ep-craft 0.1.32 → 0.1.34

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 (205) hide show
  1. package/dist/components/button/index.d.ts +12 -0
  2. package/dist/components/button-group/index.d.ts +3 -2
  3. package/dist/components/button-group/index.js +7 -3
  4. package/dist/components/button-group/src/button-group.d.ts +48 -0
  5. package/dist/components/button-group/src/button-group.js +7 -0
  6. package/dist/components/button-group/src/button-group.vue.d.ts +16 -0
  7. package/dist/components/button-group/src/button-group.vue.js +42 -0
  8. package/dist/components/button-group/src/button-group2.vue.js +4 -0
  9. package/dist/components/checkbox/index.js +6 -5
  10. package/dist/components/collection/index.d.ts +8 -0
  11. package/dist/components/collection/src/collection-item.vue.d.ts +2 -0
  12. package/dist/components/collection/src/collection-item.vue.js +10 -0
  13. package/dist/components/collection/src/collection-item2.vue.js +8 -0
  14. package/dist/components/collection/src/collection.d.ts +39 -0
  15. package/dist/components/collection/src/collection.js +52 -0
  16. package/dist/components/collection/src/collection.vue.d.ts +2 -0
  17. package/dist/components/collection/src/collection.vue.js +10 -0
  18. package/dist/components/collection/src/collection2.vue.js +7 -0
  19. package/dist/components/collection/src/tokens.d.ts +18 -0
  20. package/dist/components/divider/index.d.ts +24 -2
  21. package/dist/components/divider/index.js +8 -3
  22. package/dist/components/divider/src/divider.d.ts +30 -0
  23. package/dist/components/divider/src/divider.js +34 -0
  24. package/dist/components/divider/src/divider.vue.d.ts +24 -0
  25. package/dist/components/divider/src/divider.vue.js +39 -0
  26. package/dist/components/divider/src/divider2.vue.js +4 -0
  27. package/dist/components/dropdown/index.d.ts +3017 -3
  28. package/dist/components/dropdown/index.js +23 -3
  29. package/dist/components/dropdown/src/dropdown-item-impl.vue.d.ts +79 -0
  30. package/dist/components/dropdown/src/dropdown-item-impl.vue.js +40 -0
  31. package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +68 -0
  32. package/dist/components/dropdown/src/dropdown-item.vue.d.ts +169 -0
  33. package/dist/components/dropdown/src/dropdown-item.vue.js +35 -0
  34. package/dist/components/dropdown/src/dropdown-item2.vue.js +63 -0
  35. package/dist/components/dropdown/src/dropdown-menu.vue.d.ts +27 -0
  36. package/dist/components/dropdown/src/dropdown-menu.vue.js +24 -0
  37. package/dist/components/dropdown/src/dropdown-menu2.vue.js +75 -0
  38. package/dist/components/dropdown/src/dropdown.d.ts +200 -0
  39. package/dist/components/dropdown/src/dropdown.js +201 -0
  40. package/dist/components/dropdown/src/dropdown.vue.d.ts +1126 -0
  41. package/dist/components/dropdown/src/dropdown.vue.js +127 -0
  42. package/dist/components/dropdown/src/dropdown2.vue.js +127 -0
  43. package/dist/components/dropdown/src/instance.d.ts +2 -0
  44. package/dist/components/dropdown/src/tokens.d.ts +13 -0
  45. package/dist/components/dropdown/src/tokens.js +5 -0
  46. package/dist/components/dropdown/src/useDropdown.d.ts +5 -0
  47. package/dist/components/dropdown/src/useDropdown.js +15 -0
  48. package/dist/components/dropdown-item/index.d.ts +1 -4
  49. package/dist/components/dropdown-menu/index.d.ts +1 -4
  50. package/dist/components/index.js +129 -131
  51. package/dist/components/popover/index.d.ts +121 -3
  52. package/dist/components/popover/index.js +19 -4
  53. package/dist/components/popover/src/directive.d.ts +4 -0
  54. package/dist/components/popover/src/directive.js +15 -0
  55. package/dist/components/popover/src/popover.d.ts +291 -0
  56. package/dist/components/popover/src/popover.js +168 -0
  57. package/dist/components/popover/src/popover.vue.d.ts +53 -0
  58. package/dist/components/popover/src/popover.vue.js +125 -0
  59. package/dist/components/popover/src/popover2.vue.js +4 -0
  60. package/dist/components/progress/index.d.ts +35 -2
  61. package/dist/components/progress/index.js +10 -4
  62. package/dist/components/progress/src/progress.d.ts +97 -0
  63. package/dist/components/progress/src/progress.js +104 -0
  64. package/dist/components/progress/src/progress.vue.d.ts +30 -0
  65. package/dist/components/progress/src/progress.vue.js +179 -0
  66. package/dist/components/progress/src/progress2.vue.js +4 -0
  67. package/dist/components/roving-focus-group/index.d.ts +14 -0
  68. package/dist/components/roving-focus-group/index.js +15 -0
  69. package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.d.ts +50 -0
  70. package/dist/components/roving-focus-group/src/roving-focus-group-impl.vue.js +10 -0
  71. package/dist/components/roving-focus-group/src/roving-focus-group-impl2.vue.js +115 -0
  72. package/dist/components/roving-focus-group/src/roving-focus-group.d.ts +56 -0
  73. package/dist/components/roving-focus-group/src/roving-focus-group.js +43 -0
  74. package/dist/components/roving-focus-group/src/roving-focus-group.vue.d.ts +67 -0
  75. package/dist/components/roving-focus-group/src/roving-focus-group.vue.js +13 -0
  76. package/dist/components/roving-focus-group/src/roving-focus-group2.vue.js +21 -0
  77. package/dist/components/roving-focus-group/src/roving-focus-item.vue.d.ts +43 -0
  78. package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +20 -0
  79. package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +78 -0
  80. package/dist/components/roving-focus-group/src/tokens.d.ts +28 -0
  81. package/dist/components/roving-focus-group/src/tokens.js +5 -0
  82. package/dist/components/roving-focus-group/src/utils.d.ts +8 -0
  83. package/dist/components/roving-focus-group/src/utils.js +28 -0
  84. package/dist/components/table/index.d.ts +56 -3
  85. package/dist/components/table/index.js +20 -4
  86. package/dist/components/table/src/composables/use-scrollbar.d.ts +6 -0
  87. package/dist/components/table/src/composables/use-scrollbar.js +24 -0
  88. package/dist/components/table/src/config.d.ts +87 -0
  89. package/dist/components/table/src/config.js +210 -0
  90. package/dist/components/table/src/filter-panel.vue.d.ts +837 -0
  91. package/dist/components/table/src/filter-panel.vue.js +130 -0
  92. package/dist/components/table/src/filter-panel2.vue.js +155 -0
  93. package/dist/components/table/src/h-helper.d.ts +13 -0
  94. package/dist/components/table/src/h-helper.js +30 -0
  95. package/dist/components/table/src/layout-observer.d.ts +8 -0
  96. package/dist/components/table/src/layout-observer.js +49 -0
  97. package/dist/components/table/src/store/current.d.ts +15 -0
  98. package/dist/components/table/src/store/current.js +45 -0
  99. package/dist/components/table/src/store/expand.d.ts +14 -0
  100. package/dist/components/table/src/store/expand.js +55 -0
  101. package/dist/components/table/src/store/helper.d.ts +548 -0
  102. package/dist/components/table/src/store/helper.js +61 -0
  103. package/dist/components/table/src/store/index.d.ts +1107 -0
  104. package/dist/components/table/src/store/index.js +123 -0
  105. package/dist/components/table/src/store/tree.d.ts +27 -0
  106. package/dist/components/table/src/store/tree.js +153 -0
  107. package/dist/components/table/src/store/watcher.d.ts +88 -0
  108. package/dist/components/table/src/store/watcher.js +483 -0
  109. package/dist/components/table/src/table/defaults.d.ts +560 -0
  110. package/dist/components/table/src/table/defaults.js +236 -0
  111. package/dist/components/table/src/table/key-render-helper.d.ts +2 -0
  112. package/dist/components/table/src/table/key-render-helper.js +18 -0
  113. package/dist/components/table/src/table/style-helper.d.ts +51 -0
  114. package/dist/components/table/src/table/style-helper.js +169 -0
  115. package/dist/components/table/src/table/utils-helper.d.ts +16 -0
  116. package/dist/components/table/src/table/utils-helper.js +36 -0
  117. package/dist/components/table/src/table-body/defaults.d.ts +39 -0
  118. package/dist/components/table/src/table-body/defaults.js +25 -0
  119. package/dist/components/table/src/table-body/events-helper.d.ts +19 -0
  120. package/dist/components/table/src/table-body/events-helper.js +126 -0
  121. package/dist/components/table/src/table-body/index.d.ts +84 -0
  122. package/dist/components/table/src/table-body/index.js +77 -0
  123. package/dist/components/table/src/table-body/render-helper.d.ts +18 -0
  124. package/dist/components/table/src/table-body/render-helper.js +188 -0
  125. package/dist/components/table/src/table-body/styles-helper.d.ts +15 -0
  126. package/dist/components/table/src/table-body/styles-helper.js +98 -0
  127. package/dist/components/table/src/table-body/td-wrapper.vue.d.ts +33 -0
  128. package/dist/components/table/src/table-body/td-wrapper.vue.js +26 -0
  129. package/dist/components/table/src/table-body/td-wrapper2.vue.js +4 -0
  130. package/dist/components/table/src/table-column/defaults.d.ts +348 -0
  131. package/dist/components/table/src/table-column/defaults.js +152 -0
  132. package/dist/components/table/src/table-column/index.d.ts +2 -0
  133. package/dist/components/table/src/table-column/index.vue.d.ts +32 -0
  134. package/dist/components/table/src/table-column/index.vue.js +161 -0
  135. package/dist/components/table/src/table-column/index2.vue.js +4 -0
  136. package/dist/components/table/src/table-column/render-helper.d.ts +17 -0
  137. package/dist/components/table/src/table-column/render-helper.js +116 -0
  138. package/dist/components/table/src/table-column/watcher-helper.d.ts +8 -0
  139. package/dist/components/table/src/table-column/watcher-helper.js +85 -0
  140. package/dist/components/table/src/table-footer/index.d.ts +79 -0
  141. package/dist/components/table/src/table-footer/index.js +110 -0
  142. package/dist/components/table/src/table-footer/mapState-helper.d.ts +9 -0
  143. package/dist/components/table/src/table-footer/mapState-helper.js +16 -0
  144. package/dist/components/table/src/table-footer/style-helper.d.ts +9 -0
  145. package/dist/components/table/src/table-footer/style-helper.js +42 -0
  146. package/dist/components/table/src/table-header/event-helper.d.ts +14 -0
  147. package/dist/components/table/src/table-header/event-helper.js +113 -0
  148. package/dist/components/table/src/table-header/index.d.ts +361 -0
  149. package/dist/components/table/src/table-header/index.js +255 -0
  150. package/dist/components/table/src/table-header/style.helper.d.ts +10 -0
  151. package/dist/components/table/src/table-header/style.helper.js +73 -0
  152. package/dist/components/table/src/table-header/utils-helper.d.ts +10 -0
  153. package/dist/components/table/src/table-header/utils-helper.js +45 -0
  154. package/dist/components/table/src/table-layout.d.ts +37 -0
  155. package/dist/components/table/src/table-layout.js +144 -0
  156. package/dist/components/table/src/table.vue.d.ts +734 -0
  157. package/dist/components/table/src/table.vue.js +443 -0
  158. package/dist/components/table/src/table2.vue.js +4 -0
  159. package/dist/components/table/src/tableColumn.d.ts +2 -0
  160. package/dist/components/table/src/tokens.d.ts +3 -0
  161. package/dist/components/table/src/tokens.js +4 -0
  162. package/dist/components/table/src/util.d.ts +55 -0
  163. package/dist/components/table/src/util.js +310 -0
  164. package/dist/components/table-column/index.d.ts +40 -3
  165. package/dist/components/table-column/index.js +6 -3
  166. package/dist/components/upload/index.d.ts +45 -2
  167. package/dist/components/upload/index.js +23 -4
  168. package/dist/components/upload/src/ajax.d.ts +9 -0
  169. package/dist/components/upload/src/ajax.js +58 -0
  170. package/dist/components/upload/src/constants.d.ts +5 -0
  171. package/dist/components/upload/src/constants.js +4 -0
  172. package/dist/components/upload/src/upload-content.d.ts +136 -0
  173. package/dist/components/upload/src/upload-content.js +53 -0
  174. package/dist/components/upload/src/upload-content.vue.d.ts +38 -0
  175. package/dist/components/upload/src/upload-content.vue.js +186 -0
  176. package/dist/components/upload/src/upload-content2.vue.js +4 -0
  177. package/dist/components/upload/src/upload-dragger.d.ts +22 -0
  178. package/dist/components/upload/src/upload-dragger.js +19 -0
  179. package/dist/components/upload/src/upload-dragger.vue.d.ts +19 -0
  180. package/dist/components/upload/src/upload-dragger.vue.js +91 -0
  181. package/dist/components/upload/src/upload-dragger2.vue.js +4 -0
  182. package/dist/components/upload/src/upload-list.d.ts +45 -0
  183. package/dist/components/upload/src/upload-list.js +39 -0
  184. package/dist/components/upload/src/upload-list.vue.d.ts +28 -0
  185. package/dist/components/upload/src/upload-list.vue.js +182 -0
  186. package/dist/components/upload/src/upload-list2.vue.js +4 -0
  187. package/dist/components/upload/src/upload.d.ts +361 -0
  188. package/dist/components/upload/src/upload.js +216 -0
  189. package/dist/components/upload/src/upload.vue.d.ts +64 -0
  190. package/dist/components/upload/src/upload.vue.js +150 -0
  191. package/dist/components/upload/src/upload2.vue.js +4 -0
  192. package/dist/components/upload/src/use-handlers.d.ts +60 -0
  193. package/dist/components/upload/src/use-handlers.js +111 -0
  194. package/dist/directives/mousewheel/index.js +28 -0
  195. package/dist/ep-craft.js +277 -236
  196. package/dist/index.d.ts +67 -0
  197. package/dist/utils/dom/event.js +12 -11
  198. package/dist/utils/objects.js +10 -9
  199. package/dist/utils/vue/install.js +21 -18
  200. package/dist/utils/vue/refs.js +8 -0
  201. package/dist/vendored-components.d.ts +1 -1
  202. package/dist/vendored-components.js +44 -4
  203. package/package.json +1 -1
  204. package/dist/components/dropdown-item/index.js +0 -6
  205. package/dist/components/dropdown-menu/index.js +0 -6
