@varlet/ui 2.9.3-alpha.1679397366672 → 2.9.3-alpha.1679537809832

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.
@@ -4,7 +4,7 @@ import VarHoverOverlay, { useHoverOverlay } from '../hover-overlay/index.mjs';
4
4
  import Hover from '../hover/index.mjs';
5
5
  import { computed, defineComponent, ref } from 'vue';
6
6
  import { props } from './props.mjs';
7
- import { call, createNamespace } from '../utils/components.mjs';
7
+ import { call, createNamespace, formatElevation } from '../utils/components.mjs';
8
8
  import { useButtonGroup } from './provide.mjs';
9
9
  import { isArray } from '@varlet/shared';
10
10
  var {
@@ -27,7 +27,7 @@ function __render__(_ctx, _cache) {
27
27
  var _directive_hover = _resolveDirective("hover");
28
28
 
29
29
  return _withDirectives((_openBlock(), _createElementBlock("button", {
30
- class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), _ctx.n("--" + _ctx.states.size), [_ctx.block, _ctx.n('$--flex') + " " + _ctx.n('--block'), _ctx.n('$--inline-flex')], [_ctx.disabled, _ctx.n('--disabled')], [_ctx.states.text, _ctx.n("--text-" + _ctx.states.type) + " " + _ctx.n('--text'), _ctx.n("--" + _ctx.states.type) + " " + _ctx.n("$-elevation--" + _ctx.states.elevation)], [_ctx.states.text && _ctx.disabled, _ctx.n('--text-disabled')], [_ctx.round, _ctx.n('--round')], [_ctx.states.outline, _ctx.n('--outline')])),
30
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), _ctx.n("--" + _ctx.states.size), [_ctx.block, _ctx.n('$--flex') + " " + _ctx.n('--block'), _ctx.n('$--inline-flex')], [_ctx.disabled, _ctx.n('--disabled')], [_ctx.states.text, _ctx.n("--text-" + _ctx.states.type) + " " + _ctx.n('--text'), _ctx.n("--" + _ctx.states.type) + " " + _ctx.states.elevation], [_ctx.states.text && _ctx.disabled, _ctx.n('--text-disabled')], [_ctx.round, _ctx.n('--round')], [_ctx.states.outline, _ctx.n('--outline')])),
31
31
  style: _normalizeStyle({
32
32
  color: _ctx.states.textColor,
33
33
  background: _ctx.states.color
@@ -89,7 +89,7 @@ var __sfc__ = defineComponent({
89
89
  var states = computed(() => {
90
90
  if (!buttonGroup) {
91
91
  return {
92
- elevation: 2,
92
+ elevation: formatElevation(props.elevation, 2),
93
93
  type: props.type != null ? props.type : 'default',
94
94
  size: props.size != null ? props.size : 'normal',
95
95
  color: props.color,
@@ -107,7 +107,7 @@ var __sfc__ = defineComponent({
107
107
  mode
108
108
  } = buttonGroup;
109
109
  return {
110
- elevation: 0,
110
+ elevation: '',
111
111
  type: props.type != null ? props.type : type.value,
112
112
  size: props.size != null ? props.size : size.value,
113
113
  color: props.color != null ? props.color : color.value,
@@ -59,6 +59,10 @@ export var props = {
59
59
  textColor: {
60
60
  type: String
61
61
  },
62
+ elevation: {
63
+ type: [Boolean, Number, String],
64
+ default: true
65
+ },
62
66
  autoLoading: {
63
67
  type: Boolean,
64
68
  default: false
@@ -1,6 +1,6 @@
1
1
  import { computed, defineComponent } from 'vue';
2
2
  import { useButtons } from './provide.mjs';
3
- import { createNamespace } from '../utils/components.mjs';
3
+ import { createNamespace, formatElevation } from '../utils/components.mjs';
4
4
  import { props } from './props.mjs';
5
5
  var {
6
6
  n,
@@ -10,7 +10,7 @@ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock
10
10
 
11
11
  function __render__(_ctx, _cache) {
12
12
  return _openBlock(), _createElementBlock("div", {
13
- class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), [_ctx.mode, "" + _ctx.n("--mode-" + _ctx.mode)], [_ctx.vertical, _ctx.n('--vertical'), _ctx.n('--horizontal')], [_ctx.mode === 'normal', _ctx.n("$-elevation--" + _ctx.elevation)]))
13
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), [_ctx.mode, "" + _ctx.n("--mode-" + _ctx.mode)], [_ctx.vertical, _ctx.n('--vertical'), _ctx.n('--horizontal')], [_ctx.mode === 'normal', _ctx.formatElevation(_ctx.elevation, 2)]))
14
14
  }, [_renderSlot(_ctx.$slots, "default")], 2
15
15
  /* CLASS */
16
16
  );
@@ -35,7 +35,8 @@ var __sfc__ = defineComponent({
35
35
  bindButtons(buttonGroupProvider);
36
36
  return {
37
37
  n,
38
- classes
38
+ classes,
39
+ formatElevation
39
40
  };
40
41
  }
41
42
 
@@ -33,8 +33,8 @@ export var props = {
33
33
  validator: modeValidator
34
34
  },
35
35
  elevation: {
36
- type: [Number, String],
37
- default: 2
36
+ type: [Boolean, Number, String],
37
+ default: true
38
38
  },
39
39
  vertical: {
40
40
  type: Boolean,
package/es/card/Card.mjs CHANGED
@@ -8,7 +8,7 @@ import VarButton from '../button/index.mjs';
8
8
  import { ref, defineComponent, watch, computed, nextTick } from 'vue';
9
9
  import { props } from './props.mjs';
10
10
  import { doubleRaf, toSizeUnit } from '../utils/elements.mjs';
11
- import { call, createNamespace } from '../utils/components.mjs';
11
+ import { call, createNamespace, formatElevation } from '../utils/components.mjs';
12
12
  import { useZIndex } from '../context/zIndex.mjs';
13
13
  import { useLock } from '../context/lock.mjs';
14
14
  var {
@@ -31,7 +31,7 @@ function __render__(_ctx, _cache) {
31
31
 
32
32
  return _withDirectives((_openBlock(), _createElementBlock("div", {
33
33
  ref: "card",
34
- class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n('--layout-row')], [_ctx.outline, _ctx.n('--outline')], [_ctx.elevation, _ctx.n("$-elevation--" + _ctx.elevation), _ctx.n('$-elevation--1')])),
34
+ class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n('--layout-row')], [_ctx.outline, _ctx.n('--outline')], _ctx.formatElevation(_ctx.elevation, 1))),
35
35
  style: _normalizeStyle({
36
36
  zIndex: _ctx.floated ? _ctx.zIndex : undefined
37
37
  }),
@@ -280,6 +280,7 @@ var __sfc__ = defineComponent({
280
280
  close,
281
281
  showFloatingButtons,
282
282
  floated,
283
+ formatElevation,
283
284
  handleClick
284
285
  };
285
286
  }
package/es/card/props.mjs CHANGED
@@ -48,7 +48,8 @@ export var props = {
48
48
  type: String
49
49
  },
50
50
  elevation: {
51
- type: [Number, String]
51
+ type: [Boolean, Number, String],
52
+ default: true
52
53
  },
53
54
  ripple: {
54
55
  type: Boolean,
@@ -28,6 +28,7 @@ var __sfc__ = defineComponent({
28
28
  } = useCollapseItem();
29
29
  var active = computed(() => props.modelValue);
30
30
  var offset = computed(() => props.offset);
31
+ var elevation = computed(() => props.elevation);
31
32
 
32
33
  var checkValue = () => {
33
34
  if (!props.accordion && !isArray(props.modelValue)) {
@@ -115,6 +116,7 @@ var __sfc__ = defineComponent({
115
116
  var collapseProvider = {
116
117
  active,
117
118
  offset,
119
+ elevation,
118
120
  updateItem
119
121
  };
120
122
  bindCollapseItem(collapseProvider);
@@ -11,6 +11,10 @@ export var props = {
11
11
  type: Boolean,
12
12
  default: true
13
13
  },
14
+ elevation: {
15
+ type: [Boolean, String, Number],
16
+ default: true
17
+ },
14
18
  onChange: defineListenerProp(),
15
19
  'onUpdate:modelValue': defineListenerProp()
16
20
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent, ref, nextTick, watch, computed } from 'vue';
1
+ import { defineComponent, ref, watch, computed } from 'vue';
2
2
  import { nextTickFrame, requestAnimationFrame } from '../utils/elements.mjs';
3
3
  import { isArray } from '@varlet/shared';
4
- import { createNamespace } from '../utils/components.mjs';
4
+ import { createNamespace, formatElevation } from '../utils/components.mjs';
5
5
  import { useCollapse } from './provide.mjs';
6
6
  import { props } from './props.mjs';
7
7
  import VarIcon from '../icon/index.mjs';
@@ -9,7 +9,7 @@ var {
9
9
  n,
10
10
  classes
11
11
  } = createNamespace('collapse-item');
12
- import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, vShow as _vShow, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
12
+ import { normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, vShow as _vShow, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
13
13
 
14
14
  function __render__(_ctx, _cache) {
15
15
  var _component_var_icon = _resolveComponent("var-icon");
@@ -17,6 +17,10 @@ function __render__(_ctx, _cache) {
17
17
  return _openBlock(), _createElementBlock("div", {
18
18
  class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.offset && _ctx.isShow, _ctx.n('--active')], [_ctx.disabled, _ctx.n('--disable')]))
19
19
  }, [_createElementVNode("div", {
20
+ class: _normalizeClass(_ctx.classes(_ctx.n('shadow'), _ctx.formatElevation(_ctx.elevation, 2)))
21
+ }, null, 2
22
+ /* CLASS */
23
+ ), _createElementVNode("div", {
20
24
  class: _normalizeClass(_ctx.n('header')),
21
25
  onClick: _cache[0] || (_cache[0] = $event => _ctx.toggle())
22
26
  }, [_createElementVNode("div", {
@@ -52,7 +56,7 @@ function __render__(_ctx, _cache) {
52
56
  /* CLASS */
53
57
  )], 34
54
58
  /* CLASS, HYDRATE_EVENTS */
55
- ), [[_vShow, _ctx.show]])], 2
59
+ ), [[_vShow, _ctx.showContent]])], 2
56
60
  /* CLASS */
57
61
  );
58
62
  }
@@ -73,11 +77,12 @@ var __sfc__ = defineComponent({
73
77
  var isInitToTrigger = true; // ensure to trigger transitionend
74
78
 
75
79
  var contentEl = ref(null);
76
- var show = ref(false);
80
+ var showContent = ref(false);
77
81
  var isShow = ref(false);
78
82
  var {
79
83
  active,
80
84
  offset,
85
+ elevation,
81
86
  updateItem
82
87
  } = collapse;
83
88
  var name = computed(() => props.name);
@@ -99,8 +104,8 @@ var __sfc__ = defineComponent({
99
104
  var openPanel = () => {
100
105
  if (!contentEl.value) return;
101
106
  contentEl.value.style.height = '';
102
- show.value = true;
103
- nextTick(() => {
107
+ showContent.value = true;
108
+ requestAnimationFrame(() => {
104
109
  var {
105
110
  offsetHeight
106
111
  } = contentEl.value;
@@ -134,7 +139,7 @@ var __sfc__ = defineComponent({
134
139
 
135
140
  var transitionend = () => {
136
141
  if (!isShow.value) {
137
- show.value = false;
142
+ showContent.value = false;
138
143
  }
139
144
 
140
145
  ;
@@ -154,12 +159,14 @@ var __sfc__ = defineComponent({
154
159
  n,
155
160
  start,
156
161
  classes,
157
- show,
162
+ showContent,
158
163
  isShow,
159
164
  offset,
165
+ elevation,
160
166
  toggle,
161
167
  contentEl,
162
- transitionend
168
+ transitionend,
169
+ formatElevation
163
170
  };
164
171
  }
165
172
 
@@ -1 +1 @@
1
- :root { --collapse-background: #fff; --collapse-text-color: #232222; --collapse-header-font-size: var(--font-size-lg); --collapse-header-padding: 10px 12px; --collapse-content-font-size: var(--font-size-md); --collapse-content-padding: 0 12px 10px; --collapse-item-margin-top: 16px; --collapse-disable-color: #bdbdbd; --collapse-border-top: thin solid rgba(0, 0, 0, 0.12);}.var-collapse-item { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; position: relative; margin-top: 0; background: var(--collapse-background); color: var(--collapse-text-color); transition: margin-top 0.25s, background-color 0.25s;}.var-collapse-item::before { bottom: 0; content: ''; left: 0; position: absolute; right: 0; top: 0; z-index: -1; box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);}.var-collapse-item:not(:first-child)::after { border-top: var(--collapse-border-top); content: ''; left: 0; position: absolute; right: 0; top: 0;}.var-collapse-item__header { align-items: center; display: flex; font-size: var(--collapse-header-font-size); outline: none; padding: var(--collapse-header-padding); justify-content: space-between; position: relative;}.var-collapse-item__header-title { transition: color 0.25s;}.var-collapse-item__header-icon { transform: rotate(0deg); opacity: 1;}.var-collapse-item__header-open { transform: rotate(-180deg);}.var-collapse-item__header--disable { opacity: 0;}.var-collapse-item__content { display: flex; font-size: var(--collapse-content-font-size); overflow: hidden; transition: all 0.25s;}.var-collapse-item__content-wrap { padding: var(--collapse-content-padding); word-break: break-all; flex: 1;}.var-collapse-item--active + .var-collapse-item,.var-collapse-item--active:not(:first-child) { margin-top: var(--collapse-item-margin-top);}.var-collapse-item--active + .var-collapse-item::after,.var-collapse-item--active:not(:first-child)::after { border-top: none;}.var-collapse-item--disable { color: var(--collapse-disable-color); cursor: not-allowed;}
1
+ :root { --collapse-background: #fff; --collapse-text-color: #232222; --collapse-header-font-size: var(--font-size-lg); --collapse-header-padding: 10px 12px; --collapse-content-font-size: var(--font-size-md); --collapse-content-padding: 0 12px 10px; --collapse-item-margin-top: 16px; --collapse-disable-color: #bdbdbd; --collapse-border-top: thin solid rgba(0, 0, 0, 0.12);}.var-collapse-item { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; position: relative; margin-top: 0; background: var(--collapse-background); color: var(--collapse-text-color); transition: margin-top 0.25s, background-color 0.25s;}.var-collapse-item__shadow { bottom: 0; content: ''; left: 0; position: absolute; right: 0; top: 0; z-index: -1;}.var-collapse-item:not(:first-child)::after { border-top: var(--collapse-border-top); content: ''; left: 0; position: absolute; right: 0; top: 0;}.var-collapse-item__header { align-items: center; display: flex; font-size: var(--collapse-header-font-size); outline: none; padding: var(--collapse-header-padding); justify-content: space-between; position: relative;}.var-collapse-item__header-title { transition: color 0.25s;}.var-collapse-item__header-icon { transform: rotate(0deg); opacity: 1;}.var-collapse-item__header-open { transform: rotate(-180deg);}.var-collapse-item__header--disable { opacity: 0;}.var-collapse-item__content { display: flex; font-size: var(--collapse-content-font-size); overflow: hidden; transition: all 0.25s;}.var-collapse-item__content-wrap { padding: var(--collapse-content-padding); word-break: break-all; flex: 1;}.var-collapse-item--active + .var-collapse-item,.var-collapse-item--active:not(:first-child) { margin-top: var(--collapse-item-margin-top);}.var-collapse-item--active + .var-collapse-item::after,.var-collapse-item--active:not(:first-child)::after { border-top: none;}.var-collapse-item--disable { color: var(--collapse-disable-color); cursor: not-allowed;}
package/es/fab/Fab.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { mergeProps as _mergeProps, isVNode as _isVNode, withDirectives as _withDirectives, vShow as _vShow, createVNode as _createVNode } from "vue";
2
2
  import Button from '../button/index.mjs';
3
3
  import Icon from '../icon/index.mjs';
4
- import { computed, defineComponent, ref, Teleport, Transition, watch } from 'vue';
5
- import { useClickOutside } from '@varlet/use';
4
+ import { defineComponent, ref, Teleport, Transition, watch } from 'vue';
5
+ import { useClickOutside, useVModel } from '@varlet/use';
6
6
  import { call, createNamespace, flatFragment, useTeleport } from '../utils/components.mjs';
7
7
  import { toSizeUnit } from '../utils/elements.mjs';
8
8
  import { toNumber } from '@varlet/shared';
@@ -33,22 +33,13 @@ export default defineComponent({
33
33
  slots,
34
34
  attrs
35
35
  } = _ref;
36
- var localActive = ref(false);
36
+ var isActive = useVModel(props, 'active', {
37
+ emit: (event, value) => call(props['onUpdate:active'], value)
38
+ });
37
39
  var host = ref(null);
38
40
  var {
39
41
  disabled
40
42
  } = useTeleport();
41
- var isActive = computed({
42
- get() {
43
- return localActive.value;
44
- },
45
-
46
- set(value) {
47
- localActive.value = value;
48
- call(props['onUpdate:active'], value);
49
- }
50
-
51
- });
52
43
 
53
44
  var handleClick = (e, value, childrenLength) => {
54
45
  e.stopPropagation();
@@ -100,7 +91,8 @@ export default defineComponent({
100
91
  "type": props.type,
101
92
  "color": props.color,
102
93
  "disabled": props.disabled,
103
- "round": true
94
+ "round": true,
95
+ "elevation": props.elevation
104
96
  }, {
105
97
  default: () => [_createVNode(Icon, {
106
98
  "var-fab-cover": true,
@@ -120,7 +112,7 @@ export default defineComponent({
120
112
 
121
113
  var children = flatFragment((_slots$default = slots.default == null ? void 0 : slots.default()) != null ? _slots$default : []);
122
114
  return _createVNode("div", _mergeProps({
123
- "class": classes(n(), n("--position-" + props.position), n("--direction-" + props.direction), [props.fixed, n('--fixed'), n('--absolute')]),
115
+ "class": classes(n(), n("--position-" + props.position), n("--direction-" + props.direction), [props.fixed, n('--fixed'), n('--absolute')], [props.safeArea, n('--safe-area')]),
124
116
  "style": {
125
117
  zIndex: toNumber(props.zIndex),
126
118
  top: toSizeUnit(props.top),
@@ -152,11 +144,6 @@ export default defineComponent({
152
144
  })]);
153
145
  };
154
146
 
155
- watch(() => props.active, value => {
156
- localActive.value = value;
157
- }, {
158
- immediate: true
159
- });
160
147
  watch(() => props.trigger, () => {
161
148
  isActive.value = false;
162
149
  });
package/es/fab/fab.css CHANGED
@@ -1 +1 @@
1
- :root { --fab-top: 70px; --fab-bottom: 16px; --fab-left: 16px; --fab-right: 16px; --fab-trigger-size: 56px; --fab-trigger-inactive-icon-size: 26px; --fab-trigger-active-icon-size: 22px; --fab-actions-padding: 10px 0; --fab-action-margin: 6px; --fab-transition-standard-easing: cubic-bezier(0.4, 0, 0.2, 1);}.var-fab-transition-default-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab-transition-default-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab__trigger[var-fab-cover] { width: var(--fab-trigger-size); height: var(--fab-trigger-size);}.var-fab__trigger-inactive-icon[var-fab-cover] { font-size: var(--fab-trigger-inactive-icon-size);}.var-fab__trigger-active-icon[var-fab-cover] { font-size: var(--fab-trigger-active-icon-size);}.var-fab__actions { position: absolute; display: flex; justify-content: center; align-items: center; padding: var(--fab-actions-padding);}.var-fab__action { margin: var(--fab-action-margin);}.var-fab--position-left-top { top: var(--fab-top); left: var(--fab-left);}.var-fab--position-right-top { top: var(--fab-top); right: var(--fab-right);}.var-fab--position-left-bottom { bottom: var(--fab-bottom); left: var(--fab-left);}.var-fab--position-right-bottom { bottom: var(--fab-bottom); right: var(--fab-right);}.var-fab--direction-left .var-fab__actions,.var-fab--direction-right .var-fab__actions { height: 100%; top: 0; padding: 0 var(--fab-actions-padding);}.var-fab--direction-left .var-fab__actions { flex-direction: row-reverse; right: 100%;}.var-fab--direction-right .var-fab__actions { flex-direction: row; left: 100%;}.var-fab--direction-top .var-fab__actions,.var-fab--direction-bottom .var-fab__actions { width: 100%; left: 0;}.var-fab--direction-top .var-fab__actions { flex-direction: column-reverse; bottom: 100%;}.var-fab--direction-bottom .var-fab__actions { flex-direction: column; top: 100%;}.var-fab--fixed { position: fixed;}.var-fab--absolute { position: absolute;}.var-fab--active-transition-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--active-transition-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--active-transition-enter-from,.var-fab--active-transition-leave-to { transform: scale(0);}.var-fab--actions-transition-top-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-top-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-top-enter-from,.var-fab--actions-transition-top-leave-to { opacity: 0; transform: translateY(40px);}.var-fab--actions-transition-bottom-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-bottom-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-bottom-enter-from,.var-fab--actions-transition-bottom-leave-to { opacity: 0; transform: translateY(-40px);}.var-fab--actions-transition-left-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-left-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-left-enter-from,.var-fab--actions-transition-left-leave-to { opacity: 0; transform: translateX(40px);}.var-fab--actions-transition-right-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-right-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-right-enter-from,.var-fab--actions-transition-right-leave-to { opacity: 0; transform: translateX(-40px);}.var-fab--trigger-icon-animation { transform: scale(0.4); opacity: 0; transition-property: transform, opacity;}
1
+ :root { --fab-top: 70px; --fab-bottom: 16px; --fab-left: 16px; --fab-right: 16px; --fab-trigger-size: 56px; --fab-trigger-inactive-icon-size: 26px; --fab-trigger-active-icon-size: 22px; --fab-actions-padding: 10px 0; --fab-action-margin: 6px; --fab-transition-standard-easing: cubic-bezier(0.4, 0, 0.2, 1);}.var-fab-transition-default-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab-transition-default-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab__trigger[var-fab-cover] { width: var(--fab-trigger-size); height: var(--fab-trigger-size);}.var-fab__trigger-inactive-icon[var-fab-cover] { font-size: var(--fab-trigger-inactive-icon-size);}.var-fab__trigger-active-icon[var-fab-cover] { font-size: var(--fab-trigger-active-icon-size);}.var-fab__actions { position: absolute; display: flex; justify-content: center; align-items: center; padding: var(--fab-actions-padding);}.var-fab__action { margin: var(--fab-action-margin);}.var-fab--position-left-top { top: var(--fab-top); left: var(--fab-left);}.var-fab--position-right-top { top: var(--fab-top); right: var(--fab-right);}.var-fab--position-left-bottom { bottom: var(--fab-bottom); left: var(--fab-left);}.var-fab--position-right-bottom { bottom: var(--fab-bottom); right: var(--fab-right);}.var-fab--direction-left .var-fab__actions,.var-fab--direction-right .var-fab__actions { height: 100%; top: 0; padding: 0 var(--fab-actions-padding);}.var-fab--direction-left .var-fab__actions { flex-direction: row-reverse; right: 100%;}.var-fab--direction-right .var-fab__actions { flex-direction: row; left: 100%;}.var-fab--direction-top .var-fab__actions,.var-fab--direction-bottom .var-fab__actions { width: 100%; left: 0;}.var-fab--direction-top .var-fab__actions { flex-direction: column-reverse; bottom: 100%;}.var-fab--direction-bottom .var-fab__actions { flex-direction: column; top: 100%;}.var-fab--fixed { position: fixed;}.var-fab--absolute { position: absolute;}.var-fab--active-transition-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--active-transition-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--active-transition-enter-from,.var-fab--active-transition-leave-to { transform: scale(0);}.var-fab--actions-transition-top-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-top-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-top-enter-from,.var-fab--actions-transition-top-leave-to { opacity: 0; transform: translateY(40px);}.var-fab--actions-transition-bottom-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-bottom-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-bottom-enter-from,.var-fab--actions-transition-bottom-leave-to { opacity: 0; transform: translateY(-40px);}.var-fab--actions-transition-left-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-left-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-left-enter-from,.var-fab--actions-transition-left-leave-to { opacity: 0; transform: translateX(40px);}.var-fab--actions-transition-right-enter-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-right-leave-active { transition: 0.3s var(--fab-transition-standard-easing) !important;}.var-fab--actions-transition-right-enter-from,.var-fab--actions-transition-right-leave-to { opacity: 0; transform: translateX(-40px);}.var-fab--trigger-icon-animation { transform: scale(0.4); opacity: 0; transition-property: transform, opacity;}.var-fab--safe-area { margin-bottom: constant(safe-area-inset-bottom); margin-bottom: env(safe-area-inset-bottom);}
package/es/fab/props.mjs CHANGED
@@ -79,6 +79,14 @@ export var props = {
79
79
  right: {
80
80
  type: [Number, String]
81
81
  },
82
+ elevation: {
83
+ type: [Boolean, Number, String],
84
+ default: true
85
+ },
86
+ safeArea: {
87
+ type: Boolean,
88
+ default: false
89
+ },
82
90
  teleport: {
83
91
  type: String
84
92
  },
@@ -241,7 +241,7 @@ import './time-picker/style/index.mjs'
241
241
  import './tooltip/style/index.mjs'
242
242
  import './uploader/style/index.mjs'
243
243
 
244
- const version = '2.9.3-alpha.1679397366672'
244
+ const version = '2.9.3-alpha.1679537809832'
245
245
 
246
246
  function install(app) {
247
247
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -160,7 +160,7 @@ export * from './time-picker/index.mjs'
160
160
  export * from './tooltip/index.mjs'
161
161
  export * from './uploader/index.mjs'
162
162
 
163
- const version = '2.9.3-alpha.1679397366672'
163
+ const version = '2.9.3-alpha.1679537809832'
164
164
 
165
165
  function install(app) {
166
166
  ActionSheet.install && app.use(ActionSheet)
package/es/menu/Menu.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createNamespace } from '../utils/components.mjs';
1
+ import { createNamespace, formatElevation } from '../utils/components.mjs';
2
2
  import { defineComponent } from 'vue';
3
3
  import { props } from './props.mjs';
4
4
  import { usePopover } from './usePopover.mjs';
@@ -35,7 +35,7 @@ function __render__(_ctx, _cache) {
35
35
  zIndex: _ctx.zIndex,
36
36
  width: _ctx.sameWidth ? _ctx.toSizeUnit(Math.ceil(_ctx.hostSize.width)) : undefined
37
37
  }),
38
- class: _normalizeClass(_ctx.classes(_ctx.n('menu'), [_ctx.defaultStyle, _ctx.n('--menu-background-color') + " " + _ctx.n('$-elevation--3')])),
38
+ class: _normalizeClass(_ctx.classes(_ctx.n('menu'), [_ctx.defaultStyle, _ctx.n('--menu-background-color')], [_ctx.defaultStyle, _ctx.formatElevation(_ctx.elevation, 3)])),
39
39
  onClick: _cache[0] || (_cache[0] = _withModifiers(() => {}, ["stop"])),
40
40
  onMouseenter: _cache[1] || (_cache[1] = function () {
41
41
  return _ctx.handlePopoverMouseenter && _ctx.handlePopoverMouseenter(...arguments);
@@ -88,6 +88,7 @@ var __sfc__ = defineComponent({
88
88
  hostSize,
89
89
  show,
90
90
  zIndex,
91
+ formatElevation,
91
92
  toSizeUnit,
92
93
  n,
93
94
  classes,
package/es/menu/props.mjs CHANGED
@@ -46,6 +46,10 @@ export var props = {
46
46
  type: Boolean,
47
47
  default: false
48
48
  },
49
+ elevation: {
50
+ type: [Boolean, String, Number],
51
+ default: true
52
+ },
49
53
  defaultStyle: {
50
54
  type: Boolean,
51
55
  default: true
@@ -6,7 +6,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
6
6
 
7
7
  import flip from '@popperjs/core/lib/modifiers/flip';
8
8
  import offset from '@popperjs/core/lib/modifiers/offset';
9
- import { useClickOutside } from '@varlet/use';
9
+ import { useClickOutside, useVModel } from '@varlet/use';
10
10
  import { doubleRaf, toPxNum } from '../utils/elements.mjs';
11
11
  import { call } from '../utils/components.mjs';
12
12
  import { onMounted, onUnmounted, ref, watch } from 'vue';
@@ -15,11 +15,24 @@ import { useZIndex } from '../context/zIndex.mjs';
15
15
  export function usePopover(options) {
16
16
  var host = ref(null);
17
17
  var popover = ref(null);
18
- var show = ref(false);
19
18
  var hostSize = ref({
20
19
  width: 0,
21
20
  height: 0
22
21
  });
22
+ var show = useVModel(options, 'show', {
23
+ passive: true,
24
+ defaultValue: false,
25
+
26
+ emit(event, value) {
27
+ if (value) {
28
+ resize();
29
+ call(options.onOpen);
30
+ } else {
31
+ call(options.onClose);
32
+ }
33
+ }
34
+
35
+ });
23
36
  var {
24
37
  zIndex
25
38
  } = useZIndex(() => show.value, 1);
@@ -261,22 +274,9 @@ export function usePopover(options) {
261
274
  };
262
275
 
263
276
  useClickOutside(host, 'click', handleClickOutside);
264
- watch(() => options.show, newValue => {
265
- show.value = newValue != null ? newValue : false;
266
- }, {
267
- immediate: true
268
- });
269
277
  watch(() => options.offsetX, resize);
270
278
  watch(() => options.offsetY, resize);
271
279
  watch(() => options.placement, resize);
272
- watch(() => show.value, newValue => {
273
- if (newValue) {
274
- resize();
275
- call(options.onOpen);
276
- } else {
277
- call(options.onClose);
278
- }
279
- });
280
280
  watch(() => options.disabled, close);
281
281
  onMounted(() => {
282
282
  var _host$value;
@@ -1,6 +1,6 @@
1
1
  import Ripple from '../ripple/index.mjs';
2
2
  import { defineComponent } from 'vue';
3
- import { call, createNamespace } from '../utils/components.mjs';
3
+ import { call, createNamespace, formatElevation } from '../utils/components.mjs';
4
4
  import { props } from './props.mjs';
5
5
  import { toSizeUnit } from '../utils/elements.mjs';
6
6
  var {
@@ -13,7 +13,7 @@ function __render__(_ctx, _cache) {
13
13
  var _directive_ripple = _resolveDirective("ripple");
14
14
 
15
15
  return _withDirectives((_openBlock(), _createElementBlock("div", {
16
- class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), [_ctx.elevation != null, _ctx.n("$-elevation--" + _ctx.elevation)], [_ctx.onClick, _ctx.n('--cursor')], [_ctx.round, _ctx.n('--round')], [_ctx.inline, _ctx.n('$--inline-flex')])),
16
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box'), _ctx.formatElevation(_ctx.elevation, 2), [_ctx.onClick, _ctx.n('--cursor')], [_ctx.round, _ctx.n('--round')], [_ctx.inline, _ctx.n('$--inline-flex')])),
17
17
  style: _normalizeStyle({
18
18
  width: _ctx.toSizeUnit(_ctx.width),
19
19
  height: _ctx.toSizeUnit(_ctx.height),
@@ -44,6 +44,7 @@ var __sfc__ = defineComponent({
44
44
  return {
45
45
  n,
46
46
  classes,
47
+ formatElevation,
47
48
  toSizeUnit,
48
49
  handleClick
49
50
  };
@@ -1,7 +1,8 @@
1
1
  import { defineListenerProp } from '../utils/components.mjs';
2
2
  export var props = {
3
3
  elevation: {
4
- type: [Number, String]
4
+ type: [Boolean, Number, String],
5
+ default: false
5
6
  },
6
7
  ripple: {
7
8
  type: Boolean,
@@ -6,7 +6,7 @@ import VarIcon from '../icon/index.mjs';
6
6
  import { defineComponent, ref, computed, watch } from 'vue';
7
7
  import { getParentScroller, getScrollTop, getTarget } from '../utils/elements.mjs';
8
8
  import { props } from './props.mjs';
9
- import { toNumber } from '@varlet/shared';
9
+ import { isString, toNumber } from '@varlet/shared';
10
10
  import { call, createNamespace } from '../utils/components.mjs';
11
11
  import { useEventListener, useMounted } from '@varlet/use';
12
12
  var {
@@ -63,7 +63,7 @@ var __sfc__ = defineComponent({
63
63
  var freshNode = ref(null);
64
64
  var controlNode = ref(null);
65
65
  var startPosition = ref(0);
66
- var distance = ref(-999);
66
+ var distance = ref('-125%');
67
67
  var iconName = ref('arrow-down');
68
68
  var refreshStatus = ref('default');
69
69
  var isEnd = ref(false);
@@ -73,7 +73,7 @@ var __sfc__ = defineComponent({
73
73
  var iconHasChanged = ref(true);
74
74
  var isTouchable = computed(() => refreshStatus.value !== 'loading' && refreshStatus.value !== 'success' && !props.disabled);
75
75
  var controlStyle = computed(() => ({
76
- transform: "translate3d(0px, " + distance.value + "px, 0px) translate(-50%, 0)",
76
+ transform: "translate3d(0px, " + (isString(distance.value) ? distance.value : distance.value + "px") + ", 0px) translate(-50%, 0)",
77
77
  transition: isEnd.value ? "transform " + props.animationDuration + "ms" : undefined,
78
78
  background: isSuccess.value ? props.successBgColor : props.bgColor,
79
79
  color: isSuccess.value ? props.successColor : props.color
@@ -96,6 +96,13 @@ var __sfc__ = defineComponent({
96
96
  };
97
97
 
98
98
  var touchStart = event => {
99
+ if (controlPosition.value === 0) {
100
+ var {
101
+ width
102
+ } = controlNode.value.getBoundingClientRect();
103
+ controlPosition.value = -(width + width * 0.25);
104
+ }
105
+
99
106
  startY = event.touches[0].clientY;
100
107
  deltaY = 0;
101
108
  };
@@ -161,14 +168,6 @@ var __sfc__ = defineComponent({
161
168
  };
162
169
  }();
163
170
 
164
- var setPosition = () => {
165
- var {
166
- width
167
- } = controlNode.value.getBoundingClientRect();
168
- distance.value = -(width + width * 0.25);
169
- controlPosition.value = -(width + width * 0.25);
170
- };
171
-
172
171
  var setScroller = () => {
173
172
  scroller = props.target ? getTarget(props.target, 'PullRefresh') : getParentScroller(freshNode.value);
174
173
  };
@@ -192,10 +191,7 @@ var __sfc__ = defineComponent({
192
191
  }, toNumber(props.successDuration));
193
192
  }
194
193
  });
195
- useMounted(() => {
196
- setScroller();
197
- setPosition();
198
- });
194
+ useMounted(setScroller);
199
195
  useEventListener(freshNode, 'touchmove', touchMove);
200
196
  return {
201
197
  n,