@varlet/ui 1.27.8 → 1.27.9-alpha.1653036733481

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.
Files changed (66) hide show
  1. package/es/badge/Badge.js +1 -1
  2. package/es/card/Card.js +213 -12
  3. package/es/card/card.css +1 -1
  4. package/es/card/card.less +109 -7
  5. package/es/card/props.js +18 -0
  6. package/es/index-bar/IndexBar.js +4 -4
  7. package/es/index-bar/props.js +1 -1
  8. package/es/loading/Loading.js +5 -14
  9. package/es/loading/loading.css +1 -1
  10. package/es/loading/loading.less +20 -0
  11. package/es/picker/Picker.js +2 -1
  12. package/es/progress/Progress.js +14 -11
  13. package/es/progress/progress.css +1 -1
  14. package/es/progress/progress.less +3 -0
  15. package/es/progress/props.js +1 -1
  16. package/es/rate/Rate.js +4 -2
  17. package/es/rate/props.js +2 -4
  18. package/es/rate/rate.css +1 -1
  19. package/es/rate/rate.less +7 -0
  20. package/es/select/Select.js +3 -1
  21. package/es/slider/Slider.js +10 -9
  22. package/es/style.css +1 -1
  23. package/es/switch/Switch.js +22 -19
  24. package/es/switch/props.js +1 -2
  25. package/es/switch/switch.css +1 -1
  26. package/es/switch/switch.less +18 -4
  27. package/es/utils/elements.js +13 -0
  28. package/es/utils/jest.js +19 -0
  29. package/es/varlet.esm.js +319 -90
  30. package/highlight/attributes.json +20 -4
  31. package/highlight/tags.json +5 -1
  32. package/highlight/web-types.json +49 -5
  33. package/lib/badge/Badge.js +1 -1
  34. package/lib/card/Card.js +213 -8
  35. package/lib/card/card.css +1 -1
  36. package/lib/card/card.less +109 -7
  37. package/lib/card/props.js +18 -0
  38. package/lib/index-bar/IndexBar.js +3 -3
  39. package/lib/index-bar/props.js +1 -1
  40. package/lib/loading/Loading.js +6 -15
  41. package/lib/loading/loading.css +1 -1
  42. package/lib/loading/loading.less +20 -0
  43. package/lib/picker/Picker.js +2 -1
  44. package/lib/progress/Progress.js +15 -11
  45. package/lib/progress/progress.css +1 -1
  46. package/lib/progress/progress.less +3 -0
  47. package/lib/progress/props.js +1 -1
  48. package/lib/rate/Rate.js +3 -1
  49. package/lib/rate/props.js +2 -4
  50. package/lib/rate/rate.css +1 -1
  51. package/lib/rate/rate.less +7 -0
  52. package/lib/select/Select.js +3 -1
  53. package/lib/slider/Slider.js +9 -8
  54. package/lib/snackbar/style/index.js +1 -1
  55. package/lib/snackbar/style/less.js +1 -1
  56. package/lib/style.css +1 -1
  57. package/lib/switch/Switch.js +22 -19
  58. package/lib/switch/props.js +1 -2
  59. package/lib/switch/switch.css +1 -1
  60. package/lib/switch/switch.less +18 -4
  61. package/lib/utils/elements.js +17 -1
  62. package/lib/utils/jest.js +21 -0
  63. package/package.json +10 -9
  64. package/types/card.d.ts +2 -0
  65. package/types/indexBar.d.ts +1 -1
  66. package/umd/varlet.js +4 -4
package/es/varlet.esm.js CHANGED
@@ -134,7 +134,7 @@ function kebabCase(str) {
134
134
  var ret = str.replace(/([A-Z])/g, " $1").trim();
135
135
  return ret.split(" ").join("-").toLowerCase();
136
136
  }
137
- function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
137
+ function asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, key, arg) {
138
138
  try {
139
139
  var info = gen[key](arg);
140
140
  var value = info.value;
@@ -148,16 +148,16 @@ function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
148
148
  Promise.resolve(value).then(_next, _throw);
149
149
  }
150
150
  }
151
- function _asyncToGenerator$c(fn) {
151
+ function _asyncToGenerator$d(fn) {
152
152
  return function() {
153
153
  var self = this, args = arguments;
154
154
  return new Promise(function(resolve, reject) {
155
155
  var gen = fn.apply(self, args);
156
156
  function _next(value) {
157
- asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "next", value);
157
+ asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "next", value);
158
158
  }
159
159
  function _throw(err) {
160
- asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "throw", err);
160
+ asyncGeneratorStep$d(gen, resolve, reject, _next, _throw, "throw", err);
161
161
  }
162
162
  _next(void 0);
163
163
  });
@@ -187,7 +187,7 @@ function inViewport(_x) {
187
187
  return _inViewport.apply(this, arguments);
188
188
  }
