@companix/uikit 0.0.12 → 0.0.15

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.
@@ -2,7 +2,6 @@ import { FormProps } from '../Input';
2
2
  import { CalendarProps } from './Calendar';
3
3
  interface DatePickerProps extends Omit<CalendarProps, 'onChange'>, Omit<FormProps, 'value' | 'onChange' | 'rightElement'> {
4
4
  onChange?: (value: Date | null) => void;
5
- placeholder?: string;
6
5
  clearButton?: boolean;
7
6
  clearButtonIcon?: boolean;
8
7
  children?: React.ReactNode;
@@ -8,7 +8,7 @@ export interface FormProps extends React.HTMLAttributes<HTMLDivElement> {
8
8
  readOnly?: boolean;
9
9
  onValueChange?: (value: string, targetElement: HTMLInputElement) => void;
10
10
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
11
- inputRef?: React.RefObject<HTMLInputElement>;
11
+ inputRef?: React.Ref<HTMLInputElement>;
12
12
  size?: 'sm' | 'md' | 'lg';
13
13
  fill?: boolean;
14
14
  mask?: string;
@@ -9,6 +9,7 @@ export interface SelectFormProps extends React.HTMLAttributes<HTMLDivElement> {
9
9
  fill?: boolean;
10
10
  clearButton?: boolean;
11
11
  clearButtonIcon?: boolean;
12
+ inputRef?: React.Ref<HTMLInputElement>;
12
13
  onClear?: (event: React.MouseEvent<HTMLButtonElement>) => void;
13
14
  }
14
15
  export declare const SelectInput: import('react').ForwardRefExoticComponent<SelectFormProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,15 +1,20 @@
1
- import { FormProps } from '../Input';
2
1
  import { Option } from '../types';
3
- interface SelectProps<T> extends Omit<FormProps, 'value' | 'onChange' | 'rightElement'> {
4
- options: Option<T>[];
2
+ import { SelectFormProps } from './SelectInput';
3
+ interface Cleanable<T> {
4
+ clearButton: true;
5
5
  onChange: (event: T | null) => void;
6
- placeholder?: string;
7
- clearButton?: boolean;
8
- clearButtonIcon?: boolean;
6
+ }
7
+ interface UnCleanable<T> {
8
+ clearButton?: false;
9
+ onChange: (event: T) => void;
10
+ }
11
+ type DependedValueType<T> = Cleanable<T> | UnCleanable<T>;
12
+ type SelectProps<T> = Omit<SelectFormProps, 'value' | 'onChange' | 'closeButton'> & DependedValueType<T> & {
9
13
  value: T | null;
14
+ options: Option<T>[];
10
15
  children?: React.ReactNode;
11
16
  minimalOptions?: boolean;
12
17
  matchTarget?: 'width' | 'min-width';
13
- }
18
+ };
14
19
  export declare const Select: <T>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
15
20
  export {};
@@ -11,5 +11,6 @@ export interface SelectTagsProps<T> {
11
11
  emptyText?: string;
12
12
  size?: 'sm' | 'md' | 'lg';
13
13
  fill?: boolean;
14
+ inputRef?: React.Ref<HTMLInputElement>;
14
15
  }
15
16
  export declare const SelectTags: <T extends string | number>(props: SelectTagsProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,7 @@ interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
2
2
  grow?: boolean;
3
3
  onResize?: (el: HTMLTextAreaElement) => void;
4
4
  fill?: boolean;
5
+ textAreaRef?: React.Ref<HTMLTextAreaElement>;
5
6
  }
6
- export declare const TextArea: ({ onResize, grow, value, onChange, disabled, required, rows, fill, ...textAreaProps }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const TextArea: ({ onResize, grow, value, onChange, disabled, required, rows, fill, textAreaRef, ...textAreaProps }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -1,8 +1,8 @@
1
1
  export interface UseLoadingProps<T = unknown> {
2
- onClick: (startLoad: () => void, param: T) => Promise<any>;
2
+ onClick: (startLoad: () => void, value: T) => Promise<any>;
3
3
  }
4
4
  export declare const useLoading: <T = unknown>({ onClick }: UseLoadingProps<T>) => {
5
- handleClick: (param: T) => void;
5
+ handleClick: (value: T) => void;
6
6
  isLoading: boolean;
7
7
  isError: boolean;
8
8
  };
@@ -1,36 +1,38 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
- import { useResizeTextarea as p } from "./bundle.es38.js";
3
- import { attr as e, callMultiple as x } from "@companix/utils-browser";
4
- import { useEffect as u } from "react";
5
- const R = ({
6
- onResize: s,
2
+ import { useResizeTextarea as x } from "./bundle.es38.js";
3
+ import { attr as e, callMultiple as u } from "@companix/utils-browser";
4
+ import { useEffect as z } from "react";
5
+ import { mergeRefs as R } from "react-merge-refs";
6
+ const q = ({
7
+ onResize: m,
7
8
  grow: a = !1,
8
9
  value: t,
9
- onChange: i,
10
+ onChange: s,
10
11
  disabled: o,
11
- required: m,
12
+ required: i,
12
13
  rows: l = 2,
13
- fill: c = !1,
14
+ fill: p = !1,
15
+ textAreaRef: c,
14
16
  ...d
15
17
  }) => {
16
- const [n, r] = p(s, a);
17
- return u(r, [r, t]), /* @__PURE__ */ f(
18
+ const [n, r] = x(m, a);
19
+ return z(r, [r, t]), /* @__PURE__ */ f(
18
20
  "div",
19
21
  {
20
22
  className: "form form-textarea",
21
- "data-required": e(m),
23
+ "data-required": e(i),
22
24
  "data-disabled": e(o),
23
- "data-fill": e(c),
25
+ "data-fill": e(p),
24
26
  children: /* @__PURE__ */ f(
25
27
  "textarea",
26
28
  {
27
29
  className: "form-input",
28
30
  "data-grow": e(a),
29
31
  value: t,
30
- ref: n,
32
+ ref: R([c, n]),
31
33
  rows: l,
32
34
  disabled: o,
33
- onChange: x(i, r),
35
+ onChange: u(s, r),
34
36
  ...d
35
37
  }
36
38
  )
@@ -38,5 +40,5 @@ const R = ({
38
40
  );
39
41
  };
40
42
  export {
41
- R as TextArea
43
+ q as TextArea
42
44
  };
@@ -1,13 +1,14 @@
1
1
  import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
2
  import { useFroozeClosing as F } from "./bundle.es31.js";
3
- import { Popover as I } from "./bundle.es6.js";
4
- import { OptionItem as L } from "./bundle.es10.js";
5
- import { OptionsList as M } from "./bundle.es12.js";
6
- import { useState as j, useRef as d, useMemo as h } from "react";
3
+ import { Popover as L } from "./bundle.es6.js";
4
+ import { OptionItem as M } from "./bundle.es10.js";
5
+ import { OptionsList as j } from "./bundle.es12.js";
6
+ import { useState as V, useRef as d, useMemo as h } from "react";
7
7
  import { Icon as g } from "./bundle.es35.js";
8
- import { faClose as V, faChevronDown as B } from "@fortawesome/free-solid-svg-icons";
9
- import { attr as H, getActiveElementByAnotherElement as Q, contains as q } from "@companix/utils-browser";
10
- const ee = (v) => {
8
+ import { faClose as B, faChevronDown as H } from "@fortawesome/free-solid-svg-icons";
9
+ import { attr as Q, getActiveElementByAnotherElement as q, contains as G } from "@companix/utils-browser";
10
+ import { mergeRefs as J } from "react-merge-refs";
11
+ const ne = (v) => {
11
12
  const {
12
13
  options: r,
13
14
  closeAfterSelect: x,
@@ -15,46 +16,47 @@ const ee = (v) => {
15
16
  onChange: l,
16
17
  emptyText: N = "Ничего не найдено",
17
18
  readOnly: m,
18
- size: z = "md",
19
+ size: R = "md",
19
20
  value: n,
21
+ inputRef: z,
20
22
  disabled: f
21
- } = v, [a, A] = j(""), i = d(null), y = d(null), { popoverRef: u, froozePopoverPosition: D, handleAnimationEnd: R } = F(), b = h(() => {
23
+ } = v, [i, A] = V(""), a = d(null), y = d(null), { popoverRef: u, froozePopoverPosition: D, handleAnimationEnd: b } = F(), w = h(() => {
22
24
  const e = {};
23
25
  return r.forEach((t) => {
24
26
  e[t.value] = t;
25
27
  }), e;
26
- }, [r]), w = (e) => n.includes(e) ? [...n] : [...n, e], E = (e) => n.filter((t) => e !== t), O = (e, t) => {
28
+ }, [r]), E = (e) => n.includes(e) ? [...n] : [...n, e], O = (e) => n.filter((t) => e !== t), P = (e, t) => {
27
29
  x ? (D(), l(e), t()) : l(e);
28
- }, p = h(() => a.trim() ? r.filter(({ title: e }) => {
29
- const t = e.toLowerCase(), s = a.trim().toLowerCase();
30
+ }, p = h(() => i.trim() ? r.filter(({ title: e }) => {
31
+ const t = e.toLowerCase(), s = i.trim().toLowerCase();
30
32
  return t.indexOf(s) >= 0;
31
- }) : r, [a, r]), P = (e) => {
33
+ }) : r, [i, r]), T = (e) => {
32
34
  if (f) return;
33
35
  u.current && u.current.getAttribute("data-state") === "open" && e.preventDefault();
34
- const t = Q(e.currentTarget);
35
- e.defaultPrevented || q(e.currentTarget, t) || i.current && i.current.focus();
36
- }, T = (e) => {
37
- e.target !== i.current && e.preventDefault();
38
- }, k = (e, t) => {
39
- e.stopPropagation(), l(E(t));
36
+ const t = q(e.currentTarget);
37
+ e.defaultPrevented || G(e.currentTarget, t) || a.current && a.current.focus();
38
+ }, k = (e) => {
39
+ e.target !== a.current && e.preventDefault();
40
+ }, I = (e, t) => {
41
+ e.stopPropagation(), l(O(t));
40
42
  };
41
43
  return /* @__PURE__ */ o(
42
- I,
44
+ L,
43
45
  {
44
46
  minimal: !0,
45
47
  ref: u,
46
48
  sideOffset: 0,
47
49
  matchTarget: "width",
48
- onAnimationEnd: R,
50
+ onAnimationEnd: b,
49
51
  onOpenAutoFocus: (e) => e.preventDefault(),
50
52
  onCloseAutoFocus: (e) => e.preventDefault(),
51
- content: ({ close: e }) => /* @__PURE__ */ c(M, { maxHeight: 300, children: [
53
+ content: ({ close: e }) => /* @__PURE__ */ c(j, { maxHeight: 300, children: [
52
54
  p.length === 0 && /* @__PURE__ */ o("div", { className: "select-tags-empty", children: N }),
53
55
  p.map(({ value: t, title: s, icon: S }, $) => /* @__PURE__ */ o(
54
- L,
56
+ M,
55
57
  {
56
58
  active: n.includes(t),
57
- onClick: () => O(w(t), e),
59
+ onClick: () => P(E(t), e),
58
60
  title: s,
59
61
  icon: S
60
62
  },
@@ -65,9 +67,9 @@ const ee = (v) => {
65
67
  "div",
66
68
  {
67
69
  className: "form",
68
- onClick: P,
69
- onMouseDown: T,
70
- "data-size": z,
70
+ onClick: T,
71
+ onMouseDown: k,
72
+ "data-size": R,
71
73
  children: /* @__PURE__ */ c("div", { className: "select-tags-container", children: [
72
74
  /* @__PURE__ */ c("div", { className: "select-tags", children: [
73
75
  n.length > 0 && /* @__PURE__ */ o(
@@ -76,24 +78,24 @@ const ee = (v) => {
76
78
  className: "tag-container",
77
79
  ref: y,
78
80
  role: "listbox",
79
- "data-readonly": H(m),
81
+ "data-readonly": Q(m),
80
82
  children: n.map((e, t) => /* @__PURE__ */ c("div", { className: "tag", children: [
81
- /* @__PURE__ */ o("span", { className: "tag-name", children: b[e].title }),
82
- /* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (s) => k(s, e), children: /* @__PURE__ */ o(g, { className: "tag-close-icon", icon: V, size: "xxxs" }) })
83
+ /* @__PURE__ */ o("span", { className: "tag-name", children: w[e].title }),
84
+ /* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (s) => I(s, e), children: /* @__PURE__ */ o(g, { className: "tag-close-icon", icon: B, size: "xxxs" }) })
83
85
  ] }, `tag-option-${e}-${t}`))
84
86
  }
85
87
  ),
86
88
  (!m || n.length === 0) && /* @__PURE__ */ o(
87
89
  "input",
88
90
  {
89
- ref: i,
91
+ ref: J([z, a]),
90
92
  type: "text",
91
93
  autoCapitalize: "none",
92
94
  autoComplete: "off",
93
95
  autoCorrect: "off",
94
96
  className: "form-input",
95
97
  spellCheck: !1,
96
- value: a,
98
+ value: i,
97
99
  disabled: f,
98
100
  readOnly: m,
99
101
  placeholder: C,
@@ -101,7 +103,7 @@ const ee = (v) => {
101
103
  }
102
104
  )
103
105
  ] }),
104
- /* @__PURE__ */ o(g, { className: "expand-icon", icon: B, size: "xxxs" })
106
+ /* @__PURE__ */ o(g, { className: "expand-icon", icon: H, size: "xxxs" })
105
107
  ] })
106
108
  }
107
109
  )
@@ -109,5 +111,5 @@ const ee = (v) => {
109
111
  );
110
112
  };
111
113
  export {
112
- ee as SelectTags
114
+ ne as SelectTags
113
115
  };
@@ -1,53 +1,55 @@
1
1
  import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
- import b from "classnames";
2
+ import R from "classnames";
3
3
  import { attr as r } from "@companix/utils-browser";
4
- import { forwardRef as g, useRef as w, useCallback as y } from "react";
4
+ import { forwardRef as b, useRef as w, useCallback as y } from "react";
5
5
  import { Icon as a } from "./bundle.es35.js";
6
- import { faClose as D, faChevronDown as R } from "@fortawesome/free-solid-svg-icons";
7
- import { VisuallyHidden as T } from "@radix-ui/react-visually-hidden";
8
- const V = g(
6
+ import { faClose as D, faChevronDown as T } from "@fortawesome/free-solid-svg-icons";
7
+ import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
8
+ import { mergeRefs as O } from "react-merge-refs";
9
+ const J = b(
9
10
  ({
10
11
  required: u,
11
12
  size: d,
12
13
  fill: m,
13
14
  leftElement: l,
14
- className: p,
15
+ className: f,
15
16
  value: o,
16
- clearButton: f,
17
+ clearButton: p,
17
18
  placeholder: C,
18
19
  clearButtonIcon: h,
19
20
  disabled: s,
20
21
  onClear: I,
22
+ inputRef: N,
21
23
  ...i
22
- }, N) => {
23
- const e = w(null), k = y(
24
+ }, k) => {
25
+ const e = w(null), x = y(
24
26
  (t) => {
25
27
  if (!e.current || !document)
26
28
  return;
27
29
  t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
28
30
  },
29
31
  [e]
30
- ), x = (t) => {
32
+ ), v = (t) => {
31
33
  document && document.activeElement === e.current && t.preventDefault();
32
- }, v = (t) => {
33
- s || k(t);
34
34
  }, F = (t) => {
35
- x(t);
35
+ s || x(t);
36
+ }, g = (t) => {
37
+ v(t);
36
38
  }, z = (t) => {
37
39
  e.current && e.current.focus(), I?.(t);
38
40
  };
39
41
  return /* @__PURE__ */ n(
40
42
  "div",
41
43
  {
42
- ref: N,
43
- className: b("form select", p),
44
+ ref: k,
45
+ className: R("form select", f),
44
46
  "data-size": d ?? "md",
45
47
  "data-fill": r(m),
46
48
  "data-required": r(u),
47
49
  "data-disabled": r(s),
48
- onMouseDown: F,
50
+ onMouseDown: g,
49
51
  ...i,
50
- onClick: v,
52
+ onClick: F,
51
53
  children: [
52
54
  /* @__PURE__ */ n("div", { className: "select-layout form-input", children: [
53
55
  l && /* @__PURE__ */ c("div", { className: "select-element", children: l }),
@@ -56,14 +58,14 @@ const V = g(
56
58
  o
57
59
  ] }) }),
58
60
  /* @__PURE__ */ n("div", { className: "select-element", children: [
59
- f && o && /* @__PURE__ */ c("button", { className: "select-close-button", onClick: z, children: h ?? /* @__PURE__ */ c(a, { className: "select-close-icon", icon: D, size: "xxxs" }) }),
60
- /* @__PURE__ */ c(a, { className: "expand-icon select-expand", icon: R, size: "xxxs" })
61
+ p && o && /* @__PURE__ */ c("button", { className: "select-close-button", onClick: z, children: h ?? /* @__PURE__ */ c(a, { className: "select-close-icon", icon: D, size: "xxxs" }) }),
62
+ /* @__PURE__ */ c(a, { className: "expand-icon select-expand", icon: T, size: "xxxs" })
61
63
  ] })
62
64
  ] }),
63
- /* @__PURE__ */ c(T, { asChild: !0, children: /* @__PURE__ */ c(
65
+ /* @__PURE__ */ c(j, { asChild: !0, children: /* @__PURE__ */ c(
64
66
  "input",
65
67
  {
66
- ref: e,
68
+ ref: O([N, e]),
67
69
  autoComplete: "off",
68
70
  autoCapitalize: "none",
69
71
  autoCorrect: "off",
@@ -79,5 +81,5 @@ const V = g(
79
81
  }
80
82
  );
81
83
  export {
82
- V as SelectInput
84
+ J as SelectInput
83
85
  };
@@ -1,23 +1,16 @@
1
- import { useState as a } from "react";
2
- const l = ({ onClick: i }) => {
3
- const [e, s] = a({ isLoading: !1, isError: !1 });
4
- return {
5
- ...e,
6
- handleClick: (o) => {
7
- e.isLoading || i(() => s({ isLoading: !0, isError: !1 }), o).then(() => {
8
- s({
9
- isLoading: !1,
10
- isError: !1
11
- });
12
- }).catch((r) => {
13
- console.log(r), s({
14
- isLoading: !1,
15
- isError: !0
16
- });
17
- });
18
- }
19
- };
1
+ import { useState as e } from "react";
2
+ const d = ({ onClick: t }) => {
3
+ const [a, s] = e({ isLoading: !1, isError: !1 });
4
+ return { ...a, handleClick: (r) => {
5
+ a.isLoading || t(() => {
6
+ s({ isLoading: !0, isError: !1 });
7
+ }, r).then(() => {
8
+ s({ isLoading: !1, isError: !1 });
9
+ }).catch(() => {
10
+ s({ isLoading: !1, isError: !0 });
11
+ });
12
+ } };
20
13
  };
21
14
  export {
22
- l as useLoading
15
+ d as useLoading
23
16
  };
@@ -52,7 +52,7 @@ const y = ({
52
52
  value: e,
53
53
  minimalOptions: !0,
54
54
  matchTarget: "min-width",
55
- onChange: (t) => x(t || 0)
55
+ onChange: (t) => x(t)
56
56
  }
57
57
  ),
58
58
  /* @__PURE__ */ o(
@@ -65,7 +65,7 @@ const y = ({
65
65
  value: r,
66
66
  minimalOptions: !0,
67
67
  matchTarget: "min-width",
68
- onChange: (t) => M(t || 0)
68
+ onChange: (t) => M(t)
69
69
  }
70
70
  )
71
71
  ] }),
@@ -1,87 +1,85 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { useMemo as E, useEffect as I } from "react";
2
+ import { useMemo as A, useEffect as E } from "react";
3
3
  import { OptionsList as b } from "./bundle.es12.js";
4
- import { OptionItem as B } from "./bundle.es10.js";
5
- import { Popover as F } from "./bundle.es6.js";
4
+ import { OptionItem as F } from "./bundle.es10.js";
5
+ import { Popover as I } from "./bundle.es6.js";
6
6
  import { useFroozeClosing as z } from "./bundle.es31.js";
7
- import { SelectInput as D } from "./bundle.es32.js";
8
- import { useScrollListController as L } from "./bundle.es33.js";
9
- const y = (c) => {
7
+ import { SelectInput as B } from "./bundle.es32.js";
8
+ import { useScrollListController as D } from "./bundle.es33.js";
9
+ const q = (c) => {
10
10
  const {
11
- options: e,
11
+ options: t,
12
12
  onChange: i,
13
- minimalOptions: a,
14
- clearButton: m,
15
- clearButtonIcon: u,
16
- matchTarget: f = "width",
17
13
  value: l,
18
- children: n,
14
+ minimalOptions: a,
15
+ matchTarget: m = "width",
16
+ children: u,
19
17
  disabled: s,
20
- ...d
21
- } = c, p = E(() => {
22
- const o = e.findIndex((t) => t.value === l);
18
+ clearButton: e,
19
+ ...f
20
+ } = c, p = A(() => {
21
+ const o = t.findIndex((n) => n.value === l);
23
22
  return {
24
23
  index: o,
25
- option: e[o]
24
+ option: t[o]
26
25
  };
27
- }, [e, l]), v = p.option?.value ?? null, { popoverRef: h, froozePopoverPosition: x, handleAnimationEnd: O } = z(), { scrollToElement: C, optionsWrapperRef: g, scrollBoxRef: P } = L(), R = (o, t) => {
28
- x(), i(o), t();
29
- }, S = (o) => {
30
- o.stopPropagation(), i(null);
31
- }, A = () => {
32
- p.index !== -1 && C(p.index, !0);
26
+ }, [t, l]), d = p.option?.value ?? null, { popoverRef: v, froozePopoverPosition: h, handleAnimationEnd: x } = z(), { scrollToElement: O, optionsWrapperRef: C, scrollBoxRef: g } = D(), P = (o, n) => {
27
+ h(), i(o), n();
28
+ }, R = (o) => {
29
+ o.stopPropagation(), e && i(null);
30
+ }, S = () => {
31
+ p.index !== -1 && O(p.index, !0);
33
32
  };
34
33
  return /* @__PURE__ */ r(
35
- F,
34
+ I,
36
35
  {
37
36
  minimal: !0,
38
- ref: h,
37
+ ref: v,
39
38
  sideOffset: 0,
40
- matchTarget: f,
41
- onAnimationEnd: O,
39
+ matchTarget: m,
40
+ onAnimationEnd: x,
42
41
  onOpenAutoFocus: (o) => o.preventDefault(),
43
42
  onCloseAutoFocus: (o) => o.preventDefault(),
44
43
  disabled: s,
45
44
  content: ({ close: o }) => /* @__PURE__ */ r(
46
- T,
45
+ L,
47
46
  {
48
- options: e,
49
- active: v,
50
- scrollboxRef: P,
51
- optionsWrapperRef: g,
47
+ options: t,
48
+ active: d,
49
+ scrollboxRef: g,
50
+ optionsWrapperRef: C,
52
51
  minimalOptions: a,
53
- onOpened: A,
54
- onSelect: (t) => R(t, o)
52
+ onOpened: S,
53
+ onSelect: (n) => P(n, o)
55
54
  }
56
55
  ),
57
- children: n ?? /* @__PURE__ */ r(
58
- D,
56
+ children: u ?? /* @__PURE__ */ r(
57
+ B,
59
58
  {
60
- ...d,
59
+ ...f,
61
60
  disabled: s,
61
+ clearButton: e,
62
62
  value: p.option?.title ?? "",
63
- onClear: S,
64
- clearButton: m,
65
- clearButtonIcon: u
63
+ onClear: R
66
64
  }
67
65
  )
68
66
  }
69
67
  );
70
- }, T = (c) => {
71
- const { active: e, onOpened: i, scrollboxRef: a, optionsWrapperRef: m, options: u, onSelect: f, minimalOptions: l } = c;
72
- return I(() => {
68
+ }, L = (c) => {
69
+ const { active: t, onOpened: i, scrollboxRef: l, optionsWrapperRef: a, options: m, onSelect: u, minimalOptions: s } = c;
70
+ return E(() => {
73
71
  i?.();
74
- }, []), /* @__PURE__ */ r(b, { scrollboxRef: a, optionsWrapperRef: m, maxHeight: 300, children: u.map((n, s) => /* @__PURE__ */ r(
75
- B,
72
+ }, []), /* @__PURE__ */ r(b, { scrollboxRef: l, optionsWrapperRef: a, maxHeight: 300, children: m.map((e, f) => /* @__PURE__ */ r(
73
+ F,
76
74
  {
77
- active: e === n.value,
78
- onClick: () => f?.(n.value),
79
- minimal: l,
80
- ...n
75
+ active: t === e.value,
76
+ onClick: () => u?.(e.value),
77
+ minimal: s,
78
+ ...e
81
79
  },
82
- `option-item-${n.value}-${s}`
80
+ `option-item-${e.value}-${f}`
83
81
  )) });
84
82
  };
85
83
  export {
86
- y as Select
84
+ q as Select
87
85
  };
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.0.12",
3
+ "version": "0.0.15",
4
4
  "module": "./dist/bundle.es.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
7
7
  "files": [
8
- "dist",
9
- "README.md"
8
+ "dist"
10
9
  ],
11
- "author": "Pavel Victorov.",
10
+ "author": "Pavel Victorov",
12
11
  "scripts": {
13
12
  "echo": "echo \"uikit\"",
14
13
  "dev": "vite --config vite.config.ts",