style: update progress
parent
dc21ce5346
commit
c9188ec276
|
@ -13,6 +13,14 @@ function getPercentage({ percent, success, successPercent }: CircleProps) {
|
||||||
return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];
|
return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getStrokeColor({
|
||||||
|
success = {},
|
||||||
|
strokeColor,
|
||||||
|
}: Partial<CircleProps>): (string | Record<string, string>)[] {
|
||||||
|
const { strokeColor: successColor } = success;
|
||||||
|
return [successColor || presetPrimaryColors.green, strokeColor || null!];
|
||||||
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: progressProps(),
|
props: progressProps(),
|
||||||
|
@ -43,12 +51,13 @@ export default defineComponent({
|
||||||
);
|
);
|
||||||
|
|
||||||
// using className to style stroke color
|
// using className to style stroke color
|
||||||
const strokeColor = computed(() => [presetPrimaryColors.green, props.strokeColor || null]);
|
|
||||||
const percent = computed(() => getPercentage(props));
|
const percent = computed(() => getPercentage(props));
|
||||||
const isGradient = computed(
|
const isGradient = computed(
|
||||||
() => Object.prototype.toString.call(props.strokeColor) === '[object Object]',
|
() => Object.prototype.toString.call(props.strokeColor) === '[object Object]',
|
||||||
);
|
);
|
||||||
|
const strokeColor = computed(() =>
|
||||||
|
getStrokeColor({ success: props.success, strokeColor: props.strokeColor }),
|
||||||
|
);
|
||||||
const wrapperClassName = computed(() => ({
|
const wrapperClassName = computed(() => ({
|
||||||
[`${props.prefixCls}-inner`]: true,
|
[`${props.prefixCls}-inner`]: true,
|
||||||
[`${props.prefixCls}-circle-gradient`]: isGradient.value,
|
[`${props.prefixCls}-circle-gradient`]: isGradient.value,
|
||||||
|
|
|
@ -16,11 +16,13 @@
|
||||||
|
|
||||||
&-steps {
|
&-steps {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
&-outer {
|
&-outer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-item {
|
&-item {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
min-width: 2px;
|
min-width: 2px;
|
||||||
|
@ -180,6 +182,7 @@
|
||||||
color: @error-color;
|
color: @error-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-circle&-status-success {
|
&-circle&-status-success {
|
||||||
.@{progress-prefix-cls}-text {
|
.@{progress-prefix-cls}-text {
|
||||||
color: @success-color;
|
color: @success-color;
|
||||||
|
@ -192,10 +195,12 @@
|
||||||
transform: translateX(-100%) scaleX(0);
|
transform: translateX(-100%) scaleX(0);
|
||||||
opacity: 0.1;
|
opacity: 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
20% {
|
20% {
|
||||||
transform: translateX(-100%) scaleX(0);
|
transform: translateX(-100%) scaleX(0);
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
transform: translateX(0) scaleX(1);
|
transform: translateX(0) scaleX(1);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
Loading…
Reference in New Issue