@varlet/ui 1.26.2 → 1.26.5
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/checkbox/Checkbox.js +6 -1
- package/es/checkbox-group/CheckboxGroup.js +7 -1
- package/es/date-picker/DatePicker.js +87 -15
- package/es/date-picker/date-picker.css +1 -1
- package/es/date-picker/date-picker.less +1 -0
- package/es/date-picker/props.js +4 -0
- package/es/date-picker/src/day-picker-panel.js +10 -1
- package/es/date-picker/src/month-picker-panel.js +10 -1
- package/es/date-picker/src/panel-header.js +2 -1
- package/es/image-preview/ImagePreview.js +7 -3
- package/es/image-preview/imagePreview.css +1 -1
- package/es/image-preview/imagePreview.less +11 -1
- package/es/rate/Rate.js +2 -1
- package/es/rate/props.js +3 -0
- package/es/style.css +1 -1
- package/es/varlet.esm.js +180 -69
- package/highlight/attributes.json +8 -0
- package/highlight/tags.json +3 -1
- package/highlight/web-types.json +23 -1
- package/lib/checkbox/Checkbox.js +6 -1
- package/lib/checkbox-group/CheckboxGroup.js +7 -1
- package/lib/date-picker/DatePicker.js +86 -14
- package/lib/date-picker/date-picker.css +1 -1
- package/lib/date-picker/date-picker.less +1 -0
- package/lib/date-picker/props.js +4 -0
- package/lib/date-picker/src/day-picker-panel.js +10 -1
- package/lib/date-picker/src/month-picker-panel.js +10 -1
- package/lib/date-picker/src/panel-header.js +2 -1
- package/lib/image-preview/ImagePreview.js +7 -3
- package/lib/image-preview/imagePreview.css +1 -1
- package/lib/image-preview/imagePreview.less +11 -1
- package/lib/rate/Rate.js +2 -1
- package/lib/rate/props.js +3 -0
- package/lib/style.css +1 -1
- package/package.json +4 -4
- package/types/datePicker.d.ts +1 -0
- 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
|
@@ -1337,11 +1337,11 @@ var Locale = {
|
|
|
1337
1337
|
merge,
|
|
1338
1338
|
useLocale
|
|
1339
1339
|
};
|
|
1340
|
-
var _hoisted_1$
|
|
1340
|
+
var _hoisted_1$H = {
|
|
1341
1341
|
class: "var-action-sheet__title"
|
|
1342
1342
|
};
|
|
1343
1343
|
var _hoisted_2$t = ["onClick"];
|
|
1344
|
-
var _hoisted_3$
|
|
1344
|
+
var _hoisted_3$j = {
|
|
1345
1345
|
class: "var-action-sheet__action-name"
|
|
1346
1346
|
};
|
|
1347
1347
|
function render$W(_ctx, _cache) {
|
|
@@ -1372,7 +1372,7 @@ function render$W(_ctx, _cache) {
|
|
|
1372
1372
|
}), {
|
|
1373
1373
|
default: withCtx(() => [createElementVNode("div", mergeProps({
|
|
1374
1374
|
class: "var-action-sheet var--box"
|
|
1375
|
-
}, _ctx.$attrs), [renderSlot(_ctx.$slots, "title", {}, () => [createElementVNode("div", _hoisted_1$
|
|
1375
|
+
}, _ctx.$attrs), [renderSlot(_ctx.$slots, "title", {}, () => [createElementVNode("div", _hoisted_1$H, toDisplayString(_ctx.dt(_ctx.title, _ctx.pack.actionSheetTitle)), 1)]), renderSlot(_ctx.$slots, "actions", {}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.actions, (action) => {
|
|
1376
1376
|
return withDirectives((openBlock(), createElementBlock("div", {
|
|
1377
1377
|
class: normalizeClass(["var-action-sheet__action-item", [action.className, action.disabled ? "var-action-sheet--disabled" : null]]),
|
|
1378
1378
|
key: action.name,
|
|
@@ -1386,7 +1386,7 @@ function render$W(_ctx, _cache) {
|
|
|
1386
1386
|
"var-action-sheet-cover": "",
|
|
1387
1387
|
name: action.icon,
|
|
1388
1388
|
size: action.iconSize
|
|
1389
|
-
}, null, 8, ["name", "size"])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_3$
|
|
1389
|
+
}, null, 8, ["name", "size"])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_3$j, toDisplayString(action.name), 1)], 14, _hoisted_2$t)), [[_directive_ripple, {
|
|
1390
1390
|
disabled: action.disabled
|
|
1391
1391
|
}]]);
|
|
1392
1392
|
}), 128))])], 16)]),
|
|
@@ -1509,14 +1509,14 @@ var props$P = {
|
|
|
1509
1509
|
default: true
|
|
1510
1510
|
}
|
|
1511
1511
|
};
|
|
1512
|
-
var _hoisted_1$
|
|
1512
|
+
var _hoisted_1$G = {
|
|
1513
1513
|
class: "var-app-bar__left"
|
|
1514
1514
|
};
|
|
1515
1515
|
var _hoisted_2$s = {
|
|
1516
1516
|
key: 0,
|
|
1517
1517
|
class: "var-app-bar__title"
|
|
1518
1518
|
};
|
|
1519
|
-
var _hoisted_3$
|
|
1519
|
+
var _hoisted_3$i = {
|
|
1520
1520
|
class: "var-app-bar__right"
|
|
1521
1521
|
};
|
|
1522
1522
|
function render$V(_ctx, _cache) {
|
|
@@ -1528,13 +1528,13 @@ function render$V(_ctx, _cache) {
|
|
|
1528
1528
|
background: _ctx.color,
|
|
1529
1529
|
color: _ctx.textColor
|
|
1530
1530
|
})
|
|
1531
|
-
}, [createElementVNode("div", _hoisted_1$
|
|
1531
|
+
}, [createElementVNode("div", _hoisted_1$G, [renderSlot(_ctx.$slots, "left"), _ctx.titlePosition === "left" ? (openBlock(), createElementBlock("div", {
|
|
1532
1532
|
key: 0,
|
|
1533
1533
|
class: "var-app-bar__title",
|
|
1534
1534
|
style: normalizeStyle({
|
|
1535
1535
|
paddingLeft: _ctx.paddingLeft
|
|
1536
1536
|
})
|
|
1537
|
-
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(_ctx.title), 1)])], 4)) : createCommentVNode("v-if", true)]), _ctx.titlePosition === "center" ? (openBlock(), createElementBlock("div", _hoisted_2$s, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(_ctx.title), 1)])])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_3$
|
|
1537
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(_ctx.title), 1)])], 4)) : createCommentVNode("v-if", true)]), _ctx.titlePosition === "center" ? (openBlock(), createElementBlock("div", _hoisted_2$s, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(_ctx.title), 1)])])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_3$i, [_ctx.titlePosition === "right" ? (openBlock(), createElementBlock("div", {
|
|
1538
1538
|
key: 0,
|
|
1539
1539
|
class: "var-app-bar__title",
|
|
1540
1540
|
style: normalizeStyle({
|
|
@@ -1600,14 +1600,14 @@ var props$O = {
|
|
|
1600
1600
|
}
|
|
1601
1601
|
};
|
|
1602
1602
|
var _withScopeId$2 = (n) => (pushScopeId(""), n = n(), popScopeId(), n);
|
|
1603
|
-
var _hoisted_1$
|
|
1603
|
+
var _hoisted_1$F = {
|
|
1604
1604
|
class: "var-loading"
|
|
1605
1605
|
};
|
|
1606
1606
|
var _hoisted_2$r = {
|
|
1607
1607
|
key: 0,
|
|
1608
1608
|
class: "var-loading__circle"
|
|
1609
1609
|
};
|
|
1610
|
-
var _hoisted_3$
|
|
1610
|
+
var _hoisted_3$h = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("svg", {
|
|
1611
1611
|
viewBox: "25 25 50 50"
|
|
1612
1612
|
}, [/* @__PURE__ */ createElementVNode("circle", {
|
|
1613
1613
|
cx: "50",
|
|
@@ -1615,9 +1615,9 @@ var _hoisted_3$g = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createEl
|
|
|
1615
1615
|
r: "20",
|
|
1616
1616
|
fill: "none"
|
|
1617
1617
|
})], -1));
|
|
1618
|
-
var _hoisted_4$a = [_hoisted_3$
|
|
1618
|
+
var _hoisted_4$a = [_hoisted_3$h];
|
|
1619
1619
|
function render$U(_ctx, _cache) {
|
|
1620
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1620
|
+
return openBlock(), createElementBlock("div", _hoisted_1$F, [_ctx.$slots.default ? (openBlock(), createElementBlock("div", {
|
|
1621
1621
|
key: 0,
|
|
1622
1622
|
class: normalizeClass(["var-loading__content", [_ctx.loading ? "var-loading__content--active" : null]])
|
|
1623
1623
|
}, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true), _ctx.isShow ? (openBlock(), createElementBlock("div", {
|
|
@@ -1759,7 +1759,7 @@ var props$N = {
|
|
|
1759
1759
|
type: Function
|
|
1760
1760
|
}
|
|
1761
1761
|
};
|
|
1762
|
-
var _hoisted_1$
|
|
1762
|
+
var _hoisted_1$E = ["disabled"];
|
|
1763
1763
|
function render$T(_ctx, _cache) {
|
|
1764
1764
|
var _component_var_loading = resolveComponent("var-loading");
|
|
1765
1765
|
var _directive_ripple = resolveDirective("ripple");
|
|
@@ -1785,7 +1785,7 @@ function render$T(_ctx, _cache) {
|
|
|
1785
1785
|
radius: _ctx.loadingRadius
|
|
1786
1786
|
}, null, 8, ["type", "size", "radius"])) : createCommentVNode("v-if", true), createElementVNode("div", {
|
|
1787
1787
|
class: normalizeClass(["var-button__content", [_ctx.loading || _ctx.pending ? "var-button--hidden" : null]])
|
|
1788
|
-
}, [renderSlot(_ctx.$slots, "default")], 2)], 46, _hoisted_1$
|
|
1788
|
+
}, [renderSlot(_ctx.$slots, "default")], 2)], 46, _hoisted_1$E)), [[_directive_ripple, {
|
|
1789
1789
|
disabled: _ctx.disabled || !_ctx.ripple
|
|
1790
1790
|
}]]);
|
|
1791
1791
|
}
|
|
@@ -1985,7 +1985,7 @@ var props$L = {
|
|
|
1985
1985
|
type: String
|
|
1986
1986
|
}
|
|
1987
1987
|
};
|
|
1988
|
-
var _hoisted_1$
|
|
1988
|
+
var _hoisted_1$D = {
|
|
1989
1989
|
class: "var-badge var--box"
|
|
1990
1990
|
};
|
|
1991
1991
|
var _hoisted_2$q = {
|
|
@@ -1993,7 +1993,7 @@ var _hoisted_2$q = {
|
|
|
1993
1993
|
};
|
|
1994
1994
|
function render$R(_ctx, _cache) {
|
|
1995
1995
|
var _component_var_icon = resolveComponent("var-icon");
|
|
1996
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1996
|
+
return openBlock(), createElementBlock("div", _hoisted_1$D, [createVNode(Transition, {
|
|
1997
1997
|
name: "var-badge-fade"
|
|
1998
1998
|
}, {
|
|
1999
1999
|
default: withCtx(() => [withDirectives(createElementVNode("span", mergeProps(_ctx.$attrs, {
|
|
@@ -2103,12 +2103,12 @@ var props$K = {
|
|
|
2103
2103
|
type: Function
|
|
2104
2104
|
}
|
|
2105
2105
|
};
|
|
2106
|
-
var _hoisted_1$
|
|
2106
|
+
var _hoisted_1$C = ["src", "alt"];
|
|
2107
2107
|
var _hoisted_2$p = {
|
|
2108
2108
|
key: 0,
|
|
2109
2109
|
class: "var-card__title"
|
|
2110
2110
|
};
|
|
2111
|
-
var _hoisted_3$
|
|
2111
|
+
var _hoisted_3$g = {
|
|
2112
2112
|
key: 0,
|
|
2113
2113
|
class: "var-card__subtitle"
|
|
2114
2114
|
};
|
|
@@ -2136,7 +2136,7 @@ function render$Q(_ctx, _cache) {
|
|
|
2136
2136
|
}),
|
|
2137
2137
|
src: _ctx.src,
|
|
2138
2138
|
alt: _ctx.alt
|
|
2139
|
-
}, null, 12, _hoisted_1$
|
|
2139
|
+
}, null, 12, _hoisted_1$C)) : createCommentVNode("v-if", true)]), renderSlot(_ctx.$slots, "title", {}, () => [_ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2$p, toDisplayString(_ctx.title), 1)) : createCommentVNode("v-if", true)]), renderSlot(_ctx.$slots, "subtitle", {}, () => [_ctx.subtitle ? (openBlock(), createElementBlock("div", _hoisted_3$g, toDisplayString(_ctx.subtitle), 1)) : createCommentVNode("v-if", true)]), renderSlot(_ctx.$slots, "description", {}, () => [_ctx.description ? (openBlock(), createElementBlock("div", _hoisted_4$9, toDisplayString(_ctx.description), 1)) : createCommentVNode("v-if", true)]), _ctx.$slots.extra ? (openBlock(), createElementBlock("div", _hoisted_5$7, [renderSlot(_ctx.$slots, "extra")])) : createCommentVNode("v-if", true)], 2)), [[_directive_ripple, {
|
|
2140
2140
|
disabled: !_ctx.ripple
|
|
2141
2141
|
}]]);
|
|
2142
2142
|
}
|
|
@@ -2183,7 +2183,7 @@ var props$J = {
|
|
|
2183
2183
|
type: String
|
|
2184
2184
|
}
|
|
2185
2185
|
};
|
|
2186
|
-
var _hoisted_1$
|
|
2186
|
+
var _hoisted_1$B = {
|
|
2187
2187
|
class: "var-cell__content"
|
|
2188
2188
|
};
|
|
2189
2189
|
function render$P(_ctx, _cache) {
|
|
@@ -2196,7 +2196,7 @@ function render$P(_ctx, _cache) {
|
|
|
2196
2196
|
}, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_component_var_icon, {
|
|
2197
2197
|
class: "var--flex",
|
|
2198
2198
|
name: _ctx.icon
|
|
2199
|
-
}, null, 8, ["name"])])], 2)) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_1$
|
|
2199
|
+
}, null, 8, ["name"])])], 2)) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_1$B, [createElementVNode("div", {
|
|
2200
2200
|
class: normalizeClass(["var-cell__title", [_ctx.titleClass ? _ctx.titleClass : null]])
|
|
2201
2201
|
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(_ctx.title), 1)])], 2), _ctx.$slots.desc || _ctx.desc ? (openBlock(), createElementBlock("div", {
|
|
2202
2202
|
key: 0,
|
|
@@ -2227,21 +2227,21 @@ var props$I = {
|
|
|
2227
2227
|
default: ""
|
|
2228
2228
|
}
|
|
2229
2229
|
};
|
|
2230
|
-
var _hoisted_1$
|
|
2230
|
+
var _hoisted_1$A = {
|
|
2231
2231
|
key: 0,
|
|
2232
2232
|
class: "var-form-details"
|
|
2233
2233
|
};
|
|
2234
2234
|
var _hoisted_2$o = {
|
|
2235
2235
|
class: "var-form-details__message"
|
|
2236
2236
|
};
|
|
2237
|
-
var _hoisted_3$
|
|
2237
|
+
var _hoisted_3$f = {
|
|
2238
2238
|
class: "var-form-details__length"
|
|
2239
2239
|
};
|
|
2240
2240
|
function render$O(_ctx, _cache) {
|
|
2241
2241
|
return openBlock(), createBlock(Transition, {
|
|
2242
2242
|
name: "var-form-details"
|
|
2243
2243
|
}, {
|
|
2244
|
-
default: withCtx(() => [_ctx.errorMessage || _ctx.maxlengthText ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2244
|
+
default: withCtx(() => [_ctx.errorMessage || _ctx.maxlengthText ? (openBlock(), createElementBlock("div", _hoisted_1$A, [createElementVNode("div", _hoisted_2$o, toDisplayString(_ctx.errorMessage), 1), createElementVNode("div", _hoisted_3$f, toDisplayString(_ctx.maxlengthText), 1)])) : createCommentVNode("v-if", true)]),
|
|
2245
2245
|
_: 1
|
|
2246
2246
|
});
|
|
2247
2247
|
}
|
|
@@ -2355,7 +2355,7 @@ function useFormItems() {
|
|
|
2355
2355
|
bindFormItems: bindChildren
|
|
2356
2356
|
};
|
|
2357
2357
|
}
|
|
2358
|
-
var _hoisted_1$
|
|
2358
|
+
var _hoisted_1$z = {
|
|
2359
2359
|
class: "var-checkbox"
|
|
2360
2360
|
};
|
|
2361
2361
|
function render$N(_ctx, _cache) {
|
|
@@ -2367,7 +2367,7 @@ function render$N(_ctx, _cache) {
|
|
|
2367
2367
|
onClick: _cache[0] || (_cache[0] = function() {
|
|
2368
2368
|
return _ctx.handleClick && _ctx.handleClick(...arguments);
|
|
2369
2369
|
})
|
|
2370
|
-
}, [createElementVNode("div", _hoisted_1$
|
|
2370
|
+
}, [createElementVNode("div", _hoisted_1$z, [withDirectives((openBlock(), createElementBlock("div", {
|
|
2371
2371
|
class: normalizeClass(["var-checkbox__action", [_ctx.checked ? "var-checkbox--checked" : "var-checkbox--unchecked", _ctx.errorMessage || _ctx.checkboxGroupErrorMessage ? "var-checkbox--error" : null, _ctx.formDisabled || _ctx.disabled ? "var-checkbox--disabled" : null]]),
|
|
2372
2372
|
style: normalizeStyle({
|
|
2373
2373
|
color: _ctx.checked ? _ctx.checkedColor : _ctx.uncheckedColor
|
|
@@ -2475,6 +2475,9 @@ var Checkbox = defineComponent({
|
|
|
2475
2475
|
} = props2;
|
|
2476
2476
|
value.value = values.includes(checkedValue2) ? checkedValue2 : uncheckedValue;
|
|
2477
2477
|
};
|
|
2478
|
+
var resetWithAnimation = () => {
|
|
2479
|
+
withAnimation.value = false;
|
|
2480
|
+
};
|
|
2478
2481
|
var reset = () => {
|
|
2479
2482
|
var _props$onUpdateModel2;
|
|
2480
2483
|
(_props$onUpdateModel2 = props2["onUpdate:modelValue"]) == null ? void 0 : _props$onUpdateModel2.call(props2, props2.uncheckedValue);
|
|
@@ -2503,7 +2506,8 @@ var Checkbox = defineComponent({
|
|
|
2503
2506
|
sync,
|
|
2504
2507
|
validate,
|
|
2505
2508
|
resetValidation,
|
|
2506
|
-
reset
|
|
2509
|
+
reset,
|
|
2510
|
+
resetWithAnimation
|
|
2507
2511
|
};
|
|
2508
2512
|
bindCheckboxGroup == null ? void 0 : bindCheckboxGroup(checkboxProvider);
|
|
2509
2513
|
bindForm == null ? void 0 : bindForm(checkboxProvider);
|
|
@@ -2555,12 +2559,12 @@ var props$G = {
|
|
|
2555
2559
|
type: Function
|
|
2556
2560
|
}
|
|
2557
2561
|
};
|
|
2558
|
-
var _hoisted_1$
|
|
2562
|
+
var _hoisted_1$y = {
|
|
2559
2563
|
class: "var-checkbox-group__wrap"
|
|
2560
2564
|
};
|
|
2561
2565
|
function render$M(_ctx, _cache) {
|
|
2562
2566
|
var _component_var_form_details = resolveComponent("var-form-details");
|
|
2563
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2567
|
+
return openBlock(), createElementBlock("div", _hoisted_1$y, [createElementVNode("div", {
|
|
2564
2568
|
class: normalizeClass(["var-checkbox-group", ["var-checkbox-group--" + _ctx.direction]])
|
|
2565
2569
|
}, [renderSlot(_ctx.$slots, "default")], 2), createVNode(_component_var_form_details, {
|
|
2566
2570
|
"error-message": _ctx.errorMessage
|
|
@@ -2630,6 +2634,9 @@ var CheckboxGroup = defineComponent({
|
|
|
2630
2634
|
} = _ref;
|
|
2631
2635
|
return sync(props2.modelValue);
|
|
2632
2636
|
});
|
|
2637
|
+
var resetWithAnimation = () => {
|
|
2638
|
+
checkboxes.forEach((checkbox2) => checkbox2.resetWithAnimation());
|
|
2639
|
+
};
|
|
2633
2640
|
var checkAll2 = () => {
|
|
2634
2641
|
var _props$onUpdateModel2;
|
|
2635
2642
|
var checkedValues = checkboxes.map((_ref2) => {
|
|
@@ -2639,6 +2646,7 @@ var CheckboxGroup = defineComponent({
|
|
|
2639
2646
|
return checkedValue.value;
|
|
2640
2647
|
});
|
|
2641
2648
|
var changedModelValue = uniq(checkedValues);
|
|
2649
|
+
resetWithAnimation();
|
|
2642
2650
|
(_props$onUpdateModel2 = props2["onUpdate:modelValue"]) == null ? void 0 : _props$onUpdateModel2.call(props2, changedModelValue);
|
|
2643
2651
|
return changedModelValue;
|
|
2644
2652
|
};
|
|
@@ -2656,6 +2664,7 @@ var CheckboxGroup = defineComponent({
|
|
|
2656
2664
|
return checkedValue.value;
|
|
2657
2665
|
});
|
|
2658
2666
|
var changedModelValue = uniq(checkedValues);
|
|
2667
|
+
resetWithAnimation();
|
|
2659
2668
|
(_props$onUpdateModel3 = props2["onUpdate:modelValue"]) == null ? void 0 : _props$onUpdateModel3.call(props2, changedModelValue);
|
|
2660
2669
|
return changedModelValue;
|
|
2661
2670
|
};
|
|
@@ -2970,11 +2979,11 @@ var props$D = {
|
|
|
2970
2979
|
type: Function
|
|
2971
2980
|
}
|
|
2972
2981
|
};
|
|
2973
|
-
var _hoisted_1$
|
|
2982
|
+
var _hoisted_1$x = {
|
|
2974
2983
|
class: "var-collapse"
|
|
2975
2984
|
};
|
|
2976
2985
|
function render$J(_ctx, _cache) {
|
|
2977
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2986
|
+
return openBlock(), createElementBlock("div", _hoisted_1$x, [renderSlot(_ctx.$slots, "default")]);
|
|
2978
2987
|
}
|
|
2979
2988
|
var Collapse = defineComponent({
|
|
2980
2989
|
render: render$J,
|
|
@@ -3110,13 +3119,13 @@ var props$C = {
|
|
|
3110
3119
|
default: false
|
|
3111
3120
|
}
|
|
3112
3121
|
};
|
|
3113
|
-
var _hoisted_1$
|
|
3122
|
+
var _hoisted_1$w = {
|
|
3114
3123
|
class: "var-collapse-item-header__title"
|
|
3115
3124
|
};
|
|
3116
3125
|
var _hoisted_2$n = {
|
|
3117
3126
|
class: "var-collapse-item-header__icon"
|
|
3118
3127
|
};
|
|
3119
|
-
var _hoisted_3$
|
|
3128
|
+
var _hoisted_3$e = {
|
|
3120
3129
|
class: "var-collapse-item__wrap"
|
|
3121
3130
|
};
|
|
3122
3131
|
function render$I(_ctx, _cache) {
|
|
@@ -3130,7 +3139,7 @@ function render$I(_ctx, _cache) {
|
|
|
3130
3139
|
}, [createElementVNode("div", {
|
|
3131
3140
|
class: "var-collapse-item-header",
|
|
3132
3141
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.toggle())
|
|
3133
|
-
}, [createElementVNode("div", _hoisted_1$
|
|
3142
|
+
}, [createElementVNode("div", _hoisted_1$w, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(_ctx.title), 1)])]), createElementVNode("div", _hoisted_2$n, [renderSlot(_ctx.$slots, "icon", {}, () => [createVNode(_component_var_icon, {
|
|
3134
3143
|
name: _ctx.icon,
|
|
3135
3144
|
transition: 250,
|
|
3136
3145
|
class: normalizeClass({
|
|
@@ -3144,7 +3153,7 @@ function render$I(_ctx, _cache) {
|
|
|
3144
3153
|
onTransitionend: _cache[1] || (_cache[1] = function() {
|
|
3145
3154
|
return _ctx.transitionend && _ctx.transitionend(...arguments);
|
|
3146
3155
|
})
|
|
3147
|
-
}, [createElementVNode("div", _hoisted_3$
|
|
3156
|
+
}, [createElementVNode("div", _hoisted_3$e, [renderSlot(_ctx.$slots, "default")])], 544), [[vShow, _ctx.show]])], 2);
|
|
3148
3157
|
}
|
|
3149
3158
|
var CollapseItem = defineComponent({
|
|
3150
3159
|
render: render$I,
|
|
@@ -3256,11 +3265,11 @@ var SECOND = 1e3;
|
|
|
3256
3265
|
var MINUTE = 60 * SECOND;
|
|
3257
3266
|
var HOUR = 60 * MINUTE;
|
|
3258
3267
|
var DAY = 24 * HOUR;
|
|
3259
|
-
var _hoisted_1$
|
|
3268
|
+
var _hoisted_1$v = {
|
|
3260
3269
|
class: "var-countdown"
|
|
3261
3270
|
};
|
|
3262
3271
|
function render$H(_ctx, _cache) {
|
|
3263
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3272
|
+
return openBlock(), createElementBlock("div", _hoisted_1$v, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(_ctx.timeData)), () => [createTextVNode(toDisplayString(_ctx.showTime), 1)])]);
|
|
3264
3273
|
}
|
|
3265
3274
|
var Countdown = defineComponent({
|
|
3266
3275
|
render: render$H,
|
|
@@ -5708,7 +5717,7 @@ var props$A = {
|
|
|
5708
5717
|
};
|
|
5709
5718
|
var SPEED = 100;
|
|
5710
5719
|
var DELAY = 600;
|
|
5711
|
-
var _hoisted_1$
|
|
5720
|
+
var _hoisted_1$u = {
|
|
5712
5721
|
class: "var-counter var--box"
|
|
5713
5722
|
};
|
|
5714
5723
|
var _hoisted_2$m = ["inputmode", "readonly", "disabled"];
|
|
@@ -5716,7 +5725,7 @@ function render$G(_ctx, _cache) {
|
|
|
5716
5725
|
var _component_var_icon = resolveComponent("var-icon");
|
|
5717
5726
|
var _component_var_form_details = resolveComponent("var-form-details");
|
|
5718
5727
|
var _directive_ripple = resolveDirective("ripple");
|
|
5719
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
5728
|
+
return openBlock(), createElementBlock("div", _hoisted_1$u, [createElementVNode("div", mergeProps({
|
|
5720
5729
|
class: ["var-counter__controller var-elevation--2", [_ctx.disabled || _ctx.formDisabled ? "var-counter--disabled" : null, _ctx.errorMessage ? "var-counter--error" : null]],
|
|
5721
5730
|
style: {
|
|
5722
5731
|
background: _ctx.color ? _ctx.color : void 0
|
|
@@ -6514,6 +6523,10 @@ var props$z = {
|
|
|
6514
6523
|
type: Boolean,
|
|
6515
6524
|
default: false
|
|
6516
6525
|
},
|
|
6526
|
+
touchable: {
|
|
6527
|
+
type: Boolean,
|
|
6528
|
+
default: true
|
|
6529
|
+
},
|
|
6517
6530
|
onChange: {
|
|
6518
6531
|
type: Function
|
|
6519
6532
|
},
|
|
@@ -6521,13 +6534,13 @@ var props$z = {
|
|
|
6521
6534
|
type: Function
|
|
6522
6535
|
}
|
|
6523
6536
|
};
|
|
6524
|
-
var _hoisted_1$
|
|
6537
|
+
var _hoisted_1$t = {
|
|
6525
6538
|
class: "var-picker-header"
|
|
6526
6539
|
};
|
|
6527
6540
|
function render$F(_ctx, _cache) {
|
|
6528
6541
|
var _component_var_icon = resolveComponent("var-icon");
|
|
6529
6542
|
var _component_var_button = resolveComponent("var-button");
|
|
6530
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6543
|
+
return openBlock(), createElementBlock("div", _hoisted_1$t, [createVNode(_component_var_button, {
|
|
6531
6544
|
round: "",
|
|
6532
6545
|
text: "",
|
|
6533
6546
|
style: {
|
|
@@ -6544,7 +6557,7 @@ function render$F(_ctx, _cache) {
|
|
|
6544
6557
|
class: "var-picker-header__value",
|
|
6545
6558
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("check-panel"))
|
|
6546
6559
|
}, [createVNode(Transition, {
|
|
6547
|
-
name: _ctx.reverse ? "
|
|
6560
|
+
name: "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatex"
|
|
6548
6561
|
}, {
|
|
6549
6562
|
default: withCtx(() => [(openBlock(), createElementBlock("div", {
|
|
6550
6563
|
key: _ctx.showDate
|
|
@@ -6609,6 +6622,8 @@ var PanelHeader = defineComponent({
|
|
|
6609
6622
|
return pack.value.lang === "zh-CN" ? previewYear + " " + monthName : monthName + " " + previewYear;
|
|
6610
6623
|
});
|
|
6611
6624
|
var checkDate = (checkType) => {
|
|
6625
|
+
if (checkType === "prev" && props2.disabled.left || checkType === "next" && props2.disabled.right)
|
|
6626
|
+
return;
|
|
6612
6627
|
emit("check-date", checkType);
|
|
6613
6628
|
reverse.value = checkType === "prev";
|
|
6614
6629
|
forwardOrBackNum.value += checkType === "prev" ? -1 : 1;
|
|
@@ -6639,7 +6654,7 @@ function _extends$8() {
|
|
|
6639
6654
|
}
|
|
6640
6655
|
dayjs.extend(isSameOrBefore);
|
|
6641
6656
|
dayjs.extend(isSameOrAfter);
|
|
6642
|
-
var _hoisted_1$
|
|
6657
|
+
var _hoisted_1$s = {
|
|
6643
6658
|
class: "var-month-picker__panel"
|
|
6644
6659
|
};
|
|
6645
6660
|
var _hoisted_2$l = {
|
|
@@ -6648,14 +6663,15 @@ var _hoisted_2$l = {
|
|
|
6648
6663
|
function render$E(_ctx, _cache) {
|
|
6649
6664
|
var _component_panel_header = resolveComponent("panel-header");
|
|
6650
6665
|
var _component_var_button = resolveComponent("var-button");
|
|
6651
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6666
|
+
return openBlock(), createElementBlock("div", _hoisted_1$s, [createElementVNode("div", _hoisted_2$l, [createVNode(_component_panel_header, {
|
|
6667
|
+
ref: "headerEl",
|
|
6652
6668
|
type: "month",
|
|
6653
6669
|
date: _ctx.preview,
|
|
6654
6670
|
disabled: _ctx.panelBtnDisabled,
|
|
6655
6671
|
onCheckPanel: _ctx.clickYear,
|
|
6656
6672
|
onCheckDate: _ctx.checkDate
|
|
6657
6673
|
}, null, 8, ["date", "disabled", "onCheckPanel", "onCheckDate"]), createVNode(Transition, {
|
|
6658
|
-
name: _ctx.reverse ? "
|
|
6674
|
+
name: "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatex"
|
|
6659
6675
|
}, {
|
|
6660
6676
|
default: withCtx(() => [(openBlock(), createElementBlock("ul", {
|
|
6661
6677
|
key: _ctx.panelKey
|
|
@@ -6714,6 +6730,7 @@ var MonthPickerPanel = defineComponent({
|
|
|
6714
6730
|
var [currentYear, currentMonth] = props2.current.split("-");
|
|
6715
6731
|
var reverse = ref(false);
|
|
6716
6732
|
var panelKey = ref(0);
|
|
6733
|
+
var headerEl = ref(null);
|
|
6717
6734
|
var panelBtnDisabled = reactive({
|
|
6718
6735
|
left: false,
|
|
6719
6736
|
right: false
|
|
@@ -6840,6 +6857,9 @@ var MonthPickerPanel = defineComponent({
|
|
|
6840
6857
|
panelKey.value += checkType === "prev" ? -1 : 1;
|
|
6841
6858
|
emit("check-preview", "year", checkType);
|
|
6842
6859
|
};
|
|
6860
|
+
var forwardRef = (checkType) => {
|
|
6861
|
+
headerEl.value.checkDate(checkType);
|
|
6862
|
+
};
|
|
6843
6863
|
watch(() => props2.preview.previewYear, (year) => {
|
|
6844
6864
|
var {
|
|
6845
6865
|
componentProps: {
|
|
@@ -6857,9 +6877,11 @@ var MonthPickerPanel = defineComponent({
|
|
|
6857
6877
|
return {
|
|
6858
6878
|
pack,
|
|
6859
6879
|
MONTH_LIST,
|
|
6880
|
+
headerEl,
|
|
6860
6881
|
reverse,
|
|
6861
6882
|
panelKey,
|
|
6862
6883
|
panelBtnDisabled,
|
|
6884
|
+
forwardRef,
|
|
6863
6885
|
buttonProps,
|
|
6864
6886
|
getMonthAbbr,
|
|
6865
6887
|
chooseMonth,
|
|
@@ -6867,12 +6889,12 @@ var MonthPickerPanel = defineComponent({
|
|
|
6867
6889
|
};
|
|
6868
6890
|
}
|
|
6869
6891
|
});
|
|
6870
|
-
var _hoisted_1$
|
|
6892
|
+
var _hoisted_1$r = {
|
|
6871
6893
|
class: "var-year-picker__panel"
|
|
6872
6894
|
};
|
|
6873
6895
|
var _hoisted_2$k = ["onClick"];
|
|
6874
6896
|
function render$D(_ctx, _cache) {
|
|
6875
|
-
return openBlock(), createElementBlock("ul", _hoisted_1$
|
|
6897
|
+
return openBlock(), createElementBlock("ul", _hoisted_1$r, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.yearList, (year) => {
|
|
6876
6898
|
return openBlock(), createElementBlock("li", {
|
|
6877
6899
|
key: year,
|
|
6878
6900
|
class: normalizeClass([year === _ctx.toNumber(_ctx.preview) ? "var-year-picker__panel--active" : null]),
|
|
@@ -6965,13 +6987,13 @@ function _extends$7() {
|
|
|
6965
6987
|
}
|
|
6966
6988
|
dayjs.extend(isSameOrBefore);
|
|
6967
6989
|
dayjs.extend(isSameOrAfter);
|
|
6968
|
-
var _hoisted_1$
|
|
6990
|
+
var _hoisted_1$q = {
|
|
6969
6991
|
class: "var-day-picker__panel"
|
|
6970
6992
|
};
|
|
6971
6993
|
var _hoisted_2$j = {
|
|
6972
6994
|
class: "var-day-picker__content"
|
|
6973
6995
|
};
|
|
6974
|
-
var _hoisted_3$
|
|
6996
|
+
var _hoisted_3$d = {
|
|
6975
6997
|
class: "var-day-picker__head"
|
|
6976
6998
|
};
|
|
6977
6999
|
var _hoisted_4$8 = {
|
|
@@ -6980,18 +7002,19 @@ var _hoisted_4$8 = {
|
|
|
6980
7002
|
function render$C(_ctx, _cache) {
|
|
6981
7003
|
var _component_panel_header = resolveComponent("panel-header");
|
|
6982
7004
|
var _component_var_button = resolveComponent("var-button");
|
|
6983
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
7005
|
+
return openBlock(), createElementBlock("div", _hoisted_1$q, [createElementVNode("div", _hoisted_2$j, [createVNode(_component_panel_header, {
|
|
7006
|
+
ref: "headerEl",
|
|
6984
7007
|
type: "day",
|
|
6985
7008
|
date: _ctx.preview,
|
|
6986
7009
|
disabled: _ctx.panelBtnDisabled,
|
|
6987
7010
|
onCheckPanel: _ctx.clickMonth,
|
|
6988
7011
|
onCheckDate: _ctx.checkDate
|
|
6989
7012
|
}, null, 8, ["date", "disabled", "onCheckPanel", "onCheckDate"]), createVNode(Transition, {
|
|
6990
|
-
name: _ctx.reverse ? "
|
|
7013
|
+
name: "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatex"
|
|
6991
7014
|
}, {
|
|
6992
7015
|
default: withCtx(() => [(openBlock(), createElementBlock("div", {
|
|
6993
7016
|
key: _ctx.panelKey
|
|
6994
|
-
}, [createElementVNode("ul", _hoisted_3$
|
|
7017
|
+
}, [createElementVNode("ul", _hoisted_3$d, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.sortWeekList, (week) => {
|
|
6995
7018
|
return openBlock(), createElementBlock("li", {
|
|
6996
7019
|
key: week.index
|
|
6997
7020
|
}, toDisplayString(_ctx.getDayAbbr(week.index)), 1);
|
|
@@ -7054,6 +7077,7 @@ var DayPickerPanel = defineComponent({
|
|
|
7054
7077
|
var days = ref([]);
|
|
7055
7078
|
var reverse = ref(false);
|
|
7056
7079
|
var panelKey = ref(0);
|
|
7080
|
+
var headerEl = ref(null);
|
|
7057
7081
|
var panelBtnDisabled = reactive({
|
|
7058
7082
|
left: false,
|
|
7059
7083
|
right: false
|
|
@@ -7226,6 +7250,9 @@ var DayPickerPanel = defineComponent({
|
|
|
7226
7250
|
var chooseDay = (day) => {
|
|
7227
7251
|
emit("choose-day", day);
|
|
7228
7252
|
};
|
|
7253
|
+
var forwardRef = (checkType) => {
|
|
7254
|
+
headerEl.value.checkDate(checkType);
|
|
7255
|
+
};
|
|
7229
7256
|
onMounted(() => {
|
|
7230
7257
|
initDate();
|
|
7231
7258
|
initHeader();
|
|
@@ -7237,9 +7264,11 @@ var DayPickerPanel = defineComponent({
|
|
|
7237
7264
|
return {
|
|
7238
7265
|
days,
|
|
7239
7266
|
reverse,
|
|
7267
|
+
headerEl,
|
|
7240
7268
|
panelKey,
|
|
7241
7269
|
sortWeekList,
|
|
7242
7270
|
panelBtnDisabled,
|
|
7271
|
+
forwardRef,
|
|
7243
7272
|
filterDay,
|
|
7244
7273
|
getDayAbbr,
|
|
7245
7274
|
checkDate,
|
|
@@ -7248,9 +7277,6 @@ var DayPickerPanel = defineComponent({
|
|
|
7248
7277
|
};
|
|
7249
7278
|
}
|
|
7250
7279
|
});
|
|
7251
|
-
var _hoisted_1$q = {
|
|
7252
|
-
class: "var-date-picker-body"
|
|
7253
|
-
};
|
|
7254
7280
|
function render$B(_ctx, _cache) {
|
|
7255
7281
|
var _component_year_picker_panel = resolveComponent("year-picker-panel");
|
|
7256
7282
|
var _component_month_picker_panel = resolveComponent("month-picker-panel");
|
|
@@ -7271,7 +7297,7 @@ function render$B(_ctx, _cache) {
|
|
|
7271
7297
|
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]]),
|
|
7272
7298
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.clickEl("date"))
|
|
7273
7299
|
}, [createVNode(Transition, {
|
|
7274
|
-
name: _ctx.multiple ? "" : _ctx.reverse ? "
|
|
7300
|
+
name: _ctx.multiple ? "" : "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatey"
|
|
7275
7301
|
}, {
|
|
7276
7302
|
default: withCtx(() => {
|
|
7277
7303
|
var _ctx$chooseMonth, _ctx$chooseMonth2, _ctx$chooseMonth3;
|
|
@@ -7300,16 +7326,28 @@ function render$B(_ctx, _cache) {
|
|
|
7300
7326
|
}, _ctx.slotProps)), () => [createTextVNode(toDisplayString(_ctx.getDateTitle), 1)])]))];
|
|
7301
7327
|
}),
|
|
7302
7328
|
_: 3
|
|
7303
|
-
}, 8, ["name"])], 2)], 4), createElementVNode("div",
|
|
7329
|
+
}, 8, ["name"])], 2)], 4), createElementVNode("div", {
|
|
7330
|
+
class: "var-date-picker-body",
|
|
7331
|
+
onTouchstart: _cache[2] || (_cache[2] = function() {
|
|
7332
|
+
return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
|
|
7333
|
+
}),
|
|
7334
|
+
onTouchmove: _cache[3] || (_cache[3] = function() {
|
|
7335
|
+
return _ctx.handleTouchmove && _ctx.handleTouchmove(...arguments);
|
|
7336
|
+
}),
|
|
7337
|
+
onTouchend: _cache[4] || (_cache[4] = function() {
|
|
7338
|
+
return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
|
|
7339
|
+
})
|
|
7340
|
+
}, [createVNode(Transition, {
|
|
7304
7341
|
name: "var-date-picker-panel-fade"
|
|
7305
7342
|
}, {
|
|
7306
|
-
default: withCtx(() => [_ctx.
|
|
7343
|
+
default: withCtx(() => [_ctx.getPanelType === "year" ? (openBlock(), createBlock(_component_year_picker_panel, {
|
|
7307
7344
|
key: 0,
|
|
7308
7345
|
"component-props": _ctx.componentProps,
|
|
7309
7346
|
preview: _ctx.previewYear,
|
|
7310
7347
|
onChooseYear: _ctx.getChooseYear
|
|
7311
|
-
}, null, 8, ["component-props", "preview", "onChooseYear"])) :
|
|
7348
|
+
}, null, 8, ["component-props", "preview", "onChooseYear"])) : _ctx.getPanelType === "month" ? (openBlock(), createBlock(_component_month_picker_panel, {
|
|
7312
7349
|
key: 1,
|
|
7350
|
+
ref: "monthPanelEl",
|
|
7313
7351
|
current: _ctx.currentDate,
|
|
7314
7352
|
choose: _ctx.getChoose,
|
|
7315
7353
|
preview: _ctx.getPreview,
|
|
@@ -7317,8 +7355,9 @@ function render$B(_ctx, _cache) {
|
|
|
7317
7355
|
"component-props": _ctx.componentProps,
|
|
7318
7356
|
onChooseMonth: _ctx.getChooseMonth,
|
|
7319
7357
|
onCheckPreview: _ctx.checkPreview
|
|
7320
|
-
}, null, 8, ["current", "choose", "preview", "click-year", "component-props", "onChooseMonth", "onCheckPreview"])) :
|
|
7358
|
+
}, null, 8, ["current", "choose", "preview", "click-year", "component-props", "onChooseMonth", "onCheckPreview"])) : _ctx.getPanelType === "date" ? (openBlock(), createBlock(_component_day_picker_panel, {
|
|
7321
7359
|
key: 2,
|
|
7360
|
+
ref: "dayPanelEl",
|
|
7322
7361
|
current: _ctx.currentDate,
|
|
7323
7362
|
choose: _ctx.getChoose,
|
|
7324
7363
|
preview: _ctx.getPreview,
|
|
@@ -7328,7 +7367,7 @@ function render$B(_ctx, _cache) {
|
|
|
7328
7367
|
onCheckPreview: _ctx.checkPreview
|
|
7329
7368
|
}, null, 8, ["current", "choose", "preview", "component-props", "click-month", "onChooseDay", "onCheckPreview"])) : createCommentVNode("v-if", true)]),
|
|
7330
7369
|
_: 1
|
|
7331
|
-
})])], 2);
|
|
7370
|
+
})], 32)], 2);
|
|
7332
7371
|
}
|
|
7333
7372
|
var DatePicker = defineComponent({
|
|
7334
7373
|
render: render$B,
|
|
@@ -7340,6 +7379,10 @@ var DatePicker = defineComponent({
|
|
|
7340
7379
|
},
|
|
7341
7380
|
props: props$z,
|
|
7342
7381
|
setup(props2) {
|
|
7382
|
+
var startX = 0;
|
|
7383
|
+
var startY = 0;
|
|
7384
|
+
var checkType = "";
|
|
7385
|
+
var touchDirection;
|
|
7343
7386
|
var currentDate = dayjs().format("YYYY-MM-D");
|
|
7344
7387
|
var [currentYear, currentMonth] = currentDate.split("-");
|
|
7345
7388
|
var monthDes = MONTH_LIST.find((month) => month.index === currentMonth);
|
|
@@ -7356,6 +7399,8 @@ var DatePicker = defineComponent({
|
|
|
7356
7399
|
var chooseDays = ref([]);
|
|
7357
7400
|
var chooseRangeMonth = ref([]);
|
|
7358
7401
|
var chooseRangeDay = ref([]);
|
|
7402
|
+
var monthPanelEl = ref(null);
|
|
7403
|
+
var dayPanelEl = ref(null);
|
|
7359
7404
|
var componentProps = reactive({
|
|
7360
7405
|
allowedDates: props2.allowedDates,
|
|
7361
7406
|
type: props2.type,
|
|
@@ -7418,14 +7463,27 @@ var DatePicker = defineComponent({
|
|
|
7418
7463
|
return chooseMonth.value.index + "-" + showDay + " " + weekName.slice(0, 3);
|
|
7419
7464
|
return weekName.slice(0, 3) + ", " + monthName.slice(0, 3) + " " + chooseDay.value;
|
|
7420
7465
|
});
|
|
7466
|
+
var getPanelType = computed(() => {
|
|
7467
|
+
if (isYearPanel.value)
|
|
7468
|
+
return "year";
|
|
7469
|
+
if (props2.type === "month" || isMonthPanel.value)
|
|
7470
|
+
return "month";
|
|
7471
|
+
if (props2.type === "date")
|
|
7472
|
+
return "date";
|
|
7473
|
+
return "";
|
|
7474
|
+
});
|
|
7475
|
+
var isUntouchable = computed(() => {
|
|
7476
|
+
return !props2.touchable || ["", "year"].includes(getPanelType.value);
|
|
7477
|
+
});
|
|
7421
7478
|
var slotProps = computed(() => {
|
|
7422
|
-
var _chooseMonth$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2
|
|
7479
|
+
var _chooseMonth$value, _chooseDay$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2;
|
|
7423
7480
|
var weekIndex = dayjs(chooseYear.value + "-" + ((_chooseMonth$value = chooseMonth.value) == null ? void 0 : _chooseMonth$value.index) + "-" + chooseDay.value).day();
|
|
7481
|
+
var date = chooseDay.value ? (_chooseDay$value = chooseDay.value) == null ? void 0 : _chooseDay$value.padStart(2, "0") : "";
|
|
7424
7482
|
return {
|
|
7425
7483
|
week: "" + weekIndex,
|
|
7426
7484
|
year: (_chooseYear$value = chooseYear.value) != null ? _chooseYear$value : "",
|
|
7427
7485
|
month: (_chooseMonth$value$in = (_chooseMonth$value2 = chooseMonth.value) == null ? void 0 : _chooseMonth$value2.index) != null ? _chooseMonth$value$in : "",
|
|
7428
|
-
date
|
|
7486
|
+
date
|
|
7429
7487
|
};
|
|
7430
7488
|
});
|
|
7431
7489
|
var formatRange = computed(() => getChoose.value.chooseRangeDay.map((choose) => dayjs(choose).format("YYYY-MM-DD")));
|
|
@@ -7444,6 +7502,38 @@ var DatePicker = defineComponent({
|
|
|
7444
7502
|
isMonthPanel.value = false;
|
|
7445
7503
|
}
|
|
7446
7504
|
};
|
|
7505
|
+
var handleTouchstart = (event) => {
|
|
7506
|
+
if (isUntouchable.value)
|
|
7507
|
+
return;
|
|
7508
|
+
var {
|
|
7509
|
+
clientX,
|
|
7510
|
+
clientY
|
|
7511
|
+
} = event.touches[0];
|
|
7512
|
+
startX = clientX;
|
|
7513
|
+
startY = clientY;
|
|
7514
|
+
};
|
|
7515
|
+
var getDirection = (x, y) => {
|
|
7516
|
+
return x >= y && x > 20 ? "x" : "y";
|
|
7517
|
+
};
|
|
7518
|
+
var handleTouchmove = (event) => {
|
|
7519
|
+
if (isUntouchable.value)
|
|
7520
|
+
return;
|
|
7521
|
+
var {
|
|
7522
|
+
clientX,
|
|
7523
|
+
clientY
|
|
7524
|
+
} = event.touches[0];
|
|
7525
|
+
var x = clientX - startX;
|
|
7526
|
+
var y = clientY - startY;
|
|
7527
|
+
touchDirection = getDirection(Math.abs(x), Math.abs(y));
|
|
7528
|
+
checkType = x > 0 ? "prev" : "next";
|
|
7529
|
+
};
|
|
7530
|
+
var handleTouchend = () => {
|
|
7531
|
+
if (isUntouchable.value || touchDirection !== "x")
|
|
7532
|
+
return;
|
|
7533
|
+
var componentRef = getPanelType.value === "month" ? monthPanelEl : dayPanelEl;
|
|
7534
|
+
componentRef.value.forwardRef(checkType);
|
|
7535
|
+
resetState();
|
|
7536
|
+
};
|
|
7447
7537
|
var updateRange = (date, type) => {
|
|
7448
7538
|
var rangeDate = type === "month" ? chooseRangeMonth : chooseRangeDay;
|
|
7449
7539
|
rangeDate.value = rangeDone.value ? [date, date] : [rangeDate.value[0], date];
|
|
@@ -7530,8 +7620,8 @@ var DatePicker = defineComponent({
|
|
|
7530
7620
|
isYearPanel.value = false;
|
|
7531
7621
|
isMonthPanel.value = true;
|
|
7532
7622
|
};
|
|
7533
|
-
var checkPreview = (type,
|
|
7534
|
-
var changeValue =
|
|
7623
|
+
var checkPreview = (type, checkType2) => {
|
|
7624
|
+
var changeValue = checkType2 === "prev" ? -1 : 1;
|
|
7535
7625
|
if (type === "year") {
|
|
7536
7626
|
previewYear.value = "" + (toNumber(previewYear.value) + changeValue);
|
|
7537
7627
|
} else {
|
|
@@ -7598,6 +7688,12 @@ var DatePicker = defineComponent({
|
|
|
7598
7688
|
previewMonth.value = monthDes2;
|
|
7599
7689
|
previewYear.value = yearValue;
|
|
7600
7690
|
};
|
|
7691
|
+
var resetState = () => {
|
|
7692
|
+
startY = 0;
|
|
7693
|
+
startX = 0;
|
|
7694
|
+
checkType = "";
|
|
7695
|
+
touchDirection = void 0;
|
|
7696
|
+
};
|
|
7601
7697
|
watch(() => props2.modelValue, (value) => {
|
|
7602
7698
|
if (!checkValue() || invalidFormatDate(value) || !value)
|
|
7603
7699
|
return;
|
|
@@ -7616,7 +7712,10 @@ var DatePicker = defineComponent({
|
|
|
7616
7712
|
}, {
|
|
7617
7713
|
immediate: true
|
|
7618
7714
|
});
|
|
7715
|
+
watch(getPanelType, resetState);
|
|
7619
7716
|
return {
|
|
7717
|
+
monthPanelEl,
|
|
7718
|
+
dayPanelEl,
|
|
7620
7719
|
reverse,
|
|
7621
7720
|
currentDate,
|
|
7622
7721
|
chooseMonth,
|
|
@@ -7627,12 +7726,16 @@ var DatePicker = defineComponent({
|
|
|
7627
7726
|
isMonthPanel,
|
|
7628
7727
|
getMonthTitle,
|
|
7629
7728
|
getDateTitle,
|
|
7729
|
+
getPanelType,
|
|
7630
7730
|
getChoose,
|
|
7631
7731
|
getPreview,
|
|
7632
7732
|
componentProps,
|
|
7633
7733
|
slotProps,
|
|
7634
7734
|
formatRange,
|
|
7635
7735
|
clickEl,
|
|
7736
|
+
handleTouchstart,
|
|
7737
|
+
handleTouchmove,
|
|
7738
|
+
handleTouchend,
|
|
7636
7739
|
getChooseDay,
|
|
7637
7740
|
getChooseMonth,
|
|
7638
7741
|
getChooseYear,
|
|
@@ -9037,12 +9140,16 @@ var props$t = _extends$3({
|
|
|
9037
9140
|
]));
|
|
9038
9141
|
var DISTANCE_OFFSET = 12;
|
|
9039
9142
|
var EVENT_DELAY = 200;
|
|
9143
|
+
var TAP_DELAY = 350;
|
|
9040
9144
|
var ANIMATION_DURATION = 200;
|
|
9041
9145
|
var _hoisted_1$k = ["src", "alt"];
|
|
9042
9146
|
var _hoisted_2$f = {
|
|
9043
9147
|
key: 0,
|
|
9044
9148
|
class: "var-image-preview__indicators"
|
|
9045
9149
|
};
|
|
9150
|
+
var _hoisted_3$c = {
|
|
9151
|
+
class: "var-image-preview__extra"
|
|
9152
|
+
};
|
|
9046
9153
|
function render$u(_ctx, _cache) {
|
|
9047
9154
|
var _component_var_swipe_item = resolveComponent("var-swipe-item");
|
|
9048
9155
|
var _component_var_swipe = resolveComponent("var-swipe");
|
|
@@ -9119,7 +9226,7 @@ function render$u(_ctx, _cache) {
|
|
|
9119
9226
|
name: "close-circle",
|
|
9120
9227
|
"var-image-preview-cover": "",
|
|
9121
9228
|
onClick: _ctx.close
|
|
9122
|
-
}, null, 8, ["onClick"])) : createCommentVNode("v-if", true)])]),
|
|
9229
|
+
}, null, 8, ["onClick"])) : createCommentVNode("v-if", true)]), createElementVNode("div", _hoisted_3$c, [renderSlot(_ctx.$slots, "extra")])]),
|
|
9123
9230
|
_: 3
|
|
9124
9231
|
}, 8, ["show", "lock-scroll", "teleport", "onOpen", "onClose", "onClosed", "onOpened", "onRouteChange"]);
|
|
9125
9232
|
}
|
|
@@ -9195,10 +9302,10 @@ var VarImagePreview = defineComponent({
|
|
|
9195
9302
|
return getDistance(prevTouch, currentTouch) <= DISTANCE_OFFSET && currentTouch.timestamp - prevTouch.timestamp <= EVENT_DELAY && prevTouch.target === currentTouch.target;
|
|
9196
9303
|
};
|
|
9197
9304
|
var isTapTouch = (target) => {
|
|
9198
|
-
if (!startTouch || !prevTouch) {
|
|
9305
|
+
if (!target || !startTouch || !prevTouch) {
|
|
9199
9306
|
return false;
|
|
9200
9307
|
}
|
|
9201
|
-
return getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET && (target === startTouch.target || target.parentNode === startTouch.target);
|
|
9308
|
+
return getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET && Date.now() - prevTouch.timestamp < TAP_DELAY && (target === startTouch.target || target.parentNode === startTouch.target);
|
|
9202
9309
|
};
|
|
9203
9310
|
var handleTouchend = (event) => {
|
|
9204
9311
|
checker = window.setTimeout(() => {
|
|
@@ -12246,6 +12353,9 @@ var props$f = {
|
|
|
12246
12353
|
type: [String, Number],
|
|
12247
12354
|
default: "2"
|
|
12248
12355
|
},
|
|
12356
|
+
namespace: {
|
|
12357
|
+
type: String
|
|
12358
|
+
},
|
|
12249
12359
|
half: {
|
|
12250
12360
|
type: Boolean,
|
|
12251
12361
|
default: false
|
|
@@ -12298,11 +12408,12 @@ function render$h(_ctx, _cache) {
|
|
|
12298
12408
|
onClick: ($event) => _ctx.handleClick(val, $event)
|
|
12299
12409
|
}, [createVNode(_component_var_icon, {
|
|
12300
12410
|
transition: 0,
|
|
12411
|
+
namespace: _ctx.namespace,
|
|
12301
12412
|
name: _ctx.getIconName(val),
|
|
12302
12413
|
style: normalizeStyle({
|
|
12303
12414
|
fontSize: _ctx.toSizeUnit(_ctx.size)
|
|
12304
12415
|
})
|
|
12305
|
-
}, null, 8, ["name", "style"])], 14, _hoisted_3$6)), [[_directive_ripple, {
|
|
12416
|
+
}, null, 8, ["namespace", "name", "style"])], 14, _hoisted_3$6)), [[_directive_ripple, {
|
|
12306
12417
|
disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple
|
|
12307
12418
|
}]]);
|
|
12308
12419
|
}), 128))]), createVNode(_component_var_form_details, {
|