sard-uniapp 1.22.0 → 1.22.1

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 (65) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/components/action-sheet/README.md +15 -6
  4. package/components/action-sheet/action-sheet.d.ts +6 -10
  5. package/components/action-sheet/action-sheet.vue +16 -2
  6. package/components/action-sheet/common.d.ts +2 -1
  7. package/components/calendar-input/calendar-input.d.ts +5 -7
  8. package/components/calendar-input/calendar-input.vue +26 -3
  9. package/components/calendar-popout/README.md +15 -5
  10. package/components/calendar-popout/calendar-popout.d.ts +5 -7
  11. package/components/calendar-popout/calendar-popout.vue +19 -12
  12. package/components/calendar-popout/common.d.ts +3 -1
  13. package/components/cascader-input/cascader-input.d.ts +5 -10
  14. package/components/cascader-input/cascader-input.vue +26 -3
  15. package/components/cascader-popout/README.md +16 -6
  16. package/components/cascader-popout/cascader-popout.d.ts +5 -9
  17. package/components/cascader-popout/cascader-popout.vue +19 -12
  18. package/components/cascader-popout/common.d.ts +3 -1
  19. package/components/checkbox-input/checkbox-input.d.ts +5 -7
  20. package/components/checkbox-input/checkbox-input.vue +26 -3
  21. package/components/checkbox-popout/README.md +15 -5
  22. package/components/checkbox-popout/checkbox-popout.d.ts +5 -7
  23. package/components/checkbox-popout/checkbox-popout.vue +14 -6
  24. package/components/checkbox-popout/common.d.ts +3 -1
  25. package/components/crop-image/README.md +12 -3
  26. package/components/crop-image/common.d.ts +2 -1
  27. package/components/crop-image/crop-image.d.ts +5 -3
  28. package/components/crop-image/crop-image.vue +16 -2
  29. package/components/datetime-picker-input/datetime-picker-input.d.ts +5 -7
  30. package/components/datetime-picker-input/datetime-picker-input.vue +26 -3
  31. package/components/datetime-picker-popout/README.md +15 -5
  32. package/components/datetime-picker-popout/common.d.ts +3 -1
  33. package/components/datetime-picker-popout/datetime-picker-popout.d.ts +5 -7
  34. package/components/datetime-picker-popout/datetime-picker-popout.vue +21 -3
  35. package/components/datetime-range-picker-input/datetime-range-picker-input.d.ts +5 -7
  36. package/components/datetime-range-picker-input/datetime-range-picker-input.vue +26 -3
  37. package/components/datetime-range-picker-popout/README.md +15 -5
  38. package/components/datetime-range-picker-popout/common.d.ts +3 -1
  39. package/components/datetime-range-picker-popout/datetime-range-picker-popout.d.ts +5 -7
  40. package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +21 -3
  41. package/components/dialog/dialog.d.ts +1 -1
  42. package/components/dialog-agent/dialog-agent.d.ts +1 -1
  43. package/components/picker-input/picker-input.d.ts +6 -8
  44. package/components/picker-input/picker-input.vue +26 -3
  45. package/components/picker-popout/README.md +15 -5
  46. package/components/picker-popout/common.d.ts +3 -1
  47. package/components/picker-popout/picker-popout.d.ts +6 -8
  48. package/components/picker-popout/picker-popout.vue +21 -3
  49. package/components/popout/popout.d.ts +1 -1
  50. package/components/radio-input/radio-input.d.ts +5 -7
  51. package/components/radio-input/radio-input.vue +26 -3
  52. package/components/radio-popout/README.md +15 -5
  53. package/components/radio-popout/common.d.ts +3 -1
  54. package/components/radio-popout/radio-popout.d.ts +5 -7
  55. package/components/radio-popout/radio-popout.vue +14 -6
  56. package/components/rate/rate.d.ts +1 -1
  57. package/components/share-sheet/README.md +15 -6
  58. package/components/share-sheet/common.d.ts +2 -1
  59. package/components/share-sheet/share-sheet.d.ts +6 -10
  60. package/components/share-sheet/share-sheet.vue +16 -2
  61. package/package.json +2 -2
  62. package/use/useFormPopout.d.ts +6 -2
  63. package/use/useFormPopout.js +9 -1
  64. package/use/usePopoutInput.d.ts +4 -1
  65. package/use/usePopoutInput.js +5 -0
@@ -1,13 +1,11 @@
1
1
  import { type DatetimeRangePickerPopoutProps, type DatetimeRangePickerPopoutSlots } from './common';
2
2
  declare function __VLS_template(): Readonly<DatetimeRangePickerPopoutSlots> & DatetimeRangePickerPopoutSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<DatetimeRangePickerPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
