zartui 3.1.30 → 3.1.32

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/zartui.cjs.js CHANGED
@@ -9531,7 +9531,7 @@ var stdin_default$$ = vue.defineComponent({
9531
9531
  name: name$H,
9532
9532
  inheritAttrs: false,
9533
9533
  props: dropdownItemProps,
9534
- emits: ["open", "opened", "close", "closed", "change", "update:modelValue", "reset", "confirm"],
9534
+ emits: ["open", "opened", "close", "closed", "change", "update:modelValue", "reset", "confirm", "item-select"],
9535
9535
  setup(props, {
9536
9536
  emit,
9537
9537
  slots,
@@ -9644,21 +9644,25 @@ var stdin_default$$ = vue.defineComponent({
9644
9644
  }
9645
9645
  const onClick = () => {
9646
9646
  if (props.multiSelect) {
9647
+ let isCancelSelect = true;
9647
9648
  if (option.selected) {
9648
9649
  modelArray.splice(modelArray.indexOf(value), 1);
9649
9650
  emit("update:modelValue", -value);
9650
9651
  emit("change", -value);
9651
9652
  } else {
9652
9653
  modelArray.push(value);
9654
+ isCancelSelect = false;
9653
9655
  emit("update:modelValue", value);
9654
9656
  emit("change", value);
9655
9657
  }
9658
+ emit("item-select", value, isCancelSelect);
9656
9659
  } else {
9657
9660
  state.showPopup = false;
9658
9661
  if (option.value !== props.modelValue) {
9659
9662
  emit("update:modelValue", value);
9660
9663
  emit("change", value);
9661
9664
  }
9665
+ emit("item-select", value);
9662
9666
  }
9663
9667
  };
9664
9668
  const renderIcon = () => {
@@ -9801,10 +9805,15 @@ var stdin_default$$ = vue.defineComponent({
9801
9805
  }
9802
9806
  })]), [[vue.vShow, state.showWrapper]]);
9803
9807
  };
9808
+ const updateInnerValue = (updateValue = []) => {
9809
+ modelArray.splice(0);
9810
+ modelArray.push(...updateValue);
9811
+ };
9804
9812
  useExpose({
9805
9813
  state,
9806
9814
  toggle,
9807
- renderTitle
9815
+ renderTitle,
9816
+ updateInnerValue
9808
9817
  });
9809
9818
  return () => {
9810
9819
  if (props.teleport) {
@@ -20554,7 +20563,7 @@ const Lazyload = {
20554
20563
  });
20555
20564
  }
20556
20565
  };
