@companix/uikit 0.0.63 → 0.0.64

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.
@@ -1,122 +1,44 @@
1
- import { jsx as o, jsxs as p } from "react/jsx-runtime";
2
- import { useFroozeClosing as M } from "./bundle.es47.js";
3
- import { Popover as j } from "./bundle.es10.js";
4
- import { useState as q, useRef as h, useMemo as V } from "react";
5
- import { Icon as g } from "./bundle.es33.js";
6
- import { attr as i, getActiveElementByAnotherElement as $, contains as B } from "@companix/utils-browser";
7
- import { mergeRefs as L } from "react-merge-refs";
8
- import { faXmark as X, faChevronDown as G } from "@companix/icons-solid";
9
- import { OptionsPopover as H } from "./bundle.es50.js";
10
- import { matchPattern as J } from "@companix/utils-js";
11
- const ne = (a) => {
12
- const {
13
- closeAfterSelect: v,
14
- placeholder: C,
15
- onChange: l,
16
- onInputChange: x,
17
- readOnly: c,
18
- size: N = "md",
19
- fill: O,
20
- value: n,
21
- inputRef: R,
22
- disabled: u,
23
- required: A,
24
- // options popover
25
- ...P
26
- } = a, [f, b] = q(""), s = h(null), z = h(null), { popoverRef: d, froozePopoverPosition: D, handleAnimationEnd: E } = M(), S = (e) => n.includes(e) ? [...n] : [...n, e], k = (e) => n.filter((t) => e !== t), I = (e, t) => {
27
- v ? (D(), l(e), t()) : l(e);
28
- }, w = (e) => {
29
- if (u) return;
30
- d.current && d.current.getAttribute("data-state") === "open" && e.preventDefault();
31
- const t = $(e.currentTarget);
32
- e.defaultPrevented || B(e.currentTarget, t) || s.current && s.current.focus();
33
- }, y = (e) => {
34
- e.target !== s.current && e.preventDefault();
35
- }, F = (e, t) => {
36
- e.stopPropagation(), l(k(t));
37
- }, T = ({ target: e }) => {
38
- b(e.value), x?.(e.value);
39
- }, m = V(() => {
40
- const e = {};
41
- return (a.options ?? a.defaultOptions ?? []).forEach((r) => {
42
- e[r.value] = r;
43
- }), e;
44
- }, [a.options, a.defaultOptions]);
45
- return /* @__PURE__ */ o(
46
- j,
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useResizeTextarea as x } from "./bundle.es55.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,
8
+ grow: a = !1,
9
+ value: t,
10
+ onChange: s,
11
+ disabled: o,
12
+ required: i,
13
+ rows: l = 2,
14
+ fill: p = !1,
15
+ textAreaRef: c,
16
+ ...d
17
+ }) => {
18
+ const [n, r] = x(m, a);
19
+ return z(r, [r, t]), /* @__PURE__ */ f(
20
+ "div",
47
21
  {
48
- minimal: !0,
49
- ref: d,
50
- sideOffset: 0,
51
- matchTarget: "width",
52
- onAnimationEnd: E,
53
- onOpenAutoFocus: (e) => e.preventDefault(),
54
- onCloseAutoFocus: (e) => e.preventDefault(),
55
- content: ({ close: e }) => /* @__PURE__ */ o(
56
- H,
22
+ className: "form form-textarea",
23
+ "data-required": e(i),
24
+ "data-disabled": e(o),
25
+ "data-fill": e(p),
26
+ children: /* @__PURE__ */ f(
27
+ "textarea",
57
28
  {
58
- ...P,
59
- isActive: (t) => n.includes(t),
60
- onSelect: (t) => I(S(t), e),
61
- disableFiltering: !f.trim(),
62
- filterOptions: ({ title: t }) => J(t, f),
63
- onOptionsLoaded: (t) => {
64
- t.forEach((r) => {
65
- m[r.value] = r;
66
- });
67
- }
68
- }
69
- ),
70
- children: /* @__PURE__ */ o(
71
- "div",
72
- {
73
- className: "form",
74
- onClick: w,
75
- onMouseDown: y,
76
- "data-size": N ?? "md",
77
- "data-fill": i(O),
78
- "data-required": i(A),
79
- "data-disabled": i(u),
80
- children: /* @__PURE__ */ p("div", { className: "select-tags-container", children: [
81
- /* @__PURE__ */ p("div", { className: "select-tags", children: [
82
- n.length > 0 && /* @__PURE__ */ o(
83
- "div",
84
- {
85
- className: "tag-container",
86
- ref: z,
87
- role: "listbox",
88
- "data-readonly": i(c),
89
- children: n.map((e, t) => m[e] ? /* @__PURE__ */ p("div", { className: "tag", children: [
90
- /* @__PURE__ */ o("span", { className: "tag-name", children: m[e].title }),
91
- /* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (r) => F(r, e), children: /* @__PURE__ */ o(g, { className: "tag-close-icon", icon: X, size: "xxxs" }) })
92
- ] }, `tag-option-${e}-${t}`) : null)
93
- }
94
- ),
95
- (!c || n.length === 0) && /* @__PURE__ */ o(
96
- "input",
97
- {
98
- ref: L([R, s]),
99
- type: "text",
100
- autoCapitalize: "none",
101
- autoComplete: "off",
102
- autoCorrect: "off",
103
- className: "form-input",
104
- spellCheck: !1,
105
- value: f,
106
- disabled: u,
107
- readOnly: c,
108
- placeholder: C,
109
- onChange: T
110
- }
111
- )
112
- ] }),
113
- /* @__PURE__ */ o(g, { className: "expand-icon", icon: G, size: "xxxs" })
114
- ] })
29
+ className: "form-input",
30
+ "data-grow": e(a),
31
+ value: t,
32
+ ref: R([c, n]),
33
+ rows: l,
34
+ disabled: o,
35
+ onChange: u(s, r),
36
+ ...d
115
37
  }
116
38
  )
117
39
  }
118
40
  );
