ele-admin-plus 1.1.3 → 1.1.4-beta.1

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 (269) hide show
  1. package/es/ele-alert/index.d.ts +10 -10
  2. package/es/ele-alert/props.d.ts +6 -6
  3. package/es/ele-app/style/message.scss +1 -0
  4. package/es/ele-app/style/overwrite.scss +79 -3
  5. package/es/ele-app/types/index.d.ts +7 -6
  6. package/es/ele-avatar-group/index.d.ts +7 -8
  7. package/es/ele-avatar-group/props.d.ts +3 -4
  8. package/es/ele-basic-select/style/index.scss +4 -6
  9. package/es/ele-bottom-bar/index.d.ts +4 -4
  10. package/es/ele-bottom-bar/props.d.ts +2 -3
  11. package/es/ele-card/index.d.ts +6 -6
  12. package/es/ele-card/props.d.ts +3 -4
  13. package/es/ele-check-card/components/card-item.d.ts +2 -3
  14. package/es/ele-check-card/index.d.ts +4 -4
  15. package/es/ele-check-card/props.d.ts +3 -3
  16. package/es/ele-config-provider/receiver.d.ts +1 -1
  17. package/es/ele-config-provider/receiver.js +29 -29
  18. package/es/ele-copyable/index.d.ts +8 -8
  19. package/es/ele-copyable/index.js +5 -4
  20. package/es/ele-copyable/props.d.ts +5 -5
  21. package/es/ele-copyable/style/index.scss +4 -0
  22. package/es/ele-cropper/index.js +2 -2
  23. package/es/ele-dashboard/index.d.ts +1 -2
  24. package/es/ele-drawer/index.d.ts +16 -10
  25. package/es/ele-drawer/props.d.ts +7 -6
  26. package/es/ele-dropdown/index.d.ts +2 -2
  27. package/es/ele-dropdown/props.d.ts +1 -2
  28. package/es/ele-edit-tag/index.d.ts +4 -4
  29. package/es/ele-edit-tag/props.d.ts +2 -3
  30. package/es/ele-ellipsis/index.d.ts +4 -5
  31. package/es/ele-ellipsis/props.d.ts +1 -1
  32. package/es/ele-ellipsis/style/index.scss +4 -0
  33. package/es/ele-file-list/index.d.ts +2 -7
  34. package/es/ele-file-list/index.js +2 -2
  35. package/es/ele-file-list/types/index.d.ts +0 -4
  36. package/es/ele-icon-select/components/icon-grid.d.ts +5 -5
  37. package/es/ele-icon-select/components/icon-popper.d.ts +15 -15
  38. package/es/ele-icon-select/index.d.ts +15 -16
  39. package/es/ele-icon-select/props.d.ts +8 -8
  40. package/es/ele-loading/index.d.ts +26 -1
  41. package/es/ele-loading/index.js +53 -11
  42. package/es/ele-loading/props.d.ts +11 -1
  43. package/es/ele-loading/props.js +16 -1
  44. package/es/ele-loading/style/css-var.scss +7 -0
  45. package/es/ele-loading/style/index.js +1 -0
  46. package/es/ele-loading/style/index.scss +90 -0
  47. package/es/ele-loading/types/index.d.ts +17 -0
  48. package/es/ele-map-picker/components/map-view.d.ts +2 -2
  49. package/es/ele-map-picker/index.d.ts +2 -2
  50. package/es/ele-map-picker/props.d.ts +3 -3
  51. package/es/ele-menus/index.d.ts +2 -0
  52. package/es/ele-menus/index.js +11 -5
  53. package/es/ele-menus/props.d.ts +10 -0
  54. package/es/ele-menus/props.js +7 -1
  55. package/es/ele-menus/style/index.scss +18 -18
  56. package/es/ele-menus/types/index.d.ts +4 -0
  57. package/es/ele-menus/util.d.ts +4 -3
  58. package/es/ele-menus/util.js +23 -12
  59. package/es/ele-modal/index.d.ts +19 -13
  60. package/es/ele-modal/props.d.ts +8 -7
  61. package/es/ele-modal/util.js +2 -2
  62. package/es/ele-pagination/index.d.ts +1 -1
  63. package/es/ele-popconfirm/index.d.ts +10 -10
  64. package/es/ele-popconfirm/index.js +8 -2
  65. package/es/ele-popconfirm/props.d.ts +6 -6
  66. package/es/ele-popover/index.d.ts +6 -6
  67. package/es/ele-popover/props.d.ts +3 -4
  68. package/es/ele-printer/index.d.ts +6 -6
  69. package/es/ele-printer/props.d.ts +3 -4
  70. package/es/ele-pro-layout/components/pro-header.d.ts +7 -2
  71. package/es/ele-pro-layout/components/pro-header.js +15 -5
  72. package/es/ele-pro-layout/components/pro-iframe.js +10 -7
  73. package/es/ele-pro-layout/components/pro-sidebar.d.ts +7 -2
  74. package/es/ele-pro-layout/components/pro-sidebar.js +14 -5
  75. package/es/ele-pro-layout/components/pro-sidebox.d.ts +11 -4
  76. package/es/ele-pro-layout/components/pro-sidebox.js +16 -5
  77. package/es/ele-pro-layout/components/tab-dropdown.js +1 -4
  78. package/es/ele-pro-layout/index.d.ts +17 -3
  79. package/es/ele-pro-layout/index.js +208 -105
  80. package/es/ele-pro-layout/props.d.ts +6 -1
  81. package/es/ele-pro-layout/props.js +10 -0
  82. package/es/ele-pro-layout/style/collapse.scss +9 -10
  83. package/es/ele-pro-layout/style/index.js +0 -1
  84. package/es/ele-pro-layout/types/index.d.ts +9 -0
  85. package/es/ele-pro-layout/util.d.ts +4 -2
  86. package/es/ele-pro-layout/util.js +20 -17
  87. package/es/ele-pro-table/components/table-view.d.ts +9 -3
  88. package/es/ele-pro-table/components/table-view.js +27 -24
  89. package/es/ele-pro-table/components/tool-column.d.ts +2 -1
  90. package/es/ele-pro-table/components/tool-column.js +26 -18
  91. package/es/ele-pro-table/index.d.ts +46 -25
  92. package/es/ele-pro-table/index.js +182 -196
  93. package/es/ele-pro-table/props.d.ts +27 -15
  94. package/es/ele-pro-table/props.js +15 -3
  95. package/es/ele-pro-table/style/index.js +1 -1
  96. package/es/ele-pro-table/style/index.scss +64 -8
  97. package/es/ele-pro-table/types/index.d.ts +39 -5
  98. package/es/ele-pro-table/util.d.ts +84 -49
  99. package/es/ele-pro-table/util.js +193 -78
  100. package/es/ele-qr-code/index.d.ts +3 -3
  101. package/es/ele-qr-code/props.d.ts +1 -2
  102. package/es/ele-qr-code-svg/index.d.ts +3 -3
  103. package/es/ele-split-panel/index.d.ts +6 -6
  104. package/es/ele-split-panel/props.d.ts +3 -4
  105. package/es/ele-table/style/index.scss +1 -0
  106. package/es/ele-tabs/index.js +3 -3
  107. package/es/ele-tabs/types/index.d.ts +3 -0
  108. package/es/ele-text/index.d.ts +3 -3
  109. package/es/ele-text/props.d.ts +2 -2
  110. package/es/ele-toolbar/index.d.ts +6 -6
  111. package/es/ele-toolbar/props.d.ts +3 -4
  112. package/es/ele-tooltip/index.d.ts +3 -3
  113. package/es/ele-tooltip/props.d.ts +1 -2
  114. package/es/ele-tour/index.d.ts +2 -3
  115. package/es/ele-tour/style/index.scss +1 -1
  116. package/es/ele-tour/util.js +3 -3
  117. package/es/ele-upload-list/index.d.ts +8 -7
  118. package/es/ele-upload-list/index.js +18 -11
  119. package/es/ele-upload-list/props.d.ts +4 -4
  120. package/es/ele-upload-list/props.js +1 -1
  121. package/es/ele-watermark/index.d.ts +16 -8
  122. package/es/ele-watermark/index.js +18 -12
  123. package/es/ele-watermark/props.d.ts +3 -1
  124. package/es/ele-watermark/props.js +5 -1
  125. package/es/ele-watermark/util.js +1 -1
  126. package/es/style/index.scss +1 -0
  127. package/es/style/nprogress.scss +2 -2
  128. package/es/style/themes/default.scss +36 -12
  129. package/es/style/themes/rounded.scss +4 -2
  130. package/es/style/themes/theme-util.scss +2 -0
  131. package/es/utils/core.d.ts +1 -1
  132. package/es/utils/core.js +17 -15
  133. package/es/utils/resolvers.js +2 -2
  134. package/lib/ele-alert/index.d.ts +10 -10
  135. package/lib/ele-alert/props.d.ts +6 -6
  136. package/lib/ele-app/style/message.scss +1 -0
  137. package/lib/ele-app/style/overwrite.scss +79 -3
  138. package/lib/ele-app/types/index.d.ts +7 -6
  139. package/lib/ele-avatar-group/index.d.ts +7 -8
  140. package/lib/ele-avatar-group/props.d.ts +3 -4
  141. package/lib/ele-basic-select/style/index.scss +4 -6
  142. package/lib/ele-bottom-bar/index.d.ts +4 -4
  143. package/lib/ele-bottom-bar/props.d.ts +2 -3
  144. package/lib/ele-card/index.d.ts +6 -6
  145. package/lib/ele-card/props.d.ts +3 -4
  146. package/lib/ele-check-card/components/card-item.d.ts +2 -3
  147. package/lib/ele-check-card/index.d.ts +4 -4
  148. package/lib/ele-check-card/props.d.ts +3 -3
  149. package/lib/ele-config-provider/receiver.d.ts +1 -1
  150. package/lib/ele-config-provider/receiver.js +2 -2
  151. package/lib/ele-copyable/index.d.ts +8 -8
  152. package/lib/ele-copyable/index.js +4 -3
  153. package/lib/ele-copyable/props.d.ts +5 -5
  154. package/lib/ele-copyable/style/index.scss +4 -0
  155. package/lib/ele-cropper/index.js +2 -2
  156. package/lib/ele-dashboard/index.d.ts +1 -2
  157. package/lib/ele-drawer/index.d.ts +16 -10
  158. package/lib/ele-drawer/props.d.ts +7 -6
  159. package/lib/ele-dropdown/index.d.ts +2 -2
  160. package/lib/ele-dropdown/props.d.ts +1 -2
  161. package/lib/ele-edit-tag/index.d.ts +4 -4
  162. package/lib/ele-edit-tag/props.d.ts +2 -3
  163. package/lib/ele-ellipsis/index.d.ts +4 -5
  164. package/lib/ele-ellipsis/props.d.ts +1 -1
  165. package/lib/ele-ellipsis/style/index.scss +4 -0
  166. package/lib/ele-file-list/index.d.ts +2 -7
  167. package/lib/ele-file-list/index.js +2 -2
  168. package/lib/ele-file-list/types/index.d.ts +0 -4
  169. package/lib/ele-icon-select/components/icon-grid.d.ts +5 -5
  170. package/lib/ele-icon-select/components/icon-popper.d.ts +15 -15
  171. package/lib/ele-icon-select/index.d.ts +15 -16
  172. package/lib/ele-icon-select/props.d.ts +8 -8
  173. package/lib/ele-loading/index.d.ts +26 -1
  174. package/lib/ele-loading/index.js +52 -10
  175. package/lib/ele-loading/props.d.ts +11 -1
  176. package/lib/ele-loading/props.js +16 -1
  177. package/lib/ele-loading/style/css-var.scss +7 -0
  178. package/lib/ele-loading/style/index.js +1 -0
  179. package/lib/ele-loading/style/index.scss +90 -0
  180. package/lib/ele-loading/types/index.d.ts +17 -0
  181. package/lib/ele-map-picker/components/map-view.d.ts +2 -2
  182. package/lib/ele-map-picker/index.d.ts +2 -2
  183. package/lib/ele-map-picker/props.d.ts +3 -3
  184. package/lib/ele-menus/index.d.ts +2 -0
  185. package/lib/ele-menus/index.js +9 -3
  186. package/lib/ele-menus/props.d.ts +10 -0
  187. package/lib/ele-menus/props.js +6 -0
  188. package/lib/ele-menus/style/index.scss +18 -18
  189. package/lib/ele-menus/types/index.d.ts +4 -0
  190. package/lib/ele-menus/util.d.ts +4 -3
  191. package/lib/ele-menus/util.js +23 -12
  192. package/lib/ele-modal/index.d.ts +19 -13
  193. package/lib/ele-modal/props.d.ts +8 -7
  194. package/lib/ele-modal/util.js +2 -2
  195. package/lib/ele-pagination/index.d.ts +1 -1
  196. package/lib/ele-popconfirm/index.d.ts +10 -10
  197. package/lib/ele-popconfirm/index.js +8 -2
  198. package/lib/ele-popconfirm/props.d.ts +6 -6
  199. package/lib/ele-popover/index.d.ts +6 -6
  200. package/lib/ele-popover/props.d.ts +3 -4
  201. package/lib/ele-printer/index.d.ts +6 -6
  202. package/lib/ele-printer/props.d.ts +3 -4
  203. package/lib/ele-pro-layout/components/pro-header.d.ts +7 -2
  204. package/lib/ele-pro-layout/components/pro-header.js +15 -5
  205. package/lib/ele-pro-layout/components/pro-iframe.js +10 -7
  206. package/lib/ele-pro-layout/components/pro-sidebar.d.ts +7 -2
  207. package/lib/ele-pro-layout/components/pro-sidebar.js +14 -5
  208. package/lib/ele-pro-layout/components/pro-sidebox.d.ts +11 -4
  209. package/lib/ele-pro-layout/components/pro-sidebox.js +16 -5
  210. package/lib/ele-pro-layout/components/tab-dropdown.js +1 -4
  211. package/lib/ele-pro-layout/index.d.ts +17 -3
  212. package/lib/ele-pro-layout/index.js +205 -102
  213. package/lib/ele-pro-layout/props.d.ts +6 -1
  214. package/lib/ele-pro-layout/props.js +10 -0
  215. package/lib/ele-pro-layout/style/collapse.scss +9 -10
  216. package/lib/ele-pro-layout/style/index.js +0 -1
  217. package/lib/ele-pro-layout/types/index.d.ts +9 -0
  218. package/lib/ele-pro-layout/util.d.ts +4 -2
  219. package/lib/ele-pro-layout/util.js +19 -16
  220. package/lib/ele-pro-table/components/table-view.d.ts +9 -3
  221. package/lib/ele-pro-table/components/table-view.js +25 -22
  222. package/lib/ele-pro-table/components/tool-column.d.ts +2 -1
  223. package/lib/ele-pro-table/components/tool-column.js +25 -17
  224. package/lib/ele-pro-table/index.d.ts +46 -25
  225. package/lib/ele-pro-table/index.js +180 -194
  226. package/lib/ele-pro-table/props.d.ts +27 -15
  227. package/lib/ele-pro-table/props.js +15 -3
  228. package/lib/ele-pro-table/style/index.js +1 -1
  229. package/lib/ele-pro-table/style/index.scss +64 -8
  230. package/lib/ele-pro-table/types/index.d.ts +39 -5
  231. package/lib/ele-pro-table/util.d.ts +84 -49
  232. package/lib/ele-pro-table/util.js +192 -77
  233. package/lib/ele-qr-code/index.d.ts +3 -3
  234. package/lib/ele-qr-code/props.d.ts +1 -2
  235. package/lib/ele-qr-code-svg/index.d.ts +3 -3
  236. package/lib/ele-split-panel/index.d.ts +6 -6
  237. package/lib/ele-split-panel/props.d.ts +3 -4
  238. package/lib/ele-table/style/index.scss +1 -0
  239. package/lib/ele-tabs/index.js +3 -3
  240. package/lib/ele-tabs/types/index.d.ts +3 -0
  241. package/lib/ele-text/index.d.ts +3 -3
  242. package/lib/ele-text/props.d.ts +2 -2
  243. package/lib/ele-toolbar/index.d.ts +6 -6
  244. package/lib/ele-toolbar/props.d.ts +3 -4
  245. package/lib/ele-tooltip/index.d.ts +3 -3
  246. package/lib/ele-tooltip/props.d.ts +1 -2
  247. package/lib/ele-tour/index.d.ts +2 -3
  248. package/lib/ele-tour/style/index.scss +1 -1
  249. package/lib/ele-tour/util.js +3 -3
  250. package/lib/ele-upload-list/index.d.ts +8 -7
  251. package/lib/ele-upload-list/index.js +17 -10
  252. package/lib/ele-upload-list/props.d.ts +4 -4
  253. package/lib/ele-upload-list/props.js +1 -1
  254. package/lib/ele-watermark/index.d.ts +16 -8
  255. package/lib/ele-watermark/index.js +17 -11
  256. package/lib/ele-watermark/props.d.ts +3 -1
  257. package/lib/ele-watermark/props.js +5 -1
  258. package/lib/ele-watermark/util.js +1 -1
  259. package/lib/style/index.scss +1 -0
  260. package/lib/style/nprogress.scss +2 -2
  261. package/lib/style/themes/default.scss +36 -12
  262. package/lib/style/themes/rounded.scss +4 -2
  263. package/lib/style/themes/theme-util.scss +2 -0
  264. package/lib/utils/core.d.ts +1 -1
  265. package/lib/utils/core.js +17 -15
  266. package/lib/utils/resolvers.js +2 -2
  267. package/package.json +26 -24
  268. package/es/ele-alert/types/index.d.ts +0 -0
  269. package/lib/ele-alert/types/index.d.ts +0 -0
