@varlet/ui 3.18.1 → 3.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "3.18.1",
4
+ "version": "3.18.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "3.18.1",
4
+ "version": "3.18.2",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
package/lib/varlet.cjs.js CHANGED
@@ -849,7 +849,7 @@ var __spreadValues$43 = (a, b) => {
849
849
  return a;
850
850
  };
851
851
  var __spreadProps$22 = (a, b) => __defProps$22(a, __getOwnPropDescs$22(b));
852
- var __async$25 = (__this, __arguments, generator) => {
852
+ var __async$27 = (__this, __arguments, generator) => {
853
853
  return new Promise((resolve, reject) => {
854
854
  var fulfilled = (value) => {
855
855
  try {
@@ -937,7 +937,7 @@ function isZodResult(result) {
937
937
  }
938
938
  function useValidation() {
939
939
  const errorMessage = (0, vue.ref)("");
940
- const validate = (ruleOrRules, value, apis) => __async$25(null, null, function* () {
940
+ const validate = (ruleOrRules, value, apis) => __async$27(null, null, function* () {
941
941
  const rules = normalizeToArray(ruleOrRules).filter((rule) => isZodRule(rule) || isFunction(rule));
942
942
  const results = yield Promise.all(rules.map((rule) => isZodRule(rule) ? rule.safeParseAsync(value) : rule(value, apis)));
943
943
  resetValidation();
@@ -957,7 +957,7 @@ function useValidation() {
957
957
  const resetValidation = () => {
958
958
  errorMessage.value = "";
959
959
  };
960
- const validateWithTrigger = (validateTrigger, trigger, rules, value, apis) => __async$25(null, null, function* () {
960
+ const validateWithTrigger = (validateTrigger, trigger, rules, value, apis) => __async$27(null, null, function* () {
961
961
  if (validateTrigger.includes(trigger)) (yield validate(rules, value, apis)) && (errorMessage.value = "");
962
962
  });
963
963
  return {
@@ -2357,7 +2357,7 @@ var props$37 = {
2357
2357
  };
2358
2358
  //#endregion
2359
2359
  //#region es/icon/Icon.mjs
2360
- var __async$24 = (__this, __arguments, generator) => {
2360
+ var __async$26 = (__this, __arguments, generator) => {
2361
2361
  return new Promise((resolve, reject) => {
2362
2362
  var fulfilled = (value) => {
2363
2363
  try {
@@ -2409,7 +2409,7 @@ var __sfc__$103 = (0, vue.defineComponent)({
2409
2409
  const animateInProgress = (0, vue.ref)(false);
2410
2410
  (0, vue.watch)(() => props2.name, handleNameChange, { immediate: true });
2411
2411
  function handleNameChange(newName, oldName) {
2412
- return __async$24(this, null, function* () {
2412
+ return __async$26(this, null, function* () {
2413
2413
  const { transition } = props2;
2414
2414
  if (oldName == null || toNumber(transition) === 0) {
2415
2415
  nextName.value = newName;
@@ -3112,7 +3112,7 @@ var props$33 = {
3112
3112
  };
3113
3113
  //#endregion
3114
3114
  //#region es/field-decorator/FieldDecorator.mjs
3115
- var __async$23 = (__this, __arguments, generator) => {
3115
+ var __async$25 = (__this, __arguments, generator) => {
3116
3116
  return new Promise((resolve, reject) => {
3117
3117
  var fulfilled = (value) => {
3118
3118
  try {
@@ -3220,7 +3220,7 @@ var __sfc__$97 = (0, vue.defineComponent)({
3220
3220
  call(bindSwipeResizeDispatcher, { onResize() {
3221
3221
  (0, vue.nextTick)().then(resize);
3222
3222
  } });
3223
- if (popup) (0, vue.watch)(() => popup.show.value, (show) => __async$23(null, null, function* () {
3223
+ if (popup) (0, vue.watch)(() => popup.show.value, (show) => __async$25(null, null, function* () {
3224
3224
  if (show) {
3225
3225
  yield doubleRaf();
3226
3226
  resize();
@@ -3772,6 +3772,26 @@ function useCheckboxGroup() {
3772
3772
  }
3773
3773
  //#endregion
3774
3774
  //#region es/checkbox/Checkbox.mjs
3775
+ var __async$24 = (__this, __arguments, generator) => {
3776
+ return new Promise((resolve, reject) => {
3777
+ var fulfilled = (value) => {
3778
+ try {
3779
+ step(generator.next(value));
3780
+ } catch (e) {
3781
+ reject(e);
3782
+ }
3783
+ };
3784
+ var rejected = (value) => {
3785
+ try {
3786
+ step(generator.throw(value));
3787
+ } catch (e) {
3788
+ reject(e);
3789
+ }
3790
+ };
3791
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
3792
+ step((generator = generator.apply(__this, __arguments)).next());
3793
+ });
3794
+ };
3775
3795
  var { name: name$86, n: n$97, classes: classes$78 } = createNamespace("checkbox");
3776
3796
  var _hoisted_1$42 = [
3777
3797
  "aria-checked",
@@ -3876,26 +3896,32 @@ var __sfc__$95 = (0, vue.defineComponent)({
3876
3896
  });
3877
3897
  }
3878
3898
  function change(changedValue) {
3879
- const { checkedValue: checkedValue2, onChange } = props2;
3880
- value.value = changedValue;
3881
- call(onChange, value.value, isIndeterminate.value);
3882
- validateWithTrigger("onChange");
3883
- changedValue === checkedValue2 ? checkboxGroup?.onChecked(checkedValue2) : checkboxGroup?.onUnchecked(checkedValue2);
3899
+ return __async$24(this, null, function* () {
3900
+ const { checkedValue: checkedValue2, onChange } = props2;
3901
+ value.value = changedValue;
3902
+ changedValue === checkedValue2 ? checkboxGroup?.onChecked(checkedValue2) : checkboxGroup?.onUnchecked(checkedValue2);
3903
+ yield (0, vue.nextTick)();
3904
+ call(onChange, changedValue, isIndeterminate.value);
3905
+ validateWithTrigger("onChange");
3906
+ });
3884
3907
  }
3885
3908
  function handleClick(e) {
3886
- const { disabled, readonly, checkedValue: checkedValue2, uncheckedValue, onClick } = props2;
3887
- if ((form == null ? void 0 : form.disabled.value) || disabled) return;
3888
- call(onClick, e);
3889
- if ((form == null ? void 0 : form.readonly.value) || readonly) return;
3890
- if (isIndeterminate.value === true) {
3891
- isIndeterminate.value = false;
3892
- call(props2.onChange, value.value, isIndeterminate.value);
3893
- validateWithTrigger("onChange");
3894
- return;
3895
- }
3896
- const maximum = checkboxGroup ? checkboxGroup.checkedCount.value >= Number(checkboxGroup.max.value) : false;
3897
- if (!checked.value && maximum) return;
3898
- change(checked.value ? uncheckedValue : checkedValue2);
3909
+ return __async$24(this, null, function* () {
3910
+ const { disabled, readonly, checkedValue: checkedValue2, uncheckedValue, onClick } = props2;
3911
+ if ((form == null ? void 0 : form.disabled.value) || disabled) return;
3912
+ call(onClick, e);
3913
+ if ((form == null ? void 0 : form.readonly.value) || readonly) return;
3914
+ if (isIndeterminate.value === true) {
3915
+ isIndeterminate.value = false;
3916
+ yield (0, vue.nextTick)();
3917
+ call(props2.onChange, value.value, isIndeterminate.value);
3918
+ validateWithTrigger("onChange");
3919
+ return;
3920
+ }
3921
+ const maximum = checkboxGroup ? checkboxGroup.checkedCount.value >= Number(checkboxGroup.max.value) : false;
3922
+ if (!checked.value && maximum) return;
3923
+ change(checked.value ? uncheckedValue : checkedValue2);
3924
+ });
3899
3925
  }
3900
3926
  function handleTextClick() {
3901
3927
  checkbox.value.focus();
@@ -3998,7 +4024,7 @@ function useMenuSelect() {
3998
4024
  }
3999
4025
  //#endregion
4000
4026
  //#region es/menu-option/MenuOption.mjs
4001
- var __async$22 = (__this, __arguments, generator) => {
4027
+ var __async$23 = (__this, __arguments, generator) => {
4002
4028
  return new Promise((resolve, reject) => {
4003
4029
  var fulfilled = (value) => {
4004
4030
  try {
@@ -4154,7 +4180,7 @@ var __sfc__$94 = (0, vue.defineComponent)({
4154
4180
  }
4155
4181
  }
4156
4182
  function handleSelect() {
4157
- return __async$22(this, null, function* () {
4183
+ return __async$23(this, null, function* () {
4158
4184
  yield (0, vue.nextTick)();
4159
4185
  onSelect(menuOptionProvider);
4160
4186
  });
@@ -5351,7 +5377,7 @@ var __spreadValues$35 = (a, b) => {
5351
5377
  return a;
5352
5378
  };
5353
5379
  var __spreadProps$18 = (a, b) => __defProps$18(a, __getOwnPropDescs$18(b));
5354
- var __async$21 = (__this, __arguments, generator) => {
5380
+ var __async$22 = (__this, __arguments, generator) => {
5355
5381
  return new Promise((resolve, reject) => {
5356
5382
  var fulfilled = (value) => {
5357
5383
  try {
@@ -5464,7 +5490,7 @@ function usePopover(options) {
5464
5490
  open();
5465
5491
  }
5466
5492
  function handleReferenceMouseleave() {
5467
- return __async$21(this, null, function* () {
5493
+ return __async$22(this, null, function* () {
5468
5494
  if (options.trigger !== "hover") return;
5469
5495
  enterReference = false;
5470
5496
  yield doubleRaf();
@@ -5478,7 +5504,7 @@ function usePopover(options) {
5478
5504
  if (options.cascadeOptimization) allowClose = false;
5479
5505
  }
5480
5506
  function handlePopoverMouseleave() {
5481
- return __async$21(this, null, function* () {
5507
+ return __async$22(this, null, function* () {
5482
5508
  if (options.trigger !== "hover") return;
5483
5509
  enterPopover = false;
5484
5510
  yield doubleRaf();
@@ -5885,7 +5911,7 @@ var __spreadValues$33 = (a, b) => {
5885
5911
  }
5886
5912
  return a;
5887
5913
  };
5888
- var __async$20 = (__this, __arguments, generator) => {
5914
+ var __async$21 = (__this, __arguments, generator) => {
5889
5915
  return new Promise((resolve, reject) => {
5890
5916
  var fulfilled = (value) => {
5891
5917
  try {
@@ -6028,7 +6054,7 @@ var __sfc__$92 = (0, vue.defineComponent)({
6028
6054
  if (!value) show.value = false;
6029
6055
  }, { immediate: true });
6030
6056
  function handleArrowRight(key) {
6031
- return __async$20(this, null, function* () {
6057
+ return __async$21(this, null, function* () {
6032
6058
  var _a;
6033
6059
  call(props.onKeyArrowX, key);
6034
6060
  if (key !== "ArrowRight") return;
@@ -6491,7 +6517,7 @@ var props$93 = __spreadValues$31({
6491
6517
  ]));
6492
6518
  //#endregion
6493
6519
  //#region es/auto-complete/AutoComplete.mjs
6494
- var __async$19 = (__this, __arguments, generator) => {
6520
+ var __async$20 = (__this, __arguments, generator) => {
6495
6521
  return new Promise((resolve, reject) => {
6496
6522
  var fulfilled = (value) => {
6497
6523
  try {
@@ -6695,7 +6721,7 @@ var __sfc__$90 = (0, vue.defineComponent)({
6695
6721
  });
6696
6722
  }
6697
6723
  function handleKeydown(event) {
6698
- return __async$19(this, null, function* () {
6724
+ return __async$20(this, null, function* () {
6699
6725
  var _a;
6700
6726
  if ((form == null ? void 0 : form.disabled.value) || (form == null ? void 0 : form.readonly.value) || props2.disabled || props2.readonly || !isFocusing.value || !isShowMenuSelect.value) return;
6701
6727
  const { key } = event;
@@ -6744,7 +6770,7 @@ var __sfc__$90 = (0, vue.defineComponent)({
6744
6770
  validateWithTrigger("onChange");
6745
6771
  }
6746
6772
  function handleAutoComplete(newValue) {
6747
- return __async$19(this, null, function* () {
6773
+ return __async$20(this, null, function* () {
6748
6774
  var _a;
6749
6775
  if (props2.maxlength != null) newValue = newValue.slice(0, toNumber(props2.maxlength));
6750
6776
  if (newValue !== value.value) {
@@ -6857,7 +6883,7 @@ var __spreadValues$30 = (a, b) => {
6857
6883
  }
6858
6884
  return a;
6859
6885
  };
6860
- var __async$18 = (__this, __arguments, generator) => {
6886
+ var __async$19 = (__this, __arguments, generator) => {
6861
6887
  return new Promise((resolve, reject) => {
6862
6888
  var fulfilled = (value) => {
6863
6889
  try {
@@ -6984,7 +7010,7 @@ function attemptLoad(el) {
6984
7010
  createImage(el, attemptSRC);
6985
7011
  }
6986
7012
  function check(el) {
6987
- return __async$18(this, null, function* () {
7013
+ return __async$19(this, null, function* () {
6988
7014
  yield doubleRaf();
6989
7015
  if (inViewport(el)) attemptLoad(el);
6990
7016
  });
@@ -6993,7 +7019,7 @@ function checkAll() {
6993
7019
  lazyElements.forEach((el) => check(el));
6994
7020
  }
6995
7021
  function add$2(el) {
6996
- return __async$18(this, null, function* () {
7022
+ return __async$19(this, null, function* () {
6997
7023
  !lazyElements.includes(el) && lazyElements.push(el);
6998
7024
  getAllParentScroller(el).forEach(bindEvents);
6999
7025
  yield check(el);
@@ -7008,13 +7034,13 @@ function diff(el, binding) {
7008
7034
  return src !== binding.value || arg !== binding.arg;
7009
7035
  }
7010
7036
  function mounted(el, binding) {
7011
- return __async$18(this, null, function* () {
7037
+ return __async$19(this, null, function* () {
7012
7038
  createLazy(el, binding);
7013
7039
  yield add$2(el);
7014
7040
  });
7015
7041
  }
7016
7042
  function updated(el, binding) {
7017
- return __async$18(this, null, function* () {
7043
+ return __async$19(this, null, function* () {
7018
7044
  if (!diff(el, binding)) {
7019
7045
  lazyElements.includes(el) && (yield check(el));
7020
7046
  return;
@@ -8319,7 +8345,7 @@ var props$13 = {
8319
8345
  };
8320
8346
  //#endregion
8321
8347
  //#region es/card/Card.mjs
8322
- var __async$17 = (__this, __arguments, generator) => {
8348
+ var __async$18 = (__this, __arguments, generator) => {
8323
8349
  return new Promise((resolve, reject) => {
8324
8350
  var fulfilled = (value) => {
8325
8351
  try {
@@ -8501,7 +8527,7 @@ var __sfc__$78 = (0, vue.defineComponent)({
8501
8527
  clearTimeout(floater.value);
8502
8528
  clearTimeout(dropper);
8503
8529
  floater.value = null;
8504
- floater.value = setTimeout(() => __async$17(null, null, function* () {
8530
+ floater.value = setTimeout(() => __async$18(null, null, function* () {
8505
8531
  const { width, height, left, top } = getRect(card.value);
8506
8532
  holderWidth.value = toSizeUnit(width);
8507
8533
  holderHeight.value = toSizeUnit(height);
@@ -8975,7 +9001,7 @@ var props$18 = {
8975
9001
  };
8976
9002
  //#endregion
8977
9003
  //#region es/code/Code.mjs
8978
- var __async$16 = (__this, __arguments, generator) => {
9004
+ var __async$17 = (__this, __arguments, generator) => {
8979
9005
  return new Promise((resolve, reject) => {
8980
9006
  var fulfilled = (value) => {
8981
9007
  try {
@@ -9019,7 +9045,7 @@ var __sfc__$74 = (0, vue.defineComponent)({
9019
9045
  props2.language,
9020
9046
  normalizedTheme.value,
9021
9047
  props2.trim
9022
- ], (_0) => __async$16(null, [_0], function* ([highlighter2, code, lang = "", theme2 = "", trim]) {
9048
+ ], (_0) => __async$17(null, [_0], function* ([highlighter2, code, lang = "", theme2 = "", trim]) {
9023
9049
  if (!highlighter2) return;
9024
9050
  highlightedCode.value = yield highlighter2.codeToHtml(trim ? code.trim() : code, {
9025
9051
  lang,
@@ -9304,7 +9330,7 @@ var _CollapseComponent = stdin_default$407;
9304
9330
  var stdin_default$21 = stdin_default$407;
9305
9331
  //#endregion
9306
9332
  //#region es/collapse-transition/useCollapseTransition.mjs
9307
- var __async$15 = (__this, __arguments, generator) => {
9333
+ var __async$16 = (__this, __arguments, generator) => {
9308
9334
  return new Promise((resolve, reject) => {
9309
9335
  var fulfilled = (value) => {
9310
9336
  try {
@@ -9339,7 +9365,7 @@ function useCollapseTransition(options) {
9339
9365
  return version === transitionVersion;
9340
9366
  }
9341
9367
  function open(version) {
9342
- return __async$15(this, null, function* () {
9368
+ return __async$16(this, null, function* () {
9343
9369
  if (!contentEl.value) return;
9344
9370
  contentEl.value.style.height = "";
9345
9371
  showContent.value = true;
@@ -9355,7 +9381,7 @@ function useCollapseTransition(options) {
9355
9381
  if (isInitToTrigger && isLatestTransition(version)) handleTransitionEnd();
9356
9382
  });
9357
9383
  }
9358
- const close = (version) => __async$15(null, null, function* () {
9384
+ const close = (version) => __async$16(null, null, function* () {
9359
9385
  if (!contentEl.value) return;
9360
9386
  const { offsetHeight } = contentEl.value;
9361
9387
  contentEl.value.style.height = offsetHeight + "px";
@@ -12394,6 +12420,26 @@ function useRadioGroup() {
12394
12420
  }
12395
12421
  //#endregion
12396
12422
  //#region es/radio/Radio.mjs
12423
+ var __async$15 = (__this, __arguments, generator) => {
12424
+ return new Promise((resolve, reject) => {
12425
+ var fulfilled = (value) => {
12426
+ try {
12427
+ step(generator.next(value));
12428
+ } catch (e) {
12429
+ reject(e);
12430
+ }
12431
+ };
12432
+ var rejected = (value) => {
12433
+ try {
12434
+ step(generator.throw(value));
12435
+ } catch (e) {
12436
+ reject(e);
12437
+ }
12438
+ };
12439
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
12440
+ step((generator = generator.apply(__this, __arguments)).next());
12441
+ });
12442
+ };
12397
12443
  var { name: name$56, n: n$67, classes: classes$55 } = createNamespace("radio");
12398
12444
  var _hoisted_1$30 = [
12399
12445
  "aria-checked",
@@ -12516,12 +12562,15 @@ var __sfc__$65 = (0, vue.defineComponent)({
12516
12562
  });
12517
12563
  }
12518
12564
  function change(changedValue) {
12519
- const { checkedValue, onChange } = props2;
12520
- if (radioGroup && value.value === checkedValue) return;
12521
- value.value = changedValue;
12522
- call(onChange, value.value);
12523
- radioGroup?.onToggle(checkedValue);
12524
- validateWithTrigger("onChange");
12565
+ return __async$15(this, null, function* () {
12566
+ const { checkedValue, onChange } = props2;
12567
+ if (radioGroup && value.value === checkedValue) return;
12568
+ value.value = changedValue;
12569
+ radioGroup?.onToggle(checkedValue);
12570
+ yield (0, vue.nextTick)();
12571
+ call(onChange, changedValue);
12572
+ validateWithTrigger("onChange");
12573
+ });
12525
12574
  }
12526
12575
  function handleClick(e) {
12527
12576
  const { disabled, readonly, uncheckedValue, checkedValue, onClick } = props2;
@@ -23778,8 +23827,8 @@ var __sfc__$16 = (0, vue.defineComponent)({
23778
23827
  item.handleHovering(value);
23779
23828
  }
23780
23829
  function emitChange(value) {
23781
- call(props2.onChange, value);
23782
23830
  call(props2["onUpdate:modelValue"], value);
23831
+ call(props2.onChange, value);
23783
23832
  validateWithTrigger();
23784
23833
  }
23785
23834
  function setPercent(moveDistance, type) {
@@ -24865,8 +24914,8 @@ var __sfc__$11 = (0, vue.defineComponent)({
24865
24914
  validateWithTrigger("onLazyChange");
24866
24915
  });
24867
24916
  else {
24868
- call(onChange, newValue);
24869
24917
  call(updateModelValue, newValue);
24918
+ call(onChange, newValue);
24870
24919
  validateWithTrigger("onChange");
24871
24920
  }
24872
24921
  }
@@ -31273,7 +31322,7 @@ var _WatermarkComponent = stdin_default$106;
31273
31322
  var stdin_default$100 = stdin_default$106;
31274
31323
  //#endregion
31275
31324
  //#region es/index.bundle.mjs
31276
- var version = "3.18.1";
31325
+ var version = "3.18.2";
31277
31326
  function install(app) {
31278
31327
  stdin_default.install && app.use(stdin_default);
31279
31328
  stdin_default$1.install && app.use(stdin_default$1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "3.18.1",
3
+ "version": "3.18.2",
4
4
  "description": "A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.",
5
5
  "keywords": [
6
6
  "Vue3",
@@ -44,9 +44,9 @@
44
44
  "@popperjs/core": "^2.11.6",
45
45
  "dayjs": "^1.10.4",
46
46
  "decimal.js": "^10.2.1",
47
- "@varlet/icons": "3.18.1",
48
- "@varlet/shared": "3.18.1",
49
- "@varlet/use": "3.18.1"
47
+ "@varlet/icons": "3.18.2",
48
+ "@varlet/use": "3.18.2",
49
+ "@varlet/shared": "3.18.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^20.19.0",
@@ -62,9 +62,9 @@
62
62
  "vue": "3.5.21",
63
63
  "vue-router": "4.5.1",
64
64
  "zod": "^3.23.8",
65
- "@varlet/ui": "3.18.1",
66
- "@varlet/touch-emulator": "3.18.1",
67
- "@varlet/cli": "3.18.1"
65
+ "@varlet/touch-emulator": "3.18.2",
66
+ "@varlet/cli": "3.18.2",
67
+ "@varlet/ui": "3.18.2"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "vue": "^3.2.0"