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

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