asma-ui-core 3.81.2 → 3.81.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/custom/pathfinder-card/PathfinderCard.js +1 -0
- package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +13 -13
- package/dist/components/miscellaneous/StyledFormControlLabel.js +21 -19
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerFooter.js +19 -17
- package/dist/datetime/components/time-picker/components/TimePickerPanel.js +12 -10
- package/dist/src/components/miscellaneous/StyledFormControlLabel.d.ts +10 -0
- package/dist/src/table/shared-components/StyledCheckbox.d.ts +9 -0
- package/dist/table/components/columns/selectColumn.js +31 -33
- package/dist/table/components/columns/showTextColumn.js +13 -12
- package/dist/table/shared-components/StyledCheckbox.js +59 -53
- package/package.json +1 -1
|
@@ -153,6 +153,7 @@ function Y({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
|
|
|
153
153
|
}),
|
|
154
154
|
/* @__PURE__ */ e("div", {
|
|
155
155
|
"aria-hidden": !0,
|
|
156
|
+
inert: "true",
|
|
156
157
|
className: h.measureLayer,
|
|
157
158
|
children: /* @__PURE__ */ I("div", {
|
|
158
159
|
className: h.measureRow,
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as o } from "../../../helpers/cn.js";
|
|
2
2
|
import { StyledChip as f } from "../chip/StyledChip.js";
|
|
3
3
|
import { StyledCheckbox as v } from "../../inputs/checkbox/base-ui/StyledCheckbox.js";
|
|
4
4
|
import { StyledRadio as u } from "../../inputs/radio-button/base-ui/StyledRadio.js";
|
|
5
5
|
import i from "./StyledInteractiveChip.module.js";
|
|
6
6
|
import { forwardRef as x } from "react";
|
|
7
|
-
import { jsx as
|
|
8
|
-
var y = "[&[data-testid][role=button]]:border-2 [&[data-testid][role=button]]:border-gama-400 [&[data-testid][role=button]]:bg-gama-25", S = { paddingLeft: "6px" }, h = x(({ type:
|
|
9
|
-
const
|
|
7
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
+
var y = "[&[data-testid][role=button]]:border-2 [&[data-testid][role=button]]:border-gama-400 [&[data-testid][role=button]]:bg-gama-25", S = { paddingLeft: "6px" }, h = x(({ type: l = "checkbox", checked: t, size: d = "small", ariaLabel: n, ...e }, c) => {
|
|
9
|
+
const a = l === "checkbox", m = n ?? (typeof e.label == "string" ? e.label : void 0), s = !e.readOnly && !a && !!t, b = a ? /* @__PURE__ */ r(v, {
|
|
10
10
|
dataTest: e.dataTest,
|
|
11
11
|
disableRipple: !0,
|
|
12
12
|
checked: t,
|
|
13
|
-
size:
|
|
13
|
+
size: d,
|
|
14
14
|
readOnly: e.readOnly,
|
|
15
15
|
decorative: !0,
|
|
16
|
-
className:
|
|
17
|
-
}) : /* @__PURE__ */
|
|
16
|
+
className: o("pointer-events-none", i.control)
|
|
17
|
+
}) : /* @__PURE__ */ r(u, {
|
|
18
18
|
dataTest: e.dataTest,
|
|
19
19
|
checked: t,
|
|
20
|
-
size:
|
|
20
|
+
size: d,
|
|
21
21
|
decorative: !0,
|
|
22
|
-
className:
|
|
22
|
+
className: o("pointer-events-none", i.control)
|
|
23
23
|
});
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ r(f, {
|
|
25
25
|
ref: c,
|
|
26
26
|
"aria-label": m,
|
|
27
|
-
role:
|
|
27
|
+
role: l,
|
|
28
28
|
"aria-checked": !!t,
|
|
29
|
-
"aria-readonly": e.readOnly,
|
|
29
|
+
"aria-readonly": a ? e.readOnly : void 0,
|
|
30
30
|
avatar: b,
|
|
31
31
|
clickable: !0,
|
|
32
32
|
tabIndex: 0,
|
|
33
33
|
...e,
|
|
34
|
-
className:
|
|
34
|
+
className: o(s && y, e.className),
|
|
35
35
|
sx: {
|
|
36
36
|
...S,
|
|
37
37
|
...e.sx
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { cloneElement as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
1
|
+
import { cn as o } from "../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as h } from "../../helpers/sx.js";
|
|
3
|
+
import { cloneElement as g, isValidElement as t, useId as C } from "react";
|
|
4
|
+
import { jsx as y, jsxs as A } from "react/jsx-runtime";
|
|
5
|
+
var E = {
|
|
6
6
|
end: "flex-row",
|
|
7
7
|
start: "flex-row-reverse",
|
|
8
8
|
top: "flex-col-reverse",
|
|
9
9
|
bottom: "flex-col"
|
|
10
|
-
}, k = ({ control:
|
|
11
|
-
const
|
|
12
|
-
checked:
|
|
13
|
-
onChange:
|
|
14
|
-
disabled:
|
|
15
|
-
name:
|
|
16
|
-
value:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
}, k = ({ control: l, label: a, checked: i, disabled: d, name: m, value: c, labelPlacement: b = "end", className: f, sx: x, onChange: p }) => {
|
|
11
|
+
const e = t(l) ? l.props : {}, s = d ?? e.disabled ?? !1, r = C(), u = e["aria-label"] != null || e["aria-labelledby"] != null, n = t(l) && a != null && !u, v = t(l) ? g(l, {
|
|
12
|
+
checked: e.checked ?? i,
|
|
13
|
+
onChange: e.onChange ?? p,
|
|
14
|
+
disabled: s,
|
|
15
|
+
name: e.name ?? m,
|
|
16
|
+
value: e.value ?? c,
|
|
17
|
+
...n ? { "aria-labelledby": r } : {}
|
|
18
|
+
}) : l;
|
|
19
|
+
return /* @__PURE__ */ A("label", {
|
|
20
|
+
className: o("m-0 inline-flex items-center gap-2 align-middle text-delta-800", s ? "cursor-default" : "cursor-pointer", E[b], f),
|
|
20
21
|
style: {
|
|
21
22
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
22
|
-
...
|
|
23
|
+
...h(x)
|
|
23
24
|
},
|
|
24
|
-
children: [
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
children: [v, a != null && /* @__PURE__ */ y("span", {
|
|
26
|
+
id: n ? r : void 0,
|
|
27
|
+
className: o("text-sm leading-5 tracking-[0.00938em]", s && "text-delta-300"),
|
|
28
|
+
children: a
|
|
27
29
|
})]
|
|
28
30
|
});
|
|
29
31
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ChevronRightIcon as f } from "../../../../components/icons/chevron-right-icon/ChevronRightIcon.js";
|
|
2
2
|
import { ChevronLeftIcon as u } from "../../../../components/icons/chevron-left-icon/ChevronLeftIcon.js";
|
|
3
|
-
import { StyledButton as
|
|
3
|
+
import { StyledButton as a } from "../../../shared-components/button/StyledButton.js";
|
|
4
4
|
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
5
5
|
import { useNavigation as y } from "react-day-picker";
|
|
6
6
|
import { isDate as v, isValid as x } from "date-fns";
|
|
7
|
-
var j = ({ onClose: m, isNb:
|
|
8
|
-
const { nextMonth:
|
|
7
|
+
var j = ({ onClose: m, isNb: e, selected: i, removeSelection: h, setMonth: n, onClear: d, required: p }) => {
|
|
8
|
+
const { nextMonth: r, previousMonth: l } = y(), c = i == null ? !1 : Array.isArray(i) ? i.length > 0 : v(i) ? x(i) : typeof i == "object" ? Object.values(i).some(Boolean) : !0;
|
|
9
9
|
return /* @__PURE__ */ s("div", {
|
|
10
10
|
style: {
|
|
11
11
|
marginTop: "8px",
|
|
@@ -13,16 +13,16 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
|
|
|
13
13
|
justifyContent: "space-between"
|
|
14
14
|
},
|
|
15
15
|
children: [
|
|
16
|
-
/* @__PURE__ */ t(
|
|
16
|
+
/* @__PURE__ */ t(a, {
|
|
17
17
|
dataTest: "",
|
|
18
18
|
variant: "text",
|
|
19
19
|
onClick: (o) => {
|
|
20
|
-
d ? d() : h(o),
|
|
20
|
+
d ? d() : h(o), n(new Date(Date.now()));
|
|
21
21
|
},
|
|
22
22
|
size: "small",
|
|
23
23
|
disabled: !!p || !c,
|
|
24
24
|
style: { minWidth: "60px" },
|
|
25
|
-
children:
|
|
25
|
+
children: e ? "Nullstill" : "Clear"
|
|
26
26
|
}),
|
|
27
27
|
/* @__PURE__ */ s("div", {
|
|
28
28
|
style: {
|
|
@@ -30,13 +30,14 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
|
|
|
30
30
|
gap: 8
|
|
31
31
|
},
|
|
32
32
|
children: [
|
|
33
|
-
/* @__PURE__ */ t(
|
|
33
|
+
/* @__PURE__ */ t(a, {
|
|
34
34
|
dataTest: "",
|
|
35
|
+
"aria-label": e ? "Forrige maned" : "Previous month",
|
|
35
36
|
variant: "outlined",
|
|
36
37
|
size: "small",
|
|
37
|
-
disabled: !
|
|
38
|
+
disabled: !l,
|
|
38
39
|
onClick: () => {
|
|
39
|
-
|
|
40
|
+
l && n(l);
|
|
40
41
|
},
|
|
41
42
|
style: { minWidth: "25px" },
|
|
42
43
|
children: /* @__PURE__ */ t(u, {
|
|
@@ -44,22 +45,23 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
|
|
|
44
45
|
height: 20
|
|
45
46
|
})
|
|
46
47
|
}),
|
|
47
|
-
/* @__PURE__ */ t(
|
|
48
|
+
/* @__PURE__ */ t(a, {
|
|
48
49
|
dataTest: "",
|
|
49
50
|
size: "small",
|
|
50
51
|
onClick: () => {
|
|
51
|
-
|
|
52
|
+
n(new Date(Date.now()));
|
|
52
53
|
},
|
|
53
54
|
variant: "outlined",
|
|
54
|
-
children:
|
|
55
|
+
children: e ? "I dag" : "Today"
|
|
55
56
|
}),
|
|
56
|
-
/* @__PURE__ */ t(
|
|
57
|
+
/* @__PURE__ */ t(a, {
|
|
57
58
|
dataTest: "",
|
|
59
|
+
"aria-label": e ? "Neste maned" : "Next month",
|
|
58
60
|
variant: "outlined",
|
|
59
61
|
size: "small",
|
|
60
|
-
disabled: !
|
|
62
|
+
disabled: !r,
|
|
61
63
|
onClick: () => {
|
|
62
|
-
|
|
64
|
+
r && n(r);
|
|
63
65
|
},
|
|
64
66
|
style: { minWidth: "25px" },
|
|
65
67
|
children: /* @__PURE__ */ t(f, {
|
|
@@ -69,7 +71,7 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
|
|
|
69
71
|
})
|
|
70
72
|
]
|
|
71
73
|
}),
|
|
72
|
-
/* @__PURE__ */ t(
|
|
74
|
+
/* @__PURE__ */ t(a, {
|
|
73
75
|
dataTest: "",
|
|
74
76
|
variant: "contained",
|
|
75
77
|
size: "small",
|
|
@@ -77,7 +79,7 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
|
|
|
77
79
|
m?.(o, "backdropClick");
|
|
78
80
|
},
|
|
79
81
|
style: { minWidth: "60px" },
|
|
80
|
-
children:
|
|
82
|
+
children: e ? "Velg" : "Select"
|
|
81
83
|
})
|
|
82
84
|
]
|
|
83
85
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { StyledButton as e } from "../../../shared-components/button/StyledButton.js";
|
|
2
2
|
import { TimePickerBody as d } from "./TimePickerBody.js";
|
|
3
|
-
import { EraserIcon as
|
|
4
|
-
import { CheckIcon as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
var
|
|
7
|
-
dataTest: `${
|
|
3
|
+
import { EraserIcon as l } from "../../../shared-components/EraserIcon.js";
|
|
4
|
+
import { CheckIcon as s } from "../../../shared-components/CheckIcon.js";
|
|
5
|
+
import { Fragment as c, jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
var b = ({ dataTest: a, value: i, onSelect: m, handleClear: n, onConfirm: o }) => /* @__PURE__ */ r(c, { children: [/* @__PURE__ */ t(d, {
|
|
7
|
+
dataTest: `${a}-time-picker-body`,
|
|
8
8
|
value: i,
|
|
9
|
-
onSelect:
|
|
9
|
+
onSelect: m
|
|
10
10
|
}), /* @__PURE__ */ r("div", {
|
|
11
11
|
style: {
|
|
12
12
|
display: "flex",
|
|
@@ -17,21 +17,23 @@ var g = ({ dataTest: n, value: i, onSelect: a, handleClear: m, onConfirm: o }) =
|
|
|
17
17
|
children: [/* @__PURE__ */ t(e, {
|
|
18
18
|
dataTest: "time-picker-erase-button",
|
|
19
19
|
"data-testid": "time-picker-erase-button",
|
|
20
|
+
"aria-label": "Clear time",
|
|
20
21
|
variant: "text",
|
|
21
|
-
onClick:
|
|
22
|
+
onClick: n,
|
|
22
23
|
size: "small",
|
|
23
24
|
disabled: !i,
|
|
24
25
|
style: {
|
|
25
26
|
minWidth: "40px",
|
|
26
27
|
marginLeft: "10px"
|
|
27
28
|
},
|
|
28
|
-
children: /* @__PURE__ */ t(
|
|
29
|
+
children: /* @__PURE__ */ t(l, {
|
|
29
30
|
width: 24,
|
|
30
31
|
height: 24
|
|
31
32
|
})
|
|
32
33
|
}), /* @__PURE__ */ t(e, {
|
|
33
34
|
dataTest: "time-picker-confirm-button",
|
|
34
35
|
"data-testid": "time-picker-confirm-button",
|
|
36
|
+
"aria-label": "Confirm time",
|
|
35
37
|
variant: "contained",
|
|
36
38
|
size: "small",
|
|
37
39
|
onClick: o,
|
|
@@ -39,12 +41,12 @@ var g = ({ dataTest: n, value: i, onSelect: a, handleClear: m, onConfirm: o }) =
|
|
|
39
41
|
minWidth: "40px",
|
|
40
42
|
marginRight: "16px"
|
|
41
43
|
},
|
|
42
|
-
children: /* @__PURE__ */ t(
|
|
44
|
+
children: /* @__PURE__ */ t(s, {
|
|
43
45
|
width: 20,
|
|
44
46
|
height: 20
|
|
45
47
|
})
|
|
46
48
|
})]
|
|
47
49
|
})] });
|
|
48
50
|
export {
|
|
49
|
-
|
|
51
|
+
b as TimePickerPanel
|
|
50
52
|
};
|
|
@@ -17,5 +17,15 @@ export interface FormControlLabelProps {
|
|
|
17
17
|
* Native replacement for MUI `FormControlLabel` — a `<label>` that pairs a form control with a
|
|
18
18
|
* text label and forwards `checked`/`onChange`/`disabled`/`name`/`value` into the control (MUI's
|
|
19
19
|
* clone behavior). Public props preserved (DEC-003). TASK-203.
|
|
20
|
+
*
|
|
21
|
+
* The label text carries an `id` and is wired to the control with `aria-labelledby` (ASMA-8143).
|
|
22
|
+
* Without it every checkbox/radio placed here failed axe `label`: `StyledCheckbox`/`StyledRadio`
|
|
23
|
+
* render their own `<label>` around the real `<input>`, so nesting them inside this `<label>`
|
|
24
|
+
* produces nested labels, and axe resolves an input's implicit label with `closest('label')` — it
|
|
25
|
+
* finds the *inner* one, which holds only the visual box and no text. `<button role="switch">` had
|
|
26
|
+
* the same gap for `button-name`: `<label>` does not name a non-labelable element at all.
|
|
27
|
+
* `aria-labelledby` names the control from the same visible text either way, so the accessible name
|
|
28
|
+
* is unchanged and no markup moves. A control that already sets `aria-label`/`aria-labelledby`
|
|
29
|
+
* keeps its own.
|
|
20
30
|
*/
|
|
21
31
|
export declare const StyledFormControlLabel: ({ control, label, checked, disabled, name, value, labelPlacement, className, sx, onChange, }: FormControlLabelProps) => JSX.Element;
|
|
@@ -8,6 +8,15 @@ type StyledCheckboxProps = {
|
|
|
8
8
|
hideWrapper?: boolean;
|
|
9
9
|
className?: string;
|
|
10
10
|
onChange?: (event: ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Renders the identical visual box (same classes, same `data-*` state attributes — no visual
|
|
13
|
+
* change) with NO real `<input>` at all, for use as a pure state indicator inside a widget that
|
|
14
|
+
* already owns selection itself. A real `<input type="checkbox">` nested inside such a widget is
|
|
15
|
+
* an axe `nested-interactive` violation, and axe is explicit that `aria-hidden`/`tabIndex={-1}`
|
|
16
|
+
* do NOT satisfy the check — only removing the input does. Mirrors the `decorative` prop on the
|
|
17
|
+
* main `src/components/inputs/checkbox/base-ui/StyledCheckbox`.
|
|
18
|
+
*/
|
|
19
|
+
decorative?: boolean;
|
|
11
20
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size' | 'checked' | 'type'>;
|
|
12
21
|
export declare const IndeterminateIcon: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
13
22
|
export declare const CheckIcon: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { SELECT_COLUMN_ID as p } from "../../types.js";
|
|
2
|
-
import
|
|
3
|
-
import { StyledCheckbox as
|
|
2
|
+
import a from "../StyledTable.module.js";
|
|
3
|
+
import { StyledCheckbox as n } from "../../shared-components/StyledCheckbox.js";
|
|
4
4
|
import { StyledTooltip as u } from "../../shared-components/tooltip/index.js";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
}, i = (
|
|
9
|
-
|
|
10
|
-
}, w = (
|
|
6
|
+
var s = (o) => {
|
|
7
|
+
o.preventDefault(), o.stopPropagation();
|
|
8
|
+
}, i = (o, l) => {
|
|
9
|
+
o.key !== "Enter" && o.key !== " " || (o.preventDefault(), o.stopPropagation(), l());
|
|
10
|
+
}, w = (o) => o === "no" ? {
|
|
11
11
|
selectAll: "Velg alle rader",
|
|
12
12
|
selectRow: (l) => `Velg rad ${l}`
|
|
13
13
|
} : {
|
|
14
14
|
selectAll: "Select all rows",
|
|
15
15
|
selectRow: (l) => `Select row ${l}`
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
const
|
|
17
|
+
function x(o, l, d) {
|
|
18
|
+
const c = w(d);
|
|
19
19
|
return {
|
|
20
20
|
id: p,
|
|
21
21
|
minSize: 38,
|
|
@@ -24,18 +24,17 @@ function k(t, l, d) {
|
|
|
24
24
|
header: ({ table: e }) => /* @__PURE__ */ r("div", {
|
|
25
25
|
role: "checkbox",
|
|
26
26
|
tabIndex: 0,
|
|
27
|
-
"aria-label":
|
|
27
|
+
"aria-label": c.selectAll,
|
|
28
28
|
"aria-checked": e.getIsSomeRowsSelected() ? "mixed" : e.getIsAllRowsSelected(),
|
|
29
|
-
className:
|
|
29
|
+
className: a["select-control"],
|
|
30
30
|
onClick: () => e.toggleAllRowsSelected(),
|
|
31
|
-
onMouseDown:
|
|
32
|
-
onMouseUp:
|
|
33
|
-
onKeyDown: (
|
|
34
|
-
children: /* @__PURE__ */ r(
|
|
31
|
+
onMouseDown: s,
|
|
32
|
+
onMouseUp: s,
|
|
33
|
+
onKeyDown: (t) => i(t, () => e.toggleAllRowsSelected()),
|
|
34
|
+
children: /* @__PURE__ */ r(n, {
|
|
35
35
|
size: "small",
|
|
36
36
|
dataTest: "cell-select-all",
|
|
37
|
-
|
|
38
|
-
tabIndex: -1,
|
|
37
|
+
decorative: !0,
|
|
39
38
|
checked: e.getIsAllRowsSelected(),
|
|
40
39
|
indeterminate: e.getIsSomeRowsSelected(),
|
|
41
40
|
className: "pointer-events-none",
|
|
@@ -43,46 +42,45 @@ function k(t, l, d) {
|
|
|
43
42
|
})
|
|
44
43
|
}),
|
|
45
44
|
cell: ({ cell: e }) => {
|
|
46
|
-
const
|
|
45
|
+
const t = !e.row.getCanSelect();
|
|
47
46
|
return /* @__PURE__ */ r("div", {
|
|
48
47
|
role: "checkbox",
|
|
49
|
-
tabIndex:
|
|
50
|
-
"aria-label":
|
|
48
|
+
tabIndex: t ? -1 : 0,
|
|
49
|
+
"aria-label": c.selectRow(e.row.index + 1),
|
|
51
50
|
"aria-checked": e.row.getIsSelected(),
|
|
52
|
-
"aria-disabled":
|
|
51
|
+
"aria-disabled": t,
|
|
53
52
|
style: { height: l ?? "auto" },
|
|
54
|
-
className:
|
|
53
|
+
className: a["select-control"],
|
|
55
54
|
onClick: () => {
|
|
56
|
-
|
|
55
|
+
t || e.row.toggleSelected();
|
|
57
56
|
},
|
|
58
|
-
onMouseDown:
|
|
59
|
-
onMouseUp:
|
|
57
|
+
onMouseDown: s,
|
|
58
|
+
onMouseUp: s,
|
|
60
59
|
onKeyDown: (m) => {
|
|
61
|
-
|
|
60
|
+
t || i(m, () => e.row.toggleSelected());
|
|
62
61
|
},
|
|
63
62
|
children: /* @__PURE__ */ r(u, {
|
|
64
63
|
arrow: !0,
|
|
65
64
|
placement: "top-start",
|
|
66
65
|
title: e.row.getRowSelectionTooltip(),
|
|
67
66
|
children: /* @__PURE__ */ r("span", {
|
|
68
|
-
className:
|
|
69
|
-
children: /* @__PURE__ */ r(
|
|
67
|
+
className: t ? a["cursor-not-allowed"] : void 0,
|
|
68
|
+
children: /* @__PURE__ */ r(n, {
|
|
70
69
|
size: "small",
|
|
71
70
|
dataTest: "cell-select",
|
|
72
|
-
|
|
73
|
-
tabIndex: -1,
|
|
71
|
+
decorative: !0,
|
|
74
72
|
checked: e.row.getIsSelected(),
|
|
75
73
|
hideWrapper: !0,
|
|
76
|
-
disabled:
|
|
74
|
+
disabled: t,
|
|
77
75
|
className: "pointer-events-none"
|
|
78
76
|
})
|
|
79
77
|
})
|
|
80
78
|
})
|
|
81
79
|
});
|
|
82
80
|
},
|
|
83
|
-
fixedLeft:
|
|
81
|
+
fixedLeft: o
|
|
84
82
|
};
|
|
85
83
|
}
|
|
86
84
|
export {
|
|
87
|
-
|
|
85
|
+
x as selectColumn
|
|
88
86
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SHOW_FULL_TEXT_ID as i } from "../../types.js";
|
|
2
|
-
import { ChevronDownIcon as
|
|
3
|
-
import { StyledButton as
|
|
2
|
+
import { ChevronDownIcon as l } from "../../shared-components/ChevronDownIcon.js";
|
|
3
|
+
import { StyledButton as s } from "../../shared-components/button/StyledButton.js";
|
|
4
4
|
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
-
function f(e,
|
|
5
|
+
function f(e, r) {
|
|
6
6
|
return {
|
|
7
7
|
id: i,
|
|
8
8
|
minSize: 38,
|
|
@@ -11,24 +11,25 @@ function f(e, n) {
|
|
|
11
11
|
enableHiding: !1,
|
|
12
12
|
enableSorting: !1,
|
|
13
13
|
header: () => null,
|
|
14
|
-
cell: (
|
|
15
|
-
info:
|
|
16
|
-
rowHeight:
|
|
14
|
+
cell: (n) => /* @__PURE__ */ o(u, {
|
|
15
|
+
info: n,
|
|
16
|
+
rowHeight: r
|
|
17
17
|
}),
|
|
18
18
|
fixedLeft: e
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function u({ info: e, rowHeight:
|
|
22
|
-
const
|
|
21
|
+
function u({ info: e, rowHeight: r }) {
|
|
22
|
+
const n = e.row.getCanExpand(), a = e.row.isExpanded();
|
|
23
23
|
return /* @__PURE__ */ o("div", {
|
|
24
24
|
className: "flex w-full items-center justify-center",
|
|
25
|
-
style: { height:
|
|
26
|
-
children: /* @__PURE__ */ o(
|
|
25
|
+
style: { height: r ?? "auto" },
|
|
26
|
+
children: /* @__PURE__ */ o(s, {
|
|
27
27
|
dataTest: "expand-text-button",
|
|
28
|
+
"aria-label": a ? "Collapse text" : "Show full text",
|
|
28
29
|
size: "small",
|
|
29
30
|
variant: "textGray",
|
|
30
31
|
onClick: (t) => {
|
|
31
|
-
t.stopPropagation(),
|
|
32
|
+
t.stopPropagation(), n && e.row.getToggleExpandedHandler()(), e.row.toggleExpand();
|
|
32
33
|
},
|
|
33
34
|
onMouseDown: (t) => {
|
|
34
35
|
t.preventDefault(), t.stopPropagation();
|
|
@@ -36,7 +37,7 @@ function u({ info: e, rowHeight: n }) {
|
|
|
36
37
|
onMouseUp: (t) => {
|
|
37
38
|
t.preventDefault(), t.stopPropagation();
|
|
38
39
|
},
|
|
39
|
-
startIcon: /* @__PURE__ */ o(
|
|
40
|
+
startIcon: /* @__PURE__ */ o(l, {
|
|
40
41
|
className: "block size-5 shrink-0",
|
|
41
42
|
width: 20,
|
|
42
43
|
height: 20,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as x } from "../../helpers/cn.js";
|
|
2
2
|
import e from "./StyledCheckbox.module.js";
|
|
3
|
-
import
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
3
|
+
import P, { useEffect as v, useRef as b } from "react";
|
|
4
|
+
import { Fragment as $, jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
var y = (r) => /* @__PURE__ */ l("svg", {
|
|
6
6
|
viewBox: "0 0 24 24",
|
|
7
7
|
width: "100%",
|
|
8
8
|
height: "100%",
|
|
9
9
|
fill: "none",
|
|
10
|
-
...
|
|
11
|
-
children: [/* @__PURE__ */
|
|
10
|
+
...r,
|
|
11
|
+
children: [/* @__PURE__ */ t("title", { children: "Indeterminate icon" }), /* @__PURE__ */ t("path", {
|
|
12
12
|
d: "M6 12H18",
|
|
13
13
|
stroke: "currentColor",
|
|
14
|
-
strokeWidth:
|
|
14
|
+
strokeWidth: r.strokeWidth ?? 3,
|
|
15
15
|
strokeLinecap: "round"
|
|
16
16
|
})]
|
|
17
|
-
}),
|
|
17
|
+
}), B = (r) => /* @__PURE__ */ l("svg", {
|
|
18
18
|
viewBox: "0 0 24 24",
|
|
19
19
|
width: "100%",
|
|
20
20
|
height: "100%",
|
|
@@ -23,56 +23,62 @@ var E = (t) => /* @__PURE__ */ k("svg", {
|
|
|
23
23
|
strokeWidth: 2,
|
|
24
24
|
strokeLinecap: "round",
|
|
25
25
|
strokeLinejoin: "round",
|
|
26
|
-
...
|
|
27
|
-
children: [/* @__PURE__ */
|
|
28
|
-
}),
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
...r,
|
|
27
|
+
children: [/* @__PURE__ */ t("title", { children: "Check icon" }), /* @__PURE__ */ t("path", { d: "M4 12l5 5L20 6" })]
|
|
28
|
+
}), _ = ({ dataTest: r, size: d = "medium", disabled: h, readOnly: a, indeterminate: n = !1, checked: p, disableRipple: g, hideWrapper: I, className: N, onChange: R, decorative: w, ...W }) => {
|
|
29
|
+
const c = !!I, s = !g && !c && !h && !a, u = b(null), m = b(null);
|
|
30
|
+
v(() => {
|
|
31
|
+
u.current && (u.current.indeterminate = n);
|
|
32
32
|
}, [n]);
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
33
|
+
const k = x(e.CheckboxWrapper, !c && e[`size-${d}`], c && e.HideWrapper, n && e.Indeterminate, a && e.ReadOnly, s && e.CheckboxHover, N), L = x(e.Checkbox, e[`size-${d}`], n && e.Indeterminate), E = n ? y : B, H = P.useCallback((o) => {
|
|
34
|
+
if (o.stopPropagation(), !s) return;
|
|
35
35
|
const i = document.createElement("span");
|
|
36
|
-
i.className = e.CheckboxRipple ?? "", i.addEventListener("animationend", () => i.remove(), { once: !0 }),
|
|
36
|
+
i.className = e.CheckboxRipple ?? "", i.addEventListener("animationend", () => i.remove(), { once: !0 }), m.current?.appendChild(i);
|
|
37
37
|
}, [s]);
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
return () =>
|
|
41
|
-
}, [])
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"data-checked":
|
|
46
|
-
"data-unchecked": !
|
|
38
|
+
v(() => {
|
|
39
|
+
const o = m.current;
|
|
40
|
+
return () => o?.replaceChildren();
|
|
41
|
+
}, []);
|
|
42
|
+
const j = (o) => {
|
|
43
|
+
a || R?.(o, o.target.checked);
|
|
44
|
+
}, C = {
|
|
45
|
+
"data-checked": p && !n ? "" : void 0,
|
|
46
|
+
"data-unchecked": !p && !n ? "" : void 0,
|
|
47
47
|
"data-indeterminate": n ? "" : void 0,
|
|
48
|
-
"data-disabled":
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
48
|
+
"data-disabled": h ? "" : void 0
|
|
49
|
+
}, f = /* @__PURE__ */ l($, { children: [!c && s && /* @__PURE__ */ t("span", {
|
|
50
|
+
ref: m,
|
|
51
|
+
className: e.CheckboxRippleContainer
|
|
52
|
+
}), /* @__PURE__ */ t("span", {
|
|
53
|
+
className: L,
|
|
54
|
+
children: /* @__PURE__ */ t("span", {
|
|
55
|
+
className: e.Indicator,
|
|
56
|
+
children: /* @__PURE__ */ t(E, { strokeWidth: d === "small" ? 3 : 2 })
|
|
57
|
+
})
|
|
58
|
+
})] });
|
|
59
|
+
return w ? /* @__PURE__ */ t("span", {
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
className: k,
|
|
62
|
+
"data-test": r,
|
|
63
|
+
...C,
|
|
64
|
+
children: f
|
|
65
|
+
}) : /* @__PURE__ */ l("label", {
|
|
66
|
+
className: k,
|
|
67
|
+
"data-test": r,
|
|
68
|
+
onPointerDown: H,
|
|
69
|
+
...C,
|
|
70
|
+
children: [/* @__PURE__ */ t("input", {
|
|
71
|
+
ref: u,
|
|
72
|
+
type: "checkbox",
|
|
73
|
+
className: "sr-only",
|
|
74
|
+
checked: p,
|
|
75
|
+
disabled: h,
|
|
76
|
+
readOnly: a,
|
|
77
|
+
onChange: j,
|
|
78
|
+
...W
|
|
79
|
+
}), f]
|
|
74
80
|
});
|
|
75
81
|
};
|
|
76
82
|
export {
|
|
77
|
-
|
|
83
|
+
_ as StyledCheckbox
|
|
78
84
|
};
|