hy-app 0.1.1 → 0.1.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/components/hy-address-picker/hy-address-picker.vue +11 -13
- package/components/hy-address-picker/props.ts +2 -3
- package/components/hy-address-picker/typing.d.ts +1 -2
- package/components/hy-avatar/hy-avatar.vue +9 -9
- package/components/hy-avatar/props.ts +2 -2
- package/components/hy-avatar/typing.d.ts +1 -1
- package/components/hy-badge/hy-badge.vue +5 -4
- package/components/hy-badge/props.ts +2 -2
- package/components/hy-badge/typing.d.ts +2 -2
- package/components/hy-button/hy-button.vue +12 -12
- package/components/hy-button/props.ts +4 -5
- package/components/hy-button/typing.d.ts +3 -3
- package/components/hy-cell/hy-cell.vue +55 -20
- package/components/hy-cell/props.ts +2 -2
- package/components/hy-cell/typing.d.ts +4 -3
- package/components/hy-check-button/hy-check-button.vue +13 -7
- package/components/hy-check-button/props.ts +3 -3
- package/components/hy-checkbox/hy-checkbox.vue +23 -13
- package/components/hy-checkbox/props.ts +4 -5
- package/components/hy-checkbox/typing.d.ts +3 -6
- package/components/hy-datetime-picker/hy-datetime-picker.vue +36 -36
- package/components/hy-datetime-picker/props.ts +2 -2
- package/components/hy-datetime-picker/typing.d.ts +1 -1
- package/components/hy-form/hy-form.vue +6 -6
- package/components/hy-form/props.ts +2 -2
- package/components/hy-form/typing.d.ts +1 -1
- package/components/hy-grid/hy-grid.vue +4 -3
- package/components/hy-grid/props.ts +5 -5
- package/components/hy-grid/typing.d.ts +2 -2
- package/components/hy-icon/hy-icon.vue +8 -6
- package/components/hy-icon/props.ts +5 -5
- package/components/hy-input/hy-input.vue +9 -10
- package/components/hy-input/props.ts +2 -2
- package/components/hy-input/typing.d.ts +2 -2
- package/components/hy-login/TheUserLogin.vue +2 -2
- package/components/hy-number-step/hy-number-step.vue +54 -35
- package/components/hy-number-step/props.ts +2 -2
- package/components/hy-number-step/typing.d.ts +1 -1
- package/components/hy-overlay/hy-overlay.vue +3 -3
- package/components/hy-overlay/props.ts +2 -2
- package/components/hy-overlay/typing.d.ts +1 -1
- package/components/hy-picker/hy-picker.vue +20 -19
- package/components/hy-picker/props.ts +3 -2
- package/components/hy-picker/typing.d.ts +5 -1
- package/components/hy-popup/hy-popup.vue +6 -6
- package/components/hy-popup/props.ts +2 -2
- package/components/hy-popup/typing.d.ts +1 -1
- package/components/hy-price/hy-price.vue +4 -4
- package/components/hy-price/props.ts +2 -2
- package/components/hy-price/typing.d.ts +1 -1
- package/components/hy-radio/hy-radio.vue +26 -13
- package/components/hy-radio/props.ts +4 -4
- package/components/hy-radio/typing.d.ts +2 -1
- package/components/hy-rate/hy-rate.vue +32 -20
- package/components/hy-rate/props.ts +4 -3
- package/components/hy-rate/typing.d.ts +1 -1
- package/components/hy-search/hy-search.vue +11 -11
- package/components/hy-search/props.ts +2 -2
- package/components/hy-search/typing.d.ts +1 -2
- package/components/hy-slider/hy-slider.vue +32 -31
- package/components/hy-slider/props.ts +2 -2
- package/components/hy-subsection/hy-subsection.vue +46 -17
- package/components/hy-subsection/props.ts +6 -3
- package/components/hy-subsection/typing.d.ts +11 -8
- package/components/hy-swiper/hy-swiper.vue +44 -11
- package/components/hy-swiper/props.ts +3 -3
- package/components/hy-swiper/typing.d.ts +7 -4
- package/components/hy-switch/hy-switch.vue +11 -4
- package/components/hy-switch/props.ts +2 -2
- package/components/hy-tag/hy-tag.vue +14 -16
- package/components/hy-tag/props.ts +2 -2
- package/components/hy-tag/typing.d.ts +2 -2
- package/components/hy-textarea/hy-textarea.vue +12 -5
- package/components/hy-textarea/props.ts +2 -2
- package/components/hy-textarea/typing.d.ts +1 -1
- package/components/hy-transition/hy-transition.vue +13 -6
- package/components/hy-transition/props.ts +2 -2
- package/components/hy-transition/typing.d.ts +1 -1
- package/index.scss +1 -0
- package/libs/css/common.scss +4 -0
- package/libs/css/download.zip +0 -0
- package/libs/css/iconfont.css +4 -4
- package/libs/css/iconfont.ttf +0 -0
- package/libs/css/iconfont.woff +0 -0
- package/libs/css/iconfont.woff2 +0 -0
- package/package.json +4 -4
- package/theme.scss +3 -3
- package/typing/index.ts +0 -1
- package/typing/modules/common.d.ts +50 -0
- package/typing/modules/form.ts +3 -3
- package/utils/utils.ts +22 -13
- package/typing/modules/img.ts +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
4
|
modelValue: "",
|
|
@@ -6,7 +6,7 @@ const defaultProps: IProps = {
|
|
|
6
6
|
fieldNames: {
|
|
7
7
|
label: "label",
|
|
8
8
|
value: "value",
|
|
9
|
-
checked: "checked"
|
|
9
|
+
checked: "checked",
|
|
10
10
|
},
|
|
11
11
|
selectType: "checkbox",
|
|
12
12
|
disabled: false,
|
|
@@ -14,7 +14,7 @@ const defaultProps: IProps = {
|
|
|
14
14
|
gap: "10px",
|
|
15
15
|
type: "primary",
|
|
16
16
|
size: "medium",
|
|
17
|
-
shape: "square"
|
|
17
|
+
shape: "square",
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export default defaultProps;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<template v-for="(item, i) in columns_1" :key="i">
|
|
4
4
|
<view
|
|
5
5
|
class="hy-checkbox cursor-pointer"
|
|
6
|
-
@tap.stop="wrapperClickHandler"
|
|
6
|
+
@tap.stop="wrapperClickHandler($event, item)"
|
|
7
7
|
:style="checkboxStyle"
|
|
8
8
|
:class="[
|
|
9
9
|
`hy-checkbox-label--${iconPlacement}`,
|
|
10
|
-
borderBottom && placement === 'column' && 'hy-border-bottom'
|
|
10
|
+
borderBottom && placement === 'column' && 'hy-border-bottom',
|
|
11
11
|
]"
|
|
12
12
|
>
|
|
13
13
|
<view
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<HyIcon
|
|
25
25
|
class="hy-checkbox__icon-wrap__icon"
|
|
26
26
|
:name="IconConfig.CHECK_MASK"
|
|
27
|
-
:size="addUnit(iconSize)"
|
|
27
|
+
:size="addUnit(sizeType[size] ?? iconSize)"
|
|
28
28
|
:color="iconColor || '#ffffff'"
|
|
29
29
|
/>
|
|
30
30
|
</slot>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<text
|
|
38
38
|
:style="{
|
|
39
39
|
color: labelColor,
|
|
40
|
-
fontSize: labelSize
|
|
40
|
+
fontSize: addUnit(sizeType[size] ?? labelSize),
|
|
41
41
|
}"
|
|
42
42
|
>{{ item[fieldNames.label] }}</text
|
|
43
43
|
>
|
|
@@ -50,8 +50,10 @@
|
|
|
50
50
|
|
|
51
51
|
<script setup lang="ts">
|
|
52
52
|
import defaultProps from "./props";
|
|
53
|
-
import
|
|
54
|
-
import
|
|
53
|
+
import type { CheckboxColumnsVo } from "./typing";
|
|
54
|
+
import type IProps from "./typing";
|
|
55
|
+
import { computed, toRefs, watch, ref, reactive } from "vue";
|
|
56
|
+
import type { CSSProperties } from "vue";
|
|
55
57
|
import { addUnit, bem, error } from "../../utils";
|
|
56
58
|
import { IconConfig } from "../../config";
|
|
57
59
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
@@ -69,11 +71,16 @@ const {
|
|
|
69
71
|
inactiveColor,
|
|
70
72
|
customStyle,
|
|
71
73
|
borderBottom,
|
|
72
|
-
placement
|
|
74
|
+
placement,
|
|
73
75
|
} = toRefs(props);
|
|
74
76
|
const emit = defineEmits(["change", "update:modelValue"]);
|
|
75
77
|
|
|
76
78
|
const columns_1 = ref();
|
|
79
|
+
const sizeType: AnyObject = reactive({
|
|
80
|
+
small: 14,
|
|
81
|
+
medium: 18,
|
|
82
|
+
large: 22,
|
|
83
|
+
});
|
|
77
84
|
|
|
78
85
|
watch(
|
|
79
86
|
() => modelValue.value,
|
|
@@ -81,7 +88,7 @@ watch(
|
|
|
81
88
|
if (Array.isArray(newValue)) {
|
|
82
89
|
columns_1.value = columns.value.map((item) => {
|
|
83
90
|
item[fieldNames.value.checked] = newValue.includes(
|
|
84
|
-
item[fieldNames.value.value] as string
|
|
91
|
+
item[fieldNames.value.value] as string,
|
|
85
92
|
);
|
|
86
93
|
return item;
|
|
87
94
|
});
|
|
@@ -89,7 +96,7 @@ watch(
|
|
|
89
96
|
error("传入值不是数组,请传数组值");
|
|
90
97
|
}
|
|
91
98
|
},
|
|
92
|
-
{ immediate: true }
|
|
99
|
+
{ immediate: true },
|
|
93
100
|
);
|
|
94
101
|
|
|
95
102
|
const isDisabled = (disabledVal?: boolean): boolean =>
|
|
@@ -99,7 +106,7 @@ const checkboxStyle = computed(() => {
|
|
|
99
106
|
const style: CSSProperties = {};
|
|
100
107
|
if (borderBottom.value && placement.value === "row") {
|
|
101
108
|
error(
|
|
102
|
-
"检测到您将borderBottom设置为true,需要同时将u-checkbox-group的placement设置为column才有效"
|
|
109
|
+
"检测到您将borderBottom设置为true,需要同时将u-checkbox-group的placement设置为column才有效",
|
|
103
110
|
);
|
|
104
111
|
}
|
|
105
112
|
// 当父组件设置了显示下边框并且排列形式为纵向时,给内容和边框之间加上一定间隔
|
|
@@ -145,8 +152,8 @@ const iconWrapStyle = computed(() => {
|
|
|
145
152
|
temp[fieldNames.value.checked] && !isDisabled(temp?.disabled)
|
|
146
153
|
? activeColor.value
|
|
147
154
|
: inactiveColor.value;
|
|
148
|
-
style.width = addUnit(size.value);
|
|
149
|
-
style.height = addUnit(size.value);
|
|
155
|
+
style.width = addUnit(sizeType[size.value] ?? size.value);
|
|
156
|
+
style.height = addUnit(sizeType[size.value] ?? size.value);
|
|
150
157
|
return style;
|
|
151
158
|
};
|
|
152
159
|
});
|
|
@@ -160,6 +167,9 @@ const iconClickHandler = (e: Event, temp: CheckboxColumnsVo) => {
|
|
|
160
167
|
setRadioCheckedStatus(temp);
|
|
161
168
|
}
|
|
162
169
|
};
|
|
170
|
+
/**
|
|
171
|
+
* @description 点击整行
|
|
172
|
+
* */
|
|
163
173
|
const wrapperClickHandler = (e: Event, temp: CheckboxColumnsVo) => {
|
|
164
174
|
e.stopPropagation();
|
|
165
175
|
if (!isDisabled(temp?.disabled)) {
|
|
@@ -192,7 +202,7 @@ const setRadioCheckedStatus = (temp: CheckboxColumnsVo) => {
|
|
|
192
202
|
"update:modelValue",
|
|
193
203
|
columns_1.value
|
|
194
204
|
.filter((item: CheckboxColumnsVo) => item[fieldNames.value.checked])
|
|
195
|
-
.map((item: CheckboxColumnsVo) => item[fieldNames.value.value])
|
|
205
|
+
.map((item: CheckboxColumnsVo) => item[fieldNames.value.value]),
|
|
196
206
|
);
|
|
197
207
|
// 双向绑定
|
|
198
208
|
// if (this.usedAlone) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
import { ColorConfig } from "../../config";
|
|
3
3
|
|
|
4
4
|
const defaultProps: IProps = {
|
|
@@ -7,10 +7,10 @@ const defaultProps: IProps = {
|
|
|
7
7
|
fieldNames: {
|
|
8
8
|
label: "label",
|
|
9
9
|
value: "value",
|
|
10
|
-
checked: "checked"
|
|
10
|
+
checked: "checked",
|
|
11
11
|
},
|
|
12
12
|
shape: "square",
|
|
13
|
-
size:
|
|
13
|
+
size: "medium",
|
|
14
14
|
disabled: false,
|
|
15
15
|
activeColor: ColorConfig.primary,
|
|
16
16
|
inactiveColor: "#c8c9cc",
|
|
@@ -18,11 +18,10 @@ const defaultProps: IProps = {
|
|
|
18
18
|
iconColor: "",
|
|
19
19
|
iconPlacement: "left",
|
|
20
20
|
borderBottom: false,
|
|
21
|
-
label: "",
|
|
22
21
|
labelSize: "",
|
|
23
22
|
labelColor: "",
|
|
24
23
|
labelDisabled: "",
|
|
25
|
-
placement: "row"
|
|
24
|
+
placement: "row",
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
export default defaultProps;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from "vue";
|
|
2
|
-
import { CheckboxColumnsVo, IFieldNames } from "../hy-check-button/typing";
|
|
2
|
+
import type { CheckboxColumnsVo, IFieldNames } from "../hy-check-button/typing";
|
|
3
|
+
import { HyApp } from "@/package/typing/modules/common";
|
|
3
4
|
|
|
4
5
|
export default interface IProps {
|
|
5
6
|
/**
|
|
@@ -21,7 +22,7 @@ export default interface IProps {
|
|
|
21
22
|
/**
|
|
22
23
|
* @description 复选框大小
|
|
23
24
|
* */
|
|
24
|
-
size?: string | number;
|
|
25
|
+
size?: HyApp.SizeType | string | number;
|
|
25
26
|
/**
|
|
26
27
|
* @description 是否禁用
|
|
27
28
|
* */
|
|
@@ -42,10 +43,6 @@ export default interface IProps {
|
|
|
42
43
|
* @description 图标颜色
|
|
43
44
|
* */
|
|
44
45
|
iconColor?: string;
|
|
45
|
-
/**
|
|
46
|
-
* @description label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式
|
|
47
|
-
* */
|
|
48
|
-
label?: string;
|
|
49
46
|
/**
|
|
50
47
|
* @description label的字体大小,px单位
|
|
51
48
|
* */
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<script setup lang="ts">
|
|
56
56
|
import { computed, onMounted, ref, toRefs, watch } from "vue";
|
|
57
57
|
import defaultProps from "./props";
|
|
58
|
-
import IProps from "./typing";
|
|
58
|
+
import type IProps from "./typing";
|
|
59
59
|
import dayjs from "dayjs/esm";
|
|
60
60
|
import { error, padZero } from "../../utils";
|
|
61
61
|
import { DateModeEnum } from "../../typing";
|
|
@@ -79,14 +79,14 @@ const {
|
|
|
79
79
|
minHour,
|
|
80
80
|
maxHour,
|
|
81
81
|
minMinute,
|
|
82
|
-
maxMinute
|
|
82
|
+
maxMinute,
|
|
83
83
|
} = toRefs(props);
|
|
84
84
|
const emit = defineEmits([
|
|
85
85
|
"close",
|
|
86
86
|
"cancel",
|
|
87
87
|
"confirm",
|
|
88
88
|
"change",
|
|
89
|
-
"update:modelValue"
|
|
89
|
+
"update:modelValue",
|
|
90
90
|
]);
|
|
91
91
|
|
|
92
92
|
// 原来的日期选择器不方便,这里增加一个hasInput选项支持类似element的自带输入框的功能。
|
|
@@ -100,7 +100,7 @@ const validModes = new Set([
|
|
|
100
100
|
DateModeEnum.TIME,
|
|
101
101
|
DateModeEnum.MONTH_DAY,
|
|
102
102
|
DateModeEnum.HOUR_MINUTE,
|
|
103
|
-
DateModeEnum.MINUTE_SECOND
|
|
103
|
+
DateModeEnum.MINUTE_SECOND,
|
|
104
104
|
]);
|
|
105
105
|
|
|
106
106
|
/**
|
|
@@ -110,7 +110,7 @@ const updateColumns = () => {
|
|
|
110
110
|
const formatterFn = formatter.value || innerFormatter;
|
|
111
111
|
// 获取各列的值,并且map后,对各列的具体值进行补0操作
|
|
112
112
|
columns.value = getOriginColumns().map((column) =>
|
|
113
|
-
column.values.map((value) => formatterFn(column.type, value))
|
|
113
|
+
column.values.map((value) => formatterFn(column.type, value)),
|
|
114
114
|
);
|
|
115
115
|
};
|
|
116
116
|
|
|
@@ -122,7 +122,7 @@ const updateColumnValue = (value: string | number) => {
|
|
|
122
122
|
updateColumns();
|
|
123
123
|
// 延迟执行,等待u-picker组件列数据更新完后再设置选中值索引
|
|
124
124
|
setTimeout(() => {
|
|
125
|
-
|
|
125
|
+
updateIndexes(value);
|
|
126
126
|
}, 100);
|
|
127
127
|
};
|
|
128
128
|
|
|
@@ -142,12 +142,12 @@ watch(
|
|
|
142
142
|
if (newValue) {
|
|
143
143
|
updateColumnValue(innerValue.value);
|
|
144
144
|
}
|
|
145
|
-
}
|
|
145
|
+
},
|
|
146
146
|
);
|
|
147
147
|
|
|
148
148
|
watch(
|
|
149
149
|
() => modelValue.value,
|
|
150
|
-
() => init()
|
|
150
|
+
() => init(),
|
|
151
151
|
);
|
|
152
152
|
|
|
153
153
|
const propsChange = computed(() => {
|
|
@@ -159,13 +159,13 @@ const propsChange = computed(() => {
|
|
|
159
159
|
maxHour.value,
|
|
160
160
|
minMinute.value,
|
|
161
161
|
maxMinute.value,
|
|
162
|
-
filter.value
|
|
162
|
+
filter.value,
|
|
163
163
|
];
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
watch(
|
|
167
167
|
() => propsChange.value,
|
|
168
|
-
() => init()
|
|
168
|
+
() => init(),
|
|
169
169
|
);
|
|
170
170
|
|
|
171
171
|
onMounted(() => {
|
|
@@ -254,7 +254,7 @@ const confirm = () => {
|
|
|
254
254
|
}
|
|
255
255
|
emit("confirm", {
|
|
256
256
|
value: innerValue.value,
|
|
257
|
-
mode: mode.value
|
|
257
|
+
mode: mode.value,
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
260
|
|
|
@@ -287,12 +287,12 @@ const change = (e: any) => {
|
|
|
287
287
|
if (validModes.has(mode.value) && mode.value !== DateModeEnum.MONTH_DAY) {
|
|
288
288
|
// 根据value各列索引,从各列数组中,取出当前时间的选中值
|
|
289
289
|
selectValue = `${intercept(values[0][indexs[0]])}:${intercept(
|
|
290
|
-
values[1][indexs[1]]
|
|
290
|
+
values[1][indexs[1]],
|
|
291
291
|
)}`;
|
|
292
292
|
} else if (mode.value === DateModeEnum.MONTH_DAY) {
|
|
293
293
|
// 根据value各列索引,从各列数组中,取出当前时间的选中值
|
|
294
294
|
selectValue = `${intercept(values[0][indexs[0]])}-${intercept(
|
|
295
|
-
values[1][indexs[1]]
|
|
295
|
+
values[1][indexs[1]],
|
|
296
296
|
)}`;
|
|
297
297
|
} else {
|
|
298
298
|
// 将选择的值转为数值,比如'03'转为数值的3,'2019'转为数值的2019
|
|
@@ -325,15 +325,15 @@ const change = (e: any) => {
|
|
|
325
325
|
// 微信小程序不能传递this实例,会因为循环引用而报错
|
|
326
326
|
// picker: this.$refs.picker,
|
|
327
327
|
// #endif
|
|
328
|
-
mode: mode.value
|
|
328
|
+
mode: mode.value,
|
|
329
329
|
});
|
|
330
330
|
};
|
|
331
331
|
|
|
332
332
|
/**
|
|
333
333
|
* @description 更新索引
|
|
334
334
|
* */
|
|
335
|
-
const
|
|
336
|
-
let values = [];
|
|
335
|
+
const updateIndexes = (value: number | string) => {
|
|
336
|
+
let values: string[] = [];
|
|
337
337
|
let timeArr: string[] = [];
|
|
338
338
|
const formatterFn = formatter.value || innerFormatter;
|
|
339
339
|
|
|
@@ -343,7 +343,7 @@ const updateIndexs = (value: number | string) => {
|
|
|
343
343
|
// 使用formatter格式化方法进行管道处理
|
|
344
344
|
values = [
|
|
345
345
|
formatterFn("hour", timeArr[0]),
|
|
346
|
-
formatterFn("minute", timeArr[1])
|
|
346
|
+
formatterFn("minute", timeArr[1]),
|
|
347
347
|
];
|
|
348
348
|
break;
|
|
349
349
|
case DateModeEnum.MONTH_DAY:
|
|
@@ -351,7 +351,7 @@ const updateIndexs = (value: number | string) => {
|
|
|
351
351
|
// 使用formatter格式化方法进行管道处理
|
|
352
352
|
values = [
|
|
353
353
|
formatterFn("month", timeArr[0]),
|
|
354
|
-
formatterFn("day", timeArr[1])
|
|
354
|
+
formatterFn("day", timeArr[1]),
|
|
355
355
|
];
|
|
356
356
|
break;
|
|
357
357
|
case DateModeEnum.HOUR_MINUTE:
|
|
@@ -359,7 +359,7 @@ const updateIndexs = (value: number | string) => {
|
|
|
359
359
|
// 使用formatter格式化方法进行管道处理
|
|
360
360
|
values = [
|
|
361
361
|
formatterFn("hour", timeArr[0]),
|
|
362
|
-
formatterFn("minute", timeArr[1])
|
|
362
|
+
formatterFn("minute", timeArr[1]),
|
|
363
363
|
];
|
|
364
364
|
break;
|
|
365
365
|
case DateModeEnum.MINUTE_SECOND:
|
|
@@ -367,14 +367,14 @@ const updateIndexs = (value: number | string) => {
|
|
|
367
367
|
// 使用formatter格式化方法进行管道处理
|
|
368
368
|
values = [
|
|
369
369
|
formatterFn("minute", timeArr[0]),
|
|
370
|
-
formatterFn("second", timeArr[1])
|
|
370
|
+
formatterFn("second", timeArr[1]),
|
|
371
371
|
];
|
|
372
372
|
break;
|
|
373
373
|
default:
|
|
374
374
|
values = [
|
|
375
375
|
formatterFn("year", `${dayjs(value).year()}`),
|
|
376
376
|
// 月份补0
|
|
377
|
-
formatterFn("month", padZero(dayjs(value).month() + 1))
|
|
377
|
+
formatterFn("month", padZero(dayjs(value).month() + 1)),
|
|
378
378
|
];
|
|
379
379
|
if (mode.value === DateModeEnum.DATE) {
|
|
380
380
|
// date模式,需要添加天列
|
|
@@ -386,7 +386,7 @@ const updateIndexs = (value: number | string) => {
|
|
|
386
386
|
formatterFn("day", padZero(dayjs(value).date())),
|
|
387
387
|
formatterFn("hour", padZero(dayjs(value).hour())),
|
|
388
388
|
formatterFn("minute", padZero(dayjs(value).minute())),
|
|
389
|
-
formatterFn("second", padZero(dayjs(value).second()))
|
|
389
|
+
formatterFn("second", padZero(dayjs(value).second())),
|
|
390
390
|
);
|
|
391
391
|
}
|
|
392
392
|
break;
|
|
@@ -396,7 +396,7 @@ const updateIndexs = (value: number | string) => {
|
|
|
396
396
|
// 通过取大值,可以保证不会出现找不到索引的"-1"情况
|
|
397
397
|
return Math.max(
|
|
398
398
|
0,
|
|
399
|
-
column.findIndex((item: string) => item === values[index])
|
|
399
|
+
column.findIndex((item: string) => item === values[index]),
|
|
400
400
|
);
|
|
401
401
|
});
|
|
402
402
|
};
|
|
@@ -456,47 +456,47 @@ const getRanges = () => {
|
|
|
456
456
|
return [
|
|
457
457
|
{
|
|
458
458
|
type: "hour",
|
|
459
|
-
range: [props.minHour, props.maxHour]
|
|
459
|
+
range: [props.minHour, props.maxHour],
|
|
460
460
|
},
|
|
461
461
|
{
|
|
462
462
|
type: "minute",
|
|
463
|
-
range: [props.minMinute, props.maxMinute]
|
|
464
|
-
}
|
|
463
|
+
range: [props.minMinute, props.maxMinute],
|
|
464
|
+
},
|
|
465
465
|
];
|
|
466
466
|
}
|
|
467
467
|
const { maxYear, maxDate, maxMonth, maxHour, maxMinute } = getBoundary(
|
|
468
468
|
"max",
|
|
469
|
-
innerValue.value
|
|
469
|
+
innerValue.value,
|
|
470
470
|
);
|
|
471
471
|
const { minYear, minDate, minMonth, minHour, minMinute } = getBoundary(
|
|
472
472
|
"min",
|
|
473
|
-
innerValue.value
|
|
473
|
+
innerValue.value,
|
|
474
474
|
);
|
|
475
475
|
const result = [
|
|
476
476
|
{
|
|
477
477
|
type: "year",
|
|
478
|
-
range: [minYear, maxYear]
|
|
478
|
+
range: [minYear, maxYear],
|
|
479
479
|
},
|
|
480
480
|
{
|
|
481
481
|
type: "month",
|
|
482
|
-
range: [minMonth, maxMonth]
|
|
482
|
+
range: [minMonth, maxMonth],
|
|
483
483
|
},
|
|
484
484
|
{
|
|
485
485
|
type: "day",
|
|
486
|
-
range: [minDate, maxDate]
|
|
486
|
+
range: [minDate, maxDate],
|
|
487
487
|
},
|
|
488
488
|
{
|
|
489
489
|
type: "hour",
|
|
490
|
-
range: [minHour, maxHour]
|
|
490
|
+
range: [minHour, maxHour],
|
|
491
491
|
},
|
|
492
492
|
{
|
|
493
493
|
type: "minute",
|
|
494
|
-
range: [minMinute, maxMinute]
|
|
494
|
+
range: [minMinute, maxMinute],
|
|
495
495
|
},
|
|
496
496
|
{
|
|
497
497
|
type: "second",
|
|
498
|
-
range: [minMinute, maxMinute]
|
|
499
|
-
}
|
|
498
|
+
range: [minMinute, maxMinute],
|
|
499
|
+
},
|
|
500
500
|
];
|
|
501
501
|
let arr = result;
|
|
502
502
|
// 截取对应的列数
|
|
@@ -543,7 +543,7 @@ const getBoundary = (type: string, innerVal: string | number) => {
|
|
|
543
543
|
[`${type}Month`]: month,
|
|
544
544
|
[`${type}Date`]: date,
|
|
545
545
|
[`${type}Hour`]: hour,
|
|
546
|
-
[`${type}Minute`]: minute
|
|
546
|
+
[`${type}Minute`]: minute,
|
|
547
547
|
};
|
|
548
548
|
};
|
|
549
549
|
const onShowByClickInput = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
import { DateModeEnum } from "../../typing";
|
|
3
3
|
|
|
4
4
|
const defaultProps: IProps = {
|
|
@@ -30,7 +30,7 @@ const defaultProps: IProps = {
|
|
|
30
30
|
format: "",
|
|
31
31
|
placeholder: "请选择日期",
|
|
32
32
|
disabledColor: "#F5F5F5",
|
|
33
|
-
toolbarRightSlot: false
|
|
33
|
+
toolbarRightSlot: false,
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export default defaultProps;
|
|
@@ -157,11 +157,11 @@
|
|
|
157
157
|
</template>
|
|
158
158
|
|
|
159
159
|
<script setup lang="ts">
|
|
160
|
-
import { computed, CSSProperties, reactive, toRefs } from "vue";
|
|
161
|
-
import IProps from "./typing";
|
|
160
|
+
import { computed, type CSSProperties, reactive, toRefs } from "vue";
|
|
161
|
+
import type IProps from "./typing";
|
|
162
162
|
import defaultProps from "./props";
|
|
163
163
|
import { addUnit, error } from "../../utils";
|
|
164
|
-
import { FormColumnsType, RulesVo, FormTypeEnum } from "../../typing";
|
|
164
|
+
import type { FormColumnsType, RulesVo, FormTypeEnum } from "../../typing";
|
|
165
165
|
|
|
166
166
|
// 组件
|
|
167
167
|
import HyInput from "../hy-input/hy-input.vue";
|
|
@@ -213,7 +213,7 @@ const errors: AnyObject = reactive({});
|
|
|
213
213
|
const labelStyle = computed(() => {
|
|
214
214
|
return {
|
|
215
215
|
textAlign: labelAlign.value,
|
|
216
|
-
width: addUnit(labelWidth.value)
|
|
216
|
+
width: addUnit(labelWidth.value),
|
|
217
217
|
};
|
|
218
218
|
});
|
|
219
219
|
|
|
@@ -260,7 +260,7 @@ const validateField = (
|
|
|
260
260
|
rules: RulesVo | RulesVo[] | undefined,
|
|
261
261
|
value: string,
|
|
262
262
|
field: string,
|
|
263
|
-
event?: "blur" | "change"
|
|
263
|
+
event?: "blur" | "change",
|
|
264
264
|
) => {
|
|
265
265
|
if (!rules) return;
|
|
266
266
|
|
|
@@ -335,7 +335,7 @@ const handleBlur = (event: string, temp: FormColumnsType) => {
|
|
|
335
335
|
|
|
336
336
|
defineExpose({
|
|
337
337
|
validateField,
|
|
338
|
-
handleSubmit
|
|
338
|
+
handleSubmit,
|
|
339
339
|
});
|
|
340
340
|
</script>
|
|
341
341
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
4
|
labelPosition: "left",
|
|
@@ -9,7 +9,7 @@ const defaultProps: IProps = {
|
|
|
9
9
|
shape: "square",
|
|
10
10
|
border: "surround",
|
|
11
11
|
columns: [],
|
|
12
|
-
formData: {}
|
|
12
|
+
formData: {},
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export default defaultProps;
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script setup lang="ts">
|
|
28
|
-
import { computed, CSSProperties, toRefs } from "vue";
|
|
28
|
+
import { computed, type CSSProperties, toRefs } from "vue";
|
|
29
29
|
import defaultProps from "./props";
|
|
30
|
-
import IProps from "./typing";
|
|
30
|
+
import type IProps from "./typing";
|
|
31
31
|
import { addUnit } from "../../utils";
|
|
32
32
|
|
|
33
33
|
// 组件
|
|
@@ -63,7 +63,7 @@ const itemStyle = computed<CSSProperties>(() => {
|
|
|
63
63
|
background: bgColor.value,
|
|
64
64
|
height: addUnit(itemHeight.value),
|
|
65
65
|
width: "100%",
|
|
66
|
-
border: border.value ? "0.5px solid #c8c7cc66" : ""
|
|
66
|
+
border: border.value ? "0.5px solid #c8c7cc66" : "",
|
|
67
67
|
};
|
|
68
68
|
return style;
|
|
69
69
|
});
|
|
@@ -102,6 +102,7 @@ const childClick = (name: string | Record<string, any>) => {
|
|
|
102
102
|
justify-content: center;
|
|
103
103
|
position: relative;
|
|
104
104
|
flex-direction: column;
|
|
105
|
+
overflow: hidden;
|
|
105
106
|
/* #ifndef APP-NVUE */
|
|
106
107
|
box-sizing: border-box;
|
|
107
108
|
display: flex;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
4
|
list: [],
|
|
5
|
-
col:
|
|
5
|
+
col: 5,
|
|
6
6
|
border: false,
|
|
7
|
-
itemHeight: "
|
|
7
|
+
itemHeight: "80px",
|
|
8
8
|
align: "left",
|
|
9
9
|
gap: "0px",
|
|
10
10
|
bgColor: "transparent",
|
|
11
|
-
iconSize: "
|
|
11
|
+
iconSize: "30px",
|
|
12
12
|
round: "6px",
|
|
13
|
-
space: "12px"
|
|
13
|
+
space: "12px",
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export default defaultProps;
|
|
@@ -50,11 +50,11 @@ export default interface IProps {
|
|
|
50
50
|
/**
|
|
51
51
|
* @description icon图片圆角
|
|
52
52
|
* */
|
|
53
|
-
round
|
|
53
|
+
round?: number | string;
|
|
54
54
|
/**
|
|
55
55
|
* @description icon图片和文字间距
|
|
56
56
|
* */
|
|
57
|
-
space
|
|
57
|
+
space?: number | string;
|
|
58
58
|
/**
|
|
59
59
|
* @description 定义需要用到的外部样式
|
|
60
60
|
* */
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
color: labelColor,
|
|
22
22
|
fontSize: addUnit(labelSize),
|
|
23
23
|
marginLeft: labelPos == 'right' ? addUnit(space) : 0,
|
|
24
|
-
marginTop: labelPos == 'bottom' ? addUnit(space) : 0
|
|
24
|
+
marginTop: labelPos == 'bottom' ? addUnit(space) : 0,
|
|
25
25
|
}"
|
|
26
26
|
>{{ label }}</text
|
|
27
27
|
>
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script setup lang="ts">
|
|
32
|
-
import { computed, CSSProperties, toRefs } from "vue";
|
|
32
|
+
import { computed, type CSSProperties, toRefs } from "vue";
|
|
33
33
|
import { ColorConfig, IconConfig } from "../../config";
|
|
34
34
|
import { addUnit } from "../../utils";
|
|
35
35
|
import defaultProps from "./props";
|
|
36
|
-
import IProps from "./typing";
|
|
36
|
+
import type IProps from "./typing";
|
|
37
37
|
|
|
38
38
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
39
39
|
const {
|
|
@@ -48,7 +48,7 @@ const {
|
|
|
48
48
|
stop,
|
|
49
49
|
index,
|
|
50
50
|
isRotate,
|
|
51
|
-
round
|
|
51
|
+
round,
|
|
52
52
|
} = toRefs(props);
|
|
53
53
|
const emit = defineEmits(["click"]);
|
|
54
54
|
|
|
@@ -80,8 +80,8 @@ const iconStyle = computed<CSSProperties>(() => {
|
|
|
80
80
|
color: color.value
|
|
81
81
|
? color.value
|
|
82
82
|
: name.value === IconConfig.LOADING
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
? ColorConfig.primary
|
|
84
|
+
: "#606266",
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
return style;
|
|
@@ -187,6 +187,8 @@ const clickHandler = (e: any) => {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
&__label {
|
|
190
|
+
@include line-feed();
|
|
191
|
+
overflow: hidden;
|
|
190
192
|
/* #ifndef APP-NVUE */
|
|
191
193
|
line-height: 1;
|
|
192
194
|
/* #endif */
|