@varlet/ui 3.5.2 → 3.5.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/date-picker/DatePicker.mjs +6 -5
- package/es/date-picker/date-picker.css +1 -1
- package/es/date-picker/src/day-picker-panel.mjs +1 -0
- package/es/date-picker/src/month-picker-panel.mjs +8 -7
- package/es/date-picker/src/year-picker-panel.mjs +11 -8
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/snackbar/style/index.mjs +1 -1
- package/es/style.css +1 -1
- package/es/time-picker/TimePicker.mjs +27 -14
- package/es/time-picker/timePicker.css +1 -1
- package/es/varlet.esm.js +2155 -2151
- package/highlight/web-types.en-US.json +1 -1
- package/highlight/web-types.zh-CN.json +1 -1
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +53 -34
- package/package.json +7 -7
- package/types/styleVars.d.ts +3 -0
- package/umd/varlet.js +7 -7
package/lib/varlet.cjs.js
CHANGED
|
@@ -13379,13 +13379,14 @@ const __sfc__$T = vue.defineComponent({
|
|
|
13379
13379
|
headerEl.value.checkDate(checkType);
|
|
13380
13380
|
};
|
|
13381
13381
|
vue.watch(
|
|
13382
|
-
() => props2.preview.previewYear,
|
|
13383
|
-
(year) => {
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
}
|
|
13387
|
-
if (
|
|
13388
|
-
|
|
13382
|
+
() => [props2.preview.previewYear, props2.componentProps.max, props2.componentProps.min],
|
|
13383
|
+
([year, max2, min2]) => {
|
|
13384
|
+
if (max2) {
|
|
13385
|
+
panelBtnDisabled.right = !dayjs(`${toNumber(year) + 1}`).isSameOrBefore(dayjs(max2), "year");
|
|
13386
|
+
}
|
|
13387
|
+
if (min2) {
|
|
13388
|
+
panelBtnDisabled.left = !dayjs(`${toNumber(year) - 1}`).isSameOrAfter(dayjs(min2), "year");
|
|
13389
|
+
}
|
|
13389
13390
|
},
|
|
13390
13391
|
{ immediate: true }
|
|
13391
13392
|
);
|
|
@@ -13820,15 +13821,18 @@ const __sfc__$R = vue.defineComponent({
|
|
|
13820
13821
|
}
|
|
13821
13822
|
);
|
|
13822
13823
|
vue.watch(
|
|
13823
|
-
yearList,
|
|
13824
|
-
(
|
|
13825
|
-
const
|
|
13826
|
-
|
|
13827
|
-
} = props2;
|
|
13828
|
-
if (max2)
|
|
13824
|
+
() => [yearList.value, props2.componentProps.max, props2.componentProps.min],
|
|
13825
|
+
(newVal) => {
|
|
13826
|
+
const [list, max2, min2] = newVal;
|
|
13827
|
+
if (max2) {
|
|
13829
13828
|
panelBtnDisabled.right = !dayjs(`${toNumber(list[list.length - 1])}`).isSameOrBefore(dayjs(max2), "year");
|
|
13830
|
-
|
|
13831
|
-
if (
|
|
13829
|
+
}
|
|
13830
|
+
if (min2) {
|
|
13831
|
+
panelBtnDisabled.left = !dayjs(`${toNumber(list[0])}`).isSameOrAfter(dayjs(min2), "year");
|
|
13832
|
+
}
|
|
13833
|
+
if (toNumber(list[0] <= 0)) {
|
|
13834
|
+
panelBtnDisabled.left = false;
|
|
13835
|
+
}
|
|
13832
13836
|
},
|
|
13833
13837
|
{
|
|
13834
13838
|
immediate: true
|
|
@@ -14165,6 +14169,7 @@ const __sfc__$Q = vue.defineComponent({
|
|
|
14165
14169
|
initHeader();
|
|
14166
14170
|
}
|
|
14167
14171
|
);
|
|
14172
|
+
vue.watch(() => [props2.componentProps.max, props2.componentProps.min], initHeader);
|
|
14168
14173
|
return {
|
|
14169
14174
|
n: n$P,
|
|
14170
14175
|
nDate,
|
|
@@ -14481,7 +14486,7 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14481
14486
|
const yearPanelEl = vue.ref(null);
|
|
14482
14487
|
const monthPanelEl = vue.ref(null);
|
|
14483
14488
|
const dayPanelEl = vue.ref(null);
|
|
14484
|
-
const componentProps = vue.
|
|
14489
|
+
const componentProps = vue.computed(() => ({
|
|
14485
14490
|
allowedDates: props2.allowedDates,
|
|
14486
14491
|
type: props2.type,
|
|
14487
14492
|
color: props2.color,
|
|
@@ -14492,7 +14497,7 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14492
14497
|
multiple: props2.multiple,
|
|
14493
14498
|
range: props2.range,
|
|
14494
14499
|
buttonElevation: props2.buttonElevation
|
|
14495
|
-
});
|
|
14500
|
+
}));
|
|
14496
14501
|
const getChoose = vue.computed(() => ({
|
|
14497
14502
|
chooseMonth: chooseMonth.value,
|
|
14498
14503
|
chooseYear: chooseYear.value,
|
|
@@ -14575,7 +14580,7 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14575
14580
|
vue.watch(
|
|
14576
14581
|
() => props2.modelValue,
|
|
14577
14582
|
(value) => {
|
|
14578
|
-
if (!checkValue() || invalidFormatDate(value)
|
|
14583
|
+
if (!checkValue() || invalidFormatDate(value)) return;
|
|
14579
14584
|
if (props2.range) {
|
|
14580
14585
|
if (!isArray(value)) return;
|
|
14581
14586
|
rangeDone.value = value.length !== 1;
|
|
@@ -14769,7 +14774,8 @@ const __sfc__$P = vue.defineComponent({
|
|
|
14769
14774
|
rangeDate.value = formatDateList.filter((date) => date !== "Invalid Date");
|
|
14770
14775
|
}
|
|
14771
14776
|
function dateInit(value) {
|
|
14772
|
-
const
|
|
14777
|
+
const handleValue = value ? dayjs(value) : dayjs();
|
|
14778
|
+
const formatDate = handleValue.format("YYYY-MM-D");
|
|
14773
14779
|
if (invalidFormatDate(formatDate)) return;
|
|
14774
14780
|
const [yearValue, monthValue, dayValue] = formatDate.split("-");
|
|
14775
14781
|
const monthDes2 = MONTH_LIST.find((month) => month === monthValue);
|
|
@@ -28256,24 +28262,37 @@ const __sfc__$2 = vue.defineComponent({
|
|
|
28256
28262
|
vue.watch(
|
|
28257
28263
|
() => props2.modelValue,
|
|
28258
28264
|
(value) => {
|
|
28259
|
-
if (value) {
|
|
28260
|
-
|
|
28261
|
-
|
|
28262
|
-
const formatHour24 = dayjs().hour(hour).format("HH");
|
|
28263
|
-
const formatMinute = dayjs().minute(minute).format("mm");
|
|
28264
|
-
const formatSecond = dayjs().second(second).format("ss");
|
|
28265
|
-
hourRad.value = (formatHour12 === "12" ? 0 : toNumber(formatHour12)) * 30;
|
|
28266
|
-
minuteRad.value = toNumber(formatMinute) * 6;
|
|
28267
|
-
secondRad.value = toNumber(formatSecond) * 6;
|
|
28268
|
-
time.value = getTime(value);
|
|
28269
|
-
if (props2.format !== "24hr") {
|
|
28270
|
-
ampm.value = padStart$1(`${hour}`, 2, "0") === formatHour24 && hours24.includes(formatHour24) ? "pm" : "am";
|
|
28271
|
-
}
|
|
28272
|
-
isInner.value = props2.format === "24hr" && hours24.includes(formatHour24);
|
|
28265
|
+
if (value === void 0 || value === "") {
|
|
28266
|
+
resetTime();
|
|
28267
|
+
return;
|
|
28273
28268
|
}
|
|
28269
|
+
const { hour, minute, second } = getNumberTime(value);
|
|
28270
|
+
const formatHour12 = dayjs().hour(hour).format("hh");
|
|
28271
|
+
const formatHour24 = dayjs().hour(hour).format("HH");
|
|
28272
|
+
const formatMinute = dayjs().minute(minute).format("mm");
|
|
28273
|
+
const formatSecond = dayjs().second(second).format("ss");
|
|
28274
|
+
hourRad.value = (formatHour12 === "12" ? 0 : toNumber(formatHour12)) * 30;
|
|
28275
|
+
minuteRad.value = toNumber(formatMinute) * 6;
|
|
28276
|
+
secondRad.value = toNumber(formatSecond) * 6;
|
|
28277
|
+
time.value = getTime(value);
|
|
28278
|
+
if (props2.format !== "24hr") {
|
|
28279
|
+
ampm.value = padStart$1(`${hour}`, 2, "0") === formatHour24 && hours24.includes(formatHour24) ? "pm" : "am";
|
|
28280
|
+
}
|
|
28281
|
+
isInner.value = props2.format === "24hr" && hours24.includes(formatHour24);
|
|
28274
28282
|
},
|
|
28275
28283
|
{ immediate: true }
|
|
28276
28284
|
);
|
|
28285
|
+
function resetTime() {
|
|
28286
|
+
hourRad.value = void 0;
|
|
28287
|
+
minuteRad.value = 0;
|
|
28288
|
+
secondRad.value = 0;
|
|
28289
|
+
time.value = {
|
|
28290
|
+
hour: "00",
|
|
28291
|
+
minute: "00",
|
|
28292
|
+
second: "00"
|
|
28293
|
+
};
|
|
28294
|
+
ampm.value = "am";
|
|
28295
|
+
}
|
|
28277
28296
|
function update(newTime) {
|
|
28278
28297
|
call(props2["onUpdate:modelValue"], newTime);
|
|
28279
28298
|
call(props2.onChange, newTime);
|
|
@@ -29297,7 +29316,7 @@ withInstall(stdin_default$1);
|
|
|
29297
29316
|
withPropsDefaultsSetter(stdin_default$1, props);
|
|
29298
29317
|
const _WatermarkComponent = stdin_default$1;
|
|
29299
29318
|
var stdin_default = stdin_default$1;
|
|
29300
|
-
const version = "3.5.
|
|
29319
|
+
const version = "3.5.3";
|
|
29301
29320
|
function install(app) {
|
|
29302
29321
|
stdin_default$5I.install && app.use(stdin_default$5I);
|
|
29303
29322
|
stdin_default$5G.install && app.use(stdin_default$5G);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.3",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"main": "lib/varlet.cjs.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@popperjs/core": "^2.11.6",
|
|
49
49
|
"dayjs": "^1.10.4",
|
|
50
50
|
"decimal.js": "^10.2.1",
|
|
51
|
-
"@varlet/icons": "3.5.
|
|
52
|
-
"@varlet/shared": "3.5.
|
|
53
|
-
"@varlet/use": "3.5.
|
|
51
|
+
"@varlet/icons": "3.5.3",
|
|
52
|
+
"@varlet/shared": "3.5.3",
|
|
53
|
+
"@varlet/use": "3.5.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@vue/runtime-core": "3.4.21",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"typescript": "^5.1.5",
|
|
66
66
|
"vue": "3.4.21",
|
|
67
67
|
"vue-router": "4.2.0",
|
|
68
|
-
"@varlet/cli": "3.5.
|
|
69
|
-
"@varlet/
|
|
70
|
-
"@varlet/
|
|
68
|
+
"@varlet/cli": "3.5.3",
|
|
69
|
+
"@varlet/touch-emulator": "3.5.3",
|
|
70
|
+
"@varlet/ui": "3.5.3"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"dev": "varlet-cli dev",
|
package/types/styleVars.d.ts
CHANGED
|
@@ -259,6 +259,7 @@ interface BaseStyleVars {
|
|
|
259
259
|
'--date-picker-title-year-font-size'?: string
|
|
260
260
|
'--date-picker-title-year-font-weight'?: string
|
|
261
261
|
'--date-picker-title-year-margin-bottom'?: string
|
|
262
|
+
'--date-picker-title-year-min-height'?: string
|
|
262
263
|
'--date-picker-title-date-height'?: string
|
|
263
264
|
'--date-picker-title-date-font-size'?: string
|
|
264
265
|
'--date-picker-title-date-font-weight'?: string
|
|
@@ -280,6 +281,7 @@ interface BaseStyleVars {
|
|
|
280
281
|
'--year-picker-item-height'?: string
|
|
281
282
|
'--year-picker-item-button-max-width'?: string
|
|
282
283
|
'--day-picker-content-item-width'?: string
|
|
284
|
+
'--day-picker-content-item-min-height'?: string
|
|
283
285
|
'--day-picker-content-item-font-size'?: string
|
|
284
286
|
'--day-picker-content-item-padding'?: string
|
|
285
287
|
'--day-picker-content-item-button-width'?: string
|
|
@@ -752,6 +754,7 @@ interface BaseStyleVars {
|
|
|
752
754
|
'--time-picker-title-background'?: string
|
|
753
755
|
'--time-picker-title-hint-color'?: string
|
|
754
756
|
'--time-picker-title-hint-font-size'?: string
|
|
757
|
+
'--time-picker-title-hint-min-height'?: string
|
|
755
758
|
'--time-picker-title-inactive-opacity'?: string
|
|
756
759
|
'--time-picker-title-time-font-size'?: string
|
|
757
760
|
'--time-picker-title-time-margin'?: string
|