vue-devui 1.0.0-rc.2 → 1.0.0-rc.5

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 (174) hide show
  1. package/README.md +9 -0
  2. package/auto-complete/index.es.js +132 -58
  3. package/auto-complete/index.umd.js +5 -3
  4. package/auto-complete/style.css +1 -1
  5. package/avatar/index.es.js +77 -81
  6. package/avatar/index.umd.js +1 -1
  7. package/button/index.es.js +23 -15
  8. package/button/index.umd.js +1 -1
  9. package/button/style.css +1 -1
  10. package/card/index.es.js +3 -6
  11. package/card/index.umd.js +1 -1
  12. package/checkbox/index.es.js +5 -11
  13. package/checkbox/index.umd.js +1 -1
  14. package/comment/index.es.js +4 -6
  15. package/comment/index.umd.js +1 -1
  16. package/countdown/index.es.js +3 -6
  17. package/countdown/index.umd.js +1 -1
  18. package/{tag-input → date-picker}/index.d.ts +0 -0
  19. package/date-picker/index.es.js +1151 -0
  20. package/date-picker/index.umd.js +1 -0
  21. package/date-picker/package.json +7 -0
  22. package/date-picker/style.css +1 -0
  23. package/drawer/index.d.ts +7 -0
  24. package/drawer/index.es.js +236 -0
  25. package/drawer/index.umd.js +1 -0
  26. package/{tag-input → drawer}/package.json +1 -1
  27. package/drawer/style.css +1 -0
  28. package/dropdown/index.d.ts +7 -0
  29. package/dropdown/index.es.js +716 -0
  30. package/dropdown/index.umd.js +1 -0
  31. package/dropdown/package.json +7 -0
  32. package/dropdown/style.css +1 -0
  33. package/editable-select/index.es.js +2 -5
  34. package/editable-select/index.umd.js +1 -1
  35. package/form/index.d.ts +7 -0
  36. package/form/index.es.js +7888 -0
  37. package/form/index.umd.js +27 -0
  38. package/form/package.json +7 -0
  39. package/form/style.css +1 -0
  40. package/grid/index.es.js +30 -36
  41. package/grid/index.umd.js +1 -1
  42. package/image-preview/index.es.js +19 -19
  43. package/image-preview/index.umd.js +1 -1
  44. package/input/index.es.js +2 -5
  45. package/input/index.umd.js +1 -1
  46. package/input-number/index.d.ts +7 -0
  47. package/input-number/index.es.js +229 -0
  48. package/input-number/index.umd.js +1 -0
  49. package/input-number/package.json +7 -0
  50. package/input-number/style.css +1 -0
  51. package/layout/index.es.js +9 -22
  52. package/layout/index.umd.js +1 -1
  53. package/loading/index.es.js +40 -25
  54. package/loading/index.umd.js +1 -1
  55. package/modal/index.es.js +70 -50
  56. package/modal/index.umd.js +1 -1
  57. package/notification/index.es.js +100 -10
  58. package/notification/index.umd.js +1 -1
  59. package/notification/style.css +1 -1
  60. package/nuxt/components/Column.js +3 -0
  61. package/nuxt/components/DatePicker.js +3 -0
  62. package/nuxt/components/Drawer.js +3 -0
  63. package/nuxt/components/DrawerService.js +3 -0
  64. package/nuxt/components/Dropdown.js +3 -0
  65. package/nuxt/components/DropdownMenu.js +3 -0
  66. package/nuxt/components/DropdownPropsKey.js +3 -0
  67. package/nuxt/components/Form.js +3 -0
  68. package/nuxt/components/FormControl.js +3 -0
  69. package/nuxt/components/FormItem.js +3 -0
  70. package/nuxt/components/FormLabel.js +3 -0
  71. package/nuxt/components/FormOperation.js +3 -0
  72. package/nuxt/components/InputNumber.js +3 -0
  73. package/nuxt/components/LoadingOptions.js +3 -0
  74. package/nuxt/components/Select.js +3 -0
  75. package/nuxt/components/StickSlider.js +3 -0
  76. package/nuxt/components/Tab.js +3 -0
  77. package/nuxt/components/Table.js +3 -0
  78. package/nuxt/components/Tabs.js +3 -0
  79. package/nuxt/components/Tooltip.js +3 -0
  80. package/nuxt/components/autoCompleteProps.js +3 -0
  81. package/nuxt/components/avatarProps.js +3 -0
  82. package/nuxt/components/cardProps.js +3 -0
  83. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  84. package/nuxt/components/checkboxGroupProps.js +3 -0
  85. package/nuxt/components/checkboxProps.js +3 -0
  86. package/nuxt/components/colProps.js +3 -0
  87. package/nuxt/components/colPropsBaseClass.js +3 -0
  88. package/nuxt/components/colPropsBaseStyle.js +3 -0
  89. package/nuxt/components/commentProps.js +3 -0
  90. package/nuxt/components/countdownProps.js +3 -0
  91. package/nuxt/components/dropdownMenuProps.js +3 -0
  92. package/nuxt/components/editableSelectProps.js +3 -0
  93. package/nuxt/components/imagePreviewProps.js +3 -0
  94. package/nuxt/components/inputProps.js +3 -0
  95. package/nuxt/components/loadingProps.js +3 -0
  96. package/nuxt/components/modalProps.js +3 -0
  97. package/nuxt/components/progressProps.js +3 -0
  98. package/nuxt/components/rateProps.js +3 -0
  99. package/nuxt/components/readTipProps.js +3 -0
  100. package/nuxt/components/resultProps.js +3 -0
  101. package/nuxt/components/rowProps.js +3 -0
  102. package/nuxt/components/screenSizes.js +3 -0
  103. package/nuxt/components/skeletonProps.js +3 -0
  104. package/nuxt/components/sliderProps.js +3 -0
  105. package/nuxt/components/splitterProps.js +3 -0
  106. package/nuxt/components/statisticProps.js +3 -0
  107. package/nuxt/components/switchProps.js +3 -0
  108. package/nuxt/components/tabsProps.js +3 -0
  109. package/nuxt/components/textareaProps.js +3 -0
  110. package/nuxt/components/timeAxisProps.js +3 -0
  111. package/nuxt/components/tooltipProps.js +3 -0
  112. package/overlay/index.es.js +20 -8
  113. package/overlay/index.umd.js +1 -1
  114. package/package.json +2 -2
  115. package/pagination/index.es.js +14 -13
  116. package/pagination/index.umd.js +1 -1
  117. package/popover/index.es.js +20 -8
  118. package/popover/index.umd.js +12 -12
  119. package/progress/index.es.js +33 -35
  120. package/progress/index.umd.js +3 -3
  121. package/rate/index.es.js +31 -41
  122. package/rate/index.umd.js +1 -1
  123. package/read-tip/index.es.js +34 -34
  124. package/read-tip/index.umd.js +1 -1
  125. package/read-tip/style.css +1 -1
  126. package/result/index.es.js +2 -5
  127. package/result/index.umd.js +1 -1
  128. package/search/index.es.js +11 -11
  129. package/search/index.umd.js +8 -8
  130. package/select/index.d.ts +7 -0
  131. package/select/index.es.js +696 -0
  132. package/select/index.umd.js +1 -0
  133. package/select/package.json +7 -0
  134. package/select/style.css +1 -0
  135. package/skeleton/index.es.js +9 -12
  136. package/skeleton/index.umd.js +1 -1
  137. package/slider/index.es.js +1 -4
  138. package/slider/index.umd.js +1 -1
  139. package/splitter/index.es.js +23 -14
  140. package/splitter/index.umd.js +15 -15
  141. package/statistic/index.es.js +7 -18
  142. package/statistic/index.umd.js +1 -1
  143. package/style.css +1 -1
  144. package/switch/index.es.js +4 -7
  145. package/switch/index.umd.js +1 -1
  146. package/switch/style.css +1 -1
  147. package/table/index.d.ts +7 -0
  148. package/table/index.es.js +2376 -0
  149. package/table/index.umd.js +1 -0
  150. package/table/package.json +7 -0
  151. package/table/style.css +1 -0
  152. package/tabs/index.d.ts +7 -0
  153. package/tabs/index.es.js +194 -0
  154. package/tabs/index.umd.js +1 -0
  155. package/tabs/package.json +7 -0
  156. package/tabs/style.css +1 -0
  157. package/textarea/index.es.js +2 -5
  158. package/textarea/index.umd.js +1 -1
  159. package/timeline/index.es.js +10 -16
  160. package/timeline/index.umd.js +1 -1
  161. package/tooltip/index.d.ts +7 -0
  162. package/tooltip/index.es.js +5847 -0
  163. package/tooltip/index.umd.js +27 -0
  164. package/tooltip/package.json +7 -0
  165. package/tooltip/style.css +1 -0
  166. package/upload/index.es.js +160 -67
  167. package/upload/index.umd.js +1 -1
  168. package/upload/style.css +1 -1
  169. package/vue-devui.es.js +16936 -24821
  170. package/vue-devui.umd.js +24 -22
  171. package/nuxt/components/TagInput.js +0 -3
  172. package/tag-input/index.es.js +0 -331
  173. package/tag-input/index.umd.js +0 -1
  174. package/tag-input/style.css +0 -1
