@varlet/ui 3.2.10-alpha.1715410887389 → 3.2.10

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
@@ -647,7 +647,7 @@ var __spreadValues$v = (a, b) => {
647
647
  return a;
648
648
  };
649
649
  var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
650
- var __async$h = (__this, __arguments, generator) => {
650
+ var __async$i = (__this, __arguments, generator) => {
651
651
  return new Promise((resolve, reject) => {
652
652
  var fulfilled = (value) => {
653
653
  try {
@@ -742,7 +742,7 @@ function flatFragment(vNodes) {
742
742
  }
743
743
  function useValidation() {
744
744
  const errorMessage = vue.ref("");
745
- const validate = (rules, value, apis) => __async$h(this, null, function* () {
745
+ const validate = (rules, value, apis) => __async$i(this, null, function* () {
746
746
  if (!isArray(rules) || !rules.length) {
747
747
  return true;
748
748
  }
@@ -758,7 +758,7 @@ function useValidation() {
758
758
  const resetValidation = () => {
759
759
  errorMessage.value = "";
760
760
  };
761
- const validateWithTrigger = (validateTrigger, trigger, rules, value, apis) => __async$h(this, null, function* () {
761
+ const validateWithTrigger = (validateTrigger, trigger, rules, value, apis) => __async$i(this, null, function* () {
762
762
  if (validateTrigger.includes(trigger)) {
763
763
  (yield validate(rules, value, apis)) && (errorMessage.value = "");
764
764
  }
@@ -1481,7 +1481,7 @@ function focusChildElementByKey(hostElement, parentElement, key) {
1481
1481
  }
1482
1482
  }
1483
1483
  }
1484
- var __async$g = (__this, __arguments, generator) => {
1484
+ var __async$h = (__this, __arguments, generator) => {
1485
1485
  return new Promise((resolve, reject) => {
1486
1486
  var fulfilled = (value) => {
1487
1487
  try {
@@ -1532,7 +1532,7 @@ const __sfc__$1o = vue.defineComponent({
1532
1532
  const animateInProgress = vue.ref(false);
1533
1533
  vue.watch(() => props2.name, handleNameChange, { immediate: true });
1534
1534
  function handleNameChange(newName, oldName) {
1535
- return __async$g(this, null, function* () {
1535
+ return __async$h(this, null, function* () {
1536
1536
  const { transition } = props2;
1537
1537
  if (oldName == null || toNumber(transition) === 0) {
1538
1538
  nextName.value = newName;
@@ -2753,7 +2753,7 @@ var __spreadValues$p = (a, b) => {
2753
2753
  }
2754
2754
  return a;
2755
2755
  };
2756
- var __async$f = (__this, __arguments, generator) => {
2756
+ var __async$g = (__this, __arguments, generator) => {
2757
2757
  return new Promise((resolve, reject) => {
2758
2758
  var fulfilled = (value) => {
2759
2759
  try {
@@ -2879,7 +2879,7 @@ function attemptLoad(el) {
2879
2879
  createImage(el, attemptSRC);
2880
2880
  }
2881
2881
  function check(el) {
2882
- return __async$f(this, null, function* () {
2882
+ return __async$g(this, null, function* () {
2883
2883
  yield doubleRaf();
2884
2884
  if (inViewport(el)) {
2885
2885
  attemptLoad(el);
@@ -2890,7 +2890,7 @@ function checkAll() {
2890
2890
  lazyElements.forEach((el) => check(el));
2891
2891
  }
2892
2892
  function add$1(el) {
2893
- return __async$f(this, null, function* () {
2893
+ return __async$g(this, null, function* () {
2894
2894
  !lazyElements.includes(el) && lazyElements.push(el);
2895
2895
  getAllParentScroller(el).forEach(bindEvents);
2896
2896
  yield check(el);
@@ -2905,13 +2905,13 @@ function diff(el, binding) {
2905
2905
  return src !== binding.value || arg !== binding.arg;
2906
2906
  }
2907
2907
  function mounted(el, binding) {
2908
- return __async$f(this, null, function* () {
2908
+ return __async$g(this, null, function* () {
2909
2909
  createLazy(el, binding);
2910
2910
  yield add$1(el);
2911
2911
  });
2912
2912
  }
2913
2913
  function updated(el, binding) {
2914
- return __async$f(this, null, function* () {
2914
+ return __async$g(this, null, function* () {
2915
2915
  if (!diff(el, binding)) {
2916
2916
  lazyElements.includes(el) && (yield check(el));
2917
2917
  return;
@@ -4439,7 +4439,7 @@ const props$10 = {
4439
4439
  onClick: defineListenerProp(),
4440
4440
  "onUpdate:floating": defineListenerProp()
4441
4441
  };
4442
- var __async$e = (__this, __arguments, generator) => {
4442
+ var __async$f = (__this, __arguments, generator) => {
4443
4443
  return new Promise((resolve, reject) => {
4444
4444
  var fulfilled = (value) => {
4445
4445
  try {
@@ -4685,12 +4685,12 @@ const __sfc__$18 = vue.defineComponent({
4685
4685
  { immediate: true }
4686
4686
  );
4687
4687
  function floating() {
4688
- return __async$e(this, null, function* () {
4688
+ return __async$f(this, null, function* () {
4689
4689
  clearTimeout(floater.value);
4690
4690
  clearTimeout(dropper);
4691
4691
  floater.value = null;
4692
4692
  floater.value = setTimeout(
4693
- () => __async$e(this, null, function* () {
4693
+ () => __async$f(this, null, function* () {
4694
4694
  const { width, height, left: left2, top: top2 } = getRect(card.value);
4695
4695
  holderWidth.value = toSizeUnit(width);
4696
4696
  holderHeight.value = toSizeUnit(height);
@@ -5899,7 +5899,7 @@ const props$U = {
5899
5899
  },
5900
5900
  disabled: Boolean
5901
5901
  };
5902
- var __async$d = (__this, __arguments, generator) => {
5902
+ var __async$e = (__this, __arguments, generator) => {
5903
5903
  return new Promise((resolve, reject) => {
5904
5904
  var fulfilled = (value) => {
5905
5905
  try {
@@ -5932,7 +5932,7 @@ function useCollapseTransition(options) {
5932
5932
  { immediate: true }
5933
5933
  );
5934
5934
  function open() {
5935
- return __async$d(this, null, function* () {
5935
+ return __async$e(this, null, function* () {
5936
5936
  if (!contentEl.value) {
5937
5937
  return;
5938
5938
  }
@@ -5958,7 +5958,7 @@ function useCollapseTransition(options) {
5958
5958
  }
5959
5959
  });
5960
5960
  }
5961
- const close = () => __async$d(this, null, function* () {
5961
+ const close = () => __async$e(this, null, function* () {
5962
5962
  if (!contentEl.value) {
5963
5963
  return;
5964
5964
  }
@@ -9943,7 +9943,7 @@ const props$P = {
9943
9943
  disabled: Boolean,
9944
9944
  onScroll: defineListenerProp()
9945
9945
  };
9946
- var __async$c = (__this, __arguments, generator) => {
9946
+ var __async$d = (__this, __arguments, generator) => {
9947
9947
  return new Promise((resolve, reject) => {
9948
9948
  var fulfilled = (value) => {
9949
9949
  try {
@@ -10021,7 +10021,7 @@ const __sfc__$W = vue.defineComponent({
10021
10021
  const offsetTop = vue.computed(() => toPxNum(props2.offsetTop));
10022
10022
  let scroller;
10023
10023
  vue.watch(() => props2.disabled, resize);
10024
- onSmartMounted(() => __async$c(this, null, function* () {
10024
+ onSmartMounted(() => __async$d(this, null, function* () {
10025
10025
  yield doubleRaf();
10026
10026
  setupScroller();
10027
10027
  handleScroll();
@@ -10083,7 +10083,7 @@ const __sfc__$W = vue.defineComponent({
10083
10083
  scroller.removeEventListener("scroll", handleScroll);
10084
10084
  }
10085
10085
  function resize() {
10086
- return __async$c(this, null, function* () {
10086
+ return __async$d(this, null, function* () {
10087
10087
  isFixed.value = false;
10088
10088
  yield raf();
10089
10089
  computeFixedParams();
@@ -10737,7 +10737,7 @@ const __sfc__$U = vue.defineComponent({
10737
10737
  });
10738
10738
  __sfc__$U.render = __render__$T;
10739
10739
  var stdin_default$4N = __sfc__$U;
10740
- var __async$b = (__this, __arguments, generator) => {
10740
+ var __async$c = (__this, __arguments, generator) => {
10741
10741
  return new Promise((resolve, reject) => {
10742
10742
  var fulfilled = (value) => {
10743
10743
  try {
@@ -11180,7 +11180,7 @@ const __sfc__$T = vue.defineComponent({
11180
11180
  checkType = x > 0 ? "prev" : "next";
11181
11181
  }
11182
11182
  function handleTouchend() {
11183
- return __async$b(this, null, function* () {
11183
+ return __async$c(this, null, function* () {
11184
11184
  if (isUntouchable.value || touchDirection !== "x")
11185
11185
  return;
11186
11186
  const componentRef = getPanelType.value === "year" ? yearPanelEl : getPanelType.value === "month" ? monthPanelEl : dayPanelEl;
@@ -11926,7 +11926,7 @@ var __spreadValues$e = (a, b) => {
11926
11926
  return a;
11927
11927
  };
11928
11928
  var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
11929
- var __async$a = (__this, __arguments, generator) => {
11929
+ var __async$b = (__this, __arguments, generator) => {
11930
11930
  return new Promise((resolve, reject) => {
11931
11931
  var fulfilled = (value) => {
11932
11932
  try {
@@ -12006,7 +12006,7 @@ const __sfc__$Q = vue.defineComponent({
12006
12006
  saveXY();
12007
12007
  }
12008
12008
  function handleTouchmove(event) {
12009
- return __async$a(this, null, function* () {
12009
+ return __async$b(this, null, function* () {
12010
12010
  if (!touching.value || props2.disabled) {
12011
12011
  return;
12012
12012
  }
@@ -13447,7 +13447,7 @@ var __spreadValues$d = (a, b) => {
13447
13447
  return a;
13448
13448
  };
13449
13449
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
13450
- var __async$9 = (__this, __arguments, generator) => {
13450
+ var __async$a = (__this, __arguments, generator) => {
13451
13451
  return new Promise((resolve, reject) => {
13452
13452
  var fulfilled = (value) => {
13453
13453
  try {
@@ -13536,7 +13536,7 @@ function usePopover(options) {
13536
13536
  enterHost = true;
13537
13537
  open();
13538
13538
  };
13539
- const handleHostMouseleave = () => __async$9(this, null, function* () {
13539
+ const handleHostMouseleave = () => __async$a(this, null, function* () {
13540
13540
  if (options.trigger !== "hover") {
13541
13541
  return;
13542
13542
  }
@@ -13553,7 +13553,7 @@ function usePopover(options) {
13553
13553
  }
13554
13554
  enterPopover = true;
13555
13555
  };
13556
- const handlePopoverMouseleave = () => __async$9(this, null, function* () {
13556
+ const handlePopoverMouseleave = () => __async$a(this, null, function* () {
13557
13557
  if (options.trigger !== "hover") {
13558
13558
  return;
13559
13559
  }
@@ -14297,6 +14297,26 @@ const props$I = {
14297
14297
  onClick: defineListenerProp(),
14298
14298
  onClear: defineListenerProp()
14299
14299
  };
14300
+ var __async$9 = (__this, __arguments, generator) => {
14301
+ return new Promise((resolve, reject) => {
14302
+ var fulfilled = (value) => {
14303
+ try {
14304
+ step(generator.next(value));
14305
+ } catch (e) {
14306
+ reject(e);
14307
+ }
14308
+ };
14309
+ var rejected = (value) => {
14310
+ try {
14311
+ step(generator.throw(value));
14312
+ } catch (e) {
14313
+ reject(e);
14314
+ }
14315
+ };
14316
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
14317
+ step((generator = generator.apply(__this, __arguments)).next());
14318
+ });
14319
+ };
14300
14320
  const { name: name$I, n: n$L, classes: classes$D } = createNamespace("field-decorator");
14301
14321
  const _hoisted_1$o = ["for"];
14302
14322
  function __render__$M(_ctx, _cache) {
@@ -14506,6 +14526,7 @@ const __sfc__$N = vue.defineComponent({
14506
14526
  const middleOffsetHeight = vue.ref("0px");
14507
14527
  const transitionDisabled = vue.ref(true);
14508
14528
  const isFloating = vue.computed(() => props2.hint && (!isEmpty(props2.value) || props2.isFocusing));
14529
+ const { popup, bindPopup } = usePopup();
14509
14530
  const color = vue.computed(
14510
14531
  () => !props2.errorMessage ? props2.isFocusing ? props2.focusColor : props2.blurColor : void 0
14511
14532
  );
@@ -14517,6 +14538,18 @@ const __sfc__$N = vue.defineComponent({
14517
14538
  });
14518
14539
  });
14519
14540
  vue.onUpdated(resize);
14541
+ call(bindPopup, null);
14542
+ if (popup) {
14543
+ vue.watch(
14544
+ () => popup.show.value,
14545
+ (show) => __async$9(this, null, function* () {
14546
+ if (show) {
14547
+ yield doubleRaf();
14548
+ resize();
14549
+ }
14550
+ })
14551
+ );
14552
+ }
14520
14553
  function computePlaceholderState() {
14521
14554
  const { hint, value, composing } = props2;
14522
14555
  if (!hint && (!isEmpty(value) || composing)) {
@@ -26780,12 +26813,12 @@ var stdin_default$8 = __spreadValues$1(__spreadValues$1(__spreadValues$1(__sprea
26780
26813
  "--shadow-key-ambient-opacity": "rgba(0, 0, 0, 0.12)"
26781
26814
  }, stdin_default$17), stdin_default$16), stdin_default$15), stdin_default$14), stdin_default$13), stdin_default$12), stdin_default$11), stdin_default$10), stdin_default$$), stdin_default$_), stdin_default$Z), stdin_default$Y), stdin_default$X), stdin_default$W), stdin_default$V), stdin_default$U), stdin_default$T), stdin_default$S), stdin_default$R), stdin_default$Q), stdin_default$P), stdin_default$O), stdin_default$N), stdin_default$M), stdin_default$L), stdin_default$K), stdin_default$J), stdin_default$I), stdin_default$H), stdin_default$G), stdin_default$F), stdin_default$E), stdin_default$D), stdin_default$C), stdin_default$B), stdin_default$A), stdin_default$z), stdin_default$y), stdin_default$x), stdin_default$w), stdin_default$v), stdin_default$u), stdin_default$t), stdin_default$s), stdin_default$r), stdin_default$q), stdin_default$p), stdin_default$o), stdin_default$n), stdin_default$m), stdin_default$l), stdin_default$k), stdin_default$j), stdin_default$i), stdin_default$h), stdin_default$g), stdin_default$f), stdin_default$e), stdin_default$d), stdin_default$c), stdin_default$b), stdin_default$a), stdin_default$9);
26782
26815
  function toViewport(theme, options = {}) {
26783
- const { viewportWidth = 375, viewportUnit = "vmin", unitPrecision = 6, maxDisplayWidth } = options;
26816
+ const { viewportWidth = 375, viewportUnit = "vmin", unitPrecision = 6 } = options;
26784
26817
  return Object.entries(theme).reduce((target, [key, value]) => {
26785
- target[key] = value.includes("px") ? value.replace(/(\d+(\.\d+)?)px/g, (_, rawValue) => {
26786
- const viewportValue = `${Number((rawValue / viewportWidth * 100).toFixed(unitPrecision))}${viewportUnit}`;
26787
- return maxDisplayWidth ? `min(${viewportValue}, ${maxDisplayWidth / viewportWidth * rawValue}px)` : viewportValue;
26788
- }) : value;
26818
+ target[key] = value.includes("px") ? value.replace(
26819
+ /(\d+(\.\d+)?)px/g,
26820
+ (_, p1) => `${Number((p1 / viewportWidth * 100).toFixed(unitPrecision))}${viewportUnit}`
26821
+ ) : value;
26789
26822
  return target;
26790
26823
  }, {});
26791
26824
  }
@@ -28498,7 +28531,7 @@ withInstall(stdin_default$1);
28498
28531
  withPropsDefaultsSetter(stdin_default$1, props);
28499
28532
  const _WatermarkComponent = stdin_default$1;
28500
28533
  var stdin_default = stdin_default$1;
28501
- const version = "3.2.10-alpha.1715410887389";
28534
+ const version = "3.2.10";
28502
28535
  function install(app) {
28503
28536
  stdin_default$5E.install && app.use(stdin_default$5E);
28504
28537
  stdin_default$5C.install && app.use(stdin_default$5C);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.2.10-alpha.1715410887389",
3
+ "version": "3.2.10",
4
4
  "description": "A material like components library",
5
5
  "main": "lib/varlet.cjs.js",
6
6
  "module": "es/index.mjs",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "author": "haoziqaq <357229046@qq.com>",
28
28
  "license": "MIT",
29
- "homepage": "https://varletjs.github.io/varlet/",
29
+ "homepage": "https://varlet.pages.dev",
30
30
  "repository": {
31
31
  "type": "git",
32
32
  "url": "git+https://github.com/varletjs/varlet.git"
@@ -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.2.10-alpha.1715410887389",
52
- "@varlet/shared": "3.2.10-alpha.1715410887389",
53
- "@varlet/use": "3.2.10-alpha.1715410887389"
51
+ "@varlet/shared": "3.2.10",
52
+ "@varlet/icons": "3.2.10",
53
+ "@varlet/use": "3.2.10"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@vue/runtime-core": "3.4.21",
@@ -66,9 +66,9 @@
66
66
  "typescript": "^5.1.5",
67
67
  "vue": "3.4.21",
68
68
  "vue-router": "4.2.0",
69
- "@varlet/ui": "3.2.10-alpha.1715410887389",
70
- "@varlet/cli": "3.2.10-alpha.1715410887389",
71
- "@varlet/touch-emulator": "3.2.10-alpha.1715410887389"
69
+ "@varlet/cli": "3.2.10",
70
+ "@varlet/ui": "3.2.10",
71
+ "@varlet/touch-emulator": "3.2.10"
72
72
  },
73
73
  "scripts": {
74
74
  "dev": "varlet-cli dev",
package/types/themes.d.ts CHANGED
@@ -4,7 +4,6 @@ export interface ThemesToViewportOptions {
4
4
  viewportWidth?: number
5
5
  viewportUnit?: string
6
6
  unitPrecision?: number
7
- maxDisplayWidth?: number
8
7
  }
9
8
 
10
9
  interface Themes {