@varlet/ui 2.16.7 → 2.16.8-alpha.1695118057982

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 (348) hide show
  1. package/es/action-sheet/ActionSheet.mjs +97 -67
  2. package/es/action-sheet/index.mjs +43 -28
  3. package/es/action-sheet/props.mjs +39 -8
  4. package/es/app-bar/AppBar.mjs +129 -56
  5. package/es/app-bar/index.mjs +10 -5
  6. package/es/app-bar/props.mjs +6 -3
  7. package/es/avatar/Avatar.mjs +97 -87
  8. package/es/avatar/index.mjs +10 -5
  9. package/es/avatar/props.mjs +8 -5
  10. package/es/avatar-group/AvatarGroup.mjs +26 -20
  11. package/es/avatar-group/index.mjs +10 -5
  12. package/es/avatar-group/props.mjs +5 -2
  13. package/es/back-top/BackTop.mjs +71 -53
  14. package/es/back-top/index.mjs +10 -5
  15. package/es/back-top/props.mjs +6 -3
  16. package/es/badge/Badge.mjs +74 -46
  17. package/es/badge/index.mjs +10 -5
  18. package/es/badge/props.mjs +7 -4
  19. package/es/bottom-navigation/BottomNavigation.mjs +100 -97
  20. package/es/bottom-navigation/index.mjs +10 -5
  21. package/es/bottom-navigation/props.mjs +7 -4
  22. package/es/bottom-navigation/provide.mjs +13 -9
  23. package/es/bottom-navigation-item/BottomNavigationItem.mjs +93 -74
  24. package/es/bottom-navigation-item/index.mjs +10 -5
  25. package/es/bottom-navigation-item/props.mjs +7 -4
  26. package/es/bottom-navigation-item/provide.mjs +14 -11
  27. package/es/breadcrumb/Breadcrumb.mjs +51 -36
  28. package/es/breadcrumb/index.mjs +10 -5
  29. package/es/breadcrumb/props.mjs +6 -3
  30. package/es/breadcrumb/provide.mjs +12 -11
  31. package/es/breadcrumbs/Breadcrumbs.mjs +26 -24
  32. package/es/breadcrumbs/index.mjs +10 -5
  33. package/es/breadcrumbs/props.mjs +6 -3
  34. package/es/breadcrumbs/provide.mjs +11 -9
  35. package/es/button/Button.mjs +88 -90
  36. package/es/button/index.mjs +10 -5
  37. package/es/button/props.mjs +31 -10
  38. package/es/button/provide.mjs +8 -9
  39. package/es/button-group/ButtonGroup.mjs +38 -26
  40. package/es/button-group/index.mjs +8 -4
  41. package/es/button-group/props.mjs +8 -5
  42. package/es/button-group/provide.mjs +9 -9
  43. package/es/card/Card.mjs +292 -189
  44. package/es/card/index.mjs +10 -5
  45. package/es/card/props.mjs +9 -6
  46. package/es/cell/Cell.mjs +96 -52
  47. package/es/cell/index.mjs +10 -5
  48. package/es/cell/props.mjs +6 -3
  49. package/es/checkbox/Checkbox.mjs +136 -130
  50. package/es/checkbox/index.mjs +10 -5
  51. package/es/checkbox/props.mjs +9 -6
  52. package/es/checkbox/provide.mjs +10 -9
  53. package/es/checkbox-group/CheckboxGroup.mjs +63 -96
  54. package/es/checkbox-group/index.mjs +10 -5
  55. package/es/checkbox-group/props.mjs +9 -6
  56. package/es/checkbox-group/provide.mjs +11 -9
  57. package/es/chip/Chip.mjs +66 -50
  58. package/es/chip/index.mjs +10 -5
  59. package/es/chip/props.mjs +10 -7
  60. package/es/col/Col.mjs +60 -55
  61. package/es/col/index.mjs +10 -5
  62. package/es/col/props.mjs +7 -4
  63. package/es/col/provide.mjs +8 -9
  64. package/es/collapse/Collapse.mjs +70 -73
  65. package/es/collapse/index.mjs +10 -5
  66. package/es/collapse/props.mjs +7 -4
  67. package/es/collapse/provide.mjs +11 -9
  68. package/es/collapse-item/CollapseItem.mjs +156 -93
  69. package/es/collapse-item/index.mjs +10 -5
  70. package/es/collapse-item/props.mjs +6 -3
  71. package/es/collapse-item/provide.mjs +12 -11
  72. package/es/context/index.mjs +9 -5
  73. package/es/context/lock.mjs +18 -22
  74. package/es/context/zIndex.mjs +19 -16
  75. package/es/countdown/Countdown.mjs +73 -70
  76. package/es/countdown/index.mjs +10 -5
  77. package/es/countdown/props.mjs +7 -4
  78. package/es/counter/Counter.mjs +169 -173
  79. package/es/counter/index.mjs +10 -5
  80. package/es/counter/props.mjs +8 -5
  81. package/es/counter/provide.ts +3 -0
  82. package/es/date-picker/DatePicker.mjs +411 -304
  83. package/es/date-picker/index.mjs +10 -5
  84. package/es/date-picker/props.mjs +71 -45
  85. package/es/date-picker/src/day-picker-panel.mjs +270 -208
  86. package/es/date-picker/src/month-picker-panel.mjs +205 -175
  87. package/es/date-picker/src/panel-header.mjs +101 -83
  88. package/es/date-picker/src/year-picker-panel.mjs +64 -54
  89. package/es/dialog/Dialog.mjs +171 -106
  90. package/es/dialog/index.mjs +49 -33
  91. package/es/dialog/props.mjs +39 -9
  92. package/es/divider/Divider.mjs +56 -51
  93. package/es/divider/index.mjs +10 -5
  94. package/es/divider/props.mjs +5 -2
  95. package/es/drag/Drag.mjs +126 -144
  96. package/es/drag/index.mjs +10 -5
  97. package/es/drag/props.mjs +8 -5
  98. package/es/ellipsis/Ellipsis.mjs +81 -50
  99. package/es/ellipsis/index.mjs +8 -4
  100. package/es/ellipsis/props.mjs +5 -2
  101. package/es/fab/Fab.mjs +73 -75
  102. package/es/fab/index.mjs +8 -4
  103. package/es/fab/props.mjs +14 -11
  104. package/es/field-decorator/FieldDecorator.mjs +215 -110
  105. package/es/field-decorator/props.mjs +9 -6
  106. package/es/form/Form.mjs +69 -79
  107. package/es/form/index.mjs +11 -6
  108. package/es/form/props.mjs +6 -3
  109. package/es/form/provide.mjs +35 -22
  110. package/es/form-details/FormDetails.mjs +81 -39
  111. package/es/form-details/index.mjs +10 -5
  112. package/es/form-details/props.mjs +7 -4
  113. package/es/hover/index.mjs +37 -40
  114. package/es/hover-overlay/HoverOverlay.mjs +18 -14
  115. package/es/hover-overlay/index.mjs +13 -8
  116. package/es/hover-overlay/props.mjs +5 -2
  117. package/es/icon/Icon.mjs +50 -33
  118. package/es/icon/index.mjs +10 -5
  119. package/es/icon/props.mjs +7 -4
  120. package/es/image/Image.mjs +76 -82
  121. package/es/image/index.mjs +10 -5
  122. package/es/image/props.mjs +7 -4
  123. package/es/image-preview/ImagePreview.mjs +176 -193
  124. package/es/image-preview/index.mjs +44 -30
  125. package/es/image-preview/props.mjs +34 -9
  126. package/es/index-anchor/IndexAnchor.mjs +45 -42
  127. package/es/index-anchor/index.mjs +10 -5
  128. package/es/index-anchor/props.mjs +5 -2
  129. package/es/index-anchor/provide.mjs +12 -11
  130. package/es/index-bar/IndexBar.mjs +130 -131
  131. package/es/index-bar/index.mjs +10 -5
  132. package/es/index-bar/props.mjs +6 -3
  133. package/es/index-bar/provide.mjs +11 -9
  134. package/es/index.bundle.mjs +1 -1
  135. package/es/index.mjs +1 -1
  136. package/es/input/Input.mjs +231 -247
  137. package/es/input/index.mjs +10 -5
  138. package/es/input/props.mjs +38 -8
  139. package/es/input/provide.ts +3 -0
  140. package/es/lazy/index.mjs +94 -87
  141. package/es/link/Link.mjs +39 -45
  142. package/es/link/index.mjs +10 -5
  143. package/es/link/props.mjs +8 -5
  144. package/es/list/List.mjs +144 -97
  145. package/es/list/index.mjs +10 -5
  146. package/es/list/props.mjs +8 -5
  147. package/es/list/provide.mjs +8 -9
  148. package/es/loading/Loading.mjs +165 -72
  149. package/es/loading/index.mjs +10 -5
  150. package/es/loading/props.mjs +7 -4
  151. package/es/loading-bar/LoadingBar.mjs +19 -16
  152. package/es/loading-bar/index.mjs +37 -30
  153. package/es/loading-bar/props.mjs +5 -2
  154. package/es/locale/en-US.mjs +76 -73
  155. package/es/locale/index.mjs +52 -41
  156. package/es/locale/zh-CN.mjs +76 -73
  157. package/es/menu/Menu.mjs +76 -57
  158. package/es/menu/index.mjs +10 -5
  159. package/es/menu/props.mjs +11 -8
  160. package/es/menu/usePopover.mjs +214 -207
  161. package/es/option/Option.mjs +86 -70
  162. package/es/option/index.mjs +10 -5
  163. package/es/option/props.mjs +5 -2
  164. package/es/option/provide.mjs +10 -11
  165. package/es/overlay/Overlay.mjs +29 -31
  166. package/es/overlay/index.mjs +10 -5
  167. package/es/overlay/props.mjs +7 -4
  168. package/es/pagination/Pagination.mjs +334 -202
  169. package/es/pagination/index.mjs +10 -5
  170. package/es/pagination/props.mjs +8 -5
  171. package/es/paper/Paper.mjs +43 -31
  172. package/es/paper/index.mjs +10 -5
  173. package/es/paper/props.mjs +6 -3
  174. package/es/picker/Picker.mjs +288 -224
  175. package/es/picker/index.mjs +24 -23
  176. package/es/picker/props.mjs +37 -7
  177. package/es/popup/Popup.mjs +68 -58
  178. package/es/popup/index.mjs +10 -5
  179. package/es/popup/props.mjs +9 -6
  180. package/es/popup/provide.mjs +12 -15
  181. package/es/progress/Progress.mjs +186 -114
  182. package/es/progress/index.mjs +10 -5
  183. package/es/progress/props.mjs +7 -4
  184. package/es/pull-refresh/PullRefresh.mjs +136 -116
  185. package/es/pull-refresh/index.mjs +10 -5
  186. package/es/pull-refresh/props.mjs +8 -5
  187. package/es/radio/Radio.mjs +122 -118
  188. package/es/radio/index.mjs +10 -5
  189. package/es/radio/props.mjs +8 -5
  190. package/es/radio/provide.mjs +8 -9
  191. package/es/radio-group/RadioGroup.mjs +50 -58
  192. package/es/radio-group/index.mjs +10 -5
  193. package/es/radio-group/props.mjs +10 -7
  194. package/es/radio-group/provide.mjs +11 -9
  195. package/es/rate/Rate.mjs +103 -132
  196. package/es/rate/index.mjs +10 -5
  197. package/es/rate/props.mjs +10 -7
  198. package/es/rate/provide.ts +3 -0
  199. package/es/result/Empty.mjs +21 -12
  200. package/es/result/Error.mjs +18 -9
  201. package/es/result/Info.mjs +18 -9
  202. package/es/result/Question.mjs +18 -9
  203. package/es/result/Result.mjs +102 -55
  204. package/es/result/Success.mjs +84 -40
  205. package/es/result/Warning.mjs +18 -9
  206. package/es/result/index.mjs +10 -5
  207. package/es/result/props.mjs +6 -3
  208. package/es/ripple/index.mjs +89 -101
  209. package/es/row/Row.mjs +40 -45
  210. package/es/row/index.mjs +10 -5
  211. package/es/row/props.mjs +8 -5
  212. package/es/row/provide.mjs +9 -9
  213. package/es/select/Select.mjs +308 -298
  214. package/es/select/index.mjs +10 -5
  215. package/es/select/props.mjs +40 -10
  216. package/es/select/provide.mjs +9 -9
  217. package/es/skeleton/Skeleton.mjs +182 -71
  218. package/es/skeleton/index.mjs +10 -5
  219. package/es/skeleton/props.mjs +5 -2
  220. package/es/slider/Slider.mjs +310 -260
  221. package/es/slider/index.mjs +10 -5
  222. package/es/slider/props.mjs +15 -11
  223. package/es/slider/provide.ts +3 -0
  224. package/es/snackbar/Snackbar.mjs +47 -34
  225. package/es/snackbar/core.mjs +140 -77
  226. package/es/snackbar/index.mjs +111 -97
  227. package/es/snackbar/props.mjs +35 -14
  228. package/es/space/Space.mjs +30 -28
  229. package/es/space/index.mjs +10 -5
  230. package/es/space/margin.mjs +22 -23
  231. package/es/space/props.mjs +8 -5
  232. package/es/step/Step.mjs +96 -74
  233. package/es/step/index.mjs +10 -5
  234. package/es/step/props.mjs +6 -3
  235. package/es/step/provide.mjs +10 -11
  236. package/es/steps/Steps.mjs +31 -30
  237. package/es/steps/index.mjs +10 -5
  238. package/es/steps/props.mjs +7 -4
  239. package/es/steps/provide.mjs +9 -8
  240. package/es/sticky/Sticky.mjs +104 -92
  241. package/es/sticky/index.mjs +10 -5
  242. package/es/sticky/props.mjs +6 -3
  243. package/es/style-provider/StyleProvider.mjs +19 -18
  244. package/es/style-provider/index.mjs +15 -11
  245. package/es/style-provider/props.mjs +6 -3
  246. package/es/swipe/Swipe.mjs +281 -268
  247. package/es/swipe/index.mjs +10 -5
  248. package/es/swipe/props.mjs +6 -3
  249. package/es/swipe/provide.mjs +11 -9
  250. package/es/swipe-item/SwipeItem.mjs +29 -29
  251. package/es/swipe-item/index.mjs +8 -4
  252. package/es/swipe-item/provide.mjs +10 -11
  253. package/es/switch/Switch.mjs +143 -103
  254. package/es/switch/index.mjs +10 -5
  255. package/es/switch/props.mjs +7 -4
  256. package/es/switch/provide.ts +3 -0
  257. package/es/tab/Tab.mjs +48 -61
  258. package/es/tab/index.mjs +10 -5
  259. package/es/tab/props.mjs +6 -3
  260. package/es/tab/provide.mjs +10 -11
  261. package/es/tab-item/TabItem.mjs +27 -32
  262. package/es/tab-item/index.mjs +10 -5
  263. package/es/tab-item/props.mjs +5 -2
  264. package/es/tab-item/provide.mjs +17 -18
  265. package/es/table/Table.mjs +54 -25
  266. package/es/table/index.mjs +10 -5
  267. package/es/table/props.mjs +6 -3
  268. package/es/tabs/Tabs.mjs +162 -134
  269. package/es/tabs/index.mjs +10 -5
  270. package/es/tabs/props.mjs +15 -12
  271. package/es/tabs/provide.mjs +9 -9
  272. package/es/tabs-items/TabsItems.mjs +61 -65
  273. package/es/tabs-items/index.mjs +10 -5
  274. package/es/tabs-items/props.mjs +7 -4
  275. package/es/tabs-items/provide.mjs +11 -9
  276. package/es/themes/dark/actionSheet.mjs +8 -5
  277. package/es/themes/dark/appBar.mjs +6 -3
  278. package/es/themes/dark/avatar.mjs +7 -4
  279. package/es/themes/dark/badge.mjs +6 -3
  280. package/es/themes/dark/bottomNavigation.mjs +7 -4
  281. package/es/themes/dark/bottomNavigationItem.mjs +6 -3
  282. package/es/themes/dark/breadcrumb.mjs +6 -3
  283. package/es/themes/dark/button.mjs +7 -4
  284. package/es/themes/dark/card.mjs +10 -7
  285. package/es/themes/dark/cell.mjs +7 -4
  286. package/es/themes/dark/checkbox.mjs +7 -4
  287. package/es/themes/dark/chip.mjs +7 -4
  288. package/es/themes/dark/collapse.mjs +8 -5
  289. package/es/themes/dark/countdown.mjs +6 -3
  290. package/es/themes/dark/datePicker.mjs +10 -7
  291. package/es/themes/dark/dialog.mjs +8 -5
  292. package/es/themes/dark/divider.mjs +7 -4
  293. package/es/themes/dark/fieldDecorator.mjs +7 -4
  294. package/es/themes/dark/index.mjs +69 -51
  295. package/es/themes/dark/link.mjs +6 -3
  296. package/es/themes/dark/menu.mjs +6 -3
  297. package/es/themes/dark/option.mjs +6 -3
  298. package/es/themes/dark/pagination.mjs +11 -8
  299. package/es/themes/dark/paper.mjs +6 -3
  300. package/es/themes/dark/picker.mjs +11 -8
  301. package/es/themes/dark/popup.mjs +6 -3
  302. package/es/themes/dark/progress.mjs +6 -3
  303. package/es/themes/dark/pullRefresh.mjs +6 -3
  304. package/es/themes/dark/radio.mjs +7 -4
  305. package/es/themes/dark/result.mjs +12 -9
  306. package/es/themes/dark/select.mjs +6 -3
  307. package/es/themes/dark/skeleton.mjs +11 -6
  308. package/es/themes/dark/steps.mjs +8 -5
  309. package/es/themes/dark/switch.mjs +7 -4
  310. package/es/themes/dark/tab.mjs +6 -3
  311. package/es/themes/dark/table.mjs +12 -9
  312. package/es/themes/dark/tabs.mjs +6 -3
  313. package/es/themes/dark/timePicker.mjs +9 -6
  314. package/es/themes/dark/uploader.mjs +10 -7
  315. package/es/themes/dark/watermark.mjs +6 -3
  316. package/es/themes/index.mjs +7 -5
  317. package/es/time-picker/TimePicker.mjs +297 -232
  318. package/es/time-picker/clock.mjs +222 -172
  319. package/es/time-picker/index.mjs +10 -5
  320. package/es/time-picker/props.mjs +14 -8
  321. package/es/time-picker/utils.mjs +46 -86
  322. package/es/tooltip/Tooltip.mjs +82 -62
  323. package/es/tooltip/index.mjs +10 -5
  324. package/es/tooltip/props.mjs +12 -9
  325. package/es/uploader/Uploader.mjs +315 -308
  326. package/es/uploader/index.mjs +10 -5
  327. package/es/uploader/props.mjs +10 -7
  328. package/es/uploader/provide.ts +3 -0
  329. package/es/utils/components.mjs +158 -127
  330. package/es/utils/elements.mjs +106 -123
  331. package/es/utils/logger.mjs +9 -5
  332. package/es/utils/shared.mjs +25 -23
  333. package/es/utils/test.mjs +105 -93
  334. package/es/varlet.esm.js +12464 -13425
  335. package/es/watermark/Watermark.mjs +191 -109
  336. package/es/watermark/index.mjs +8 -4
  337. package/es/watermark/props.mjs +8 -5
  338. package/highlight/web-types.en-US.json +3 -3
  339. package/highlight/web-types.zh-CN.json +2 -2
  340. package/lib/varlet.cjs.js +9187 -10199
  341. package/package.json +7 -7
  342. package/umd/varlet.js +4 -4
  343. package/es/counter/provide.mjs +0 -1
  344. package/es/input/provide.mjs +0 -1
  345. package/es/rate/provide.mjs +0 -1
  346. package/es/slider/provide.mjs +0 -1
  347. package/es/switch/provide.mjs +0 -1
  348. package/es/uploader/provide.mjs +0 -1
