vxe-table 4.1.20 → 4.2.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 (324) hide show
  1. package/README.en.md +2 -4
  2. package/README.md +2 -3
  3. package/README.zh-TW.md +2 -4
  4. package/es/button/index.js +1 -1
  5. package/es/checkbox/index.js +1 -1
  6. package/es/checkbox-group/index.js +1 -1
  7. package/es/colgroup/index.js +3 -2
  8. package/es/column/index.js +3 -2
  9. package/es/edit/src/hook.js +2 -1
  10. package/es/export/index.js +2 -2
  11. package/es/export/src/hook.js +2 -1
  12. package/es/export/src/util.js +3 -5
  13. package/es/filter/index.js +1 -1
  14. package/es/filter/src/hook.js +17 -10
  15. package/es/footer/index.js +1 -1
  16. package/es/footer/src/footer.js +3 -2
  17. package/es/form/index.js +1 -1
  18. package/es/form/src/form-gather.js +3 -3
  19. package/es/form/src/form-item.js +4 -4
  20. package/es/form/src/form.js +36 -43
  21. package/es/form/src/render.js +15 -10
  22. package/es/form/src/util.js +6 -0
  23. package/es/form-gather/index.js +1 -1
  24. package/es/form-item/index.js +1 -1
  25. package/es/grid/index.js +1 -1
  26. package/es/grid/src/grid.js +2 -1
  27. package/es/header/index.js +1 -1
  28. package/es/header/src/header.js +1 -1
  29. package/es/input/index.js +1 -1
  30. package/es/input/src/date.js +41 -0
  31. package/es/input/src/input.js +4 -51
  32. package/es/input/src/number.js +10 -0
  33. package/es/list/index.js +1 -1
  34. package/es/menu/index.js +1 -1
  35. package/es/modal/index.js +1 -1
  36. package/es/modal/src/modal.js +2 -1
  37. package/es/optgroup/index.js +1 -1
  38. package/es/option/index.js +1 -1
  39. package/es/pager/index.js +1 -1
  40. package/es/pager/src/pager.js +13 -2
  41. package/es/pulldown/index.js +1 -1
  42. package/es/radio/index.js +1 -1
  43. package/es/radio-button/index.js +1 -1
  44. package/es/radio-group/index.js +1 -1
  45. package/es/select/index.js +1 -1
  46. package/es/select/style.css +1 -1
  47. package/es/style.css +1 -1
  48. package/es/style.min.css +1 -1
  49. package/es/switch/index.js +1 -1
  50. package/es/table/index.js +1 -1
  51. package/es/table/src/body.js +32 -11
  52. package/es/table/src/cell.js +3 -3
  53. package/es/table/src/column.js +3 -1
  54. package/es/table/src/columnInfo.js +5 -4
  55. package/es/table/src/emits.js +5 -1
  56. package/es/table/src/props.js +5 -2
  57. package/es/table/src/table.js +120 -86
  58. package/es/table/src/util.js +5 -3
  59. package/es/textarea/index.js +1 -1
  60. package/es/toolbar/index.js +1 -1
  61. package/es/toolbar/src/toolbar.js +2 -1
  62. package/es/tools/dom.js +9 -0
  63. package/es/tools/log.js +13 -0
  64. package/es/tools/utils.js +0 -12
  65. package/es/tooltip/index.js +1 -1
  66. package/es/tooltip/src/tooltip.js +85 -45
  67. package/es/tooltip/style.css +1 -1
  68. package/es/v-x-e-table/index.js +1 -0
  69. package/es/v-x-e-table/src/conf.js +12 -7
  70. package/es/v-x-e-table/src/interceptor.js +1 -1
  71. package/es/v-x-e-table/src/renderer.js +2 -1
  72. package/es/v-x-e-table/src/store.js +1 -1
  73. package/helper/vetur/attributes.json +31 -11
  74. package/helper/vetur/tags.json +8 -3
  75. package/lib/button/index.js +3 -2
  76. package/lib/button/index.min.js +1 -1
  77. package/lib/checkbox/index.js +3 -2
  78. package/lib/checkbox/index.min.js +1 -1
  79. package/lib/checkbox-group/index.js +3 -2
  80. package/lib/checkbox-group/index.min.js +1 -1
  81. package/lib/colgroup/index.js +6 -4
  82. package/lib/colgroup/index.min.js +1 -1
  83. package/lib/column/index.js +6 -4
  84. package/lib/column/index.min.js +1 -1
  85. package/lib/edit/src/hook.js +7 -5
  86. package/lib/edit/src/hook.min.js +1 -1
  87. package/lib/export/index.js +5 -4
  88. package/lib/export/index.min.js +1 -1
  89. package/lib/export/src/hook.js +14 -12
  90. package/lib/export/src/hook.min.js +1 -1
  91. package/lib/export/src/util.js +7 -9
  92. package/lib/export/src/util.min.js +1 -1
  93. package/lib/filter/index.js +3 -2
  94. package/lib/filter/index.min.js +1 -1
  95. package/lib/filter/src/hook.js +24 -13
  96. package/lib/filter/src/hook.min.js +1 -1
  97. package/lib/footer/index.js +3 -2
  98. package/lib/footer/index.min.js +1 -1
  99. package/lib/footer/src/footer.js +7 -3
  100. package/lib/footer/src/footer.min.js +1 -1
  101. package/lib/form/index.js +3 -2
  102. package/lib/form/index.min.js +1 -1
  103. package/lib/form/src/form-gather.js +3 -3
  104. package/lib/form/src/form-gather.min.js +1 -1
  105. package/lib/form/src/form-item.js +3 -3
  106. package/lib/form/src/form-item.min.js +1 -1
  107. package/lib/form/src/form.js +45 -58
  108. package/lib/form/src/form.min.js +1 -1
  109. package/lib/form/src/render.js +24 -10
  110. package/lib/form/src/render.min.js +1 -1
  111. package/lib/form/src/util.js +11 -0
  112. package/lib/form/src/util.min.js +1 -1
  113. package/lib/form-gather/index.js +3 -2
  114. package/lib/form-gather/index.min.js +1 -1
  115. package/lib/form-item/index.js +3 -2
  116. package/lib/form-item/index.min.js +1 -1
  117. package/lib/grid/index.js +3 -2
  118. package/lib/grid/index.min.js +1 -1
  119. package/lib/grid/src/grid.js +16 -14
  120. package/lib/grid/src/grid.min.js +1 -1
  121. package/lib/header/index.js +3 -2
  122. package/lib/header/index.min.js +1 -1
  123. package/lib/header/src/header.js +1 -1
  124. package/lib/header/src/header.min.js +1 -1
  125. package/lib/index.umd.js +584 -415
  126. package/lib/index.umd.min.js +1 -2
  127. package/lib/input/index.js +3 -2
  128. package/lib/input/index.min.js +1 -1
  129. package/lib/input/src/date.js +56 -0
  130. package/lib/input/src/date.min.js +1 -0
  131. package/lib/input/src/input.js +13 -67
  132. package/lib/input/src/input.min.js +1 -1
  133. package/lib/input/src/number.js +23 -0
  134. package/lib/input/src/number.min.js +1 -0
  135. package/lib/list/index.js +3 -2
  136. package/lib/list/index.min.js +1 -1
  137. package/lib/menu/index.js +3 -2
  138. package/lib/menu/index.min.js +1 -1
  139. package/lib/modal/index.js +3 -2
  140. package/lib/modal/index.min.js +1 -1
  141. package/lib/modal/src/modal.js +3 -1
  142. package/lib/modal/src/modal.min.js +1 -1
  143. package/lib/optgroup/index.js +3 -2
  144. package/lib/optgroup/index.min.js +1 -1
  145. package/lib/option/index.js +3 -2
  146. package/lib/option/index.min.js +1 -1
  147. package/lib/pager/index.js +3 -2
  148. package/lib/pager/index.min.js +1 -1
  149. package/lib/pager/src/pager.js +15 -1
  150. package/lib/pager/src/pager.min.js +1 -1
  151. package/lib/pulldown/index.js +3 -2
  152. package/lib/pulldown/index.min.js +1 -1
  153. package/lib/radio/index.js +3 -2
  154. package/lib/radio/index.min.js +1 -1
  155. package/lib/radio-button/index.js +3 -2
  156. package/lib/radio-button/index.min.js +1 -1
  157. package/lib/radio-group/index.js +3 -2
  158. package/lib/radio-group/index.min.js +1 -1
  159. package/lib/select/index.js +3 -2
  160. package/lib/select/index.min.js +1 -1
  161. package/lib/select/style/style.css +1 -1
  162. package/lib/select/style/style.min.css +1 -1
  163. package/lib/style.css +1 -1
  164. package/lib/style.min.css +1 -1
  165. package/lib/switch/index.js +3 -2
  166. package/lib/switch/index.min.js +1 -1
  167. package/lib/table/index.js +3 -2
  168. package/lib/table/index.min.js +1 -1
  169. package/lib/table/src/body.js +32 -11
  170. package/lib/table/src/body.min.js +1 -1
  171. package/lib/table/src/cell.js +3 -3
  172. package/lib/table/src/cell.min.js +1 -1
  173. package/lib/table/src/column.js +3 -1
  174. package/lib/table/src/column.min.js +1 -1
  175. package/lib/table/src/columnInfo.js +13 -9
  176. package/lib/table/src/columnInfo.min.js +1 -1
  177. package/lib/table/src/emits.js +1 -1
  178. package/lib/table/src/emits.min.js +1 -1
  179. package/lib/table/src/props.js +5 -2
  180. package/lib/table/src/table.js +187 -148
  181. package/lib/table/src/table.min.js +1 -1
  182. package/lib/table/src/util.js +5 -3
  183. package/lib/table/src/util.min.js +1 -1
  184. package/lib/textarea/index.js +3 -2
  185. package/lib/textarea/index.min.js +1 -1
  186. package/lib/toolbar/index.js +3 -2
  187. package/lib/toolbar/index.min.js +1 -1
  188. package/lib/toolbar/src/toolbar.js +4 -2
  189. package/lib/toolbar/src/toolbar.min.js +1 -1
  190. package/lib/tools/dom.js +12 -1
  191. package/lib/tools/dom.min.js +1 -1
  192. package/lib/tools/log.js +29 -0
  193. package/lib/tools/log.min.js +1 -0
  194. package/lib/tools/utils.js +0 -20
  195. package/lib/tools/utils.min.js +1 -1
  196. package/lib/tooltip/index.js +3 -3
  197. package/lib/tooltip/index.min.js +1 -1
  198. package/lib/tooltip/src/tooltip.js +114 -60
  199. package/lib/tooltip/src/tooltip.min.js +1 -1
  200. package/lib/tooltip/style/style.css +1 -1
  201. package/lib/tooltip/style/style.min.css +1 -1
  202. package/lib/v-x-e-table/index.js +1 -0
  203. package/lib/v-x-e-table/index.min.js +1 -1
  204. package/lib/v-x-e-table/src/conf.js +12 -7
  205. package/lib/v-x-e-table/src/conf.min.js +1 -1
  206. package/lib/v-x-e-table/src/interceptor.js +3 -3
  207. package/lib/v-x-e-table/src/interceptor.min.js +1 -1
  208. package/lib/v-x-e-table/src/renderer.js +3 -1
  209. package/lib/v-x-e-table/src/renderer.min.js +1 -1
  210. package/lib/v-x-e-table/src/store.js +2 -2
  211. package/lib/v-x-e-table/src/store.min.js +1 -1
  212. package/package.json +4 -4
  213. package/packages/button/index.ts +2 -1
  214. package/packages/checkbox/index.ts +2 -1
  215. package/packages/checkbox-group/index.ts +2 -1
  216. package/packages/colgroup/index.ts +4 -2
  217. package/packages/column/index.ts +4 -2
  218. package/packages/edit/src/hook.ts +2 -1
  219. package/packages/export/index.ts +3 -2
  220. package/packages/export/src/hook.ts +2 -1
  221. package/packages/export/src/util.ts +4 -6
  222. package/packages/filter/index.ts +2 -1
  223. package/packages/filter/src/hook.ts +17 -10
  224. package/packages/footer/index.ts +2 -1
  225. package/packages/footer/src/footer.ts +3 -2
  226. package/packages/form/index.ts +2 -1
  227. package/packages/form/src/form-gather.ts +3 -3
  228. package/packages/form/src/form-item.ts +4 -4
  229. package/packages/form/src/form.ts +38 -46
  230. package/packages/form/src/render.ts +8 -6
  231. package/packages/form/src/util.ts +8 -1
  232. package/packages/form-gather/index.ts +2 -1
  233. package/packages/form-item/index.ts +2 -1
  234. package/packages/grid/index.ts +2 -1
  235. package/packages/grid/src/grid.ts +2 -1
  236. package/packages/header/index.ts +2 -1
  237. package/packages/header/src/header.ts +1 -1
  238. package/packages/input/index.ts +2 -1
  239. package/packages/input/src/date.ts +42 -0
  240. package/packages/input/src/input.ts +3 -51
  241. package/packages/input/src/number.ts +12 -0
  242. package/packages/list/index.ts +2 -1
  243. package/packages/menu/index.ts +2 -1
  244. package/packages/modal/index.ts +2 -1
  245. package/packages/modal/src/modal.ts +2 -1
  246. package/packages/optgroup/index.ts +2 -1
  247. package/packages/option/index.ts +2 -1
  248. package/packages/pager/index.ts +2 -1
  249. package/packages/pager/src/pager.ts +17 -3
  250. package/packages/pulldown/index.ts +2 -1
  251. package/packages/radio/index.ts +2 -1
  252. package/packages/radio-button/index.ts +2 -1
  253. package/packages/radio-group/index.ts +2 -1
  254. package/packages/select/index.ts +2 -1
  255. package/packages/switch/index.ts +2 -1
  256. package/packages/table/index.ts +2 -1
  257. package/packages/table/src/body.ts +33 -12
  258. package/packages/table/src/cell.ts +3 -3
  259. package/packages/table/src/column.ts +3 -1
  260. package/packages/table/src/columnInfo.ts +5 -3
  261. package/packages/table/src/emits.ts +5 -1
  262. package/packages/table/src/props.ts +5 -2
  263. package/packages/table/src/table.ts +120 -84
  264. package/packages/table/src/util.ts +5 -3
  265. package/packages/textarea/index.ts +2 -1
  266. package/packages/toolbar/index.ts +2 -1
  267. package/packages/toolbar/src/toolbar.ts +2 -1
  268. package/packages/tools/dom.ts +11 -0
  269. package/packages/tools/log.ts +16 -0
  270. package/packages/tools/utils.ts +0 -15
  271. package/packages/tooltip/index.ts +2 -1
  272. package/packages/tooltip/src/tooltip.ts +87 -46
  273. package/packages/v-x-e-table/index.ts +1 -0
  274. package/packages/v-x-e-table/src/conf.ts +12 -7
  275. package/packages/v-x-e-table/src/interceptor.ts +1 -1
  276. package/packages/v-x-e-table/src/renderer.ts +2 -1
  277. package/packages/v-x-e-table/src/store.ts +1 -1
  278. package/styles/select.scss +1 -1
  279. package/styles/tooltip.scss +1 -1
  280. package/types/all.d.ts +2 -2
  281. package/types/button.d.ts +54 -54
  282. package/types/checkbox-group.d.ts +21 -21
  283. package/types/checkbox.d.ts +30 -30
  284. package/types/colgroup.d.ts +16 -16
  285. package/types/column.d.ts +172 -161
  286. package/types/component.d.ts +9 -9
  287. package/types/edit.d.ts +35 -35
  288. package/types/export.d.ts +101 -101
  289. package/types/filter.d.ts +19 -19
  290. package/types/footer.d.ts +1 -1
  291. package/types/form-gather.d.ts +3 -3
  292. package/types/form-item.d.ts +68 -66
  293. package/types/form.d.ts +136 -131
  294. package/types/grid.d.ts +257 -257
  295. package/types/header.d.ts +1 -1
  296. package/types/icon.d.ts +1 -1
  297. package/types/input.d.ts +162 -162
  298. package/types/keyboard.d.ts +6 -6
  299. package/types/list.d.ts +54 -54
  300. package/types/menu.d.ts +33 -33
  301. package/types/modal.d.ts +160 -160
  302. package/types/optgroup.d.ts +5 -5
  303. package/types/option.d.ts +19 -19
  304. package/types/pager.d.ts +65 -61
  305. package/types/plugins/pro.d.ts +245 -215
  306. package/types/pulldown.d.ts +36 -36
  307. package/types/radio-button.d.ts +25 -25
  308. package/types/radio-group.d.ts +20 -20
  309. package/types/radio.d.ts +27 -27
  310. package/types/select.d.ts +82 -82
  311. package/types/switch.d.ts +40 -40
  312. package/types/table.d.ts +1422 -1336
  313. package/types/textarea.d.ts +71 -71
  314. package/types/toolbar.d.ts +65 -65
  315. package/types/tooltip.d.ts +50 -44
  316. package/types/v-x-e-table/commands.d.ts +12 -12
  317. package/types/v-x-e-table/formats.d.ts +10 -10
  318. package/types/v-x-e-table/hooks.d.ts +9 -9
  319. package/types/v-x-e-table/index.d.ts +51 -43
  320. package/types/v-x-e-table/interceptor.d.ts +26 -26
  321. package/types/v-x-e-table/menus.d.ts +13 -13
  322. package/types/v-x-e-table/renderer.d.ts +128 -128
  323. package/types/v-x-e-table/setup.d.ts +55 -55
  324. package/types/validator.d.ts +28 -28
