zartui 3.1.26 → 3.1.28

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
@@ -11855,6 +11855,10 @@ var stdin_default$S = vue.defineComponent({
11855
11855
  }
11856
11856
  return props.asyncGetter && (item == null ? void 0 : item.children) || !props.asyncGetter && ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length);
11857
11857
  };
11858
+ const getToSubDisabled = (item) => {
11859
+ var _a;
11860
+ return item.disabled || !props.asyncGetter && (!item.children || ((_a = item.children) == null ? void 0 : _a.length) === 0);
11861
+ };
11858
11862
  function adapterHierarchTree(root, emitChange = true) {
11859
11863
  if (!props.unanimous)
11860
11864
  return;
@@ -11918,7 +11922,7 @@ var stdin_default$S = vue.defineComponent({
11918
11922
  toNextLevel(item, index);
11919
11923
  }
11920
11924
  }, [showSub(item) && vue.createVNode("div", {
11921
- "class": bem$A("sub-level", getChecked(item) ? "disable" : "")
11925
+ "class": bem$A("sub-level", getChecked(item) || getToSubDisabled(item) ? "disable" : "")
11922
11926
  }, [vue.createVNode("span", {
11923
11927
  "class": bem$A("sub-icon")
11924
11928
  }, [SubIcon(bem$A)]), vue.createVNode("span", null, [vue.createTextVNode("下级")])])])]))]);
@@ -14580,9 +14584,8 @@ var stdin_default$z = vue.defineComponent({
14580
14584
  slots
14581
14585
  }) {
14582
14586
  const currentOptions2 = vue.ref(props.options);
14583
- vue.watch(props.options, (newVal) => {
14584
- currentOptions2.value = newVal;
14585
- });
14587
+ const currentSelectedIndex = vue.computed(() => props.selectedIndex);
14588
+ const currentSelectedValue = vue.computed(() => props.selectedValue);
14586
14589
  const confirmIndexes = vue.ref(props.selectedIndex);
14587
14590
  const confirmValues = vue.ref(props.selectedValue);
14588
14591
  const resetOptions = (props2) => {
@@ -14634,8 +14637,8 @@ var stdin_default$z = vue.defineComponent({
14634
14637
  if (newValue !== props.showPicker) {
14635
14638
  emit("update:showPicker", newValue);
14636
14639
  }
14637
- confirmIndexes.value = deepClone(props.selectedIndex);
14638
- confirmValues.value = deepClone(props.selectedValue);
14640
+ confirmIndexes.value = deepClone(currentSelectedIndex.value);
14641
+ confirmValues.value = deepClone(currentSelectedValue.value);
14639
14642
  getIndexesByValues();
14640
14643
  });
14641
14644
  vue.watch(() => props.showPicker, (newValue) => {
@@ -20542,7 +20545,7 @@ const Lazyload = {
20542
20545
  });
20543
20546
  }
20544
20547
  };
20545
- const version = "3.1.26";
20548
+ const version = "3.1.28";
20546
20549
  function install(app) {
20547
20550
  const components = [
20548
20551
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -11853,6 +11853,10 @@ var stdin_default$S = defineComponent({
11853
11853
  }
11854
11854
  return props.asyncGetter && (item == null ? void 0 : item.children) || !props.asyncGetter && ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length);
11855
11855
  };
11856
+ const getToSubDisabled = (item) => {
11857
+ var _a;
11858
+ return item.disabled || !props.asyncGetter && (!item.children || ((_a = item.children) == null ? void 0 : _a.length) === 0);
11859
+ };
11856
11860
  function adapterHierarchTree(root, emitChange = true) {
11857
11861
  if (!props.unanimous)
11858
11862
  return;
@@ -11916,7 +11920,7 @@ var stdin_default$S = defineComponent({
11916
11920
  toNextLevel(item, index);
11917
11921
  }
11918
11922
  }, [showSub(item) && createVNode("div", {
11919
- "class": bem$A("sub-level", getChecked(item) ? "disable" : "")
11923
+ "class": bem$A("sub-level", getChecked(item) || getToSubDisabled(item) ? "disable" : "")
11920
11924
  }, [createVNode("span", {
11921
11925
  "class": bem$A("sub-icon")
11922
11926
  }, [SubIcon(bem$A)]), createVNode("span", null, [createTextVNode("下级")])])])]))]);
