element-pe 1.0.5 → 1.0.6

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 (259) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +632 -1287
  4. package/dist/index.full.min.js +9 -10
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +7 -8
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +630 -1289
  9. package/es/component.d.ts +24 -2
  10. package/es/components/affix/index.js +1 -1
  11. package/es/components/autocomplete/index.d.ts +4 -4
  12. package/es/components/autocomplete/src/index.vue.d.ts +2 -2
  13. package/es/components/carousel/index.d.ts +2 -2
  14. package/es/components/carousel/src/main.vue.d.ts +2 -2
  15. package/es/components/cascader/index.d.ts +2 -2
  16. package/es/components/cascader/src/index.vue.d.ts +1 -1
  17. package/es/components/checkbox/index.d.ts +6 -6
  18. package/es/components/checkbox/src/checkbox-button.vue.d.ts +1 -1
  19. package/es/components/checkbox/src/checkbox-group.vue.d.ts +1 -1
  20. package/es/components/checkbox/src/checkbox.vue.d.ts +2 -2
  21. package/es/components/color-picker/index.d.ts +2 -2
  22. package/es/components/color-picker/src/components/alpha-slider.vue.d.ts +1 -1
  23. package/es/components/color-picker/src/components/hue-slider.vue.d.ts +1 -1
  24. package/es/components/color-picker/src/index.vue.d.ts +1 -1
  25. package/es/components/descriptions/index.d.ts +8 -8
  26. package/es/components/descriptions/src/description-item.d.ts +2 -2
  27. package/es/components/descriptions/src/descriptions-cell.d.ts +1 -1
  28. package/es/components/descriptions/src/index.vue.d.ts +4 -4
  29. package/es/components/drawer/index.d.ts +6 -6
  30. package/es/components/drawer/src/index.vue.d.ts +3 -3
  31. package/es/components/dropdown/index.d.ts +2 -2
  32. package/es/components/dropdown/src/dropdown.vue.d.ts +2 -2
  33. package/es/components/form/index.js +2 -2
  34. package/es/components/icon/index.d.ts +1 -1
  35. package/es/components/icon/src/icon.vue.d.ts +1 -1
  36. package/es/components/image/index.d.ts +3 -3
  37. package/es/components/image/index.js +2 -3
  38. package/es/components/image/src/image.d.ts +1 -1
  39. package/es/components/image/src/image.vue.d.ts +3 -3
  40. package/es/components/image-viewer/index.d.ts +28 -104
  41. package/es/components/image-viewer/index.js +60 -61
  42. package/es/components/image-viewer/src/image-viewer.d.ts +14 -0
  43. package/es/components/image-viewer/src/image-viewer.vue.d.ts +55 -0
  44. package/es/components/input/index.d.ts +116 -360
  45. package/es/components/input/index.js +216 -209
  46. package/es/components/input/src/calc-textarea-height.d.ts +6 -0
  47. package/es/components/input/src/input.d.ts +46 -0
  48. package/es/components/input/src/input.vue.d.ts +162 -0
  49. package/es/components/input-number/index.d.ts +2 -2
  50. package/es/components/input-number/src/index.vue.d.ts +1 -1
  51. package/es/components/menu/index.d.ts +7 -3
  52. package/es/components/menu/index.js +8 -3
  53. package/es/components/menu/src/menu.d.ts +8 -3
  54. package/es/components/pagination/index.d.ts +2 -2
  55. package/es/components/pagination/src/pagination.d.ts +2 -2
  56. package/es/components/progress/index.js +0 -1
  57. package/es/components/radio/index.d.ts +2 -2
  58. package/es/components/radio/src/radio.vue.d.ts +2 -2
  59. package/es/components/rate/index.js +1 -1
  60. package/es/components/row/index.d.ts +4 -4
  61. package/es/components/row/src/row.d.ts +2 -2
  62. package/es/components/scrollbar/index.d.ts +4 -4
  63. package/es/components/scrollbar/src/index.vue.d.ts +2 -2
  64. package/es/components/select/index.d.ts +3 -3
  65. package/es/components/select/src/select.vue.d.ts +3 -3
  66. package/es/components/select-v2/index.d.ts +6 -6
  67. package/es/components/select-v2/index.js +2 -0
  68. package/es/components/select-v2/src/select.vue.d.ts +3 -3
  69. package/es/components/slider/index.d.ts +4 -4
  70. package/es/components/slider/src/button.vue.d.ts +2 -2
  71. package/es/components/slider/src/index.vue.d.ts +2 -2
  72. package/es/components/space/index.d.ts +2 -2
  73. package/es/components/space/src/space.d.ts +2 -2
  74. package/es/components/steps/index.d.ts +2 -2
  75. package/es/components/steps/src/index.vue.d.ts +2 -2
  76. package/es/components/table/index.d.ts +4 -4
  77. package/es/components/table/index.js +17 -9
  78. package/es/components/table/src/table.vue.d.ts +4 -4
  79. package/es/components/tag/index.d.ts +1 -1
  80. package/es/components/tag/src/tag.vue.d.ts +1 -1
  81. package/es/components/timeline/index.d.ts +4 -4
  82. package/es/components/timeline/src/item.vue.d.ts +2 -2
  83. package/es/components/tree/index.js +1 -1
  84. package/es/components/tree-v2/index.d.ts +1 -1
  85. package/es/components/tree-v2/index.js +2 -24
  86. package/es/components/tree-v2/src/tree.vue.d.ts +1 -1
  87. package/es/components/upload/index.d.ts +4 -4
  88. package/es/components/upload/src/index.vue.d.ts +2 -2
  89. package/es/components/upload/src/upload.vue.d.ts +2 -2
  90. package/es/components/virtual-list/src/builders/build-grid.d.ts +3 -3
  91. package/es/components/virtual-list/src/builders/build-list.d.ts +4 -4
  92. package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +3 -3
  93. package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +4 -4
  94. package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +3 -3
  95. package/es/components/virtual-list/src/components/fixed-size-list.d.ts +4 -4
  96. package/es/components/virtual-list/src/components/scrollbar.d.ts +1 -1
  97. package/es/utils/dom.d.ts +5 -5
  98. package/es/utils/dom.js +29 -36
  99. package/es/utils/props.d.ts +2 -2
  100. package/es/utils/props.js +15 -7
  101. package/es/utils/util.d.ts +2 -2
  102. package/es/utils/util.js +3 -3
  103. package/es/version.d.ts +1 -1
  104. package/es/version.js +1 -1
  105. package/lib/component.d.ts +24 -2
  106. package/lib/components/affix/index.js +1 -1
  107. package/lib/components/autocomplete/index.d.ts +4 -4
  108. package/lib/components/autocomplete/src/index.vue.d.ts +2 -2
  109. package/lib/components/carousel/index.d.ts +2 -2
  110. package/lib/components/carousel/src/main.vue.d.ts +2 -2
  111. package/lib/components/cascader/index.d.ts +2 -2
  112. package/lib/components/cascader/src/index.vue.d.ts +1 -1
  113. package/lib/components/checkbox/index.d.ts +6 -6
  114. package/lib/components/checkbox/src/checkbox-button.vue.d.ts +1 -1
  115. package/lib/components/checkbox/src/checkbox-group.vue.d.ts +1 -1
  116. package/lib/components/checkbox/src/checkbox.vue.d.ts +2 -2
  117. package/lib/components/color-picker/index.d.ts +2 -2
  118. package/lib/components/color-picker/src/components/alpha-slider.vue.d.ts +1 -1
  119. package/lib/components/color-picker/src/components/hue-slider.vue.d.ts +1 -1
  120. package/lib/components/color-picker/src/index.vue.d.ts +1 -1
  121. package/lib/components/descriptions/index.d.ts +8 -8
  122. package/lib/components/descriptions/src/description-item.d.ts +2 -2
  123. package/lib/components/descriptions/src/descriptions-cell.d.ts +1 -1
  124. package/lib/components/descriptions/src/index.vue.d.ts +4 -4
  125. package/lib/components/drawer/index.d.ts +6 -6
  126. package/lib/components/drawer/src/index.vue.d.ts +3 -3
  127. package/lib/components/dropdown/index.d.ts +2 -2
  128. package/lib/components/dropdown/src/dropdown.vue.d.ts +2 -2
  129. package/lib/components/form/index.js +2 -2
  130. package/lib/components/icon/index.d.ts +1 -1
  131. package/lib/components/icon/src/icon.vue.d.ts +1 -1
  132. package/lib/components/image/index.d.ts +3 -3
  133. package/lib/components/image/index.js +2 -3
  134. package/lib/components/image/src/image.d.ts +1 -1
  135. package/lib/components/image/src/image.vue.d.ts +3 -3
  136. package/lib/components/image-viewer/index.d.ts +28 -104
  137. package/lib/components/image-viewer/index.js +61 -60
  138. package/lib/components/image-viewer/src/image-viewer.d.ts +14 -0
  139. package/lib/components/image-viewer/src/image-viewer.vue.d.ts +55 -0
  140. package/lib/components/input/index.d.ts +116 -360
  141. package/lib/components/input/index.js +215 -206
  142. package/lib/components/input/src/calc-textarea-height.d.ts +6 -0
  143. package/lib/components/input/src/input.d.ts +46 -0
  144. package/lib/components/input/src/input.vue.d.ts +162 -0
  145. package/lib/components/input-number/index.d.ts +2 -2
  146. package/lib/components/input-number/src/index.vue.d.ts +1 -1
  147. package/lib/components/menu/index.d.ts +7 -3
  148. package/lib/components/menu/index.js +8 -3
  149. package/lib/components/menu/src/menu.d.ts +8 -3
  150. package/lib/components/pagination/index.d.ts +2 -2
  151. package/lib/components/pagination/src/pagination.d.ts +2 -2
  152. package/lib/components/progress/index.js +0 -1
  153. package/lib/components/radio/index.d.ts +2 -2
  154. package/lib/components/radio/src/radio.vue.d.ts +2 -2
  155. package/lib/components/rate/index.js +1 -1
  156. package/lib/components/row/index.d.ts +4 -4
  157. package/lib/components/row/src/row.d.ts +2 -2
  158. package/lib/components/scrollbar/index.d.ts +4 -4
  159. package/lib/components/scrollbar/src/index.vue.d.ts +2 -2
  160. package/lib/components/select/index.d.ts +3 -3
  161. package/lib/components/select/src/select.vue.d.ts +3 -3
  162. package/lib/components/select-v2/index.d.ts +6 -6
  163. package/lib/components/select-v2/index.js +2 -0
  164. package/lib/components/select-v2/src/select.vue.d.ts +3 -3
  165. package/lib/components/slider/index.d.ts +4 -4
  166. package/lib/components/slider/src/button.vue.d.ts +2 -2
  167. package/lib/components/slider/src/index.vue.d.ts +2 -2
  168. package/lib/components/space/index.d.ts +2 -2
  169. package/lib/components/space/src/space.d.ts +2 -2
  170. package/lib/components/steps/index.d.ts +2 -2
  171. package/lib/components/steps/src/index.vue.d.ts +2 -2
  172. package/lib/components/table/index.d.ts +4 -4
  173. package/lib/components/table/index.js +17 -9
  174. package/lib/components/table/src/table.vue.d.ts +4 -4
  175. package/lib/components/tag/index.d.ts +1 -1
  176. package/lib/components/tag/src/tag.vue.d.ts +1 -1
  177. package/lib/components/timeline/index.d.ts +4 -4
  178. package/lib/components/timeline/src/item.vue.d.ts +2 -2
  179. package/lib/components/tree/index.js +1 -1
  180. package/lib/components/tree-v2/index.d.ts +1 -1
  181. package/lib/components/tree-v2/index.js +2 -24
  182. package/lib/components/tree-v2/src/tree.vue.d.ts +1 -1
  183. package/lib/components/upload/index.d.ts +4 -4
  184. package/lib/components/upload/src/index.vue.d.ts +2 -2
  185. package/lib/components/upload/src/upload.vue.d.ts +2 -2
  186. package/lib/components/virtual-list/src/builders/build-grid.d.ts +3 -3
  187. package/lib/components/virtual-list/src/builders/build-list.d.ts +4 -4
  188. package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +3 -3
  189. package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +4 -4
  190. package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +3 -3
  191. package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +4 -4
  192. package/lib/components/virtual-list/src/components/scrollbar.d.ts +1 -1
  193. package/lib/utils/dom.d.ts +5 -5
  194. package/lib/utils/dom.js +29 -36
  195. package/lib/utils/props.d.ts +2 -2
  196. package/lib/utils/props.js +15 -7
  197. package/lib/utils/util.d.ts +2 -2
  198. package/lib/utils/util.js +2 -2
  199. package/lib/version.d.ts +1 -1
  200. package/lib/version.js +1 -1
  201. package/package.json +3 -2
  202. package/packages/components/affix/src/affix.vue +1 -1
  203. package/packages/components/color-picker/src/index.vue +1 -1
  204. package/packages/components/form/__tests__/form.spec.ts +1 -1
  205. package/packages/components/form/src/form-item.vue +2 -2
  206. package/packages/components/image/src/image.ts +3 -3
  207. package/packages/components/image/src/image.vue +1 -1
  208. package/packages/components/image-viewer/__tests__/image-viewer.spec.ts +1 -1
  209. package/packages/components/image-viewer/index.ts +5 -10
  210. package/packages/components/image-viewer/src/image-viewer.ts +32 -0
  211. package/packages/components/image-viewer/src/{index.vue → image-viewer.vue} +73 -82
  212. package/packages/components/input/__tests__/input.spec.ts +7 -7
  213. package/packages/components/input/index.ts +5 -10
  214. package/packages/components/input/src/{calcTextareaHeight.ts → calc-textarea-height.ts} +9 -7
  215. package/packages/components/input/src/input.ts +100 -0
  216. package/packages/components/input/src/{index.vue → input.vue} +135 -239
  217. package/packages/components/menu/src/menu.ts +10 -3
  218. package/packages/components/progress/src/index.vue +0 -1
  219. package/packages/components/rate/src/index.vue +1 -1
  220. package/packages/components/select-v2/src/useSelect.ts +2 -0
  221. package/packages/components/space/__tests__/space.spec.ts +1 -1
  222. package/packages/components/switch/__tests__/switch.spec.ts +1 -1
  223. package/packages/components/table/src/store/tree.ts +18 -3
  224. package/packages/components/table/src/table-body/render-helper.ts +1 -1
  225. package/packages/components/table/src/table-column/index.ts +4 -1
  226. package/packages/components/table/src/table-layout.ts +2 -2
  227. package/packages/components/table/src/util.ts +1 -1
  228. package/packages/components/tree/src/model/node.ts +1 -1
  229. package/packages/element-plus/package.json +3 -2
  230. package/packages/element-plus/version.ts +1 -1
  231. package/packages/theme-chalk/package.json +1 -2
  232. package/packages/theme-chalk/src/message-box.scss +1 -0
  233. package/packages/utils/dist/es/dom.d.ts +5 -5
  234. package/packages/utils/dist/es/dom.js +29 -36
  235. package/packages/utils/dist/es/props.d.ts +2 -2
  236. package/packages/utils/dist/es/props.js +15 -7
  237. package/packages/utils/dist/es/util.d.ts +2 -2
  238. package/packages/utils/dist/es/util.js +3 -3
  239. package/packages/utils/dist/lib/dom.d.ts +5 -5
  240. package/packages/utils/dist/lib/dom.js +29 -36
  241. package/packages/utils/dist/lib/props.d.ts +2 -2
  242. package/packages/utils/dist/lib/props.js +15 -7
  243. package/packages/utils/dist/lib/util.d.ts +2 -2
  244. package/packages/utils/dist/lib/util.js +2 -2
  245. package/packages/utils/dom.ts +34 -41
  246. package/packages/utils/props.ts +27 -11
  247. package/packages/utils/tests/dom.spec.ts +183 -0
  248. package/packages/utils/util.ts +8 -9
  249. package/tags.json +1 -1
  250. package/theme-chalk/el-message-box.css +1 -1
  251. package/theme-chalk/index.css +1 -1
  252. package/theme-chalk/src/message-box.scss +1 -0
  253. package/web-types.json +1 -1
  254. package/es/components/image-viewer/src/index.vue.d.ts +0 -67
  255. package/es/components/input/src/calcTextareaHeight.d.ts +0 -6
  256. package/es/components/input/src/index.vue.d.ts +0 -197
  257. package/lib/components/image-viewer/src/index.vue.d.ts +0 -67
  258. package/lib/components/input/src/calcTextareaHeight.d.ts +0 -6
  259. package/lib/components/input/src/index.vue.d.ts +0 -197
