@web-utils/form-ui 1.0.0-beta50 → 1.0.0-beta52

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