@tedi-design-system/react 16.0.0-rc.14 → 16.0.0-rc.15
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/choice-group/choice-group.cjs.js +1 -1
- package/src/tedi/components/form/choice-group/choice-group.es.js +44 -44
- 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 +75 -64
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.module.scss.es.js +3 -2
package/package.json
CHANGED
|
@@ -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 o=require("react/jsx-runtime"),_=require("../../../../../external/classnames/index.cjs.js"),h=require("react"),Z=require("../feedback-text/feedback-text.cjs.js"),ee=require("../form-label/form-label.cjs.js"),te=require("../checkbox/checkbox.cjs.js"),j=require("./choice-group.module.scss.cjs.js"),re=require("./choice-group-context.cjs.js"),N=require("./components/choice-group-item/choice-group-item.cjs.js"),B=require("../../../helpers/hooks/use-breakpoint.cjs.js"),ne=require("../../../providers/label-provider/use-labels.cjs.js"),oe=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),F=require("../../layout/grid/row.cjs.js"),ie=require("../../layout/grid/col.cjs.js"),v=f=>{const{getLabel:m}=ne.useLabels(),I=B.useBreakpoint(f.defaultServerBreakpoint),{getCurrentBreakpointProps:R}=oe.useBreakpointProps(f.defaultServerBreakpoint),{id:d,className:T,label:p,required:H,helper:u,items:n,variant:k="default",direction:C=k==="default"||B.isBreakpointBelow(I,"md")?"column":"row",rowProps:b,name:S,inputType:i="radio",value:G,defaultValue:w,onChange:a,hideLabel:P,indeterminateCheck:s,indeterminateCheckProps:x={},color:E,layout:y="separated",showIndicator:$,...O}=R(f),{...W}=x,X=(x==null?void 0:x.indented)??!0,L=(u==null?void 0:u.id)??`${d}-helper`,M=s&&i==="checkbox",[Y,A]=h.useState(()=>{if(w)return w;if(i==="radio"){const e=n.find(l=>l.defaultChecked);return e?e.value:null}return i==="checkbox"?n.filter(e=>e.defaultChecked).map(e=>e.value):null}),q=(e=f.value)=>!!a&&typeof e<"u",r=q(G)?G:Y,g=h.useMemo(()=>(r==null?void 0:r.length)===0,[r==null?void 0:r.length]),c=h.useMemo(()=>{var e;return(r==null?void 0:r.length)===((e=n==null?void 0:n.filter(l=>!l.disabled))==null?void 0:e.length)},[r==null?void 0:r.length,n]),z=h.useMemo(()=>!g&&!c,[c,g]),D=h.useMemo(()=>{const e=c?"all":g?"none":"some";return typeof s=="string"?s:typeof s=="function"?s(e):s?m(e==="all"?"table.filter.remove-all":"table.filter.select-all"):""},[m,s,c,g]),J={name:S,inputType:i,onChange:(e,l)=>{let t=r;i==="checkbox"&&t?t=l?Array.isArray(t)?[...t,e]:[e]:Array.isArray(t)?t.filter(V=>V!==e):t:t=e,q()||A(Array.isArray(t)?[...t]:t),a==null||a(t)},currentValue:r},K=_.default(j.default["tedi-choice-group"],T),Q=_.default(j.default["tedi-choice-group__inner"],b==null?void 0:b.className,{[j.default["tedi-choice-group__inner--indented"]]:M&&X}),U=()=>{var l;const e=c?[]:(l=n==null?void 0:n.filter(t=>!t.disabled))==null?void 0:l.map(t=>t.value);q()||A([...e]),a==null||a(e)};return o.jsx(re.ChoiceGroupContext.Provider,{value:J,children:o.jsxs("fieldset",{...O,className:K,id:d,name:S,"aria-describedby":L,children:[p&&typeof p=="string"?o.jsx(ee.FormLabel,{id:d,label:p,required:H,hideLabel:P,renderWithoutLabel:!0}):o.jsx("label",{htmlFor:d,children:p}),o.jsx(F.Row,{children:o.jsx(ie.Col,{children:n!=null&&n.length?o.jsxs(o.Fragment,{children:[M&&o.jsx(te.Checkbox,{id:`${d}-indeterminate`,value:"indeterminate",name:"indeterminate",...W,label:D,indeterminate:z,checked:c,onChange:U}),o.jsx(F.Row,{direction:C,gutterX:y==="segmented"?0:2,gutterY:y==="segmented"?0:1,gap:k==="default"&&(B.isBreakpointBelow(I,"md")||C==="row")?1:0,...b,className:Q,role:i==="radio"?"radiogroup":void 0,"aria-labelledby":i==="radio"?d:void 0,children:n.map(e=>o.jsx(N.ChoiceGroupItem,{...e,color:E,variant:k,type:i,layout:y,showIndicator:$,direction:C},e.id))})]}):o.jsx("p",{children:m("table.filter.no-options")})})}),u&&o.jsx(Z.FeedbackText,{...u,id:L})]})})};v.Item=N.ChoiceGroupItem;exports.ChoiceGroup=v;exports.default=v;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
1
|
+
import { jsx as n, jsxs as w, Fragment as Z } from "react/jsx-runtime";
|
|
2
2
|
import F from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import
|
|
3
|
+
import k, { useState as ee } from "react";
|
|
4
4
|
import { FeedbackText as te } from "../feedback-text/feedback-text.es.js";
|
|
5
5
|
import { FormLabel as re } from "../form-label/form-label.es.js";
|
|
6
6
|
import { Checkbox as oe } from "../checkbox/checkbox.es.js";
|
|
@@ -8,68 +8,68 @@ import I from "./choice-group.module.scss.es.js";
|
|
|
8
8
|
import { ChoiceGroupContext as ne } from "./choice-group-context.es.js";
|
|
9
9
|
import { ChoiceGroupItem as j } from "./components/choice-group-item/choice-group-item.es.js";
|
|
10
10
|
import { useBreakpoint as ie, isBreakpointBelow as G } from "../../../helpers/hooks/use-breakpoint.es.js";
|
|
11
|
-
import { useLabels as
|
|
12
|
-
import { useBreakpointProps as
|
|
11
|
+
import { useLabels as ae } from "../../../providers/label-provider/use-labels.es.js";
|
|
12
|
+
import { useBreakpointProps as le } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
13
13
|
import { Row as H } from "../../layout/grid/row.es.js";
|
|
14
14
|
import { Col as de } from "../../layout/grid/col.es.js";
|
|
15
|
-
const se = (
|
|
16
|
-
const { getLabel:
|
|
15
|
+
const se = (f) => {
|
|
16
|
+
const { getLabel: u } = ae(), B = ie(f.defaultServerBreakpoint), { getCurrentBreakpointProps: E } = le(f.defaultServerBreakpoint), {
|
|
17
17
|
id: s,
|
|
18
18
|
className: R,
|
|
19
|
-
label:
|
|
19
|
+
label: p,
|
|
20
20
|
required: T,
|
|
21
21
|
helper: m,
|
|
22
22
|
items: o,
|
|
23
|
-
variant:
|
|
24
|
-
direction:
|
|
25
|
-
rowProps:
|
|
23
|
+
variant: y = "default",
|
|
24
|
+
direction: C = y === "default" || G(B, "md") ? "column" : "row",
|
|
25
|
+
rowProps: h,
|
|
26
26
|
name: S,
|
|
27
27
|
inputType: i = "radio",
|
|
28
|
-
value:
|
|
29
|
-
defaultValue:
|
|
30
|
-
onChange:
|
|
28
|
+
value: A,
|
|
29
|
+
defaultValue: L,
|
|
30
|
+
onChange: l,
|
|
31
31
|
hideLabel: $,
|
|
32
32
|
indeterminateCheck: d,
|
|
33
|
-
indeterminateCheckProps:
|
|
33
|
+
indeterminateCheckProps: b = {},
|
|
34
34
|
color: q,
|
|
35
|
-
layout: x,
|
|
35
|
+
layout: x = "separated",
|
|
36
36
|
showIndicator: P,
|
|
37
37
|
...W
|
|
38
|
-
} = E(
|
|
39
|
-
if (
|
|
38
|
+
} = E(f), { ...X } = b, Y = (b == null ? void 0 : b.indented) ?? !0, M = (m == null ? void 0 : m.id) ?? `${s}-helper`, N = d && i === "checkbox", [z, _] = ee(() => {
|
|
39
|
+
if (L) return L;
|
|
40
40
|
if (i === "radio") {
|
|
41
|
-
const e = o.find((
|
|
41
|
+
const e = o.find((a) => a.defaultChecked);
|
|
42
42
|
return e ? e.value : null;
|
|
43
43
|
}
|
|
44
44
|
return i === "checkbox" ? o.filter((e) => e.defaultChecked).map((e) => e.value) : null;
|
|
45
|
-
}), v = (e =
|
|
45
|
+
}), v = (e = f.value) => !!l && typeof e < "u", r = v(A) ? A : z, g = k.useMemo(() => (r == null ? void 0 : r.length) === 0, [r == null ? void 0 : r.length]), c = k.useMemo(
|
|
46
46
|
() => {
|
|
47
47
|
var e;
|
|
48
|
-
return (r == null ? void 0 : r.length) === ((e = o == null ? void 0 : o.filter((
|
|
48
|
+
return (r == null ? void 0 : r.length) === ((e = o == null ? void 0 : o.filter((a) => !a.disabled)) == null ? void 0 : e.length);
|
|
49
49
|
},
|
|
50
50
|
[r == null ? void 0 : r.length, o]
|
|
51
|
-
), D =
|
|
52
|
-
const e = c ? "all" :
|
|
53
|
-
return typeof d == "string" ? d : typeof d == "function" ? d(e) : d ?
|
|
54
|
-
}, [
|
|
51
|
+
), D = k.useMemo(() => !g && !c, [c, g]), J = k.useMemo(() => {
|
|
52
|
+
const e = c ? "all" : g ? "none" : "some";
|
|
53
|
+
return typeof d == "string" ? d : typeof d == "function" ? d(e) : d ? u(e === "all" ? "table.filter.remove-all" : "table.filter.select-all") : "";
|
|
54
|
+
}, [u, d, c, g]), K = {
|
|
55
55
|
name: S,
|
|
56
56
|
inputType: i,
|
|
57
|
-
onChange: (e,
|
|
57
|
+
onChange: (e, a) => {
|
|
58
58
|
let t = r;
|
|
59
|
-
i === "checkbox" && t ? t =
|
|
59
|
+
i === "checkbox" && t ? t = a ? Array.isArray(t) ? [...t, e] : [e] : Array.isArray(t) ? t.filter((V) => V !== e) : t : t = e, v() || _(Array.isArray(t) ? [...t] : t), l == null || l(t);
|
|
60
60
|
},
|
|
61
61
|
currentValue: r
|
|
62
|
-
}, O = F(I["tedi-choice-group"], R), Q = F(I["tedi-choice-group__inner"],
|
|
63
|
-
[I["tedi-choice-group__inner--indented"]]:
|
|
62
|
+
}, O = F(I["tedi-choice-group"], R), Q = F(I["tedi-choice-group__inner"], h == null ? void 0 : h.className, {
|
|
63
|
+
[I["tedi-choice-group__inner--indented"]]: N && Y
|
|
64
64
|
}), U = () => {
|
|
65
|
-
var
|
|
66
|
-
const e = c ? [] : (
|
|
67
|
-
v() ||
|
|
65
|
+
var a;
|
|
66
|
+
const e = c ? [] : (a = o == null ? void 0 : o.filter((t) => !t.disabled)) == null ? void 0 : a.map((t) => t.value);
|
|
67
|
+
v() || _([...e]), l == null || l(e);
|
|
68
68
|
};
|
|
69
|
-
return /* @__PURE__ */ n(ne.Provider, { value: K, children: /* @__PURE__ */
|
|
70
|
-
|
|
71
|
-
/* @__PURE__ */ n(H, { children: /* @__PURE__ */ n(de, { children: o != null && o.length ? /* @__PURE__ */
|
|
72
|
-
|
|
69
|
+
return /* @__PURE__ */ n(ne.Provider, { value: K, children: /* @__PURE__ */ w("fieldset", { ...W, className: O, id: s, name: S, "aria-describedby": M, children: [
|
|
70
|
+
p && typeof p == "string" ? /* @__PURE__ */ n(re, { id: s, label: p, required: T, hideLabel: $, renderWithoutLabel: !0 }) : /* @__PURE__ */ n("label", { htmlFor: s, children: p }),
|
|
71
|
+
/* @__PURE__ */ n(H, { children: /* @__PURE__ */ n(de, { children: o != null && o.length ? /* @__PURE__ */ w(Z, { children: [
|
|
72
|
+
N && /* @__PURE__ */ n(
|
|
73
73
|
oe,
|
|
74
74
|
{
|
|
75
75
|
id: `${s}-indeterminate`,
|
|
@@ -85,11 +85,11 @@ const se = (u) => {
|
|
|
85
85
|
/* @__PURE__ */ n(
|
|
86
86
|
H,
|
|
87
87
|
{
|
|
88
|
-
direction:
|
|
89
|
-
gutterX:
|
|
90
|
-
gutterY:
|
|
91
|
-
gap:
|
|
92
|
-
...
|
|
88
|
+
direction: C,
|
|
89
|
+
gutterX: x === "segmented" ? 0 : 2,
|
|
90
|
+
gutterY: x === "segmented" ? 0 : 1,
|
|
91
|
+
gap: y === "default" && (G(B, "md") || C === "row") ? 1 : 0,
|
|
92
|
+
...h,
|
|
93
93
|
className: Q,
|
|
94
94
|
role: i === "radio" ? "radiogroup" : void 0,
|
|
95
95
|
"aria-labelledby": i === "radio" ? s : void 0,
|
|
@@ -98,18 +98,18 @@ const se = (u) => {
|
|
|
98
98
|
{
|
|
99
99
|
...e,
|
|
100
100
|
color: q,
|
|
101
|
-
variant:
|
|
101
|
+
variant: y,
|
|
102
102
|
type: i,
|
|
103
103
|
layout: x,
|
|
104
104
|
showIndicator: P,
|
|
105
|
-
direction:
|
|
105
|
+
direction: C
|
|
106
106
|
},
|
|
107
107
|
e.id
|
|
108
108
|
))
|
|
109
109
|
}
|
|
110
110
|
)
|
|
111
|
-
] }) : /* @__PURE__ */ n("p", { children:
|
|
112
|
-
m && /* @__PURE__ */ n(te, { ...m, id:
|
|
111
|
+
] }) : /* @__PURE__ */ n("p", { children: u("table.filter.no-options") }) }) }),
|
|
112
|
+
m && /* @__PURE__ */ n(te, { ...m, id: M })
|
|
113
113
|
] }) });
|
|
114
114
|
};
|
|
115
115
|
se.Item = j;
|
package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("../../../../../../../external/classnames/index.cjs.js"),R=require("react"),S=require("../../../checkbox/checkbox.cjs.js"),A=require("../../../feedback-text/feedback-text.cjs.js"),H=require("../../../radio/radio.cjs.js"),L=require("../../choice-group-context.cjs.js"),e=require("./choice-group-item.module.scss.cjs.js"),O=require("../../../../../helpers/hooks/use-breakpoint-props.cjs.js"),V=require("../../../../layout/grid/col.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("../../../../../../../external/classnames/index.cjs.js"),R=require("react"),S=require("../../../checkbox/checkbox.cjs.js"),A=require("../../../feedback-text/feedback-text.cjs.js"),H=require("../../../radio/radio.cjs.js"),L=require("../../choice-group-context.cjs.js"),e=require("./choice-group-item.module.scss.cjs.js"),O=require("../../../../../helpers/hooks/use-breakpoint-props.cjs.js"),V=require("../../../../layout/grid/col.cjs.js"),v=n=>{const{getCurrentBreakpointProps:_}=O.useBreakpointProps(n.defaultServerBreakpoint),{id:c,label:k,value:a,className:q,direction:m,disabled:d,colProps:N=m==="column"?{width:12}:{width:"auto"},onChange:p,hideLabel:I,helper:r,tooltip:B,type:u="radio",variant:s="default",color:$="primary",layout:G,showIndicator:C,justifyContent:x="start"}=_(n),{currentValue:l,name:b,onChange:f,inputType:P}=R.useContext(L.ChoiceGroupContext),i=Array.isArray(l)?l.includes(a):a===l,M=l===void 0?n.defaultChecked:i,y=(o,g)=>{f==null||f(o,g),p==null||p(o,g)},T=h.default(e.default[`tedi-choice-group-item--${G==="separated"?"separated":"segmented"}`],m&&e.default[`tedi-choice-group-item--${m}`]),w=h.default(e.default["tedi-choice-group-item"],e.default[`tedi-choice-group-item--${s}`],e.default[`tedi-choice-group-item--${s}-${$}`],C&&e.default["tedi-choice-group-item--indicator"],u&&e.default[`tedi-choice-group-item--${u}`],{[e.default["tedi-choice-group-item--disabled"]]:d},{[e.default["tedi-choice-group-item--checked"]]:i},{[`justify-content-${x}`]:x}),E=u==="radio"?H.Radio:S.Checkbox,F=o=>{var j;d||s!=="card"||o.target.closest("input, label")||(j=document.getElementById(c))==null||j.click()};return t.jsx(V.Col,{...N,className:T,children:t.jsx("div",{className:w,tabIndex:d?-1:0,onClick:F,role:u,"aria-checked":i,children:s==="default"||C?t.jsx(E,{id:c,label:k,value:a,name:b,className:h.default(e.default["tedi-choice-group-item__indicator"],q),disabled:d,checked:i,defaultChecked:M,onChange:y,hideLabel:I,helper:r?{...r,className:h.default(e.default["tedi-choice-group-item__feedback-text"],r.className)}:void 0,tooltip:B,"data-testid":"choice-group-item-indicator","aria-checked":i}):t.jsxs(t.Fragment,{children:[t.jsx("input",{id:c,value:a,name:b,type:P,disabled:d,checked:i,defaultChecked:l===void 0?n.defaultChecked:void 0,onChange:o=>{y(a,o.target.checked)},className:"visually-hidden",role:u==="radio"?"radio":void 0,"aria-checked":i,tabIndex:-1}),t.jsxs("label",{htmlFor:c,className:e.default["tedi-choice-group-item__label"],children:[k,r&&t.jsx(A.FeedbackText,{...r,id:c,className:e.default["tedi-choice-group-item__feedback-text"]})]})]})})})};exports.ChoiceGroupItem=v;exports.default=v;
|
package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, jsxs as _, Fragment as M } from "react/jsx-runtime";
|
|
2
2
|
import u from "../../../../../../../external/classnames/index.es.js";
|
|
3
3
|
import R from "react";
|
|
4
4
|
import { Checkbox as T } from "../../../checkbox/checkbox.es.js";
|
|
@@ -8,85 +8,96 @@ import { ChoiceGroupContext as S } from "../../choice-group-context.es.js";
|
|
|
8
8
|
import e from "./choice-group-item.module.scss.es.js";
|
|
9
9
|
import { useBreakpointProps as V } from "../../../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
10
10
|
import { Col as q } from "../../../../layout/grid/col.es.js";
|
|
11
|
-
const te = (
|
|
12
|
-
const { getCurrentBreakpointProps: v } = V(
|
|
11
|
+
const te = (s) => {
|
|
12
|
+
const { getCurrentBreakpointProps: v } = V(s.defaultServerBreakpoint), {
|
|
13
13
|
id: i,
|
|
14
14
|
label: k,
|
|
15
15
|
value: c,
|
|
16
|
-
className:
|
|
17
|
-
direction:
|
|
18
|
-
disabled:
|
|
19
|
-
colProps:
|
|
20
|
-
onChange:
|
|
21
|
-
hideLabel:
|
|
22
|
-
helper:
|
|
16
|
+
className: I,
|
|
17
|
+
direction: h,
|
|
18
|
+
disabled: r,
|
|
19
|
+
colProps: $ = h === "column" ? { width: 12 } : { width: "auto" },
|
|
20
|
+
onChange: p,
|
|
21
|
+
hideLabel: B,
|
|
22
|
+
helper: a,
|
|
23
23
|
tooltip: j,
|
|
24
|
-
type:
|
|
25
|
-
variant:
|
|
24
|
+
type: d = "radio",
|
|
25
|
+
variant: m = "default",
|
|
26
26
|
color: w = "primary",
|
|
27
27
|
layout: E,
|
|
28
28
|
showIndicator: C,
|
|
29
|
-
justifyContent:
|
|
30
|
-
} = v(
|
|
31
|
-
f == null || f(o, g),
|
|
29
|
+
justifyContent: b = "start"
|
|
30
|
+
} = v(s), { currentValue: n, name: y, onChange: f, inputType: F } = R.useContext(S), t = Array.isArray(n) ? n.includes(c) : c === n, G = n === void 0 ? s.defaultChecked : t, x = (o, g) => {
|
|
31
|
+
f == null || f(o, g), p == null || p(o, g);
|
|
32
32
|
}, P = u(
|
|
33
33
|
e[`tedi-choice-group-item--${E === "separated" ? "separated" : "segmented"}`],
|
|
34
|
-
|
|
34
|
+
h && e[`tedi-choice-group-item--${h}`]
|
|
35
35
|
), A = u(
|
|
36
36
|
e["tedi-choice-group-item"],
|
|
37
|
-
e[`tedi-choice-group-item--${
|
|
38
|
-
e[`tedi-choice-group-item--${
|
|
37
|
+
e[`tedi-choice-group-item--${m}`],
|
|
38
|
+
e[`tedi-choice-group-item--${m}-${w}`],
|
|
39
39
|
C && e["tedi-choice-group-item--indicator"],
|
|
40
|
-
|
|
41
|
-
{ [e["tedi-choice-group-item--disabled"]]:
|
|
40
|
+
d && e[`tedi-choice-group-item--${d}`],
|
|
41
|
+
{ [e["tedi-choice-group-item--disabled"]]: r },
|
|
42
42
|
{ [e["tedi-choice-group-item--checked"]]: t },
|
|
43
|
-
{ [`justify-content-${
|
|
43
|
+
{ [`justify-content-${b}`]: b }
|
|
44
44
|
);
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
m || s !== "card" || o.target.closest("input, label") || (N = document.getElementById(i)) == null || N.click();
|
|
48
|
-
}, role: a, "aria-checked": t, children: s === "default" || C ? /* @__PURE__ */ n(
|
|
49
|
-
a === "radio" ? L : T,
|
|
45
|
+
return /* @__PURE__ */ l(q, { ...$, className: P, children: /* @__PURE__ */ l(
|
|
46
|
+
"div",
|
|
50
47
|
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
48
|
+
className: A,
|
|
49
|
+
tabIndex: r ? -1 : 0,
|
|
50
|
+
onClick: (o) => {
|
|
51
|
+
var N;
|
|
52
|
+
r || m !== "card" || o.target.closest("input, label") || (N = document.getElementById(i)) == null || N.click();
|
|
53
|
+
},
|
|
54
|
+
role: d,
|
|
55
|
+
"aria-checked": t,
|
|
56
|
+
children: m === "default" || C ? /* @__PURE__ */ l(
|
|
57
|
+
d === "radio" ? L : T,
|
|
58
|
+
{
|
|
59
|
+
id: i,
|
|
60
|
+
label: k,
|
|
61
|
+
value: c,
|
|
62
|
+
name: y,
|
|
63
|
+
className: u(e["tedi-choice-group-item__indicator"], I),
|
|
64
|
+
disabled: r,
|
|
65
|
+
checked: t,
|
|
66
|
+
defaultChecked: G,
|
|
67
|
+
onChange: x,
|
|
68
|
+
hideLabel: B,
|
|
69
|
+
helper: a ? { ...a, className: u(e["tedi-choice-group-item__feedback-text"], a.className) } : void 0,
|
|
70
|
+
tooltip: j,
|
|
71
|
+
"data-testid": "choice-group-item-indicator",
|
|
72
|
+
"aria-checked": t
|
|
73
|
+
}
|
|
74
|
+
) : /* @__PURE__ */ _(M, { children: [
|
|
75
|
+
/* @__PURE__ */ l(
|
|
76
|
+
"input",
|
|
77
|
+
{
|
|
78
|
+
id: i,
|
|
79
|
+
value: c,
|
|
80
|
+
name: y,
|
|
81
|
+
type: F,
|
|
82
|
+
disabled: r,
|
|
83
|
+
checked: t,
|
|
84
|
+
defaultChecked: n === void 0 ? s.defaultChecked : void 0,
|
|
85
|
+
onChange: (o) => {
|
|
86
|
+
x(c, o.target.checked);
|
|
87
|
+
},
|
|
88
|
+
className: "visually-hidden",
|
|
89
|
+
role: d === "radio" ? "radio" : void 0,
|
|
90
|
+
"aria-checked": t,
|
|
91
|
+
tabIndex: -1
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ _("label", { htmlFor: i, className: e["tedi-choice-group-item__label"], children: [
|
|
95
|
+
k,
|
|
96
|
+
a && /* @__PURE__ */ l(H, { ...a, id: i, className: e["tedi-choice-group-item__feedback-text"] })
|
|
97
|
+
] })
|
|
98
|
+
] })
|
|
65
99
|
}
|
|
66
|
-
)
|
|
67
|
-
/* @__PURE__ */ n(
|
|
68
|
-
"input",
|
|
69
|
-
{
|
|
70
|
-
id: i,
|
|
71
|
-
value: c,
|
|
72
|
-
name: b,
|
|
73
|
-
type: F,
|
|
74
|
-
disabled: m,
|
|
75
|
-
checked: t,
|
|
76
|
-
defaultChecked: d === void 0 ? l.defaultChecked : void 0,
|
|
77
|
-
onChange: (o) => {
|
|
78
|
-
y(c, o.target.checked);
|
|
79
|
-
},
|
|
80
|
-
className: e["tedi-choice-group-item__input"],
|
|
81
|
-
role: a === "radio" ? "radio" : void 0,
|
|
82
|
-
"aria-checked": t
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
/* @__PURE__ */ x("label", { htmlFor: i, className: e["tedi-choice-group-item__label"], children: [
|
|
86
|
-
k,
|
|
87
|
-
r && /* @__PURE__ */ n(H, { ...r, id: i, className: e["tedi-choice-group-item__feedback-text"] })
|
|
88
|
-
] })
|
|
89
|
-
] }) }) });
|
|
100
|
+
) });
|
|
90
101
|
};
|
|
91
102
|
export {
|
|
92
103
|
te as ChoiceGroupItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-choice-group-item":"tedi-choice-group-item-427c7527","tedi-choice-group-item--card":"tedi-choice-group-item--card-8fc3694a","tedi-choice-group-item--card__feedback-text":"tedi-choice-group-item--card__feedback-text-f124d2c4","tedi-choice-group-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-choice-group-item":"tedi-choice-group-item-427c7527","tedi-choice-group-item--card":"tedi-choice-group-item--card-8fc3694a","tedi-choice-group-item--card__feedback-text":"tedi-choice-group-item--card__feedback-text-f124d2c4","tedi-choice-group-item--card__label":"tedi-choice-group-item--card__label-3706d8e1","tedi-choice-group-item__input":"tedi-choice-group-item__input-7f8978bd","tedi-choice-group-item--disabled":"tedi-choice-group-item--disabled-9e588377","tedi-choice-group-item__feedback-text":"tedi-choice-group-item__feedback-text-c4f883af","tedi-choice-group-item--card-primary":"tedi-choice-group-item--card-primary-17806082","tedi-choice-group-item--checked":"tedi-choice-group-item--checked-add34e3f","tedi-choice-group-item__indicator":"tedi-choice-group-item__indicator-72d3142f","tedi-choice-group-item__label":"tedi-choice-group-item__label-aa5aae03","tedi-choice-group-item--card-secondary":"tedi-choice-group-item--card-secondary-1ee614f7","tedi-choice-group-item--segmented":"tedi-choice-group-item--segmented-8d812ae2","tedi-choice-group-item--column":"tedi-choice-group-item--column-09c83229","tedi-choice-group-item--column-reverse":"tedi-choice-group-item--column-reverse-c38b79f2","tedi-choice-group-item--row":"tedi-choice-group-item--row-dd5ba42c","tedi-choice-group-item--row-reverse":"tedi-choice-group-item--row-reverse-ad23204f","tedi-choice-group-item--separated":"tedi-choice-group-item--separated-e086464b","tedi-choice-group-item--radio":"tedi-choice-group-item--radio-2766bb38"};exports.default=e;
|
|
@@ -2,19 +2,20 @@ const e = {
|
|
|
2
2
|
"tedi-choice-group-item": "tedi-choice-group-item-427c7527",
|
|
3
3
|
"tedi-choice-group-item--card": "tedi-choice-group-item--card-8fc3694a",
|
|
4
4
|
"tedi-choice-group-item--card__feedback-text": "tedi-choice-group-item--card__feedback-text-f124d2c4",
|
|
5
|
-
"tedi-choice-group-item__input": "tedi-choice-group-item__input-7f8978bd",
|
|
6
5
|
"tedi-choice-group-item--card__label": "tedi-choice-group-item--card__label-3706d8e1",
|
|
6
|
+
"tedi-choice-group-item__input": "tedi-choice-group-item__input-7f8978bd",
|
|
7
7
|
"tedi-choice-group-item--disabled": "tedi-choice-group-item--disabled-9e588377",
|
|
8
8
|
"tedi-choice-group-item__feedback-text": "tedi-choice-group-item__feedback-text-c4f883af",
|
|
9
9
|
"tedi-choice-group-item--card-primary": "tedi-choice-group-item--card-primary-17806082",
|
|
10
|
-
"tedi-choice-group-item--checkbox": "tedi-choice-group-item--checkbox-d8e2518f",
|
|
11
10
|
"tedi-choice-group-item--checked": "tedi-choice-group-item--checked-add34e3f",
|
|
12
11
|
"tedi-choice-group-item__indicator": "tedi-choice-group-item__indicator-72d3142f",
|
|
13
12
|
"tedi-choice-group-item__label": "tedi-choice-group-item__label-aa5aae03",
|
|
14
13
|
"tedi-choice-group-item--card-secondary": "tedi-choice-group-item--card-secondary-1ee614f7",
|
|
15
14
|
"tedi-choice-group-item--segmented": "tedi-choice-group-item--segmented-8d812ae2",
|
|
16
15
|
"tedi-choice-group-item--column": "tedi-choice-group-item--column-09c83229",
|
|
16
|
+
"tedi-choice-group-item--column-reverse": "tedi-choice-group-item--column-reverse-c38b79f2",
|
|
17
17
|
"tedi-choice-group-item--row": "tedi-choice-group-item--row-dd5ba42c",
|
|
18
|
+
"tedi-choice-group-item--row-reverse": "tedi-choice-group-item--row-reverse-ad23204f",
|
|
18
19
|
"tedi-choice-group-item--separated": "tedi-choice-group-item--separated-e086464b",
|
|
19
20
|
"tedi-choice-group-item--radio": "tedi-choice-group-item--radio-2766bb38"
|
|
20
21
|
};
|