@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
@@ -4,11 +4,9 @@ import { props } from './props';
4
4
  import { defineComponent, ref, watch } from 'vue';
5
5
  import { dt } from '../utils/shared';
6
6
  import { pack } from '../locale';
7
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createVNode as _createVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
7
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, 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-dialog__title"
@@ -16,10 +14,7 @@ var _hoisted_1 = {
16
14
  var _hoisted_2 = {
17
15
  class: "var-dialog__actions"
18
16
  };
19
-
20
- _popScopeId();
21
-
22
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
17
+ export function render(_ctx, _cache) {
23
18
  var _component_var_button = _resolveComponent("var-button");
24
19
 
25
20
  var _component_var_popup = _resolveComponent("var-popup");
@@ -41,20 +36,20 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
41
36
  onRouteChange: _ctx.onRouteChange,
42
37
  onClickOverlay: _ctx.handleClickOverlay
43
38
  }, {
44
- default: _withId(() => [_createVNode("div", _mergeProps({
39
+ default: _withCtx(() => [_createElementVNode("div", _mergeProps({
45
40
  class: "var--box var-dialog"
46
- }, _ctx.$attrs), [_createVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "title", {}, () => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.title, _ctx.pack.dialogTitle)), 1
41
+ }, _ctx.$attrs), [_createElementVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "title", {}, () => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.title, _ctx.pack.dialogTitle)), 1
47
42
  /* TEXT */
48
- )])]), _createVNode("div", {
43
+ )])]), _createElementVNode("div", {
49
44
  class: "var-dialog__message",
50
- style: {
45
+ style: _normalizeStyle({
51
46
  textAlign: _ctx.messageAlign
52
- }
47
+ })
53
48
  }, [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.message), 1
54
49
  /* TEXT */
55
50
  )])], 4
56
51
  /* STYLE */
