fds-vue-core 6.0.10 → 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.
- package/dist/fds-vue-core.cjs.js +25 -30
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.es.js +25 -30
- package/dist/fds-vue-core.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FdsSearchSelectPro/FdsSearchSelectPro.stories.ts +60 -30
- package/src/components/FdsSearchSelectPro/FdsSearchSelectPro.vue +18 -33
- package/src/components/FdsSearchSelectPro/types.ts +2 -0
- package/src/components/FdsSearchSelectPro/useSearchSelectProItems.ts +5 -0
package/dist/fds-vue-core.cjs.js
CHANGED
|
@@ -10760,9 +10760,14 @@ const useSearchSelectProItems = ({
|
|
|
10760
10760
|
selectedItems.value = selectedItems.value.filter((item) => currentIds.has(getItemIdentifier(item)));
|
|
10761
10761
|
};
|
|
10762
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
|
+
});
|
|
10763
10767
|
const shouldShowLoadMore = vue.computed(() => {
|
|
10764
10768
|
if (isMultiple.value && showSelectedOnly.value) return false;
|
|
10765
10769
|
if (hasInternalMoreItems.value) return true;
|
|
10770
|
+
if (hasMoreServerPages.value) return true;
|
|
10766
10771
|
if (props.maxItems && props.maxItems > 0) return false;
|
|
10767
10772
|
return props.showLoadMore;
|
|
10768
10773
|
});
|
|
@@ -10841,6 +10846,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
10841
10846
|
loading: { type: Boolean, default: false },
|
|
10842
10847
|
searchFields: { default: () => [] },
|
|
10843
10848
|
preserveOrder: { type: Boolean, default: false },
|
|
10849
|
+
debounceMs: { default: 500 },
|
|
10844
10850
|
initialValue: { default: "" },
|
|
10845
10851
|
displayValue: { default: "" },
|
|
10846
10852
|
disabled: { type: Boolean, default: false },
|
|
@@ -11044,20 +11050,23 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
11044
11050
|
}
|
|
11045
11051
|
return digits;
|
|
11046
11052
|
};
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
|
|
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);
|
|
11053
11069
|
};
|
|
11054
|
-
const debouncedEmitChange = debounce((value) => {
|
|
11055
|
-
const formattedValue = formatPidWithDash(value);
|
|
11056
|
-
emit("change", formattedValue);
|
|
11057
|
-
}, 500);
|
|
11058
|
-
const debouncedEmitInput = debounce((ev) => {
|
|
11059
|
-
emit("input", ev);
|
|
11060
|
-
}, 500);
|
|
11061
11070
|
vue.watch(
|
|
11062
11071
|
() => searchTerm.value,
|
|
11063
11072
|
(newValue) => {
|
|
@@ -11090,12 +11099,6 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
11090
11099
|
valid.value = false;
|
|
11091
11100
|
}
|
|
11092
11101
|
};
|
|
11093
|
-
const totalPages = vue.computed(() => {
|
|
11094
|
-
if (props.page !== void 0 && props.totalPages !== void 0) {
|
|
11095
|
-
return props.totalPages;
|
|
11096
|
-
}
|
|
11097
|
-
return null;
|
|
11098
|
-
});
|
|
11099
11102
|
const handleInput = (e) => {
|
|
11100
11103
|
const target = e.target;
|
|
11101
11104
|
const { value } = target;
|
|
@@ -11166,9 +11169,6 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
11166
11169
|
}
|
|
11167
11170
|
return result;
|
|
11168
11171
|
};
|
|
11169
|
-
const handlePagination = (_payload) => {
|
|
11170
|
-
emit("paginate", _payload.detail);
|
|
11171
|
-
};
|
|
11172
11172
|
const selectItem = (item) => {
|
|
11173
11173
|
selectedItem.value = item;
|
|
11174
11174
|
setValidSelectedState();
|
|
@@ -11348,6 +11348,8 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
11348
11348
|
});
|
|
11349
11349
|
vue.onBeforeUnmount(() => {
|
|
11350
11350
|
window.removeEventListener("mouseup", onClickOutside);
|
|
11351
|
+
if (changeTimeout) clearTimeout(changeTimeout);
|
|
11352
|
+
if (inputTimeout) clearTimeout(inputTimeout);
|
|
11351
11353
|
const input = getInputElement();
|
|
11352
11354
|
if (input) {
|
|
11353
11355
|
input.removeEventListener("keydown", handleInputKeyDown);
|
|
@@ -11519,14 +11521,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
|
11519
11521
|
vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMore ? resolvedLoadingMoreLabel.value : resolvedLoadMoreLabel.value), 1)
|
|
11520
11522
|
], 42, _hoisted_12)
|
|
11521
11523
|
])) : vue.createCommentVNode("", true)
|
|
11522
|
-
], 32)
|
|
11523
|
-
__props.page !== void 0 && totalPages.value !== null && totalPages.value > 1 ? (vue.openBlock(), vue.createBlock(_sfc_main$l, {
|
|
11524
|
-
key: 0,
|
|
11525
|
-
current: __props.page,
|
|
11526
|
-
max: totalPages.value,
|
|
11527
|
-
onPaginate: handlePagination,
|
|
11528
|
-
class: "my-4! px-2"
|
|
11529
|
-
}, null, 8, ["current", "max"])) : vue.createCommentVNode("", true)
|
|
11524
|
+
], 32)
|
|
11530
11525
|
], 64)) : !__props.loading ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_13, [
|
|
11531
11526
|
vue.createElementVNode("li", _hoisted_14, vue.toDisplayString(__props.noResultPrompt), 1)
|
|
11532
11527
|
])) : vue.createCommentVNode("", true)
|