@loafacto/ui 0.16.3 → 0.16.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 CHANGED
@@ -2752,12 +2752,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2752
2752
  }
2753
2753
  const list = useTemplateRef("list");
2754
2754
  const thumb = ref(null);
2755
+ const instant = ref(true);
2756
+ let lastEl = null;
2755
2757
  function measure() {
2756
2758
  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 el = ((_a = list.value) == null ? void 0 : _a.querySelector(".lf-rail__link--active, .lf-rail__link.router-link-active")) ?? null;
2760
+ const next = el && el.offsetWidth ? { x: el.offsetLeft, y: el.offsetTop, w: el.offsetWidth, h: el.offsetHeight } : null;
2759
2761
  const cur = thumb.value;
2760
2762
  if (cur && next && cur.x === next.x && cur.y === next.y && cur.w === next.w && cur.h === next.h) return;
2763
+ instant.value = !lastEl || el === lastEl || !cur;
2764
+ if (next) lastEl = el;
2761
2765
  thumb.value = next;
2762
2766
  }
2763
2767
  let mo = null;
@@ -2793,10 +2797,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2793
2797
  }, [
2794
2798
  thumb.value ? (openBlock(), createElementBlock("span", {
2795
2799
  key: 0,
2796
- class: "lf-rail__thumb",
2800
+ class: normalizeClass(["lf-rail__thumb", { "lf-rail__thumb--instant": instant.value }]),
2797
2801
  style: normalizeStyle({ transform: `translate(${thumb.value.x}px, ${thumb.value.y}px)`, width: `${thumb.value.w}px`, height: `${thumb.value.h}px` }),
2798
2802
  "aria-hidden": "true"
2799
- }, null, 4)) : createCommentVNode("", true),
2803
+ }, null, 6)) : createCommentVNode("", true),
2800
2804
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
2801
2805
  var _a;
2802
2806
  return openBlock(), createElementBlock(Fragment, {
@@ -2837,7 +2841,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2837
2841
  };
2838
2842
  }
2839
2843
  });
2840
- const LfNavRail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-690fde3f"]]);
2844
+ const LfNavRail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-a29be44a"]]);
2841
2845
  const _hoisted_1$3 = ["aria-label"];
2842
2846
  const _hoisted_2$3 = ["aria-checked", "aria-label", "title", "disabled", "onClick"];
2843
2847
  const _hoisted_3$2 = {
@@ -2870,10 +2874,17 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2870
2874
  );
2871
2875
  const root = useTemplateRef("root");
2872
2876
  const thumb = ref(null);
2877
+ const instant = ref(true);
2878
+ let lastEl = null;
2873
2879
  function measure() {
2874
2880
  var _a;
2875
- const el = (_a = root.value) == null ? void 0 : _a.querySelector(".lf-seg__btn--on");
2876
- thumb.value = el ? { x: el.offsetLeft, w: el.offsetWidth } : null;
2881
+ const el = ((_a = root.value) == null ? void 0 : _a.querySelector(".lf-seg__btn--on")) ?? null;
2882
+ const next = el && el.offsetWidth ? { x: el.offsetLeft, w: el.offsetWidth } : null;
2883
+ const cur = thumb.value;
2884
+ if (cur && next && cur.x === next.x && cur.w === next.w) return;
2885
+ instant.value = !lastEl || el === lastEl || !cur;
2886
+ if (next) lastEl = el;
2887
+ thumb.value = next;
2877
2888
  }
2878
2889
  watch(() => [model.value, normalized.value.length], () => {
2879
2890
  void nextTick(measure);
@@ -2901,10 +2912,10 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2901
2912
  }, [
2902
2913
  thumb.value ? (openBlock(), createElementBlock("span", {
2903
2914
  key: 0,
2904
- class: "lf-seg__thumb",
2915
+ class: normalizeClass(["lf-seg__thumb", { "lf-seg__thumb--instant": instant.value }]),
2905
2916
  style: normalizeStyle({ transform: `translateX(${thumb.value.x}px)`, width: `${thumb.value.w}px` }),
2906
2917
  "aria-hidden": "true"
2907
- }, null, 4)) : createCommentVNode("", true),
2918
+ }, null, 6)) : createCommentVNode("", true),
2908
2919
  (openBlock(true), createElementBlock(Fragment, null, renderList(normalized.value, (opt) => {
2909
2920
  return openBlock(), createElementBlock("button", {
2910
2921
  key: String(opt.value),
@@ -2929,7 +2940,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2929
2940
  };
2930
2941
  }
2931
2942
  });
2932
- const LfSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-474f0f2f"]]);
2943
+ const LfSegmented = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-10fad8e3"]]);
2933
2944
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2934
2945
  __name: "LfTransitionList",
2935
2946
  props: {