fds-vue-core 6.0.9 → 6.0.11

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.
@@ -8588,7 +8588,9 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
8588
8588
  vue.createElementVNode("div", {
8589
8589
  class: vue.normalizeClass({ "flex flex-row gap-4": props.labelLeft })
8590
8590
  }, [
8591
- vue.createElementVNode("div", null, [
8591
+ vue.createElementVNode("div", {
8592
+ class: vue.normalizeClass({ "text-right": props.labelLeft })
8593
+ }, [
8592
8594
  props.label ? (vue.openBlock(), vue.createElementBlock("label", vue.mergeProps({
8593
8595
  key: 0,
8594
8596
  for: inputId.value,
@@ -8598,7 +8600,7 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
8598
8600
  key: 1,
8599
8601
  class: vue.normalizeClass(["font-thin", { "mb-1": !props.labelLeft }])
8600
8602
  }, vue.toDisplayString(props.meta), 3)) : vue.createCommentVNode("", true)
8601
- ]),
8603
+ ], 2),
8602
8604
  vue.createElementVNode("div", {
8603
8605
  class: vue.normalizeClass({ "flex-1": props.labelLeft })
8604
8606
  }, [
@@ -10758,9 +10760,14 @@ const useSearchSelectProItems = ({
10758
10760
  selectedItems.value = selectedItems.value.filter((item) => currentIds.has(getItemIdentifier(item)));
10759
10761
  };
10760
10762
  const hasInternalMoreItems = vue.computed(() => matchingItems.value.length > displayedItems.value.length);
10763
+ const hasMoreServerPages = vue.computed(() => {
10764
+ if (props.page === void 0 || props.totalPages === void 0) return false;
10765
+ return props.page < props.totalPages;
10766
+ });
10761
10767
  const shouldShowLoadMore = vue.computed(() => {
10762
10768
  if (isMultiple.value && showSelectedOnly.value) return false;
10763
10769
  if (hasInternalMoreItems.value) return true;
10770
+ if (hasMoreServerPages.value) return true;
10764
10771
  if (props.maxItems && props.maxItems > 0) return false;
10765
10772
  return props.showLoadMore;
10766
10773
  });
@@ -10839,6 +10846,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
10839
10846
  loading: { type: Boolean, default: false },
10840
10847
  searchFields: { default: () => [] },
10841
10848
  preserveOrder: { type: Boolean, default: false },
10849
+ debounceMs: { default: 500 },
10842
10850
  initialValue: { default: "" },
10843
10851
  displayValue: { default: "" },
10844
10852
  disabled: { type: Boolean, default: false },
@@ -11042,20 +11050,23 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
11042
11050
  }
11043
11051
  return digits;
11044
11052
  };
11045
- const debounce = (fn, delay) => {
11046
- let timeout;
11047
- return (...args) => {
11048
- clearTimeout(timeout);
11049
- timeout = setTimeout(() => fn(...args), delay);
11050
- };
11053
+ let changeTimeout = null;
11054
+ let inputTimeout = null;
11055
+ const debouncedEmitChange = (value) => {
11056
+ if (changeTimeout) clearTimeout(changeTimeout);
11057
+ const delay = Math.max(0, props.debounceMs ?? 500);
11058
+ changeTimeout = setTimeout(() => {
11059
+ const formattedValue = formatPidWithDash(value);
11060
+ emit("change", formattedValue);
11061
+ }, delay);
11062
+ };
11063
+ const debouncedEmitInput = (ev) => {
11064
+ if (inputTimeout) clearTimeout(inputTimeout);
11065
+ const delay = Math.max(0, props.debounceMs ?? 500);
11066
+ inputTimeout = setTimeout(() => {
11067
+ emit("input", ev);
11068
+ }, delay);
11051
11069
  };
11052
- const debouncedEmitChange = debounce((value) => {
11053
- const formattedValue = formatPidWithDash(value);
11054
- emit("change", formattedValue);
11055
- }, 500);
11056
- const debouncedEmitInput = debounce((ev) => {
11057
- emit("input", ev);
11058
- }, 500);
11059
11070
  vue.watch(
11060
11071
  () => searchTerm.value,
11061
11072
  (newValue) => {
@@ -11088,12 +11099,6 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
11088
11099
  valid.value = false;
11089
11100
  }
11090
11101
  };
11091
- const totalPages = vue.computed(() => {
11092
- if (props.page !== void 0 && props.totalPages !== void 0) {
11093
- return props.totalPages;
11094
- }
11095
- return null;
11096
- });
11097
11102
  const handleInput = (e) => {
11098
11103
  const target = e.target;
11099
11104
  const { value } = target;
@@ -11164,9 +11169,6 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
11164
11169
  }
11165
11170
  return result;
11166
11171
  };
11167
- const handlePagination = (_payload) => {
11168
- emit("paginate", _payload.detail);
11169
- };
11170
11172
  const selectItem = (item) => {
11171
11173
  selectedItem.value = item;
11172
11174
  setValidSelectedState();
@@ -11346,6 +11348,8 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
11346
11348
  });
11347
11349
  vue.onBeforeUnmount(() => {
11348
11350
  window.removeEventListener("mouseup", onClickOutside);
11351
+ if (changeTimeout) clearTimeout(changeTimeout);
11352
+ if (inputTimeout) clearTimeout(inputTimeout);
11349
11353
  const input = getInputElement();
11350
11354
  if (input) {
11351
11355
  input.removeEventListener("keydown", handleInputKeyDown);
@@ -11517,14 +11521,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
11517
11521
  vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMore ? resolvedLoadingMoreLabel.value : resolvedLoadMoreLabel.value), 1)
11518
11522
  ], 42, _hoisted_12)
11519
11523
  ])) : vue.createCommentVNode("", true)
11520
- ], 32),
11521
- __props.page !== void 0 && totalPages.value !== null && totalPages.value > 1 ? (vue.openBlock(), vue.createBlock(_sfc_main$l, {
11522
- key: 0,
11523
- current: __props.page,
11524
- max: totalPages.value,
11525
- onPaginate: handlePagination,
11526
- class: "my-4! px-2"
11527
- }, null, 8, ["current", "max"])) : vue.createCommentVNode("", true)
11524
+ ], 32)
11528
11525
  ], 64)) : !__props.loading ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_13, [
11529
11526
  vue.createElementVNode("li", _hoisted_14, vue.toDisplayString(__props.noResultPrompt), 1)
11530
11527
  ])) : vue.createCommentVNode("", true)