hy-app 0.6.8 → 0.7.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/attributes.json +1 -1
- package/components/hy-action-sheet/index.scss +2 -2
- package/components/hy-avatar/hy-avatar.vue +12 -5
- package/components/hy-avatar/index.scss +2 -2
- package/components/hy-avatar/props.ts +4 -2
- package/components/hy-avatar/typing.d.ts +8 -1
- package/components/hy-calendar/hy-calendar.vue +1 -0
- package/components/hy-calendar/month.vue +25 -5
- package/components/hy-calendar/props.ts +1 -1
- package/components/hy-cascader/hy-cascader.vue +503 -0
- package/components/hy-cascader/index.scss +84 -0
- package/components/hy-cascader/props.ts +88 -0
- package/components/hy-cascader/typing.d.ts +34 -0
- package/components/hy-cell-item/index.scss +8 -9
- package/components/hy-check-button/typing.d.ts +12 -7
- package/components/hy-code-input/hy-code-input.vue +33 -11
- package/components/hy-code-input/index.scss +2 -2
- package/components/hy-code-input/typing.d.ts +4 -0
- package/components/hy-config-provider/hy-config-provider.vue +58 -53
- package/components/hy-config-provider/props.ts +1 -1
- package/components/hy-datetime-picker/props.ts +1 -1
- package/components/hy-datetime-picker/typing.d.ts +1 -1
- package/components/hy-dropdown/typing.d.ts +5 -0
- package/components/hy-float-button/index.scss +1 -1
- package/components/hy-form/typing.d.ts +6 -0
- package/components/hy-form-item/typing.d.ts +1 -1
- package/components/hy-grid/hy-grid.vue +12 -12
- package/components/hy-grid/index.scss +1 -2
- package/components/hy-grid/props.ts +7 -2
- package/components/hy-grid/typing.d.ts +1 -1
- package/components/hy-icon/typing.d.ts +52 -9
- package/components/hy-index-bar/index.scss +1 -1
- package/components/hy-keyboard/constants.ts +83 -0
- package/components/hy-keyboard/hy-keyboard.vue +375 -0
- package/components/hy-keyboard/index.scss +73 -0
- package/components/hy-keyboard/key/index.scss +79 -0
- package/components/hy-keyboard/key/index.vue +91 -0
- package/components/hy-keyboard/key/types.ts +1 -0
- package/components/hy-keyboard/props.ts +108 -0
- package/components/hy-keyboard/typing.d.ts +18 -0
- package/components/hy-line-progress/index.scss +3 -3
- package/components/hy-menu/index.scss +1 -1
- package/components/hy-modal/index.scss +2 -2
- package/components/hy-modal/typing.d.ts +2 -2
- package/components/hy-notice-bar/hy-column-notice.vue +54 -94
- package/components/hy-notice-bar/hy-notice-bar.vue +128 -96
- package/components/hy-notice-bar/hy-row-notice.vue +89 -121
- package/components/hy-notice-bar/index.scss +1 -1
- package/components/hy-notice-bar/props.ts +86 -85
- package/components/hy-notify/hy-notify.vue +9 -9
- package/components/hy-notify/typing.d.ts +22 -0
- package/components/hy-picker/hy-picker.vue +126 -149
- package/components/hy-picker/props.ts +4 -1
- package/components/hy-picker/typing.d.ts +22 -0
- package/components/hy-popover/index.scss +6 -6
- package/components/hy-popup/index.scss +6 -5
- package/components/hy-price/hy-price.vue +52 -23
- package/components/hy-price/props.ts +54 -54
- package/components/hy-radio/props.ts +1 -1
- package/components/hy-radio/typing.d.ts +5 -1
- package/components/hy-rolling-num/typing.d.ts +1 -0
- package/components/hy-scroll-list/index.scss +2 -2
- package/components/hy-search/index.scss +1 -1
- package/components/hy-signature/index.scss +1 -1
- package/components/hy-skeleton/index.scss +21 -4
- package/components/hy-slider/index.scss +3 -3
- package/components/hy-steps/hy-steps.vue +1 -1
- package/components/hy-steps/index.scss +3 -3
- package/components/hy-submit-bar/typing.d.ts +3 -3
- package/components/hy-subsection/index.scss +8 -8
- package/components/hy-swipe-action/hy-swipe-action.vue +34 -15
- package/components/hy-swipe-action/index.scss +0 -1
- package/components/hy-swiper/index.scss +2 -2
- package/components/hy-switch/index.scss +3 -3
- package/components/hy-switch/typing.d.ts +4 -0
- package/components/hy-tabbar/props.ts +2 -1
- package/components/hy-tabbar/typing.d.ts +5 -4
- package/components/hy-tabbar-group/index.scss +2 -2
- package/components/hy-tabs/hy-tabs.vue +338 -336
- package/components/hy-tabs/index.scss +7 -7
- package/components/hy-tabs/typing.d.ts +41 -33
- package/components/hy-tag/index.scss +1 -1
- package/components/hy-textarea/hy-textarea.vue +2 -2
- package/components/hy-textarea/index.scss +4 -4
- package/components/hy-textarea/typing.d.ts +4 -0
- package/components/hy-toast/hy-toast.vue +14 -6
- package/components/hy-toast/index.scss +1 -1
- package/components/hy-toast/typing.d.ts +42 -36
- package/components/hy-tooltip/hy-tooltip.vue +1 -1
- package/components/hy-tooltip/index.scss +7 -6
- package/components/hy-tooltip/props.ts +1 -1
- package/components/hy-upload/hy-upload.vue +16 -1
- package/components/hy-upload/index.scss +149 -144
- package/components/hy-warn/index.scss +1 -1
- package/components/index.ts +6 -0
- package/global.d.ts +2 -0
- package/libs/config/icon.ts +442 -430
- package/libs/css/_function.scss +7 -13
- package/libs/css/_mixin.scss +3 -3
- package/libs/css/common.scss +1 -1
- package/libs/css/iconfont.css +445 -441
- package/libs/css/theme.scss +54 -25
- package/libs/locale/lang/en-US.ts +4 -0
- package/libs/locale/lang/zh-CN.ts +4 -0
- package/libs/typing/index.ts +80 -0
- package/package.json +5 -2
- package/tags.json +1 -1
- package/web-types.json +1 -1
- package/components/hy-qrcode/qrcode.js.bak +0 -1434
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@use "../../libs/css/theme" as *;
|
|
2
|
+
@use "../../libs/css/mixin" as *;
|
|
3
|
+
|
|
4
|
+
@include b(cascader) {
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
|
|
9
|
+
&-input {
|
|
10
|
+
position: relative;
|
|
11
|
+
.input-cover {
|
|
12
|
+
opacity: 0;
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
z-index: 1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@include e(header) {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
align-items: center;
|
|
26
|
+
padding: $hy-border-margin-padding-base;
|
|
27
|
+
border-bottom: $hy-border-line;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include e(header-title) {
|
|
31
|
+
font-size: $hy-font-size-base;
|
|
32
|
+
font-weight: $hy-font-weight-bold;
|
|
33
|
+
color: $hy-text-color;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@include e(header-close) {
|
|
37
|
+
width: 60rpx;
|
|
38
|
+
height: 60rpx;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@include e(content) {
|
|
45
|
+
flex: 1;
|
|
46
|
+
overflow-y: auto;
|
|
47
|
+
padding: 0;
|
|
48
|
+
height: 100%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@include e(item) {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
padding: $hy-border-margin-padding-lg $hy-border-margin-padding-base;
|
|
56
|
+
font-size: $hy-font-size-base;
|
|
57
|
+
color: $hy-text-color;
|
|
58
|
+
position: relative;
|
|
59
|
+
|
|
60
|
+
@include m(active) {
|
|
61
|
+
color: $hy-primary;
|
|
62
|
+
font-weight: $hy-font-weight-bold;
|
|
63
|
+
background: $hy-background--hover;
|
|
64
|
+
border-left: $hy-border-width-lg solid $hy-primary;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@include e(panel) {
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@include edeep(loading) {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: 0;
|
|
76
|
+
right: 0;
|
|
77
|
+
left: 0;
|
|
78
|
+
bottom: 0;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
z-index: 10;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { CascaderOption, CascaderValue, CascaderLazyLoad } from './typing'
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
|
+
import type { HyInputProps } from '../hy-input/typing'
|
|
4
|
+
import { useTranslate } from '../../libs'
|
|
5
|
+
|
|
6
|
+
const { t } = useTranslate('cascader')
|
|
7
|
+
|
|
8
|
+
const cascaderProps = {
|
|
9
|
+
/** 当前选中的值 */
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: Object as PropType<CascaderValue>,
|
|
12
|
+
default: () => ({ value: [], label: [] })
|
|
13
|
+
},
|
|
14
|
+
/** 是否显示级联选择器弹窗 */
|
|
15
|
+
show: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
/** 级联选择器数据源 */
|
|
20
|
+
options: {
|
|
21
|
+
type: Array as PropType<CascaderOption[]>,
|
|
22
|
+
default: () => []
|
|
23
|
+
},
|
|
24
|
+
/** 是否显示顶部工具栏 */
|
|
25
|
+
showToolbar: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
},
|
|
29
|
+
/** 顶部标题 */
|
|
30
|
+
title: String,
|
|
31
|
+
/** 输入框占位提示文字 */
|
|
32
|
+
placeholder: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: () => t('placeholder')
|
|
35
|
+
},
|
|
36
|
+
/** 点击遮罩层是否关闭 */
|
|
37
|
+
closeOnClickOverlay: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
/** 弹出层的 z-index 值 */
|
|
42
|
+
zIndex: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 10076
|
|
45
|
+
},
|
|
46
|
+
/** 是否显示输入框 */
|
|
47
|
+
hasInput: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
50
|
+
},
|
|
51
|
+
/** 输入框配置 */
|
|
52
|
+
input: {
|
|
53
|
+
type: Object as PropType<HyInputProps>,
|
|
54
|
+
default: () => {}
|
|
55
|
+
},
|
|
56
|
+
/** 多选时的分隔符 */
|
|
57
|
+
separator: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: ' / '
|
|
60
|
+
},
|
|
61
|
+
/** 选项值对应的 key */
|
|
62
|
+
valueKey: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: 'value'
|
|
65
|
+
},
|
|
66
|
+
/** 选项标签对应的 key */
|
|
67
|
+
labelKey: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: 'label'
|
|
70
|
+
},
|
|
71
|
+
/** 选项子级对应的 key */
|
|
72
|
+
childrenKey: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: 'children'
|
|
75
|
+
},
|
|
76
|
+
/** 异步加载子节点的回调函数,提供后将启用异步加载模式 */
|
|
77
|
+
lazyLoad: {
|
|
78
|
+
type: Function as PropType<CascaderLazyLoad>,
|
|
79
|
+
default: undefined
|
|
80
|
+
},
|
|
81
|
+
/** 选项对象中,标识叶子节点的 key */
|
|
82
|
+
isLeafKey: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: 'isLeaf'
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export default cascaderProps
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface CascaderOption {
|
|
2
|
+
value: string | number
|
|
3
|
+
label: string
|
|
4
|
+
children?: CascaderOption[]
|
|
5
|
+
disabled?: boolean
|
|
6
|
+
isLeaf?: boolean
|
|
7
|
+
[key: string]: any
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface CascaderValue {
|
|
11
|
+
value: (string | number)[]
|
|
12
|
+
label: string[]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CascaderEmitValue {
|
|
16
|
+
value: (string | number)[]
|
|
17
|
+
label: string[]
|
|
18
|
+
selectedOptions: CascaderOption[]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type CascaderLazyLoad = (
|
|
22
|
+
option: CascaderOption | null,
|
|
23
|
+
tabIndex: number,
|
|
24
|
+
resolve: (children: CascaderOption[]) => void
|
|
25
|
+
) => void
|
|
26
|
+
|
|
27
|
+
export interface ICascaderEmits {
|
|
28
|
+
(e: 'close'): void
|
|
29
|
+
(e: 'cancel'): void
|
|
30
|
+
(e: 'confirm', params: CascaderEmitValue): void
|
|
31
|
+
(e: 'change', params: CascaderEmitValue): void
|
|
32
|
+
(e: 'update:show', show: boolean): void
|
|
33
|
+
(e: 'update:modelValue', value: CascaderValue): void
|
|
34
|
+
}
|
|
@@ -12,22 +12,22 @@
|
|
|
12
12
|
/* 大 */
|
|
13
13
|
@include m(large) {
|
|
14
14
|
font-size: $hy-font-size-lg;
|
|
15
|
-
padding:
|
|
16
|
-
line-height:
|
|
15
|
+
padding: $hy-border-margin-padding-lg;
|
|
16
|
+
line-height: $hy-line-height-lg;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/* 默认 */
|
|
20
20
|
@include m(medium) {
|
|
21
21
|
font-size: $hy-font-size-base;
|
|
22
|
-
padding:
|
|
23
|
-
line-height:
|
|
22
|
+
padding: $hy-border-margin-padding-base;
|
|
23
|
+
line-height: $hy-line-height-base;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/* 小 */
|
|
27
27
|
@include m(small) {
|
|
28
28
|
font-size: $hy-font-size-sm;
|
|
29
|
-
padding:
|
|
30
|
-
line-height:
|
|
29
|
+
padding: $hy-border-margin-padding-sm;
|
|
30
|
+
line-height: $hy-line-height-sm;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/*点击状态*/
|
|
@@ -51,9 +51,8 @@
|
|
|
51
51
|
|
|
52
52
|
/*sub值*/
|
|
53
53
|
@include e(sub) {
|
|
54
|
-
margin-top: $hy-border-margin-padding-sm;
|
|
55
54
|
color: $hy-text-color--grey;
|
|
56
|
-
font-size:
|
|
55
|
+
font-size: $hy-font-size-sm;
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
}
|
|
@@ -64,7 +63,7 @@
|
|
|
64
63
|
max-width: 90%;
|
|
65
64
|
flex: 1;
|
|
66
65
|
@include m(value) {
|
|
67
|
-
line-height:
|
|
66
|
+
line-height: $hy-line-height-base;
|
|
68
67
|
color: $hy-text-color--grey;
|
|
69
68
|
margin-right: $hy-border-margin-padding-sm;
|
|
70
69
|
}
|
|
@@ -1,33 +1,38 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import type checkButtonProps from './props'
|
|
3
|
+
|
|
4
|
+
export interface HyCheckButtonProps extends ExtractPropTypes<typeof checkButtonProps> {}
|
|
5
|
+
|
|
1
6
|
export interface CheckboxColumnsVo extends FieldNamesType {
|
|
2
7
|
/**
|
|
3
|
-
*
|
|
8
|
+
* 显示文本内容
|
|
4
9
|
* */
|
|
5
10
|
label?: string
|
|
6
11
|
/**
|
|
7
|
-
*
|
|
12
|
+
* 值
|
|
8
13
|
* */
|
|
9
14
|
value?: string | number
|
|
10
15
|
/**
|
|
11
|
-
*
|
|
16
|
+
* 是否选中
|
|
12
17
|
* */
|
|
13
18
|
checked?: boolean
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
|
-
*
|
|
21
|
+
* 是否禁用
|
|
17
22
|
* */
|
|
18
23
|
disabled?: boolean
|
|
19
24
|
}
|
|
20
25
|
export interface IFieldNames {
|
|
21
26
|
/**
|
|
22
|
-
*
|
|
27
|
+
* 自定义columns的文本键
|
|
23
28
|
* */
|
|
24
29
|
label: string
|
|
25
30
|
/**
|
|
26
|
-
*
|
|
31
|
+
* 自定义columns的值键
|
|
27
32
|
* */
|
|
28
33
|
value: string
|
|
29
34
|
/**
|
|
30
|
-
*
|
|
35
|
+
* 自定义columns的选中键
|
|
31
36
|
* */
|
|
32
37
|
checked: string
|
|
33
38
|
}
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
:style="{
|
|
36
36
|
height: boxSize
|
|
37
37
|
}"
|
|
38
|
-
@focus="
|
|
39
|
-
@blur="
|
|
38
|
+
@focus="handleFocus"
|
|
39
|
+
@blur="handleBlur"
|
|
40
40
|
/>
|
|
41
41
|
</view>
|
|
42
42
|
</template>
|
|
@@ -80,9 +80,19 @@ const boxSize = addUnit(props.size)
|
|
|
80
80
|
|
|
81
81
|
watch(
|
|
82
82
|
() => props.modelValue,
|
|
83
|
-
(newValue: string | number) => {
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
(newValue: string | number | undefined, oldValue: string | number | undefined) => {
|
|
84
|
+
const newValueStr = String(newValue).substring(0, props.maxlength)
|
|
85
|
+
inputValue.value = newValueStr
|
|
86
|
+
current.value = newValueStr.length
|
|
87
|
+
|
|
88
|
+
// 当值从外部更新时(如键盘组件),也触发change事件
|
|
89
|
+
if (newValue !== oldValue) {
|
|
90
|
+
emit('change', newValueStr)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (String(inputValue.value).length >= Number(props.maxlength)) {
|
|
94
|
+
emit('finish', inputValue.value)
|
|
95
|
+
}
|
|
86
96
|
},
|
|
87
97
|
|
|
88
98
|
{ immediate: true }
|
|
@@ -178,14 +188,30 @@ const itemClass = computed(() => {
|
|
|
178
188
|
})
|
|
179
189
|
|
|
180
190
|
/**
|
|
181
|
-
*
|
|
191
|
+
* 将输入的值,转为数组,给item历遍时,根据当前的索引显示数组的元素
|
|
182
192
|
*/
|
|
183
193
|
const codeArray = computed(() => {
|
|
184
194
|
return String(inputValue.value).split('')
|
|
185
195
|
})
|
|
186
196
|
|
|
187
197
|
/**
|
|
188
|
-
*
|
|
198
|
+
* 输入框获取焦点时触发
|
|
199
|
+
* */
|
|
200
|
+
const handleFocus = () => {
|
|
201
|
+
isFocus.value = true
|
|
202
|
+
emit('focus')
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* 输入框失去焦点时触发
|
|
207
|
+
* */
|
|
208
|
+
const handleBlur = () => {
|
|
209
|
+
isFocus.value = false
|
|
210
|
+
emit('blur')
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 监听输入框的值发生变化
|
|
189
215
|
* */
|
|
190
216
|
const inputHandler = (e: InputOnInputEvent) => {
|
|
191
217
|
const value = e.detail.value
|
|
@@ -200,10 +226,6 @@ const inputHandler = (e: InputOnInputEvent) => {
|
|
|
200
226
|
emit('change', value)
|
|
201
227
|
// 修改通过v-model双向绑定的值
|
|
202
228
|
emit('update:modelValue', value)
|
|
203
|
-
// 达到用户指定输入长度时,发出完成事件
|
|
204
|
-
if (String(value).length >= Number(props.maxlength)) {
|
|
205
|
-
emit('finish', value)
|
|
206
|
-
}
|
|
207
229
|
}
|
|
208
230
|
</script>
|
|
209
231
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/* 无边框 */
|
|
28
28
|
@include e(no) {
|
|
29
29
|
background-color: $hy-background--track;
|
|
30
|
-
border-radius: $hy-
|
|
30
|
+
border-radius: $hy-radius-sm;
|
|
31
31
|
@include m(active) {
|
|
32
32
|
&:before {
|
|
33
33
|
content: "";
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
content: "";
|
|
68
68
|
position: absolute;
|
|
69
69
|
bottom: 0;
|
|
70
|
-
border-radius: $hy-
|
|
70
|
+
border-radius: $hy-radius-semicircle;
|
|
71
71
|
width: 40px;
|
|
72
72
|
background-color: $hy-border-color--2;
|
|
73
73
|
}
|
|
@@ -1,53 +1,58 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view :class="themeClass" :style="[themeStyle, { height: height ? addUnit(height) : '' }]">
|
|
3
|
-
<!-- @slot 默认插槽 -->
|
|
4
|
-
<slot />
|
|
5
|
-
</view>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script lang="ts">
|
|
9
|
-
export default {
|
|
10
|
-
name: 'hy-config-provider',
|
|
11
|
-
options: {
|
|
12
|
-
addGlobalClass: true,
|
|
13
|
-
virtualHost: true,
|
|
14
|
-
styleIsolation: 'shared'
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
import { computed } from 'vue'
|
|
21
|
-
import { addUnit, colorGradient } from '../../libs'
|
|
22
|
-
import configProviderProps from './props'
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 将 ConfigProvider 组件的 theme 属性设置为 dark,可以开启深色模式。 深色模式会全局生效,使页面上的所有 Wot 组件变为深色风格。
|
|
26
|
-
* @displayName hy-config-provider
|
|
27
|
-
*/
|
|
28
|
-
defineOptions({})
|
|
29
|
-
|
|
30
|
-
const props = defineProps(configProviderProps)
|
|
31
|
-
|
|
32
|
-
const themeClass = computed(() => {
|
|
33
|
-
return [props.customClass, 'hy-config-provider', `hy-theme--${props.theme}`]
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
const themeStyle = computed(() => {
|
|
37
|
-
return [
|
|
38
|
-
{
|
|
39
|
-
'--hy-theme-color': props.themeColor,
|
|
40
|
-
'--hy-theme--light':
|
|
41
|
-
props.theme === '
|
|
42
|
-
? colorGradient(props.themeColor)[
|
|
43
|
-
: colorGradient(props.themeColor
|
|
44
|
-
padding: addUnit(props.padding)
|
|
45
|
-
},
|
|
46
|
-
props.customStyle
|
|
47
|
-
]
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<view :class="themeClass" :style="[themeStyle, { height: height ? addUnit(height) : '' }]">
|
|
3
|
+
<!-- @slot 默认插槽 -->
|
|
4
|
+
<slot />
|
|
5
|
+
</view>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default {
|
|
10
|
+
name: 'hy-config-provider',
|
|
11
|
+
options: {
|
|
12
|
+
addGlobalClass: true,
|
|
13
|
+
virtualHost: true,
|
|
14
|
+
styleIsolation: 'shared'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { computed, provide, toRefs } from 'vue'
|
|
21
|
+
import { addUnit, colorGradient } from '../../libs'
|
|
22
|
+
import configProviderProps from './props'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 将 ConfigProvider 组件的 theme 属性设置为 dark,可以开启深色模式。 深色模式会全局生效,使页面上的所有 Wot 组件变为深色风格。
|
|
26
|
+
* @displayName hy-config-provider
|
|
27
|
+
*/
|
|
28
|
+
defineOptions({})
|
|
29
|
+
|
|
30
|
+
const props = defineProps(configProviderProps)
|
|
31
|
+
|
|
32
|
+
const themeClass = computed(() => {
|
|
33
|
+
return [props.customClass, 'hy-config-provider', `hy-theme--${props.theme}`]
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const themeStyle = computed(() => {
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
'--hy-theme-color': props.themeColor,
|
|
40
|
+
'--hy-theme--light':
|
|
41
|
+
props.theme === 'dark'
|
|
42
|
+
? colorGradient(props.themeColor, '#000')[60]
|
|
43
|
+
: colorGradient(props.themeColor)[80],
|
|
44
|
+
padding: addUnit(props.padding)
|
|
45
|
+
},
|
|
46
|
+
props.customStyle
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
// 提供给所有后代组件
|
|
51
|
+
provide('hy-config-provider', {
|
|
52
|
+
...toRefs(props)
|
|
53
|
+
})
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style scoped lang="scss">
|
|
57
|
+
@import './index.scss';
|
|
58
|
+
</style>
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
:name="item[customKeys?.icon]"
|
|
15
15
|
label-pos="bottom"
|
|
16
16
|
:label="item[customKeys?.name]"
|
|
17
|
-
:space="item?.
|
|
18
|
-
:color="item?.
|
|
19
|
-
:size="item?.
|
|
20
|
-
:bold="item?.
|
|
21
|
-
:customPrefix="item?.
|
|
22
|
-
:imgMode="item?.
|
|
23
|
-
:width="item?.
|
|
24
|
-
:height="item?.
|
|
25
|
-
:top="item?.
|
|
26
|
-
:stop="item?.
|
|
27
|
-
:round="item?.
|
|
28
|
-
:customStyle="item?.
|
|
17
|
+
:space="item?.iconProps?.space || iconProps?.space || 8"
|
|
18
|
+
:color="item?.iconProps?.color || iconProps?.color"
|
|
19
|
+
:size="item?.iconProps?.size || iconProps?.size || size"
|
|
20
|
+
:bold="item?.iconProps?.bold || iconProps?.bold"
|
|
21
|
+
:customPrefix="item?.iconProps?.customPrefix"
|
|
22
|
+
:imgMode="item?.iconProps?.imgMode || iconProps?.imgMode"
|
|
23
|
+
:width="item?.iconProps?.width || iconProps?.width"
|
|
24
|
+
:height="item?.iconProps?.height || iconProps?.height"
|
|
25
|
+
:top="item?.iconProps?.top || iconProps?.top"
|
|
26
|
+
:stop="item?.iconProps?.stop || iconProps?.stop"
|
|
27
|
+
:round="item?.iconProps?.round || iconProps?.round || 6"
|
|
28
|
+
:customStyle="item?.iconProps?.customStyle || iconProps?.customStyle"
|
|
29
29
|
></hy-icon>
|
|
30
30
|
</view>
|
|
31
31
|
</template>
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
/* #endif */
|
|
14
14
|
|
|
15
15
|
@include e(item) {
|
|
16
|
-
align-items: center;
|
|
17
16
|
justify-content: center;
|
|
18
17
|
position: relative;
|
|
19
18
|
flex-direction: column;
|
|
@@ -24,9 +23,9 @@
|
|
|
24
23
|
/* #endif */
|
|
25
24
|
|
|
26
25
|
/* #ifdef MP */
|
|
27
|
-
position: relative;
|
|
28
26
|
float: left;
|
|
29
27
|
/* #endif */
|
|
28
|
+
padding: $hy-border-margin-padding-base 0;
|
|
30
29
|
|
|
31
30
|
// 只有当有 border 类时才显示边框
|
|
32
31
|
@include m(border) {
|
|
@@ -21,6 +21,11 @@ const gridProps = {
|
|
|
21
21
|
type: Number,
|
|
22
22
|
default: 5
|
|
23
23
|
},
|
|
24
|
+
/** 图标大小 */
|
|
25
|
+
size: {
|
|
26
|
+
type: [Number, String],
|
|
27
|
+
default: 44
|
|
28
|
+
},
|
|
24
29
|
/** 是否显示宫格的边框 */
|
|
25
30
|
border: {
|
|
26
31
|
type: Boolean,
|
|
@@ -29,7 +34,7 @@ const gridProps = {
|
|
|
29
34
|
/** 单个宫格高度 */
|
|
30
35
|
itemHeight: {
|
|
31
36
|
type: [Number, String],
|
|
32
|
-
default: '
|
|
37
|
+
default: '100%'
|
|
33
38
|
},
|
|
34
39
|
/**
|
|
35
40
|
* 宫格对齐方式,表现为数量少的时候,靠左,居中,还是靠右
|
|
@@ -50,7 +55,7 @@ const gridProps = {
|
|
|
50
55
|
default: 'transparent'
|
|
51
56
|
},
|
|
52
57
|
/** 图标属性api配置集合 */
|
|
53
|
-
|
|
58
|
+
iconProps: Object as PropType<HyIconProps>,
|
|
54
59
|
/** 定义需要用到的外部样式 */
|
|
55
60
|
customStyle: Object as PropType<CSSProperties>,
|
|
56
61
|
/** 自定义外部类名 */
|