@midas-ds/components 1.1.0 → 1.3.0
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/CHANGELOG.md +63 -1
- package/accordion/AccordionItem.d.ts +2 -2
- package/index.cjs +138 -0
- package/index.css +1 -0
- package/index.d.ts +0 -2
- package/index.js +27094 -105
- package/package.json +22 -4
- package/table/Table.d.ts +3 -4
- package/textfield/TextField.d.ts +15 -4
- package/theme.cjs +1 -0
- package/theme.js +20 -0
- package/tokens-BskyMDHv.cjs +1 -0
- package/Breadcrumbs.css +0 -1
- package/Button-DL6nqUco.js +0 -182
- package/Button.css +0 -1
- package/ButtonGroup.css +0 -1
- package/Card.css +0 -1
- package/Checkbox-q0dugR2t.js +0 -402
- package/Checkbox.css +0 -1
- package/Collection-KMFfVuzU.js +0 -510
- package/ComboBox.css +0 -1
- package/DatePicker.css +0 -1
- package/Dialog-D6Bqrpn-.js +0 -1952
- package/Disclosure-dAZYXyTH.js +0 -225
- package/Disclosure.css +0 -1
- package/DragAndDrop-B0T3WgjL.js +0 -40
- package/Dropdown.css +0 -1
- package/FileUpload.css +0 -1
- package/Flex.css +0 -1
- package/Flex.module-CpoxBzQX.js +0 -37
- package/FocusScope-B7CkxXNC.js +0 -513
- package/Form-BWBjJC6v.js +0 -238
- package/Grid.css +0 -1
- package/Grid.module-Ia0e9Dix.js +0 -36
- package/Group-D7_8007y.js +0 -42
- package/Heading-RCRHv6hd.js +0 -15
- package/Hidden-CVlUgUJM.js +0 -37
- package/InfoBanner.css +0 -1
- package/Layout.css +0 -1
- package/Link-BnQvB-hH.js +0 -75
- package/Link.css +0 -1
- package/LinkButton.css +0 -1
- package/ListBox-DBBiqvcR.js +0 -474
- package/ListKeyboardDelegate-gCXy-Xnn.js +0 -172
- package/Logo.css +0 -1
- package/Modal.css +0 -1
- package/MultiSelect.css +0 -1
- package/PressResponder-B4g56kDz.js +0 -31
- package/RSPContexts-BW2SEIqe.js +0 -11
- package/Radio.css +0 -1
- package/SearchField.css +0 -1
- package/Select.css +0 -1
- package/SelectionManager-BfXUE1qg.js +0 -1031
- package/Separator-BBX9m2O2.js +0 -49
- package/Spinner.css +0 -1
- package/Table.css +0 -1
- package/Tabs.css +0 -1
- package/Tag-DWt0koFj.js +0 -728
- package/Tag.css +0 -1
- package/Text-BCF0xvqL.js +0 -15
- package/TextArea.css +0 -1
- package/TextField-CX4eOQf6.js +0 -225
- package/TextField.css +0 -1
- package/TextField.module-DdICj682.js +0 -143
- package/Toast.css +0 -1
- package/VisuallyHidden-Dhr5caPC.js +0 -39
- package/chevron-down-Cd1bkzXT.js +0 -13
- package/chevron-right-DBMc9VMi.js +0 -23
- package/clsx-OuTLNxxd.js +0 -16
- package/context-BpJLnOuu.js +0 -80
- package/createLucideIcon-DeWljiyi.js +0 -79
- package/index-B-jHjTDC.js +0 -120
- package/index-BPdc9gJ8.js +0 -3122
- package/index-KSgQWWiy.js +0 -26984
- package/index10.js +0 -4
- package/index11.js +0 -5
- package/index12.js +0 -4
- package/index13.js +0 -4
- package/index14.js +0 -4
- package/index15.js +0 -6
- package/index16.js +0 -6
- package/index17.js +0 -6
- package/index18.js +0 -4
- package/index19.js +0 -6
- package/index2.js +0 -8
- package/index20.js +0 -6
- package/index21.js +0 -4
- package/index22.js +0 -5
- package/index23.js +0 -5
- package/index24.js +0 -5
- package/index25.js +0 -6
- package/index26.js +0 -6
- package/index27.js +0 -6
- package/index28.js +0 -4
- package/index29.js +0 -6
- package/index3.js +0 -6
- package/index30.js +0 -21
- package/index31.js +0 -22
- package/index32.js +0 -14
- package/index33.js +0 -11
- package/index34.js +0 -31
- package/index35.js +0 -8
- package/index36.js +0 -9
- package/index37.js +0 -19
- package/index38.js +0 -9
- package/index39.js +0 -9
- package/index4.js +0 -4
- package/index40.js +0 -23
- package/index41.js +0 -63
- package/index42.js +0 -53
- package/index43.js +0 -18
- package/index44.js +0 -27
- package/index45.js +0 -18
- package/index46.js +0 -21
- package/index47.js +0 -49
- package/index48.js +0 -5
- package/index49.js +0 -25
- package/index5.js +0 -5
- package/index50.js +0 -18
- package/index51.js +0 -9
- package/index52.js +0 -25
- package/index53.js +0 -18
- package/index54.js +0 -11
- package/index55.js +0 -12
- package/index56.js +0 -15
- package/index57.js +0 -9
- package/index58.js +0 -9
- package/index59.js +0 -19
- package/index6.js +0 -4
- package/index60.js +0 -22
- package/index61.js +0 -61
- package/index62.js +0 -15
- package/index63.js +0 -11
- package/index64.js +0 -53
- package/index65.js +0 -85
- package/index66.js +0 -74
- package/index67.js +0 -24
- package/index68.js +0 -69
- package/index69.js +0 -80
- package/index7.js +0 -9
- package/index70.js +0 -140
- package/index71.js +0 -70
- package/index72.js +0 -42
- package/index73.js +0 -82
- package/index74.js +0 -71
- package/index75.js +0 -104
- package/index76.js +0 -275
- package/index77.js +0 -723
- package/index78.js +0 -489
- package/index79.js +0 -314
- package/index8.js +0 -4
- package/index80.js +0 -389
- package/index81.js +0 -252
- package/index82.js +0 -1364
- package/index83.js +0 -1009
- package/index84.js +0 -386
- package/index85.js +0 -2101
- package/index86.js +0 -2368
- package/index87.js +0 -6831
- package/index88.js +0 -17
- package/index89.js +0 -14
- package/index9.js +0 -5
- package/index90.js +0 -6
- package/index91.js +0 -9
- package/intlStrings-Cd44R5hT.js +0 -278
- package/react.esm-sMU8Z7rL.js +0 -11060
- package/triangle-alert-1OYl9KWz.js +0 -56
- package/useControlledState-Kv9K2AYu.js +0 -30
- package/useDescription-B7stiK3j.js +0 -32
- package/useEvent-Xk5kn5Ns.js +0 -21
- package/useField-DMzJIIN4.js +0 -67
- package/useFilter-Bt9dbV1U.js +0 -35
- package/useFocusRing-9PXyKy2A.js +0 -1297
- package/useFocusable-CcEBZe40.js +0 -59
- package/useGridSelectionCheckbox-DYgEnElE.js +0 -22
- package/useHasTabbableChild-D6DwR81L.js +0 -34
- package/useHighlightSelectionDescription-WYAbP4No.js +0 -552
- package/useLabels-9zaZ9oa0.js +0 -17
- package/useListState-BfTeKTk5.js +0 -119
- package/useLocalizedStringFormatter-BlCbn-hX.js +0 -96
- package/useSingleSelectListState-DPkaL0la.js +0 -34
- package/useUpdateEffect-Dtz-i14F.js +0 -12
- package/x-JK7i-TQC.js +0 -14
package/index77.js
DELETED
|
@@ -1,723 +0,0 @@
|
|
|
1
|
-
import { jsx as v, jsxs as C } from "react/jsx-runtime";
|
|
2
|
-
import { a as ne, $ as de } from "./Button-DL6nqUco.js";
|
|
3
|
-
import { a as se, c as X, d as N, o as Y, e as Z, B as z, i as ee, b as ce, E as L } from "./useFocusRing-9PXyKy2A.js";
|
|
4
|
-
import { d as fe, a as ue } from "./Dialog-D6Bqrpn-.js";
|
|
5
|
-
import { a as pe } from "./Form-BWBjJC6v.js";
|
|
6
|
-
import { a as be } from "./RSPContexts-BW2SEIqe.js";
|
|
7
|
-
import { $ as me, a as $e, b as V, c as ge, d as ye } from "./Collection-KMFfVuzU.js";
|
|
8
|
-
import { $ as M, a as ve, b as xe, c as De } from "./DragAndDrop-B0T3WgjL.js";
|
|
9
|
-
import { $ as _ } from "./ListBox-DBBiqvcR.js";
|
|
10
|
-
import { $ as he } from "./Text-BCF0xvqL.js";
|
|
11
|
-
import * as H from "react";
|
|
12
|
-
import c, { useState as Se, useMemo as te, forwardRef as re, useContext as E, useRef as P, useEffect as F, createContext as Pe } from "react";
|
|
13
|
-
import { $ as we } from "./useListState-BfTeKTk5.js";
|
|
14
|
-
import { $ as ke, a as J } from "./ListKeyboardDelegate-gCXy-Xnn.js";
|
|
15
|
-
import { $ as Ie } from "./context-BpJLnOuu.js";
|
|
16
|
-
import { $ as Ee, b as Ke, c as Te, a as He, T as Be } from "./Tag-DWt0koFj.js";
|
|
17
|
-
import { $ as Ae } from "./useGridSelectionCheckbox-DYgEnElE.js";
|
|
18
|
-
import { a as Re } from "./FocusScope-B7CkxXNC.js";
|
|
19
|
-
import { $ as G } from "./VisuallyHidden-Dhr5caPC.js";
|
|
20
|
-
import { I as Ce } from "./TextField-CX4eOQf6.js";
|
|
21
|
-
import { C as Me } from "./Checkbox-q0dugR2t.js";
|
|
22
|
-
import { C as Le } from "./chevron-down-Cd1bkzXT.js";
|
|
23
|
-
import './MultiSelect.css';function Ve(n, a) {
|
|
24
|
-
let { key: l } = n;
|
|
25
|
-
const { checkboxProps: e } = Ae(n, a);
|
|
26
|
-
return {
|
|
27
|
-
checkboxProps: {
|
|
28
|
-
...e,
|
|
29
|
-
"aria-labelledby": `${e.id} ${Ee(a, l)}`
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function _e(n) {
|
|
34
|
-
let { initialItems: a = [], initialSelectedKeys: l, getKey: e = (f) => {
|
|
35
|
-
var d;
|
|
36
|
-
return (d = f.id) !== null && d !== void 0 ? d : f.key;
|
|
37
|
-
}, filter: o, initialFilterText: t = "" } = n, [r, i] = Se({
|
|
38
|
-
items: a,
|
|
39
|
-
selectedKeys: l === "all" ? "all" : new Set(l || []),
|
|
40
|
-
filterText: t
|
|
41
|
-
}), s = te(() => o ? r.items.filter((f) => o(f, r.filterText)) : r.items, [
|
|
42
|
-
r.items,
|
|
43
|
-
r.filterText,
|
|
44
|
-
o
|
|
45
|
-
]);
|
|
46
|
-
return {
|
|
47
|
-
...r,
|
|
48
|
-
items: s,
|
|
49
|
-
...Fe({
|
|
50
|
-
getKey: e
|
|
51
|
-
}, i),
|
|
52
|
-
getItem(f) {
|
|
53
|
-
return r.items.find((d) => e(d) === f);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function Fe(n, a) {
|
|
58
|
-
let { cursor: l, getKey: e } = n;
|
|
59
|
-
return {
|
|
60
|
-
setSelectedKeys(o) {
|
|
61
|
-
a((t) => ({
|
|
62
|
-
...t,
|
|
63
|
-
selectedKeys: o
|
|
64
|
-
}));
|
|
65
|
-
},
|
|
66
|
-
setFilterText(o) {
|
|
67
|
-
a((t) => ({
|
|
68
|
-
...t,
|
|
69
|
-
filterText: o
|
|
70
|
-
}));
|
|
71
|
-
},
|
|
72
|
-
insert(o, ...t) {
|
|
73
|
-
a((r) => B(r, o, ...t));
|
|
74
|
-
},
|
|
75
|
-
insertBefore(o, ...t) {
|
|
76
|
-
a((r) => {
|
|
77
|
-
let i = r.items.findIndex((s) => (e == null ? void 0 : e(s)) === o);
|
|
78
|
-
if (i === -1)
|
|
79
|
-
if (r.items.length === 0) i = 0;
|
|
80
|
-
else return r;
|
|
81
|
-
return B(r, i, ...t);
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
insertAfter(o, ...t) {
|
|
85
|
-
a((r) => {
|
|
86
|
-
let i = r.items.findIndex((s) => (e == null ? void 0 : e(s)) === o);
|
|
87
|
-
if (i === -1)
|
|
88
|
-
if (r.items.length === 0) i = 0;
|
|
89
|
-
else return r;
|
|
90
|
-
return B(r, i + 1, ...t);
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
prepend(...o) {
|
|
94
|
-
a((t) => B(t, 0, ...o));
|
|
95
|
-
},
|
|
96
|
-
append(...o) {
|
|
97
|
-
a((t) => B(t, t.items.length, ...o));
|
|
98
|
-
},
|
|
99
|
-
remove(...o) {
|
|
100
|
-
a((t) => {
|
|
101
|
-
let r = new Set(o), i = t.items.filter((f) => !r.has(e(f))), s = "all";
|
|
102
|
-
if (t.selectedKeys !== "all") {
|
|
103
|
-
s = new Set(t.selectedKeys);
|
|
104
|
-
for (let f of o) s.delete(f);
|
|
105
|
-
}
|
|
106
|
-
return l == null && i.length === 0 && (s = /* @__PURE__ */ new Set()), {
|
|
107
|
-
...t,
|
|
108
|
-
items: i,
|
|
109
|
-
selectedKeys: s
|
|
110
|
-
};
|
|
111
|
-
});
|
|
112
|
-
},
|
|
113
|
-
removeSelectedItems() {
|
|
114
|
-
a((o) => {
|
|
115
|
-
if (o.selectedKeys === "all") return {
|
|
116
|
-
...o,
|
|
117
|
-
items: [],
|
|
118
|
-
selectedKeys: /* @__PURE__ */ new Set()
|
|
119
|
-
};
|
|
120
|
-
let t = o.selectedKeys, r = o.items.filter((i) => !t.has(e(i)));
|
|
121
|
-
return {
|
|
122
|
-
...o,
|
|
123
|
-
items: r,
|
|
124
|
-
selectedKeys: /* @__PURE__ */ new Set()
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
},
|
|
128
|
-
move(o, t) {
|
|
129
|
-
a((r) => {
|
|
130
|
-
let i = r.items.findIndex((d) => e(d) === o);
|
|
131
|
-
if (i === -1) return r;
|
|
132
|
-
let s = r.items.slice(), [f] = s.splice(i, 1);
|
|
133
|
-
return s.splice(t, 0, f), {
|
|
134
|
-
...r,
|
|
135
|
-
items: s
|
|
136
|
-
};
|
|
137
|
-
});
|
|
138
|
-
},
|
|
139
|
-
moveBefore(o, t) {
|
|
140
|
-
a((r) => {
|
|
141
|
-
let i = r.items.findIndex((d) => e(d) === o);
|
|
142
|
-
if (i === -1) return r;
|
|
143
|
-
let f = (Array.isArray(t) ? t : [
|
|
144
|
-
...t
|
|
145
|
-
]).map((d) => r.items.findIndex((m) => e(m) === d)).sort((d, m) => d - m);
|
|
146
|
-
return Q(r, f, i);
|
|
147
|
-
});
|
|
148
|
-
},
|
|
149
|
-
moveAfter(o, t) {
|
|
150
|
-
a((r) => {
|
|
151
|
-
let i = r.items.findIndex((d) => e(d) === o);
|
|
152
|
-
if (i === -1) return r;
|
|
153
|
-
let f = (Array.isArray(t) ? t : [
|
|
154
|
-
...t
|
|
155
|
-
]).map((d) => r.items.findIndex((m) => e(m) === d)).sort((d, m) => d - m);
|
|
156
|
-
return Q(r, f, i + 1);
|
|
157
|
-
});
|
|
158
|
-
},
|
|
159
|
-
update(o, t) {
|
|
160
|
-
a((r) => {
|
|
161
|
-
let i = r.items.findIndex((s) => e(s) === o);
|
|
162
|
-
return i === -1 ? r : {
|
|
163
|
-
...r,
|
|
164
|
-
items: [
|
|
165
|
-
...r.items.slice(0, i),
|
|
166
|
-
t,
|
|
167
|
-
...r.items.slice(i + 1)
|
|
168
|
-
]
|
|
169
|
-
};
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
function B(n, a, ...l) {
|
|
175
|
-
return {
|
|
176
|
-
...n,
|
|
177
|
-
items: [
|
|
178
|
-
...n.items.slice(0, a),
|
|
179
|
-
...l,
|
|
180
|
-
...n.items.slice(a)
|
|
181
|
-
]
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
function Q(n, a, l) {
|
|
185
|
-
l -= a.filter((t) => t < l).length;
|
|
186
|
-
let e = a.map((t) => ({
|
|
187
|
-
from: t,
|
|
188
|
-
to: l++
|
|
189
|
-
}));
|
|
190
|
-
for (let t = 0; t < e.length; t++) {
|
|
191
|
-
let r = e[t].from;
|
|
192
|
-
for (let i = t; i < e.length; i++)
|
|
193
|
-
e[i].from > r && e[i].from--;
|
|
194
|
-
}
|
|
195
|
-
for (let t = 0; t < e.length; t++) {
|
|
196
|
-
let r = e[t];
|
|
197
|
-
for (let i = e.length - 1; i > t; i--) {
|
|
198
|
-
let s = e[i];
|
|
199
|
-
s.from < r.to ? r.to++ : s.from++;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
let o = n.items.slice();
|
|
203
|
-
for (let t of e) {
|
|
204
|
-
let [r] = o.splice(t.from, 1);
|
|
205
|
-
o.splice(t.to, 0, r);
|
|
206
|
-
}
|
|
207
|
-
return {
|
|
208
|
-
...n,
|
|
209
|
-
items: o
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
const Ne = /* @__PURE__ */ Pe(null), ze = /* @__PURE__ */ re(function(a, l) {
|
|
213
|
-
return [a, l] = se(a, l, Ne), /* @__PURE__ */ c.createElement(me, {
|
|
214
|
-
content: /* @__PURE__ */ c.createElement($e, a)
|
|
215
|
-
}, (e) => /* @__PURE__ */ c.createElement(Ge, {
|
|
216
|
-
props: a,
|
|
217
|
-
collection: e,
|
|
218
|
-
gridListRef: l
|
|
219
|
-
}));
|
|
220
|
-
});
|
|
221
|
-
function Ge({ props: n, collection: a, gridListRef: l }) {
|
|
222
|
-
let { dragAndDropHooks: e, keyboardNavigationBehavior: o = "arrow", layout: t = "stack" } = n, { CollectionRoot: r, isVirtualized: i, layoutDelegate: s, dropTargetDelegate: f } = E(V), d = we({
|
|
223
|
-
...n,
|
|
224
|
-
collection: a,
|
|
225
|
-
children: void 0,
|
|
226
|
-
layoutDelegate: s
|
|
227
|
-
}), m = ke({
|
|
228
|
-
usage: "search",
|
|
229
|
-
sensitivity: "base"
|
|
230
|
-
}), { disabledBehavior: b, disabledKeys: g } = d.selectionManager, { direction: u } = Ie(), p = te(() => new J({
|
|
231
|
-
collection: a,
|
|
232
|
-
collator: m,
|
|
233
|
-
ref: l,
|
|
234
|
-
disabledKeys: g,
|
|
235
|
-
disabledBehavior: b,
|
|
236
|
-
layoutDelegate: s,
|
|
237
|
-
layout: t,
|
|
238
|
-
direction: u
|
|
239
|
-
}), [
|
|
240
|
-
a,
|
|
241
|
-
l,
|
|
242
|
-
t,
|
|
243
|
-
g,
|
|
244
|
-
b,
|
|
245
|
-
s,
|
|
246
|
-
m,
|
|
247
|
-
u
|
|
248
|
-
]), { gridProps: R } = Ke({
|
|
249
|
-
...n,
|
|
250
|
-
keyboardDelegate: p,
|
|
251
|
-
// Only tab navigation is supported in grid layout.
|
|
252
|
-
keyboardNavigationBehavior: t === "grid" ? "tab" : o,
|
|
253
|
-
isVirtualized: i
|
|
254
|
-
}, d, l), D = d.selectionManager, w = !!(e != null && e.useDraggableCollectionState), h = !!(e != null && e.useDroppableCollectionState), y = P(w), $ = P(h);
|
|
255
|
-
F(() => {
|
|
256
|
-
y.current !== w && console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."), $.current !== h && console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.");
|
|
257
|
-
}, [
|
|
258
|
-
w,
|
|
259
|
-
h
|
|
260
|
-
]);
|
|
261
|
-
let k, x, S, I = !1, K = null, W = P(null);
|
|
262
|
-
if (w && e) {
|
|
263
|
-
k = e.useDraggableCollectionState({
|
|
264
|
-
collection: a,
|
|
265
|
-
selectionManager: D,
|
|
266
|
-
preview: e.renderDragPreview ? W : void 0
|
|
267
|
-
}), e.useDraggableCollection({}, k, l);
|
|
268
|
-
let T = e.DragPreview;
|
|
269
|
-
K = e.renderDragPreview ? /* @__PURE__ */ c.createElement(T, {
|
|
270
|
-
ref: W
|
|
271
|
-
}, e.renderDragPreview) : null;
|
|
272
|
-
}
|
|
273
|
-
if (h && e) {
|
|
274
|
-
x = e.useDroppableCollectionState({
|
|
275
|
-
collection: a,
|
|
276
|
-
selectionManager: D
|
|
277
|
-
});
|
|
278
|
-
let T = new J({
|
|
279
|
-
collection: a,
|
|
280
|
-
disabledKeys: D.disabledKeys,
|
|
281
|
-
disabledBehavior: D.disabledBehavior,
|
|
282
|
-
ref: l
|
|
283
|
-
}), le = e.dropTargetDelegate || f || new e.ListDropTargetDelegate(a, l, {
|
|
284
|
-
layout: t,
|
|
285
|
-
direction: u
|
|
286
|
-
});
|
|
287
|
-
S = e.useDroppableCollection({
|
|
288
|
-
keyboardDelegate: T,
|
|
289
|
-
dropTargetDelegate: le
|
|
290
|
-
}, x, l), I = x.isDropTarget({
|
|
291
|
-
type: "root"
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
let { focusProps: oe, isFocused: j, isFocusVisible: O } = X(), U = {
|
|
295
|
-
isDropTarget: I,
|
|
296
|
-
isEmpty: d.collection.size === 0,
|
|
297
|
-
isFocused: j,
|
|
298
|
-
isFocusVisible: O,
|
|
299
|
-
layout: t,
|
|
300
|
-
state: d
|
|
301
|
-
}, ae = N({
|
|
302
|
-
className: n.className,
|
|
303
|
-
style: n.style,
|
|
304
|
-
defaultClassName: "react-aria-GridList",
|
|
305
|
-
values: U
|
|
306
|
-
}), q = null, ie = null;
|
|
307
|
-
if (d.collection.size === 0 && n.renderEmptyState) {
|
|
308
|
-
let T = n.renderEmptyState(U);
|
|
309
|
-
q = /* @__PURE__ */ c.createElement("div", {
|
|
310
|
-
role: "row",
|
|
311
|
-
style: {
|
|
312
|
-
display: "contents"
|
|
313
|
-
}
|
|
314
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
315
|
-
role: "gridcell",
|
|
316
|
-
style: {
|
|
317
|
-
display: "contents"
|
|
318
|
-
}
|
|
319
|
-
}, T));
|
|
320
|
-
}
|
|
321
|
-
return /* @__PURE__ */ c.createElement(Re, null, /* @__PURE__ */ c.createElement("div", {
|
|
322
|
-
...Y(n),
|
|
323
|
-
...ae,
|
|
324
|
-
...Z(R, oe, S == null ? void 0 : S.collectionProps, ie),
|
|
325
|
-
ref: l,
|
|
326
|
-
slot: n.slot || void 0,
|
|
327
|
-
onScroll: n.onScroll,
|
|
328
|
-
"data-drop-target": I || void 0,
|
|
329
|
-
"data-empty": d.collection.size === 0 || void 0,
|
|
330
|
-
"data-focused": j || void 0,
|
|
331
|
-
"data-focus-visible": O || void 0,
|
|
332
|
-
"data-layout": t
|
|
333
|
-
}, /* @__PURE__ */ c.createElement(z, {
|
|
334
|
-
values: [
|
|
335
|
-
[
|
|
336
|
-
_,
|
|
337
|
-
d
|
|
338
|
-
],
|
|
339
|
-
[
|
|
340
|
-
M,
|
|
341
|
-
{
|
|
342
|
-
dragAndDropHooks: e,
|
|
343
|
-
dragState: k,
|
|
344
|
-
dropState: x
|
|
345
|
-
}
|
|
346
|
-
],
|
|
347
|
-
[
|
|
348
|
-
ve,
|
|
349
|
-
{
|
|
350
|
-
render: je
|
|
351
|
-
}
|
|
352
|
-
]
|
|
353
|
-
]
|
|
354
|
-
}, h && /* @__PURE__ */ c.createElement(qe, null), /* @__PURE__ */ c.createElement(r, {
|
|
355
|
-
collection: a,
|
|
356
|
-
scrollRef: l,
|
|
357
|
-
persistedKeys: xe(D, e, x),
|
|
358
|
-
renderDropIndicator: De(e, x)
|
|
359
|
-
})), q, K));
|
|
360
|
-
}
|
|
361
|
-
const We = /* @__PURE__ */ ge("item", function(a, l, e) {
|
|
362
|
-
let o = E(_), { dragAndDropHooks: t, dragState: r, dropState: i } = E(M), s = ee(l), { isVirtualized: f } = E(V), { rowProps: d, gridCellProps: m, descriptionProps: b, ...g } = Te({
|
|
363
|
-
node: e,
|
|
364
|
-
shouldSelectOnPressUp: !!r,
|
|
365
|
-
isVirtualized: f
|
|
366
|
-
}, o, s), { hoverProps: u, isHovered: p } = ce({
|
|
367
|
-
isDisabled: !g.allowsSelection && !g.hasAction,
|
|
368
|
-
onHoverStart: e.props.onHoverStart,
|
|
369
|
-
onHoverChange: e.props.onHoverChange,
|
|
370
|
-
onHoverEnd: e.props.onHoverEnd
|
|
371
|
-
}), { isFocusVisible: R, focusProps: D } = X(), { checkboxProps: w } = Ve({
|
|
372
|
-
key: e.key
|
|
373
|
-
}, o), h = o.selectionManager.disabledBehavior === "all" && g.isDisabled ? {
|
|
374
|
-
isDisabled: !0
|
|
375
|
-
} : {}, y = null;
|
|
376
|
-
r && t && (y = t.useDraggableItem({
|
|
377
|
-
key: e.key,
|
|
378
|
-
hasDragButton: !0
|
|
379
|
-
}, r));
|
|
380
|
-
let $ = null, k = P(null), { visuallyHiddenProps: x } = G();
|
|
381
|
-
i && t && ($ = t.useDropIndicator({
|
|
382
|
-
target: {
|
|
383
|
-
type: "item",
|
|
384
|
-
key: e.key,
|
|
385
|
-
dropPosition: "on"
|
|
386
|
-
}
|
|
387
|
-
}, i, k));
|
|
388
|
-
let S = r && r.isDragging(e.key), I = N({
|
|
389
|
-
...a,
|
|
390
|
-
id: void 0,
|
|
391
|
-
children: e.rendered,
|
|
392
|
-
defaultClassName: "react-aria-GridListItem",
|
|
393
|
-
values: {
|
|
394
|
-
...g,
|
|
395
|
-
isHovered: p,
|
|
396
|
-
isFocusVisible: R,
|
|
397
|
-
selectionMode: o.selectionManager.selectionMode,
|
|
398
|
-
selectionBehavior: o.selectionManager.selectionBehavior,
|
|
399
|
-
allowsDragging: !!r,
|
|
400
|
-
isDragging: S,
|
|
401
|
-
isDropTarget: $ == null ? void 0 : $.isDropTarget
|
|
402
|
-
}
|
|
403
|
-
}), K = P(null);
|
|
404
|
-
return F(() => {
|
|
405
|
-
r && !K.current && console.warn('Draggable items in a GridList must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.');
|
|
406
|
-
}, []), F(() => {
|
|
407
|
-
e.textValue || console.warn("A `textValue` prop is required for <GridListItem> elements with non-plain text children in order to support accessibility features such as type to select.");
|
|
408
|
-
}, [
|
|
409
|
-
e.textValue
|
|
410
|
-
]), /* @__PURE__ */ c.createElement(c.Fragment, null, $ && !$.isHidden && /* @__PURE__ */ c.createElement("div", {
|
|
411
|
-
role: "row",
|
|
412
|
-
style: {
|
|
413
|
-
position: "absolute"
|
|
414
|
-
}
|
|
415
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
416
|
-
role: "gridcell"
|
|
417
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
418
|
-
role: "button",
|
|
419
|
-
...x,
|
|
420
|
-
...$ == null ? void 0 : $.dropIndicatorProps,
|
|
421
|
-
ref: k
|
|
422
|
-
}))), /* @__PURE__ */ c.createElement("div", {
|
|
423
|
-
...Z(Y(a), d, D, u, y == null ? void 0 : y.dragProps),
|
|
424
|
-
...I,
|
|
425
|
-
ref: s,
|
|
426
|
-
"data-selected": g.isSelected || void 0,
|
|
427
|
-
"data-disabled": g.isDisabled || void 0,
|
|
428
|
-
"data-hovered": p || void 0,
|
|
429
|
-
"data-focused": g.isFocused || void 0,
|
|
430
|
-
"data-focus-visible": R || void 0,
|
|
431
|
-
"data-pressed": g.isPressed || void 0,
|
|
432
|
-
"data-allows-dragging": !!r || void 0,
|
|
433
|
-
"data-dragging": S || void 0,
|
|
434
|
-
"data-drop-target": ($ == null ? void 0 : $.isDropTarget) || void 0,
|
|
435
|
-
"data-selection-mode": o.selectionManager.selectionMode === "none" ? void 0 : o.selectionManager.selectionMode
|
|
436
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
437
|
-
...m,
|
|
438
|
-
style: {
|
|
439
|
-
display: "contents"
|
|
440
|
-
}
|
|
441
|
-
}, /* @__PURE__ */ c.createElement(z, {
|
|
442
|
-
values: [
|
|
443
|
-
[
|
|
444
|
-
be,
|
|
445
|
-
{
|
|
446
|
-
slots: {
|
|
447
|
-
[L]: {},
|
|
448
|
-
selection: w
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
],
|
|
452
|
-
[
|
|
453
|
-
ne,
|
|
454
|
-
{
|
|
455
|
-
slots: {
|
|
456
|
-
[L]: h,
|
|
457
|
-
drag: {
|
|
458
|
-
...y == null ? void 0 : y.dragButtonProps,
|
|
459
|
-
ref: K,
|
|
460
|
-
style: {
|
|
461
|
-
pointerEvents: "none"
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
],
|
|
467
|
-
[
|
|
468
|
-
he,
|
|
469
|
-
{
|
|
470
|
-
slots: {
|
|
471
|
-
[L]: {},
|
|
472
|
-
description: b
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
],
|
|
476
|
-
[
|
|
477
|
-
V,
|
|
478
|
-
ye
|
|
479
|
-
],
|
|
480
|
-
[
|
|
481
|
-
_,
|
|
482
|
-
null
|
|
483
|
-
]
|
|
484
|
-
]
|
|
485
|
-
}, I.children))));
|
|
486
|
-
});
|
|
487
|
-
function je(n, a) {
|
|
488
|
-
a = ee(a);
|
|
489
|
-
let { dragAndDropHooks: l, dropState: e } = E(M), o = P(null), { dropIndicatorProps: t, isHidden: r, isDropTarget: i } = l.useDropIndicator(n, e, o);
|
|
490
|
-
return r ? null : /* @__PURE__ */ c.createElement(Ue, {
|
|
491
|
-
...n,
|
|
492
|
-
dropIndicatorProps: t,
|
|
493
|
-
isDropTarget: i,
|
|
494
|
-
buttonRef: o,
|
|
495
|
-
ref: a
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
function Oe(n, a) {
|
|
499
|
-
let { dropIndicatorProps: l, isDropTarget: e, buttonRef: o, ...t } = n, { visuallyHiddenProps: r } = G(), i = N({
|
|
500
|
-
...t,
|
|
501
|
-
defaultClassName: "react-aria-DropIndicator",
|
|
502
|
-
values: {
|
|
503
|
-
isDropTarget: e
|
|
504
|
-
}
|
|
505
|
-
});
|
|
506
|
-
return /* @__PURE__ */ c.createElement("div", {
|
|
507
|
-
...i,
|
|
508
|
-
role: "row",
|
|
509
|
-
ref: a,
|
|
510
|
-
"data-drop-target": e || void 0
|
|
511
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
512
|
-
role: "gridcell"
|
|
513
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
514
|
-
...r,
|
|
515
|
-
role: "button",
|
|
516
|
-
...l,
|
|
517
|
-
ref: o
|
|
518
|
-
}), i.children));
|
|
519
|
-
}
|
|
520
|
-
const Ue = /* @__PURE__ */ re(Oe);
|
|
521
|
-
function qe() {
|
|
522
|
-
let { dragAndDropHooks: n, dropState: a } = E(M), l = P(null), { dropIndicatorProps: e } = n.useDropIndicator({
|
|
523
|
-
target: {
|
|
524
|
-
type: "root"
|
|
525
|
-
}
|
|
526
|
-
}, a, l), o = a.isDropTarget({
|
|
527
|
-
type: "root"
|
|
528
|
-
}), { visuallyHiddenProps: t } = G();
|
|
529
|
-
return !o && e["aria-hidden"] ? null : /* @__PURE__ */ c.createElement("div", {
|
|
530
|
-
role: "row",
|
|
531
|
-
"aria-hidden": e["aria-hidden"],
|
|
532
|
-
style: {
|
|
533
|
-
position: "absolute"
|
|
534
|
-
}
|
|
535
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
536
|
-
role: "gridcell"
|
|
537
|
-
}, /* @__PURE__ */ c.createElement("div", {
|
|
538
|
-
role: "button",
|
|
539
|
-
...t,
|
|
540
|
-
...e,
|
|
541
|
-
ref: l
|
|
542
|
-
})));
|
|
543
|
-
}
|
|
544
|
-
const Je = '"../theme/tokens.css"', Qe = '"Inter", sans-serif', Xe = "#000000", Ye = "#b31b1b", Ze = "(max-width: 767px)", et = "#bfbfbf", tt = "#e6e6e6", rt = "#f2f2f2", ot = "_button_1eb3v_4", at = "_icon_1eb3v_19", it = "_multiSelect_1eb3v_44", lt = "_popover_1eb3v_60", nt = "_listBoxItem_1eb3v_73", A = {
|
|
545
|
-
tokens: Je,
|
|
546
|
-
display: Qe,
|
|
547
|
-
black: Xe,
|
|
548
|
-
signalRed130: Ye,
|
|
549
|
-
smBreakpoint: Ze,
|
|
550
|
-
gray50: et,
|
|
551
|
-
gray20: tt,
|
|
552
|
-
backgroundSecondary: rt,
|
|
553
|
-
button: ot,
|
|
554
|
-
icon: at,
|
|
555
|
-
multiSelect: it,
|
|
556
|
-
popover: lt,
|
|
557
|
-
listBoxItem: nt
|
|
558
|
-
}, Kt = ({
|
|
559
|
-
label: n,
|
|
560
|
-
description: a,
|
|
561
|
-
items: l,
|
|
562
|
-
onSelectionChange: e,
|
|
563
|
-
selectedKeys: o,
|
|
564
|
-
defaultSelectedKeys: t,
|
|
565
|
-
isDisabled: r,
|
|
566
|
-
isInvalid: i,
|
|
567
|
-
errorMessage: s
|
|
568
|
-
}) => {
|
|
569
|
-
const f = H.useRef(null), [d, m] = H.useState(
|
|
570
|
-
void 0
|
|
571
|
-
), b = _e({
|
|
572
|
-
initialItems: l,
|
|
573
|
-
initialSelectedKeys: t
|
|
574
|
-
});
|
|
575
|
-
H.useEffect(() => {
|
|
576
|
-
const u = () => {
|
|
577
|
-
f.current && m(f.current.offsetWidth - 2);
|
|
578
|
-
};
|
|
579
|
-
return u(), window.addEventListener("resize", u), () => {
|
|
580
|
-
window.removeEventListener("resize", u);
|
|
581
|
-
};
|
|
582
|
-
}, []), H.useEffect(() => {
|
|
583
|
-
e && e(new Set(b.selectedKeys));
|
|
584
|
-
}, [b.selectedKeys, e]), H.useEffect(() => {
|
|
585
|
-
o && b.setSelectedKeys(new Set(o));
|
|
586
|
-
}, [o]);
|
|
587
|
-
const g = b.selectedKeys === "all" ? new Set(
|
|
588
|
-
b.items.map((u) => u.id)
|
|
589
|
-
) : b.selectedKeys;
|
|
590
|
-
return /* @__PURE__ */ v(
|
|
591
|
-
"div",
|
|
592
|
-
{
|
|
593
|
-
className: A.multiSelect,
|
|
594
|
-
"data-disabled": r,
|
|
595
|
-
"data-invalid": i,
|
|
596
|
-
children: /* @__PURE__ */ C(
|
|
597
|
-
z,
|
|
598
|
-
{
|
|
599
|
-
values: [
|
|
600
|
-
[
|
|
601
|
-
// we should maybe add more here
|
|
602
|
-
// [LabelContext, {...labelProps, ref: labelRef}],
|
|
603
|
-
// [InputContext, {...inputProps, ref: inputOrTextAreaRef}],
|
|
604
|
-
// [TextAreaContext, {...inputProps, ref: inputOrTextAreaRef}],
|
|
605
|
-
// [TextContext, {
|
|
606
|
-
// slots: {
|
|
607
|
-
// description: descriptionProps,
|
|
608
|
-
// errorMessage: errorMessageProps
|
|
609
|
-
// }
|
|
610
|
-
// }],
|
|
611
|
-
pe,
|
|
612
|
-
{
|
|
613
|
-
isInvalid: i || !1,
|
|
614
|
-
validationErrors: [],
|
|
615
|
-
validationDetails: {
|
|
616
|
-
customError: i || !1,
|
|
617
|
-
badInput: !1,
|
|
618
|
-
patternMismatch: !1,
|
|
619
|
-
rangeOverflow: !1,
|
|
620
|
-
rangeUnderflow: !1,
|
|
621
|
-
stepMismatch: !1,
|
|
622
|
-
tooLong: !1,
|
|
623
|
-
tooShort: !1,
|
|
624
|
-
typeMismatch: !1,
|
|
625
|
-
valid: !1,
|
|
626
|
-
valueMissing: !1
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
]
|
|
630
|
-
],
|
|
631
|
-
children: [
|
|
632
|
-
/* @__PURE__ */ v(
|
|
633
|
-
Ce,
|
|
634
|
-
{
|
|
635
|
-
label: n,
|
|
636
|
-
description: a,
|
|
637
|
-
errorMessage: s,
|
|
638
|
-
children: /* @__PURE__ */ C(fe, { children: [
|
|
639
|
-
/* @__PURE__ */ C(
|
|
640
|
-
de,
|
|
641
|
-
{
|
|
642
|
-
className: A.button,
|
|
643
|
-
ref: f,
|
|
644
|
-
isDisabled: r,
|
|
645
|
-
children: [
|
|
646
|
-
"Välj",
|
|
647
|
-
/* @__PURE__ */ v(
|
|
648
|
-
"div",
|
|
649
|
-
{
|
|
650
|
-
className: A.icon,
|
|
651
|
-
"aria-hidden": "true",
|
|
652
|
-
children: /* @__PURE__ */ v(Le, { size: 20 })
|
|
653
|
-
}
|
|
654
|
-
)
|
|
655
|
-
]
|
|
656
|
-
}
|
|
657
|
-
),
|
|
658
|
-
/* @__PURE__ */ v(
|
|
659
|
-
ue,
|
|
660
|
-
{
|
|
661
|
-
className: A.popover,
|
|
662
|
-
style: { width: d },
|
|
663
|
-
offset: 0,
|
|
664
|
-
UNSTABLE_portalContainer: f.current || void 0,
|
|
665
|
-
children: /* @__PURE__ */ v(
|
|
666
|
-
ze,
|
|
667
|
-
{
|
|
668
|
-
"aria-label": n,
|
|
669
|
-
selectionMode: "multiple",
|
|
670
|
-
selectedKeys: b.selectedKeys,
|
|
671
|
-
onSelectionChange: b.setSelectedKeys,
|
|
672
|
-
children: b.items.map((u) => /* @__PURE__ */ C(
|
|
673
|
-
We,
|
|
674
|
-
{
|
|
675
|
-
id: u.id,
|
|
676
|
-
textValue: u.name,
|
|
677
|
-
className: A.listBoxItem,
|
|
678
|
-
children: [
|
|
679
|
-
/* @__PURE__ */ v(Me, { slot: "selection" }),
|
|
680
|
-
u.name
|
|
681
|
-
]
|
|
682
|
-
},
|
|
683
|
-
u.id
|
|
684
|
-
))
|
|
685
|
-
}
|
|
686
|
-
)
|
|
687
|
-
}
|
|
688
|
-
)
|
|
689
|
-
] })
|
|
690
|
-
}
|
|
691
|
-
),
|
|
692
|
-
/* @__PURE__ */ v(
|
|
693
|
-
He,
|
|
694
|
-
{
|
|
695
|
-
"aria-label": "Valda",
|
|
696
|
-
onRemove: (u) => {
|
|
697
|
-
b.setSelectedKeys(new Set(Array.from(b.selectedKeys).filter((p) => !u.has(p))));
|
|
698
|
-
},
|
|
699
|
-
children: Array.from(g).map((u) => {
|
|
700
|
-
const p = b.getItem(u);
|
|
701
|
-
return /* @__PURE__ */ v(
|
|
702
|
-
Be,
|
|
703
|
-
{
|
|
704
|
-
id: p == null ? void 0 : p.id,
|
|
705
|
-
textValue: p == null ? void 0 : p.name,
|
|
706
|
-
isDisabled: r,
|
|
707
|
-
dismissable: !0,
|
|
708
|
-
children: p == null ? void 0 : p.name
|
|
709
|
-
},
|
|
710
|
-
p == null ? void 0 : p.id
|
|
711
|
-
);
|
|
712
|
-
})
|
|
713
|
-
}
|
|
714
|
-
)
|
|
715
|
-
]
|
|
716
|
-
}
|
|
717
|
-
)
|
|
718
|
-
}
|
|
719
|
-
);
|
|
720
|
-
};
|
|
721
|
-
export {
|
|
722
|
-
Kt as MultiSelect
|
|
723
|
-
};
|