vue-devui 1.0.0-rc.1 → 1.0.0-rc.12

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 (352) hide show
  1. package/README.md +70 -121
  2. package/alert/index.es.js +46 -15
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8204 -296
  6. package/auto-complete/index.umd.js +29 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +36 -5
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5727 -111
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +63 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8068 -255
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +213 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{anchor → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +59 -19
  29. package/countdown/index.umd.js +1 -1
  30. package/{anchor → date-picker-pro}/index.d.ts +0 -0
  31. package/date-picker-pro/index.es.js +10856 -0
  32. package/date-picker-pro/index.umd.js +27 -0
  33. package/{breadcrumb → date-picker-pro}/package.json +1 -1
  34. package/date-picker-pro/style.css +1 -0
  35. package/drawer/index.es.js +31 -4
  36. package/drawer/index.umd.js +1 -1
  37. package/drawer/style.css +1 -1
  38. package/dropdown/index.es.js +210 -149
  39. package/dropdown/index.umd.js +1 -1
  40. package/dropdown/style.css +1 -1
  41. package/editable-select/index.es.js +569 -159
  42. package/editable-select/index.umd.js +1 -1
  43. package/editable-select/style.css +1 -1
  44. package/form/index.es.js +1048 -1187
  45. package/form/index.umd.js +15 -15
  46. package/form/style.css +1 -1
  47. package/fullscreen/index.es.js +29 -5
  48. package/fullscreen/index.umd.js +1 -1
  49. package/fullscreen/style.css +1 -1
  50. package/grid/index.es.js +101 -86
  51. package/grid/index.umd.js +1 -1
  52. package/grid/style.css +1 -1
  53. package/icon/index.es.js +183 -23
  54. package/icon/index.umd.js +1 -1
  55. package/icon/style.css +1 -0
  56. package/image-preview/index.es.js +53 -30
  57. package/image-preview/index.umd.js +1 -1
  58. package/image-preview/style.css +1 -1
  59. package/input/index.es.js +8101 -144
  60. package/input/index.umd.js +27 -1
  61. package/input/style.css +1 -1
  62. package/input-number/index.es.js +274 -177
  63. package/input-number/index.umd.js +1 -1
  64. package/input-number/style.css +1 -1
  65. package/layout/index.es.js +40 -25
  66. package/layout/index.umd.js +1 -1
  67. package/layout/style.css +1 -1
  68. package/loading/index.es.js +74 -35
  69. package/loading/index.umd.js +1 -1
  70. package/loading/style.css +1 -1
  71. package/modal/index.es.js +375 -171
  72. package/modal/index.umd.js +1 -1
  73. package/modal/style.css +1 -1
  74. package/notification/index.es.js +293 -40
  75. package/notification/index.umd.js +1 -1
  76. package/notification/style.css +1 -1
  77. package/nuxt/components/ButtonGroup.js +3 -0
  78. package/nuxt/components/CheckboxButton.js +3 -0
  79. package/nuxt/components/CheckboxGroup.js +3 -0
  80. package/nuxt/components/Collapse.js +3 -0
  81. package/nuxt/components/CollapseItem.js +3 -0
  82. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  83. package/nuxt/components/DatePickerPro.js +3 -0
  84. package/nuxt/components/DropdownPropsKey.js +3 -0
  85. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  86. package/nuxt/components/FORM_TOKEN.js +3 -0
  87. package/nuxt/components/Icon.js +1 -0
  88. package/nuxt/components/IconGroup.js +3 -0
  89. package/nuxt/components/LABEL_DATA.js +3 -0
  90. package/nuxt/components/LoadingOptions.js +3 -0
  91. package/nuxt/components/Option.js +3 -0
  92. package/nuxt/components/OptionGroup.js +3 -0
  93. package/nuxt/components/RadioButton.js +3 -0
  94. package/nuxt/components/Step.js +3 -0
  95. package/nuxt/components/Steps.js +3 -0
  96. package/nuxt/components/TABLE_TOKEN.js +3 -0
  97. package/nuxt/components/Tab.js +3 -0
  98. package/nuxt/components/TimeSelect.js +3 -0
  99. package/nuxt/components/autoCompleteProps.js +3 -0
  100. package/nuxt/components/avatarProps.js +3 -0
  101. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  102. package/nuxt/components/buttonGroupProps.js +3 -0
  103. package/nuxt/components/cardProps.js +3 -0
  104. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  105. package/nuxt/components/checkboxGroupProps.js +3 -0
  106. package/nuxt/components/checkboxProps.js +3 -0
  107. package/nuxt/components/colProps.js +3 -0
  108. package/nuxt/components/colPropsBaseClass.js +3 -0
  109. package/nuxt/components/colPropsBaseStyle.js +3 -0
  110. package/nuxt/components/collapseItemProps.js +3 -0
  111. package/nuxt/components/collapseProps.js +3 -0
  112. package/nuxt/components/countdownProps.js +3 -0
  113. package/nuxt/components/datePickerProCommonProps.js +3 -0
  114. package/nuxt/components/datePickerProPanelProps.js +3 -0
  115. package/nuxt/components/datePickerProProps.js +3 -0
  116. package/nuxt/components/editableSelectProps.js +3 -0
  117. package/nuxt/components/formItemProps.js +3 -0
  118. package/nuxt/components/formProps.js +3 -0
  119. package/nuxt/components/iconProps.js +1 -0
  120. package/nuxt/components/imagePreviewProps.js +3 -0
  121. package/nuxt/components/inputProps.js +3 -0
  122. package/nuxt/components/loadingProps.js +3 -0
  123. package/nuxt/components/modalProps.js +3 -0
  124. package/nuxt/components/progressProps.js +3 -0
  125. package/nuxt/components/rateProps.js +3 -0
  126. package/nuxt/components/resultProps.js +3 -0
  127. package/nuxt/components/rowProps.js +3 -0
  128. package/nuxt/components/screenSizes.js +3 -0
  129. package/nuxt/components/skeletonProps.js +3 -0
  130. package/nuxt/components/sliderProps.js +3 -0
  131. package/nuxt/components/splitterProps.js +3 -0
  132. package/nuxt/components/statisticProps.js +3 -0
  133. package/nuxt/components/stepProps.js +3 -0
  134. package/nuxt/components/stepsProps.js +3 -0
  135. package/nuxt/components/svgIconProps.js +3 -0
  136. package/nuxt/components/switchProps.js +3 -0
  137. package/nuxt/components/tableProps.js +3 -0
  138. package/nuxt/components/tabsProps.js +3 -0
  139. package/nuxt/components/tagProps.js +3 -0
  140. package/nuxt/components/textareaProps.js +3 -0
  141. package/nuxt/components/timeAxisProps.js +3 -0
  142. package/nuxt/components/timerPickerPanelProps.js +3 -0
  143. package/nuxt/components/treeProps.js +3 -0
  144. package/overlay/index.es.js +104 -133
  145. package/overlay/index.umd.js +1 -1
  146. package/overlay/style.css +1 -1
  147. package/package.json +4 -2
  148. package/pagination/index.es.js +171 -141
  149. package/pagination/index.umd.js +1 -1
  150. package/pagination/style.css +1 -1
  151. package/panel/style.css +1 -1
  152. package/popover/index.es.js +294 -230
  153. package/popover/index.umd.js +15 -15
  154. package/popover/style.css +1 -1
  155. package/progress/index.es.js +110 -56
  156. package/progress/index.umd.js +3 -3
  157. package/progress/style.css +1 -1
  158. package/radio/index.es.js +7967 -146
  159. package/radio/index.umd.js +27 -1
  160. package/radio/style.css +1 -1
  161. package/rate/index.es.js +77 -55
  162. package/rate/index.umd.js +1 -1
  163. package/rate/style.css +1 -1
  164. package/result/index.es.js +170 -27
  165. package/result/index.umd.js +1 -1
  166. package/result/style.css +1 -1
  167. package/ripple/index.es.js +43 -42
  168. package/ripple/index.umd.js +1 -1
  169. package/search/index.es.js +3660 -1097
  170. package/search/index.umd.js +18 -18
  171. package/search/style.css +1 -1
  172. package/select/index.es.js +8998 -487
  173. package/select/index.umd.js +27 -1
  174. package/select/style.css +1 -1
  175. package/skeleton/index.es.js +46 -24
  176. package/skeleton/index.umd.js +1 -1
  177. package/skeleton/style.css +1 -1
  178. package/slider/index.es.js +144 -138
  179. package/slider/index.umd.js +1 -1
  180. package/slider/style.css +1 -1
  181. package/splitter/index.es.js +468 -340
  182. package/splitter/index.umd.js +16 -16
  183. package/splitter/style.css +1 -1
  184. package/statistic/index.es.js +41 -34
  185. package/statistic/index.umd.js +1 -1
  186. package/statistic/style.css +1 -1
  187. package/status/index.es.js +26 -2
  188. package/status/index.umd.js +1 -1
  189. package/status/style.css +1 -1
  190. package/{back-top → steps}/index.d.ts +0 -0
  191. package/steps/index.es.js +385 -0
  192. package/steps/index.umd.js +1 -0
  193. package/{gantt → steps}/package.json +1 -1
  194. package/steps/style.css +1 -0
  195. package/style.css +1 -1
  196. package/switch/index.es.js +7802 -64
  197. package/switch/index.umd.js +27 -1
  198. package/switch/style.css +1 -1
  199. package/table/index.es.js +10315 -1147
  200. package/table/index.umd.js +27 -1
  201. package/table/style.css +1 -1
  202. package/tabs/index.es.js +345 -142
  203. package/tabs/index.umd.js +1 -1
  204. package/tabs/style.css +1 -1
  205. package/tag/index.es.js +47 -23
  206. package/tag/index.umd.js +1 -1
  207. package/tag/style.css +1 -1
  208. package/textarea/index.es.js +7921 -83
  209. package/textarea/index.umd.js +35 -1
  210. package/textarea/style.css +1 -1
  211. package/time-picker/index.es.js +8704 -559
  212. package/time-picker/index.umd.js +27 -1
  213. package/time-picker/style.css +1 -1
  214. package/{breadcrumb → time-select}/index.d.ts +0 -0
  215. package/{color-picker → time-select}/index.es.js +4116 -2914
  216. package/time-select/index.umd.js +27 -0
  217. package/{back-top → time-select}/package.json +1 -1
  218. package/time-select/style.css +1 -0
  219. package/timeline/index.es.js +177 -37
  220. package/timeline/index.umd.js +1 -1
  221. package/timeline/style.css +1 -1
  222. package/tooltip/index.es.js +286 -221
  223. package/tooltip/index.umd.js +15 -15
  224. package/tooltip/style.css +1 -1
  225. package/tree/index.es.js +5325 -1855
  226. package/tree/index.umd.js +18 -18
  227. package/tree/style.css +1 -1
  228. package/upload/index.es.js +456 -133
  229. package/upload/index.umd.js +1 -1
  230. package/upload/style.css +1 -1
  231. package/vue-devui.es.js +14986 -16343
  232. package/vue-devui.umd.js +30 -20
  233. package/accordion/index.es.js +0 -723
  234. package/accordion/index.umd.js +0 -1
  235. package/accordion/package.json +0 -7
  236. package/accordion/style.css +0 -1
  237. package/anchor/index.es.js +0 -263
  238. package/anchor/index.umd.js +0 -1
  239. package/anchor/style.css +0 -1
  240. package/back-top/index.es.js +0 -130
  241. package/back-top/index.umd.js +0 -1
  242. package/back-top/style.css +0 -1
  243. package/breadcrumb/index.es.js +0 -128
  244. package/breadcrumb/index.umd.js +0 -1
  245. package/breadcrumb/style.css +0 -1
  246. package/carousel/index.d.ts +0 -7
  247. package/carousel/index.es.js +0 -314
  248. package/carousel/index.umd.js +0 -1
  249. package/carousel/package.json +0 -7
  250. package/carousel/style.css +0 -1
  251. package/cascader/index.d.ts +0 -7
  252. package/cascader/index.es.js +0 -5971
  253. package/cascader/index.umd.js +0 -27
  254. package/cascader/package.json +0 -7
  255. package/cascader/style.css +0 -1
  256. package/color-picker/index.d.ts +0 -7
  257. package/color-picker/index.umd.js +0 -27
  258. package/color-picker/package.json +0 -7
  259. package/color-picker/style.css +0 -1
  260. package/comment/index.d.ts +0 -7
  261. package/comment/index.es.js +0 -86
  262. package/comment/index.umd.js +0 -1
  263. package/comment/package.json +0 -7
  264. package/comment/style.css +0 -1
  265. package/date-picker/index.d.ts +0 -7
  266. package/date-picker/index.es.js +0 -1154
  267. package/date-picker/index.umd.js +0 -1
  268. package/date-picker/package.json +0 -7
  269. package/date-picker/style.css +0 -1
  270. package/dragdrop/index.d.ts +0 -7
  271. package/dragdrop/index.es.js +0 -157
  272. package/dragdrop/index.umd.js +0 -1
  273. package/dragdrop/package.json +0 -7
  274. package/gantt/index.d.ts +0 -7
  275. package/gantt/index.es.js +0 -523
  276. package/gantt/index.umd.js +0 -1
  277. package/gantt/style.css +0 -1
  278. package/input-icon/index.d.ts +0 -7
  279. package/input-icon/index.es.js +0 -332
  280. package/input-icon/index.umd.js +0 -1
  281. package/input-icon/package.json +0 -7
  282. package/input-icon/style.css +0 -1
  283. package/list/index.d.ts +0 -7
  284. package/list/index.es.js +0 -39
  285. package/list/index.umd.js +0 -1
  286. package/list/package.json +0 -7
  287. package/list/style.css +0 -1
  288. package/nav-sprite/index.d.ts +0 -7
  289. package/nav-sprite/index.es.js +0 -68
  290. package/nav-sprite/index.umd.js +0 -1
  291. package/nav-sprite/package.json +0 -7
  292. package/nuxt/components/Accordion.js +0 -3
  293. package/nuxt/components/Anchor.js +0 -3
  294. package/nuxt/components/BackTop.js +0 -3
  295. package/nuxt/components/Breadcrumb.js +0 -3
  296. package/nuxt/components/Carousel.js +0 -3
  297. package/nuxt/components/CarouselItem.js +0 -3
  298. package/nuxt/components/Cascader.js +0 -3
  299. package/nuxt/components/ColorPicker.js +0 -3
  300. package/nuxt/components/Comment.js +0 -3
  301. package/nuxt/components/DatePicker.js +0 -3
  302. package/nuxt/components/FormControl.js +0 -3
  303. package/nuxt/components/FormLabel.js +0 -3
  304. package/nuxt/components/Gantt.js +0 -3
  305. package/nuxt/components/InputIcon.js +0 -3
  306. package/nuxt/components/List.js +0 -3
  307. package/nuxt/components/ListItem.js +0 -3
  308. package/nuxt/components/NavSprite.js +0 -2
  309. package/nuxt/components/QuadrantDiagram.js +0 -3
  310. package/nuxt/components/ReadTip.js +0 -3
  311. package/nuxt/components/StepsGuide.js +0 -3
  312. package/nuxt/components/StickSlider.js +0 -3
  313. package/nuxt/components/Sticky.js +0 -2
  314. package/nuxt/components/TagInput.js +0 -3
  315. package/nuxt/components/Transfer.js +0 -3
  316. package/nuxt/components/TreeSelect.js +0 -3
  317. package/nuxt/components/overlayEmits.js +0 -3
  318. package/nuxt/components/overlayProps.js +0 -3
  319. package/quadrant-diagram/index.d.ts +0 -7
  320. package/quadrant-diagram/index.es.js +0 -5728
  321. package/quadrant-diagram/index.umd.js +0 -27
  322. package/quadrant-diagram/package.json +0 -7
  323. package/quadrant-diagram/style.css +0 -1
  324. package/read-tip/index.d.ts +0 -7
  325. package/read-tip/index.es.js +0 -261
  326. package/read-tip/index.umd.js +0 -1
  327. package/read-tip/package.json +0 -7
  328. package/read-tip/style.css +0 -1
  329. package/steps-guide/index.d.ts +0 -7
  330. package/steps-guide/index.es.js +0 -242
  331. package/steps-guide/index.umd.js +0 -1
  332. package/steps-guide/package.json +0 -7
  333. package/steps-guide/style.css +0 -1
  334. package/sticky/index.d.ts +0 -7
  335. package/sticky/index.es.js +0 -197
  336. package/sticky/index.umd.js +0 -1
  337. package/sticky/package.json +0 -7
  338. package/tag-input/index.d.ts +0 -7
  339. package/tag-input/index.es.js +0 -331
  340. package/tag-input/index.umd.js +0 -1
  341. package/tag-input/package.json +0 -7
  342. package/tag-input/style.css +0 -1
  343. package/transfer/index.d.ts +0 -7
  344. package/transfer/index.es.js +0 -7615
  345. package/transfer/index.umd.js +0 -27
  346. package/transfer/package.json +0 -7
  347. package/transfer/style.css +0 -1
  348. package/tree-select/index.d.ts +0 -7
  349. package/tree-select/index.es.js +0 -627
  350. package/tree-select/index.umd.js +0 -1
  351. package/tree-select/package.json +0 -7
  352. package/tree-select/style.css +0 -1
@@ -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, ref, computed, onMounted, watch, createVNode, mergeProps, createTextVNode } from "vue";
7
+ import { defineComponent, ref, computed, onMounted, watch, createVNode, createTextVNode } from "vue";
8
8
  const statisticProps = {
9
9
  title: {
10
10
  type: String,
@@ -26,9 +26,6 @@ const statisticProps = {
26
26
  type: String,
27
27
  default: ""
28
28
  },
29
- valueStyle: {
30
- type: Object
31
- },
32
29
  animationDuration: {
33
30
  type: Number,
34
31
  default: 2e3
@@ -61,9 +58,10 @@ const isHasDot = (value) => {
61
58
  if (!isNaN(value)) {
62
59
  return (value + "").indexOf(".") !== -1;
63
60
  }
61
+ return false;
64
62
  };
65
63
  const analysisValueType = (value, propsValue, groupSeparator, splitPrecisionNumber) => {
66
- const fixedNumber = propsValue.toString().indexOf(".") !== -1 ? propsValue.toString().length - propsValue.toString().indexOf(".") - 1 : 0;
64
+ const fixedNumber = (propsValue == null ? void 0 : propsValue.toString().indexOf(".")) !== -1 ? (propsValue == null ? void 0 : propsValue.toString().length) - (propsValue == null ? void 0 : propsValue.toString().indexOf(".")) - 1 : 0;
67
65
  if (typeof value === "number") {
68
66
  if (isHasDot(value)) {
69
67
  return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator) : separator(value.toFixed(fixedNumber).toString(), groupSeparator);
@@ -92,16 +90,7 @@ const easeInExpo = function(x) {
92
90
  const easeInOutCirc = function(x) {
93
91
  return x < 0.5 ? (1 - sqrt(1 - pow(2 * x, 2))) / 2 : (sqrt(1 - pow(-2 * x + 2, 2)) + 1) / 2;
94
92
  };
95
- var easing = /* @__PURE__ */ Object.freeze({
96
- __proto__: null,
97
- [Symbol.toStringTag]: "Module",
98
- easeOutCubic,
99
- linear,
100
- easeOutExpo,
101
- easeInOutExpo,
102
- easeInExpo,
103
- easeInOutCirc
104
- });
93
+ var easing = { easeOutCubic, linear, easeOutExpo, easeInOutExpo, easeInExpo, easeInOutCirc };
105
94
  class Tween {
106
95
  constructor(options) {
107
96
  __publicField(this, "from");
@@ -119,7 +108,7 @@ class Tween {
119
108
  __publicField(this, "time");
120
109
  __publicField(this, "elapsed");
121
110
  __publicField(this, "keys");
122
- const { from, to, duration, delay, easing: easing2, onStart, onUpdate, onFinish } = options;
111
+ const { from, to, duration, delay, easing: easingValue, onStart, onUpdate, onFinish } = options;
123
112
  for (const key in from) {
124
113
  if (to[key] === void 0) {
125
114
  to[key] = from[key];
@@ -134,7 +123,7 @@ class Tween {
134
123
  this.to = to;
135
124
  this.duration = duration;
136
125
  this.delay = delay;
137
- this.easing = easing2;
126
+ this.easing = easingValue;
138
127
  this.onStart = onStart;
139
128
  this.onUpdate = onUpdate;
140
129
  this.onFinish = onFinish;
@@ -187,15 +176,38 @@ class Tween {
187
176
  this.timer = null;
188
177
  }
189
178
  }
179
+ function createBem(namespace, element, modifier) {
180
+ let cls = namespace;
181
+ if (element) {
182
+ cls += `__${element}`;
183
+ }
184
+ if (modifier) {
185
+ cls += `--${modifier}`;
186
+ }
187
+ return cls;
188
+ }
189
+ function useNamespace(block, needDot = false) {
190
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
191
+ const b = () => createBem(namespace);
192
+ const e = (element) => element ? createBem(namespace, element) : "";
193
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
194
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
195
+ return {
196
+ b,
197
+ e,
198
+ m,
199
+ em
200
+ };
201
+ }
190
202
  var statistic = "";
191
203
  var Statistic = defineComponent({
192
204
  name: "DStatistic",
193
- inheritAttrs: false,
194
205
  props: statisticProps,
195
206
  setup(props, ctx) {
196
207
  var _a;
197
208
  const innerValue = ref((_a = props.valueFrom) != null ? _a : props.value);
198
209
  const tween = ref(null);
210
+ const ns = useNamespace("statistic");
199
211
  const animation = (from = ((_b) => (_b = props.valueFrom) != null ? _b : 0)(), to = typeof props.value === "number" ? props.value : Number(props.value)) => {
200
212
  if (from !== to) {
201
213
  tween.value = new Tween({
@@ -233,35 +245,30 @@ var Statistic = defineComponent({
233
245
  });
234
246
  return () => {
235
247
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
236
- return createVNode("div", mergeProps({
237
- "class": "devui-statistic"
238
- }, ctx.attrs), [createVNode("div", {
239
- "class": "devui-statistic-title",
240
- "style": props.titleStyle
248
+ return createVNode("div", {
249
+ "class": ns.b()
250
+ }, [createVNode("div", {
251
+ "class": ns.e("title")
241
252
  }, [((_b = (_a2 = ctx.slots).title) == null ? void 0 : _b.call(_a2)) || props.title]), createVNode("div", {
242
- "class": "devui-statistic-content",
243
- "style": props.valueStyle
253
+ "class": ns.e("content")
244
254
  }, [props.prefix || ((_d = (_c = ctx.slots).prefix) == null ? void 0 : _d.call(_c)) ? createVNode("span", {
245
- "class": "devui-statistic-prefix"
255
+ "class": ns.e("prefix")
246
256
  }, [((_f = (_e = ctx.slots).prefix) == null ? void 0 : _f.call(_e)) || props.prefix]) : null, createVNode("span", {
247
- "class": "devui-statistic--value"
257
+ "class": ns.e("value")
248
258
  }, [statisticValue.value]), props.suffix || ((_h = (_g = ctx.slots).suffix) == null ? void 0 : _h.call(_g)) ? createVNode("span", {
249
- "class": "devui-statistic-suffix"
259
+ "class": ns.e("suffix")
250
260
  }, [((_j = (_i = ctx.slots).suffix) == null ? void 0 : _j.call(_i)) || props.suffix]) : null]), props.extra || ((_l = (_k = ctx.slots).extra) == null ? void 0 : _l.call(_k)) ? createVNode("div", {
251
- "class": "devui-statistic-extra"
261
+ "class": ns.e("extra")
252
262
  }, [createTextVNode(" "), ((_n = (_m = ctx.slots).extra) == null ? void 0 : _n.call(_m)) || props.extra]) : null]);
253
263
  };
254
264
  }
255
265
  });
256
- Statistic.install = function(app) {
257
- app.component(Statistic.name, Statistic);
258
- };
259
266
  var index = {
260
267
  title: "Statistic \u7EDF\u8BA1\u6570\u503C",
261
268
  category: "\u6570\u636E\u5C55\u793A",
262
269
  status: "100%",
263
270
  install(app) {
264
- app.use(Statistic);
271
+ app.component(Statistic.name, Statistic);
265
272
  }
266
273
  };
267
- export { Statistic, index as default };
274
+ export { Statistic, index as default, statisticProps };
@@ -1 +1 @@
1
- var $=Object.defineProperty;var z=(a,e,f)=>e in a?$(a,e,{enumerable:!0,configurable:!0,writable:!0,value:f}):a[e]=f;var n=(a,e,f)=>(z(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:""},valueStyle:{type:Object},animationDuration:{type:Number,default:2e3},valueFrom:{type:Number},animation:{type:Boolean,default:!1},start:{type:Boolean,default:!0},extra:{type:String,default:""}},y=(t,i)=>t.replace(/\d+/,function(s){return s.replace(/(\d)(?=(\d{3})+$)/g,function(l){return l+`${i}`})}),C=t=>{if(!isNaN(t))return(t+"").indexOf(".")!==-1},D=(t,i,r,s)=>{const l=i.toString().indexOf(".")!==-1?i.toString().length-i.toString().indexOf(".")-1:0;return typeof t=="number"?C(t)?y(s?t.toFixed(s).toString():t.toFixed(l).toString(),r):y(s?t.toFixed(s).toString():t.toString(),r):t},c=Math.pow,v=Math.sqrt,E=function(t){return 1-c(1-t,3)},A=t=>t,I=function(t){return t===1?1:1-c(2,-10*t)},M=function(t){return t===0?0:t===1?1:t<.5?c(2,20*t-10)/2:(2-c(2,-20*t+10))/2},_=function(t){return t===0?0:c(2,10*t-10)},U=function(t){return t<.5?(1-v(1-c(2*t,2)))/2:(v(1-c(-2*t+2,2))+1)/2};var j=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",easeOutCubic:E,linear:A,easeOutExpo:I,easeInOutExpo:M,easeInExpo:_,easeInOutCirc:U});class q{constructor(i){n(this,"from");n(this,"to");n(this,"duration");n(this,"delay");n(this,"easing");n(this,"onStart");n(this,"onUpdate");n(this,"onFinish");n(this,"startTime");n(this,"started");n(this,"finished");n(this,"timer");n(this,"time");n(this,"elapsed");n(this,"keys");const{from:r,to:s,duration:l,delay:g,easing:S,onStart:u,onUpdate:d,onFinish:h}=i;for(const o in r)s[o]===void 0&&(s[o]=r[o]);for(const o in s)r[o]===void 0&&(r[o]=s[o]);this.from=r,this.to=s,this.duration=l,this.delay=g,this.easing=S,this.onStart=u,this.onUpdate=d,this.onFinish=h,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])*j[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 H="",m=e.defineComponent({name:"DStatistic",inheritAttrs:!1,props:f,setup(t,i){var S;const r=e.ref((S=t.valueFrom)!=null?S:t.value),s=e.ref(null),l=(u=(h=>(h=t.valueFrom)!=null?h:0)(),d=typeof t.value=="number"?t.value:Number(t.value))=>{u!==d&&(s.value=new q({from:{value:u},to:{value:d},delay:0,duration:t.animationDuration,easing:"easeOutCubic",onUpdate:o=>{r.value=o.value},onFinish:()=>{r.value=d}}),s.value.start())},g=e.computed(()=>D(r.value,t.value,t.groupSeparator,t.precision));return e.onMounted(()=>{t.animation&&t.start&&l()}),e.watch(()=>t.start,u=>{u&&!s.value&&l()}),()=>{var u,d,h,o,x,F,p,O,b,N,T,k,V,w;return e.createVNode("div",e.mergeProps({class:"devui-statistic"},i.attrs),[e.createVNode("div",{class:"devui-statistic-title",style:t.titleStyle},[((d=(u=i.slots).title)==null?void 0:d.call(u))||t.title]),e.createVNode("div",{class:"devui-statistic-content",style:t.valueStyle},[t.prefix||((o=(h=i.slots).prefix)==null?void 0:o.call(h))?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"},[g.value]),t.suffix||((O=(p=i.slots).suffix)==null?void 0:O.call(p))?e.createVNode("span",{class:"devui-statistic-suffix"},[((N=(b=i.slots).suffix)==null?void 0:N.call(b))||t.suffix]):null]),t.extra||((k=(T=i.slots).extra)==null?void 0:k.call(T))?e.createVNode("div",{class:"devui-statistic-extra"},[e.createTextVNode(" "),((w=(V=i.slots).extra)==null?void 0:w.call(V))||t.extra]):null])}}});m.install=function(t){t.component(m.name,m)};var B={title:"Statistic \u7EDF\u8BA1\u6570\u503C",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(m)}};a.Statistic=m,a.default=B,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
1
+ var _=Object.defineProperty;var j=(a,i,c)=>i in a?_(a,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[i]=c;var r=(a,i,c)=>(j(a,typeof i!="symbol"?i+"":i,c),c);(function(a,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(a=typeof globalThis!="undefined"?globalThis:a||self,i(a.index={},a.Vue))})(this,function(a,i){"use strict";const c={title:{type:String,default:""},value:{type:[Number,String]},prefix:{type:String},suffix:{type:String},precision:{type:Number},groupSeparator:{type:String,default:""},animationDuration:{type:Number,default:2e3},valueFrom:{type:Number},animation:{type:Boolean,default:!1},start:{type:Boolean,default:!0},extra:{type:String,default:""}},y=(t,e)=>t.replace(/\d+/,function(s){return s.replace(/(\d)(?=(\d{3})+$)/g,function(o){return o+`${e}`})}),$=t=>isNaN(t)?!1:(t+"").indexOf(".")!==-1,A=(t,e,n,s)=>{const o=(e==null?void 0:e.toString().indexOf("."))!==-1?(e==null?void 0:e.toString().length)-(e==null?void 0:e.toString().indexOf("."))-1:0;return typeof t=="number"?$(t)?y(s?t.toFixed(s).toString():t.toFixed(o).toString(),n):y(s?t.toFixed(s).toString():t.toString(),n):t},l=Math.pow,v=Math.sqrt;var M={easeOutCubic:function(t){return 1-l(1-t,3)},linear:t=>t,easeOutExpo:function(t){return t===1?1:1-l(2,-10*t)},easeInOutExpo:function(t){return t===0?0:t===1?1:t<.5?l(2,20*t-10)/2:(2-l(2,-20*t+10))/2},easeInExpo:function(t){return t===0?0:l(2,10*t-10)},easeInOutCirc:function(t){return t<.5?(1-v(1-l(2*t,2)))/2:(v(1-l(-2*t+2,2))+1)/2}};class U{constructor(e){r(this,"from");r(this,"to");r(this,"duration");r(this,"delay");r(this,"easing");r(this,"onStart");r(this,"onUpdate");r(this,"onFinish");r(this,"startTime");r(this,"started");r(this,"finished");r(this,"timer");r(this,"time");r(this,"elapsed");r(this,"keys");const{from:n,to:s,duration:o,delay:m,easing:S,onStart:u,onUpdate:f,onFinish:h}=e;for(const d in n)s[d]===void 0&&(s[d]=n[d]);for(const d in s)n[d]===void 0&&(n[d]=s[d]);this.from=n,this.to=s,this.duration=o,this.delay=m,this.easing=S,this.onStart=u,this.onUpdate=f,this.onFinish=h,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 e in this.to)this.keys[e]=this.from[e]+(this.to[e]-this.from[e])*M[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 e=()=>{this.update(),this.timer=requestAnimationFrame(e),this.finished&&(cancelAnimationFrame(this.timer),this.timer=null)};e()}stop(){cancelAnimationFrame(this.timer),this.timer=null}}function g(t,e,n){let s=t;return e&&(s+=`__${e}`),n&&(s+=`--${n}`),s}function q(t,e=!1){const n=e?`.devui-${t}`:`devui-${t}`;return{b:()=>g(n),e:u=>u?g(n,u):"",m:u=>u?g(n,"",u):"",em:(u,f)=>u&&f?g(n,u,f):""}}var P="",F=i.defineComponent({name:"DStatistic",props:c,setup(t,e){var u;const n=i.ref((u=t.valueFrom)!=null?u:t.value),s=i.ref(null),o=q("statistic"),m=(f=(d=>(d=t.valueFrom)!=null?d:0)(),h=typeof t.value=="number"?t.value:Number(t.value))=>{f!==h&&(s.value=new U({from:{value:f},to:{value:h},delay:0,duration:t.animationDuration,easing:"easeOutCubic",onUpdate:x=>{n.value=x.value},onFinish:()=>{n.value=h}}),s.value.start())},S=i.computed(()=>A(n.value,t.value,t.groupSeparator,t.precision));return i.onMounted(()=>{t.animation&&t.start&&m()}),i.watch(()=>t.start,f=>{f&&!s.value&&m()}),()=>{var f,h,d,x,N,O,b,T,k,w,C,D,E,I;return i.createVNode("div",{class:o.b()},[i.createVNode("div",{class:o.e("title")},[((h=(f=e.slots).title)==null?void 0:h.call(f))||t.title]),i.createVNode("div",{class:o.e("content")},[t.prefix||((x=(d=e.slots).prefix)==null?void 0:x.call(d))?i.createVNode("span",{class:o.e("prefix")},[((O=(N=e.slots).prefix)==null?void 0:O.call(N))||t.prefix]):null,i.createVNode("span",{class:o.e("value")},[S.value]),t.suffix||((T=(b=e.slots).suffix)==null?void 0:T.call(b))?i.createVNode("span",{class:o.e("suffix")},[((w=(k=e.slots).suffix)==null?void 0:w.call(k))||t.suffix]):null]),t.extra||((D=(C=e.slots).extra)==null?void 0:D.call(C))?i.createVNode("div",{class:o.e("extra")},[i.createTextVNode(" "),((I=(E=e.slots).extra)==null?void 0:I.call(E))||t.extra]):null])}}}),B={title:"Statistic \u7EDF\u8BA1\u6570\u503C",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(F.name,F)}};a.Statistic=F,a.default=B,a.statisticProps=c,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
@@ -1 +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;font-size:14px}.devui-statistic-content{font-size:24px;display:flex;align-items:center}.devui-statistic-prefix{margin-right:6px;display:flex;align-items:center}.devui-statistic-suffix{margin-left:6px;display:flex;align-items:center}.devui-statistic--value{display:inline-block}
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;font-size:14px}.devui-statistic__content{font-size:24px;display:flex;align-items:center}.devui-statistic__prefix{margin-right:6px;display:flex;align-items:center}.devui-statistic__suffix{margin-left:6px;display:flex;align-items:center}.devui-statistic__value{display:inline-block}
@@ -1,4 +1,27 @@
1
1
  import { defineComponent, computed, createVNode } from "vue";
2
+ function createBem(namespace, element, modifier) {
3
+ let cls = namespace;
4
+ if (element) {
5
+ cls += `__${element}`;
6
+ }
7
+ if (modifier) {
8
+ cls += `--${modifier}`;
9
+ }
10
+ return cls;
11
+ }
12
+ function useNamespace(block, needDot = false) {
13
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
14
+ const b = () => createBem(namespace);
15
+ const e = (element) => element ? createBem(namespace, element) : "";
16
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
17
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
18
+ return {
19
+ b,
20
+ e,
21
+ m,
22
+ em
23
+ };
24
+ }
2
25
  var status = "";
3
26
  var Status = defineComponent({
4
27
  name: "DStatus",
@@ -9,14 +32,15 @@ var Status = defineComponent({
9
32
  }
10
33
  },
11
34
  setup(props, ctx) {
35
+ const ns = useNamespace("status");
12
36
  const typeClass = computed(() => {
13
37
  const {
14
38
  type
15
39
  } = props;
16
40
  const typeStatus = ["success", "error", "initial", "warning", "waiting", "running", "invalid"];
17
- let typeClassStr = `devui-status devui-status-bg-invalid`;
41
+ let typeClassStr = `${ns.b()} ${ns.em("bg", "invalid")}`;
18
42
  if (typeStatus.includes(type)) {
19
- typeClassStr = `devui-status devui-status-bg-${type}`;
43
+ typeClassStr = `${ns.b()} ${ns.em("bg", type)}`;
20
44
  }
21
45
  return typeClassStr;
22
46
  });
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){"use strict";var l="",s=t.defineComponent({name:"DStatus",props:{type:{default:"invalid",type:String}},setup(i,o){const r=t.computed(()=>{const{type:n}=i,u=["success","error","initial","warning","waiting","running","invalid"];let a="devui-status devui-status-bg-invalid";return u.includes(n)&&(a=`devui-status devui-status-bg-${n}`),a});return()=>{var n,u;return t.createVNode("span",{class:r.value},[(u=(n=o.slots).default)==null?void 0:u.call(n)])}}}),d={title:"Status \u72B6\u6001",category:"\u901A\u7528",status:"100%",install(i){i.component(s.name,s)}};e.Status=s,e.default=d,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"});
1
+ (function(t,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(t=typeof globalThis!="undefined"?globalThis:t||self,u(t.index={},t.Vue))})(this,function(t,u){"use strict";function r(n,a,e){let i=n;return a&&(i+=`__${a}`),e&&(i+=`--${e}`),i}function f(n,a=!1){const e=a?`.devui-${n}`:`devui-${n}`;return{b:()=>r(e),e:s=>s?r(e,s):"",m:s=>s?r(e,"",s):"",em:(s,p)=>s&&p?r(e,s,p):""}}var y="",d=u.defineComponent({name:"DStatus",props:{type:{default:"invalid",type:String}},setup(n,a){const e=f("status"),i=u.computed(()=>{const{type:o}=n,c=["success","error","initial","warning","waiting","running","invalid"];let l=`${e.b()} ${e.em("bg","invalid")}`;return c.includes(o)&&(l=`${e.b()} ${e.em("bg",o)}`),l});return()=>{var o,c;return u.createVNode("span",{class:i.value},[(c=(o=a.slots).default)==null?void 0:c.call(o)])}}}),m={title:"Status \u72B6\u6001",category:"\u901A\u7528",status:"100%",install(n){n.component(d.name,d)}};t.Status=d,t.default=m,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"});
package/status/style.css CHANGED
@@ -1 +1 @@
1
- .devui-status{line-height:20px;height:20px;display:flex;align-items:center}.devui-status:before{display:inline-block;content:"";width:10px;height:10px;margin-right:5px;border-radius:100%}.devui-status.devui-status-bg-success:before{background-color:var(--devui-success, #50d4ab)}.devui-status.devui-status-bg-error:before{background-color:var(--devui-danger, #f66f6a)}.devui-status.devui-status-bg-warning:before{background-color:var(--devui-warning, #fac20a)}.devui-status.devui-status-bg-initial:before{background-color:var(--devui-initial, #e9edfa)}.devui-status.devui-status-bg-waiting:before{background-color:var(--devui-waiting, #9faad7)}.devui-status.devui-status-bg-running:before{background-color:var(--devui-info, #5e7ce0)}.devui-status.devui-status-bg-invalid:before{background-color:var(--devui-dividing-line, #dfe1e6)}
1
+ .devui-status{line-height:20px;height:20px;display:flex;align-items:center}.devui-status:before{display:inline-block;content:"";width:10px;height:10px;margin-right:5px;border-radius:100%}.devui-status.devui-status__bg--success:before{background-color:var(--devui-success, #50d4ab)}.devui-status.devui-status__bg--error:before{background-color:var(--devui-danger, #f66f6a)}.devui-status.devui-status__bg--warning:before{background-color:var(--devui-warning, #fac20a)}.devui-status.devui-status__bg--initial:before{background-color:var(--devui-initial, #e9edfa)}.devui-status.devui-status__bg--waiting:before{background-color:var(--devui-waiting, #9faad7)}.devui-status.devui-status__bg--running:before{background-color:var(--devui-info, #5e7ce0)}.devui-status.devui-status__bg--invalid:before{background-color:var(--devui-dividing-line, #f2f2f3)}
File without changes
@@ -0,0 +1,385 @@
1
+ import { defineComponent, toRefs, ref, provide, watch, computed, createVNode, resolveDynamicComponent, mergeProps, getCurrentInstance, inject, Fragment } from "vue";
2
+ const stepsProps = {
3
+ modelValue: {
4
+ type: Number,
5
+ default: 0
6
+ },
7
+ space: {
8
+ type: Number
9
+ },
10
+ alignCenter: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ direction: {
15
+ type: String,
16
+ default: "horizontal"
17
+ },
18
+ simple: {
19
+ type: Boolean,
20
+ default: false
21
+ }
22
+ };
23
+ function createBem(namespace, element, modifier) {
24
+ let cls = namespace;
25
+ if (element) {
26
+ cls += `__${element}`;
27
+ }
28
+ if (modifier) {
29
+ cls += `--${modifier}`;
30
+ }
31
+ return cls;
32
+ }
33
+ function useNamespace(block, needDot = false) {
34
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
35
+ const b = () => createBem(namespace);
36
+ const e = (element) => element ? createBem(namespace, element) : "";
37
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
38
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
39
+ return {
40
+ b,
41
+ e,
42
+ m,
43
+ em
44
+ };
45
+ }
46
+ var steps = "";
47
+ const ACTIVE_STEP = "active-step";
48
+ const STEPS = "steps";
49
+ const STEPS_PROPS = "steps-props";
50
+ var Steps = defineComponent({
51
+ name: "DSteps",
52
+ props: stepsProps,
53
+ emits: ["update:modelValue"],
54
+ setup(props, {
55
+ slots
56
+ }) {
57
+ const {
58
+ modelValue,
59
+ direction,
60
+ simple
61
+ } = toRefs(props);
62
+ const ns = useNamespace("steps");
63
+ const activeStep = ref(modelValue.value);
64
+ provide(ACTIVE_STEP, activeStep);
65
+ provide(STEPS_PROPS, props);
66
+ const steps2 = ref([]);
67
+ provide(STEPS, steps2);
68
+ watch(modelValue, (newVal) => {
69
+ activeStep.value = newVal;
70
+ });
71
+ const stepsClass = computed(() => {
72
+ const directionClass = direction.value === "vertical" ? " vertical" : "";
73
+ const simpleClass = simple.value ? " simple" : "";
74
+ return `${ns.b()}${directionClass}${simpleClass}`;
75
+ });
76
+ return () => {
77
+ var _a;
78
+ return createVNode("div", {
79
+ "class": stepsClass.value
80
+ }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
81
+ };
82
+ }
83
+ });
84
+ const stepProps = {
85
+ title: {
86
+ type: String,
87
+ required: true
88
+ },
89
+ description: {
90
+ type: String
91
+ },
92
+ icon: {
93
+ type: String
94
+ },
95
+ status: {
96
+ type: String
97
+ }
98
+ };
99
+ const DEFAULT_PREFIX = "icon";
100
+ const iconProps = {
101
+ name: {
102
+ type: String,
103
+ default: "",
104
+ required: true
105
+ },
106
+ size: {
107
+ type: [Number, String],
108
+ default: "inherit"
109
+ },
110
+ color: {
111
+ type: String,
112
+ default: "inherit"
113
+ },
114
+ component: {
115
+ type: Object,
116
+ default: null
117
+ },
118
+ classPrefix: {
119
+ type: String,
120
+ default: DEFAULT_PREFIX
121
+ },
122
+ operable: {
123
+ type: Boolean,
124
+ default: false
125
+ },
126
+ disabled: {
127
+ type: Boolean,
128
+ default: false
129
+ },
130
+ rotate: {
131
+ type: [Number, String]
132
+ }
133
+ };
134
+ const svgIconProps = {
135
+ name: {
136
+ type: String,
137
+ default: "",
138
+ required: true
139
+ },
140
+ color: {
141
+ type: String,
142
+ default: "inherit"
143
+ },
144
+ size: {
145
+ type: [Number, String],
146
+ default: "inherit"
147
+ }
148
+ };
149
+ var icon = "";
150
+ var svgIcon = defineComponent({
151
+ name: "DSvgIcon",
152
+ props: svgIconProps,
153
+ setup(props) {
154
+ const {
155
+ name,
156
+ color,
157
+ size
158
+ } = toRefs(props);
159
+ const ns = useNamespace("svg-icon");
160
+ const iconName = computed(() => `#icon-${name.value}`);
161
+ const iconSize = computed(() => {
162
+ return typeof size.value === "number" ? `${size.value}px` : size.value;
163
+ });
164
+ const styles = {
165
+ width: iconSize.value,
166
+ height: iconSize.value
167
+ };
168
+ return () => {
169
+ return createVNode("svg", {
170
+ "class": ns.b(),
171
+ "style": styles
172
+ }, [createVNode("use", {
173
+ "xlink:href": iconName.value,
174
+ "fill": color.value
175
+ }, null)]);
176
+ };
177
+ }
178
+ });
179
+ function isUrl(value) {
180
+ return /^((http|https):)?\/\//.test(value);
181
+ }
182
+ function useIconDom(props, ctx) {
183
+ const {
184
+ component,
185
+ name,
186
+ size,
187
+ color,
188
+ classPrefix,
189
+ rotate
190
+ } = toRefs(props);
191
+ const ns = useNamespace("icon");
192
+ const iconSize = computed(() => {
193
+ return typeof size.value === "number" ? `${size.value}px` : size.value;
194
+ });
195
+ const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
196
+ const imgIconDom = () => {
197
+ return createVNode("img", mergeProps({
198
+ "src": name.value,
199
+ "alt": name.value.split("/")[name.value.split("/").length - 1],
200
+ "class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
201
+ "style": {
202
+ width: iconSize.value || "",
203
+ transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
204
+ }
205
+ }, ctx.attrs), null);
206
+ };
207
+ const svgIconDom = () => {
208
+ return createVNode(IconComponent, mergeProps({
209
+ "name": name.value,
210
+ "color": color.value,
211
+ "size": iconSize.value,
212
+ "class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
213
+ "style": {
214
+ transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
215
+ }
216
+ }, ctx.attrs), null);
217
+ };
218
+ const fontIconDom = () => {
219
+ const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
220
+ return createVNode("i", mergeProps({
221
+ "class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
222
+ "style": {
223
+ fontSize: iconSize.value,
224
+ color: color.value,
225
+ transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
226
+ }
227
+ }, ctx.attrs), null);
228
+ };
229
+ const iconDom = () => {
230
+ return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
231
+ };
232
+ return {
233
+ iconDom
234
+ };
235
+ }
236
+ var Icon = defineComponent({
237
+ name: "DIcon",
238
+ props: iconProps,
239
+ emits: ["click"],
240
+ setup(props, ctx) {
241
+ const {
242
+ disabled,
243
+ operable
244
+ } = toRefs(props);
245
+ const {
246
+ iconDom
247
+ } = useIconDom(props, ctx);
248
+ const ns = useNamespace("icon");
249
+ const wrapClassed = computed(() => ({
250
+ [ns.e("container")]: true,
251
+ [ns.m("disabled")]: disabled.value,
252
+ [ns.m("operable")]: operable.value
253
+ }));
254
+ const onClick = (e) => {
255
+ if (disabled.value) {
256
+ return;
257
+ }
258
+ ctx.emit("click", e);
259
+ };
260
+ return () => {
261
+ var _a, _b, _c, _d;
262
+ return createVNode("div", {
263
+ "class": wrapClassed.value,
264
+ "onClick": onClick
265
+ }, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
266
+ };
267
+ }
268
+ });
269
+ var iconGroup = "";
270
+ defineComponent({
271
+ name: "DIconGroup",
272
+ setup(_, ctx) {
273
+ const ns = useNamespace("icon-group");
274
+ return () => {
275
+ var _a, _b;
276
+ return createVNode("div", {
277
+ "class": ns.b()
278
+ }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
279
+ };
280
+ }
281
+ });
282
+ var step = "";
283
+ var Step = defineComponent({
284
+ name: "DStep",
285
+ props: stepProps,
286
+ setup(props, {
287
+ slots
288
+ }) {
289
+ const {
290
+ title,
291
+ description,
292
+ icon: icon2,
293
+ status
294
+ } = toRefs(props);
295
+ const ns = useNamespace("step");
296
+ const instance = getCurrentInstance();
297
+ const activeStep = inject(ACTIVE_STEP);
298
+ const steps2 = inject(STEPS);
299
+ steps2.value.push(instance);
300
+ const stepsProps2 = inject(STEPS_PROPS);
301
+ const currentStepIndex = steps2.value.indexOf(instance);
302
+ const stepClass = computed(() => {
303
+ const activeClass = activeStep.value === currentStepIndex ? " active" : "";
304
+ const finishedClass = activeStep.value > currentStepIndex ? " finished" : "";
305
+ const centerClass = stepsProps2.alignCenter ? " center" : "";
306
+ const statusClass = (status == null ? void 0 : status.value) ? ` ${status == null ? void 0 : status.value}` : "";
307
+ const simpleClass = stepsProps2.simple ? ` ${ns.m("simple")}` : "";
308
+ return `${ns.b()}${activeClass}${finishedClass}${centerClass}${statusClass}${simpleClass}`;
309
+ });
310
+ const stepStyle = computed(() => {
311
+ const styleObj = {};
312
+ if (stepsProps2.space) {
313
+ styleObj.width = `${stepsProps2.space}px`;
314
+ } else {
315
+ styleObj.flexBasis = stepsProps2.alignCenter || stepsProps2.simple ? `${100 / steps2.value.length}%` : `${100 / (steps2.value.length - 1)}%`;
316
+ }
317
+ return styleObj;
318
+ });
319
+ const iconColor = computed(() => {
320
+ const isActive = activeStep.value === currentStepIndex;
321
+ const isFinished = activeStep.value > currentStepIndex;
322
+ return isActive ? "var(--devui-brand)" : isFinished ? "var(--devui-success)" : "var(--devui-placeholder)";
323
+ });
324
+ const statusMap = {
325
+ finish: createVNode(Icon, {
326
+ "name": "right-o",
327
+ "color": "var(--devui-success)",
328
+ "size": "24px"
329
+ }, null),
330
+ success: createVNode(Icon, {
331
+ "name": "right-o",
332
+ "color": "var(--devui-success)",
333
+ "size": "24px"
334
+ }, null),
335
+ error: createVNode(Icon, {
336
+ "name": "error-o",
337
+ "color": "var(--devui-danger)",
338
+ "size": "24px"
339
+ }, null)
340
+ };
341
+ const renderDot = () => {
342
+ var _a;
343
+ return slots.icon ? (_a = slots.icon) == null ? void 0 : _a.call(slots, iconColor.value) : icon2.value ? createVNode(Icon, {
344
+ "name": icon2.value,
345
+ "color": iconColor.value,
346
+ "size": "24px"
347
+ }, null) : status.value && statusMap[status.value] ? statusMap[status.value] : activeStep.value > steps2.value.indexOf(instance) ? createVNode(Icon, {
348
+ "name": "right-o",
349
+ "color": "var(--devui-success)",
350
+ "size": "24px"
351
+ }, null) : createVNode("span", {
352
+ "class": ns.e("dot")
353
+ }, [currentStepIndex + 1]);
354
+ };
355
+ return () => {
356
+ return createVNode(Fragment, null, [stepsProps2.simple ? createVNode("div", {
357
+ "class": stepClass.value,
358
+ "style": stepStyle.value
359
+ }, [title.value]) : createVNode("div", {
360
+ "class": stepClass.value,
361
+ "style": stepStyle.value
362
+ }, [createVNode("div", {
363
+ "class": ns.e("dot-container")
364
+ }, [renderDot(), createVNode("div", {
365
+ "class": ns.e("line")
366
+ }, null)]), createVNode("div", {
367
+ "class": ns.e("content")
368
+ }, [createVNode("span", {
369
+ "class": ns.e("title")
370
+ }, [title.value]), description.value && createVNode("span", {
371
+ "class": ns.e("description")
372
+ }, [description.value])])])]);
373
+ };
374
+ }
375
+ });
376
+ var index = {
377
+ title: "Steps \u6B65\u9AA4\u6761",
378
+ category: "\u6570\u636E\u5C55\u793A",
379
+ status: "100%",
380
+ install(app) {
381
+ app.component(Steps.name, Steps);
382
+ app.component(Step.name, Step);
383
+ }
384
+ };
385
+ export { Step, Steps, index as default, stepProps, stepsProps };
@@ -0,0 +1 @@
1
+ (function(d,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis!="undefined"?globalThis:d||self,e(d.index={},d.Vue))})(this,function(d,e){"use strict";const P={modelValue:{type:Number,default:0},space:{type:Number},alignCenter:{type:Boolean,default:!1},direction:{type:String,default:"horizontal"},simple:{type:Boolean,default:!1}};function y(a,s,o){let n=a;return s&&(n+=`__${s}`),o&&(n+=`--${o}`),n}function v(a,s=!1){const o=s?`.devui-${a}`:`devui-${a}`;return{b:()=>y(o),e:t=>t?y(o,t):"",m:t=>t?y(o,"",t):"",em:(t,r)=>t&&r?y(o,t,r):""}}var k="";const D="active-step",I="steps",z="steps-props";var C=e.defineComponent({name:"DSteps",props:P,emits:["update:modelValue"],setup(a,{slots:s}){const{modelValue:o,direction:n,simple:u}=e.toRefs(a),l=v("steps"),c=e.ref(o.value);e.provide(D,c),e.provide(z,a);const t=e.ref([]);e.provide(I,t),e.watch(o,i=>{c.value=i});const r=e.computed(()=>{const i=n.value==="vertical"?" vertical":"",p=u.value?" simple":"";return`${l.b()}${i}${p}`});return()=>{var i;return e.createVNode("div",{class:r.value},[(i=s.default)==null?void 0:i.call(s)])}}});const x={title:{type:String,required:!0},description:{type:String},icon:{type:String},status:{type:String}},E={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},T={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};var M="",_=e.defineComponent({name:"DSvgIcon",props:T,setup(a){const{name:s,color:o,size:n}=e.toRefs(a),u=v("svg-icon"),l=e.computed(()=>`#icon-${s.value}`),c=e.computed(()=>typeof n.value=="number"?`${n.value}px`:n.value),t={width:c.value,height:c.value};return()=>e.createVNode("svg",{class:u.b(),style:t},[e.createVNode("use",{"xlink:href":l.value,fill:o.value},null)])}});function R(a){return/^((http|https):)?\/\//.test(a)}function j(a,s){const{component:o,name:n,size:u,color:l,classPrefix:c,rotate:t}=e.toRefs(a),r=v("icon"),i=e.computed(()=>typeof u.value=="number"?`${u.value}px`:u.value),p=o.value?e.resolveDynamicComponent(o.value):e.resolveDynamicComponent(_),m=()=>e.createVNode("img",e.mergeProps({src:n.value,alt:n.value.split("/")[n.value.split("/").length-1],class:[(t==null?void 0:t.value)==="infinite"&&r.m("spin")],style:{width:i.value||"",transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null),S=()=>e.createVNode(p,e.mergeProps({name:n.value,color:l.value,size:i.value,class:[(t==null?void 0:t.value)==="infinite"&&r.m("spin")],style:{transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null),h=()=>{const N=/^icon-/.test(n.value)?n.value:`${c.value}-${n.value}`;return e.createVNode("i",e.mergeProps({class:[c.value,N,(t==null?void 0:t.value)==="infinite"&&r.m("spin")],style:{fontSize:i.value,color:l.value,transform:`rotate(${t==null?void 0:t.value}deg)`}},s.attrs),null)};return{iconDom:()=>o.value?S():R(n.value)?m():h()}}var g=e.defineComponent({name:"DIcon",props:E,emits:["click"],setup(a,s){const{disabled:o,operable:n}=e.toRefs(a),{iconDom:u}=j(a,s),l=v("icon"),c=e.computed(()=>({[l.e("container")]:!0,[l.m("disabled")]:o.value,[l.m("operable")]:n.value})),t=r=>{o.value||s.emit("click",r)};return()=>{var r,i,p,m;return e.createVNode("div",{class:c.value,onClick:t},[(i=(r=s.slots).prefix)==null?void 0:i.call(r),u(),(m=(p=s.slots).suffix)==null?void 0:m.call(p)])}}}),U="";e.defineComponent({name:"DIconGroup",setup(a,s){const o=v("icon-group");return()=>{var n,u;return e.createVNode("div",{class:o.b()},[(u=(n=s.slots).default)==null?void 0:u.call(n)])}}});var G="",V=e.defineComponent({name:"DStep",props:x,setup(a,{slots:s}){const{title:o,description:n,icon:u,status:l}=e.toRefs(a),c=v("step"),t=e.getCurrentInstance(),r=e.inject(D),i=e.inject(I);i.value.push(t);const p=e.inject(z),m=i.value.indexOf(t),S=e.computed(()=>{const f=r.value===m?" active":"",b=r.value>m?" finished":"",F=p.alignCenter?" center":"",O=(l==null?void 0:l.value)?` ${l==null?void 0:l.value}`:"",w=p.simple?` ${c.m("simple")}`:"";return`${c.b()}${f}${b}${F}${O}${w}`}),h=e.computed(()=>{const f={};return p.space?f.width=`${p.space}px`:f.flexBasis=p.alignCenter||p.simple?`${100/i.value.length}%`:`${100/(i.value.length-1)}%`,f}),$=e.computed(()=>{const f=r.value===m,b=r.value>m;return f?"var(--devui-brand)":b?"var(--devui-success)":"var(--devui-placeholder)"}),N={finish:e.createVNode(g,{name:"right-o",color:"var(--devui-success)",size:"24px"},null),success:e.createVNode(g,{name:"right-o",color:"var(--devui-success)",size:"24px"},null),error:e.createVNode(g,{name:"error-o",color:"var(--devui-danger)",size:"24px"},null)},B=()=>{var f;return s.icon?(f=s.icon)==null?void 0:f.call(s,$.value):u.value?e.createVNode(g,{name:u.value,color:$.value,size:"24px"},null):l.value&&N[l.value]?N[l.value]:r.value>i.value.indexOf(t)?e.createVNode(g,{name:"right-o",color:"var(--devui-success)",size:"24px"},null):e.createVNode("span",{class:c.e("dot")},[m+1])};return()=>e.createVNode(e.Fragment,null,[p.simple?e.createVNode("div",{class:S.value,style:h.value},[o.value]):e.createVNode("div",{class:S.value,style:h.value},[e.createVNode("div",{class:c.e("dot-container")},[B(),e.createVNode("div",{class:c.e("line")},null)]),e.createVNode("div",{class:c.e("content")},[e.createVNode("span",{class:c.e("title")},[o.value]),n.value&&e.createVNode("span",{class:c.e("description")},[n.value])])])])}}),A={title:"Steps \u6B65\u9AA4\u6761",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(a){a.component(C.name,C),a.component(V.name,V)}};d.Step=V,d.Steps=C,d.default=A,d.stepProps=x,d.stepsProps=P,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "gantt",
2
+ "name": "steps",
3
3
  "version": "0.0.0",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.es.js",