@@ -1,4 +1,33 @@
1
- import { omit, uuid, eachTree } from "../utils/core";
1
+ import { unref } from "vue";
2
+ import { omit, eachTree, uuid, mapTree } from "../utils/core";
3
+ function mergeProps(props, globalProps) {
4
+ if (props == null) {
5
+ return globalProps ?? true;
6
+ }
7
+ if (!props) {
8
+ return false;
9
+ }
10
+ if (!globalProps || typeof globalProps !== "object") {
11
+ return props;
12
+ }
13
+ if (typeof props !== "object") {
14
+ return globalProps;
15
+ }
16
+ return { ...globalProps, ...props };
17
+ }
18
+ function getValue(data, field) {
19
+ if (typeof field === "function") {
20
+ return field(data);
21
+ }
22
+ if (!field) {
23
+ return;
24
+ }
25
+ let value = data;
26
+ field.split(".").forEach((f) => {
27
+ value = value ? value[f] : null;
28
+ });
29
+ return value;
30
+ }
2
31
  function getTablePage(pagination, globalPagination) {
3
32
  const props = getPaginationProps(void 0, pagination, globalPagination);
4
33
  return (props == null ? void 0 : props.currentPage) ?? 1;
@@ -24,21 +53,6 @@ function getPaginationProps(size, pagination, globalPagination, pageProps) {
24
53
  }
25
54
  return Object.assign(defaultProps, omit(props, ["autoAmend"]), pageProps);
26
55
  }
