@varlet/ui 1.20.0 → 1.22.0-alpha.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 (75) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/es/action-sheet/ActionSheet.js +15 -19
  3. package/es/app-bar/AppBar.js +14 -19
  4. package/es/back-top/BackTop.js +7 -10
  5. package/es/badge/Badge.js +7 -12
  6. package/es/button/Button.js +14 -13
  7. package/es/card/Card.js +19 -23
  8. package/es/cell/Cell.js +14 -19
  9. package/es/checkbox/Checkbox.js +14 -19
  10. package/es/checkbox-group/CheckboxGroup.js +6 -11
  11. package/es/chip/Chip.js +8 -11
  12. package/es/col/Col.js +8 -11
  13. package/es/collapse/Collapse.js +5 -10
  14. package/es/collapse-item/CollapseItem.js +16 -21
  15. package/es/countdown/Countdown.js +5 -10
  16. package/es/counter/Counter.js +18 -22
  17. package/es/date-picker/DatePicker.js +22 -27
  18. package/es/date-picker/src/day-picker-panel.js +11 -16
  19. package/es/date-picker/src/month-picker-panel.js +9 -14
  20. package/es/date-picker/src/panel-header.js +12 -17
  21. package/es/date-picker/src/year-picker-panel.js +11 -15
  22. package/es/dialog/Dialog.js +12 -17
  23. package/es/divider/Divider.js +8 -13
  24. package/es/form/Form.js +5 -10
  25. package/es/form-details/FormDetails.js +6 -11
  26. package/es/icon/Icon.js +6 -9
  27. package/es/icon/icon.less +1 -1
  28. package/es/image/Image.js +23 -21
  29. package/es/image-preview/ImagePreview.js +20 -24
  30. package/es/index-anchor/IndexAnchor.js +17 -9
  31. package/es/index-bar/IndexBar.js +26 -20
  32. package/es/index-bar/props.js +4 -0
  33. package/es/input/Input.js +33 -37
  34. package/es/list/List.js +10 -15
  35. package/es/loading/Loading.js +21 -24
  36. package/es/menu/Menu.js +9 -12
  37. package/es/option/Option.js +16 -21
  38. package/es/picker/Picker.js +33 -36
  39. package/es/popup/Popup.js +14 -17
  40. package/es/progress/Progress.js +30 -32
  41. package/es/pull-refresh/PullRefresh.js +12 -15
  42. package/es/radio/Radio.js +14 -19
  43. package/es/radio-group/RadioGroup.js +6 -11
  44. package/es/rate/Rate.js +12 -16
  45. package/es/row/Row.js +7 -10
  46. package/es/select/Select.js +42 -47
  47. package/es/skeleton/Skeleton.js +41 -39
  48. package/es/slider/Slider.js +32 -36
  49. package/es/snackbar/Snackbar.js +8 -11
  50. package/es/snackbar/core.js +14 -19
  51. package/es/snackbar/style/index.js +1 -1
  52. package/es/snackbar/style/less.js +1 -1
  53. package/es/step/Step.js +42 -97
  54. package/es/steps/Steps.js +6 -9
  55. package/es/sticky/Sticky.js +38 -33
  56. package/es/sticky/props.js +8 -0
  57. package/es/sticky/sticky.css +1 -1
  58. package/es/sticky/sticky.less +6 -2
  59. package/es/swipe/Swipe.js +20 -24
  60. package/es/swipe-item/SwipeItem.js +6 -9
  61. package/es/switch/Switch.js +16 -21
  62. package/es/tab/Tab.js +8 -11
  63. package/es/tab-item/TabItem.js +5 -8
  64. package/es/tabs/Tabs.js +10 -13
  65. package/es/tabs-items/TabsItems.js +4 -7
  66. package/es/time-picker/TimePicker.js +31 -36
  67. package/es/time-picker/clock.js +14 -19
  68. package/es/uploader/Uploader.js +31 -31
  69. package/highlight/attributes.json +12 -0
  70. package/highlight/tags.json +4 -1
  71. package/highlight/web-types.json +27 -0
  72. package/package.json +4 -4
  73. package/types/indexBar.d.ts +1 -0
  74. package/types/sticky.d.ts +2 -0
  75. package/umd/varlet.js +2 -1