@@ -1,10 +1,11 @@
1
- import { defineComponent, h, ref, Ref, resolveComponent, ComponentOptions, ComputedRef, 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, VNode, 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'
5
- import { errLog, getFuncText, isEnableConf, eqEmptyValue } from '../../tools/utils'
5
+ import { getFuncText, isEnableConf, eqEmptyValue } from '../../tools/utils'
6
+ import { errLog } from '../../tools/log'
6
7
  import { scrollToView } from '../../tools/dom'
7
- import { createItem } from './util'
8
+ import { createItem, handleFieldOrItem } from './util'
8
9
  import { renderTitle } from './render'
9
10
  import { useSize } from '../../hooks/size'
10
11
 
@@ -113,7 +114,6 @@ export default defineComponent({
113
114
 
114
115
  const internalData = reactive<FormInternalData>({
115
116
  tooltipTimeout: null,
116
- tooltipActive: false,
117
117
  tooltipStore: {
118
118
  item: null,
119
119
  visible: false
@@ -129,24 +129,8 @@ export default defineComponent({
129
129
  return Object.assign({}, GlobalConfig.form.validConfig, props.validConfig)
130
130
  })
131
131
 
132
- let computeTooltipOpts = ref() as ComputedRef<VxeFormPropTypes.TooltipOpts>
133
-
134
- const handleTooltipLeaveMethod = () => {
135
- const tooltipOpts = computeTooltipOpts.value
136
- setTimeout(() => {
137
- if (!internalData.tooltipActive) {
138
- formMethods.closeTooltip()
139
- }
140
- }, tooltipOpts.leaveDelay)
141
- return false
142
- }
143
-
144
- computeTooltipOpts = computed(() => {
145
- const opts: VxeFormPropTypes.TooltipOpts = Object.assign({ leaveDelay: 300 }, GlobalConfig.form.tooltipConfig, props.tooltipConfig)
146
- if (opts.enterable) {
147
- opts.leaveMethod = handleTooltipLeaveMethod
148
- }
149
- return opts
132
+ const computeTooltipOpts = computed(() => {
133
+ return Object.assign({}, GlobalConfig.tooltip, GlobalConfig.form.tooltipConfig, props.tooltipConfig)
150
134
  })
151
135
 
152
136
  const refMaps: FormPrivateRef = {
@@ -208,6 +192,11 @@ export default defineComponent({
208
192
  return itemList
209
193
  }
210
194
 
195
+ const getItemByField = (field: string) => {
196
+ const rest = XEUtils.findTree(reactData.formItems, item => item.field === field, { children: 'children' })
197
+ return rest ? rest.item : null
198
+ }
199
+
211
200
  const getCollapseStatus = () => {
212
201
  return reactData.collapseAll
213
202
  }
@@ -226,15 +215,14 @@ export default defineComponent({
226
215
  formMethods.dispatchEvent('collapse', { status, collapse: status, data: props.data }, evnt)
227
216
  }
228
217
 
229
- const clearValidate = (field?: string) => {
230
- const itemList = getItems()
231
- if (field) {
232
- const item = itemList.find((item) => item.field === field)
218
+ const clearValidate = (fieldOrItem?: VxeFormItemPropTypes.Field | VxeFormDefines.ItemInfo) => {
219
+ if (fieldOrItem) {
220
+ const item = handleFieldOrItem($xeform, fieldOrItem)
233
221
  if (item) {
234
222
  item.showError = false
235
223
  }
236
224
  } else {
237
- itemList.forEach((item) => {
225
+ getItems().forEach((item) => {
238
226
  item.showError = false
239
227
  })
240
228
  }
@@ -267,10 +255,9 @@ export default defineComponent({
267
255
  }
268
256
 
269
257
  const handleFocus = (fields: string[]) => {
270
- const itemList = getItems()
271
258
  const el = refElem.value
272
259
  fields.some((property, index) => {
273
- const item = itemList.find((item) => item.field === property)
260
+ const item = getItemByField(property)
274
261
  if (item && isEnableConf(item.itemRender)) {
275
262
  const { itemRender } = item
276
263
  const compConf = VXETable.renderer.get(itemRender.name)
@@ -428,8 +415,9 @@ export default defineComponent({
428
415
  return beginValidate(getItems(), '', callback)
429
416
  }
430
417
 
431
- const validateField = (field: VxeFormItemPropTypes.Field, callback: any) => {
432
- return beginValidate(getItems().filter(item => item.field === field), '', callback)
418
+ const validateField = (fieldOrItem: VxeFormItemPropTypes.Field | VxeFormDefines.ItemInfo, callback: any) => {
419
+ const item = handleFieldOrItem($xeform, fieldOrItem)
420
+ return beginValidate(item ? [item] : [], '', callback)
433
421
  }
434
422
 
435
423
  const submitEvent = (evnt: Event) => {
@@ -459,7 +447,7 @@ export default defineComponent({
459
447
  return nextTick()
460
448
  }
461
449
 
462
- const triggerHeaderHelpEvent = (evnt: MouseEvent, params: {
450
+ const triggerTitleTipEvent = (evnt: MouseEvent, params: {
463
451
  item: VxeFormDefines.ItemInfo;
464
452
  }) => {
465
453
  const { item } = params
@@ -469,8 +457,9 @@ export default defineComponent({
469
457
  const content = (overflowElem.textContent || '').trim()
470
458
  const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth
471
459
  clearTimeout(internalData.tooltipTimeout)
472
- internalData.tooltipActive = true
473
- closeTooltip()
460
+ if (tooltipStore.item !== item) {
461
+ closeTooltip()
462
+ }
474
463
  if (content && isCellOverflow) {
475
464
  Object.assign(tooltipStore, {
476
465
  item,
@@ -482,13 +471,16 @@ export default defineComponent({
482
471
  }
483
472
  }
484
473
 
485
- const handleTargetLeaveEvent = () => {
474
+ const handleTitleTipLeaveEvent = () => {
486
475
  const tooltipOpts = computeTooltipOpts.value
487
- internalData.tooltipActive = false
476
+ let $tooltip = refTooltip.value
477
+ if ($tooltip) {
478
+ $tooltip.setActived(false)
479
+ }
488
480
  if (tooltipOpts.enterable) {
489
481
  internalData.tooltipTimeout = setTimeout(() => {
490
- const $tooltip = refTooltip.value
491
- if ($tooltip && !$tooltip.reactData.isHover) {
482
+ $tooltip = refTooltip.value
483
+ if ($tooltip && !$tooltip.isActived()) {
492
484
  closeTooltip()
493
485
  }
494
486
  }, tooltipOpts.leaveDelay)
@@ -510,8 +502,7 @@ export default defineComponent({
510
502
  clearValidate(property)
511
503
  })
512
504
  .catch(({ rule }) => {
513
- const itemList = getItems()
514
- const item = itemList.find((item) => item.field === property)
505
+ const item = getItemByField(property)
515
506
  if (item) {
516
507
  item.showError = true
517
508
  item.errRule = rule
@@ -524,7 +515,7 @@ export default defineComponent({
524
515
  const { data, rules, titleOverflow: allTitleOverflow } = props
525
516
  const { collapseAll } = reactData
526
517
  const validOpts = computeValidOpts.value
527
- return itemList.map((item, index) => {
518
+ return itemList.map((item) => {
528
519
  const { slots, title, visible, folding, visibleMethod, field, collapseNode, itemRender, showError, errRule, className, titleOverflow, children } = item
529
520
  const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
530
521
  const defaultSlot = slots ? slots.default : null
@@ -596,9 +587,9 @@ export default defineComponent({
596
587
  }
597
588
  const ons = showTooltip ? {
598
589
  onMouseenter (evnt: MouseEvent) {
599
- triggerHeaderHelpEvent(evnt, params)
590
+ triggerTitleTipEvent(evnt, params)
600
591
  },
601
- onMouseleave: handleTargetLeaveEvent
592
+ onMouseleave: handleTitleTipLeaveEvent
602
593
  } : {}
603
594
  return h('div', {
604
595
  class: ['vxe-form--item', item.id, span ? `vxe-col--${span} is--span` : '', className ? (XEUtils.isFunction(className) ? className(params) : className) : '', {
@@ -608,7 +599,7 @@ export default defineComponent({
608
599
  'is--active': !itemVisibleMethod || itemVisibleMethod(params),
609
600
  'is--error': showError
610
601
  }],
611
- key: index
602
+ key: item.id
612
603
  }, [
613
604
  h('div', {
614
605
  class: 'vxe-form--item-inner'
@@ -642,14 +633,15 @@ export default defineComponent({
642
633
  updateStatus,
643
634
  toggleCollapse,
644
635
  getItems,
636
+ getItemByField,
645
637
  closeTooltip
646
638
  }
647
639
 
648
640
  const formPrivateMethods: VxeFormPrivateMethods = {
649
641
  callSlot,
650
642
  toggleCollapseEvent,
651
- triggerHeaderHelpEvent,
652
- handleTargetLeaveEvent
643
+ triggerTitleTipEvent,
644
+ handleTitleTipLeaveEvent
653
645
  }
654
646
 
655
647
  Object.assign($xeform, formMethods, formPrivateMethods)
@@ -27,7 +27,9 @@ function renderSuffixIcon (titleSuffix: VxeFormItemPropTypes.TitleSuffix) {
27
27
 
28
28
  export function renderTitle ($xeform: VxeFormConstructor & VxeFormPrivateMethods, item: VxeFormDefines.ItemInfo) {
29
29
  const { data } = $xeform.props
30
+ const { computeTooltipOpts } = $xeform.getComputeMaps()
30
31
  const { slots, field, itemRender, titlePrefix, titleSuffix } = item
32
+ const tooltipOpts = computeTooltipOpts.value
31
33
  const compConf = isEnableConf(itemRender) ? VXETable.renderer.get(itemRender.name) : null
32
34
  const params = { data, property: field, item, $form: $xeform }
33
35
  const titleSlot = slots ? slots.title : null
@@ -37,9 +39,9 @@ export function renderTitle ($xeform: VxeFormConstructor & VxeFormPrivateMethods
37
39
  titVNs.push(
38
40
  (titlePrefix.content || titlePrefix.message)
39
41
  ? h(resolveComponent('vxe-tooltip') as ComponentOptions, {
40
- content: getFuncText(titlePrefix.content || titlePrefix.message),
41
- enterable: titlePrefix.enterable,
42
- theme: titlePrefix.theme
42
+ ...tooltipOpts,
43
+ ...titlePrefix,
44
+ content: getFuncText(titlePrefix.content || titlePrefix.message)
43
45
  }, {
44
46
  default: () => renderPrefixIcon(titlePrefix)
45
47
  })
@@ -61,9 +63,9 @@ export function renderTitle ($xeform: VxeFormConstructor & VxeFormPrivateMethods
61
63
  fixVNs.push(
62
64
  (titleSuffix.content || titleSuffix.message)
63
65
  ? h(resolveComponent('vxe-tooltip') as ComponentOptions, {
64
- content: getFuncText(titleSuffix.content || titleSuffix.message),
65
- enterable: titleSuffix.enterable,
66
- theme: titleSuffix.theme
66
+ ...tooltipOpts,
67
+ ...titleSuffix,
68
+ content: getFuncText(titleSuffix.content || titleSuffix.message)
67
69
  }, {
68
70
  default: () => renderSuffixIcon(titleSuffix)
69
71
  })
@@ -2,7 +2,7 @@ import { watch } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { ItemInfo } from './itemInfo'
4
4
 
5
- import { VxeFormConstructor } from '../../../types/all'
5
+ import { VxeFormConstructor, VxeFormDefines } from '../../../types/all'
6
6
 
7
7
  export interface XEFormItemProvide {
8
8
  formItem: ItemInfo;
@@ -16,6 +16,13 @@ export function createItem ($xeform: VxeFormConstructor, _vm: any) {
16
16
  return isFormItem(_vm) ? _vm : new ItemInfo($xeform, _vm)
17
17
  }
18
18
 
19
+ export const handleFieldOrItem = ($xeform: VxeFormConstructor, fieldOrItem: string | VxeFormDefines.ItemInfo) => {
20
+ if (fieldOrItem) {
21
+ return XEUtils.isString(fieldOrItem) ? $xeform.getItemByField(fieldOrItem) : fieldOrItem
22
+ }
23
+ return null
24
+ }
25
+
19
26
  export function watchItem (props: any, formItem: ItemInfo) {
20
27
  Object.keys(props).forEach(name => {
21
28
  watch(() => props[name], (value: any) => {
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const FormGather = Object.assign(VxeFormGatherComponent, {
6
6
  install (app: App) {
7
- dynamicApp.component(VxeFormGatherComponent.name, VxeFormGatherComponent)
8
7
  app.component(VxeFormGatherComponent.name, VxeFormGatherComponent)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxeFormGatherComponent.name, VxeFormGatherComponent)
12
+
12
13
  export default FormGather
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const FormItem = Object.assign(VxeFormItemComponent, {
6
6
  install (app: App) {
7
- dynamicApp.component(VxeFormItemComponent.name, VxeFormItemComponent)
8
7
  app.component(VxeFormItemComponent.name, VxeFormItemComponent)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxeFormItemComponent.name, VxeFormItemComponent)
12
+
12
13
  export default FormItem
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const Grid = Object.assign(VxeGridComponent, {
6
6
  install (app: App) {
7
- dynamicApp.component(VxeGridComponent.name, VxeGridComponent)
8
7
  app.component(VxeGridComponent.name, VxeGridComponent)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxeGridComponent.name, VxeGridComponent)
12
+
12
13
  export default Grid
@@ -1,7 +1,8 @@
1
1
  import { defineComponent, h, PropType, ref, Ref, computed, provide, getCurrentInstance, resolveComponent, ComponentOptions, reactive, onUnmounted, watch, nextTick, VNode, ComponentPublicInstance, onMounted } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
- import { errLog, getLastZIndex, nextZIndex, isEnableConf } from '../../tools/utils'
3
+ import { getLastZIndex, nextZIndex, isEnableConf } from '../../tools/utils'
4
4
  import { getOffsetHeight, getPaddingTopBottomSize, getDomNode } from '../../tools/dom'
5
+ import { errLog } from '../../tools/log'
5
6
  import GlobalConfig from '../../v-x-e-table/src/conf'
6
7
  import { VXETable } from '../../v-x-e-table'
7
8
  import tableComponentProps from '../../table/src/props'
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const Header = Object.assign(VxeTableHeader, {
6
6
  install (app: App) {
7
- dynamicApp.component(VxeTableHeader.name, VxeTableHeader)
8
7
  app.component(VxeTableHeader.name, VxeTableHeader)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxeTableHeader.name, VxeTableHeader)
12
+
12
13
  export default Header
@@ -263,7 +263,7 @@ export default defineComponent({
263
263
  rowspan: column.rowSpan > 1 ? column.rowSpan : null,
264
264
  style: headerCellStyle ? (XEUtils.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle) : null,
265
265
  ...thOns,
266
- key: columnKey || isColGroup ? column.id : $columnIndex
266
+ key: columnKey || columnOpts.useKey || isColGroup ? column.id : $columnIndex
267
267
  }, [
268
268
  h('div', {
269
269
  class: ['vxe-cell', {
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const Input = Object.assign(VxeInputConstructor, {
6
6
  install (app: App) {
7
- dynamicApp.component(VxeInputConstructor.name, VxeInputConstructor)
8
7
  app.component(VxeInputConstructor.name, VxeInputConstructor)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxeInputConstructor.name, VxeInputConstructor)
12
+
12
13
  export default Input
@@ -0,0 +1,42 @@
1
+ import XEUtils from 'xe-utils'
2
+
3
+ import { VxeInputPropTypes } from '../../../types/all'
4
+
5
+ export function toStringTimeDate (str: VxeInputPropTypes.ModelValue) {
6
+ if (str) {
7
+ const rest = new Date()
8
+ let h = 0
9
+ let m = 0
10
+ let s = 0
11
+ if (XEUtils.isDate(str)) {
12
+ h = str.getHours()
13
+ m = str.getMinutes()
14
+ s = str.getSeconds()
15
+ } else {
16
+ str = XEUtils.toValueString(str)
17
+ const parses = str.match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/)
18
+ if (parses) {
19
+ h = XEUtils.toNumber(parses[1])
20
+ m = XEUtils.toNumber(parses[3])
21
+ s = XEUtils.toNumber(parses[5])
22
+ }
23
+ }
24
+ rest.setHours(h)
25
+ rest.setMinutes(m)
26
+ rest.setSeconds(s)
27
+ return rest
28
+ }
29
+ return new Date('')
30
+ }
31
+
32
+ export function getDateQuarter (date: Date) {
33
+ const month = date.getMonth()
34
+ if (month < 3) {
35
+ return 1
36
+ } else if (month < 6) {
37
+ return 2
38
+ } else if (month < 9) {
39
+ return 3
40
+ }
41
+ return 4
42
+ }
@@ -5,6 +5,8 @@ import { useSize } from '../../hooks/size'
5
5
  import { getFuncText, getLastZIndex, nextZIndex } from '../../tools/utils'
6
6
  import { hasClass, getAbsolutePos, getEventTargetNode } from '../../tools/dom'
7
7
  import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event'
8
+ import { toStringTimeDate, getDateQuarter } from './date'
9
+ import { handleNumber, toFloatValueFixed } from './number'
8
10
 
9
11
  import { VNodeStyle, VxeInputConstructor, VxeInputEmits, InputReactData, InputMethods, VxeInputPropTypes, InputPrivateRef } from '../../../types/all'
10
12
 
@@ -52,33 +54,6 @@ const yearSize = 20
52
54
  const monthSize = 20
53
55
  const quarterSize = 8
54
56
 
55
- function toStringTimeDate (str: VxeInputPropTypes.ModelValue) {
56
- if (str) {
57
- const rest = new Date()
58
- let h = 0
59
- let m = 0
60
- let s = 0
61
- if (XEUtils.isDate(str)) {
62
- h = str.getHours()
63
- m = str.getMinutes()
64
- s = str.getSeconds()
65
- } else {
66
- str = XEUtils.toValueString(str)
67
- const parses = str.match(/^(\d{1,2})(:(\d{1,2}))?(:(\d{1,2}))?/)
68
- if (parses) {
69
- h = XEUtils.toNumber(parses[1])
70
- m = XEUtils.toNumber(parses[3])
71
- s = XEUtils.toNumber(parses[5])
72
- }
73
- }
74
- rest.setHours(h)
75
- rest.setMinutes(m)
76
- rest.setSeconds(s)
77
- return rest
78
- }
79
- return new Date('')
80
- }
81
-
82
57
  export default defineComponent({
83
58
  name: 'VxeInput',
84
59
  props: {
@@ -410,18 +385,6 @@ export default defineComponent({
410
385
  return XEUtils.chunk(yearList, 4)
411
386
  })
412
387
 
413
- const getDateQuarter = (date: Date) => {
414
- const month = date.getMonth()
415
- if (month < 3) {
416
- return 1
417
- } else if (month < 6) {
418
- return 2
419
- } else if (month < 9) {
420
- return 3
421
- }
422
- return 4
423
- }
424
-
425
388
  const computeQuarterList = computed(() => {
426
389
  const { selectMonth, currentDate } = reactData
427
390
  const quarters: DateQuarterItem[] = []
@@ -609,18 +572,7 @@ export default defineComponent({
609
572
  return immediate || !(type === 'text' || type === 'number' || type === 'integer' || type === 'float')
610
573
  })
611
574
 
612
- const handleNumber = (val: string | number) => {
613
- return XEUtils.isString(val) ? val.replace(/,/g, '') : val
614
- }
615
-
616
- function toFloatValueFixed (inputValue: string | number, digitsValue: number) {
617
- if (/^-/.test('' + inputValue)) {
618
- return XEUtils.toFixed(XEUtils.ceil(inputValue, digitsValue), digitsValue)
619
- }
620
- return XEUtils.toFixed(XEUtils.floor(inputValue, digitsValue), digitsValue)
621
- }
622
-
623
- function getNumberValue (val: any) {
575
+ const getNumberValue = (val: any) => {
624
576
  const { type, exponential } = props
625
577
  const inpMaxlength = computeInpMaxlength.value
626
578
  const digitsValue = computeDigitsValue.value
@@ -0,0 +1,12 @@
1
+ import XEUtils from 'xe-utils'
2
+
3
+ export function handleNumber (val: string | number) {
4
+ return XEUtils.isString(val) ? val.replace(/,/g, '') : val
5
+ }
6
+
7
+ export function toFloatValueFixed (inputValue: string | number, digitsValue: number) {
8
+ if (/^-/.test('' + inputValue)) {
9
+ return XEUtils.toFixed(XEUtils.ceil(inputValue, digitsValue), digitsValue)
10
+ }
11
+ return XEUtils.toFixed(XEUtils.floor(inputValue, digitsValue), digitsValue)
12
+ }
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const List = Object.assign(VxeListComponent, {
6
6
  install (app: App) {
7
- dynamicApp.component(VxeListComponent.name, VxeListComponent)
8
7
  app.component(VxeListComponent.name, VxeListComponent)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxeListComponent.name, VxeListComponent)
12
+
12
13
  export default List
@@ -8,9 +8,10 @@ export const Menu = {
8
8
  Panel: PanelComponent,
9
9
  install (app: App) {
10
10
  VXETable.hooks.add('$tableMenu', menuHook)
11
- dynamicApp.component(PanelComponent.name, PanelComponent)
12
11
  app.component(PanelComponent.name, PanelComponent)
13
12
  }
14
13
  }
15
14
 
15
+ dynamicApp.component(PanelComponent.name, PanelComponent)
16
+
16
17
  export default Menu
@@ -98,10 +98,11 @@ export const modal = ModalController
98
98
 
99
99
  export const Modal = Object.assign(VxeModalComponent, {
100
100
  install: function (app: App) {
101
- dynamicApp.component(VxeModalComponent.name, VxeModalComponent)
102
101
  app.component(VxeModalComponent.name, VxeModalComponent)
103
102
  VXETable.modal = ModalController
104
103
  }
105
104
  })
106
105
 
106
+ dynamicApp.component(VxeModalComponent.name, VxeModalComponent)
107
+
107
108
  export default Modal
@@ -2,7 +2,8 @@ import { defineComponent, h, Teleport, ref, Ref, computed, reactive, nextTick, w
2
2
  import XEUtils from 'xe-utils'
3
3
  import { useSize } from '../../hooks/size'
4
4
  import { getDomNode, getEventTargetNode } from '../../tools/dom'
5
- import { errLog, getLastZIndex, nextZIndex, getFuncText } from '../../tools/utils'
5
+ import { getLastZIndex, nextZIndex, getFuncText } from '../../tools/utils'
6
+ import { errLog } from '../../tools/log'
6
7
  import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event'
7
8
  import GlobalConfig from '../../v-x-e-table/src/conf'
8
9
  import VxeButtonConstructor from '../../button/src/button'
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const Optgroup = Object.assign(VxeOptgroupComponent, {
6
6
  install: function (app: App) {
7
- dynamicApp.component(VxeOptgroupComponent.name, VxeOptgroupComponent)
8
7
  app.component(VxeOptgroupComponent.name, VxeOptgroupComponent)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxeOptgroupComponent.name, VxeOptgroupComponent)
12
+
12
13
  export default Optgroup
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const Option = Object.assign(VxeOptionComponent, {
6
6
  install: function (app: App) {
7
- dynamicApp.component(VxeOptionComponent.name, VxeOptionComponent)
8
7
  app.component(VxeOptionComponent.name, VxeOptionComponent)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxeOptionComponent.name, VxeOptionComponent)
12
+
12
13
  export default Option
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const Pager = Object.assign(VxePagerComponent, {
6
6
  install: function (app: App) {
7
- dynamicApp.component(VxePagerComponent.name, VxePagerComponent)
8
7
  app.component(VxePagerComponent.name, VxePagerComponent)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxePagerComponent.name, VxePagerComponent)
12
+
12
13
  export default Pager
@@ -1,10 +1,10 @@
1
- import { defineComponent, h, PropType, computed, inject, resolveComponent, ComponentOptions, ref, Ref, nextTick } from 'vue'
1
+ import { defineComponent, h, PropType, computed, inject, resolveComponent, ComponentOptions, ref, Ref, reactive, nextTick, watch } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import GlobalConfig from '../../v-x-e-table/src/conf'
4
4
  import { hasEventKey, EVENT_KEYS } from '../../tools/event'
5
5
  import { useSize } from '../../hooks/size'
6
6
 
7
- import { VxePagerPropTypes, VxePagerConstructor, VxePagerEmits, VxeSelectEvents, PagerPrivateRef, VxeGridConstructor, PagerMethods, PagerPrivateMethods, VxePagerPrivateMethods } from '../../../types/all'
7
+ import { VxePagerPropTypes, VxePagerConstructor, VxePagerEmits, VxeSelectEvents, PagerPrivateRef, VxeGridConstructor, PagerMethods, PagerPrivateMethods, VxePagerPrivateMethods, PagerReactData } from '../../../types/all'
8
8
 
9
9
  export default defineComponent({
10
10
  name: 'VxePager',
@@ -57,6 +57,10 @@ export default defineComponent({
57
57
 
58
58
  const $xegrid = inject('$xegrid', null as VxeGridConstructor | null)
59
59
 
60
+ const reactData = reactive<PagerReactData>({
61
+ inpCurrPage: props.currentPage
62
+ })
63
+
60
64
  const refElem = ref() as Ref<HTMLDivElement>
61
65
 
62
66
  const refMaps: PagerPrivateRef = {
@@ -165,6 +169,11 @@ export default defineComponent({
165
169
  pagerMethods.dispatchEvent('page-change', { type: 'size', pageSize, currentPage: Math.min(props.currentPage, getPageCount(props.total, pageSize)) })
166
170
  }
167
171
 
172
+ const jumpInputEvent = (evnt: KeyboardEvent) => {
173
+ const inputElem: HTMLInputElement = evnt.target as HTMLInputElement
174
+ reactData.inpCurrPage = inputElem.value
175
+ }
176
+
168
177
  const jumpKeydownEvent = (evnt: KeyboardEvent) => {
169
178
  if (hasEventKey(evnt, EVENT_KEYS.ENTER)) {
170
179
  triggerJumpEvent(evnt)
@@ -337,9 +346,10 @@ export default defineComponent({
337
346
  }, GlobalConfig.i18n('vxe.pager.goto')) : null,
338
347
  h('input', {
339
348
  class: 'vxe-pager--goto',
340
- value: props.currentPage,
349
+ value: reactData.inpCurrPage,
341
350
  type: 'text',
342
351
  autocomplete: 'off',
352
+ onInput: jumpInputEvent,
343
353
  onKeydown: jumpKeydownEvent,
344
354
  onBlur: triggerJumpEvent
345
355
  }),
@@ -405,6 +415,10 @@ export default defineComponent({
405
415
 
406
416
  Object.assign($xepager, pagerMethods, pagerPrivateMethods)
407
417
 
418
+ watch(() => props.currentPage, (value) => {
419
+ reactData.inpCurrPage = value
420
+ })
421
+
408
422
  const renderVN = () => {
409
423
  const { align, layouts, className } = props
410
424
  const childNodes = []
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const Pulldown = Object.assign(VxePulldownComponent, {
6
6
  install: function (app: App) {
7
- dynamicApp.component(VxePulldownComponent.name, VxePulldownComponent)
8
7
  app.component(VxePulldownComponent.name, VxePulldownComponent)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxePulldownComponent.name, VxePulldownComponent)
12
+
12
13
  export default Pulldown
@@ -4,9 +4,10 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const Radio = Object.assign(VxeRadioComponent, {
6
6
  install: function (app: App) {
7
- dynamicApp.component(VxeRadioComponent.name, VxeRadioComponent)
8
7
  app.component(VxeRadioComponent.name, VxeRadioComponent)
9
8
  }
10
9
  })
11
10
 
11
+ dynamicApp.component(VxeRadioComponent.name, VxeRadioComponent)
12
+
12
13
  export default Radio