@varlet/ui 3.7.1 → 3.7.2-alpha.1733247317826

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
@@ -4133,7 +4133,7 @@ const props$1c = {
4133
4133
  type: String,
4134
4134
  default: "click"
4135
4135
  },
4136
- reference: String,
4136
+ reference: [String, Object],
4137
4137
  placement: {
4138
4138
  type: String,
4139
4139
  default: "cover-top-start"
@@ -5483,7 +5483,7 @@ var __async$h = (__this, __arguments, generator) => {
5483
5483
  function usePopover(options) {
5484
5484
  const host = vue.ref(null);
5485
5485
  const popover = vue.ref(null);
5486
- const hostSize = vue.ref({ width: 0, height: 0 });
5486
+ const referenceSize = vue.ref({ width: 0, height: 0 });
5487
5487
  const show = useVModel(options, "show", {
5488
5488
  passive: true,
5489
5489
  defaultValue: false,
@@ -5498,11 +5498,10 @@ function usePopover(options) {
5498
5498
  const { zIndex } = useZIndex(() => show.value, 1);
5499
5499
  useStack(() => show.value, zIndex);
5500
5500
  let popoverInstance = null;
5501
+ let reference2;
5501
5502
  let enterPopover = false;
5502
- let enterHost = false;
5503
+ let enterReference = false;
5503
5504
  useEventListener(() => window, "keydown", handleKeydown);
5504
- useClickOutside(getReference, "click", handleClickOutside);
5505
- onWindowResize(resize);
5506
5505
  vue.watch(() => [options.offsetX, options.offsetY, options.placement, options.strategy], resize);
5507
5506
  vue.watch(() => options.disabled, close);
5508
5507
  vue.watch(
@@ -5513,19 +5512,34 @@ function usePopover(options) {
5513
5512
  }
5514
5513
  }
5515
5514
  );
5516
- vue.onMounted(() => {
5517
- var _a;
5518
- popoverInstance = createPopper((_a = getReference()) != null ? _a : host.value, popover.value, getPopperOptions());
5519
- });
5520
- vue.onUnmounted(() => {
5515
+ onWindowResize(resize);
5516
+ vue.onMounted(createPopperInstance);
5517
+ vue.onUnmounted(destroyPopperInstance);
5518
+ function createPopperInstance() {
5519
+ const reference22 = getReference();
5520
+ popoverInstance = createPopper(reference22, popover.value, getPopperOptions());
5521
+ reference22.addEventListener("mouseenter", handleReferenceMouseenter);
5522
+ reference22.addEventListener("mouseleave", handleReferenceMouseleave);
5523
+ reference22.addEventListener("click", handleReferenceClick);
5524
+ document.addEventListener("click", handleClickOutside);
5525
+ }
5526
+ function destroyPopperInstance() {
5527
+ const reference22 = getReference();
5528
+ if (reference22) {
5529
+ reference22.removeEventListener("mouseenter", handleReferenceMouseenter);
5530
+ reference22.removeEventListener("mouseleave", handleReferenceMouseleave);
5531
+ reference22.removeEventListener("click", handleReferenceClick);
5532
+ }
5521
5533
  popoverInstance.destroy();
5522
- });
5523
- function computeHostSize() {
5524
- if (!host.value) {
5534
+ document.removeEventListener("click", handleClickOutside);
5535
+ }
5536
+ function computeReferenceSize() {
5537
+ const reference22 = getReference();
5538
+ if (!reference22) {
5525
5539
  return;
5526
5540
  }
5527
- const { width, height } = getStyle$1(host.value);
5528
- hostSize.value = {
5541
+ const { width, height } = getStyle$1(reference22);
5542
+ referenceSize.value = {
5529
5543
  width: toPxNum(width),
5530
5544
  height: toPxNum(height)
5531
5545
  };
@@ -5562,19 +5576,19 @@ function usePopover(options) {
5562
5576
  return "left";
5563
5577
  }
5564
5578
  }
5565
- function handleHostMouseenter() {
5579
+ function handleReferenceMouseenter() {
5566
5580
  if (options.trigger !== "hover") {
5567
5581
  return;
5568
5582
  }
5569
- enterHost = true;
5583
+ enterReference = true;
5570
5584
  open();
5571
5585
  }
5572
- function handleHostMouseleave() {
5586
+ function handleReferenceMouseleave() {
5573
5587
  return __async$h(this, null, function* () {
5574
5588
  if (options.trigger !== "hover") {
5575
5589
  return;
5576
5590
  }
5577
- enterHost = false;
5591
+ enterReference = false;
5578
5592
  yield doubleRaf();
5579
5593
  if (enterPopover) {
5580
5594
  return;
@@ -5595,13 +5609,13 @@ function usePopover(options) {
5595
5609
  }
5596
5610
  enterPopover = false;
5597
5611
  yield doubleRaf();
5598
- if (enterHost) {
5612
+ if (enterReference) {
5599
5613
  return;
5600
5614
  }
5601
5615
  close();
5602
5616
  });
5603
5617
  }
5604
- function handleHostClick() {
5618
+ function handleReferenceClick() {
5605
5619
  if (options.trigger !== "click") {
5606
5620
  return;
5607
5621
  }
@@ -5611,15 +5625,18 @@ function usePopover(options) {
5611
5625
  }
5612
5626
  open();
5613
5627
  }
5614
- function handlePopoverClose() {
5615
- close();
5616
- }
5617
5628
  function handleClickOutside(e) {
5618
- if (options.trigger !== "click") {
5619
- return;
5629
+ const reference22 = getReference();
5630
+ if (reference22 && !reference22.contains(e.target)) {
5631
+ if (options.trigger !== "click") {
5632
+ return;
5633
+ }
5634
+ handlePopoverClose();
5635
+ call(options.onClickOutside, e);
5620
5636
  }
5621
- handlePopoverClose();
5622
- call(options.onClickOutside, e);
5637
+ }
5638
+ function handlePopoverClose() {
5639
+ close();
5623
5640
  }
5624
5641
  function handleClosed() {
5625
5642
  resize();
@@ -5627,7 +5644,7 @@ function usePopover(options) {
5627
5644
  }
5628
5645
  function getPosition() {
5629
5646
  const { offsetX, offsetY, placement } = options;
5630
- computeHostSize();
5647
+ computeReferenceSize();
5631
5648
  const offset2 = {
5632
5649
  x: toPxNum(offsetX),
5633
5650
  y: toPxNum(offsetY)
@@ -5637,49 +5654,49 @@ function usePopover(options) {
5637
5654
  return {
5638
5655
  placement: "bottom",
5639
5656
  skidding: offset2.x,
5640
- distance: offset2.y - hostSize.value.height
5657
+ distance: offset2.y - referenceSize.value.height
5641
5658
  };
5642
5659
  case "cover-top-start":
5643
5660
  return {
5644
5661
  placement: "bottom-start",
5645
5662
  skidding: offset2.x,
5646
- distance: offset2.y - hostSize.value.height
5663
+ distance: offset2.y - referenceSize.value.height
5647
5664
  };
5648
5665
  case "cover-top-end":
5649
5666
  return {
5650
5667
  placement: "bottom-end",
5651
5668
  skidding: offset2.x,
5652
- distance: offset2.y - hostSize.value.height
5669
+ distance: offset2.y - referenceSize.value.height
5653
5670
  };
5654
5671
  case "cover-bottom":
5655
5672
  return {
5656
5673
  placement: "top",
5657
5674
  skidding: offset2.x,
5658
- distance: -offset2.y - hostSize.value.height
5675
+ distance: -offset2.y - referenceSize.value.height
5659
5676
  };
5660
5677
  case "cover-bottom-start":
5661
5678
  return {
5662
5679
  placement: "top-start",
5663
5680
  skidding: offset2.x,
5664
- distance: -offset2.y - hostSize.value.height
5681
+ distance: -offset2.y - referenceSize.value.height
5665
5682
  };
5666
5683
  case "cover-bottom-end":
5667
5684
  return {
5668
5685
  placement: "top-end",
5669
5686
  skidding: offset2.x,
5670
- distance: -offset2.y - hostSize.value.height
5687
+ distance: -offset2.y - referenceSize.value.height
5671
5688
  };
5672
5689
  case "cover-left":
5673
5690
  return {
5674
5691
  placement: "right",
5675
5692
  skidding: offset2.y,
5676
- distance: offset2.x - hostSize.value.width
5693
+ distance: offset2.x - referenceSize.value.width
5677
5694
  };
5678
5695
  case "cover-right":
5679
5696
  return {
5680
5697
  placement: "left",
5681
5698
  skidding: offset2.y,
5682
- distance: -offset2.x - hostSize.value.width
5699
+ distance: -offset2.x - referenceSize.value.width
5683
5700
  };
5684
5701
  case "left":
5685
5702
  case "left-start":
@@ -5749,7 +5766,17 @@ function usePopover(options) {
5749
5766
  };
5750
5767
  }
5751
5768
  function getReference() {
5752
- return options.reference ? host.value.querySelector(options.reference) : host.value;
5769
+ var _a, _b;
5770
+ const targetReference = (_a = reference2 != null ? reference2 : options.reference) != null ? _a : host.value;
5771
+ if (isString(targetReference)) {
5772
+ return (_b = host.value) == null ? void 0 : _b.querySelector(targetReference);
5773
+ }
5774
+ return targetReference;
5775
+ }
5776
+ function setReference(newReference) {
5777
+ destroyPopperInstance();
5778
+ reference2 = newReference;
5779
+ createPopperInstance();
5753
5780
  }
5754
5781
  function handleKeydown(event) {
5755
5782
  const { closeOnKeyEscape = false } = options;
@@ -5777,14 +5804,12 @@ function usePopover(options) {
5777
5804
  popover,
5778
5805
  zIndex,
5779
5806
  host,
5780
- hostSize,
5781
- handleHostClick,
5782
- handleHostMouseenter,
5783
- handleHostMouseleave,
5807
+ referenceSize,
5784
5808
  handlePopoverClose,
5785
5809
  handlePopoverMouseenter,
5786
5810
  handlePopoverMouseleave,
5787
5811
  handleClosed,
5812
+ setReference,
5788
5813
  resize,
5789
5814
  open,
5790
5815
  close
@@ -5796,10 +5821,7 @@ function __render__$1i(_ctx, _cache) {
5796
5821
  "div",
5797
5822
  {
5798
5823
  ref: "host",
5799
- class: vue.normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box"))),
5800
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleHostClick && _ctx.handleHostClick(...args)),
5801
- onMouseenter: _cache[4] || (_cache[4] = (...args) => _ctx.handleHostMouseenter && _ctx.handleHostMouseenter(...args)),
5802
- onMouseleave: _cache[5] || (_cache[5] = (...args) => _ctx.handleHostMouseleave && _ctx.handleHostMouseleave(...args))
5824
+ class: vue.normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box")))
5803
5825
  },
5804
5826
  [
5805
5827
  vue.renderSlot(_ctx.$slots, "default"),
@@ -5820,7 +5842,7 @@ function __render__$1i(_ctx, _cache) {
5820
5842
  ref: "popover",
5821
5843
  style: vue.normalizeStyle({
5822
5844
  zIndex: _ctx.zIndex,
5823
- width: _ctx.sameWidth ? _ctx.toSizeUnit(Math.ceil(_ctx.hostSize.width)) : void 0
5845
+ width: _ctx.sameWidth ? _ctx.toSizeUnit(Math.ceil(_ctx.referenceSize.width)) : void 0
5824
5846
  }),
5825
5847
  class: vue.normalizeClass(
5826
5848
  _ctx.classes(
@@ -5850,8 +5872,8 @@ function __render__$1i(_ctx, _cache) {
5850
5872
  }, 8, ["name", "onAfterEnter", "onAfterLeave"])
5851
5873
  ], 8, ["to", "disabled"]))
5852
5874
  ],
5853
- 34
5854
- /* CLASS, NEED_HYDRATION */
5875
+ 2
5876
+ /* CLASS */
5855
5877
  );
5856
5878
  }
5857
5879
  const __sfc__$1l = vue.defineComponent({
@@ -5862,12 +5884,9 @@ const __sfc__$1l = vue.defineComponent({
5862
5884
  const {
5863
5885
  popover,
5864
5886
  host,
5865
- hostSize,
5887
+ referenceSize,
5866
5888
  show,
5867
5889
  zIndex,
5868
- handleHostClick,
5869
- handleHostMouseenter,
5870
- handleHostMouseleave,
5871
5890
  handlePopoverMouseenter,
5872
5891
  handlePopoverMouseleave,
5873
5892
  handlePopoverClose,
@@ -5877,12 +5896,14 @@ const __sfc__$1l = vue.defineComponent({
5877
5896
  // expose
5878
5897
  close,
5879
5898
  // expose
5880
- resize
5899
+ resize,
5900
+ // expose
5901
+ setReference
5881
5902
  } = usePopover(props2);
5882
5903
  return {
5883
5904
  popover,
5884
5905
  host,
5885
- hostSize,
5906
+ referenceSize,
5886
5907
  show,
5887
5908
  zIndex,
5888
5909
  teleportDisabled,
@@ -5890,16 +5911,14 @@ const __sfc__$1l = vue.defineComponent({
5890
5911
  toSizeUnit,
5891
5912
  n: n$1k,
5892
5913
  classes: classes$13,
5893
- handleHostClick,
5894
- handleHostMouseenter,
5895
- handleHostMouseleave,
5896
5914
  handlePopoverMouseenter,
5897
5915
  handlePopoverMouseleave,
5898
5916
  handlePopoverClose,
5899
5917
  handleClosed,
5900
5918
  resize,
5901
5919
  open,
5902
- close
5920
+ close,
5921
+ setReference
5903
5922
  };
5904
5923
  }
5905
5924
  });
@@ -6661,6 +6680,10 @@ const __sfc__$1i = vue.defineComponent({
6661
6680
  var _a;
6662
6681
  (_a = menu.value) == null ? void 0 : _a.resize();
6663
6682
  }
6683
+ function setReference(reference2) {
6684
+ var _a;
6685
+ (_a = menu.value) == null ? void 0 : _a.setReference(reference2);
6686
+ }
6664
6687
  return {
6665
6688
  show,
6666
6689
  menu,
@@ -6670,7 +6693,8 @@ const __sfc__$1i = vue.defineComponent({
6670
6693
  formatElevation,
6671
6694
  open,
6672
6695
  close,
6673
- resize
6696
+ resize,
6697
+ setReference
6674
6698
  };
6675
6699
  }
6676
6700
  });
@@ -16172,7 +16196,7 @@ const props$H = {
16172
16196
  type: String,
16173
16197
  default: "hover"
16174
16198
  },
16175
- reference: String,
16199
+ reference: [String, Object],
16176
16200
  placement: {
16177
16201
  type: String,
16178
16202
  default: "bottom"
@@ -16212,10 +16236,7 @@ function __render__$J(_ctx, _cache) {
16212
16236
  "div",
16213
16237
  {
16214
16238
  ref: "host",
16215
- class: vue.normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box"))),
16216
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleHostClick && _ctx.handleHostClick(...args)),
16217
- onMouseenter: _cache[4] || (_cache[4] = (...args) => _ctx.handleHostMouseenter && _ctx.handleHostMouseenter(...args)),
16218
- onMouseleave: _cache[5] || (_cache[5] = (...args) => _ctx.handleHostMouseleave && _ctx.handleHostMouseleave(...args))
16239
+ class: vue.normalizeClass(_ctx.classes(_ctx.n(), _ctx.n("$--box")))
16219
16240
  },
16220
16241
  [
16221
16242
  vue.renderSlot(_ctx.$slots, "default"),
@@ -16248,7 +16269,7 @@ function __render__$J(_ctx, _cache) {
16248
16269
  style: vue.normalizeStyle({
16249
16270
  background: _ctx.color,
16250
16271
  color: _ctx.textColor,
16251
- width: _ctx.sameWidth ? _ctx.toSizeUnit(Math.ceil(_ctx.hostSize.width)) : void 0
16272
+ width: _ctx.sameWidth ? _ctx.toSizeUnit(Math.ceil(_ctx.referenceSize.width)) : void 0
16252
16273
  }),
16253
16274
  class: vue.normalizeClass(_ctx.classes(_ctx.n("content-container"), _ctx.n(`--${_ctx.type}`))),
16254
16275
  role: "tooltip"
@@ -16277,8 +16298,8 @@ function __render__$J(_ctx, _cache) {
16277
16298
  }, 8, ["name", "onAfterEnter", "onAfterLeave"])
16278
16299
  ], 8, ["to", "disabled"]))
16279
16300
  ],
16280
- 34
16281
- /* CLASS, NEED_HYDRATION */
16301
+ 2
16302
+ /* CLASS */
16282
16303
  );
16283
16304
  }
16284
16305
  const __sfc__$M = vue.defineComponent({
@@ -16289,12 +16310,9 @@ const __sfc__$M = vue.defineComponent({
16289
16310
  const {
16290
16311
  popover,
16291
16312
  host,
16292
- hostSize,
16313
+ referenceSize,
16293
16314
  show,
16294
16315
  zIndex,
16295
- handleHostClick,
16296
- handleHostMouseenter,
16297
- handleHostMouseleave,
16298
16316
  handlePopoverMouseenter,
16299
16317
  handlePopoverMouseleave,
16300
16318
  handlePopoverClose,
@@ -16304,28 +16322,28 @@ const __sfc__$M = vue.defineComponent({
16304
16322
  // expose
16305
16323
  close,
16306
16324
  // expose
16307
- resize
16325
+ resize,
16326
+ // expose
16327
+ setReference
16308
16328
  } = usePopover(props2);
16309
16329
  return {
16310
16330
  popover,
16311
16331
  host,
16312
- hostSize,
16332
+ referenceSize,
16313
16333
  show,
16314
16334
  zIndex,
16315
16335
  teleportDisabled,
16316
16336
  toSizeUnit,
16317
16337
  n: n$L,
16318
16338
  classes: classes$B,
16319
- handleHostClick,
16320
16339
  handlePopoverClose,
16321
- handleHostMouseenter,
16322
- handleHostMouseleave,
16323
16340
  handlePopoverMouseenter,
16324
16341
  handlePopoverMouseleave,
16325
16342
  handleClosed,
16326
16343
  resize,
16327
16344
  open,
16328
- close
16345
+ close,
16346
+ setReference
16329
16347
  };
16330
16348
  }
16331
16349
  });
@@ -25724,7 +25742,20 @@ var stdin_default$2U = {
25724
25742
  "--switch-variant-handle-background": "rgb(255, 255, 255, .7)",
25725
25743
  "--switch-variant-handle-color": "var(--color-primary)",
25726
25744
  "--switch-variant-handle-active-color": "var(--color-primary)",
25727
- "--switch-variant-handle-active-background": "var(--color-on-primary)"
25745
+ "--switch-variant-handle-active-background": "var(--color-on-primary)",
25746
+ "--switch-width": "40px",
25747
+ "--switch-height": "24px",
25748
+ "--switch-track-width": "38px",
25749
+ "--switch-track-height": "14.4px",
25750
+ "--switch-track-border-radius": "calc(20px * 2 / 3)",
25751
+ "--switch-handle-width": "20px",
25752
+ "--switch-handle-height": "20px",
25753
+ "--switch-ripple-size": "40px",
25754
+ "--switch-ripple-left": "-10px",
25755
+ "--switch-ripple-active-left": "10px",
25756
+ "--switch-loading-size": "16px",
25757
+ "--switch-variant-ripple-left": "-4px",
25758
+ "--switch-variant-ripple-active-left": "16px"
25728
25759
  };
25729
25760
  var stdin_default$2T = {
25730
25761
  "--tab-inactive-color": "rgba(255, 255, 255, .65)",
@@ -26957,7 +26988,20 @@ var stdin_default$1A = {
26957
26988
  "--switch-variant-handle-color": "var(--color-on-primary)",
26958
26989
  "--switch-variant-handle-active-color": "var(--color-primary)",
26959
26990
  "--switch-variant-handle-background": "#79747E",
26960
- "--switch-variant-handle-active-background": "var(--color-on-primary)"
26991
+ "--switch-variant-handle-active-background": "var(--color-on-primary)",
26992
+ "--switch-width": "40px",
26993
+ "--switch-height": "24px",
26994
+ "--switch-track-width": "38px",
26995
+ "--switch-track-height": "14.4px",
26996
+ "--switch-track-border-radius": "calc(20px * 2 / 3)",
26997
+ "--switch-handle-width": "20px",
26998
+ "--switch-handle-height": "20px",
26999
+ "--switch-ripple-size": "40px",
27000
+ "--switch-ripple-left": "-10px",
27001
+ "--switch-ripple-active-left": "10px",
27002
+ "--switch-loading-size": "16px",
27003
+ "--switch-variant-ripple-left": "-4px",
27004
+ "--switch-variant-ripple-active-left": "16px"
26961
27005
  };
26962
27006
  var stdin_default$1z = {
26963
27007
  "--rate-color": "var(--color-on-surface-variant)",
@@ -27936,7 +27980,20 @@ var stdin_default$u = {
27936
27980
  "--switch-variant-handle-color": "var(--color-on-primary)",
27937
27981
  "--switch-variant-handle-active-color": "var(--color-primary)",
27938
27982
  "--switch-variant-handle-background": "#938F99",
27939
- "--switch-variant-handle-active-background": "var(--color-on-primary)"
27983
+ "--switch-variant-handle-active-background": "var(--color-on-primary)",
27984
+ "--switch-width": "40px",
27985
+ "--switch-height": "24px",
27986
+ "--switch-track-width": "38px",
27987
+ "--switch-track-height": "14.4px",
27988
+ "--switch-track-border-radius": "calc(20px * 2 / 3)",
27989
+ "--switch-handle-width": "20px",
27990
+ "--switch-handle-height": "20px",
27991
+ "--switch-ripple-size": "40px",
27992
+ "--switch-ripple-left": "-10px",
27993
+ "--switch-ripple-active-left": "10px",
27994
+ "--switch-loading-size": "16px",
27995
+ "--switch-variant-ripple-left": "-4px",
27996
+ "--switch-variant-ripple-active-left": "16px"
27940
27997
  };
27941
27998
  var stdin_default$t = {
27942
27999
  "--slider-thumb-size": "16px",
@@ -30016,7 +30073,7 @@ withInstall(stdin_default$1);
30016
30073
  withPropsDefaultsSetter(stdin_default$1, props);
30017
30074
  const _WatermarkComponent = stdin_default$1;
30018
30075
  var stdin_default = stdin_default$1;
30019
- const version = "3.7.1";
30076
+ const version = "3.7.2-alpha.1733247317826";
30020
30077
  function install(app) {
30021
30078
  stdin_default$5W.install && app.use(stdin_default$5W);
30022
30079
  stdin_default$5U.install && app.use(stdin_default$5U);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.7.1",
3
+ "version": "3.7.2-alpha.1733247317826",
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.7.1",
52
- "@varlet/use": "3.7.1",
53
- "@varlet/shared": "3.7.1"
51
+ "@varlet/shared": "3.7.2-alpha.1733247317826",
52
+ "@varlet/icons": "3.7.2-alpha.1733247317826",
53
+ "@varlet/use": "3.7.2-alpha.1733247317826"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^18.7.18",
@@ -66,9 +66,9 @@
66
66
  "vue": "3.4.21",
67
67
  "vue-router": "4.2.0",
68
68
  "zod": "^3.23.8",
69
- "@varlet/cli": "3.7.1",
70
- "@varlet/ui": "3.7.1",
71
- "@varlet/touch-emulator": "3.7.1"
69
+ "@varlet/touch-emulator": "3.7.2-alpha.1733247317826",
70
+ "@varlet/cli": "3.7.2-alpha.1733247317826",
71
+ "@varlet/ui": "3.7.2-alpha.1733247317826"
72
72
  },
73
73
  "scripts": {
74
74
  "dev": "varlet-cli dev",
package/types/menu.d.ts CHANGED
@@ -22,11 +22,13 @@ export type MenuTrigger = 'click' | 'hover' | 'manual'
22
22
 
23
23
  export type MenuStrategy = PositioningStrategy
24
24
 
25
+ export type MenuReference = string | HTMLElement
26
+
25
27
  export interface MenuProps extends BasicAttributes {
26
28
  show?: boolean
27
29
  disabled?: boolean
28
30
  trigger?: MenuTrigger
29
- reference?: string
31
+ reference?: MenuReference
30
32
  placement?: MenuPlacement
31
33
  strategy?: MenuStrategy
32
34
  offsetX?: string | number
@@ -24,6 +24,8 @@ export type MenuSelectStrategy = PositioningStrategy
24
24
 
25
25
  export type MenuSelectSize = 'normal' | 'mini' | 'small' | 'large'
26
26
 
27
+ export type MenuSelectReference = string | HTMLElement
28
+
27
29
  export type MenuSelectOptionLabelRender = (option: MenuSelectOption, checked: boolean) => VNodeChild
28
30
 
29
31
  export interface MenuSelectOption {
@@ -42,7 +44,7 @@ export interface MenuSelectProps extends BasicAttributes {
42
44
  show?: boolean
43
45
  disabled?: boolean
44
46
  trigger?: MenuSelectTrigger
45
- reference?: string
47
+ reference?: MenuSelectReference
46
48
  placement?: MenuSelectPlacement
47
49
  strategy?: MenuSelectStrategy
48
50
  offsetX?: string | number
@@ -668,6 +668,19 @@ interface BaseStyleVars {
668
668
  '--switch-variant-handle-active-color'?: string
669
669
  '--switch-variant-handle-background'?: string
670
670
  '--switch-variant-handle-active-background'?: string
671
+ '--switch-width'?: string
672
+ '--switch-height'?: string
673
+ '--switch-track-width'?: string
674
+ '--switch-track-height'?: string
675
+ '--switch-track-border-radius'?: string
676
+ '--switch-handle-width'?: string
677
+ '--switch-handle-height'?: string
678
+ '--switch-ripple-size'?: string
679
+ '--switch-ripple-left'?: string
680
+ '--switch-ripple-active-left'?: string
681
+ '--switch-loading-size'?: string
682
+ '--switch-variant-ripple-left'?: string
683
+ '--switch-variant-ripple-active-left'?: string
671
684
  '--table-background'?: string
672
685
  '--table-border-radius'?: string
673
686
  '--table-thead-border-bottom'?: string
@@ -11,6 +11,8 @@ export type TooltipPlacement = TooltipNeededPopperPlacement
11
11
 
12
12
  export type TooltipTrigger = 'click' | 'hover' | 'manual'
13
13
 
14
+ export type TooltipReference = string | HTMLElement
15
+
14
16
  export type TooltipType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger'
15
17
 
16
18
  export type TooltipStrategy = PositioningStrategy
@@ -23,7 +25,7 @@ export interface TooltipProps extends BasicAttributes {
23
25
  textColor?: string
24
26
  type?: TooltipType
25
27
  trigger?: TooltipTrigger
26
- reference?: string
28
+ reference?: TooltipReference
27
29
  placement?: TooltipPlacement
28
30
  strategy?: TooltipStrategy
29
31
  offsetX?: string | number