zartui 3.1.14 → 3.1.16

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.
Files changed (40) hide show
  1. package/es/cell/Cell.d.ts +1 -1
  2. package/es/cell/index.d.ts +1 -1
  3. package/es/date-time-picker/DateTimePicker.mjs +1 -1
  4. package/es/dropdown-item/types.d.ts +3 -3
  5. package/es/field/Field.d.ts +1 -1
  6. package/es/field/index.d.ts +1 -1
  7. package/es/index.d.ts +1 -1
  8. package/es/index.mjs +1 -1
  9. package/es/multiple-picker/MultiplePicker.d.ts +16 -1
  10. package/es/multiple-picker/MultiplePicker.mjs +19 -2
  11. package/es/multiple-picker/MultiplePickerOptions.mjs +3 -1
  12. package/es/multiple-picker/index.d.ts +11 -1
  13. package/es/pull-refresh/PullRefresh.d.ts +5 -1
  14. package/es/pull-refresh/PullRefresh.mjs +15 -4
  15. package/es/pull-refresh/index.d.ts +2 -0
  16. package/es/utils/dom.d.ts +2 -0
  17. package/es/utils/dom.mjs +15 -0
  18. package/lib/cell/Cell.d.ts +1 -1
  19. package/lib/cell/index.d.ts +1 -1
  20. package/lib/date-time-picker/DateTimePicker.js +1 -1
  21. package/lib/dropdown-item/types.d.ts +3 -3
  22. package/lib/field/Field.d.ts +1 -1
  23. package/lib/field/index.d.ts +1 -1
  24. package/lib/index.d.ts +1 -1
  25. package/lib/index.js +1 -1
  26. package/lib/multiple-picker/MultiplePicker.d.ts +16 -1
  27. package/lib/multiple-picker/MultiplePicker.js +19 -2
  28. package/lib/multiple-picker/MultiplePickerOptions.js +3 -1
  29. package/lib/multiple-picker/index.d.ts +11 -1
  30. package/lib/pull-refresh/PullRefresh.d.ts +5 -1
  31. package/lib/pull-refresh/PullRefresh.js +13 -2
  32. package/lib/pull-refresh/index.d.ts +2 -0
  33. package/lib/utils/dom.d.ts +2 -0
  34. package/lib/utils/dom.js +15 -0
  35. package/lib/web-types.json +1 -1
  36. package/lib/zartui.cjs.js +49 -7
  37. package/lib/zartui.es.js +49 -7
  38. package/lib/zartui.js +49 -7
  39. package/lib/zartui.min.js +1 -1
  40. package/package.json +1 -1
package/es/cell/Cell.d.ts CHANGED
@@ -194,8 +194,8 @@ declare const _default: import("vue").DefineComponent<{
194
194
  onClear?: ((...args: any[]) => any) | undefined;
195
195
  }, {
196
196
  replace: boolean;
197
- value: string;
198
197
  center: boolean;
198
+ value: string;
199
199
  border: boolean;
200
200
  direction: CellDirection;
201
201
  isLink: boolean;
@@ -97,8 +97,8 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
97
97
  onClear?: ((...args: any[]) => any) | undefined;
98
98
  }, {
99
99
  replace: boolean;
100
- value: string;
101
100
  center: boolean;
101
+ value: string;
102
102
  border: boolean;
103
103
  direction: import("./types").CellDirection;
104
104
  isLink: boolean;
@@ -124,7 +124,7 @@ var stdin_default = defineComponent({
124
124
  }
125
125
  }
126
126
  onClose();
127
- emit("confirm");
127
+ emit("confirm", currentValue.value);
128
128
  };
