vxe-pc-ui 0.2.0 → 0.4.0

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 (318) hide show
  1. package/es/anchor/index.js +2 -0
  2. package/es/anchor/src/anchor.js +18 -18
  3. package/es/anchor-link/index.js +2 -0
  4. package/es/breadcrumb/index.js +2 -0
  5. package/es/breadcrumb/src/breadcrumb.js +2 -2
  6. package/es/breadcrumb-item/index.js +2 -0
  7. package/es/button/index.js +2 -0
  8. package/es/button/src/button-group.js +2 -5
  9. package/es/button-group/index.js +2 -0
  10. package/es/checkbox/src/checkbox.js +8 -8
  11. package/es/checkbox/src/group.js +6 -6
  12. package/es/checkbox-group/index.js +1 -1
  13. package/es/col/index.js +2 -0
  14. package/es/components.js +3 -0
  15. package/es/form/index.js +2 -0
  16. package/es/form/src/form-config-item.js +3 -8
  17. package/es/form/src/form-item.js +3 -8
  18. package/es/form/src/form.js +5 -8
  19. package/es/form/src/render.js +2 -10
  20. package/es/form-design/index.js +2 -0
  21. package/es/form-gather/index.js +2 -0
  22. package/es/form-item/index.js +2 -0
  23. package/es/icon/index.js +2 -0
  24. package/es/input/index.js +1 -1
  25. package/es/input/style.css +5 -5
  26. package/es/input/style.min.css +1 -1
  27. package/es/layout-aside/index.js +2 -0
  28. package/es/layout-body/index.js +2 -0
  29. package/es/layout-container/index.js +2 -0
  30. package/es/layout-footer/index.js +2 -0
  31. package/es/layout-header/index.js +2 -0
  32. package/es/list/index.js +10 -0
  33. package/es/list/src/list.js +340 -0
  34. package/es/list/style.css +26 -0
  35. package/es/list/style.min.css +1 -0
  36. package/es/list-design/index.js +2 -0
  37. package/es/loading/index.js +2 -0
  38. package/es/modal/index.js +1 -1
  39. package/es/modal/src/modal.js +2 -5
  40. package/es/modal/style.css +1 -1
  41. package/es/modal/style.min.css +1 -1
  42. package/es/optgroup/index.js +1 -1
  43. package/es/option/index.js +1 -1
  44. package/es/pager/index.js +1 -1
  45. package/es/pager/src/pager.js +4 -4
  46. package/es/pager/style.css +2 -2
  47. package/es/pager/style.min.css +1 -1
  48. package/es/pulldown/index.js +1 -1
  49. package/es/pulldown/style.css +2 -2
  50. package/es/pulldown/style.min.css +1 -1
  51. package/es/radio/index.js +1 -1
  52. package/es/radio-button/index.js +1 -1
  53. package/es/radio-group/index.js +1 -1
  54. package/es/row/index.js +2 -0
  55. package/es/select/index.js +1 -1
  56. package/es/select/style.css +2 -2
  57. package/es/select/style.min.css +1 -1
  58. package/es/style.css +1 -1
  59. package/es/style.min.css +1 -1
  60. package/es/switch/index.js +1 -1
  61. package/es/switch/style.css +1 -1
  62. package/es/switch/style.min.css +1 -1
  63. package/es/tab-pane/index.js +2 -0
  64. package/es/tabs/index.js +2 -0
  65. package/es/tabs/src/tabs.js +50 -19
  66. package/es/tabs/style.css +49 -34
  67. package/es/tabs/style.min.css +1 -1
  68. package/es/textarea/index.js +1 -1
  69. package/es/textarea/style.css +2 -2
  70. package/es/textarea/style.min.css +1 -1
  71. package/es/tooltip/index.js +2 -0
  72. package/es/tooltip/src/tooltip.js +2 -7
  73. package/es/ui/src/core.js +1 -1
  74. package/es/ui/src/globalStore.js +64 -66
  75. package/es/ui/src/log.js +1 -1
  76. package/es/ui/src/resize.js +81 -0
  77. package/es/ui/src/store.js +8 -1
  78. package/es/vxe-input/style.css +5 -5
  79. package/es/vxe-input/style.min.css +1 -1
  80. package/es/vxe-list/index.js +3 -0
  81. package/es/vxe-list/style.css +26 -0
  82. package/es/vxe-list/style.min.css +1 -0
  83. package/es/vxe-modal/style.css +1 -1
  84. package/es/vxe-modal/style.min.css +1 -1
  85. package/es/vxe-pager/style.css +2 -2
  86. package/es/vxe-pager/style.min.css +1 -1
  87. package/es/vxe-pulldown/style.css +2 -2
  88. package/es/vxe-pulldown/style.min.css +1 -1
  89. package/es/vxe-select/style.css +2 -2
  90. package/es/vxe-select/style.min.css +1 -1
  91. package/es/vxe-switch/style.css +1 -1
  92. package/es/vxe-switch/style.min.css +1 -1
  93. package/es/vxe-tabs/style.css +49 -34
  94. package/es/vxe-tabs/style.min.css +1 -1
  95. package/es/vxe-textarea/style.css +2 -2
  96. package/es/vxe-textarea/style.min.css +1 -1
  97. package/lib/anchor/index.js +2 -0
  98. package/lib/anchor/index.min.js +1 -1
  99. package/lib/anchor/src/anchor.js +18 -18
  100. package/lib/anchor/src/anchor.min.js +1 -1
  101. package/lib/anchor-link/index.js +2 -0
  102. package/lib/anchor-link/index.min.js +1 -1
  103. package/lib/breadcrumb/index.js +2 -0
  104. package/lib/breadcrumb/index.min.js +1 -1
  105. package/lib/breadcrumb/src/breadcrumb.js +2 -2
  106. package/lib/breadcrumb/src/breadcrumb.min.js +1 -1
  107. package/lib/breadcrumb-item/index.js +2 -0
  108. package/lib/breadcrumb-item/index.min.js +1 -1
  109. package/lib/button/index.js +2 -0
  110. package/lib/button/index.min.js +1 -1
  111. package/lib/button/src/button-group.js +5 -7
  112. package/lib/button/src/button-group.min.js +1 -1
  113. package/lib/button-group/index.js +2 -0
  114. package/lib/button-group/index.min.js +1 -1
  115. package/lib/checkbox/src/checkbox.js +8 -8
  116. package/lib/checkbox/src/checkbox.min.js +1 -1
  117. package/lib/checkbox/src/group.js +6 -6
  118. package/lib/checkbox/src/group.min.js +1 -1
  119. package/lib/checkbox-group/index.js +1 -1
  120. package/lib/checkbox-group/index.min.js +1 -1
  121. package/lib/col/index.js +2 -0
  122. package/lib/col/index.min.js +1 -1
  123. package/lib/components.js +13 -1
  124. package/lib/components.min.js +1 -1
  125. package/lib/form/index.js +2 -0
  126. package/lib/form/index.min.js +1 -1
  127. package/lib/form/src/form-config-item.js +3 -4
  128. package/lib/form/src/form-config-item.min.js +1 -1
  129. package/lib/form/src/form-item.js +3 -4
  130. package/lib/form/src/form-item.min.js +1 -1
  131. package/lib/form/src/form.js +7 -8
  132. package/lib/form/src/form.min.js +1 -1
  133. package/lib/form/src/render.js +4 -8
  134. package/lib/form/src/render.min.js +1 -1
  135. package/lib/form-design/index.js +2 -0
  136. package/lib/form-design/index.min.js +1 -1
  137. package/lib/form-gather/index.js +2 -0
  138. package/lib/form-gather/index.min.js +1 -1
  139. package/lib/form-item/index.js +2 -0
  140. package/lib/form-item/index.min.js +1 -1
  141. package/lib/icon/index.js +2 -0
  142. package/lib/icon/index.min.js +1 -1
  143. package/lib/index.umd.js +737 -167
  144. package/lib/index.umd.min.js +1 -1
  145. package/lib/input/index.js +1 -1
  146. package/lib/input/index.min.js +1 -1
  147. package/lib/input/style/style.css +5 -5
  148. package/lib/input/style/style.min.css +1 -1
  149. package/lib/layout-aside/index.js +2 -0
  150. package/lib/layout-aside/index.min.js +1 -1
  151. package/lib/layout-body/index.js +2 -0
  152. package/lib/layout-body/index.min.js +1 -1
  153. package/lib/layout-container/index.js +2 -0
  154. package/lib/layout-container/index.min.js +1 -1
  155. package/lib/layout-footer/index.js +2 -0
  156. package/lib/layout-footer/index.min.js +1 -1
  157. package/lib/layout-header/index.js +2 -0
  158. package/lib/layout-header/index.min.js +1 -1
  159. package/lib/list/index.js +17 -0
  160. package/lib/list/index.min.js +1 -0
  161. package/lib/list/src/list.js +397 -0
  162. package/lib/list/src/list.min.js +1 -0
  163. package/lib/list/style/index.js +1 -0
  164. package/lib/list/style/style.css +26 -0
  165. package/lib/list/style/style.min.css +1 -0
  166. package/lib/list-design/index.js +2 -0
  167. package/lib/list-design/index.min.js +1 -1
  168. package/lib/loading/index.js +2 -0
  169. package/lib/loading/index.min.js +1 -1
  170. package/lib/modal/index.js +1 -5
  171. package/lib/modal/index.min.js +1 -1
  172. package/lib/modal/src/modal.js +3 -4
  173. package/lib/modal/src/modal.min.js +1 -1
  174. package/lib/modal/style/style.css +1 -1
  175. package/lib/modal/style/style.min.css +1 -1
  176. package/lib/optgroup/index.js +1 -1
  177. package/lib/optgroup/index.min.js +1 -1
  178. package/lib/option/index.js +1 -1
  179. package/lib/option/index.min.js +1 -1
  180. package/lib/pager/index.js +1 -1
  181. package/lib/pager/index.min.js +1 -1
  182. package/lib/pager/src/pager.js +6 -7
  183. package/lib/pager/src/pager.min.js +1 -1
  184. package/lib/pager/style/style.css +2 -2
  185. package/lib/pager/style/style.min.css +1 -1
  186. package/lib/pulldown/index.js +1 -1
  187. package/lib/pulldown/index.min.js +1 -1
  188. package/lib/pulldown/style/style.css +2 -2
  189. package/lib/pulldown/style/style.min.css +1 -1
  190. package/lib/radio/index.js +1 -1
  191. package/lib/radio/index.min.js +1 -1
  192. package/lib/radio-button/index.js +1 -1
  193. package/lib/radio-button/index.min.js +1 -1
  194. package/lib/radio-group/index.js +1 -1
  195. package/lib/radio-group/index.min.js +1 -1
  196. package/lib/row/index.js +2 -0
  197. package/lib/row/index.min.js +1 -1
  198. package/lib/select/index.js +1 -1
  199. package/lib/select/index.min.js +1 -1
  200. package/lib/select/style/style.css +2 -2
  201. package/lib/select/style/style.min.css +1 -1
  202. package/lib/style.css +1 -1
  203. package/lib/style.min.css +1 -1
  204. package/lib/switch/index.js +1 -1
  205. package/lib/switch/index.min.js +1 -1
  206. package/lib/switch/style/style.css +1 -1
  207. package/lib/switch/style/style.min.css +1 -1
  208. package/lib/tab-pane/index.js +2 -0
  209. package/lib/tab-pane/index.min.js +1 -1
  210. package/lib/tabs/index.js +2 -0
  211. package/lib/tabs/index.min.js +1 -1
  212. package/lib/tabs/src/tabs.js +50 -12
  213. package/lib/tabs/src/tabs.min.js +1 -1
  214. package/lib/tabs/style/style.css +49 -34
  215. package/lib/tabs/style/style.min.css +1 -1
  216. package/lib/textarea/index.js +1 -1
  217. package/lib/textarea/index.min.js +1 -1
  218. package/lib/textarea/style/style.css +2 -2
  219. package/lib/textarea/style/style.min.css +1 -1
  220. package/lib/tooltip/index.js +2 -0
  221. package/lib/tooltip/index.min.js +1 -1
  222. package/lib/tooltip/src/tooltip.js +3 -4
  223. package/lib/tooltip/src/tooltip.min.js +1 -1
  224. package/lib/ui/src/core.js +1 -1
  225. package/lib/ui/src/core.min.js +1 -1
  226. package/lib/ui/src/globalStore.js +63 -65
  227. package/lib/ui/src/globalStore.min.js +1 -1
  228. package/lib/ui/src/log.js +1 -1
  229. package/lib/ui/src/log.min.js +1 -1
  230. package/lib/ui/src/resize.js +96 -0
  231. package/lib/ui/src/resize.min.js +1 -0
  232. package/lib/ui/src/store.js +8 -1
  233. package/lib/ui/src/store.min.js +1 -1
  234. package/lib/vxe-input/style/style.css +5 -5
  235. package/lib/vxe-input/style/style.min.css +1 -1
  236. package/lib/vxe-list/index.js +22 -0
  237. package/lib/vxe-list/index.min.js +1 -0
  238. package/lib/vxe-list/style/index.js +1 -0
  239. package/lib/vxe-list/style/style.css +26 -0
  240. package/lib/vxe-list/style/style.min.css +1 -0
  241. package/lib/vxe-modal/style/style.css +1 -1
  242. package/lib/vxe-modal/style/style.min.css +1 -1
  243. package/lib/vxe-pager/style/style.css +2 -2
  244. package/lib/vxe-pager/style/style.min.css +1 -1
  245. package/lib/vxe-pulldown/style/style.css +2 -2
  246. package/lib/vxe-pulldown/style/style.min.css +1 -1
  247. package/lib/vxe-select/style/style.css +2 -2
  248. package/lib/vxe-select/style/style.min.css +1 -1
  249. package/lib/vxe-switch/style/style.css +1 -1
  250. package/lib/vxe-switch/style/style.min.css +1 -1
  251. package/lib/vxe-tabs/style/style.css +49 -34
  252. package/lib/vxe-tabs/style/style.min.css +1 -1
  253. package/lib/vxe-textarea/style/style.css +2 -2
  254. package/lib/vxe-textarea/style/style.min.css +1 -1
  255. package/package.json +1 -1
  256. package/packages/anchor/index.ts +3 -0
  257. package/packages/anchor/src/anchor.ts +23 -23
  258. package/packages/anchor-link/index.ts +3 -0
  259. package/packages/breadcrumb/index.ts +3 -0
  260. package/packages/breadcrumb/src/breadcrumb.ts +2 -2
  261. package/packages/breadcrumb-item/index.ts +3 -0
  262. package/packages/button/index.ts +3 -0
  263. package/packages/button-group/index.ts +3 -0
  264. package/packages/checkbox/index.ts +2 -2
  265. package/packages/checkbox/src/checkbox.ts +8 -8
  266. package/packages/checkbox/src/group.ts +6 -6
  267. package/packages/checkbox-group/index.ts +3 -4
  268. package/packages/col/index.ts +3 -0
  269. package/packages/components.ts +3 -0
  270. package/packages/form/index.ts +3 -0
  271. package/packages/form/src/form.ts +4 -4
  272. package/packages/form-design/index.ts +3 -0
  273. package/packages/form-gather/index.ts +3 -0
  274. package/packages/form-item/index.ts +3 -0
  275. package/packages/icon/index.ts +3 -0
  276. package/packages/input/index.ts +3 -4
  277. package/packages/layout-aside/index.ts +3 -0
  278. package/packages/layout-body/index.ts +3 -0
  279. package/packages/layout-container/index.ts +3 -0
  280. package/packages/layout-footer/index.ts +3 -0
  281. package/packages/layout-header/index.ts +3 -0
  282. package/packages/list/index.ts +14 -0
  283. package/packages/list/src/list.ts +372 -0
  284. package/packages/list-design/index.ts +3 -0
  285. package/packages/loading/index.ts +3 -0
  286. package/packages/optgroup/index.ts +3 -4
  287. package/packages/option/index.ts +3 -4
  288. package/packages/pager/index.ts +3 -4
  289. package/packages/pager/src/pager.ts +3 -3
  290. package/packages/pulldown/index.ts +3 -4
  291. package/packages/radio/index.ts +3 -4
  292. package/packages/radio-button/index.ts +3 -4
  293. package/packages/radio-group/index.ts +2 -3
  294. package/packages/row/index.ts +3 -0
  295. package/packages/select/index.ts +3 -4
  296. package/packages/switch/index.ts +1 -2
  297. package/packages/tab-pane/index.ts +3 -0
  298. package/packages/tabs/index.ts +3 -0
  299. package/packages/tabs/src/tabs.ts +49 -19
  300. package/packages/textarea/index.ts +3 -4
  301. package/packages/tooltip/index.ts +3 -0
  302. package/packages/ui/src/globalStore.ts +63 -65
  303. package/packages/ui/src/resize.ts +85 -0
  304. package/styles/all.scss +1 -0
  305. package/styles/components/input.scss +5 -5
  306. package/styles/components/list.scss +1 -1
  307. package/styles/components/modal.scss +1 -1
  308. package/styles/components/pager.scss +2 -2
  309. package/styles/components/pulldown.scss +2 -2
  310. package/styles/components/select.scss +2 -2
  311. package/styles/components/switch.scss +1 -1
  312. package/styles/components/tabs.scss +44 -34
  313. package/styles/components/textarea.scss +2 -2
  314. package/types/all.d.ts +1 -0
  315. package/types/components/list.d.ts +166 -0
  316. package/types/components/tab-pane.d.ts +1 -1
  317. package/types/components/tabs.d.ts +2 -2
  318. package/types/ui/global-config.d.ts +67 -25
