@selectwin/kit 0.1.256 → 0.1.258
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/README.md +57 -0
- package/dist/SelectActionList.d.ts +5 -0
- package/dist/SelectActionList.js +55 -39
- package/dist/SelectAppFrame.d.ts +8 -2
- package/dist/SelectAppFrame.js +124 -119
- package/dist/SelectAvatarGroup.d.ts +31 -0
- package/dist/SelectAvatarGroup.js +39 -0
- package/dist/SelectBadge.d.ts +1 -1
- package/dist/SelectChannelPreview.d.ts +15 -5
- package/dist/SelectChannelPreview.js +94 -54
- package/dist/SelectConversationNote.d.ts +37 -0
- package/dist/SelectConversationNote.js +93 -0
- package/dist/SelectFieldset.d.ts +14 -0
- package/dist/SelectFieldset.js +27 -0
- package/dist/SelectFilterBar.d.ts +6 -1
- package/dist/SelectFilterBar.js +153 -123
- package/dist/SelectImageUploadField.d.ts +5 -3
- package/dist/SelectImageUploadField.js +26 -26
- package/dist/SelectKanban.d.ts +13 -1
- package/dist/SelectKanban.js +72 -50
- package/dist/SelectLocale.d.ts +40 -0
- package/dist/SelectLocale.js +560 -511
- package/dist/SelectMail.d.ts +17 -2
- package/dist/SelectMail.js +9 -6
- package/dist/SelectModal.d.ts +10 -4
- package/dist/SelectModal.js +158 -137
- package/dist/SelectSegmented.d.ts +7 -0
- package/dist/SelectSegmented.js +51 -43
- package/dist/SelectSideNav.d.ts +2 -1
- package/dist/SelectSideNav.js +156 -135
- package/dist/SelectSortable.d.ts +47 -1
- package/dist/SelectSortable.js +138 -19
- package/dist/SelectSteps.d.ts +3 -0
- package/dist/SelectSteps.js +42 -31
- package/dist/SelectTimeline.d.ts +4 -0
- package/dist/SelectTimeline.js +20 -9
- package/dist/SelectTriggerMenu.d.ts +77 -0
- package/dist/SelectTriggerMenu.js +98 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +186 -182
- package/dist/internal/navCount.d.ts +21 -0
- package/dist/internal/navCount.js +27 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectSegmented.js
CHANGED
|
@@ -1,95 +1,103 @@
|
|
|
1
1
|
import { forwardRef as e, useId as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
|
|
2
2
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
3
3
|
//#region src/SelectSegmented.tsx
|
|
4
|
-
var s = e(function({ value: e, onChange: s, options: c, ariaLabel: l, fullWidth: u = !1, label: d, hint: f, disabled: p = !1, error: m,
|
|
5
|
-
let
|
|
4
|
+
var s = e(function({ value: e, onChange: s, options: c, ariaLabel: l, fullWidth: u = !1, label: d, hint: f, disabled: p = !1, error: m, variant: h = "track", semantics: g = h === "chips" ? "radio" : "tabs", size: _ = "md", className: v, ...y }, b) {
|
|
5
|
+
let x = t(), S = Math.max(0, c.findIndex((t) => t.value === e)), C = r([]), [w, T] = i(null), E = g === "radio", D = c.map((e) => e.count ?? "").join(",");
|
|
6
6
|
n(() => {
|
|
7
7
|
let e = () => {
|
|
8
|
-
let e =
|
|
8
|
+
let e = C.current[S];
|
|
9
9
|
if (!e) return;
|
|
10
10
|
let t = {
|
|
11
11
|
left: e.offsetLeft,
|
|
12
12
|
width: e.offsetWidth
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
T((e) => e && e.left === t.left && e.width === t.width ? e : t);
|
|
15
15
|
};
|
|
16
16
|
e();
|
|
17
17
|
let t = typeof ResizeObserver < "u" ? new ResizeObserver(e) : null;
|
|
18
|
-
return
|
|
18
|
+
return C.current.forEach((e) => e && (t == null ? void 0 : t.observe(e))), () => t == null ? void 0 : t.disconnect();
|
|
19
19
|
}, [
|
|
20
|
-
|
|
20
|
+
S,
|
|
21
21
|
c.length,
|
|
22
|
-
|
|
22
|
+
D
|
|
23
23
|
]);
|
|
24
|
-
let
|
|
25
|
-
left:
|
|
26
|
-
width:
|
|
24
|
+
let O = w ? {
|
|
25
|
+
left: w.left,
|
|
26
|
+
width: w.width,
|
|
27
27
|
opacity: 1
|
|
28
|
-
} : { opacity: 0 },
|
|
28
|
+
} : { opacity: 0 }, k = d == null ? y : {}, A = (t) => {
|
|
29
29
|
var n, r;
|
|
30
|
-
if ((n =
|
|
31
|
-
let i =
|
|
30
|
+
if ((n = k.onKeyDown) == null || n.call(k, t), t.defaultPrevented || p || !c.length) return;
|
|
31
|
+
let i = C.current.findIndex((e) => e === t.target);
|
|
32
32
|
if (i < 0) return;
|
|
33
|
-
let a = t.key === "ArrowRight" ||
|
|
34
|
-
l < 0 || (t.preventDefault(), (r =
|
|
35
|
-
},
|
|
36
|
-
ref: d == null ?
|
|
37
|
-
...
|
|
38
|
-
className: `select-segmented${u ? " select-segmented--full" : ""}${
|
|
39
|
-
role:
|
|
33
|
+
let a = t.key === "ArrowRight" || E && t.key === "ArrowDown", o = t.key === "ArrowLeft" || E && t.key === "ArrowUp", l = a ? (i + 1) % c.length : o ? (i - 1 + c.length) % c.length : t.key === "Home" ? 0 : t.key === "End" ? c.length - 1 : -1;
|
|
34
|
+
l < 0 || (t.preventDefault(), (r = C.current[l]) == null || r.focus(), c[l].value !== e && s(c[l].value));
|
|
35
|
+
}, j = /* @__PURE__ */ o("div", {
|
|
36
|
+
ref: d == null ? b : void 0,
|
|
37
|
+
...k,
|
|
38
|
+
className: `select-segmented${h === "chips" ? " select-segmented--chips" : ""}${u ? " select-segmented--full" : ""}${_ === "sm" ? " select-segmented--sm" : ""}${p ? " select-segmented--disabled" : ""}${m != null && m !== !1 ? " select-segmented--error" : ""}${d == null && v ? " " + v : ""}`,
|
|
39
|
+
role: E ? "radiogroup" : "tablist",
|
|
40
40
|
"aria-label": l,
|
|
41
|
-
"aria-labelledby": d != null && !l ?
|
|
41
|
+
"aria-labelledby": d != null && !l ? x : void 0,
|
|
42
42
|
"aria-disabled": p || void 0,
|
|
43
|
-
onKeyDown:
|
|
44
|
-
children: [/* @__PURE__ */ a("span", {
|
|
43
|
+
onKeyDown: A,
|
|
44
|
+
children: [h === "chips" ? null : /* @__PURE__ */ a("span", {
|
|
45
45
|
className: "select-segmented__pill",
|
|
46
46
|
"aria-hidden": "true",
|
|
47
|
-
style:
|
|
47
|
+
style: O
|
|
48
48
|
}), c.map((t, n) => {
|
|
49
49
|
let r = t.value === e, i = !!t.count && t.count > 0, c = t.title && i ? `${t.title}, ${t.countLabel ?? t.count}` : t.title;
|
|
50
50
|
return /* @__PURE__ */ o("button", {
|
|
51
51
|
ref: (e) => {
|
|
52
|
-
|
|
52
|
+
C.current[n] = e;
|
|
53
53
|
},
|
|
54
54
|
type: "button",
|
|
55
|
-
role:
|
|
56
|
-
"aria-selected":
|
|
57
|
-
"aria-checked":
|
|
58
|
-
tabIndex: n ===
|
|
55
|
+
role: E ? "radio" : "tab",
|
|
56
|
+
"aria-selected": E ? void 0 : r,
|
|
57
|
+
"aria-checked": E ? r : void 0,
|
|
58
|
+
tabIndex: n === S ? 0 : -1,
|
|
59
59
|
className: `select-segmented__item${r ? " select-segmented__item--active" : ""}`,
|
|
60
60
|
title: t.title,
|
|
61
61
|
"aria-label": c,
|
|
62
62
|
disabled: p,
|
|
63
63
|
onClick: () => s(t.value),
|
|
64
|
-
children: [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
children: [
|
|
65
|
+
t.icon != null && t.icon !== !1 ? /* @__PURE__ */ a("span", {
|
|
66
|
+
className: "select-segmented__icon",
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
children: t.icon
|
|
69
|
+
}) : null,
|
|
70
|
+
t.label,
|
|
71
|
+
i ? /* @__PURE__ */ a("span", {
|
|
72
|
+
className: "select-segmented__count",
|
|
73
|
+
"aria-hidden": t.title ? !0 : void 0,
|
|
74
|
+
children: t.count
|
|
75
|
+
}) : null
|
|
76
|
+
]
|
|
69
77
|
}, t.value);
|
|
70
78
|
})]
|
|
71
|
-
}),
|
|
72
|
-
return d == null && !
|
|
79
|
+
}), M = m != null && m !== !1 && m !== "";
|
|
80
|
+
return d == null && !M ? j : d == null ? /* @__PURE__ */ o("div", {
|
|
73
81
|
className: "select-field",
|
|
74
|
-
children: [
|
|
82
|
+
children: [j, /* @__PURE__ */ a("p", {
|
|
75
83
|
className: "select-field__error",
|
|
76
84
|
children: m
|
|
77
85
|
})]
|
|
78
86
|
}) : /* @__PURE__ */ o("div", {
|
|
79
|
-
ref:
|
|
80
|
-
...
|
|
81
|
-
className: `select-field${
|
|
87
|
+
ref: b,
|
|
88
|
+
...y,
|
|
89
|
+
className: `select-field${v ? " " + v : ""}`,
|
|
82
90
|
children: [
|
|
83
91
|
/* @__PURE__ */ a("div", {
|
|
84
92
|
className: "select-field__labelrow",
|
|
85
93
|
children: /* @__PURE__ */ a("span", {
|
|
86
94
|
className: "select-field__label",
|
|
87
|
-
id:
|
|
95
|
+
id: x,
|
|
88
96
|
children: d
|
|
89
97
|
})
|
|
90
98
|
}),
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
j,
|
|
100
|
+
M ? /* @__PURE__ */ a("p", {
|
|
93
101
|
className: "select-field__error",
|
|
94
102
|
children: m
|
|
95
103
|
}) : f != null && /* @__PURE__ */ a("p", {
|
package/dist/SelectSideNav.d.ts
CHANGED
package/dist/SelectSideNav.js
CHANGED
|
@@ -3,12 +3,13 @@ import { ChevronDownIcon as t } from "./icons.js";
|
|
|
3
3
|
import { SelectTooltip as n } from "./SelectTooltip.js";
|
|
4
4
|
import { useSelectMessages as r } from "./SelectLocale.js";
|
|
5
5
|
import { SelectPopover as i } from "./SelectPopover.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { NavCount as a, hasNavCount as o, useNavCountName as s } from "./internal/navCount.js";
|
|
7
|
+
import { SelectMenu as c, SelectMenuHeading as l, SelectMenuItem as u } from "./SelectMenu.js";
|
|
8
|
+
import { Fragment as d, forwardRef as f, useEffect as p, useLayoutEffect as m, useRef as h, useState as g } from "react";
|
|
9
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
10
|
+
import { Link as y } from "react-router-dom";
|
|
10
11
|
//#region src/SelectSideNav.tsx
|
|
11
|
-
function
|
|
12
|
+
function b({ item: t, className: n, active: r, onSelect: i, tabIndex: a, label: o, children: s }) {
|
|
12
13
|
let c = t.to != null || t.href != null ? e(t.to ?? t.href) : void 0, l = {
|
|
13
14
|
className: n,
|
|
14
15
|
tabIndex: a,
|
|
@@ -16,224 +17,240 @@ function _({ item: t, className: n, active: r, onSelect: i, tabIndex: a, label:
|
|
|
16
17
|
"aria-label": o,
|
|
17
18
|
onClick: () => i(t.id)
|
|
18
19
|
};
|
|
19
|
-
return c !== void 0 && t.to != null ? /* @__PURE__ */
|
|
20
|
+
return c !== void 0 && t.to != null ? /* @__PURE__ */ _(y, {
|
|
20
21
|
...l,
|
|
21
22
|
to: c,
|
|
22
23
|
"aria-current": r ? "page" : void 0,
|
|
23
24
|
children: s
|
|
24
|
-
}) : c === void 0 ? /* @__PURE__ */
|
|
25
|
+
}) : c === void 0 ? /* @__PURE__ */ _("button", {
|
|
25
26
|
type: "button",
|
|
26
27
|
...l,
|
|
27
28
|
children: s
|
|
28
|
-
}) : /* @__PURE__ */
|
|
29
|
+
}) : /* @__PURE__ */ _("a", {
|
|
29
30
|
...l,
|
|
30
31
|
href: c,
|
|
31
32
|
"aria-current": r ? "page" : void 0,
|
|
32
33
|
children: s
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function x(e, t) {
|
|
36
37
|
var n;
|
|
37
|
-
return ((n = e.children) == null ? void 0 : n.some((e) => e.id === t ||
|
|
38
|
+
return ((n = e.children) == null ? void 0 : n.some((e) => e.id === t || x(e, t))) ?? !1;
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
-
let i = e.alwaysOpen === !0,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
let
|
|
45
|
-
return
|
|
40
|
+
function S({ item: e, active: n, onSelect: r }) {
|
|
41
|
+
let i = e.alwaysOpen === !0, o = x(e, n), [s, c] = g(o);
|
|
42
|
+
p(() => {
|
|
43
|
+
c(o);
|
|
44
|
+
}, [o]);
|
|
45
|
+
let l = i || s, u = h(null), [d, f] = g(null), [y, S] = g(0);
|
|
46
|
+
return m(() => {
|
|
46
47
|
var e;
|
|
47
|
-
let t =
|
|
48
|
-
n && r && (n = ((e = r.parentElement) == null ? void 0 : e.querySelector(":scope > .select-sidenav__item")) ?? null),
|
|
48
|
+
let t = u.current, n = (t == null ? void 0 : t.querySelector(".select-sidenav__item--child.is-active")) ?? null, r = n == null ? void 0 : n.closest(".select-sidenav__subgroup .select-sidenav__collapse[data-open=\"false\"]");
|
|
49
|
+
n && r && (n = ((e = r.parentElement) == null ? void 0 : e.querySelector(":scope > .select-sidenav__item")) ?? null), f(n && l ? C(n, t) : null);
|
|
49
50
|
}, [
|
|
50
51
|
n,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
]),
|
|
54
|
-
let e =
|
|
52
|
+
l,
|
|
53
|
+
y
|
|
54
|
+
]), p(() => {
|
|
55
|
+
let e = u.current;
|
|
55
56
|
if (!e || typeof ResizeObserver > "u") return;
|
|
56
|
-
let t = new ResizeObserver(() =>
|
|
57
|
+
let t = new ResizeObserver(() => S((e) => e + 1));
|
|
57
58
|
return t.observe(e), () => t.disconnect();
|
|
58
|
-
}, []), /* @__PURE__ */
|
|
59
|
+
}, []), /* @__PURE__ */ v("div", {
|
|
59
60
|
className: "select-sidenav__group",
|
|
60
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ v("button", {
|
|
61
62
|
type: "button",
|
|
62
|
-
className: i ? `select-sidenav__item${e.id === n ? " is-active" : ""}` : `select-sidenav__item select-sidenav__item--parent${
|
|
63
|
-
onClick: () => i ? r(e.id) :
|
|
63
|
+
className: i ? `select-sidenav__item${e.id === n ? " is-active" : ""}` : `select-sidenav__item select-sidenav__item--parent${s ? " is-open" : ""}`,
|
|
64
|
+
onClick: () => i ? r(e.id) : c((e) => !e),
|
|
64
65
|
"data-nav-id": e.id,
|
|
65
|
-
"aria-expanded": i ? void 0 :
|
|
66
|
+
"aria-expanded": i ? void 0 : s,
|
|
66
67
|
children: [
|
|
67
|
-
e.icon && /* @__PURE__ */
|
|
68
|
+
e.icon && /* @__PURE__ */ _("span", {
|
|
68
69
|
className: "select-sidenav__icon",
|
|
69
70
|
children: e.icon
|
|
70
71
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ _("span", {
|
|
72
73
|
className: "select-sidenav__label",
|
|
73
74
|
children: e.label
|
|
74
75
|
}),
|
|
75
|
-
|
|
76
|
+
/* @__PURE__ */ _(a, { item: e }),
|
|
77
|
+
!i && /* @__PURE__ */ _("span", {
|
|
76
78
|
className: "select-sidenav__chevron",
|
|
77
79
|
"aria-hidden": "true",
|
|
78
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ _(t, {})
|
|
79
81
|
})
|
|
80
82
|
]
|
|
81
|
-
}), /* @__PURE__ */
|
|
83
|
+
}), /* @__PURE__ */ _("div", {
|
|
82
84
|
className: "select-sidenav__collapse",
|
|
83
|
-
"data-open":
|
|
84
|
-
"aria-hidden": !
|
|
85
|
-
children: /* @__PURE__ */
|
|
85
|
+
"data-open": l,
|
|
86
|
+
"aria-hidden": !l,
|
|
87
|
+
children: /* @__PURE__ */ v("div", {
|
|
86
88
|
className: "select-sidenav__children",
|
|
87
|
-
ref:
|
|
89
|
+
ref: u,
|
|
88
90
|
onTransitionEnd: (e) => {
|
|
89
|
-
e.propertyName === "grid-template-rows" &&
|
|
91
|
+
e.propertyName === "grid-template-rows" && S((e) => e + 1);
|
|
90
92
|
},
|
|
91
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ _("span", {
|
|
92
94
|
className: "select-sidenav__rail-active",
|
|
93
95
|
"aria-hidden": "true",
|
|
94
96
|
style: {
|
|
95
|
-
top:
|
|
96
|
-
opacity:
|
|
97
|
+
top: d ?? 0,
|
|
98
|
+
opacity: d == null ? 0 : 1
|
|
97
99
|
}
|
|
98
100
|
}), e.children.map((e) => {
|
|
99
101
|
var t;
|
|
100
|
-
return (t = e.children) != null && t.length ? /* @__PURE__ */
|
|
102
|
+
return (t = e.children) != null && t.length ? /* @__PURE__ */ _(w, {
|
|
101
103
|
item: e,
|
|
102
104
|
active: n,
|
|
103
105
|
onSelect: r,
|
|
104
|
-
tabbable:
|
|
105
|
-
}, e.id) : /* @__PURE__ */
|
|
106
|
+
tabbable: l
|
|
107
|
+
}, e.id) : /* @__PURE__ */ v(b, {
|
|
106
108
|
item: e,
|
|
107
109
|
active: e.id === n,
|
|
108
110
|
onSelect: r,
|
|
109
111
|
className: `select-sidenav__item select-sidenav__item--child${e.id === n ? " is-active" : ""}`,
|
|
110
|
-
tabIndex:
|
|
111
|
-
children: [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
tabIndex: l ? void 0 : -1,
|
|
113
|
+
children: [
|
|
114
|
+
e.icon && /* @__PURE__ */ _("span", {
|
|
115
|
+
className: "select-sidenav__icon",
|
|
116
|
+
children: e.icon
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ _("span", {
|
|
119
|
+
className: "select-sidenav__label",
|
|
120
|
+
children: e.label
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ _(a, { item: e })
|
|
123
|
+
]
|
|
118
124
|
}, e.id);
|
|
119
125
|
})]
|
|
120
126
|
})
|
|
121
127
|
})]
|
|
122
128
|
});
|
|
123
129
|
}
|
|
124
|
-
function
|
|
130
|
+
function C(e, t) {
|
|
125
131
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
126
132
|
return n.top - r.top + t.scrollTop + n.height / 2;
|
|
127
133
|
}
|
|
128
|
-
function
|
|
129
|
-
let
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
}, [
|
|
134
|
+
function w({ item: e, active: n, onSelect: r, tabbable: i }) {
|
|
135
|
+
let o = x(e, n), [s, c] = g(o);
|
|
136
|
+
return p(() => {
|
|
137
|
+
o && c(!0);
|
|
138
|
+
}, [o]), /* @__PURE__ */ v("div", {
|
|
133
139
|
className: "select-sidenav__subgroup",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ v("button", {
|
|
135
141
|
type: "button",
|
|
136
|
-
className: `select-sidenav__item select-sidenav__item--child select-sidenav__item--subparent${
|
|
137
|
-
onClick: () =>
|
|
138
|
-
"aria-expanded":
|
|
142
|
+
className: `select-sidenav__item select-sidenav__item--child select-sidenav__item--subparent${s ? " is-open" : ""}${o && !s ? " is-active" : ""}`,
|
|
143
|
+
onClick: () => c((e) => !e),
|
|
144
|
+
"aria-expanded": s,
|
|
139
145
|
tabIndex: i ? void 0 : -1,
|
|
140
146
|
"data-nav-id": e.id,
|
|
141
147
|
children: [
|
|
142
|
-
e.icon && /* @__PURE__ */
|
|
148
|
+
e.icon && /* @__PURE__ */ _("span", {
|
|
143
149
|
className: "select-sidenav__icon",
|
|
144
150
|
children: e.icon
|
|
145
151
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ _("span", {
|
|
147
153
|
className: "select-sidenav__label",
|
|
148
154
|
children: e.label
|
|
149
155
|
}),
|
|
150
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ _(a, { item: e }),
|
|
157
|
+
/* @__PURE__ */ _("span", {
|
|
151
158
|
className: "select-sidenav__chevron",
|
|
152
159
|
"aria-hidden": "true",
|
|
153
|
-
children: /* @__PURE__ */
|
|
160
|
+
children: /* @__PURE__ */ _(t, {})
|
|
154
161
|
})
|
|
155
162
|
]
|
|
156
|
-
}), /* @__PURE__ */
|
|
163
|
+
}), /* @__PURE__ */ _("div", {
|
|
157
164
|
className: "select-sidenav__collapse",
|
|
158
|
-
"data-open":
|
|
159
|
-
"aria-hidden": !
|
|
160
|
-
children: /* @__PURE__ */
|
|
165
|
+
"data-open": s,
|
|
166
|
+
"aria-hidden": !s,
|
|
167
|
+
children: /* @__PURE__ */ _("div", {
|
|
161
168
|
className: "select-sidenav__subchildren",
|
|
162
|
-
children: e.children.map((e) => /* @__PURE__ */
|
|
169
|
+
children: e.children.map((e) => /* @__PURE__ */ v(b, {
|
|
163
170
|
item: e,
|
|
164
171
|
active: e.id === n,
|
|
165
172
|
onSelect: r,
|
|
166
173
|
className: `select-sidenav__item select-sidenav__item--child select-sidenav__item--grandchild${e.id === n ? " is-active" : ""}`,
|
|
167
|
-
tabIndex: i &&
|
|
168
|
-
children: [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
tabIndex: i && s ? void 0 : -1,
|
|
175
|
+
children: [
|
|
176
|
+
e.icon && /* @__PURE__ */ _("span", {
|
|
177
|
+
className: "select-sidenav__icon",
|
|
178
|
+
children: e.icon
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ _("span", {
|
|
181
|
+
className: "select-sidenav__label",
|
|
182
|
+
children: e.label
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ _(a, { item: e })
|
|
185
|
+
]
|
|
175
186
|
}, e.id))
|
|
176
187
|
})
|
|
177
188
|
})]
|
|
178
189
|
});
|
|
179
190
|
}
|
|
180
|
-
function
|
|
191
|
+
function T(e) {
|
|
181
192
|
return e.hint ?? (typeof e.label == "string" ? e.label : e.id);
|
|
182
193
|
}
|
|
183
|
-
function
|
|
184
|
-
var
|
|
185
|
-
let [
|
|
194
|
+
function E({ item: e, active: t, onSelect: f }) {
|
|
195
|
+
var p;
|
|
196
|
+
let [m, h] = g(!1), y = r().sideNav.pending, b = s(), S = T(e), C = !!((p = e.children) != null && p.length), w = e.id === t || x(e, t), E = o(e), D = /* @__PURE__ */ v("button", {
|
|
186
197
|
type: "button",
|
|
187
|
-
className: `select-sidenav__railitem${
|
|
188
|
-
"aria-label": e.indicator ?
|
|
189
|
-
"aria-haspopup":
|
|
190
|
-
"aria-expanded":
|
|
191
|
-
"aria-current": !
|
|
198
|
+
className: `select-sidenav__railitem${w ? " is-active" : ""}${m ? " is-open" : ""}`,
|
|
199
|
+
"aria-label": b(e.indicator ? y(S) : S, e),
|
|
200
|
+
"aria-haspopup": C ? "menu" : void 0,
|
|
201
|
+
"aria-expanded": C ? m : void 0,
|
|
202
|
+
"aria-current": !C && e.id === t ? "page" : void 0,
|
|
192
203
|
"data-nav-id": e.id,
|
|
193
|
-
onClick: () =>
|
|
194
|
-
children: [e.icon ? /* @__PURE__ */
|
|
204
|
+
onClick: () => C ? h((e) => !e) : f(e.id),
|
|
205
|
+
children: [e.icon ? /* @__PURE__ */ _("span", {
|
|
195
206
|
className: "select-sidenav__icon",
|
|
196
207
|
children: e.icon
|
|
197
|
-
}) : /* @__PURE__ */
|
|
208
|
+
}) : /* @__PURE__ */ _("span", {
|
|
198
209
|
className: "select-sidenav__railinitial",
|
|
199
|
-
children:
|
|
200
|
-
}),
|
|
210
|
+
children: S.charAt(0)
|
|
211
|
+
}), E ? /* @__PURE__ */ _(a, {
|
|
212
|
+
item: e,
|
|
213
|
+
corner: !0,
|
|
214
|
+
spoken: !1
|
|
215
|
+
}) : e.indicator ? /* @__PURE__ */ _("span", {
|
|
201
216
|
className: "select-sidenav__raildot",
|
|
202
217
|
"aria-hidden": "true"
|
|
203
218
|
}) : null]
|
|
204
219
|
});
|
|
205
|
-
if (!
|
|
206
|
-
content:
|
|
220
|
+
if (!C) return /* @__PURE__ */ _(n, {
|
|
221
|
+
content: S,
|
|
207
222
|
placement: "right",
|
|
208
|
-
children:
|
|
223
|
+
children: D
|
|
209
224
|
});
|
|
210
|
-
let
|
|
211
|
-
|
|
225
|
+
let O = (e) => {
|
|
226
|
+
h(!1), f(e);
|
|
212
227
|
};
|
|
213
|
-
return /* @__PURE__ */
|
|
214
|
-
active:
|
|
215
|
-
onClose: () =>
|
|
216
|
-
activator:
|
|
228
|
+
return /* @__PURE__ */ _(i, {
|
|
229
|
+
active: m,
|
|
230
|
+
onClose: () => h(!1),
|
|
231
|
+
activator: D,
|
|
217
232
|
placement: "right",
|
|
218
233
|
role: "menu",
|
|
219
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ v(c, {
|
|
220
235
|
className: "select-sidenav__railmenu",
|
|
221
236
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
e.alwaysOpen ? /* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ _(l, { children: S }),
|
|
238
|
+
e.alwaysOpen ? /* @__PURE__ */ _(u, {
|
|
224
239
|
active: e.id === t,
|
|
225
|
-
onClick: () =>
|
|
240
|
+
onClick: () => O(e.id),
|
|
226
241
|
children: e.label
|
|
227
242
|
}) : null,
|
|
228
243
|
e.children.map((e) => {
|
|
229
244
|
var n;
|
|
230
|
-
return (n = e.children) != null && n.length ? /* @__PURE__ */
|
|
245
|
+
return (n = e.children) != null && n.length ? /* @__PURE__ */ v(d, { children: [/* @__PURE__ */ _(l, { children: T(e) }), e.children.map((e) => /* @__PURE__ */ _(u, {
|
|
231
246
|
active: e.id === t,
|
|
232
|
-
onClick: () =>
|
|
247
|
+
onClick: () => O(e.id),
|
|
248
|
+
trailing: o(e) ? /* @__PURE__ */ _(a, { item: e }) : void 0,
|
|
233
249
|
children: e.label
|
|
234
|
-
}, e.id))] }, e.id) : /* @__PURE__ */
|
|
250
|
+
}, e.id))] }, e.id) : /* @__PURE__ */ _(u, {
|
|
235
251
|
active: e.id === t,
|
|
236
|
-
onClick: () =>
|
|
252
|
+
onClick: () => O(e.id),
|
|
253
|
+
trailing: o(e) ? /* @__PURE__ */ _(a, { item: e }) : void 0,
|
|
237
254
|
children: e.label
|
|
238
255
|
}, e.id);
|
|
239
256
|
})
|
|
@@ -241,54 +258,58 @@ function C({ item: e, active: t, onSelect: l }) {
|
|
|
241
258
|
})
|
|
242
259
|
});
|
|
243
260
|
}
|
|
244
|
-
var
|
|
245
|
-
return i ? /* @__PURE__ */
|
|
246
|
-
ref:
|
|
247
|
-
...
|
|
248
|
-
className: `select-sidenav select-sidenav--rail${
|
|
249
|
-
children: e.map((e, r) => /* @__PURE__ */
|
|
261
|
+
var D = f(function({ sections: e, active: t, onSelect: n, header: r, collapsed: i = !1, className: o, ...s }, c) {
|
|
262
|
+
return i ? /* @__PURE__ */ _("nav", {
|
|
263
|
+
ref: c,
|
|
264
|
+
...s,
|
|
265
|
+
className: `select-sidenav select-sidenav--rail${o ? " " + o : ""}`,
|
|
266
|
+
children: e.map((e, r) => /* @__PURE__ */ _("div", {
|
|
250
267
|
className: "select-sidenav__section",
|
|
251
268
|
role: "group",
|
|
252
269
|
"aria-label": e.label,
|
|
253
|
-
children: e.items.map((e) => /* @__PURE__ */
|
|
270
|
+
children: e.items.map((e) => /* @__PURE__ */ _(E, {
|
|
254
271
|
item: e,
|
|
255
272
|
active: t,
|
|
256
273
|
onSelect: n
|
|
257
274
|
}, e.id))
|
|
258
275
|
}, r))
|
|
259
|
-
}) : /* @__PURE__ */
|
|
260
|
-
ref:
|
|
261
|
-
...
|
|
262
|
-
className: `select-sidenav${
|
|
263
|
-
children: [r && /* @__PURE__ */
|
|
276
|
+
}) : /* @__PURE__ */ v("nav", {
|
|
277
|
+
ref: c,
|
|
278
|
+
...s,
|
|
279
|
+
className: `select-sidenav${o ? " " + o : ""}`,
|
|
280
|
+
children: [r && /* @__PURE__ */ _("div", {
|
|
264
281
|
className: "select-sidenav__header",
|
|
265
282
|
children: r
|
|
266
|
-
}), e.map((e, r) => /* @__PURE__ */
|
|
283
|
+
}), e.map((e, r) => /* @__PURE__ */ v("div", {
|
|
267
284
|
className: "select-sidenav__section",
|
|
268
|
-
children: [e.label && /* @__PURE__ */
|
|
285
|
+
children: [e.label && /* @__PURE__ */ _("div", {
|
|
269
286
|
className: "select-sidenav__sectionlabel",
|
|
270
287
|
children: e.label
|
|
271
|
-
}), e.items.map((e) => e.children ? /* @__PURE__ */
|
|
288
|
+
}), e.items.map((e) => e.children ? /* @__PURE__ */ _(S, {
|
|
272
289
|
item: e,
|
|
273
290
|
active: t,
|
|
274
291
|
onSelect: n
|
|
275
|
-
}, e.id) : /* @__PURE__ */
|
|
292
|
+
}, e.id) : /* @__PURE__ */ v(b, {
|
|
276
293
|
item: e,
|
|
277
294
|
active: e.id === t,
|
|
278
295
|
onSelect: n,
|
|
279
296
|
className: `select-sidenav__item${e.id === t ? " is-active" : ""}`,
|
|
280
|
-
children: [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
297
|
+
children: [
|
|
298
|
+
e.icon && /* @__PURE__ */ _("span", {
|
|
299
|
+
className: "select-sidenav__icon",
|
|
300
|
+
children: e.icon
|
|
301
|
+
}),
|
|
302
|
+
/* @__PURE__ */ _("span", {
|
|
303
|
+
className: "select-sidenav__label",
|
|
304
|
+
children: e.label
|
|
305
|
+
}),
|
|
306
|
+
/* @__PURE__ */ _(a, { item: e })
|
|
307
|
+
]
|
|
287
308
|
}, e.id))]
|
|
288
309
|
}, r))]
|
|
289
310
|
});
|
|
290
311
|
});
|
|
291
312
|
//#endregion
|
|
292
|
-
export {
|
|
313
|
+
export { D as SelectSideNav };
|
|
293
314
|
|
|
294
315
|
//# sourceMappingURL=SelectSideNav.js.map
|