wimui 0.68.0 → 0.69.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.
- package/dist/components/_internal/useAnnounce.cjs +2 -0
- package/dist/components/_internal/useAnnounce.d.ts +39 -0
- package/dist/components/_internal/useAnnounce.js +41 -0
- package/dist/components/ai/InteractiveGraph/interactive-graph.module.cjs +1 -1
- package/dist/components/ai/InteractiveGraph/interactive-graph.module.js +1 -1
- package/dist/components/data-display/AvatarGroup/AvatarGroup.cjs +1 -1
- package/dist/components/data-display/AvatarGroup/AvatarGroup.js +4 -4
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.js +61 -65
- package/dist/components/data-display/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/data-display/DataGrid/DataGrid.js +78 -74
- package/dist/components/data-display/DataGrid/useFixedColumns.cjs +1 -1
- package/dist/components/data-display/DataGrid/useFixedColumns.d.ts +6 -1
- package/dist/components/data-display/DataGrid/useFixedColumns.js +22 -17
- package/dist/components/data-display/FAQSection/FAQSection.cjs +1 -1
- package/dist/components/data-display/FAQSection/FAQSection.js +28 -25
- package/dist/components/data-display/FAQSection/faq-section.module.cjs +1 -1
- package/dist/components/data-display/FAQSection/faq-section.module.js +8 -7
- package/dist/components/data-display/SelectionBar/SelectionBar.cjs +2 -0
- package/dist/components/data-display/SelectionBar/SelectionBar.d.ts +77 -0
- package/dist/components/data-display/SelectionBar/SelectionBar.js +68 -0
- package/dist/components/data-display/SelectionBar/selection-bar.module.cjs +2 -0
- package/dist/components/data-display/SelectionBar/selection-bar.module.js +10 -0
- package/dist/components/data-display/Table/table.module.cjs +1 -1
- package/dist/components/data-display/Table/table.module.js +1 -1
- package/dist/components/feedback/Snackbar/Snackbar.cjs +1 -1
- package/dist/components/feedback/Snackbar/Snackbar.js +8 -9
- package/dist/components/feedback/Toast/Toast.cjs +1 -1
- package/dist/components/feedback/Toast/Toast.js +60 -71
- package/dist/components/form/Cascader/Cascader.cjs +1 -1
- package/dist/components/form/Cascader/Cascader.js +4 -4
- package/dist/components/form/Combobox/Combobox.cjs +1 -1
- package/dist/components/form/Combobox/Combobox.js +11 -11
- package/dist/components/form/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/form/DatePicker/DatePicker.js +4 -4
- package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/form/FileUpload/FileUpload.js +13 -18
- package/dist/components/form/MultiSelect/MultiSelect.cjs +1 -1
- package/dist/components/form/MultiSelect/MultiSelect.js +66 -66
- package/dist/components/form/Select/Select.cjs +1 -1
- package/dist/components/form/Select/Select.js +114 -114
- package/dist/components/form/Transfer/Transfer.cjs +1 -1
- package/dist/components/form/Transfer/Transfer.js +84 -88
- package/dist/components/form/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/form/TreeSelect/TreeSelect.js +4 -4
- package/dist/components/layout/SimpleGrid/SimpleGrid.cjs +1 -1
- package/dist/components/layout/SimpleGrid/SimpleGrid.js +1 -1
- package/dist/components/layout/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/layout/Toolbar/Toolbar.d.ts +15 -0
- package/dist/components/layout/Toolbar/Toolbar.js +85 -60
- package/dist/components/layout/Toolbar/toolbar.module.cjs +1 -1
- package/dist/components/layout/Toolbar/toolbar.module.js +8 -6
- package/dist/components/media/Lightbox/Lightbox.cjs +1 -1
- package/dist/components/media/Lightbox/Lightbox.js +46 -47
- package/dist/components/media/Video/video.module.cjs +1 -1
- package/dist/components/media/Video/video.module.js +2 -2
- package/dist/components/navigation/Breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/navigation/Breadcrumb/Breadcrumb.js +24 -24
- package/dist/components/navigation/Menubar/Menubar.cjs +1 -1
- package/dist/components/navigation/Menubar/Menubar.js +10 -10
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +110 -112
- package/dist/data-display-core.d.ts +1 -0
- package/dist/data-display.cjs +1 -1
- package/dist/data-display.js +2 -1
- package/dist/i18n/generated/common.cjs +1 -1
- package/dist/i18n/generated/common.js +3 -3
- package/dist/i18n/generated/components.cjs +1 -1
- package/dist/i18n/generated/components.d.ts +1 -1
- package/dist/i18n/generated/components.js +2 -2
- package/dist/i18n/generated/data-display.cjs +1 -1
- package/dist/i18n/generated/data-display.d.ts +1 -1
- package/dist/i18n/generated/data-display.js +21 -3
- package/dist/i18n/generated/form.cjs +1 -1
- package/dist/i18n/generated/form.d.ts +1 -1
- package/dist/i18n/generated/form.js +4 -4
- package/dist/i18n/generated/keys.d.ts +2 -1
- package/dist/i18n/generated/layout.cjs +2 -0
- package/dist/i18n/generated/layout.d.ts +3 -0
- package/dist/i18n/generated/layout.js +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +41 -40
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +3 -3
- package/dist/llms-full.txt +22 -1
- package/dist/llms.txt +2 -1
- package/dist/locales/en/common.json +1 -1
- package/dist/locales/en/components.json +4 -4
- package/dist/locales/en/data-display.json +6 -0
- package/dist/locales/en/form.json +3 -4
- package/dist/locales/ja/components.json +2 -2
- package/dist/locales/ja/data-display.json +6 -0
- package/dist/locales/ja/form.json +1 -2
- package/dist/locales/pt/common.json +2 -2
- package/dist/locales/pt/components.json +4 -4
- package/dist/locales/pt/data-display.json +6 -0
- package/dist/locales/pt/form.json +3 -4
- package/dist/styles.css +1 -1
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +11 -8
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { Button as t } from "../Button/Button.js";
|
|
4
|
+
import { BaseListItem as n } from "../../_internal/BaseListItem/BaseListItem.js";
|
|
5
|
+
import { formNs as r } from "../../../i18n/generated/form.js";
|
|
6
|
+
import { FieldTemplate as i } from "../FieldTemplate/FieldTemplate.js";
|
|
7
|
+
import { Checkbox as a } from "../Checkbox/Checkbox.js";
|
|
8
|
+
import { useAnnounce as o } from "../../_internal/useAnnounce.js";
|
|
9
9
|
import { VirtualList as s } from "../../data-display/VirtualList/VirtualList.js";
|
|
10
10
|
import c from "./transfer.module.js";
|
|
11
11
|
import { useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
12
12
|
import m from "classnames";
|
|
13
13
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/form/Transfer/Transfer.tsx
|
|
15
|
-
var _ = 36, v = 50, y = ({ data: t, title:
|
|
16
|
-
let { t: D } = e(
|
|
15
|
+
var _ = 36, v = 50, y = ({ data: t, title: i, listType: o, id: u, disabled: d, selectedKeys: y, focusedKey: b, setFocusedKey: x, onSelect: S, onSelectAll: C, onKeyDown: w, labels: T = {}, className: E }) => {
|
|
16
|
+
let { t: D } = e(r), { noData: O = D("transfer.no_data") } = T, k = f(null), A = f(null), [j, M] = p(0);
|
|
17
17
|
l(() => {
|
|
18
18
|
let e = k.current;
|
|
19
19
|
if (!e) return;
|
|
@@ -32,8 +32,8 @@ var _ = 36, v = 50, y = ({ data: t, title: n, listType: a, id: u, disabled: d, s
|
|
|
32
32
|
t,
|
|
33
33
|
j
|
|
34
34
|
]);
|
|
35
|
-
let N = t.filter((e) => !e.disabled).map((e) => e.key), P = y.filter((e) => N.includes(e)), F = N.length > 0 && P.length === N.length, I = P.length > 0 && P.length < N.length, L = b && t.some((e) => e.key === b) ? `${u}-${
|
|
36
|
-
id: `${u}-${
|
|
35
|
+
let N = t.filter((e) => !e.disabled).map((e) => e.key), P = y.filter((e) => N.includes(e)), F = N.length > 0 && P.length === N.length, I = P.length > 0 && P.length < N.length, L = b && t.some((e) => e.key === b) ? `${u}-${o}-option-${b}` : void 0, R = t.length >= v && j > 0, z = (e, r) => /* @__PURE__ */ h(n, {
|
|
36
|
+
id: `${u}-${o}-option-${e.key}`,
|
|
37
37
|
className: m(c.item, b === e.key && c.active),
|
|
38
38
|
disabled: d || e.disabled,
|
|
39
39
|
active: b === e.key,
|
|
@@ -44,26 +44,26 @@ var _ = 36, v = 50, y = ({ data: t, title: n, listType: a, id: u, disabled: d, s
|
|
|
44
44
|
"aria-selected": y.includes(e.key),
|
|
45
45
|
"aria-disabled": d || e.disabled,
|
|
46
46
|
"aria-setsize": R ? t.length : void 0,
|
|
47
|
-
"aria-posinset": R ?
|
|
47
|
+
"aria-posinset": R ? r + 1 : void 0,
|
|
48
48
|
icon: /* @__PURE__ */ h("div", {
|
|
49
49
|
className: m(c.checkboxVisual, y.includes(e.key) && c.checked, (d || e.disabled) && c.disabled),
|
|
50
50
|
"aria-hidden": "true"
|
|
51
51
|
}),
|
|
52
52
|
children: e.title
|
|
53
|
-
}, e.key), B = typeof
|
|
53
|
+
}, e.key), B = typeof i == "string" ? i : "";
|
|
54
54
|
return /* @__PURE__ */ g("div", {
|
|
55
55
|
className: m(c.list, E),
|
|
56
56
|
children: [/* @__PURE__ */ g("div", {
|
|
57
57
|
className: c.header,
|
|
58
|
-
children: [/* @__PURE__ */ h(
|
|
58
|
+
children: [/* @__PURE__ */ h(a, {
|
|
59
59
|
checked: F,
|
|
60
60
|
indeterminate: I,
|
|
61
|
-
onChange: () => C(N,
|
|
61
|
+
onChange: () => C(N, o),
|
|
62
62
|
disabled: d || N.length === 0,
|
|
63
63
|
children: /* @__PURE__ */ h("span", {
|
|
64
64
|
className: c.headerTitle,
|
|
65
65
|
title: B,
|
|
66
|
-
children:
|
|
66
|
+
children: i
|
|
67
67
|
})
|
|
68
68
|
}), /* @__PURE__ */ g("span", {
|
|
69
69
|
className: c.headerCount,
|
|
@@ -82,7 +82,7 @@ var _ = 36, v = 50, y = ({ data: t, title: n, listType: a, id: u, disabled: d, s
|
|
|
82
82
|
"aria-activedescendant": t.length > 0 ? L : void 0,
|
|
83
83
|
"aria-disabled": d || void 0,
|
|
84
84
|
tabIndex: t.length === 0 ? -1 : 0,
|
|
85
|
-
onKeyDown: (e) => w(e,
|
|
85
|
+
onKeyDown: (e) => w(e, o, t),
|
|
86
86
|
onFocus: () => {
|
|
87
87
|
if (!b) {
|
|
88
88
|
let e = t.find((e) => !e.disabled);
|
|
@@ -108,34 +108,34 @@ var _ = 36, v = 50, y = ({ data: t, title: n, listType: a, id: u, disabled: d, s
|
|
|
108
108
|
}) : t.map((e, t) => z(e, t))
|
|
109
109
|
})]
|
|
110
110
|
});
|
|
111
|
-
}, b = ({ dataSource:
|
|
112
|
-
let { t:
|
|
113
|
-
|
|
114
|
-
let
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
if (
|
|
111
|
+
}, b = ({ dataSource: n = [], targetKeys: a, onChange: s, titles: l, className: f, style: _, disabled: v = !1, label: b, error: x, required: S, layout: C = "vertical", labels: w = {}, "aria-label": T, "aria-labelledby": E, "aria-describedby": D }) => {
|
|
112
|
+
let { t: O } = e(r), k = l ?? [O("transfer.source"), O("transfer.target")], { moveToTarget: A = O("transfer.move_to_target"), moveToSource: j = O("transfer.move_to_source"), statusMovedToTarget: M = (e) => O("transfer.status_moved_to_target", { count: e }), statusMovedToSource: N = (e) => O("transfer.status_moved_to_source", { count: e }) } = w, [P, F] = p([]), [I, L] = p(a || []), R = `wim-transfer-${u()}`, z = b ? `${R}-label` : void 0, B = x ? `${R}-error` : void 0, V = a !== void 0 && !!s, H = V ? a : I, U = d(() => n.filter((e) => !H.includes(e.key)), [n, H]), W = d(() => n.filter((e) => H.includes(e.key)), [n, H]), [G, K] = p(null), [q, J] = p(null), { announce: ee, region: te } = o();
|
|
113
|
+
G && !U.some((e) => e.key === G) && K(null), q && !W.some((e) => e.key === q) && J(null);
|
|
114
|
+
let Y = (e) => {
|
|
115
|
+
v || F((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
116
|
+
}, X = (e, t) => {
|
|
117
|
+
if (v) return;
|
|
118
118
|
let n = e;
|
|
119
|
-
n.every((e) =>
|
|
120
|
-
},
|
|
121
|
-
if (
|
|
122
|
-
let t = e === "toRight" ?
|
|
119
|
+
n.every((e) => P.includes(e)) ? F((e) => e.filter((e) => !n.includes(e))) : F((e) => [.../* @__PURE__ */ new Set([...e, ...n])]);
|
|
120
|
+
}, Z = (e) => {
|
|
121
|
+
if (v) return;
|
|
122
|
+
let t = e === "toRight" ? U.map((e) => e.key) : W.map((e) => e.key), n = P.filter((e) => t.includes(e));
|
|
123
123
|
if (n.length === 0) return;
|
|
124
|
-
let r = e === "toRight" ? [...
|
|
125
|
-
|
|
126
|
-
let i = e === "toRight" ?
|
|
127
|
-
|
|
128
|
-
},
|
|
124
|
+
let r = e === "toRight" ? [...H, ...n] : H.filter((e) => !n.includes(e));
|
|
125
|
+
V || L(r), s && s(r, e, n), F((e) => e.filter((e) => !n.includes(e)));
|
|
126
|
+
let i = e === "toRight" ? M(n.length) : N(n.length);
|
|
127
|
+
ee(i, { delay: 50 });
|
|
128
|
+
}, Q = (e, t, n) => {
|
|
129
129
|
let r = e.filter((e) => !e.disabled);
|
|
130
130
|
if (r.length === 0) return null;
|
|
131
131
|
if (t === null) return n === 1 ? r[0].key : r[r.length - 1].key;
|
|
132
132
|
let i = r.findIndex((e) => e.key === t);
|
|
133
133
|
return i === -1 ? r[0].key : r[(i + n + r.length) % r.length].key;
|
|
134
|
-
},
|
|
135
|
-
if (
|
|
136
|
-
let r = t === "source" ?
|
|
137
|
-
if (e.key === "ArrowDown") e.preventDefault(), i(
|
|
138
|
-
else if (e.key === "ArrowUp") e.preventDefault(), i(
|
|
134
|
+
}, $ = (e, t, n) => {
|
|
135
|
+
if (v) return;
|
|
136
|
+
let r = t === "source" ? G : q, i = t === "source" ? K : J;
|
|
137
|
+
if (e.key === "ArrowDown") e.preventDefault(), i(Q(n, r, 1));
|
|
138
|
+
else if (e.key === "ArrowUp") e.preventDefault(), i(Q(n, r, -1));
|
|
139
139
|
else if (e.key === "Home") {
|
|
140
140
|
e.preventDefault();
|
|
141
141
|
let t = n.find((e) => !e.disabled);
|
|
@@ -147,80 +147,76 @@ var _ = 36, v = 50, y = ({ data: t, title: n, listType: a, id: u, disabled: d, s
|
|
|
147
147
|
} else if (e.key === " ") {
|
|
148
148
|
e.preventDefault();
|
|
149
149
|
let t = n.find((e) => e.key === r);
|
|
150
|
-
t && !t.disabled &&
|
|
151
|
-
} else e.key === "Enter" && (e.preventDefault(),
|
|
152
|
-
},
|
|
153
|
-
return /* @__PURE__ */ h(
|
|
154
|
-
label:
|
|
155
|
-
error:
|
|
156
|
-
required:
|
|
157
|
-
layout:
|
|
158
|
-
labelId:
|
|
159
|
-
errorId:
|
|
160
|
-
className:
|
|
150
|
+
t && !t.disabled && Y(t.key);
|
|
151
|
+
} else e.key === "Enter" && (e.preventDefault(), Z(t === "source" ? "toRight" : "toLeft"));
|
|
152
|
+
}, ne = P.filter((e) => U.some((t) => t.key === e)).length === 0, re = P.filter((e) => W.some((t) => t.key === e)).length === 0;
|
|
153
|
+
return /* @__PURE__ */ h(i, {
|
|
154
|
+
label: b,
|
|
155
|
+
error: x,
|
|
156
|
+
required: S,
|
|
157
|
+
layout: C,
|
|
158
|
+
labelId: z,
|
|
159
|
+
errorId: B,
|
|
160
|
+
className: f,
|
|
161
161
|
children: /* @__PURE__ */ g("div", {
|
|
162
162
|
className: m(c.container, "wim-transfer"),
|
|
163
|
-
children: [/* @__PURE__ */
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
children: ee
|
|
167
|
-
}), /* @__PURE__ */ g("div", {
|
|
168
|
-
className: m(c.root, b && c.disabled),
|
|
169
|
-
style: v,
|
|
163
|
+
children: [te, /* @__PURE__ */ g("div", {
|
|
164
|
+
className: m(c.root, v && c.disabled),
|
|
165
|
+
style: _,
|
|
170
166
|
role: "group",
|
|
171
|
-
"aria-labelledby":
|
|
172
|
-
"aria-label":
|
|
173
|
-
"aria-describedby": [
|
|
167
|
+
"aria-labelledby": b ? z : E,
|
|
168
|
+
"aria-label": b || E ? void 0 : T,
|
|
169
|
+
"aria-describedby": [D, B].filter(Boolean).join(" ") || void 0,
|
|
174
170
|
children: [
|
|
175
171
|
/* @__PURE__ */ h(y, {
|
|
176
172
|
className: "wim-transfer__list",
|
|
177
|
-
data:
|
|
178
|
-
title:
|
|
173
|
+
data: U,
|
|
174
|
+
title: k[0],
|
|
179
175
|
listType: "source",
|
|
180
|
-
id:
|
|
181
|
-
disabled:
|
|
182
|
-
selectedKeys:
|
|
183
|
-
focusedKey:
|
|
184
|
-
setFocusedKey:
|
|
185
|
-
onSelect:
|
|
186
|
-
onSelectAll:
|
|
187
|
-
onKeyDown:
|
|
188
|
-
labels:
|
|
176
|
+
id: R,
|
|
177
|
+
disabled: v,
|
|
178
|
+
selectedKeys: P,
|
|
179
|
+
focusedKey: G,
|
|
180
|
+
setFocusedKey: K,
|
|
181
|
+
onSelect: Y,
|
|
182
|
+
onSelectAll: X,
|
|
183
|
+
onKeyDown: $,
|
|
184
|
+
labels: w
|
|
189
185
|
}),
|
|
190
186
|
/* @__PURE__ */ g("div", {
|
|
191
187
|
className: m(c.operation, "wim-transfer__operation"),
|
|
192
|
-
children: [/* @__PURE__ */ h(
|
|
188
|
+
children: [/* @__PURE__ */ h(t, {
|
|
193
189
|
variant: "outline",
|
|
194
190
|
size: "sm",
|
|
195
191
|
className: c.button,
|
|
196
|
-
onClick: () =>
|
|
197
|
-
disabled:
|
|
192
|
+
onClick: () => Z("toRight"),
|
|
193
|
+
disabled: v || ne,
|
|
198
194
|
icon: "ChevronRightIcon",
|
|
199
|
-
"aria-label":
|
|
200
|
-
}), /* @__PURE__ */ h(
|
|
195
|
+
"aria-label": A
|
|
196
|
+
}), /* @__PURE__ */ h(t, {
|
|
201
197
|
variant: "outline",
|
|
202
198
|
size: "sm",
|
|
203
199
|
className: c.button,
|
|
204
|
-
onClick: () =>
|
|
205
|
-
disabled:
|
|
200
|
+
onClick: () => Z("toLeft"),
|
|
201
|
+
disabled: v || re,
|
|
206
202
|
icon: "ChevronLeftIcon",
|
|
207
|
-
"aria-label":
|
|
203
|
+
"aria-label": j
|
|
208
204
|
})]
|
|
209
205
|
}),
|
|
210
206
|
/* @__PURE__ */ h(y, {
|
|
211
207
|
className: "wim-transfer__list",
|
|
212
|
-
data:
|
|
213
|
-
title:
|
|
208
|
+
data: W,
|
|
209
|
+
title: k[1],
|
|
214
210
|
listType: "target",
|
|
215
|
-
id:
|
|
216
|
-
disabled:
|
|
217
|
-
selectedKeys:
|
|
218
|
-
focusedKey:
|
|
219
|
-
setFocusedKey:
|
|
220
|
-
onSelect:
|
|
221
|
-
onSelectAll:
|
|
222
|
-
onKeyDown:
|
|
223
|
-
labels:
|
|
211
|
+
id: R,
|
|
212
|
+
disabled: v,
|
|
213
|
+
selectedKeys: P,
|
|
214
|
+
focusedKey: q,
|
|
215
|
+
setFocusedKey: J,
|
|
216
|
+
onSelect: Y,
|
|
217
|
+
onSelectAll: X,
|
|
218
|
+
onKeyDown: $,
|
|
219
|
+
labels: w
|
|
224
220
|
})
|
|
225
221
|
]
|
|
226
222
|
})]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../overlay/FocusTrap/FocusTrap.cjs"),ee=require("
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../overlay/FocusTrap/FocusTrap.cjs"),ee=require("../../_internal/useInlineFloating.cjs"),a=require("../InputBase/InputBase.cjs"),o=require("../FieldTemplate/FieldTemplate.cjs"),s=require("../../data-display/TreeView/TreeView.cjs"),c=require("./tree-select.module.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("classnames");u=e.__toESM(u,1);let d=require("react/jsx-runtime");function f(e){return e.map(e=>({value:e.value,label:e.label,disabled:e.disabled,icon:e.icon,children:e.children?f(e.children):void 0}))}var p=(0,l.forwardRef)(({treeData:e=[],value:p,onChange:m,placeholder:h,label:g,error:_,required:v,layout:y,className:b,disabled:x=!1,multiple:S=!1,searchable:C=!1,defaultExpandedKeys:w=[],allowClear:T=!1,checkStrategy:E=`cascade`,id:D,width:O,fullWidth:k=!1,asChild:A=!1,children:te,...ne},re)=>{let ie=(0,l.useId)(),j=D||`wim-tree-select-${ie}`,M=g?`${j}-label`:void 0,N=_?`${j}-error`:void 0,P=`${j}-trigger`,F=`${j}-dropdown`,[I,L]=(0,l.useState)(!1),[R,z]=(0,l.useState)(S?[]:``),B=(0,l.useRef)(null),V=(0,l.useRef)(null),H=p!==void 0,U=H?p:R;(0,l.useEffect)(()=>{let e=e=>{B.current&&!B.current.contains(e.target)&&L(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,l.useEffect)(()=>{if(I){let e=setTimeout(()=>{let e=B.current?.querySelector(`[data-testid="tree-view-search-input"]`);e?e.focus():(B.current?.querySelector(`[data-testid="tree-view-root"]`))?.focus()},100);return()=>clearTimeout(e)}},[I]);let W=()=>{if(!x){let e=!I;L(e),e||V.current?.focus()}},G=e=>{x||(I?e.key===`Escape`&&(e.preventDefault(),L(!1),V.current?.focus()):(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),L(!0)))},K=(0,l.useMemo)(()=>{let t={},n=e=>{e.forEach(e=>{t[e.value]=e,e.children&&n(e.children)})};return n(e),t},[e]),q=()=>{if(S){let e=Array.isArray(U)?U:[];return e.length===0?null:e.map(e=>K[e]?K[e].label:e).reduce((e,t)=>[e,`, `,t])}{let e=U;return e?K[e]?K[e].label:e:null}},J=e=>{let t;S?t=e:(t=e[0]||``,L(!1),V.current?.focus()),H||z(t),m&&m(t)},ae=()=>{if(x)return;let e=S?[]:``;H||z(e),m&&m(e)},oe=(0,l.useMemo)(()=>f(e),[e]),Y=(0,l.useMemo)(()=>S?Array.isArray(U)?U:[]:U?[U]:[],[U,S]),X=q(),{"aria-label":Z,"aria-labelledby":Q,"aria-describedby":se,...ce}=ne,$=typeof h==`string`?h:`Select`,le=A?t.Root:`div`,{setReference:ue,setFloating:de,floatingProps:fe}=ee.useInlineFloating({open:I&&!x}),pe=n.useMergedRef(B,re,ue);return(0,d.jsx)(o.FieldTemplate,{label:g,error:_,required:v,layout:y,labelId:M,errorId:N,className:(0,u.default)(c.default.container,b),children:(0,d.jsxs)(le,{className:(0,u.default)(`wim-tree-select`,c.default.root,k&&c.default.fullWidth),ref:pe,...ce,children:[(0,d.jsx)(t.Slottable,{children:te}),(0,d.jsx)(a.InputBase,{disabled:x,allowClear:T,hasValue:!!X,onClear:ae,intent:_?`danger`:`default`,width:O,fullWidth:k,rightIcons:[{name:`ChevronDownIcon`,rotated:I,onClick:W,decorative:!0}],className:(0,u.default)(I&&c.default.open),children:(0,d.jsx)(`div`,{id:P,className:(0,u.default)(c.default.trigger,x&&c.default.disabled),onClick:W,onKeyDown:G,tabIndex:x?-1:0,role:`combobox`,"aria-expanded":I,"aria-haspopup":`tree`,"aria-controls":I?F:void 0,"aria-disabled":x,"aria-labelledby":M||Q,"aria-label":g?void 0:Z||$,"aria-describedby":N||se,"aria-required":v,"aria-invalid":!!_,ref:V,children:(0,d.jsx)(`div`,{className:(0,u.default)(c.default.value,!X&&c.default.placeholder),children:X||h})})}),(0,d.jsx)(r.Transition,{show:I&&!x,preset:`fade`,className:c.default.dropdown,ref:de,...fe,children:(0,d.jsx)(`div`,{id:F,children:(0,d.jsx)(i.FocusTrap,{active:I,initialFocus:!1,children:(0,d.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":M||Q,"aria-label":g?void 0:Z||$,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),L(!1),V.current?.focus())},children:(0,d.jsx)(s.TreeView,{multiSelect:S,defaultSelectedValues:Y,defaultCheckedValues:S?Y:[],nodes:oe,onCheckedChange:J,onSelectedChange:J,checkable:S,checkStrategy:E,searchable:C,defaultExpandedValues:w,styles:{root:c.default.treeView,item:c.default.treeViewItem,search:c.default.treeViewSearch}})})})})})]})})});p.displayName=`TreeSelect`,exports.TreeSelect=p;
|
|
@@ -3,8 +3,8 @@ import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react
|
|
|
3
3
|
import { useMergedRef as n } from "../../../hooks/useMergedRef.js";
|
|
4
4
|
import { Transition as r } from "../../layout/Transition/Transition.js";
|
|
5
5
|
import { FocusTrap as i } from "../../overlay/FocusTrap/FocusTrap.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useInlineFloating as a } from "../../_internal/useInlineFloating.js";
|
|
7
|
+
import { InputBase as o } from "../InputBase/InputBase.js";
|
|
8
8
|
import { FieldTemplate as s } from "../FieldTemplate/FieldTemplate.js";
|
|
9
9
|
import { TreeView as c } from "../../data-display/TreeView/TreeView.js";
|
|
10
10
|
import l from "./tree-select.module.js";
|
|
@@ -71,7 +71,7 @@ var y = u(({ treeData: u = [], value: y, onChange: b, placeholder: x, label: S,
|
|
|
71
71
|
if (D) return;
|
|
72
72
|
let e = O ? [] : "";
|
|
73
73
|
U || B(e), b && b(e);
|
|
74
|
-
}, pe = f(() => v(u), [u]), J = f(() => O ? Array.isArray(W) ? W : [] : W ? [W] : [], [W, O]), Y = de(), { "aria-label": X, "aria-labelledby": Z, "aria-describedby": me, ...he } = se, Q = typeof x == "string" ? x : "Select", ge = ae ? e : "div", { setReference: $, setFloating: _e, floatingProps: ve } =
|
|
74
|
+
}, pe = f(() => v(u), [u]), J = f(() => O ? Array.isArray(W) ? W : [] : W ? [W] : [], [W, O]), Y = de(), { "aria-label": X, "aria-labelledby": Z, "aria-describedby": me, ...he } = se, Q = typeof x == "string" ? x : "Select", ge = ae ? e : "div", { setReference: $, setFloating: _e, floatingProps: ve } = a({ open: L && !D }), ye = n(V, ce, $);
|
|
75
75
|
return /* @__PURE__ */ g(s, {
|
|
76
76
|
label: S,
|
|
77
77
|
error: C,
|
|
@@ -86,7 +86,7 @@ var y = u(({ treeData: u = [], value: y, onChange: b, placeholder: x, label: S,
|
|
|
86
86
|
...he,
|
|
87
87
|
children: [
|
|
88
88
|
/* @__PURE__ */ g(t, { children: oe }),
|
|
89
|
-
/* @__PURE__ */ g(
|
|
89
|
+
/* @__PURE__ */ g(o, {
|
|
90
90
|
disabled: D,
|
|
91
91
|
allowClear: te,
|
|
92
92
|
hasValue: !!Y,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/style-utils.cjs"),n=require("../Grid/grid-utils.cjs"),r=require("./simple-grid.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=i.default.forwardRef(({cols:e=1,spacing:i=`2xl`,verticalSpacing:s,minChildWidth:c,className:l,style:u,children:d,...f},p)=>{let m=n.generateResponsiveVars(e,`--wim-simple-grid-cols`,e=>`repeat(${e}, minmax(0, 1fr))`),h={display:`grid`,
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/style-utils.cjs"),n=require("../Grid/grid-utils.cjs"),r=require("./simple-grid.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=i.default.forwardRef(({cols:e=1,spacing:i=`2xl`,verticalSpacing:s,minChildWidth:c,className:l,style:u,children:d,...f},p)=>{let m=n.generateResponsiveVars(e,`--wim-simple-grid-cols`,e=>`repeat(${e}, minmax(0, 1fr))`),h={display:`grid`,columnGap:t.getSpacingValue(i),rowGap:t.getSpacingValue(s??i),gridTemplateColumns:c?`repeat(auto-fill, minmax(${typeof c==`number`?`${c}px`:c}, 1fr))`:void 0,...m,...u};return(0,o.jsx)(`div`,{className:r.default.container,children:(0,o.jsx)(`div`,{ref:p,className:(0,a.default)(`wim-simple-grid`,r.default.root,l),style:h,...f,children:d})})});s.displayName=`SimpleGrid`,exports.SimpleGrid=s;
|
|
@@ -9,7 +9,7 @@ import { jsx as a } from "react/jsx-runtime";
|
|
|
9
9
|
var o = r.forwardRef(({ cols: r = 1, spacing: o = "2xl", verticalSpacing: s, minChildWidth: c, className: l, style: u, children: d, ...f }, p) => {
|
|
10
10
|
let m = t(r, "--wim-simple-grid-cols", (e) => `repeat(${e}, minmax(0, 1fr))`), h = {
|
|
11
11
|
display: "grid",
|
|
12
|
-
|
|
12
|
+
columnGap: e(o),
|
|
13
13
|
rowGap: e(s ?? o),
|
|
14
14
|
gridTemplateColumns: c ? `repeat(auto-fill, minmax(${typeof c == "number" ? `${c}px` : c}, 1fr))` : void 0,
|
|
15
15
|
...m,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../hooks/useMergedRef.cjs"),i=require("../../../icon/more-horizontal.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("../../../i18n/generated/layout.cjs"),s=require("../../_internal/rovingIndex.cjs"),c=require("../../_internal/InlineDisclosure.cjs"),l=require("../OverflowList/OverflowList.cjs"),u=require("./toolbar.module.cjs");let d=require("react");d=e.__toESM(d,1);let f=require("classnames");f=e.__toESM(f,1);let p=require("react/jsx-runtime");var m=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]`,h={sm:`2xs`,md:`xs`,lg:`sm`},g=e=>d.default.isValidElement(e)&&e.type===C,_=`data-wim-toolbar-roving`,v=/^(button|checkbox|radio|submit|reset|image|file|color)$/,y=e=>e.tagName===`TEXTAREA`||e.tagName===`SELECT`||e.isContentEditable||e.tagName===`INPUT`&&!v.test(e.type),b=e=>Array.from(e.querySelectorAll(m)).filter(e=>!y(e)&&!e.closest(`[aria-hidden="true"]`)&&(e.getAttribute(`tabindex`)!==`-1`||e.hasAttribute(_))),x=d.default.forwardRef(({asChild:e=!1,size:m=`md`,orientation:v=`horizontal`,overflow:y=`wrap`,moreLabel:x,className:S,children:C,onKeyDownCapture:w,onFocus:T,...E},D)=>{let{t:O}=n.useWimTranslation(o.layoutNs),k=(0,d.useRef)(null),A=r.useMergedRef(D,k),j=(0,d.useRef)(null),M=(0,d.useRef)(null),N=(0,d.useCallback)(()=>{let e=k.current;if(!e)return;let t=b(e),n=document.activeElement,r=n&&t.includes(n)?n:j.current&&t.includes(j.current)?j.current:t[0];j.current=r??null;for(let e of t)e===r?e.hasAttribute(_)&&(e.removeAttribute(_),e.setAttribute(`tabindex`,`0`)):e.getAttribute(`tabindex`)!==`-1`&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(_,``));M.current?.takeRecords()},[]);(0,d.useLayoutEffect)(N),(0,d.useEffect)(()=>{let e=k.current;if(!e)return;let t=new MutationObserver(()=>N());return t.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`disabled`,`tabindex`,`aria-hidden`]}),M.current=t,()=>{t.disconnect(),M.current=null}},[N]);let P=e=>{T?.(e);let t=k.current,n=e.target;t&&n!==j.current&&b(t).includes(n)&&(j.current=n,N())},F=e=>{if(w?.(e),e.defaultPrevented)return;let t=k.current;if(!t)return;let n=b(t);if(n.length===0)return;let r=n.indexOf(document.activeElement);if(r<0)return;let i=s.getRovingIndex({key:e.key,current:r,count:n.length,orientation:v});i!==null&&(e.preventDefault(),e.stopPropagation(),n[i]?.focus())},I=e?t.Root:`div`,L=y===`collapse`&&v===`horizontal`&&!e,R=L?(0,p.jsx)(l.OverflowList,{gap:h[m],items:d.default.Children.toArray(C),renderItem:e=>e,renderOverflow:e=>(0,p.jsx)(c.InlineDisclosure,{trigger:(0,p.jsx)(a.Icon,{component:i.default,size:`sm`}),label:(x??(e=>O(`a11y.toolbar_more`,{count:e})))(e.length),triggerClassName:u.default.more,children:e.filter(e=>!g(e)).map((e,t)=>(0,p.jsx)(`li`,{children:e},t))})}):C;return(0,p.jsx)(I,{ref:A,role:`toolbar`,"aria-orientation":v,"data-size":m,"data-orientation":v,className:(0,f.default)(`wim-toolbar`,u.default.root,u.default[`size-${m}`],u.default[v],L&&u.default.collapse,S),onKeyDownCapture:F,onFocus:P,...E,children:R})});x.displayName=`Toolbar`;var S=d.default.forwardRef(({asChild:e=!1,className:n,children:r,...i},a)=>(0,p.jsx)(e?t.Root:`div`,{ref:a,role:`group`,className:(0,f.default)(u.default.group,n),...i,children:r}));S.displayName=`Toolbar.Group`;var C=d.default.forwardRef(({className:e,...t},n)=>(0,p.jsx)(`div`,{ref:n,role:`separator`,"aria-hidden":`true`,className:(0,f.default)(u.default.separator,e),...t}));C.displayName=`Toolbar.Separator`;var w=x;w.Group=S,w.Separator=C,exports.Toolbar=w,exports.default=w,exports.ToolbarGroup=S,exports.ToolbarSeparator=C;
|
|
@@ -15,6 +15,21 @@ export type ToolbarProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
|
15
15
|
* @default "horizontal"
|
|
16
16
|
*/
|
|
17
17
|
orientation?: "horizontal" | "vertical";
|
|
18
|
+
/**
|
|
19
|
+
* How the controls that do not fit on one line are handled. `"wrap"` wraps them onto the next
|
|
20
|
+
* line; `"collapse"` keeps one line and moves the trailing children that do not fit behind a
|
|
21
|
+
* "…" button, which opens them in a panel next to it. Each direct child (a whole
|
|
22
|
+
* `Toolbar.Group`) is collapsed as one unit. Horizontal toolbars only, and not with `asChild`.
|
|
23
|
+
*
|
|
24
|
+
* A control remounts when it moves into the panel, so keep its state controlled.
|
|
25
|
+
* @default "wrap"
|
|
26
|
+
*/
|
|
27
|
+
overflow?: "wrap" | "collapse";
|
|
28
|
+
/**
|
|
29
|
+
* Accessible name of the "…" button with `overflow="collapse"`, from the number of hidden
|
|
30
|
+
* children. Defaults to the built-in "Show hidden tools (n)" (en / ja / pt).
|
|
31
|
+
*/
|
|
32
|
+
moreLabel?: (count: number) => string;
|
|
18
33
|
};
|
|
19
34
|
export type ToolbarGroupProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
20
35
|
/**
|
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import r from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
3
|
+
import { useWimTranslation as t } from "../../../i18n/useWimTranslation.js";
|
|
4
|
+
import { useMergedRef as n } from "../../../hooks/useMergedRef.js";
|
|
5
|
+
import r from "../../../icon/more-horizontal.js";
|
|
6
|
+
import { Icon as i } from "../../media/Icon/Icon.js";
|
|
7
|
+
import { layoutNs as a } from "../../../i18n/generated/layout.js";
|
|
8
|
+
import { getRovingIndex as o } from "../../_internal/rovingIndex.js";
|
|
9
|
+
import { InlineDisclosure as s } from "../../_internal/InlineDisclosure.js";
|
|
10
|
+
import { OverflowList as c } from "../OverflowList/OverflowList.js";
|
|
11
|
+
import l from "./toolbar.module.js";
|
|
12
|
+
import u, { useCallback as d, useEffect as f, useLayoutEffect as p, useRef as m } from "react";
|
|
13
|
+
import h from "classnames";
|
|
14
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
9
15
|
//#region src/components/layout/Toolbar/Toolbar.tsx
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
var _ = "button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]", v = {
|
|
17
|
+
sm: "2xs",
|
|
18
|
+
md: "xs",
|
|
19
|
+
lg: "sm"
|
|
20
|
+
}, y = (e) => u.isValidElement(e) && e.type === E, b = "data-wim-toolbar-roving", x = /^(button|checkbox|radio|submit|reset|image|file|color)$/, S = (e) => e.tagName === "TEXTAREA" || e.tagName === "SELECT" || e.isContentEditable || e.tagName === "INPUT" && !x.test(e.type), C = (e) => Array.from(e.querySelectorAll(_)).filter((e) => !S(e) && !e.closest("[aria-hidden=\"true\"]") && (e.getAttribute("tabindex") !== "-1" || e.hasAttribute(b))), w = u.forwardRef(({ asChild: _ = !1, size: x = "md", orientation: S = "horizontal", overflow: w = "wrap", moreLabel: T, className: E, children: D, onKeyDownCapture: O, onFocus: k, ...A }, j) => {
|
|
21
|
+
let { t: M } = t(a), N = m(null), P = n(j, N), F = m(null), I = m(null), L = d(() => {
|
|
22
|
+
let e = N.current;
|
|
13
23
|
if (!e) return;
|
|
14
|
-
let t =
|
|
15
|
-
|
|
16
|
-
for (let e of t) e === r ? e.hasAttribute(
|
|
17
|
-
|
|
24
|
+
let t = C(e), n = document.activeElement, r = n && t.includes(n) ? n : F.current && t.includes(F.current) ? F.current : t[0];
|
|
25
|
+
F.current = r ?? null;
|
|
26
|
+
for (let e of t) e === r ? e.hasAttribute(b) && (e.removeAttribute(b), e.setAttribute("tabindex", "0")) : e.getAttribute("tabindex") !== "-1" && (e.setAttribute("tabindex", "-1"), e.setAttribute(b, ""));
|
|
27
|
+
I.current?.takeRecords();
|
|
18
28
|
}, []);
|
|
19
|
-
|
|
20
|
-
let e =
|
|
29
|
+
p(L), f(() => {
|
|
30
|
+
let e = N.current;
|
|
21
31
|
if (!e) return;
|
|
22
|
-
let t = new MutationObserver(() =>
|
|
32
|
+
let t = new MutationObserver(() => L());
|
|
23
33
|
return t.observe(e, {
|
|
24
34
|
subtree: !0,
|
|
25
35
|
childList: !0,
|
|
@@ -29,59 +39,74 @@ var d = "button:not([disabled]), [href], input:not([disabled]), select:not([disa
|
|
|
29
39
|
"tabindex",
|
|
30
40
|
"aria-hidden"
|
|
31
41
|
]
|
|
32
|
-
}),
|
|
33
|
-
t.disconnect(),
|
|
42
|
+
}), I.current = t, () => {
|
|
43
|
+
t.disconnect(), I.current = null;
|
|
34
44
|
};
|
|
35
|
-
}, [
|
|
36
|
-
|
|
45
|
+
}, [L]);
|
|
46
|
+
let R = (e) => {
|
|
47
|
+
k?.(e);
|
|
48
|
+
let t = N.current, n = e.target;
|
|
49
|
+
t && n !== F.current && C(t).includes(n) && (F.current = n, L());
|
|
50
|
+
}, z = (e) => {
|
|
51
|
+
if (O?.(e), e.defaultPrevented) return;
|
|
52
|
+
let t = N.current;
|
|
53
|
+
if (!t) return;
|
|
54
|
+
let n = C(t);
|
|
55
|
+
if (n.length === 0) return;
|
|
56
|
+
let r = n.indexOf(document.activeElement);
|
|
57
|
+
if (r < 0) return;
|
|
58
|
+
let i = o({
|
|
59
|
+
key: e.key,
|
|
60
|
+
current: r,
|
|
61
|
+
count: n.length,
|
|
62
|
+
orientation: S
|
|
63
|
+
});
|
|
64
|
+
i !== null && (e.preventDefault(), e.stopPropagation(), n[i]?.focus());
|
|
65
|
+
}, B = _ ? e : "div", V = w === "collapse" && S === "horizontal" && !_, H = V ? /* @__PURE__ */ g(c, {
|
|
66
|
+
gap: v[x],
|
|
67
|
+
items: u.Children.toArray(D),
|
|
68
|
+
renderItem: (e) => e,
|
|
69
|
+
renderOverflow: (e) => /* @__PURE__ */ g(s, {
|
|
70
|
+
trigger: /* @__PURE__ */ g(i, {
|
|
71
|
+
component: r,
|
|
72
|
+
size: "sm"
|
|
73
|
+
}),
|
|
74
|
+
label: (T ?? ((e) => M("a11y.toolbar_more", { count: e })))(e.length),
|
|
75
|
+
triggerClassName: l.more,
|
|
76
|
+
children: e.filter((e) => !y(e)).map((e, t) => /* @__PURE__ */ g("li", { children: e }, t))
|
|
77
|
+
})
|
|
78
|
+
}) : D;
|
|
79
|
+
return /* @__PURE__ */ g(B, {
|
|
80
|
+
ref: P,
|
|
37
81
|
role: "toolbar",
|
|
38
|
-
"aria-orientation":
|
|
39
|
-
"data-size":
|
|
40
|
-
"data-orientation":
|
|
41
|
-
className:
|
|
42
|
-
onKeyDownCapture:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
let r = h(t);
|
|
47
|
-
if (r.length === 0) return;
|
|
48
|
-
let i = r.indexOf(document.activeElement);
|
|
49
|
-
if (i < 0) return;
|
|
50
|
-
let a = n({
|
|
51
|
-
key: e.key,
|
|
52
|
-
current: i,
|
|
53
|
-
count: r.length,
|
|
54
|
-
orientation: p
|
|
55
|
-
});
|
|
56
|
-
a !== null && (e.preventDefault(), e.stopPropagation(), r[a]?.focus());
|
|
57
|
-
},
|
|
58
|
-
onFocus: (e) => {
|
|
59
|
-
v?.(e);
|
|
60
|
-
let t = x.current, n = e.target;
|
|
61
|
-
t && n !== C.current && h(t).includes(n) && (C.current = n, T());
|
|
62
|
-
},
|
|
63
|
-
...y,
|
|
64
|
-
children: g
|
|
82
|
+
"aria-orientation": S,
|
|
83
|
+
"data-size": x,
|
|
84
|
+
"data-orientation": S,
|
|
85
|
+
className: h("wim-toolbar", l.root, l[`size-${x}`], l[S], V && l.collapse, E),
|
|
86
|
+
onKeyDownCapture: z,
|
|
87
|
+
onFocus: R,
|
|
88
|
+
...A,
|
|
89
|
+
children: H
|
|
65
90
|
});
|
|
66
91
|
});
|
|
67
|
-
|
|
68
|
-
var
|
|
69
|
-
ref:
|
|
92
|
+
w.displayName = "Toolbar";
|
|
93
|
+
var T = u.forwardRef(({ asChild: t = !1, className: n, children: r, ...i }, a) => /* @__PURE__ */ g(t ? e : "div", {
|
|
94
|
+
ref: a,
|
|
70
95
|
role: "group",
|
|
71
|
-
className: l
|
|
72
|
-
...
|
|
73
|
-
children:
|
|
96
|
+
className: h(l.group, n),
|
|
97
|
+
...i,
|
|
98
|
+
children: r
|
|
74
99
|
}));
|
|
75
|
-
|
|
76
|
-
var
|
|
100
|
+
T.displayName = "Toolbar.Group";
|
|
101
|
+
var E = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ g("div", {
|
|
77
102
|
ref: n,
|
|
78
103
|
role: "separator",
|
|
79
104
|
"aria-hidden": "true",
|
|
80
|
-
className: l
|
|
105
|
+
className: h(l.separator, e),
|
|
81
106
|
...t
|
|
82
107
|
}));
|
|
83
|
-
|
|
84
|
-
var
|
|
85
|
-
|
|
108
|
+
E.displayName = "Toolbar.Separator";
|
|
109
|
+
var D = w;
|
|
110
|
+
D.Group = T, D.Separator = E;
|
|
86
111
|
//#endregion
|
|
87
|
-
export {
|
|
112
|
+
export { D as Toolbar, D as default, T as ToolbarGroup, E as ToolbarSeparator };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_avk5e_4`,t=`_horizontal_avk5e_13`,n=`_vertical_avk5e_16`,r=`_group_avk5e_32`,i=`_separator_avk5e_42`,a=`_collapse_avk5e_58`,o=`_more_avk5e_66`,s={root:e,horizontal:t,vertical:n,"size-sm":`_size-sm_avk5e_20`,"size-md":`_size-md_avk5e_24`,"size-lg":`_size-lg_avk5e_28`,group:r,separator:i,collapse:a,more:o};exports.collapse=a,exports.default=s,exports.group=r,exports.horizontal=t,exports.more=o,exports.root=e,exports.separator=i,exports.vertical=n;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/layout/Toolbar/toolbar.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_avk5e_4", t = "_horizontal_avk5e_13", n = "_vertical_avk5e_16", r = "_group_avk5e_32", i = "_separator_avk5e_42", a = "_collapse_avk5e_58", o = "_more_avk5e_66", s = {
|
|
4
4
|
root: e,
|
|
5
5
|
horizontal: t,
|
|
6
6
|
vertical: n,
|
|
7
|
-
"size-sm": "_size-
|
|
8
|
-
"size-md": "_size-
|
|
9
|
-
"size-lg": "_size-
|
|
7
|
+
"size-sm": "_size-sm_avk5e_20",
|
|
8
|
+
"size-md": "_size-md_avk5e_24",
|
|
9
|
+
"size-lg": "_size-lg_avk5e_28",
|
|
10
10
|
group: r,
|
|
11
|
-
separator: i
|
|
11
|
+
separator: i,
|
|
12
|
+
collapse: a,
|
|
13
|
+
more: o
|
|
12
14
|
};
|
|
13
15
|
//#endregion
|
|
14
|
-
export { a as default, r as group, t as horizontal, e as root, i as separator, n as vertical };
|
|
16
|
+
export { a as collapse, s as default, r as group, t as horizontal, o as more, e as root, i as separator, n as vertical };
|