20557
- const version = "3.1.30";
20566
+ const version = "3.1.32";
20558
20567
  function install(app) {
20559
20568
  const components = [
20560
20569
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -9529,7 +9529,7 @@ var stdin_default$$ = defineComponent({
9529
9529
  name: name$H,
9530
9530
  inheritAttrs: false,
9531
9531
  props: dropdownItemProps,
9532
- emits: ["open", "opened", "close", "closed", "change", "update:modelValue", "reset", "confirm"],
9532
+ emits: ["open", "opened", "close", "closed", "change", "update:modelValue", "reset", "confirm", "item-select"],
9533
9533
  setup(props, {
9534
9534
  emit,
9535
9535
  slots,
@@ -9642,21 +9642,25 @@ var stdin_default$$ = defineComponent({
9642
9642
  }
9643
9643
  const onClick = () => {
9644
9644
  if (props.multiSelect) {
9645
+ let isCancelSelect = true;
9645
9646
  if (option.selected) {
9646
9647
  modelArray.splice(modelArray.indexOf(value), 1);
9647
9648
  emit("update:modelValue", -value);
9648
9649
  emit("change", -value);
9649
9650
  } else {
9650
9651
  modelArray.push(value);
9652
+ isCancelSelect = false;
9651
9653
  emit("update:modelValue", value);
9652
9654
  emit("change", value);
9653
9655
  }
9656
+ emit("item-select", value, isCancelSelect);
9654
9657
  } else {
9655
9658
  state.showPopup = false;
9656
9659
  if (option.value !== props.modelValue) {
9657
9660
  emit("update:modelValue", value);
9658
9661
  emit("change", value);
9659
9662
  }
9663
+ emit("item-select", value);
9660
9664
  }
9661
9665
  };
9662
9666
  const renderIcon = () => {
@@ -9799,10 +9803,15 @@ var stdin_default$$ = defineComponent({
9799
9803
  }
9800
9804
  })]), [[vShow, state.showWrapper]]);
9801
9805
  };
9806
+ const updateInnerValue = (updateValue = []) => {
9807
+ modelArray.splice(0);
9808
+ modelArray.push(...updateValue);
9809
+ };
9802
9810
  useExpose({
9803
9811
  state,
9804
9812
  toggle,
9805
- renderTitle
9813
+ renderTitle,
9814
+ updateInnerValue
9806
9815
  });
9807
9816
  return () => {
9808
9817
  if (props.teleport) {
@@ -20552,7 +20561,7 @@ const Lazyload = {
20552
20561
  });
20553
20562
  }
20554
20563
  };
20555
- const version = "3.1.30";
20564
+ const version = "3.1.32";
20556
20565
  function install(app) {
20557
20566
  const components = [
20558
20567
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -9775,7 +9775,7 @@
9775
9775
  name: name$H,
9776
9776
  inheritAttrs: false,
9777
9777
  props: dropdownItemProps,
9778
- emits: ["open", "opened", "close", "closed", "change", "update:modelValue", "reset", "confirm"],
9778
+ emits: ["open", "opened", "close", "closed", "change", "update:modelValue", "reset", "confirm", "item-select"],
9779
9779
  setup(props, {
9780
9780
  emit,
9781
9781
  slots,
@@ -9885,21 +9885,25 @@
9885
9885
  }
9886
9886
  const onClick = () => {
9887
9887
  if (props.multiSelect) {
9888
+ let isCancelSelect = true;
9888
9889
  if (option.selected) {
9889
9890
  modelArray.splice(modelArray.indexOf(value), 1);
9890
9891
  emit("update:modelValue", -value);
9891
9892
  emit("change", -value);
9892
9893
  } else {
9893
9894
  modelArray.push(value);
9895
+ isCancelSelect = false;
9894
9896
  emit("update:modelValue", value);
9895
9897
  emit("change", value);
9896
9898
  }
9899
+ emit("item-select", value, isCancelSelect);
9897
9900
  } else {
9898
9901
  state.showPopup = false;
9899
9902
  if (option.value !== props.modelValue) {
9900
9903
  emit("update:modelValue", value);
9901
9904
  emit("change", value);
9902
9905
  }
9906
+ emit("item-select", value);
9903
9907
  }
9904
9908
  };
9905
9909
  const renderIcon = () => {
@@ -10042,10 +10046,15 @@
10042
10046
  }
10043
10047
  })]), [[vue.vShow, state.showWrapper]]);
10044
10048
  };
10049
+ const updateInnerValue = (updateValue = []) => {
10050
+ modelArray.splice(0);
10051
+ modelArray.push(...updateValue);
10052
+ };
10045
10053
  useExpose({
10046
10054
  state,
10047
10055
  toggle,
10048
- renderTitle
10056
+ renderTitle,
10057
+ updateInnerValue
10049
10058
  });
10050
10059
  return () => {
10051
10060
  if (props.teleport) {
@@ -17870,10 +17879,9 @@
17870
17879
  crossAxis: 0,
17871
17880
  alignmentAxis: null
17872
17881
  } : {
17873
- mainAxis: 0,
17874
- crossAxis: 0,
17875
- alignmentAxis: null,
17876
- ...rawValue
17882
+ mainAxis: rawValue.mainAxis || 0,
17883
+ crossAxis: rawValue.crossAxis || 0,
17884
+ alignmentAxis: rawValue.alignmentAxis
17877
17885
  };
17878
17886
  if (alignment && typeof alignmentAxis === "number") {
17879
17887
  crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
@@ -17978,7 +17986,11 @@
17978
17986
  ...limitedCoords,
17979
17987
  data: {
17980
17988
  x: limitedCoords.x - x,
17981
- y: limitedCoords.y - y
17989
+ y: limitedCoords.y - y,
17990
+ enabled: {
17991
+ [mainAxis]: checkMainAxis,
17992
+ [crossAxis]: checkCrossAxis
17993
+ }
17982
17994
  }
17983
17995
  };
17984
17996
  }
