vxe-table 4.2.8 → 4.3.0-beta.2

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 (227) hide show
  1. package/es/button/src/button.js +14 -14
  2. package/es/button/style.css +1 -58
  3. package/es/checkbox/src/checkbox.js +7 -4
  4. package/es/checkbox/style.css +37 -58
  5. package/es/edit/src/hook.js +29 -13
  6. package/es/export/src/export-panel.js +10 -20
  7. package/es/export/src/hook.js +45 -45
  8. package/es/export/src/import-panel.js +2 -2
  9. package/es/export/src/util.js +7 -7
  10. package/es/export/style.css +27 -82
  11. package/es/filter/src/hook.js +5 -5
  12. package/es/filter/src/panel.js +9 -17
  13. package/es/filter/style.css +27 -79
  14. package/es/footer/src/footer.js +15 -15
  15. package/es/form/src/form-config-item.js +8 -7
  16. package/es/form/src/form-item.js +8 -7
  17. package/es/form/src/form.js +8 -6
  18. package/es/form/style.css +0 -3
  19. package/es/grid/src/grid.js +18 -13
  20. package/es/grid/style.css +1 -1
  21. package/es/header/src/header.js +18 -18
  22. package/es/header/style.css +0 -95
  23. package/es/icon/style.css +379 -0
  24. package/es/input/src/input.js +26 -26
  25. package/es/input/style.css +13 -4
  26. package/es/keyboard/src/hook.js +7 -7
  27. package/es/list/src/list.js +5 -5
  28. package/es/loading/src/loading.js +1 -1
  29. package/es/menu/src/hooks.js +9 -9
  30. package/es/menu/src/panel.js +2 -2
  31. package/es/modal/src/modal.js +52 -51
  32. package/es/modal/style.css +2 -3
  33. package/es/pager/src/pager.js +3 -3
  34. package/es/pager/style.css +4 -2
  35. package/es/pulldown/src/pulldown.js +7 -7
  36. package/es/radio/src/button.js +1 -1
  37. package/es/radio/src/radio.js +5 -4
  38. package/es/radio/style.css +32 -55
  39. package/es/select/src/select.js +13 -12
  40. package/es/select/style.css +1 -0
  41. package/es/style.css +1 -1
  42. package/es/style.min.css +1 -1
  43. package/es/switch/src/switch.js +1 -1
  44. package/es/table/src/body.js +38 -34
  45. package/es/table/src/cell.js +16 -28
  46. package/es/table/src/columnInfo.js +4 -4
  47. package/es/table/src/table.js +65 -60
  48. package/es/table/src/util.js +2 -2
  49. package/es/table/style.css +160 -139
  50. package/es/textarea/src/textarea.js +5 -5
  51. package/es/toolbar/src/toolbar.js +17 -24
  52. package/es/toolbar/style.css +28 -80
  53. package/es/tools/dom.js +2 -2
  54. package/es/tools/log.js +1 -1
  55. package/es/tools/vn.js +7 -0
  56. package/es/tooltip/src/tooltip.js +22 -10
  57. package/es/v-x-e-table/index.js +1 -1
  58. package/es/v-x-e-table/src/conf.js +43 -38
  59. package/es/v-x-e-table/src/interceptor.js +1 -1
  60. package/es/v-x-e-table/src/renderer.js +19 -15
  61. package/es/v-x-e-table/style.css +405 -2
  62. package/lib/button/src/button.js +10 -10
  63. package/lib/button/src/button.min.js +1 -1
  64. package/lib/button/style/style.css +1 -58
  65. package/lib/button/style/style.min.css +1 -1
  66. package/lib/checkbox/src/checkbox.js +5 -3
  67. package/lib/checkbox/src/checkbox.min.js +1 -1
  68. package/lib/checkbox/style/style.css +37 -58
  69. package/lib/checkbox/style/style.min.css +1 -1
  70. package/lib/edit/src/hook.js +14 -13
  71. package/lib/edit/src/hook.min.js +1 -1
  72. package/lib/export/src/export-panel.js +11 -17
  73. package/lib/export/src/export-panel.min.js +1 -1
  74. package/lib/export/src/hook.js +50 -50
  75. package/lib/export/src/hook.min.js +1 -1
  76. package/lib/export/src/import-panel.js +3 -3
  77. package/lib/export/src/import-panel.min.js +1 -1
  78. package/lib/export/src/util.js +4 -4
  79. package/lib/export/src/util.min.js +1 -1
  80. package/lib/export/style/style.css +27 -82
  81. package/lib/export/style/style.min.css +1 -1
  82. package/lib/filter/src/hook.js +5 -5
  83. package/lib/filter/src/hook.min.js +1 -1
  84. package/lib/filter/src/panel.js +11 -15
  85. package/lib/filter/src/panel.min.js +1 -1
  86. package/lib/filter/style/style.css +27 -79
  87. package/lib/filter/style/style.min.css +1 -1
  88. package/lib/footer/src/footer.js +14 -14
  89. package/lib/footer/src/footer.min.js +1 -1
  90. package/lib/form/src/form-config-item.js +9 -7
  91. package/lib/form/src/form-config-item.min.js +1 -1
  92. package/lib/form/src/form-item.js +9 -7
  93. package/lib/form/src/form-item.min.js +1 -1
  94. package/lib/form/src/form.js +9 -6
  95. package/lib/form/src/form.min.js +1 -1
  96. package/lib/form/style/style.css +0 -3
  97. package/lib/form/style/style.min.css +1 -1
  98. package/lib/grid/src/grid.js +17 -13
  99. package/lib/grid/src/grid.min.js +1 -1
  100. package/lib/grid/style/style.css +1 -1
  101. package/lib/grid/style/style.min.css +1 -1
  102. package/lib/header/src/header.js +17 -17
  103. package/lib/header/src/header.min.js +1 -1
  104. package/lib/header/style/style.css +0 -95
  105. package/lib/header/style/style.min.css +0 -1
  106. package/lib/icon/style/style.css +379 -0
  107. package/lib/icon/style/style.min.css +1 -1
  108. package/lib/index.umd.js +163 -159
  109. package/lib/index.umd.min.js +1 -1
  110. package/lib/input/src/input.js +23 -23
  111. package/lib/input/src/input.min.js +1 -1
  112. package/lib/input/style/style.css +13 -4
  113. package/lib/input/style/style.min.css +1 -1
  114. package/lib/keyboard/src/hook.js +7 -7
  115. package/lib/keyboard/src/hook.min.js +1 -1
  116. package/lib/list/src/list.js +5 -5
  117. package/lib/list/src/list.min.js +1 -1
  118. package/lib/loading/src/loading.js +1 -1
  119. package/lib/loading/src/loading.min.js +1 -1
  120. package/lib/menu/src/hooks.js +9 -9
  121. package/lib/menu/src/hooks.min.js +1 -1
  122. package/lib/menu/src/panel.js +2 -2
  123. package/lib/menu/src/panel.min.js +1 -1
  124. package/lib/modal/src/modal.js +55 -53
  125. package/lib/modal/src/modal.min.js +1 -1
  126. package/lib/modal/style/style.css +2 -3
  127. package/lib/modal/style/style.min.css +1 -1
  128. package/lib/pager/src/pager.js +2 -2
  129. package/lib/pager/src/pager.min.js +1 -1
  130. package/lib/pager/style/style.css +4 -2
  131. package/lib/pager/style/style.min.css +1 -1
  132. package/lib/pulldown/src/pulldown.js +7 -7
  133. package/lib/pulldown/src/pulldown.min.js +1 -1
  134. package/lib/radio/src/button.js +1 -1
  135. package/lib/radio/src/button.min.js +1 -1
  136. package/lib/radio/src/radio.js +4 -4
  137. package/lib/radio/src/radio.min.js +1 -1
  138. package/lib/radio/style/style.css +32 -55
  139. package/lib/radio/style/style.min.css +1 -1
  140. package/lib/select/src/select.js +14 -12
  141. package/lib/select/src/select.min.js +1 -1
  142. package/lib/select/style/style.css +1 -0
  143. package/lib/select/style/style.min.css +1 -1
  144. package/lib/style.css +1 -1
  145. package/lib/style.min.css +1 -1
  146. package/lib/switch/src/switch.js +1 -1
  147. package/lib/switch/src/switch.min.js +1 -1
  148. package/lib/table/src/body.js +36 -34
  149. package/lib/table/src/body.min.js +1 -1
  150. package/lib/table/src/cell.js +21 -29
  151. package/lib/table/src/cell.min.js +1 -1
  152. package/lib/table/src/columnInfo.js +4 -4
  153. package/lib/table/src/columnInfo.min.js +1 -1
  154. package/lib/table/src/table.js +65 -61
  155. package/lib/table/src/table.min.js +1 -1
  156. package/lib/table/src/util.js +2 -2
  157. package/lib/table/src/util.min.js +1 -1
  158. package/lib/table/style/style.css +160 -139
  159. package/lib/table/style/style.min.css +1 -1
  160. package/lib/textarea/src/textarea.js +6 -6
  161. package/lib/textarea/src/textarea.min.js +1 -1
  162. package/lib/toolbar/src/toolbar.js +20 -22
  163. package/lib/toolbar/src/toolbar.min.js +1 -1
  164. package/lib/toolbar/style/style.css +28 -80
  165. package/lib/toolbar/style/style.min.css +1 -1
  166. package/lib/tools/dom.js +2 -2
  167. package/lib/tools/dom.min.js +1 -1
  168. package/lib/tools/log.js +1 -1
  169. package/lib/tools/log.min.js +1 -1
  170. package/lib/tools/vn.js +13 -0
  171. package/lib/tools/vn.min.js +1 -1
  172. package/lib/tooltip/src/tooltip.js +22 -8
  173. package/lib/tooltip/src/tooltip.min.js +1 -1
  174. package/lib/v-x-e-table/index.js +1 -1
  175. package/lib/v-x-e-table/index.min.js +1 -1
  176. package/lib/v-x-e-table/src/conf.js +43 -38
  177. package/lib/v-x-e-table/src/conf.min.js +1 -1
  178. package/lib/v-x-e-table/src/interceptor.js +1 -1
  179. package/lib/v-x-e-table/src/interceptor.min.js +1 -1
  180. package/lib/v-x-e-table/src/renderer.js +18 -16
  181. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  182. package/lib/v-x-e-table/style/style.css +405 -2
  183. package/lib/v-x-e-table/style/style.min.css +1 -1
  184. package/package.json +6 -6
  185. package/packages/checkbox/src/checkbox.ts +7 -4
  186. package/packages/edit/src/hook.ts +18 -6
  187. package/packages/export/src/export-panel.ts +9 -19
  188. package/packages/filter/src/panel.ts +8 -16
  189. package/packages/form/src/form-config-item.ts +4 -3
  190. package/packages/form/src/form-item.ts +4 -3
  191. package/packages/form/src/form.ts +6 -4
  192. package/packages/grid/src/grid.ts +2 -1
  193. package/packages/input/src/input.ts +3 -3
  194. package/packages/modal/src/modal.ts +5 -4
  195. package/packages/radio/src/radio.ts +4 -3
  196. package/packages/select/src/select.ts +2 -1
  197. package/packages/table/src/cell.ts +18 -35
  198. package/packages/table/src/table.ts +11 -10
  199. package/packages/toolbar/src/toolbar.ts +14 -21
  200. package/packages/tools/vn.ts +10 -0
  201. package/packages/tooltip/src/tooltip.ts +8 -4
  202. package/packages/v-x-e-table/src/conf.ts +43 -38
  203. package/styles/base/checked.scss +44 -148
  204. package/styles/button.scss +1 -43
  205. package/styles/checkbox.scss +6 -65
  206. package/styles/export.scss +2 -9
  207. package/styles/filter.scss +2 -6
  208. package/styles/form.scss +0 -3
  209. package/styles/header.scss +0 -134
  210. package/styles/icon.scss +509 -713
  211. package/styles/input.scss +8 -0
  212. package/styles/modal.scss +0 -1
  213. package/styles/old-icon.scss +713 -0
  214. package/styles/pager.scss +2 -0
  215. package/styles/radio.scss +9 -77
  216. package/styles/select.scss +1 -0
  217. package/styles/table.scss +144 -21
  218. package/styles/toolbar.scss +2 -6
  219. package/styles/variable.scss +5 -5
  220. package/types/all.d.ts +6 -0
  221. package/types/column.d.ts +11 -11
  222. package/types/component.d.ts +3 -1
  223. package/types/form-item.d.ts +1 -0
  224. package/types/form.d.ts +6 -2
  225. package/types/grid.d.ts +4 -4
  226. package/types/table.d.ts +2 -2
  227. package/types/v-x-e-table/renderer.d.ts +3 -2
