@varlet/ui 1.24.1 → 1.24.2

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 (163) hide show
  1. package/README.en-US.md +6 -0
  2. package/README.md +5 -0
  3. package/es/back-top/BackTop.js +3 -1
  4. package/es/badge/Badge.js +4 -3
  5. package/es/button/Button.js +6 -2
  6. package/es/card/Card.js +3 -1
  7. package/es/checkbox/Checkbox.js +3 -1
  8. package/es/checkbox-group/CheckboxGroup.js +23 -11
  9. package/es/chip/Chip.js +3 -1
  10. package/es/col/Col.js +3 -1
  11. package/es/collapse/Collapse.js +24 -14
  12. package/es/collapse-item/CollapseItem.js +3 -1
  13. package/es/counter/Counter.js +3 -1
  14. package/es/date-picker/DatePicker.js +2 -2
  15. package/es/date-picker/src/day-picker-panel.js +4 -3
  16. package/es/date-picker/src/month-picker-panel.js +4 -3
  17. package/es/date-picker/src/panel-header.js +4 -3
  18. package/es/date-picker/src/year-picker-panel.js +4 -3
  19. package/es/divider/Divider.js +4 -3
  20. package/es/form/Form.js +18 -9
  21. package/es/icon/icon.css +1 -1
  22. package/es/image/Image.js +18 -6
  23. package/es/image-preview/ImagePreview.js +21 -12
  24. package/es/index-bar/IndexBar.js +11 -7
  25. package/es/input/Input.js +27 -9
  26. package/es/lazy/index.js +5 -1
  27. package/es/list/List.js +3 -1
  28. package/es/loading/Loading.js +4 -3
  29. package/es/menu/Menu.js +57 -52
  30. package/es/menu/index.js +1 -1
  31. package/es/menu/style/index.js +0 -1
  32. package/es/menu/style/less.js +0 -1
  33. package/es/option/Option.js +3 -1
  34. package/es/pagination/Pagination.js +9 -3
  35. package/es/picker/Picker.js +5 -1
  36. package/es/popup/Popup.js +5 -4
  37. package/es/pull-refresh/PullRefresh.js +12 -4
  38. package/es/radio/Radio.js +3 -1
  39. package/es/radio-group/RadioGroup.js +6 -3
  40. package/es/row/Row.js +3 -1
  41. package/es/select/Select.js +36 -18
  42. package/es/slider/Slider.js +14 -3
  43. package/es/snackbar/index.js +16 -7
  44. package/es/snackbar/style/index.js +1 -1
  45. package/es/snackbar/style/less.js +1 -1
  46. package/es/space/Space.js +5 -3
  47. package/es/step/Step.js +6 -2
  48. package/es/style-provider/StyleProvider.js +4 -3
  49. package/es/style-provider/index.js +7 -2
  50. package/es/swipe/Swipe.js +16 -7
  51. package/es/switch/Switch.js +3 -1
  52. package/es/tab/Tab.js +3 -1
  53. package/es/tabs/Tabs.js +21 -12
  54. package/es/tabs-items/TabsItems.js +24 -12
  55. package/es/time-picker/TimePicker.js +9 -3
  56. package/es/time-picker/clock.js +9 -5
  57. package/es/uploader/Uploader.js +16 -8
  58. package/es/utils/components.js +9 -1
  59. package/es/utils/elements.js +9 -7
  60. package/es/utils/jest.js +41 -12
  61. package/es/utils/shared.js +20 -4
  62. package/lib/action-sheet/ActionSheet.js +1 -1
  63. package/lib/app-bar/AppBar.js +1 -1
  64. package/lib/back-top/BackTop.js +4 -2
  65. package/lib/badge/Badge.js +5 -4
  66. package/lib/button/Button.js +7 -3
  67. package/lib/card/Card.js +4 -2
  68. package/lib/cell/Cell.js +1 -1
  69. package/lib/checkbox/Checkbox.js +4 -2
  70. package/lib/checkbox-group/CheckboxGroup.js +24 -12
  71. package/lib/checkbox-group/provide.js +1 -1
  72. package/lib/chip/Chip.js +4 -2
  73. package/lib/col/Col.js +4 -2
  74. package/lib/collapse/Collapse.js +25 -15
  75. package/lib/collapse/provide.js +1 -1
  76. package/lib/collapse-item/CollapseItem.js +4 -2
  77. package/lib/context/lock.js +1 -1
  78. package/lib/countdown/Countdown.js +1 -1
  79. package/lib/counter/Counter.js +4 -2
  80. package/lib/date-picker/DatePicker.js +3 -3
  81. package/lib/date-picker/src/day-picker-panel.js +5 -4
  82. package/lib/date-picker/src/month-picker-panel.js +5 -4
  83. package/lib/date-picker/src/panel-header.js +5 -4
  84. package/lib/date-picker/src/year-picker-panel.js +5 -4
  85. package/lib/dialog/Dialog.js +1 -1
  86. package/lib/divider/Divider.js +5 -4
  87. package/lib/form/Form.js +19 -10
  88. package/lib/form/provide.js +1 -1
  89. package/lib/form-details/FormDetails.js +1 -1
  90. package/lib/icon/Icon.js +1 -1
  91. package/lib/icon/icon.css +1 -1
  92. package/lib/image/Image.js +19 -7
  93. package/lib/image-preview/ImagePreview.js +22 -13
  94. package/lib/index-anchor/IndexAnchor.js +1 -1
  95. package/lib/index-bar/IndexBar.js +12 -8
  96. package/lib/index-bar/provide.js +1 -1
  97. package/lib/input/Input.js +28 -10
  98. package/lib/input/props.js +1 -1
  99. package/lib/lazy/index.js +6 -2
  100. package/lib/list/List.js +4 -2
  101. package/lib/loading/Loading.js +5 -4
  102. package/lib/loading/props.js +2 -2
  103. package/lib/locale/index.js +1 -1
  104. package/lib/menu/Menu.js +54 -50
  105. package/lib/menu/index.js +1 -1
  106. package/lib/menu/style/index.js +0 -1
  107. package/lib/menu/style/less.js +0 -1
  108. package/lib/option/Option.js +4 -2
  109. package/lib/pagination/Pagination.js +10 -4
  110. package/lib/picker/Picker.js +6 -2
  111. package/lib/popup/Popup.js +5 -4
  112. package/lib/progress/Progress.js +1 -1
  113. package/lib/pull-refresh/PullRefresh.js +13 -5
  114. package/lib/radio/Radio.js +4 -2
  115. package/lib/radio-group/RadioGroup.js +7 -4
  116. package/lib/radio-group/provide.js +1 -1
  117. package/lib/rate/Rate.js +1 -1
  118. package/lib/row/Row.js +4 -2
  119. package/lib/row/provide.js +1 -1
  120. package/lib/select/Select.js +37 -19
  121. package/lib/select/props.js +1 -1
  122. package/lib/select/provide.js +1 -1
  123. package/lib/skeleton/Skeleton.js +1 -1
  124. package/lib/slider/Slider.js +15 -4
  125. package/lib/snackbar/Snackbar.js +1 -1
  126. package/lib/snackbar/core.js +1 -1
  127. package/lib/snackbar/index.js +16 -7
  128. package/lib/snackbar/props.js +1 -1
  129. package/lib/space/Space.js +5 -3
  130. package/lib/space/props.js +1 -1
  131. package/lib/step/Step.js +7 -3
  132. package/lib/steps/Steps.js +1 -1
  133. package/lib/steps/provide.js +1 -1
  134. package/lib/sticky/Sticky.js +1 -1
  135. package/lib/style-provider/StyleProvider.js +4 -3
  136. package/lib/style-provider/index.js +7 -2
  137. package/lib/style.css +1 -1
  138. package/lib/swipe/Swipe.js +17 -8
  139. package/lib/swipe/provide.js +1 -1
  140. package/lib/swipe-item/SwipeItem.js +1 -1
  141. package/lib/switch/Switch.js +4 -2
  142. package/lib/tab/Tab.js +4 -2
  143. package/lib/tab-item/TabItem.js +1 -1
  144. package/lib/table/Table.js +1 -1
  145. package/lib/tabs/Tabs.js +22 -13
  146. package/lib/tabs/provide.js +1 -1
  147. package/lib/tabs-items/TabsItems.js +25 -13
  148. package/lib/tabs-items/provide.js +1 -1
  149. package/lib/time-picker/TimePicker.js +10 -4
  150. package/lib/time-picker/clock.js +10 -6
  151. package/lib/time-picker/props.js +1 -1
  152. package/lib/time-picker/utils.js +1 -1
  153. package/lib/uploader/Uploader.js +17 -9
  154. package/lib/utils/components.js +15 -7
  155. package/lib/utils/elements.js +20 -17
  156. package/lib/utils/jest.js +49 -20
  157. package/lib/utils/shared.js +24 -6
  158. package/package.json +25 -17
  159. package/umd/varlet.js +4 -4
  160. package/es/menu/MenuSfc.css +0 -0
  161. package/es/menu/MenuSfc.less +0 -0
  162. package/lib/menu/MenuSfc.css +0 -0
  163. package/lib/menu/MenuSfc.less +0 -0
@@ -33,7 +33,9 @@ export function render(_ctx, _cache) {
33
33
  margin: _ctx.thumbSize === undefined ? _ctx.thumbSize : "0 " + _ctx.toNumber(_ctx.thumbSize) / 2 + "px"
34
34
  }),
35
35
  ref: "sliderEl",
36
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.click && _ctx.click(...args))
36
+ onClick: _cache[0] || (_cache[0] = function () {
37
+ return _ctx.click && _ctx.click(...arguments);
38
+ })
37
39
  }, [_createElementVNode("div", _hoisted_2, [_createElementVNode("div", {
38
40
  class: "var-slider__track-background",
39
41
  style: _normalizeStyle({
@@ -314,7 +316,15 @@ export default defineComponent({
314
316
  return true;
315
317
  };
316
318
 
317
- var setProps = (modelValue = props.modelValue, step = toNumber(props.step)) => {
319
+ var setProps = function (modelValue, step) {
320
+ if (modelValue === void 0) {
321
+ modelValue = props.modelValue;
322
+ }
323
+
324
+ if (step === void 0) {
325
+ step = toNumber(props.step);
326
+ }
327
+
318
328
  if (props.range && isArray(modelValue)) {
319
329
  thumbsProps[Thumbs.First].percentValue = modelValue[0] / step;
320
330
  thumbsProps[Thumbs.First].currentLeft = thumbsProps[Thumbs.First].percentValue * unitWidth.value;
@@ -325,7 +335,8 @@ export default defineComponent({
325
335
  }
326
336
  };
327
337
 
328
- watch([() => props.modelValue, () => props.step], ([modelValue, step]) => {
338
+ watch([() => props.modelValue, () => props.step], _ref => {
339
+ var [modelValue, step] = _ref;
329
340
  if (!stepValidator() || !valueValidator() || isScroll.value) return;
330
341
  setProps(modelValue, toNumber(step));
331
342
  });
@@ -44,11 +44,12 @@ var transitionGroupProps = {
44
44
  var TransitionGroupHost = {
45
45
  setup() {
46
46
  return () => {
47
- var snackbarList = uniqSnackbarOptions.map(({
48
- id,
49
- reactiveSnackOptions,
50
- _update
51
- }) => {
47
+ var snackbarList = uniqSnackbarOptions.map(_ref => {
48
+ var {
49
+ id,
50
+ reactiveSnackOptions,
51
+ _update
52
+ } = _ref;
52
53
  var transitionGroupEl = document.querySelector('.var-transition-group');
53
54
 
54
55
  if (reactiveSnackOptions.forbidClick || reactiveSnackOptions.type === 'loading') {
@@ -150,7 +151,11 @@ Snackbar.install = function (app) {
150
151
  app.component(VarSnackbar.name, VarSnackbar);
151
152
  };
152
153
 
153
- Snackbar.allowMultiple = function (bool = false) {
154
+ Snackbar.allowMultiple = function (bool) {
155
+ if (bool === void 0) {
156
+ bool = false;
157
+ }
158
+
154
159
  if (bool !== isAllowMultiple) {
155
160
  uniqSnackbarOptions.forEach(option => {
156
161
  option.reactiveSnackOptions.show = false;
@@ -202,7 +207,11 @@ function updateUniqOption(reactiveSnackOptions, _update) {
202
207
  firstOption._update = _update;
203
208
  }
204
209
 
205
- function getTop(position = 'top') {
210
+ function getTop(position) {
211
+ if (position === void 0) {
212
+ position = 'top';
213
+ }
214
+
206
215
  if (position === 'bottom') return {
207
216
  [position]: '5%'
208
217
  };
@@ -1,8 +1,8 @@
1
1
  import '../../styles/common.css'
2
- import '../SnackbarSfc.css'
3
2
  import '../../styles/elevation.css'
4
3
  import '../../loading/loading.css'
5
4
  import '../../button/button.css'
6
5
  import '../../icon/icon.css'
7
6
  import '../snackbar.css'
8
7
  import '../coreSfc.css'
8
+ import '../SnackbarSfc.css'
@@ -1,8 +1,8 @@
1
1
  import '../../styles/common.less'
2
- import '../SnackbarSfc.less'
3
2
  import '../../styles/elevation.less'
4
3
  import '../../loading/loading.less'
5
4
  import '../../button/button.less'
6
5
  import '../../icon/icon.less'
7
6
  import '../snackbar.less'
8
7
  import '../coreSfc.less'
8
+ import '../SnackbarSfc.less'
package/es/space/Space.js CHANGED
@@ -15,9 +15,11 @@ export default defineComponent({
15
15
  name: 'VarSpace',
16
16
  props,
17
17
 
18
- setup(props, {
19
- slots
20
- }) {
18
+ setup(props, _ref) {
19
+ var {
20
+ slots
21
+ } = _ref;
22
+
21
23
  var getSize = (size, isInternalSize) => {
22
24
  return isInternalSize ? internalSizes[size] : isArray(size) ? size.map(toPxNum) : [toPxNum(size), toPxNum(size)];
23
25
  };
package/es/step/Step.js CHANGED
@@ -28,7 +28,9 @@ export function render(_ctx, _cache) {
28
28
  style: _normalizeStyle({
29
29
  backgroundColor: _ctx.isActive || _ctx.isCurrent ? _ctx.activeColor : _ctx.inactiveColor
30
30
  }),
31
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.click && _ctx.click(...args))
31
+ onClick: _cache[0] || (_cache[0] = function () {
32
+ return _ctx.click && _ctx.click(...arguments);
33
+ })
32
34
  }, [_ctx.isActive ? (_openBlock(), _createBlock(_component_var_icon, {
33
35
  key: 0,
34
36
  class: "var-step__icon",
@@ -59,7 +61,9 @@ export function render(_ctx, _cache) {
59
61
  ["var-step-" + _ctx.direction + "__content"]: true,
60
62
  ["var-step-" + _ctx.direction + "__content--active"]: _ctx.isActive || _ctx.isCurrent
61
63
  }),
62
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.click && _ctx.click(...args))
64
+ onClick: _cache[1] || (_cache[1] = function () {
65
+ return _ctx.click && _ctx.click(...arguments);
66
+ })
63
67
  }, [_renderSlot(_ctx.$slots, "default")], 2
64
68
  /* CLASS */
65
69
  )], 2
@@ -9,9 +9,10 @@ export default defineComponent({
9
9
  }
10
10
  },
11
11
 
12
- setup(props, {
13
- slots
14
- }) {
12
+ setup(props, _ref) {
13
+ var {
14
+ slots
15
+ } = _ref;
15
16
  return () => h('div', {
16
17
  class: 'var-style-provider',
17
18
  style: formatStyleVars(props.styleVars)
@@ -2,11 +2,16 @@ import VarStyleProvider from './StyleProvider.js'
2
2
  import { formatStyleVars } from '../utils/elements';
3
3
  var mountedVarKeys = [];
4
4
 
5
- function StyleProvider(styleVars = {}) {
5
+ function StyleProvider(styleVars) {
6
+ if (styleVars === void 0) {
7
+ styleVars = {};
8
+ }
9
+
6
10
  mountedVarKeys.forEach(key => document.documentElement.style.removeProperty(key));
7
11
  mountedVarKeys.length = 0;
8
12
  var styles = formatStyleVars(styleVars);
9
- Object.entries(styles).forEach(([key, value]) => {
13
+ Object.entries(styles).forEach(_ref => {
14
+ var [key, value] = _ref;
10
15
  document.documentElement.style.setProperty(key, value);
11
16
  mountedVarKeys.push(key);
12
17
  });
package/es/swipe/Swipe.js CHANGED
@@ -23,9 +23,15 @@ export function render(_ctx, _cache) {
23
23
  transform: "translate" + (_ctx.vertical ? 'Y' : 'X') + "(" + _ctx.translate + "px)",
24
24
  transitionDuration: _ctx.lockDuration ? "0ms" : _ctx.toNumber(_ctx.duration) + "ms"
25
25
  }),
26
- onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.handleTouchstart && _ctx.handleTouchstart(...args)),
27
- onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.handleTouchmove && _ctx.handleTouchmove(...args)),
28
- onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.handleTouchend && _ctx.handleTouchend(...args))
26
+ onTouchstart: _cache[0] || (_cache[0] = function () {
27
+ return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
28
+ }),
29
+ onTouchmove: _cache[1] || (_cache[1] = function () {
30
+ return _ctx.handleTouchmove && _ctx.handleTouchmove(...arguments);
31
+ }),
32
+ onTouchend: _cache[2] || (_cache[2] = function () {
33
+ return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
34
+ })
29
35
  }, [_renderSlot(_ctx.$slots, "default")], 38
30
36
  /* CLASS, STYLE, HYDRATE_EVENTS */
31
37
  ), _renderSlot(_ctx.$slots, "indicator", {
@@ -79,9 +85,12 @@ export default defineComponent({
79
85
  var prevX;
80
86
  var prevY;
81
87
 
82
- var findSwipeItem = idx => swipeItems.find(({
83
- index
84
- }) => index.value === idx);
88
+ var findSwipeItem = idx => swipeItems.find(_ref => {
89
+ var {
90
+ index
91
+ } = _ref;
92
+ return index.value === idx;
93
+ });
85
94
 
86
95
  var dispatchBorrower = () => {
87
96
  if (!props.loop) {
@@ -195,7 +204,7 @@ export default defineComponent({
195
204
  };
196
205
 
197
206
  var stopAutoplay = () => {
198
- timer && clearInterval(timer);
207
+ timer && clearTimeout(timer);
199
208
  };
200
209
 
201
210
  var getDirection = (x, y) => {
@@ -22,7 +22,9 @@ export function render(_ctx, _cache) {
22
22
 
23
23
  return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
24
24
  class: _normalizeClass(["var-switch-block", [_ctx.disabled || _ctx.formDisabled ? 'var-switch__disable' : null]]),
25
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.switchActive && _ctx.switchActive(...args)),
25
+ onClick: _cache[0] || (_cache[0] = function () {
26
+ return _ctx.switchActive && _ctx.switchActive(...arguments);
27
+ }),
26
28
  style: _normalizeStyle(_ctx.styleComputed.switch)
27
29
  }, [_createElementVNode("div", {
28
30
  style: _normalizeStyle(_ctx.styleComputed.track),
package/es/tab/Tab.js CHANGED
@@ -12,7 +12,9 @@ export function render(_ctx, _cache) {
12
12
  style: _normalizeStyle({
13
13
  color: _ctx.computeColorStyle()
14
14
  }),
15
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
15
+ onClick: _cache[0] || (_cache[0] = function () {
16
+ return _ctx.handleClick && _ctx.handleClick(...arguments);
17
+ })
16
18
  }, [_renderSlot(_ctx.$slots, "default")], 6
17
19
  /* CLASS, STYLE */
18
20
  )), [[_directive_ripple, {
package/es/tabs/Tabs.js CHANGED
@@ -81,15 +81,21 @@ export default defineComponent({
81
81
  };
82
82
 
83
83
  var matchName = () => {
84
- return tabList.find(({
85
- name
86
- }) => props.active === name.value);
84
+ return tabList.find(_ref => {
85
+ var {
86
+ name
87
+ } = _ref;
88
+ return props.active === name.value;
89
+ });
87
90
  };
88
91
 
89
92
  var matchIndex = () => {
90
- return tabList.find(({
91
- index
92
- }) => props.active === index.value);
93
+ return tabList.find(_ref2 => {
94
+ var {
95
+ index
96
+ } = _ref2;
97
+ return props.active === index.value;
98
+ });
93
99
  };
94
100
 
95
101
  var matchBoundary = () => {
@@ -110,9 +116,10 @@ export default defineComponent({
110
116
  scrollable.value = tabList.length >= 5;
111
117
  };
112
118
 
113
- var moveIndicator = ({
114
- element
115
- }) => {
119
+ var moveIndicator = _ref3 => {
120
+ var {
121
+ element
122
+ } = _ref3;
116
123
  var el = element.value;
117
124
 
118
125
  if (props.layoutDirection === 'horizontal') {
@@ -124,9 +131,11 @@ export default defineComponent({
124
131
  }
125
132
  };
126
133
 
127
- var scrollToCenter = ({
128
- element
129
- }) => {
134
+ var scrollToCenter = _ref4 => {
135
+ var {
136
+ element
137
+ } = _ref4;
138
+
130
139
  if (!scrollable.value) {
131
140
  return;
132
141
  }
@@ -39,15 +39,21 @@ export default defineComponent({
39
39
  } = useTabItem();
40
40
 
41
41
  var matchName = active => {
42
- return tabItemList.find(({
43
- name
44
- }) => active === name.value);
42
+ return tabItemList.find(_ref => {
43
+ var {
44
+ name
45
+ } = _ref;
46
+ return active === name.value;
47
+ });
45
48
  };
46
49
 
47
50
  var matchIndex = active => {
48
- return tabItemList.find(({
49
- index
50
- }) => active === index.value);
51
+ return tabItemList.find(_ref2 => {
52
+ var {
53
+ index
54
+ } = _ref2;
55
+ return active === index.value;
56
+ });
51
57
  };
52
58
 
53
59
  var matchActive = active => {
@@ -63,9 +69,12 @@ export default defineComponent({
63
69
  return;
64
70
  }
65
71
 
66
- tabItemList.forEach(({
67
- setCurrent
68
- }) => setCurrent(false));
72
+ tabItemList.forEach(_ref3 => {
73
+ var {
74
+ setCurrent
75
+ } = _ref3;
76
+ return setCurrent(false);
77
+ });
69
78
  newActiveTabItemProvider.setCurrent(true);
70
79
  (_swipe$value = swipe.value) == null ? void 0 : _swipe$value.to(newActiveTabItemProvider.index.value);
71
80
  };
@@ -73,9 +82,12 @@ export default defineComponent({
73
82
  var handleSwipeChange = currentIndex => {
74
83
  var _tabItem$name$value, _props$onUpdateActiv;
75
84
 
76
- var tabItem = tabItemList.find(({
77
- index
78
- }) => index.value === currentIndex);
85
+ var tabItem = tabItemList.find(_ref4 => {
86
+ var {
87
+ index
88
+ } = _ref4;
89
+ return index.value === currentIndex;
90
+ });
79
91
  var active = (_tabItem$name$value = tabItem.name.value) != null ? _tabItem$name$value : tabItem.index.value;
80
92
  (_props$onUpdateActiv = props['onUpdate:active']) == null ? void 0 : _props$onUpdateActiv.call(props, active);
81
93
  };
@@ -67,9 +67,15 @@ export function render(_ctx, _cache) {
67
67
  /* STYLE */
68
68
  ), _createElementVNode("div", _hoisted_5, [_createElementVNode("div", {
69
69
  class: "var-time-picker-clock__container",
70
- onTouchstart: _cache[5] || (_cache[5] = (...args) => _ctx.moveHand && _ctx.moveHand(...args)),
71
- onTouchmove: _cache[6] || (_cache[6] = (...args) => _ctx.moveHand && _ctx.moveHand(...args)),
72
- onTouchend: _cache[7] || (_cache[7] = (...args) => _ctx.end && _ctx.end(...args)),
70
+ onTouchstart: _cache[5] || (_cache[5] = function () {
71
+ return _ctx.moveHand && _ctx.moveHand(...arguments);
72
+ }),
73
+ onTouchmove: _cache[6] || (_cache[6] = function () {
74
+ return _ctx.moveHand && _ctx.moveHand(...arguments);
75
+ }),
76
+ onTouchend: _cache[7] || (_cache[7] = function () {
77
+ return _ctx.end && _ctx.end(...arguments);
78
+ }),
73
79
  ref: "container"
74
80
  }, [_createVNode(_Transition, {
75
81
  name: "var-time-picker-panel-fade"
@@ -95,9 +95,10 @@ export default defineComponent({
95
95
  },
96
96
  emits: ['update', 'change-prevent-update'],
97
97
 
98
- setup(props, {
99
- emit
100
- }) {
98
+ setup(props, _ref) {
99
+ var {
100
+ emit
101
+ } = _ref;
101
102
  var inner = ref(null);
102
103
  var disableHour = ref([]);
103
104
  var disable24HourIndex = ref([]);
@@ -218,7 +219,9 @@ export default defineComponent({
218
219
  return hours[activeItemIndex.value].padStart(2, '0');
219
220
  };
220
221
 
221
- watch([activeItemIndex, () => props.isInner], ([index, inner], [oldIndex, oldInner]) => {
222
+ watch([activeItemIndex, () => props.isInner], (_ref2, _ref3) => {
223
+ var [index, inner] = _ref2;
224
+ var [oldIndex, oldInner] = _ref3;
222
225
  var isSame = index === oldIndex && inner === oldInner;
223
226
  if (isSame || props.type !== 'hour' || activeItemIndex.value === undefined) return;
224
227
  var newHour = inner ? hours24[activeItemIndex.value] : getHour();
@@ -253,7 +256,8 @@ export default defineComponent({
253
256
 
254
257
  emit('update', newTime);
255
258
  });
256
- watch([() => props.max, () => props.min, () => props.allowedTime], ([max, min, allowedTime]) => {
259
+ watch([() => props.max, () => props.min, () => props.allowedTime], _ref4 => {
260
+ var [max, min, allowedTime] = _ref4;
257
261
  disableHour.value = [];
258
262
 
259
263
  if (max && !min) {
@@ -88,7 +88,9 @@ export function render(_ctx, _cache) {
88
88
  accept: _ctx.accept,
89
89
  capture: _ctx.capture,
90
90
  disabled: _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly,
91
- onChange: _cache[0] || (_cache[0] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
91
+ onChange: _cache[0] || (_cache[0] = function () {
92
+ return _ctx.handleChange && _ctx.handleChange(...arguments);
93
+ })
92
94
  }, null, 40
93
95
  /* PROPS, HYDRATE_EVENTS */
94
96
  , _hoisted_7), _renderSlot(_ctx.$slots, "default", {}, () => [_createVNode(_component_var_icon, {
@@ -291,11 +293,17 @@ export default defineComponent({
291
293
 
292
294
  var resolvedVarFiles = yield Promise.all(getResolvers(varFiles));
293
295
  var validationVarFiles = yield Promise.all(getBeforeReaders(resolvedVarFiles));
294
- var validVarFiles = validationVarFiles.filter(({
295
- valid
296
- }) => valid).map(({
297
- varFile
298
- }) => varFile);
296
+ var validVarFiles = validationVarFiles.filter(_ref2 => {
297
+ var {
298
+ valid
299
+ } = _ref2;
300
+ return valid;
301
+ }).map(_ref3 => {
302
+ var {
303
+ varFile
304
+ } = _ref3;
305
+ return varFile;
306
+ });
299
307
  (_props$onUpdateModel = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel.call(props, [...modelValue, ...validVarFiles]);
300
308
  event.target.value = '';
301
309
  validVarFiles.forEach(varFile => onAfterRead == null ? void 0 : onAfterRead(reactive(varFile)));
@@ -307,7 +315,7 @@ export default defineComponent({
307
315
  }();
308
316
 
309
317
  var handleRemove = /*#__PURE__*/function () {
310
- var _ref2 = _asyncToGenerator(function* (removedVarFile) {
318
+ var _ref4 = _asyncToGenerator(function* (removedVarFile) {
311
319
  var _props$onUpdateModel2;
312
320
 
313
321
  var {
@@ -333,7 +341,7 @@ export default defineComponent({
333
341
  });
334
342
 
335
343
  return function handleRemove(_x2) {
336
- return _ref2.apply(this, arguments);
344
+ return _ref4.apply(this, arguments);
337
345
  };
338
346
  }(); // expose
339
347
 
@@ -30,7 +30,15 @@ export function mount(component) {
30
30
 
31
31
  };
32
32
  }
33
- export function mountInstance(component, props = {}, eventListener = {}) {
33
+ export function mountInstance(component, props, eventListener) {
34
+ if (props === void 0) {
35
+ props = {};
36
+ }
37
+
38
+ if (eventListener === void 0) {
39
+ eventListener = {};
40
+ }
41
+
34
42
  var Host = {
35
43
  setup() {
36
44
  return () => h(component, _extends({}, props, eventListener));
@@ -170,12 +170,13 @@ export function doubleRaf() {
170
170
  });
171
171
  });
172
172
  }
173
- export function scrollTo(element, {
174
- top = 0,
175
- left = 0,
176
- duration = 300,
177
- animation
178
- }) {
173
+ export function scrollTo(element, _ref) {
174
+ var {
175
+ top = 0,
176
+ left = 0,
177
+ duration = 300,
178
+ animation
179
+ } = _ref;
179
180
  var startTime = Date.now();
180
181
  var scrollTop = getScrollTop(element);
181
182
  var scrollLeft = getScrollLeft(element);
@@ -198,7 +199,8 @@ export function scrollTo(element, {
198
199
  });
199
200
  }
200
201
  export function formatStyleVars(styleVars) {
201
- return Object.entries(styleVars != null ? styleVars : {}).reduce((styles, [key, value]) => {
202
+ return Object.entries(styleVars != null ? styleVars : {}).reduce((styles, _ref2) => {
203
+ var [key, value] = _ref2;
202
204
  var cssVar = key.startsWith('--') ? key : "--" + kebabCase(key);
203
205
  styles[cssVar] = value;
204
206
  return styles;
package/es/utils/jest.js CHANGED
@@ -35,7 +35,23 @@ export function mockDoubleRaf() {
35
35
 
36
36
  };
37
37
  }
38
- export function trigger(wrapper, eventName, x = 0, y = 0, offsetX = 0, offsetY = 0) {
38
+ export function trigger(wrapper, eventName, x, y, offsetX, offsetY) {
39
+ if (x === void 0) {
40
+ x = 0;
41
+ }
42
+
43
+ if (y === void 0) {
44
+ y = 0;
45
+ }
46
+
47
+ if (offsetX === void 0) {
48
+ offsetX = 0;
49
+ }
50
+
51
+ if (offsetY === void 0) {
52
+ offsetY = 0;
53
+ }
54
+
39
55
  var el = 'element' in wrapper ? wrapper.element : wrapper;
40
56
  var touchList = [getTouch(el, x, y)];
41
57
  var event = document.createEvent('CustomEvent');
@@ -52,14 +68,15 @@ export function trigger(wrapper, eventName, x = 0, y = 0, offsetX = 0, offsetY =
52
68
  el.dispatchEvent(event);
53
69
  return nextTick();
54
70
  }
55
- export function mockOffset({
56
- offsetWidth,
57
- offsetHeight,
58
- clientWidth,
59
- clientHeight,
60
- offsetLeft,
61
- offsetTop
62
- } = {}) {
71
+ export function mockOffset(_temp) {
72
+ var {
73
+ offsetWidth,
74
+ offsetHeight,
75
+ clientWidth,
76
+ clientHeight,
77
+ offsetLeft,
78
+ offsetTop
79
+ } = _temp === void 0 ? {} : _temp;
63
80
  Object.defineProperties(HTMLElement.prototype, {
64
81
  offsetWidth: {
65
82
  get() {
@@ -123,12 +140,20 @@ export function mockImageNaturalSize(naturalWidth, naturalHeight) {
123
140
  }
124
141
  });
125
142
  }
126
- export function triggerDrag(_x) {
143
+ export function triggerDrag(_x, _x2, _x3) {
127
144
  return _triggerDrag.apply(this, arguments);
128
145
  }
129
146
 
130
147
  function _triggerDrag() {
131
- _triggerDrag = _asyncToGenerator(function* (el, x = 0, y = 0) {
148
+ _triggerDrag = _asyncToGenerator(function* (el, x, y) {
149
+ if (x === void 0) {
150
+ x = 0;
151
+ }
152
+
153
+ if (y === void 0) {
154
+ y = 0;
155
+ }
156
+
132
157
  yield trigger(el, 'touchstart', 0, 0);
133
158
  yield trigger(el, 'touchmove', x / 4, y / 4);
134
159
  yield trigger(el, 'touchmove', x / 3, y / 3);
@@ -198,7 +223,11 @@ export function mockStubs() {
198
223
 
199
224
  };
200
225
  }
201
- export function mockConsole(method, fn = () => {}) {
226
+ export function mockConsole(method, fn) {
227
+ if (fn === void 0) {
228
+ fn = () => {};
229
+ }
230
+
202
231
  var originMethod = console[method];
203
232
  console[method] = fn;
204
233
  return {
@@ -46,10 +46,18 @@ export var removeItem = (arr, item) => {
46
46
  }
47
47
  }
48
48
  };
49
- export var throttle = (method, mustRunDelay = 200) => {
49
+ export var throttle = function (method, mustRunDelay) {
50
+ if (mustRunDelay === void 0) {
51
+ mustRunDelay = 200;
52
+ }
53
+
50
54
  var timer;
51
55
  var start = 0;
52
- return function loop(...args) {
56
+ return function loop() {
57
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
58
+ args[_key] = arguments[_key];
59
+ }
60
+
53
61
  var now = Date.now();
54
62
  var elapsed = now - start;
55
63
 
@@ -71,9 +79,17 @@ export var throttle = (method, mustRunDelay = 200) => {
71
79
  }
72
80
  };
73
81
  };
74
- export var debounce = (method, delay = 200) => {
82
+ export var debounce = function (method, delay) {
83
+ if (delay === void 0) {
84
+ delay = 200;
85
+ }
86
+
75
87
  var timer;
76
- return function (...args) {
88
+ return function () {
89
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
90
+ args[_key2] = arguments[_key2];
91
+ }
92
+
77
93
  timer && window.clearTimeout(timer);
78
94
  timer = window.setTimeout(() => {
79
95
  method.apply(this, args);
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.render = render;
5
4
  exports.default = void 0;
5
+ exports.render = render;
6
6
 
7
7
  var _ripple = _interopRequireDefault(require("../ripple"));
8
8
 
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.render = render;
5
4
  exports.default = void 0;
5
+ exports.render = render;
6
6
 
7
7
  var _vue = require("vue");
8
8