dfish-widget 1.0.61 → 1.0.63

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/index.esm.js CHANGED
@@ -5467,7 +5467,7 @@ var script$O = /*#__PURE__*/Object.assign(__default__$1, {
5467
5467
  }
5468
5468
  },
5469
5469
  current: {
5470
- type: [String, Number]
5470
+ type: [String, Number, Array]
5471
5471
  },
5472
5472
  itemHeight: {
5473
5473
  type: [String, Number],
@@ -5553,7 +5553,7 @@ const props = __props;
5553
5553
  };
5554
5554
 
5555
5555
  const isCurrent = (item) => {
5556
- return props.current === item[propValue]
5556
+ return Array.isArray(props.current) ? props.current.includes(item[propValue]) : (props.current === item[propValue])
5557
5557
  };
5558
5558
 
5559
5559
  const clickItem = (e, item) => {
@@ -5699,14 +5699,19 @@ const props = __props;
5699
5699
  const watchCurrent = async (val) => {
5700
5700
  await nextTick();
5701
5701
  current = val;
5702
- if (!showList.value.find(n => n[propValue] === val)) {
5703
- const item = expandTo(val);
5704
- const i = flatList.value.indexOf(item);
5705
- if (i > -1) {
5706
- await nextTick();
5707
- wrap.value.scrollToY(((i + 1) * itemHeight) - (flow.value.height / 2));
5702
+ if (!val) return
5703
+ val = $$1.array(val);
5704
+ for (let v of val) {
5705
+ if (!showList.value.find(n => v == n[propValue])) {
5706
+ expandTo(v);
5708
5707
  }
5709
5708
  }
5709
+ const item = find(val[0]);
5710
+ const i = flatList.value.indexOf(item);
5711
+ if (i > -1) {
5712
+ await nextTick();
5713
+ wrap.value.scrollToY(((i + 1) * itemHeight) - (flow.value.height / 2));
5714
+ }
5710
5715
  };
5711
5716
 
5712
5717
  onMounted(async () => {
@@ -6648,6 +6653,7 @@ const props = __props;
6648
6653
  };
6649
6654
 
6650
6655
  const find = (id, children) => {
6656
+ if (id && id[leafSymbol]) return id
6651
6657
  if (!children) children = props.children;
6652
6658
  for (let item of children) {
6653
6659
  if (item[propValue] === id) return item
@@ -6712,14 +6718,17 @@ const props = __props;
6712
6718
  current = val;
6713
6719
  if (!val) return
6714
6720
  val = $$1.array(val);
6715
- if (!showList.value.find(n => val.includes(n[propValue]))) {
6716
- const item = expandTo(val[0]);
6717
- const i = flatList.value.indexOf(item);
6718
- if (i > -1) {
6719
- await nextTick();
6720
- root.value.scrollToY(((i + 1) * itemHeight) - (flow.value.height / 2));
6721
+ for (let v of val) {
6722
+ if (!showList.value.find(n => v == n[propValue])) {
6723
+ expandTo(v);
6721
6724
  }
6722
6725
  }
6726
+ const item = find(val[0]);
6727
+ const i = flatList.value.indexOf(item);
6728
+ if (i > -1) {
6729
+ await nextTick();
6730
+ root.value.scrollToY(((i + 1) * itemHeight) - (flow.value.height / 2));
6731
+ }
6723
6732
  };
6724
6733
 
6725
6734
  onMounted(async () => {