vue-devui 1.0.0-beta.1 → 1.0.0-beta.10

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 (323) hide show
  1. package/accordion/index.d.ts +7 -0
  2. package/accordion/index.es.js +186 -139
  3. package/accordion/index.umd.js +1 -1
  4. package/accordion/style.css +1 -1
  5. package/alert/index.d.ts +7 -0
  6. package/alert/index.es.js +2 -3
  7. package/alert/index.umd.js +1 -1
  8. package/alert/style.css +1 -1
  9. package/anchor/index.d.ts +7 -0
  10. package/avatar/index.d.ts +7 -0
  11. package/avatar/index.es.js +1 -1
  12. package/avatar/index.umd.js +1 -1
  13. package/back-top/index.d.ts +7 -0
  14. package/back-top/index.es.js +128 -0
  15. package/back-top/index.umd.js +1 -0
  16. package/back-top/package.json +7 -0
  17. package/back-top/style.css +1 -0
  18. package/badge/index.d.ts +7 -0
  19. package/badge/index.es.js +1 -1
  20. package/badge/index.umd.js +1 -1
  21. package/breadcrumb/index.d.ts +7 -0
  22. package/button/index.d.ts +7 -0
  23. package/button/index.es.js +9 -8
  24. package/button/index.umd.js +1 -1
  25. package/card/index.d.ts +7 -0
  26. package/card/index.es.js +1 -1
  27. package/card/index.umd.js +1 -1
  28. package/carousel/index.d.ts +7 -0
  29. package/carousel/index.es.js +5 -4
  30. package/carousel/index.umd.js +1 -1
  31. package/cascader/index.d.ts +7 -0
  32. package/cascader/index.es.js +1239 -83
  33. package/cascader/index.umd.js +1 -1
  34. package/cascader/style.css +1 -1
  35. package/checkbox/index.d.ts +7 -0
  36. package/checkbox/index.es.js +43 -8
  37. package/checkbox/index.umd.js +1 -1
  38. package/comment/index.d.ts +7 -0
  39. package/comment/index.es.js +85 -0
  40. package/comment/index.umd.js +1 -0
  41. package/comment/package.json +7 -0
  42. package/comment/style.css +1 -0
  43. package/countdown/index.d.ts +7 -0
  44. package/countdown/index.es.js +176 -0
  45. package/countdown/index.umd.js +1 -0
  46. package/countdown/package.json +7 -0
  47. package/countdown/style.css +1 -0
  48. package/date-picker/index.d.ts +7 -0
  49. package/date-picker/index.es.js +32 -21
  50. package/date-picker/index.umd.js +1 -1
  51. package/date-picker/style.css +1 -1
  52. package/dragdrop/index.d.ts +7 -0
  53. package/dragdrop/index.es.js +32 -0
  54. package/dragdrop/index.umd.js +1 -0
  55. package/dragdrop/package.json +7 -0
  56. package/drawer/index.d.ts +7 -0
  57. package/drawer/index.es.js +161 -41
  58. package/drawer/index.umd.js +1 -1
  59. package/drawer/style.css +1 -1
  60. package/dropdown/index.d.ts +7 -0
  61. package/dropdown/index.es.js +527 -0
  62. package/dropdown/index.umd.js +1 -0
  63. package/dropdown/package.json +7 -0
  64. package/dropdown/style.css +1 -0
  65. package/editable-select/index.d.ts +7 -0
  66. package/editable-select/index.es.js +5718 -469
  67. package/editable-select/index.umd.js +27 -1
  68. package/editable-select/style.css +1 -1
  69. package/form/index.d.ts +7 -0
  70. package/form/index.es.js +2244 -0
  71. package/form/index.umd.js +1 -0
  72. package/form/package.json +7 -0
  73. package/form/style.css +1 -0
  74. package/fullscreen/index.d.ts +7 -0
  75. package/fullscreen/index.es.js +14 -4
  76. package/fullscreen/index.umd.js +1 -1
  77. package/gantt/index.d.ts +7 -0
  78. package/gantt/index.es.js +535 -0
  79. package/gantt/index.umd.js +1 -0
  80. package/gantt/package.json +7 -0
  81. package/gantt/style.css +1 -0
  82. package/grid/index.d.ts +7 -0
  83. package/grid/index.es.js +269 -0
  84. package/grid/index.umd.js +1 -0
  85. package/grid/package.json +7 -0
  86. package/grid/style.css +1 -0
  87. package/icon/index.d.ts +7 -0
  88. package/icon/index.es.js +6 -5
  89. package/icon/index.umd.js +1 -1
  90. package/image-preview/index.d.ts +7 -0
  91. package/image-preview/index.es.js +72 -11
  92. package/image-preview/index.umd.js +1 -1
  93. package/image-preview/style.css +1 -1
  94. package/index.d.ts +7 -0
  95. package/input/index.d.ts +7 -0
  96. package/input/index.es.js +24 -13
  97. package/input/index.umd.js +1 -1
  98. package/input-icon/index.d.ts +7 -0
  99. package/input-icon/index.es.js +332 -0
  100. package/input-icon/index.umd.js +1 -0
  101. package/input-icon/package.json +7 -0
  102. package/input-icon/style.css +1 -0
  103. package/input-number/index.d.ts +7 -0
  104. package/input-number/index.es.js +5 -4
  105. package/input-number/index.umd.js +1 -1
  106. package/layout/index.d.ts +7 -0
  107. package/layout/index.es.js +1 -1
  108. package/layout/index.umd.js +1 -1
  109. package/loading/index.d.ts +7 -0
  110. package/loading/index.es.js +1 -1
  111. package/loading/index.umd.js +1 -1
  112. package/modal/index.d.ts +7 -0
  113. package/modal/index.es.js +117 -99
  114. package/modal/index.umd.js +1 -1
  115. package/modal/style.css +1 -1
  116. package/nav-sprite/index.d.ts +7 -0
  117. package/nuxt/components/Accordion.js +3 -0
  118. package/nuxt/components/Alert.js +3 -0
  119. package/nuxt/components/Anchor.js +3 -0
  120. package/nuxt/components/Aside.js +3 -0
  121. package/nuxt/components/Avatar.js +3 -0
  122. package/nuxt/components/BackTop.js +3 -0
  123. package/nuxt/components/Badge.js +3 -0
  124. package/nuxt/components/Breadcrumb.js +3 -0
  125. package/nuxt/components/Button.js +3 -0
  126. package/nuxt/components/Card.js +3 -0
  127. package/nuxt/components/Carousel.js +3 -0
  128. package/nuxt/components/Cascader.js +3 -0
  129. package/nuxt/components/Checkbox.js +3 -0
  130. package/nuxt/components/Col.js +3 -0
  131. package/nuxt/components/Column.js +3 -0
  132. package/nuxt/components/Comment.js +3 -0
  133. package/nuxt/components/Content.js +3 -0
  134. package/nuxt/components/Countdown.js +3 -0
  135. package/nuxt/components/DatePicker.js +3 -0
  136. package/nuxt/components/Drawer.js +3 -0
  137. package/nuxt/components/Dropdown.js +3 -0
  138. package/nuxt/components/EditableSelect.js +3 -0
  139. package/nuxt/components/FixedOverlay.js +3 -0
  140. package/nuxt/components/FlexibleOverlay.js +3 -0
  141. package/nuxt/components/Footer.js +3 -0
  142. package/nuxt/components/Form.js +3 -0
  143. package/nuxt/components/FormControl.js +3 -0
  144. package/nuxt/components/FormItem.js +3 -0
  145. package/nuxt/components/FormLabel.js +3 -0
  146. package/nuxt/components/FormOperation.js +3 -0
  147. package/nuxt/components/Fullscreen.js +3 -0
  148. package/nuxt/components/Gantt.js +3 -0
  149. package/nuxt/components/Header.js +3 -0
  150. package/nuxt/components/Icon.js +2 -0
  151. package/nuxt/components/ImagePreviewService.js +3 -0
  152. package/nuxt/components/Input.js +3 -0
  153. package/nuxt/components/InputIcon.js +3 -0
  154. package/nuxt/components/InputNumber.js +3 -0
  155. package/nuxt/components/Layout.js +3 -0
  156. package/nuxt/components/Loading.js +3 -0
  157. package/nuxt/components/LoadingService.js +3 -0
  158. package/nuxt/components/Modal.js +3 -0
  159. package/nuxt/components/MultiUpload.js +3 -0
  160. package/nuxt/components/NavSprite.js +2 -0
  161. package/nuxt/components/Pagination.js +3 -0
  162. package/nuxt/components/Panel.js +3 -0
  163. package/nuxt/components/Popover.js +3 -0
  164. package/nuxt/components/Progress.js +3 -0
  165. package/nuxt/components/QuadrantDiagram.js +3 -0
  166. package/nuxt/components/Radio.js +3 -0
  167. package/nuxt/components/RadioGroup.js +3 -0
  168. package/nuxt/components/Rate.js +3 -0
  169. package/nuxt/components/ReadTip.js +3 -0
  170. package/nuxt/components/Result.js +3 -0
  171. package/nuxt/components/Row.js +3 -0
  172. package/nuxt/components/Search.js +3 -0
  173. package/nuxt/components/Select.js +3 -0
  174. package/nuxt/components/Skeleton.js +3 -0
  175. package/nuxt/components/SkeletonItem.js +3 -0
  176. package/nuxt/components/Slider.js +3 -0
  177. package/nuxt/components/Splitter.js +3 -0
  178. package/nuxt/components/Statistic.js +3 -0
  179. package/nuxt/components/Status.js +3 -0
  180. package/nuxt/components/StepsGuide.js +3 -0
  181. package/nuxt/components/StickSlider.js +3 -0
  182. package/nuxt/components/Sticky.js +2 -0
  183. package/nuxt/components/Switch.js +3 -0
  184. package/nuxt/components/Table.js +3 -0
  185. package/nuxt/components/Tabs.js +3 -0
  186. package/nuxt/components/Tag.js +3 -0
  187. package/nuxt/components/TagInput.js +3 -0
  188. package/nuxt/components/Textarea.js +3 -0
  189. package/nuxt/components/TimeAxis.js +3 -0
  190. package/nuxt/components/TimeAxisItem.js +3 -0
  191. package/nuxt/components/TimePicker.js +3 -0
  192. package/nuxt/components/Toast.js +3 -0
  193. package/nuxt/components/ToastService.js +3 -0
  194. package/nuxt/components/Tooltip.js +3 -0
  195. package/nuxt/components/Transfer.js +3 -0
  196. package/nuxt/components/Tree.js +3 -0
  197. package/nuxt/components/TreeSelect.js +3 -0
  198. package/nuxt/components/Upload.js +3 -0
  199. package/nuxt/components/buttonProps.js +3 -0
  200. package/nuxt/index.js +13 -0
  201. package/overlay/index.d.ts +7 -0
  202. package/overlay/index.es.js +110 -93
  203. package/overlay/index.umd.js +1 -1
  204. package/overlay/style.css +1 -1
  205. package/package.json +6 -33
  206. package/pagination/index.d.ts +7 -0
  207. package/pagination/index.es.js +3 -3
  208. package/pagination/index.umd.js +1 -1
  209. package/panel/index.d.ts +7 -0
  210. package/panel/index.es.js +25 -22
  211. package/panel/index.umd.js +1 -1
  212. package/panel/style.css +1 -1
  213. package/popover/index.d.ts +7 -0
  214. package/popover/index.es.js +5 -2
  215. package/popover/index.umd.js +1 -1
  216. package/progress/index.d.ts +7 -0
  217. package/progress/index.es.js +1 -1
  218. package/progress/index.umd.js +2 -2
  219. package/quadrant-diagram/index.d.ts +7 -0
  220. package/radio/index.d.ts +7 -0
  221. package/radio/index.es.js +1 -1
  222. package/radio/index.umd.js +1 -1
  223. package/rate/index.d.ts +7 -0
  224. package/rate/index.es.js +1 -1
  225. package/rate/index.umd.js +1 -1
  226. package/read-tip/index.d.ts +7 -0
  227. package/read-tip/index.es.js +258 -0
  228. package/read-tip/index.umd.js +1 -0
  229. package/read-tip/package.json +7 -0
  230. package/read-tip/style.css +1 -0
  231. package/result/index.d.ts +7 -0
  232. package/result/index.es.js +119 -0
  233. package/result/index.umd.js +1 -0
  234. package/result/package.json +7 -0
  235. package/result/style.css +1 -0
  236. package/ripple/index.d.ts +7 -0
  237. package/ripple/index.es.js +5 -2
  238. package/ripple/index.umd.js +1 -1
  239. package/search/index.d.ts +7 -0
  240. package/search/index.es.js +35 -21
  241. package/search/index.umd.js +1 -1
  242. package/select/index.d.ts +7 -0
  243. package/select/index.es.js +47 -11
  244. package/select/index.umd.js +1 -1
  245. package/skeleton/index.d.ts +7 -0
  246. package/skeleton/index.es.js +148 -26
  247. package/skeleton/index.umd.js +1 -1
  248. package/skeleton/style.css +1 -1
  249. package/slider/index.d.ts +7 -0
  250. package/slider/index.es.js +30 -177
  251. package/slider/index.umd.js +1 -1
  252. package/slider/style.css +1 -1
  253. package/splitter/index.d.ts +7 -0
  254. package/splitter/index.es.js +107 -89
  255. package/splitter/index.umd.js +1 -1
  256. package/statistic/index.d.ts +7 -0
  257. package/statistic/index.es.js +280 -0
  258. package/statistic/index.umd.js +1 -0
  259. package/statistic/package.json +7 -0
  260. package/statistic/style.css +1 -0
  261. package/status/index.d.ts +7 -0
  262. package/status/index.es.js +2 -2
  263. package/status/index.umd.js +1 -1
  264. package/steps-guide/index.d.ts +7 -0
  265. package/steps-guide/index.es.js +101 -73
  266. package/steps-guide/index.umd.js +1 -1
  267. package/steps-guide/style.css +1 -1
  268. package/sticky/index.d.ts +7 -0
  269. package/style.css +1 -1
  270. package/switch/index.d.ts +7 -0
  271. package/switch/index.es.js +1 -1
  272. package/switch/index.umd.js +1 -1
  273. package/table/index.d.ts +7 -0
  274. package/table/index.es.js +1498 -156
  275. package/table/index.umd.js +1 -1
  276. package/table/style.css +1 -1
  277. package/tabs/index.d.ts +7 -0
  278. package/tabs/index.es.js +6 -3
  279. package/tabs/index.umd.js +1 -1
  280. package/tag/index.d.ts +7 -0
  281. package/tag/index.es.js +131 -0
  282. package/tag/index.umd.js +1 -0
  283. package/tag/package.json +7 -0
  284. package/tag/style.css +1 -0
  285. package/tag-input/index.d.ts +7 -0
  286. package/tag-input/index.es.js +1 -13
  287. package/tag-input/index.umd.js +1 -1
  288. package/textarea/index.d.ts +7 -0
  289. package/textarea/index.es.js +132 -0
  290. package/textarea/index.umd.js +1 -0
  291. package/textarea/package.json +7 -0
  292. package/textarea/style.css +1 -0
  293. package/time-axis/index.d.ts +7 -0
  294. package/time-axis/index.es.js +241 -21
  295. package/time-axis/index.umd.js +1 -1
  296. package/time-axis/style.css +1 -1
  297. package/time-picker/index.d.ts +7 -0
  298. package/time-picker/index.es.js +50 -26
  299. package/time-picker/index.umd.js +1 -1
  300. package/time-picker/style.css +1 -1
  301. package/toast/index.d.ts +7 -0
  302. package/toast/index.es.js +8 -7
  303. package/toast/index.umd.js +1 -1
  304. package/toast/style.css +1 -1
  305. package/tooltip/index.d.ts +7 -0
  306. package/transfer/index.d.ts +7 -0
  307. package/transfer/index.es.js +368 -79
  308. package/transfer/index.umd.js +1 -1
  309. package/transfer/style.css +1 -1
  310. package/tree/index.d.ts +7 -0
  311. package/tree/index.es.js +171 -35
  312. package/tree/index.umd.js +1 -1
  313. package/tree-select/index.d.ts +7 -0
  314. package/tree-select/index.es.js +528 -0
  315. package/tree-select/index.umd.js +1 -0
  316. package/tree-select/package.json +7 -0
  317. package/tree-select/style.css +1 -0
  318. package/upload/index.d.ts +7 -0
  319. package/upload/index.es.js +8 -7
  320. package/upload/index.umd.js +1 -1
  321. package/upload/style.css +1 -1
  322. package/vue-devui.es.js +19214 -7637
  323. package/vue-devui.umd.js +29 -3
