@atooyu/uxto-ui 1.1.2 → 1.1.4
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/index.js +50 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -41
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +25 -25
- package/package.json +1 -1
- package/src/components/u-icon/u-icon.vue +40 -27
- package/src/components/u-swiper/u-swiper.vue +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const _hoisted_4$g = {
|
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "u-button__icon"
|
|
16
16
|
};
|
|
17
|
-
const _hoisted_5$
|
|
17
|
+
const _hoisted_5$c = { class: "u-button__text" };
|
|
18
18
|
const __default__$L = {
|
|
19
19
|
options: {
|
|
20
20
|
virtualHost: true,
|
|
@@ -78,7 +78,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
|
78
78
|
vue.createElementVNode("view", { class: "u-button__loading-icon" }, null, -1)
|
|
79
79
|
])])) : (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$o, [
|
|
80
80
|
__props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_4$g, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true),
|
|
81
|
-
vue.createElementVNode("text", _hoisted_5$
|
|
81
|
+
vue.createElementVNode("text", _hoisted_5$c, [
|
|
82
82
|
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
83
83
|
])
|
|
84
84
|
]))
|
|
@@ -101,7 +101,7 @@ const _hoisted_1$E = {
|
|
|
101
101
|
const _hoisted_2$u = { class: "u-input__icon" };
|
|
102
102
|
const _hoisted_3$n = { class: "u-input__body" };
|
|
103
103
|
const _hoisted_4$f = ["type", "value", "placeholder", "placeholder-style", "disabled", "maxlength", "focus", "confirm-type", "adjust-position"];
|
|
104
|
-
const _hoisted_5$
|
|
104
|
+
const _hoisted_5$b = {
|
|
105
105
|
key: 2,
|
|
106
106
|
class: "u-input__suffix"
|
|
107
107
|
};
|
|
@@ -194,7 +194,7 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
|
194
194
|
}, [..._cache[0] || (_cache[0] = [
|
|
195
195
|
vue.createElementVNode("text", { class: "u-input__clear-icon" }, "×", -1)
|
|
196
196
|
])])) : vue.createCommentVNode("", true),
|
|
197
|
-
_ctx.$slots.suffix || __props.suffixIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_5$
|
|
197
|
+
_ctx.$slots.suffix || __props.suffixIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_5$b, [
|
|
198
198
|
vue.renderSlot(_ctx.$slots, "suffix", {}, () => [
|
|
199
199
|
vue.createElementVNode("text", _hoisted_6$7, vue.toDisplayString(__props.suffixIcon), 1)
|
|
200
200
|
], true)
|
|
@@ -211,7 +211,7 @@ const _hoisted_2$t = {
|
|
|
211
211
|
};
|
|
212
212
|
const _hoisted_3$m = ["src"];
|
|
213
213
|
const _hoisted_4$e = { class: "u-cell__content" };
|
|
214
|
-
const _hoisted_5$
|
|
214
|
+
const _hoisted_5$a = { class: "u-cell__title" };
|
|
215
215
|
const _hoisted_6$6 = { class: "u-cell__title-text" };
|
|
216
216
|
const _hoisted_7$5 = {
|
|
217
217
|
key: 0,
|
|
@@ -279,7 +279,7 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
|
279
279
|
], true)
|
|
280
280
|
])) : vue.createCommentVNode("", true),
|
|
281
281
|
vue.createElementVNode("view", _hoisted_4$e, [
|
|
282
|
-
vue.createElementVNode("view", _hoisted_5$
|
|
282
|
+
vue.createElementVNode("view", _hoisted_5$a, [
|
|
283
283
|
vue.createElementVNode("text", _hoisted_6$6, vue.toDisplayString(__props.title), 1),
|
|
284
284
|
__props.label ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_7$5, vue.toDisplayString(__props.label), 1)) : vue.createCommentVNode("", true)
|
|
285
285
|
]),
|
|
@@ -339,7 +339,7 @@ const _hoisted_1$B = {
|
|
|
339
339
|
const _hoisted_2$r = { class: "u-modal__title" };
|
|
340
340
|
const _hoisted_3$k = { class: "u-modal__body" };
|
|
341
341
|
const _hoisted_4$d = { class: "u-modal__message" };
|
|
342
|
-
const _hoisted_5$
|
|
342
|
+
const _hoisted_5$9 = { class: "u-modal__footer" };
|
|
343
343
|
const __default__$H = {
|
|
344
344
|
options: {
|
|
345
345
|
virtualHost: true,
|
|
@@ -394,7 +394,7 @@ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
|
394
394
|
vue.createElementVNode("text", _hoisted_4$d, vue.toDisplayString(__props.message), 1)
|
|
395
395
|
], true)
|
|
396
396
|
]),
|
|
397
|
-
vue.createElementVNode("view", _hoisted_5$
|
|
397
|
+
vue.createElementVNode("view", _hoisted_5$9, [
|
|
398
398
|
__props.showCancel ? (vue.openBlock(), vue.createElementBlock("view", {
|
|
399
399
|
key: 0,
|
|
400
400
|
class: "u-modal__button u-modal__button--cancel",
|
|
@@ -655,29 +655,33 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
|
655
655
|
return !!getIcon(props.name);
|
|
656
656
|
});
|
|
657
657
|
const iconSrc = vue.computed(() => {
|
|
658
|
-
|
|
659
|
-
if (!svgData) return "";
|
|
660
|
-
if (props.color && svgData.startsWith("data:image/svg+xml")) {
|
|
661
|
-
try {
|
|
662
|
-
let svgContent = decodeURIComponent(svgData.replace("data:image/svg+xml,", ""));
|
|
663
|
-
if (svgContent.includes('fill="currentColor"')) {
|
|
664
|
-
svgContent = svgContent.replace(/fill="currentColor"/g, `fill="${props.color}"`);
|
|
665
|
-
} else if (!svgContent.includes("fill=")) {
|
|
666
|
-
svgContent = svgContent.replace("<svg", `<svg fill="${props.color}"`);
|
|
667
|
-
} else {
|
|
668
|
-
svgContent = svgContent.replace(/fill="[^"]*"/g, `fill="${props.color}"`);
|
|
669
|
-
}
|
|
670
|
-
return "data:image/svg+xml," + encodeURIComponent(svgContent);
|
|
671
|
-
} catch (e) {
|
|
672
|
-
return svgData;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
return svgData;
|
|
658
|
+
return getIcon(props.name) || "";
|
|
676
659
|
});
|
|
677
660
|
const sizePx = vue.computed(() => {
|
|
678
661
|
const size = typeof props.size === "number" ? props.size : parseInt(props.size);
|
|
679
662
|
return size + "px";
|
|
680
663
|
});
|
|
664
|
+
const colorToFilter = (color) => {
|
|
665
|
+
const colorMap = {
|
|
666
|
+
"#ff9500": "invert(58%) sepia(97%) saturate(1833%) hue-rotate(351deg) brightness(101%) contrast(101%)",
|
|
667
|
+
"#12b6af": "invert(47%) sepia(85%) saturate(475%) hue-rotate(131deg) brightness(92%) contrast(92%)",
|
|
668
|
+
"#333333": "invert(20%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%)",
|
|
669
|
+
"#666666": "invert(45%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%)",
|
|
670
|
+
"#999999": "invert(70%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%)",
|
|
671
|
+
"#ffffff": "invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%)",
|
|
672
|
+
"#ff4d4f": "invert(46%) sepia(98%) saturate(1925%) hue-rotate(335deg) brightness(101%) contrast(101%)"
|
|
673
|
+
};
|
|
674
|
+
const lowerColor = color.toLowerCase();
|
|
675
|
+
if (colorMap[lowerColor]) {
|
|
676
|
+
return colorMap[lowerColor];
|
|
677
|
+
}
|
|
678
|
+
const hex = color.replace("#", "");
|
|
679
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
680
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
681
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
682
|
+
const hue = Math.atan2(Math.sqrt(3) * (g - b), 2 * r - g - b) * 180 / Math.PI;
|
|
683
|
+
return `invert(1) sepia(1) saturate(10000%) hue-rotate(${hue}deg)`;
|
|
684
|
+
};
|
|
681
685
|
const iconStyle = vue.computed(() => {
|
|
682
686
|
const size = typeof props.size === "number" ? props.size : parseInt(props.size);
|
|
683
687
|
const style = {
|
|
@@ -685,6 +689,9 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
|
685
689
|
width: size + "px",
|
|
686
690
|
height: size + "px"
|
|
687
691
|
};
|
|
692
|
+
if (props.color && isSvgIcon.value) {
|
|
693
|
+
style.filter = colorToFilter(props.color);
|
|
694
|
+
}
|
|
688
695
|
if (props.color && !isSvgIcon.value) {
|
|
689
696
|
style.color = props.color;
|
|
690
697
|
}
|
|
@@ -713,7 +720,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
|
713
720
|
};
|
|
714
721
|
}
|
|
715
722
|
});
|
|
716
|
-
const UIcon = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-
|
|
723
|
+
const UIcon = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-535b2661"]]);
|
|
717
724
|
const __default__$F = {
|
|
718
725
|
options: {
|
|
719
726
|
virtualHost: true,
|
|
@@ -2065,7 +2072,7 @@ const _hoisted_4$c = {
|
|
|
2065
2072
|
key: 0,
|
|
2066
2073
|
class: "u-grid-item__badge"
|
|
2067
2074
|
};
|
|
2068
|
-
const _hoisted_5$
|
|
2075
|
+
const _hoisted_5$8 = { class: "u-grid-item__badge-text" };
|
|
2069
2076
|
const _hoisted_6$5 = {
|
|
2070
2077
|
key: 1,
|
|
2071
2078
|
class: "u-grid-item__text"
|
|
@@ -2135,7 +2142,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
|
2135
2142
|
}, null, 8, _hoisted_2$i)) : __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$f, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true)
|
|
2136
2143
|
], true),
|
|
2137
2144
|
__props.badge !== void 0 && __props.badge !== null && __props.badge !== "" ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_4$c, [
|
|
2138
|
-
vue.createElementVNode("text", _hoisted_5$
|
|
2145
|
+
vue.createElementVNode("text", _hoisted_5$8, vue.toDisplayString(__props.badge), 1)
|
|
2139
2146
|
])) : vue.createCommentVNode("", true)
|
|
2140
2147
|
])) : vue.createCommentVNode("", true),
|
|
2141
2148
|
__props.text || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_6$5, [
|
|
@@ -2148,17 +2155,16 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
|
2148
2155
|
}
|
|
2149
2156
|
});
|
|
2150
2157
|
const uGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-de6f40c1"]]);
|
|
2151
|
-
const _hoisted_1$l = {
|
|
2152
|
-
const _hoisted_2$h = {
|
|
2158
|
+
const _hoisted_1$l = {
|
|
2153
2159
|
key: 0,
|
|
2154
2160
|
class: "u-swiper__loading"
|
|
2155
2161
|
};
|
|
2156
|
-
const
|
|
2162
|
+
const _hoisted_2$h = {
|
|
2157
2163
|
key: 1,
|
|
2158
2164
|
class: "u-swiper__title"
|
|
2159
2165
|
};
|
|
2160
|
-
const
|
|
2161
|
-
const
|
|
2166
|
+
const _hoisted_3$e = { class: "u-swiper__title-text" };
|
|
2167
|
+
const _hoisted_4$b = {
|
|
2162
2168
|
key: 2,
|
|
2163
2169
|
class: "u-swiper__indicator"
|
|
2164
2170
|
};
|
|
@@ -2261,7 +2267,10 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
2261
2267
|
});
|
|
2262
2268
|
return (_ctx, _cache) => {
|
|
2263
2269
|
const _component_swiper = vue.resolveComponent("swiper");
|
|
2264
|
-
return vue.openBlock(), vue.createElementBlock("view",
|
|
2270
|
+
return vue.openBlock(), vue.createElementBlock("view", {
|
|
2271
|
+
class: "u-swiper",
|
|
2272
|
+
style: vue.normalizeStyle({ "--swiper-height": swiperHeight.value })
|
|
2273
|
+
}, [
|
|
2265
2274
|
vue.createVNode(_component_swiper, {
|
|
2266
2275
|
class: "u-swiper__wrapper",
|
|
2267
2276
|
autoplay: __props.autoplay,
|
|
@@ -2281,13 +2290,13 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
2281
2290
|
]),
|
|
2282
2291
|
_: 3
|
|
2283
2292
|
}, 8, ["autoplay", "interval", "duration", "indicator-dots", "indicator-color", "indicator-active-color", "circular", "vertical", "current"]),
|
|
2284
|
-
__props.loading ? (vue.openBlock(), vue.createElementBlock("view",
|
|
2293
|
+
__props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$l, [..._cache[0] || (_cache[0] = [
|
|
2285
2294
|
vue.createElementVNode("view", { class: "u-swiper__loading-icon" }, null, -1)
|
|
2286
2295
|
])])) : vue.createCommentVNode("", true),
|
|
2287
|
-
__props.showTitle && currentTitle.value ? (vue.openBlock(), vue.createElementBlock("view",
|
|
2288
|
-
vue.createElementVNode("text",
|
|
2296
|
+
__props.showTitle && currentTitle.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$h, [
|
|
2297
|
+
vue.createElementVNode("text", _hoisted_3$e, vue.toDisplayString(currentTitle.value), 1)
|
|
2289
2298
|
])) : vue.createCommentVNode("", true),
|
|
2290
|
-
showIndicator.value && indicatorSlot.value ? (vue.openBlock(), vue.createElementBlock("view",
|
|
2299
|
+
showIndicator.value && indicatorSlot.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_4$b, [
|
|
2291
2300
|
vue.renderSlot(_ctx.$slots, "indicator", {
|
|
2292
2301
|
current: currentIndex.value,
|
|
2293
2302
|
total: itemCount.value
|
|
@@ -2305,11 +2314,11 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
2305
2314
|
}, null, 2);
|
|
2306
2315
|
}), 128))
|
|
2307
2316
|
], 6)) : vue.createCommentVNode("", true)
|
|
2308
|
-
]);
|
|
2317
|
+
], 4);
|
|
2309
2318
|
};
|
|
2310
2319
|
}
|
|
2311
2320
|
});
|
|
2312
|
-
const uSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-
|
|
2321
|
+
const uSwiper = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-58aa8214"]]);
|
|
2313
2322
|
const __default__$o = {
|
|
2314
2323
|
options: {
|
|
2315
2324
|
virtualHost: true,
|