@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 CHANGED
@@ -501,6 +501,8 @@ const bookmark = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns=
501
501
  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";
502
502
  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";
503
503
  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";
504
+ 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";
505
+ 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";
504
506
  const icons = {
505
507
  // 箭头类
506
508
  "arrow-down": arrowDown,
@@ -608,7 +610,10 @@ const icons = {
608
610
  "code": code,
609
611
  "clock": clock,
610
612
  "time": clock,
611
- "calendar": clock
613
+ "calendar": clock,
614
+ // 位置和扫码
615
+ "location": location,
616
+ "scan": scan
612
617
  };
613
618
  function getIcon(name) {
614
619
  return icons[name];
@@ -650,7 +655,24 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
650
655
  return !!getIcon(props.name);
651
656
  });
652
657
  const iconSrc = vue.computed(() => {
653
- return getIcon(props.name);
658
+ const svgData = getIcon(props.name);
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;
654
676
  });
655
677
  const sizePx = vue.computed(() => {
656
678
  const size = typeof props.size === "number" ? props.size : parseInt(props.size);
@@ -668,6 +690,12 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
668
690
  }
669
691
  return style;
670
692
  });
693
+ const svgStyle = vue.computed(() => {
694
+ return {
695
+ width: sizePx.value,
696
+ height: sizePx.value
697
+ };
698
+ });
671
699
  return (_ctx, _cache) => {
672
700
  return vue.openBlock(), vue.createElementBlock("view", {
673
701
  class: vue.normalizeClass(["u-icon", { "u-icon--spin": __props.spin }]),
@@ -678,14 +706,14 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
678
706
  key: 0,
679
707
  class: "u-icon__svg",
680
708
  src: iconSrc.value,
681
- style: vue.normalizeStyle({ width: sizePx.value, height: sizePx.value }),
709
+ style: vue.normalizeStyle(svgStyle.value),
682
710
  mode: "aspectFit"
683
711
  }, null, 12, _hoisted_1$A)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$q, vue.toDisplayString(__props.name), 1))
684
712
  ], 6);
685
713
  };
686
714
  }
687
715
  });
688
- const UIcon = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-5d845d48"]]);
716
+ const UIcon = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-632e7780"]]);
689
717
  const __default__$F = {
690
718
  options: {
691
719
  virtualHost: true,