vxe-table 4.16.15 → 4.16.17

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 (258) hide show
  1. package/README.md +1 -1
  2. package/README.zh-TW.md +1 -1
  3. package/es/grid/src/grid.js +7 -2
  4. package/es/index.css +1 -1
  5. package/es/index.min.css +1 -1
  6. package/es/locale/lang/en-US.js +2 -2
  7. package/es/style.css +1 -1
  8. package/es/style.min.css +1 -1
  9. package/es/table/module/filter/panel.js +2 -1
  10. package/es/table/module/menu/hook.js +9 -3
  11. package/es/table/module/menu/panel.js +113 -109
  12. package/es/table/src/header.js +4 -1
  13. package/es/table/src/table.js +58 -30
  14. package/es/table/src/util.js +19 -4
  15. package/es/ui/index.js +8 -5
  16. package/es/ui/src/log.js +1 -1
  17. package/lib/grid/src/grid.js +6 -2
  18. package/lib/grid/src/grid.min.js +1 -1
  19. package/lib/index.css +1 -1
  20. package/lib/index.min.css +1 -1
  21. package/lib/index.umd.js +89 -41
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/locale/lang/ar-EG.min.js +1 -1
  24. package/lib/locale/lang/de-DE.min.js +1 -1
  25. package/lib/locale/lang/en-US.js +2 -2
  26. package/lib/locale/lang/en-US.min.js +1 -1
  27. package/lib/locale/lang/es-ES.min.js +1 -1
  28. package/lib/locale/lang/fr-FR.min.js +1 -1
  29. package/lib/locale/lang/hu-HU.min.js +1 -1
  30. package/lib/locale/lang/hy-AM.min.js +1 -1
  31. package/lib/locale/lang/id-ID.min.js +1 -1
  32. package/lib/locale/lang/it-IT.min.js +1 -1
  33. package/lib/locale/lang/ja-JP.min.js +1 -1
  34. package/lib/locale/lang/ko-KR.min.js +1 -1
  35. package/lib/locale/lang/ms-MY.min.js +1 -1
  36. package/lib/locale/lang/nb-NO.min.js +1 -1
  37. package/lib/locale/lang/pt-BR.min.js +1 -1
  38. package/lib/locale/lang/ru-RU.min.js +1 -1
  39. package/lib/locale/lang/th-TH.min.js +1 -1
  40. package/lib/locale/lang/ug-CN.min.js +1 -1
  41. package/lib/locale/lang/uk-UA.min.js +1 -1
  42. package/lib/locale/lang/uz-UZ.min.js +1 -1
  43. package/lib/locale/lang/vi-VN.min.js +1 -1
  44. package/lib/locale/lang/zh-CHT.min.js +1 -1
  45. package/lib/locale/lang/zh-CN.min.js +1 -1
  46. package/lib/locale/lang/zh-HK.min.js +1 -1
  47. package/lib/locale/lang/zh-MO.min.js +1 -1
  48. package/lib/locale/lang/zh-TW.min.js +1 -1
  49. package/lib/style.css +1 -1
  50. package/lib/style.min.css +1 -1
  51. package/lib/table/src/header.js +3 -1
  52. package/lib/table/src/props.js +0 -318
  53. package/lib/ui/index.js +8 -5
  54. package/lib/ui/index.min.js +1 -1
  55. package/lib/ui/src/log.js +1 -1
  56. package/lib/ui/src/log.min.js +1 -1
  57. package/package.json +1 -1
  58. package/packages/grid/src/grid.ts +8 -2
  59. package/packages/locale/lang/en-US.ts +2 -2
  60. package/packages/table/module/filter/panel.ts +2 -1
  61. package/packages/table/module/menu/hook.ts +11 -3
  62. package/packages/table/module/menu/panel.ts +112 -108
  63. package/packages/table/src/header.ts +3 -1
  64. package/packages/table/src/table.ts +58 -30
  65. package/packages/table/src/util.ts +19 -2
  66. package/packages/ui/index.ts +7 -4
  67. package/styles/components/grid.scss +0 -1
  68. package/es/colgroup/style.css +0 -0
  69. package/es/colgroup/style.min.css +0 -0
  70. package/es/column/style.css +0 -0
  71. package/es/column/style.min.css +0 -0
  72. package/es/grid/style.css +0 -87
  73. package/es/grid/style.min.css +0 -1
  74. package/es/iconfont.1758246364726.ttf +0 -0
  75. package/es/iconfont.1758246364726.woff +0 -0
  76. package/es/iconfont.1758246364726.woff2 +0 -0
  77. package/es/index.esm.js +0 -3
  78. package/es/locale/lang/ar-EG.d.ts +0 -2
  79. package/es/locale/lang/de-DE.d.ts +0 -2
  80. package/es/locale/lang/en-US.d.ts +0 -2
  81. package/es/locale/lang/es-ES.d.ts +0 -2
  82. package/es/locale/lang/fr-FR.d.ts +0 -2
  83. package/es/locale/lang/hu-HU.d.ts +0 -2
  84. package/es/locale/lang/hy-AM.d.ts +0 -2
  85. package/es/locale/lang/id-ID.d.ts +0 -2
  86. package/es/locale/lang/it-IT.d.ts +0 -2
  87. package/es/locale/lang/ja-JP.d.ts +0 -2
  88. package/es/locale/lang/ko-KR.d.ts +0 -2
  89. package/es/locale/lang/ms-MY.d.ts +0 -2
  90. package/es/locale/lang/nb-NO.d.ts +0 -2
  91. package/es/locale/lang/pt-BR.d.ts +0 -2
  92. package/es/locale/lang/ru-RU.d.ts +0 -2
  93. package/es/locale/lang/th-TH.d.ts +0 -2
  94. package/es/locale/lang/ug-CN.d.ts +0 -2
  95. package/es/locale/lang/uk-UA.d.ts +0 -2
  96. package/es/locale/lang/uz-UZ.d.ts +0 -2
  97. package/es/locale/lang/vi-VN.d.ts +0 -2
  98. package/es/locale/lang/zh-CHT.d.ts +0 -2
  99. package/es/locale/lang/zh-CN.d.ts +0 -2
  100. package/es/locale/lang/zh-HK.d.ts +0 -2
  101. package/es/locale/lang/zh-MO.d.ts +0 -2
  102. package/es/locale/lang/zh-TW.d.ts +0 -2
  103. package/es/table/style.css +0 -3657
  104. package/es/table/style.min.css +0 -1
  105. package/es/toolbar/style.css +0 -90
  106. package/es/toolbar/style.min.css +0 -1
  107. package/es/ui/style.css +0 -0
  108. package/es/ui/style.min.css +0 -0
  109. package/es/v-x-e-table/style.css +0 -0
  110. package/es/v-x-e-table/style.min.css +0 -0
  111. package/es/vxe-colgroup/style.css +0 -0
  112. package/es/vxe-colgroup/style.min.css +0 -0
  113. package/es/vxe-column/style.css +0 -0
  114. package/es/vxe-column/style.min.css +0 -0
  115. package/es/vxe-grid/style.css +0 -87
  116. package/es/vxe-grid/style.min.css +0 -1
  117. package/es/vxe-table/style.css +0 -3657
  118. package/es/vxe-table/style.min.css +0 -1
  119. package/es/vxe-toolbar/style.css +0 -90
  120. package/es/vxe-toolbar/style.min.css +0 -1
  121. package/es/vxe-ui/style.css +0 -0
  122. package/es/vxe-ui/style.min.css +0 -0
  123. package/es/vxe-v-x-e-table/style.css +0 -0
  124. package/es/vxe-v-x-e-table/style.min.css +0 -0
  125. package/lib/colgroup/style/index.js +0 -1
  126. package/lib/colgroup/style/style.css +0 -0
  127. package/lib/colgroup/style/style.min.css +0 -0
  128. package/lib/column/style/index.js +0 -1
  129. package/lib/column/style/style.css +0 -0
  130. package/lib/column/style/style.min.css +0 -0
  131. package/lib/grid/style/index.js +0 -1
  132. package/lib/grid/style/style.css +0 -87
  133. package/lib/grid/style/style.min.css +0 -1
  134. package/lib/iconfont.1758246364726.ttf +0 -0
  135. package/lib/iconfont.1758246364726.woff +0 -0
  136. package/lib/iconfont.1758246364726.woff2 +0 -0
  137. package/lib/index.common.js +0 -22
  138. package/lib/locale/lang/ar-EG.d.ts +0 -2
  139. package/lib/locale/lang/ar-EG.umd.js +0 -806
  140. package/lib/locale/lang/de-DE.d.ts +0 -2
  141. package/lib/locale/lang/de-DE.umd.js +0 -806
  142. package/lib/locale/lang/en-US.d.ts +0 -2
  143. package/lib/locale/lang/en-US.umd.js +0 -806
  144. package/lib/locale/lang/es-ES.d.ts +0 -2
  145. package/lib/locale/lang/es-ES.umd.js +0 -806
  146. package/lib/locale/lang/fr-FR.d.ts +0 -2
  147. package/lib/locale/lang/fr-FR.umd.js +0 -806
  148. package/lib/locale/lang/hu-HU.d.ts +0 -2
  149. package/lib/locale/lang/hu-HU.umd.js +0 -806
  150. package/lib/locale/lang/hy-AM.d.ts +0 -2
  151. package/lib/locale/lang/hy-AM.umd.js +0 -806
  152. package/lib/locale/lang/id-ID.d.ts +0 -2
  153. package/lib/locale/lang/id-ID.umd.js +0 -806
  154. package/lib/locale/lang/it-IT.d.ts +0 -2
  155. package/lib/locale/lang/it-IT.umd.js +0 -806
  156. package/lib/locale/lang/ja-JP.d.ts +0 -2
  157. package/lib/locale/lang/ja-JP.umd.js +0 -806
  158. package/lib/locale/lang/ko-KR.d.ts +0 -2
  159. package/lib/locale/lang/ko-KR.umd.js +0 -806
  160. package/lib/locale/lang/ms-MY.d.ts +0 -2
  161. package/lib/locale/lang/ms-MY.umd.js +0 -806
  162. package/lib/locale/lang/nb-NO.d.ts +0 -2
  163. package/lib/locale/lang/nb-NO.umd.js +0 -806
  164. package/lib/locale/lang/pt-BR.d.ts +0 -2
  165. package/lib/locale/lang/pt-BR.umd.js +0 -806
  166. package/lib/locale/lang/ru-RU.d.ts +0 -2
  167. package/lib/locale/lang/ru-RU.umd.js +0 -806
  168. package/lib/locale/lang/th-TH.d.ts +0 -2
  169. package/lib/locale/lang/th-TH.umd.js +0 -806
  170. package/lib/locale/lang/ug-CN.d.ts +0 -2
  171. package/lib/locale/lang/ug-CN.umd.js +0 -806
  172. package/lib/locale/lang/uk-UA.d.ts +0 -2
  173. package/lib/locale/lang/uk-UA.umd.js +0 -806
  174. package/lib/locale/lang/uz-UZ.d.ts +0 -2
  175. package/lib/locale/lang/uz-UZ.umd.js +0 -806
  176. package/lib/locale/lang/vi-VN.d.ts +0 -2
  177. package/lib/locale/lang/vi-VN.umd.js +0 -806
  178. package/lib/locale/lang/zh-CHT.d.ts +0 -2
  179. package/lib/locale/lang/zh-CHT.umd.js +0 -806
  180. package/lib/locale/lang/zh-CN.d.ts +0 -2
  181. package/lib/locale/lang/zh-CN.umd.js +0 -808
  182. package/lib/locale/lang/zh-HK.d.ts +0 -2
  183. package/lib/locale/lang/zh-HK.umd.js +0 -23
  184. package/lib/locale/lang/zh-MO.d.ts +0 -2
  185. package/lib/locale/lang/zh-MO.umd.js +0 -23
  186. package/lib/locale/lang/zh-TW.d.ts +0 -2
  187. package/lib/locale/lang/zh-TW.umd.js +0 -23
  188. package/lib/table/module/custom/hook.js +0 -430
  189. package/lib/table/module/custom/hook.min.js +0 -1
  190. package/lib/table/module/custom/panel.js +0 -1193
  191. package/lib/table/module/custom/panel.min.js +0 -1
  192. package/lib/table/module/edit/hook.js +0 -1308
  193. package/lib/table/module/edit/hook.min.js +0 -1
  194. package/lib/table/module/export/export-panel.js +0 -467
  195. package/lib/table/module/export/export-panel.min.js +0 -1
  196. package/lib/table/module/export/hook.js +0 -1888
  197. package/lib/table/module/export/hook.min.js +0 -1
  198. package/lib/table/module/export/import-panel.js +0 -226
  199. package/lib/table/module/export/import-panel.min.js +0 -1
  200. package/lib/table/module/export/util.js +0 -20
  201. package/lib/table/module/export/util.min.js +0 -1
  202. package/lib/table/module/filter/hook.js +0 -442
  203. package/lib/table/module/filter/hook.min.js +0 -1
  204. package/lib/table/module/filter/panel.js +0 -264
  205. package/lib/table/module/filter/panel.min.js +0 -1
  206. package/lib/table/module/keyboard/hook.js +0 -579
  207. package/lib/table/module/keyboard/hook.min.js +0 -1
  208. package/lib/table/module/menu/hook.js +0 -383
  209. package/lib/table/module/menu/hook.min.js +0 -1
  210. package/lib/table/module/menu/panel.js +0 -135
  211. package/lib/table/module/menu/panel.min.js +0 -1
  212. package/lib/table/module/validator/hook.js +0 -681
  213. package/lib/table/module/validator/hook.min.js +0 -1
  214. package/lib/table/src/header.min.js +0 -1
  215. package/lib/table/src/props.min.js +0 -1
  216. package/lib/table/src/store.js +0 -15
  217. package/lib/table/src/store.min.js +0 -1
  218. package/lib/table/src/table.js +0 -902
  219. package/lib/table/src/table.min.js +0 -1
  220. package/lib/table/src/use/cell-view.js +0 -57
  221. package/lib/table/src/use/cell-view.min.js +0 -1
  222. package/lib/table/src/use/index.js +0 -16
  223. package/lib/table/src/use/index.min.js +0 -1
  224. package/lib/table/src/util.js +0 -896
  225. package/lib/table/src/util.min.js +0 -1
  226. package/lib/table/style/index.js +0 -1
  227. package/lib/table/style/style.css +0 -3657
  228. package/lib/table/style/style.min.css +0 -1
  229. package/lib/toolbar/style/index.js +0 -1
  230. package/lib/toolbar/style/style.css +0 -90
  231. package/lib/toolbar/style/style.min.css +0 -1
  232. package/lib/ui/style/index.js +0 -1
  233. package/lib/ui/style/style.css +0 -0
  234. package/lib/ui/style/style.min.css +0 -0
  235. package/lib/v-x-e-table/style/index.js +0 -1
  236. package/lib/v-x-e-table/style/style.css +0 -0
  237. package/lib/v-x-e-table/style/style.min.css +0 -0
  238. package/lib/vxe-colgroup/style/index.js +0 -1
  239. package/lib/vxe-colgroup/style/style.css +0 -0
  240. package/lib/vxe-colgroup/style/style.min.css +0 -0
  241. package/lib/vxe-column/style/index.js +0 -1
  242. package/lib/vxe-column/style/style.css +0 -0
  243. package/lib/vxe-column/style/style.min.css +0 -0
  244. package/lib/vxe-grid/style/index.js +0 -1
  245. package/lib/vxe-grid/style/style.css +0 -87
  246. package/lib/vxe-grid/style/style.min.css +0 -1
  247. package/lib/vxe-table/style/index.js +0 -1
  248. package/lib/vxe-table/style/style.css +0 -3657
  249. package/lib/vxe-table/style/style.min.css +0 -1
  250. package/lib/vxe-toolbar/style/index.js +0 -1
  251. package/lib/vxe-toolbar/style/style.css +0 -90
  252. package/lib/vxe-toolbar/style/style.min.css +0 -1
  253. package/lib/vxe-ui/style/index.js +0 -1
  254. package/lib/vxe-ui/style/style.css +0 -0
  255. package/lib/vxe-ui/style/style.min.css +0 -0
  256. package/lib/vxe-v-x-e-table/style/index.js +0 -1
  257. package/lib/vxe-v-x-e-table/style/style.css +0 -0
  258. package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
