rei-kit 2.6.0 → 2.8.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/README.md +4 -4
- package/dist/BaseSkeleton-B-oo7JKE.js +43 -0
- package/dist/BaseSkeleton-B-oo7JKE.js.map +1 -0
- package/dist/{GoogleButton-nIRz9G8s.js → GoogleButton-DVro7xZH.js} +3 -33
- package/dist/GoogleButton-DVro7xZH.js.map +1 -0
- package/dist/app.js +2 -2
- package/dist/components/AvatarStack.vue.d.ts +24 -0
- package/dist/components/BaseChip.vue.d.ts +32 -0
- package/dist/components/BaseKbd.vue.d.ts +21 -0
- package/dist/components/BaseLink.vue.d.ts +33 -0
- package/dist/components/BaseListbox.vue.d.ts +38 -0
- package/dist/components/BaseRating.vue.d.ts +35 -0
- package/dist/components/BaseSeparator.vue.d.ts +20 -0
- package/dist/components/BaseSkeleton.vue.d.ts +25 -0
- package/dist/components/CopyButton.vue.d.ts +33 -0
- package/dist/components/FileDrop.vue.d.ts +45 -0
- package/dist/components/TagsInput.vue.d.ts +38 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +926 -167
- package/dist/index.js.map +1 -1
- package/dist/{inert-B441LoCD.js → inert-TJG_g0d6.js} +32 -2
- package/dist/inert-TJG_g0d6.js.map +1 -0
- package/dist/styles.css +697 -0
- package/dist/web/CommandMenu.vue.d.ts +50 -0
- package/dist/web/DataTable.vue.d.ts +61 -0
- package/dist/web/index.d.ts +13 -0
- package/dist/web.js +438 -51
- package/dist/web.js.map +1 -1
- package/package.json +2 -2
- package/dist/GoogleButton-nIRz9G8s.js.map +0 -1
- package/dist/inert-B441LoCD.js.map +0 -1
package/dist/web.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
import { r as ensureSheetRoot, t as inertOutside } from "./inert-TJG_g0d6.js";
|
|
1
2
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BOaGB7Aw.js";
|
|
2
|
-
import { t as
|
|
3
|
-
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, nextTick, normalizeClass, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useId, useModel, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
3
|
+
import { t as BaseSkeleton_default } from "./BaseSkeleton-B-oo7JKE.js";
|
|
4
|
+
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, nextTick, normalizeClass, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useId, useModel, useTemplateRef, vModelText, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
5
|
+
import { ArrowDown, ArrowUp, ChevronsUpDown, Search } from "lucide-vue-next";
|
|
4
6
|
import { RouterLink } from "vue-router";
|
|
5
7
|
//#region src/web/BaseAccordion.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var _hoisted_1$
|
|
7
|
-
var _hoisted_2$
|
|
8
|
+
var _hoisted_1$9 = { class: "rk-accordion" };
|
|
9
|
+
var _hoisted_2$9 = [
|
|
8
10
|
"aria-expanded",
|
|
9
11
|
"aria-controls",
|
|
10
12
|
"onClick"
|
|
11
13
|
];
|
|
12
|
-
var _hoisted_3$
|
|
13
|
-
var _hoisted_4$
|
|
14
|
+
var _hoisted_3$7 = { class: "rk-accordion-title" };
|
|
15
|
+
var _hoisted_4$6 = {
|
|
14
16
|
class: "rk-accordion-mark",
|
|
15
17
|
"aria-hidden": "true"
|
|
16
18
|
};
|
|
17
|
-
var _hoisted_5$
|
|
18
|
-
var _hoisted_6$
|
|
19
|
+
var _hoisted_5$5 = ["id"];
|
|
20
|
+
var _hoisted_6$4 = { class: "rk-accordion-clip" };
|
|
19
21
|
//#endregion
|
|
20
22
|
//#region src/web/BaseAccordion.vue
|
|
21
23
|
var BaseAccordion_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -37,7 +39,7 @@ var BaseAccordion_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
|
|
|
37
39
|
else open.value = __props.multiple ? [...open.value, key] : [key];
|
|
38
40
|
}
|
|
39
41
|
return (_ctx, _cache) => {
|
|
40
|
-
return openBlock(), createElementBlock("ul", _hoisted_1$
|
|
42
|
+
return openBlock(), createElementBlock("ul", _hoisted_1$9, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
|
|
41
43
|
return openBlock(), createElementBlock("li", {
|
|
42
44
|
key: item.key,
|
|
43
45
|
class: "rk-accordion-item"
|
|
@@ -48,32 +50,32 @@ var BaseAccordion_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
|
|
|
48
50
|
"aria-expanded": isOpen(item.key),
|
|
49
51
|
"aria-controls": `${unref(uid)}-${item.key}`,
|
|
50
52
|
onClick: ($event) => toggle(item.key)
|
|
51
|
-
}, [createElementVNode("span", _hoisted_3$
|
|
53
|
+
}, [createElementVNode("span", _hoisted_3$7, [renderSlot(_ctx.$slots, "title", {
|
|
52
54
|
item,
|
|
53
55
|
open: isOpen(item.key)
|
|
54
|
-
}, () => [createTextVNode(toDisplayString(item.title), 1)], true)]), createElementVNode("span", _hoisted_4$
|
|
56
|
+
}, () => [createTextVNode(toDisplayString(item.title), 1)], true)]), createElementVNode("span", _hoisted_4$6, [_cache[0] || (_cache[0] = createElementVNode("span", { class: "rk-accordion-bar" }, null, -1)), createElementVNode("span", { class: normalizeClass(["rk-accordion-bar rk-accordion-bar-turn", { "is-open": isOpen(item.key) }]) }, null, 2)])], 8, _hoisted_2$9)]),
|
|
55
57
|
_: 2
|
|
56
58
|
}, 1024)), createElementVNode("div", {
|
|
57
59
|
id: `${unref(uid)}-${item.key}`,
|
|
58
60
|
class: normalizeClass(["rk-accordion-panel", { "is-open": isOpen(item.key) }])
|
|
59
|
-
}, [createElementVNode("div", _hoisted_6$
|
|
61
|
+
}, [createElementVNode("div", _hoisted_6$4, [createElementVNode("div", { class: normalizeClass(["rk-accordion-body", { "is-open": isOpen(item.key) }]) }, [renderSlot(_ctx.$slots, "default", {
|
|
60
62
|
item,
|
|
61
63
|
open: isOpen(item.key)
|
|
62
|
-
}, void 0, true)], 2)])], 10, _hoisted_5$
|
|
64
|
+
}, void 0, true)], 2)])], 10, _hoisted_5$5)]);
|
|
63
65
|
}), 128))]);
|
|
64
66
|
};
|
|
65
67
|
}
|
|
66
68
|
}), [["__scopeId", "data-v-03e2e1d0"]]);
|
|
67
69
|
//#endregion
|
|
68
70
|
//#region src/web/BaseBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
69
|
-
var _hoisted_1$
|
|
70
|
-
var _hoisted_2$
|
|
71
|
-
var _hoisted_3$
|
|
71
|
+
var _hoisted_1$8 = ["aria-label"];
|
|
72
|
+
var _hoisted_2$8 = { class: "rk-crumbs" };
|
|
73
|
+
var _hoisted_3$6 = {
|
|
72
74
|
key: 1,
|
|
73
75
|
class: "rk-crumb-current",
|
|
74
76
|
"aria-current": "page"
|
|
75
77
|
};
|
|
76
|
-
var _hoisted_4$
|
|
78
|
+
var _hoisted_4$5 = {
|
|
77
79
|
key: 2,
|
|
78
80
|
class: "rk-crumb-sep",
|
|
79
81
|
"aria-hidden": "true"
|
|
@@ -88,7 +90,7 @@ var BaseBreadcrumb_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
88
90
|
},
|
|
89
91
|
setup(__props) {
|
|
90
92
|
return (_ctx, _cache) => {
|
|
91
|
-
return openBlock(), createElementBlock("nav", { "aria-label": __props.label || void 0 }, [createElementVNode("ol", _hoisted_2$
|
|
93
|
+
return openBlock(), createElementBlock("nav", { "aria-label": __props.label || void 0 }, [createElementVNode("ol", _hoisted_2$8, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
|
|
92
94
|
return openBlock(), createElementBlock("li", {
|
|
93
95
|
key: item.label,
|
|
94
96
|
class: "rk-crumb"
|
|
@@ -99,22 +101,22 @@ var BaseBreadcrumb_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
99
101
|
}, {
|
|
100
102
|
default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
|
|
101
103
|
_: 2
|
|
102
|
-
}, 1032, ["to"])) : (openBlock(), createElementBlock("span", _hoisted_3$
|
|
103
|
-
}), 128))])], 8, _hoisted_1$
|
|
104
|
+
}, 1032, ["to"])) : (openBlock(), createElementBlock("span", _hoisted_3$6, toDisplayString(item.label), 1)), index < __props.items.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$5, "/")) : createCommentVNode("", true)]);
|
|
105
|
+
}), 128))])], 8, _hoisted_1$8);
|
|
104
106
|
};
|
|
105
107
|
}
|
|
106
108
|
}), [["__scopeId", "data-v-dcc01b03"]]);
|
|
107
109
|
//#endregion
|
|
108
110
|
//#region src/web/BaseDisclosure.vue?vue&type=script&setup=true&lang.ts
|
|
109
|
-
var _hoisted_1$
|
|
110
|
-
var _hoisted_2$
|
|
111
|
-
var _hoisted_3$
|
|
112
|
-
var _hoisted_4$
|
|
111
|
+
var _hoisted_1$7 = { class: "rk-disclosure" };
|
|
112
|
+
var _hoisted_2$7 = ["aria-expanded", "aria-controls"];
|
|
113
|
+
var _hoisted_3$5 = { class: "rk-disclosure-title" };
|
|
114
|
+
var _hoisted_4$4 = {
|
|
113
115
|
class: "rk-disclosure-mark",
|
|
114
116
|
"aria-hidden": "true"
|
|
115
117
|
};
|
|
116
|
-
var _hoisted_5$
|
|
117
|
-
var _hoisted_6$
|
|
118
|
+
var _hoisted_5$4 = ["id"];
|
|
119
|
+
var _hoisted_6$3 = { class: "rk-disclosure-clip" };
|
|
118
120
|
//#endregion
|
|
119
121
|
//#region src/web/BaseDisclosure.vue
|
|
120
122
|
var BaseDisclosure_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -134,30 +136,30 @@ var BaseDisclosure_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
134
136
|
const open = useModel(__props, "modelValue");
|
|
135
137
|
const id = useId();
|
|
136
138
|
return (_ctx, _cache) => {
|
|
137
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
139
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [(openBlock(), createBlock(resolveDynamicComponent(`h${__props.headingLevel}`), null, {
|
|
138
140
|
default: withCtx(() => [createElementVNode("button", {
|
|
139
141
|
type: "button",
|
|
140
142
|
class: "rk-disclosure-control",
|
|
141
143
|
"aria-expanded": open.value,
|
|
142
144
|
"aria-controls": unref(id),
|
|
143
145
|
onClick: _cache[0] || (_cache[0] = ($event) => open.value = !open.value)
|
|
144
|
-
}, [createElementVNode("span", _hoisted_3$
|
|
146
|
+
}, [createElementVNode("span", _hoisted_3$5, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)], true)]), createElementVNode("span", _hoisted_4$4, [_cache[1] || (_cache[1] = createElementVNode("span", { class: "rk-disclosure-bar" }, null, -1)), createElementVNode("span", { class: normalizeClass(["rk-disclosure-bar rk-disclosure-turn", { "is-open": open.value }]) }, null, 2)])], 8, _hoisted_2$7)]),
|
|
145
147
|
_: 3
|
|
146
148
|
})), createElementVNode("div", {
|
|
147
149
|
id: unref(id),
|
|
148
150
|
class: normalizeClass(["rk-disclosure-panel", { "is-open": open.value }])
|
|
149
|
-
}, [createElementVNode("div", _hoisted_6$
|
|
151
|
+
}, [createElementVNode("div", _hoisted_6$3, [createElementVNode("div", { class: normalizeClass(["rk-disclosure-body", { "is-open": open.value }]) }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2)])], 10, _hoisted_5$4)]);
|
|
150
152
|
};
|
|
151
153
|
}
|
|
152
154
|
}), [["__scopeId", "data-v-ad5c09f5"]]);
|
|
153
155
|
//#endregion
|
|
154
156
|
//#region src/web/BaseModal.vue?vue&type=script&setup=true&lang.ts
|
|
155
|
-
var _hoisted_1$
|
|
156
|
-
var _hoisted_2$
|
|
157
|
-
var _hoisted_3$
|
|
158
|
-
var _hoisted_4$
|
|
159
|
-
var _hoisted_5$
|
|
160
|
-
var _hoisted_6 = {
|
|
157
|
+
var _hoisted_1$6 = ["role", "aria-label"];
|
|
158
|
+
var _hoisted_2$6 = { class: "rk-modal-head" };
|
|
159
|
+
var _hoisted_3$4 = { class: "rk-modal-title" };
|
|
160
|
+
var _hoisted_4$3 = ["aria-label"];
|
|
161
|
+
var _hoisted_5$3 = { class: "rk-modal-body" };
|
|
162
|
+
var _hoisted_6$2 = {
|
|
161
163
|
key: 0,
|
|
162
164
|
class: "rk-modal-actions"
|
|
163
165
|
};
|
|
@@ -276,7 +278,7 @@ var BaseModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
276
278
|
"aria-label": __props.title,
|
|
277
279
|
tabindex: "-1"
|
|
278
280
|
}, [
|
|
279
|
-
createElementVNode("div", _hoisted_2$
|
|
281
|
+
createElementVNode("div", _hoisted_2$6, [createElementVNode("h2", _hoisted_3$4, toDisplayString(__props.title), 1), __props.dismissible ? (openBlock(), createElementBlock("button", {
|
|
280
282
|
key: 0,
|
|
281
283
|
type: "button",
|
|
282
284
|
class: "rk-modal-close",
|
|
@@ -290,10 +292,10 @@ var BaseModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
290
292
|
}, [createElementVNode("path", {
|
|
291
293
|
d: "M18 6 6 18M6 6l12 12",
|
|
292
294
|
"stroke-linecap": "round"
|
|
293
|
-
})], -1)])], 8, _hoisted_4$
|
|
294
|
-
createElementVNode("div", _hoisted_5$
|
|
295
|
-
_ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "actions", {}, void 0, true)])) : createCommentVNode("", true)
|
|
296
|
-
], 8, _hoisted_1$
|
|
295
|
+
})], -1)])], 8, _hoisted_4$3)) : createCommentVNode("", true)]),
|
|
296
|
+
createElementVNode("div", _hoisted_5$3, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
|
|
297
|
+
_ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_6$2, [renderSlot(_ctx.$slots, "actions", {}, void 0, true)])) : createCommentVNode("", true)
|
|
298
|
+
], 8, _hoisted_1$6)], 32)) : createCommentVNode("", true)]),
|
|
297
299
|
_: 3
|
|
298
300
|
})]);
|
|
299
301
|
};
|
|
@@ -301,15 +303,15 @@ var BaseModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
301
303
|
}), [["__scopeId", "data-v-61956691"]]);
|
|
302
304
|
//#endregion
|
|
303
305
|
//#region src/web/BasePagination.vue?vue&type=script&setup=true&lang.ts
|
|
304
|
-
var _hoisted_1$
|
|
305
|
-
var _hoisted_2$
|
|
306
|
-
var _hoisted_3$
|
|
306
|
+
var _hoisted_1$5 = ["aria-label"];
|
|
307
|
+
var _hoisted_2$5 = ["disabled", "aria-label"];
|
|
308
|
+
var _hoisted_3$3 = {
|
|
307
309
|
key: 0,
|
|
308
310
|
class: "rk-pager-gap",
|
|
309
311
|
"aria-hidden": "true"
|
|
310
312
|
};
|
|
311
|
-
var _hoisted_4 = ["aria-current", "onClick"];
|
|
312
|
-
var _hoisted_5 = ["disabled", "aria-label"];
|
|
313
|
+
var _hoisted_4$2 = ["aria-current", "onClick"];
|
|
314
|
+
var _hoisted_5$2 = ["disabled", "aria-label"];
|
|
313
315
|
/**
|
|
314
316
|
* Moving between pages of a list.
|
|
315
317
|
*
|
|
@@ -372,15 +374,15 @@ var BasePagination_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
372
374
|
disabled: __props.page <= 1,
|
|
373
375
|
"aria-label": __props.previousLabel,
|
|
374
376
|
onClick: _cache[0] || (_cache[0] = ($event) => go(__props.page - 1))
|
|
375
|
-
}, " ‹ ", 8, _hoisted_2$
|
|
377
|
+
}, " ‹ ", 8, _hoisted_2$5),
|
|
376
378
|
(openBlock(true), createElementBlock(Fragment, null, renderList(slots.value, (slot, index) => {
|
|
377
|
-
return openBlock(), createElementBlock(Fragment, { key: `${slot}-${index}` }, [slot === "gap" ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
379
|
+
return openBlock(), createElementBlock(Fragment, { key: `${slot}-${index}` }, [slot === "gap" ? (openBlock(), createElementBlock("span", _hoisted_3$3, "…")) : (openBlock(), createElementBlock("button", {
|
|
378
380
|
key: 1,
|
|
379
381
|
type: "button",
|
|
380
382
|
class: normalizeClass(["rk-pager-page", { "is-active": slot === __props.page }]),
|
|
381
383
|
"aria-current": slot === __props.page ? "page" : void 0,
|
|
382
384
|
onClick: ($event) => go(slot)
|
|
383
|
-
}, toDisplayString(slot), 11, _hoisted_4))], 64);
|
|
385
|
+
}, toDisplayString(slot), 11, _hoisted_4$2))], 64);
|
|
384
386
|
}), 128)),
|
|
385
387
|
createElementVNode("button", {
|
|
386
388
|
type: "button",
|
|
@@ -388,12 +390,397 @@ var BasePagination_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
388
390
|
disabled: __props.page >= __props.pages,
|
|
389
391
|
"aria-label": __props.nextLabel,
|
|
390
392
|
onClick: _cache[1] || (_cache[1] = ($event) => go(__props.page + 1))
|
|
391
|
-
}, " › ", 8, _hoisted_5)
|
|
392
|
-
], 8, _hoisted_1$
|
|
393
|
+
}, " › ", 8, _hoisted_5$2)
|
|
394
|
+
], 8, _hoisted_1$5);
|
|
393
395
|
};
|
|
394
396
|
}
|
|
395
397
|
}), [["__scopeId", "data-v-29950578"]]);
|
|
396
398
|
//#endregion
|
|
399
|
+
//#region src/web/CommandMenu.vue?vue&type=script&setup=true&lang.ts
|
|
400
|
+
var _hoisted_1$4 = ["aria-label"];
|
|
401
|
+
var _hoisted_2$4 = { class: "rk-command-field" };
|
|
402
|
+
var _hoisted_3$2 = [
|
|
403
|
+
"placeholder",
|
|
404
|
+
"aria-label",
|
|
405
|
+
"aria-controls",
|
|
406
|
+
"aria-activedescendant"
|
|
407
|
+
];
|
|
408
|
+
var _hoisted_4$1 = ["id", "aria-label"];
|
|
409
|
+
var _hoisted_5$1 = {
|
|
410
|
+
key: 0,
|
|
411
|
+
class: "rk-command-group"
|
|
412
|
+
};
|
|
413
|
+
var _hoisted_6$1 = [
|
|
414
|
+
"id",
|
|
415
|
+
"aria-selected",
|
|
416
|
+
"onClick",
|
|
417
|
+
"onPointermove"
|
|
418
|
+
];
|
|
419
|
+
var _hoisted_7$1 = { class: "truncate" };
|
|
420
|
+
var _hoisted_8$1 = {
|
|
421
|
+
key: 1,
|
|
422
|
+
class: "rk-command-hint"
|
|
423
|
+
};
|
|
424
|
+
var _hoisted_9$1 = {
|
|
425
|
+
key: 0,
|
|
426
|
+
class: "rk-command-empty"
|
|
427
|
+
};
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/web/CommandMenu.vue
|
|
430
|
+
var CommandMenu_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
431
|
+
__name: "CommandMenu",
|
|
432
|
+
props: /*@__PURE__*/ mergeModels({
|
|
433
|
+
groups: {},
|
|
434
|
+
label: {},
|
|
435
|
+
placeholder: {},
|
|
436
|
+
emptyLabel: {},
|
|
437
|
+
hotkey: { default: () => void 0 }
|
|
438
|
+
}, {
|
|
439
|
+
"modelValue": {
|
|
440
|
+
type: Boolean,
|
|
441
|
+
default: false
|
|
442
|
+
},
|
|
443
|
+
"modelModifiers": {}
|
|
444
|
+
}),
|
|
445
|
+
emits: /*@__PURE__*/ mergeModels(["select"], ["update:modelValue"]),
|
|
446
|
+
setup(__props, { emit: __emit }) {
|
|
447
|
+
const emit = __emit;
|
|
448
|
+
/** Open or closed, with `v-model`. */
|
|
449
|
+
const open = useModel(__props, "modelValue");
|
|
450
|
+
const query = ref("");
|
|
451
|
+
const active = ref(0);
|
|
452
|
+
const id = useId();
|
|
453
|
+
const field = useTemplateRef("field");
|
|
454
|
+
const sheetRoot = ensureSheetRoot();
|
|
455
|
+
let release = null;
|
|
456
|
+
const matches = computed(() => {
|
|
457
|
+
const needle = query.value.trim().toLowerCase();
|
|
458
|
+
const keep = (item) => needle === "" || [item.label, ...item.keywords ?? []].some((word) => word.toLowerCase().includes(needle));
|
|
459
|
+
return __props.groups.map((group) => ({
|
|
460
|
+
...group,
|
|
461
|
+
items: group.items.filter(keep)
|
|
462
|
+
})).filter((group) => group.items.length > 0);
|
|
463
|
+
});
|
|
464
|
+
/** Flattened, because the arrows walk the results and not the groups. */
|
|
465
|
+
const flat = computed(() => matches.value.flatMap((group) => group.items));
|
|
466
|
+
function choose(item) {
|
|
467
|
+
emit("select", item.id);
|
|
468
|
+
open.value = false;
|
|
469
|
+
}
|
|
470
|
+
function move(step) {
|
|
471
|
+
if (flat.value.length === 0) return;
|
|
472
|
+
active.value = (active.value + step + flat.value.length) % flat.value.length;
|
|
473
|
+
nextTick(() => {
|
|
474
|
+
document.getElementById(`${id}-${active.value}`)?.scrollIntoView?.({ block: "nearest" });
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
function onKeydown(event) {
|
|
478
|
+
if (event.key === "ArrowDown") {
|
|
479
|
+
event.preventDefault();
|
|
480
|
+
move(1);
|
|
481
|
+
} else if (event.key === "ArrowUp") {
|
|
482
|
+
event.preventDefault();
|
|
483
|
+
move(-1);
|
|
484
|
+
} else if (event.key === "Home") {
|
|
485
|
+
event.preventDefault();
|
|
486
|
+
active.value = 0;
|
|
487
|
+
} else if (event.key === "End") {
|
|
488
|
+
event.preventDefault();
|
|
489
|
+
active.value = Math.max(0, flat.value.length - 1);
|
|
490
|
+
} else if (event.key === "Enter") {
|
|
491
|
+
const item = flat.value[active.value];
|
|
492
|
+
if (item) {
|
|
493
|
+
event.preventDefault();
|
|
494
|
+
choose(item);
|
|
495
|
+
}
|
|
496
|
+
} else if (event.key === "Escape") {
|
|
497
|
+
event.preventDefault();
|
|
498
|
+
open.value = false;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
function onWindowKeydown(event) {
|
|
502
|
+
if (!__props.hotkey || event.key.toLowerCase() !== __props.hotkey.toLowerCase()) return;
|
|
503
|
+
if (!event.metaKey && !event.ctrlKey) return;
|
|
504
|
+
event.preventDefault();
|
|
505
|
+
open.value = !open.value;
|
|
506
|
+
}
|
|
507
|
+
if (typeof window !== "undefined") window.addEventListener("keydown", onWindowKeydown);
|
|
508
|
+
watch(open, async (isOpen) => {
|
|
509
|
+
if (typeof document === "undefined") return;
|
|
510
|
+
if (!isOpen) {
|
|
511
|
+
release?.();
|
|
512
|
+
release = null;
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
query.value = "";
|
|
516
|
+
active.value = 0;
|
|
517
|
+
await nextTick();
|
|
518
|
+
field.value?.focus();
|
|
519
|
+
const panel = field.value?.closest(".rk-command-panel");
|
|
520
|
+
if (panel) release = inertOutside(panel);
|
|
521
|
+
}, { immediate: true });
|
|
522
|
+
watch(query, () => active.value = 0);
|
|
523
|
+
onBeforeUnmount(() => {
|
|
524
|
+
release?.();
|
|
525
|
+
if (typeof window !== "undefined") window.removeEventListener("keydown", onWindowKeydown);
|
|
526
|
+
});
|
|
527
|
+
const indexOf = (item) => flat.value.indexOf(item);
|
|
528
|
+
return (_ctx, _cache) => {
|
|
529
|
+
return openBlock(), createBlock(Teleport, { to: unref(sheetRoot) }, [createVNode(Transition, { name: "rk-command" }, {
|
|
530
|
+
default: withCtx(() => [open.value ? (openBlock(), createElementBlock("div", {
|
|
531
|
+
key: 0,
|
|
532
|
+
class: "rk-command",
|
|
533
|
+
onKeydown
|
|
534
|
+
}, [createElementVNode("div", {
|
|
535
|
+
class: "rk-command-scrim",
|
|
536
|
+
onClick: _cache[0] || (_cache[0] = ($event) => open.value = false)
|
|
537
|
+
}), createElementVNode("div", {
|
|
538
|
+
class: "rk-command-panel surface-overlay",
|
|
539
|
+
role: "dialog",
|
|
540
|
+
"aria-modal": "true",
|
|
541
|
+
"aria-label": __props.label
|
|
542
|
+
}, [createElementVNode("div", _hoisted_2$4, [createVNode(unref(Search), {
|
|
543
|
+
class: "text-ink-soft size-4 shrink-0",
|
|
544
|
+
"aria-hidden": "true"
|
|
545
|
+
}), withDirectives(createElementVNode("input", {
|
|
546
|
+
ref_key: "field",
|
|
547
|
+
ref: field,
|
|
548
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => query.value = $event),
|
|
549
|
+
type: "text",
|
|
550
|
+
role: "combobox",
|
|
551
|
+
class: "rk-command-input",
|
|
552
|
+
autocomplete: "off",
|
|
553
|
+
placeholder: __props.placeholder,
|
|
554
|
+
"aria-label": __props.label,
|
|
555
|
+
"aria-expanded": true,
|
|
556
|
+
"aria-controls": unref(id),
|
|
557
|
+
"aria-activedescendant": flat.value.length ? `${unref(id)}-${active.value}` : void 0
|
|
558
|
+
}, null, 8, _hoisted_3$2), [[vModelText, query.value]])]), createElementVNode("div", {
|
|
559
|
+
id: unref(id),
|
|
560
|
+
class: "rk-command-list",
|
|
561
|
+
role: "listbox",
|
|
562
|
+
"aria-label": __props.label
|
|
563
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(matches.value, (group) => {
|
|
564
|
+
return openBlock(), createElementBlock(Fragment, { key: group.label ?? "items" }, [group.label ? (openBlock(), createElementBlock("p", _hoisted_5$1, toDisplayString(group.label), 1)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(group.items, (item) => {
|
|
565
|
+
return openBlock(), createElementBlock("div", {
|
|
566
|
+
id: `${unref(id)}-${indexOf(item)}`,
|
|
567
|
+
key: item.id,
|
|
568
|
+
class: normalizeClass(["rk-command-item", { "is-active": indexOf(item) === active.value }]),
|
|
569
|
+
role: "option",
|
|
570
|
+
"aria-selected": indexOf(item) === active.value,
|
|
571
|
+
onClick: ($event) => choose(item),
|
|
572
|
+
onPointermove: ($event) => active.value = indexOf(item)
|
|
573
|
+
}, [
|
|
574
|
+
item.icon ? (openBlock(), createBlock(resolveDynamicComponent(item.icon), {
|
|
575
|
+
key: 0,
|
|
576
|
+
class: "size-4 shrink-0",
|
|
577
|
+
"aria-hidden": "true"
|
|
578
|
+
})) : createCommentVNode("", true),
|
|
579
|
+
createElementVNode("span", _hoisted_7$1, toDisplayString(item.label), 1),
|
|
580
|
+
item.hint ? (openBlock(), createElementBlock("span", _hoisted_8$1, toDisplayString(item.hint), 1)) : createCommentVNode("", true)
|
|
581
|
+
], 42, _hoisted_6$1);
|
|
582
|
+
}), 128))], 64);
|
|
583
|
+
}), 128)), flat.value.length === 0 ? (openBlock(), createElementBlock("p", _hoisted_9$1, toDisplayString(__props.emptyLabel), 1)) : createCommentVNode("", true)], 8, _hoisted_4$1)], 8, _hoisted_1$4)], 32)) : createCommentVNode("", true)]),
|
|
584
|
+
_: 1
|
|
585
|
+
})], 8, ["to"]);
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
}), [["__scopeId", "data-v-cce1dd03"]]);
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region src/web/DataTable.vue?vue&type=script&setup=true&lang.ts
|
|
591
|
+
var _hoisted_1$3 = ["aria-label"];
|
|
592
|
+
var _hoisted_2$3 = {
|
|
593
|
+
key: 0,
|
|
594
|
+
scope: "col",
|
|
595
|
+
class: "rk-data-pick"
|
|
596
|
+
};
|
|
597
|
+
var _hoisted_3$1 = [
|
|
598
|
+
"checked",
|
|
599
|
+
"indeterminate",
|
|
600
|
+
"aria-label"
|
|
601
|
+
];
|
|
602
|
+
var _hoisted_4 = ["aria-sort"];
|
|
603
|
+
var _hoisted_5 = ["onClick"];
|
|
604
|
+
var _hoisted_6 = {
|
|
605
|
+
key: 0,
|
|
606
|
+
"aria-busy": "true"
|
|
607
|
+
};
|
|
608
|
+
var _hoisted_7 = { key: 0 };
|
|
609
|
+
var _hoisted_8 = { key: 1 };
|
|
610
|
+
var _hoisted_9 = {
|
|
611
|
+
key: 0,
|
|
612
|
+
class: "rk-data-pick"
|
|
613
|
+
};
|
|
614
|
+
var _hoisted_10 = [
|
|
615
|
+
"checked",
|
|
616
|
+
"aria-label",
|
|
617
|
+
"onChange"
|
|
618
|
+
];
|
|
619
|
+
var _hoisted_11 = { key: 2 };
|
|
620
|
+
var _hoisted_12 = ["colspan"];
|
|
621
|
+
//#endregion
|
|
622
|
+
//#region src/web/DataTable.vue
|
|
623
|
+
var DataTable_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
624
|
+
__name: "DataTable",
|
|
625
|
+
props: /*@__PURE__*/ mergeModels({
|
|
626
|
+
columns: {},
|
|
627
|
+
rows: {},
|
|
628
|
+
caption: {},
|
|
629
|
+
captionHidden: {
|
|
630
|
+
type: Boolean,
|
|
631
|
+
default: false
|
|
632
|
+
},
|
|
633
|
+
rowKey: { default: () => void 0 },
|
|
634
|
+
selectAllLabel: { default: () => void 0 },
|
|
635
|
+
rowLabel: {
|
|
636
|
+
type: Function,
|
|
637
|
+
default: void 0
|
|
638
|
+
},
|
|
639
|
+
manualSort: {
|
|
640
|
+
type: Boolean,
|
|
641
|
+
default: false
|
|
642
|
+
},
|
|
643
|
+
loading: {
|
|
644
|
+
type: Boolean,
|
|
645
|
+
default: false
|
|
646
|
+
},
|
|
647
|
+
loadingRows: { default: 5 },
|
|
648
|
+
stickyHeader: {
|
|
649
|
+
type: Boolean,
|
|
650
|
+
default: false
|
|
651
|
+
}
|
|
652
|
+
}, {
|
|
653
|
+
"sort": { default: void 0 },
|
|
654
|
+
"sortModifiers": {},
|
|
655
|
+
"selected": { default: () => [] },
|
|
656
|
+
"selectedModifiers": {}
|
|
657
|
+
}),
|
|
658
|
+
emits: ["update:sort", "update:selected"],
|
|
659
|
+
setup(__props) {
|
|
660
|
+
/** Which column is sorted, and which way. `v-model:sort`. */
|
|
661
|
+
const sort = useModel(__props, "sort");
|
|
662
|
+
/** The chosen rows' keys. `v-model:selected`. */
|
|
663
|
+
const selected = useModel(__props, "selected");
|
|
664
|
+
const selectable = computed(() => Boolean(__props.rowKey && __props.selectAllLabel && __props.rowLabel));
|
|
665
|
+
const keyOf = (row, index) => __props.rowKey ? String(row[__props.rowKey]) : String(index);
|
|
666
|
+
function compare(a, b) {
|
|
667
|
+
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
668
|
+
if (a == null) return b == null ? 0 : -1;
|
|
669
|
+
if (b == null) return 1;
|
|
670
|
+
return String(a).localeCompare(String(b));
|
|
671
|
+
}
|
|
672
|
+
const shown = computed(() => {
|
|
673
|
+
if (!sort.value || __props.manualSort) return __props.rows;
|
|
674
|
+
const { key, direction } = sort.value;
|
|
675
|
+
const sorted = [...__props.rows].sort((a, b) => compare(a[key], b[key]));
|
|
676
|
+
return direction === "asc" ? sorted : sorted.reverse();
|
|
677
|
+
});
|
|
678
|
+
/** Ascending, then descending, then back to the order it arrived in. */
|
|
679
|
+
function toggleSort(column) {
|
|
680
|
+
if (!column.sortable) return;
|
|
681
|
+
if (sort.value?.key !== column.key) {
|
|
682
|
+
sort.value = {
|
|
683
|
+
key: column.key,
|
|
684
|
+
direction: "asc"
|
|
685
|
+
};
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
sort.value = sort.value.direction === "asc" ? {
|
|
689
|
+
key: column.key,
|
|
690
|
+
direction: "desc"
|
|
691
|
+
} : void 0;
|
|
692
|
+
}
|
|
693
|
+
const ariaSort = (column) => {
|
|
694
|
+
if (!column.sortable) return void 0;
|
|
695
|
+
if (sort.value?.key !== column.key) return "none";
|
|
696
|
+
return sort.value.direction === "asc" ? "ascending" : "descending";
|
|
697
|
+
};
|
|
698
|
+
const allKeys = computed(() => shown.value.map((row, index) => keyOf(row, index)));
|
|
699
|
+
const allChosen = computed(() => allKeys.value.length > 0 && allKeys.value.every((key) => selected.value.includes(key)));
|
|
700
|
+
const someChosen = computed(() => !allChosen.value && allKeys.value.some((key) => selected.value.includes(key)));
|
|
701
|
+
function toggleAll() {
|
|
702
|
+
selected.value = allChosen.value ? [] : allKeys.value;
|
|
703
|
+
}
|
|
704
|
+
function toggleRow(key) {
|
|
705
|
+
selected.value = selected.value.includes(key) ? selected.value.filter((one) => one !== key) : [...selected.value, key];
|
|
706
|
+
}
|
|
707
|
+
const columnCount = computed(() => __props.columns.length + (selectable.value ? 1 : 0));
|
|
708
|
+
return (_ctx, _cache) => {
|
|
709
|
+
return openBlock(), createElementBlock("div", {
|
|
710
|
+
class: "rk-data-scroll",
|
|
711
|
+
tabindex: "0",
|
|
712
|
+
role: "region",
|
|
713
|
+
"aria-label": __props.caption
|
|
714
|
+
}, [createElementVNode("table", { class: normalizeClass(["rk-data", { "is-sticky": __props.stickyHeader }]) }, [
|
|
715
|
+
createElementVNode("caption", { class: normalizeClass(__props.captionHidden ? "rk-data-caption-hidden" : "rk-data-caption") }, toDisplayString(__props.caption), 3),
|
|
716
|
+
createElementVNode("thead", null, [createElementVNode("tr", null, [selectable.value ? (openBlock(), createElementBlock("th", _hoisted_2$3, [createElementVNode("input", {
|
|
717
|
+
type: "checkbox",
|
|
718
|
+
class: "rk-data-box focus-ring",
|
|
719
|
+
checked: allChosen.value,
|
|
720
|
+
indeterminate: someChosen.value,
|
|
721
|
+
"aria-label": __props.selectAllLabel,
|
|
722
|
+
onChange: toggleAll
|
|
723
|
+
}, null, 40, _hoisted_3$1)])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
724
|
+
return openBlock(), createElementBlock("th", {
|
|
725
|
+
key: column.key,
|
|
726
|
+
scope: "col",
|
|
727
|
+
"aria-sort": ariaSort(column),
|
|
728
|
+
class: normalizeClass([column.align === "end" && "is-end", column.nowrap && "is-nowrap"])
|
|
729
|
+
}, [column.sortable ? (openBlock(), createElementBlock("button", {
|
|
730
|
+
key: 0,
|
|
731
|
+
type: "button",
|
|
732
|
+
class: "rk-data-sort focus-ring",
|
|
733
|
+
onClick: ($event) => toggleSort(column)
|
|
734
|
+
}, [createTextVNode(toDisplayString(column.label) + " ", 1), ariaSort(column) === "ascending" ? (openBlock(), createBlock(unref(ArrowUp), {
|
|
735
|
+
key: 0,
|
|
736
|
+
class: "size-3.5",
|
|
737
|
+
"aria-hidden": "true"
|
|
738
|
+
})) : ariaSort(column) === "descending" ? (openBlock(), createBlock(unref(ArrowDown), {
|
|
739
|
+
key: 1,
|
|
740
|
+
class: "size-3.5",
|
|
741
|
+
"aria-hidden": "true"
|
|
742
|
+
})) : (openBlock(), createBlock(unref(ChevronsUpDown), {
|
|
743
|
+
key: 2,
|
|
744
|
+
class: "size-3.5 opacity-40",
|
|
745
|
+
"aria-hidden": "true"
|
|
746
|
+
}))], 8, _hoisted_5)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(column.label), 1)], 64))], 10, _hoisted_4);
|
|
747
|
+
}), 128))])]),
|
|
748
|
+
__props.loading ? (openBlock(), createElementBlock("tbody", _hoisted_6, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.loadingRows, (row) => {
|
|
749
|
+
return openBlock(), createElementBlock("tr", { key: row }, [selectable.value ? (openBlock(), createElementBlock("td", _hoisted_7)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
750
|
+
return openBlock(), createElementBlock("td", { key: column.key }, [createVNode(BaseSkeleton_default, {
|
|
751
|
+
shape: "text",
|
|
752
|
+
height: "0.75rem",
|
|
753
|
+
width: "70%"
|
|
754
|
+
})]);
|
|
755
|
+
}), 128))]);
|
|
756
|
+
}), 128))])) : shown.value.length > 0 ? (openBlock(), createElementBlock("tbody", _hoisted_8, [(openBlock(true), createElementBlock(Fragment, null, renderList(shown.value, (row, index) => {
|
|
757
|
+
return openBlock(), createElementBlock("tr", {
|
|
758
|
+
key: keyOf(row, index),
|
|
759
|
+
class: normalizeClass({ "is-chosen": selected.value.includes(keyOf(row, index)) })
|
|
760
|
+
}, [selectable.value ? (openBlock(), createElementBlock("td", _hoisted_9, [createElementVNode("input", {
|
|
761
|
+
type: "checkbox",
|
|
762
|
+
class: "rk-data-box focus-ring",
|
|
763
|
+
checked: selected.value.includes(keyOf(row, index)),
|
|
764
|
+
"aria-label": __props.rowLabel(row),
|
|
765
|
+
onChange: ($event) => toggleRow(keyOf(row, index))
|
|
766
|
+
}, null, 40, _hoisted_10)])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
767
|
+
return openBlock(), createElementBlock("td", {
|
|
768
|
+
key: column.key,
|
|
769
|
+
class: normalizeClass([column.align === "end" && "is-end", column.nowrap && "is-nowrap"])
|
|
770
|
+
}, [renderSlot(_ctx.$slots, column.key, {
|
|
771
|
+
row,
|
|
772
|
+
value: row[column.key]
|
|
773
|
+
}, () => [createTextVNode(toDisplayString(row[column.key]), 1)], true)], 2);
|
|
774
|
+
}), 128))], 2);
|
|
775
|
+
}), 128))])) : (openBlock(), createElementBlock("tbody", _hoisted_11, [createElementVNode("tr", null, [createElementVNode("td", {
|
|
776
|
+
colspan: columnCount.value,
|
|
777
|
+
class: "rk-data-empty"
|
|
778
|
+
}, [renderSlot(_ctx.$slots, "empty", {}, void 0, true)], 8, _hoisted_12)])]))
|
|
779
|
+
], 2)], 8, _hoisted_1$3);
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
}), [["__scopeId", "data-v-5920cac0"]]);
|
|
783
|
+
//#endregion
|
|
397
784
|
//#region src/web/BaseTabs.vue?vue&type=script&setup=true&lang.ts
|
|
398
785
|
var _hoisted_1$2 = ["aria-label"];
|
|
399
786
|
var _hoisted_2$2 = [
|
|
@@ -539,6 +926,6 @@ var NavLinks_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
539
926
|
}
|
|
540
927
|
}), [["__scopeId", "data-v-52e5d553"]]);
|
|
541
928
|
//#endregion
|
|
542
|
-
export { BaseAccordion_default as BaseAccordion, BaseBreadcrumb_default as BaseBreadcrumb, BaseDisclosure_default as BaseDisclosure, BaseModal_default as BaseModal, BasePagination_default as BasePagination, BaseTabs_default as BaseTabs, BaseTooltip_default as BaseTooltip, NavLinks_default as NavLinks };
|
|
929
|
+
export { BaseAccordion_default as BaseAccordion, BaseBreadcrumb_default as BaseBreadcrumb, BaseDisclosure_default as BaseDisclosure, BaseModal_default as BaseModal, BasePagination_default as BasePagination, BaseTabs_default as BaseTabs, BaseTooltip_default as BaseTooltip, CommandMenu_default as CommandMenu, DataTable_default as DataTable, NavLinks_default as NavLinks };
|
|
543
930
|
|
|
544
931
|
//# sourceMappingURL=web.js.map
|