@varlet/ui 3.19.0 → 3.19.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.19.0",
4
+ "version": "3.19.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -862,6 +862,15 @@
862
862
  "kind": "expression"
863
863
  }
864
864
  },
865
+ {
866
+ "name": "size",
867
+ "description": "BackTop button size",
868
+ "default": "-",
869
+ "value": {
870
+ "type": "string | number",
871
+ "kind": "expression"
872
+ }
873
+ },
865
874
  {
866
875
  "name": "elevation",
867
876
  "description": "Elevation level, options `true` `false` and level of `0-24`",
@@ -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.19.0",
4
+ "version": "3.19.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -862,6 +862,15 @@
862
862
  "kind": "expression"
863
863
  }
864
864
  },
865
+ {
866
+ "name": "size",
867
+ "description": "`BackTop` 按钮大小",
868
+ "default": "-",
869
+ "value": {
870
+ "type": "string | number",
871
+ "kind": "expression"
872
+ }
873
+ },
865
874
  {
866
875
  "name": "elevation",
867
876
  "description": "海拔高度,可选值为 `true` `false` 和 `0-24` 的等级",
package/lib/varlet.cjs.js CHANGED
@@ -3404,8 +3404,10 @@ var __sfc__$99 = (0, vue.defineComponent)({
3404
3404
  const isFloating = (0, vue.computed)(() => props2.hint && (!isEmpty(props2.value) || props2.isFocusing));
3405
3405
  const { popup, bindPopup } = usePopup();
3406
3406
  const { bindSwipeResizeDispatcher } = useSwipeResizeDispatcher();
3407
+ let transitionVersion = 0;
3407
3408
  const color = (0, vue.computed)(() => !props2.isError ? props2.isFocusing ? props2.focusColor : props2.blurColor : void 0);
3408
- onWindowResize(resize);
3409
+ onWindowResize(() => resize(true));
3410
+ useResizeObserver(middleEl, () => resize(true));
3409
3411
  onSmartMounted(() => {
3410
3412
  resize();
3411
3413
  (0, vue.nextTick)().then(() => {
@@ -3415,12 +3417,12 @@ var __sfc__$99 = (0, vue.defineComponent)({
3415
3417
  (0, vue.onUpdated)(resize);
3416
3418
  call(bindPopup, null);
3417
3419
  call(bindSwipeResizeDispatcher, { onResize() {
3418
- (0, vue.nextTick)().then(resize);
3420
+ (0, vue.nextTick)().then(() => resize(true));
3419
3421
  } });
3420
3422
  if (popup) (0, vue.watch)(() => popup.show.value, (show) => __async$24(null, null, function* () {
3421
3423
  if (show) {
3422
3424
  yield doubleRaf();
3423
- resize();
3425
+ resize(true);
3424
3426
  }
3425
3427
  }));
3426
3428
  function computePlaceholderState() {
@@ -3434,15 +3436,28 @@ var __sfc__$99 = (0, vue.defineComponent)({
3434
3436
  function handleClick(e) {
3435
3437
  call(props2.onClick, e);
3436
3438
  }
3437
- function resize() {
3438
- middleOffsetLeft.value = `${middleEl.value.offsetLeft}px`;
3439
- middleOffsetWidth.value = `${middleEl.value.offsetWidth}px`;
3440
- middleOffsetHeight.value = `${middleEl.value.offsetHeight}px`;
3441
- if (props2.variant === "outlined" && placeholderTextEl.value) {
3442
- const placeholderTextStyle = getStyle$1(placeholderTextEl.value);
3443
- const placeholderSpace = `var(--field-decorator-outlined-${props2.size}-placeholder-space)`;
3444
- legendWidth.value = `calc(${placeholderTextStyle.width} * 0.75 + ${placeholderSpace} * 2)`;
3445
- }
3439
+ function resize(disableTransition = false) {
3440
+ return __async$24(this, null, function* () {
3441
+ if (!middleEl.value) return;
3442
+ if (disableTransition) {
3443
+ transitionVersion++;
3444
+ transitionDisabled.value = true;
3445
+ }
3446
+ const currentTransitionVersion = transitionVersion;
3447
+ middleOffsetLeft.value = `${middleEl.value.offsetLeft}px`;
3448
+ middleOffsetWidth.value = `${middleEl.value.offsetWidth}px`;
3449
+ middleOffsetHeight.value = `${middleEl.value.offsetHeight}px`;
3450
+ if (props2.variant === "outlined" && placeholderTextEl.value) {
3451
+ const placeholderTextStyle = getStyle$1(placeholderTextEl.value);
3452
+ const placeholderSpace = `var(--field-decorator-outlined-${props2.size}-placeholder-space)`;
3453
+ legendWidth.value = `calc(${placeholderTextStyle.width} * 0.75 + ${placeholderSpace} * 2)`;
3454
+ }
3455
+ if (disableTransition) {
3456
+ yield (0, vue.nextTick)();
3457
+ yield raf();
3458
+ if (currentTransitionVersion === transitionVersion) transitionDisabled.value = false;
3459
+ }
3460
+ });
3446
3461
  }
3447
3462
  return {
3448
3463
  placeholderTextEl,
@@ -8484,6 +8499,7 @@ var props$5 = {
8484
8499
  default: true
8485
8500
  },
8486
8501
  bottom: [Number, String],
8502
+ size: [Number, String],
8487
8503
  target: [String, Object],
8488
8504
  onClick: defineListenerProp()
8489
8505
  };
@@ -8501,7 +8517,8 @@ function __render__$87(_ctx, _cache) {
8501
8517
  class: _ctx.classes(_ctx.n(), [_ctx.show, _ctx.n("--active")]),
8502
8518
  style: {
8503
8519
  right: _ctx.toSizeUnit(_ctx.right),
8504
- bottom: _ctx.toSizeUnit(_ctx.bottom)
8520
+ bottom: _ctx.toSizeUnit(_ctx.bottom),
8521
+ "--back-top-button-size": _ctx.toSizeUnit(_ctx.size)
8505
8522
  }
8506
8523
  }, _ctx.$attrs, { onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"])) }), [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createVNode)(_component_var_button, {
8507
8524
  elevation: _ctx.elevation,
@@ -32698,7 +32715,7 @@ var _WatermarkComponent = stdin_default$107;
32698
32715
  var stdin_default$101 = stdin_default$107;
32699
32716
  //#endregion
32700
32717
  //#region es/index.bundle.mjs
32701
- var version = "3.19.0";
32718
+ var version = "3.19.2";
32702
32719
  function install(app) {
32703
32720
  stdin_default.install && app.use(stdin_default);
32704
32721
  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.19.0",
3
+ "version": "3.19.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.19.0",
48
- "@varlet/shared": "3.19.0",
49
- "@varlet/use": "3.19.0"
47
+ "@varlet/icons": "3.19.2",
48
+ "@varlet/shared": "3.19.2",
49
+ "@varlet/use": "3.19.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/cli": "3.19.0",
66
- "@varlet/ui": "3.19.0",
67
- "@varlet/touch-emulator": "3.19.0"
65
+ "@varlet/ui": "3.19.2",
66
+ "@varlet/cli": "3.19.2",
67
+ "@varlet/touch-emulator": "3.19.2"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vue": "^3.2.0"