- "update:model-value": (date: (string | Date)[] | undefined) => any;
5
- change: (date: (string | Date)[] | undefined) => any;
6
- "update:visible": (visible: boolean) => any;
3
+ declare const __VLS_component: import("vue").DefineComponent<DatetimeRangePickerPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ [x: string]: any;
5
+ } & {
6
+ [x: string]: any;
7
7
  }, string, import("vue").PublicProps, Readonly<DatetimeRangePickerPopoutProps> & Readonly<{
8
- "onUpdate:model-value"?: ((date: (string | Date)[] | undefined) => any) | undefined;
9
- onChange?: ((date: (string | Date)[] | undefined) => any) | undefined;
10
- "onUpdate:visible"?: ((visible: boolean) => any) | undefined;
8
+ [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
11
9
  }>, {
12
10
  type: string;
13
11
  validateEvent: boolean;
@@ -7,6 +7,7 @@
7
7
  :root-style="popoutStyle"
8
8
  @confirm="onConfirm"
9
9
  @enter="onEnter"
10
+ @visible-hook="onVisibleHook"
10
11
  >
11
12
  <template #visible="{ already }">
12
13
  <sar-datetime-range-picker
@@ -59,6 +60,16 @@ import { useFormPopout } from "../../use";
59
60
  * @property {boolean} validateEvent 是否触发表单验证,默认值:true。
60
61
  * @event {(visible: boolean) => void} update 弹出框显隐时触发
61
62
  * @event {(date: (Date | string)[]) => void} change 日期时间输入组件值改变时触发
63
+ * @event {() => void} confirm 点击确定按钮时触发
64
+ * @event {(name: TransitionHookName) => void} visible-hook 入场/退场动画状态改变时触发
65
+ * @event {() => void} before-enter 入场动画开始前触发
66
+ * @event {() => void} enter 入场动画开始时触发
67
+ * @event {() => void} after-enter 入场动画结束时触发
68
+ * @event {() => void} enter-cancelled 入场动画取消时触发
69
+ * @event {() => void} before-leave 退场动画开始前触发
70
+ * @event {() => void} leave 退场动画开始时触发
71
+ * @event {() => void} after-leave 退场动画结束时触发
72
+ * @event {() => void} leave-cancelled 退场动画取消时触发
62
73
  */
63
74
  export default _defineComponent({
64
75
  components: {
@@ -90,7 +101,7 @@ export default _defineComponent({
90
101
  formatter: { type: Function, required: false },
91
102
  valueFormat: { type: String, required: false }
92
103
  }, defaultDatetimeRangePickerInputProps()),
93
- emits: ["update:visible", "update:model-value", "change"],
104
+ emits: ["update:visible", "update:model-value", "change", "confirm", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
94
105
  setup(__props, { expose: __expose, emit: __emit }) {
95
106
  __expose();
96
107
  const props = __props;
@@ -102,7 +113,14 @@ export default _defineComponent({
102
113
  const maxDate2 = toDate(props.max || getMaxDate(), props.valueFormat);
103
114
  return maxDate2 < minDate.value ? new Date(minDate.value) : maxDate2;
104
115
  });
105
- const { innerVisible, innerValue, popoutValue, onChange, onConfirm } = useFormPopout(props, emit, {
116
+ const {
117
+ innerVisible,
118
+ innerValue,
119
+ popoutValue,
120
+ onChange,
121
+ onConfirm,
122
+ onVisibleHook
123
+ } = useFormPopout(props, emit, {
106
124
  onConfirmBefore() {
107
125
  if (!popoutValue.value || Array.isArray(popoutValue.value) && popoutValue.value.filter(Boolean).length < 2) {
108
126
  popoutValue.value = normalizeRangeValue(
@@ -119,7 +137,7 @@ export default _defineComponent({
119
137
  popoutValue.value = innerValue.value;
120
138
  }
121
139
  };
122
- const __returned__ = { props, emit, minDate, maxDate, innerVisible, innerValue, popoutValue, onChange, onConfirm, onEnter, SarPopout, SarDatetimeRangePicker };
140
+ const __returned__ = { props, emit, minDate, maxDate, innerVisible, innerValue, popoutValue, onChange, onConfirm, onVisibleHook, onEnter, SarPopout, SarDatetimeRangePicker };
123
141
  return __returned__;
124
142
  }
125
143
  });
@@ -8,8 +8,8 @@ declare const __VLS_component: import("vue").DefineComponent<DialogProps, {}, {}
8
8
  [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
9
9
  }>, {
10
10
  buttonType: "round" | "text";
11
- showConfirm: boolean;
12
11
  duration: number;
12
+ showConfirm: boolean;
13
13
  overlayClosable: boolean;
14
14
  showCancel: boolean;
15
15
  headed: boolean;
@@ -8,8 +8,8 @@ declare const _default: import("vue").DefineComponent<DialogAgentProps, {}, {},
8
8
  }>, {
9
9
  id: string;
10
10
  buttonType: "round" | "text";
11
- showConfirm: boolean;
12
11
  duration: number;
12
+ showConfirm: boolean;
13
13
  overlayClosable: boolean;
14
14
  showCancel: boolean;
15
15
  headed: boolean;
@@ -1,18 +1,16 @@
1
1
  import { type PickerOption } from '../picker/common';
2
2
  import { type PickerInputProps, type PickerInputSlots } from './common';
3
3
  declare function __VLS_template(): Readonly<PickerInputSlots> & PickerInputSlots;
4
- declare const __VLS_component: import("vue").DefineComponent<PickerInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
5
- "update:model-value": (value: any) => any;
6
- change: (value: any) => any;
7
- "update:visible": (visible: boolean) => any;
4
+ declare const __VLS_component: import("vue").DefineComponent<PickerInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ [x: string]: any;
6
+ } & {
7
+ [x: string]: any;
8
8
  }, string, import("vue").PublicProps, Readonly<PickerInputProps> & Readonly<{
9
- "onUpdate:model-value"?: ((value: any) => any) | undefined;
10
- onChange?: ((value: any) => any) | undefined;
11
- "onUpdate:visible"?: ((visible: boolean) => any) | undefined;
9
+ [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
12
10
  }>, {
13
11
  valueOnClear: () => any;
14
- validateEvent: boolean;
15
12
  columns: PickerOption[] | PickerOption[][];
13
+ validateEvent: boolean;
16
14
  immediateChange: boolean;
17
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
16
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
@@ -30,6 +30,8 @@
30
30
  :validate-event="validateEvent"
31
31
  :internal-custom="$slots.custom ? 1 : 0"
32
32
  @change="onChange"
33
+ @visible-hook="onVisibleHook"
34
+ @confirm="onConfirm"
33
35
  >
34
36
  <template
35
37
  v-if="$slots.custom"
@@ -95,6 +97,16 @@ import {
95
97
  * @property {InputProps} inputProps 自定义输入框组件属性,默认值:-。
96
98
  * @event {(visible: boolean) => void} update 弹出框显隐时触发
97
99
  * @event {(value: any) => void} change 选择器输入组件值改变时触发
100
+ * @event {() => void} confirm 点击确定按钮时触发
101
+ * @event {(name: TransitionHookName) => void} visible-hook 入场/退场动画状态改变时触发
102
+ * @event {() => void} before-enter 入场动画开始前触发
103
+ * @event {() => void} enter 入场动画开始时触发
104
+ * @event {() => void} after-enter 入场动画结束时触发
105
+ * @event {() => void} enter-cancelled 入场动画取消时触发
106
+ * @event {() => void} before-leave 退场动画开始前触发
107
+ * @event {() => void} leave 退场动画开始时触发
108
+ * @event {() => void} after-leave 退场动画结束时触发
109
+ * @event {() => void} leave-cancelled 退场动画取消时触发
98
110
  */
99
111
  export default _defineComponent({
100
112
  components: {
@@ -133,12 +145,20 @@ export default _defineComponent({
133
145
  internalArrow: { type: Number, required: false },
134
146
  inputProps: { type: Object, required: false }
135
147
  }, defaultPickerInputProps()),
136
- emits: ["update:visible", "update:model-value", "change"],
148
+ emits: ["update:visible", "update:model-value", "change", "confirm", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
137
149
  setup(__props, { expose: __expose, emit: __emit }) {
138
150
  __expose();
139
151
  const props = __props;
140
152
  const emit = __emit;
141
- const { innerVisible, innerValue, inputValue, show, onChange, onClear } = usePopoutInput(props, emit);
153
+ const {
154
+ innerVisible,
155
+ innerValue,
156
+ inputValue,
157
+ show,
158
+ onChange,
159
+ onClear,
160
+ onVisibleHook
161
+ } = usePopoutInput(props, emit);
142
162
  const fieldKeys = computed(() => {
143
163
  return Object.assign({}, defaultOptionKeys, props.optionKeys);
144
164
  });
@@ -165,7 +185,10 @@ export default _defineComponent({
165
185
  immediate: true
166
186
  }
167
187
  );
168
- const __returned__ = { props, emit, innerVisible, innerValue, inputValue, show, onChange, onClear, fieldKeys, getOutletText, getInputValue, SarPopoutInput, SarPickerPopout };
188
+ const onConfirm = () => {
189
+ emit("confirm");
190
+ };
191
+ const __returned__ = { props, emit, innerVisible, innerValue, inputValue, show, onChange, onClear, onVisibleHook, fieldKeys, getOutletText, getInputValue, onConfirm, SarPopoutInput, SarPickerPopout };
169
192
  return __returned__;
170
193
  }
171
194
  });
@@ -44,8 +44,18 @@ import PickerPopout from 'sard-uniapp/components/picker-popout/picker-popout.vue
44
44
 
45
45
  ### PickerPopoutEmits
46
46
 
47
- | 事件 | 描述 | 类型 |
48
- | ------------------ | -------------------------- | -------------------------- |
49
- | update:model-value | 选择器输入组件值改变时触发 | (value: any) => void |
50
- | change | 选择器输入组件值改变时触发 | (value: any) => void |
51
- | update:visible | 弹出框显隐时触发 | (visible: boolean) => void |
47
+ | 事件 | 描述 | 类型 |
48
+ | ---------------------------------- | --------------------------- | ---------------------------------- |
49
+ | update:model-value | 选择器输入组件值改变时触发 | (value: any) => void |
50
+ | change | 选择器输入组件值改变时触发 | (value: any) => void |
51
+ | update:visible | 弹出框显隐时触发 | (visible: boolean) => void |
52
+ | confirm <sup>1.22.1+</sup> | 点击确定按钮时触发 | () => void |
53
+ | visible-hook <sup>1.22.1+</sup> | 入场/退场动画状态改变时触发 | (name: TransitionHookName) => void |
54
+ | before-enter <sup>1.22.1+</sup> | 入场动画开始前触发 | () => void |
55
+ | enter <sup>1.22.1+</sup> | 入场动画开始时触发 | () => void |
56
+ | after-enter <sup>1.22.1+</sup> | 入场动画结束时触发 | () => void |
57
+ | enter-cancelled <sup>1.22.1+</sup> | 入场动画取消时触发 | () => void |
58
+ | before-leave <sup>1.22.1+</sup> | 退场动画开始前触发 | () => void |
59
+ | leave <sup>1.22.1+</sup> | 退场动画开始时触发 | () => void |
60
+ | after-leave <sup>1.22.1+</sup> | 退场动画结束时触发 | () => void |
61
+ | leave-cancelled <sup>1.22.1+</sup> | 退场动画取消时触发 | () => void |
@@ -1,5 +1,6 @@
1
1
  import { type StyleValue } from 'vue';
2
2
  import { type PickerSlots, type PickerProps } from '../picker/common';
3
+ import { type TransitionHookEmits } from '../popup/common';
3
4
  export interface PickerPopoutProps extends PickerProps {
4
5
  visible?: boolean;
5
6
  title?: string;
@@ -14,10 +15,11 @@ export declare const defaultPickerPopoutProps: () => {
14
15
  };
15
16
  export interface PickerPopoutSlots extends PickerSlots {
16
17
  }
17
- export interface PickerPopoutEmits {
18
+ export interface PickerPopoutEmits extends TransitionHookEmits {
18
19
  (e: 'update:visible', visible: boolean): void;
19
20
  (e: 'update:model-value', value: any): void;
20
21
  (e: 'change', value: any): void;
22
+ (e: 'confirm'): void;
21
23
  }
22
24
  export interface PickerPopoutExpose {
23
25
  }
@@ -1,16 +1,14 @@
1
1
  import { type PickerPopoutProps, type PickerPopoutSlots } from './common';
2
2
  declare function __VLS_template(): Readonly<PickerPopoutSlots> & PickerPopoutSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<PickerPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
- "update:model-value": (value: any) => any;
5
- change: (value: any) => any;
6
- "update:visible": (visible: boolean) => any;
3
+ declare const __VLS_component: import("vue").DefineComponent<PickerPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ [x: string]: any;
5
+ } & {
6
+ [x: string]: any;
7
7
  }, string, import("vue").PublicProps, Readonly<PickerPopoutProps> & Readonly<{
8
- "onUpdate:model-value"?: ((value: any) => any) | undefined;
9
- onChange?: ((value: any) => any) | undefined;
10
- "onUpdate:visible"?: ((visible: boolean) => any) | undefined;
8
+ [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
11
9
  }>, {
12
- validateEvent: boolean;
13
10
  columns: import("../picker/common").PickerOption[] | import("../picker/common").PickerOption[][];
11
+ validateEvent: boolean;
14
12
  immediateChange: boolean;
15
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
14
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
@@ -7,6 +7,7 @@
7
7
  :root-style="popoutStyle"
8
8
  @confirm="onConfirm"
9
9
  @enter="onEnter"
10
+ @visible-hook="onVisibleHook"
10
11
  >
11
12
  <template #visible="{ already }">
12
13
  <sar-picker
@@ -71,6 +72,16 @@ import { useFormPopout } from "../../use";
71
72
  * @property {boolean} validateEvent 是否触发表单验证,默认值:true。
72
73
  * @event {(visible: boolean) => void} update 弹出框显隐时触发
73
74
  * @event {(value: any) => void} change 选择器输入组件值改变时触发
75
+ * @event {() => void} confirm 点击确定按钮时触发
76
+ * @event {(name: TransitionHookName) => void} visible-hook 入场/退场动画状态改变时触发
77
+ * @event {() => void} before-enter 入场动画开始前触发
78
+ * @event {() => void} enter 入场动画开始时触发
79
+ * @event {() => void} after-enter 入场动画结束时触发
80
+ * @event {() => void} enter-cancelled 入场动画取消时触发
81
+ * @event {() => void} before-leave 退场动画开始前触发
82
+ * @event {() => void} leave 退场动画开始时触发
83
+ * @event {() => void} after-leave 退场动画结束时触发
84
+ * @event {() => void} leave-cancelled 退场动画取消时触发
74
85
  */
75
86
  export default _defineComponent({
76
87
  components: {
@@ -98,12 +109,19 @@ export default _defineComponent({
98
109
  immediateChange: { type: Boolean, required: false },
99
110
  internalCustom: { type: Number, required: false }
100
111
  }, defaultPickerPopoutProps()),
101
- emits: ["update:visible", "update:model-value", "change"],
112
+ emits: ["update:visible", "update:model-value", "change", "confirm", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
102
113
  setup(__props, { expose: __expose, emit: __emit }) {
103
114
  __expose();
104
115
  const props = __props;
105
116
  const emit = __emit;
106
- const { innerVisible, innerValue, popoutValue, onChange, onConfirm } = useFormPopout(props, emit, {
117
+ const {
118
+ innerVisible,
119
+ innerValue,
120
+ popoutValue,
121
+ onChange,
122
+ onConfirm,
123
+ onVisibleHook
124
+ } = useFormPopout(props, emit, {
107
125
  onConfirmBefore() {
108
126
  if (isEmptyBinding(popoutValue.value)) {
109
127
  const [initialValue, selectedOptions] = getInitialValue(
@@ -123,7 +141,7 @@ export default _defineComponent({
123
141
  popoutValue.value = innerValue.value;
124
142
  }
125
143
  };
126
- const __returned__ = { props, emit, innerVisible, innerValue, popoutValue, onChange, onConfirm, fieldKeys, onEnter, SarPopout, SarPicker, get isNumber() {
144
+ const __returned__ = { props, emit, innerVisible, innerValue, popoutValue, onChange, onConfirm, onVisibleHook, fieldKeys, onEnter, SarPopout, SarPicker, get isNumber() {
127
145
  return isNumber;
128
146
  } };
129
147
  return __returned__;
@@ -8,8 +8,8 @@ declare const __VLS_component: import("vue").DefineComponent<PopoutProps, {}, {}
8
8
  [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
9
9
  }>, {
10
10
  type: "compact" | "loose";
11
- showConfirm: boolean;
12
11
  duration: number;
12
+ showConfirm: boolean;
13
13
  overlayClosable: boolean;
14
14
  showClose: boolean;
15
15
  showFooter: boolean;
@@ -1,13 +1,11 @@
1
1
  import { type RadioInputProps, type RadioInputSlots } from './common';
2
2
  declare function __VLS_template(): Readonly<RadioInputSlots> & RadioInputSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<RadioInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
- "update:model-value": (value: any) => any;
5
- change: (value: any) => any;
6
- "update:visible": (visible: boolean) => any;
3
+ declare const __VLS_component: import("vue").DefineComponent<RadioInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ [x: string]: any;
5
+ } & {
6
+ [x: string]: any;
7
7
  }, string, import("vue").PublicProps, Readonly<RadioInputProps> & Readonly<{
8
- "onUpdate:model-value"?: ((value: any) => any) | undefined;
9
- onChange?: ((value: any) => any) | undefined;
10
- "onUpdate:visible"?: ((visible: boolean) => any) | undefined;
8
+ [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
11
9
  }>, {
12
10
  options: import("../radio/common").RadioGroupOption[];
13
11
  type: import("../radio/common").IconType;
@@ -31,6 +31,8 @@
31
31
  :searchable="searchable"
32
32
  :filter-placeholder="filterPlaceholder"
33
33
  @change="onChange"
34
+ @visible-hook="onVisibleHook"
35
+ @confirm="onConfirm"
34
36
  />
35
37
  </sar-popout-input>
36
38
  </template>
@@ -73,6 +75,16 @@ import { usePopoutInput } from "../../use";
73
75
  * @property {InputProps} inputProps 自定义输入框组件属性,默认值:-。
74
76
  * @event {(visible: boolean) => void} update 弹出框显隐时触发
75
77
  * @event {(value: any | undefined) => void} change 单选输入组件值改变时触发
78
+ * @event {() => void} confirm 点击确定按钮时触发
79
+ * @event {(name: TransitionHookName) => void} visible-hook 入场/退场动画状态改变时触发
80
+ * @event {() => void} before-enter 入场动画开始前触发
81
+ * @event {() => void} enter 入场动画开始时触发
82
+ * @event {() => void} after-enter 入场动画结束时触发
83
+ * @event {() => void} enter-cancelled 入场动画取消时触发
84
+ * @event {() => void} before-leave 退场动画开始前触发
85
+ * @event {() => void} leave 退场动画开始时触发
86
+ * @event {() => void} after-leave 退场动画结束时触发
87
+ * @event {() => void} leave-cancelled 退场动画取消时触发
76
88
  */
77
89
  export default _defineComponent({
78
90
  components: {
@@ -115,12 +127,20 @@ export default _defineComponent({
115
127
  internalArrow: { type: Number, required: false },
116
128
  inputProps: { type: Object, required: false }
117
129
  }, defaultRadioInputProps()),
118
- emits: ["update:visible", "update:model-value", "change"],
130
+ emits: ["update:visible", "update:model-value", "change", "confirm", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
119
131
  setup(__props, { expose: __expose, emit: __emit }) {
120
132
  __expose();
121
133
  const props = __props;
122
134
  const emit = __emit;
123
- const { innerVisible, innerValue, inputValue, show, onChange, onClear } = usePopoutInput(props, emit);
135
+ const {
136
+ innerVisible,
137
+ innerValue,
138
+ inputValue,
139
+ show,
140
+ onChange,
141
+ onClear,
142
+ onVisibleHook
143
+ } = usePopoutInput(props, emit);
124
144
  const fieldKeys = computed(() => {
125
145
  return Object.assign({}, defaultOptionKeys, props.optionKeys);
126
146
  });
@@ -145,7 +165,10 @@ export default _defineComponent({
145
165
  immediate: true
146
166
  }
147
167
  );
148
- const __returned__ = { props, emit, innerVisible, innerValue, inputValue, show, onChange, onClear, fieldKeys, getOutletText, getInputValue, SarPopoutInput, SarRadioPopout };
168
+ const onConfirm = () => {
169
+ emit("confirm");
170
+ };
171
+ const __returned__ = { props, emit, innerVisible, innerValue, inputValue, show, onChange, onClear, onVisibleHook, fieldKeys, getOutletText, getInputValue, onConfirm, SarPopoutInput, SarRadioPopout };
149
172
  return __returned__;
150
173
  }
151
174
  });
@@ -53,11 +53,21 @@ import RadioPopout from 'sard-uniapp/components/radio-popout/radio-popout.vue'
53
53
 
54
54
  ### RadioPopoutEmits
55
55
 
56
- | 事件 | 描述 | 类型 |
57
- | ------------------ | ------------------------ | --------------------------------- |
58
- | update:model-value | 单选输入组件值改变时触发 | (value: any \| undefined) => void |
59
- | change | 单选输入组件值改变时触发 | (value: any \| undefined) => void |
60
- | update:visible | 弹出框显隐时触发 | (visible: boolean) => void |
56
+ | 事件 | 描述 | 类型 |
57
+ | ---------------------------------- | --------------------------- | ---------------------------------- |
58
+ | update:model-value | 单选输入组件值改变时触发 | (value: any \| undefined) => void |
59
+ | change | 单选输入组件值改变时触发 | (value: any \| undefined) => void |
60
+ | update:visible | 弹出框显隐时触发 | (visible: boolean) => void |
61
+ | confirm <sup>1.22.1+</sup> | 点击确定按钮时触发 | () => void |
62
+ | visible-hook <sup>1.22.1+</sup> | 入场/退场动画状态改变时触发 | (name: TransitionHookName) => void |
63
+ | before-enter <sup>1.22.1+</sup> | 入场动画开始前触发 | () => void |
64
+ | enter <sup>1.22.1+</sup> | 入场动画开始时触发 | () => void |
65
+ | after-enter <sup>1.22.1+</sup> | 入场动画结束时触发 | () => void |
66
+ | enter-cancelled <sup>1.22.1+</sup> | 入场动画取消时触发 | () => void |
67
+ | before-leave <sup>1.22.1+</sup> | 退场动画开始前触发 | () => void |
68
+ | leave <sup>1.22.1+</sup> | 退场动画开始时触发 | () => void |
69
+ | after-leave <sup>1.22.1+</sup> | 退场动画结束时触发 | () => void |
70
+ | leave-cancelled <sup>1.22.1+</sup> | 退场动画取消时触发 | () => void |
61
71
 
62
72
  ## 主题定制
63
73
 
@@ -1,5 +1,6 @@
1
1
  import { type StyleValue } from 'vue';
2
2
  import { type RadioGroupProps } from '../radio/common';
3
+ import { type TransitionHookEmits } from '../popup/common';
3
4
  export interface RadioPopoutProps extends RadioGroupProps {
4
5
  visible?: boolean;
5
6
  title?: string;
@@ -16,10 +17,11 @@ export declare const defaultRadioPopoutProps: () => {
16
17
  export interface RadioPopoutSlots {
17
18
  default?(props: Record<string, never>): any;
18
19
  }
19
- export interface RadioPopoutEmits {
20
+ export interface RadioPopoutEmits extends TransitionHookEmits {
20
21
  (e: 'update:visible', visible: boolean): void;
21
22
  (e: 'update:model-value', value: any): void;
22
23
  (e: 'change', value: any): void;
24
+ (e: 'confirm'): void;
23
25
  }
24
26
  export interface RadioPopoutExpose {
25
27
  }
@@ -1,13 +1,11 @@
1
1
  import { type RadioPopoutProps, type RadioPopoutSlots } from './common';
2
2
  declare function __VLS_template(): Readonly<RadioPopoutSlots> & RadioPopoutSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<RadioPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
4
- "update:model-value": (value: any) => any;
5
- change: (value: any) => any;
6
- "update:visible": (visible: boolean) => any;
3
+ declare const __VLS_component: import("vue").DefineComponent<RadioPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ [x: string]: any;
5
+ } & {
6
+ [x: string]: any;
7
7
  }, string, import("vue").PublicProps, Readonly<RadioPopoutProps> & Readonly<{
8
- "onUpdate:model-value"?: ((value: any) => any) | undefined;
9
- onChange?: ((value: any) => any) | undefined;
10
- "onUpdate:visible"?: ((visible: boolean) => any) | undefined;
8
+ [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
11
9
  }>, {
12
10
  options: import("../radio/common").RadioGroupOption[];
13
11
  type: import("../radio/common").IconType;
@@ -5,6 +5,7 @@
5
5
  :root-class="popoutClass"
6
6
  :root-style="popoutStyle"
7
7
  @confirm="onConfirm"
8
+ @visible-hook="onVisibleHook"
8
9
  >
9
10
  <template #visible="{ already }">
10
11
  <view v-if="already">
@@ -104,6 +105,16 @@ import { useScrollSide, useFormPopout } from "../../use";
104
105
  * @property {string} filterPlaceholder 搜索输入框占位符内容,默认值:-。
105
106
  * @event {(visible: boolean) => void} update 弹出框显隐时触发
106
107
  * @event {(value: any | undefined) => void} change 单选输入组件值改变时触发
108
+ * @event {() => void} confirm 点击确定按钮时触发
109
+ * @event {(name: TransitionHookName) => void} visible-hook 入场/退场动画状态改变时触发
110
+ * @event {() => void} before-enter 入场动画开始前触发
111
+ * @event {() => void} enter 入场动画开始时触发
112
+ * @event {() => void} after-enter 入场动画结束时触发
113
+ * @event {() => void} enter-cancelled 入场动画取消时触发
114
+ * @event {() => void} before-leave 退场动画开始前触发
115
+ * @event {() => void} leave 退场动画开始时触发
116
+ * @event {() => void} after-leave 退场动画结束时触发
117
+ * @event {() => void} leave-cancelled 退场动画取消时触发
107
118
  */
108
119
  export default _defineComponent({
109
120
  components: {
@@ -142,16 +153,13 @@ export default _defineComponent({
142
153
  options: { type: Array, required: false },
143
154
  optionKeys: { type: Object, required: false }
144
155
  }, defaultRadioPopoutProps()),
145
- emits: ["update:visible", "update:model-value", "change"],
156
+ emits: ["update:visible", "update:model-value", "change", "confirm", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
146
157
  setup(__props, { expose: __expose, emit: __emit }) {
147
158
  __expose();
148
159
  const props = __props;
149
160
  const emit = __emit;
150
161
  const bem = createBem("radio-popout");
151
- const { innerVisible, popoutValue, onChange, onConfirm } = useFormPopout(
152
- props,
153
- emit
154
- );
162
+ const { innerVisible, popoutValue, onChange, onConfirm, onVisibleHook } = useFormPopout(props, emit);
155
163
  const fieldKeys = computed(() => {
156
164
  return Object.assign({}, defaultOptionKeys, props.optionKeys);
157
165
  });
@@ -190,7 +198,7 @@ export default _defineComponent({
190
198
  bem.em("scroll", "searchable", props.searchable)
191
199
  );
192
200
  });
193
- const __returned__ = { props, emit, bem, innerVisible, popoutValue, onChange, onConfirm, fieldKeys, objectOptions, select, searchValue, filteredOptions, scrollSide, onScroll, onScrolltoupper, onScrolltolower, containerClass, scrollClass, SarPopout, SarRadioGroup, SarRadio, SarList, SarListItem, SarIcon, SarInput };
201
+ const __returned__ = { props, emit, bem, innerVisible, popoutValue, onChange, onConfirm, onVisibleHook, fieldKeys, objectOptions, select, searchValue, filteredOptions, scrollSide, onScroll, onScrolltoupper, onScrolltolower, containerClass, scrollClass, SarPopout, SarRadioGroup, SarRadio, SarList, SarListItem, SarIcon, SarInput };
194
202
  return __returned__;
195
203
  }
196
204
  });
@@ -6,8 +6,8 @@ declare const _default: import("vue").DefineComponent<RateProps, {}, {}, {}, {},
6
6
  "onUpdate:model-value"?: ((value: number) => any) | undefined;
7
7
  onChange?: ((value: number) => any) | undefined;
8
8
  }>, {
9
- validateEvent: boolean;
10
9
  count: number;
10
+ validateEvent: boolean;
11
11
  icon: string;
12
12
  voidIcon: string;
13
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -68,12 +68,21 @@ import ShareSheet from 'sard-uniapp/components/share-sheet/share-sheet.vue'
68
68
 
69
69
  ### ShareSheetEmits
70
70
 
71
- | 事件 | 描述 | 类型 |
72
- | -------------- | ------------------ | ------------------------------ |
73
- | update:visible | 分享面板显隐时触发 | (visible: boolean) => void |
74
- | close | 点击遮罩时触发 | () => void |
75
- | cancel | 点击取消按钮时触发 | () => void |
76
- | select | 点击分享项时触发 | (item: ShareSheetItem) => void |
71
+ | 事件 | 描述 | 类型 |
72
+ | ---------------------------------- | --------------------------- | ---------------------------------- |
73
+ | update:visible | 分享面板显隐时触发 | (visible: boolean) => void |
74
+ | close | 点击遮罩时触发 | () => void |
75
+ | cancel | 点击取消按钮时触发 | () => void |
76
+ | select | 点击分享项时触发 | (item: ShareSheetItem) => void |
77
+ | visible-hook <sup>1.22.1+</sup> | 入场/退场动画状态改变时触发 | (name: TransitionHookName) => void |
78
+ | before-enter <sup>1.22.1+</sup> | 入场动画开始前触发 | () => void |
79
+ | enter <sup>1.22.1+</sup> | 入场动画开始时触发 | () => void |
80
+ | after-enter <sup>1.22.1+</sup> | 入场动画结束时触发 | () => void |
81
+ | enter-cancelled <sup>1.22.1+</sup> | 入场动画取消时触发 | () => void |
82
+ | before-leave <sup>1.22.1+</sup> | 退场动画开始前触发 | () => void |
83
+ | leave <sup>1.22.1+</sup> | 退场动画开始时触发 | () => void |
84
+ | after-leave <sup>1.22.1+</sup> | 退场动画结束时触发 | () => void |
85
+ | leave-cancelled <sup>1.22.1+</sup> | 退场动画取消时触发 | () => void |
77
86
 
78
87
  ### ShareSheetItem
79
88
 
@@ -1,4 +1,5 @@
1
1
  import { type StyleValue } from 'vue';
2
+ import { type TransitionHookEmits } from '../popup/common';
2
3
  export interface ShareSheetProps {
3
4
  rootStyle?: StyleValue;
4
5
  rootClass?: string;
@@ -15,7 +16,7 @@ export declare const defaultShareSheetProps: {
15
16
  overlayClosable: boolean;
16
17
  duration: number;
17
18
  };
18
- export interface ShareSheetEmits {
19
+ export interface ShareSheetEmits extends TransitionHookEmits {
19
20
  (e: 'update:visible', visible: boolean): void;
20
21
  (e: 'close'): void;
21
22
  (e: 'cancel'): void;
@@ -1,14 +1,10 @@
1
- import { type ShareSheetProps, type ShareSheetItem } from './common';
2
- declare const _default: import("vue").DefineComponent<ShareSheetProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
- cancel: () => any;
4
- close: () => any;
5
- select: (item: ShareSheetItem) => any;
6
- "update:visible": (visible: boolean) => any;
1
+ import { type ShareSheetProps } from './common';
2
+ declare const _default: import("vue").DefineComponent<ShareSheetProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ [x: string]: any;
4
+ } & {
5
+ [x: string]: any;
7
6
  }, string, import("vue").PublicProps, Readonly<ShareSheetProps> & Readonly<{
8
- onCancel?: (() => any) | undefined;
9
- onClose?: (() => any) | undefined;
10
- onSelect?: ((item: ShareSheetItem) => any) | undefined;
11
- "onUpdate:visible"?: ((visible: boolean) => any) | undefined;
7
+ [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
12
8
  }>, {
13
9
  duration: number;
14
10
  overlayClosable: boolean;