@varlet/ui 3.5.2 → 3.5.4-alpha.1727864204645

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/lib/varlet.cjs.js CHANGED
@@ -8485,7 +8485,10 @@ const props$V = {
8485
8485
  },
8486
8486
  imageHeight: [String, Number],
8487
8487
  imageWidth: [String, Number],
8488
- outline: Boolean,
8488
+ variant: {
8489
+ type: String,
8490
+ default: "standard"
8491
+ },
8489
8492
  layout: {
8490
8493
  type: String,
8491
8494
  default: "column"
@@ -8505,7 +8508,9 @@ const props$V = {
8505
8508
  },
8506
8509
  ripple: Boolean,
8507
8510
  onClick: defineListenerProp(),
8508
- "onUpdate:floating": defineListenerProp()
8511
+ "onUpdate:floating": defineListenerProp(),
8512
+ // deprecated
8513
+ outline: Boolean
8509
8514
  };
8510
8515
  var __async$d = (__this, __arguments, generator) => {
8511
8516
  return new Promise((resolve, reject) => {
@@ -8538,7 +8543,15 @@ function __render__$10(_ctx, _cache) {
8538
8543
  "div",
8539
8544
  {
8540
8545
  ref: "card",
8541
- class: vue.normalizeClass(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n("--layout-row")], [_ctx.outline, _ctx.n("--outline")], _ctx.formatElevation(_ctx.elevation, 1))),
8546
+ class: vue.normalizeClass(
8547
+ _ctx.classes(
8548
+ _ctx.n(),
8549
+ [_ctx.isRow, _ctx.n("--layout-row")],
8550
+ [_ctx.variant === "outlined" || _ctx.outline, _ctx.n("--outline")],
8551
+ [_ctx.variant === "filled", _ctx.n("--filled")],
8552
+ [_ctx.variant === "standard" || _ctx.outline, _ctx.formatElevation(_ctx.elevation, 1)]
8553
+ )
8554
+ ),
8542
8555
  style: vue.normalizeStyle({
8543
8556
  zIndex: _ctx.floated ? _ctx.zIndex : void 0
8544
8557
  }),
@@ -13379,13 +13392,14 @@ const __sfc__$T = vue.defineComponent({
13379
13392
  headerEl.value.checkDate(checkType);
13380
13393
  };
13381
13394
  vue.watch(
13382
- () => props2.preview.previewYear,
13383
- (year) => {
13384
- const {
13385
- componentProps: { min: min2, max: max2 }
13386
- } = props2;
13387
- if (max2) panelBtnDisabled.right = !dayjs(`${toNumber(year) + 1}`).isSameOrBefore(dayjs(max2), "year");
13388
- if (min2) panelBtnDisabled.left = !dayjs(`${toNumber(year) - 1}`).isSameOrAfter(dayjs(min2), "year");
13395
+ () => [props2.preview.previewYear, props2.componentProps.max, props2.componentProps.min],
13396
+ ([year, max2, min2]) => {
13397
+ if (max2) {
13398
+ panelBtnDisabled.right = !dayjs(`${toNumber(year) + 1}`).isSameOrBefore(dayjs(max2), "year");
13399
+ }
13400
+ if (min2) {
13401
+ panelBtnDisabled.left = !dayjs(`${toNumber(year) - 1}`).isSameOrAfter(dayjs(min2), "year");
13402
+ }
13389
13403
  },
13390
13404
  { immediate: true }
13391
13405
  );
@@ -13820,15 +13834,18 @@ const __sfc__$R = vue.defineComponent({
13820
13834
  }
13821
13835
  );
13822
13836
  vue.watch(
13823
- yearList,
13824
- (list) => {
13825
- const {
13826
- componentProps: { min: min2, max: max2 }
13827
- } = props2;
13828
- if (max2)
13837
+ () => [yearList.value, props2.componentProps.max, props2.componentProps.min],
13838
+ (newVal) => {
13839
+ const [list, max2, min2] = newVal;
13840
+ if (max2) {
13829
13841
  panelBtnDisabled.right = !dayjs(`${toNumber(list[list.length - 1])}`).isSameOrBefore(dayjs(max2), "year");
13830
- if (min2) panelBtnDisabled.left = !dayjs(`${toNumber(list[0])}`).isSameOrAfter(dayjs(min2), "year");
13831
- if (toNumber(list[0] <= 0)) panelBtnDisabled.left = false;
13842
+ }
13843
+ if (min2) {
13844
+ panelBtnDisabled.left = !dayjs(`${toNumber(list[0])}`).isSameOrAfter(dayjs(min2), "year");
13845
+ }
13846
+ if (toNumber(list[0] <= 0)) {
13847
+ panelBtnDisabled.left = false;
13848
+ }
13832
13849
  },
13833
13850
  {
13834
13851
  immediate: true
@@ -14165,6 +14182,7 @@ const __sfc__$Q = vue.defineComponent({
14165
14182
  initHeader();
14166
14183
  }
14167
14184
  );
14185
+ vue.watch(() => [props2.componentProps.max, props2.componentProps.min], initHeader);
14168
14186
  return {
14169
14187
  n: n$P,
14170
14188
  nDate,
@@ -14481,7 +14499,7 @@ const __sfc__$P = vue.defineComponent({
14481
14499
  const yearPanelEl = vue.ref(null);
14482
14500
  const monthPanelEl = vue.ref(null);
14483
14501
  const dayPanelEl = vue.ref(null);
14484
- const componentProps = vue.reactive({
14502
+ const componentProps = vue.computed(() => ({
14485
14503
  allowedDates: props2.allowedDates,
14486
14504
  type: props2.type,
14487
14505
  color: props2.color,
@@ -14492,7 +14510,7 @@ const __sfc__$P = vue.defineComponent({
14492
14510
  multiple: props2.multiple,
14493
14511
  range: props2.range,
14494
14512
  buttonElevation: props2.buttonElevation
14495
- });
14513
+ }));
14496
14514
  const getChoose = vue.computed(() => ({
14497
14515
  chooseMonth: chooseMonth.value,
14498
14516
  chooseYear: chooseYear.value,
@@ -14575,7 +14593,7 @@ const __sfc__$P = vue.defineComponent({
14575
14593
  vue.watch(
14576
14594
  () => props2.modelValue,
14577
14595
  (value) => {
14578
- if (!checkValue() || invalidFormatDate(value) || !value) return;
14596
+ if (!checkValue() || invalidFormatDate(value)) return;
14579
14597
  if (props2.range) {
14580
14598
  if (!isArray(value)) return;
14581
14599
  rangeDone.value = value.length !== 1;
@@ -14769,7 +14787,8 @@ const __sfc__$P = vue.defineComponent({
14769
14787
  rangeDate.value = formatDateList.filter((date) => date !== "Invalid Date");
14770
14788
  }
14771
14789
  function dateInit(value) {
14772
- const formatDate = dayjs(value).format("YYYY-MM-D");
14790
+ const handleValue = value ? dayjs(value) : dayjs();
14791
+ const formatDate = handleValue.format("YYYY-MM-D");
14773
14792
  if (invalidFormatDate(formatDate)) return;
14774
14793
  const [yearValue, monthValue, dayValue] = formatDate.split("-");
14775
14794
  const monthDes2 = MONTH_LIST.find((month) => month === monthValue);
@@ -24748,6 +24767,7 @@ var stdin_default$34 = {
24748
24767
  "--card-description-color": "#aaaaaa",
24749
24768
  "--card-padding": "0 0 15px 0",
24750
24769
  "--card-background": "var(--color-surface-container-highest)",
24770
+ "--card-filled-background": "var(--color-surface-container-highest)",
24751
24771
  "--card-outline-color": "var(--color-outline)",
24752
24772
  "--card-border-radius": "4px",
24753
24773
  "--card-image-width": "100%",
@@ -25832,6 +25852,7 @@ var stdin_default$1W = {
25832
25852
  var stdin_default$1V = {
25833
25853
  "--card-border-radius": "12px",
25834
25854
  "--card-background": "var(--color-surface-container-low)",
25855
+ "--card-filled-background": "var(--color-surface-container-highest)",
25835
25856
  "--card-image-height": "188px",
25836
25857
  "--card-title-color": "#1D1B20",
25837
25858
  "--card-title-font-size": "16px",
@@ -26807,6 +26828,7 @@ var stdin_default$W = {
26807
26828
  var stdin_default$V = {
26808
26829
  "--card-border-radius": "12px",
26809
26830
  "--card-background": "var(--color-surface-container-highest)",
26831
+ "--card-filled-background": "var(--color-surface-container-highest)",
26810
26832
  "--card-image-height": "188px",
26811
26833
  "--card-title-color": "var(--color-inverse-surface)",
26812
26834
  "--card-title-font-size": "16px",
@@ -28256,24 +28278,37 @@ const __sfc__$2 = vue.defineComponent({
28256
28278
  vue.watch(
28257
28279
  () => props2.modelValue,
28258
28280
  (value) => {
28259
- if (value) {
28260
- const { hour, minute, second } = getNumberTime(value);
28261
- const formatHour12 = dayjs().hour(hour).format("hh");
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);
28281
+ if (value === void 0 || value === "") {
28282
+ resetTime();
28283
+ return;
28273
28284
  }
28285
+ const { hour, minute, second } = getNumberTime(value);
28286
+ const formatHour12 = dayjs().hour(hour).format("hh");
28287
+ const formatHour24 = dayjs().hour(hour).format("HH");
28288
+ const formatMinute = dayjs().minute(minute).format("mm");
28289
+ const formatSecond = dayjs().second(second).format("ss");
28290
+ hourRad.value = (formatHour12 === "12" ? 0 : toNumber(formatHour12)) * 30;
28291
+ minuteRad.value = toNumber(formatMinute) * 6;
28292
+ secondRad.value = toNumber(formatSecond) * 6;
28293
+ time.value = getTime(value);
28294
+ if (props2.format !== "24hr") {
28295
+ ampm.value = padStart$1(`${hour}`, 2, "0") === formatHour24 && hours24.includes(formatHour24) ? "pm" : "am";
28296
+ }
28297
+ isInner.value = props2.format === "24hr" && hours24.includes(formatHour24);
28274
28298
  },
28275
28299
  { immediate: true }
28276
28300
  );
28301
+ function resetTime() {
28302
+ hourRad.value = void 0;
28303
+ minuteRad.value = 0;
28304
+ secondRad.value = 0;
28305
+ time.value = {
28306
+ hour: "00",
28307
+ minute: "00",
28308
+ second: "00"
28309
+ };
28310
+ ampm.value = "am";
28311
+ }
28277
28312
  function update(newTime) {
28278
28313
  call(props2["onUpdate:modelValue"], newTime);
28279
28314
  call(props2.onChange, newTime);
@@ -29297,7 +29332,7 @@ withInstall(stdin_default$1);
29297
29332
  withPropsDefaultsSetter(stdin_default$1, props);
29298
29333
  const _WatermarkComponent = stdin_default$1;
29299
29334
  var stdin_default = stdin_default$1;
29300
- const version = "3.5.2";
29335
+ const version = "3.5.4-alpha.1727864204645";
29301
29336
  function install(app) {
29302
29337
  stdin_default$5I.install && app.use(stdin_default$5I);
29303
29338
  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.2",
3
+ "version": "3.5.4-alpha.1727864204645",
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.2",
52
- "@varlet/shared": "3.5.2",
53
- "@varlet/use": "3.5.2"
51
+ "@varlet/icons": "3.5.4-alpha.1727864204645",
52
+ "@varlet/use": "3.5.4-alpha.1727864204645",
53
+ "@varlet/shared": "3.5.4-alpha.1727864204645"
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.2",
69
- "@varlet/ui": "3.5.2",
70
- "@varlet/touch-emulator": "3.5.2"
68
+ "@varlet/ui": "3.5.4-alpha.1727864204645",
69
+ "@varlet/cli": "3.5.4-alpha.1727864204645",
70
+ "@varlet/touch-emulator": "3.5.4-alpha.1727864204645"
71
71
  },
72
72
  "scripts": {
73
73
  "dev": "varlet-cli dev",
package/types/card.d.ts CHANGED
@@ -7,7 +7,10 @@ export type CardFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'
7
7
 
8
8
  export type CardLayout = 'row' | 'column'
9
9
 
10
+ export type CardVariant = 'standard' | 'outlined' | 'filled'
11
+
10
12
  export interface CardProps extends BasicAttributes {
13
+ variant?: CardVariant
11
14
  src?: string
12
15
  fit?: CardFit
13
16
  imageHeight?: string | number
@@ -17,12 +20,18 @@ export interface CardProps extends BasicAttributes {
17
20
  subtitle?: string
18
21
  description?: string
19
22
  elevation?: boolean | number | string
23
+ filled?: boolean
20
24
  ripple?: boolean
21
- onClick?: ListenerProp<(e: Event) => void>
22
25
  layout?: CardLayout
23
26
  floating?: boolean
24
27
  floatingDuration?: number
28
+ onClick?: ListenerProp<(e: Event) => void>
25
29
  'onUpdate:floating'?: ListenerProp<(value: boolean) => void>
30
+
31
+ /**
32
+ * @deprecated
33
+ */
34
+ outline?: boolean
26
35
  }
27
36
 
28
37
  export interface CardTitleData {
@@ -130,6 +130,7 @@ interface BaseStyleVars {
130
130
  '--button-normal-font-size'?: string
131
131
  '--button-large-font-size'?: string
132
132
  '--card-background'?: string
133
+ '--card-filled-background'?: string
133
134
  '--card-padding'?: string
134
135
  '--card-border-radius'?: string
135
136
  '--card-outline-color'?: string
@@ -259,6 +260,7 @@ interface BaseStyleVars {
259
260
  '--date-picker-title-year-font-size'?: string
260
261
  '--date-picker-title-year-font-weight'?: string
261
262
  '--date-picker-title-year-margin-bottom'?: string
263
+ '--date-picker-title-year-min-height'?: string
262
264
  '--date-picker-title-date-height'?: string
263
265
  '--date-picker-title-date-font-size'?: string
264
266
  '--date-picker-title-date-font-weight'?: string
@@ -280,6 +282,7 @@ interface BaseStyleVars {
280
282
  '--year-picker-item-height'?: string
281
283
  '--year-picker-item-button-max-width'?: string
282
284
  '--day-picker-content-item-width'?: string
285
+ '--day-picker-content-item-min-height'?: string
283
286
  '--day-picker-content-item-font-size'?: string
284
287
  '--day-picker-content-item-padding'?: string
285
288
  '--day-picker-content-item-button-width'?: string
@@ -752,6 +755,7 @@ interface BaseStyleVars {
752
755
  '--time-picker-title-background'?: string
753
756
  '--time-picker-title-hint-color'?: string
754
757
  '--time-picker-title-hint-font-size'?: string
758
+ '--time-picker-title-hint-min-height'?: string
755
759
  '--time-picker-title-inactive-opacity'?: string
756
760
  '--time-picker-title-time-font-size'?: string
757
761
  '--time-picker-title-time-margin'?: string