@varlet/ui 2.9.0 → 2.9.1-alpha.1678874318012
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.
- package/es/button/Button.mjs +17 -14
- package/es/button/button.css +1 -1
- package/es/button/style/index.mjs +1 -0
- package/es/counter/Counter.mjs +36 -22
- package/es/counter/counter.css +1 -1
- package/es/counter/style/index.mjs +2 -0
- package/es/hover-overlay/HoverOverlay.mjs +32 -0
- package/es/hover-overlay/HoverOverlaySfc.css +0 -0
- package/es/hover-overlay/hoverOverlay.css +1 -0
- package/es/hover-overlay/index.mjs +21 -0
- package/es/hover-overlay/props.mjs +6 -0
- package/es/hover-overlay/style/index.mjs +2 -0
- package/es/image-preview/index.mjs +32 -5
- package/es/index.bundle.mjs +7 -1
- package/es/index.mjs +6 -1
- package/es/input/Input.mjs +1 -3
- package/es/slider/Slider.mjs +54 -12
- package/es/slider/slider.css +1 -1
- package/es/slider/style/index.mjs +1 -0
- package/es/snackbar/style/index.mjs +1 -1
- package/es/style.css +1 -1
- package/es/style.mjs +1 -0
- package/es/switch/Switch.mjs +29 -6
- package/es/switch/style/index.mjs +1 -0
- package/es/varlet.esm.js +5860 -5736
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +399 -240
- package/package.json +6 -6
- package/types/hoverOverlay.d.ts +13 -0
- package/types/imagePreview.d.ts +5 -1
- package/types/index.d.ts +2 -0
- package/umd/varlet.js +5 -5
package/es/button/Button.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Ripple from '../ripple/index.mjs';
|
|
2
2
|
import VarLoading from '../loading/index.mjs';
|
|
3
|
+
import VarHoverOverlay, { useHoverOverlay } from '../hover-overlay/index.mjs';
|
|
3
4
|
import Hover from '../hover/index.mjs';
|
|
4
5
|
import { computed, defineComponent, ref } from 'vue';
|
|
5
6
|
import { props } from './props.mjs';
|
|
@@ -10,7 +11,7 @@ var {
|
|
|
10
11
|
n,
|
|
11
12
|
classes
|
|
12
13
|
} = createNamespace('button');
|
|
13
|
-
import { resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
14
|
+
import { resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, createElementVNode as _createElementVNode, createVNode as _createVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
14
15
|
|
|
15
16
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
16
17
|
|
|
@@ -19,6 +20,8 @@ var _hoisted_1 = ["type", "disabled"];
|
|
|
19
20
|
function __render__(_ctx, _cache) {
|
|
20
21
|
var _component_var_loading = _resolveComponent("var-loading");
|
|
21
22
|
|
|
23
|
+
var _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
|
|
24
|
+
|
|
22
25
|
var _directive_ripple = _resolveDirective("ripple");
|
|
23
26
|
|
|
24
27
|
var _directive_hover = _resolveDirective("hover");
|
|
@@ -51,21 +54,22 @@ function __render__(_ctx, _cache) {
|
|
|
51
54
|
class: _normalizeClass(_ctx.classes(_ctx.n('content'), [_ctx.loading || _ctx.pending, _ctx.n('--hidden')]))
|
|
52
55
|
}, [_renderSlot(_ctx.$slots, "default")], 2
|
|
53
56
|
/* CLASS */
|
|
54
|
-
),
|
|
55
|
-
|
|
56
|
-
}, null,
|
|
57
|
-
/*
|
|
58
|
-
)], 46
|
|
57
|
+
), _createVNode(_component_var_hover_overlay, {
|
|
58
|
+
hovering: _ctx.hovering
|
|
59
|
+
}, null, 8
|
|
60
|
+
/* PROPS */
|
|
61
|
+
, ["hovering"])], 46
|
|
59
62
|
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
60
63
|
, _hoisted_1)), [[_directive_ripple, {
|
|
61
64
|
disabled: _ctx.disabled || !_ctx.ripple
|
|
62
|
-
}], [_directive_hover, _ctx.
|
|
65
|
+
}], [_directive_hover, _ctx.handleHovering, "desktop"]]);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
var __sfc__ = defineComponent({
|
|
66
69
|
name: 'VarButton',
|
|
67
70
|
components: {
|
|
68
|
-
VarLoading
|
|
71
|
+
VarLoading,
|
|
72
|
+
VarHoverOverlay
|
|
69
73
|
},
|
|
70
74
|
directives: {
|
|
71
75
|
Ripple,
|
|
@@ -75,10 +79,13 @@ var __sfc__ = defineComponent({
|
|
|
75
79
|
|
|
76
80
|
setup(props) {
|
|
77
81
|
var pending = ref(false);
|
|
78
|
-
var hovering = ref(false);
|
|
79
82
|
var {
|
|
80
83
|
buttonGroup
|
|
81
84
|
} = useButtonGroup();
|
|
85
|
+
var {
|
|
86
|
+
hovering,
|
|
87
|
+
handleHovering
|
|
88
|
+
} = useHoverOverlay();
|
|
82
89
|
var states = computed(() => {
|
|
83
90
|
if (!buttonGroup) {
|
|
84
91
|
return {
|
|
@@ -150,17 +157,13 @@ var __sfc__ = defineComponent({
|
|
|
150
157
|
attemptAutoLoading(call(onTouchstart, e));
|
|
151
158
|
};
|
|
152
159
|
|
|
153
|
-
var handleHover = isHover => {
|
|
154
|
-
hovering.value = isHover;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
160
|
return {
|
|
158
161
|
n,
|
|
159
162
|
classes,
|
|
160
163
|
pending,
|
|
161
164
|
states,
|
|
162
165
|
hovering,
|
|
163
|
-
|
|
166
|
+
handleHovering,
|
|
164
167
|
handleClick,
|
|
165
168
|
handleTouchstart
|
|
166
169
|
};
|
package/es/button/button.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --button-default-color: #f5f5f5; --button-primary-color: var(--color-primary); --button-danger-color: var(--color-danger); --button-success-color: var(--color-success); --button-warning-color: var(--color-warning); --button-info-color: var(--color-info); --button-disabled-color: var(--color-disabled); --button-disabled-text-color: var(--color-text-disabled); --button-border-radius: 4px; --button-mini-padding: 0 9px; --button-small-padding: 0 11px; --button-normal-padding: 0 15px; --button-large-padding: 0 22px; --button-round-padding: 6px; --button-mini-height: 20px; --button-small-height: 28px; --button-normal-height: 36px; --button-large-height: 44px; --button-mini-font-size: var(--font-size-xs); --button-small-font-size: var(--font-size-sm); --button-normal-font-size: var(--font-size-md); --button-large-font-size: var(--font-size-lg);}.var-button { position: relative; justify-content: center; align-items: center; outline: none; border: none; border-radius: var(--button-border-radius); user-select: none; cursor: pointer; font-family: inherit; transition: box-shadow 0.2s, background-color 0.25s; will-change: box-shadow; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); white-space: nowrap;}.var-button:active { box-shadow: 0 3px 5px -1px var(--shadow-key-umbra-opacity), 0 5px 8px 0 var(--shadow-key-penumbra-opacity), 0 1px 14px 0 var(--shadow-key-ambient-opacity);}.var-button__content { display: flex; align-items: center; flex-wrap: wrap;}.var-button__loading[var-button-cover] { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);}.var-
|
|
1
|
+
:root { --button-default-color: #f5f5f5; --button-primary-color: var(--color-primary); --button-danger-color: var(--color-danger); --button-success-color: var(--color-success); --button-warning-color: var(--color-warning); --button-info-color: var(--color-info); --button-disabled-color: var(--color-disabled); --button-disabled-text-color: var(--color-text-disabled); --button-border-radius: 4px; --button-mini-padding: 0 9px; --button-small-padding: 0 11px; --button-normal-padding: 0 15px; --button-large-padding: 0 22px; --button-round-padding: 6px; --button-mini-height: 20px; --button-small-height: 28px; --button-normal-height: 36px; --button-large-height: 44px; --button-mini-font-size: var(--font-size-xs); --button-small-font-size: var(--font-size-sm); --button-normal-font-size: var(--font-size-md); --button-large-font-size: var(--font-size-lg);}.var-button { position: relative; justify-content: center; align-items: center; outline: none; border: none; border-radius: var(--button-border-radius); user-select: none; cursor: pointer; font-family: inherit; transition: box-shadow 0.2s, background-color 0.25s; will-change: box-shadow; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); white-space: nowrap;}.var-button:active { box-shadow: 0 3px 5px -1px var(--shadow-key-umbra-opacity), 0 5px 8px 0 var(--shadow-key-penumbra-opacity), 0 1px 14px 0 var(--shadow-key-ambient-opacity);}.var-button__content { display: flex; align-items: center; flex-wrap: wrap;}.var-button__loading[var-button-cover] { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);}.var-button--default { color: inherit; background-color: var(--button-default-color);}.var-button--primary { color: #fff; background-color: var(--button-primary-color);}.var-button--info { color: #fff; background-color: var(--button-info-color);}.var-button--success { color: #fff; background-color: var(--button-success-color);}.var-button--warning { color: #fff; background-color: var(--button-warning-color);}.var-button--danger { color: #fff; background-color: var(--button-danger-color);}.var-button--disabled { background-color: var(--button-disabled-color); color: var(--button-disabled-text-color); cursor: not-allowed; box-shadow: none !important;}.var-button--block { width: 100%;}.var-button--text { background-color: transparent;}.var-button--text:active { box-shadow: none;}.var-button--text-default { color: inherit;}.var-button--text-primary { color: var(--button-primary-color);}.var-button--text-info { color: var(--button-info-color);}.var-button--text-success { color: var(--button-success-color);}.var-button--text-warning { color: var(--button-warning-color);}.var-button--text-danger { color: var(--button-danger-color);}.var-button--text-disabled { color: var(--button-disabled-text-color);}.var-button--normal { height: var(--button-normal-height); padding: var(--button-normal-padding); font-size: var(--button-normal-font-size);}.var-button--large { height: var(--button-large-height); padding: var(--button-large-padding); font-size: var(--button-large-font-size);}.var-button--small { height: var(--button-small-height); padding: var(--button-small-padding); font-size: var(--button-small-font-size);}.var-button--mini { height: var(--button-mini-height); padding: var(--button-mini-padding); font-size: var(--button-mini-font-size);}.var-button--round { padding: var(--button-round-padding); border-radius: 50%; height: auto;}.var-button--outline { border: thin solid currentColor;}.var-button--hidden { opacity: 0;}
|
package/es/counter/Counter.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import VarButton from '../button/index.mjs';
|
|
1
2
|
import VarIcon from '../icon/index.mjs';
|
|
2
3
|
import VarFormDetails from '../form-details/index.mjs';
|
|
3
4
|
import Ripple from '../ripple/index.mjs';
|
|
@@ -14,7 +15,7 @@ var {
|
|
|
14
15
|
} = createNamespace('counter');
|
|
15
16
|
var SPEED = 100;
|
|
16
17
|
var DELAY = 600;
|
|
17
|
-
import { resolveComponent as _resolveComponent,
|
|
18
|
+
import { resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, withCtx as _withCtx, vModelText as _vModelText, createElementVNode as _createElementVNode, withDirectives as _withDirectives, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
18
19
|
|
|
19
20
|
var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
|
|
20
21
|
|
|
@@ -23,9 +24,9 @@ var _hoisted_1 = ["inputmode", "readonly", "disabled"];
|
|
|
23
24
|
function __render__(_ctx, _cache) {
|
|
24
25
|
var _component_var_icon = _resolveComponent("var-icon");
|
|
25
26
|
|
|
26
|
-
var
|
|
27
|
+
var _component_var_button = _resolveComponent("var-button");
|
|
27
28
|
|
|
28
|
-
var
|
|
29
|
+
var _component_var_form_details = _resolveComponent("var-form-details");
|
|
29
30
|
|
|
30
31
|
return _openBlock(), _createElementBlock("div", {
|
|
31
32
|
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.n('$--box')))
|
|
@@ -34,23 +35,29 @@ function __render__(_ctx, _cache) {
|
|
|
34
35
|
style: {
|
|
35
36
|
background: _ctx.color ? _ctx.color : undefined
|
|
36
37
|
}
|
|
37
|
-
}, _ctx.$attrs), [
|
|
38
|
-
"var-counter-cover": "",
|
|
39
|
-
name: "minus",
|
|
38
|
+
}, _ctx.$attrs), [_createVNode(_component_var_button, {
|
|
40
39
|
class: _normalizeClass(_ctx.classes(_ctx.n('decrement-button'), [!_ctx.decrementButton, _ctx.n('--hidden')], [_ctx.disabled || _ctx.formDisabled, _ctx.n('--not-allowed')])),
|
|
41
40
|
style: _normalizeStyle({
|
|
42
41
|
width: _ctx.toSizeUnit(_ctx.buttonSize),
|
|
43
42
|
height: _ctx.toSizeUnit(_ctx.buttonSize)
|
|
44
43
|
}),
|
|
44
|
+
round: "",
|
|
45
|
+
"var-counter-cover": "",
|
|
46
|
+
ripple: _ctx.ripple && _ctx.decrementButton && !_ctx.disabled && !_ctx.formDisabled && !_ctx.readonly && !_ctx.formReadonly && !_ctx.disableDecrement && !_ctx.isMin,
|
|
45
47
|
onClick: _ctx.decrement,
|
|
46
48
|
onTouchstart: _ctx.pressDecrement,
|
|
47
49
|
onTouchend: _ctx.releaseDecrement,
|
|
48
50
|
onTouchcancel: _ctx.releaseDecrement
|
|
49
|
-
},
|
|
51
|
+
}, {
|
|
52
|
+
default: _withCtx(() => [_createVNode(_component_var_icon, {
|
|
53
|
+
name: "minus"
|
|
54
|
+
})]),
|
|
55
|
+
_: 1
|
|
56
|
+
/* STABLE */
|
|
57
|
+
|
|
58
|
+
}, 8
|
|
50
59
|
/* PROPS */
|
|
51
|
-
, ["class", "style", "onClick", "onTouchstart", "onTouchend", "onTouchcancel"]),
|
|
52
|
-
disabled: !_ctx.ripple || _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly || _ctx.disableDecrement || !_ctx.decrementButton || _ctx.isMin
|
|
53
|
-
}]]), _withDirectives(_createElementVNode("input", {
|
|
60
|
+
, ["class", "style", "ripple", "onClick", "onTouchstart", "onTouchend", "onTouchcancel"]), _withDirectives(_createElementVNode("input", {
|
|
54
61
|
class: _normalizeClass(_ctx.classes(_ctx.n('input'), [_ctx.disabled || _ctx.formDisabled, _ctx.n('--not-allowed')])),
|
|
55
62
|
style: _normalizeStyle({
|
|
56
63
|
width: _ctx.toSizeUnit(_ctx.inputWidth),
|
|
@@ -65,23 +72,29 @@ function __render__(_ctx, _cache) {
|
|
|
65
72
|
})
|
|
66
73
|
}, null, 46
|
|
67
74
|
/* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
|
|
68
|
-
, _hoisted_1), [[_vModelText, _ctx.inputValue]]),
|
|
69
|
-
"var-counter-cover": "",
|
|
70
|
-
name: "plus",
|
|
75
|
+
, _hoisted_1), [[_vModelText, _ctx.inputValue]]), _createVNode(_component_var_button, {
|
|
71
76
|
class: _normalizeClass(_ctx.classes(_ctx.n('increment-button'), [!_ctx.incrementButton, _ctx.n('--hidden')], [_ctx.disabled || _ctx.formDisabled, _ctx.n('--not-allowed')])),
|
|
72
77
|
style: _normalizeStyle({
|
|
73
78
|
width: _ctx.toSizeUnit(_ctx.buttonSize),
|
|
74
79
|
height: _ctx.toSizeUnit(_ctx.buttonSize)
|
|
75
80
|
}),
|
|
81
|
+
round: "",
|
|
82
|
+
"var-counter-cover": "",
|
|
83
|
+
ripple: _ctx.ripple && _ctx.incrementButton && !_ctx.disabled && !_ctx.formDisabled && !_ctx.readonly && !_ctx.formReadonly && !_ctx.disableIncrement && !_ctx.isMax,
|
|
76
84
|
onClick: _ctx.increment,
|
|
77
85
|
onTouchstart: _ctx.pressIncrement,
|
|
78
86
|
onTouchend: _ctx.releaseIncrement,
|
|
79
87
|
onTouchcancel: _ctx.releaseIncrement
|
|
80
|
-
},
|
|
88
|
+
}, {
|
|
89
|
+
default: _withCtx(() => [_createVNode(_component_var_icon, {
|
|
90
|
+
name: "plus"
|
|
91
|
+
})]),
|
|
92
|
+
_: 1
|
|
93
|
+
/* STABLE */
|
|
94
|
+
|
|
95
|
+
}, 8
|
|
81
96
|
/* PROPS */
|
|
82
|
-
, ["class", "style", "onClick", "onTouchstart", "onTouchend", "onTouchcancel"]),
|
|
83
|
-
disabled: !_ctx.ripple || _ctx.disabled || _ctx.readonly || _ctx.formDisabled || _ctx.formReadonly || _ctx.disableIncrement || !_ctx.incrementButton || _ctx.isMax
|
|
84
|
-
}]])], 16
|
|
97
|
+
, ["class", "style", "ripple", "onClick", "onTouchstart", "onTouchend", "onTouchcancel"])], 16
|
|
85
98
|
/* FULL_PROPS */
|
|
86
99
|
), _createVNode(_component_var_form_details, {
|
|
87
100
|
"error-message": _ctx.errorMessage
|
|
@@ -95,6 +108,7 @@ function __render__(_ctx, _cache) {
|
|
|
95
108
|
var __sfc__ = defineComponent({
|
|
96
109
|
name: 'VarCounter',
|
|
97
110
|
components: {
|
|
111
|
+
VarButton,
|
|
98
112
|
VarIcon,
|
|
99
113
|
VarFormDetails
|
|
100
114
|
},
|
|
@@ -106,10 +120,6 @@ var __sfc__ = defineComponent({
|
|
|
106
120
|
|
|
107
121
|
setup(props) {
|
|
108
122
|
var inputValue = ref('');
|
|
109
|
-
var incrementTimer;
|
|
110
|
-
var decrementTimer;
|
|
111
|
-
var incrementDelayTimer;
|
|
112
|
-
var decrementDelayTimer;
|
|
113
123
|
var {
|
|
114
124
|
bindForm,
|
|
115
125
|
form
|
|
@@ -124,7 +134,11 @@ var __sfc__ = defineComponent({
|
|
|
124
134
|
var {
|
|
125
135
|
readonly: formReadonly,
|
|
126
136
|
disabled: formDisabled
|
|
127
|
-
} = form != null ? form : {};
|
|
137
|
+
} = form != null ? form : {};
|
|
138
|
+
var incrementTimer;
|
|
139
|
+
var decrementTimer;
|
|
140
|
+
var incrementDelayTimer;
|
|
141
|
+
var decrementDelayTimer; // expose
|
|
128
142
|
|
|
129
143
|
var validate = () => v(props.rules, props.modelValue);
|
|
130
144
|
|
package/es/counter/counter.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --counter-padding: 0 4px; --counter-font-color: #fff; --counter-background: var(--color-primary); --counter-input-width: 28px; --counter-input-margin: 0 4px; --counter-input-font-size: 14px; --counter-button-size: 28px; --counter-button-icon-size: 100%; --counter-disabled-color: var(--color-disabled); --counter-disabled-opacity: var(--opacity-disabled); --counter-error-color: var(--color-danger);}.var-counter { display: inline-flex; flex-direction: column; align-items: flex-start;}.var-counter__controller { display: flex; align-items: center; color: var(--counter-font-color); border-radius: var(--counter-button-size); padding: var(--counter-padding); background: var(--counter-background); transition: color 0.25s, background-color 0.25s, opacity 0.25s;}.var-
|
|
1
|
+
:root { --counter-padding: 0 4px; --counter-font-color: #fff; --counter-background: var(--color-primary); --counter-input-width: 28px; --counter-input-margin: 0 4px; --counter-input-font-size: 14px; --counter-button-size: 28px; --counter-button-icon-size: 100%; --counter-disabled-color: var(--color-disabled); --counter-disabled-opacity: var(--opacity-disabled); --counter-error-color: var(--color-danger);}.var-counter { display: inline-flex; flex-direction: column; align-items: flex-start;}.var-counter__controller { display: flex; align-items: center; color: var(--counter-font-color); border-radius: var(--counter-button-size); padding: var(--counter-padding); background: var(--counter-background); transition: color 0.25s, background-color 0.25s, opacity 0.25s;}.var-counter__input { width: var(--counter-input-width); font-size: var(--counter-input-font-size); outline: none; border: none; background: transparent; padding: 0; text-align: center; color: var(--counter-font-color); margin: var(--counter-input-margin);}.var-counter__input[disabled] { background: transparent;}.var-counter__increment-button[var-counter-cover],.var-counter__decrement-button[var-counter-cover] { width: var(--counter-button-size); height: var(--counter-button-size); font-size: var(--counter-button-icon-size); border-radius: 50%; padding: 0; background-color: rgba(0, 0, 0, 0); box-shadow: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-user-select: none; user-select: none;}.var-counter__increment-button[var-counter-cover]:active,.var-counter__decrement-button[var-counter-cover]:active { box-shadow: none;}.var-counter--disabled { opacity: var(--counter-disabled-opacity); cursor: not-allowed;}.var-counter--disabled .var-hover-overlay { opacity: 0;}.var-counter--not-allowed { cursor: not-allowed !important;}.var-counter--hidden { opacity: 0;}.var-counter--error { background: var(--counter-error-color);}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import '../../styles/common.css'
|
|
2
2
|
import '../../styles/elevation.css'
|
|
3
3
|
import '../../icon/icon.css'
|
|
4
|
+
import '../../loading/loading.css'
|
|
5
|
+
import '../../button/button.css'
|
|
4
6
|
import '../../form-details/formDetails.css'
|
|
5
7
|
import '../../ripple/ripple.css'
|
|
6
8
|
import '../counter.css'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent } from 'vue';
|
|
2
|
+
import { props } from './props.mjs';
|
|
3
|
+
import { createNamespace } from '../utils/components.mjs';
|
|
4
|
+
var {
|
|
5
|
+
n,
|
|
6
|
+
classes
|
|
7
|
+
} = createNamespace('hover-overlay');
|
|
8
|
+
import { normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
9
|
+
|
|
10
|
+
function __render__(_ctx, _cache) {
|
|
11
|
+
return _openBlock(), _createElementBlock("div", {
|
|
12
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), [_ctx.hovering, _ctx.n('--hovering')]))
|
|
13
|
+
}, null, 2
|
|
14
|
+
/* CLASS */
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var __sfc__ = defineComponent({
|
|
19
|
+
name: 'VarHoverOverlay',
|
|
20
|
+
props,
|
|
21
|
+
|
|
22
|
+
setup() {
|
|
23
|
+
return {
|
|
24
|
+
n,
|
|
25
|
+
classes
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
__sfc__.render = __render__;
|
|
32
|
+
export default __sfc__;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.var-hover-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: inherit; background-color: currentColor; opacity: 0; transition: opacity 0.15s; will-change: opacity; pointer-events: none;}.var-hover-overlay--hovering { opacity: 0.15;}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import HoverOverlay from './HoverOverlay.mjs';
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
HoverOverlay.install = function (app) {
|
|
5
|
+
app.component(HoverOverlay.name, HoverOverlay);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export function useHoverOverlay() {
|
|
9
|
+
var hovering = ref(false);
|
|
10
|
+
|
|
11
|
+
var handleHovering = value => {
|
|
12
|
+
hovering.value = value;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
hovering,
|
|
17
|
+
handleHovering
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export var _HoverOverlayComponent = HoverOverlay;
|
|
21
|
+
export default HoverOverlay;
|
|
@@ -1,8 +1,31 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import VarImagePreview from './ImagePreview.mjs';
|
|
2
4
|
import { nextTick, reactive } from 'vue';
|
|
3
5
|
import { inBrowser, isArray, isString } from '@varlet/shared';
|
|
4
6
|
import { call, mountInstance } from '../utils/components.mjs';
|
|
5
7
|
var singletonOptions;
|
|
8
|
+
var defaultOptions = {};
|
|
9
|
+
|
|
10
|
+
function normalizeOptions(options) {
|
|
11
|
+
if (options === void 0) {
|
|
12
|
+
options = {};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (isString(options)) {
|
|
16
|
+
return _extends({}, defaultOptions, {
|
|
17
|
+
images: [options]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (isArray(options)) {
|
|
22
|
+
return _extends({}, defaultOptions, {
|
|
23
|
+
images: options
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return _extends({}, defaultOptions, options);
|
|
28
|
+
}
|
|
6
29
|
|
|
7
30
|
function ImagePreview(options) {
|
|
8
31
|
if (!inBrowser()) {
|
|
@@ -10,11 +33,7 @@ function ImagePreview(options) {
|
|
|
10
33
|
}
|
|
11
34
|
|
|
12
35
|
ImagePreview.close();
|
|
13
|
-
var imagePreviewOptions =
|
|
14
|
-
images: [options]
|
|
15
|
-
} : isArray(options) ? {
|
|
16
|
-
images: options
|
|
17
|
-
} : options;
|
|
36
|
+
var imagePreviewOptions = normalizeOptions(options);
|
|
18
37
|
var reactiveImagePreviewOptions = reactive(imagePreviewOptions);
|
|
19
38
|
reactiveImagePreviewOptions.teleport = 'body';
|
|
20
39
|
singletonOptions = reactiveImagePreviewOptions;
|
|
@@ -48,6 +67,14 @@ ImagePreview.close = () => {
|
|
|
48
67
|
}
|
|
49
68
|
};
|
|
50
69
|
|
|
70
|
+
ImagePreview.setDefaultOptions = options => {
|
|
71
|
+
defaultOptions = options;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
ImagePreview.resetDefaultOptions = () => {
|
|
75
|
+
defaultOptions = {};
|
|
76
|
+
};
|
|
77
|
+
|
|
51
78
|
VarImagePreview.install = function (app) {
|
|
52
79
|
app.component(VarImagePreview.name, VarImagePreview);
|
|
53
80
|
};
|
package/es/index.bundle.mjs
CHANGED
|
@@ -29,6 +29,7 @@ import Fab from './fab/index.mjs'
|
|
|
29
29
|
import Form from './form/index.mjs'
|
|
30
30
|
import FormDetails from './form-details/index.mjs'
|
|
31
31
|
import Hover from './hover/index.mjs'
|
|
32
|
+
import HoverOverlay from './hover-overlay/index.mjs'
|
|
32
33
|
import Icon from './icon/index.mjs'
|
|
33
34
|
import Image from './image/index.mjs'
|
|
34
35
|
import ImagePreview from './image-preview/index.mjs'
|
|
@@ -109,6 +110,7 @@ export * from './fab/index.mjs'
|
|
|
109
110
|
export * from './form/index.mjs'
|
|
110
111
|
export * from './form-details/index.mjs'
|
|
111
112
|
export * from './hover/index.mjs'
|
|
113
|
+
export * from './hover-overlay/index.mjs'
|
|
112
114
|
export * from './icon/index.mjs'
|
|
113
115
|
export * from './image/index.mjs'
|
|
114
116
|
export * from './image-preview/index.mjs'
|
|
@@ -189,6 +191,7 @@ import './fab/style/index.mjs'
|
|
|
189
191
|
import './form/style/index.mjs'
|
|
190
192
|
import './form-details/style/index.mjs'
|
|
191
193
|
import './hover/style/index.mjs'
|
|
194
|
+
import './hover-overlay/style/index.mjs'
|
|
192
195
|
import './icon/style/index.mjs'
|
|
193
196
|
import './image/style/index.mjs'
|
|
194
197
|
import './image-preview/style/index.mjs'
|
|
@@ -238,7 +241,7 @@ import './time-picker/style/index.mjs'
|
|
|
238
241
|
import './tooltip/style/index.mjs'
|
|
239
242
|
import './uploader/style/index.mjs'
|
|
240
243
|
|
|
241
|
-
const version = '2.9.
|
|
244
|
+
const version = '2.9.1-alpha.1678874318012'
|
|
242
245
|
|
|
243
246
|
function install(app) {
|
|
244
247
|
ActionSheet.install && app.use(ActionSheet)
|
|
@@ -272,6 +275,7 @@ function install(app) {
|
|
|
272
275
|
Form.install && app.use(Form)
|
|
273
276
|
FormDetails.install && app.use(FormDetails)
|
|
274
277
|
Hover.install && app.use(Hover)
|
|
278
|
+
HoverOverlay.install && app.use(HoverOverlay)
|
|
275
279
|
Icon.install && app.use(Icon)
|
|
276
280
|
Image.install && app.use(Image)
|
|
277
281
|
ImagePreview.install && app.use(ImagePreview)
|
|
@@ -356,6 +360,7 @@ export {
|
|
|
356
360
|
Form,
|
|
357
361
|
FormDetails,
|
|
358
362
|
Hover,
|
|
363
|
+
HoverOverlay,
|
|
359
364
|
Icon,
|
|
360
365
|
Image,
|
|
361
366
|
ImagePreview,
|
|
@@ -440,6 +445,7 @@ export default {
|
|
|
440
445
|
Form,
|
|
441
446
|
FormDetails,
|
|
442
447
|
Hover,
|
|
448
|
+
HoverOverlay,
|
|
443
449
|
Icon,
|
|
444
450
|
Image,
|
|
445
451
|
ImagePreview,
|
package/es/index.mjs
CHANGED
|
@@ -29,6 +29,7 @@ import Fab from './fab/index.mjs'
|
|
|
29
29
|
import Form from './form/index.mjs'
|
|
30
30
|
import FormDetails from './form-details/index.mjs'
|
|
31
31
|
import Hover from './hover/index.mjs'
|
|
32
|
+
import HoverOverlay from './hover-overlay/index.mjs'
|
|
32
33
|
import Icon from './icon/index.mjs'
|
|
33
34
|
import Image from './image/index.mjs'
|
|
34
35
|
import ImagePreview from './image-preview/index.mjs'
|
|
@@ -109,6 +110,7 @@ export * from './fab/index.mjs'
|
|
|
109
110
|
export * from './form/index.mjs'
|
|
110
111
|
export * from './form-details/index.mjs'
|
|
111
112
|
export * from './hover/index.mjs'
|
|
113
|
+
export * from './hover-overlay/index.mjs'
|
|
112
114
|
export * from './icon/index.mjs'
|
|
113
115
|
export * from './image/index.mjs'
|
|
114
116
|
export * from './image-preview/index.mjs'
|
|
@@ -158,7 +160,7 @@ export * from './time-picker/index.mjs'
|
|
|
158
160
|
export * from './tooltip/index.mjs'
|
|
159
161
|
export * from './uploader/index.mjs'
|
|
160
162
|
|
|
161
|
-
const version = '2.9.
|
|
163
|
+
const version = '2.9.1-alpha.1678874318012'
|
|
162
164
|
|
|
163
165
|
function install(app) {
|
|
164
166
|
ActionSheet.install && app.use(ActionSheet)
|
|
@@ -192,6 +194,7 @@ function install(app) {
|
|
|
192
194
|
Form.install && app.use(Form)
|
|
193
195
|
FormDetails.install && app.use(FormDetails)
|
|
194
196
|
Hover.install && app.use(Hover)
|
|
197
|
+
HoverOverlay.install && app.use(HoverOverlay)
|
|
195
198
|
Icon.install && app.use(Icon)
|
|
196
199
|
Image.install && app.use(Image)
|
|
197
200
|
ImagePreview.install && app.use(ImagePreview)
|
|
@@ -276,6 +279,7 @@ export {
|
|
|
276
279
|
Form,
|
|
277
280
|
FormDetails,
|
|
278
281
|
Hover,
|
|
282
|
+
HoverOverlay,
|
|
279
283
|
Icon,
|
|
280
284
|
Image,
|
|
281
285
|
ImagePreview,
|
|
@@ -360,6 +364,7 @@ export default {
|
|
|
360
364
|
Form,
|
|
361
365
|
FormDetails,
|
|
362
366
|
Hover,
|
|
367
|
+
HoverOverlay,
|
|
363
368
|
Icon,
|
|
364
369
|
Image,
|
|
365
370
|
ImagePreview,
|
package/es/input/Input.mjs
CHANGED
|
@@ -264,9 +264,7 @@ var __sfc__ = defineComponent({
|
|
|
264
264
|
value = formatNumber(value);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
|
|
268
|
-
target.value = value;
|
|
269
|
-
return value;
|
|
267
|
+
return withMaxlength(withTrim(value));
|
|
270
268
|
};
|
|
271
269
|
|
|
272
270
|
var handleCompositionStart = e => {
|