fui-material 2.6.5 → 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.
@@ -3380,24 +3380,24 @@ const FTooltip = ({
3380
3380
  tooltipElement && createPortal(tooltipElement, document.body)
3381
3381
  ] });
3382
3382
  };
3383
- const rotate = "_rotate_1prwk_43";
3384
- const focused = "_focused_1prwk_94";
3385
- const selected = "_selected_1prwk_97";
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-select_1prwk_3",
3388
- "f-select-native-hidden": "_f-select-native-hidden_1prwk_8",
3389
- "f-select-actions": "_f-select-actions_1prwk_25",
3390
- "f-select-icon": "_f-select-icon_1prwk_34",
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-dropdown_1prwk_48",
3393
- "f-select-list": "_f-select-list_1prwk_62",
3394
- "f-select-option": "_f-select-option_1prwk_81",
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-create_1prwk_102",
3398
- "f-select-no-results": "_f-select-no-results_1prwk_108",
3399
- "f-select-highlight": "_f-select-highlight_1prwk_128",
3400
- "has-icons": "_has-icons_1prwk_135"
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: [
@@ -3432,6 +3432,7 @@ const FSearchableSelect = forwardRef(
3432
3432
  disabled: disabled2,
3433
3433
  onKeyDown: restOnKeyDown,
3434
3434
  onFocus: restOnFocus,
3435
+ onChangeTerm,
3435
3436
  ...restProps
3436
3437
  }, ref) => {
3437
3438
  const options = useMemo(() => {
@@ -3457,6 +3458,7 @@ const FSearchableSelect = forwardRef(
3457
3458
  const [isOpen, setIsOpen] = useState(false);
3458
3459
  const [searchQuery, setSearchQuery] = useState("");
3459
3460
  const [highlightedIndex, setHighlightedIndex] = useState(0);
3461
+ const [isTyping, setIsTyping] = useState(false);
3460
3462
  const containerRef = useRef(null);
3461
3463
  const visibleInputRef = useRef(null);
3462
3464
  const listRef = useRef(null);
@@ -3469,6 +3471,17 @@ const FSearchableSelect = forwardRef(
3469
3471
  setSearchQuery(found ? found.label : strValue);
3470
3472
  }
3471
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]);
3472
3485
  const deferredQuery = useDeferredValue(searchQuery);
3473
3486
  const filteredOptions = useMemo(() => {
3474
3487
  if (!isOpen) return options;
@@ -3605,6 +3618,7 @@ const FSearchableSelect = forwardRef(
3605
3618
  onChange: (e) => {
3606
3619
  const val = e.target.value;
3607
3620
  setSearchQuery(val);
3621
+ if (onChangeTerm) onChangeTerm(e);
3608
3622
  if (!isOpen) setIsOpen(true);
3609
3623
  if (allowCreate) {
3610
3624
  triggerChange(val);
@@ -3633,7 +3647,10 @@ const FSearchableSelect = forwardRef(
3633
3647
  /* @__PURE__ */ jsx("div", { className: `${styles$6["f-select-icon"]} ${isOpen ? styles$6["rotate"] : ""}`, children: /* @__PURE__ */ jsx(ChevronIcon, {}) })
3634
3648
  ] })
3635
3649
  ] }),
3636
- 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: renderList.length === 0 ? /* @__PURE__ */ jsx("li", { className: styles$6["f-select-no-results"], children: allowCreate ? "Нет данных" : "Совпадений не найдено" }) : renderList.map((option, index) => /* @__PURE__ */ jsx(
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(
3637
3654
  "li",
3638
3655
  {
3639
3656
  className: `
@@ -3678,11 +3695,11 @@ const FSearchableSelect = forwardRef(
3678
3695
  )
3679
3696
  }
3680
3697
  ),
3681
- errText && errText.length > 0 && /* @__PURE__ */ jsx(
3698
+ errText && Array.isArray(errText) && errText.length > 0 && /* @__PURE__ */ jsx(
3682
3699
  "div",
3683
3700
  {
3684
3701
  className: "f-form-element__errorblock",
3685
- children: typeof errText !== "string" && errText.map((error2, index) => /* @__PURE__ */ jsx(
3702
+ children: errText.map((error2, index) => /* @__PURE__ */ jsx(
3686
3703
  "p",
3687
3704
  {
3688
3705
  id: `${inputId}-errortext-${index}`,