@tcn/ui 0.3.0 → 0.3.1
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/Color-ASIRERSW-B4GaVKuQ.js +990 -0
- package/dist/Color-ASIRERSW-B4GaVKuQ.js.map +1 -0
- package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js +1485 -0
- package/dist/WithTooltip-IO6J4KBT-B1oq93K5.js.map +1 -0
- package/dist/actions/__docs__/components/gallery.d.ts +8 -0
- package/dist/actions/__docs__/components/gallery.d.ts.map +1 -0
- package/dist/actions/__docs__/components/gallery.js +20 -0
- package/dist/actions/__docs__/components/gallery.js.map +1 -0
- package/dist/actions/__docs__/components/showcase.d.ts +27 -0
- package/dist/actions/__docs__/components/showcase.d.ts.map +1 -0
- package/dist/actions/__docs__/components/showcase.js +15 -0
- package/dist/actions/__docs__/components/showcase.js.map +1 -0
- package/dist/actions/button/base_button/base_button.d.ts +2 -0
- package/dist/actions/button/base_button/base_button.d.ts.map +1 -1
- package/dist/actions/button/base_button/base_button.js +18 -16
- package/dist/actions/button/base_button/base_button.js.map +1 -1
- package/dist/actions/button/button/button.js +6 -6
- package/dist/actions/button/button_group/button_group.js +1 -1
- package/dist/actions/button/select_group/select_group.js +13 -13
- package/dist/actions/button/select_group/single_select_group.js +6 -6
- package/dist/actions/button/slim_button/slim_button.js +2 -2
- package/dist/actions/types.d.ts +2 -0
- package/dist/actions/types.d.ts.map +1 -0
- package/dist/actions/types.js +2 -0
- package/dist/actions/types.js.map +1 -0
- package/dist/feedback/loading/loading.js +12 -12
- package/dist/feedback/loading/loading.js.map +1 -1
- package/dist/feedback/progress/progress_bar.js +1 -1
- package/dist/form/field/common/field_control/field_control.js +8 -8
- package/dist/form/field/common/status_input/status_input.js +6 -6
- package/dist/form/field/field.js +5 -5
- package/dist/form/field/h_field/h_field.js +11 -11
- package/dist/form/field/v_field/v_field.js +10 -10
- package/dist/form/field_set/field_set.js +3 -3
- package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js +6 -0
- package/dist/formatter-QJ4M4OGQ-DaIl2Wi_.js.map +1 -0
- package/dist/gallery.css +1 -0
- package/dist/inputs/checkbox/checkbox.js +11 -11
- package/dist/inputs/color_input/color_picker.js +5 -5
- package/dist/inputs/combo_box/combo_box.js +16 -16
- package/dist/inputs/date_picker/date_picker.js +18 -18
- package/dist/inputs/date_picker/date_picker_body.js +2 -2
- package/dist/inputs/date_picker/date_picker_input.js +18 -18
- package/dist/inputs/input/input.js +5 -5
- package/dist/inputs/mask_input/key_capture_input.js +7 -7
- package/dist/inputs/mask_input/mask_input.js +4 -4
- package/dist/inputs/multi_combo_box/multi_combo_box.js +17 -17
- package/dist/inputs/multiselect/multiselect.js +13 -13
- package/dist/inputs/multiselect/multiselect_row.js +8 -8
- package/dist/inputs/phone_number_input/phone_number_input.js +11 -11
- package/dist/inputs/radio/radio.js +10 -10
- package/dist/inputs/radio/radio_row.js +3 -3
- package/dist/inputs/select/select.js +14 -14
- package/dist/inputs/slider/slider.js +10 -10
- package/dist/inputs/switch/switch.js +4 -4
- package/dist/inputs/textarea/textarea.js +7 -7
- package/dist/inputs/unit_input/unit_input.js +4 -4
- package/dist/layouts/body/h_body.js +7 -7
- package/dist/layouts/body/v_body.js +6 -6
- package/dist/layouts/column/column.js +17 -17
- package/dist/layouts/footer/footer.js +7 -7
- package/dist/layouts/grid/grid.js +24 -24
- package/dist/layouts/header/header.js +2 -2
- package/dist/layouts/list/item.js +2 -2
- package/dist/layouts/list/list.js +7 -7
- package/dist/layouts/list/section_header.js +6 -6
- package/dist/layouts/scaffold/scaffold.js +16 -16
- package/dist/layouts/sidebar_end/sidebar_end.js +14 -14
- package/dist/layouts/sidebar_start/sidebar_start.js +10 -10
- package/dist/layouts/utility_bar/utility_bar.js +10 -10
- package/dist/overlay/frame/frame.js +4 -4
- package/dist/overlay/menu/menu.js +34 -34
- package/dist/overlay/portal/portal_platform_context.js +4 -4
- package/dist/showcase-WfP6kBEb.js +58401 -0
- package/dist/showcase-WfP6kBEb.js.map +1 -0
- package/dist/showcase.css +1 -0
- package/dist/stacks/box/box.js +23 -23
- package/dist/stacks/h_collapsible_box.js +2 -2
- package/dist/stacks/h_stack.js +41 -41
- package/dist/stacks/spacer.js +11 -11
- package/dist/stacks/story_components/circle.js +10 -10
- package/dist/stacks/story_components/picture_placeholder.js +9 -9
- package/dist/stacks/story_components/rect.js +7 -7
- package/dist/stacks/story_components/style_box.js +4 -4
- package/dist/stacks/utils/use_is_collapsed.js +6 -6
- package/dist/stacks/v_collapsible_box.js +2 -2
- package/dist/stacks/v_stack.js +42 -42
- package/dist/stacks/z_stack.js +39 -39
- package/dist/surfaces/alert/alert.js +4 -4
- package/dist/surfaces/card/card.js +4 -4
- package/dist/surfaces/confirm/confirm.js +9 -9
- package/dist/surfaces/drawers/drawer_start/drawer_start.js +2 -2
- package/dist/surfaces/drawers/drawer_top/drawer_top.js +2 -2
- package/dist/surfaces/modal/modal.js +5 -5
- package/dist/surfaces/page/h_page.js +7 -7
- package/dist/surfaces/page/v_page.js +5 -5
- package/dist/surfaces/panel/h_panel.js +14 -14
- package/dist/surfaces/panel/v_panel.js +9 -9
- package/dist/surfaces/pop_confirm/pop_confirm.js +6 -6
- package/dist/surfaces/popconfirm/pop_confirm.js +8 -8
- package/dist/surfaces/tooltip/tooltip.js +8 -8
- package/dist/surfaces/window/window.js +9 -9
- package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js +3777 -0
- package/dist/syntaxhighlighter-IQDEPFLK-BX_eF8__.js.map +1 -0
- package/dist/themes/themes/ergo/ergo_theme.js +33 -1
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/tokens/badge/badge.js +9 -9
- package/dist/tokens/bubble/bubble.js +8 -8
- package/dist/tokens/chip/chip.js +3 -3
- package/dist/utils/click_away_listener.js +10 -10
- package/dist/utils/click_away_listener.js.map +1 -1
- package/dist/utils/dnd/draggable/draggable.js +4 -4
- package/dist/utils/dnd/handle.js +8 -8
- package/dist/utils/focus_redirect.js +5 -5
- package/dist/utils/hooks/make_context_hook.js +4 -4
- package/dist/utils/hooks/use_media_query.js +2 -2
- package/dist/utils/hooks/use_media_query.js.map +1 -1
- package/package.json +1 -1
- package/src/actions/__docs__/actions.mdx +131 -0
- package/src/actions/__docs__/actions.stories.tsx +309 -0
- package/src/actions/__docs__/components/gallery.module.css +6 -0
- package/src/actions/__docs__/components/gallery.tsx +28 -0
- package/src/actions/__docs__/components/showcase.module.css +55 -0
- package/src/actions/__docs__/components/showcase.tsx +121 -0
- package/src/actions/button/base_button/base_button.tsx +5 -1
- package/src/actions/types.ts +6 -0
- package/src/themes/themes/ergo/ergo_theme.css +33 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as l, jsx as n, Fragment as T } from "react/jsx-runtime";
|
|
2
|
-
import { useSignalValue as y, useSignalValueEffect as
|
|
2
|
+
import { useSignalValue as y, useSignalValueEffect as _ } from "@tcn/state";
|
|
3
3
|
import "../../utils/click_away_listener.js";
|
|
4
4
|
import "../../utils/focus_redirect.js";
|
|
5
5
|
import "../../utils/scroll_away_listener.js";
|
|
6
|
-
import Y, { useState as
|
|
6
|
+
import Y, { useState as B, useRef as L, useLayoutEffect as r } from "react";
|
|
7
7
|
import { useResizeObserver as O } from "../../utils/hooks/use_resize_observer.js";
|
|
8
8
|
import { HStack as U } from "../../stacks/h_stack.js";
|
|
9
|
-
import { Spacer as
|
|
9
|
+
import { Spacer as R } from "../../stacks/spacer.js";
|
|
10
10
|
import { VStack as u } from "../../stacks/v_stack.js";
|
|
11
|
-
import { clsx as
|
|
11
|
+
import { clsx as V } from "clsx";
|
|
12
12
|
import { DatePickerBody as $ } from "./date_picker_body.js";
|
|
13
13
|
import { DatePickerHeader as q } from "./date_picker_header.js";
|
|
14
14
|
import { DatePickerPresenter as E } from "./date_picker_presenter.js";
|
|
@@ -22,22 +22,22 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
22
22
|
min: g = null,
|
|
23
23
|
max: b = null,
|
|
24
24
|
minVisibleTimeInMilliseconds: m,
|
|
25
|
-
maxVisibleTimeInMilliseconds:
|
|
26
|
-
disabledDates:
|
|
25
|
+
maxVisibleTimeInMilliseconds: f,
|
|
26
|
+
disabledDates: p,
|
|
27
27
|
countryCode: D = "en-US",
|
|
28
28
|
renderActions: P,
|
|
29
29
|
onTimeSelected: S,
|
|
30
30
|
timeIntervalInMinutes: d
|
|
31
31
|
}, H) {
|
|
32
|
-
const [F, I] =
|
|
32
|
+
const [F, I] = B(0), M = L(!1), j = O((t, o) => {
|
|
33
33
|
I(o);
|
|
34
|
-
}), [e] =
|
|
34
|
+
}), [e] = B(() => {
|
|
35
35
|
const t = /* @__PURE__ */ new Date(), o = i == null ? t.getFullYear() : i.getFullYear(), c = i == null ? t.getMonth() : i.getMonth();
|
|
36
36
|
return new E(i, o, c, s);
|
|
37
37
|
}), a = y(e.stateBroadcast), z = y(e.valueBroadcast), N = a.error;
|
|
38
|
-
return
|
|
38
|
+
return _((t) => {
|
|
39
39
|
N !== t && x && x(t);
|
|
40
|
-
}, e.errorBroadcast),
|
|
40
|
+
}, e.errorBroadcast), _((t) => {
|
|
41
41
|
M.current ? k && k(t) : M.current = !0;
|
|
42
42
|
}, e.valueBroadcast), r(() => {
|
|
43
43
|
e.initialize();
|
|
@@ -48,12 +48,12 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
48
48
|
}, [e, g]), r(() => {
|
|
49
49
|
e.setMaxDate(b);
|
|
50
50
|
}, [e, b]), r(() => {
|
|
51
|
-
|
|
52
|
-
}, [e,
|
|
51
|
+
p == null ? e.setDisabledDates([]) : e.setDisabledDates(p);
|
|
52
|
+
}, [e, p]), r(() => {
|
|
53
53
|
typeof m == "number" && e.setMinVisibleTime(m);
|
|
54
54
|
}, [e, m]), r(() => {
|
|
55
|
-
typeof
|
|
56
|
-
}, [e,
|
|
55
|
+
typeof f == "number" && e.setMaxVisibleTime(f);
|
|
56
|
+
}, [e, f]), r(() => {
|
|
57
57
|
typeof d == "number" && e.setTimeIntervalInMinutes(d);
|
|
58
58
|
}, [e, d]), r(() => {
|
|
59
59
|
e.selectDate(i);
|
|
@@ -63,7 +63,7 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
63
63
|
ref: H,
|
|
64
64
|
width: "auto",
|
|
65
65
|
height: "auto",
|
|
66
|
-
className:
|
|
66
|
+
className: V(w["date-picker"], "date-picker"),
|
|
67
67
|
tabIndex: 0,
|
|
68
68
|
children: [
|
|
69
69
|
/* @__PURE__ */ l(
|
|
@@ -73,7 +73,7 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
73
73
|
inline: !0,
|
|
74
74
|
height: "auto",
|
|
75
75
|
width: "auto",
|
|
76
|
-
className:
|
|
76
|
+
className: V(w["date-picker-box"], "date-picker-box"),
|
|
77
77
|
"data-is-disabled": h,
|
|
78
78
|
children: [
|
|
79
79
|
/* @__PURE__ */ l(u, { height: "auto", children: [
|
|
@@ -81,12 +81,12 @@ import '../../date_picker.css';const J = "_date-picker_0a0d8e4", K = "_date-pick
|
|
|
81
81
|
/* @__PURE__ */ n($, { countryCode: D, presenter: e })
|
|
82
82
|
] }),
|
|
83
83
|
P && /* @__PURE__ */ n(u, { paddingInline: "8px", children: P(e) }),
|
|
84
|
-
/* @__PURE__ */ n(
|
|
84
|
+
/* @__PURE__ */ n(R, { height: "8px" })
|
|
85
85
|
]
|
|
86
86
|
}
|
|
87
87
|
),
|
|
88
88
|
s && /* @__PURE__ */ l(T, { children: [
|
|
89
|
-
/* @__PURE__ */ n(
|
|
89
|
+
/* @__PURE__ */ n(R, { width: "8px" }),
|
|
90
90
|
/* @__PURE__ */ n(
|
|
91
91
|
G,
|
|
92
92
|
{
|
|
@@ -7,7 +7,7 @@ import { Spacer as c } from "../../stacks/spacer.js";
|
|
|
7
7
|
import { VStack as d } from "../../stacks/v_stack.js";
|
|
8
8
|
import { DatePickerDate as g } from "./date_picker_date.js";
|
|
9
9
|
import { DatePickerDay as k } from "./date_picker_day.js";
|
|
10
|
-
function
|
|
10
|
+
function j({ presenter: o, countryCode: p }) {
|
|
11
11
|
const { visibleDates: i } = n(o.stateBroadcast), a = [];
|
|
12
12
|
for (let t = 0; t < i.length; t += 7)
|
|
13
13
|
a.push(i.slice(t, t + 7));
|
|
@@ -21,6 +21,6 @@ function V({ presenter: o, countryCode: p }) {
|
|
|
21
21
|
] });
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
j as DatePickerBody
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=date_picker_body.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, Fragment as q, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import B, { useState as L, useRef as M, useCallback as V, useMemo as W, useLayoutEffect as Z } from "react";
|
|
3
3
|
import { ZStack as G } from "../../stacks/z_stack.js";
|
|
4
4
|
import { Popper as H } from "../../overlay/popper/legacy/popper.js";
|
|
5
|
-
import { clsx as
|
|
5
|
+
import { clsx as m } from "clsx";
|
|
6
6
|
import "../../actions/button/base_button/base_button.js";
|
|
7
7
|
import "../../actions/button/button_group/button_group.js";
|
|
8
8
|
import "../../actions/button/slim_button/slim_button.js";
|
|
@@ -33,17 +33,17 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
33
33
|
countryCode: s,
|
|
34
34
|
renderActions: S,
|
|
35
35
|
onTimeSelected: w,
|
|
36
|
-
...
|
|
37
|
-
},
|
|
38
|
-
const [n, a] = L(null),
|
|
36
|
+
..._
|
|
37
|
+
}, b) => {
|
|
38
|
+
const [n, a] = L(null), v = n != null, i = M(null), p = V((t) => t.closest(".suggestion-list") != null, []), C = W(() => {
|
|
39
39
|
const t = {
|
|
40
40
|
year: "numeric",
|
|
41
41
|
month: "short",
|
|
42
42
|
day: "numeric"
|
|
43
43
|
};
|
|
44
44
|
return r && (t.hour = "numeric", t.minute = "2-digit", t.hour12 = !0), new Intl.DateTimeFormat(s, t);
|
|
45
|
-
}, [s, r]),
|
|
46
|
-
function
|
|
45
|
+
}, [s, r]), F = c != null ? C.format(c) : R;
|
|
46
|
+
function P(t) {
|
|
47
47
|
a(t.currentTarget);
|
|
48
48
|
}
|
|
49
49
|
function e() {
|
|
@@ -54,7 +54,7 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
54
54
|
n != null && i.current && i.current.focus();
|
|
55
55
|
});
|
|
56
56
|
}, [n]);
|
|
57
|
-
function
|
|
57
|
+
function O(t) {
|
|
58
58
|
t.key === "Escape" && e();
|
|
59
59
|
}
|
|
60
60
|
function I() {
|
|
@@ -67,20 +67,20 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
67
67
|
function j(t, z, K) {
|
|
68
68
|
w?.(t, z, K), e();
|
|
69
69
|
}
|
|
70
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ u(q, { children: [
|
|
71
71
|
/* @__PURE__ */ o(
|
|
72
72
|
J,
|
|
73
73
|
{
|
|
74
|
-
ref:
|
|
75
|
-
className:
|
|
74
|
+
ref: b,
|
|
75
|
+
className: m(f.button, "select"),
|
|
76
76
|
hAlign: "start",
|
|
77
77
|
disabled: l,
|
|
78
78
|
hierarchy: A,
|
|
79
|
-
onClick:
|
|
79
|
+
onClick: P,
|
|
80
80
|
width: y,
|
|
81
81
|
maxWidth: D,
|
|
82
|
-
...
|
|
83
|
-
children: /* @__PURE__ */ o("span", { className: "ellipsis", children:
|
|
82
|
+
..._,
|
|
83
|
+
children: /* @__PURE__ */ o("span", { className: "ellipsis", children: F })
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
/* @__PURE__ */ o(
|
|
@@ -95,16 +95,16 @@ import '../../date_picker_input.css';const U = "_button_f404820", X = "_popover_
|
|
|
95
95
|
horizontalAnchor: "start",
|
|
96
96
|
verticalOrigin: "top",
|
|
97
97
|
horizontalOrigin: "start",
|
|
98
|
-
open:
|
|
98
|
+
open: v,
|
|
99
99
|
isClickAwayException: p,
|
|
100
100
|
isScrollAwayException: p,
|
|
101
101
|
restoreFocus: !0,
|
|
102
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ u(
|
|
103
103
|
G,
|
|
104
104
|
{
|
|
105
105
|
padding: "8px",
|
|
106
|
-
className:
|
|
107
|
-
onKeyDown:
|
|
106
|
+
className: m(f.popover, "date-picker-popover"),
|
|
107
|
+
onKeyDown: O,
|
|
108
108
|
children: [
|
|
109
109
|
/* @__PURE__ */ o(
|
|
110
110
|
Q,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { clsx as
|
|
3
|
-
import
|
|
4
|
-
import '../../input.css';const c = "_input_a16553f", m = { input: c },
|
|
2
|
+
import { clsx as f } from "clsx";
|
|
3
|
+
import o from "react";
|
|
4
|
+
import '../../input.css';const c = "_input_a16553f", m = { input: c }, y = o.forwardRef(function({ type: i = "text", style: s, className: n, width: r, height: l, onChange: a, ...t }, u) {
|
|
5
5
|
return /* @__PURE__ */ d(
|
|
6
6
|
"input",
|
|
7
7
|
{
|
|
8
|
-
className:
|
|
8
|
+
className: f(m.input, n, "input"),
|
|
9
9
|
type: i,
|
|
10
10
|
ref: u,
|
|
11
11
|
"data-is-disabled": t.disabled || !1,
|
|
@@ -19,6 +19,6 @@ import '../../input.css';const c = "_input_a16553f", m = { input: c }, I = f.for
|
|
|
19
19
|
);
|
|
20
20
|
});
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
y as Input
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=input.js.map
|
|
@@ -2,12 +2,12 @@ import { jsx as L } from "react/jsx-runtime";
|
|
|
2
2
|
import "../../utils/click_away_listener.js";
|
|
3
3
|
import "../../utils/focus_redirect.js";
|
|
4
4
|
import "../../utils/scroll_away_listener.js";
|
|
5
|
-
import
|
|
6
|
-
import { useForkRef as
|
|
5
|
+
import _, { useRef as e } from "react";
|
|
6
|
+
import { useForkRef as j } from "../../utils/hooks/use_fork_ref.js";
|
|
7
7
|
import "../../utils/hooks/use_resize_observer.js";
|
|
8
|
-
import { Input as
|
|
9
|
-
const
|
|
10
|
-
const p = e(0), c = e(0), r = e(0), u = e(0), x = e(0), o = e(0), i = e(null), P =
|
|
8
|
+
import { Input as B } from "../input/input.js";
|
|
9
|
+
const N = _.forwardRef(function({ onKeyCapture: n, onKeyDown: m, onInput: d, ...E }, v) {
|
|
10
|
+
const p = e(0), c = e(0), r = e(0), u = e(0), x = e(0), o = e(0), i = e(null), P = j(v, i);
|
|
11
11
|
function g(f) {
|
|
12
12
|
const t = i.current;
|
|
13
13
|
t != null && (p.current = t.value.length, c.current = t.selectionStart == null ? 0 : t.selectionStart, r.current = t.selectionEnd == null ? 0 : t.selectionEnd, o.current = r.current, u.current = Math.min(
|
|
@@ -71,9 +71,9 @@ const O = j.forwardRef(function({ onKeyCapture: n, onKeyDown: m, onInput: d, ...
|
|
|
71
71
|
}
|
|
72
72
|
d && d(f);
|
|
73
73
|
}
|
|
74
|
-
return /* @__PURE__ */ L(
|
|
74
|
+
return /* @__PURE__ */ L(B, { ref: P, onKeyDown: g, onInput: I, ...E });
|
|
75
75
|
});
|
|
76
76
|
export {
|
|
77
|
-
|
|
77
|
+
N as KeyCaptureInput
|
|
78
78
|
};
|
|
79
79
|
//# sourceMappingURL=key_capture_input.js.map
|
|
@@ -6,8 +6,8 @@ import "../../utils/scroll_away_listener.js";
|
|
|
6
6
|
import A, { useRef as I, useState as j, useLayoutEffect as p } from "react";
|
|
7
7
|
import { useForkRef as K } from "../../utils/hooks/use_fork_ref.js";
|
|
8
8
|
import "../../utils/hooks/use_resize_observer.js";
|
|
9
|
-
import { KeyCaptureInput as
|
|
10
|
-
import { MaskPresenter as
|
|
9
|
+
import { KeyCaptureInput as _ } from "./key_capture_input.js";
|
|
10
|
+
import { MaskPresenter as F } from "./mask_presenter.js";
|
|
11
11
|
const Y = A.forwardRef(
|
|
12
12
|
function({
|
|
13
13
|
value: m = "",
|
|
@@ -21,7 +21,7 @@ const Y = A.forwardRef(
|
|
|
21
21
|
prepareCopyValue: y = (i) => i,
|
|
22
22
|
...C
|
|
23
23
|
}, E) {
|
|
24
|
-
const i = Array.isArray(c) ? c : [c], f = I(null), D = K(E, f), [e] = j(() => new
|
|
24
|
+
const i = Array.isArray(c) ? c : [c], f = I(null), D = K(E, f), [e] = j(() => new F(i)), P = B(e.valueBroadcast);
|
|
25
25
|
B(e.maskConfigsBroadcast);
|
|
26
26
|
function T(t, s, n, o, l, r) {
|
|
27
27
|
switch (n != null ? e.setSelection(n.start, n.end) : e.forceMoveCursorTo(o), s) {
|
|
@@ -103,7 +103,7 @@ const Y = A.forwardRef(
|
|
|
103
103
|
document.removeEventListener("selectionchange", l), document.removeEventListener("mousedown", n), document.removeEventListener("keydown", o);
|
|
104
104
|
};
|
|
105
105
|
}, [e]), /* @__PURE__ */ V(
|
|
106
|
-
|
|
106
|
+
_,
|
|
107
107
|
{
|
|
108
108
|
value: P,
|
|
109
109
|
ref: D,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as t, jsxs as h, Fragment as C } from "react/jsx-runtime";
|
|
2
|
-
import O, { useState as
|
|
2
|
+
import O, { useState as _ } from "react";
|
|
3
3
|
import { ComboBox as v } from "../combo_box/combo_box.js";
|
|
4
|
-
import { MultiselectInlineValues as
|
|
5
|
-
import { MultiselectValues as
|
|
6
|
-
import { makeAvailableOptions as
|
|
7
|
-
import { Option as
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { VStack as
|
|
4
|
+
import { MultiselectInlineValues as N } from "../multiselect/multiselect_inline_values.js";
|
|
5
|
+
import { MultiselectValues as R } from "../multiselect/multiselect_values.js";
|
|
6
|
+
import { makeAvailableOptions as T } from "../options/utils.js";
|
|
7
|
+
import { Option as g } from "../options/option.js";
|
|
8
|
+
import { clsx as j } from "clsx";
|
|
9
|
+
import { VStack as k } from "../../stacks/v_stack.js";
|
|
10
10
|
import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3", F = { "multi-combo-box-container": E }, P = O.forwardRef(function({
|
|
11
11
|
value: e = [],
|
|
12
12
|
children: M,
|
|
@@ -19,11 +19,11 @@ import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3
|
|
|
19
19
|
inputProps: m,
|
|
20
20
|
...y
|
|
21
21
|
}, S) {
|
|
22
|
-
const [f, l] =
|
|
22
|
+
const [f, l] = _(""), u = O.Children.toArray(
|
|
23
23
|
M
|
|
24
|
-
),
|
|
25
|
-
const i =
|
|
26
|
-
return i ?? /* @__PURE__ */ t(
|
|
24
|
+
), p = T(u, e), d = e.map((o) => {
|
|
25
|
+
const i = u.find((a) => a.props.value === o);
|
|
26
|
+
return i ?? /* @__PURE__ */ t(g, { value: o, label: o, children: o });
|
|
27
27
|
});
|
|
28
28
|
function x(o) {
|
|
29
29
|
if (e.indexOf(o.props.value) > -1) {
|
|
@@ -49,11 +49,11 @@ import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3
|
|
|
49
49
|
noOptionMatchedMessage: "Press Enter To Add",
|
|
50
50
|
placeholder: "Type to Add",
|
|
51
51
|
...m,
|
|
52
|
-
children:
|
|
52
|
+
children: p
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
55
|
/* @__PURE__ */ t(
|
|
56
|
-
|
|
56
|
+
N,
|
|
57
57
|
{
|
|
58
58
|
values: d,
|
|
59
59
|
disabled: n,
|
|
@@ -61,11 +61,11 @@ import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3
|
|
|
61
61
|
}
|
|
62
62
|
)
|
|
63
63
|
] }) : /* @__PURE__ */ h(
|
|
64
|
-
|
|
64
|
+
k,
|
|
65
65
|
{
|
|
66
66
|
ref: S,
|
|
67
67
|
...y,
|
|
68
|
-
className:
|
|
68
|
+
className: j(F["multi-combo-box-container"], A),
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ t(
|
|
71
71
|
v,
|
|
@@ -79,11 +79,11 @@ import '../../multi_combo_box.css';const E = "_multi-combo-box-container_9528df3
|
|
|
79
79
|
noOptionMatchedMessage: "No Options Matched",
|
|
80
80
|
placeholder: "Type to Search or Add",
|
|
81
81
|
...m,
|
|
82
|
-
children:
|
|
82
|
+
children: p
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
85
|
/* @__PURE__ */ t(
|
|
86
|
-
|
|
86
|
+
R,
|
|
87
87
|
{
|
|
88
88
|
values: d,
|
|
89
89
|
onRemove: x,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as v, Fragment as
|
|
2
|
-
import A, { useRef as V, useLayoutEffect as
|
|
3
|
-
import { Spacer as
|
|
4
|
-
import { VStack as
|
|
5
|
-
import { MultiselectInlineValues as
|
|
6
|
-
import { MultiselectValues as
|
|
1
|
+
import { jsxs as v, Fragment as w, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import A, { useRef as V, useLayoutEffect as j } from "react";
|
|
3
|
+
import { Spacer as q } from "../../stacks/spacer.js";
|
|
4
|
+
import { VStack as C } from "../../stacks/v_stack.js";
|
|
5
|
+
import { MultiselectInlineValues as E } from "./multiselect_inline_values.js";
|
|
6
|
+
import { MultiselectValues as N } from "./multiselect_values.js";
|
|
7
7
|
import { makeAvailableOptions as g, makeValuesAsOptions as I } from "../options/utils.js";
|
|
8
8
|
import { Select as S } from "../select/select.js";
|
|
9
9
|
import "../../utils/click_away_listener.js";
|
|
@@ -26,7 +26,7 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
26
26
|
const r = V(null), F = L(m, r), c = e[e.length - 1] || null, O = V(null), f = A.Children.toArray(
|
|
27
27
|
x
|
|
28
28
|
), p = g(f, e), d = I(f, e);
|
|
29
|
-
|
|
29
|
+
j(() => {
|
|
30
30
|
const t = O.current;
|
|
31
31
|
c != null && t != null && (t.querySelector(`[data-value='${c}']`)?.focus(), requestAnimationFrame(() => {
|
|
32
32
|
r.current && r.current.focus();
|
|
@@ -37,11 +37,11 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
37
37
|
}
|
|
38
38
|
function R(t) {
|
|
39
39
|
if (e.indexOf(t.props.value) > -1) {
|
|
40
|
-
const M = e.filter((
|
|
40
|
+
const M = e.filter((_) => _ !== t.props.value);
|
|
41
41
|
n && n(M);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
return y ? /* @__PURE__ */ v(
|
|
44
|
+
return y ? /* @__PURE__ */ v(w, { children: [
|
|
45
45
|
/* @__PURE__ */ l(
|
|
46
46
|
S,
|
|
47
47
|
{
|
|
@@ -55,9 +55,9 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
55
55
|
children: p
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
/* @__PURE__ */ l(
|
|
58
|
+
/* @__PURE__ */ l(q, { width: "8px" }),
|
|
59
59
|
/* @__PURE__ */ l(
|
|
60
|
-
|
|
60
|
+
E,
|
|
61
61
|
{
|
|
62
62
|
values: d,
|
|
63
63
|
onRemove: R,
|
|
@@ -65,7 +65,7 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
67
|
] }) : /* @__PURE__ */ v(
|
|
68
|
-
|
|
68
|
+
C,
|
|
69
69
|
{
|
|
70
70
|
width: s,
|
|
71
71
|
minWidth: i,
|
|
@@ -88,7 +88,7 @@ import '../../multiselect.css';const $ = "_multiselect-container_009951a", z = {
|
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
90
|
/* @__PURE__ */ l(
|
|
91
|
-
|
|
91
|
+
N,
|
|
92
92
|
{
|
|
93
93
|
disabled: o,
|
|
94
94
|
values: d,
|
|
@@ -3,21 +3,21 @@ import R from "react";
|
|
|
3
3
|
import { useSignalValue as p } from "@tcn/state";
|
|
4
4
|
import { HField as E } from "../../form/field/h_field/h_field.js";
|
|
5
5
|
import { Multiselect as S } from "./multiselect.js";
|
|
6
|
-
const
|
|
6
|
+
const j = R.forwardRef(function({ presenter: r, children: c, id: u, ...m }, d) {
|
|
7
7
|
let n = [];
|
|
8
|
-
const
|
|
8
|
+
const a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), f = p(r.optionsBroadcast), { value: g, label: M, description: w, error: v } = p(r.stateBroadcast), V = f.map((e, o) => {
|
|
9
9
|
const t = c(e, o);
|
|
10
|
-
return
|
|
10
|
+
return a.set(e, t.props.value), l.set(t.props.value, e), t;
|
|
11
11
|
});
|
|
12
12
|
function h(e) {
|
|
13
13
|
const o = e.map((t) => {
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
14
|
+
const s = l.get(t);
|
|
15
|
+
if (s == null) throw new Error(`Invalid value: ${t}`);
|
|
16
|
+
return s;
|
|
17
17
|
});
|
|
18
18
|
o && r.setValue(o);
|
|
19
19
|
}
|
|
20
|
-
return n = g.map((e) =>
|
|
20
|
+
return n = g.map((e) => a.get(e) || "") || [], /* @__PURE__ */ i(
|
|
21
21
|
E,
|
|
22
22
|
{
|
|
23
23
|
id: u,
|
|
@@ -30,6 +30,6 @@ const C = R.forwardRef(function({ presenter: r, children: c, id: u, ...m }, d) {
|
|
|
30
30
|
);
|
|
31
31
|
});
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
j as MultiselectRow
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=multiselect_row.js.map
|
|
@@ -14,13 +14,13 @@ import { countriesPhoneInformation as $ } from "./countries_phone_information.js
|
|
|
14
14
|
import { NotebookIcon as Ie } from "@tcn/icons/notebook_icon.js";
|
|
15
15
|
import { Option as F } from "../options/option.js";
|
|
16
16
|
import { SuggestionList as Ne } from "../suggestions/suggestion_list.js";
|
|
17
|
-
import { stripNonNumericAfterCountryCode as
|
|
17
|
+
import { stripNonNumericAfterCountryCode as _ } from "./utils.js";
|
|
18
18
|
import "../../utils/click_away_listener.js";
|
|
19
19
|
import "../../utils/focus_redirect.js";
|
|
20
20
|
import "../../utils/scroll_away_listener.js";
|
|
21
21
|
import { useForkRef as ye } from "../../utils/hooks/use_fork_ref.js";
|
|
22
22
|
import "../../utils/hooks/use_resize_observer.js";
|
|
23
|
-
import '../../phone_number_input.css';const xe = "_phone-number-input_5c4483d", ge = "_phone-number-input-select_a7b33ac", Pe = "_phone-number-input-input_5b14556",
|
|
23
|
+
import '../../phone_number_input.css';const xe = "_phone-number-input_5c4483d", ge = "_phone-number-input-select_a7b33ac", Pe = "_phone-number-input-input_5b14556", _e = "_phone-number-input-phone-book-popover_1511f35", Se = "_phone-number-input-phone-book_7999ca1", Be = "_phone-number-input-obfuscated_5a0ed8c", f = { "phone-number-input": xe, "phone-number-input-select": ge, "phone-number-input-input": Pe, "phone-number-input-phone-book-popover": _e, "phone-number-input-phone-book": Se, "phone-number-input-obfuscated": Be }, Oe = "•";
|
|
24
24
|
function Ve(o) {
|
|
25
25
|
return o.map((n) => ({
|
|
26
26
|
...n,
|
|
@@ -66,7 +66,7 @@ function Me(o) {
|
|
|
66
66
|
n.value
|
|
67
67
|
));
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function S(o, n, r) {
|
|
70
70
|
for (let h = 5; h > 1; h--) {
|
|
71
71
|
const c = o.slice(0, h), u = B.get(c);
|
|
72
72
|
if (u != null) {
|
|
@@ -93,13 +93,13 @@ const Ye = me.forwardRef(function({
|
|
|
93
93
|
}, ne) {
|
|
94
94
|
const N = Y(n), [j, V] = m(
|
|
95
95
|
null
|
|
96
|
-
), z = j != null, [b, M] = m(c), H =
|
|
96
|
+
), z = j != null, [b, M] = m(c), H = S(
|
|
97
97
|
n,
|
|
98
98
|
b,
|
|
99
99
|
c
|
|
100
100
|
), [y, x] = m(() => {
|
|
101
101
|
const e = n.split(H.prefix)[1];
|
|
102
|
-
return e == null ? "" :
|
|
102
|
+
return e == null ? "" : _(e);
|
|
103
103
|
}), D = Z(() => fe.toArray(T).filter(
|
|
104
104
|
(e) => he(e) && e.type === F
|
|
105
105
|
), [T]), R = D.length > 0, [C, g] = m(H.code), [W, P] = m([
|
|
@@ -109,11 +109,11 @@ const Ye = me.forwardRef(function({
|
|
|
109
109
|
const t = k.get(e);
|
|
110
110
|
if (t == null || (g(t.code), P([...t.masks]), M(t.code), y == null))
|
|
111
111
|
return;
|
|
112
|
-
const p = `${t.prefix}${
|
|
112
|
+
const p = `${t.prefix}${_(y)}`;
|
|
113
113
|
N.current = p, u && u(p, !1);
|
|
114
114
|
}
|
|
115
115
|
A(() => {
|
|
116
|
-
const e =
|
|
116
|
+
const e = S(
|
|
117
117
|
n,
|
|
118
118
|
b,
|
|
119
119
|
c
|
|
@@ -121,7 +121,7 @@ const Ye = me.forwardRef(function({
|
|
|
121
121
|
g(e.code), P([...e.masks]), M(e.code);
|
|
122
122
|
}, [n, b, c]);
|
|
123
123
|
function ue(e) {
|
|
124
|
-
const t = k.get(C)?.prefix, p =
|
|
124
|
+
const t = k.get(C)?.prefix, p = _(e), s = t + p;
|
|
125
125
|
a && E(!1), N.current = s, y !== e && x(e), u && u(s, !1);
|
|
126
126
|
}
|
|
127
127
|
function se(e) {
|
|
@@ -135,7 +135,7 @@ const Ye = me.forwardRef(function({
|
|
|
135
135
|
}
|
|
136
136
|
function ce(e) {
|
|
137
137
|
if (e.startsWith("+")) {
|
|
138
|
-
const t =
|
|
138
|
+
const t = S(
|
|
139
139
|
e,
|
|
140
140
|
b,
|
|
141
141
|
c
|
|
@@ -148,12 +148,12 @@ const Ye = me.forwardRef(function({
|
|
|
148
148
|
}
|
|
149
149
|
function ae(e) {
|
|
150
150
|
G(!0), E(!1), x(e);
|
|
151
|
-
const t = k.get(C)?.prefix, p =
|
|
151
|
+
const t = k.get(C)?.prefix, p = _(e), s = t + p;
|
|
152
152
|
N.current = s, u && u(s, !1);
|
|
153
153
|
}
|
|
154
154
|
const w = be(
|
|
155
155
|
(e, t = !1) => {
|
|
156
|
-
const p = N.current, s =
|
|
156
|
+
const p = N.current, s = S(
|
|
157
157
|
e,
|
|
158
158
|
b,
|
|
159
159
|
c
|
|
@@ -3,32 +3,32 @@ import { clsx as x } from "clsx";
|
|
|
3
3
|
import h from "react";
|
|
4
4
|
import { HStack as p } from "../../stacks/h_stack.js";
|
|
5
5
|
import '../../radio.css';const y = "_radio_ce5c4e1", R = { radio: y };
|
|
6
|
-
let
|
|
7
|
-
function
|
|
8
|
-
return o ?? `radio-${
|
|
6
|
+
let _ = 0;
|
|
7
|
+
function g(o) {
|
|
8
|
+
return o ?? `radio-${_++}`;
|
|
9
9
|
}
|
|
10
|
-
const
|
|
10
|
+
const j = h.forwardRef(function({
|
|
11
11
|
name: l,
|
|
12
12
|
id: s,
|
|
13
13
|
label: a,
|
|
14
14
|
className: c,
|
|
15
15
|
checked: r,
|
|
16
16
|
backgroundColor: u,
|
|
17
|
-
value:
|
|
17
|
+
value: f,
|
|
18
18
|
onChange: e,
|
|
19
19
|
...t
|
|
20
|
-
},
|
|
21
|
-
const d =
|
|
20
|
+
}, m) {
|
|
21
|
+
const d = g(s);
|
|
22
22
|
return /* @__PURE__ */ b(p, { inline: !0, width: "auto", children: [
|
|
23
23
|
/* @__PURE__ */ n(
|
|
24
24
|
"input",
|
|
25
25
|
{
|
|
26
|
-
ref:
|
|
26
|
+
ref: m,
|
|
27
27
|
className: x(c, R.radio, "radio"),
|
|
28
28
|
type: "radio",
|
|
29
29
|
id: d,
|
|
30
30
|
name: l,
|
|
31
|
-
value:
|
|
31
|
+
value: f,
|
|
32
32
|
style: { backgroundColor: u },
|
|
33
33
|
checked: r,
|
|
34
34
|
"data-checked": r,
|
|
@@ -52,6 +52,6 @@ const C = h.forwardRef(function({
|
|
|
52
52
|
] });
|
|
53
53
|
});
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
j as Radio
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=radio.js.map
|
|
@@ -4,14 +4,14 @@ import r, { useState as c } from "react";
|
|
|
4
4
|
import { HField as d } from "../../form/field/h_field/h_field.js";
|
|
5
5
|
import { FieldPresenter as R } from "../../form/field_presenters/field_presenter.js";
|
|
6
6
|
function C({ presenter: t, id: n, ...a }) {
|
|
7
|
-
const [o] = c(() => t ?? new R("Label", "")), { label: i, value: s, description: l, error:
|
|
7
|
+
const [o] = c(() => t ?? new R("Label", "")), { label: i, value: s, description: l, error: u } = f(
|
|
8
8
|
o.stateBroadcast
|
|
9
|
-
),
|
|
9
|
+
), m = r.Children.map(a.children, (e) => !r.isValidElement(e) || e.type !== "Radio" ? e : r.cloneElement(e, {
|
|
10
10
|
...e.props,
|
|
11
11
|
checked: s === e.props,
|
|
12
12
|
onChange: o.setValue
|
|
13
13
|
}));
|
|
14
|
-
return /* @__PURE__ */ p(d, { id: n, label: i, description: l, errorMessage:
|
|
14
|
+
return /* @__PURE__ */ p(d, { id: n, label: i, description: l, errorMessage: u, children: m });
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
17
|
C as RadioRow
|