@varlet/ui 3.20.6 → 3.20.8

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
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  let vue = require("vue");
6
- //#region ../../node_modules/.pnpm/rattail@2.1.1_oxfmt@0.60.0_vite-plus@0.2.6_@types+node@20.19.39_@vitest+coverage-istanbul@4.1_njw3paytr7isgqoonhsyyq2e2q/node_modules/rattail/dist/callOrReturn-Kvk3rYZJ.mjs
6
+ //#region ../../node_modules/.pnpm/rattail@2.1.1_oxfmt@0.72.0_vite-plus@1.1.0_@types+node@22.19.17_@vitest+coverage-istanbul@5.0_av5tye26zac23ejqbw3p6coe4y/node_modules/rattail/dist/callOrReturn-Kvk3rYZJ.mjs
7
7
  function isArray(val) {
8
8
  return Array.isArray(val);
9
9
  }
@@ -86,7 +86,7 @@ function init(converter, defaultAttributes) {
86
86
  }
87
87
  init(defaultConverter, { path: "/" });
88
88
  //#endregion
89
- //#region ../../node_modules/.pnpm/rattail@2.1.1_oxfmt@0.60.0_vite-plus@0.2.6_@types+node@20.19.39_@vitest+coverage-istanbul@4.1_njw3paytr7isgqoonhsyyq2e2q/node_modules/rattail/dist/index.mjs
89
+ //#region ../../node_modules/.pnpm/rattail@2.1.1_oxfmt@0.72.0_vite-plus@1.1.0_@types+node@22.19.17_@vitest+coverage-istanbul@5.0_av5tye26zac23ejqbw3p6coe4y/node_modules/rattail/dist/index.mjs
90
90
  function clamp$1(num, min, max) {
91
91
  return Math.min(max, Math.max(min, num));
92
92
  }
@@ -4994,10 +4994,7 @@ function computeOffsets(_ref) {
4994
4994
  case start$1:
4995
4995
  offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
4996
4996
  break;
4997
- case "end":
4998
- offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
4999
- break;
5000
- default:
4997
+ case "end": offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
5001
4998
  }
5002
4999
  }
5003
5000
  return offsets;
@@ -7364,7 +7361,6 @@ var Dayjs = /*#__PURE__*/ function() {
7364
7361
  case "ss": return Utils.s(_this3.$s, 2, "0");
7365
7362
  case "SSS": return Utils.s(_this3.$ms, 3, "0");
7366
7363
  case "Z": return zoneStr;
7367
- default: break;
7368
7364
  }
7369
7365
  return null;
7370
7366
  };
@@ -7410,9 +7406,7 @@ var Dayjs = /*#__PURE__*/ function() {
7410
7406
  case S:
7411
7407
  result = diff / MILLISECONDS_A_SECOND;
7412
7408
  break;
7413
- default:
7414
- result = diff;
7415
- break;
7409
+ default: result = diff;
7416
7410
  }
7417
7411
  return _float ? result : Utils.a(result);
7418
7412
  };