@@ -1,264 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _vue = require("vue");
8
- var _comp = require("../../../ui/src/comp");
9
- var _ui = require("../../../ui");
10
- var _utils = require("../../../ui/src/utils");
11
- var _dom = require("../../../ui/src/dom");
12
- var _vn = require("../../../ui/src/vn");
13
- var _log = require("../../../ui/src/log");
14
- var _xeUtils = _interopRequireDefault(require("xe-utils"));
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- const {
17
- getI18n,
18
- getIcon,
19
- renderer
20
- } = _ui.VxeUI;
21
- var _default = exports.default = (0, _comp.defineVxeComponent)({
22
- name: 'VxeTableFilterPanel',
23
- props: {
24
- filterStore: Object
25
- },
26
- setup(props, context) {
27
- const xID = _xeUtils.default.uniqueId();
28
- const $xeTable = (0, _vue.inject)('$xeTable', {});
29
- const {
30
- reactData: tableReactData,
31
- internalData: tableInternalData,
32
- getComputeMaps
33
- } = $xeTable;
34
- const {
35
- computeFilterOpts
36
- } = getComputeMaps();
37
- const refElem = (0, _vue.ref)();
38
- const refMaps = {
39
- refElem
40
- };
41
- const $xeFilterPanel = {
42
- xID,
43
- props,
44
- context,
45
- getRefMaps: () => refMaps
46
- };
47
- const computeHasCheckOption = (0, _vue.computed)(() => {
48
- const {
49
- filterStore
50
- } = props;
51
- return filterStore && filterStore.options.some(option => option.checked);
52
- });
53
- // 全部筛选事件
54
- const filterCheckAllEvent = (evnt, value) => {
55
- const {
56
- filterStore
57
- } = props;
58
- filterStore.options.forEach(option => {
59
- option._checked = value;
60
- option.checked = value;
61
- });
62
- filterStore.isAllSelected = value;
63
- filterStore.isIndeterminate = false;
64
- };
65
- /*************************
66
- * Publish methods
67
- *************************/
68
- // 确认筛选
69
- const confirmFilter = evnt => {
70
- if (!evnt) {
71
- (0, _log.warnLog)('vxe.error.delFunc', ['confirmFilter', 'saveFilterPanelByEvent']);
72
- }
73
- $xeTable.handleFilterConfirmFilter(evnt || new Event('click'));
74
- };
75
- // (单选)筛选发生改变
76
- const changeRadioOption = (evnt, checked, item) => {
77
- $xeTable.handleFilterChangeRadioOption(evnt, checked, item);
78
- };
79
- /**
80
- * 重置筛选
81
- * 当筛选面板中的重置按钮被按下时触发
82
- * @param {Event} evnt 事件
83
- */
84
- const resetFilter = evnt => {
85
- $xeTable.handleFilterResetFilter(evnt);
86
- };
87
- // (多选)筛选发生改变
88
- const changeMultipleOption = (evnt, checked, item) => {
89
- $xeTable.handleFilterChangeMultipleOption(evnt, checked, item);
90
- };
91
- // 筛选发生改变
92
- const changeOption = (evnt, checked, item) => {
93
- $xeTable.handleFilterChangeOption(evnt, checked, item);
94
- };
95
- const changeAllOption = (evnt, checked) => {
96
- const {
97
- filterStore
98
- } = props;
99
- if (filterStore.multiple) {
100
- filterCheckAllEvent(evnt, checked);
101
- } else {
102
- resetFilter(evnt);
103
- }
104
- };
105
- /*************************
106
- * Publish methods
107
- *************************/
108
- const filterPanelMethods = {
109
- changeRadioOption,
110
- changeMultipleOption,
111
- changeAllOption,
112
- changeOption,
113
- confirmFilter,
114
- resetFilter
115
- };
116
- Object.assign($xeFilterPanel, filterPanelMethods);
117
- const renderOptions = (filterRender, compConf) => {
118
- const {
119
- filterStore
120
- } = props;
121
- const {
122
- column,
123
- multiple,
124
- maxHeight
125
- } = filterStore;
126
- const slots = column ? column.slots : null;
127
- const filterSlot = slots ? slots.filter : null;
128
- const params = Object.assign({}, tableInternalData._currFilterParams, {
129
- $panel: $xeFilterPanel,
130
- $table: $xeTable
131
- });
132
- const rtFilter = compConf ? compConf.renderTableFilter || compConf.renderFilter : null;
133
- if (filterSlot) {
134
- return [(0, _vue.h)('div', {
135
- class: 'vxe-table--filter-template',
136
- style: maxHeight ? {
137
- maxHeight: `${maxHeight}px`
138
- } : {}
139
- }, $xeTable.callSlot(filterSlot, params))];
140
- } else if (rtFilter) {
141
- return [(0, _vue.h)('div', {
142
- class: 'vxe-table--filter-template',
143
- style: maxHeight ? {
144
- maxHeight: `${maxHeight}px`
145
- } : {}
146
- }, (0, _vn.getSlotVNs)(rtFilter(filterRender, params)))];
147
- }
148
- const isAllChecked = multiple ? filterStore.isAllSelected : !filterStore.options.some(item => item._checked);
149
- const isAllIndeterminate = multiple && filterStore.isIndeterminate;
150
- return [(0, _vue.h)('ul', {
151
- class: 'vxe-table--filter-header'
152
- }, [(0, _vue.h)('li', {
153
- class: ['vxe-table--filter-option', {
154
- 'is--checked': isAllChecked,
155
- 'is--indeterminate': isAllIndeterminate
156
- }],
157
- title: getI18n(multiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter'),
158
- onClick: evnt => {
159
- changeAllOption(evnt, !filterStore.isAllSelected);
160
- }
161
- }, (multiple ? [(0, _vue.h)('span', {
162
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
163
- })] : []).concat([(0, _vue.h)('span', {
164
- class: 'vxe-checkbox--label'
165
- }, getI18n('vxe.table.allFilter'))]))]), (0, _vue.h)('ul', {
166
- class: 'vxe-table--filter-body',
167
- style: maxHeight ? {
168
- maxHeight: `${maxHeight}px`
169
- } : {}
170
- }, filterStore.options.map(item => {
171
- const isChecked = item._checked;
172
- const isIndeterminate = false;
173
- return (0, _vue.h)('li', {
174
- class: ['vxe-table--filter-option', {
175
- 'is--checked': item._checked
176
- }],
177
- title: item.label,
178
- onClick: evnt => {
179
- changeOption(evnt, !item._checked, item);
180
- }
181
- }, (multiple ? [(0, _vue.h)('span', {
182
- class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
183
- })] : []).concat([(0, _vue.h)('span', {
184
- class: 'vxe-checkbox--label'
185
- }, (0, _utils.formatText)(item.label, 1))]));
186
- }))];
187
- };
188
- const renderFooters = () => {
189
- const {
190
- filterStore
191
- } = props;
192
- const {
193
- column,
194
- multiple
195
- } = filterStore;
196
- const filterOpts = computeFilterOpts.value;
197
- const hasCheckOption = computeHasCheckOption.value;
198
- const {
199
- filterRender
200
- } = column;
201
- const compConf = (0, _utils.isEnableConf)(filterRender) ? renderer.get(filterRender.name) : null;
202
- const isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
203
- return multiple && (compConf ? !(compConf.showTableFilterFooter === false || compConf.showFilterFooter === false || compConf.isFooter === false) : true) ? [(0, _vue.h)('div', {
204
- class: 'vxe-table--filter-footer'
205
- }, [(0, _vue.h)('button', {
206
- class: {
207
- 'is--disabled': isDisabled
208
- },
209
- disabled: isDisabled,
210
- onClick: confirmFilter
211
- }, filterOpts.confirmButtonText || getI18n('vxe.table.confirmFilter')), (0, _vue.h)('button', {
212
- onClick: resetFilter
213
- }, filterOpts.resetButtonText || getI18n('vxe.table.resetFilter'))])] : [];
214
- };
215
- const renderVN = () => {
216
- const {
217
- filterStore
218
- } = props;
219
- const {
220
- initStore
221
- } = tableReactData;
222
- const {
223
- visible,
224
- multiple,
225
- column
226
- } = filterStore;
227
- const filterRender = column ? column.filterRender : null;
228
- const compConf = (0, _utils.isEnableConf)(filterRender) ? renderer.get(filterRender.name) : null;
229
- const filterClassName = compConf ? compConf.tableFilterClassName || compConf.filterClassName : '';
230
- const params = Object.assign({}, tableInternalData._currFilterParams, {
231
- $panel: $xeFilterPanel,
232
- $table: $xeTable
233
- });
234
- const tableProps = $xeTable.props;
235
- const {
236
- computeSize
237
- } = $xeTable.getComputeMaps();
238
- const vSize = computeSize.value;
239
- const filterOpts = computeFilterOpts.value;
240
- const {
241
- transfer,
242
- destroyOnClose
243
- } = filterOpts;
244
- return (0, _vue.h)(_vue.Teleport, {
245
- to: 'body',
246
- disabled: !transfer
247
- }, [(0, _vue.h)('div', {
248
- ref: refElem,
249
- class: ['vxe-table--filter-wrapper', 'filter--prevent-default', (0, _dom.getPropClass)(filterClassName, params), {
250
- [`size--${vSize}`]: vSize,
251
- 'is--animat': tableProps.animat,
252
- 'is--multiple': multiple,
253
- 'is--active': visible
254
- }],
255
- style: filterStore.style
256
- }, initStore.filter && (destroyOnClose ? visible : true) && column ? renderOptions(filterRender, compConf).concat(renderFooters()) : [])]);
257
- };
258
- $xeFilterPanel.renderVN = renderVN;
259
- return $xeFilterPanel;
260
- },
261
- render() {
262
- return this.renderVN();
263
- }
264
- });
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _vue=require("vue"),_comp=require("../../../ui/src/comp"),_ui=require("../../../ui"),_utils=require("../../../ui/src/utils"),_dom=require("../../../ui/src/dom"),_vn=require("../../../ui/src/vn"),_log=require("../../../ui/src/log"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{getI18n,getIcon,renderer}=_ui.VxeUI;var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableFilterPanel",props:{filterStore:Object},setup(p,e){var t=_xeUtils.default.uniqueId();let _=(0,_vue.inject)("$xeTable",{}),{reactData:h,internalData:m,getComputeMaps:l}=_,f=l().computeFilterOpts,x=(0,_vue.ref)(),r={refElem:x},b={xID:t,props:p,context:e,getRefMaps:()=>r},g=(0,_vue.computed)(()=>{var e=p.filterStore;return e&&e.options.some(e=>e.checked)}),i=(e,t)=>{var l=p.filterStore;l.options.forEach(e=>{e._checked=t,e.checked=t}),l.isAllSelected=t,l.isIndeterminate=!1},C=e=>{e||(0,_log.warnLog)("vxe.error.delFunc",["confirmFilter","saveFilterPanelByEvent"]),_.handleFilterConfirmFilter(e||new Event("click"))};let F=e=>{_.handleFilterResetFilter(e)};let E=(e,t,l)=>{_.handleFilterChangeOption(e,t,l)},I=(e,t)=>{var l=p.filterStore;l.multiple?i(0,t):F(e)};t={changeRadioOption:(e,t,l)=>{_.handleFilterChangeRadioOption(e,t,l)},changeMultipleOption:(e,t,l)=>{_.handleFilterChangeMultipleOption(e,t,l)},changeAllOption:I,changeOption:E,confirmFilter:C,resetFilter:F};Object.assign(b,t);return b.renderVN=()=>{var e=p.filterStore,t=h.initStore,{visible:l,multiple:r,column:i}=e,a=i?i.filterRender:null,n=(0,_utils.isEnableConf)(a)?renderer.get(a.name):null,o=n?n.tableFilterClassName||n.filterClassName:"",s=Object.assign({},m._currFilterParams,{$panel:b,$table:_}),u=_.props,c=_.getComputeMaps().computeSize,c=c.value,{transfer:v,destroyOnClose:d}=f.value;return(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!v},[(0,_vue.h)("div",{ref:x,class:["vxe-table--filter-wrapper","filter--prevent-default",(0,_dom.getPropClass)(o,s),{["size--"+c]:c,"is--animat":u.animat,"is--multiple":r,"is--active":l}],style:e.style},t.filter&&(!d||l)&&i?((e,t)=>{let l=p.filterStore,{column:r,multiple:i,maxHeight:a}=l;var n=r?r.slots:null,n=n?n.filter:null,o=Object.assign({},m._currFilterParams,{$panel:b,$table:_}),t=t?t.renderTableFilter||t.renderFilter:null;return n?[(0,_vue.h)("div",{class:"vxe-table--filter-template",style:a?{maxHeight:a+"px"}:{}},_.callSlot(n,o))]:t?[(0,_vue.h)("div",{class:"vxe-table--filter-template",style:a?{maxHeight:a+"px"}:{}},(0,_vn.getSlotVNs)(t(e,o)))]:(n=i?l.isAllSelected:!l.options.some(e=>e._checked),t=i&&l.isIndeterminate,[(0,_vue.h)("ul",{class:"vxe-table--filter-header"},[(0,_vue.h)("li",{class:["vxe-table--filter-option",{"is--checked":n,"is--indeterminate":t}],title:getI18n(i?"vxe.table.allTitle":"vxe.table.allFilter"),onClick:e=>{I(e,!l.isAllSelected)}},(i?[(0,_vue.h)("span",{class:["vxe-checkbox--icon",t?getIcon().TABLE_CHECKBOX_INDETERMINATE:n?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]})]:[]).concat([(0,_vue.h)("span",{class:"vxe-checkbox--label"},getI18n("vxe.table.allFilter"))]))]),(0,_vue.h)("ul",{class:"vxe-table--filter-body",style:a?{maxHeight:a+"px"}:{}},l.options.map(t=>{var e=t._checked;return(0,_vue.h)("li",{class:["vxe-table--filter-option",{"is--checked":t._checked}],title:t.label,onClick:e=>{E(e,!t._checked,t)}},(i?[(0,_vue.h)("span",{class:["vxe-checkbox--icon",e?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]})]:[]).concat([(0,_vue.h)("span",{class:"vxe-checkbox--label"},(0,_utils.formatText)(t.label,1))]))}))])})(a,n).concat((()=>{var e=p.filterStore,{column:t,multiple:l}=e,r=f.value,i=g.value,t=t.filterRender,t=(0,_utils.isEnableConf)(t)?renderer.get(t.name):null,i=!i&&!e.isAllSelected&&!e.isIndeterminate;return l&&(!t||!1!==t.showTableFilterFooter&&!1!==t.showFilterFooter&&!1!==t.isFooter)?[(0,_vue.h)("div",{class:"vxe-table--filter-footer"},[(0,_vue.h)("button",{class:{"is--disabled":i},disabled:i,onClick:C},r.confirmButtonText||getI18n("vxe.table.confirmFilter")),(0,_vue.h)("button",{onClick:F},r.resetButtonText||getI18n("vxe.table.resetFilter"))])]:[]})()):[])])},b},render(){return this.renderVN()}});