@@ -4,12 +4,11 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const VxePager = Object.assign(VxePagerComponent, {
6
6
  install: function (app: App) {
7
- app.component(VxePagerComponent.name, VxePagerComponent)
7
+ app.component(VxePagerComponent.name as string, VxePagerComponent)
8
8
  }
9
9
  })
10
10
 
11
- export const Pager = VxePager
12
-
13
- dynamicApp.component(VxePagerComponent.name, VxePagerComponent)
11
+ dynamicApp.component(VxePagerComponent.name as string, VxePagerComponent)
14
12
 
13
+ export const Pager = VxePager
15
14
  export default VxePager
@@ -61,7 +61,7 @@ export default defineComponent({
61
61
 
62
62
  const computeSize = useSize(props)
63
63
 
64
- const $xegrid = inject('$xegrid', null as any)
64
+ const $xeGrid = inject('$xeGrid', null as any)
65
65
 
66
66
  const reactData = reactive<PagerReactData>({
67
67
  inpCurrPage: props.currentPage
@@ -506,7 +506,7 @@ export default defineComponent({
506
506
  childNodes.push(
507
507
  h('span', {
508
508
  class: 'vxe-pager--left-wrapper'
509
- }, slots.left({ $grid: $xegrid }))
509
+ }, slots.left({ $grid: $xeGrid }))
510
510
  )
511
511
  }
512
512
  layouts.forEach((name) => {
@@ -564,7 +564,7 @@ export default defineComponent({
564
564
  childNodes.push(
565
565
  h('span', {
566
566
  class: 'vxe-pager--right-wrapper'
567
- }, slots.right({ $grid: $xegrid }))
567
+ }, slots.right({ $grid: $xeGrid }))
568
568
  )
569
569
  }
570
570
  return h('div', {
@@ -4,12 +4,11 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const VxePulldown = Object.assign(VxePulldownComponent, {
6
6
  install: function (app: App) {
7
- app.component(VxePulldownComponent.name, VxePulldownComponent)
7
+ app.component(VxePulldownComponent.name as string, VxePulldownComponent)
8
8
  }
9
9
  })
10
10
 
11
- export const Pulldown = VxePulldown
12
-
13
- dynamicApp.component(VxePulldownComponent.name, VxePulldownComponent)
11
+ dynamicApp.component(VxePulldownComponent.name as string, VxePulldownComponent)
14
12
 
13
+ export const Pulldown = VxePulldown
15
14
  export default VxePulldown
@@ -4,12 +4,11 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const VxeRadio = Object.assign(VxeRadioComponent, {
6
6
  install: function (app: App) {
7
- app.component(VxeRadioComponent.name, VxeRadioComponent)
7
+ app.component(VxeRadioComponent.name as string, VxeRadioComponent)
8
8
  }
9
9
  })
10
10
 
11
- export const Radio = VxeRadio
12
-
13
- dynamicApp.component(VxeRadioComponent.name, VxeRadioComponent)
11
+ dynamicApp.component(VxeRadioComponent.name as string, VxeRadioComponent)
14
12
 
13
+ export const Radio = VxeRadio
15
14
  export default VxeRadio
@@ -4,12 +4,11 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const VxeRadioButton = Object.assign(VxeRadioButtonComponent, {
6
6
  install: function (app: App) {
7
- app.component(VxeRadioButtonComponent.name, VxeRadioButtonComponent)
7
+ app.component(VxeRadioButtonComponent.name as string, VxeRadioButtonComponent)
8
8
  }
9
9
  })
10
10
 
11
- export const RadioButton = VxeRadioButton
12
-
13
- dynamicApp.component(VxeRadioButtonComponent.name, VxeRadioButtonComponent)
11
+ dynamicApp.component(VxeRadioButtonComponent.name as string, VxeRadioButtonComponent)
14
12
 
13
+ export const RadioButton = VxeRadioButton
15
14
  export default VxeRadioButton
@@ -8,8 +8,7 @@ export const VxeRadioGroup = Object.assign(VxeRadioGroupComponent, {
8
8
  }
9
9
  })
10
10
 
11
- export const RadioGroup = VxeRadioGroup
12
-
13
- dynamicApp.component(VxeRadioGroupComponent.name, VxeRadioGroupComponent)
11
+ dynamicApp.component(VxeRadioGroupComponent.name as string, VxeRadioGroupComponent)
14
12
 
13
+ export const RadioGroup = VxeRadioGroup
15
14
  export default VxeRadioGroup
@@ -1,5 +1,6 @@
1
1
  import { App } from 'vue'
2
2
  import VxeRowComponent from './src/row'
3
+ import { dynamicApp } from '../dynamics'
3
4
 
4
5
  const VxeRow = Object.assign({}, VxeRowComponent, {
5
6
  install (app: App) {
@@ -7,5 +8,7 @@ const VxeRow = Object.assign({}, VxeRowComponent, {
7
8
  }
8
9
  })
9
10
 
11
+ dynamicApp.component(VxeRowComponent.name as string, VxeRowComponent)
12
+
10
13
  export const Row = VxeRow
11
14
  export default VxeRow
@@ -4,12 +4,11 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const VxeSelect = Object.assign(VxeSelectComponent, {
6
6
  install: function (app: App) {
7
- app.component(VxeSelectComponent.name, VxeSelectComponent)
7
+ app.component(VxeSelectComponent.name as string, VxeSelectComponent)
8
8
  }
9
9
  })
10
10
 
11
- export const Select = VxeSelect
12
-
13
- dynamicApp.component(VxeSelectComponent.name, VxeSelectComponent)
11
+ dynamicApp.component(VxeSelectComponent.name as string, VxeSelectComponent)
14
12
 
13
+ export const Select = VxeSelect
15
14
  export default VxeSelect
@@ -8,8 +8,7 @@ export const VxeSwitch = Object.assign(VxeSwitchComponent, {
8
8
  }
9
9
  })
10
10
 
11
- export const Switch = VxeSwitch
12
-
13
11
  dynamicApp.component(VxeSwitchComponent.name as string, VxeSwitchComponent)
14
12
 
13
+ export const Switch = VxeSwitch
15
14
  export default VxeSwitch
@@ -1,5 +1,6 @@
1
1
  import { App } from 'vue'
2
2
  import VxeTabPaneComponent from '../tabs/src/tab-pane'
3
+ import { dynamicApp } from '../dynamics'
3
4
 
4
5
  const VxeTabPane = Object.assign({}, VxeTabPaneComponent, {
5
6
  install (app: App) {
@@ -7,5 +8,7 @@ const VxeTabPane = Object.assign({}, VxeTabPaneComponent, {
7
8
  }
8
9
  })
9
10
 
11
+ dynamicApp.component(VxeTabPaneComponent.name as string, VxeTabPaneComponent)
12
+
10
13
  export const TabPane = VxeTabPane
11
14
  export default VxeTabPane
@@ -1,5 +1,6 @@
1
1
  import { App } from 'vue'
2
2
  import VxeTabsComponent from './src/tabs'
3
+ import { dynamicApp } from '../dynamics'
3
4
 
4
5
  const VxeTabs = Object.assign({}, VxeTabsComponent, {
5
6
  install (app: App) {
@@ -7,5 +8,7 @@ const VxeTabs = Object.assign({}, VxeTabsComponent, {
7
8
  }
8
9
  })
9
10
 
11
+ dynamicApp.component(VxeTabsComponent.name as string, VxeTabsComponent)
12
+
10
13
  export const Tabs = VxeTabs
11
14
  export default VxeTabs
@@ -13,9 +13,14 @@ export default defineComponent({
13
13
  destroyOnClose: Boolean as PropType<VxeTabsPropTypes.DestroyOnClose>,
14
14
  type: String as PropType<VxeTabsPropTypes.Type>
15
15
  },
16
- emits: [],
16
+ emits: [
17
+ 'update:modelValue',
18
+ 'click',
19
+ 'change',
20
+ 'load'
21
+ ],
17
22
  setup (props, context) {
18
- const { slots } = context
23
+ const { slots, emit } = context
19
24
 
20
25
  const xID = XEUtils.uniqueId()
21
26
 
@@ -75,27 +80,48 @@ export default defineComponent({
75
80
  const { type, options } = props
76
81
  const { staticTabs, activeName } = reactData
77
82
  const headerWrapperEl = refHeaderElem.value
78
- if (headerWrapperEl && !type) {
83
+ let lintWidth = 0
84
+ let lintLeft = 0
85
+ if (headerWrapperEl) {
79
86
  const index = XEUtils.findIndexOf(staticTabs.length ? staticTabs : options, item => item.name === activeName)
80
87
  if (index > -1) {
81
88
  const tabEl = headerWrapperEl.children[index] as HTMLDivElement
82
89
  const tabWidth = tabEl.clientWidth
83
- const lintWidth = Math.max(4, Math.floor(tabWidth * 0.6))
84
- reactData.lintLeft = tabEl.offsetLeft + Math.floor((tabWidth - lintWidth) / 2)
85
- reactData.lintWidth = lintWidth
90
+ if (type === 'card') {
91
+ lintWidth = tabWidth + 1
92
+ lintLeft = tabEl.offsetLeft
93
+ } else if (type === 'border-card') {
94
+ lintWidth = tabWidth + 1
95
+ lintLeft = tabEl.offsetLeft - 1
96
+ } else if (!type) {
97
+ lintWidth = Math.max(4, Math.floor(tabWidth * 0.6))
98
+ lintLeft = tabEl.offsetLeft + Math.floor((tabWidth - lintWidth) / 2)
99
+ }
86
100
  }
87
101
  }
102
+ reactData.lintLeft = lintLeft
103
+ reactData.lintWidth = lintWidth
88
104
  })
89
105
  }
90
106
 
91
107
  const clickEvent = (evnt: KeyboardEvent, item: VxeTabPaneProps | VxeTabPaneDefines.TabConfig) => {
92
- const { initNames } = reactData
108
+ const { initNames, activeName } = reactData
93
109
  const { name } = item
110
+ let isInit = false
111
+ const value = name
94
112
  if (!initNames.includes(name)) {
113
+ isInit = true
95
114
  initNames.push(name)
96
115
  }
97
116
  reactData.activeName = name
98
- updateLineStyle()
117
+ emit('update:modelValue', value)
118
+ if (name !== activeName) {
119
+ emit('change', { value, name, $event: evnt })
120
+ }
121
+ emit('click', { name, $event: evnt })
122
+ if (isInit) {
123
+ emit('load', { name, $event: evnt })
124
+ }
99
125
  }
100
126
 
101
127
  const renderTabHeader = (list: VxeTabsPropTypes.Options | VxeTabPaneDefines.TabConfig[]) => {
@@ -111,6 +137,7 @@ export default defineComponent({
111
137
  const { title, name, slots } = item
112
138
  const tabSlot = slots ? slots.tab : null
113
139
  return h('div', {
140
+ key: name,
114
141
  class: ['vxe-tab-header--item', {
115
142
  'is--active': activeName === name
116
143
  }],
@@ -123,15 +150,13 @@ export default defineComponent({
123
150
  }, tabSlot ? callSlot(tabSlot, { name, title }) : `${title}`)
124
151
  ])
125
152
  })),
126
- type
127
- ? null
128
- : h('span', {
129
- class: 'vxe-tabs-header--active-line',
130
- style: {
131
- left: `${lintLeft}px`,
132
- width: `${lintWidth}px`
133
- }
134
- })
153
+ h('span', {
154
+ class: `vxe-tabs-header--active-line-${type || 'default'}`,
155
+ style: {
156
+ left: `${lintLeft}px`,
157
+ width: `${lintWidth}px`
158
+ }
159
+ })
135
160
  ])
136
161
  }
137
162
 
@@ -143,6 +168,7 @@ export default defineComponent({
143
168
  default () {
144
169
  return name && initNames.includes(name)
145
170
  ? h('div', {
171
+ key: name,
146
172
  class: ['vxe-tab-pane--item', {
147
173
  'is--visible': activeName === name
148
174
  }]
@@ -156,7 +182,7 @@ export default defineComponent({
156
182
  const { destroyOnClose } = props
157
183
  const activeOptionTab = computeActiveOptionTab.value
158
184
  if (destroyOnClose) {
159
- return activeOptionTab ? renderOptionPane(activeOptionTab) : createCommentVNode()
185
+ return activeOptionTab ? [renderOptionPane(activeOptionTab)] : createCommentVNode()
160
186
  }
161
187
  return options.map(renderOptionPane)
162
188
  }
@@ -167,6 +193,7 @@ export default defineComponent({
167
193
  const defaultSlot = slots ? slots.default : null
168
194
  return name && initNames.includes(name)
169
195
  ? h('div', {
196
+ key: name,
170
197
  class: ['vxe-tab-pane--item', {
171
198
  'is--visible': activeName === name
172
199
  }]
@@ -178,7 +205,7 @@ export default defineComponent({
178
205
  const { destroyOnClose } = props
179
206
  const activeDefaultTab = computeActiveDefaultTab.value
180
207
  if (destroyOnClose) {
181
- return activeDefaultTab ? renderDefaultPane(activeDefaultTab) : createCommentVNode()
208
+ return activeDefaultTab ? [renderDefaultPane(activeDefaultTab)] : createCommentVNode()
182
209
  }
183
210
  return staticTabs.map(renderDefaultPane)
184
211
  }
@@ -204,6 +231,9 @@ export default defineComponent({
204
231
 
205
232
  watch(() => props.modelValue, (val) => {
206
233
  reactData.activeName = val
234
+ })
235
+
236
+ watch(() => reactData.activeName, () => {
207
237
  updateLineStyle()
208
238
  })
209
239
 
@@ -4,12 +4,11 @@ import { dynamicApp } from '../dynamics'
4
4
 
5
5
  export const VxeTextarea = Object.assign(VxeTextareaComponent, {
6
6
  install: function (app: App) {
7
- app.component(VxeTextareaComponent.name, VxeTextareaComponent)
7
+ app.component(VxeTextareaComponent.name as string, VxeTextareaComponent)
8
8
  }
9
9
  })
10
10
 
11
- export const Textarea = VxeTextarea
12
-
13
- dynamicApp.component(VxeTextareaComponent.name, VxeTextareaComponent)
11
+ dynamicApp.component(VxeTextareaComponent.name as string, VxeTextareaComponent)
14
12
 
13
+ export const Textarea = VxeTextarea
15
14
  export default VxeTextarea
@@ -1,5 +1,6 @@
1
1
  import { App } from 'vue'
2
2
  import VxeTooltipComponent from './src/tooltip'
3
+ import { dynamicApp } from '../dynamics'
3
4
 
4
5
  const VxeTooltip = Object.assign({}, VxeTooltipComponent, {
5
6
  install (app: App) {
@@ -7,5 +8,7 @@ const VxeTooltip = Object.assign({}, VxeTooltipComponent, {
7
8
  }
8
9
  })
9
10
 
11
+ dynamicApp.component(VxeTooltipComponent.name as string, VxeTooltipComponent)
12
+
10
13
  export const Tooltip = VxeTooltip
11
14
  export default VxeTooltip
@@ -7,25 +7,21 @@ const globalConfigStore: Required<VxeGlobalConfig> = {
7
7
  zIndex: 999,
8
8
  emptyCell: ' ',
9
9
  loadingText: '',
10
+ resizeInterval: 500,
10
11
 
11
12
  i18n: (key: string) => key,
12
13
 
13
- tooltip: {
14
- // size: null,
15
- trigger: 'hover',
16
- theme: 'dark',
17
- enterDelay: 500,
18
- leaveDelay: 300
19
- },
20
- pager: {
21
- // size: null,
22
- // autoHidden: false,
23
- // perfect: true,
24
- // pageSize: 10,
25
- // pagerCount: 7,
26
- // pageSizes: [10, 15, 20, 50, 100],
27
- // layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
28
- },
14
+ anchor: {},
15
+ anchorLink: {},
16
+ breadcrumb: {
17
+ separator: '/'
18
+ },
19
+ breadcrumbItem: {},
20
+ button: {},
21
+ buttonGroup: {},
22
+ checkbox: {},
23
+ checkboxGroup: {},
24
+ col: {},
29
25
  form: {
30
26
  // preventSubmit: false,
31
27
  // size: null,
@@ -39,6 +35,10 @@ const globalConfigStore: Required<VxeGlobalConfig> = {
39
35
  },
40
36
  titleAsterisk: true
41
37
  },
38
+ formDesign: {},
39
+ formGather: {},
40
+ formItem: {},
41
+ icon: {},
42
42
  input: {
43
43
  // size: null,
44
44
  // transfer: false
@@ -52,49 +52,21 @@ const globalConfigStore: Required<VxeGlobalConfig> = {
52
52
  digits: 2,
53
53
  controls: true
54
54
  },
55
- textarea: {
56
- // size: null,
57
- // autosize: {
58
- // minRows: 1,
59
- // maxRows: 10
60
- // }
61
- },
62
- select: {
63
- // size: null,
64
- // transfer: false,
65
- // optionConfig: {
66
- // keyField: '_X_OPTION_KEY'
67
- // },
68
- multiCharOverflow: 8
69
- },
70
- button: {
71
- // size: null,
72
- // transfer: false
73
- },
74
- buttonGroup: {
75
- // size: null
76
- },
77
- radio: {
78
- // size: null,
79
- strict: true
80
- },
81
- radioButton: {
82
- // size: null,
83
- strict: true
84
- },
85
- radioGroup: {
55
+ layoutAside: {},
56
+ layoutBody: {},
57
+ layoutContainer: {},
58
+ layoutFooter: {},
59
+ layoutHeader: {},
60
+ listDesign: {},
61
+ list: {
86
62
  // size: null,
87
- strict: true
88
- },
89
- checkbox: {
90
- // size: null
91
- },
92
- checkboxGroup: {
93
- // size: null
94
- },
95
- switch: {
96
- // size: null
63
+ scrollY: {
64
+ enabled: true,
65
+ gt: 100
66
+ // oSize: 0
67
+ }
97
68
  },
69
+ loading: {},
98
70
  modal: {
99
71
  // size: null,
100
72
  top: 15,
@@ -113,16 +85,42 @@ const globalConfigStore: Required<VxeGlobalConfig> = {
113
85
  // storage: false,
114
86
  storageKey: 'VXE_MODAL_POSITION'
115
87
  },
116
- list: {
88
+ optgroup: {},
89
+ option: {},
90
+ pager: {
117
91
  // size: null,
118
- scrollY: {
119
- enabled: true,
120
- gt: 100
121
- // oSize: 0
122
- }
92
+ // autoHidden: false,
93
+ // perfect: true,
94
+ // pageSize: 10,
95
+ // pagerCount: 7,
96
+ // pageSizes: [10, 15, 20, 50, 100],
97
+ // layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
98
+ },
99
+ pulldown: {},
100
+ radio: {
101
+ strict: true
102
+ },
103
+ radioButton: {
104
+ strict: true
105
+ },
106
+ radioGroup: {
107
+ strict: true
123
108
  },
124
- breadcrumb: {},
125
- formDesign: {}
109
+ row: {},
110
+ select: {
111
+ multiCharOverflow: 8
112
+ },
113
+ switch: {},
114
+ tabPane: {},
115
+ tabs: {},
116
+ textarea: {},
117
+ tooltip: {
118
+ // size: null,
119
+ trigger: 'hover',
120
+ theme: 'dark',
121
+ enterDelay: 500,
122
+ leaveDelay: 300
123
+ }
126
124
  }
127
125
 
128
126
  export default globalConfigStore
@@ -0,0 +1,85 @@
1
+ import XEUtils from 'xe-utils'
2
+ import globalConfigStore from './globalStore'
3
+
4
+ /**
5
+ * 监听 resize 事件
6
+ * 如果项目中已使用了 resize-observer-polyfill,那么只需要将方法定义全局,该组件就会自动使用
7
+ */
8
+ let resizeTimeout: any
9
+ /* eslint-disable no-use-before-define */
10
+ const eventStore: XEResizeObserver[] = []
11
+ const defaultInterval = 500
12
+
13
+ function eventHandle () {
14
+ if (eventStore.length) {
15
+ eventStore.forEach((item) => {
16
+ item.tarList.forEach((observer) => {
17
+ const { target, width, heighe } = observer
18
+ const clientWidth = target.clientWidth
19
+ const clientHeight = target.clientHeight
20
+ const rWidth = clientWidth && width !== clientWidth
21
+ const rHeight = clientHeight && heighe !== clientHeight
22
+ if (rWidth || rHeight) {
23
+ observer.width = clientWidth
24
+ observer.heighe = clientHeight
25
+ setTimeout(item.callback)
26
+ }
27
+ })
28
+ })
29
+ /* eslint-disable @typescript-eslint/no-use-before-define */
30
+ eventListener()
31
+ }
32
+ }
33
+
34
+ function eventListener () {
35
+ clearTimeout(resizeTimeout)
36
+ resizeTimeout = setTimeout(eventHandle, globalConfigStore.resizeInterval || defaultInterval)
37
+ }
38
+
39
+ export class XEResizeObserver {
40
+ tarList: {
41
+ target: Element;
42
+ width: number;
43
+ heighe: number;
44
+ }[] = []
45
+
46
+ callback: (...args: any[]) => void
47
+
48
+ constructor (callback: (...args: any[]) => void) {
49
+ this.callback = callback
50
+ }
51
+
52
+ observe (target: Element): void {
53
+ if (target) {
54
+ const { tarList } = this
55
+ if (!tarList.some(observer => observer.target === target)) {
56
+ tarList.push({
57
+ target,
58
+ width: target.clientWidth,
59
+ heighe: target.clientHeight
60
+ })
61
+ }
62
+ if (!eventStore.length) {
63
+ eventListener()
64
+ }
65
+ if (!eventStore.some((item) => item === this)) {
66
+ eventStore.push(this)
67
+ }
68
+ }
69
+ }
70
+
71
+ unobserve (target: Element): void {
72
+ XEUtils.remove(eventStore, item => item.tarList.some(observer => observer.target === target))
73
+ }
74
+
75
+ disconnect (): void {
76
+ XEUtils.remove(eventStore, item => item === this)
77
+ }
78
+ }
79
+
80
+ export function createResizeEvent (callback: (...args: any[]) => void): any {
81
+ if (window.ResizeObserver) {
82
+ return new window.ResizeObserver(callback)
83
+ }
84
+ return new XEResizeObserver(callback)
85
+ }
package/styles/all.scss CHANGED
@@ -21,6 +21,7 @@
21
21
  @import './components/layout-footer.scss';
22
22
  @import './components/layout-header.scss';
23
23
  @import './components/list-design.scss';
24
+ @import './components/list.scss';
24
25
  @import './components/loading.scss';
25
26
  @import './components/modal.scss';
26
27
  @import './components/optgroup.scss';
@@ -12,7 +12,7 @@ $iconWidth: 1.6em;
12
12
  font-family: inherit;
13
13
  line-height: inherit;
14
14
  padding: 0 0.6em;
15
- color: var(--vxe-font-color);
15
+ color: var(--vxe-ui-font-color);
16
16
  border: 1px solid var(--vxe-ui-input-border-color);
17
17
  background-color: var(--vxe-ui-input-background-color);
18
18
  box-shadow: none;
@@ -205,7 +205,7 @@ $iconWidth: 1.6em;
205
205
  .vxe-input--suffix {
206
206
  &:hover {
207
207
  .vxe-input--clear-icon {
208
- color: var(--vxe-font-color);
208
+ color: var(--vxe-ui-font-color);
209
209
  }
210
210
  }
211
211
  &:active {
@@ -218,7 +218,7 @@ $iconWidth: 1.6em;
218
218
  &:hover {
219
219
  .vxe-input--search-suffix,
220
220
  .vxe-input--password-suffix {
221
- color: var(--vxe-font-color);
221
+ color: var(--vxe-ui-font-color);
222
222
  }
223
223
  }
224
224
  &:active {
@@ -231,7 +231,7 @@ $iconWidth: 1.6em;
231
231
  .vxe-input--number-prev,
232
232
  .vxe-input--number-next {
233
233
  &:hover {
234
- color: var(--vxe-font-color);
234
+ color: var(--vxe-ui-font-color);
235
235
  }
236
236
  &:active {
237
237
  color: var(--vxe-primary-color);
@@ -303,7 +303,7 @@ $iconWidth: 1.6em;
303
303
  position: absolute;
304
304
  left: 0;
305
305
  padding: 4px 0;
306
- color: var(--vxe-font-color);
306
+ color: var(--vxe-ui-font-color);
307
307
  font-size: var(--vxe-font-size);
308
308
  text-align: left;
309
309
  &:not(.is--transfer) {
@@ -2,7 +2,7 @@
2
2
  position: relative;
3
3
  display: block;
4
4
  padding: 0;
5
- color: var(--vxe-font-color);
5
+ color: var(--vxe-ui-font-color);
6
6
  direction: ltr;
7
7
  .vxe-list--virtual-wrapper {
8
8
  position: relative;
@@ -8,7 +8,7 @@
8
8
  line-height: 1.5;
9
9
  width: calc(100% + 18px);
10
10
  height: calc(100% + 18px);
11
- color: var(--vxe-font-color);
11
+ color: var(--vxe-ui-font-color);
12
12
  font-family: var(--vxe-font-family);
13
13
  transition: top .4s ease-in-out;
14
14
  &.is--active {