@varlet/ui 3.20.1 → 3.20.2

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.
@@ -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": "3.20.1",
4
+ "version": "3.20.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -3362,7 +3362,7 @@
3362
3362
  },
3363
3363
  {
3364
3364
  "name": "allowed-dates",
3365
- "description": "Selectable date filter",
3365
+ "description": "Selectable date filter. The value format follows `type`: `year` uses `YYYY`, `month` uses `YYYY-MM`, and `date` / `datetime` use `YYYY-MM-DD`",
3366
3366
  "default": "-",
3367
3367
  "value": {
3368
3368
  "type": "(value: string) => boolean",
@@ -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": "3.20.1",
4
+ "version": "3.20.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -3113,7 +3113,7 @@
3113
3113
  },
3114
3114
  {
3115
3115
  "name": "allowed-dates",
3116
- "description": "可选日期过滤函数",
3116
+ "description": "可选日期过滤函数,参数格式随 `type` 变化:`year` 使用 `YYYY`,`month` 使用 `YYYY-MM`,`date` / `datetime` 使用 `YYYY-MM-DD`",
3117
3117
  "default": "-",
3118
3118
  "value": {
3119
3119
  "type": "(value: string) => boolean",
package/lib/varlet.cjs.js CHANGED
@@ -15421,8 +15421,7 @@ var WeekHeader = [
15421
15421
  var DatePickerFormats = {
15422
15422
  Year: "YYYY",
15423
15423
  Month: "YYYY-MM",
15424
- Day: "YYYY-MM-D",
15425
- DayPadded: "YYYY-MM-DD"
15424
+ Day: "YYYY-MM-DD"
15426
15425
  };
15427
15426
  var ShiftDirections = enumOf({
15428
15427
  Prev: "prev",
@@ -16319,7 +16318,7 @@ var __sfc__$60 = (0, vue.defineComponent)({
16319
16318
  var _a, _b, _c, _d;
16320
16319
  const { multiple, range } = props2;
16321
16320
  if (range) {
16322
- const formattedDays = selectionState.selectedRangeDays.map((date) => dayjs$1(date).format(DatePickerFormats.DayPadded));
16321
+ const formattedDays = selectionState.selectedRangeDays.map((date) => dayjs$1(date).format(DatePickerFormats.Day));
16323
16322
  return formattedDays.length ? formattedDays.join(" ~ ") : "";
16324
16323
  }
16325
16324
  if (multiple) return `${selectionState.selectedDays.length}${(pt || t)("datePickerSelected")}`;
@@ -16330,7 +16329,7 @@ var __sfc__$60 = (0, vue.defineComponent)({
16330
16329
  const monthName = (_d = (_c = (pt || t)("datePickerMonthDict")) == null ? void 0 : _c[selectionState.selectedMonth].name) != null ? _d : "";
16331
16330
  const showDay = padStart(selectionState.selectedDay, 2, "0");
16332
16331
  if ((pt || t)("lang") === "zh-CN") return `${selectionState.selectedMonth}-${showDay} ${weekName.slice(0, 3)}`;
16333
- return `${weekName.slice(0, 3)}, ${monthName.slice(0, 3)} ${selectionState.selectedDay}`;
16332
+ return `${weekName.slice(0, 3)}, ${monthName.slice(0, 3)} ${toNumber(selectionState.selectedDay)}`;
16334
16333
  });
16335
16334
  const dateSlotProps = (0, vue.computed)(() => {
16336
16335
  var _a, _b;
@@ -16343,7 +16342,7 @@ var __sfc__$60 = (0, vue.defineComponent)({
16343
16342
  date: day
16344
16343
  };
16345
16344
  });
16346
- const formattedRangeDays = (0, vue.computed)(() => selectionState.selectedRangeDays.map((date) => dayjs$1(date).format(DatePickerFormats.DayPadded)));
16345
+ const formattedRangeDays = (0, vue.computed)(() => selectionState.selectedRangeDays.map((date) => dayjs$1(date).format(DatePickerFormats.Day)));
16347
16346
  const selectedYearInPreview = (0, vue.computed)(() => selectionState.selectedYear === previewYear.value);
16348
16347
  const selectedMonthInPreview = (0, vue.computed)(() => selectionState.selectedMonth === previewMonth.value);
16349
16348
  let shouldKeepPreviewOnModelValueChange = false;
@@ -16452,7 +16451,7 @@ var __sfc__$60 = (0, vue.defineComponent)({
16452
16451
  }
16453
16452
  function updateMultiple(selectedValue, pickerType) {
16454
16453
  const selectedMultipleValues = getMultipleValuesByType(pickerType);
16455
- const valueFormat = pickerType === DatePickerTypes.Year ? DatePickerFormats.Year : pickerType === DatePickerTypes.Month ? DatePickerFormats.Month : DatePickerFormats.DayPadded;
16454
+ const valueFormat = pickerType === DatePickerTypes.Year ? DatePickerFormats.Year : pickerType === DatePickerTypes.Month ? DatePickerFormats.Month : DatePickerFormats.Day;
16456
16455
  const nextMultipleValues = selectedMultipleValues.map((date) => dayjs$1(date).format(valueFormat));
16457
16456
  const index = nextMultipleValues.findIndex((multipleValue) => multipleValue === selectedValue);
16458
16457
  const alreadySelected = index !== -1;
@@ -16491,7 +16490,7 @@ var __sfc__$60 = (0, vue.defineComponent)({
16491
16490
  const { readonly } = props2;
16492
16491
  if (readonly) return;
16493
16492
  const targetMonthDayjsObject = dayjs$1(`${previewYear.value}-${previewMonth.value}-01`).add(monthOffset, DatePickerUnits.Month);
16494
- const dayValue = `${targetMonthDayjsObject.format(DatePickerFormats.Month)}-${day}`;
16493
+ const dayValue = targetMonthDayjsObject.date(day).format(DatePickerFormats.Day);
16495
16494
  if (!isSelectableDate(dayValue, DatePickerUnits.Day)) return;
16496
16495
  reverse.value = monthOffset !== 0 ? monthOffset < 0 : getReverse(DatePickerUnits.Day, day);
16497
16496
  if (monthOffset !== 0) {
@@ -16499,7 +16498,7 @@ var __sfc__$60 = (0, vue.defineComponent)({
16499
16498
  previewMonth.value = targetMonthDayjsObject.format(DatePickerFormats.Month).split("-")[1];
16500
16499
  emitPreview();
16501
16500
  }
16502
- selectValue(dayjs$1(dayValue).format(DatePickerFormats.DayPadded), DatePickerTypes.Date);
16501
+ selectValue(dayValue, DatePickerTypes.Date);
16503
16502
  }
16504
16503
  function selectMonthFromPanel(month) {
16505
16504
  const { type: pickerType, readonly } = props2;
@@ -32818,7 +32817,7 @@ var _WatermarkComponent = stdin_default$108;
32818
32817
  var stdin_default$102 = stdin_default$108;
32819
32818
  //#endregion
32820
32819
  //#region es/index.bundle.mjs
32821
- var version = "3.20.1";
32820
+ var version = "3.20.2";
32822
32821
  function install(app) {
32823
32822
  stdin_default.install && app.use(stdin_default);
32824
32823
  stdin_default$1.install && app.use(stdin_default$1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.20.1",
3
+ "version": "3.20.2",
4
4
  "description": "A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.",
5
5
  "keywords": [
6
6
  "Vue3",
@@ -44,9 +44,9 @@
44
44
  "@popperjs/core": "^2.11.6",
45
45
  "dayjs": "^1.10.4",
46
46
  "decimal.js": "^10.2.1",
47
- "@varlet/icons": "3.20.1",
48
- "@varlet/shared": "3.20.1",
49
- "@varlet/use": "3.20.1"
47
+ "@varlet/icons": "3.20.2",
48
+ "@varlet/use": "3.20.2",
49
+ "@varlet/shared": "3.20.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^20.19.0",
@@ -62,9 +62,9 @@
62
62
  "vue": "3.5.21",
63
63
  "vue-router": "4.5.1",
64
64
  "zod": "^3.23.8",
65
- "@varlet/touch-emulator": "3.20.1",
66
- "@varlet/ui": "3.20.1",
67
- "@varlet/cli": "3.20.1"
65
+ "@varlet/cli": "3.20.2",
66
+ "@varlet/ui": "3.20.2",
67
+ "@varlet/touch-emulator": "3.20.2"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vue": "^3.2.0"