@wrdagency/blockout 1.0.13 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/style10.css +1 -1
- package/dist/assets/style2.css +1 -1
- package/dist/assets/style21.css +1 -1
- package/dist/assets/style3.css +1 -1
- package/dist/assets/style4.css +1 -1
- package/dist/assets/style5.css +1 -1
- package/dist/assets/style6.css +1 -1
- package/dist/assets/style7.css +1 -1
- package/dist/assets/style8.css +1 -1
- package/dist/assets/style9.css +1 -1
- package/dist/combobox-popover-DcwyOnhG.js +650 -0
- package/dist/components/avatar/index.d.ts +4 -2
- package/dist/components/avatar/index.js +24 -19
- package/dist/components/breadcrumbs/index.js +2 -2
- package/dist/components/button/button.js +2 -2
- package/dist/components/button/icon.js +1 -1
- package/dist/components/controls/base-popover-control/index.js +1 -1
- package/dist/components/controls/checkbox-control/index.js +1 -1
- package/dist/components/controls/choice-control/choice.js +1 -1
- package/dist/components/controls/choice-control/index.js +1 -1
- package/dist/components/controls/date-control/index.js +1 -1
- package/dist/components/controls/list-control/item.js +1 -1
- package/dist/components/controls/recurrence-control/index.js +1 -1
- package/dist/components/controls/select-control/props.d.ts +4 -3
- package/dist/components/controls/select-control/select.d.ts +1 -1
- package/dist/components/controls/select-control/select.js +55 -51
- package/dist/components/controls/tag-control/ariakit-experimental.js +17 -17
- package/dist/components/controls/tag-control/index.js +9 -9
- package/dist/components/controls/tag-control/props.js +1 -1
- package/dist/components/controls/toggle-control/index.js +1 -1
- package/dist/components/controls/toggle-group-control/index.js +1 -1
- package/dist/components/data-form/status.js +1 -1
- package/dist/components/data-form/submit.js +1 -1
- package/dist/components/data-view/data/filter.js +2 -2
- package/dist/components/data-view/index.js +1 -1
- package/dist/components/data-view/layouts/grid/group.js +2 -2
- package/dist/components/data-view/layouts/grid/item.js +2 -2
- package/dist/components/data-view/layouts/kanban/group.js +2 -2
- package/dist/components/data-view/layouts/kanban/item.js +2 -2
- package/dist/components/data-view/layouts/kanban/root.js +1 -1
- package/dist/components/data-view/layouts/list/group.js +2 -2
- package/dist/components/data-view/layouts/list/item.js +2 -2
- package/dist/components/data-view/layouts/table/empty.js +2 -2
- package/dist/components/data-view/layouts/table/group.js +3 -3
- package/dist/components/data-view/layouts/table/item.js +3 -3
- package/dist/components/data-view/layouts/table/root.js +2 -2
- package/dist/components/data-view/parts/body/empty.js +1 -1
- package/dist/components/data-view/parts/body/index.js +4 -4
- package/dist/components/data-view/parts/controls/index.js +2 -2
- package/dist/components/data-view/parts/controls/search.js +2 -2
- package/dist/components/data-view/parts/filters/chip.js +1 -1
- package/dist/components/data-view/parts/filters/editor.js +1 -1
- package/dist/components/data-view/parts/footer/actions.js +2 -2
- package/dist/components/data-view/parts/footer/index.js +2 -2
- package/dist/components/data-view/parts/footer/selection.js +2 -2
- package/dist/components/data-view/parts/view-control/index.js +2 -2
- package/dist/components/data-view/root.js +2 -2
- package/dist/components/data-view/slots/group/checkbox.js +3 -3
- package/dist/components/data-view/slots/group/context.js +1 -1
- package/dist/components/data-view/slots/group/icon.js +1 -1
- package/dist/components/data-view/slots/group/index.js +1 -1
- package/dist/components/data-view/slots/group/label.js +1 -1
- package/dist/components/data-view/slots/index.js +3 -3
- package/dist/components/data-view/slots/item/actions.js +1 -1
- package/dist/components/data-view/slots/item/checkbox.js +2 -2
- package/dist/components/data-view/slots/item/depth.js +3 -3
- package/dist/components/data-view/slots/item/description.js +1 -1
- package/dist/components/data-view/slots/item/index.js +1 -1
- package/dist/components/data-view/slots/item/properties.js +2 -2
- package/dist/components/data-view/slots/item/relations.js +4 -4
- package/dist/components/data-view/slots/item/tags.js +1 -1
- package/dist/components/data-view/slots/item/thumbnail.js +1 -1
- package/dist/components/data-view/slots/item/title.js +3 -3
- package/dist/components/data-view/slots/item/util.js +2 -2
- package/dist/components/data-view/slots/property/field/editable.js +2 -2
- package/dist/components/data-view/slots/property/field/index.js +1 -1
- package/dist/components/data-view/slots/property/field/static.js +1 -1
- package/dist/components/data-view/slots/property/index.js +1 -1
- package/dist/components/data-view/slots/property/label.js +1 -1
- package/dist/components/data-view/slots/root/checkbox.js +2 -2
- package/dist/components/data-view/slots/root/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/progress/index.js +1 -1
- package/dist/components/shell/pane.js +20 -15
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/window/index.js +2 -2
- package/dist/{filter-DAMRLXNe.js → filter-BqYmWg3n.js} +1 -1
- package/dist/{index-CoFfLb68.js → index-BdzBM_aG.js} +1 -1
- package/dist/{index-CPOlz97j.js → index-BrUAPkzm.js} +3 -3
- package/dist/{index-ClExU5xD.js → index-CWkR83hZ.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/primitives/colourway/index.js +1 -1
- package/dist/primitives/icon-label/index.d.ts +3 -1
- package/dist/primitives/icon-label/index.js +18 -13
- package/dist/primitives/link/index.js +1 -1
- package/dist/primitives/nav-link/index.js +1 -1
- package/dist/primitives/resizable/index.js +1 -1
- package/dist/primitives/tooltip/index.js +1 -1
- package/dist/primitives/truncate/index.js +1 -1
- package/dist/primitives/typography/heading.js +1 -1
- package/dist/primitives/typography/paragraph.js +1 -1
- package/dist/tag-remove-CVXLunYF.js +447 -0
- package/package.json +1 -1
- package/dist/MAXQOH4L-DBaf8WKp.js +0 -564
- package/dist/tag-remove-BVa8oSsq.js +0 -533
|
@@ -1,533 +0,0 @@
|
|
|
1
|
-
import { d as ve, a as ee } from "./S43UC3DV-CiBKpqp8.js";
|
|
2
|
-
import { createContext as he, useContext as W, useRef as ge, useState as te, useEffect as oe, useCallback as be } from "react";
|
|
3
|
-
import { f as _, c as K, a as R, _ as L, m as T, o as P, r as Ce, i as $, a4 as ye, C as Pe, a7 as xe, s as Te, q as ne, j, e as O, ag as re, l as ae, ah as ke, y as z, aa as Ve, n as Ee, G as Se, T as J, V as H, U as A, a5 as Ie } from "./LMDWO4NN-CIZvvtic.js";
|
|
4
|
-
import { jsx as E, jsxs as se, Fragment as De } from "react/jsx-runtime";
|
|
5
|
-
import { c as we, u as Oe, R as _e } from "./G7GW6PWC-A0eDeXMt.js";
|
|
6
|
-
import { u as Ke, d as q, T as ie, e as ue, f as Re, g as Le, h as Ne } from "./MAXQOH4L-DBaf8WKp.js";
|
|
7
|
-
import { a as le, c as Be, s as je, e as Fe, b as Me, d as Q } from "./YV4JVR4I-w1-dnslS.js";
|
|
8
|
-
import { u as ce } from "./6VRAQV3D-DK_p41oq.js";
|
|
9
|
-
import { t as $e } from "./7PRQYBBV-91wrWGjk.js";
|
|
10
|
-
import { u as Ue } from "./5JTVDSTH-DcfjjEya.js";
|
|
11
|
-
import { b as He } from "./PFRGBC2K-B9ko--FF.js";
|
|
12
|
-
import { c as We, b as Ae } from "./4CMBR7SL-ChJnawVl.js";
|
|
13
|
-
var qe = he(!1), Ge = "span", Ze = /* @__PURE__ */ E(
|
|
14
|
-
"svg",
|
|
15
|
-
{
|
|
16
|
-
display: "block",
|
|
17
|
-
fill: "none",
|
|
18
|
-
stroke: "currentColor",
|
|
19
|
-
strokeLinecap: "round",
|
|
20
|
-
strokeLinejoin: "round",
|
|
21
|
-
strokeWidth: 1.5,
|
|
22
|
-
viewBox: "0 0 16 16",
|
|
23
|
-
height: "1em",
|
|
24
|
-
width: "1em",
|
|
25
|
-
children: /* @__PURE__ */ E("polyline", { points: "4,8 7,12 12,4" })
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
function ze(n) {
|
|
29
|
-
return n.checked ? n.children || Ze : typeof n.children == "function" ? n.children : null;
|
|
30
|
-
}
|
|
31
|
-
var de = K(
|
|
32
|
-
function(r) {
|
|
33
|
-
var o = r, { store: e, checked: a } = o, s = L(o, ["store", "checked"]);
|
|
34
|
-
const d = W(qe);
|
|
35
|
-
a = a ?? d;
|
|
36
|
-
const i = ze({ checked: a, children: s.children });
|
|
37
|
-
return s = T(P({
|
|
38
|
-
"aria-hidden": !0
|
|
39
|
-
}, s), {
|
|
40
|
-
children: i,
|
|
41
|
-
style: P({
|
|
42
|
-
width: "1em",
|
|
43
|
-
height: "1em",
|
|
44
|
-
pointerEvents: "none"
|
|
45
|
-
}, s.style)
|
|
46
|
-
}), Ce(s);
|
|
47
|
-
}
|
|
48
|
-
), St = _(function(r) {
|
|
49
|
-
const o = de(r);
|
|
50
|
-
return R(Ge, o);
|
|
51
|
-
}), Je = "span", Qe = K(function(r) {
|
|
52
|
-
var o = r, { store: e, checked: a } = o, s = L(o, ["store", "checked"]);
|
|
53
|
-
const d = W(ve);
|
|
54
|
-
return a = a ?? d, s = de(T(P({}, s), { checked: a })), s;
|
|
55
|
-
}), It = _(function(r) {
|
|
56
|
-
const o = Qe(r);
|
|
57
|
-
return R(Je, o);
|
|
58
|
-
}), Xe = "div";
|
|
59
|
-
function Ye(n, ...r) {
|
|
60
|
-
if (!n) return !1;
|
|
61
|
-
if ("id" in n) {
|
|
62
|
-
const o = r.filter(Boolean).map((e) => `[aria-controls~="${e}"]`).join(", ");
|
|
63
|
-
return o ? n.matches(o) : !1;
|
|
64
|
-
}
|
|
65
|
-
return !1;
|
|
66
|
-
}
|
|
67
|
-
var et = K(
|
|
68
|
-
function(r) {
|
|
69
|
-
var o = r, {
|
|
70
|
-
store: e,
|
|
71
|
-
modal: a,
|
|
72
|
-
tabIndex: s,
|
|
73
|
-
alwaysVisible: d,
|
|
74
|
-
autoFocusOnHide: i = !0,
|
|
75
|
-
hideOnInteractOutside: m = !0
|
|
76
|
-
} = o, u = L(o, [
|
|
77
|
-
"store",
|
|
78
|
-
"modal",
|
|
79
|
-
"tabIndex",
|
|
80
|
-
"alwaysVisible",
|
|
81
|
-
"autoFocusOnHide",
|
|
82
|
-
"hideOnInteractOutside"
|
|
83
|
-
]);
|
|
84
|
-
const l = ee();
|
|
85
|
-
e = e || l, $(
|
|
86
|
-
e,
|
|
87
|
-
process.env.NODE_ENV !== "production" && "ComboboxPopover must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
88
|
-
);
|
|
89
|
-
const b = e.useState("baseElement"), g = ge(!1), C = le(
|
|
90
|
-
e.tag,
|
|
91
|
-
(p) => p == null ? void 0 : p.renderedItems.length
|
|
92
|
-
);
|
|
93
|
-
return u = Ke(P({ store: e, alwaysVisible: d }, u)), u = Oe(T(P({
|
|
94
|
-
store: e,
|
|
95
|
-
modal: a,
|
|
96
|
-
alwaysVisible: d,
|
|
97
|
-
backdrop: !1,
|
|
98
|
-
autoFocusOnShow: !1,
|
|
99
|
-
finalFocus: b,
|
|
100
|
-
preserveTabOrderAnchor: null,
|
|
101
|
-
unstable_treeSnapshotKey: C
|
|
102
|
-
}, u), {
|
|
103
|
-
// When the combobox popover is modal, we make sure to include the
|
|
104
|
-
// combobox input and all the combobox controls (cancel, disclosure) in
|
|
105
|
-
// the list of persistent elements so they make part of the modal context,
|
|
106
|
-
// allowing users to tab through them.
|
|
107
|
-
getPersistentElements() {
|
|
108
|
-
var p;
|
|
109
|
-
const h = ((p = u.getPersistentElements) == null ? void 0 : p.call(u)) || [];
|
|
110
|
-
if (!a || !e) return h;
|
|
111
|
-
const { contentElement: y, baseElement: t } = e.getState();
|
|
112
|
-
if (!t) return h;
|
|
113
|
-
const c = Pe(t), v = [];
|
|
114
|
-
if (y != null && y.id && v.push(`[aria-controls~="${y.id}"]`), t != null && t.id && v.push(`[aria-controls~="${t.id}"]`), !v.length) return [...h, t];
|
|
115
|
-
const x = v.join(","), I = c.querySelectorAll(x);
|
|
116
|
-
return [...h, ...I];
|
|
117
|
-
},
|
|
118
|
-
// The combobox popover should focus on the combobox input when it hides,
|
|
119
|
-
// unless the event was triggered by a click outside the popover, in which
|
|
120
|
-
// case the input shouldn't be re-focused.
|
|
121
|
-
autoFocusOnHide(p) {
|
|
122
|
-
return ye(i, p) ? !1 : g.current ? (g.current = !1, !1) : !0;
|
|
123
|
-
},
|
|
124
|
-
// Make sure we don't hide the popover when the user interacts with the
|
|
125
|
-
// combobox cancel or the combobox disclosure buttons. They will have the
|
|
126
|
-
// aria-controls attribute pointing to either the combobox input or the
|
|
127
|
-
// combobox popover elements.
|
|
128
|
-
hideOnInteractOutside(p) {
|
|
129
|
-
var h, y;
|
|
130
|
-
const t = e == null ? void 0 : e.getState(), c = (h = t == null ? void 0 : t.contentElement) == null ? void 0 : h.id, v = (y = t == null ? void 0 : t.baseElement) == null ? void 0 : y.id;
|
|
131
|
-
if (Ye(p.target, c, v)) return !1;
|
|
132
|
-
const x = typeof m == "function" ? m(p) : m;
|
|
133
|
-
return x && (g.current = p.type === "click"), x;
|
|
134
|
-
}
|
|
135
|
-
})), u;
|
|
136
|
-
}
|
|
137
|
-
), Dt = we(
|
|
138
|
-
_(function(r) {
|
|
139
|
-
const o = et(r);
|
|
140
|
-
return R(Xe, o);
|
|
141
|
-
}),
|
|
142
|
-
ee
|
|
143
|
-
);
|
|
144
|
-
function G() {
|
|
145
|
-
const [n, r] = te(!1);
|
|
146
|
-
return oe(() => {
|
|
147
|
-
r(xe());
|
|
148
|
-
}, []), n;
|
|
149
|
-
}
|
|
150
|
-
var tt = "div", ot = K(function(r) {
|
|
151
|
-
var o = r, {
|
|
152
|
-
store: e,
|
|
153
|
-
value: a,
|
|
154
|
-
getItem: s,
|
|
155
|
-
removeOnKeyPress: d = !0
|
|
156
|
-
} = o, i = L(o, [
|
|
157
|
-
"store",
|
|
158
|
-
"value",
|
|
159
|
-
"getItem",
|
|
160
|
-
"removeOnKeyPress"
|
|
161
|
-
]);
|
|
162
|
-
const m = q();
|
|
163
|
-
e = e || m, $(
|
|
164
|
-
e,
|
|
165
|
-
process.env.NODE_ENV !== "production" && "Tag must be wrapped in a TagList component."
|
|
166
|
-
);
|
|
167
|
-
const u = ne(i.id), l = G(), b = be(
|
|
168
|
-
(t) => {
|
|
169
|
-
const c = T(P({}, t), { value: a });
|
|
170
|
-
return s ? s(c) : c;
|
|
171
|
-
},
|
|
172
|
-
[a, s]
|
|
173
|
-
), g = i.onKeyDown, C = j(d), p = O((t) => {
|
|
174
|
-
if (g == null || g(t), t.defaultPrevented) return;
|
|
175
|
-
const { inputElement: c } = e.getState(), v = t.key === "Backspace";
|
|
176
|
-
if ((v || t.key === "Delete") && C(t)) {
|
|
177
|
-
t.preventDefault(), e.removeValue(a);
|
|
178
|
-
const V = v && e.previous() || e.next();
|
|
179
|
-
e.move(V);
|
|
180
|
-
}
|
|
181
|
-
const I = !t.ctrlKey && !t.metaKey && t.key.length === 1, N = !re(), f = t.key === "v" || t.key === "V", D = (N ? t.ctrlKey : t.metaKey) && f;
|
|
182
|
-
(I || D) && (c == null || c.focus());
|
|
183
|
-
}), [h, y] = te();
|
|
184
|
-
return i = ae(
|
|
185
|
-
i,
|
|
186
|
-
(t) => /* @__PURE__ */ E(ie.Provider, { value: a, children: /* @__PURE__ */ E(ue.Provider, { value: y, children: t }) }),
|
|
187
|
-
[a]
|
|
188
|
-
), i = T(P({
|
|
189
|
-
id: u,
|
|
190
|
-
role: l ? "listitem" : "option",
|
|
191
|
-
children: a,
|
|
192
|
-
"aria-describedby": h
|
|
193
|
-
}, i), {
|
|
194
|
-
onKeyDown: p
|
|
195
|
-
}), i = ce(T(P({
|
|
196
|
-
store: e
|
|
197
|
-
}, i), {
|
|
198
|
-
getItem: b
|
|
199
|
-
})), i;
|
|
200
|
-
}), wt = Te(
|
|
201
|
-
_(function(r) {
|
|
202
|
-
const o = ot(r);
|
|
203
|
-
return R(tt, o);
|
|
204
|
-
})
|
|
205
|
-
);
|
|
206
|
-
function me(n) {
|
|
207
|
-
return async () => {
|
|
208
|
-
const r = await (n == null ? void 0 : n());
|
|
209
|
-
return me(async () => (await (r == null ? void 0 : r()), n));
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
var M = nt();
|
|
213
|
-
function nt({
|
|
214
|
-
limit: n = 100
|
|
215
|
-
} = {}) {
|
|
216
|
-
const r = [];
|
|
217
|
-
let o = [], e = null;
|
|
218
|
-
const a = () => r.length > 0, s = () => o.length > 0;
|
|
219
|
-
return {
|
|
220
|
-
canUndo: a,
|
|
221
|
-
canRedo: s,
|
|
222
|
-
undo: async () => {
|
|
223
|
-
var u;
|
|
224
|
-
a() && (e = null, o.push(await ((u = r.pop()) == null ? void 0 : u())));
|
|
225
|
-
},
|
|
226
|
-
redo: async () => {
|
|
227
|
-
var u;
|
|
228
|
-
s() && (e = null, r.push(await ((u = o.pop()) == null ? void 0 : u())));
|
|
229
|
-
},
|
|
230
|
-
execute: async (u, l) => {
|
|
231
|
-
if (!u) return;
|
|
232
|
-
for (; r.length > n; )
|
|
233
|
-
r.shift();
|
|
234
|
-
const b = l === e;
|
|
235
|
-
e = l ?? null;
|
|
236
|
-
const g = b ? Math.max(0, r.length - 1) : r.length, C = await u();
|
|
237
|
-
if (!C) return;
|
|
238
|
-
o = [];
|
|
239
|
-
const p = r[g];
|
|
240
|
-
r[g] = me(async () => {
|
|
241
|
-
await (C == null ? void 0 : C());
|
|
242
|
-
const h = await (p == null ? void 0 : p());
|
|
243
|
-
return async () => {
|
|
244
|
-
await (h == null ? void 0 : h()), await (u == null ? void 0 : u());
|
|
245
|
-
};
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
var rt = "input", at = [`
|
|
251
|
-
`, ";", ",", /\s/];
|
|
252
|
-
function X(n, r = at) {
|
|
253
|
-
const o = n === void 0 ? r : n;
|
|
254
|
-
return o ? $e(o) : [];
|
|
255
|
-
}
|
|
256
|
-
function Y(n, r) {
|
|
257
|
-
for (const o of r) {
|
|
258
|
-
let e = n.match(o);
|
|
259
|
-
for (; (e == null ? void 0 : e.index) === 0; )
|
|
260
|
-
n = n.slice(e[0].length), e = n.match(o);
|
|
261
|
-
if (e)
|
|
262
|
-
return n.split(o);
|
|
263
|
-
}
|
|
264
|
-
return [];
|
|
265
|
-
}
|
|
266
|
-
var st = K(
|
|
267
|
-
function(r) {
|
|
268
|
-
var o = r, {
|
|
269
|
-
store: e,
|
|
270
|
-
tabbable: a = !0,
|
|
271
|
-
delimiter: s,
|
|
272
|
-
addValueOnPaste: d = !0,
|
|
273
|
-
addValueOnChange: i = !0,
|
|
274
|
-
setValueOnChange: m = !0,
|
|
275
|
-
removeOnBackspace: u = !0
|
|
276
|
-
} = o, l = L(o, [
|
|
277
|
-
"store",
|
|
278
|
-
"tabbable",
|
|
279
|
-
"delimiter",
|
|
280
|
-
"addValueOnPaste",
|
|
281
|
-
"addValueOnChange",
|
|
282
|
-
"setValueOnChange",
|
|
283
|
-
"removeOnBackspace"
|
|
284
|
-
]);
|
|
285
|
-
const b = q();
|
|
286
|
-
e = e || b, $(
|
|
287
|
-
e,
|
|
288
|
-
process.env.NODE_ENV !== "production" && "TagInput must receive a `store` prop or be wrapped in a TagProvider component."
|
|
289
|
-
);
|
|
290
|
-
const g = le(e, "value"), C = l.onPaste, p = j(d), h = O((f) => {
|
|
291
|
-
if (C == null || C(f), f.defaultPrevented) return;
|
|
292
|
-
const k = f.clipboardData.getData("text"), D = X(s), V = Y(k.trim(), D).map((w) => w.trim()).filter((w) => w !== ""), S = Object.assign(f, { values: V });
|
|
293
|
-
if (p(S) && V.length) {
|
|
294
|
-
f.preventDefault();
|
|
295
|
-
for (const w of V)
|
|
296
|
-
e.addValue(w);
|
|
297
|
-
}
|
|
298
|
-
}), y = l.onChange, t = j(m), c = j(i), v = O((f) => {
|
|
299
|
-
if (y == null || y(f), f.defaultPrevented || !e) return;
|
|
300
|
-
const { value: k } = e.getState(), D = ke(f), V = f.currentTarget, { start: S, end: w } = z(V), { value: U } = V;
|
|
301
|
-
if (t(f) && M.execute(() => {
|
|
302
|
-
if (e.setValue(U), queueMicrotask(() => {
|
|
303
|
-
Ve(V, S, w);
|
|
304
|
-
}), U !== k)
|
|
305
|
-
return () => e.setValue(k);
|
|
306
|
-
}, D), S === w && S === U.length) {
|
|
307
|
-
const pe = X(s);
|
|
308
|
-
let B = Y(U, pe);
|
|
309
|
-
const Z = B.pop() || "";
|
|
310
|
-
B = B.map((F) => F.trim()).filter((F) => F !== "");
|
|
311
|
-
const fe = Object.assign(f, { values: B });
|
|
312
|
-
if (B.length && c(fe)) {
|
|
313
|
-
f.preventDefault();
|
|
314
|
-
for (const F of B)
|
|
315
|
-
e.addValue(F);
|
|
316
|
-
M.execute(() => {
|
|
317
|
-
if (e.setValue(Z), Z !== k)
|
|
318
|
-
return () => e.setValue(k);
|
|
319
|
-
}, D);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}), x = l.onKeyDown, I = j(u), N = O((f) => {
|
|
323
|
-
if (x == null || x(f), !f.defaultPrevented && f.key === "Backspace" && I(f)) {
|
|
324
|
-
const { start: k, end: D } = z(f.currentTarget);
|
|
325
|
-
if (!(k === D && k === 0)) return;
|
|
326
|
-
e.setValues((S) => S.length ? S.slice(0, -1) : S);
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
return l = T(P({
|
|
330
|
-
value: g
|
|
331
|
-
}, l), {
|
|
332
|
-
ref: Ee(e.setInputElement, l.ref),
|
|
333
|
-
onPaste: h,
|
|
334
|
-
onChange: v,
|
|
335
|
-
onKeyDown: N
|
|
336
|
-
}), l = ce(P({ store: e, tabbable: a }, l)), l;
|
|
337
|
-
}
|
|
338
|
-
), Ot = _(function(r) {
|
|
339
|
-
const o = st(r);
|
|
340
|
-
return R(rt, o);
|
|
341
|
-
}), it = "div", ut = K(
|
|
342
|
-
function(r) {
|
|
343
|
-
var o = r, { store: e } = o, a = L(o, ["store"]);
|
|
344
|
-
const s = Re();
|
|
345
|
-
e = e || s, $(
|
|
346
|
-
e,
|
|
347
|
-
process.env.NODE_ENV !== "production" && "TagList must receive a `store` prop or be wrapped in a TagProvider component."
|
|
348
|
-
);
|
|
349
|
-
const d = a.onMouseDown, i = O((t) => {
|
|
350
|
-
if (d == null || d(t), t.defaultPrevented) return;
|
|
351
|
-
const c = t.target, v = t.currentTarget, x = He(c);
|
|
352
|
-
if (!(x === v) && v.contains(x)) return;
|
|
353
|
-
const { inputElement: N } = e.getState();
|
|
354
|
-
Se(t.currentTarget, "mouseup", () => {
|
|
355
|
-
N == null || N.focus();
|
|
356
|
-
});
|
|
357
|
-
}), m = a.onKeyDown, u = O((t) => {
|
|
358
|
-
if (m == null || m(t), t.defaultPrevented) return;
|
|
359
|
-
const c = !re(), v = t.key === "z" || t.key === "Z", x = c ? t.ctrlKey : t.metaKey, I = t.shiftKey && v || c && t.key === "y";
|
|
360
|
-
x && I ? (t.preventDefault(), M.redo()) : x && v && (t.preventDefault(), M.undo());
|
|
361
|
-
});
|
|
362
|
-
a = ae(
|
|
363
|
-
a,
|
|
364
|
-
(t) => /* @__PURE__ */ E(Le, { value: e, children: t }),
|
|
365
|
-
[e]
|
|
366
|
-
), a = T(P({}, a), {
|
|
367
|
-
onMouseDown: i,
|
|
368
|
-
onKeyDown: u
|
|
369
|
-
}), a = Ue(P({ store: e }, a));
|
|
370
|
-
const l = e.useState(
|
|
371
|
-
(t) => t.orientation === "both" ? void 0 : t.orientation
|
|
372
|
-
), g = e.useState((t) => t.renderedItems).filter((t) => !!t.value).map((t) => t.id), C = e.useState((t) => {
|
|
373
|
-
var c;
|
|
374
|
-
return (c = t.labelElement) == null ? void 0 : c.id;
|
|
375
|
-
}), p = {};
|
|
376
|
-
for (const t in a)
|
|
377
|
-
if (t === "role" || t.startsWith("aria-")) {
|
|
378
|
-
const c = t;
|
|
379
|
-
p[c] = a[c], delete a[c];
|
|
380
|
-
}
|
|
381
|
-
const h = G(), y = /* @__PURE__ */ se(De, { children: [
|
|
382
|
-
/* @__PURE__ */ E(
|
|
383
|
-
"div",
|
|
384
|
-
T(P({
|
|
385
|
-
role: h ? "list" : "listbox",
|
|
386
|
-
"aria-live": "polite",
|
|
387
|
-
"aria-relevant": "all",
|
|
388
|
-
"aria-atomic": !0,
|
|
389
|
-
"aria-labelledby": C,
|
|
390
|
-
"aria-orientation": l,
|
|
391
|
-
"aria-owns": g.join(" ")
|
|
392
|
-
}, p), {
|
|
393
|
-
style: { position: "fixed" }
|
|
394
|
-
})
|
|
395
|
-
),
|
|
396
|
-
a.children
|
|
397
|
-
] });
|
|
398
|
-
return a = T(P({}, a), {
|
|
399
|
-
children: y
|
|
400
|
-
}), a;
|
|
401
|
-
}
|
|
402
|
-
), _t = _(function(r) {
|
|
403
|
-
const o = ut(r);
|
|
404
|
-
return R(it, o);
|
|
405
|
-
});
|
|
406
|
-
function lt(n = {}) {
|
|
407
|
-
var r;
|
|
408
|
-
const o = (r = n.store) == null ? void 0 : r.getState(), e = We(n), a = J(A({}, e.getState()), {
|
|
409
|
-
inputElement: H(o == null ? void 0 : o.inputElement, null),
|
|
410
|
-
labelElement: H(o == null ? void 0 : o.labelElement, null),
|
|
411
|
-
value: H(n.value, o == null ? void 0 : o.value, n.defaultValue, ""),
|
|
412
|
-
values: H(
|
|
413
|
-
n.values,
|
|
414
|
-
o == null ? void 0 : o.values,
|
|
415
|
-
n.defaultValues,
|
|
416
|
-
[]
|
|
417
|
-
)
|
|
418
|
-
}), s = Be(a, e, n.store);
|
|
419
|
-
je(
|
|
420
|
-
s,
|
|
421
|
-
() => Fe(s, ["inputElement", "activeId"], (i) => {
|
|
422
|
-
i.inputElement && i.activeId === void 0 && s.setState("activeId", i.inputElement.id);
|
|
423
|
-
})
|
|
424
|
-
);
|
|
425
|
-
const d = (i) => {
|
|
426
|
-
const { values: m } = s.getState();
|
|
427
|
-
M.execute(() => {
|
|
428
|
-
let u = !0;
|
|
429
|
-
if (s.setState("values", (l) => {
|
|
430
|
-
const b = Ie(i, l);
|
|
431
|
-
return b === l && (u = !1), b;
|
|
432
|
-
}), !!u)
|
|
433
|
-
return () => {
|
|
434
|
-
var l;
|
|
435
|
-
s.setState("values", m), e.move((l = s.getState().inputElement) == null ? void 0 : l.id);
|
|
436
|
-
};
|
|
437
|
-
});
|
|
438
|
-
};
|
|
439
|
-
return J(A(A({}, e), s), {
|
|
440
|
-
setInputElement: (i) => s.setState("inputElement", i),
|
|
441
|
-
setLabelElement: (i) => s.setState("labelElement", i),
|
|
442
|
-
setValue: (i) => s.setState("value", i),
|
|
443
|
-
resetValue: () => s.setState("value", a.value),
|
|
444
|
-
setValues: d,
|
|
445
|
-
addValue: (i) => {
|
|
446
|
-
d((m) => m.includes(i) ? m : [...m, i]);
|
|
447
|
-
},
|
|
448
|
-
removeValue: (i) => d((m) => m.filter((u) => u !== i))
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
function ct(n, r, o) {
|
|
452
|
-
return Q(n, o, "value", "setValue"), Q(n, o, "values", "setValues"), Ae(n, r, o);
|
|
453
|
-
}
|
|
454
|
-
function dt(n = {}) {
|
|
455
|
-
const [r, o] = Me(lt, n);
|
|
456
|
-
return ct(r, o, n);
|
|
457
|
-
}
|
|
458
|
-
function Kt(n = {}) {
|
|
459
|
-
const r = dt(n);
|
|
460
|
-
return /* @__PURE__ */ E(Ne, { value: r, children: n.children });
|
|
461
|
-
}
|
|
462
|
-
var mt = "button", pt = K(
|
|
463
|
-
function(r) {
|
|
464
|
-
var o = r, {
|
|
465
|
-
store: e,
|
|
466
|
-
value: a,
|
|
467
|
-
removeOnClick: s = !0
|
|
468
|
-
} = o, d = L(o, [
|
|
469
|
-
"store",
|
|
470
|
-
"value",
|
|
471
|
-
"removeOnClick"
|
|
472
|
-
]);
|
|
473
|
-
const i = q();
|
|
474
|
-
e = e || i, $(
|
|
475
|
-
e,
|
|
476
|
-
process.env.NODE_ENV !== "production" && "TagRemove must receive a `store` prop or be wrapped in a TagProvider component."
|
|
477
|
-
);
|
|
478
|
-
const m = ne(d.id), u = W(ue), l = W(ie), b = l !== null, g = a ?? l;
|
|
479
|
-
oe(() => (u == null || u(m), () => u == null ? void 0 : u()), [m, u]);
|
|
480
|
-
const C = d.onClick, p = j(s), h = O((c) => {
|
|
481
|
-
if (C == null || C(c), c.defaultPrevented || !e || !g || !p(c)) return;
|
|
482
|
-
const { inputElement: v } = e.getState();
|
|
483
|
-
e.removeValue(g), v == null || v.focus();
|
|
484
|
-
}), y = /* @__PURE__ */ se(
|
|
485
|
-
"svg",
|
|
486
|
-
{
|
|
487
|
-
display: "block",
|
|
488
|
-
viewBox: "0 0 24 24",
|
|
489
|
-
fill: "none",
|
|
490
|
-
stroke: "currentColor",
|
|
491
|
-
strokeWidth: 1.5,
|
|
492
|
-
strokeLinecap: "round",
|
|
493
|
-
strokeLinejoin: "round",
|
|
494
|
-
height: "1em",
|
|
495
|
-
width: "1em",
|
|
496
|
-
"aria-hidden": !0,
|
|
497
|
-
children: [
|
|
498
|
-
/* @__PURE__ */ E("path", { d: "M7.28782 5.46243C7.80963 4.92308 8.07054 4.65341 8.37751 4.46038C8.64963 4.28926 8.94749 4.16299 9.25969 4.0864C9.61186 4 9.98709 4 10.7375 4H16.8C17.9201 4 18.4802 4 18.908 4.21799C19.2843 4.40973 19.5903 4.71569 19.782 5.09202C20 5.51984 20 6.0799 20 7.2V16.8C20 17.9201 20 18.4802 19.782 18.908C19.5903 19.2843 19.2843 19.5903 18.908 19.782C18.4802 20 17.9201 20 16.8 20H10.7512C9.99584 20 9.61818 20 9.264 19.9126C8.95004 19.8351 8.65067 19.7073 8.37748 19.5342C8.06931 19.339 7.80802 19.0663 7.28544 18.521L2.59879 13.63C2.03714 13.0439 1.75631 12.7508 1.65115 12.4158C1.55859 12.121 1.55935 11.8048 1.65332 11.5104C1.7601 11.1759 2.04233 10.8842 2.60679 10.3008L7.28782 5.46243Z" }),
|
|
499
|
-
/* @__PURE__ */ E("path", { d: "M10.052 9L16 15M15.948 9L10 15" })
|
|
500
|
-
]
|
|
501
|
-
}
|
|
502
|
-
), t = G() && b;
|
|
503
|
-
return d = T(P({
|
|
504
|
-
id: m,
|
|
505
|
-
children: y,
|
|
506
|
-
role: t ? "button" : void 0,
|
|
507
|
-
"aria-hidden": !t,
|
|
508
|
-
"aria-label": t ? `Remove ${g}` : b ? "Press Delete or Backspace to remove" : void 0
|
|
509
|
-
}, d), {
|
|
510
|
-
onClick: h,
|
|
511
|
-
render: b ? /* @__PURE__ */ E(_e.span, { render: d.render }) : d.render
|
|
512
|
-
}), d;
|
|
513
|
-
}
|
|
514
|
-
), Rt = _(function(r) {
|
|
515
|
-
const o = pt(r);
|
|
516
|
-
return R(mt, o);
|
|
517
|
-
});
|
|
518
|
-
export {
|
|
519
|
-
Dt as C,
|
|
520
|
-
Kt as T,
|
|
521
|
-
_t as a,
|
|
522
|
-
wt as b,
|
|
523
|
-
Rt as c,
|
|
524
|
-
Ot as d,
|
|
525
|
-
It as e,
|
|
526
|
-
qe as f,
|
|
527
|
-
St as g,
|
|
528
|
-
ot as h,
|
|
529
|
-
st as i,
|
|
530
|
-
ut as j,
|
|
531
|
-
pt as k,
|
|
532
|
-
de as u
|
|
533
|
-
};
|