sard-uniapp 1.21.2 → 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.
- package/CHANGELOG.md +26 -1
- package/README.md +1 -1
- package/components/accordion/README.md +13 -6
- package/components/accordion/accordion.vue +10 -3
- package/components/accordion/common.d.ts +2 -0
- package/components/accordion/index.scss +6 -0
- package/components/accordion-item/accordion-item.vue +6 -1
- package/components/accordion-item/index.scss +12 -0
- package/components/action-sheet/README.md +15 -6
- package/components/action-sheet/action-sheet.d.ts +6 -10
- package/components/action-sheet/action-sheet.vue +16 -2
- package/components/action-sheet/common.d.ts +2 -1
- package/components/calendar-input/README.md +9 -0
- package/components/calendar-input/calendar-input.d.ts +13 -8
- package/components/calendar-input/calendar-input.vue +39 -4
- package/components/calendar-input/common.d.ts +3 -1
- package/components/calendar-popout/README.md +15 -5
- package/components/calendar-popout/calendar-popout.d.ts +5 -7
- package/components/calendar-popout/calendar-popout.vue +19 -12
- package/components/calendar-popout/common.d.ts +3 -1
- package/components/cascader-input/README.md +8 -1
- package/components/cascader-input/cascader-input.d.ts +5 -10
- package/components/cascader-input/cascader-input.vue +39 -4
- package/components/cascader-input/common.d.ts +2 -2
- package/components/cascader-popout/README.md +16 -6
- package/components/cascader-popout/cascader-popout.d.ts +5 -9
- package/components/cascader-popout/cascader-popout.vue +19 -12
- package/components/cascader-popout/common.d.ts +3 -1
- package/components/checkbox-input/README.md +9 -0
- package/components/checkbox-input/checkbox-input.d.ts +13 -8
- package/components/checkbox-input/checkbox-input.vue +39 -4
- package/components/checkbox-input/common.d.ts +3 -1
- package/components/checkbox-popout/README.md +15 -5
- package/components/checkbox-popout/checkbox-popout.d.ts +5 -7
- package/components/checkbox-popout/checkbox-popout.vue +14 -6
- package/components/checkbox-popout/common.d.ts +3 -1
- package/components/config/index.d.ts +5 -0
- package/components/config/index.js +5 -0
- package/components/crop-image/README.md +12 -3
- package/components/crop-image/common.d.ts +2 -1
- package/components/crop-image/crop-image.d.ts +5 -3
- package/components/crop-image/crop-image.vue +16 -2
- package/components/datetime-picker-input/README.md +9 -0
- package/components/datetime-picker-input/common.d.ts +2 -2
- package/components/datetime-picker-input/datetime-picker-input.d.ts +5 -7
- package/components/datetime-picker-input/datetime-picker-input.vue +39 -4
- package/components/datetime-picker-popout/README.md +15 -5
- package/components/datetime-picker-popout/common.d.ts +3 -1
- package/components/datetime-picker-popout/datetime-picker-popout.d.ts +5 -7
- package/components/datetime-picker-popout/datetime-picker-popout.vue +21 -3
- package/components/datetime-range-picker-input/README.md +9 -0
- package/components/datetime-range-picker-input/common.d.ts +2 -2
- package/components/datetime-range-picker-input/datetime-range-picker-input.d.ts +5 -7
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +39 -4
- package/components/datetime-range-picker-popout/README.md +15 -5
- package/components/datetime-range-picker-popout/common.d.ts +3 -1
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.d.ts +5 -7
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +21 -3
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog-agent/dialog-agent.d.ts +1 -1
- package/components/dnd/README.md +120 -0
- package/components/dnd/common.d.ts +49 -0
- package/components/dnd/common.js +1 -0
- package/components/dnd/dnd.d.ts +37 -0
- package/components/dnd/dnd.vue +136 -0
- package/components/dnd/index.d.ts +1 -0
- package/components/dnd/index.js +1 -0
- package/components/dnd/index.scss +11 -0
- package/components/dnd/variables.scss +7 -0
- package/components/dnd-handle/common.d.ts +12 -0
- package/components/dnd-handle/common.js +1 -0
- package/components/dnd-handle/dnd-handle.d.ts +10 -0
- package/components/dnd-handle/dnd-handle.vue +89 -0
- package/components/dnd-handle/index.d.ts +1 -0
- package/components/dnd-handle/index.js +1 -0
- package/components/dnd-handle/index.scss +13 -0
- package/components/dnd-item/common.d.ts +21 -0
- package/components/dnd-item/common.js +1 -0
- package/components/dnd-item/dnd-item.d.ts +10 -0
- package/components/dnd-item/dnd-item.vue +193 -0
- package/components/dnd-item/index.d.ts +1 -0
- package/components/dnd-item/index.js +1 -0
- package/components/dnd-item/index.scss +28 -0
- package/components/floating-bubble/index.scss +1 -0
- package/components/form/README.md +6 -5
- package/components/form/common.d.ts +4 -0
- package/components/form-item/form-item.vue +10 -4
- package/components/picker-input/README.md +9 -0
- package/components/picker-input/common.d.ts +2 -2
- package/components/picker-input/picker-input.d.ts +6 -8
- package/components/picker-input/picker-input.vue +41 -4
- package/components/picker-popout/README.md +15 -5
- package/components/picker-popout/common.d.ts +3 -1
- package/components/picker-popout/picker-popout.d.ts +6 -8
- package/components/picker-popout/picker-popout.vue +21 -3
- package/components/popout/popout.d.ts +1 -1
- package/components/popout-input/README.md +20 -11
- package/components/popout-input/common.d.ts +10 -0
- package/components/popout-input/common.js +2 -1
- package/components/popout-input/index.scss +1 -0
- package/components/popout-input/popout-input.d.ts +5 -1
- package/components/popout-input/popout-input.vue +22 -7
- package/components/popup/README.md +24 -22
- package/components/popup/common.d.ts +3 -0
- package/components/popup/popup.d.ts +8 -5
- package/components/popup/popup.vue +25 -2
- package/components/radio-input/README.md +9 -0
- package/components/radio-input/common.d.ts +3 -1
- package/components/radio-input/radio-input.d.ts +13 -8
- package/components/radio-input/radio-input.vue +39 -4
- package/components/radio-popout/README.md +15 -5
- package/components/radio-popout/common.d.ts +3 -1
- package/components/radio-popout/radio-popout.d.ts +5 -7
- package/components/radio-popout/radio-popout.vue +14 -6
- package/components/rate/rate.d.ts +1 -1
- package/components/share-sheet/README.md +15 -6
- package/components/share-sheet/common.d.ts +2 -1
- package/components/share-sheet/share-sheet.d.ts +6 -10
- package/components/share-sheet/share-sheet.vue +17 -3
- package/components/stepper/common.d.ts +1 -1
- package/components/stepper/stepper.vue +1 -1
- package/components/style/mixins/disable-scroll.scss +14 -0
- package/components/style/mixins.scss +1 -0
- package/components/style/variables.scss +4 -0
- package/components/tree/common.d.ts +1 -0
- package/components/tree/index.scss +4 -0
- package/components/tree/tree.vue +33 -21
- package/components/tree/variables.scss +1 -2
- package/components/tree-node/tree-node.vue +2 -0
- package/global.d.ts +3 -0
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/index.scss +1 -0
- package/package.json +2 -2
- package/use/index.d.ts +1 -0
- package/use/index.js +1 -0
- package/use/useFormPopout.d.ts +6 -2
- package/use/useFormPopout.js +9 -1
- package/use/useKeyList.d.ts +5 -0
- package/use/useKeyList.js +15 -0
- package/use/usePopoutInput.d.ts +4 -1
- package/use/usePopoutInput.js +5 -0
- package/utils/array.js +6 -6
|
@@ -2,6 +2,7 @@ import { type PopoutInputProps } from './common';
|
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
prepend?(_: {}): any;
|
|
4
4
|
append?(_: {}): any;
|
|
5
|
+
arrow?(_: {}): any;
|
|
5
6
|
default?(_: {}): any;
|
|
6
7
|
};
|
|
7
8
|
declare const __VLS_component: import("vue").DefineComponent<PopoutInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
@@ -14,7 +15,10 @@ declare const __VLS_component: import("vue").DefineComponent<PopoutInputProps, {
|
|
|
14
15
|
onClick?: ((event: any) => any) | undefined;
|
|
15
16
|
onChange?: ((value: string) => any) | undefined;
|
|
16
17
|
onClear?: (() => any) | undefined;
|
|
17
|
-
}>, {
|
|
18
|
+
}>, {
|
|
19
|
+
arrow: string;
|
|
20
|
+
arrowFamily: string;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
22
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
19
23
|
export default _default;
|
|
20
24
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
<sar-input
|
|
4
4
|
inlaid
|
|
5
5
|
:model-value="innerValue"
|
|
6
|
-
@change="onChange"
|
|
7
6
|
:placeholder="placeholder"
|
|
8
7
|
:readonly="isReadonly"
|
|
9
8
|
:disabled="isDisabled"
|
|
@@ -13,7 +12,9 @@
|
|
|
13
12
|
:auto-height="multiline"
|
|
14
13
|
:input-min-height="multiline"
|
|
15
14
|
:internal-prepend="$slots.prepend ? 1 : 0"
|
|
15
|
+
v-bind="inputProps"
|
|
16
16
|
@clear="onClear"
|
|
17
|
+
@change="onChange"
|
|
17
18
|
>
|
|
18
19
|
<template #prepend>
|
|
19
20
|
<slot name="prepend"></slot>
|
|
@@ -21,11 +22,15 @@
|
|
|
21
22
|
<template #append>
|
|
22
23
|
<slot name="append"></slot>
|
|
23
24
|
<view :class="bem.e('append')">
|
|
24
|
-
<view :class="bem.e('loading')"
|
|
25
|
+
<view v-if="loading" :class="bem.e('loading')">
|
|
25
26
|
<sar-loading />
|
|
26
27
|
</view>
|
|
27
28
|
<view v-if="!isReadonly" :class="bem.e('arrow')">
|
|
28
|
-
<
|
|
29
|
+
<slot
|
|
30
|
+
v-if="internalArrow !== 0 && $slots.arrow"
|
|
31
|
+
name="arrow"
|
|
32
|
+
></slot>
|
|
33
|
+
<sar-icon v-else :family="arrowFamily" :name="arrow" />
|
|
29
34
|
</view>
|
|
30
35
|
</view>
|
|
31
36
|
</template>
|
|
@@ -46,12 +51,15 @@
|
|
|
46
51
|
</template>
|
|
47
52
|
|
|
48
53
|
<script>
|
|
49
|
-
import { defineComponent as _defineComponent } from "vue";
|
|
54
|
+
import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
|
|
50
55
|
import { computed, ref, watch } from "vue";
|
|
51
56
|
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
52
57
|
import SarInput from "../input/input.vue";
|
|
53
58
|
import SarIcon from "../icon/icon.vue";
|
|
54
59
|
import { useFormContext } from "../form/common";
|
|
60
|
+
import {
|
|
61
|
+
defaultPopoutInputProps
|
|
62
|
+
} from "./common";
|
|
55
63
|
import SarLoading from "../loading/loading.vue";
|
|
56
64
|
/**
|
|
57
65
|
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
@@ -63,6 +71,9 @@ import SarLoading from "../loading/loading.vue";
|
|
|
63
71
|
* @property {boolean} loading 加载状态,默认值:false。
|
|
64
72
|
* @property {boolean} clearable 是否显示清空按钮,默认值:false。
|
|
65
73
|
* @property {boolean} multiline 是否多行输入框,默认值:false。
|
|
74
|
+
* @property {string} arrow 自定义箭头图标名,默认值:'caret-right'。
|
|
75
|
+
* @property {string} arrowFamily 自定义箭头图标字体,默认值:'sari'。
|
|
76
|
+
* @property {InputProps} inputProps 自定义输入框组件属性,默认值:-。
|
|
66
77
|
* @event {() => void} click 点击输入框时触发,只读和禁用不触发
|
|
67
78
|
* @event {(value: string) => void} update 输入框值改变时触发
|
|
68
79
|
* @event {(value: string) => void} change 输入框值改变时触发
|
|
@@ -81,7 +92,7 @@ export default _defineComponent({
|
|
|
81
92
|
}
|
|
82
93
|
},
|
|
83
94
|
__name: "popout-input",
|
|
84
|
-
props:
|
|
95
|
+
props: _mergeDefaults({
|
|
85
96
|
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
86
97
|
rootClass: { type: String, required: false },
|
|
87
98
|
modelValue: { type: null, required: false },
|
|
@@ -90,8 +101,12 @@ export default _defineComponent({
|
|
|
90
101
|
disabled: { type: Boolean, required: false },
|
|
91
102
|
clearable: { type: Boolean, required: false },
|
|
92
103
|
loading: { type: Boolean, required: false },
|
|
93
|
-
multiline: { type: Boolean, required: false }
|
|
94
|
-
|
|
104
|
+
multiline: { type: Boolean, required: false },
|
|
105
|
+
arrow: { type: String, required: false },
|
|
106
|
+
arrowFamily: { type: String, required: false },
|
|
107
|
+
internalArrow: { type: Number, required: false },
|
|
108
|
+
inputProps: { type: Object, required: false }
|
|
109
|
+
}, defaultPopoutInputProps),
|
|
95
110
|
emits: ["click", "update:model-value", "change", "clear"],
|
|
96
111
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
97
112
|
__expose();
|
|
@@ -28,16 +28,17 @@ import Popup from 'sard-uniapp/components/popup/popup.vue'
|
|
|
28
28
|
|
|
29
29
|
### PopupProps
|
|
30
30
|
|
|
31
|
-
| 属性
|
|
32
|
-
|
|
|
33
|
-
| root-class
|
|
34
|
-
| root-style
|
|
35
|
-
| visible
|
|
36
|
-
| duration
|
|
37
|
-
| effect
|
|
38
|
-
| overlay
|
|
39
|
-
| background
|
|
40
|
-
| transparent
|
|
31
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
32
|
+
| --------------------------------- | ---------------------- | ---------------------------------------------------------------------------------- | ------ |
|
|
33
|
+
| root-class | 组件根元素类名 | string | - |
|
|
34
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
35
|
+
| visible (v-model) | 是否可见 | boolean | false |
|
|
36
|
+
| duration | 显隐动画时长,单位 ms | number | 300 |
|
|
37
|
+
| effect | 显隐效果 | 'slide-top' \| 'slide-right' \| 'slide-bottom' \| 'slide-left' \| 'zoom' \| 'fade' | 'fade' |
|
|
38
|
+
| overlay | 是否显示遮罩 | boolean | true |
|
|
39
|
+
| background | 遮罩背景色 | string | - |
|
|
40
|
+
| transparent | 透明遮罩 | boolean | false |
|
|
41
|
+
| overlay-closable <sup>1.22+</sup> | 是否在点击遮罩层后关闭 | boolean | true |
|
|
41
42
|
|
|
42
43
|
### PopupSlots
|
|
43
44
|
|
|
@@ -47,18 +48,19 @@ import Popup from 'sard-uniapp/components/popup/popup.vue'
|
|
|
47
48
|
|
|
48
49
|
### PopupEmits
|
|
49
50
|
|
|
50
|
-
| 事件
|
|
51
|
-
|
|
|
52
|
-
| overlay-click
|
|
53
|
-
| visible-hook
|
|
54
|
-
| before-enter
|
|
55
|
-
| enter
|
|
56
|
-
| after-enter
|
|
57
|
-
| enter-cancelled
|
|
58
|
-
| before-leave
|
|
59
|
-
| leave
|
|
60
|
-
| after-leave
|
|
61
|
-
| leave-cancelled
|
|
51
|
+
| 事件 | 描述 | 类型 |
|
|
52
|
+
| ------------------------------- | --------------------------- | ---------------------------------- |
|
|
53
|
+
| overlay-click | 点击遮罩时触发 | (event: any) => void |
|
|
54
|
+
| visible-hook | 入场/退场动画状态改变时触发 | (name: TransitionHookName) => void |
|
|
55
|
+
| before-enter | 入场动画开始前触发 | () => void |
|
|
56
|
+
| enter | 入场动画开始时触发 | () => void |
|
|
57
|
+
| after-enter | 入场动画结束时触发 | () => void |
|
|
58
|
+
| enter-cancelled | 入场动画取消时触发 | () => void |
|
|
59
|
+
| before-leave | 退场动画开始前触发 | () => void |
|
|
60
|
+
| leave | 退场动画开始时触发 | () => void |
|
|
61
|
+
| after-leave | 退场动画结束时触发 | () => void |
|
|
62
|
+
| leave-cancelled | 退场动画取消时触发 | () => void |
|
|
63
|
+
| update:visible <sup>1.22+</sup> | 显隐时触发 | (visible: boolean) => void |
|
|
62
64
|
|
|
63
65
|
## 主题定制
|
|
64
66
|
|
|
@@ -12,11 +12,13 @@ export interface PopupProps {
|
|
|
12
12
|
background?: string;
|
|
13
13
|
transparent?: boolean;
|
|
14
14
|
keepRender?: boolean;
|
|
15
|
+
overlayClosable?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export declare const defaultPopupProps: {
|
|
17
18
|
duration: number;
|
|
18
19
|
effect: PopupProps["effect"];
|
|
19
20
|
overlay: boolean;
|
|
21
|
+
overlayClosable: boolean;
|
|
20
22
|
};
|
|
21
23
|
export interface PopupSlots {
|
|
22
24
|
default?(props: Record<string, never>): any;
|
|
@@ -45,6 +47,7 @@ export interface TransitionHookCallbacks {
|
|
|
45
47
|
}
|
|
46
48
|
export interface PopupEmits extends TransitionHookEmits {
|
|
47
49
|
(e: 'overlay-click', event: any): void;
|
|
50
|
+
(e: 'update:visible', visible: boolean): void;
|
|
48
51
|
}
|
|
49
52
|
export interface PopupContext {
|
|
50
53
|
visibleState: TransitionHookName | undefined;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type PopupProps, type PopupSlots } from './common';
|
|
2
|
-
declare
|
|
3
|
-
|
|
2
|
+
declare const _default: {
|
|
3
|
+
mounted(): void;
|
|
4
|
+
};
|
|
5
|
+
// export default _default;
|
|
6
|
+
declare const _default_1: __VLS_WithTemplateSlots<import("vue").DefineComponent<PopupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
7
|
[x: string]: any;
|
|
5
8
|
} & {
|
|
6
9
|
[x: string]: any;
|
|
@@ -10,9 +13,9 @@ declare const __VLS_component: import("vue").DefineComponent<PopupProps, {}, {},
|
|
|
10
13
|
effect: "slide-top" | "slide-right" | "slide-bottom" | "slide-left" | "zoom" | "fade" | "full-fade";
|
|
11
14
|
duration: number;
|
|
12
15
|
overlay: boolean;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export default
|
|
16
|
+
overlayClosable: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<PopupSlots> & PopupSlots>;
|
|
18
|
+
export default _default_1;
|
|
16
19
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
17
20
|
new (): {
|
|
18
21
|
$slots: S;
|
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
* @property {boolean} overlay 是否显示遮罩,默认值:true。
|
|
66
66
|
* @property {string} background 遮罩背景色,默认值:-。
|
|
67
67
|
* @property {boolean} transparent 透明遮罩,默认值:false。
|
|
68
|
+
* @property {boolean} overlayClosable 是否在点击遮罩层后关闭,默认值:true。
|
|
68
69
|
* @event {(event: any) => void} overlay-click 点击遮罩时触发
|
|
69
70
|
* @event {(name: TransitionHookName) => void} visible-hook 入场/退场动画状态改变时触发
|
|
70
71
|
* @event {() => void} before-enter 入场动画开始前触发
|
|
@@ -75,6 +76,7 @@ import {
|
|
|
75
76
|
* @event {() => void} leave 退场动画开始时触发
|
|
76
77
|
* @event {() => void} after-leave 退场动画结束时触发
|
|
77
78
|
* @event {() => void} leave-cancelled 退场动画取消时触发
|
|
79
|
+
* @event {(visible: boolean) => void} update 显隐时触发
|
|
78
80
|
*/
|
|
79
81
|
export default _defineComponent({
|
|
80
82
|
components: {
|
|
@@ -99,9 +101,10 @@ export default _defineComponent({
|
|
|
99
101
|
overlayStyle: { type: String, required: false },
|
|
100
102
|
background: { type: String, required: false },
|
|
101
103
|
transparent: { type: Boolean, required: false },
|
|
102
|
-
keepRender: { type: Boolean, required: false }
|
|
104
|
+
keepRender: { type: Boolean, required: false },
|
|
105
|
+
overlayClosable: { type: Boolean, required: false }
|
|
103
106
|
}, defaultPopupProps),
|
|
104
|
-
emits: ["overlay-click", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
|
|
107
|
+
emits: ["overlay-click", "update:visible", "before-enter", "enter", "after-enter", "enter-cancelled", "before-leave", "leave", "after-leave", "leave-cancelled", "visible-hook"],
|
|
105
108
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
106
109
|
__expose();
|
|
107
110
|
const props = __props;
|
|
@@ -133,6 +136,9 @@ export default _defineComponent({
|
|
|
133
136
|
);
|
|
134
137
|
const onOverlayClick = (event) => {
|
|
135
138
|
emit("overlay-click", event);
|
|
139
|
+
if (props.overlayClosable) {
|
|
140
|
+
emit("update:visible", false);
|
|
141
|
+
}
|
|
136
142
|
};
|
|
137
143
|
const pageVisible = ref(true);
|
|
138
144
|
onShow(() => {
|
|
@@ -167,6 +173,23 @@ export default _defineComponent({
|
|
|
167
173
|
});
|
|
168
174
|
</script>
|
|
169
175
|
|
|
176
|
+
<!-- #ifdef APP-PLUS -->
|
|
177
|
+
<script module="render" lang="renderjs">
|
|
178
|
+
// @ts-expect-error ignore renderjs
|
|
179
|
+
export default {
|
|
180
|
+
mounted() {
|
|
181
|
+
const root = document.querySelector('uni-app') || document.body
|
|
182
|
+
// @ts-expect-error ignore renderjs
|
|
183
|
+
if (this.$ownerInstance.$el) {
|
|
184
|
+
// @ts-expect-error ignore renderjs
|
|
185
|
+
root.appendChild(this.$ownerInstance.$el)
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
</script>
|
|
190
|
+
<!-- #endif -->
|
|
191
|
+
|
|
192
|
+
|
|
170
193
|
<style lang="scss">
|
|
171
194
|
@import './index.scss';
|
|
172
195
|
</style>
|
|
@@ -38,6 +38,15 @@ import RadioInput from 'sard-uniapp/components/radio-input/radio-input.vue'
|
|
|
38
38
|
| clearable | 是否显示清空按钮 | boolean | false |
|
|
39
39
|
| placeholder | 输入框占位符内容 | string | - |
|
|
40
40
|
| value-on-clear <sup>1.19.2+</sup> | 设置点击清除按钮后的值 | () => any | () => undefined |
|
|
41
|
+
| arrow <sup>1.22+</sup> | 自定义箭头图标名 | string | 'caret-right' |
|
|
42
|
+
| arrow-family <sup>1.22+</sup> | 自定义箭头图标字体 | string | 'sari' |
|
|
43
|
+
| input-props <sup>1.22+</sup> | 自定义输入框组件属性 | InputProps | - |
|
|
44
|
+
|
|
45
|
+
### RadioInputSlots
|
|
46
|
+
|
|
47
|
+
| 插槽 | 描述 | 属性 |
|
|
48
|
+
| ---------------------- | ---------- | ---------- |
|
|
49
|
+
| arrow <sup>1.22+</sup> | 自定义箭头 | () => void |
|
|
41
50
|
|
|
42
51
|
### RadioInputEmits
|
|
43
52
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RadioGroupOption } from '../radio/common';
|
|
2
|
-
import { type PopoutInputProps } from '../popout-input/common';
|
|
2
|
+
import { type PopoutInputSlots, type PopoutInputProps } from '../popout-input/common';
|
|
3
3
|
import { type RadioPopoutEmits, type RadioPopoutProps } from '../radio-popout/common';
|
|
4
4
|
export type RadioInputOption = RadioGroupOption;
|
|
5
5
|
export interface RadioInputProps extends RadioPopoutProps, Omit<PopoutInputProps, 'modelValue'> {
|
|
@@ -11,5 +11,7 @@ export declare const defaultRadioInputProps: () => {
|
|
|
11
11
|
validateEvent: boolean;
|
|
12
12
|
type: RadioPopoutProps["type"];
|
|
13
13
|
};
|
|
14
|
+
export interface RadioInputSlots extends PopoutInputSlots {
|
|
15
|
+
}
|
|
14
16
|
export interface RadioInputEmits extends RadioPopoutEmits {
|
|
15
17
|
}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { type RadioInputProps } from './common';
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { type RadioInputProps, type RadioInputSlots } from './common';
|
|
2
|
+
declare function __VLS_template(): Readonly<RadioInputSlots> & RadioInputSlots;
|
|
3
|
+
declare const __VLS_component: import("vue").DefineComponent<RadioInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
} & {
|
|
6
|
+
[x: string]: any;
|
|
6
7
|
}, string, import("vue").PublicProps, Readonly<RadioInputProps> & Readonly<{
|
|
7
|
-
|
|
8
|
-
onChange?: ((value: any) => any) | undefined;
|
|
9
|
-
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
8
|
+
[x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
|
|
10
9
|
}>, {
|
|
11
10
|
options: import("../radio/common").RadioGroupOption[];
|
|
12
11
|
type: import("../radio/common").IconType;
|
|
13
12
|
valueOnClear: () => any;
|
|
14
13
|
validateEvent: boolean;
|
|
15
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
16
16
|
export default _default;
|
|
17
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -7,9 +7,14 @@
|
|
|
7
7
|
:clearable="clearable"
|
|
8
8
|
:root-class="rootClass"
|
|
9
9
|
:root-style="rootStyle"
|
|
10
|
+
:internal-arrow="$slots.arrow ? 1 : 0"
|
|
11
|
+
:input-props="inputProps"
|
|
10
12
|
@clear="onClear"
|
|
11
13
|
@click="show"
|
|
12
14
|
>
|
|
15
|
+
<template v-if="$slots.arrow" #arrow>
|
|
16
|
+
<slot name="arrow"></slot>
|
|
17
|
+
</template>
|
|
13
18
|
<sar-radio-popout
|
|
14
19
|
v-model:visible="innerVisible"
|
|
15
20
|
v-model="innerValue"
|
|
@@ -26,6 +31,8 @@
|
|
|
26
31
|
:searchable="searchable"
|
|
27
32
|
:filter-placeholder="filterPlaceholder"
|
|
28
33
|
@change="onChange"
|
|
34
|
+
@visible-hook="onVisibleHook"
|
|
35
|
+
@confirm="onConfirm"
|
|
29
36
|
/>
|
|
30
37
|
</sar-popout-input>
|
|
31
38
|
</template>
|
|
@@ -63,8 +70,21 @@ import { usePopoutInput } from "../../use";
|
|
|
63
70
|
* @property {boolean} clearable 是否显示清空按钮,默认值:false。
|
|
64
71
|
* @property {string} placeholder 输入框占位符内容,默认值:-。
|
|
65
72
|
* @property {() => any} valueOnClear 设置点击清除按钮后的值,默认值:() => undefined。
|
|
73
|
+
* @property {string} arrow 自定义箭头图标名,默认值:'caret-right'。
|
|
74
|
+
* @property {string} arrowFamily 自定义箭头图标字体,默认值:'sari'。
|
|
75
|
+
* @property {InputProps} inputProps 自定义输入框组件属性,默认值:-。
|
|
66
76
|
* @event {(visible: boolean) => void} update 弹出框显隐时触发
|
|
67
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 退场动画取消时触发
|
|
68
88
|
*/
|
|
69
89
|
export default _defineComponent({
|
|
70
90
|
components: {
|
|
@@ -101,14 +121,26 @@ export default _defineComponent({
|
|
|
101
121
|
placeholder: { type: String, required: false },
|
|
102
122
|
clearable: { type: Boolean, required: false },
|
|
103
123
|
loading: { type: Boolean, required: false },
|
|
104
|
-
multiline: { type: Boolean, required: false }
|
|
124
|
+
multiline: { type: Boolean, required: false },
|
|
125
|
+
arrow: { type: String, required: false },
|
|
126
|
+
arrowFamily: { type: String, required: false },
|
|
127
|
+
internalArrow: { type: Number, required: false },
|
|
128
|
+
inputProps: { type: Object, required: false }
|
|
105
129
|
}, defaultRadioInputProps()),
|
|
106
|
-
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"],
|
|
107
131
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
108
132
|
__expose();
|
|
109
133
|
const props = __props;
|
|
110
134
|
const emit = __emit;
|
|
111
|
-
const {
|
|
135
|
+
const {
|
|
136
|
+
innerVisible,
|
|
137
|
+
innerValue,
|
|
138
|
+
inputValue,
|
|
139
|
+
show,
|
|
140
|
+
onChange,
|
|
141
|
+
onClear,
|
|
142
|
+
onVisibleHook
|
|
143
|
+
} = usePopoutInput(props, emit);
|
|
112
144
|
const fieldKeys = computed(() => {
|
|
113
145
|
return Object.assign({}, defaultOptionKeys, props.optionKeys);
|
|
114
146
|
});
|
|
@@ -133,7 +165,10 @@ export default _defineComponent({
|
|
|
133
165
|
immediate: true
|
|
134
166
|
}
|
|
135
167
|
);
|
|
136
|
-
const
|
|
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 };
|
|
137
172
|
return __returned__;
|
|
138
173
|
}
|
|
139
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
|
|
59
|
-
| change
|
|
60
|
-
| update:visible
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
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
|
|
74
|
-
| close
|
|
75
|
-
| cancel
|
|
76
|
-
| select
|
|
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;
|