@web-utils/form-ui 1.0.0-beta3 → 1.0.0-beta31

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 (176) 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 -1
  6. package/chunks/4ZuVpQf6.mjs +478 -0
  7. package/chunks/B99alfW4.mjs +207 -0
  8. package/chunks/BQ77eAb3.mjs +71 -0
  9. package/chunks/BV_N8p9t.mjs +83 -0
  10. package/chunks/BV_P9a8o.mjs +100 -0
  11. package/chunks/BgDYHgyH.mjs +189 -0
  12. package/chunks/Bm5eiSmT.mjs +79 -0
  13. package/chunks/BmZieBZW.mjs +88 -0
  14. package/chunks/Br4i8stg.mjs +222 -0
  15. package/chunks/C3a15Ful.mjs +95 -0
  16. package/chunks/C44-CFi-.mjs +636 -0
  17. package/chunks/C4bM8miy.mjs +174 -0
  18. package/chunks/C9J3j0PX.mjs +93 -0
  19. package/chunks/Cby3mvvZ.mjs +216 -0
  20. package/chunks/Cc3EJjbV.mjs +25 -0
  21. package/chunks/Cgl-hCE5.mjs +25 -0
  22. package/chunks/Ci1XxmdE.mjs +51 -0
  23. package/chunks/CkFapoKt.mjs +8 -0
  24. package/chunks/CsfgUCe9.mjs +17 -0
  25. package/chunks/CugRu2Ka.mjs +42 -0
  26. package/chunks/Cy-4nmyC.mjs +106 -0
  27. package/chunks/D1EOkWJ7.mjs +25 -0
  28. package/chunks/D1G2MMMx.mjs +1360 -0
  29. package/chunks/DO8dVGef.mjs +98 -0
  30. package/chunks/DazglPJZ.mjs +180 -0
  31. package/chunks/Dt6gY213.mjs +62 -0
  32. package/chunks/DtAYXPvz.mjs +108 -0
  33. package/chunks/JhyiXnbd.mjs +76 -0
  34. package/chunks/S64sNmuR.mjs +226 -0
  35. package/chunks/bnRb5PUB.mjs +108 -0
  36. package/chunks/dM-icPM8.mjs +107 -0
  37. package/chunks/pxFLMMUm.mjs +110 -0
  38. package/chunks/q1SlJP1y.mjs +171 -0
  39. package/confirm-button/index.d.ts +113 -0
  40. package/confirm-button/index.mjs +35 -0
  41. package/confirmable/index.d.ts +84 -0
  42. package/confirmable/index.mjs +8 -0
  43. package/constants/index.d.ts +42 -0
  44. package/constants/index.mjs +4 -0
  45. package/dict-render/index.d.ts +28 -0
  46. package/element-dialog/index.d.ts +374 -0
  47. package/element-dialog/index.mjs +2 -91
  48. package/empty-view/index.d.ts +29 -0
  49. package/empty-view/index.mjs +1 -1
  50. package/flex-scroll-area/index.d.ts +22 -0
  51. package/flex-scroll-area/index.mjs +1 -1
  52. package/form-advice/index.d.ts +9 -0
  53. package/form-advice/index.mjs +13 -12
  54. package/form-button/index.d.ts +114 -0
  55. package/form-button/index.mjs +36 -0
  56. package/form-cascader/index.d.ts +486 -0
  57. package/form-cascader/index.mjs +2 -0
  58. package/form-cell/index.d.ts +25 -0
  59. package/form-check-box-group/index.d.ts +295 -0
  60. package/form-check-box-group/index.mjs +1 -1
  61. package/form-checkbox/index.d.ts +273 -0
  62. package/form-checkbox/index.mjs +1 -1
  63. package/form-date-picker/index.d.ts +423 -0
  64. package/form-date-picker/index.mjs +1 -1
  65. package/form-holder/index.d.ts +166 -0
  66. package/form-holder/index.mjs +1 -1
  67. package/form-holder/style.css +1 -1
  68. package/form-image/index.d.ts +226 -0
  69. package/form-image/index.mjs +1 -1
  70. package/form-input/index.d.ts +389 -0
  71. package/form-input/index.mjs +1 -1
  72. package/form-input/style.css +1 -0
  73. package/form-input-cron-expression/index.d.ts +217 -0
  74. package/form-input-cron-expression/index.mjs +2 -0
  75. package/form-input-cron-expression/style.css +1 -0
  76. package/form-input-email/index.d.ts +363 -0
  77. package/form-input-email/index.mjs +1 -1
  78. package/form-input-id-card/index.d.ts +363 -0
  79. package/form-input-id-card/index.mjs +1 -1
  80. package/form-input-number/index.d.ts +327 -0
  81. package/form-input-number/index.mjs +1 -1
  82. package/form-input-phone-number/index.d.ts +363 -0
  83. package/form-input-phone-number/index.mjs +1 -1
  84. package/form-input-tag/index.d.ts +2 -0
  85. package/form-input-time/index.d.ts +2 -0
  86. package/form-item-config-provider/index.d.ts +22 -0
  87. package/form-item-config-provider/index.mjs +24 -0
  88. package/form-item-group/index.d.ts +94 -0
  89. package/form-item-group/index.mjs +2 -78
  90. package/form-item-group/style.css +1 -1
  91. package/form-item-x/index.d.ts +184 -0
  92. package/form-item-x/index.mjs +1 -1
  93. package/form-item-x/style.css +1 -0
  94. package/form-radio-group/index.d.ts +283 -0
  95. package/form-radio-group/index.mjs +1 -1
  96. package/form-rate/index.d.ts +321 -0
  97. package/form-rate/index.mjs +1 -1
  98. package/form-red-table/index.d.ts +21 -0
  99. package/form-red-table/index.mjs +27 -26
  100. package/form-row/index.d.ts +11 -0
  101. package/form-row/index.mjs +1 -1
  102. package/form-select/index.d.ts +542 -0
  103. package/form-select/index.mjs +1 -1
  104. package/form-slider/index.d.ts +350 -0
  105. package/form-slider/index.mjs +1 -1
  106. package/form-switch/index.d.ts +339 -0
  107. package/form-switch/index.mjs +1 -1
  108. package/form-text/index.d.ts +229 -0
  109. package/form-text/index.mjs +1 -1
  110. package/form-view/index.d.ts +2 -0
  111. package/form-view/index.mjs +1 -1
  112. package/helper/dictionary.d.ts +15 -0
  113. package/helper/dictionary.mjs +97 -0
  114. package/hook/useDictionary.d.ts +60 -0
  115. package/hook/useDictionary.mjs +15 -0
  116. package/hook/useVisibilityChange.d.ts +4 -0
  117. package/hook/useVisibilityChange.mjs +14 -0
  118. package/iframe-window/index.d.ts +9 -0
  119. package/iframe-window/index.mjs +37 -0
  120. package/iframe-window/style.css +1 -0
  121. package/index.d.ts +51 -0
  122. package/index.mjs +51 -37
  123. package/month-calendar/index.d.ts +80 -0
  124. package/package.json +12 -7
  125. package/pageable-table/index.d.ts +436 -0
  126. package/pageable-table/index.mjs +2 -0
  127. package/pageable-table/style.css +1 -0
  128. package/resize-observer/index.d.ts +8 -0
  129. package/resize-observer/index.mjs +40 -0
  130. package/resize-observer/style.css +1 -0
  131. package/resolver/index.d.ts +9 -0
  132. package/resolver/index.mjs +29 -0
  133. package/table-column/index.d.ts +160 -0
  134. package/table-column/index.mjs +2 -0
  135. package/table-column/style.css +1 -0
  136. package/table-column-def/index.d.ts +85 -0
  137. package/table-column-def/index.mjs +11 -0
  138. package/table-column-filter/index.d.ts +11 -0
  139. package/table-column-filterable/index.d.ts +10 -0
  140. package/table-view/index.d.ts +2 -0
  141. package/table-view/index.mjs +1 -1
  142. package/toolbar/index.d.ts +129 -0
  143. package/toolbar/index.mjs +1 -8
  144. package/toolbar/style.css +1 -0
  145. package/toolbar-button/index.d.ts +77 -0
  146. package/toolbar-button/index.mjs +1 -8
  147. package/vue-cron/index.d.ts +191 -0
  148. package/vue-cron/index.mjs +2 -0
  149. package/vue-cron/style.css +1 -0
  150. package/web-types.json +1 -1
  151. package/x-input-tag/index.d.ts +2 -0
  152. package/x-input-tag/index.mjs +226 -0
  153. package/x-input-tag/style.css +1 -0
  154. package/year-calendar/index.d.ts +99 -0
  155. package/year-calendar/index.mjs +2 -0
  156. package/year-calendar/style.css +1 -0
  157. package/chunks/B4M_TFeR.mjs +0 -152
  158. package/chunks/B5BIQCcK.mjs +0 -149
  159. package/chunks/BHNKrW1j.mjs +0 -61
  160. package/chunks/BO9jWhBl.mjs +0 -46
  161. package/chunks/BZ8aOa78.mjs +0 -35
  162. package/chunks/Bsz7y4Xp.mjs +0 -73
  163. package/chunks/Bxj372sF.mjs +0 -53
  164. package/chunks/C33EmJN8.mjs +0 -32
  165. package/chunks/C6Li3-l7.mjs +0 -28
  166. package/chunks/CBcdalMX.mjs +0 -35
  167. package/chunks/CdRsyF0n.mjs +0 -43
  168. package/chunks/ClNahmiU.mjs +0 -23
  169. package/chunks/CstztYMu.mjs +0 -28
  170. package/chunks/DC9b53M6.mjs +0 -32
  171. package/chunks/DDVAgRED.mjs +0 -36
  172. package/chunks/DpJQABVD.mjs +0 -91
  173. package/chunks/ZsLNWI9x.mjs +0 -46
  174. package/chunks/jn_iQrVZ.mjs +0 -28
  175. package/constants.mjs +0 -4
  176. package/input/style.css +0 -1