@@ -1,196 +1,260 @@
1
- import VarFormDetails from '../form-details/index.mjs';
2
- import VarHoverOverlay, { useHoverOverlay } from '../hover-overlay/index.mjs';
3
- import Hover from '../hover/index.mjs';
4
- import { defineComponent, ref, onBeforeUnmount, computed, reactive, nextTick, watch, unref } from 'vue';
5
- import { useValidation, createNamespace, call } from '../utils/components.mjs';
6
- import { useForm } from '../form/provide.mjs';
7
- import { getLeft, multiplySizeUnit } from '../utils/elements.mjs';
8
- import { warn } from '../utils/logger.mjs';
9
- import { isArray, isNumber, toNumber, getRect } from '@varlet/shared';
10
- import { props, Thumbs } from './props.mjs';
11
- import { onSmartMounted } from '@varlet/use';
12
- var {
13
- name,
14
- n,
15
- classes
16
- } = createNamespace('slider');
1
+ import VarFormDetails from "../form-details/index.mjs";
2
+ import VarHoverOverlay, { useHoverOverlay } from "../hover-overlay/index.mjs";
3
+ import Hover from "../hover/index.mjs";
4
+ import { defineComponent, ref, onBeforeUnmount, computed, reactive, nextTick, watch, unref } from "vue";
5
+ import { useValidation, createNamespace, call } from "../utils/components.mjs";
6
+ import { useForm } from "../form/provide.mjs";
7
+ import { getLeft, multiplySizeUnit } from "../utils/elements.mjs";
8
+ import { warn } from "../utils/logger.mjs";
9
+ import { isArray, isNumber, toNumber, getRect } from "@varlet/shared";
10
+ import { props, Thumbs } from "./props.mjs";
11
+ import { onSmartMounted } from "@varlet/use";
12
+ const { name, n, classes } = createNamespace("slider");
17
13
  import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, resolveDirective as _resolveDirective, withDirectives as _withDirectives, resolveComponent as _resolveComponent, createVNode as _createVNode, toDisplayString as _toDisplayString, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