@@ -0,0 +1,2376 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __publicField = (obj, key, value) => {
21
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ return value;
23
+ };
24
+ import { computed, ref, watch, unref, defineComponent, inject, createVNode, toRefs, onMounted, onUnmounted, Teleport, Transition, renderSlot, isVNode, nextTick, mergeProps, Fragment, withDirectives, vShow, toRef, provide, getCurrentInstance, shallowRef, h, render, createTextVNode, resolveDirective, reactive, onBeforeMount, onBeforeUnmount } from "vue";
25
+ import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
26
+ import { onClickOutside } from "@vueuse/core";
27
+ const TableProps = {
28
+ data: {
29
+ type: Array,
30
+ default: []
31
+ },
32
+ striped: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ scrollable: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ maxWidth: {
41
+ type: String
42
+ },
43
+ maxHeight: {
44
+ type: String
45
+ },
46
+ tableWidth: {
47
+ type: String
48
+ },
49
+ tableHeight: {
50
+ type: String
51
+ },
52
+ size: {
53
+ type: String,
54
+ validator(value) {
55
+ return value === "sm" || value === "md" || value === "lg";
56
+ },
57
+ default: "sm"
58
+ },
59
+ rowHoveredHighlight: {
60
+ type: Boolean,
61
+ default: true
62
+ },
63
+ fixHeader: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ checkable: {
68
+ type: Boolean,
69
+ default: false
70
+ },
71
+ tableLayout: {
72
+ type: String,
73
+ default: "fixed",
74
+ validator(v) {
75
+ return v === "fixed" || v === "auto";
76
+ }
77
+ },
78
+ showLoading: {
79
+ type: Boolean,
80
+ default: false
81
+ },
82
+ headerBg: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ spanMethod: {
87
+ type: Function
88
+ },
89
+ borderType: {
90
+ type: String,
91
+ default: ""
92
+ }
93
+ };
94
+ const TABLE_TOKEN = Symbol();
95
+ function createBem(namespace, element, modifier) {
96
+ let cls = namespace;
97
+ if (element) {
98
+ cls += `__${element}`;
99
+ }
100
+ if (modifier) {
101
+ cls += `--${modifier}`;
102
+ }
103
+ return cls;
104
+ }
105
+ function useNamespace(block) {
106
+ const namespace = `devui-${block}`;
107
+ const b = () => createBem(namespace);
108
+ const e = (element) => element ? createBem(namespace, element) : "";
109
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
110
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
111
+ return {
112
+ b,
113
+ e,
114
+ m,
115
+ em
116
+ };
117
+ }
118
+ function useTable(props) {
119
+ const ns = useNamespace("table");
120
+ const classes = computed(() => ({
121
+ [ns.e("view")]: true,
122
+ [ns.m("striped")]: props.striped,
123
+ [ns.m("header-bg")]: props.headerBg,
124
+ [ns.m("layout-auto")]: props.tableLayout === "auto",
125
+ [ns.m(`${props.size}`)]: true,
126
+ [ns.m(`${props.borderType}`)]: Boolean(props.borderType)
127
+ }));
128
+ const style = computed(() => ({
129
+ maxHeight: props.maxHeight,
130
+ maxWidth: props.maxWidth,
131
+ height: props.tableHeight,
132
+ width: props.tableWidth
133
+ }));
134
+ return { classes, style };
135
+ }
136
+ const useFixedColumn = (column) => {
137
+ const ns = useNamespace("table");
138
+ const stickyClass = computed(() => ({
139
+ [ns.e("checkable-cell")]: column.value.type === "checkable",
140
+ [ns.m("sticky-cell")]: Boolean(column.value.fixedLeft) || Boolean(column.value.fixedRight)
141
+ }));
142
+ const stickyStyle = computed(() => ({
143
+ left: column.value.fixedLeft,
144
+ right: column.value.fixedRight
145
+ }));
146
+ return { stickyClass, stickyStyle };
147
+ };
148
+ function replaceColumn(array, column) {
149
+ return array.map((item) => {
150
+ var _a;
151
+ if (item.id === column.id) {
152
+ return column;
153
+ } else if ((_a = item.children) == null ? void 0 : _a.length) {
154
+ item.children = replaceColumn(item.children, column);
155
+ }
156
+ return item;
157
+ });
158
+ }
159
+ function doFlattenColumns(columns) {
160
+ const result = [];
161
+ columns.forEach((column) => {
162
+ if (column.children) {
163
+ result.push.apply(result, doFlattenColumns(column.children));
164
+ } else {
165
+ result.push(column);
166
+ }
167
+ });
168
+ return result;
169
+ }
170
+ const createColumnGenerator = () => {
171
+ const _columns = ref([]);
172
+ const flatColumns = ref([]);
173
+ const sortColumn = () => {
174
+ _columns.value.sort((a, b) => a.order - b.order);
175
+ };
176
+ const insertColumn = (column, parent) => {
177
+ const array = unref(_columns);
178
+ let newColumns = [];
179
+ if (!parent) {
180
+ array.push(column);
181
+ newColumns = array;
182
+ } else {
183
+ if (parent && !parent.children) {
184
+ parent.children = [];
185
+ }
186
+ parent.children.push(column);
187
+ newColumns = replaceColumn(array, parent);
188
+ }
189
+ sortColumn();
190
+ _columns.value = newColumns;
191
+ };
192
+ const removeColumn = (column) => {
193
+ const i = _columns.value.findIndex((v) => v === column);
194
+ if (i === -1) {
195
+ return;
196
+ }
197
+ _columns.value.splice(i, 1);
198
+ };
199
+ const updateColumns = () => {
200
+ flatColumns.value = [].concat(doFlattenColumns(_columns.value));
201
+ };
202
+ return { _columns, flatColumns, insertColumn, removeColumn, sortColumn, updateColumns };
203
+ };
204
+ const createSelection = (dataSource, _data) => {
205
+ const _checkList = ref([]);
206
+ const _checkAllRecord = ref(false);
207
+ const _checkAll = computed({
208
+ get: () => _checkAllRecord.value,
209
+ set: (val) => {
210
+ _checkAllRecord.value = val;
211
+ for (let i = 0; i < _checkList.value.length; i++) {
212
+ _checkList.value[i] = val;
213
+ }
214
+ }
215
+ });
216
+ const _halfChecked = ref(false);
217
+ watch(dataSource, (value) => {
218
+ _checkList.value = new Array(value.length).fill(false);
219
+ }, { deep: true, immediate: true });
220
+ watch(_checkList, (list) => {
221
+ if (list.length === 0) {
222
+ return;
223
+ }
224
+ let allTrue = true;
225
+ let allFalse = true;
226
+ for (let i = 0; i < list.length; i++) {
227
+ allTrue && (allTrue = list[i]);
228
+ allFalse && (allFalse = !list[i]);
229
+ }
230
+ _checkAllRecord.value = allTrue;
231
+ _halfChecked.value = !(allFalse || allTrue);
232
+ }, { immediate: true, deep: true });
233
+ const getCheckedRows = () => {
234
+ return _data.value.filter((_, index2) => _checkList.value[index2]);
235
+ };
236
+ return {
237
+ _checkList,
238
+ _checkAll,
239
+ _halfChecked,
240
+ getCheckedRows
241
+ };
242
+ };
243
+ const createSorter = (dataSource, _data) => {
244
+ const sortData = (direction, sortMethod) => {
245
+ if (direction === "ASC") {
246
+ _data.value = _data.value.sort((a, b) => sortMethod ? sortMethod(a, b) ? 1 : -1 : 0);
247
+ } else if (direction === "DESC") {
248
+ _data.value = _data.value.sort((a, b) => sortMethod ? sortMethod(a, b) ? -1 : 1 : 0);
249
+ } else {
250
+ _data.value = [...dataSource.value];
251
+ }
252
+ };
253
+ const thList = [];
254
+ return { sortData, thList };
255
+ };
256
+ const createFilter = (dataSource, _data) => {
257
+ const fieldSet = /* @__PURE__ */ new Set();
258
+ const filterData = (field, results) => {
259
+ fieldSet.add(field);
260
+ const fields = [...fieldSet];
261
+ _data.value = dataSource.value.filter((item) => {
262
+ return fields.reduce((prev, fieldKey) => {
263
+ return prev && results.indexOf(item[fieldKey]) !== -1;
264
+ }, true);
265
+ });
266
+ };
267
+ const resetFilterData = () => {
268
+ fieldSet.clear();
269
+ _data.value = [...dataSource.value];
270
+ };
271
+ return { filterData, resetFilterData };
272
+ };
273
+ const createFixedLogic = (columns) => {
274
+ const isFixedLeft = computed(() => {
275
+ return columns.value.reduce((prev, current) => prev || !!current.fixedLeft, false);
276
+ });
277
+ return { isFixedLeft };
278
+ };
279
+ function createStore(dataSource) {
280
+ const _data = ref([]);
281
+ watch(dataSource, (value) => {
282
+ _data.value = [...value];
283
+ }, { deep: true, immediate: true });
284
+ const { _columns, flatColumns, insertColumn, removeColumn, sortColumn, updateColumns } = createColumnGenerator();
285
+ const { _checkAll, _checkList, _halfChecked, getCheckedRows } = createSelection(dataSource, _data);
286
+ const { sortData, thList } = createSorter(dataSource, _data);
287
+ const { filterData, resetFilterData } = createFilter(dataSource, _data);
288
+ const { isFixedLeft } = createFixedLogic(_columns);
289
+ return {
290
+ states: {
291
+ _data,
292
+ _columns,
293
+ flatColumns,
294
+ _checkList,
295
+ _checkAll,
296
+ _halfChecked,
297
+ isFixedLeft,
298
+ thList
299
+ },
300
+ insertColumn,
301
+ sortColumn,
302
+ removeColumn,
303
+ updateColumns,
304
+ getCheckedRows,
305
+ sortData,
306
+ filterData,
307
+ resetFilterData
308
+ };
309
+ }
310
+ var ColGroup = defineComponent({
311
+ name: "DColGroup",
312
+ setup() {
313
+ const parent = inject(TABLE_TOKEN);
314
+ const columns = parent == null ? void 0 : parent.store.states._columns;
315
+ return () => (parent == null ? void 0 : parent.props.fixHeader) ? createVNode("colgroup", null, [columns == null ? void 0 : columns.value.map((column, index2) => {
316
+ return createVNode("col", {
317
+ "key": index2,
318
+ "width": column.realWidth
319
+ }, null);
320
+ })]) : null;
321
+ }
322
+ });
323
+ const sortProps = {
324
+ sortDirection: {
325
+ type: String,
326
+ default: ""
327
+ }
328
+ };
329
+ var sort = "";
330
+ var Sort = defineComponent({
331
+ props: sortProps,
332
+ emits: ["sort"],
333
+ setup(props, ctx) {
334
+ const directionMap = {
335
+ ASC: "DESC",
336
+ DESC: "",
337
+ default: "ASC"
338
+ };
339
+ const changeDirection = () => {
340
+ ctx.emit("sort", directionMap[props.sortDirection || "default"]);
341
+ };
342
+ return () => createVNode("span", {
343
+ "onClick": changeDirection,
344
+ "class": "sort-clickable"
345
+ }, [createVNode("i", {
346
+ "class": ["datatable-svg", {
347
+ "sort-icon-default": !props.sortDirection,
348
+ "sort-icon-asc": props.sortDirection === "ASC",
349
+ "sort-icon-desc": props.sortDirection === "DESC"
350
+ }]
351
+ }, [createVNode("svg", {
352
+ "width": "16px",
353
+ "height": "16px",
354
+ "viewBox": "0 0 16 16",
355
+ "version": "1.1",
356
+ "xmlns": "http://www.w3.org/2000/svg"
357
+ }, [createVNode("defs", null, [createVNode("circle", {
358
+ "id": "sort-svg-path-1",
359
+ "cx": "8",
360
+ "cy": "8",
361
+ "r": "8"
362
+ }, null), createVNode("filter", {
363
+ "x": "-34.4%",
364
+ "y": "-21.9%",
365
+ "width": "168.8%",
366
+ "height": "168.8%",
367
+ "filterUnits": "objectBoundingBox",
368
+ "id": "filter-2"
369
+ }, [createVNode("feOffset", {
370
+ "dx": "0",
371
+ "dy": "2",
372
+ "in": "SourceAlpha",
373
+ "result": "shadowOffsetOuter1"
374
+ }, null), createVNode("feGaussianBlur", {
375
+ "stdDeviation": "1.5",
376
+ "in": "shadowOffsetOuter1",
377
+ "result": "shadowBlurOuter1"
378
+ }, null), createVNode("feColorMatrix", {
379
+ "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.085309222 0",
380
+ "type": "matrix",
381
+ "in": "shadowBlurOuter1"
382
+ }, null)])]), createVNode("g", {
383
+ "stroke": "none",
384
+ "stroke-width": "1",
385
+ "fill": "none",
386
+ "fill-rule": "evenodd"
387
+ }, [createVNode("use", {
388
+ "fill-rule": "evenodd",
389
+ "xlink:href": "#sort-svg-path-1"
390
+ }, null), createVNode("polygon", {
391
+ "points": "8 4 11 7 5 7"
392
+ }, null), createVNode("polygon", {
393
+ "points": "8 12 5 9 11 9"
394
+ }, null)])])])]);
395
+ }
396
+ });
397
+ const dropdownProps = {
398
+ visible: {
399
+ type: Boolean,
400
+ default: false
401
+ },
402
+ trigger: {
403
+ type: String,
404
+ default: "click"
405
+ },
406
+ closeScope: {
407
+ type: String,
408
+ default: "all"
409
+ },
410
+ position: {
411
+ type: Array,
412
+ default: ["bottom"]
413
+ },
414
+ align: {
415
+ type: String,
416
+ default: null
417
+ },
418
+ offset: {
419
+ type: [Number, Object],
420
+ default: 4
421
+ },
422
+ shiftOffset: {
423
+ type: Number
424
+ },
425
+ closeOnMouseLeaveMenu: {
426
+ type: Boolean,
427
+ default: false
428
+ },
429
+ showAnimation: {
430
+ type: Boolean,
431
+ default: true
432
+ },
433
+ overlayClass: {
434
+ type: String,
435
+ default: ""
436
+ },
437
+ destroyOnHide: {
438
+ type: Boolean,
439
+ default: true
440
+ }
441
+ };
442
+ function getElement(element) {
443
+ if (element instanceof Element) {
444
+ return element;
445
+ }
446
+ if (element && typeof element === "object" && element.$el instanceof Element) {
447
+ return element.$el;
448
+ }
449
+ return null;
450
+ }
451
+ const dropdownMap = /* @__PURE__ */ new Map();
452
+ function subscribeEvent(dom, type, callback) {
453
+ dom == null ? void 0 : dom.addEventListener(type, callback);
454
+ return () => {
455
+ dom == null ? void 0 : dom.removeEventListener(type, callback);
456
+ };
457
+ }
458
+ const useDropdownEvent = ({ id, isOpen, origin, dropdownRef, props, emit }) => {
459
+ let overlayEnter = false;
460
+ let originEnter = false;
461
+ const { trigger, closeScope, closeOnMouseLeaveMenu } = toRefs(props);
462
+ const toggle = (status) => {
463
+ isOpen.value = status;
464
+ emit("toggle", isOpen.value);
465
+ };
466
+ const handleLeave = async (elementType, closeAll) => {
467
+ await new Promise((resolve) => setTimeout(resolve, 50));
468
+ if (elementType === "origin" && overlayEnter || elementType === "dropdown" && originEnter) {
469
+ return;
470
+ }
471
+ if (closeAll) {
472
+ [...dropdownMap.values()].reverse().forEach((item) => {
473
+ setTimeout(() => {
474
+ var _a;
475
+ (_a = item.toggle) == null ? void 0 : _a.call(item);
476
+ }, 0);
477
+ });
478
+ }
479
+ toggle(false);
480
+ };
481
+ watch([trigger, origin, dropdownRef], ([triggerVal, originVal, dropdownEl], ov, onInvalidate) => {
482
+ const originEl = getElement(originVal);
483
+ const subscriptions = [];
484
+ setTimeout(() => {
485
+ subscriptions.push(subscribeEvent(document, "click", (e) => {
486
+ const dropdownValues = [...dropdownMap.values()];
487
+ if (!isOpen.value || closeScope.value === "none" || dropdownEl.contains(e.target) && closeScope.value === "blank" || dropdownValues.some((item) => {
488
+ var _a;
489
+ return (_a = item.toggleEl) == null ? void 0 : _a.contains(e.target);
490
+ }) && dropdownValues.some((item) => {
491
+ var _a;
492
+ return (_a = item.menuEl) == null ? void 0 : _a.contains(e.target);
493
+ })) {
494
+ return;
495
+ }
496
+ [...dropdownMap.values()].reverse().forEach((item) => {
497
+ setTimeout(() => {
498
+ var _a, _b;
499
+ if (!((_a = item.toggleEl) == null ? void 0 : _a.contains(e.target))) {
500
+ (_b = item.toggle) == null ? void 0 : _b.call(item);
501
+ }
502
+ }, 0);
503
+ });
504
+ overlayEnter = false;
505
+ }));
506
+ }, 0);
507
+ if (triggerVal === "click") {
508
+ subscriptions.push(subscribeEvent(originEl, "click", () => toggle(!isOpen.value)), subscribeEvent(dropdownEl, "mouseleave", (e) => {
509
+ var _a;
510
+ if (closeOnMouseLeaveMenu.value && !((_a = dropdownMap.get(id).child) == null ? void 0 : _a.contains(e.relatedTarget))) {
511
+ handleLeave("dropdown", true);
512
+ }
513
+ }));
514
+ } else if (triggerVal === "hover") {
515
+ subscriptions.push(subscribeEvent(originEl, "mouseenter", () => {
516
+ originEnter = true;
517
+ toggle(true);
518
+ }), subscribeEvent(originEl, "mouseleave", () => {
519
+ originEnter = false;
520
+ handleLeave("origin");
521
+ }), subscribeEvent(dropdownEl, "mouseenter", () => {
522
+ overlayEnter = true;
523
+ isOpen.value = true;
524
+ }), subscribeEvent(dropdownEl, "mouseleave", (e) => {
525
+ var _a;
526
+ overlayEnter = false;
527
+ if (e.relatedTarget && ((originEl == null ? void 0 : originEl.contains(e.relatedTarget)) || ((_a = dropdownMap.get(id).child) == null ? void 0 : _a.contains(e.relatedTarget)))) {
528
+ return;
529
+ }
530
+ handleLeave("dropdown", true);
531
+ }));
532
+ }
533
+ onInvalidate(() => subscriptions.forEach((v) => v()));
534
+ });
535
+ };
536
+ function useDropdown(id, visible, isOpen, origin, dropdownRef, popDirection, emit) {
537
+ const calcPopDirection = (dropdownEl) => {
538
+ const elementHeight = dropdownEl.offsetHeight;
539
+ const bottomDistance = window.innerHeight - origin.value.getBoundingClientRect().bottom;
540
+ const isBottomEnough = bottomDistance >= elementHeight;
541
+ if (!isBottomEnough) {
542
+ popDirection.value = "top";
543
+ } else {
544
+ popDirection.value = "bottom";
545
+ }
546
+ };
547
+ watch(visible, (newVal, oldVal) => {
548
+ if (oldVal === void 0) {
549
+ return;
550
+ }
551
+ isOpen.value = newVal;
552
+ emit("toggle", isOpen.value);
553
+ }, { immediate: true });
554
+ watch([isOpen, dropdownRef], ([isOpenVal, dropdownEl]) => {
555
+ var _a;
556
+ if (isOpenVal) {
557
+ dropdownMap.set(id, __spreadProps(__spreadValues({}, dropdownMap.get(id)), {
558
+ menuEl: dropdownEl,
559
+ toggle: () => {
560
+ isOpen.value = false;
561
+ emit("toggle", isOpen.value);
562
+ }
563
+ }));
564
+ for (const value of dropdownMap.values()) {
565
+ if ((_a = value.menuEl) == null ? void 0 : _a.contains(origin.value)) {
566
+ value.child = dropdownEl;
567
+ }
568
+ }
569
+ }
570
+ if (dropdownEl) {
571
+ calcPopDirection(dropdownEl);
572
+ }
573
+ });
574
+ onMounted(() => {
575
+ dropdownMap.set(id, { toggleEl: origin.value });
576
+ });
577
+ onUnmounted(() => {
578
+ dropdownMap.delete(id);
579
+ });
580
+ }
581
+ function useOverlayProps(props, currentPosition, isOpen) {
582
+ const { showAnimation, overlayClass, destroyOnHide } = toRefs(props);
583
+ const overlayModelValue = ref(false);
584
+ const overlayShowValue = ref(false);
585
+ const styles = computed(() => ({
586
+ transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%"
587
+ }));
588
+ const classes = computed(() => ({
589
+ "fade-in-bottom": showAnimation.value && isOpen.value && currentPosition.value === "bottom",
590
+ "fade-in-top": showAnimation.value && isOpen.value && currentPosition.value === "top",
591
+ [`${overlayClass.value}`]: true
592
+ }));
593
+ const handlePositionChange = (pos) => {
594
+ currentPosition.value = pos.includes("top") || pos.includes("end") ? "top" : "bottom";
595
+ };
596
+ watch(isOpen, (isOpenVal) => {
597
+ overlayModelValue.value = destroyOnHide.value ? isOpenVal : true;
598
+ overlayShowValue.value = isOpenVal;
599
+ });
600
+ return { overlayModelValue, overlayShowValue, styles, classes, handlePositionChange };
601
+ }
602
+ var baseOverlay = "";
603
+ function _isSlot(s) {
604
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
605
+ }
606
+ const CommonOverlay = defineComponent({
607
+ setup(props, ctx) {
608
+ return () => {
609
+ let _slot;
610
+ return createVNode(Teleport, {
611
+ "to": "#d-overlay-anchor"
612
+ }, {
613
+ default: () => [createVNode(Transition, {
614
+ "name": "devui-overlay-fade"
615
+ }, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
616
+ default: () => [_slot]
617
+ })]
618
+ });
619
+ };
620
+ }
621
+ });
622
+ const overlayProps = {
623
+ visible: {
624
+ type: Boolean
625
+ },
626
+ backgroundBlock: {
627
+ type: Boolean,
628
+ default: false
629
+ },
630
+ backgroundClass: {
631
+ type: String,
632
+ default: ""
633
+ },
634
+ backgroundStyle: {
635
+ type: [String, Object]
636
+ },
637
+ onBackdropClick: {
638
+ type: Function
639
+ },
640
+ backdropClose: {
641
+ type: Boolean,
642
+ default: true
643
+ },
644
+ hasBackdrop: {
645
+ type: Boolean,
646
+ default: true
647
+ }
648
+ };
649
+ const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
650
+ overlayStyle: {
651
+ type: [String, Object],
652
+ default: void 0
653
+ }
654
+ });
655
+ const overlayEmits = ["update:visible", "backdropClick"];
656
+ function useOverlayLogic(props, ctx) {
657
+ const backgroundClass = computed(() => {
658
+ return [
659
+ "devui-overlay-background",
660
+ props.backgroundClass,
661
+ !props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
662
+ ];
663
+ });
664
+ const overlayClass = computed(() => {
665
+ return "devui-overlay";
666
+ });
667
+ const handleBackdropClick = (event) => {
668
+ var _a;
669
+ event.preventDefault();
670
+ (_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
671
+ if (props.backdropClose) {
672
+ ctx.emit("update:visible", false);
673
+ }
674
+ };
675
+ const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
676
+ onMounted(() => {
677
+ const body2 = document.body;
678
+ const originOverflow = body2.style.overflow;
679
+ const originPosition = body2.style.position;
680
+ watch([() => props.visible, () => props.backgroundBlock], ([visible, backgroundBlock]) => {
681
+ if (backgroundBlock) {
682
+ const top = body2.getBoundingClientRect().y;
683
+ if (visible) {
684
+ body2.style.overflowY = "scroll";
685
+ body2.style.position = visible ? "fixed" : "";
686
+ body2.style.top = `${top}px`;
687
+ } else {
688
+ body2.style.overflowY = originOverflow;
689
+ body2.style.position = originPosition;
690
+ body2.style.top = "";
691
+ window.scrollTo(0, -top);
692
+ }
693
+ }
694
+ });
695
+ onUnmounted(() => {
696
+ document.body.style.overflow = originOverflow;
697
+ });
698
+ });
699
+ return {
700
+ backgroundClass,
701
+ overlayClass,
702
+ handleBackdropClick,
703
+ handleOverlayBubbleCancel
704
+ };
705
+ }
706
+ var fixedOverlay = "";
707
+ defineComponent({
708
+ name: "DFixedOverlay",
709
+ props: fixedOverlayProps,
710
+ emits: overlayEmits,
711
+ setup(props, ctx) {
712
+ const {
713
+ backgroundClass,
714
+ overlayClass,
715
+ handleBackdropClick,
716
+ handleOverlayBubbleCancel
717
+ } = useOverlayLogic(props, ctx);
718
+ return () => createVNode(CommonOverlay, null, {
719
+ default: () => [props.visible && createVNode("div", {
720
+ "class": backgroundClass.value,
721
+ "style": props.backgroundStyle,
722
+ "onClick": handleBackdropClick
723
+ }, [createVNode("div", {
724
+ "class": overlayClass.value,
725
+ "style": props.overlayStyle,
726
+ "onClick": handleOverlayBubbleCancel
727
+ }, [renderSlot(ctx.slots, "default")])])]
728
+ });
729
+ }
730
+ });
731
+ const flexibleOverlayProps = {
732
+ modelValue: {
733
+ type: Boolean,
734
+ default: false
735
+ },
736
+ origin: {
737
+ type: Object,
738
+ require: true
739
+ },
740
+ position: {
741
+ type: Array,
742
+ default: ["bottom"]
743
+ },
744
+ offset: {
745
+ type: [Number, Object],
746
+ default: 8
747
+ },
748
+ shiftOffset: {
749
+ type: Number
750
+ },
751
+ align: {
752
+ type: String,
753
+ default: null
754
+ },
755
+ showArrow: {
756
+ type: Boolean,
757
+ default: false
758
+ },
759
+ isArrowCenter: {
760
+ type: Boolean,
761
+ default: true
762
+ }
763
+ };
764
+ function getScrollParent(element) {
765
+ const overflowRegex = /(auto|scroll|hidden)/;
766
+ for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
767
+ const style = window.getComputedStyle(parent);
768
+ if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
769
+ return parent;
770
+ }
771
+ }
772
+ return window;
773
+ }
774
+ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
775
+ let { x, y } = point;
776
+ if (!isArrowCenter) {
777
+ const { width, height } = originRect;
778
+ if (x && placement.includes("start")) {
779
+ x = 12;
780
+ }
781
+ if (x && placement.includes("end")) {
782
+ x = Math.round(width - 24);
783
+ }
784
+ if (y && placement.includes("start")) {
785
+ y = 10;
786
+ }
787
+ if (y && placement.includes("end")) {
788
+ y = height - 14;
789
+ }
790
+ }
791
+ return { x, y };
792
+ }
793
+ function useOverlay(props, emit) {
794
+ const overlayRef = ref();
795
+ const arrowRef = ref();
796
+ let originParent = null;
797
+ const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
798
+ const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
799
+ const staticSide = {
800
+ top: "bottom",
801
+ right: "left",
802
+ bottom: "top",
803
+ left: "right"
804
+ }[placement.split("-")[0]];
805
+ Object.assign(arrowEl.style, {
806
+ left: x ? `${x}px` : "",
807
+ top: y ? `${y}px` : "",
808
+ right: "",
809
+ bottom: "",
810
+ [staticSide]: "-4px"
811
+ });
812
+ };
813
+ const updatePosition = async () => {
814
+ const hostEl = props.origin;
815
+ const overlayEl = unref(overlayRef.value);
816
+ const arrowEl = unref(arrowRef.value);
817
+ const middleware = [
818
+ offset(props.offset),
819
+ autoPlacement({
820
+ alignment: props.align,
821
+ allowedPlacements: props.position
822
+ })
823
+ ];
824
+ props.showArrow && middleware.push(arrow({ element: arrowEl }));
825
+ props.shiftOffset !== void 0 && middleware.push(shift());
826
+ const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
827
+ strategy: "fixed",
828
+ middleware
829
+ });
830
+ let applyX = x;
831
+ let applyY = y;
832
+ if (props.shiftOffset !== void 0) {
833
+ const { x: shiftX, y: shiftY } = middlewareData.shift;
834
+ shiftX < 0 && (applyX -= props.shiftOffset);
835
+ shiftX > 0 && (applyX += props.shiftOffset);
836
+ shiftY < 0 && (applyY -= props.shiftOffset);
837
+ shiftY > 0 && (applyY += props.shiftOffset);
838
+ }
839
+ emit("positionChange", placement);
840
+ Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
841
+ props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
842
+ };
843
+ watch(() => props.modelValue, () => {
844
+ if (props.modelValue && props.origin) {
845
+ originParent = getScrollParent(props.origin);
846
+ nextTick(updatePosition);
847
+ originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
848
+ originParent !== window && window.addEventListener("scroll", updatePosition);
849
+ window.addEventListener("resize", updatePosition);
850
+ } else {
851
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
852
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
853
+ window.removeEventListener("resize", updatePosition);
854
+ }
855
+ });
856
+ onUnmounted(() => {
857
+ originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
858
+ originParent !== window && window.removeEventListener("scroll", updatePosition);
859
+ window.removeEventListener("resize", updatePosition);
860
+ });
861
+ return { arrowRef, overlayRef, updatePosition };
862
+ }
863
+ var flexibleOverlay = "";
864
+ const FlexibleOverlay = defineComponent({
865
+ name: "DFlexibleOverlay",
866
+ inheritAttrs: false,
867
+ props: flexibleOverlayProps,
868
+ emits: ["update:modelValue", "positionChange"],
869
+ setup(props, {
870
+ slots,
871
+ attrs,
872
+ emit,
873
+ expose
874
+ }) {
875
+ const {
876
+ arrowRef,
877
+ overlayRef,
878
+ updatePosition
879
+ } = useOverlay(props, emit);
880
+ expose({
881
+ updatePosition
882
+ });
883
+ return () => {
884
+ var _a;
885
+ return props.modelValue && createVNode("div", mergeProps({
886
+ "ref": overlayRef,
887
+ "class": "devui-flexible-overlay"
888
+ }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
889
+ "ref": arrowRef,
890
+ "class": "devui-flexible-overlay-arrow"
891
+ }, null)]);
892
+ };
893
+ }
894
+ });
895
+ var dropdown = "";
896
+ let dropdownId = 1;
897
+ var Dropdown = defineComponent({
898
+ name: "DDropdown",
899
+ inheritAttrs: false,
900
+ props: dropdownProps,
901
+ emits: ["toggle"],
902
+ setup(props, {
903
+ slots,
904
+ attrs,
905
+ emit,
906
+ expose
907
+ }) {
908
+ const {
909
+ visible,
910
+ position,
911
+ align,
912
+ offset: offset2,
913
+ destroyOnHide,
914
+ showAnimation
915
+ } = toRefs(props);
916
+ const origin = ref();
917
+ const dropdownRef = ref();
918
+ const overlayRef = ref();
919
+ const id = `dropdown_${dropdownId++}`;
920
+ const isOpen = ref(false);
921
+ const currentPosition = ref("bottom");
922
+ useDropdownEvent({
923
+ id,
924
+ isOpen,
925
+ origin,
926
+ dropdownRef,
927
+ props,
928
+ emit
929
+ });
930
+ useDropdown(id, visible, isOpen, origin, dropdownRef, currentPosition, emit);
931
+ const {
932
+ overlayModelValue,
933
+ overlayShowValue,
934
+ styles,
935
+ classes,
936
+ handlePositionChange
937
+ } = useOverlayProps(props, currentPosition, isOpen);
938
+ watch(overlayShowValue, (overlayShowValueVal) => {
939
+ nextTick(() => {
940
+ if (!destroyOnHide.value && overlayShowValueVal) {
941
+ overlayRef.value.updatePosition();
942
+ }
943
+ });
944
+ });
945
+ expose({
946
+ updatePosition: () => overlayRef.value.updatePosition()
947
+ });
948
+ return () => {
949
+ var _a;
950
+ return createVNode(Fragment, null, [createVNode("div", {
951
+ "ref": origin,
952
+ "class": "devui-dropdown-toggle"
953
+ }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), createVNode(Teleport, {
954
+ "to": "body"
955
+ }, {
956
+ default: () => [createVNode(Transition, {
957
+ "name": showAnimation.value ? `devui-dropdown-fade-${currentPosition.value}` : ""
958
+ }, {
959
+ default: () => [withDirectives(createVNode(FlexibleOverlay, {
960
+ "modelValue": overlayModelValue.value,
961
+ "onUpdate:modelValue": ($event) => overlayModelValue.value = $event,
962
+ "ref": overlayRef,
963
+ "origin": origin.value,
964
+ "position": position.value,
965
+ "align": align.value,
966
+ "offset": offset2.value,
967
+ "onPositionChange": handlePositionChange,
968
+ "class": classes.value,
969
+ "style": styles.value
970
+ }, {
971
+ default: () => {
972
+ var _a2;
973
+ return [createVNode("div", mergeProps({
974
+ "ref": dropdownRef,
975
+ "class": "devui-dropdown-menu-wrap"
976
+ }, attrs), [(_a2 = slots.menu) == null ? void 0 : _a2.call(slots)])];
977
+ }
978
+ }), [[vShow, overlayShowValue.value]])]
979
+ })]
980
+ })]);
981
+ };
982
+ }
983
+ });
984
+ const dropdownMenuProps = {
985
+ modelValue: {
986
+ type: Boolean,
987
+ default: false
988
+ },
989
+ origin: {
990
+ type: Object,
991
+ require: true
992
+ },
993
+ position: {
994
+ type: Array,
995
+ default: ["bottom"]
996
+ },
997
+ align: {
998
+ type: String,
999
+ default: null
1000
+ },
1001
+ offset: {
1002
+ type: [Number, Object],
1003
+ default: 4
1004
+ },
1005
+ clickOutside: {
1006
+ type: Function,
1007
+ default: () => true
1008
+ },
1009
+ showAnimation: {
1010
+ type: Boolean,
1011
+ default: true
1012
+ },
1013
+ overlayClass: {
1014
+ type: String,
1015
+ default: ""
1016
+ }
1017
+ };
1018
+ defineComponent({
1019
+ name: "DDropdownMenu",
1020
+ inheritAttrs: false,
1021
+ props: dropdownMenuProps,
1022
+ emits: ["update:modelValue"],
1023
+ setup(props, {
1024
+ slots,
1025
+ attrs,
1026
+ emit
1027
+ }) {
1028
+ const {
1029
+ modelValue,
1030
+ origin,
1031
+ position,
1032
+ align,
1033
+ offset: offset2,
1034
+ clickOutside,
1035
+ showAnimation,
1036
+ overlayClass
1037
+ } = toRefs(props);
1038
+ const dropdownMenuRef = ref(null);
1039
+ onClickOutside(dropdownMenuRef, (value) => {
1040
+ var _a, _b;
1041
+ if (((_a = clickOutside.value) == null ? void 0 : _a.call(clickOutside)) && !((_b = origin == null ? void 0 : origin.value) == null ? void 0 : _b.contains(value.target))) {
1042
+ emit("update:modelValue", false);
1043
+ }
1044
+ });
1045
+ const currentPosition = ref("bottom");
1046
+ const handlePositionChange = (pos) => {
1047
+ currentPosition.value = pos.split("-")[0] === "top" ? "top" : "bottom";
1048
+ };
1049
+ const styles = computed(() => ({
1050
+ transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%"
1051
+ }));
1052
+ return () => createVNode(Teleport, {
1053
+ "to": "body"
1054
+ }, {
1055
+ default: () => [createVNode(Transition, {
1056
+ "name": showAnimation.value ? `devui-dropdown-fade-${currentPosition.value}` : ""
1057
+ }, {
1058
+ default: () => [createVNode(FlexibleOverlay, {
1059
+ "modelValue": modelValue.value,
1060
+ "onUpdate:modelValue": ($event) => modelValue.value = $event,
1061
+ "origin": origin == null ? void 0 : origin.value,
1062
+ "position": position.value,
1063
+ "align": align.value,
1064
+ "offset": offset2.value,
1065
+ "onPositionChange": handlePositionChange,
1066
+ "class": overlayClass.value,
1067
+ "style": styles.value
1068
+ }, {
1069
+ default: () => {
1070
+ var _a;
1071
+ return [createVNode("div", mergeProps({
1072
+ "ref": dropdownMenuRef,
1073
+ "class": "devui-dropdown-menu-wrap"
1074
+ }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)])];
1075
+ }
1076
+ })]
1077
+ })]
1078
+ });
1079
+ }
1080
+ });
1081
+ var checkbox = "";
1082
+ const commonProps = {
1083
+ name: {
1084
+ type: String,
1085
+ default: void 0
1086
+ },
1087
+ halfchecked: {
1088
+ type: Boolean,
1089
+ default: false
1090
+ },
1091
+ isShowTitle: {
1092
+ type: Boolean,
1093
+ default: true
1094
+ },
1095
+ title: {
1096
+ type: String
1097
+ },
1098
+ color: {
1099
+ type: String,
1100
+ default: void 0
1101
+ },
1102
+ showAnimation: {
1103
+ type: Boolean,
1104
+ default: true
1105
+ },
1106
+ disabled: {
1107
+ type: Boolean,
1108
+ default: false
1109
+ },
1110
+ beforeChange: {
1111
+ type: Function,
1112
+ default: void 0
1113
+ }
1114
+ };
1115
+ const checkboxProps = __spreadProps(__spreadValues({}, commonProps), {
1116
+ halfchecked: {
1117
+ type: Boolean,
1118
+ default: false
1119
+ },
1120
+ checked: {
1121
+ type: Boolean,
1122
+ default: false
1123
+ },
1124
+ value: {
1125
+ type: String
1126
+ },
1127
+ label: {
1128
+ type: String,
1129
+ default: void 0
1130
+ },
1131
+ title: {
1132
+ type: String,
1133
+ default: void 0
1134
+ },
1135
+ "onUpdate:checked": {
1136
+ type: Function,
1137
+ default: void 0
1138
+ },
1139
+ onChange: {
1140
+ type: Function,
1141
+ default: void 0
1142
+ },
1143
+ modelValue: {
1144
+ type: Boolean
1145
+ },
1146
+ "onUpdate:modelValue": {
1147
+ type: Function
1148
+ }
1149
+ });
1150
+ const checkboxGroupProps = __spreadProps(__spreadValues({}, commonProps), {
1151
+ modelValue: {
1152
+ type: Array,
1153
+ required: true
1154
+ },
1155
+ direction: {
1156
+ type: String,
1157
+ default: "column"
1158
+ },
1159
+ itemWidth: {
1160
+ type: Number,
1161
+ default: void 0
1162
+ },
1163
+ options: {
1164
+ type: Array,
1165
+ default: () => []
1166
+ },
1167
+ onChange: {
1168
+ type: Function,
1169
+ default: void 0
1170
+ },
1171
+ "onUpdate:modelValue": {
1172
+ type: Function,
1173
+ default: void 0
1174
+ }
1175
+ });
1176
+ const checkboxGroupInjectionKey = Symbol("d-checkbox-group");
1177
+ var Checkbox = defineComponent({
1178
+ name: "DCheckbox",
1179
+ props: checkboxProps,
1180
+ emits: ["change", "update:checked", "update:modelValue"],
1181
+ setup(props, ctx) {
1182
+ const checkboxGroupConf = inject(checkboxGroupInjectionKey, null);
1183
+ const isChecked = computed(() => props.checked || props.modelValue);
1184
+ const mergedDisabled = computed(() => {
1185
+ return (checkboxGroupConf == null ? void 0 : checkboxGroupConf.disabled.value) || props.disabled;
1186
+ });
1187
+ const mergedChecked = computed(() => {
1188
+ var _a, _b;
1189
+ return (_b = (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isItemChecked) == null ? void 0 : _a.call(checkboxGroupConf, props.value)) != null ? _b : isChecked.value;
1190
+ });
1191
+ const mergedIsShowTitle = computed(() => {
1192
+ var _a;
1193
+ return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isShowTitle.value) != null ? _a : props.isShowTitle;
1194
+ });
1195
+ const mergedShowAnimation = computed(() => {
1196
+ var _a;
1197
+ return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.showAnimation.value) != null ? _a : props.showAnimation;
1198
+ });
1199
+ const mergedColor = computed(() => {
1200
+ var _a;
1201
+ return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color.value) != null ? _a : props.color;
1202
+ });
1203
+ const itemWidth = checkboxGroupConf == null ? void 0 : checkboxGroupConf.itemWidth.value;
1204
+ const direction = checkboxGroupConf == null ? void 0 : checkboxGroupConf.direction.value;
1205
+ const canChange = (checked, val) => {
1206
+ var _a;
1207
+ if (mergedDisabled.value) {
1208
+ return Promise.resolve(false);
1209
+ }
1210
+ const beforeChange = (_a = props.beforeChange) != null ? _a : checkboxGroupConf == null ? void 0 : checkboxGroupConf.beforeChange;
1211
+ if (beforeChange) {
1212
+ const res = beforeChange(checked, val);
1213
+ if (typeof res === "boolean") {
1214
+ return Promise.resolve(res);
1215
+ }
1216
+ return res;
1217
+ }
1218
+ return Promise.resolve(true);
1219
+ };
1220
+ const toggle = () => {
1221
+ const current = !isChecked.value;
1222
+ checkboxGroupConf == null ? void 0 : checkboxGroupConf.toggleGroupVal(props.value);
1223
+ ctx.emit("update:checked", current);
1224
+ ctx.emit("update:modelValue", current);
1225
+ ctx.emit("change", current);
1226
+ };
1227
+ const handleClick = () => {
1228
+ canChange(!isChecked.value, props.label).then((res) => res && toggle());
1229
+ };
1230
+ return {
1231
+ itemWidth,
1232
+ direction,
1233
+ mergedColor,
1234
+ mergedDisabled,
1235
+ mergedIsShowTitle,
1236
+ mergedChecked,
1237
+ mergedShowAnimation,
1238
+ handleClick
1239
+ };
1240
+ },
1241
+ render() {
1242
+ var _a;
1243
+ const {
1244
+ itemWidth,
1245
+ direction,
1246
+ mergedChecked,
1247
+ mergedDisabled,
1248
+ mergedIsShowTitle,
1249
+ mergedShowAnimation,
1250
+ halfchecked,
1251
+ title,
1252
+ label,
1253
+ handleClick,
1254
+ name,
1255
+ value,
1256
+ mergedColor,
1257
+ $slots
1258
+ } = this;
1259
+ const wrapperCls = {
1260
+ "devui-checkbox-column-margin": direction === "column",
1261
+ "devui-checkbox-wrap": typeof itemWidth !== "undefined"
1262
+ };
1263
+ const wrapperStyle = itemWidth ? [`width: ${itemWidth}px`] : [];
1264
+ const checkboxCls = {
1265
+ "devui-checkbox": true,
1266
+ active: mergedChecked,
1267
+ halfchecked,
1268
+ disabled: mergedDisabled,
1269
+ unchecked: !mergedChecked
1270
+ };
1271
+ const labelTitle = mergedIsShowTitle ? title || label : "";
1272
+ const bgImgStyle = mergedColor && halfchecked || mergedColor ? `linear-gradient(${mergedColor}, ${mergedColor})` : "";
1273
+ const spanStyle = [`border-color:${(mergedChecked || halfchecked) && mergedColor ? mergedColor : ""}`, `background-image:${bgImgStyle}`, `background-color:${mergedColor && halfchecked ? mergedColor : ""}`];
1274
+ const spanCls = {
1275
+ "devui-checkbox-material": true,
1276
+ "custom-color": mergedColor,
1277
+ "devui-checkbox-no-label": !label && !$slots.default,
1278
+ "devui-no-animation": !mergedShowAnimation,
1279
+ "devui-checkbox-default-background": !halfchecked
1280
+ };
1281
+ const polygonCls = {
1282
+ "devui-tick": true,
1283
+ "devui-no-animation": !mergedShowAnimation
1284
+ };
1285
+ const stopPropagation = ($event) => $event.stopPropagation();
1286
+ const inputProps = {
1287
+ indeterminate: halfchecked
1288
+ };
1289
+ return createVNode("div", {
1290
+ "class": wrapperCls,
1291
+ "style": wrapperStyle
1292
+ }, [createVNode("div", {
1293
+ "class": checkboxCls
1294
+ }, [createVNode("label", {
1295
+ "title": labelTitle,
1296
+ "onClick": handleClick
1297
+ }, [createVNode("input", mergeProps({
1298
+ "name": name || value,
1299
+ "class": "devui-checkbox-input",
1300
+ "type": "checkbox"
1301
+ }, inputProps, {
1302
+ "checked": mergedChecked,
1303
+ "disabled": mergedDisabled,
1304
+ "onClick": stopPropagation,
1305
+ "onChange": stopPropagation
1306
+ }), null), createVNode("span", {
1307
+ "style": spanStyle,
1308
+ "class": spanCls
1309
+ }, [createVNode("span", {
1310
+ "class": "devui-checkbox-halfchecked-bg"
1311
+ }, null), createVNode("svg", {
1312
+ "viewBox": "0 0 16 16",
1313
+ "version": "1.1",
1314
+ "xmlns": "http://www.w3.org/2000/svg",
1315
+ "class": "devui-checkbox-tick"
1316
+ }, [createVNode("g", {
1317
+ "stroke": "none",
1318
+ "stroke-width": "1",
1319
+ "fill": "none",
1320
+ "fill-rule": "evenodd"
1321
+ }, [createVNode("polygon", {
1322
+ "fill-rule": "nonzero",
1323
+ "points": "5.17391304 6.56521739 7.7173913 9.10869565 11.826087 5 13 6.17391304 7.7173913 11.4565217 4 7.73913043",
1324
+ "class": polygonCls
1325
+ }, null)])])]), label || ((_a = $slots.default) == null ? void 0 : _a.call($slots))])])]);
1326
+ }
1327
+ });
1328
+ var checkboxGroup = "";
1329
+ defineComponent({
1330
+ name: "DCheckboxGroup",
1331
+ props: checkboxGroupProps,
1332
+ emits: ["change", "update:modelValue"],
1333
+ setup(props, ctx) {
1334
+ const valList = toRef(props, "modelValue");
1335
+ const defaultOpt = {
1336
+ checked: false,
1337
+ isShowTitle: true,
1338
+ halfchecked: false,
1339
+ showAnimation: true,
1340
+ disabled: false
1341
+ };
1342
+ const toggleGroupVal = (val) => {
1343
+ let index2 = -1;
1344
+ if (typeof valList.value[0] === "string") {
1345
+ index2 = valList.value.findIndex((item) => item === val);
1346
+ } else if (typeof valList.value[0] === "object") {
1347
+ index2 = valList.value.findIndex((item) => item.value === val);
1348
+ }
1349
+ if (index2 === -1) {
1350
+ if (typeof props.options[0] === "object") {
1351
+ const newOne = props.options.find((item) => item.value === val);
1352
+ const res2 = [...valList.value, newOne];
1353
+ ctx.emit("update:modelValue", res2);
1354
+ ctx.emit("change", res2);
1355
+ return;
1356
+ }
1357
+ const res = [...valList.value, val];
1358
+ ctx.emit("update:modelValue", res);
1359
+ ctx.emit("change", res);
1360
+ return;
1361
+ }
1362
+ valList.value.splice(index2, 1);
1363
+ ctx.emit("update:modelValue", valList.value);
1364
+ ctx.emit("change", valList.value);
1365
+ };
1366
+ const isItemChecked = (itemVal) => {
1367
+ if (typeof valList.value[0] === "string") {
1368
+ return valList.value.includes(itemVal);
1369
+ } else if (typeof valList.value[0] === "object") {
1370
+ return valList.value.some((item) => item.value === itemVal);
1371
+ }
1372
+ };
1373
+ provide(checkboxGroupInjectionKey, {
1374
+ disabled: toRef(props, "disabled"),
1375
+ isShowTitle: toRef(props, "isShowTitle"),
1376
+ color: toRef(props, "color"),
1377
+ showAnimation: toRef(props, "showAnimation"),
1378
+ beforeChange: props.beforeChange,
1379
+ isItemChecked,
1380
+ toggleGroupVal,
1381
+ itemWidth: toRef(props, "itemWidth"),
1382
+ direction: toRef(props, "direction")
1383
+ });
1384
+ return {
1385
+ defaultOpt
1386
+ };
1387
+ },
1388
+ render() {
1389
+ var _a;
1390
+ const {
1391
+ direction,
1392
+ $slots,
1393
+ defaultOpt,
1394
+ options
1395
+ } = this;
1396
+ let children = (_a = $slots.default) == null ? void 0 : _a.call($slots);
1397
+ if ((options == null ? void 0 : options.length) > 0) {
1398
+ children = options.map((opt) => {
1399
+ let mergedOpt = null;
1400
+ if (typeof opt === "string") {
1401
+ mergedOpt = Object.assign({}, defaultOpt, {
1402
+ label: opt,
1403
+ value: opt
1404
+ });
1405
+ } else if (typeof opt === "object") {
1406
+ mergedOpt = Object.assign({}, defaultOpt, __spreadProps(__spreadValues({}, opt), {
1407
+ label: opt.name
1408
+ }));
1409
+ }
1410
+ return createVNode(Checkbox, mergedOpt, null);
1411
+ });
1412
+ }
1413
+ return createVNode("div", {
1414
+ "class": "devui-checkbox-group"
1415
+ }, [createVNode("div", {
1416
+ "class": {
1417
+ "devui-checkbox-list-inline": direction === "row"
1418
+ }
1419
+ }, [children])]);
1420
+ }
1421
+ });
1422
+ var filter = "";
1423
+ const Filter = defineComponent({
1424
+ props: {
1425
+ modelValue: {
1426
+ type: Array,
1427
+ default: []
1428
+ },
1429
+ "onUpdate:modelValue": {
1430
+ type: Function
1431
+ },
1432
+ customTemplate: {
1433
+ type: Function
1434
+ },
1435
+ filterList: {
1436
+ type: Array,
1437
+ required: true
1438
+ },
1439
+ filterMultiple: {
1440
+ type: Boolean,
1441
+ default: true
1442
+ }
1443
+ },
1444
+ emits: ["update:modelValue"],
1445
+ setup(props) {
1446
+ const filterOrigin = ref(null);
1447
+ const onUpdateChecked = (config, value) => {
1448
+ const checkedList = props.modelValue;
1449
+ const update = props["onUpdate:modelValue"];
1450
+ const contained = !!checkedList.find((item) => item === config.value);
1451
+ if (value && !contained) {
1452
+ update == null ? void 0 : update([...checkedList, config.value]);
1453
+ } else if (!value && contained) {
1454
+ update == null ? void 0 : update(checkedList.filter((item) => config.value !== item));
1455
+ }
1456
+ };
1457
+ const updateSingleChecked = (config) => {
1458
+ var _a;
1459
+ (_a = props["onUpdate:modelValue"]) == null ? void 0 : _a.call(props, [config.value]);
1460
+ };
1461
+ const dropdownContent = computed(() => {
1462
+ const checkedList = props.modelValue;
1463
+ const isContained = (config) => !!checkedList.find((item) => item === config.value);
1464
+ return () => createVNode("ul", {
1465
+ "class": "devui-dropdown-menu data-table-column-filter-content",
1466
+ "style": "padding:10px"
1467
+ }, [props.filterList.map((item, index2) => {
1468
+ return createVNode("li", {
1469
+ "style": index2 > 0 ? "margin-top:10px" : ""
1470
+ }, [props.filterMultiple ? createVNode(Checkbox, {
1471
+ "modelValue": isContained(item),
1472
+ "onUpdate:modelValue": (value) => onUpdateChecked(item, value)
1473
+ }, {
1474
+ default: () => [item.name]
1475
+ }) : createVNode("span", {
1476
+ "onClick": () => updateSingleChecked(item)
1477
+ }, [item.name])]);
1478
+ })]);
1479
+ });
1480
+ return () => createVNode(Fragment, null, [createVNode("span", {
1481
+ "ref": filterOrigin
1482
+ }, [createVNode("i", {
1483
+ "class": ["filter-icon", {
1484
+ "filter-icon-active": true
1485
+ }]
1486
+ }, [createVNode("svg", {
1487
+ "width": "16px",
1488
+ "height": "16px",
1489
+ "viewBox": "0 0 16 16",
1490
+ "version": "1.1",
1491
+ "xmlns": "http://www.w3.org/2000/svg",
1492
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
1493
+ }, [createVNode("g", {
1494
+ "stroke": "none",
1495
+ "stroke-width": "1",
1496
+ "fill": "none",
1497
+ "fill-rule": "evenodd"
1498
+ }, [createVNode("g", null, [createVNode("polygon", {
1499
+ "points": "10.0085775 7 10.0085775 15 6 13 6 7 2 3 2 1 14 1 14 3"
1500
+ }, null)])])])])]), createVNode(Dropdown, {
1501
+ "origin": filterOrigin.value,
1502
+ "closeScope": "blank"
1503
+ }, {
1504
+ default: () => {
1505
+ var _a, _b;
1506
+ return [(_b = (_a = props.customTemplate) == null ? void 0 : _a.call(props, {
1507
+ value: props.modelValue,
1508
+ onChange: props["onUpdate:modelValue"]
1509
+ })) != null ? _b : dropdownContent.value()];
1510
+ }
1511
+ })]);
1512
+ }
1513
+ });
1514
+ const useSort = (column) => {
1515
+ const table2 = inject(TABLE_TOKEN);
1516
+ const store = table2.store;
1517
+ const direction = ref(column.value.sortDirection);
1518
+ const sortClass = computed(() => ({
1519
+ "sort-active": Boolean(direction.value)
1520
+ }));
1521
+ const thInstance = getCurrentInstance();
1522
+ thInstance && store.states.thList.push(thInstance);
1523
+ onMounted(() => {
1524
+ var _a;
1525
+ column.value.sortable && column.value.sortDirection && ((_a = store.sortData) == null ? void 0 : _a.call(store, direction.value, column.value.sortMethod));
1526
+ });
1527
+ const execClearSortOrder = () => {
1528
+ store.states.thList.forEach((th) => {
1529
+ var _a, _b;
1530
+ if (th !== thInstance) {
1531
+ (_b = (_a = th.exposed) == null ? void 0 : _a.clearSortOrder) == null ? void 0 : _b.call(_a);
1532
+ }
1533
+ });
1534
+ };
1535
+ const handleSort = (val) => {
1536
+ var _a;
1537
+ direction.value = val;
1538
+ execClearSortOrder();
1539
+ (_a = store.sortData) == null ? void 0 : _a.call(store, direction.value, column.value.sortMethod);
1540
+ table2.emit("sort-change", { field: column.value.field, direction: direction.value });
1541
+ };
1542
+ const clearSortOrder = () => {
1543
+ direction.value = "";
1544
+ };
1545
+ return { direction, sortClass, handleSort, clearSortOrder };
1546
+ };
1547
+ const useFilter = (store, column) => {
1548
+ const filteredRef = shallowRef();
1549
+ watch(filteredRef, (results) => {
1550
+ store.filterData(column.value.field, results);
1551
+ });
1552
+ return filteredRef;
1553
+ };
1554
+ var TH = defineComponent({
1555
+ name: "DTableHeaderTh",
1556
+ props: {
1557
+ column: {
1558
+ type: Object,
1559
+ required: true
1560
+ }
1561
+ },
1562
+ setup(props, {
1563
+ expose
1564
+ }) {
1565
+ const table2 = inject(TABLE_TOKEN);
1566
+ const store = table2.store;
1567
+ const {
1568
+ column
1569
+ } = toRefs(props);
1570
+ const {
1571
+ direction,
1572
+ sortClass,
1573
+ handleSort,
1574
+ clearSortOrder
1575
+ } = useSort(column);
1576
+ const filteredRef = useFilter(store, column);
1577
+ const {
1578
+ stickyClass,
1579
+ stickyStyle
1580
+ } = useFixedColumn(column);
1581
+ expose({
1582
+ clearSortOrder
1583
+ });
1584
+ return () => {
1585
+ var _a, _b;
1586
+ return createVNode("th", {
1587
+ "class": [stickyClass.value, sortClass.value],
1588
+ "style": stickyStyle.value
1589
+ }, [createVNode("div", {
1590
+ "class": "header-container"
1591
+ }, [(_b = (_a = column.value).renderHeader) == null ? void 0 : _b.call(_a, column.value, store), column.value.filterable && createVNode(Filter, {
1592
+ "modelValue": filteredRef.value,
1593
+ "onUpdate:modelValue": ($event) => filteredRef.value = $event,
1594
+ "filterList": props.column.filterList,
1595
+ "customTemplate": props.column.customFilterTemplate
1596
+ }, null), column.value.sortable && createVNode(Sort, {
1597
+ "sort-direction": direction.value,
1598
+ "onSort": handleSort
1599
+ }, null)])]);
1600
+ };
1601
+ }
1602
+ });
1603
+ function getAllColumns(columns) {
1604
+ const result = [];
1605
+ columns.forEach((column) => {
1606
+ if (column.children) {
1607
+ result.push(column);
1608
+ result.push.apply(result, getAllColumns(column.children));
1609
+ } else {
1610
+ result.push(column);
1611
+ }
1612
+ });
1613
+ return result;
1614
+ }
1615
+ function convertToRows(originColumns) {
1616
+ let maxLevel = 1;
1617
+ const traverse = (column, parent) => {
1618
+ if (parent) {
1619
+ column.level = parent.level + 1;
1620
+ if (maxLevel < column.level) {
1621
+ maxLevel = column.level;
1622
+ }
1623
+ }
1624
+ if (column.children) {
1625
+ let colSpan = 0;
1626
+ column.children.forEach((subColumn) => {
1627
+ traverse(subColumn, column);
1628
+ colSpan += subColumn.colSpan;
1629
+ });
1630
+ column.colSpan = colSpan;
1631
+ } else {
1632
+ column.colSpan = 1;
1633
+ }
1634
+ };
1635
+ originColumns.forEach((column) => {
1636
+ column.level = 1;
1637
+ traverse(column, void 0);
1638
+ });
1639
+ const rows = [];
1640
+ for (let i = 0; i < maxLevel; i++) {
1641
+ rows.push([]);
1642
+ }
1643
+ const allColumns = getAllColumns(originColumns);
1644
+ allColumns.forEach((column) => {
1645
+ if (!column.children) {
1646
+ column.rowSpan = maxLevel - column.level + 1;
1647
+ } else {
1648
+ column.rowSpan = 1;
1649
+ column.children.forEach((col) => col.isSubColumn = true);
1650
+ }
1651
+ rows[column.level - 1].push(column);
1652
+ });
1653
+ return rows;
1654
+ }
1655
+ function useHeader() {
1656
+ const table2 = inject(TABLE_TOKEN);
1657
+ const headerRows = computed(() => convertToRows(table2 == null ? void 0 : table2.store.states._columns.value));
1658
+ return { headerRows };
1659
+ }
1660
+ var header = "";
1661
+ var body = "";
1662
+ var TableHeader = defineComponent({
1663
+ name: "DTableHeader",
1664
+ setup() {
1665
+ const ns = useNamespace("table");
1666
+ const {
1667
+ headerRows
1668
+ } = useHeader();
1669
+ return () => createVNode("thead", {
1670
+ "class": ns.e("thead")
1671
+ }, [headerRows.value.map((subColumns) => createVNode("tr", null, [subColumns.map((column, columnIndex) => createVNode(TH, {
1672
+ "key": columnIndex,
1673
+ "column": column,
1674
+ "colspan": column.colSpan,
1675
+ "rowspan": column.rowSpan
1676
+ }, null))]))]);
1677
+ }
1678
+ });
1679
+ var TD = defineComponent({
1680
+ name: "DTableBodyTd",
1681
+ props: {
1682
+ column: {
1683
+ type: Object,
1684
+ default: () => ({})
1685
+ },
1686
+ row: {
1687
+ type: Object,
1688
+ default: () => ({})
1689
+ },
1690
+ index: {
1691
+ type: Number,
1692
+ default: 0
1693
+ }
1694
+ },
1695
+ setup(props) {
1696
+ const table2 = inject(TABLE_TOKEN);
1697
+ const column = toRef(props, "column");
1698
+ const {
1699
+ stickyClass,
1700
+ stickyStyle
1701
+ } = useFixedColumn(column);
1702
+ return () => {
1703
+ var _a, _b;
1704
+ return createVNode("td", {
1705
+ "class": stickyClass.value,
1706
+ "style": stickyStyle.value
1707
+ }, [(_b = (_a = column.value).renderCell) == null ? void 0 : _b.call(_a, props.row, column.value, table2.store, props.index)]);
1708
+ };
1709
+ }
1710
+ });
1711
+ function useMergeCell() {
1712
+ const table2 = inject(TABLE_TOKEN);
1713
+ const { _data: data, _columns: columns } = table2.store.states;
1714
+ const getSpan = (row, column, rowIndex, columnIndex) => {
1715
+ const fn = table2 == null ? void 0 : table2.props.spanMethod;
1716
+ let rowspan = 1;
1717
+ let colspan = 1;
1718
+ if (typeof fn === "function") {
1719
+ const result = fn({ row, column, rowIndex, columnIndex });
1720
+ if (Array.isArray(result)) {
1721
+ rowspan = result[0];
1722
+ colspan = result[1];
1723
+ } else if (typeof result === "object") {
1724
+ rowspan = result.rowspan;
1725
+ colspan = result.colspan;
1726
+ }
1727
+ }
1728
+ return { rowspan, colspan };
1729
+ };
1730
+ const tableSpans = computed(() => {
1731
+ const result = {};
1732
+ if (table2 == null ? void 0 : table2.props.spanMethod) {
1733
+ data.value.forEach((row, rowIndex) => {
1734
+ columns.value.forEach((column, columnIndex) => {
1735
+ const { rowspan, colspan } = getSpan(row, column, rowIndex, columnIndex);
1736
+ if (rowspan > 1 || colspan > 1) {
1737
+ result[`${rowIndex}-${columnIndex}`] = [rowspan, colspan];
1738
+ }
1739
+ });
1740
+ });
1741
+ }
1742
+ return result;
1743
+ });
1744
+ const removeCells = computed(() => {
1745
+ const result = [];
1746
+ for (const indexKey of Object.keys(tableSpans.value)) {
1747
+ const indexArray = indexKey.split("-").map((item) => Number(item));
1748
+ const spans = tableSpans.value[indexKey];
1749
+ for (let i = 1; i < spans[0]; i++) {
1750
+ result.push(`${indexArray[0] + i}-${indexArray[1]}`);
1751
+ for (let j = 1; j < spans[1]; j++) {
1752
+ result.push(`${indexArray[0] + i}-${indexArray[1] + j}`);
1753
+ }
1754
+ }
1755
+ for (let i = 1; i < spans[1]; i++) {
1756
+ result.push(`${indexArray[0]}-${indexArray[1] + i}`);
1757
+ }
1758
+ }
1759
+ return result;
1760
+ });
1761
+ return { tableSpans, removeCells };
1762
+ }
1763
+ var TableBody = defineComponent({
1764
+ name: "DTableBody",
1765
+ setup() {
1766
+ const table2 = inject(TABLE_TOKEN);
1767
+ const {
1768
+ _data: data,
1769
+ flatColumns
1770
+ } = table2.store.states;
1771
+ const ns = useNamespace("table");
1772
+ const hoverEnabled = computed(() => table2.props.rowHoveredHighlight);
1773
+ const {
1774
+ tableSpans,
1775
+ removeCells
1776
+ } = useMergeCell();
1777
+ return () => createVNode("tbody", {
1778
+ "class": ns.e("tbody")
1779
+ }, [data.value.map((row, rowIndex) => {
1780
+ return createVNode("tr", {
1781
+ "key": rowIndex,
1782
+ "class": {
1783
+ "hover-enabled": hoverEnabled.value
1784
+ }
1785
+ }, [flatColumns.value.map((column, columnIndex) => {
1786
+ var _a;
1787
+ const cellId = `${rowIndex}-${columnIndex}`;
1788
+ const [rowspan, colspan] = (_a = tableSpans.value[cellId]) != null ? _a : [1, 1];
1789
+ if (removeCells.value.includes(cellId)) {
1790
+ return null;
1791
+ }
1792
+ return createVNode(TD, {
1793
+ "column": column,
1794
+ "index": rowIndex,
1795
+ "row": row,
1796
+ "rowspan": rowspan,
1797
+ "colspan": colspan
1798
+ }, null);
1799
+ })]);
1800
+ })]);
1801
+ }
1802
+ });
1803
+ var FixHeader = defineComponent({
1804
+ props: {
1805
+ classes: {
1806
+ type: Object,
1807
+ default: () => ({})
1808
+ },
1809
+ isEmpty: {
1810
+ type: Boolean
1811
+ }
1812
+ },
1813
+ setup(props) {
1814
+ const ns = useNamespace("table");
1815
+ return () => {
1816
+ return createVNode("div", {
1817
+ "class": ns.e("fix-header")
1818
+ }, [createVNode("div", {
1819
+ "style": "overflow:hidden scroll;"
1820
+ }, [createVNode("table", {
1821
+ "class": props.classes,
1822
+ "cellpadding": "0",
1823
+ "cellspacing": "0"
1824
+ }, [createVNode(ColGroup, null, null), createVNode(TableHeader, null, null)])]), createVNode("div", {
1825
+ "class": ns.e("scroll-view")
1826
+ }, [createVNode("table", {
1827
+ "class": props.classes,
1828
+ "cellpadding": "0",
1829
+ "cellspacing": "0"
1830
+ }, [createVNode(ColGroup, null, null), !props.isEmpty && createVNode(TableBody, {
1831
+ "style": "flex: 1"
1832
+ }, null)])])]);
1833
+ };
1834
+ }
1835
+ });
1836
+ var NormalHeader = defineComponent({
1837
+ props: {
1838
+ classes: {
1839
+ type: Object,
1840
+ default: () => ({})
1841
+ },
1842
+ isEmpty: {
1843
+ type: Boolean
1844
+ }
1845
+ },
1846
+ setup(props) {
1847
+ return () => {
1848
+ return createVNode("table", {
1849
+ "class": props.classes,
1850
+ "cellpadding": "0",
1851
+ "cellspacing": "0"
1852
+ }, [createVNode(ColGroup, null, null), createVNode(TableHeader, {
1853
+ "style": "position:relative"
1854
+ }, null), !props.isEmpty && createVNode(TableBody, null, null)]);
1855
+ };
1856
+ }
1857
+ });
1858
+ class View {
1859
+ constructor() {
1860
+ __publicField(this, "top", "50%");
1861
+ __publicField(this, "left", "50%");
1862
+ }
1863
+ }
1864
+ const loadingProps = {
1865
+ message: String,
1866
+ backdrop: Boolean,
1867
+ view: {
1868
+ type: Object,
1869
+ default: () => new View()
1870
+ },
1871
+ zIndex: Number,
1872
+ isFull: {
1873
+ type: Boolean,
1874
+ default: false
1875
+ }
1876
+ };
1877
+ class LoadingOptions {
1878
+ constructor() {
1879
+ __publicField(this, "target");
1880
+ __publicField(this, "message");
1881
+ __publicField(this, "loadingTemplateRef");
1882
+ __publicField(this, "backdrop", true);
1883
+ __publicField(this, "positionType", "relative");
1884
+ __publicField(this, "view", new View());
1885
+ __publicField(this, "zIndex");
1886
+ }
1887
+ }
1888
+ var loading = "";
1889
+ var Loading = defineComponent({
1890
+ name: "DLoading",
1891
+ inheritAttrs: false,
1892
+ props: loadingProps,
1893
+ setup(props) {
1894
+ const style = {
1895
+ top: props.view.top,
1896
+ left: props.view.left,
1897
+ zIndex: props.zIndex
1898
+ };
1899
+ if (!props.message) {
1900
+ style.background = "none";
1901
+ }
1902
+ const isShow = ref(false);
1903
+ const open = () => {
1904
+ isShow.value = true;
1905
+ };
1906
+ const close = () => {
1907
+ isShow.value = false;
1908
+ };
1909
+ return {
1910
+ style,
1911
+ isShow,
1912
+ open,
1913
+ close
1914
+ };
1915
+ },
1916
+ render() {
1917
+ var _a;
1918
+ const {
1919
+ isShow,
1920
+ isFull,
1921
+ backdrop,
1922
+ style,
1923
+ message,
1924
+ $slots
1925
+ } = this;
1926
+ return isShow && createVNode("div", {
1927
+ "class": ["devui-loading-contanier", isFull ? "devui-loading--full" : ""]
1928
+ }, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
1929
+ "class": "devui-loading-wrapper"
1930
+ }, [backdrop ? createVNode("div", {
1931
+ "class": "devui-loading-mask"
1932
+ }, null) : null, createVNode("div", {
1933
+ "style": style,
1934
+ "class": "devui-loading-area"
1935
+ }, [createVNode("div", {
1936
+ "class": "devui-busy-default-spinner"
1937
+ }, [createVNode("div", {
1938
+ "class": "devui-loading-bar1"
1939
+ }, null), createVNode("div", {
1940
+ "class": "devui-loading-bar2"
1941
+ }, null), createVNode("div", {
1942
+ "class": "devui-loading-bar3"
1943
+ }, null), createVNode("div", {
1944
+ "class": "devui-loading-bar4"
1945
+ }, null)]), message ? createVNode("span", {
1946
+ "class": "devui-loading-text"
1947
+ }, [message]) : null])])]);
1948
+ }
1949
+ });
1950
+ const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
1951
+ function createComponent(component, props, children = null) {
1952
+ const vnode = h(component, __spreadValues({}, props), children);
1953
+ const container = document.createElement("div");
1954
+ vnode[COMPONENT_CONTAINER_SYMBOL] = container;
1955
+ render(vnode, container);
1956
+ return vnode.component;
1957
+ }
1958
+ function unmountComponent(ComponnetInstance) {
1959
+ render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
1960
+ }
1961
+ const loadingConstructor = defineComponent(Loading);
1962
+ const cacheInstance = /* @__PURE__ */ new WeakSet();
1963
+ const isEmpty = (val) => {
1964
+ if (!val) {
1965
+ return true;
1966
+ }
1967
+ if (Array.isArray(val)) {
1968
+ return val.length === 0;
1969
+ }
1970
+ if (val instanceof Set || val instanceof Map) {
1971
+ return val.size === 0;
1972
+ }
1973
+ if (val instanceof Promise) {
1974
+ return false;
1975
+ }
1976
+ if (typeof val === "object") {
1977
+ try {
1978
+ return Object.keys(val).length === 0;
1979
+ } catch (e) {
1980
+ return false;
1981
+ }
1982
+ }
1983
+ return false;
1984
+ };
1985
+ const getType = (vari) => {
1986
+ return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
1987
+ };
1988
+ const isPromise = (value) => {
1989
+ const type = getType(value);
1990
+ switch (type) {
1991
+ case "promise":
1992
+ return [value];
1993
+ case "array":
1994
+ if (value.some((val) => getType(val) !== "promise")) {
1995
+ console.error(new TypeError("Binding values should all be of type Promise"));
1996
+ return "error";
1997
+ }
1998
+ return value;
1999
+ default:
2000
+ return false;
2001
+ }
2002
+ };
2003
+ const unmount = (el) => {
2004
+ cacheInstance.delete(el);
2005
+ el.instance.proxy.close();
2006
+ unmountComponent(el.instance);
2007
+ };
2008
+ const toggleLoading = (el, binding) => {
2009
+ var _a, _b, _c;
2010
+ if (binding.value) {
2011
+ const vals = isPromise(binding.value);
2012
+ if (vals === "error") {
2013
+ return;
2014
+ }
2015
+ (_c = (_b = (_a = el == null ? void 0 : el.instance) == null ? void 0 : _a.proxy) == null ? void 0 : _b.open) == null ? void 0 : _c.call(_b);
2016
+ el.appendChild(el.mask);
2017
+ cacheInstance.add(el);
2018
+ if (vals) {
2019
+ Promise.all(vals).catch((err) => {
2020
+ console.error(new Error("Promise handling errors"), err);
2021
+ }).finally(() => {
2022
+ unmount(el);
2023
+ });
2024
+ }
2025
+ } else {
2026
+ unmount(el);
2027
+ }
2028
+ };
2029
+ const removeAttribute = (el) => {
2030
+ el.removeAttribute("zindex");
2031
+ el.removeAttribute("positiontype");
2032
+ el.removeAttribute("backdrop");
2033
+ el.removeAttribute("message");
2034
+ el.removeAttribute("view");
2035
+ el.removeAttribute("loadingtemplateref");
2036
+ };
2037
+ const handleProps = (el, vprops) => {
2038
+ var _a;
2039
+ const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
2040
+ const loadingTemplateRef = props.loadingTemplateRef;
2041
+ const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
2042
+ el.style.position = props.positionType;
2043
+ el.options = props;
2044
+ el.instance = loadingInstance;
2045
+ el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
2046
+ };
2047
+ const loadingDirective = {
2048
+ mounted: function(el, binding, vnode) {
2049
+ handleProps(el, vnode.props);
2050
+ removeAttribute(el);
2051
+ !isEmpty(binding.value) && toggleLoading(el, binding);
2052
+ },
2053
+ updated: function(el, binding, vnode) {
2054
+ if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el)) {
2055
+ return;
2056
+ }
2057
+ !cacheInstance.has(el) && handleProps(el, vnode.props);
2058
+ removeAttribute(el);
2059
+ toggleLoading(el, binding);
2060
+ }
2061
+ };
2062
+ defineComponent(Loading);
2063
+ var table = "";
2064
+ let tableIdInit = 1;
2065
+ var Table = defineComponent({
2066
+ name: "DTable",
2067
+ directives: {
2068
+ dLoading: loadingDirective
2069
+ },
2070
+ props: TableProps,
2071
+ emits: ["sort-change"],
2072
+ setup(props, ctx) {
2073
+ const table2 = getCurrentInstance();
2074
+ const store = createStore(toRef(props, "data"));
2075
+ const tableId = `devui-table_${tableIdInit++}`;
2076
+ table2.tableId = tableId;
2077
+ table2.store = store;
2078
+ provide(TABLE_TOKEN, table2);
2079
+ const {
2080
+ classes,
2081
+ style
2082
+ } = useTable(props);
2083
+ const isEmpty2 = computed(() => props.data.length === 0);
2084
+ const ns = useNamespace("table");
2085
+ const hiddenColumns = ref(null);
2086
+ table2.hiddenColumns = hiddenColumns;
2087
+ ctx.expose({
2088
+ getCheckedRows() {
2089
+ return store.getCheckedRows();
2090
+ }
2091
+ });
2092
+ onMounted(async () => {
2093
+ await nextTick();
2094
+ store.updateColumns();
2095
+ });
2096
+ return () => {
2097
+ var _a, _b;
2098
+ return withDirectives(createVNode("div", {
2099
+ "class": ns.b(),
2100
+ "style": style.value
2101
+ }, [createVNode("div", {
2102
+ "ref": hiddenColumns,
2103
+ "class": "hidden-columns"
2104
+ }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), props.fixHeader ? createVNode(FixHeader, {
2105
+ "classes": classes.value,
2106
+ "is-empty": isEmpty2.value
2107
+ }, null) : createVNode(NormalHeader, {
2108
+ "classes": classes.value,
2109
+ "is-empty": isEmpty2.value
2110
+ }, null), isEmpty2.value && createVNode("div", {
2111
+ "class": ns.e("empty")
2112
+ }, [createTextVNode("No Data")])]), [[resolveDirective("dLoading"), props.showLoading]]);
2113
+ };
2114
+ }
2115
+ });
2116
+ const tableColumnProps = {
2117
+ type: {
2118
+ type: String,
2119
+ default: ""
2120
+ },
2121
+ header: {
2122
+ type: String
2123
+ },
2124
+ field: {
2125
+ type: String,
2126
+ default: ""
2127
+ },
2128
+ width: {
2129
+ type: [String, Number],
2130
+ default: ""
2131
+ },
2132
+ minWidth: {
2133
+ type: [String, Number],
2134
+ default: 80
2135
+ },
2136
+ formatter: {
2137
+ type: Function
2138
+ },
2139
+ order: {
2140
+ type: Number,
2141
+ default: 0
2142
+ },
2143
+ sortable: {
2144
+ type: Boolean,
2145
+ default: false
2146
+ },
2147
+ sortDirection: {
2148
+ type: String,
2149
+ default: ""
2150
+ },
2151
+ sortMethod: {
2152
+ type: Function
2153
+ },
2154
+ filterable: {
2155
+ type: Boolean,
2156
+ default: false
2157
+ },
2158
+ filterMultiple: {
2159
+ type: Boolean,
2160
+ default: false
2161
+ },
2162
+ filterList: {
2163
+ type: Array,
2164
+ default: []
2165
+ },
2166
+ fixedLeft: {
2167
+ type: String
2168
+ },
2169
+ fixedRight: {
2170
+ type: String
2171
+ }
2172
+ };
2173
+ function formatWidth(width) {
2174
+ if (typeof width === "number") {
2175
+ return width;
2176
+ }
2177
+ return parseInt(width, 10) || 0;
2178
+ }
2179
+ function formatMinWidth(minWidth) {
2180
+ return formatWidth(minWidth) || 80;
2181
+ }
2182
+ const cellMap = {
2183
+ checkable: {
2184
+ renderHeader(column, store) {
2185
+ return h(Checkbox, {
2186
+ modelValue: store.states._checkAll.value,
2187
+ halfchecked: store.states._halfChecked.value,
2188
+ onChange: (val) => {
2189
+ store.states._checkAll.value = val;
2190
+ }
2191
+ });
2192
+ },
2193
+ renderCell(rowData, column, store, rowIndex) {
2194
+ return h(Checkbox, {
2195
+ modelValue: store.states._checkList.value[rowIndex],
2196
+ onChange: (val) => {
2197
+ store.states._checkList.value[rowIndex] = val;
2198
+ }
2199
+ });
2200
+ }
2201
+ },
2202
+ index: {
2203
+ renderHeader(column) {
2204
+ var _a;
2205
+ return h("span", {
2206
+ class: "title"
2207
+ }, (_a = column.header) != null ? _a : "#");
2208
+ },
2209
+ renderCell(rowData, column, store, rowIndex) {
2210
+ return rowIndex + 1;
2211
+ }
2212
+ },
2213
+ default: {
2214
+ renderHeader(column) {
2215
+ var _a;
2216
+ return h("span", {
2217
+ class: "title"
2218
+ }, (_a = column.header) != null ? _a : "");
2219
+ },
2220
+ renderCell(rowData, column, store, rowIndex) {
2221
+ var _a, _b;
2222
+ const value = column.field ? rowData[column.field] : "";
2223
+ if (column.formatter) {
2224
+ return column.formatter(rowData, column, value, rowIndex);
2225
+ }
2226
+ return (_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : "";
2227
+ }
2228
+ }
2229
+ };
2230
+ function createColumn(props, slots) {
2231
+ const {
2232
+ type,
2233
+ field,
2234
+ header: header2,
2235
+ sortable,
2236
+ sortDirection,
2237
+ width,
2238
+ minWidth,
2239
+ formatter,
2240
+ sortMethod,
2241
+ filterable,
2242
+ filterList,
2243
+ filterMultiple,
2244
+ order,
2245
+ fixedLeft,
2246
+ fixedRight
2247
+ } = props;
2248
+ const column = reactive({});
2249
+ column.type = type.value;
2250
+ function renderHeader(columnItem, store) {
2251
+ if (slots.header) {
2252
+ return slots.header(columnItem);
2253
+ }
2254
+ return cellMap[type.value || "default"].renderHeader(columnItem, store);
2255
+ }
2256
+ function renderCell(rowData, columnItem, store, rowIndex) {
2257
+ if (slots.default) {
2258
+ return slots.default({ row: rowData, rowIndex });
2259
+ }
2260
+ return cellMap[type.value || "default"].renderCell(rowData, columnItem, store, rowIndex);
2261
+ }
2262
+ watch([field, header2, order], ([fieldVal, headerVal, orderVal]) => {
2263
+ column.field = fieldVal;
2264
+ column.header = headerVal;
2265
+ column.order = orderVal;
2266
+ }, { immediate: true });
2267
+ watch([sortable, sortDirection, sortMethod], ([sortableVal, sortDirectionVal, sortMethodVal]) => {
2268
+ column.sortable = sortableVal;
2269
+ column.sortDirection = sortDirectionVal;
2270
+ column.sortMethod = sortMethodVal;
2271
+ }, { immediate: true });
2272
+ watch([filterable, filterList, filterMultiple], ([filterableVal, filterListVal, filterMultipleVal]) => {
2273
+ column.filterable = filterableVal;
2274
+ column.filterMultiple = filterMultipleVal;
2275
+ column.filterList = filterListVal;
2276
+ }, { immediate: true });
2277
+ watch([fixedLeft, fixedRight], ([left, right]) => {
2278
+ column.fixedLeft = left;
2279
+ column.fixedRight = right;
2280
+ }, { immediate: true });
2281
+ watch([width, minWidth], ([widthVal, minWidthVal]) => {
2282
+ column.width = formatWidth(widthVal);
2283
+ column.minWidth = formatMinWidth(minWidthVal);
2284
+ column.realWidth = column.width || column.minWidth;
2285
+ });
2286
+ onBeforeMount(() => {
2287
+ column.renderHeader = renderHeader;
2288
+ column.renderCell = renderCell;
2289
+ column.formatter = formatter == null ? void 0 : formatter.value;
2290
+ column.customFilterTemplate = slots.customFilterTemplate;
2291
+ column.subColumns = slots.subColumns;
2292
+ });
2293
+ return column;
2294
+ }
2295
+ function useRender() {
2296
+ const instance = getCurrentInstance();
2297
+ const columnOrTableParent = computed(() => {
2298
+ let parent = instance == null ? void 0 : instance.parent;
2299
+ while (parent && !parent.tableId && !parent.columnId) {
2300
+ parent = parent.parent;
2301
+ }
2302
+ return parent;
2303
+ });
2304
+ const getColumnIndex = (children, child) => {
2305
+ return Array.prototype.indexOf.call(children, child);
2306
+ };
2307
+ return { columnOrTableParent, getColumnIndex };
2308
+ }
2309
+ let columnIdInit = 1;
2310
+ var Column = defineComponent({
2311
+ name: "DColumn",
2312
+ props: tableColumnProps,
2313
+ setup(props, ctx) {
2314
+ const instance = getCurrentInstance();
2315
+ const column = createColumn(toRefs(props), ctx.slots);
2316
+ const owner = inject(TABLE_TOKEN);
2317
+ const isSubColumn = ref(false);
2318
+ let columnId = "";
2319
+ const {
2320
+ columnOrTableParent,
2321
+ getColumnIndex
2322
+ } = useRender();
2323
+ const parent = columnOrTableParent.value;
2324
+ columnId = `${parent.tableId || parent.columnId}_column_${columnIdInit++}`;
2325
+ onBeforeMount(() => {
2326
+ isSubColumn.value = owner !== parent;
2327
+ column.id = columnId;
2328
+ });
2329
+ onMounted(() => {
2330
+ var _a;
2331
+ const children = isSubColumn.value ? parent.vnode.el.children : (_a = owner == null ? void 0 : owner.hiddenColumns.value) == null ? void 0 : _a.children;
2332
+ const columnIndex = getColumnIndex(children || [], instance.vnode.el);
2333
+ columnIndex > -1 && (owner == null ? void 0 : owner.store.insertColumn(column, isSubColumn.value ? parent.columnConfig : null));
2334
+ });
2335
+ watch(() => column.order, () => {
2336
+ owner == null ? void 0 : owner.store.sortColumn();
2337
+ });
2338
+ onBeforeUnmount(() => {
2339
+ owner == null ? void 0 : owner.store.removeColumn(column);
2340
+ });
2341
+ instance.columnId = columnId;
2342
+ instance.columnConfig = column;
2343
+ },
2344
+ render() {
2345
+ var _a, _b;
2346
+ try {
2347
+ const renderDefault = (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a, {
2348
+ row: {},
2349
+ column: {},
2350
+ $index: -1
2351
+ });
2352
+ const children = [];
2353
+ if (Array.isArray(renderDefault)) {
2354
+ for (const childNode of renderDefault) {
2355
+ if (childNode.type.name === "DColumn") {
2356
+ children.push(childNode);
2357
+ }
2358
+ }
2359
+ }
2360
+ const vnode = h("div", children);
2361
+ return vnode;
2362
+ } catch {
2363
+ return h("div", []);
2364
+ }
2365
+ }
2366
+ });
2367
+ var index = {
2368
+ title: "Table \u8868\u683C",
2369
+ category: "\u6570\u636E\u5C55\u793A",
2370
+ status: "20%",
2371
+ install(app) {
2372
+ app.component(Table.name, Table);
2373
+ app.component(Column.name, Column);
2374
+ }
2375
+ };
2376
+ export { Column, Table, index as default };