@varlet/ui 3.2.2 → 3.2.4

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
@@ -602,15 +602,23 @@ function useVModel(props2, key, options = {}) {
602
602
  });
603
603
  }
604
604
  const proxy = vue.ref(getValue());
605
+ let shouldEmit = true;
605
606
  vue.watch(
606
607
  () => props2[key],
607
608
  () => {
609
+ shouldEmit = false;
608
610
  proxy.value = getValue();
611
+ vue.nextTick(() => {
612
+ shouldEmit = true;
613
+ });
609
614
  }
610
615
  );
611
616
  vue.watch(
612
617
  () => proxy.value,
613
618
  (newValue) => {
619
+ if (!shouldEmit) {
620
+ return;
621
+ }
614
622
  emit ? emit(event, newValue) : call(props2[event], newValue);
615
623
  }
616
624
  );
@@ -3123,8 +3131,7 @@ const __sfc__$1i = vue.defineComponent({
3123
3131
  return {
3124
3132
  rootStyles,
3125
3133
  n: n$1h,
3126
- classes: classes$13,
3127
- toSizeUnit
3134
+ classes: classes$13
3128
3135
  };
3129
3136
  }
3130
3137
  });
@@ -10224,16 +10231,11 @@ const __sfc__$V = vue.defineComponent({
10224
10231
  right: false
10225
10232
  });
