@varlet/ui 1.21.0 → 1.22.0-alpha.15

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 (63) hide show
  1. package/es/action-sheet/ActionSheet.js +15 -19
  2. package/es/app-bar/AppBar.js +14 -19
  3. package/es/back-top/BackTop.js +7 -10
  4. package/es/badge/Badge.js +7 -12
  5. package/es/button/Button.js +14 -13
  6. package/es/card/Card.js +19 -23
  7. package/es/cell/Cell.js +14 -19
  8. package/es/checkbox/Checkbox.js +14 -19
  9. package/es/checkbox-group/CheckboxGroup.js +6 -11
  10. package/es/chip/Chip.js +8 -11
  11. package/es/col/Col.js +8 -11
  12. package/es/collapse/Collapse.js +5 -10
  13. package/es/collapse-item/CollapseItem.js +16 -21
  14. package/es/countdown/Countdown.js +5 -10
  15. package/es/counter/Counter.js +18 -22
  16. package/es/date-picker/DatePicker.js +23 -28
  17. package/es/date-picker/src/day-picker-panel.js +14 -19
  18. package/es/date-picker/src/month-picker-panel.js +12 -17
  19. package/es/date-picker/src/panel-header.js +12 -17
  20. package/es/date-picker/src/year-picker-panel.js +12 -16
  21. package/es/dialog/Dialog.js +12 -17
  22. package/es/divider/Divider.js +8 -13
  23. package/es/form/Form.js +5 -10
  24. package/es/form-details/FormDetails.js +6 -11
  25. package/es/icon/Icon.js +6 -9
  26. package/es/icon/icon.less +1 -1
  27. package/es/image/Image.js +23 -21
  28. package/es/image-preview/ImagePreview.js +20 -24
  29. package/es/index-anchor/IndexAnchor.js +4 -7
  30. package/es/index-bar/IndexBar.js +15 -19
  31. package/es/input/Input.js +33 -37
  32. package/es/list/List.js +10 -15
  33. package/es/loading/Loading.js +21 -24
  34. package/es/menu/Menu.js +9 -12
  35. package/es/option/Option.js +16 -21
  36. package/es/picker/Picker.js +33 -36
  37. package/es/popup/Popup.js +14 -17
  38. package/es/progress/Progress.js +30 -32
  39. package/es/pull-refresh/PullRefresh.js +12 -15
  40. package/es/radio/Radio.js +14 -19
  41. package/es/radio-group/RadioGroup.js +6 -11
  42. package/es/rate/Rate.js +12 -16
  43. package/es/row/Row.js +7 -10
  44. package/es/select/Select.js +42 -47
  45. package/es/skeleton/Skeleton.js +41 -39
  46. package/es/slider/Slider.js +32 -36
  47. package/es/snackbar/Snackbar.js +8 -11
  48. package/es/snackbar/core.js +14 -19
  49. package/es/step/Step.js +23 -28
  50. package/es/steps/Steps.js +6 -9
  51. package/es/sticky/Sticky.js +10 -13
  52. package/es/swipe/Swipe.js +20 -24
  53. package/es/swipe-item/SwipeItem.js +6 -9
  54. package/es/switch/Switch.js +16 -21
  55. package/es/tab/Tab.js +8 -11
  56. package/es/tab-item/TabItem.js +5 -8
  57. package/es/tabs/Tabs.js +10 -13
  58. package/es/tabs-items/TabsItems.js +4 -7
  59. package/es/time-picker/TimePicker.js +32 -37
  60. package/es/time-picker/clock.js +15 -20
  61. package/es/uploader/Uploader.js +31 -31
  62. package/package.json +4 -4
  63. package/umd/varlet.js +2 -1
package/es/input/Input.js CHANGED
@@ -5,40 +5,36 @@ import { props } from './props';
5
5
  import { isEmpty, isNumber, toNumber } from '../utils/shared';
6
6
  import { useValidation } from '../utils/components';
7
7
  import { useForm } from '../form/provide';