18
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
19
- var _hoisted_1 = ["onTouchstart"];
14
+ const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
15
+ const _hoisted_1 = ["onTouchstart"];
20
16
  function __render__(_ctx, _cache) {
21
- var _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
22
- var _component_var_form_details = _resolveComponent("var-form-details");
23
- var _directive_hover = _resolveDirective("hover");
24
- return _openBlock(), _createElementBlock("div", {
25
- class: _normalizeClass(_ctx.classes(_ctx.n(_ctx.direction), _ctx.n('$--box')))
26
- }, [_createElementVNode("div", {
27
- class: _normalizeClass(_ctx.classes(_ctx.n(_ctx.direction + "-block"), [_ctx.isDisabled, _ctx.n('--disabled')], [_ctx.errorMessage, _ctx.n(_ctx.direction + "--error")])),
28
- ref: "sliderEl",
29
- onClick: _cache[0] || (_cache[0] = function () {
30
- return _ctx.click && _ctx.click(...arguments);
31
- })
32
- }, [_createElementVNode("div", {
33
- class: _normalizeClass(_ctx.n(_ctx.direction + "-track"))
34
- }, [_createElementVNode("div", {
35
- class: _normalizeClass(_ctx.n(_ctx.direction + "-track-background")),
36
- style: _normalizeStyle({
37
- background: _ctx.trackColor,
38
- height: _ctx.isVertical ? '100%' : _ctx.multiplySizeUnit(_ctx.trackHeight),
39
- width: _ctx.isVertical ? _ctx.multiplySizeUnit(_ctx.trackHeight) : '100%'
40
- })
41
- }, null, 6 /* CLASS, STYLE */), _createElementVNode("div", {
42
- class: _normalizeClass(_ctx.n(_ctx.direction + "-track-fill")),
43
- style: _normalizeStyle(_ctx.getFillStyle)
44
- }, null, 6 /* CLASS, STYLE */)], 2 /* CLASS */), (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.thumbList, item => {
45
- return _openBlock(), _createElementBlock("div", {
46
- class: _normalizeClass(_ctx.n(_ctx.direction + "-thumb")),
47
- key: item.enumValue,
48
- style: _normalizeStyle(_ctx.thumbStyle(item)),
49
- onTouchstart: _withModifiers($event => _ctx.start($event, item.enumValue), ["stop"])
50
- }, [_renderSlot(_ctx.$slots, "button", {
51
- currentValue: item.text
52
- }, () => [_withDirectives(_createElementVNode("div", {
53
- class: _normalizeClass(_ctx.n(_ctx.direction + "-thumb-block")),
54
- style: _normalizeStyle({
55
- background: _ctx.thumbColor
56
- })
57
- }, null, 6 /* CLASS, STYLE */), [[_directive_hover, value => _ctx.hover(value, item), "desktop"]]), _createElementVNode("div", {
58
- class: _normalizeClass(_ctx.classes(_ctx.n(_ctx.direction + "-thumb-ripple"), [_ctx.thumbsProps[item.enumValue].active, _ctx.n(_ctx.direction + "-thumb-ripple--active")])),
59
- style: _normalizeStyle({
60
- background: _ctx.thumbsProps[item.enumValue].active ? _ctx.thumbColor : undefined
61
- })
62
- }, [_createVNode(_component_var_hover_overlay, {
63
- hovering: item.hovering
64
- }, null, 8 /* PROPS */, ["hovering"])], 6 /* CLASS, STYLE */), _createElementVNode("div", {
65
- class: _normalizeClass(_ctx.classes(_ctx.n(_ctx.direction + "-thumb-label"), [_ctx.showLabel(item.enumValue), _ctx.n(_ctx.direction + "-thumb-label--active")])),
66
- style: _normalizeStyle({
67
- background: _ctx.labelColor,
68
- color: _ctx.labelTextColor,
69
- height: _ctx.thumbSize === undefined ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 2),
70
- width: _ctx.thumbSize === undefined ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 2)
71
- })
72
- }, [_createElementVNode("span", null, _toDisplayString(item.text), 1 /* TEXT */)], 6 /* CLASS, STYLE */)])], 46 /* CLASS, STYLE, PROPS, HYDRATE_EVENTS */, _hoisted_1);
73
- }), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */), _createVNode(_component_var_form_details, {
74
- "error-message": _ctx.errorMessage,
75
- class: _normalizeClass(_ctx.n('form')),
76
- "var-slider-cover": ""
77
- }, null, 8 /* PROPS */, ["error-message", "class"])], 2 /* CLASS */);
17
+ const _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
18
+ const _component_var_form_details = _resolveComponent("var-form-details");
19
+ const _directive_hover = _resolveDirective("hover");
20
+ return _openBlock(), _createElementBlock(
21
+ "div",
22
+ {
23
+ class: _normalizeClass(_ctx.classes(_ctx.n(_ctx.direction), _ctx.n("$--box")))
24
+ },
25
+ [
26
+ _createElementVNode(
27
+ "div",
28
+ {
29
+ class: _normalizeClass(_ctx.classes(_ctx.n(`${_ctx.direction}-block`), [_ctx.isDisabled, _ctx.n("--disabled")], [_ctx.errorMessage, _ctx.n(`${_ctx.direction}--error`)])),
30
+ ref: "sliderEl",
31
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.click && _ctx.click(...args))
32
+ },
33
+ [
34
+ _createElementVNode(
35
+ "div",
36
+ {
37
+ class: _normalizeClass(_ctx.n(`${_ctx.direction}-track`))
38
+ },
39
+ [
40
+ _createElementVNode(
41
+ "div",
42
+ {
43
+ class: _normalizeClass(_ctx.n(`${_ctx.direction}-track-background`)),
44
+ style: _normalizeStyle({
45
+ background: _ctx.trackColor,
46
+ height: _ctx.isVertical ? "100%" : _ctx.multiplySizeUnit(_ctx.trackHeight),
47
+ width: _ctx.isVertical ? _ctx.multiplySizeUnit(_ctx.trackHeight) : "100%"
48
+ })
49
+ },
50
+ null,
51
+ 6
52
+ /* CLASS, STYLE */
53
+ ),
54
+ _createElementVNode(
55
+ "div",
56
+ {
57
+ class: _normalizeClass(_ctx.n(`${_ctx.direction}-track-fill`)),
58
+ style: _normalizeStyle(_ctx.getFillStyle)
59
+ },
60
+ null,
61
+ 6
62
+ /* CLASS, STYLE */
63
+ )
64
+ ],
65
+ 2
66
+ /* CLASS */
67
+ ),
68
+ (_openBlock(true), _createElementBlock(
69
+ _Fragment,
70
+ null,
71
+ _renderList(_ctx.thumbList, (item) => {
72
+ return _openBlock(), _createElementBlock("div", {
73
+ class: _normalizeClass(_ctx.n(`${_ctx.direction}-thumb`)),
74
+ key: item.enumValue,
75
+ style: _normalizeStyle(_ctx.thumbStyle(item)),
76
+ onTouchstart: _withModifiers(($event) => _ctx.start($event, item.enumValue), ["stop"])
77
+ }, [
78
+ _renderSlot(_ctx.$slots, "button", {
79
+ currentValue: item.text
80
+ }, () => [
81
+ _withDirectives(_createElementVNode(
82
+ "div",
83
+ {
84
+ class: _normalizeClass(_ctx.n(`${_ctx.direction}-thumb-block`)),
85
+ style: _normalizeStyle({
86
+ background: _ctx.thumbColor
87
+ })
88
+ },
89
+ null,
90
+ 6
91
+ /* CLASS, STYLE */
92
+ ), [
93
+ [_directive_hover, (value) => _ctx.hover(value, item), "desktop"]
94
+ ]),
95
+ _createElementVNode(
96
+ "div",
97
+ {
98
+ class: _normalizeClass(
99
+ _ctx.classes(_ctx.n(`${_ctx.direction}-thumb-ripple`), [
100
+ _ctx.thumbsProps[item.enumValue].active,
101
+ _ctx.n(`${_ctx.direction}-thumb-ripple--active`)
102
+ ])
103
+ ),
104
+ style: _normalizeStyle({
105
+ background: _ctx.thumbsProps[item.enumValue].active ? _ctx.thumbColor : void 0
106
+ })
107
+ },
108
+ [
109
+ _createVNode(_component_var_hover_overlay, {
110
+ hovering: item.hovering
111
+ }, null, 8, ["hovering"])
112
+ ],
113
+ 6
114
+ /* CLASS, STYLE */
115
+ ),
116
+ _createElementVNode(
117
+ "div",
118
+ {
119
+ class: _normalizeClass(
120
+ _ctx.classes(_ctx.n(`${_ctx.direction}-thumb-label`), [_ctx.showLabel(item.enumValue), _ctx.n(`${_ctx.direction}-thumb-label--active`)])
121
+ ),
122
+ style: _normalizeStyle({
123
+ background: _ctx.labelColor,
124
+ color: _ctx.labelTextColor,
125
+ height: _ctx.thumbSize === void 0 ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 2),
126
+ width: _ctx.thumbSize === void 0 ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 2)
127
+ })
128
+ },
129
+ [
130
+ _createElementVNode(
131
+ "span",
132
+ null,
133
+ _toDisplayString(item.text),
134
+ 1
135
+ /* TEXT */
136
+ )
137
+ ],
138
+ 6
139
+ /* CLASS, STYLE */
140
+ )
141
+ ])
142
+ ], 46, _hoisted_1);
143
+ }),
144
+ 128
145
+ /* KEYED_FRAGMENT */
146
+ ))
147
+ ],
148
+ 2
149
+ /* CLASS */
150
+ ),
151
+ _createVNode(_component_var_form_details, {
152
+ "error-message": _ctx.errorMessage,
153
+ class: _normalizeClass(_ctx.n("form")),
154
+ "var-slider-cover": ""
155
+ }, null, 8, ["error-message", "class"])
156
+ ],
157
+ 2
158
+ /* CLASS */
159
+ );
78
160
  }