27
- function mergeProps(props, globalProps) {
28
- if (props == null) {
29
- return globalProps ?? true;
30
- }
31
- if (!props) {
32
- return false;
33
- }
34
- if (!globalProps || typeof globalProps !== "object") {
35
- return props;
36
- }
37
- if (typeof props !== "object") {
38
- return globalProps;
39
- }
40
- return { ...globalProps, ...props };
41
- }
42
56
  function isAutoAmend(pagination, globalPagination) {
43
57
  const props = mergeProps(pagination, globalPagination);
44
58
  if (!props) {
@@ -49,6 +63,18 @@ function isAutoAmend(pagination, globalPagination) {
49
63
  }
50
64
  return props === true;
51
65
  }
66
+ function getTableSize(cacheKey, size, globalSize) {
67
+ return getCacheSize(cacheKey) ?? size ?? globalSize ?? "default";
68
+ }
69
+ function getDefaultFilter(columns) {
70
+ const filter = {};
71
+ eachTree(columns, (d) => {
72
+ if (typeof d.columnKey === "string" && d.columnKey.length && d.filteredValue) {
73
+ filter[d.columnKey] = d.filteredValue;
74
+ }
75
+ });
76
+ return filter;
77
+ }
52
78
  function getRequestName(globalRequest, request) {
53
79
  const defaultRequest = {
54
80
  sortName: "sort",
@@ -65,22 +91,6 @@ function getResponseName(globalResponse, response) {
65
91
  };
66
92
  return Object.assign(defaultResponse, globalResponse, response);
67
93
  }
68
- function getTableSize(cacheKey, size, globalSize) {
69
- return getCacheSize(cacheKey) ?? size ?? globalSize ?? "default";
70
- }
71
- function getValue(data, field) {
72
- if (typeof field === "function") {
73
- return field(data);
74
- }
75
- if (!field) {
76
- return;
77
- }
78
- let value = data;
79
- field.split(".").forEach((f) => {
80
- value = value ? value[f] : null;
81
- });
82
- return value;
83
- }
84
94
  function getOrderItems(sorter) {
85
95
  var _a, _b;
86
96
  const orders = [];
@@ -104,6 +114,71 @@ function getOrderItems(sorter) {
104
114
  }
105
115
  return orders;
106
116
  }
117
+ function getRequestOrders(sorter, request, globalRequest) {
118
+ const orders = {};
119
+ const { sortName, orderName, ascValue, descValue } = getRequestName(
120
+ globalRequest,
121
+ request
122
+ );
123
+ if (!sortName || !orderName) {
124
+ return orders;
125
+ }
126
+ const items = getOrderItems(sorter);
127
+ if (items.length === 1) {
128
+ orders[sortName] = items[0].field;
129
+ orders[orderName] = items[0].descend ? descValue : ascValue;
130
+ } else if (items.length) {
131
+ orders[sortName] = items.map((d) => [d.field, d.descend ? descValue : ascValue].join(" ")).join(",");
132
+ }
133
+ return orders;
134
+ }
135
+ function getRequestFilters(filter) {
136
+ const filters = {};
137
+ if (filter) {
138
+ Object.keys(filter).forEach((key) => {
139
+ const value = filter[key];
140
+ if (value == null) {
141
+ return;
142
+ }
143
+ if (typeof value === "string") {
144
+ if (value) {
145
+ filters[key] = value;
146
+ }
147
+ } else if (Array.isArray(value)) {
148
+ if (value.length) {
149
+ filters[key] = value.join(",");
150
+ }
151
+ } else {
152
+ filters[key] = value;
153
+ }
154
+ });
155
+ }
156
+ return filters;
157
+ }
158
+ function getResponseResult(data, response, globalResponse, lazy, treeOpt) {
159
+ if (!data || Array.isArray(data)) {
160
+ return { data: getResponseData(data, lazy, treeOpt) };
161
+ }
162
+ const { dataName, countName } = getResponseName(globalResponse, response);
163
+ if (!dataName) {
164
+ return {};
165
+ }
166
+ return {
167
+ data: getResponseData(getValue(data, dataName), lazy, treeOpt),
168
+ total: (countName ? getValue(data, countName) : void 0) ?? 0
169
+ };
170
+ }
171
+ function getResponseData(data, lazy, treeProps) {
172
+ if (!data || !lazy) {
173
+ return data;
174
+ }
175
+ const name = (treeProps == null ? void 0 : treeProps.hasChildren) ?? "hasChildren";
176
+ return data.map((d) => {
177
+ const temp = { ...d };
178
+ temp[name] = temp[name] ?? true;
179
+ return temp;
180
+ });
181
+ }
107
182
  function reloadData(datasource, sorter, page, limit) {
108
183
  const data = sortData(datasource, sorter);
109
184
  const total = data.length;
@@ -138,30 +213,6 @@ function sortData(datasource, sorter) {
138
213
  });
139
214
  return data;
140
215
  }
141
- function getRequestFilters(filter) {
142
- const filters = {};
143
- Object.keys(filter).forEach((key) => {
144
- const value = filter[key];
145
- if (value == null) {
146
- return;
147
- }
148
- if (typeof value === "string") {
149
- if (value) {
150
- filters[key] = value;
151
- }
152
- } else if (Array.isArray(value)) {
153
- if (value.length) {
154
- filters[key] = value.join(",");
155
- }
156
- } else {
157
- filters[key] = value;
158
- }
159
- });
160
- return filters;
161
- }
162
- function selectionIsChange(rows, selections) {
163
- return rows !== selections && (selections == null || rows.length !== selections.length || rows.some((t) => !(selections && selections.includes(t))));
164
- }
165
216
  function getColId(column) {
166
217
  return column ? column.columnKey || column.prop : void 0;
167
218
  }
@@ -199,12 +250,12 @@ function getCheckedColumns(columns, cols, checkedIds, sortable) {
199
250
  if (colId == null) {
200
251
  return;
201
252
  }
202
- const temp = cols.find((c) => c.id === colId);
253
+ const temp = cols.find((c) => c.uid === colId);
203
254
  if (temp && !checkedIds.includes(colId)) {
204
255
  return;
205
256
  }
206
257
  const fixed = (temp == null ? void 0 : temp.fixed) ?? d.fixed;
207
- const id = uuid(8);
258
+ const uid = uuid(8);
208
259
  if (d.children) {
209
260
  const children = getCheckedColumns(
210
261
  d.children,
@@ -213,10 +264,10 @@ function getCheckedColumns(columns, cols, checkedIds, sortable) {
213
264
  sortable
214
265
  );
215
266
  if (children.length) {
216
- data.push({ ...d, fixed, id, children });
267
+ data.push({ ...d, fixed, uid, children });
217
268
  }
218
269
  } else {
219
- data.push({ ...d, fixed, id });
270
+ data.push({ ...d, fixed, uid });
220
271
  }
221
272
  });
222
273
  if (!sortable || !data.length) {
@@ -226,15 +277,15 @@ function getCheckedColumns(columns, cols, checkedIds, sortable) {
226
277
  var _a, _b;
227
278
  const aColId = getColId(a);
228
279
  const bColId = getColId(b);
229
- let ai = cols.findIndex((c) => c.id === aColId);
230
- let bi = cols.findIndex((c) => c.id === bColId);
280
+ let ai = cols.findIndex((c) => c.uid === aColId);
281
+ let bi = cols.findIndex((c) => c.uid === bColId);
231
282
  if (ai === -1 && ((_a = a.children) == null ? void 0 : _a.length)) {
232
283
  const colId = getColId(a.children[0]);
233
- ai = cols.findIndex((c) => c.id === colId);
284
+ ai = cols.findIndex((c) => c.uid === colId);
234
285
  }
235
286
  if (bi === -1 && ((_b = b.children) == null ? void 0 : _b.length)) {
236
287
  const colId = getColId(b.children[0]);
237
- bi = cols.findIndex((c) => c.id === colId);
288
+ bi = cols.findIndex((c) => c.uid === colId);
238
289
  }
239
290
  if (ai === -1 && a.hideInSetting && a.fixed === "right") {
240
291
  ai = cols.length;
@@ -268,7 +319,7 @@ function getSettingCols(columns, untitledText, cacheKey) {
268
319
  const colId = getColId(d);
269
320
  if (colId && !((_a = d.children) == null ? void 0 : _a.length) && !d.hideInSetting && !(d.type && hideTypes.includes(d.type))) {
270
321
  data.push({
271
- id: colId,
322
+ uid: colId,
272
323
  prop: d.prop,
273
324
  columnKey: d.columnKey,
274
325
  label: d.label || untitledText,
@@ -277,14 +328,35 @@ function getSettingCols(columns, untitledText, cacheKey) {
277
328
  });
278
329
  }
279
330
  });
280
- const checkedIds = data.filter((d) => d.checked).map((d) => d.id);
331
+ return getColsResult(data);
332
+ }
333
+ function getColsResult(cols) {
334
+ const ids = cols.filter((d) => d.checked).map((d) => d.uid);
281
335
  return {
282
- data,
283
- checkedIds,
284
- isChecked: data.length > 0 && data.length === checkedIds.length,
285
- isIndeterminate: checkedIds.length !== 0 && data.length !== checkedIds.length
336
+ data: sortCols(cols),
337
+ checkedIds: ids,
338
+ isChecked: cols.length > 0 && cols.length === ids.length,
339
+ isIndeterminate: ids.length !== 0 && cols.length !== ids.length
286
340
  };
287
341
  }
342
+ function sortCols(cols) {
343
+ cols.sort((a, b) => {
344
+ let ai = cols.indexOf(a);
345
+ let bi = cols.indexOf(b);
346
+ if (a.fixed === true || a.fixed === "left") {
347
+ ai -= cols.length;
348
+ } else if (a.fixed === "right") {
349
+ ai += cols.length;
350
+ }
351
+ if (b.fixed === true || b.fixed === "left") {
352
+ bi -= cols.length;
353
+ } else if (b.fixed === "right") {
354
+ bi += cols.length;
355
+ }
356
+ return ai - bi;
357
+ });
358
+ return cols;
359
+ }
288
360
  function getCacheCols(cacheKey) {
289
361
  if (!cacheKey) {
290
362
  return;
@@ -298,14 +370,14 @@ function getCacheCols(cacheKey) {
298
370
  if (!Array.isArray(data)) {
299
371
  return;
300
372
  }
301
- const checkedIds = data.filter((d) => d.checked).map((d) => d.id);
302
- return {
303
- data,
304
- checkedIds,
305
- isChecked: data.length > 0 && data.length === checkedIds.length,
306
- isIndeterminate: checkedIds.length !== 0 && data.length !== checkedIds.length
307
- };
308
- } catch (_e) {
373
+ data.forEach((d) => {
374
+ if (d.uid == null && d.id != null) {
375
+ d.uid = d.id;
376
+ }
377
+ });
378
+ return getColsResult(data);
379
+ } catch (e) {
380
+ console.error(e);
309
381
  }
310
382
  }
311
383
  function getColsCacheKey(cacheKey) {
@@ -322,6 +394,9 @@ function getCacheSize(cacheKey) {
322
394
  }
323
395
  }
324
396
  }
397
+ function selectionIsChange(rows, selections) {
398
+ return rows !== selections && (selections == null || rows.length !== selections.length || rows.some((t) => !(selections && selections.includes(t))));
399
+ }
325
400
  function isDisableRow(row, index, columns) {
326
401
  let disabled = false;
327
402
  eachTree(columns, (col) => {
@@ -332,6 +407,38 @@ function isDisableRow(row, index, columns) {
332
407
  });
333
408
  return disabled;
334
409
  }
410
+ function getTableFilter(tableRef) {
411
+ var _a, _b;
412
+ const states = (_b = (_a = unref(tableRef)) == null ? void 0 : _a.store) == null ? void 0 : _b.states;
413
+ const columns = unref(states == null ? void 0 : states.columns);
414
+ const filters = unref(states == null ? void 0 : states.filters);
415
+ if (!filters || !columns) {
416
+ return;
417
+ }
418
+ const keys = Object.keys(filters);
419
+ const filter = {};
420
+ columns.forEach((col) => {
421
+ if (keys.includes(col.id)) {
422
+ filter[col.columnKey || col.id] = filters[col.id];
423
+ }
424
+ });
425
+ return filter;
426
+ }
427
+ function getTableState(cols, data) {
428
+ const { sorter, filter } = data;
429
+ const filterKeys = filter == null ? [] : Object.keys(filter);
430
+ const hasSorter = sorter != null && sorter.prop != null && sorter.prop != "";
431
+ let hasSortCol = false;
432
+ const result = mapTree(cols, (col) => {
433
+ if (hasSorter && col.prop === sorter.prop) {
434
+ hasSortCol = true;
435
+ }
436
+ const t = col.columnKey && filterKeys.includes(col.columnKey);
437
+ const filteredValue = t ? filter[col.columnKey] : [];
438
+ return { ...col, filteredValue };
439
+ });
440
+ return { cols: result, sorter: hasSorter && hasSortCol ? sorter : void 0 };
441
+ }
335
442
  function useTableMethods(getIns) {
336
443
  return {
337
444
  clearSelection: () => {
@@ -454,24 +561,32 @@ export {
454
561
  getCheckedColumns,
455
562
  getColId,
456
563
  getColsCacheKey,
564
+ getColsResult,
565
+ getDefaultFilter,
457
566
  getInitCacheColumns,
458
567
  getInitColumns,
459
568
  getOrderItems,
460
569
  getPaginationProps,
461
570
  getRequestFilters,
462
571
  getRequestName,
572
+ getRequestOrders,
573
+ getResponseData,
463
574
  getResponseName,
575
+ getResponseResult,
464
576
  getSettingCols,
465
577
  getSizeCacheKey,
578
+ getTableFilter,
466
579
  getTableLimit,
467
580
  getTablePage,
468
581
  getTableSize,
582
+ getTableState,
469
583
  getValue,
470
584
  isAutoAmend,
471
585
  isDisableRow,
472
586
  mergeProps,
473
587
  reloadData,
474
588
  selectionIsChange,
589
+ sortCols,
475
590
  sortData,
476
591
  useTableEvents,
477
592
  useTableMethods
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{
22
22
  default: number;
23
23
  };
24
24
  imageSettings: import("vue").PropType<import("./types").ImageSettings>;
25
- customStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
25
+ customStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
26
26
  }, {
27
27
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
28
28
  imageRef: import("vue").Ref<HTMLImageElement | null>;
@@ -54,14 +54,14 @@ declare const _default: import("vue").DefineComponent<{
54
54
  default: number;
55
55
  };
56
56
  imageSettings: import("vue").PropType<import("./types").ImageSettings>;
57
- customStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
57
+ customStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
58
58
  }>> & {
59
59
  onDone?: (() => any) | undefined;
60
60
  }, {
61
61
  size: number;
62
+ margin: number;
62
63
  level: import("./types").Level;
63
64
  bgColor: string;
64
65
  fgColor: string;
65
- margin: number;
66
66
  }, {}>;
67
67
  export default _default;
@@ -1,5 +1,4 @@
1
1
  import type { PropType, ExtractPropTypes } from 'vue';
2
- import type { StyleValue } from '../ele-app/types';
3
2
  import type { Level, ImageSettings } from './types';
4
3
  /**
5
4
  * 属性
@@ -27,7 +26,7 @@ export declare const qrCodeProps: {
27
26
  default: number;
28
27
  };
29
28
  imageSettings: PropType<ImageSettings>;
30
- customStyle: PropType<StyleValue>;
29
+ customStyle: PropType<Partial<import("vue").CSSProperties>>;
31
30
  };
32
31
  export type QrCodeProps = ExtractPropTypes<typeof qrCodeProps>;
33
32
  /**
@@ -21,7 +21,7 @@ declare const _default: import("vue").DefineComponent<{
21
21
  default: number;
22
22
  };
23
23
  imageSettings: import("vue").PropType<import("../ele-qr-code/types").ImageSettings>;
24
- customStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
24
+ customStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
25
25
  }, {
26
26
  viewBox: import("vue").Ref<string>;
27
27
  path: import("vue").Ref<string>;
@@ -57,14 +57,14 @@ declare const _default: import("vue").DefineComponent<{
57
57
  default: number;
58
58
  };
59
59
  imageSettings: import("vue").PropType<import("../ele-qr-code/types").ImageSettings>;
60
- customStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
60
+ customStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
61
61
  }>> & {
62
62
  onDone?: (() => any) | undefined;
63
63
  }, {
64
64
  size: number;
65
+ margin: number;
65
66
  level: import("../ele-qr-code/types").Level;
66
67
  bgColor: string;
67
68
  fgColor: string;
68
- margin: number;
69
69
  }, {}>;
70
70
  export default _default;
@@ -3,10 +3,10 @@ declare const _default: import("vue").DefineComponent<{
3
3
  minSize: NumberConstructor;
4
4
  maxSize: NumberConstructor;
5
5
  space: StringConstructor;
6
- customStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
7
- bodyStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
6
+ customStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
7
+ bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
8
8
  allowCollapse: BooleanConstructor;
9
- collapseStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
9
+ collapseStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
10
10
  collapse: BooleanConstructor;
11
11
  vertical: BooleanConstructor;
12
12
  reverse: BooleanConstructor;
@@ -33,10 +33,10 @@ declare const _default: import("vue").DefineComponent<{
33
33
  minSize: NumberConstructor;
34
34
  maxSize: NumberConstructor;
35
35
  space: StringConstructor;
36
- customStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
37
- bodyStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
36
+ customStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
37
+ bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
38
38
  allowCollapse: BooleanConstructor;
39
- collapseStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
39
+ collapseStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
40
40
  collapse: BooleanConstructor;
41
41
  vertical: BooleanConstructor;
42
42
  reverse: BooleanConstructor;
@@ -1,5 +1,4 @@
1
1
  import type { PropType, ExtractPropTypes } from 'vue';
2
- import type { StyleValue } from '../ele-app/types';
3
2
  /**
4
3
  * 属性
5
4
  */
@@ -8,10 +7,10 @@ export declare const splitPanelProps: {
8
7
  minSize: NumberConstructor;
9
8
  maxSize: NumberConstructor;
10
9
  space: StringConstructor;
11
- customStyle: PropType<StyleValue>;
12
- bodyStyle: PropType<StyleValue>;
10
+ customStyle: PropType<Partial<import("vue").CSSProperties>>;
11
+ bodyStyle: PropType<Partial<import("vue").CSSProperties>>;
13
12
  allowCollapse: BooleanConstructor;
14
- collapseStyle: PropType<StyleValue>;
13
+ collapseStyle: PropType<Partial<import("vue").CSSProperties>>;
15
14
  collapse: BooleanConstructor;
16
15
  vertical: BooleanConstructor;
17
16
  reverse: BooleanConstructor;
@@ -29,6 +29,7 @@
29
29
  border-color: eleVar('table', 'border-color');
30
30
  border-bottom-width: 1px;
31
31
  vertical-align: middle;
32
+ box-sizing: border-box;
32
33
  text-align: left;
33
34
  }
34
35
 
@@ -231,7 +231,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
231
231
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item, index2) => {
232
232
  return openBlock(), createBlock(_component_ElTabPane, mergeProps({
233
233
  key: index2 + "-" + item.name
234
- }, _ctx.omit(item, ["meta"])), createSlots({
234
+ }, _ctx.omit(item, ["slot", "meta"])), createSlots({
235
235
  label: withCtx(() => [
236
236
  createVNode(_component_TabTitle, {
237
237
  ref_for: true,
@@ -265,10 +265,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
265
265
  ]),
266
266
  _: 2
267
267
  }, [
268
- item.name && _ctx.$slots[item.name] ? {
268
+ item.name && _ctx.$slots[item.slot || item.name] ? {
269
269
  name: "default",
270
270
  fn: withCtx(() => [
271
- renderSlot(_ctx.$slots, item.name, { item })
271
+ renderSlot(_ctx.$slots, item.slot || item.name, { item })
272
272
  ]),
273
273
  key: "0"
274
274
  } : void 0
@@ -5,6 +5,9 @@ import type { DropdownItem } from '../../ele-dropdown/types';
5
5
  * 页签数据
6
6
  */
7
7
  export interface TabPaneItem extends ElTabPaneProps {
8
+ /** 插槽名称 */
9
+ slot?: string;
10
+ /** 元数据 */
8
11
  meta?: any;
9
12
  }
10
13
  /**
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<{
11
11
  italic: BooleanConstructor;
12
12
  icon: import("vue").PropType<import("./types").TextIcon>;
13
13
  iconProps: import("vue").PropType<import("../ele-app/types").ElIconProps>;
14
- iconStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
14
+ iconStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
15
15
  }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
16
  tag: {
17
17
  type: StringConstructor;
@@ -25,11 +25,11 @@ declare const _default: import("vue").DefineComponent<{
25
25
  italic: BooleanConstructor;
26
26
  icon: import("vue").PropType<import("./types").TextIcon>;
27
27
  iconProps: import("vue").PropType<import("../ele-app/types").ElIconProps>;
28
- iconStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
28
+ iconStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
29
29
  }>>, {
30
30
  tag: string;
31
- deleted: boolean;
32
31
  underline: boolean;
32
+ deleted: boolean;
33
33
  strong: boolean;
34
34
  italic: boolean;
35
35
  }, {}>;
@@ -1,5 +1,5 @@
1
1
  import type { PropType, ExtractPropTypes } from 'vue';
2
- import type { StyleValue, ElIconProps } from '../ele-app/types';
2
+ import type { ElIconProps } from '../ele-app/types';
3
3
  import type { TextType, TextSize, TextIcon } from './types';
4
4
  /**
5
5
  * 属性
@@ -17,7 +17,7 @@ export declare const textProps: {
17
17
  italic: BooleanConstructor;
18
18
  icon: PropType<TextIcon>;
19
19
  iconProps: PropType<ElIconProps>;
20
- iconStyle: PropType<StyleValue>;
20
+ iconStyle: PropType<Partial<import("vue").CSSProperties>>;
21
21
  };
22
22
  export type TextProps = ExtractPropTypes<typeof textProps>;
23
23
  export type TextPropKeys = Array<keyof typeof textProps>;
@@ -5,9 +5,9 @@ declare const _default: import("vue").DefineComponent<{
5
5
  type: import("vue").PropType<import("./types").ToolbarTheme>;
6
6
  default: string;
7
7
  };
8
- titleStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
9
- bodyStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
10
- toolsStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
8
+ titleStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
9
+ bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
10
+ toolsStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
11
11
  }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
12
12
  title: StringConstructor;
13
13
  subtitle: StringConstructor;
@@ -15,9 +15,9 @@ declare const _default: import("vue").DefineComponent<{
15
15
  type: import("vue").PropType<import("./types").ToolbarTheme>;
16
16
  default: string;
17
17
  };
18
- titleStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
19
- bodyStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
20
- toolsStyle: import("vue").PropType<import("../ele-app/types").StyleValue>;
18
+ titleStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
19
+ bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
20
+ toolsStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
21
21
  }>>, {
22
22
  theme: import("./types").ToolbarTheme;
23
23
  }, {}>;
@@ -1,5 +1,4 @@
1
1
  import type { PropType, ExtractPropTypes } from 'vue';
2
- import type { StyleValue } from '../ele-app/types';
3
2
  import type { ToolbarTheme } from './types';
4
3
  /**
5
4
  * 属性
@@ -11,8 +10,8 @@ export declare const toolbarProps: {
11
10
  type: PropType<ToolbarTheme>;
12
11
  default: string;
13
12
  };
14
- titleStyle: PropType<StyleValue>;
15
- bodyStyle: PropType<StyleValue>;
16
- toolsStyle: PropType<StyleValue>;
13
+ titleStyle: PropType<Partial<import("vue").CSSProperties>>;
14
+ bodyStyle: PropType<Partial<import("vue").CSSProperties>>;
15
+ toolsStyle: PropType<Partial<import("vue").CSSProperties>>;
17
16
  };
18
17
  export type ToolbarProps = ExtractPropTypes<typeof toolbarProps>;
@@ -1,7 +1,7 @@
1
- import type { StyleValue, ElTooltipProps, ElTooltipInstance, ElPopperInstance } from '../ele-app/types';
1
+ import type { ElTooltipProps, ElTooltipInstance, ElPopperInstance } from '../ele-app/types';
2
2
  import type { TooltipEmits } from './props';
3
3
  declare const _default: import("vue").DefineComponent<{
4
- bodyStyle: import("vue").PropType<StyleValue>;
4
+ bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
5
5
  bg: StringConstructor;
6
6
  arrowBg: StringConstructor;
7
7
  keepAlive: BooleanConstructor;
@@ -130,7 +130,7 @@ declare const _default: import("vue").DefineComponent<{
130
130
  onPopOpen: (e: any) => void;
131
131
  onPopClose: (e: any) => void;
132
132
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, TooltipEmits, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
133
- bodyStyle: import("vue").PropType<StyleValue>;
133
+ bodyStyle: import("vue").PropType<Partial<import("vue").CSSProperties>>;
134
134
  bg: StringConstructor;
135
135
  arrowBg: StringConstructor;
136
136
  keepAlive: BooleanConstructor;