@@ -71,7 +71,7 @@ describe('Space.vue', () => {
71
71
  size: 'unknown',
72
72
  })
73
73
 
74
- expect(warnHandler).toHaveBeenCalledTimes(1)
74
+ expect(warnHandler).toHaveBeenCalled()
75
75
 
76
76
  expect(wrapper.find('.el-space__item').attributes('style')).toContain(
77
77
  'margin-right: 8px'
@@ -260,7 +260,7 @@ describe('Switch.vue', () => {
260
260
  this.loading = false
261
261
  return this.asyncResult == 'success'
262
262
  ? resolve(true)
263
- : reject(new Error('error'))
263
+ : reject(new Error('Error'))
264
264
  }, 1000)
265
265
  })
266
266
  },
@@ -67,6 +67,7 @@ function useTree<T>(watcherData: WatcherPropsData<T>) {
67
67
  }
68
68
 
69
69
  const updateTreeData = (
70
+ ifChangeExpandRowKeys = false,
70
71
  ifExpandAll = instance.store?.states.defaultExpandAll.value
71
72
  ) => {
72
73
  const nested = normalizedData.value
@@ -77,10 +78,17 @@ function useTree<T>(watcherData: WatcherPropsData<T>) {
77
78
  const oldTreeData = unref(treeData)
78
79
  const rootLazyRowKeys = []
79
80
  const getExpanded = (oldValue, key) => {
80
- if (expandRowKeys.value) {
81
- return ifExpandAll || expandRowKeys.value.includes(key)
81
+ if (ifChangeExpandRowKeys) {
82
+ if (expandRowKeys.value) {
83
+ return ifExpandAll || expandRowKeys.value.includes(key)
84
+ } else {
85
+ return !!(ifExpandAll || oldValue?.expanded)
86
+ }
82
87
  } else {
83
- return !!(ifExpandAll || oldValue?.expanded)
88
+ const included =
89
+ ifExpandAll ||
90
+ (expandRowKeys.value && expandRowKeys.value.includes(key))
91
+ return !!(oldValue?.expanded || included)
84
92
  }
85
93
  }
86
94
  // 合并 expanded 与 display,确保数据刷新后,状态不变
@@ -126,6 +134,13 @@ function useTree<T>(watcherData: WatcherPropsData<T>) {
126
134
  instance.store?.updateTableScrollY()
127
135
  }
128
136
 
137
+ watch(
138
+ () => expandRowKeys.value,
139
+ () => {
140
+ updateTreeData(true)
141
+ }
142
+ )
143
+
129
144
  watch(
130
145
  () => normalizedData.value,
131
146
  () => {
@@ -201,7 +201,7 @@ function useRender<T>(props: Partial<TableBodyProps<T>>) {
201
201
  }
202
202
  const childKey = getRowIdentity(node, rowKey.value)
203
203
  if (childKey === undefined || childKey === null) {
204
- throw new Error('for nested data item, row-key is required.')
204
+ throw new Error('For nested data item, row-key is required.')
205
205
  }
206
206
  cur = { ...treeData.value[childKey] }
207
207
  // 对于当前节点,分成有无子节点两种情况。
@@ -165,7 +165,10 @@ export default defineComponent({
165
165
  })
166
166
  if (renderDefault instanceof Array) {
167
167
  for (const childNode of renderDefault) {
168
- if (childNode.type?.name === 'ElTableColumn') {
168
+ if (
169
+ childNode.type?.name === 'ElTableColumn' ||
170
+ childNode.shapeFlag & 2
171
+ ) {
169
172
  children.push(childNode)
170
173
  } else if (
171
174
  childNode.type === Fragment &&
@@ -62,10 +62,10 @@ class TableLayout<T> {
62
62
  }
63
63
  }
64
64
  if (!this.table) {
65
- throw new Error('table is required for Table Layout')
65
+ throw new Error('Table is required for Table Layout')
66
66
  }
67
67
  if (!this.store) {
68
- throw new Error('store is required for Table Layout')
68
+ throw new Error('Store is required for Table Layout')
69
69
  }
70
70
  }
71
71
 
@@ -149,7 +149,7 @@ export const getRowIdentity = <T>(
149
149
  row: T,
150
150
  rowKey: string | ((row: T) => any)
151
151
  ): string => {
152
- if (!row) throw new Error('row is required when get row identity')
152
+ if (!row) throw new Error('Row is required when get row identity')
153
153
  if (typeof rowKey === 'string') {
154
154
  if (rowKey.indexOf('.') < 0) {
155
155
  return `${row[rowKey]}`
@@ -251,7 +251,7 @@ class Node {
251
251
  }
252
252
 
253
253
  insertChild(child?: FakeNode | Node, index?: number, batch?: boolean): void {
254
- if (!child) throw new Error('insertChild error: child is required.')
254
+ if (!child) throw new Error('InsertChild error: child is required.')
255
255
 
256
256
  if (!(child instanceof Node)) {
257
257
  if (!batch) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-pe",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "A Component Library for Vue 3",
5
5
  "homepage": "https://element-plus.org/",
6
6
  "keywords": [
@@ -35,7 +35,8 @@
35
35
  "vue": "^3.2.0"
36
36
  },
37
37
  "dependencies": {
38
- "@popperjs/core": "^2.10.1",
38
+ "@element-plus/icons": "^0.0.11",
39
+ "@popperjs/core": "^2.10.2",
39
40
  "@vueuse/core": "~6.1.0",
40
41
  "async-validator": "^4.0.3",
41
42
  "dayjs": "^1.10.7",
@@ -1 +1 @@
1
- export const version = '1.0.3'
1
+ export const version = '1.0.5'
@@ -34,8 +34,7 @@
34
34
  "gulp-autoprefixer": "^8.0.0",
35
35
  "gulp-clean-css": "^4.3.0",
36
36
  "gulp-rename": "^2.0.0",
37
- "gulp-sass": "^5.0.0",
38
- "sass": "^1.42.1"
37
+ "gulp-sass": "^5.0.0"
39
38
  },
40
39
  "gitHead": "c69724230befa8fede0e6b9c37fb0b7e39fd7cdd"
41
40
  }
@@ -106,6 +106,7 @@
106
106
  + .#{$namespace}-message-box__message {
107
107
  padding-left: 36px;
108
108
  padding-right: 12px;
109
+ word-break: break-word;
109
110
  }
110
111
 
111
112
  @each $type in (success, info, warning, error) {
@@ -3,14 +3,14 @@ import type { Nullable } from './types';
3
3
  export declare const on: (element: HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
4
4
  export declare const off: (element: HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
5
5
  export declare const once: (el: HTMLElement, event: string, fn: EventListener) => void;
6
- export declare function hasClass(el: HTMLElement, cls: string): boolean;
7
- export declare function addClass(el: HTMLElement, cls: string): void;
8
- export declare function removeClass(el: HTMLElement, cls: string): void;
6
+ export declare function hasClass(el: HTMLElement | Element, cls: string): boolean;
7
+ export declare function addClass(el: HTMLElement | Element, cls: string): void;
8
+ export declare function removeClass(el: HTMLElement | Element, cls: string): void;
9
9
  export declare const getStyle: (element: HTMLElement, styleName: string) => string;
10
10
  export declare function setStyle(element: HTMLElement, styleName: CSSProperties | string, value?: string): void;
11
11
  export declare function removeStyle(element: HTMLElement, style: CSSProperties | string): void;
12
- export declare const isScroll: (el: HTMLElement, isVertical?: Nullable<boolean>) => RegExpMatchArray;
13
- export declare const getScrollContainer: (el: HTMLElement, isVertical?: Nullable<boolean>) => Window | HTMLElement;
12
+ export declare const isScroll: (el: HTMLElement, isVertical?: Nullable<boolean>) => RegExpMatchArray | null;
13
+ export declare const getScrollContainer: (el: HTMLElement, isVertical?: Nullable<boolean>) => Window | HTMLElement | undefined;
14
14
  export declare const isInContainer: (el: Element | undefined, container: Element | Window | undefined) => boolean;
15
15
  export declare const getOffsetTop: (el: HTMLElement) => number;
16
16
  export declare const getOffsetTopDistance: (el: HTMLElement, containerEl: HTMLElement) => number;
@@ -1,7 +1,7 @@
1
1
  import isServer from './isServer';
2
2
  import { camelize, isObject } from './util';
3
- const trim = function (s) {
4
- return (s || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
3
+ const trimArr = function (s) {
4
+ return (s || '').split(' ').filter((item) => !!item.trim());
5
5
  };
6
6
  export const on = function (element, event, handler, useCapture = false) {
7
7
  if (element && event && handler) {
@@ -31,54 +31,47 @@ export function hasClass(el, cls) {
31
31
  return el.classList.contains(cls);
32
32
  }
33
33
  else {
34
- return ` ${el.className} `.indexOf(` ${cls} `) > -1;
34
+ const className = el.getAttribute('class') || '';
35
+ return className.split(' ').includes(cls);
35
36
  }
36
37
  }
37
38
  export function addClass(el, cls) {
38
39
  if (!el)
39
40
  return;
40
- let curClass = el.className;
41
- const classes = (cls || '').split(' ');
42
- for (let i = 0, j = classes.length; i < j; i++) {
43
- const clsName = classes[i];
44
- if (!clsName)
45
- continue;
46
- if (el.classList) {
47
- el.classList.add(clsName);
48
- }
49
- else if (!hasClass(el, clsName)) {
50
- curClass += ` ${clsName}`;
51
- }
41
+ let className = el.getAttribute('class') || '';
42
+ const curClass = trimArr(className);
43
+ const classes = (cls || '')
44
+ .split(' ')
45
+ .filter((item) => !curClass.includes(item) && !!item.trim());
46
+ if (el.classList) {
47
+ el.classList.add(...classes);
52
48
  }
53
- if (!el.classList) {
54
- el.className = curClass;
49
+ else {
50
+ className += ` ${classes.join(' ')}`;
51
+ el.setAttribute('class', className);
55
52
  }
56
53
  }
57
54
  export function removeClass(el, cls) {
58
55
  if (!el || !cls)
59
56
  return;
60
- const classes = cls.split(' ');
61
- let curClass = ` ${el.className} `;
62
- for (let i = 0, j = classes.length; i < j; i++) {
63
- const clsName = classes[i];
64
- if (!clsName)
65
- continue;
66
- if (el.classList) {
67
- el.classList.remove(clsName);
68
- }
69
- else if (hasClass(el, clsName)) {
70
- curClass = curClass.replace(` ${clsName} `, ' ');
71
- }
72
- }
73
- if (!el.classList) {
74
- el.className = trim(curClass);
57
+ const classes = trimArr(cls);
58
+ let curClass = el.getAttribute('class') || '';
59
+ if (el.classList) {
60
+ el.classList.remove(...classes);
61
+ return;
75
62
  }
63
+ classes.forEach((item) => {
64
+ curClass = curClass.replace(` ${item} `, ' ');
65
+ });
66
+ const className = trimArr(curClass).join(' ');
67
+ el.setAttribute('class', className);
76
68
  }
77
69
  export const getStyle = function (element, styleName) {
70
+ var _a;
78
71
  if (isServer)
79
- return;
72
+ return '';
80
73
  if (!element || !styleName)
81
- return null;
74
+ return '';
82
75
  styleName = camelize(styleName);
83
76
  if (styleName === 'float') {
84
77
  styleName = 'cssFloat';
@@ -87,7 +80,7 @@ export const getStyle = function (element, styleName) {
87
80
  const style = element.style[styleName];
88
81
  if (style)
89
82
  return style;
90
- const computed = document.defaultView.getComputedStyle(element, '');
83
+ const computed = (_a = document.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(element, '');
91
84
  return computed ? computed[styleName] : '';
92
85
  }
93
86
  catch (e) {
@@ -121,7 +114,7 @@ export function removeStyle(element, style) {
121
114
  }
122
115
  export const isScroll = (el, isVertical) => {
123
116
  if (isServer)
124
- return;
117
+ return null;
125
118
  const determinedDirection = isVertical === null || isVertical === undefined;
126
119
  const overflow = determinedDirection
127
120
  ? getStyle(el, 'overflow')
@@ -39,13 +39,13 @@ export declare type BuildPropReturn<T, D, R, V, C> = {
39
39
  readonly validator: ((val: unknown) => boolean) | undefined;
40
40
  [propKey]: true;
41
41
  } & BuildPropDefault<BuildPropType<T, V, C>, IfUnknown<D, never>, IfUnknown<R, false>>;
42
- export declare function buildProp<T = never, D extends BuildPropType<T, V, C> = never, R extends boolean = false, V = never, C = never>(option: BuildPropOption<T, D, R, V, C>): BuildPropReturn<T, D, R, V, C>;
42
+ export declare function buildProp<T = never, D extends BuildPropType<T, V, C> = never, R extends boolean = false, V = never, C = never>(option: BuildPropOption<T, D, R, V, C>, key?: string): BuildPropReturn<T, D, R, V, C>;
43
43
  declare type NativePropType = [
44
44
  ((...args: any) => any) | {
45
45
  new (...args: any): any;
46
46
  } | undefined | null
47
47
  ];
48
- export declare const buildProps: <O extends { [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any> ? O[K] : [O[K]] extends NativePropType ? O[K] : O[K] extends BuildPropOption<infer T, infer D, infer R, infer V, infer C> ? D extends BuildPropType<T, V, C> ? BuildPropOption<T, D, R, V, C> : never : never; }>(options: O) => { [K_1 in keyof O]: O[K_1] extends {
48
+ export declare const buildProps: <O extends { [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any> ? O[K] : [O[K]] extends NativePropType ? O[K] : O[K] extends BuildPropOption<infer T, infer D, infer R, infer V, infer C> ? D extends BuildPropType<T, V, C> ? BuildPropOption<T, D, R, V, C> : never : never; }>(props: O) => { [K_1 in keyof O]: O[K_1] extends {
49
49
  [propKey]: boolean;
50
50
  } ? O[K_1] : [O[K_1]] extends NativePropType ? O[K_1] : O[K_1] extends BuildPropOption<infer T_1, infer _D, infer R_1, infer V_1, infer C_1> ? BuildPropReturn<T_1, O[K_1]["default"], R_1, V_1, C_1> : never; };
51
51
  export declare const definePropType: <T>(val: any) => PropWrapper<T>;
@@ -1,10 +1,9 @@
1
+ import { warn } from 'vue';
1
2
  import { isObject } from '@vue/shared';
2
- import mapValues from 'lodash/mapValues';
3
- import { debugWarn } from './error';
3
+ import fromPairs from 'lodash/fromPairs';
4
4
  const wrapperKey = Symbol();
5
5
  export const propKey = Symbol();
6
- export function buildProp(option) {
7
- var _a;
6
+ export function buildProp(option, key) {
8
7
  if (!isObject(option) || !!option[propKey])
9
8
  return option;
10
9
  const { values, required, default: defaultValue, type, validator } = option;
@@ -19,20 +18,29 @@ export function buildProp(option) {
19
18
  if (validator)
20
19
  valid || (valid = validator(val));
21
20
  if (!valid && allowedValues.length > 0) {
22
- debugWarn(`Vue warn`, `Invalid prop: Expected one of (${allowedValues.join(', ')}), got value ${val}`);
21
+ const allowValuesText = [...new Set(allowedValues)]
22
+ .map((value) => JSON.stringify(value))
23
+ .join(', ');
24
+ warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ''}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
23
25
  }
24
26
  return valid;
25
27
  }
26
28
  : undefined;
27
29
  return {
28
- type: ((_a = type) === null || _a === void 0 ? void 0 : _a[wrapperKey]) || type,
30
+ type: typeof type === 'object' &&
31
+ Object.getOwnPropertySymbols(type).includes(wrapperKey)
32
+ ? type[wrapperKey]
33
+ : type,
29
34
  required: !!required,
30
35
  default: defaultValue,
31
36
  validator: _validator,
32
37
  [propKey]: true,
33
38
  };
34
39
  }
35
- export const buildProps = (options) => mapValues(options, (option) => buildProp(option));
40
+ export const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
41
+ key,
42
+ buildProp(option, key),
43
+ ]));
36
44
  export const definePropType = (val) => ({ [wrapperKey]: val });
37
45
  export const keyOf = (arr) => Object.keys(arr);
38
46
  export const mutable = (val) => val;
@@ -1,6 +1,6 @@
1
1
  import { camelize, capitalize, extend, hasOwn, isArray, isObject, isString, looseEqual } from '@vue/shared';
2
2
  import type { ComponentPublicInstance, CSSProperties, Ref } from 'vue';
3
- import type { AnyFunction, TimeoutHandle, Nullable } from './types';
3
+ import type { TimeoutHandle, Nullable } from './types';
4
4
  export declare const SCOPE = "Util";
5
5
  export declare function toObject<T>(arr: Array<T>): Record<string, T>;
6
6
  export declare const getValueByPath: (obj: any, paths?: string) => unknown;
@@ -20,7 +20,7 @@ export { hasOwn, isObject, isArray, isString, capitalize, camelize, looseEqual,
20
20
  export declare const isBool: (val: unknown) => val is boolean;
21
21
  export declare const isNumber: (val: unknown) => val is number;
22
22
  export declare const isHTMLElement: (val: unknown) => boolean;
23
- export declare function rafThrottle<T extends AnyFunction<any>>(fn: T): AnyFunction<void>;
23
+ export declare function rafThrottle<T extends (...args: any) => any>(fn: T): T;
24
24
  export declare const clearTimer: (timer: Ref<TimeoutHandle>) => void;
25
25
  export declare function getRandomInt(max: number): number;
26
26
  export declare function isUndefined(val: any): val is undefined;
@@ -2,7 +2,7 @@ import { getCurrentInstance } from 'vue';
2
2
  import { camelize, capitalize, extend, hasOwn, hyphenate, isArray, isObject, isString, isFunction, looseEqual, toRawType, } from '@vue/shared';
3
3
  import isEqualWith from 'lodash/isEqualWith';
4
4
  import isServer from './isServer';
5
- import { debugWarn } from './error';
5
+ import { debugWarn, throwError } from './error';
6
6
  export const SCOPE = 'Util';
7
7
  export function toObject(arr) {
8
8
  const res = {};
@@ -41,7 +41,7 @@ export function getPropByPath(obj, path, strict) {
41
41
  }
42
42
  else {
43
43
  if (strict) {
44
- throw new Error('please transfer a valid prop path to form item!');
44
+ throwError(SCOPE, 'Please transfer a valid prop path to form item!');
45
45
  }
46
46
  break;
47
47
  }
@@ -92,7 +92,7 @@ export function rafThrottle(fn) {
92
92
  return;
93
93
  locked = true;
94
94
  window.requestAnimationFrame(() => {
95
- fn.apply(this, args);
95
+ Reflect.apply(fn, this, args);
96
96
  locked = false;
97
97
  });
98
98
  };
@@ -3,14 +3,14 @@ import type { Nullable } from './types';
3
3
  export declare const on: (element: HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
4
4
  export declare const off: (element: HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
5
5
  export declare const once: (el: HTMLElement, event: string, fn: EventListener) => void;
6
- export declare function hasClass(el: HTMLElement, cls: string): boolean;
7
- export declare function addClass(el: HTMLElement, cls: string): void;
8
- export declare function removeClass(el: HTMLElement, cls: string): void;
6
+ export declare function hasClass(el: HTMLElement | Element, cls: string): boolean;
7
+ export declare function addClass(el: HTMLElement | Element, cls: string): void;
8
+ export declare function removeClass(el: HTMLElement | Element, cls: string): void;
9
9
  export declare const getStyle: (element: HTMLElement, styleName: string) => string;
10
10
  export declare function setStyle(element: HTMLElement, styleName: CSSProperties | string, value?: string): void;
11
11
  export declare function removeStyle(element: HTMLElement, style: CSSProperties | string): void;
12
- export declare const isScroll: (el: HTMLElement, isVertical?: Nullable<boolean>) => RegExpMatchArray;
13
- export declare const getScrollContainer: (el: HTMLElement, isVertical?: Nullable<boolean>) => Window | HTMLElement;
12
+ export declare const isScroll: (el: HTMLElement, isVertical?: Nullable<boolean>) => RegExpMatchArray | null;
13
+ export declare const getScrollContainer: (el: HTMLElement, isVertical?: Nullable<boolean>) => Window | HTMLElement | undefined;
14
14
  export declare const isInContainer: (el: Element | undefined, container: Element | Window | undefined) => boolean;
15
15
  export declare const getOffsetTop: (el: HTMLElement) => number;
16
16
  export declare const getOffsetTopDistance: (el: HTMLElement, containerEl: HTMLElement) => number;
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.stop = exports.getOffsetTopDistance = exports.getOffsetTop = exports.isInContainer = exports.getScrollContainer = exports.isScroll = exports.removeStyle = exports.setStyle = exports.getStyle = exports.removeClass = exports.addClass = exports.hasClass = exports.once = exports.off = exports.on = void 0;
7
7
  const isServer_1 = __importDefault(require("./isServer"));
8
8
  const util_1 = require("./util");
9
- const trim = function (s) {
10
- return (s || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
9
+ const trimArr = function (s) {
10
+ return (s || '').split(' ').filter((item) => !!item.trim());
11
11
  };
12
12
  const on = function (element, event, handler, useCapture = false) {
13
13
  if (element && event && handler) {
@@ -40,57 +40,50 @@ function hasClass(el, cls) {
40
40
  return el.classList.contains(cls);
41
41
  }
42
42
  else {
43
- return ` ${el.className} `.indexOf(` ${cls} `) > -1;
43
+ const className = el.getAttribute('class') || '';
44
+ return className.split(' ').includes(cls);
44
45
  }
45
46
  }
46
47
  exports.hasClass = hasClass;
47
48
  function addClass(el, cls) {
48
49
  if (!el)
49
50
  return;
50
- let curClass = el.className;
51
- const classes = (cls || '').split(' ');
52
- for (let i = 0, j = classes.length; i < j; i++) {
53
- const clsName = classes[i];
54
- if (!clsName)
55
- continue;
56
- if (el.classList) {
57
- el.classList.add(clsName);
58
- }
59
- else if (!hasClass(el, clsName)) {
60
- curClass += ` ${clsName}`;
61
- }
51
+ let className = el.getAttribute('class') || '';
52
+ const curClass = trimArr(className);
53
+ const classes = (cls || '')
54
+ .split(' ')
55
+ .filter((item) => !curClass.includes(item) && !!item.trim());
56
+ if (el.classList) {
57
+ el.classList.add(...classes);
62
58
  }
63
- if (!el.classList) {
64
- el.className = curClass;
59
+ else {
60
+ className += ` ${classes.join(' ')}`;
61
+ el.setAttribute('class', className);
65
62
  }
66
63
  }
67
64
  exports.addClass = addClass;
68
65
  function removeClass(el, cls) {
69
66
  if (!el || !cls)
70
67
  return;
71
- const classes = cls.split(' ');
72
- let curClass = ` ${el.className} `;
73
- for (let i = 0, j = classes.length; i < j; i++) {
74
- const clsName = classes[i];
75
- if (!clsName)
76
- continue;
77
- if (el.classList) {
78
- el.classList.remove(clsName);
79
- }
80
- else if (hasClass(el, clsName)) {
81
- curClass = curClass.replace(` ${clsName} `, ' ');
82
- }
83
- }
84
- if (!el.classList) {
85
- el.className = trim(curClass);
68
+ const classes = trimArr(cls);
69
+ let curClass = el.getAttribute('class') || '';
70
+ if (el.classList) {
71
+ el.classList.remove(...classes);
72
+ return;
86
73
  }
74
+ classes.forEach((item) => {
75
+ curClass = curClass.replace(` ${item} `, ' ');
76
+ });
77
+ const className = trimArr(curClass).join(' ');
78
+ el.setAttribute('class', className);
87
79
  }
88
80
  exports.removeClass = removeClass;
89
81
  const getStyle = function (element, styleName) {
82
+ var _a;
90
83
  if (isServer_1.default)
91
- return;
84
+ return '';
92
85
  if (!element || !styleName)
93
- return null;
86
+ return '';
94
87
  styleName = (0, util_1.camelize)(styleName);
95
88
  if (styleName === 'float') {
96
89
  styleName = 'cssFloat';
@@ -99,7 +92,7 @@ const getStyle = function (element, styleName) {
99
92
  const style = element.style[styleName];
100
93
  if (style)
101
94
  return style;
102
- const computed = document.defaultView.getComputedStyle(element, '');
95
+ const computed = (_a = document.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(element, '');
103
96
  return computed ? computed[styleName] : '';
104
97
  }
105
98
  catch (e) {
@@ -136,7 +129,7 @@ function removeStyle(element, style) {
136
129
  exports.removeStyle = removeStyle;
137
130
  const isScroll = (el, isVertical) => {
138
131
  if (isServer_1.default)
139
- return;
132
+ return null;
140
133
  const determinedDirection = isVertical === null || isVertical === undefined;
141
134
  const overflow = determinedDirection
142
135
  ? (0, exports.getStyle)(el, 'overflow')
@@ -39,13 +39,13 @@ export declare type BuildPropReturn<T, D, R, V, C> = {
39
39
  readonly validator: ((val: unknown) => boolean) | undefined;
40
40
  [propKey]: true;
41
41
  } & BuildPropDefault<BuildPropType<T, V, C>, IfUnknown<D, never>, IfUnknown<R, false>>;
42
- export declare function buildProp<T = never, D extends BuildPropType<T, V, C> = never, R extends boolean = false, V = never, C = never>(option: BuildPropOption<T, D, R, V, C>): BuildPropReturn<T, D, R, V, C>;
42
+ export declare function buildProp<T = never, D extends BuildPropType<T, V, C> = never, R extends boolean = false, V = never, C = never>(option: BuildPropOption<T, D, R, V, C>, key?: string): BuildPropReturn<T, D, R, V, C>;
43
43
  declare type NativePropType = [
44
44
  ((...args: any) => any) | {
45
45
  new (...args: any): any;
46
46
  } | undefined | null
47
47
  ];
48
- export declare const buildProps: <O extends { [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any> ? O[K] : [O[K]] extends NativePropType ? O[K] : O[K] extends BuildPropOption<infer T, infer D, infer R, infer V, infer C> ? D extends BuildPropType<T, V, C> ? BuildPropOption<T, D, R, V, C> : never : never; }>(options: O) => { [K_1 in keyof O]: O[K_1] extends {
48
+ export declare const buildProps: <O extends { [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any> ? O[K] : [O[K]] extends NativePropType ? O[K] : O[K] extends BuildPropOption<infer T, infer D, infer R, infer V, infer C> ? D extends BuildPropType<T, V, C> ? BuildPropOption<T, D, R, V, C> : never : never; }>(props: O) => { [K_1 in keyof O]: O[K_1] extends {
49
49
  [propKey]: boolean;
50
50
  } ? O[K_1] : [O[K_1]] extends NativePropType ? O[K_1] : O[K_1] extends BuildPropOption<infer T_1, infer _D, infer R_1, infer V_1, infer C_1> ? BuildPropReturn<T_1, O[K_1]["default"], R_1, V_1, C_1> : never; };
51
51
  export declare const definePropType: <T>(val: any) => PropWrapper<T>;
@@ -4,13 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.componentSize = exports.mutable = exports.keyOf = exports.definePropType = exports.buildProps = exports.buildProp = exports.propKey = void 0;
7
+ const vue_1 = require("vue");
7
8
  const shared_1 = require("@vue/shared");
8
- const mapValues_1 = __importDefault(require("lodash/mapValues"));
9
- const error_1 = require("./error");
9
+ const fromPairs_1 = __importDefault(require("lodash/fromPairs"));
10
10
  const wrapperKey = Symbol();
11
11
  exports.propKey = Symbol();
12
- function buildProp(option) {
13
- var _a;
12
+ function buildProp(option, key) {
14
13
  if (!(0, shared_1.isObject)(option) || !!option[exports.propKey])
15
14
  return option;
16
15
  const { values, required, default: defaultValue, type, validator } = option;
@@ -25,13 +24,19 @@ function buildProp(option) {
25
24
  if (validator)
26
25
  valid || (valid = validator(val));
27
26
  if (!valid && allowedValues.length > 0) {
28
- (0, error_1.debugWarn)(`Vue warn`, `Invalid prop: Expected one of (${allowedValues.join(', ')}), got value ${val}`);
27
+ const allowValuesText = [...new Set(allowedValues)]
28
+ .map((value) => JSON.stringify(value))
29
+ .join(', ');
30
+ (0, vue_1.warn)(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ''}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
29
31
  }
30
32
  return valid;
31
33
  }
32
34
  : undefined;
33
35
  return {
34
- type: ((_a = type) === null || _a === void 0 ? void 0 : _a[wrapperKey]) || type,
36
+ type: typeof type === 'object' &&
37
+ Object.getOwnPropertySymbols(type).includes(wrapperKey)
38
+ ? type[wrapperKey]
39
+ : type,
35
40
  required: !!required,
36
41
  default: defaultValue,
37
42
  validator: _validator,
@@ -39,7 +44,10 @@ function buildProp(option) {
39
44
  };
40
45
  }
41
46
  exports.buildProp = buildProp;
42
- const buildProps = (options) => (0, mapValues_1.default)(options, (option) => buildProp(option));
47
+ const buildProps = (props) => (0, fromPairs_1.default)(Object.entries(props).map(([key, option]) => [
48
+ key,
49
+ buildProp(option, key),
50
+ ]));
43
51
  exports.buildProps = buildProps;
44
52
  const definePropType = (val) => ({ [wrapperKey]: val });
45
53
  exports.definePropType = definePropType;
@@ -1,6 +1,6 @@
1
1
  import { camelize, capitalize, extend, hasOwn, isArray, isObject, isString, looseEqual } from '@vue/shared';
2
2
  import type { ComponentPublicInstance, CSSProperties, Ref } from 'vue';
3
- import type { AnyFunction, TimeoutHandle, Nullable } from './types';
3
+ import type { TimeoutHandle, Nullable } from './types';
4
4
  export declare const SCOPE = "Util";
5
5
  export declare function toObject<T>(arr: Array<T>): Record<string, T>;
6
6
  export declare const getValueByPath: (obj: any, paths?: string) => unknown;
@@ -20,7 +20,7 @@ export { hasOwn, isObject, isArray, isString, capitalize, camelize, looseEqual,
20
20
  export declare const isBool: (val: unknown) => val is boolean;
21
21
  export declare const isNumber: (val: unknown) => val is number;
22
22
  export declare const isHTMLElement: (val: unknown) => boolean;
23
- export declare function rafThrottle<T extends AnyFunction<any>>(fn: T): AnyFunction<void>;
23
+ export declare function rafThrottle<T extends (...args: any) => any>(fn: T): T;
24
24
  export declare const clearTimer: (timer: Ref<TimeoutHandle>) => void;
25
25
  export declare function getRandomInt(max: number): number;
26
26
  export declare function isUndefined(val: any): val is undefined;
@@ -57,7 +57,7 @@ function getPropByPath(obj, path, strict) {
57
57
  }
58
58
  else {
59
59
  if (strict) {
60
- throw new Error('please transfer a valid prop path to form item!');
60
+ (0, error_1.throwError)(exports.SCOPE, 'Please transfer a valid prop path to form item!');
61
61
  }
62
62
  break;
63
63
  }
@@ -117,7 +117,7 @@ function rafThrottle(fn) {
117
117
  return;
118
118
  locked = true;
119
119
  window.requestAnimationFrame(() => {
120
- fn.apply(this, args);
120
+ Reflect.apply(fn, this, args);
121
121
  locked = false;
122
122
  });
123
123
  };