@companix/uikit 0.0.63 → 0.0.65

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,44 +1,23 @@
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",
21
- {
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",
28
- {
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
37
- }
38
- )
39
- }
40
- );
1
+ import { jsx as d, Fragment as p } from "react/jsx-runtime";
2
+ import { getNextCandleTime as T, sleep as S, getTimes as x } from "@companix/utils-js";
3
+ import { useRef as g, useState as v, useEffect as s } from "react";
4
+ const n = (t) => String(t).padStart(2, "0"), j = ({ expiration: t, separator: m = ":", onExpired: a }) => {
5
+ const e = g(null), [, o] = v([]);
6
+ s(() => {
7
+ const c = Date.now(), f = T(c, "1s") - c;
8
+ return e.current && clearInterval(e.current), S(f).then(() => {
9
+ o([]), e.current = setInterval(() => {
10
+ o([]);
11
+ }, 1e3);
12
+ }), () => {
13
+ e.current && clearInterval(e.current);
14
+ };
15
+ }, [t]);
16
+ const r = t - Date.now(), { hours: i, minutes: u, seconds: l } = x(r);
17
+ return s(() => {
18
+ r <= 0 && (a?.(), e.current && clearInterval(e.current));
19
+ }, [r <= 0]), /* @__PURE__ */ d(p, { children: [n(i), n(u), n(l)].join(m) });
41
20
  };
42
21
  export {
43
- q as TextArea
22
+ j as Countdown
44
23
  };
@@ -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.es56.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,11 +1,11 @@
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
- import { Calendar as E } from "./bundle.es56.js";
6
- import { useDayDisableCheker as N } from "./bundle.es57.js";
5
+ import { Calendar as E } from "./bundle.es57.js";
6
+ import { useDayDisableCheker as N } from "./bundle.es58.js";
7
7
  import { getNum as h, formatTime as v } from "@companix/utils-js";
8
- import { removeDigits as O } from "./bundle.es58.js";
8
+ import { removeDigits as O } from "./bundle.es51.js";
9
9
  import { SelectRightElements as Y } from "./bundle.es59.js";
