vue-devui 1.0.0-beta.4 → 1.0.0-beta.8

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 (203) hide show
  1. package/accordion/index.d.ts +7 -0
  2. package/accordion/index.es.js +186 -139
  3. package/accordion/index.umd.js +1 -1
  4. package/accordion/style.css +1 -1
  5. package/alert/index.d.ts +7 -0
  6. package/alert/index.es.js +1 -1
  7. package/alert/index.umd.js +1 -1
  8. package/anchor/index.d.ts +7 -0
  9. package/avatar/index.d.ts +7 -0
  10. package/avatar/index.es.js +1 -1
  11. package/avatar/index.umd.js +1 -1
  12. package/back-top/index.d.ts +7 -0
  13. package/back-top/index.es.js +128 -0
  14. package/back-top/index.umd.js +1 -0
  15. package/back-top/package.json +7 -0
  16. package/back-top/style.css +1 -0
  17. package/badge/index.d.ts +7 -0
  18. package/badge/index.es.js +1 -1
  19. package/badge/index.umd.js +1 -1
  20. package/breadcrumb/index.d.ts +7 -0
  21. package/button/index.d.ts +7 -0
  22. package/button/index.es.js +4 -4
  23. package/button/index.umd.js +1 -1
  24. package/card/index.d.ts +7 -0
  25. package/card/index.es.js +1 -1
  26. package/card/index.umd.js +1 -1
  27. package/carousel/index.d.ts +7 -0
  28. package/carousel/index.es.js +3 -3
  29. package/carousel/index.umd.js +1 -1
  30. package/cascader/index.d.ts +7 -0
  31. package/cascader/index.es.js +1239 -83
  32. package/cascader/index.umd.js +1 -1
  33. package/cascader/style.css +1 -1
  34. package/checkbox/index.d.ts +7 -0
  35. package/checkbox/index.es.js +1 -1
  36. package/checkbox/index.umd.js +1 -1
  37. package/comment/index.d.ts +7 -0
  38. package/comment/index.es.js +57 -0
  39. package/comment/index.umd.js +1 -0
  40. package/comment/package.json +7 -0
  41. package/comment/style.css +1 -0
  42. package/countdown/index.d.ts +7 -0
  43. package/countdown/index.es.js +167 -0
  44. package/countdown/index.umd.js +1 -0
  45. package/countdown/package.json +7 -0
  46. package/countdown/style.css +1 -0
  47. package/date-picker/index.d.ts +7 -0
  48. package/date-picker/index.es.js +15 -15
  49. package/date-picker/index.umd.js +1 -1
  50. package/dragdrop/index.d.ts +7 -0
  51. package/drawer/index.d.ts +7 -0
  52. package/drawer/index.es.js +33 -9
  53. package/drawer/index.umd.js +1 -1
  54. package/dropdown/index.d.ts +7 -0
  55. package/dropdown/index.es.js +61 -61
  56. package/dropdown/index.umd.js +1 -1
  57. package/editable-select/index.d.ts +7 -0
  58. package/editable-select/index.es.js +53 -26
  59. package/editable-select/index.umd.js +9 -9
  60. package/form/index.d.ts +7 -0
  61. package/form/index.es.js +175 -80
  62. package/form/index.umd.js +1 -1
  63. package/form/style.css +1 -1
  64. package/fullscreen/index.d.ts +7 -0
  65. package/fullscreen/index.es.js +1 -1
  66. package/fullscreen/index.umd.js +1 -1
  67. package/gantt/index.d.ts +7 -0
  68. package/grid/index.d.ts +7 -0
  69. package/grid/index.es.js +2 -2
  70. package/grid/index.umd.js +1 -1
  71. package/icon/index.d.ts +7 -0
  72. package/icon/index.es.js +4 -4
  73. package/icon/index.umd.js +1 -1
  74. package/image-preview/index.d.ts +7 -0
  75. package/image-preview/index.es.js +23 -2
  76. package/image-preview/index.umd.js +1 -1
  77. package/index.d.ts +7 -0
  78. package/input/index.d.ts +7 -0
  79. package/input/index.es.js +12 -12
  80. package/input/index.umd.js +1 -1
  81. package/input-icon/index.d.ts +7 -0
  82. package/input-icon/index.es.js +331 -0
  83. package/input-icon/index.umd.js +1 -0
  84. package/input-icon/package.json +7 -0
  85. package/input-icon/style.css +1 -0
  86. package/input-number/index.d.ts +7 -0
  87. package/input-number/index.es.js +3 -3
  88. package/input-number/index.umd.js +1 -1
  89. package/layout/index.d.ts +7 -0
  90. package/layout/index.es.js +1 -1
  91. package/layout/index.umd.js +1 -1
  92. package/loading/index.d.ts +7 -0
  93. package/loading/index.es.js +1 -1
  94. package/loading/index.umd.js +1 -1
  95. package/modal/index.d.ts +7 -0
  96. package/modal/index.es.js +58 -57
  97. package/modal/index.umd.js +1 -1
  98. package/nav-sprite/index.d.ts +7 -0
  99. package/overlay/index.d.ts +7 -0
  100. package/overlay/index.es.js +56 -55
  101. package/overlay/index.umd.js +1 -1
  102. package/package.json +2 -31
  103. package/pagination/index.d.ts +7 -0
  104. package/pagination/index.es.js +3 -3
  105. package/pagination/index.umd.js +1 -1
  106. package/panel/index.d.ts +7 -0
  107. package/popover/index.d.ts +7 -0
  108. package/popover/index.es.js +1 -1
  109. package/popover/index.umd.js +1 -1
  110. package/progress/index.d.ts +7 -0
  111. package/progress/index.es.js +1 -1
  112. package/progress/index.umd.js +2 -2
  113. package/quadrant-diagram/index.d.ts +7 -0
  114. package/radio/index.d.ts +7 -0
  115. package/radio/index.es.js +1 -1
  116. package/radio/index.umd.js +1 -1
  117. package/rate/index.d.ts +7 -0
  118. package/rate/index.es.js +1 -1
  119. package/rate/index.umd.js +1 -1
  120. package/read-tip/index.d.ts +7 -0
  121. package/read-tip/index.es.js +61 -24
  122. package/read-tip/index.umd.js +1 -1
  123. package/read-tip/style.css +1 -1
  124. package/result/index.d.ts +7 -0
  125. package/result/index.es.js +118 -0
  126. package/result/index.umd.js +1 -0
  127. package/result/package.json +7 -0
  128. package/result/style.css +1 -0
  129. package/ripple/index.d.ts +7 -0
  130. package/ripple/index.es.js +5 -2
  131. package/ripple/index.umd.js +1 -1
  132. package/search/index.d.ts +7 -0
  133. package/search/index.es.js +14 -14
  134. package/search/index.umd.js +1 -1
  135. package/select/index.d.ts +7 -0
  136. package/select/index.es.js +3 -3
  137. package/select/index.umd.js +1 -1
  138. package/skeleton/index.d.ts +7 -0
  139. package/skeleton/index.es.js +148 -26
  140. package/skeleton/index.umd.js +1 -1
  141. package/skeleton/style.css +1 -1
  142. package/slider/index.d.ts +7 -0
  143. package/slider/index.es.js +1 -1
  144. package/slider/index.umd.js +1 -1
  145. package/splitter/index.d.ts +7 -0
  146. package/splitter/index.es.js +24 -25
  147. package/splitter/index.umd.js +1 -1
  148. package/status/index.d.ts +7 -0
  149. package/status/index.es.js +1 -1
  150. package/status/index.umd.js +1 -1
  151. package/steps-guide/index.d.ts +7 -0
  152. package/steps-guide/index.es.js +97 -74
  153. package/steps-guide/index.umd.js +1 -1
  154. package/sticky/index.d.ts +7 -0
  155. package/style.css +1 -1
  156. package/switch/index.d.ts +7 -0
  157. package/switch/index.es.js +1 -1
  158. package/switch/index.umd.js +1 -1
  159. package/table/index.d.ts +7 -0
  160. package/table/index.es.js +1492 -157
  161. package/table/index.umd.js +1 -1
  162. package/table/style.css +1 -1
  163. package/tabs/index.d.ts +7 -0
  164. package/tabs/index.es.js +1 -0
  165. package/tabs/index.umd.js +1 -1
  166. package/tag/index.d.ts +7 -0
  167. package/tag/index.es.js +94 -12
  168. package/tag/index.umd.js +1 -1
  169. package/tag/style.css +1 -1
  170. package/tag-input/index.d.ts +7 -0
  171. package/tag-input/index.es.js +1 -1
  172. package/tag-input/index.umd.js +1 -1
  173. package/textarea/index.d.ts +7 -0
  174. package/textarea/index.es.js +1 -1
  175. package/textarea/index.umd.js +1 -1
  176. package/time-axis/index.d.ts +7 -0
  177. package/time-axis/index.es.js +240 -21
  178. package/time-axis/index.umd.js +1 -1
  179. package/time-axis/style.css +1 -1
  180. package/time-picker/index.d.ts +7 -0
  181. package/time-picker/index.es.js +12 -7
  182. package/time-picker/index.umd.js +1 -1
  183. package/time-picker/style.css +1 -1
  184. package/toast/index.d.ts +7 -0
  185. package/toast/index.es.js +4 -4
  186. package/toast/index.umd.js +1 -1
  187. package/tooltip/index.d.ts +7 -0
  188. package/transfer/index.d.ts +7 -0
  189. package/transfer/index.es.js +301 -62
  190. package/transfer/index.umd.js +1 -1
  191. package/transfer/style.css +1 -1
  192. package/tree/index.d.ts +7 -0
  193. package/tree/index.es.js +160 -31
  194. package/tree/index.umd.js +1 -1
  195. package/tree-select/index.d.ts +7 -0
  196. package/tree-select/index.es.js +435 -110
  197. package/tree-select/index.umd.js +1 -1
  198. package/tree-select/style.css +1 -1
  199. package/upload/index.d.ts +7 -0
  200. package/upload/index.es.js +4 -4
  201. package/upload/index.umd.js +1 -1
  202. package/vue-devui.es.js +14014 -11820
  203. package/vue-devui.umd.js +19 -19