79
-
80
- var __sfc__ = defineComponent({
161
+ const __sfc__ = defineComponent({
81
162
  name,
82
163
  components: {
83
164
  VarFormDetails,
84
165
  VarHoverOverlay
85
166
  },
86
- directives: {
87
- Hover
88
- },
167
+ directives: { Hover },
89
168
  props,
90
- setup(props) {
91
- var maxDistance = ref(0);
92
- var sliderEl = ref(null);
93
- var isScroll = ref(false);
94
- var scope = computed(() => toNumber(props.max) - toNumber(props.min));
95
- var unitWidth = computed(() => maxDistance.value / scope.value * toNumber(props.step));
96
- var isDisabled = computed(() => props.disabled || (form == null ? void 0 : form.disabled.value));
97
- var isReadonly = computed(() => props.readonly || (form == null ? void 0 : form.readonly.value));
98
- var isVertical = computed(() => props.direction === 'vertical');
99
- var {
100
- bindForm,
101
- form
102
- } = useForm();
103
- var {
104
- errorMessage,
105
- validateWithTrigger: vt,
106
- validate: v,
107
- resetValidation
108
- } = useValidation();
109
- var {
110
- hovering: hoveringFirst,
111
- handleHovering: handleHoveringFirst
112
- } = useHoverOverlay();
113
- var {
114
- hovering: hoveringSecond,
115
- handleHovering: handleHoveringSecond
116
- } = useHoverOverlay();
117
- var thumbList = computed(() => {
118
- var {
119
- modelValue,
120
- range
121
- } = props;
122
- var list = [];
169
+ setup(props2) {
170
+ const maxDistance = ref(0);
171
+ const sliderEl = ref(null);
172
+ const isScroll = ref(false);
173
+ const scope = computed(() => toNumber(props2.max) - toNumber(props2.min));
174
+ const unitWidth = computed(() => maxDistance.value / scope.value * toNumber(props2.step));
175
+ const isDisabled = computed(() => props2.disabled || (form == null ? void 0 : form.disabled.value));
176
+ const isReadonly = computed(() => props2.readonly || (form == null ? void 0 : form.readonly.value));
177
+ const isVertical = computed(() => props2.direction === "vertical");
178
+ const { bindForm, form } = useForm();
179
+ const { errorMessage, validateWithTrigger: vt, validate: v, resetValidation } = useValidation();
180
+ const { hovering: hoveringFirst, handleHovering: handleHoveringFirst } = useHoverOverlay();
181
+ const { hovering: hoveringSecond, handleHovering: handleHoveringSecond } = useHoverOverlay();
182
+ const thumbList = computed(() => {
183
+ const { modelValue, range } = props2;
184
+ let list = [];
123
185
  if (range && isArray(modelValue)) {
124
- list = [{
125
- value: getValue(modelValue[0]),
126
- enumValue: Thumbs.First,
127
- text: toPrecision(modelValue[0]),
128
- hovering: unref(hoveringFirst),
129
- handleHovering: handleHoveringFirst
130
- }, {
131
- value: getValue(modelValue[1]),
132
- enumValue: Thumbs.Second,
133
- text: toPrecision(modelValue[1]),
134
- hovering: unref(hoveringSecond),
135
- handleHovering: handleHoveringSecond
136
- }];
186
+ list = [
187
+ {
188
+ value: getValue(modelValue[0]),
189
+ enumValue: Thumbs.First,
190
+ text: toPrecision(modelValue[0]),
191
+ hovering: unref(hoveringFirst),
192
+ handleHovering: handleHoveringFirst
193
+ },
194
+ {
195
+ value: getValue(modelValue[1]),
196
+ enumValue: Thumbs.Second,
197
+ text: toPrecision(modelValue[1]),
198
+ hovering: unref(hoveringSecond),
199
+ handleHovering: handleHoveringSecond
200
+ }
201
+ ];
137
202
  } else if (isNumber(modelValue)) {
138
- list = [{
139
- value: getValue(modelValue),
140
- enumValue: Thumbs.First,
141
- text: toPrecision(modelValue),
142
- hovering: unref(hoveringFirst),
143
- handleHovering: handleHoveringFirst
144
- }];
203
+ list = [
204
+ {
205
+ value: getValue(modelValue),
206
+ enumValue: Thumbs.First,
207
+ text: toPrecision(modelValue),
208
+ hovering: unref(hoveringFirst),
209
+ handleHovering: handleHoveringFirst
210
+ }
211
+ ];
145
212
  }
146
213
  return list;
147
214
  });
148
- var getFillStyle = computed(() => {
149
- var {
150
- activeColor,
151
- range,
152
- modelValue
153
- } = props;
154
- var gap = range && isArray(modelValue) ? getValue(Math.min(modelValue[0], modelValue[1])) : 0;
155
- var fillLength = range && isArray(modelValue) ? getValue(Math.max(modelValue[0], modelValue[1])) - gap : getValue(modelValue);
215
+ const getFillStyle = computed(() => {
216
+ const { activeColor, range, modelValue } = props2;
217
+ const gap = range && isArray(modelValue) ? getValue(Math.min(modelValue[0], modelValue[1])) : 0;
218
+ const fillLength = range && isArray(modelValue) ? getValue(Math.max(modelValue[0], modelValue[1])) - gap : getValue(modelValue);
156
219
  return isVertical.value ? {
157
- left: '0px',
158
- height: fillLength + "%",
159
- bottom: gap + "%",
220
+ left: "0px",
221
+ height: `${fillLength}%`,
222
+ bottom: `${gap}%`,
160
223
  background: activeColor
161
224
  } : {
162
- top: '0px',
163
- width: fillLength + "%",
164
- left: gap + "%",
225
+ top: "0px",
226
+ width: `${fillLength}%`,
227
+ left: `${gap}%`,
165
228
  background: activeColor
166
229
  };
167
230
  });
168
- var thumbsProps = reactive({
231
+ const thumbsProps = reactive({
169
232
  [Thumbs.First]: getThumbProps(),
170
233
  [Thumbs.Second]: getThumbProps()
171
234
  });
172
- var activeThumb;
173
- var sliderProvider = {
235
+ let activeThumb;
236
+ const sliderProvider = {
174
237
  reset,
175
238
  validate,
176
239
  resetValidation
177
240
  };
178
241
  call(bindForm, sliderProvider);
179
- watch([() => props.modelValue, () => props.step], _ref => {
180
- var [modelValue, step] = _ref;
181
- if (!stepValidator() || !valueValidator() || isScroll.value) return;
242
+ watch([() => props2.modelValue, () => props2.step], ([modelValue, step]) => {
243
+ if (!stepValidator() || !valueValidator() || isScroll.value)
244
+ return;
182
245
  setProps(modelValue, toNumber(step));
183
246
  });
184
247
  watch(maxDistance, () => setProps());
185
248
  onSmartMounted(() => {
186
- if (!stepValidator() || !valueValidator()) return;
187
- maxDistance.value = sliderEl.value[isVertical.value ? 'offsetHeight' : 'offsetWidth'];
249
+ if (!stepValidator() || !valueValidator())
250
+ return;
251
+ maxDistance.value = sliderEl.value[isVertical.value ? "offsetHeight" : "offsetWidth"];
188
252
  });
189
253
  onBeforeUnmount(() => {
190
254
  removeDocumentEvents();
191
255
  });
192
256
  function validate() {
193
- return v(props.rules, props.modelValue);
257
+ return v(props2.rules, props2.modelValue);
194
258
  }
195
259
  function getThumbProps() {
196
260
  return {
@@ -201,140 +265,131 @@ var __sfc__ = defineComponent({
201
265
  };
202
266
  }
203
267
  function validateWithTrigger() {
204
- return nextTick(() => vt(['onChange'], 'onChange', props.rules, props.modelValue));
268
+ return nextTick(() => vt(["onChange"], "onChange", props2.rules, props2.modelValue));
205
269
  }
206
270
  function getOffset(e) {
207
- var currentTarget = e.currentTarget;
208
- if (!currentTarget) return 0;
271
+ const currentTarget = e.currentTarget;
272
+ if (!currentTarget)
273
+ return 0;
209
274
  if (!isVertical.value) {
210
275
  return e.clientX - getLeft(currentTarget);
211
276
  }
212
277
  return maxDistance.value - (e.clientY - getRect(currentTarget).top);
213
278
  }
214
279
  function thumbStyle(thumb) {
215
- var key = isVertical.value ? 'bottom' : 'left';
280
+ const key = isVertical.value ? "bottom" : "left";
216
281
  return {
217
- [key]: thumb.value + "%",
218
- zIndex: thumbsProps[thumb.enumValue].active ? 1 : undefined
282
+ [key]: `${thumb.value}%`,
283
+ zIndex: thumbsProps[thumb.enumValue].active ? 1 : void 0
219
284
  };
220
285
  }
221
286
  function showLabel(type) {
222
- if (props.labelVisible === 'always') return true;
223
- if (props.labelVisible === 'never') return false;
287
+ if (props2.labelVisible === "always")
288
+ return true;
289
+ if (props2.labelVisible === "never")
290
+ return false;
224
291
  return thumbsProps[type].active;
225
292
  }
226
293
  function getValue(value) {
227
- var {
228
- min,
229
- max
230
- } = props;
231
- if (value < toNumber(min)) return 0;
232
- if (value > toNumber(max)) return 100;
294
+ const { min, max } = props2;
295
+ if (value < toNumber(min))
296
+ return 0;
297
+ if (value > toNumber(max))
298
+ return 100;
233
299
  return (value - toNumber(min)) / scope.value * 100;
234
300
  }
235
301
  function toPrecision(value) {
236
- if (!isNumber(value)) return 0;
237
- var num = value;
238
- if (num < Number(props.min)) num = Number(props.min);
239
- if (num > Number(props.max)) num = Number(props.max);
240
- var isInteger = parseInt("" + num, 10) === num;
302
+ if (!isNumber(value))
303
+ return 0;
304
+ let num = value;
305
+ if (num < Number(props2.min))
306
+ num = Number(props2.min);
307
+ if (num > Number(props2.max))
308
+ num = Number(props2.max);
309
+ const isInteger = parseInt(`${num}`, 10) === num;
241
310
  return isInteger ? num : toNumber(num.toPrecision(5));
242
311
  }
243
312
  function hover(value, item) {
244
- if (isDisabled.value) return;
313
+ if (isDisabled.value)
314
+ return;
245
315
  item.handleHovering(value);
246
316
  }
247
317
  function setPercent(moveDistance, type) {
248
- var rangeValue = [];
249
- var {
250
- step,
251
- range,
252
- modelValue,
253
- onChange,
254
- min
255
- } = props;
256
- var stepNumber = toNumber(step);
257
- var roundDistance = Math.round(moveDistance / unitWidth.value);
258
- var curValue = roundDistance * stepNumber + toNumber(min);
259
- var prevValue = thumbsProps[type].percentValue * stepNumber + toNumber(min);
318
+ let rangeValue = [];
319
+ const { step, range, modelValue, onChange, min } = props2;
320
+ const stepNumber = toNumber(step);
321
+ const roundDistance = Math.round(moveDistance / unitWidth.value);
322
+ const curValue = roundDistance * stepNumber + toNumber(min);
323
+ const prevValue = thumbsProps[type].percentValue * stepNumber + toNumber(min);
260
324
  thumbsProps[type].percentValue = roundDistance;
261
325
  if (range && isArray(modelValue)) {
262
326
  rangeValue = type === Thumbs.First ? [curValue, modelValue[1]] : [modelValue[0], curValue];
263
327
  }
264
328
  if (prevValue !== curValue) {
265
- var value = range ? rangeValue.map(value => toPrecision(value)) : toPrecision(curValue);
329
+ const value = range ? rangeValue.map((value2) => toPrecision(value2)) : toPrecision(curValue);
266
330
  call(onChange, value);
267
- call(props['onUpdate:modelValue'], value);
331
+ call(props2["onUpdate:modelValue"], value);
268
332
  validateWithTrigger();
269
333
  }
270
334
  }
271
335
  function getType(offset) {
272
- if (!props.range) return Thumbs.First;
273
- var thumb1Distance = thumbsProps[Thumbs.First].percentValue * unitWidth.value;
274
- var thumb2Distance = thumbsProps[Thumbs.Second].percentValue * unitWidth.value;
275
- var offsetToThumb1 = Math.abs(offset - thumb1Distance);
276
- var offsetToThumb2 = Math.abs(offset - thumb2Distance);
336
+ if (!props2.range)
337
+ return Thumbs.First;
338
+ const thumb1Distance = thumbsProps[Thumbs.First].percentValue * unitWidth.value;
339
+ const thumb2Distance = thumbsProps[Thumbs.Second].percentValue * unitWidth.value;
340
+ const offsetToThumb1 = Math.abs(offset - thumb1Distance);
341
+ const offsetToThumb2 = Math.abs(offset - thumb2Distance);
277
342
  return offsetToThumb1 <= offsetToThumb2 ? Thumbs.First : Thumbs.Second;
278
343
  }
279
344
  function addDocumentEvents() {
280
- document.addEventListener('touchmove', move, {
281
- passive: false
282
- });
283
- document.addEventListener('touchend', end);
284
- document.addEventListener('touchcancel', end);
345
+ document.addEventListener("touchmove", move, { passive: false });
346
+ document.addEventListener("touchend", end);
347
+ document.addEventListener("touchcancel", end);
285
348
  }
286
349
  function removeDocumentEvents() {
287
- document.removeEventListener('touchmove', move);
288
- document.removeEventListener('touchend', end);
289
- document.removeEventListener('touchcancel', end);
350
+ document.removeEventListener("touchmove", move);
351
+ document.removeEventListener("touchend", end);
352
+ document.removeEventListener("touchcancel", end);
290
353
  }
291
354
  function start(event, type) {
292
- if (!maxDistance.value) maxDistance.value = sliderEl.value.offsetWidth;
355
+ if (!maxDistance.value)
356
+ maxDistance.value = sliderEl.value.offsetWidth;
293
357
  if (!isDisabled.value) {
294
358
  thumbsProps[type].active = true;
295
359
  }
296
360
  activeThumb = type;
297
361
  addDocumentEvents();
298
- if (isDisabled.value || isReadonly.value) return;
299
- call(props.onStart);
362
+ if (isDisabled.value || isReadonly.value)
363
+ return;
364
+ call(props2.onStart);
300
365
  isScroll.value = true;
301
- var {
302
- clientX,
303
- clientY
304
- } = event.touches[0];
366
+ const { clientX, clientY } = event.touches[0];
305
367
  thumbsProps[type].startPosition = isVertical.value ? clientY : clientX;
306
368
  }
307
369
  function move(event) {
308
370
  event.preventDefault();
309
- if (isDisabled.value || isReadonly.value || !isScroll.value) return;
310
- var {
311
- startPosition,
312
- currentOffset
313
- } = thumbsProps[activeThumb];
314
- var {
315
- clientX,
316
- clientY
317
- } = event.touches[0];
318
- var moveDistance = (isVertical.value ? startPosition - clientY : clientX - startPosition) + currentOffset;
319
- if (moveDistance <= 0) moveDistance = 0;else if (moveDistance >= maxDistance.value) moveDistance = maxDistance.value;
371
+ if (isDisabled.value || isReadonly.value || !isScroll.value)
372
+ return;
373
+ const { startPosition, currentOffset } = thumbsProps[activeThumb];
374
+ const { clientX, clientY } = event.touches[0];
375
+ let moveDistance = (isVertical.value ? startPosition - clientY : clientX - startPosition) + currentOffset;
376
+ if (moveDistance <= 0)
377
+ moveDistance = 0;
378
+ else if (moveDistance >= maxDistance.value)
379
+ moveDistance = maxDistance.value;
320
380
  setPercent(moveDistance, activeThumb);
321
381
  }
322
382
  function end() {
323
383
  removeDocumentEvents();
324
- var {
325
- range,
326
- modelValue,
327
- onEnd,
328
- step,
329
- min
330
- } = props;
384
+ const { range, modelValue, onEnd, step, min } = props2;
331
385
  if (!isDisabled.value) {
332
386
  thumbsProps[activeThumb].active = false;
333
387
  }
334
- if (isDisabled.value || isReadonly.value) return;
335
- var rangeValue = [];
388
+ if (isDisabled.value || isReadonly.value)
389
+ return;
390
+ let rangeValue = [];
336
391
  thumbsProps[activeThumb].currentOffset = thumbsProps[activeThumb].percentValue * unitWidth.value;
337
- var curValue = thumbsProps[activeThumb].percentValue * toNumber(step) + toNumber(min);
392
+ const curValue = thumbsProps[activeThumb].percentValue * toNumber(step) + toNumber(min);
338
393
  if (range && isArray(modelValue)) {
339
394
  rangeValue = activeThumb === Thumbs.First ? [curValue, modelValue[1]] : [modelValue[0], curValue];
340
395
  }
@@ -342,31 +397,30 @@ var __sfc__ = defineComponent({
342
397
  isScroll.value = false;
343
398
  }
344
399
  function click(event) {
345
- if (isDisabled.value || isReadonly.value) return;
346
- if (event.target.closest("." + n('thumb'))) return;
347
- var offset = getOffset(event);
348
- var type = getType(offset);
400
+ if (isDisabled.value || isReadonly.value)
401
+ return;
402
+ if (event.target.closest(`.${n("thumb")}`))
403
+ return;
404
+ const offset = getOffset(event);
405
+ const type = getType(offset);
349
406
  activeThumb = type;
350
407
  setPercent(offset, type);
351
408
  end();
352
409
  }
353
410
  function stepValidator() {
354
- var stepNumber = toNumber(props.step);
411
+ const stepNumber = toNumber(props2.step);
355
412
  if (isNaN(stepNumber)) {
356
- warn('Slider', 'type of prop "step" should be Number');
413
+ warn("Slider", 'type of prop "step" should be Number');
357
414
  return false;
358
415
  }
359
416
  if (stepNumber < 0) {
360
- warn('Slider', '"step" should be > 0');
417
+ warn("Slider", '"step" should be > 0');
361
418
  return false;
362
419
  }
363
420
  return true;
364
421
  }
365
422
  function valueValidator() {
366
- var {
367
- range,
368
- modelValue
369
- } = props;
423
+ const { range, modelValue } = props2;
370
424
  if (range && !isArray(modelValue)) {
371
425
  console.error('[Varlet] Slider: "modelValue" should be an Array');
372
426
  return false;
@@ -381,23 +435,16 @@ var __sfc__ = defineComponent({
381
435
  }
382
436
  return true;
383
437
  }
384
- function setProps(modelValue, step) {
385
- if (modelValue === void 0) {
386
- modelValue = props.modelValue;
387
- }
388
- if (step === void 0) {
389
- step = toNumber(props.step);
390
- }
391
- var getPercent = value => {
392
- var {
393
- min,
394
- max
395
- } = props;
396
- if (value < toNumber(min)) return 0;
397
- if (value > toNumber(max)) return scope.value / step;
438
+ function setProps(modelValue = props2.modelValue, step = toNumber(props2.step)) {
439
+ const getPercent = (value) => {
440
+ const { min, max } = props2;
441
+ if (value < toNumber(min))
442
+ return 0;
443
+ if (value > toNumber(max))
444
+ return scope.value / step;
398
445
  return (value - toNumber(min)) / step;
399
446
  };
400
- if (props.range && isArray(modelValue)) {
447
+ if (props2.range && isArray(modelValue)) {
401
448
  thumbsProps[Thumbs.First].percentValue = getPercent(modelValue[0]);
402
449
  thumbsProps[Thumbs.First].currentOffset = thumbsProps[Thumbs.First].percentValue * unitWidth.value;
403
450
  thumbsProps[Thumbs.Second].percentValue = getPercent(modelValue[1]);
@@ -407,8 +454,8 @@ var __sfc__ = defineComponent({
407
454
  }
408
455
  }
409
456
  function reset() {
410
- var resetValue = props.range ? [0, 0] : 0;
411
- call(props['onUpdate:modelValue'], resetValue);
457
+ const resetValue = props2.range ? [0, 0] : 0;
458
+ call(props2["onUpdate:modelValue"], resetValue);
412
459
  resetValidation();
413
460
  }
414
461
  return {
@@ -435,4 +482,7 @@ var __sfc__ = defineComponent({
435
482
  }
436
483
  });
437
484
  __sfc__.render = __render__;
438
- export default __sfc__;
485
+ var stdin_default = __sfc__;
486
+ export {
487
+ stdin_default as default
488
+ };