@@ -14578,9 +14582,8 @@ var stdin_default$z = defineComponent({
14578
14582
  slots
14579
14583
  }) {
14580
14584
  const currentOptions2 = ref(props.options);
14581
- watch(props.options, (newVal) => {
14582
- currentOptions2.value = newVal;
14583
- });
14585
+ const currentSelectedIndex = computed(() => props.selectedIndex);
14586
+ const currentSelectedValue = computed(() => props.selectedValue);
14584
14587
  const confirmIndexes = ref(props.selectedIndex);
14585
14588
  const confirmValues = ref(props.selectedValue);
14586
14589
  const resetOptions = (props2) => {
@@ -14632,8 +14635,8 @@ var stdin_default$z = defineComponent({
14632
14635
  if (newValue !== props.showPicker) {
14633
14636
  emit("update:showPicker", newValue);
14634
14637
  }
14635
- confirmIndexes.value = deepClone(props.selectedIndex);
14636
- confirmValues.value = deepClone(props.selectedValue);
14638
+ confirmIndexes.value = deepClone(currentSelectedIndex.value);
14639
+ confirmValues.value = deepClone(currentSelectedValue.value);
14637
14640
  getIndexesByValues();
14638
14641
  });
14639
14642
  watch(() => props.showPicker, (newValue) => {
@@ -20540,7 +20543,7 @@ const Lazyload = {
20540
20543
  });
20541
20544
  }
20542
20545
  };
20543
- const version = "3.1.26";
20546
+ const version = "3.1.28";
20544
20547
  function install(app) {
20545
20548
  const components = [
20546
20549
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -12093,6 +12093,10 @@
12093
12093
  }
12094
12094
  return props.asyncGetter && (item == null ? void 0 : item.children) || !props.asyncGetter && ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length);
12095
12095
  };
12096
+ const getToSubDisabled = (item) => {
12097
+ var _a;
12098
+ return item.disabled || !props.asyncGetter && (!item.children || ((_a = item.children) == null ? void 0 : _a.length) === 0);
12099
+ };
12096
12100
  function adapterHierarchTree(root, emitChange = true) {
12097
12101
  if (!props.unanimous)
12098
12102
  return;
@@ -12156,7 +12160,7 @@
12156
12160
  toNextLevel(item, index);
12157
12161
  }
12158
12162
  }, [showSub(item) && vue.createVNode("div", {
12159
- "class": bem$A("sub-level", getChecked(item) ? "disable" : "")
12163
+ "class": bem$A("sub-level", getChecked(item) || getToSubDisabled(item) ? "disable" : "")
12160
12164
  }, [vue.createVNode("span", {
12161
12165
  "class": bem$A("sub-icon")
12162
12166
  }, [SubIcon(bem$A)]), vue.createVNode("span", null, [vue.createTextVNode("下级")])])])]))]);
@@ -16325,9 +16329,8 @@
16325
16329
  slots
16326
16330
  }) {
16327
16331
  const currentOptions2 = vue.ref(props.options);
16328
- vue.watch(props.options, (newVal) => {
16329
- currentOptions2.value = newVal;
16330
- });
16332
+ const currentSelectedIndex = vue.computed(() => props.selectedIndex);
16333
+ const currentSelectedValue = vue.computed(() => props.selectedValue);
16331
16334
  const confirmIndexes = vue.ref(props.selectedIndex);
16332
16335
  const confirmValues = vue.ref(props.selectedValue);
16333
16336
  const resetOptions = (props2) => {
@@ -16379,8 +16382,8 @@
16379
16382
  if (newValue !== props.showPicker) {
16380
16383
  emit("update:showPicker", newValue);
16381
16384
  }
16382
- confirmIndexes.value = deepClone(props.selectedIndex);
16383
- confirmValues.value = deepClone(props.selectedValue);
16385
+ confirmIndexes.value = deepClone(currentSelectedIndex.value);
16386
+ confirmValues.value = deepClone(currentSelectedValue.value);
16384
16387
  getIndexesByValues();
16385
16388
  });
16386
16389
  vue.watch(() => props.showPicker, (newValue) => {
@@ -24540,7 +24543,7 @@
24540
24543
  });
24541
24544
  }
24542
24545
  };
24543
- const version = "3.1.26";
24546
+ const version = "3.1.28";
24544
24547
  function install(app) {
24545
24548
  const components = [
24546
24549
  ActionSheet,