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

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 (332) hide show
  1. package/README.md +62 -45
  2. package/accordion/index.d.ts +7 -0
  3. package/accordion/index.es.js +460 -142
  4. package/accordion/index.umd.js +1 -1
  5. package/accordion/style.css +1 -1
  6. package/alert/index.d.ts +7 -0
  7. package/alert/index.es.js +7 -5
  8. package/alert/index.umd.js +1 -1
  9. package/alert/style.css +1 -1
  10. package/anchor/index.d.ts +7 -0
  11. package/avatar/index.d.ts +7 -0
  12. package/avatar/index.es.js +1 -1
  13. package/avatar/index.umd.js +1 -1
  14. package/back-top/index.d.ts +7 -0
  15. package/back-top/index.es.js +128 -0
  16. package/back-top/index.umd.js +1 -0
  17. package/back-top/package.json +7 -0
  18. package/back-top/style.css +1 -0
  19. package/badge/index.d.ts +7 -0
  20. package/badge/index.es.js +1 -1
  21. package/badge/index.umd.js +1 -1
  22. package/breadcrumb/index.d.ts +7 -0
  23. package/button/index.d.ts +7 -0
  24. package/button/index.es.js +218 -12
  25. package/button/index.umd.js +1 -1
  26. package/button/style.css +1 -1
  27. package/card/index.d.ts +7 -0
  28. package/card/index.es.js +1 -1
  29. package/card/index.umd.js +1 -1
  30. package/carousel/index.d.ts +7 -0
  31. package/carousel/index.es.js +5 -4
  32. package/carousel/index.umd.js +1 -1
  33. package/cascader/index.d.ts +7 -0
  34. package/cascader/index.es.js +1239 -83
  35. package/cascader/index.umd.js +1 -1
  36. package/cascader/style.css +1 -1
  37. package/checkbox/index.d.ts +7 -0
  38. package/checkbox/index.es.js +43 -8
  39. package/checkbox/index.umd.js +1 -1
  40. package/color-picker/index.d.ts +7 -0
  41. package/color-picker/index.es.js +2960 -0
  42. package/color-picker/index.umd.js +1 -0
  43. package/color-picker/package.json +7 -0
  44. package/color-picker/style.css +1 -0
  45. package/comment/index.d.ts +7 -0
  46. package/comment/index.es.js +85 -0
  47. package/comment/index.umd.js +1 -0
  48. package/comment/package.json +7 -0
  49. package/comment/style.css +1 -0
  50. package/countdown/index.d.ts +7 -0
  51. package/countdown/index.es.js +176 -0
  52. package/countdown/index.umd.js +1 -0
  53. package/countdown/package.json +7 -0
  54. package/countdown/style.css +1 -0
  55. package/date-picker/index.d.ts +7 -0
  56. package/date-picker/index.es.js +32 -21
  57. package/date-picker/index.umd.js +1 -1
  58. package/date-picker/style.css +1 -1
  59. package/dragdrop/index.d.ts +7 -0
  60. package/dragdrop/index.es.js +157 -0
  61. package/dragdrop/index.umd.js +1 -0
  62. package/dragdrop/package.json +7 -0
  63. package/drawer/index.d.ts +7 -0
  64. package/drawer/index.es.js +194 -42
  65. package/drawer/index.umd.js +1 -1
  66. package/drawer/style.css +1 -1
  67. package/dropdown/index.d.ts +7 -0
  68. package/dropdown/index.es.js +535 -0
  69. package/dropdown/index.umd.js +1 -0
  70. package/dropdown/package.json +7 -0
  71. package/dropdown/style.css +1 -0
  72. package/editable-select/index.d.ts +7 -0
  73. package/editable-select/index.es.js +5782 -469
  74. package/editable-select/index.umd.js +27 -1
  75. package/editable-select/style.css +1 -1
  76. package/form/index.d.ts +7 -0
  77. package/form/index.es.js +2257 -0
  78. package/form/index.umd.js +1 -0
  79. package/form/package.json +7 -0
  80. package/form/style.css +1 -0
  81. package/fullscreen/index.d.ts +7 -0
  82. package/fullscreen/index.es.js +14 -4
  83. package/fullscreen/index.umd.js +1 -1
  84. package/gantt/index.d.ts +7 -0
  85. package/gantt/index.es.js +535 -0
  86. package/gantt/index.umd.js +1 -0
  87. package/gantt/package.json +7 -0
  88. package/gantt/style.css +1 -0
  89. package/grid/index.d.ts +7 -0
  90. package/grid/index.es.js +269 -0
  91. package/grid/index.umd.js +1 -0
  92. package/grid/package.json +7 -0
  93. package/grid/style.css +1 -0
  94. package/icon/index.d.ts +7 -0
  95. package/icon/index.es.js +6 -5
  96. package/icon/index.umd.js +1 -1
  97. package/image-preview/index.d.ts +7 -0
  98. package/image-preview/index.es.js +99 -20
  99. package/image-preview/index.umd.js +1 -1
  100. package/image-preview/style.css +1 -1
  101. package/index.d.ts +7 -0
  102. package/input/index.d.ts +7 -0
  103. package/input/index.es.js +24 -13
  104. package/input/index.umd.js +1 -1
  105. package/input-icon/index.d.ts +7 -0
  106. package/input-icon/index.es.js +332 -0
  107. package/input-icon/index.umd.js +1 -0
  108. package/input-icon/package.json +7 -0
  109. package/input-icon/style.css +1 -0
  110. package/input-number/index.d.ts +7 -0
  111. package/input-number/index.es.js +5 -4
  112. package/input-number/index.umd.js +1 -1
  113. package/layout/index.d.ts +7 -0
  114. package/layout/index.es.js +1 -1
  115. package/layout/index.umd.js +1 -1
  116. package/loading/index.d.ts +7 -0
  117. package/loading/index.es.js +1 -1
  118. package/loading/index.umd.js +1 -1
  119. package/modal/index.d.ts +7 -0
  120. package/modal/index.es.js +328 -109
  121. package/modal/index.umd.js +1 -1
  122. package/modal/style.css +1 -1
  123. package/nav-sprite/index.d.ts +7 -0
  124. package/nuxt/components/Accordion.js +3 -0
  125. package/nuxt/components/Alert.js +3 -0
  126. package/nuxt/components/Anchor.js +3 -0
  127. package/nuxt/components/Aside.js +3 -0
  128. package/nuxt/components/Avatar.js +3 -0
  129. package/nuxt/components/BackTop.js +3 -0
  130. package/nuxt/components/Badge.js +3 -0
  131. package/nuxt/components/Breadcrumb.js +3 -0
  132. package/nuxt/components/Button.js +3 -0
  133. package/nuxt/components/Card.js +3 -0
  134. package/nuxt/components/Carousel.js +3 -0
  135. package/nuxt/components/Cascader.js +3 -0
  136. package/nuxt/components/Checkbox.js +3 -0
  137. package/nuxt/components/Col.js +3 -0
  138. package/nuxt/components/ColorPicker.js +3 -0
  139. package/nuxt/components/Column.js +3 -0
  140. package/nuxt/components/Comment.js +3 -0
  141. package/nuxt/components/Content.js +3 -0
  142. package/nuxt/components/Countdown.js +3 -0
  143. package/nuxt/components/DatePicker.js +3 -0
  144. package/nuxt/components/Drawer.js +3 -0
  145. package/nuxt/components/DrawerService.js +3 -0
  146. package/nuxt/components/Dropdown.js +3 -0
  147. package/nuxt/components/EditableSelect.js +3 -0
  148. package/nuxt/components/FixedOverlay.js +3 -0
  149. package/nuxt/components/FlexibleOverlay.js +3 -0
  150. package/nuxt/components/Footer.js +3 -0
  151. package/nuxt/components/Form.js +3 -0
  152. package/nuxt/components/FormControl.js +3 -0
  153. package/nuxt/components/FormItem.js +3 -0
  154. package/nuxt/components/FormLabel.js +3 -0
  155. package/nuxt/components/FormOperation.js +3 -0
  156. package/nuxt/components/Fullscreen.js +3 -0
  157. package/nuxt/components/Gantt.js +3 -0
  158. package/nuxt/components/Header.js +3 -0
  159. package/nuxt/components/Icon.js +2 -0
  160. package/nuxt/components/ImagePreviewService.js +3 -0
  161. package/nuxt/components/Input.js +3 -0
  162. package/nuxt/components/InputIcon.js +3 -0
  163. package/nuxt/components/InputNumber.js +3 -0
  164. package/nuxt/components/Layout.js +3 -0
  165. package/nuxt/components/Loading.js +3 -0
  166. package/nuxt/components/LoadingService.js +3 -0
  167. package/nuxt/components/Modal.js +3 -0
  168. package/nuxt/components/NavSprite.js +2 -0
  169. package/nuxt/components/Pagination.js +3 -0
  170. package/nuxt/components/Panel.js +3 -0
  171. package/nuxt/components/Popover.js +3 -0
  172. package/nuxt/components/Progress.js +3 -0
  173. package/nuxt/components/QuadrantDiagram.js +3 -0
  174. package/nuxt/components/Radio.js +3 -0
  175. package/nuxt/components/RadioGroup.js +3 -0
  176. package/nuxt/components/Rate.js +3 -0
  177. package/nuxt/components/ReadTip.js +3 -0
  178. package/nuxt/components/Result.js +3 -0
  179. package/nuxt/components/Row.js +3 -0
  180. package/nuxt/components/Search.js +3 -0
  181. package/nuxt/components/Select.js +3 -0
  182. package/nuxt/components/Skeleton.js +3 -0
  183. package/nuxt/components/SkeletonItem.js +3 -0
  184. package/nuxt/components/Slider.js +3 -0
  185. package/nuxt/components/Splitter.js +3 -0
  186. package/nuxt/components/Statistic.js +3 -0
  187. package/nuxt/components/Status.js +3 -0
  188. package/nuxt/components/StepsGuide.js +3 -0
  189. package/nuxt/components/StickSlider.js +3 -0
  190. package/nuxt/components/Sticky.js +2 -0
  191. package/nuxt/components/Switch.js +3 -0
  192. package/nuxt/components/Table.js +3 -0
  193. package/nuxt/components/Tabs.js +3 -0
  194. package/nuxt/components/Tag.js +3 -0
  195. package/nuxt/components/TagInput.js +3 -0
  196. package/nuxt/components/Textarea.js +3 -0
  197. package/nuxt/components/TimeAxis.js +3 -0
  198. package/nuxt/components/TimeAxisItem.js +3 -0
  199. package/nuxt/components/TimePicker.js +3 -0
  200. package/nuxt/components/Toast.js +3 -0
  201. package/nuxt/components/ToastService.js +3 -0
  202. package/nuxt/components/Tooltip.js +3 -0
  203. package/nuxt/components/Transfer.js +3 -0
  204. package/nuxt/components/Tree.js +3 -0
  205. package/nuxt/components/TreeSelect.js +3 -0
  206. package/nuxt/components/Upload.js +3 -0
  207. package/nuxt/components/buttonProps.js +3 -0
  208. package/nuxt/index.js +13 -0
  209. package/overlay/index.d.ts +7 -0
  210. package/overlay/index.es.js +111 -94
  211. package/overlay/index.umd.js +1 -1
  212. package/overlay/style.css +1 -1
  213. package/package.json +5 -47
  214. package/pagination/index.d.ts +7 -0
  215. package/pagination/index.es.js +3 -3
  216. package/pagination/index.umd.js +1 -1
  217. package/panel/index.d.ts +7 -0
  218. package/panel/index.es.js +25 -22
  219. package/panel/index.umd.js +1 -1
  220. package/panel/style.css +1 -1
  221. package/popover/index.d.ts +7 -0
  222. package/popover/index.es.js +18 -6
  223. package/popover/index.umd.js +1 -1
  224. package/progress/index.d.ts +7 -0
  225. package/progress/index.es.js +9 -9
  226. package/progress/index.umd.js +3 -3
  227. package/quadrant-diagram/index.d.ts +7 -0
  228. package/radio/index.d.ts +7 -0
  229. package/radio/index.es.js +6 -6
  230. package/radio/index.umd.js +1 -1
  231. package/rate/index.d.ts +7 -0
  232. package/rate/index.es.js +1 -1
  233. package/rate/index.umd.js +1 -1
  234. package/read-tip/index.d.ts +7 -0
  235. package/read-tip/index.es.js +258 -0
  236. package/read-tip/index.umd.js +1 -0
  237. package/read-tip/package.json +7 -0
  238. package/read-tip/style.css +1 -0
  239. package/result/index.d.ts +7 -0
  240. package/result/index.es.js +119 -0
  241. package/result/index.umd.js +1 -0
  242. package/result/package.json +7 -0
  243. package/result/style.css +1 -0
  244. package/ripple/index.d.ts +7 -0
  245. package/ripple/index.es.js +5 -2
  246. package/ripple/index.umd.js +1 -1
  247. package/search/index.d.ts +7 -0
  248. package/search/index.es.js +35 -21
  249. package/search/index.umd.js +1 -1
  250. package/select/index.d.ts +7 -0
  251. package/select/index.es.js +47 -11
  252. package/select/index.umd.js +1 -1
  253. package/skeleton/index.d.ts +7 -0
  254. package/skeleton/index.es.js +148 -26
  255. package/skeleton/index.umd.js +1 -1
  256. package/skeleton/style.css +1 -1
  257. package/slider/index.d.ts +7 -0
  258. package/slider/index.es.js +32 -182
  259. package/slider/index.umd.js +1 -1
  260. package/slider/style.css +1 -1
  261. package/splitter/index.d.ts +7 -0
  262. package/splitter/index.es.js +295 -100
  263. package/splitter/index.umd.js +1 -1
  264. package/splitter/style.css +1 -1
  265. package/statistic/index.d.ts +7 -0
  266. package/statistic/index.es.js +280 -0
  267. package/statistic/index.umd.js +1 -0
  268. package/statistic/package.json +7 -0
  269. package/statistic/style.css +1 -0
  270. package/status/index.d.ts +7 -0
  271. package/status/index.es.js +2 -2
  272. package/status/index.umd.js +1 -1
  273. package/steps-guide/index.d.ts +7 -0
  274. package/steps-guide/index.es.js +101 -73
  275. package/steps-guide/index.umd.js +1 -1
  276. package/steps-guide/style.css +1 -1
  277. package/sticky/index.d.ts +7 -0
  278. package/style.css +1 -1
  279. package/switch/index.d.ts +7 -0
  280. package/switch/index.es.js +1 -1
  281. package/switch/index.umd.js +1 -1
  282. package/table/index.d.ts +7 -0
  283. package/table/index.es.js +1708 -156
  284. package/table/index.umd.js +1 -1
  285. package/table/style.css +1 -1
  286. package/tabs/index.d.ts +7 -0
  287. package/tabs/index.es.js +6 -3
  288. package/tabs/index.umd.js +1 -1
  289. package/tag/index.d.ts +7 -0
  290. package/tag/index.es.js +131 -0
  291. package/tag/index.umd.js +1 -0
  292. package/tag/package.json +7 -0
  293. package/tag/style.css +1 -0
  294. package/tag-input/index.d.ts +7 -0
  295. package/tag-input/index.es.js +1 -13
  296. package/tag-input/index.umd.js +1 -1
  297. package/textarea/index.d.ts +7 -0
  298. package/textarea/index.es.js +132 -0
  299. package/textarea/index.umd.js +1 -0
  300. package/textarea/package.json +7 -0
  301. package/textarea/style.css +1 -0
  302. package/time-axis/index.d.ts +7 -0
  303. package/time-axis/index.es.js +241 -21
  304. package/time-axis/index.umd.js +1 -1
  305. package/time-axis/style.css +1 -1
  306. package/time-picker/index.d.ts +7 -0
  307. package/time-picker/index.es.js +266 -32
  308. package/time-picker/index.umd.js +1 -1
  309. package/time-picker/style.css +1 -1
  310. package/toast/index.d.ts +7 -0
  311. package/toast/index.es.js +16 -12
  312. package/toast/index.umd.js +1 -1
  313. package/toast/style.css +1 -1
  314. package/tooltip/index.d.ts +7 -0
  315. package/transfer/index.d.ts +7 -0
  316. package/transfer/index.es.js +575 -83
  317. package/transfer/index.umd.js +1 -1
  318. package/transfer/style.css +1 -1
  319. package/tree/index.d.ts +7 -0
  320. package/tree/index.es.js +171 -35
  321. package/tree/index.umd.js +1 -1
  322. package/tree-select/index.d.ts +7 -0
  323. package/tree-select/index.es.js +528 -0
  324. package/tree-select/index.umd.js +1 -0
  325. package/tree-select/package.json +7 -0
  326. package/tree-select/style.css +1 -0
  327. package/upload/index.d.ts +7 -0
  328. package/upload/index.es.js +172 -513
  329. package/upload/index.umd.js +1 -1
  330. package/upload/style.css +1 -1
  331. package/vue-devui.es.js +22079 -8773
  332. package/vue-devui.umd.js +29 -3
