zartui 3.1.66 → 3.1.68

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
@@ -16942,7 +16942,10 @@ const multiplePickerProps = {
16942
16942
  showToolbar: truthProp,
16943
16943
  showTitle: truthProp,
16944
16944
  options: makeArrayProp(),
16945
- filteredOptions: makeArrayProp(),
16945
+ filteredOptions: {
16946
+ type: Array,
16947
+ default: void 0
16948
+ },
16946
16949
  toolbarPosition: makeStringProp("bottom"),
16947
16950
  textKey: makeStringProp("text"),
16948
16951
  columnCounts: makeNumberProp(3),
@@ -16966,7 +16969,7 @@ var stdin_default$A = vue.defineComponent({
16966
16969
  const confirmIndexes = vue.ref(props.selectedIndex);
16967
16970
  const confirmValues = vue.ref(props.selectedValue);
16968
16971
  const displayOptions = vue.computed(() => {
16969
- return props.filteredOptions && props.filteredOptions.length > 0 ? props.filteredOptions : currentOptions2.value;
16972
+ return props.filteredOptions !== void 0 ? props.filteredOptions : currentOptions2.value;
16970
16973
  });
16971
16974
  const displaySelectedIndexes = vue.computed(() => {
16972
16975
  if (!props.filteredOptions || props.filteredOptions.length === 0) {
@@ -17002,22 +17005,22 @@ var stdin_default$A = vue.defineComponent({
17002
17005
  };
17003
17006
  const onUpdateCurrentIndexes = (newVal) => {
17004
17007
  if (props.filteredOptions && props.filteredOptions.length > 0) {
17005
- const selectedValues = newVal.filter((idx) => idx >= 0 && idx < displayOptions.value.length).map((idx) => {
17008
+ const selectedValuesInFiltered = newVal.filter((idx) => idx >= 0 && idx < displayOptions.value.length).map((idx) => {
17006
17009
  var _a;
17007
17010
  return (_a = displayOptions.value[idx]) == null ? void 0 : _a.value;
17008
17011
  });
17009
17012
  const newSelectedIndexes = /* @__PURE__ */ new Set();
17013
+ const filteredValuesSet = new Set(displayOptions.value.map((opt) => opt.value));
17010
17014
  confirmIndexes.value.forEach((idx) => {
17011
17015
  var _a;
17012
17016
  if (idx >= 0 && idx < currentOptions2.value.length) {
17013
17017
  const value = (_a = currentOptions2.value[idx]) == null ? void 0 : _a.value;
17014
- const isInFilteredList = displayOptions.value.some((opt) => opt.value === value);
17015
- if (!isInFilteredList) {
17018
+ if (!filteredValuesSet.has(value)) {
17016
17019
  newSelectedIndexes.add(idx);
17017
17020
  }
17018
17021
  }
17019
17022
  });
17020
- selectedValues.forEach((value) => {
17023
+ selectedValuesInFiltered.forEach((value) => {
17021
17024
  const originalIndex = currentOptions2.value.findIndex((opt) => opt.value === value);
17022
17025
  if (originalIndex >= 0) {
17023
17026
  newSelectedIndexes.add(originalIndex);
@@ -17064,11 +17067,13 @@ var stdin_default$A = vue.defineComponent({
17064
17067
  if (newValue !== props.showPicker) {
17065
17068
  emit("update:showPicker", newValue);
17066
17069
  }
17067
- currentOptions2.value = deepClone(props.options);
17068
- confirmIndexes.value = deepClone(currentSelectedIndex.value);
17069
- confirmValues.value = deepClone(currentSelectedValue.value);
17070
- getIndexesByValues();
17071
- updateAllSelectedOptions();
17070
+ if (newValue) {
17071
+ currentOptions2.value = deepClone(props.options);
17072
+ confirmIndexes.value = deepClone(currentSelectedIndex.value);
17073
+ confirmValues.value = deepClone(currentSelectedValue.value);
17074
+ getIndexesByValues();
17075
+ updateAllSelectedOptions();
17076
+ }
17072
17077
  });
17073
17078
  vue.watch(() => props.showPicker, (newValue) => {
17074
17079
  var _a;
@@ -17194,65 +17199,87 @@ var stdin_default$A = vue.defineComponent({
17194
17199
  const handleSelectAll = () => {
17195
17200
  if (props.filteredOptions && props.filteredOptions.length === 0) {
17196
17201
  confirmIndexes.value = [];
17202
+ confirmValues.value = [];
17203
+ emit("update:selectedValue", confirmValues.value);
17204
+ emit("update:selectedIndex", confirmIndexes.value);
17197
17205
  updateAllSelectedOptions();
17206
+ onChange();
17198
17207
  return;
17199
17208
  }
17209
+ let newIndexes = [];
17200
17210
  if (!isAllSelected.value) {
17201
17211
  if (props.filteredOptions && props.filteredOptions.length > 0) {
17202
- const selectedIndexes = [];
17203
17212
  displayOptions.value.forEach((option2) => {
17204
17213
  const originalIndex = currentOptions2.value.findIndex((opt) => opt.value === option2.value);
17205
17214
  if (originalIndex >= 0) {
17206
- selectedIndexes.push(originalIndex);
17215
+ newIndexes.push(originalIndex);
17207
17216
  }
17208
17217
  });
17209
- confirmIndexes.value = selectedIndexes;
17210
17218
  } else {
17211
- confirmIndexes.value = currentOptions2.value.map((_, index2) => index2);
17219
+ newIndexes = currentOptions2.value.map((_, index2) => index2);
17212
17220
  }
17213
17221
  } else {
17214
- confirmIndexes.value = [];
17222
+ newIndexes = [];
17215
17223
  }
17224
+ confirmIndexes.value = newIndexes;
17225
+ if (confirmIndexes.value.length > 0) {
17226
+ getValuesByIndexes();
17227
+ } else {
17228
+ confirmValues.value = [];
17229
+ }
17230
+ emit("update:selectedValue", confirmValues.value);
17231
+ emit("update:selectedIndex", confirmIndexes.value);
17216
17232
  updateAllSelectedOptions();
17233
+ onChange();
17217
17234
  };
17218
17235
  const onSelectOther = () => {
17219
17236
  if (props.filteredOptions && props.filteredOptions.length === 0) {
17220
17237
  confirmIndexes.value = [];
17238
+ confirmValues.value = [];
17239
+ emit("update:selectedValue", confirmValues.value);
17240
+ emit("update:selectedIndex", confirmIndexes.value);
17221
17241
  updateAllSelectedOptions();
17242
+ onChange();
17222
17243
  return;
17223
17244
  }
17245
+ let newIndexes = [];
17224
17246
  if (props.filteredOptions && props.filteredOptions.length > 0) {
17225
- const filteredValues = new Set(displayOptions.value.map((opt) => opt.value));
17226
17247
  const currentSelectedInFiltered = /* @__PURE__ */ new Set();
17227
17248
  confirmIndexes.value.forEach((idx) => {
17228
17249
  var _a;
17229
17250
  if (idx >= 0 && idx < currentOptions2.value.length) {
17230
17251
  const value = (_a = currentOptions2.value[idx]) == null ? void 0 : _a.value;
17231
- if (filteredValues.has(value)) {
17252
+ const isInFilteredList = displayOptions.value.some((opt) => opt.value === value);
17253
+ if (isInFilteredList) {
17232
17254
  currentSelectedInFiltered.add(idx);
17233
17255
  }
17234
17256
  }
17235
17257
  });
17236
- const newSelectedIndexes = [];
17237
17258
  displayOptions.value.forEach((option2) => {
17238
17259
  const originalIndex = currentOptions2.value.findIndex((opt) => opt.value === option2.value);
17239
17260
  if (originalIndex >= 0) {
17240
17261
  if (!currentSelectedInFiltered.has(originalIndex)) {
17241
- newSelectedIndexes.push(originalIndex);
17262
+ newIndexes.push(originalIndex);
17242
17263
  }
17243
17264
  }
17244
17265
  });
17245
- confirmIndexes.value = newSelectedIndexes;
17246
17266
  } else {
17247
- const temp = new Array();
17248
17267
  currentOptions2.value.forEach((_, index2) => {
17249
17268
  if (!confirmIndexes.value.includes(index2)) {
17250
- temp.push(index2);
17269
+ newIndexes.push(index2);
17251
17270
  }
17252
17271
  });
17253
- confirmIndexes.value = temp;
17254
17272
  }
17273
+ confirmIndexes.value = newIndexes;
17274
+ if (confirmIndexes.value.length > 0) {
17275
+ getValuesByIndexes();
17276
+ } else {
17277
+ confirmValues.value = [];
17278
+ }
17279
+ emit("update:selectedValue", confirmValues.value);
17280
+ emit("update:selectedIndex", confirmIndexes.value);
17255
17281
  updateAllSelectedOptions();
17282
+ onChange();
17256
17283
  };
17257
17284
  const genOptionItems = () => {
17258
17285
  let formatOptions = [];
@@ -17267,7 +17294,7 @@ var stdin_default$A = vue.defineComponent({
17267
17294
  return vue.createVNode(stdin_default$B, {
17268
17295
  "ref": pickerOptions,
17269
17296
  "currentIndexes": displaySelectedIndexes.value,
17270
- "onUpdate:currentIndexes": [($event) => displaySelectedIndexes.value = $event, onUpdateCurrentIndexes],
17297
+ "onUpdate:currentIndexes": onUpdateCurrentIndexes,
17271
17298
  "columnCounts": props.columnCounts,
17272
17299
  "initialOptions": formatOptions,
17273
17300
  "allowHtml": props.allowHtml,
@@ -17280,7 +17307,7 @@ var stdin_default$A = vue.defineComponent({
17280
17307
  });
17281
17308
  };
17282
17309
  const genOptions2 = () => {
17283
- const showEmpty = props.filteredOptions && props.filteredOptions.length === 0;
17310
+ const showEmpty = !displayOptions.value || displayOptions.value.length === 0;
17284
17311
  return vue.createVNode("div", {
17285
17312
  "class": bem$s("options")
17286
17313
  }, [showEmpty ? vue.createVNode(stdin_default$$, {
@@ -23381,7 +23408,7 @@ const Lazyload = {
23381
23408
  });
23382
23409
  }
23383
23410
  };
23384
- const version = "3.1.66";
23411
+ const version = "3.1.68";
23385
23412
  function install(app) {
23386
23413
  const components = [
23387
23414
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -16940,7 +16940,10 @@ const multiplePickerProps = {
16940
16940
  showToolbar: truthProp,
16941
16941
  showTitle: truthProp,
16942
16942
  options: makeArrayProp(),
16943
- filteredOptions: makeArrayProp(),
16943
+ filteredOptions: {
16944
+ type: Array,
16945
+ default: void 0
16946
+ },
16944
16947
  toolbarPosition: makeStringProp("bottom"),
16945
16948
  textKey: makeStringProp("text"),
16946
16949
  columnCounts: makeNumberProp(3),
@@ -16964,7 +16967,7 @@ var stdin_default$A = defineComponent({
16964
16967
  const confirmIndexes = ref(props.selectedIndex);
16965
16968
  const confirmValues = ref(props.selectedValue);
16966
16969
  const displayOptions = computed(() => {
16967
- return props.filteredOptions && props.filteredOptions.length > 0 ? props.filteredOptions : currentOptions2.value;
16970
+ return props.filteredOptions !== void 0 ? props.filteredOptions : currentOptions2.value;
16968
16971
  });
16969
16972
  const displaySelectedIndexes = computed(() => {
16970
16973
  if (!props.filteredOptions || props.filteredOptions.length === 0) {
@@ -17000,22 +17003,22 @@ var stdin_default$A = defineComponent({
17000
17003
  };
17001
17004
  const onUpdateCurrentIndexes = (newVal) => {
17002
17005
  if (props.filteredOptions && props.filteredOptions.length > 0) {
17003
- const selectedValues = newVal.filter((idx) => idx >= 0 && idx < displayOptions.value.length).map((idx) => {
17006
+ const selectedValuesInFiltered = newVal.filter((idx) => idx >= 0 && idx < displayOptions.value.length).map((idx) => {
17004
17007
  var _a;
17005
17008
  return (_a = displayOptions.value[idx]) == null ? void 0 : _a.value;
17006
17009
  });
17007
17010
  const newSelectedIndexes = /* @__PURE__ */ new Set();
17011
+ const filteredValuesSet = new Set(displayOptions.value.map((opt) => opt.value));
17008
17012
  confirmIndexes.value.forEach((idx) => {
17009
17013
  var _a;
17010
17014
  if (idx >= 0 && idx < currentOptions2.value.length) {
17011
17015
  const value = (_a = currentOptions2.value[idx]) == null ? void 0 : _a.value;
17012
- const isInFilteredList = displayOptions.value.some((opt) => opt.value === value);
17013
- if (!isInFilteredList) {
17016
+ if (!filteredValuesSet.has(value)) {
17014
17017
  newSelectedIndexes.add(idx);
17015
17018
  }
17016
17019
  }
17017
17020
  });
17018
- selectedValues.forEach((value) => {
17021
+ selectedValuesInFiltered.forEach((value) => {
17019
17022
  const originalIndex = currentOptions2.value.findIndex((opt) => opt.value === value);
17020
17023
  if (originalIndex >= 0) {
17021
17024
  newSelectedIndexes.add(originalIndex);
@@ -17062,11 +17065,13 @@ var stdin_default$A = defineComponent({
17062
17065
  if (newValue !== props.showPicker) {
17063
17066
  emit("update:showPicker", newValue);
17064
17067
  }
17065
- currentOptions2.value = deepClone(props.options);
17066
- confirmIndexes.value = deepClone(currentSelectedIndex.value);
17067
- confirmValues.value = deepClone(currentSelectedValue.value);
17068
- getIndexesByValues();
17069
- updateAllSelectedOptions();
17068
+ if (newValue) {
17069
+ currentOptions2.value = deepClone(props.options);
17070
+ confirmIndexes.value = deepClone(currentSelectedIndex.value);
17071
+ confirmValues.value = deepClone(currentSelectedValue.value);
17072
+ getIndexesByValues();
17073
+ updateAllSelectedOptions();
17074
+ }
17070
17075
  });
17071
17076
  watch(() => props.showPicker, (newValue) => {
17072
17077
  var _a;
@@ -17192,65 +17197,87 @@ var stdin_default$A = defineComponent({
17192
17197
  const handleSelectAll = () => {
17193
17198
  if (props.filteredOptions && props.filteredOptions.length === 0) {
17194
17199
  confirmIndexes.value = [];
17200
+ confirmValues.value = [];
17201
+ emit("update:selectedValue", confirmValues.value);
17202
+ emit("update:selectedIndex", confirmIndexes.value);
17195
17203
  updateAllSelectedOptions();
17204
+ onChange();
17196
17205
  return;
17197
17206
  }
17207
+ let newIndexes = [];
17198
17208
  if (!isAllSelected.value) {
17199
17209
  if (props.filteredOptions && props.filteredOptions.length > 0) {
17200
- const selectedIndexes = [];
17201
17210
  displayOptions.value.forEach((option2) => {
17202
17211
  const originalIndex = currentOptions2.value.findIndex((opt) => opt.value === option2.value);
17203
17212
  if (originalIndex >= 0) {
17204
- selectedIndexes.push(originalIndex);
17213
+ newIndexes.push(originalIndex);
17205
17214
  }
17206
17215
  });
17207
- confirmIndexes.value = selectedIndexes;
17208
17216
  } else {
17209
- confirmIndexes.value = currentOptions2.value.map((_, index2) => index2);
17217
+ newIndexes = currentOptions2.value.map((_, index2) => index2);
17210
17218
  }
17211
17219
  } else {
17212
- confirmIndexes.value = [];
17220
+ newIndexes = [];
17213
17221
  }
17222
+ confirmIndexes.value = newIndexes;
17223
+ if (confirmIndexes.value.length > 0) {
17224
+ getValuesByIndexes();
17225
+ } else {
17226
+ confirmValues.value = [];
17227
+ }
17228
+ emit("update:selectedValue", confirmValues.value);
17229
+ emit("update:selectedIndex", confirmIndexes.value);
17214
17230
  updateAllSelectedOptions();
17231
+ onChange();
17215
17232
  };
17216
17233
  const onSelectOther = () => {
17217
17234
  if (props.filteredOptions && props.filteredOptions.length === 0) {
17218
17235
  confirmIndexes.value = [];
17236
+ confirmValues.value = [];
17237
+ emit("update:selectedValue", confirmValues.value);
17238
+ emit("update:selectedIndex", confirmIndexes.value);
17219
17239
  updateAllSelectedOptions();
17240
+ onChange();
17220
17241
  return;
17221
17242
  }
17243
+ let newIndexes = [];
17222
17244
  if (props.filteredOptions && props.filteredOptions.length > 0) {
17223
- const filteredValues = new Set(displayOptions.value.map((opt) => opt.value));
17224
17245
  const currentSelectedInFiltered = /* @__PURE__ */ new Set();
17225
17246
  confirmIndexes.value.forEach((idx) => {
17226
17247
  var _a;
17227
17248
  if (idx >= 0 && idx < currentOptions2.value.length) {
17228
17249
  const value = (_a = currentOptions2.value[idx]) == null ? void 0 : _a.value;
17229
- if (filteredValues.has(value)) {
17250
+ const isInFilteredList = displayOptions.value.some((opt) => opt.value === value);
17251
+ if (isInFilteredList) {
17230
17252
  currentSelectedInFiltered.add(idx);
17231
17253
  }
17232
17254
  }
17233
17255
  });
17234
- const newSelectedIndexes = [];
17235
17256
  displayOptions.value.forEach((option2) => {
17236
17257
  const originalIndex = currentOptions2.value.findIndex((opt) => opt.value === option2.value);
17237
17258
  if (originalIndex >= 0) {
17238
17259
  if (!currentSelectedInFiltered.has(originalIndex)) {
17239
- newSelectedIndexes.push(originalIndex);
17260
+ newIndexes.push(originalIndex);
17240
17261
  }
17241
17262
  }
17242
17263
  });
17243
- confirmIndexes.value = newSelectedIndexes;
17244
17264
  } else {
17245
- const temp = new Array();
17246
17265
  currentOptions2.value.forEach((_, index2) => {
17247
17266
  if (!confirmIndexes.value.includes(index2)) {
17248
- temp.push(index2);
17267
+ newIndexes.push(index2);
17249
17268
  }
17250
17269
  });
17251
- confirmIndexes.value = temp;
17252
17270
  }
17271
+ confirmIndexes.value = newIndexes;
17272
+ if (confirmIndexes.value.length > 0) {
17273
+ getValuesByIndexes();
17274
+ } else {
17275
+ confirmValues.value = [];
17276
+ }
17277
+ emit("update:selectedValue", confirmValues.value);
17278
+ emit("update:selectedIndex", confirmIndexes.value);
17253
17279
  updateAllSelectedOptions();
17280
+ onChange();
17254
17281
  };
17255
17282
  const genOptionItems = () => {
17256
17283
  let formatOptions = [];
@@ -17265,7 +17292,7 @@ var stdin_default$A = defineComponent({
17265
17292
  return createVNode(stdin_default$B, {
17266
17293
  "ref": pickerOptions,
17267
17294
  "currentIndexes": displaySelectedIndexes.value,
17268
- "onUpdate:currentIndexes": [($event) => displaySelectedIndexes.value = $event, onUpdateCurrentIndexes],
17295
+ "onUpdate:currentIndexes": onUpdateCurrentIndexes,
17269
17296
  "columnCounts": props.columnCounts,
17270
17297
  "initialOptions": formatOptions,
17271
17298
  "allowHtml": props.allowHtml,
@@ -17278,7 +17305,7 @@ var stdin_default$A = defineComponent({
17278
17305
  });
17279
17306
  };
17280
17307
  const genOptions2 = () => {
17281
- const showEmpty = props.filteredOptions && props.filteredOptions.length === 0;
17308
+ const showEmpty = !displayOptions.value || displayOptions.value.length === 0;
17282
17309
  return createVNode("div", {
17283
17310
  "class": bem$s("options")
17284
17311
  }, [showEmpty ? createVNode(stdin_default$$, {
@@ -23379,7 +23406,7 @@ const Lazyload = {
23379
23406
  });
23380
23407
  }
23381
23408
  };
23382
- const version = "3.1.66";
23409
+ const version = "3.1.68";
23383
23410
  function install(app) {
23384
23411
  const components = [
23385
23412
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -18718,7 +18718,10 @@
18718
18718
  showToolbar: truthProp,
18719
18719
  showTitle: truthProp,
18720
18720
  options: makeArrayProp(),
18721
- filteredOptions: makeArrayProp(),
18721
+ filteredOptions: {
18722
+ type: Array,
18723
+ default: void 0
18724
+ },
18722
18725
  toolbarPosition: makeStringProp("bottom"),
18723
18726
  textKey: makeStringProp("text"),
18724
18727
  columnCounts: makeNumberProp(3),
@@ -18742,7 +18745,7 @@
18742
18745
  const confirmIndexes = vue.ref(props.selectedIndex);
18743
18746
  const confirmValues = vue.ref(props.selectedValue);
18744
18747
  const displayOptions = vue.computed(() => {
18745
- return props.filteredOptions && props.filteredOptions.length > 0 ? props.filteredOptions : currentOptions2.value;
18748
+ return props.filteredOptions !== void 0 ? props.filteredOptions : currentOptions2.value;
18746
18749
  });
18747
18750
  const displaySelectedIndexes = vue.computed(() => {
18748
18751
  if (!props.filteredOptions || props.filteredOptions.length === 0) {
@@ -18778,22 +18781,22 @@
18778
18781
  };
18779
18782
  const onUpdateCurrentIndexes = (newVal) => {
18780
18783
  if (props.filteredOptions && props.filteredOptions.length > 0) {
18781
- const selectedValues = newVal.filter((idx) => idx >= 0 && idx < displayOptions.value.length).map((idx) => {
18784
+ const selectedValuesInFiltered = newVal.filter((idx) => idx >= 0 && idx < displayOptions.value.length).map((idx) => {
18782
18785
  var _a;
18783
18786
  return (_a = displayOptions.value[idx]) == null ? void 0 : _a.value;
18784
18787
  });
18785
18788
  const newSelectedIndexes = /* @__PURE__ */ new Set();
18789
+ const filteredValuesSet = new Set(displayOptions.value.map((opt) => opt.value));
18786
18790
  confirmIndexes.value.forEach((idx) => {
18787
18791
  var _a;
18788
18792
  if (idx >= 0 && idx < currentOptions2.value.length) {
18789
18793
  const value = (_a = currentOptions2.value[idx]) == null ? void 0 : _a.value;
18790
- const isInFilteredList = displayOptions.value.some((opt) => opt.value === value);
18791
- if (!isInFilteredList) {
18794
+ if (!filteredValuesSet.has(value)) {
18792
18795
  newSelectedIndexes.add(idx);
18793
18796
  }
18794
18797
  }
18795
18798
  });
18796
- selectedValues.forEach((value) => {
18799
+ selectedValuesInFiltered.forEach((value) => {
18797
18800
  const originalIndex = currentOptions2.value.findIndex((opt) => opt.value === value);
18798
18801
  if (originalIndex >= 0) {
18799
18802
  newSelectedIndexes.add(originalIndex);
@@ -18840,11 +18843,13 @@
18840
18843
  if (newValue !== props.showPicker) {
18841
18844
  emit("update:showPicker", newValue);
18842
18845
  }
18843
- currentOptions2.value = deepClone(props.options);
18844
- confirmIndexes.value = deepClone(currentSelectedIndex.value);
18845
- confirmValues.value = deepClone(currentSelectedValue.value);
18846
- getIndexesByValues();
18847
- updateAllSelectedOptions();
18846
+ if (newValue) {
18847
+ currentOptions2.value = deepClone(props.options);
18848
+ confirmIndexes.value = deepClone(currentSelectedIndex.value);
18849
+ confirmValues.value = deepClone(currentSelectedValue.value);
18850
+ getIndexesByValues();
18851
+ updateAllSelectedOptions();
18852
+ }
18848
18853
  });
18849
18854
  vue.watch(() => props.showPicker, (newValue) => {
18850
18855
  var _a;
@@ -18970,65 +18975,87 @@
18970
18975
  const handleSelectAll = () => {
18971
18976
  if (props.filteredOptions && props.filteredOptions.length === 0) {
18972
18977
  confirmIndexes.value = [];
18978
+ confirmValues.value = [];
18979
+ emit("update:selectedValue", confirmValues.value);
18980
+ emit("update:selectedIndex", confirmIndexes.value);
18973
18981
  updateAllSelectedOptions();
18982
+ onChange();
18974
18983
  return;
18975
18984
  }
18985
+ let newIndexes = [];
18976
18986
  if (!isAllSelected.value) {
18977
18987
  if (props.filteredOptions && props.filteredOptions.length > 0) {
18978
- const selectedIndexes = [];
18979
18988
  displayOptions.value.forEach((option) => {
18980
18989
  const originalIndex = currentOptions2.value.findIndex((opt) => opt.value === option.value);
18981
18990
  if (originalIndex >= 0) {
18982
- selectedIndexes.push(originalIndex);
18991
+ newIndexes.push(originalIndex);
18983
18992
  }
18984
18993
  });
18985
- confirmIndexes.value = selectedIndexes;
18986
18994
  } else {
18987
- confirmIndexes.value = currentOptions2.value.map((_, index2) => index2);
18995
+ newIndexes = currentOptions2.value.map((_, index2) => index2);
18988
18996
  }
18989
18997
  } else {
18990
- confirmIndexes.value = [];
18998
+ newIndexes = [];
18991
18999
  }
19000
+ confirmIndexes.value = newIndexes;
19001
+ if (confirmIndexes.value.length > 0) {
19002
+ getValuesByIndexes();
19003
+ } else {
19004
+ confirmValues.value = [];
19005
+ }
19006
+ emit("update:selectedValue", confirmValues.value);
19007
+ emit("update:selectedIndex", confirmIndexes.value);
18992
19008
  updateAllSelectedOptions();
19009
+ onChange();
18993
19010
  };
18994
19011
  const onSelectOther = () => {
18995
19012
  if (props.filteredOptions && props.filteredOptions.length === 0) {
18996
19013
  confirmIndexes.value = [];
19014
+ confirmValues.value = [];
19015
+ emit("update:selectedValue", confirmValues.value);
19016
+ emit("update:selectedIndex", confirmIndexes.value);
18997
19017
  updateAllSelectedOptions();
19018
+ onChange();
18998
19019
  return;
18999
19020
  }
19021
+ let newIndexes = [];
19000
19022
  if (props.filteredOptions && props.filteredOptions.length > 0) {
19001
- const filteredValues = new Set(displayOptions.value.map((opt) => opt.value));
19002
19023
  const currentSelectedInFiltered = /* @__PURE__ */ new Set();
19003
19024
  confirmIndexes.value.forEach((idx) => {
19004
19025
  var _a;
19005
19026
  if (idx >= 0 && idx < currentOptions2.value.length) {
19006
19027
  const value = (_a = currentOptions2.value[idx]) == null ? void 0 : _a.value;
19007
- if (filteredValues.has(value)) {
19028
+ const isInFilteredList = displayOptions.value.some((opt) => opt.value === value);
19029
+ if (isInFilteredList) {
19008
19030
  currentSelectedInFiltered.add(idx);
19009
19031
  }
19010
19032
  }
19011
19033
  });
19012
- const newSelectedIndexes = [];
19013
19034
  displayOptions.value.forEach((option) => {
19014
19035
  const originalIndex = currentOptions2.value.findIndex((opt) => opt.value === option.value);
19015
19036
  if (originalIndex >= 0) {
19016
19037
  if (!currentSelectedInFiltered.has(originalIndex)) {
19017
- newSelectedIndexes.push(originalIndex);
19038
+ newIndexes.push(originalIndex);
19018
19039
  }
19019
19040
  }
19020
19041
  });
19021
- confirmIndexes.value = newSelectedIndexes;
19022
19042
  } else {
19023
- const temp = new Array();
19024
19043
  currentOptions2.value.forEach((_, index2) => {
19025
19044
  if (!confirmIndexes.value.includes(index2)) {
19026
- temp.push(index2);
19045
+ newIndexes.push(index2);
19027
19046
  }
19028
19047
  });
19029
- confirmIndexes.value = temp;
19030
19048
  }
19049
+ confirmIndexes.value = newIndexes;
19050
+ if (confirmIndexes.value.length > 0) {
19051
+ getValuesByIndexes();
19052
+ } else {
19053
+ confirmValues.value = [];
19054
+ }
19055
+ emit("update:selectedValue", confirmValues.value);
19056
+ emit("update:selectedIndex", confirmIndexes.value);
19031
19057
  updateAllSelectedOptions();
19058
+ onChange();
19032
19059
  };
19033
19060
  const genOptionItems = () => {
19034
19061
  let formatOptions = [];
@@ -19043,7 +19070,7 @@
19043
19070
  return vue.createVNode(stdin_default$B, {
19044
19071
  "ref": pickerOptions,
19045
19072
  "currentIndexes": displaySelectedIndexes.value,
19046
- "onUpdate:currentIndexes": [($event) => displaySelectedIndexes.value = $event, onUpdateCurrentIndexes],
19073
+ "onUpdate:currentIndexes": onUpdateCurrentIndexes,
19047
19074
  "columnCounts": props.columnCounts,
19048
19075
  "initialOptions": formatOptions,
19049
19076
  "allowHtml": props.allowHtml,
@@ -19056,7 +19083,7 @@
19056
19083
  });
19057
19084
  };
19058
19085
  const genOptions2 = () => {
19059
- const showEmpty = props.filteredOptions && props.filteredOptions.length === 0;
19086
+ const showEmpty = !displayOptions.value || displayOptions.value.length === 0;
19060
19087
  return vue.createVNode("div", {
19061
19088
  "class": bem$s("options")
19062
19089
  }, [showEmpty ? vue.createVNode(stdin_default$$, {
@@ -27441,7 +27468,7 @@
27441
27468
  });
27442
27469
  }
27443
27470
  };
27444
- const version = "3.1.66";
27471
+ const version = "3.1.68";
27445
27472
  function install(app) {
27446
27473
  const components = [
27447
27474
  ActionSheet,