@web-utils/form-ui 1.0.0-beta4 → 1.0.0-beta40

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 (189) hide show
  1. package/api/index.d.ts +60 -0
  2. package/api/index.mjs +42 -0
  3. package/awesome-button/index.d.ts +60 -0
  4. package/awesome-button/index.mjs +49 -0
  5. package/base.css +1 -0
  6. package/chunks/B1MSrc6f.mjs +8 -0
  7. package/chunks/B3ajWLh3.mjs +198 -0
  8. package/chunks/BH_JJ8Xh.mjs +106 -0
  9. package/chunks/BWBHzD5N.mjs +89 -0
  10. package/chunks/Bd1UFJic.mjs +660 -0
  11. package/chunks/Bm5eiSmT.mjs +79 -0
  12. package/chunks/BsCS7SB5.mjs +141 -0
  13. package/chunks/BufIRDd0.mjs +185 -0
  14. package/chunks/C1AgOUe_.mjs +172 -0
  15. package/chunks/C3Uo82-I.mjs +35 -0
  16. package/chunks/C9dGL28n.mjs +56 -0
  17. package/chunks/CFOGMFgo.mjs +150 -0
  18. package/chunks/CLPSCSsy.mjs +603 -0
  19. package/chunks/CSyJ-vEx.mjs +17 -0
  20. package/chunks/CTKmEf2M.mjs +93 -0
  21. package/chunks/CWfUPCtS.mjs +1360 -0
  22. package/chunks/CXvGoZKJ.mjs +198 -0
  23. package/chunks/Cab-ZjRx.mjs +164 -0
  24. package/chunks/ChmDDqoZ2.mjs +478 -0
  25. package/chunks/Cj59E77g.mjs +230 -0
  26. package/chunks/CqTcEefA.mjs +93 -0
  27. package/chunks/Ct5bDJ50.mjs +38 -0
  28. package/chunks/CuG2Q-PM.mjs +100 -0
  29. package/chunks/D8UVq1t1.mjs +176 -0
  30. package/chunks/DDmQcNm6.mjs +93 -0
  31. package/chunks/DF9fJMQS.mjs +105 -0
  32. package/chunks/DJe97Fgi.mjs +107 -0
  33. package/chunks/DXYgAmil.mjs +317 -0
  34. package/chunks/DhtHh0jk.mjs +87 -0
  35. package/chunks/DiJyms_r.mjs +100 -0
  36. package/chunks/Ds_Tpa_M.mjs +83 -0
  37. package/chunks/TvNHGVAP.mjs +25 -0
  38. package/chunks/XCGWTz41.mjs +25 -0
  39. package/chunks/XqRTtFfp.mjs +166 -0
  40. package/chunks/cmuHpsX6.mjs +109 -0
  41. package/chunks/o6VhYAN52.mjs +207 -0
  42. package/chunks/pdwFQpA8.mjs +57 -0
  43. package/chunks/taicx2sd.mjs +25 -0
  44. package/confirm-button/index.d.ts +113 -0
  45. package/confirm-button/index.mjs +35 -0
  46. package/confirmable/index.d.ts +84 -0
  47. package/confirmable/index.mjs +8 -0
  48. package/constants/index.d.ts +53 -0
  49. package/constants/index.mjs +4 -0
  50. package/editable-tree/index.d.ts +254 -0
  51. package/editable-tree/index.mjs +2 -0
  52. package/editable-tree/style.css +1 -0
  53. package/element-dialog/index.d.ts +337 -16
  54. package/element-dialog/index.mjs +2 -91
  55. package/empty-view/index.d.ts +2 -2
  56. package/empty-view/index.mjs +1 -1
  57. package/flex-scroll-area/index.d.ts +1 -1
  58. package/flex-scroll-area/index.mjs +1 -1
  59. package/form-advice/index.mjs +13 -12
  60. package/form-button/index.d.ts +114 -0
  61. package/form-button/index.mjs +36 -0
  62. package/form-card/index.d.ts +14 -0
  63. package/form-card/index.mjs +18 -0
  64. package/form-cascader/index.d.ts +472 -0
  65. package/form-cascader/index.mjs +2 -0
  66. package/form-check-box-group/index.d.ts +289 -18
  67. package/form-check-box-group/index.mjs +1 -1
  68. package/form-check-box-group/style.css +1 -0
  69. package/form-checkbox/index.d.ts +236 -16
  70. package/form-checkbox/index.mjs +1 -1
  71. package/form-date-picker/index.d.ts +390 -19
  72. package/form-date-picker/index.mjs +1 -1
  73. package/form-holder/index.d.ts +87 -20
  74. package/form-holder/index.mjs +1 -1
  75. package/form-holder/style.css +1 -1
  76. package/form-image/index.d.ts +145 -13
  77. package/form-image/index.mjs +1 -1
  78. package/form-input/index.d.ts +301 -20
  79. package/form-input/index.mjs +1 -1
  80. package/form-input/style.css +1 -0
  81. package/form-input-cron-expression/index.d.ts +217 -0
  82. package/form-input-cron-expression/index.mjs +2 -0
  83. package/form-input-cron-expression/style.css +1 -0
  84. package/form-input-email/index.d.ts +307 -16
  85. package/form-input-email/index.mjs +1 -1
  86. package/form-input-id-card/index.d.ts +307 -16
  87. package/form-input-id-card/index.mjs +1 -1
  88. package/form-input-number/index.d.ts +246 -18
  89. package/form-input-number/index.mjs +1 -1
  90. package/form-input-phone-number/index.d.ts +307 -16
  91. package/form-input-phone-number/index.mjs +1 -1
  92. package/form-input-tag/index.d.ts +263 -1
  93. package/form-input-tag/index.mjs +1 -3
  94. package/form-input-time/index.d.ts +434 -1
  95. package/form-input-time/index.mjs +1 -3
  96. package/form-item-config-provider/index.d.ts +22 -0
  97. package/form-item-config-provider/index.mjs +24 -0
  98. package/form-item-group/index.d.ts +91 -17
  99. package/form-item-group/index.mjs +2 -78
  100. package/form-item-group/style.css +1 -1
  101. package/form-item-x/index.d.ts +141 -11
  102. package/form-item-x/index.mjs +1 -1
  103. package/form-item-x/style.css +1 -0
  104. package/form-radio-group/index.d.ts +303 -16
  105. package/form-radio-group/index.mjs +1 -1
  106. package/form-rate/index.d.ts +254 -14
  107. package/form-rate/index.mjs +1 -1
  108. package/form-red-table/index.mjs +27 -26
  109. package/form-row/index.d.ts +2 -2
  110. package/form-row/index.mjs +1 -1
  111. package/form-select/index.d.ts +537 -18
  112. package/form-select/index.mjs +1 -1
  113. package/form-slider/index.d.ts +283 -16
  114. package/form-slider/index.mjs +1 -1
  115. package/form-switch/index.d.ts +272 -14
  116. package/form-switch/index.mjs +1 -1
  117. package/form-text/index.d.ts +165 -13
  118. package/form-text/index.mjs +1 -1
  119. package/form-textarea/index.d.ts +351 -0
  120. package/form-textarea/index.mjs +2 -0
  121. package/form-time-select/index.d.ts +319 -0
  122. package/form-time-select/index.mjs +2 -0
  123. package/form-view/index.mjs +1 -1
  124. package/helper/dictionary.d.ts +15 -0
  125. package/helper/dictionary.mjs +97 -0
  126. package/hook/useDictionary.d.ts +60 -0
  127. package/hook/useDictionary.mjs +15 -0
  128. package/hook/useVisibilityChange.d.ts +4 -0
  129. package/hook/useVisibilityChange.mjs +14 -0
  130. package/iframe-window/index.d.ts +9 -0
  131. package/iframe-window/index.mjs +37 -0
  132. package/iframe-window/style.css +1 -0
  133. package/index.d.ts +52 -36
  134. package/index.mjs +54 -61
  135. package/package.json +10 -5
  136. package/pageable-table/index.d.ts +398 -0
  137. package/pageable-table/index.mjs +2 -0
  138. package/pageable-table/style.css +1 -0
  139. package/resize-observer/index.d.ts +8 -0
  140. package/resize-observer/index.mjs +40 -0
  141. package/resize-observer/style.css +1 -0
  142. package/resolver/index.mjs +29 -0
  143. package/table-column/index.d.ts +160 -0
  144. package/table-column/index.mjs +2 -0
  145. package/table-column/style.css +1 -0
  146. package/table-column-def/index.d.ts +85 -0
  147. package/table-column-def/index.mjs +11 -0
  148. package/table-view/index.d.ts +340 -1
  149. package/table-view/index.mjs +453 -6
  150. package/table-view/style.css +1 -0
  151. package/toolbar/index.d.ts +128 -1
  152. package/toolbar/index.mjs +1 -8
  153. package/toolbar/style.css +1 -0
  154. package/toolbar-button/index.d.ts +188 -1
  155. package/toolbar-button/index.mjs +1 -8
  156. package/vue-cron/index.d.ts +191 -0
  157. package/vue-cron/index.mjs +2 -0
  158. package/vue-cron/style.css +1 -0
  159. package/web-types.json +1 -1
  160. package/x-input-tag/index.d.ts +2 -0
  161. package/x-input-tag/index.mjs +227 -0
  162. package/x-input-tag/style.css +1 -0
  163. package/year-calendar/index.d.ts +99 -0
  164. package/year-calendar/index.mjs +2 -0
  165. package/year-calendar/style.css +1 -0
  166. package/chunks/B4M_TFeR.mjs +0 -152
  167. package/chunks/B5BIQCcK.mjs +0 -149
  168. package/chunks/BHNKrW1j.mjs +0 -61
  169. package/chunks/BO9jWhBl.mjs +0 -46
  170. package/chunks/BZ8aOa78.mjs +0 -35
  171. package/chunks/Bsz7y4Xp.mjs +0 -73
  172. package/chunks/Bxj372sF.mjs +0 -53
  173. package/chunks/C33EmJN8.mjs +0 -32
  174. package/chunks/C6Li3-l7.mjs +0 -28
  175. package/chunks/CBcdalMX.mjs +0 -35
  176. package/chunks/CdRsyF0n.mjs +0 -43
  177. package/chunks/ClNahmiU.mjs +0 -23
  178. package/chunks/CstztYMu.mjs +0 -28
  179. package/chunks/DC9b53M6.mjs +0 -32
  180. package/chunks/DDVAgRED.mjs +0 -36
  181. package/chunks/DpJQABVD.mjs +0 -91
  182. package/chunks/ZsLNWI9x.mjs +0 -46
  183. package/chunks/jn_iQrVZ.mjs +0 -28
  184. package/constants.d.ts +0 -1
  185. package/constants.mjs +0 -4
  186. package/input/style.css +0 -1
  187. package/resolver.mjs +0 -79
  188. package/utils/style.css +0 -1
  189. /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