@@ -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
+ inheritAttrs: false,
209
+ props: statisticProps,
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);
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",inheritAttrs:!1,props:f,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));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,p,N,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"},[((N=(p=i.slots).suffix)==null?void 0:N.call(p))||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;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}.devui-statistic-prefix{margin-right:6px;display:flex}.devui-statistic-suffix{margin-left:6px;display:flex}.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;
@@ -1,7 +1,11 @@
1
- import { computed, ref, reactive, nextTick, defineComponent, onMounted, createVNode, Teleport } from "vue";
1
+ import { reactive, ref, nextTick, computed, defineComponent, onMounted, createVNode, Teleport } from "vue";
2
2
  var stepsGuide = "";
3
3
  const stepsGuideProps = {
4
4
  steps: Array,
5
+ stepIndex: {
6
+ type: Number,
7
+ default: void 0
8
+ },
5
9
  showClose: {
6
10
  type: Boolean,
7
11
  default: true
@@ -9,25 +13,37 @@ const stepsGuideProps = {
9
13
  showDots: {
10
14
  type: Boolean,
11
15
  default: true
16
+ },
17
+ scrollToTargetSwitch: {
18
+ type: Boolean,
19
+ default: true
20
+ },
21
+ zIndex: {
22
+ type: Number,
23
+ default: 1100
24
+ },
25
+ stepChange: {
26
+ type: Function,
27
+ default() {
28
+ return true;
29
+ }
12
30
  }
13
31
  };
14
- function useStepsGuideNav(steps, stepIndex) {
15
- const currentStep = computed(() => {
16
- const _step = steps[stepIndex.value];
17
- _step.position = _step.position || "top";
18
- return _step;
19
- });
20
- const guideClassList = ["d-steps-guide"];
32
+ function useStepsGuidePosition(props, currentStep) {
33
+ const guideClassList = reactive(["devui-steps-guide"]);
21
34
  const stepsRef = ref(null);
22
35
  const guidePosition = reactive({
23
36
  left: "",
24
37
  top: "",
25
- zIndex: 1100
38
+ zIndex: props.zIndex
26
39
  });
27
40
  const updateGuidePosition = () => {
41
+ if (!currentStep.value || !stepsRef.value)
42
+ return;
28
43
  const baseTop = window.pageYOffset - document.documentElement.clientTop;
29
44
  const baseLeft = window.pageXOffset - document.documentElement.clientLeft;
30
45
  const currentStepPosition = currentStep.value.position;
46
+ const stepGuideElement = stepsRef.value;
31
47
  let _left, _top;
32
48
  if (typeof currentStepPosition !== "string") {
33
49
  const { top = 0, left = 0, type = "top" } = currentStepPosition;
@@ -36,9 +52,12 @@ function useStepsGuideNav(steps, stepIndex) {
36
52
  _top = top;
37
53
  } else {
38
54
  guideClassList.splice(1, 1, currentStepPosition);
39
- const stepGuideElement = stepsRef.value;
40
55
  const triggerSelector = currentStep.value.target || currentStep.value.trigger;
41
56
  const triggerElement = document.querySelector(triggerSelector);
57
+ if (!triggerElement) {
58
+ console.warn(`${triggerSelector} \u4E0D\u5B58\u5728!`);
59
+ return false;
60
+ }
42
61
  const targetRect = triggerElement.getBoundingClientRect();
43
62
  _left = targetRect.left + triggerElement.clientWidth / 2 - stepGuideElement.clientWidth / 2 + baseLeft;
44
63
  _top = targetRect.top + triggerElement.clientHeight / 2 - stepGuideElement.clientHeight / 2 + baseTop;
@@ -70,93 +89,95 @@ function useStepsGuideNav(steps, stepIndex) {
70
89
  }
71
90
  guidePosition.left = _left + "px";
72
91
  guidePosition.top = _top + "px";
92
+ if (props.scrollToTargetSwitch && typeof stepGuideElement.scrollIntoView === "function") {
93
+ nextTick(() => {
94
+ stepGuideElement.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
95
+ });
96
+ }
73
97
  };
74
98
  return {
75
- currentStep,
76
99
  stepsRef,
77
100
  guidePosition,
78
101
  guideClassList,
79
102
  updateGuidePosition
80
103
  };
81
104
  }
82
- function useStepsGuideCtrl(stepsCount, stepIndex, updateGuidePosition) {
83
- const showSteps = ref(true);
84
- const closeSteps = () => {
85
- showSteps.value = false;
105
+ function useStepsGuideCtrl(props, ctx, updateGuidePosition, stepIndex) {
106
+ const stepsCount = computed(() => props.steps.length);
107
+ const closeGuide = () => {
108
+ const _index = stepIndex.value;
109
+ stepIndex.value = -1;
110
+ nextTick(() => {
111
+ ctx.emit("guide-close", _index);
112
+ });
86
113
  };
87
114
  const setCurrentIndex = (index2) => {
88
- if (index2 > stepsCount.value || index2 < 0)
89
- index2 = 0;
90
- stepIndex.value = index2;
91
- if (!showSteps.value) {
92
- showSteps.value = true;
93
- nextTick(() => {
94
- updateGuidePosition();
95
- });
96
- } else {
97
- updateGuidePosition();
115
+ if (index2 !== -1 && props.stepChange()) {
116
+ if (index2 > -1 && index2 < stepsCount.value) {
117
+ stepIndex.value = index2;
118
+ nextTick(() => {
119
+ updateGuidePosition();
120
+ });
121
+ } else {
122
+ console.error(`stepIndex is not within the value range`);
123
+ }
98
124
  }
125
+ if (index2 === -1)
126
+ closeGuide();
99
127
  };
100
128
  return {
101
- showSteps,
102
- closeSteps,
129
+ stepsCount,
130
+ closeGuide,
103
131
  setCurrentIndex
104
132
  };
105
133
  }
106
134
  var StepsGuide = defineComponent({
107
135
  name: "DStepsGuide",
108
136
  props: stepsGuideProps,
109
- emits: [],
137
+ emits: ["guide-close", "update:stepIndex"],
110
138
  setup(props, ctx) {
111
- const stepsCount = computed(() => props.steps.length - 1);
112
- const stepIndex = ref(0);
139
+ var _a;
140
+ const stepIndexData = ref((_a = props.stepIndex) != null ? _a : 0);
141
+ const stepIndex = computed({
142
+ set: (val) => {
143
+ if (props.stepIndex != null) {
144
+ ctx.emit("update:stepIndex", val);
145
+ }
146
+ stepIndexData.value = val;
147
+ },
148
+ get: () => stepIndexData.value
149
+ });
150
+ const currentStep = computed(() => {
151
+ const _step = props.steps[stepIndex.value];
152
+ if (_step)
153
+ _step.position = _step.position || "top";
154
+ return _step;
155
+ });
113
156
  const {
114
- currentStep,
115
157
  stepsRef,
116
158
  guidePosition,
117
159
  guideClassList,
118
160
  updateGuidePosition
119
- } = useStepsGuideNav(props.steps, stepIndex);
161
+ } = useStepsGuidePosition(props, currentStep);
120
162
  const {
121
- showSteps,
122
- closeSteps,
163
+ stepsCount,
164
+ closeGuide,
123
165
  setCurrentIndex
124
- } = useStepsGuideCtrl(stepsCount, stepIndex, updateGuidePosition);
166
+ } = useStepsGuideCtrl(props, ctx, updateGuidePosition, stepIndex);
125
167
  onMounted(() => {
126
168
  updateGuidePosition();
127
169
  });
128
- return {
129
- stepsCount,
130
- stepIndex,
131
- showSteps,
132
- guidePosition,
133
- guideClassList,
134
- stepsRef,
135
- currentStep,
136
- setCurrentIndex,
137
- closeSteps
138
- };
139
- },
140
- render(props) {
141
- const {
142
- showSteps,
143
- guidePosition,
144
- guideClassList,
145
- currentStep,
146
- stepIndex,
147
- stepsCount,
148
- setCurrentIndex,
149
- closeSteps,
150
- showClose,
151
- showDots
152
- } = props;
153
- return showSteps ? createVNode(Teleport, {
170
+ ctx.expose({
171
+ closeGuide,
172
+ setCurrentIndex
173
+ });
174
+ return () => stepIndex.value > -1 && stepsCount.value > 0 ? createVNode(Teleport, {
154
175
  "to": "body"
155
176
  }, {
156
177
  default: () => [createVNode("div", {
157
178
  "style": guidePosition,
158
179
  "class": guideClassList,
159
- "ref": "stepsRef"
180
+ "ref": stepsRef
160
181
  }, [createVNode("div", {
161
182
  "class": "devui-shining-dot"
162
183
  }, null), createVNode("div", {
@@ -167,45 +188,52 @@ var StepsGuide = defineComponent({
167
188
  "class": "devui-guide-container"
168
189
  }, [createVNode("p", {
169
190
  "class": "devui-title"
170
- }, [currentStep.title]), showClose ? createVNode("div", {
191
+ }, [currentStep.value.title]), props.showClose ? createVNode("div", {
171
192
  "class": "icon icon-close",
172
- "onClick": closeSteps
193
+ "onClick": closeGuide
173
194
  }, null) : null, createVNode("div", {
174
195
  "class": "devui-content"
175
- }, [currentStep.content]), createVNode("div", {
196
+ }, [currentStep.value.content]), createVNode("div", {
176
197
  "class": "devui-ctrl"
177
- }, [showDots ? createVNode("div", {
198
+ }, [props.showDots ? createVNode("div", {
178
199
  "class": "devui-dots"
179
200
  }, [props.steps.map((step, index2) => {
180
201
  return createVNode("em", {
181
- "class": ["icon icon-dot-status", currentStep === step ? "devui-active" : ""],
202
+ "class": ["icon icon-dot-status", currentStep.value === step ? "devui-active" : ""],
182
203
  "key": index2
183
204
  }, null);
184
205
  })]) : null, createVNode("div", {
185
206
  "class": "devui-guide-btn"
186
- }, [stepIndex > 0 ? createVNode("div", {
207
+ }, [stepIndex.value > 0 ? createVNode("div", {
187
208
  "class": "devui-prev-step",
188
- "onClick": () => setCurrentIndex(--props.stepIndex)
189
- }, ["\u4E0A\u4E00\u6B65"]) : null, stepIndex === stepsCount ? createVNode("div", {
190
- "onClick": closeSteps
209
+ "onClick": () => setCurrentIndex(stepIndex.value - 1)
210
+ }, ["\u4E0A\u4E00\u6B65"]) : null, stepIndex.value === stepsCount.value - 1 ? createVNode("div", {
211
+ "onClick": closeGuide
191
212
  }, ["\u6211\u77E5\u9053\u5566"]) : createVNode("div", {
192
213
  "class": "devui-next-step",
193
214
  "onClick": () => {
194
- setCurrentIndex(++props.stepIndex);
215
+ setCurrentIndex(stepIndex.value + 1);
195
216
  }
196
217
  }, ["\u6211\u77E5\u9053\u5566,\u7EE7\u7EED"])])])])])]
197
218
  }) : null;
198
219
  }
199
220
  });
221
+ var StepsGuideDirective = {
222
+ mounted(el, binding, vNode) {
223
+ },
224
+ updated(el, binding) {
225
+ }
226
+ };
200
227
  StepsGuide.install = function(app) {
201
228
  app.component(StepsGuide.name, StepsGuide);
202
229
  };
203
230
  var index = {
204
231
  title: "StepsGuide \u64CD\u4F5C\u6307\u5F15",
205
232
  category: "\u5BFC\u822A",
206
- status: "50%",
233
+ status: "80%",
207
234
  install(app) {
208
235
  app.use(StepsGuide);
236
+ app.directive("StepsGuide", StepsGuideDirective);
209
237
  }
210
238
  };
211
239
  export { StepsGuide, index as default };
@@ -1 +1 @@
1
- (function(u,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.index={},u.Vue))})(this,function(u,e){"use strict";var b="";const N={steps:Array,showClose:{type:Boolean,default:!0},showDots:{type:Boolean,default:!0}};function V(t,h){const o=e.computed(()=>{const d=t[h.value];return d.position=d.position||"top",d}),s=["d-steps-guide"],r=e.ref(null),a=e.reactive({left:"",top:"",zIndex:1100});return{currentStep:o,stepsRef:r,guidePosition:a,guideClassList:s,updateGuidePosition:()=>{const d=window.pageYOffset-document.documentElement.clientTop,g=window.pageXOffset-document.documentElement.clientLeft,f=o.value.position;let c,l;if(typeof f!="string"){const{top:i=0,left:C=0,type:n="top"}=f;s.splice(1,1,n),c=C,l=i}else{s.splice(1,1,f);const i=r.value,C=o.value.target||o.value.trigger,n=document.querySelector(C),S=n.getBoundingClientRect();c=S.left+n.clientWidth/2-i.clientWidth/2+g,l=S.top+n.clientHeight/2-i.clientHeight/2+d;const v=f.split("-");switch(v[0]){case"top":l+=-i.clientHeight/2-n.clientHeight;break;case"bottom":l+=i.clientHeight/2+n.clientHeight;break;case"left":l+=i.clientHeight/2-n.clientHeight,c+=-i.clientWidth/2-n.clientWidth/2;break;case"right":l+=i.clientHeight/2-n.clientHeight,c+=i.clientWidth/2+n.clientWidth/2;break}switch(v[1]){case"left":c+=i.clientWidth/2-n.clientWidth/2;break;case"right":c+=-i.clientWidth/2+n.clientWidth/2;break}}a.left=c+"px",a.top=l+"px"}}}function y(t,h,o){const s=e.ref(!0);return{showSteps:s,closeSteps:()=>{s.value=!1},setCurrentIndex:p=>{(p>t.value||p<0)&&(p=0),h.value=p,s.value?o():(s.value=!0,e.nextTick(()=>{o()}))}}}var m=e.defineComponent({name:"DStepsGuide",props:N,emits:[],setup(t,h){const o=e.computed(()=>t.steps.length-1),s=e.ref(0),{currentStep:r,stepsRef:a,guidePosition:p,guideClassList:d,updateGuidePosition:g}=V(t.steps,s),{showSteps:f,closeSteps:c,setCurrentIndex:l}=y(o,s,g);return e.onMounted(()=>{g()}),{stepsCount:o,stepIndex:s,showSteps:f,guidePosition:p,guideClassList:d,stepsRef:a,currentStep:r,setCurrentIndex:l,closeSteps:c}},render(t){const{showSteps:h,guidePosition:o,guideClassList:s,currentStep:r,stepIndex:a,stepsCount:p,setCurrentIndex:d,closeSteps:g,showClose:f,showDots:c}=t;return h?e.createVNode(e.Teleport,{to:"body"},{default:()=>[e.createVNode("div",{style:o,class:s,ref:"stepsRef"},[e.createVNode("div",{class:"devui-shining-dot"},null),e.createVNode("div",{class:"devui-shining-plus"},null),e.createVNode("div",{class:"devui-arrow"},null),e.createVNode("div",{class:"devui-guide-container"},[e.createVNode("p",{class:"devui-title"},[r.title]),f?e.createVNode("div",{class:"icon icon-close",onClick:g},null):null,e.createVNode("div",{class:"devui-content"},[r.content]),e.createVNode("div",{class:"devui-ctrl"},[c?e.createVNode("div",{class:"devui-dots"},[t.steps.map((l,i)=>e.createVNode("em",{class:["icon icon-dot-status",r===l?"devui-active":""],key:i},null))]):null,e.createVNode("div",{class:"devui-guide-btn"},[a>0?e.createVNode("div",{class:"devui-prev-step",onClick:()=>d(--t.stepIndex)},["\u4E0A\u4E00\u6B65"]):null,a===p?e.createVNode("div",{onClick:g},["\u6211\u77E5\u9053\u5566"]):e.createVNode("div",{class:"devui-next-step",onClick:()=>{d(++t.stepIndex)}},["\u6211\u77E5\u9053\u5566,\u7EE7\u7EED"])])])])])]}):null}});m.install=function(t){t.component(m.name,m)};var w={title:"StepsGuide \u64CD\u4F5C\u6307\u5F15",category:"\u5BFC\u822A",status:"50%",install(t){t.use(m)}};u.StepsGuide=m,u.default=w,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
1
+ (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";var x="";const y={steps:Array,stepIndex:{type:Number,default:void 0},showClose:{type:Boolean,default:!0},showDots:{type:Boolean,default:!0},scrollToTargetSwitch:{type:Boolean,default:!0},zIndex:{type:Number,default:1100},stepChange:{type:Function,default(){return!0}}};function b(i,o){const r=e.reactive(["devui-steps-guide"]),n=e.ref(null),l=e.reactive({left:"",top:"",zIndex:i.zIndex});return{stepsRef:n,guidePosition:l,guideClassList:r,updateGuidePosition:()=>{if(!o.value||!n.value)return;const m=window.pageYOffset-document.documentElement.clientTop,c=window.pageXOffset-document.documentElement.clientLeft,p=o.value.position,s=n.value;let d,u;if(typeof p!="string"){const{top:f=0,left:t=0,type:g="top"}=p;r.splice(1,1,g),d=t,u=f}else{r.splice(1,1,p);const f=o.value.target||o.value.trigger,t=document.querySelector(f);if(!t)return console.warn(`${f} \u4E0D\u5B58\u5728!`),!1;const g=t.getBoundingClientRect();d=g.left+t.clientWidth/2-s.clientWidth/2+c,u=g.top+t.clientHeight/2-s.clientHeight/2+m;const C=p.split("-");switch(C[0]){case"top":u+=-s.clientHeight/2-t.clientHeight;break;case"bottom":u+=s.clientHeight/2+t.clientHeight;break;case"left":u+=s.clientHeight/2-t.clientHeight,d+=-s.clientWidth/2-t.clientWidth/2;break;case"right":u+=s.clientHeight/2-t.clientHeight,d+=s.clientWidth/2+t.clientWidth/2;break}switch(C[1]){case"left":d+=s.clientWidth/2-t.clientWidth/2;break;case"right":d+=-s.clientWidth/2+t.clientWidth/2;break}}l.left=d+"px",l.top=u+"px",i.scrollToTargetSwitch&&typeof s.scrollIntoView=="function"&&e.nextTick(()=>{s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})})}}}function N(i,o,r,n){const l=e.computed(()=>i.steps.length),v=()=>{const c=n.value;n.value=-1,e.nextTick(()=>{o.emit("guide-close",c)})};return{stepsCount:l,closeGuide:v,setCurrentIndex:c=>{c!==-1&&i.stepChange()&&(c>-1&&c<l.value?(n.value=c,e.nextTick(()=>{r()})):console.error("stepIndex is not within the value range")),c===-1&&v()}}}var h=e.defineComponent({name:"DStepsGuide",props:y,emits:["guide-close","update:stepIndex"],setup(i,o){var f;const r=e.ref((f=i.stepIndex)!=null?f:0),n=e.computed({set:t=>{i.stepIndex!=null&&o.emit("update:stepIndex",t),r.value=t},get:()=>r.value}),l=e.computed(()=>{const t=i.steps[n.value];return t&&(t.position=t.position||"top"),t}),{stepsRef:v,guidePosition:m,guideClassList:c,updateGuidePosition:p}=b(i,l),{stepsCount:s,closeGuide:d,setCurrentIndex:u}=N(i,o,p,n);return e.onMounted(()=>{p()}),o.expose({closeGuide:d,setCurrentIndex:u}),()=>n.value>-1&&s.value>0?e.createVNode(e.Teleport,{to:"body"},{default:()=>[e.createVNode("div",{style:m,class:c,ref:v},[e.createVNode("div",{class:"devui-shining-dot"},null),e.createVNode("div",{class:"devui-shining-plus"},null),e.createVNode("div",{class:"devui-arrow"},null),e.createVNode("div",{class:"devui-guide-container"},[e.createVNode("p",{class:"devui-title"},[l.value.title]),i.showClose?e.createVNode("div",{class:"icon icon-close",onClick:d},null):null,e.createVNode("div",{class:"devui-content"},[l.value.content]),e.createVNode("div",{class:"devui-ctrl"},[i.showDots?e.createVNode("div",{class:"devui-dots"},[i.steps.map((t,g)=>e.createVNode("em",{class:["icon icon-dot-status",l.value===t?"devui-active":""],key:g},null))]):null,e.createVNode("div",{class:"devui-guide-btn"},[n.value>0?e.createVNode("div",{class:"devui-prev-step",onClick:()=>u(n.value-1)},["\u4E0A\u4E00\u6B65"]):null,n.value===s.value-1?e.createVNode("div",{onClick:d},["\u6211\u77E5\u9053\u5566"]):e.createVNode("div",{class:"devui-next-step",onClick:()=>{u(n.value+1)}},["\u6211\u77E5\u9053\u5566,\u7EE7\u7EED"])])])])])]}):null}}),V={mounted(i,o,r){},updated(i,o){}};h.install=function(i){i.component(h.name,h)};var w={title:"StepsGuide \u64CD\u4F5C\u6307\u5F15",category:"\u5BFC\u822A",status:"80%",install(i){i.use(h),i.directive("StepsGuide",V)}};a.StepsGuide=h,a.default=w,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});