@idds/vue 1.4.17 → 1.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CircleProgressBar.vue.d.ts +2 -2
- package/dist/components/CircleProgressBar.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.es.js +25 -33
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1590,7 +1590,7 @@ declare const _default: {
|
|
|
1590
1590
|
}>> & Readonly<{}>, {
|
|
1591
1591
|
progress: number;
|
|
1592
1592
|
className: string;
|
|
1593
|
-
variant: "primary" | "secondary" | "
|
|
1593
|
+
variant: "primary" | "secondary" | "positive" | "warning" | "negative" | string;
|
|
1594
1594
|
diameter: number;
|
|
1595
1595
|
strokeWidth: number;
|
|
1596
1596
|
trackColor: string;
|
|
@@ -5937,7 +5937,7 @@ declare const _default: {
|
|
|
5937
5937
|
}> | import('vue').Component>;
|
|
5938
5938
|
};
|
|
5939
5939
|
state: {
|
|
5940
|
-
type: import('vue').PropType<"default" | "
|
|
5940
|
+
type: import('vue').PropType<"default" | "positive" | "destructive">;
|
|
5941
5941
|
default: string;
|
|
5942
5942
|
};
|
|
5943
5943
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
@@ -5982,7 +5982,7 @@ declare const _default: {
|
|
|
5982
5982
|
}> | import('vue').Component>;
|
|
5983
5983
|
};
|
|
5984
5984
|
state: {
|
|
5985
|
-
type: import('vue').PropType<"default" | "
|
|
5985
|
+
type: import('vue').PropType<"default" | "positive" | "destructive">;
|
|
5986
5986
|
default: string;
|
|
5987
5987
|
};
|
|
5988
5988
|
}>> & Readonly<{}>, {
|
package/dist/index.es.js
CHANGED
|
@@ -2784,9 +2784,9 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
2784
2784
|
};
|
|
2785
2785
|
}
|
|
2786
2786
|
});
|
|
2787
|
-
const _hoisted_1$w = ["
|
|
2788
|
-
const _hoisted_2$t = ["cx", "cy", "r", "stroke
|
|
2789
|
-
const _hoisted_3$r = ["cx", "cy", "r", "stroke
|
|
2787
|
+
const _hoisted_1$w = ["viewBox"];
|
|
2788
|
+
const _hoisted_2$t = ["cx", "cy", "r", "stroke-width"];
|
|
2789
|
+
const _hoisted_3$r = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke-dashoffset"];
|
|
2790
2790
|
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
2791
2791
|
__name: "CircleProgressBar",
|
|
2792
2792
|
props: {
|
|
@@ -2799,66 +2799,58 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
2799
2799
|
},
|
|
2800
2800
|
setup(__props) {
|
|
2801
2801
|
const props = __props;
|
|
2802
|
-
const VARIANT_MAP = {
|
|
2803
|
-
primary: "var(--ina-primary-500)",
|
|
2804
|
-
secondary: "var(--ina-secondary-500)",
|
|
2805
|
-
success: "var(--ina-success-500)",
|
|
2806
|
-
warning: "var(--ina-warning-500)",
|
|
2807
|
-
error: "var(--ina-error-500)"
|
|
2808
|
-
};
|
|
2809
2802
|
const normalizedProgress = computed(
|
|
2810
2803
|
() => Math.min(100, Math.max(0, props.progress))
|
|
2811
2804
|
);
|
|
2812
|
-
const strokeColor = computed(() => {
|
|
2813
|
-
const isHex = props.variant.startsWith("#");
|
|
2814
|
-
return isHex ? props.variant : VARIANT_MAP[props.variant] || VARIANT_MAP.primary;
|
|
2815
|
-
});
|
|
2816
2805
|
const center = computed(() => props.diameter / 2);
|
|
2817
2806
|
const radius = computed(() => (props.diameter - props.strokeWidth) / 2);
|
|
2818
2807
|
const circumference = computed(() => 2 * Math.PI * radius.value);
|
|
2819
2808
|
const strokeDashoffset = computed(
|
|
2820
2809
|
() => circumference.value - normalizedProgress.value / 100 * circumference.value
|
|
2821
2810
|
);
|
|
2811
|
+
const isCustomColor = computed(() => props.variant.startsWith("#"));
|
|
2822
2812
|
const containerClasses = computed(() => {
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2813
|
+
const variantClass = !isCustomColor.value ? `ina-circle-progress-bar--${props.variant}` : "";
|
|
2814
|
+
return ["ina-circle-progress-bar", variantClass, props.className].filter(Boolean).join(" ");
|
|
2815
|
+
});
|
|
2816
|
+
const containerStyle = computed(() => {
|
|
2817
|
+
const style = {
|
|
2818
|
+
"--ina-circle-progress-size": `${props.diameter}px`
|
|
2819
|
+
};
|
|
2820
|
+
if (props.trackColor) {
|
|
2821
|
+
style["--ina-circle-progress-track-color"] = props.trackColor;
|
|
2822
|
+
}
|
|
2823
|
+
if (isCustomColor.value) {
|
|
2824
|
+
style["--ina-circle-progress-color"] = props.variant;
|
|
2825
|
+
}
|
|
2826
|
+
return style;
|
|
2828
2827
|
});
|
|
2829
|
-
const containerStyle = computed(() => ({
|
|
2830
|
-
width: `${props.diameter}px`,
|
|
2831
|
-
height: `${props.diameter}px`
|
|
2832
|
-
}));
|
|
2833
2828
|
return (_ctx, _cache) => {
|
|
2834
2829
|
return openBlock(), createElementBlock("div", {
|
|
2835
2830
|
class: normalizeClass(containerClasses.value),
|
|
2836
2831
|
style: normalizeStyle(containerStyle.value)
|
|
2837
2832
|
}, [
|
|
2838
2833
|
(openBlock(), createElementBlock("svg", {
|
|
2839
|
-
|
|
2840
|
-
|
|
2834
|
+
class: "ina-circle-progress-bar__svg",
|
|
2835
|
+
width: "100%",
|
|
2836
|
+
height: "100%",
|
|
2841
2837
|
viewBox: `0 0 ${__props.diameter} ${__props.diameter}`,
|
|
2842
2838
|
fill: "none",
|
|
2843
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2844
|
-
style: { "transform": "rotate(-90deg)" }
|
|
2839
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2845
2840
|
}, [
|
|
2846
2841
|
createElementVNode("circle", {
|
|
2842
|
+
class: "ina-circle-progress-bar__track",
|
|
2847
2843
|
cx: center.value,
|
|
2848
2844
|
cy: center.value,
|
|
2849
2845
|
r: radius.value,
|
|
2850
|
-
stroke: __props.
|
|
2851
|
-
"stroke-width": __props.strokeWidth,
|
|
2852
|
-
fill: "none"
|
|
2846
|
+
"stroke-width": __props.strokeWidth
|
|
2853
2847
|
}, null, 8, _hoisted_2$t),
|
|
2854
2848
|
createElementVNode("circle", {
|
|
2849
|
+
class: "ina-circle-progress-bar__progress",
|
|
2855
2850
|
cx: center.value,
|
|
2856
2851
|
cy: center.value,
|
|
2857
2852
|
r: radius.value,
|
|
2858
|
-
stroke: strokeColor.value,
|
|
2859
2853
|
"stroke-width": __props.strokeWidth,
|
|
2860
|
-
fill: "none",
|
|
2861
|
-
"stroke-linecap": "round",
|
|
2862
2854
|
"stroke-dasharray": circumference.value,
|
|
2863
2855
|
"stroke-dashoffset": strokeDashoffset.value
|
|
2864
2856
|
}, null, 8, _hoisted_3$r)
|