@@ -0,0 +1,7 @@
1
+ import { App } from 'vue';
2
+ declare function install(app: App): void
3
+ declare const _default: {
4
+ install: typeof install;
5
+ version: string;
6
+ };
7
+ export default _default;
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { defineComponent, inject, reactive, ref, onMounted, watch, computed, withDirectives, createVNode, provide, nextTick, resolveComponent, onUpdated } from "vue";
7
+ import { defineComponent, inject, reactive, ref, watch, computed, onMounted, withDirectives, createVNode, provide, onUnmounted, resolveComponent, onUpdated } from "vue";
8
8
  const splitterProps = {
9
9
  orientation: {
10
10
  type: String,
@@ -141,28 +141,26 @@ var DSplitterBar = defineComponent({
141
141
  wrapperClass: `devui-splitter-bar devui-splitter-bar-${props.orientation}`
142
142
  });
143
143
  const domRef = ref();
144
- onMounted(() => {
145
- watch([() => props.splitBarSize, domRef], ([curSplitBarSize, ele]) => {
146
- if (!(ele instanceof HTMLElement)) {
147
- return;
148
- }
144
+ watch([() => props.splitBarSize, domRef], ([curSplitBarSize, ele]) => {
145
+ if (!(ele instanceof HTMLElement)) {
146
+ return;
147
+ }
148
+ setStyle(ele, {
149
+ flexBasis: curSplitBarSize
150
+ });
151
+ }, {
152
+ immediate: true
153
+ });
154
+ watch([() => store.state.panes, domRef], ([panes, ele]) => {
155
+ if (!store.isStaticBar(props.index)) {
156
+ state.wrapperClass += " resizable";
157
+ } else {
149
158
  setStyle(ele, {
150
- flexBasis: curSplitBarSize
159
+ flexBasis: props.disabledBarSize
151
160
  });
152
- }, {
153
- immediate: true
154
- });
155
- watch([() => store.state.panes, domRef], ([panes, ele]) => {
156
- if (!store.isStaticBar(props.index)) {
157
- state.wrapperClass += " resizable";
158
- } else {
159
- setStyle(ele, {
160
- flexBasis: props.disabledBarSize
161
- });
162
- }
163
- }, {
164
- deep: true
165
- });
161
+ }
162
+ }, {
163
+ deep: true
166
164
  });
167
165
  const coordinate = {
168
166
  pageX: 0,
@@ -427,21 +425,32 @@ var Splitter = defineComponent({
427
425
  store.setPanes({
428
426
  panes: state.panes
429
427
  });
430
- const domRef = ref();
431
428
  provide("orientation", props.orientation);
432
429
  provide("splitterStore", store);
433
- onMounted(() => {
434
- nextTick(() => {
435
- let containerSize = 0;
436
- if (props.orientation === "vertical") {
437
- containerSize = domRef.value.clientHeight;
438
- } else {
439
- containerSize = domRef.value.clientWidth;
440
- }
441
- store.setSplitter({
442
- containerSize
443
- });
430
+ const domRef = ref();
431
+ const refreshSplitterContainerSize = () => {
432
+ if (!domRef)
433
+ return;
434
+ let containerSize = 0;
435
+ if (props.orientation === "vertical") {
436
+ containerSize = domRef.value.clientHeight;
437
+ } else {
438
+ containerSize = domRef.value.clientWidth;
439
+ }
440
+ store.setSplitter({
441
+ containerSize
444
442
  });
443
+ };
444
+ const observer = new ResizeObserver(refreshSplitterContainerSize);
445
+ watch(domRef, (ele) => {
446
+ if (!ele) {
447
+ return;
448
+ }
449
+ refreshSplitterContainerSize();
450
+ observer.observe(domRef.value);
451
+ });
452
+ onUnmounted(() => {
453
+ observer.disconnect();
445
454
  });
446
455
  return () => {
447
456
  const {
@@ -512,7 +521,32 @@ var SplitterPane = defineComponent({
512
521
  }) {
513
522
  const store = inject("splitterStore");
514
523
  const domRef = ref();
515
- const order = ref();
524
+ const orderRef = ref();
525
+ watch([orderRef, domRef], ([order, ele]) => {
526
+ if (!ele) {
527
+ return;
528
+ }
529
+ setStyle(ele, {
530
+ order
531
+ });
532
+ });
533
+ const setSizeStyle = (curSize, ele) => {
534
+ if (!ele) {
535
+ return;
536
+ }
537
+ ele.style.flexBasis = curSize;
538
+ const paneFixedClass = "devui-splitter-pane-fixed";
539
+ if (curSize) {
540
+ addClass(ele, paneFixedClass);
541
+ } else {
542
+ removeClass(ele, paneFixedClass);
543
+ }
544
+ };
545
+ watch([() => props.size, domRef], ([size, ele]) => {
546
+ setSizeStyle(size, ele);
547
+ }, {
548
+ immediate: true
549
+ });
516
550
  const orientation = inject("orientation");
517
551
  let initialSize = "";
518
552
  onMounted(() => {
@@ -527,70 +561,54 @@ var SplitterPane = defineComponent({
527
561
  });
528
562
  });
529
563
  const getPaneSize = () => {
530
- const el = domRef == null ? void 0 : domRef.value;
564
+ const ele = domRef.value;
565
+ if (!ele) {
566
+ return;
567
+ }
531
568
  if (orientation === "vertical") {
532
- return el.offsetHeight;
569
+ return ele.offsetHeight;
533
570
  } else {
534
- return el.offsetWidth;
571
+ return ele.offsetWidth;
535
572
  }
536
573
  };
537
- onMounted(() => {
538
- watch([order, domRef], ([order2, dom]) => {
539
- if (!(dom instanceof HTMLElement)) {
540
- return;
541
- }
542
- setStyle(dom, {
543
- order: order2
574
+ watch(() => props.collapsed, (collapsed) => {
575
+ const ele = domRef.value;
576
+ if (!ele) {
577
+ return;
578
+ }
579
+ const paneHiddenClass = "devui-splitter-pane-hidden";
580
+ if (!collapsed) {
581
+ removeClass(ele, paneHiddenClass);
582
+ } else {
583
+ addClass(ele, paneHiddenClass);
584
+ }
585
+ if (collapsed && props.shrink) {
586
+ removeClass(ele, paneHiddenClass);
587
+ setStyle(ele, {
588
+ flexBasis: `${props.shrinkWidth}px`
544
589
  });
545
- });
546
- watch(() => props.size, (curSize) => {
547
- const ele = domRef.value;
548
- ele.style.flexBasis = curSize;
549
- const paneFixedClass = "devui-splitter-pane-fixed";
550
- if (curSize) {
551
- addClass(ele, paneFixedClass);
552
- } else {
553
- removeClass(ele, paneFixedClass);
554
- }
555
- }, {
556
- immediate: true
557
- });
558
- watch(() => props.collapsed, (collapsed) => {
559
- const paneHiddenClass = "devui-splitter-pane-hidden";
560
- nextTick(() => {
561
- const el = domRef.value;
562
- if (!collapsed) {
563
- removeClass(el, paneHiddenClass);
564
- } else {
565
- addClass(el, paneHiddenClass);
566
- }
567
- if (collapsed && props.shrink) {
568
- removeClass(el, paneHiddenClass);
569
- setStyle(el, {
570
- flexBasis: `${props.shrinkWidth}px`
571
- });
572
- } else {
573
- setStyle(el, {
574
- flexBasis: initialSize
575
- });
576
- }
590
+ } else {
591
+ setStyle(ele, {
592
+ flexBasis: initialSize
577
593
  });
578
- }, {
579
- immediate: true
580
- });
594
+ }
595
+ }, {
596
+ immediate: true
581
597
  });
582
598
  const toggleNearPaneFlexGrow = (collapsed) => {
583
- nextTick(() => {
584
- const flexGrowClass = "devui-splitter-pane-grow";
585
- if (hasClass(domRef.value, flexGrowClass)) {
586
- removeClass(domRef.value, flexGrowClass);
587
- } else if (collapsed) {
588
- addClass(domRef.value, flexGrowClass);
589
- }
590
- });
599
+ const ele = domRef.value;
600
+ if (!(ele instanceof HTMLElement)) {
601
+ return;
602
+ }
603
+ const flexGrowClass = "devui-splitter-pane-grow";
604
+ if (hasClass(ele, flexGrowClass)) {
605
+ removeClass(ele, flexGrowClass);
606
+ } else if (collapsed) {
607
+ addClass(ele, flexGrowClass);
608
+ }
591
609
  };
592
610
  expose({
593
- order,
611
+ order: orderRef,
594
612
  getPaneSize,
595
613
  toggleNearPaneFlexGrow
596
614
  });
@@ -610,7 +628,7 @@ Splitter.install = function(app) {
610
628
  var index = {
611
629
  title: "Splitter \u5206\u5272\u5668",
612
630
  category: "\u5E03\u5C40",
613
- status: "\u5DF2\u5B8C\u6210",
631
+ status: "100%",
614
632
  install(app) {
615
633
  app.use(Splitter);
616
634
  }
@@ -1 +1 @@
1
- var _=Object.defineProperty;var K=(m,s,P)=>s in m?_(m,s,{enumerable:!0,configurable:!0,writable:!0,value:P}):m[s]=P;var V=(m,s,P)=>(K(m,typeof s!="symbol"?s+"":s,P),P);(function(m,s){typeof exports=="object"&&typeof module!="undefined"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(m=typeof globalThis!="undefined"?globalThis:m||self,s(m.index={},m.Vue))})(this,function(m,s){"use strict";const P={orientation:{type:String,default:"horizontal"},splitBarSize:{type:String,default:"2px"},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean,default:!0}};function y(t,e){const i={},o=Object.keys(e);return o.forEach(n=>{i[n]=t.style[n]}),o.forEach(n=>{t.style[n]=e[n]}),i}function M(t,e){return t.classList?t.classList.contains(e):` ${t.className} `.indexOf(` ${e} `)>-1}function B(t,e){t.classList?t.classList.add(e):M(t,e)||(t.className=`${t.className} ${e}`)}function b(t,e){if(t.classList)t.classList.remove(e);else if(M(t,e)){const i=t.className;t.className=` ${i} `.replace(` ${e} `," ")}}const j={mounted(t,{value:e}){t.$value=e,e.enableResize&&F(t)},unmounted(t,{value:e}){e.enableResize&&$(t,"mousedown",D)}};function F(t){N(t,"mousedown",D)}function N(t,e,i){t.addEventListener&&t.addEventListener(e,i)}function $(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)}function D(t){var n;const e=(n=t==null?void 0:t.target)==null?void 0:n.$value;if(!e)return;N(document,"mousemove",i),N(document,"mouseup",o),e.onPressEvent(E(t));function i(l){e.onDragEvent(E(l))}function o(l){$(document,"mousemove",i),$(document,"mouseup",o),e.onReleaseEvent(E(l))}}function E(t){return{pageX:t.pageX,pageY:t.pageY,clientX:t.clientX,clientY:t.clientY,offsetX:t.offsetX,offsetY:t.offsetY,type:t.type,originalEvent:t}}var U="";const H={index:{type:Number},orientation:{type:String,required:!0},splitBarSize:{type:String,required:!0},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean}};var q=s.defineComponent({name:"DSplitterBar",props:H,setup(t){const e=s.inject("splitterStore"),i=s.reactive({wrapperClass:`devui-splitter-bar devui-splitter-bar-${t.orientation}`}),o=s.ref();s.onMounted(()=>{s.watch([()=>t.splitBarSize,o],([a,r])=>{r instanceof HTMLElement&&y(r,{flexBasis:a})},{immediate:!0}),s.watch([()=>e.state.panes,o],([a,r])=>{e.isStaticBar(t.index)?y(r,{flexBasis:t.disabledBarSize}):i.wrapperClass+=" resizable"},{deep:!0})});const n={pageX:0,pageY:0,originalX:0,originalY:0};let l;const f={enableResize:!0,onPressEvent:function({originalEvent:a}){a.stopPropagation(),!!e.isResizable(t.index)&&(l=e.dragState(t.index),n.originalX=a.pageX,n.originalY=a.pageY)},onDragEvent:function({originalEvent:a}){if(a.stopPropagation(),!e.isResizable(t.index))return;n.pageX=a.pageX,n.pageY=a.pageY;let r;t.orientation==="vertical"?r=n.pageY-n.originalY:r=n.pageX-n.originalX,e.setSize(l,r)},onReleaseEvent:function({originalEvent:a}){if(a.stopPropagation(),!e.isResizable(t.index))return;n.pageX=a.pageX,n.pageY=a.pageY;let r;t.orientation==="vertical"?r=n.pageY-n.originalY:r=n.pageX-n.originalX,e.setSize(l,r)}},u=(a,r)=>{const z=e.getPane(a),g=e.getPane(r);return{pane:z,nearPane:g}},h=(a,r,z)=>{var w,R,k,T;const g=((R=(w=a==null?void 0:a.component)==null?void 0:w.props)==null?void 0:R.collapsible)&&z,x=(T=(k=a==null?void 0:a.component)==null?void 0:k.props)==null?void 0:T.collapsed,Y=r.collapsed;return{"devui-collapse":g,collapsed:x,hidden:Y}},S=s.computed(()=>{var g,x;const{pane:a,nearPane:r}=u(t.index,t.index+1),z=((x=(g=a==null?void 0:a.component)==null?void 0:g.props)==null?void 0:x.collapseDirection)!=="after"||t.index===0;return h(a,r,z)}),c=s.computed(()=>{var g,x;const{pane:a,nearPane:r}=u(t.index+1,t.index),z=((x=(g=a==null?void 0:a.component)==null?void 0:g.props)==null?void 0:x.collapseDirection)!=="before"||t.index+1===e.state.paneCount-1;return h(a,r,z)}),p=()=>{var g,x,Y,w;const{pane:a,nearPane:r}=u(t.index,t.index+1);((x=(g=a==null?void 0:a.component)==null?void 0:g.props)==null?void 0:x.collapsed)||((w=(Y=r==null?void 0:r.component)==null?void 0:Y.props)==null?void 0:w.collapsed)?B(o.value,"none-resizable"):b(o.value,"none-resizable")},d=a=>{e.tooglePane(t.index,t.index+1,a),p()},C=a=>{e.tooglePane(t.index+1,t.index,a),p()},X=()=>{d(!0),C(!0)};return s.onMounted(()=>{X()}),()=>s.withDirectives(s.createVNode("div",{class:i.wrapperClass,ref:o},[t.showCollapseButton?s.createVNode("div",{class:["prev",S.value],onClick:()=>{d()}},null):null,s.createVNode("div",{class:"devui-resize-handle"},null),t.showCollapseButton?s.createVNode("div",{class:["next",c.value],onClick:()=>C()},null):null]),[[j,f]])}});class G{constructor(){V(this,"state");this.state=s.reactive({panes:[],splitterContainerSize:0,paneCount:0})}setPanes({panes:e}){this.state.panes=e.map((i,o)=>{var n;return i.component&&(i.component.exposed.order.value=o*2),i.getPaneSize=(n=i==null?void 0:i.component)==null?void 0:n.exposed.getPaneSize,i}),this.state.paneCount=e.length}setSplitter({containerSize:e}){this.state.splitterContainerSize=e}getPane(e){if(!this.state.panes||e<0||e>=this.state.panes.length)throw new Error("no pane can return.");return this.state.panes[e]}dragState(e){const i=this.getPane(e),o=this.getPane(e+1),n=i.getPaneSize()+o.getPaneSize();return{prev:{index:e,initialSize:i.getPaneSize(),minSize:this.toPixels(i.component.props.minSize)||n-this.toPixels(o.component.props.maxSize)||0,maxSize:this.toPixels(i.component.props.maxSize)||n-this.toPixels(o.component.props.minSize)||n},next:{index:e+1,initialSize:o.getPaneSize(),minSize:this.toPixels(o.component.props.minSize)||n-this.toPixels(i.component.props.maxSize)||0,maxSize:this.toPixels(o.component.props.maxSize)||n-this.toPixels(i.component.props.minSize)||n}}}clamp(e,i,o){return Math.min(i,Math.max(e,o))}resize(e,i){const o=this.getPane(e.index),n=this.state.splitterContainerSize,l=this.clamp(e.minSize,e.maxSize,e.initialSize+i);let f="";this.isPercent(o.component.props.size)?f=l/n*100+"%":f=l+"px",o.component.props.size=f,o.component.emit("sizeChange",f)}isResizable(e){var l,f,u,h,S,c,p,d;const i=this.getPane(e),o=this.getPane(e+1),n=((f=(l=i==null?void 0:i.component)==null?void 0:l.props)==null?void 0:f.collapsed)||((h=(u=o==null?void 0:o.component)==null?void 0:u.props)==null?void 0:h.collapsed);return((c=(S=i==null?void 0:i.component)==null?void 0:S.props)==null?void 0:c.resizable)&&((d=(p=o==null?void 0:o.component)==null?void 0:p.props)==null?void 0:d.resizable)&&!n}isStaticBar(e){var n,l,f,u;const i=this.getPane(e),o=this.getPane(e+1);return!(((l=(n=i==null?void 0:i.component)==null?void 0:n.props)==null?void 0:l.resizable)&&((u=(f=o==null?void 0:o.component)==null?void 0:f.props)==null?void 0:u.resizable))}isPercent(e){return/%$/.test(e)}toPixels(e){let i=parseFloat(e);return this.isPercent(e)&&(i=this.state.splitterContainerSize*i/100),i}tooglePane(e,i,o){var f,u,h,S,c,p,d,C,X,a,r,z,g;const n=this.getPane(e),l=this.getPane(i);((u=(f=n==null?void 0:n.component)==null?void 0:f.props)==null?void 0:u.collapsible)&&(n.component.props.collapsed=o?(S=(h=n==null?void 0:n.component)==null?void 0:h.props)==null?void 0:S.collapsed:!((p=(c=n==null?void 0:n.component)==null?void 0:c.props)==null?void 0:p.collapsed),(a=(d=l==null?void 0:l.component)==null?void 0:d.exposed)==null||a.toggleNearPaneFlexGrow((X=(C=n==null?void 0:n.component)==null?void 0:C.props)==null?void 0:X.collapsed),(g=n==null?void 0:n.component)==null||g.emit("collapsedChange",(z=(r=n==null?void 0:n.component)==null?void 0:r.props)==null?void 0:z.collapsed))}setSize(e,i){const o=this.getPane(e.prev.index),n=this.getPane(e.next.index);o.component.props.size&&n.component.props.size?(this.resize(e.prev,i),this.resize(e.next,-i)):n.component.props.size?this.resize(e.next,-i):this.resize(e.prev,i)}}var A="",v=s.defineComponent({name:"DSplitter",components:{DSplitterBar:q},props:P,emits:[],setup(t,e){var l,f;const i=new G,o=s.reactive({panes:[]});o.panes=((f=(l=e.slots).DSplitterPane)==null?void 0:f.call(l))||[],i.setPanes({panes:o.panes});const n=s.ref();return s.provide("orientation",t.orientation),s.provide("splitterStore",i),s.onMounted(()=>{s.nextTick(()=>{let u=0;t.orientation==="vertical"?u=n.value.clientHeight:u=n.value.clientWidth,i.setSplitter({containerSize:u})})}),()=>{const{splitBarSize:u,orientation:h,showCollapseButton:S}=t,c=["devui-splitter",`devui-splitter-${h}`];return s.createVNode("div",{class:c,ref:n},[o.panes,o.panes.filter((p,d,C)=>d!==C.length-1).map((p,d)=>s.createVNode(s.resolveComponent("d-splitter-bar"),{key:d,style:`order: ${d*2+1}`,splitBarSize:u,orientation:h,index:d,showCollapseButton:S},null))])}}});const W={size:{type:String},minSize:{type:String},maxSize:{type:String},resizable:{type:Boolean,default:!0},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},collapseDirection:{type:String,default:"both"},shrink:{type:Boolean,default:!1},shrinkWidth:{type:Number,default:36}};var J="",L=s.defineComponent({name:"DSplitterPane",props:W,emits:["sizeChange","collapsedChange"],setup(t,{slots:e,expose:i}){const o=s.inject("splitterStore"),n=s.ref(),l=s.ref(),f=s.inject("orientation");let u="";s.onMounted(()=>{u=t.size,o.setPanes({panes:o.state.panes})}),s.onUpdated(()=>{o.setPanes({panes:o.state.panes})});const h=()=>{const c=n==null?void 0:n.value;return f==="vertical"?c.offsetHeight:c.offsetWidth};return s.onMounted(()=>{s.watch([l,n],([c,p])=>{p instanceof HTMLElement&&y(p,{order:c})}),s.watch(()=>t.size,c=>{const p=n.value;p.style.flexBasis=c;const d="devui-splitter-pane-fixed";c?B(p,d):b(p,d)},{immediate:!0}),s.watch(()=>t.collapsed,c=>{const p="devui-splitter-pane-hidden";s.nextTick(()=>{const d=n.value;c?B(d,p):b(d,p),c&&t.shrink?(b(d,p),y(d,{flexBasis:`${t.shrinkWidth}px`})):y(d,{flexBasis:u})})},{immediate:!0})}),i({order:l,getPaneSize:h,toggleNearPaneFlexGrow:c=>{s.nextTick(()=>{const p="devui-splitter-pane-grow";M(n.value,p)?b(n.value,p):c&&B(n.value,p)})}}),()=>{var c;return s.createVNode("div",{class:"devui-splitter-pane",ref:n},[(c=e.default)==null?void 0:c.call(e)])}}});v.install=function(t){t.component(v.name,v),t.component(L.name,L)};var O={title:"Splitter \u5206\u5272\u5668",category:"\u5E03\u5C40",status:"\u5DF2\u5B8C\u6210",install(t){t.use(v)}};m.Splitter=v,m.default=O,Object.defineProperty(m,"__esModule",{value:!0}),m[Symbol.toStringTag]="Module"});
1
+ var U=Object.defineProperty;var _=(g,o,v)=>o in g?U(g,o,{enumerable:!0,configurable:!0,writable:!0,value:v}):g[o]=v;var k=(g,o,v)=>(_(g,typeof o!="symbol"?o+"":o,v),v);(function(g,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(g=typeof globalThis!="undefined"?globalThis:g||self,o(g.index={},g.Vue))})(this,function(g,o){"use strict";const v={orientation:{type:String,default:"horizontal"},splitBarSize:{type:String,default:"2px"},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean,default:!0}};function b(t,e){const i={},s=Object.keys(e);return s.forEach(n=>{i[n]=t.style[n]}),s.forEach(n=>{t.style[n]=e[n]}),i}function R(t,e){return t.classList?t.classList.contains(e):` ${t.className} `.indexOf(` ${e} `)>-1}function X(t,e){t.classList?t.classList.add(e):R(t,e)||(t.className=`${t.className} ${e}`)}function y(t,e){if(t.classList)t.classList.remove(e);else if(R(t,e)){const i=t.className;t.className=` ${i} `.replace(` ${e} `," ")}}const F={mounted(t,{value:e}){t.$value=e,e.enableResize&&H(t)},unmounted(t,{value:e}){e.enableResize&&$(t,"mousedown",L)}};function H(t){N(t,"mousedown",L)}function N(t,e,i){t.addEventListener&&t.addEventListener(e,i)}function $(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)}function L(t){var n;const e=(n=t==null?void 0:t.target)==null?void 0:n.$value;if(!e)return;N(document,"mousemove",i),N(document,"mouseup",s),e.onPressEvent(E(t));function i(p){e.onDragEvent(E(p))}function s(p){$(document,"mousemove",i),$(document,"mouseup",s),e.onReleaseEvent(E(p))}}function E(t){return{pageX:t.pageX,pageY:t.pageY,clientX:t.clientX,clientY:t.clientY,offsetX:t.offsetX,offsetY:t.offsetY,type:t.type,originalEvent:t}}var K="";const T={index:{type:Number},orientation:{type:String,required:!0},splitBarSize:{type:String,required:!0},disabledBarSize:{type:String,default:"1px"},showCollapseButton:{type:Boolean}};var q=o.defineComponent({name:"DSplitterBar",props:T,setup(t){const e=o.inject("splitterStore"),i=o.reactive({wrapperClass:`devui-splitter-bar devui-splitter-bar-${t.orientation}`}),s=o.ref();o.watch([()=>t.splitBarSize,s],([a,c])=>{c instanceof HTMLElement&&b(c,{flexBasis:a})},{immediate:!0}),o.watch([()=>e.state.panes,s],([a,c])=>{e.isStaticBar(t.index)?b(c,{flexBasis:t.disabledBarSize}):i.wrapperClass+=" resizable"},{deep:!0});const n={pageX:0,pageY:0,originalX:0,originalY:0};let p;const d={enableResize:!0,onPressEvent:function({originalEvent:a}){a.stopPropagation(),!!e.isResizable(t.index)&&(p=e.dragState(t.index),n.originalX=a.pageX,n.originalY=a.pageY)},onDragEvent:function({originalEvent:a}){if(a.stopPropagation(),!e.isResizable(t.index))return;n.pageX=a.pageX,n.pageY=a.pageY;let c;t.orientation==="vertical"?c=n.pageY-n.originalY:c=n.pageX-n.originalX,e.setSize(p,c)},onReleaseEvent:function({originalEvent:a}){if(a.stopPropagation(),!e.isResizable(t.index))return;n.pageX=a.pageX,n.pageY=a.pageY;let c;t.orientation==="vertical"?c=n.pageY-n.originalY:c=n.pageX-n.originalX,e.setSize(p,c)}},f=(a,c)=>{const x=e.getPane(a),h=e.getPane(c);return{pane:x,nearPane:h}},z=(a,c,x)=>{var B,M,V,j;const h=((M=(B=a==null?void 0:a.component)==null?void 0:B.props)==null?void 0:M.collapsible)&&x,C=(j=(V=a==null?void 0:a.component)==null?void 0:V.props)==null?void 0:j.collapsed,Y=c.collapsed;return{"devui-collapse":h,collapsed:C,hidden:Y}},m=o.computed(()=>{var h,C;const{pane:a,nearPane:c}=f(t.index,t.index+1),x=((C=(h=a==null?void 0:a.component)==null?void 0:h.props)==null?void 0:C.collapseDirection)!=="after"||t.index===0;return z(a,c,x)}),S=o.computed(()=>{var h,C;const{pane:a,nearPane:c}=f(t.index+1,t.index),x=((C=(h=a==null?void 0:a.component)==null?void 0:h.props)==null?void 0:C.collapseDirection)!=="before"||t.index+1===e.state.paneCount-1;return z(a,c,x)}),l=()=>{var h,C,Y,B;const{pane:a,nearPane:c}=f(t.index,t.index+1);((C=(h=a==null?void 0:a.component)==null?void 0:h.props)==null?void 0:C.collapsed)||((B=(Y=c==null?void 0:c.component)==null?void 0:Y.props)==null?void 0:B.collapsed)?X(s.value,"none-resizable"):y(s.value,"none-resizable")},r=a=>{e.tooglePane(t.index,t.index+1,a),l()},u=a=>{e.tooglePane(t.index+1,t.index,a),l()},P=()=>{r(!0),u(!0)};return o.onMounted(()=>{P()}),()=>o.withDirectives(o.createVNode("div",{class:i.wrapperClass,ref:s},[t.showCollapseButton?o.createVNode("div",{class:["prev",m.value],onClick:()=>{r()}},null):null,o.createVNode("div",{class:"devui-resize-handle"},null),t.showCollapseButton?o.createVNode("div",{class:["next",S.value],onClick:()=>u()},null):null]),[[F,d]])}});class G{constructor(){k(this,"state");this.state=o.reactive({panes:[],splitterContainerSize:0,paneCount:0})}setPanes({panes:e}){this.state.panes=e.map((i,s)=>{var n;return i.component&&(i.component.exposed.order.value=s*2),i.getPaneSize=(n=i==null?void 0:i.component)==null?void 0:n.exposed.getPaneSize,i}),this.state.paneCount=e.length}setSplitter({containerSize:e}){this.state.splitterContainerSize=e}getPane(e){if(!this.state.panes||e<0||e>=this.state.panes.length)throw new Error("no pane can return.");return this.state.panes[e]}dragState(e){const i=this.getPane(e),s=this.getPane(e+1),n=i.getPaneSize()+s.getPaneSize();return{prev:{index:e,initialSize:i.getPaneSize(),minSize:this.toPixels(i.component.props.minSize)||n-this.toPixels(s.component.props.maxSize)||0,maxSize:this.toPixels(i.component.props.maxSize)||n-this.toPixels(s.component.props.minSize)||n},next:{index:e+1,initialSize:s.getPaneSize(),minSize:this.toPixels(s.component.props.minSize)||n-this.toPixels(i.component.props.maxSize)||0,maxSize:this.toPixels(s.component.props.maxSize)||n-this.toPixels(i.component.props.minSize)||n}}}clamp(e,i,s){return Math.min(i,Math.max(e,s))}resize(e,i){const s=this.getPane(e.index),n=this.state.splitterContainerSize,p=this.clamp(e.minSize,e.maxSize,e.initialSize+i);let d="";this.isPercent(s.component.props.size)?d=p/n*100+"%":d=p+"px",s.component.props.size=d,s.component.emit("sizeChange",d)}isResizable(e){var p,d,f,z,m,S,l,r;const i=this.getPane(e),s=this.getPane(e+1),n=((d=(p=i==null?void 0:i.component)==null?void 0:p.props)==null?void 0:d.collapsed)||((z=(f=s==null?void 0:s.component)==null?void 0:f.props)==null?void 0:z.collapsed);return((S=(m=i==null?void 0:i.component)==null?void 0:m.props)==null?void 0:S.resizable)&&((r=(l=s==null?void 0:s.component)==null?void 0:l.props)==null?void 0:r.resizable)&&!n}isStaticBar(e){var n,p,d,f;const i=this.getPane(e),s=this.getPane(e+1);return!(((p=(n=i==null?void 0:i.component)==null?void 0:n.props)==null?void 0:p.resizable)&&((f=(d=s==null?void 0:s.component)==null?void 0:d.props)==null?void 0:f.resizable))}isPercent(e){return/%$/.test(e)}toPixels(e){let i=parseFloat(e);return this.isPercent(e)&&(i=this.state.splitterContainerSize*i/100),i}tooglePane(e,i,s){var d,f,z,m,S,l,r,u,P,a,c,x,h;const n=this.getPane(e),p=this.getPane(i);((f=(d=n==null?void 0:n.component)==null?void 0:d.props)==null?void 0:f.collapsible)&&(n.component.props.collapsed=s?(m=(z=n==null?void 0:n.component)==null?void 0:z.props)==null?void 0:m.collapsed:!((l=(S=n==null?void 0:n.component)==null?void 0:S.props)==null?void 0:l.collapsed),(a=(r=p==null?void 0:p.component)==null?void 0:r.exposed)==null||a.toggleNearPaneFlexGrow((P=(u=n==null?void 0:n.component)==null?void 0:u.props)==null?void 0:P.collapsed),(h=n==null?void 0:n.component)==null||h.emit("collapsedChange",(x=(c=n==null?void 0:n.component)==null?void 0:c.props)==null?void 0:x.collapsed))}setSize(e,i){const s=this.getPane(e.prev.index),n=this.getPane(e.next.index);s.component.props.size&&n.component.props.size?(this.resize(e.prev,i),this.resize(e.next,-i)):n.component.props.size?this.resize(e.next,-i):this.resize(e.prev,i)}}var A="",w=o.defineComponent({name:"DSplitter",components:{DSplitterBar:q},props:v,emits:[],setup(t,e){var f,z;const i=new G,s=o.reactive({panes:[]});s.panes=((z=(f=e.slots).DSplitterPane)==null?void 0:z.call(f))||[],i.setPanes({panes:s.panes}),o.provide("orientation",t.orientation),o.provide("splitterStore",i);const n=o.ref(),p=()=>{if(!n)return;let m=0;t.orientation==="vertical"?m=n.value.clientHeight:m=n.value.clientWidth,i.setSplitter({containerSize:m})},d=new ResizeObserver(p);return o.watch(n,m=>{!m||(p(),d.observe(n.value))}),o.onUnmounted(()=>{d.disconnect()}),()=>{const{splitBarSize:m,orientation:S,showCollapseButton:l}=t,r=["devui-splitter",`devui-splitter-${S}`];return o.createVNode("div",{class:r,ref:n},[s.panes,s.panes.filter((u,P,a)=>P!==a.length-1).map((u,P)=>o.createVNode(o.resolveComponent("d-splitter-bar"),{key:P,style:`order: ${P*2+1}`,splitBarSize:m,orientation:S,index:P,showCollapseButton:l},null))])}}});const O={size:{type:String},minSize:{type:String},maxSize:{type:String},resizable:{type:Boolean,default:!0},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},collapseDirection:{type:String,default:"both"},shrink:{type:Boolean,default:!1},shrinkWidth:{type:Number,default:36}};var J="",D=o.defineComponent({name:"DSplitterPane",props:O,emits:["sizeChange","collapsedChange"],setup(t,{slots:e,expose:i}){const s=o.inject("splitterStore"),n=o.ref(),p=o.ref();o.watch([p,n],([l,r])=>{!r||b(r,{order:l})});const d=(l,r)=>{if(!r)return;r.style.flexBasis=l;const u="devui-splitter-pane-fixed";l?X(r,u):y(r,u)};o.watch([()=>t.size,n],([l,r])=>{d(l,r)},{immediate:!0});const f=o.inject("orientation");let z="";o.onMounted(()=>{z=t.size,s.setPanes({panes:s.state.panes})}),o.onUpdated(()=>{s.setPanes({panes:s.state.panes})});const m=()=>{const l=n.value;if(!!l)return f==="vertical"?l.offsetHeight:l.offsetWidth};return o.watch(()=>t.collapsed,l=>{const r=n.value;if(!r)return;const u="devui-splitter-pane-hidden";l?X(r,u):y(r,u),l&&t.shrink?(y(r,u),b(r,{flexBasis:`${t.shrinkWidth}px`})):b(r,{flexBasis:z})},{immediate:!0}),i({order:p,getPaneSize:m,toggleNearPaneFlexGrow:l=>{const r=n.value;if(!(r instanceof HTMLElement))return;const u="devui-splitter-pane-grow";R(r,u)?y(r,u):l&&X(r,u)}}),()=>{var l;return o.createVNode("div",{class:"devui-splitter-pane",ref:n},[(l=e.default)==null?void 0:l.call(e)])}}});w.install=function(t){t.component(w.name,w),t.component(D.name,D)};var W={title:"Splitter \u5206\u5272\u5668",category:"\u5E03\u5C40",status:"100%",install(t){t.use(w)}};g.Splitter=w,g.default=W,Object.defineProperty(g,"__esModule",{value:!0}),g[Symbol.toStringTag]="Module"});
@@ -0,0 +1,7 @@
1
+ import { App } from 'vue';
2
+ declare function install(app: App): void
3
+ declare const _default: {
4
+ install: typeof install;
5
+ version: string;
6
+ };
7
+ export default _default;
@@ -0,0 +1,280 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import { defineComponent, ref, computed, onMounted, watch, createVNode, mergeProps } from "vue";
8
+ const statisticProps = {
9
+ title: {
10
+ type: String,
11
+ default: ""
12
+ },
13
+ value: {
14
+ type: [Number, String]
15
+ },
16
+ prefix: {
17
+ type: String
18
+ },
19
+ suffix: {
20
+ type: String
21
+ },
22
+ precision: {
23
+ type: Number
24
+ },
25
+ groupSeparator: {
26
+ type: String,
27
+ default: ","
28
+ },
29
+ showGroupSeparator: {
30
+ type: Boolean,
31
+ default: false
32
+ },
33
+ titleStyle: {
34
+ type: Object
35
+ },
36
+ contentStyle: {
37
+ type: Object
38
+ },
39
+ animationDuration: {
40
+ type: Number,
41
+ default: 2e3
42
+ },
43
+ valueFrom: {
44
+ type: Number
45
+ },
46
+ animation: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ start: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ extra: {
55
+ type: String,
56
+ default: ""
57
+ },
58
+ easing: {
59
+ type: String,
60
+ default: "easeOutCubic"
61
+ },
62
+ delay: {
63
+ type: Number,
64
+ default: 0
65
+ }
66
+ };
67
+ const separator = (SeparatorString, groupSeparator, showGroupSeparator) => {
68
+ const res = SeparatorString.replace(/\d+/, function(n) {
69
+ return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
70
+ return $1 + `${showGroupSeparator ? groupSeparator : ""}`;
71
+ });
72
+ });
73
+ return res;
74
+ };
75
+ const isHasDot = (value) => {
76
+ if (!isNaN(value)) {
77
+ return (value + "").indexOf(".") !== -1;
78
+ }
79
+ };
80
+ const analysisValueType = (value, propsValue, groupSeparator, splitPrecisionNumber, showGroupSeparator) => {
81
+ const fixedNumber = propsValue.toString().indexOf(".") !== -1 ? propsValue.toString().length - propsValue.toString().indexOf(".") - 1 : 0;
82
+ if (typeof value === "number") {
83
+ if (isHasDot(value)) {
84
+ return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator, showGroupSeparator) : separator(value.toFixed(fixedNumber).toString(), groupSeparator, showGroupSeparator);
85
+ } else {
86
+ return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator, showGroupSeparator) : separator(value.toString(), groupSeparator, showGroupSeparator);
87
+ }
88
+ } else {
89
+ return value;
90
+ }
91
+ };
92
+ const pow = Math.pow;
93
+ const sqrt = Math.sqrt;
94
+ const easeOutCubic = function(x) {
95
+ return 1 - pow(1 - x, 3);
96
+ };
97
+ const linear = (x) => x;
98
+ const easeOutExpo = function(x) {
99
+ return x === 1 ? 1 : 1 - pow(2, -10 * x);
100
+ };
101
+ const easeInOutExpo = function(x) {
102
+ return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? pow(2, 20 * x - 10) / 2 : (2 - pow(2, -20 * x + 10)) / 2;
103
+ };
104
+ const easeInExpo = function(x) {
105
+ return x === 0 ? 0 : pow(2, 10 * x - 10);
106
+ };
107
+ const easeInOutCirc = function(x) {
108
+ return x < 0.5 ? (1 - sqrt(1 - pow(2 * x, 2))) / 2 : (sqrt(1 - pow(-2 * x + 2, 2)) + 1) / 2;
109
+ };
110
+ var easing = /* @__PURE__ */ Object.freeze({
111
+ __proto__: null,
112
+ [Symbol.toStringTag]: "Module",
113
+ easeOutCubic,
114
+ linear,
115
+ easeOutExpo,
116
+ easeInOutExpo,
117
+ easeInExpo,
118
+ easeInOutCirc
119
+ });
120
+ class Tween {
121
+ constructor(options) {
122
+ __publicField(this, "from");
123
+ __publicField(this, "to");
124
+ __publicField(this, "duration");
125
+ __publicField(this, "delay");
126
+ __publicField(this, "easing");
127
+ __publicField(this, "onStart");
128
+ __publicField(this, "onUpdate");
129
+ __publicField(this, "onFinish");
130
+ __publicField(this, "startTime");
131
+ __publicField(this, "started");
132
+ __publicField(this, "finished");
133
+ __publicField(this, "timer");
134
+ __publicField(this, "time");
135
+ __publicField(this, "elapsed");
136
+ __publicField(this, "keys");
137
+ const { from, to, duration, delay, easing: easing2, onStart, onUpdate, onFinish } = options;
138
+ for (const key in from) {
139
+ if (to[key] === void 0) {
140
+ to[key] = from[key];
141
+ }
142
+ }
143
+ for (const key in to) {
144
+ if (from[key] === void 0) {
145
+ from[key] = to[key];
146
+ }
147
+ }
148
+ this.from = from;
149
+ this.to = to;
150
+ this.duration = duration;
151
+ this.delay = delay;
152
+ this.easing = easing2;
153
+ this.onStart = onStart;
154
+ this.onUpdate = onUpdate;
155
+ this.onFinish = onFinish;
156
+ this.startTime = Date.now() + this.delay;
157
+ this.started = false;
158
+ this.finished = false;
159
+ this.timer = null;
160
+ this.keys = {};
161
+ }
162
+ update() {
163
+ this.time = Date.now();
164
+ if (this.time < this.startTime) {
165
+ return;
166
+ }
167
+ if (this.finished) {
168
+ return;
169
+ }
170
+ if (this.elapsed === this.duration) {
171
+ if (!this.finished) {
172
+ this.finished = true;
173
+ this.onFinish && this.onFinish(this.keys);
174
+ }
175
+ return;
176
+ }
177
+ this.elapsed = this.time - this.startTime;
178
+ this.elapsed = this.elapsed > this.duration ? this.duration : this.elapsed;
179
+ for (const key in this.to) {
180
+ this.keys[key] = this.from[key] + (this.to[key] - this.from[key]) * easing[this.easing](this.elapsed / this.duration);
181
+ }
182
+ if (!this.started) {
183
+ this.onStart && this.onStart(this.keys);
184
+ this.started = true;
185
+ }
186
+ this.onUpdate(this.keys);
187
+ }
188
+ start() {
189
+ this.startTime = Date.now() + this.delay;
190
+ const tick = () => {
191
+ this.update();
192
+ this.timer = requestAnimationFrame(tick);
193
+ if (this.finished) {
194
+ cancelAnimationFrame(this.timer);
195
+ this.timer = null;
196
+ }
197
+ };
198
+ tick();
199
+ }
200
+ stop() {
201
+ cancelAnimationFrame(this.timer);
202
+ this.timer = null;
203
+ }
204
+ }
205
+ var statistic = "";
206
+ var Statistic = defineComponent({
207
+ name: "DStatistic",
208
+ props: statisticProps,
209
+ inheritAttrs: false,
210
+ setup(props, ctx) {
211
+ var _a;
212
+ const innerValue = ref((_a = props.valueFrom) != null ? _a : props.value);
213
+ const tween = ref(null);
214
+ const animation = (from = ((_b) => (_b = props.valueFrom) != null ? _b : 0)(), to = typeof props.value === "number" ? props.value : Number(props.value)) => {
215
+ if (from !== to) {
216
+ tween.value = new Tween({
217
+ from: {
218
+ value: from
219
+ },
220
+ to: {
221
+ value: to
222
+ },
223
+ delay: props.delay,
224
+ duration: props.animationDuration,
225
+ easing: props.easing,
226
+ onUpdate: (keys) => {
227
+ innerValue.value = keys.value;
228
+ },
229
+ onFinish: () => {
230
+ innerValue.value = to;
231
+ }
232
+ });
233
+ tween.value.start();
234
+ }
235
+ };
236
+ const statisticValue = computed(() => {
237
+ return analysisValueType(innerValue.value, props.value, props.groupSeparator, props.precision, props.showGroupSeparator, props.animation);
238
+ });
239
+ onMounted(() => {
240
+ if (props.animation && props.start) {
241
+ animation();
242
+ }
243
+ });
244
+ watch(() => props.start, (value) => {
245
+ if (value && !tween.value) {
246
+ animation();
247
+ }
248
+ });
249
+ return () => {
250
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
251
+ return createVNode("div", mergeProps({
252
+ "class": "devui-statistic"
253
+ }, ctx.attrs), [createVNode("div", {
254
+ "class": "devui-statistic-title",
255
+ "style": props.titleStyle
256
+ }, [((_b = (_a2 = ctx.slots).title) == null ? void 0 : _b.call(_a2)) || props.title]), createVNode("div", {
257
+ "class": "devui-statistic-content",
258
+ "style": props.contentStyle
259
+ }, [props.prefix || ((_d = (_c = ctx.slots).prefix) == null ? void 0 : _d.call(_c)) ? createVNode("span", {
260
+ "class": "devui-statistic-prefix"
261
+ }, [((_f = (_e = ctx.slots).prefix) == null ? void 0 : _f.call(_e)) || props.prefix]) : null, createVNode("span", {
262
+ "class": "devui-statistic--value"
263
+ }, [statisticValue.value]), props.suffix || ((_h = (_g = ctx.slots).suffix) == null ? void 0 : _h.call(_g)) ? createVNode("span", {
264
+ "class": "devui-statistic-suffix"
265
+ }, [((_j = (_i = ctx.slots).suffix) == null ? void 0 : _j.call(_i)) || props.suffix]) : null]), ((_l = (_k = ctx.slots).extra) == null ? void 0 : _l.call(_k)) || props.extra]);
266
+ };
267
+ }
268
+ });
269
+ Statistic.install = function(app) {
270
+ app.component(Statistic.name, Statistic);
271
+ };
272
+ var index = {
273
+ title: "Statistic \u7EDF\u8BA1\u6570\u503C",
274
+ category: "\u6570\u636E\u5C55\u793A",
275
+ status: "100%",
276
+ install(app) {
277
+ app.use(Statistic);
278
+ }
279
+ };
280
+ export { Statistic, index as default };
@@ -0,0 +1 @@
1
+ var q=Object.defineProperty;var B=(a,e,f)=>e in a?q(a,e,{enumerable:!0,configurable:!0,writable:!0,value:f}):a[e]=f;var s=(a,e,f)=>(B(a,typeof e!="symbol"?e+"":e,f),f);(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.index={},a.Vue))})(this,function(a,e){"use strict";const f={title:{type:String,default:""},value:{type:[Number,String]},prefix:{type:String},suffix:{type:String},precision:{type:Number},groupSeparator:{type:String,default:","},showGroupSeparator:{type:Boolean,default:!1},titleStyle:{type:Object},contentStyle:{type:Object},animationDuration:{type:Number,default:2e3},valueFrom:{type:Number},animation:{type:Boolean,default:!1},start:{type:Boolean,default:!1},extra:{type:String,default:""},easing:{type:String,default:"easeOutCubic"},delay:{type:Number,default:0}},g=(t,i,n)=>t.replace(/\d+/,function(u){return u.replace(/(\d)(?=(\d{3})+$)/g,function(h){return h+`${n?i:""}`})}),w=t=>{if(!isNaN(t))return(t+"").indexOf(".")!==-1},C=(t,i,n,r,u)=>{const h=i.toString().indexOf(".")!==-1?i.toString().length-i.toString().indexOf(".")-1:0;return typeof t=="number"?w(t)?g(r?t.toFixed(r).toString():t.toFixed(h).toString(),n,u):g(r?t.toFixed(r).toString():t.toString(),n,u):t},c=Math.pow,v=Math.sqrt,D=function(t){return 1-c(1-t,3)},E=t=>t,V=function(t){return t===1?1:1-c(2,-10*t)},A=function(t){return t===0?0:t===1?1:t<.5?c(2,20*t-10)/2:(2-c(2,-20*t+10))/2},I=function(t){return t===0?0:c(2,10*t-10)},M=function(t){return t<.5?(1-v(1-c(2*t,2)))/2:(v(1-c(-2*t+2,2))+1)/2};var _=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",easeOutCubic:D,linear:E,easeOutExpo:V,easeInOutExpo:A,easeInExpo:I,easeInOutCirc:M});class j{constructor(i){s(this,"from");s(this,"to");s(this,"duration");s(this,"delay");s(this,"easing");s(this,"onStart");s(this,"onUpdate");s(this,"onFinish");s(this,"startTime");s(this,"started");s(this,"finished");s(this,"timer");s(this,"time");s(this,"elapsed");s(this,"keys");const{from:n,to:r,duration:u,delay:h,easing:S,onStart:l,onUpdate:d,onFinish:m}=i;for(const o in n)r[o]===void 0&&(r[o]=n[o]);for(const o in r)n[o]===void 0&&(n[o]=r[o]);this.from=n,this.to=r,this.duration=u,this.delay=h,this.easing=S,this.onStart=l,this.onUpdate=d,this.onFinish=m,this.startTime=Date.now()+this.delay,this.started=!1,this.finished=!1,this.timer=null,this.keys={}}update(){if(this.time=Date.now(),!(this.time<this.startTime)&&!this.finished){if(this.elapsed===this.duration){this.finished||(this.finished=!0,this.onFinish&&this.onFinish(this.keys));return}this.elapsed=this.time-this.startTime,this.elapsed=this.elapsed>this.duration?this.duration:this.elapsed;for(const i in this.to)this.keys[i]=this.from[i]+(this.to[i]-this.from[i])*_[this.easing](this.elapsed/this.duration);this.started||(this.onStart&&this.onStart(this.keys),this.started=!0),this.onUpdate(this.keys)}}start(){this.startTime=Date.now()+this.delay;const i=()=>{this.update(),this.timer=requestAnimationFrame(i),this.finished&&(cancelAnimationFrame(this.timer),this.timer=null)};i()}stop(){cancelAnimationFrame(this.timer),this.timer=null}}var $="",y=e.defineComponent({name:"DStatistic",props:f,inheritAttrs:!1,setup(t,i){var S;const n=e.ref((S=t.valueFrom)!=null?S:t.value),r=e.ref(null),u=(l=(m=>(m=t.valueFrom)!=null?m:0)(),d=typeof t.value=="number"?t.value:Number(t.value))=>{l!==d&&(r.value=new j({from:{value:l},to:{value:d},delay:t.delay,duration:t.animationDuration,easing:t.easing,onUpdate:o=>{n.value=o.value},onFinish:()=>{n.value=d}}),r.value.start())},h=e.computed(()=>C(n.value,t.value,t.groupSeparator,t.precision,t.showGroupSeparator,t.animation));return e.onMounted(()=>{t.animation&&t.start&&u()}),e.watch(()=>t.start,l=>{l&&!r.value&&u()}),()=>{var l,d,m,o,x,F,O,b,N,p,T,k;return e.createVNode("div",e.mergeProps({class:"devui-statistic"},i.attrs),[e.createVNode("div",{class:"devui-statistic-title",style:t.titleStyle},[((d=(l=i.slots).title)==null?void 0:d.call(l))||t.title]),e.createVNode("div",{class:"devui-statistic-content",style:t.contentStyle},[t.prefix||((o=(m=i.slots).prefix)==null?void 0:o.call(m))?e.createVNode("span",{class:"devui-statistic-prefix"},[((F=(x=i.slots).prefix)==null?void 0:F.call(x))||t.prefix]):null,e.createVNode("span",{class:"devui-statistic--value"},[h.value]),t.suffix||((b=(O=i.slots).suffix)==null?void 0:b.call(O))?e.createVNode("span",{class:"devui-statistic-suffix"},[((p=(N=i.slots).suffix)==null?void 0:p.call(N))||t.suffix]):null]),((k=(T=i.slots).extra)==null?void 0:k.call(T))||t.extra])}}});y.install=function(t){t.component(y.name,y)};var U={title:"Statistic \u7EDF\u8BA1\u6570\u503C",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(y)}};a.Statistic=y,a.default=U,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "statistic",
3
+ "version": "0.0.0",
4
+ "main": "index.umd.js",
5
+ "module": "index.es.js",
6
+ "style": "style.css"
7
+ }
@@ -0,0 +1 @@
1
+ .devui-statistic{box-sizing:border-box;margin:0;padding:0;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none}.devui-statistic-title{margin-bottom:4px;opacity:.7;font-size:14px}.devui-statistic-content{font-size:24px;display:flex;align-items:center;vertical-align:center}.devui-statistic-prefix{margin-right:6px}.devui-statistic-suffix{margin-left:6px}.devui-statistic--value{display:inline-block}
@@ -0,0 +1,7 @@
1
+ import { App } from 'vue';
2
+ declare function install(app: App): void
3
+ declare const _default: {
4
+ install: typeof install;
5
+ version: string;
6
+ };
7
+ export default _default;
@@ -4,7 +4,7 @@ var Status = defineComponent({
4
4
  name: "DStatus",
5
5
  props: {
6
6
  type: {
7
- default: "initial",
7
+ default: "invalid",
8
8
  type: String
9
9
  }
10
10
  },
@@ -34,7 +34,7 @@ Status.install = function(app) {
34
34
  var index = {
35
35
  title: "Status \u72B6\u6001",
36
36
  category: "\u901A\u7528",
37
- status: "\u5DF2\u5B8C\u6210",
37
+ status: "100%",
38
38
  install(app) {
39
39
  app.use(Status);
40
40
  }
@@ -1 +1 @@
1
- (function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t.index={},t.Vue))})(this,function(t,e){"use strict";var l="",u=e.defineComponent({name:"DStatus",props:{type:{default:"initial",type:String}},setup(n,o){const r=e.computed(()=>{const{type:s}=n,i=["success","error","initial","warning","waiting","running","invalid"];let a="devui-status devui-status-bg-invalid";return i.includes(s)&&(a=`devui-status devui-status-bg-${s}`),a});return()=>{var s,i;return e.createVNode("span",{class:r.value},[(i=(s=o.slots).default)==null?void 0:i.call(s)])}}});u.install=function(n){n.component(u.name,u)};var d={title:"Status \u72B6\u6001",category:"\u901A\u7528",status:"\u5DF2\u5B8C\u6210",install(n){n.use(u)}};t.Status=u,t.default=d,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"});
1
+ (function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t.index={},t.Vue))})(this,function(t,e){"use strict";var l="",n=e.defineComponent({name:"DStatus",props:{type:{default:"invalid",type:String}},setup(u,o){const r=e.computed(()=>{const{type:s}=u,i=["success","error","initial","warning","waiting","running","invalid"];let a="devui-status devui-status-bg-invalid";return i.includes(s)&&(a=`devui-status devui-status-bg-${s}`),a});return()=>{var s,i;return e.createVNode("span",{class:r.value},[(i=(s=o.slots).default)==null?void 0:i.call(s)])}}});n.install=function(u){u.component(n.name,n)};var d={title:"Status \u72B6\u6001",category:"\u901A\u7528",status:"100%",install(u){u.use(n)}};t.Status=n,t.default=d,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"});
@@ -0,0 +1,7 @@
1
+ import { App } from 'vue';
2
+ declare function install(app: App): void
3
+ declare const _default: {
4
+ install: typeof install;
5
+ version: string;
6
+ };
7
+ export default _default;