@@ -0,0 +1,603 @@
1
+ import { n as e, u as t } from "./cmuHpsX6.mjs";
2
+ import { getDictLabel as n } from "../helper/dictionary.mjs";
3
+ import { pageableTableContextKey as r } from "../constants/index.mjs";
4
+ import i from "../resize-observer/index.mjs";
5
+ import { t as a } from "./CuG2Q-PM.mjs";
6
+ import { useVisibilityChange as o } from "../hook/useVisibilityChange.mjs";
7
+ import { hasOwn as s } from "@web-utils/core";
8
+ import { Fragment as c, computed as l, createBlock as u, createTextVNode as d, createVNode as f, inject as p, mergeModels as m, mergeProps as h, nextTick as ee, onBeforeUpdate as te, onUpdated as g, openBlock as _, provide as ne, reactive as v, ref as y, toDisplayString as b, useModel as x, watch as S, withCtx as C } from "vue";
9
+ import { ElMessage as re } from "element-plus";
10
+ import { ElButton as ie, ElCheckbox as w, ElDrawer as T, ElEmpty as ae, ElPagination as E, ElRadio as D, ElTable as O, ElTableColumn as k } from "element-plus/es";
11
+ import { useEventBus as A } from "@web-utils/vue/hooks/useEventBus";
12
+ //#region src/components/table/components/TableColumnFilter.vue
13
+ var j = {
14
+ __name: "TableColumnFilter",
15
+ props: /* @__PURE__ */ m({ columns: {
16
+ type: Array,
17
+ default: () => []
18
+ } }, {
19
+ modelValue: {
20
+ type: Boolean,
21
+ default: !1
22
+ },
23
+ modelModifiers: {}
24
+ }),
25
+ emits: ["update:modelValue"],
26
+ setup(e, { expose: t }) {
27
+ let n = x(e, "modelValue"), r = v({}), i = v({}), a = v({}), o = v({}), s = (e, t, n) => {
28
+ n === "hide" ? r[t.prop] = e : n === "fixed" ? i[t.prop] = e : n === "filterable" ? a[t.prop] = e : n === "sortable" && (o[t.prop] = e);
29
+ };
30
+ return t({
31
+ hideProps: r,
32
+ fixedProps: i,
33
+ filterableProps: a,
34
+ sortableProps: o
35
+ }), (t, r) => {
36
+ let i = k, a = w, o = O, c = T;
37
+ return _(), u(c, {
38
+ modelValue: n.value,
39
+ "onUpdate:modelValue": r[0] || (r[0] = (e) => n.value = e),
40
+ class: "table-column-filter",
41
+ title: "表格设置",
42
+ "append-to-body": ""
43
+ }, {
44
+ default: C(() => [f(o, {
45
+ data: e.columns,
46
+ border: ""
47
+ }, {
48
+ default: C(() => [
49
+ f(i, { label: "列名" }, {
50
+ default: C(({ row: e }) => [d(b(e.label), 1)]),
51
+ _: 1
52
+ }),
53
+ f(i, {
54
+ label: "隐藏",
55
+ align: "center"
56
+ }, {
57
+ default: C(({ row: e }) => [f(a, { onChange: (t) => s(t, e, "hide") }, null, 8, ["onChange"])]),
58
+ _: 1
59
+ }),
60
+ f(i, {
61
+ label: "冻结",
62
+ align: "center"
63
+ }, {
64
+ default: C(({ row: e }) => [f(a, { onChange: (t) => s(t, e, "fixed") }, null, 8, ["onChange"])]),
65
+ _: 1
66
+ }),
67
+ f(i, {
68
+ label: "过滤",
69
+ align: "center"
70
+ }, {
71
+ default: C(({ row: e }) => [f(a, { onChange: (t) => s(t, e, "filterable") }, null, 8, ["onChange"])]),
72
+ _: 1
73
+ }),
74
+ f(i, {
75
+ label: "排序",
76
+ align: "center"
77
+ }, {
78
+ default: C(({ row: e }) => [f(a, {
79
+ title: e.allowSort ? null : "该列不支持排序!",
80
+ disabled: !e.allowSort,
81
+ onChange: (t) => s(t, e, "sortable")
82
+ }, null, 8, [
83
+ "title",
84
+ "disabled",
85
+ "onChange"
86
+ ])]),
87
+ _: 1
88
+ })
89
+ ]),
90
+ _: 1
91
+ }, 8, ["data"])]),
92
+ _: 1
93
+ }, 8, ["modelValue"]);
94
+ };
95
+ }
96
+ }, M = {
97
+ props: {
98
+ filterable: Boolean,
99
+ prop: String
100
+ },
101
+ setup(e, { attrs: t, slots: n }) {
102
+ let i = p(r, null), o = l(() => {
103
+ if (e.filterable && i) return (e, t, n) => t[n.property] === e;
104
+ }), s = l(() => {
105
+ if (e.filterable && i) return [...new Set(i.records.value.map((t) => t[e.prop]).filter((e) => e))].map((e) => ({
106
+ text: e,
107
+ value: e
108
+ }));
109
+ });
110
+ return () => f(a, h(t, {
111
+ prop: e.prop,
112
+ filterable: e.filterable,
113
+ filterMethod: o.value,
114
+ filters: s.value
115
+ }), { default: t.default || n.default });
116
+ }
117
+ }, N = {
118
+ data: {
119
+ type: Array,
120
+ default: () => []
121
+ },
122
+ height: [String, Number],
123
+ maxHeight: [String, Number],
124
+ stripe: {
125
+ type: Boolean,
126
+ default: !1
127
+ },
128
+ border: {
129
+ type: Boolean,
130
+ default: !0
131
+ },
132
+ size: String,
133
+ fit: {
134
+ type: Boolean,
135
+ default: !0
136
+ },
137
+ showHeader: {
138
+ type: Boolean,
139
+ default: !0
140
+ },
141
+ highlightCurrentRow: {
142
+ type: Boolean,
143
+ default: !1
144
+ },
145
+ currentRowKey: [String, Number],
146
+ rowClassName: [Function, String],
147
+ rowStyle: [Function, Object],
148
+ cellClassName: [Function, String],
149
+ cellStyle: [Function, Object],
150
+ headerRowClassName: [Function, String],
151
+ headerRowStyle: [Function, Object],
152
+ headerCellClassName: [Function, String],
153
+ headerCellStyle: [Function, Object],
154
+ rowKey: {
155
+ type: [Function, String],
156
+ default: "id"
157
+ },
158
+ emptyText: {
159
+ type: String,
160
+ default: "No Data"
161
+ },
162
+ defaultExpandAll: {
163
+ type: Boolean,
164
+ default: !1
165
+ },
166
+ expandRowKeys: {
167
+ type: Array,
168
+ default: () => []
169
+ },
170
+ defaultSort: Object,
171
+ tooltipEffect: {
172
+ type: String,
173
+ default: "dark"
174
+ },
175
+ tooltipOptions: {
176
+ type: Object,
177
+ default: () => ({})
178
+ },
179
+ appendFilterPanelTo: String,
180
+ showSummary: {
181
+ type: Boolean,
182
+ default: !1
183
+ },
184
+ sumText: {
185
+ type: String,
186
+ default: "Sum"
187
+ },
188
+ summaryMethod: Function,
189
+ spanMethod: Function,
190
+ selectOnIndeterminate: {
191
+ type: Boolean,
192
+ default: !0
193
+ },
194
+ indent: {
195
+ type: Number,
196
+ default: 16
197
+ },
198
+ lazy: {
199
+ type: Boolean,
200
+ default: !1
201
+ },
202
+ load: Function,
203
+ treeProps: {
204
+ type: Object,
205
+ default: () => ({})
206
+ },
207
+ tableLayout: {
208
+ type: String,
209
+ default: "fixed"
210
+ },
211
+ scrollbarAlwaysOn: {
212
+ type: Boolean,
213
+ default: !1
214
+ },
215
+ showOverflowTooltip: [Boolean, Object],
216
+ flexible: {
217
+ type: Boolean,
218
+ default: !1
219
+ },
220
+ scrollbarTabindex: [String, Number],
221
+ allowDragLastColumn: {
222
+ type: Boolean,
223
+ default: !0
224
+ },
225
+ tooltipFormatter: Function,
226
+ preserveExpandedContent: {
227
+ type: Boolean,
228
+ default: !1
229
+ },
230
+ nativeScrollbar: {
231
+ type: Boolean,
232
+ default: !1
233
+ },
234
+ rowExpandable: Function,
235
+ selectionWidth: {
236
+ type: String,
237
+ default: "45"
238
+ },
239
+ viewId: String,
240
+ url: String,
241
+ hideOnSinglePage: Boolean,
242
+ api: Function,
243
+ model: Object,
244
+ ascs: {
245
+ type: Array,
246
+ default: () => []
247
+ },
248
+ descs: {
249
+ type: Array,
250
+ default: () => []
251
+ },
252
+ headerBold: Boolean,
253
+ autoHeight: Boolean,
254
+ immediate: {
255
+ type: Boolean,
256
+ default: !0
257
+ },
258
+ index: {
259
+ type: Boolean,
260
+ default: !0
261
+ },
262
+ multiple: {
263
+ type: Boolean,
264
+ default: !0
265
+ },
266
+ selection: {
267
+ type: Boolean,
268
+ default: !0
269
+ },
270
+ reloadOnModelChange: {
271
+ type: Boolean,
272
+ default: !1
273
+ },
274
+ columns: Array,
275
+ pageSize: {
276
+ type: Number,
277
+ default: 25
278
+ },
279
+ dicOptions: {
280
+ type: Array,
281
+ default: () => []
282
+ },
283
+ paging: {
284
+ type: Boolean,
285
+ default: !0
286
+ },
287
+ clickRowSelect: Boolean,
288
+ payloadStyle: String,
289
+ disabledRowKeys: Array,
290
+ selectExport: Boolean,
291
+ useVisibilityChange: Boolean
292
+ }, P = { data: !0 }, oe = (e) => P[e] !== !0;
293
+ //#endregion
294
+ //#region src/components/table/PageableTable.vue?vue&type=script&lang.jsx
295
+ function se(e) {
296
+ let t = "";
297
+ for (let n in e) t += `<TableColumn prop="${n}" label="${n}"/>\n`;
298
+ return t;
299
+ }
300
+ var F = {
301
+ loading: 1,
302
+ error: -1,
303
+ empty: 2,
304
+ success: 0
305
+ }, I = {
306
+ name: "PageableTable",
307
+ emits: { "page-loaded": null },
308
+ inheritAttrs: !1,
309
+ props: { ...N },
310
+ setup(a, { emit: u, attrs: p, slots: m, expose: _ }) {
311
+ let v = y(), b = y(), x = y(1), C = y(F.empty), w = y([]), T = y(null), N = y(!1), P = y([]), I = y({
312
+ total: 0,
313
+ page: 1,
314
+ limit: a.pageSize,
315
+ ascs: a.ascs,
316
+ descs: a.descs
317
+ }), L = y(0), R = y(0), z = l(() => a.reloadOnModelChange ? {
318
+ asc: I.value.ascs,
319
+ desc: I.value.descs,
320
+ page: I.value.page,
321
+ limit: I.value.limit,
322
+ model: a.model
323
+ } : {
324
+ asc: I.value.ascs,
325
+ desc: I.value.descs,
326
+ page: I.value.page,
327
+ limit: I.value.limit
328
+ }), B = l(() => {
329
+ var e;
330
+ let t = `${(I.value.page - 1) * I.value.limit + (((e = w.value) == null ? void 0 : e.length) ?? 0)}`;
331
+ return t.length > 3 ? 60 + (t.length - 3) * 10 : 60;
332
+ }), V = () => {
333
+ U();
334
+ }, H = (e, t, n) => {
335
+ if (a.clickRowSelect && $(e)) {
336
+ var r;
337
+ if (P.value.find((t) => t[a.rowKey] === e[a.rowKey])) {
338
+ var i;
339
+ (i = v.value) == null || i.toggleRowSelection(e, !1);
340
+ return;
341
+ }
342
+ (r = v.value) == null || r.toggleRowSelection(e);
343
+ }
344
+ }, U = () => {
345
+ var e, t;
346
+ let n = (e = v.value) == null || (e = e.$children) == null ? void 0 : e.find((e) => {
347
+ var t;
348
+ return ((t = e.$options) == null ? void 0 : t.name) === "ElTableBody";
349
+ });
350
+ n == null || (t = n.$refs) == null || (t = t.tooltip) == null || t.hide();
351
+ }, W = ({ scrollLeft: e, scrollTop: t }) => {
352
+ L.value = t, R.value = e;
353
+ }, G = () => {
354
+ pe(L.value, R.value);
355
+ }, ce = (t) => e(se(t)), le = ({ prop: e, order: t }) => {
356
+ a.payloadStyle === "body" ? (I.value.ascs = t === "ascending" ? [e] : a.ascs, I.value.descs = t === "descending" ? [e] : a.descs) : (I.value.ascs = t === "ascending" ? e : "", I.value.descs = t === "descending" ? e : "");
357
+ }, ue = (e) => {
358
+ $(e) && (T.value = e);
359
+ }, de = (e) => {
360
+ P.value = e;
361
+ }, K = () => {
362
+ var e;
363
+ (e = v.value) == null || e.clearSelection();
364
+ }, fe = () => {
365
+ let e;
366
+ return e = a.payloadStyle === "body" ? {
367
+ page: {
368
+ ...I.value,
369
+ current: I.value.page,
370
+ size: I.value.limit
371
+ },
372
+ example: a.model || {}
373
+ } : {
374
+ ...I.value,
375
+ current: I.value.page,
376
+ size: I.value.limit,
377
+ ...a.model || {}
378
+ }, a.selectExport && (a.rowKey ? e.exportKeys = P.value.map((e) => e[a.rowKey]) : e.exportKeys = P.value.map((e) => w.value.indexOf(e))), e;
379
+ }, q = async (e = !0) => {
380
+ if (s(p, "data") && p.data !== !1) {
381
+ var t;
382
+ w.value = p.data, I.value.page = 1, I.value.total = (t = w.value) == null ? void 0 : t.length, I.value.limit = I.value.total;
383
+ return;
384
+ }
385
+ e !== !1 && (w.value = []);
386
+ let n, r = fe();
387
+ if (a.api) {
388
+ e !== !1 && (C.value = F.loading);
389
+ try {
390
+ a.api && (n = await a.api(r));
391
+ } catch {
392
+ C.value = F.error;
393
+ return;
394
+ }
395
+ } else if (a.data) n = { data: { data: {
396
+ total: a.data.length,
397
+ records: a.data
398
+ } } };
399
+ else {
400
+ re.warning({
401
+ title: "开发提示!",
402
+ message: "PageableTable api(Function) 属性"
403
+ });
404
+ return;
405
+ }
406
+ let { data: { data: i } = {} } = n || {}, { total: o, records: c } = i || {};
407
+ I.value.total = Number(o), w.value = await me(c), !c || !c.length ? C.value = F.empty : C.value = F.success, J(), u("page-loaded", i);
408
+ }, J = () => {
409
+ ee(() => {
410
+ var e;
411
+ (e = v.value) == null || e.doLayout();
412
+ });
413
+ }, Y = async (e) => {
414
+ await q(e);
415
+ }, X = () => {
416
+ I.value = {
417
+ total: 0,
418
+ page: 1,
419
+ limit: a.pageSize,
420
+ ascs: a.ascs,
421
+ descs: a.descs
422
+ };
423
+ }, pe = (e, t) => {
424
+ v.value.setScrollTop(e), v.value.setScrollLeft(t);
425
+ }, Z = (e, t) => {
426
+ var n;
427
+ (n = v.value) == null || n.toggleRowSelection(e, t);
428
+ }, me = async (e) => {
429
+ if (!e) return [];
430
+ let t = [...e];
431
+ for (let e of t) for (let t of a.dicOptions) if (e[`$${t.prop}`] = e[t.prop], t.dicData) {
432
+ var r;
433
+ e[t.prop] = ((r = t.dicData.find((n) => n.modelValue === e[t.prop])) == null ? void 0 : r.label) || e[t.prop];
434
+ } else e[t.prop] = await n(t.dicType, e[t.prop]);
435
+ return t;
436
+ }, Q = () => {
437
+ N.value = !N.value;
438
+ }, $ = (e) => {
439
+ var t;
440
+ return !(e != null && e.disabled) && !((t = a.disabledRowKeys) != null && t.includes(e == null ? void 0 : e[a.rowKey]));
441
+ };
442
+ a.useVisibilityChange && o({ onPageVisible: () => {
443
+ Y(!1);
444
+ } }), A("reloadTableView", (e) => {
445
+ e === a.viewId && q();
446
+ }), S(() => a.url, X), S(() => a.api, X), S(() => p.data, q), S(() => z.value, q, {
447
+ deep: !0,
448
+ immediate: a.immediate
449
+ }), g(() => {
450
+ G();
451
+ }), te(() => {
452
+ x.value++;
453
+ }), _({
454
+ records: w,
455
+ getPage: q,
456
+ refresh: Y,
457
+ reload: X,
458
+ doLayout: J,
459
+ clearSelection: K,
460
+ toggleRowSelection: Z,
461
+ toggleSettings: Q
462
+ }), ne(r, {
463
+ records: w,
464
+ getPage: q,
465
+ refresh: Y,
466
+ reload: X,
467
+ doLayout: J,
468
+ clearSelection: K,
469
+ toggleRowSelection: Z,
470
+ toggleSettings: Q
471
+ });
472
+ let { autoBindProps: he, listeners: ge } = t(a, { predicate: oe });
473
+ return () => {
474
+ var e;
475
+ let t = T.value && T.value[p["row-key"] || a.rowKey || "id"] === (T.value && a.rowKey ? T.value[a.rowKey] : (e = T.value) == null ? void 0 : e.id), n = [];
476
+ if (m.default) {
477
+ var r;
478
+ let e = (r = m.default) == null ? void 0 : r.call(m);
479
+ (e.length === 1 ? e[0].children : e).forEach(({ props: e, children: t }) => {
480
+ if (e) {
481
+ var r, i, a, o;
482
+ n.push({
483
+ ...e,
484
+ allowSort: e.sortable !== !1,
485
+ hide: (r = b.value) == null ? void 0 : r.hideProps[e.prop],
486
+ filterable: (i = b.value) == null ? void 0 : i.filterableProps[e.prop],
487
+ sortable: ((a = b.value) == null ? void 0 : a.sortableProps[e.prop]) === !0,
488
+ fixed: e.fixed || ((o = b.value) == null ? void 0 : o.fixedProps[e.prop]),
489
+ header: t == null ? void 0 : t.header,
490
+ default: t == null ? void 0 : t.default
491
+ });
492
+ }
493
+ });
494
+ } else a.columns && a.columns.forEach((e) => {
495
+ var t, r, i, a;
496
+ n.push({
497
+ ...e,
498
+ allowSort: e.sortable !== !1,
499
+ hide: (t = b.value) == null ? void 0 : t.hideProps[e.prop],
500
+ filterable: (r = b.value) == null ? void 0 : r.filterableProps[e.prop],
501
+ sortable: ((i = b.value) == null ? void 0 : i.sortableProps[e.prop]) === !0,
502
+ fixed: e.fixed || ((a = b.value) == null ? void 0 : a.fixedProps[e.prop])
503
+ });
504
+ });
505
+ return f("div", { class: ["pageable-table", { "auto-height": a.autoHeight }] }, [f("div", { class: "pageable-table-wrapper" }, [
506
+ m.toolbar && m.toolbar({ selectedRows: P.value }),
507
+ f(O, h(ge.value, he.value, {
508
+ ref: v,
509
+ data: w.value,
510
+ class: ["flex-item", { "header-bold": a.headerBold }],
511
+ border: a.border,
512
+ stripe: !0,
513
+ size: "default",
514
+ height: a.autoHeight ? null : "auto",
515
+ onScroll: W,
516
+ onSortChange: le,
517
+ onRowDblclick: V,
518
+ onRowClick: H,
519
+ onCellClick: U,
520
+ onCurrentChange: ue,
521
+ onSelectionChange: de
522
+ }), {
523
+ default: () => {
524
+ let e = [];
525
+ if (a.multiple && a.selection && e.push(f(k, {
526
+ type: "selection",
527
+ selectable: $,
528
+ width: a.selectionWidth,
529
+ align: "center"
530
+ }, null)), !a.multiple && a.selection && e.push(f(k, {
531
+ type: "single-selection",
532
+ "class-name": "single-select-column",
533
+ width: a.selectionWidth,
534
+ align: "center"
535
+ }, {
536
+ header: () => f(D, {
537
+ modelValue: !!T.value,
538
+ label: !0
539
+ }, { default: () => [f("span", null, null)] }),
540
+ default: ({ row: e }) => f(D, {
541
+ label: !0,
542
+ disabled: !$(e),
543
+ modelValue: t
544
+ }, { default: () => [f("span", null, null)] })
545
+ })), a.index && e.push(f(k, {
546
+ type: "index",
547
+ label: "序号",
548
+ width: B.value,
549
+ align: "center"
550
+ }, { default: ({ $index: e }) => (I.value.page - 1) * I.value.limit + e + 1 || e + 1 })), n.length > 0) for (let t = 0; t < n.length; t++) {
551
+ let r = n[t];
552
+ if (r.hide) continue;
553
+ let i = r.prop;
554
+ e.push(f(M, r, { default: m[i] ? ({ row: e }) => m[i]({ row: e }) : void 0 }));
555
+ }
556
+ else e.push(f(k, { label: "点击表格行复制模板" }, { default: ({ row: e }) => f("pre", {
557
+ class: "pointer",
558
+ onClick: () => ce(e)
559
+ }, [JSON.stringify(e, null, " ")]) }));
560
+ return e;
561
+ },
562
+ empty: () => m.empty ? m.empty() : f(c, null, [
563
+ C.value === F.loading && f("span", { class: "pageable-table-loading" }, [f("i", { class: "table-status-icon el-icon-loading" }, null), d("加载中...")]),
564
+ C.value === F.error && f(ie, {
565
+ class: "pageable-table-error",
566
+ onClick: Y
567
+ }, { default: () => [f("i", { class: "table-status-icon el-icon-error" }, null), d("加载失败,点击重试!")] }),
568
+ C.value !== F.loading && C.value !== F.error && f(ae, null, null)
569
+ ]),
570
+ append: m.append
571
+ }),
572
+ a.paging && f(E, {
573
+ "current-page": I.value.page,
574
+ "onUpdate:current-page": (e) => I.value.page = e,
575
+ "hide-on-single-page": a.hideOnSinglePage,
576
+ "page-size": I.value.limit,
577
+ "onUpdate:page-size": (e) => I.value.limit = e,
578
+ total: I.value.total,
579
+ "page-sizes": [
580
+ 10,
581
+ 25,
582
+ 50,
583
+ 100,
584
+ 500,
585
+ 1e3,
586
+ 2e3
587
+ ],
588
+ class: "flex-not-shrink",
589
+ background: !0,
590
+ layout: "total, sizes, prev, pager, next, jumper"
591
+ }, null),
592
+ f(j, {
593
+ ref: b,
594
+ modelValue: N.value,
595
+ "onUpdate:modelValue": (e) => N.value = e,
596
+ columns: n
597
+ }, null)
598
+ ]), f(i, { onNotify: J }, null)]);
599
+ };
600
+ }
601
+ };
602
+ //#endregion
603
+ export { I as t };
@@ -0,0 +1,17 @@
1
+ import { c as e, s as t } from "./Cj59E77g.mjs";
2
+ //#region src/components/form/props/common.ts
3
+ var n = {
4
+ ...e,
5
+ ...t,
6
+ wrapFormItem: {
7
+ type: Boolean,
8
+ default: !0
9
+ },
10
+ disabled: {
11
+ type: Boolean,
12
+ default: void 0
13
+ },
14
+ col: Boolean
15
+ }, r = { size: { type: String } };
16
+ //#endregion
17
+ export { n, r as t };
@@ -0,0 +1,93 @@
1
+ import { i as e, n as t } from "./Cj59E77g.mjs";
2
+ import { n, t as r } from "./CSyJ-vEx.mjs";
3
+ import { createVNode as i, mergeProps as a } from "vue";
4
+ import { ElTimeSelect as o } from "element-plus/es";
5
+ //#region src/components/form/props/time-select.ts
6
+ var s = {
7
+ ...n,
8
+ ...r,
9
+ modelValue: String,
10
+ disabled: {
11
+ type: Boolean,
12
+ default: !1
13
+ },
14
+ editable: {
15
+ type: Boolean,
16
+ default: !0
17
+ },
18
+ clearable: {
19
+ type: Boolean,
20
+ default: !0
21
+ },
22
+ includeEndTime: {
23
+ type: Boolean,
24
+ default: !1
25
+ },
26
+ size: {
27
+ type: String,
28
+ default: "default"
29
+ },
30
+ placeholder: String,
31
+ name: String,
32
+ effect: {
33
+ type: String,
34
+ default: "light"
35
+ },
36
+ prefixIcon: [String, Object],
37
+ clearIcon: [String, Object],
38
+ start: {
39
+ type: String,
40
+ default: "09:00"
41
+ },
42
+ end: {
43
+ type: String,
44
+ default: "18:00"
45
+ },
46
+ step: {
47
+ type: String,
48
+ default: "00:30"
49
+ },
50
+ minTime: String,
51
+ maxTime: String,
52
+ format: {
53
+ type: String,
54
+ default: "HH:mm"
55
+ },
56
+ emptyValues: Array,
57
+ valueOnClear: [
58
+ String,
59
+ Number,
60
+ Boolean,
61
+ Function
62
+ ],
63
+ popperClass: {
64
+ type: String,
65
+ default: ""
66
+ },
67
+ popperStyle: [String, Object]
68
+ }, c = {
69
+ disabled: !0,
70
+ modelValue: !0
71
+ }, l = (e) => n[e] === void 0 && c[e] !== !0, u = {
72
+ name: "FormTimeSelect",
73
+ inheritAttrs: !1,
74
+ props: { ...s },
75
+ emits: { ...t },
76
+ setup(t, { emit: n, slots: r, attrs: s }) {
77
+ let { emitInput: c, render: u, placeholder: d, disabled: f, listeners: p, inputProps: m } = e(t, {
78
+ emit: n,
79
+ slots: r,
80
+ attrs: s,
81
+ predicate: l
82
+ });
83
+ return () => u({ vNodes: i(o, a(p.value, m.value, {
84
+ style: "width: 100%",
85
+ modelValue: t.modelValue,
86
+ disabled: f.value,
87
+ "onUpdate:modelValue": c,
88
+ placeholder: d.value
89
+ }), null) });
90
+ }
91
+ };
92
+ //#endregion
93
+ export { u as t };