@uva-glass/component-library 3.52.6 → 3.52.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/dist/assets/Backdrop.css +1 -1
- package/dist/assets/Card.css +1 -1
- package/dist/assets/Column.css +1 -1
- package/dist/assets/Drawer.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/ModalDialog.css +1 -1
- package/dist/assets/OverlayCloseButton.css +1 -1
- package/dist/assets/OverlayStepBar.css +1 -1
- package/dist/assets/PageOverlay.css +1 -1
- package/dist/assets/Spinner.css +1 -1
- package/dist/assets/Tooltip.css +1 -1
- package/dist/chunk-RW5PKMWM-pUx2dyqB.js +11292 -0
- package/dist/chunk-RW5PKMWM-pUx2dyqB.js.map +1 -0
- package/dist/{client--GsCJ9Up.js → client-CFLMKOFW.js} +1 -37
- package/dist/{client--GsCJ9Up.js.map → client-CFLMKOFW.js.map} +1 -1
- package/dist/components/Accordion/Accordion.test.js +3 -3
- package/dist/components/AccordionCard/AccordionCard.test.js +3 -3
- package/dist/components/ActionList/ActionList.test.js +3 -3
- package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -2
- package/dist/components/Attention/Attention.test.js +2 -2
- package/dist/components/Backdrop/Backdrop.test.js +2 -2
- package/dist/components/Buttons/Button.stories.js +8 -8
- package/dist/components/Buttons/Button.test.js +2 -2
- package/dist/components/Buttons/LinkButton.stories.js +10 -10
- package/dist/components/Buttons/LinkButton.test.js +2 -2
- package/dist/components/Buttons/MenuButton.stories.js +14 -14
- package/dist/components/Buttons/MenuButton.test.js +2 -2
- package/dist/components/Card/Card.test.js +2 -2
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.test.js +3 -3
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +7 -7
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +2 -2
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +57 -114
- package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
- package/dist/components/Chip/Chip.stories.js +5 -5
- package/dist/components/ControlsButton/ControlsButton.stories.js +1 -1
- package/dist/components/Drawer/Drawer.stories.js +9 -9
- package/dist/components/FeedbackBar/FeedbackBar.test.js +2 -2
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/IconButton/IconButton.stories.js +5 -5
- package/dist/components/InputField/InputField.stories.js +11 -11
- package/dist/components/Label/Label.test.js +2 -2
- package/dist/components/MetaDataBar/MetaDataBar.test.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +12 -12
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +15 -15
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +2 -2
- package/dist/components/Notification/Notification.stories.js +8 -8
- package/dist/components/Notification/Notification.test.js +2 -2
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +4 -4
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +4 -4
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +2 -2
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
- package/dist/components/SearchField/SearchField.js +61 -51
- package/dist/components/SearchField/SearchField.js.map +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/StatusBadge/StatusBadge.test.js +2 -2
- package/dist/components/TextArea/TextArea.stories.js +3 -3
- package/dist/components/TextArea/TextArea.test.js +9 -9
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js +3 -3
- package/dist/{index-DYPpFe2R.js → index-ApPj4mI1.js} +1 -2
- package/dist/{index-DYPpFe2R.js.map → index-ApPj4mI1.js.map} +1 -1
- package/dist/{index-C_1Z-Fok.js → index-BKK3EWVW.js} +2 -2
- package/dist/{index-C_1Z-Fok.js.map → index-BKK3EWVW.js.map} +1 -1
- package/dist/index-Dbb5M7Zc.js +24457 -0
- package/dist/index-Dbb5M7Zc.js.map +1 -0
- package/dist/react-18-C6foUf2n.js +42 -0
- package/dist/react-18-C6foUf2n.js.map +1 -0
- package/dist/{react.esm-DdELhthz.js → react.esm-BjO203QT.js} +3 -19
- package/dist/{react.esm-DdELhthz.js.map → react.esm-BjO203QT.js.map} +1 -1
- package/dist/setupTests.js +1 -1
- package/dist/storybook__react.d.js +7466 -7955
- package/dist/storybook__react.d.js.map +1 -1
- package/dist/{test-utils-BP59mSnn.js → test-utils-BcpWLsLH.js} +1 -19
- package/dist/{test-utils-BP59mSnn.js.map → test-utils-BcpWLsLH.js.map} +1 -1
- package/package.json +13 -13
- package/dist/index-BJRrLdmi.js +0 -34071
- package/dist/index-BJRrLdmi.js.map +0 -1
- package/dist/index-fdIFY6eP.js +0 -11566
- package/dist/index-fdIFY6eP.js.map +0 -1
- package/dist/react-18-BHQltW8V.js +0 -38
- package/dist/react-18-BHQltW8V.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as n, s as a } from "../../react.esm-
|
|
4
|
-
import { u as e } from "../../index-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as n, s as a } from "../../react.esm-BjO203QT.js";
|
|
4
|
+
import { u as e } from "../../index-BKK3EWVW.js";
|
|
5
5
|
import { Accordion as i } from "./Accordion.js";
|
|
6
6
|
describe("Accordion", () => {
|
|
7
7
|
it("should render", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as c, s as e, f as s, w as d } from "../../react.esm-
|
|
4
|
-
import { u as r } from "../../index-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as c, s as e, f as s, w as d } from "../../react.esm-BjO203QT.js";
|
|
4
|
+
import { u as r } from "../../index-BKK3EWVW.js";
|
|
5
5
|
import { AccordionCard as a } from "./AccordionCard.js";
|
|
6
6
|
describe("AccordionCard", () => {
|
|
7
7
|
it("should render", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as n, s as t, w as a } from "../../react.esm-
|
|
4
|
-
import { u as l } from "../../index-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as n, s as t, w as a } from "../../react.esm-BjO203QT.js";
|
|
4
|
+
import { u as l } from "../../index-BKK3EWVW.js";
|
|
5
5
|
import { ActionList as o } from "./ActionList.js";
|
|
6
6
|
const T = jest.fn(), c = [
|
|
7
7
|
/* @__PURE__ */ i("button", { type: "button", onClick: T, children: "Test Action 1" }, "1"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r, s as t } from "../../react.esm-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r, s as t } from "../../react.esm-BjO203QT.js";
|
|
4
4
|
import { AppStatusBar as s } from "./AppStatusBar.js";
|
|
5
5
|
describe("AppStatusBar", () => {
|
|
6
6
|
it("should render", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as t, s as r } from "../../react.esm-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as t, s as r } from "../../react.esm-BjO203QT.js";
|
|
4
4
|
import { Attention as n } from "./Attention.js";
|
|
5
5
|
describe("Attention", () => {
|
|
6
6
|
it("should render (variant primary)", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as e, s as o } from "../../react.esm-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as e, s as o } from "../../react.esm-BjO203QT.js";
|
|
4
4
|
import { Backdrop as t } from "./Backdrop.js";
|
|
5
5
|
describe("Backdrop", () => {
|
|
6
6
|
it("should render", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t, jsxs as a, Fragment as s } from "react/jsx-runtime";
|
|
2
|
-
import { l } from "../../index-
|
|
2
|
+
import { f as l } from "../../index-Dbb5M7Zc.js";
|
|
3
3
|
import { Button as n } from "./Button.js";
|
|
4
4
|
const c = "<Button variant={variant} onClick={onClictFunction}>{children}</Button>", h = {
|
|
5
5
|
title: "Atoms/Buttons/Button",
|
|
@@ -23,26 +23,26 @@ const c = "<Button variant={variant} onClick={onClictFunction}>{children}</Butto
|
|
|
23
23
|
inspectComponent: n,
|
|
24
24
|
codeString: c
|
|
25
25
|
}
|
|
26
|
-
},
|
|
26
|
+
}, e = (o) => /* @__PURE__ */ t(n, { ...o }), i = {
|
|
27
27
|
variant: "primary",
|
|
28
28
|
disabled: !1,
|
|
29
29
|
displayColumn: !1,
|
|
30
30
|
onClick: l()
|
|
31
|
-
}, d =
|
|
31
|
+
}, d = e.bind({});
|
|
32
32
|
d.args = {
|
|
33
33
|
children: "Click me!",
|
|
34
34
|
...i
|
|
35
35
|
};
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const r = e.bind({});
|
|
37
|
+
r.args = {
|
|
38
38
|
...i,
|
|
39
39
|
children: /* @__PURE__ */ a(s, { children: [
|
|
40
40
|
/* @__PURE__ */ t("div", { children: "Child 1" }),
|
|
41
41
|
/* @__PURE__ */ t("div", { children: "Child 2" })
|
|
42
42
|
] })
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
...
|
|
44
|
+
r.argTypes = {
|
|
45
|
+
...r.argTypes,
|
|
46
46
|
children: {
|
|
47
47
|
table: {
|
|
48
48
|
disable: !0
|
|
@@ -52,7 +52,7 @@ e.argTypes = {
|
|
|
52
52
|
};
|
|
53
53
|
export {
|
|
54
54
|
d as ButtonExample,
|
|
55
|
-
|
|
55
|
+
r as WithMultipleChildren,
|
|
56
56
|
h as default
|
|
57
57
|
};
|
|
58
58
|
//# sourceMappingURL=Button.stories.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as n, s as t, f as c } from "../../react.esm-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as n, s as t, f as c } from "../../react.esm-BjO203QT.js";
|
|
4
4
|
import { Button as o } from "./Button.js";
|
|
5
5
|
const s = jest.fn();
|
|
6
6
|
describe("Button", () => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as t, jsxs as a, Fragment as l } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { f as s } from "../../index-Dbb5M7Zc.js";
|
|
3
3
|
import { BrowserRouter as c } from "react-router";
|
|
4
|
-
import { LinkButton as
|
|
4
|
+
import { LinkButton as n } from "./LinkButton.js";
|
|
5
5
|
const d = `
|
|
6
6
|
// Has all HTMLAnchorElement props available except "className" and "style"
|
|
7
7
|
<LinkButton variant={variant} to={to} replace={replace} buttonRef={buttonRef}>{children}</LinkButton>
|
|
8
8
|
`, k = {
|
|
9
9
|
title: "Atoms/Buttons/LinkButton",
|
|
10
|
-
component:
|
|
10
|
+
component: n,
|
|
11
11
|
argTypes: {
|
|
12
12
|
variant: {
|
|
13
13
|
options: [
|
|
@@ -23,10 +23,10 @@ const d = `
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
parameters: {
|
|
26
|
-
inspectComponent:
|
|
26
|
+
inspectComponent: n,
|
|
27
27
|
codeString: d
|
|
28
28
|
}
|
|
29
|
-
}, r = (o) => /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
|
|
29
|
+
}, r = (o) => /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(n, { ...o }) }), i = {
|
|
30
30
|
variant: "primary",
|
|
31
31
|
onClick: s()
|
|
32
32
|
}, p = r.bind({});
|
|
@@ -34,16 +34,16 @@ p.args = {
|
|
|
34
34
|
children: "Click me!",
|
|
35
35
|
...i
|
|
36
36
|
};
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const e = r.bind({});
|
|
38
|
+
e.args = {
|
|
39
39
|
...i,
|
|
40
40
|
children: /* @__PURE__ */ a(l, { children: [
|
|
41
41
|
/* @__PURE__ */ t("div", { children: "Child 1" }),
|
|
42
42
|
/* @__PURE__ */ t("div", { children: "Child 2" })
|
|
43
43
|
] })
|
|
44
44
|
};
|
|
45
|
-
|
|
46
|
-
...
|
|
45
|
+
e.argTypes = {
|
|
46
|
+
...e.argTypes,
|
|
47
47
|
children: {
|
|
48
48
|
table: {
|
|
49
49
|
disable: !0
|
|
@@ -53,7 +53,7 @@ n.argTypes = {
|
|
|
53
53
|
};
|
|
54
54
|
export {
|
|
55
55
|
p as LinkButtonExample,
|
|
56
|
-
|
|
56
|
+
e as WithMultipleChildren,
|
|
57
57
|
k as default
|
|
58
58
|
};
|
|
59
59
|
//# sourceMappingURL=LinkButton.stories.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as n, s as t, f as c } from "../../react.esm-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as n, s as t, f as c } from "../../react.esm-BjO203QT.js";
|
|
4
4
|
import { BrowserRouter as u, Routes as a, Route as d } from "react-router";
|
|
5
5
|
import { LinkButton as o } from "./LinkButton.js";
|
|
6
6
|
const r = ({ children: i }) => /* @__PURE__ */ s(u, { children: [
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { MenuButton as
|
|
1
|
+
import { jsx as n, jsxs as s, Fragment as l } from "react/jsx-runtime";
|
|
2
|
+
import { f as c } from "../../index-Dbb5M7Zc.js";
|
|
3
|
+
import { MenuButton as t } from "./MenuButton.js";
|
|
4
4
|
const d = `
|
|
5
5
|
// Has all LabelHTMLAttributes props available except "className" and "style"
|
|
6
6
|
<MenuButton variant={variant} onClick={onClickFunction} onKeyDown={onKeyDown} onKeyUp={onKeyUp} buttonRef={buttonRef}>{children}</MenuButton>
|
|
7
7
|
`, b = {
|
|
8
8
|
title: "Atoms/Buttons/MenuButton",
|
|
9
|
-
component:
|
|
9
|
+
component: t,
|
|
10
10
|
argTypes: {
|
|
11
11
|
variant: {
|
|
12
12
|
options: ["primary", "secondary", "destructive-primary", "destructive-secondary", "blank", "blank-icon"],
|
|
@@ -14,10 +14,10 @@ const d = `
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
parameters: {
|
|
17
|
-
inspectComponent:
|
|
17
|
+
inspectComponent: t,
|
|
18
18
|
codeString: d
|
|
19
19
|
}
|
|
20
|
-
}, r = (a) => /* @__PURE__ */
|
|
20
|
+
}, r = (a) => /* @__PURE__ */ n(t, { ...a }), o = {
|
|
21
21
|
variant: "primary",
|
|
22
22
|
onClick: c()
|
|
23
23
|
}, p = r.bind({});
|
|
@@ -25,13 +25,13 @@ p.args = {
|
|
|
25
25
|
children: "Click me!",
|
|
26
26
|
...o
|
|
27
27
|
};
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const e = r.bind({});
|
|
29
|
+
e.args = {
|
|
30
30
|
...o,
|
|
31
31
|
iconName: "EllipsisVertical"
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
...
|
|
33
|
+
e.argTypes = {
|
|
34
|
+
...e.argTypes,
|
|
35
35
|
children: {
|
|
36
36
|
table: {
|
|
37
37
|
disable: !0
|
|
@@ -42,9 +42,9 @@ t.argTypes = {
|
|
|
42
42
|
const i = r.bind({});
|
|
43
43
|
i.args = {
|
|
44
44
|
...o,
|
|
45
|
-
children: /* @__PURE__ */ l
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ s(l, { children: [
|
|
46
|
+
/* @__PURE__ */ n("div", { children: "Child 1" }),
|
|
47
|
+
/* @__PURE__ */ n("div", { children: "Child 2" })
|
|
48
48
|
] })
|
|
49
49
|
};
|
|
50
50
|
i.argTypes = {
|
|
@@ -58,7 +58,7 @@ i.argTypes = {
|
|
|
58
58
|
};
|
|
59
59
|
export {
|
|
60
60
|
p as MenuButtonExample,
|
|
61
|
-
|
|
61
|
+
e as WithIconChildren,
|
|
62
62
|
i as WithMultipleChildren,
|
|
63
63
|
b as default
|
|
64
64
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as u, s as e, f as c } from "../../react.esm-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as u, s as e, f as c } from "../../react.esm-BjO203QT.js";
|
|
4
4
|
import { createRef as s } from "react";
|
|
5
5
|
import { MenuButton as r } from "./MenuButton.js";
|
|
6
6
|
const n = jest.fn();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r, s as d } from "../../react.esm-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r, s as d } from "../../react.esm-BjO203QT.js";
|
|
4
4
|
import { Card as o } from "./Card.js";
|
|
5
5
|
describe("Card", () => {
|
|
6
6
|
it("should render", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as g, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { f as e } from "../../index-Dbb5M7Zc.js";
|
|
3
3
|
import { Checkbox as n } from "./Checkbox.js";
|
|
4
4
|
import { FormField as t } from "../FormField/FormField.js";
|
|
5
5
|
import { Label as i } from "../Label/Label.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as o, s as t } from "../../react.esm-
|
|
4
|
-
import { u as s } from "../../index-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as o, s as t } from "../../react.esm-BjO203QT.js";
|
|
4
|
+
import { u as s } from "../../index-BKK3EWVW.js";
|
|
5
5
|
import { Checkbox as r } from "./Checkbox.js";
|
|
6
6
|
describe("Checkbox", () => {
|
|
7
7
|
it("should render", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t, Fragment as l } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { f as o } from "../../index-Dbb5M7Zc.js";
|
|
3
3
|
import { CheckboxButtonBar as i } from "./CheckboxButtonBar.js";
|
|
4
4
|
const u = "<CheckboxButtonBar checkboxes={} defaultValues={} label={} labelPosition={} required={} notValidatedText={} disableGroup={} onSetValues={} />", v = {
|
|
5
5
|
title: "Molecules/CheckboxButtonBar",
|
|
@@ -79,8 +79,8 @@ s.args = {
|
|
|
79
79
|
footerText: "Weken in periode 2",
|
|
80
80
|
onSetValues: o()
|
|
81
81
|
};
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const n = a.bind({});
|
|
83
|
+
n.args = {
|
|
84
84
|
label: "Weken",
|
|
85
85
|
required: !0,
|
|
86
86
|
checkboxes: [
|
|
@@ -114,8 +114,8 @@ b.args = {
|
|
|
114
114
|
actAsRadioButtonBar: !0,
|
|
115
115
|
onSetValues: o()
|
|
116
116
|
};
|
|
117
|
-
const
|
|
118
|
-
|
|
117
|
+
const b = a.bind({});
|
|
118
|
+
b.args = {
|
|
119
119
|
label: "Weken",
|
|
120
120
|
required: !0,
|
|
121
121
|
checkboxes: [
|
|
@@ -283,10 +283,10 @@ c.args = {
|
|
|
283
283
|
onSetValues: o()
|
|
284
284
|
};
|
|
285
285
|
export {
|
|
286
|
-
|
|
286
|
+
n as AsRadioButtonBar,
|
|
287
287
|
s as CheckboxButtonBarExample,
|
|
288
288
|
c as Segmented,
|
|
289
|
-
|
|
289
|
+
b as WithPrefix,
|
|
290
290
|
p as WithTooltip,
|
|
291
291
|
v as default
|
|
292
292
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as c, s as t } from "../../react.esm-
|
|
2
|
+
import "../../index-ApPj4mI1.js";
|
|
3
|
+
import { r as c, s as t } from "../../react.esm-BjO203QT.js";
|
|
4
4
|
import { CheckboxButtonBar as a } from "./CheckboxButtonBar.js";
|
|
5
5
|
const n = jest.fn(), d = [
|
|
6
6
|
{
|
|
@@ -1,142 +1,85 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useState as
|
|
5
|
-
import { CheckboxTree as
|
|
6
|
-
import { Chip as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, "findProto"), $ = /* @__PURE__ */ h((e) => !!(typeof e == "object" && e && E(e, (t) => /^Synthetic(?:Base)?Event$/.test(t.constructor.name)) && typeof e.persist == "function"), "isReactSyntheticEvent"), k = /* @__PURE__ */ h((e) => {
|
|
15
|
-
if ($(e)) {
|
|
16
|
-
let t = Object.create(
|
|
17
|
-
e.constructor.prototype,
|
|
18
|
-
Object.getOwnPropertyDescriptors(e)
|
|
19
|
-
);
|
|
20
|
-
t.persist();
|
|
21
|
-
let r = Object.getOwnPropertyDescriptor(t, "view"), o = r?.value;
|
|
22
|
-
return typeof o == "object" && o?.constructor.name === "Window" && Object.defineProperty(t, "view", {
|
|
23
|
-
...r,
|
|
24
|
-
value: Object.create(o.constructor.prototype)
|
|
25
|
-
}), t;
|
|
26
|
-
}
|
|
27
|
-
return e;
|
|
28
|
-
}, "serializeArg");
|
|
29
|
-
function f(e, t = {}) {
|
|
30
|
-
let r = {
|
|
31
|
-
...V,
|
|
32
|
-
...t
|
|
33
|
-
}, o = /* @__PURE__ */ h(function(...i) {
|
|
34
|
-
if (t.implicit) {
|
|
35
|
-
let g = ("__STORYBOOK_PREVIEW__" in T ? T.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
|
|
36
|
-
(p) => p.phase === "playing" || p.phase === "rendering"
|
|
37
|
-
);
|
|
38
|
-
if (g) {
|
|
39
|
-
let p = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, O = new v({
|
|
40
|
-
phase: g.phase,
|
|
41
|
-
name: e,
|
|
42
|
-
deprecated: p
|
|
43
|
-
});
|
|
44
|
-
if (p)
|
|
45
|
-
console.warn(O);
|
|
46
|
-
else
|
|
47
|
-
throw O;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
let c = w.getChannel(), u = Date.now().toString(36) + Math.random().toString(36).substring(2), n = 5, s = i.map(k), a = i.length > 1 ? s : s[0], l = {
|
|
51
|
-
id: u,
|
|
52
|
-
count: 0,
|
|
53
|
-
data: { name: e, args: a },
|
|
54
|
-
options: {
|
|
55
|
-
...r,
|
|
56
|
-
maxDepth: n + (r.depth || 3)
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
c.emit(P, l);
|
|
60
|
-
}, "actionHandler");
|
|
61
|
-
return o.isAction = !0, o.implicit = t.implicit, o;
|
|
62
|
-
}
|
|
63
|
-
h(f, "action");
|
|
64
|
-
const A = (e, t, r) => {
|
|
65
|
-
const o = Array.from({ length: t }, (n, s) => s + 1), i = (n) => {
|
|
66
|
-
const s = Math.ceil(parseInt(n) / r), a = s === r ? "" : `.${parseInt(n) % r || r}`;
|
|
67
|
-
return `${s}${a}`;
|
|
68
|
-
}, c = o.map((n) => ({
|
|
69
|
-
itemName: i(String(n)),
|
|
70
|
-
itemValue: n,
|
|
1
|
+
import { jsx as h, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { f as C } from "../../index-Dbb5M7Zc.js";
|
|
3
|
+
import { a as u } from "../../chunk-RW5PKMWM-pUx2dyqB.js";
|
|
4
|
+
import { useState as f } from "react";
|
|
5
|
+
import { CheckboxTree as p } from "./CheckboxTree.js";
|
|
6
|
+
import { Chip as g } from "../Chip/Chip.js";
|
|
7
|
+
const E = (e, r, t) => {
|
|
8
|
+
const l = Array.from({ length: r }, (o, c) => c + 1), n = (o) => {
|
|
9
|
+
const c = Math.ceil(parseInt(o) / t), i = c === t ? "" : `.${parseInt(o) % t || t}`;
|
|
10
|
+
return `${c}${i}`;
|
|
11
|
+
}, s = l.map((o) => ({
|
|
12
|
+
itemName: n(String(o)),
|
|
13
|
+
itemValue: o,
|
|
71
14
|
disabled: !1
|
|
72
15
|
}));
|
|
73
|
-
return
|
|
74
|
-
const
|
|
75
|
-
return e.includes(String(
|
|
76
|
-
itemName: `Semester ${
|
|
16
|
+
return l.reduce((o, c, i) => {
|
|
17
|
+
const m = Math.ceil(c / t);
|
|
18
|
+
return e.includes(String(i + 1)) && (o[m] || (o[m] = {
|
|
19
|
+
itemName: `Semester ${m}`,
|
|
77
20
|
children: []
|
|
78
|
-
}),
|
|
79
|
-
...
|
|
80
|
-
itemValue: String(
|
|
81
|
-
})),
|
|
21
|
+
}), o[m].children.push({
|
|
22
|
+
...s[i],
|
|
23
|
+
itemValue: String(s[i].itemValue)
|
|
24
|
+
})), o;
|
|
82
25
|
}, []);
|
|
83
|
-
},
|
|
26
|
+
}, x = 7, O = 3, T = E(
|
|
84
27
|
["1", "2", "3", "4", "5", "6", "7"],
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
),
|
|
28
|
+
x,
|
|
29
|
+
O
|
|
30
|
+
), _ = "<CheckboxTree title={} checkboxTree={} selectedValues={} onChange={} />", P = {
|
|
88
31
|
title: "Organisms/CheckboxTree",
|
|
89
|
-
component:
|
|
32
|
+
component: p,
|
|
90
33
|
parameters: {
|
|
91
|
-
inspectComponent:
|
|
92
|
-
codeString:
|
|
34
|
+
inspectComponent: p,
|
|
35
|
+
codeString: _
|
|
93
36
|
}
|
|
94
|
-
},
|
|
95
|
-
|
|
37
|
+
}, $ = (e) => /* @__PURE__ */ h(p, { ...e }), k = $.bind({});
|
|
38
|
+
k.args = {
|
|
96
39
|
title: "Periode",
|
|
97
|
-
checkboxTree:
|
|
40
|
+
checkboxTree: T,
|
|
98
41
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
99
42
|
selectedValues: ["3", "4"],
|
|
100
43
|
onChange: C()
|
|
101
44
|
};
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
return `${
|
|
105
|
-
},
|
|
106
|
-
const [
|
|
107
|
-
return `${(
|
|
108
|
-
},
|
|
109
|
-
const [e,
|
|
110
|
-
const
|
|
111
|
-
(
|
|
45
|
+
const a = 3, V = (e) => {
|
|
46
|
+
const r = Math.ceil(parseInt(e) / a), t = r === a ? "" : `.${parseInt(e) % a || a}`;
|
|
47
|
+
return `${r}${t}`;
|
|
48
|
+
}, R = (e) => {
|
|
49
|
+
const [r, t] = e.split(".").map(Number);
|
|
50
|
+
return `${(r - 1) * a + (t || 1)}`;
|
|
51
|
+
}, j = () => {
|
|
52
|
+
const [e, r] = f(["5", "4", "1"]), t = (n) => {
|
|
53
|
+
const s = JSON.parse(JSON.stringify(e)).filter(
|
|
54
|
+
(d) => d !== R(n)
|
|
112
55
|
);
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
|
|
56
|
+
r(() => s), u("onChange value:")(s);
|
|
57
|
+
}, l = (n) => {
|
|
58
|
+
r([...n]), u("onChange value:")(n);
|
|
116
59
|
};
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
|
|
60
|
+
return /* @__PURE__ */ b("div", { style: { width: "15rem" }, children: [
|
|
61
|
+
/* @__PURE__ */ h("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5rem", width: "100%", marginBottom: "1rem" }, children: e && e.map((n, s) => /* @__PURE__ */ h(
|
|
62
|
+
g,
|
|
120
63
|
{
|
|
121
|
-
label:
|
|
122
|
-
onDelete:
|
|
64
|
+
label: V(n),
|
|
65
|
+
onDelete: t
|
|
123
66
|
},
|
|
124
|
-
`${
|
|
67
|
+
`${s}_${n}`
|
|
125
68
|
)) }),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
69
|
+
/* @__PURE__ */ h(
|
|
70
|
+
p,
|
|
128
71
|
{
|
|
129
72
|
title: "Periode",
|
|
130
|
-
checkboxTree:
|
|
73
|
+
checkboxTree: T,
|
|
131
74
|
selectedValues: e,
|
|
132
|
-
onChange:
|
|
75
|
+
onChange: l
|
|
133
76
|
}
|
|
134
77
|
)
|
|
135
78
|
] });
|
|
136
79
|
};
|
|
137
80
|
export {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
81
|
+
k as CheckboxTreeExample,
|
|
82
|
+
j as CheckboxTreeWithChips,
|
|
83
|
+
P as default
|
|
141
84
|
};
|
|
142
85
|
//# sourceMappingURL=CheckboxTree.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxTree.stories.js","sources":["../../../node_modules/storybook/dist/actions/index.js","../../../src/components/CheckboxTree/CheckboxTree.stories.tsx"],"sourcesContent":["var w = Object.defineProperty;\nvar i = (o, n) => w(o, \"name\", { value: n, configurable: !0 });\n\n// src/actions/constants.ts\nvar S = \"actions\", a = \"storybook/actions\", I = `${a}/panel`, y = `${a}/action-event`, P = `${a}/action-clear`, T = \"$___storybook.isCyclic\";\n\n// src/actions/runtime/action.ts\nimport { ImplicitActionsDuringRendering as _ } from \"storybook/internal/preview-errors\";\nimport { global as d } from \"@storybook/global\";\nimport { addons as v } from \"storybook/preview-api\";\n\n// src/actions/runtime/configureActions.ts\nvar c = {\n depth: 10,\n clearOnStoryChange: !0,\n limit: 50\n}, C = /* @__PURE__ */ i((o = {}) => {\n Object.assign(c, o);\n}, \"configureActions\");\n\n// src/actions/runtime/action.ts\nvar u = /* @__PURE__ */ i((o, n) => {\n let t = Object.getPrototypeOf(o);\n return !t || n(t) ? t : u(t, n);\n}, \"findProto\"), D = /* @__PURE__ */ i((o) => !!(typeof o == \"object\" && o && u(o, (n) => /^Synthetic(?:Base)?Event$/.test(n.constructor.name)) &&\ntypeof o.persist == \"function\"), \"isReactSyntheticEvent\"), x = /* @__PURE__ */ i((o) => {\n if (D(o)) {\n let n = Object.create(\n o.constructor.prototype,\n Object.getOwnPropertyDescriptors(o)\n );\n n.persist();\n let t = Object.getOwnPropertyDescriptor(n, \"view\"), e = t?.value;\n return typeof e == \"object\" && e?.constructor.name === \"Window\" && Object.defineProperty(n, \"view\", {\n ...t,\n value: Object.create(e.constructor.prototype)\n }), n;\n }\n return o;\n}, \"serializeArg\");\nfunction g(o, n = {}) {\n let t = {\n ...c,\n ...n\n }, e = /* @__PURE__ */ i(function(...r) {\n if (n.implicit) {\n let m = (\"__STORYBOOK_PREVIEW__\" in d ? d.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(\n (s) => s.phase === \"playing\" || s.phase === \"rendering\"\n );\n if (m) {\n let s = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, f = new _({\n phase: m.phase,\n name: o,\n deprecated: s\n });\n if (s)\n console.warn(f);\n else\n throw f;\n }\n }\n let O = v.getChannel(), h = Date.now().toString(36) + Math.random().toString(36).substring(2), A = 5, l = r.map(x), E = r.length > 1 ? l :\n l[0], b = {\n id: h,\n count: 0,\n data: { name: o, args: E },\n options: {\n ...t,\n maxDepth: A + (t.depth || 3)\n }\n };\n O.emit(y, b);\n }, \"actionHandler\");\n return e.isAction = !0, e.implicit = n.implicit, e;\n}\ni(g, \"action\");\n\n// src/actions/runtime/actions.ts\nvar L = /* @__PURE__ */ i((...o) => {\n let n = c, t = o;\n t.length === 1 && Array.isArray(t[0]) && ([t] = t), t.length !== 1 && typeof t[t.length - 1] != \"string\" && (n = {\n ...c,\n ...t.pop()\n });\n let e = t[0];\n (t.length !== 1 || typeof e == \"string\") && (e = {}, t.forEach((r) => {\n e[r] = r;\n }));\n let p = {};\n return Object.keys(e).forEach((r) => {\n p[r] = g(e[r], n);\n }), p;\n}, \"actions\");\nexport {\n a as ADDON_ID,\n P as CLEAR_ID,\n T as CYCLIC_KEY,\n y as EVENT_ID,\n I as PANEL_ID,\n S as PARAM_KEY,\n g as action,\n L as actions,\n c as config,\n C as configureActions\n};\n","import { fn } from 'storybook/test';\nimport { action } from 'storybook/actions';\nimport { useState } from 'react';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { CheckboxLeaf, CheckboxBranch, CheckboxTreeProps } from './CheckboxTree';\n\nimport { CheckboxTree } from './CheckboxTree';\n\nimport { Chip } from 'components/Chip';\n\nconst createPeriodTree = (periodIndices: string[], numberOfPeriods: number, periodPerSemester: number) => {\n const allPeriods = Array.from({ length: numberOfPeriods }, (_, idx) => idx + 1);\n\n const periodValueToLabel = (value: string) => {\n const semester = Math.ceil(parseInt(value) / periodPerSemester);\n const period = semester === periodPerSemester ? '' : `.${parseInt(value) % periodPerSemester || periodPerSemester}`;\n return `${semester}${period}`;\n };\n\n const periodTree = allPeriods.map((periodIndex) => ({\n itemName: periodValueToLabel(String(periodIndex)),\n itemValue: periodIndex,\n disabled: false,\n }));\n\n const periodTreeObject = allPeriods.reduce((periods, currentPeriod, periodIndex) => {\n const semester = Math.ceil(currentPeriod / periodPerSemester);\n if (periodIndices.includes(String(periodIndex + 1))) {\n if (!periods[semester]) {\n periods[semester] = {\n itemName: `Semester ${semester}`,\n children: [],\n };\n }\n periods[semester].children.push({\n ...periodTree[periodIndex],\n itemValue: String(periodTree[periodIndex].itemValue),\n } as CheckboxLeaf);\n }\n return periods;\n }, [] as CheckboxBranch[]);\n\n return periodTreeObject;\n};\n\nconst NUMBER_OF_PERIODS = 7;\nconst PERIOD_PER_SEMESTER = 3;\n\nconst MOCK_CHECKBOX_TREE = createPeriodTree(\n ['1', '2', '3', '4', '5', '6', '7'],\n NUMBER_OF_PERIODS,\n PERIOD_PER_SEMESTER\n);\n\nconst codeString = '<CheckboxTree title={} checkboxTree={} selectedValues={} onChange={} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Organisms/CheckboxTree',\n component: CheckboxTree,\n parameters: {\n inspectComponent: CheckboxTree,\n codeString: codeString,\n },\n} as Meta<CheckboxTreeProps>;\n\nconst Template: StoryFn<CheckboxTreeProps> = (args) => <CheckboxTree {...args} />;\n\nexport const CheckboxTreeExample = Template.bind({});\nCheckboxTreeExample.args = {\n title: 'Periode',\n checkboxTree: MOCK_CHECKBOX_TREE,\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n selectedValues: ['3', '4'],\n onChange: fn(),\n};\n\nconst PERIOD_SEGMENT = 3;\n\nconst periodValueToLabel = (value: string) => {\n const semester = Math.ceil(parseInt(value) / PERIOD_SEGMENT);\n const period = semester === PERIOD_SEGMENT ? '' : `.${parseInt(value) % PERIOD_SEGMENT || PERIOD_SEGMENT}`;\n return `${semester}${period}`;\n};\n\nconst periodLabelToValue = (value: string): string => {\n const [row, col] = value.split('.').map(Number);\n return `${(row - 1) * PERIOD_SEGMENT + (col || 1)}`;\n};\n\nexport const CheckboxTreeWithChips: StoryFn<CheckboxTreeProps> = () => {\n const [activeFilters, setActiveFilters] = useState<string[]>(['5', '4', '1']);\n\n const handleRemoveActiveFilter = (filterToRemove: string) => {\n const newActiveFilters = JSON.parse(JSON.stringify(activeFilters)).filter(\n (filter: string) => filter !== periodLabelToValue(filterToRemove)\n );\n\n setActiveFilters(() => newActiveFilters);\n action('onChange value:')(newActiveFilters);\n };\n\n const handlePeriodChange = (value: string[]) => {\n setActiveFilters([...value]);\n action('onChange value:')(value);\n };\n\n return (\n <div style={{ width: '15rem' }}>\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem', width: '100%', marginBottom: '1rem' }}>\n {activeFilters &&\n activeFilters.map((activeFilter, index) => (\n <Chip\n label={periodValueToLabel(activeFilter)}\n onDelete={handleRemoveActiveFilter}\n key={`${index}_${activeFilter}`}\n />\n ))}\n </div>\n <CheckboxTree\n title=\"Periode\"\n checkboxTree={MOCK_CHECKBOX_TREE}\n selectedValues={activeFilters}\n onChange={handlePeriodChange}\n />\n </div>\n );\n};\n"],"names":["w","i","o","n","a","y","c","u","t","D","x","e","g","r","m","d","s","f","_","O","v","h","A","l","E","b","createPeriodTree","periodIndices","numberOfPeriods","periodPerSemester","allPeriods","idx","periodValueToLabel","value","semester","period","periodTree","periodIndex","periods","currentPeriod","NUMBER_OF_PERIODS","PERIOD_PER_SEMESTER","MOCK_CHECKBOX_TREE","codeString","CheckboxTree_stories","CheckboxTree","Template","args","jsx","CheckboxTreeExample","fn","PERIOD_SEGMENT","periodLabelToValue","row","col","CheckboxTreeWithChips","activeFilters","setActiveFilters","useState","handleRemoveActiveFilter","filterToRemove","newActiveFilters","filter","action","handlePeriodChange","activeFilter","index","Chip"],"mappings":";;;;;;AAAA,IAAIA,IAAI,OAAO,gBACXC,IAAI,CAACC,GAAGC,MAAMH,EAAEE,GAAG,QAAQ,EAAE,OAAOC,GAAG,cAAc,GAAE,CAAE,GAG1CC,IAAI,qBAAuCC,IAAI,GAAGD,CAAC,iBAQlEE,IAAI;AAAA,EACN,OAAO;AAAA,EACP,oBAAoB;AAAA,EACpB,OAAO;AACT,GAKIC,IAAoB,gBAAAN,EAAE,CAACC,GAAGC,MAAM;AAClC,MAAIK,IAAI,OAAO,eAAeN,CAAC;AAC/B,SAAO,CAACM,KAAKL,EAAEK,CAAC,IAAIA,IAAID,EAAEC,GAAGL,CAAC;AAChC,GAAG,WAAW,GAAGM,IAAoB,gBAAAR,EAAE,CAACC,MAAM,CAAC,EAAE,OAAOA,KAAK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AAC,GAEtEC,IAA2B,CAACC,MAA2B;AAC3D,UAAMC,IAAmB,KAAK,MAAM,KAAK,UAAUL,CAAa,CAAC,EAAE;AAAA,MACjE,CAACM,MAAmBA,MAAWV,EAAmBQ,CAAc;AAAA,IAAA;AAGlE,IAAAH,EAAiB,MAAMI,CAAgB,GACvCE,EAAO,iBAAiB,EAAEF,CAAgB;AAAA,EAC5C,GAEMG,IAAqB,CAAC/B,MAAoB;AAC9C,IAAAwB,EAAiB,CAAC,GAAGxB,CAAK,CAAC,GAC3B8B,EAAO,iBAAiB,EAAE9B,CAAK;AAAA,EACjC;AAEA,2BACG,OAAA,EAAI,OAAO,EAAE,OAAO,WACnB,UAAA;AAAA,IAAA,gBAAAe,EAAC,SAAI,OAAO,EAAE,SAAS,QAAQ,UAAU,QAAQ,KAAK,UAAU,OAAO,QAAQ,cAAc,UAC1F,UAAAQ,KACCA,EAAc,IAAI,CAACS,GAAcC,MAC/B,gBAAAlB;AAAA,MAACmB;AAAA,MAAA;AAAA,QACC,OAAOnC,EAAmBiC,CAAY;AAAA,QACtC,UAAUN;AAAA,MAAA;AAAA,MACL,GAAGO,CAAK,IAAID,CAAY;AAAA,IAAA,CAEhC,GACL;AAAA,IACA,gBAAAjB;AAAA,MAACH;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,cAAcH;AAAA,QACd,gBAAgBc;AAAA,QAChB,UAAUQ;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GACF;AAEJ;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"CheckboxTree.stories.js","sources":["../../../src/components/CheckboxTree/CheckboxTree.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\nimport { action } from 'storybook/actions';\nimport { useState } from 'react';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { CheckboxLeaf, CheckboxBranch, CheckboxTreeProps } from './CheckboxTree';\n\nimport { CheckboxTree } from './CheckboxTree';\n\nimport { Chip } from 'components/Chip';\n\nconst createPeriodTree = (periodIndices: string[], numberOfPeriods: number, periodPerSemester: number) => {\n const allPeriods = Array.from({ length: numberOfPeriods }, (_, idx) => idx + 1);\n\n const periodValueToLabel = (value: string) => {\n const semester = Math.ceil(parseInt(value) / periodPerSemester);\n const period = semester === periodPerSemester ? '' : `.${parseInt(value) % periodPerSemester || periodPerSemester}`;\n return `${semester}${period}`;\n };\n\n const periodTree = allPeriods.map((periodIndex) => ({\n itemName: periodValueToLabel(String(periodIndex)),\n itemValue: periodIndex,\n disabled: false,\n }));\n\n const periodTreeObject = allPeriods.reduce((periods, currentPeriod, periodIndex) => {\n const semester = Math.ceil(currentPeriod / periodPerSemester);\n if (periodIndices.includes(String(periodIndex + 1))) {\n if (!periods[semester]) {\n periods[semester] = {\n itemName: `Semester ${semester}`,\n children: [],\n };\n }\n periods[semester].children.push({\n ...periodTree[periodIndex],\n itemValue: String(periodTree[periodIndex].itemValue),\n } as CheckboxLeaf);\n }\n return periods;\n }, [] as CheckboxBranch[]);\n\n return periodTreeObject;\n};\n\nconst NUMBER_OF_PERIODS = 7;\nconst PERIOD_PER_SEMESTER = 3;\n\nconst MOCK_CHECKBOX_TREE = createPeriodTree(\n ['1', '2', '3', '4', '5', '6', '7'],\n NUMBER_OF_PERIODS,\n PERIOD_PER_SEMESTER\n);\n\nconst codeString = '<CheckboxTree title={} checkboxTree={} selectedValues={} onChange={} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Organisms/CheckboxTree',\n component: CheckboxTree,\n parameters: {\n inspectComponent: CheckboxTree,\n codeString: codeString,\n },\n} as Meta<CheckboxTreeProps>;\n\nconst Template: StoryFn<CheckboxTreeProps> = (args) => <CheckboxTree {...args} />;\n\nexport const CheckboxTreeExample = Template.bind({});\nCheckboxTreeExample.args = {\n title: 'Periode',\n checkboxTree: MOCK_CHECKBOX_TREE,\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n selectedValues: ['3', '4'],\n onChange: fn(),\n};\n\nconst PERIOD_SEGMENT = 3;\n\nconst periodValueToLabel = (value: string) => {\n const semester = Math.ceil(parseInt(value) / PERIOD_SEGMENT);\n const period = semester === PERIOD_SEGMENT ? '' : `.${parseInt(value) % PERIOD_SEGMENT || PERIOD_SEGMENT}`;\n return `${semester}${period}`;\n};\n\nconst periodLabelToValue = (value: string): string => {\n const [row, col] = value.split('.').map(Number);\n return `${(row - 1) * PERIOD_SEGMENT + (col || 1)}`;\n};\n\nexport const CheckboxTreeWithChips: StoryFn<CheckboxTreeProps> = () => {\n const [activeFilters, setActiveFilters] = useState<string[]>(['5', '4', '1']);\n\n const handleRemoveActiveFilter = (filterToRemove: string) => {\n const newActiveFilters = JSON.parse(JSON.stringify(activeFilters)).filter(\n (filter: string) => filter !== periodLabelToValue(filterToRemove)\n );\n\n setActiveFilters(() => newActiveFilters);\n action('onChange value:')(newActiveFilters);\n };\n\n const handlePeriodChange = (value: string[]) => {\n setActiveFilters([...value]);\n action('onChange value:')(value);\n };\n\n return (\n <div style={{ width: '15rem' }}>\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem', width: '100%', marginBottom: '1rem' }}>\n {activeFilters &&\n activeFilters.map((activeFilter, index) => (\n <Chip\n label={periodValueToLabel(activeFilter)}\n onDelete={handleRemoveActiveFilter}\n key={`${index}_${activeFilter}`}\n />\n ))}\n </div>\n <CheckboxTree\n title=\"Periode\"\n checkboxTree={MOCK_CHECKBOX_TREE}\n selectedValues={activeFilters}\n onChange={handlePeriodChange}\n />\n </div>\n );\n};\n"],"names":["createPeriodTree","periodIndices","numberOfPeriods","periodPerSemester","allPeriods","_","idx","periodValueToLabel","value","semester","period","periodTree","periodIndex","periods","currentPeriod","NUMBER_OF_PERIODS","PERIOD_PER_SEMESTER","MOCK_CHECKBOX_TREE","codeString","CheckboxTree_stories","CheckboxTree","Template","args","jsx","CheckboxTreeExample","fn","PERIOD_SEGMENT","periodLabelToValue","row","col","CheckboxTreeWithChips","activeFilters","setActiveFilters","useState","handleRemoveActiveFilter","filter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A,IAAA,gBAAAe,EAAC,SAAI,OAAO,EAAE,SAAS,QAAQ,UAAU,QAAQ,KAAK,UAAU,OAAO,QAAQ,cAAc,UAC1F,UAAAQ,KACCA,EAAc,IAAI,CAACS,GAAcC,MAC/B,gBAAAlB;AAAA,MAACmB;AAAA,MAAA;AAAA,QACC,OAAOnC,EAAmBiC,CAAY;AAAA,QACtC,UAAUN;AAAA,MAAA;AAAA,MACL,GAAGO,CAAK,IAAID,CAAY;AAAA,IAAA,CAEhC,GACL;AAAA,IACA,gBAAAjB;AAAA,MAACH;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,cAAcH;AAAA,QACd,gBAAgBc;AAAA,QAChB,UAAUQ;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,GACF;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { f as t } from "../../index-Dbb5M7Zc.js";
|
|
3
3
|
import { Chip as e } from "./Chip.js";
|
|
4
4
|
const s = "<Chip label={string} onDelete={onDeleteFunction(label)}/>", b = {
|
|
5
5
|
title: "Atoms/Chip",
|
|
@@ -9,14 +9,14 @@ const s = "<Chip label={string} onDelete={onDeleteFunction(label)}/>", b = {
|
|
|
9
9
|
inspectComponent: e,
|
|
10
10
|
codeString: s
|
|
11
11
|
}
|
|
12
|
-
},
|
|
12
|
+
}, n = (o) => /* @__PURE__ */ l(e, { ...o }), a = {
|
|
13
13
|
label: "Nederlands",
|
|
14
14
|
onDelete: t()
|
|
15
|
-
}, i =
|
|
15
|
+
}, i = n.bind({});
|
|
16
16
|
i.args = {
|
|
17
17
|
...a
|
|
18
18
|
};
|
|
19
|
-
const r =
|
|
19
|
+
const r = n.bind({});
|
|
20
20
|
r.args = {
|
|
21
21
|
label: "Een filter met een veel te lang label",
|
|
22
22
|
onDelete: t()
|