@tcn/ui 0.10.0 → 0.12.0
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/feedback/index.d.ts +1 -0
- package/dist/feedback/index.d.ts.map +1 -1
- package/dist/feedback/index.js +6 -4
- package/dist/feedback/index.js.map +1 -1
- package/dist/feedback/progress/progress.d.ts +7 -0
- package/dist/feedback/progress/progress.d.ts.map +1 -0
- package/dist/feedback/progress/progress.js +38 -0
- package/dist/feedback/progress/progress.js.map +1 -0
- package/dist/feedback/progress/progress_bar.d.ts +0 -1
- package/dist/feedback/progress/progress_bar.d.ts.map +1 -1
- package/dist/feedback/progress/progress_bar.js +6 -46
- package/dist/feedback/progress/progress_bar.js.map +1 -1
- package/dist/form/field/common/status_input/status_input.js +4 -3
- package/dist/form/field/common/status_input/status_input.js.map +1 -1
- package/dist/form/field/h_field/h_field.d.ts.map +1 -1
- package/dist/form/field/h_field/h_field.js +33 -35
- package/dist/form/field/h_field/h_field.js.map +1 -1
- package/dist/form/field/v_field/v_field.d.ts.map +1 -1
- package/dist/form/field/v_field/v_field.js +34 -36
- package/dist/form/field/v_field/v_field.js.map +1 -1
- package/dist/frame.css +1 -1
- package/dist/inputs/color_input/color_input.d.ts.map +1 -1
- package/dist/inputs/color_input/color_input.js +47 -46
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/combo_box/combo_box.d.ts.map +1 -1
- package/dist/inputs/combo_box/combo_box.js +61 -58
- package/dist/inputs/combo_box/combo_box.js.map +1 -1
- package/dist/inputs/index.d.ts +1 -0
- package/dist/inputs/index.d.ts.map +1 -1
- package/dist/inputs/index.js +34 -31
- package/dist/inputs/index.js.map +1 -1
- package/dist/inputs/input/input.js +9 -9
- package/dist/inputs/input/input.js.map +1 -1
- package/dist/inputs/input_group/input_group.d.ts +5 -0
- package/dist/inputs/input_group/input_group.d.ts.map +1 -0
- package/dist/inputs/input_group/input_group.js +20 -0
- package/dist/inputs/input_group/input_group.js.map +1 -0
- package/dist/inputs/phone_number_input/countries_phone_information.d.ts +2 -2
- package/dist/inputs/phone_number_input/countries_phone_information.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/countries_phone_information.js +5 -353
- package/dist/inputs/phone_number_input/countries_phone_information.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_context.d.ts +24 -0
- package/dist/inputs/phone_number_input/phone_number_context.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_context.js +23 -0
- package/dist/inputs/phone_number_input/phone_number_context.js.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.d.ts +19 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js +77 -0
- package/dist/inputs/phone_number_input/phone_number_country_select_adapter.js.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_input.d.ts +16 -14
- package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.js +104 -274
- package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input_adapter.d.ts +6 -0
- package/dist/inputs/phone_number_input/phone_number_input_adapter.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js +95 -0
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js.map +1 -0
- package/dist/inputs/phone_number_input/sip_input.d.ts +12 -0
- package/dist/inputs/phone_number_input/sip_input.d.ts.map +1 -0
- package/dist/inputs/phone_number_input/sip_input.js +111 -0
- package/dist/inputs/phone_number_input/sip_input.js.map +1 -0
- package/dist/inputs/select/select.d.ts.map +1 -1
- package/dist/inputs/select/select.js +3 -2
- package/dist/inputs/select/select.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts +4 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +148 -121
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/inputs/textarea/textarea.js +8 -8
- package/dist/inputs/textarea/textarea.js.map +1 -1
- package/dist/inputs/unit_input/unit_input.d.ts.map +1 -1
- package/dist/inputs/unit_input/unit_input.js +39 -39
- package/dist/inputs/unit_input/unit_input.js.map +1 -1
- package/dist/overlay/frame/frame.d.ts +8 -4
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +88 -24
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/overlay/popper/base/dismissal_decorator.js.map +1 -1
- package/dist/overlay/popper/legacy/popper.d.ts.map +1 -1
- package/dist/overlay/popper/legacy/popper.js +52 -50
- package/dist/overlay/popper/legacy/popper.js.map +1 -1
- package/dist/phone_number_input.css +1 -1
- package/dist/progress_bar-CPP0Jyv-.js +38 -0
- package/dist/progress_bar-CPP0Jyv-.js.map +1 -0
- package/dist/progress_bar.css +1 -1
- package/dist/stacks/box/bottom_resize_handle.d.ts +2 -8
- package/dist/stacks/box/bottom_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
- package/dist/stacks/box/box.d.ts +2 -2
- package/dist/stacks/box/box.d.ts.map +1 -1
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.d.ts +2 -8
- package/dist/stacks/box/end_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/left_resize_handle.d.ts +2 -8
- package/dist/stacks/box/left_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/left_resize_handle.js.map +1 -1
- package/dist/stacks/box/resize_handlers.d.ts +3 -2
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +41 -37
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.d.ts +2 -8
- package/dist/stacks/box/right_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/right_resize_handle.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.d.ts +2 -8
- package/dist/stacks/box/start_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/start_resize_handle.js +4 -4
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/top_resize_handle.d.ts +2 -8
- package/dist/stacks/box/top_resize_handle.d.ts.map +1 -1
- package/dist/stacks/box/top_resize_handle.js +4 -4
- package/dist/stacks/box/top_resize_handle.js.map +1 -1
- package/dist/stacks/box/types.d.ts +18 -0
- package/dist/stacks/box/types.d.ts.map +1 -0
- package/dist/stacks/h_collapsible_box.js +25 -25
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/index.d.ts +1 -0
- package/dist/stacks/index.d.ts.map +1 -1
- package/dist/stacks/v_collapsible_box.js +25 -25
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/suggestion_list.css +1 -1
- package/dist/surfaces/modal/modal.d.ts +3 -4
- package/dist/surfaces/modal/modal.d.ts.map +1 -1
- package/dist/surfaces/modal/modal.js +10 -8
- package/dist/surfaces/modal/modal.js.map +1 -1
- package/dist/surfaces/window/window.d.ts +3 -4
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +26 -14
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/themes/stylesheets/reset.css +1 -1
- package/dist/themes/stylesheets/reset.js +8 -1
- package/dist/themes/stylesheets/reset.js.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +186 -19
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/typography/body_text/body_text.d.ts.map +1 -1
- package/dist/typography/body_text/body_text.js +12 -10
- package/dist/typography/body_text/body_text.js.map +1 -1
- package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +1 -1
- package/dist/utils/dnd/hooks/use_drag_container.js +22 -19
- package/dist/utils/dnd/hooks/use_drag_container.js.map +1 -1
- package/package.json +4 -2
- package/src/feedback/index.ts +1 -0
- package/src/feedback/progress/progress.module.css +5 -0
- package/src/feedback/progress/progress.stories.tsx +48 -0
- package/src/feedback/progress/progress.tsx +39 -0
- package/src/feedback/progress/progress_bar.module.css +4 -28
- package/src/feedback/progress/progress_bar.stories.tsx +1 -1
- package/src/feedback/progress/progress_bar.tsx +14 -26
- package/src/form/field/h_field/h_field.tsx +0 -4
- package/src/form/field/v_field/v_field.stories.tsx +8 -0
- package/src/form/field/v_field/v_field.tsx +1 -4
- package/src/form/field_set/field_set.stories.tsx +2 -1
- package/src/inputs/__docs__/inputs.mdx +81 -0
- package/src/inputs/__docs__/inputs.stories.tsx +268 -0
- package/src/inputs/color_input/color_input.tsx +17 -17
- package/src/inputs/combo_box/combo_box.tsx +17 -13
- package/src/inputs/index.ts +2 -0
- package/src/inputs/input/input.tsx +1 -1
- package/src/inputs/input_group/input_group.tsx +26 -0
- package/src/inputs/phone_number_input/countries_phone_information.ts +6 -353
- package/src/inputs/phone_number_input/phone_number_context.tsx +32 -0
- package/src/inputs/phone_number_input/phone_number_country_select_adapter.tsx +126 -0
- package/src/inputs/phone_number_input/phone_number_input.module.css +5 -63
- package/src/inputs/phone_number_input/phone_number_input.stories.tsx +180 -150
- package/src/inputs/phone_number_input/phone_number_input.tsx +133 -400
- package/src/inputs/phone_number_input/phone_number_input_adapter.tsx +123 -0
- package/src/inputs/phone_number_input/sip_input.tsx +147 -0
- package/src/inputs/select/select.stories.tsx +23 -2
- package/src/inputs/select/select.tsx +13 -14
- package/src/inputs/suggestions/suggestion_list.module.css +1 -0
- package/src/inputs/suggestions/suggestion_list.stories.tsx +12 -8
- package/src/inputs/suggestions/suggestion_list.tsx +82 -42
- package/src/inputs/textarea/textarea.tsx +1 -1
- package/src/inputs/unit_input/unit_input.tsx +17 -17
- package/src/overlay/frame/frame.module.css +2 -4
- package/src/overlay/frame/frame.stories.tsx +13 -10
- package/src/overlay/frame/frame.tsx +121 -15
- package/src/overlay/popper/base/dismissal_decorator.tsx +1 -1
- package/src/overlay/popper/legacy/popper.tsx +5 -1
- package/src/stacks/box/bottom_resize_handle.tsx +2 -8
- package/src/stacks/box/box.tsx +14 -2
- package/src/stacks/box/end_resize_handle.tsx +3 -8
- package/src/stacks/box/left_resize_handle.tsx +3 -8
- package/src/stacks/box/resize_handlers.ts +28 -12
- package/src/stacks/box/right_resize_handle.tsx +2 -8
- package/src/stacks/box/start_resize_handle.tsx +4 -9
- package/src/stacks/box/top_resize_handle.tsx +4 -8
- package/src/stacks/box/types.ts +44 -0
- package/src/stacks/h_collapsible_box.tsx +2 -2
- package/src/stacks/index.ts +1 -0
- package/src/stacks/v_collapsible_box.tsx +2 -2
- package/src/surfaces/modal/modal.tsx +6 -4
- package/src/surfaces/window/window.stories.tsx +9 -1
- package/src/surfaces/window/window.tsx +19 -7
- package/src/themes/stories/controls_fieldset.tsx +1 -1
- package/src/themes/stylesheets/reset.css +8 -1
- package/src/themes/themes/ergo/ergo_theme.css +186 -19
- package/src/typography/body_text/body_text.tsx +2 -0
- package/src/utils/dnd/__stories__/draggable.stories.tsx +14 -8
- package/src/utils/dnd/hooks/use_drag_container.ts +13 -3
- package/src/inputs/phone_number_input/__tests__/utils.test.ts +0 -52
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsxs as n, Fragment as
|
|
1
|
+
import { jsxs as n, Fragment as I, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Box as m } from "../../stacks/box/box.js";
|
|
3
|
-
import { HStack as
|
|
3
|
+
import { HStack as $ } from "../../stacks/h_stack.js";
|
|
4
4
|
import { Spacer as p } from "../../stacks/spacer.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useState as A, useRef as N, useLayoutEffect as P } from "react";
|
|
5
|
+
import { clsx as h } from "clsx";
|
|
6
|
+
import { useState as C, useRef as A, useLayoutEffect as N } from "react";
|
|
8
7
|
import "../../actions/button/base_button/base_button.js";
|
|
9
8
|
import "../../actions/button/button_group/button_group.js";
|
|
10
9
|
import "../../actions/button/slim_button/slim_button.js";
|
|
11
|
-
import { Button as
|
|
10
|
+
import { Button as P } from "../../actions/button/button/button.js";
|
|
12
11
|
import "../../actions/button/select_group/select_group.js";
|
|
13
12
|
import "../../actions/button/select_group/single_select_group.js";
|
|
14
13
|
import "../../actions/toggle/toggle.js";
|
|
15
|
-
import { ColorPicker as
|
|
16
|
-
import { Input as
|
|
17
|
-
import { Popper as
|
|
18
|
-
import
|
|
14
|
+
import { ColorPicker as _ } from "./color_picker.js";
|
|
15
|
+
import { Input as B } from "../input/input.js";
|
|
16
|
+
import { Popper as F } from "../../overlay/popper/legacy/popper.js";
|
|
17
|
+
import { InputGroup as j } from "../input_group/input_group.js";
|
|
18
|
+
import '../../color_input.css';const z = "_checker-board_2cc94a9", K = "_color-input-select_abe3066", f = { "checker-board": z, "color-input-select": K };
|
|
19
19
|
function or({
|
|
20
20
|
value: c = "#000",
|
|
21
21
|
onChange: i,
|
|
22
22
|
onError: O,
|
|
23
23
|
disabled: s,
|
|
24
|
-
width:
|
|
25
|
-
maxWidth:
|
|
26
|
-
minWidth:
|
|
27
|
-
hierarchy:
|
|
28
|
-
...
|
|
24
|
+
width: x = "100%",
|
|
25
|
+
maxWidth: g,
|
|
26
|
+
minWidth: b,
|
|
27
|
+
hierarchy: k = "secondary",
|
|
28
|
+
...E
|
|
29
29
|
}) {
|
|
30
|
-
const [e, a] =
|
|
30
|
+
const [e, a] = C(null), y = e != null, d = A(null);
|
|
31
31
|
function w(t) {
|
|
32
32
|
a(t.currentTarget);
|
|
33
33
|
}
|
|
34
34
|
function u() {
|
|
35
35
|
a(null);
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
N(() => {
|
|
38
38
|
requestAnimationFrame(() => {
|
|
39
39
|
e != null && d.current && d.current.focus();
|
|
40
40
|
});
|
|
@@ -42,25 +42,26 @@ function or({
|
|
|
42
42
|
function R(t) {
|
|
43
43
|
t.key === "Escape" && u();
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
const
|
|
45
|
+
function S(t) {
|
|
46
|
+
const r = t.rgb;
|
|
47
47
|
let l = t.hex;
|
|
48
|
-
|
|
48
|
+
r.a != null ? l = `rgba(${r.r},${r.g},${r.b},${r.a})` : l = `rgb(${r.r},${r.g},${r.b})`, i && i(l);
|
|
49
49
|
}
|
|
50
|
-
return /* @__PURE__ */ n(
|
|
50
|
+
return /* @__PURE__ */ n(I, { children: [
|
|
51
51
|
/* @__PURE__ */ n(
|
|
52
|
-
|
|
52
|
+
j,
|
|
53
53
|
{
|
|
54
54
|
height: "auto",
|
|
55
|
-
width:
|
|
56
|
-
minWidth:
|
|
57
|
-
maxWidth:
|
|
55
|
+
width: x,
|
|
56
|
+
minWidth: b,
|
|
57
|
+
maxWidth: g,
|
|
58
58
|
className: "tcn-color-input-wrapper",
|
|
59
|
-
...
|
|
59
|
+
...E,
|
|
60
60
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
61
|
+
/* @__PURE__ */ o(
|
|
62
|
+
B,
|
|
63
63
|
{
|
|
64
|
+
width: "flex",
|
|
64
65
|
disabled: s,
|
|
65
66
|
value: c,
|
|
66
67
|
style: {
|
|
@@ -72,17 +73,17 @@ function or({
|
|
|
72
73
|
className: "tcn-color-input",
|
|
73
74
|
onChange: i
|
|
74
75
|
}
|
|
75
|
-
)
|
|
76
|
+
),
|
|
76
77
|
/* @__PURE__ */ n(
|
|
77
|
-
|
|
78
|
+
P,
|
|
78
79
|
{
|
|
79
80
|
disabled: s,
|
|
80
|
-
hierarchy:
|
|
81
|
+
hierarchy: k,
|
|
81
82
|
onClick: w,
|
|
82
83
|
width: "70px",
|
|
83
84
|
maxWidth: "70px",
|
|
84
|
-
className:
|
|
85
|
-
|
|
85
|
+
className: h(
|
|
86
|
+
f["color-input-select"],
|
|
86
87
|
"tcn-color-input-select",
|
|
87
88
|
"tcn-select"
|
|
88
89
|
),
|
|
@@ -92,16 +93,16 @@ function or({
|
|
|
92
93
|
paddingInlineEnd: 0
|
|
93
94
|
},
|
|
94
95
|
children: [
|
|
95
|
-
/* @__PURE__ */ n(
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ n($, { height: "14px", gap: "4px", hAlign: "start", children: [
|
|
97
|
+
/* @__PURE__ */ o(p, { width: "4px" }),
|
|
98
|
+
/* @__PURE__ */ o(
|
|
98
99
|
m,
|
|
99
100
|
{
|
|
100
101
|
width: "flex",
|
|
101
102
|
height: "30px",
|
|
102
|
-
className: f
|
|
103
|
+
className: h(f["checker-board"], "tcn-checker-board"),
|
|
103
104
|
style: { borderRadius: "2px", overflow: "hidden" },
|
|
104
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ o(
|
|
105
106
|
m,
|
|
106
107
|
{
|
|
107
108
|
height: "100%",
|
|
@@ -110,30 +111,30 @@ function or({
|
|
|
110
111
|
)
|
|
111
112
|
}
|
|
112
113
|
),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ o(p, {})
|
|
114
115
|
] }),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ o(p, { width: "4px" })
|
|
116
117
|
]
|
|
117
118
|
}
|
|
118
119
|
)
|
|
119
120
|
]
|
|
120
121
|
}
|
|
121
122
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
|
|
123
|
+
/* @__PURE__ */ o(
|
|
124
|
+
F,
|
|
124
125
|
{
|
|
125
126
|
anchorElement: e,
|
|
126
127
|
onClose: u,
|
|
127
|
-
open:
|
|
128
|
+
open: y,
|
|
128
129
|
restoreFocus: !0,
|
|
129
130
|
horizontalAnchor: "end",
|
|
130
131
|
horizontalOrigin: "end",
|
|
131
|
-
children: /* @__PURE__ */
|
|
132
|
-
|
|
132
|
+
children: /* @__PURE__ */ o(
|
|
133
|
+
_,
|
|
133
134
|
{
|
|
134
135
|
color: c,
|
|
135
136
|
onKeyDown: R,
|
|
136
|
-
onColorChange:
|
|
137
|
+
onColorChange: S
|
|
137
138
|
}
|
|
138
139
|
)
|
|
139
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color_input.js","sources":["../../../src/inputs/color_input/color_input.tsx"],"sourcesContent":["import { Box } from '../../stacks/box/box.js';\nimport { HStack } from '../../stacks/h_stack.js';\nimport { Spacer } from '../../stacks/spacer.js';\nimport {
|
|
1
|
+
{"version":3,"file":"color_input.js","sources":["../../../src/inputs/color_input/color_input.tsx"],"sourcesContent":["import { Box } from '../../stacks/box/box.js';\nimport { HStack } from '../../stacks/h_stack.js';\nimport { Spacer } from '../../stacks/spacer.js';\nimport { clsx } from 'clsx';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { HTMLAttributes } from 'react';\nimport { ColorState } from 'react-color';\nimport { Button } from '../../actions/index.js';\nimport { ColorPicker } from './color_picker.js';\nimport { Input } from '../input/input.js';\nimport styles from './color_input.module.css';\n\nimport { Popper } from '../../overlay/popper/legacy/popper.js';\nimport { InputGroup } from '../input_group/input_group.js';\n\nexport interface ColorInputProps\n extends Omit<HTMLAttributes<HTMLButtonElement>, 'onChange' | 'onError'> {\n value?: string;\n disabled?: boolean;\n onChange?: (color: string) => void;\n onError?: (error: string | null) => void;\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n hierarchy?: 'primary' | 'secondary' | 'tertiary';\n}\n\nexport function ColorInput({\n value = '#000',\n onChange,\n onError,\n disabled,\n width = '100%',\n maxWidth,\n minWidth,\n hierarchy = 'secondary',\n ...props\n}: ColorInputProps) {\n const [anchorElement, setAnchorElement] = useState<HTMLButtonElement | null>(null);\n const isOpen = anchorElement != null;\n const pickerRef = useRef<HTMLDivElement | null>(null);\n\n function openPicker(e: React.MouseEvent<HTMLButtonElement>) {\n setAnchorElement(e.currentTarget);\n }\n\n function closePicker() {\n setAnchorElement(null);\n }\n\n useLayoutEffect(() => {\n requestAnimationFrame(() => {\n if (anchorElement != null) {\n pickerRef.current && pickerRef.current.focus();\n }\n });\n }, [anchorElement]);\n\n function processKeyInput(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closePicker();\n }\n }\n\n function updateColor(value: ColorState) {\n const rgb = value.rgb;\n let color = value.hex;\n\n if (rgb.a != null) {\n color = `rgba(${rgb.r},${rgb.g},${rgb.b},${rgb.a})`;\n } else {\n color = `rgb(${rgb.r},${rgb.g},${rgb.b})`;\n }\n\n onChange && onChange(color);\n }\n\n return (\n <>\n <InputGroup\n height=\"auto\"\n width={width}\n minWidth={minWidth}\n maxWidth={maxWidth}\n className=\"tcn-color-input-wrapper\"\n {...props}\n >\n <Input\n width=\"flex\"\n disabled={disabled}\n value={value}\n style={{\n borderEndEndRadius: 0,\n borderStartEndRadius: 0,\n textAlign: 'start',\n paddingInlineEnd: '8px',\n }}\n className=\"tcn-color-input\"\n onChange={onChange}\n />\n\n <Button\n disabled={disabled}\n hierarchy={hierarchy}\n onClick={openPicker}\n width=\"70px\"\n maxWidth=\"70px\"\n className={clsx(\n styles['color-input-select'],\n 'tcn-color-input-select',\n 'tcn-select'\n )}\n style={{\n borderStartStartRadius: 0,\n borderEndStartRadius: 0,\n paddingInlineEnd: 0,\n }}\n >\n <HStack height=\"14px\" gap=\"4px\" hAlign=\"start\">\n <Spacer width=\"4px\" />\n <Box\n width=\"flex\"\n height=\"30px\"\n className={clsx(styles['checker-board'], 'tcn-checker-board')}\n style={{ borderRadius: '2px', overflow: 'hidden' }}\n >\n <Box\n height=\"100%\"\n style={{ backgroundColor: value, borderRadius: '2px' }}\n ></Box>\n </Box>\n <Spacer />\n </HStack>\n <Spacer width=\"4px\" />\n </Button>\n </InputGroup>\n <Popper\n anchorElement={anchorElement}\n onClose={closePicker}\n open={isOpen}\n restoreFocus\n horizontalAnchor=\"end\"\n horizontalOrigin=\"end\"\n >\n <ColorPicker\n color={value}\n onKeyDown={processKeyInput}\n onColorChange={updateColor}\n />\n </Popper>\n </>\n );\n}\n"],"names":["ColorInput","value","onChange","onError","disabled","width","maxWidth","minWidth","hierarchy","props","anchorElement","setAnchorElement","useState","isOpen","pickerRef","useRef","openPicker","e","closePicker","useLayoutEffect","processKeyInput","event","updateColor","rgb","color","jsxs","Fragment","InputGroup","jsx","Input","Button","clsx","styles","HStack","Spacer","Box","Popper","ColorPicker"],"mappings":";;;;;;;;;;;;;;;;;;AA2BO,SAASA,GAAW;AAAA,EACzB,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAoB;AAClB,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAAmC,IAAI,GAC3EC,IAASH,KAAiB,MAC1BI,IAAYC,EAA8B,IAAI;AAEpD,WAASC,EAAWC,GAAwC;AAC1D,IAAAN,EAAiBM,EAAE,aAAa;AAAA,EAClC;AAEA,WAASC,IAAc;AACrB,IAAAP,EAAiB,IAAI;AAAA,EACvB;AAEA,EAAAQ,EAAgB,MAAM;AACpB,0BAAsB,MAAM;AAC1B,MAAIT,KAAiB,QACnBI,EAAU,WAAWA,EAAU,QAAQ,MAAA;AAAA,IAE3C,CAAC;AAAA,EACH,GAAG,CAACJ,CAAa,CAAC;AAElB,WAASU,EAAgBC,GAA4B;AACnD,IAAIA,EAAM,QAAQ,YAChBH,EAAA;AAAA,EAEJ;AAEA,WAASI,EAAYrB,GAAmB;AACtC,UAAMsB,IAAMtB,EAAM;AAClB,QAAIuB,IAAQvB,EAAM;AAElB,IAAIsB,EAAI,KAAK,OACXC,IAAQ,QAAQD,EAAI,CAAC,IAAIA,EAAI,CAAC,IAAIA,EAAI,CAAC,IAAIA,EAAI,CAAC,MAEhDC,IAAQ,OAAOD,EAAI,CAAC,IAAIA,EAAI,CAAC,IAAIA,EAAI,CAAC,KAG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MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"combo_box.d.ts","sourceRoot":"","sources":["../../../src/inputs/combo_box/combo_box.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAS,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAC/E,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,sBAAsB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,QAAQ,wFA8InB,CAAC"}
|
|
@@ -1,93 +1,96 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as D, Fragment as L, jsx as C } 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 N, { useRef as c, useState as f } from "react";
|
|
6
|
+
import { useForkRef as z } from "../../utils/hooks/use_fork_ref.js";
|
|
7
7
|
import "../../utils/hooks/use_resize_observer.js";
|
|
8
8
|
import "../../utils/dnd/context.js";
|
|
9
|
-
import { clsx as
|
|
9
|
+
import { clsx as G } from "clsx";
|
|
10
10
|
import "../../draggable.module-BgelQsuJ.js";
|
|
11
|
-
import { SuggestionList as
|
|
12
|
-
import { Input as
|
|
13
|
-
const
|
|
14
|
-
onOptionSelect:
|
|
15
|
-
children:
|
|
16
|
-
onKeyDown:
|
|
17
|
-
onKeyUp:
|
|
18
|
-
value:
|
|
19
|
-
noOptionMatchedMessage:
|
|
20
|
-
trimCustomInput:
|
|
21
|
-
className:
|
|
22
|
-
onMouseDown:
|
|
23
|
-
onMouseUp:
|
|
11
|
+
import { SuggestionList as H } from "../suggestions/suggestion_list.js";
|
|
12
|
+
import { Input as J } from "../input/input.js";
|
|
13
|
+
const oe = N.forwardRef(function({
|
|
14
|
+
onOptionSelect: m,
|
|
15
|
+
children: O = [],
|
|
16
|
+
onKeyDown: r,
|
|
17
|
+
onKeyUp: p,
|
|
18
|
+
value: o,
|
|
19
|
+
noOptionMatchedMessage: T,
|
|
20
|
+
trimCustomInput: b = !1,
|
|
21
|
+
className: k,
|
|
22
|
+
onMouseDown: g,
|
|
23
|
+
onMouseUp: h,
|
|
24
24
|
...i
|
|
25
|
-
},
|
|
26
|
-
const
|
|
25
|
+
}, A) {
|
|
26
|
+
const E = c(!1), [F, d] = f(o), S = c(o), n = c(!1), [V, y] = f(null), a = c(null), [R, x] = f(!1), I = z(A, a);
|
|
27
27
|
function l() {
|
|
28
|
-
|
|
28
|
+
x(!0);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
n.current = !1,
|
|
30
|
+
function u() {
|
|
31
|
+
n.current = !1, d(""), x(!1);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function M(e, t, w) {
|
|
34
34
|
n.current = !0;
|
|
35
|
-
const
|
|
35
|
+
const s = a.current;
|
|
36
36
|
requestAnimationFrame(() => {
|
|
37
|
-
|
|
38
|
-
}), i.onChange && i.onChange(e),
|
|
37
|
+
s != null && (s.value = e, s.focus(), s.setSelectionRange(t, w));
|
|
38
|
+
}), i.onChange && i.onChange(e), u();
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function j(e) {
|
|
41
41
|
n.current = !0;
|
|
42
|
-
const t =
|
|
43
|
-
t?.focus(),
|
|
42
|
+
const t = a.current;
|
|
43
|
+
t?.focus(), u(), m && m(e);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
if (
|
|
47
|
-
n.current = !1,
|
|
45
|
+
function B(e) {
|
|
46
|
+
if (S.current = e.currentTarget.value, n.current) {
|
|
47
|
+
n.current = !1, r && r(e);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
function B(e) {
|
|
53
|
-
e.key === "Enter" && (h ? r() : (l(), e.preventDefault())), d.current !== e.currentTarget.value && l(), m && m(e);
|
|
50
|
+
r && r(e);
|
|
54
51
|
}
|
|
55
52
|
function U(e) {
|
|
56
|
-
|
|
53
|
+
const t = e.key;
|
|
54
|
+
d(e.currentTarget.value), t === "Enter" && (R ? u() : (l(), e.preventDefault())), S.current !== e.currentTarget.value && l(), p && p(e);
|
|
57
55
|
}
|
|
58
56
|
function _(e) {
|
|
59
|
-
|
|
57
|
+
y(e.currentTarget), E.current = document.activeElement === e.currentTarget, g && g(e);
|
|
58
|
+
}
|
|
59
|
+
function q(e) {
|
|
60
|
+
n.current && (n.current = !1, u()), l(), h && h(e);
|
|
60
61
|
}
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
62
|
+
return /* @__PURE__ */ D(L, { children: [
|
|
63
|
+
/* @__PURE__ */ C(
|
|
64
|
+
J,
|
|
64
65
|
{
|
|
65
|
-
ref:
|
|
66
|
-
className:
|
|
66
|
+
ref: I,
|
|
67
|
+
className: G(k, "tcn-combo-box-input"),
|
|
67
68
|
...i,
|
|
68
|
-
value:
|
|
69
|
-
onKeyDown:
|
|
70
|
-
onKeyUp:
|
|
71
|
-
onMouseDown:
|
|
72
|
-
onMouseUp:
|
|
69
|
+
value: o,
|
|
70
|
+
onKeyDown: B,
|
|
71
|
+
onKeyUp: U,
|
|
72
|
+
onMouseDown: _,
|
|
73
|
+
onMouseUp: q
|
|
73
74
|
}
|
|
74
75
|
),
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
/* @__PURE__ */ C(
|
|
77
|
+
H,
|
|
77
78
|
{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
open: R,
|
|
80
|
+
anchorElement: V,
|
|
81
|
+
onClose: M,
|
|
82
|
+
value: o,
|
|
83
|
+
initialSearchValue: F,
|
|
84
|
+
trimCustomInput: b,
|
|
85
|
+
onOptionSelect: j,
|
|
86
|
+
noSuggestionMessage: T,
|
|
84
87
|
haveValueAsOption: !0,
|
|
85
|
-
children:
|
|
88
|
+
children: O
|
|
86
89
|
}
|
|
87
90
|
)
|
|
88
91
|
] });
|
|
89
92
|
});
|
|
90
93
|
export {
|
|
91
|
-
|
|
94
|
+
oe as ComboBox
|
|
92
95
|
};
|
|
93
96
|
//# sourceMappingURL=combo_box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo_box.js","sources":["../../../src/inputs/combo_box/combo_box.tsx"],"sourcesContent":["import { useForkRef } from '../../utils/index.js';\nimport { clsx } from 'clsx';\nimport React, { useRef, useState } from 'react';\nimport { SuggestionList } from '../suggestions/suggestion_list.js';\nimport { Input, InputProps } from '../input/input.js';\nimport { OptionProps } from '../options/option.js';\n\nexport interface ComboBoxProps extends InputProps {\n children?: React.ReactElement<OptionProps>[] | React.ReactElement<OptionProps>;\n onOptionSelect?: (value: string) => void;\n noOptionMatchedMessage?: React.ReactNode;\n trimCustomInput?: boolean;\n}\n\nexport const ComboBox = React.forwardRef(function ComboBox(\n {\n onOptionSelect: onSuggestionSelect,\n children = [],\n onKeyDown,\n onKeyUp,\n value,\n noOptionMatchedMessage,\n trimCustomInput = false,\n className,\n onMouseDown,\n onMouseUp,\n ...props\n }: ComboBoxProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const isAlreadyFocusedRef = useRef(false);\n const valueRef = useRef(value);\n const isClosingRef = useRef(false);\n const [anchorElement, setAnchorElement] = useState<HTMLInputElement | null>(null);\n const internalInputRef = useRef<HTMLInputElement | null>(null);\n const [isSuggestionsOpen, setIsSuggestionsOpen] = useState(false);\n const forkedRef = useForkRef(ref, internalInputRef);\n\n function openSuggestions() {\n setIsSuggestionsOpen(true);\n }\n\n function closeSuggestions() {\n isClosingRef.current = false;\n setIsSuggestionsOpen(false);\n }\n\n function handleClose(\n value: string,\n selectionStart: number | null,\n selectionEnd: number | null\n ) {\n isClosingRef.current = true;\n const input = internalInputRef.current;\n\n requestAnimationFrame(() => {\n if (input != null) {\n input.value = value;\n input.focus();\n input.setSelectionRange(selectionStart, selectionEnd);\n }\n });\n props.onChange && props.onChange(value);\n closeSuggestions();\n }\n\n function handleSelection(value: string) {\n isClosingRef.current = true;\n const input = internalInputRef.current;\n\n if (input != null) {\n input.focus();\n }\n\n closeSuggestions();\n onSuggestionSelect && onSuggestionSelect(value);\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n valueRef.current = event.currentTarget.value;\n\n if (isClosingRef.current) {\n isClosingRef.current = false;\n onKeyDown && onKeyDown(event);\n return;\n }\n\n onKeyDown && onKeyDown(event);\n }\n\n function handleKeyUp(event: React.KeyboardEvent<HTMLInputElement>) {\n const key = event.key;\n\n if (key === 'Enter') {\n if (isSuggestionsOpen) {\n closeSuggestions();\n } else {\n openSuggestions();\n event.preventDefault();\n }\n }\n\n if (valueRef.current !== event.currentTarget.value) {\n openSuggestions();\n }\n\n onKeyUp && onKeyUp(event);\n }\n\n function handlMouseDown(event: React.MouseEvent<HTMLInputElement>) {\n setAnchorElement(event.currentTarget);\n isAlreadyFocusedRef.current = document.activeElement === event.currentTarget;\n onMouseDown && onMouseDown(event);\n }\n\n function handleMouseUp(event: React.MouseEvent<HTMLInputElement>) {\n if (isClosingRef.current) {\n isClosingRef.current = false;\n closeSuggestions();\n }\n\n openSuggestions();\n onMouseUp && onMouseUp(event);\n }\n\n return (\n <>\n <Input\n ref={forkedRef}\n className={clsx(className, 'tcn-combo-box-input')}\n {...props}\n value={value}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onMouseDown={handlMouseDown}\n onMouseUp={handleMouseUp}\n />\n {isSuggestionsOpen
|
|
1
|
+
{"version":3,"file":"combo_box.js","sources":["../../../src/inputs/combo_box/combo_box.tsx"],"sourcesContent":["import { useForkRef } from '../../utils/index.js';\nimport { clsx } from 'clsx';\nimport React, { useRef, useState } from 'react';\nimport { SuggestionList } from '../suggestions/suggestion_list.js';\nimport { Input, InputProps } from '../input/input.js';\nimport { OptionProps } from '../options/option.js';\n\nexport interface ComboBoxProps extends InputProps {\n children?: React.ReactElement<OptionProps>[] | React.ReactElement<OptionProps>;\n onOptionSelect?: (value: string) => void;\n noOptionMatchedMessage?: React.ReactNode;\n trimCustomInput?: boolean;\n}\n\nexport const ComboBox = React.forwardRef(function ComboBox(\n {\n onOptionSelect: onSuggestionSelect,\n children = [],\n onKeyDown,\n onKeyUp,\n value,\n noOptionMatchedMessage,\n trimCustomInput = false,\n className,\n onMouseDown,\n onMouseUp,\n ...props\n }: ComboBoxProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const isAlreadyFocusedRef = useRef(false);\n const [searchValue, setSearchValue] = useState(value);\n const valueRef = useRef(value);\n const isClosingRef = useRef(false);\n const [anchorElement, setAnchorElement] = useState<HTMLInputElement | null>(null);\n const internalInputRef = useRef<HTMLInputElement | null>(null);\n const [isSuggestionsOpen, setIsSuggestionsOpen] = useState(false);\n const forkedRef = useForkRef(ref, internalInputRef);\n\n function openSuggestions() {\n setIsSuggestionsOpen(true);\n }\n\n function closeSuggestions() {\n isClosingRef.current = false;\n setSearchValue('');\n setIsSuggestionsOpen(false);\n }\n\n function handleClose(\n value: string,\n selectionStart: number | null,\n selectionEnd: number | null\n ) {\n isClosingRef.current = true;\n const input = internalInputRef.current;\n\n requestAnimationFrame(() => {\n if (input != null) {\n input.value = value;\n input.focus();\n input.setSelectionRange(selectionStart, selectionEnd);\n }\n });\n props.onChange && props.onChange(value);\n closeSuggestions();\n }\n\n function handleSelection(value: string) {\n isClosingRef.current = true;\n const input = internalInputRef.current;\n\n if (input != null) {\n input.focus();\n }\n\n closeSuggestions();\n onSuggestionSelect && onSuggestionSelect(value);\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n valueRef.current = event.currentTarget.value;\n\n if (isClosingRef.current) {\n isClosingRef.current = false;\n onKeyDown && onKeyDown(event);\n return;\n }\n\n onKeyDown && onKeyDown(event);\n }\n\n function handleKeyUp(event: React.KeyboardEvent<HTMLInputElement>) {\n const key = event.key;\n\n setSearchValue(event.currentTarget.value);\n\n if (key === 'Enter') {\n if (isSuggestionsOpen) {\n closeSuggestions();\n } else {\n openSuggestions();\n event.preventDefault();\n }\n }\n\n if (valueRef.current !== event.currentTarget.value) {\n openSuggestions();\n }\n\n onKeyUp && onKeyUp(event);\n }\n\n function handlMouseDown(event: React.MouseEvent<HTMLInputElement>) {\n setAnchorElement(event.currentTarget);\n isAlreadyFocusedRef.current = document.activeElement === event.currentTarget;\n onMouseDown && onMouseDown(event);\n }\n\n function handleMouseUp(event: React.MouseEvent<HTMLInputElement>) {\n if (isClosingRef.current) {\n isClosingRef.current = false;\n closeSuggestions();\n }\n\n openSuggestions();\n onMouseUp && onMouseUp(event);\n }\n\n return (\n <>\n <Input\n ref={forkedRef}\n className={clsx(className, 'tcn-combo-box-input')}\n {...props}\n value={value}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onMouseDown={handlMouseDown}\n onMouseUp={handleMouseUp}\n />\n <SuggestionList\n open={isSuggestionsOpen}\n anchorElement={anchorElement}\n onClose={handleClose}\n value={value}\n initialSearchValue={searchValue}\n trimCustomInput={trimCustomInput}\n onOptionSelect={handleSelection}\n noSuggestionMessage={noOptionMatchedMessage}\n haveValueAsOption={true}\n >\n {children}\n </SuggestionList>\n </>\n );\n});\n"],"names":["ComboBox","React","onSuggestionSelect","children","onKeyDown","onKeyUp","value","noOptionMatchedMessage","trimCustomInput","className","onMouseDown","onMouseUp","props","ref","isAlreadyFocusedRef","useRef","searchValue","setSearchValue","useState","valueRef","isClosingRef","anchorElement","setAnchorElement","internalInputRef","isSuggestionsOpen","setIsSuggestionsOpen","forkedRef","useForkRef","openSuggestions","closeSuggestions","handleClose","selectionStart","selectionEnd","input","handleSelection","handleKeyDown","event","handleKeyUp","key","handlMouseDown","handleMouseUp","jsxs","Fragment","jsx","Input","clsx","SuggestionList"],"mappings":";;;;;;;;;;;;AAcO,MAAMA,KAAWC,EAAM,WAAW,SACvC;AAAA,EACE,gBAAgBC;AAAA,EAChB,UAAAC,IAAW,CAAA;AAAA,EACX,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAsBC,EAAO,EAAK,GAClC,CAACC,GAAaC,CAAc,IAAIC,EAASZ,CAAK,GAC9Ca,IAAWJ,EAAOT,CAAK,GACvBc,IAAeL,EAAO,EAAK,GAC3B,CAACM,GAAeC,CAAgB,IAAIJ,EAAkC,IAAI,GAC1EK,IAAmBR,EAAgC,IAAI,GACvD,CAACS,GAAmBC,CAAoB,IAAIP,EAAS,EAAK,GAC1DQ,IAAYC,EAAWd,GAAKU,CAAgB;AAElD,WAASK,IAAkB;AACzB,IAAAH,EAAqB,EAAI;AAAA,EAC3B;AAEA,WAASI,IAAmB;AAC1B,IAAAT,EAAa,UAAU,IACvBH,EAAe,EAAE,GACjBQ,EAAqB,EAAK;AAAA,EAC5B;AAEA,WAASK,EACPxB,GACAyB,GACAC,GACA;AACA,IAAAZ,EAAa,UAAU;AACvB,UAAMa,IAAQV,EAAiB;AAE/B,0BAAsB,MAAM;AAC1B,MAAIU,KAAS,SACXA,EAAM,QAAQ3B,GACd2B,EAAM,MAAA,GACNA,EAAM,kBAAkBF,GAAgBC,CAAY;AAAA,IAExD,CAAC,GACDpB,EAAM,Y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,CAAC;AAEpC,cAAc,qDAAqD,CAAC;AACpE,cAAc,4CAA4C,CAAC;AAE3D,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,oBAAoB,CAAC;AAEnC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,8BAA8B,CAAC"}
|
package/dist/inputs/index.js
CHANGED
|
@@ -3,23 +3,23 @@ import { ColorInput as p } from "./color_input/color_input.js";
|
|
|
3
3
|
import { ColorPicker as a } from "./color_input/color_picker.js";
|
|
4
4
|
import { ComboBox as f } from "./combo_box/combo_box.js";
|
|
5
5
|
import { DatePicker as n } from "./date_picker/date_picker.js";
|
|
6
|
-
import { DatePickerDay as
|
|
6
|
+
import { DatePickerDay as c } from "./date_picker/date_picker_day.js";
|
|
7
7
|
import { DatePickerBody as s } from "./date_picker/date_picker_body.js";
|
|
8
|
-
import { DatePickerDate as
|
|
8
|
+
import { DatePickerDate as k } from "./date_picker/date_picker_date.js";
|
|
9
9
|
import { DatePickerInput as P } from "./date_picker/date_picker_input.js";
|
|
10
10
|
import { DatePickerHeader as D } from "./date_picker/date_picker_header.js";
|
|
11
11
|
import { DatePickerPresenter as M } from "./date_picker/date_picker_presenter.js";
|
|
12
|
-
import { Input as
|
|
12
|
+
import { Input as d } from "./input/input.js";
|
|
13
13
|
import { AlphaCharacter as A } from "./mask_input/alpha_character.js";
|
|
14
14
|
import { AlphaNumericCharacter as B } from "./mask_input/alpha_numeric_character.js";
|
|
15
15
|
import { Character as O } from "./mask_input/character.js";
|
|
16
16
|
import { ConstantCharacter as L } from "./mask_input/constant_character.js";
|
|
17
17
|
import { KeyCaptureInput as v } from "./mask_input/key_capture_input.js";
|
|
18
|
-
import { LanguageCharacter as
|
|
19
|
-
import { Mask as
|
|
20
|
-
import { MaskInput as
|
|
21
|
-
import { MaskPresenter as
|
|
22
|
-
import { NumericCharacter as
|
|
18
|
+
import { LanguageCharacter as G } from "./mask_input/language_character.js";
|
|
19
|
+
import { Mask as K } from "./mask_input/mask.js";
|
|
20
|
+
import { MaskInput as U } from "./mask_input/mask_input.js";
|
|
21
|
+
import { MaskPresenter as q } from "./mask_input/mask_presenter.js";
|
|
22
|
+
import { NumericCharacter as E } from "./mask_input/numeric_character.js";
|
|
23
23
|
import { RegexCharacter as J } from "./mask_input/regex_character.js";
|
|
24
24
|
import { MultiComboBox as W } from "./multi_combo_box/multi_combo_box.js";
|
|
25
25
|
import { Multiselect as Y } from "./multiselect/multiselect.js";
|
|
@@ -27,16 +27,17 @@ import { MultiselectInlineValues as _ } from "./multiselect/multiselect_inline_v
|
|
|
27
27
|
import { MultiselectValues as rr } from "./multiselect/multiselect_values.js";
|
|
28
28
|
import { makeAvailableOptions as or, makeValuesAsOptions as tr } from "./options/utils.js";
|
|
29
29
|
import { Option as mr } from "./options/option.js";
|
|
30
|
-
import { countriesPhoneInformation as xr } from "./phone_number_input/countries_phone_information.js";
|
|
31
|
-
import { PhoneNumberInput as
|
|
30
|
+
import { countriesPhoneInformation as xr, defaultCountries as fr } from "./phone_number_input/countries_phone_information.js";
|
|
31
|
+
import { PhoneNumberInput as nr } from "./phone_number_input/phone_number_input.js";
|
|
32
32
|
import { Radio as cr } from "./radio/radio.js";
|
|
33
|
-
import { Select as
|
|
33
|
+
import { Select as sr } from "./select/select.js";
|
|
34
34
|
import { Slider as kr } from "./slider/slider.js";
|
|
35
|
-
import { SuggestionItem as
|
|
36
|
-
import { SuggestionList as
|
|
37
|
-
import { Switch as
|
|
38
|
-
import { Textarea as
|
|
39
|
-
import { UnitInput as
|
|
35
|
+
import { SuggestionItem as Pr } from "./suggestions/suggestion_item.js";
|
|
36
|
+
import { SuggestionList as Dr } from "./suggestions/suggestion_list.js";
|
|
37
|
+
import { Switch as Mr } from "./switch/switch.js";
|
|
38
|
+
import { Textarea as dr } from "./textarea/textarea.js";
|
|
39
|
+
import { UnitInput as Ar } from "./unit_input/unit_input.js";
|
|
40
|
+
import { InputGroup as Br } from "./input_group/input_group.js";
|
|
40
41
|
export {
|
|
41
42
|
A as AlphaCharacter,
|
|
42
43
|
B as AlphaNumericCharacter,
|
|
@@ -48,34 +49,36 @@ export {
|
|
|
48
49
|
L as ConstantCharacter,
|
|
49
50
|
n as DatePicker,
|
|
50
51
|
s as DatePickerBody,
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
k as DatePickerDate,
|
|
53
|
+
c as DatePickerDay,
|
|
53
54
|
D as DatePickerHeader,
|
|
54
55
|
P as DatePickerInput,
|
|
55
56
|
M as DatePickerPresenter,
|
|
56
|
-
|
|
57
|
+
d as Input,
|
|
58
|
+
Br as InputGroup,
|
|
57
59
|
v as KeyCaptureInput,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
G as LanguageCharacter,
|
|
61
|
+
K as Mask,
|
|
62
|
+
U as MaskInput,
|
|
63
|
+
q as MaskPresenter,
|
|
62
64
|
W as MultiComboBox,
|
|
63
65
|
Y as Multiselect,
|
|
64
66
|
_ as MultiselectInlineValues,
|
|
65
67
|
rr as MultiselectValues,
|
|
66
|
-
|
|
68
|
+
E as NumericCharacter,
|
|
67
69
|
mr as Option,
|
|
68
|
-
|
|
70
|
+
nr as PhoneNumberInput,
|
|
69
71
|
cr as Radio,
|
|
70
72
|
J as RegexCharacter,
|
|
71
|
-
|
|
73
|
+
sr as Select,
|
|
72
74
|
kr as Slider,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
Pr as SuggestionItem,
|
|
76
|
+
Dr as SuggestionList,
|
|
77
|
+
Mr as Switch,
|
|
78
|
+
dr as Textarea,
|
|
79
|
+
Ar as UnitInput,
|
|
78
80
|
xr as countriesPhoneInformation,
|
|
81
|
+
fr as defaultCountries,
|
|
79
82
|
or as makeAvailableOptions,
|
|
80
83
|
tr as makeValuesAsOptions
|
|
81
84
|
};
|
package/dist/inputs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { clsx as
|
|
3
|
-
import
|
|
4
|
-
import '../../input.css';const
|
|
5
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as c } from "clsx";
|
|
3
|
+
import d from "react";
|
|
4
|
+
import '../../input.css';const f = "_input_a16553f", m = { input: f }, y = d.forwardRef(function({ type: n = "text", style: i, className: s, width: r, height: l, onChange: a, ...t }, o) {
|
|
5
|
+
return /* @__PURE__ */ u(
|
|
6
6
|
"input",
|
|
7
7
|
{
|
|
8
|
-
className:
|
|
9
|
-
type:
|
|
10
|
-
ref:
|
|
8
|
+
className: c(m.input, s, "tcn-input", "tcn-control"),
|
|
9
|
+
type: n,
|
|
10
|
+
ref: o,
|
|
11
11
|
"data-is-disabled": t.disabled || !1,
|
|
12
12
|
"aria-disabled": t.disabled || !1,
|
|
13
13
|
onChange: (e) => {
|
|
14
14
|
a && a(e.currentTarget.value, e);
|
|
15
15
|
},
|
|
16
16
|
...t,
|
|
17
|
-
style: { width: r, height: l, ...
|
|
17
|
+
style: { width: r, height: l, ...i }
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sources":["../../../src/inputs/input/input.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { InputHTMLAttributes } from 'react';\nimport styles from './input.module.css';\n\nexport interface InputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n type?: React.HTMLInputTypeAttribute;\n width?: string;\n height?: string;\n value?: string;\n disabled?: boolean;\n min?: string;\n max?: string;\n placeholder?: string;\n onChange?: (value: string, event?: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport const Input = React.forwardRef(function Input(\n { type = 'text', style, className, width, height, onChange, ...props }: InputProps,\n ref: React.Ref<HTMLInputElement>\n) {\n return (\n <input\n className={clsx(styles.input, className, 'tcn-input')}\n type={type}\n ref={ref}\n data-is-disabled={props.disabled || false}\n aria-disabled={props.disabled || false}\n onChange={e => {\n onChange && onChange(e.currentTarget.value, e);\n }}\n {...props}\n style={{ width, height, ...style }}\n />\n );\n});\n"],"names":["Input","React","type","style","className","width","height","onChange","props","ref","jsx","clsx","styles"],"mappings":";;;8CAkBaA,IAAQC,EAAM,WAAW,SACpC,EAAE,MAAAC,IAAO,QAAQ,OAAAC,GAAO,WAAAC,GAAW,OAAAC,GAAO,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAA,GAC/DC,GACA;AACA,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,OAAOR,GAAW,
|
|
1
|
+
{"version":3,"file":"input.js","sources":["../../../src/inputs/input/input.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React from 'react';\nimport { InputHTMLAttributes } from 'react';\nimport styles from './input.module.css';\n\nexport interface InputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n type?: React.HTMLInputTypeAttribute;\n width?: string;\n height?: string;\n value?: string;\n disabled?: boolean;\n min?: string;\n max?: string;\n placeholder?: string;\n onChange?: (value: string, event?: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport const Input = React.forwardRef(function Input(\n { type = 'text', style, className, width, height, onChange, ...props }: InputProps,\n ref: React.Ref<HTMLInputElement>\n) {\n return (\n <input\n className={clsx(styles.input, className, 'tcn-input', 'tcn-control')}\n type={type}\n ref={ref}\n data-is-disabled={props.disabled || false}\n aria-disabled={props.disabled || false}\n onChange={e => {\n onChange && onChange(e.currentTarget.value, e);\n }}\n {...props}\n style={{ width, height, ...style }}\n />\n );\n});\n"],"names":["Input","React","type","style","className","width","height","onChange","props","ref","jsx","clsx","styles"],"mappings":";;;8CAkBaA,IAAQC,EAAM,WAAW,SACpC,EAAE,MAAAC,IAAO,QAAQ,OAAAC,GAAO,WAAAC,GAAW,OAAAC,GAAO,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAA,GAC/DC,GACA;AACA,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,OAAOR,GAAW,aAAa,aAAa;AAAA,MACnE,MAAAF;AAAA,MACA,KAAAO;AAAA,MACA,oBAAkBD,EAAM,YAAY;AAAA,MACpC,iBAAeA,EAAM,YAAY;AAAA,MACjC,UAAU,CAAA,MAAK;AACb,QAAAD,KAAYA,EAAS,EAAE,cAAc,OAAO,CAAC;AAAA,MAC/C;AAAA,MACC,GAAGC;AAAA,MACJ,OAAO,EAAE,OAAAH,GAAO,QAAAC,GAAQ,GAAGH,EAAA;AAAA,IAAM;AAAA,EAAA;AAGvC,CAAC;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { HStackProps } from '../../stacks/h_stack.js';
|
|
3
|
+
export type InputGroupProps = HStackProps;
|
|
4
|
+
export declare const InputGroup: React.ForwardRefExoticComponent<InputGroupProps & React.RefAttributes<HTMLElement>>;
|
|
5
|
+
//# sourceMappingURL=input_group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input_group.d.ts","sourceRoot":"","sources":["../../../src/inputs/input_group/input_group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC;AAE1C,eAAO,MAAM,UAAU,qFAmBtB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import r from "react";
|
|
3
|
+
import { clsx as t } from "clsx";
|
|
4
|
+
import { HStack as c } from "../../stacks/h_stack.js";
|
|
5
|
+
const N = r.forwardRef(
|
|
6
|
+
function({ children: n, as: p = "div", className: e, ...m }, s) {
|
|
7
|
+
const a = r.Children.map(
|
|
8
|
+
n,
|
|
9
|
+
(o) => r.isValidElement(o) ? r.cloneElement(o, {
|
|
10
|
+
...o.props,
|
|
11
|
+
className: t(o.props.className, "tcn-input-group-slot")
|
|
12
|
+
}) : o
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ u(c, { ref: s, as: p, className: t(e, "tcn-input-group"), ...m, children: a });
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
export {
|
|
18
|
+
N as InputGroup
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=input_group.js.map
|