@vtable-guild/vtable-guild 2.9.0-alpha.8 → 2.9.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/css/index.css +191 -9
  2. package/css/style.css +191 -36
  3. package/css/tailwind3-utilities.css +0 -27
  4. package/css/tailwind3.css +191 -9
  5. package/css/tailwind4.css +191 -9
  6. package/dist/css/index.css +191 -9
  7. package/dist/css/style.css +191 -36
  8. package/dist/css/tailwind3-utilities.css +0 -27
  9. package/dist/css/tailwind3.css +191 -9
  10. package/dist/css/tailwind4.css +191 -9
  11. package/dist/icons/src/ElFilterIcon.mjs +9 -0
  12. package/dist/index.full.mjs +5997 -5451
  13. package/dist/table/src/components/TableLightFilter.d.ts +76 -0
  14. package/dist/table/src/components/TableLightFilter.d.ts.map +1 -0
  15. package/dist/table/src/components/TableLightFilter.mjs +318 -0
  16. package/dist/table/src/components/TableLightFilter.test.d.ts +2 -0
  17. package/dist/table/src/components/TableLightFilter.test.d.ts.map +1 -0
  18. package/dist/table/src/components/TableQuery.d.ts +101 -46
  19. package/dist/table/src/components/TableQuery.d.ts.map +1 -1
  20. package/dist/table/src/components/TableQuery.mjs +312 -186
  21. package/dist/table/src/components/VTableQuery.vue.d.ts +4 -3
  22. package/dist/table/src/components/VTableQuery.vue.d.ts.map +1 -1
  23. package/dist/table/src/components/VTableQuery.vue.mjs +49 -30
  24. package/dist/table/src/controls.d.ts.map +1 -1
  25. package/dist/table/src/controls.mjs +95 -68
  26. package/dist/table/src/types/controls.d.ts +16 -1
  27. package/dist/table/src/types/controls.d.ts.map +1 -1
  28. package/dist/table/src/types/query-form.d.ts +68 -15
  29. package/dist/table/src/types/query-form.d.ts.map +1 -1
  30. package/dist/table/src/utils/queryFields.mjs +11 -11
  31. package/dist/table/src/utils/queryFilterLayout.d.ts +29 -0
  32. package/dist/table/src/utils/queryFilterLayout.d.ts.map +1 -0
  33. package/dist/table/src/utils/queryFilterLayout.mjs +74 -0
  34. package/dist/table/src/utils/queryFilterLayout.test.d.ts +2 -0
  35. package/dist/table/src/utils/queryFilterLayout.test.d.ts.map +1 -0
  36. package/dist/theme/src/query.d.ts +30 -53
  37. package/dist/theme/src/query.d.ts.map +1 -1
  38. package/dist/theme/src/query.mjs +22 -23
  39. package/package.json +1 -1
