vue-devui 1.0.0-rc.0 → 1.0.0-rc.3

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 (320) hide show
  1. package/README.md +55 -113
  2. package/alert/index.es.js +28 -30
  3. package/alert/index.umd.js +1 -1
  4. package/auto-complete/index.es.js +143 -103
  5. package/auto-complete/index.umd.js +5 -1
  6. package/auto-complete/style.css +1 -1
  7. package/avatar/index.es.js +77 -81
  8. package/avatar/index.umd.js +1 -1
  9. package/badge/index.es.js +1 -1
  10. package/badge/index.umd.js +1 -1
  11. package/badge/style.css +1 -1
  12. package/button/index.es.js +43 -43
  13. package/button/index.umd.js +1 -1
  14. package/card/index.es.js +3 -6
  15. package/card/index.umd.js +1 -1
  16. package/checkbox/index.es.js +5 -11
  17. package/checkbox/index.umd.js +1 -1
  18. package/comment/index.es.js +2 -5
  19. package/comment/index.umd.js +1 -1
  20. package/countdown/index.es.js +5 -7
  21. package/countdown/index.umd.js +1 -1
  22. package/editable-select/index.es.js +124 -168
  23. package/editable-select/index.umd.js +1 -1
  24. package/fullscreen/index.es.js +13 -16
  25. package/fullscreen/index.umd.js +1 -1
  26. package/grid/index.es.js +30 -36
  27. package/grid/index.umd.js +1 -1
  28. package/icon/index.es.js +39 -57
  29. package/icon/index.umd.js +1 -1
  30. package/image-preview/index.es.js +21 -20
  31. package/image-preview/index.umd.js +1 -1
  32. package/input/index.es.js +2 -5
  33. package/input/index.umd.js +1 -1
  34. package/layout/index.es.js +6 -21
  35. package/layout/index.umd.js +1 -1
  36. package/loading/index.es.js +20 -12
  37. package/loading/index.umd.js +1 -1
  38. package/modal/index.es.js +135 -122
  39. package/modal/index.umd.js +1 -1
  40. package/modal/style.css +1 -1
  41. package/notification/index.es.js +38 -40
  42. package/notification/index.umd.js +1 -1
  43. package/nuxt/components/DropdownPropsKey.js +3 -0
  44. package/nuxt/components/PanelBody.js +3 -0
  45. package/nuxt/components/PanelFooter.js +3 -0
  46. package/nuxt/components/PanelHeader.js +3 -0
  47. package/nuxt/components/Timeline.js +3 -0
  48. package/nuxt/components/TimelineItem.js +3 -0
  49. package/nuxt/components/alertProps.js +3 -0
  50. package/nuxt/components/autoCompleteProps.js +3 -0
  51. package/nuxt/components/avatarProps.js +3 -0
  52. package/nuxt/components/cardProps.js +3 -0
  53. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  54. package/nuxt/components/checkboxGroupProps.js +3 -0
  55. package/nuxt/components/checkboxProps.js +3 -0
  56. package/nuxt/components/colProps.js +3 -0
  57. package/nuxt/components/colPropsBaseClass.js +3 -0
  58. package/nuxt/components/colPropsBaseStyle.js +3 -0
  59. package/nuxt/components/commentProps.js +3 -0
  60. package/nuxt/components/countdownProps.js +3 -0
  61. package/nuxt/components/editableSelectProps.js +3 -0
  62. package/nuxt/components/fullscreenProps.js +3 -0
  63. package/nuxt/components/iconProps.js +2 -0
  64. package/nuxt/components/imagePreviewProps.js +3 -0
  65. package/nuxt/components/inputProps.js +3 -0
  66. package/nuxt/components/paginationProps.js +3 -0
  67. package/nuxt/components/panelProps.js +3 -0
  68. package/nuxt/components/progressProps.js +3 -0
  69. package/nuxt/components/rateProps.js +3 -0
  70. package/nuxt/components/readTipProps.js +3 -0
  71. package/nuxt/components/resultProps.js +3 -0
  72. package/nuxt/components/rowProps.js +3 -0
  73. package/nuxt/components/screenSizes.js +3 -0
  74. package/nuxt/components/searchProps.js +3 -0
  75. package/nuxt/components/skeletonProps.js +3 -0
  76. package/nuxt/components/splitterProps.js +3 -0
  77. package/nuxt/components/statisticProps.js +3 -0
  78. package/nuxt/components/switchProps.js +3 -0
  79. package/nuxt/components/tagInputProps.js +3 -0
  80. package/nuxt/components/tagProps.js +3 -0
  81. package/nuxt/components/textareaProps.js +3 -0
  82. package/nuxt/components/timeAxisProps.js +3 -0
  83. package/overlay/index.es.js +49 -42
  84. package/overlay/index.umd.js +1 -1
  85. package/overlay/style.css +1 -1
  86. package/package.json +8 -43
  87. package/pagination/index.es.js +24 -25
  88. package/pagination/index.umd.js +1 -1
  89. package/panel/index.es.js +45 -32
  90. package/panel/index.umd.js +1 -1
  91. package/popover/index.es.js +51 -44
  92. package/popover/index.umd.js +12 -12
  93. package/popover/style.css +1 -1
  94. package/progress/index.es.js +34 -36
  95. package/progress/index.umd.js +3 -3
  96. package/progress/style.css +1 -1
  97. package/radio/index.es.js +11 -11
  98. package/radio/index.umd.js +1 -1
  99. package/radio/style.css +1 -1
  100. package/rate/index.es.js +4 -7
  101. package/rate/index.umd.js +1 -1
  102. package/read-tip/index.es.js +8 -8
  103. package/read-tip/index.umd.js +1 -1
  104. package/result/index.es.js +40 -58
  105. package/result/index.umd.js +1 -1
  106. package/ripple/index.es.js +47 -42
  107. package/ripple/index.umd.js +1 -1
  108. package/search/index.es.js +13 -16
  109. package/search/index.umd.js +8 -8
  110. package/skeleton/index.es.js +20 -23
  111. package/skeleton/index.umd.js +1 -1
  112. package/slider/index.es.js +60 -59
  113. package/slider/index.umd.js +1 -1
  114. package/splitter/index.es.js +223 -171
  115. package/splitter/index.umd.js +13 -13
  116. package/splitter/style.css +1 -1
  117. package/statistic/index.es.js +7 -18
  118. package/statistic/index.umd.js +1 -1
  119. package/status/index.es.js +1 -4
  120. package/status/index.umd.js +1 -1
  121. package/status/style.css +1 -1
  122. package/style.css +1 -1
  123. package/switch/index.es.js +3 -6
  124. package/switch/index.umd.js +1 -1
  125. package/tag/index.es.js +15 -18
  126. package/tag/index.umd.js +1 -1
  127. package/tag/style.css +1 -1
  128. package/tag-input/index.es.js +7 -8
  129. package/tag-input/index.umd.js +1 -1
  130. package/textarea/index.es.js +2 -5
  131. package/textarea/index.umd.js +1 -1
  132. package/{accordion → timeline}/index.d.ts +0 -0
  133. package/{time-axis → timeline}/index.es.js +64 -83
  134. package/timeline/index.umd.js +1 -0
  135. package/{anchor → timeline}/package.json +1 -1
  136. package/timeline/style.css +1 -0
  137. package/upload/index.es.js +98 -97
  138. package/upload/index.umd.js +1 -1
  139. package/vue-devui.es.js +12477 -24991
  140. package/vue-devui.umd.js +24 -20
  141. package/accordion/index.es.js +0 -720
  142. package/accordion/index.umd.js +0 -1
  143. package/accordion/package.json +0 -7
  144. package/accordion/style.css +0 -1
  145. package/anchor/index.d.ts +0 -7
  146. package/anchor/index.es.js +0 -263
  147. package/anchor/index.umd.js +0 -1
  148. package/anchor/style.css +0 -1
  149. package/back-top/index.d.ts +0 -7
  150. package/back-top/index.es.js +0 -128
  151. package/back-top/index.umd.js +0 -1
  152. package/back-top/package.json +0 -7
  153. package/back-top/style.css +0 -1
  154. package/breadcrumb/index.d.ts +0 -7
  155. package/breadcrumb/index.es.js +0 -127
  156. package/breadcrumb/index.umd.js +0 -1
  157. package/breadcrumb/package.json +0 -7
  158. package/breadcrumb/style.css +0 -1
  159. package/carousel/index.d.ts +0 -7
  160. package/carousel/index.es.js +0 -329
  161. package/carousel/index.umd.js +0 -1
  162. package/carousel/package.json +0 -7
  163. package/carousel/style.css +0 -1
  164. package/cascader/index.d.ts +0 -7
  165. package/cascader/index.es.js +0 -5963
  166. package/cascader/index.umd.js +0 -27
  167. package/cascader/package.json +0 -7
  168. package/cascader/style.css +0 -1
  169. package/color-picker/index.d.ts +0 -7
  170. package/color-picker/index.es.js +0 -8187
  171. package/color-picker/index.umd.js +0 -27
  172. package/color-picker/package.json +0 -7
  173. package/color-picker/style.css +0 -1
  174. package/date-picker/index.d.ts +0 -7
  175. package/date-picker/index.es.js +0 -1171
  176. package/date-picker/index.umd.js +0 -1
  177. package/date-picker/package.json +0 -7
  178. package/date-picker/style.css +0 -1
  179. package/dragdrop/index.d.ts +0 -7
  180. package/dragdrop/index.es.js +0 -157
  181. package/dragdrop/index.umd.js +0 -1
  182. package/dragdrop/package.json +0 -7
  183. package/drawer/index.d.ts +0 -7
  184. package/drawer/index.es.js +0 -234
  185. package/drawer/index.umd.js +0 -1
  186. package/drawer/package.json +0 -7
  187. package/drawer/style.css +0 -1
  188. package/dropdown/index.d.ts +0 -7
  189. package/dropdown/index.es.js +0 -638
  190. package/dropdown/index.umd.js +0 -1
  191. package/dropdown/package.json +0 -7
  192. package/dropdown/style.css +0 -1
  193. package/form/index.d.ts +0 -7
  194. package/form/index.es.js +0 -7865
  195. package/form/index.umd.js +0 -27
  196. package/form/package.json +0 -7
  197. package/form/style.css +0 -1
  198. package/gantt/index.d.ts +0 -7
  199. package/gantt/index.es.js +0 -523
  200. package/gantt/index.umd.js +0 -1
  201. package/gantt/package.json +0 -7
  202. package/gantt/style.css +0 -1
  203. package/input-icon/index.d.ts +0 -7
  204. package/input-icon/index.es.js +0 -331
  205. package/input-icon/index.umd.js +0 -1
  206. package/input-icon/package.json +0 -7
  207. package/input-icon/style.css +0 -1
  208. package/input-number/index.d.ts +0 -7
  209. package/input-number/index.es.js +0 -240
  210. package/input-number/index.umd.js +0 -1
  211. package/input-number/package.json +0 -7
  212. package/input-number/style.css +0 -1
  213. package/list/index.d.ts +0 -7
  214. package/list/index.es.js +0 -39
  215. package/list/index.umd.js +0 -1
  216. package/list/package.json +0 -7
  217. package/list/style.css +0 -1
  218. package/nav-sprite/index.d.ts +0 -7
  219. package/nav-sprite/index.es.js +0 -68
  220. package/nav-sprite/index.umd.js +0 -1
  221. package/nav-sprite/package.json +0 -7
  222. package/nuxt/components/Accordion.js +0 -3
  223. package/nuxt/components/Anchor.js +0 -3
  224. package/nuxt/components/BackTop.js +0 -3
  225. package/nuxt/components/Breadcrumb.js +0 -3
  226. package/nuxt/components/Carousel.js +0 -3
  227. package/nuxt/components/CarouselItem.js +0 -3
  228. package/nuxt/components/Cascader.js +0 -3
  229. package/nuxt/components/ColorPicker.js +0 -3
  230. package/nuxt/components/Column.js +0 -3
  231. package/nuxt/components/DatePicker.js +0 -3
  232. package/nuxt/components/Drawer.js +0 -3
  233. package/nuxt/components/DrawerService.js +0 -3
  234. package/nuxt/components/Dropdown.js +0 -3
  235. package/nuxt/components/DropdownMenu.js +0 -3
  236. package/nuxt/components/Form.js +0 -3
  237. package/nuxt/components/FormControl.js +0 -3
  238. package/nuxt/components/FormItem.js +0 -3
  239. package/nuxt/components/FormLabel.js +0 -3
  240. package/nuxt/components/FormOperation.js +0 -3
  241. package/nuxt/components/Gantt.js +0 -3
  242. package/nuxt/components/InputIcon.js +0 -3
  243. package/nuxt/components/InputNumber.js +0 -3
  244. package/nuxt/components/List.js +0 -3
  245. package/nuxt/components/ListItem.js +0 -3
  246. package/nuxt/components/NavSprite.js +0 -2
  247. package/nuxt/components/QuadrantDiagram.js +0 -3
  248. package/nuxt/components/Select.js +0 -3
  249. package/nuxt/components/StepsGuide.js +0 -3
  250. package/nuxt/components/StickSlider.js +0 -3
  251. package/nuxt/components/Sticky.js +0 -2
  252. package/nuxt/components/Table.js +0 -3
  253. package/nuxt/components/Tabs.js +0 -3
  254. package/nuxt/components/TimeAxis.js +0 -3
  255. package/nuxt/components/TimeAxisItem.js +0 -3
  256. package/nuxt/components/TimePicker.js +0 -3
  257. package/nuxt/components/Tooltip.js +0 -3
  258. package/nuxt/components/Transfer.js +0 -3
  259. package/nuxt/components/Tree.js +0 -3
  260. package/nuxt/components/TreeSelect.js +0 -3
  261. package/nuxt/components/dropdownMenuProps.js +0 -3
  262. package/nuxt/components/tooltipProps.js +0 -3
  263. package/quadrant-diagram/index.d.ts +0 -7
  264. package/quadrant-diagram/index.es.js +0 -5728
  265. package/quadrant-diagram/index.umd.js +0 -27
  266. package/quadrant-diagram/package.json +0 -7
  267. package/quadrant-diagram/style.css +0 -1
  268. package/select/index.d.ts +0 -7
  269. package/select/index.es.js +0 -706
  270. package/select/index.umd.js +0 -1
  271. package/select/package.json +0 -7
  272. package/select/style.css +0 -1
  273. package/steps-guide/index.d.ts +0 -7
  274. package/steps-guide/index.es.js +0 -239
  275. package/steps-guide/index.umd.js +0 -1
  276. package/steps-guide/package.json +0 -7
  277. package/steps-guide/style.css +0 -1
  278. package/sticky/index.d.ts +0 -7
  279. package/sticky/index.es.js +0 -197
  280. package/sticky/index.umd.js +0 -1
  281. package/sticky/package.json +0 -7
  282. package/table/index.d.ts +0 -7
  283. package/table/index.es.js +0 -1969
  284. package/table/index.umd.js +0 -1
  285. package/table/package.json +0 -7
  286. package/table/style.css +0 -1
  287. package/tabs/index.d.ts +0 -7
  288. package/tabs/index.es.js +0 -194
  289. package/tabs/index.umd.js +0 -1
  290. package/tabs/package.json +0 -7
  291. package/tabs/style.css +0 -1
  292. package/time-axis/index.d.ts +0 -7
  293. package/time-axis/index.umd.js +0 -1
  294. package/time-axis/package.json +0 -7
  295. package/time-axis/style.css +0 -1
  296. package/time-picker/index.d.ts +0 -7
  297. package/time-picker/index.es.js +0 -1237
  298. package/time-picker/index.umd.js +0 -1
  299. package/time-picker/package.json +0 -7
  300. package/time-picker/style.css +0 -1
  301. package/tooltip/index.d.ts +0 -7
  302. package/tooltip/index.es.js +0 -5828
  303. package/tooltip/index.umd.js +0 -27
  304. package/tooltip/package.json +0 -7
  305. package/tooltip/style.css +0 -1
  306. package/transfer/index.d.ts +0 -7
  307. package/transfer/index.es.js +0 -7608
  308. package/transfer/index.umd.js +0 -27
  309. package/transfer/package.json +0 -7
  310. package/transfer/style.css +0 -1
  311. package/tree/index.d.ts +0 -7
  312. package/tree/index.es.js +0 -6490
  313. package/tree/index.umd.js +0 -27
  314. package/tree/package.json +0 -7
  315. package/tree/style.css +0 -1
  316. package/tree-select/index.d.ts +0 -7
  317. package/tree-select/index.es.js +0 -623
  318. package/tree-select/index.umd.js +0 -1
  319. package/tree-select/package.json +0 -7
  320. package/tree-select/style.css +0 -1