@@ -10779,13 +10773,13 @@ P.cubeRoot = P.cbrt = function() {
10779
10773
  if (!x.isFinite() || x.isZero()) return new Ctor(x);
10780
10774
  external = false;
10781
10775
  s = x.s * mathpow(x.s * x, 1 / 3);
10782
- if (!s || Math.abs(s) == Infinity) {
10776
+ if (!s || Math.abs(s) == 1 / 0) {
10783
10777
  n = digitsToString(x.d);
10784
10778
  e = x.e;
10785
10779
  if (s = (e - n.length + 1) % 3) n += s == 1 || s == -2 ? "0" : "00";
10786
10780
  s = mathpow(n, 1 / 3);
10787
10781
  e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));
10788
- if (s == Infinity) n = "5e" + e;
10782
+ if (s == 1 / 0) n = "5e" + e;
10789
10783
  else {
10790
10784
  n = s.toExponential();
10791
10785
  n = n.slice(0, n.indexOf("e") + 1) + e;
@@ -10856,7 +10850,7 @@ P.greaterThanOrEqualTo = P.gte = function(y) {
10856
10850
  };
10857
10851
  P.hyperbolicCosine = P.cosh = function() {
10858
10852
  var k, n, pr, rm, len, x = this, Ctor = x.constructor, one = new Ctor(1);
10859
- if (!x.isFinite()) return new Ctor(x.s ? Infinity : NaN);
10853
+ if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);
10860
10854
  if (x.isZero()) return one;
10861
10855
  pr = Ctor.precision;
10862
10856
  rm = Ctor.rounding;
@@ -11062,11 +11056,13 @@ P.logarithm = P.log = function(base) {
11062
11056
  isBase10 = base.eq(10);
11063
11057
  }
11064
11058
  d = arg.d;
11065
- if (arg.s < 0 || !d || !d[0] || arg.eq(1)) return new Ctor(d && !d[0] ? -Infinity : arg.s != 1 ? NaN : d ? 0 : Infinity);
11066
- if (isBase10) if (d.length > 1) inf = true;
11067
- else {
11068
- for (k = d[0]; k % 10 === 0;) k /= 10;
11069
- inf = k !== 1;
11059
+ if (arg.s < 0 || !d || !d[0] || arg.eq(1)) return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);
11060
+ if (isBase10) {
11061
+ if (d.length > 1) inf = true;
11062
+ else {
11063
+ for (k = d[0]; k % 10 === 0;) k /= 10;
11064
+ inf = k !== 1;
11065
+ }
11070
11066
  }
11071
11067
  external = false;
11072
11068
  sd = pr + guard;
@@ -11284,15 +11280,15 @@ P.sine = P.sin = function() {
11284
11280
  };
11285
11281
  P.squareRoot = P.sqrt = function() {
11286
11282
  var m, n, sd, r, rep, t, x = this, d = x.d, e = x.e, s = x.s, Ctor = x.constructor;
11287
- if (s !== 1 || !d || !d[0]) return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : Infinity);
11283
+ if (s !== 1 || !d || !d[0]) return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);
11288
11284
  external = false;
11289
11285
  s = Math.sqrt(+x);
11290
- if (s == 0 || s == Infinity) {
11286
+ if (s == 0 || s == 1 / 0) {
11291
11287
  n = digitsToString(d);
11292
11288
  if ((n.length + e) % 2 == 0) n += "0";
11293
11289
  s = Math.sqrt(n);
11294
11290
  e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);
11295
- if (s == Infinity) n = "5e" + e;
11291
+ if (s == 1 / 0) n = "5e" + e;
11296
11292
  else {
11297
11293
  n = s.toExponential();
11298
11294
  n = n.slice(0, n.indexOf("e") + 1) + e;
@@ -11589,8 +11585,8 @@ function checkInt32(i, min, max) {
11589
11585
  if (i !== ~~i || i < min || i > max) throw Error(invalidArgument + i);
11590
11586
  }
11591
11587
  function checkRoundingDigits(d, i, rm, repeating) {
11592
- var di, k, r, rd;
11593
- for (k = d[0]; k >= 10; k /= 10) --i;
11588
+ var di, k = d[0], r, rd;
11589
+ for (; k >= 10; k /= 10) --i;
11594
11590
  if (--i < 0) {
11595
11591
  i += LOG_BASE;
11596
11592
  di = 0;
@@ -11600,12 +11596,13 @@ function checkRoundingDigits(d, i, rm, repeating) {
11600
11596
  }
11601
11597
  k = mathpow(10, LOG_BASE - i);
11602
11598
  rd = d[di] % k | 0;
11603
- if (repeating == null) if (i < 3) {
11604
- if (i == 0) rd = rd / 100 | 0;
11605
- else if (i == 1) rd = rd / 10 | 0;
11606
- r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 5e4 || rd == 0;
11607
- } else r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;
11608
- else if (i < 4) {
11599
+ if (repeating == null) {
11600
+ if (i < 3) {
11601
+ if (i == 0) rd = rd / 100 | 0;
11602
+ else if (i == 1) rd = rd / 10 | 0;
11603
+ r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 5e4 || rd == 0;
11604
+ } else r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) && (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 || (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;
11605
+ } else if (i < 4) {
11609
11606
  if (i == 0) rd = rd / 1e3 | 0;
11610
11607
  else if (i == 1) rd = rd / 100 | 0;
11611
11608
  else if (i == 2) rd = rd / 10 | 0;
@@ -11803,14 +11800,15 @@ function finalise(x, sd, rm, isTruncated) {
11803
11800
  } else {
11804
11801
  xdi = Math.ceil((i + 1) / LOG_BASE);
11805
11802
  k = xd.length;
11806
- if (xdi >= k) if (isTruncated) {
11807
- for (; k++ <= xdi;) xd.push(0);
11808
- w = rd = 0;
11809
- digits = 1;
11810
- i %= LOG_BASE;
11811
- j = i - LOG_BASE + 1;
11812
- } else break out;
11813
- else {
11803
+ if (xdi >= k) {
11804
+ if (isTruncated) {
11805
+ for (; k++ <= xdi;) xd.push(0);
11806
+ w = rd = 0;
11807
+ digits = 1;
11808
+ i %= LOG_BASE;
11809
+ j = i - LOG_BASE + 1;
11810
+ } else break out;
11811
+ } else {
11814
11812
  w = k = xd[xdi];
11815
11813
  for (digits = 1; k >= 10; k /= 10) digits++;
11816
11814
  i %= LOG_BASE;
@@ -11957,7 +11955,7 @@ function maxOrMin(Ctor, args, n) {
11957
11955
  }
11958
11956
  function naturalExponential(x, sd) {
11959
11957
  var denominator, guard, j, pow, sum, t, wpr, rep = 0, i = 0, k = 0, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision;
11960
- if (!x.d || !x.d[0] || x.e > 17) return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : Infinity : x.s ? x.s < 0 ? 0 : x : NaN);
11958
+ if (!x.d || !x.d[0] || x.e > 17) return new Ctor(x.d ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 : x.s ? x.s < 0 ? 0 : x : NaN);
11961
11959
  if (sd == null) {
11962
11960
  external = false;
11963
11961
  wpr = pr;
@@ -11978,13 +11976,14 @@ function naturalExponential(x, sd) {
11978
11976
  if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
11979
11977
  j = k;
11980
11978
  while (j--) sum = finalise(sum.times(sum), wpr, 1);
11981
- if (sd == null) if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
11982
- Ctor.precision = wpr += 10;
11983
- denominator = pow = t = new Ctor(1);
11984
- i = 0;
11985
- rep++;
11986
- } else return finalise(sum, Ctor.precision = pr, rm, external = true);
11987
- else {
11979
+ if (sd == null) {
11980
+ if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
11981
+ Ctor.precision = wpr += 10;
11982
+ denominator = pow = t = new Ctor(1);
11983
+ i = 0;
11984
+ rep++;
11985
+ } else return finalise(sum, Ctor.precision = pr, rm, external = true);
11986
+ } else {
11988
11987
  Ctor.precision = pr;
11989
11988
  return sum;
11990
11989
  }
@@ -11994,7 +11993,7 @@ function naturalExponential(x, sd) {
11994
11993
  }
11995
11994
  function naturalLogarithm(y, sd) {
11996
11995
  var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2, n = 1, guard = 10, x = y, xd = x.d, Ctor = x.constructor, rm = Ctor.rounding, pr = Ctor.precision;
11997
- if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) return new Ctor(xd && !xd[0] ? -Infinity : x.s != 1 ? NaN : xd ? 0 : x);
11996
+ if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);
11998
11997
  if (sd == null) {
11999
11998
  external = false;
12000
11999
  wpr = pr;
@@ -12031,13 +12030,14 @@ function naturalLogarithm(y, sd) {
12031
12030
  sum = sum.times(2);
12032
12031
  if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ""));
12033
12032
  sum = divide(sum, new Ctor(n), wpr, 1);
12034
- if (sd == null) if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
12035
- Ctor.precision = wpr += guard;
12036
- t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);
12037
- x2 = finalise(x.times(x), wpr, 1);
12038
- denominator = rep = 1;
12039
- } else return finalise(sum, Ctor.precision = pr, rm, external = true);
12040
- else {
12033
+ if (sd == null) {
12034
+ if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
12035
+ Ctor.precision = wpr += guard;
12036
+ t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);
12037
+ x2 = finalise(x.times(x), wpr, 1);
12038
+ denominator = rep = 1;
12039
+ } else return finalise(sum, Ctor.precision = pr, rm, external = true);
12040
+ } else {
12041
12041
  Ctor.precision = pr;
12042
12042
  return sum;
12043
12043
  }
@@ -12250,13 +12250,15 @@ function toStringBinary(x, baseOut, sd, rm) {
12250
12250
  for (len = xd.length; !xd[len - 1]; --len);
12251
12251
  for (i = 0, str = ""; i < len; i++) str += NUMERALS.charAt(xd[i]);
12252
12252
  if (isExp) {
12253
- if (len > 1) if (baseOut == 16 || baseOut == 8) {
12254
- i = baseOut == 16 ? 4 : 3;
12255
- for (--len; len % i; len++) str += "0";
12256
- xd = convertBase(str, base, baseOut);
12257
- for (len = xd.length; !xd[len - 1]; --len);
12258
- for (i = 1, str = "1."; i < len; i++) str += NUMERALS.charAt(xd[i]);
12259
- } else str = str.charAt(0) + "." + str.slice(1);
12253
+ if (len > 1) {
12254
+ if (baseOut == 16 || baseOut == 8) {
12255
+ i = baseOut == 16 ? 4 : 3;
12256
+ for (--len; len % i; len++) str += "0";
12257
+ xd = convertBase(str, base, baseOut);
12258
+ for (len = xd.length; !xd[len - 1]; --len);
12259
+ for (i = 1, str = "1."; i < len; i++) str += NUMERALS.charAt(xd[i]);
12260
+ } else str = str.charAt(0) + "." + str.slice(1);
12261
+ }
12260
12262
  str = str + (e < 0 ? "p" : "p+") + e;
12261
12263
  } else if (e < 0) {
12262
12264
  for (; ++e;) str = "0" + str;
@@ -12359,14 +12361,20 @@ function config(obj) {
12359
12361
  ];
12360
12362
  for (i = 0; i < ps.length; i += 3) {
12361
12363
  if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];
12362
- if ((v = obj[p]) !== void 0) if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;
12363
- else throw Error(invalidArgument + p + ": " + v);
12364
+ if ((v = obj[p]) !== void 0) {
12365
+ if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;
12366
+ else throw Error(invalidArgument + p + ": " + v);
12367
+ }
12364
12368
  }
12365
12369
  if (p = "crypto", useDefaults) this[p] = DEFAULTS[p];
12366
- if ((v = obj[p]) !== void 0) if (v === true || v === false || v === 0 || v === 1) if (v) if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) this[p] = true;
12367
- else throw Error(cryptoUnavailable);
12368
- else this[p] = false;
12369
- else throw Error(invalidArgument + p + ": " + v);
12370
+ if ((v = obj[p]) !== void 0) {
12371
+ if (v === true || v === false || v === 0 || v === 1) {
12372
+ if (v) {
12373
+ if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) this[p] = true;
12374
+ else throw Error(cryptoUnavailable);
12375
+ } else this[p] = false;
12376
+ } else throw Error(invalidArgument + p + ": " + v);
12377
+ }
12370
12378
  return this;
12371
12379
  }
12372
12380
  function cos(x) {
@@ -12383,17 +12391,18 @@ function clone(obj) {
12383
12391
  x.constructor = Decimal;
12384
12392
  if (isDecimalInstance(v)) {
12385
12393
  x.s = v.s;
12386
- if (external) if (!v.d || v.e > Decimal.maxE) {
12387
- x.e = NaN;
12388
- x.d = null;
12389
- } else if (v.e < Decimal.minE) {
12390
- x.e = 0;
12391
- x.d = [0];
12394
+ if (external) {
12395
+ if (!v.d || v.e > Decimal.maxE) {
12396
+ x.e = NaN;
12397
+ x.d = null;
12398
+ } else if (v.e < Decimal.minE) {
12399
+ x.e = 0;
12400
+ x.d = [0];
12401
+ } else {
12402
+ x.e = v.e;
12403
+ x.d = v.d.slice();
12404
+ }
12392
12405
  } else {
12393
- x.e = v.e;
12394
- x.d = v.d.slice();
12395
- }
12396
- else {
12397
12406
  x.e = v.e;
12398
12407
  x.d = v.d ? v.d.slice() : v.d;
12399
12408
  }
@@ -12413,20 +12422,21 @@ function clone(obj) {
12413
12422
  } else x.s = 1;
12414
12423
  if (v === ~~v && v < 1e7) {
12415
12424
  for (e = 0, i = v; i >= 10; i /= 10) e++;
12416
- if (external) if (e > Decimal.maxE) {
12417
- x.e = NaN;
12418
- x.d = null;
12419
- } else if (e < Decimal.minE) {
12420
- x.e = 0;
12421
- x.d = [0];
12425
+ if (external) {
12426
+ if (e > Decimal.maxE) {
12427
+ x.e = NaN;
12428
+ x.d = null;
12429
+ } else if (e < Decimal.minE) {
12430
+ x.e = 0;
12431
+ x.d = [0];
12432
+ } else {
12433
+ x.e = e;
12434
+ x.d = [v];
12435
+ }
12422
12436
  } else {
12423
12437
  x.e = e;
12424
12438
  x.d = [v];
12425
12439
  }
12426
- else {
12427
- x.e = e;
12428
- x.d = [v];
12429
- }
12430
12440
  return;
12431
12441
  }
12432
12442
  if (v * 0 !== 0) {
@@ -12544,7 +12554,7 @@ function hypot() {
12544
12554
  if (!n.d) {
12545
12555
  if (n.s) {
12546
12556
  external = true;
12547
- return new this(Infinity);
12557
+ return new this(1 / 0);
12548
12558
  }
12549
12559
  t = n;
12550
12560
  } else if (t.d) t = t.plus(n.times(n));
@@ -15447,8 +15457,6 @@ var __spreadValues$21 = (a, b) => {
15447
15457
  return a;
15448
15458
  };
15449
15459
  var dayjs$4 = createDayjs();
15450
- var DAYS_PER_WEEK = 7;
15451
- var WEEKS_PER_PANEL = 6;
15452
15460
  var MonthOffset = {
15453
15461
  Prev: -1,
15454
15462
  Current: 0,
@@ -15526,7 +15534,7 @@ var __sfc__$64 = (0, vue.defineComponent)({
15526
15534
  const lastDayjsObject = firstDayjsObject.endOf(DatePickerUnits.Month);
15527
15535
  const daysInMonth = firstDayjsObject.daysInMonth();
15528
15536
  const leadingCount = Math.max(0, sortWeekList.value.findIndex((week) => week === `${firstDayjsObject.day()}`));
15529
- const trailingCount = WEEKS_PER_PANEL * DAYS_PER_WEEK - leadingCount - daysInMonth;
15537
+ const trailingCount = 42 - leadingCount - daysInMonth;
15530
15538
  const cells = [];
15531
15539
  for (let offset = leadingCount; offset > 0; offset--) cells.push(createCell(firstDayjsObject.subtract(offset, DatePickerUnits.Day), MonthOffset.Prev));
15532
15540
  for (let day = 1; day <= daysInMonth; day++) cells.push(createCell(firstDayjsObject.date(day), MonthOffset.Current));
@@ -17919,7 +17927,8 @@ function Dialog(options) {
17919
17927
  if (!inBrowser()) return Promise.resolve();
17920
17928
  return new Promise((resolve) => {
17921
17929
  Dialog.close();
17922
- const reactiveDialogOptions = (0, vue.reactive)(normalizeOptions$2(options));
17930
+ const dialogOptions = normalizeOptions$2(options);
17931
+ const reactiveDialogOptions = (0, vue.reactive)(dialogOptions);
17923
17932
  reactiveDialogOptions.teleport = "body";
17924
17933
  singletonOptions$2 = reactiveDialogOptions;
17925
17934
  const { unmountInstance } = mountInstance(stdin_default$400, reactiveDialogOptions, {
@@ -18413,7 +18422,9 @@ var stdin_default$99 = stdin_default$397;
18413
18422
  var props$32 = {
18414
18423
  expand: Boolean,
18415
18424
  expandTrigger: String,
18425
+ expandableOnOverflow: Boolean,
18416
18426
  lineClamp: [Number, String],
18427
+ tooltipOnOverflow: Boolean,
18417
18428
  tooltip: {
18418
18429
  type: [Object, Boolean],
18419
18430
  default: true
@@ -18444,11 +18455,12 @@ var _hoisted_1$26 = { key: 0 };
18444
18455
  function __render__$53(_ctx, _cache) {
18445
18456
  const _component_var_tooltip = (0, vue.resolveComponent)("var-tooltip");
18446
18457
  return (0, vue.openBlock)(), (0, vue.createBlock)(_component_var_tooltip, (0, vue.mergeProps)({
18458
+ ref: "rootRef",
18447
18459
  class: _ctx.classes(_ctx.n(), [
18448
18460
  _ctx.lineClamp,
18449
18461
  _ctx.n("--clamp"),
18450
18462
  _ctx.n("--line")
18451
- ], [_ctx.expandTrigger, _ctx.n("--cursor")], [_ctx.expanding, _ctx.n("--expand")]),
18463
+ ], [_ctx.clickable, _ctx.n("--cursor")], [_ctx.expanding, _ctx.n("--expand")]),
18452
18464
  "var-ellipsis-cover": "",
18453
18465
  style: _ctx.rootStyles
18454
18466
  }, _ctx.tooltipProps, { onClick: _ctx.handleClick }), {
@@ -18469,24 +18481,54 @@ var __sfc__$53 = (0, vue.defineComponent)({
18469
18481
  components: { VarTooltip: stdin_default$99 },
18470
18482
  props: props$32,
18471
18483
  setup(props2) {
18484
+ const rootRef = (0, vue.ref)(null);
18485
+ const truncated = (0, vue.ref)(false);
18472
18486
  const expanding = useVModel(props2, "expand");
18487
+ let previousWidth;
18488
+ const clickable = (0, vue.computed)(() => !!props2.expandTrigger && (!props2.expandableOnOverflow || truncated.value || expanding.value));
18473
18489
  const rootStyles = (0, vue.computed)(() => props2.lineClamp ? { "-webkit-line-clamp": props2.lineClamp } : {});
18474
18490
  const tooltipProps = (0, vue.computed)(() => {
18475
- if (props2.tooltip === false) return { disabled: true };
18491
+ if (props2.tooltip === false || props2.tooltipOnOverflow && !truncated.value) return { disabled: true };
18476
18492
  if (props2.tooltip === true) return { sameWidth: true };
18477
18493
  return __spreadValues$13({ sameWidth: true }, props2.tooltip);
18478
18494
  });
18495
+ function getRootElement() {
18496
+ var _a;
18497
+ if (!rootRef.value) return null;
18498
+ return (_a = rootRef.value.$el) != null ? _a : rootRef.value;
18499
+ }
18500
+ function checkTruncated() {
18501
+ const element = getRootElement();
18502
+ if (!element) return;
18503
+ const next = props2.lineClamp ? element.scrollHeight > element.clientHeight : element.scrollWidth > element.clientWidth;
18504
+ if (next !== truncated.value) truncated.value = next;
18505
+ }
18479
18506
  function handleClick() {
18480
- if (!props2.expandTrigger) return;
18507
+ if (!clickable.value) return;
18481
18508
  expanding.value = !expanding.value;
18482
18509
  }
18510
+ function handleResize(entries) {
18511
+ var _a;
18512
+ const width = (_a = entries[0]) == null ? void 0 : _a.contentRect.width;
18513
+ if (width !== void 0 && width !== previousWidth && previousWidth !== void 0 && props2.expandableOnOverflow && expanding.value) expanding.value = false;
18514
+ previousWidth = width;
18515
+ checkTruncated();
18516
+ }
18517
+ useResizeObserver(getRootElement, handleResize);
18518
+ (0, vue.watch)(() => props2.lineClamp, checkTruncated);
18519
+ onSmartMounted(checkTruncated);
18520
+ (0, vue.onUpdated)(checkTruncated);
18483
18521
  return {
18522
+ rootRef,
18523
+ truncated,
18524
+ clickable,
18484
18525
  tooltipProps,
18485
18526
  expanding,
18486
18527
  rootStyles,
18487
18528
  n: n$55,
18488
18529
  classes: classes$44,
18489
- handleClick
18530
+ handleClick,
18531
+ handleResize
18490
18532
  };
18491
18533
  }
18492
18534
  });
@@ -20007,7 +20049,8 @@ function normalizeOptions$1(options = {}) {
20007
20049
  function ImagePreview(options) {
20008
20050
  if (!inBrowser()) return;
20009
20051
  ImagePreview.close();
20010
- const reactiveImagePreviewOptions = (0, vue.reactive)(normalizeOptions$1(options));
20052
+ const imagePreviewOptions = normalizeOptions$1(options);
20053
+ const reactiveImagePreviewOptions = (0, vue.reactive)(imagePreviewOptions);
20011
20054
  reactiveImagePreviewOptions.teleport = "body";
20012
20055
  singletonOptions$1 = reactiveImagePreviewOptions;
20013
20056
  const { unmountInstance } = mountInstance(stdin_default$388, reactiveImagePreviewOptions, {
@@ -22303,7 +22346,8 @@ var singletonOptions;
22303
22346
  function Picker(options) {
22304
22347
  return new Promise((resolve) => {
22305
22348
  Picker.close();
22306
- const reactivePickerOptions = (0, vue.reactive)(isArray(options) ? { columns: options } : options);
22349
+ const pickerOptions = isArray(options) ? { columns: options } : options;
22350
+ const reactivePickerOptions = (0, vue.reactive)(pickerOptions);
22307
22351
  reactivePickerOptions.dynamic = true;
22308
22352
  reactivePickerOptions.teleport = "body";
22309
22353
  singletonOptions = reactivePickerOptions;
@@ -22540,12 +22584,8 @@ var __sfc__$37 = (0, vue.defineComponent)({
22540
22584
  const roundValue = clamp$1(Math.round(toNumber(value)), MIN, MAX);
22541
22585
  const strokeOffset = `${(MAX - roundValue) / MAX * CIRCUMFERENCE}`;
22542
22586
  const strokeWidth = toPxNum(lineWidth) / toPxNum(size) * diameter;
22543
- const beginPositionX = 0;
22544
- const beginPositionY = -20;
22545
- const endPositionX = 0;
22546
- const endPositionY = -2 * RADIUS;
22547
- const path = `M ${diameter / 2} ${diameter / 2} m ${beginPositionX} ${beginPositionY} a ${RADIUS} ${RADIUS}
22548
- 0 1 1 ${endPositionX} 40 a ${RADIUS} ${RADIUS} 0 1 1 0 ${endPositionY}`;
22587
+ const path = `M ${diameter / 2} ${diameter / 2} m 0 -20 a ${RADIUS} ${RADIUS}
22588
+ 0 1 1 0 40 a ${RADIUS} ${RADIUS} 0 1 1 0 -40`;
22549
22589
  return {
22550
22590
  strokeWidth,
22551
22591
  viewBox,
@@ -25518,6 +25558,7 @@ var props$74 = {
25518
25558
  type: Number,
25519
25559
  default: 3e3
25520
25560
  },
25561
+ progress: Boolean,
25521
25562
  elevation: {
25522
25563
  type: [
25523
25564
  Boolean,
@@ -25560,6 +25601,7 @@ var ICON_TYPE_DICT = {
25560
25601
  loading: ""
25561
25602
  };
25562
25603
  function __render__$15(_ctx, _cache) {
25604
+ var _a;
25563
25605
  const _component_var_icon = (0, vue.resolveComponent)("var-icon");
25564
25606
  const _component_var_loading = (0, vue.resolveComponent)("var-loading");
25565
25607
  return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
@@ -25569,7 +25611,7 @@ function __render__$15(_ctx, _cache) {
25569
25611
  zIndex: _ctx.zIndex
25570
25612
  })
25571
25613
  }, [(0, vue.createElementVNode)("div", {
25572
- class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n("wrapper"), _ctx.n(`wrapper-${_ctx.position}`), _ctx.formatElevation(_ctx.elevation, 4), [_ctx.vertical, _ctx.n("vertical")], [_ctx.type && _ctx.SNACKBAR_TYPE.includes(_ctx.type), _ctx.n(`wrapper-${_ctx.type}`)])),
25614
+ class: (0, vue.normalizeClass)(_ctx.classes(_ctx.n("wrapper"), _ctx.n(`wrapper-${_ctx.position}`), _ctx.formatElevation(_ctx.elevation, 4), [_ctx.vertical, _ctx.n("vertical")], [_ctx.showProgress, _ctx.n("wrapper--progress")], [_ctx.type && _ctx.SNACKBAR_TYPE.includes(_ctx.type), _ctx.n(`wrapper-${_ctx.type}`)])),
25573
25615
  style: (0, vue.normalizeStyle)({ zIndex: _ctx.zIndex })
25574
25616
  }, [
25575
25617
  (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([_ctx.n("content"), _ctx.contentClass]) }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(_ctx.content), 1)])], 2),
@@ -25598,7 +25640,15 @@ function __render__$15(_ctx, _cache) {
25598
25640
  _ctx.$slots.action ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
25599
25641
  key: 1,
25600
25642
  class: (0, vue.normalizeClass)(_ctx.n("action"))
25601
- }, [(0, vue.renderSlot)(_ctx.$slots, "action")], 2)) : (0, vue.createCommentVNode)("v-if", true)
25643
+ }, [(0, vue.renderSlot)(_ctx.$slots, "action")], 2)) : (0, vue.createCommentVNode)("v-if", true),
25644
+ _ctx.showProgress ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
25645
+ key: (_a = _ctx.countdown) == null ? void 0 : _a.id,
25646
+ class: (0, vue.normalizeClass)(_ctx.n("progress")),
25647
+ "aria-hidden": "true"
25648
+ }, [(0, vue.createElementVNode)("div", {
25649
+ class: (0, vue.normalizeClass)(_ctx.n("progress-bar")),
25650
+ style: (0, vue.normalizeStyle)(_ctx.progressStyle)
25651
+ }, null, 6)], 2)) : (0, vue.createCommentVNode)("v-if", true)
25602
25652
  ], 6)], 6)), [[vue.vShow, _ctx.show]]);
25603
25653
  }
25604
25654
  var __sfc__$15 = (0, vue.defineComponent)({
@@ -25609,7 +25659,9 @@ var __sfc__$15 = (0, vue.defineComponent)({
25609
25659
  },
25610
25660
  props: props$74,
25611
25661
  setup(props2) {
25612
- const timer = (0, vue.ref)(null);
25662
+ let timer;
25663
+ let countdownId = 0;
25664
+ const countdown = (0, vue.shallowRef)();
25613
25665
  const { zIndex } = useZIndex(() => props2.show, 1);
25614
25666
  useLock(() => props2.show, () => props2.lockScroll);
25615
25667
  const isForbidClick = (0, vue.computed)(() => {
@@ -25617,35 +25669,57 @@ var __sfc__$15 = (0, vue.defineComponent)({
25617
25669
  return type === "loading" || forbidClick;
25618
25670
  });
25619
25671
  const iconName = (0, vue.computed)(() => !props2.type ? "" : ICON_TYPE_DICT[props2.type]);
25672
+ const showProgress = (0, vue.computed)(() => props2.progress && countdown.value !== void 0 && countdown.value.duration > 0 && Number.isFinite(countdown.value.duration));
25673
+ const progressStyle = (0, vue.computed)(() => {
25674
+ if (!props2.progress || !countdown.value) return;
25675
+ const { duration, startedAt } = countdown.value;
25676
+ return {
25677
+ animationDuration: `${duration}ms`,
25678
+ animationDelay: `${-Math.max(0, Date.now() - startedAt)}ms`
25679
+ };
25680
+ });
25681
+ function clearCountdown() {
25682
+ clearTimeout(timer);
25683
+ timer = void 0;
25684
+ countdown.value = void 0;
25685
+ }
25620
25686
  function updateAfterDuration() {
25621
- timer.value = setTimeout(() => {
25622
- if (props2.type !== "loading") call(props2["onUpdate:show"], false);
25687
+ clearCountdown();
25688
+ if (!props2.show || props2.type === "loading") return;
25689
+ countdown.value = {
25690
+ id: countdownId++,
25691
+ duration: props2.duration,
25692
+ startedAt: Date.now()
25693
+ };
25694
+ timer = setTimeout(() => {
25695
+ clearCountdown();
25696
+ call(props2["onUpdate:show"], false);
25623
25697
  }, props2.duration);
25624
25698
  }
25625
25699
  (0, vue.watch)(() => props2.show, (show) => {
25626
- if (show) {
25627
- call(props2.onOpen);
25628
- updateAfterDuration();
25629
- } else {
25630
- clearTimeout(timer.value);
25631
- call(props2.onClose);
25632
- }
25633
- });
25634
- (0, vue.watch)(() => props2._update, () => {
25635
- clearTimeout(timer.value);
25636
- updateAfterDuration();
25700
+ if (show) call(props2.onOpen);
25701
+ else call(props2.onClose);
25637
25702
  });
25703
+ (0, vue.watch)([
25704
+ () => props2.show,
25705
+ () => props2.type === "loading",
25706
+ () => props2._update
25707
+ ], updateAfterDuration);
25638
25708
  onSmartMounted(() => {
25639
25709
  if (props2.show) {
25640
25710
  call(props2.onOpen);
25641
25711
  updateAfterDuration();
25642
25712
  }
25643
25713
  });
25714
+ (0, vue.onUnmounted)(clearCountdown);
25644
25715
  return {
25645
25716
  SNACKBAR_TYPE,
25646
25717
  zIndex,
25647
25718
  iconName,
25648
25719
  isForbidClick,
25720
+ countdown,
25721
+ showProgress,
25722
+ progressStyle,
25649
25723
  n: n$17,
25650
25724
  classes: classes$13,
25651
25725
  formatElevation
@@ -25737,6 +25811,7 @@ var defaultOptionsValue = {
25737
25811
  action: "",
25738
25812
  position: "top",
25739
25813
  duration: 3e3,
25814
+ progress: false,
25740
25815
  elevation: true,
25741
25816
  vertical: false,
25742
25817
  contentClass: void 0,
@@ -25917,12 +25992,15 @@ function computeMargin(y, x, options) {
25917
25992
  "flex-end",
25918
25993
  "start",
25919
25994
  "end"
25920
- ].includes(justify)) if (index !== lastIndex) margin = `${half(y)} ${x} ${half(y)} 0`;
25921
- else margin = `${half(y)} 0`;
25922
- else if (justify === "space-around") margin = `${half(y)} ${half(x)}`;
25923
- else if (justify === "space-between") if (index === 0) margin = `${half(y)} ${half(x)} ${half(y)} 0`;
25924
- else if (index === lastIndex) margin = `${half(y)} 0 ${half(y)} ${half(x)}`;
25925
- else margin = `${half(y)} ${half(x)}`;
25995
+ ].includes(justify)) {
25996
+ if (index !== lastIndex) margin = `${half(y)} ${x} ${half(y)} 0`;
25997
+ else margin = `${half(y)} 0`;
25998
+ } else if (justify === "space-around") margin = `${half(y)} ${half(x)}`;
25999
+ else if (justify === "space-between") {
26000
+ if (index === 0) margin = `${half(y)} ${half(x)} ${half(y)} 0`;
26001
+ else if (index === lastIndex) margin = `${half(y)} 0 ${half(y)} ${half(x)}`;
26002
+ else margin = `${half(y)} ${half(x)}`;
26003
+ }
25926
26004
  }
25927
26005
  if (direction === "column" && index !== lastIndex) margin = `0 0 ${y} 0`;
25928
26006
  return margin;
@@ -32877,7 +32955,7 @@ var _WatermarkComponent = stdin_default$108;
32877
32955
  var stdin_default$102 = stdin_default$108;
32878
32956
  //#endregion
32879
32957
  //#region es/index.bundle.mjs
32880
- var version = "3.20.6";
32958
+ var version = "3.20.8";
32881
32959
  function install(app) {
32882
32960
  stdin_default.install && app.use(stdin_default);
32883
32961
  stdin_default$1.install && app.use(stdin_default$1);