@aeria-ui/ui 0.0.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/LICENSE +19 -0
- package/README.md +11 -0
- package/dist/activation-c458cc9b.js +83 -0
- package/dist/components/aeria-accordion/aeria-accordion.vue.d.ts +24 -0
- package/dist/components/aeria-badge/aeria-badge.vue.d.ts +22 -0
- package/dist/components/aeria-bare-button/aeria-bare-button.vue.d.ts +25 -0
- package/dist/components/aeria-button/aeria-button.vue.d.ts +30 -0
- package/dist/components/aeria-card/aeria-card.vue.d.ts +25 -0
- package/dist/components/aeria-context-menu/aeria-context-menu.vue.d.ts +38 -0
- package/dist/components/aeria-crud/_internals/components/aeria-filter-panel/aeria-filter-panel.vue.d.ts +6 -0
- package/dist/components/aeria-crud/_internals/components/aeria-insert-panel/aeria-insert-panel.vue.d.ts +7 -0
- package/dist/components/aeria-crud/_internals/helpers.d.ts +6 -0
- package/dist/components/aeria-crud/_internals/layouts/aeria-grid/aeria-grid.vue.d.ts +18 -0
- package/dist/components/aeria-crud/_internals/layouts/aeria-tabular/aeria-tabular.vue.d.ts +24 -0
- package/dist/components/aeria-crud/_internals/layouts/index.d.ts +98 -0
- package/dist/components/aeria-crud/_internals/store.d.ts +24 -0
- package/dist/components/aeria-crud/aeria-crud.vue.d.ts +45 -0
- package/dist/components/aeria-grid/aeria-grid.vue.d.ts +21 -0
- package/dist/components/aeria-icon/aeria-icon.vue.d.ts +27 -0
- package/dist/components/aeria-info/aeria-info.vue.d.ts +22 -0
- package/dist/components/aeria-main/aeria-main.vue.d.ts +9 -0
- package/dist/components/aeria-menu/aeria-menu.vue.d.ts +7 -0
- package/dist/components/aeria-pagination/aeria-pagination.vue.d.ts +19 -0
- package/dist/components/aeria-panel/aeria-panel.vue.d.ts +75 -0
- package/dist/components/aeria-picture/aeria-picture.vue.d.ts +37 -0
- package/dist/components/aeria-table/aeria-table.vue.d.ts +42 -0
- package/dist/components/aeria-tabs/aeria-tabs.vue.d.ts +23 -0
- package/dist/components/dashboard/aeria-crud-topbar/aeria-crud-topbar.vue.d.ts +14 -0
- package/dist/components/dashboard/aeria-password-form/aeria-password-form.vue.d.ts +36 -0
- package/dist/components/dashboard/aeria-prompt/aeria-prompt.vue.d.ts +23 -0
- package/dist/components/dashboard/aeria-toast/aeria-toast.vue.d.ts +25 -0
- package/dist/components/dashboard/index.d.ts +4 -0
- package/dist/components/form/aeria-checkbox/aeria-checkbox.vue.d.ts +84 -0
- package/dist/components/form/aeria-file/aeria-file.vue.d.ts +26 -0
- package/dist/components/form/aeria-form/_internals/helpers.d.ts +4 -0
- package/dist/components/form/aeria-form/aeria-form.vue.d.ts +88 -0
- package/dist/components/form/aeria-input/aeria-input.vue.d.ts +35 -0
- package/dist/components/form/aeria-options/aeria-options.vue.d.ts +41 -0
- package/dist/components/form/aeria-search/_internals/components/aeria-search-container/aeria-search-container.vue.d.ts +26 -0
- package/dist/components/form/aeria-search/_internals/components/aeria-search-item/aeria-search-item.vue.d.ts +31 -0
- package/dist/components/form/aeria-search/aeria-search.vue.d.ts +40 -0
- package/dist/components/form/aeria-select/aeria-select.vue.d.ts +31 -0
- package/dist/components/form/aeria-switch/aeria-switch.vue.d.ts +34 -0
- package/dist/components/form/index.d.ts +8 -0
- package/dist/components/form/types.d.ts +9 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/utils/aeria-async.d.ts +41 -0
- package/dist/components/utils/index.d.ts +1 -0
- package/dist/crud-view-0cee3962.js +31 -0
- package/dist/index-8ee4cf77.js +3259 -0
- package/dist/index.d.ts +2 -0
- package/dist/less/main.less +3 -0
- package/dist/less/polyfill.less +37 -0
- package/dist/less/spinner.less +47 -0
- package/dist/less/theme.less +10 -0
- package/dist/less/utilities.less +27 -0
- package/dist/password-change-845c176d.js +53 -0
- package/dist/profile-dc78782e.js +133 -0
- package/dist/routes.d.ts +4 -0
- package/dist/signin-596dcc4b.js +83 -0
- package/dist/signup-33a15c17.js +112 -0
- package/dist/style.css +1 -0
- package/dist/ui.js +42 -0
- package/dist/views/dashboard/crud-view/crud-view.vue.d.ts +21 -0
- package/dist/views/dashboard/user/password-change/password-change.vue.d.ts +2 -0
- package/dist/views/dashboard/user/profile/profile.vue.d.ts +9 -0
- package/dist/views/user/activation.vue.d.ts +2 -0
- package/dist/views/user/signin.vue.d.ts +2 -0
- package/dist/views/user/signup.vue.d.ts +2 -0
- package/package.json +52 -0
- package/themes/dark.less +21 -0
- package/themes/light.less +21 -0
- package/vue.d.ts +7 -0
|
@@ -0,0 +1,3259 @@
|
|
|
1
|
+
import { defineComponent as U, ref as Y, resolveDirective as ee, openBlock as n, createElementBlock as l, normalizeClass as W, Fragment as K, renderList as H, withDirectives as P, toDisplayString as w, createCommentVNode as f, createTextVNode as Q, unref as t, renderSlot as C, inject as ve, computed as D, createElementVNode as V, mergeProps as G, createBlock as g, resolveDynamicComponent as ye, withCtx as _, useCssVars as bt, Teleport as Ge, watch as re, createVNode as M, vModelDynamic as gt, onBeforeMount as vt, normalizeStyle as $e, withModifiers as Fe, pushScopeId as qe, popScopeId as Ue, provide as fe, onMounted as kt, isRef as Se, normalizeProps as ae, guardReactiveProps as be, createSlots as de, vModelCheckbox as Vt, onUnmounted as Ct, resolveComponent as At, Suspense as It, useSlots as Ot, h as wt } from "vue";
|
|
2
|
+
import { t as z } from "@aeria-ui/i18n";
|
|
3
|
+
import { useScrollObserver as We, useBreakpoints as je, useClipboard as Bt, PAGINATION_PER_PAGE_DEFAULTS as St, API_URL as ft, request as jt, useDebounce as yt, isDocumentComplete as Tt, convertToSearchQuery as it, useAction as Lt, convertFromSearchQuery as Rt, usePasswordPolicy as Ft } from "@aeria-ui/web";
|
|
4
|
+
import { useStore as ue, getStoreId as Te, useParentStore as ge, STORE_ID as Ee } from "@aeria-ui/state-management";
|
|
5
|
+
import { useRouter as Le } from "vue-router";
|
|
6
|
+
import { getReferenceProperty as pe, convertConditionToQuery as Mt, deepClone as Be, freshItem as qt, isRequired as Ut, evaluateCondition as Qe, isLeft as Et } from "@aeriajs/common";
|
|
7
|
+
import { vMaska as zt } from "maska";
|
|
8
|
+
const Ht = ["onClick"], Dt = { key: 0 }, Qt = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "accordion__content"
|
|
11
|
+
}, Gt = /* @__PURE__ */ U({
|
|
12
|
+
__name: "aeria-accordion",
|
|
13
|
+
props: {
|
|
14
|
+
enumerate: { type: Boolean },
|
|
15
|
+
noPadding: { type: Boolean },
|
|
16
|
+
headers: {}
|
|
17
|
+
},
|
|
18
|
+
setup(c) {
|
|
19
|
+
const u = Y(null), e = (a) => typeof a == "string" ? a : a.title;
|
|
20
|
+
return (a, s) => {
|
|
21
|
+
const r = ee("clickable");
|
|
22
|
+
return n(), l("div", {
|
|
23
|
+
class: W({
|
|
24
|
+
accordion: !0,
|
|
25
|
+
"accordion--padded": !a.noPadding
|
|
26
|
+
})
|
|
27
|
+
}, [
|
|
28
|
+
(n(!0), l(K, null, H(Object.keys(a.$slots).filter((i) => i !== "default"), (i, y) => (n(), l("div", {
|
|
29
|
+
key: i,
|
|
30
|
+
class: "accordion__slot"
|
|
31
|
+
}, [
|
|
32
|
+
P((n(), l("div", {
|
|
33
|
+
class: "accordion__header",
|
|
34
|
+
onClick: (m) => u.value === i ? u.value = null : u.value = i
|
|
35
|
+
}, [
|
|
36
|
+
a.enumerate ? (n(), l("span", Dt, w(y + 1) + ". ", 1)) : f("", !0),
|
|
37
|
+
Q(" " + w(a.headers[i] ? e(a.headers[i]) : t(z)(i)), 1)
|
|
38
|
+
], 8, Ht)), [
|
|
39
|
+
[r]
|
|
40
|
+
]),
|
|
41
|
+
u.value === i ? (n(), l("div", Qt, [
|
|
42
|
+
C(a.$slots, i, {}, void 0, !0)
|
|
43
|
+
])) : f("", !0)
|
|
44
|
+
]))), 128))
|
|
45
|
+
], 2);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const X = (c, u) => {
|
|
50
|
+
const e = c.__vccOpts || c;
|
|
51
|
+
for (const [a, s] of u)
|
|
52
|
+
e[a] = s;
|
|
53
|
+
return e;
|
|
54
|
+
}, Bs = /* @__PURE__ */ X(Gt, [["__scopeId", "data-v-3ea933d4"]]), Wt = /* @__PURE__ */ U({
|
|
55
|
+
__name: "aeria-badge",
|
|
56
|
+
props: {
|
|
57
|
+
large: { type: Boolean },
|
|
58
|
+
alt: { type: Boolean }
|
|
59
|
+
},
|
|
60
|
+
setup(c) {
|
|
61
|
+
return (u, e) => (n(), l("div", {
|
|
62
|
+
class: W(`
|
|
63
|
+
badge
|
|
64
|
+
${u.large && "badge--large"}
|
|
65
|
+
${u.alt && "badge--alt"}
|
|
66
|
+
`)
|
|
67
|
+
}, [
|
|
68
|
+
C(u.$slots, "default", {}, void 0, !0)
|
|
69
|
+
], 2));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const he = /* @__PURE__ */ X(Wt, [["__scopeId", "data-v-47f92648"]]), Xt = /* @__PURE__ */ U({
|
|
73
|
+
__name: "aeria-bare-button",
|
|
74
|
+
props: {
|
|
75
|
+
disabled: { type: Boolean }
|
|
76
|
+
},
|
|
77
|
+
emits: ["click"],
|
|
78
|
+
setup(c, { emit: u }) {
|
|
79
|
+
const e = c, a = u, s = (r) => {
|
|
80
|
+
e.disabled || a("click", r);
|
|
81
|
+
};
|
|
82
|
+
return (r, i) => (n(), l("button", {
|
|
83
|
+
class: W(`
|
|
84
|
+
barebutton
|
|
85
|
+
barebutton--${r.disabled ? "disabled" : "enabled"}
|
|
86
|
+
`),
|
|
87
|
+
onClick: s
|
|
88
|
+
}, [
|
|
89
|
+
C(r.$slots, "default", {}, void 0, !0)
|
|
90
|
+
], 2));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
const me = /* @__PURE__ */ X(Xt, [["__scopeId", "data-v-35bc81ae"]]), Yt = ["href"], Jt = {
|
|
94
|
+
key: 0,
|
|
95
|
+
"data-component": "icon-label"
|
|
96
|
+
}, Kt = /* @__PURE__ */ U({
|
|
97
|
+
__name: "aeria-icon",
|
|
98
|
+
props: {
|
|
99
|
+
icon: {},
|
|
100
|
+
size: {},
|
|
101
|
+
medium: { type: Boolean },
|
|
102
|
+
reactive: { type: [Boolean, null] },
|
|
103
|
+
iconRight: { type: Boolean },
|
|
104
|
+
fill: {}
|
|
105
|
+
},
|
|
106
|
+
setup(c) {
|
|
107
|
+
const u = c, e = typeof u.reactive == "boolean" ? u.reactive : ve("iconReactive", !1), a = D(() => {
|
|
108
|
+
var s;
|
|
109
|
+
return (s = u.icon) != null && s.includes(":") ? u.icon : `regular:${u.icon}`;
|
|
110
|
+
});
|
|
111
|
+
return (s, r) => (n(), l("a", {
|
|
112
|
+
class: W(`
|
|
113
|
+
icon
|
|
114
|
+
${t(e) && "icon--reactive"}
|
|
115
|
+
${s.$slots.default ? "icon--centered" : "icon--standalone"}
|
|
116
|
+
`)
|
|
117
|
+
}, [
|
|
118
|
+
V("div", {
|
|
119
|
+
class: W(`
|
|
120
|
+
icon__icon
|
|
121
|
+
${s.size && `icon__icon--${s.size}`}
|
|
122
|
+
${s.iconRight && "icon__icon--right"}
|
|
123
|
+
`)
|
|
124
|
+
}, [
|
|
125
|
+
(n(), l("svg", G({
|
|
126
|
+
width: "24",
|
|
127
|
+
height: "24",
|
|
128
|
+
viewBox: "0 0 256 256",
|
|
129
|
+
"data-component": "icon"
|
|
130
|
+
}, {
|
|
131
|
+
...s.fill ? { fill: s.fill } : {}
|
|
132
|
+
}), [
|
|
133
|
+
V("use", {
|
|
134
|
+
href: `/assets/icons.svg#${a.value}`
|
|
135
|
+
}, null, 8, Yt)
|
|
136
|
+
], 16))
|
|
137
|
+
], 2),
|
|
138
|
+
s.$slots.default ? (n(), l("div", Jt, [
|
|
139
|
+
C(s.$slots, "default", {}, void 0, !0)
|
|
140
|
+
])) : f("", !0)
|
|
141
|
+
], 2));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
const Z = /* @__PURE__ */ X(Kt, [["__scopeId", "data-v-4b763bd3"]]), Zt = { class: "panel__header-left" }, Pt = { key: 1 }, Nt = {
|
|
145
|
+
key: 2,
|
|
146
|
+
style: { "margin-left": "auto" }
|
|
147
|
+
}, xt = /* @__PURE__ */ U({
|
|
148
|
+
__name: "aeria-panel",
|
|
149
|
+
props: {
|
|
150
|
+
closeHint: { type: Boolean, default: !1 },
|
|
151
|
+
modelValue: { default: !0 },
|
|
152
|
+
title: {},
|
|
153
|
+
float: { type: Boolean },
|
|
154
|
+
fixedRight: { type: Boolean },
|
|
155
|
+
floating: { type: Boolean },
|
|
156
|
+
loading: { type: Boolean },
|
|
157
|
+
bordered: { type: Boolean },
|
|
158
|
+
animate: { type: Boolean },
|
|
159
|
+
overlay: { type: Boolean },
|
|
160
|
+
invisibleOverlay: { type: Boolean },
|
|
161
|
+
collapsed: { type: Boolean },
|
|
162
|
+
collapsible: { type: Boolean, default: !1 },
|
|
163
|
+
fullAeriaidth: { type: Boolean },
|
|
164
|
+
fill: { type: Boolean },
|
|
165
|
+
fillFooter: { type: Boolean },
|
|
166
|
+
transparent: { type: Boolean },
|
|
167
|
+
transparentMobile: { type: Boolean },
|
|
168
|
+
outerHeader: { type: Boolean },
|
|
169
|
+
overlayLayer: {}
|
|
170
|
+
},
|
|
171
|
+
emits: ["update:modelValue", "update:collapsed", "update:closeHint", "overlayClick", "close"],
|
|
172
|
+
setup(c, { emit: u }) {
|
|
173
|
+
const e = c, a = u, s = D(() => e.floating || e.float), r = Y(e.collapsed), i = Y(null), { reachedEnd: y } = We(i), m = () => {
|
|
174
|
+
a("update:modelValue", !1), a("close");
|
|
175
|
+
}, v = () => {
|
|
176
|
+
a("overlayClick");
|
|
177
|
+
}, d = (o) => {
|
|
178
|
+
a("update:collapsed", o), r.value = o;
|
|
179
|
+
};
|
|
180
|
+
return (o, $) => {
|
|
181
|
+
const b = ee("clickable"), I = ee("loading"), j = ee("overlay");
|
|
182
|
+
return o.modelValue ? P((n(), l("div", {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: W(`
|
|
185
|
+
panel
|
|
186
|
+
${o.fixedRight && "panel--fixed"}
|
|
187
|
+
`)
|
|
188
|
+
}, [
|
|
189
|
+
(n(), g(ye(
|
|
190
|
+
s.value ? "dialog" : "div"
|
|
191
|
+
), {
|
|
192
|
+
"data-component": "panel",
|
|
193
|
+
class: W(`
|
|
194
|
+
aeria-surface
|
|
195
|
+
panel__content
|
|
196
|
+
${!(s.value || o.fixedRight) && "panel__content--rounded"}
|
|
197
|
+
${s.value && "panel__content--floating"}
|
|
198
|
+
${o.animate && "panel__content--animate"}
|
|
199
|
+
${o.bordered && "panel__content--bordered-body"}
|
|
200
|
+
${o.fixedRight && "panel__content--fixed-right"}
|
|
201
|
+
${o.transparent && "panel__content--transparent"}
|
|
202
|
+
${o.transparentMobile && "panel__content--transparent-mobile"}
|
|
203
|
+
${o.outerHeader && "panel__content--outer-header"}
|
|
204
|
+
`),
|
|
205
|
+
onClick: $[1] || ($[1] = (L) => L.stopPropagation())
|
|
206
|
+
}, {
|
|
207
|
+
default: _(() => [
|
|
208
|
+
o.$slots.header || o.title ? (n(), l("div", {
|
|
209
|
+
key: 0,
|
|
210
|
+
class: W(`
|
|
211
|
+
panel__header
|
|
212
|
+
${r.value && "panel__header--collapsed"}
|
|
213
|
+
${o.outerHeader && "panel__header--outer"}
|
|
214
|
+
`)
|
|
215
|
+
}, [
|
|
216
|
+
V("div", Zt, [
|
|
217
|
+
o.$slots.header ? C(o.$slots, "header", { key: 0 }, void 0, !0) : o.title ? (n(), l("div", Pt, w(o.title), 1)) : f("", !0),
|
|
218
|
+
o.$slots.extra ? (n(), l("div", Nt, [
|
|
219
|
+
C(o.$slots, "extra", {}, void 0, !0)
|
|
220
|
+
])) : f("", !0)
|
|
221
|
+
]),
|
|
222
|
+
o.collapsible ? P((n(), g(Z, {
|
|
223
|
+
key: 0,
|
|
224
|
+
reactive: "",
|
|
225
|
+
icon: r.value ? "plus" : "minus",
|
|
226
|
+
onClick: $[0] || ($[0] = (L) => d(!r.value))
|
|
227
|
+
}, null, 8, ["icon"])), [
|
|
228
|
+
[b]
|
|
229
|
+
]) : o.closeHint ? P((n(), g(Z, {
|
|
230
|
+
key: 1,
|
|
231
|
+
reactive: "",
|
|
232
|
+
icon: "x",
|
|
233
|
+
onClick: m
|
|
234
|
+
}, null, 512)), [
|
|
235
|
+
[b]
|
|
236
|
+
]) : f("", !0)
|
|
237
|
+
], 2)) : f("", !0),
|
|
238
|
+
r.value ? f("", !0) : P((n(), l("div", {
|
|
239
|
+
key: 1,
|
|
240
|
+
ref_key: "body",
|
|
241
|
+
ref: i,
|
|
242
|
+
class: W(`
|
|
243
|
+
panel__body
|
|
244
|
+
${o.fill || "panel__body--padded"}
|
|
245
|
+
`)
|
|
246
|
+
}, [
|
|
247
|
+
C(o.$slots, "default", {}, void 0, !0)
|
|
248
|
+
], 2)), [
|
|
249
|
+
[I, o.loading]
|
|
250
|
+
]),
|
|
251
|
+
o.$slots.footer ? (n(), l("div", {
|
|
252
|
+
key: 2,
|
|
253
|
+
class: W(`
|
|
254
|
+
panel__footer
|
|
255
|
+
${o.fillFooter || "panel__footer--padded"}
|
|
256
|
+
${t(y) || "panel__footer--shadowed"}
|
|
257
|
+
`)
|
|
258
|
+
}, [
|
|
259
|
+
C(o.$slots, "footer", {}, void 0, !0)
|
|
260
|
+
], 2)) : f("", !0)
|
|
261
|
+
]),
|
|
262
|
+
_: 3
|
|
263
|
+
}, 8, ["class"]))
|
|
264
|
+
], 2)), [
|
|
265
|
+
[j, {
|
|
266
|
+
condition: o.overlay || o.fixedRight || s.value,
|
|
267
|
+
invisible: o.invisibleOverlay,
|
|
268
|
+
click: v,
|
|
269
|
+
layer: o.overlayLayer || (s.value ? 60 : o.fixedRight ? 50 : 0)
|
|
270
|
+
}]
|
|
271
|
+
]) : f("", !0);
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
const Ae = /* @__PURE__ */ X(xt, [["__scopeId", "data-v-2f015982"]]), en = { class: "button__content" }, tn = {
|
|
276
|
+
key: 1,
|
|
277
|
+
class: "button__content"
|
|
278
|
+
}, nn = /* @__PURE__ */ U({
|
|
279
|
+
__name: "aeria-button",
|
|
280
|
+
props: {
|
|
281
|
+
size: {},
|
|
282
|
+
variant: {},
|
|
283
|
+
small: { type: Boolean },
|
|
284
|
+
large: { type: Boolean },
|
|
285
|
+
icon: {},
|
|
286
|
+
disabled: { type: Boolean },
|
|
287
|
+
loading: { type: Boolean }
|
|
288
|
+
},
|
|
289
|
+
setup(c) {
|
|
290
|
+
const u = c, e = ve("buttonVariant", u.variant) || "primary", a = (() => {
|
|
291
|
+
switch (!0) {
|
|
292
|
+
case u.small:
|
|
293
|
+
return "small";
|
|
294
|
+
case u.large:
|
|
295
|
+
return "large";
|
|
296
|
+
}
|
|
297
|
+
return ve("buttonSize", u.size) || "medium";
|
|
298
|
+
})();
|
|
299
|
+
return (s, r) => (n(), g(me, {
|
|
300
|
+
class: W(`
|
|
301
|
+
button
|
|
302
|
+
button--${t(e)}
|
|
303
|
+
button--${t(a)}
|
|
304
|
+
${s.loading && "button--loading"}
|
|
305
|
+
`),
|
|
306
|
+
disabled: s.disabled
|
|
307
|
+
}, {
|
|
308
|
+
default: _(() => [
|
|
309
|
+
s.icon ? (n(), g(Z, {
|
|
310
|
+
key: 0,
|
|
311
|
+
icon: s.icon
|
|
312
|
+
}, {
|
|
313
|
+
default: _(() => [
|
|
314
|
+
V("div", en, [
|
|
315
|
+
C(s.$slots, "default", {}, void 0, !0)
|
|
316
|
+
])
|
|
317
|
+
]),
|
|
318
|
+
_: 3
|
|
319
|
+
}, 8, ["icon"])) : (n(), l("div", tn, [
|
|
320
|
+
C(s.$slots, "default", {}, void 0, !0)
|
|
321
|
+
]))
|
|
322
|
+
]),
|
|
323
|
+
_: 3
|
|
324
|
+
}, 8, ["class", "disabled"]));
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
const ie = /* @__PURE__ */ X(nn, [["__scopeId", "data-v-c328251b"]]), on = { class: "card__picture" }, an = { class: "card__footer" }, sn = { class: "card__footer-upper" }, ln = { class: "card__badge" }, rn = /* @__PURE__ */ U({
|
|
328
|
+
__name: "aeria-card",
|
|
329
|
+
props: {
|
|
330
|
+
inactive: { type: Boolean },
|
|
331
|
+
horizontal: { type: Boolean }
|
|
332
|
+
},
|
|
333
|
+
setup(c) {
|
|
334
|
+
return (u, e) => (n(), l("div", {
|
|
335
|
+
class: W(`
|
|
336
|
+
card
|
|
337
|
+
${u.inactive && "card--inactive"}
|
|
338
|
+
${u.horizontal && "card--horizontal"}
|
|
339
|
+
`)
|
|
340
|
+
}, [
|
|
341
|
+
V("div", on, [
|
|
342
|
+
C(u.$slots, "default", {}, void 0, !0)
|
|
343
|
+
]),
|
|
344
|
+
V("div", an, [
|
|
345
|
+
V("div", sn, [
|
|
346
|
+
V("div", null, [
|
|
347
|
+
C(u.$slots, "footer", {}, void 0, !0)
|
|
348
|
+
]),
|
|
349
|
+
u.$slots.actions ? C(u.$slots, "actions", { key: 0 }, void 0, !0) : f("", !0)
|
|
350
|
+
]),
|
|
351
|
+
V("div", ln, [
|
|
352
|
+
C(u.$slots, "badge", {}, void 0, !0)
|
|
353
|
+
])
|
|
354
|
+
])
|
|
355
|
+
], 2));
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
const un = /* @__PURE__ */ X(rn, [["__scopeId", "data-v-c1a322df"]]), cn = {
|
|
359
|
+
key: 0,
|
|
360
|
+
class: "content__section"
|
|
361
|
+
}, dn = { class: "content__item" }, pn = /* @__PURE__ */ U({
|
|
362
|
+
__name: "aeria-context-menu",
|
|
363
|
+
props: {
|
|
364
|
+
actions: {},
|
|
365
|
+
subject: {},
|
|
366
|
+
overlayLayer: {}
|
|
367
|
+
},
|
|
368
|
+
emits: ["actionClick"],
|
|
369
|
+
setup(c, { emit: u }) {
|
|
370
|
+
bt((v) => ({
|
|
371
|
+
"365137f9": m.value.x,
|
|
372
|
+
"365137fa": m.value.y
|
|
373
|
+
}));
|
|
374
|
+
const e = u, a = ue("user"), s = Y(null), r = Y(!1), i = (v) => v.filter((d) => d.roles ? d.roles.include(a.currentUser.role) : !!d.click), y = (v, d) => {
|
|
375
|
+
v.click(d), e("actionClick", {
|
|
376
|
+
action: v,
|
|
377
|
+
subject: d
|
|
378
|
+
}), r.value = !1;
|
|
379
|
+
}, m = D(() => {
|
|
380
|
+
if (!s.value)
|
|
381
|
+
return {
|
|
382
|
+
x: 0,
|
|
383
|
+
y: 0
|
|
384
|
+
};
|
|
385
|
+
const v = s.value.getBoundingClientRect().top, d = s.value.getBoundingClientRect().left, o = s.value.offsetHeight;
|
|
386
|
+
return {
|
|
387
|
+
_: r.value,
|
|
388
|
+
x: Math.floor(d) + "px",
|
|
389
|
+
y: Math.floor(v + o) + "px"
|
|
390
|
+
};
|
|
391
|
+
});
|
|
392
|
+
return (v, d) => {
|
|
393
|
+
var $;
|
|
394
|
+
const o = ee("overlay");
|
|
395
|
+
return n(), l(K, null, [
|
|
396
|
+
Object.keys(v.$slots).some((b) => b !== "default") || (($ = v.actions) == null ? void 0 : $.length) > 0 ? (n(), l("div", {
|
|
397
|
+
key: 0,
|
|
398
|
+
ref_key: "contextmenu",
|
|
399
|
+
ref: s,
|
|
400
|
+
class: "contextmenu"
|
|
401
|
+
}, [
|
|
402
|
+
V("a", {
|
|
403
|
+
class: "contextmenu__trigger",
|
|
404
|
+
onClick: d[0] || (d[0] = (b) => r.value = !0)
|
|
405
|
+
}, [
|
|
406
|
+
C(v.$slots, "default", {}, void 0, !0)
|
|
407
|
+
])
|
|
408
|
+
], 512)) : f("", !0),
|
|
409
|
+
r.value ? (n(), g(Ge, {
|
|
410
|
+
key: 1,
|
|
411
|
+
to: "main"
|
|
412
|
+
}, [
|
|
413
|
+
P((n(), g(Ae, {
|
|
414
|
+
modelValue: r.value,
|
|
415
|
+
"onUpdate:modelValue": d[4] || (d[4] = (b) => r.value = b),
|
|
416
|
+
animate: "",
|
|
417
|
+
fill: "",
|
|
418
|
+
class: "content"
|
|
419
|
+
}, {
|
|
420
|
+
default: _(() => {
|
|
421
|
+
var b;
|
|
422
|
+
return [
|
|
423
|
+
V("div", null, [
|
|
424
|
+
v.$slots.header ? (n(), l("div", cn, [
|
|
425
|
+
C(v.$slots, "header", {}, void 0, !0)
|
|
426
|
+
])) : f("", !0),
|
|
427
|
+
Object.keys(v.$slots).filter((I) => !["default", "extra", "header"].includes(I)).length > 0 ? (n(), l("div", {
|
|
428
|
+
key: 1,
|
|
429
|
+
class: "content__section",
|
|
430
|
+
onClick: d[1] || (d[1] = (I) => r.value = !1)
|
|
431
|
+
}, [
|
|
432
|
+
(n(!0), l(K, null, H(Object.keys(v.$slots).filter((I) => !["default", "extra", "header"].includes(I)), (I, j) => (n(), g(me, {
|
|
433
|
+
key: `slot-${j}`,
|
|
434
|
+
class: "content__item content__item--reactive"
|
|
435
|
+
}, {
|
|
436
|
+
default: _(() => [
|
|
437
|
+
C(v.$slots, I, {}, void 0, !0)
|
|
438
|
+
]),
|
|
439
|
+
_: 2
|
|
440
|
+
}, 1024))), 128))
|
|
441
|
+
])) : f("", !0),
|
|
442
|
+
((b = v.actions) == null ? void 0 : b.length) > 0 ? (n(), l("div", {
|
|
443
|
+
key: 2,
|
|
444
|
+
class: "content__section",
|
|
445
|
+
onClick: d[2] || (d[2] = (I) => r.value = !1)
|
|
446
|
+
}, [
|
|
447
|
+
(n(!0), l(K, null, H(i(v.actions), (I, j) => (n(), g(me, {
|
|
448
|
+
key: `action-${j}`,
|
|
449
|
+
class: "content__item content__item--reactive",
|
|
450
|
+
onClick: (L) => y(I, v.subject)
|
|
451
|
+
}, {
|
|
452
|
+
default: _(() => [
|
|
453
|
+
I.icon ? (n(), g(Z, {
|
|
454
|
+
key: 0,
|
|
455
|
+
icon: I.icon
|
|
456
|
+
}, {
|
|
457
|
+
default: _(() => [
|
|
458
|
+
Q(w(I.translate ? t(z)(I.name) : I.name), 1)
|
|
459
|
+
]),
|
|
460
|
+
_: 2
|
|
461
|
+
}, 1032, ["icon"])) : f("", !0)
|
|
462
|
+
]),
|
|
463
|
+
_: 2
|
|
464
|
+
}, 1032, ["onClick"]))), 128))
|
|
465
|
+
])) : f("", !0),
|
|
466
|
+
v.$slots.extra ? (n(), l("div", {
|
|
467
|
+
key: 3,
|
|
468
|
+
class: "content__section",
|
|
469
|
+
onClick: d[3] || (d[3] = (I) => r.value = !1)
|
|
470
|
+
}, [
|
|
471
|
+
V("div", dn, [
|
|
472
|
+
v.$slots.extra ? C(v.$slots, "extra", { key: 0 }, void 0, !0) : f("", !0)
|
|
473
|
+
])
|
|
474
|
+
])) : f("", !0)
|
|
475
|
+
])
|
|
476
|
+
];
|
|
477
|
+
}),
|
|
478
|
+
_: 3
|
|
479
|
+
}, 8, ["modelValue"])), [
|
|
480
|
+
[
|
|
481
|
+
o,
|
|
482
|
+
{
|
|
483
|
+
layer: v.overlayLayer,
|
|
484
|
+
click: () => {
|
|
485
|
+
r.value = !1;
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
void 0,
|
|
489
|
+
{ invisibleOnLarge: !0 }
|
|
490
|
+
]
|
|
491
|
+
])
|
|
492
|
+
])) : f("", !0)
|
|
493
|
+
], 64);
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
const Ve = /* @__PURE__ */ X(pn, [["__scopeId", "data-v-28e185ef"]]), _n = { class: "info__content" }, mn = /* @__PURE__ */ U({
|
|
498
|
+
__name: "aeria-info",
|
|
499
|
+
props: {
|
|
500
|
+
where: {}
|
|
501
|
+
},
|
|
502
|
+
setup(c) {
|
|
503
|
+
const u = c, e = je(), a = Y(!1), s = u.where || "top";
|
|
504
|
+
return (r, i) => t(e).md ? (n(), l("div", {
|
|
505
|
+
key: 0,
|
|
506
|
+
class: "info",
|
|
507
|
+
onMouseleave: i[1] || (i[1] = (y) => a.value = !1)
|
|
508
|
+
}, [
|
|
509
|
+
a.value ? (n(), l("div", {
|
|
510
|
+
key: 0,
|
|
511
|
+
class: W(`
|
|
512
|
+
info__bubble
|
|
513
|
+
info__bubble--${t(s)}
|
|
514
|
+
`)
|
|
515
|
+
}, [
|
|
516
|
+
V("div", _n, [
|
|
517
|
+
C(r.$slots, "text", {}, void 0, !0)
|
|
518
|
+
])
|
|
519
|
+
], 2)) : f("", !0),
|
|
520
|
+
V("div", {
|
|
521
|
+
onMouseover: i[0] || (i[0] = (y) => a.value = !0)
|
|
522
|
+
}, [
|
|
523
|
+
C(r.$slots, "default", {}, void 0, !0)
|
|
524
|
+
], 32)
|
|
525
|
+
], 32)) : C(r.$slots, "default", { key: 1 }, void 0, !0);
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
const vn = /* @__PURE__ */ X(mn, [["__scopeId", "data-v-b4b7dab5"]]), fn = { class: "input" }, yn = {
|
|
529
|
+
key: 0,
|
|
530
|
+
class: "input__label"
|
|
531
|
+
}, $n = {
|
|
532
|
+
key: 1,
|
|
533
|
+
class: "input__hint"
|
|
534
|
+
}, hn = ["placeholder", "readonly", "value"], bn = ["value", "data-maska"], gn = {
|
|
535
|
+
key: 1,
|
|
536
|
+
class: "input__clipboard"
|
|
537
|
+
}, kn = /* @__PURE__ */ U({
|
|
538
|
+
__name: "aeria-input",
|
|
539
|
+
props: {
|
|
540
|
+
modelValue: {},
|
|
541
|
+
property: {},
|
|
542
|
+
propertyName: {},
|
|
543
|
+
parentPropertyName: {},
|
|
544
|
+
parentCollection: {},
|
|
545
|
+
variant: {}
|
|
546
|
+
},
|
|
547
|
+
emits: ["update:modelValue", "input", "change"],
|
|
548
|
+
setup(c, { emit: u }) {
|
|
549
|
+
const e = c, a = e.property || {}, s = "icon" in a || "inputType" in a && a.inputType === "search", r = ve("searchOnly", !1), i = ve("innerInputLabel", !1), y = !r && a.readOnly, m = Bt(), v = u, d = ve("inputVariant", e.variant) || "normal", o = {
|
|
550
|
+
type: (() => {
|
|
551
|
+
if ("type" in a)
|
|
552
|
+
switch (a.type) {
|
|
553
|
+
case "number":
|
|
554
|
+
case "integer":
|
|
555
|
+
return "number";
|
|
556
|
+
}
|
|
557
|
+
if (a.inputType)
|
|
558
|
+
return a.inputType;
|
|
559
|
+
switch (typeof e.modelValue) {
|
|
560
|
+
case "string":
|
|
561
|
+
return "text";
|
|
562
|
+
case "number":
|
|
563
|
+
return "number";
|
|
564
|
+
default:
|
|
565
|
+
return "text";
|
|
566
|
+
}
|
|
567
|
+
})(),
|
|
568
|
+
placeholder: i ? a.description || e.propertyName : a.placeholder
|
|
569
|
+
};
|
|
570
|
+
"type" in a && (a.type === "number" && (o.min = a.minimum || a.exclusiveMinimum, o.max = a.maximum || a.exclusiveMaximum), o.name = e.propertyName, o.readonly = y, a.type === "string" && [
|
|
571
|
+
"date",
|
|
572
|
+
"date-time"
|
|
573
|
+
].includes(a.format) && (o.type = !r && a.format === "date-time" ? "datetime-local" : "date")), o.type === "text" && r && (o.type = "search");
|
|
574
|
+
const $ = () => {
|
|
575
|
+
try {
|
|
576
|
+
return e.modelValue ? new Date(e.modelValue).toISOString().split("T").shift() : "";
|
|
577
|
+
} catch {
|
|
578
|
+
return "";
|
|
579
|
+
}
|
|
580
|
+
}, b = Y([
|
|
581
|
+
"date",
|
|
582
|
+
"date-time"
|
|
583
|
+
].includes(o.type) ? $() : e.modelValue === null || e.modelValue === void 0 ? "" : e.modelValue), I = (L) => {
|
|
584
|
+
const q = (() => {
|
|
585
|
+
if (o.type === "number")
|
|
586
|
+
return Number(L);
|
|
587
|
+
if (!("type" in a && a.type === "string"))
|
|
588
|
+
return L;
|
|
589
|
+
switch (a.format) {
|
|
590
|
+
case "date":
|
|
591
|
+
case "date-time":
|
|
592
|
+
return new Date(L);
|
|
593
|
+
default:
|
|
594
|
+
return L;
|
|
595
|
+
}
|
|
596
|
+
})();
|
|
597
|
+
v("input", q), v("update:modelValue", q);
|
|
598
|
+
}, j = (L, q) => {
|
|
599
|
+
const { masked: O } = q || {}, oe = b.value = L.target.value, x = O ? L.detail.unmasked : oe;
|
|
600
|
+
I(x);
|
|
601
|
+
};
|
|
602
|
+
return re(() => e.modelValue, (L, q) => {
|
|
603
|
+
L instanceof Date || (q && !L ? b.value = void 0 : L && q === void 0 && (b.value = L));
|
|
604
|
+
}), (L, q) => {
|
|
605
|
+
const O = ee("focus"), oe = ee("clickable");
|
|
606
|
+
return n(), l("label", fn, [
|
|
607
|
+
t(i) ? f("", !0) : (n(), l("div", yn, [
|
|
608
|
+
L.$slots.default ? C(L.$slots, "default", { key: 0 }, void 0, !0) : C(L.$slots, "description", { key: 1 }, void 0, !0)
|
|
609
|
+
])),
|
|
610
|
+
L.$slots.hint ? (n(), l("div", $n, [
|
|
611
|
+
C(L.$slots, "hint", {}, void 0, !0)
|
|
612
|
+
])) : f("", !0),
|
|
613
|
+
"element" in t(a) && t(a).element === "textarea" ? (n(), l("div", {
|
|
614
|
+
key: 2,
|
|
615
|
+
class: W(`
|
|
616
|
+
input__container
|
|
617
|
+
input__container--${t(d)}
|
|
618
|
+
`)
|
|
619
|
+
}, [
|
|
620
|
+
P(V("textarea", {
|
|
621
|
+
placeholder: o.placeholder,
|
|
622
|
+
readonly: o.readonly,
|
|
623
|
+
value: L.modelValue,
|
|
624
|
+
class: W(`
|
|
625
|
+
input__textarea
|
|
626
|
+
input__input--${t(d)}
|
|
627
|
+
`),
|
|
628
|
+
onInput: j
|
|
629
|
+
}, null, 42, hn), [
|
|
630
|
+
[O, t(a).focus]
|
|
631
|
+
])
|
|
632
|
+
], 2)) : (n(), l("div", {
|
|
633
|
+
key: 3,
|
|
634
|
+
class: W(`
|
|
635
|
+
input__container
|
|
636
|
+
input__container--${t(d)}
|
|
637
|
+
`)
|
|
638
|
+
}, [
|
|
639
|
+
P(V("input", G(o, {
|
|
640
|
+
value: b.value,
|
|
641
|
+
"data-component": "input",
|
|
642
|
+
"data-maska": "mask" in t(a) ? t(a).mask : "",
|
|
643
|
+
class: `
|
|
644
|
+
input__input
|
|
645
|
+
input__input--${t(d)}
|
|
646
|
+
${t(s) && "input__input--icon"}
|
|
647
|
+
${t(y) && "input__input--readOnly"}
|
|
648
|
+
`,
|
|
649
|
+
onMaska: q[0] || (q[0] = (x) => j(x, { masked: !0 })),
|
|
650
|
+
onChange: q[1] || (q[1] = (x) => v("change", x))
|
|
651
|
+
}), null, 16, bn), [
|
|
652
|
+
[t(zt)],
|
|
653
|
+
[O, t(a).focus]
|
|
654
|
+
]),
|
|
655
|
+
t(s) ? (n(), g(Z, {
|
|
656
|
+
key: 0,
|
|
657
|
+
icon: t(a).icon || "magnifying-glass",
|
|
658
|
+
class: W(`
|
|
659
|
+
input__icon
|
|
660
|
+
input__icon--${t(d)}
|
|
661
|
+
`)
|
|
662
|
+
}, null, 8, ["icon", "class"])) : f("", !0),
|
|
663
|
+
t(y) ? (n(), l("div", gn, [
|
|
664
|
+
M(vn, null, {
|
|
665
|
+
text: _(() => [
|
|
666
|
+
Q("Copiar")
|
|
667
|
+
]),
|
|
668
|
+
default: _(() => [
|
|
669
|
+
P(M(Z, {
|
|
670
|
+
icon: "clipboard",
|
|
671
|
+
onClick: q[2] || (q[2] = (x) => t(m)(String(L.modelValue || "")))
|
|
672
|
+
}, null, 512), [
|
|
673
|
+
[oe]
|
|
674
|
+
])
|
|
675
|
+
]),
|
|
676
|
+
_: 1
|
|
677
|
+
})
|
|
678
|
+
])) : f("", !0)
|
|
679
|
+
], 2))
|
|
680
|
+
]);
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
const Ce = /* @__PURE__ */ X(kn, [["__scopeId", "data-v-3e3e8c77"]]), Vn = ["value"], Cn = {
|
|
685
|
+
key: 1,
|
|
686
|
+
value: ""
|
|
687
|
+
}, An = ["value", "data-selected"], In = /* @__PURE__ */ U({
|
|
688
|
+
__name: "aeria-select",
|
|
689
|
+
props: {
|
|
690
|
+
modelValue: {},
|
|
691
|
+
property: {},
|
|
692
|
+
propertyName: {},
|
|
693
|
+
parentPropertyName: {},
|
|
694
|
+
parentCollection: {},
|
|
695
|
+
booleanRef: { type: Boolean },
|
|
696
|
+
multiple: { type: [Boolean, Number] },
|
|
697
|
+
noOutline: { type: Boolean }
|
|
698
|
+
},
|
|
699
|
+
emits: ["update:modelValue", "change"],
|
|
700
|
+
setup(c, { emit: u }) {
|
|
701
|
+
const e = c, a = u, s = Y(null), r = e.property || {}, i = (d) => {
|
|
702
|
+
e.booleanRef && (y.value = d), a("update:modelValue", (d == null ? void 0 : d._id) || d), a("change", (d == null ? void 0 : d._id) || d);
|
|
703
|
+
}, y = e.booleanRef ? (() => {
|
|
704
|
+
const d = Y(e.modelValue);
|
|
705
|
+
return D({
|
|
706
|
+
get: () => d.value === "true" ? !0 : d.value === "false" ? !1 : null,
|
|
707
|
+
set: ($) => {
|
|
708
|
+
d.value = $;
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
})() : D({
|
|
712
|
+
get: () => e.modelValue,
|
|
713
|
+
set: i
|
|
714
|
+
}), m = (d) => Array.isArray(e.modelValue) ? e.modelValue.includes(d) : e.modelValue === d, v = D(() => e.multiple ? typeof e.multiple == "number" ? e.multiple : 5 : 1);
|
|
715
|
+
return e.multiple && re(() => e.modelValue, (d) => {
|
|
716
|
+
var $;
|
|
717
|
+
if (!s.value)
|
|
718
|
+
return;
|
|
719
|
+
const o = s.value.querySelector('option[data-selected="true"]');
|
|
720
|
+
o && o.removeAttribute("data-selected"), ($ = s.value.querySelector(`option[value="${d}"]`)) == null || $.setAttribute("data-selected", "true");
|
|
721
|
+
}), (d, o) => (n(), l("div", {
|
|
722
|
+
class: W({
|
|
723
|
+
select: !0,
|
|
724
|
+
"select--outline": !d.noOutline
|
|
725
|
+
})
|
|
726
|
+
}, [
|
|
727
|
+
V("select", G({
|
|
728
|
+
ref_key: "select",
|
|
729
|
+
ref: s,
|
|
730
|
+
value: t(y)
|
|
731
|
+
}, {
|
|
732
|
+
size: v.value
|
|
733
|
+
}, {
|
|
734
|
+
class: {
|
|
735
|
+
select__select: !0,
|
|
736
|
+
"select__select--multiple": !!e.multiple
|
|
737
|
+
},
|
|
738
|
+
onChange: o[0] || (o[0] = ($) => i($.target.value))
|
|
739
|
+
}), [
|
|
740
|
+
t(r).icon ? (n(), g(Z, {
|
|
741
|
+
key: 0,
|
|
742
|
+
icon: t(r).icon
|
|
743
|
+
}, null, 8, ["icon"])) : f("", !0),
|
|
744
|
+
e.multiple ? f("", !0) : (n(), l("option", Cn, w(t(z)("none")), 1)),
|
|
745
|
+
(n(!0), l(K, null, H("enum" in t(r) ? t(r).enum : [], ($) => (n(), l("option", {
|
|
746
|
+
key: $,
|
|
747
|
+
value: $,
|
|
748
|
+
"data-selected": m($)
|
|
749
|
+
}, w(t(r).translate ? t(z)($) : $), 9, An))), 128)),
|
|
750
|
+
C(d.$slots, "default", {}, void 0, !0)
|
|
751
|
+
], 16, Vn)
|
|
752
|
+
], 2));
|
|
753
|
+
}
|
|
754
|
+
});
|
|
755
|
+
const ze = /* @__PURE__ */ X(In, [["__scopeId", "data-v-7a33443b"]]), On = { class: "pagination" }, wn = ["value"], Bn = { class: "pagination__control" }, Sn = { class: "pagination__page-input" }, jn = /* @__PURE__ */ U({
|
|
756
|
+
__name: "aeria-pagination",
|
|
757
|
+
props: {
|
|
758
|
+
pagination: {}
|
|
759
|
+
},
|
|
760
|
+
emits: ["paginate"],
|
|
761
|
+
setup(c, { emit: u }) {
|
|
762
|
+
const e = c, a = u, s = D({
|
|
763
|
+
get: () => Math.floor(e.pagination.offset / e.pagination.limit),
|
|
764
|
+
set: (v) => {
|
|
765
|
+
e.pagination.offset = v * e.pagination.limit;
|
|
766
|
+
}
|
|
767
|
+
}), r = D({
|
|
768
|
+
get: () => e.pagination.limit,
|
|
769
|
+
set: (v) => {
|
|
770
|
+
e.pagination.limit = Number(v);
|
|
771
|
+
}
|
|
772
|
+
}), i = Y(s.value ? s.value + 1 : 1), y = D(() => Math.ceil(e.pagination.recordsTotal / e.pagination.limit)), m = (v) => {
|
|
773
|
+
s.value = v === "previous" ? s.value - 1 : s.value + 1;
|
|
774
|
+
};
|
|
775
|
+
return re([
|
|
776
|
+
s,
|
|
777
|
+
r
|
|
778
|
+
], ([v]) => {
|
|
779
|
+
i.value = v + 1, a("paginate", {
|
|
780
|
+
offset: s.value * r.value,
|
|
781
|
+
limit: r.value
|
|
782
|
+
});
|
|
783
|
+
}), (v, d) => (n(), l("div", On, [
|
|
784
|
+
M(ze, {
|
|
785
|
+
modelValue: r.value,
|
|
786
|
+
"onUpdate:modelValue": d[0] || (d[0] = (o) => r.value = o),
|
|
787
|
+
property: {
|
|
788
|
+
enum: [],
|
|
789
|
+
icon: "list"
|
|
790
|
+
},
|
|
791
|
+
class: "pagination__control"
|
|
792
|
+
}, {
|
|
793
|
+
default: _(() => [
|
|
794
|
+
(n(!0), l(K, null, H(t(St), (o) => (n(), l("option", {
|
|
795
|
+
key: `limit-${o}`,
|
|
796
|
+
value: o
|
|
797
|
+
}, w(o), 9, wn))), 128))
|
|
798
|
+
]),
|
|
799
|
+
_: 1
|
|
800
|
+
}, 8, ["modelValue"]),
|
|
801
|
+
V("div", Bn, [
|
|
802
|
+
M(me, {
|
|
803
|
+
onClick: d[1] || (d[1] = (o) => s.value = 0)
|
|
804
|
+
}, {
|
|
805
|
+
default: _(() => [
|
|
806
|
+
M(Z, {
|
|
807
|
+
reactive: "",
|
|
808
|
+
icon: "caret-double-left"
|
|
809
|
+
})
|
|
810
|
+
]),
|
|
811
|
+
_: 1
|
|
812
|
+
}),
|
|
813
|
+
M(me, {
|
|
814
|
+
disabled: s.value === 0,
|
|
815
|
+
onClick: d[2] || (d[2] = (o) => m("previous"))
|
|
816
|
+
}, {
|
|
817
|
+
default: _(() => [
|
|
818
|
+
M(Z, {
|
|
819
|
+
reactive: "",
|
|
820
|
+
icon: "caret-left"
|
|
821
|
+
})
|
|
822
|
+
]),
|
|
823
|
+
_: 1
|
|
824
|
+
}, 8, ["disabled"]),
|
|
825
|
+
V("div", Sn, [
|
|
826
|
+
(n(), g(Ce, {
|
|
827
|
+
key: s.value,
|
|
828
|
+
modelValue: i.value,
|
|
829
|
+
"onUpdate:modelValue": d[3] || (d[3] = (o) => i.value = o),
|
|
830
|
+
property: {
|
|
831
|
+
type: "number",
|
|
832
|
+
minimum: 1
|
|
833
|
+
},
|
|
834
|
+
onChange: d[4] || (d[4] = (o) => {
|
|
835
|
+
s.value = i.value === 0 ? 0 : i.value - 1;
|
|
836
|
+
})
|
|
837
|
+
}, null, 8, ["modelValue"])),
|
|
838
|
+
V("span", null, w(t(z)("of")) + " " + w(y.value), 1)
|
|
839
|
+
]),
|
|
840
|
+
M(me, {
|
|
841
|
+
disabled: s.value === y.value - 1,
|
|
842
|
+
onClick: d[5] || (d[5] = (o) => m("next"))
|
|
843
|
+
}, {
|
|
844
|
+
default: _(() => [
|
|
845
|
+
M(Z, {
|
|
846
|
+
reactive: "",
|
|
847
|
+
icon: "caret-right"
|
|
848
|
+
})
|
|
849
|
+
]),
|
|
850
|
+
_: 1
|
|
851
|
+
}, 8, ["disabled"]),
|
|
852
|
+
M(me, {
|
|
853
|
+
onClick: d[6] || (d[6] = (o) => s.value = y.value - 1)
|
|
854
|
+
}, {
|
|
855
|
+
default: _(() => [
|
|
856
|
+
M(Z, {
|
|
857
|
+
reactive: "",
|
|
858
|
+
icon: "caret-double-right"
|
|
859
|
+
})
|
|
860
|
+
]),
|
|
861
|
+
_: 1
|
|
862
|
+
})
|
|
863
|
+
])
|
|
864
|
+
]));
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
const Tn = /* @__PURE__ */ X(jn, [["__scopeId", "data-v-7b3fd4da"]]), Ln = { class: "checkbox__text" }, Rn = ["innerHTML"], Fn = { class: "checkbox__hint" }, Mn = ["innerHTML"], qn = {
|
|
868
|
+
inheritAttrs: !1
|
|
869
|
+
}, Un = /* @__PURE__ */ U({
|
|
870
|
+
...qn,
|
|
871
|
+
__name: "aeria-checkbox",
|
|
872
|
+
props: {
|
|
873
|
+
modelValue: {},
|
|
874
|
+
property: {},
|
|
875
|
+
propertyName: {},
|
|
876
|
+
parentPropertyName: {},
|
|
877
|
+
parentCollection: {},
|
|
878
|
+
value: {},
|
|
879
|
+
variant: {}
|
|
880
|
+
},
|
|
881
|
+
emits: ["update:modelValue", "change"],
|
|
882
|
+
setup(c, { emit: u }) {
|
|
883
|
+
const e = c, a = e.property || {}, s = !("enum" in a) && [
|
|
884
|
+
"array",
|
|
885
|
+
"boolean"
|
|
886
|
+
].includes(a.type) ? "checkbox" : "radio", r = u, i = e.value || !1, y = D({
|
|
887
|
+
get: () => {
|
|
888
|
+
var m;
|
|
889
|
+
return "type" in a && a.type === "boolean" ? !!e.value : "items" in a ? (m = e.modelValue) == null ? void 0 : m.includes(e.value) : e.modelValue === e.value;
|
|
890
|
+
},
|
|
891
|
+
set: () => {
|
|
892
|
+
var m;
|
|
893
|
+
if (!a.readOnly) {
|
|
894
|
+
if ("type" in a && a.type === "boolean") {
|
|
895
|
+
r("update:modelValue", !e.modelValue);
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
if ("items" in a) {
|
|
899
|
+
r("update:modelValue", (m = e.modelValue) != null && m.includes(i) ? e.modelValue.filter((v) => v !== i) : [
|
|
900
|
+
...e.modelValue || [],
|
|
901
|
+
i
|
|
902
|
+
]);
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
r("update:modelValue", e.value);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
return (m, v) => {
|
|
910
|
+
const d = ee("clickable");
|
|
911
|
+
return n(), l("label", {
|
|
912
|
+
class: W(`
|
|
913
|
+
checkbox
|
|
914
|
+
${t(a).readOnly && "checkbox--readOnly"}
|
|
915
|
+
`)
|
|
916
|
+
}, [
|
|
917
|
+
P(V("input", G({
|
|
918
|
+
"onUpdate:modelValue": v[0] || (v[0] = (o) => y.value = o)
|
|
919
|
+
}, {
|
|
920
|
+
type: t(s),
|
|
921
|
+
readOnly: t(a).readOnly,
|
|
922
|
+
checked: y.value
|
|
923
|
+
}, { class: "checkbox__input" }), null, 16), [
|
|
924
|
+
[gt, y.value]
|
|
925
|
+
]),
|
|
926
|
+
P((n(), l("div", Ln, [
|
|
927
|
+
V("div", null, [
|
|
928
|
+
m.$slots.description ? C(m.$slots, "description", { key: 0 }, void 0, !0) : t(i) ? (n(), l("div", {
|
|
929
|
+
key: 1,
|
|
930
|
+
innerHTML: t(a).translate ? t(z)(t(i)) : t(i)
|
|
931
|
+
}, null, 8, Rn)) : C(m.$slots, "default", { key: 2 }, void 0, !0)
|
|
932
|
+
]),
|
|
933
|
+
V("div", Fn, [
|
|
934
|
+
m.$slots.hint ? C(m.$slots, "hint", { key: 0 }, void 0, !0) : t(a).hint ? (n(), l("div", {
|
|
935
|
+
key: 1,
|
|
936
|
+
innerHTML: t(a).hint
|
|
937
|
+
}, null, 8, Mn)) : f("", !0)
|
|
938
|
+
])
|
|
939
|
+
])), [
|
|
940
|
+
[d]
|
|
941
|
+
])
|
|
942
|
+
], 2);
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
});
|
|
946
|
+
const En = /* @__PURE__ */ X(Un, [["__scopeId", "data-v-c0ec1e4a"]]), zn = {
|
|
947
|
+
inheritAttrs: !1
|
|
948
|
+
}, Hn = /* @__PURE__ */ U({
|
|
949
|
+
...zn,
|
|
950
|
+
__name: "aeria-options",
|
|
951
|
+
props: {
|
|
952
|
+
modelValue: {},
|
|
953
|
+
propertyName: {},
|
|
954
|
+
parentPropertyName: {},
|
|
955
|
+
parentCollection: {},
|
|
956
|
+
property: {},
|
|
957
|
+
columns: { default: 1 }
|
|
958
|
+
},
|
|
959
|
+
emits: ["update:modelValue"],
|
|
960
|
+
setup(c, { emit: u }) {
|
|
961
|
+
const e = c, a = u, s = "items" in e.property ? e.property.items.enum : e.property.enum, r = (i) => {
|
|
962
|
+
a("update:modelValue", i);
|
|
963
|
+
};
|
|
964
|
+
return vt(() => {
|
|
965
|
+
e.modelValue || a(
|
|
966
|
+
"update:modelValue",
|
|
967
|
+
"items" in e.property ? [] : ""
|
|
968
|
+
);
|
|
969
|
+
}), (i, y) => (n(), l("div", {
|
|
970
|
+
class: "options",
|
|
971
|
+
style: $e(`
|
|
972
|
+
--columns: ${i.columns};
|
|
973
|
+
grid-template-columns: repeat(var(--columns), 1fr);
|
|
974
|
+
`)
|
|
975
|
+
}, [
|
|
976
|
+
(n(!0), l(K, null, H(t(s), (m) => (n(), l("div", {
|
|
977
|
+
key: `option-${m}`,
|
|
978
|
+
class: "options__checkbox"
|
|
979
|
+
}, [
|
|
980
|
+
M(En, G({
|
|
981
|
+
value: m,
|
|
982
|
+
property: i.property
|
|
983
|
+
}, {
|
|
984
|
+
"model-value": i.modelValue,
|
|
985
|
+
"onUpdate:modelValue": r
|
|
986
|
+
}), null, 16, ["model-value"])
|
|
987
|
+
]))), 128))
|
|
988
|
+
], 4));
|
|
989
|
+
}
|
|
990
|
+
});
|
|
991
|
+
const Dn = /* @__PURE__ */ X(Hn, [["__scopeId", "data-v-43cda372"]]), Qn = (c) => (qe("data-v-30f5a5ca"), c = c(), Ue(), c), Gn = { class: "switch-wrapper" }, Wn = /* @__PURE__ */ Qn(() => /* @__PURE__ */ V("div", { class: "switch__slider" }, null, -1)), Xn = { key: 1 }, Yn = {
|
|
992
|
+
inheritAttrs: !1
|
|
993
|
+
}, Jn = /* @__PURE__ */ U({
|
|
994
|
+
...Yn,
|
|
995
|
+
__name: "aeria-switch",
|
|
996
|
+
props: {
|
|
997
|
+
modelValue: {},
|
|
998
|
+
property: {},
|
|
999
|
+
propertyName: {},
|
|
1000
|
+
parentPropertyName: {},
|
|
1001
|
+
parentCollection: {}
|
|
1002
|
+
},
|
|
1003
|
+
emits: ["update:modelValue", "change"],
|
|
1004
|
+
setup(c, { emit: u }) {
|
|
1005
|
+
const e = c, a = u, s = e.property || {}, r = () => {
|
|
1006
|
+
s.readOnly || (a("change", !e.modelValue), a("update:modelValue", !e.modelValue));
|
|
1007
|
+
};
|
|
1008
|
+
return (i, y) => {
|
|
1009
|
+
const m = ee("clickable");
|
|
1010
|
+
return n(), l("div", Gn, [
|
|
1011
|
+
P((n(), l("a", {
|
|
1012
|
+
class: W(`
|
|
1013
|
+
switch
|
|
1014
|
+
${i.modelValue && "switch--active"}
|
|
1015
|
+
${t(s).readOnly && "switch--readOnly"}
|
|
1016
|
+
`),
|
|
1017
|
+
onClick: Fe(r, ["stop"])
|
|
1018
|
+
}, [
|
|
1019
|
+
Wn,
|
|
1020
|
+
V("div", {
|
|
1021
|
+
class: W(`
|
|
1022
|
+
switch__dummy
|
|
1023
|
+
${!i.modelValue && "switch__dummy--flex"}
|
|
1024
|
+
`)
|
|
1025
|
+
}, null, 2)
|
|
1026
|
+
], 2)), [
|
|
1027
|
+
[m, {
|
|
1028
|
+
blocked: t(s).readOnly
|
|
1029
|
+
}]
|
|
1030
|
+
]),
|
|
1031
|
+
i.$slots.default ? C(i.$slots, "default", { key: 0 }, void 0, !0) : (n(), l("div", Xn, w(t(s).description || i.propertyName), 1))
|
|
1032
|
+
]);
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1035
|
+
});
|
|
1036
|
+
const Kn = /* @__PURE__ */ X(Jn, [["__scopeId", "data-v-30f5a5ca"]]), $t = (c) => (qe("data-v-ecfb1379"), c = c(), Ue(), c), Zn = { class: "picture" }, Pn = {
|
|
1037
|
+
key: 0,
|
|
1038
|
+
style: { position: "fixed", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }
|
|
1039
|
+
}, Nn = ["src"], xn = {
|
|
1040
|
+
key: 0,
|
|
1041
|
+
class: "picture__meta"
|
|
1042
|
+
}, eo = ["src"], to = /* @__PURE__ */ $t(() => /* @__PURE__ */ V("line", {
|
|
1043
|
+
x1: "0",
|
|
1044
|
+
y1: "0",
|
|
1045
|
+
x2: "200",
|
|
1046
|
+
y2: "200",
|
|
1047
|
+
stroke: "#000",
|
|
1048
|
+
"vector-effect": "non-scaling-stroke"
|
|
1049
|
+
}, null, -1)), no = /* @__PURE__ */ $t(() => /* @__PURE__ */ V("line", {
|
|
1050
|
+
x1: "200",
|
|
1051
|
+
y1: "0",
|
|
1052
|
+
x2: "0",
|
|
1053
|
+
y2: "200",
|
|
1054
|
+
stroke: "#000",
|
|
1055
|
+
"vector-effect": "non-scaling-stroke"
|
|
1056
|
+
}, null, -1)), oo = [
|
|
1057
|
+
to,
|
|
1058
|
+
no
|
|
1059
|
+
], ao = { key: 5 }, so = /* @__PURE__ */ U({
|
|
1060
|
+
__name: "aeria-picture",
|
|
1061
|
+
props: {
|
|
1062
|
+
url: {},
|
|
1063
|
+
fileId: {},
|
|
1064
|
+
modelValue: {},
|
|
1065
|
+
objectFit: {},
|
|
1066
|
+
bordered: { type: Boolean },
|
|
1067
|
+
width: {},
|
|
1068
|
+
height: {},
|
|
1069
|
+
expandable: { type: Boolean },
|
|
1070
|
+
meta: {}
|
|
1071
|
+
},
|
|
1072
|
+
setup(c) {
|
|
1073
|
+
const u = c, e = D(() => u.fileId ? `${ft}/file/${u.fileId}/picture` : u.url || u.modelValue), a = Y(!1);
|
|
1074
|
+
return (s, r) => {
|
|
1075
|
+
var y;
|
|
1076
|
+
const i = ee("overlay");
|
|
1077
|
+
return n(), l("figure", Zn, [
|
|
1078
|
+
e.value ? (n(), g(Ge, {
|
|
1079
|
+
key: 0,
|
|
1080
|
+
to: "main"
|
|
1081
|
+
}, [
|
|
1082
|
+
a.value ? P((n(), l("div", Pn, [
|
|
1083
|
+
V("img", {
|
|
1084
|
+
src: e.value,
|
|
1085
|
+
style: `
|
|
1086
|
+
max-height: 60vh;
|
|
1087
|
+
object-fit: contain;
|
|
1088
|
+
`,
|
|
1089
|
+
onClick: r[0] || (r[0] = (m) => a.value = !0)
|
|
1090
|
+
}, null, 8, Nn),
|
|
1091
|
+
(y = s.meta) != null && y.owner ? (n(), l("div", xn, " Criado por " + w(s.meta.owner.name) + " em " + w(s.formatDateTime(s.meta.created_at, { hours: !0 })), 1)) : f("", !0)
|
|
1092
|
+
])), [
|
|
1093
|
+
[i, {
|
|
1094
|
+
click: () => {
|
|
1095
|
+
a.value = !1;
|
|
1096
|
+
}
|
|
1097
|
+
}]
|
|
1098
|
+
]) : f("", !0)
|
|
1099
|
+
])) : f("", !0),
|
|
1100
|
+
e.value ? (n(), l("img", {
|
|
1101
|
+
key: 1,
|
|
1102
|
+
src: e.value,
|
|
1103
|
+
class: W(`
|
|
1104
|
+
picture__image
|
|
1105
|
+
${s.bordered && "picture__image--bordered"}
|
|
1106
|
+
${s.expandable && "picture__image--expandable"}
|
|
1107
|
+
`),
|
|
1108
|
+
style: $e(`
|
|
1109
|
+
object-fit: ${s.objectFit || "cover"};
|
|
1110
|
+
width: ${s.width || "100%"};
|
|
1111
|
+
height: ${s.height || "100%"};
|
|
1112
|
+
`),
|
|
1113
|
+
onClick: r[1] || (r[1] = () => {
|
|
1114
|
+
s.expandable && (a.value = !0);
|
|
1115
|
+
})
|
|
1116
|
+
}, null, 14, eo)) : s.$slots.fallback ? C(s.$slots, "fallback", { key: 2 }, void 0, !0) : s.$slots.default ? C(s.$slots, "default", { key: 3 }, void 0, !0) : (n(), l("svg", {
|
|
1117
|
+
key: 4,
|
|
1118
|
+
class: W(["picture__background", `
|
|
1119
|
+
${s.bordered && "picture__image--bordered"}
|
|
1120
|
+
`]),
|
|
1121
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1122
|
+
viewBox: "0 0 200 200",
|
|
1123
|
+
preserveAspectRatio: "none",
|
|
1124
|
+
style: $e(`
|
|
1125
|
+
object-fit: ${s.objectFit || "cover"};
|
|
1126
|
+
width: ${s.width || "100%"};
|
|
1127
|
+
height: ${s.height || "100%"};
|
|
1128
|
+
`)
|
|
1129
|
+
}, oo, 6)),
|
|
1130
|
+
s.$slots.caption ? (n(), l("figcaption", ao, [
|
|
1131
|
+
C(s.$slots, "caption", {}, void 0, !0)
|
|
1132
|
+
])) : f("", !0)
|
|
1133
|
+
]);
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1137
|
+
const Me = /* @__PURE__ */ X(so, [["__scopeId", "data-v-ecfb1379"]]), lo = { class: "file" }, io = { key: 0 }, ro = ["href"], uo = { class: "file__actions" }, co = ["accept"], po = {
|
|
1138
|
+
key: 0,
|
|
1139
|
+
class: "file__buttons"
|
|
1140
|
+
}, _o = {
|
|
1141
|
+
key: 1,
|
|
1142
|
+
class: "file__buttons"
|
|
1143
|
+
}, mo = /* @__PURE__ */ U({
|
|
1144
|
+
__name: "aeria-file",
|
|
1145
|
+
props: {
|
|
1146
|
+
modelValue: {},
|
|
1147
|
+
property: {},
|
|
1148
|
+
propertyName: {},
|
|
1149
|
+
parentPropertyName: {},
|
|
1150
|
+
parentCollection: {},
|
|
1151
|
+
meta: {},
|
|
1152
|
+
content: {}
|
|
1153
|
+
},
|
|
1154
|
+
emits: ["update:modelValue", "update:content", "change"],
|
|
1155
|
+
setup(c, { emit: u }) {
|
|
1156
|
+
const e = c, a = u, r = Te() ? ge() : null, i = Y(null), y = D(() => {
|
|
1157
|
+
var b;
|
|
1158
|
+
return i.value ? URL.createObjectURL(i.value) : (b = e.modelValue) == null ? void 0 : b.link;
|
|
1159
|
+
}), m = D(() => {
|
|
1160
|
+
var b, I, j;
|
|
1161
|
+
return /^image\//.test((b = e.modelValue) == null ? void 0 : b.mime) && !((I = i.value) != null && I.type) || /^image\//.test((j = i.value) == null ? void 0 : j.type);
|
|
1162
|
+
}), v = (b) => new Promise((I) => {
|
|
1163
|
+
const j = new FileReader();
|
|
1164
|
+
j.onload = () => I(j.result), j.readAsArrayBuffer(b);
|
|
1165
|
+
}), d = () => {
|
|
1166
|
+
i.value = null;
|
|
1167
|
+
}, o = async (b) => {
|
|
1168
|
+
i.value = b.target.files[0];
|
|
1169
|
+
const I = i.value, j = await v(I);
|
|
1170
|
+
if (r) {
|
|
1171
|
+
const { data: L } = await jt(`${ft}/${r.$id}/upload?filename=${I.name}`, j, {
|
|
1172
|
+
params: {
|
|
1173
|
+
method: "POST",
|
|
1174
|
+
headers: {
|
|
1175
|
+
"content-type": I.type || "application/octet-stream",
|
|
1176
|
+
"x-stream-request": "1"
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
a("update:modelValue", L);
|
|
1181
|
+
}
|
|
1182
|
+
a("update:content", j), a("change", j);
|
|
1183
|
+
}, $ = async () => {
|
|
1184
|
+
a("update:modelValue", null);
|
|
1185
|
+
};
|
|
1186
|
+
return (b, I) => {
|
|
1187
|
+
var j, L, q, O, oe, x;
|
|
1188
|
+
return n(), l("div", lo, [
|
|
1189
|
+
i.value || (j = b.modelValue) != null && j._id ? (n(), l("div", io, [
|
|
1190
|
+
m.value ? (n(), g(Me, {
|
|
1191
|
+
key: 0,
|
|
1192
|
+
modelValue: y.value,
|
|
1193
|
+
"onUpdate:modelValue": I[0] || (I[0] = (B) => y.value = B),
|
|
1194
|
+
class: W(`
|
|
1195
|
+
file__image
|
|
1196
|
+
${!t(r) || ((L = b.modelValue) == null ? void 0 : L._id) || "file__image--unsent"}
|
|
1197
|
+
`)
|
|
1198
|
+
}, null, 8, ["modelValue", "class"])) : f("", !0),
|
|
1199
|
+
(q = b.modelValue) != null && q._id ? (n(), l("a", {
|
|
1200
|
+
key: 1,
|
|
1201
|
+
href: b.modelValue.download_link
|
|
1202
|
+
}, w(b.modelValue.filename), 9, ro)) : f("", !0)
|
|
1203
|
+
])) : f("", !0),
|
|
1204
|
+
V("div", uo, [
|
|
1205
|
+
V("input", {
|
|
1206
|
+
ref: "file",
|
|
1207
|
+
type: "file",
|
|
1208
|
+
accept: (oe = (O = b.property) == null ? void 0 : O.accept) == null ? void 0 : oe.join(","),
|
|
1209
|
+
onChange: o
|
|
1210
|
+
}, null, 40, co),
|
|
1211
|
+
i.value ? (n(), l("div", po, [
|
|
1212
|
+
M(ie, {
|
|
1213
|
+
small: "",
|
|
1214
|
+
onClick: Fe(d, ["prevent"])
|
|
1215
|
+
}, {
|
|
1216
|
+
default: _(() => [
|
|
1217
|
+
Q(" Limpar ")
|
|
1218
|
+
]),
|
|
1219
|
+
_: 1
|
|
1220
|
+
})
|
|
1221
|
+
])) : (x = b.modelValue) != null && x._id ? (n(), l("div", _o, [
|
|
1222
|
+
M(ie, {
|
|
1223
|
+
small: "",
|
|
1224
|
+
onClick: Fe($, ["prevent"])
|
|
1225
|
+
}, {
|
|
1226
|
+
default: _(() => [
|
|
1227
|
+
Q(" Remover ")
|
|
1228
|
+
]),
|
|
1229
|
+
_: 1
|
|
1230
|
+
})
|
|
1231
|
+
])) : f("", !0)
|
|
1232
|
+
])
|
|
1233
|
+
]);
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
const vo = /* @__PURE__ */ X(mo, [["__scopeId", "data-v-f3848c9a"]]), fo = { class: "container" }, yo = {
|
|
1238
|
+
key: 1,
|
|
1239
|
+
class: "container__footer"
|
|
1240
|
+
}, $o = /* @__PURE__ */ U({
|
|
1241
|
+
__name: "aeria-search-container",
|
|
1242
|
+
props: {
|
|
1243
|
+
observeScroll: { type: Boolean }
|
|
1244
|
+
},
|
|
1245
|
+
emits: ["endReached"],
|
|
1246
|
+
setup(c, { emit: u }) {
|
|
1247
|
+
const e = c, a = u, s = Y(null), r = e.observeScroll ? We(s, {
|
|
1248
|
+
antecipate: 100
|
|
1249
|
+
}).reachedEnd : null;
|
|
1250
|
+
return r !== null && re(r, (i) => {
|
|
1251
|
+
i && a("endReached", i);
|
|
1252
|
+
}), (i, y) => (n(), l("div", fo, [
|
|
1253
|
+
i.$slots.default ? (n(), l("div", {
|
|
1254
|
+
key: 0,
|
|
1255
|
+
ref_key: "containerEl",
|
|
1256
|
+
ref: s,
|
|
1257
|
+
class: "container__content"
|
|
1258
|
+
}, [
|
|
1259
|
+
C(i.$slots, "default", {}, void 0, !0)
|
|
1260
|
+
], 512)) : f("", !0),
|
|
1261
|
+
i.$slots.footer ? (n(), l("div", yo, [
|
|
1262
|
+
C(i.$slots, "footer", {}, void 0, !0)
|
|
1263
|
+
])) : f("", !0)
|
|
1264
|
+
]));
|
|
1265
|
+
}
|
|
1266
|
+
});
|
|
1267
|
+
const rt = /* @__PURE__ */ X($o, [["__scopeId", "data-v-193f9eed"]]), ho = { class: "item__values" }, bo = /* @__PURE__ */ U({
|
|
1268
|
+
__name: "aeria-search-item",
|
|
1269
|
+
props: {
|
|
1270
|
+
item: {},
|
|
1271
|
+
indexes: {},
|
|
1272
|
+
modelValue: {},
|
|
1273
|
+
property: {}
|
|
1274
|
+
},
|
|
1275
|
+
emits: ["update:modelValue", "change"],
|
|
1276
|
+
setup(c, { emit: u }) {
|
|
1277
|
+
const e = c, a = u, s = e.property, r = pe(s), i = ge(), y = D(() => Array.isArray(e.modelValue) ? Array.isArray(e.modelValue) && Object.values(e.modelValue).some(({ _id: d }) => e.item._id === d) : e.modelValue && e.modelValue._id === e.item._id), m = () => {
|
|
1278
|
+
if (y.value)
|
|
1279
|
+
return;
|
|
1280
|
+
const d = ($) => $.filter((b) => !!(b != null && b._id)), o = "items" in s ? d(Array.isArray(e.modelValue) ? e.modelValue : [e.modelValue]) : e.modelValue;
|
|
1281
|
+
a("update:modelValue", Array.isArray(o) ? [
|
|
1282
|
+
...o,
|
|
1283
|
+
e.item
|
|
1284
|
+
] : e.item), a("change", e.item);
|
|
1285
|
+
}, v = async (d) => {
|
|
1286
|
+
if (r.purge && (d != null && d.purge)) {
|
|
1287
|
+
const { _id: $ } = e.item;
|
|
1288
|
+
await i.$actions.remove({
|
|
1289
|
+
filters: {
|
|
1290
|
+
_id: $
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
const o = () => {
|
|
1295
|
+
const $ = [...e.modelValue], b = $.findIndex((I) => I._id === e.item._id);
|
|
1296
|
+
return $.splice(b, 1), $;
|
|
1297
|
+
};
|
|
1298
|
+
a("update:modelValue", "items" in s ? o() : null);
|
|
1299
|
+
};
|
|
1300
|
+
return (d, o) => {
|
|
1301
|
+
const $ = ee("clickable");
|
|
1302
|
+
return P((n(), l("div", {
|
|
1303
|
+
class: W({
|
|
1304
|
+
item: !0,
|
|
1305
|
+
"item--selected": y.value
|
|
1306
|
+
}),
|
|
1307
|
+
onClick: o[0] || (o[0] = (b) => y.value ? v() : m())
|
|
1308
|
+
}, [
|
|
1309
|
+
C(d.$slots, "default", {}, void 0, !0),
|
|
1310
|
+
V("div", ho, [
|
|
1311
|
+
(n(!0), l(K, null, H(d.indexes, (b, I) => (n(), l("div", {
|
|
1312
|
+
key: `index-${d.item._id}-${I}`,
|
|
1313
|
+
class: "item__value"
|
|
1314
|
+
}, w(d.item[b]), 1))), 128))
|
|
1315
|
+
])
|
|
1316
|
+
], 2)), [
|
|
1317
|
+
[$]
|
|
1318
|
+
]);
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
});
|
|
1322
|
+
const De = /* @__PURE__ */ X(bo, [["__scopeId", "data-v-fa7fea9f"]]), go = { class: "search__panel" }, ko = { class: "search__input" }, Vo = ["value"], Co = { style: { flex: "1" } }, Ao = { key: 1 }, Io = { key: 0 }, Oo = { key: 1 }, wo = { class: "search__summary" }, Bo = {
|
|
1323
|
+
key: 1,
|
|
1324
|
+
class: "search"
|
|
1325
|
+
}, So = { key: 0 }, Re = 10, jo = /* @__PURE__ */ U({
|
|
1326
|
+
__name: "aeria-search",
|
|
1327
|
+
props: {
|
|
1328
|
+
modelValue: {},
|
|
1329
|
+
parentPropertyName: {},
|
|
1330
|
+
parentCollection: {},
|
|
1331
|
+
property: {},
|
|
1332
|
+
propertyName: {},
|
|
1333
|
+
selectOnly: { type: Boolean },
|
|
1334
|
+
panel: { default: void 0 }
|
|
1335
|
+
},
|
|
1336
|
+
emits: ["update:modelValue", "change", "update:panel"],
|
|
1337
|
+
setup(c, { emit: u }) {
|
|
1338
|
+
const e = c, a = pe(e.property), s = e.panel !== void 0 ? D(() => e.panel) : Y(!1), r = u, i = ue(pe(e.property).$ref), y = Te(), m = y ? ge() : null, v = a.indexes;
|
|
1339
|
+
fe(Ee, pe(e.property).$ref), fe("innerInputLabel", !0), fe("omitInputLabels", !0);
|
|
1340
|
+
const d = Y(e.modelValue), o = Y({
|
|
1341
|
+
data: [],
|
|
1342
|
+
pagination: {}
|
|
1343
|
+
}), $ = D(() => o.value.data), b = D(() => o.value.pagination), I = Y(0), j = Y(v[0]), L = Y(!1), q = Y({}), O = () => {
|
|
1344
|
+
const k = {};
|
|
1345
|
+
if (y) {
|
|
1346
|
+
const F = Se(y) ? y.value : y;
|
|
1347
|
+
k[F] = m;
|
|
1348
|
+
}
|
|
1349
|
+
return a.constraints ? Mt(a.constraints, k) : {};
|
|
1350
|
+
}, oe = () => {
|
|
1351
|
+
$.value.length < b.value.recordsTotal && (I.value += 1, B());
|
|
1352
|
+
}, x = async () => Object.values(q.value).every((k) => !(String(k).length > 0)) ? i.$actions.custom("getAll", {
|
|
1353
|
+
limit: Re,
|
|
1354
|
+
offset: I.value * Re,
|
|
1355
|
+
filters: O()
|
|
1356
|
+
}) : i.$actions.custom("getAll", {
|
|
1357
|
+
limit: Re,
|
|
1358
|
+
offset: I.value * Re,
|
|
1359
|
+
filters: {
|
|
1360
|
+
...O(),
|
|
1361
|
+
$or: v.filter((k) => {
|
|
1362
|
+
var F;
|
|
1363
|
+
return ((F = q.value[k]) == null ? void 0 : F.length) > 0;
|
|
1364
|
+
}).map((k) => ({
|
|
1365
|
+
[k]: {
|
|
1366
|
+
$regex: q.value[k].trim().replace("(", "\\(").replace(")", "\\)"),
|
|
1367
|
+
$options: "i"
|
|
1368
|
+
}
|
|
1369
|
+
}))
|
|
1370
|
+
}
|
|
1371
|
+
}), B = async () => {
|
|
1372
|
+
if (i.loading.getAll)
|
|
1373
|
+
return;
|
|
1374
|
+
const k = await x();
|
|
1375
|
+
o.value.pagination = k.pagination, I.value === 0 && o.value.data.splice(0), o.value.data.push(...k.data);
|
|
1376
|
+
}, [h] = yt({
|
|
1377
|
+
delay: 800
|
|
1378
|
+
})(() => {
|
|
1379
|
+
I.value = 0, B(), L.value = !1;
|
|
1380
|
+
}), R = () => {
|
|
1381
|
+
L.value = !0, h();
|
|
1382
|
+
}, te = () => {
|
|
1383
|
+
"effect" in s ? r("update:panel", !0) : s.value = !0, B();
|
|
1384
|
+
}, ne = () => {
|
|
1385
|
+
I.value = 0, o.value.data.splice(0), "effect" in s ? r("update:panel", !1) : s.value = !1;
|
|
1386
|
+
}, se = D(() => !Object.values(q.value).some((k) => !!k));
|
|
1387
|
+
re(se, (k, F) => {
|
|
1388
|
+
k && !F && B();
|
|
1389
|
+
}), kt(() => {
|
|
1390
|
+
e.selectOnly && B();
|
|
1391
|
+
});
|
|
1392
|
+
const p = (k) => {
|
|
1393
|
+
d.value = k, e.selectOnly || r("update:modelValue", k);
|
|
1394
|
+
}, E = () => {
|
|
1395
|
+
ne(), r("update:modelValue", d.value);
|
|
1396
|
+
};
|
|
1397
|
+
return (k, F) => {
|
|
1398
|
+
const A = ee("clickable");
|
|
1399
|
+
return n(), l("div", null, [
|
|
1400
|
+
t(s) ? (n(), g(Ge, {
|
|
1401
|
+
key: 0,
|
|
1402
|
+
to: "main"
|
|
1403
|
+
}, [
|
|
1404
|
+
M(Ae, {
|
|
1405
|
+
float: "",
|
|
1406
|
+
"close-hint": "",
|
|
1407
|
+
title: `Selecionar ${t(z)(k.propertyName)}`,
|
|
1408
|
+
"overlay-layer": 65,
|
|
1409
|
+
"model-value": t(s),
|
|
1410
|
+
style: { "--panel-max-width": "36rem" },
|
|
1411
|
+
onClose: ne,
|
|
1412
|
+
onOverlayClick: ne
|
|
1413
|
+
}, {
|
|
1414
|
+
footer: _(() => [
|
|
1415
|
+
M(ie, {
|
|
1416
|
+
large: "",
|
|
1417
|
+
onClick: E
|
|
1418
|
+
}, {
|
|
1419
|
+
default: _(() => [
|
|
1420
|
+
Q(" Salvar ")
|
|
1421
|
+
]),
|
|
1422
|
+
_: 1
|
|
1423
|
+
})
|
|
1424
|
+
]),
|
|
1425
|
+
default: _(() => {
|
|
1426
|
+
var S, T;
|
|
1427
|
+
return [
|
|
1428
|
+
V("div", go, [
|
|
1429
|
+
V("div", ko, [
|
|
1430
|
+
t(v).length > 1 ? (n(), g(ze, {
|
|
1431
|
+
key: 0,
|
|
1432
|
+
modelValue: j.value,
|
|
1433
|
+
"onUpdate:modelValue": F[0] || (F[0] = (J) => j.value = J),
|
|
1434
|
+
onChange: F[1] || (F[1] = (J) => q.value = {})
|
|
1435
|
+
}, {
|
|
1436
|
+
default: _(() => [
|
|
1437
|
+
(n(!0), l(K, null, H(t(v), (J) => (n(), l("option", {
|
|
1438
|
+
key: `searchfield-${J}`,
|
|
1439
|
+
value: J
|
|
1440
|
+
}, w(t(z)(J)), 9, Vo))), 128))
|
|
1441
|
+
]),
|
|
1442
|
+
_: 1
|
|
1443
|
+
}, 8, ["modelValue"])) : f("", !0),
|
|
1444
|
+
V("div", Co, [
|
|
1445
|
+
(n(), g(Ce, {
|
|
1446
|
+
key: `field-${j.value}`,
|
|
1447
|
+
modelValue: q.value[j.value],
|
|
1448
|
+
"onUpdate:modelValue": F[2] || (F[2] = (J) => q.value[j.value] = J),
|
|
1449
|
+
property: {
|
|
1450
|
+
...t(i).properties[j.value],
|
|
1451
|
+
inputType: "search"
|
|
1452
|
+
},
|
|
1453
|
+
onInput: R
|
|
1454
|
+
}, null, 8, ["modelValue", "property"]))
|
|
1455
|
+
])
|
|
1456
|
+
]),
|
|
1457
|
+
$.value.length ? (n(), g(rt, {
|
|
1458
|
+
key: 0,
|
|
1459
|
+
"observe-scroll": "",
|
|
1460
|
+
onEndReached: oe
|
|
1461
|
+
}, {
|
|
1462
|
+
default: _(() => [
|
|
1463
|
+
(n(!0), l(K, null, H($.value, (J) => (n(), g(De, G({
|
|
1464
|
+
item: J,
|
|
1465
|
+
indexes: t(v),
|
|
1466
|
+
property: k.property
|
|
1467
|
+
}, {
|
|
1468
|
+
key: `matching-${J._id}`,
|
|
1469
|
+
modelValue: d.value,
|
|
1470
|
+
"onUpdate:modelValue": F[3] || (F[3] = (ce) => d.value = ce)
|
|
1471
|
+
}), null, 16, ["modelValue"]))), 128))
|
|
1472
|
+
]),
|
|
1473
|
+
_: 1
|
|
1474
|
+
})) : (n(), l("div", Ao, [
|
|
1475
|
+
L.value ? (n(), l("div", Io, " Pesquisando... ")) : !t(i).loading.getAll && Object.values(q.value).filter((J) => !!J).length > 0 && !("items" in k.property && ((S = k.modelValue) != null && S.length) || !Array.isArray(k.modelValue) && ((T = k.modelValue) != null && T._id)) ? (n(), l("div", Oo, " Não há resultados ")) : f("", !0)
|
|
1476
|
+
]))
|
|
1477
|
+
]),
|
|
1478
|
+
V("div", wo, " Mostrando " + w($.value.length) + " " + w(t(z)("of")) + " " + w(b.value.recordsTotal), 1)
|
|
1479
|
+
];
|
|
1480
|
+
}),
|
|
1481
|
+
_: 1
|
|
1482
|
+
}, 8, ["title", "model-value"])
|
|
1483
|
+
])) : f("", !0),
|
|
1484
|
+
k.selectOnly ? f("", !0) : (n(), l("div", Bo, [
|
|
1485
|
+
M(rt, null, {
|
|
1486
|
+
footer: _(() => [
|
|
1487
|
+
P((n(), g(Z, {
|
|
1488
|
+
icon: "plus",
|
|
1489
|
+
onClick: te
|
|
1490
|
+
}, {
|
|
1491
|
+
default: _(() => [
|
|
1492
|
+
Q(" Selecionar ")
|
|
1493
|
+
]),
|
|
1494
|
+
_: 1
|
|
1495
|
+
})), [
|
|
1496
|
+
[A]
|
|
1497
|
+
])
|
|
1498
|
+
]),
|
|
1499
|
+
default: _(() => {
|
|
1500
|
+
var S;
|
|
1501
|
+
return [
|
|
1502
|
+
"items" in k.property ? (n(), l("div", So, [
|
|
1503
|
+
(n(!0), l(K, null, H(k.modelValue, (T) => (n(), g(De, G({
|
|
1504
|
+
item: T,
|
|
1505
|
+
indexes: t(v),
|
|
1506
|
+
property: k.property,
|
|
1507
|
+
modelValue: k.modelValue
|
|
1508
|
+
}, {
|
|
1509
|
+
key: `selected-${T._id}`,
|
|
1510
|
+
"onUpdate:modelValue": p
|
|
1511
|
+
}), null, 16))), 128))
|
|
1512
|
+
])) : (S = k.modelValue) != null && S._id ? (n(), g(De, G({ key: 1 }, {
|
|
1513
|
+
item: k.modelValue,
|
|
1514
|
+
indexes: t(v),
|
|
1515
|
+
property: t(a),
|
|
1516
|
+
modelValue: k.modelValue
|
|
1517
|
+
}, { "onUpdate:modelValue": p }), null, 16)) : f("", !0)
|
|
1518
|
+
];
|
|
1519
|
+
}),
|
|
1520
|
+
_: 1
|
|
1521
|
+
})
|
|
1522
|
+
]))
|
|
1523
|
+
]);
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
});
|
|
1527
|
+
const To = /* @__PURE__ */ X(jo, [["__scopeId", "data-v-26a9c85f"]]), ut = (c, u) => {
|
|
1528
|
+
const e = "items" in c ? c.items : c, a = {
|
|
1529
|
+
options: Dn,
|
|
1530
|
+
select: ze,
|
|
1531
|
+
switch: Kn,
|
|
1532
|
+
file: vo,
|
|
1533
|
+
search: To,
|
|
1534
|
+
input: Ce,
|
|
1535
|
+
form: He
|
|
1536
|
+
}, s = (() => {
|
|
1537
|
+
if ("type" in e) {
|
|
1538
|
+
if (e.type === "object")
|
|
1539
|
+
return "form";
|
|
1540
|
+
if (e.type === "boolean")
|
|
1541
|
+
return "switch";
|
|
1542
|
+
}
|
|
1543
|
+
if ("element" in c) {
|
|
1544
|
+
if (c.element === "checkbox" || c.element === "radio")
|
|
1545
|
+
return "options";
|
|
1546
|
+
if (c.element === "select")
|
|
1547
|
+
return "select";
|
|
1548
|
+
}
|
|
1549
|
+
const r = pe(c);
|
|
1550
|
+
return r ? r.inline ? "form" : r.$ref === "file" ? "file" : "search" : "items" in c && c.uniqueItems ? "options" : "enum" in e ? "select" : "input";
|
|
1551
|
+
})();
|
|
1552
|
+
return u[s] ? u[s] : a[s];
|
|
1553
|
+
}, Lo = (c, u) => {
|
|
1554
|
+
c ?? (c = []);
|
|
1555
|
+
const e = "items" in u ? u.items : u;
|
|
1556
|
+
if ("$ref" in u) {
|
|
1557
|
+
const a = ue(u.$ref), s = Be(a.$freshItem);
|
|
1558
|
+
return c.unshift(s);
|
|
1559
|
+
}
|
|
1560
|
+
return "properties" in e ? c.unshift(qt(e)) : "type" in e && e.type === "boolean" ? c.unshift({}) : c.unshift(null);
|
|
1561
|
+
}, Ro = (c, u) => {
|
|
1562
|
+
c.splice(u, 1);
|
|
1563
|
+
}, Fo = {
|
|
1564
|
+
key: 0,
|
|
1565
|
+
class: "form__header"
|
|
1566
|
+
}, Mo = {
|
|
1567
|
+
key: 1,
|
|
1568
|
+
class: "form__fieldset"
|
|
1569
|
+
}, qo = { key: 0 }, Uo = ["innerHTML"], Eo = ["onInput"], zo = { key: 4 }, Ho = { value: "true" }, Do = { value: "false" }, Qo = {
|
|
1570
|
+
key: 5,
|
|
1571
|
+
style: { display: "grid", "row-gap": ".4rem" }
|
|
1572
|
+
}, Go = { style: { "flex-grow": "1" } }, Wo = {
|
|
1573
|
+
key: 7,
|
|
1574
|
+
class: "form__validation-error"
|
|
1575
|
+
}, Xo = { key: 0 }, Yo = { key: 1 }, Jo = {
|
|
1576
|
+
key: 3,
|
|
1577
|
+
class: "form__footer"
|
|
1578
|
+
}, Ko = /* @__PURE__ */ U({
|
|
1579
|
+
__name: "aeria-form",
|
|
1580
|
+
props: {
|
|
1581
|
+
modelValue: {},
|
|
1582
|
+
property: {},
|
|
1583
|
+
propertyName: {},
|
|
1584
|
+
parentPropertyName: {},
|
|
1585
|
+
parentCollection: {},
|
|
1586
|
+
form: {},
|
|
1587
|
+
collection: {},
|
|
1588
|
+
isReadOnly: { type: Boolean, default: !1 },
|
|
1589
|
+
searchOnly: { type: Boolean },
|
|
1590
|
+
layout: {},
|
|
1591
|
+
required: {},
|
|
1592
|
+
formComponents: {},
|
|
1593
|
+
propertyComponents: {},
|
|
1594
|
+
omitFormHeader: { type: Boolean },
|
|
1595
|
+
omitInputLabels: { type: Boolean },
|
|
1596
|
+
innerInputLabel: { type: Boolean },
|
|
1597
|
+
validationErrors: { default: null },
|
|
1598
|
+
highlightRequired: { type: Boolean, default: !0 },
|
|
1599
|
+
focus: { type: Boolean }
|
|
1600
|
+
},
|
|
1601
|
+
emits: ["update:modelValue", "input", "change"],
|
|
1602
|
+
setup(c, { emit: u }) {
|
|
1603
|
+
const e = c, a = u;
|
|
1604
|
+
vt(() => {
|
|
1605
|
+
e.modelValue || a("update:modelValue", e.property && "items" in e.property ? [] : {});
|
|
1606
|
+
});
|
|
1607
|
+
const s = e.property && pe(e.property), r = s ? s.$ref : e.collection || Te(), i = r ? ue(Se(r) ? r.value : r) : null;
|
|
1608
|
+
!r && process.env.NODE_ENV !== "production" && console.warn(`aeria-form was used without providing storeId or specifying
|
|
1609
|
+
collection prop, some features may not work as intended`);
|
|
1610
|
+
const y = Y(!1), m = D(() => !e.form && e.property ? "properties" in e.property ? e.property.properties : i == null ? void 0 : i.properties : e.form), v = D(() => e.layout || (i == null ? void 0 : i.description.formLayout)), d = (p) => {
|
|
1611
|
+
const E = ve(p, e[p]);
|
|
1612
|
+
return e[p] && fe(p, e[p]), E;
|
|
1613
|
+
}, o = D(() => e.validationErrors !== null ? e.validationErrors : i == null ? void 0 : i.validationErrors), $ = d("formComponents") || {}, b = d("propertyComponents") || {}, I = d("omitFormHeader"), j = d("omitInputLabels"), L = d("innerInputLabel");
|
|
1614
|
+
r && fe(Ee, r), fe("searchOnly", e.searchOnly);
|
|
1615
|
+
const q = (p) => m.value ? Object.entries(m.value).filter(([E, k]) => !k.noForm && p([
|
|
1616
|
+
E,
|
|
1617
|
+
k
|
|
1618
|
+
])) : null, O = (p) => {
|
|
1619
|
+
var k;
|
|
1620
|
+
if (e.searchOnly || !r)
|
|
1621
|
+
return !0;
|
|
1622
|
+
const E = e.property && "properties" in e.property ? e.property.form : (k = i == null ? void 0 : i.description) == null ? void 0 : k.form;
|
|
1623
|
+
return !E || E.includes(p);
|
|
1624
|
+
}, oe = q(([p]) => O(p)), x = je(), B = {}, h = (p, E) => {
|
|
1625
|
+
var S, T, J, ce;
|
|
1626
|
+
const k = [], F = ((T = (S = v.value) == null ? void 0 : S.fields) == null ? void 0 : T[p]) || ((ce = (J = v.value) == null ? void 0 : J.fields) == null ? void 0 : ce.$default);
|
|
1627
|
+
if (!E)
|
|
1628
|
+
return;
|
|
1629
|
+
if (F != null && F.if && !e.searchOnly) {
|
|
1630
|
+
const _e = Qe(
|
|
1631
|
+
e.modelValue,
|
|
1632
|
+
F.if
|
|
1633
|
+
);
|
|
1634
|
+
_e.satisfied || (B[p] && (i ? e.modelValue[p] = typeof i.$freshItem[p] == "object" ? Be(i.$freshItem[p]) : i.$freshItem[p] : e.modelValue[p] = [
|
|
1635
|
+
void 0,
|
|
1636
|
+
null
|
|
1637
|
+
].includes(e.modelValue[p]) ? null : e.modelValue[p].constructor()), k.push("display: none;")), B[p] = _e.satisfied;
|
|
1638
|
+
}
|
|
1639
|
+
const A = x.value.md && (F == null ? void 0 : F.span) || 6;
|
|
1640
|
+
return k.push(`
|
|
1641
|
+
--field-span: ${A};
|
|
1642
|
+
grid-column: span var(--field-span) / span var(--field-span);
|
|
1643
|
+
`), F && (F.verticalSpacing && k.push(`
|
|
1644
|
+
--vertical-spacing: ${F.verticalSpacing};
|
|
1645
|
+
padding: var(--vertical-spacing) 0;
|
|
1646
|
+
`), F.separator && k.push(`
|
|
1647
|
+
border-top: 1px solid var(--theme-border-color);
|
|
1648
|
+
border-width: 1px 0 1px 0;
|
|
1649
|
+
padding: 1rem 0;
|
|
1650
|
+
margin: 1rem 0;
|
|
1651
|
+
`)), k.join("");
|
|
1652
|
+
}, R = (p) => p === null || p instanceof Object && !Object.keys(p).length, te = D(() => e.required ? e.required : e.property && "required" in e.property ? e.property.required : i == null ? void 0 : i.description.required), ne = D(() => e.form ? Tt(
|
|
1653
|
+
e.modelValue,
|
|
1654
|
+
e.form,
|
|
1655
|
+
te.value,
|
|
1656
|
+
i == null ? void 0 : i.description
|
|
1657
|
+
) : !0), se = (p, E) => {
|
|
1658
|
+
var k;
|
|
1659
|
+
return (k = o.value) != null && k[p] && (typeof o.value[p].index != "number" || o.value[p].index === E) ? o.value[p].errors : null;
|
|
1660
|
+
};
|
|
1661
|
+
return (p, E) => {
|
|
1662
|
+
const k = ee("clickable"), F = ee("focus");
|
|
1663
|
+
return n(), l("form", {
|
|
1664
|
+
class: "form",
|
|
1665
|
+
style: $e(`row-gap: ${t(I) ? ".8rem" : "var(--form-internal-gap, 1.6rem);"};`)
|
|
1666
|
+
}, [
|
|
1667
|
+
p.$slots.header && !t(I) ? (n(), l("header", Fo, [
|
|
1668
|
+
C(p.$slots, "header", {}, void 0, !0)
|
|
1669
|
+
])) : f("", !0),
|
|
1670
|
+
C(p.$slots, "default", {}, void 0, !0),
|
|
1671
|
+
p.isReadOnly ? f("", !0) : (n(), l("fieldset", Mo, [
|
|
1672
|
+
(n(!0), l(K, null, H(t(oe), ([A, S]) => {
|
|
1673
|
+
var T, J, ce, _e, Xe, Ye, Je, Ke, Ze, Pe, Ne, xe, et;
|
|
1674
|
+
return n(), l("div", {
|
|
1675
|
+
key: `field-${A}`,
|
|
1676
|
+
style: $e(h(A, S)),
|
|
1677
|
+
class: "form__field"
|
|
1678
|
+
}, [
|
|
1679
|
+
(!("type" in S) || S.type !== "boolean" || p.searchOnly) && !S.noLabel && !t(j) && !t(L) ? (n(), l("label", qo, [
|
|
1680
|
+
V("div", {
|
|
1681
|
+
class: W({
|
|
1682
|
+
"form__field-label": !0,
|
|
1683
|
+
"form__field-label--section": "items" in S ? "properties" in S.items : "properties" in S,
|
|
1684
|
+
"form__field-required-hint": p.highlightRequired && !p.searchOnly && (!te.value || t(Ut)(A, te.value, p.modelValue))
|
|
1685
|
+
})
|
|
1686
|
+
}, w(S.description || t(z)(A)), 3),
|
|
1687
|
+
S.hint ? (n(), l("div", {
|
|
1688
|
+
key: 0,
|
|
1689
|
+
innerHTML: S.hint
|
|
1690
|
+
}, null, 8, Uo)) : f("", !0)
|
|
1691
|
+
])) : f("", !0),
|
|
1692
|
+
p.$slots[`field-${A}`] ? C(p.$slots, `field-${A}`, ae(G({ key: 1 }, {
|
|
1693
|
+
propery: S,
|
|
1694
|
+
properyName: A,
|
|
1695
|
+
modelValue: p.modelValue
|
|
1696
|
+
})), void 0, !0) : (ce = (J = (T = p.layout) == null ? void 0 : T.fields) == null ? void 0 : J[A]) != null && ce.component && t(b)[p.layout.fields[A].component.name] ? (n(), g(ye(t(b)[p.layout.fields[A].component.name]), G({
|
|
1697
|
+
key: 2,
|
|
1698
|
+
modelValue: p.modelValue[A],
|
|
1699
|
+
"onUpdate:modelValue": (N) => p.modelValue[A] = N
|
|
1700
|
+
}, {
|
|
1701
|
+
property: S,
|
|
1702
|
+
propertyName: A,
|
|
1703
|
+
...p.layout.fields[A].component.props || {}
|
|
1704
|
+
}, {
|
|
1705
|
+
onInput: (N) => a("input", A),
|
|
1706
|
+
onChange: E[0] || (E[0] = (N) => a("change", N))
|
|
1707
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])) : "format" in S && ["date", "date-time"].includes(S.format) && p.searchOnly ? (n(), l("div", {
|
|
1708
|
+
key: 3,
|
|
1709
|
+
style: { display: "grid", "grid-template-columns": "repeat(2, 1fr)", "column-gap": "1rem" },
|
|
1710
|
+
onInput: (N) => a("input", A),
|
|
1711
|
+
onChange: E[1] || (E[1] = (N) => a("change", N))
|
|
1712
|
+
}, [
|
|
1713
|
+
M(Ce, G({
|
|
1714
|
+
modelValue: p.modelValue[A].$gte,
|
|
1715
|
+
"onUpdate:modelValue": (N) => p.modelValue[A].$gte = N
|
|
1716
|
+
}, {
|
|
1717
|
+
property: S,
|
|
1718
|
+
propertyName: A
|
|
1719
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue"]),
|
|
1720
|
+
M(Ce, G({
|
|
1721
|
+
modelValue: p.modelValue[A].$lte,
|
|
1722
|
+
"onUpdate:modelValue": (N) => p.modelValue[A].$lte = N
|
|
1723
|
+
}, {
|
|
1724
|
+
property: S,
|
|
1725
|
+
propertyName: A
|
|
1726
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
1727
|
+
], 40, Eo)) : "type" in S && S.type === "boolean" && p.searchOnly ? (n(), l("div", zo, [
|
|
1728
|
+
M(ze, G({
|
|
1729
|
+
property: S,
|
|
1730
|
+
propertyName: A
|
|
1731
|
+
}, {
|
|
1732
|
+
"boolean-ref": "",
|
|
1733
|
+
"model-value": p.modelValue[A],
|
|
1734
|
+
onChange: E[2] || (E[2] = (N) => a("change", N)),
|
|
1735
|
+
"onUpdate:modelValue": (N) => {
|
|
1736
|
+
p.modelValue[A] = N == "true" ? !0 : N == "false" ? !1 : null;
|
|
1737
|
+
}
|
|
1738
|
+
}), {
|
|
1739
|
+
default: _(() => [
|
|
1740
|
+
V("option", Ho, w(t(z)("yes")), 1),
|
|
1741
|
+
V("option", Do, w(t(z)("no")), 1)
|
|
1742
|
+
]),
|
|
1743
|
+
_: 2
|
|
1744
|
+
}, 1040, ["model-value", "onUpdate:modelValue"])
|
|
1745
|
+
])) : p.modelValue && "items" in S && !S.uniqueItems && (!("$ref" in S.items) || S.items.inline || S.items.$ref === "file") ? (n(), l("div", Qo, [
|
|
1746
|
+
V("div", null, [
|
|
1747
|
+
M(ie, {
|
|
1748
|
+
small: "",
|
|
1749
|
+
variant: "alt",
|
|
1750
|
+
icon: "plus",
|
|
1751
|
+
disabled: !("inline" in S.items && S.items.inline) && (((_e = p.modelValue[A]) == null ? void 0 : _e.length) >= S.maxItems || R((Ye = p.modelValue[A]) == null ? void 0 : Ye[((Xe = p.modelValue[A]) == null ? void 0 : Xe.length) - 1])),
|
|
1752
|
+
onClick: Fe((N) => {
|
|
1753
|
+
p.modelValue[A] || (p.modelValue[A] = []), t(Lo)(p.modelValue[A], S);
|
|
1754
|
+
}, ["prevent"])
|
|
1755
|
+
}, {
|
|
1756
|
+
default: _(() => [
|
|
1757
|
+
Q(" Adicionar ")
|
|
1758
|
+
]),
|
|
1759
|
+
_: 2
|
|
1760
|
+
}, 1032, ["disabled", "onClick"])
|
|
1761
|
+
]),
|
|
1762
|
+
(n(!0), l(K, null, H(p.modelValue[A], (N, Ie) => {
|
|
1763
|
+
var tt, nt, ot, at, st, lt;
|
|
1764
|
+
return n(), l("div", {
|
|
1765
|
+
key: `rep-${A}-${Ie}`,
|
|
1766
|
+
style: { display: "flex", "column-gap": ".6rem", "align-items": "center" }
|
|
1767
|
+
}, [
|
|
1768
|
+
V("div", Go, [
|
|
1769
|
+
(n(), g(ye(t(ut)(S, t($))), G({
|
|
1770
|
+
modelValue: p.modelValue[A][Ie],
|
|
1771
|
+
"onUpdate:modelValue": (Oe) => p.modelValue[A][Ie] = Oe
|
|
1772
|
+
}, {
|
|
1773
|
+
property: S.items,
|
|
1774
|
+
propertyName: A,
|
|
1775
|
+
parentCollection: t(r),
|
|
1776
|
+
parentPropertyName: p.parentPropertyName,
|
|
1777
|
+
columns: ((ot = (nt = (tt = p.layout) == null ? void 0 : tt.fields) == null ? void 0 : nt[A]) == null ? void 0 : ot.optionsColumns) || ((lt = (st = (at = p.layout) == null ? void 0 : at.fields) == null ? void 0 : st.$default) == null ? void 0 : lt.optionsColumns),
|
|
1778
|
+
validationErrors: se(A, Ie),
|
|
1779
|
+
...S.componentProps || {}
|
|
1780
|
+
}, {
|
|
1781
|
+
onInput: (Oe) => a("input", A),
|
|
1782
|
+
onChange: E[3] || (E[3] = (Oe) => a("change", Oe))
|
|
1783
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"]))
|
|
1784
|
+
]),
|
|
1785
|
+
P(M(Z, {
|
|
1786
|
+
reactive: "",
|
|
1787
|
+
icon: "trash",
|
|
1788
|
+
onClick: (Oe) => t(Ro)(p.modelValue[A], Ie)
|
|
1789
|
+
}, null, 8, ["onClick"]), [
|
|
1790
|
+
[k]
|
|
1791
|
+
])
|
|
1792
|
+
]);
|
|
1793
|
+
}), 128))
|
|
1794
|
+
])) : p.modelValue ? P((n(), g(ye(t(ut)(S, t($))), G({
|
|
1795
|
+
key: 6,
|
|
1796
|
+
modelValue: p.modelValue[A],
|
|
1797
|
+
"onUpdate:modelValue": (N) => p.modelValue[A] = N
|
|
1798
|
+
}, {
|
|
1799
|
+
property: S,
|
|
1800
|
+
propertyName: A,
|
|
1801
|
+
parentPropertyName: p.parentPropertyName,
|
|
1802
|
+
parentCollection: t(r),
|
|
1803
|
+
columns: ((Ze = (Ke = (Je = p.layout) == null ? void 0 : Je.fields) == null ? void 0 : Ke[A]) == null ? void 0 : Ze.optionsColumns) || ((xe = (Ne = (Pe = p.layout) == null ? void 0 : Pe.fields) == null ? void 0 : Ne.$default) == null ? void 0 : xe.optionsColumns),
|
|
1804
|
+
...S.componentProps || {},
|
|
1805
|
+
validationErrors: se(A)
|
|
1806
|
+
}, {
|
|
1807
|
+
onInput: (N) => a("input", A),
|
|
1808
|
+
onChange: E[4] || (E[4] = (N) => a("change", N))
|
|
1809
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])), [
|
|
1810
|
+
[F, !y.value && (y.value = !!p.focus)]
|
|
1811
|
+
]) : f("", !0),
|
|
1812
|
+
(et = o.value) != null && et[A] ? (n(), l("div", Wo, [
|
|
1813
|
+
o.value[A].type ? (n(), l("span", Xo, w(t(z)(`validation_error.${o.value[A].type}`)), 1)) : f("", !0),
|
|
1814
|
+
o.value[A].detail ? (n(), l("span", Yo, w(t(z)(o.value[A].detail)), 1)) : f("", !0)
|
|
1815
|
+
])) : f("", !0)
|
|
1816
|
+
], 4);
|
|
1817
|
+
}), 128))
|
|
1818
|
+
])),
|
|
1819
|
+
p.$slots.after ? C(p.$slots, "after", { key: 2 }, void 0, !0) : f("", !0),
|
|
1820
|
+
p.$slots.footer ? (n(), l("div", Jo, [
|
|
1821
|
+
C(p.$slots, "footer", ae(be({
|
|
1822
|
+
isInsertReady: ne.value
|
|
1823
|
+
})), void 0, !0)
|
|
1824
|
+
])) : f("", !0)
|
|
1825
|
+
], 4);
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
});
|
|
1829
|
+
const He = /* @__PURE__ */ X(Ko, [["__scopeId", "data-v-d14d28ec"]]), Zo = /* @__PURE__ */ U({
|
|
1830
|
+
__name: "aeria-filter-panel",
|
|
1831
|
+
emits: ["update:modelValue"],
|
|
1832
|
+
setup(c, { emit: u }) {
|
|
1833
|
+
const e = u, a = ge(), s = Le(), r = () => {
|
|
1834
|
+
a.pagination.offset = 0, a.$actions.filter(), e("update:modelValue", !1), s.push({
|
|
1835
|
+
query: it(a)
|
|
1836
|
+
}), console.log(it(a));
|
|
1837
|
+
};
|
|
1838
|
+
return (i, y) => (n(), g(Ae, {
|
|
1839
|
+
"close-hint": "",
|
|
1840
|
+
"fixed-right": "",
|
|
1841
|
+
title: "Filtrar por",
|
|
1842
|
+
onClose: y[2] || (y[2] = (m) => e("update:modelValue", !1)),
|
|
1843
|
+
onOverlayClick: y[3] || (y[3] = (m) => e("update:modelValue", !1))
|
|
1844
|
+
}, {
|
|
1845
|
+
footer: _(() => [
|
|
1846
|
+
t(a).filtersCount > 0 ? (n(), g(ie, {
|
|
1847
|
+
key: 0,
|
|
1848
|
+
variant: "transparent",
|
|
1849
|
+
onClick: y[1] || (y[1] = (m) => {
|
|
1850
|
+
t(a).$actions.clearFilters(), r(), e("update:modelValue", !1);
|
|
1851
|
+
})
|
|
1852
|
+
}, {
|
|
1853
|
+
default: _(() => [
|
|
1854
|
+
Q(" Limpar "),
|
|
1855
|
+
M(he, null, {
|
|
1856
|
+
default: _(() => [
|
|
1857
|
+
Q(w(t(a).filtersCount), 1)
|
|
1858
|
+
]),
|
|
1859
|
+
_: 1
|
|
1860
|
+
})
|
|
1861
|
+
]),
|
|
1862
|
+
_: 1
|
|
1863
|
+
})) : f("", !0),
|
|
1864
|
+
M(ie, {
|
|
1865
|
+
large: "",
|
|
1866
|
+
icon: "funnel",
|
|
1867
|
+
disabled: !t(a).hasActiveFilters,
|
|
1868
|
+
onClick: r
|
|
1869
|
+
}, {
|
|
1870
|
+
default: _(() => [
|
|
1871
|
+
Q(" Filtrar ")
|
|
1872
|
+
]),
|
|
1873
|
+
_: 1
|
|
1874
|
+
}, 8, ["disabled"])
|
|
1875
|
+
]),
|
|
1876
|
+
default: _(() => [
|
|
1877
|
+
M(He, G({
|
|
1878
|
+
modelValue: t(a).filters,
|
|
1879
|
+
"onUpdate:modelValue": y[0] || (y[0] = (m) => t(a).filters = m)
|
|
1880
|
+
}, {
|
|
1881
|
+
searchOnly: !0,
|
|
1882
|
+
form: t(a).availableFilters,
|
|
1883
|
+
layout: t(a).description.formLayout || {}
|
|
1884
|
+
}, { focus: "" }), null, 16, ["modelValue"])
|
|
1885
|
+
]),
|
|
1886
|
+
_: 1
|
|
1887
|
+
}));
|
|
1888
|
+
}
|
|
1889
|
+
}), le = Y(!1), ct = Y(!1), ke = Y(!1), we = Y((...c) => null), dt = Y(), pt = !1, Po = /* @__PURE__ */ U({
|
|
1890
|
+
__name: "aeria-insert-panel",
|
|
1891
|
+
setup(c) {
|
|
1892
|
+
const u = ue("meta"), e = ue(u.view.collection), a = ve("individualActions", []), s = async () => {
|
|
1893
|
+
const i = await e.$actions.deepInsert();
|
|
1894
|
+
Et(i) || (le.value = !1);
|
|
1895
|
+
}, r = () => {
|
|
1896
|
+
u.$actions.ask({
|
|
1897
|
+
action: () => {
|
|
1898
|
+
e.$actions.clearItem(), e.validationErrors = {}, le.value = !1;
|
|
1899
|
+
},
|
|
1900
|
+
body: z("prompt.close_panel")
|
|
1901
|
+
});
|
|
1902
|
+
};
|
|
1903
|
+
return re(() => e.item._id, (i) => {
|
|
1904
|
+
i === null && (le.value = !1);
|
|
1905
|
+
}), (i, y) => {
|
|
1906
|
+
const m = ee("clickable");
|
|
1907
|
+
return n(), g(Ae, {
|
|
1908
|
+
modelValue: t(le),
|
|
1909
|
+
"onUpdate:modelValue": y[3] || (y[3] = (v) => Se(le) ? le.value = v : null),
|
|
1910
|
+
"fixed-right": "",
|
|
1911
|
+
loading: t(e).loading.get,
|
|
1912
|
+
onOverlayClick: r
|
|
1913
|
+
}, {
|
|
1914
|
+
header: _(() => [
|
|
1915
|
+
V("span", null, w((() => {
|
|
1916
|
+
switch (t(le)) {
|
|
1917
|
+
case "add":
|
|
1918
|
+
return t(z)("action.add");
|
|
1919
|
+
case "duplicate":
|
|
1920
|
+
return t(z)("action.duplicate");
|
|
1921
|
+
case "edit":
|
|
1922
|
+
default:
|
|
1923
|
+
return t(z)("action.edit");
|
|
1924
|
+
}
|
|
1925
|
+
})()), 1),
|
|
1926
|
+
V("span", null, " " + w(t(z)(t(u).view.collection)), 1)
|
|
1927
|
+
]),
|
|
1928
|
+
extra: _(() => [
|
|
1929
|
+
M(Ve, G({
|
|
1930
|
+
subject: t(e).item,
|
|
1931
|
+
actions: t(a).filter(({ action: v }) => v !== "ui/spawnEdit")
|
|
1932
|
+
}, {
|
|
1933
|
+
onActionClick: y[2] || (y[2] = (v) => le.value = !1)
|
|
1934
|
+
}), {
|
|
1935
|
+
default: _(() => [
|
|
1936
|
+
t(e).item._id ? P((n(), g(Z, {
|
|
1937
|
+
key: 0,
|
|
1938
|
+
reactive: "",
|
|
1939
|
+
icon: "dots-three"
|
|
1940
|
+
}, null, 512)), [
|
|
1941
|
+
[m]
|
|
1942
|
+
]) : f("", !0)
|
|
1943
|
+
]),
|
|
1944
|
+
_: 1
|
|
1945
|
+
}, 16)
|
|
1946
|
+
]),
|
|
1947
|
+
footer: _(() => [
|
|
1948
|
+
M(ie, {
|
|
1949
|
+
variant: "transparent",
|
|
1950
|
+
onClick: r
|
|
1951
|
+
}, {
|
|
1952
|
+
default: _(() => [
|
|
1953
|
+
Q(w(t(z)("action.cancel")), 1)
|
|
1954
|
+
]),
|
|
1955
|
+
_: 1
|
|
1956
|
+
}),
|
|
1957
|
+
M(ie, {
|
|
1958
|
+
large: "",
|
|
1959
|
+
disabled: !t(e).isInsertReady || pt || t(e).loading.get,
|
|
1960
|
+
loading: t(e).loading.insert,
|
|
1961
|
+
onClick: s
|
|
1962
|
+
}, {
|
|
1963
|
+
default: _(() => [
|
|
1964
|
+
Q(w(t(z)("action.insert")), 1)
|
|
1965
|
+
]),
|
|
1966
|
+
_: 1
|
|
1967
|
+
}, 8, ["disabled", "loading"])
|
|
1968
|
+
]),
|
|
1969
|
+
default: _(() => [
|
|
1970
|
+
M(He, G({
|
|
1971
|
+
modelValue: t(e).item,
|
|
1972
|
+
"onUpdate:modelValue": y[0] || (y[0] = (v) => t(e).item = v)
|
|
1973
|
+
}, {
|
|
1974
|
+
collection: t(u).view.collection,
|
|
1975
|
+
form: t(e).properties,
|
|
1976
|
+
isReadOnly: pt,
|
|
1977
|
+
layout: t(e).description.formLayout || {}
|
|
1978
|
+
}, {
|
|
1979
|
+
focus: "",
|
|
1980
|
+
onAdd: y[1] || (y[1] = (v) => v.preventDefault())
|
|
1981
|
+
}), de({ _: 2 }, [
|
|
1982
|
+
H(Object.keys(i.$slots).filter((v) => v.startsWith("field-")), (v) => ({
|
|
1983
|
+
name: v,
|
|
1984
|
+
fn: _((d) => [
|
|
1985
|
+
C(i.$slots, v, ae(be(d)))
|
|
1986
|
+
])
|
|
1987
|
+
}))
|
|
1988
|
+
]), 1040, ["modelValue"])
|
|
1989
|
+
]),
|
|
1990
|
+
_: 3
|
|
1991
|
+
}, 8, ["modelValue", "loading"]);
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
}), ht = (c, u) => {
|
|
1995
|
+
if (u) {
|
|
1996
|
+
if (!c) {
|
|
1997
|
+
u.filtersPreset = {}, u.preferredTableProperties = [], u.pagination.offset = 0;
|
|
1998
|
+
return;
|
|
1999
|
+
}
|
|
2000
|
+
u.filtersPreset = c.filters || {}, u.preferredTableProperties = c.table ? Array.from(c.table) : [], u.pagination.offset = 0;
|
|
2001
|
+
}
|
|
2002
|
+
}, No = (c, u = {
|
|
2003
|
+
persistInQuery: !0
|
|
2004
|
+
}) => {
|
|
2005
|
+
const a = Le().currentRoute;
|
|
2006
|
+
return re(() => a.value.query.section, (s) => {
|
|
2007
|
+
if (c) {
|
|
2008
|
+
if (c.description.filtersPresets) {
|
|
2009
|
+
const r = s || Object.keys(c.description.filtersPresets)[0];
|
|
2010
|
+
ht(c.description.filtersPresets[r], c);
|
|
2011
|
+
}
|
|
2012
|
+
if (u.persistInQuery) {
|
|
2013
|
+
const r = a.value.query;
|
|
2014
|
+
r.offset && (c.pagination.offset = +r.offset), r.limit && (c.pagination.limit = +r.limit), r.search && (c.textQuery = r.search, c.filters.$text = {
|
|
2015
|
+
$search: `"${r.search}"`,
|
|
2016
|
+
$caseSensitive: !1
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
}, {
|
|
2021
|
+
immediate: !0
|
|
2022
|
+
});
|
|
2023
|
+
}, xo = (c) => (qe("data-v-d8e1b8cf"), c = c(), Ue(), c), ea = {
|
|
2024
|
+
key: 0,
|
|
2025
|
+
class: "table aeria-surface"
|
|
2026
|
+
}, ta = { key: 0 }, na = { key: 1 }, oa = { key: 0 }, aa = ["checked"], sa = {
|
|
2027
|
+
key: 1,
|
|
2028
|
+
style: { "text-align": "right" }
|
|
2029
|
+
}, la = { key: 2 }, ia = { key: 3 }, ra = ["onClick"], ua = { key: 0 }, ca = ["value"], da = { class: "table__cell-mobile-label" }, pa = {
|
|
2030
|
+
key: 0,
|
|
2031
|
+
class: "table__cell-container"
|
|
2032
|
+
}, _a = {
|
|
2033
|
+
key: 1,
|
|
2034
|
+
class: "table__cell-container"
|
|
2035
|
+
}, ma = { class: "table__cell-grid" }, va = { key: 0 }, fa = { key: 1 }, ya = ["href"], $a = { key: 3 }, ha = { key: 2 }, ba = { key: 0 }, ga = { key: 1 }, ka = { key: 2 }, Va = {
|
|
2036
|
+
key: 1,
|
|
2037
|
+
class: "no-print"
|
|
2038
|
+
}, Ca = { class: "table__cell-actions" }, Aa = {
|
|
2039
|
+
key: 2,
|
|
2040
|
+
class: "no-print table__mobile-actions"
|
|
2041
|
+
}, Ia = ["id"], Oa = { key: 1 }, wa = /* @__PURE__ */ xo(() => /* @__PURE__ */ V("td", { colspan: 10 }, [
|
|
2042
|
+
/* @__PURE__ */ V("div", { class: "table__empty" }, " Não foram encontrados resultados. ")
|
|
2043
|
+
], -1)), Ba = [
|
|
2044
|
+
wa
|
|
2045
|
+
], Sa = /* @__PURE__ */ U({
|
|
2046
|
+
__name: "aeria-table",
|
|
2047
|
+
props: {
|
|
2048
|
+
columns: {},
|
|
2049
|
+
rows: {},
|
|
2050
|
+
collection: {},
|
|
2051
|
+
checkbox: { type: Boolean },
|
|
2052
|
+
actions: {},
|
|
2053
|
+
layout: {}
|
|
2054
|
+
},
|
|
2055
|
+
emits: ["itemClick"],
|
|
2056
|
+
setup(c, { emit: u }) {
|
|
2057
|
+
const e = c, a = u, s = je(), r = e.collection || Te(), i = r ? ue(typeof r == "string" ? r : r.value) : null, y = D({
|
|
2058
|
+
get: () => i == null ? void 0 : i.selected,
|
|
2059
|
+
set: ($) => i == null ? void 0 : i.$actions.selectManyItems($, !0)
|
|
2060
|
+
}), m = ($, b) => $ != null && $.button ? typeof $.button == "object" ? Qe(b, $.button).satisfied : $.button : !1, v = ($) => {
|
|
2061
|
+
var b;
|
|
2062
|
+
return !s.value.xl || !((b = e.layout) != null && b.actions) || !e.actions ? [] : e.actions.filter((I) => {
|
|
2063
|
+
const j = e.layout.actions[I.action];
|
|
2064
|
+
return m(j, $);
|
|
2065
|
+
});
|
|
2066
|
+
}, d = ($) => {
|
|
2067
|
+
var b;
|
|
2068
|
+
return e.actions ? !s.value.xl || !((b = e.layout) != null && b.actions) ? e.actions : e.actions.filter((I) => {
|
|
2069
|
+
const j = e.layout.actions[I.action];
|
|
2070
|
+
return !m(j, $);
|
|
2071
|
+
}) : [];
|
|
2072
|
+
}, o = ($, b) => {
|
|
2073
|
+
var L, q;
|
|
2074
|
+
const I = [], j = (q = (L = e.layout) == null ? void 0 : L.actions) == null ? void 0 : q[b.action];
|
|
2075
|
+
return j != null && j.if && (Qe(
|
|
2076
|
+
$,
|
|
2077
|
+
j.if
|
|
2078
|
+
).satisfied || I.push("display: none;")), I.join("");
|
|
2079
|
+
};
|
|
2080
|
+
return ($, b) => {
|
|
2081
|
+
var j, L, q;
|
|
2082
|
+
const I = ee("clickable");
|
|
2083
|
+
return $.columns && Object.keys($.columns).length > 0 || $.$slots.thead ? (n(), l("table", ea, [
|
|
2084
|
+
$.$slots.thead ? (n(), l("thead", ta, [
|
|
2085
|
+
C($.$slots, "thead", {}, void 0, !0)
|
|
2086
|
+
])) : (n(), l("thead", na, [
|
|
2087
|
+
V("tr", null, [
|
|
2088
|
+
$.checkbox && t(i) && t(s).md ? (n(), l("th", oa, [
|
|
2089
|
+
V("input", {
|
|
2090
|
+
type: "checkbox",
|
|
2091
|
+
checked: t(i).selected.length > 0 && t(i).selected.length === t(i).itemsCount,
|
|
2092
|
+
onChange: b[0] || (b[0] = (O) => t(i).$actions.selectAllItems(O.target.checked))
|
|
2093
|
+
}, null, 40, aa)
|
|
2094
|
+
])) : f("", !0),
|
|
2095
|
+
(n(!0), l(K, null, H(Object.entries($.columns), ([O, oe], x) => (n(), l("th", {
|
|
2096
|
+
key: `header-${x}`,
|
|
2097
|
+
class: "table__header"
|
|
2098
|
+
}, w(oe.description || t(z)(O)), 1))), 128)),
|
|
2099
|
+
(j = $.actions) != null && j.length ? (n(), l("th", sa)) : f("", !0)
|
|
2100
|
+
])
|
|
2101
|
+
])),
|
|
2102
|
+
$.$slots.tbody ? (n(), l("tbody", la, [
|
|
2103
|
+
C($.$slots, "tbody", {}, void 0, !0)
|
|
2104
|
+
])) : (n(), l("tbody", ia, [
|
|
2105
|
+
(n(!0), l(K, null, H($.rows, (O) => {
|
|
2106
|
+
var oe, x;
|
|
2107
|
+
return n(), l("tr", {
|
|
2108
|
+
key: O._id,
|
|
2109
|
+
onClick: (B) => a("itemClick", O)
|
|
2110
|
+
}, [
|
|
2111
|
+
t(i) && $.checkbox && t(s).md ? (n(), l("td", ua, [
|
|
2112
|
+
P(V("input", {
|
|
2113
|
+
"onUpdate:modelValue": b[1] || (b[1] = (B) => y.value = B),
|
|
2114
|
+
type: "checkbox",
|
|
2115
|
+
value: O._id
|
|
2116
|
+
}, null, 8, ca), [
|
|
2117
|
+
[Vt, y.value]
|
|
2118
|
+
])
|
|
2119
|
+
])) : f("", !0),
|
|
2120
|
+
(n(!0), l(K, null, H(Object.entries($.columns), ([B, h], R) => {
|
|
2121
|
+
var te, ne, se, p, E, k;
|
|
2122
|
+
return n(), l("td", {
|
|
2123
|
+
key: `column-${O._id}-${R}`
|
|
2124
|
+
}, [
|
|
2125
|
+
V("div", da, w(h.description || t(z)(B)), 1),
|
|
2126
|
+
`row-${B}` in $.$slots ? (n(), l("div", pa, [
|
|
2127
|
+
C($.$slots, `row-${B}`, ae(be({
|
|
2128
|
+
store: t(i),
|
|
2129
|
+
column: B,
|
|
2130
|
+
property: h,
|
|
2131
|
+
row: O
|
|
2132
|
+
})), void 0, !0)
|
|
2133
|
+
])) : (n(), l("div", _a, [
|
|
2134
|
+
V("div", ma, [
|
|
2135
|
+
"type" in h && h.type === "boolean" ? (n(), l("div", va, [
|
|
2136
|
+
O[B] ? (n(), g(Z, {
|
|
2137
|
+
key: 0,
|
|
2138
|
+
icon: "check",
|
|
2139
|
+
"icon-classes": "aeria-blueish"
|
|
2140
|
+
}, {
|
|
2141
|
+
default: _(() => [
|
|
2142
|
+
Q(w(t(z)("yes")), 1)
|
|
2143
|
+
]),
|
|
2144
|
+
_: 1
|
|
2145
|
+
})) : (n(), g(Z, {
|
|
2146
|
+
key: 1,
|
|
2147
|
+
icon: "x",
|
|
2148
|
+
"icon-classes": "aeria-redish"
|
|
2149
|
+
}, {
|
|
2150
|
+
default: _(() => [
|
|
2151
|
+
Q(w(t(z)("no")), 1)
|
|
2152
|
+
]),
|
|
2153
|
+
_: 1
|
|
2154
|
+
}))
|
|
2155
|
+
])) : ((te = t(pe)(h)) == null ? void 0 : te.$ref) === "file" ? (n(), l("div", fa, [
|
|
2156
|
+
/^image/.test((ne = O[B][0]) == null ? void 0 : ne.mime) && "items" in h ? (n(), g(Me, {
|
|
2157
|
+
key: 0,
|
|
2158
|
+
modelValue: O[B][0].link,
|
|
2159
|
+
"onUpdate:modelValue": (F) => O[B][0].link = F,
|
|
2160
|
+
expandable: "",
|
|
2161
|
+
meta: O[B][0],
|
|
2162
|
+
class: "table__picture"
|
|
2163
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : /^image/.test((se = O[B]) == null ? void 0 : se.mime) ? (n(), g(Me, {
|
|
2164
|
+
key: 1,
|
|
2165
|
+
modelValue: O[B].link,
|
|
2166
|
+
"onUpdate:modelValue": (F) => O[B].link = F,
|
|
2167
|
+
expandable: "",
|
|
2168
|
+
meta: O[B],
|
|
2169
|
+
class: "table__picture"
|
|
2170
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : (p = O[B]) != null && p.link ? (n(), l("a", {
|
|
2171
|
+
key: 2,
|
|
2172
|
+
href: O[B].link,
|
|
2173
|
+
style: { "font-size": "10pt" }
|
|
2174
|
+
}, w(O[B].filename), 9, ya)) : (n(), l("div", $a, " - "))
|
|
2175
|
+
])) : (n(), l("div", ha, [
|
|
2176
|
+
t(i) ? (n(), l("span", ba, w(t(i).$actions.formatValue({
|
|
2177
|
+
value: O[B],
|
|
2178
|
+
key: B,
|
|
2179
|
+
property: h
|
|
2180
|
+
})), 1)) : (n(), l("span", ga, w(Array.isArray(O[B]) ? O[B].filter((F) => !!F).join(", ") : [void 0, null].includes(O[B]) ? "-" : O[B]), 1)),
|
|
2181
|
+
((k = (E = t(pe)(h)) == null ? void 0 : E.indexes) == null ? void 0 : k.length) > 1 ? (n(), l("div", ka, [
|
|
2182
|
+
(n(!0), l(K, null, H(t(pe)(h).indexes.slice(1, 2), (F, A) => (n(), l("div", {
|
|
2183
|
+
key: `subvalue-${A}`,
|
|
2184
|
+
class: "table__cell-subvalue"
|
|
2185
|
+
}, w(t(i).$actions.formatValue({
|
|
2186
|
+
value: O[B],
|
|
2187
|
+
key: B,
|
|
2188
|
+
property: h,
|
|
2189
|
+
index: F
|
|
2190
|
+
})), 1))), 128))
|
|
2191
|
+
])) : f("", !0)
|
|
2192
|
+
]))
|
|
2193
|
+
])
|
|
2194
|
+
]))
|
|
2195
|
+
]);
|
|
2196
|
+
}), 128)),
|
|
2197
|
+
(oe = $.actions) != null && oe.length && t(s).md ? (n(), l("td", Va, [
|
|
2198
|
+
V("div", Ca, [
|
|
2199
|
+
(n(!0), l(K, null, H(v(O), (B) => (n(), g(ie, {
|
|
2200
|
+
key: `action-${B.action}`,
|
|
2201
|
+
small: "",
|
|
2202
|
+
variant: "transparent",
|
|
2203
|
+
icon: B.icon,
|
|
2204
|
+
style: $e(o(O, B)),
|
|
2205
|
+
onClick: (h) => B.click(O)
|
|
2206
|
+
}, {
|
|
2207
|
+
default: _(() => [
|
|
2208
|
+
Q(w(t(z)(B.name)), 1)
|
|
2209
|
+
]),
|
|
2210
|
+
_: 2
|
|
2211
|
+
}, 1032, ["icon", "style", "onClick"]))), 128)),
|
|
2212
|
+
d(O).length > 0 ? (n(), g(Ve, ae(G({ key: 0 }, {
|
|
2213
|
+
subject: O,
|
|
2214
|
+
actions: d(O)
|
|
2215
|
+
})), {
|
|
2216
|
+
default: _(() => [
|
|
2217
|
+
P(M(Z, {
|
|
2218
|
+
reactive: "",
|
|
2219
|
+
icon: "dots-three"
|
|
2220
|
+
}, null, 512), [
|
|
2221
|
+
[I]
|
|
2222
|
+
])
|
|
2223
|
+
]),
|
|
2224
|
+
_: 2
|
|
2225
|
+
}, 1040)) : f("", !0)
|
|
2226
|
+
])
|
|
2227
|
+
])) : (x = $.actions) != null && x.length ? (n(), l("td", Aa, [
|
|
2228
|
+
V("div", {
|
|
2229
|
+
class: "table__mobile-actions-grid",
|
|
2230
|
+
style: $e(`grid-template-columns: repeat(${v(O).length + (d(O).length ? 1 : 0)}, 1fr);`)
|
|
2231
|
+
}, [
|
|
2232
|
+
(n(!0), l(K, null, H(v(O), (B) => (n(), g(me, {
|
|
2233
|
+
key: `action-${B.action}`,
|
|
2234
|
+
class: "table__mobile-actions-button",
|
|
2235
|
+
onClick: (h) => B.click(O)
|
|
2236
|
+
}, {
|
|
2237
|
+
default: _(() => [
|
|
2238
|
+
M(Z, {
|
|
2239
|
+
icon: B.icon || "gear"
|
|
2240
|
+
}, {
|
|
2241
|
+
default: _(() => [
|
|
2242
|
+
Q(w(t(z)(B.name)), 1)
|
|
2243
|
+
]),
|
|
2244
|
+
_: 2
|
|
2245
|
+
}, 1032, ["icon"])
|
|
2246
|
+
]),
|
|
2247
|
+
_: 2
|
|
2248
|
+
}, 1032, ["onClick"]))), 128)),
|
|
2249
|
+
d(O).length > 0 ? (n(), g(Ve, ae(G({ key: 0 }, {
|
|
2250
|
+
subject: O,
|
|
2251
|
+
actions: d(O)
|
|
2252
|
+
})), {
|
|
2253
|
+
default: _(() => [
|
|
2254
|
+
M(Z, {
|
|
2255
|
+
icon: "dots-three",
|
|
2256
|
+
class: "table__mobile-actions-button"
|
|
2257
|
+
})
|
|
2258
|
+
]),
|
|
2259
|
+
_: 2
|
|
2260
|
+
}, 1040)) : f("", !0)
|
|
2261
|
+
], 4)
|
|
2262
|
+
])) : f("", !0),
|
|
2263
|
+
V("div", {
|
|
2264
|
+
id: `dropdown-${O._id}`
|
|
2265
|
+
}, null, 8, Ia)
|
|
2266
|
+
], 8, ra);
|
|
2267
|
+
}), 128))
|
|
2268
|
+
])),
|
|
2269
|
+
V("tfoot", null, [
|
|
2270
|
+
$.$slots.tfoot ? C($.$slots, "tfoot", { key: 0 }, void 0, !0) : $.columns && !((L = $.rows) != null && L.length) && !((q = t(i)) != null && q.loading.getAll) ? (n(), l("tr", Oa, Ba)) : f("", !0)
|
|
2271
|
+
])
|
|
2272
|
+
])) : f("", !0);
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
2275
|
+
});
|
|
2276
|
+
const ja = /* @__PURE__ */ X(Sa, [["__scopeId", "data-v-d8e1b8cf"]]), Ta = /* @__PURE__ */ U({
|
|
2277
|
+
__name: "aeria-tabular",
|
|
2278
|
+
props: {
|
|
2279
|
+
individualActions: {},
|
|
2280
|
+
layoutOptions: {},
|
|
2281
|
+
componentProps: {}
|
|
2282
|
+
},
|
|
2283
|
+
setup(c) {
|
|
2284
|
+
const u = c, e = ge(), a = Te(), s = D(() => {
|
|
2285
|
+
const r = {
|
|
2286
|
+
collection: a,
|
|
2287
|
+
checkbox: e.hasSelectionActions,
|
|
2288
|
+
columns: e.tableProperties,
|
|
2289
|
+
rows: e.items,
|
|
2290
|
+
actions: u.individualActions,
|
|
2291
|
+
layout: e.tableLayout
|
|
2292
|
+
};
|
|
2293
|
+
return Object.assign(r, u.componentProps);
|
|
2294
|
+
});
|
|
2295
|
+
return (r, i) => (n(), l("div", null, [
|
|
2296
|
+
r.$slots.inner ? C(r.$slots, "inner", { key: 0 }) : f("", !0),
|
|
2297
|
+
t(e).properties ? (n(), g(ja, G({ key: 1 }, s.value, {
|
|
2298
|
+
key: t(e).$id
|
|
2299
|
+
}), de({ _: 2 }, [
|
|
2300
|
+
H(Object.keys(r.$slots).filter((y) => !["inner"].includes(y)), (y) => ({
|
|
2301
|
+
name: y,
|
|
2302
|
+
fn: _((m) => [
|
|
2303
|
+
C(r.$slots, y, ae(be(m)))
|
|
2304
|
+
])
|
|
2305
|
+
}))
|
|
2306
|
+
]), 1040)) : f("", !0)
|
|
2307
|
+
]));
|
|
2308
|
+
}
|
|
2309
|
+
}), La = /* @__PURE__ */ U({
|
|
2310
|
+
__name: "aeria-grid",
|
|
2311
|
+
props: {
|
|
2312
|
+
list: { type: Boolean }
|
|
2313
|
+
},
|
|
2314
|
+
setup(c) {
|
|
2315
|
+
return (u, e) => (n(), l("div", {
|
|
2316
|
+
class: W(`
|
|
2317
|
+
grid
|
|
2318
|
+
${u.list && "grid--list"}
|
|
2319
|
+
`)
|
|
2320
|
+
}, [
|
|
2321
|
+
C(u.$slots, "default", {}, void 0, !0)
|
|
2322
|
+
], 2));
|
|
2323
|
+
}
|
|
2324
|
+
});
|
|
2325
|
+
const Ra = /* @__PURE__ */ X(La, [["__scopeId", "data-v-438c4aed"]]), Fa = { key: 0 }, Ma = {
|
|
2326
|
+
key: 1,
|
|
2327
|
+
class: "card__information"
|
|
2328
|
+
}, qa = /* @__PURE__ */ U({
|
|
2329
|
+
__name: "aeria-grid",
|
|
2330
|
+
props: {
|
|
2331
|
+
individualActions: {},
|
|
2332
|
+
hasSelectionActions: { type: Boolean },
|
|
2333
|
+
layoutOptions: {},
|
|
2334
|
+
componentName: {}
|
|
2335
|
+
},
|
|
2336
|
+
setup(c) {
|
|
2337
|
+
const e = c.layoutOptions, a = ge(), s = (r) => Array.isArray(r) ? r[0] : r;
|
|
2338
|
+
return (r, i) => {
|
|
2339
|
+
const y = ee("clickable");
|
|
2340
|
+
return n(), g(Ra, {
|
|
2341
|
+
list: r.componentName === "list"
|
|
2342
|
+
}, {
|
|
2343
|
+
default: _(() => [
|
|
2344
|
+
(n(!0), l(K, null, H(t(a).items, (m) => (n(), g(un, {
|
|
2345
|
+
key: m,
|
|
2346
|
+
inactive: !!(t(e).active && !m[t(e).active]),
|
|
2347
|
+
horizontal: r.componentName === "list"
|
|
2348
|
+
}, de({
|
|
2349
|
+
footer: _(() => [
|
|
2350
|
+
t(e).title ? (n(), l("div", Fa, w(m[t(e).title]), 1)) : f("", !0),
|
|
2351
|
+
t(e).information ? (n(), l("div", Ma, w(m[t(e).information]), 1)) : f("", !0)
|
|
2352
|
+
]),
|
|
2353
|
+
actions: _(() => [
|
|
2354
|
+
r.individualActions.length > 0 ? (n(), g(Ve, ae(G({ key: 0 }, {
|
|
2355
|
+
subject: m,
|
|
2356
|
+
actions: r.individualActions
|
|
2357
|
+
})), {
|
|
2358
|
+
default: _(() => [
|
|
2359
|
+
P(M(Z, {
|
|
2360
|
+
reactive: "",
|
|
2361
|
+
icon: "dots-three-vertical"
|
|
2362
|
+
}, null, 512), [
|
|
2363
|
+
[y]
|
|
2364
|
+
])
|
|
2365
|
+
]),
|
|
2366
|
+
_: 2
|
|
2367
|
+
}, 1040)) : f("", !0)
|
|
2368
|
+
]),
|
|
2369
|
+
default: _(() => {
|
|
2370
|
+
var v;
|
|
2371
|
+
return [
|
|
2372
|
+
M(Me, {
|
|
2373
|
+
expandable: "",
|
|
2374
|
+
url: (v = s(m[t(e).picture])) == null ? void 0 : v.link,
|
|
2375
|
+
meta: s(m[t(e).picture])
|
|
2376
|
+
}, null, 8, ["url", "meta"])
|
|
2377
|
+
];
|
|
2378
|
+
}),
|
|
2379
|
+
_: 2
|
|
2380
|
+
}, [
|
|
2381
|
+
t(e).badge && Array.isArray(m[t(e).badge]) ? {
|
|
2382
|
+
name: "badge",
|
|
2383
|
+
fn: _(() => [
|
|
2384
|
+
(n(!0), l(K, null, H(m[t(e).badge], (v) => (n(), g(he, {
|
|
2385
|
+
key: `${m._id}-${v}`,
|
|
2386
|
+
large: ""
|
|
2387
|
+
}, {
|
|
2388
|
+
default: _(() => [
|
|
2389
|
+
Q(w(t(e).translateBadge ? t(z)(v) : v), 1)
|
|
2390
|
+
]),
|
|
2391
|
+
_: 2
|
|
2392
|
+
}, 1024))), 128))
|
|
2393
|
+
]),
|
|
2394
|
+
key: "0"
|
|
2395
|
+
} : t(e).badge ? {
|
|
2396
|
+
name: "badge",
|
|
2397
|
+
fn: _(() => [
|
|
2398
|
+
M(he, null, {
|
|
2399
|
+
default: _(() => [
|
|
2400
|
+
Q(w(t(e).translateBadge ? t(z)(m[t(e).badge]) : m[t(e)[r.badge]]), 1)
|
|
2401
|
+
]),
|
|
2402
|
+
_: 2
|
|
2403
|
+
}, 1024)
|
|
2404
|
+
]),
|
|
2405
|
+
key: "1"
|
|
2406
|
+
} : void 0
|
|
2407
|
+
]), 1032, ["inactive", "horizontal"]))), 128))
|
|
2408
|
+
]),
|
|
2409
|
+
_: 1
|
|
2410
|
+
}, 8, ["list"]);
|
|
2411
|
+
};
|
|
2412
|
+
}
|
|
2413
|
+
});
|
|
2414
|
+
const _t = /* @__PURE__ */ X(qa, [["__scopeId", "data-v-e4d693b3"]]), Ua = (c) => ({
|
|
2415
|
+
tabular: Ta,
|
|
2416
|
+
grid: _t,
|
|
2417
|
+
list: _t
|
|
2418
|
+
})[c], Ea = (c) => (qe("data-v-94852509"), c = c(), Ue(), c), za = {
|
|
2419
|
+
key: 2,
|
|
2420
|
+
class: "crud__controls"
|
|
2421
|
+
}, Ha = {
|
|
2422
|
+
key: 0,
|
|
2423
|
+
class: "crud__search"
|
|
2424
|
+
}, Da = { class: "crud__actions" }, Qa = { class: "crud__context-badge" }, Ga = /* @__PURE__ */ Ea(() => /* @__PURE__ */ V("div", null, "Filtros", -1)), Wa = { key: 0 }, Xa = {
|
|
2425
|
+
key: 3,
|
|
2426
|
+
class: "crud__pagination"
|
|
2427
|
+
}, mt = 30, Ya = /* @__PURE__ */ U({
|
|
2428
|
+
__name: "aeria-crud",
|
|
2429
|
+
props: {
|
|
2430
|
+
collection: {},
|
|
2431
|
+
noControls: { type: Boolean },
|
|
2432
|
+
noActions: { type: Boolean },
|
|
2433
|
+
noFetch: { type: Boolean },
|
|
2434
|
+
noLayoutToggle: { type: Boolean },
|
|
2435
|
+
layout: {},
|
|
2436
|
+
action: {},
|
|
2437
|
+
componentProps: {},
|
|
2438
|
+
scrollPagination: { type: Boolean },
|
|
2439
|
+
noQueryPersistence: { type: Boolean }
|
|
2440
|
+
},
|
|
2441
|
+
emits: ["uiEvent"],
|
|
2442
|
+
setup(c, { emit: u }) {
|
|
2443
|
+
const e = c, a = u, s = Le(), r = yt({
|
|
2444
|
+
delay: 600
|
|
2445
|
+
}), i = ue("meta"), y = je(), { reachedEnd: m, detach: v } = We(null, {
|
|
2446
|
+
antecipate: 600
|
|
2447
|
+
}), d = !y.value.md || e.scrollPagination;
|
|
2448
|
+
d && re(m, (h) => {
|
|
2449
|
+
h && o.pagination.recordsTotal > o.items.length && b.value < mt && (b.value += 1, j());
|
|
2450
|
+
});
|
|
2451
|
+
const o = ue(e.collection);
|
|
2452
|
+
No(o, {
|
|
2453
|
+
persistInQuery: !e.noQueryPersistence
|
|
2454
|
+
});
|
|
2455
|
+
const $ = e.action ? Se(e.action) ? e.action.value : e.action : Lt(o, s);
|
|
2456
|
+
we.value = $[0], dt.value = $[1];
|
|
2457
|
+
const b = Y(0), I = Y(!1), j = async (h) => {
|
|
2458
|
+
o.activeFilters = Object.assign({}, (h == null ? void 0 : h.filters) || o.$filters), Object.assign(o.activeFilters, o.filtersPreset);
|
|
2459
|
+
const R = {
|
|
2460
|
+
filters: o.activeFilters,
|
|
2461
|
+
limit: o.pagination.limit,
|
|
2462
|
+
offset: o.pagination.offset,
|
|
2463
|
+
project: o.preferredTableProperties.length > 0 ? o.preferredTableProperties : o.description.table || Object.keys(o.properties)
|
|
2464
|
+
};
|
|
2465
|
+
b.value > 0 && (R.limit = 15, R.offset = b.value * R.limit), o.description.tableMeta && (R.project = R.project.concat(o.description.tableMeta)), h && Object.assign(R, h), o.loading.getAll = !0;
|
|
2466
|
+
const { data: te, pagination: ne } = await o.$actions.retrieveItems(R);
|
|
2467
|
+
o.pagination.recordsCount = ne.recordsCount, o.pagination.recordsTotal = ne.recordsTotal, b.value === 0 && o.items.splice(0), o.items.push(...te), o.loading.getAll = !1, I.value = !0;
|
|
2468
|
+
}, L = async (h) => {
|
|
2469
|
+
s.push({
|
|
2470
|
+
query: {
|
|
2471
|
+
...s.currentRoute.value.query,
|
|
2472
|
+
offset: h.offset,
|
|
2473
|
+
limit: h.limit
|
|
2474
|
+
}
|
|
2475
|
+
}), o.pagination.offset = h.offset, o.pagination.limit = h.limit, j();
|
|
2476
|
+
}, q = ve("emptyComponent", null);
|
|
2477
|
+
re(() => [
|
|
2478
|
+
s.currentRoute.value.path,
|
|
2479
|
+
s.currentRoute.value.query.section
|
|
2480
|
+
], async (h, R) => {
|
|
2481
|
+
if (R && R[0] === h[0] && R[1] === h[1])
|
|
2482
|
+
return;
|
|
2483
|
+
const te = s.currentRoute.value;
|
|
2484
|
+
if (i.view.title = e.collection, i.view.collection = e.collection, ct.value = !1, !e.noFetch && !te.query._popstate) {
|
|
2485
|
+
const ne = Rt(o, te);
|
|
2486
|
+
Object.keys(ne).length > 0 && Object.assign(o.filters, ne), await j();
|
|
2487
|
+
}
|
|
2488
|
+
}, {
|
|
2489
|
+
immediate: !0,
|
|
2490
|
+
flush: "post"
|
|
2491
|
+
});
|
|
2492
|
+
const [O] = r((h) => (s.push({
|
|
2493
|
+
query: {
|
|
2494
|
+
search: h || void 0
|
|
2495
|
+
}
|
|
2496
|
+
}), h ? (o.filters = Object.assign(Be(o.freshFilters), {
|
|
2497
|
+
$text: {
|
|
2498
|
+
$search: `"${h}"`,
|
|
2499
|
+
$caseSensitive: !1
|
|
2500
|
+
}
|
|
2501
|
+
}), j({
|
|
2502
|
+
offset: 0
|
|
2503
|
+
})) : (o.filters = Be(o.freshFilters), b.value = 0, j())));
|
|
2504
|
+
re(() => o.textQuery, (h) => {
|
|
2505
|
+
O(h);
|
|
2506
|
+
});
|
|
2507
|
+
const oe = (h) => {
|
|
2508
|
+
h.currentLayout = h.currentLayout === "tabular" ? h.description.layout.name : "tabular";
|
|
2509
|
+
};
|
|
2510
|
+
Ct(() => {
|
|
2511
|
+
o.$actions.clearFilters(), o.textQuery = "", v();
|
|
2512
|
+
}), re(() => dt.value, async (h) => {
|
|
2513
|
+
var ne;
|
|
2514
|
+
const R = Be(h);
|
|
2515
|
+
let te;
|
|
2516
|
+
if (R)
|
|
2517
|
+
if ([
|
|
2518
|
+
"spawnEdit",
|
|
2519
|
+
"spawnView",
|
|
2520
|
+
"duplicate"
|
|
2521
|
+
].includes(R.name) && (te = o.$actions.get({
|
|
2522
|
+
filters: {
|
|
2523
|
+
_id: R.params._id
|
|
2524
|
+
}
|
|
2525
|
+
})), R.name === "spawnAdd")
|
|
2526
|
+
o.$actions.clearItem(), (ne = R.params) != null && ne.item && (o.$actions.setItem(R.params.item), Object.keys(R.params.item).forEach((se) => {
|
|
2527
|
+
delete o.referenceItem[se];
|
|
2528
|
+
})), le.value = "add";
|
|
2529
|
+
else if (R.name === "spawnEdit")
|
|
2530
|
+
o.$actions.setItem(R.params), le.value = "edit";
|
|
2531
|
+
else if (R.name === "spawnView")
|
|
2532
|
+
ct.value = !0, le.value = "view";
|
|
2533
|
+
else if (R.name === "duplicate") {
|
|
2534
|
+
await te;
|
|
2535
|
+
const se = Object.entries(o.item).reduce((p, [E, k]) => {
|
|
2536
|
+
if (!(E in o.properties))
|
|
2537
|
+
return {
|
|
2538
|
+
...p,
|
|
2539
|
+
[E]: k
|
|
2540
|
+
};
|
|
2541
|
+
const F = o.properties[E];
|
|
2542
|
+
if (F.readOnly)
|
|
2543
|
+
return p;
|
|
2544
|
+
const A = (S) => {
|
|
2545
|
+
const T = pe(F);
|
|
2546
|
+
if (!T)
|
|
2547
|
+
return S;
|
|
2548
|
+
if (T.$ref === "file")
|
|
2549
|
+
return {};
|
|
2550
|
+
if (T.inline && S) {
|
|
2551
|
+
const { _id: J, ...ce } = S;
|
|
2552
|
+
return ce;
|
|
2553
|
+
}
|
|
2554
|
+
return S;
|
|
2555
|
+
};
|
|
2556
|
+
return k = Array.isArray(k) ? k.map(A) : A(k), {
|
|
2557
|
+
...p,
|
|
2558
|
+
[E]: k
|
|
2559
|
+
};
|
|
2560
|
+
}, {});
|
|
2561
|
+
o.$actions.setItem(se), delete o.item._id, o.referenceItem = {}, le.value = "duplicate";
|
|
2562
|
+
} else
|
|
2563
|
+
a("uiEvent", R);
|
|
2564
|
+
}, {
|
|
2565
|
+
deep: !0
|
|
2566
|
+
}), re(() => le, (h) => {
|
|
2567
|
+
h.value === !1 && (i.view.collection = e.collection, o.$actions.clearItem());
|
|
2568
|
+
});
|
|
2569
|
+
const x = D(() => o.individualActions.map((h) => ({
|
|
2570
|
+
click: we.value(h),
|
|
2571
|
+
...h
|
|
2572
|
+
}))), B = D(() => o.actions.filter((h) => !h.button));
|
|
2573
|
+
return fe(Ee, D(() => e.collection)), fe("individualActions", x), (h, R) => {
|
|
2574
|
+
var se, p, E, k, F, A, S;
|
|
2575
|
+
const te = ee("clickable"), ne = ee("loading");
|
|
2576
|
+
return n(), l(K, null, [
|
|
2577
|
+
t(ke) ? (n(), g(Zo, {
|
|
2578
|
+
key: t(o).$id,
|
|
2579
|
+
modelValue: t(ke),
|
|
2580
|
+
"onUpdate:modelValue": R[0] || (R[0] = (T) => Se(ke) ? ke.value = T : null)
|
|
2581
|
+
}, null, 8, ["modelValue"])) : f("", !0),
|
|
2582
|
+
t(le) ? (n(), g(Po, { key: 1 }, de({ _: 2 }, [
|
|
2583
|
+
H(Object.keys(h.$slots).filter((T) => T.startsWith("field-")), (T) => ({
|
|
2584
|
+
name: T,
|
|
2585
|
+
fn: _((J) => [
|
|
2586
|
+
C(h.$slots, T, ae(be(J)), void 0, !0)
|
|
2587
|
+
])
|
|
2588
|
+
}))
|
|
2589
|
+
]), 1024)) : f("", !0),
|
|
2590
|
+
!h.noActions && (t(o).description.search || Object.keys(t(o).availableFilters).length > 0 || ((se = t(o)) == null ? void 0 : se.actions.length) > 0 || h.$slots.actions || !h.noLayoutToggle && t(o).description.layout && ((p = t(o).description.layout) == null ? void 0 : p.name) !== "tabular") ? (n(), l("div", za, [
|
|
2591
|
+
t(o).description.search ? (n(), l("div", Ha, [
|
|
2592
|
+
M(Ce, G({
|
|
2593
|
+
modelValue: t(o).textQuery,
|
|
2594
|
+
"onUpdate:modelValue": R[1] || (R[1] = (T) => t(o).textQuery = T)
|
|
2595
|
+
}, {
|
|
2596
|
+
property: {
|
|
2597
|
+
type: "string",
|
|
2598
|
+
placeholder: t(o).description.search.placeholder || "Pesquise aqui",
|
|
2599
|
+
inputType: "search"
|
|
2600
|
+
}
|
|
2601
|
+
}), null, 16, ["modelValue"])
|
|
2602
|
+
])) : f("", !0),
|
|
2603
|
+
V("div", Da, [
|
|
2604
|
+
B.value.length > 0 || !h.noLayoutToggle && t(o).description.layout && ((E = t(o).description.layout) == null ? void 0 : E.name) !== "tabular" ? (n(), g(Ve, { key: 0 }, de({
|
|
2605
|
+
default: _(() => [
|
|
2606
|
+
M(ie, {
|
|
2607
|
+
variant: "alt",
|
|
2608
|
+
icon: "sliders"
|
|
2609
|
+
}, {
|
|
2610
|
+
default: _(() => [
|
|
2611
|
+
t(o).filtersCount ? (n(), g(he, { key: 0 }, {
|
|
2612
|
+
default: _(() => [
|
|
2613
|
+
Q(w(t(o).filtersCount), 1)
|
|
2614
|
+
]),
|
|
2615
|
+
_: 1
|
|
2616
|
+
})) : f("", !0)
|
|
2617
|
+
]),
|
|
2618
|
+
_: 1
|
|
2619
|
+
})
|
|
2620
|
+
]),
|
|
2621
|
+
_: 2
|
|
2622
|
+
}, [
|
|
2623
|
+
Object.keys(t(o).availableFilters).length > 0 ? {
|
|
2624
|
+
name: "filter",
|
|
2625
|
+
fn: _(() => [
|
|
2626
|
+
P((n(), g(Z, {
|
|
2627
|
+
icon: "funnel",
|
|
2628
|
+
onClick: R[2] || (R[2] = (T) => ke.value = !0)
|
|
2629
|
+
}, {
|
|
2630
|
+
default: _(() => [
|
|
2631
|
+
Q(" Filtros ")
|
|
2632
|
+
]),
|
|
2633
|
+
_: 1
|
|
2634
|
+
})), [
|
|
2635
|
+
[te]
|
|
2636
|
+
]),
|
|
2637
|
+
V("div", Qa, [
|
|
2638
|
+
t(o).filtersCount ? (n(), g(he, { key: 0 }, {
|
|
2639
|
+
default: _(() => [
|
|
2640
|
+
Q(w(t(o).filtersCount), 1)
|
|
2641
|
+
]),
|
|
2642
|
+
_: 1
|
|
2643
|
+
})) : f("", !0)
|
|
2644
|
+
])
|
|
2645
|
+
]),
|
|
2646
|
+
key: "0"
|
|
2647
|
+
} : void 0,
|
|
2648
|
+
!h.noLayoutToggle && t(o).description.layout && ((k = t(o).description.layout) == null ? void 0 : k.name) !== "tabular" ? {
|
|
2649
|
+
name: "layout-toggle",
|
|
2650
|
+
fn: _(() => [
|
|
2651
|
+
P((n(), g(Z, {
|
|
2652
|
+
icon: "table",
|
|
2653
|
+
onClick: R[3] || (R[3] = (T) => oe(t(o)))
|
|
2654
|
+
}, {
|
|
2655
|
+
default: _(() => [
|
|
2656
|
+
Q(" Alternar layout ")
|
|
2657
|
+
]),
|
|
2658
|
+
_: 1
|
|
2659
|
+
})), [
|
|
2660
|
+
[te]
|
|
2661
|
+
])
|
|
2662
|
+
]),
|
|
2663
|
+
key: "1"
|
|
2664
|
+
} : void 0,
|
|
2665
|
+
H(B.value, (T, J) => ({
|
|
2666
|
+
name: `action-${J}`,
|
|
2667
|
+
fn: _(() => [
|
|
2668
|
+
T ? (n(), g(Z, {
|
|
2669
|
+
key: 0,
|
|
2670
|
+
icon: T.icon || "gear",
|
|
2671
|
+
disabled: t(o).selected.length === 0 && T.selection,
|
|
2672
|
+
onClick: (ce) => t(we)(T)({ _id: t(o).selected.map((_e) => _e._id) })
|
|
2673
|
+
}, {
|
|
2674
|
+
default: _(() => [
|
|
2675
|
+
Q(w(t(z)(T.name)), 1)
|
|
2676
|
+
]),
|
|
2677
|
+
_: 2
|
|
2678
|
+
}, 1032, ["icon", "disabled", "onClick"])) : f("", !0)
|
|
2679
|
+
])
|
|
2680
|
+
}))
|
|
2681
|
+
]), 1024)) : Object.keys(t(o).availableFilters).length > 0 ? (n(), g(ie, {
|
|
2682
|
+
key: 1,
|
|
2683
|
+
variant: "alt",
|
|
2684
|
+
icon: "funnel",
|
|
2685
|
+
onClick: R[4] || (R[4] = (T) => ke.value = !0)
|
|
2686
|
+
}, {
|
|
2687
|
+
default: _(() => [
|
|
2688
|
+
Ga,
|
|
2689
|
+
t(o).filtersCount ? (n(), g(he, { key: 0 }, {
|
|
2690
|
+
default: _(() => [
|
|
2691
|
+
Q(w(t(o).filtersCount), 1)
|
|
2692
|
+
]),
|
|
2693
|
+
_: 1
|
|
2694
|
+
})) : f("", !0)
|
|
2695
|
+
]),
|
|
2696
|
+
_: 1
|
|
2697
|
+
})) : f("", !0),
|
|
2698
|
+
(n(!0), l(K, null, H(t(o).actions.filter((T) => T.button), (T, J) => (n(), g(ie, {
|
|
2699
|
+
key: `action-${J}`,
|
|
2700
|
+
icon: T.icon,
|
|
2701
|
+
disabled: t(o).selected.length === 0 && T.selection,
|
|
2702
|
+
onClick: (ce) => t(we)(T)({ _id: t(o).selected.map((_e) => _e._id) })
|
|
2703
|
+
}, {
|
|
2704
|
+
default: _(() => [
|
|
2705
|
+
Q(w(t(z)(T.name)), 1)
|
|
2706
|
+
]),
|
|
2707
|
+
_: 2
|
|
2708
|
+
}, 1032, ["icon", "disabled", "onClick"]))), 128)),
|
|
2709
|
+
h.$slots.actions ? C(h.$slots, "actions", { key: 2 }, void 0, !0) : f("", !0)
|
|
2710
|
+
])
|
|
2711
|
+
])) : f("", !0),
|
|
2712
|
+
P((n(), l("div", null, [
|
|
2713
|
+
t(o).itemsCount === 0 && !t(o).loading.getAll && I.value && (t(q) || h.$slots.empty) ? (n(), l("div", Wa, [
|
|
2714
|
+
t(q) ? (n(), g(ye(t(q)), ae(G({ key: 0 }, {
|
|
2715
|
+
collection: t(o).$id
|
|
2716
|
+
})), {
|
|
2717
|
+
default: _(() => [
|
|
2718
|
+
t(o).filtersCount === 0 && t(o).description.actions && "ui:spawnAdd" in t(o).description.actions ? (n(), g(ie, {
|
|
2719
|
+
key: 0,
|
|
2720
|
+
icon: "plus",
|
|
2721
|
+
onClick: R[5] || (R[5] = (T) => t(we)({
|
|
2722
|
+
action: "ui:spawnAdd"
|
|
2723
|
+
})())
|
|
2724
|
+
}, {
|
|
2725
|
+
default: _(() => [
|
|
2726
|
+
Q(" Adicionar primeiro item ")
|
|
2727
|
+
]),
|
|
2728
|
+
_: 1
|
|
2729
|
+
})) : f("", !0)
|
|
2730
|
+
]),
|
|
2731
|
+
_: 1
|
|
2732
|
+
}, 16)) : C(h.$slots, "empty", ae(G({ key: 1 }, {
|
|
2733
|
+
collection: t(o).$id
|
|
2734
|
+
})), void 0, !0)
|
|
2735
|
+
])) : h.$slots.component ? C(h.$slots, "component", ae(G({ key: 1 }, {
|
|
2736
|
+
store: t(o)
|
|
2737
|
+
})), void 0, !0) : (n(), g(ye(t(Ua)(((F = h.layout) == null ? void 0 : F.name) || t(o).$currentLayout)), G({ key: 2 }, {
|
|
2738
|
+
individualActions: x.value,
|
|
2739
|
+
layoutOptions: ((A = h.layout) == null ? void 0 : A.options) || t(o).layout.options,
|
|
2740
|
+
componentProps: h.componentProps
|
|
2741
|
+
}, {
|
|
2742
|
+
"component-name": ((S = h.layout) == null ? void 0 : S.name) || t(o).$currentLayout
|
|
2743
|
+
}), de({ _: 2 }, [
|
|
2744
|
+
H(Object.keys(h.$slots).filter((T) => T.startsWith("row-")), (T) => ({
|
|
2745
|
+
name: T,
|
|
2746
|
+
fn: _((J) => [
|
|
2747
|
+
C(h.$slots, T, ae(be(J)), void 0, !0)
|
|
2748
|
+
])
|
|
2749
|
+
})),
|
|
2750
|
+
h.$slots.tfoot ? {
|
|
2751
|
+
name: "tfoot",
|
|
2752
|
+
fn: _(() => [
|
|
2753
|
+
C(h.$slots, "tfoot", {}, void 0, !0)
|
|
2754
|
+
]),
|
|
2755
|
+
key: "0"
|
|
2756
|
+
} : void 0
|
|
2757
|
+
]), 1040, ["component-name"]))
|
|
2758
|
+
])), [
|
|
2759
|
+
[ne, (!t(d) || b.value === mt) && t(o).loading.getAll]
|
|
2760
|
+
]),
|
|
2761
|
+
!t(o).loading.getAll && t(o).itemsCount > 0 ? (n(), l("div", Xa, [
|
|
2762
|
+
M(Tn, {
|
|
2763
|
+
pagination: t(o).pagination,
|
|
2764
|
+
onPaginate: L
|
|
2765
|
+
}, null, 8, ["pagination"])
|
|
2766
|
+
])) : f("", !0)
|
|
2767
|
+
], 64);
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
});
|
|
2771
|
+
const Ss = /* @__PURE__ */ X(Ya, [["__scopeId", "data-v-94852509"]]), Ja = { class: "prompt" }, Ka = /* @__PURE__ */ U({
|
|
2772
|
+
__name: "aeria-prompt",
|
|
2773
|
+
props: {
|
|
2774
|
+
title: {},
|
|
2775
|
+
actions: {}
|
|
2776
|
+
},
|
|
2777
|
+
setup(c) {
|
|
2778
|
+
const u = ue("meta"), e = (a) => {
|
|
2779
|
+
u.$actions.fulfillPrompt(a);
|
|
2780
|
+
};
|
|
2781
|
+
return (a, s) => (n(), g(Ae, {
|
|
2782
|
+
float: "",
|
|
2783
|
+
"fill-footer": "",
|
|
2784
|
+
"close-hint": !1,
|
|
2785
|
+
style: { "--panel-min-width": "32rem" }
|
|
2786
|
+
}, de({
|
|
2787
|
+
footer: _(() => [
|
|
2788
|
+
V("div", {
|
|
2789
|
+
class: "prompt__actions",
|
|
2790
|
+
style: $e(`grid-template-columns: repeat(${a.actions.length}, 1fr)`)
|
|
2791
|
+
}, [
|
|
2792
|
+
(n(!0), l(K, null, H(a.actions, (r, i) => (n(), g(me, {
|
|
2793
|
+
key: `action-${i}`,
|
|
2794
|
+
class: W(`
|
|
2795
|
+
prompt__action
|
|
2796
|
+
prompt__action--${r.variant || "primary"}
|
|
2797
|
+
`),
|
|
2798
|
+
onClick: (y) => r.click ? r.click(r) : e(r)
|
|
2799
|
+
}, {
|
|
2800
|
+
default: _(() => [
|
|
2801
|
+
Q(w(r.title || r.name), 1)
|
|
2802
|
+
]),
|
|
2803
|
+
_: 2
|
|
2804
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
2805
|
+
], 4)
|
|
2806
|
+
]),
|
|
2807
|
+
default: _(() => [
|
|
2808
|
+
V("div", Ja, [
|
|
2809
|
+
C(a.$slots, "default", {}, void 0, !0)
|
|
2810
|
+
])
|
|
2811
|
+
]),
|
|
2812
|
+
_: 2
|
|
2813
|
+
}, [
|
|
2814
|
+
a.title ? {
|
|
2815
|
+
name: "title",
|
|
2816
|
+
fn: _(() => [
|
|
2817
|
+
Q(w(a.title), 1)
|
|
2818
|
+
]),
|
|
2819
|
+
key: "0"
|
|
2820
|
+
} : void 0
|
|
2821
|
+
]), 1024));
|
|
2822
|
+
}
|
|
2823
|
+
});
|
|
2824
|
+
const Za = /* @__PURE__ */ X(Ka, [["__scopeId", "data-v-73673b07"]]), Pa = { class: "toast__content" }, Na = { class: "toast__time" }, xa = /* @__PURE__ */ U({
|
|
2825
|
+
__name: "aeria-toast",
|
|
2826
|
+
props: {
|
|
2827
|
+
idx: {},
|
|
2828
|
+
itr: {},
|
|
2829
|
+
date: {},
|
|
2830
|
+
icon: {}
|
|
2831
|
+
},
|
|
2832
|
+
setup(c) {
|
|
2833
|
+
const u = ue("meta");
|
|
2834
|
+
return (e, a) => {
|
|
2835
|
+
const s = ee("clickable");
|
|
2836
|
+
return P((n(), l("div", {
|
|
2837
|
+
class: W({
|
|
2838
|
+
toast: !0,
|
|
2839
|
+
"toast--animate": t(u).toasts[0].itr === e.itr
|
|
2840
|
+
}),
|
|
2841
|
+
onAnimationend: a[0] || (a[0] = (r) => t(u).$actions.popToast()),
|
|
2842
|
+
onClick: a[1] || (a[1] = (r) => t(u).$actions.popToast(e.itr))
|
|
2843
|
+
}, [
|
|
2844
|
+
M(Z, G(
|
|
2845
|
+
e.icon ? { icon: e.icon } : { icon: "warning-circle" },
|
|
2846
|
+
{ style: { "--icon-size": "4rem", "--icon-color": "var(--theme-brand-color-shade-3)" } }
|
|
2847
|
+
), null, 16),
|
|
2848
|
+
V("div", Pa, [
|
|
2849
|
+
C(e.$slots, "default", {}, void 0, !0),
|
|
2850
|
+
V("div", Na, w(e.formatDateTime(e.date, { hoursOnly: !0 })), 1)
|
|
2851
|
+
])
|
|
2852
|
+
], 34)), [
|
|
2853
|
+
[s]
|
|
2854
|
+
]);
|
|
2855
|
+
};
|
|
2856
|
+
}
|
|
2857
|
+
});
|
|
2858
|
+
const es = /* @__PURE__ */ X(xa, [["__scopeId", "data-v-54736bc3"]]), ts = ["innerHTML"], ns = { class: "main__toasts" }, os = ["innerHTML"], as = /* @__PURE__ */ U({
|
|
2859
|
+
__name: "aeria-main",
|
|
2860
|
+
setup(c) {
|
|
2861
|
+
const u = ue("meta"), e = D(() => u.themeOverride || u.theme);
|
|
2862
|
+
return (a, s) => {
|
|
2863
|
+
const r = At("router-view");
|
|
2864
|
+
return n(), l("main", {
|
|
2865
|
+
id: "main",
|
|
2866
|
+
class: W(`
|
|
2867
|
+
main
|
|
2868
|
+
main--${e.value}
|
|
2869
|
+
${e.value === "dark" && "tw-dark"}
|
|
2870
|
+
`)
|
|
2871
|
+
}, [
|
|
2872
|
+
(n(), g(It, null, {
|
|
2873
|
+
default: _(() => [
|
|
2874
|
+
M(r, null, {
|
|
2875
|
+
default: _(({ Component: i }) => [
|
|
2876
|
+
(n(), g(ye(i), null, de({ _: 2 }, [
|
|
2877
|
+
H(Object.keys(a.$slots), (y) => ({
|
|
2878
|
+
name: y,
|
|
2879
|
+
fn: _(() => [
|
|
2880
|
+
C(a.$slots, y, {}, void 0, !0)
|
|
2881
|
+
])
|
|
2882
|
+
}))
|
|
2883
|
+
]), 1024))
|
|
2884
|
+
]),
|
|
2885
|
+
_: 3
|
|
2886
|
+
})
|
|
2887
|
+
]),
|
|
2888
|
+
_: 3
|
|
2889
|
+
})),
|
|
2890
|
+
C(a.$slots, "default", {}, void 0, !0),
|
|
2891
|
+
M(Ae, G({
|
|
2892
|
+
modelValue: t(u).modal.visible,
|
|
2893
|
+
"onUpdate:modelValue": s[0] || (s[0] = (i) => t(u).modal.visible = i),
|
|
2894
|
+
float: "",
|
|
2895
|
+
"close-hint": ""
|
|
2896
|
+
}, t(u).modal, {
|
|
2897
|
+
"overlay-layer": 70,
|
|
2898
|
+
onOverlayClick: s[1] || (s[1] = (i) => t(u).modal.visible = !1)
|
|
2899
|
+
}), {
|
|
2900
|
+
default: _(() => [
|
|
2901
|
+
t(u).modal.body ? (n(), l("div", {
|
|
2902
|
+
key: 0,
|
|
2903
|
+
style: { "white-space": "pre-wrap" },
|
|
2904
|
+
innerHTML: t(u).modal.body
|
|
2905
|
+
}, null, 8, ts)) : f("", !0),
|
|
2906
|
+
t(u).modal.component ? (n(), g(ye(t(u).modal.component), { key: 1 })) : f("", !0)
|
|
2907
|
+
]),
|
|
2908
|
+
_: 1
|
|
2909
|
+
}, 16, ["modelValue"]),
|
|
2910
|
+
t(u).prompt.visible ? (n(), g(Za, ae(G({ key: 0 }, t(u).prompt)), {
|
|
2911
|
+
default: _(() => [
|
|
2912
|
+
Q(w(t(u).prompt.body), 1)
|
|
2913
|
+
]),
|
|
2914
|
+
_: 1
|
|
2915
|
+
}, 16)) : f("", !0),
|
|
2916
|
+
V("div", ns, [
|
|
2917
|
+
(n(!0), l(K, null, H(t(u).toasts, (i) => (n(), g(es, G(i, {
|
|
2918
|
+
key: `toast-${i.itr}`
|
|
2919
|
+
}), {
|
|
2920
|
+
default: _(() => [
|
|
2921
|
+
V("div", {
|
|
2922
|
+
innerHTML: t(z)(i.text)
|
|
2923
|
+
}, null, 8, os)
|
|
2924
|
+
]),
|
|
2925
|
+
_: 2
|
|
2926
|
+
}, 1040))), 128))
|
|
2927
|
+
])
|
|
2928
|
+
], 2);
|
|
2929
|
+
};
|
|
2930
|
+
}
|
|
2931
|
+
});
|
|
2932
|
+
const js = /* @__PURE__ */ X(as, [["__scopeId", "data-v-1166be3d"]]);
|
|
2933
|
+
const ss = {}, ls = { class: "menu" };
|
|
2934
|
+
function is(c, u) {
|
|
2935
|
+
return n(), l("menu", ls, [
|
|
2936
|
+
(n(!0), l(K, null, H(Object.keys(c.$slots), (e) => (n(), l("div", {
|
|
2937
|
+
key: e,
|
|
2938
|
+
class: "menu__entry"
|
|
2939
|
+
}, [
|
|
2940
|
+
C(c.$slots, e, {}, void 0, !0)
|
|
2941
|
+
]))), 128))
|
|
2942
|
+
]);
|
|
2943
|
+
}
|
|
2944
|
+
const Ts = /* @__PURE__ */ X(ss, [["render", is], ["__scopeId", "data-v-3cfef7fb"]]), rs = { class: "tabs" }, us = {
|
|
2945
|
+
key: 0,
|
|
2946
|
+
class: "tabs__horizontal"
|
|
2947
|
+
}, cs = {
|
|
2948
|
+
key: 0,
|
|
2949
|
+
class: "tabs__tab tabs__tab--info"
|
|
2950
|
+
}, ds = ["onClick"], ps = {
|
|
2951
|
+
key: 1,
|
|
2952
|
+
class: "tabs__context-menu"
|
|
2953
|
+
}, _s = ["onClick"], ms = /* @__PURE__ */ U({
|
|
2954
|
+
__name: "aeria-tabs",
|
|
2955
|
+
props: {
|
|
2956
|
+
query: {},
|
|
2957
|
+
param: {},
|
|
2958
|
+
dropdown: { type: Boolean }
|
|
2959
|
+
},
|
|
2960
|
+
setup(c) {
|
|
2961
|
+
const u = c, e = Ot(), a = Le(), s = je(), r = "query" in u && u.query ? "query" : "params", i = D(() => {
|
|
2962
|
+
const m = a.currentRoute.value[r][u.query || u.param];
|
|
2963
|
+
return m || Object.keys(e)[0];
|
|
2964
|
+
}), y = (m) => {
|
|
2965
|
+
if (r === "query") {
|
|
2966
|
+
a.push({
|
|
2967
|
+
query: {
|
|
2968
|
+
...a.currentRoute.value.query,
|
|
2969
|
+
[u.query]: m
|
|
2970
|
+
}
|
|
2971
|
+
});
|
|
2972
|
+
return;
|
|
2973
|
+
}
|
|
2974
|
+
a.push({
|
|
2975
|
+
params: {
|
|
2976
|
+
[u.param]: m
|
|
2977
|
+
}
|
|
2978
|
+
});
|
|
2979
|
+
};
|
|
2980
|
+
return (m, v) => {
|
|
2981
|
+
const d = ee("clickable");
|
|
2982
|
+
return n(), l("div", rs, [
|
|
2983
|
+
t(s).md && !m.dropdown ? (n(), l("div", us, [
|
|
2984
|
+
m.$slots.default ? (n(), l("div", cs, [
|
|
2985
|
+
C(m.$slots, "default", {}, void 0, !0)
|
|
2986
|
+
])) : f("", !0),
|
|
2987
|
+
(n(!0), l(K, null, H(Object.keys(m.$slots).filter((o) => o !== "default"), (o, $) => (n(), l("div", {
|
|
2988
|
+
key: o,
|
|
2989
|
+
class: W({
|
|
2990
|
+
tabs__tab: !0,
|
|
2991
|
+
"tabs__tab--current": o === i.value || !i.value && $ === 0
|
|
2992
|
+
}),
|
|
2993
|
+
onClick: (b) => y(o)
|
|
2994
|
+
}, [
|
|
2995
|
+
C(m.$slots, o, {}, void 0, !0)
|
|
2996
|
+
], 10, ds))), 128))
|
|
2997
|
+
])) : (n(), l("div", ps, [
|
|
2998
|
+
M(Ve, null, de({
|
|
2999
|
+
default: _(() => [
|
|
3000
|
+
P((n(), g(Z, {
|
|
3001
|
+
"icon-right": "",
|
|
3002
|
+
icon: "caret-down",
|
|
3003
|
+
style: { "--icon-color": "var(--theme-brand-color-shade-1)" },
|
|
3004
|
+
class: "tabs__context-menu-icon"
|
|
3005
|
+
}, {
|
|
3006
|
+
default: _(() => [
|
|
3007
|
+
C(m.$slots, i.value, {}, void 0, !0)
|
|
3008
|
+
]),
|
|
3009
|
+
_: 3
|
|
3010
|
+
})), [
|
|
3011
|
+
[d]
|
|
3012
|
+
])
|
|
3013
|
+
]),
|
|
3014
|
+
_: 2
|
|
3015
|
+
}, [
|
|
3016
|
+
H(Object.keys(m.$slots).filter((o) => o !== "default"), (o) => ({
|
|
3017
|
+
name: o,
|
|
3018
|
+
fn: _(() => [
|
|
3019
|
+
V("div", {
|
|
3020
|
+
onClick: ($) => y(o)
|
|
3021
|
+
}, [
|
|
3022
|
+
C(m.$slots, o, {}, void 0, !0)
|
|
3023
|
+
], 8, _s)
|
|
3024
|
+
])
|
|
3025
|
+
}))
|
|
3026
|
+
]), 1024)
|
|
3027
|
+
]))
|
|
3028
|
+
]);
|
|
3029
|
+
};
|
|
3030
|
+
}
|
|
3031
|
+
});
|
|
3032
|
+
const vs = /* @__PURE__ */ X(ms, [["__scopeId", "data-v-d12cddeb"]]), fs = U({
|
|
3033
|
+
props: {
|
|
3034
|
+
initialValue: String,
|
|
3035
|
+
promise: Promise
|
|
3036
|
+
},
|
|
3037
|
+
setup(c) {
|
|
3038
|
+
const u = Y(c.initialValue);
|
|
3039
|
+
return c.promise instanceof Promise && c.promise.then((e) => {
|
|
3040
|
+
u.value = e;
|
|
3041
|
+
}), () => wt("div", u.value);
|
|
3042
|
+
}
|
|
3043
|
+
}), ys = ["onClick"], $s = { key: 1 }, hs = /* @__PURE__ */ U({
|
|
3044
|
+
__name: "aeria-crud-topbar",
|
|
3045
|
+
props: {
|
|
3046
|
+
collection: {}
|
|
3047
|
+
},
|
|
3048
|
+
setup(c) {
|
|
3049
|
+
const u = c, a = Le().currentRoute, s = D(() => {
|
|
3050
|
+
try {
|
|
3051
|
+
const r = u.collection ? u.collection : a.value.meta.collection || a.value.params.collection;
|
|
3052
|
+
return ge(r);
|
|
3053
|
+
} catch {
|
|
3054
|
+
return null;
|
|
3055
|
+
}
|
|
3056
|
+
});
|
|
3057
|
+
return (r, i) => s.value && s.value.description.filtersPresets ? (n(), g(vs, {
|
|
3058
|
+
key: 0,
|
|
3059
|
+
dropdown: "",
|
|
3060
|
+
query: "section"
|
|
3061
|
+
}, de({ _: 2 }, [
|
|
3062
|
+
H(Object.entries(s.value.description.filtersPresets), ([y, m]) => ({
|
|
3063
|
+
name: y,
|
|
3064
|
+
fn: _(() => [
|
|
3065
|
+
V("div", {
|
|
3066
|
+
class: "topbar__preset",
|
|
3067
|
+
onClick: (v) => t(ht)(m, s.value)
|
|
3068
|
+
}, [
|
|
3069
|
+
m.icon ? (n(), g(Z, {
|
|
3070
|
+
key: 0,
|
|
3071
|
+
icon: m.icon
|
|
3072
|
+
}, {
|
|
3073
|
+
default: _(() => [
|
|
3074
|
+
Q(w(m.name || t(z)(y, { plural: !0 })), 1)
|
|
3075
|
+
]),
|
|
3076
|
+
_: 2
|
|
3077
|
+
}, 1032, ["icon"])) : (n(), l("div", $s, w(m.name || t(z)(y, { plural: !0 })), 1)),
|
|
3078
|
+
m.badgeFunction ? (n(), g(he, { key: 2 }, {
|
|
3079
|
+
default: _(() => [
|
|
3080
|
+
M(t(fs), {
|
|
3081
|
+
"initial-value": "0",
|
|
3082
|
+
promise: s.value.$functions[m.badgeFunction]({ filters: m.filters })
|
|
3083
|
+
}, null, 8, ["promise"])
|
|
3084
|
+
]),
|
|
3085
|
+
_: 2
|
|
3086
|
+
}, 1024)) : f("", !0)
|
|
3087
|
+
], 8, ys)
|
|
3088
|
+
])
|
|
3089
|
+
}))
|
|
3090
|
+
]), 1024)) : f("", !0);
|
|
3091
|
+
}
|
|
3092
|
+
});
|
|
3093
|
+
const bs = /* @__PURE__ */ X(hs, [["__scopeId", "data-v-d0b47fbb"]]), gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3094
|
+
__proto__: null,
|
|
3095
|
+
default: bs
|
|
3096
|
+
}, Symbol.toStringTag, { value: "Module" })), Ls = /* @__PURE__ */ U({
|
|
3097
|
+
__name: "aeria-password-form",
|
|
3098
|
+
props: {
|
|
3099
|
+
modelValue: {}
|
|
3100
|
+
},
|
|
3101
|
+
emits: ["update:modelValue"],
|
|
3102
|
+
setup(c) {
|
|
3103
|
+
const u = c;
|
|
3104
|
+
fe(Ee, null);
|
|
3105
|
+
const e = Ft(), a = D(() => e(
|
|
3106
|
+
u.modelValue.password,
|
|
3107
|
+
u.modelValue.confirmation
|
|
3108
|
+
));
|
|
3109
|
+
return (s, r) => (n(), g(He, {
|
|
3110
|
+
form: {
|
|
3111
|
+
password: {
|
|
3112
|
+
type: "string",
|
|
3113
|
+
icon: "key",
|
|
3114
|
+
inputType: "password"
|
|
3115
|
+
},
|
|
3116
|
+
confirmation: {
|
|
3117
|
+
type: "string",
|
|
3118
|
+
icon: "key",
|
|
3119
|
+
inputType: "password"
|
|
3120
|
+
}
|
|
3121
|
+
},
|
|
3122
|
+
"model-value": s.modelValue,
|
|
3123
|
+
"onUpdate:modelValue": r[0] || (r[0] = (i) => s.$emit("update:modelValue", i))
|
|
3124
|
+
}, {
|
|
3125
|
+
after: _(() => [
|
|
3126
|
+
V("div", null, w(a.value || "Senhas conferem"), 1),
|
|
3127
|
+
C(s.$slots, "default", ae(be({ passwordError: a.value })))
|
|
3128
|
+
]),
|
|
3129
|
+
_: 3
|
|
3130
|
+
}, 8, ["model-value"]));
|
|
3131
|
+
}
|
|
3132
|
+
}), Rs = (c, u = []) => ({
|
|
3133
|
+
path: "/user",
|
|
3134
|
+
name: "/user",
|
|
3135
|
+
component: c,
|
|
3136
|
+
children: u.concat([
|
|
3137
|
+
{
|
|
3138
|
+
path: "invite/:id",
|
|
3139
|
+
name: "/user/invite/:id",
|
|
3140
|
+
redirect: (e) => ({
|
|
3141
|
+
path: "/user/signup",
|
|
3142
|
+
params: {
|
|
3143
|
+
inviteId: e.params.id
|
|
3144
|
+
}
|
|
3145
|
+
})
|
|
3146
|
+
},
|
|
3147
|
+
{
|
|
3148
|
+
path: "signin",
|
|
3149
|
+
name: "/user/signin",
|
|
3150
|
+
component: () => import("./signin-596dcc4b.js"),
|
|
3151
|
+
meta: {
|
|
3152
|
+
title: "Autenticação"
|
|
3153
|
+
}
|
|
3154
|
+
},
|
|
3155
|
+
{
|
|
3156
|
+
path: "signup",
|
|
3157
|
+
name: "/user/signup",
|
|
3158
|
+
component: () => import("./signup-33a15c17.js"),
|
|
3159
|
+
meta: {
|
|
3160
|
+
title: "Registro"
|
|
3161
|
+
}
|
|
3162
|
+
},
|
|
3163
|
+
{
|
|
3164
|
+
path: "activation",
|
|
3165
|
+
name: "/user/activation",
|
|
3166
|
+
component: () => import("./activation-c458cc9b.js"),
|
|
3167
|
+
meta: {
|
|
3168
|
+
title: "Ativação"
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
])
|
|
3172
|
+
}), Fs = (c, u = []) => ({
|
|
3173
|
+
path: "/dashboard",
|
|
3174
|
+
name: "/dashboard",
|
|
3175
|
+
component: c,
|
|
3176
|
+
redirect: {
|
|
3177
|
+
name: "/dashboard/"
|
|
3178
|
+
},
|
|
3179
|
+
meta: {
|
|
3180
|
+
title: "Dashboard"
|
|
3181
|
+
},
|
|
3182
|
+
children: u.concat([
|
|
3183
|
+
{
|
|
3184
|
+
path: "c/:collection?",
|
|
3185
|
+
name: "/dashboard/crud",
|
|
3186
|
+
props: !0,
|
|
3187
|
+
components: {
|
|
3188
|
+
default: () => import("./crud-view-0cee3962.js"),
|
|
3189
|
+
topbar: () => Promise.resolve().then(() => gs)
|
|
3190
|
+
},
|
|
3191
|
+
meta: {
|
|
3192
|
+
title: "%viewTitle%"
|
|
3193
|
+
}
|
|
3194
|
+
},
|
|
3195
|
+
{
|
|
3196
|
+
path: "user",
|
|
3197
|
+
name: "/dashboard/user",
|
|
3198
|
+
meta: {
|
|
3199
|
+
title: "user",
|
|
3200
|
+
icon: "users"
|
|
3201
|
+
},
|
|
3202
|
+
redirect: "/dashboard/c/user",
|
|
3203
|
+
children: [
|
|
3204
|
+
{
|
|
3205
|
+
path: "profile",
|
|
3206
|
+
component: () => import("./profile-dc78782e.js"),
|
|
3207
|
+
meta: {
|
|
3208
|
+
title: "Meu perfil",
|
|
3209
|
+
icon: "user-square"
|
|
3210
|
+
}
|
|
3211
|
+
},
|
|
3212
|
+
{
|
|
3213
|
+
path: "changepass",
|
|
3214
|
+
name: "/dashboard/user/changepass",
|
|
3215
|
+
component: () => import("./password-change-845c176d.js"),
|
|
3216
|
+
meta: {
|
|
3217
|
+
title: "Mudar senha",
|
|
3218
|
+
icon: "lock"
|
|
3219
|
+
}
|
|
3220
|
+
}
|
|
3221
|
+
]
|
|
3222
|
+
}
|
|
3223
|
+
])
|
|
3224
|
+
});
|
|
3225
|
+
export {
|
|
3226
|
+
He as A,
|
|
3227
|
+
Za as B,
|
|
3228
|
+
es as C,
|
|
3229
|
+
bs as D,
|
|
3230
|
+
Rs as E,
|
|
3231
|
+
Fs as F,
|
|
3232
|
+
Ls as _,
|
|
3233
|
+
ie as a,
|
|
3234
|
+
Z as b,
|
|
3235
|
+
En as c,
|
|
3236
|
+
Ss as d,
|
|
3237
|
+
Me as e,
|
|
3238
|
+
Ts as f,
|
|
3239
|
+
Ae as g,
|
|
3240
|
+
X as h,
|
|
3241
|
+
Bs as i,
|
|
3242
|
+
he as j,
|
|
3243
|
+
me as k,
|
|
3244
|
+
un as l,
|
|
3245
|
+
Ve as m,
|
|
3246
|
+
Ra as n,
|
|
3247
|
+
vn as o,
|
|
3248
|
+
js as p,
|
|
3249
|
+
Tn as q,
|
|
3250
|
+
ja as r,
|
|
3251
|
+
vs as s,
|
|
3252
|
+
vo as t,
|
|
3253
|
+
Ce as u,
|
|
3254
|
+
Dn as v,
|
|
3255
|
+
To as w,
|
|
3256
|
+
ze as x,
|
|
3257
|
+
Kn as y,
|
|
3258
|
+
fs as z
|
|
3259
|
+
};
|