@vtable-guild/vtable-guild 2.9.0-alpha.1 → 2.9.0-alpha.3

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 (141) hide show
  1. package/css/presets/antdv.css +10 -0
  2. package/css/presets/element-plus.css +10 -0
  3. package/css/style.css +138 -0
  4. package/css/tailwind3-utilities.css +118 -0
  5. package/css/tailwind3.css +20 -0
  6. package/css/tailwind4.css +20 -0
  7. package/dist/core/src/components/Button.d.ts +9 -0
  8. package/dist/core/src/components/Button.d.ts.map +1 -1
  9. package/dist/core/src/components/Button.mjs +11 -6
  10. package/dist/css/presets/antdv.css +10 -0
  11. package/dist/css/presets/element-plus.css +10 -0
  12. package/dist/css/style.css +138 -0
  13. package/dist/css/tailwind3-utilities.css +118 -0
  14. package/dist/css/tailwind3.css +20 -0
  15. package/dist/css/tailwind4.css +20 -0
  16. package/dist/icons/src/CheckCircleFilledIcon.d.ts +3 -0
  17. package/dist/icons/src/CheckCircleFilledIcon.d.ts.map +1 -0
  18. package/dist/icons/src/CheckCircleFilledIcon.mjs +9 -0
  19. package/dist/icons/src/CloseCircleFilledIcon.d.ts +3 -0
  20. package/dist/icons/src/CloseCircleFilledIcon.d.ts.map +1 -0
  21. package/dist/icons/src/CloseCircleFilledIcon.mjs +9 -0
  22. package/dist/icons/src/index.d.ts +2 -0
  23. package/dist/icons/src/index.d.ts.map +1 -1
  24. package/dist/index.full.mjs +6548 -5313
  25. package/dist/index.mjs +149 -115
  26. package/dist/table/src/components/Table.d.ts +3 -3
  27. package/dist/table/src/components/Table.d.ts.map +1 -1
  28. package/dist/table/src/components/Table.mjs +486 -460
  29. package/dist/table/src/components/TableCell.d.ts.map +1 -1
  30. package/dist/table/src/components/TableCell.mjs +109 -86
  31. package/dist/table/src/components/TableEditableCell.d.ts +29 -0
  32. package/dist/table/src/components/TableEditableCell.d.ts.map +1 -0
  33. package/dist/table/src/components/TableEditableCell.mjs +39 -0
  34. package/dist/table/src/components/TableEditableCell.test.d.ts +2 -0
  35. package/dist/table/src/components/TableEditableCell.test.d.ts.map +1 -0
  36. package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
  37. package/dist/table/src/components/TableHeaderCell.mjs +174 -175
  38. package/dist/table/src/components/TableQuery.d.ts +108 -0
  39. package/dist/table/src/components/TableQuery.d.ts.map +1 -0
  40. package/dist/table/src/components/TableQuery.mjs +244 -0
  41. package/dist/table/src/components/TableQuery.test.d.ts +2 -0
  42. package/dist/table/src/components/TableQuery.test.d.ts.map +1 -0
  43. package/dist/table/src/components/VTableDynamicSlots.test.d.ts +2 -0
  44. package/dist/table/src/components/VTableDynamicSlots.test.d.ts.map +1 -0
  45. package/dist/table/src/components/VTableEditCell.vue.d.ts +19 -0
  46. package/dist/table/src/components/VTableEditCell.vue.d.ts.map +1 -0
  47. package/dist/table/src/components/VTableEditCell.vue.mjs +21 -0
  48. package/dist/table/src/components/VTableEditCell.vue2.mjs +4 -0
  49. package/dist/table/src/components/VTableQuery.vue.d.ts +18 -0
  50. package/dist/table/src/components/VTableQuery.vue.d.ts.map +1 -0
  51. package/dist/table/src/components/VTableQuery.vue.mjs +64 -0
  52. package/dist/table/src/components/VTableQuery.vue2.mjs +4 -0
  53. package/dist/table/src/composables/useTableDictionary.d.ts +5 -0
  54. package/dist/table/src/composables/useTableDictionary.d.ts.map +1 -0
  55. package/dist/table/src/composables/useTableDictionary.mjs +168 -0
  56. package/dist/table/src/composables/useTableDictionary.test.d.ts +2 -0
  57. package/dist/table/src/composables/useTableDictionary.test.d.ts.map +1 -0
  58. package/dist/table/src/composables/useTableEdit.d.ts.map +1 -1
  59. package/dist/table/src/composables/useTableEdit.mjs +352 -135
  60. package/dist/table/src/composables/useTableEditable.d.ts +4 -0
  61. package/dist/table/src/composables/useTableEditable.d.ts.map +1 -0
  62. package/dist/table/src/composables/useTableEditable.mjs +125 -0
  63. package/dist/table/src/composables/useTableEditable.test.d.ts +2 -0
  64. package/dist/table/src/composables/useTableEditable.test.d.ts.map +1 -0
  65. package/dist/table/src/composables/useTableQuery.d.ts.map +1 -1
  66. package/dist/table/src/composables/useTableQuery.mjs +33 -33
  67. package/dist/table/src/composables/useTableRequest.d.ts.map +1 -1
  68. package/dist/table/src/composables/useTableRequest.mjs +138 -97
  69. package/dist/table/src/composables/useTableRequest.polling.test.d.ts +2 -0
  70. package/dist/table/src/composables/useTableRequest.polling.test.d.ts.map +1 -0
  71. package/dist/table/src/context.d.ts +6 -2
  72. package/dist/table/src/context.d.ts.map +1 -1
  73. package/dist/table/src/controls.d.ts +4 -0
  74. package/dist/table/src/controls.d.ts.map +1 -0
  75. package/dist/table/src/controls.mjs +97 -0
  76. package/dist/table/src/controls.test.d.ts +2 -0
  77. package/dist/table/src/controls.test.d.ts.map +1 -0
  78. package/dist/table/src/index.d.ts +10 -0
  79. package/dist/table/src/index.d.ts.map +1 -1
  80. package/dist/table/src/renderers.d.ts.map +1 -1
  81. package/dist/table/src/renderers.mjs +88 -23
  82. package/dist/table/src/review-current.repro.test.d.ts +2 -0
  83. package/dist/table/src/review-current.repro.test.d.ts.map +1 -0
  84. package/dist/table/src/types/column.d.ts +4 -1
  85. package/dist/table/src/types/column.d.ts.map +1 -1
  86. package/dist/table/src/types/controls.d.ts +31 -0
  87. package/dist/table/src/types/controls.d.ts.map +1 -0
  88. package/dist/table/src/types/dictionary.d.ts +71 -0
  89. package/dist/table/src/types/dictionary.d.ts.map +1 -0
  90. package/dist/table/src/types/dictionary.typecheck.d.ts +6 -0
  91. package/dist/table/src/types/dictionary.typecheck.d.ts.map +1 -0
  92. package/dist/table/src/types/editable.d.ts +49 -0
  93. package/dist/table/src/types/editable.d.ts.map +1 -0
  94. package/dist/table/src/types/editable.typecheck.d.ts +15 -0
  95. package/dist/table/src/types/editable.typecheck.d.ts.map +1 -0
  96. package/dist/table/src/types/editing.d.ts +41 -4
  97. package/dist/table/src/types/editing.d.ts.map +1 -1
  98. package/dist/table/src/types/editing.typecheck.d.ts.map +1 -1
  99. package/dist/table/src/types/index.d.ts +4 -0
  100. package/dist/table/src/types/index.d.ts.map +1 -1
  101. package/dist/table/src/types/query-form.d.ts +90 -0
  102. package/dist/table/src/types/query-form.d.ts.map +1 -0
  103. package/dist/table/src/types/query-form.typecheck.d.ts +10 -0
  104. package/dist/table/src/types/query-form.typecheck.d.ts.map +1 -0
  105. package/dist/table/src/types/query.d.ts +6 -2
  106. package/dist/table/src/types/query.d.ts.map +1 -1
  107. package/dist/table/src/types/renderers.d.ts +15 -3
  108. package/dist/table/src/types/renderers.d.ts.map +1 -1
  109. package/dist/table/src/types/request.d.ts +20 -2
  110. package/dist/table/src/types/request.d.ts.map +1 -1
  111. package/dist/table/src/types/request.typecheck.d.ts.map +1 -1
  112. package/dist/table/src/utils/cell.d.ts +3 -2
  113. package/dist/table/src/utils/cell.d.ts.map +1 -1
  114. package/dist/table/src/utils/cell.mjs +45 -44
  115. package/dist/table/src/utils/fieldPath.d.ts +6 -0
  116. package/dist/table/src/utils/fieldPath.d.ts.map +1 -0
  117. package/dist/table/src/utils/fieldPath.mjs +29 -0
  118. package/dist/table/src/utils/queryFields.d.ts +4 -0
  119. package/dist/table/src/utils/queryFields.d.ts.map +1 -0
  120. package/dist/table/src/utils/queryFields.mjs +31 -0
  121. package/dist/table/src/utils/queryFields.test.d.ts +2 -0
  122. package/dist/table/src/utils/queryFields.test.d.ts.map +1 -0
  123. package/dist/table/src/utils/stateEqual.d.ts +3 -0
  124. package/dist/table/src/utils/stateEqual.d.ts.map +1 -0
  125. package/dist/table/src/utils/stateEqual.mjs +15 -0
  126. package/dist/theme/src/index.d.ts +4 -0
  127. package/dist/theme/src/index.d.ts.map +1 -1
  128. package/dist/theme/src/presets/antdv/table.d.ts +7 -0
  129. package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
  130. package/dist/theme/src/presets/antdv/table.mjs +7 -0
  131. package/dist/theme/src/presets/element-plus/table.d.ts +7 -0
  132. package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
  133. package/dist/theme/src/presets/element-plus/table.mjs +7 -0
  134. package/dist/theme/src/query.d.ts +128 -0
  135. package/dist/theme/src/query.d.ts.map +1 -0
  136. package/dist/theme/src/query.mjs +56 -0
  137. package/dist/vtable-guild/src/augment.d.ts +2 -1
  138. package/dist/vtable-guild/src/augment.d.ts.map +1 -1
  139. package/dist/vtable-guild/src/index.d.ts +1 -0
  140. package/dist/vtable-guild/src/index.d.ts.map +1 -1
  141. package/package.json +1 -1