129
129
  const onOpen = () => {
130
130
  var _a, _b, _c;
@@ -3,10 +3,10 @@ import type { VNode, ComponentPublicInstance } from 'vue';
3
3
  import type { Numeric } from '../utils';
4
4
  export type DropdownItemOptionValue = Numeric | boolean | string;
5
5
  export type DropdownItemOption = {
6
- text: string;
6
+ text?: string;
7
7
  icon?: string;
8
- value: DropdownItemOptionValue;
9
- selected: boolean;
8
+ value?: DropdownItemOptionValue;
9
+ selected?: boolean;
10
10
  [key: PropertyKey]: any;
11
11
  };
12
12
  export type DropdownItemExpose = {
@@ -382,11 +382,11 @@ declare const _default: import("vue").DefineComponent<{
382
382
  onClickRightIcon?: ((...args: any[]) => any) | undefined;
383
383
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
384
384
  }, {
385
+ center: boolean;
385
386
  type: FieldType;
386
387
  autofocus: boolean;
387
388
  disabled: boolean;
388
389
  value: string;
389
- center: boolean;
390
390
  border: boolean;
391
391
  direction: import("../cell").CellDirection;
392
392
  isLink: boolean;
@@ -227,11 +227,11 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
227
227
  onClickRightIcon?: ((...args: any[]) => any) | undefined;
228
228
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
229
229
  }, {
230
+ center: boolean;
230
231
  type: import("./types").FieldType;
231
232
  autofocus: boolean;
232
233
  disabled: boolean;
233
234
  value: string;
234
- center: boolean;
235
235
  border: boolean;
236
236
  direction: import("..").CellDirection;
237
237
  isLink: boolean;
package/es/index.d.ts CHANGED
@@ -81,4 +81,4 @@ declare namespace _default {
81
81
  }
82
82
  export default _default;
83
83
  export function install(app: any): void;
84
- export const version: "3.1.13";
84
+ export const version: "3.1.15";
package/es/index.mjs CHANGED
@@ -74,7 +74,7 @@ import { TimePicker } from "./time-picker/index.mjs";
74
74
  import { Timeline } from "./timeline/index.mjs";
75
75
  import { Toast } from "./toast/index.mjs";
76
76
  import { Uploader } from "./uploader/index.mjs";
77
- const version = "3.1.13";
77
+ const version = "3.1.15";
78
78
  function install(app) {
79
79
  const components = [
80
80
  ActionSheet,
@@ -1,4 +1,5 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
+ import { Numeric } from '../utils';
2
3
  import { PickerOption } from './types';
3
4
  declare const multiplePickerProps: {
4
5
  title: StringConstructor;
@@ -51,6 +52,10 @@ declare const multiplePickerProps: {
51
52
  type: import("vue").PropType<number[]>;
52
53
  default: () => number[];
53
54
  };
55
+ selectedValue: {
56
+ type: import("vue").PropType<Numeric[]>;
57
+ default: () => Numeric[];
58
+ };
54
59
  popup: {
55
60
  type: BooleanConstructor;
56
61
  default: true;
@@ -108,11 +113,15 @@ declare const _default: import("vue").DefineComponent<{
108
113
  type: import("vue").PropType<number[]>;
109
114
  default: () => number[];
110
115
  };
116
+ selectedValue: {
117
+ type: import("vue").PropType<Numeric[]>;
118
+ default: () => Numeric[];
119
+ };
111
120
  popup: {
112
121
  type: BooleanConstructor;
113
122
  default: true;
114
123
  };
115
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex")[], "cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
124
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex" | "update:selectedValue")[], "cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex" | "update:selectedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
116
125
  title: StringConstructor;
117
126
  loading: BooleanConstructor;
118
127
  readonly: BooleanConstructor;
@@ -163,6 +172,10 @@ declare const _default: import("vue").DefineComponent<{
163
172
  type: import("vue").PropType<number[]>;
164
173
  default: () => number[];
165
174
  };
175
+ selectedValue: {
176
+ type: import("vue").PropType<Numeric[]>;
177
+ default: () => Numeric[];
178
+ };
166
179
  popup: {
167
180
  type: BooleanConstructor;
168
181
  default: true;
@@ -173,6 +186,7 @@ declare const _default: import("vue").DefineComponent<{
173
186
  onConfirm?: ((...args: any[]) => any) | undefined;
174
187
  "onUpdate:showPicker"?: ((...args: any[]) => any) | undefined;
175
188
  "onUpdate:selectedIndex"?: ((...args: any[]) => any) | undefined;
189
+ "onUpdate:selectedValue"?: ((...args: any[]) => any) | undefined;
176
190
  }, {
177
191
  readonly: boolean;
178
192
  closeOnClickOverlay: boolean;
@@ -189,5 +203,6 @@ declare const _default: import("vue").DefineComponent<{
189
203
  columnCounts: number;
190
204
  toolbarPosition: string;
191
205
  selectedIndex: number[];
206
+ selectedValue: Numeric[];
192
207
  }, {}>;
193
208
  export default _default;
@@ -2,6 +2,7 @@ import { createVNode as _createVNode } from "vue";
2
2
  import { ref, watch, computed, defineComponent } from "vue";
3
3
  import { createNamespace, makeArrayProp, makeNumberProp, makeNumericProp, makeStringProp, truthProp } from "../utils/index.mjs";
4
4
  import { unitToPx } from "../utils/format.mjs";
5
+ import { deepClone } from "../utils/deep-clone.mjs";
5
6
  import Loading from "../loading/index.mjs";
6
7
  import MultiplePickerOptions from "./MultiplePickerOptions.mjs";
7
8
  import Popup from "../popup/index.mjs";
@@ -25,17 +26,31 @@ const multiplePickerProps = {
25
26
  textKey: makeStringProp("text"),
26
27
  columnCounts: makeNumberProp(3),
27
28
  selectedIndex: makeArrayProp([]),
29
+ selectedValue: makeArrayProp([]),
28
30
  popup: truthProp
29
31
  };
30
32
  var stdin_default = defineComponent({
31
33
  name,
32
34
  props: multiplePickerProps,
33
- emits: ["cancel", "confirm", "change", "update:showPicker", "update:selectedIndex"],
35
+ emits: ["cancel", "confirm", "change", "update:showPicker", "update:selectedIndex", "update:selectedValue"],
34
36
  setup(props, {
35
37
  emit,
36
38
  slots
37
39
  }) {
38
40
  const confirmIndexes = ref(props.selectedIndex);
41
+ const confirmValues = ref(props.selectedValue);
42
+ const getIndexesByValues = () => {
43
+ var _a;
44
+ if (confirmValues.value && confirmValues.value.length > 0) {
45
+ confirmIndexes.value.splice(0, confirmIndexes.value.length);
46
+ (_a = props.options) == null ? void 0 : _a.forEach((option, index) => {
47
+ if (option.value && confirmValues.value.includes(option.value)) {
48
+ confirmIndexes.value.push(index);
49
+ }
50
+ });
51
+ }
52
+ };
53
+ getIndexesByValues();
39
54
  const pickerOptions = ref();
40
55
  const currentShow = ref(props.showPicker);
41
56
  const DEFAULT_ITEM_HEIGHT = ref(36);
@@ -43,7 +58,9 @@ var stdin_default = defineComponent({
43
58
  if (newValue !== props.showPicker) {
44
59
  emit("update:showPicker", newValue);
45
60
  }
46
- confirmIndexes.value = props.selectedIndex;
61
+ confirmIndexes.value = deepClone(props.selectedIndex);
62
+ confirmValues.value = deepClone(props.selectedValue);
63
+ getIndexesByValues();
47
64
  });
48
65
  watch(() => props.showPicker, (newValue) => {
49
66
  var _a;
@@ -1,6 +1,7 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import { ref, defineComponent, reactive } from "vue";
3
3
  import { createNamespace, isObject, makeArrayProp, makeNumberProp, makeStringProp } from "../utils/index.mjs";
4
+ import { deepClone } from "../utils/deep-clone.mjs";
4
5
  import { useExpose } from "../composables/use-expose.mjs";
5
6
  const [name, bem] = createNamespace("multiple-picker-options");
6
7
  const multiplePickerOptionsProps = {
@@ -83,7 +84,8 @@ var stdin_default = defineComponent({
83
84
  }, [slots.options ? slots.options(option) : _createVNode("div", childData, null)]);
84
85
  });
85
86
  };
86
- const setConfirmIndex = (indexes) => {
87
+ const setConfirmIndex = (data) => {
88
+ const indexes = deepClone(data);
87
89
  state.confirmed = true;
88
90
  const keys = Object.keys(indexes);
89
91
  currentIndexes.value.length = 0;
@@ -51,11 +51,15 @@ export declare const MultiplePicker: import("../utils").WithInstall<import("vue"
51
51
  type: import("vue").PropType<number[]>;
52
52
  default: () => number[];
53
53
  };
54
+ selectedValue: {
55
+ type: import("vue").PropType<import("../utils").Numeric[]>;
56
+ default: () => import("../utils").Numeric[];
57
+ };
54
58
  popup: {
55
59
  type: BooleanConstructor;
56
60
  default: true;
57
61
  };
58
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex")[], "cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
62
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex" | "update:selectedValue")[], "cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex" | "update:selectedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
59
63
  title: StringConstructor;
60
64
  loading: BooleanConstructor;
61
65
  readonly: BooleanConstructor;
@@ -106,6 +110,10 @@ export declare const MultiplePicker: import("../utils").WithInstall<import("vue"
106
110
  type: import("vue").PropType<number[]>;
107
111
  default: () => number[];
108
112
  };
113
+ selectedValue: {
114
+ type: import("vue").PropType<import("../utils").Numeric[]>;
115
+ default: () => import("../utils").Numeric[];
116
+ };
109
117
  popup: {
110
118
  type: BooleanConstructor;
111
119
  default: true;
@@ -116,6 +124,7 @@ export declare const MultiplePicker: import("../utils").WithInstall<import("vue"
116
124
  onConfirm?: ((...args: any[]) => any) | undefined;
117
125
  "onUpdate:showPicker"?: ((...args: any[]) => any) | undefined;
118
126
  "onUpdate:selectedIndex"?: ((...args: any[]) => any) | undefined;
127
+ "onUpdate:selectedValue"?: ((...args: any[]) => any) | undefined;
119
128
  }, {
120
129
  readonly: boolean;
121
130
  closeOnClickOverlay: boolean;
@@ -132,6 +141,7 @@ export declare const MultiplePicker: import("../utils").WithInstall<import("vue"
132
141
  columnCounts: number;
133
142
  toolbarPosition: string;
134
143
  selectedIndex: number[];
144
+ selectedValue: import("../utils").Numeric[];
135
145
  }, {}>>;
136
146
  export default MultiplePicker;
137
147
  export type { MultiplePickerProps };
@@ -1,4 +1,5 @@
1
- import type { ExtractPropTypes } from 'vue';
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
+ import { TargetContainer } from '../utils';
2
3
  declare const pullRefreshProps: {
3
4
  disabled: BooleanConstructor;
4
5
  modelValue: BooleanConstructor;
@@ -19,6 +20,7 @@ declare const pullRefreshProps: {
19
20
  type: (NumberConstructor | StringConstructor)[];
20
21
  default: number;
21
22
  };
23
+ scrollElement: PropType<TargetContainer>;
22
24
  };
23
25
  export type PullRefreshProps = ExtractPropTypes<typeof pullRefreshProps>;
24
26
  declare const _default: import("vue").DefineComponent<{
@@ -41,6 +43,7 @@ declare const _default: import("vue").DefineComponent<{
41
43
  type: (NumberConstructor | StringConstructor)[];
42
44
  default: number;
43
45
  };
46
+ scrollElement: PropType<TargetContainer>;
44
47
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
45
48
  disabled: BooleanConstructor;
46
49
  modelValue: BooleanConstructor;
@@ -61,6 +64,7 @@ declare const _default: import("vue").DefineComponent<{
61
64
  type: (NumberConstructor | StringConstructor)[];
62
65
  default: number;
63
66
  };
67
+ scrollElement: PropType<TargetContainer>;
64
68
  }>> & {
65
69
  onChange?: ((...args: any[]) => any) | undefined;
66
70
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -1,6 +1,6 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { ref, watch, reactive, nextTick, defineComponent } from "vue";
3
- import { numericProp, getScrollTop, preventDefault, createNamespace, makeNumericProp } from "../utils/index.mjs";
2
+ import { ref, watch, reactive, nextTick, defineComponent, computed } from "vue";
3
+ import { numericProp, getScrollTop, preventDefault, createNamespace, makeNumericProp, getTargetDom } from "../utils/index.mjs";
4
4
  import { useEventListener, useScrollParent } from "@zartui/use";
5
5
  import { useTouch } from "../composables/use-touch.mjs";
6
6
  import { Loading } from "../loading/index.mjs";
@@ -17,7 +17,8 @@ const pullRefreshProps = {
17
17
  loadingText: String,
18
18
  pullDistance: numericProp,
19
19
  successDuration: makeNumericProp(500),
20
- animationDuration: makeNumericProp(300)
20
+ animationDuration: makeNumericProp(300),
21
+ scrollElement: null
21
22
  };
22
23
  var stdin_default = defineComponent({
23
24
  name,
@@ -30,7 +31,17 @@ var stdin_default = defineComponent({
30
31
  let reachTop;
31
32
  const root = ref();
32
33
  const track = ref();
33
- const scrollParent = useScrollParent(root);
34
+ const rootScrollElement = useScrollParent(root);
35
+ const scrollParent = computed(() => {
36
+ if (props.scrollElement) {
37
+ const targetDom = getTargetDom(props.scrollElement);
38
+ if (!targetDom) {
39
+ console.warn("\u8BF7\u68C0\u67E5props scroll-element\u5143\u7D20\u662F\u5426\u5B58\u5728\uFF01");
40
+ }
41
+ return targetDom != null ? targetDom : rootScrollElement.value;
42
+ }
43
+ return rootScrollElement.value;
44
+ });
34
45
  const state = reactive({
35
46
  status: "normal",
36
47
  distance: 0,
@@ -18,6 +18,7 @@ export declare const PullRefresh: import("../utils").WithInstall<import("vue").D
18
18
  type: (NumberConstructor | StringConstructor)[];
19
19
  default: number;
20
20
  };
21
+ scrollElement: import("vue").PropType<import("../utils").TargetContainer>;
21
22
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "refresh")[], "update:modelValue" | "change" | "refresh", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
22
23
  disabled: BooleanConstructor;
23
24
  modelValue: BooleanConstructor;
@@ -38,6 +39,7 @@ export declare const PullRefresh: import("../utils").WithInstall<import("vue").D
38
39
  type: (NumberConstructor | StringConstructor)[];
39
40
  default: number;
40
41
  };
42
+ scrollElement: import("vue").PropType<import("../utils").TargetContainer>;
41
43
  }>> & {
42
44
  onChange?: ((...args: any[]) => any) | undefined;
43
45
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
package/es/utils/dom.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Ref } from 'vue';
2
2
  export type ScrollElement = Element | Window;
3
+ export type TargetContainer = string | HTMLElement | (() => HTMLElement);
3
4
  export declare function getScrollTop(el: ScrollElement): number;
4
5
  export declare function setScrollTop(el: ScrollElement, value: number): void;
5
6
  export declare function getRootScrollTop(): number;
@@ -10,4 +11,5 @@ export declare const stopPropagation: (event: Event) => void;
10
11
  export declare function preventDefault(event: Event, isStopPropagation?: boolean): void;
11
12
  export declare function isHidden(elementRef: HTMLElement | Ref<HTMLElement | undefined>): boolean;
12
13
  export declare function colorFromCSSClass(className: string, defaultColor: string): string;
14
+ export declare const getTargetDom: (target: TargetContainer) => HTMLElement;
13
15
  export declare const windowWidth: Ref<number>, windowHeight: Ref<number>;
package/es/utils/dom.mjs CHANGED
@@ -61,12 +61,27 @@ function colorFromCSSClass(className, defaultColor) {
61
61
  document.body.removeChild(tmp);
62
62
  return !classColor ? defaultColor : classColor;
63
63
  }
64
+ const getTargetDom = (target) => {
65
+ if (target) {
66
+ if (typeof target === "string") {
67
+ return document.querySelectorAll(target)[0];
68
+ }
69
+ if (typeof target === "function") {
70
+ return target();
71
+ }
72
+ if (typeof target === "object" && target instanceof window.HTMLElement) {
73
+ return target;
74
+ }
75
+ }
76
+ return document.body;
77
+ };
64
78
  const { width: windowWidth, height: windowHeight } = useWindowSize();
65
79
  export {
66
80
  colorFromCSSClass,
67
81
  getElementTop,
68
82
  getRootScrollTop,
69
83
  getScrollTop,
84
+ getTargetDom,
70
85
  isHidden,
71
86
  preventDefault,
72
87
  resetScroll,
@@ -194,8 +194,8 @@ declare const _default: import("vue").DefineComponent<{
194
194
  onClear?: ((...args: any[]) => any) | undefined;
195
195
  }, {
196
196
  replace: boolean;
197
- value: string;
198
197
  center: boolean;
198
+ value: string;
199
199
  border: boolean;
200
200
  direction: CellDirection;
201
201
  isLink: boolean;
@@ -97,8 +97,8 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
97
97
  onClear?: ((...args: any[]) => any) | undefined;
98
98
  }, {
99
99
  replace: boolean;
100
- value: string;
101
100
  center: boolean;
101
+ value: string;
102
102
  border: boolean;
103
103
  direction: import("./types").CellDirection;
104
104
  isLink: boolean;
@@ -156,7 +156,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
156
156
  }
157
157
  }
158
158
  onClose();
159
- emit("confirm");
159
+ emit("confirm", currentValue.value);
160
160
  };
161
161
  const onOpen = () => {
162
162
  var _a, _b, _c;
@@ -3,10 +3,10 @@ import type { VNode, ComponentPublicInstance } from 'vue';
3
3
  import type { Numeric } from '../utils';
4
4
  export type DropdownItemOptionValue = Numeric | boolean | string;
5
5
  export type DropdownItemOption = {
6
- text: string;
6
+ text?: string;
7
7
  icon?: string;
8
- value: DropdownItemOptionValue;
9
- selected: boolean;
8
+ value?: DropdownItemOptionValue;
9
+ selected?: boolean;
10
10
  [key: PropertyKey]: any;
11
11
  };
12
12
  export type DropdownItemExpose = {
@@ -382,11 +382,11 @@ declare const _default: import("vue").DefineComponent<{
382
382
  onClickRightIcon?: ((...args: any[]) => any) | undefined;
383
383
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
384
384
  }, {
385
+ center: boolean;
385
386
  type: FieldType;
386
387
  autofocus: boolean;
387
388
  disabled: boolean;
388
389
  value: string;
389
- center: boolean;
390
390
  border: boolean;
391
391
  direction: import("../cell").CellDirection;
392
392
  isLink: boolean;
@@ -227,11 +227,11 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
227
227
  onClickRightIcon?: ((...args: any[]) => any) | undefined;
228
228
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
229
229
  }, {
230
+ center: boolean;
230
231
  type: import("./types").FieldType;
231
232
  autofocus: boolean;
232
233
  disabled: boolean;
233
234
  value: string;
234
- center: boolean;
235
235
  border: boolean;
236
236
  direction: import("..").CellDirection;
237
237
  isLink: boolean;
package/lib/index.d.ts CHANGED
@@ -81,4 +81,4 @@ declare namespace _default {
81
81
  }
82
82
  export default _default;
83
83
  export function install(app: any): void;
84
- export const version: "3.1.13";
84
+ export const version: "3.1.15";
package/lib/index.js CHANGED
@@ -176,7 +176,7 @@ __reExport(stdin_exports, require("./time-picker"), module.exports);
176
176
  __reExport(stdin_exports, require("./timeline"), module.exports);
177
177
  __reExport(stdin_exports, require("./toast"), module.exports);
178
178
  __reExport(stdin_exports, require("./uploader"), module.exports);
179
- const version = "3.1.13";
179
+ const version = "3.1.15";
180
180
  function install(app) {
181
181
  const components = [
182
182
  import_action_sheet.ActionSheet,
@@ -1,4 +1,5 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
+ import { Numeric } from '../utils';
2
3
  import { PickerOption } from './types';
3
4
  declare const multiplePickerProps: {
4
5
  title: StringConstructor;
@@ -51,6 +52,10 @@ declare const multiplePickerProps: {
51
52
  type: import("vue").PropType<number[]>;
52
53
  default: () => number[];
53
54
  };
55
+ selectedValue: {
56
+ type: import("vue").PropType<Numeric[]>;
57
+ default: () => Numeric[];
58
+ };
54
59
  popup: {
55
60
  type: BooleanConstructor;
56
61
  default: true;
@@ -108,11 +113,15 @@ declare const _default: import("vue").DefineComponent<{
108
113
  type: import("vue").PropType<number[]>;
109
114
  default: () => number[];
110
115
  };
116
+ selectedValue: {
117
+ type: import("vue").PropType<Numeric[]>;
118
+ default: () => Numeric[];
119
+ };
111
120
  popup: {
112
121
  type: BooleanConstructor;
113
122
  default: true;
114
123
  };
115
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex")[], "cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
124
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex" | "update:selectedValue")[], "cancel" | "change" | "confirm" | "update:showPicker" | "update:selectedIndex" | "update:selectedValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
116
125
  title: StringConstructor;
117
126
  loading: BooleanConstructor;
118
127
  readonly: BooleanConstructor;
@@ -163,6 +172,10 @@ declare const _default: import("vue").DefineComponent<{
163
172
  type: import("vue").PropType<number[]>;
164
173
  default: () => number[];
165
174
  };
175
+ selectedValue: {
176
+ type: import("vue").PropType<Numeric[]>;
177
+ default: () => Numeric[];
178
+ };
166
179
  popup: {
167
180
  type: BooleanConstructor;
168
181
  default: true;
@@ -173,6 +186,7 @@ declare const _default: import("vue").DefineComponent<{
173
186
  onConfirm?: ((...args: any[]) => any) | undefined;
174
187
  "onUpdate:showPicker"?: ((...args: any[]) => any) | undefined;
175
188
  "onUpdate:selectedIndex"?: ((...args: any[]) => any) | undefined;
189
+ "onUpdate:selectedValue"?: ((...args: any[]) => any) | undefined;
176
190
  }, {
177
191
  readonly: boolean;
178
192
  closeOnClickOverlay: boolean;
@@ -189,5 +203,6 @@ declare const _default: import("vue").DefineComponent<{
189
203
  columnCounts: number;
190
204
  toolbarPosition: string;
191
205
  selectedIndex: number[];
206
+ selectedValue: Numeric[];
192
207
  }, {}>;
193
208
  export default _default;
@@ -34,6 +34,7 @@ var import_vue = require("vue");
34
34
  var import_vue2 = require("vue");
35
35
  var import_utils = require("../utils");
36
36
  var import_format = require("../utils/format");
37
+ var import_deep_clone = require("../utils/deep-clone");
37
38
  var import_loading = __toESM(require("../loading"));
38
39
  var import_MultiplePickerOptions = __toESM(require("./MultiplePickerOptions"));
39
40
  var import_popup = __toESM(require("../popup"));
@@ -57,17 +58,31 @@ const multiplePickerProps = {
57
58
  textKey: (0, import_utils.makeStringProp)("text"),
58
59
  columnCounts: (0, import_utils.makeNumberProp)(3),
59
60
  selectedIndex: (0, import_utils.makeArrayProp)([]),
61
+ selectedValue: (0, import_utils.makeArrayProp)([]),
60
62
  popup: import_utils.truthProp
61
63
  };
62
64
  var stdin_default = (0, import_vue2.defineComponent)({
63
65
  name,
64
66
  props: multiplePickerProps,
65
- emits: ["cancel", "confirm", "change", "update:showPicker", "update:selectedIndex"],
67
+ emits: ["cancel", "confirm", "change", "update:showPicker", "update:selectedIndex", "update:selectedValue"],
66
68
  setup(props, {
67
69
  emit,
68
70
  slots
69
71
  }) {
70
72
  const confirmIndexes = (0, import_vue2.ref)(props.selectedIndex);
73
+ const confirmValues = (0, import_vue2.ref)(props.selectedValue);
74
+ const getIndexesByValues = () => {
75
+ var _a;
76
+ if (confirmValues.value && confirmValues.value.length > 0) {
77
+ confirmIndexes.value.splice(0, confirmIndexes.value.length);
78
+ (_a = props.options) == null ? void 0 : _a.forEach((option, index) => {
79
+ if (option.value && confirmValues.value.includes(option.value)) {
80
+ confirmIndexes.value.push(index);
81
+ }
82
+ });
83
+ }
84
+ };
85
+ getIndexesByValues();
71
86
  const pickerOptions = (0, import_vue2.ref)();
72
87
  const currentShow = (0, import_vue2.ref)(props.showPicker);
73
88
  const DEFAULT_ITEM_HEIGHT = (0, import_vue2.ref)(36);
@@ -75,7 +90,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
75
90
  if (newValue !== props.showPicker) {
76
91
  emit("update:showPicker", newValue);
77
92
  }
78
- confirmIndexes.value = props.selectedIndex;
93
+ confirmIndexes.value = (0, import_deep_clone.deepClone)(props.selectedIndex);
94
+ confirmValues.value = (0, import_deep_clone.deepClone)(props.selectedValue);
95
+ getIndexesByValues();
79
96
  });
80
97
  (0, import_vue2.watch)(() => props.showPicker, (newValue) => {
81
98
  var _a;
@@ -23,6 +23,7 @@ module.exports = __toCommonJS(stdin_exports);
23
23
  var import_vue = require("vue");
24
24
  var import_vue2 = require("vue");
25
25
  var import_utils = require("../utils");
26
+ var import_deep_clone = require("../utils/deep-clone");
26
27
  var import_use_expose = require("../composables/use-expose");
27
28
  const [name, bem] = (0, import_utils.createNamespace)("multiple-picker-options");
28
29
  const multiplePickerOptionsProps = {
@@ -105,7 +106,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
105
106
  }, [slots.options ? slots.options(option) : (0, import_vue.createVNode)("div", childData, null)]);
106
107
  });
107
108
  };
108
- const setConfirmIndex = (indexes) => {
109
+ const setConfirmIndex = (data) => {
110
+ const indexes = (0, import_deep_clone.deepClone)(data);
109
111
  state.confirmed = true;
110
112
  const keys = Object.keys(indexes);
111
113
  currentIndexes.value.length = 0;