@tcn/ui 0.10.0 → 0.11.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/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 +120 -111
- 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 +87 -23
- 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/stacks/box/bottom_resize_handle.d.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +2 -2
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +32 -32
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.d.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/h_collapsible_box.js +18 -18
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/v_collapsible_box.js +18 -18
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/suggestion_list.css +1 -1
- package/dist/surfaces/window/window.d.ts +1 -1
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +20 -10
- 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 +183 -18
- 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/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.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 +24 -3
- 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 +123 -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 +6 -1
- package/src/stacks/box/box.tsx +12 -2
- package/src/stacks/box/end_resize_handle.tsx +6 -1
- package/src/stacks/box/left_resize_handle.tsx +6 -1
- package/src/stacks/box/resize_handlers.ts +20 -8
- package/src/stacks/box/right_resize_handle.tsx +6 -1
- package/src/stacks/box/start_resize_handle.tsx +7 -2
- package/src/stacks/box/top_resize_handle.tsx +7 -2
- package/src/stacks/h_collapsible_box.tsx +2 -2
- package/src/stacks/v_collapsible_box.tsx +2 -2
- package/src/surfaces/window/window.tsx +14 -4
- 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 +183 -18
- 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,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":"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"}
|
package/dist/inputs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAEhD,cAAc,sCAAsC,CAAC;AAErD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AAEpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AAEjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAEhD,cAAc,sCAAsC,CAAC;AAErD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AAEpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input_group.js","sources":["../../../src/inputs/input_group/input_group.tsx"],"sourcesContent":["import React from 'react';\nimport { clsx } from 'clsx';\nimport { HStack, type HStackProps } from '../../stacks/h_stack.js';\n\nexport type InputGroupProps = HStackProps;\n\nexport const InputGroup = React.forwardRef<HTMLElement, InputGroupProps>(\n function InputGroup(\n { children, as = 'div', className, ...props }: InputGroupProps,\n ref\n ) {\n const clonedChildren = React.Children.map(children, child =>\n React.isValidElement(child)\n ? React.cloneElement(child, {\n ...child.props,\n className: clsx(child.props.className, 'tcn-input-group-slot'),\n })\n : child\n );\n return (\n <HStack ref={ref} as={as} className={clsx(className, 'tcn-input-group')} {...props}>\n {clonedChildren}\n </HStack>\n );\n }\n);\n"],"names":["InputGroup","React","children","as","className","props","ref","clonedChildren","child","clsx","jsx","HStack"],"mappings":";;;;AAMO,MAAMA,IAAaC,EAAM;AAAA,EAC9B,SACE,EAAE,UAAAC,GAAU,IAAAC,IAAK,OAAO,WAAAC,GAAW,GAAGC,EAAA,GACtCC,GACA;AACA,UAAMC,IAAiBN,EAAM,SAAS;AAAA,MAAIC;AAAA,MAAU,OAClDD,EAAM,eAAeO,CAAK,IACtBP,EAAM,aAAaO,GAAO;AAAA,QACxB,GAAGA,EAAM;AAAA,QACT,WAAWC,EAAKD,EAAM,MAAM,WAAW,sBAAsB;AAAA,MAAA,CAC9D,IACDA;AAAA,IAAA;AAEN,WACE,gBAAAE,EAACC,GAAA,EAAO,KAAAL,GAAU,IAAAH,GAAQ,WAAWM,EAAKL,GAAW,iBAAiB,GAAI,GAAGC,GAC1E,UAAAE,EAAA,CACH;AAAA,EAEJ;AACF;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CountryCode } from 'libphonenumber-js';
|
|
2
2
|
export interface CountryPhoneInformation {
|
|
3
3
|
name: string;
|
|
4
4
|
code: string;
|
|
5
5
|
prefix: string;
|
|
6
|
-
masks: MaskConfig[];
|
|
7
6
|
unicodeFlag: string;
|
|
8
7
|
keywords: string[];
|
|
9
8
|
}
|
|
10
9
|
export declare const countriesPhoneInformation: CountryPhoneInformation[];
|
|
10
|
+
export declare const defaultCountries: CountryCode[];
|
|
11
11
|
//# sourceMappingURL=countries_phone_information.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"countries_phone_information.d.ts","sourceRoot":"","sources":["../../../src/inputs/phone_number_input/countries_phone_information.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"countries_phone_information.d.ts","sourceRoot":"","sources":["../../../src/inputs/phone_number_input/countries_phone_information.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,yBAAyB,EAAE,uBAAuB,EAoe9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,WAAW,EAEzC,CAAC"}
|