@@ -1,38 +1,35 @@
1
- import { defineComponent, ref, onMounted, onUnmounted, onActivated, onDeactivated, computed } from 'vue';
1
+ import { defineComponent, ref, onMounted, onUnmounted, onActivated, onDeactivated, computed, watch } from 'vue';
2
2
  import { props } from './props';
3
3
  import { getParentScroller, toPxNum } from '../utils/elements';
4
4
  import { toNumber } from '../utils/shared';
5
- import { renderSlot as _renderSlot, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from "vue";
6
-
7
- var _withId = /*#__PURE__*/_withScopeId("");
8
-
9
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
10
- return _openBlock(), _createBlock("div", {
11
- class: "var-sticky",
5
+ import { renderSlot as _renderSlot, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
6
+ export function render(_ctx, _cache) {
7
+ return _openBlock(), _createElementBlock("div", {
8
+ class: _normalizeClass(["var-sticky", [_ctx.enableCSSMode ? 'var-sticky--css-mode' : null]]),
12
9
  ref: "stickyEl",
13
- style: {
10
+ style: _normalizeStyle({
14
11
  zIndex: _ctx.toNumber(_ctx.zIndex),
15
- top: !_ctx.isFixed ? _ctx.offsetTop + "px" : null,
16
- width: _ctx.isFixed ? _ctx.fixedWidth : null,
17
- height: _ctx.isFixed ? _ctx.fixedHeight : null
18
- }
19
- }, [_createVNode("div", {
12
+ top: _ctx.enableCSSMode ? _ctx.offsetTop + "px" : null,
13
+ width: _ctx.enableFixedMode ? _ctx.fixedWidth : null,
14
+ height: _ctx.enableFixedMode ? _ctx.fixedHeight : null
15
+ })
16
+ }, [_createElementVNode("div", {
20
17
  class: "var-sticky__wrapper",
21
18
  ref: "wrapperEl",
22
- style: {
19
+ style: _normalizeStyle({
23
20
  zIndex: _ctx.toNumber(_ctx.zIndex),
24
- position: _ctx.isFixed ? 'fixed' : null,
25
- width: _ctx.isFixed ? _ctx.fixedWrapperWidth : null,
26
- height: _ctx.isFixed ? _ctx.fixedWrapperHeight : null,
27
- left: _ctx.isFixed ? _ctx.fixedLeft : null,
28
- top: _ctx.isFixed ? _ctx.fixedTop : null
29
- }
21
+ position: _ctx.enableFixedMode ? 'fixed' : null,
22
+ width: _ctx.enableFixedMode ? _ctx.fixedWrapperWidth : null,
23
+ height: _ctx.enableFixedMode ? _ctx.fixedWrapperHeight : null,
24
+ left: _ctx.enableFixedMode ? _ctx.fixedLeft : null,
25
+ top: _ctx.enableFixedMode ? _ctx.fixedTop : null
26
+ })
30
27
  }, [_renderSlot(_ctx.$slots, "default")], 4
31
28
  /* STYLE */
32
- )], 4
33
- /* STYLE */
29
+ )], 6
30
+ /* CLASS, STYLE */
34
31
  );
35
- });
32
+ }
36
33
  export default defineComponent({
37
34
  render,
38
35
  name: 'VarSticky',
@@ -41,7 +38,6 @@ export default defineComponent({
41
38
  setup(props) {
42
39
  var stickyEl = ref(null);
43
40
  var wrapperEl = ref(null);
44
- var isSupportCSSSticky;
45
41
  var isFixed = ref(false);
46
42
  var fixedTop = ref('0px');
47
43
  var fixedLeft = ref('0px');
@@ -49,10 +45,22 @@ export default defineComponent({
49
45
  var fixedHeight = ref('auto');
50
46
  var fixedWrapperWidth = ref('auto');
51
47
  var fixedWrapperHeight = ref('auto');
48
+ var enableCSSMode = computed(() => !props.disabled && props.cssMode);
49
+ var enableFixedMode = computed(() => !props.disabled && isFixed.value);
52
50
  var offsetTop = computed(() => toPxNum(props.offsetTop));
53
51
  var scroller = window;
54
52
 
55
53
  var handleScroll = () => {
54
+ var {
55
+ onScroll,
56
+ cssMode,
57
+ disabled
58
+ } = props;
59
+
60
+ if (disabled) {
61
+ return;
62
+ }
63
+
56
64
  var scrollerTop = 0;
57
65
 
58
66
  if (scroller !== window) {
@@ -69,12 +77,9 @@ export default defineComponent({
69
77
  left: stickyLeft
70
78
  } = sticky.getBoundingClientRect();
71
79
  var currentOffsetTop = stickyTop - scrollerTop;
72
- var {
73
- onScroll
74
- } = props;
75
80
 
76
81
  if (currentOffsetTop <= offsetTop.value) {
77
- if (!isSupportCSSSticky) {
82
+ if (!cssMode) {
78
83
  fixedWidth.value = sticky.offsetWidth + "px";
79
84
  fixedHeight.value = sticky.offsetHeight + "px";
80
85
  fixedTop.value = scrollerTop + offsetTop.value + "px";
@@ -103,12 +108,10 @@ export default defineComponent({
103
108
  window.removeEventListener('scroll', handleScroll);
104
109
  };
105
110
 
111
+ watch(() => props.disabled, handleScroll);
106
112
  onActivated(addScrollListener);
107
113
  onDeactivated(removeScrollListener);
108
- onMounted(() => {
109
- isSupportCSSSticky = ['sticky', '-webkit-sticky'].includes(window.getComputedStyle(stickyEl.value).position);
110
- addScrollListener();
111
- });
114
+ onMounted(addScrollListener);
112
115
  onUnmounted(removeScrollListener);
113
116
  return {
114
117
  stickyEl,
@@ -121,6 +124,8 @@ export default defineComponent({
121
124
  fixedHeight,
122
125
  fixedWrapperWidth,
123
126
  fixedWrapperHeight,
127
+ enableCSSMode,
128
+ enableFixedMode,
124
129
  toNumber
125
130
  };
126
131
  }
@@ -7,6 +7,14 @@ export var props = {
7
7
  type: [String, Number],
8
8
  default: 10
9
9
  },
10
+ cssMode: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ disabled: {
15
+ type: Boolean,
16
+ default: false
17
+ },
10
18
  onScroll: {
11
19
  type: Function
12
20
  }
@@ -1 +1 @@
1
- .var-sticky { position: sticky; position: -webkit-sticky;}
1
+ .var-sticky { position: relative;}.var-sticky--css-mode { position: sticky; position: -webkit-sticky;}
@@ -1,4 +1,8 @@
1
1
  .var-sticky {
2
- position: sticky;
3
- position: -webkit-sticky;
2
+ position: relative;
3
+
4
+ &--css-mode {
5
+ position: sticky;
6
+ position: -webkit-sticky;
7
+ }
4
8
  }
package/es/swipe/Swipe.js CHANGED
@@ -5,50 +5,46 @@ import { props } from './props';
5
5
  import { isNumber, toNumber } from '../utils/shared';
6
6
  var SWIPE_DELAY = 250;
7
7
  var SWIPE_DISTANCE = 20;
8
- import { renderSlot as _renderSlot, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
8
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, 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
  class: "var-swipe",
16
14
  ref: "swipeEl"
17
15
  };
18
-
19
- _popScopeId();
20
-
21
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
22
- return _openBlock(), _createBlock("div", _hoisted_1, [_createVNode("div", {
23
- class: ["var-swipe__track", [_ctx.vertical ? 'var-swipe--vertical' : null]],
24
- style: {
16
+ var _hoisted_2 = ["onClick"];
17
+ export function render(_ctx, _cache) {
18
+ return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
19
+ class: _normalizeClass(["var-swipe__track", [_ctx.vertical ? 'var-swipe--vertical' : null]]),
20
+ style: _normalizeStyle({
25
21
  width: !_ctx.vertical ? _ctx.trackSize + "px" : null,
26
22
  height: _ctx.vertical ? _ctx.trackSize + "px" : null,
27
23
  transform: "translate" + (_ctx.vertical ? 'Y' : 'X') + "(" + _ctx.translate + "px)",
28
24
  transitionDuration: _ctx.lockDuration ? "0ms" : _ctx.toNumber(_ctx.duration) + "ms"
29
- },
30
- onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.handleTouchstart && _ctx.handleTouchstart(...args)),
31
- onTouchmove: _cache[2] || (_cache[2] = (...args) => _ctx.handleTouchmove && _ctx.handleTouchmove(...args)),
32
- onTouchend: _cache[3] || (_cache[3] = (...args) => _ctx.handleTouchend && _ctx.handleTouchend(...args))
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))
33
29
  }, [_renderSlot(_ctx.$slots, "default")], 38
34
30
  /* CLASS, STYLE, HYDRATE_EVENTS */
35
31
  ), _renderSlot(_ctx.$slots, "indicator", {
36
32
  index: _ctx.index,
37
33
  length: _ctx.length
38
- }, () => [_ctx.indicator && _ctx.length ? (_openBlock(), _createBlock("div", {
34
+ }, () => [_ctx.indicator && _ctx.length ? (_openBlock(), _createElementBlock("div", {
39
35
  key: 0,
40
- class: ["var-swipe__indicators", [_ctx.vertical ? 'var-swipe--indicators-vertical' : null]]
41
- }, [(_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.length, (l, idx) => {
42
- return _openBlock(), _createBlock("div", {
43
- class: ["var-swipe__indicator", [_ctx.index === idx ? 'var-swipe--indicator-active' : null, _ctx.vertical ? 'var-swipe--indicator-vertical' : null]],
44
- style: {
36
+ class: _normalizeClass(["var-swipe__indicators", [_ctx.vertical ? 'var-swipe--indicators-vertical' : null]])
37
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.length, (l, idx) => {
38
+ return _openBlock(), _createElementBlock("div", {
39
+ class: _normalizeClass(["var-swipe__indicator", [_ctx.index === idx ? 'var-swipe--indicator-active' : null, _ctx.vertical ? 'var-swipe--indicator-vertical' : null]]),
40
+ style: _normalizeStyle({
45
41
  background: _ctx.indicatorColor
46
- },
42
+ }),
47
43
  key: l,
48
44
  onClick: $event => _ctx.to(idx)
49
45
  }, null, 14
50
46
  /* CLASS, STYLE, PROPS */
51
- , ["onClick"]);
47
+ , _hoisted_2);
52
48
  }), 128
53
49
  /* KEYED_FRAGMENT */
54
50
  ))], 2
@@ -56,7 +52,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
56
52
  )) : _createCommentVNode("v-if", true)])], 512
57
53
  /* NEED_PATCH */
58
54
  );
59
- });
55
+ }
60
56
  export default defineComponent({
61
57
  render,
62
58
  name: 'VarSwipe',
@@ -1,21 +1,18 @@
1
1
  import { defineComponent, ref } from 'vue';
2
2
  import { useSwipe } from './provide';
3
- import { renderSlot as _renderSlot, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from "vue";
4
-
5
- var _withId = /*#__PURE__*/_withScopeId("");
6
-
7
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
8
- return _openBlock(), _createBlock("div", {
3
+ import { renderSlot as _renderSlot, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
4
+ export function render(_ctx, _cache) {
5
+ return _openBlock(), _createElementBlock("div", {
9
6
  class: "var-swipe-item",
10
- style: {
7
+ style: _normalizeStyle({
11
8
  width: !_ctx.vertical ? _ctx.size + "px" : null,
12
9
  height: _ctx.vertical ? _ctx.size + "px" : null,
13
10
  transform: "translate" + (_ctx.vertical ? 'Y' : 'X') + "(" + _ctx.translate + "px)"
14
- }
11
+ })
15
12
  }, [_renderSlot(_ctx.$slots, "default")], 4
16
13
  /* STYLE */
17
14
  );
18
- });
15
+ }
19
16
  export default defineComponent({
20
17
  render,
21
18
  name: 'VarSwipeItem',
@@ -6,40 +6,35 @@ import { props } from './props';
6
6
  import FormDetails from '../form-details';
7
7
  import Loading from '../loading';
8
8
  import Ripple from '../ripple';
9
- import { createVNode as _createVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
9
+ import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createVNode as _createVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
10
10
 
11
- var _withId = /*#__PURE__*/_withScopeId("");
12
-
13
- _pushScopeId("");
11
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
14
12
 
15
13
  var _hoisted_1 = {
16
14
  class: "var-switch"
17
15
  };
18
-
19
- _popScopeId();
20
-
21
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
16
+ export function render(_ctx, _cache) {
22
17
  var _component_var_loading = _resolveComponent("var-loading");
23
18
 
24
19
  var _component_var_form_details = _resolveComponent("var-form-details");
25
20
 
26
21
  var _directive_ripple = _resolveDirective("ripple");
27
22
 
28
- return _openBlock(), _createBlock("div", _hoisted_1, [_createVNode("div", {
29
- class: ["var-switch-block", [_ctx.disabled || _ctx.formDisabled ? 'var-switch__disable' : null]],
30
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.switchActive && _ctx.switchActive(...args)),
31
- style: _ctx.styleComputed.switch
32
- }, [_createVNode("div", {
33
- style: _ctx.styleComputed.track,
34
- class: ["var-switch__track", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__track-active' : null, _ctx.errorMessage ? 'var-switch__track-error' : null]]
23
+ return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
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)),
26
+ style: _normalizeStyle(_ctx.styleComputed.switch)
27
+ }, [_createElementVNode("div", {
28
+ style: _normalizeStyle(_ctx.styleComputed.track),
29
+ class: _normalizeClass(["var-switch__track", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__track-active' : null, _ctx.errorMessage ? 'var-switch__track-error' : null]])
35
30
  }, null, 6
36
31
  /* CLASS, STYLE */
37
- ), _withDirectives(_createVNode("div", {
32
+ ), _withDirectives(_createElementVNode("div", {
38
33
  class: "var-switch__ripple",
39
- style: _ctx.styleComputed.ripple
40
- }, [_createVNode("div", {
41
- style: _ctx.styleComputed.handle,
42
- class: ["var-switch__handle var-elevation--2", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__handle-active' : null, _ctx.errorMessage ? 'var-switch__handle-error' : null]]
34
+ style: _normalizeStyle(_ctx.styleComputed.ripple)
35
+ }, [_createElementVNode("div", {
36
+ style: _normalizeStyle(_ctx.styleComputed.handle),
37
+ class: _normalizeClass(["var-switch__handle var-elevation--2", [_ctx.modelValue === _ctx.activeValue ? 'var-switch__handle-active' : null, _ctx.errorMessage ? 'var-switch__handle-error' : null]])
43
38
  }, [_ctx.loading ? (_openBlock(), _createBlock(_component_var_loading, {
44
39
  key: 0,
45
40
  radius: _ctx.size / 2 - 2
@@ -58,7 +53,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
58
53
  }, null, 8
59
54
  /* PROPS */
60
55
  , ["error-message"])]);
61
- });
56
+ }
62
57
  export default defineComponent({
63
58
  render,
64
59
  name: 'VarSwitch',
package/es/tab/Tab.js CHANGED
@@ -2,26 +2,23 @@ import { defineComponent, ref, computed, watch } from 'vue';
2
2
  import { props } from './props';
3
3
  import Ripple from '../ripple';
4
4
  import { useTabs } from './provide';
5
- import { renderSlot as _renderSlot, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from "vue";
6
-
7
- var _withId = /*#__PURE__*/_withScopeId("");
8
-
9
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
5
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
6
+ export function render(_ctx, _cache) {
10
7
  var _directive_ripple = _resolveDirective("ripple");
11
8
 
12
- return _withDirectives((_openBlock(), _createBlock("div", {
13
- class: ["var-tab var--box", [_ctx.computeColorClass(), "var-tab--" + _ctx.itemDirection]],
9
+ return _withDirectives((_openBlock(), _createElementBlock("div", {
10
+ class: _normalizeClass(["var-tab var--box", [_ctx.computeColorClass(), "var-tab--" + _ctx.itemDirection]]),
14
11
  ref: "tabEl",
15
- style: {
12
+ style: _normalizeStyle({
16
13
  color: _ctx.computeColorStyle()
17
- },
18
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
14
+ }),
15
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
19
16
  }, [_renderSlot(_ctx.$slots, "default")], 6
20
17
  /* CLASS, STYLE */
21
18
  )), [[_directive_ripple, {
22
19
  disabled: _ctx.disabled
23
20
  }]]);
24
- });
21
+ }
25
22
  export default defineComponent({
26
23
  render,
27
24
  name: 'VarTab',
@@ -2,17 +2,14 @@ import SwipeItem from '../swipe-item';
2
2
  import { defineComponent, ref, computed } from 'vue';
3
3
  import { useTabsItems } from './provide';
4
4
  import { props } from './props';
5
- import { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from "vue";
6
-
7
- var _withId = /*#__PURE__*/_withScopeId("");
8
-
9
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
5
+ import { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
6
+ export function render(_ctx, _cache) {
10
7
  var _component_var_swipe_item = _resolveComponent("var-swipe-item");
11
8
 
12
9
  return _openBlock(), _createBlock(_component_var_swipe_item, {
13
- class: ["var-tab-item", [!_ctx.current && 'var-tab-item--inactive']]
10
+ class: _normalizeClass(["var-tab-item", [!_ctx.current && 'var-tab-item--inactive']])
14
11
  }, {
15
- default: _withId(() => [_ctx.initSlot ? _renderSlot(_ctx.$slots, "default", {
12
+ default: _withCtx(() => [_ctx.initSlot ? _renderSlot(_ctx.$slots, "default", {
16
13
  key: 0
17
14
  }) : _createCommentVNode("v-if", true)]),
18
15
  _: 3
@@ -21,7 +18,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
21
18
  }, 8
22
19
  /* PROPS */
23
20
  , ["class"]);
24
- });
21
+ }
25
22
  export default defineComponent({
26
23
  render,
27
24
  name: 'VarTabItem',
package/es/tabs/Tabs.js CHANGED
@@ -4,30 +4,27 @@ import { props } from './props';
4
4
  import { useTabList } from './provide';
5
5
  import { isNumber, linear } from '../utils/shared';
6
6
  import { toSizeUnit, scrollTo } from '../utils/elements';
7
- import { renderSlot as _renderSlot, createVNode as _createVNode, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from "vue";
8
-
9
- var _withId = /*#__PURE__*/_withScopeId("");
10
-
11
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
7
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
8
+ export function render(_ctx, _cache) {
12
9
  return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.sticky ? 'var-sticky' : _ctx.Transition), {
13
10
  "offset-top": _ctx.sticky ? _ctx.offsetTop : null
14
11
  }, {
15
- default: _withId(() => [_createVNode("div", _mergeProps({
12
+ default: _withCtx(() => [_createElementVNode("div", _mergeProps({
16
13
  class: ["var-tabs var--box", ["var-tabs--item-" + _ctx.itemDirection, "var-tabs--layout-" + _ctx.layoutDirection + "-padding", _ctx.elevation ? "var-elevation--4" : null, _ctx.fixedBottom ? 'var-tabs--fixed-bottom' : null]],
17
14
  style: {
18
15
  background: _ctx.color
19
16
  }
20
- }, _ctx.$attrs), [_createVNode("div", {
21
- class: ["var-tabs__tab-wrap", [_ctx.scrollable ? "var-tabs--layout-" + _ctx.layoutDirection + "-scrollable" : null, "var-tabs--layout-" + _ctx.layoutDirection]],
17
+ }, _ctx.$attrs), [_createElementVNode("div", {
18
+ class: _normalizeClass(["var-tabs__tab-wrap", [_ctx.scrollable ? "var-tabs--layout-" + _ctx.layoutDirection + "-scrollable" : null, "var-tabs--layout-" + _ctx.layoutDirection]]),
22
19
  ref: "scrollerEl"
23
- }, [_renderSlot(_ctx.$slots, "default"), _createVNode("div", {
24
- class: ["var-tabs__indicator", ["var-tabs--layout-" + _ctx.layoutDirection + "-indicator"]],
25
- style: {
20
+ }, [_renderSlot(_ctx.$slots, "default"), _createElementVNode("div", {
21
+ class: _normalizeClass(["var-tabs__indicator", ["var-tabs--layout-" + _ctx.layoutDirection + "-indicator"]]),
22
+ style: _normalizeStyle({
26
23
  width: _ctx.layoutDirection === 'horizontal' ? _ctx.indicatorWidth : _ctx.toSizeUnit(_ctx.indicatorSize),
27
24
  height: _ctx.layoutDirection === 'horizontal' ? _ctx.toSizeUnit(_ctx.indicatorSize) : _ctx.indicatorHeight,
28
25
  transform: _ctx.layoutDirection === 'horizontal' ? "translateX(" + _ctx.indicatorX + ")" : "translateY(" + _ctx.indicatorY + ")",
29
26
  background: _ctx.indicatorColor || _ctx.activeColor
30
- }
27
+ })
31
28
  }, null, 6
32
29
  /* CLASS, STYLE */
33
30
  )], 2
@@ -41,7 +38,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
41
38
  }, 8
42
39
  /* PROPS */
43
40
  , ["offset-top"]);
44
- });
41
+ }
45
42
  export default defineComponent({
46
43
  render,
47
44
  name: 'VarTabs',
@@ -2,11 +2,8 @@ import Swipe from '../swipe';
2
2
  import { defineComponent, watch, ref } from 'vue';
3
3
  import { useTabItem } from './provide';
4
4
  import { props } from './props';
5
- import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from "vue";
6
-
7
- var _withId = /*#__PURE__*/_withScopeId("");
8
-
9
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
5
+ import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
6
+ export function render(_ctx, _cache) {
10
7
  var _component_var_swipe = _resolveComponent("var-swipe");
11
8
 
12
9
  return _openBlock(), _createBlock(_component_var_swipe, {
@@ -17,14 +14,14 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
17
14
  indicator: false,
18
15
  onChange: _ctx.handleSwipeChange
19
16
  }, {
20
- default: _withId(() => [_renderSlot(_ctx.$slots, "default")]),
17
+ default: _withCtx(() => [_renderSlot(_ctx.$slots, "default")]),
21
18
  _: 3
22
19
  /* FORWARDED */
23
20
 
24
21
  }, 8
25
22
  /* PROPS */
26
23
  , ["loop", "touchable", "onChange"]);
27
- });
24
+ }
28
25
  export default defineComponent({
29
26
  render,
30
27
  name: 'VarTabsItems',
@@ -4,19 +4,17 @@ import Clock from './clock.js'
4
4
  import { props, hoursAmpm, hours24 } from './props';
5
5
  import { toNumber } from '../utils/shared';
6
6
  import { getNumberTime, getIsDisableMinute, getIsDisableSecond } from './utils';
7
- import { toDisplayString as _toDisplayString, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, Transition as _Transition, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
7
+ import { toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, createVNode as _createVNode, Transition as _Transition, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
8
8
 
9
- var _withId = /*#__PURE__*/_withScopeId("");
10
-
11
- _pushScopeId("");
9
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
12
10
 
13
11
  var _hoisted_1 = {
14
12
  class: "var-time-picker-title__time"
15
13
  };
16
14
 
17
- var _hoisted_2 = /*#__PURE__*/_createVNode("span", null, ":", -1
15
+ var _hoisted_2 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/_createElementVNode("span", null, ":", -1
18
16
  /* HOISTED */
19
- );
17
+ ));
20
18
 
21
19
  var _hoisted_3 = {
22
20
  key: 0
@@ -28,58 +26,55 @@ var _hoisted_4 = {
28
26
  var _hoisted_5 = {
29
27
  class: "var-time-picker-body"
30
28
  };
31
-
32
- _popScopeId();
33
-
34
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
29
+ export function render(_ctx, _cache) {
35
30
  var _component_clock = _resolveComponent("clock");
36
31
 
37
- return _openBlock(), _createBlock("div", {
38
- class: ["var-time-picker", [_ctx.shadow ? 'var-elevation--2' : null]],
32
+ return _openBlock(), _createElementBlock("div", {
33
+ class: _normalizeClass(["var-time-picker", [_ctx.shadow ? 'var-elevation--2' : null]]),
39
34
  ref: "picker"
40
- }, [_createVNode("div", {
35
+ }, [_createElementVNode("div", {
41
36
  class: "var-time-picker-title",
42
- style: {
37
+ style: _normalizeStyle({
43
38
  background: _ctx.headerColor || _ctx.color
44
- }
45
- }, [_createVNode("div", _hoisted_1, [_createVNode("div", {
46
- class: ["var-time-picker-title__btn", _ctx.type === 'hour' ? 'var-time-picker-title__btn--active' : null],
47
- onClick: _cache[1] || (_cache[1] = $event => _ctx.checkPanel('hour'))
39
+ })
40
+ }, [_createElementVNode("div", _hoisted_1, [_createElementVNode("div", {
41
+ class: _normalizeClass(["var-time-picker-title__btn", _ctx.type === 'hour' ? 'var-time-picker-title__btn--active' : null]),
42
+ onClick: _cache[0] || (_cache[0] = $event => _ctx.checkPanel('hour'))
48
43
  }, _toDisplayString(_ctx.time.hour), 3
49
44
  /* TEXT, CLASS */
50
- ), _hoisted_2, _createVNode("div", {
51
- class: ["var-time-picker-title__btn", _ctx.type === 'minute' ? 'var-time-picker-title__btn--active' : null],
52
- onClick: _cache[2] || (_cache[2] = $event => _ctx.checkPanel('minute'))
45
+ ), _hoisted_2, _createElementVNode("div", {
46
+ class: _normalizeClass(["var-time-picker-title__btn", _ctx.type === 'minute' ? 'var-time-picker-title__btn--active' : null]),
47
+ onClick: _cache[1] || (_cache[1] = $event => _ctx.checkPanel('minute'))
53
48
  }, _toDisplayString(_ctx.time.minute), 3
54
49
  /* TEXT, CLASS */
55
- ), _ctx.useSeconds ? (_openBlock(), _createBlock("span", _hoisted_3, ":")) : _createCommentVNode("v-if", true), _ctx.useSeconds ? (_openBlock(), _createBlock("div", {
50
+ ), _ctx.useSeconds ? (_openBlock(), _createElementBlock("span", _hoisted_3, ":")) : _createCommentVNode("v-if", true), _ctx.useSeconds ? (_openBlock(), _createElementBlock("div", {
56
51
  key: 1,
57
- class: ["var-time-picker-title__btn", _ctx.type === 'second' ? 'var-time-picker-title__btn--active' : null],
58
- onClick: _cache[3] || (_cache[3] = $event => _ctx.checkPanel('second'))
52
+ class: _normalizeClass(["var-time-picker-title__btn", _ctx.type === 'second' ? 'var-time-picker-title__btn--active' : null]),
53
+ onClick: _cache[2] || (_cache[2] = $event => _ctx.checkPanel('second'))
59
54
  }, _toDisplayString(_ctx.time.second), 3
60
55
  /* TEXT, CLASS */
61
- )) : _createCommentVNode("v-if", true)]), _ctx.format === 'ampm' ? (_openBlock(), _createBlock("div", _hoisted_4, [_createVNode("div", {
62
- class: ["var-time-picker-title__btn", _ctx.ampm === 'am' ? 'var-time-picker-title__btn--active' : null],
63
- onClick: _cache[4] || (_cache[4] = $event => _ctx.checkAmpm('am'))
56
+ )) : _createCommentVNode("v-if", true)]), _ctx.format === 'ampm' ? (_openBlock(), _createElementBlock("div", _hoisted_4, [_createElementVNode("div", {
57
+ class: _normalizeClass(["var-time-picker-title__btn", _ctx.ampm === 'am' ? 'var-time-picker-title__btn--active' : null]),
58
+ onClick: _cache[3] || (_cache[3] = $event => _ctx.checkAmpm('am'))
64
59
  }, " AM ", 2
65
60
  /* CLASS */
66
- ), _createVNode("div", {
67
- class: ["var-time-picker-title__btn", _ctx.ampm === 'pm' ? 'var-time-picker-title__btn--active' : null],
68
- onClick: _cache[5] || (_cache[5] = $event => _ctx.checkAmpm('pm'))
61
+ ), _createElementVNode("div", {
62
+ class: _normalizeClass(["var-time-picker-title__btn", _ctx.ampm === 'pm' ? 'var-time-picker-title__btn--active' : null]),
63
+ onClick: _cache[4] || (_cache[4] = $event => _ctx.checkAmpm('pm'))
69
64
  }, " PM ", 2
70
65
  /* CLASS */
71
66
  )])) : _createCommentVNode("v-if", true)], 4
72
67
  /* STYLE */
73
- ), _createVNode("div", _hoisted_5, [_createVNode("div", {
68
+ ), _createElementVNode("div", _hoisted_5, [_createElementVNode("div", {
74
69
  class: "var-time-picker-clock__container",
75
- onTouchstart: _cache[6] || (_cache[6] = (...args) => _ctx.moveHand && _ctx.moveHand(...args)),
76
- onTouchmove: _cache[7] || (_cache[7] = (...args) => _ctx.moveHand && _ctx.moveHand(...args)),
77
- onTouchend: _cache[8] || (_cache[8] = (...args) => _ctx.end && _ctx.end(...args)),
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)),
78
73
  ref: "container"
79
74
  }, [_createVNode(_Transition, {
80
75
  name: "var-time-picker-panel-fade"
81
76
  }, {
82
- default: _withId(() => [_createVNode(_component_clock, {
77
+ default: _withCtx(() => [_createVNode(_component_clock, {
83
78
  key: _ctx.type,
84
79
  ref: "inner",
85
80
  type: _ctx.type,
@@ -107,7 +102,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
107
102
  )])], 2
108
103
  /* CLASS */
109
104
  );
110
- });
105
+ }
111
106
  export default defineComponent({
112
107
  render,
113
108
  name: 'VarTimePicker',