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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
2
|
@use "../../theme.scss" as *;
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
@include b(button){
|
|
5
5
|
height: 40px;
|
|
6
6
|
position: relative;
|
|
7
7
|
align-items: center;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
margin-left: 4px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
@include m(large) {
|
|
25
25
|
/* #ifndef APP-NVUE */
|
|
26
26
|
width: 100%;
|
|
27
27
|
/* #endif */
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
padding: 0 15px;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
@include m(medium) {
|
|
33
33
|
padding: 0 12px;
|
|
34
34
|
font-size: 14px;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
@include m(small) {
|
|
38
38
|
/* #ifndef APP-NVUE */
|
|
39
39
|
min-width: 60px;
|
|
40
40
|
/* #endif */
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
font-size: 12px;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
@include m(mini) {
|
|
47
47
|
height: 22px;
|
|
48
48
|
font-size: 10px;
|
|
49
49
|
/* #ifndef APP-NVUE */
|
|
@@ -52,52 +52,31 @@
|
|
|
52
52
|
padding: 0 8px;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
@include m(disabled) {
|
|
56
56
|
opacity: 0.5;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
@include themeColor(info, $hy-info, $hy-info);
|
|
60
|
+
@include themeColor(success, $hy-success, $hy-success);
|
|
61
|
+
@include themeColor(primary, $hy-primary, $hy-primary);
|
|
62
|
+
@include themeColor(error, $hy-error, $hy-error);
|
|
63
|
+
@include themeColor(warning, $hy-warning, $hy-warning);
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
@include themeColor(info__plain, transparent, $hy-info, $hy-info);
|
|
66
|
+
@include themeColor(success__plain, transparent, $hy-success, $hy-success);
|
|
67
|
+
@include themeColor(primary__plain, transparent, $hy-primary, $hy-primary);
|
|
68
|
+
@include themeColor(error__plain, transparent, $hy-error, $hy-error);
|
|
69
|
+
@include themeColor(warning__plain, transparent, $hy-warning, $hy-warning);
|
|
70
70
|
|
|
71
|
-
&--primary {
|
|
72
|
-
color: #fff;
|
|
73
|
-
background-color: $hy-primary;
|
|
74
|
-
border: 1px solid $hy-primary;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&--error {
|
|
78
|
-
color: #fff;
|
|
79
|
-
background-color: $hy-error;
|
|
80
|
-
border: 1px solid $hy-error;
|
|
81
|
-
}
|
|
82
71
|
|
|
83
|
-
&--warning {
|
|
84
|
-
color: #fff;
|
|
85
|
-
background-color: $hy-warning;
|
|
86
|
-
border: 1px solid $hy-warning;
|
|
87
|
-
}
|
|
88
72
|
|
|
89
|
-
|
|
73
|
+
@include m(block) {
|
|
90
74
|
@include flex;
|
|
91
75
|
width: 100%;
|
|
92
76
|
}
|
|
93
77
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&--square {
|
|
99
|
-
border-radius: 3px;
|
|
100
|
-
}
|
|
78
|
+
@include borderRadio(circle);
|
|
79
|
+
@include borderRadio(square);
|
|
101
80
|
|
|
102
81
|
&__icon {
|
|
103
82
|
min-width: 1em;
|
|
@@ -105,12 +84,13 @@
|
|
|
105
84
|
vertical-align: top;
|
|
106
85
|
}
|
|
107
86
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
87
|
+
//&--plain {
|
|
88
|
+
// //color: v-bind(textColor);
|
|
89
|
+
// color: $hy-primary;
|
|
90
|
+
// background-color: #fff;
|
|
91
|
+
//}
|
|
112
92
|
|
|
113
|
-
|
|
93
|
+
@include m(hairline) {
|
|
114
94
|
border-width: 0.5px;
|
|
115
95
|
}
|
|
116
96
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
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 HyButtonProps {
|
|
4
5
|
/**
|
|
5
6
|
* @description 是否显示按钮的细边框 (默认 true )
|
|
6
7
|
* */
|
|
@@ -102,13 +103,9 @@ export default interface IProps {
|
|
|
102
103
|
* */
|
|
103
104
|
text?: string;
|
|
104
105
|
/**
|
|
105
|
-
* @description 按钮图标
|
|
106
|
+
* @description 按钮图标api集合
|
|
106
107
|
* */
|
|
107
|
-
icon?:
|
|
108
|
-
/**
|
|
109
|
-
* @description 按钮图标颜色
|
|
110
|
-
* */
|
|
111
|
-
iconColor?: string;
|
|
108
|
+
icon?: Partial<HyIconProps>;
|
|
112
109
|
/**
|
|
113
110
|
* @description 按钮颜色,支持传入linear-gradient渐变色
|
|
114
111
|
* */
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="
|
|
3
|
-
<text class="
|
|
4
|
-
<text class="
|
|
2
|
+
<view class="hy-calendar-header hy-border-bottom">
|
|
3
|
+
<text class="hy-calendar-header__title" v-if="showTitle">{{ title }}</text>
|
|
4
|
+
<text class="hy-calendar-header__subtitle" v-if="showSubtitle">{{
|
|
5
5
|
subtitle
|
|
6
6
|
}}</text>
|
|
7
|
-
<view class="
|
|
8
|
-
<text class="
|
|
7
|
+
<view class="hy-calendar-header__weekdays">
|
|
8
|
+
<text class="hy-calendar-header__weekdays__weekday">{{
|
|
9
9
|
weekText[0]
|
|
10
10
|
}}</text>
|
|
11
|
-
<text class="
|
|
11
|
+
<text class="hy-calendar-header__weekdays__weekday">{{
|
|
12
12
|
weekText[1]
|
|
13
13
|
}}</text>
|
|
14
|
-
<text class="
|
|
14
|
+
<text class="hy-calendar-header__weekdays__weekday">{{
|
|
15
15
|
weekText[2]
|
|
16
16
|
}}</text>
|
|
17
|
-
<text class="
|
|
17
|
+
<text class="hy-calendar-header__weekdays__weekday">{{
|
|
18
18
|
weekText[3]
|
|
19
19
|
}}</text>
|
|
20
|
-
<text class="
|
|
20
|
+
<text class="hy-calendar-header__weekdays__weekday">{{
|
|
21
21
|
weekText[4]
|
|
22
22
|
}}</text>
|
|
23
|
-
<text class="
|
|
23
|
+
<text class="hy-calendar-header__weekdays__weekday">{{
|
|
24
24
|
weekText[5]
|
|
25
25
|
}}</text>
|
|
26
|
-
<text class="
|
|
26
|
+
<text class="hy-calendar-header__weekdays__weekday">{{
|
|
27
27
|
weekText[6]
|
|
28
28
|
}}</text>
|
|
29
29
|
</view>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
<script>
|
|
34
34
|
export default {
|
|
35
|
-
name: "
|
|
35
|
+
name: "hy-calendar-header",
|
|
36
36
|
props: {
|
|
37
37
|
// 标题
|
|
38
38
|
title: {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
:round="round"
|
|
8
8
|
:closeOnClickOverlay="closeOnClickOverlay"
|
|
9
9
|
>
|
|
10
|
-
<view class="
|
|
10
|
+
<view class="hy-calendar">
|
|
11
11
|
<HyHeader
|
|
12
12
|
:title="title"
|
|
13
13
|
:subtitle="subtitle"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
></HyMount>
|
|
51
51
|
</scroll-view>
|
|
52
52
|
<slot name="footer" v-if="showConfirm">
|
|
53
|
-
<view class="
|
|
53
|
+
<view class="hy-calendar__confirm">
|
|
54
54
|
<HyButton
|
|
55
55
|
shape="circle"
|
|
56
56
|
:text="buttonDisabled ? confirmDisabledText : confirmText"
|
|
@@ -64,6 +64,15 @@
|
|
|
64
64
|
</HyPopup>
|
|
65
65
|
</template>
|
|
66
66
|
|
|
67
|
+
<script lang="ts">
|
|
68
|
+
export default {
|
|
69
|
+
name: "hy-calendar",
|
|
70
|
+
options: {
|
|
71
|
+
virtualHost: true,
|
|
72
|
+
styleIsolation: "shared",
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
</script>
|
|
67
76
|
<script setup lang="ts">
|
|
68
77
|
import type IProps from "./typing";
|
|
69
78
|
import defaultProps from "./props";
|
|
@@ -1,169 +1,178 @@
|
|
|
1
1
|
@use "../../libs/css/mixin.scss" as *;
|
|
2
2
|
@use "../../theme.scss" as *;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
@include b(theme) {
|
|
5
|
+
@include m(dark) {
|
|
6
|
+
background-color: $hy-dark-background;
|
|
7
|
+
color: $hy-dark-color;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
&__title {
|
|
18
|
-
font-size: 16px;
|
|
19
|
-
color: $hy-color-title;
|
|
20
|
-
text-align: center;
|
|
21
|
-
height: 42px;
|
|
22
|
-
line-height: 42px;
|
|
23
|
-
font-weight: bold;
|
|
11
|
+
/* 主样式 */
|
|
12
|
+
@include b(calendar){
|
|
13
|
+
/* 确认按钮 */
|
|
14
|
+
&__confirm {
|
|
15
|
+
padding: 7px 18px;
|
|
24
16
|
}
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
line-height: 40px;
|
|
32
|
-
font-weight: bold;
|
|
33
|
-
}
|
|
18
|
+
/* 头部样式 */
|
|
19
|
+
&-header {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
padding-bottom: 4px;
|
|
34
23
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
&__title {
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
color: $hy-color-title;
|
|
27
|
+
text-align: center;
|
|
28
|
+
height: 42px;
|
|
29
|
+
line-height: 42px;
|
|
30
|
+
font-weight: bold;
|
|
31
|
+
}
|
|
38
32
|
|
|
39
|
-
&
|
|
40
|
-
font-size:
|
|
41
|
-
color: $
|
|
42
|
-
|
|
43
|
-
flex: 1;
|
|
33
|
+
&__subtitle {
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
color: $hy-color-hint;
|
|
36
|
+
height: 40px;
|
|
44
37
|
text-align: center;
|
|
38
|
+
line-height: 40px;
|
|
39
|
+
font-weight: bold;
|
|
45
40
|
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
41
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
42
|
+
&__weekdays {
|
|
43
|
+
@include flex;
|
|
44
|
+
justify-content: space-between;
|
|
53
45
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
text-align: center;
|
|
63
|
-
font-weight: bold;
|
|
46
|
+
&__weekday {
|
|
47
|
+
font-size: 13px;
|
|
48
|
+
color: $hy-tips-color;
|
|
49
|
+
line-height: 30px;
|
|
50
|
+
flex: 1;
|
|
51
|
+
text-align: center;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
64
54
|
}
|
|
65
55
|
|
|
66
|
-
&__days {
|
|
67
|
-
position: relative;
|
|
68
|
-
@include flex;
|
|
69
|
-
flex-wrap: wrap;
|
|
70
|
-
|
|
71
|
-
&__month-mark-wrapper {
|
|
72
|
-
position: absolute;
|
|
73
|
-
top: 0;
|
|
74
|
-
bottom: 0;
|
|
75
|
-
left: 0;
|
|
76
|
-
right: 0;
|
|
77
|
-
@include flex;
|
|
78
|
-
justify-content: center;
|
|
79
|
-
align-items: center;
|
|
80
56
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
57
|
+
&-month {
|
|
58
|
+
&__title {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
font-size: 14px;
|
|
62
|
+
line-height: 42px;
|
|
63
|
+
height: 42px;
|
|
64
|
+
color: $hy-color-hint;
|
|
65
|
+
text-align: center;
|
|
66
|
+
font-weight: bold;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* 内容样式 */
|
|
70
|
+
&-wrapper {
|
|
71
|
+
margin-top: 4px;
|
|
85
72
|
}
|
|
86
73
|
|
|
87
|
-
&
|
|
74
|
+
&__days {
|
|
75
|
+
position: relative;
|
|
88
76
|
@include flex;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
flex: 1;
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
|
|
79
|
+
&__month-mark-wrapper {
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: 0;
|
|
82
|
+
bottom: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
right: 0;
|
|
98
85
|
@include flex;
|
|
99
|
-
align-items: center;
|
|
100
86
|
justify-content: center;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
&__dot {
|
|
104
|
-
width: 7px;
|
|
105
|
-
height: 7px;
|
|
106
|
-
border-radius: 100px;
|
|
107
|
-
background-color: $u-error;
|
|
108
|
-
position: absolute;
|
|
109
|
-
top: 12px;
|
|
110
|
-
right: 7px;
|
|
111
|
-
}
|
|
87
|
+
align-items: center;
|
|
112
88
|
|
|
113
|
-
&
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
font-size: 10px;
|
|
119
|
-
text-align: center;
|
|
120
|
-
left: 0;
|
|
121
|
-
right: 0;
|
|
89
|
+
&__text {
|
|
90
|
+
font-size: 155px;
|
|
91
|
+
color: $hy-info-dark;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
122
94
|
|
|
123
|
-
|
|
124
|
-
|
|
95
|
+
&__day {
|
|
96
|
+
@include flex;
|
|
97
|
+
padding: 2px;
|
|
98
|
+
/* #ifndef APP-NVUE */
|
|
99
|
+
// vue下使用css进行宽度计算,因为某些安卓机会无法进行js获取父元素宽度进行计算得出,会有偏移
|
|
100
|
+
width: calc(100% / 7);
|
|
101
|
+
box-sizing: border-box;
|
|
102
|
+
/* #endif */
|
|
103
|
+
|
|
104
|
+
&__select {
|
|
105
|
+
flex: 1;
|
|
106
|
+
@include flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
position: relative;
|
|
110
|
+
|
|
111
|
+
&__dot {
|
|
112
|
+
width: 7px;
|
|
113
|
+
height: 7px;
|
|
114
|
+
border-radius: 100px;
|
|
115
|
+
background-color: $hy-error;
|
|
116
|
+
position: absolute;
|
|
117
|
+
top: 12px;
|
|
118
|
+
right: 7px;
|
|
125
119
|
}
|
|
126
120
|
|
|
127
|
-
|
|
128
|
-
color:
|
|
121
|
+
&__buttom-info {
|
|
122
|
+
color: $hy-color-hint;
|
|
123
|
+
text-align: center;
|
|
124
|
+
position: absolute;
|
|
125
|
+
bottom: 5px;
|
|
126
|
+
font-size: 10px;
|
|
127
|
+
text-align: center;
|
|
128
|
+
left: 0;
|
|
129
|
+
right: 0;
|
|
130
|
+
|
|
131
|
+
&--selected {
|
|
132
|
+
color: #ffffff;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&--disabled {
|
|
136
|
+
color: #cacbcd;
|
|
137
|
+
}
|
|
129
138
|
}
|
|
130
|
-
}
|
|
131
139
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
&__info {
|
|
141
|
+
text-align: center;
|
|
142
|
+
font-size: 16px;
|
|
135
143
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
144
|
+
&--selected {
|
|
145
|
+
color: #ffffff;
|
|
146
|
+
}
|
|
139
147
|
|
|
140
|
-
|
|
141
|
-
|
|
148
|
+
&--disabled {
|
|
149
|
+
color: $hy-info-dark;
|
|
150
|
+
}
|
|
142
151
|
}
|
|
143
|
-
}
|
|
144
152
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
&--selected {
|
|
154
|
+
background-color: var(--hy-theme-dark, $hy-primary);
|
|
155
|
+
@include flex;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
align-items: center;
|
|
158
|
+
flex: 1;
|
|
159
|
+
border-radius: 3px;
|
|
160
|
+
}
|
|
153
161
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
162
|
+
&--range-selected {
|
|
163
|
+
opacity: 0.3;
|
|
164
|
+
border-radius: 0;
|
|
165
|
+
}
|
|
158
166
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
167
|
+
&--range-start-selected {
|
|
168
|
+
border-top-right-radius: 0;
|
|
169
|
+
border-bottom-right-radius: 0;
|
|
170
|
+
}
|
|
163
171
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
172
|
+
&--range-end-selected {
|
|
173
|
+
border-top-left-radius: 0;
|
|
174
|
+
border-bottom-left-radius: 0;
|
|
175
|
+
}
|
|
167
176
|
}
|
|
168
177
|
}
|
|
169
178
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="
|
|
2
|
+
<view class="hy-calendar-month-wrapper" ref="hy-calendar-month-wrapper">
|
|
3
3
|
<view
|
|
4
4
|
v-for="(item, index) in months"
|
|
5
5
|
:key="index"
|
|
6
|
-
:class="[`
|
|
7
|
-
:ref="`
|
|
6
|
+
:class="[`hy-calendar-month-${index}`]"
|
|
7
|
+
:ref="`hy-calendar-month-${index}`"
|
|
8
8
|
:id="`month-${index}`"
|
|
9
9
|
>
|
|
10
|
-
<text v-if="index !== 0" class="
|
|
10
|
+
<text v-if="index !== 0" class="hy-calendar-month__title"
|
|
11
11
|
>{{ item.year }}年{{ item.month }}月</text
|
|
12
12
|
>
|
|
13
|
-
<view class="
|
|
13
|
+
<view class="hy-calendar-month__days">
|
|
14
14
|
<view
|
|
15
15
|
v-if="showMark"
|
|
16
|
-
class="
|
|
16
|
+
class="hy-calendar-month__days__month-mark-wrapper"
|
|
17
17
|
>
|
|
18
|
-
<text class="
|
|
18
|
+
<text class="hy-calendar-month__days__month-mark-wrapper__text">{{
|
|
19
19
|
item.month
|
|
20
20
|
}}</text>
|
|
21
21
|
</view>
|
|
22
22
|
<view
|
|
23
|
-
class="
|
|
23
|
+
class="hy-calendar-month__days__day"
|
|
24
24
|
v-for="(item1, index1) in item.date"
|
|
25
25
|
:key="index1"
|
|
26
26
|
:style="[dayStyle(index, index1, item1)]"
|
|
27
27
|
@tap="clickHandler(index, index1, item1)"
|
|
28
28
|
:class="[
|
|
29
|
-
item1.selected && '
|
|
29
|
+
item1.selected && 'hy-calendar-month__days__day__select--selected',
|
|
30
30
|
]"
|
|
31
31
|
>
|
|
32
32
|
<view
|
|
33
|
-
class="
|
|
33
|
+
class="hy-calendar-month__days__day__select"
|
|
34
34
|
:style="[daySelectStyle(index, index1, item1)]"
|
|
35
35
|
>
|
|
36
36
|
<text
|
|
37
|
-
class="
|
|
37
|
+
class="hy-calendar-month__days__day__select__info"
|
|
38
38
|
:class="[
|
|
39
39
|
item1.disabled || isForbid(item1)
|
|
40
|
-
? '
|
|
40
|
+
? 'hy-calendar-month__days__day__select__info--disabled'
|
|
41
41
|
: '',
|
|
42
42
|
]"
|
|
43
43
|
:style="[textStyle(item1)]"
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
>
|
|
46
46
|
<text
|
|
47
47
|
v-if="getBottomInfo(index, index1, item1)"
|
|
48
|
-
class="
|
|
48
|
+
class="hy-calendar-month__days__day__select__buttom-info"
|
|
49
49
|
:class="[
|
|
50
50
|
item1.disabled || isForbid(item1)
|
|
51
|
-
? '
|
|
51
|
+
? 'hy-calendar-month__days__day__select__buttom-info--disabled'
|
|
52
52
|
: '',
|
|
53
53
|
]"
|
|
54
54
|
:style="[textStyle(item1)]"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
>
|
|
57
57
|
<text
|
|
58
58
|
v-if="item1.dot"
|
|
59
|
-
class="
|
|
59
|
+
class="hy-calendar-month__days__day__select__dot"
|
|
60
60
|
></text>
|
|
61
61
|
</view>
|
|
62
62
|
</view>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
import { addUnit, colorGradient, deepClone, getRect, sleep } from "../../utils";
|
|
70
70
|
import dayjs from "dayjs/esm/index";
|
|
71
71
|
export default {
|
|
72
|
-
name: "
|
|
72
|
+
name: "hy-calendar-month",
|
|
73
73
|
props: {
|
|
74
74
|
// 是否显示月份背景色
|
|
75
75
|
showMark: {
|
|
@@ -363,7 +363,7 @@ export default {
|
|
|
363
363
|
// 获取月份数据区域的宽度,因为nvue不支持百分比,所以无法通过css设置每个日期item的宽度
|
|
364
364
|
getWrapperWidth() {
|
|
365
365
|
// #ifndef APP-NVUE
|
|
366
|
-
getRect(".
|
|
366
|
+
getRect(".hy-calendar-month-wrapper").then((size) => {
|
|
367
367
|
this.width = size.width;
|
|
368
368
|
});
|
|
369
369
|
// #endif
|
|
@@ -371,7 +371,7 @@ export default {
|
|
|
371
371
|
getMonthRect() {
|
|
372
372
|
// 获取每个月份数据的尺寸,用于父组件在scroll-view滚动事件中,监听当前滚动到了第几个月份
|
|
373
373
|
const promiseAllArr = this.months.map((item, index) =>
|
|
374
|
-
this.getMonthRectByPromise(`
|
|
374
|
+
this.getMonthRectByPromise(`hy-calendar-month-${index}`),
|
|
375
375
|
);
|
|
376
376
|
// 一次性返回
|
|
377
377
|
Promise.all(promiseAllArr).then((sizes) => {
|
|
@@ -70,6 +70,17 @@
|
|
|
70
70
|
</view>
|
|
71
71
|
</template>
|
|
72
72
|
|
|
73
|
+
<script lang="ts">
|
|
74
|
+
export default {
|
|
75
|
+
name: 'hy-card',
|
|
76
|
+
options: {
|
|
77
|
+
addGlobalClass: true,
|
|
78
|
+
virtualHost: true,
|
|
79
|
+
styleIsolation: 'shared'
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
</script>
|
|
83
|
+
|
|
73
84
|
<script setup lang="ts">
|
|
74
85
|
import defaultProps from "./props";
|
|
75
86
|
import type IProps from "./typing";
|