119
41
  };
120
42
  export {
121
- ne as SelectTags
43
+ q as TextArea
122
44
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
2
  import { Popover as T } from "./bundle.es10.js";
3
- import { Input as w } from "./bundle.es13.js";
3
+ import { Input as w } from "./bundle.es14.js";
4
4
  import { useState as A, useRef as j } from "react";
5
5
  import { Calendar as E } from "./bundle.es56.js";
6
6
  import { useDayDisableCheker as N } from "./bundle.es57.js";
@@ -4,7 +4,7 @@ import { getNum as v } from "@companix/utils-js";
4
4
  import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es58.js";
5
5
  import { SelectRightElements as w } from "./bundle.es59.js";
6
6
  import { Select as y } from "./bundle.es12.js";
7
- import { Input as z } from "./bundle.es13.js";
7
+ import { Input as z } from "./bundle.es14.js";
8
8
  const r = {
9
9
  char: ":",
10
10
  toString: (s) => s ? q(s, r.char) : "",
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, Fragment as m } from "react/jsx-runtime";
2
2
  import { useContext as C, createContext as g, useState as h, useEffect as x, useCallback as u } from "react";
3
- import { Dialog as D } from "./bundle.es21.js";
3
+ import { Dialog as D } from "./bundle.es22.js";
4
4
  import { hash as v } from "@companix/utils-js";
5
5
  const $ = (t) => {
6
6
  const e = {}, n = {}, l = [], c = v();
@@ -1,8 +1,8 @@
1
- import { jsx as i, jsxs as g } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as x } from "react/jsx-runtime";
2
2
  import { useMemo as h, useEffect as O } from "react";
3
3
  import { Spinner as L } from "./bundle.es6.js";
4
- import { OptionItem as u } from "./bundle.es14.js";
5
- import { OptionsList as C } from "./bundle.es16.js";
4
+ import { OptionItem as u } from "./bundle.es15.js";
5
+ import { OptionsList as C } from "./bundle.es17.js";
6
6
  import { Icon as R } from "./bundle.es33.js";
7
7
  import { faPlus as S } from "@companix/icons-solid";
8
8
  const b = () => ({ isLoading: !1, options: [] }), k = (s) => {
@@ -23,11 +23,11 @@ const b = () => ({ isLoading: !1, options: [] }), k = (s) => {
23
23
  filterOptions: l,
24
24
  disableFiltering: e,
25
25
  ...d
26
- } = s, { options: f, isLoading: v } = k(d), x = h(() => l && !e ? f.filter(l) : f, [f, l, e]);
26
+ } = s, { options: f, isLoading: v } = k(d), g = h(() => l && !e ? f.filter(l) : f, [f, l, e]);
27
27
  return v ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(L, { size: 24 }) }) : /* @__PURE__ */ i(
28
28
  y,
29
29
  {
30
- options: x,
30
+ options: g,
31
31
  isActive: n,
32
32
  emptyText: r,
33
33
  scrollboxRef: o,
@@ -51,8 +51,8 @@ const b = () => ({ isLoading: !1, options: [] }), k = (s) => {
51
51
  emptyText: l = "Ничего не найдено"
52
52
  } = s;
53
53
  return O(() => {
54
- r?.(p.findIndex((e) => n(e.value)));
55
- }, []), /* @__PURE__ */ g(C, { scrollboxRef: t, optionsWrapperRef: c, maxHeight: 300, children: [
54
+ console.log("onOpened"), r?.(p.findIndex((e) => n(e.value)));
55
+ }, []), /* @__PURE__ */ x(C, { scrollboxRef: t, optionsWrapperRef: c, maxHeight: 300, children: [
56
56
  o && /* @__PURE__ */ i(
57
57
  u,
58
58
  {
@@ -1,6 +1,6 @@
1
1
  import { jsx as s, Fragment as p } from "react/jsx-runtime";
2
2
  import { forwardRef as f, useState as u, useImperativeHandle as c } from "react";
3
- import { AlertDialog as x } from "./bundle.es22.js";
3
+ import { AlertDialog as x } from "./bundle.es23.js";
4
4
  const g = f((a, l) => {
5
5
  const [i, n] = u([]);
6
6
  c(
package/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ export { Tooltip } from './Tooltip';
19
19
  export type { TooltipProps } from './Tooltip';
20
20
  export { Select } from './Select';
21
21
  export type { SelectProps, SelectParams } from './Select';
22
+ export { SelectTags } from './SelectTags';
23
+ export type { SelectTagsProps, SelectTagsParams } from './SelectTags';
22
24
  export { Input } from './Input/Input';
23
25
  export type { InputProps } from './Input/Input';
24
26
  export { OptionItem } from './OptionItem/OptionItem';
@@ -47,8 +49,6 @@ export { Countdown } from './Countdown';
47
49
  export type { CountDownProps } from './Countdown';
48
50
  export { TextArea } from './TextArea';
49
51
  export type { TextAreaProps } from './TextArea';
50
- export { SelectTags } from './SelectTags';
51
- export type { SelectTagsProps } from './SelectTags';
52
52
  export { DatePicker } from './DatePicker';
53
53
  export type { DatePickerProps } from './DatePicker';
54
54
  export { DateInput } from './DateInput';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.0.63",
3
+ "version": "0.0.64",
4
4
  "main": "./dist/bundle.es.js",
5
5
  "module": "./dist/bundle.es.js",
6
6
  "types": "./dist/index.d.ts",