@tedi-design-system/react 19.2.0-rc.6 → 19.2.0-rc.8
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/component.manifest.json +8 -8
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/map-components/map-layer/map-layer.cjs.js +1 -1
- package/src/community/components/map-components/map-layer/map-layer.es.js +1 -1
- package/src/tedi/components/content/label/label.cjs.js +1 -1
- package/src/tedi/components/content/label/label.d.ts +22 -0
- package/src/tedi/components/content/label/label.es.js +30 -28
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group-context.cjs.js +1 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group-context.d.ts +20 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group-context.es.js +5 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.cjs.js +1 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.d.ts +72 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.es.js +124 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.module.scss.cjs.js +1 -0
- package/src/tedi/components/form/checkbox/checkbox-group/checkbox-group.module.scss.es.js +13 -0
- package/src/tedi/components/form/checkbox/checkbox.cjs.js +1 -1
- package/src/tedi/components/form/checkbox/checkbox.d.ts +8 -2
- package/src/tedi/components/form/checkbox/checkbox.es.js +146 -108
- package/src/tedi/components/form/checkbox/checkbox.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/checkbox/checkbox.module.scss.es.js +11 -3
- package/src/tedi/components/form/checkbox/index.cjs.js +1 -0
- package/src/tedi/components/form/checkbox/index.d.ts +11 -0
- package/src/tedi/components/form/checkbox/index.es.js +7 -0
- package/src/tedi/components/form/choice-group/choice-group.cjs.js +1 -1
- package/src/tedi/components/form/choice-group/choice-group.d.ts +11 -0
- package/src/tedi/components/form/choice-group/choice-group.es.js +80 -69
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.cjs.js +1 -1
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.es.js +15 -15
- package/src/tedi/components/form/choice-input.types.d.ts +46 -8
- package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field.d.ts +5 -0
- package/src/tedi/components/form/date-field/date-field.es.js +187 -184
- package/src/tedi/components/form/date-time-field/date-time-field.cjs.js +1 -1
- package/src/tedi/components/form/date-time-field/date-time-field.d.ts +5 -0
- package/src/tedi/components/form/date-time-field/date-time-field.es.js +103 -101
- package/src/tedi/components/form/form-label/form-label.cjs.js +1 -1
- package/src/tedi/components/form/form-label/form-label.d.ts +9 -0
- package/src/tedi/components/form/form-label/form-label.es.js +15 -14
- 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 +7 -0
- package/src/tedi/components/form/multi-value-field/multi-value-field.es.js +41 -40
- package/src/tedi/components/form/number-field/number-field.cjs.js +1 -1
- package/src/tedi/components/form/number-field/number-field.es.js +54 -43
- package/src/tedi/components/form/radio/index.cjs.js +1 -0
- package/src/tedi/components/form/radio/index.d.ts +11 -0
- package/src/tedi/components/form/radio/index.es.js +7 -0
- package/src/tedi/components/form/radio/radio-group/radio-group-context.cjs.js +1 -0
- package/src/tedi/components/form/radio/radio-group/radio-group-context.d.ts +21 -0
- package/src/tedi/components/form/radio/radio-group/radio-group-context.es.js +5 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.cjs.js +1 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.d.ts +56 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.es.js +78 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.module.scss.cjs.js +1 -0
- package/src/tedi/components/form/radio/radio-group/radio-group.module.scss.es.js +13 -0
- package/src/tedi/components/form/radio/radio.cjs.js +1 -1
- package/src/tedi/components/form/radio/radio.d.ts +7 -2
- package/src/tedi/components/form/radio/radio.es.js +117 -77
- package/src/tedi/components/form/radio/radio.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/radio/radio.module.scss.es.js +11 -3
- package/src/tedi/components/form/select/select.cjs.js +1 -1
- package/src/tedi/components/form/select/select.es.js +79 -77
- package/src/tedi/components/form/slider/slider.cjs.js +1 -1
- package/src/tedi/components/form/slider/slider.d.ts +7 -0
- package/src/tedi/components/form/slider/slider.es.js +48 -47
- package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.es.js +72 -61
- package/src/tedi/components/form/time-field/time-field.cjs.js +1 -1
- package/src/tedi/components/form/time-field/time-field.d.ts +5 -0
- package/src/tedi/components/form/time-field/time-field.es.js +87 -85
- package/src/tedi/components/form/toggle/toggle.cjs.js +1 -1
- package/src/tedi/components/form/toggle/toggle.d.ts +7 -0
- package/src/tedi/components/form/toggle/toggle.es.js +26 -24
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.d.ts +12 -0
- package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.es.js +57 -27
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.cjs.js +1 -1
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.d.ts +17 -0
- package/src/tedi/components/navigation/table-of-contents/table-of-contents.es.js +65 -51
- package/src/tedi/index.d.ts +2 -2
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +14 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +25 -11
- package/tedi.cjs.js +1 -1
- package/tedi.es.js +298 -294
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { BreakpointSupport } from '../../../helpers';
|
|
1
2
|
import { ChoiceInputProps } from '../choice-input.types';
|
|
2
|
-
export type RadioProps = ChoiceInputProps
|
|
3
|
-
|
|
3
|
+
export type RadioProps = BreakpointSupport<ChoiceInputProps>;
|
|
4
|
+
interface RadioComponent {
|
|
5
|
+
(props: RadioProps): JSX.Element;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Radio: RadioComponent;
|
|
4
9
|
export default Radio;
|
|
@@ -1,96 +1,136 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import t from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import o from "react";
|
|
4
|
+
import { Icon as ee } from "../../base/icon/icon.es.js";
|
|
5
|
+
import { FeedbackText as q } from "../feedback-text/feedback-text.es.js";
|
|
6
|
+
import { FormLabel as ae } from "../form-label/form-label.es.js";
|
|
7
|
+
import a from "./radio.module.scss.es.js";
|
|
8
|
+
import { RadioGroupContext as ie } from "./radio-group/radio-group-context.es.js";
|
|
9
|
+
import { useBreakpointProps as de } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
10
|
+
import { Row as re } from "../../layout/grid/row.es.js";
|
|
11
|
+
import { Col as V } from "../../layout/grid/col.es.js";
|
|
12
|
+
const te = (k) => {
|
|
13
|
+
const e = o.useContext(ie), { getCurrentBreakpointProps: $ } = de(k.defaultServerBreakpoint), {
|
|
14
|
+
id: L,
|
|
12
15
|
label: m,
|
|
13
|
-
value:
|
|
14
|
-
className:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
hideLabel: y,
|
|
16
|
+
value: s,
|
|
17
|
+
className: y,
|
|
18
|
+
onChange: c,
|
|
19
|
+
hideLabel: C,
|
|
18
20
|
helper: r,
|
|
19
|
-
checked:
|
|
20
|
-
defaultChecked:
|
|
21
|
-
hover:
|
|
22
|
-
name:
|
|
23
|
-
tooltip:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
checked: p,
|
|
22
|
+
defaultChecked: j,
|
|
23
|
+
hover: E,
|
|
24
|
+
name: D,
|
|
25
|
+
tooltip: P,
|
|
26
|
+
description: b,
|
|
27
|
+
icon: _,
|
|
28
|
+
labelProps: F,
|
|
29
|
+
size: G,
|
|
30
|
+
variant: M,
|
|
31
|
+
cardVariant: S,
|
|
32
|
+
disabled: H,
|
|
33
|
+
invalid: T,
|
|
34
|
+
required: I,
|
|
35
|
+
...w
|
|
36
|
+
} = $(k), u = G ?? (e == null ? void 0 : e.size) ?? "default", B = M ?? (e == null ? void 0 : e.variant) ?? "default", U = S ?? (e == null ? void 0 : e.cardVariant) ?? "primary", h = H ?? (e == null ? void 0 : e.disabled) ?? !1, A = T ?? (e == null ? void 0 : e.invalid), J = I ?? (e == null ? void 0 : e.required);
|
|
37
|
+
B === "card" && P && console.warn('Radio: `tooltip` is not supported with `variant="card"` and will be ignored. Use `description`.');
|
|
38
|
+
const K = o.useId(), n = L ?? K, O = D ?? (e == null ? void 0 : e.name), [x, Q] = o.useState(j || !1), N = e !== null, W = o.useMemo(() => N ? (e == null ? void 0 : e.value) === s : c && typeof p < "u" ? p : x, [N, e, s, c, p, x]), X = (d) => {
|
|
39
|
+
N ? e == null || e.onValueChange(s) : typeof p > "u" && Q(d == null ? void 0 : d.target.checked), c == null || c(s, d == null ? void 0 : d.target.checked);
|
|
40
|
+
}, f = r ? r.id ?? `${n}-helper` : void 0, Y = f, z = /* @__PURE__ */ i(
|
|
41
|
+
"input",
|
|
42
|
+
{
|
|
43
|
+
id: n,
|
|
44
|
+
value: s,
|
|
45
|
+
name: O,
|
|
46
|
+
type: "radio",
|
|
47
|
+
disabled: h,
|
|
48
|
+
checked: W,
|
|
49
|
+
required: J,
|
|
50
|
+
onChange: X,
|
|
51
|
+
className: a["tedi-radio__input"],
|
|
52
|
+
"aria-describedby": Y
|
|
53
|
+
}
|
|
54
|
+
), v = /* @__PURE__ */ i(
|
|
55
|
+
"span",
|
|
56
|
+
{
|
|
57
|
+
"aria-hidden": "true",
|
|
58
|
+
className: t(
|
|
59
|
+
a["tedi-radio__indicator"],
|
|
60
|
+
{ [a["tedi-radio__indicator--hover"]]: E },
|
|
61
|
+
{ [a[`tedi-radio__indicator--size-${u}`]]: u },
|
|
62
|
+
{ [a["tedi-radio__indicator--invalid"]]: A }
|
|
63
|
+
),
|
|
64
|
+
"data-testid": "radio-indicator"
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
if (B === "card") {
|
|
68
|
+
const d = `${n}-label`, R = b ? `${n}-description` : void 0, g = [R, f].filter(Boolean).join(" ") || void 0;
|
|
69
|
+
return /* @__PURE__ */ l(
|
|
70
|
+
"label",
|
|
71
|
+
{
|
|
72
|
+
"data-name": "radio",
|
|
73
|
+
className: t(
|
|
74
|
+
a["tedi-radio"],
|
|
75
|
+
a["tedi-radio--card"],
|
|
76
|
+
a[`tedi-radio--card-${U}`],
|
|
77
|
+
{ [a["tedi-radio--card-with-icon"]]: !!_ },
|
|
78
|
+
{ [a["tedi-radio--disabled"]]: h },
|
|
79
|
+
y
|
|
80
|
+
),
|
|
81
|
+
...w,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ l("span", { className: a["tedi-radio__card-control"], children: [
|
|
84
|
+
o.cloneElement(z, {
|
|
85
|
+
"aria-labelledby": m ? d : void 0,
|
|
86
|
+
"aria-describedby": g
|
|
87
|
+
}),
|
|
88
|
+
v,
|
|
89
|
+
_ && /* @__PURE__ */ i(ee, { name: _, size: u === "default" ? 18 : 24, className: a["tedi-radio__card-icon"] }),
|
|
90
|
+
/* @__PURE__ */ i("span", { id: d, className: t(a["tedi-radio__card-label"], { "sr-only": C }), children: m })
|
|
91
|
+
] }),
|
|
92
|
+
b && /* @__PURE__ */ i("span", { id: R, className: a["tedi-radio__card-description"], children: b }),
|
|
93
|
+
r && /* @__PURE__ */ i(q, { id: f, ...r, className: t(a["tedi-radio__helper"], r.className) })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
const Z = t(a["tedi-radio__label"], { [a["tedi-radio--disabled"]]: h });
|
|
99
|
+
return /* @__PURE__ */ l(
|
|
32
100
|
"div",
|
|
33
101
|
{
|
|
34
|
-
className:
|
|
102
|
+
className: t(a["tedi-radio"], { [a["tedi-radio--disabled"]]: h }),
|
|
35
103
|
"data-name": "radio",
|
|
36
|
-
...
|
|
104
|
+
...w,
|
|
37
105
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
value: h,
|
|
45
|
-
name: j,
|
|
46
|
-
type: "radio",
|
|
47
|
-
disabled: c,
|
|
48
|
-
checked: $,
|
|
49
|
-
onChange: z,
|
|
50
|
-
className: e["tedi-radio__input"],
|
|
51
|
-
"aria-describedby": [k, B].filter(Boolean).join(" "),
|
|
52
|
-
required: u
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
/* @__PURE__ */ d(
|
|
56
|
-
"div",
|
|
57
|
-
{
|
|
58
|
-
"aria-hidden": "true",
|
|
59
|
-
onClick: () => {
|
|
60
|
-
var i;
|
|
61
|
-
return (i = b.current) == null ? void 0 : i.click();
|
|
62
|
-
},
|
|
63
|
-
className: l(
|
|
64
|
-
e["tedi-radio__indicator"],
|
|
65
|
-
{ [e["tedi-radio__indicator--hover"]]: x },
|
|
66
|
-
{ [e[`tedi-radio__indicator--size-${f}`]]: f },
|
|
67
|
-
{ [e["tedi-radio__indicator--invalid"]]: w },
|
|
68
|
-
g
|
|
69
|
-
),
|
|
70
|
-
"data-testid": "radio-indicator"
|
|
71
|
-
}
|
|
72
|
-
)
|
|
106
|
+
/* @__PURE__ */ l(re, { gutter: 0, children: [
|
|
107
|
+
/* @__PURE__ */ i(V, { width: "auto", children: /* @__PURE__ */ l("div", { className: a["tedi-radio__outer-indicator-wrapper"], children: [
|
|
108
|
+
z,
|
|
109
|
+
o.cloneElement(v, {
|
|
110
|
+
className: t(v.props.className, y)
|
|
111
|
+
})
|
|
73
112
|
] }) }),
|
|
74
|
-
m && /* @__PURE__ */
|
|
75
|
-
|
|
113
|
+
m && /* @__PURE__ */ i(V, { children: /* @__PURE__ */ i(
|
|
114
|
+
ae,
|
|
76
115
|
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
id: o,
|
|
116
|
+
className: Z,
|
|
117
|
+
id: n,
|
|
80
118
|
"data-testid": "radio-label",
|
|
81
|
-
hideLabel:
|
|
119
|
+
hideLabel: C,
|
|
82
120
|
label: m,
|
|
83
|
-
tooltip:
|
|
84
|
-
required:
|
|
121
|
+
tooltip: P,
|
|
122
|
+
required: I,
|
|
123
|
+
labelProps: F
|
|
85
124
|
}
|
|
86
125
|
) })
|
|
87
126
|
] }),
|
|
88
|
-
r && /* @__PURE__ */
|
|
127
|
+
r && /* @__PURE__ */ i(q, { id: f, ...r, className: t(a["tedi-radio__helper"], r.className) })
|
|
89
128
|
]
|
|
90
129
|
}
|
|
91
130
|
);
|
|
92
131
|
};
|
|
132
|
+
te.displayName = "Radio";
|
|
93
133
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
134
|
+
te as Radio,
|
|
135
|
+
te as default
|
|
96
136
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d={"tedi-radio":"tedi-radio-c814e478","tedi-radio--disabled":"tedi-radio--disabled-fb9dbcd0","tedi-radio__input":"tedi-radio__input-62863a92","tedi-radio__indicator":"tedi-radio__indicator-c6e05a3f","tedi-radio__indicator--size-default":"tedi-radio__indicator--size-default-dd9e104b","tedi-radio__indicator--size-large":"tedi-radio__indicator--size-large-c5c7d068","tedi-radio__indicator--invalid":"tedi-radio__indicator--invalid-d5a930d7","tedi-radio__indicator--hover":"tedi-radio__indicator--hover-6e11a48a","tedi-radio__outer-indicator-wrapper":"tedi-radio__outer-indicator-wrapper-7c0ad4cd","tedi-radio__helper":"tedi-radio__helper-266c7814","tedi-radio--card":"tedi-radio--card-f10f7b18","tedi-radio__card-control":"tedi-radio__card-control-d010324f","tedi-radio__card-label":"tedi-radio__card-label-19b7c642","tedi-radio__card-icon":"tedi-radio__card-icon-fa03c66c","tedi-radio__card-description":"tedi-radio__card-description-69c958cf","tedi-radio--card-with-icon":"tedi-radio--card-with-icon-0735f37d","tedi-radio--card-primary":"tedi-radio--card-primary-f05b3587","tedi-radio--card-secondary":"tedi-radio--card-secondary-9a5fbafe"};exports.default=d;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const d = {
|
|
2
2
|
"tedi-radio": "tedi-radio-c814e478",
|
|
3
3
|
"tedi-radio--disabled": "tedi-radio--disabled-fb9dbcd0",
|
|
4
4
|
"tedi-radio__input": "tedi-radio__input-62863a92",
|
|
@@ -8,8 +8,16 @@ const i = {
|
|
|
8
8
|
"tedi-radio__indicator--invalid": "tedi-radio__indicator--invalid-d5a930d7",
|
|
9
9
|
"tedi-radio__indicator--hover": "tedi-radio__indicator--hover-6e11a48a",
|
|
10
10
|
"tedi-radio__outer-indicator-wrapper": "tedi-radio__outer-indicator-wrapper-7c0ad4cd",
|
|
11
|
-
"tedi-radio__helper": "tedi-radio__helper-266c7814"
|
|
11
|
+
"tedi-radio__helper": "tedi-radio__helper-266c7814",
|
|
12
|
+
"tedi-radio--card": "tedi-radio--card-f10f7b18",
|
|
13
|
+
"tedi-radio__card-control": "tedi-radio__card-control-d010324f",
|
|
14
|
+
"tedi-radio__card-label": "tedi-radio__card-label-19b7c642",
|
|
15
|
+
"tedi-radio__card-icon": "tedi-radio__card-icon-fa03c66c",
|
|
16
|
+
"tedi-radio__card-description": "tedi-radio__card-description-69c958cf",
|
|
17
|
+
"tedi-radio--card-with-icon": "tedi-radio--card-with-icon-0735f37d",
|
|
18
|
+
"tedi-radio--card-primary": "tedi-radio--card-primary-f05b3587",
|
|
19
|
+
"tedi-radio--card-secondary": "tedi-radio--card-secondary-9a5fbafe"
|
|
12
20
|
};
|
|
13
21
|
export {
|
|
14
|
-
|
|
22
|
+
d as default
|
|
15
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),Y=require("../../../../../external/classnames/index.cjs.js"),a=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),Y=require("../../../../../external/classnames/index.cjs.js"),a=require("react"),lt=require("../../../../../external/react-select/dist/react-select.esm.cjs.js"),ot=require("../../../../../external/react-select/async/dist/react-select-async.esm.cjs.js"),st=require("../feedback-text/feedback-text.cjs.js"),at=require("../form-label/form-label.cjs.js"),T=require("../input-group/input-group.cjs.js"),rt=require("../input-group/input-group.module.scss.cjs.js"),i=require("./components/select-bulk-helpers.cjs.js"),it=require("./components/select-clear-indicator.cjs.js"),ct=require("./components/select-control.cjs.js"),ut=require("./components/select-dropdown-indicator.cjs.js"),dt=require("./components/select-group.cjs.js"),pt=require("./components/select-group-heading.cjs.js"),ft=require("./components/select-indicators-container.cjs.js"),St=require("./components/select-input.cjs.js"),bt=require("./components/select-loading-indicator.cjs.js"),gt=require("./components/select-menu.cjs.js"),mt=require("./components/select-menu-list.cjs.js"),yt=require("./components/select-menu-portal.cjs.js"),Lt=require("./components/select-multi-value.cjs.js"),Mt=require("./components/select-multi-value-remove.cjs.js"),vt=require("./components/select-option.cjs.js"),It=require("./components/select-single-value.cjs.js"),ht=require("./components/select-value-container.cjs.js"),p=require("./select.module.scss.cjs.js"),Ct=require("../../../providers/label-provider/use-labels.cjs.js"),Z=a.forwardRef((k,ee)=>{var Q;const{options:u,defaultOptions:te,name:ne,iconName:le="arrow_drop_down",label:oe,required:R,value:x,defaultValue:D,tagsDirection:V="stack",onChange:_,onInputChange:se,inputValue:ae,loadOptions:re,isLoading:ie,openMenuOnFocus:ce=!1,openMenuOnClick:ue=!0,tabSelectsValue:de=!1,disabled:P=!1,className:pe,hideLabel:fe=!1,helper:c,placeholder:Se,invalid:be,valid:ge,size:q,async:me=!1,renderOption:ye,renderMessageListFooter:F,noOptionsMessage:Le,loadingMessage:Me,multiple:v=!1,showSelectAll:G=!1,selectableGroups:N=!1,dropdownType:ve="menu",renderValue:Ie,closeMenuOnSelect:he=!v,blurInputOnSelect:j=!1,autoFocus:Ce=!1,isClearable:Oe=!0,isClearIndicatorVisible:H=!1,showClearOnInteraction:Ae=!1,isSearchable:C=!0,openKeyboardOnTouch:U=!0,menuIsOpen:Ve,onMenuClose:_e,onMenuOpen:qe,onBlur:E,inputIsHidden:Ee,isTagRemovable:we=!1,tagsEllipsis:Te=!1,backspaceRemovesValue:ke=!1,optionGroupHeadingText:Re={modifiers:"small",color:"tertiary"},cacheOptions:xe=!0,showRadioButtons:De=!1,renderWithoutLabel:Pe,tooltip:Fe,labelProps:Ge,classNames:K}=k,d=(Q=T.useOptionalInputGroup)==null?void 0:Q.call(T),Ne=a.useId(),w=d==null?void 0:d.hasExternalLabel,b=k.id??(d==null?void 0:d.inputId)??Ne,je=w?(d==null?void 0:d.inputId)??b:`${b}-input`,He=w?`${b}-container`:b,B=c?(c==null?void 0:c.id)??`${b}-helper`:void 0,I=a.useRef(null),{getLabel:O}=Ct.useLabels();a.useImperativeHandle(ee,()=>I.current);const[Ue,$]=a.useState(!1),Ke=t=>{var e,n;if(U||!C||t.pointerType!=="touch"&&t.pointerType!=="pen")return;const o=t.target;if(!((e=o.closest)!=null&&e.call(o,`.${p.default["tedi-select__control"]}`)))return;const l=(n=I.current)==null?void 0:n.inputRef,r=!!l&&(t.target===l||l.contains(o));$(!r)},Be=()=>{$(!1),E==null||E()},m=!!G&&v,[$e,ze]=a.useState(D??null),z=x!==void 0,g=z?x:$e,f=a.useMemo(()=>Array.isArray(g)?g:g?[g]:[],[g]),A=a.useMemo(()=>({value:i.SELECT_ALL_VALUE,label:O("select.select-all")}),[O]),y=!!N&&!!v,{groupFlattenedOptions:W,groupSentinelMap:h}=a.useMemo(()=>{const t=new Map;if(!y||!u||u.length===0)return{groupFlattenedOptions:null,groupSentinelMap:t};if(!u.some(e=>e&&Array.isArray(e.options)))return{groupFlattenedOptions:null,groupSentinelMap:t};const l=[],r=new Map;for(const e of u)if(e&&Array.isArray(e.options)){const n=e,s=`${i.GROUP_OPTION_PREFIX}${n.label??""}`,S=n.options.filter(L=>!L.isDisabled);r.set(s,{enabled:S}),l.push({value:s,label:n.label??""});for(const L of n.options)l.push({...L,customData:{...L.customData??{},__tediInGroup:!0}})}else l.push(e);return{groupFlattenedOptions:l,groupSentinelMap:r}},[u,y]),We=a.useMemo(()=>{let t=W??u;return m&&t&&t.length>0&&(t=[A,...t]),t},[u,W,m,A]),Xe=a.useMemo(()=>{const t=[];if(y&&h.size>0)for(const[o,l]of h)l.enabled.length>0&&i.areAllSelected(f,l.enabled)&&t.push({value:o,label:""});if(m){const o=i.getEnabledOptions(u??[]);o.length>0&&i.areAllSelected(f,o)&&t.push(A)}return t.length===0?g:[...f,...t]},[g,f,u,y,h,m,A]),Je=(t,o)=>{let l=t;const r=o.option;if(y&&r&&h.has(r.value)){const e=h.get(r.value).enabled;if(o.action==="select-option"){const n=[...f];for(const s of e)n.some(S=>S.value===s.value)||n.push(s);l=n}else o.action==="deselect-option"&&(l=f.filter(n=>!e.some(s=>s.value===n.value)))}else if(m){const e=i.getEnabledOptions(u??[]),n=(r==null?void 0:r.value)===i.SELECT_ALL_VALUE;n&&o.action==="select-option"?l=[...f.filter(S=>S.value!==i.SELECT_ALL_VALUE&&!e.some(L=>L.value===S.value)),...e]:n&&o.action==="deselect-option"&&(l=f.filter(s=>s.value!==i.SELECT_ALL_VALUE&&!e.some(S=>S.value===s.value)))}Array.isArray(l)&&(l=l.filter(e=>e.value!==i.SELECT_ALL_VALUE&&!i.isGroupSentinel(e))),z||ze(l),_==null||_(l),!j&&I.current&&setTimeout(()=>{var e,n;return(n=(e=I.current)==null?void 0:e.inputRef)==null?void 0:n.focus()},0)},Qe=a.useCallback((t,o)=>t.data.value===i.SELECT_ALL_VALUE||i.isGroupSentinel(t.data)||!o?!0:String(t.label).toLowerCase().includes(o.toLowerCase()),[]),[X,J]=a.useState(!1),Ye=t=>{(t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||t.key==="End"||t.key==="PageUp"||t.key==="PageDown"||t.key==="Tab")&&(X||J(!0))},Ze=a.useCallback(()=>{J(t=>t&&!1)},[]),et=a.useCallback(t=>M.jsx(mt.SelectMenuList,{...t,renderMessageListFooter:F}),[F]),tt=()=>{const t={ClearIndicator:e=>it.SelectClearIndicator({isClearIndicatorVisible:H,...e}),DropdownIndicator:()=>ut.SelectDropDownIndicator({iconName:le}),IndicatorSeparator:()=>null,MenuPortal:yt.SelectMenuPortal,Menu:gt.SelectMenu,MenuList:et,Option:e=>vt.SelectOption({renderOption:ye,multiple:v,showRadioButtons:De,...e}),Control:ct.SelectControl,Input:St.SelectInput,MultiValue:e=>Lt.SelectMultiValue({isTagRemovable:we,tagsEllipsis:Te,...e}),MultiValueRemove:Mt.SelectMultiValueRemove,SingleValue:It.SelectSingleValue,Group:dt.SelectGroup,GroupHeading:e=>pt.SelectGroupHeading({optionGroupHeadingText:Re,...e}),IndicatorsContainer:ft.SelectIndicatorsContainer,ValueContainer:ht.SelectValueContainer,LoadingIndicator:bt.SelectLoadingIndicator},o=me?ot.default:lt.default,l=()=>O("select.no-options"),r=()=>O("select.loading");return M.jsx(o,{tagsDirection:V,showSelectAll:G,selectableGroups:N,dropdownType:ve,renderValue:Ie,keyboardMode:X,exitKeyboardMode:Ze,onKeyDown:Ye,id:He,"aria-describedby":B,autoFocus:Ce,ref:I,instanceId:b,className:"tedi-select__wrapper",name:ne,options:We,defaultOptions:te,value:Xe,defaultValue:D,cacheOptions:xe,onChange:Je,filterOption:m||y?Qe:void 0,onInputChange:se,onBlur:Be,softKeyboardSuppressed:!U&&C&&Ue,inputValue:ae,inputId:je,loadOptions:re,isLoading:ie,noOptionsMessage:Le||l,loadingMessage:Me||r,classNamePrefix:"select",components:t,isDisabled:P,isSearchable:C,menuIsOpen:Ve,openMenuOnFocus:ce,openMenuOnClick:ue,tabSelectsValue:de,onMenuClose:_e,onMenuOpen:qe,placeholder:Se||"",isClearable:Oe,backspaceRemovesValue:ke,menuShouldScrollIntoView:!0,isMulti:v,hideSelectedOptions:!1,closeMenuOnSelect:he,blurInputOnSelect:j,menuPlacement:"auto",inputIsHidden:Ee,required:R,menuPortalTarget:document.body,menuPosition:"absolute",classNames:(()=>{const e={};if(K)for(const[n,s]of Object.entries(K))e[n]=typeof s=="string"?()=>s:s;if(d){const n=e.control;e.control=s=>Y.default(n==null?void 0:n(s),rt.default["tedi-input-group__input"])}return Object.keys(e).length>0?e:void 0})(),theme:e=>({...e,colors:{...e.colors,primary:"var(--tedi-blue-600)",danger:"var(--tedi-red-600)",dangerLight:"var(--tedi-red-200)"}}),styles:{input:e=>({...e,gridTemplateColumns:"0fr"})}})},nt=Y.default(p.default["tedi-select"],pe,{[p.default["tedi-select--invalid"]]:be||(c==null?void 0:c.type)==="error"},{[p.default["tedi-select--valid"]]:ge||(c==null?void 0:c.type)==="valid"},{[p.default[`tedi-select--${q}`]]:q},{[p.default[`tedi-select--tags-${V}`]]:V},{[p.default["tedi-select--searchable"]]:C},{[p.default["tedi-select--clear-on-interaction"]]:H&&Ae},{[p.default["tedi-select--disabled"]]:P});return M.jsxs("div",{"data-name":"select",className:nt,onPointerDownCapture:Ke,children:[M.jsxs("div",{className:p.default["tedi-select__inner"],children:[!w&&M.jsx(at.FormLabel,{id:`${b}-input`,label:oe,required:R,hideLabel:fe,size:q,renderWithoutLabel:Pe,tooltip:Fe,labelProps:Ge}),tt()]}),c&&M.jsx(st.FeedbackText,{...c,id:B})]})});Z.displayName="Select";exports.Select=Z;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsx as L, jsxs as Q } from "react/jsx-runtime";
|
|
2
2
|
import Y from "../../../../../external/classnames/index.es.js";
|
|
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
|
|
13
|
-
import { SelectDropDownIndicator as
|
|
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
|
|
3
|
+
import r, { forwardRef as st } from "react";
|
|
4
|
+
import rt from "../../../../../external/react-select/dist/react-select.esm.es.js";
|
|
5
|
+
import at from "../../../../../external/react-select/async/dist/react-select-async.esm.es.js";
|
|
6
|
+
import { FeedbackText as it } from "../feedback-text/feedback-text.es.js";
|
|
7
|
+
import { FormLabel as ct } from "../form-label/form-label.es.js";
|
|
8
|
+
import { useOptionalInputGroup as ut } from "../input-group/input-group.es.js";
|
|
9
|
+
import dt from "../input-group/input-group.module.scss.es.js";
|
|
10
|
+
import { SELECT_ALL_VALUE as M, GROUP_OPTION_PREFIX as pt, areAllSelected as Z, getEnabledOptions as ee, isGroupSentinel as te } from "./components/select-bulk-helpers.es.js";
|
|
11
|
+
import { SelectClearIndicator as ft } from "./components/select-clear-indicator.es.js";
|
|
12
|
+
import { SelectControl as mt } from "./components/select-control.es.js";
|
|
13
|
+
import { SelectDropDownIndicator as gt } from "./components/select-dropdown-indicator.es.js";
|
|
14
|
+
import { SelectGroup as St } from "./components/select-group.es.js";
|
|
15
|
+
import { SelectGroupHeading as bt } from "./components/select-group-heading.es.js";
|
|
16
|
+
import { SelectIndicatorsContainer as yt } from "./components/select-indicators-container.es.js";
|
|
17
|
+
import { SelectInput as Mt } from "./components/select-input.es.js";
|
|
18
|
+
import { SelectLoadingIndicator as vt } from "./components/select-loading-indicator.es.js";
|
|
19
|
+
import { SelectMenu as ht } from "./components/select-menu.es.js";
|
|
20
|
+
import { SelectMenuList as It } from "./components/select-menu-list.es.js";
|
|
21
|
+
import { SelectMenuPortal as Ot } from "./components/select-menu-portal.es.js";
|
|
22
|
+
import { SelectMultiValue as Ct } from "./components/select-multi-value.es.js";
|
|
23
|
+
import { SelectMultiValueRemove as wt } from "./components/select-multi-value-remove.es.js";
|
|
24
|
+
import { SelectOption as Lt } from "./components/select-option.es.js";
|
|
25
|
+
import { SelectSingleValue as Vt } from "./components/select-single-value.es.js";
|
|
26
|
+
import { SelectValueContainer as At } from "./components/select-value-container.es.js";
|
|
27
27
|
import d from "./select.module.scss.es.js";
|
|
28
|
-
import { useLabels as
|
|
29
|
-
const
|
|
28
|
+
import { useLabels as _t } from "../../../providers/label-provider/use-labels.es.js";
|
|
29
|
+
const kt = st(
|
|
30
30
|
(D, oe) => {
|
|
31
31
|
var J;
|
|
32
32
|
const {
|
|
@@ -86,22 +86,23 @@ const _t = lt(
|
|
|
86
86
|
showRadioButtons: xe = !1,
|
|
87
87
|
renderWithoutLabel: Ee,
|
|
88
88
|
tooltip: Ge,
|
|
89
|
+
labelProps: He,
|
|
89
90
|
classNames: j
|
|
90
|
-
} = D, u = (J =
|
|
91
|
+
} = D, u = (J = ut) == null ? void 0 : J(), Ke = r.useId(), R = u == null ? void 0 : u.hasExternalLabel, m = D.id ?? (u == null ? void 0 : u.inputId) ?? Ke, je = R ? (u == null ? void 0 : u.inputId) ?? m : `${m}-input`, Ue = R ? `${m}-container` : m, U = a ? (a == null ? void 0 : a.id) ?? `${m}-helper` : void 0, h = r.useRef(null), { getLabel: C } = _t();
|
|
91
92
|
r.useImperativeHandle(
|
|
92
93
|
oe,
|
|
93
94
|
() => h.current
|
|
94
95
|
);
|
|
95
|
-
const [
|
|
96
|
+
const [Be, B] = r.useState(!1), ze = (t) => {
|
|
96
97
|
var e, o;
|
|
97
98
|
if (K || !O || t.pointerType !== "touch" && t.pointerType !== "pen") return;
|
|
98
99
|
const l = t.target;
|
|
99
100
|
if (!((e = l.closest) != null && e.call(l, `.${d["tedi-select__control"]}`))) return;
|
|
100
101
|
const n = (o = h.current) == null ? void 0 : o.inputRef, i = !!n && (t.target === n || n.contains(l));
|
|
101
102
|
B(!i);
|
|
102
|
-
},
|
|
103
|
+
}, qe = () => {
|
|
103
104
|
B(!1), k == null || k();
|
|
104
|
-
}, S = !!x && v, [
|
|
105
|
+
}, S = !!x && v, [We, Xe] = r.useState(T ?? null), z = P !== void 0, g = z ? P : We, p = r.useMemo(() => Array.isArray(g) ? g : g ? [g] : [], [g]), w = r.useMemo(
|
|
105
106
|
() => ({ value: M, label: C("select.select-all") }),
|
|
106
107
|
[C]
|
|
107
108
|
), b = !!E && !!v, { groupFlattenedOptions: q, groupSentinelMap: I } = r.useMemo(() => {
|
|
@@ -112,7 +113,7 @@ const _t = lt(
|
|
|
112
113
|
const n = [], i = /* @__PURE__ */ new Map();
|
|
113
114
|
for (const e of c)
|
|
114
115
|
if (e && Array.isArray(e.options)) {
|
|
115
|
-
const o = e, s = `${
|
|
116
|
+
const o = e, s = `${pt}${o.label ?? ""}`, f = o.options.filter((y) => !y.isDisabled);
|
|
116
117
|
i.set(s, { enabled: f }), n.push({ value: s, label: o.label ?? "" });
|
|
117
118
|
for (const y of o.options)
|
|
118
119
|
n.push({
|
|
@@ -122,10 +123,10 @@ const _t = lt(
|
|
|
122
123
|
} else
|
|
123
124
|
n.push(e);
|
|
124
125
|
return { groupFlattenedOptions: n, groupSentinelMap: i };
|
|
125
|
-
}, [c, b]),
|
|
126
|
+
}, [c, b]), Je = r.useMemo(() => {
|
|
126
127
|
let t = q ?? c;
|
|
127
128
|
return S && t && t.length > 0 && (t = [w, ...t]), t;
|
|
128
|
-
}, [c, q, S, w]),
|
|
129
|
+
}, [c, q, S, w]), Qe = r.useMemo(() => {
|
|
129
130
|
const t = [];
|
|
130
131
|
if (b && I.size > 0)
|
|
131
132
|
for (const [l, n] of I)
|
|
@@ -143,7 +144,7 @@ const _t = lt(
|
|
|
143
144
|
I,
|
|
144
145
|
S,
|
|
145
146
|
w
|
|
146
|
-
]),
|
|
147
|
+
]), Ye = (t, l) => {
|
|
147
148
|
let n = t;
|
|
148
149
|
const i = l.option;
|
|
149
150
|
if (b && i && I.has(i.value)) {
|
|
@@ -162,22 +163,22 @@ const _t = lt(
|
|
|
162
163
|
(s) => s.value !== M && !e.some((f) => f.value === s.value)
|
|
163
164
|
));
|
|
164
165
|
}
|
|
165
|
-
Array.isArray(n) && (n = n.filter((e) => e.value !== M && !te(e))), z ||
|
|
166
|
+
Array.isArray(n) && (n = n.filter((e) => e.value !== M && !te(e))), z || Xe(n), A == null || A(n), !G && h.current && setTimeout(() => {
|
|
166
167
|
var e, o;
|
|
167
168
|
return (o = (e = h.current) == null ? void 0 : e.inputRef) == null ? void 0 : o.focus();
|
|
168
169
|
}, 0);
|
|
169
|
-
},
|
|
170
|
+
}, Ze = r.useCallback(
|
|
170
171
|
(t, l) => t.data.value === M || te(t.data) || !l ? !0 : String(t.label).toLowerCase().includes(l.toLowerCase()),
|
|
171
172
|
[]
|
|
172
|
-
), [W, X] = r.useState(!1),
|
|
173
|
+
), [W, X] = r.useState(!1), et = (t) => {
|
|
173
174
|
(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
|
-
},
|
|
175
|
+
}, tt = r.useCallback(() => {
|
|
175
176
|
X((t) => t && !1);
|
|
176
|
-
}, []),
|
|
177
|
-
(t) => /* @__PURE__ */ L(
|
|
177
|
+
}, []), ot = r.useCallback(
|
|
178
|
+
(t) => /* @__PURE__ */ L(It, { ...t, renderMessageListFooter: $ }),
|
|
178
179
|
[$]
|
|
179
|
-
),
|
|
180
|
-
Me ?
|
|
180
|
+
), nt = () => /* @__PURE__ */ L(
|
|
181
|
+
Me ? at : rt,
|
|
181
182
|
{
|
|
182
183
|
tagsDirection: V,
|
|
183
184
|
showSelectAll: x,
|
|
@@ -185,50 +186,50 @@ const _t = lt(
|
|
|
185
186
|
dropdownType: Oe,
|
|
186
187
|
renderValue: Ce,
|
|
187
188
|
keyboardMode: W,
|
|
188
|
-
exitKeyboardMode:
|
|
189
|
-
onKeyDown:
|
|
190
|
-
id:
|
|
189
|
+
exitKeyboardMode: tt,
|
|
190
|
+
onKeyDown: et,
|
|
191
|
+
id: Ue,
|
|
191
192
|
"aria-describedby": U,
|
|
192
193
|
autoFocus: Le,
|
|
193
194
|
ref: h,
|
|
194
195
|
instanceId: m,
|
|
195
196
|
className: "tedi-select__wrapper",
|
|
196
197
|
name: le,
|
|
197
|
-
options:
|
|
198
|
+
options: Je,
|
|
198
199
|
defaultOptions: ne,
|
|
199
|
-
value:
|
|
200
|
+
value: Qe,
|
|
200
201
|
defaultValue: T,
|
|
201
202
|
cacheOptions: $e,
|
|
202
|
-
onChange:
|
|
203
|
-
filterOption: S || b ?
|
|
203
|
+
onChange: Ye,
|
|
204
|
+
filterOption: S || b ? Ze : void 0,
|
|
204
205
|
onInputChange: ae,
|
|
205
|
-
onBlur:
|
|
206
|
-
softKeyboardSuppressed: !K && O &&
|
|
206
|
+
onBlur: qe,
|
|
207
|
+
softKeyboardSuppressed: !K && O && Be,
|
|
207
208
|
inputValue: ie,
|
|
208
|
-
inputId:
|
|
209
|
+
inputId: je,
|
|
209
210
|
loadOptions: ce,
|
|
210
211
|
isLoading: ue,
|
|
211
212
|
noOptionsMessage: he || (() => C("select.no-options")),
|
|
212
213
|
loadingMessage: Ie || (() => C("select.loading")),
|
|
213
214
|
classNamePrefix: "select",
|
|
214
215
|
components: {
|
|
215
|
-
ClearIndicator: (e) =>
|
|
216
|
-
DropdownIndicator: () =>
|
|
216
|
+
ClearIndicator: (e) => ft({ isClearIndicatorVisible: H, ...e }),
|
|
217
|
+
DropdownIndicator: () => gt({ iconName: se }),
|
|
217
218
|
IndicatorSeparator: () => null,
|
|
218
|
-
MenuPortal:
|
|
219
|
-
Menu:
|
|
220
|
-
MenuList:
|
|
221
|
-
Option: (e) =>
|
|
222
|
-
Control:
|
|
223
|
-
Input:
|
|
224
|
-
MultiValue: (e) =>
|
|
225
|
-
MultiValueRemove:
|
|
226
|
-
SingleValue:
|
|
227
|
-
Group:
|
|
228
|
-
GroupHeading: (e) =>
|
|
229
|
-
IndicatorsContainer:
|
|
230
|
-
ValueContainer:
|
|
231
|
-
LoadingIndicator:
|
|
219
|
+
MenuPortal: Ot,
|
|
220
|
+
Menu: ht,
|
|
221
|
+
MenuList: ot,
|
|
222
|
+
Option: (e) => Lt({ renderOption: ve, multiple: v, showRadioButtons: xe, ...e }),
|
|
223
|
+
Control: mt,
|
|
224
|
+
Input: Mt,
|
|
225
|
+
MultiValue: (e) => Ct({ isTagRemovable: Ne, tagsEllipsis: Pe, ...e }),
|
|
226
|
+
MultiValueRemove: wt,
|
|
227
|
+
SingleValue: Vt,
|
|
228
|
+
Group: St,
|
|
229
|
+
GroupHeading: (e) => bt({ optionGroupHeadingText: Fe, ...e }),
|
|
230
|
+
IndicatorsContainer: yt,
|
|
231
|
+
ValueContainer: At,
|
|
232
|
+
LoadingIndicator: vt
|
|
232
233
|
},
|
|
233
234
|
isDisabled: F,
|
|
234
235
|
isSearchable: O,
|
|
@@ -258,7 +259,7 @@ const _t = lt(
|
|
|
258
259
|
e[o] = typeof s == "string" ? () => s : s;
|
|
259
260
|
if (u) {
|
|
260
261
|
const o = e.control;
|
|
261
|
-
e.control = (s) => Y(o == null ? void 0 : o(s),
|
|
262
|
+
e.control = (s) => Y(o == null ? void 0 : o(s), dt["tedi-input-group__input"]);
|
|
262
263
|
}
|
|
263
264
|
return Object.keys(e).length > 0 ? e : void 0;
|
|
264
265
|
})(),
|
|
@@ -278,7 +279,7 @@ const _t = lt(
|
|
|
278
279
|
})
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
|
-
),
|
|
282
|
+
), lt = Y(
|
|
282
283
|
d["tedi-select"],
|
|
283
284
|
me,
|
|
284
285
|
{ [d["tedi-select--invalid"]]: be || (a == null ? void 0 : a.type) === "error" },
|
|
@@ -289,10 +290,10 @@ const _t = lt(
|
|
|
289
290
|
{ [d["tedi-select--clear-on-interaction"]]: H && Ae },
|
|
290
291
|
{ [d["tedi-select--disabled"]]: F }
|
|
291
292
|
);
|
|
292
|
-
return /* @__PURE__ */ Q("div", { "data-name": "select", className:
|
|
293
|
+
return /* @__PURE__ */ Q("div", { "data-name": "select", className: lt, onPointerDownCapture: ze, children: [
|
|
293
294
|
/* @__PURE__ */ Q("div", { className: d["tedi-select__inner"], children: [
|
|
294
295
|
!R && /* @__PURE__ */ L(
|
|
295
|
-
|
|
296
|
+
ct,
|
|
296
297
|
{
|
|
297
298
|
id: `${m}-input`,
|
|
298
299
|
label: re,
|
|
@@ -300,16 +301,17 @@ const _t = lt(
|
|
|
300
301
|
hideLabel: ge,
|
|
301
302
|
size: _,
|
|
302
303
|
renderWithoutLabel: Ee,
|
|
303
|
-
tooltip: Ge
|
|
304
|
+
tooltip: Ge,
|
|
305
|
+
labelProps: He
|
|
304
306
|
}
|
|
305
307
|
),
|
|
306
|
-
|
|
308
|
+
nt()
|
|
307
309
|
] }),
|
|
308
|
-
a && /* @__PURE__ */ L(
|
|
310
|
+
a && /* @__PURE__ */ L(it, { ...a, id: U })
|
|
309
311
|
] });
|
|
310
312
|
}
|
|
311
313
|
);
|
|
312
|
-
|
|
314
|
+
kt.displayName = "Select";
|
|
313
315
|
export {
|
|
314
|
-
|
|
316
|
+
kt as Select
|
|
315
317
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),B=require("../../../../../external/classnames/index.cjs.js"),e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),B=require("../../../../../external/classnames/index.cjs.js"),e=require("react"),de=require("../../overlays/tooltip/tooltip.cjs.js"),oe=require("../../overlays/tooltip/tooltip-content.cjs.js"),ue=require("../../overlays/tooltip/tooltip-trigger.cjs.js"),ce=require("../feedback-text/feedback-text.cjs.js"),pe=require("../form-label/form-label.cjs.js"),t=require("./slider.module.scss.cjs.js"),fe=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),F=e.forwardRef((m,M)=>{const{getCurrentBreakpointProps:P}=fe.useBreakpointProps(m.defaultServerBreakpoint),{id:V,name:E,label:h,hideLabel:R,labelProps:D,required:x,min:l=0,max:d=100,step:$=1,value:c,defaultValue:H,onChange:o,disabled:i=!1,invalid:O=!1,minLabel:p,maxLabel:U,showCurrentValue:f=!1,valueFormatter:_,tooltip:z=!0,addonRight:j,helper:r,className:A,"aria-label":G,"aria-labelledby":J,"aria-valuetext":K}=P(m),Q=e.useId(),b=V??`tedi-slider-${Q}`,k=r?r.id??`${b}-helper`:void 0,[W,X]=e.useState(H??l),u=Math.min(d,Math.max(l,c??W)),[Y,w]=e.useState(!1),[Z,L]=e.useState(!1),[s,C]=e.useState(!1),N=!!z&&!i,ee=N&&(Y||Z||s),ae=e.useCallback(()=>w(!0),[]),te=e.useCallback(()=>w(!1),[]),re=e.useCallback(()=>L(!0),[]),le=e.useCallback(()=>L(!1),[]),S=e.useRef(null),n=e.useCallback(()=>{S.current=null,C(!1)},[]);e.useEffect(()=>{if(s)return window.addEventListener("pointerup",n),window.addEventListener("pointercancel",n),()=>{window.removeEventListener("pointerup",n),window.removeEventListener("pointercancel",n)}},[s,n]);const ie=e.useCallback(g=>{i||(S.current=g.pointerId,C(!0))},[i]),se=e.useCallback(g=>{const y=Number(g.target.value);c===void 0&&X(y),o==null||o(y)},[o,c]),T=O||(r==null?void 0:r.type)==="error",q=d===l?0:(u-l)/(d-l)*100,I=_?_(u):u,v=f?I:U,ne=B.default(t.default["tedi-slider"],{[t.default["tedi-slider--disabled"]]:i,[t.default["tedi-slider--invalid"]]:T,[t.default["tedi-slider--dragging"]]:s&&!i},A);return a.jsxs("div",{"data-name":"slider",className:ne,children:[h&&a.jsx(pe.FormLabel,{id:b,label:h,required:x,hideLabel:R,labelProps:D}),a.jsxs("div",{className:t.default["tedi-slider__container"],children:[a.jsxs("div",{className:t.default["tedi-slider__track-row"],children:[p!=null&&a.jsx("span",{className:t.default["tedi-slider__range-label"],"aria-hidden":"true",children:p}),a.jsxs("div",{className:t.default["tedi-slider__track"],style:{"--tedi-slider-progress":`${q}%`,"--tedi-slider-progress-ratio":`${q/100}`},children:[a.jsx("input",{ref:M,id:b,name:E,type:"range",min:l,max:d,step:$,value:u,disabled:i,required:x,"aria-invalid":T?"true":void 0,"aria-describedby":k,"aria-label":G,"aria-labelledby":J,"aria-valuetext":K,onChange:se,onMouseEnter:ae,onMouseLeave:te,onPointerDown:ie,onFocus:re,onBlur:le,className:B.default(t.default["tedi-slider__input"],{[t.default["tedi-slider__input--dragging"]]:s})}),N&&a.jsxs(de.Tooltip,{open:ee,onToggle:()=>{},focusManager:{returnFocus:!1,initialFocus:-1},placement:"top",trackReferencePosition:!0,children:[a.jsx(ue.TooltipTrigger,{children:a.jsx("span",{className:t.default["tedi-slider__thumb-anchor"],"aria-hidden":"true",tabIndex:-1})}),a.jsx(oe.TooltipContent,{children:I})]})]}),v!=null&&a.jsx("span",{className:t.default["tedi-slider__range-label"],"aria-hidden":f?void 0:"true","aria-live":f?"polite":void 0,children:v})]}),j&&a.jsx("div",{className:t.default["tedi-slider__addon"],children:j})]}),r&&a.jsx(ce.FeedbackText,{...r,id:k})]})});F.displayName="Slider";exports.Slider=F;
|