@companix/uikit 0.0.51 → 0.0.53

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.
@@ -0,0 +1 @@
1
+ export declare const SelectLoader: () => import("react/jsx-runtime").JSX.Element;
@@ -9,10 +9,11 @@ interface SelectPopoverProps<T> {
9
9
  optionsWrapperRef?: React.RefObject<HTMLDivElement>;
10
10
  options: Option<T>[];
11
11
  minimalOptions?: boolean;
12
- active?: T | null;
12
+ isActive: (value: T) => boolean;
13
13
  onSelect?: (value: T) => void;
14
14
  onOpened?: () => void;
15
15
  addOption?: SelectAddOption;
16
+ emptyText?: string;
16
17
  }
17
- export declare const SelectOptions: <T>(props: SelectPopoverProps<T>) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const SelectOptionsList: <T>(props: SelectPopoverProps<T>) => import("react/jsx-runtime").JSX.Element;
18
19
  export {};
@@ -19,6 +19,7 @@ export interface SelectParams {
19
19
  }>;
20
20
  addOption?: SelectAddOption;
21
21
  isLoading?: boolean;
22
+ emptyText?: string;
22
23
  }
23
24
  export type SelectProps<T> = Omit<SelectFormProps, 'value' | 'onChange' | 'closeButton'> & DependedValueType<T> & SelectParams & {
24
25
  value: T | null;
@@ -1,4 +1,5 @@
1
1
  import { Option } from '../types';
2
+ import { SelectAddOption } from '../Select/SelectOptions';
2
3
  export interface SelectTagsProps<T> {
3
4
  options: Option<T>[];
4
5
  onChange: (event: T[]) => void;
@@ -11,8 +12,10 @@ export interface SelectTagsProps<T> {
11
12
  emptyText?: string;
12
13
  size?: 'sm' | 'md' | 'lg';
13
14
  fill?: boolean;
15
+ minimalOptions?: boolean;
14
16
  inputRef?: React.Ref<HTMLInputElement>;
15
17
  required?: boolean;
16
18
  isLoading?: boolean;
19
+ addOption?: SelectAddOption;
17
20
  }
18
21
  export declare const SelectTags: <T extends string | number>(props: SelectTagsProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,13 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useMemo as I, useImperativeHandle as T } from "react";
3
- import { Popover as b } from "./bundle.es10.js";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useMemo as I, useImperativeHandle as b } from "react";
3
+ import { Popover as z } from "./bundle.es10.js";
4
4
  import { useFroozeClosing as B } from "./bundle.es45.js";
5
5
  import { SelectInput as D } from "./bundle.es46.js";
6
- import { useScrollListController as L } from "./bundle.es47.js";
7
- import { SelectOptions as j } from "./bundle.es48.js";
8
- import { mergeRefs as w } from "react-merge-refs";
9
- import { Spinner as H } from "./bundle.es6.js";
10
- const Q = (a) => {
6
+ import { useScrollListController as j } from "./bundle.es47.js";
7
+ import { SelectOptionsList as w } from "./bundle.es48.js";
8
+ import { mergeRefs as y } from "react-merge-refs";
9
+ import { SelectLoader as H } from "./bundle.es49.js";
10
+ const U = (a) => {
11
11
  const {
12
12
  options: t,
13
13
  onChange: l,
@@ -19,57 +19,59 @@ const Q = (a) => {
19
19
  scrollRef: d,
20
20
  popoverRef: v,
21
21
  clearButton: s,
22
- addOption: h,
23
- isLoading: g,
24
- ...x
25
- } = a, r = I(() => {
22
+ emptyText: h,
23
+ addOption: x,
24
+ isLoading: R,
25
+ ...g
26
+ } = a, n = I(() => {
26
27
  const o = i === null ? -1 : t.findIndex((e) => e.value === i);
27
28
  return {
28
29
  index: o,
29
30
  option: t[o]
30
31
  };
31
- }, [t, i]), R = r.option?.value ?? null, { popoverRef: C, froozePopoverPosition: O, handleAnimationEnd: P } = B(), { scrollToElement: c, optionsWrapperRef: S, scrollBoxRef: A } = L();
32
- T(d, () => ({
32
+ }, [t, i]), C = n.option?.value ?? null, { popoverRef: O, froozePopoverPosition: P, handleAnimationEnd: S } = B(), { scrollToElement: c, optionsWrapperRef: A, scrollBoxRef: L } = j();
33
+ b(d, () => ({
33
34
  scrollTo: (o) => c(o, "top")
34
35
  }));
35
- const z = (o, e) => {
36
- O(), l(o), e();
36
+ const T = (o, e) => {
37
+ P(), l(o), e();
37
38
  }, E = (o) => {
38
39
  o.stopPropagation(), s && l(null);
39
40
  }, F = () => {
40
- r.index !== -1 && c(r.index, "center");
41
+ n.index !== -1 && c(n.index, "center");
41
42
  };
42
- return /* @__PURE__ */ n(
43
- b,
43
+ return /* @__PURE__ */ r(
44
+ z,
44
45
  {
45
46
  minimal: !0,
46
- ref: w([C, v]),
47
+ ref: y([O, v]),
47
48
  sideOffset: 0,
48
49
  matchTarget: f,
49
- onAnimationEnd: P,
50
+ onAnimationEnd: S,
50
51
  onOpenAutoFocus: (o) => o.preventDefault(),
51
52
  onCloseAutoFocus: (o) => o.preventDefault(),
52
53
  disabled: p,
53
- content: ({ close: o }) => g ? /* @__PURE__ */ n("div", { className: "select-popover-loading", children: /* @__PURE__ */ n(H, { size: 24 }) }) : /* @__PURE__ */ n(
54
- j,
54
+ content: ({ close: o }) => R ? /* @__PURE__ */ r(H, {}) : /* @__PURE__ */ r(
55
+ w,
55
56
  {
56
57
  options: t,
57
- active: R,
58
- scrollboxRef: A,
59
- optionsWrapperRef: S,
58
+ isActive: (e) => e === C,
59
+ emptyText: h,
60
+ scrollboxRef: L,
61
+ optionsWrapperRef: A,
60
62
  minimalOptions: m,
61
- addOption: h,
63
+ addOption: x,
62
64
  onOpened: F,
63
- onSelect: (e) => z(e, o)
65
+ onSelect: (e) => T(e, o)
64
66
  }
65
67
  ),
66
- children: u ?? /* @__PURE__ */ n(
68
+ children: u ?? /* @__PURE__ */ r(
67
69
  D,
68
70
  {
69
- ...x,
71
+ ...g,
70
72
  disabled: p,
71
73
  clearButton: s,
72
- value: r.option?.title ?? "",
74
+ value: n.option?.title ?? "",
73
75
  onClear: E
74
76
  }
75
77
  )
@@ -77,5 +79,5 @@ const Q = (a) => {
77
79
  );
78
80
  };
79
81
  export {
80
- Q as Select
82
+ U as Select
81
83
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { forwardRef as b, useRef as R } from "react";
3
3
  import { mergeRefs as c } from "react-merge-refs";
4
- import { InputElement as x } from "./bundle.es49.js";
5
- import { InputContainer as I } from "./bundle.es50.js";
4
+ import { InputElement as x } from "./bundle.es50.js";
5
+ import { InputContainer as I } from "./bundle.es51.js";
6
6
  import g from "classnames";
7
7
  const N = b(
8
8
  ({
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import C from "classnames";
3
3
  import { forwardRef as j, useRef as w } from "react";
4
4
  import { mergeRefs as y } from "react-merge-refs";
5
- import { InputContainer as F } from "./bundle.es50.js";
5
+ import { InputContainer as F } from "./bundle.es51.js";
6
6
  import { NumericFormat as V } from "react-number-format";
7
7
  const D = j(
8
8
  ({
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import f from "classnames";
3
3
  import * as o from "@radix-ui/react-dialog";
4
4
  import { VisuallyHidden as a } from "@radix-ui/react-visually-hidden";
5
- import { RemoveListener as v } from "./bundle.es51.js";
5
+ import { RemoveListener as v } from "./bundle.es52.js";
6
6
  const g = (l) => {
7
7
  const { size: n = "s", open: r, onOpenChange: s, children: c, onClosed: t, disableEsc: p, className: d } = l, m = (h) => {
8
8
  p && h.preventDefault();
@@ -1,7 +1,7 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import * as r from "@radix-ui/react-alert-dialog";
3
3
  import { Button as c } from "./bundle.es4.js";
4
- import { RemoveListener as N } from "./bundle.es51.js";
4
+ import { RemoveListener as N } from "./bundle.es52.js";
5
5
  import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
6
6
  const C = ({
7
7
  open: d,
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { Button as m } from "./bundle.es4.js";
3
- import { useLoading as p } from "./bundle.es52.js";
3
+ import { useLoading as p } from "./bundle.es53.js";
4
4
  const g = ({ onClick: o, appearance: r = "primary", ...i }) => {
5
5
  const { isLoading: n, isError: t, handleClick: a } = p({ onClick: o });
6
6
  return /* @__PURE__ */ e(
@@ -1,5 +1,5 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
- import { useResizeTextarea as x } from "./bundle.es53.js";
2
+ import { useResizeTextarea as x } from "./bundle.es54.js";
3
3
  import { attr as e, callMultiple as u } from "@companix/utils-browser";
4
4
  import { useEffect as z } from "react";
5
5
  import { mergeRefs as R } from "react-merge-refs";
@@ -1,111 +1,110 @@
1
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
2
  import { useFroozeClosing as q } from "./bundle.es45.js";
3
- import { Spinner as L } from "./bundle.es6.js";
4
3
  import { Popover as V } from "./bundle.es10.js";
5
- import { OptionItem as B } from "./bundle.es14.js";
6
- import { OptionsList as H } from "./bundle.es16.js";
4
+ import { useState as $, useRef as f, useMemo as p } from "react";
7
5
  import { Icon as d } from "./bundle.es33.js";
8
- import { useState as X, useRef as h, useMemo as g } from "react";
9
- import { attr as v, getActiveElementByAnotherElement as G, contains as J } from "@companix/utils-browser";
10
- import { mergeRefs as K } from "react-merge-refs";
11
- import { faXmark as Q, faChevronDown as U } from "@companix/icons-solid";
12
- import { matchPattern as W } from "@companix/utils-js";
13
- const le = (x) => {
6
+ import { attr as h, getActiveElementByAnotherElement as B, contains as X } from "@companix/utils-browser";
7
+ import { mergeRefs as G } from "react-merge-refs";
8
+ import { faXmark as H, faChevronDown as J } from "@companix/icons-solid";
9
+ import { matchPattern as K } from "@companix/utils-js";
10
+ import { SelectOptionsList as Q } from "./bundle.es48.js";
11
+ import { SelectLoader as U } from "./bundle.es49.js";
12
+ const se = (g) => {
14
13
  const {
15
14
  options: r,
16
- closeAfterSelect: C,
17
- placeholder: N,
18
- onChange: c,
19
- emptyText: R = "Ничего не найдено",
20
- readOnly: l,
21
- size: z = "md",
15
+ closeAfterSelect: v,
16
+ placeholder: x,
17
+ onChange: s,
18
+ emptyText: C = "Ничего не найдено",
19
+ readOnly: c,
20
+ size: N = "md",
22
21
  value: n,
23
- inputRef: A,
24
- isLoading: D,
25
- disabled: p,
26
- required: P
27
- } = x, [i, b] = X(""), a = h(null), k = h(null), { popoverRef: m, froozePopoverPosition: y, handleAnimationEnd: E } = q(), O = g(() => {
22
+ inputRef: R,
23
+ minimalOptions: A,
24
+ isLoading: z,
25
+ disabled: m,
26
+ required: D,
27
+ addOption: P
28
+ } = g, [a, S] = $(""), i = f(null), b = f(null), { popoverRef: l, froozePopoverPosition: E, handleAnimationEnd: O } = q(), k = p(() => {
28
29
  const e = {};
29
30
  return r.forEach((t) => {
30
31
  e[t.value] = t;
31
32
  }), e;
32
- }, [r]), S = (e) => n.includes(e) ? [...n] : [...n, e], T = (e) => n.filter((t) => e !== t), w = (e, t) => {
33
- C ? (y(), c(e), t()) : c(e);
34
- }, f = g(() => i.trim() ? r.filter(({ title: e }) => W(e, i)) : r, [i, r]), I = (e) => {
35
- if (p) return;
36
- m.current && m.current.getAttribute("data-state") === "open" && e.preventDefault();
37
- const t = G(e.currentTarget);
38
- e.defaultPrevented || J(e.currentTarget, t) || a.current && a.current.focus();
39
- }, $ = (e) => {
40
- e.target !== a.current && e.preventDefault();
41
- }, F = (e, t) => {
42
- e.stopPropagation(), c(T(t));
33
+ }, [r]), y = (e) => n.includes(e) ? [...n] : [...n, e], T = (e) => n.filter((t) => e !== t), w = (e, t) => {
34
+ v ? (E(), s(e), t()) : s(e);
35
+ }, F = p(() => a.trim() ? r.filter(({ title: e }) => K(e, a)) : r, [a, r]), I = (e) => {
36
+ if (m) return;
37
+ l.current && l.current.getAttribute("data-state") === "open" && e.preventDefault();
38
+ const t = B(e.currentTarget);
39
+ e.defaultPrevented || X(e.currentTarget, t) || i.current && i.current.focus();
40
+ }, L = (e) => {
41
+ e.target !== i.current && e.preventDefault();
42
+ }, M = (e, t) => {
43
+ e.stopPropagation(), s(T(t));
43
44
  };
44
45
  return /* @__PURE__ */ o(
45
46
  V,
46
47
  {
47
48
  minimal: !0,
48
- ref: m,
49
+ ref: l,
49
50
  sideOffset: 0,
50
51
  matchTarget: "width",
51
- onAnimationEnd: E,
52
+ onAnimationEnd: O,
52
53
  onOpenAutoFocus: (e) => e.preventDefault(),
53
54
  onCloseAutoFocus: (e) => e.preventDefault(),
54
- content: ({ close: e }) => D ? /* @__PURE__ */ o("div", { className: "select-popover-loading", children: /* @__PURE__ */ o(L, { size: 24 }) }) : /* @__PURE__ */ s(H, { maxHeight: 300, children: [
55
- f.length === 0 && /* @__PURE__ */ o("div", { className: "select-tags-empty", children: R }),
56
- f.map(({ value: t, title: u, icon: M }, j) => /* @__PURE__ */ o(
57
- B,
58
- {
59
- active: n.includes(t),
60
- onClick: () => w(S(t), e),
61
- title: u,
62
- icon: M
63
- },
64
- `option-item-${t}-${j}`
65
- ))
66
- ] }),
55
+ content: ({ close: e }) => z ? /* @__PURE__ */ o(U, {}) : /* @__PURE__ */ o(
56
+ Q,
57
+ {
58
+ isActive: (t) => n.includes(t),
59
+ options: F,
60
+ emptyText: C,
61
+ onSelect: (t) => w(y(t), e),
62
+ minimalOptions: A,
63
+ addOption: P
64
+ }
65
+ ),
67
66
  children: /* @__PURE__ */ o(
68
67
  "div",
69
68
  {
70
69
  className: "form",
71
70
  onClick: I,
72
- onMouseDown: $,
73
- "data-size": z,
74
- "data-required": v(P),
75
- children: /* @__PURE__ */ s("div", { className: "select-tags-container", children: [
76
- /* @__PURE__ */ s("div", { className: "select-tags", children: [
71
+ onMouseDown: L,
72
+ "data-size": N,
73
+ "data-required": h(D),
74
+ children: /* @__PURE__ */ u("div", { className: "select-tags-container", children: [
75
+ /* @__PURE__ */ u("div", { className: "select-tags", children: [
77
76
  n.length > 0 && /* @__PURE__ */ o(
78
77
  "div",
79
78
  {
80
79
  className: "tag-container",
81
- ref: k,
80
+ ref: b,
82
81
  role: "listbox",
83
- "data-readonly": v(l),
84
- children: n.map((e, t) => /* @__PURE__ */ s("div", { className: "tag", children: [
85
- /* @__PURE__ */ o("span", { className: "tag-name", children: O[e].title }),
86
- /* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (u) => F(u, e), children: /* @__PURE__ */ o(d, { className: "tag-close-icon", icon: Q, size: "xxxs" }) })
82
+ "data-readonly": h(c),
83
+ children: n.map((e, t) => /* @__PURE__ */ u("div", { className: "tag", children: [
84
+ /* @__PURE__ */ o("span", { className: "tag-name", children: k[e].title }),
85
+ /* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (j) => M(j, e), children: /* @__PURE__ */ o(d, { className: "tag-close-icon", icon: H, size: "xxxs" }) })
87
86
  ] }, `tag-option-${e}-${t}`))
88
87
  }
89
88
  ),
90
- (!l || n.length === 0) && /* @__PURE__ */ o(
89
+ (!c || n.length === 0) && /* @__PURE__ */ o(
91
90
  "input",
92
91
  {
93
- ref: K([A, a]),
92
+ ref: G([R, i]),
94
93
  type: "text",
95
94
  autoCapitalize: "none",
96
95
  autoComplete: "off",
97
96
  autoCorrect: "off",
98
97
  className: "form-input",
99
98
  spellCheck: !1,
100
- value: i,
101
- disabled: p,
102
- readOnly: l,
103
- placeholder: N,
104
- onChange: ({ target: e }) => b(e.value)
99
+ value: a,
100
+ disabled: m,
101
+ readOnly: c,
102
+ placeholder: x,
103
+ onChange: ({ target: e }) => S(e.value)
105
104
  }
106
105
  )
107
106
  ] }),
108
- /* @__PURE__ */ o(d, { className: "expand-icon", icon: U, size: "xxxs" })
107
+ /* @__PURE__ */ o(d, { className: "expand-icon", icon: J, size: "xxxs" })
109
108
  ] })
110
109
  }
111
110
  )
@@ -113,5 +112,5 @@ const le = (x) => {
113
112
  );
114
113
  };
115
114
  export {
116
- le as SelectTags
115
+ se as SelectTags
117
116
  };
@@ -2,11 +2,11 @@ import { jsx as u } from "react/jsx-runtime";
2
2
  import { Popover as T } from "./bundle.es10.js";
3
3
  import { Input as w } from "./bundle.es13.js";
4
4
  import { useState as A, useRef as j } from "react";
5
- import { Calendar as E } from "./bundle.es54.js";
6
- import { useDayDisableCheker as N } from "./bundle.es55.js";
5
+ import { Calendar as E } from "./bundle.es55.js";
6
+ import { useDayDisableCheker as N } from "./bundle.es56.js";
7
7
  import { getNum as h, formatTime as v } from "@companix/utils-js";
8
- import { removeDigits as O } from "./bundle.es56.js";
9
- import { SelectRightElements as Y } from "./bundle.es57.js";
8
+ import { removeDigits as O } from "./bundle.es57.js";
9
+ import { SelectRightElements as Y } from "./bundle.es58.js";
10
10
  const i = {
11
11
  char: "-",
12
12
  toString: (e) => {
@@ -1,8 +1,8 @@
1
1
  import { jsxs as D, jsx as h } from "react/jsx-runtime";
2
2
  import { useMemo as M, useEffect as C } from "react";
3
3
  import { Select as c } from "./bundle.es12.js";
4
- import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es56.js";
5
- import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es58.js";
4
+ import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es57.js";
5
+ import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es59.js";
6
6
  const B = ({
7
7
  min: o = j,
8
8
  max: e = N,
@@ -1,8 +1,8 @@
1
1
  import { jsx as g } from "react/jsx-runtime";
2
2
  import { useRef as _, useMemo as b, useState as P, useEffect as j } from "react";
3
3
  import { getNum as v } from "@companix/utils-js";
4
- import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es56.js";
5
- import { SelectRightElements as w } from "./bundle.es57.js";
4
+ import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es57.js";
5
+ import { SelectRightElements as w } from "./bundle.es58.js";
6
6
  import { Select as y } from "./bundle.es12.js";
7
7
  import { Input as z } from "./bundle.es13.js";
8
8
  const r = {
@@ -1,6 +1,6 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
2
  import { useState as h, useEffect as c, createContext as f, useContext as w } from "react";
3
- import { getColorScheme as v, updateDOM as m } from "./bundle.es59.js";
3
+ import { getColorScheme as v, updateDOM as m } from "./bundle.es60.js";
4
4
  const i = f({
5
5
  setColorScheme: () => {
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { hash as m } from "@companix/utils-js";
3
3
  import { useRef as n, useMemo as s } from "react";
4
- import { Viewport as p } from "./bundle.es60.js";
4
+ import { Viewport as p } from "./bundle.es61.js";
5
5
  const a = (t = {}) => {
6
6
  const e = {
7
7
  emit: (r) => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { hash as r } from "@companix/utils-js";
3
- import { Viewport as a } from "./bundle.es61.js";
3
+ import { Viewport as a } from "./bundle.es62.js";
4
4
  import { useRef as c, useMemo as h } from "react";
5
5
  const m = (i = {}) => {
6
6
  const o = {
@@ -2,7 +2,7 @@ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-toast";
3
3
  import { attr as T } from "@companix/utils-browser";
4
4
  import { useState as d, useRef as b, useEffect as j, useLayoutEffect as E } from "react";
5
- import { RemoveListener as I } from "./bundle.es51.js";
5
+ import { RemoveListener as I } from "./bundle.es52.js";
6
6
  const m = (o) => {
7
7
  const [r, u] = d(!0), [p, f] = d(!1), s = b(null), {
8
8
  appearance: C = "neutral",
@@ -4,7 +4,7 @@ import { attr as l } from "@companix/utils-browser";
4
4
  import { forwardRef as y, useRef as S, useCallback as T } from "react";
5
5
  import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
6
6
  import { mergeRefs as w } from "react-merge-refs";
7
- import { SelectRightElements as z } from "./bundle.es57.js";
7
+ import { SelectRightElements as z } from "./bundle.es58.js";
8
8
  const V = y(
9
9
  ({
10
10
  required: a,
@@ -1,44 +1,46 @@
1
- import { jsxs as d, jsx as i } from "react/jsx-runtime";
2
- import { useEffect as x } from "react";
3
- import { OptionItem as e } from "./bundle.es14.js";
4
- import { OptionsList as O } from "./bundle.es16.js";
5
- import { Icon as u } from "./bundle.es33.js";
6
- import { faPlus as v } from "@companix/icons-solid";
7
- const S = (n) => {
1
+ import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
+ import { useEffect as O } from "react";
3
+ import { OptionItem as n } from "./bundle.es14.js";
4
+ import { OptionsList as u } from "./bundle.es16.js";
5
+ import { Icon as v } from "./bundle.es33.js";
6
+ import { faPlus as h } from "@companix/icons-solid";
7
+ const L = (s) => {
8
8
  const {
9
- active: m,
10
- onOpened: r,
11
- addOption: o,
12
- scrollboxRef: c,
9
+ isActive: m,
10
+ onOpened: c,
11
+ addOption: t,
12
+ scrollboxRef: l,
13
13
  optionsWrapperRef: p,
14
- options: s,
15
- onSelect: l,
16
- minimalOptions: a
17
- } = n;
18
- return x(() => {
19
- r?.();
20
- }, []), /* @__PURE__ */ d(O, { scrollboxRef: c, optionsWrapperRef: p, maxHeight: 300, children: [
21
- o && /* @__PURE__ */ i(
22
- e,
14
+ options: i,
15
+ onSelect: r,
16
+ minimalOptions: a,
17
+ emptyText: f
18
+ } = s;
19
+ return O(() => {
20
+ c?.();
21
+ }, []), /* @__PURE__ */ x(u, { scrollboxRef: l, optionsWrapperRef: p, maxHeight: 300, children: [
22
+ t && /* @__PURE__ */ e(
23
+ n,
23
24
  {
24
25
  className: "select-add-option",
25
- icon: /* @__PURE__ */ i(u, { icon: v }),
26
- title: o.text,
27
- onClick: o.onClick
26
+ icon: /* @__PURE__ */ e(v, { icon: h }),
27
+ title: t.text,
28
+ onClick: t.onClick
28
29
  }
29
30
  ),
30
- s.map((t, f) => /* @__PURE__ */ i(
31
- e,
31
+ i.length === 0 && !t && /* @__PURE__ */ e("div", { className: "select-tags-empty", children: f }),
32
+ i.map((o, d) => /* @__PURE__ */ e(
33
+ n,
32
34
  {
33
- active: m === t.value,
34
- onClick: () => l?.(t.value),
35
+ active: m(o.value),
36
+ onClick: () => r?.(o.value),
35
37
  minimal: a,
36
- ...t
38
+ ...o
37
39
  },
38
- `select-option-${f}`
40
+ `select-option-${d}`
39
41
  ))
40
42
  ] });
41
43
  };
42
44
  export {
43
- S as SelectOptions
45
+ L as SelectOptionsList
44
46
  };
@@ -1,26 +1,6 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { forwardRef as m, useCallback as i } from "react";
3
- import c from "react-input-mask";
4
- const I = m(
5
- ({ mask: r, maskChar: f = "_", onChange: n, onValueChange: o, ...a }, e) => {
6
- const p = i(
7
- (t) => {
8
- n?.(t), o?.(t.target.value, t.target);
9
- },
10
- [n, o]
11
- );
12
- return r ? /* @__PURE__ */ u(
13
- c,
14
- {
15
- inputRef: e,
16
- mask: r,
17
- maskChar: f,
18
- onChange: p,
19
- ...a
20
- }
21
- ) : /* @__PURE__ */ u("input", { ref: e, ...a, onChange: p });
22
- }
23
- );
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Spinner as r } from "./bundle.es6.js";
3
+ const t = () => /* @__PURE__ */ e("div", { className: "select-popover-loading", children: /* @__PURE__ */ e(r, { size: 24 }) });
24
4
  export {
25
- I as InputElement
5
+ t as SelectLoader
26
6
  };