package/table/index.es.js CHANGED
@@ -1,4 +1,23 @@
1
- import { computed, ref, watch, defineComponent, inject, createVNode, toRefs, getCurrentInstance, provide, createTextVNode, onBeforeMount, onMounted } from "vue";
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
+ import { computed, ref, watch, defineComponent, inject, createVNode, mergeProps, toRef, provide, Teleport, Transition, renderSlot, isVNode, onMounted, onUnmounted, withDirectives, vShow, reactive, isRef, toRefs, Fragment, shallowRef, getCurrentInstance, createTextVNode, resolveDirective, onBeforeMount, h, onBeforeUnmount } from "vue";
2
21
  const TableProps = {
3
22
  data: {
4
23
  type: Array,
@@ -8,15 +27,57 @@ const TableProps = {
8
27
  type: Boolean,
9
28
  default: false
10
29
  },
11
- headerBg: {
30
+ scrollable: {
12
31
  type: Boolean,
13
32
  default: false
14
33
  },
34
+ maxWidth: {
35
+ type: String
36
+ },
37
+ maxHeight: {
38
+ type: String
39
+ },
40
+ tableWidth: {
41
+ type: String
42
+ },
43
+ tableHeight: {
44
+ type: String
45
+ },
46
+ size: {
47
+ type: String,
48
+ validator(value) {
49
+ return value === "sm" || value === "md" || value === "lg";
50
+ }
51
+ },
52
+ rowHoveredHighlight: {
53
+ type: Boolean,
54
+ default: true
55
+ },
56
+ fixHeader: {
57
+ type: Boolean,
58
+ default: false
59
+ },
60
+ checkable: {
61
+ type: Boolean,
62
+ default: true
63
+ },
15
64
  tableLayout: {
16
65
  type: String,
17
- default: "fixed"
66
+ default: "auto",
67
+ validator(v) {
68
+ return v === "fixed" || v === "auto";
69
+ }
70
+ },
71
+ showLoading: {
72
+ type: Boolean,
73
+ default: false
74
+ },
75
+ headerBg: {
76
+ type: Boolean,
77
+ default: false
18
78
  }
19
79
  };
80
+ const TABLE_TOKEN = Symbol();
20
81
  function useTable(props) {
21
82
  const classes = computed(() => ({
22
83
  "devui-table": true,
@@ -24,170 +85,1389 @@ function useTable(props) {
24
85
  "header-bg": props.headerBg,
25
86
  "table-layout-auto": props.tableLayout === "auto"
26
87
  }));
27
- return { classes };
88
+ const style = computed(() => ({
89
+ maxHeight: props.maxHeight,
90
+ maxWidth: props.maxWidth,
91
+ height: props.tableHeight,
92
+ width: props.tableWidth
93
+ }));
94
+ return { classes, style };
28
95
  }
29
- function createStore(props) {
96
+ const useFixedColumn = (column) => {
97
+ const stickyCell = computed(() => {
98
+ const col = column.value;
99
+ if (col.fixedLeft) {
100
+ return `devui-sticky-cell left`;
101
+ }
102
+ if (col.fixedRight) {
103
+ return `devui-sticky-cell right`;
104
+ }
105
+ return void 0;
106
+ });
107
+ const offsetStyle = computed(() => {
108
+ const col = column.value;
109
+ if (col.fixedLeft) {
110
+ return `left:${col.fixedLeft}`;
111
+ }
112
+ if (col.fixedRight) {
113
+ return `right:${col.fixedRight}`;
114
+ }
115
+ return void 0;
116
+ });
117
+ return {
118
+ stickyCell,
119
+ offsetStyle
120
+ };
121
+ };
122
+ function createStore(dataSource) {
30
123
  const _data = ref([]);
124
+ watch(dataSource, (value) => {
125
+ _data.value = [...value];
126
+ }, { deep: true, immediate: true });
127
+ const { _columns, insertColumn, removeColumn, sortColumn } = createColumnGenerator();
128
+ const { _checkAll, _checkList, _halfChecked, getCheckedRows } = createSelection(dataSource, _data);
129
+ const { sortData } = createSorter(dataSource, _data);
130
+ const { filterData, resetFilterData } = createFilter(dataSource, _data);
131
+ const { isFixedLeft } = createFixedLogic(_columns);
132
+ return {
133
+ states: {
134
+ _data,
135
+ _columns,
136
+ _checkList,
137
+ _checkAll,
138
+ _halfChecked,
139
+ isFixedLeft
140
+ },
141
+ insertColumn,
142
+ sortColumn,
143
+ removeColumn,
144
+ getCheckedRows,
145
+ sortData,
146
+ filterData,
147
+ resetFilterData
148
+ };
149
+ }
150
+ const createColumnGenerator = () => {
31
151
  const _columns = ref([]);
32
- updateData();
33
- watch(() => props.data, updateData, { deep: true });
34
- function updateData() {
35
- _data.value = [];
36
- props.data.forEach((item) => {
37
- _data.value.push(item);
38
- });
39
- }
40
152
  const insertColumn = (column) => {
41
153
  _columns.value.push(column);
154
+ _columns.value.sort((a, b) => a.order > b.order ? 1 : -1);
155
+ };
156
+ const sortColumn = () => {
157
+ _columns.value.sort((a, b) => a.order > b.order ? 1 : -1);
158
+ };
159
+ const removeColumn = (column) => {
160
+ const i = _columns.value.findIndex((v) => v === column);
161
+ if (i === -1) {
162
+ return;
163
+ }
164
+ _columns.value.splice(i, 1);
165
+ };
166
+ return { _columns, insertColumn, removeColumn, sortColumn };
167
+ };
168
+ const createSelection = (dataSource, _data) => {
169
+ const _checkList = ref([]);
170
+ const _checkAllRecord = ref(false);
171
+ const _checkAll = computed({
172
+ get: () => _checkAllRecord.value,
173
+ set: (val) => {
174
+ _checkAllRecord.value = val;
175
+ for (let i = 0; i < _checkList.value.length; i++) {
176
+ _checkList.value[i] = val;
177
+ }
178
+ }
179
+ });
180
+ const _halfChecked = ref(false);
181
+ watch(dataSource, (value) => {
182
+ _checkList.value = new Array(value.length).fill(false);
183
+ }, { deep: true, immediate: true });
184
+ watch(_checkList, (list) => {
185
+ if (list.length === 0) {
186
+ return;
187
+ }
188
+ let allTrue = true;
189
+ let allFalse = true;
190
+ for (let i = 0; i < list.length; i++) {
191
+ allTrue && (allTrue = list[i]);
192
+ allFalse && (allFalse = !list[i]);
193
+ }
194
+ _checkAllRecord.value = allTrue;
195
+ _halfChecked.value = !(allFalse || allTrue);
196
+ }, { immediate: true, deep: true });
197
+ const getCheckedRows = () => {
198
+ return _data.value.filter((_, index2) => _checkList.value[index2]);
42
199
  };
43
200
  return {
44
- insertColumn,
45
- states: {
46
- _data,
47
- _columns
201
+ _checkList,
202
+ _checkAll,
203
+ _halfChecked,
204
+ getCheckedRows
205
+ };
206
+ };
207
+ const createSorter = (dataSource, _data) => {
208
+ const sortData = (field, direction, compareFn = (field2, a, b) => a[field2] > b[field2]) => {
209
+ if (direction === "ASC") {
210
+ _data.value = _data.value.sort((a, b) => compareFn(field, a, b) ? 1 : -1);
211
+ } else if (direction === "DESC") {
212
+ _data.value = _data.value.sort((a, b) => !compareFn(field, a, b) ? 1 : -1);
213
+ } else {
214
+ _data.value = [...dataSource.value];
48
215
  }
49
216
  };
50
- }
217
+ return { sortData };
218
+ };
219
+ const createFilter = (dataSource, _data) => {
220
+ const fieldSet = new Set();
221
+ const filterData = (field, results) => {
222
+ fieldSet.add(field);
223
+ const fields = [...fieldSet];
224
+ _data.value = dataSource.value.filter((item) => {
225
+ return fields.reduce((prev, field2) => {
226
+ return prev && results.indexOf(item[field2]) !== -1;
227
+ }, true);
228
+ });
229
+ };
230
+ const resetFilterData = () => {
231
+ fieldSet.clear();
232
+ _data.value = [...dataSource.value];
233
+ };
234
+ return { filterData, resetFilterData };
235
+ };
236
+ const createFixedLogic = (columns) => {
237
+ const isFixedLeft = computed(() => {
238
+ return columns.value.reduce((prev, current) => prev || !!current.fixedLeft, false);
239
+ });
240
+ return { isFixedLeft };
241
+ };
51
242
  var ColGroup = defineComponent({
52
243
  name: "DColGroup",
53
244
  setup() {
54
- const parent = inject("table");
245
+ const parent = inject(TABLE_TOKEN);
55
246
  const columns = parent.store.states._columns;
56
- return {
57
- columns
58
- };
59
- },
60
- render() {
61
- const {
62
- columns
63
- } = this;
64
- return createVNode("colgroup", null, [columns.map((column, index2) => {
247
+ return () => parent.props.tableLayout === "fixed" ? createVNode("colgroup", null, [parent.props.checkable ? createVNode("col", {
248
+ "width": 36
249
+ }, null) : null, columns.value.map((column, index2) => {
65
250
  return createVNode("col", {
66
251
  "key": index2,
67
252
  "width": column.realWidth
68
253
  }, null);
69
- })]);
254
+ })]) : null;
70
255
  }
71
256
  });
72
- const TableHeaderProps = {
73
- store: {
74
- type: Object,
75
- default: {}
257
+ var checkbox = "";
258
+ const commonProps = {
259
+ name: {
260
+ type: String,
261
+ default: void 0
262
+ },
263
+ halfchecked: {
264
+ type: Boolean,
265
+ default: false
266
+ },
267
+ isShowTitle: {
268
+ type: Boolean,
269
+ default: true
270
+ },
271
+ title: {
272
+ type: String
273
+ },
274
+ color: {
275
+ type: String,
276
+ default: void 0
277
+ },
278
+ showAnimation: {
279
+ type: Boolean,
280
+ default: true
281
+ },
282
+ disabled: {
283
+ type: Boolean,
284
+ default: false
285
+ },
286
+ beforeChange: {
287
+ type: Function,
288
+ default: void 0
76
289
  }
77
290
  };
78
- var header = "";
79
- var TableHeader = defineComponent({
80
- name: "DTableHeader",
81
- props: TableHeaderProps,
82
- setup(props) {
291
+ const checkboxProps = __spreadProps(__spreadValues({}, commonProps), {
292
+ halfchecked: {
293
+ type: Boolean,
294
+ default: false
295
+ },
296
+ checked: {
297
+ type: Boolean,
298
+ default: false
299
+ },
300
+ value: {
301
+ type: String
302
+ },
303
+ label: {
304
+ type: String,
305
+ default: void 0
306
+ },
307
+ title: {
308
+ type: String,
309
+ default: void 0
310
+ },
311
+ "onUpdate:checked": {
312
+ type: Function,
313
+ default: void 0
314
+ },
315
+ onChange: {
316
+ type: Function,
317
+ default: void 0
318
+ },
319
+ modelValue: {
320
+ type: Boolean
321
+ },
322
+ "onUpdate:modelValue": {
323
+ type: Function
324
+ }
325
+ });
326
+ const checkboxGroupProps = __spreadProps(__spreadValues({}, commonProps), {
327
+ modelValue: {
328
+ type: Array,
329
+ required: true
330
+ },
331
+ direction: {
332
+ type: String,
333
+ default: "column"
334
+ },
335
+ itemWidth: {
336
+ type: Number,
337
+ default: void 0
338
+ },
339
+ options: {
340
+ type: Array,
341
+ default: () => []
342
+ },
343
+ onChange: {
344
+ type: Function,
345
+ default: void 0
346
+ },
347
+ "onUpdate:modelValue": {
348
+ type: Function,
349
+ default: void 0
350
+ }
351
+ });
352
+ const checkboxGroupInjectionKey = Symbol("d-checkbox-group");
353
+ var Checkbox = defineComponent({
354
+ name: "DCheckbox",
355
+ props: checkboxProps,
356
+ emits: ["change", "update:checked", "update:modelValue"],
357
+ setup(props, ctx) {
358
+ const checkboxGroupConf = inject(checkboxGroupInjectionKey, null);
359
+ const isChecked = computed(() => props.checked || props.modelValue);
360
+ const mergedDisabled = computed(() => {
361
+ return (checkboxGroupConf == null ? void 0 : checkboxGroupConf.disabled.value) || props.disabled;
362
+ });
363
+ const mergedChecked = computed(() => {
364
+ var _a, _b;
365
+ return (_b = (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isItemChecked) == null ? void 0 : _a.call(checkboxGroupConf, props.value)) != null ? _b : isChecked.value;
366
+ });
367
+ const mergedIsShowTitle = computed(() => {
368
+ var _a;
369
+ return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isShowTitle.value) != null ? _a : props.isShowTitle;
370
+ });
371
+ const mergedShowAnimation = computed(() => {
372
+ var _a;
373
+ return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.showAnimation.value) != null ? _a : props.showAnimation;
374
+ });
375
+ const mergedColor = computed(() => {
376
+ var _a;
377
+ return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color.value) != null ? _a : props.color;
378
+ });
379
+ const itemWidth = checkboxGroupConf == null ? void 0 : checkboxGroupConf.itemWidth.value;
380
+ const direction = checkboxGroupConf == null ? void 0 : checkboxGroupConf.direction.value;
381
+ const canChange = (isChecked2, val) => {
382
+ var _a;
383
+ if (mergedDisabled.value) {
384
+ return Promise.resolve(false);
385
+ }
386
+ const beforeChange = (_a = props.beforeChange) != null ? _a : checkboxGroupConf == null ? void 0 : checkboxGroupConf.beforeChange;
387
+ if (beforeChange) {
388
+ const res = beforeChange(isChecked2, val);
389
+ if (typeof res === "boolean") {
390
+ return Promise.resolve(res);
391
+ }
392
+ return res;
393
+ }
394
+ return Promise.resolve(true);
395
+ };
396
+ const toggle = () => {
397
+ const current = !isChecked.value;
398
+ checkboxGroupConf == null ? void 0 : checkboxGroupConf.toggleGroupVal(props.value);
399
+ ctx.emit("update:checked", current);
400
+ ctx.emit("update:modelValue", current);
401
+ ctx.emit("change", current);
402
+ };
403
+ const handleClick = () => {
404
+ canChange(!isChecked.value, props.label).then((res) => res && toggle());
405
+ };
406
+ return {
407
+ itemWidth,
408
+ direction,
409
+ mergedColor,
410
+ mergedDisabled,
411
+ mergedIsShowTitle,
412
+ mergedChecked,
413
+ mergedShowAnimation,
414
+ handleClick
415
+ };
416
+ },
417
+ render() {
418
+ var _a;
83
419
  const {
84
- store
85
- } = toRefs(props);
86
- const columns = store.value.states._columns.value;
420
+ itemWidth,
421
+ direction,
422
+ mergedChecked,
423
+ mergedDisabled,
424
+ mergedIsShowTitle,
425
+ mergedShowAnimation,
426
+ halfchecked,
427
+ title,
428
+ label,
429
+ handleClick,
430
+ name,
431
+ value,
432
+ mergedColor,
433
+ $slots
434
+ } = this;
435
+ const wrapperCls = {
436
+ "devui-checkbox-column-margin": direction === "column",
437
+ "devui-checkbox-wrap": typeof itemWidth !== "undefined"
438
+ };
439
+ const wrapperStyle = itemWidth ? [`width: ${itemWidth}px`] : [];
440
+ const checkboxCls = {
441
+ "devui-checkbox": true,
442
+ active: mergedChecked,
443
+ halfchecked,
444
+ disabled: mergedDisabled,
445
+ unchecked: !mergedChecked
446
+ };
447
+ const labelTitle = mergedIsShowTitle ? title || label : "";
448
+ const bgImgStyle = mergedColor && halfchecked || mergedColor ? `linear-gradient(${mergedColor}, ${mergedColor})` : "";
449
+ const spanStyle = [`border-color:${(mergedChecked || halfchecked) && mergedColor ? mergedColor : ""}`, `background-image:${bgImgStyle}`, `background-color:${mergedColor && halfchecked ? mergedColor : ""}`];
450
+ const spanCls = {
451
+ "devui-checkbox-material": true,
452
+ "custom-color": mergedColor,
453
+ "devui-checkbox-no-label": !label && !$slots.default,
454
+ "devui-no-animation": !mergedShowAnimation,
455
+ "devui-checkbox-default-background": !halfchecked
456
+ };
457
+ const polygonCls = {
458
+ "devui-tick": true,
459
+ "devui-no-animation": !mergedShowAnimation
460
+ };
461
+ const stopPropagation = ($event) => $event.stopPropagation();
462
+ const inputProps = {
463
+ indeterminate: halfchecked
464
+ };
465
+ return createVNode("div", {
466
+ "class": wrapperCls,
467
+ "style": wrapperStyle
468
+ }, [createVNode("div", {
469
+ "class": checkboxCls
470
+ }, [createVNode("label", {
471
+ "title": labelTitle,
472
+ "onClick": handleClick
473
+ }, [createVNode("input", mergeProps({
474
+ "name": name || value,
475
+ "class": "devui-checkbox-input",
476
+ "type": "checkbox"
477
+ }, inputProps, {
478
+ "checked": mergedChecked,
479
+ "disabled": mergedDisabled,
480
+ "onClick": stopPropagation,
481
+ "onChange": stopPropagation
482
+ }), null), createVNode("span", {
483
+ "style": spanStyle,
484
+ "class": spanCls
485
+ }, [createVNode("span", {
486
+ "class": "devui-checkbox-halfchecked-bg"
487
+ }, null), createVNode("svg", {
488
+ "viewBox": "0 0 16 16",
489
+ "version": "1.1",
490
+ "xmlns": "http://www.w3.org/2000/svg",
491
+ "class": "devui-checkbox-tick"
492
+ }, [createVNode("g", {
493
+ "stroke": "none",
494
+ "stroke-width": "1",
495
+ "fill": "none",
496
+ "fill-rule": "evenodd"
497
+ }, [createVNode("polygon", {
498
+ "fill-rule": "nonzero",
499
+ "points": "5.17391304 6.56521739 7.7173913 9.10869565 11.826087 5 13 6.17391304 7.7173913 11.4565217 4 7.73913043",
500
+ "class": polygonCls
501
+ }, null)])])]), label || ((_a = $slots.default) == null ? void 0 : _a.call($slots))])])]);
502
+ }
503
+ });
504
+ var checkboxGroup = "";
505
+ var CheckboxGroup = defineComponent({
506
+ name: "DCheckboxGroup",
507
+ props: checkboxGroupProps,
508
+ emits: ["change", "update:modelValue"],
509
+ setup(props, ctx) {
510
+ const valList = toRef(props, "modelValue");
511
+ const defaultOpt = {
512
+ checked: false,
513
+ isShowTitle: true,
514
+ halfchecked: false,
515
+ showAnimation: true,
516
+ disabled: false
517
+ };
518
+ const toggleGroupVal = (val) => {
519
+ let index2 = -1;
520
+ if (typeof valList.value[0] === "string") {
521
+ index2 = valList.value.findIndex((item) => item === val);
522
+ } else if (typeof valList.value[0] === "object") {
523
+ index2 = valList.value.findIndex((item) => item.value === val);
524
+ }
525
+ if (index2 === -1) {
526
+ if (typeof props.options[0] === "object") {
527
+ const newOne = props.options.find((item) => item.value === val);
528
+ const res2 = [...valList.value, newOne];
529
+ ctx.emit("update:modelValue", res2);
530
+ ctx.emit("change", res2);
531
+ return;
532
+ }
533
+ const res = [...valList.value, val];
534
+ ctx.emit("update:modelValue", res);
535
+ ctx.emit("change", res);
536
+ return;
537
+ }
538
+ valList.value.splice(index2, 1);
539
+ ctx.emit("update:modelValue", valList.value);
540
+ ctx.emit("change", valList.value);
541
+ };
542
+ const isItemChecked = (itemVal) => {
543
+ if (typeof valList.value[0] === "string") {
544
+ return valList.value.includes(itemVal);
545
+ } else if (typeof valList.value[0] === "object") {
546
+ return valList.value.some((item) => item.value === itemVal);
547
+ }
548
+ };
549
+ provide(checkboxGroupInjectionKey, {
550
+ disabled: toRef(props, "disabled"),
551
+ isShowTitle: toRef(props, "isShowTitle"),
552
+ color: toRef(props, "color"),
553
+ showAnimation: toRef(props, "showAnimation"),
554
+ beforeChange: props.beforeChange,
555
+ isItemChecked,
556
+ toggleGroupVal,
557
+ itemWidth: toRef(props, "itemWidth"),
558
+ direction: toRef(props, "direction")
559
+ });
87
560
  return {
88
- columns
561
+ defaultOpt
89
562
  };
90
563
  },
91
564
  render() {
565
+ var _a;
92
566
  const {
93
- columns
567
+ direction,
568
+ $slots,
569
+ defaultOpt,
570
+ options
94
571
  } = this;
95
- return createVNode("thead", {
96
- "class": "devui-thead"
97
- }, [createVNode("tr", null, [columns.map((column, index2) => {
98
- return createVNode("th", {
99
- "key": index2
100
- }, [column.renderHeader()]);
101
- })])]);
572
+ let children = (_a = $slots.default) == null ? void 0 : _a.call($slots);
573
+ if ((options == null ? void 0 : options.length) > 0) {
574
+ children = options.map((opt) => {
575
+ let mergedOpt = null;
576
+ if (typeof opt === "string") {
577
+ mergedOpt = Object.assign({}, defaultOpt, {
578
+ label: opt,
579
+ value: opt
580
+ });
581
+ } else if (typeof opt === "object") {
582
+ mergedOpt = Object.assign({}, defaultOpt, __spreadProps(__spreadValues({}, opt), {
583
+ label: opt.name
584
+ }));
585
+ }
586
+ return createVNode(Checkbox, mergedOpt, null);
587
+ });
588
+ }
589
+ return createVNode("div", {
590
+ "class": "devui-checkbox-group"
591
+ }, [createVNode("div", {
592
+ "class": {
593
+ "devui-checkbox-list-inline": direction === "row"
594
+ }
595
+ }, [children])]);
102
596
  }
103
597
  });
104
- const TableBodyProps = {
105
- store: {
106
- type: Object,
107
- default: {}
598
+ Checkbox.install = function(app) {
599
+ app.component(Checkbox.name, Checkbox);
600
+ };
601
+ CheckboxGroup.install = function(app) {
602
+ app.component(CheckboxGroup.name, CheckboxGroup);
603
+ };
604
+ var sort = "";
605
+ const Sort = defineComponent({
606
+ props: {
607
+ modelValue: {
608
+ type: String,
609
+ default: ""
610
+ },
611
+ "onUpdate:modelValue": {
612
+ type: Function
613
+ }
614
+ },
615
+ emits: ["update:modelValue"],
616
+ setup(props, ctx) {
617
+ const changeDirection = () => {
618
+ let direction = "";
619
+ if (props.modelValue === "ASC") {
620
+ direction = "DESC";
621
+ } else if (props.modelValue === "DESC") {
622
+ direction = "";
623
+ } else {
624
+ direction = "ASC";
625
+ }
626
+ ctx.emit("update:modelValue", direction);
627
+ };
628
+ return () => createVNode("span", {
629
+ "onClick": changeDirection,
630
+ "class": "sort-clickable"
631
+ }, [createVNode("i", {
632
+ "class": ["datatable-svg", {
633
+ "sort-icon-default": !props.modelValue,
634
+ "sort-icon-asc": props.modelValue === "ASC",
635
+ "sort-icon-desc": props.modelValue === "DESC"
636
+ }]
637
+ }, [createVNode("svg", {
638
+ "width": "16px",
639
+ "height": "16px",
640
+ "viewBox": "0 0 16 16",
641
+ "version": "1.1",
642
+ "xmlns": "http://www.w3.org/2000/svg",
643
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
644
+ }, [createVNode("defs", null, [createVNode("circle", {
645
+ "id": "sort-svg-path-1",
646
+ "cx": "8",
647
+ "cy": "8",
648
+ "r": "8"
649
+ }, null), createVNode("filter", {
650
+ "x": "-34.4%",
651
+ "y": "-21.9%",
652
+ "width": "168.8%",
653
+ "height": "168.8%",
654
+ "filterUnits": "objectBoundingBox",
655
+ "id": "filter-2"
656
+ }, [createVNode("feOffset", {
657
+ "dx": "0",
658
+ "dy": "2",
659
+ "in": "SourceAlpha",
660
+ "result": "shadowOffsetOuter1"
661
+ }, null), createVNode("feGaussianBlur", {
662
+ "stdDeviation": "1.5",
663
+ "in": "shadowOffsetOuter1",
664
+ "result": "shadowBlurOuter1"
665
+ }, null), createVNode("feColorMatrix", {
666
+ "values": "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.085309222 0",
667
+ "type": "matrix",
668
+ "in": "shadowBlurOuter1"
669
+ }, null)])]), createVNode("g", {
670
+ "stroke": "none",
671
+ "stroke-width": "1",
672
+ "fill": "none",
673
+ "fill-rule": "evenodd"
674
+ }, [createVNode("use", {
675
+ "fill-rule": "evenodd",
676
+ "xlink:href": "#sort-svg-path-1"
677
+ }, null), createVNode("polygon", {
678
+ "points": "8 4 11 7 5 7"
679
+ }, null), createVNode("polygon", {
680
+ "points": "8 12 5 9 11 9"
681
+ }, null)])])])]);
682
+ }
683
+ });
684
+ const dropdownProps = {
685
+ origin: {
686
+ type: Object
687
+ },
688
+ isOpen: {
689
+ type: Boolean,
690
+ default: false
691
+ },
692
+ disabled: {
693
+ type: Boolean,
694
+ default: false
695
+ },
696
+ trigger: {
697
+ type: String,
698
+ default: "click"
699
+ },
700
+ closeScope: {
701
+ type: String,
702
+ default: "all"
703
+ },
704
+ closeOnMouseLeaveMenu: {
705
+ type: Boolean,
706
+ default: false
707
+ },
708
+ showAnimation: {
709
+ type: Boolean,
710
+ default: true
108
711
  }
109
712
  };
110
- function useTableBody(props) {
111
- const storeData = props.store.states;
112
- const rowColumns = computed(() => {
113
- return storeData._data.value.map((row) => {
114
- const obj = Object.assign({}, row);
115
- obj.columns = storeData._columns.value;
116
- return obj;
713
+ function isComponent(target) {
714
+ return !!(target == null ? void 0 : target.$el);
715
+ }
716
+ function getElement(element) {
717
+ if (element instanceof Element) {
718
+ return element;
719
+ }
720
+ if (element && typeof element === "object" && element.$el instanceof Element) {
721
+ return element.$el;
722
+ }
723
+ return null;
724
+ }
725
+ function subscribeEvent(dom, type, callback) {
726
+ dom == null ? void 0 : dom.addEventListener(type, callback);
727
+ return () => {
728
+ dom == null ? void 0 : dom.removeEventListener(type, callback);
729
+ };
730
+ }
731
+ const useDropdown = ({
732
+ visible,
733
+ trigger,
734
+ origin,
735
+ closeScope,
736
+ closeOnMouseLeaveMenu
737
+ }) => {
738
+ const dropdownElRef = ref();
739
+ const closeByScope = () => {
740
+ if (closeScope.value === "none") {
741
+ return;
742
+ }
743
+ visible.value = false;
744
+ };
745
+ watch([trigger, origin, dropdownElRef], ([trigger2, origin2, dropdownEl], ov, onInvalidate) => {
746
+ const originEl = getElement(origin2);
747
+ if (!originEl || !dropdownEl) {
748
+ return;
749
+ }
750
+ const subscriptions = [
751
+ subscribeEvent(dropdownEl, "click", () => {
752
+ if (closeScope.value === "all") {
753
+ visible.value = false;
754
+ }
755
+ })
756
+ ];
757
+ if (trigger2 === "click") {
758
+ subscriptions.push(subscribeEvent(originEl, "click", () => visible.value = !visible.value), subscribeEvent(document, "click", (e) => {
759
+ if (!visible.value) {
760
+ return;
761
+ }
762
+ const target = e.target;
763
+ const isContain = originEl.contains(target) || dropdownEl.contains(target);
764
+ if (isContain) {
765
+ return;
766
+ }
767
+ closeByScope();
768
+ }), subscribeEvent(dropdownEl, "mouseleave", () => {
769
+ if (closeOnMouseLeaveMenu.value) {
770
+ visible.value = false;
771
+ }
772
+ }));
773
+ } else if (trigger2 === "hover") {
774
+ let overlayEnter = false;
775
+ let originEnter = false;
776
+ const handleLeave = async (elementType) => {
777
+ await new Promise((resolve) => setTimeout(resolve, 50));
778
+ if (elementType === "origin" && overlayEnter || elementType === "dropdown" && originEnter) {
779
+ return;
780
+ }
781
+ closeByScope();
782
+ };
783
+ subscriptions.push(subscribeEvent(originEl, "mouseenter", () => {
784
+ originEnter = true;
785
+ visible.value = true;
786
+ }), subscribeEvent(originEl, "mouseleave", () => {
787
+ originEnter = false;
788
+ if (!closeOnMouseLeaveMenu.value) {
789
+ handleLeave("origin");
790
+ }
791
+ }), subscribeEvent(dropdownEl, "mouseenter", () => {
792
+ overlayEnter = true;
793
+ visible.value = true;
794
+ }), subscribeEvent(dropdownEl, "mouseleave", () => {
795
+ overlayEnter = false;
796
+ handleLeave("dropdown");
797
+ }));
798
+ }
799
+ onInvalidate(() => subscriptions.forEach((v) => v()));
800
+ });
801
+ return { dropdownEl: dropdownElRef };
802
+ };
803
+ var overlay = "";
804
+ function _isSlot(s) {
805
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
806
+ }
807
+ const CommonOverlay = defineComponent({
808
+ setup(props, ctx) {
809
+ return () => {
810
+ let _slot;
811
+ return createVNode(Teleport, {
812
+ "to": "#d-overlay-anchor"
813
+ }, {
814
+ default: () => [createVNode(Transition, {
815
+ "name": "devui-overlay-fade"
816
+ }, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
817
+ default: () => [_slot]
818
+ })]
819
+ });
820
+ };
821
+ }
822
+ });
823
+ const overlayProps = {
824
+ visible: {
825
+ type: Boolean
826
+ },
827
+ "onUpdate:visible": {
828
+ type: Function
829
+ },
830
+ backgroundBlock: {
831
+ type: Boolean,
832
+ default: false
833
+ },
834
+ backgroundClass: {
835
+ type: String,
836
+ default: ""
837
+ },
838
+ backgroundStyle: {
839
+ type: [String, Object]
840
+ },
841
+ onBackdropClick: {
842
+ type: Function
843
+ },
844
+ backdropClose: {
845
+ type: Boolean,
846
+ default: true
847
+ },
848
+ hasBackdrop: {
849
+ type: Boolean,
850
+ default: true
851
+ }
852
+ };
853
+ const overlayEmits = ["onUpdate:visible", "backdropClick"];
854
+ const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
855
+ overlayStyle: {
856
+ type: [String, Object],
857
+ default: void 0
858
+ }
859
+ });
860
+ const flexibleOverlayProps = __spreadValues({
861
+ origin: {
862
+ type: Object,
863
+ require: true
864
+ },
865
+ position: {
866
+ type: Object,
867
+ default: () => ({
868
+ originX: "left",
869
+ originY: "top",
870
+ overlayX: "left",
871
+ overlayY: "top"
872
+ })
873
+ }
874
+ }, overlayProps);
875
+ function useOverlayLogic(props) {
876
+ const backgroundClass = computed(() => {
877
+ return [
878
+ "devui-overlay-background",
879
+ props.backgroundClass,
880
+ !props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
881
+ ];
882
+ });
883
+ const overlayClass = computed(() => {
884
+ return "devui-overlay";
885
+ });
886
+ const handleBackdropClick = (event) => {
887
+ var _a, _b;
888
+ event.preventDefault();
889
+ (_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
890
+ if (props.backdropClose) {
891
+ (_b = props["onUpdate:visible"]) == null ? void 0 : _b.call(props, false);
892
+ }
893
+ };
894
+ const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
895
+ onMounted(() => {
896
+ const body2 = document.body;
897
+ const originOverflow = body2.style.overflow;
898
+ const originPosition = body2.style.position;
899
+ watch([() => props.visible, () => props.backgroundBlock], ([visible, backgroundBlock]) => {
900
+ if (backgroundBlock) {
901
+ const top = body2.getBoundingClientRect().y;
902
+ if (visible) {
903
+ body2.style.overflowY = "scroll";
904
+ body2.style.position = visible ? "fixed" : "";
905
+ body2.style.top = `${top}px`;
906
+ } else {
907
+ body2.style.overflowY = originOverflow;
908
+ body2.style.position = originPosition;
909
+ body2.style.top = "";
910
+ window.scrollTo(0, -top);
911
+ }
912
+ }
913
+ });
914
+ onUnmounted(() => {
915
+ document.body.style.overflow = originOverflow;
117
916
  });
118
917
  });
119
- return { rowColumns };
918
+ return {
919
+ backgroundClass,
920
+ overlayClass,
921
+ handleBackdropClick,
922
+ handleOverlayBubbleCancel
923
+ };
120
924
  }
121
- var body = "";
122
- var TableBody = defineComponent({
123
- name: "DTableBody",
124
- props: TableBodyProps,
925
+ const FixedOverlay = defineComponent({
926
+ name: "DFixedOverlay",
927
+ props: fixedOverlayProps,
928
+ emits: overlayEmits,
929
+ setup(props, ctx) {
930
+ const {
931
+ backgroundClass,
932
+ overlayClass,
933
+ handleBackdropClick,
934
+ handleOverlayBubbleCancel
935
+ } = useOverlayLogic(props);
936
+ return () => createVNode(CommonOverlay, null, {
937
+ default: () => [withDirectives(createVNode("div", {
938
+ "class": backgroundClass.value,
939
+ "style": props.backgroundStyle,
940
+ "onClick": handleBackdropClick
941
+ }, [createVNode("div", {
942
+ "class": overlayClass.value,
943
+ "style": props.overlayStyle,
944
+ "onClick": handleOverlayBubbleCancel
945
+ }, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
946
+ });
947
+ }
948
+ });
949
+ const FlexibleOverlay = defineComponent({
950
+ name: "DFlexibleOverlay",
951
+ props: flexibleOverlayProps,
952
+ emits: overlayEmits,
953
+ setup(props, ctx) {
954
+ const overlayRef = ref(null);
955
+ const positionedStyle = reactive({
956
+ position: "absolute"
957
+ });
958
+ onMounted(async () => {
959
+ const handleRectChange = (position, rect, origin) => {
960
+ const point = calculatePosition(position, rect, origin);
961
+ positionedStyle.left = `${point.x}px`;
962
+ positionedStyle.top = `${point.y}px`;
963
+ };
964
+ const locationElements = computed(() => {
965
+ const overlay2 = overlayRef.value;
966
+ const origin = getOrigin(props.origin);
967
+ if (!overlay2 || !origin) {
968
+ return;
969
+ }
970
+ return {
971
+ origin,
972
+ overlay: overlay2
973
+ };
974
+ });
975
+ const visibleRef = toRef(props, "visible");
976
+ const positionRef = toRef(props, "position");
977
+ watch([locationElements, visibleRef, positionRef], async ([locationElements2, visible, position], ov, onInvalidate) => {
978
+ if (!visible || !locationElements2) {
979
+ return;
980
+ }
981
+ const {
982
+ origin,
983
+ overlay: overlay2
984
+ } = locationElements2;
985
+ handleRectChange(position, overlay2.getBoundingClientRect(), origin);
986
+ const unsubscriptions = [subscribeLayoutEvent(() => handleRectChange(position, overlay2.getBoundingClientRect(), origin)), subscribeOverlayResize(overlay2, (entries) => handleRectChange(position, entries[0].contentRect, origin)), subscribeOriginResize(origin, () => handleRectChange(position, overlay2.getBoundingClientRect(), origin))];
987
+ onInvalidate(() => {
988
+ unsubscriptions.forEach((fn) => fn());
989
+ });
990
+ });
991
+ });
992
+ const {
993
+ backgroundClass,
994
+ overlayClass,
995
+ handleBackdropClick,
996
+ handleOverlayBubbleCancel
997
+ } = useOverlayLogic(props);
998
+ return () => createVNode(CommonOverlay, null, {
999
+ default: () => [withDirectives(createVNode("div", {
1000
+ "style": props.backgroundStyle,
1001
+ "class": backgroundClass.value,
1002
+ "onClick": handleBackdropClick
1003
+ }, [createVNode("div", {
1004
+ "ref": overlayRef,
1005
+ "class": overlayClass.value,
1006
+ "style": positionedStyle,
1007
+ "onClick": handleOverlayBubbleCancel
1008
+ }, [renderSlot(ctx.slots, "default")])]), [[vShow, props.visible]])]
1009
+ });
1010
+ }
1011
+ });
1012
+ function getOrigin(origin) {
1013
+ if (origin instanceof Element) {
1014
+ return origin;
1015
+ }
1016
+ if (isRef(origin)) {
1017
+ return getElement(origin.value);
1018
+ }
1019
+ if (isComponent(origin)) {
1020
+ return getElement(origin);
1021
+ }
1022
+ return origin;
1023
+ }
1024
+ function calculatePosition(position, rect, origin) {
1025
+ const originRect = getOriginRect(origin);
1026
+ const originPoint = getOriginRelativePoint(originRect, position);
1027
+ return getOverlayPoint(originPoint, rect, position);
1028
+ }
1029
+ function getOriginRect(origin) {
1030
+ if (origin instanceof Element) {
1031
+ return origin.getBoundingClientRect();
1032
+ }
1033
+ const width = origin.width || 0;
1034
+ const height = origin.height || 0;
1035
+ return {
1036
+ top: origin.y,
1037
+ bottom: origin.y + height,
1038
+ left: origin.x,
1039
+ right: origin.x + width,
1040
+ height,
1041
+ width
1042
+ };
1043
+ }
1044
+ function getOverlayPoint(originPoint, rect, position) {
1045
+ let x;
1046
+ const {
1047
+ width,
1048
+ height
1049
+ } = rect;
1050
+ if (position.overlayX == "center") {
1051
+ x = originPoint.x - width / 2;
1052
+ } else {
1053
+ x = position.overlayX == "left" ? originPoint.x : originPoint.x - width;
1054
+ }
1055
+ let y;
1056
+ if (position.overlayY == "center") {
1057
+ y = originPoint.y - height / 2;
1058
+ } else {
1059
+ y = position.overlayY == "top" ? originPoint.y : originPoint.y - height;
1060
+ }
1061
+ return {
1062
+ x,
1063
+ y
1064
+ };
1065
+ }
1066
+ function getOriginRelativePoint(originRect, position) {
1067
+ let x;
1068
+ if (position.originX == "center") {
1069
+ x = originRect.left + originRect.width / 2;
1070
+ } else {
1071
+ const startX = originRect.left;
1072
+ const endX = originRect.right;
1073
+ x = position.originX == "left" ? startX : endX;
1074
+ }
1075
+ let y;
1076
+ if (position.originY == "center") {
1077
+ y = originRect.top + originRect.height / 2;
1078
+ } else {
1079
+ y = position.originY == "top" ? originRect.top : originRect.bottom;
1080
+ }
1081
+ return {
1082
+ x,
1083
+ y
1084
+ };
1085
+ }
1086
+ function subscribeLayoutEvent(event) {
1087
+ window.addEventListener("scroll", event, true);
1088
+ window.addEventListener("resize", event);
1089
+ window.addEventListener("orientationchange", event);
1090
+ return () => {
1091
+ window.removeEventListener("scroll", event, true);
1092
+ window.removeEventListener("resize", event);
1093
+ window.removeEventListener("orientationchange", event);
1094
+ };
1095
+ }
1096
+ function subscribeOverlayResize(overlay2, callback) {
1097
+ if (overlay2 instanceof Element) {
1098
+ const resizeObserver = new ResizeObserver(callback);
1099
+ resizeObserver.observe(overlay2);
1100
+ return () => resizeObserver.disconnect();
1101
+ }
1102
+ return () => {
1103
+ };
1104
+ }
1105
+ function subscribeOriginResize(origin, callback) {
1106
+ if (origin instanceof Element) {
1107
+ const observer = new MutationObserver(callback);
1108
+ observer.observe(origin, {
1109
+ attributeFilter: ["style"]
1110
+ });
1111
+ return () => observer.disconnect();
1112
+ }
1113
+ return () => {
1114
+ };
1115
+ }
1116
+ FlexibleOverlay.install = function(app) {
1117
+ app.component(FlexibleOverlay.name, FlexibleOverlay);
1118
+ };
1119
+ FixedOverlay.install = function(app) {
1120
+ app.component(FixedOverlay.name, FixedOverlay);
1121
+ };
1122
+ var dropdown = "";
1123
+ var Dropdown = defineComponent({
1124
+ name: "DDropdown",
1125
+ props: dropdownProps,
1126
+ emits: [],
1127
+ setup(props, ctx) {
1128
+ const {
1129
+ isOpen,
1130
+ origin,
1131
+ trigger,
1132
+ closeScope,
1133
+ closeOnMouseLeaveMenu
1134
+ } = toRefs(props);
1135
+ const visible = ref(false);
1136
+ watch(isOpen, (value) => {
1137
+ visible.value = value;
1138
+ }, {
1139
+ immediate: true
1140
+ });
1141
+ const position = {
1142
+ originX: "center",
1143
+ originY: "bottom",
1144
+ overlayX: "center",
1145
+ overlayY: "top"
1146
+ };
1147
+ const {
1148
+ dropdownEl
1149
+ } = useDropdown({
1150
+ visible,
1151
+ origin,
1152
+ trigger,
1153
+ closeScope,
1154
+ closeOnMouseLeaveMenu
1155
+ });
1156
+ const animatedVisible = computed(() => {
1157
+ return props.showAnimation ? visible.value : true;
1158
+ });
1159
+ return () => {
1160
+ return createVNode(Fragment, null, [createVNode(FlexibleOverlay, {
1161
+ "origin": props.origin,
1162
+ "visible": visible.value,
1163
+ "onUpdate:visible": ($event) => visible.value = $event,
1164
+ "position": position,
1165
+ "hasBackdrop": false
1166
+ }, {
1167
+ default: () => [createVNode(Transition, {
1168
+ "name": "devui-dropdown-fade"
1169
+ }, {
1170
+ default: () => {
1171
+ var _a, _b;
1172
+ return [withDirectives(createVNode("div", {
1173
+ "ref": dropdownEl,
1174
+ "style": "min-width:102px"
1175
+ }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), [[vShow, animatedVisible.value]])];
1176
+ }
1177
+ })]
1178
+ })]);
1179
+ };
1180
+ }
1181
+ });
1182
+ Dropdown.install = function(app) {
1183
+ app.component(Dropdown.name, Dropdown);
1184
+ };
1185
+ var filter = "";
1186
+ const Filter = defineComponent({
1187
+ props: {
1188
+ modelValue: {
1189
+ type: Array,
1190
+ default: []
1191
+ },
1192
+ "onUpdate:modelValue": {
1193
+ type: Function
1194
+ },
1195
+ customTemplate: {
1196
+ type: Function
1197
+ },
1198
+ filterList: {
1199
+ type: Array,
1200
+ required: true
1201
+ },
1202
+ filterMultiple: {
1203
+ type: Boolean,
1204
+ default: true
1205
+ }
1206
+ },
1207
+ emits: ["update:modelValue"],
125
1208
  setup(props) {
1209
+ const filterOrigin = ref(null);
1210
+ const onUpdateChecked = (config, value) => {
1211
+ const checkedList = props.modelValue;
1212
+ const update = props["onUpdate:modelValue"];
1213
+ const contained = !!checkedList.find((item) => item === config.value);
1214
+ if (value && !contained) {
1215
+ update == null ? void 0 : update([...checkedList, config.value]);
1216
+ } else if (!value && contained) {
1217
+ update == null ? void 0 : update(checkedList.filter((item) => config.value !== item));
1218
+ }
1219
+ };
1220
+ const updateSingleChecked = (config) => {
1221
+ var _a;
1222
+ (_a = props["onUpdate:modelValue"]) == null ? void 0 : _a.call(props, [config.value]);
1223
+ };
1224
+ const dropdownContent = computed(() => {
1225
+ const checkedList = props.modelValue;
1226
+ const isContained = (config) => !!checkedList.find((item) => item === config.value);
1227
+ return () => createVNode("ul", {
1228
+ "class": "devui-dropdown-menu data-table-column-filter-content",
1229
+ "style": "padding:10px"
1230
+ }, [props.filterList.map((item, index2) => {
1231
+ return createVNode("li", {
1232
+ "style": index2 > 0 ? "margin-top:10px" : ""
1233
+ }, [props.filterMultiple ? createVNode(Checkbox, {
1234
+ "modelValue": isContained(item),
1235
+ "onUpdate:modelValue": (value) => onUpdateChecked(item, value)
1236
+ }, {
1237
+ default: () => [item.name]
1238
+ }) : createVNode("span", {
1239
+ "onClick": () => updateSingleChecked(item)
1240
+ }, [item.name])]);
1241
+ })]);
1242
+ });
1243
+ return () => createVNode(Fragment, null, [createVNode("span", {
1244
+ "ref": filterOrigin
1245
+ }, [createVNode("i", {
1246
+ "class": ["filter-icon", {
1247
+ "filter-icon-active": true
1248
+ }]
1249
+ }, [createVNode("svg", {
1250
+ "width": "16px",
1251
+ "height": "16px",
1252
+ "viewBox": "0 0 16 16",
1253
+ "version": "1.1",
1254
+ "xmlns": "http://www.w3.org/2000/svg",
1255
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
1256
+ }, [createVNode("g", {
1257
+ "stroke": "none",
1258
+ "stroke-width": "1",
1259
+ "fill": "none",
1260
+ "fill-rule": "evenodd"
1261
+ }, [createVNode("g", null, [createVNode("polygon", {
1262
+ "points": "10.0085775 7 10.0085775 15 6 13 6 7 2 3 2 1 14 1 14 3"
1263
+ }, null)])])])])]), createVNode(Dropdown, {
1264
+ "origin": filterOrigin.value,
1265
+ "closeScope": "blank"
1266
+ }, {
1267
+ default: () => {
1268
+ var _a, _b;
1269
+ return [(_b = (_a = props.customTemplate) == null ? void 0 : _a.call(props, {
1270
+ value: props.modelValue,
1271
+ onChange: props["onUpdate:modelValue"]
1272
+ })) != null ? _b : dropdownContent.value()];
1273
+ }
1274
+ })]);
1275
+ }
1276
+ });
1277
+ var header = "";
1278
+ var body = "";
1279
+ const useSort = (store, column) => {
1280
+ const directionRef = ref("DESC");
1281
+ watch([directionRef, column], ([direction, column2]) => {
1282
+ if (column2.sortable) {
1283
+ store.sortData(column2.field, direction, column2.compareFn);
1284
+ }
1285
+ }, { immediate: true });
1286
+ return directionRef;
1287
+ };
1288
+ const useFliter = (store, column) => {
1289
+ const filteredRef = shallowRef();
1290
+ watch(filteredRef, (results) => {
1291
+ store.filterData(column.value.field, results);
1292
+ });
1293
+ return filteredRef;
1294
+ };
1295
+ var TableHeader = defineComponent({
1296
+ name: "DTableHeader",
1297
+ setup() {
1298
+ const table2 = inject(TABLE_TOKEN);
126
1299
  const {
127
- rowColumns
128
- } = useTableBody(props);
129
- return {
130
- rowColumns
1300
+ _checkAll: checkAll,
1301
+ _halfChecked: halfChecked,
1302
+ _columns: columns,
1303
+ isFixedLeft
1304
+ } = table2.store.states;
1305
+ const thAttrs = computed(() => isFixedLeft.value ? {
1306
+ class: "devui-sticky-cell left",
1307
+ style: "left:0;"
1308
+ } : null);
1309
+ const checkbox2 = computed(() => table2.props.checkable ? createVNode("th", thAttrs.value, [createVNode(Checkbox, {
1310
+ "style": "padding:10px;",
1311
+ "modelValue": checkAll.value,
1312
+ "onUpdate:modelValue": ($event) => checkAll.value = $event,
1313
+ "halfchecked": halfChecked.value
1314
+ }, null)]) : null);
1315
+ return () => {
1316
+ return createVNode("thead", {
1317
+ "class": "devui-thead"
1318
+ }, [createVNode("tr", null, [checkbox2.value, columns.value.map((column, index2) => createVNode(Th, {
1319
+ "key": index2,
1320
+ "column": column
1321
+ }, null))])]);
131
1322
  };
1323
+ }
1324
+ });
1325
+ const Th = defineComponent({
1326
+ props: {
1327
+ column: {
1328
+ type: Object,
1329
+ required: true
1330
+ }
132
1331
  },
133
- render() {
1332
+ setup(props) {
1333
+ const table2 = inject(TABLE_TOKEN);
134
1334
  const {
135
- rowColumns
136
- } = this;
137
- return createVNode("tbody", {
1335
+ column
1336
+ } = toRefs(props);
1337
+ const directionRef = useSort(table2.store, column);
1338
+ const filteredRef = useFliter(table2.store, column);
1339
+ const {
1340
+ stickyCell,
1341
+ offsetStyle
1342
+ } = useFixedColumn(column);
1343
+ return () => createVNode("th", {
1344
+ "class": stickyCell.value,
1345
+ "style": offsetStyle.value
1346
+ }, [createVNode("div", {
1347
+ "class": "header-container"
1348
+ }, [props.column.renderHeader(), props.column.filterable && createVNode(Filter, {
1349
+ "modelValue": filteredRef.value,
1350
+ "onUpdate:modelValue": ($event) => filteredRef.value = $event,
1351
+ "filterList": props.column.filterList,
1352
+ "customTemplate": props.column.customFilterTemplate
1353
+ }, null)]), props.column.sortable && createVNode(Sort, {
1354
+ "modelValue": directionRef.value,
1355
+ "onUpdate:modelValue": ($event) => directionRef.value = $event
1356
+ }, null)]);
1357
+ }
1358
+ });
1359
+ var TableBody = defineComponent({
1360
+ name: "DTableBody",
1361
+ setup() {
1362
+ const table2 = inject(TABLE_TOKEN);
1363
+ const {
1364
+ _data: data,
1365
+ _columns: columns,
1366
+ _checkList: checkList,
1367
+ isFixedLeft
1368
+ } = table2.store.states;
1369
+ const hoverEnabled = computed(() => table2.props.rowHoveredHighlight);
1370
+ const tdAttrs = computed(() => isFixedLeft.value ? {
1371
+ class: "devui-sticky-cell left",
1372
+ style: "left:0;"
1373
+ } : null);
1374
+ const renderCheckbox = (index2) => table2.props.checkable ? createVNode("td", tdAttrs.value, [createVNode(Checkbox, {
1375
+ "modelValue": checkList.value[index2],
1376
+ "onUpdate:modelValue": ($event) => checkList.value[index2] = $event
1377
+ }, null)]) : null;
1378
+ return () => createVNode("tbody", {
138
1379
  "class": "devui-tbody"
139
- }, [rowColumns.map((row, rowIndex) => {
1380
+ }, [data.value.map((row, rowIndex) => {
140
1381
  return createVNode("tr", {
141
- "key": rowIndex
142
- }, [row.columns.map((column, index2) => {
143
- return createVNode("td", {
144
- "key": index2
145
- }, [column.renderCell({
146
- row,
147
- column,
148
- $index: index2
149
- })]);
150
- })]);
1382
+ "key": rowIndex,
1383
+ "class": {
1384
+ "hover-enabled": hoverEnabled.value
1385
+ }
1386
+ }, [renderCheckbox(rowIndex), columns.value.map((column, index2) => createVNode(TD, {
1387
+ "column": column,
1388
+ "index": index2,
1389
+ "row": row
1390
+ }, null))]);
151
1391
  })]);
152
1392
  }
153
1393
  });
1394
+ const TD = defineComponent({
1395
+ props: {
1396
+ column: {
1397
+ type: Object
1398
+ },
1399
+ row: {
1400
+ type: Object
1401
+ },
1402
+ index: {
1403
+ type: Number
1404
+ }
1405
+ },
1406
+ setup(props) {
1407
+ const column = toRef(props, "column");
1408
+ const {
1409
+ stickyCell,
1410
+ offsetStyle
1411
+ } = useFixedColumn(column);
1412
+ return () => createVNode("td", {
1413
+ "class": stickyCell.value,
1414
+ "style": offsetStyle.value
1415
+ }, [column.value.renderCell(props.row, props.index)]);
1416
+ }
1417
+ });
154
1418
  var table = "";
155
1419
  var Table = defineComponent({
156
1420
  name: "DTable",
157
1421
  props: TableProps,
158
- setup(props) {
1422
+ setup(props, ctx) {
159
1423
  const table2 = getCurrentInstance();
160
- const store = createStore(props);
1424
+ const store = createStore(toRef(props, "data"));
161
1425
  table2.store = store;
1426
+ provide(TABLE_TOKEN, table2);
162
1427
  const {
163
- classes
164
- } = useTable(props);
165
- provide("table", table2);
166
- return {
167
1428
  classes,
168
- store
169
- };
170
- },
171
- render() {
172
- const {
173
- classes,
174
- data,
175
- store,
176
- $slots
177
- } = this;
178
- return createVNode("div", {
179
- "class": "devui-table-wrapper"
180
- }, [$slots.default(), createVNode("table", {
181
- "class": classes,
182
- "cellpadding": "0",
183
- "cellspacing": "0"
184
- }, [createVNode(ColGroup, null, null), createVNode(TableHeader, {
185
- "store": store
186
- }, null), !!data.length && createVNode(TableBody, {
187
- "store": store
188
- }, null)]), !data.length && createVNode("div", {
1429
+ style
1430
+ } = useTable(props);
1431
+ const isEmpty = computed(() => props.data.length === 0);
1432
+ const fixHeaderCompo = computed(() => {
1433
+ return createVNode("div", {
1434
+ "class": "devui-table-view"
1435
+ }, [createVNode("div", {
1436
+ "style": "overflow: hidden scroll;"
1437
+ }, [createVNode("table", {
1438
+ "class": classes.value,
1439
+ "cellpadding": "0",
1440
+ "cellspacing": "0"
1441
+ }, [createVNode(ColGroup, null, null), createVNode(TableHeader, null, null)])]), createVNode("div", {
1442
+ "class": "scroll-view"
1443
+ }, [createVNode("table", {
1444
+ "class": classes.value,
1445
+ "cellpadding": "0",
1446
+ "cellspacing": "0"
1447
+ }, [createVNode(ColGroup, null, null), !isEmpty.value && createVNode(TableBody, {
1448
+ "style": "flex: 1"
1449
+ }, null)])])]);
1450
+ });
1451
+ const normalHeaderCompo = computed(() => {
1452
+ return createVNode("table", {
1453
+ "class": classes.value,
1454
+ "cellpadding": "0",
1455
+ "cellspacing": "0"
1456
+ }, [createVNode(ColGroup, null, null), createVNode(TableHeader, {
1457
+ "style": "position: relative"
1458
+ }, null), !isEmpty.value && createVNode(TableBody, null, null)]);
1459
+ });
1460
+ ctx.expose({
1461
+ getCheckedRows() {
1462
+ return store.getCheckedRows();
1463
+ }
1464
+ });
1465
+ return () => withDirectives(createVNode("div", {
1466
+ "class": "devui-table-wrapper",
1467
+ "style": style.value
1468
+ }, [ctx.slots.default(), props.fixHeader ? fixHeaderCompo.value : normalHeaderCompo.value, isEmpty.value && createVNode("div", {
189
1469
  "class": "devui-table-empty"
190
- }, [createTextVNode("No Data")])]);
1470
+ }, [createTextVNode("No Data")])]), [[resolveDirective("dLoading"), props.showLoading]]);
191
1471
  }
192
1472
  });
193
1473
  const TableColumnProps = {
@@ -209,6 +1489,36 @@ const TableColumnProps = {
209
1489
  },
210
1490
  formatter: {
211
1491
  type: Function
1492
+ },
1493
+ order: {
1494
+ type: Number,
1495
+ default: 0
1496
+ },
1497
+ sortable: {
1498
+ type: Boolean,
1499
+ default: false
1500
+ },
1501
+ compareFn: {
1502
+ type: Function,
1503
+ default: (field, a, b) => a[field] < b[field]
1504
+ },
1505
+ filterable: {
1506
+ type: Boolean,
1507
+ default: false
1508
+ },
1509
+ filterMultiple: {
1510
+ type: Boolean,
1511
+ default: false
1512
+ },
1513
+ filterList: {
1514
+ type: Array,
1515
+ default: []
1516
+ },
1517
+ fixedLeft: {
1518
+ type: String
1519
+ },
1520
+ fixedRight: {
1521
+ type: String
212
1522
  }
213
1523
  };
214
1524
  function formatWidth(width) {
@@ -220,59 +1530,84 @@ function formatWidth(width) {
220
1530
  function formatMinWidth(minWidth) {
221
1531
  return formatWidth(minWidth) || 80;
222
1532
  }
223
- function useRender(props) {
224
- const formatedWidth = ref(formatWidth(props.width));
225
- const formatedMinWidth = ref(formatMinWidth(props.minWidth));
226
- const setColumnWidth = (column) => {
227
- column.width = formatedWidth.value;
228
- column.minWidth = formatedMinWidth.value;
1533
+ function createColumn(props, templates) {
1534
+ const {
1535
+ field,
1536
+ header: header2,
1537
+ sortable,
1538
+ width,
1539
+ minWidth,
1540
+ formatter,
1541
+ compareFn,
1542
+ filterable,
1543
+ filterList,
1544
+ filterMultiple,
1545
+ order,
1546
+ fixedLeft,
1547
+ fixedRight
1548
+ } = props;
1549
+ const column = reactive({});
1550
+ watch([field, header2, order], ([field2, header22, order2]) => {
1551
+ column.field = field2;
1552
+ column.header = header22;
1553
+ column.order = order2;
1554
+ }, { immediate: true });
1555
+ watch([sortable, compareFn], ([sortable2, compareFn2]) => {
1556
+ column.sortable = sortable2;
1557
+ column.compareFn = compareFn2;
1558
+ });
1559
+ watch([
1560
+ filterable,
1561
+ filterList,
1562
+ filterMultiple
1563
+ ], ([filterable2, filterList2, filterMultiple2]) => {
1564
+ column.filterable = filterable2;
1565
+ column.filterMultiple = filterMultiple2;
1566
+ column.filterList = filterList2;
1567
+ }, { immediate: true });
1568
+ watch([fixedLeft, fixedRight], ([left, right]) => {
1569
+ column.fixedLeft = left;
1570
+ column.fixedRight = right;
1571
+ }, { immediate: true });
1572
+ watch([width, minWidth], ([width2, minWidth2]) => {
1573
+ column.width = formatWidth(width2);
1574
+ column.minWidth = formatMinWidth(minWidth2);
229
1575
  column.realWidth = column.width || column.minWidth;
230
- return column;
231
- };
232
- const setColumnRender = (column) => {
233
- column.renderHeader = () => {
234
- return defaultRenderHeader(column);
235
- };
236
- column.renderCell = (data) => {
237
- return defaultRenderCell(data);
238
- };
239
- };
240
- return { setColumnWidth, setColumnRender };
1576
+ });
1577
+ onBeforeMount(() => {
1578
+ column.renderHeader = defaultRenderHeader;
1579
+ column.renderCell = defaultRenderCell;
1580
+ column.formatter = formatter.value;
1581
+ column.customFilterTemplate = templates.customFilterTemplate;
1582
+ column.subColumns = templates.subColumns;
1583
+ });
1584
+ return column;
241
1585
  }
242
- function defaultRenderHeader(column) {
243
- return column.header;
1586
+ function defaultRenderHeader() {
1587
+ return h("span", { class: "title" }, this.header);
244
1588
  }
245
- function defaultRenderCell({
246
- row,
247
- column,
248
- $index
249
- }) {
250
- var _a;
251
- const value = row[column.field];
252
- if (column.formatter) {
253
- return column.formatter(row, column, value, $index);
254
- }
255
- return ((_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) || "";
1589
+ function defaultRenderCell(rowData, index2) {
1590
+ var _a, _b;
1591
+ const value = rowData[this.field];
1592
+ if (this.formatter) {
1593
+ return this.formatter(rowData, value, index2);
1594
+ }
1595
+ return (_b = (_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) != null ? _b : "";
256
1596
  }
257
1597
  var Column = defineComponent({
258
1598
  name: "DColumn",
259
1599
  props: TableColumnProps,
260
- setup(props) {
261
- const column = {
262
- field: props.field,
263
- header: props.header
264
- };
265
- const parent = inject("table");
266
- const {
267
- setColumnWidth,
268
- setColumnRender
269
- } = useRender(props);
270
- onBeforeMount(() => {
271
- setColumnWidth(column);
272
- setColumnRender(column);
273
- });
1600
+ setup(props, ctx) {
1601
+ const column = createColumn(toRefs(props), ctx.slots);
1602
+ const parent = inject(TABLE_TOKEN);
274
1603
  onMounted(() => {
275
1604
  parent.store.insertColumn(column);
1605
+ watch(() => column.order, () => {
1606
+ parent.store.sortColumn();
1607
+ });
1608
+ });
1609
+ onBeforeUnmount(() => {
1610
+ parent.store.removeColumn(column);
276
1611
  });
277
1612
  },
278
1613
  render() {