fds-vue-core 7.1.1 → 7.1.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.
@@ -11606,6 +11606,9 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11606
11606
  syncSelectedItemsWithItems();
11607
11607
  }
11608
11608
  filterAndPaginate();
11609
+ if (!selectedItem.value) {
11610
+ resolveInitialSingleSelection();
11611
+ }
11609
11612
  },
11610
11613
  { immediate: true }
11611
11614
  );
@@ -11743,11 +11746,39 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11743
11746
  }
11744
11747
  return result;
11745
11748
  };
11746
- const selectItem = (item) => {
11749
+ function selectItem(item) {
11747
11750
  selectedItem.value = item;
11748
11751
  setValidSelectedState();
11749
11752
  emit("searchSelected", item);
11750
- };
11753
+ }
11754
+ function getCandidateMatchValues(item) {
11755
+ if (isDividerItem(item) && !props.dividerSelectable) return [];
11756
+ if (searchFields.value.length > 0) {
11757
+ return searchFields.value.map((key) => String(item[key] ?? "").trim()).filter((value) => value.length > 0);
11758
+ }
11759
+ return [String(item.label ?? item.name ?? "").trim()].filter((value) => value.length > 0);
11760
+ }
11761
+ function resolveInitialSingleSelection() {
11762
+ if (isMultiple.value || !props.initialValue) return;
11763
+ const normalizeForInitialMatch = (value) => {
11764
+ const trimmed = value.trim();
11765
+ if (!trimmed) return "";
11766
+ if (!isPidString(trimmed)) {
11767
+ return trimmed.replace(/-$/, "").toLowerCase();
11768
+ }
11769
+ const digits = trimmed.replace(/\D/g, "");
11770
+ return (digits.length > 8 ? `${digits.substring(0, 8)}-${digits.substring(8)}` : digits).toLowerCase();
11771
+ };
11772
+ const normalizedInitialValue = normalizeForInitialMatch(props.initialValue);
11773
+ if (!normalizedInitialValue) return;
11774
+ const initialMatch = sourceItems.value.find(
11775
+ (item) => getCandidateMatchValues(item).some((value) => normalizeForInitialMatch(value) === normalizedInitialValue)
11776
+ );
11777
+ if (!initialMatch) return;
11778
+ const firstField = searchFields.value[0];
11779
+ searchTerm.value = (firstField ? String(initialMatch[firstField] ?? "") : props.initialValue).trim();
11780
+ selectItem(initialMatch);
11781
+ }
11751
11782
  const getHierarchyLevel = (item) => {
11752
11783
  const level = Number(item[props.levelField] ?? 0);
11753
11784
  return Number.isFinite(level) && level >= 0 ? level : 0;
@@ -11957,7 +11988,10 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
11957
11988
  vue.onMounted(() => {
11958
11989
  if (props.initialValue) {
11959
11990
  searchTerm.value = props.initialValue;
11960
- setValidSelectedState();
11991
+ resolveInitialSingleSelection();
11992
+ if (!selectedItem.value) {
11993
+ setValidSelectedState();
11994
+ }
11961
11995
  }
11962
11996
  window.addEventListener("mouseup", onClickOutside);
11963
11997
  vue.nextTick(() => {
@@ -15876,8 +15910,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
15876
15910
  heading: { default: void 0 },
15877
15911
  align: { default: "left" },
15878
15912
  icon: { default: void 0 },
15879
- dataTestid: { default: void 0 },
15880
- isSortActive: { type: Boolean, default: false }
15913
+ dataTestid: { default: void 0 }
15881
15914
  },
15882
15915
  emits: ["sort"],
15883
15916
  setup(__props, { emit: __emit }) {
@@ -15889,10 +15922,6 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
15889
15922
  props.align === "right" && "text-right justify-end",
15890
15923
  iconName.value && "text-blue-600! hover:bg-blue_t-200 cursor-pointer focus-visible:outline-dashed focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-blue-500 active:bg-blue_t-300"
15891
15924
  ]);
15892
- const iconClasses = vue.computed(() => [
15893
- "fill-blue-500 ml-1 transition-opacity",
15894
- iconName.value && !props.isSortActive && "opacity-20"
15895
- ]);
15896
15925
  const iconName = vue.computed(() => props.icon);
15897
15926
  const emit = __emit;
15898
15927
  const handleSort = (ev) => {
@@ -15922,8 +15951,8 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
15922
15951
  vue.createVNode(_sfc_main$J, {
15923
15952
  name: iconName.value,
15924
15953
  size: "24px",
15925
- class: vue.normalizeClass(iconClasses.value)
15926
- }, null, 8, ["name", "class"])
15954
+ class: "fill-blue-500 ml-1"
15955
+ }, null, 8, ["name"])
15927
15956
  ], 42, _hoisted_1$1)) : (vue.openBlock(), vue.createElementBlock("div", {
15928
15957
  key: 1,
15929
15958
  class: vue.normalizeClass(headerClasses.value)