@@ -18049,6 +18061,9 @@
18049
18061
  }
18050
18062
  };
18051
18063
  };
18064
+ function hasWindow() {
18065
+ return typeof window !== "undefined";
18066
+ }
18052
18067
  function getNodeName$1(node) {
18053
18068
  if (isNode(node)) {
18054
18069
  return (node.nodeName || "").toLowerCase();
@@ -18064,16 +18079,25 @@
18064
18079
  return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
18065
18080
  }
18066
18081
  function isNode(value) {
18082
+ if (!hasWindow()) {
18083
+ return false;
18084
+ }
18067
18085
  return value instanceof Node || value instanceof getWindow$1(value).Node;
18068
18086
  }
18069
18087
  function isElement$1(value) {
18088
+ if (!hasWindow()) {
18089
+ return false;
18090
+ }
18070
18091
  return value instanceof Element || value instanceof getWindow$1(value).Element;
18071
18092
  }
18072
18093
  function isHTMLElement$1(value) {
18094
+ if (!hasWindow()) {
18095
+ return false;
18096
+ }
18073
18097
  return value instanceof HTMLElement || value instanceof getWindow$1(value).HTMLElement;
18074
18098
  }
18075
18099
  function isShadowRoot$1(value) {
18076
- if (typeof ShadowRoot === "undefined") {
18100
+ if (!hasWindow() || typeof ShadowRoot === "undefined") {
18077
18101
  return false;
18078
18102
  }
18079
18103
  return value instanceof ShadowRoot || value instanceof getWindow$1(value).ShadowRoot;
@@ -18340,8 +18364,12 @@
18340
18364
  function getClientRects(element) {
18341
18365
  return Array.from(element.getClientRects());
18342
18366
  }
18343
- function getWindowScrollBarX$1(element) {
18344
- return getBoundingClientRect$1(getDocumentElement$1(element)).left + getNodeScroll$1(element).scrollLeft;
18367
+ function getWindowScrollBarX$1(element, rect) {
18368
+ const leftScroll = getNodeScroll$1(element).scrollLeft;
18369
+ if (!rect) {
18370
+ return getBoundingClientRect$1(getDocumentElement$1(element)).left + leftScroll;
18371
+ }
18372
+ return rect.left + leftScroll;
18345
18373
  }
18346
18374
  function getDocumentRect(element) {
18347
18375
  const html = getDocumentElement$1(element);
@@ -18509,8 +18537,16 @@
18509
18537
  offsets.x = getWindowScrollBarX$1(documentElement);
18510
18538
  }
18511
18539
  }
18512
- const x = rect.left + scroll.scrollLeft - offsets.x;
18513
- const y = rect.top + scroll.scrollTop - offsets.y;
18540
+ let htmlX = 0;
18541
+ let htmlY = 0;
18542
+ if (documentElement && !isOffsetParentAnElement && !isFixed) {
18543
+ const htmlRect = documentElement.getBoundingClientRect();
18544
+ htmlY = htmlRect.top + scroll.scrollTop;
18545
+ htmlX = htmlRect.left + scroll.scrollLeft - // RTL <body> scrollbar.
18546
+ getWindowScrollBarX$1(documentElement, htmlRect);
18547
+ }
18548
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlX;
18549
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlY;
18514
18550
  return {
18515
18551
  x,
18516
18552
  y,
@@ -18528,7 +18564,11 @@
18528
18564
  if (polyfill) {
18529
18565
  return polyfill(element);
18530
18566
  }
18531
- return element.offsetParent;
18567
+ let rawOffsetParent = element.offsetParent;
18568
+ if (getDocumentElement$1(element) === rawOffsetParent) {
18569
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
18570
+ }
18571
+ return rawOffsetParent;
18532
18572
  }
18533
18573
  function getOffsetParent$1(element, polyfill) {
18534
18574
  const win = getWindow$1(element);
@@ -24583,7 +24623,7 @@
24583
24623
  });
24584
24624
  }
24585
24625
  };
24586
- const version = "3.1.30";
24626
+ const version = "3.1.32";
24587
24627
  function install(app) {
24588
24628
  const components = [
24589
24629
  ActionSheet,