57
- ), _createVNode("div", _hoisted_2, [_ctx.cancelButton ? (_openBlock(), _createBlock(_component_var_button, {
52
+ ), _createElementVNode("div", _hoisted_2, [_ctx.cancelButton ? (_openBlock(), _createBlock(_component_var_button, {
58
53
  key: 0,
59
54
  class: "var-dialog__button var-dialog__cancel-button",
60
55
  "var-dialog-cover": "",
@@ -63,7 +58,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
63
58
  color: _ctx.cancelButtonColor,
64
59
  onClick: _ctx.cancel
65
60
  }, {
66
- default: _withId(() => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.cancelButtonText, _ctx.pack.dialogCancelButtonText)), 1
61
+ default: _withCtx(() => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.cancelButtonText, _ctx.pack.dialogCancelButtonText)), 1
67
62
  /* TEXT */
68
63
  )]),
69
64
  _: 1
@@ -80,7 +75,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
80
75
  color: _ctx.confirmButtonColor,
81
76
  onClick: _ctx.confirm
82
77
  }, {
83
- default: _withId(() => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.confirmButtonText, _ctx.pack.dialogConfirmButtonText)), 1
78
+ default: _withCtx(() => [_createTextVNode(_toDisplayString(_ctx.dt(_ctx.confirmButtonText, _ctx.pack.dialogConfirmButtonText)), 1
84
79
  /* TEXT */
85
80
  )]),
86
81
  _: 1
@@ -97,7 +92,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
97
92
  }, 8
98
93
  /* PROPS */
99
94
  , ["show", "overlay", "overlay-class", "overlay-style", "lock-scroll", "close-on-click-overlay", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange", "onClickOverlay"]);
100
- });
95
+ }
101
96
  export default defineComponent({
102
97
  render,
103
98
  name: 'VarDialog',
@@ -4,29 +4,24 @@ import { defineComponent, computed, reactive, onMounted, onUpdated, toRefs } fro
4
4
  import { toSizeUnit } from '../utils/elements';
5
5
  import { isBool, toNumber } from '../utils/shared';
6
6
  import { props } from './props';
7
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
7
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, 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
  key: 0,
15
13
  class: "var-divider__text"
16
14
  };
17
-
18
- _popScopeId();
19
-
20
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
21
- return _openBlock(), _createBlock("div", {
22
- class: ["var-divider var--box", [_ctx.vertical ? 'var-divider--vertical' : null, _ctx.withText ? 'var-divider--with-text' : null, _ctx.isInset ? 'var-divider--inset' : null, _ctx.dashed ? 'var-divider--dashed' : null]],
23
- style: _ctx.style
24
- }, [_renderSlot(_ctx.$slots, "default", {}, () => [_ctx.description ? (_openBlock(), _createBlock("span", _hoisted_1, _toDisplayString(_ctx.description), 1
15
+ export function render(_ctx, _cache) {
16
+ return _openBlock(), _createElementBlock("div", {
17
+ class: _normalizeClass(["var-divider var--box", [_ctx.vertical ? 'var-divider--vertical' : null, _ctx.withText ? 'var-divider--with-text' : null, _ctx.isInset ? 'var-divider--inset' : null, _ctx.dashed ? 'var-divider--dashed' : null]]),
18
+ style: _normalizeStyle(_ctx.style)
19
+ }, [_renderSlot(_ctx.$slots, "default", {}, () => [_ctx.description ? (_openBlock(), _createElementBlock("span", _hoisted_1, _toDisplayString(_ctx.description), 1
25
20
  /* TEXT */
26
21
  )) : _createCommentVNode("v-if", true)])], 6
27
22
  /* CLASS, STYLE */
28
23
  );
29
- });
24
+ }
30
25
  export default defineComponent({
31
26
  render,
32
27
  name: 'VarDivider',
package/es/form/Form.js CHANGED
@@ -5,21 +5,16 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
5
5
  import { defineComponent, computed } from 'vue';
6
6
  import { props } from './props';
7
7
  import { useFormItems } from './provide';
8
- import { renderSlot as _renderSlot, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
8
+ import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, 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-form"
16
14
  };
17
-
18
- _popScopeId();
19
-
20
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
21
- return _openBlock(), _createBlock("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default")]);
22
- });
15
+ export function render(_ctx, _cache) {
16
+ return _openBlock(), _createElementBlock("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default")]);
17
+ }
23
18
  export default defineComponent({
24
19
  render,
25
20
  name: 'VarForm',
@@ -1,10 +1,8 @@
1
1
  import { defineComponent } from 'vue';
2
2
  import { props } from './props';
3
- import { toDisplayString as _toDisplayString, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
3
+ import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, withCtx as _withCtx, createBlock as _createBlock, 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
  key: 0,
@@ -16,23 +14,20 @@ var _hoisted_2 = {
16
14
  var _hoisted_3 = {
17
15
  class: "var-form-details__length"
18
16
  };
19
-
20
- _popScopeId();
21
-
22
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
17
+ export function render(_ctx, _cache) {
23
18
  return _openBlock(), _createBlock(_Transition, {
24
19
  name: "var-form-details"
25
20
  }, {
26
- default: _withId(() => [_ctx.errorMessage || _ctx.maxlengthText ? (_openBlock(), _createBlock("div", _hoisted_1, [_createVNode("div", _hoisted_2, _toDisplayString(_ctx.errorMessage), 1
21
+ default: _withCtx(() => [_ctx.errorMessage || _ctx.maxlengthText ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _hoisted_2, _toDisplayString(_ctx.errorMessage), 1
27
22
  /* TEXT */
28
- ), _createVNode("div", _hoisted_3, _toDisplayString(_ctx.maxlengthText), 1
23
+ ), _createElementVNode("div", _hoisted_3, _toDisplayString(_ctx.maxlengthText), 1
29
24
  /* TEXT */
30
25
  )])) : _createCommentVNode("v-if", true)]),
31
26
  _: 1
32
27
  /* STABLE */
33
28
 
34
29
  });
35
- });
30
+ }
36
31
  export default defineComponent({
37
32
  render,
38
33
  name: 'VarFormDetails',
package/es/icon/Icon.js CHANGED
@@ -6,26 +6,23 @@ import { defineComponent, watch, ref, nextTick } from 'vue';
6
6
  import { isURL, toNumber } from '../utils/shared';
7
7
  import { props } from './props';
8
8
  import { toSizeUnit } from '../utils/elements';
9
- import { resolveDynamicComponent as _resolveDynamicComponent, 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) => {
9
+ import { resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createBlock as _createBlock } from "vue";
10
+ export function render(_ctx, _cache) {
14
11
  return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.isURL(_ctx.name) ? 'img' : 'i'), {
15
- class: ["var-icon", [_ctx.namespace + "--set", _ctx.isURL(_ctx.name) ? 'var-icon__image' : _ctx.namespace + "-" + _ctx.nextName, _ctx.shrinking ? 'var-icon--shrinking' : null]],
16
- style: {
12
+ class: _normalizeClass(["var-icon", [_ctx.namespace + "--set", _ctx.isURL(_ctx.name) ? 'var-icon__image' : _ctx.namespace + "-" + _ctx.nextName, _ctx.shrinking ? 'var-icon--shrinking' : null]]),
13
+ style: _normalizeStyle({
17
14
  color: _ctx.color,
18
15
  transition: "all " + _ctx.toNumber(_ctx.transition) + "ms",
19
16
  width: _ctx.isURL(_ctx.name) ? _ctx.toSizeUnit(_ctx.size) : null,
20
17
  height: _ctx.isURL(_ctx.name) ? _ctx.toSizeUnit(_ctx.size) : null,
21
18
  fontSize: _ctx.toSizeUnit(_ctx.size)
22
- },
19
+ }),
23
20
  src: _ctx.isURL(_ctx.name) ? _ctx.nextName : null,
24
21
  onClick: _ctx.onClick
25
22
  }, null, 8
26
23
  /* PROPS */
27
24
  , ["class", "style", "src", "onClick"]);
28
- });
25
+ }
29
26
  export default defineComponent({
30
27
  render,
31
28
  name: 'VarIcon',
package/es/icon/icon.less CHANGED
@@ -1,4 +1,4 @@
1
- @import '~@varlet/icons/dist/css/varlet-icons.less';
1
+ @import '@varlet/icons/dist/css/varlet-icons.less';
2
2
 
3
3
  @icon-size: 20px;
4
4
 
package/es/image/Image.js CHANGED
@@ -3,55 +3,57 @@ import Lazy from '../lazy';
3
3
  import { defineComponent } from 'vue';
4
4
  import { props } from './props';
5
5
  import { toSizeUnit } from '../utils/elements';
6
- import { resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from "vue";
6
+ import { normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
7
7
 
8
- var _withId = /*#__PURE__*/_withScopeId("");
8
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
9
9
 
10
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
10
+ var _hoisted_1 = ["alt", "lazy-error", "lazy-loading"];
11
+ var _hoisted_2 = ["alt", "src"];
12
+ export function render(_ctx, _cache) {
11
13
  var _directive_lazy = _resolveDirective("lazy");
12
14
 
13
15
  var _directive_ripple = _resolveDirective("ripple");
14
16
 
15
- return _withDirectives((_openBlock(), _createBlock("div", {
16
- class: ["var-image var--box", [!_ctx.block ? 'var--inline-block' : null]],
17
- style: {
17
+ return _withDirectives((_openBlock(), _createElementBlock("div", {
18
+ class: _normalizeClass(["var-image var--box", [!_ctx.block ? 'var--inline-block' : null]]),
19
+ style: _normalizeStyle({
18
20
  width: _ctx.toSizeUnit(_ctx.width),
19
21
  height: _ctx.toSizeUnit(_ctx.height),
20
22
  'border-radius': _ctx.toSizeUnit(_ctx.radius)
21
- }
22
- }, [_ctx.lazy ? _withDirectives((_openBlock(), _createBlock("img", {
23
+ })
24
+ }, [_ctx.lazy ? _withDirectives((_openBlock(), _createElementBlock("img", {
23
25
  key: 0,
24
26
  class: "var-image__image",
25
27
  alt: _ctx.alt,
26
28
  "lazy-error": _ctx.error,
27
29
  "lazy-loading": _ctx.loading,
28
- style: {
30
+ style: _normalizeStyle({
29
31
  objectFit: _ctx.fit
30
- },
31
- onLoad: _cache[1] || (_cache[1] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
32
- onError: _cache[2] || (_cache[2] = (...args) => _ctx.handleError && _ctx.handleError(...args)),
33
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onClick && _ctx.onClick(...args))
32
+ }),
33
+ onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
34
+ onError: _cache[1] || (_cache[1] = (...args) => _ctx.handleError && _ctx.handleError(...args)),
35
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onClick && _ctx.onClick(...args))
34
36
  }, null, 44
35
37
  /* STYLE, PROPS, HYDRATE_EVENTS */
36
- , ["alt", "lazy-error", "lazy-loading"])), [[_directive_lazy, _ctx.src]]) : (_openBlock(), _createBlock("img", {
38
+ , _hoisted_1)), [[_directive_lazy, _ctx.src]]) : (_openBlock(), _createElementBlock("img", {
37
39
  key: 1,
38
40
  class: "var-image__image",
39
41
  alt: _ctx.alt,
40
- style: {
42
+ style: _normalizeStyle({
41
43
  objectFit: _ctx.fit
42
- },
44
+ }),
43
45
  src: _ctx.src,
44
- onLoad: _cache[4] || (_cache[4] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
45
- onError: _cache[5] || (_cache[5] = (...args) => _ctx.handleError && _ctx.handleError(...args)),
46
- onClick: _cache[6] || (_cache[6] = (...args) => _ctx.onClick && _ctx.onClick(...args))
46
+ onLoad: _cache[3] || (_cache[3] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
47
+ onError: _cache[4] || (_cache[4] = (...args) => _ctx.handleError && _ctx.handleError(...args)),
48
+ onClick: _cache[5] || (_cache[5] = (...args) => _ctx.onClick && _ctx.onClick(...args))
47
49
  }, null, 44
48
50
  /* STYLE, PROPS, HYDRATE_EVENTS */
49
- , ["alt", "src"]))], 6
51
+ , _hoisted_2))], 6
50
52
  /* CLASS, STYLE */
51
53
  )), [[_directive_ripple, {
52
54
  disabled: !_ctx.ripple
53
55
  }]]);
54
- });
56
+ }
55
57
  export default defineComponent({
56
58
  render,
57
59
  name: 'VarImage',
@@ -8,20 +8,16 @@ import { toNumber } from '../utils/shared';
8
8
  var DISTANCE_OFFSET = 12;
9
9
  var EVENT_DELAY = 200;
10
10
  var ANIMATION_DURATION = 200;
11
- import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createBlock as _createBlock, createVNode as _createVNode, resolveComponent as _resolveComponent, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
11
+ import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
12
12
 
13
- var _withId = /*#__PURE__*/_withScopeId("");
13
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
14
14
 
15
- _pushScopeId("");
16
-
17
- var _hoisted_1 = {
15
+ var _hoisted_1 = ["src", "alt"];
16
+ var _hoisted_2 = {
18
17
  key: 0,
19
18
  class: "var-image-preview__indicators"
20
19
  };
21
-
22
- _popScopeId();
23
-
24
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
20
+ export function render(_ctx, _cache) {
25
21
  var _component_var_swipe_item = _resolveComponent("var-swipe-item");
26
22
 
27
23
  var _component_var_swipe = _resolveComponent("var-swipe");
@@ -45,7 +41,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
45
41
  onOpened: _ctx.onOpened,
46
42
  onRouteChange: _ctx.onRouteChange
47
43
  }, {
48
- default: _withId(() => [_createVNode(_component_var_swipe, _mergeProps({
44
+ default: _withCtx(() => [_createVNode(_component_var_swipe, _mergeProps({
49
45
  class: "var-image-preview__swipe",
50
46
  "var-image-preview-cover": "",
51
47
  touchable: _ctx.canSwipe,
@@ -54,29 +50,29 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
54
50
  loop: _ctx.loop,
55
51
  onChange: _ctx.onChange
56
52
  }, _ctx.$attrs), {
57
- default: _withId(() => [(_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.images, image => {
53
+ default: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.images, image => {
58
54
  return _openBlock(), _createBlock(_component_var_swipe_item, {
59
55
  class: "var-image-preview__swipe-item",
60
56
  "var-image-preview-cover": "",
61
57
  key: image
62
58
  }, {
63
- default: _withId(() => [_createVNode("div", {
59
+ default: _withCtx(() => [_createElementVNode("div", {
64
60
  class: "var-image-preview__zoom-container",
65
- style: {
61
+ style: _normalizeStyle({
66
62
  transform: "scale(" + _ctx.scale + ") translate(" + _ctx.translateX + "px, " + _ctx.translateY + "px)",
67
63
  transitionTimingFunction: _ctx.transitionTimingFunction,
68
64
  transitionDuration: _ctx.transitionDuration
69
- },
70
- onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.handleTouchstart && _ctx.handleTouchstart(...args)),
71
- onTouchmove: _cache[2] || (_cache[2] = (...args) => _ctx.handleTouchmove && _ctx.handleTouchmove(...args)),
72
- onTouchend: _cache[3] || (_cache[3] = (...args) => _ctx.handleTouchend && _ctx.handleTouchend(...args))
73
- }, [_createVNode("img", {
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))
69
+ }, [_createElementVNode("img", {
74
70
  class: "var-image-preview__image",
75
71
  src: image,
76
72
  alt: image
77
73
  }, null, 8
78
74
  /* PROPS */
79
- , ["src", "alt"])], 36
75
+ , _hoisted_1)], 36
80
76
  /* STYLE, HYDRATE_EVENTS */
81
77
  )]),
82
78
  _: 2
@@ -88,17 +84,17 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
88
84
  }), 128
89
85
  /* KEYED_FRAGMENT */
90
86
  ))]),
91
- indicator: _withId(({
87
+ indicator: _withCtx(({
92
88
  index,
93
89
  length
94
90
  }) => [_renderSlot(_ctx.$slots, "indicator", {
95
91
  index: index,
96
92
  length: length
97
- }, () => [_ctx.indicator && _ctx.images.length > 1 ? (_openBlock(), _createBlock("div", _hoisted_1, _toDisplayString(index + 1) + " / " + _toDisplayString(length), 1
93
+ }, () => [_ctx.indicator && _ctx.images.length > 1 ? (_openBlock(), _createElementBlock("div", _hoisted_2, _toDisplayString(index + 1) + " / " + _toDisplayString(length), 1
98
94
  /* TEXT */
99
95
  )) : _createCommentVNode("v-if", true)])]),
100
- _: 1
101
- /* STABLE */
96
+ _: 3
97
+ /* FORWARDED */
102
98
 
103
99
  }, 16
104
100
  /* FULL_PROPS */
@@ -117,7 +113,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
117
113
  }, 8
118
114
  /* PROPS */
119
115
  , ["show", "lock-scroll", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
120
- });
116
+ }
121
117
  export default defineComponent({
122
118
  render,
123
119
  name: 'VarImagePreview',
@@ -2,17 +2,16 @@ import { computed, defineComponent, ref, Transition } from 'vue';
2
2
  import Sticky from '../sticky';
3
3
  import { useIndexBar } from './provide';
4
4
  import { props } from './props';
5
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, createVNode as _createVNode, resolveDynamicComponent as _resolveDynamicComponent, 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, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, createElementVNode as _createElementVNode, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
6
+ export function render(_ctx, _cache) {
10
7
  return _openBlock(), _createBlock(_resolveDynamicComponent(_ctx.sticky ? 'var-sticky' : _ctx.Transition), {
11
8
  "offset-top": _ctx.sticky ? _ctx.stickyOffsetTop : null,
12
9
  "z-index": _ctx.sticky ? _ctx.zIndex : null,
10
+ disabled: _ctx.disabled && !_ctx.cssMode,
11
+ "css-mode": _ctx.cssMode,
13
12
  ref: "anchorEl"
14
13
  }, {
15
- default: _withId(() => [_createVNode("div", _mergeProps({
14
+ default: _withCtx(() => [_createElementVNode("div", _mergeProps({
16
15
  class: "var-index-anchor"
17
16
  }, _ctx.$attrs), [_renderSlot(_ctx.$slots, "default", {}, () => [_createTextVNode(_toDisplayString(_ctx.name), 1
18
17
  /* TEXT */
@@ -24,8 +23,8 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
24
23
 
25
24
  }, 8
26
25
  /* PROPS */
27
- , ["offset-top", "z-index"]);
28
- });
26
+ , ["offset-top", "z-index", "disabled", "css-mode"]);
27
+ }
29
28
  export default defineComponent({
30
29
  render,
31
30
  name: 'VarIndexAnchor',
@@ -42,6 +41,7 @@ export default defineComponent({
42
41
  bindIndexBar
43
42
  } = useIndexBar();
44
43
  var ownTop = ref(0);
44
+ var disabled = ref(false);
45
45
  var name = computed(() => props.index);
46
46
  var anchorEl = ref(null);
47
47
 
@@ -53,6 +53,7 @@ export default defineComponent({
53
53
  var {
54
54
  active,
55
55
  sticky,
56
+ cssMode,
56
57
  stickyOffsetTop,
57
58
  zIndex
58
59
  } = indexBar;
@@ -62,11 +63,16 @@ export default defineComponent({
62
63
  ownTop.value = anchorEl.value.$el ? anchorEl.value.$el.offsetTop : anchorEl.value.offsetTop;
63
64
  };
64
65
 
66
+ var setDisabled = value => {
67
+ disabled.value = value;
68
+ };
69
+
65
70
  var indexAnchorProvider = {
66
71
  index,
67
72
  name,
68
73
  ownTop,
69
- setOwnTop
74
+ setOwnTop,
75
+ setDisabled
70
76
  };
71
77
  bindIndexBar(indexAnchorProvider);
72
78
  return {
@@ -75,6 +81,8 @@ export default defineComponent({
75
81
  active,
76
82
  sticky,
77
83
  zIndex,
84
+ disabled,
85
+ cssMode,
78
86
  stickyOffsetTop,
79
87
  Transition
80
88
  };
@@ -7,39 +7,35 @@ import { easeInOutCubic, isPlainObject, toNumber } from '../utils/shared';
7
7
  import { getParentScroller, getScrollLeft, nextTickFrame, requestAnimationFrame, scrollTo as varScrollTo } from '../utils/elements';
8
8
  import { useIndexAnchors } from './provide';
9
9
  import { props } from './props';
10
- import { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createBlock as _createBlock, toDisplayString as _toDisplayString, createVNode as _createVNode, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
10
+ import { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, 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-index-bar",
18
16
  ref: "barEl"
19
17
  };
20
-
21
- _popScopeId();
22
-
23
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
24
- return _openBlock(), _createBlock("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default"), _createVNode("ul", {
18
+ var _hoisted_2 = ["onClick"];
19
+ export function render(_ctx, _cache) {
20
+ return _openBlock(), _createElementBlock("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default"), _createElementVNode("ul", {
25
21
  class: "var-index-bar__anchor-list",
26
- style: {
22
+ style: _normalizeStyle({
27
23
  zIndex: _ctx.zIndex + 2,
28
24
  display: _ctx.hideList ? 'none' : 'block'
29
- }
30
- }, [(_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.anchorNameList, anchorName => {
31
- return _openBlock(), _createBlock("li", {
25
+ })
26
+ }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.anchorNameList, anchorName => {
27
+ return _openBlock(), _createElementBlock("li", {
32
28
  key: anchorName,
33
- class: ["var-index-bar__anchor-item", {
29
+ class: _normalizeClass(["var-index-bar__anchor-item", {
34
30
  'var-index-bar__anchor-item--active': _ctx.active === anchorName
35
- }],
36
- style: {
31
+ }]),
32
+ style: _normalizeStyle({
37
33
  color: _ctx.active === anchorName && _ctx.highlightColor ? _ctx.highlightColor : ''
38
- },
34
+ }),
39
35
  onClick: $event => _ctx.anchorClick(anchorName)
40
36
  }, _toDisplayString(anchorName), 15
41
37
  /* TEXT, CLASS, STYLE, PROPS */
42
- , ["onClick"]);
38
+ , _hoisted_2);
43
39
  }), 128
44
40
  /* KEYED_FRAGMENT */
45
41
  ))], 4
@@ -47,7 +43,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
47
43
  )], 512
48
44
  /* NEED_PATCH */
49
45
  );
50
- });
46
+ }
51
47
  export default defineComponent({
52
48
  render,
53
49
  name: 'VarIndexBar',
@@ -66,11 +62,13 @@ export default defineComponent({
66
62
  var anchorNameList = ref([]);
67
63
  var active = ref();
68
64
  var sticky = computed(() => props.sticky);
65
+ var cssMode = computed(() => props.cssMode);
69
66
  var stickyOffsetTop = computed(() => props.stickyOffsetTop);
70
67
  var zIndex = computed(() => props.zIndex);
71
68
  var indexBarProvider = {
72
69
  active,
73
70
  sticky,
71
+ cssMode,
74
72
  stickyOffsetTop,
75
73
  zIndex
76
74
  };
@@ -88,12 +86,20 @@ export default defineComponent({
88
86
  scrollTop,
89
87
  scrollHeight
90
88
  } = scrollEl.value;
89
+ var {
90
+ offsetTop
91
+ } = barEl.value;
91
92
  indexAnchors.forEach((anchor, index) => {
92
93
  var anchorTop = anchor.ownTop.value;
93
- var top = scrollTop - anchorTop + stickyOffsetTop.value;
94
+ var top = scrollTop - anchorTop + stickyOffsetTop.value - offsetTop;
94
95
  var distance = index === indexAnchors.length - 1 ? scrollHeight : indexAnchors[index + 1].ownTop.value - anchor.ownTop.value;
95
96
 
96
97
  if (top >= 0 && top < distance && !clickedName.value) {
98
+ if (index && !props.cssMode) {
99
+ indexAnchors[index - 1].setDisabled(true);
100
+ }
101
+
102
+ anchor.setDisabled(false);
97
103
  emitEvent(anchor);
98
104
  }
99
105
  });
@@ -7,6 +7,10 @@ export var props = {
7
7
  type: Number,
8
8
  default: 0
9
9
  },
10
+ cssMode: {
11
+ type: Boolean,
12
+ default: false
13
+ },
10
14
  hideList: {
11
15
  type: Boolean,
12
16
  default: false