@varlet/ui 2.9.0 → 2.9.1-alpha.1678875429822
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 +12 -18
- package/es/slider/Slider.mjs +54 -12
- package/es/slider/slider.css +1 -1
- package/es/slider/style/index.mjs +1 -0
- 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 +6813 -6694
- 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 +408 -252
- 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/style.mjs
CHANGED
|
@@ -29,6 +29,7 @@ import './fab/style/index.mjs'
|
|
|
29
29
|
import './form/style/index.mjs'
|
|
30
30
|
import './form-details/style/index.mjs'
|
|
31
31
|
import './hover/style/index.mjs'
|
|
32
|
+
import './hover-overlay/style/index.mjs'
|
|
32
33
|
import './icon/style/index.mjs'
|
|
33
34
|
import './image/style/index.mjs'
|
|
34
35
|
import './image-preview/style/index.mjs'
|
package/es/switch/Switch.mjs
CHANGED
|
@@ -2,6 +2,8 @@ import { defineComponent, computed, nextTick } from 'vue';
|
|
|
2
2
|
import { useValidation, createNamespace, call } from '../utils/components.mjs';
|
|
3
3
|
import { multiplySizeUnit } from '../utils/elements.mjs';
|
|
4
4
|
import { useForm } from '../form/provide.mjs';
|
|
5
|
+
import VarHoverOverlay, { useHoverOverlay } from '../hover-overlay/index.mjs';
|
|
6
|
+
import Hover from '../hover/index.mjs';
|
|
5
7
|
import { props } from './props.mjs';
|
|
6
8
|
import VarFormDetails from '../form-details/index.mjs';
|
|
7
9
|
import VarLoading from '../loading/index.mjs';
|
|
@@ -10,16 +12,20 @@ var {
|
|
|
10
12
|
n,
|
|
11
13
|
classes
|
|
12
14
|
} = createNamespace('switch');
|
|
13
|
-
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives
|
|
15
|
+
import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives } from "vue";
|
|
14
16
|
|
|
15
17
|
function __render__(_ctx, _cache) {
|
|
16
18
|
var _component_var_loading = _resolveComponent("var-loading");
|
|
17
19
|
|
|
20
|
+
var _component_var_hover_overlay = _resolveComponent("var-hover-overlay");
|
|
21
|
+
|
|
18
22
|
var _component_var_form_details = _resolveComponent("var-form-details");
|
|
19
23
|
|
|
20
24
|
var _directive_ripple = _resolveDirective("ripple");
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
var _directive_hover = _resolveDirective("hover");
|
|
27
|
+
|
|
28
|
+
return _withDirectives((_openBlock(), _createElementBlock("div", {
|
|
23
29
|
class: _normalizeClass(_ctx.n())
|
|
24
30
|
}, [_createElementVNode("div", {
|
|
25
31
|
class: _normalizeClass(_ctx.classes(_ctx.n('block'), [_ctx.disabled || _ctx.formDisabled, _ctx.n('--disabled')])),
|
|
@@ -46,7 +52,11 @@ function __render__(_ctx, _cache) {
|
|
|
46
52
|
/* PROPS */
|
|
47
53
|
, ["radius"])) : _createCommentVNode("v-if", true)], 6
|
|
48
54
|
/* CLASS, STYLE */
|
|
49
|
-
)
|
|
55
|
+
), _createVNode(_component_var_hover_overlay, {
|
|
56
|
+
hovering: _ctx.hovering
|
|
57
|
+
}, null, 8
|
|
58
|
+
/* PROPS */
|
|
59
|
+
, ["hovering"])], 6
|
|
50
60
|
/* CLASS, STYLE */
|
|
51
61
|
)), [[_directive_ripple, {
|
|
52
62
|
disabled: !_ctx.ripple || _ctx.disabled || _ctx.loading || _ctx.formDisabled
|
|
@@ -58,17 +68,19 @@ function __render__(_ctx, _cache) {
|
|
|
58
68
|
/* PROPS */
|
|
59
69
|
, ["error-message"])], 2
|
|
60
70
|
/* CLASS */
|
|
61
|
-
);
|
|
71
|
+
)), [[_directive_hover, _ctx.hover, "desktop"]]);
|
|
62
72
|
}
|
|
63
73
|
|
|
64
74
|
var __sfc__ = defineComponent({
|
|
65
75
|
name: 'VarSwitch',
|
|
66
76
|
components: {
|
|
67
77
|
VarLoading,
|
|
68
|
-
VarFormDetails
|
|
78
|
+
VarFormDetails,
|
|
79
|
+
VarHoverOverlay
|
|
69
80
|
},
|
|
70
81
|
directives: {
|
|
71
|
-
Ripple
|
|
82
|
+
Ripple,
|
|
83
|
+
Hover
|
|
72
84
|
},
|
|
73
85
|
props,
|
|
74
86
|
|
|
@@ -83,6 +95,10 @@ var __sfc__ = defineComponent({
|
|
|
83
95
|
validate: v,
|
|
84
96
|
resetValidation
|
|
85
97
|
} = useValidation();
|
|
98
|
+
var {
|
|
99
|
+
hovering,
|
|
100
|
+
handleHovering
|
|
101
|
+
} = useHoverOverlay();
|
|
86
102
|
|
|
87
103
|
var validate = () => v(props.rules, props.modelValue);
|
|
88
104
|
|
|
@@ -150,6 +166,11 @@ var __sfc__ = defineComponent({
|
|
|
150
166
|
validateWithTrigger();
|
|
151
167
|
};
|
|
152
168
|
|
|
169
|
+
var hover = value => {
|
|
170
|
+
if (props.disabled || form != null && form.disabled.value) return;
|
|
171
|
+
handleHovering(value);
|
|
172
|
+
};
|
|
173
|
+
|
|
153
174
|
var reset = () => {
|
|
154
175
|
call(props['onUpdate:modelValue'], props.inactiveValue);
|
|
155
176
|
resetValidation();
|
|
@@ -165,6 +186,8 @@ var __sfc__ = defineComponent({
|
|
|
165
186
|
n,
|
|
166
187
|
classes,
|
|
167
188
|
switchActive,
|
|
189
|
+
hovering,
|
|
190
|
+
hover,
|
|
168
191
|
radius,
|
|
169
192
|
styleComputed,
|
|
170
193
|
errorMessage,
|