10
10
  const i = {
11
11
  char: "-",
@@ -1,7 +1,7 @@
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.es58.js";
4
+ import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es51.js";
5
5
  import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es60.js";
6
6
  const B = ({
7
7
  min: o = j,
@@ -1,81 +1,81 @@
1
1
  import { jsx as g } from "react/jsx-runtime";
2
- import { useRef as _, useMemo as b, useState as P, useEffect as j } from "react";
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.es58.js";
5
- import { SelectRightElements as w } from "./bundle.es59.js";
6
- import { Select as y } from "./bundle.es12.js";
7
- import { Input as z } from "./bundle.es13.js";
8
- const r = {
2
+ import { useRef as b, useMemo as I, useState as E, useCallback as A } from "react";
3
+ import { getNum as S } from "@companix/utils-js";
4
+ import { getTimesOptions as W, getTimeValue as q, removeDigits as w, convertTimeToOption as y } from "./bundle.es51.js";
5
+ import { SelectRightElements as z } from "./bundle.es59.js";
6
+ import { Select as F } from "./bundle.es12.js";
7
+ import { Input as G } from "./bundle.es14.js";
8
+ const o = {
9
9
  char: ":",
10
- toString: (s) => s ? q(s, r.char) : "",
10
+ toString: (s) => s ? y(s, o.char) : "",
11
11
  toValue: (s) => {
12
- const n = s.split(r.char);
12
+ const n = s.split(o.char);
13
13
  if (n.length === 2) {
14
- const [e, i] = [v(n[0]), v(n[1])];
15
- if (e !== null && i !== null && e < 24 && e >= 0 && i < 60 && i >= 0)
16
- return { hours: e, minutes: i };
14
+ const [e, u] = [S(n[0]), S(n[1])];
15
+ if (e !== null && u !== null && e < 24 && e >= 0 && u < 60 && u >= 0)
16
+ return { hours: e, minutes: u };
17
17
  }
18
18
  return null;
19
19
  }
20
- }, U = (s) => {
21
- const { value: n, onChange: e, clearButton: i, clearButtonIcon: I, disabled: a, ...T } = s, m = _(null), p = _(null), h = b(() => D(10), []), d = b(() => {
20
+ }, Y = (s) => {
21
+ const { value: n, onChange: e, clearButton: u, clearButtonIcon: _, disabled: a, ...T } = s, m = b(null), p = b(null), h = I(() => W(10), []), k = I(() => {
22
22
  if (n && !n.minutes.toString().endsWith("0")) {
23
- const t = n.hours * 6 + Math.trunc(n.minutes / 10), u = [...h];
24
- return u.splice(t + 1, 0, A(n)), u;
23
+ const t = n.hours * 6 + Math.trunc(n.minutes / 10), r = [...h];
24
+ return r.splice(t + 1, 0, q(n)), r;
25
25
  }
26
26
  return h;
27
- }, [h, n]), [o, l] = P(() => r.toString(n)), x = (t) => {
28
- l(t);
29
- const u = r.toValue(t);
30
- u && e?.(u);
31
- }, B = (t) => {
27
+ }, [h, n]), [i, l] = E(() => o.toString(n)), v = (t) => {
28
+ l(t), N(t);
29
+ const r = o.toValue(t);
30
+ r && e?.(r);
31
+ }, x = (t) => {
32
32
  a || m.current && m.current.getAttribute("data-state") === "open" && t.preventDefault();
33
- }, O = () => {
34
- r.toValue(o) === null && l(r.toString(n ?? null));
33
+ }, B = () => {
34
+ o.toValue(i) === null && l(o.toString(n ?? null));
35
+ }, O = (t) => {
36
+ e?.(o.toValue(t)), l(t);
35
37
  }, R = (t) => {
36
- e?.(r.toValue(t)), l(t);
37
- }, k = (t) => {
38
38
  t.stopPropagation(), l(""), e?.(null);
39
- };
40
- return j(() => {
41
- if (o && o !== "__:__") {
42
- const [t, u] = o.split(":"), V = (c) => {
43
- const [C, S] = c.split(""), [E, M] = [C === "_" ? "0" : C, S === "_" ? "0" : S];
44
- return E + M;
45
- }, N = [V(t), V(u)].join(":"), f = r.toValue(N);
39
+ }, N = A((t) => {
40
+ if (t && t !== "__:__") {
41
+ const [r, M] = t.split(":"), d = (c) => {
42
+ const [C, V] = c.split(""), [j, D] = [C === "_" ? "0" : C, V === "_" ? "0" : V];
43
+ return j + D;
44
+ }, P = [d(r), d(M)].join(":"), f = o.toValue(P);
46
45
  if (f) {
47
46
  const c = f.hours * 6 + Math.trunc(f.minutes / 10);
48
47
  c !== -1 && p.current && p.current.scrollTo(c);
49
48
  }
50
49
  }
51
- }, [d, o]), /* @__PURE__ */ g(
52
- y,
50
+ }, []);
51
+ return /* @__PURE__ */ g(
52
+ F,
53
53
  {
54
54
  minimalOptions: !0,
55
- options: d,
56
- onChange: R,
57
- value: o,
55
+ options: k,
56
+ onChange: O,
57
+ value: i,
58
58
  popoverRef: m,
59
59
  scrollRef: p,
60
60
  disabled: a,
61
61
  children: /* @__PURE__ */ g(
62
- z,
62
+ G,
63
63
  {
64
64
  ...T,
65
- value: o,
65
+ value: i,
66
66
  disabled: a,
67
- onClick: B,
68
- onValueChange: x,
69
- onBlur: O,
67
+ onClick: x,
68
+ onValueChange: v,
69
+ onBlur: B,
70
70
  mask: "99:99",
71
71
  placeholder: "00:00",
72
72
  rightElement: /* @__PURE__ */ g(
73
- w,
73
+ z,
74
74
  {
75
- clearButton: i,
76
- clearButtonIcon: I,
77
- value: !!W(o, [":", "_"]),
78
- onClear: k
75
+ clearButton: u,
76
+ clearButtonIcon: _,
77
+ value: !!w(i, [":", "_"]),
78
+ onClear: R
79
79
  }
80
80
  )
81
81
  }
@@ -84,5 +84,5 @@ const r = {
84
84
  );
85
85
  };
86
86
  export {
87
- U as TimePicker
87
+ Y as TimePicker
88
88
  };
@@ -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.es53.js";
5
+ import { RemoveListener as I } from "./bundle.es54.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",
@@ -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 e, jsxs as g } 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) => {
@@ -21,10 +21,10 @@ const b = () => ({ isLoading: !1, options: [] }), k = (s) => {
21
21
  onSelect: a,
22
22
  minimalOptions: m,
23
23
  filterOptions: l,
24
- disableFiltering: e,
24
+ disableFiltering: i,
25
25
  ...d
26
- } = s, { options: f, isLoading: v } = k(d), x = h(() => l && !e ? f.filter(l) : f, [f, l, e]);
27
- return v ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(L, { size: 24 }) }) : /* @__PURE__ */ i(
26
+ } = s, { options: f, isLoading: v } = k(d), x = h(() => l && !i ? f.filter(l) : f, [f, l, i]);
27
+ return v ? /* @__PURE__ */ e("div", { className: "select-popover-loading", children: /* @__PURE__ */ e(L, { size: 24 }) }) : /* @__PURE__ */ e(
28
28
  y,
29
29
  {
30
30
  options: x,
@@ -51,25 +51,25 @@ 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)));
54
+ r?.(p.findIndex(({ value: i }) => n(i)));
55
55
  }, []), /* @__PURE__ */ g(C, { scrollboxRef: t, optionsWrapperRef: c, maxHeight: 300, children: [
56
- o && /* @__PURE__ */ i(
56
+ o && /* @__PURE__ */ e(
57
57
  u,
58
58
  {
59
59
  className: "select-add-option",
60
- icon: /* @__PURE__ */ i(R, { icon: S }),
60
+ icon: /* @__PURE__ */ e(R, { icon: S }),
61
61
  title: o.text,
62
62
  onClick: o.onClick
63
63
  }
64
64
  ),
65
- p.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-empty", children: l }),
66
- p.map((e, d) => /* @__PURE__ */ i(
65
+ p.length === 0 && !o && /* @__PURE__ */ e("div", { className: "select-tags-empty", children: l }),
66
+ p.map((i, d) => /* @__PURE__ */ e(
67
67
  u,
68
68
  {
69
- active: n(e.value),
70
- onClick: () => a?.(e.value),
69
+ active: n(i.value),
70
+ onClick: () => a?.(i.value),
71
71
  minimal: m,
72
- ...e
72
+ ...i
73
73
  },
74
74
  `select-option-${d}`
75
75
  ))
@@ -1,26 +1,76 @@
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 });
1
+ import { clamp as m } from "@companix/utils-browser";
2
+ import { formatTime as i } from "@companix/utils-js";
3
+ const d = (n, r) => new Date(r, n, 0).getDate(), u = (n, r) => new Date(r, n - 1, 1).getDay(), g = (n) => n === 0 ? 6 : n - 1, D = (n) => new Array(n).fill(0), T = {
4
+ add: (n, r) => n.includes(r) ? [...n] : [...n, r],
5
+ remove: (n, r) => n.filter((t) => r !== t)
6
+ }, p = (n) => ({
7
+ day: n.getDate(),
8
+ month: n.getMonth() + 1,
9
+ year: n.getFullYear()
10
+ }), A = ({ min: n, max: r }) => (t) => {
11
+ if (n.year === t.year) {
12
+ if (t.month !== 0 && t.month < n.month)
13
+ return t.month = 0, t.day = 0, t;
14
+ if (t.month === n.month && t.day < n.day && t.day !== 0)
15
+ return t.day = 0, t;
22
16
  }
23
- );
17
+ if (r.year === t.year) {
18
+ if (t.month !== 0 && t.month > r.month)
19
+ return t.month = 0, t.day = 0, t;
20
+ if (t.month === r.month && t.day > r.day && t.day !== 0)
21
+ return t.day = 0, t;
22
+ }
23
+ }, M = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], w = [
24
+ "Январь",
25
+ "Февраль",
26
+ "Март",
27
+ "Апрель",
28
+ "Май",
29
+ "Июнь",
30
+ "Июль",
31
+ "Август",
32
+ "Сентябрь",
33
+ "Октябрь",
34
+ "Ноябрь",
35
+ "Декабрь"
36
+ ], c = 9999, a = 100, F = (n, r) => {
37
+ const t = [], o = m(n - r, a, c), e = m(n + r, a, c);
38
+ for (let s = o; s <= e; s++)
39
+ t.push({ title: String(s).padStart(4, "0"), value: s });
40
+ return t;
41
+ }, Y = (n) => {
42
+ const r = [], t = new Intl.DateTimeFormat(n, {
43
+ month: "long"
44
+ });
45
+ for (let o = 0; o < 12; o++)
46
+ r.push({
47
+ title: t.format(new Date(2023, o, 15)),
48
+ value: o
49
+ });
50
+ return r;
51
+ }, E = (n, r) => r.reduce((t, o) => t.replaceAll(o, ""), n.trim()), _ = ({ hours: n, minutes: r }, t = ":") => [i(n), i(r)].join(t), h = (n, r = ":") => {
52
+ const [t, o] = [i(n.hours), i(n.minutes)], e = [t, o].join(r);
53
+ return { title: e, value: e, hours: t, minutes: o };
54
+ }, I = (n, r = ":") => {
55
+ const t = { minutes: -n, hours: 0 };
56
+ return Array.from({ length: 1440 / n }).map(() => (t.minutes += n, t.minutes === 60 && (t.minutes = 0, t.hours++), h(t, r)));
57
+ };
24
58
  export {
25
- I as InputElement
59
+ c as DEFAULT_MAX_YEAR,
60
+ a as DEFAULT_MIN_YEAR,
61
+ w as DefaultMonths,
62
+ T as arrays,
63
+ _ as convertTimeToOption,
64
+ A as createDateValidation,
65
+ D as createVoids,
66
+ p as dateToFormat,
67
+ g as getDayIndex,
68
+ u as getFirstDay,
69
+ d as getMonthMaxDay,
70
+ Y as getMonths,
71
+ h as getTimeValue,
72
+ I as getTimesOptions,
73
+ F as getYears,
74
+ E as removeDigits,
75
+ M as weeks
26
76
  };
@@ -1,41 +1,26 @@
1
- import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
- import h from "classnames";
3
- import { attr as e } from "@companix/utils-browser";
4
- import { forwardRef as x } from "react";
5
- import { useInputPadding as N } from "./bundle.es64.js";
6
- const v = x(
7
- ({
8
- required: s,
9
- disabled: t,
10
- size: i,
11
- fill: d,
12
- leftElement: r,
13
- rightElement: a,
14
- className: f,
15
- inputRef: m,
16
- children: n,
17
- ...p
18
- }, c) => {
19
- const { leftRef: l, rightRef: u } = N(m, [r, a]);
20
- return /* @__PURE__ */ b(
21
- "div",
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,
22
14
  {
23
- ref: c,
24
- className: h("form", f),
25
- "data-size": i ?? "md",
26
- "data-fill": e(d),
27
- "data-required": e(s),
28
- "data-disabled": e(t),
29
- ...p,
30
- children: [
31
- r && /* @__PURE__ */ o("span", { ref: l, className: "form-input-base-left-element", children: r }),
32
- n,
33
- a && /* @__PURE__ */ o("span", { ref: u, className: "form-input-base-right-element", children: a })
34
- ]
15
+ inputRef: e,
16
+ mask: r,
17
+ maskChar: f,
18
+ onChange: p,
19
+ ...a
35
20
  }
36
- );
21
+ ) : /* @__PURE__ */ u("input", { ref: e, ...a, onChange: p });
37
22
  }
38
23
  );
39
24
  export {
40
- v as InputContainer
25
+ I as InputElement
41
26
  };