sard-uniapp 1.19.0 → 1.19.2
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 +29 -0
- package/README.md +1 -1
- package/components/action-sheet/variables.scss +1 -1
- package/components/calendar/calendar.vue +2 -2
- package/components/calendar-input/calendar-input.d.ts +3 -2
- package/components/calendar-input/calendar-input.vue +1 -0
- package/components/calendar-input/common.d.ts +2 -0
- package/components/calendar-popout/calendar-popout.d.ts +12 -2
- package/components/calendar-popout/calendar-popout.vue +7 -1
- package/components/calendar-popout/common.d.ts +2 -0
- package/components/cascader-input/cascader-input.d.ts +2 -1
- package/components/cascader-input/cascader-input.vue +7 -6
- package/components/cascader-input/common.d.ts +2 -0
- package/components/cascader-input/common.js +1 -0
- package/components/cascader-popout/cascader-popout.d.ts +1 -1
- package/components/cascader-popout/cascader-popout.vue +2 -2
- package/components/check-icon/variables.scss +1 -1
- package/components/checkbox/variables.scss +1 -1
- package/components/checkbox-input/checkbox-input.d.ts +1 -0
- package/components/checkbox-input/checkbox-input.vue +3 -2
- package/components/checkbox-input/common.d.ts +2 -0
- package/components/checkbox-input/common.js +5 -1
- package/components/config/index.d.ts +44 -1
- package/components/config/index.js +36 -0
- package/components/datetime-picker-input/common.d.ts +2 -0
- package/components/datetime-picker-input/common.js +1 -0
- package/components/datetime-picker-input/datetime-picker-input.d.ts +2 -1
- package/components/datetime-picker-input/datetime-picker-input.vue +1 -0
- package/components/datetime-picker-popout/datetime-picker-popout.d.ts +1 -1
- package/components/datetime-picker-popout/datetime-picker-popout.vue +2 -2
- package/components/datetime-range-picker-input/common.d.ts +2 -0
- package/components/datetime-range-picker-input/common.js +1 -0
- package/components/datetime-range-picker-input/datetime-range-picker-input.d.ts +1 -0
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +1 -0
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +2 -2
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog-agent/dialog-agent.d.ts +1 -1
- package/components/dropdown/common.d.ts +3 -1
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/variables.scss +1 -1
- package/components/dropdown-item/dropdown-item.vue +27 -3
- package/components/empty/variables.scss +1 -1
- package/components/input/common.d.ts +1 -0
- package/components/input/index.scss +0 -20
- package/components/input/input.vue +16 -17
- package/components/input/variables.scss +2 -2
- package/components/picker/common.d.ts +1 -1
- package/components/picker/common.js +18 -6
- package/components/picker/picker.vue +30 -15
- package/components/picker-input/common.d.ts +2 -0
- package/components/picker-input/common.js +2 -0
- package/components/picker-input/picker-input.d.ts +2 -1
- package/components/picker-input/picker-input.vue +3 -2
- package/components/picker-popout/picker-popout.d.ts +1 -1
- package/components/picker-popout/picker-popout.vue +9 -4
- package/components/popout/common.d.ts +1 -0
- package/components/popout/popout.d.ts +1 -1
- package/components/popout/popout.vue +1 -0
- package/components/popout-input/popout-input.vue +1 -0
- package/components/popout-input/variables.scss +1 -1
- package/components/pull-down-refresh/pull-down-refresh.d.ts +1 -1
- package/components/qrcode/common.d.ts +2 -0
- package/components/qrcode/qrcode.vue +58 -61
- package/components/radio/variables.scss +1 -1
- package/components/radio-input/common.d.ts +3 -1
- package/components/radio-input/common.js +5 -1
- package/components/radio-input/radio-input.d.ts +1 -0
- package/components/radio-input/radio-input.vue +3 -2
- package/components/radio-popout/common.d.ts +1 -1
- package/components/rate/rate.d.ts +1 -1
- package/components/rate/variables.scss +1 -1
- package/components/search/variables.scss +1 -1
- package/components/share-sheet/variables.scss +1 -1
- package/components/stepper/variables.scss +1 -1
- package/components/style/variables-dark.scss +10 -6
- package/components/style/variables.scss +17 -11
- package/components/tag/common.d.ts +1 -1
- package/components/tag/index.scss +5 -1
- package/components/tag/tag.vue +2 -2
- package/components/timeline/variables.scss +1 -1
- package/components/tree/variables.scss +3 -3
- package/components/upload/common.d.ts +1 -0
- package/components/upload/upload.d.ts +1 -1
- package/components/upload/upload.vue +45 -26
- package/package.json +2 -2
- package/use/useFormPopout.d.ts +1 -1
- package/use/useFormPopout.js +4 -1
- package/use/usePopoutInput.d.ts +2 -1
- package/use/usePopoutInput.js +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## [1.19.2](https://github.com/sutras/sard-uniapp/compare/v1.19.1...v1.19.2) (2025-06-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* picker 值为空时滚到第一个位置 ([f033ccc](https://github.com/sutras/sard-uniapp/commit/f033ccc713ec1260d1cb761769ab31ccbc39d808))
|
|
7
|
+
* 修复 picker-popout 首次选择不能获取选项列表问题 ([50cebc7](https://github.com/sutras/sard-uniapp/commit/50cebc75c036c8b0bf7ed32cb46338d68716385d))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* *-input 系列组件新增valueOnClear属性 ([42275cd](https://github.com/sutras/sard-uniapp/commit/42275cd5beec09d7d5fe669c560ae6ad7dfc1b13))
|
|
13
|
+
* calendar-popout组件新增title和title-prepend插槽 ([f6f8404](https://github.com/sutras/sard-uniapp/commit/f6f84042f2924f6547bb6273078ada5e08039fd5))
|
|
14
|
+
* upload 组件新增 beforeChoose 属性 ([22e3137](https://github.com/sutras/sard-uniapp/commit/22e3137c72e3a16f298dcabbffd2db43268f8a74))
|
|
15
|
+
* 增加 tag 组件的 mark 属性,支持 'left' 和 'right' 值以控制标记方向 ([77f9fb7](https://github.com/sutras/sard-uniapp/commit/77f9fb724040d99f7aa2612ccd03c8c6f175de52))
|
|
16
|
+
* 新增css变量 ([f1b081e](https://github.com/sutras/sard-uniapp/commit/f1b081ef65c66794dec1d7b4bc6d769676cbdf7f))
|
|
17
|
+
* 新增图标属性和长按菜单功能 ([62c0d7f](https://github.com/sutras/sard-uniapp/commit/62c0d7f9d4e085f91c0c745f85b02d90d0cd246e))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [1.19.1](https://github.com/sutras/sard-uniapp/compare/v1.19.0...v1.19.1) (2025-06-11)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* dropdown 新增 before-close 属性 ([fca24ac](https://github.com/sutras/sard-uniapp/commit/fca24ac536bc3840fbc9562fde4992f864968080))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
1
30
|
# [1.19.0](https://github.com/sutras/sard-uniapp/compare/v1.18.0...v1.19.0) (2025-06-10)
|
|
2
31
|
|
|
3
32
|
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ page,
|
|
|
23
23
|
--sar-action-sheet-item-description-color: var(--sar-tertiary-color);
|
|
24
24
|
|
|
25
25
|
--sar-action-sheet-loading-size: 40rpx;
|
|
26
|
-
--sar-action-sheet-loading-color: var(--sar-
|
|
26
|
+
--sar-action-sheet-loading-color: var(--sar-fourth-color);
|
|
27
27
|
|
|
28
28
|
--sar-action-sheet-cancel-min-height: 96rpx;
|
|
29
29
|
--sar-action-sheet-cancel-padding: 16rpx 32rpx;
|
|
@@ -113,6 +113,8 @@ import {
|
|
|
113
113
|
parseDate,
|
|
114
114
|
formatDate
|
|
115
115
|
} from "../../utils";
|
|
116
|
+
import { useTranslate } from "../locale";
|
|
117
|
+
import { useScrollSide } from "../../use";
|
|
116
118
|
import {
|
|
117
119
|
defaultCalendarProps,
|
|
118
120
|
getMaxDate,
|
|
@@ -123,11 +125,9 @@ import {
|
|
|
123
125
|
import { useInPopup } from "../popup/common";
|
|
124
126
|
import SarButton from "../button/button.vue";
|
|
125
127
|
import SarIcon from "../icon/icon.vue";
|
|
126
|
-
import { useTranslate } from "../locale";
|
|
127
128
|
import SarCalendarMonth from "../calendar-month/calendar-month.vue";
|
|
128
129
|
import SarPopout from "../popout/popout.vue";
|
|
129
130
|
import SarDatetimePicker from "../datetime-picker/datetime-picker.vue";
|
|
130
|
-
import { useScrollSide } from "../../use";
|
|
131
131
|
export default _defineComponent({
|
|
132
132
|
components: {
|
|
133
133
|
SarButton,
|
|
@@ -10,10 +10,11 @@ declare const _default: import("vue").DefineComponent<CalendarInputProps, {}, {}
|
|
|
10
10
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
12
|
type: CalendarType;
|
|
13
|
+
valueOnClear: () => any;
|
|
14
|
+
showConfirm: boolean;
|
|
13
15
|
validateEvent: boolean;
|
|
16
|
+
outletFormat: string;
|
|
14
17
|
weekStartsOn: number;
|
|
15
|
-
showConfirm: boolean;
|
|
16
18
|
maxDays: number;
|
|
17
|
-
outletFormat: string;
|
|
18
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
20
|
export default _default;
|
|
@@ -60,6 +60,7 @@ export default _defineComponent({
|
|
|
60
60
|
__name: "calendar-input",
|
|
61
61
|
props: _mergeDefaults({
|
|
62
62
|
outletFormat: { type: String, required: false },
|
|
63
|
+
valueOnClear: { type: Function, required: false },
|
|
63
64
|
visible: { type: Boolean, required: false },
|
|
64
65
|
title: { type: String, required: false },
|
|
65
66
|
showConfirm: { type: Boolean, required: false },
|
|
@@ -2,9 +2,11 @@ import { type CalendarPopoutEmits, type CalendarPopoutProps } from '../calendar-
|
|
|
2
2
|
import { type PopoutInputProps } from '../popout-input/common';
|
|
3
3
|
export interface CalendarInputProps extends CalendarPopoutProps, Omit<PopoutInputProps, 'modelValue' | 'loading'> {
|
|
4
4
|
outletFormat?: string;
|
|
5
|
+
valueOnClear?: () => any;
|
|
5
6
|
}
|
|
6
7
|
export declare const defaultCalendarInputProps: () => {
|
|
7
8
|
outletFormat: string;
|
|
9
|
+
valueOnClear: CalendarInputProps["valueOnClear"];
|
|
8
10
|
showConfirm: boolean;
|
|
9
11
|
validateEvent: boolean;
|
|
10
12
|
type: import("../calendar").CalendarProps["type"];
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type CalendarPopoutProps } from './common';
|
|
2
|
-
declare
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
"title-prepend"?(_: {}): any;
|
|
4
|
+
title?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<CalendarPopoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
7
|
"update:model-value": (value: string | string[] | Date | Date[] | undefined) => any;
|
|
4
8
|
change: (value: string | string[] | Date | Date[] | undefined) => any;
|
|
5
9
|
"update:visible": (visible: boolean) => any;
|
|
@@ -9,9 +13,15 @@ declare const _default: import("vue").DefineComponent<CalendarPopoutProps, {}, {
|
|
|
9
13
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
10
14
|
}>, {
|
|
11
15
|
type: import("../calendar/common.js").CalendarType;
|
|
16
|
+
showConfirm: boolean;
|
|
12
17
|
validateEvent: boolean;
|
|
13
18
|
weekStartsOn: number;
|
|
14
|
-
showConfirm: boolean;
|
|
15
19
|
maxDays: number;
|
|
16
20
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
17
22
|
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<sar-popout
|
|
3
3
|
v-model:visible="innerVisible"
|
|
4
|
-
:title="title"
|
|
4
|
+
:title="$slots.title ? '' : title"
|
|
5
5
|
:show-confirm="showConfirm"
|
|
6
6
|
:confirm-disabled="confirmDisabled"
|
|
7
7
|
:root-class="popoutClass"
|
|
8
8
|
:root-style="popoutStyle"
|
|
9
9
|
@confirm="onConfirm"
|
|
10
10
|
>
|
|
11
|
+
<template #title-prepend>
|
|
12
|
+
<slot name="title-prepend"></slot>
|
|
13
|
+
</template>
|
|
14
|
+
<template #title>
|
|
15
|
+
<slot name="title"></slot>
|
|
16
|
+
</template>
|
|
11
17
|
<template #visible="{ already }">
|
|
12
18
|
<sar-calendar
|
|
13
19
|
v-if="already"
|
|
@@ -17,6 +17,8 @@ export declare const defaultCalendarPopoutProps: () => {
|
|
|
17
17
|
};
|
|
18
18
|
export interface CalendarPopoutSlots {
|
|
19
19
|
default?(props: Record<string, never>): any;
|
|
20
|
+
title?(props: Record<string, never>): any;
|
|
21
|
+
'title-prepend'?(props: Record<string, never>): any;
|
|
20
22
|
}
|
|
21
23
|
export interface CalendarPopoutEmits {
|
|
22
24
|
(e: 'update:visible', visible: boolean): void;
|
|
@@ -12,8 +12,9 @@ declare const __VLS_component: import("vue").DefineComponent<CascaderInputProps,
|
|
|
12
12
|
onSelect?: ((option: CascaderOption, tabIndex: number) => any) | undefined;
|
|
13
13
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
|
-
|
|
15
|
+
valueOnClear: () => any;
|
|
16
16
|
showConfirm: boolean;
|
|
17
|
+
validateEvent: boolean;
|
|
17
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
19
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
19
20
|
export default _default;
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
defaultFieldKeys,
|
|
44
44
|
getSelectedOptionsByValue
|
|
45
45
|
} from "../cascader/common";
|
|
46
|
-
import {
|
|
46
|
+
import { isEmptyBinding } from "../../utils";
|
|
47
47
|
import { usePopoutInput } from "../../use";
|
|
48
48
|
import {
|
|
49
49
|
defaultCascaderInputProps
|
|
@@ -61,6 +61,7 @@ export default _defineComponent({
|
|
|
61
61
|
},
|
|
62
62
|
__name: "cascader-input",
|
|
63
63
|
props: _mergeDefaults({
|
|
64
|
+
valueOnClear: { type: Function, required: false },
|
|
64
65
|
visible: { type: Boolean, required: false },
|
|
65
66
|
title: { type: String, required: false },
|
|
66
67
|
showConfirm: { type: Boolean, required: false },
|
|
@@ -88,9 +89,9 @@ export default _defineComponent({
|
|
|
88
89
|
const props = __props;
|
|
89
90
|
const emit = __emit;
|
|
90
91
|
const { innerVisible, innerValue, inputValue, show, onChange, onClear } = usePopoutInput(props, emit, {
|
|
91
|
-
onClear() {
|
|
92
|
-
emit("update:model-value",
|
|
93
|
-
emit("change",
|
|
92
|
+
onClear(value) {
|
|
93
|
+
emit("update:model-value", value, []);
|
|
94
|
+
emit("change", value, []);
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
97
|
const fieldkeys = computed(() => {
|
|
@@ -103,13 +104,13 @@ export default _defineComponent({
|
|
|
103
104
|
function getOutletText(options, value, fieldKeys) {
|
|
104
105
|
const selectedOptions = getSelectedOptionsByValue(options, value, fieldKeys);
|
|
105
106
|
if (!selectedOptions) {
|
|
106
|
-
return
|
|
107
|
+
return isEmptyBinding(value) ? "" : String(value);
|
|
107
108
|
}
|
|
108
109
|
const labels = selectedOptions.map((option) => option[fieldKeys.label]);
|
|
109
110
|
return labels.join("/");
|
|
110
111
|
}
|
|
111
112
|
function getInputValue() {
|
|
112
|
-
if (
|
|
113
|
+
if (isEmptyBinding(innerValue.value) || !props.options) {
|
|
113
114
|
return "";
|
|
114
115
|
}
|
|
115
116
|
return getOutletText(props.options, innerValue.value, fieldkeys.value);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type PopoutInputProps } from '../popout-input/common';
|
|
2
2
|
import { type CascaderPopoutProps, type CascaderPopoutEmits, type CascaderPopoutSlots } from '../cascader-popout/common';
|
|
3
3
|
export interface CascaderInputProps extends CascaderPopoutProps, Omit<PopoutInputProps, 'modelValue'> {
|
|
4
|
+
valueOnClear?: () => any;
|
|
4
5
|
}
|
|
5
6
|
export declare const defaultCascaderInputProps: () => {
|
|
7
|
+
valueOnClear: CascaderInputProps["valueOnClear"];
|
|
6
8
|
showConfirm: boolean;
|
|
7
9
|
validateEvent: boolean;
|
|
8
10
|
};
|
|
@@ -11,8 +11,8 @@ declare const __VLS_component: import("vue").DefineComponent<CascaderPopoutProps
|
|
|
11
11
|
onSelect?: ((option: import("../cascader/common.js").CascaderOption, tabIndex: number) => any) | undefined;
|
|
12
12
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
13
13
|
}>, {
|
|
14
|
-
validateEvent: boolean;
|
|
15
14
|
showConfirm: boolean;
|
|
15
|
+
validateEvent: boolean;
|
|
16
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
17
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
18
18
|
export default _default;
|
|
@@ -34,7 +34,7 @@ import SarCascader from "../cascader/cascader.vue";
|
|
|
34
34
|
import {
|
|
35
35
|
defaultCascaderPopoutProps
|
|
36
36
|
} from "./common";
|
|
37
|
-
import {
|
|
37
|
+
import { isEmptyBinding } from "../../utils";
|
|
38
38
|
import { useFormPopout } from "../../use";
|
|
39
39
|
export default _defineComponent({
|
|
40
40
|
components: {
|
|
@@ -74,7 +74,7 @@ export default _defineComponent({
|
|
|
74
74
|
emit,
|
|
75
75
|
{
|
|
76
76
|
onChange() {
|
|
77
|
-
if (!props.showConfirm && !
|
|
77
|
+
if (!props.showConfirm && !isEmptyBinding(popoutValue.value)) {
|
|
78
78
|
onConfirm();
|
|
79
79
|
innerVisible.value = false;
|
|
80
80
|
}
|
|
@@ -3,7 +3,7 @@ page,
|
|
|
3
3
|
.sar-portal {
|
|
4
4
|
--sar-check-icon-size: 1em;
|
|
5
5
|
--sar-check-icon-square-border-radius: 0.15em;
|
|
6
|
-
--sar-check-icon-border-color: var(--sar-
|
|
6
|
+
--sar-check-icon-border-color: var(--sar-fourth-color);
|
|
7
7
|
|
|
8
8
|
--sar-check-icon-disabled-color: var(--sar-disabled-color);
|
|
9
9
|
--sar-check-icon-disabled-bg: var(--sar-disabled-shallow-bg);
|
|
@@ -5,7 +5,7 @@ page,
|
|
|
5
5
|
--sar-checkbox-group-row-gap: 16rpx;
|
|
6
6
|
|
|
7
7
|
--sar-checkbox-icon-font-size: 40rpx;
|
|
8
|
-
--sar-checkbox-icon-color: var(--sar-
|
|
8
|
+
--sar-checkbox-icon-color: var(--sar-fourth-color);
|
|
9
9
|
--sar-checkbox-icon-checked-color: var(--sar-primary);
|
|
10
10
|
--sar-checkbox-icon-disabled-color: var(--sar-disabled-color);
|
|
11
11
|
--sar-checkbox-icon-transition-duration: var(--sar-duration);
|
|
@@ -9,6 +9,7 @@ declare const _default: import("vue").DefineComponent<CheckboxInputProps, {}, {}
|
|
|
9
9
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
10
10
|
}>, {
|
|
11
11
|
options: import("../checkbox/common").CheckboxGroupOption[];
|
|
12
|
+
valueOnClear: () => any;
|
|
12
13
|
validateEvent: boolean;
|
|
13
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
15
|
export default _default;
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
defaultCheckboxInputProps
|
|
42
42
|
} from "./common";
|
|
43
|
-
import { getMayPrimitiveOption,
|
|
43
|
+
import { getMayPrimitiveOption, isEmptyBinding } from "../../utils";
|
|
44
44
|
import { usePopoutInput } from "../../use";
|
|
45
45
|
export default _defineComponent({
|
|
46
46
|
components: {
|
|
@@ -55,6 +55,7 @@ export default _defineComponent({
|
|
|
55
55
|
},
|
|
56
56
|
__name: "checkbox-input",
|
|
57
57
|
props: _mergeDefaults({
|
|
58
|
+
valueOnClear: { type: Function, required: false },
|
|
58
59
|
visible: { type: Boolean, required: false },
|
|
59
60
|
title: { type: String, required: false },
|
|
60
61
|
popoutClass: { type: String, required: false },
|
|
@@ -91,7 +92,7 @@ export default _defineComponent({
|
|
|
91
92
|
).map((option) => getMayPrimitiveOption(option, optionKeys.label)).join(", ");
|
|
92
93
|
}
|
|
93
94
|
function getInputValue() {
|
|
94
|
-
if (
|
|
95
|
+
if (isEmptyBinding(innerValue.value) || Array.isArray(innerValue.value) && innerValue.value.length === 0) {
|
|
95
96
|
return "";
|
|
96
97
|
}
|
|
97
98
|
return getOutletText(props.options, fieldKeys.value, innerValue.value);
|
|
@@ -3,8 +3,10 @@ import { type PopoutInputProps } from '../popout-input/common';
|
|
|
3
3
|
import { type CheckboxPopoutEmits, type CheckboxPopoutProps } from '../checkbox-popout/common';
|
|
4
4
|
export type CheckboxInputOption = CheckboxGroupOption;
|
|
5
5
|
export interface CheckboxInputProps extends CheckboxPopoutProps, Omit<PopoutInputProps, 'modelValue'> {
|
|
6
|
+
valueOnClear?: () => any;
|
|
6
7
|
}
|
|
7
8
|
export declare const defaultCheckboxInputProps: () => {
|
|
9
|
+
valueOnClear: CheckboxInputProps["valueOnClear"];
|
|
8
10
|
options: () => never[];
|
|
9
11
|
validateEvent: boolean;
|
|
10
12
|
};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { defaultCheckboxPopoutProps, } from '../checkbox-popout/common';
|
|
2
|
-
|
|
2
|
+
import { defaultConfig } from '../config';
|
|
3
|
+
export const defaultCheckboxInputProps = () => ({
|
|
4
|
+
...defaultCheckboxPopoutProps(),
|
|
5
|
+
...defaultConfig.checkboxInput,
|
|
6
|
+
});
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { type AvatarProps } from '../avatar';
|
|
2
2
|
import { type AlertProps } from '../alert';
|
|
3
3
|
import { type ButtonProps } from '../button';
|
|
4
|
+
import { type CalendarInputProps } from '../calendar-input';
|
|
4
5
|
import { type CalendarProps } from '../calendar';
|
|
6
|
+
import { type CascaderInputProps } from '../cascader-input';
|
|
5
7
|
import { type CheckboxGroupProps } from '../checkbox';
|
|
8
|
+
import { type CheckboxInputProps } from '../checkbox-input';
|
|
9
|
+
import { type DatetimePickerInputProps } from '../datetime-picker-input';
|
|
10
|
+
import { type DatetimeRangePickerInputProps } from '../datetime-range-picker-input';
|
|
6
11
|
import { type DialogProps } from '../dialog';
|
|
7
12
|
import { type DropdownProps } from '../dropdown';
|
|
8
13
|
import { type FloatingBubbleProps } from '../floating-bubble';
|
|
@@ -17,12 +22,14 @@ import { type NoticeBarProps } from '../notice-bar';
|
|
|
17
22
|
import { type NotifyProps } from '../notify';
|
|
18
23
|
import { type PaginationProps } from '../pagination';
|
|
19
24
|
import { type PasswordInputProps } from '../password-input';
|
|
25
|
+
import { type PickerInputProps } from '../picker-input';
|
|
20
26
|
import { type PopoutProps } from '../popout';
|
|
21
27
|
import { type PopoverProps } from '../popover';
|
|
22
28
|
import { type PopupProps } from '../popup';
|
|
23
29
|
import { type QrcodeProps } from '../qrcode';
|
|
24
30
|
import { type RadioGroupProps } from '../radio';
|
|
25
31
|
import { type RadioInputProps } from '../radio-input';
|
|
32
|
+
import { type RadioPopoutProps } from '../radio-popout';
|
|
26
33
|
import { type ResultProps } from '../result';
|
|
27
34
|
import { type SearchProps } from '../search';
|
|
28
35
|
import { type SpaceProps } from '../space';
|
|
@@ -40,6 +47,23 @@ type DeepPartial<T> = {
|
|
|
40
47
|
};
|
|
41
48
|
export declare const defaultConfig: {
|
|
42
49
|
initialZIndex: number;
|
|
50
|
+
/**
|
|
51
|
+
* 设置点击清除按钮后的值
|
|
52
|
+
*
|
|
53
|
+
* - 类型:() => any
|
|
54
|
+
* - 默认值:() = undefined
|
|
55
|
+
*
|
|
56
|
+
* 支持以下组件:
|
|
57
|
+
*
|
|
58
|
+
* - CalendarInput
|
|
59
|
+
* - DatetimePickerInput
|
|
60
|
+
* - DatetimeRangePickerInput
|
|
61
|
+
* - CascaderInput
|
|
62
|
+
* - CheckboxInput
|
|
63
|
+
* - PickerInput
|
|
64
|
+
* - RadioInput
|
|
65
|
+
*/
|
|
66
|
+
valueOnClear: (() => any) | undefined;
|
|
43
67
|
actionSheet: {
|
|
44
68
|
overlayClosable: boolean;
|
|
45
69
|
duration: number;
|
|
@@ -74,6 +98,7 @@ export declare const defaultConfig: {
|
|
|
74
98
|
};
|
|
75
99
|
calendarInput: {
|
|
76
100
|
outletFormat: string;
|
|
101
|
+
valueOnClear: CalendarInputProps["valueOnClear"];
|
|
77
102
|
};
|
|
78
103
|
calendarPopout: {
|
|
79
104
|
showConfirm: boolean;
|
|
@@ -83,6 +108,9 @@ export declare const defaultConfig: {
|
|
|
83
108
|
showConfirm: boolean;
|
|
84
109
|
validateEvent: boolean;
|
|
85
110
|
};
|
|
111
|
+
cascaderInput: {
|
|
112
|
+
valueOnClear: CascaderInputProps["valueOnClear"];
|
|
113
|
+
};
|
|
86
114
|
checkbox: {
|
|
87
115
|
validateEvent: boolean;
|
|
88
116
|
};
|
|
@@ -90,6 +118,9 @@ export declare const defaultConfig: {
|
|
|
90
118
|
direction: CheckboxGroupProps["direction"];
|
|
91
119
|
validateEvent: boolean;
|
|
92
120
|
};
|
|
121
|
+
checkboxInput: {
|
|
122
|
+
valueOnClear: CheckboxInputProps["valueOnClear"];
|
|
123
|
+
};
|
|
93
124
|
checkboxPopout: {
|
|
94
125
|
validateEvent: boolean;
|
|
95
126
|
};
|
|
@@ -117,12 +148,18 @@ export declare const defaultConfig: {
|
|
|
117
148
|
type: string;
|
|
118
149
|
calendar: "solar";
|
|
119
150
|
};
|
|
151
|
+
datetimePickerInput: {
|
|
152
|
+
valueOnClear: DatetimePickerInputProps["valueOnClear"];
|
|
153
|
+
};
|
|
120
154
|
datetimePickerPopout: {
|
|
121
155
|
validateEvent: boolean;
|
|
122
156
|
};
|
|
123
157
|
datetimeRangePicker: {
|
|
124
158
|
type: string;
|
|
125
159
|
};
|
|
160
|
+
datetimeRangePickerInput: {
|
|
161
|
+
valueOnClear: DatetimeRangePickerInputProps["valueOnClear"];
|
|
162
|
+
};
|
|
126
163
|
datetimeRangePickerPopout: {
|
|
127
164
|
validateEvent: boolean;
|
|
128
165
|
};
|
|
@@ -254,6 +291,9 @@ export declare const defaultConfig: {
|
|
|
254
291
|
picker: {
|
|
255
292
|
immediateChange: boolean;
|
|
256
293
|
};
|
|
294
|
+
pickerInput: {
|
|
295
|
+
valueOnClear: PickerInputProps["valueOnClear"];
|
|
296
|
+
};
|
|
257
297
|
pickerPopout: {
|
|
258
298
|
validateEvent: boolean;
|
|
259
299
|
};
|
|
@@ -307,9 +347,12 @@ export declare const defaultConfig: {
|
|
|
307
347
|
direction: RadioGroupProps["direction"];
|
|
308
348
|
validateEvent: boolean;
|
|
309
349
|
};
|
|
350
|
+
radioInput: {
|
|
351
|
+
valueOnClear: RadioInputProps["valueOnClear"];
|
|
352
|
+
};
|
|
310
353
|
radioPopout: {
|
|
311
354
|
validateEvent: boolean;
|
|
312
|
-
type:
|
|
355
|
+
type: RadioPopoutProps["type"];
|
|
313
356
|
};
|
|
314
357
|
rate: {
|
|
315
358
|
count: number;
|
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
export const defaultConfig = {
|
|
3
3
|
// 全局初始 zIndex
|
|
4
4
|
initialZIndex: 1000,
|
|
5
|
+
/**
|
|
6
|
+
* 设置点击清除按钮后的值
|
|
7
|
+
*
|
|
8
|
+
* - 类型:() => any
|
|
9
|
+
* - 默认值:() = undefined
|
|
10
|
+
*
|
|
11
|
+
* 支持以下组件:
|
|
12
|
+
*
|
|
13
|
+
* - CalendarInput
|
|
14
|
+
* - DatetimePickerInput
|
|
15
|
+
* - DatetimeRangePickerInput
|
|
16
|
+
* - CascaderInput
|
|
17
|
+
* - CheckboxInput
|
|
18
|
+
* - PickerInput
|
|
19
|
+
* - RadioInput
|
|
20
|
+
*/
|
|
21
|
+
valueOnClear: undefined,
|
|
5
22
|
actionSheet: {
|
|
6
23
|
overlayClosable: true,
|
|
7
24
|
duration: 250,
|
|
@@ -36,6 +53,7 @@ export const defaultConfig = {
|
|
|
36
53
|
},
|
|
37
54
|
calendarInput: {
|
|
38
55
|
outletFormat: 'YYYY-MM-DD',
|
|
56
|
+
valueOnClear: undefined,
|
|
39
57
|
},
|
|
40
58
|
calendarPopout: {
|
|
41
59
|
showConfirm: true,
|
|
@@ -45,6 +63,9 @@ export const defaultConfig = {
|
|
|
45
63
|
showConfirm: true,
|
|
46
64
|
validateEvent: true,
|
|
47
65
|
},
|
|
66
|
+
cascaderInput: {
|
|
67
|
+
valueOnClear: undefined,
|
|
68
|
+
},
|
|
48
69
|
checkbox: {
|
|
49
70
|
validateEvent: true,
|
|
50
71
|
},
|
|
@@ -52,6 +73,9 @@ export const defaultConfig = {
|
|
|
52
73
|
direction: 'vertical',
|
|
53
74
|
validateEvent: true,
|
|
54
75
|
},
|
|
76
|
+
checkboxInput: {
|
|
77
|
+
valueOnClear: undefined,
|
|
78
|
+
},
|
|
55
79
|
checkboxPopout: {
|
|
56
80
|
validateEvent: true,
|
|
57
81
|
},
|
|
@@ -79,12 +103,18 @@ export const defaultConfig = {
|
|
|
79
103
|
type: 'yMd',
|
|
80
104
|
calendar: 'solar',
|
|
81
105
|
},
|
|
106
|
+
datetimePickerInput: {
|
|
107
|
+
valueOnClear: undefined,
|
|
108
|
+
},
|
|
82
109
|
datetimePickerPopout: {
|
|
83
110
|
validateEvent: true,
|
|
84
111
|
},
|
|
85
112
|
datetimeRangePicker: {
|
|
86
113
|
type: 'yMd',
|
|
87
114
|
},
|
|
115
|
+
datetimeRangePickerInput: {
|
|
116
|
+
valueOnClear: undefined,
|
|
117
|
+
},
|
|
88
118
|
datetimeRangePickerPopout: {
|
|
89
119
|
validateEvent: true,
|
|
90
120
|
},
|
|
@@ -216,6 +246,9 @@ export const defaultConfig = {
|
|
|
216
246
|
picker: {
|
|
217
247
|
immediateChange: false,
|
|
218
248
|
},
|
|
249
|
+
pickerInput: {
|
|
250
|
+
valueOnClear: undefined,
|
|
251
|
+
},
|
|
219
252
|
pickerPopout: {
|
|
220
253
|
validateEvent: true,
|
|
221
254
|
},
|
|
@@ -269,6 +302,9 @@ export const defaultConfig = {
|
|
|
269
302
|
direction: 'vertical',
|
|
270
303
|
validateEvent: true,
|
|
271
304
|
},
|
|
305
|
+
radioInput: {
|
|
306
|
+
valueOnClear: undefined,
|
|
307
|
+
},
|
|
272
308
|
radioPopout: {
|
|
273
309
|
validateEvent: true,
|
|
274
310
|
type: 'circle',
|
|
@@ -2,8 +2,10 @@ import { type PopoutInputProps } from '../popout-input/common';
|
|
|
2
2
|
import { type DatetimePickerPopoutProps, type DatetimePickerPopoutEmits, type DatetimePickerPopoutSlots } from '../datetime-picker-popout/common';
|
|
3
3
|
export interface DatetimePickerInputProps extends DatetimePickerPopoutProps, Omit<PopoutInputProps, 'modelValue' | 'loading'> {
|
|
4
4
|
outletFormat?: string;
|
|
5
|
+
valueOnClear?: () => any;
|
|
5
6
|
}
|
|
6
7
|
export declare const defaultDatetimePickerInputProps: () => {
|
|
8
|
+
valueOnClear: DatetimePickerInputProps["valueOnClear"];
|
|
7
9
|
validateEvent: boolean;
|
|
8
10
|
type: string;
|
|
9
11
|
calendar: "solar";
|
|
@@ -10,8 +10,9 @@ declare const __VLS_component: import("vue").DefineComponent<DatetimePickerInput
|
|
|
10
10
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
12
|
type: string;
|
|
13
|
-
|
|
13
|
+
valueOnClear: () => any;
|
|
14
14
|
calendar: "solar" | "lunar";
|
|
15
|
+
validateEvent: boolean;
|
|
15
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
17
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
17
18
|
export default _default;
|
|
@@ -55,6 +55,7 @@ export default _defineComponent({
|
|
|
55
55
|
__name: "datetime-picker-input",
|
|
56
56
|
props: _mergeDefaults({
|
|
57
57
|
outletFormat: { type: String, required: false },
|
|
58
|
+
valueOnClear: { type: Function, required: false },
|
|
58
59
|
visible: { type: Boolean, required: false },
|
|
59
60
|
title: { type: String, required: false },
|
|
60
61
|
validateEvent: { type: Boolean, required: false },
|
|
@@ -10,8 +10,8 @@ declare const __VLS_component: import("vue").DefineComponent<DatetimePickerPopou
|
|
|
10
10
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
12
|
type: string;
|
|
13
|
-
validateEvent: boolean;
|
|
14
13
|
calendar: "solar" | "lunar";
|
|
14
|
+
validateEvent: boolean;
|
|
15
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
17
17
|
export default _default;
|
|
@@ -33,7 +33,7 @@ import SarDatetimePicker from "../datetime-picker/datetime-picker.vue";
|
|
|
33
33
|
import {
|
|
34
34
|
defaultDatetimePickerPopoutProps
|
|
35
35
|
} from "./common";
|
|
36
|
-
import { formatDate,
|
|
36
|
+
import { formatDate, isEmptyBinding, toDate } from "../../utils";
|
|
37
37
|
import {
|
|
38
38
|
getInitialValue,
|
|
39
39
|
getMaxDate,
|
|
@@ -90,7 +90,7 @@ export default _defineComponent({
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
const onEnter = () => {
|
|
93
|
-
if (!
|
|
93
|
+
if (!isEmptyBinding(innerValue.value) && popoutValue.value !== innerValue.value) {
|
|
94
94
|
popoutValue.value = innerValue.value;
|
|
95
95
|
}
|
|
96
96
|
};
|
|
@@ -2,8 +2,10 @@ import { type DatetimeRangePickerPopoutProps, type DatetimeRangePickerPopoutSlot
|
|
|
2
2
|
import { type PopoutInputProps } from '../popout-input/common';
|
|
3
3
|
export interface DatetimeRangePickerInputProps extends DatetimeRangePickerPopoutProps, Omit<PopoutInputProps, 'modelValue' | 'loading'> {
|
|
4
4
|
outletFormat?: string;
|
|
5
|
+
valueOnClear?: () => any;
|
|
5
6
|
}
|
|
6
7
|
export declare const defaultDatetimeRangePickerInputProps: () => {
|
|
8
|
+
valueOnClear: DatetimeRangePickerInputProps["valueOnClear"];
|
|
7
9
|
validateEvent: boolean;
|
|
8
10
|
type: string;
|
|
9
11
|
};
|