189
189
  function _inViewport() {
190
- _inViewport = _asyncToGenerator$c(function* (element) {
190
+ _inViewport = _asyncToGenerator$d(function* (element) {
191
191
  yield doubleRaf();
192
192
  var {
193
193
  top,
@@ -278,6 +278,17 @@ var toSizeUnit = (value) => {
278
278
  }
279
279
  return toPxNum(value) + "px";
280
280
  };
281
+ var multiplySizeUnit = function(value, quantity) {
282
+ if (quantity === void 0) {
283
+ quantity = 1;
284
+ }
285
+ if (value == null) {
286
+ return void 0;
287
+ }
288
+ var legalSize = toSizeUnit(value);
289
+ var unit = legalSize.match(/(vh|%|rem|px|vw)$/)[0];
290
+ return "" + parseFloat(legalSize) * quantity + unit;
291
+ };
281
292
  function requestAnimationFrame(fn) {
282
293
  return globalThis.requestAnimationFrame ? globalThis.requestAnimationFrame(fn) : globalThis.setTimeout(fn, 16);
283
294
  }
@@ -335,7 +346,7 @@ function supportTouch() {
335
346
  return inBrowser2 && "ontouchstart" in window;
336
347
  }
337
348
  var _excluded = ["collect", "clear"];
338
- function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
349
+ function asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, key, arg) {
339
350
  try {
340
351
  var info = gen[key](arg);
341
352
  var value = info.value;
@@ -349,16 +360,16 @@ function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
349
360
  Promise.resolve(value).then(_next, _throw);
350
361
  }
351
362
  }
352
- function _asyncToGenerator$b(fn) {
363
+ function _asyncToGenerator$c(fn) {
353
364
  return function() {
354
365
  var self = this, args = arguments;
355
366
  return new Promise(function(resolve, reject) {
356
367
  var gen = fn.apply(self, args);
357
368
  function _next(value) {
358
- asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "next", value);
369
+ asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "next", value);
359
370
  }
360
371
  function _throw(err) {
361
- asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "throw", err);
372
+ asyncGeneratorStep$c(gen, resolve, reject, _next, _throw, "throw", err);
362
373
  }
363
374
  _next(void 0);
364
375
  });
@@ -545,7 +556,7 @@ function keyInProvides(key) {
545
556
  function useValidation() {
546
557
  var errorMessage = ref("");
547
558
  var validate = /* @__PURE__ */ function() {
548
- var _ref = _asyncToGenerator$b(function* (rules, value, apis) {
559
+ var _ref = _asyncToGenerator$c(function* (rules, value, apis) {
549
560
  if (!isArray(rules) || !rules.length) {
550
561
  return true;
551
562
  }
@@ -566,7 +577,7 @@ function useValidation() {
566
577
  errorMessage.value = "";
567
578
  };
568
579
  var validateWithTrigger = /* @__PURE__ */ function() {
569
- var _ref2 = _asyncToGenerator$b(function* (validateTrigger, trigger, rules, value, apis) {
580
+ var _ref2 = _asyncToGenerator$c(function* (validateTrigger, trigger, rules, value, apis) {
570
581
  if (validateTrigger.includes(trigger)) {
571
582
  (yield validate(rules, value, apis)) && (errorMessage.value = "");
572
583
  }
@@ -1090,7 +1101,7 @@ var props$T = {
1090
1101
  type: Function
1091
1102
  }
1092
1103
  };
1093
- function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
1104
+ function asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, key, arg) {
1094
1105
  try {
1095
1106
  var info = gen[key](arg);
1096
1107
  var value = info.value;
@@ -1104,16 +1115,16 @@ function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
1104
1115
  Promise.resolve(value).then(_next, _throw);
1105
1116
  }
1106
1117
  }
1107
- function _asyncToGenerator$a(fn) {
1118
+ function _asyncToGenerator$b(fn) {
1108
1119
  return function() {
1109
1120
  var self = this, args = arguments;
1110
1121
  return new Promise(function(resolve, reject) {
1111
1122
  var gen = fn.apply(self, args);
1112
1123
  function _next(value) {
1113
- asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "next", value);
1124
+ asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "next", value);
1114
1125
  }
1115
1126
  function _throw(err) {
1116
- asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "throw", err);
1127
+ asyncGeneratorStep$b(gen, resolve, reject, _next, _throw, "throw", err);
1117
1128
  }
1118
1129
  _next(void 0);
1119
1130
  });
@@ -1145,7 +1156,7 @@ var Icon = defineComponent({
1145
1156
  var nextName = ref("");
1146
1157
  var shrinking = ref(false);
1147
1158
  var handleNameChange = /* @__PURE__ */ function() {
1148
- var _ref = _asyncToGenerator$a(function* (newName, oldName) {
1159
+ var _ref = _asyncToGenerator$b(function* (newName, oldName) {
1149
1160
  var {
1150
1161
  transition
1151
1162
  } = props2;
@@ -1683,10 +1694,10 @@ function render$W(_ctx, _cache) {
1683
1694
  key: 0,
1684
1695
  class: normalizeClass(_ctx.n("circle"))
1685
1696
  }, [createElementVNode("span", {
1686
- class: normalizeClass(_ctx.n("circle-block")),
1697
+ class: normalizeClass(_ctx.classes(_ctx.n("circle-block"), _ctx.n("circle-block--" + _ctx.size))),
1687
1698
  style: normalizeStyle({
1688
- width: _ctx.getRadius * 2 + "px",
1689
- height: _ctx.getRadius * 2 + "px",
1699
+ width: _ctx.multiplySizeUnit(_ctx.radius, 2),
1700
+ height: _ctx.multiplySizeUnit(_ctx.radius, 2),
1690
1701
  color: _ctx.color
1691
1702
  })
1692
1703
  }, _hoisted_2$7, 6)], 2)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.loadingTypeDict, (nums, key) => {
@@ -1726,15 +1737,6 @@ var Loading = defineComponent({
1726
1737
  rect: 8,
1727
1738
  disappear: 3
1728
1739
  };
1729
- var sizeDict = {
1730
- mini: 9,
1731
- small: 12,
1732
- normal: 15,
1733
- large: 18
1734
- };
1735
- var getRadius = computed(() => {
1736
- return props2.radius ? toNumber(props2.radius) : sizeDict[props2.size];
1737
- });
1738
1740
  var isShow = computed(() => {
1739
1741
  if (!call(slots.default))
1740
1742
  return true;
@@ -1743,8 +1745,8 @@ var Loading = defineComponent({
1743
1745
  return {
1744
1746
  n: n$Z,
1745
1747
  classes: classes$O,
1748
+ multiplySizeUnit,
1746
1749
  loadingTypeDict,
1747
- getRadius,
1748
1750
  isShow
1749
1751
  };
1750
1752
  }
@@ -2110,7 +2112,7 @@ var Badge = defineComponent({
2110
2112
  icon: icon2
2111
2113
  } = props2;
2112
2114
  var positionBasic = slots.default && n$W("position") + " " + n$W("--" + position);
2113
- var dotClass = dot && n$W("dot");
2115
+ var dotClass = dot ? n$W("dot") : null;
2114
2116
  var positionClass = getPositionClass();
2115
2117
  var iconClass = icon2 ? n$W("icon") : null;
2116
2118
  return [n$W("--" + type), positionBasic, dotClass, positionClass, iconClass];
@@ -2540,6 +2542,24 @@ var props$K = {
2540
2542
  height: {
2541
2543
  type: [String, Number]
2542
2544
  },
2545
+ width: {
2546
+ type: [String, Number]
2547
+ },
2548
+ layout: {
2549
+ type: String,
2550
+ default: "column"
2551
+ },
2552
+ floating: {
2553
+ type: Boolean,
2554
+ default: false
2555
+ },
2556
+ "onUpdate:floating": {
2557
+ type: Function
2558
+ },
2559
+ floatingDuration: {
2560
+ type: Number,
2561
+ default: 250
2562
+ },
2543
2563
  alt: {
2544
2564
  type: String
2545
2565
  },
@@ -2563,28 +2583,78 @@ var props$K = {
2563
2583
  type: Function
2564
2584
  }
2565
2585
  };
2586
+ function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
2587
+ try {
2588
+ var info = gen[key](arg);
2589
+ var value = info.value;
2590
+ } catch (error) {
2591
+ reject(error);
2592
+ return;
2593
+ }
2594
+ if (info.done) {
2595
+ resolve(value);
2596
+ } else {
2597
+ Promise.resolve(value).then(_next, _throw);
2598
+ }
2599
+ }
2600
+ function _asyncToGenerator$a(fn) {
2601
+ return function() {
2602
+ var self = this, args = arguments;
2603
+ return new Promise(function(resolve, reject) {
2604
+ var gen = fn.apply(self, args);
2605
+ function _next(value) {
2606
+ asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "next", value);
2607
+ }
2608
+ function _throw(err) {
2609
+ asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, "throw", err);
2610
+ }
2611
+ _next(void 0);
2612
+ });
2613
+ };
2614
+ }
2566
2615
  var {
2567
2616
  n: n$T,
2568
2617
  classes: classes$I
2569
2618
  } = createNamespace("card");
2619
+ var RIPPLE_DELAY = 500;
2570
2620
  var _hoisted_1$g = ["src", "alt"];
2571
2621
  function render$Q(_ctx, _cache) {
2622
+ var _component_var_icon = resolveComponent("var-icon");
2623
+ var _component_var_button = resolveComponent("var-button");
2572
2624
  var _directive_ripple = resolveDirective("ripple");
2573
- return withDirectives((openBlock(), createElementBlock("div", {
2574
- class: normalizeClass(_ctx.classes(_ctx.n(), [_ctx.elevation, "var-elevation--" + _ctx.elevation, "var-elevation--2"])),
2625
+ return openBlock(), createElementBlock("div", {
2626
+ ref: "card",
2627
+ class: normalizeClass(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n("--layout-row")])),
2575
2628
  onClick: _cache[0] || (_cache[0] = function() {
2576
2629
  return _ctx.onClick && _ctx.onClick(...arguments);
2577
2630
  })
2631
+ }, [withDirectives((openBlock(), createElementBlock("div", {
2632
+ ref: "cardFloater",
2633
+ class: normalizeClass(_ctx.classes(_ctx.n("floater"), [_ctx.elevation, "var-elevation--" + _ctx.elevation, "var-elevation--1"])),
2634
+ style: normalizeStyle({
2635
+ width: _ctx.floaterWidth,
2636
+ height: _ctx.floaterHeight,
2637
+ top: _ctx.floaterTop,
2638
+ left: _ctx.floaterLeft,
2639
+ overflow: _ctx.floaterOverflow,
2640
+ position: _ctx.floaterPosition,
2641
+ borderRadius: _ctx.floating ? "0px" : void 0,
2642
+ zIndex: _ctx.floated ? _ctx.zIndex : void 0,
2643
+ transition: _ctx.floated ? "background-color " + _ctx.floatingDuration + "ms, border-radius " + _ctx.floatingDuration + "ms, width " + _ctx.floatingDuration + "ms, height " + _ctx.floatingDuration + "ms, top " + _ctx.floatingDuration + "ms, left " + _ctx.floatingDuration + "ms" : void 0
2644
+ })
2578
2645
  }, [renderSlot(_ctx.$slots, "image", {}, () => [_ctx.src ? (openBlock(), createElementBlock("img", {
2579
2646
  key: 0,
2580
2647
  class: normalizeClass(_ctx.n("image")),
2581
2648
  style: normalizeStyle({
2582
2649
  objectFit: _ctx.fit,
2583
- height: _ctx.toSizeUnit(_ctx.height)
2650
+ height: _ctx.toSizeUnit(_ctx.height),
2651
+ width: _ctx.toSizeUnit(_ctx.width)
2584
2652
  }),
2585
2653
  src: _ctx.src,
2586
2654
  alt: _ctx.alt
2587
- }, null, 14, _hoisted_1$g)) : createCommentVNode("v-if", true)]), renderSlot(_ctx.$slots, "title", {}, () => [_ctx.title ? (openBlock(), createElementBlock("div", {
2655
+ }, null, 14, _hoisted_1$g)) : createCommentVNode("v-if", true)]), createElementVNode("div", {
2656
+ class: normalizeClass(_ctx.n("container"))
2657
+ }, [renderSlot(_ctx.$slots, "title", {}, () => [_ctx.title ? (openBlock(), createElementBlock("div", {
2588
2658
  key: 0,
2589
2659
  class: normalizeClass(_ctx.n("title"))
2590
2660
  }, toDisplayString(_ctx.title), 3)) : createCommentVNode("v-if", true)]), renderSlot(_ctx.$slots, "subtitle", {}, () => [_ctx.subtitle ? (openBlock(), createElementBlock("div", {
@@ -2596,9 +2666,42 @@ function render$Q(_ctx, _cache) {
2596
2666
  }, toDisplayString(_ctx.description), 3)) : createCommentVNode("v-if", true)]), _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
2597
2667
  key: 0,
2598
2668
  class: normalizeClass(_ctx.n("footer"))
2599
- }, [renderSlot(_ctx.$slots, "extra")], 2)) : createCommentVNode("v-if", true)], 2)), [[_directive_ripple, {
2600
- disabled: !_ctx.ripple
2601
- }]]);
2669
+ }, [renderSlot(_ctx.$slots, "extra")], 2)) : createCommentVNode("v-if", true), _ctx.$slots.content && !_ctx.isRow ? (openBlock(), createElementBlock("div", {
2670
+ key: 1,
2671
+ class: normalizeClass(_ctx.n("content")),
2672
+ style: normalizeStyle({
2673
+ height: _ctx.contentHeight,
2674
+ opacity: _ctx.opacity,
2675
+ transition: "opacity " + _ctx.floatingDuration * 2 + "ms"
2676
+ })
2677
+ }, [renderSlot(_ctx.$slots, "content")], 6)) : createCommentVNode("v-if", true)], 2), _ctx.showToolBar ? (openBlock(), createElementBlock("div", {
2678
+ key: 0,
2679
+ class: normalizeClass(_ctx.classes(_ctx.n("toolbar"), "var--box")),
2680
+ style: normalizeStyle({
2681
+ zIndex: _ctx.zIndex,
2682
+ opacity: _ctx.opacity,
2683
+ transition: "opacity " + _ctx.floatingDuration * 2 + "ms"
2684
+ })
2685
+ }, [renderSlot(_ctx.$slots, "toolbar-close", {}, () => [createVNode(_component_var_button, {
2686
+ size: "large",
2687
+ round: "",
2688
+ class: normalizeClass(_ctx.classes(_ctx.n("toolbar-close"), "var-elevation--6")),
2689
+ onClick: withModifiers(_ctx.close, ["stop"])
2690
+ }, {
2691
+ default: withCtx(() => [createVNode(_component_var_icon, {
2692
+ name: "window-close",
2693
+ size: "24px"
2694
+ })]),
2695
+ _: 1
2696
+ }, 8, ["class", "onClick"])]), renderSlot(_ctx.$slots, "toolbar-extra")], 6)) : createCommentVNode("v-if", true)], 6)), [[_directive_ripple, {
2697
+ disabled: !_ctx.ripple || _ctx.floater
2698
+ }]]), createElementVNode("div", {
2699
+ class: normalizeClass(_ctx.n("holder")),
2700
+ style: normalizeStyle({
2701
+ width: _ctx.holderWidth,
2702
+ height: _ctx.holderHeight
2703
+ })
2704
+ }, null, 6)], 2);
2602
2705
  }
2603
2706
  var Card = defineComponent({
2604
2707
  render: render$Q,
@@ -2606,12 +2709,131 @@ var Card = defineComponent({
2606
2709
  directives: {
2607
2710
  Ripple
2608
2711
  },
2712
+ components: {
2713
+ VarIcon: Icon,
2714
+ VarButton: Button
2715
+ },
2609
2716
  props: props$K,
2610
- setup() {
2717
+ setup(props2) {
2718
+ var card2 = ref(null);
2719
+ var cardFloater = ref(null);
2720
+ var holderWidth = ref("auto");
2721
+ var holderHeight = ref("auto");
2722
+ var floaterWidth = ref("100%");
2723
+ var floaterHeight = ref("100%");
2724
+ var floaterTop = ref("auto");
2725
+ var floaterLeft = ref("auto");
2726
+ var floaterPosition = ref("static");
2727
+ var floaterOverflow = ref("hidden");
2728
+ var contentHeight = ref("0px");
2729
+ var opacity = ref("0");
2730
+ var {
2731
+ zIndex
2732
+ } = useZIndex(() => props2.floating, 1);
2733
+ var isRow = computed(() => props2.layout === "row");
2734
+ var showToolBar = ref(false);
2735
+ var floated = ref(false);
2736
+ useLock(() => props2.floating, () => isRow);
2737
+ var dropdownFloaterTop = "auto";
2738
+ var dropdownFloaterLeft = "auto";
2739
+ var dropper = null;
2740
+ var floater = ref(null);
2741
+ var floating = /* @__PURE__ */ function() {
2742
+ var _ref = _asyncToGenerator$a(function* () {
2743
+ clearTimeout(floater.value);
2744
+ clearTimeout(dropper);
2745
+ floater.value = null;
2746
+ floater.value = setTimeout(/* @__PURE__ */ _asyncToGenerator$a(function* () {
2747
+ var {
2748
+ width,
2749
+ height,
2750
+ left,
2751
+ top
2752
+ } = card2.value.getBoundingClientRect();
2753
+ holderWidth.value = toSizeUnit(width);
2754
+ holderHeight.value = toSizeUnit(height);
2755
+ floaterWidth.value = holderWidth.value;
2756
+ floaterHeight.value = holderHeight.value;
2757
+ floaterTop.value = toSizeUnit(top);
2758
+ floaterLeft.value = toSizeUnit(left);
2759
+ floaterPosition.value = "fixed";
2760
+ dropdownFloaterTop = floaterTop.value;
2761
+ dropdownFloaterLeft = floaterLeft.value;
2762
+ showToolBar.value = true;
2763
+ yield doubleRaf();
2764
+ floaterTop.value = "0";
2765
+ floaterLeft.value = "0";
2766
+ floaterWidth.value = "100vw";
2767
+ floaterHeight.value = "100vh";
2768
+ contentHeight.value = "auto";
2769
+ opacity.value = "1";
2770
+ floaterOverflow.value = "auto";
2771
+ floated.value = true;
2772
+ }), props2.ripple ? RIPPLE_DELAY : 0);
2773
+ });
2774
+ return function floating2() {
2775
+ return _ref.apply(this, arguments);
2776
+ };
2777
+ }();
2778
+ var dropdown = () => {
2779
+ clearTimeout(dropper);
2780
+ clearTimeout(floater.value);
2781
+ floater.value = null;
2782
+ floaterWidth.value = holderWidth.value;
2783
+ floaterHeight.value = holderHeight.value;
2784
+ floaterTop.value = dropdownFloaterTop;
2785
+ floaterLeft.value = dropdownFloaterLeft;
2786
+ contentHeight.value = "0px";
2787
+ opacity.value = "0";
2788
+ showToolBar.value = false;
2789
+ dropper = setTimeout(() => {
2790
+ holderWidth.value = "auto";
2791
+ holderHeight.value = "auto";
2792
+ floaterWidth.value = "100%";
2793
+ floaterHeight.value = "100%";
2794
+ floaterTop.value = "auto";
2795
+ floaterLeft.value = "auto";
2796
+ dropdownFloaterTop = "auto";
2797
+ dropdownFloaterLeft = "auto";
2798
+ floaterOverflow.value = "hidden";
2799
+ floaterPosition.value = "static";
2800
+ floated.value = false;
2801
+ }, props2.floatingDuration);
2802
+ };
2803
+ var close = () => {
2804
+ call(props2["onUpdate:floating"], false);
2805
+ };
2806
+ watch(() => props2.floating, (value) => {
2807
+ if (isRow.value)
2808
+ return;
2809
+ nextTick(() => {
2810
+ value ? floating() : dropdown();
2811
+ });
2812
+ }, {
2813
+ immediate: true
2814
+ });
2611
2815
  return {
2612
2816
  n: n$T,
2613
2817
  classes: classes$I,
2614
- toSizeUnit
2818
+ toSizeUnit,
2819
+ card: card2,
2820
+ cardFloater,
2821
+ holderWidth,
2822
+ holderHeight,
2823
+ floater,
2824
+ floaterWidth,
2825
+ floaterHeight,
2826
+ floaterTop,
2827
+ floaterLeft,
2828
+ floaterPosition,
2829
+ floaterOverflow,
2830
+ contentHeight,
2831
+ opacity,
2832
+ zIndex,
2833
+ isRow,
2834
+ close,
2835
+ showToolBar,
2836
+ floated
2615
2837
  };
2616
2838
  }
2617
2839
  });
@@ -10325,7 +10547,7 @@ var props$q = {
10325
10547
  default: true
10326
10548
  },
10327
10549
  stickyOffsetTop: {
10328
- type: Number,
10550
+ type: [String, Number],
10329
10551
  default: 0
10330
10552
  },
10331
10553
  cssMode: {
@@ -10405,7 +10627,7 @@ function render$r(_ctx, _cache) {
10405
10627
  style: normalizeStyle({
10406
10628
  color: _ctx.active === anchorName && _ctx.highlightColor ? _ctx.highlightColor : ""
10407
10629
  }),
10408
- onClick: ($event) => _ctx.anchorClick(anchorName)
10630
+ onClick: ($event) => _ctx.anchorClick(anchorName, true)
10409
10631
  }, toDisplayString(anchorName), 15, _hoisted_1$a);
10410
10632
  }), 128))], 6)], 2);
10411
10633
  }
@@ -10426,7 +10648,7 @@ var IndexBar = defineComponent({
10426
10648
  var active = ref();
10427
10649
  var sticky2 = computed(() => props2.sticky);
10428
10650
  var cssMode = computed(() => props2.cssMode);
10429
- var stickyOffsetTop = computed(() => props2.stickyOffsetTop);
10651
+ var stickyOffsetTop = computed(() => toPxNum(props2.stickyOffsetTop));
10430
10652
  var zIndex = computed(() => props2.zIndex);
10431
10653
  var indexBarProvider = {
10432
10654
  active,
@@ -10498,7 +10720,7 @@ var IndexBar = defineComponent({
10498
10720
  };
10499
10721
  }();
10500
10722
  var scrollTo$1 = (index) => {
10501
- requestAnimationFrame(() => anchorClick(index, true));
10723
+ requestAnimationFrame(() => anchorClick(index));
10502
10724
  };
10503
10725
  watch(() => length.value, /* @__PURE__ */ _asyncToGenerator$5(function* () {
10504
10726
  yield doubleRaf();
@@ -12114,7 +12336,8 @@ var VarPicker = defineComponent({
12114
12336
  } = getPicked();
12115
12337
  prevIndexes = [...indexes];
12116
12338
  }, {
12117
- immediate: true
12339
+ immediate: true,
12340
+ deep: true
12118
12341
  });
12119
12342
  return {
12120
12343
  n: n$o,
@@ -12243,7 +12466,7 @@ var props$j = {
12243
12466
  default: false
12244
12467
  },
12245
12468
  size: {
12246
- type: Number,
12469
+ type: [Number, String],
12247
12470
  default: 40
12248
12471
  },
12249
12472
  rotate: {
@@ -12271,7 +12494,7 @@ function render$l(_ctx, _cache) {
12271
12494
  }, [createElementVNode("div", mergeProps({
12272
12495
  class: _ctx.n("linear-block"),
12273
12496
  style: {
12274
- height: _ctx.lineWidth + "px"
12497
+ height: _ctx.toSizeUnit(_ctx.lineWidth)
12275
12498
  }
12276
12499
  }, _ctx.$attrs), [_ctx.track ? (openBlock(), createElementBlock("div", {
12277
12500
  key: 0,
@@ -12292,8 +12515,8 @@ function render$l(_ctx, _cache) {
12292
12515
  key: 1,
12293
12516
  class: normalizeClass(_ctx.n("circle")),
12294
12517
  style: normalizeStyle({
12295
- width: _ctx.size + "px",
12296
- height: _ctx.size + "px"
12518
+ width: _ctx.toSizeUnit(_ctx.size),
12519
+ height: _ctx.toSizeUnit(_ctx.size)
12297
12520
  })
12298
12521
  }, [(openBlock(), createElementBlock("svg", {
12299
12522
  class: normalizeClass(_ctx.n("circle-svg")),
@@ -12304,22 +12527,22 @@ function render$l(_ctx, _cache) {
12304
12527
  }, [_ctx.track ? (openBlock(), createElementBlock("circle", {
12305
12528
  key: 0,
12306
12529
  class: normalizeClass(_ctx.n("circle-background")),
12307
- cx: _ctx.size / 2,
12308
- cy: _ctx.size / 2,
12530
+ cx: _ctx.multiplySizeUnit(_ctx.size, 0.5),
12531
+ cy: _ctx.multiplySizeUnit(_ctx.size, 0.5),
12309
12532
  r: _ctx.circleProps.radius,
12310
12533
  fill: "transparent",
12311
- "stroke-width": _ctx.lineWidth,
12534
+ "stroke-width": _ctx.toSizeUnit(_ctx.lineWidth),
12312
12535
  style: normalizeStyle({
12313
12536
  strokeDasharray: _ctx.circleProps.perimeter,
12314
12537
  stroke: _ctx.trackColor
12315
12538
  })
12316
12539
  }, null, 14, _hoisted_2$3)) : createCommentVNode("v-if", true), createElementVNode("circle", {
12317
12540
  class: normalizeClass(_ctx.n("circle-certain")),
12318
- cx: _ctx.size / 2,
12319
- cy: _ctx.size / 2,
12541
+ cx: _ctx.multiplySizeUnit(_ctx.size, 0.5),
12542
+ cy: _ctx.multiplySizeUnit(_ctx.size, 0.5),
12320
12543
  r: _ctx.circleProps.radius,
12321
12544
  fill: "transparent",
12322
- "stroke-width": _ctx.lineWidth,
12545
+ "stroke-width": _ctx.toSizeUnit(_ctx.lineWidth),
12323
12546
  style: normalizeStyle({
12324
12547
  strokeDasharray: _ctx.circleProps.strokeDasharray,
12325
12548
  stroke: _ctx.color
@@ -12350,9 +12573,9 @@ var Progress = defineComponent({
12350
12573
  lineWidth,
12351
12574
  value
12352
12575
  } = props2;
12353
- var viewBox = "0 0 " + size + " " + size;
12576
+ var viewBox = "0 0 " + toPxNum(size) + " " + toPxNum(size);
12354
12577
  var roundValue = toNumber(value) > 100 ? 100 : Math.round(toNumber(value));
12355
- var radius = (size - toNumber(lineWidth)) / 2;
12578
+ var radius = (toPxNum(size) - toPxNum(lineWidth)) / 2;
12356
12579
  var perimeter = 2 * Math.PI * radius;
12357
12580
  var strokeDasharray = roundValue / 100 * perimeter + ", " + perimeter;
12358
12581
  return {
@@ -12366,6 +12589,8 @@ var Progress = defineComponent({
12366
12589
  return {
12367
12590
  n: n$n,
12368
12591
  classes: classes$i,
12592
+ toSizeUnit,
12593
+ multiplySizeUnit,
12369
12594
  linearProps,
12370
12595
  circleProps
12371
12596
  };
@@ -12981,12 +13206,10 @@ var props$f = {
12981
13206
  default: "star-outline"
12982
13207
  },
12983
13208
  size: {
12984
- type: [String, Number],
12985
- default: "24"
13209
+ type: [String, Number]
12986
13210
  },
12987
13211
  gap: {
12988
- type: [String, Number],
12989
- default: "2"
13212
+ type: [String, Number]
12990
13213
  },
12991
13214
  namespace: {
12992
13215
  type: String
@@ -13043,13 +13266,15 @@ function render$h(_ctx, _cache) {
13043
13266
  class: normalizeClass(_ctx.getClass(val)),
13044
13267
  onClick: ($event) => _ctx.handleClick(val, $event)
13045
13268
  }, [createVNode(_component_var_icon, {
13269
+ class: normalizeClass(_ctx.n("content-icon")),
13270
+ "var-rate-cover": "",
13046
13271
  transition: 0,
13047
13272
  namespace: _ctx.namespace,
13048
13273
  name: _ctx.getIconName(val),
13049
13274
  style: normalizeStyle({
13050
13275
  fontSize: _ctx.toSizeUnit(_ctx.size)
13051
13276
  })
13052
- }, null, 8, ["namespace", "name", "style"])], 14, _hoisted_1$5)), [[_directive_ripple, {
13277
+ }, null, 8, ["class", "namespace", "name", "style"])], 14, _hoisted_1$5)), [[_directive_ripple, {
13053
13278
  disabled: _ctx.formReadonly || _ctx.readonly || _ctx.formDisabled || _ctx.disabled || !_ctx.ripple
13054
13279
  }]]);
13055
13280
  }), 128))], 2), createVNode(_component_var_form_details, {
@@ -13550,6 +13775,7 @@ var Select = defineComponent({
13550
13775
  return label2.value;
13551
13776
  };
13552
13777
  var findLabel = (modelValue) => {
13778
+ var _option$label$value, _option;
13553
13779
  var option2 = options.find((_ref2) => {
13554
13780
  var {
13555
13781
  value
@@ -13564,7 +13790,7 @@ var Select = defineComponent({
13564
13790
  return label2.value === modelValue;
13565
13791
  });
13566
13792
  }
13567
- return option2.label.value;
13793
+ return (_option$label$value = (_option = option2) == null ? void 0 : _option.label.value) != null ? _option$label$value : "";
13568
13794
  };
13569
13795
  var computePlaceholderState = () => {
13570
13796
  var {
@@ -13980,8 +14206,8 @@ function render$d(_ctx, _cache) {
13980
14206
  }, [createElementVNode("div", {
13981
14207
  class: normalizeClass(_ctx.classes(_ctx.n("block"), [_ctx.isDisabled, _ctx.n("--disabled")], [_ctx.errorMessage, _ctx.n("--error")])),
13982
14208
  style: normalizeStyle({
13983
- height: _ctx.thumbSize === void 0 ? _ctx.thumbSize : 3 * _ctx.toNumber(_ctx.thumbSize) + "px",
13984
- margin: _ctx.thumbSize === void 0 ? _ctx.thumbSize : "0 " + _ctx.toNumber(_ctx.thumbSize) / 2 + "px"
14209
+ height: _ctx.thumbSize === void 0 ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 3),
14210
+ margin: _ctx.thumbSize === void 0 ? _ctx.thumbSize : "0 " + _ctx.multiplySizeUnit(_ctx.thumbSize, 0.5)
13985
14211
  }),
13986
14212
  ref: "sliderEl",
13987
14213
  onClick: _cache[0] || (_cache[0] = function() {
@@ -13993,7 +14219,7 @@ function render$d(_ctx, _cache) {
13993
14219
  class: normalizeClass(_ctx.n("track-background")),
13994
14220
  style: normalizeStyle({
13995
14221
  background: _ctx.trackColor,
13996
- height: _ctx.trackHeight + "px"
14222
+ height: _ctx.multiplySizeUnit(_ctx.trackHeight)
13997
14223
  })
13998
14224
  }, null, 6), createElementVNode("div", {
13999
14225
  class: normalizeClass(_ctx.n("track-fill")),
@@ -14016,8 +14242,8 @@ function render$d(_ctx, _cache) {
14016
14242
  class: normalizeClass(_ctx.n("thumb-block")),
14017
14243
  style: normalizeStyle({
14018
14244
  background: _ctx.thumbColor,
14019
- height: _ctx.thumbSize + "px",
14020
- width: _ctx.thumbSize + "px"
14245
+ height: _ctx.multiplySizeUnit(_ctx.thumbSize),
14246
+ width: _ctx.multiplySizeUnit(_ctx.thumbSize)
14021
14247
  })
14022
14248
  }, null, 6), createElementVNode("div", {
14023
14249
  class: normalizeClass(_ctx.classes(_ctx.n("thumb-ripple"), [_ctx.thumbsProps[item.enumValue].active, _ctx.n("thumb-ripple--active")])),
@@ -14029,8 +14255,8 @@ function render$d(_ctx, _cache) {
14029
14255
  style: normalizeStyle({
14030
14256
  background: _ctx.labelColor,
14031
14257
  color: _ctx.labelTextColor,
14032
- height: _ctx.thumbSize === void 0 ? _ctx.thumbSize : 2 * _ctx.toNumber(_ctx.thumbSize) + "px",
14033
- width: _ctx.thumbSize === void 0 ? _ctx.thumbSize : 2 * _ctx.toNumber(_ctx.thumbSize) + "px"
14258
+ height: _ctx.thumbSize === void 0 ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 2),
14259
+ width: _ctx.thumbSize === void 0 ? _ctx.thumbSize : _ctx.multiplySizeUnit(_ctx.thumbSize, 2)
14034
14260
  })
14035
14261
  }, [createElementVNode("span", null, toDisplayString(item.value), 1)], 6)])], 46, _hoisted_1$3);
14036
14262
  }), 128))], 6), createVNode(_component_var_form_details, {
@@ -14092,7 +14318,7 @@ var Slider = defineComponent({
14092
14318
  var getRippleSize = (item) => {
14093
14319
  var size;
14094
14320
  if (props2.thumbSize !== void 0) {
14095
- size = thumbsProps[item.enumValue].active ? 3 * toNumber(props2.thumbSize) + "px" : "0px";
14321
+ size = thumbsProps[item.enumValue].active ? multiplySizeUnit(props2.thumbSize, 3) : "0px";
14096
14322
  }
14097
14323
  return {
14098
14324
  height: size,
@@ -14286,6 +14512,7 @@ var Slider = defineComponent({
14286
14512
  errorMessage,
14287
14513
  thumbsProps,
14288
14514
  thumbList,
14515
+ multiplySizeUnit,
14289
14516
  toNumber,
14290
14517
  getRippleSize,
14291
14518
  showLabel,
@@ -15141,8 +15368,7 @@ var props$6 = {
15141
15368
  type: String
15142
15369
  },
15143
15370
  size: {
15144
- type: [String, Number],
15145
- default: 20
15371
+ type: [String, Number]
15146
15372
  },
15147
15373
  rules: {
15148
15374
  type: Array
@@ -15179,16 +15405,16 @@ function render$8(_ctx, _cache) {
15179
15405
  style: normalizeStyle(_ctx.styleComputed.switch)
15180
15406
  }, [createElementVNode("div", {
15181
15407
  style: normalizeStyle(_ctx.styleComputed.track),
15182
- class: normalizeClass(_ctx.classes(_ctx.n("track"), [_ctx.modelValue === _ctx.activeValue, _ctx.n("track-active")], [_ctx.errorMessage, _ctx.n("track-error")]))
15408
+ class: normalizeClass(_ctx.classes(_ctx.n("track"), [_ctx.modelValue === _ctx.activeValue, _ctx.n("track--active")], [_ctx.errorMessage, _ctx.n("track--error")]))
15183
15409
  }, null, 6), withDirectives((openBlock(), createElementBlock("div", {
15184
- class: normalizeClass(_ctx.n("ripple")),
15410
+ class: normalizeClass(_ctx.classes(_ctx.n("ripple"), [_ctx.modelValue === _ctx.activeValue, _ctx.n("ripple--active")])),
15185
15411
  style: normalizeStyle(_ctx.styleComputed.ripple)
15186
15412
  }, [createElementVNode("div", {
15187
15413
  style: normalizeStyle(_ctx.styleComputed.handle),
15188
- class: normalizeClass(_ctx.classes(_ctx.n("handle"), "var-elevation--2", [_ctx.modelValue === _ctx.activeValue, _ctx.n("handle-active")], [_ctx.errorMessage, _ctx.n("handle-error")]))
15414
+ class: normalizeClass(_ctx.classes(_ctx.n("handle"), "var-elevation--2", [_ctx.modelValue === _ctx.activeValue, _ctx.n("handle--active")], [_ctx.errorMessage, _ctx.n("handle--error")]))
15189
15415
  }, [_ctx.loading ? (openBlock(), createBlock(_component_var_loading, {
15190
15416
  key: 0,
15191
- radius: _ctx.toNumber(_ctx.size) / 2 - 2
15417
+ radius: _ctx.radius
15192
15418
  }, null, 8, ["radius"])) : createCommentVNode("v-if", true)], 6)], 6)), [[_directive_ripple, {
15193
15419
  disabled: !_ctx.ripple || _ctx.disabled || _ctx.loading || _ctx.formDisabled
15194
15420
  }]])], 6), createVNode(_component_var_form_details, {
@@ -15228,35 +15454,38 @@ var Switch = defineComponent({
15228
15454
  loadingColor,
15229
15455
  activeValue
15230
15456
  } = props2;
15231
- var sizeNum = toNumber(size);
15232
- var switchWidth = sizeNum * 2;
15233
- var switchHeight = sizeNum * 1.2;
15234
15457
  return {
15235
15458
  handle: {
15236
- width: size + "px",
15237
- height: size + "px",
15459
+ width: multiplySizeUnit(size),
15460
+ height: multiplySizeUnit(size),
15238
15461
  backgroundColor: modelValue === activeValue ? color || "" : closeColor || "",
15239
15462
  color: loadingColor && loadingColor
15240
15463
  },
15241
15464
  ripple: {
15242
- left: modelValue === activeValue ? sizeNum / 2 + "px" : "-" + sizeNum / 2 + "px",
15465
+ left: modelValue === activeValue ? multiplySizeUnit(size, 0.5) : "-" + multiplySizeUnit(size, 0.5),
15243
15466
  color: modelValue === activeValue ? color || "" : closeColor || "#999",
15244
- width: sizeNum * 2 + "px",
15245
- height: sizeNum * 2 + "px"
15467
+ width: multiplySizeUnit(size, 2),
15468
+ height: multiplySizeUnit(size, 2)
15246
15469
  },
15247
15470
  track: {
15248
- height: switchHeight * 0.6 + "px",
15249
- width: switchWidth - 2 + "px",
15250
- borderRadius: switchWidth / 3 + "px",
15471
+ height: multiplySizeUnit(size, 0.72),
15472
+ width: multiplySizeUnit(size, 1.9),
15473
+ borderRadius: multiplySizeUnit(size, 2 / 3),
15251
15474
  filter: modelValue === activeValue || errorMessage != null && errorMessage.value ? "opacity(.6)" : "brightness(.6)",
15252
15475
  backgroundColor: modelValue === activeValue ? color || "" : closeColor || ""
15253
15476
  },
15254
15477
  switch: {
15255
- height: switchHeight + "px",
15256
- width: switchWidth + "px"
15478
+ height: multiplySizeUnit(size, 1.2),
15479
+ width: multiplySizeUnit(size, 2)
15257
15480
  }
15258
15481
  };
15259
15482
  });
15483
+ var radius = computed(() => {
15484
+ var {
15485
+ size = "5.333vw"
15486
+ } = props2;
15487
+ return multiplySizeUnit(size, 0.4);
15488
+ });
15260
15489
  var switchActive = (event) => {
15261
15490
  var {
15262
15491
  onClick,
@@ -15291,7 +15520,7 @@ var Switch = defineComponent({
15291
15520
  n: n$8,
15292
15521
  classes: classes$7,
15293
15522
  switchActive,
15294
- toNumber,
15523
+ radius,
15295
15524
  styleComputed,
15296
15525
  errorMessage,
15297
15526
  formDisabled: form == null ? void 0 : form.disabled,