@uva-glass/component-library 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
._checkbox-
|
|
1
|
+
._checkbox-tree__header_3w3rj_1{display:block;font-weight:var(--semibold);margin-bottom:.25rem;text-align:left}._checkbox-tree__branch_3w3rj_8{list-style:none;-webkit-user-select:none;user-select:none}._checkbox-tree__branch_3w3rj_8[aria-expanded=false]{margin-bottom:.5rem}._checkbox-tree__branch_3w3rj_8 input[type=checkbox]:disabled+label{color:var(--color-grey-300)}._checkbox-tree__branch--icon_3w3rj_21{pointer-events:none;transform:rotate(0);transition:transform .3s ease-out}._checkbox-tree__branch--icon--expanded_3w3rj_27{transform:rotate(90deg);transition:transform .3s ease-in}._checkbox-tree__branch--formfield_3w3rj_32{align-items:center;display:flex;flex-direction:row;gap:.5rem}._checkbox-tree__leaves_3w3rj_39{display:none;flex-direction:column;gap:.5rem;list-style:none;margin:.5rem 0 .5rem 1rem;-webkit-user-select:none;user-select:none}._checkbox-tree__leaves--expanded_3w3rj_48{display:flex}._checkbox-tree__leaf_3w3rj_52{align-items:center;display:flex;flex-direction:row;gap:0 .5rem;margin-left:1.5rem;-webkit-user-select:none;user-select:none}._checkbox-tree__leaf_3w3rj_52 input[type=checkbox]:disabled+label{color:var(--color-grey-300)}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Button as
|
|
2
|
+
import { useRef as B, useEffect as N } from "react";
|
|
3
|
+
import { c as j } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { Icon as T } from "../Icon/Icon.js";
|
|
5
|
+
import { Button as R } from "../Buttons/Button.js";
|
|
6
6
|
import "../Buttons/LinkButton.js";
|
|
7
7
|
import "@react-aria/button";
|
|
8
|
-
import { Checkbox as
|
|
9
|
-
import { Label as
|
|
8
|
+
import { Checkbox as y } from "../Checkbox/Checkbox.js";
|
|
9
|
+
import { Label as w } from "../Label/Label.js";
|
|
10
10
|
import "@react-aria/dialog";
|
|
11
11
|
import "@react-aria/focus";
|
|
12
12
|
import "@react-aria/overlays";
|
|
13
13
|
import "../OverlayCloseButton/OverlayCloseButton.js";
|
|
14
|
-
import { FormField as
|
|
14
|
+
import { FormField as S } from "../FormField/FormField.js";
|
|
15
15
|
import "../GridRow/GridRow.js";
|
|
16
16
|
import "../IconButton/IconButton.js";
|
|
17
17
|
import "../Input/Input.js";
|
|
@@ -26,34 +26,34 @@ import "../SelectListbox/SelectListbox.js";
|
|
|
26
26
|
import "../SelectListbox/SelectProvider.js";
|
|
27
27
|
import "../Sortable/components/SortableItem.js";
|
|
28
28
|
import "../../SortableProvider-BUsvniX7.js";
|
|
29
|
-
import { useResponsive as
|
|
29
|
+
import { useResponsive as I } from "../hooks/useResponsive.js";
|
|
30
30
|
import '../../assets/CheckboxTree.css';const o = {
|
|
31
|
-
"checkbox-tree__header": "_checkbox-
|
|
32
|
-
"checkbox-tree__branch": "_checkbox-
|
|
33
|
-
"checkbox-tree__branch--icon": "_checkbox-tree__branch--
|
|
34
|
-
"checkbox-tree__branch--icon--expanded": "_checkbox-tree__branch--icon--
|
|
35
|
-
"checkbox-tree__branch--formfield": "_checkbox-tree__branch--
|
|
36
|
-
"checkbox-tree__leaves": "_checkbox-
|
|
37
|
-
"checkbox-tree__leaves--expanded": "_checkbox-tree__leaves--
|
|
38
|
-
"checkbox-tree__leaf": "_checkbox-
|
|
31
|
+
"checkbox-tree__header": "_checkbox-tree__header_3w3rj_1",
|
|
32
|
+
"checkbox-tree__branch": "_checkbox-tree__branch_3w3rj_8",
|
|
33
|
+
"checkbox-tree__branch--icon": "_checkbox-tree__branch--icon_3w3rj_21",
|
|
34
|
+
"checkbox-tree__branch--icon--expanded": "_checkbox-tree__branch--icon--expanded_3w3rj_27",
|
|
35
|
+
"checkbox-tree__branch--formfield": "_checkbox-tree__branch--formfield_3w3rj_32",
|
|
36
|
+
"checkbox-tree__leaves": "_checkbox-tree__leaves_3w3rj_39",
|
|
37
|
+
"checkbox-tree__leaves--expanded": "_checkbox-tree__leaves--expanded_3w3rj_48",
|
|
38
|
+
"checkbox-tree__leaf": "_checkbox-tree__leaf_3w3rj_52"
|
|
39
39
|
}, _e = ({
|
|
40
40
|
title: b,
|
|
41
|
-
checkboxTree:
|
|
41
|
+
checkboxTree: C,
|
|
42
42
|
defaultValue: l,
|
|
43
|
-
noLabelFrontWeight:
|
|
44
|
-
onChange:
|
|
43
|
+
noLabelFrontWeight: m = !1,
|
|
44
|
+
onChange: u
|
|
45
45
|
}) => {
|
|
46
|
-
const s =
|
|
46
|
+
const s = B([]), { lessThan: n } = I(), _ = (r, e = document) => [].slice.call(e.querySelectorAll(r)), A = () => {
|
|
47
47
|
const r = s.current.reduce((e, t) => (t.name && t.checked && e.push(t.value), e), []);
|
|
48
|
-
|
|
49
|
-
},
|
|
48
|
+
u && u(r);
|
|
49
|
+
}, x = (r) => {
|
|
50
50
|
var e, t, d;
|
|
51
51
|
for (; r; ) {
|
|
52
52
|
const c = (t = (e = r.closest("[data-ul]")) == null ? void 0 : e.parentNode) == null ? void 0 : t.querySelector("input"), k = _(
|
|
53
53
|
"input",
|
|
54
54
|
(d = c == null ? void 0 : c.closest("[data-li]")) == null ? void 0 : d.querySelector("[data-ul]")
|
|
55
|
-
).reduce((
|
|
56
|
-
if (c && (c.checked = p, c.indeterminate = !p && p !==
|
|
55
|
+
).reduce((v, g) => (g.disabled || v.push(g.checked), v), []), p = k.every(Boolean), F = k.some(Boolean);
|
|
56
|
+
if (c && (c.checked = p, c.indeterminate = !p && p !== F), !c || r === c)
|
|
57
57
|
break;
|
|
58
58
|
r = c;
|
|
59
59
|
}
|
|
@@ -64,7 +64,7 @@ import '../../assets/CheckboxTree.css';const o = {
|
|
|
64
64
|
"aria-expanded",
|
|
65
65
|
((d = e == null ? void 0 : e.closest("[data-li]")) == null ? void 0 : d.getAttribute("aria-expanded")) === "false" ? "true" : "false"
|
|
66
66
|
), t && t.classList.toggle(o["checkbox-tree__leaves--expanded"]);
|
|
67
|
-
},
|
|
67
|
+
}, E = (r) => {
|
|
68
68
|
var c;
|
|
69
69
|
const e = r.target;
|
|
70
70
|
if (!e || !e.parentNode || !e.parentNode.parentNode) return;
|
|
@@ -74,50 +74,50 @@ import '../../assets/CheckboxTree.css';const o = {
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
if (s.current.indexOf(e) === -1) return;
|
|
77
|
-
(e.parentNode.parentNode ? _("input", e.parentNode.parentNode) : []).forEach((h) => h.checked = h.disabled ? !1 : e.checked),
|
|
78
|
-
},
|
|
77
|
+
(e.parentNode.parentNode ? _("input", e.parentNode.parentNode) : []).forEach((h) => h.checked = h.disabled ? !1 : e.checked), x(e), A();
|
|
78
|
+
}, q = (r) => {
|
|
79
79
|
const e = r.target, t = e.closest("[data-li]");
|
|
80
80
|
f(e, t);
|
|
81
81
|
};
|
|
82
|
-
return
|
|
82
|
+
return N(() => {
|
|
83
83
|
s.current = _("input") || [];
|
|
84
|
-
}, []),
|
|
84
|
+
}, []), N(() => {
|
|
85
85
|
l && s.current.forEach((r) => {
|
|
86
|
-
l.includes(r.value) && (r.checked = !0,
|
|
86
|
+
l.includes(r.value) && (r.checked = !0, x(r));
|
|
87
87
|
});
|
|
88
88
|
}, [l]), /* @__PURE__ */ i("div", { children: [
|
|
89
89
|
b && /* @__PURE__ */ a("span", { className: o["checkbox-tree__header"], children: b }),
|
|
90
|
-
/* @__PURE__ */ a("div", { onClick:
|
|
90
|
+
/* @__PURE__ */ a("div", { onClick: E, "data-ul": !0, role: "tree", tabIndex: 0, children: C.map(({ itemName: r, children: e }) => /* @__PURE__ */ i(
|
|
91
91
|
"div",
|
|
92
92
|
{
|
|
93
93
|
className: o["checkbox-tree__branch"],
|
|
94
94
|
"data-li": !0,
|
|
95
95
|
"aria-expanded": n.md ? "false" : "true",
|
|
96
96
|
children: [
|
|
97
|
-
/* @__PURE__ */ i(
|
|
98
|
-
/* @__PURE__ */ a(
|
|
99
|
-
|
|
97
|
+
/* @__PURE__ */ i(S, { inline: !0, className: o["checkbox-tree__branch--formfield"], children: [
|
|
98
|
+
/* @__PURE__ */ a(R, { variant: "blank", onClick: q, children: /* @__PURE__ */ a(
|
|
99
|
+
T,
|
|
100
100
|
{
|
|
101
101
|
name: "CheveronRight",
|
|
102
102
|
size: 16,
|
|
103
|
-
className:
|
|
103
|
+
className: j(o["checkbox-tree__branch--icon"], {
|
|
104
104
|
[o["checkbox-tree__branch--icon--expanded"]]: !n.md
|
|
105
105
|
})
|
|
106
106
|
}
|
|
107
107
|
) }),
|
|
108
|
-
/* @__PURE__ */ a(
|
|
109
|
-
/* @__PURE__ */ a(
|
|
108
|
+
/* @__PURE__ */ a(y, { id: r, disabled: e.every((t) => t.disabled) }),
|
|
109
|
+
/* @__PURE__ */ a(w, { htmlFor: r, noFontWeight: m, children: r })
|
|
110
110
|
] }),
|
|
111
111
|
/* @__PURE__ */ a(
|
|
112
112
|
"div",
|
|
113
113
|
{
|
|
114
|
-
className:
|
|
114
|
+
className: j(o["checkbox-tree__leaves"], {
|
|
115
115
|
[o["checkbox-tree__leaves--expanded"]]: !n.md
|
|
116
116
|
}),
|
|
117
117
|
"data-ul": !0,
|
|
118
|
-
children: e.map(({ itemName: t, itemValue: d, disabled: c }) => /* @__PURE__ */ a("div", { className: o["checkbox-tree__leaf"], "data-li": !0, children: /* @__PURE__ */ i(
|
|
119
|
-
/* @__PURE__ */ a(
|
|
120
|
-
/* @__PURE__ */ a(
|
|
118
|
+
children: e.map(({ itemName: t, itemValue: d, disabled: c }) => /* @__PURE__ */ a("div", { className: o["checkbox-tree__leaf"], "data-li": !0, children: /* @__PURE__ */ i(S, { inline: !0, className: o["checkbox-tree__branch--formfield"], children: [
|
|
119
|
+
/* @__PURE__ */ a(y, { id: t, name: t, value: d, disabled: c }),
|
|
120
|
+
/* @__PURE__ */ a(w, { htmlFor: t, noFontWeight: m, children: t })
|
|
121
121
|
] }) }, t))
|
|
122
122
|
}
|
|
123
123
|
)
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@uva-glass/component-library",
|
|
3
3
|
"author": "Team Glass - Frontend vrienden",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "2.6.
|
|
5
|
+
"version": "2.6.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react-dom": "^18.3.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@commitlint/cli": "^19.6.
|
|
43
|
+
"@commitlint/cli": "^19.6.1",
|
|
44
44
|
"@commitlint/config-conventional": "^19.6.0",
|
|
45
45
|
"@react-aria/button": "^3.11.0",
|
|
46
46
|
"@react-aria/dialog": "^3.5.20",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"stylelint-config-recommended": "^14.0.1",
|
|
86
86
|
"stylelint-config-standard": "^36.0.1",
|
|
87
87
|
"stylelint-order": "^6.0.4",
|
|
88
|
-
"stylelint": "^16.
|
|
88
|
+
"stylelint": "^16.12.0",
|
|
89
89
|
"typescript": "^5.7.2",
|
|
90
90
|
"vite-plugin-dts": "^4.3.0",
|
|
91
91
|
"vite-plugin-lib-inject-css": "^2.1.1",
|