vant 4.9.20 → 4.9.21

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/vant.cjs.js CHANGED
@@ -2986,7 +2986,19 @@ var stdin_default$1D = vue.defineComponent({
2986
2986
  }
2987
2987
  });
2988
2988
  const TAB_STATUS_KEY = Symbol();
2989
+ const ALL_TAB_STATUS_KEY = Symbol();
2989
2990
  const useTabStatus = () => vue.inject(TAB_STATUS_KEY, null);
2991
+ const useAllTabStatus = () => vue.inject(ALL_TAB_STATUS_KEY, null);
2992
+ const useProvideTabStatus = (status) => {
2993
+ const allTabStatus = useAllTabStatus();
2994
+ vue.provide(TAB_STATUS_KEY, status);
2995
+ vue.provide(
2996
+ ALL_TAB_STATUS_KEY,
2997
+ vue.computed(() => {
2998
+ return (allTabStatus == null || allTabStatus.value) && status.value;
2999
+ })
3000
+ );
3001
+ };
2990
3002
  const [name$1s, bem$1o] = createNamespace("tab");
2991
3003
  const TabTitle = vue.defineComponent({
2992
3004
  name: name$1s,
@@ -3233,7 +3245,7 @@ var stdin_default$1B = vue.defineComponent({
3233
3245
  parent.setLine();
3234
3246
  parent.scrollIntoView();
3235
3247
  });
3236
- vue.provide(TAB_STATUS_KEY, active);
3248
+ useProvideTabStatus(active);
3237
3249
  useExpose({
3238
3250
  id,
3239
3251
  renderTitle
@@ -5557,7 +5569,7 @@ var stdin_default$1n = vue.defineComponent({
5557
5569
  const direction = vue.computed(() => getParentProp("direction"));
5558
5570
  const iconStyle = vue.computed(() => {
5559
5571
  const checkedColor = props2.checkedColor || getParentProp("checkedColor");
5560
- if (checkedColor && props2.checked && !disabled.value) {
5572
+ if (checkedColor && (props2.checked || props2.indeterminate) && !disabled.value) {
5561
5573
  return {
5562
5574
  borderColor: checkedColor,
5563
5575
  backgroundColor: checkedColor
@@ -10169,13 +10181,7 @@ const floatingBubbleProps = {
10169
10181
  icon: String,
10170
10182
  axis: makeStringProp("y"),
10171
10183
  magnetic: String,
10172
- offset: {
10173
- type: Object,
10174
- default: () => ({
10175
- x: -1,
10176
- y: -1
10177
- })
10178
- },
10184
+ offset: Object,
10179
10185
  teleport: {
10180
10186
  type: [String, Object],
10181
10187
  default: "body"
@@ -10229,8 +10235,8 @@ var stdin_default$S = vue.defineComponent({
10229
10235
  offset
10230
10236
  } = props2;
10231
10237
  state.value = {
10232
- x: offset.x > -1 ? offset.x : windowWidth.value - width - gapX.value,
10233
- y: offset.y > -1 ? offset.y : windowHeight.value - height - gapY.value,
10238
+ x: offset ? offset.x : windowWidth.value - width - gapX.value,
10239
+ y: offset ? offset.y : windowHeight.value - height - gapY.value,
10234
10240
  width,
10235
10241
  height
10236
10242
  };
@@ -11654,7 +11660,7 @@ var stdin_default$J = vue.defineComponent({
11654
11660
  const loading = vue.ref(props2.loading);
11655
11661
  const root = vue.ref();
11656
11662
  const placeholder = vue.ref();
11657
- const tabStatus = useTabStatus();
11663
+ const tabStatus = useAllTabStatus();
11658
11664
  const scrollParent = use.useScrollParent(root);
11659
11665
  const scroller = vue.computed(() => props2.scroller || scrollParent.value);
11660
11666
  const check = () => {
@@ -12854,6 +12860,7 @@ var stdin_default$A = vue.defineComponent({
12854
12860
  props: progressProps,
12855
12861
  setup(props2) {
12856
12862
  const background = vue.computed(() => props2.inactive ? void 0 : props2.color);
12863
+ const format2 = (rate) => Math.min(Math.max(+rate, 0), 100);
12857
12864
  const renderPivot = () => {
12858
12865
  const {
12859
12866
  textColor,
@@ -12861,12 +12868,13 @@ var stdin_default$A = vue.defineComponent({
12861
12868
  pivotColor,
12862
12869
  percentage
12863
12870
  } = props2;
12871
+ const safePercentage = format2(percentage);
12864
12872
  const text = pivotText != null ? pivotText : `${percentage}%`;
12865
12873
  if (props2.showPivot && text) {
12866
12874
  const style = {
12867
12875
  color: textColor,
12868
- left: `${+percentage}%`,
12869
- transform: `translate(-${+percentage}%,-50%)`,
12876
+ left: `${safePercentage}%`,
12877
+ transform: `translate(-${safePercentage}%,-50%)`,
12870
12878
  background: pivotColor || background.value
12871
12879
  };
12872
12880
  return vue.createVNode("span", {
@@ -12883,12 +12891,13 @@ var stdin_default$A = vue.defineComponent({
12883
12891
  percentage,
12884
12892
  strokeWidth
12885
12893
  } = props2;
12894
+ const safePercentage = format2(percentage);
12886
12895
  const rootStyle = {
12887
12896
  background: trackColor,
12888
12897
  height: addUnit(strokeWidth)
12889
12898
  };
12890
12899
  const portionStyle = {
12891
- width: `${percentage}%`,
12900
+ width: `${safePercentage}%`,
12892
12901
  background: background.value
12893
12902
  };
12894
12903
  return vue.createVNode("div", {
@@ -17101,7 +17110,7 @@ const Lazyload = {
17101
17110
  });
17102
17111
  }
17103
17112
  };
17104
- const version = "4.9.20";
17113
+ const version = "4.9.21";
17105
17114
  function install(app) {
17106
17115
  const components = [
17107
17116
  ActionBar,
@@ -17436,6 +17445,8 @@ exports.timePickerProps = timePickerProps;
17436
17445
  exports.toastProps = toastProps;
17437
17446
  exports.treeSelectProps = treeSelectProps;
17438
17447
  exports.uploaderProps = uploaderProps;
17448
+ exports.useAllTabStatus = useAllTabStatus;
17439
17449
  exports.useCurrentLang = useCurrentLang;
17450
+ exports.useTabStatus = useTabStatus;
17440
17451
  exports.version = version;
17441
17452
  exports.watermarkProps = watermarkProps;
package/lib/vant.es.js CHANGED
@@ -2984,7 +2984,19 @@ var stdin_default$1D = defineComponent({
2984
2984
  }
2985
2985
  });
2986
2986
  const TAB_STATUS_KEY = Symbol();
2987
+ const ALL_TAB_STATUS_KEY = Symbol();
2987
2988
  const useTabStatus = () => inject(TAB_STATUS_KEY, null);
2989
+ const useAllTabStatus = () => inject(ALL_TAB_STATUS_KEY, null);
2990
+ const useProvideTabStatus = (status) => {
2991
+ const allTabStatus = useAllTabStatus();
2992
+ provide(TAB_STATUS_KEY, status);
2993
+ provide(
2994
+ ALL_TAB_STATUS_KEY,
2995
+ computed(() => {
2996
+ return (allTabStatus == null || allTabStatus.value) && status.value;
2997
+ })
2998
+ );
2999
+ };
2988
3000
  const [name$1s, bem$1o] = createNamespace("tab");
2989
3001
  const TabTitle = defineComponent({
2990
3002
  name: name$1s,
@@ -3231,7 +3243,7 @@ var stdin_default$1B = defineComponent({
3231
3243
  parent.setLine();
3232
3244
  parent.scrollIntoView();
3233
3245
  });
3234
- provide(TAB_STATUS_KEY, active);
3246
+ useProvideTabStatus(active);
3235
3247
  useExpose({
3236
3248
  id,
3237
3249
  renderTitle
@@ -5555,7 +5567,7 @@ var stdin_default$1n = defineComponent({
5555
5567
  const direction = computed(() => getParentProp("direction"));
5556
5568
  const iconStyle = computed(() => {
5557
5569
  const checkedColor = props2.checkedColor || getParentProp("checkedColor");
5558
- if (checkedColor && props2.checked && !disabled.value) {
5570
+ if (checkedColor && (props2.checked || props2.indeterminate) && !disabled.value) {
5559
5571
  return {
5560
5572
  borderColor: checkedColor,
5561
5573
  backgroundColor: checkedColor
@@ -10167,13 +10179,7 @@ const floatingBubbleProps = {
10167
10179
  icon: String,
10168
10180
  axis: makeStringProp("y"),
10169
10181
  magnetic: String,
10170
- offset: {
10171
- type: Object,
10172
- default: () => ({
10173
- x: -1,
10174
- y: -1
10175
- })
10176
- },
10182
+ offset: Object,
10177
10183
  teleport: {
10178
10184
  type: [String, Object],
10179
10185
  default: "body"
@@ -10227,8 +10233,8 @@ var stdin_default$S = defineComponent({
10227
10233
  offset
10228
10234
  } = props2;
10229
10235
  state.value = {
10230
- x: offset.x > -1 ? offset.x : windowWidth.value - width - gapX.value,
10231
- y: offset.y > -1 ? offset.y : windowHeight.value - height - gapY.value,
10236
+ x: offset ? offset.x : windowWidth.value - width - gapX.value,
10237
+ y: offset ? offset.y : windowHeight.value - height - gapY.value,
10232
10238
  width,
10233
10239
  height
10234
10240
  };
@@ -11652,7 +11658,7 @@ var stdin_default$J = defineComponent({
11652
11658
  const loading = ref(props2.loading);
11653
11659
  const root = ref();
11654
11660
  const placeholder = ref();
11655
- const tabStatus = useTabStatus();
11661
+ const tabStatus = useAllTabStatus();
11656
11662
  const scrollParent = useScrollParent(root);
11657
11663
  const scroller = computed(() => props2.scroller || scrollParent.value);
11658
11664
  const check = () => {
@@ -12852,6 +12858,7 @@ var stdin_default$A = defineComponent({
12852
12858
  props: progressProps,
12853
12859
  setup(props2) {
12854
12860
  const background = computed(() => props2.inactive ? void 0 : props2.color);
12861
+ const format2 = (rate) => Math.min(Math.max(+rate, 0), 100);
12855
12862
  const renderPivot = () => {
12856
12863
  const {
12857
12864
  textColor,
@@ -12859,12 +12866,13 @@ var stdin_default$A = defineComponent({
12859
12866
  pivotColor,
12860
12867
  percentage
12861
12868
  } = props2;
12869
+ const safePercentage = format2(percentage);
12862
12870
  const text = pivotText != null ? pivotText : `${percentage}%`;
12863
12871
  if (props2.showPivot && text) {
12864
12872
  const style = {
12865
12873
  color: textColor,
12866
- left: `${+percentage}%`,
12867
- transform: `translate(-${+percentage}%,-50%)`,
12874
+ left: `${safePercentage}%`,
12875
+ transform: `translate(-${safePercentage}%,-50%)`,
12868
12876
  background: pivotColor || background.value
12869
12877
  };
12870
12878
  return createVNode("span", {
@@ -12881,12 +12889,13 @@ var stdin_default$A = defineComponent({
12881
12889
  percentage,
12882
12890
  strokeWidth
12883
12891
  } = props2;
12892
+ const safePercentage = format2(percentage);
12884
12893
  const rootStyle = {
12885
12894
  background: trackColor,
12886
12895
  height: addUnit(strokeWidth)
12887
12896
  };
12888
12897
  const portionStyle = {
12889
- width: `${percentage}%`,
12898
+ width: `${safePercentage}%`,
12890
12899
  background: background.value
12891
12900
  };
12892
12901
  return createVNode("div", {
@@ -17099,7 +17108,7 @@ const Lazyload = {
17099
17108
  });
17100
17109
  }
17101
17110
  };
17102
- const version = "4.9.20";
17111
+ const version = "4.9.21";
17103
17112
  function install(app) {
17104
17113
  const components = [
17105
17114
  ActionBar,
@@ -17435,7 +17444,9 @@ export {
17435
17444
  toastProps,
17436
17445
  treeSelectProps,
17437
17446
  uploaderProps,
17447
+ useAllTabStatus,
17438
17448
  useCurrentLang,
17449
+ useTabStatus,
17439
17450
  version,
17440
17451
  watermarkProps
17441
17452
  };
package/lib/vant.js CHANGED
@@ -2353,7 +2353,7 @@
2353
2353
  return propRef;
2354
2354
  };
2355
2355
  /**
2356
- * @vue/shared v3.5.16
2356
+ * @vue/shared v3.5.17
2357
2357
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
2358
2358
  * @license MIT
2359
2359
  **/
@@ -3419,7 +3419,19 @@
3419
3419
  }
3420
3420
  });
3421
3421
  const TAB_STATUS_KEY = Symbol();
3422
+ const ALL_TAB_STATUS_KEY = Symbol();
3422
3423
  const useTabStatus = () => vue.inject(TAB_STATUS_KEY, null);
3424
+ const useAllTabStatus = () => vue.inject(ALL_TAB_STATUS_KEY, null);
3425
+ const useProvideTabStatus = (status) => {
3426
+ const allTabStatus = useAllTabStatus();
3427
+ vue.provide(TAB_STATUS_KEY, status);
3428
+ vue.provide(
3429
+ ALL_TAB_STATUS_KEY,
3430
+ vue.computed(() => {
3431
+ return (allTabStatus == null || allTabStatus.value) && status.value;
3432
+ })
3433
+ );
3434
+ };
3423
3435
  const [name$1s, bem$1o] = createNamespace("tab");
3424
3436
  const TabTitle = vue.defineComponent({
3425
3437
  name: name$1s,
@@ -3660,7 +3672,7 @@
3660
3672
  parent.setLine();
3661
3673
  parent.scrollIntoView();
3662
3674
  });
3663
- vue.provide(TAB_STATUS_KEY, active);
3675
+ useProvideTabStatus(active);
3664
3676
  useExpose({
3665
3677
  id,
3666
3678
  renderTitle
@@ -5984,7 +5996,7 @@
5984
5996
  const direction = vue.computed(() => getParentProp("direction"));
5985
5997
  const iconStyle = vue.computed(() => {
5986
5998
  const checkedColor = props2.checkedColor || getParentProp("checkedColor");
5987
- if (checkedColor && props2.checked && !disabled.value) {
5999
+ if (checkedColor && (props2.checked || props2.indeterminate) && !disabled.value) {
5988
6000
  return {
5989
6001
  borderColor: checkedColor,
5990
6002
  backgroundColor: checkedColor
@@ -10570,13 +10582,7 @@
10570
10582
  icon: String,
10571
10583
  axis: makeStringProp("y"),
10572
10584
  magnetic: String,
10573
- offset: {
10574
- type: Object,
10575
- default: () => ({
10576
- x: -1,
10577
- y: -1
10578
- })
10579
- },
10585
+ offset: Object,
10580
10586
  teleport: {
10581
10587
  type: [String, Object],
10582
10588
  default: "body"
@@ -10630,8 +10636,8 @@
10630
10636
  offset
10631
10637
  } = props2;
10632
10638
  state.value = {
10633
- x: offset.x > -1 ? offset.x : windowWidth.value - width - gapX.value,
10634
- y: offset.y > -1 ? offset.y : windowHeight.value - height - gapY.value,
10639
+ x: offset ? offset.x : windowWidth.value - width - gapX.value,
10640
+ y: offset ? offset.y : windowHeight.value - height - gapY.value,
10635
10641
  width,
10636
10642
  height
10637
10643
  };
@@ -12049,7 +12055,7 @@
12049
12055
  const loading = vue.ref(props2.loading);
12050
12056
  const root = vue.ref();
12051
12057
  const placeholder = vue.ref();
12052
- const tabStatus = useTabStatus();
12058
+ const tabStatus = useAllTabStatus();
12053
12059
  const scrollParent = useScrollParent(root);
12054
12060
  const scroller = vue.computed(() => props2.scroller || scrollParent.value);
12055
12061
  const check = () => {
@@ -14000,6 +14006,7 @@
14000
14006
  props: progressProps,
14001
14007
  setup(props2) {
14002
14008
  const background = vue.computed(() => props2.inactive ? void 0 : props2.color);
14009
+ const format2 = (rate) => Math.min(Math.max(+rate, 0), 100);
14003
14010
  const renderPivot = () => {
14004
14011
  const {
14005
14012
  textColor,
@@ -14007,12 +14014,13 @@
14007
14014
  pivotColor,
14008
14015
  percentage
14009
14016
  } = props2;
14017
+ const safePercentage = format2(percentage);
14010
14018
  const text = pivotText != null ? pivotText : `${percentage}%`;
14011
14019
  if (props2.showPivot && text) {
14012
14020
  const style = {
14013
14021
  color: textColor,
14014
- left: `${+percentage}%`,
14015
- transform: `translate(-${+percentage}%,-50%)`,
14022
+ left: `${safePercentage}%`,
14023
+ transform: `translate(-${safePercentage}%,-50%)`,
14016
14024
  background: pivotColor || background.value
14017
14025
  };
14018
14026
  return vue.createVNode("span", {
@@ -14029,12 +14037,13 @@
14029
14037
  percentage,
14030
14038
  strokeWidth
14031
14039
  } = props2;
14040
+ const safePercentage = format2(percentage);
14032
14041
  const rootStyle = {
14033
14042
  background: trackColor,
14034
14043
  height: addUnit(strokeWidth)
14035
14044
  };
14036
14045
  const portionStyle = {
14037
- width: `${percentage}%`,
14046
+ width: `${safePercentage}%`,
14038
14047
  background: background.value
14039
14048
  };
14040
14049
  return vue.createVNode("div", {
@@ -18218,7 +18227,7 @@
18218
18227
  });
18219
18228
  }
18220
18229
  };
18221
- const version = "4.9.20";
18230
+ const version = "4.9.21";
18222
18231
  function install(app) {
18223
18232
  const components = [
18224
18233
  ActionBar,
@@ -18553,7 +18562,9 @@
18553
18562
  exports2.toastProps = toastProps;
18554
18563
  exports2.treeSelectProps = treeSelectProps;
18555
18564
  exports2.uploaderProps = uploaderProps;
18565
+ exports2.useAllTabStatus = useAllTabStatus;
18556
18566
  exports2.useCurrentLang = useCurrentLang;
18567
+ exports2.useTabStatus = useTabStatus;
18557
18568
  exports2.version = version;
18558
18569
  exports2.watermarkProps = watermarkProps;
18559
18570
  Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });