@varlet/ui 1.24.1 → 1.24.2-alpha.1640861757955

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 (159) hide show
  1. package/es/back-top/BackTop.js +3 -1
  2. package/es/badge/Badge.js +4 -3
  3. package/es/button/Button.js +6 -2
  4. package/es/card/Card.js +3 -1
  5. package/es/checkbox/Checkbox.js +3 -1
  6. package/es/checkbox-group/CheckboxGroup.js +23 -11
  7. package/es/chip/Chip.js +3 -1
  8. package/es/col/Col.js +3 -1
  9. package/es/collapse/Collapse.js +24 -14
  10. package/es/collapse-item/CollapseItem.js +3 -1
  11. package/es/counter/Counter.js +3 -1
  12. package/es/date-picker/DatePicker.js +2 -2
  13. package/es/date-picker/src/day-picker-panel.js +4 -3
  14. package/es/date-picker/src/month-picker-panel.js +4 -3
  15. package/es/date-picker/src/panel-header.js +4 -3
  16. package/es/date-picker/src/year-picker-panel.js +4 -3
  17. package/es/divider/Divider.js +4 -3
  18. package/es/form/Form.js +18 -9
  19. package/es/icon/icon.css +1 -1
  20. package/es/image/Image.js +18 -6
  21. package/es/image-preview/ImagePreview.js +21 -12
  22. package/es/index-bar/IndexBar.js +11 -7
  23. package/es/input/Input.js +27 -9
  24. package/es/lazy/index.js +5 -1
  25. package/es/list/List.js +3 -1
  26. package/es/loading/Loading.js +4 -3
  27. package/es/menu/Menu.js +59 -52
  28. package/es/menu/index.js +1 -1
  29. package/es/menu/style/index.js +0 -1
  30. package/es/menu/style/less.js +0 -1
  31. package/es/option/Option.js +3 -1
  32. package/es/pagination/Pagination.js +9 -3
  33. package/es/picker/Picker.js +5 -1
  34. package/es/popup/Popup.js +5 -4
  35. package/es/pull-refresh/PullRefresh.js +12 -4
  36. package/es/radio/Radio.js +3 -1
  37. package/es/radio-group/RadioGroup.js +6 -3
  38. package/es/row/Row.js +3 -1
  39. package/es/select/Select.js +36 -18
  40. package/es/slider/Slider.js +14 -3
  41. package/es/snackbar/index.js +16 -7
  42. package/es/space/Space.js +5 -3
  43. package/es/step/Step.js +6 -2
  44. package/es/style-provider/StyleProvider.js +4 -3
  45. package/es/style-provider/index.js +7 -2
  46. package/es/swipe/Swipe.js +16 -7
  47. package/es/switch/Switch.js +3 -1
  48. package/es/tab/Tab.js +3 -1
  49. package/es/tabs/Tabs.js +21 -12
  50. package/es/tabs-items/TabsItems.js +24 -12
  51. package/es/time-picker/TimePicker.js +9 -3
  52. package/es/time-picker/clock.js +9 -5
  53. package/es/uploader/Uploader.js +16 -8
  54. package/es/utils/components.js +9 -1
  55. package/es/utils/elements.js +9 -7
  56. package/es/utils/jest.js +41 -12
  57. package/es/utils/shared.js +20 -4
  58. package/lib/action-sheet/ActionSheet.js +1 -1
  59. package/lib/app-bar/AppBar.js +1 -1
  60. package/lib/back-top/BackTop.js +4 -2
  61. package/lib/badge/Badge.js +5 -4
  62. package/lib/button/Button.js +7 -3
  63. package/lib/card/Card.js +4 -2
  64. package/lib/cell/Cell.js +1 -1
  65. package/lib/checkbox/Checkbox.js +4 -2
  66. package/lib/checkbox-group/CheckboxGroup.js +24 -12
  67. package/lib/checkbox-group/provide.js +1 -1
  68. package/lib/chip/Chip.js +4 -2
  69. package/lib/col/Col.js +4 -2
  70. package/lib/collapse/Collapse.js +25 -15
  71. package/lib/collapse/provide.js +1 -1
  72. package/lib/collapse-item/CollapseItem.js +4 -2
  73. package/lib/context/lock.js +1 -1
  74. package/lib/countdown/Countdown.js +1 -1
  75. package/lib/counter/Counter.js +4 -2
  76. package/lib/date-picker/DatePicker.js +3 -3
  77. package/lib/date-picker/src/day-picker-panel.js +5 -4
  78. package/lib/date-picker/src/month-picker-panel.js +5 -4
  79. package/lib/date-picker/src/panel-header.js +5 -4
  80. package/lib/date-picker/src/year-picker-panel.js +5 -4
  81. package/lib/dialog/Dialog.js +1 -1
  82. package/lib/divider/Divider.js +5 -4
  83. package/lib/form/Form.js +19 -10
  84. package/lib/form/provide.js +1 -1
  85. package/lib/form-details/FormDetails.js +1 -1
  86. package/lib/icon/Icon.js +1 -1
  87. package/lib/icon/icon.css +1 -1
  88. package/lib/image/Image.js +19 -7
  89. package/lib/image-preview/ImagePreview.js +22 -13
  90. package/lib/index-anchor/IndexAnchor.js +1 -1
  91. package/lib/index-bar/IndexBar.js +12 -8
  92. package/lib/index-bar/provide.js +1 -1
  93. package/lib/input/Input.js +28 -10
  94. package/lib/input/props.js +1 -1
  95. package/lib/lazy/index.js +6 -2
  96. package/lib/list/List.js +4 -2
  97. package/lib/loading/Loading.js +5 -4
  98. package/lib/loading/props.js +2 -2
  99. package/lib/locale/index.js +1 -1
  100. package/lib/menu/Menu.js +56 -50
  101. package/lib/menu/index.js +1 -1
  102. package/lib/menu/style/index.js +0 -1
  103. package/lib/menu/style/less.js +0 -1
  104. package/lib/option/Option.js +4 -2
  105. package/lib/pagination/Pagination.js +10 -4
  106. package/lib/picker/Picker.js +6 -2
  107. package/lib/popup/Popup.js +5 -4
  108. package/lib/progress/Progress.js +1 -1
  109. package/lib/pull-refresh/PullRefresh.js +13 -5
  110. package/lib/radio/Radio.js +4 -2
  111. package/lib/radio-group/RadioGroup.js +7 -4
  112. package/lib/radio-group/provide.js +1 -1
  113. package/lib/rate/Rate.js +1 -1
  114. package/lib/row/Row.js +4 -2
  115. package/lib/row/provide.js +1 -1
  116. package/lib/select/Select.js +37 -19
  117. package/lib/select/props.js +1 -1
  118. package/lib/select/provide.js +1 -1
  119. package/lib/skeleton/Skeleton.js +1 -1
  120. package/lib/slider/Slider.js +15 -4
  121. package/lib/snackbar/Snackbar.js +1 -1
  122. package/lib/snackbar/core.js +1 -1
  123. package/lib/snackbar/index.js +16 -7
  124. package/lib/snackbar/props.js +1 -1
  125. package/lib/space/Space.js +5 -3
  126. package/lib/space/props.js +1 -1
  127. package/lib/step/Step.js +7 -3
  128. package/lib/steps/Steps.js +1 -1
  129. package/lib/steps/provide.js +1 -1
  130. package/lib/sticky/Sticky.js +1 -1
  131. package/lib/style-provider/StyleProvider.js +4 -3
  132. package/lib/style-provider/index.js +7 -2
  133. package/lib/style.css +1 -1
  134. package/lib/swipe/Swipe.js +17 -8
  135. package/lib/swipe/provide.js +1 -1
  136. package/lib/swipe-item/SwipeItem.js +1 -1
  137. package/lib/switch/Switch.js +4 -2
  138. package/lib/tab/Tab.js +4 -2
  139. package/lib/tab-item/TabItem.js +1 -1
  140. package/lib/table/Table.js +1 -1
  141. package/lib/tabs/Tabs.js +22 -13
  142. package/lib/tabs/provide.js +1 -1
  143. package/lib/tabs-items/TabsItems.js +25 -13
  144. package/lib/tabs-items/provide.js +1 -1
  145. package/lib/time-picker/TimePicker.js +10 -4
  146. package/lib/time-picker/clock.js +10 -6
  147. package/lib/time-picker/props.js +1 -1
  148. package/lib/time-picker/utils.js +1 -1
  149. package/lib/uploader/Uploader.js +17 -9
  150. package/lib/utils/components.js +15 -7
  151. package/lib/utils/elements.js +20 -17
  152. package/lib/utils/jest.js +49 -20
  153. package/lib/utils/shared.js +24 -6
  154. package/package.json +25 -17
  155. package/umd/varlet.js +4 -4
  156. package/es/menu/MenuSfc.css +0 -0
  157. package/es/menu/MenuSfc.less +0 -0
  158. package/lib/menu/MenuSfc.css +0 -0
  159. package/lib/menu/MenuSfc.less +0 -0
@@ -63,9 +63,15 @@ export function render(_ctx, _cache) {
63
63
  transitionTimingFunction: _ctx.transitionTimingFunction,
64
64
  transitionDuration: _ctx.transitionDuration
65
65
  }),
66
- onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.handleTouchstart && _ctx.handleTouchstart(...args)),
67
- onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.handleTouchmove && _ctx.handleTouchmove(...args)),
68
- onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.handleTouchend && _ctx.handleTouchend(...args))
66
+ onTouchstart: _cache[0] || (_cache[0] = function () {
67
+ return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
68
+ }),
69
+ onTouchmove: _cache[1] || (_cache[1] = function () {
70
+ return _ctx.handleTouchmove && _ctx.handleTouchmove(...arguments);
71
+ }),
72
+ onTouchend: _cache[2] || (_cache[2] = function () {
73
+ return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
74
+ })
69
75
  }, [_createElementVNode("img", {
70
76
  class: "var-image-preview__image",
71
77
  src: image,
@@ -84,15 +90,18 @@ export function render(_ctx, _cache) {
84
90
  }), 128
85
91
  /* KEYED_FRAGMENT */
86
92
  ))]),
87
- indicator: _withCtx(({
88
- index,
89
- length
90
- }) => [_renderSlot(_ctx.$slots, "indicator", {
91
- index: index,
92
- length: length
93
- }, () => [_ctx.indicator && _ctx.images.length > 1 ? (_openBlock(), _createElementBlock("div", _hoisted_2, _toDisplayString(index + 1) + " / " + _toDisplayString(length), 1
94
- /* TEXT */
95
- )) : _createCommentVNode("v-if", true)])]),
93
+ indicator: _withCtx(_ref => {
94
+ var {
95
+ index,
96
+ length
97
+ } = _ref;
98
+ return [_renderSlot(_ctx.$slots, "indicator", {
99
+ index: index,
100
+ length: length
101
+ }, () => [_ctx.indicator && _ctx.images.length > 1 ? (_openBlock(), _createElementBlock("div", _hoisted_2, _toDisplayString(index + 1) + " / " + _toDisplayString(length), 1
102
+ /* TEXT */
103
+ )) : _createCommentVNode("v-if", true)])];
104
+ }),
96
105
  _: 3
97
106
  /* FORWARDED */
98
107
 
@@ -109,9 +109,12 @@ export default defineComponent({
109
109
  var _ref = _asyncToGenerator(function* (anchorName, manualCall) {
110
110
  if (manualCall) props.onClick == null ? void 0 : props.onClick(anchorName);
111
111
  if (anchorName === active.value) return;
112
- var indexAnchor = indexAnchors.find(({
113
- name
114
- }) => anchorName === name.value);
112
+ var indexAnchor = indexAnchors.find(_ref2 => {
113
+ var {
114
+ name
115
+ } = _ref2;
116
+ return anchorName === name.value;
117
+ });
115
118
  if (!indexAnchor) return;
116
119
  var top = indexAnchor.ownTop.value;
117
120
  var left = getScrollLeft(scrollEl.value);
@@ -139,10 +142,11 @@ export default defineComponent({
139
142
  };
140
143
 
141
144
  watch(() => length.value, () => nextTick(() => {
142
- indexAnchors.forEach(({
143
- name,
144
- setOwnTop
145
- }) => {
145
+ indexAnchors.forEach(_ref3 => {
146
+ var {
147
+ name,
148
+ setOwnTop
149
+ } = _ref3;
146
150
  if (name.value) anchorNameList.value.push(name.value);
147
151
  setOwnTop();
148
152
  });
package/es/input/Input.js CHANGED
@@ -23,7 +23,9 @@ export function render(_ctx, _cache) {
23
23
 
24
24
  return _openBlock(), _createElementBlock("div", {
25
25
  class: _normalizeClass(["var-input var--box", [_ctx.disabled ? 'var-input--disabled' : null]]),
26
- onClick: _cache[8] || (_cache[8] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
26
+ onClick: _cache[8] || (_cache[8] = function () {
27
+ return _ctx.handleClick && _ctx.handleClick(...arguments);
28
+ })
27
29
  }, [_createElementVNode("div", {
28
30
  class: _normalizeClass(["var-input__controller", [_ctx.isFocus ? 'var-input--focus' : null, _ctx.errorMessage ? 'var-input--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-input--disabled' : null]]),
29
31
  style: _normalizeStyle({
@@ -51,10 +53,18 @@ export function render(_ctx, _cache) {
51
53
  caretColor: !_ctx.errorMessage ? _ctx.focusColor : null,
52
54
  resize: _ctx.resize ? 'vertical' : 'none'
53
55
  }),
54
- onFocus: _cache[0] || (_cache[0] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
55
- onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
56
- onInput: _cache[2] || (_cache[2] = (...args) => _ctx.handleInput && _ctx.handleInput(...args)),
57
- onChange: _cache[3] || (_cache[3] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
56
+ onFocus: _cache[0] || (_cache[0] = function () {
57
+ return _ctx.handleFocus && _ctx.handleFocus(...arguments);
58
+ }),
59
+ onBlur: _cache[1] || (_cache[1] = function () {
60
+ return _ctx.handleBlur && _ctx.handleBlur(...arguments);
61
+ }),
62
+ onInput: _cache[2] || (_cache[2] = function () {
63
+ return _ctx.handleInput && _ctx.handleInput(...arguments);
64
+ }),
65
+ onChange: _cache[3] || (_cache[3] = function () {
66
+ return _ctx.handleChange && _ctx.handleChange(...arguments);
67
+ })
58
68
  }, "\n ", 46
59
69
  /* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
60
70
  , _hoisted_2)) : (_openBlock(), _createElementBlock("input", {
@@ -71,10 +81,18 @@ export function render(_ctx, _cache) {
71
81
  color: _ctx.textColor,
72
82
  caretColor: !_ctx.errorMessage ? _ctx.focusColor : null
73
83
  }),
74
- onFocus: _cache[4] || (_cache[4] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
75
- onBlur: _cache[5] || (_cache[5] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
76
- onInput: _cache[6] || (_cache[6] = (...args) => _ctx.handleInput && _ctx.handleInput(...args)),
77
- onChange: _cache[7] || (_cache[7] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
84
+ onFocus: _cache[4] || (_cache[4] = function () {
85
+ return _ctx.handleFocus && _ctx.handleFocus(...arguments);
86
+ }),
87
+ onBlur: _cache[5] || (_cache[5] = function () {
88
+ return _ctx.handleBlur && _ctx.handleBlur(...arguments);
89
+ }),
90
+ onInput: _cache[6] || (_cache[6] = function () {
91
+ return _ctx.handleInput && _ctx.handleInput(...arguments);
92
+ }),
93
+ onChange: _cache[7] || (_cache[7] = function () {
94
+ return _ctx.handleChange && _ctx.handleChange(...arguments);
95
+ })
78
96
  }, null, 46
79
97
  /* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
80
98
  , _hoisted_3)), _createElementVNode("label", {
package/es/lazy/index.js CHANGED
@@ -202,7 +202,11 @@ function _updated() {
202
202
  return _updated.apply(this, arguments);
203
203
  }
204
204
 
205
- function mergeLazyOptions(lazyOptions = {}) {
205
+ function mergeLazyOptions(lazyOptions) {
206
+ if (lazyOptions === void 0) {
207
+ lazyOptions = {};
208
+ }
209
+
206
210
  var {
207
211
  events,
208
212
  loading,
package/es/list/List.js CHANGED
@@ -50,7 +50,9 @@ export function render(_ctx, _cache) {
50
50
  key: 2
51
51
  }, () => [_withDirectives(_createElementVNode("div", {
52
52
  class: "var-list__error",
53
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.load && _ctx.load(...args))
53
+ onClick: _cache[0] || (_cache[0] = function () {
54
+ return _ctx.load && _ctx.load(...arguments);
55
+ })
54
56
  }, [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.errorText, _ctx.pack.listErrorText)), 1
55
57
  /* TEXT */
56
58
  )], 512
@@ -87,9 +87,10 @@ export default defineComponent({
87
87
  name: 'VarLoading',
88
88
  props,
89
89
 
90
- setup(props, {
91
- slots
92
- }) {
90
+ setup(props, _ref) {
91
+ var {
92
+ slots
93
+ } = _ref;
93
94
  var loadingTypeDict = {
94
95
  wave: 5,
95
96
  cube: 4,
package/es/menu/Menu.js CHANGED
@@ -1,55 +1,30 @@
1
+ import { isVNode as _isVNode, withDirectives as _withDirectives, createVNode as _createVNode, vShow as _vShow } from "vue";
2
+
1
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
4
 
3
5
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
4
6
 
5
- import { defineComponent, ref, watch, onMounted, onUnmounted } from 'vue';
7
+ import { defineComponent, ref, watch, onMounted, onUnmounted, Transition, Teleport, nextTick } from 'vue';
6
8
  import { props } from './props';
7
9
  import { getLeft, getTop, toSizeUnit } from '../utils/elements';
8
10
  import { useZIndex } from '../context/zIndex';
9
- import { useTeleport } from '../utils/components';
10
- import { renderSlot as _renderSlot, vShow as _vShow, withModifiers as _withModifiers, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock } from "vue";
11
- export function render(_ctx, _cache) {
12
- return _openBlock(), _createElementBlock("div", {
13
- class: "var-menu",
14
- ref: "host",
15
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
16
- }, [_renderSlot(_ctx.$slots, "default"), (_openBlock(), _createBlock(_Teleport, {
17
- to: _ctx.teleport,
18
- disabled: !_ctx.teleport || _ctx.disabled
19
- }, [_createVNode(_Transition, {
20
- name: "var-menu",
21
- onAfterEnter: _ctx.onOpened,
22
- onAfterLeave: _ctx.onClosed
23
- }, {
24
- default: _withCtx(() => [_withDirectives(_createElementVNode("div", {
25
- class: "var-menu__menu var-elevation--3",
26
- ref: "menu",
27
- style: _normalizeStyle({
28
- top: "calc(" + _ctx.top + "px + " + _ctx.toSizeUnit(_ctx.offsetY) + ")",
29
- left: "calc(" + _ctx.left + "px + " + _ctx.toSizeUnit(_ctx.offsetX) + ")",
30
- zIndex: _ctx.zIndex
31
- }),
32
- onClick: _cache[0] || (_cache[0] = _withModifiers(() => {}, ["stop"]))
33
- }, [_renderSlot(_ctx.$slots, "menu")], 4
34
- /* STYLE */
35
- ), [[_vShow, _ctx.show]])]),
36
- _: 3
37
- /* FORWARDED */
38
-
39
- }, 8
40
- /* PROPS */
41
- , ["onAfterEnter", "onAfterLeave"])], 8
42
- /* PROPS */
43
- , ["to", "disabled"]))], 512
44
- /* NEED_PATCH */
45
- );
11
+ import { exposeApis, useTeleport } from '../utils/components';
12
+
13
+
14
+
15
+
16
+ function _isSlot(s) {
17
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
46
18
  }
19
+
47
20
  export default defineComponent({
48
- render,
49
21
  name: 'VarMenu',
50
22
  props,
51
23
 
52
- setup(props) {
24
+ setup(props, _ref) {
25
+ var {
26
+ slots
27
+ } = _ref;
53
28
  var host = ref(null);
54
29
  var menu = ref(null);
55
30
  var top = ref(0);
@@ -73,6 +48,8 @@ export default defineComponent({
73
48
  var handleMenuClose = () => {
74
49
  var _props$onUpdateShow;
75
50
 
51
+ console.log(123);
52
+
76
53
  if (clickSelf) {
77
54
  clickSelf = false;
78
55
  return;
@@ -91,19 +68,43 @@ export default defineComponent({
91
68
  left.value = getLeft(host.value);
92
69
  };
93
70
 
71
+ var renderTransition = () => _createVNode(Transition, {
72
+ "name": "var-menu",
73
+ "onAfterEnter": props.onOpen,
74
+ "onAfterLeave": props.onClosed
75
+ }, {
76
+ default: () => [_withDirectives(_createVNode("div", {
77
+ "class": "var-menu__menu var-elevation--3",
78
+ "ref": menu,
79
+ "style": {
80
+ top: "calc(" + top.value + "px + " + toSizeUnit(props.offsetY) + ")",
81
+ left: "calc(" + left.value + "px + " + toSizeUnit(props.offsetX) + ")",
82
+ zIndex: zIndex.value
83
+ },
84
+ "onClick": event => {
85
+ event.stopPropagation();
86
+ }
87
+ }, [slots.menu == null ? void 0 : slots.menu()]), [[_vShow, props.show]])]
88
+ });
89
+
94
90
  watch(() => props.alignment, resize);
95
91
  watch(() => props.show, /*#__PURE__*/function () {
96
- var _ref = _asyncToGenerator(function* (newValue) {
92
+ var _ref2 = _asyncToGenerator(function* (newValue) {
97
93
  var {
98
94
  onOpen,
99
95
  onClose
100
96
  } = props;
101
- newValue && resize();
97
+
98
+ if (newValue) {
99
+ yield nextTick();
100
+ resize();
101
+ }
102
+
102
103
  newValue ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
103
104
  });
104
105
 
105
106
  return function (_x) {
106
- return _ref.apply(this, arguments);
107
+ return _ref2.apply(this, arguments);
107
108
  };
108
109
  }());
109
110
  onMounted(() => {
@@ -115,16 +116,22 @@ export default defineComponent({
115
116
  document.removeEventListener('click', handleMenuClose);
116
117
  window.removeEventListener('resize', resize);
117
118
  });
118
- return {
119
- disabled,
120
- zIndex,
121
- host,
122
- menu,
123
- top,
124
- left,
125
- toSizeUnit,
126
- handleClick,
119
+ exposeApis({
127
120
  resize
121
+ });
122
+ return () => {
123
+ var _slot;
124
+
125
+ return _createVNode("div", {
126
+ "class": "var-menu",
127
+ "ref": host,
128
+ "onClick": handleClick
129
+ }, [slots.default == null ? void 0 : slots.default(), props.teleport ? _createVNode(Teleport, {
130
+ "to": props.teleport,
131
+ "disabled": disabled.value
132
+ }, _isSlot(_slot = renderTransition()) ? _slot : {
133
+ default: () => [_slot]
134
+ }) : renderTransition()]);
128
135
  };
129
136
  }
130
137
 
package/es/menu/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import Menu from './Menu.js'
1
+ import Menu from './Menu';
2
2
 
3
3
  Menu.install = function (app) {
4
4
  app.component(Menu.name, Menu);
@@ -1,4 +1,3 @@
1
1
  import '../../styles/common.css'
2
2
  import '../../styles/elevation.css'
3
3
  import '../menu.css'
4
- import '../MenuSfc.css'
@@ -1,4 +1,3 @@
1
1
  import '../../styles/common.less'
2
2
  import '../../styles/elevation.less'
3
3
  import '../menu.less'
4
- import '../MenuSfc.less'
@@ -21,7 +21,9 @@ export function render(_ctx, _cache) {
21
21
  width: _ctx.wrapWidth,
22
22
  color: _ctx.optionSelected ? _ctx.focusColor : undefined
23
23
  }),
24
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
24
+ onClick: _cache[2] || (_cache[2] = function () {
25
+ return _ctx.handleClick && _ctx.handleClick(...arguments);
26
+ })
25
27
  }, [_createElementVNode("div", {
26
28
  class: _normalizeClass(["var-option__cover", [_ctx.optionSelected ? 'var-option--selected-background' : null]]),
27
29
  style: _normalizeStyle({
@@ -131,7 +131,9 @@ export function render(_ctx, _cache) {
131
131
  style: {
132
132
  "display": "flex"
133
133
  },
134
- onClick: _cache[5] || (_cache[5] = (...args) => _ctx.showMenu && _ctx.showMenu(...args))
134
+ onClick: _cache[5] || (_cache[5] = function () {
135
+ return _ctx.showMenu && _ctx.showMenu(...arguments);
136
+ })
135
137
  }, [_createElementVNode("span", null, _toDisplayString(_ctx.size) + _toDisplayString(_ctx.pack.paginationItem) + " / " + _toDisplayString(_ctx.pack.paginationPage), 1
136
138
  /* TEXT */
137
139
  ), _createVNode(_component_var_icon, {
@@ -258,11 +260,15 @@ export default defineComponent({
258
260
  if (type === 'simple' && !isValidatePage(value)) simpleValue.value = "" + current.value;
259
261
  };
260
262
 
261
- watch([() => props.current, () => props.size], ([newCurrent, newSize]) => {
263
+ watch([() => props.current, () => props.size], _ref => {
264
+ var [newCurrent, newSize] = _ref;
262
265
  current.value = toNumber(newCurrent) || 1;
263
266
  size.value = toNumber(newSize || 10);
264
267
  });
265
- watch([current, pageCount], ([newCurrent, newCount], [oldCurrent, oldCount]) => {
268
+ watch([current, pageCount], (_ref2, _ref3) => {
269
+ var [newCurrent, newCount] = _ref2;
270
+ var [oldCurrent, oldCount] = _ref3;
271
+
266
272
  if (newCurrent > newCount) {
267
273
  current.value = newCount;
268
274
  return;
@@ -209,7 +209,11 @@ export default defineComponent({
209
209
  };
210
210
  };
211
211
 
212
- var scrollTo = (scrollColumn, index, duration, noEmit = false) => {
212
+ var scrollTo = function (scrollColumn, index, duration, noEmit) {
213
+ if (noEmit === void 0) {
214
+ noEmit = false;
215
+ }
216
+
213
217
  var translate = center.value - boundaryIndex(scrollColumn, index) * optionHeight.value;
214
218
 
215
219
  if (translate === scrollColumn.translate) {
package/es/popup/Popup.js CHANGED
@@ -19,10 +19,11 @@ export default defineComponent({
19
19
  inheritAttrs: false,
20
20
  props,
21
21
 
22
- setup(props, {
23
- slots,
24
- attrs
25
- }) {
22
+ setup(props, _ref) {
23
+ var {
24
+ slots,
25
+ attrs
26
+ } = _ref;
26
27
  var {
27
28
  zIndex
28
29
  } = useZIndex(() => props.show, 3);
@@ -13,10 +13,18 @@ export function render(_ctx, _cache) {
13
13
  return _openBlock(), _createElementBlock("div", {
14
14
  ref: "freshNode",
15
15
  class: "var-pull-refresh",
16
- onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
17
- onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.touchMove && _ctx.touchMove(...args)),
18
- onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args)),
19
- onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
16
+ onTouchstart: _cache[0] || (_cache[0] = function () {
17
+ return _ctx.touchStart && _ctx.touchStart(...arguments);
18
+ }),
19
+ onTouchmove: _cache[1] || (_cache[1] = function () {
20
+ return _ctx.touchMove && _ctx.touchMove(...arguments);
21
+ }),
22
+ onTouchend: _cache[2] || (_cache[2] = function () {
23
+ return _ctx.touchEnd && _ctx.touchEnd(...arguments);
24
+ }),
25
+ onTouchcancel: _cache[3] || (_cache[3] = function () {
26
+ return _ctx.touchEnd && _ctx.touchEnd(...arguments);
27
+ })
20
28
  }, [_createElementVNode("div", {
21
29
  class: _normalizeClass(["var-pull-refresh__control var-elevation--2", [_ctx.isSuccess ? 'var-pull-refresh__control-success' : null]]),
22
30
  style: _normalizeStyle(_ctx.controlStyle)
package/es/radio/Radio.js CHANGED
@@ -22,7 +22,9 @@ export function render(_ctx, _cache) {
22
22
 
23
23
  return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _mergeProps({
24
24
  class: "var-radio",
25
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
25
+ onClick: _cache[0] || (_cache[0] = function () {
26
+ return _ctx.handleClick && _ctx.handleClick(...arguments);
27
+ })
26
28
  }, _ctx.$attrs), [_withDirectives(_createElementVNode("div", {
27
29
  class: _normalizeClass(["var-radio__action", [_ctx.checked ? 'var-radio--checked' : 'var-radio--unchecked', _ctx.errorMessage || _ctx.radioGroupErrorMessage ? 'var-radio--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-radio--disabled' : null]]),
28
30
  style: _normalizeStyle({
@@ -61,9 +61,12 @@ export default defineComponent({
61
61
  });
62
62
  };
63
63
 
64
- var syncRadios = () => radios.forEach(({
65
- sync
66
- }) => sync(props.modelValue));
64
+ var syncRadios = () => radios.forEach(_ref => {
65
+ var {
66
+ sync
67
+ } = _ref;
68
+ return sync(props.modelValue);
69
+ });
67
70
 
68
71
  var onToggle = changedValue => {
69
72
  var _props$onUpdateModel;
package/es/row/Row.js CHANGED
@@ -10,7 +10,9 @@ export function render(_ctx, _cache) {
10
10
  justifyContent: _ctx.justify,
11
11
  alignItems: _ctx.align
12
12
  }),
13
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
13
+ onClick: _cache[0] || (_cache[0] = function () {
14
+ return _ctx.onClick && _ctx.onClick(...arguments);
15
+ })
14
16
  }, [_renderSlot(_ctx.$slots, "default")], 4
15
17
  /* STYLE */
16
18
  );
@@ -41,7 +41,9 @@ export function render(_ctx, _cache) {
41
41
 
42
42
  return _openBlock(), _createElementBlock("div", {
43
43
  class: _normalizeClass(["var-select var--box", [_ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null]]),
44
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
44
+ onClick: _cache[3] || (_cache[3] = function () {
45
+ return _ctx.handleClick && _ctx.handleClick(...arguments);
46
+ })
45
47
  }, [_createElementVNode("div", {
46
48
  class: _normalizeClass(["var-select__controller", [_ctx.isFocus ? 'var-select--focus' : null, _ctx.errorMessage ? 'var-select--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null]]),
47
49
  style: _normalizeStyle({
@@ -63,7 +65,9 @@ export function render(_ctx, _cache) {
63
65
  default: _withCtx(() => [_createElementVNode("div", {
64
66
  class: _normalizeClass(["var-select__wrap", [!_ctx.hint ? 'var-select--non-hint' : null]]),
65
67
  ref: "wrapEl",
66
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args))
68
+ onClick: _cache[1] || (_cache[1] = function () {
69
+ return _ctx.handleFocus && _ctx.handleFocus(...arguments);
70
+ })
67
71
  }, [_createElementVNode("div", {
68
72
  class: _normalizeClass(["var-select__select", [_ctx.errorMessage ? 'var-select--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-select--disabled' : null]]),
69
73
  style: _normalizeStyle({
@@ -227,10 +231,12 @@ export default defineComponent({
227
231
  });
228
232
  };
229
233
 
230
- var findValueOrLabel = ({
231
- value,
232
- label
233
- }) => {
234
+ var findValueOrLabel = _ref => {
235
+ var {
236
+ value,
237
+ label
238
+ } = _ref;
239
+
234
240
  if (value.value != null) {
235
241
  return value.value;
236
242
  }
@@ -239,14 +245,20 @@ export default defineComponent({
239
245
  };
240
246
 
241
247
  var findLabel = modelValue => {
242
- var option = options.find(({
243
- value
244
- }) => value.value === modelValue);
248
+ var option = options.find(_ref2 => {
249
+ var {
250
+ value
251
+ } = _ref2;
252
+ return value.value === modelValue;
253
+ });
245
254
 
246
255
  if (!option) {
247
- option = options.find(({
248
- label
249
- }) => label.value === modelValue);
256
+ option = options.find(_ref3 => {
257
+ var {
258
+ label
259
+ } = _ref3;
260
+ return label.value === modelValue;
261
+ });
250
262
  }
251
263
 
252
264
  return option.label.value;
@@ -312,9 +324,12 @@ export default defineComponent({
312
324
  return;
313
325
  }
314
326
 
315
- var selectedValue = multiple ? options.filter(({
316
- selected
317
- }) => selected.value).map(findValueOrLabel) : findValueOrLabel(option);
327
+ var selectedValue = multiple ? options.filter(_ref4 => {
328
+ var {
329
+ selected
330
+ } = _ref4;
331
+ return selected.value;
332
+ }).map(findValueOrLabel) : findValueOrLabel(option);
318
333
  (_props$onUpdateModel = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel.call(props, selectedValue);
319
334
  onChange == null ? void 0 : onChange(selectedValue);
320
335
  validateWithTrigger('onChange');
@@ -371,9 +386,12 @@ export default defineComponent({
371
386
  }
372
387
 
373
388
  var rawModelValue = modelValue;
374
- var option = options.find(({
375
- label
376
- }) => label.value === text);
389
+ var option = options.find(_ref5 => {
390
+ var {
391
+ label
392
+ } = _ref5;
393
+ return label.value === text;
394
+ });
377
395
  var currentModelValue = rawModelValue.filter(value => {
378
396
  var _value$value;
379
397
 
@@ -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
  });