@@ -1,11 +1,14 @@
1
- import { defineComponent as ae, inject as ne, computed as y, useId as le, ref as K, watch as ue, onBeforeUnmount as re, createVNode as n, mergeProps as oe, toValue as C, Fragment as se, nextTick as ie } from "vue";
2
- import { useTheme as de } from "../../../core/src/composables/useTheme.mjs";
3
- import F from "../../../core/src/components/Button.mjs";
4
- import { VTABLE_GUILD_INJECTION_KEY as ce } from "../../../core/src/plugin/index.mjs";
5
- import { resolveQueryThemePreset as ye, queryEnUS as fe, queryZhCN as me } from "../../../theme/src/query.mjs";
6
- import { snapshot as R } from "../utils/snapshot.mjs";
7
- import { stateEqual as Y } from "../utils/stateEqual.mjs";
8
- const Se = /* @__PURE__ */ ae({
1
+ import { defineComponent as ve, inject as me, computed as s, useId as be, ref as $, watch as ge, onBeforeUnmount as he, createVNode as o, mergeProps as R, nextTick as qe, toValue as k, Fragment as Ce } from "vue";
2
+ import { useTheme as Te } from "../../../core/src/composables/useTheme.mjs";
3
+ import U from "../../../core/src/components/Button.mjs";
4
+ import { VTABLE_GUILD_INJECTION_KEY as Fe } from "../../../core/src/plugin/index.mjs";
5
+ import { resolveQueryThemePreset as Pe, queryEnUS as we, queryZhCN as xe } from "../../../theme/src/query.mjs";
6
+ import Se from "./TableLightFilter.mjs";
7
+ import { useQueryFilterWidth as Be, getQueryFilterLayout as Oe } from "../utils/queryFilterLayout.mjs";
8
+ import { deriveTableQueryFields as Ne } from "../utils/queryFields.mjs";
9
+ import { snapshot as D } from "../utils/snapshot.mjs";
10
+ import { stateEqual as H } from "../utils/stateEqual.mjs";
11
+ const _e = /* @__PURE__ */ ve({
9
12
  name: "TableQuery",
10
13
  inheritAttrs: !1,
11
14
  props: {
@@ -17,35 +20,59 @@ const Se = /* @__PURE__ */ ae({
17
20
  type: String,
18
21
  default: "form"
19
22
  },
20
- fields: {
21
- type: Array,
22
- required: !0
23
- },
23
+ fields: Array,
24
+ columns: Array,
24
25
  controls: {
25
26
  type: Object,
26
27
  required: !0
27
28
  },
28
- layout: {
29
+ layoutType: {
29
30
  type: String,
30
- default: "light"
31
+ default: "QueryFilter"
31
32
  },
32
- autoSubmit: Boolean,
33
- debounceTime: {
34
- type: Number,
35
- default: 0
33
+ layout: String,
34
+ span: [Number, Object],
35
+ defaultColsNumber: Number,
36
+ defaultFormItemsNumber: Number,
37
+ defaultCollapsed: {
38
+ type: Boolean,
39
+ default: void 0
36
40
  },
37
- hiddenPolicy: {
38
- type: String,
39
- default: "preserve"
41
+ collapsed: {
42
+ type: Boolean,
43
+ default: void 0
40
44
  },
41
- collapsedCount: {
42
- type: Number,
43
- default: 3
45
+ onCollapse: Function,
46
+ collapseRender: {
47
+ type: [Boolean, Function],
48
+ default: void 0
44
49
  },
45
- collapsible: {
50
+ optionRender: {
51
+ type: [Boolean, Function],
52
+ default: void 0
53
+ },
54
+ searchText: String,
55
+ resetText: String,
56
+ labelWidth: [Number, String],
57
+ searchGutter: [Number, Array],
58
+ split: Boolean,
59
+ preserve: {
46
60
  type: Boolean,
47
61
  default: !0
48
62
  },
63
+ showHiddenNum: Boolean,
64
+ submitter: {
65
+ type: [Boolean, Object],
66
+ default: void 0
67
+ },
68
+ submitterColSpanProps: Object,
69
+ collapse: Boolean,
70
+ collapseLabel: null,
71
+ footerRender: {
72
+ type: [Boolean, Function],
73
+ default: void 0
74
+ },
75
+ getPopupContainer: Function,
49
76
  disabled: Boolean,
50
77
  validate: Function,
51
78
  errors: Object,
@@ -55,192 +82,291 @@ const Se = /* @__PURE__ */ ae({
55
82
  },
56
83
  emits: {
57
84
  submitted: (e) => !0,
58
- reset: (e) => !0
85
+ reset: (e) => !0,
86
+ "update:collapsed": (e) => !0
59
87
  },
60
88
  slots: Object,
61
89
  setup(e, {
62
- attrs: Z,
63
- slots: I,
64
- emit: _,
65
- expose: z
90
+ attrs: te,
91
+ slots: m,
92
+ emit: E,
93
+ expose: ne
66
94
  }) {
67
- const U = ne(ce, null), {
68
- slots: r
69
- } = de("query", y(() => ye(U?.themePreset)), e), v = y(() => ({
70
- ...U?.locale === "en-US" ? fe : me,
95
+ const z = me(Fe, null), {
96
+ slots: c
97
+ } = Te("query", s(() => Pe(z?.themePreset)), e), b = s(() => ({
98
+ ...z?.locale === "en-US" ? we : xe,
71
99
  ...e.locale
72
- })), H = le(), q = K(!1), b = K();
73
- let S, x, f = 0, m = !1, P, g, O;
74
- const A = y(() => [...e.fields].sort((a, t) => (a.order ?? 0) - (t.order ?? 0))), E = (a) => ({
75
- field: a,
76
- values: e.query.draft.value
77
- }), M = (a) => typeof a.hidden == "function" ? a.hidden(E(a)) : !!a.hidden, j = y(() => A.value.filter((a) => !M(a))), Q = y(() => Math.max(1, Math.floor(e.collapsedCount || 1))), V = y(() => e.collapsible && j.value.length > Q.value), W = y(() => V.value && e.query.collapsed.value ? j.value.slice(0, Q.value) : j.value), B = y(() => e.disabled || q.value || e.query.submitting.value);
78
- function N() {
79
- clearTimeout(S), S = void 0;
100
+ })), le = be(), I = $(null), ae = Be(I), S = $(!1), q = $();
101
+ let p, g = 0, C = !1, L, T, Q, F;
102
+ const P = s(() => e.fields ? [...e.fields].sort((t, l) => (l.order ?? 0) - (t.order ?? 0)) : Ne(e.columns ?? [])), f = s(() => e.query.draft.value), _ = (t, l = f.value) => ({
103
+ field: t,
104
+ values: l
105
+ }), J = (t) => typeof t.hidden == "function" ? t.hidden(_(t)) : !!t.hidden, G = s(() => P.value.filter((t) => !J(t))), ue = s(() => e.submitter || void 0), V = s(() => !!m.actions || e.optionRender !== !1 && e.submitter !== !1), W = $(e.defaultCollapsed), w = s(() => e.collapsed ?? (V.value && (W.value ?? e.query.collapsed.value))), h = s(() => Oe(G.value, {
106
+ width: ae.value,
107
+ layout: e.layout,
108
+ span: e.span,
109
+ defaultColsNumber: e.defaultColsNumber,
110
+ defaultFormItemsNumber: e.defaultFormItemsNumber,
111
+ collapsed: w.value,
112
+ submitterColSpanProps: e.submitterColSpanProps,
113
+ showActions: V.value
114
+ })), re = s(() => {
115
+ const [t, l] = Array.isArray(e.searchGutter) ? e.searchGutter : [e.searchGutter, void 0];
116
+ return {
117
+ "--vtg-query-label-width": typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth,
118
+ "--vtg-query-column-gap": t === void 0 ? void 0 : `${t}px`,
119
+ "--vtg-query-row-gap": l === void 0 ? void 0 : `${l}px`
120
+ };
121
+ }), B = s(() => e.disabled || S.value || e.query.submitting.value);
122
+ function K() {
123
+ const t = !w.value;
124
+ e.collapsed === void 0 && (W.value === void 0 ? e.query.toggleCollapsed() : W.value = t), e.onCollapse?.(t), E("update:collapsed", t);
80
125
  }
81
- ue(() => [e.layout, e.autoSubmit, e.disabled], N, {
126
+ ge(() => [e.layoutType, e.disabled, e.query], O, {
82
127
  flush: "sync"
83
128
  });
84
- function k() {
85
- N(), f++, x?.abort(), O?.(!1), O = void 0, x = void 0, q.value = !1, P = void 0, g = void 0;
129
+ function O() {
130
+ g++, p?.abort(), F?.(), F = void 0, Q?.(!1), Q = void 0, p = void 0, S.value = !1, L = void 0, T = void 0;
86
131
  }
87
- function X() {
88
- return e.hiddenPolicy === "omit" ? {
89
- omitFields: A.value.filter(M).map((a) => a.name)
90
- } : void 0;
132
+ function oe() {
133
+ if (e.preserve) return;
134
+ const t = new Set(e.layoutType === "LightFilter" ? G.value : h.value.fields.map(({
135
+ field: l
136
+ }) => l));
137
+ return {
138
+ omitFields: P.value.filter((l) => !t.has(l)).map(({
139
+ name: l
140
+ }) => l)
141
+ };
91
142
  }
92
- function h(a) {
93
- if (m || e.disabled) return Promise.resolve(!1);
94
- if (N(), g && P === a) return g;
95
- k();
96
- const t = f, l = new AbortController();
97
- x = l, P = a, b.value = void 0, a === "reset" && e.query.resetFields();
98
- const s = R(e.query.draft.value), i = X();
99
- q.value = !0;
100
- let d;
101
- return g = new Promise((u) => {
102
- d = u;
103
- }), O = d, (async () => {
104
- let u = !1;
143
+ function x(t, l) {
144
+ if (C || e.disabled) return Promise.resolve(!1);
145
+ if (T && L === t) return T;
146
+ O();
147
+ const n = g, a = new AbortController();
148
+ p = a, L = t, q.value = void 0;
149
+ const u = e.query.draft, d = u.value;
150
+ t === "reset" ? e.query.resetFields() : l && (u.value = {
151
+ ...f.value,
152
+ ...D(l)
153
+ });
154
+ const r = D(f.value);
155
+ l && (F = () => {
156
+ H(r, u.value) && (u.value = d);
157
+ });
158
+ const i = oe();
159
+ S.value = !0;
160
+ let N;
161
+ return T = new Promise((v) => {
162
+ N = v;
163
+ }), Q = N, (async () => {
164
+ let v = !1;
105
165
  try {
106
- if (a === "reset" && await ie(), m || t !== f || l.signal.aborted) return !1;
107
- const o = await e.validate?.(s, {
108
- fields: j.value,
109
- action: a,
110
- signal: l.signal
166
+ if ((t === "reset" || l) && await qe(), C || n !== g || a.signal.aborted) return !1;
167
+ const y = await e.validate?.(r, {
168
+ fields: G.value,
169
+ action: t,
170
+ signal: a.signal
111
171
  });
112
- return m || t !== f || l.signal.aborted ? !1 : o === !1 ? (b.value = v.value.validationFailed, !1) : !Y(s, e.query.draft.value) || (q.value = !1, u = await (a === "reset" ? e.query.reset(i) : e.query.submit(i)), m || t !== f) ? !1 : (_(a === "reset" ? "reset" : "submitted", u), u);
113
- } catch (o) {
114
- return !m && t === f && (b.value = o instanceof Error ? o.message : String(o)), !1;
172
+ return C || n !== g || a.signal.aborted ? !1 : y === !1 ? (q.value = b.value.validationFailed, !1) : !H(r, f.value) || (F = void 0, S.value = !1, v = await (t === "reset" ? e.query.reset(i) : e.query.submit(i)), C || n !== g) ? !1 : (E(t === "reset" ? "reset" : "submitted", v), v);
173
+ } catch (y) {
174
+ return !C && n === g && (q.value = y instanceof Error ? y.message : String(y)), !1;
115
175
  } finally {
116
- t === f && (q.value = !1, P = void 0, x = void 0, g = void 0, O = void 0);
176
+ n === g && (F?.(), F = void 0, S.value = !1, L = void 0, p = void 0, T = void 0, Q = void 0);
117
177
  }
118
- })().then(d), g;
178
+ })().then(N), T;
119
179
  }
120
- function p(a, t) {
121
- a = A.value.find((u) => u.name === a.name) ?? a;
122
- const l = E(a), s = typeof a.disabled == "function" ? a.disabled(l) : a.disabled, i = typeof a.readonly == "function" ? a.readonly(l) : a.readonly;
123
- if (e.disabled || e.query.submitting.value || s || i || Y(e.query.draft.value[a.name], t)) return;
124
- k(), b.value = void 0;
125
- const d = e.query.draft;
126
- d.value = {
127
- ...d.value,
128
- [a.name]: R(t)
129
- }, e.layout === "light" && e.autoSubmit && (S = setTimeout(() => {
130
- S = void 0, !m && e.layout === "light" && e.autoSubmit && !e.disabled && h("submit");
131
- }, Math.max(0, e.debounceTime)));
180
+ function ie(t) {
181
+ const l = _(t), n = typeof t.disabled == "function" ? t.disabled(l) : t.disabled, a = typeof t.readonly == "function" ? t.readonly(l) : t.readonly;
182
+ return !e.disabled && !e.query.submitting.value && !J(t) && !n && !a;
132
183
  }
133
- re(() => {
134
- m = !0, k();
184
+ function se(t, l) {
185
+ const n = P.value.find((u) => u.name === t);
186
+ if (!n || !ie(n) || H(f.value[t], l)) return;
187
+ O(), q.value = void 0;
188
+ const a = e.query.draft;
189
+ a.value = {
190
+ ...f.value,
191
+ [t]: D(l)
192
+ };
193
+ }
194
+ function de(t) {
195
+ if (B.value) return Promise.resolve(!1);
196
+ const l = Object.fromEntries(P.value.filter((n) => Object.hasOwn(t, n.name)).map(({
197
+ name: n
198
+ }) => [n, t[n]]));
199
+ return Object.keys(l).length ? x("submit", l) : Promise.resolve(!0);
200
+ }
201
+ he(() => {
202
+ C = !0, O();
135
203
  });
136
- const $ = {
137
- submit: () => h("submit"),
138
- reset: () => h("reset"),
139
- cancel: k
204
+ const M = {
205
+ submit: () => x("submit"),
206
+ reset: () => x("reset"),
207
+ cancel: O
140
208
  };
141
- return z($), () => {
142
- const a = e.rootTag;
143
- return n(a, oe(Z, {
144
- class: r.root(),
145
- "data-query-layout": e.layout,
146
- "aria-label": v.value.label,
147
- onSubmit: (t) => {
148
- t.preventDefault(), h("submit");
209
+ ne(M);
210
+ function Y(t, l, n) {
211
+ const a = _(t, l), u = e.errors?.[t.name] ?? k(t.dictionary?.error)?.message, d = [...k(t.options) ?? k(t.dictionary?.options) ?? []], r = l[t.name];
212
+ for (const j of Array.isArray(r) ? r : [r]) {
213
+ if (!t.dictionary || !["string", "number", "boolean"].includes(typeof j) || d.some((ye) => Object.is(ye.value, j))) continue;
214
+ const X = j, A = k(t.dictionary.valueEnum).get(X), ee = typeof A == "string" ? A : A?.text;
215
+ typeof ee == "string" && d.push({
216
+ value: X,
217
+ label: ee,
218
+ ...typeof A == "object" ? {
219
+ status: A.status
220
+ } : {}
221
+ });
222
+ }
223
+ const i = typeof t.readonly == "function" ? t.readonly(a) : !!t.readonly, N = e.disabled || e.query.submitting.value || (typeof t.disabled == "function" ? t.disabled(a) : !!t.disabled), v = {
224
+ value: r,
225
+ onChange: n,
226
+ fieldProps: typeof t.fieldProps == "function" ? t.fieldProps(a) : t.fieldProps ?? {},
227
+ options: d,
228
+ disabled: N,
229
+ readonly: i,
230
+ loading: k(t.dictionary?.loading) ?? !1,
231
+ error: u,
232
+ id: `${le}-${t.name}`,
233
+ name: t.name,
234
+ mode: "query",
235
+ onSearch: t.dictionary ? (j) => {
236
+ t.dictionary.search(j);
237
+ } : void 0
238
+ }, y = t.valueType ?? "text", Z = Object.hasOwn(e.controls, y) ? e.controls[y] : void 0;
239
+ return {
240
+ control: v,
241
+ renderer: Z ?? e.controls.text,
242
+ valueType: Z ? y : "text"
243
+ };
244
+ }
245
+ function ce() {
246
+ const t = h.value.canCollapse && e.collapseRender !== !1, l = {
247
+ ...M,
248
+ submitting: B.value,
249
+ collapsed: w.value,
250
+ toggleCollapsed: K,
251
+ showCollapseButton: t
252
+ };
253
+ if (m.actions) return m.actions(l);
254
+ const n = ue.value, {
255
+ resetButtonProps: a,
256
+ submitButtonProps: u
257
+ } = n ?? {}, d = [a !== !1 && o(U, R({
258
+ key: "reset"
259
+ }, R(a ?? {}, {
260
+ htmlType: "button",
261
+ disabled: B.value || !!a?.disabled,
262
+ onClick: (i) => {
263
+ i.defaultPrevented || x("reset");
264
+ }
265
+ })), {
266
+ default: () => [n?.searchConfig?.resetText ?? e.resetText ?? b.value.reset]
267
+ }), u !== !1 && o(U, R({
268
+ key: "submit"
269
+ }, R({
270
+ type: "primary"
271
+ }, u ?? {}, {
272
+ htmlType: e.rootTag === "form" ? "submit" : "button",
273
+ disabled: B.value || !!u?.disabled,
274
+ onClick: (i) => {
275
+ i.defaultPrevented || (i.preventDefault(), x("submit"));
276
+ }
277
+ })), {
278
+ default: () => [n?.searchConfig?.submitText ?? e.searchText ?? b.value.submit]
279
+ })].filter(Boolean), r = n?.render ?? e.optionRender;
280
+ return o(Ce, null, [r === !1 ? null : typeof r == "function" ? r(l, d) : d, t ? o(U, {
281
+ type: "link",
282
+ htmlType: "button",
283
+ disabled: e.disabled,
284
+ class: c.collapse(),
285
+ onClick: K,
286
+ "aria-expanded": !w.value
287
+ }, {
288
+ default: () => [typeof e.collapseRender == "function" ? e.collapseRender(w.value) : w.value ? `${b.value.expand}${e.showHiddenNum ? ` (${h.value.hiddenCount})` : ""}` : b.value.collapse]
289
+ }) : null]);
290
+ }
291
+ function fe() {
292
+ const t = new Map(h.value.fields.map((n) => [n.field.name, n])), l = e.preserve ? P.value : h.value.fields.map(({
293
+ field: n
294
+ }) => n);
295
+ return o("div", {
296
+ class: c.fields(),
297
+ "data-query-grid": "",
298
+ style: re.value
299
+ }, [l.map((n) => {
300
+ const a = t.get(n.name), {
301
+ control: u,
302
+ renderer: d,
303
+ valueType: r
304
+ } = Y(n, f.value, (i) => {
305
+ se(n.name, i);
306
+ });
307
+ return o("div", {
308
+ key: n.name,
309
+ class: c.field(),
310
+ style: a?.style,
311
+ hidden: !a,
312
+ "data-query-field": n.name,
313
+ "data-query-split": e.split && a?.endsRow ? "" : void 0
314
+ }, [o("label", {
315
+ class: c.label(),
316
+ for: u.id
317
+ }, [n.label ?? n.name]), o("div", {
318
+ class: c.control(),
319
+ "data-query-value-type": r
320
+ }, [m.field ? m.field({
321
+ field: n,
322
+ values: f.value,
323
+ control: u,
324
+ layoutType: "QueryFilter"
325
+ }) : d?.(u), u.error ? o("div", {
326
+ class: c.error(),
327
+ role: "alert",
328
+ id: `${u.id}-error`
329
+ }, [u.error]) : null])]);
330
+ }), V.value ? o("div", {
331
+ class: [c.actions(), e.submitterColSpanProps?.class],
332
+ style: [h.value.actionStyle, e.submitterColSpanProps?.style],
333
+ "data-query-actions": ""
334
+ }, [ce()]) : null]);
335
+ }
336
+ return () => {
337
+ const t = e.rootTag, l = e.layoutType === "LightFilter";
338
+ return o(t, R(te, {
339
+ ref: I,
340
+ class: c.root(),
341
+ "data-query-layout-type": e.layoutType,
342
+ "data-query-layout": l ? void 0 : h.value.layout,
343
+ "aria-label": b.value.label,
344
+ onSubmit: (n) => {
345
+ n.target === I.value && (n.preventDefault(), l || x("submit"));
149
346
  }
150
347
  }), {
151
- default: () => [n("div", {
152
- class: r.fields()
153
- }, [W.value.map((t) => {
154
- const l = E(t), s = `${H}-${t.name}`, i = e.errors?.[t.name] ?? C(t.dictionary?.error)?.message, d = typeof t.readonly == "function" ? t.readonly(l) : !!t.readonly, u = e.disabled || e.query.submitting.value || (typeof t.disabled == "function" ? t.disabled(l) : !!t.disabled), o = [...C(t.options) ?? C(t.dictionary?.options) ?? []], w = e.query.draft.value[t.name];
155
- for (const c of Array.isArray(w) ? w : [w]) {
156
- if (!t.dictionary || !["string", "number", "boolean"].includes(typeof c) || o.some((te) => Object.is(te.value, c))) continue;
157
- const T = C(t.dictionary.valueEnum).get(c), J = typeof T == "string" ? T : T?.text;
158
- typeof J == "string" && o.push({
159
- value: c,
160
- label: J,
161
- ...typeof T == "object" ? {
162
- status: T.status
163
- } : {}
164
- });
165
- }
166
- const L = {
167
- value: w,
168
- onChange: (c) => p(t, c),
169
- fieldProps: typeof t.fieldProps == "function" ? t.fieldProps(l) : t.fieldProps ?? {},
170
- options: o,
171
- disabled: u,
172
- readonly: d,
173
- loading: C(t.dictionary?.loading) ?? !1,
174
- error: i,
175
- id: s,
176
- name: t.name,
177
- mode: "query",
178
- onSearch: t.dictionary ? (c) => {
179
- t.dictionary.search(c);
180
- } : void 0
181
- }, D = t.valueType ?? "text", G = Object.prototype.hasOwnProperty.call(e.controls, D) ? e.controls[D] : void 0, ee = G ?? e.controls.text;
182
- return n("div", {
183
- key: t.name,
184
- class: r.field(),
185
- "data-query-field": t.name
186
- }, [n("label", {
187
- class: r.label(),
188
- for: s
189
- }, [t.label ?? t.name]), n("div", {
190
- class: r.control(),
191
- "data-query-value-type": G ? D : "text"
192
- }, [I.field?.({
193
- field: t,
194
- values: e.query.draft.value,
195
- control: L
196
- }) ?? ee?.(L), i ? n("div", {
197
- class: r.error(),
198
- role: "alert",
199
- id: `${s}-error`
200
- }, [i]) : null])]);
201
- })]), n("div", {
202
- class: r.actions()
203
- }, [I.actions?.({
204
- ...$,
205
- submitting: B.value,
206
- collapsed: e.query.collapsed.value,
207
- toggleCollapsed: e.query.toggleCollapsed
208
- }) ?? n(se, null, [n(F, {
209
- htmlType: "button",
210
- disabled: B.value,
211
- onClick: (t) => {
212
- t.preventDefault(), h("reset");
213
- }
214
- }, {
215
- default: () => [v.value.reset]
216
- }), n(F, {
217
- type: "primary",
218
- htmlType: e.rootTag === "form" ? "submit" : "button",
219
- disabled: B.value,
220
- onClick: (t) => {
221
- t.preventDefault(), h("submit");
222
- }
223
- }, {
224
- default: () => [v.value.submit]
225
- }), V.value ? n(F, {
226
- type: "link",
227
- htmlType: "button",
348
+ default: () => [l ? o(Se, {
349
+ fields: P.value,
350
+ values: f.value,
228
351
  disabled: e.disabled,
229
- class: r.collapse(),
230
- onClick: (t) => {
231
- t.preventDefault(), e.query.toggleCollapsed();
232
- },
233
- "aria-expanded": !e.query.collapsed.value
234
- }, {
235
- default: () => [e.query.collapsed.value ? v.value.expand : v.value.collapse]
236
- }) : null])]), b.value || e.query.error.value ? n("div", {
237
- class: r.feedback(),
352
+ submitting: B.value,
353
+ collapse: e.collapse,
354
+ collapseLabel: e.collapseLabel,
355
+ footerRender: e.footerRender,
356
+ getPopupContainer: e.getPopupContainer,
357
+ locale: b.value,
358
+ resolveField: Y,
359
+ submitValues: de
360
+ }, m.field ? {
361
+ field: m.field
362
+ } : void 0) : fe(), q.value || e.query.error.value ? o("div", {
363
+ class: c.feedback(),
238
364
  role: "alert"
239
- }, [b.value ?? e.query.error.value?.message]) : null]
365
+ }, [q.value ?? e.query.error.value?.message]) : null]
240
366
  });
241
367
  };
242
368
  }
243
369
  });
244
370
  export {
245
- Se as default
371
+ _e as default
246
372
  };
@@ -1,13 +1,14 @@
1
1
  import { TableQueryInstance, TableQueryProps, TableQuerySlots } from '../types/query-form';
2
- declare const _default: <TValues extends object = Record<string, unknown>, TParams extends object = TValues>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
2
+ declare const _default: <TValues extends object = Record<string, unknown>, TParams extends object = TValues, TRecord extends object = TValues>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onReset?: ((success: boolean) => any) | undefined;
5
5
  readonly onSubmitted?: ((success: boolean) => any) | undefined;
6
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onReset" | "onSubmitted"> & TableQueryProps<TValues, TParams> & Partial<{}>> & import('vue').PublicProps;
6
+ readonly "onUpdate:collapsed"?: ((collapsed: boolean) => any) | undefined;
7
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onReset" | "onSubmitted" | "onUpdate:collapsed"> & TableQueryProps<TValues, TParams, TRecord> & Partial<{}>> & import('vue').PublicProps;
7
8
  expose(exposed: import('vue').ShallowUnwrapRef<TableQueryInstance>): void;
8
9
  attrs: any;
9
10
  slots: Readonly<TableQuerySlots<TValues>> & TableQuerySlots<TValues>;
10
- emit: ((evt: "reset", success: boolean) => void) & ((evt: "submitted", success: boolean) => void);
11
+ emit: ((evt: "reset", success: boolean) => void) & ((evt: "submitted", success: boolean) => void) & ((evt: "update:collapsed", collapsed: boolean) => void);
11
12
  }>) => import('vue').VNode & {
12
13
  __ctx?: Awaited<typeof __VLS_setup>;
13
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"VTableQuery.vue.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableQuery.vue"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;yBAE9E,OAAO,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,SAAS,MAAM,GAAG,OAAO,EAClG,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAqHO,mBAAmB,CAAC;;;iMAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,oBAAsB,GAAG,IAAI;WACpE,GAAG;;;EAIP,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAhIzE,wBAgI4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"VTableQuery.vue.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableQuery.vue"],"names":[],"mappings":"AAiEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;yBAG3F,OAAO,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChD,OAAO,SAAS,MAAM,GAAG,OAAO,EAChC,OAAO,SAAS,MAAM,GAAG,OAAO,EAEnC,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAiJO,mBAAmB,CAAC;;;;iOAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,oBAAsB,GAAG,IAAI;WACpE,GAAG;;;EAIP,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAhKzE,wBAgK4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}