@@ -0,0 +1,348 @@
1
+ import type { ComponentInternalInstance, PropType, Ref, VNode } from 'vue';
2
+ import type { DefaultRow, Table, TableSortOrder } from '../table/defaults';
3
+ import type { TableOverflowTooltipFormatter, TableOverflowTooltipOptions } from '../util';
4
+ import type { Store } from '../store';
5
+ type CI<T extends DefaultRow> = {
6
+ column: TableColumnCtx<T>;
7
+ $index: number;
8
+ store: Store<T>;
9
+ _self: any;
10
+ };
11
+ type Filters = {
12
+ text: string;
13
+ value: string;
14
+ }[];
15
+ type FilterMethods<T extends DefaultRow> = (value: string, row: T, column: TableColumnCtx<T>) => void;
16
+ type ValueOf<T> = T[keyof T];
17
+ type TableColumnCtx<T extends DefaultRow = DefaultRow> = {
18
+ id: string;
19
+ realWidth: number | null;
20
+ type: string;
21
+ label: string;
22
+ className: string;
23
+ labelClassName: string;
24
+ property: string;
25
+ prop: string;
26
+ width?: string | number;
27
+ minWidth: string | number;
28
+ renderHeader: (data: CI<T>) => VNode;
29
+ sortable: boolean | string;
30
+ sortMethod: (a: T, b: T) => number;
31
+ sortBy: string | ((row: T, index: number, array?: T[]) => string) | string[];
32
+ resizable: boolean;
33
+ columnKey: string;
34
+ rawColumnKey: string;
35
+ align: string;
36
+ headerAlign: string;
37
+ showOverflowTooltip?: boolean | TableOverflowTooltipOptions;
38
+ tooltipFormatter?: TableOverflowTooltipFormatter<T>;
39
+ fixed: boolean | string;
40
+ formatter: (row: T, column: TableColumnCtx<T>, cellValue: any, index: number) => VNode | string;
41
+ selectable: (row: T, index: number) => boolean;
42
+ reserveSelection: boolean;
43
+ filterMethod: FilterMethods<T>;
44
+ filteredValue: string[];
45
+ filters: Filters;
46
+ filterPlacement: string;
47
+ filterMultiple: boolean;
48
+ filterClassName: string;
49
+ index: number | ((index: number) => number);
50
+ sortOrders: (TableSortOrder | null)[];
51
+ renderCell: (data: any) => VNode | VNode[];
52
+ colSpan: number;
53
+ rowSpan: number;
54
+ children?: TableColumnCtx<T>[];
55
+ level: number;
56
+ filterable: boolean | FilterMethods<T> | Filters;
57
+ order: TableSortOrder | null;
58
+ isColumnGroup: boolean;
59
+ isSubColumn: boolean;
60
+ columns: TableColumnCtx<T>[];
61
+ getColumnIndex: () => number;
62
+ no: number;
63
+ filterOpened?: boolean;
64
+ renderFilterIcon?: (scope: any) => VNode;
65
+ renderExpand?: (scope: any) => VNode;
66
+ };
67
+ interface TableColumn<T extends DefaultRow> extends ComponentInternalInstance {
68
+ vnode: {
69
+ vParent: TableColumn<T> | Table<T>;
70
+ } & VNode;
71
+ vParent: TableColumn<T> | Table<T>;
72
+ columnId: string;
73
+ columnConfig: Ref<Partial<TableColumnCtx<T>>>;
74
+ }
75
+ interface TableColumnProps<T extends DefaultRow = DefaultRow> {
76
+ /**
77
+ * @description type of the column. If set to `selection`, the column will display checkbox. If set to `index`, the column will display index of the row (staring from 1). If set to `expand`, the column will display expand icon
78
+ */
79
+ type?: string;
80
+ /**
81
+ * @description column label
82
+ */
83
+ label?: string;
84
+ /**
85
+ * @description class name of cells in the column
86
+ */
87
+ className?: string;
88
+ /**
89
+ * @description class name of the label of this column
90
+ */
91
+ labelClassName?: string;
92
+ /**
93
+ * @description
94
+ */
95
+ property?: string;
96
+ /**
97
+ * @description field name. You can also use its alias: `property`
98
+ */
99
+ prop?: string;
100
+ /**
101
+ * @description column width
102
+ */
103
+ width?: string | number;
104
+ /**
105
+ * @description column minimum width. Columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion
106
+ */
107
+ minWidth?: string | number;
108
+ /**
109
+ * @description render function for table header of this column
110
+ */
111
+ renderHeader?: TableColumnCtx<T>['renderHeader'];
112
+ /**
113
+ * @description whether column can be sorted. Remote sorting can be done by setting this attribute to 'custom' and listening to the `sort-change` event of Table
114
+ */
115
+ sortable?: boolean | string;
116
+ /**
117
+ * @description sorting method, works when `sortable` is `true`. Should return a number, just like Array.sort
118
+ */
119
+ sortMethod?: TableColumnCtx<T>['sortMethod'];
120
+ /**
121
+ * @description specify which property to sort by, works when `sortable` is `true` and `sort-method` is `undefined`. If set to an Array, the column will sequentially sort by the next property if the previous one is equal
122
+ */
123
+ sortBy?: TableColumnCtx<T>['sortBy'];
124
+ /**
125
+ * @description whether column width can be resized, works when `border` of `el-table` is `true`
126
+ */
127
+ resizable?: boolean;
128
+ /**
129
+ * @description column's key. If you need to use the filter-change event, you need this attribute to identify which column is being filtered
130
+ */
131
+ columnKey?: string;
132
+ /**
133
+ * @description alignment, the value should be 'left' \/ 'center' \/ 'right'
134
+ */
135
+ align?: string;
136
+ /**
137
+ * @description alignment of the table header. If omitted, the value of the above `align` attribute will be applied, the value should be 'left' \/ 'center' \/ 'right'
138
+ */
139
+ headerAlign?: string;
140
+ /**
141
+ * @description whether to hide extra content and show them in a tooltip when hovering on the cell
142
+ */
143
+ showOverflowTooltip?: TableColumnCtx<T>['showOverflowTooltip'];
144
+ /**
145
+ * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`
146
+ */
147
+ tooltipFormatter?: TableColumnCtx<T>['tooltipFormatter'];
148
+ /**
149
+ * @description whether column is fixed at left / right. Will be fixed at left if `true`
150
+ */
151
+ fixed?: boolean | string;
152
+ /**
153
+ * @description function that formats cell content
154
+ */
155
+ formatter?: TableColumnCtx<T>['formatter'];
156
+ /**
157
+ * @description function that determines if a certain row can be selected, works when `type` is 'selection'
158
+ */
159
+ selectable?: TableColumnCtx<T>['selectable'];
160
+ /**
161
+ * @description whether to reserve selection after data refreshing, works when `type` is 'selection'. Note that `row-key` is required for this to work
162
+ */
163
+ reserveSelection?: boolean;
164
+ /**
165
+ * @description data filtering method. If `filter-multiple` is on, this method will be called multiple times for each row, and a row will display if one of the calls returns `true`
166
+ */
167
+ filterMethod?: TableColumnCtx<T>['filterMethod'];
168
+ /**
169
+ * @description filter value for selected data, might be useful when table header is rendered with `render-header`
170
+ */
171
+ filteredValue?: TableColumnCtx<T>['filteredValue'];
172
+ /**
173
+ * @description an array of data filtering options. For each element in this array, `text` and `value` are required
174
+ */
175
+ filters?: TableColumnCtx<T>['filters'];
176
+ /**
177
+ * @description placement for the filter dropdown
178
+ */
179
+ filterPlacement?: string;
180
+ /**
181
+ * @description whether data filtering supports multiple options
182
+ */
183
+ filterMultiple?: boolean;
184
+ /**
185
+ * @description className for the filter dropdown
186
+ */
187
+ filterClassName?: string;
188
+ /**
189
+ * @description customize indices for each row, works on columns with `type=index`
190
+ */
191
+ index?: TableColumnCtx<T>['index'];
192
+ /**
193
+ * @description the order of the sorting strategies used when sorting the data, works when `sortable` is `true`. Accepts an array, as the user clicks on the header, the column is sorted in order of the elements in the array
194
+ */
195
+ sortOrders?: TableColumnCtx<T>['sortOrders'];
196
+ }
197
+ export type { Filters, FilterMethods, TableColumnCtx, TableColumn, TableColumnProps, ValueOf, };
198
+ /**
199
+ * @deprecated Removed after 3.0.0, Use `TableColumnProps` instead.
200
+ */
201
+ export declare const tableColumnProps: {
202
+ /**
203
+ * @description type of the column. If set to `selection`, the column will display checkbox. If set to `index`, the column will display index of the row (staring from 1). If set to `expand`, the column will display expand icon
204
+ */
205
+ type: {
206
+ type: StringConstructor;
207
+ default: string;
208
+ };
209
+ /**
210
+ * @description column label
211
+ */
212
+ label: StringConstructor;
213
+ /**
214
+ * @description class name of cells in the column
215
+ */
216
+ className: StringConstructor;
217
+ /**
218
+ * @description class name of the label of this column
219
+ */
220
+ labelClassName: StringConstructor;
221
+ /**
222
+ * @description
223
+ */
224
+ property: StringConstructor;
225
+ /**
226
+ * @description field name. You can also use its alias: `property`
227
+ */
228
+ prop: StringConstructor;
229
+ /**
230
+ * @description column width
231
+ */
232
+ width: {
233
+ type: (NumberConstructor | StringConstructor)[];
234
+ default: string;
235
+ };
236
+ /**
237
+ * @description column minimum width. Columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion
238
+ */
239
+ minWidth: {
240
+ type: (NumberConstructor | StringConstructor)[];
241
+ default: string;
242
+ };
243
+ /**
244
+ * @description render function for table header of this column
245
+ */
246
+ renderHeader: PropType<TableColumnCtx<any>["renderHeader"]>;
247
+ /**
248
+ * @description whether column can be sorted. Remote sorting can be done by setting this attribute to 'custom' and listening to the `sort-change` event of Table
249
+ */
250
+ sortable: {
251
+ type: (BooleanConstructor | StringConstructor)[];
252
+ default: boolean;
253
+ };
254
+ /**
255
+ * @description sorting method, works when `sortable` is `true`. Should return a number, just like Array.sort
256
+ */
257
+ sortMethod: PropType<TableColumnCtx<any>["sortMethod"]>;
258
+ /**
259
+ * @description specify which property to sort by, works when `sortable` is `true` and `sort-method` is `undefined`. If set to an Array, the column will sequentially sort by the next property if the previous one is equal
260
+ */
261
+ sortBy: PropType<TableColumnCtx<any>["sortBy"]>;
262
+ /**
263
+ * @description whether column width can be resized, works when `border` of `el-table` is `true`
264
+ */
265
+ resizable: {
266
+ type: BooleanConstructor;
267
+ default: boolean;
268
+ };
269
+ /**
270
+ * @description column's key. If you need to use the filter-change event, you need this attribute to identify which column is being filtered
271
+ */
272
+ columnKey: StringConstructor;
273
+ /**
274
+ * @description alignment, the value should be 'left' \/ 'center' \/ 'right'
275
+ */
276
+ align: StringConstructor;
277
+ /**
278
+ * @description alignment of the table header. If omitted, the value of the above `align` attribute will be applied, the value should be 'left' \/ 'center' \/ 'right'
279
+ */
280
+ headerAlign: StringConstructor;
281
+ /**
282
+ * @description whether to hide extra content and show them in a tooltip when hovering on the cell
283
+ */
284
+ showOverflowTooltip: {
285
+ type: PropType<TableColumnCtx<any>["showOverflowTooltip"]>;
286
+ default: undefined;
287
+ };
288
+ /**
289
+ * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`
290
+ */
291
+ tooltipFormatter: PropType<TableColumnCtx<any>["tooltipFormatter"]>;
292
+ /**
293
+ * @description whether column is fixed at left / right. Will be fixed at left if `true`
294
+ */
295
+ fixed: (BooleanConstructor | StringConstructor)[];
296
+ /**
297
+ * @description function that formats cell content
298
+ */
299
+ formatter: PropType<TableColumnCtx<any>["formatter"]>;
300
+ /**
301
+ * @description function that determines if a certain row can be selected, works when `type` is 'selection'
302
+ */
303
+ selectable: PropType<TableColumnCtx<any>["selectable"]>;
304
+ /**
305
+ * @description whether to reserve selection after data refreshing, works when `type` is 'selection'. Note that `row-key` is required for this to work
306
+ */
307
+ reserveSelection: BooleanConstructor;
308
+ /**
309
+ * @description data filtering method. If `filter-multiple` is on, this method will be called multiple times for each row, and a row will display if one of the calls returns `true`
310
+ */
311
+ filterMethod: PropType<TableColumnCtx<any>["filterMethod"]>;
312
+ /**
313
+ * @description filter value for selected data, might be useful when table header is rendered with `render-header`
314
+ */
315
+ filteredValue: PropType<TableColumnCtx<any>["filteredValue"]>;
316
+ /**
317
+ * @description an array of data filtering options. For each element in this array, `text` and `value` are required
318
+ */
319
+ filters: PropType<TableColumnCtx<any>["filters"]>;
320
+ /**
321
+ * @description placement for the filter dropdown
322
+ */
323
+ filterPlacement: StringConstructor;
324
+ /**
325
+ * @description whether data filtering supports multiple options
326
+ */
327
+ filterMultiple: {
328
+ type: BooleanConstructor;
329
+ default: boolean;
330
+ };
331
+ /**
332
+ * @description className for the filter dropdown
333
+ */
334
+ filterClassName: StringConstructor;
335
+ /**
336
+ * @description customize indices for each row, works on columns with `type=index`
337
+ */
338
+ index: PropType<TableColumnCtx<any>["index"]>;
339
+ /**
340
+ * @description the order of the sorting strategies used when sorting the data, works when `sortable` is `true`. Accepts an array, as the user clicks on the header, the column is sorted in order of the elements in the array
341
+ */
342
+ sortOrders: {
343
+ type: PropType<TableColumnCtx<any>["sortOrders"]>;
344
+ default: () => (string | null)[];
345
+ validator: (val: TableColumnCtx<any>["sortOrders"]) => boolean;
346
+ };
347
+ };
348
+ export default tableColumnProps;
@@ -0,0 +1,152 @@
1
+ const r = {
2
+ /**
3
+ * @description type of the column. If set to `selection`, the column will display checkbox. If set to `index`, the column will display index of the row (staring from 1). If set to `expand`, the column will display expand icon
4
+ */
5
+ type: {
6
+ type: String,
7
+ default: "default"
8
+ },
9
+ /**
10
+ * @description column label
11
+ */
12
+ label: String,
13
+ /**
14
+ * @description class name of cells in the column
15
+ */
16
+ className: String,
17
+ /**
18
+ * @description class name of the label of this column
19
+ */
20
+ labelClassName: String,
21
+ /**
22
+ * @description
23
+ */
24
+ property: String,
25
+ /**
26
+ * @description field name. You can also use its alias: `property`
27
+ */
28
+ prop: String,
29
+ /**
30
+ * @description column width
31
+ */
32
+ width: {
33
+ type: [String, Number],
34
+ default: ""
35
+ },
36
+ /**
37
+ * @description column minimum width. Columns with `width` has a fixed width, while columns with `min-width` has a width that is distributed in proportion
38
+ */
39
+ minWidth: {
40
+ type: [String, Number],
41
+ default: ""
42
+ },
43
+ /**
44
+ * @description render function for table header of this column
45
+ */
46
+ renderHeader: Function,
47
+ /**
48
+ * @description whether column can be sorted. Remote sorting can be done by setting this attribute to 'custom' and listening to the `sort-change` event of Table
49
+ */
50
+ sortable: {
51
+ type: [Boolean, String],
52
+ default: !1
53
+ },
54
+ /**
55
+ * @description sorting method, works when `sortable` is `true`. Should return a number, just like Array.sort
56
+ */
57
+ sortMethod: Function,
58
+ /**
59
+ * @description specify which property to sort by, works when `sortable` is `true` and `sort-method` is `undefined`. If set to an Array, the column will sequentially sort by the next property if the previous one is equal
60
+ */
61
+ sortBy: [String, Function, Array],
62
+ /**
63
+ * @description whether column width can be resized, works when `border` of `el-table` is `true`
64
+ */
65
+ resizable: {
66
+ type: Boolean,
67
+ default: !0
68
+ },
69
+ /**
70
+ * @description column's key. If you need to use the filter-change event, you need this attribute to identify which column is being filtered
71
+ */
72
+ columnKey: String,
73
+ /**
74
+ * @description alignment, the value should be 'left' \/ 'center' \/ 'right'
75
+ */
76
+ align: String,
77
+ /**
78
+ * @description alignment of the table header. If omitted, the value of the above `align` attribute will be applied, the value should be 'left' \/ 'center' \/ 'right'
79
+ */
80
+ headerAlign: String,
81
+ /**
82
+ * @description whether to hide extra content and show them in a tooltip when hovering on the cell
83
+ */
84
+ showOverflowTooltip: {
85
+ type: [Boolean, Object],
86
+ default: void 0
87
+ },
88
+ /**
89
+ * @description function that formats cell tooltip content, works when `show-overflow-tooltip` is `true`
90
+ */
91
+ tooltipFormatter: Function,
92
+ /**
93
+ * @description whether column is fixed at left / right. Will be fixed at left if `true`
94
+ */
95
+ fixed: [Boolean, String],
96
+ /**
97
+ * @description function that formats cell content
98
+ */
99
+ formatter: Function,
100
+ /**
101
+ * @description function that determines if a certain row can be selected, works when `type` is 'selection'
102
+ */
103
+ selectable: Function,
104
+ /**
105
+ * @description whether to reserve selection after data refreshing, works when `type` is 'selection'. Note that `row-key` is required for this to work
106
+ */
107
+ reserveSelection: Boolean,
108
+ /**
109
+ * @description data filtering method. If `filter-multiple` is on, this method will be called multiple times for each row, and a row will display if one of the calls returns `true`
110
+ */
111
+ filterMethod: Function,
112
+ /**
113
+ * @description filter value for selected data, might be useful when table header is rendered with `render-header`
114
+ */
115
+ filteredValue: Array,
116
+ /**
117
+ * @description an array of data filtering options. For each element in this array, `text` and `value` are required
118
+ */
119
+ filters: Array,
120
+ /**
121
+ * @description placement for the filter dropdown
122
+ */
123
+ filterPlacement: String,
124
+ /**
125
+ * @description whether data filtering supports multiple options
126
+ */
127
+ filterMultiple: {
128
+ type: Boolean,
129
+ default: !0
130
+ },
131
+ /**
132
+ * @description className for the filter dropdown
133
+ */
134
+ filterClassName: String,
135
+ /**
136
+ * @description customize indices for each row, works on columns with `type=index`
137
+ */
138
+ index: [Number, Function],
139
+ /**
140
+ * @description the order of the sorting strategies used when sorting the data, works when `sortable` is `true`. Accepts an array, as the user clicks on the header, the column is sorted in order of the elements in the array
141
+ */
142
+ sortOrders: {
143
+ type: Array,
144
+ default: () => ["ascending", "descending", null],
145
+ validator: (e) => e.every(
146
+ (t) => ["ascending", "descending", null].includes(t)
147
+ )
148
+ }
149
+ };
150
+ export {
151
+ r as tableColumnProps
152
+ };
@@ -0,0 +1,2 @@
1
+ import ElTableColumn from './index.vue';
2
+ export default ElTableColumn;
@@ -0,0 +1,32 @@
1
+ import type { TableColumnCtx, TableColumnProps } from './defaults';
2
+ import type { DefaultRow } from '../table/defaults';
3
+ declare const _default: <T extends DefaultRow = DefaultRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & TableColumnProps<T> & Partial<{}>> & import("vue").PublicProps;
5
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
6
+ attrs: any;
7
+ slots: {
8
+ default?: (props: {
9
+ row: T;
10
+ column: TableColumnCtx<T>;
11
+ $index: number;
12
+ }) => any;
13
+ header?: (props: {
14
+ column: TableColumnCtx<T>;
15
+ $index: number;
16
+ }) => any;
17
+ expand?: (props: {
18
+ expanded: boolean;
19
+ expandable: boolean;
20
+ }) => any;
21
+ 'filter-icon'?: (props: {
22
+ filterOpened: boolean;
23
+ }) => any;
24
+ };
25
+ emit: {};
26
+ }>) => import("vue").VNode & {
27
+ __ctx?: Awaited<typeof __VLS_setup>;
28
+ };
29
+ export default _default;
30
+ type __VLS_PrettifyLocal<T> = {
31
+ [K in keyof T]: T[K];
32
+ } & {};
@@ -0,0 +1,161 @@
1
+ import { defineComponent as k, useSlots as H, getCurrentInstance as K, ref as R, computed as V, onBeforeMount as z, onMounted as D, onBeforeUnmount as G, openBlock as U, createBlock as j, Fragment as $, h as x } from "vue";
2
+ import "../../../config-provider/index.js";
3
+ import { isUndefined as I } from "../../../../utils/types.js";
4
+ import "lodash-unified";
5
+ import "@vueuse/core";
6
+ import { isArray as w, isString as q } from "@vue/shared";
7
+ import "@element-plus/icons-vue";
8
+ import { cellStarts as J } from "../config.js";
9
+ import { createTableColumnId as L, mergeOptions as Q, compose as X } from "../util.js";
10
+ import Y from "./watcher-helper.js";
11
+ import Z from "./render-helper.js";
12
+ import { useGlobalConfig as ee } from "../../../config-provider/src/hooks/use-global-config.js";
13
+ const Ce = /* @__PURE__ */ k({
14
+ // 上游为 'ElTableColumn';本仓自持组件统一以 Ep* 命名(见文件头注释第 1 处差异)。
15
+ name: "EpTableColumn",
16
+ __name: "index",
17
+ props: {
18
+ type: { default: "default" },
19
+ label: {},
20
+ className: {},
21
+ labelClassName: {},
22
+ property: {},
23
+ prop: {},
24
+ width: { default: "" },
25
+ minWidth: { default: "" },
26
+ renderHeader: {},
27
+ sortable: { type: [Boolean, String], default: !1 },
28
+ sortMethod: {},
29
+ sortBy: {},
30
+ resizable: { type: Boolean, default: !0 },
31
+ columnKey: {},
32
+ align: {},
33
+ headerAlign: {},
34
+ showOverflowTooltip: { type: [Boolean, Object], default: void 0 },
35
+ tooltipFormatter: {},
36
+ fixed: { type: [Boolean, String] },
37
+ formatter: {},
38
+ selectable: {},
39
+ reserveSelection: { type: Boolean },
40
+ filterMethod: {},
41
+ filteredValue: {},
42
+ filters: {},
43
+ filterPlacement: {},
44
+ filterMultiple: { type: Boolean, default: !0 },
45
+ filterClassName: {},
46
+ index: {},
47
+ sortOrders: { default: () => ["ascending", "descending", null] }
48
+ },
49
+ setup(O) {
50
+ const t = O, d = H(), c = K(), C = ee("table"), s = R({}), m = V(() => {
51
+ let e = c.parent;
52
+ for (; e && !e.tableId; )
53
+ e = e.parent;
54
+ return e;
55
+ }), { registerNormalWatchers: P, registerComplexWatchers: T } = Y(
56
+ m,
57
+ t
58
+ ), {
59
+ columnId: h,
60
+ isSubColumn: f,
61
+ realHeaderAlign: B,
62
+ columnOrTableParent: g,
63
+ setColumnWidth: F,
64
+ setColumnForcedProps: M,
65
+ setColumnRenders: N,
66
+ getPropsData: S,
67
+ getColumnElIndex: _,
68
+ realAlign: A,
69
+ updateColumnOrder: b
70
+ } = Z(t, d, m), l = g.value, E = "tableId" in l ? l.tableId : l.columnId;
71
+ h.value = L(E), z(() => {
72
+ var v, y;
73
+ f.value = m.value !== l;
74
+ const e = t.type || "default", r = t.sortable === "" ? !0 : t.sortable, a = e === "selection" ? !1 : I(t.showOverflowTooltip) ? l.props.showOverflowTooltip ?? ((v = C.value) == null ? void 0 : v.showOverflowTooltip) : t.showOverflowTooltip, i = I(t.tooltipFormatter) ? l.props.tooltipFormatter ?? ((y = C.value) == null ? void 0 : y.tooltipFormatter) : t.tooltipFormatter, o = {
75
+ ...J[e],
76
+ id: h.value,
77
+ type: e,
78
+ property: t.prop || t.property,
79
+ align: A,
80
+ headerAlign: B,
81
+ showOverflowTooltip: a,
82
+ tooltipFormatter: i,
83
+ // filter 相关属性
84
+ filterable: t.filters || t.filterMethod,
85
+ filteredValue: [],
86
+ filterPlacement: "",
87
+ filterClassName: "",
88
+ isColumnGroup: !1,
89
+ isSubColumn: !1,
90
+ filterOpened: !1,
91
+ // sort 相关属性
92
+ sortable: r,
93
+ // index 列
94
+ index: t.index,
95
+ // <el-table-column key="xxx" />
96
+ rawColumnKey: c.vnode.key
97
+ };
98
+ let p = S([
99
+ "columnKey",
100
+ "label",
101
+ "className",
102
+ "labelClassName",
103
+ "type",
104
+ "renderHeader",
105
+ "formatter",
106
+ "fixed",
107
+ "resizable"
108
+ ], ["sortMethod", "sortBy", "sortOrders"], ["selectable", "reserveSelection"], [
109
+ "filterMethod",
110
+ "filters",
111
+ "filterMultiple",
112
+ "filterOpened",
113
+ "filteredValue",
114
+ "filterPlacement",
115
+ "filterClassName"
116
+ ]);
117
+ p = Q(o, p), p = X(N, F, M)(p), s.value = p, P(), T();
118
+ }), D(() => {
119
+ var o, u;
120
+ const e = g.value, r = f.value ? (o = e.vnode.el) == null ? void 0 : o.children : (u = e.refs.hiddenColumns) == null ? void 0 : u.children, a = () => _(r || [], c.vnode.el);
121
+ s.value.getColumnIndex = a, a() > -1 && m.value.store.commit(
122
+ "insertColumn",
123
+ s.value,
124
+ f.value ? "columnConfig" in e && e.columnConfig.value : null,
125
+ b
126
+ );
127
+ }), G(() => {
128
+ const e = s.value.getColumnIndex;
129
+ (e ? e() : -1) > -1 && m.value.store.commit(
130
+ "removeColumn",
131
+ s.value,
132
+ f.value ? "columnConfig" in l && l.columnConfig.value : null,
133
+ b
134
+ );
135
+ }), c.columnId = h.value, c.columnConfig = s;
136
+ const W = () => {
137
+ var e, r;
138
+ try {
139
+ const a = (e = d.default) == null ? void 0 : e.call(d, {
140
+ row: {},
141
+ column: {},
142
+ $index: -1
143
+ }), i = [];
144
+ if (w(a))
145
+ for (const o of a) {
146
+ const u = (r = o.type) == null ? void 0 : r.name;
147
+ u === "EpTableColumn" || u === "ElTableColumn" || o.shapeFlag & 2 ? i.push(o) : o.type === $ && w(o.children) && o.children.forEach((n) => {
148
+ (n == null ? void 0 : n.patchFlag) !== 1024 && !q(n == null ? void 0 : n.children) && i.push(n);
149
+ });
150
+ }
151
+ return x("div", i);
152
+ } catch {
153
+ return x("div", []);
154
+ }
155
+ };
156
+ return (e, r) => (U(), j(W));
157
+ }
158
+ });
159
+ export {
160
+ Ce as default
161
+ };