@varlet/ui 2.8.6 → 2.8.7-alpha.1678160786574
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/breadcrumb/provide.mjs +4 -6
- package/es/breadcrumbs/provide.mjs +3 -6
- package/es/button/Button.mjs +17 -2
- package/es/button/button.css +1 -1
- package/es/icon/Icon.mjs +10 -7
- package/es/icon/icon.css +1 -1
- package/es/icon/props.mjs +3 -0
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/style.css +1 -1
- package/es/tab/provide.mjs +4 -6
- package/es/tab-item/provide.mjs +4 -6
- package/es/tabs/provide.mjs +3 -6
- package/es/tabs-items/provide.mjs +3 -6
- package/es/varlet.esm.js +4150 -4070
- package/highlight/web-types.en-US.json +12 -3
- package/highlight/web-types.zh-CN.json +12 -3
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +263 -159
- package/package.json +6 -6
- package/types/icon.d.ts +1 -0
- package/umd/varlet.js +6 -6
package/lib/varlet.cjs.js
CHANGED
|
@@ -457,6 +457,104 @@ function useClickOutside(target, type, listener) {
|
|
|
457
457
|
};
|
|
458
458
|
useEventListener(document, type, handler);
|
|
459
459
|
}
|
|
460
|
+
var __rest = globalThis && globalThis.__rest || function(s, e) {
|
|
461
|
+
var t = {};
|
|
462
|
+
for (var p in s)
|
|
463
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
464
|
+
t[p] = s[p];
|
|
465
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
466
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
467
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
468
|
+
t[p[i]] = s[p[i]];
|
|
469
|
+
}
|
|
470
|
+
return t;
|
|
471
|
+
};
|
|
472
|
+
function keyInProvides$1(key) {
|
|
473
|
+
const instance = vue.getCurrentInstance();
|
|
474
|
+
return key in instance.provides;
|
|
475
|
+
}
|
|
476
|
+
function useParent$1(key) {
|
|
477
|
+
if (!keyInProvides$1(key)) {
|
|
478
|
+
return {
|
|
479
|
+
index: null,
|
|
480
|
+
parentProvider: null,
|
|
481
|
+
bindParent: null
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
const provider = vue.inject(key);
|
|
485
|
+
const { childInstances, collect, clear: clear2 } = provider, parentProvider = __rest(provider, ["childInstances", "collect", "clear"]);
|
|
486
|
+
const childInstance = vue.getCurrentInstance();
|
|
487
|
+
const index = vue.computed(() => childInstances.indexOf(childInstance));
|
|
488
|
+
const bindParent = (childProvider) => {
|
|
489
|
+
vue.onMounted(() => {
|
|
490
|
+
vue.nextTick().then(() => {
|
|
491
|
+
collect(childInstance, childProvider);
|
|
492
|
+
});
|
|
493
|
+
});
|
|
494
|
+
vue.onBeforeUnmount(() => {
|
|
495
|
+
vue.nextTick().then(() => {
|
|
496
|
+
clear2(childInstance, childProvider);
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
return {
|
|
501
|
+
index,
|
|
502
|
+
parentProvider,
|
|
503
|
+
bindParent
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
function flatVNodes$1(subTree) {
|
|
507
|
+
const vNodes = [];
|
|
508
|
+
const flat = (subTree2) => {
|
|
509
|
+
if (subTree2 === null || subTree2 === void 0 ? void 0 : subTree2.component) {
|
|
510
|
+
flat(subTree2 === null || subTree2 === void 0 ? void 0 : subTree2.component.subTree);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
if (Array.isArray(subTree2 === null || subTree2 === void 0 ? void 0 : subTree2.children)) {
|
|
514
|
+
subTree2.children.forEach((child) => {
|
|
515
|
+
if (vue.isVNode(child)) {
|
|
516
|
+
vNodes.push(child);
|
|
517
|
+
flat(child);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
flat(subTree);
|
|
523
|
+
return vNodes;
|
|
524
|
+
}
|
|
525
|
+
function useChildren$1(key) {
|
|
526
|
+
const parentInstance = vue.getCurrentInstance();
|
|
527
|
+
const childInstances = vue.reactive([]);
|
|
528
|
+
const childProviders = [];
|
|
529
|
+
const length = vue.computed(() => childInstances.length);
|
|
530
|
+
const sortInstances = () => {
|
|
531
|
+
const vNodes = flatVNodes$1(parentInstance.subTree);
|
|
532
|
+
childInstances.sort((a, b) => {
|
|
533
|
+
return vNodes.indexOf(a.vnode) - vNodes.indexOf(b.vnode);
|
|
534
|
+
});
|
|
535
|
+
};
|
|
536
|
+
const collect = (childInstance, childProvider) => {
|
|
537
|
+
childInstances.push(childInstance);
|
|
538
|
+
childProviders.push(childProvider);
|
|
539
|
+
sortInstances();
|
|
540
|
+
};
|
|
541
|
+
const clear2 = (childInstance, childProvider) => {
|
|
542
|
+
removeItem(childInstances, childInstance);
|
|
543
|
+
removeItem(childProviders, childProvider);
|
|
544
|
+
};
|
|
545
|
+
const bindChildren = (parentProvider) => {
|
|
546
|
+
vue.provide(key, Object.assign({
|
|
547
|
+
childInstances,
|
|
548
|
+
collect,
|
|
549
|
+
clear: clear2
|
|
550
|
+
}, parentProvider));
|
|
551
|
+
};
|
|
552
|
+
return {
|
|
553
|
+
length,
|
|
554
|
+
childProviders,
|
|
555
|
+
bindChildren
|
|
556
|
+
};
|
|
557
|
+
}
|
|
460
558
|
var _excluded = ["collect", "clear"];
|
|
461
559
|
function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
|
|
462
560
|
try {
|
|
@@ -1209,6 +1307,9 @@ var props$16 = {
|
|
|
1209
1307
|
type: [Number, String],
|
|
1210
1308
|
default: 0
|
|
1211
1309
|
},
|
|
1310
|
+
animationClass: {
|
|
1311
|
+
type: String
|
|
1312
|
+
},
|
|
1212
1313
|
onClick: defineListenerProp()
|
|
1213
1314
|
};
|
|
1214
1315
|
function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -1248,10 +1349,10 @@ function __render__$1e(_ctx, _cache) {
|
|
|
1248
1349
|
return vue.openBlock(), vue.createBlock(
|
|
1249
1350
|
vue.resolveDynamicComponent(_ctx.isURL(_ctx.name) ? "img" : "i"),
|
|
1250
1351
|
{
|
|
1251
|
-
class: vue.normalizeClass(_ctx.classes(_ctx.n(), [_ctx.namespace !== _ctx.n(), _ctx.namespace], _ctx.namespace + "--set", [_ctx.isURL(_ctx.name), _ctx.n("image"), _ctx.namespace + "-" + _ctx.nextName], [_ctx.
|
|
1352
|
+
class: vue.normalizeClass(_ctx.classes(_ctx.n(), [_ctx.namespace !== _ctx.n(), _ctx.namespace], _ctx.namespace + "--set", [_ctx.isURL(_ctx.name), _ctx.n("image"), _ctx.namespace + "-" + _ctx.nextName], [_ctx.animateInProgress, _ctx.animationClass == null ? _ctx.n("--shrinking") : _ctx.animationClass])),
|
|
1252
1353
|
style: vue.normalizeStyle({
|
|
1253
1354
|
color: _ctx.color,
|
|
1254
|
-
transition:
|
|
1355
|
+
"transition-duration": _ctx.toNumber(_ctx.transition) + "ms",
|
|
1255
1356
|
width: _ctx.isURL(_ctx.name) ? _ctx.toSizeUnit(_ctx.size) : null,
|
|
1256
1357
|
height: _ctx.isURL(_ctx.name) ? _ctx.toSizeUnit(_ctx.size) : null,
|
|
1257
1358
|
fontSize: _ctx.toSizeUnit(_ctx.size)
|
|
@@ -1269,7 +1370,7 @@ var __sfc__$1f = vue.defineComponent({
|
|
|
1269
1370
|
props: props$16,
|
|
1270
1371
|
setup(props2) {
|
|
1271
1372
|
var nextName = vue.ref("");
|
|
1272
|
-
var
|
|
1373
|
+
var animateInProgress = vue.ref(false);
|
|
1273
1374
|
var handleNameChange = /* @__PURE__ */ function() {
|
|
1274
1375
|
var _ref = _asyncToGenerator$c(function* (newName, oldName) {
|
|
1275
1376
|
var {
|
|
@@ -1279,11 +1380,13 @@ var __sfc__$1f = vue.defineComponent({
|
|
|
1279
1380
|
nextName.value = newName;
|
|
1280
1381
|
return;
|
|
1281
1382
|
}
|
|
1282
|
-
|
|
1383
|
+
animateInProgress.value = true;
|
|
1283
1384
|
yield vue.nextTick();
|
|
1284
1385
|
setTimeout(() => {
|
|
1285
|
-
oldName != null
|
|
1286
|
-
|
|
1386
|
+
if (oldName != null) {
|
|
1387
|
+
nextName.value = newName;
|
|
1388
|
+
}
|
|
1389
|
+
animateInProgress.value = false;
|
|
1287
1390
|
}, toNumber(transition));
|
|
1288
1391
|
});
|
|
1289
1392
|
return function handleNameChange2(_x, _x2) {
|
|
@@ -1297,7 +1400,7 @@ var __sfc__$1f = vue.defineComponent({
|
|
|
1297
1400
|
n: n$1d,
|
|
1298
1401
|
classes: classes$10,
|
|
1299
1402
|
nextName,
|
|
1300
|
-
|
|
1403
|
+
animateInProgress,
|
|
1301
1404
|
isURL,
|
|
1302
1405
|
toNumber,
|
|
1303
1406
|
toSizeUnit
|
|
@@ -2846,6 +2949,128 @@ function useButtonGroup() {
|
|
|
2846
2949
|
bindButtonGroup: bindParent
|
|
2847
2950
|
};
|
|
2848
2951
|
}
|
|
2952
|
+
function shouldDisabled(arg) {
|
|
2953
|
+
if (!arg) {
|
|
2954
|
+
return false;
|
|
2955
|
+
}
|
|
2956
|
+
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
2957
|
+
if (arg === "desktop" && isMobile) {
|
|
2958
|
+
return true;
|
|
2959
|
+
}
|
|
2960
|
+
if (arg === "mobile" && !isMobile) {
|
|
2961
|
+
return true;
|
|
2962
|
+
}
|
|
2963
|
+
return false;
|
|
2964
|
+
}
|
|
2965
|
+
function getStyle(element) {
|
|
2966
|
+
var style = element.getAttribute("style");
|
|
2967
|
+
if (!style)
|
|
2968
|
+
return {};
|
|
2969
|
+
return style.split(";").filter(Boolean).reduce((style2, item) => {
|
|
2970
|
+
var [key, value] = item.split(":").map((item2) => item2.trim());
|
|
2971
|
+
style2[camelize(key)] = value;
|
|
2972
|
+
return style2;
|
|
2973
|
+
}, {});
|
|
2974
|
+
}
|
|
2975
|
+
function updateRawStyle(element) {
|
|
2976
|
+
var {
|
|
2977
|
+
value
|
|
2978
|
+
} = element._hover;
|
|
2979
|
+
var style = getStyle(element);
|
|
2980
|
+
Object.keys(value).forEach((key) => {
|
|
2981
|
+
var camelizedKey = camelize(key);
|
|
2982
|
+
var styleValue = value[camelizedKey];
|
|
2983
|
+
if (styleValue != null && style[camelizedKey]) {
|
|
2984
|
+
element._hover.rawStyle[camelizedKey] = style[camelizedKey];
|
|
2985
|
+
}
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
function updateStyle(element, styleValue) {
|
|
2989
|
+
Object.keys(styleValue).forEach((key) => {
|
|
2990
|
+
var value = styleValue[key];
|
|
2991
|
+
if (value != null) {
|
|
2992
|
+
element.style[key] = value;
|
|
2993
|
+
}
|
|
2994
|
+
});
|
|
2995
|
+
}
|
|
2996
|
+
function clearStyle(element) {
|
|
2997
|
+
Object.keys(element._hover.value).forEach((key) => {
|
|
2998
|
+
element.style[key] = "";
|
|
2999
|
+
});
|
|
3000
|
+
}
|
|
3001
|
+
function restoreStyle(element) {
|
|
3002
|
+
clearStyle(element);
|
|
3003
|
+
updateStyle(element, element._hover.rawStyle);
|
|
3004
|
+
element._hover.rawStyle = {};
|
|
3005
|
+
}
|
|
3006
|
+
function createHover() {
|
|
3007
|
+
var {
|
|
3008
|
+
value
|
|
3009
|
+
} = this._hover;
|
|
3010
|
+
this._hover.hovering = true;
|
|
3011
|
+
if (isFunction(value)) {
|
|
3012
|
+
value(this._hover.hovering);
|
|
3013
|
+
return;
|
|
3014
|
+
}
|
|
3015
|
+
updateStyle(this, value);
|
|
3016
|
+
}
|
|
3017
|
+
function removeHover() {
|
|
3018
|
+
this._hover.hovering = false;
|
|
3019
|
+
if (isFunction(this._hover.value)) {
|
|
3020
|
+
this._hover.value(this._hover.hovering);
|
|
3021
|
+
return;
|
|
3022
|
+
}
|
|
3023
|
+
restoreStyle(this);
|
|
3024
|
+
}
|
|
3025
|
+
function mounted(element, binding) {
|
|
3026
|
+
var _element$_hover$hover, _element$_hover;
|
|
3027
|
+
var {
|
|
3028
|
+
arg,
|
|
3029
|
+
value
|
|
3030
|
+
} = binding;
|
|
3031
|
+
if (shouldDisabled(arg)) {
|
|
3032
|
+
return;
|
|
3033
|
+
}
|
|
3034
|
+
element._hover = {
|
|
3035
|
+
value,
|
|
3036
|
+
hovering: (_element$_hover$hover = (_element$_hover = element._hover) == null ? void 0 : _element$_hover.hovering) != null ? _element$_hover$hover : false,
|
|
3037
|
+
rawStyle: {}
|
|
3038
|
+
};
|
|
3039
|
+
updateRawStyle(element);
|
|
3040
|
+
element.addEventListener("mouseenter", createHover);
|
|
3041
|
+
element.addEventListener("mouseleave", removeHover);
|
|
3042
|
+
}
|
|
3043
|
+
function unmounted(element, binding) {
|
|
3044
|
+
if (shouldDisabled(binding.arg)) {
|
|
3045
|
+
return;
|
|
3046
|
+
}
|
|
3047
|
+
restoreStyle(element);
|
|
3048
|
+
element.removeEventListener("mouseenter", createHover);
|
|
3049
|
+
element.removeEventListener("mouseleave", removeHover);
|
|
3050
|
+
}
|
|
3051
|
+
function beforeUpdate(element, binding) {
|
|
3052
|
+
unmounted(element, binding);
|
|
3053
|
+
}
|
|
3054
|
+
function shouldUpdateStyle(element, binding) {
|
|
3055
|
+
return !isFunction(binding.value) && element._hover.hovering;
|
|
3056
|
+
}
|
|
3057
|
+
function updated(element, binding) {
|
|
3058
|
+
mounted(element, binding);
|
|
3059
|
+
if (shouldUpdateStyle(element, binding)) {
|
|
3060
|
+
updateStyle(element, binding.value);
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
var Hover = {
|
|
3064
|
+
mounted,
|
|
3065
|
+
unmounted,
|
|
3066
|
+
beforeUpdate,
|
|
3067
|
+
updated,
|
|
3068
|
+
install(app) {
|
|
3069
|
+
app.directive("hover", this);
|
|
3070
|
+
}
|
|
3071
|
+
};
|
|
3072
|
+
var _HoverComponent = Hover;
|
|
3073
|
+
const Hover$1 = Hover;
|
|
2849
3074
|
var {
|
|
2850
3075
|
n: n$17,
|
|
2851
3076
|
classes: classes$W
|
|
@@ -2854,6 +3079,7 @@ var _hoisted_1$p = ["type", "disabled"];
|
|
|
2854
3079
|
function __render__$18(_ctx, _cache) {
|
|
2855
3080
|
var _component_var_loading = vue.resolveComponent("var-loading");
|
|
2856
3081
|
var _directive_ripple = vue.resolveDirective("ripple");
|
|
3082
|
+
var _directive_hover = vue.resolveDirective("hover");
|
|
2857
3083
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock(
|
|
2858
3084
|
"button",
|
|
2859
3085
|
{
|
|
@@ -2893,12 +3119,20 @@ function __render__$18(_ctx, _cache) {
|
|
|
2893
3119
|
[vue.renderSlot(_ctx.$slots, "default")],
|
|
2894
3120
|
2
|
|
2895
3121
|
/* CLASS */
|
|
3122
|
+
), vue.createElementVNode(
|
|
3123
|
+
"div",
|
|
3124
|
+
{
|
|
3125
|
+
class: vue.normalizeClass(_ctx.classes(_ctx.n("overlay"), [_ctx.hovering, _ctx.n("--hovering")]))
|
|
3126
|
+
},
|
|
3127
|
+
null,
|
|
3128
|
+
2
|
|
3129
|
+
/* CLASS */
|
|
2896
3130
|
)],
|
|
2897
3131
|
46,
|
|
2898
3132
|
_hoisted_1$p
|
|
2899
3133
|
)), [[_directive_ripple, {
|
|
2900
3134
|
disabled: _ctx.disabled || !_ctx.ripple
|
|
2901
|
-
}]]);
|
|
3135
|
+
}], [_directive_hover, _ctx.handleHover, "desktop"]]);
|
|
2902
3136
|
}
|
|
2903
3137
|
var __sfc__$19 = vue.defineComponent({
|
|
2904
3138
|
name: "VarButton",
|
|
@@ -2906,11 +3140,13 @@ var __sfc__$19 = vue.defineComponent({
|
|
|
2906
3140
|
VarLoading: Loading
|
|
2907
3141
|
},
|
|
2908
3142
|
directives: {
|
|
2909
|
-
Ripple: Ripple$1
|
|
3143
|
+
Ripple: Ripple$1,
|
|
3144
|
+
Hover: Hover$1
|
|
2910
3145
|
},
|
|
2911
3146
|
props: props$10,
|
|
2912
3147
|
setup(props2) {
|
|
2913
3148
|
var pending = vue.ref(false);
|
|
3149
|
+
var hovering = vue.ref(false);
|
|
2914
3150
|
var {
|
|
2915
3151
|
buttonGroup: buttonGroup2
|
|
2916
3152
|
} = useButtonGroup();
|
|
@@ -2976,11 +3212,16 @@ var __sfc__$19 = vue.defineComponent({
|
|
|
2976
3212
|
}
|
|
2977
3213
|
attemptAutoLoading(call(onTouchstart, e));
|
|
2978
3214
|
};
|
|
3215
|
+
var handleHover = (isHover) => {
|
|
3216
|
+
hovering.value = isHover;
|
|
3217
|
+
};
|
|
2979
3218
|
return {
|
|
2980
3219
|
n: n$17,
|
|
2981
3220
|
classes: classes$W,
|
|
2982
3221
|
pending,
|
|
2983
3222
|
states,
|
|
3223
|
+
hovering,
|
|
3224
|
+
handleHover,
|
|
2984
3225
|
handleClick,
|
|
2985
3226
|
handleTouchstart
|
|
2986
3227
|
};
|
|
@@ -3718,15 +3959,12 @@ var props$X = {
|
|
|
3718
3959
|
onClick: defineListenerProp()
|
|
3719
3960
|
};
|
|
3720
3961
|
var BREADCRUMBS_BIND_BREADCRUMB_ITEM_KEY = Symbol("BREADCRUMBS_BIND_BREADCRUMB_KEY");
|
|
3721
|
-
var BREADCRUMBS_COUNT_BREADCRUMB_ITEM_KEY = Symbol("BREADCRUMBS_COUNT_BREADCRUMB_KEY");
|
|
3722
3962
|
function useBreadcrumbsList() {
|
|
3723
3963
|
var {
|
|
3724
3964
|
childProviders,
|
|
3725
|
-
bindChildren
|
|
3726
|
-
} = useChildren(BREADCRUMBS_BIND_BREADCRUMB_ITEM_KEY);
|
|
3727
|
-
var {
|
|
3965
|
+
bindChildren,
|
|
3728
3966
|
length
|
|
3729
|
-
} =
|
|
3967
|
+
} = useChildren$1(BREADCRUMBS_BIND_BREADCRUMB_ITEM_KEY);
|
|
3730
3968
|
return {
|
|
3731
3969
|
length,
|
|
3732
3970
|
breadcrumbList: childProviders,
|
|
@@ -3736,11 +3974,9 @@ function useBreadcrumbsList() {
|
|
|
3736
3974
|
function useBreadcrumb() {
|
|
3737
3975
|
var {
|
|
3738
3976
|
parentProvider,
|
|
3739
|
-
bindParent
|
|
3740
|
-
} = useParent(BREADCRUMBS_BIND_BREADCRUMB_ITEM_KEY);
|
|
3741
|
-
var {
|
|
3977
|
+
bindParent,
|
|
3742
3978
|
index
|
|
3743
|
-
} =
|
|
3979
|
+
} = useParent$1(BREADCRUMBS_BIND_BREADCRUMB_ITEM_KEY);
|
|
3744
3980
|
if (!parentProvider || !bindParent || !index) {
|
|
3745
3981
|
throw Error("<var-breadcrumb/> must in <var-breadcrumbs/>");
|
|
3746
3982
|
}
|
|
@@ -13333,128 +13569,6 @@ Form.install = function(app) {
|
|
|
13333
13569
|
Form.useValidation = useValidation;
|
|
13334
13570
|
Form.useForm = useForm;
|
|
13335
13571
|
var _FormComponent = Form;
|
|
13336
|
-
function shouldDisabled(arg) {
|
|
13337
|
-
if (!arg) {
|
|
13338
|
-
return false;
|
|
13339
|
-
}
|
|
13340
|
-
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
13341
|
-
if (arg === "desktop" && isMobile) {
|
|
13342
|
-
return true;
|
|
13343
|
-
}
|
|
13344
|
-
if (arg === "mobile" && !isMobile) {
|
|
13345
|
-
return true;
|
|
13346
|
-
}
|
|
13347
|
-
return false;
|
|
13348
|
-
}
|
|
13349
|
-
function getStyle(element) {
|
|
13350
|
-
var style = element.getAttribute("style");
|
|
13351
|
-
if (!style)
|
|
13352
|
-
return {};
|
|
13353
|
-
return style.split(";").filter(Boolean).reduce((style2, item) => {
|
|
13354
|
-
var [key, value] = item.split(":").map((item2) => item2.trim());
|
|
13355
|
-
style2[camelize(key)] = value;
|
|
13356
|
-
return style2;
|
|
13357
|
-
}, {});
|
|
13358
|
-
}
|
|
13359
|
-
function updateRawStyle(element) {
|
|
13360
|
-
var {
|
|
13361
|
-
value
|
|
13362
|
-
} = element._hover;
|
|
13363
|
-
var style = getStyle(element);
|
|
13364
|
-
Object.keys(value).forEach((key) => {
|
|
13365
|
-
var camelizedKey = camelize(key);
|
|
13366
|
-
var styleValue = value[camelizedKey];
|
|
13367
|
-
if (styleValue != null && style[camelizedKey]) {
|
|
13368
|
-
element._hover.rawStyle[camelizedKey] = style[camelizedKey];
|
|
13369
|
-
}
|
|
13370
|
-
});
|
|
13371
|
-
}
|
|
13372
|
-
function updateStyle(element, styleValue) {
|
|
13373
|
-
Object.keys(styleValue).forEach((key) => {
|
|
13374
|
-
var value = styleValue[key];
|
|
13375
|
-
if (value != null) {
|
|
13376
|
-
element.style[key] = value;
|
|
13377
|
-
}
|
|
13378
|
-
});
|
|
13379
|
-
}
|
|
13380
|
-
function clearStyle(element) {
|
|
13381
|
-
Object.keys(element._hover.value).forEach((key) => {
|
|
13382
|
-
element.style[key] = "";
|
|
13383
|
-
});
|
|
13384
|
-
}
|
|
13385
|
-
function restoreStyle(element) {
|
|
13386
|
-
clearStyle(element);
|
|
13387
|
-
updateStyle(element, element._hover.rawStyle);
|
|
13388
|
-
element._hover.rawStyle = {};
|
|
13389
|
-
}
|
|
13390
|
-
function createHover() {
|
|
13391
|
-
var {
|
|
13392
|
-
value
|
|
13393
|
-
} = this._hover;
|
|
13394
|
-
this._hover.hovering = true;
|
|
13395
|
-
if (isFunction(value)) {
|
|
13396
|
-
value(this._hover.hovering);
|
|
13397
|
-
return;
|
|
13398
|
-
}
|
|
13399
|
-
updateStyle(this, value);
|
|
13400
|
-
}
|
|
13401
|
-
function removeHover() {
|
|
13402
|
-
this._hover.hovering = false;
|
|
13403
|
-
if (isFunction(this._hover.value)) {
|
|
13404
|
-
this._hover.value(this._hover.hovering);
|
|
13405
|
-
return;
|
|
13406
|
-
}
|
|
13407
|
-
restoreStyle(this);
|
|
13408
|
-
}
|
|
13409
|
-
function mounted(element, binding) {
|
|
13410
|
-
var _element$_hover$hover, _element$_hover;
|
|
13411
|
-
var {
|
|
13412
|
-
arg,
|
|
13413
|
-
value
|
|
13414
|
-
} = binding;
|
|
13415
|
-
if (shouldDisabled(arg)) {
|
|
13416
|
-
return;
|
|
13417
|
-
}
|
|
13418
|
-
element._hover = {
|
|
13419
|
-
value,
|
|
13420
|
-
hovering: (_element$_hover$hover = (_element$_hover = element._hover) == null ? void 0 : _element$_hover.hovering) != null ? _element$_hover$hover : false,
|
|
13421
|
-
rawStyle: {}
|
|
13422
|
-
};
|
|
13423
|
-
updateRawStyle(element);
|
|
13424
|
-
element.addEventListener("mouseenter", createHover);
|
|
13425
|
-
element.addEventListener("mouseleave", removeHover);
|
|
13426
|
-
}
|
|
13427
|
-
function unmounted(element, binding) {
|
|
13428
|
-
if (shouldDisabled(binding.arg)) {
|
|
13429
|
-
return;
|
|
13430
|
-
}
|
|
13431
|
-
restoreStyle(element);
|
|
13432
|
-
element.removeEventListener("mouseenter", createHover);
|
|
13433
|
-
element.removeEventListener("mouseleave", removeHover);
|
|
13434
|
-
}
|
|
13435
|
-
function beforeUpdate(element, binding) {
|
|
13436
|
-
unmounted(element, binding);
|
|
13437
|
-
}
|
|
13438
|
-
function shouldUpdateStyle(element, binding) {
|
|
13439
|
-
return !isFunction(binding.value) && element._hover.hovering;
|
|
13440
|
-
}
|
|
13441
|
-
function updated(element, binding) {
|
|
13442
|
-
mounted(element, binding);
|
|
13443
|
-
if (shouldUpdateStyle(element, binding)) {
|
|
13444
|
-
updateStyle(element, binding.value);
|
|
13445
|
-
}
|
|
13446
|
-
}
|
|
13447
|
-
var Hover = {
|
|
13448
|
-
mounted,
|
|
13449
|
-
unmounted,
|
|
13450
|
-
beforeUpdate,
|
|
13451
|
-
updated,
|
|
13452
|
-
install(app) {
|
|
13453
|
-
app.directive("hover", this);
|
|
13454
|
-
}
|
|
13455
|
-
};
|
|
13456
|
-
var _HoverComponent = Hover;
|
|
13457
|
-
const Hover$1 = Hover;
|
|
13458
13572
|
function fitValidator(fit) {
|
|
13459
13573
|
return ["fill", "contain", "cover", "none", "scale-down"].includes(fit);
|
|
13460
13574
|
}
|
|
@@ -21948,15 +22062,12 @@ var props$6 = {
|
|
|
21948
22062
|
onClick: defineListenerProp()
|
|
21949
22063
|
};
|
|
21950
22064
|
var TABS_BIND_TAB_KEY = Symbol("TABS_BIND_TAB_KEY");
|
|
21951
|
-
var TABS_COUNT_TAB_KEY = Symbol("TABS_COUNT_TAB_KEY");
|
|
21952
22065
|
function useTabList() {
|
|
21953
22066
|
var {
|
|
21954
22067
|
childProviders,
|
|
21955
|
-
bindChildren
|
|
21956
|
-
} = useChildren(TABS_BIND_TAB_KEY);
|
|
21957
|
-
var {
|
|
22068
|
+
bindChildren,
|
|
21958
22069
|
length
|
|
21959
|
-
} =
|
|
22070
|
+
} = useChildren$1(TABS_BIND_TAB_KEY);
|
|
21960
22071
|
return {
|
|
21961
22072
|
length,
|
|
21962
22073
|
tabList: childProviders,
|
|
@@ -21966,11 +22077,9 @@ function useTabList() {
|
|
|
21966
22077
|
function useTabs() {
|
|
21967
22078
|
var {
|
|
21968
22079
|
parentProvider,
|
|
21969
|
-
bindParent
|
|
21970
|
-
} = useParent(TABS_BIND_TAB_KEY);
|
|
21971
|
-
var {
|
|
22080
|
+
bindParent,
|
|
21972
22081
|
index
|
|
21973
|
-
} =
|
|
22082
|
+
} = useParent$1(TABS_BIND_TAB_KEY);
|
|
21974
22083
|
if (!parentProvider || !bindParent || !index) {
|
|
21975
22084
|
throw Error("<var-tab/> must in <var-tabs/>");
|
|
21976
22085
|
}
|
|
@@ -22086,15 +22195,12 @@ Tab.install = function(app) {
|
|
|
22086
22195
|
};
|
|
22087
22196
|
var _TabComponent = Tab;
|
|
22088
22197
|
var TABS_ITEMS_BIND_TAB_ITEM_KEY = Symbol("TABS_ITEMS_BIND_TAB_ITEM_KEY");
|
|
22089
|
-
var TABS_ITEMS_COUNT_TAB_ITEM_KEY = Symbol("TABS_ITEMS_COUNT_TAB_ITEM_KEY");
|
|
22090
22198
|
function useTabItem() {
|
|
22091
22199
|
var {
|
|
22092
22200
|
bindChildren,
|
|
22093
|
-
childProviders
|
|
22094
|
-
} = useChildren(TABS_ITEMS_BIND_TAB_ITEM_KEY);
|
|
22095
|
-
var {
|
|
22201
|
+
childProviders,
|
|
22096
22202
|
length
|
|
22097
|
-
} =
|
|
22203
|
+
} = useChildren$1(TABS_ITEMS_BIND_TAB_ITEM_KEY);
|
|
22098
22204
|
return {
|
|
22099
22205
|
length,
|
|
22100
22206
|
tabItemList: childProviders,
|
|
@@ -22104,11 +22210,9 @@ function useTabItem() {
|
|
|
22104
22210
|
function useTabsItems() {
|
|
22105
22211
|
var {
|
|
22106
22212
|
parentProvider,
|
|
22107
|
-
bindParent
|
|
22108
|
-
} = useParent(TABS_ITEMS_BIND_TAB_ITEM_KEY);
|
|
22109
|
-
var {
|
|
22213
|
+
bindParent,
|
|
22110
22214
|
index
|
|
22111
|
-
} =
|
|
22215
|
+
} = useParent$1(TABS_ITEMS_BIND_TAB_ITEM_KEY);
|
|
22112
22216
|
if (!parentProvider || !bindParent || !index) {
|
|
22113
22217
|
throw Error("<var-tab-item/> must in <var-tabs-items/>");
|
|
22114
22218
|
}
|
|
@@ -24519,7 +24623,7 @@ const TimePickerSfc = "";
|
|
|
24519
24623
|
const TooltipSfc = "";
|
|
24520
24624
|
const uploader = "";
|
|
24521
24625
|
const UploaderSfc = "";
|
|
24522
|
-
const version = "2.8.
|
|
24626
|
+
const version = "2.8.7-alpha.1678160786574";
|
|
24523
24627
|
function install(app) {
|
|
24524
24628
|
ActionSheet.install && app.use(ActionSheet);
|
|
24525
24629
|
AppBar.install && app.use(AppBar);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.7-alpha.1678160786574",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"main": "lib/varlet.cjs.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@popperjs/core": "^2.11.6",
|
|
47
47
|
"dayjs": "^1.10.4",
|
|
48
48
|
"decimal.js": "^10.2.1",
|
|
49
|
-
"@varlet/icons": "2.8.
|
|
50
|
-
"@varlet/
|
|
51
|
-
"@varlet/
|
|
49
|
+
"@varlet/icons": "2.8.7-alpha.1678160786574",
|
|
50
|
+
"@varlet/shared": "2.8.7-alpha.1678160786574",
|
|
51
|
+
"@varlet/use": "2.8.7-alpha.1678160786574"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/jest": "^26.0.15",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"typescript": "^4.4.4",
|
|
64
64
|
"vue": "3.2.25",
|
|
65
65
|
"vue-router": "4.0.12",
|
|
66
|
-
"@varlet/cli": "2.8.
|
|
67
|
-
"@varlet/touch-emulator": "2.8.
|
|
66
|
+
"@varlet/cli": "2.8.7-alpha.1678160786574",
|
|
67
|
+
"@varlet/touch-emulator": "2.8.7-alpha.1678160786574"
|
|
68
68
|
},
|
|
69
69
|
"browserslist": [
|
|
70
70
|
"Chrome >= 54",
|