vxe-table 4.16.17 → 4.16.18

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