@loafacto/ui 0.16.2 → 0.16.3

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.
@@ -1,4 +1,4 @@
1
- import type { Component } from 'vue';
1
+ import { type Component } from 'vue';
2
2
  import type { RailItem } from '../types';
3
3
  type __VLS_Props = {
4
4
  items: RailItem[];
package/dist/index.js CHANGED
@@ -206,7 +206,7 @@ const _hoisted_4$j = ["href", "aria-label"];
206
206
  const _hoisted_5$f = ["src"];
207
207
  const _hoisted_6$b = { class: "lf-brand__name" };
208
208
  const _hoisted_7$a = ["aria-expanded"];
209
- const _hoisted_8$5 = {
209
+ const _hoisted_8$4 = {
210
210
  key: 0,
211
211
  class: "lf-switcher__menu",
212
212
  role: "menu"
@@ -469,7 +469,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
469
469
  ], 8, _hoisted_7$a),
470
470
  createVNode(Transition, { name: "lf-shell-menu" }, {
471
471
  default: withCtx(() => [
472
- switcherOpen.value ? (openBlock(), createElementBlock("div", _hoisted_8$5, [
472
+ switcherOpen.value ? (openBlock(), createElementBlock("div", _hoisted_8$4, [
473
473
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.services, (svc) => {
474
474
  return openBlock(), createElementBlock("a", {
475
475
  key: svc.id,
@@ -675,7 +675,7 @@ const _hoisted_7$9 = {
675
675
  viewBox: "0 0 24 24",
676
676
  "aria-hidden": "true"
677
677
  };
678
- const _hoisted_8$4 = ["d"];
678
+ const _hoisted_8$3 = ["d"];
679
679
  const _sfc_main$x = /* @__PURE__ */ defineComponent({
680
680
  __name: "AppToast",
681
681
  setup(__props) {
@@ -735,7 +735,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
735
735
  createElementVNode("path", {
736
736
  d: ICON_PATHS.close,
737
737
  fill: "currentColor"
738
- }, null, 8, _hoisted_8$4)
738
+ }, null, 8, _hoisted_8$3)
739
739
  ]))
740
740
  ], 8, _hoisted_6$a)
741
741
  ], 10, _hoisted_2$q);
@@ -861,7 +861,7 @@ const _hoisted_7$8 = {
861
861
  key: 0,
862
862
  class: "app-confirm__require"
863
863
  };
864
- const _hoisted_8$3 = { class: "app-confirm__require-label" };
864
+ const _hoisted_8$2 = { class: "app-confirm__require-label" };
865
865
  const _hoisted_9$1 = { class: "app-confirm__actions" };
866
866
  const _hoisted_10$1 = ["disabled"];
867
867
  const _sfc_main$v = /* @__PURE__ */ defineComponent({
@@ -897,7 +897,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
897
897
  createElementVNode("div", _hoisted_5$d, [
898
898
  createElementVNode("p", _hoisted_6$9, toDisplayString(unref(store).message), 1),
899
899
  unref(store).requireText ? (openBlock(), createElementBlock("label", _hoisted_7$8, [
900
- createElementVNode("span", _hoisted_8$3, [
900
+ createElementVNode("span", _hoisted_8$2, [
901
901
  createTextVNode(toDisplayString(unref(store).requireLabel || "확인을 위해 입력") + ": ", 1),
902
902
  createElementVNode("code", null, toDisplayString(unref(store).requireText), 1)
903
903
  ]),
@@ -1630,7 +1630,7 @@ const _hoisted_7$7 = {
1630
1630
  class: "lf-radio-group__error",
1631
1631
  role: "alert"
1632
1632
  };
1633
- const _hoisted_8$2 = {
1633
+ const _hoisted_8$1 = {
1634
1634
  key: 2,
1635
1635
  class: "lf-radio-group__hint"
1636
1636
  };
@@ -1689,7 +1689,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1689
1689
  ])
1690
1690
  ], 2);
1691
1691
  }), 128)),
1692
- __props.error ? (openBlock(), createElementBlock("p", _hoisted_7$7, toDisplayString(__props.error), 1)) : __props.hint ? (openBlock(), createElementBlock("p", _hoisted_8$2, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
1692
+ __props.error ? (openBlock(), createElementBlock("p", _hoisted_7$7, toDisplayString(__props.error), 1)) : __props.hint ? (openBlock(), createElementBlock("p", _hoisted_8$1, toDisplayString(__props.hint), 1)) : createCommentVNode("", true)
1693
1693
  ], 2);
1694
1694
  };
1695
1695
  }
@@ -2722,21 +2722,20 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2722
2722
  }
2723
2723
  });
2724
2724
  const LfMenu = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-0318782c"]]);
2725
- const _hoisted_1$4 = { class: "lf-rail__list" };
2726
- const _hoisted_2$4 = {
2725
+ const _hoisted_1$4 = {
2727
2726
  key: 0,
2728
2727
  class: "lf-rail__group",
2729
2728
  role: "presentation"
2730
2729
  };
2731
- const _hoisted_3$3 = { class: "lf-rail__group-name" };
2732
- const _hoisted_4$2 = { class: "lf-rail__icon" };
2733
- const _hoisted_5$1 = {
2730
+ const _hoisted_2$4 = { class: "lf-rail__group-name" };
2731
+ const _hoisted_3$3 = { class: "lf-rail__icon" };
2732
+ const _hoisted_4$2 = {
2734
2733
  key: 2,
2735
2734
  class: "lf-rail__badge"
2736
2735
  };
2737
- const _hoisted_6$1 = { class: "lf-rail__name" };
2738
- const _hoisted_7$1 = { class: "lf-rail__short" };
2739
- const _hoisted_8$1 = { class: "lf-rail__long" };
2736
+ const _hoisted_5$1 = { class: "lf-rail__name" };
2737
+ const _hoisted_6$1 = { class: "lf-rail__short" };
2738
+ const _hoisted_7$1 = { class: "lf-rail__long" };
2740
2739
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2741
2740
  __name: "LfNavRail",
2742
2741
  props: {
@@ -2751,19 +2750,60 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2751
2750
  function linkAttrs(item) {
2752
2751
  return props.link === "a" ? { href: item.to } : { to: item.to };
2753
2752
  }
2753
+ const list = useTemplateRef("list");
2754
+ const thumb = ref(null);
2755
+ function measure() {
2756
+ var _a;
2757
+ const el = (_a = list.value) == null ? void 0 : _a.querySelector(".lf-rail__link--active, .lf-rail__link.router-link-active");
2758
+ const next = el ? { x: el.offsetLeft, y: el.offsetTop, w: el.offsetWidth, h: el.offsetHeight } : null;
2759
+ const cur = thumb.value;
2760
+ if (cur && next && cur.x === next.x && cur.y === next.y && cur.w === next.w && cur.h === next.h) return;
2761
+ thumb.value = next;
2762
+ }
2763
+ let mo = null;
2764
+ let ro = null;
2765
+ onMounted(() => {
2766
+ measure();
2767
+ if (!list.value) return;
2768
+ if (typeof MutationObserver !== "undefined") {
2769
+ mo = new MutationObserver(() => measure());
2770
+ mo.observe(list.value, { subtree: true, attributes: true, attributeFilter: ["class"] });
2771
+ }
2772
+ if (typeof ResizeObserver !== "undefined") {
2773
+ ro = new ResizeObserver(() => measure());
2774
+ ro.observe(list.value);
2775
+ }
2776
+ });
2777
+ onBeforeUnmount(() => {
2778
+ mo == null ? void 0 : mo.disconnect();
2779
+ ro == null ? void 0 : ro.disconnect();
2780
+ });
2781
+ watch(() => [props.current, props.items.length], () => {
2782
+ void nextTick(measure);
2783
+ });
2754
2784
  function isActive(item) {
2755
2785
  if (props.current === void 0) return false;
2756
2786
  return props.current === item.to || props.current.startsWith(`${item.to}/`);
2757
2787
  }
2758
2788
  return (_ctx, _cache) => {
2759
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
2789
+ return openBlock(), createElementBlock("div", {
2790
+ ref_key: "list",
2791
+ ref: list,
2792
+ class: normalizeClass(["lf-rail__list", { "lf-rail__list--thumb": thumb.value }])
2793
+ }, [
2794
+ thumb.value ? (openBlock(), createElementBlock("span", {
2795
+ key: 0,
2796
+ class: "lf-rail__thumb",
2797
+ style: normalizeStyle({ transform: `translate(${thumb.value.x}px, ${thumb.value.y}px)`, width: `${thumb.value.w}px`, height: `${thumb.value.h}px` }),
2798
+ "aria-hidden": "true"
2799
+ }, null, 4)) : createCommentVNode("", true),
2760
2800
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
2761
2801
  var _a;
2762
2802
  return openBlock(), createElementBlock(Fragment, {
2763
2803
  key: item.to
2764
2804
  }, [
2765
- item.group && item.group !== ((_a = __props.items[index - 1]) == null ? void 0 : _a.group) ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
2766
- createElementVNode("span", _hoisted_3$3, toDisplayString(item.group), 1)
2805
+ item.group && item.group !== ((_a = __props.items[index - 1]) == null ? void 0 : _a.group) ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
2806
+ createElementVNode("span", _hoisted_2$4, toDisplayString(item.group), 1)
2767
2807
  ])) : createCommentVNode("", true),
2768
2808
  (openBlock(), createBlock(resolveDynamicComponent(__props.link), mergeProps({ ref_for: true }, linkAttrs(item), {
2769
2809
  class: ["lf-rail__link", { "lf-rail__link--active": isActive(item), "lf-rail__link--bottom": item.bottom }],
@@ -2772,7 +2812,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2772
2812
  onClick: ($event) => emit("navigate", item)
2773
2813
  }), {
2774
2814
  default: withCtx(() => [
2775
- createElementVNode("span", _hoisted_4$2, [
2815
+ createElementVNode("span", _hoisted_3$3, [
2776
2816
  item.iconPath ? (openBlock(), createBlock(LfIcon, {
2777
2817
  key: 0,
2778
2818
  path: item.iconPath,
@@ -2782,22 +2822,22 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2782
2822
  name: item.icon,
2783
2823
  size: "1.15rem"
2784
2824
  }, null, 8, ["name"])) : createCommentVNode("", true),
2785
- item.badge ? (openBlock(), createElementBlock("span", _hoisted_5$1, toDisplayString(item.badge), 1)) : createCommentVNode("", true)
2825
+ item.badge ? (openBlock(), createElementBlock("span", _hoisted_4$2, toDisplayString(item.badge), 1)) : createCommentVNode("", true)
2786
2826
  ]),
2787
- createElementVNode("span", _hoisted_6$1, [
2788
- createElementVNode("span", _hoisted_7$1, toDisplayString(item.short ?? item.label), 1),
2789
- createElementVNode("span", _hoisted_8$1, toDisplayString(item.label), 1)
2827
+ createElementVNode("span", _hoisted_5$1, [
2828
+ createElementVNode("span", _hoisted_6$1, toDisplayString(item.short ?? item.label), 1),
2829
+ createElementVNode("span", _hoisted_7$1, toDisplayString(item.label), 1)
2790
2830
  ])
2791
2831
  ]),
2792
2832
  _: 2
2793
2833
  }, 1040, ["class", "title", "aria-label", "onClick"]))
2794
2834
  ], 64);
2795
2835
  }), 128))
2796
- ]);
2836
+ ], 2);
2797
2837
  };
2798
2838
  }
2799
2839
  });
2800
- const LfNavRail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-1af1c379"]]);
2840
+ const LfNavRail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-690fde3f"]]);
2801
2841
  const _hoisted_1$3 = ["aria-label"];
2802
2842
  const _hoisted_2$3 = ["aria-checked", "aria-label", "title", "disabled", "onClick"];
2803
2843
  const _hoisted_3$2 = {