@@ -319,7 +319,7 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
319
319
  }
320
320
  // 如果当前行被激活编辑,则清除激活状态
321
321
  if (actived.row && $xetable.findRowIndexOf(rows, actived.row) > -1) {
322
- editMethods.clearActived()
322
+ editMethods.clearEdit()
323
323
  }
324
324
  // 从新增中移除已删除的数据
325
325
  rows.forEach((row: any) => {
@@ -551,7 +551,14 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
551
551
  return $xetable.scrollToRow(row, column).then(() => {
552
552
  const cell = $xetable.getCell(row, column)
553
553
  if (cell) {
554
- editPrivateMethods.handleActived({ row, rowIndex: $xetable.getRowIndex(row), column, columnIndex: $xetable.getColumnIndex(column), cell, $table: $xetable })
554
+ editPrivateMethods.handleActived({
555
+ row,
556
+ rowIndex: $xetable.getRowIndex(row),
557
+ column,
558
+ columnIndex: $xetable.getColumnIndex(column),
559
+ cell,
560
+ $table: $xetable
561
+ })
555
562
  internalData._lastCallTime = Date.now()
556
563
  }
557
564
  return nextTick()
@@ -564,14 +571,19 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
564
571
  */
565
572
  setSelectCell (row, fieldOrColumn) {
566
573
  const { tableData } = reactData
567
- const { visibleColumn } = internalData
568
574
  const editOpts = computeEditOpts.value
569
575
  const column = XEUtils.isString(fieldOrColumn) ? $xetable.getColumnByField(fieldOrColumn) : fieldOrColumn
570
576
  if (row && column && editOpts.trigger !== 'manual') {
571
577
  const rowIndex = $xetable.findRowIndexOf(tableData, row)
572
578
  if (rowIndex > -1 && column) {
573
579
  const cell = $xetable.getCell(row, column)
574
- const params = { row, rowIndex, column, columnIndex: visibleColumn.indexOf(column), cell }
580
+ const params = {
581
+ row,
582
+ rowIndex,
583
+ column,
584
+ columnIndex: $xetable.getColumnIndex(column),
585
+ cell
586
+ }
575
587
  $xetable.handleSelected(params, {})
576
588
  }
577
589
  }
@@ -608,7 +620,7 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
608
620
  }
609
621
  $xetable.closeTooltip()
610
622
  if (actived.column) {
611
- editMethods.clearActived(evnt)
623
+ editMethods.clearEdit(evnt)
612
624
  }
613
625
  type = 'edit-actived'
614
626
  column.renderHeight = cell.offsetHeight
@@ -714,7 +726,7 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
714
726
  const selectMethod = () => {
715
727
  if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
716
728
  if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
717
- editMethods.clearActived(evnt)
729
+ editMethods.clearEdit(evnt)
718
730
  editMethods.clearSelected()
719
731
  if ($xetable.clearCellAreas) {
720
732
  $xetable.clearCellAreas()
@@ -153,7 +153,7 @@ export default defineComponent({
153
153
 
154
154
  const renderVN = () => {
155
155
  const { defaultOptions, storeData } = props
156
- const { isAll, isIndeterminate } = reactData
156
+ const { isAll: isAllChecked, isIndeterminate: isAllIndeterminate } = reactData
157
157
  const { hasTree, hasMerge, isPrint, hasColgroup } = storeData
158
158
  const { isHeader } = defaultOptions
159
159
  const cols: any[] = []
@@ -164,12 +164,14 @@ export default defineComponent({
164
164
  XEUtils.eachTree(storeData.columns, (column: any) => {
165
165
  const colTitle = formatText(column.getTitle(), 1)
166
166
  const isColGroup = column.children && column.children.length
167
+ const isChecked = column.checked
168
+ const indeterminate = column.halfChecked
167
169
  cols.push(
168
170
  h('li', {
169
171
  class: ['vxe-export--panel-column-option', `level--${column.level}`, {
170
172
  'is--group': isColGroup,
171
- 'is--checked': column.checked,
172
- 'is--indeterminate': column.halfChecked,
173
+ 'is--checked': isChecked,
174
+ 'is--indeterminate': indeterminate,
173
175
  'is--disabled': column.disabled
174
176
  }],
175
177
  title: colTitle,
@@ -180,13 +182,7 @@ export default defineComponent({
180
182
  }
181
183
  }, [
182
184
  h('span', {
183
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
184
- }),
185
- h('span', {
186
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
187
- }),
188
- h('span', {
189
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
185
+ class: ['vxe-checkbox--icon', indeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
190
186
  }),
191
187
  h('span', {
192
188
  class: 'vxe-checkbox--label'
@@ -295,20 +291,14 @@ export default defineComponent({
295
291
  }, [
296
292
  h('li', {
297
293
  class: ['vxe-export--panel-column-option', {
298
- 'is--checked': isAll,
299
- 'is--indeterminate': isIndeterminate
294
+ 'is--checked': isAllChecked,
295
+ 'is--indeterminate': isAllIndeterminate
300
296
  }],
301
297
  title: GlobalConfig.i18n('vxe.table.allTitle'),
302
298
  onClick: allColumnEvent
303
299
  }, [
304
300
  h('span', {
305
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
306
- }),
307
- h('span', {
308
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
309
- }),
310
- h('span', {
311
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
301
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
312
302
  }),
313
303
  h('span', {
314
304
  class: 'vxe-checkbox--label'
@@ -121,14 +121,16 @@ export default defineComponent({
121
121
  }, compConf.renderFilter(filterRender, params))
122
122
  ]
123
123
  }
124
+ const isAllChecked = multiple ? filterStore.isAllSelected : !filterStore.options.some((item: any) => item._checked)
125
+ const isAllIndeterminate = multiple && filterStore.isIndeterminate
124
126
  return [
125
127
  h('ul', {
126
128
  class: 'vxe-table--filter-header'
127
129
  }, [
128
130
  h('li', {
129
131
  class: ['vxe-table--filter-option', {
130
- 'is--checked': multiple ? filterStore.isAllSelected : !filterStore.options.some((item: any) => item._checked),
131
- 'is--indeterminate': multiple && filterStore.isIndeterminate
132
+ 'is--checked': isAllChecked,
133
+ 'is--indeterminate': isAllIndeterminate
132
134
  }],
133
135
  title: GlobalConfig.i18n(multiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter'),
134
136
  onClick: (evnt: MouseEvent) => {
@@ -136,13 +138,7 @@ export default defineComponent({
136
138
  }
137
139
  }, (multiple ? [
138
140
  h('span', {
139
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
140
- }),
141
- h('span', {
142
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
143
- }),
144
- h('span', {
145
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
141
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
146
142
  })
147
143
  ] : []).concat([
148
144
  h('span', {
@@ -156,6 +152,8 @@ export default defineComponent({
156
152
  maxHeight: `${maxHeight}px`
157
153
  } : {}
158
154
  }, filterStore.options.map((item: any) => {
155
+ const isChecked = item._checked
156
+ const isIndeterminate = false
159
157
  return h('li', {
160
158
  class: ['vxe-table--filter-option', {
161
159
  'is--checked': item._checked
@@ -166,13 +164,7 @@ export default defineComponent({
166
164
  }
167
165
  }, (multiple ? [
168
166
  h('span', {
169
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
170
- }),
171
- h('span', {
172
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
173
- }),
174
- h('span', {
175
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
167
+ class: ['vxe-checkbox--icon', isIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
176
168
  })
177
169
  ] : []).concat([
178
170
  h('span', {
@@ -3,10 +3,11 @@ import XEUtils from 'xe-utils'
3
3
  import GlobalConfig from '../../v-x-e-table/src/conf'
4
4
  import { VXETable } from '../../v-x-e-table'
5
5
  import { getFuncText, isEnableConf } from '../../tools/utils'
6
+ import { getSlotVNs } from '../../tools/vn'
6
7
  import { renderTitle } from './render'
7
8
  import { isActivetem } from './util'
8
9
 
9
- import { VxeFormConstructor, VxeFormDefines, VxeFormPrivateMethods } from '../../../types/all'
10
+ import { VxeFormConstructor, VxeFormDefines, VxeFormPrivateMethods, SlotVNodeType } from '../../../types/all'
10
11
 
11
12
  const VxeFormConfigItem = defineComponent({
12
13
  name: 'VxeFormConfigItem',
@@ -68,11 +69,11 @@ const VxeFormConfigItem = defineComponent({
68
69
  class: ['vxe-form--gather vxe-row', item.id, span ? `vxe-col--${span} is--span` : '', className ? (XEUtils.isFunction(className) ? className(params) : className) : '']
69
70
  }, childVNs) : createCommentVNode()
70
71
  }
71
- let contentVNs: any[] = []
72
+ let contentVNs: SlotVNodeType[] = []
72
73
  if (defaultSlot) {
73
74
  contentVNs = $xeform.callSlot(defaultSlot, params)
74
75
  } else if (compConf && compConf.renderItemContent) {
75
- contentVNs = compConf.renderItemContent(itemRender, params)
76
+ contentVNs = getSlotVNs(compConf.renderItemContent(itemRender, params))
76
77
  } else if (field) {
77
78
  contentVNs = [XEUtils.toValueString(XEUtils.get(data, field))]
78
79
  }
@@ -3,10 +3,11 @@ import XEUtils from 'xe-utils'
3
3
  import GlobalConfig from '../../v-x-e-table/src/conf'
4
4
  import { VXETable } from '../../v-x-e-table'
5
5
  import { getFuncText, isEnableConf } from '../../tools/utils'
6
+ import { getSlotVNs } from '../../tools/vn'
6
7
  import { createItem, watchItem, destroyItem, assemItem, XEFormItemProvide, isActivetem } from './util'
7
8
  import { renderTitle } from './render'
8
9
 
9
- import { VxeFormConstructor, VxeFormDefines, VxeFormItemPropTypes, VxeFormPrivateMethods } from '../../../types/all'
10
+ import { SlotVNodeType, VxeFormConstructor, VxeFormDefines, VxeFormItemPropTypes, VxeFormPrivateMethods } from '../../../types/all'
10
11
 
11
12
  export const formItemProps = {
12
13
  title: String as PropType<VxeFormItemPropTypes.Title>,
@@ -92,11 +93,11 @@ export default defineComponent({
92
93
  isRequired = itemRules.some((rule) => rule.required)
93
94
  }
94
95
  }
95
- let contentVNs: any[] = []
96
+ let contentVNs: SlotVNodeType[] = []
96
97
  if (defaultSlot) {
97
98
  contentVNs = $xeform.callSlot(defaultSlot, params)
98
99
  } else if (compConf && compConf.renderItemContent) {
99
- contentVNs = compConf.renderItemContent(itemRender, params)
100
+ contentVNs = getSlotVNs(compConf.renderItemContent(itemRender, params))
100
101
  } else if (field) {
101
102
  contentVNs = [`${XEUtils.get(data, field)}`]
102
103
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent, h, ref, Ref, resolveComponent, ComponentOptions, createCommentVNode, provide, computed, reactive, watch, nextTick, PropType, VNode, onMounted } from 'vue'
1
+ import { defineComponent, h, ref, Ref, resolveComponent, ComponentOptions, createCommentVNode, provide, computed, reactive, watch, nextTick, PropType, onMounted } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import GlobalConfig from '../../v-x-e-table/src/conf'
4
4
  import { VXETable } from '../../v-x-e-table'
@@ -9,6 +9,7 @@ import { createItem, handleFieldOrItem, isHiddenItem, isActivetem } from './util
9
9
  import { useSize } from '../../hooks/size'
10
10
  import VxeFormConfigItem from './form-config-item'
11
11
  import VxeLoading from '../../loading/index'
12
+ import { getSlotVNs } from '../../tools/vn'
12
13
 
13
14
  import { VxeFormConstructor, VxeFormPropTypes, VxeFormEmits, FormReactData, FormMethods, FormPrivateRef, VxeFormPrivateMethods, VxeFormDefines, VxeFormItemPropTypes, VxeTooltipInstance, FormInternalData, VxeFormPrivateComputed } from '../../../types/all'
14
15
 
@@ -83,6 +84,7 @@ export default defineComponent({
83
84
  titleAsterisk: { type: Boolean as PropType<VxeFormPropTypes.TitleAsterisk>, default: () => GlobalConfig.form.titleAsterisk },
84
85
  titleOverflow: { type: [Boolean, String] as PropType<VxeFormPropTypes.TitleOverflow>, default: null },
85
86
  className: [String, Function] as PropType<VxeFormPropTypes.ClassName>,
87
+ readonly: Boolean as PropType<VxeFormPropTypes.Readonly>,
86
88
  items: Array as PropType<VxeFormPropTypes.Items>,
87
89
  rules: Object as PropType<VxeFormPropTypes.Rules>,
88
90
  preventSubmit: { type: Boolean as PropType<VxeFormPropTypes.PreventSubmit>, default: () => GlobalConfig.form.preventSubmit },
@@ -153,13 +155,13 @@ export default defineComponent({
153
155
  getComputeMaps: () => computeMaps
154
156
  } as unknown as VxeFormConstructor & VxeFormPrivateMethods
155
157
 
156
- const callSlot = (slotFunc: ((params: any) => any) | string | null, params: any): VNode[] => {
158
+ const callSlot = (slotFunc: ((params: any) => any) | string | null, params: any) => {
157
159
  if (slotFunc) {
158
160
  if (XEUtils.isString(slotFunc)) {
159
161
  slotFunc = slots[slotFunc] || null
160
162
  }
161
163
  if (XEUtils.isFunction(slotFunc)) {
162
- return slotFunc(params)
164
+ return getSlotVNs(slotFunc(params))
163
165
  }
164
166
  }
165
167
  return []
@@ -241,7 +243,7 @@ export default defineComponent({
241
243
  if (compConf && compConf.itemResetMethod) {
242
244
  compConf.itemResetMethod({ data, field, property: field, item, $form: $xeform })
243
245
  } else if (field) {
244
- XEUtils.set(data, field, resetValue === null ? getResetValue(XEUtils.get(data, field), undefined) : resetValue)
246
+ XEUtils.set(data, field, resetValue === null ? getResetValue(XEUtils.get(data, field), undefined) : XEUtils.clone(resetValue, true))
245
247
  }
246
248
  }
247
249
  })
@@ -9,6 +9,7 @@ import tableComponentProps from '../../table/src/props'
9
9
  import tableComponentEmits from '../../table/src/emits'
10
10
  import { useSize } from '../../hooks/size'
11
11
  import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event'
12
+ import { getSlotVNs } from '../../tools/vn'
12
13
 
13
14
  import { TableMethods, VxeGridConstructor, VxeGridEmits, GridReactData, VxeGridPropTypes, VxeToolbarPropTypes, GridMethods, GridPrivateMethods, VxeGridPrivateComputed, VxeGridPrivateMethods, VxePagerInstance, VxeToolbarInstance, GridPrivateRef, VxeFormInstance, VxeTableProps, VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods, VxeTableEvents, VxePagerEvents, VxeFormEvents, VxeTableDefines, VxeTableEventProps, VxeFormItemProps, VxeGridProps } from '../../../types/all'
14
15
 
@@ -1024,7 +1025,7 @@ export default defineComponent({
1024
1025
  slotFunc = slots[slotFunc] || null
1025
1026
  }
1026
1027
  if (XEUtils.isFunction(slotFunc)) {
1027
- return slotFunc(params)
1028
+ return getSlotVNs(slotFunc(params))
1028
1029
  }
1029
1030
  }
1030
1031
  return []
@@ -1952,7 +1952,7 @@ export default defineComponent({
1952
1952
  onClick: datePrevEvent
1953
1953
  }, [
1954
1954
  h('i', {
1955
- class: 'vxe-icon--caret-left'
1955
+ class: 'vxe-icon-caret-left'
1956
1956
  })
1957
1957
  ]),
1958
1958
  h('span', {
@@ -1960,7 +1960,7 @@ export default defineComponent({
1960
1960
  onClick: dateTodayMonthEvent
1961
1961
  }, [
1962
1962
  h('i', {
1963
- class: 'vxe-icon--dot'
1963
+ class: 'vxe-icon-dot'
1964
1964
  })
1965
1965
  ]),
1966
1966
  h('span', {
@@ -1970,7 +1970,7 @@ export default defineComponent({
1970
1970
  onClick: dateNextEvent
1971
1971
  }, [
1972
1972
  h('i', {
1973
- class: 'vxe-icon--caret-right'
1973
+ class: 'vxe-icon-caret-right'
1974
1974
  })
1975
1975
  ]),
1976
1976
  multiple && computeSupportMultiples.value ? h('span', {
@@ -8,6 +8,7 @@ import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event'
8
8
  import GlobalConfig from '../../v-x-e-table/src/conf'
9
9
  import VxeButtonConstructor from '../../button/src/button'
10
10
  import VxeLoading from '../../loading/index'
11
+ import { getSlotVNs } from '../../tools/vn'
11
12
 
12
13
  import { VxeModalConstructor, VxeModalPropTypes, ModalReactData, VxeModalEmits, ModalEventTypes, VxeButtonInstance, ModalMethods, ModalPrivateRef, VxeModalMethods } from '../../../types/all'
13
14
 
@@ -687,7 +688,7 @@ export default defineComponent({
687
688
  const { slots: propSlots = {}, showClose, showZoom, title } = props
688
689
  const { zoomLocat } = reactData
689
690
  const titleSlot = slots.title || propSlots.title
690
- const titVNs: VNode[] = titleSlot ? titleSlot({ $modal: $xemodal }) as VNode[] : [
691
+ const titVNs = titleSlot ? getSlotVNs(titleSlot({ $modal: $xemodal })) : [
691
692
  h('span', {
692
693
  class: 'vxe-modal--title'
693
694
  }, title ? getFuncText(title) : GlobalConfig.i18n('vxe.alert.title'))
@@ -736,7 +737,7 @@ export default defineComponent({
736
737
  'is--ellipsis': !isMsg && props.showTitleOverflow
737
738
  }],
738
739
  ...headerOns
739
- }, headerSlot ? (!reactData.inited || (props.destroyOnClose && !reactData.visible) ? [] : headerSlot({ $modal: $xemodal })) as VNode[] : renderTitles())
740
+ }, headerSlot ? (!reactData.inited || (props.destroyOnClose && !reactData.visible) ? [] : getSlotVNs(headerSlot({ $modal: $xemodal }))) : renderTitles())
740
741
  )
741
742
  }
742
743
  return headVNs
@@ -762,7 +763,7 @@ export default defineComponent({
762
763
  contVNs.push(
763
764
  h('div', {
764
765
  class: 'vxe-modal--content'
765
- }, defaultSlot ? (!reactData.inited || (props.destroyOnClose && !reactData.visible) ? [] : defaultSlot({ $modal: $xemodal })) as VNode[] : getFuncText(content))
766
+ }, defaultSlot ? (!reactData.inited || (props.destroyOnClose && !reactData.visible) ? [] : getSlotVNs(defaultSlot({ $modal: $xemodal }))) as VNode[] : getFuncText(content))
766
767
  )
767
768
  if (!isMsg) {
768
769
  /**
@@ -814,7 +815,7 @@ export default defineComponent({
814
815
  footVNs.push(
815
816
  h('div', {
816
817
  class: 'vxe-modal--footer'
817
- }, footerSlot ? (!reactData.inited || (props.destroyOnClose && !reactData.visible) ? [] : footerSlot({ $modal: $xemodal })) as VNode[] : renderBtns())
818
+ }, footerSlot ? (!reactData.inited || (props.destroyOnClose && !reactData.visible) ? [] : getSlotVNs(footerSlot({ $modal: $xemodal }))) as VNode[] : renderBtns())
818
819
  )
819
820
  }
820
821
  if (!isMsg && props.resize) {
@@ -100,10 +100,11 @@ export default defineComponent({
100
100
  const vSize = computeSize.value
101
101
  const isDisabled = computeDisabled.value
102
102
  const name = computeName.value
103
- const checked = computeChecked.value
103
+ const isChecked = computeChecked.value
104
104
  return h('label', {
105
105
  class: ['vxe-radio', {
106
106
  [`size--${vSize}`]: vSize,
107
+ 'is--checked': isChecked,
107
108
  'is--disabled': isDisabled
108
109
  }],
109
110
  title: props.title
@@ -112,13 +113,13 @@ export default defineComponent({
112
113
  class: 'vxe-radio--input',
113
114
  type: 'radio',
114
115
  name,
115
- checked,
116
+ checked: isChecked,
116
117
  disabled: isDisabled,
117
118
  onChange: changeEvent,
118
119
  onClick: clickEvent
119
120
  }),
120
121
  h('span', {
121
- class: 'vxe-radio--icon'
122
+ class: ['vxe-radio--icon', isChecked ? 'vxe-icon-radio-checked' : 'vxe-icon-radio-unchecked']
122
123
  }),
123
124
  h('span', {
124
125
  class: 'vxe-radio--label'
@@ -6,6 +6,7 @@ import { getEventTargetNode, getAbsolutePos } from '../../tools/dom'
6
6
  import { getLastZIndex, nextZIndex, getFuncText, formatText } from '../../tools/utils'
7
7
  import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event'
8
8
  import VxeInputComponent from '../../input/src/input'
9
+ import { getSlotVNs } from '../../tools/vn'
9
10
 
10
11
  import { VxeSelectPropTypes, VxeSelectConstructor, SelectReactData, VxeSelectEmits, VxeInputConstructor, SelectMethods, SelectPrivateRef, VxeSelectMethods, VxeOptgroupProps, VxeOptionProps, VxeFormDefines, VxeFormConstructor, VxeFormPrivateMethods, VxeInputDefines } from '../../../types/all'
11
12
 
@@ -147,7 +148,7 @@ export default defineComponent({
147
148
  slotFunc = slots[slotFunc] || null
148
149
  }
149
150
  if (XEUtils.isFunction(slotFunc)) {
150
- return slotFunc(params)
151
+ return getSlotVNs(slotFunc(params))
151
152
  }
152
153
  }
153
154
  return []
@@ -5,8 +5,9 @@ import { VXETable } from '../../v-x-e-table'
5
5
  import { getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../tools/utils'
6
6
  import { updateCellTitle } from '../../tools/dom'
7
7
  import { createColumn } from './util'
8
+ import { getSlotVNs } from '../../tools/vn'
8
9
 
9
- import { VxeTableConstructor, VxeTableDefines, VxeTablePrivateMethods } from '../../../types/all'
10
+ import { SlotVNodeType, VxeTableConstructor, VxeTableDefines, VxeTablePrivateMethods } from '../../../types/all'
10
11
 
11
12
  function renderHelpIcon (params: VxeTableDefines.CellRenderHeaderParams) {
12
13
  const { $table, column } = params
@@ -24,7 +25,7 @@ function renderHelpIcon (params: VxeTableDefines.CellRenderHeaderParams) {
24
25
  ] : []
25
26
  }
26
27
 
27
- function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams, content: VNode[] | string[] | string) {
28
+ function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams, content: SlotVNodeType[]) {
28
29
  const { $table, column } = params
29
30
  const { props, internalData } = $table
30
31
  const { computeTooltipOpts } = $table.getComputeMaps()
@@ -81,7 +82,7 @@ function getFooterContent (params: VxeTableDefines.CellRenderFooterParams) {
81
82
  if (renderOpts) {
82
83
  const compConf = VXETable.renderer.get(renderOpts.name)
83
84
  if (compConf && compConf.renderFooter) {
84
- return compConf.renderFooter(renderOpts, params)
85
+ return getSlotVNs(compConf.renderFooter(renderOpts, params))
85
86
  }
86
87
  }
87
88
  return [formatText(items[_columnIndex], 1)]
@@ -160,10 +161,10 @@ export const Cell = {
160
161
  if (renderOpts) {
161
162
  const compConf = VXETable.renderer.get(renderOpts.name)
162
163
  if (compConf && compConf.renderHeader) {
163
- return renderTitleContent(params, compConf.renderHeader(renderOpts, params))
164
+ return renderTitleContent(params, getSlotVNs(compConf.renderHeader(renderOpts, params)))
164
165
  }
165
166
  }
166
- return renderTitleContent(params, formatText(column.getTitle(), 1))
167
+ return renderTitleContent(params, [formatText(column.getTitle(), 1)])
167
168
  },
168
169
  renderDefaultHeader (params: VxeTableDefines.CellRenderHeaderParams) {
169
170
  return renderHelpIcon(params).concat(Cell.renderHeaderTitle(params))
@@ -181,7 +182,7 @@ export const Cell = {
181
182
  const compConf = VXETable.renderer.get(renderOpts.name)
182
183
  const compFn = compConf ? compConf[funName] : null
183
184
  if (compFn) {
184
- return compFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))
185
+ return getSlotVNs(compFn(renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params)))
185
186
  }
186
187
  }
187
188
  const cellValue = $table.getCellLabel(row, column)
@@ -211,7 +212,7 @@ export const Cell = {
211
212
  /**
212
213
  * 树节点
213
214
  */
214
- renderTreeIcon (params: VxeTableDefines.CellRenderBodyParams, cellVNodes: VNode[]) {
215
+ renderTreeIcon (params: VxeTableDefines.CellRenderBodyParams, cellVNodes: SlotVNodeType[]) {
215
216
  const { $table, isHidden } = params
216
217
  const { reactData } = $table
217
218
  const { computeTreeOpts } = $table.getComputeMaps()
@@ -272,7 +273,7 @@ export const Cell = {
272
273
  const { $table, column } = params
273
274
  const { slots } = column
274
275
  const headerSlot = slots ? slots.header : null
275
- return renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : formatText(column.getTitle(), 1))
276
+ return renderTitleContent(params, headerSlot ? $table.callSlot(headerSlot, params) : [formatText(column.getTitle(), 1)])
276
277
  },
277
278
  renderSeqCell (params: VxeTableDefines.CellRenderBodyParams) {
278
279
  const { $table, column } = params
@@ -342,10 +343,7 @@ export const Cell = {
342
343
  if (isVisible) {
343
344
  radioVNs.push(
344
345
  h('span', {
345
- class: 'vxe-radio--icon vxe-radio--checked-icon'
346
- }),
347
- h('span', {
348
- class: 'vxe-radio--icon vxe-radio--unchecked-icon'
346
+ class: ['vxe-radio--icon', isChecked ? GlobalConfig.icon.TABLE_RADIO_CHECKED : GlobalConfig.icon.TABLE_RADIO_UNCHECKED]
349
347
  })
350
348
  )
351
349
  }
@@ -416,13 +414,7 @@ export const Cell = {
416
414
  ...ons
417
415
  }, [
418
416
  h('span', {
419
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
420
- }),
421
- h('span', {
422
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
423
- }),
424
- h('span', {
425
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
417
+ class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
426
418
  })
427
419
  ].concat(titleSlot || headerTitle ? [
428
420
  h('span', {
@@ -471,13 +463,7 @@ export const Cell = {
471
463
  if (isVisible) {
472
464
  checkVNs.push(
473
465
  h('span', {
474
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
475
- }),
476
- h('span', {
477
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
478
- }),
479
- h('span', {
480
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
466
+ class: ['vxe-checkbox--icon', indeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
481
467
  })
482
468
  )
483
469
  }
@@ -542,13 +528,7 @@ export const Cell = {
542
528
  if (isVisible) {
543
529
  checkVNs.push(
544
530
  h('span', {
545
- class: 'vxe-checkbox--icon vxe-checkbox--checked-icon'
546
- }),
547
- h('span', {
548
- class: 'vxe-checkbox--icon vxe-checkbox--unchecked-icon'
549
- }),
550
- h('span', {
551
- class: 'vxe-checkbox--icon vxe-checkbox--indeterminate-icon'
531
+ class: ['vxe-checkbox--icon', indeterminate ? GlobalConfig.icon.TABLE_CHECKBOX_INDETERMINATE : (isChecked ? GlobalConfig.icon.TABLE_CHECKBOX_CHECKED : GlobalConfig.icon.TABLE_CHECKBOX_UNCHECKED)]
552
532
  })
553
533
  )
554
534
  if (defaultSlot || labelField) {
@@ -626,7 +606,7 @@ export const Cell = {
626
606
  if (contentRender) {
627
607
  const compConf = VXETable.renderer.get(contentRender.name)
628
608
  if (compConf && compConf.renderExpand) {
629
- return compConf.renderExpand(contentRender, params)
609
+ return getSlotVNs(compConf.renderExpand(contentRender, params))
630
610
  }
631
611
  }
632
612
  return []
@@ -792,7 +772,10 @@ export const Cell = {
792
772
  if (editSlot) {
793
773
  return $table.callSlot(editSlot, params)
794
774
  }
795
- return compConf && compConf.renderEdit ? compConf.renderEdit(editRender, Object.assign({ $type: 'edit' }, params)) : []
775
+ if (compConf && compConf.renderEdit) {
776
+ return getSlotVNs(compConf.renderEdit(editRender, Object.assign({ $type: 'edit' }, params)))
777
+ }
778
+ return []
796
779
  }
797
780
  if (defaultSlot) {
798
781
  return $table.callSlot(defaultSlot, params)