@varlet/ui 1.26.1 → 1.26.4
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/badge/Badge.js +1 -1
- package/es/checkbox/Checkbox.js +6 -1
- package/es/checkbox-group/CheckboxGroup.js +7 -1
- package/es/date-picker/DatePicker.js +4 -3
- package/es/date-picker/src/day-picker-panel.js +1 -1
- package/es/date-picker/src/month-picker-panel.js +1 -1
- package/es/date-picker/src/panel-header.js +1 -1
- package/es/divider/Divider.js +1 -1
- package/es/image-preview/ImagePreview.js +3 -2
- package/es/menu/Menu.js +1 -1
- package/es/rate/Rate.js +2 -1
- package/es/rate/props.js +3 -0
- package/es/ripple/index.js +1 -3
- package/es/ripple/ripple.css +1 -1
- package/es/ripple/ripple.less +3 -0
- package/es/space/Space.js +21 -2
- package/es/style.css +1 -1
- package/es/varlet.esm.js +47 -17
- package/highlight/attributes.json +4 -0
- package/highlight/tags.json +1 -0
- package/highlight/web-types.json +10 -1
- package/lib/badge/Badge.js +1 -1
- package/lib/checkbox/Checkbox.js +6 -1
- package/lib/checkbox-group/CheckboxGroup.js +7 -1
- package/lib/date-picker/DatePicker.js +4 -3
- package/lib/date-picker/src/day-picker-panel.js +1 -1
- package/lib/date-picker/src/month-picker-panel.js +1 -1
- package/lib/date-picker/src/panel-header.js +1 -1
- package/lib/divider/Divider.js +1 -1
- package/lib/image-preview/ImagePreview.js +3 -2
- package/lib/menu/Menu.js +1 -1
- package/lib/rate/Rate.js +2 -1
- package/lib/rate/props.js +3 -0
- package/lib/ripple/index.js +1 -3
- package/lib/ripple/ripple.css +1 -1
- package/lib/ripple/ripple.less +3 -0
- package/lib/space/Space.js +20 -1
- package/lib/style.css +1 -1
- package/package.json +4 -4
- package/types/radioGroup.d.ts +3 -3
- package/types/rate.d.ts +1 -0
- package/umd/varlet.js +4 -4
package/es/varlet.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive, getCurrentInstance, watch, onBeforeMount, onUnmounted, onActivated, onDeactivated, ref, onMounted, provide, computed, inject, nextTick, createApp, onBeforeUnmount, h, isVNode, defineComponent, createVNode, Teleport, Transition, withDirectives, mergeProps, vShow, openBlock, createBlock, resolveDynamicComponent, normalizeClass, normalizeStyle, resolveComponent, resolveDirective, withCtx, createElementVNode, renderSlot, toDisplayString, createElementBlock, Fragment, renderList, createCommentVNode, onUpdated, createTextVNode, pushScopeId, popScopeId, withModifiers, normalizeProps, guardReactiveProps, vModelText, toRefs, withKeys, toRaw, TransitionGroup } from "vue";
|
|
1
|
+
import { reactive, getCurrentInstance, watch, onBeforeMount, onUnmounted, onActivated, onDeactivated, ref, onMounted, provide, computed, inject, nextTick, createApp, onBeforeUnmount, h, isVNode, defineComponent, createVNode, Teleport, Transition, withDirectives, mergeProps, vShow, openBlock, createBlock, resolveDynamicComponent, normalizeClass, normalizeStyle, resolveComponent, resolveDirective, withCtx, createElementVNode, renderSlot, toDisplayString, createElementBlock, Fragment, renderList, createCommentVNode, onUpdated, createTextVNode, pushScopeId, popScopeId, withModifiers, normalizeProps, guardReactiveProps, vModelText, toRefs, withKeys, toRaw, TransitionGroup, Comment } from "vue";
|
|
2
2
|
var context = {
|
|
3
3
|
locks: {},
|
|
4
4
|
zIndex: 2e3,
|
|
@@ -64,7 +64,6 @@ function createRipple(event) {
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
var task = () => {
|
|
67
|
-
var _ripple$color;
|
|
68
67
|
_ripple.tasker = null;
|
|
69
68
|
var {
|
|
70
69
|
x,
|
|
@@ -79,7 +78,7 @@ function createRipple(event) {
|
|
|
79
78
|
ripple2.style.transform = "translate(" + x + "px, " + y + "px) scale3d(.3, .3, .3)";
|
|
80
79
|
ripple2.style.width = size + "px";
|
|
81
80
|
ripple2.style.height = size + "px";
|
|
82
|
-
ripple2.style.backgroundColor =
|
|
81
|
+
_ripple.color && (ripple2.style.backgroundColor = _ripple.color);
|
|
83
82
|
ripple2.dataset.createdAt = String(performance.now());
|
|
84
83
|
setStyles(this);
|
|
85
84
|
this.appendChild(ripple2);
|
|
@@ -2029,7 +2028,7 @@ var Badge = defineComponent({
|
|
|
2029
2028
|
dot,
|
|
2030
2029
|
icon: icon2
|
|
2031
2030
|
} = props2;
|
|
2032
|
-
var positionBasic =
|
|
2031
|
+
var positionBasic = slots.default && "var-badge__position var-badge--" + position;
|
|
2033
2032
|
var dotClass = dot && "var-badge__dot";
|
|
2034
2033
|
var positionClass = getPositionClass();
|
|
2035
2034
|
var iconClass = icon2 && "var-badge__icon";
|
|
@@ -2476,6 +2475,9 @@ var Checkbox = defineComponent({
|
|
|
2476
2475
|
} = props2;
|
|
2477
2476
|
value.value = values.includes(checkedValue2) ? checkedValue2 : uncheckedValue;
|
|
2478
2477
|
};
|
|
2478
|
+
var resetWithAnimation = () => {
|
|
2479
|
+
withAnimation.value = false;
|
|
2480
|
+
};
|
|
2479
2481
|
var reset = () => {
|
|
2480
2482
|
var _props$onUpdateModel2;
|
|
2481
2483
|
(_props$onUpdateModel2 = props2["onUpdate:modelValue"]) == null ? void 0 : _props$onUpdateModel2.call(props2, props2.uncheckedValue);
|
|
@@ -2504,7 +2506,8 @@ var Checkbox = defineComponent({
|
|
|
2504
2506
|
sync,
|
|
2505
2507
|
validate,
|
|
2506
2508
|
resetValidation,
|
|
2507
|
-
reset
|
|
2509
|
+
reset,
|
|
2510
|
+
resetWithAnimation
|
|
2508
2511
|
};
|
|
2509
2512
|
bindCheckboxGroup == null ? void 0 : bindCheckboxGroup(checkboxProvider);
|
|
2510
2513
|
bindForm == null ? void 0 : bindForm(checkboxProvider);
|
|
@@ -2631,6 +2634,9 @@ var CheckboxGroup = defineComponent({
|
|
|
2631
2634
|
} = _ref;
|
|
2632
2635
|
return sync(props2.modelValue);
|
|
2633
2636
|
});
|
|
2637
|
+
var resetWithAnimation = () => {
|
|
2638
|
+
checkboxes.forEach((checkbox2) => checkbox2.resetWithAnimation());
|
|
2639
|
+
};
|
|
2634
2640
|
var checkAll2 = () => {
|
|
2635
2641
|
var _props$onUpdateModel2;
|
|
2636
2642
|
var checkedValues = checkboxes.map((_ref2) => {
|
|
@@ -2640,6 +2646,7 @@ var CheckboxGroup = defineComponent({
|
|
|
2640
2646
|
return checkedValue.value;
|
|
2641
2647
|
});
|
|
2642
2648
|
var changedModelValue = uniq(checkedValues);
|
|
2649
|
+
resetWithAnimation();
|
|
2643
2650
|
(_props$onUpdateModel2 = props2["onUpdate:modelValue"]) == null ? void 0 : _props$onUpdateModel2.call(props2, changedModelValue);
|
|
2644
2651
|
return changedModelValue;
|
|
2645
2652
|
};
|
|
@@ -2657,6 +2664,7 @@ var CheckboxGroup = defineComponent({
|
|
|
2657
2664
|
return checkedValue.value;
|
|
2658
2665
|
});
|
|
2659
2666
|
var changedModelValue = uniq(checkedValues);
|
|
2667
|
+
resetWithAnimation();
|
|
2660
2668
|
(_props$onUpdateModel3 = props2["onUpdate:modelValue"]) == null ? void 0 : _props$onUpdateModel3.call(props2, changedModelValue);
|
|
2661
2669
|
return changedModelValue;
|
|
2662
2670
|
};
|
|
@@ -6545,7 +6553,7 @@ function render$F(_ctx, _cache) {
|
|
|
6545
6553
|
class: "var-picker-header__value",
|
|
6546
6554
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("check-panel"))
|
|
6547
6555
|
}, [createVNode(Transition, {
|
|
6548
|
-
name: _ctx.reverse ? "
|
|
6556
|
+
name: "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatex"
|
|
6549
6557
|
}, {
|
|
6550
6558
|
default: withCtx(() => [(openBlock(), createElementBlock("div", {
|
|
6551
6559
|
key: _ctx.showDate
|
|
@@ -6656,7 +6664,7 @@ function render$E(_ctx, _cache) {
|
|
|
6656
6664
|
onCheckPanel: _ctx.clickYear,
|
|
6657
6665
|
onCheckDate: _ctx.checkDate
|
|
6658
6666
|
}, null, 8, ["date", "disabled", "onCheckPanel", "onCheckDate"]), createVNode(Transition, {
|
|
6659
|
-
name: _ctx.reverse ? "
|
|
6667
|
+
name: "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatex"
|
|
6660
6668
|
}, {
|
|
6661
6669
|
default: withCtx(() => [(openBlock(), createElementBlock("ul", {
|
|
6662
6670
|
key: _ctx.panelKey
|
|
@@ -6988,7 +6996,7 @@ function render$C(_ctx, _cache) {
|
|
|
6988
6996
|
onCheckPanel: _ctx.clickMonth,
|
|
6989
6997
|
onCheckDate: _ctx.checkDate
|
|
6990
6998
|
}, null, 8, ["date", "disabled", "onCheckPanel", "onCheckDate"]), createVNode(Transition, {
|
|
6991
|
-
name: _ctx.reverse ? "
|
|
6999
|
+
name: "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatex"
|
|
6992
7000
|
}, {
|
|
6993
7001
|
default: withCtx(() => [(openBlock(), createElementBlock("div", {
|
|
6994
7002
|
key: _ctx.panelKey
|
|
@@ -7272,7 +7280,7 @@ function render$B(_ctx, _cache) {
|
|
|
7272
7280
|
class: normalizeClass(["var-date-picker-title__date", [!_ctx.isYearPanel ? "var-date-picker-title__date--active" : null, _ctx.range ? "var-date-picker-title__date--range" : null]]),
|
|
7273
7281
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.clickEl("date"))
|
|
7274
7282
|
}, [createVNode(Transition, {
|
|
7275
|
-
name: _ctx.multiple ? "" : _ctx.reverse ? "
|
|
7283
|
+
name: _ctx.multiple ? "" : "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatey"
|
|
7276
7284
|
}, {
|
|
7277
7285
|
default: withCtx(() => {
|
|
7278
7286
|
var _ctx$chooseMonth, _ctx$chooseMonth2, _ctx$chooseMonth3;
|
|
@@ -7420,13 +7428,14 @@ var DatePicker = defineComponent({
|
|
|
7420
7428
|
return weekName.slice(0, 3) + ", " + monthName.slice(0, 3) + " " + chooseDay.value;
|
|
7421
7429
|
});
|
|
7422
7430
|
var slotProps = computed(() => {
|
|
7423
|
-
var _chooseMonth$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2
|
|
7431
|
+
var _chooseMonth$value, _chooseDay$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2;
|
|
7424
7432
|
var weekIndex = dayjs(chooseYear.value + "-" + ((_chooseMonth$value = chooseMonth.value) == null ? void 0 : _chooseMonth$value.index) + "-" + chooseDay.value).day();
|
|
7433
|
+
var date = chooseDay.value ? (_chooseDay$value = chooseDay.value) == null ? void 0 : _chooseDay$value.padStart(2, "0") : "";
|
|
7425
7434
|
return {
|
|
7426
7435
|
week: "" + weekIndex,
|
|
7427
7436
|
year: (_chooseYear$value = chooseYear.value) != null ? _chooseYear$value : "",
|
|
7428
7437
|
month: (_chooseMonth$value$in = (_chooseMonth$value2 = chooseMonth.value) == null ? void 0 : _chooseMonth$value2.index) != null ? _chooseMonth$value$in : "",
|
|
7429
|
-
date
|
|
7438
|
+
date
|
|
7430
7439
|
};
|
|
7431
7440
|
});
|
|
7432
7441
|
var formatRange = computed(() => getChoose.value.chooseRangeDay.map((choose) => dayjs(choose).format("YYYY-MM-DD")));
|
|
@@ -8016,7 +8025,7 @@ var Divider = defineComponent({
|
|
|
8016
8025
|
});
|
|
8017
8026
|
});
|
|
8018
8027
|
var checkHasText = () => {
|
|
8019
|
-
state.withText = Boolean(slots.default
|
|
8028
|
+
state.withText = Boolean(slots.default) || Boolean(props2.description);
|
|
8020
8029
|
};
|
|
8021
8030
|
onMounted(() => {
|
|
8022
8031
|
checkHasText();
|
|
@@ -9038,6 +9047,7 @@ var props$t = _extends$3({
|
|
|
9038
9047
|
]));
|
|
9039
9048
|
var DISTANCE_OFFSET = 12;
|
|
9040
9049
|
var EVENT_DELAY = 200;
|
|
9050
|
+
var TAP_DELAY = 350;
|
|
9041
9051
|
var ANIMATION_DURATION = 200;
|
|
9042
9052
|
var _hoisted_1$k = ["src", "alt"];
|
|
9043
9053
|
var _hoisted_2$f = {
|
|
@@ -9196,10 +9206,10 @@ var VarImagePreview = defineComponent({
|
|
|
9196
9206
|
return getDistance(prevTouch, currentTouch) <= DISTANCE_OFFSET && currentTouch.timestamp - prevTouch.timestamp <= EVENT_DELAY && prevTouch.target === currentTouch.target;
|
|
9197
9207
|
};
|
|
9198
9208
|
var isTapTouch = (target) => {
|
|
9199
|
-
if (!startTouch || !prevTouch) {
|
|
9209
|
+
if (!target || !startTouch || !prevTouch) {
|
|
9200
9210
|
return false;
|
|
9201
9211
|
}
|
|
9202
|
-
return getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET && (target === startTouch.target || target.parentNode === startTouch.target);
|
|
9212
|
+
return getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET && Date.now() - prevTouch.timestamp < TAP_DELAY && (target === startTouch.target || target.parentNode === startTouch.target);
|
|
9203
9213
|
};
|
|
9204
9214
|
var handleTouchend = (event) => {
|
|
9205
9215
|
checker = window.setTimeout(() => {
|
|
@@ -10518,7 +10528,7 @@ var Menu = defineComponent({
|
|
|
10518
10528
|
});
|
|
10519
10529
|
var renderTransition = () => createVNode(Transition, {
|
|
10520
10530
|
"name": "var-menu",
|
|
10521
|
-
"onAfterEnter": props2.
|
|
10531
|
+
"onAfterEnter": props2.onOpened,
|
|
10522
10532
|
"onAfterLeave": props2.onClosed
|
|
10523
10533
|
}, {
|
|
10524
10534
|
default: () => [withDirectives(createVNode("div", {
|
|
@@ -12247,6 +12257,9 @@ var props$f = {
|
|
|
12247
12257
|
type: [String, Number],
|
|
12248
12258
|
default: "2"
|
|
12249
12259
|
},
|
|
12260
|
+
namespace: {
|
|
12261
|
+
type: String
|
|
12262
|
+
},
|
|
12250
12263
|
half: {
|
|
12251
12264
|
type: Boolean,
|
|
12252
12265
|
default: false
|
|
@@ -12299,11 +12312,12 @@ function render$h(_ctx, _cache) {
|
|
|
12299
12312
|
onClick: ($event) => _ctx.handleClick(val, $event)
|
|
12300
12313
|
}, [createVNode(_component_var_icon, {
|
|
12301
12314
|
transition: 0,
|
|
12315
|
+
namespace: _ctx.namespace,
|
|
12302
12316
|
name: _ctx.getIconName(val),
|
|
12303
12317
|
style: normalizeStyle({
|
|
12304
12318
|
fontSize: _ctx.toSizeUnit(_ctx.size)
|
|
12305
12319
|
})
|
|
12306
|
-
}, null, 8, ["name", "style"])], 14, _hoisted_3$6)), [[_directive_ripple, {
|
|
12320
|
+
}, null, 8, ["namespace", "name", "style"])], 14, _hoisted_3$6)), [[_directive_ripple, {
|
|
12307
12321
|
disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple
|
|
12308
12322
|
}]]);
|
|
12309
12323
|
}), 128))]), createVNode(_component_var_form_details, {
|
|
@@ -14025,9 +14039,25 @@ var Space = defineComponent({
|
|
|
14025
14039
|
size
|
|
14026
14040
|
} = props2;
|
|
14027
14041
|
var children = (_slots$default = slots.default == null ? void 0 : slots.default()) != null ? _slots$default : [];
|
|
14028
|
-
var lastIndex = children.length - 1;
|
|
14029
14042
|
var isInternalSize = internalSizeValidator(size);
|
|
14030
14043
|
var [y, x] = getSize(size, isInternalSize);
|
|
14044
|
+
var flatten = (vNodes) => {
|
|
14045
|
+
var result = [];
|
|
14046
|
+
vNodes.forEach((vNode) => {
|
|
14047
|
+
if (vNode.type === Comment)
|
|
14048
|
+
return;
|
|
14049
|
+
if (vNode.type === Fragment && isArray(vNode.children)) {
|
|
14050
|
+
vNode.children.forEach((item) => {
|
|
14051
|
+
result.push(item);
|
|
14052
|
+
});
|
|
14053
|
+
return;
|
|
14054
|
+
}
|
|
14055
|
+
result.push(vNode);
|
|
14056
|
+
});
|
|
14057
|
+
return result;
|
|
14058
|
+
};
|
|
14059
|
+
children = flatten(children);
|
|
14060
|
+
var lastIndex = children.length - 1;
|
|
14031
14061
|
var spacers = children.map((child, index) => {
|
|
14032
14062
|
var margin = "0";
|
|
14033
14063
|
if (direction === "row") {
|
|
@@ -1203,6 +1203,10 @@
|
|
|
1203
1203
|
"type": "string",
|
|
1204
1204
|
"description": "半选时图标的样式,只有在 `half` 为 `true` 时才有效 默认值:star-half-full"
|
|
1205
1205
|
},
|
|
1206
|
+
"var-rate/namespace": {
|
|
1207
|
+
"type": "string",
|
|
1208
|
+
"description": "图标的命名空间, 可扩展自定义图标库 默认值:var-icon"
|
|
1209
|
+
},
|
|
1206
1210
|
"var-rate/disabled": {
|
|
1207
1211
|
"type": "boolean",
|
|
1208
1212
|
"description": "是否禁止评分 默认值:false"
|
package/highlight/tags.json
CHANGED
package/highlight/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
|
-
"version": "1.26.
|
|
4
|
+
"version": "1.26.3",
|
|
5
5
|
"name": "VARLET",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -3583,6 +3583,15 @@
|
|
|
3583
3583
|
"kind": "expression"
|
|
3584
3584
|
}
|
|
3585
3585
|
},
|
|
3586
|
+
{
|
|
3587
|
+
"name": "namespace",
|
|
3588
|
+
"description": "图标的命名空间, 可扩展自定义图标库",
|
|
3589
|
+
"default": "var-icon",
|
|
3590
|
+
"value": {
|
|
3591
|
+
"type": "string",
|
|
3592
|
+
"kind": "expression"
|
|
3593
|
+
}
|
|
3594
|
+
},
|
|
3586
3595
|
{
|
|
3587
3596
|
"name": "disabled",
|
|
3588
3597
|
"description": "是否禁止评分",
|
package/lib/badge/Badge.js
CHANGED
|
@@ -71,7 +71,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
71
71
|
dot,
|
|
72
72
|
icon
|
|
73
73
|
} = props;
|
|
74
|
-
var positionBasic =
|
|
74
|
+
var positionBasic = slots.default && "var-badge__position var-badge--" + position;
|
|
75
75
|
var dotClass = dot && 'var-badge__dot';
|
|
76
76
|
var positionClass = getPositionClass();
|
|
77
77
|
var iconClass = icon && 'var-badge__icon';
|
package/lib/checkbox/Checkbox.js
CHANGED
|
@@ -171,6 +171,10 @@ var _default = (0, _vue.defineComponent)({
|
|
|
171
171
|
uncheckedValue
|
|
172
172
|
} = props;
|
|
173
173
|
value.value = values.includes(checkedValue) ? checkedValue : uncheckedValue;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
var resetWithAnimation = () => {
|
|
177
|
+
withAnimation.value = false;
|
|
174
178
|
}; // expose
|
|
175
179
|
|
|
176
180
|
|
|
@@ -210,7 +214,8 @@ var _default = (0, _vue.defineComponent)({
|
|
|
210
214
|
sync,
|
|
211
215
|
validate,
|
|
212
216
|
resetValidation,
|
|
213
|
-
reset
|
|
217
|
+
reset,
|
|
218
|
+
resetWithAnimation
|
|
214
219
|
};
|
|
215
220
|
bindCheckboxGroup == null ? void 0 : bindCheckboxGroup(checkboxProvider);
|
|
216
221
|
bindForm == null ? void 0 : bindForm(checkboxProvider);
|
|
@@ -114,7 +114,11 @@ var _default = (0, _vue.defineComponent)({
|
|
|
114
114
|
sync
|
|
115
115
|
} = _ref;
|
|
116
116
|
return sync(props.modelValue);
|
|
117
|
-
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
var resetWithAnimation = () => {
|
|
120
|
+
checkboxes.forEach(checkbox => checkbox.resetWithAnimation());
|
|
121
|
+
}; // expose
|
|
118
122
|
|
|
119
123
|
|
|
120
124
|
var checkAll = () => {
|
|
@@ -127,6 +131,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
127
131
|
return checkedValue.value;
|
|
128
132
|
});
|
|
129
133
|
var changedModelValue = (0, _shared.uniq)(checkedValues);
|
|
134
|
+
resetWithAnimation();
|
|
130
135
|
(_props$onUpdateModel2 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel2.call(props, changedModelValue);
|
|
131
136
|
return changedModelValue;
|
|
132
137
|
}; // expose
|
|
@@ -147,6 +152,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
147
152
|
return checkedValue.value;
|
|
148
153
|
});
|
|
149
154
|
var changedModelValue = (0, _shared.uniq)(checkedValues);
|
|
155
|
+
resetWithAnimation();
|
|
150
156
|
(_props$onUpdateModel3 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel3.call(props, changedModelValue);
|
|
151
157
|
return changedModelValue;
|
|
152
158
|
}; // expose
|
|
@@ -55,7 +55,7 @@ function render(_ctx, _cache) {
|
|
|
55
55
|
class: (0, _vue.normalizeClass)(["var-date-picker-title__date", [!_ctx.isYearPanel ? 'var-date-picker-title__date--active' : null, _ctx.range ? 'var-date-picker-title__date--range' : null]]),
|
|
56
56
|
onClick: _cache[1] || (_cache[1] = $event => _ctx.clickEl('date'))
|
|
57
57
|
}, [(0, _vue.createVNode)(_vue.Transition, {
|
|
58
|
-
name: _ctx.multiple ? '' : _ctx.reverse ? '
|
|
58
|
+
name: _ctx.multiple ? '' : "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatey"
|
|
59
59
|
}, {
|
|
60
60
|
default: (0, _vue.withCtx)(() => {
|
|
61
61
|
var _ctx$chooseMonth, _ctx$chooseMonth2, _ctx$chooseMonth3;
|
|
@@ -245,14 +245,15 @@ var _default = (0, _vue.defineComponent)({
|
|
|
245
245
|
return weekName.slice(0, 3) + ", " + monthName.slice(0, 3) + " " + chooseDay.value;
|
|
246
246
|
});
|
|
247
247
|
var slotProps = (0, _vue.computed)(() => {
|
|
248
|
-
var _chooseMonth$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2
|
|
248
|
+
var _chooseMonth$value, _chooseDay$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2;
|
|
249
249
|
|
|
250
250
|
var weekIndex = (0, _dayjs.default)(chooseYear.value + "-" + ((_chooseMonth$value = chooseMonth.value) == null ? void 0 : _chooseMonth$value.index) + "-" + chooseDay.value).day();
|
|
251
|
+
var date = chooseDay.value ? (_chooseDay$value = chooseDay.value) == null ? void 0 : _chooseDay$value.padStart(2, '0') : '';
|
|
251
252
|
return {
|
|
252
253
|
week: "" + weekIndex,
|
|
253
254
|
year: (_chooseYear$value = chooseYear.value) != null ? _chooseYear$value : '',
|
|
254
255
|
month: (_chooseMonth$value$in = (_chooseMonth$value2 = chooseMonth.value) == null ? void 0 : _chooseMonth$value2.index) != null ? _chooseMonth$value$in : '',
|
|
255
|
-
date
|
|
256
|
+
date
|
|
256
257
|
};
|
|
257
258
|
});
|
|
258
259
|
var formatRange = (0, _vue.computed)(() => getChoose.value.chooseRangeDay.map(choose => (0, _dayjs.default)(choose).format('YYYY-MM-DD')));
|
|
@@ -59,7 +59,7 @@ function render(_ctx, _cache) {
|
|
|
59
59
|
}, null, 8
|
|
60
60
|
/* PROPS */
|
|
61
61
|
, ["date", "disabled", "onCheckPanel", "onCheckDate"]), (0, _vue.createVNode)(_vue.Transition, {
|
|
62
|
-
name: _ctx.reverse ? '
|
|
62
|
+
name: "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatex"
|
|
63
63
|
}, {
|
|
64
64
|
default: (0, _vue.withCtx)(() => [((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
65
65
|
key: _ctx.panelKey
|
|
@@ -53,7 +53,7 @@ function render(_ctx, _cache) {
|
|
|
53
53
|
}, null, 8
|
|
54
54
|
/* PROPS */
|
|
55
55
|
, ["date", "disabled", "onCheckPanel", "onCheckDate"]), (0, _vue.createVNode)(_vue.Transition, {
|
|
56
|
-
name: _ctx.reverse ? '
|
|
56
|
+
name: "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatex"
|
|
57
57
|
}, {
|
|
58
58
|
default: (0, _vue.withCtx)(() => [((0, _vue.openBlock)(), (0, _vue.createElementBlock)("ul", {
|
|
59
59
|
key: _ctx.panelKey
|
|
@@ -48,7 +48,7 @@ function render(_ctx, _cache) {
|
|
|
48
48
|
class: "var-picker-header__value",
|
|
49
49
|
onClick: _cache[1] || (_cache[1] = $event => _ctx.$emit('check-panel'))
|
|
50
50
|
}, [(0, _vue.createVNode)(_vue.Transition, {
|
|
51
|
-
name: _ctx.reverse ? '
|
|
51
|
+
name: "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatex"
|
|
52
52
|
}, {
|
|
53
53
|
default: (0, _vue.withCtx)(() => [((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
|
|
54
54
|
key: _ctx.showDate
|
package/lib/divider/Divider.js
CHANGED
|
@@ -69,7 +69,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
var checkHasText = () => {
|
|
72
|
-
state.withText = Boolean(slots.default
|
|
72
|
+
state.withText = Boolean(slots.default) || Boolean(props.description);
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
(0, _vue.onMounted)(() => {
|
|
@@ -22,6 +22,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
22
22
|
|
|
23
23
|
var DISTANCE_OFFSET = 12;
|
|
24
24
|
var EVENT_DELAY = 200;
|
|
25
|
+
var TAP_DELAY = 350;
|
|
25
26
|
var ANIMATION_DURATION = 200;
|
|
26
27
|
|
|
27
28
|
var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
|
|
@@ -219,11 +220,11 @@ var _default = (0, _vue.defineComponent)({
|
|
|
219
220
|
};
|
|
220
221
|
|
|
221
222
|
var isTapTouch = target => {
|
|
222
|
-
if (!startTouch || !prevTouch) {
|
|
223
|
+
if (!target || !startTouch || !prevTouch) {
|
|
223
224
|
return false;
|
|
224
225
|
}
|
|
225
226
|
|
|
226
|
-
return getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET && (target === startTouch.target || target.parentNode === startTouch.target);
|
|
227
|
+
return getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET && Date.now() - prevTouch.timestamp < TAP_DELAY && (target === startTouch.target || target.parentNode === startTouch.target);
|
|
227
228
|
};
|
|
228
229
|
|
|
229
230
|
var handleTouchend = event => {
|
package/lib/menu/Menu.js
CHANGED
|
@@ -88,7 +88,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
88
88
|
|
|
89
89
|
var renderTransition = () => (0, _vue.createVNode)(_vue.Transition, {
|
|
90
90
|
"name": "var-menu",
|
|
91
|
-
"onAfterEnter": props.
|
|
91
|
+
"onAfterEnter": props.onOpened,
|
|
92
92
|
"onAfterLeave": props.onClosed
|
|
93
93
|
}, {
|
|
94
94
|
default: () => [(0, _vue.withDirectives)((0, _vue.createVNode)("div", {
|
package/lib/rate/Rate.js
CHANGED
|
@@ -49,13 +49,14 @@ function render(_ctx, _cache) {
|
|
|
49
49
|
onClick: $event => _ctx.handleClick(val, $event)
|
|
50
50
|
}, [(0, _vue.createVNode)(_component_var_icon, {
|
|
51
51
|
transition: 0,
|
|
52
|
+
namespace: _ctx.namespace,
|
|
52
53
|
name: _ctx.getIconName(val),
|
|
53
54
|
style: (0, _vue.normalizeStyle)({
|
|
54
55
|
fontSize: _ctx.toSizeUnit(_ctx.size)
|
|
55
56
|
})
|
|
56
57
|
}, null, 8
|
|
57
58
|
/* PROPS */
|
|
58
|
-
, ["name", "style"])], 14
|
|
59
|
+
, ["namespace", "name", "style"])], 14
|
|
59
60
|
/* CLASS, STYLE, PROPS */
|
|
60
61
|
, _hoisted_3)), [[_directive_ripple, {
|
|
61
62
|
disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple
|
package/lib/rate/props.js
CHANGED
package/lib/ripple/index.js
CHANGED
|
@@ -63,8 +63,6 @@ function createRipple(event) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
var task = () => {
|
|
66
|
-
var _ripple$color;
|
|
67
|
-
|
|
68
66
|
_ripple.tasker = null;
|
|
69
67
|
var {
|
|
70
68
|
x,
|
|
@@ -79,7 +77,7 @@ function createRipple(event) {
|
|
|
79
77
|
ripple.style.transform = "translate(" + x + "px, " + y + "px) scale3d(.3, .3, .3)";
|
|
80
78
|
ripple.style.width = size + "px";
|
|
81
79
|
ripple.style.height = size + "px";
|
|
82
|
-
ripple.style.backgroundColor =
|
|
80
|
+
_ripple.color && (ripple.style.backgroundColor = _ripple.color);
|
|
83
81
|
ripple.dataset.createdAt = String(performance.now());
|
|
84
82
|
setStyles(this);
|
|
85
83
|
this.appendChild(ripple);
|
package/lib/ripple/ripple.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root { --ripple-cubic-bezier: cubic-bezier(0.68, 0.01, 0.62, 0.6);}.var-ripple { position: absolute; transition: transform 0.2s var(--ripple-cubic-bezier), opacity 0.14s linear; top: 0; left: 0; border-radius: 50%; opacity: 0; will-change: transform, opacity; pointer-events: none; z-index: 100;}
|
|
1
|
+
:root { --ripple-cubic-bezier: cubic-bezier(0.68, 0.01, 0.62, 0.6); --ripple-color: currentColor;}.var-ripple { position: absolute; transition: transform 0.2s var(--ripple-cubic-bezier), opacity 0.14s linear; top: 0; left: 0; border-radius: 50%; opacity: 0; will-change: transform, opacity; pointer-events: none; z-index: 100; background-color: var(--ripple-color);}
|
package/lib/ripple/ripple.less
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@ripple-cubic-bezier: cubic-bezier(0.68, 0.01, 0.62, 0.6);
|
|
2
|
+
@ripple-color: currentColor;
|
|
2
3
|
|
|
3
4
|
:root {
|
|
4
5
|
--ripple-cubic-bezier: @ripple-cubic-bezier;
|
|
6
|
+
--ripple-color: @ripple-color;
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
.var-ripple {
|
|
@@ -14,4 +16,5 @@
|
|
|
14
16
|
will-change: transform, opacity;
|
|
15
17
|
pointer-events: none;
|
|
16
18
|
z-index: 100;
|
|
19
|
+
background-color: var(--ripple-color);
|
|
17
20
|
}
|
package/lib/space/Space.js
CHANGED
|
@@ -47,9 +47,28 @@ var _default = (0, _vue.defineComponent)({
|
|
|
47
47
|
size
|
|
48
48
|
} = props;
|
|
49
49
|
var children = (_slots$default = slots.default == null ? void 0 : slots.default()) != null ? _slots$default : [];
|
|
50
|
-
var lastIndex = children.length - 1;
|
|
51
50
|
var isInternalSize = (0, _props.internalSizeValidator)(size);
|
|
52
51
|
var [y, x] = getSize(size, isInternalSize);
|
|
52
|
+
|
|
53
|
+
var flatten = vNodes => {
|
|
54
|
+
var result = [];
|
|
55
|
+
vNodes.forEach(vNode => {
|
|
56
|
+
if (vNode.type === _vue.Comment) return;
|
|
57
|
+
|
|
58
|
+
if (vNode.type === _vue.Fragment && (0, _shared.isArray)(vNode.children)) {
|
|
59
|
+
vNode.children.forEach(item => {
|
|
60
|
+
result.push(item);
|
|
61
|
+
});
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
result.push(vNode);
|
|
66
|
+
});
|
|
67
|
+
return result;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
children = flatten(children);
|
|
71
|
+
var lastIndex = children.length - 1;
|
|
53
72
|
var spacers = children.map((child, index) => {
|
|
54
73
|
var margin = '0';
|
|
55
74
|
|