@varlet/ui 1.26.2 → 1.26.3
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 +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/image-preview/ImagePreview.js +3 -2
- package/es/varlet.esm.js +20 -9
- package/highlight/web-types.json +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/image-preview/ImagePreview.js +3 -2
- package/package.json +4 -4
- package/types/radioGroup.d.ts +3 -3
- package/umd/varlet.js +3 -3
package/es/checkbox/Checkbox.js
CHANGED
|
@@ -155,6 +155,10 @@ export default defineComponent({
|
|
|
155
155
|
uncheckedValue
|
|
156
156
|
} = props;
|
|
157
157
|
value.value = values.includes(checkedValue) ? checkedValue : uncheckedValue;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
var resetWithAnimation = () => {
|
|
161
|
+
withAnimation.value = false;
|
|
158
162
|
}; // expose
|
|
159
163
|
|
|
160
164
|
|
|
@@ -194,7 +198,8 @@ export default defineComponent({
|
|
|
194
198
|
sync,
|
|
195
199
|
validate,
|
|
196
200
|
resetValidation,
|
|
197
|
-
reset
|
|
201
|
+
reset,
|
|
202
|
+
resetWithAnimation
|
|
198
203
|
};
|
|
199
204
|
bindCheckboxGroup == null ? void 0 : bindCheckboxGroup(checkboxProvider);
|
|
200
205
|
bindForm == null ? void 0 : bindForm(checkboxProvider);
|
|
@@ -99,7 +99,11 @@ export default defineComponent({
|
|
|
99
99
|
sync
|
|
100
100
|
} = _ref;
|
|
101
101
|
return sync(props.modelValue);
|
|
102
|
-
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
var resetWithAnimation = () => {
|
|
105
|
+
checkboxes.forEach(checkbox => checkbox.resetWithAnimation());
|
|
106
|
+
}; // expose
|
|
103
107
|
|
|
104
108
|
|
|
105
109
|
var checkAll = () => {
|
|
@@ -112,6 +116,7 @@ export default defineComponent({
|
|
|
112
116
|
return checkedValue.value;
|
|
113
117
|
});
|
|
114
118
|
var changedModelValue = uniq(checkedValues);
|
|
119
|
+
resetWithAnimation();
|
|
115
120
|
(_props$onUpdateModel2 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel2.call(props, changedModelValue);
|
|
116
121
|
return changedModelValue;
|
|
117
122
|
}; // expose
|
|
@@ -132,6 +137,7 @@ export default defineComponent({
|
|
|
132
137
|
return checkedValue.value;
|
|
133
138
|
});
|
|
134
139
|
var changedModelValue = uniq(checkedValues);
|
|
140
|
+
resetWithAnimation();
|
|
135
141
|
(_props$onUpdateModel3 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel3.call(props, changedModelValue);
|
|
136
142
|
return changedModelValue;
|
|
137
143
|
}; // expose
|
|
@@ -40,7 +40,7 @@ export function render(_ctx, _cache) {
|
|
|
40
40
|
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]]),
|
|
41
41
|
onClick: _cache[1] || (_cache[1] = $event => _ctx.clickEl('date'))
|
|
42
42
|
}, [_createVNode(_Transition, {
|
|
43
|
-
name: _ctx.multiple ? '' : _ctx.reverse ? '
|
|
43
|
+
name: _ctx.multiple ? '' : "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatey"
|
|
44
44
|
}, {
|
|
45
45
|
default: _withCtx(() => {
|
|
46
46
|
var _ctx$chooseMonth, _ctx$chooseMonth2, _ctx$chooseMonth3;
|
|
@@ -225,14 +225,15 @@ export default defineComponent({
|
|
|
225
225
|
return weekName.slice(0, 3) + ", " + monthName.slice(0, 3) + " " + chooseDay.value;
|
|
226
226
|
});
|
|
227
227
|
var slotProps = computed(() => {
|
|
228
|
-
var _chooseMonth$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2
|
|
228
|
+
var _chooseMonth$value, _chooseDay$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2;
|
|
229
229
|
|
|
230
230
|
var weekIndex = dayjs(chooseYear.value + "-" + ((_chooseMonth$value = chooseMonth.value) == null ? void 0 : _chooseMonth$value.index) + "-" + chooseDay.value).day();
|
|
231
|
+
var date = chooseDay.value ? (_chooseDay$value = chooseDay.value) == null ? void 0 : _chooseDay$value.padStart(2, '0') : '';
|
|
231
232
|
return {
|
|
232
233
|
week: "" + weekIndex,
|
|
233
234
|
year: (_chooseYear$value = chooseYear.value) != null ? _chooseYear$value : '',
|
|
234
235
|
month: (_chooseMonth$value$in = (_chooseMonth$value2 = chooseMonth.value) == null ? void 0 : _chooseMonth$value2.index) != null ? _chooseMonth$value$in : '',
|
|
235
|
-
date
|
|
236
|
+
date
|
|
236
237
|
};
|
|
237
238
|
});
|
|
238
239
|
var formatRange = computed(() => getChoose.value.chooseRangeDay.map(choose => dayjs(choose).format('YYYY-MM-DD')));
|
|
@@ -41,7 +41,7 @@ export function render(_ctx, _cache) {
|
|
|
41
41
|
}, null, 8
|
|
42
42
|
/* PROPS */
|
|
43
43
|
, ["date", "disabled", "onCheckPanel", "onCheckDate"]), _createVNode(_Transition, {
|
|
44
|
-
name: _ctx.reverse ? '
|
|
44
|
+
name: "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatex"
|
|
45
45
|
}, {
|
|
46
46
|
default: _withCtx(() => [(_openBlock(), _createElementBlock("div", {
|
|
47
47
|
key: _ctx.panelKey
|
|
@@ -35,7 +35,7 @@ export function render(_ctx, _cache) {
|
|
|
35
35
|
}, null, 8
|
|
36
36
|
/* PROPS */
|
|
37
37
|
, ["date", "disabled", "onCheckPanel", "onCheckDate"]), _createVNode(_Transition, {
|
|
38
|
-
name: _ctx.reverse ? '
|
|
38
|
+
name: "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatex"
|
|
39
39
|
}, {
|
|
40
40
|
default: _withCtx(() => [(_openBlock(), _createElementBlock("ul", {
|
|
41
41
|
key: _ctx.panelKey
|
|
@@ -36,7 +36,7 @@ export function render(_ctx, _cache) {
|
|
|
36
36
|
class: "var-picker-header__value",
|
|
37
37
|
onClick: _cache[1] || (_cache[1] = $event => _ctx.$emit('check-panel'))
|
|
38
38
|
}, [_createVNode(_Transition, {
|
|
39
|
-
name: _ctx.reverse ? '
|
|
39
|
+
name: "var-date-picker" + (_ctx.reverse ? '-reverse' : '') + "-translatex"
|
|
40
40
|
}, {
|
|
41
41
|
default: _withCtx(() => [(_openBlock(), _createElementBlock("div", {
|
|
42
42
|
key: _ctx.showDate
|
|
@@ -7,6 +7,7 @@ import { props } from './props';
|
|
|
7
7
|
import { toNumber } from '../utils/shared';
|
|
8
8
|
var DISTANCE_OFFSET = 12;
|
|
9
9
|
var EVENT_DELAY = 200;
|
|
10
|
+
var TAP_DELAY = 250;
|
|
10
11
|
var ANIMATION_DURATION = 200;
|
|
11
12
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
12
13
|
|
|
@@ -203,11 +204,11 @@ export default defineComponent({
|
|
|
203
204
|
};
|
|
204
205
|
|
|
205
206
|
var isTapTouch = target => {
|
|
206
|
-
if (!startTouch || !prevTouch) {
|
|
207
|
+
if (!target || !startTouch || !prevTouch) {
|
|
207
208
|
return false;
|
|
208
209
|
}
|
|
209
210
|
|
|
210
|
-
return getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET && (target === startTouch.target || target.parentNode === startTouch.target);
|
|
211
|
+
return getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET && Date.now() - prevTouch.timestamp < TAP_DELAY && (target === startTouch.target || target.parentNode === startTouch.target);
|
|
211
212
|
};
|
|
212
213
|
|
|
213
214
|
var handleTouchend = event => {
|
package/es/varlet.esm.js
CHANGED
|
@@ -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);
|
|
@@ -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
|
};
|
|
@@ -6544,7 +6553,7 @@ function render$F(_ctx, _cache) {
|
|
|
6544
6553
|
class: "var-picker-header__value",
|
|
6545
6554
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("check-panel"))
|
|
6546
6555
|
}, [createVNode(Transition, {
|
|
6547
|
-
name: _ctx.reverse ? "
|
|
6556
|
+
name: "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatex"
|
|
6548
6557
|
}, {
|
|
6549
6558
|
default: withCtx(() => [(openBlock(), createElementBlock("div", {
|
|
6550
6559
|
key: _ctx.showDate
|
|
@@ -6655,7 +6664,7 @@ function render$E(_ctx, _cache) {
|
|
|
6655
6664
|
onCheckPanel: _ctx.clickYear,
|
|
6656
6665
|
onCheckDate: _ctx.checkDate
|
|
6657
6666
|
}, null, 8, ["date", "disabled", "onCheckPanel", "onCheckDate"]), createVNode(Transition, {
|
|
6658
|
-
name: _ctx.reverse ? "
|
|
6667
|
+
name: "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatex"
|
|
6659
6668
|
}, {
|
|
6660
6669
|
default: withCtx(() => [(openBlock(), createElementBlock("ul", {
|
|
6661
6670
|
key: _ctx.panelKey
|
|
@@ -6987,7 +6996,7 @@ function render$C(_ctx, _cache) {
|
|
|
6987
6996
|
onCheckPanel: _ctx.clickMonth,
|
|
6988
6997
|
onCheckDate: _ctx.checkDate
|
|
6989
6998
|
}, null, 8, ["date", "disabled", "onCheckPanel", "onCheckDate"]), createVNode(Transition, {
|
|
6990
|
-
name: _ctx.reverse ? "
|
|
6999
|
+
name: "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatex"
|
|
6991
7000
|
}, {
|
|
6992
7001
|
default: withCtx(() => [(openBlock(), createElementBlock("div", {
|
|
6993
7002
|
key: _ctx.panelKey
|
|
@@ -7271,7 +7280,7 @@ function render$B(_ctx, _cache) {
|
|
|
7271
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]]),
|
|
7272
7281
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.clickEl("date"))
|
|
7273
7282
|
}, [createVNode(Transition, {
|
|
7274
|
-
name: _ctx.multiple ? "" : _ctx.reverse ? "
|
|
7283
|
+
name: _ctx.multiple ? "" : "var-date-picker" + (_ctx.reverse ? "-reverse" : "") + "-translatey"
|
|
7275
7284
|
}, {
|
|
7276
7285
|
default: withCtx(() => {
|
|
7277
7286
|
var _ctx$chooseMonth, _ctx$chooseMonth2, _ctx$chooseMonth3;
|
|
@@ -7419,13 +7428,14 @@ var DatePicker = defineComponent({
|
|
|
7419
7428
|
return weekName.slice(0, 3) + ", " + monthName.slice(0, 3) + " " + chooseDay.value;
|
|
7420
7429
|
});
|
|
7421
7430
|
var slotProps = computed(() => {
|
|
7422
|
-
var _chooseMonth$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2
|
|
7431
|
+
var _chooseMonth$value, _chooseDay$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2;
|
|
7423
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") : "";
|
|
7424
7434
|
return {
|
|
7425
7435
|
week: "" + weekIndex,
|
|
7426
7436
|
year: (_chooseYear$value = chooseYear.value) != null ? _chooseYear$value : "",
|
|
7427
7437
|
month: (_chooseMonth$value$in = (_chooseMonth$value2 = chooseMonth.value) == null ? void 0 : _chooseMonth$value2.index) != null ? _chooseMonth$value$in : "",
|
|
7428
|
-
date
|
|
7438
|
+
date
|
|
7429
7439
|
};
|
|
7430
7440
|
});
|
|
7431
7441
|
var formatRange = computed(() => getChoose.value.chooseRangeDay.map((choose) => dayjs(choose).format("YYYY-MM-DD")));
|
|
@@ -9037,6 +9047,7 @@ var props$t = _extends$3({
|
|
|
9037
9047
|
]));
|
|
9038
9048
|
var DISTANCE_OFFSET = 12;
|
|
9039
9049
|
var EVENT_DELAY = 200;
|
|
9050
|
+
var TAP_DELAY = 250;
|
|
9040
9051
|
var ANIMATION_DURATION = 200;
|
|
9041
9052
|
var _hoisted_1$k = ["src", "alt"];
|
|
9042
9053
|
var _hoisted_2$f = {
|
|
@@ -9195,10 +9206,10 @@ var VarImagePreview = defineComponent({
|
|
|
9195
9206
|
return getDistance(prevTouch, currentTouch) <= DISTANCE_OFFSET && currentTouch.timestamp - prevTouch.timestamp <= EVENT_DELAY && prevTouch.target === currentTouch.target;
|
|
9196
9207
|
};
|
|
9197
9208
|
var isTapTouch = (target) => {
|
|
9198
|
-
if (!startTouch || !prevTouch) {
|
|
9209
|
+
if (!target || !startTouch || !prevTouch) {
|
|
9199
9210
|
return false;
|
|
9200
9211
|
}
|
|
9201
|
-
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);
|
|
9202
9213
|
};
|
|
9203
9214
|
var handleTouchend = (event) => {
|
|
9204
9215
|
checker = window.setTimeout(() => {
|
package/highlight/web-types.json
CHANGED
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
|
|
@@ -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 = 250;
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.3",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
},
|
|
40
40
|
"gitHead": "ee9c3866bedad96c86365b0f9888a3a6bb781b1f",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@varlet/icons": "1.26.
|
|
42
|
+
"@varlet/icons": "1.26.3",
|
|
43
43
|
"dayjs": "^1.10.4",
|
|
44
44
|
"decimal.js": "^10.2.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@varlet/cli": "1.26.
|
|
48
|
-
"@varlet/touch-emulator": "1.26.
|
|
47
|
+
"@varlet/cli": "1.26.3",
|
|
48
|
+
"@varlet/touch-emulator": "1.26.3",
|
|
49
49
|
"@vue/test-utils": "2.0.0-rc.6",
|
|
50
50
|
"@vue/runtime-core": "3.2.25",
|
|
51
51
|
"typescript": "^4.4.4",
|
package/types/radioGroup.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import { VarComponent } from './varComponent'
|
|
|
3
3
|
export type RadioGroupValidateTriggers = 'onChange'
|
|
4
4
|
|
|
5
5
|
export interface RadioGroupProps {
|
|
6
|
-
modelValue?: any
|
|
6
|
+
modelValue?: any
|
|
7
7
|
direction?: 'horizontal' | 'vertical'
|
|
8
8
|
validateTrigger?: Array<RadioGroupValidateTriggers>
|
|
9
9
|
rules?: Array<(value: any) => any>
|
|
10
|
-
onChange?: (value:
|
|
11
|
-
'onUpdate:modelValue'?: (value:
|
|
10
|
+
onChange?: (value: any) => void
|
|
11
|
+
'onUpdate:modelValue'?: (value: any) => void
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export class RadioGroup extends VarComponent {
|