@@ -0,0 +1,636 @@
1
+ import { s as e, t } from "./BQ77eAb3.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 "./BV_P9a8o.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, defineComponent as p, inject as m, mergeModels as h, mergeProps as g, nextTick as ee, onBeforeUpdate as _, onUpdated as te, openBlock as v, provide as y, reactive as b, ref as x, toDisplayString as S, useModel as C, watch as w, withCtx as T } from "vue";
9
+ import { ElMessage as ne } from "element-plus";
10
+ import { ElButton as re, ElCheckbox as E, ElDrawer as D, ElEmpty as O, ElPagination as k, ElRadio as A, ElTable as j, ElTableColumn as M } from "element-plus/es";
11
+ import { useEventBus as ie } from "@web-utils/vue/hooks/useEventBus";
12
+ //#region src/components/table/components/TableColumnFilter.vue
13
+ var ae = {
14
+ __name: "TableColumnFilter",
15
+ props: /* @__PURE__ */ h({ 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 = C(e, "modelValue"), r = b({}), i = b({}), a = b({}), o = b({}), 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 = M, a = E, o = j, c = D;
37
+ return v(), 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: T(() => [f(o, {
45
+ data: e.columns,
46
+ border: ""
47
+ }, {
48
+ default: T(() => [
49
+ f(i, { label: "列名" }, {
50
+ default: T(({ row: e }) => [d(S(e.label), 1)]),
51
+ _: 1
52
+ }),
53
+ f(i, {
54
+ label: "隐藏",
55
+ align: "center"
56
+ }, {
57
+ default: T(({ 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: T(({ 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: T(({ 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: T(({ 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
+ }, oe = {
97
+ props: {
98
+ filterable: Boolean,
99
+ prop: String
100
+ },
101
+ setup(e, { attrs: t, slots: n }) {
102
+ let i = m(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, g(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 }, se = [
293
+ "change",
294
+ "expand-change",
295
+ "blur",
296
+ "focus",
297
+ "clear",
298
+ "visible-change",
299
+ "remove-tag"
300
+ ], ce = (e) => P[e] !== !0;
301
+ //#endregion
302
+ //#region src/components/table/PageableTable.vue?vue&type=script&lang.jsx
303
+ function F(e) {
304
+ let t = "";
305
+ for (let n in e) t += `<TableColumn prop="${n}" label="${n}"/>\n`;
306
+ return t;
307
+ }
308
+ var I = {
309
+ loading: 1,
310
+ error: -1,
311
+ empty: 2,
312
+ success: 0
313
+ }, L = /* @__PURE__ */ p({
314
+ name: "PageableTable",
315
+ emits: {
316
+ "page-loaded": null,
317
+ select: null,
318
+ "select-all": null,
319
+ "selection-change": null,
320
+ "cell-mouse-enter": null,
321
+ "cell-mouse-leave": null,
322
+ "cell-click": null,
323
+ "cell-dblclick": null,
324
+ "cell-contextmenu": null,
325
+ "row-click": null,
326
+ "row-contextmenu": null,
327
+ "row-dblclick": null,
328
+ "header-click": null,
329
+ "header-contextmenu": null,
330
+ "sort-change": null,
331
+ "filter-change": null,
332
+ "current-change": null,
333
+ "header-dragend": null,
334
+ "expand-change": null,
335
+ scroll: null
336
+ },
337
+ inheritAttrs: !1,
338
+ props: { ...N },
339
+ setup(a, { emit: u, attrs: p, slots: m, expose: h }) {
340
+ let v = x(), b = x(), S = x(1), C = x(I.empty), T = x([]), E = x(null), D = x(!1), N = x([]), P = x({
341
+ total: 0,
342
+ page: 1,
343
+ limit: a.pageSize,
344
+ ascs: a.ascs,
345
+ descs: a.descs
346
+ }), L = x(0), R = x(0), z = l(() => a.reloadOnModelChange ? {
347
+ asc: P.value.ascs,
348
+ desc: P.value.descs,
349
+ page: P.value.page,
350
+ limit: P.value.limit,
351
+ model: a.model
352
+ } : {
353
+ asc: P.value.ascs,
354
+ desc: P.value.descs,
355
+ page: P.value.page,
356
+ limit: P.value.limit
357
+ }), B = l(() => {
358
+ var e;
359
+ let t = `${(P.value.page - 1) * P.value.limit + (((e = T.value) == null ? void 0 : e.length) ?? 0)}`;
360
+ return t.length > 3 ? 60 + (t.length - 3) * 10 : 60;
361
+ }), V = (...e) => {
362
+ U(), u("row-dblclick", ...e);
363
+ }, H = (e, t, n) => {
364
+ if (a.clickRowSelect && $(e)) {
365
+ var r;
366
+ if (N.value.find((t) => t[a.rowKey] === e[a.rowKey])) {
367
+ var i;
368
+ (i = v.value) == null || i.toggleRowSelection(e, !1);
369
+ return;
370
+ }
371
+ (r = v.value) == null || r.toggleRowSelection(e);
372
+ }
373
+ }, U = () => {
374
+ var e, t;
375
+ let n = (e = v.value) == null || (e = e.$children) == null ? void 0 : e.find((e) => {
376
+ var t;
377
+ return ((t = e.$options) == null ? void 0 : t.name) === "ElTableBody";
378
+ });
379
+ n == null || (t = n.$refs) == null || (t = t.tooltip) == null || t.hide();
380
+ }, W = ({ scrollLeft: e, scrollTop: t }) => {
381
+ L.value = t, R.value = e;
382
+ }, le = () => {
383
+ me(L.value, R.value);
384
+ }, ue = (e) => t(F(e)), de = ({ prop: e, order: t }) => {
385
+ a.payloadStyle === "body" ? (P.value.ascs = t === "ascending" ? [e] : a.ascs, P.value.descs = t === "descending" ? [e] : a.descs) : (P.value.ascs = t === "ascending" ? e : "", P.value.descs = t === "descending" ? e : "");
386
+ }, fe = (e) => {
387
+ $(e) && (E.value = e);
388
+ }, pe = (e) => {
389
+ N.value = e, u("selection-change", e);
390
+ }, G = () => {
391
+ var e;
392
+ (e = v.value) == null || e.clearSelection();
393
+ }, K = () => {
394
+ let e;
395
+ return e = a.payloadStyle === "body" ? {
396
+ page: {
397
+ ...P.value,
398
+ current: P.value.page,
399
+ size: P.value.limit
400
+ },
401
+ example: a.model || {}
402
+ } : {
403
+ ...P.value,
404
+ current: P.value.page,
405
+ size: P.value.limit,
406
+ ...a.model || {}
407
+ }, a.selectExport && (a.rowKey ? e.exportKeys = N.value.map((e) => e[a.rowKey]) : e.exportKeys = N.value.map((e) => T.value.indexOf(e))), e;
408
+ }, q = async (e = !0) => {
409
+ if (s(p, "data") && p.data !== !1) {
410
+ var t;
411
+ T.value = p.data, P.value.page = 1, P.value.total = (t = T.value) == null ? void 0 : t.length, P.value.limit = P.value.total;
412
+ return;
413
+ }
414
+ e !== !1 && (T.value = []);
415
+ let n, r = K();
416
+ if (a.api) {
417
+ e !== !1 && (C.value = I.loading);
418
+ try {
419
+ a.api && (n = await a.api(r));
420
+ } catch {
421
+ C.value = I.error;
422
+ return;
423
+ }
424
+ } else if (a.data) n = { data: { data: {
425
+ total: a.data.length,
426
+ records: a.data
427
+ } } };
428
+ else {
429
+ ne.warning({
430
+ title: "开发提示!",
431
+ message: "PageableTable api(Function) 属性"
432
+ });
433
+ return;
434
+ }
435
+ let { data: { data: i } = {} } = n || {}, { total: o, records: c } = i || {};
436
+ P.value.total = Number(o), T.value = await he(c), !c || !c.length ? C.value = I.empty : C.value = I.success, J(), u("page-loaded", i);
437
+ }, J = () => {
438
+ ee(() => {
439
+ var e;
440
+ (e = v.value) == null || e.doLayout();
441
+ });
442
+ }, Y = async (e) => {
443
+ await q(e);
444
+ }, X = () => {
445
+ P.value = {
446
+ total: 0,
447
+ page: 1,
448
+ limit: a.pageSize,
449
+ ascs: a.ascs,
450
+ descs: a.descs
451
+ };
452
+ }, me = (e, t) => {
453
+ v.value.setScrollTop(e), v.value.setScrollLeft(t);
454
+ }, Z = (e, t) => {
455
+ var n;
456
+ (n = v.value) == null || n.toggleRowSelection(e, t);
457
+ }, he = async (e) => {
458
+ if (!e) return [];
459
+ let t = [...e];
460
+ for (let e of t) for (let t of a.dicOptions) if (e[`$${t.prop}`] = e[t.prop], t.dicData) {
461
+ var r;
462
+ e[t.prop] = ((r = t.dicData.find((n) => n.modelValue === e[t.prop])) == null ? void 0 : r.label) || e[t.prop];
463
+ } else e[t.prop] = await n(t.dicType, e[t.prop]);
464
+ return t;
465
+ }, Q = () => {
466
+ D.value = !D.value;
467
+ }, $ = (e) => {
468
+ var t;
469
+ return !(e != null && e.disabled) && !((t = a.disabledRowKeys) != null && t.includes(e == null ? void 0 : e[a.rowKey]));
470
+ };
471
+ a.useVisibilityChange && o({ onPageVisible: () => {
472
+ Y(!1);
473
+ } }), ie("reloadTableView", (e) => {
474
+ e === a.viewId && q();
475
+ }), w(() => a.url, X), w(() => a.api, X), w(() => p.data, q), w(() => z.value, q, {
476
+ deep: !0,
477
+ immediate: a.immediate
478
+ }), te(() => {
479
+ le();
480
+ }), _(() => {
481
+ S.value++;
482
+ }), h({
483
+ records: T,
484
+ getPage: q,
485
+ refresh: Y,
486
+ reload: X,
487
+ doLayout: J,
488
+ clearSelection: G,
489
+ toggleRowSelection: Z,
490
+ toggleSettings: Q
491
+ }), y(r, {
492
+ records: T,
493
+ getPage: q,
494
+ refresh: Y,
495
+ reload: X,
496
+ doLayout: J,
497
+ clearSelection: G,
498
+ toggleRowSelection: Z,
499
+ toggleSettings: Q
500
+ });
501
+ let ge = e(a, {
502
+ emit: u,
503
+ events: se,
504
+ predicate: ce
505
+ });
506
+ return () => {
507
+ var e;
508
+ let t = E.value && E.value[p["row-key"] || a.rowKey || "id"] === (E.value && a.rowKey ? E.value[a.rowKey] : (e = E.value) == null ? void 0 : e.id), n = [];
509
+ if (m.default) {
510
+ var r;
511
+ let e = (r = m.default) == null ? void 0 : r.call(m);
512
+ (e.length === 1 ? e[0].children : e).forEach(({ props: e, children: t }) => {
513
+ if (e) {
514
+ var r, i, a, o;
515
+ n.push({
516
+ ...e,
517
+ allowSort: e.sortable !== !1,
518
+ hide: (r = b.value) == null ? void 0 : r.hideProps[e.prop],
519
+ filterable: (i = b.value) == null ? void 0 : i.filterableProps[e.prop],
520
+ sortable: ((a = b.value) == null ? void 0 : a.sortableProps[e.prop]) === !0,
521
+ fixed: e.fixed || ((o = b.value) == null ? void 0 : o.fixedProps[e.prop]),
522
+ header: t == null ? void 0 : t.header,
523
+ default: t == null ? void 0 : t.default
524
+ });
525
+ }
526
+ });
527
+ } else a.columns && a.columns.forEach((e) => {
528
+ var t, r, i, a;
529
+ n.push({
530
+ ...e,
531
+ allowSort: e.sortable !== !1,
532
+ hide: (t = b.value) == null ? void 0 : t.hideProps[e.prop],
533
+ filterable: (r = b.value) == null ? void 0 : r.filterableProps[e.prop],
534
+ sortable: ((i = b.value) == null ? void 0 : i.sortableProps[e.prop]) === !0,
535
+ fixed: e.fixed || ((a = b.value) == null ? void 0 : a.fixedProps[e.prop])
536
+ });
537
+ });
538
+ return f("div", { class: ["pageable-table", { "auto-height": a.autoHeight }] }, [f("div", { class: "pageable-table-wrapper" }, [
539
+ m.toolbar && m.toolbar({ selectedRows: N.value }),
540
+ f(j, g(ge.value, {
541
+ ref: v,
542
+ data: T.value,
543
+ class: ["flex-item", { "header-bold": a.headerBold }],
544
+ border: a.border,
545
+ stripe: !0,
546
+ size: "default",
547
+ height: a.autoHeight ? null : "auto",
548
+ onScroll: W,
549
+ onSortChange: de,
550
+ onRowDblclick: V,
551
+ onRowClick: H,
552
+ onCellClick: U,
553
+ onCurrentChange: fe,
554
+ onSelectionChange: pe
555
+ }), {
556
+ default: () => {
557
+ let e = [];
558
+ if (a.multiple && a.selection && e.push(f(M, {
559
+ type: "selection",
560
+ selectable: $,
561
+ width: a.selectionWidth,
562
+ align: "center"
563
+ }, null)), !a.multiple && a.selection && e.push(f(M, {
564
+ type: "single-selection",
565
+ "class-name": "single-select-column",
566
+ width: a.selectionWidth,
567
+ align: "center"
568
+ }, {
569
+ header: () => f(A, {
570
+ modelValue: !!E.value,
571
+ label: !0
572
+ }, { default: () => [f("span", null, null)] }),
573
+ default: ({ row: e }) => f(A, {
574
+ label: !0,
575
+ disabled: !$(e),
576
+ modelValue: t
577
+ }, { default: () => [f("span", null, null)] })
578
+ })), a.index && e.push(f(M, {
579
+ type: "index",
580
+ label: "序号",
581
+ width: B.value,
582
+ align: "center"
583
+ }, { default: ({ $index: e }) => (P.value.page - 1) * P.value.limit + e + 1 || e + 1 })), n.length > 0) for (let t = 0; t < n.length; t++) {
584
+ let r = n[t];
585
+ if (r.hide) continue;
586
+ let i = r.prop;
587
+ e.push(f(oe, r, { default: m[i] ? ({ row: e }) => m[i]({ row: e }) : void 0 }));
588
+ }
589
+ else e.push(f(M, { label: "点击表格行复制模板" }, { default: ({ row: e }) => f("pre", {
590
+ class: "pointer",
591
+ onClick: () => ue(e)
592
+ }, [JSON.stringify(e, null, " ")]) }));
593
+ return e;
594
+ },
595
+ empty: () => m.empty ? m.empty() : f(c, null, [
596
+ C.value === I.loading && f("span", { class: "pageable-table-loading" }, [f("i", { class: "table-status-icon el-icon-loading" }, null), d("加载中...")]),
597
+ C.value === I.error && f(re, {
598
+ class: "pageable-table-error",
599
+ onClick: Y
600
+ }, { default: () => [f("i", { class: "table-status-icon el-icon-error" }, null), d("加载失败,点击重试!")] }),
601
+ C.value !== I.loading && C.value !== I.error && f(O, null, null)
602
+ ]),
603
+ append: m.append
604
+ }),
605
+ a.paging && f(k, {
606
+ "current-page": P.value.page,
607
+ "onUpdate:current-page": (e) => P.value.page = e,
608
+ "hide-on-single-page": a.hideOnSinglePage,
609
+ "page-size": P.value.limit,
610
+ "onUpdate:page-size": (e) => P.value.limit = e,
611
+ total: P.value.total,
612
+ "page-sizes": [
613
+ 10,
614
+ 25,
615
+ 50,
616
+ 100,
617
+ 500,
618
+ 1e3,
619
+ 2e3
620
+ ],
621
+ class: "flex-not-shrink",
622
+ background: !0,
623
+ layout: "total, sizes, prev, pager, next, jumper"
624
+ }, null),
625
+ f(ae, {
626
+ ref: b,
627
+ modelValue: D.value,
628
+ "onUpdate:modelValue": (e) => D.value = e,
629
+ columns: n
630
+ }, null)
631
+ ]), f(i, { onNotify: J }, null)]);
632
+ };
633
+ }
634
+ });
635
+ //#endregion
636
+ export { L as t };