sard-uniapp 1.9.1 → 1.10.0
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/README.md +39 -1
- package/changelog.md +18 -0
- package/components/calendar/calendar.d.ts +4 -2
- package/components/calendar/calendar.vue +34 -10
- package/components/calendar/common.d.ts +4 -2
- package/components/calendar-input/calendar-input.d.ts +5 -2
- package/components/calendar-input/calendar-input.vue +23 -11
- package/components/calendar-input/common.d.ts +4 -1
- package/components/cascader/cascader.d.ts +2 -0
- package/components/cascader/cascader.vue +6 -1
- package/components/cascader/common.d.ts +1 -0
- package/components/cascader-input/cascader-input.d.ts +2 -0
- package/components/cascader-input/cascader-input.vue +3 -2
- package/components/cascader-input/common.d.ts +1 -0
- package/components/checkbox-input/checkbox-input.d.ts +2 -0
- package/components/checkbox-input/checkbox-input.vue +3 -2
- package/components/checkbox-input/common.d.ts +1 -0
- package/components/config/index.d.ts +6 -0
- package/components/config/index.js +5 -0
- package/components/datetime-picker/common.d.ts +4 -2
- package/components/datetime-picker/datetime-picker.d.ts +4 -2
- package/components/datetime-picker/datetime-picker.vue +29 -12
- package/components/datetime-picker-input/common.d.ts +4 -1
- package/components/datetime-picker-input/common.js +1 -0
- package/components/datetime-picker-input/datetime-picker-input.d.ts +4 -2
- package/components/datetime-picker-input/datetime-picker-input.vue +18 -11
- package/components/dialog/common.d.ts +4 -0
- package/components/dialog/dialog.vue +6 -1
- package/components/dialog-agent/dialog-agent.vue +4 -16
- package/components/input/common.d.ts +2 -0
- package/components/input/input.d.ts +5 -15
- package/components/input/input.vue +22 -4
- package/components/password-input/common.d.ts +1 -0
- package/components/password-input/password-input.d.ts +2 -0
- package/components/password-input/password-input.vue +2 -1
- package/components/picker/common.d.ts +1 -0
- package/components/picker/picker.d.ts +2 -0
- package/components/picker/picker.vue +2 -1
- package/components/picker-input/common.d.ts +1 -0
- package/components/picker-input/picker-input.d.ts +2 -0
- package/components/picker-input/picker-input.vue +4 -2
- package/components/popout-input/common.d.ts +1 -0
- package/components/popout-input/popout-input.d.ts +2 -0
- package/components/popout-input/popout-input.vue +3 -2
- package/components/radio-input/common.d.ts +1 -0
- package/components/radio-input/radio-input.d.ts +2 -0
- package/components/radio-input/radio-input.vue +4 -2
- package/components/rate/common.d.ts +1 -0
- package/components/rate/rate.d.ts +2 -0
- package/components/rate/rate.vue +3 -1
- package/components/search/common.d.ts +2 -0
- package/components/search/search.d.ts +5 -15
- package/components/search/search.vue +7 -2
- package/components/slider/common.d.ts +1 -0
- package/components/slider/slider.d.ts +2 -0
- package/components/slider/slider.vue +4 -2
- package/components/space/common.d.ts +20 -0
- package/components/space/common.js +7 -0
- package/components/space/index.d.ts +1 -0
- package/components/space/index.js +1 -0
- package/components/space/index.scss +38 -0
- package/components/space/space.d.ts +13 -0
- package/components/space/space.vue +65 -0
- package/components/space/variables.scss +7 -0
- package/components/stepper/common.d.ts +1 -0
- package/components/stepper/stepper.d.ts +2 -0
- package/components/stepper/stepper.vue +2 -1
- package/components/switch/common.d.ts +1 -0
- package/components/switch/switch.d.ts +2 -0
- package/components/switch/switch.vue +2 -1
- package/components/upload/common.d.ts +1 -0
- package/components/upload/upload.d.ts +2 -0
- package/components/upload/upload.vue +3 -1
- package/global.d.ts +2 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.scss +1 -0
- package/package.json +2 -2
- package/utils/date.d.ts +2 -1
- package/utils/date.js +72 -21
- package/utils/regexp.d.ts +1 -0
- package/utils/regexp.js +3 -0
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
## 特性
|
|
23
23
|
|
|
24
|
-
- 🧩
|
|
24
|
+
- 🧩 74+个高质量组件,覆盖移动端主流场景
|
|
25
25
|
- 💪 支持一套代码同时开发 H5 / 小程序 / App
|
|
26
26
|
- 🌿 支持按需引入和 `Tree Shaking`
|
|
27
27
|
- 📖 详尽的文档和案例展示
|
|
@@ -100,3 +100,41 @@ npm run deploy
|
|
|
100
100
|
```bash
|
|
101
101
|
npm run release
|
|
102
102
|
```
|
|
103
|
+
|
|
104
|
+
## 修复问题流程
|
|
105
|
+
|
|
106
|
+
- 修复问题
|
|
107
|
+
- 测试
|
|
108
|
+
- 修改版本号
|
|
109
|
+
- 暂存
|
|
110
|
+
- 提交
|
|
111
|
+
- 给提交打标签
|
|
112
|
+
- 运行 `npm run buildAndRelease` 打包组件库并发布到 npm
|
|
113
|
+
- 发布到 uniapp 插件市场
|
|
114
|
+
- 运行 `npm run push` 推送代码和标签
|
|
115
|
+
- 运行 `npm run build:site` 打包文档(如果文档有修改)
|
|
116
|
+
- 运行 `npm run deploy` 部署文档(如果文档有修改)
|
|
117
|
+
- 更新 gitee 上的文档(如果文档有修改)
|
|
118
|
+
|
|
119
|
+
## 新增组件流程
|
|
120
|
+
|
|
121
|
+
- 运行 `npm run newComponent` 命令自动创建组件
|
|
122
|
+
- 编写组件代码
|
|
123
|
+
- 编写案例代码
|
|
124
|
+
- 编写组件文档
|
|
125
|
+
- 编写测试用例
|
|
126
|
+
- 使用实际项目本地安装测试 `pnpm link ../sard-uniapp`
|
|
127
|
+
- 从上面的“修复问题流程”第三部“修改版本号”开始走一遍
|
|
128
|
+
|
|
129
|
+
## 打包安卓包流程
|
|
130
|
+
|
|
131
|
+
- 在 `HBuilder` 中打开 `sard-uniapp` 项目
|
|
132
|
+
- 点击 发行->App-Android/iOS-云打包
|
|
133
|
+
- 勾选“android(apk 包)” 、“使用云端证书”、“打正式包”、“快速安心打包”
|
|
134
|
+
- 点击“打包“按钮开始打包
|
|
135
|
+
- 注意:如果控制台出现错误:`[ERROR] Cannot start service: Host version "_._._" does not match - binary version "_._._"`,需安装和 Host version 一样版本的 `@esbuild/darwin-x64`
|
|
136
|
+
- 等待云端打包完成
|
|
137
|
+
- 到 `gitee` 仓库创建发行版:[resource 发行版 - Gitee.com](https://gitee.com/sutras/resource/releases/new)
|
|
138
|
+
- 将 gitee 发行版 apk 资源链接转换为二维码图片
|
|
139
|
+
- 将图片更新到 `sard-assets` 项目,并发布到 npm
|
|
140
|
+
- 最后等待 http://fastly.jsdelivr.net 链接生效
|
package/changelog.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# [1.10.0](https://github.com/sutras/sard-uniapp/compare/v1.9.2...v1.10.0) (2025-01-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* 新增 Space 组件, 新增 Dialog 组件的按钮配置, 新增 valueFormat 属性, 修复已知问题 ([7648ea6](https://github.com/sutras/sard-uniapp/commit/7648ea65937c5af9a2b6a8cfa9c5b70ade14ef65))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [1.9.2](https://github.com/sutras/sard-uniapp/compare/v1.9.1...v1.9.2) (2024-12-22)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* 表单组件新增change事件 ([58f2fa8](https://github.com/sutras/sard-uniapp/commit/58f2fa88e59f4b28b23592cf9ff17e2353a9ae37))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
1
19
|
## [1.9.1](https://github.com/sutras/sard-uniapp/compare/v1.9.0...v1.9.1) (2024-12-22)
|
|
2
20
|
|
|
3
21
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type CalendarProps } from './common';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<CalendarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
|
-
"update:model-value": (value: Date | Date[]) => any;
|
|
3
|
+
"update:model-value": (value: string | string[] | Date | Date[]) => any;
|
|
4
|
+
change: (value: string | string[] | Date | Date[]) => any;
|
|
4
5
|
}, string, import("vue").PublicProps, Readonly<CalendarProps> & Readonly<{
|
|
5
|
-
"onUpdate:model-value"?: ((value: Date | Date[]) => any) | undefined;
|
|
6
|
+
"onUpdate:model-value"?: ((value: string | string[] | Date | Date[]) => any) | undefined;
|
|
7
|
+
onChange?: ((value: string | string[] | Date | Date[]) => any) | undefined;
|
|
6
8
|
}>, {
|
|
7
9
|
type: import("./common").CalendarType;
|
|
8
10
|
maxDays: number;
|
|
@@ -88,7 +88,9 @@ import {
|
|
|
88
88
|
toMonthNumber,
|
|
89
89
|
getPrevMonthDate,
|
|
90
90
|
getNextMonthDate,
|
|
91
|
-
toArray
|
|
91
|
+
toArray,
|
|
92
|
+
parseDate,
|
|
93
|
+
formatDate
|
|
92
94
|
} from "../../utils";
|
|
93
95
|
import {
|
|
94
96
|
defaultCalendarProps,
|
|
@@ -123,7 +125,7 @@ export default _defineComponent({
|
|
|
123
125
|
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
124
126
|
rootClass: { type: String, required: false },
|
|
125
127
|
type: { type: String, required: false },
|
|
126
|
-
modelValue: { type: [Date, Array], required: false },
|
|
128
|
+
modelValue: { type: [Date, Array, String], required: false },
|
|
127
129
|
min: { type: Date, required: false },
|
|
128
130
|
max: { type: Date, required: false },
|
|
129
131
|
currentDate: { type: Date, required: false },
|
|
@@ -133,9 +135,10 @@ export default _defineComponent({
|
|
|
133
135
|
weekStartsOn: { type: Number, required: false },
|
|
134
136
|
formatter: { type: Function, required: false },
|
|
135
137
|
allowSameDay: { type: Boolean, required: false },
|
|
136
|
-
severalMonths: { type: Boolean, required: false }
|
|
138
|
+
severalMonths: { type: Boolean, required: false },
|
|
139
|
+
valueFormat: { type: String, required: false }
|
|
137
140
|
}, defaultCalendarProps),
|
|
138
|
-
emits: ["update:model-value"],
|
|
141
|
+
emits: ["update:model-value", "change"],
|
|
139
142
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
140
143
|
__expose();
|
|
141
144
|
const props = __props;
|
|
@@ -149,20 +152,34 @@ export default _defineComponent({
|
|
|
149
152
|
const maxDate2 = props.max || getMaxDate(props.severalMonths);
|
|
150
153
|
return maxDate2.getTime() < minDate.value.getTime() ? new Date(minDate.value) : maxDate2;
|
|
151
154
|
});
|
|
155
|
+
const toDate = (date) => {
|
|
156
|
+
if (date instanceof Date) {
|
|
157
|
+
return date;
|
|
158
|
+
}
|
|
159
|
+
return parseDate(date, props.valueFormat);
|
|
160
|
+
};
|
|
161
|
+
const makeDate = (date) => {
|
|
162
|
+
return Array.isArray(date) ? date.map((item) => toDate(item)) : toDate(date);
|
|
163
|
+
};
|
|
164
|
+
const normalizeValue = (value) => {
|
|
165
|
+
return value ? makeDate(value) : props.type === "single" ? void 0 : [];
|
|
166
|
+
};
|
|
152
167
|
const innerValue = ref(
|
|
153
|
-
props.modelValue
|
|
168
|
+
normalizeValue(props.modelValue)
|
|
154
169
|
);
|
|
170
|
+
let currentEmitValue = innerValue.value;
|
|
155
171
|
watch(
|
|
156
172
|
() => props.modelValue,
|
|
157
173
|
() => {
|
|
158
|
-
if (
|
|
159
|
-
innerValue.value = props.modelValue
|
|
174
|
+
if (currentEmitValue !== props.modelValue) {
|
|
175
|
+
innerValue.value = normalizeValue(props.modelValue);
|
|
176
|
+
currentEmitValue = props.modelValue;
|
|
160
177
|
}
|
|
161
178
|
}
|
|
162
179
|
);
|
|
163
180
|
const getInitialCurrentDate = () => {
|
|
164
181
|
let date = new Date();
|
|
165
|
-
const value = toArray(
|
|
182
|
+
const value = toArray(innerValue.value)[0];
|
|
166
183
|
if (value) {
|
|
167
184
|
date = value;
|
|
168
185
|
}
|
|
@@ -286,7 +303,10 @@ export default _defineComponent({
|
|
|
286
303
|
}
|
|
287
304
|
if (nextValue !== void 0) {
|
|
288
305
|
innerValue.value = nextValue;
|
|
289
|
-
|
|
306
|
+
const emitValue = props.valueFormat ? Array.isArray(nextValue) ? nextValue.map((item) => formatDate(item, props.valueFormat)) : formatDate(nextValue, props.valueFormat) : nextValue;
|
|
307
|
+
currentEmitValue = emitValue;
|
|
308
|
+
emit("update:model-value", emitValue);
|
|
309
|
+
emit("change", emitValue);
|
|
290
310
|
}
|
|
291
311
|
};
|
|
292
312
|
const inPopup = useInPopup();
|
|
@@ -304,7 +324,11 @@ export default _defineComponent({
|
|
|
304
324
|
const calendarStyle = computed(() => {
|
|
305
325
|
return stringifyStyle(props.rootStyle);
|
|
306
326
|
});
|
|
307
|
-
const __returned__ = { props, emit, bem, t, minDate, maxDate,
|
|
327
|
+
const __returned__ = { props, emit, bem, t, minDate, maxDate, toDate, makeDate, normalizeValue, innerValue, get currentEmitValue() {
|
|
328
|
+
return currentEmitValue;
|
|
329
|
+
}, set currentEmitValue(v) {
|
|
330
|
+
currentEmitValue = v;
|
|
331
|
+
}, getInitialCurrentDate, innerCurrentDate, startDate, onPrevMonthClick, onNextMonthClick, pickerVisible, pickerValue, onMonthClick, onPickerConfirm, weeks, months, todayNumber, currentDates, onDayClick, inPopup, preventPageScroll, calendarClass, calendarStyle, get toMonthNumber() {
|
|
308
332
|
return toMonthNumber;
|
|
309
333
|
}, SarButton, SarIcon, SarCalendarMonth, SarPopout, SarDatetimePicker };
|
|
310
334
|
return __returned__;
|
|
@@ -16,7 +16,7 @@ export interface CalendarProps {
|
|
|
16
16
|
rootStyle?: StyleValue;
|
|
17
17
|
rootClass?: string;
|
|
18
18
|
type?: CalendarType;
|
|
19
|
-
modelValue?: Date | Date[];
|
|
19
|
+
modelValue?: Date | Date[] | string | string[];
|
|
20
20
|
min?: Date;
|
|
21
21
|
max?: Date;
|
|
22
22
|
currentDate?: Date;
|
|
@@ -27,6 +27,7 @@ export interface CalendarProps {
|
|
|
27
27
|
formatter?: (day: CalendarDay) => void;
|
|
28
28
|
allowSameDay?: boolean;
|
|
29
29
|
severalMonths?: boolean;
|
|
30
|
+
valueFormat?: string;
|
|
30
31
|
}
|
|
31
32
|
export declare const defaultCalendarProps: {
|
|
32
33
|
type: CalendarProps["type"];
|
|
@@ -34,7 +35,8 @@ export declare const defaultCalendarProps: {
|
|
|
34
35
|
weekStartsOn: number;
|
|
35
36
|
};
|
|
36
37
|
export interface CalendarEmits {
|
|
37
|
-
(e: 'update:model-value', value: Date | Date[]): void;
|
|
38
|
+
(e: 'update:model-value', value: Date | Date[] | string | string[]): void;
|
|
39
|
+
(e: 'change', value: Date | Date[] | string | string[]): void;
|
|
38
40
|
}
|
|
39
41
|
export interface CalendarMonthProps {
|
|
40
42
|
year: number;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type CalendarType } from '../calendar/common';
|
|
2
2
|
import { type CalendarInputProps } from './common';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<CalendarInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
|
-
"update:model-value": (value: Date | Date[] | undefined) => any;
|
|
4
|
+
"update:model-value": (value: string | string[] | Date | Date[] | undefined) => any;
|
|
5
|
+
change: (value: string | string[] | Date | Date[] | undefined) => any;
|
|
5
6
|
"update:visible": (visible: boolean) => any;
|
|
6
7
|
}, string, import("vue").PublicProps, Readonly<CalendarInputProps> & Readonly<{
|
|
7
|
-
"onUpdate:model-value"?: ((value: Date | Date[] | undefined) => any) | undefined;
|
|
8
|
+
"onUpdate:model-value"?: ((value: string | string[] | Date | Date[] | undefined) => any) | undefined;
|
|
9
|
+
onChange?: ((value: string | string[] | Date | Date[] | undefined) => any) | undefined;
|
|
8
10
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
9
11
|
}>, {
|
|
10
12
|
type: CalendarType;
|
|
@@ -12,5 +14,6 @@ declare const _default: import("vue").DefineComponent<CalendarInputProps, {}, {}
|
|
|
12
14
|
maxDays: number;
|
|
13
15
|
weekStartsOn: number;
|
|
14
16
|
showConfirm: boolean;
|
|
17
|
+
outletFormat: string;
|
|
15
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
19
|
export default _default;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<sar-calendar
|
|
24
24
|
v-if="already"
|
|
25
25
|
:model-value="popoutValue"
|
|
26
|
-
@
|
|
26
|
+
@change="onChange"
|
|
27
27
|
:type="type"
|
|
28
28
|
:min="min"
|
|
29
29
|
:max="max"
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
:formatter="formatter"
|
|
36
36
|
:allow-same-day="allowSameDay"
|
|
37
37
|
:several-months="severalMonths"
|
|
38
|
+
:value-format="valueFormat"
|
|
38
39
|
/>
|
|
39
40
|
</template>
|
|
40
41
|
</sar-popout>
|
|
@@ -46,13 +47,12 @@ import { ref, watch, computed } from "vue";
|
|
|
46
47
|
import SarPopoutInput from "../popout-input/popout-input.vue";
|
|
47
48
|
import SarCalendar from "../calendar/calendar.vue";
|
|
48
49
|
import SarPopout from "../popout/popout.vue";
|
|
49
|
-
import { formatDate } from "../../utils";
|
|
50
|
+
import { formatDate, isString, parseDate } from "../../utils";
|
|
50
51
|
import { useTranslate } from "../locale";
|
|
51
52
|
import {
|
|
52
53
|
defaultCalendarInputProps
|
|
53
54
|
} from "./common";
|
|
54
55
|
import { useFormItemContext } from "../form/common";
|
|
55
|
-
const format = "YYYY-MM-DD";
|
|
56
56
|
export default _defineComponent({
|
|
57
57
|
components: {
|
|
58
58
|
SarPopoutInput,
|
|
@@ -70,11 +70,12 @@ export default _defineComponent({
|
|
|
70
70
|
visible: { type: Boolean, required: false },
|
|
71
71
|
title: { type: String, required: false },
|
|
72
72
|
showConfirm: { type: Boolean, required: false },
|
|
73
|
+
outletFormat: { type: String, required: false },
|
|
73
74
|
validateEvent: { type: Boolean, required: false },
|
|
74
75
|
rootStyle: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
75
76
|
rootClass: { type: String, required: false },
|
|
76
77
|
type: { type: String, required: false },
|
|
77
|
-
modelValue: { type: [Date, Array], required: false },
|
|
78
|
+
modelValue: { type: [Date, Array, String], required: false },
|
|
78
79
|
min: { type: Date, required: false },
|
|
79
80
|
max: { type: Date, required: false },
|
|
80
81
|
currentDate: { type: Date, required: false },
|
|
@@ -85,13 +86,14 @@ export default _defineComponent({
|
|
|
85
86
|
formatter: { type: Function, required: false },
|
|
86
87
|
allowSameDay: { type: Boolean, required: false },
|
|
87
88
|
severalMonths: { type: Boolean, required: false },
|
|
89
|
+
valueFormat: { type: String, required: false },
|
|
88
90
|
placeholder: { type: String, required: false },
|
|
89
91
|
readonly: { type: Boolean, required: false },
|
|
90
92
|
disabled: { type: Boolean, required: false },
|
|
91
93
|
clearable: { type: Boolean, required: false },
|
|
92
94
|
multiline: { type: Boolean, required: false }
|
|
93
95
|
}, defaultCalendarInputProps),
|
|
94
|
-
emits: ["update:visible", "update:model-value"],
|
|
96
|
+
emits: ["update:visible", "update:model-value", "change"],
|
|
95
97
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
96
98
|
__expose();
|
|
97
99
|
const props = __props;
|
|
@@ -125,19 +127,28 @@ export default _defineComponent({
|
|
|
125
127
|
const onConfirm = () => {
|
|
126
128
|
innerValue.value = popoutValue.value;
|
|
127
129
|
emit("update:model-value", popoutValue.value);
|
|
130
|
+
emit("change", popoutValue.value);
|
|
128
131
|
inputValue.value = getInputValue();
|
|
129
132
|
};
|
|
130
133
|
const inputValue = ref("");
|
|
131
134
|
const { t } = useTranslate("calendar");
|
|
135
|
+
function getOutletTextMayByStr(date) {
|
|
136
|
+
if (isString(date) && props.valueFormat) {
|
|
137
|
+
date = parseDate(date, props.valueFormat);
|
|
138
|
+
}
|
|
139
|
+
if (date instanceof Date) {
|
|
140
|
+
return formatDate(date, props.outletFormat);
|
|
141
|
+
}
|
|
142
|
+
return date;
|
|
143
|
+
}
|
|
132
144
|
function getOutletText(date, type) {
|
|
133
145
|
if (type === "single") {
|
|
134
|
-
return
|
|
146
|
+
return getOutletTextMayByStr(date);
|
|
135
147
|
}
|
|
136
148
|
if (type === "range") {
|
|
137
|
-
return `${
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)}`;
|
|
149
|
+
return `${getOutletTextMayByStr(date[0])} ${t(
|
|
150
|
+
"to"
|
|
151
|
+
)} ${getOutletTextMayByStr(date[1])}`;
|
|
141
152
|
}
|
|
142
153
|
if (type === "multiple") {
|
|
143
154
|
return t("multipleOutlet", {
|
|
@@ -165,6 +176,7 @@ export default _defineComponent({
|
|
|
165
176
|
inputValue.value = "";
|
|
166
177
|
innerValue.value = void 0;
|
|
167
178
|
emit("update:model-value", void 0);
|
|
179
|
+
emit("change", void 0);
|
|
168
180
|
};
|
|
169
181
|
const innerVisible = ref(props.visible);
|
|
170
182
|
watch(
|
|
@@ -181,7 +193,7 @@ export default _defineComponent({
|
|
|
181
193
|
innerVisible.value = true;
|
|
182
194
|
emit("update:visible", true);
|
|
183
195
|
};
|
|
184
|
-
const __returned__ = { props, emit, formItemContext, innerValue, popoutValue, confirmDisabled, onChange, onConfirm, inputValue,
|
|
196
|
+
const __returned__ = { props, emit, formItemContext, innerValue, popoutValue, confirmDisabled, onChange, onConfirm, inputValue, t, getOutletTextMayByStr, getOutletText, getInputValue, onClear, innerVisible, onVisible, onInputClick, SarPopoutInput, SarCalendar, SarPopout };
|
|
185
197
|
return __returned__;
|
|
186
198
|
}
|
|
187
199
|
});
|
|
@@ -4,6 +4,7 @@ export interface CalendarInputProps extends CalendarProps, Omit<PopoutInputProps
|
|
|
4
4
|
visible?: boolean;
|
|
5
5
|
title?: string;
|
|
6
6
|
showConfirm?: boolean;
|
|
7
|
+
outletFormat?: string;
|
|
7
8
|
validateEvent?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare const defaultCalendarInputProps: {
|
|
@@ -12,8 +13,10 @@ export declare const defaultCalendarInputProps: {
|
|
|
12
13
|
weekStartsOn: number;
|
|
13
14
|
showConfirm: boolean;
|
|
14
15
|
validateEvent: boolean;
|
|
16
|
+
outletFormat: string;
|
|
15
17
|
};
|
|
16
18
|
export interface CalendarInputEmits {
|
|
17
19
|
(e: 'update:visible', visible: boolean): void;
|
|
18
|
-
(e: 'update:model-value', value: Date | Date[] | undefined): void;
|
|
20
|
+
(e: 'update:model-value', value: Date | Date[] | string | string[] | undefined): void;
|
|
21
|
+
(e: 'change', value: Date | Date[] | string | string[] | undefined): void;
|
|
19
22
|
}
|
|
@@ -2,9 +2,11 @@ import { type CascaderProps, type CascaderSlots, type CascaderOption } from './c
|
|
|
2
2
|
declare function __VLS_template(): Readonly<CascaderSlots> & CascaderSlots;
|
|
3
3
|
declare const __VLS_component: import("vue").DefineComponent<CascaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
4
|
"update:model-value": (value: string | number, selectedOptions: CascaderOption[]) => any;
|
|
5
|
+
change: (value: string | number, selectedOptions: CascaderOption[]) => any;
|
|
5
6
|
select: (option: CascaderOption, tabIndex: number) => any;
|
|
6
7
|
}, string, import("vue").PublicProps, Readonly<CascaderProps> & Readonly<{
|
|
7
8
|
"onUpdate:model-value"?: ((value: string | number, selectedOptions: CascaderOption[]) => any) | undefined;
|
|
9
|
+
onChange?: ((value: string | number, selectedOptions: CascaderOption[]) => any) | undefined;
|
|
8
10
|
onSelect?: ((option: CascaderOption, tabIndex: number) => any) | undefined;
|
|
9
11
|
}>, {
|
|
10
12
|
options: CascaderOption[];
|
|
@@ -109,7 +109,7 @@ export default _defineComponent({
|
|
|
109
109
|
hintText: { type: String, required: false },
|
|
110
110
|
labelRender: { type: Function, required: false }
|
|
111
111
|
}, defaultCascaderProps),
|
|
112
|
-
emits: ["update:model-value", "select"],
|
|
112
|
+
emits: ["update:model-value", "change", "select"],
|
|
113
113
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
114
114
|
__expose();
|
|
115
115
|
const props = __props;
|
|
@@ -188,6 +188,11 @@ export default _defineComponent({
|
|
|
188
188
|
nextValue,
|
|
189
189
|
nextTabs.map((tab) => tab.selected)
|
|
190
190
|
);
|
|
191
|
+
emit(
|
|
192
|
+
"change",
|
|
193
|
+
nextValue,
|
|
194
|
+
nextTabs.map((tab) => tab.selected)
|
|
195
|
+
);
|
|
191
196
|
}
|
|
192
197
|
tempValue = option[mergedFieldKeys.value.value];
|
|
193
198
|
tabs.value = nextTabs;
|
|
@@ -31,6 +31,7 @@ export interface CascaderSlots {
|
|
|
31
31
|
}
|
|
32
32
|
export interface CascaderEmits {
|
|
33
33
|
(e: 'update:model-value', value: string | number, selectedOptions: CascaderOption[]): void;
|
|
34
|
+
(e: 'change', value: string | number, selectedOptions: CascaderOption[]): void;
|
|
34
35
|
(e: 'select', option: CascaderOption, tabIndex: number): void;
|
|
35
36
|
}
|
|
36
37
|
export interface CascaderTab {
|
|
@@ -3,10 +3,12 @@ import { type CascaderInputProps, type CascaderInputSlots } from './common';
|
|
|
3
3
|
declare function __VLS_template(): Readonly<CascaderInputSlots> & CascaderInputSlots;
|
|
4
4
|
declare const __VLS_component: import("vue").DefineComponent<CascaderInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
5
|
"update:model-value": (value: any) => any;
|
|
6
|
+
change: (value: any) => any;
|
|
6
7
|
select: (option: CascaderOption, tabIndex: number) => any;
|
|
7
8
|
"update:visible": (visible: boolean) => any;
|
|
8
9
|
}, string, import("vue").PublicProps, Readonly<CascaderInputProps> & Readonly<{
|
|
9
10
|
"onUpdate:model-value"?: ((value: any) => any) | undefined;
|
|
11
|
+
onChange?: ((value: any) => any) | undefined;
|
|
10
12
|
onSelect?: ((option: CascaderOption, tabIndex: number) => any) | undefined;
|
|
11
13
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
12
14
|
}>, {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<sar-cascader
|
|
24
24
|
v-if="already"
|
|
25
25
|
:model-value="popoutValue"
|
|
26
|
-
@
|
|
26
|
+
@change="onChange"
|
|
27
27
|
:options="options"
|
|
28
28
|
:field-keys="fieldKeys"
|
|
29
29
|
:placeholder="hintText"
|
|
@@ -84,7 +84,7 @@ export default _defineComponent({
|
|
|
84
84
|
loading: { type: Boolean, required: false },
|
|
85
85
|
multiline: { type: Boolean, required: false }
|
|
86
86
|
}, defaultCascaderInputProps),
|
|
87
|
-
emits: ["update:visible", "update:model-value", "select"],
|
|
87
|
+
emits: ["update:visible", "update:model-value", "change", "select"],
|
|
88
88
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
89
89
|
__expose();
|
|
90
90
|
const props = __props;
|
|
@@ -114,6 +114,7 @@ export default _defineComponent({
|
|
|
114
114
|
const onConfirm = () => {
|
|
115
115
|
innerValue.value = popoutValue.value;
|
|
116
116
|
emit("update:model-value", popoutValue.value);
|
|
117
|
+
emit("change", popoutValue.value);
|
|
117
118
|
inputValue.value = getInputValue();
|
|
118
119
|
};
|
|
119
120
|
const inputValue = ref("");
|
|
@@ -18,5 +18,6 @@ export interface CascaderInputSlots {
|
|
|
18
18
|
export interface CascaderInputEmits {
|
|
19
19
|
(e: 'update:visible', visible: boolean): void;
|
|
20
20
|
(e: 'update:model-value', value: any): void;
|
|
21
|
+
(e: 'change', value: any): void;
|
|
21
22
|
(e: 'select', option: CascaderOption, tabIndex: number): void;
|
|
22
23
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type CheckboxInputProps } from './common';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<CheckboxInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
3
|
"update:model-value": (value: any) => any;
|
|
4
|
+
change: (value: any) => any;
|
|
4
5
|
"update:visible": (visible: boolean) => any;
|
|
5
6
|
}, string, import("vue").PublicProps, Readonly<CheckboxInputProps> & Readonly<{
|
|
6
7
|
"onUpdate:model-value"?: ((value: any) => any) | undefined;
|
|
8
|
+
onChange?: ((value: any) => any) | undefined;
|
|
7
9
|
"onUpdate:visible"?: ((visible: boolean) => any) | undefined;
|
|
8
10
|
}>, {
|
|
9
11
|
options: import("../checkbox/common").CheckboxGroupOption[];
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
:direction="direction"
|
|
28
28
|
:validate-event="false"
|
|
29
29
|
:model-value="popoutValue"
|
|
30
|
-
@
|
|
30
|
+
@change="onChange"
|
|
31
31
|
>
|
|
32
32
|
<template #custom="{ toggle }">
|
|
33
33
|
<sar-list inlaid>
|
|
@@ -107,7 +107,7 @@ export default _defineComponent({
|
|
|
107
107
|
loading: { type: Boolean, required: false },
|
|
108
108
|
multiline: { type: Boolean, required: false }
|
|
109
109
|
}, defaultCheckboxInputProps),
|
|
110
|
-
emits: ["update:visible", "update:model-value"],
|
|
110
|
+
emits: ["update:visible", "update:model-value", "change"],
|
|
111
111
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
112
112
|
__expose();
|
|
113
113
|
const props = __props;
|
|
@@ -137,6 +137,7 @@ export default _defineComponent({
|
|
|
137
137
|
const onConfirm = () => {
|
|
138
138
|
innerValue.value = popoutValue.value;
|
|
139
139
|
emit("update:model-value", popoutValue.value);
|
|
140
|
+
emit("change", popoutValue.value);
|
|
140
141
|
inputValue.value = getInputValue();
|
|
141
142
|
};
|
|
142
143
|
const inputValue = ref("");
|
|
@@ -25,6 +25,7 @@ import { type RadioGroupProps } from '../radio';
|
|
|
25
25
|
import { type RadioInputProps } from '../radio-input';
|
|
26
26
|
import { type ResultProps } from '../result';
|
|
27
27
|
import { type SearchProps } from '../search';
|
|
28
|
+
import { type SpaceProps } from '../space';
|
|
28
29
|
import { type StepperProps } from '../stepper';
|
|
29
30
|
import { type StepsProps } from '../steps';
|
|
30
31
|
import { type SwiperDotProps } from '../swiper-dot';
|
|
@@ -70,6 +71,7 @@ export declare const defaultConfig: {
|
|
|
70
71
|
calendarInput: {
|
|
71
72
|
showConfirm: boolean;
|
|
72
73
|
validateEvent: boolean;
|
|
74
|
+
outletFormat: string;
|
|
73
75
|
};
|
|
74
76
|
cascaderInput: {
|
|
75
77
|
showConfirm: boolean;
|
|
@@ -304,6 +306,10 @@ export declare const defaultConfig: {
|
|
|
304
306
|
step: number;
|
|
305
307
|
validateEvent: boolean;
|
|
306
308
|
};
|
|
309
|
+
space: {
|
|
310
|
+
direction: SpaceProps["direction"];
|
|
311
|
+
size: SpaceProps["size"];
|
|
312
|
+
};
|
|
307
313
|
stepper: {
|
|
308
314
|
min: number;
|
|
309
315
|
max: number;
|
|
@@ -32,6 +32,7 @@ export const defaultConfig = {
|
|
|
32
32
|
calendarInput: {
|
|
33
33
|
showConfirm: true,
|
|
34
34
|
validateEvent: true,
|
|
35
|
+
outletFormat: 'YYYY-MM-DD',
|
|
35
36
|
},
|
|
36
37
|
cascaderInput: {
|
|
37
38
|
showConfirm: true,
|
|
@@ -266,6 +267,10 @@ export const defaultConfig = {
|
|
|
266
267
|
step: 1,
|
|
267
268
|
validateEvent: true,
|
|
268
269
|
},
|
|
270
|
+
space: {
|
|
271
|
+
direction: 'horizontal',
|
|
272
|
+
size: 'middle',
|
|
273
|
+
},
|
|
269
274
|
stepper: {
|
|
270
275
|
min: Number.MIN_SAFE_INTEGER,
|
|
271
276
|
max: Number.MAX_SAFE_INTEGER,
|
|
@@ -5,15 +5,17 @@ export interface DatetimePickerProps {
|
|
|
5
5
|
type?: string;
|
|
6
6
|
min?: Date;
|
|
7
7
|
max?: Date;
|
|
8
|
-
modelValue?: Date;
|
|
8
|
+
modelValue?: Date | string;
|
|
9
9
|
filter?: (letter: DatetimeLetter, value: number, date: Date, index: number) => boolean;
|
|
10
10
|
formatter?: (letter: DatetimeLetter, option: DatetimeColumnOption, date: Date, index: number) => string | void | undefined;
|
|
11
|
+
valueFormat?: string;
|
|
11
12
|
}
|
|
12
13
|
export declare const defaultDatetimePickerProps: {
|
|
13
14
|
type: string;
|
|
14
15
|
};
|
|
15
16
|
export interface DatetimePickerEmits {
|
|
16
|
-
(e: 'update:model-value', date: Date): void;
|
|
17
|
+
(e: 'update:model-value', date: Date | string): void;
|
|
18
|
+
(e: 'change', date: Date | string): void;
|
|
17
19
|
}
|
|
18
20
|
export interface DatetimeColumnOption {
|
|
19
21
|
value: number;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type DatetimePickerProps } from './common';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<DatetimePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
3
|
-
"update:model-value": (date: Date) => any;
|
|
3
|
+
"update:model-value": (date: string | Date) => any;
|
|
4
|
+
change: (date: string | Date) => any;
|
|
4
5
|
}, string, import("vue").PublicProps, Readonly<DatetimePickerProps> & Readonly<{
|
|
5
|
-
"onUpdate:model-value"?: ((date: Date) => any) | undefined;
|
|
6
|
+
"onUpdate:model-value"?: ((date: string | Date) => any) | undefined;
|
|
7
|
+
onChange?: ((date: string | Date) => any) | undefined;
|
|
6
8
|
}>, {
|
|
7
9
|
type: string;
|
|
8
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|