@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.
- package/dist/Select/OptionsPopover.d.ts +6 -4
- package/dist/Select/index.d.ts +7 -10
- package/dist/SelectTags/index.d.ts +4 -7
- package/dist/__utils/utils.d.ts +4 -0
- package/dist/bundle.es.js +31 -31
- package/dist/bundle.es12.js +30 -29
- package/dist/bundle.es13.js +122 -41
- package/dist/bundle.es14.js +37 -32
- package/dist/bundle.es15.js +32 -52
- package/dist/bundle.es16.js +54 -19
- package/dist/bundle.es17.js +21 -33
- package/dist/bundle.es18.js +31 -23
- package/dist/bundle.es19.js +24 -44
- package/dist/bundle.es20.js +41 -19
- package/dist/bundle.es21.js +23 -29
- package/dist/bundle.es22.js +28 -37
- package/dist/bundle.es23.js +38 -16
- package/dist/bundle.es24.js +15 -18
- package/dist/bundle.es25.js +18 -20
- package/dist/bundle.es26.js +20 -41
- package/dist/bundle.es27.js +35 -113
- package/dist/bundle.es28.js +4 -4
- package/dist/bundle.es29.js +1 -1
- package/dist/bundle.es32.js +48 -48
- package/dist/bundle.es42.js +1 -1
- package/dist/bundle.es43.js +1 -1
- package/dist/bundle.es50.js +14 -14
- package/dist/bundle.es51.js +73 -23
- package/dist/bundle.es52.js +20 -35
- package/dist/bundle.es53.js +39 -5
- package/dist/bundle.es54.js +5 -14
- package/dist/bundle.es55.js +13 -13
- package/dist/bundle.es56.js +13 -69
- package/dist/bundle.es57.js +68 -66
- package/dist/bundle.es58.js +67 -69
- package/dist/bundle.es60.js +1 -1
- package/dist/bundle.es62.js +1 -1
- package/dist/bundle.es65.js +2 -2
- package/dist/bundle.es66.js +2 -2
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/bundle.es26.js
CHANGED
|
@@ -1,44 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
22
|
+
j as Countdown
|
|
44
23
|
};
|
package/dist/bundle.es27.js
CHANGED
|
@@ -1,122 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
43
|
+
q as TextArea
|
|
122
44
|
};
|
package/dist/bundle.es28.js
CHANGED
|
@@ -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.
|
|
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.
|
|
6
|
-
import { useDayDisableCheker as N } from "./bundle.
|
|
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.
|
|
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: "-",
|
package/dist/bundle.es29.js
CHANGED
|
@@ -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.
|
|
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,
|
package/dist/bundle.es32.js
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
1
|
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { getNum as
|
|
4
|
-
import { getTimesOptions as
|
|
5
|
-
import { SelectRightElements as
|
|
6
|
-
import { Select as
|
|
7
|
-
import { Input as
|
|
8
|
-
const
|
|
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 ?
|
|
10
|
+
toString: (s) => s ? y(s, o.char) : "",
|
|
11
11
|
toValue: (s) => {
|
|
12
|
-
const n = s.split(
|
|
12
|
+
const n = s.split(o.char);
|
|
13
13
|
if (n.length === 2) {
|
|
14
|
-
const [e,
|
|
15
|
-
if (e !== null &&
|
|
16
|
-
return { hours: e, minutes:
|
|
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
|
-
},
|
|
21
|
-
const { value: n, onChange: e, clearButton:
|
|
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),
|
|
24
|
-
return
|
|
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]), [
|
|
28
|
-
l(t);
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
},
|
|
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
|
-
},
|
|
34
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
}, [
|
|
52
|
-
|
|
50
|
+
}, []);
|
|
51
|
+
return /* @__PURE__ */ g(
|
|
52
|
+
F,
|
|
53
53
|
{
|
|
54
54
|
minimalOptions: !0,
|
|
55
|
-
options:
|
|
56
|
-
onChange:
|
|
57
|
-
value:
|
|
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
|
-
|
|
62
|
+
G,
|
|
63
63
|
{
|
|
64
64
|
...T,
|
|
65
|
-
value:
|
|
65
|
+
value: i,
|
|
66
66
|
disabled: a,
|
|
67
|
-
onClick:
|
|
68
|
-
onValueChange:
|
|
69
|
-
onBlur:
|
|
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
|
-
|
|
73
|
+
z,
|
|
74
74
|
{
|
|
75
|
-
clearButton:
|
|
76
|
-
clearButtonIcon:
|
|
77
|
-
value: !!
|
|
78
|
-
onClear:
|
|
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
|
-
|
|
87
|
+
Y as TimePicker
|
|
88
88
|
};
|
package/dist/bundle.es42.js
CHANGED
|
@@ -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.
|
|
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",
|
package/dist/bundle.es43.js
CHANGED
|
@@ -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.
|
|
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();
|
package/dist/bundle.es50.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
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.
|
|
5
|
-
import { OptionsList as C } from "./bundle.
|
|
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:
|
|
24
|
+
disableFiltering: i,
|
|
25
25
|
...d
|
|
26
|
-
} = s, { options: f, isLoading: v } = k(d), x = h(() => l && !
|
|
27
|
-
return v ? /* @__PURE__ */
|
|
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((
|
|
54
|
+
r?.(p.findIndex(({ value: i }) => n(i)));
|
|
55
55
|
}, []), /* @__PURE__ */ g(C, { scrollboxRef: t, optionsWrapperRef: c, maxHeight: 300, children: [
|
|
56
|
-
o && /* @__PURE__ */
|
|
56
|
+
o && /* @__PURE__ */ e(
|
|
57
57
|
u,
|
|
58
58
|
{
|
|
59
59
|
className: "select-add-option",
|
|
60
|
-
icon: /* @__PURE__ */
|
|
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__ */
|
|
66
|
-
p.map((
|
|
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(
|
|
70
|
-
onClick: () => a?.(
|
|
69
|
+
active: n(i.value),
|
|
70
|
+
onClick: () => a?.(i.value),
|
|
71
71
|
minimal: m,
|
|
72
|
-
...
|
|
72
|
+
...i
|
|
73
73
|
},
|
|
74
74
|
`select-option-${d}`
|
|
75
75
|
))
|
package/dist/bundle.es51.js
CHANGED
|
@@ -1,26 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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
|
};
|
package/dist/bundle.es52.js
CHANGED
|
@@ -1,41 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
25
|
+
I as InputElement
|
|
41
26
|
};
|