fui-material 2.6.6 → 2.6.7
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/f-ui-kit.es.js
CHANGED
|
@@ -3380,24 +3380,24 @@ const FTooltip = ({
|
|
|
3380
3380
|
tooltipElement && createPortal(tooltipElement, document.body)
|
|
3381
3381
|
] });
|
|
3382
3382
|
};
|
|
3383
|
-
const rotate = "
|
|
3384
|
-
const focused = "
|
|
3385
|
-
const selected = "
|
|
3383
|
+
const rotate = "_rotate_fq6h3_43";
|
|
3384
|
+
const focused = "_focused_fq6h3_94";
|
|
3385
|
+
const selected = "_selected_fq6h3_97";
|
|
3386
3386
|
const styles$6 = {
|
|
3387
|
-
"f-search-select": "_f-search-
|
|
3388
|
-
"f-select-native-hidden": "_f-select-native-
|
|
3389
|
-
"f-select-actions": "_f-select-
|
|
3390
|
-
"f-select-icon": "_f-select-
|
|
3387
|
+
"f-search-select": "_f-search-select_fq6h3_3",
|
|
3388
|
+
"f-select-native-hidden": "_f-select-native-hidden_fq6h3_8",
|
|
3389
|
+
"f-select-actions": "_f-select-actions_fq6h3_25",
|
|
3390
|
+
"f-select-icon": "_f-select-icon_fq6h3_34",
|
|
3391
3391
|
rotate,
|
|
3392
|
-
"f-select-dropdown": "_f-select-
|
|
3393
|
-
"f-select-list": "_f-select-
|
|
3394
|
-
"f-select-option": "_f-select-
|
|
3392
|
+
"f-select-dropdown": "_f-select-dropdown_fq6h3_48",
|
|
3393
|
+
"f-select-list": "_f-select-list_fq6h3_62",
|
|
3394
|
+
"f-select-option": "_f-select-option_fq6h3_81",
|
|
3395
3395
|
focused,
|
|
3396
3396
|
selected,
|
|
3397
|
-
"f-select-create": "_f-select-
|
|
3398
|
-
"f-select-no-results": "_f-select-no-
|
|
3399
|
-
"f-select-highlight": "_f-select-
|
|
3400
|
-
"has-icons": "_has-
|
|
3397
|
+
"f-select-create": "_f-select-create_fq6h3_102",
|
|
3398
|
+
"f-select-no-results": "_f-select-no-results_fq6h3_108",
|
|
3399
|
+
"f-select-highlight": "_f-select-highlight_fq6h3_128",
|
|
3400
|
+
"has-icons": "_has-icons_fq6h3_135"
|
|
3401
3401
|
};
|
|
3402
3402
|
const ChevronIcon = ({ className }) => /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className, children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" }) });
|
|
3403
3403
|
const CloseIcon = () => /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -3458,6 +3458,7 @@ const FSearchableSelect = forwardRef(
|
|
|
3458
3458
|
const [isOpen, setIsOpen] = useState(false);
|
|
3459
3459
|
const [searchQuery, setSearchQuery] = useState("");
|
|
3460
3460
|
const [highlightedIndex, setHighlightedIndex] = useState(0);
|
|
3461
|
+
const [isTyping, setIsTyping] = useState(false);
|
|
3461
3462
|
const containerRef = useRef(null);
|
|
3462
3463
|
const visibleInputRef = useRef(null);
|
|
3463
3464
|
const listRef = useRef(null);
|
|
@@ -3470,6 +3471,17 @@ const FSearchableSelect = forwardRef(
|
|
|
3470
3471
|
setSearchQuery(found ? found.label : strValue);
|
|
3471
3472
|
}
|
|
3472
3473
|
}, [restProps.value, options]);
|
|
3474
|
+
useEffect(() => {
|
|
3475
|
+
if (!searchQuery || !isOpen) {
|
|
3476
|
+
setIsTyping(false);
|
|
3477
|
+
return;
|
|
3478
|
+
}
|
|
3479
|
+
setIsTyping(true);
|
|
3480
|
+
const timeoutId = setTimeout(() => {
|
|
3481
|
+
setIsTyping(false);
|
|
3482
|
+
}, 600);
|
|
3483
|
+
return () => clearTimeout(timeoutId);
|
|
3484
|
+
}, [searchQuery, isOpen]);
|
|
3473
3485
|
const deferredQuery = useDeferredValue(searchQuery);
|
|
3474
3486
|
const filteredOptions = useMemo(() => {
|
|
3475
3487
|
if (!isOpen) return options;
|
|
@@ -3635,7 +3647,10 @@ const FSearchableSelect = forwardRef(
|
|
|
3635
3647
|
/* @__PURE__ */ jsx("div", { className: `${styles$6["f-select-icon"]} ${isOpen ? styles$6["rotate"] : ""}`, children: /* @__PURE__ */ jsx(ChevronIcon, {}) })
|
|
3636
3648
|
] })
|
|
3637
3649
|
] }),
|
|
3638
|
-
isOpen && !disabled2 && !load && /* @__PURE__ */ jsx("div", { className: styles$6["f-select-dropdown"], children: /* @__PURE__ */ jsx("ul", { ref: listRef, className: styles$6["f-select-list"], children:
|
|
3650
|
+
isOpen && !disabled2 && !load && /* @__PURE__ */ jsx("div", { className: styles$6["f-select-dropdown"], children: /* @__PURE__ */ jsx("ul", { ref: listRef, className: styles$6["f-select-list"], children: isTyping ? (
|
|
3651
|
+
// НОВОЕ: Отображение статуса ввода
|
|
3652
|
+
/* @__PURE__ */ jsx("li", { className: styles$6["f-select-no-results"], children: "Ожидается окончание ввода..." })
|
|
3653
|
+
) : renderList.length === 0 ? /* @__PURE__ */ jsx("li", { className: styles$6["f-select-no-results"], children: allowCreate ? "Нет данных" : "Совпадений не найдено" }) : renderList.map((option, index) => /* @__PURE__ */ jsx(
|
|
3639
3654
|
"li",
|
|
3640
3655
|
{
|
|
3641
3656
|
className: `
|
|
@@ -3680,11 +3695,11 @@ const FSearchableSelect = forwardRef(
|
|
|
3680
3695
|
)
|
|
3681
3696
|
}
|
|
3682
3697
|
),
|
|
3683
|
-
errText && errText.length > 0 && /* @__PURE__ */ jsx(
|
|
3698
|
+
errText && Array.isArray(errText) && errText.length > 0 && /* @__PURE__ */ jsx(
|
|
3684
3699
|
"div",
|
|
3685
3700
|
{
|
|
3686
3701
|
className: "f-form-element__errorblock",
|
|
3687
|
-
children:
|
|
3702
|
+
children: errText.map((error2, index) => /* @__PURE__ */ jsx(
|
|
3688
3703
|
"p",
|
|
3689
3704
|
{
|
|
3690
3705
|
id: `${inputId}-errortext-${index}`,
|