@@ -44,33 +44,41 @@ var Slider = defineComponent({
44
44
  const currentPosition = ref(0);
45
45
  const newPostion = ref(0);
46
46
  const percentDispaly = ref("");
47
- const renderShowInput = () => {
48
- return props.showInput ? createVNode("div", {
49
- "class": "devui-input__out-wrap"
50
- }, [createVNode("input", {
51
- "onInput": handleOnInput,
52
- "value": inputValue.value + ""
53
- }, null)]) : "";
54
- };
55
- if (props.modelValue > props.max) {
56
- percentDispaly.value = "100%";
57
- } else if (props.modelValue < props.min) {
58
- percentDispaly.value = "0%";
59
- } else {
60
- percentDispaly.value = (props.modelValue - props.min) * 100 / (props.max - props.min) + "%";
47
+ function handleOnInput(event) {
48
+ inputValue.value = parseInt(event.target.value);
49
+ if (!inputValue.value) {
50
+ inputValue.value = props.min;
51
+ percentDispaly.value = "0%";
52
+ } else {
53
+ if (inputValue.value < props.min || inputValue.value > props.max) {
54
+ return;
55
+ }
56
+ const re = /^(?:[1-9]?\d|100)$/;
57
+ if (re.test(`${inputValue.value}`)) {
58
+ percentDispaly.value = (inputValue.value - props.min) * 100 / (props.max - props.min) + "%";
59
+ ctx.emit("update:modelValue", inputValue.value);
60
+ }
61
+ }
61
62
  }
62
- onMounted(() => {
63
- const sliderWidth = sliderRunway.value.clientWidth;
64
- currentPosition.value = sliderWidth * (inputValue.value - props.min) / (props.max - props.min);
65
- });
66
- function handleButtonMousedown(event) {
67
- popoverShow.value = true;
68
- if (props.disabled)
63
+ function setPostion(newPosition) {
64
+ const sliderWidth = Math.round(sliderRunway.value.clientWidth);
65
+ if (newPosition < 0) {
66
+ newPosition = 0;
67
+ }
68
+ const LengthPerStep = sliderWidth / ((props.max - props.min) / props.step);
69
+ const steps = Math.round(newPosition / LengthPerStep);
70
+ const value = steps * LengthPerStep;
71
+ if (Math.round(value) >= sliderWidth) {
72
+ currentPosition.value = sliderWidth;
73
+ inputValue.value = props.max;
74
+ percentDispaly.value = "100%";
75
+ ctx.emit("update:modelValue", props.max);
69
76
  return;
70
- event.preventDefault();
71
- dragStart(event);
72
- window.addEventListener("mousemove", onDragging);
73
- window.addEventListener("mouseup", onDragEnd);
77
+ }
78
+ percentDispaly.value = Math.round(value * 100 / sliderWidth) + "%";
79
+ inputValue.value = Math.round(value * (props.max - props.min) / sliderWidth) + props.min;
80
+ currentPosition.value = newPosition;
81
+ ctx.emit("update:modelValue", inputValue.value);
74
82
  }
75
83
  function dragStart(event) {
76
84
  isClick = false;
@@ -93,25 +101,34 @@ var Slider = defineComponent({
93
101
  window.removeEventListener("mousemove", onDragging);
94
102
  window.removeEventListener("mouseup", onDragEnd);
95
103
  }
96
- function setPostion(newPosition) {
97
- const sliderWidth = Math.round(sliderRunway.value.clientWidth);
98
- if (newPosition < 0) {
99
- newPosition = 0;
100
- }
101
- const LengthPerStep = sliderWidth / ((props.max - props.min) / props.step);
102
- const steps = Math.round(newPosition / LengthPerStep);
103
- const value = steps * LengthPerStep;
104
- if (Math.round(value) >= sliderWidth) {
105
- currentPosition.value = sliderWidth;
106
- inputValue.value = props.max;
107
- percentDispaly.value = "100%";
108
- ctx.emit("update:modelValue", props.max);
104
+ const renderShowInput = () => {
105
+ return props.showInput ? createVNode("div", {
106
+ "class": "devui-input__out-wrap"
107
+ }, [createVNode("input", {
108
+ "onInput": handleOnInput,
109
+ "value": inputValue.value + ""
110
+ }, null)]) : "";
111
+ };
112
+ if (props.modelValue > props.max) {
113
+ percentDispaly.value = "100%";
114
+ } else if (props.modelValue < props.min) {
115
+ percentDispaly.value = "0%";
116
+ } else {
117
+ percentDispaly.value = (props.modelValue - props.min) * 100 / (props.max - props.min) + "%";
118
+ }
119
+ onMounted(() => {
120
+ const sliderWidth = sliderRunway.value.clientWidth;
121
+ currentPosition.value = sliderWidth * (inputValue.value - props.min) / (props.max - props.min);
122
+ });
123
+ function handleButtonMousedown(event) {
124
+ popoverShow.value = true;
125
+ if (props.disabled) {
109
126
  return;
110
127
  }
111
- percentDispaly.value = Math.round(value * 100 / sliderWidth) + "%";
112
- inputValue.value = Math.round(value * (props.max - props.min) / sliderWidth) + props.min;
113
- currentPosition.value = newPosition;
114
- ctx.emit("update:modelValue", inputValue.value);
128
+ event.preventDefault();
129
+ dragStart(event);
130
+ window.addEventListener("mousemove", onDragging);
131
+ window.addEventListener("mouseup", onDragEnd);
115
132
  }
116
133
  function handleRunwayMousedown(event) {
117
134
  if (!props.disabled && isClick) {
@@ -123,22 +140,6 @@ var Slider = defineComponent({
123
140
  return;
124
141
  }
125
142
  }
126
- function handleOnInput(event) {
127
- inputValue.value = parseInt(event.target.value);
128
- if (!inputValue.value) {
129
- inputValue.value = props.min;
130
- percentDispaly.value = "0%";
131
- } else {
132
- if (inputValue.value < props.min || inputValue.value > props.max) {
133
- return;
134
- }
135
- const re = /^(?:[1-9]?\d|100)$/;
136
- if (re.test(`${inputValue.value}`)) {
137
- percentDispaly.value = (inputValue.value - props.min) * 100 / (props.max - props.min) + "%";
138
- ctx.emit("update:modelValue", inputValue.value);
139
- }
140
- }
141
- }
142
143
  const disableClass = computed(() => {
143
144
  return props.disabled ? " disabled" : "";
144
145
  });
@@ -190,7 +191,7 @@ var index = {
190
191
  category: "\u6570\u636E\u5F55\u5165",
191
192
  status: "100%",
192
193
  install(app) {
193
- app.use(Slider);
194
+ app.component(Slider.name, Slider);
194
195
  }
195
196
  };
196
197
  export { Slider, index as default };
@@ -1 +1 @@
1
- (function(a,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(a=typeof globalThis!="undefined"?globalThis:a||self,t(a.index={},a.Vue))})(this,function(a,t){"use strict";const g={disabled:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},modelValue:{type:Number,default:0},showInput:{type:Boolean,default:!1},step:{type:Number,default:1},tipsRenderer:{type:String,default:""}};var R="",o=t.defineComponent({name:"DSlider",props:g,emits:["update:modelValue"],setup(e,v){let m=!0,f=0,s=0;const d=t.ref(!1),V=t.ref(null),l=t.ref(e.modelValue),r=t.ref(0),h=t.ref(0),u=t.ref(""),S=()=>e.showInput?t.createVNode("div",{class:"devui-input__out-wrap"},[t.createVNode("input",{onInput:D,value:l.value+""},null)]):"";e.modelValue>e.max?u.value="100%":e.modelValue<e.min?u.value="0%":u.value=(e.modelValue-e.min)*100/(e.max-e.min)+"%",t.onMounted(()=>{const n=V.value.clientWidth;r.value=n*(l.value-e.min)/(e.max-e.min)});function M(n){d.value=!0,!e.disabled&&(n.preventDefault(),E(n),window.addEventListener("mousemove",N),window.addEventListener("mouseup",_))}function E(n){m=!1,s=n.clientX,f=r.value,h.value=f}function N(n){d.value=!0;const c=n.clientX-s;h.value=f+c,b(h.value)}function _(){d.value=!1,setTimeout(()=>{m=!0},100),window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",_)}function b(n){const i=Math.round(V.value.clientWidth);n<0&&(n=0);const c=i/((e.max-e.min)/e.step),y=Math.round(n/c)*c;if(Math.round(y)>=i){r.value=i,l.value=e.max,u.value="100%",v.emit("update:modelValue",e.max);return}u.value=Math.round(y*100/i)+"%",l.value=Math.round(y*(e.max-e.min)/i)+e.min,r.value=n,v.emit("update:modelValue",l.value)}function X(n){if(!e.disabled&&m){s=n.target.getBoundingClientRect().left;const i=n.clientX;b(i-s),M(n)}else return}function D(n){if(l.value=parseInt(n.target.value),!l.value)l.value=e.min,u.value="0%";else{if(l.value<e.min||l.value>e.max)return;/^(?:[1-9]?\d|100)$/.test(`${l.value}`)&&(u.value=(l.value-e.min)*100/(e.max-e.min)+"%",v.emit("update:modelValue",l.value))}}const w=t.computed(()=>e.disabled?" disabled":""),I=()=>t.createVNode("div",{class:"devui-slider_popover",style:{left:u.value,opacity:d.value?1:0}},[t.createVNode("div",{class:"devui-slider_popover-arrow"},null),t.createVNode("div",{class:"devui-slider_popover-content"},[l.value+" "+e.tipsRenderer])]);return()=>t.createVNode("div",{class:"devui-slider"},[t.createVNode("div",{ref:V,class:"devui-slider__runway"+w.value,onMousedown:X,onMouseout:()=>d.value=!1},[t.createVNode("div",{class:"devui-slider__bar"+w.value,style:{width:u.value}},null),t.createVNode("div",{class:"devui-slider__button"+w.value,style:{left:u.value},onMousedown:M,onMouseenter:()=>d.value=!0,onMouseout:()=>d.value=!1},null),e.tipsRenderer==="null"?"":I()]),t.createVNode("span",{class:"devui-min_count"},[e.min]),t.createVNode("span",{class:"devui-max_count"},[e.max]),S()])}});o.install=function(e){e.component(o.name,o)};var x={title:"Slider \u6ED1\u5757",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.use(o)}};a.Slider=o,a.default=x,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
1
+ (function(a,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(a=typeof globalThis!="undefined"?globalThis:a||self,t(a.index={},a.Vue))})(this,function(a,t){"use strict";const g={disabled:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},modelValue:{type:Number,default:0},showInput:{type:Boolean,default:!1},step:{type:Number,default:1},tipsRenderer:{type:String,default:""}};var R="",o=t.defineComponent({name:"DSlider",props:g,emits:["update:modelValue"],setup(e,m){let v=!0,f=0,s=0;const d=t.ref(!1),V=t.ref(null),l=t.ref(e.modelValue),r=t.ref(0),h=t.ref(0),u=t.ref("");function S(n){if(l.value=parseInt(n.target.value),!l.value)l.value=e.min,u.value="0%";else{if(l.value<e.min||l.value>e.max)return;/^(?:[1-9]?\d|100)$/.test(`${l.value}`)&&(u.value=(l.value-e.min)*100/(e.max-e.min)+"%",m.emit("update:modelValue",l.value))}}function M(n){const i=Math.round(V.value.clientWidth);n<0&&(n=0);const c=i/((e.max-e.min)/e.step),y=Math.round(n/c)*c;if(Math.round(y)>=i){r.value=i,l.value=e.max,u.value="100%",m.emit("update:modelValue",e.max);return}u.value=Math.round(y*100/i)+"%",l.value=Math.round(y*(e.max-e.min)/i)+e.min,r.value=n,m.emit("update:modelValue",l.value)}function E(n){v=!1,s=n.clientX,f=r.value,h.value=f}function N(n){d.value=!0;const c=n.clientX-s;h.value=f+c,M(h.value)}function _(){d.value=!1,setTimeout(()=>{v=!0},100),window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",_)}const X=()=>e.showInput?t.createVNode("div",{class:"devui-input__out-wrap"},[t.createVNode("input",{onInput:S,value:l.value+""},null)]):"";e.modelValue>e.max?u.value="100%":e.modelValue<e.min?u.value="0%":u.value=(e.modelValue-e.min)*100/(e.max-e.min)+"%",t.onMounted(()=>{const n=V.value.clientWidth;r.value=n*(l.value-e.min)/(e.max-e.min)});function b(n){d.value=!0,!e.disabled&&(n.preventDefault(),E(n),window.addEventListener("mousemove",N),window.addEventListener("mouseup",_))}function D(n){if(!e.disabled&&v){s=n.target.getBoundingClientRect().left;const i=n.clientX;M(i-s),b(n)}else return}const w=t.computed(()=>e.disabled?" disabled":""),I=()=>t.createVNode("div",{class:"devui-slider_popover",style:{left:u.value,opacity:d.value?1:0}},[t.createVNode("div",{class:"devui-slider_popover-arrow"},null),t.createVNode("div",{class:"devui-slider_popover-content"},[l.value+" "+e.tipsRenderer])]);return()=>t.createVNode("div",{class:"devui-slider"},[t.createVNode("div",{ref:V,class:"devui-slider__runway"+w.value,onMousedown:D,onMouseout:()=>d.value=!1},[t.createVNode("div",{class:"devui-slider__bar"+w.value,style:{width:u.value}},null),t.createVNode("div",{class:"devui-slider__button"+w.value,style:{left:u.value},onMousedown:b,onMouseenter:()=>d.value=!0,onMouseout:()=>d.value=!1},null),e.tipsRenderer==="null"?"":I()]),t.createVNode("span",{class:"devui-min_count"},[e.min]),t.createVNode("span",{class:"devui-max_count"},[e.max]),X()])}});o.install=function(e){e.component(o.name,o)};var x={title:"Slider \u6ED1\u5757",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.component(o.name,o)}};a.Slider=o,a.default=x,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});