hy-app 0.1.4 → 0.2.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/components/hy-address-picker/hy-address-picker.vue +31 -10
- package/components/hy-address-picker/index.scss +1 -1
- package/components/hy-address-picker/props.ts +1 -3
- package/components/hy-address-picker/typing.d.ts +4 -11
- package/components/hy-avatar/hy-avatar.vue +11 -0
- package/components/hy-avatar/index.scss +8 -8
- package/components/hy-avatar/typing.d.ts +1 -1
- package/components/hy-back-top/hy-back-top.vue +27 -2
- package/components/hy-back-top/index.scss +11 -1
- package/components/hy-back-top/props.ts +1 -6
- package/components/hy-back-top/typing.d.ts +4 -7
- package/components/hy-badge/hy-badge.vue +11 -0
- package/components/hy-badge/index.scss +18 -40
- package/components/hy-badge/typing.d.ts +1 -1
- package/components/hy-button/hy-button.vue +44 -17
- package/components/hy-button/index.scss +25 -45
- package/components/hy-button/props.ts +1 -2
- package/components/hy-button/typing.d.ts +4 -7
- package/components/hy-calendar/header.vue +12 -12
- package/components/hy-calendar/hy-calendar.vue +11 -2
- package/components/hy-calendar/index.scss +140 -131
- package/components/hy-calendar/month.vue +18 -18
- package/components/hy-calendar/typing.d.ts +1 -1
- package/components/hy-card/hy-card.vue +11 -0
- package/components/hy-card/index.scss +12 -12
- package/components/hy-card/props.ts +2 -2
- package/components/hy-card/typing.d.ts +1 -1
- package/components/hy-cell/hy-cell.vue +57 -19
- package/components/hy-cell/index.scss +55 -28
- package/components/hy-cell/props.ts +4 -5
- package/components/hy-cell/typing.d.ts +11 -21
- package/components/hy-check-button/hy-check-button.vue +13 -2
- package/components/hy-check-button/index.scss +0 -5
- package/components/hy-check-button/typing.d.ts +1 -1
- package/components/hy-checkbox/hy-checkbox.vue +34 -10
- package/components/hy-checkbox/index.scss +15 -5
- package/components/hy-checkbox/props.ts +2 -3
- package/components/hy-checkbox/typing.d.ts +3 -3
- package/components/hy-config-provider/hy-config-provider.vue +52 -0
- package/components/hy-config-provider/index.scss +21 -0
- package/components/hy-config-provider/props.ts +13 -0
- package/components/hy-config-provider/typing.d.ts +28 -0
- package/components/hy-count-down/hy-count-down.vue +11 -0
- package/components/hy-count-down/index.scss +13 -1
- package/components/hy-count-down/typing.d.ts +1 -1
- package/components/hy-count-to/hy-count-to.vue +12 -1
- package/components/hy-count-to/index.scss +14 -1
- package/components/hy-count-to/props.ts +1 -1
- package/components/hy-count-to/typing.d.ts +1 -3
- package/components/hy-datetime-picker/hy-datetime-picker.vue +29 -14
- package/components/hy-datetime-picker/index.scss +1 -1
- package/components/hy-datetime-picker/props.ts +1 -3
- package/components/hy-datetime-picker/typing.d.ts +6 -13
- package/components/hy-divider/hy-divider.vue +11 -0
- package/components/hy-divider/index.scss +1 -1
- package/components/hy-divider/typing.d.ts +1 -1
- package/components/hy-dropdown/hy-dropdown.vue +13 -1
- package/components/hy-dropdown/index.scss +4 -1
- package/components/hy-dropdown/props.ts +2 -2
- package/components/hy-dropdown/typing.d.ts +1 -1
- package/components/hy-dropdown-item/hy-dropdown-item.vue +21 -3
- package/components/hy-dropdown-item/index.scss +35 -2
- package/components/hy-dropdown-item/typing.d.ts +1 -3
- package/components/hy-empty/hy-empty.vue +22 -10
- package/components/hy-empty/index.scss +17 -3
- package/components/hy-empty/props.ts +1 -5
- package/components/hy-empty/typing.d.ts +4 -19
- package/components/hy-float-button/hy-float-button.vue +11 -0
- package/components/hy-float-button/index.scss +13 -2
- package/components/hy-float-button/props.ts +3 -3
- package/components/hy-float-button/typing.d.ts +1 -1
- package/components/hy-folding-panel/hy-folding-panel.vue +11 -0
- package/components/hy-folding-panel/index.scss +4 -1
- package/components/hy-folding-panel/typing.d.ts +1 -1
- package/components/hy-form/hy-form.vue +214 -36
- package/components/hy-form/index.scss +13 -3
- package/components/hy-form/props.ts +0 -2
- package/components/hy-form/typing.d.ts +25 -7
- package/components/hy-grid/hy-grid.vue +27 -5
- package/components/hy-grid/index.scss +1 -1
- package/components/hy-grid/props.ts +1 -3
- package/components/hy-grid/typing.d.ts +13 -16
- package/components/hy-icon/hy-icon.vue +17 -10
- package/components/hy-icon/index.scss +16 -7
- package/components/hy-icon/props.ts +2 -2
- package/components/hy-icon/typing.d.ts +1 -1
- package/components/hy-image/hy-image.vue +11 -0
- package/components/hy-image/index.scss +4 -3
- package/components/hy-image/typing.d.ts +1 -1
- package/components/hy-input/hy-input.vue +58 -19
- package/components/hy-input/index.scss +12 -2
- package/components/hy-input/props.ts +3 -5
- package/components/hy-input/typing.d.ts +13 -12
- package/components/hy-line/hy-line.vue +11 -0
- package/components/hy-line/index.scss +4 -1
- package/components/hy-line/typing.d.ts +1 -1
- package/components/hy-line-progress/hy-line-progress.vue +17 -2
- package/components/hy-line-progress/index.scss +20 -8
- package/components/hy-line-progress/props.ts +4 -4
- package/components/hy-line-progress/typing.d.ts +5 -1
- package/components/hy-list/hy-list.vue +23 -8
- package/components/hy-list/index.scss +1 -4
- package/components/hy-list/typing.d.ts +1 -1
- package/components/hy-loading/hy-loading.vue +11 -0
- package/components/hy-loading/index.scss +2 -2
- package/components/hy-loading/typing.d.ts +1 -2
- package/components/hy-login/TheUserLogin.vue +63 -106
- package/components/hy-login/hy-login.vue +15 -10
- package/components/hy-login/props.ts +1 -1
- package/components/hy-login/typing.d.ts +6 -1
- package/components/hy-modal/hy-modal.vue +15 -7
- package/components/hy-modal/index.scss +19 -3
- package/components/hy-modal/typing.d.ts +1 -1
- package/components/hy-navbar/hy-navbar.vue +11 -0
- package/components/hy-navbar/index.scss +14 -3
- package/components/hy-navbar/props.ts +1 -1
- package/components/hy-navbar/typing.d.ts +1 -2
- package/components/hy-notice-bar/hy-notice-bar.vue +11 -0
- package/components/hy-notice-bar/index.scss +35 -35
- package/components/hy-notice-bar/typing.d.ts +1 -1
- package/components/hy-number-step/hy-number-step.vue +40 -18
- package/components/hy-number-step/index.scss +34 -25
- package/components/hy-number-step/props.ts +4 -4
- package/components/hy-number-step/typing.d.ts +8 -3
- package/components/hy-overlay/index.scss +3 -1
- package/components/hy-overlay/typing.d.ts +1 -1
- package/components/hy-parse/typing.d.ts +1 -1
- package/components/hy-picker/hy-picker.vue +30 -8
- package/components/hy-picker/index.scss +7 -3
- package/components/hy-picker/props.ts +2 -5
- package/components/hy-picker/typing.d.ts +4 -15
- package/components/hy-popup/hy-popup.vue +11 -0
- package/components/hy-popup/index.scss +10 -1
- package/components/hy-popup/typing.d.ts +1 -1
- package/components/hy-price/hy-price.vue +11 -0
- package/components/hy-price/index.scss +4 -1
- package/components/hy-price/typing.d.ts +1 -1
- package/components/hy-qrcode/hy-qrcode.vue +11 -0
- package/components/hy-qrcode/index.scss +4 -1
- package/components/hy-qrcode/typing.d.ts +1 -1
- package/components/hy-radio/hy-radio.vue +25 -5
- package/components/hy-radio/index.scss +17 -5
- package/components/hy-radio/props.ts +2 -3
- package/components/hy-radio/typing.d.ts +2 -2
- package/components/hy-rate/hy-rate.vue +11 -0
- package/components/hy-rate/index.scss +6 -6
- package/components/hy-rate/typing.d.ts +1 -1
- package/components/hy-read-more/hy-read-more.vue +23 -2
- package/components/hy-read-more/index.scss +29 -2
- package/components/hy-read-more/props.ts +2 -7
- package/components/hy-read-more/typing.d.ts +1 -1
- package/components/hy-scroll-list/hy-scroll-list.vue +31 -9
- package/components/hy-scroll-list/index.scss +10 -1
- package/components/hy-scroll-list/props.ts +2 -2
- package/components/hy-scroll-list/typing.d.ts +1 -1
- package/components/hy-search/hy-search.vue +23 -3
- package/components/hy-search/index.scss +25 -4
- package/components/hy-search/props.ts +3 -5
- package/components/hy-search/typing.d.ts +6 -13
- package/components/hy-slider/hy-slider.vue +11 -0
- package/components/hy-slider/index.scss +3 -2
- package/components/hy-slider/props.ts +1 -1
- package/components/hy-slider/typing.d.ts +1 -1
- package/components/hy-status-bar/typing.d.ts +1 -1
- package/components/hy-steps/hy-steps.vue +38 -20
- package/components/hy-steps/index.scss +57 -17
- package/components/hy-steps/props.ts +2 -2
- package/components/hy-steps/typing.d.ts +1 -1
- package/components/{hy-submitBar/hy-submitBar.vue → hy-submit-bar/hy-submit-bar.vue} +13 -34
- package/components/hy-submit-bar/index.scss +45 -0
- package/components/{hy-submitBar → hy-submit-bar}/typing.d.ts +1 -1
- package/components/hy-subsection/hy-subsection.vue +12 -0
- package/components/hy-subsection/index.scss +28 -8
- package/components/hy-subsection/props.ts +3 -3
- package/components/hy-subsection/typing.d.ts +1 -1
- package/components/hy-swipe-action/typing.d.ts +1 -1
- package/components/hy-swiper/hy-swiper.vue +11 -0
- package/components/hy-swiper/index.scss +13 -2
- package/components/hy-swiper/typing.d.ts +2 -5
- package/components/hy-switch/hy-switch.vue +28 -5
- package/components/hy-switch/index.scss +25 -7
- package/components/hy-switch/props.ts +1 -3
- package/components/hy-switch/typing.d.ts +6 -5
- package/components/hy-tabs/hy-tabs.vue +27 -15
- package/components/hy-tabs/index.scss +25 -4
- package/components/hy-tabs/props.ts +4 -10
- package/components/hy-tabs/typing.d.ts +1 -1
- package/components/hy-tag/hy-tag.vue +38 -22
- package/components/hy-tag/index.scss +27 -115
- package/components/hy-tag/props.ts +1 -2
- package/components/hy-tag/typing.d.ts +3 -10
- package/components/hy-text/hy-text.vue +12 -1
- package/components/hy-text/index.scss +20 -37
- package/components/hy-text/typing.d.ts +1 -1
- package/components/hy-textarea/hy-textarea.vue +17 -6
- package/components/hy-textarea/index.scss +16 -5
- package/components/hy-textarea/typing.d.ts +2 -2
- package/components/hy-toast/hy-toast.vue +13 -2
- package/components/hy-toast/index.scss +26 -26
- package/components/hy-toast/typing.d.ts +1 -1
- package/components/hy-tooltip/hy-tooltip.vue +11 -0
- package/components/hy-tooltip/index.scss +3 -3
- package/components/hy-tooltip/props.ts +1 -1
- package/components/hy-tooltip/typing.d.ts +1 -1
- package/components/hy-transition/typing.d.ts +1 -1
- package/components/hy-upload/hy-upload.vue +11 -0
- package/components/hy-upload/index.scss +12 -1
- package/components/hy-upload/typing.d.ts +1 -1
- package/components/hy-warn/hy-warn.vue +22 -11
- package/components/hy-warn/index.scss +46 -1
- package/components/hy-warn/typing.d.ts +1 -1
- package/components/hy-waterfall/hy-waterfall.vue +11 -0
- package/components/hy-waterfall/index.scss +1 -1
- package/components/hy-waterfall/typing.d.ts +1 -3
- package/components/index.ts +2 -2
- package/config/icon.ts +4 -0
- package/libs/css/common.scss +9 -0
- package/libs/css/mixin.scss +78 -0
- package/package.json +3 -3
- package/public/font/iconfont.css +3 -3
- package/store/userInfo.ts +26 -25
- package/theme.scss +76 -60
- package/typing/modules/common.d.ts +5 -1
- package/typing/modules/form.ts +29 -14
- package/utils/colorGradient.ts +1 -1
- package/utils/inside.ts +3 -0
- package/components/hy-submitBar/Index.vue +0 -17
- package/components/hy-submitBar/index.scss +0 -9
- /package/components/{hy-submitBar → hy-submit-bar}/props.ts +0 -0
|
@@ -3,18 +3,27 @@
|
|
|
3
3
|
<view
|
|
4
4
|
v-if="hasInput"
|
|
5
5
|
class="u-datetime-picker__has-input"
|
|
6
|
-
@
|
|
6
|
+
@tap="onShowByClickInput"
|
|
7
7
|
>
|
|
8
8
|
<slot name="trigger" :value="inputValue">
|
|
9
9
|
<HyInput
|
|
10
|
-
:placeholder="placeholder"
|
|
11
|
-
:readonly="true"
|
|
12
10
|
v-model="inputValue"
|
|
13
|
-
:
|
|
14
|
-
:
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
-
:
|
|
11
|
+
:readonly="true"
|
|
12
|
+
:disabled="input?.disabled"
|
|
13
|
+
:disabledColor="input?.disabledColor"
|
|
14
|
+
:shape="input?.shape"
|
|
15
|
+
:border="input?.border"
|
|
16
|
+
:prefixIcon="input?.prefixIcon"
|
|
17
|
+
:suffixIcon="input?.suffixIcon"
|
|
18
|
+
:color="input?.color"
|
|
19
|
+
:fontSize="input?.fontSize"
|
|
20
|
+
:inputAlign="input?.inputAlign"
|
|
21
|
+
:placeholder="input?.placeholder || '请选择地址'"
|
|
22
|
+
:placeholderStyle="input?.placeholderStyle"
|
|
23
|
+
:placeholderClass="input?.placeholderClass"
|
|
24
|
+
:customStyle="
|
|
25
|
+
Object.assign({ 'pointer-events': 'none' }, input?.customStyle)
|
|
26
|
+
"
|
|
18
27
|
></HyInput>
|
|
19
28
|
<view class="input-cover"></view>
|
|
20
29
|
</slot>
|
|
@@ -53,6 +62,17 @@
|
|
|
53
62
|
</view>
|
|
54
63
|
</template>
|
|
55
64
|
|
|
65
|
+
<script lang="ts">
|
|
66
|
+
export default {
|
|
67
|
+
name: 'hy-address-picker',
|
|
68
|
+
options: {
|
|
69
|
+
addGlobalClass: true,
|
|
70
|
+
virtualHost: true,
|
|
71
|
+
styleIsolation: 'shared'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
75
|
+
|
|
56
76
|
<script setup lang="ts">
|
|
57
77
|
import { onMounted, ref, toRefs } from "vue";
|
|
58
78
|
import defaultProps from "./props";
|
|
@@ -64,7 +84,7 @@ import HyInput from "../hy-input/hy-input.vue";
|
|
|
64
84
|
import HyPicker from "../hy-picker/hy-picker.vue";
|
|
65
85
|
|
|
66
86
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
67
|
-
const { show, modelValue, hasInput,
|
|
87
|
+
const { show, modelValue, hasInput, input, separator, closeOnClickOverlay } =
|
|
68
88
|
toRefs(props);
|
|
69
89
|
const emit = defineEmits([
|
|
70
90
|
"close",
|
|
@@ -223,7 +243,8 @@ const change = (e: any) => {
|
|
|
223
243
|
};
|
|
224
244
|
|
|
225
245
|
const onShowByClickInput = () => {
|
|
226
|
-
|
|
246
|
+
console.log(input.value?.disabled);
|
|
247
|
+
if (!input.value?.disabled) {
|
|
227
248
|
showByClickInput.value = !showByClickInput.value;
|
|
228
249
|
}
|
|
229
250
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties } from "vue";
|
|
2
|
+
import type HyInputProps from "../hy-input/typing";
|
|
2
3
|
|
|
3
|
-
export default interface
|
|
4
|
+
export default interface HyAddressPickerProps {
|
|
4
5
|
/**
|
|
5
6
|
* @description 用于控制选择器的弹出和收起 ( 默认 false )
|
|
6
7
|
* */
|
|
@@ -62,22 +63,14 @@ export default interface IProps {
|
|
|
62
63
|
* @note 类型有问题,需要调整
|
|
63
64
|
* */
|
|
64
65
|
defaultIndex?: Array<any>;
|
|
65
|
-
/**
|
|
66
|
-
* @description 是否禁用输入框 ( 默认 false )
|
|
67
|
-
* */
|
|
68
|
-
disabled?: boolean;
|
|
69
66
|
/**
|
|
70
67
|
* @description 输入框是否显示边框 ( 默认 false )
|
|
71
68
|
* */
|
|
72
69
|
hasInput?: boolean;
|
|
73
70
|
/**
|
|
74
|
-
* @description
|
|
75
|
-
* */
|
|
76
|
-
placeholder?: string;
|
|
77
|
-
/**
|
|
78
|
-
* @description 禁用时候输入框颜色
|
|
71
|
+
* @description 输入框集合属性
|
|
79
72
|
* */
|
|
80
|
-
|
|
73
|
+
input?: Partial<HyInputProps>;
|
|
81
74
|
/**
|
|
82
75
|
* @description 右边插槽
|
|
83
76
|
* */
|
|
@@ -49,6 +49,17 @@
|
|
|
49
49
|
</view>
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
|
+
<script lang="ts">
|
|
53
|
+
export default {
|
|
54
|
+
name: 'hy-avatar',
|
|
55
|
+
options: {
|
|
56
|
+
addGlobalClass: true,
|
|
57
|
+
virtualHost: true,
|
|
58
|
+
styleIsolation: 'shared'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
52
63
|
<script setup lang="ts">
|
|
53
64
|
import { computed, type CSSProperties, toRefs, ref, watch } from "vue";
|
|
54
65
|
import defaultProps from "./props";
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
2
|
@use "../../theme.scss" as *;
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
@include b(avatar) {
|
|
5
5
|
@include flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: center;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
@include m(circle) {
|
|
10
10
|
border-radius: $hy-border-radius-circle;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
@include m(square) {
|
|
14
14
|
border-radius: $hy-border-margin-padding-sm;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
@include m(small) {
|
|
18
18
|
width: $hy-avatar-size-sm;
|
|
19
19
|
height: $hy-avatar-size-sm;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
@include m(medium) {
|
|
23
23
|
width: $hy-avatar-size-base;
|
|
24
24
|
height: $hy-avatar-size-base;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
@include m(large) {
|
|
28
28
|
width: $hy-avatar-size-lg;
|
|
29
29
|
height: $hy-avatar-size-lg;
|
|
30
30
|
}
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
width: 100%;
|
|
34
34
|
height: 100%;
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
@include m(circle) {
|
|
37
37
|
border-radius: $hy-border-radius-circle;
|
|
38
38
|
overflow: hidden;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
@include m(square) {
|
|
42
42
|
border-radius: $hy-border-margin-padding-sm;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -2,21 +2,46 @@
|
|
|
2
2
|
<HyTransition mode="fade" :customStyle="backTopStyle" :show="show">
|
|
3
3
|
<slot>
|
|
4
4
|
<view class="hy-back-top" :style="contentStyle" @click="backToTop">
|
|
5
|
-
<HyIcon
|
|
5
|
+
<HyIcon
|
|
6
|
+
:name="icon?.name || IconConfig.DOWNLOAD"
|
|
7
|
+
:color="icon?.color"
|
|
8
|
+
:size="icon?.size"
|
|
9
|
+
:bold="icon?.bold"
|
|
10
|
+
:customPrefix="icon?.customPrefix"
|
|
11
|
+
:imgMode="icon?.imgMode"
|
|
12
|
+
:width="icon?.width"
|
|
13
|
+
:height="icon?.height"
|
|
14
|
+
:top="icon?.top"
|
|
15
|
+
:stop="icon?.stop"
|
|
16
|
+
:round="icon?.round"
|
|
17
|
+
:customStyle="icon?.customStyle"
|
|
18
|
+
></HyIcon>
|
|
6
19
|
<text v-if="text" class="hy-back-top__text">{{ text }}</text>
|
|
7
20
|
</view>
|
|
8
21
|
</slot>
|
|
9
22
|
</HyTransition>
|
|
10
23
|
</template>
|
|
11
24
|
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
export default {
|
|
27
|
+
name: 'hy-back-top',
|
|
28
|
+
options: {
|
|
29
|
+
addGlobalClass: true,
|
|
30
|
+
virtualHost: true,
|
|
31
|
+
styleIsolation: 'shared'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
12
36
|
<script setup lang="ts">
|
|
13
37
|
import { computed, type CSSProperties, toRefs } from "vue";
|
|
14
38
|
import defaultProps from "./props";
|
|
39
|
+
import { addUnit, getPx } from "../../utils";
|
|
40
|
+
import { IconConfig } from "@/package";
|
|
15
41
|
import type IProps from "./typing";
|
|
16
42
|
// 组件
|
|
17
43
|
import HyTransition from "../hy-transition/hy-transition.vue";
|
|
18
44
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
19
|
-
import { addUnit, getPx } from "../../utils";
|
|
20
45
|
|
|
21
46
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
22
47
|
const { customStyle, duration, mode, bottom, right, top, scrollTop } =
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
+
@use "../../theme.scss" as *;
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
/* 暗色主题 */
|
|
5
|
+
@include b(theme){
|
|
6
|
+
@include m(dark) {
|
|
7
|
+
@include b(back-top) {
|
|
8
|
+
background-color: $hy-dark-background--track;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@include b(back-top) {
|
|
4
14
|
@include flex;
|
|
5
15
|
flex-direction: column;
|
|
6
16
|
align-items: center;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type IProps from "./typing";
|
|
2
|
-
import { IconConfig } from "../../config";
|
|
3
2
|
|
|
4
3
|
const defaultProps: IProps = {
|
|
5
4
|
mode: "circle",
|
|
6
|
-
icon:
|
|
5
|
+
icon: {},
|
|
7
6
|
text: "",
|
|
8
7
|
duration: 500,
|
|
9
8
|
scrollTop: 0,
|
|
@@ -11,10 +10,6 @@ const defaultProps: IProps = {
|
|
|
11
10
|
bottom: 100,
|
|
12
11
|
right: 20,
|
|
13
12
|
zIndex: 888,
|
|
14
|
-
iconStyle: {
|
|
15
|
-
color: "#909399",
|
|
16
|
-
fontSize: "19px",
|
|
17
|
-
},
|
|
18
13
|
customStyle: {
|
|
19
14
|
transform: "rotate(180deg)",
|
|
20
15
|
},
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { CSSProperties } from "vue";
|
|
2
|
+
import type HyIconProps from "../hy-icon/typing";
|
|
2
3
|
|
|
3
|
-
export default interface
|
|
4
|
+
export default interface HyBackTopProps {
|
|
4
5
|
/**
|
|
5
6
|
* @description 返回顶部的形状,circle-圆形,square-方形 (默认 'circle' )
|
|
6
7
|
* */
|
|
7
8
|
mode?: HyApp.ShapeType;
|
|
8
9
|
/**
|
|
9
|
-
* @description
|
|
10
|
+
* @description 自定义图标属性集合
|
|
10
11
|
* */
|
|
11
|
-
icon?:
|
|
12
|
+
icon?: Partial<HyIconProps>;
|
|
12
13
|
/**
|
|
13
14
|
* @description 提示文字
|
|
14
15
|
* */
|
|
@@ -37,10 +38,6 @@ export default interface IProps {
|
|
|
37
38
|
* @description 层级 (默认 888 )
|
|
38
39
|
* */
|
|
39
40
|
zIndex?: number;
|
|
40
|
-
/**
|
|
41
|
-
* @description 图标的样式,对象形式 (默认 {color: '#909399',fontSize: '19px'})
|
|
42
|
-
* */
|
|
43
|
-
iconStyle?: CSSProperties;
|
|
44
41
|
/**
|
|
45
42
|
* @description 定义需要用到的外部样式(默认{transform: "rotate(180deg)"})
|
|
46
43
|
* */
|
|
@@ -13,6 +13,17 @@
|
|
|
13
13
|
>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
export default {
|
|
18
|
+
name: 'hy-badge',
|
|
19
|
+
options: {
|
|
20
|
+
addGlobalClass: true,
|
|
21
|
+
virtualHost: true,
|
|
22
|
+
styleIsolation: 'shared'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
16
27
|
<script setup lang="ts">
|
|
17
28
|
import type IProps from "./typing";
|
|
18
29
|
import defaultProps from "./props";
|
|
@@ -4,69 +4,47 @@
|
|
|
4
4
|
$hy-badge-dot-size: 8px !default;
|
|
5
5
|
$hy-badge-text-font-size: 11px !default;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@include b(badge) {
|
|
8
10
|
border-radius: 100px;
|
|
9
11
|
@include flex;
|
|
10
12
|
line-height: $hy-badge-text-font-size;
|
|
11
13
|
text-align: center;
|
|
12
14
|
font-size: $hy-badge-text-font-size;
|
|
13
|
-
color: $hy-text-color-inverse;
|
|
14
15
|
z-index: 999;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
@include m(dot) {
|
|
17
18
|
height: $hy-badge-dot-size;
|
|
18
19
|
width: $hy-badge-dot-size;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
@include m(inverted) {
|
|
22
23
|
font-size: 13px;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
@include m(not-dot) {
|
|
26
27
|
padding: 2px 5px;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
@include m(horn) {
|
|
30
31
|
border-bottom-left-radius: 0;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
&--primary--inverted {
|
|
38
|
-
color: $hy-primary;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&--error {
|
|
42
|
-
background-color: $hy-error;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&--error--inverted {
|
|
46
|
-
color: $hy-error;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&--success {
|
|
50
|
-
background-color: $hy-success;
|
|
51
|
-
}
|
|
34
|
+
/* 主题色 */
|
|
35
|
+
@include themeColor(primary, $hy-primary);
|
|
36
|
+
@include themeColor(primary--inverted, "", "", $hy-primary);
|
|
52
37
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
38
|
+
@include themeColor(error, $hy-error);
|
|
39
|
+
@include themeColor(error--inverted, "", "", $hy-error);
|
|
56
40
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
41
|
+
@include themeColor(success, $hy-success);
|
|
42
|
+
@include themeColor(success--inverted, "", "", $hy-success);
|
|
60
43
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
44
|
+
@include themeColor(warning, $hy-warning);
|
|
45
|
+
@include themeColor(warning--inverted, "", "", $hy-warning);
|
|
64
46
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
47
|
+
@include themeColor(info, $hy-info);
|
|
48
|
+
@include themeColor(info--inverted, "", "", $hy-info);
|
|
68
49
|
|
|
69
|
-
&--warning--inverted {
|
|
70
|
-
color: $hy-warning;
|
|
71
|
-
}
|
|
72
50
|
}
|
|
@@ -21,10 +21,9 @@
|
|
|
21
21
|
@launchapp="launchapp"
|
|
22
22
|
@agreeprivacyauthorization="agreeprivacyauthorization"
|
|
23
23
|
:hover-class="!disabled && !loading ? 'hy-button--active' : ''"
|
|
24
|
-
class="hy-button hy-reset-button"
|
|
25
24
|
:style="[baseColor, customStyle]"
|
|
26
25
|
@tap="clickHandler"
|
|
27
|
-
:class="bemClass"
|
|
26
|
+
:class="['hy-button', 'hy-reset-button', bemClass]"
|
|
28
27
|
>
|
|
29
28
|
<template v-if="loading">
|
|
30
29
|
<HyLoading
|
|
@@ -40,11 +39,19 @@
|
|
|
40
39
|
</template>
|
|
41
40
|
<template v-else>
|
|
42
41
|
<HyIcon
|
|
43
|
-
v-if="icon"
|
|
44
|
-
:name="icon"
|
|
42
|
+
v-if="icon?.name"
|
|
43
|
+
:name="icon?.name"
|
|
45
44
|
:color="iconColorCom"
|
|
46
|
-
:size="textSize * 1.35"
|
|
47
|
-
:
|
|
45
|
+
:size="icon?.size || textSize * 1.35"
|
|
46
|
+
:bold="icon?.bold"
|
|
47
|
+
:customPrefix="icon?.customPrefix"
|
|
48
|
+
:imgMode="icon?.imgMode"
|
|
49
|
+
:width="icon?.width"
|
|
50
|
+
:height="icon?.height"
|
|
51
|
+
:top="icon?.top"
|
|
52
|
+
:stop="icon?.stop"
|
|
53
|
+
:round="icon?.round"
|
|
54
|
+
:customStyle="icon?.customStyle || { marginRight: '2px' }"
|
|
48
55
|
></HyIcon>
|
|
49
56
|
<slot>
|
|
50
57
|
<text
|
|
@@ -74,11 +81,11 @@
|
|
|
74
81
|
:style="[baseColor, customStyle]"
|
|
75
82
|
>
|
|
76
83
|
<template v-if="loading">
|
|
77
|
-
<
|
|
84
|
+
<HyLoading
|
|
78
85
|
:mode="loadingMode"
|
|
79
|
-
:size="loadingSize
|
|
86
|
+
:size="loadingSize"
|
|
80
87
|
:color="loadingColor"
|
|
81
|
-
></
|
|
88
|
+
></HyLoading>
|
|
82
89
|
<text
|
|
83
90
|
class="hy-button__loading-text"
|
|
84
91
|
:style="[nvueTextStyle]"
|
|
@@ -88,10 +95,19 @@
|
|
|
88
95
|
</template>
|
|
89
96
|
<template v-else>
|
|
90
97
|
<HyIcon
|
|
91
|
-
v-if="icon"
|
|
92
|
-
:name="icon"
|
|
98
|
+
v-if="icon?.name"
|
|
99
|
+
:name="icon?.name"
|
|
93
100
|
:color="iconColorCom"
|
|
94
|
-
:size="textSize * 1.35"
|
|
101
|
+
:size="icon?.size || textSize * 1.35"
|
|
102
|
+
:bold="icon?.bold"
|
|
103
|
+
:customPrefix="icon?.customPrefix"
|
|
104
|
+
:imgMode="icon?.imgMode"
|
|
105
|
+
:width="icon?.width"
|
|
106
|
+
:height="icon?.height"
|
|
107
|
+
:top="icon?.top"
|
|
108
|
+
:stop="icon?.stop"
|
|
109
|
+
:round="icon?.round"
|
|
110
|
+
:customStyle="icon?.customStyle || { marginRight: '2px' }"
|
|
95
111
|
></HyIcon>
|
|
96
112
|
<text
|
|
97
113
|
class="hy-button__text"
|
|
@@ -109,6 +125,17 @@
|
|
|
109
125
|
<!-- #endif -->
|
|
110
126
|
</template>
|
|
111
127
|
|
|
128
|
+
<script lang="ts">
|
|
129
|
+
export default {
|
|
130
|
+
name: 'hy-button',
|
|
131
|
+
options: {
|
|
132
|
+
addGlobalClass: true,
|
|
133
|
+
virtualHost: true,
|
|
134
|
+
styleIsolation: 'shared'
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
</script>
|
|
138
|
+
|
|
112
139
|
<script setup lang="ts">
|
|
113
140
|
import { computed, type CSSProperties, toRefs } from "vue";
|
|
114
141
|
import { bem, throttle } from "../../utils";
|
|
@@ -130,7 +157,7 @@ const {
|
|
|
130
157
|
type,
|
|
131
158
|
plain,
|
|
132
159
|
color,
|
|
133
|
-
|
|
160
|
+
icon,
|
|
134
161
|
} = toRefs(props);
|
|
135
162
|
const emit = defineEmits([
|
|
136
163
|
"click",
|
|
@@ -181,11 +208,11 @@ const loadingColor = computed(() => {
|
|
|
181
208
|
const iconColorCom = computed((): string => {
|
|
182
209
|
// 如果是镂空状态,设置了color就用color值,否则使用主题颜色,
|
|
183
210
|
// u-icon的color能接受一个主题颜色的值
|
|
184
|
-
if (
|
|
211
|
+
if (icon.value?.color) return icon.value?.color;
|
|
185
212
|
if (plain.value) {
|
|
186
213
|
return color.value ? color.value : textColor;
|
|
187
214
|
} else {
|
|
188
|
-
return type.value
|
|
215
|
+
return (type.value = "#ffffff");
|
|
189
216
|
}
|
|
190
217
|
});
|
|
191
218
|
const baseColor = computed((): CSSProperties => {
|
|
@@ -195,7 +222,7 @@ const baseColor = computed((): CSSProperties => {
|
|
|
195
222
|
style.color = plain.value ? color.value : "white";
|
|
196
223
|
if (!plain.value) {
|
|
197
224
|
// 非镂空,背景色使用自定义的颜色
|
|
198
|
-
style["background
|
|
225
|
+
style["background"] = color.value;
|
|
199
226
|
}
|
|
200
227
|
if (color.value.indexOf("gradient") !== -1) {
|
|
201
228
|
// 如果自定义的颜色为渐变色,不显示边框,以及通过backgroundImage设置渐变色
|
|
@@ -216,7 +243,7 @@ const baseColor = computed((): CSSProperties => {
|
|
|
216
243
|
}
|
|
217
244
|
} else {
|
|
218
245
|
// 针对自定义了color颜色的情况,镂空状态下,就是用自定义的颜色
|
|
219
|
-
style.color = plain.value ? textColor : "";
|
|
246
|
+
// style.color = plain.value ? textColor : "";
|
|
220
247
|
}
|
|
221
248
|
return style;
|
|
222
249
|
});
|