@tedi-design-system/react 19.1.2-rc.3 → 19.2.0-rc.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/bundle-stats.html +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.cjs.js +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.d.ts +6 -0
- package/src/tedi/components/form/multi-value-field/multi-value-field.es.js +126 -117
- package/src/tedi/components/form/multi-value-field/multi-value-field.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.module.scss.es.js +2 -0
- package/src/tedi/components/form/select/components/select-clear-indicator.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-clear-indicator.es.js +21 -10
- package/src/tedi/components/form/select/select.cjs.js +1 -1
- package/src/tedi/components/form/select/select.d.ts +6 -0
- package/src/tedi/components/form/select/select.es.js +173 -171
- package/src/tedi/components/form/select/select.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/select/select.module.scss.es.js +2 -1
- package/src/tedi/components/form/textarea/textarea.d.ts +1 -1
- package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.d.ts +6 -0
- package/src/tedi/components/form/textfield/textfield.es.js +86 -84
- package/src/tedi/components/form/textfield/textfield.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.module.scss.es.js +2 -0
- package/src/tedi/components/navigation/breadcrumbs/breadcrumbs.cjs.js +1 -1
- package/src/tedi/components/navigation/breadcrumbs/breadcrumbs.es.js +19 -10
- package/src/tedi/components/navigation/breadcrumbs/breadcrumbs.module.scss.cjs.js +1 -1
- package/src/tedi/components/navigation/breadcrumbs/breadcrumbs.module.scss.es.js +2 -1
- package/src/tedi/components/overlays/dropdown/dropdown-context.d.ts +8 -0
- package/src/tedi/components/overlays/dropdown/dropdown-item/dropdown-item.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown-item/dropdown-item.es.js +46 -46
- package/src/tedi/components/overlays/dropdown/dropdown-trigger/dropdown-trigger.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown-trigger/dropdown-trigger.es.js +7 -6
- package/src/tedi/components/overlays/dropdown/dropdown.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.d.ts +8 -0
- package/src/tedi/components/overlays/dropdown/dropdown.es.js +95 -87
|
@@ -1,109 +1,110 @@
|
|
|
1
|
-
import { jsx as L, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import r, { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { FeedbackText as
|
|
7
|
-
import { FormLabel as
|
|
8
|
-
import { useOptionalInputGroup as
|
|
9
|
-
import
|
|
10
|
-
import { SELECT_ALL_VALUE as M, GROUP_OPTION_PREFIX as
|
|
11
|
-
import { SelectClearIndicator as
|
|
12
|
-
import { SelectControl as
|
|
1
|
+
import { jsx as L, jsxs as Q } from "react/jsx-runtime";
|
|
2
|
+
import Y from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import r, { forwardRef as lt } from "react";
|
|
4
|
+
import st from "../../../../../external/react-select/dist/react-select.esm.es.js";
|
|
5
|
+
import rt from "../../../../../external/react-select/async/dist/react-select-async.esm.es.js";
|
|
6
|
+
import { FeedbackText as at } from "../feedback-text/feedback-text.es.js";
|
|
7
|
+
import { FormLabel as it } from "../form-label/form-label.es.js";
|
|
8
|
+
import { useOptionalInputGroup as ct } from "../input-group/input-group.es.js";
|
|
9
|
+
import ut from "../input-group/input-group.module.scss.es.js";
|
|
10
|
+
import { SELECT_ALL_VALUE as M, GROUP_OPTION_PREFIX as dt, areAllSelected as Z, getEnabledOptions as ee, isGroupSentinel as te } from "./components/select-bulk-helpers.es.js";
|
|
11
|
+
import { SelectClearIndicator as pt } from "./components/select-clear-indicator.es.js";
|
|
12
|
+
import { SelectControl as ft } from "./components/select-control.es.js";
|
|
13
13
|
import { SelectDropDownIndicator as mt } from "./components/select-dropdown-indicator.es.js";
|
|
14
|
-
import { SelectGroup as
|
|
15
|
-
import { SelectGroupHeading as
|
|
16
|
-
import { SelectIndicatorsContainer as
|
|
17
|
-
import { SelectInput as
|
|
18
|
-
import { SelectLoadingIndicator as
|
|
19
|
-
import { SelectMenu as
|
|
20
|
-
import { SelectMenuList as
|
|
21
|
-
import { SelectMenuPortal as
|
|
22
|
-
import { SelectMultiValue as
|
|
23
|
-
import { SelectMultiValueRemove as
|
|
24
|
-
import { SelectOption as
|
|
25
|
-
import { SelectSingleValue as
|
|
26
|
-
import { SelectValueContainer as
|
|
14
|
+
import { SelectGroup as gt } from "./components/select-group.es.js";
|
|
15
|
+
import { SelectGroupHeading as St } from "./components/select-group-heading.es.js";
|
|
16
|
+
import { SelectIndicatorsContainer as bt } from "./components/select-indicators-container.es.js";
|
|
17
|
+
import { SelectInput as yt } from "./components/select-input.es.js";
|
|
18
|
+
import { SelectLoadingIndicator as Mt } from "./components/select-loading-indicator.es.js";
|
|
19
|
+
import { SelectMenu as vt } from "./components/select-menu.es.js";
|
|
20
|
+
import { SelectMenuList as ht } from "./components/select-menu-list.es.js";
|
|
21
|
+
import { SelectMenuPortal as It } from "./components/select-menu-portal.es.js";
|
|
22
|
+
import { SelectMultiValue as Ot } from "./components/select-multi-value.es.js";
|
|
23
|
+
import { SelectMultiValueRemove as Ct } from "./components/select-multi-value-remove.es.js";
|
|
24
|
+
import { SelectOption as wt } from "./components/select-option.es.js";
|
|
25
|
+
import { SelectSingleValue as Lt } from "./components/select-single-value.es.js";
|
|
26
|
+
import { SelectValueContainer as Vt } from "./components/select-value-container.es.js";
|
|
27
27
|
import d from "./select.module.scss.es.js";
|
|
28
|
-
import { useLabels as
|
|
29
|
-
const
|
|
30
|
-
(D,
|
|
31
|
-
var
|
|
28
|
+
import { useLabels as At } from "../../../providers/label-provider/use-labels.es.js";
|
|
29
|
+
const _t = lt(
|
|
30
|
+
(D, oe) => {
|
|
31
|
+
var J;
|
|
32
32
|
const {
|
|
33
33
|
options: c,
|
|
34
|
-
defaultOptions:
|
|
35
|
-
name:
|
|
36
|
-
iconName:
|
|
37
|
-
label:
|
|
34
|
+
defaultOptions: ne,
|
|
35
|
+
name: le,
|
|
36
|
+
iconName: se = "arrow_drop_down",
|
|
37
|
+
label: re,
|
|
38
38
|
required: N,
|
|
39
39
|
value: P,
|
|
40
40
|
defaultValue: T,
|
|
41
41
|
tagsDirection: V = "stack",
|
|
42
42
|
onChange: A,
|
|
43
|
-
onInputChange:
|
|
44
|
-
inputValue:
|
|
45
|
-
loadOptions:
|
|
46
|
-
isLoading:
|
|
47
|
-
openMenuOnFocus:
|
|
48
|
-
openMenuOnClick:
|
|
49
|
-
tabSelectsValue:
|
|
43
|
+
onInputChange: ae,
|
|
44
|
+
inputValue: ie,
|
|
45
|
+
loadOptions: ce,
|
|
46
|
+
isLoading: ue,
|
|
47
|
+
openMenuOnFocus: de = !1,
|
|
48
|
+
openMenuOnClick: pe = !0,
|
|
49
|
+
tabSelectsValue: fe = !1,
|
|
50
50
|
disabled: F = !1,
|
|
51
51
|
className: me,
|
|
52
|
-
hideLabel:
|
|
52
|
+
hideLabel: ge = !1,
|
|
53
53
|
helper: a,
|
|
54
|
-
placeholder:
|
|
55
|
-
invalid:
|
|
56
|
-
valid:
|
|
54
|
+
placeholder: Se,
|
|
55
|
+
invalid: be,
|
|
56
|
+
valid: ye,
|
|
57
57
|
size: _,
|
|
58
|
-
async:
|
|
59
|
-
renderOption:
|
|
58
|
+
async: Me = !1,
|
|
59
|
+
renderOption: ve,
|
|
60
60
|
renderMessageListFooter: $,
|
|
61
|
-
noOptionsMessage:
|
|
62
|
-
loadingMessage:
|
|
61
|
+
noOptionsMessage: he,
|
|
62
|
+
loadingMessage: Ie,
|
|
63
63
|
multiple: v = !1,
|
|
64
64
|
showSelectAll: x = !1,
|
|
65
65
|
selectableGroups: E = !1,
|
|
66
|
-
dropdownType:
|
|
67
|
-
renderValue:
|
|
68
|
-
closeMenuOnSelect:
|
|
66
|
+
dropdownType: Oe = "menu",
|
|
67
|
+
renderValue: Ce,
|
|
68
|
+
closeMenuOnSelect: we = !v,
|
|
69
69
|
blurInputOnSelect: G = !1,
|
|
70
|
-
autoFocus:
|
|
71
|
-
isClearable:
|
|
72
|
-
isClearIndicatorVisible:
|
|
70
|
+
autoFocus: Le = !1,
|
|
71
|
+
isClearable: Ve = !0,
|
|
72
|
+
isClearIndicatorVisible: H = !1,
|
|
73
|
+
showClearOnInteraction: Ae = !1,
|
|
73
74
|
isSearchable: O = !0,
|
|
74
|
-
openKeyboardOnTouch:
|
|
75
|
-
menuIsOpen:
|
|
76
|
-
onMenuClose:
|
|
77
|
-
onMenuOpen:
|
|
75
|
+
openKeyboardOnTouch: K = !0,
|
|
76
|
+
menuIsOpen: _e,
|
|
77
|
+
onMenuClose: ke,
|
|
78
|
+
onMenuOpen: Re,
|
|
78
79
|
onBlur: k,
|
|
79
|
-
inputIsHidden:
|
|
80
|
-
isTagRemovable:
|
|
81
|
-
tagsEllipsis:
|
|
82
|
-
backspaceRemovesValue:
|
|
83
|
-
optionGroupHeadingText:
|
|
84
|
-
cacheOptions:
|
|
85
|
-
showRadioButtons:
|
|
86
|
-
renderWithoutLabel:
|
|
87
|
-
tooltip:
|
|
88
|
-
classNames:
|
|
89
|
-
} = D, u = (
|
|
80
|
+
inputIsHidden: De,
|
|
81
|
+
isTagRemovable: Ne = !1,
|
|
82
|
+
tagsEllipsis: Pe = !1,
|
|
83
|
+
backspaceRemovesValue: Te = !1,
|
|
84
|
+
optionGroupHeadingText: Fe = { modifiers: "small", color: "tertiary" },
|
|
85
|
+
cacheOptions: $e = !0,
|
|
86
|
+
showRadioButtons: xe = !1,
|
|
87
|
+
renderWithoutLabel: Ee,
|
|
88
|
+
tooltip: Ge,
|
|
89
|
+
classNames: j
|
|
90
|
+
} = D, u = (J = ct) == null ? void 0 : J(), He = r.useId(), R = u == null ? void 0 : u.hasExternalLabel, m = D.id ?? (u == null ? void 0 : u.inputId) ?? He, Ke = R ? (u == null ? void 0 : u.inputId) ?? m : `${m}-input`, je = R ? `${m}-container` : m, U = a ? (a == null ? void 0 : a.id) ?? `${m}-helper` : void 0, h = r.useRef(null), { getLabel: C } = At();
|
|
90
91
|
r.useImperativeHandle(
|
|
91
|
-
|
|
92
|
+
oe,
|
|
92
93
|
() => h.current
|
|
93
94
|
);
|
|
94
|
-
const [
|
|
95
|
+
const [Ue, B] = r.useState(!1), Be = (t) => {
|
|
95
96
|
var e, o;
|
|
96
|
-
if (
|
|
97
|
+
if (K || !O || t.pointerType !== "touch" && t.pointerType !== "pen") return;
|
|
97
98
|
const l = t.target;
|
|
98
99
|
if (!((e = l.closest) != null && e.call(l, `.${d["tedi-select__control"]}`))) return;
|
|
99
100
|
const n = (o = h.current) == null ? void 0 : o.inputRef, i = !!n && (t.target === n || n.contains(l));
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
}, S = !!x && v, [
|
|
101
|
+
B(!i);
|
|
102
|
+
}, ze = () => {
|
|
103
|
+
B(!1), k == null || k();
|
|
104
|
+
}, S = !!x && v, [qe, We] = r.useState(T ?? null), z = P !== void 0, g = z ? P : qe, p = r.useMemo(() => Array.isArray(g) ? g : g ? [g] : [], [g]), w = r.useMemo(
|
|
104
105
|
() => ({ value: M, label: C("select.select-all") }),
|
|
105
106
|
[C]
|
|
106
|
-
), b = !!E && !!v, { groupFlattenedOptions:
|
|
107
|
+
), b = !!E && !!v, { groupFlattenedOptions: q, groupSentinelMap: I } = r.useMemo(() => {
|
|
107
108
|
const t = /* @__PURE__ */ new Map();
|
|
108
109
|
if (!b || !c || c.length === 0)
|
|
109
110
|
return { groupFlattenedOptions: null, groupSentinelMap: t };
|
|
@@ -111,8 +112,8 @@ const At = nt(
|
|
|
111
112
|
const n = [], i = /* @__PURE__ */ new Map();
|
|
112
113
|
for (const e of c)
|
|
113
114
|
if (e && Array.isArray(e.options)) {
|
|
114
|
-
const o = e, s = `${
|
|
115
|
-
i.set(s, { enabled:
|
|
115
|
+
const o = e, s = `${dt}${o.label ?? ""}`, f = o.options.filter((y) => !y.isDisabled);
|
|
116
|
+
i.set(s, { enabled: f }), n.push({ value: s, label: o.label ?? "" });
|
|
116
117
|
for (const y of o.options)
|
|
117
118
|
n.push({
|
|
118
119
|
...y,
|
|
@@ -121,17 +122,17 @@ const At = nt(
|
|
|
121
122
|
} else
|
|
122
123
|
n.push(e);
|
|
123
124
|
return { groupFlattenedOptions: n, groupSentinelMap: i };
|
|
124
|
-
}, [c, b]),
|
|
125
|
-
let t =
|
|
125
|
+
}, [c, b]), Xe = r.useMemo(() => {
|
|
126
|
+
let t = q ?? c;
|
|
126
127
|
return S && t && t.length > 0 && (t = [w, ...t]), t;
|
|
127
|
-
}, [c,
|
|
128
|
+
}, [c, q, S, w]), Je = r.useMemo(() => {
|
|
128
129
|
const t = [];
|
|
129
130
|
if (b && I.size > 0)
|
|
130
131
|
for (const [l, n] of I)
|
|
131
|
-
n.enabled.length > 0 &&
|
|
132
|
+
n.enabled.length > 0 && Z(p, n.enabled) && t.push({ value: l, label: "" });
|
|
132
133
|
if (S) {
|
|
133
|
-
const l =
|
|
134
|
-
l.length > 0 &&
|
|
134
|
+
const l = ee(c ?? []);
|
|
135
|
+
l.length > 0 && Z(p, l) && t.push(w);
|
|
135
136
|
}
|
|
136
137
|
return t.length === 0 ? g : [...p, ...t];
|
|
137
138
|
}, [
|
|
@@ -142,7 +143,7 @@ const At = nt(
|
|
|
142
143
|
I,
|
|
143
144
|
S,
|
|
144
145
|
w
|
|
145
|
-
]),
|
|
146
|
+
]), Qe = (t, l) => {
|
|
146
147
|
let n = t;
|
|
147
148
|
const i = l.option;
|
|
148
149
|
if (b && i && I.has(i.value)) {
|
|
@@ -150,114 +151,114 @@ const At = nt(
|
|
|
150
151
|
if (l.action === "select-option") {
|
|
151
152
|
const o = [...p];
|
|
152
153
|
for (const s of e)
|
|
153
|
-
o.some((
|
|
154
|
+
o.some((f) => f.value === s.value) || o.push(s);
|
|
154
155
|
n = o;
|
|
155
156
|
} else l.action === "deselect-option" && (n = p.filter((o) => !e.some((s) => s.value === o.value)));
|
|
156
157
|
} else if (S) {
|
|
157
|
-
const e =
|
|
158
|
+
const e = ee(c ?? []), o = (i == null ? void 0 : i.value) === M;
|
|
158
159
|
o && l.action === "select-option" ? n = [...p.filter(
|
|
159
|
-
(
|
|
160
|
+
(f) => f.value !== M && !e.some((y) => y.value === f.value)
|
|
160
161
|
), ...e] : o && l.action === "deselect-option" && (n = p.filter(
|
|
161
|
-
(s) => s.value !== M && !e.some((
|
|
162
|
+
(s) => s.value !== M && !e.some((f) => f.value === s.value)
|
|
162
163
|
));
|
|
163
164
|
}
|
|
164
|
-
Array.isArray(n) && (n = n.filter((e) => e.value !== M && !
|
|
165
|
+
Array.isArray(n) && (n = n.filter((e) => e.value !== M && !te(e))), z || We(n), A == null || A(n), !G && h.current && setTimeout(() => {
|
|
165
166
|
var e, o;
|
|
166
167
|
return (o = (e = h.current) == null ? void 0 : e.inputRef) == null ? void 0 : o.focus();
|
|
167
168
|
}, 0);
|
|
168
|
-
},
|
|
169
|
-
(t, l) => t.data.value === M ||
|
|
169
|
+
}, Ye = r.useCallback(
|
|
170
|
+
(t, l) => t.data.value === M || te(t.data) || !l ? !0 : String(t.label).toLowerCase().includes(l.toLowerCase()),
|
|
170
171
|
[]
|
|
171
|
-
), [
|
|
172
|
-
(t.key === "ArrowUp" || t.key === "ArrowDown" || t.key === "Home" || t.key === "End" || t.key === "PageUp" || t.key === "PageDown" || t.key === "Tab") && (
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
}, []),
|
|
176
|
-
(t) => /* @__PURE__ */ L(
|
|
172
|
+
), [W, X] = r.useState(!1), Ze = (t) => {
|
|
173
|
+
(t.key === "ArrowUp" || t.key === "ArrowDown" || t.key === "Home" || t.key === "End" || t.key === "PageUp" || t.key === "PageDown" || t.key === "Tab") && (W || X(!0));
|
|
174
|
+
}, et = r.useCallback(() => {
|
|
175
|
+
X((t) => t && !1);
|
|
176
|
+
}, []), tt = r.useCallback(
|
|
177
|
+
(t) => /* @__PURE__ */ L(ht, { ...t, renderMessageListFooter: $ }),
|
|
177
178
|
[$]
|
|
178
|
-
),
|
|
179
|
-
|
|
179
|
+
), ot = () => /* @__PURE__ */ L(
|
|
180
|
+
Me ? rt : st,
|
|
180
181
|
{
|
|
181
182
|
tagsDirection: V,
|
|
182
183
|
showSelectAll: x,
|
|
183
184
|
selectableGroups: E,
|
|
184
|
-
dropdownType:
|
|
185
|
-
renderValue:
|
|
186
|
-
keyboardMode:
|
|
187
|
-
exitKeyboardMode:
|
|
188
|
-
onKeyDown:
|
|
189
|
-
id:
|
|
190
|
-
"aria-describedby":
|
|
191
|
-
autoFocus:
|
|
185
|
+
dropdownType: Oe,
|
|
186
|
+
renderValue: Ce,
|
|
187
|
+
keyboardMode: W,
|
|
188
|
+
exitKeyboardMode: et,
|
|
189
|
+
onKeyDown: Ze,
|
|
190
|
+
id: je,
|
|
191
|
+
"aria-describedby": U,
|
|
192
|
+
autoFocus: Le,
|
|
192
193
|
ref: h,
|
|
193
|
-
instanceId:
|
|
194
|
+
instanceId: m,
|
|
194
195
|
className: "tedi-select__wrapper",
|
|
195
|
-
name:
|
|
196
|
-
options:
|
|
197
|
-
defaultOptions:
|
|
198
|
-
value:
|
|
196
|
+
name: le,
|
|
197
|
+
options: Xe,
|
|
198
|
+
defaultOptions: ne,
|
|
199
|
+
value: Je,
|
|
199
200
|
defaultValue: T,
|
|
200
|
-
cacheOptions:
|
|
201
|
-
onChange:
|
|
202
|
-
filterOption: S || b ?
|
|
203
|
-
onInputChange:
|
|
204
|
-
onBlur:
|
|
205
|
-
softKeyboardSuppressed: !
|
|
206
|
-
inputValue:
|
|
207
|
-
inputId:
|
|
208
|
-
loadOptions:
|
|
209
|
-
isLoading:
|
|
210
|
-
noOptionsMessage:
|
|
211
|
-
loadingMessage:
|
|
201
|
+
cacheOptions: $e,
|
|
202
|
+
onChange: Qe,
|
|
203
|
+
filterOption: S || b ? Ye : void 0,
|
|
204
|
+
onInputChange: ae,
|
|
205
|
+
onBlur: ze,
|
|
206
|
+
softKeyboardSuppressed: !K && O && Ue,
|
|
207
|
+
inputValue: ie,
|
|
208
|
+
inputId: Ke,
|
|
209
|
+
loadOptions: ce,
|
|
210
|
+
isLoading: ue,
|
|
211
|
+
noOptionsMessage: he || (() => C("select.no-options")),
|
|
212
|
+
loadingMessage: Ie || (() => C("select.loading")),
|
|
212
213
|
classNamePrefix: "select",
|
|
213
214
|
components: {
|
|
214
|
-
ClearIndicator: (e) =>
|
|
215
|
-
DropdownIndicator: () => mt({ iconName:
|
|
215
|
+
ClearIndicator: (e) => pt({ isClearIndicatorVisible: H, ...e }),
|
|
216
|
+
DropdownIndicator: () => mt({ iconName: se }),
|
|
216
217
|
IndicatorSeparator: () => null,
|
|
217
|
-
MenuPortal:
|
|
218
|
-
Menu:
|
|
219
|
-
MenuList:
|
|
220
|
-
Option: (e) =>
|
|
221
|
-
Control:
|
|
222
|
-
Input:
|
|
223
|
-
MultiValue: (e) =>
|
|
224
|
-
MultiValueRemove:
|
|
225
|
-
SingleValue:
|
|
226
|
-
Group:
|
|
227
|
-
GroupHeading: (e) =>
|
|
228
|
-
IndicatorsContainer:
|
|
229
|
-
ValueContainer:
|
|
230
|
-
LoadingIndicator:
|
|
218
|
+
MenuPortal: It,
|
|
219
|
+
Menu: vt,
|
|
220
|
+
MenuList: tt,
|
|
221
|
+
Option: (e) => wt({ renderOption: ve, multiple: v, showRadioButtons: xe, ...e }),
|
|
222
|
+
Control: ft,
|
|
223
|
+
Input: yt,
|
|
224
|
+
MultiValue: (e) => Ot({ isTagRemovable: Ne, tagsEllipsis: Pe, ...e }),
|
|
225
|
+
MultiValueRemove: Ct,
|
|
226
|
+
SingleValue: Lt,
|
|
227
|
+
Group: gt,
|
|
228
|
+
GroupHeading: (e) => St({ optionGroupHeadingText: Fe, ...e }),
|
|
229
|
+
IndicatorsContainer: bt,
|
|
230
|
+
ValueContainer: Vt,
|
|
231
|
+
LoadingIndicator: Mt
|
|
231
232
|
},
|
|
232
233
|
isDisabled: F,
|
|
233
234
|
isSearchable: O,
|
|
234
|
-
menuIsOpen:
|
|
235
|
-
openMenuOnFocus:
|
|
236
|
-
openMenuOnClick:
|
|
237
|
-
tabSelectsValue:
|
|
238
|
-
onMenuClose:
|
|
239
|
-
onMenuOpen:
|
|
240
|
-
placeholder:
|
|
241
|
-
isClearable:
|
|
242
|
-
backspaceRemovesValue:
|
|
235
|
+
menuIsOpen: _e,
|
|
236
|
+
openMenuOnFocus: de,
|
|
237
|
+
openMenuOnClick: pe,
|
|
238
|
+
tabSelectsValue: fe,
|
|
239
|
+
onMenuClose: ke,
|
|
240
|
+
onMenuOpen: Re,
|
|
241
|
+
placeholder: Se || "",
|
|
242
|
+
isClearable: Ve,
|
|
243
|
+
backspaceRemovesValue: Te,
|
|
243
244
|
menuShouldScrollIntoView: !0,
|
|
244
245
|
isMulti: v,
|
|
245
246
|
hideSelectedOptions: !1,
|
|
246
|
-
closeMenuOnSelect:
|
|
247
|
+
closeMenuOnSelect: we,
|
|
247
248
|
blurInputOnSelect: G,
|
|
248
249
|
menuPlacement: "auto",
|
|
249
|
-
inputIsHidden:
|
|
250
|
+
inputIsHidden: De,
|
|
250
251
|
required: N,
|
|
251
252
|
menuPortalTarget: document.body,
|
|
252
253
|
menuPosition: "absolute",
|
|
253
254
|
classNames: (() => {
|
|
254
255
|
const e = {};
|
|
255
|
-
if (
|
|
256
|
-
for (const [o, s] of Object.entries(
|
|
256
|
+
if (j)
|
|
257
|
+
for (const [o, s] of Object.entries(j))
|
|
257
258
|
e[o] = typeof s == "string" ? () => s : s;
|
|
258
259
|
if (u) {
|
|
259
260
|
const o = e.control;
|
|
260
|
-
e.control = (s) =>
|
|
261
|
+
e.control = (s) => Y(o == null ? void 0 : o(s), ut["tedi-input-group__input"]);
|
|
261
262
|
}
|
|
262
263
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
263
264
|
})(),
|
|
@@ -277,37 +278,38 @@ const At = nt(
|
|
|
277
278
|
})
|
|
278
279
|
}
|
|
279
280
|
}
|
|
280
|
-
),
|
|
281
|
+
), nt = Y(
|
|
281
282
|
d["tedi-select"],
|
|
282
283
|
me,
|
|
283
|
-
{ [d["tedi-select--invalid"]]:
|
|
284
|
-
{ [d["tedi-select--valid"]]:
|
|
284
|
+
{ [d["tedi-select--invalid"]]: be || (a == null ? void 0 : a.type) === "error" },
|
|
285
|
+
{ [d["tedi-select--valid"]]: ye || (a == null ? void 0 : a.type) === "valid" },
|
|
285
286
|
{ [d[`tedi-select--${_}`]]: _ },
|
|
286
287
|
{ [d[`tedi-select--tags-${V}`]]: V },
|
|
287
288
|
{ [d["tedi-select--searchable"]]: O },
|
|
289
|
+
{ [d["tedi-select--clear-on-interaction"]]: H && Ae },
|
|
288
290
|
{ [d["tedi-select--disabled"]]: F }
|
|
289
291
|
);
|
|
290
|
-
return /* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ Q("div", { "data-name": "select", className: nt, onPointerDownCapture: Be, children: [
|
|
293
|
+
/* @__PURE__ */ Q("div", { className: d["tedi-select__inner"], children: [
|
|
292
294
|
!R && /* @__PURE__ */ L(
|
|
293
|
-
|
|
295
|
+
it,
|
|
294
296
|
{
|
|
295
|
-
id: `${
|
|
296
|
-
label:
|
|
297
|
+
id: `${m}-input`,
|
|
298
|
+
label: re,
|
|
297
299
|
required: N,
|
|
298
|
-
hideLabel:
|
|
300
|
+
hideLabel: ge,
|
|
299
301
|
size: _,
|
|
300
|
-
renderWithoutLabel:
|
|
301
|
-
tooltip:
|
|
302
|
+
renderWithoutLabel: Ee,
|
|
303
|
+
tooltip: Ge
|
|
302
304
|
}
|
|
303
305
|
),
|
|
304
|
-
|
|
306
|
+
ot()
|
|
305
307
|
] }),
|
|
306
|
-
a && /* @__PURE__ */ L(
|
|
308
|
+
a && /* @__PURE__ */ L(at, { ...a, id: U })
|
|
307
309
|
] });
|
|
308
310
|
}
|
|
309
311
|
);
|
|
310
|
-
|
|
312
|
+
_t.displayName = "Select";
|
|
311
313
|
export {
|
|
312
|
-
|
|
314
|
+
_t as Select
|
|
313
315
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-select__control":"tedi-select__control-dbce8bb7","tedi-select__value-container":"tedi-select__value-container-253d079a","tedi-select__indicators-container":"tedi-select__indicators-container-0fc8fa2a","tedi-select__input":"tedi-select__input-5525b622","tedi-select":"tedi-select-8b014852","tedi-select--disabled":"tedi-select--disabled-2d4b8ddd","tedi-select--invalid":"tedi-select--invalid-3901c89c","tedi-select--valid":"tedi-select--valid-969c0297","tedi-select__control--focused":"tedi-select__control--focused-0e632efe","tedi-select__arrow":"tedi-select__arrow-94b5ef4a","tedi-select__loading-indicator":"tedi-select__loading-indicator-a35a63ca","tedi-select__dropdown-indicator":"tedi-select__dropdown-indicator-5a948baa","tedi-select__clear-indicator":"tedi-select__clear-indicator-68b60b12","tedi-select__menu-portal":"tedi-select__menu-portal-d5349f37","tedi-select__menu":"tedi-select__menu-bf54b75b","tedi-select__menu-list--grid":"tedi-select__menu-list--grid-393f3232","tedi-select__menu-list":"tedi-select__menu-list-0aa06e24","tedi-select__menu-list-inner":"tedi-select__menu-list-inner-471e5cf8","tedi-select__menu-list-footer":"tedi-select__menu-list-footer-eb1d3bbc","tedi-select__option":"tedi-select__option-6f811381","tedi-select__option--disabled":"tedi-select__option--disabled-d3aff112","tedi-select__option--selected":"tedi-select__option--selected-a93e5fb0","tedi-select__option--focused":"tedi-select__option--focused-1d972ff1","tedi-select__option--control":"tedi-select__option--control-f69f3f48","tedi-select--small":"tedi-select--small-2659608b","tedi-select__multi-value-item":"tedi-select__multi-value-item-b8ec59ae","tedi-select__multi-value--ellipsis":"tedi-select__multi-value--ellipsis-1d821ed7","tedi-select__group":"tedi-select__group-b275e954","tedi-select__group-heading":"tedi-select__group-heading-02b3d9bc","tedi-select__group-heading--selectable":"tedi-select__group-heading--selectable-c84cd617","tedi-select__option--indented":"tedi-select__option--indented-bf4a1661","tedi-select__multi-value-clear":"tedi-select__multi-value-clear-d231f7de","tedi-select--tags-row":"tedi-select--tags-row-c9f33e4b","tedi-select__overflow-tag":"tedi-select__overflow-tag-c0391df2","tedi-select__menu-list--keyboard":"tedi-select__menu-list--keyboard-3d066942","tedi-select__select-all":"tedi-select__select-all-12c3e7f1","tedi-select__group-heading-toggle":"tedi-select__group-heading-toggle-34296a63","tedi-select--tags-stack":"tedi-select--tags-stack-ddb929a9","tedi-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-select__control":"tedi-select__control-dbce8bb7","tedi-select__value-container":"tedi-select__value-container-253d079a","tedi-select__indicators-container":"tedi-select__indicators-container-0fc8fa2a","tedi-select__input":"tedi-select__input-5525b622","tedi-select":"tedi-select-8b014852","tedi-select--disabled":"tedi-select--disabled-2d4b8ddd","tedi-select--invalid":"tedi-select--invalid-3901c89c","tedi-select--valid":"tedi-select--valid-969c0297","tedi-select__control--focused":"tedi-select__control--focused-0e632efe","tedi-select__arrow":"tedi-select__arrow-94b5ef4a","tedi-select__loading-indicator":"tedi-select__loading-indicator-a35a63ca","tedi-select__dropdown-indicator":"tedi-select__dropdown-indicator-5a948baa","tedi-select__clear-indicator":"tedi-select__clear-indicator-68b60b12","tedi-select--clear-on-interaction":"tedi-select--clear-on-interaction-6a390ada","tedi-select__separator":"tedi-select__separator-b1045f3f","tedi-select__menu-portal":"tedi-select__menu-portal-d5349f37","tedi-select__menu":"tedi-select__menu-bf54b75b","tedi-select__menu-list--grid":"tedi-select__menu-list--grid-393f3232","tedi-select__menu-list":"tedi-select__menu-list-0aa06e24","tedi-select__menu-list-inner":"tedi-select__menu-list-inner-471e5cf8","tedi-select__menu-list-footer":"tedi-select__menu-list-footer-eb1d3bbc","tedi-select__option":"tedi-select__option-6f811381","tedi-select__option--disabled":"tedi-select__option--disabled-d3aff112","tedi-select__option--selected":"tedi-select__option--selected-a93e5fb0","tedi-select__option--focused":"tedi-select__option--focused-1d972ff1","tedi-select__option--control":"tedi-select__option--control-f69f3f48","tedi-select--small":"tedi-select--small-2659608b","tedi-select__multi-value-item":"tedi-select__multi-value-item-b8ec59ae","tedi-select__multi-value--ellipsis":"tedi-select__multi-value--ellipsis-1d821ed7","tedi-select__group":"tedi-select__group-b275e954","tedi-select__group-heading":"tedi-select__group-heading-02b3d9bc","tedi-select__group-heading--selectable":"tedi-select__group-heading--selectable-c84cd617","tedi-select__option--indented":"tedi-select__option--indented-bf4a1661","tedi-select__multi-value-clear":"tedi-select__multi-value-clear-d231f7de","tedi-select--tags-row":"tedi-select--tags-row-c9f33e4b","tedi-select__overflow-tag":"tedi-select__overflow-tag-c0391df2","tedi-select__menu-list--keyboard":"tedi-select__menu-list--keyboard-3d066942","tedi-select__select-all":"tedi-select__select-all-12c3e7f1","tedi-select__group-heading-toggle":"tedi-select__group-heading-toggle-34296a63","tedi-select--tags-stack":"tedi-select--tags-stack-ddb929a9","tedi-select--searchable":"tedi-select--searchable-d56eb325"};exports.default=e;
|
|
@@ -12,6 +12,8 @@ const e = {
|
|
|
12
12
|
"tedi-select__loading-indicator": "tedi-select__loading-indicator-a35a63ca",
|
|
13
13
|
"tedi-select__dropdown-indicator": "tedi-select__dropdown-indicator-5a948baa",
|
|
14
14
|
"tedi-select__clear-indicator": "tedi-select__clear-indicator-68b60b12",
|
|
15
|
+
"tedi-select--clear-on-interaction": "tedi-select--clear-on-interaction-6a390ada",
|
|
16
|
+
"tedi-select__separator": "tedi-select__separator-b1045f3f",
|
|
15
17
|
"tedi-select__menu-portal": "tedi-select__menu-portal-d5349f37",
|
|
16
18
|
"tedi-select__menu": "tedi-select__menu-bf54b75b",
|
|
17
19
|
"tedi-select__menu-list--grid": "tedi-select__menu-list--grid-393f3232",
|
|
@@ -37,7 +39,6 @@ const e = {
|
|
|
37
39
|
"tedi-select__select-all": "tedi-select__select-all-12c3e7f1",
|
|
38
40
|
"tedi-select__group-heading-toggle": "tedi-select__group-heading-toggle-34296a63",
|
|
39
41
|
"tedi-select--tags-stack": "tedi-select--tags-stack-ddb929a9",
|
|
40
|
-
"tedi-select__separator": "tedi-select__separator-b1045f3f",
|
|
41
42
|
"tedi-select--searchable": "tedi-select--searchable-d56eb325"
|
|
42
43
|
};
|
|
43
44
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { TextFieldForwardRef, TextFieldProps } from '../textfield/textfield';
|
|
3
|
-
export interface TextareaProps extends Omit<TextFieldProps, 'icon' | 'isClearable' | 'onClear'> {
|
|
3
|
+
export interface TextareaProps extends Omit<TextFieldProps, 'icon' | 'isClearable' | 'showClearOnInteraction' | 'onClear'> {
|
|
4
4
|
/**
|
|
5
5
|
* Maximum number of characters allowed in the textarea.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),p=require("../../../../../external/classnames/index.cjs.js"),i=require("react"),K=require("../../base/icon/icon.cjs.js"),pe=require("../../buttons/closing-button/closing-button.cjs.js"),_e=require("../../misc/separator/separator.cjs.js"),D=require("../feedback-text/feedback-text.cjs.js"),Ie=require("../field/field.cjs.js"),ge=require("../form-label/form-label.cjs.js"),k=require("../input-group/input-group.cjs.js"),t=require("./textfield.module.scss.cjs.js"),je=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),Ae=require("../../../providers/label-provider/use-labels.cjs.js"),Ne={large:24,default:18},q=i.forwardRef((_,U)=>{var V;const{getCurrentBreakpointProps:J}=je.useBreakpointProps(_.defaultServerBreakpoint),{id:ke,label:I,className:Q,inputClassName:W,disabled:c,required:C,hideLabel:S,invalid:f,readOnly:B,icon:s,onIconClick:b,iconButtonProps:y,size:d="default",placeholder:X,isArrowsHidden:Y=!0,isClearable:F,showClearOnInteraction:Z,onClear:v,onChange:o,onChangeEvent:G,onKeyUp:ee,onKeyDown:te,onKeyPress:re,defaultValue:w,value:g,onFocus:j,onBlur:A,onClick:ae,helper:e,input:a,name:le,isTextArea:ie,startSlot:se,endSlot:ne,...de}=J(_)||{},{getLabel:T}=Ae.useLabels(),z=i.useRef(null),L=i.useRef(null),[oe,R]=i.useState(g??w??""),M=g??oe,u=!!(F&&M&&!B),x=(V=k.useOptionalInputGroup)==null?void 0:V.call(k),ce=i.useId(),ue=x==null?void 0:x.hasExternalLabel,m=_.id??(x==null?void 0:x.inputId)??ce;i.useImperativeHandle(U,()=>({get input(){return L.current},get inner(){return z.current}}));const O=i.useMemo(()=>Array.isArray(e)?f||e.some(r=>r.type==="error"):f||(e==null?void 0:e.type)==="error",[f,e]),fe=i.useMemo(()=>!e||Array.isArray(e)&&e.length===0?!1:Array.isArray(e)?!f&&e.every(r=>r.type==="valid"):!f&&e.type==="valid",[f,e]),xe=d==="large"?"default":d,h=g!==void 0,me=i.useCallback(r=>{h||R(r),o==null||o(r)},[h,o]),P=i.useCallback(()=>{h||R(""),o==null||o(""),v==null||v()},[h,o,v]),$=i.useCallback(()=>{if(!s)return null;const N={size:d==="large"?24:d==="small"?!!b?18:16:18,className:t.default["tedi-textfield__icon"]},H=typeof s=="string"?{...N,name:s}:{...N,...s,className:p.default(N.className,s.className)};return b?l.jsx("button",{type:"button",...y,className:p.default(t.default["tedi-textfield__icon-wrapper"],y==null?void 0:y.className),onClick:c?void 0:b,disabled:c,children:l.jsx(K.Icon,{...H})}):l.jsx("div",{className:t.default["tedi-textfield__icon-wrapper"],"aria-hidden":"true",children:l.jsx(K.Icon,{...H})})},[s,d,b,y,c]),E=i.useMemo(()=>u?l.jsx(pe.ClosingButton,{iconSize:Ne[d==="large"?"large":"default"],onClick:c?void 0:P,disabled:c,title:T("clear"),className:t.default["tedi-textfield__clear-button"]}):null,[u,d,c,P,T]),ye=i.useMemo(()=>!u&&!s?null:l.jsxs("div",{className:t.default["tedi-textfield__right-area"],children:[E,u&&s&&l.jsx(_e.Separator,{color:"primary",axis:"vertical",className:t.default["tedi-textfield__separator"]}),s&&$()]}),[u,s,E,$]),be=l.jsx(Ie.Field,{...a,id:m,name:le,value:M,defaultValue:w,onChange:me,onChangeEvent:G,disabled:c,readOnly:B||(a==null?void 0:a.readOnly),required:C,invalid:O,placeholder:X,className:p.default(t.default["tedi-textfield__input"],W,{[t.default["tedi-textfield__input--hidden-arrows"]]:Y}),onFocus:r=>{var n;(n=a==null?void 0:a.onFocus)==null||n.call(a,r),j==null||j(r)},onBlur:r=>{var n;(n=a==null?void 0:a.onBlur)==null||n.call(a,r),A==null||A(r)},isTextArea:ie,"aria-describedby":!e||Array.isArray(e)&&e.length===0?void 0:Array.isArray(e)?e.map((r,n)=>`${m}-helper-${n}`).join(" "):`${m}-helper`,"aria-label":S&&typeof I=="string"?I:void 0,ref:L}),ve=p.default(t.default["tedi-textfield"],{[t.default[`tedi-textfield--${d}`]]:d},{[t.default["tedi-textfield--with-icon"]]:s},{[t.default["tedi-textfield--invalid"]]:O},{[t.default["tedi-textfield--valid"]]:fe},{[t.default["tedi-textfield--clearable"]]:u},{[t.default["tedi-textfield--clear-on-interaction"]]:u&&Z},Q),he=()=>!e||Array.isArray(e)&&e.length===0?null:l.jsx("div",{className:t.default["tedi-textfield__feedback-wrapper"],children:Array.isArray(e)?e.map((r,n)=>l.jsx(D.FeedbackText,{...r,id:`${m}-helper-${n}`},n)):l.jsx(D.FeedbackText,{...e,id:`${m}-helper`})});return l.jsxs("div",{"data-name":"textfield",...de,className:ve,children:[!ue&&l.jsx(ge.FormLabel,{id:m,label:I,required:C,hideLabel:S,size:xe}),l.jsxs("div",{className:t.default["tedi-textfield__inner"],onKeyDown:te,onKeyUp:ee,onKeyPress:re,onClick:ae,ref:z,children:[se,be,ne,(F||s)&&ye]}),he()]})});q.displayName="TextField";exports.TextField=q;exports.default=q;
|
|
@@ -50,6 +50,12 @@ type TextFieldBreakpointProps = {
|
|
|
50
50
|
* @default false
|
|
51
51
|
*/
|
|
52
52
|
isClearable?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Show the clear (×) button only while the field is hovered or focused, instead of whenever it has
|
|
55
|
+
* a value. Requires `isClearable`.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
showClearOnInteraction?: boolean;
|
|
53
59
|
/**
|
|
54
60
|
* Additional CSS class name applied to the root container (`<div>`).
|
|
55
61
|
*
|