@varlet/ui 3.19.1 → 3.19.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.19.1",
4
+ "version": "3.19.3",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -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.1",
4
+ "version": "3.19.3",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
package/lib/varlet.cjs.js CHANGED
@@ -3404,9 +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
- useResizeObserver(middleEl, resize);
3409
+ onWindowResize(() => resize(true));
3410
+ useResizeObserver(middleEl, () => resize(true));
3410
3411
  onSmartMounted(() => {
3411
3412
  resize();
3412
3413
  (0, vue.nextTick)().then(() => {
@@ -3416,12 +3417,12 @@ var __sfc__$99 = (0, vue.defineComponent)({
3416
3417
  (0, vue.onUpdated)(resize);
3417
3418
  call(bindPopup, null);
3418
3419
  call(bindSwipeResizeDispatcher, { onResize() {
3419
- (0, vue.nextTick)().then(resize);
3420
+ (0, vue.nextTick)().then(() => resize(true));
3420
3421
  } });
3421
3422
  if (popup) (0, vue.watch)(() => popup.show.value, (show) => __async$24(null, null, function* () {
3422
3423
  if (show) {
3423
3424
  yield doubleRaf();
3424
- resize();
3425
+ resize(true);
3425
3426
  }
3426
3427
  }));
3427
3428
  function computePlaceholderState() {
@@ -3435,16 +3436,28 @@ var __sfc__$99 = (0, vue.defineComponent)({
3435
3436
  function handleClick(e) {
3436
3437
  call(props2.onClick, e);
3437
3438
  }
3438
- function resize() {
3439
- if (!middleEl.value) return;
3440
- middleOffsetLeft.value = `${middleEl.value.offsetLeft}px`;
3441
- middleOffsetWidth.value = `${middleEl.value.offsetWidth}px`;
3442
- middleOffsetHeight.value = `${middleEl.value.offsetHeight}px`;
3443
- if (props2.variant === "outlined" && placeholderTextEl.value) {
3444
- const placeholderTextStyle = getStyle$1(placeholderTextEl.value);
3445
- const placeholderSpace = `var(--field-decorator-outlined-${props2.size}-placeholder-space)`;
3446
- legendWidth.value = `calc(${placeholderTextStyle.width} * 0.75 + ${placeholderSpace} * 2)`;
3447
- }
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
+ });
3448
3461
  }
3449
3462
  return {
3450
3463
  placeholderTextEl,
@@ -8335,7 +8348,7 @@ function __render__$88(_ctx, _cache) {
8335
8348
  _ctx.block,
8336
8349
  `${_ctx.n("$--flex")} ${_ctx.n("--block")}`,
8337
8350
  _ctx.n("$--inline-flex")
8338
- ], [!_ctx.states.text, _ctx.states.elevation], [!_ctx.states.iconContainer && !_ctx.states.text, _ctx.n(`--${_ctx.states.type}`)], [_ctx.states.text, `${_ctx.n("--text")} ${_ctx.n(`--text-${_ctx.states.type}`)}`], [_ctx.states.iconContainer, _ctx.n(`--icon-container-${_ctx.states.type}`)], [_ctx.states.filledDefault, _ctx.n("--filled-default")], [_ctx.round, _ctx.n("--round")], [_ctx.fab, _ctx.n("--fab")], [_ctx.states.outline, _ctx.n("--outline")], [_ctx.loading || _ctx.pending, _ctx.n("--loading")], [_ctx.disabled, _ctx.n("--disabled")], [_ctx.states.text && _ctx.disabled, _ctx.n("--text-disabled")])),
8351
+ ], [!_ctx.states.text, _ctx.states.elevation], [!_ctx.states.iconContainer && !_ctx.states.text, _ctx.n(`--${_ctx.states.type}`)], [_ctx.states.text, `${_ctx.n("--text")} ${_ctx.n(`--text-${_ctx.states.type}`)}`], [_ctx.states.iconContainer, _ctx.n(`--icon-container-${_ctx.states.type}`)], [_ctx.states.filledDefault, _ctx.n("--filled-default")], [_ctx.states.elevationDisabled, _ctx.n("--elevation-disabled")], [_ctx.round, _ctx.n("--round")], [_ctx.fab, _ctx.n("--fab")], [_ctx.states.outline, _ctx.n("--outline")], [_ctx.loading || _ctx.pending, _ctx.n("--loading")], [_ctx.disabled, _ctx.n("--disabled")], [_ctx.states.text && _ctx.disabled, _ctx.n("--text-disabled")])),
8339
8352
  tabindex: _ctx.focusable ? void 0 : "-1",
8340
8353
  style: (0, vue.normalizeStyle)({
8341
8354
  color: _ctx.states.textColor,
@@ -8401,7 +8414,8 @@ var __sfc__$88 = (0, vue.defineComponent)({
8401
8414
  textColor: props2.textColor,
8402
8415
  outline: props2.outline,
8403
8416
  iconContainer: props2.tonal || props2.iconContainer,
8404
- filledDefault: (props2.type == null || props2.type === "default") && isFilledElevation(props2.elevation) && !props2.text && !props2.outline && !props2.tonal && !props2.iconContainer
8417
+ elevationDisabled: props2.tonal || props2.elevation === false || toNumber(props2.elevation) === 0,
8418
+ filledDefault: (props2.type == null || props2.type === "default") && (props2.elevation === false || toNumber(props2.elevation) === 0) && !props2.text && !props2.outline && !props2.tonal && !props2.iconContainer
8405
8419
  };
8406
8420
  const { type, size, color, textColor, mode, elevation } = buttonGroup;
8407
8421
  return {
@@ -8413,7 +8427,8 @@ var __sfc__$88 = (0, vue.defineComponent)({
8413
8427
  text: mode.value === "text" || mode.value === "outline",
8414
8428
  outline: mode.value === "outline",
8415
8429
  iconContainer: mode.value === "tonal" || mode.value === "icon-container",
8416
- filledDefault: mode.value === "normal" && ((_g = props2.type) != null ? _g : type.value) === "default" && isFilledElevation(elevation.value)
8430
+ elevationDisabled: mode.value === "tonal",
8431
+ filledDefault: mode.value === "normal" && ((_g = props2.type) != null ? _g : type.value) === "default" && (elevation.value === false || toNumber(elevation.value) === 0)
8417
8432
  };
8418
8433
  });
8419
8434
  function attemptAutoLoading(result) {
@@ -8440,9 +8455,6 @@ var __sfc__$88 = (0, vue.defineComponent)({
8440
8455
  if (!props2.focusable) return;
8441
8456
  isFocusing.value = true;
8442
8457
  }
8443
- function isFilledElevation(elevation) {
8444
- return elevation === false || toNumber(elevation) === 0;
8445
- }
8446
8458
  return {
8447
8459
  pending,
8448
8460
  states,
@@ -32702,7 +32714,7 @@ var _WatermarkComponent = stdin_default$107;
32702
32714
  var stdin_default$101 = stdin_default$107;
32703
32715
  //#endregion
32704
32716
  //#region es/index.bundle.mjs
32705
- var version = "3.19.1";
32717
+ var version = "3.19.3";
32706
32718
  function install(app) {
32707
32719
  stdin_default.install && app.use(stdin_default);
32708
32720
  stdin_default$1.install && app.use(stdin_default$1);