prime-ui-kit 0.7.11 → 0.7.13
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/components/index.js
CHANGED
|
@@ -10459,7 +10459,7 @@ function filterOptions(options, query) {
|
|
|
10459
10459
|
return o.label.toLowerCase().includes(q) || o.value.toLowerCase().includes(q);
|
|
10460
10460
|
});
|
|
10461
10461
|
}
|
|
10462
|
-
function
|
|
10462
|
+
function optionsForPickList(options, query, selected) {
|
|
10463
10463
|
return filterOptions(options, query).filter((o) => !selected.includes(o.value));
|
|
10464
10464
|
}
|
|
10465
10465
|
function shouldShowCreate(creatable, inputTrim, selected, options) {
|
|
@@ -10704,8 +10704,8 @@ function TagSelectRoot({
|
|
|
10704
10704
|
return next.length === prev.length ? prev : next;
|
|
10705
10705
|
});
|
|
10706
10706
|
}, [options]);
|
|
10707
|
-
const
|
|
10708
|
-
() =>
|
|
10707
|
+
const filteredForPick = React71.useMemo(
|
|
10708
|
+
() => optionsForPickList(mergedOptions, inputValue, selected),
|
|
10709
10709
|
[mergedOptions, inputValue, selected]
|
|
10710
10710
|
);
|
|
10711
10711
|
const showCreate = shouldShowCreate(creatable, inputTrim, selected, mergedOptions);
|
|
@@ -10735,15 +10735,15 @@ function TagSelectRoot({
|
|
|
10735
10735
|
}
|
|
10736
10736
|
};
|
|
10737
10737
|
}, [optionManagement, options, setSelected]);
|
|
10738
|
-
const hasPanelContent =
|
|
10738
|
+
const hasPanelContent = filteredForPick.length > 0 || showCreate;
|
|
10739
10739
|
const flatOptionValues = React71.useMemo(() => {
|
|
10740
10740
|
const v = [];
|
|
10741
10741
|
if (showCreate) v.push(CREATE_VALUE);
|
|
10742
|
-
for (const o of
|
|
10742
|
+
for (const o of filteredForPick) {
|
|
10743
10743
|
if (!o.disabled) v.push(o.value);
|
|
10744
10744
|
}
|
|
10745
10745
|
return v;
|
|
10746
|
-
}, [
|
|
10746
|
+
}, [filteredForPick, showCreate]);
|
|
10747
10747
|
React71.useLayoutEffect(() => {
|
|
10748
10748
|
if (!open) return;
|
|
10749
10749
|
updateRef.current();
|
|
@@ -10877,7 +10877,9 @@ function TagSelectRoot({
|
|
|
10877
10877
|
if (!open) {
|
|
10878
10878
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
10879
10879
|
e.preventDefault();
|
|
10880
|
-
if (
|
|
10880
|
+
if (filteredForPick.length > 0 || showCreate) {
|
|
10881
|
+
setOpen(true);
|
|
10882
|
+
}
|
|
10881
10883
|
}
|
|
10882
10884
|
return;
|
|
10883
10885
|
}
|
|
@@ -11002,9 +11004,9 @@ function TagSelectRoot({
|
|
|
11002
11004
|
setInputValue(next);
|
|
11003
11005
|
const nextTrim = next.trim();
|
|
11004
11006
|
const nextMerged = mergeOptionsWithCreated(options, createdOptions);
|
|
11005
|
-
const
|
|
11007
|
+
const nextPick = optionsForPickList(nextMerged, next, selected);
|
|
11006
11008
|
const nextShowCreate = shouldShowCreate(creatable, nextTrim, selected, nextMerged);
|
|
11007
|
-
if (
|
|
11009
|
+
if (nextPick.length > 0 || nextShowCreate) {
|
|
11008
11010
|
setOpen(true);
|
|
11009
11011
|
} else {
|
|
11010
11012
|
setOpen(false);
|
|
@@ -11074,7 +11076,7 @@ function TagSelectRoot({
|
|
|
11074
11076
|
},
|
|
11075
11077
|
CREATE_VALUE
|
|
11076
11078
|
) : null,
|
|
11077
|
-
resolvedOptionManagement ?
|
|
11079
|
+
resolvedOptionManagement ? filteredForPick.map((o) => /* @__PURE__ */ jsxs31(
|
|
11078
11080
|
"div",
|
|
11079
11081
|
{
|
|
11080
11082
|
role: "option",
|
|
@@ -11117,7 +11119,7 @@ function TagSelectRoot({
|
|
|
11117
11119
|
]
|
|
11118
11120
|
},
|
|
11119
11121
|
o.value
|
|
11120
|
-
)) :
|
|
11122
|
+
)) : filteredForPick.map((o) => /* @__PURE__ */ jsx57(
|
|
11121
11123
|
"button",
|
|
11122
11124
|
{
|
|
11123
11125
|
type: "button",
|