@companix/uikit 0.0.16 → 0.0.17
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/DatePicker/index.d.ts +2 -3
- package/dist/Input/Form.scss +1 -4
- package/dist/Input/InlineInput.d.ts +0 -0
- package/dist/Input/{index.d.ts → Input.d.ts} +4 -8
- package/dist/Input/Input.scss +23 -0
- package/dist/Input/InputContainer.d.ts +11 -0
- package/dist/Input/InputElement.d.ts +7 -0
- package/dist/NumberInput/index.d.ts +2 -2
- package/dist/Select/SelectOptions.d.ts +12 -0
- package/dist/Select/SelectRight.d.ts +8 -0
- package/dist/Select/index.d.ts +5 -1
- package/dist/TimePicker/index.d.ts +10 -0
- package/dist/__hooks/use-input-padding.d.ts +5 -0
- package/dist/__hooks/use-scrollbox.d.ts +1 -1
- package/dist/__hooks/use-update.d.ts +1 -1
- package/dist/__utils/utils.d.ts +15 -1
- package/dist/bundle.es.js +30 -26
- package/dist/bundle.es10.js +1 -1
- package/dist/bundle.es14.js +1 -1
- package/dist/bundle.es19.js +1 -1
- package/dist/bundle.es20.js +1 -1
- package/dist/bundle.es23.js +1 -1
- package/dist/bundle.es24.js +2 -2
- package/dist/bundle.es25.js +93 -85
- package/dist/bundle.es26.js +67 -29
- package/dist/bundle.es27.js +34 -10
- package/dist/bundle.es28.js +11 -10
- package/dist/bundle.es29.js +82 -21
- package/dist/bundle.es30.js +10 -35
- package/dist/bundle.es31.js +21 -20
- package/dist/bundle.es32.js +36 -83
- package/dist/bundle.es33.js +23 -17
- package/dist/bundle.es34.js +87 -14
- package/dist/bundle.es35.js +18 -22
- package/dist/bundle.es36.js +20 -5
- package/dist/bundle.es37.js +24 -14
- package/dist/bundle.es38.js +39 -14
- package/dist/bundle.es39.js +20 -68
- package/dist/bundle.es40.js +5 -68
- package/dist/bundle.es41.js +13 -31
- package/dist/bundle.es42.js +14 -68
- package/dist/bundle.es43.js +66 -39
- package/dist/bundle.es44.js +67 -30
- package/dist/bundle.es45.js +69 -74
- package/dist/bundle.es46.js +10 -48
- package/dist/bundle.es47.js +45 -0
- package/dist/bundle.es48.js +34 -0
- package/dist/bundle.es49.js +70 -0
- package/dist/bundle.es50.js +16 -0
- package/dist/bundle.es51.js +45 -0
- package/dist/bundle.es52.js +77 -0
- package/dist/bundle.es53.js +51 -0
- package/dist/bundle.es54.js +16 -0
- package/dist/bundle.es8.js +54 -62
- package/dist/bundle.es9.js +35 -70
- package/dist/index.d.ts +3 -1
- package/dist/index.scss +2 -2
- package/dist/types.d.ts +4 -0
- package/package.json +2 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useRef as f, useLayoutEffect as u, useEffect as s } from "react";
|
|
2
|
+
const o = (t, r) => {
|
|
3
|
+
const e = f(!1);
|
|
4
|
+
u(() => {
|
|
5
|
+
e.current = !0, t();
|
|
6
|
+
}, []), s(() => {
|
|
7
|
+
if (e.current) {
|
|
8
|
+
e.current = !1;
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
t();
|
|
12
|
+
}, r);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
o as useEffectWithLayout
|
|
16
|
+
};
|
package/dist/bundle.es8.js
CHANGED
|
@@ -1,85 +1,77 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
const
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as F, useImperativeHandle as I } from "react";
|
|
3
|
+
import { Popover as T } from "./bundle.es6.js";
|
|
4
|
+
import { useFroozeClosing as b } from "./bundle.es33.js";
|
|
5
|
+
import { SelectInput as z } from "./bundle.es34.js";
|
|
6
|
+
import { useScrollListController as B } from "./bundle.es35.js";
|
|
7
|
+
import { SelectOptions as D } from "./bundle.es36.js";
|
|
8
|
+
import { mergeRefs as j } from "react-merge-refs";
|
|
9
|
+
const G = (a) => {
|
|
10
10
|
const {
|
|
11
|
-
options:
|
|
11
|
+
options: n,
|
|
12
12
|
onChange: i,
|
|
13
|
-
value:
|
|
14
|
-
minimalOptions:
|
|
15
|
-
matchTarget:
|
|
13
|
+
value: r,
|
|
14
|
+
minimalOptions: m,
|
|
15
|
+
matchTarget: f = "width",
|
|
16
16
|
children: u,
|
|
17
|
-
disabled:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
disabled: p,
|
|
18
|
+
scrollRef: d,
|
|
19
|
+
popoverRef: v,
|
|
20
|
+
clearButton: s,
|
|
21
|
+
...h
|
|
22
|
+
} = a, t = F(() => {
|
|
23
|
+
const o = r === null ? -1 : n.findIndex((e) => e.value === r);
|
|
22
24
|
return {
|
|
23
25
|
index: o,
|
|
24
|
-
option:
|
|
26
|
+
option: n[o]
|
|
25
27
|
};
|
|
26
|
-
}, [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
}, [n, r]), x = t.option?.value ?? null, { popoverRef: R, froozePopoverPosition: C, handleAnimationEnd: g } = b(), { scrollToElement: c, optionsWrapperRef: O, scrollBoxRef: P } = B();
|
|
29
|
+
I(d, () => ({
|
|
30
|
+
scrollTo: (o) => c(o, "top")
|
|
31
|
+
}));
|
|
32
|
+
const S = (o, e) => {
|
|
33
|
+
C(), i(o), e();
|
|
34
|
+
}, A = (o) => {
|
|
35
|
+
o.stopPropagation(), s && i(null);
|
|
36
|
+
}, E = () => {
|
|
37
|
+
t.index !== -1 && c(t.index, "center");
|
|
32
38
|
};
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
|
|
39
|
+
return /* @__PURE__ */ l(
|
|
40
|
+
T,
|
|
35
41
|
{
|
|
36
42
|
minimal: !0,
|
|
37
|
-
ref: v,
|
|
43
|
+
ref: j([R, v]),
|
|
38
44
|
sideOffset: 0,
|
|
39
|
-
matchTarget:
|
|
40
|
-
onAnimationEnd:
|
|
45
|
+
matchTarget: f,
|
|
46
|
+
onAnimationEnd: g,
|
|
41
47
|
onOpenAutoFocus: (o) => o.preventDefault(),
|
|
42
48
|
onCloseAutoFocus: (o) => o.preventDefault(),
|
|
43
|
-
disabled:
|
|
44
|
-
content: ({ close: o }) => /* @__PURE__ */
|
|
45
|
-
|
|
49
|
+
disabled: p,
|
|
50
|
+
content: ({ close: o }) => /* @__PURE__ */ l(
|
|
51
|
+
D,
|
|
46
52
|
{
|
|
47
|
-
options:
|
|
48
|
-
active:
|
|
49
|
-
scrollboxRef:
|
|
50
|
-
optionsWrapperRef:
|
|
51
|
-
minimalOptions:
|
|
52
|
-
onOpened:
|
|
53
|
-
onSelect: (
|
|
53
|
+
options: n,
|
|
54
|
+
active: x,
|
|
55
|
+
scrollboxRef: P,
|
|
56
|
+
optionsWrapperRef: O,
|
|
57
|
+
minimalOptions: m,
|
|
58
|
+
onOpened: E,
|
|
59
|
+
onSelect: (e) => S(e, o)
|
|
54
60
|
}
|
|
55
61
|
),
|
|
56
|
-
children: u ?? /* @__PURE__ */
|
|
57
|
-
|
|
62
|
+
children: u ?? /* @__PURE__ */ l(
|
|
63
|
+
z,
|
|
58
64
|
{
|
|
59
|
-
...
|
|
60
|
-
disabled:
|
|
61
|
-
clearButton:
|
|
62
|
-
value:
|
|
63
|
-
onClear:
|
|
65
|
+
...h,
|
|
66
|
+
disabled: p,
|
|
67
|
+
clearButton: s,
|
|
68
|
+
value: t.option?.title ?? "",
|
|
69
|
+
onClear: A
|
|
64
70
|
}
|
|
65
71
|
)
|
|
66
72
|
}
|
|
67
73
|
);
|
|
68
|
-
}, L = (c) => {
|
|
69
|
-
const { active: t, onOpened: i, scrollboxRef: l, optionsWrapperRef: a, options: m, onSelect: u, minimalOptions: s } = c;
|
|
70
|
-
return E(() => {
|
|
71
|
-
i?.();
|
|
72
|
-
}, []), /* @__PURE__ */ r(b, { scrollboxRef: l, optionsWrapperRef: a, maxHeight: 300, children: m.map((e, f) => /* @__PURE__ */ r(
|
|
73
|
-
F,
|
|
74
|
-
{
|
|
75
|
-
active: t === e.value,
|
|
76
|
-
onClick: () => u?.(e.value),
|
|
77
|
-
minimal: s,
|
|
78
|
-
...e
|
|
79
|
-
},
|
|
80
|
-
`option-item-${e.value}-${f}`
|
|
81
|
-
)) });
|
|
82
74
|
};
|
|
83
75
|
export {
|
|
84
|
-
|
|
76
|
+
G as Select
|
|
85
77
|
};
|
package/dist/bundle.es9.js
CHANGED
|
@@ -1,77 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
const Q = R(
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l, useRef as b } from "react";
|
|
3
|
+
import { mergeRefs as R } from "react-merge-refs";
|
|
4
|
+
import { InputElement as c } from "./bundle.es37.js";
|
|
5
|
+
import { InputContainer as x } from "./bundle.es38.js";
|
|
6
|
+
import I from "classnames";
|
|
7
|
+
const E = l(
|
|
9
8
|
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
inputRef: L,
|
|
25
|
-
...j
|
|
26
|
-
}, k) => {
|
|
27
|
-
const s = l(null), m = l(null), d = l(null), q = { Right: m, Left: d }, h = g((t) => {
|
|
28
|
-
if (s.current) {
|
|
29
|
-
const i = s.current.style, o = q[t];
|
|
30
|
-
o.current && o.current.clientWidth ? i[`padding${t}`] !== `${o.current.clientWidth}px` && (i[`padding${t}`] = `${o.current.clientWidth}px`) : i[`padding${t}`] && (i[`padding${t}`] = "");
|
|
31
|
-
}
|
|
32
|
-
}, []);
|
|
33
|
-
U(() => {
|
|
34
|
-
h("Left"), h("Right");
|
|
35
|
-
}, [f, e]);
|
|
36
|
-
const w = g((t) => {
|
|
37
|
-
x?.(t), $?.(t.target.value, t.target);
|
|
38
|
-
}, []);
|
|
39
|
-
return /* @__PURE__ */ z(
|
|
40
|
-
"div",
|
|
9
|
+
onChange: m,
|
|
10
|
+
onValueChange: f,
|
|
11
|
+
readOnly: i,
|
|
12
|
+
inputClassName: o,
|
|
13
|
+
value: p,
|
|
14
|
+
placeholder: n,
|
|
15
|
+
mask: d,
|
|
16
|
+
maskChar: s,
|
|
17
|
+
inputRef: u,
|
|
18
|
+
...e
|
|
19
|
+
}, a) => {
|
|
20
|
+
const r = b(null);
|
|
21
|
+
return /* @__PURE__ */ t(x, { ref: a, inputRef: r, ...e, children: /* @__PURE__ */ t(
|
|
22
|
+
c,
|
|
41
23
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
type: "text",
|
|
55
|
-
ref: v([s, L]),
|
|
56
|
-
className: "form-input form-input-base",
|
|
57
|
-
"aria-disabled": p,
|
|
58
|
-
onChange: w,
|
|
59
|
-
value: N,
|
|
60
|
-
placeholder: W,
|
|
61
|
-
disabled: p,
|
|
62
|
-
readOnly: I,
|
|
63
|
-
maskChar: C,
|
|
64
|
-
mask: y
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
f && /* @__PURE__ */ n("span", { ref: m, className: "form-input-base-right-element", children: f })
|
|
68
|
-
]
|
|
24
|
+
type: "text",
|
|
25
|
+
ref: R([r, u]),
|
|
26
|
+
className: I("form-input form-input-base", o),
|
|
27
|
+
"aria-disabled": e.disabled,
|
|
28
|
+
onChange: m,
|
|
29
|
+
onValueChange: f,
|
|
30
|
+
value: p,
|
|
31
|
+
placeholder: n,
|
|
32
|
+
disabled: e.disabled,
|
|
33
|
+
readOnly: i,
|
|
34
|
+
maskChar: s,
|
|
35
|
+
mask: d
|
|
69
36
|
}
|
|
70
|
-
);
|
|
37
|
+
) });
|
|
71
38
|
}
|
|
72
|
-
), B = R(
|
|
73
|
-
({ mask: r, maskChar: u, ...a }, e) => r ? /* @__PURE__ */ n(M, { inputRef: e, mask: r, maskChar: u, ...a }) : /* @__PURE__ */ n("input", { ref: e, ...a })
|
|
74
39
|
);
|
|
75
40
|
export {
|
|
76
|
-
|
|
41
|
+
E as Input
|
|
77
42
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { ImitateScroll } from './Scrollable/ImitateScroll';
|
|
|
5
5
|
export { Popover } from './Popover';
|
|
6
6
|
export { Tooltip } from './Tooltip';
|
|
7
7
|
export { Select } from './Select';
|
|
8
|
-
export { Input } from './Input';
|
|
8
|
+
export { Input } from './Input/Input';
|
|
9
9
|
export { OptionItem } from './OptionItem/OptionItem';
|
|
10
10
|
export { NumberInput } from './NumberInput';
|
|
11
11
|
export { OptionsList } from './OptionItem/OptionsList';
|
|
@@ -22,8 +22,10 @@ export { Countdown } from './Countdown';
|
|
|
22
22
|
export { TextArea } from './TextArea';
|
|
23
23
|
export { SelectTags } from './SelectTags';
|
|
24
24
|
export { DatePicker } from './DatePicker';
|
|
25
|
+
export { DateInput } from './DateInput';
|
|
25
26
|
export { FileOverlay } from './File';
|
|
26
27
|
export { FormGroup } from './FormGroup';
|
|
28
|
+
export { TimePicker } from './TimePicker';
|
|
27
29
|
export * from './__hooks/use-local-storage';
|
|
28
30
|
export { createAlertAgent } from './DialogAlert';
|
|
29
31
|
export { createToaster } from './Toaster';
|
package/dist/index.scss
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
@use './TextArea/TextArea.scss';
|
|
15
15
|
@use './SelectTags/SelectTags.scss';
|
|
16
16
|
@use './OptionItem/Option.scss';
|
|
17
|
+
@use './Input/Input.scss';
|
|
18
|
+
@use './Input/Form.scss';
|
|
17
19
|
@use './DateInput/DateInput.scss';
|
|
18
20
|
@use './DatePicker/DatePicker.scss';
|
|
19
21
|
@use './DatePicker/Calendar.scss';
|
|
20
|
-
@use './Input/Input.scss';
|
|
21
|
-
@use './Input/Form.scss';
|
|
22
22
|
@use './Switch/Switch.scss';
|
|
23
23
|
@use './Spinner/Spinner.scss';
|
|
24
24
|
@use './ButtonGroup/ButtonGroup.scss';
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companix/uikit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"module": "./dist/bundle.es.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@companix/utils-browser": "*",
|
|
26
26
|
"@companix/utils-js": "*",
|
|
27
|
+
"@fortawesome/free-regular-svg-icons": "^7.1.0",
|
|
27
28
|
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
|
28
|
-
"@fortawesome/react-fontawesome": "^3.1.1",
|
|
29
29
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
30
30
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
31
31
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"@radix-ui/react-toast": "^1.2.15",
|
|
37
37
|
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
38
38
|
"classnames": "^2.5.1",
|
|
39
|
-
"font-awesome": "^4.7.0",
|
|
40
39
|
"react-input-mask": "^2.0.4",
|
|
41
40
|
"react-merge-refs": "^3.0.2"
|
|
42
41
|
},
|