@varlet/ui 3.20.1 → 3.20.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.
@@ -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.3",
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",
@@ -10117,9 +10117,18 @@
10117
10117
  "kind": "expression"
10118
10118
  }
10119
10119
  },
10120
+ {
10121
+ "name": "variant",
10122
+ "description": "Appearance variant, optional values are `standard` `outlined` `filled`",
10123
+ "default": "standard",
10124
+ "value": {
10125
+ "type": "string",
10126
+ "kind": "expression"
10127
+ }
10128
+ },
10120
10129
  {
10121
10130
  "name": "elevation",
10122
- "description": "Elevation level, options `true` `false` and level of `0-24`, not in simple mode",
10131
+ "description": "Elevation level, options `true` `false` and level of `0-24`, only effective with the `standard` variant",
10123
10132
  "default": "true",
10124
10133
  "value": {
10125
10134
  "type": "string | number | 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.3",
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",
@@ -10036,9 +10036,18 @@
10036
10036
  "kind": "expression"
10037
10037
  }
10038
10038
  },
10039
+ {
10040
+ "name": "variant",
10041
+ "description": "外观类型,可选值为 `standard` `outlined` `filled`",
10042
+ "default": "standard",
10043
+ "value": {
10044
+ "type": "string",
10045
+ "kind": "expression"
10046
+ }
10047
+ },
10039
10048
  {
10040
10049
  "name": "elevation",
10041
- "description": "海拔高度,可选值为 `true` `false` 和 `0-24` 的等级, 不为简单模式时生效",
10050
+ "description": "海拔高度,可选值为 `true` `false` 和 `0-24` 的等级,仅在 `standard` 外观下生效",
10042
10051
  "default": "true",
10043
10052
  "value": {
10044
10053
  "type": "string | number | 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;
@@ -28195,6 +28194,9 @@ var stdin_default$268 = {
28195
28194
  "--uploader-file-name-background": "#303030",
28196
28195
  "--uploader-file-name-color": "#aaa",
28197
28196
  "--uploader-file-cover-background": "#303030",
28197
+ "--uploader-outlined-background": "transparent",
28198
+ "--uploader-filled-background": "var(--color-surface-container-highest)",
28199
+ "--uploader-outline-color": "var(--color-outline)",
28198
28200
  "--uploader-action-icon-size": "24px",
28199
28201
  "--uploader-action-margin": "0 10px 10px 0",
28200
28202
  "--uploader-file-size": "80px",
@@ -29569,6 +29571,9 @@ var stdin_default$192 = {
29569
29571
  "--uploader-action-background": "var(--color-surface-container-highest)",
29570
29572
  "--uploader-file-name-background": "var(--color-surface-container-highest)",
29571
29573
  "--uploader-file-cover-background": "var(--color-surface-container-highest)",
29574
+ "--uploader-outlined-background": "transparent",
29575
+ "--uploader-filled-background": "var(--color-surface-container-highest)",
29576
+ "--uploader-outline-color": "var(--color-outline)",
29572
29577
  "--uploader-action-icon-color": "var(--color-on-surface-variant)",
29573
29578
  "--uploader-file-name-color": "var(--color-on-surface-variant)",
29574
29579
  "--uploader-action-icon-size": "24px",
@@ -30927,6 +30932,9 @@ var stdin_default$116 = {
30927
30932
  "--uploader-action-background": "var(--color-surface-container-low)",
30928
30933
  "--uploader-file-name-background": "var(--color-surface-container-low)",
30929
30934
  "--uploader-file-cover-background": "var(--color-surface-container-low)",
30935
+ "--uploader-outlined-background": "transparent",
30936
+ "--uploader-filled-background": "var(--color-surface-container-highest)",
30937
+ "--uploader-outline-color": "var(--color-outline)",
30930
30938
  "--uploader-action-icon-color": "var(--color-on-surface-variant)",
30931
30939
  "--uploader-file-name-color": "var(--color-on-surface-variant)",
30932
30940
  "--uploader-action-icon-size": "24px",
@@ -32150,6 +32158,10 @@ var props$90 = {
32150
32158
  ],
32151
32159
  default: true
32152
32160
  },
32161
+ variant: {
32162
+ type: String,
32163
+ default: "standard"
32164
+ },
32153
32165
  resolveType: {
32154
32166
  type: String,
32155
32167
  default: "default"
@@ -32235,7 +32247,7 @@ function __render__$1(_ctx, _cache) {
32235
32247
  (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.n("file-list")) }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.files, (f) => {
32236
32248
  return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
32237
32249
  key: f.id,
32238
- class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n("file"), _ctx.formatElevation(_ctx.elevation, 2), [f.state === "loading", _ctx.n("--loading")])),
32250
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n("file"), [_ctx.variant === "standard", _ctx.formatElevation(_ctx.elevation, 2)], [_ctx.variant === "outlined", _ctx.n("--outlined")], [_ctx.variant === "filled", _ctx.n("--filled")], [f.state === "loading", _ctx.n("--loading")])),
32239
32251
  onClick: ($event) => _ctx.preview(f)
32240
32252
  }, [
32241
32253
  (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.n("file-name")) }, (0, vue.toDisplayString)(f.name || f.url), 3),
@@ -32268,7 +32280,7 @@ function __render__$1(_ctx, _cache) {
32268
32280
  }), 128)), !_ctx.maxlength || _ctx.modelValue.length < _ctx.toNumber(_ctx.maxlength) ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
32269
32281
  key: 0,
32270
32282
  ref: "actionRef",
32271
- class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n("--outline-none"), [!_ctx.$slots.default, `${_ctx.n("action")} ${_ctx.formatElevation(_ctx.elevation, 2)}`], [_ctx.disabled || _ctx.formDisabled, _ctx.n("--disabled")])),
32283
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n("--outline-none"), [!_ctx.$slots.default, _ctx.n("action")], [!_ctx.$slots.default && _ctx.variant === "standard", _ctx.formatElevation(_ctx.elevation, 2)], [!_ctx.$slots.default && _ctx.variant === "outlined", _ctx.n("--outlined")], [!_ctx.$slots.default && _ctx.variant === "filled", _ctx.n("--filled")], [_ctx.disabled || _ctx.formDisabled, _ctx.n("--disabled")])),
32272
32284
  tabindex: _ctx.disabled || _ctx.formDisabled ? void 0 : "0",
32273
32285
  onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleActionClick && _ctx.handleActionClick(...args)),
32274
32286
  onFocus: _cache[3] || (_cache[3] = ($event) => _ctx.isFocusing = true),
@@ -32818,7 +32830,7 @@ var _WatermarkComponent = stdin_default$108;
32818
32830
  var stdin_default$102 = stdin_default$108;
32819
32831
  //#endregion
32820
32832
  //#region es/index.bundle.mjs
32821
- var version = "3.20.1";
32833
+ var version = "3.20.3";
32822
32834
  function install(app) {
32823
32835
  stdin_default.install && app.use(stdin_default);
32824
32836
  stdin_default$1.install && app.use(stdin_default$1);