8
- import { renderSlot as _renderSlot, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDynamicComponent as _resolveDynamicComponent, toDisplayString as _toDisplayString, resolveComponent as _resolveComponent, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
8
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveDynamicComponent as _resolveDynamicComponent, normalizeStyle as _normalizeStyle, createBlock as _createBlock, toDisplayString as _toDisplayString, resolveComponent as _resolveComponent, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
9
9
 
10
- var _withId = /*#__PURE__*/_withScopeId("");
11
-
12
- _pushScopeId("");
10
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
13
11
 
14
12
  var _hoisted_1 = {
15
13
  key: 0,
16
14
  class: "var-input__autocomplete"
17
15
  };
18
-
19
- _popScopeId();
20
-
21
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
16
+ var _hoisted_2 = ["for"];
17
+ export function render(_ctx, _cache) {
22
18
  var _component_var_icon = _resolveComponent("var-icon");
23
19
 
24
20
  var _component_var_form_details = _resolveComponent("var-form-details");
25
21
 
26
- return _openBlock(), _createBlock("div", {
27
- class: ["var-input var--box", [_ctx.disabled ? 'var-input--disabled' : null]],
28
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
29
- }, [_createVNode("div", {
30
- class: ["var-input__controller", [_ctx.isFocus ? 'var-input--focus' : null, _ctx.errorMessage ? 'var-input--error' : null, _ctx.formDisabled || _ctx.disabled ? 'var-input--disabled' : null]],
31
- style: {
22
+ return _openBlock(), _createElementBlock("div", {
23
+ class: _normalizeClass(["var-input var--box", [_ctx.disabled ? 'var-input--disabled' : null]]),
24
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
25
+ }, [_createElementVNode("div", {
26
+ 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]]),
27
+ style: _normalizeStyle({
32
28
  color: !_ctx.errorMessage ? _ctx.isFocus ? _ctx.focusColor : _ctx.blurColor : null
33
- }
34
- }, [_createVNode("div", {
35
- class: ["var-input__icon", [!_ctx.hint ? 'var-input--non-hint' : null]]
29
+ })
30
+ }, [_createElementVNode("div", {
31
+ class: _normalizeClass(["var-input__icon", [!_ctx.hint ? 'var-input--non-hint' : null]])
36
32
  }, [_renderSlot(_ctx.$slots, "prepend-icon")], 2
37
33
  /* CLASS */
38
- ), _createVNode("div", {
39
- class: ["var-input__wrap", [!_ctx.hint ? 'var-input--non-hint' : null]]
40
- }, [_ctx.type === 'password' ? (_openBlock(), _createBlock("input", _hoisted_1)) : _createCommentVNode("v-if", true), (_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.textarea ? 'textarea' : 'input'), {
41
- class: ["var-input__input", [_ctx.formDisabled || _ctx.disabled ? 'var-input--disabled' : null, _ctx.textarea ? 'var-input--textarea' : null, _ctx.errorMessage ? 'var-input--caret-error' : null]],
34
+ ), _createElementVNode("div", {
35
+ class: _normalizeClass(["var-input__wrap", [!_ctx.hint ? 'var-input--non-hint' : null]])
36
+ }, [_ctx.type === 'password' ? (_openBlock(), _createElementBlock("input", _hoisted_1)) : _createCommentVNode("v-if", true), (_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.textarea ? 'textarea' : 'input'), {
37
+ class: _normalizeClass(["var-input__input", [_ctx.formDisabled || _ctx.disabled ? 'var-input--disabled' : null, _ctx.textarea ? 'var-input--textarea' : null, _ctx.errorMessage ? 'var-input--caret-error' : null]]),
42
38
  ref: "el",
43
39
  autocomplete: "new-password",
44
40
  id: _ctx.id,
@@ -47,26 +43,26 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
47
43
  value: _ctx.modelValue,
48
44
  maxlength: _ctx.maxlength,
49
45
  rows: _ctx.rows,
50
- style: {
46
+ style: _normalizeStyle({
51
47
  color: _ctx.textColor,
52
48
  caretColor: !_ctx.errorMessage ? _ctx.focusColor : null,
53
49
  resize: _ctx.resize ? 'vertical' : 'none'
54
- },
50
+ }),
55
51
  onFocus: _ctx.handleFocus,
56
52
  onBlur: _ctx.handleBlur,
57
53
  onInput: _ctx.handleInput,
58
54
  onChange: _ctx.handleChange
59
55
  }, null, 8
60
56
  /* PROPS */
61
- , ["id", "disabled", "type", "value", "maxlength", "rows", "class", "style", "onFocus", "onBlur", "onInput", "onChange"])), _createVNode("label", {
62
- class: [_ctx.textarea ? 'var-input__textarea-placeholder' : 'var-input__placeholder', _ctx.computePlaceholderState(), !_ctx.hint ? 'var-input--placeholder-non-hint' : null],
57
+ , ["id", "disabled", "type", "value", "maxlength", "rows", "class", "style", "onFocus", "onBlur", "onInput", "onChange"])), _createElementVNode("label", {
58
+ class: _normalizeClass([_ctx.textarea ? 'var-input__textarea-placeholder' : 'var-input__placeholder', _ctx.computePlaceholderState(), !_ctx.hint ? 'var-input--placeholder-non-hint' : null]),
63
59
  for: _ctx.id
64
60
  }, _toDisplayString(_ctx.placeholder), 11
65
61
  /* TEXT, CLASS, PROPS */
66
- , ["for"])], 2
62
+ , _hoisted_2)], 2
67
63
  /* CLASS */
68
- ), _createVNode("div", {
69
- class: ["var-input__icon", [!_ctx.hint ? 'var-input--non-hint' : null]]
64
+ ), _createElementVNode("div", {
65
+ class: _normalizeClass(["var-input__icon", [!_ctx.hint ? 'var-input--non-hint' : null]])
70
66
  }, [_renderSlot(_ctx.$slots, "append-icon", {}, () => [_ctx.clearable && !_ctx.isEmpty(_ctx.modelValue) ? (_openBlock(), _createBlock(_component_var_icon, {
71
67
  key: 0,
72
68
  class: "var-input__clear-icon",
@@ -80,17 +76,17 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
80
76
  /* CLASS */
81
77
  )], 6
82
78
  /* CLASS, STYLE */
83
- ), _ctx.line ? (_openBlock(), _createBlock("div", {
79
+ ), _ctx.line ? (_openBlock(), _createElementBlock("div", {
84
80
  key: 0,
85
- class: ["var-input__line", [_ctx.formDisabled || _ctx.disabled ? 'var-input--line-disabled' : null, _ctx.errorMessage ? 'var-input--line-error' : null]],
86
- style: {
81
+ class: _normalizeClass(["var-input__line", [_ctx.formDisabled || _ctx.disabled ? 'var-input--line-disabled' : null, _ctx.errorMessage ? 'var-input--line-error' : null]]),
82
+ style: _normalizeStyle({
87
83
  background: !_ctx.errorMessage ? _ctx.blurColor : null
88
- }
89
- }, [_createVNode("div", {
90
- class: ["var-input__dot", [_ctx.isFocus ? 'var-input--spread' : null, _ctx.formDisabled || _ctx.disabled ? 'var-input--line-disabled' : null, _ctx.errorMessage ? 'var-input--line-error' : null]],
91
- style: {
84
+ })
85
+ }, [_createElementVNode("div", {
86
+ class: _normalizeClass(["var-input__dot", [_ctx.isFocus ? 'var-input--spread' : null, _ctx.formDisabled || _ctx.disabled ? 'var-input--line-disabled' : null, _ctx.errorMessage ? 'var-input--line-error' : null]]),
87
+ style: _normalizeStyle({
92
88
  background: !_ctx.errorMessage ? _ctx.focusColor : null
93
- }
89
+ })
94
90
  }, null, 6
95
91
  /* CLASS, STYLE */
96
92
  )], 6
@@ -103,7 +99,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
103
99
  , ["error-message", "maxlength-text"])], 2
104
100
  /* CLASS */
105
101
  );
106
- });
102
+ }
107
103
  export default defineComponent({
108
104
  render,
109
105
  name: 'VarInput',
package/es/list/List.js CHANGED
@@ -9,11 +9,9 @@ import { getParentScroller, isHidden, toPxNum } from '../utils/elements';
9
9
  import { props } from './props';
10
10
  import { isNumber, dt } from '../utils/shared';
11
11
  import { pack } from '../locale';
12
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createVNode as _createVNode, resolveComponent as _resolveComponent, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
12
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
13
13
 
14
- var _withId = /*#__PURE__*/_withScopeId("");
15
-
16
- _pushScopeId("");
14
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
17
15
 
18
16
  var _hoisted_1 = {
19
17
  class: "var-list var--box",
@@ -32,40 +30,37 @@ var _hoisted_5 = {
32
30
  class: "var-list__detector",
33
31
  ref: "detectorEl"
34
32
  };
35
-
36
- _popScopeId();
37
-
38
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
33
+ export function render(_ctx, _cache) {
39
34
  var _component_var_loading = _resolveComponent("var-loading");
40
35
 
41
36
  var _directive_ripple = _resolveDirective("ripple");
42
37
 
43
- return _openBlock(), _createBlock("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default"), _ctx.loading ? _renderSlot(_ctx.$slots, "loading", {
38
+ return _openBlock(), _createElementBlock("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default"), _ctx.loading ? _renderSlot(_ctx.$slots, "loading", {
44
39
  key: 0
45
- }, () => [_createVNode("div", _hoisted_2, [_createVNode("div", _hoisted_3, _toDisplayString(_ctx.dt(_ctx.loadingText, _ctx.pack.listLoadingText)), 1
40
+ }, () => [_createElementVNode("div", _hoisted_2, [_createElementVNode("div", _hoisted_3, _toDisplayString(_ctx.dt(_ctx.loadingText, _ctx.pack.listLoadingText)), 1
46
41
  /* TEXT */
47
42
  ), _createVNode(_component_var_loading, {
48
43
  size: "mini",
49
44
  radius: 10
50
45
  })])]) : _createCommentVNode("v-if", true), _ctx.finished ? _renderSlot(_ctx.$slots, "finished", {
51
46
  key: 1
52
- }, () => [_createVNode("div", _hoisted_4, _toDisplayString(_ctx.dt(_ctx.finishedText, _ctx.pack.listFinishedText)), 1
47
+ }, () => [_createElementVNode("div", _hoisted_4, _toDisplayString(_ctx.dt(_ctx.finishedText, _ctx.pack.listFinishedText)), 1
53
48
  /* TEXT */
54
49
  )]) : _createCommentVNode("v-if", true), _ctx.error ? _renderSlot(_ctx.$slots, "error", {
55
50
  key: 2
56
- }, () => [_withDirectives(_createVNode("div", {
51
+ }, () => [_withDirectives(_createElementVNode("div", {
57
52
  class: "var-list__error",
58
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.load && _ctx.load(...args))
53
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.load && _ctx.load(...args))
59
54
  }, [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.errorText, _ctx.pack.listErrorText)), 1
60
55
  /* TEXT */
61
56
  )], 512
62
57
  /* NEED_PATCH */
63
- ), [[_directive_ripple]])]) : _createCommentVNode("v-if", true), _createVNode("div", _hoisted_5, null, 512
58
+ ), [[_directive_ripple]])]) : _createCommentVNode("v-if", true), _createElementVNode("div", _hoisted_5, null, 512
64
59
  /* NEED_PATCH */
65
60
  )], 512
66
61
  /* NEED_PATCH */
67
62
  );
68
- });
63
+ }
69
64
  export default defineComponent({
70
65
  render,
71
66
  name: 'VarList',
@@ -1,10 +1,8 @@
1
1
  import { defineComponent } from 'vue';
2
2
  import { props } from './props';
3
- import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
3
+ import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
4
4
 
5
- var _withId = /*#__PURE__*/_withScopeId("");
6
-
7
- _pushScopeId("");
5
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
8
6
 
9
7
  var _hoisted_1 = {
10
8
  class: "var--box var-loading"
@@ -14,41 +12,40 @@ var _hoisted_2 = {
14
12
  class: "var-loading__circle"
15
13
  };
16
14
 
17
- var _hoisted_3 = /*#__PURE__*/_createVNode("svg", {
15
+ var _hoisted_3 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("svg", {
18
16
  viewBox: "25 25 50 50"
19
- }, [/*#__PURE__*/_createVNode("circle", {
17
+ }, [/*#__PURE__*/_createElementVNode("circle", {
20
18
  cx: "50",
21
19
  cy: "50",
22
20
  r: "20",
23
21
  fill: "none"
24
22
  })], -1
25
23
  /* HOISTED */
26
- );
27
-
28
- _popScopeId();
24
+ ));
29
25
 
30
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
31
- return _openBlock(), _createBlock("div", _hoisted_1, [_ctx.type === 'circle' ? (_openBlock(), _createBlock("div", _hoisted_2, [_createVNode("span", {
26
+ var _hoisted_4 = [_hoisted_3];
27
+ export function render(_ctx, _cache) {
28
+ return _openBlock(), _createElementBlock("div", _hoisted_1, [_ctx.type === 'circle' ? (_openBlock(), _createElementBlock("div", _hoisted_2, [_createElementVNode("span", {
32
29
  class: "var-loading__circle-block",
33
- style: {
30
+ style: _normalizeStyle({
34
31
  width: _ctx.radius * 2 + 'px',
35
32
  height: _ctx.radius * 2 + 'px'
36
- }
37
- }, [_hoisted_3], 4
33
+ })
34
+ }, _hoisted_4, 4
38
35
  /* STYLE */
39
- )])) : _createCommentVNode("v-if", true), (_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.loadingTypeDict, (nums, key) => {
40
- return _openBlock(), _createBlock(_Fragment, {
36
+ )])) : _createCommentVNode("v-if", true), (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.loadingTypeDict, (nums, key) => {
37
+ return _openBlock(), _createElementBlock(_Fragment, {
41
38
  key: key
42
- }, [_ctx.type === key ? (_openBlock(), _createBlock("div", {
39
+ }, [_ctx.type === key ? (_openBlock(), _createElementBlock("div", {
43
40
  key: 0,
44
- class: "var-loading__" + key + " var-loading__" + key + "-" + _ctx.size
45
- }, [(_openBlock(true), _createBlock(_Fragment, null, _renderList(nums, num => {
46
- return _openBlock(), _createBlock("div", {
41
+ class: _normalizeClass("var-loading__" + key + " var-loading__" + key + "-" + _ctx.size)
42
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(nums, num => {
43
+ return _openBlock(), _createElementBlock("div", {
47
44
  key: num + key,
48
- style: {
45
+ style: _normalizeStyle({
49
46
  backgroundColor: _ctx.color
50
- },
51
- class: "var-loading__" + key + "-item var-loading__" + key + "-item-" + _ctx.size
47
+ }),
48
+ class: _normalizeClass("var-loading__" + key + "-item var-loading__" + key + "-item-" + _ctx.size)
52
49
  }, null, 6
53
50
  /* CLASS, STYLE */
54
51
  );
@@ -62,7 +59,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
62
59
  }), 128
63
60
  /* KEYED_FRAGMENT */
64
61
  ))]);
65
- });
62
+ }
66
63
  export default defineComponent({
67
64
  render,
68
65
  name: 'VarLoading',
package/es/menu/Menu.js CHANGED
@@ -6,15 +6,12 @@ import { defineComponent, ref, watch, onMounted, onUnmounted, nextTick } from 'v
6
6
  import { props } from './props';
7
7
  import { getLeft, getTop, toSizeUnit } from '../utils/elements';
8
8
  import { useZIndex } from '../context/zIndex';
9
- import { renderSlot as _renderSlot, vShow as _vShow, withModifiers as _withModifiers, createVNode as _createVNode, withDirectives as _withDirectives, Transition as _Transition, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from "vue";
10
-
11
- var _withId = /*#__PURE__*/_withScopeId("");
12
-
13
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
14
- return _openBlock(), _createBlock("div", {
9
+ 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";
10
+ export function render(_ctx, _cache) {
11
+ return _openBlock(), _createElementBlock("div", {
15
12
  class: "var-menu",
16
13
  ref: "host",
17
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
14
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
18
15
  }, [_renderSlot(_ctx.$slots, "default"), (_openBlock(), _createBlock(_Teleport, {
19
16
  to: _ctx.teleport
20
17
  }, [_createVNode(_Transition, {
@@ -22,15 +19,15 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
22
19
  onAfterEnter: _ctx.onOpened,
23
20
  onAfterLeave: _ctx.onClosed
24
21
  }, {
25
- default: _withId(() => [_withDirectives(_createVNode("div", {
22
+ default: _withCtx(() => [_withDirectives(_createElementVNode("div", {
26
23
  class: "var-menu__menu var-elevation--3",
27
24
  ref: "menu",
28
- style: {
25
+ style: _normalizeStyle({
29
26
  top: "calc(" + _ctx.top + "px + " + _ctx.toSizeUnit(_ctx.offsetY) + ")",
30
27
  left: "calc(" + _ctx.left + "px + " + _ctx.toSizeUnit(_ctx.offsetX) + ")",
31
28
  zIndex: _ctx.zIndex
32
- },
33
- onClick: _cache[1] || (_cache[1] = _withModifiers(() => {}, ["stop"]))
29
+ }),
30
+ onClick: _cache[0] || (_cache[0] = _withModifiers(() => {}, ["stop"]))
34
31
  }, [_renderSlot(_ctx.$slots, "menu")], 4
35
32
  /* STYLE */
36
33
  ), [[_vShow, _ctx.show]])]),
@@ -44,7 +41,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
44
41
  , ["to"]))], 512
45
42
  /* NEED_PATCH */
46
43
  );
47
- });
44
+ }
48
45
  export default defineComponent({
49
46
  render,
50
47
  name: 'VarMenu',
@@ -3,35 +3,30 @@ import Ripple from '../ripple';
3
3
  import { defineComponent, computed, ref, watch } from 'vue';
4
4
  import { useSelect } from './provide';
5
5
  import { props } from './props';
6
- import { createVNode as _createVNode, resolveComponent as _resolveComponent, withModifiers as _withModifiers, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
6
+ import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withModifiers as _withModifiers, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
7
7
 
8
- var _withId = /*#__PURE__*/_withScopeId("");
9
-
10
- _pushScopeId("");
8
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
11
9
 
12
10
  var _hoisted_1 = {
13
11
  class: "var-option__text"
14
12
  };
15
-
16
- _popScopeId();
17
-
18
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
13
+ export function render(_ctx, _cache) {
19
14
  var _component_var_checkbox = _resolveComponent("var-checkbox");
20
15
 
21
16
  var _directive_ripple = _resolveDirective("ripple");
22
17
 
23
- return _withDirectives((_openBlock(), _createBlock("div", {
24
- class: ["var-option var--box", [_ctx.optionSelected ? 'var-option--selected-color' : null]],
25
- style: {
18
+ return _withDirectives((_openBlock(), _createElementBlock("div", {
19
+ class: _normalizeClass(["var-option var--box", [_ctx.optionSelected ? 'var-option--selected-color' : null]]),
20
+ style: _normalizeStyle({
26
21
  width: _ctx.wrapWidth,
27
22
  color: _ctx.optionSelected ? _ctx.focusColor : null
28
- },
29
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
30
- }, [_createVNode("div", {
31
- class: ["var-option__cover", [_ctx.optionSelected ? 'var-option--selected-background' : null]],
32
- style: {
23
+ }),
24
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
25
+ }, [_createElementVNode("div", {
26
+ class: _normalizeClass(["var-option__cover", [_ctx.optionSelected ? 'var-option--selected-background' : null]]),
27
+ style: _normalizeStyle({
33
28
  background: _ctx.optionSelected ? _ctx.focusColor : null
34
- }
29
+ })
35
30
  }, null, 6
36
31
  /* CLASS, STYLE */
37
32
  ), _ctx.multiple ? (_openBlock(), _createBlock(_component_var_checkbox, {
@@ -39,17 +34,17 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
39
34
  ref: "checkbox",
40
35
  "checked-color": _ctx.focusColor,
41
36
  modelValue: _ctx.optionSelected,
42
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.optionSelected = $event),
43
- onClick: _cache[2] || (_cache[2] = _withModifiers(() => {}, ["stop"])),
37
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.optionSelected = $event),
38
+ onClick: _cache[1] || (_cache[1] = _withModifiers(() => {}, ["stop"])),
44
39
  onChange: _ctx.handleSelect
45
40
  }, null, 8
46
41
  /* PROPS */
47
- , ["checked-color", "modelValue", "onChange"])) : _createCommentVNode("v-if", true), _createVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.label), 1
42
+ , ["checked-color", "modelValue", "onChange"])) : _createCommentVNode("v-if", true), _createElementVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.label), 1
48
43
  /* TEXT */
49
44
  )])])], 6
50
45
  /* CLASS, STYLE */
51
46
  )), [[_directive_ripple]]);
52
- });
47
+ }
53
48
  export default defineComponent({
54
49
  render,
55
50
  name: 'VarOption',
@@ -7,11 +7,9 @@ import { toPxNum, getTranslate } from '../utils/elements';
7
7
  import { pack } from '../locale';
8
8
  var MOMENTUM_RECORD_TIME = 300;
9
9
  var MOMENTUM_ALLOW_DISTANCE = 15;
10
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createBlock as _createBlock, withModifiers as _withModifiers, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
10
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, withModifiers as _withModifiers, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
11
11
 
12
- var _withId = /*#__PURE__*/_withScopeId("");
13
-
14
- _pushScopeId("");
12
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
15
13
 
16
14
  var _hoisted_1 = {
17
15
  class: "var-picker__toolbar"
@@ -19,13 +17,12 @@ var _hoisted_1 = {
19
17
  var _hoisted_2 = {
20
18
  class: "var-picker__title"
21
19
  };
22
- var _hoisted_3 = {
20
+ var _hoisted_3 = ["onTouchstart", "onTouchmove", "onTouchend"];
21
+ var _hoisted_4 = ["onTransitionend"];
22
+ var _hoisted_5 = {
23
23
  class: "var-picker__text"
24
24
  };
25
-
26
- _popScopeId();
27
-
28
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
25
+ export function render(_ctx, _cache) {
29
26
  var _component_var_button = _resolveComponent("var-button");
30
27
 
31
28
  return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.dynamic ? 'var-popup' : _ctx.Transition), _mergeProps(_ctx.dynamic ? {
@@ -48,16 +45,16 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
48
45
  } : null, {
49
46
  "var-picker-cover": ""
50
47
  }), {
51
- default: _withId(() => [_createVNode("div", _mergeProps({
48
+ default: _withCtx(() => [_createElementVNode("div", _mergeProps({
52
49
  class: "var-picker"
53
- }, _ctx.$attrs), [_createVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "cancel", {}, () => [_createVNode(_component_var_button, {
50
+ }, _ctx.$attrs), [_createElementVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "cancel", {}, () => [_createVNode(_component_var_button, {
54
51
  class: "var-picker__cancel-button",
55
52
  "var-picker-cover": "",
56
53
  text: "",
57
54
  "text-color": _ctx.cancelButtonTextColor,
58
55
  onClick: _ctx.cancel
59
56
  }, {
60
- default: _withId(() => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.cancelButtonText, _ctx.pack.pickerCancelButtonText)), 1
57
+ default: _withCtx(() => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.cancelButtonText, _ctx.pack.pickerCancelButtonText)), 1
61
58
  /* TEXT */
62
59
  )]),
63
60
  _: 1
@@ -65,7 +62,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
65
62
 
66
63
  }, 8
67
64
  /* PROPS */
68
- , ["text-color", "onClick"])]), _renderSlot(_ctx.$slots, "title", {}, () => [_createVNode("div", _hoisted_2, _toDisplayString(_ctx.dt(_ctx.title, _ctx.pack.pickerTitle)), 1
65
+ , ["text-color", "onClick"])]), _renderSlot(_ctx.$slots, "title", {}, () => [_createElementVNode("div", _hoisted_2, _toDisplayString(_ctx.dt(_ctx.title, _ctx.pack.pickerTitle)), 1
69
66
  /* TEXT */
70
67
  )]), _renderSlot(_ctx.$slots, "confirm", {}, () => [_createVNode(_component_var_button, {
71
68
  class: "var-picker__confirm-button",
@@ -74,7 +71,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
74
71
  "text-color": _ctx.confirmButtonTextColor,
75
72
  onClick: _ctx.confirm
76
73
  }, {
77
- default: _withId(() => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.confirmButtonText, _ctx.pack.pickerConfirmButtonText)), 1
74
+ default: _withCtx(() => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.confirmButtonText, _ctx.pack.pickerConfirmButtonText)), 1
78
75
  /* TEXT */
79
76
  )]),
80
77
  _: 1
@@ -82,35 +79,35 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
82
79
 
83
80
  }, 8
84
81
  /* PROPS */
85
- , ["text-color", "onClick"])])]), _createVNode("div", {
82
+ , ["text-color", "onClick"])])]), _createElementVNode("div", {
86
83
  class: "var-picker__columns",
87
- style: {
84
+ style: _normalizeStyle({
88
85
  height: _ctx.columnHeight + "px"
89
- }
90
- }, [(_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.scrollColumns, c => {
91
- return _openBlock(), _createBlock("div", {
86
+ })
87
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.scrollColumns, c => {
88
+ return _openBlock(), _createElementBlock("div", {
92
89
  class: "var-picker__column",
93
90
  key: c,
94
91
  onTouchstart: $event => _ctx.handleTouchstart($event, c),
95
92
  onTouchmove: _withModifiers($event => _ctx.handleTouchmove($event, c), ["prevent"]),
96
93
  onTouchend: $event => _ctx.handleTouchend($event, c)
97
- }, [_createVNode("div", {
94
+ }, [_createElementVNode("div", {
98
95
  class: "var-picker__scroller",
99
96
  ref: el => c.scrollEl = el,
100
- style: {
97
+ style: _normalizeStyle({
101
98
  transform: "translateY(" + c.translate + "px)",
102
99
  transitionDuration: c.duration + "ms",
103
100
  transitionProperty: c.duration ? 'transform' : 'none'
104
- },
101
+ }),
105
102
  onTransitionend: $event => _ctx.handleTransitionend(c)
106
- }, [(_openBlock(true), _createBlock(_Fragment, null, _renderList(c.column.texts, t => {
107
- return _openBlock(), _createBlock("div", {
103
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(c.column.texts, t => {
104
+ return _openBlock(), _createElementBlock("div", {
108
105
  class: "var-picker__option",
109
- style: {
106
+ style: _normalizeStyle({
110
107
  height: _ctx.optionHeight + "px"
111
- },
108
+ }),
112
109
  key: t
113
- }, [_createVNode("div", _hoisted_3, _toDisplayString(t), 1
110
+ }, [_createElementVNode("div", _hoisted_5, _toDisplayString(t), 1
114
111
  /* TEXT */
115
112
  )], 4
116
113
  /* STYLE */
@@ -119,24 +116,24 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
119
116
  /* KEYED_FRAGMENT */
120
117
  ))], 44
121
118
  /* STYLE, PROPS, HYDRATE_EVENTS */
122
- , ["onTransitionend"])], 40
119
+ , _hoisted_4)], 40
123
120
  /* PROPS, HYDRATE_EVENTS */
124
- , ["onTouchstart", "onTouchmove", "onTouchend"]);
121
+ , _hoisted_3);
125
122
  }), 128
126
123
  /* KEYED_FRAGMENT */
127
- )), _createVNode("div", {
124
+ )), _createElementVNode("div", {
128
125
  class: "var-picker__picked",
129
- style: {
126
+ style: _normalizeStyle({
130
127
  top: _ctx.center + "px",
131
128
  height: _ctx.optionHeight + "px"
132
- }
129
+ })
133
130
  }, null, 4
134
131
  /* STYLE */
135
- ), _createVNode("div", {
132
+ ), _createElementVNode("div", {
136
133
  class: "var-picker__mask",
137
- style: {
134
+ style: _normalizeStyle({
138
135
  backgroundSize: "100% " + (_ctx.columnHeight - _ctx.optionHeight) / 2 + "px"
139
- }
136
+ })
140
137
  }, null, 4
141
138
  /* STYLE */
142
139
  )], 4
@@ -150,7 +147,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
150
147
  }, 16
151
148
  /* FULL_PROPS */
152
149
  );
153
- });
150
+ }
154
151
  export default defineComponent({
155
152
  render,
156
153
  name: 'VarPicker',
package/es/popup/Popup.js CHANGED
@@ -5,11 +5,8 @@ import { props } from './props';
5
5
  import { useLock } from '../context/lock';
6
6
  import { useZIndex } from '../context/zIndex';
7
7
  import { addRouteListener, useTeleport } from '../utils/components';
8
- import { openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, mergeProps as _mergeProps, Transition as _Transition, createVNode as _createVNode, vShow as _vShow, withDirectives as _withDirectives, Teleport as _Teleport, withScopeId as _withScopeId } from "vue";
9
-
10
- var _withId = /*#__PURE__*/_withScopeId("");
11
-
12
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
8
+ import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, mergeProps as _mergeProps, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, vShow as _vShow, createElementVNode as _createElementVNode, withDirectives as _withDirectives, Teleport as _Teleport, createBlock as _createBlock } from "vue";
9
+ export function render(_ctx, _cache) {
13
10
  return _openBlock(), _createBlock(_Teleport, {
14
11
  to: _ctx.teleport,
15
12
  disabled: !_ctx.teleport || _ctx.disabled
@@ -18,24 +15,24 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
18
15
  onAfterEnter: _ctx.onOpened,
19
16
  onAfterLeave: _ctx.onClosed
20
17
  }, {
21
- default: _withId(() => [_withDirectives(_createVNode("div", {
18
+ default: _withCtx(() => [_withDirectives(_createElementVNode("div", {
22
19
  class: "var--box var-popup",
23
- style: {
20
+ style: _normalizeStyle({
24
21
  zIndex: _ctx.zIndex - 2
25
- }
26
- }, [_ctx.overlay ? (_openBlock(), _createBlock("div", {
22
+ })
23
+ }, [_ctx.overlay ? (_openBlock(), _createElementBlock("div", {
27
24
  key: 0,
28
- class: ["var-popup__overlay", [_ctx.overlayClass]],
29
- style: _extends({
25
+ class: _normalizeClass(["var-popup__overlay", [_ctx.overlayClass]]),
26
+ style: _normalizeStyle(_extends({
30
27
  zIndex: _ctx.zIndex - 1
31
- }, _ctx.overlayStyle),
32
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.hidePopup && _ctx.hidePopup(...args))
28
+ }, _ctx.overlayStyle)),
29
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.hidePopup && _ctx.hidePopup(...args))
33
30
  }, null, 6
34
31
  /* CLASS, STYLE */
35
32
  )) : _createCommentVNode("v-if", true), _createVNode(_Transition, {
36
33
  name: _ctx.transition ? _ctx.transition : "var-pop-" + _ctx.position
37
34
  }, {
38
- default: _withId(() => [_ctx.show ? (_openBlock(), _createBlock("div", _mergeProps({
35
+ default: _withCtx(() => [_ctx.show ? (_openBlock(), _createElementBlock("div", _mergeProps({
39
36
  key: 0,
40
37
  class: ["var-popup__content var-elevation--3", ["var-popup--" + _ctx.position]],
41
38
  style: {
@@ -52,15 +49,15 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
52
49
  , ["name"])], 4
53
50
  /* STYLE */
54
51
  ), [[_vShow, _ctx.show]])]),
55
- _: 1
56
- /* STABLE */
52
+ _: 3
53
+ /* FORWARDED */
57
54
 
58
55
  }, 8
59
56
  /* PROPS */
60
57
  , ["onAfterEnter", "onAfterLeave"])], 8
61
58
  /* PROPS */
62
59
  , ["to", "disabled"]);
63
- });
60
+ }
64
61
  export default defineComponent({
65
62
  render,
66
63
  name: 'VarPopup',