10226
10233
  const yearList = vue.computed(() => {
10227
- const list = [];
10228
- if (!props2.preview)
10229
- return list;
10230
- let startYear = Math.floor(toNumber(props2.preview) / 100 + page.value) * 100;
10231
- startYear = startYear < 0 ? 0 : startYear;
10232
- const yearRange = [startYear, startYear + 100];
10233
- for (let i = yearRange[0]; i < yearRange[1]; i++) {
10234
- list.push(i);
10234
+ if (!props2.preview) {
10235
+ return [];
10235
10236
  }
10236
- return list;
10237
+ const startYear = Math.floor(toNumber(props2.preview) / 100 + page.value) * 100;
10238
+ return Array.from(Array(100), (_v, k) => Math.max(0, startYear) + k);
10237
10239
  });
10238
10240
  const shouldChoose = (val) => {
10239
10241
  const {
@@ -10257,12 +10259,8 @@ const __sfc__$V = vue.defineComponent({
10257
10259
  const {
10258
10260
  componentProps: { min: min2, max: max2 }
10259
10261
  } = props2;
10260
- let isBeforeMax = true;
10261
- let isAfterMin = true;
10262
- if (max2)
10263
- isBeforeMax = dayjs(year).isSameOrBefore(dayjs(max2), "year");
10264
- if (min2)
10265
- isAfterMin = dayjs(year).isSameOrAfter(dayjs(min2), "year");
10262
+ const isBeforeMax = max2 ? dayjs(year).isSameOrBefore(dayjs(max2), "year") : true;
10263
+ const isAfterMin = min2 ? dayjs(year).isSameOrAfter(dayjs(min2), "year") : true;
10266
10264
  return isBeforeMax && isAfterMin;
10267
10265
  };
10268
10266
  const buttonProps = (year) => {
@@ -10333,9 +10331,10 @@ const __sfc__$V = vue.defineComponent({
10333
10331
  });
10334
10332
  };
10335
10333
  const checkDate = (checkType) => {
10336
- reverse.value = checkType === "prev";
10337
- panelKey.value += checkType === "prev" ? -1 : 1;
10338
- page.value += checkType === "prev" ? -1 : 1;
10334
+ const isPrevType = checkType === "prev";
10335
+ reverse.value = isPrevType;
10336
+ panelKey.value += isPrevType ? -1 : 1;
10337
+ page.value += isPrevType ? -1 : 1;
10339
10338
  };
10340
10339
  const forwardRef = (checkType) => {
10341
10340
  headerEl.value.checkDate(checkType);
@@ -11809,7 +11808,8 @@ function __render__$Q(_ctx, _cache) {
11809
11808
  [_ctx.hairline, _ctx.n("--hairline")]
11810
11809
  )
11811
11810
  ),
11812
- style: vue.normalizeStyle(_ctx.style)
11811
+ style: vue.normalizeStyle(_ctx.style),
11812
+ role: "separator"
11813
11813
  },
11814
11814
  [
11815
11815
  !_ctx.vertical ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
@@ -13465,9 +13465,8 @@ function usePopover(options) {
13465
13465
  const show = useVModel(options, "show", {
13466
13466
  passive: true,
13467
13467
  defaultValue: false,
13468
- emit(event, value) {
13468
+ emit(_event, value) {
13469
13469
  if (value) {
13470
- resize();
13471
13470
  call(options.onOpen);
13472
13471
  } else {
13473
13472
  call(options.onClose);
@@ -13712,8 +13711,7 @@ function usePopover(options) {
13712
13711
  popoverInstance.setOptions(getPopperOptions());
13713
13712
  };
13714
13713
  const open = () => {
13715
- const { disabled } = options;
13716
- if (disabled) {
13714
+ if (options.disabled) {
13717
13715
  return;
13718
13716
  }
13719
13717
  show.value = true;
@@ -13728,6 +13726,14 @@ function usePopover(options) {
13728
13726
  onWindowResize(resize);
13729
13727
  vue.watch(() => [options.offsetX, options.offsetY, options.placement, options.strategy], resize);
13730
13728
  vue.watch(() => options.disabled, close);
13729
+ vue.watch(
13730
+ () => show.value,
13731
+ (newValue) => {
13732
+ if (newValue) {
13733
+ resize();
13734
+ }
13735
+ }
13736
+ );
13731
13737
  vue.onMounted(() => {
13732
13738
  var _a;
13733
13739
  popoverInstance = createPopper((_a = getReference()) != null ? _a : host.value, popover.value, getPopperOptions());
@@ -14880,6 +14886,10 @@ const props$F = {
14880
14886
  type: String,
14881
14887
  default: "fill"
14882
14888
  },
14889
+ position: {
14890
+ type: String,
14891
+ default: "50% 50%"
14892
+ },
14883
14893
  alt: String,
14884
14894
  title: String,
14885
14895
  referrerpolicy: String,
@@ -14928,7 +14938,7 @@ function __render__$J(_ctx, _cache) {
14928
14938
  referrerpolicy: _ctx.referrerpolicy,
14929
14939
  "lazy-loading": _ctx.loading,
14930
14940
  "lazy-error": _ctx.error,
14931
- style: vue.normalizeStyle({ objectFit: _ctx.fit }),
14941
+ style: vue.normalizeStyle({ objectFit: _ctx.fit, objectPosition: _ctx.position }),
14932
14942
  onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
14933
14943
  onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
14934
14944
  }, null, 46, _hoisted_1$m)), [
@@ -14941,7 +14951,7 @@ function __render__$J(_ctx, _cache) {
14941
14951
  alt: _ctx.alt,
14942
14952
  title: _ctx.title,
14943
14953
  referrerpolicy: _ctx.referrerpolicy,
14944
- style: vue.normalizeStyle({ objectFit: _ctx.fit }),
14954
+ style: vue.normalizeStyle({ objectFit: _ctx.fit, objectPosition: _ctx.position }),
14945
14955
  src: _ctx.src,
14946
14956
  onLoad: _cache[2] || (_cache[2] = (...args) => _ctx.handleLoad && _ctx.handleLoad(...args)),
14947
14957
  onError: _cache[3] || (_cache[3] = (...args) => _ctx.handleError && _ctx.handleError(...args)),
@@ -20516,7 +20526,7 @@ function __render__$l(_ctx, _cache) {
20516
20526
  {
20517
20527
  class: vue.normalizeClass(_ctx.classes(_ctx.n("success-line"), _ctx.n("success-line-tip"))),
20518
20528
  style: vue.normalizeStyle({
20519
- animationDuration: _ctx.animation ? `760ms` : "0ms",
20529
+ animationDuration: _ctx.animation ? "760ms" : "0ms",
20520
20530
  borderRadius: `calc(${_ctx.borderSize} * 0.625)`
20521
20531
  })
20522
20532
  },
@@ -20529,7 +20539,7 @@ function __render__$l(_ctx, _cache) {
20529
20539
  {
20530
20540
  class: vue.normalizeClass(_ctx.classes(_ctx.n("success-line"), _ctx.n("success-line-long"))),
20531
20541
  style: vue.normalizeStyle({
20532
- animationDuration: _ctx.animation ? `770ms` : "0ms",
20542
+ animationDuration: _ctx.animation ? "770ms" : "0ms",
20533
20543
  borderRadius: `calc(${_ctx.borderSize} * 0.625)`
20534
20544
  })
20535
20545
  },
@@ -20562,7 +20572,7 @@ function __render__$l(_ctx, _cache) {
20562
20572
  {
20563
20573
  class: vue.normalizeClass(_ctx.n("success-cover-right")),
20564
20574
  style: vue.normalizeStyle({
20565
- animationDuration: _ctx.animation ? `4250ms` : "0ms"
20575
+ animationDuration: _ctx.animation ? "4250ms" : "0ms"
20566
20576
  })
20567
20577
  },
20568
20578
  null,
@@ -20586,8 +20596,7 @@ const __sfc__$m = vue.defineComponent({
20586
20596
  setup() {
20587
20597
  return {
20588
20598
  n: n$l,
20589
- classes: classes$h,
20590
- toNumber
20599
+ classes: classes$h
20591
20600
  };
20592
20601
  }
20593
20602
  });
@@ -20741,22 +20750,17 @@ const __sfc__$j = vue.defineComponent({
20741
20750
  },
20742
20751
  props: props$i,
20743
20752
  setup(props2) {
20744
- const circleSize = vue.computed(() => {
20745
- const { imageSize } = props2;
20746
- return `calc(${imageSize ? toSizeUnit(imageSize) : "var(--result-image-size)"} * 0.9)`;
20747
- });
20748
- const borderSize = vue.computed(() => {
20749
- const { imageSize } = props2;
20750
- return `calc(${imageSize ? toSizeUnit(props2.imageSize) : "var(--result-image-size)"} * 0.05)`;
20751
- });
20753
+ const circleSize = vue.computed(
20754
+ () => `calc(${props2.imageSize ? toSizeUnit(props2.imageSize) : "var(--result-image-size)"} * 0.9)`
20755
+ );
20756
+ const borderSize = vue.computed(
20757
+ () => `calc(${props2.imageSize ? toSizeUnit(props2.imageSize) : "var(--result-image-size)"} * 0.05)`
20758
+ );
20752
20759
  return {
20753
20760
  circleSize,
20754
20761
  borderSize,
20755
- toSizeUnit,
20756
20762
  n: n$k,
20757
- classes: classes$g,
20758
- toNumber,
20759
- toPxNum
20763
+ classes: classes$g
20760
20764
  };
20761
20765
  }
20762
20766
  });
@@ -23042,6 +23046,7 @@ const props$8 = {
23042
23046
  loadingColor: String,
23043
23047
  closeColor: String,
23044
23048
  size: [String, Number],
23049
+ variant: Boolean,
23045
23050
  rules: Array,
23046
23051
  ripple: {
23047
23052
  type: Boolean,
@@ -23084,14 +23089,14 @@ function __render__$9(_ctx, _cache) {
23084
23089
  return vue.withDirectives((vue.openBlock(), vue.createElementBlock(
23085
23090
  "div",
23086
23091
  {
23087
- class: vue.normalizeClass(_ctx.n())
23092
+ class: vue.normalizeClass(_ctx.classes(_ctx.n(), [_ctx.variant, _ctx.n("--variant")]))
23088
23093
  },
23089
23094
  [
23090
23095
  vue.createElementVNode(
23091
23096
  "div",
23092
23097
  {
23093
23098
  ref: "switchRef",
23094
- class: vue.normalizeClass(_ctx.classes(_ctx.n("block"), [_ctx.disabled || _ctx.formDisabled, _ctx.n("--disabled")])),
23099
+ class: vue.normalizeClass(_ctx.classes(_ctx.n("block"), [_ctx.disabled || _ctx.formDisabled, _ctx.n("--disabled")], [_ctx.isActive, _ctx.n("block--active")])),
23095
23100
  style: vue.normalizeStyle(_ctx.styleComputed.switch),
23096
23101
  onClick: _cache[2] || (_cache[2] = (...args) => _ctx.switchActive && _ctx.switchActive(...args))
23097
23102
  },
@@ -23100,16 +23105,14 @@ function __render__$9(_ctx, _cache) {
23100
23105
  "div",
23101
23106
  {
23102
23107
  style: vue.normalizeStyle(_ctx.styleComputed.track),
23103
- class: vue.normalizeClass(
23104
- _ctx.classes(_ctx.n("track"), [_ctx.modelValue === _ctx.activeValue, _ctx.n("track--active")], [_ctx.errorMessage, _ctx.n("track--error")])
23105
- )
23108
+ class: vue.normalizeClass(_ctx.classes(_ctx.n("track"), [_ctx.isActive, _ctx.n("track--active")], [_ctx.errorMessage && !_ctx.variant, _ctx.n("track--error")]))
23106
23109
  },
23107
23110
  null,
23108
23111
  6
23109
23112
  /* CLASS, STYLE */
23110
23113
  ),
23111
23114
  vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
23112
- class: vue.normalizeClass(_ctx.classes(_ctx.n("ripple"), [_ctx.modelValue === _ctx.activeValue, _ctx.n("ripple--active")])),
23115
+ class: vue.normalizeClass(_ctx.classes(_ctx.n("ripple"), [_ctx.isActive, _ctx.n("ripple--active")])),
23113
23116
  style: vue.normalizeStyle(_ctx.styleComputed.ripple),
23114
23117
  tabindex: _ctx.disabled || _ctx.formDisabled ? void 0 : "0",
23115
23118
  onFocus: _cache[0] || (_cache[0] = ($event) => _ctx.isFocusing = true),
@@ -23123,8 +23126,9 @@ function __render__$9(_ctx, _cache) {
23123
23126
  _ctx.classes(
23124
23127
  _ctx.n("handle"),
23125
23128
  _ctx.n("$-elevation--2"),
23126
- [_ctx.modelValue === _ctx.activeValue, _ctx.n("handle--active")],
23127
- [_ctx.errorMessage, _ctx.n("handle--error")]
23129
+ [_ctx.isActive, _ctx.n("handle--active")],
23130
+ [_ctx.errorMessage && !_ctx.variant, _ctx.n("handle--error")],
23131
+ [_ctx.hovering, _ctx.n("handle--hover")]
23128
23132
  )
23129
23133
  )
23130
23134
  },
@@ -23182,31 +23186,33 @@ const __sfc__$9 = vue.defineComponent({
23182
23186
  const { bindForm, form } = useForm();
23183
23187
  const { errorMessage, validateWithTrigger: vt, validate: v, resetValidation } = useValidation();
23184
23188
  const { hovering, handleHovering } = useHoverOverlay();
23189
+ const isActive = vue.computed(() => props2.modelValue === props2.activeValue);
23185
23190
  const styleComputed = vue.computed(() => {
23186
- const { size, modelValue, color, closeColor, loadingColor, activeValue } = props2;
23191
+ const { size, color, closeColor, loadingColor, variant } = props2;
23187
23192
  return {
23188
23193
  handle: {
23189
23194
  width: multiplySizeUnit(size),
23190
23195
  height: multiplySizeUnit(size),
23191
- backgroundColor: modelValue === activeValue ? color : closeColor,
23196
+ backgroundColor: isActive.value ? color : closeColor,
23192
23197
  color: loadingColor
23193
23198
  },
23194
23199
  ripple: {
23195
- left: modelValue === activeValue ? multiplySizeUnit(size, 0.5) : `-${multiplySizeUnit(size, 0.5)}`,
23196
- color: modelValue === activeValue ? color : closeColor || "currentColor",
23200
+ left: isActive.value ? multiplySizeUnit(size, 0.5) : `-${multiplySizeUnit(size, variant ? 1 / 3 : 0.5)}`,
23201
+ color: isActive.value ? color : closeColor || "currentColor",
23197
23202
  width: multiplySizeUnit(size, 2),
23198
23203
  height: multiplySizeUnit(size, 2)
23199
23204
  },
23200
23205
  track: {
23201
- height: multiplySizeUnit(size, 0.72),
23202
- width: multiplySizeUnit(size, 1.9),
23206
+ width: multiplySizeUnit(size, variant ? 13 / 6 : 1.9),
23207
+ height: multiplySizeUnit(size, variant ? 4 / 3 : 0.72),
23203
23208
  borderRadius: multiplySizeUnit(size, 2 / 3),
23204
- filter: modelValue === activeValue || (errorMessage == null ? void 0 : errorMessage.value) ? void 0 : "brightness(.6)",
23205
- backgroundColor: modelValue === activeValue ? color : closeColor
23209
+ filter: isActive.value || (errorMessage == null ? void 0 : errorMessage.value) ? void 0 : `brightness(${variant ? 1 : 0.6})`,
23210
+ backgroundColor: isActive.value ? color : closeColor,
23211
+ borderWidth: variant && !isActive.value ? multiplySizeUnit(size, 1 / 12) : void 0
23206
23212
  },
23207
23213
  switch: {
23208
- height: multiplySizeUnit(size, 1.2),
23209
- width: multiplySizeUnit(size, 2)
23214
+ width: multiplySizeUnit(size, variant ? 13 / 6 : 2),
23215
+ height: multiplySizeUnit(size, variant ? 4 / 3 : 1.2)
23210
23216
  }
23211
23217
  };
23212
23218
  });
@@ -23253,7 +23259,6 @@ const __sfc__$9 = vue.defineComponent({
23253
23259
  disabled,
23254
23260
  loading,
23255
23261
  readonly,
23256
- modelValue,
23257
23262
  activeValue,
23258
23263
  inactiveValue,
23259
23264
  lazyChange,
@@ -23267,7 +23272,7 @@ const __sfc__$9 = vue.defineComponent({
23267
23272
  if (loading || readonly || (form == null ? void 0 : form.readonly.value)) {
23268
23273
  return;
23269
23274
  }
23270
- const newValue = modelValue === activeValue ? inactiveValue : activeValue;
23275
+ const newValue = isActive.value ? inactiveValue : activeValue;
23271
23276
  if (lazyChange) {
23272
23277
  call(onBeforeChange, newValue, (value) => {
23273
23278
  call(updateModelValue, value);
@@ -23290,6 +23295,7 @@ const __sfc__$9 = vue.defineComponent({
23290
23295
  resetValidation();
23291
23296
  }
23292
23297
  return {
23298
+ isActive,
23293
23299
  switchRef,
23294
23300
  hovering,
23295
23301
  isFocusing,
@@ -24346,10 +24352,21 @@ var stdin_default$2P = {
24346
24352
  "--switch-track-active-background": "var(--color-primary)",
24347
24353
  "--switch-track-error-background": "var(--color-danger)",
24348
24354
  "--switch-ripple-color": "var(--color-primary)",
24349
- "--switch-handle-color": "#fff",
24355
+ "--switch-handle-color": "var(--color-on-primary)",
24356
+ "--switch-handle-active-color": "var(--color-on-primary)",
24350
24357
  "--switch-handle-active-background": "var(--color-primary)",
24351
24358
  "--switch-handle-error-background": "var(--color-danger)",
24352
- "--switch-disabled-opacity": "var(--opacity-disabled)"
24359
+ "--switch-disabled-opacity": "var(--opacity-disabled)",
24360
+ "--switch-variant-width": "52px",
24361
+ "--switch-variant-height": "32px",
24362
+ "--switch-variant-track-background": "var(--color-surface-container-highest)",
24363
+ "--switch-variant-handle-width": "24px",
24364
+ "--switch-variant-handle-height": "24px",
24365
+ "--switch-variant-track-border-color": "rgb(255, 255, 255, .7)",
24366
+ "--switch-variant-handle-background": "rgb(255, 255, 255, .7)",
24367
+ "--switch-variant-handle-color": "var(--color-primary)",
24368
+ "--switch-variant-handle-active-color": "var(--color-primary)",
24369
+ "--switch-variant-handle-active-background": "var(--color-on-primary)"
24353
24370
  };
24354
24371
  var stdin_default$2O = {
24355
24372
  "--tab-inactive-color": "rgba(255, 255, 255, .65)",
@@ -25495,10 +25512,21 @@ var stdin_default$1x = {
25495
25512
  "--switch-track-active-background": "var(--color-primary)",
25496
25513
  "--switch-track-error-background": "var(--color-danger)",
25497
25514
  "--switch-ripple-color": "var(--color-primary)",
25498
- "--switch-handle-color": "#fff",
25515
+ "--switch-handle-color": "var(--color-primary)",
25516
+ "--switch-handle-active-color": "var(--color-on-primary)",
25499
25517
  "--switch-handle-active-background": "var(--color-primary)",
25500
25518
  "--switch-handle-error-background": "var(--color-danger)",
25501
- "--switch-disabled-opacity": "var(--opacity-disabled)"
25519
+ "--switch-disabled-opacity": "var(--opacity-disabled)",
25520
+ "--switch-variant-width": "52px",
25521
+ "--switch-variant-height": "32px",
25522
+ "--switch-variant-track-background": "var(--color-surface-container-highest)",
25523
+ "--switch-variant-handle-width": "24px",
25524
+ "--switch-variant-handle-height": "24px",
25525
+ "--switch-variant-track-border-color": "#79747E",
25526
+ "--switch-variant-handle-color": "var(--color-on-primary)",
25527
+ "--switch-variant-handle-active-color": "var(--color-primary)",
25528
+ "--switch-variant-handle-background": "#79747E",
25529
+ "--switch-variant-handle-active-background": "var(--color-on-primary)"
25502
25530
  };
25503
25531
  var stdin_default$1w = {
25504
25532
  "--rate-color": "var(--color-on-surface-variant)",
@@ -26389,10 +26417,21 @@ var stdin_default$t = {
26389
26417
  "--switch-track-active-background": "var(--color-primary)",
26390
26418
  "--switch-track-error-background": "var(--color-danger)",
26391
26419
  "--switch-ripple-color": "var(--color-primary)",
26392
- "--switch-handle-color": "var(--color-on-primary)",
26420
+ "--switch-handle-color": "var(--color-primary)",
26421
+ "--switch-handle-active-color": "var(--color-on-primary)",
26393
26422
  "--switch-handle-active-background": "var(--color-primary)",
26394
26423
  "--switch-handle-error-background": "var(--color-danger)",
26395
- "--switch-disabled-opacity": "var(--opacity-disabled)"
26424
+ "--switch-disabled-opacity": "var(--opacity-disabled)",
26425
+ "--switch-variant-width": "52px",
26426
+ "--switch-variant-height": "32px",
26427
+ "--switch-variant-track-background": "var(--color-surface-container-highest)",
26428
+ "--switch-variant-handle-width": "24px",
26429
+ "--switch-variant-handle-height": "24px",
26430
+ "--switch-variant-track-border-color": "#938F99",
26431
+ "--switch-variant-handle-color": "var(--color-on-primary)",
26432
+ "--switch-variant-handle-active-color": "var(--color-primary)",
26433
+ "--switch-variant-handle-background": "#938F99",
26434
+ "--switch-variant-handle-active-background": "var(--color-on-primary)"
26396
26435
  };
26397
26436
  var stdin_default$s = {
26398
26437
  "--slider-thumb-size": "16px",
@@ -26941,12 +26980,10 @@ const __sfc__$3 = vue.defineComponent({
26941
26980
  required: true
26942
26981
  },
26943
26982
  useSeconds: {
26944
- type: Boolean,
26945
- default: false
26983
+ type: Boolean
26946
26984
  },
26947
26985
  preventNextUpdate: {
26948
- type: Boolean,
26949
- default: false
26986
+ type: Boolean
26950
26987
  },
26951
26988
  type: {
26952
26989
  type: String,
@@ -27138,7 +27175,7 @@ const __sfc__$3 = vue.defineComponent({
27138
27175
  }
27139
27176
  disable24HourIndex.value = disableHour.value.map((hour) => hours24.findIndex((hour24) => hour === hour24)).filter((hour) => hour >= 0);
27140
27177
  },
27141
- { immediate: true }
27178
+ { immediate: true, deep: true }
27142
27179
  );
27143
27180
  return {
27144
27181
  n: n$3,
@@ -28451,7 +28488,7 @@ withInstall(stdin_default$1);
28451
28488
  withPropsDefaultsSetter(stdin_default$1, props);
28452
28489
  const _WatermarkComponent = stdin_default$1;
28453
28490
  var stdin_default = stdin_default$1;
28454
- const version = "3.2.2";
28491
+ const version = "3.2.4";
28455
28492
  function install(app) {
28456
28493
  stdin_default$5E.install && app.use(stdin_default$5E);
28457
28494
  stdin_default$5C.install && app.use(stdin_default$5C);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.2.2",
3
+ "version": "3.2.4",
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.2.2",
52
- "@varlet/shared": "3.2.2",
53
- "@varlet/use": "3.2.2"
51
+ "@varlet/icons": "3.2.4",
52
+ "@varlet/shared": "3.2.4",
53
+ "@varlet/use": "3.2.4"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@vue/runtime-core": "3.4.21",
@@ -66,9 +66,9 @@
66
66
  "typescript": "^5.1.5",
67
67
  "vue": "3.4.21",
68
68
  "vue-router": "4.2.0",
69
- "@varlet/cli": "3.2.2",
70
- "@varlet/touch-emulator": "3.2.2",
71
- "@varlet/ui": "3.2.2"
69
+ "@varlet/cli": "3.2.4",
70
+ "@varlet/ui": "3.2.4",
71
+ "@varlet/touch-emulator": "3.2.4"
72
72
  },
73
73
  "scripts": {
74
74
  "dev": "varlet-cli dev",
package/types/image.d.ts CHANGED
@@ -8,6 +8,7 @@ export type ImageFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'
8
8
  export interface ImageProps extends BasicAttributes {
9
9
  src?: string
10
10
  fit?: ImageFit
11
+ position?: string
11
12
  title?: string
12
13
  alt?: string
13
14
  referrerpolicy?: ImgHTMLAttributes['referrerpolicy']
@@ -1205,12 +1205,34 @@ export interface StyleVars {
1205
1205
  switchHandleBackground?: string
1206
1206
  '--switch-handle-color'?: string
1207
1207
  switchHandleColor?: string
1208
+ '--switch-handle-active-color'?: string
1209
+ switchHandleActiveColor?: string
1208
1210
  '--switch-handle-active-background'?: string
1209
1211
  switchHandleActiveBackground?: string
1210
1212
  '--switch-handle-error-background'?: string
1211
1213
  switchHandleErrorBackground?: string
1212
1214
  '--switch-disabled-opacity'?: string
1213
1215
  switchDisabledOpacity?: string
1216
+ '--switch-variant-width'?: string
1217
+ switchVariantWidth?: string
1218
+ '--switch-variant-height'?: string
1219
+ switchVariantHeight?: string
1220
+ '--switch-variant-track-border-color'?: string
1221
+ switchVariantTrackBorderColor?: string
1222
+ '--switch-variant-track-background'?: string
1223
+ switchVariantTrackBackground?: string
1224
+ '--switch-variant-handle-width'?: string
1225
+ switchVariantHandleWidth?: string
1226
+ '--switch-variant-handle-height'?: string
1227
+ switchVariantHandleHeight?: string
1228
+ '--switch-variant-handle-color'?: string
1229
+ switchVariantHandleColor?: string
1230
+ '--switch-variant-handle-active-color'?: string
1231
+ switchVariantHandleActiveColor?: string
1232
+ '--switch-variant-handle-background'?: string
1233
+ switchVariantHandleBackground?: string
1234
+ '--switch-variant-handle-active-background'?: string
1235
+ switchVariantHandleActiveBackground?: string
1214
1236
  '--table-background'?: string
1215
1237
  tableBackground?: string
1216
1238
  '--table-border-radius'?: string
package/types/switch.d.ts CHANGED
@@ -18,6 +18,7 @@ export interface SwitchProps extends BasicAttributes {
18
18
  size?: string | number
19
19
  lazyChange?: boolean
20
20
  validateTrigger?: Array<SwitchValidateTrigger>
21
+ variant?: boolean
21
22
  rules?: Array<(value: any) => any>
22
23
  onClick?: ListenerProp<(event: Event) => void>
23
24
  onChange?: ListenerProp<(value: any) => void>