@@ -0,0 +1,108 @@
1
+ import { PropType, SlotsType } from 'vue';
2
+ import { TableQueryProps, TableQuerySlots } from '../types/query-form';
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ query: {
5
+ type: PropType<TableQueryProps["query"]>;
6
+ required: true;
7
+ };
8
+ rootTag: {
9
+ type: PropType<TableQueryProps["rootTag"]>;
10
+ default: string;
11
+ };
12
+ fields: {
13
+ type: PropType<TableQueryProps["fields"]>;
14
+ required: true;
15
+ };
16
+ controls: {
17
+ type: PropType<TableQueryProps["controls"]>;
18
+ required: true;
19
+ };
20
+ layout: {
21
+ type: PropType<TableQueryProps["layout"]>;
22
+ default: string;
23
+ };
24
+ autoSubmit: BooleanConstructor;
25
+ debounceTime: {
26
+ type: NumberConstructor;
27
+ default: number;
28
+ };
29
+ hiddenPolicy: {
30
+ type: PropType<TableQueryProps["hiddenPolicy"]>;
31
+ default: string;
32
+ };
33
+ collapsedCount: {
34
+ type: NumberConstructor;
35
+ default: number;
36
+ };
37
+ collapsible: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ disabled: BooleanConstructor;
42
+ validate: PropType<TableQueryProps["validate"]>;
43
+ errors: PropType<TableQueryProps["errors"]>;
44
+ locale: PropType<TableQueryProps["locale"]>;
45
+ ui: PropType<TableQueryProps["ui"]>;
46
+ class: StringConstructor;
47
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
48
+ submitted: (_success: boolean) => true;
49
+ reset: (_success: boolean) => true;
50
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
51
+ query: {
52
+ type: PropType<TableQueryProps["query"]>;
53
+ required: true;
54
+ };
55
+ rootTag: {
56
+ type: PropType<TableQueryProps["rootTag"]>;
57
+ default: string;
58
+ };
59
+ fields: {
60
+ type: PropType<TableQueryProps["fields"]>;
61
+ required: true;
62
+ };
63
+ controls: {
64
+ type: PropType<TableQueryProps["controls"]>;
65
+ required: true;
66
+ };
67
+ layout: {
68
+ type: PropType<TableQueryProps["layout"]>;
69
+ default: string;
70
+ };
71
+ autoSubmit: BooleanConstructor;
72
+ debounceTime: {
73
+ type: NumberConstructor;
74
+ default: number;
75
+ };
76
+ hiddenPolicy: {
77
+ type: PropType<TableQueryProps["hiddenPolicy"]>;
78
+ default: string;
79
+ };
80
+ collapsedCount: {
81
+ type: NumberConstructor;
82
+ default: number;
83
+ };
84
+ collapsible: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
88
+ disabled: BooleanConstructor;
89
+ validate: PropType<TableQueryProps["validate"]>;
90
+ errors: PropType<TableQueryProps["errors"]>;
91
+ locale: PropType<TableQueryProps["locale"]>;
92
+ ui: PropType<TableQueryProps["ui"]>;
93
+ class: StringConstructor;
94
+ }>> & Readonly<{
95
+ onReset?: ((_success: boolean) => any) | undefined;
96
+ onSubmitted?: ((_success: boolean) => any) | undefined;
97
+ }>, {
98
+ disabled: boolean;
99
+ layout: "form" | "light" | undefined;
100
+ rootTag: "form" | "div" | undefined;
101
+ hiddenPolicy: "preserve" | "omit" | undefined;
102
+ autoSubmit: boolean;
103
+ debounceTime: number;
104
+ collapsedCount: number;
105
+ collapsible: boolean;
106
+ }, SlotsType<TableQuerySlots<Record<string, unknown>>>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
107
+ export default _default;
108
+ //# sourceMappingURL=TableQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableQuery.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableQuery.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,KAAK,CAAA;AAIZ,OAAO,KAAK,EAGV,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAA;;;cAQC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;;;;cAChC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;;;;cACtC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;cAChC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;;;;cACvC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;cAI3C,QAAQ,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;;;;;;;;;;;;cAMrC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YACzC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACnC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACvC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;;0BAIvB,OAAO;sBACX,OAAO;;;cAtBA,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;;;;cAChC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;;;;cACtC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;cAChC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;;;;cACvC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;cAI3C,QAAQ,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;;;;;;;;;;;;cAMrC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YACzC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACnC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACvC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;AArBjD,wBAmUE"}
@@ -0,0 +1,244 @@
1
+ import { defineComponent as ee, inject as te, computed as f, useId as ae, ref as G, watch as ne, onBeforeUnmount as le, createVNode as n, mergeProps as ue, toValue as C, Fragment as re, nextTick as oe } from "vue";
2
+ import { useTheme as se } from "../../../core/src/composables/useTheme.mjs";
3
+ import D from "../../../core/src/components/Button.mjs";
4
+ import { VTABLE_GUILD_INJECTION_KEY as ie } from "../../../core/src/plugin/index.mjs";
5
+ import { resolveQueryThemePreset as de, queryEnUS as ce, queryZhCN as fe } from "../../../theme/src/query.mjs";
6
+ import { snapshot as J } from "../utils/snapshot.mjs";
7
+ import { stateEqual as K } from "../utils/stateEqual.mjs";
8
+ const Te = /* @__PURE__ */ ee({
9
+ name: "TableQuery",
10
+ inheritAttrs: !1,
11
+ props: {
12
+ query: {
13
+ type: Object,
14
+ required: !0
15
+ },
16
+ rootTag: {
17
+ type: String,
18
+ default: "form"
19
+ },
20
+ fields: {
21
+ type: Array,
22
+ required: !0
23
+ },
24
+ controls: {
25
+ type: Object,
26
+ required: !0
27
+ },
28
+ layout: {
29
+ type: String,
30
+ default: "form"
31
+ },
32
+ autoSubmit: Boolean,
33
+ debounceTime: {
34
+ type: Number,
35
+ default: 0
36
+ },
37
+ hiddenPolicy: {
38
+ type: String,
39
+ default: "preserve"
40
+ },
41
+ collapsedCount: {
42
+ type: Number,
43
+ default: 3
44
+ },
45
+ collapsible: {
46
+ type: Boolean,
47
+ default: !0
48
+ },
49
+ disabled: Boolean,
50
+ validate: Function,
51
+ errors: Object,
52
+ locale: Object,
53
+ ui: Object,
54
+ class: String
55
+ },
56
+ emits: {
57
+ submitted: (e) => !0,
58
+ reset: (e) => !0
59
+ },
60
+ slots: Object,
61
+ setup(e, {
62
+ attrs: R,
63
+ slots: F,
64
+ emit: I,
65
+ expose: Y
66
+ }) {
67
+ const _ = te(ie, null), {
68
+ slots: r
69
+ } = se("query", f(() => de(_?.themePreset)), e), v = f(() => ({
70
+ ..._?.locale === "en-US" ? ce : fe,
71
+ ...e.locale
72
+ })), Z = ae(), q = G(!1), b = G();
73
+ let S, x, y = 0, m = !1, P, g, j;
74
+ const A = f(() => [...e.fields].sort((a, t) => (a.order ?? 0) - (t.order ?? 0))), E = (a) => ({
75
+ field: a,
76
+ values: e.query.draft.value
77
+ }), U = (a) => typeof a.hidden == "function" ? a.hidden(E(a)) : !!a.hidden, O = f(() => A.value.filter((a) => !U(a))), M = f(() => Math.max(1, Math.floor(e.collapsedCount || 1))), Q = f(() => e.collapsible && O.value.length > M.value), z = f(() => Q.value && e.query.collapsed.value ? O.value.slice(0, M.value) : O.value), B = f(() => e.disabled || q.value || e.query.submitting.value);
78
+ function N() {
79
+ clearTimeout(S), S = void 0;
80
+ }
81
+ ne(() => [e.layout, e.autoSubmit, e.disabled], N, {
82
+ flush: "sync"
83
+ });
84
+ function k() {
85
+ N(), y++, x?.abort(), j?.(!1), j = void 0, x = void 0, q.value = !1, P = void 0, g = void 0;
86
+ }
87
+ function H() {
88
+ return e.hiddenPolicy === "omit" ? {
89
+ omitFields: A.value.filter(U).map((a) => a.name)
90
+ } : void 0;
91
+ }
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 = y, l = new AbortController();
97
+ x = l, P = a, b.value = void 0, a === "reset" && e.query.resetFields();
98
+ const s = J(e.query.draft.value), i = H();
99
+ q.value = !0;
100
+ let d;
101
+ return g = new Promise((u) => {
102
+ d = u;
103
+ }), j = d, (async () => {
104
+ let u = !1;
105
+ try {
106
+ if (a === "reset" && await oe(), m || t !== y || l.signal.aborted) return !1;
107
+ const o = await e.validate?.(s, {
108
+ fields: O.value,
109
+ action: a,
110
+ signal: l.signal
111
+ });
112
+ return m || t !== y || l.signal.aborted ? !1 : o === !1 ? (b.value = v.value.validationFailed, !1) : !K(s, e.query.draft.value) || (q.value = !1, u = await (a === "reset" ? e.query.reset(i) : e.query.submit(i)), m || t !== y) ? !1 : (I(a === "reset" ? "reset" : "submitted", u), u);
113
+ } catch (o) {
114
+ return !m && t === y && (b.value = o instanceof Error ? o.message : String(o)), !1;
115
+ } finally {
116
+ t === y && (q.value = !1, P = void 0, x = void 0, g = void 0, j = void 0);
117
+ }
118
+ })().then(d), g;
119
+ }
120
+ function W(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 || K(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]: J(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)));
132
+ }
133
+ le(() => {
134
+ m = !0, k();
135
+ });
136
+ const V = {
137
+ submit: () => h("submit"),
138
+ reset: () => h("reset"),
139
+ cancel: k
140
+ };
141
+ return Y(V), () => {
142
+ const a = e.rootTag;
143
+ return n(a, ue(R, {
144
+ class: r.root(),
145
+ "aria-label": v.value.label,
146
+ onSubmit: (t) => {
147
+ t.preventDefault(), h("submit");
148
+ }
149
+ }), {
150
+ default: () => [n("div", {
151
+ class: r.fields()
152
+ }, [z.value.map((t) => {
153
+ const l = E(t), s = `${Z}-${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];
154
+ for (const c of Array.isArray(w) ? w : [w]) {
155
+ if (!t.dictionary || !["string", "number", "boolean"].includes(typeof c) || o.some((p) => Object.is(p.value, c))) continue;
156
+ const T = C(t.dictionary.valueEnum).get(c), L = typeof T == "string" ? T : T?.text;
157
+ typeof L == "string" && o.push({
158
+ value: c,
159
+ label: L,
160
+ ...typeof T == "object" ? {
161
+ status: T.status
162
+ } : {}
163
+ });
164
+ }
165
+ const $ = {
166
+ value: w,
167
+ onChange: (c) => W(t, c),
168
+ fieldProps: typeof t.fieldProps == "function" ? t.fieldProps(l) : t.fieldProps ?? {},
169
+ options: o,
170
+ disabled: u,
171
+ readonly: d,
172
+ loading: C(t.dictionary?.loading) ?? !1,
173
+ error: i,
174
+ id: s,
175
+ name: t.name,
176
+ mode: "query",
177
+ onSearch: t.dictionary ? (c) => {
178
+ t.dictionary.search(c);
179
+ } : void 0
180
+ }, X = e.controls[t.valueType ?? "text"] ?? e.controls.text;
181
+ return n("div", {
182
+ key: t.name,
183
+ class: r.field(),
184
+ "data-query-field": t.name
185
+ }, [n("label", {
186
+ class: r.label(),
187
+ for: s
188
+ }, [t.label ?? t.name]), n("div", {
189
+ class: r.control()
190
+ }, [F.field?.({
191
+ field: t,
192
+ values: e.query.draft.value,
193
+ control: $
194
+ }) ?? X?.($), i ? n("div", {
195
+ class: r.error(),
196
+ role: "alert",
197
+ id: `${s}-error`
198
+ }, [i]) : null])]);
199
+ })]), n("div", {
200
+ class: r.actions()
201
+ }, [F.actions?.({
202
+ ...V,
203
+ submitting: B.value,
204
+ collapsed: e.query.collapsed.value,
205
+ toggleCollapsed: e.query.toggleCollapsed
206
+ }) ?? n(re, null, [n(D, {
207
+ htmlType: "button",
208
+ disabled: B.value,
209
+ onClick: (t) => {
210
+ t.preventDefault(), h("reset");
211
+ }
212
+ }, {
213
+ default: () => [v.value.reset]
214
+ }), n(D, {
215
+ type: "primary",
216
+ htmlType: e.rootTag === "form" ? "submit" : "button",
217
+ disabled: B.value,
218
+ onClick: (t) => {
219
+ t.preventDefault(), h("submit");
220
+ }
221
+ }, {
222
+ default: () => [v.value.submit]
223
+ }), Q.value ? n(D, {
224
+ type: "link",
225
+ htmlType: "button",
226
+ disabled: e.disabled,
227
+ class: r.collapse(),
228
+ onClick: (t) => {
229
+ t.preventDefault(), e.query.toggleCollapsed();
230
+ },
231
+ "aria-expanded": !e.query.collapsed.value
232
+ }, {
233
+ default: () => [e.query.collapsed.value ? v.value.expand : v.value.collapse]
234
+ }) : null])]), b.value || e.query.error.value ? n("div", {
235
+ class: r.feedback(),
236
+ role: "alert"
237
+ }, [b.value ?? e.query.error.value?.message]) : null]
238
+ });
239
+ };
240
+ }
241
+ });
242
+ export {
243
+ Te as default
244
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TableQuery.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableQuery.test.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableQuery.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=VTableDynamicSlots.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VTableDynamicSlots.test.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableDynamicSlots.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { UseTableEditableReturn } from '../types/editable';
2
+ import { TableBodyCellSlotProps } from '../types/table';
3
+ declare const _default: <TRecord extends object = Record<string, unknown>>(__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<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & {
5
+ edit: Pick<UseTableEditableReturn<TRecord>, "renderEditor">;
6
+ cell: TableBodyCellSlotProps<TRecord>;
7
+ } & Partial<{}>> & import('vue').PublicProps;
8
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
9
+ attrs: any;
10
+ slots: {};
11
+ emit: {};
12
+ }>) => import('vue').VNode & {
13
+ __ctx?: Awaited<typeof __VLS_setup>;
14
+ };
15
+ export default _default;
16
+ type __VLS_PrettifyLocal<T> = {
17
+ [K in keyof T]: T[K];
18
+ } & {};
19
+ //# sourceMappingURL=VTableEditCell.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VTableEditCell.vue.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableEditCell.vue"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;yBAE3C,OAAO,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,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;WA6DO,mBAAmB,CAAC;cA1DpB,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;cACrD,sBAAsB,CAAC,OAAO,CAAC;mBAyDuD,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;UAEJ,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAxEzE,wBAwE4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { defineComponent as n, createBlock as r, openBlock as c } from "vue";
2
+ const i = /* @__PURE__ */ n({
3
+ name: "VTableEditCell",
4
+ inheritAttrs: !1,
5
+ __name: "VTableEditCell",
6
+ props: {
7
+ edit: {},
8
+ cell: {}
9
+ },
10
+ setup(t) {
11
+ const e = t, l = () => e.edit.renderEditor({
12
+ ...e.cell,
13
+ value: e.cell.text,
14
+ renderIndex: e.cell.index
15
+ });
16
+ return (o, d) => (c(), r(l));
17
+ }
18
+ });
19
+ export {
20
+ i as default
21
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./VTableEditCell.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,18 @@
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<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onReset?: ((success: boolean) => any) | undefined;
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;
7
+ expose(exposed: import('vue').ShallowUnwrapRef<TableQueryInstance>): void;
8
+ attrs: any;
9
+ slots: Readonly<TableQuerySlots<TValues>> & TableQuerySlots<TValues>;
10
+ emit: ((evt: "reset", success: boolean) => void) & ((evt: "submitted", success: boolean) => void);
11
+ }>) => import('vue').VNode & {
12
+ __ctx?: Awaited<typeof __VLS_setup>;
13
+ };
14
+ export default _default;
15
+ type __VLS_PrettifyLocal<T> = {
16
+ [K in keyof T]: T[K];
17
+ } & {};
18
+ //# sourceMappingURL=VTableQuery.vue.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,64 @@
1
+ import { defineComponent as p, ref as c, createBlock as y, openBlock as b, unref as v, mergeProps as P, createSlots as T, withCtx as l, renderSlot as n, normalizeProps as i, guardReactiveProps as a } from "vue";
2
+ import k from "./TableQuery.mjs";
3
+ const g = /* @__PURE__ */ p({
4
+ name: "VTableQuery",
5
+ inheritAttrs: !1,
6
+ __name: "VTableQuery",
7
+ props: {
8
+ query: {},
9
+ rootTag: {},
10
+ fields: {},
11
+ controls: {},
12
+ layout: {},
13
+ autoSubmit: { type: Boolean },
14
+ debounceTime: {},
15
+ hiddenPolicy: {},
16
+ collapsedCount: {},
17
+ collapsible: { type: Boolean, default: !0 },
18
+ disabled: { type: Boolean },
19
+ validate: {},
20
+ errors: {},
21
+ locale: {},
22
+ ui: {},
23
+ class: {}
24
+ },
25
+ emits: ["submitted", "reset"],
26
+ setup(u, { expose: m, emit: d }) {
27
+ const f = u, r = d, t = c();
28
+ m({
29
+ submit: () => t.value?.submit() ?? Promise.resolve(!1),
30
+ reset: () => t.value?.reset() ?? Promise.resolve(!1),
31
+ cancel: () => t.value?.cancel()
32
+ });
33
+ function B(e) {
34
+ return e;
35
+ }
36
+ return (e, s) => (b(), y(v(k), P({
37
+ ref_key: "inner",
38
+ ref: t
39
+ }, { ...e.$attrs, ...f }, {
40
+ onSubmitted: s[0] || (s[0] = (o) => r("submitted", o)),
41
+ onReset: s[1] || (s[1] = (o) => r("reset", o))
42
+ }), T({ _: 2 }, [
43
+ e.$slots.field ? {
44
+ name: "field",
45
+ fn: l((o) => [
46
+ n(e.$slots, "field", i(a(
47
+ o
48
+ )))
49
+ ]),
50
+ key: "0"
51
+ } : void 0,
52
+ e.$slots.actions ? {
53
+ name: "actions",
54
+ fn: l((o) => [
55
+ n(e.$slots, "actions", i(a(o)))
56
+ ]),
57
+ key: "1"
58
+ } : void 0
59
+ ]), 1040));
60
+ }
61
+ });
62
+ export {
63
+ g as default
64
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./VTableQuery.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,5 @@
1
+ import { CreateTableDictionaryOptions, TableDictionary, UseTableDictionaryOptions, UseTableDictionaryReturn } from '../types/dictionary';
2
+ /** A cache is owned by this instance, never by a process-wide registry or a cell renderer. */
3
+ export declare function createTableDictionary<TParams extends object = Record<string, unknown>>(options: CreateTableDictionaryOptions<TParams>): TableDictionary<TParams>;
4
+ export declare function useTableDictionary<TParams extends object = Record<string, unknown>>(options: UseTableDictionaryOptions<TParams>): UseTableDictionaryReturn;
5
+ //# sourceMappingURL=useTableDictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableDictionary.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useTableDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,eAAe,EAGf,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,qBAAqB,CAAA;AA+B5B,8FAA8F;AAC9F,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpF,OAAO,EAAE,4BAA4B,CAAC,OAAO,CAAC,GAC7C,eAAe,CAAC,OAAO,CAAC,CAyG1B;AAED,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjF,OAAO,EAAE,yBAAyB,CAAC,OAAO,CAAC,GAC1C,wBAAwB,CAoI1B"}