@wssto2/vue-core 0.4.4 → 0.4.6

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.
Files changed (73) hide show
  1. package/dist/{Activity-BH0jQxZs.js → Activity-BVk8iG3X.js} +2 -2
  2. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-DxD6JvyK.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-B7qSUiee.js} +1 -1
  3. package/dist/{Changes-DS81sZj9.js → Changes-CaiZpcyW.js} +2 -2
  4. package/dist/CollectionPage.vue_vue_type_script_setup_true_lang-kBBHIJTB.js +1520 -0
  5. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DBtMgcW6.js → DataTable.vue_vue_type_script_setup_true_lang-KPm5NrDE.js} +1 -1
  6. package/dist/{DeadLetters-BqKtaowL.js → DeadLetters-BOMgmmOg.js} +3 -3
  7. package/dist/{General-CK-9LrQ2.js → General-BaW63VQg.js} +2 -2
  8. package/dist/IconTile.vue_vue_type_script_setup_true_lang-_FXvaj93.js +50 -0
  9. package/dist/{Menu.vue_vue_type_script_setup_true_lang-ClsOlOSr.js → Menu.vue_vue_type_script_setup_true_lang-uPmxWvds.js} +56 -50
  10. package/dist/{NewRolePage-CziDdoeG.js → NewRolePage-B8OGQE-A.js} +3 -3
  11. package/dist/{ProfilePage-x063Zij2.js → ProfilePage-Bbv5KH3L.js} +4 -4
  12. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-Bua3wbN6.js → RecordHeader.vue_vue_type_script_setup_true_lang-D87Hs75d.js} +1 -1
  13. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-CzP4BNh7.js → ResourcePage.vue_vue_type_script_setup_true_lang-gJGEfLzX.js} +1 -1
  14. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-BjhaIqqG.js → RoleEditor.vue_vue_type_script_setup_true_lang-4YJhNgbn.js} +1 -1
  15. package/dist/{RolePage-Cecu3BKn.js → RolePage-Bn0re7VE.js} +6 -6
  16. package/dist/{RolesPage-DIL35QcF.js → RolesPage-CjEAQvTq.js} +3 -3
  17. package/dist/{SectionList.vue_vue_type_script_setup_true_lang-CaF3LPbQ.js → SectionList.vue_vue_type_script_setup_true_lang-B0p_8xQG.js} +2 -2
  18. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-BJfEOvEf.js → SectionNavigator.vue_vue_type_script_setup_true_lang-ROl9_pdO.js} +3 -3
  19. package/dist/SelectField.vue_vue_type_script_setup_true_lang-BJoAkBo2.js +437 -0
  20. package/dist/{SessionList.vue_vue_type_script_setup_true_lang-D5KRitar.js → SessionList.vue_vue_type_script_setup_true_lang-D4k5QeWS.js} +1 -1
  21. package/dist/{Sessions-DhHIVk7e.js → Sessions-r9WHf0nU.js} +2 -2
  22. package/dist/{SettingsPage-BuGtZcae.js → SettingsPage-Dcib_TK0.js} +2 -2
  23. package/dist/{SignIn-DRls5eYK.js → SignIn-DJ-ai_ap.js} +2 -2
  24. package/dist/{SignInPage-D9wR46KD.js → SignInPage-CJAsxvc6.js} +1 -1
  25. package/dist/{SignInTable.vue_vue_type_script_setup_true_lang-CifEaH7c.js → SignInTable.vue_vue_type_script_setup_true_lang-ALAuc0sI.js} +1 -1
  26. package/dist/{SignIns-BMBFeBrK.js → SignIns-NnIqezxn.js} +2 -2
  27. package/dist/ToneDot.vue_vue_type_script_setup_true_lang-99rNn-L5.js +24 -0
  28. package/dist/{UserRecord-BOCP5XC6.js → UserRecord-JZFQ40hK.js} +6 -6
  29. package/dist/{UsersList-Df6HeAAO.js → UsersList-cfhb1GE7.js} +4 -4
  30. package/dist/access/index.js +1 -1
  31. package/dist/collection/CollectionCell.vue.d.ts +2 -0
  32. package/dist/collection/RecordIdentity.vue.d.ts +6 -0
  33. package/dist/collection/datePresets.d.ts +8 -4
  34. package/dist/collection/filters.d.ts +4 -0
  35. package/dist/collection/index.js +49 -49
  36. package/dist/collection/rowInteractions.d.ts +2 -0
  37. package/dist/collection/state.d.ts +10 -5
  38. package/dist/collection/useCollection.d.ts +20 -5
  39. package/dist/controls/IconTile.vue.d.ts +10 -3
  40. package/dist/controls/index.js +1 -1
  41. package/dist/form/I18nField.vue.d.ts +1 -1
  42. package/dist/form/TextareaField.vue.d.ts +1 -1
  43. package/dist/form/index.js +4 -4
  44. package/dist/form/options.d.ts +3 -0
  45. package/dist/http-D_D9YbLH.js +194 -0
  46. package/dist/identity/index.js +1 -1
  47. package/dist/{index-EkQmsbBQ.js → index-7QcMXQZq.js} +2 -2
  48. package/dist/{index-BykMr7eH.js → index-By5B18A3.js} +10 -10
  49. package/dist/{index-BwMaMqSc.js → index-CixCeO47.js} +5 -5
  50. package/dist/index.d.ts +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/{neighbors-DpaIMQAL.js → neighbors-BRf4Eh2R.js} +1 -1
  53. package/dist/notifications/index.js +1 -1
  54. package/dist/overlay/AlertDialog.vue.d.ts +2 -2
  55. package/dist/overlay/Menu.vue.d.ts +3 -0
  56. package/dist/overlay/index.js +1 -1
  57. package/dist/page/AdaptivePageShell.vue.d.ts +2 -2
  58. package/dist/page/ResourceHeader.vue.d.ts +2 -2
  59. package/dist/page/index.js +5 -5
  60. package/dist/resource/index.js +1 -1
  61. package/dist/{rowLayout-CZ7uZFnE.js → rowLayout-BkQWulan.js} +239 -221
  62. package/dist/shell/NavigationList.vue.d.ts +1 -1
  63. package/dist/shell/index.js +1 -1
  64. package/dist/state/ToneDot.vue.d.ts +12 -0
  65. package/dist/{status-DyvlO552.js → status-Ct8ixCoS.js} +2 -2
  66. package/dist/styles.css +1 -1
  67. package/package.json +1 -1
  68. package/src/styles/collection.css +1 -1
  69. package/src/styles/theme.css +7 -0
  70. package/dist/CollectionPage.vue_vue_type_script_setup_true_lang-BZRdVhZo.js +0 -1485
  71. package/dist/IconTile.vue_vue_type_script_setup_true_lang-BpIjgu5E.js +0 -40
  72. package/dist/SelectField.vue_vue_type_script_setup_true_lang-7O1BAx04.js +0 -423
  73. package/dist/http-CNcDHSOj.js +0 -194
@@ -1,40 +0,0 @@
1
- import { defineComponent as s, openBlock as t, createElementBlock as o, normalizeClass as r, createBlock as l, unref as c, toDisplayString as d, createCommentVNode as x } from "vue";
2
- import { _ as u } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
3
- const m = ["data-tone"], g = /* @__PURE__ */ s({
4
- __name: "IconTile",
5
- props: {
6
- tone: { default: "anchor" },
7
- icon: { default: void 0 },
8
- text: { default: void 0 },
9
- size: { default: "row" }
10
- },
11
- setup(a) {
12
- const e = a, i = {
13
- brand: "bg-tile-brand text-tile-brand-foreground",
14
- anchor: "bg-tile-anchor text-tile-anchor-foreground",
15
- neutral: "bg-tile-neutral text-tile-neutral-foreground"
16
- }, n = {
17
- row: { box: "size-tile rounded-md", text: "text-caption" },
18
- md: { box: "size-11 rounded-xl", text: "text-base" },
19
- lg: { box: "size-14 rounded-2xl", text: "text-xl" }
20
- };
21
- return (f, p) => (t(), o("span", {
22
- "aria-hidden": "true",
23
- "data-tone": e.tone,
24
- class: r(["inline-flex shrink-0 select-none items-center justify-center", [i[e.tone], n[e.size].box]])
25
- }, [
26
- e.icon ? (t(), l(c(u), {
27
- key: 0,
28
- name: e.icon,
29
- size: 20,
30
- class: "size-[62%]"
31
- }, null, 8, ["name"])) : e.text ? (t(), o("span", {
32
- key: 1,
33
- class: r(["font-semibold leading-none", n[e.size].text])
34
- }, d(e.text), 3)) : x("", !0)
35
- ], 10, m));
36
- }
37
- });
38
- export {
39
- g as _
40
- };
@@ -1,423 +0,0 @@
1
- import { defineComponent as U, ref as N, useId as H, useTemplateRef as P, computed as y, watch as F, nextTick as I, openBlock as n, createElementBlock as b, normalizeClass as g, createElementVNode as s, createVNode as L, unref as t, withDirectives as j, vModelText as G, createCommentVNode as _, toDisplayString as w, createBlock as z, Fragment as B, renderList as T, onScopeDispose as K, useModel as W, mergeProps as E, withCtx as D, createSlots as J, createTextVNode as Q, mergeModels as X, mergeDefaults as Y } from "vue";
2
- import { useI18n as R } from "vue-i18n";
3
- import { _ as Z } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
4
- import { _ as V } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
5
- import { u as ee } from "./mediaQuery-CygcXmFW.js";
6
- import { _ as te } from "./Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js";
7
- import { _ as oe } from "./Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js";
8
- import { a as le, c as ae, _ as ne, f as se, b as re } from "./control-7EP4tjYy.js";
9
- import { g as ie, m as ue } from "./options-Ba_0uLWN.js";
10
- import { a as ce } from "./suggestions-BxMm6MQA.js";
11
- const de = { class: "flex min-h-9 items-center gap-1.5 rounded-control bg-fill px-2.5 text-content-muted focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-border-focus" }, pe = ["aria-label", "placeholder"], me = ["aria-multiselectable", "aria-busy"], fe = {
12
- key: 0,
13
- role: "presentation"
14
- }, ve = ["aria-selected"], be = { class: "flex-1 py-2" }, ge = {
15
- key: 1,
16
- role: "presentation",
17
- class: "flex items-center gap-2.5 px-row-inset py-4 text-subheadline text-content-muted",
18
- "data-test": "options-loading"
19
- }, he = { role: "status" }, ye = {
20
- key: 2,
21
- role: "presentation",
22
- class: "flex flex-col items-start gap-1 px-row-inset py-3",
23
- "data-test": "options-failed"
24
- }, xe = {
25
- role: "alert",
26
- class: "text-subheadline text-content-destructive"
27
- }, ke = ["id"], _e = ["aria-labelledby"], we = ["aria-selected"], $e = ["disabled", "onClick"], Ce = {
28
- key: 0,
29
- "aria-hidden": "true",
30
- class: "flex shrink-0 items-center"
31
- }, Se = { class: "min-w-0 flex-1 text-content-strong" }, Le = {
32
- key: 0,
33
- class: "shrink-0 text-footnote text-content-muted"
34
- }, Ve = {
35
- key: 3,
36
- class: "px-4 py-6 text-center text-subheadline text-content-muted"
37
- }, M = /* @__PURE__ */ U({
38
- __name: "OptionList",
39
- props: {
40
- options: {},
41
- modelValue: { default: null },
42
- multiple: { type: Boolean, default: !1 },
43
- searchFrom: { default: 9 },
44
- noneLabel: { default: void 0 },
45
- presentation: { default: "grouped" },
46
- status: { default: "loaded" }
47
- },
48
- emits: ["select", "retry"],
49
- setup(r, { emit: l }) {
50
- const e = r, d = l, { t: f } = R(), v = N(""), m = H(), h = P("root"), o = y(() => e.options.length >= e.searchFrom), x = y(() => ie(ue(e.options, v.value))), S = (p) => e.multiple ? Array.isArray(e.modelValue) && e.modelValue.includes(p.value) : e.modelValue === p.value, A = y(() => e.multiple ? !1 : e.modelValue === null);
51
- function O(p) {
52
- if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(p.key)) return;
53
- const a = [...h.value?.querySelectorAll("[data-option]:not([disabled])") ?? []];
54
- if (a.length === 0) return;
55
- const i = a.indexOf(document.activeElement), c = p.key === "Home" ? 0 : p.key === "End" ? a.length - 1 : p.key === "ArrowDown" ? Math.min(i + 1, a.length - 1) : Math.max(i - 1, 0);
56
- p.key === "ArrowUp" && i <= 0 ? h.value?.querySelector("[data-option-search]")?.focus() : a[i === -1 && p.key === "ArrowDown" ? 0 : c]?.focus(), p.preventDefault();
57
- }
58
- const $ = y(() => e.presentation === "grouped"), C = y(() => e.status === "loading"), u = y(() => e.status === "failed");
59
- return F(() => e.status, (p, k) => {
60
- k !== "loading" || p === "loading" || I(() => {
61
- const a = document.activeElement;
62
- (!a || a === document.body || a.getAttribute("role") === "dialog" && !!h.value && a.contains(h.value)) && h.value?.querySelector("[data-option-search], [data-option]:not([disabled])")?.focus({ preventScroll: !0 });
63
- });
64
- }), (p, k) => (n(), b("div", {
65
- ref_key: "root",
66
- ref: h,
67
- "data-test": "option-list",
68
- onKeydown: O
69
- }, [
70
- o.value ? (n(), b("div", {
71
- key: 0,
72
- class: g(["sticky top-0 z-10 pb-2", $.value ? "bg-surface-page pt-1" : "bg-surface-cell"])
73
- }, [
74
- s("label", de, [
75
- L(t(V), {
76
- name: "search",
77
- size: 16,
78
- class: "shrink-0"
79
- }),
80
- j(s("input", {
81
- "onUpdate:modelValue": k[0] || (k[0] = (a) => v.value = a),
82
- "data-option-search": "",
83
- type: "search",
84
- enterkeyhint: "search",
85
- autocomplete: "off",
86
- autocapitalize: "off",
87
- spellcheck: "false",
88
- "aria-label": t(f)("core.form.select.search"),
89
- placeholder: t(f)("core.form.select.search"),
90
- class: "min-w-0 flex-1 border-0 bg-transparent p-0 text-body text-content-strong outline-none placeholder:text-content-disabled focus:ring-0"
91
- }, null, 8, pe), [
92
- [G, v.value]
93
- ])
94
- ])
95
- ], 2)) : _("", !0),
96
- s("ul", {
97
- class: g(["flex flex-col", $.value ? "gap-group-gap" : "gap-2"]),
98
- role: "listbox",
99
- "aria-multiselectable": e.multiple || void 0,
100
- "aria-busy": C.value || void 0
101
- }, [
102
- e.noneLabel && v.value === "" ? (n(), b("li", fe, [
103
- s("ul", {
104
- role: "group",
105
- class: g($.value ? "rounded-group bg-surface-cell shadow-group" : "")
106
- }, [
107
- s("li", {
108
- role: "option",
109
- "aria-selected": A.value
110
- }, [
111
- s("button", {
112
- type: "button",
113
- "data-option": "",
114
- class: g(["flex min-h-row w-full cursor-pointer items-center gap-3 px-row-inset text-left text-body hover:bg-fill focus-visible:bg-fill focus-visible:outline-none active:bg-fill", [A.value ? "text-content-strong" : "text-content-muted", $.value ? "rounded-group" : "rounded-control"]]),
115
- onClick: k[1] || (k[1] = (a) => d("select", null))
116
- }, [
117
- s("span", be, w(e.noneLabel), 1),
118
- A.value ? (n(), z(t(V), {
119
- key: 0,
120
- name: "checkCustom",
121
- size: 18,
122
- class: "shrink-0 text-content-link"
123
- })) : _("", !0)
124
- ], 2)
125
- ], 8, ve)
126
- ], 2)
127
- ])) : _("", !0),
128
- C.value ? (n(), b("li", ge, [
129
- L(t(V), {
130
- name: "loader4Line",
131
- size: 16,
132
- class: "shrink-0 animate-spin text-content-link"
133
- }),
134
- s("span", he, w(t(f)("core.form.select.loading")), 1)
135
- ])) : u.value ? (n(), b("li", ye, [
136
- s("span", xe, w(t(f)("core.form.select.load_failed")), 1),
137
- s("button", {
138
- type: "button",
139
- "data-option": "",
140
- "data-test": "options-retry",
141
- class: "-ml-2 cursor-pointer rounded-control px-2 py-1 text-subheadline font-medium text-content-link hover:bg-fill focus-visible:bg-fill focus-visible:outline-none",
142
- onClick: k[2] || (k[2] = (a) => d("retry"))
143
- }, w(t(f)("core.actions.retry")), 1)
144
- ])) : _("", !0),
145
- (n(!0), b(B, null, T(x.value, (a, i) => (n(), b("li", {
146
- key: a.title ?? i,
147
- role: "presentation"
148
- }, [
149
- a.title ? (n(), b("p", {
150
- key: 0,
151
- id: `${t(m)}-${i}`,
152
- class: "px-row-inset pb-1.5 text-footnote uppercase tracking-wide text-content-muted"
153
- }, w(a.title), 9, ke)) : _("", !0),
154
- s("ul", {
155
- role: "group",
156
- "aria-labelledby": a.title ? `${t(m)}-${i}` : void 0,
157
- class: g($.value ? "rounded-group bg-surface-cell shadow-group" : "")
158
- }, [
159
- (n(!0), b(B, null, T(a.options, (c) => (n(), b("li", {
160
- key: String(c.value),
161
- role: "option",
162
- "aria-selected": S(c),
163
- class: "group/option"
164
- }, [
165
- s("button", {
166
- type: "button",
167
- "data-option": "",
168
- "data-test": "option",
169
- disabled: c.disabled,
170
- class: g(["flex w-full cursor-pointer items-stretch gap-3 pl-row-inset text-left text-body hover:bg-fill focus-visible:bg-fill focus-visible:outline-none active:bg-fill disabled:cursor-not-allowed disabled:opacity-45", $.value ? "group-first/option:rounded-t-group group-last/option:rounded-b-group" : "rounded-control"]),
171
- onClick: (Fe) => d("select", c.value)
172
- }, [
173
- e.multiple ? (n(), b("span", Ce, [
174
- s("span", {
175
- class: g(["flex size-5.5 items-center justify-center rounded-full border", S(c) ? "border-control-on bg-control-on text-white" : "border-border-control"])
176
- }, [
177
- S(c) ? (n(), z(t(V), {
178
- key: 0,
179
- name: "checkCustom",
180
- size: 12
181
- })) : _("", !0)
182
- ], 2)
183
- ])) : _("", !0),
184
- s("span", {
185
- class: g(["flex min-h-row min-w-0 flex-1 items-center gap-3 py-2 pr-row-inset", $.value ? "border-t border-border-separator group-first/option:border-t-0" : ""])
186
- }, [
187
- s("span", Se, w(c.label), 1),
188
- c.description ? (n(), b("span", Le, w(c.description), 1)) : _("", !0),
189
- !e.multiple && S(c) ? (n(), z(t(V), {
190
- key: 1,
191
- name: "checkCustom",
192
- size: 18,
193
- class: "shrink-0 text-content-link"
194
- })) : _("", !0)
195
- ], 2)
196
- ], 10, $e)
197
- ], 8, we))), 128))
198
- ], 10, _e)
199
- ]))), 128)),
200
- x.value.length === 0 && !C.value && !u.value ? (n(), b("li", Ve, w(t(f)("core.form.select.no_matches")), 1)) : _("", !0)
201
- ], 10, me)
202
- ], 544));
203
- }
204
- });
205
- function je(r) {
206
- const l = ce(), e = r.for !== void 0;
207
- let d = 0;
208
- function f() {
209
- const v = r.for?.();
210
- if (e && v == null) {
211
- l.cancel(), l.items.value = [], l.status.value = "idle";
212
- return;
213
- }
214
- l.run(
215
- (m) => e ? r.load(v, { signal: m }) : r.load({ signal: m })
216
- );
217
- }
218
- return F(
219
- () => r.for?.(),
220
- (v, m) => {
221
- m != null && d++, f();
222
- },
223
- { immediate: !0 }
224
- ), K(l.cancel), {
225
- get status() {
226
- return l.status.value;
227
- },
228
- get options() {
229
- return l.items.value;
230
- },
231
- get generation() {
232
- return d;
233
- },
234
- reload: f
235
- };
236
- }
237
- const q = (r) => Array.isArray(r), De = [];
238
- function qe(r, l) {
239
- const e = y(() => {
240
- const o = r();
241
- return q(o) ? o : o.options;
242
- }), d = y(() => {
243
- const o = r();
244
- return q(o) ? "loaded" : o.status;
245
- }), f = y(() => d.value === "loading" || d.value === "failed" ? De : e.value), v = y(() => d.value === "loading"), m = r();
246
- let h = q(m) ? 0 : m.generation;
247
- return F(
248
- () => {
249
- const o = r();
250
- return q(o) ? null : o.status === "loaded" || o.status === "idle" ? o.options : null;
251
- },
252
- (o) => {
253
- const x = r();
254
- o === null || q(x) || x.generation === h || (h = x.generation, l(o));
255
- }
256
- ), { known: e, rows: f, status: d, loading: v, reload: () => {
257
- const o = r();
258
- q(o) || o.reload();
259
- } };
260
- }
261
- const ze = ["id", "disabled", "aria-expanded", "aria-required", "aria-invalid", "aria-describedby", "aria-busy"], Ae = ["id", "disabled", "aria-required", "aria-invalid", "aria-describedby", "aria-busy", "onClick"], Oe = { class: "max-h-72 overflow-y-auto" }, Ge = /* @__PURE__ */ U({
262
- __name: "SelectField",
263
- props: /* @__PURE__ */ X(/* @__PURE__ */ Y({
264
- label: {},
265
- hint: {},
266
- error: {},
267
- required: { type: Boolean },
268
- editable: { type: Boolean },
269
- disabled: { type: Boolean },
270
- lockedReason: {},
271
- presentation: {},
272
- name: {},
273
- options: {},
274
- selected: {},
275
- placeholder: {},
276
- clearable: { type: Boolean },
277
- searchFrom: {}
278
- }, { ...re, selected: null, placeholder: void 0, clearable: !1, searchFrom: 9 }), {
279
- modelValue: { default: null },
280
- modelModifiers: {}
281
- }),
282
- emits: ["update:modelValue"],
283
- setup(r) {
284
- const l = r, e = W(r, "modelValue"), { t: d } = R(), f = ee(), v = !!le(), m = P("sheet"), h = N(!1), o = qe(() => l.options, (C) => {
285
- e.value !== null && !C.some((u) => u.value === e.value) && (e.value = null);
286
- }), x = y(() => o.known.value.find((C) => C.value === e.value) ?? (l.selected?.value === e.value ? l.selected : null)), S = y(() => l.placeholder ?? d("core.form.select.choose")), A = ae("popup", () => l.error ? "error" : l.disabled ? "locked" : "rest");
287
- function O(C) {
288
- e.value = C, m.value?.dismiss();
289
- }
290
- const $ = y(() => [
291
- "flex max-w-full min-w-0 items-center gap-1.5 py-1 pl-2.5 pr-2 text-body focus-visible:outline-none",
292
- v ? "compact:pl-0 compact:pr-0" : "",
293
- l.disabled ? "cursor-not-allowed" : "cursor-pointer"
294
- ]);
295
- return (C, u) => (n(), z(ne, E(t(se)(l), {
296
- value: x.value?.label ?? null
297
- }), {
298
- default: D(({ id: p, describedby: k, invalid: a }) => [
299
- s("div", {
300
- class: g(["inline-flex max-w-full min-w-0", t(A)])
301
- }, [
302
- t(f) ? (n(), b("button", {
303
- key: 0,
304
- id: p,
305
- type: "button",
306
- disabled: l.disabled,
307
- "aria-haspopup": "dialog",
308
- "aria-expanded": h.value,
309
- "aria-required": l.required || void 0,
310
- "aria-invalid": a || void 0,
311
- "aria-describedby": k,
312
- "aria-busy": t(o).loading.value || void 0,
313
- class: g($.value),
314
- onClick: u[0] || (u[0] = (i) => m.value?.present())
315
- }, [
316
- s("span", {
317
- class: g(["min-w-0 truncate", x.value ? v ? "text-content-strong compact:text-content-muted" : "text-content-strong" : "text-content-disabled"])
318
- }, w(x.value?.label ?? S.value), 3),
319
- L(t(V), {
320
- name: t(o).loading.value ? "loader4Line" : "expandUpDownLine",
321
- size: 14,
322
- class: g(["shrink-0 text-content-muted", t(o).loading.value ? "animate-spin" : ""])
323
- }, null, 8, ["name", "class"])
324
- ], 10, ze)) : (n(), z(oe, {
325
- key: 1,
326
- label: l.label ?? S.value,
327
- width: "md",
328
- "match-trigger-width": "",
329
- placement: "bottom-start",
330
- arrow: !1
331
- }, {
332
- trigger: D(({ toggle: i, attrs: c }) => [
333
- s("button", E({
334
- id: p,
335
- type: "button"
336
- }, c, {
337
- "aria-haspopup": "listbox",
338
- disabled: l.disabled,
339
- "aria-required": l.required || void 0,
340
- "aria-invalid": a || void 0,
341
- "aria-describedby": k,
342
- "aria-busy": t(o).loading.value || void 0,
343
- class: $.value,
344
- onClick: i
345
- }), [
346
- s("span", {
347
- class: g(["min-w-0 truncate", x.value ? "text-content-strong" : "text-content-disabled"])
348
- }, w(x.value?.label ?? S.value), 3),
349
- L(t(V), {
350
- name: t(o).loading.value ? "loader4Line" : "expandUpDownLine",
351
- size: 14,
352
- class: g(["shrink-0 text-content-muted", t(o).loading.value ? "animate-spin" : ""])
353
- }, null, 8, ["name", "class"])
354
- ], 16, Ae)
355
- ]),
356
- default: D(({ dismiss: i }) => [
357
- s("div", Oe, [
358
- L(M, {
359
- options: t(o).rows.value,
360
- status: t(o).status.value,
361
- "model-value": e.value,
362
- "search-from": l.searchFrom,
363
- "none-label": l.clearable ? t(d)("core.form.select.clear") : void 0,
364
- presentation: "plain",
365
- onSelect: (c) => {
366
- e.value = c, i();
367
- },
368
- onRetry: u[1] || (u[1] = (c) => t(o).reload())
369
- }, null, 8, ["options", "status", "model-value", "search-from", "none-label", "onSelect"])
370
- ])
371
- ]),
372
- _: 2
373
- }, 1032, ["label"]))
374
- ], 2),
375
- t(f) ? (n(), z(te, {
376
- key: 0,
377
- ref_key: "sheet",
378
- ref: m,
379
- title: l.label ?? S.value,
380
- grouped: "",
381
- onPresented: u[4] || (u[4] = (i) => h.value = !0),
382
- onDismissed: u[5] || (u[5] = (i) => h.value = !1)
383
- }, J({
384
- default: D(() => [
385
- L(M, {
386
- options: t(o).rows.value,
387
- status: t(o).status.value,
388
- "model-value": e.value,
389
- "search-from": l.searchFrom,
390
- "none-label": l.clearable ? t(d)("core.form.select.clear") : void 0,
391
- onSelect: O,
392
- onRetry: u[2] || (u[2] = (i) => t(o).reload())
393
- }, null, 8, ["options", "status", "model-value", "search-from", "none-label"])
394
- ]),
395
- _: 2
396
- }, [
397
- l.clearable && e.value !== null ? {
398
- name: "footer",
399
- fn: D(() => [
400
- L(Z, {
401
- prominence: "plain",
402
- onClick: u[3] || (u[3] = (i) => O(null))
403
- }, {
404
- default: D(() => [
405
- Q(w(t(d)("core.form.select.clear")), 1)
406
- ]),
407
- _: 1
408
- })
409
- ]),
410
- key: "0"
411
- } : void 0
412
- ]), 1032, ["title"])) : _("", !0)
413
- ]),
414
- _: 1
415
- }, 16, ["value"]));
416
- }
417
- });
418
- export {
419
- Ge as _,
420
- M as a,
421
- je as b,
422
- qe as u
423
- };
@@ -1,194 +0,0 @@
1
- import { hasInjectionContext as z, inject as $, watch as _ } from "vue";
2
- import { g as O } from "./platform-q3cjODLx.js";
3
- const j = [5, 8, 10, 15, 25, 50, 100], E = 25;
4
- function U(e) {
5
- const t = `defineCollection("${e.id}")`;
6
- if (typeof e.id != "string" || e.id.trim() === "") throw new Error("defineCollection: `id` must be a non-empty string.");
7
- if (!Number.isInteger(e.stateVersion) || e.stateVersion < 1) throw new Error(`${t}: \`stateVersion\` must be a positive integer.`);
8
- if (typeof e.load != "function") throw new Error(`${t}: \`load\` must be a function.`);
9
- if (typeof e.key != "function") throw new Error(`${t}: \`key\` must be a function.`);
10
- const r = {
11
- sorts: e.query?.sorts ? [...e.query.sorts] : null,
12
- filters: e.query?.filters ? [...e.query.filters] : null,
13
- views: e.query?.views ? [...e.query.views] : null,
14
- sensitive: [...e.query?.sensitive ?? []],
15
- pageSizes: [...e.query?.pageSizes ?? j],
16
- search: e.query?.search ?? !0
17
- };
18
- if (r.pageSizes.length === 0 || r.pageSizes.some((c) => !Number.isInteger(c) || c < 1))
19
- throw new Error(`${t}: \`query.pageSizes\` must list positive integers.`);
20
- for (const c of r.sensitive)
21
- if (r.filters && !r.filters.includes(c)) throw new Error(`${t}: sensitive filter "${c}" is not in \`query.filters\`.`);
22
- const s = e.defaults ?? {}, n = s.pageSize ?? (r.pageSizes.includes(E) ? E : r.pageSizes[0]);
23
- if (!r.pageSizes.includes(n)) throw new Error(`${t}: default page size ${n} is not one of ${r.pageSizes.join(", ")}.`);
24
- const o = s.sort ?? null;
25
- if (o !== null && r.sorts && !r.sorts.includes(o)) throw new Error(`${t}: default sort "${o}" is not in \`query.sorts\`.`);
26
- const i = s.view ?? null;
27
- if (i !== null && r.views && !r.views.includes(i)) throw new Error(`${t}: default view "${i}" is not in \`query.views\`.`);
28
- const a = Object.fromEntries(Object.entries(s.filters ?? {}).filter(([, c]) => c !== void 0 && c !== ""));
29
- for (const c of Object.keys(a))
30
- if (r.filters && !r.filters.includes(c)) throw new Error(`${t}: default filter "${c}" is not in \`query.filters\`.`);
31
- const l = s.page ?? 1;
32
- if (!Number.isInteger(l) || l < 1) throw new Error(`${t}: default page must be a positive integer.`);
33
- const f = s.direction ?? "asc";
34
- if (f !== "asc" && f !== "desc") throw new Error(`${t}: default direction must be "asc" or "desc".`);
35
- return Object.freeze({
36
- id: e.id,
37
- stateVersion: e.stateVersion,
38
- load: e.load,
39
- key: e.key,
40
- defaults: Object.freeze({
41
- page: l,
42
- pageSize: n,
43
- sort: o,
44
- direction: f,
45
- search: s.search ?? "",
46
- view: i,
47
- filters: Object.freeze(a)
48
- }),
49
- contract: Object.freeze(r),
50
- migrate: e.migrate
51
- });
52
- }
53
- const X = "from";
54
- function F(e, t) {
55
- if (typeof e == "string") {
56
- const r = new URLSearchParams(t).toString(), s = e.indexOf("#"), n = s === -1 ? e : e.slice(0, s);
57
- return `${n}${n.includes("?") ? "&" : "?"}${r}${s === -1 ? "" : e.slice(s)}`;
58
- }
59
- return { ...e, query: { ...e.query, ...t } };
60
- }
61
- function G(e) {
62
- if (!z()) return;
63
- const t = $(O, null);
64
- t && _(
65
- () => {
66
- const r = t.session.state.value;
67
- return r.status === "authenticated" ? r.user.id : null;
68
- },
69
- e,
70
- { flush: "sync" }
71
- );
72
- }
73
- const I = 4096, k = 200, T = 32, N = 1e6, v = /^[A-Za-z0-9_.-]{1,64}$/;
74
- function C(e) {
75
- let t = "";
76
- for (const r of new TextEncoder().encode(e)) t += String.fromCharCode(r);
77
- return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
78
- }
79
- function M(e) {
80
- const t = e.replace(/-/g, "+").replace(/_/g, "/"), r = atob(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
81
- return new TextDecoder("utf-8", { fatal: !0 }).decode(Uint8Array.from(r, (s) => s.charCodeAt(0)));
82
- }
83
- const S = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
84
- function m(e, t = k) {
85
- return typeof e == "string" && e.length <= t ? e : null;
86
- }
87
- function A(e, t) {
88
- const { defaults: r, contract: s } = e, n = typeof t.p == "number" && Number.isInteger(t.p) && t.p >= 1 && t.p <= N ? t.p : r.page, o = typeof t.l == "number" && s.pageSizes.includes(t.l) ? t.l : r.pageSize;
89
- let i = r.sort;
90
- const a = m(t.c, 64);
91
- a !== null && (s.sorts ? s.sorts.includes(a) : v.test(a)) && (i = a);
92
- const l = t.d === "asc" || t.d === "desc" ? t.d : r.direction, f = m(t.s) ?? r.search;
93
- let c = r.view;
94
- const g = m(t.w, 64);
95
- g !== null && (s.views ? s.views.includes(g) : v.test(g)) && (c = g);
96
- const w = S(t.f) ? {} : { ...r.filters };
97
- if (S(t.f)) {
98
- let y = 0;
99
- for (const [u, h] of Object.entries(t.f)) {
100
- if (++y > T) break;
101
- if (!(s.filters ? s.filters.includes(u) : v.test(u)) || s.sensitive.includes(u)) continue;
102
- const b = typeof h == "number" || typeof h == "boolean" ? String(h) : m(h);
103
- b !== null && b !== "" && (w[u] = b);
104
- }
105
- }
106
- return { page: n, pageSize: o, sort: i, direction: l, search: f, view: c, filters: w };
107
- }
108
- function J(e, t) {
109
- const r = { v: e.stateVersion, p: t.page, l: t.pageSize };
110
- t.sort && (r.c = t.sort), r.d = t.direction, t.search && (r.s = t.search), t.view && (r.w = t.view);
111
- const s = Object.fromEntries(
112
- Object.entries(t.filters).filter(([n, o]) => o !== void 0 && o !== "" && !e.contract.sensitive.includes(n))
113
- );
114
- return (Object.keys(s).length > 0 || Object.keys(e.defaults.filters).length > 0) && (r.f = s), C(JSON.stringify(r));
115
- }
116
- function x(e, t) {
117
- const r = t.v === void 0 ? e.stateVersion : t.v;
118
- if (typeof r != "number" || !Number.isInteger(r)) return null;
119
- if (r === e.stateVersion) return A(e, t);
120
- const s = e.migrate?.(t, r);
121
- return s ? A(e, s) : null;
122
- }
123
- function Z(e, t) {
124
- if (typeof t != "string" || t === "" || t.length > I) return null;
125
- let r;
126
- try {
127
- r = JSON.parse(M(t));
128
- } catch {
129
- return null;
130
- }
131
- return S(r) ? x(e, r) : null;
132
- }
133
- function B(e) {
134
- return JSON.stringify([
135
- e.page,
136
- e.pageSize,
137
- e.sort,
138
- e.direction,
139
- e.search,
140
- e.view,
141
- Object.entries(e.filters).sort(([t], [r]) => t.localeCompare(r))
142
- ]);
143
- }
144
- const d = (e) => typeof e == "object" && e !== null && !Array.isArray(e), p = (...e) => {
145
- for (const t of e) if (typeof t == "number" && Number.isFinite(t)) return t;
146
- return null;
147
- };
148
- function L(e) {
149
- return {
150
- // Filters first: the reserved names below always win, a filter called "page" cannot break paging.
151
- ...e.filters,
152
- page: e.page,
153
- per_page: e.pageSize,
154
- order_col: e.sort,
155
- order_dir: e.sort ? e.direction : null,
156
- search: e.search,
157
- view: e.view
158
- };
159
- }
160
- function P(e, t) {
161
- const r = e.data, s = d(r) && Array.isArray(r.data), n = Array.isArray(r) ? r : s ? r.data : [], o = s ? r : {}, i = d(e.meta) ? e.meta : d(o.meta) ? o.meta : {}, a = p(o.per_page, i.per_page) ?? t.pageSize, l = p(o.total, i.total) ?? n.length, f = p(o.current_page, i.page, i.current_page) ?? t.page, c = p(o.last_page, i.last_page) ?? (l === 0 ? 0 : Math.ceil(l / Math.max(1, a))), g = p(o.from, i.from) ?? (n.length === 0 ? 0 : (f - 1) * a + 1), w = p(o.to, i.to) ?? (n.length === 0 ? 0 : g + n.length - 1), y = Array.isArray(i.views) ? i.views : Array.isArray(o.views) ? o.views : void 0;
162
- return {
163
- rows: n,
164
- total: l,
165
- page: f,
166
- pageSize: a,
167
- lastPage: c,
168
- from: g,
169
- to: w,
170
- views: y?.filter(d).flatMap((u) => typeof u.key == "string" ? [{ key: u.key, count: p(u.count) ?? void 0 }] : []),
171
- meta: i,
172
- requestId: e.requestId
173
- };
174
- }
175
- function K(e, t, r = {}) {
176
- return async (s, { signal: n }) => {
177
- const o = await e.get(t, { query: r.params ? r.params(s) : L(s), signal: n });
178
- return P(o, s);
179
- };
180
- }
181
- export {
182
- j as D,
183
- X as L,
184
- U as a,
185
- x as b,
186
- Z as d,
187
- J as e,
188
- K as h,
189
- L as l,
190
- G as o,
191
- B as q,
192
- P as r,
193
- F as w
194
- };