@atooyu/uxto-ui 1.1.0 → 1.1.2
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 +32 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -4
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +6 -6
- package/package.json +1 -1
- package/src/components/u-icon/icons/location.svg +3 -0
- package/src/components/u-icon/icons/scan.svg +3 -0
- package/src/components/u-icon/index.ts +6 -0
- package/src/components/u-icon/u-icon.vue +38 -5
package/dist/index.mjs
CHANGED
|
@@ -499,6 +499,8 @@ const bookmark = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns=
|
|
|
499
499
|
const bookmarkO = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='currentColor'%20d='M17%203H7c-1.1%200-1.99.9-1.99%202L5%2021l7-3%207%203V5c0-1.1-.9-2-2-2zm0%2015l-5-2.18L7%2018V5h10v13z'/%3e%3c/svg%3e";
|
|
500
500
|
const chat = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='currentColor'%20d='M20%202H4c-1.1%200-2%20.9-2%202v18l4-4h14c1.1%200%202-.9%202-2V4c0-1.1-.9-2-2-2zm0%2014H6l-2%202V4h16v12z'/%3e%3c/svg%3e";
|
|
501
501
|
const clipboard = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='currentColor'%20d='M19%203h-4.18C14.4%201.84%2013.3%201%2012%201c-1.3%200-2.4.84-2.82%202H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2V5c0-1.1-.9-2-2-2zm-7%200c.55%200%201%20.45%201%201s-.45%201-1%201-1-.45-1-1%20.45-1%201-1zm2%2014H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z'/%3e%3c/svg%3e";
|
|
502
|
+
const location = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%3e%3cpath%20d='M12%202C8.13%202%205%205.13%205%209c0%205.25%207%2013%207%2013s7-7.75%207-13c0-3.87-3.13-7-7-7zm0%209.5c-1.38%200-2.5-1.12-2.5-2.5s1.12-2.5%202.5-2.5%202.5%201.12%202.5%202.5-1.12%202.5-2.5%202.5z'/%3e%3c/svg%3e";
|
|
503
|
+
const scan = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%3e%3cpath%20d='M3%2011h8V3H3v8zm2-6h4v4H5V5zm8-2v8h8V3h-8zm6%206h-4V5h4v4zM3%2021h8v-8H3v8zm2-6h4v4H5v-4zm13-2h-2v3h-3v2h3v3h2v-3h3v-2h-3v-3z'/%3e%3c/svg%3e";
|
|
502
504
|
const icons = {
|
|
503
505
|
// 箭头类
|
|
504
506
|
"arrow-down": arrowDown,
|
|
@@ -606,7 +608,10 @@ const icons = {
|
|
|
606
608
|
"code": code,
|
|
607
609
|
"clock": clock,
|
|
608
610
|
"time": clock,
|
|
609
|
-
"calendar": clock
|
|
611
|
+
"calendar": clock,
|
|
612
|
+
// 位置和扫码
|
|
613
|
+
"location": location,
|
|
614
|
+
"scan": scan
|
|
610
615
|
};
|
|
611
616
|
function getIcon(name) {
|
|
612
617
|
return icons[name];
|
|
@@ -648,7 +653,24 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
648
653
|
return !!getIcon(props.name);
|
|
649
654
|
});
|
|
650
655
|
const iconSrc = computed(() => {
|
|
651
|
-
|
|
656
|
+
const svgData = getIcon(props.name);
|
|
657
|
+
if (!svgData) return "";
|
|
658
|
+
if (props.color && svgData.startsWith("data:image/svg+xml")) {
|
|
659
|
+
try {
|
|
660
|
+
let svgContent = decodeURIComponent(svgData.replace("data:image/svg+xml,", ""));
|
|
661
|
+
if (svgContent.includes('fill="currentColor"')) {
|
|
662
|
+
svgContent = svgContent.replace(/fill="currentColor"/g, `fill="${props.color}"`);
|
|
663
|
+
} else if (!svgContent.includes("fill=")) {
|
|
664
|
+
svgContent = svgContent.replace("<svg", `<svg fill="${props.color}"`);
|
|
665
|
+
} else {
|
|
666
|
+
svgContent = svgContent.replace(/fill="[^"]*"/g, `fill="${props.color}"`);
|
|
667
|
+
}
|
|
668
|
+
return "data:image/svg+xml," + encodeURIComponent(svgContent);
|
|
669
|
+
} catch (e) {
|
|
670
|
+
return svgData;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
return svgData;
|
|
652
674
|
});
|
|
653
675
|
const sizePx = computed(() => {
|
|
654
676
|
const size = typeof props.size === "number" ? props.size : parseInt(props.size);
|
|
@@ -666,6 +688,12 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
666
688
|
}
|
|
667
689
|
return style;
|
|
668
690
|
});
|
|
691
|
+
const svgStyle = computed(() => {
|
|
692
|
+
return {
|
|
693
|
+
width: sizePx.value,
|
|
694
|
+
height: sizePx.value
|
|
695
|
+
};
|
|
696
|
+
});
|
|
669
697
|
return (_ctx, _cache) => {
|
|
670
698
|
return openBlock(), createElementBlock("view", {
|
|
671
699
|
class: normalizeClass(["u-icon", { "u-icon--spin": __props.spin }]),
|
|
@@ -676,14 +704,14 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
676
704
|
key: 0,
|
|
677
705
|
class: "u-icon__svg",
|
|
678
706
|
src: iconSrc.value,
|
|
679
|
-
style: normalizeStyle(
|
|
707
|
+
style: normalizeStyle(svgStyle.value),
|
|
680
708
|
mode: "aspectFit"
|
|
681
709
|
}, null, 12, _hoisted_1$A)) : (openBlock(), createElementBlock("text", _hoisted_2$q, toDisplayString(__props.name), 1))
|
|
682
710
|
], 6);
|
|
683
711
|
};
|
|
684
712
|
}
|
|
685
713
|
});
|
|
686
|
-
const UIcon = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-
|
|
714
|
+
const UIcon = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-632e7780"]]);
|
|
687
715
|
const __default__$F = {
|
|
688
716
|
options: {
|
|
689
717
|
virtualHost: true,
|