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
|
@@ -50,15 +50,13 @@
|
|
|
50
50
|
<slot name="toolbar-bottom"> </slot>
|
|
51
51
|
</template>
|
|
52
52
|
</HyPicker>
|
|
53
|
-
|
|
54
|
-
<HyList container-height="" list=""></HyList>
|
|
55
53
|
</view>
|
|
56
54
|
</template>
|
|
57
55
|
|
|
58
56
|
<script setup lang="ts">
|
|
59
57
|
import { onMounted, ref, toRefs } from "vue";
|
|
60
58
|
import defaultProps from "./props";
|
|
61
|
-
import IProps from "./typing";
|
|
59
|
+
import type IProps from "./typing";
|
|
62
60
|
import address from "../../utils/address.json";
|
|
63
61
|
|
|
64
62
|
// 组件
|
|
@@ -73,7 +71,7 @@ const emit = defineEmits([
|
|
|
73
71
|
"cancel",
|
|
74
72
|
"confirm",
|
|
75
73
|
"change",
|
|
76
|
-
"update:modelValue"
|
|
74
|
+
"update:modelValue",
|
|
77
75
|
]);
|
|
78
76
|
|
|
79
77
|
// 原来的日期选择器不方便,这里增加一个hasInput选项支持类似element的自带输入框的功能。
|
|
@@ -111,16 +109,16 @@ const updateColumnValue = (value: string) => {
|
|
|
111
109
|
const addressArr = value.split(separator.value);
|
|
112
110
|
// 查出省索引
|
|
113
111
|
provinceIndex = address.findIndex((item) =>
|
|
114
|
-
areCitiesEqual(item.name, addressArr[0])
|
|
112
|
+
areCitiesEqual(item.name, addressArr[0]),
|
|
115
113
|
);
|
|
116
114
|
// 查出市索引
|
|
117
115
|
cityIndex = address[provinceIndex].areas.findIndex((item) =>
|
|
118
|
-
areCitiesEqual(item.name, addressArr[1])
|
|
116
|
+
areCitiesEqual(item.name, addressArr[1]),
|
|
119
117
|
);
|
|
120
118
|
|
|
121
119
|
// 查出县/区索引
|
|
122
120
|
countyIndex = address[provinceIndex].areas[cityIndex].areas.findIndex(
|
|
123
|
-
(item) => areCitiesEqual(item.name, addressArr[2])
|
|
121
|
+
(item) => areCitiesEqual(item.name, addressArr[2]),
|
|
124
122
|
);
|
|
125
123
|
} else {
|
|
126
124
|
provinceIndex = 0;
|
|
@@ -130,12 +128,12 @@ const updateColumnValue = (value: string) => {
|
|
|
130
128
|
// 省级数组
|
|
131
129
|
const provinceData = address.map((item) => ({
|
|
132
130
|
name: item.name,
|
|
133
|
-
code: item.code
|
|
131
|
+
code: item.code,
|
|
134
132
|
}));
|
|
135
133
|
// 市级数组
|
|
136
134
|
const cityData = address[provinceIndex].areas.map((item) => ({
|
|
137
135
|
name: item.name,
|
|
138
|
-
code: item.code
|
|
136
|
+
code: item.code,
|
|
139
137
|
}));
|
|
140
138
|
// 县/区级数组
|
|
141
139
|
const areaData = address[provinceIndex].areas[cityIndex].areas;
|
|
@@ -188,7 +186,7 @@ const confirm = ({ value }: { value: Record<string, any>[] }) => {
|
|
|
188
186
|
showByClickInput.value = false;
|
|
189
187
|
emit("update:modelValue", inputValue.value);
|
|
190
188
|
emit("confirm", {
|
|
191
|
-
value: inputValue.value
|
|
189
|
+
value: inputValue.value,
|
|
192
190
|
});
|
|
193
191
|
};
|
|
194
192
|
|
|
@@ -205,7 +203,7 @@ const change = (e: any) => {
|
|
|
205
203
|
uPickerRef.value?.setColumnValues(1, children1);
|
|
206
204
|
//更换 第二列数据
|
|
207
205
|
const children2 = address[index].areas[indexs[1]].areas.map((item) => ({
|
|
208
|
-
...item
|
|
206
|
+
...item,
|
|
209
207
|
}));
|
|
210
208
|
uPickerRef.value?.setColumnValues(2, children2);
|
|
211
209
|
//更换 第三列数据
|
|
@@ -213,14 +211,14 @@ const change = (e: any) => {
|
|
|
213
211
|
if (columnIndex === 1) {
|
|
214
212
|
//如果改变的是第二列
|
|
215
213
|
const children3 = address[indexs[0]].areas[indexs[1]].areas.map((item) => ({
|
|
216
|
-
...item
|
|
214
|
+
...item,
|
|
217
215
|
}));
|
|
218
216
|
uPickerRef.value?.setColumnValues(2, children3);
|
|
219
217
|
}
|
|
220
218
|
|
|
221
219
|
// 发出change时间,value为当前选中的时间戳
|
|
222
220
|
emit("change", {
|
|
223
|
-
...e
|
|
221
|
+
...e,
|
|
224
222
|
});
|
|
225
223
|
};
|
|
226
224
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
2
|
-
import { DateModeEnum } from "../../typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
3
2
|
|
|
4
3
|
const defaultProps: IProps = {
|
|
5
4
|
show: false,
|
|
@@ -21,7 +20,7 @@ const defaultProps: IProps = {
|
|
|
21
20
|
hasInput: false,
|
|
22
21
|
placeholder: "请选择地址",
|
|
23
22
|
disabledColor: "#F5F5F5",
|
|
24
|
-
toolbarRightSlot: false
|
|
23
|
+
toolbarRightSlot: false,
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
export default defaultProps;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
:style="[
|
|
14
14
|
{
|
|
15
15
|
width: addUnit(size),
|
|
16
|
-
height: addUnit(size)
|
|
17
|
-
}
|
|
16
|
+
height: addUnit(size),
|
|
17
|
+
},
|
|
18
18
|
]"
|
|
19
19
|
/>
|
|
20
20
|
<!-- #endif -->
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
justifyContent: 'center',
|
|
34
34
|
textAlign: 'center',
|
|
35
35
|
color: color,
|
|
36
|
-
fontSize: fontSize
|
|
36
|
+
fontSize: fontSize,
|
|
37
37
|
}"
|
|
38
38
|
>{{ text }}</text
|
|
39
39
|
>
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<script setup lang="ts">
|
|
53
|
-
import { computed, CSSProperties, toRefs, ref, watch } from "vue";
|
|
53
|
+
import { computed, type CSSProperties, toRefs, ref, watch } from "vue";
|
|
54
54
|
import defaultProps from "./props";
|
|
55
|
-
import IProps from "./typing";
|
|
55
|
+
import type IProps from "./typing";
|
|
56
56
|
import { addUnit, random } from "../../utils";
|
|
57
57
|
|
|
58
58
|
// 组件
|
|
@@ -70,7 +70,7 @@ const {
|
|
|
70
70
|
size,
|
|
71
71
|
shape,
|
|
72
72
|
name,
|
|
73
|
-
customStyle
|
|
73
|
+
customStyle,
|
|
74
74
|
} = toRefs(props);
|
|
75
75
|
const emit = defineEmits(["click"]);
|
|
76
76
|
|
|
@@ -97,7 +97,7 @@ const colors = ref<string[]>([
|
|
|
97
97
|
"#86cefa",
|
|
98
98
|
"#98d1ee",
|
|
99
99
|
"#73d1f1",
|
|
100
|
-
"#80a7dc"
|
|
100
|
+
"#80a7dc",
|
|
101
101
|
]);
|
|
102
102
|
const avatarUrl = ref(src.value);
|
|
103
103
|
const allowMp = ref<boolean>(false);
|
|
@@ -111,7 +111,7 @@ watch(
|
|
|
111
111
|
errorHandler();
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
{ immediate: true }
|
|
114
|
+
{ immediate: true },
|
|
115
115
|
);
|
|
116
116
|
|
|
117
117
|
const avatarStyle = computed<CSSProperties>(() => {
|
|
@@ -121,7 +121,7 @@ const avatarStyle = computed<CSSProperties>(() => {
|
|
|
121
121
|
? randomBgColor.value
|
|
122
122
|
? colors.value[colorIndex.value ? colorIndex.value : random(0, 19)]
|
|
123
123
|
: bgColor.value
|
|
124
|
-
: "transparent"
|
|
124
|
+
: "transparent",
|
|
125
125
|
};
|
|
126
126
|
if (typeof size.value === "number") {
|
|
127
127
|
style.width = addUnit(size.value);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
4
|
src: "",
|
|
@@ -14,7 +14,7 @@ const defaultProps: IProps = {
|
|
|
14
14
|
randomBgColor: false,
|
|
15
15
|
defaultUrl: "",
|
|
16
16
|
colorIndex: 0,
|
|
17
|
-
name: ""
|
|
17
|
+
name: "",
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export default defaultProps;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
isDot ? 'hy-badge--dot' : 'hy-badge--not-dot',
|
|
7
7
|
inverted && 'hy-badge--inverted',
|
|
8
8
|
shape === 'horn' && 'hy-badge--horn',
|
|
9
|
-
`hy-badge--${type}${inverted ? '--inverted' : ''}
|
|
9
|
+
`hy-badge--${type}${inverted ? '--inverted' : ''}`,
|
|
10
10
|
]"
|
|
11
11
|
:style="[customStyle, badgeStyle]"
|
|
12
12
|
>{{ isDot ? "" : showValue }}</text
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
|
-
import IProps from "./typing";
|
|
17
|
+
import type IProps from "./typing";
|
|
18
18
|
import defaultProps from "./props";
|
|
19
|
-
import { computed, CSSProperties, toRefs } from "vue";
|
|
19
|
+
import { computed, type CSSProperties, toRefs } from "vue";
|
|
20
20
|
import { addUnit } from "../../utils";
|
|
21
21
|
|
|
22
22
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
@@ -29,7 +29,7 @@ const {
|
|
|
29
29
|
offset,
|
|
30
30
|
inverted,
|
|
31
31
|
max,
|
|
32
|
-
customStyle
|
|
32
|
+
customStyle,
|
|
33
33
|
} = toRefs(props);
|
|
34
34
|
const emit = defineEmits(["click"]);
|
|
35
35
|
|
|
@@ -94,6 +94,7 @@ $hy-badge-text-font-size: 11px !default;
|
|
|
94
94
|
text-align: center;
|
|
95
95
|
font-size: $hy-badge-text-font-size;
|
|
96
96
|
color: $hy-text-color-inverse;
|
|
97
|
+
z-index: 999;
|
|
97
98
|
|
|
98
99
|
&--dot {
|
|
99
100
|
height: $hy-badge-dot-size;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
4
|
isDot: false,
|
|
@@ -13,7 +13,7 @@ const defaultProps: IProps = {
|
|
|
13
13
|
numberType: "overflow",
|
|
14
14
|
offset: null,
|
|
15
15
|
inverted: false,
|
|
16
|
-
absolute: false
|
|
16
|
+
absolute: false,
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export default defaultProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from "vue";
|
|
1
|
+
import type { CSSProperties } from "vue";
|
|
2
2
|
|
|
3
3
|
export default interface IProps {
|
|
4
4
|
/**
|
|
@@ -18,7 +18,7 @@ export default interface IProps {
|
|
|
18
18
|
* */
|
|
19
19
|
max?: number;
|
|
20
20
|
/**
|
|
21
|
-
* @description 主题类型,error|warning|success|primary (默认 'error' )
|
|
21
|
+
* @description 主题类型,error|warning|success|primary|info (默认 'error' )
|
|
22
22
|
* */
|
|
23
23
|
type?: HyApp.ThemeType;
|
|
24
24
|
/**
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
!disabled && !loading && !color && (plain || type === 'info')
|
|
69
69
|
? 'hy-button--active--plain'
|
|
70
70
|
: !disabled && !loading && !plain
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
? 'hy-button--active'
|
|
72
|
+
: ''
|
|
73
73
|
"
|
|
74
74
|
@tap="clickHandler"
|
|
75
75
|
:class="bemClass"
|
|
@@ -99,9 +99,9 @@
|
|
|
99
99
|
class="hy-button__text"
|
|
100
100
|
:style="[
|
|
101
101
|
{
|
|
102
|
-
marginLeft: icon ? '2px' : 0
|
|
102
|
+
marginLeft: icon ? '2px' : 0,
|
|
103
103
|
},
|
|
104
|
-
nvueTextStyle
|
|
104
|
+
nvueTextStyle,
|
|
105
105
|
]"
|
|
106
106
|
:class="[plain && `hy-button__text--plain--${type}`]"
|
|
107
107
|
>{{ text }}</text
|
|
@@ -112,12 +112,12 @@
|
|
|
112
112
|
</template>
|
|
113
113
|
|
|
114
114
|
<script setup lang="ts">
|
|
115
|
-
import { computed, CSSProperties, toRefs } from "vue";
|
|
115
|
+
import { computed, type CSSProperties, toRefs } from "vue";
|
|
116
116
|
import { bem, throttle } from "../../utils";
|
|
117
117
|
import defaultProps from "./props";
|
|
118
118
|
import { ColorConfig, IconConfig } from "../../config";
|
|
119
119
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
120
|
-
import IProps from "./typing";
|
|
120
|
+
import type IProps from "./typing";
|
|
121
121
|
|
|
122
122
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
123
123
|
const {
|
|
@@ -129,7 +129,7 @@ const {
|
|
|
129
129
|
type,
|
|
130
130
|
plain,
|
|
131
131
|
color,
|
|
132
|
-
iconColor
|
|
132
|
+
iconColor,
|
|
133
133
|
} = toRefs(props);
|
|
134
134
|
const emit = defineEmits([
|
|
135
135
|
"click",
|
|
@@ -138,7 +138,7 @@ const emit = defineEmits([
|
|
|
138
138
|
"error",
|
|
139
139
|
"opensetting",
|
|
140
140
|
"launchapp",
|
|
141
|
-
"agreeprivacyauthorization"
|
|
141
|
+
"agreeprivacyauthorization",
|
|
142
142
|
]);
|
|
143
143
|
|
|
144
144
|
const textColor = (ColorConfig as any)[type.value];
|
|
@@ -153,7 +153,7 @@ const bemClass = computed(() => {
|
|
|
153
153
|
"button",
|
|
154
154
|
props,
|
|
155
155
|
["type", "shape", "size"],
|
|
156
|
-
["disabled", "plain", "hairline"]
|
|
156
|
+
["disabled", "plain", "hairline"],
|
|
157
157
|
);
|
|
158
158
|
} else {
|
|
159
159
|
// 由于nvue的原因,在有color参数时,不需要传入type,否则会生成type相关的类型,影响最终的样式
|
|
@@ -161,7 +161,7 @@ const bemClass = computed(() => {
|
|
|
161
161
|
"button",
|
|
162
162
|
props,
|
|
163
163
|
["shape", "size"],
|
|
164
|
-
["disabled", "plain", "hairline"]
|
|
164
|
+
["disabled", "plain", "hairline"],
|
|
165
165
|
);
|
|
166
166
|
}
|
|
167
167
|
});
|
|
@@ -306,7 +306,7 @@ const agreeprivacyauthorization = (e: any) => {
|
|
|
306
306
|
padding: 0 15px;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
&--
|
|
309
|
+
&--medium {
|
|
310
310
|
padding: 0 12px;
|
|
311
311
|
font-size: 14px;
|
|
312
312
|
}
|
|
@@ -315,7 +315,7 @@ const agreeprivacyauthorization = (e: any) => {
|
|
|
315
315
|
/* #ifndef APP-NVUE */
|
|
316
316
|
min-width: 60px;
|
|
317
317
|
/* #endif */
|
|
318
|
-
height:
|
|
318
|
+
height: 30px;
|
|
319
319
|
padding: 0 8px;
|
|
320
320
|
font-size: 12px;
|
|
321
321
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
2
|
-
import type { CSSProperties } from "vue";
|
|
1
|
+
import type IProps from "./typing";
|
|
3
2
|
|
|
4
3
|
const defaultProps: IProps = {
|
|
5
4
|
hairline: false,
|
|
6
|
-
type: "
|
|
7
|
-
size: "
|
|
5
|
+
type: "primary",
|
|
6
|
+
size: "medium",
|
|
8
7
|
shape: "square",
|
|
9
8
|
plain: false,
|
|
10
9
|
disabled: false,
|
|
@@ -30,7 +29,7 @@ const defaultProps: IProps = {
|
|
|
30
29
|
icon: "",
|
|
31
30
|
iconColor: "",
|
|
32
31
|
color: "",
|
|
33
|
-
stop: true
|
|
32
|
+
stop: true,
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
export default defaultProps;
|
|
@@ -6,13 +6,13 @@ export default interface IProps {
|
|
|
6
6
|
* */
|
|
7
7
|
hairline?: boolean;
|
|
8
8
|
/**
|
|
9
|
-
* @description 按钮的预置样式,info,primary,error,warning,success (默认 '
|
|
9
|
+
* @description 按钮的预置样式,info,primary,error,warning,success (默认 'primary' )
|
|
10
10
|
* */
|
|
11
11
|
type?: HyApp.ThemeType;
|
|
12
12
|
/**
|
|
13
|
-
* @description 按钮尺寸,large,
|
|
13
|
+
* @description 按钮尺寸,large,medium,mini (默认 medium)
|
|
14
14
|
* */
|
|
15
|
-
size?:
|
|
15
|
+
size?: HyApp.SizeType | "mini";
|
|
16
16
|
/**
|
|
17
17
|
* @description 按钮形状,circle(两边为半圆),square(带圆角) (默认 'square' )
|
|
18
18
|
* */
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<slot>
|
|
21
21
|
<template v-for="(item, i) in list" :key="i">
|
|
22
22
|
<view
|
|
23
|
-
class="
|
|
23
|
+
:class="ItemClass"
|
|
24
24
|
:hover-class="containerClass(item)"
|
|
25
25
|
:hover-stay-time="250"
|
|
26
26
|
:style="{ borderBottom: border ? '1rpx solid #c8c7cc66' : '' }"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<view class="hy-cell__body--container__content-icon">
|
|
31
31
|
<slot name="icon" :icon="item?.icon">
|
|
32
32
|
<HyIcon
|
|
33
|
-
size="
|
|
33
|
+
:size="iconSize"
|
|
34
34
|
:name="item?.icon"
|
|
35
35
|
:color="disabled || item?.disabled ? '#c0c0c0' : ''"
|
|
36
36
|
></HyIcon>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
<text
|
|
43
43
|
class="hy-cell__body--container__content-title--text"
|
|
44
44
|
:class="[
|
|
45
|
-
(disabled || item?.disabled) && 'hy-cell--disabled'
|
|
45
|
+
(disabled || item?.disabled) && 'hy-cell--disabled',
|
|
46
46
|
]"
|
|
47
47
|
>{{ item?.title }}</text
|
|
48
48
|
>
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
arrange === 'left'
|
|
64
64
|
? 'flex-start'
|
|
65
65
|
: arrange === 'right'
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
? 'flex-end'
|
|
67
|
+
: 'center',
|
|
68
68
|
}"
|
|
69
69
|
>
|
|
70
70
|
<slot name="value" :record="item">
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
:class="[
|
|
82
82
|
`hy-cell__body--container__right-icon--${
|
|
83
83
|
item?.arrowDirection || arrowDirection
|
|
84
|
-
}
|
|
84
|
+
}`,
|
|
85
85
|
]"
|
|
86
86
|
>
|
|
87
87
|
<slot name="right-icon" :icon="item?.rightIcon || rightIcon">
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
:name="item?.rightIcon || rightIcon"
|
|
90
90
|
:custom-style="rightIconStyle"
|
|
91
91
|
:color="disabled || item?.disabled ? '#c0c0c0' : 'info'"
|
|
92
|
-
:size="
|
|
92
|
+
:size="iconSize"
|
|
93
93
|
></HyIcon>
|
|
94
94
|
</slot>
|
|
95
95
|
</view>
|
|
@@ -104,13 +104,14 @@
|
|
|
104
104
|
|
|
105
105
|
<script setup lang="ts">
|
|
106
106
|
import defaultProps from "./props";
|
|
107
|
-
import IProps
|
|
107
|
+
import type IProps from "./typing";
|
|
108
|
+
import type { CellContentVo } from "./typing";
|
|
108
109
|
|
|
109
110
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
110
111
|
import { computed, toRefs } from "vue";
|
|
111
112
|
|
|
112
113
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
113
|
-
const { disabled, clickable } = toRefs(props);
|
|
114
|
+
const { size, disabled, clickable } = toRefs(props);
|
|
114
115
|
const emit = defineEmits(["click"]);
|
|
115
116
|
|
|
116
117
|
/**
|
|
@@ -122,12 +123,29 @@ const containerClass = computed(() => {
|
|
|
122
123
|
!disabled.value &&
|
|
123
124
|
!temp?.disabled &&
|
|
124
125
|
clickable.value &&
|
|
125
|
-
"hy-cell__body--container__clickable"
|
|
126
|
+
"hy-cell__body--container__clickable",
|
|
126
127
|
]
|
|
127
128
|
.filter(Boolean)
|
|
128
129
|
.join();
|
|
129
130
|
};
|
|
130
131
|
});
|
|
132
|
+
const ItemClass = computed(() => {
|
|
133
|
+
return [
|
|
134
|
+
"hy-cell__body--container",
|
|
135
|
+
`hy-cell__body--container__${size.value}`,
|
|
136
|
+
];
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const iconSize = computed(() => {
|
|
140
|
+
switch (size.value) {
|
|
141
|
+
case "large":
|
|
142
|
+
return 25;
|
|
143
|
+
case "medium":
|
|
144
|
+
return 20;
|
|
145
|
+
case "small":
|
|
146
|
+
return 15;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
131
149
|
|
|
132
150
|
/**
|
|
133
151
|
* @description 点击cell
|
|
@@ -137,7 +155,7 @@ const clickHandler = (e: Event, temp: CellContentVo, index: number) => {
|
|
|
137
155
|
emit("click", temp, index);
|
|
138
156
|
if (temp?.url) {
|
|
139
157
|
uni.navigateTo({
|
|
140
|
-
url: temp.url
|
|
158
|
+
url: temp.url,
|
|
141
159
|
});
|
|
142
160
|
}
|
|
143
161
|
e.stopPropagation();
|
|
@@ -189,7 +207,27 @@ const clickHandler = (e: Event, temp: CellContentVo, index: number) => {
|
|
|
189
207
|
align-items: center;
|
|
190
208
|
justify-content: space-between;
|
|
191
209
|
flex: 1;
|
|
192
|
-
|
|
210
|
+
|
|
211
|
+
/* 大 */
|
|
212
|
+
&__large {
|
|
213
|
+
font-size: $hy-font-size-lg;
|
|
214
|
+
padding: 35rpx;
|
|
215
|
+
line-height: 25px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* 默认 */
|
|
219
|
+
&__medium {
|
|
220
|
+
font-size: $hy-font-size-base;
|
|
221
|
+
padding: 30rpx;
|
|
222
|
+
line-height: 20px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* 小 */
|
|
226
|
+
&__small {
|
|
227
|
+
font-size: $hy-font-size-sm;
|
|
228
|
+
padding: 25rpx;
|
|
229
|
+
line-height: 15px;
|
|
230
|
+
}
|
|
193
231
|
|
|
194
232
|
/*点击状态*/
|
|
195
233
|
&__clickable {
|
|
@@ -202,29 +240,24 @@ const clickHandler = (e: Event, temp: CellContentVo, index: number) => {
|
|
|
202
240
|
&-icon {
|
|
203
241
|
@include flex();
|
|
204
242
|
align-items: center;
|
|
205
|
-
font-size: 16px;
|
|
206
243
|
margin-right: 10px;
|
|
207
244
|
}
|
|
208
245
|
/*行头部*/
|
|
209
246
|
&-title {
|
|
247
|
+
margin-right: $hy-border-margin-padding-sm;
|
|
210
248
|
flex: $hy-font-size-subtitle;
|
|
211
|
-
line-height: 25px;
|
|
212
249
|
display: flex;
|
|
213
250
|
flex-direction: column;
|
|
214
251
|
|
|
215
252
|
/*标题*/
|
|
216
253
|
&--text {
|
|
217
|
-
font-size: $hy-font-size-lg;
|
|
218
|
-
line-height: 22px;
|
|
219
254
|
color: $hy-color-title;
|
|
220
255
|
}
|
|
221
256
|
|
|
222
257
|
/*sub值*/
|
|
223
258
|
&--sub {
|
|
224
259
|
margin-top: $hy-border-margin-padding-sm;
|
|
225
|
-
font-size: $hy-font-size-base;
|
|
226
260
|
color: $hy-text-color-grey;
|
|
227
|
-
line-height: 18px;
|
|
228
261
|
}
|
|
229
262
|
}
|
|
230
263
|
}
|
|
@@ -235,8 +268,6 @@ const clickHandler = (e: Event, temp: CellContentVo, index: number) => {
|
|
|
235
268
|
max-width: 90%;
|
|
236
269
|
flex: 1;
|
|
237
270
|
&__value {
|
|
238
|
-
//text-align: right;
|
|
239
|
-
font-size: $hy-font-size-base;
|
|
240
271
|
line-height: 24px;
|
|
241
272
|
color: $hy-text-color-grey;
|
|
242
273
|
margin-right: $hy-border-margin-padding-sm;
|
|
@@ -251,6 +282,10 @@ const clickHandler = (e: Event, temp: CellContentVo, index: number) => {
|
|
|
251
282
|
transform: rotate(-90deg);
|
|
252
283
|
}
|
|
253
284
|
|
|
285
|
+
&--left {
|
|
286
|
+
transform: rotate(180deg);
|
|
287
|
+
}
|
|
288
|
+
|
|
254
289
|
&--down {
|
|
255
290
|
transform: rotate(90deg);
|
|
256
291
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
import { ColorConfig, IconConfig } from "../../config";
|
|
3
3
|
|
|
4
4
|
const defaultProps: IProps = {
|
|
@@ -14,7 +14,7 @@ const defaultProps: IProps = {
|
|
|
14
14
|
value: "",
|
|
15
15
|
arrange: "right",
|
|
16
16
|
rightIcon: IconConfig.RIGHT,
|
|
17
|
-
arrowDirection: "
|
|
17
|
+
arrowDirection: "right",
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export default defaultProps;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { CSSProperties } from "vue";
|
|
1
|
+
import type { CSSProperties } from "vue";
|
|
2
|
+
import { HyApp } from "@/package/typing/modules/common";
|
|
2
3
|
|
|
3
4
|
export interface CellContentVo extends AnyObject {
|
|
4
5
|
/**
|
|
@@ -32,7 +33,7 @@ export interface CellContentVo extends AnyObject {
|
|
|
32
33
|
/**
|
|
33
34
|
* @description 单元格右侧箭头的方向,可选值为:left,up,down
|
|
34
35
|
* */
|
|
35
|
-
arrowDirection?:
|
|
36
|
+
arrowDirection?: HyApp.RotateType;
|
|
36
37
|
}
|
|
37
38
|
export default interface IProps {
|
|
38
39
|
/**
|
|
@@ -86,7 +87,7 @@ export default interface IProps {
|
|
|
86
87
|
/**
|
|
87
88
|
* @description 右侧箭头的方向,可选值为:left,up,down
|
|
88
89
|
* */
|
|
89
|
-
arrowDirection?: "left" | "up" | "down";
|
|
90
|
+
arrowDirection?: "left" | "up" | "down" | "right";
|
|
90
91
|
/**
|
|
91
92
|
* @description 自定义右侧icon样式
|
|
92
93
|
* */
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
19
|
import { toRefs, watch, ref } from "vue";
|
|
20
20
|
import defaultProps from "./props";
|
|
21
|
-
import IProps
|
|
21
|
+
import type IProps from "./typing";
|
|
22
|
+
import type { CheckboxColumnsVo } from "./typing";
|
|
22
23
|
import HyTag from "../hy-tag/hy-tag.vue";
|
|
23
24
|
|
|
24
25
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
@@ -32,16 +33,21 @@ const columns_1 = ref<CheckboxColumnsVo[]>();
|
|
|
32
33
|
|
|
33
34
|
watch(
|
|
34
35
|
() => modelValue.value,
|
|
35
|
-
(newValue: string | (string | number)[]) => {
|
|
36
|
+
(newValue: string | number | (string | number)[]) => {
|
|
36
37
|
if (!columns.value.length) return;
|
|
37
38
|
columns_1.value = columns.value.map((item) => {
|
|
38
|
-
|
|
39
|
-
item[fieldNames.value.
|
|
40
|
-
|
|
39
|
+
if (Array.isArray(newValue)) {
|
|
40
|
+
item[fieldNames.value.checked] = newValue.includes(
|
|
41
|
+
item[fieldNames.value.value] as string,
|
|
42
|
+
);
|
|
43
|
+
} else {
|
|
44
|
+
item[fieldNames.value.checked] =
|
|
45
|
+
newValue === item[fieldNames.value.value];
|
|
46
|
+
}
|
|
41
47
|
return item;
|
|
42
48
|
});
|
|
43
49
|
},
|
|
44
|
-
{ immediate: true }
|
|
50
|
+
{ immediate: true },
|
|
45
51
|
);
|
|
46
52
|
|
|
47
53
|
const onCheckbox = ({ name }: { name: number }) => {
|
|
@@ -52,7 +58,7 @@ const onCheckbox = ({ name }: { name: number }) => {
|
|
|
52
58
|
"update:modelValue",
|
|
53
59
|
columns.value
|
|
54
60
|
.filter((item) => item[fieldNames.value.checked])
|
|
55
|
-
.map((item) => item[fieldNames.value.value])
|
|
61
|
+
.map((item) => item[fieldNames.value.value]),
|
|
56
62
|
);
|
|
57
63
|
} else {
|
|
58
64
|
emit("update:modelValue", columns.value[name][fieldNames.value.value]);
|