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.
Files changed (229) hide show
  1. package/components/hy-address-picker/hy-address-picker.vue +31 -10
  2. package/components/hy-address-picker/index.scss +1 -1
  3. package/components/hy-address-picker/props.ts +1 -3
  4. package/components/hy-address-picker/typing.d.ts +4 -11
  5. package/components/hy-avatar/hy-avatar.vue +11 -0
  6. package/components/hy-avatar/index.scss +8 -8
  7. package/components/hy-avatar/typing.d.ts +1 -1
  8. package/components/hy-back-top/hy-back-top.vue +27 -2
  9. package/components/hy-back-top/index.scss +11 -1
  10. package/components/hy-back-top/props.ts +1 -6
  11. package/components/hy-back-top/typing.d.ts +4 -7
  12. package/components/hy-badge/hy-badge.vue +11 -0
  13. package/components/hy-badge/index.scss +18 -40
  14. package/components/hy-badge/typing.d.ts +1 -1
  15. package/components/hy-button/hy-button.vue +44 -17
  16. package/components/hy-button/index.scss +25 -45
  17. package/components/hy-button/props.ts +1 -2
  18. package/components/hy-button/typing.d.ts +4 -7
  19. package/components/hy-calendar/header.vue +12 -12
  20. package/components/hy-calendar/hy-calendar.vue +11 -2
  21. package/components/hy-calendar/index.scss +140 -131
  22. package/components/hy-calendar/month.vue +18 -18
  23. package/components/hy-calendar/typing.d.ts +1 -1
  24. package/components/hy-card/hy-card.vue +11 -0
  25. package/components/hy-card/index.scss +12 -12
  26. package/components/hy-card/props.ts +2 -2
  27. package/components/hy-card/typing.d.ts +1 -1
  28. package/components/hy-cell/hy-cell.vue +57 -19
  29. package/components/hy-cell/index.scss +55 -28
  30. package/components/hy-cell/props.ts +4 -5
  31. package/components/hy-cell/typing.d.ts +11 -21
  32. package/components/hy-check-button/hy-check-button.vue +13 -2
  33. package/components/hy-check-button/index.scss +0 -5
  34. package/components/hy-check-button/typing.d.ts +1 -1
  35. package/components/hy-checkbox/hy-checkbox.vue +34 -10
  36. package/components/hy-checkbox/index.scss +15 -5
  37. package/components/hy-checkbox/props.ts +2 -3
  38. package/components/hy-checkbox/typing.d.ts +3 -3
  39. package/components/hy-config-provider/hy-config-provider.vue +52 -0
  40. package/components/hy-config-provider/index.scss +21 -0
  41. package/components/hy-config-provider/props.ts +13 -0
  42. package/components/hy-config-provider/typing.d.ts +28 -0
  43. package/components/hy-count-down/hy-count-down.vue +11 -0
  44. package/components/hy-count-down/index.scss +13 -1
  45. package/components/hy-count-down/typing.d.ts +1 -1
  46. package/components/hy-count-to/hy-count-to.vue +12 -1
  47. package/components/hy-count-to/index.scss +14 -1
  48. package/components/hy-count-to/props.ts +1 -1
  49. package/components/hy-count-to/typing.d.ts +1 -3
  50. package/components/hy-datetime-picker/hy-datetime-picker.vue +29 -14
  51. package/components/hy-datetime-picker/index.scss +1 -1
  52. package/components/hy-datetime-picker/props.ts +1 -3
  53. package/components/hy-datetime-picker/typing.d.ts +6 -13
  54. package/components/hy-divider/hy-divider.vue +11 -0
  55. package/components/hy-divider/index.scss +1 -1
  56. package/components/hy-divider/typing.d.ts +1 -1
  57. package/components/hy-dropdown/hy-dropdown.vue +13 -1
  58. package/components/hy-dropdown/index.scss +4 -1
  59. package/components/hy-dropdown/props.ts +2 -2
  60. package/components/hy-dropdown/typing.d.ts +1 -1
  61. package/components/hy-dropdown-item/hy-dropdown-item.vue +21 -3
  62. package/components/hy-dropdown-item/index.scss +35 -2
  63. package/components/hy-dropdown-item/typing.d.ts +1 -3
  64. package/components/hy-empty/hy-empty.vue +22 -10
  65. package/components/hy-empty/index.scss +17 -3
  66. package/components/hy-empty/props.ts +1 -5
  67. package/components/hy-empty/typing.d.ts +4 -19
  68. package/components/hy-float-button/hy-float-button.vue +11 -0
  69. package/components/hy-float-button/index.scss +13 -2
  70. package/components/hy-float-button/props.ts +3 -3
  71. package/components/hy-float-button/typing.d.ts +1 -1
  72. package/components/hy-folding-panel/hy-folding-panel.vue +11 -0
  73. package/components/hy-folding-panel/index.scss +4 -1
  74. package/components/hy-folding-panel/typing.d.ts +1 -1
  75. package/components/hy-form/hy-form.vue +214 -36
  76. package/components/hy-form/index.scss +13 -3
  77. package/components/hy-form/props.ts +0 -2
  78. package/components/hy-form/typing.d.ts +25 -7
  79. package/components/hy-grid/hy-grid.vue +27 -5
  80. package/components/hy-grid/index.scss +1 -1
  81. package/components/hy-grid/props.ts +1 -3
  82. package/components/hy-grid/typing.d.ts +13 -16
  83. package/components/hy-icon/hy-icon.vue +17 -10
  84. package/components/hy-icon/index.scss +16 -7
  85. package/components/hy-icon/props.ts +2 -2
  86. package/components/hy-icon/typing.d.ts +1 -1
  87. package/components/hy-image/hy-image.vue +11 -0
  88. package/components/hy-image/index.scss +4 -3
  89. package/components/hy-image/typing.d.ts +1 -1
  90. package/components/hy-input/hy-input.vue +58 -19
  91. package/components/hy-input/index.scss +12 -2
  92. package/components/hy-input/props.ts +3 -5
  93. package/components/hy-input/typing.d.ts +13 -12
  94. package/components/hy-line/hy-line.vue +11 -0
  95. package/components/hy-line/index.scss +4 -1
  96. package/components/hy-line/typing.d.ts +1 -1
  97. package/components/hy-line-progress/hy-line-progress.vue +17 -2
  98. package/components/hy-line-progress/index.scss +20 -8
  99. package/components/hy-line-progress/props.ts +4 -4
  100. package/components/hy-line-progress/typing.d.ts +5 -1
  101. package/components/hy-list/hy-list.vue +23 -8
  102. package/components/hy-list/index.scss +1 -4
  103. package/components/hy-list/typing.d.ts +1 -1
  104. package/components/hy-loading/hy-loading.vue +11 -0
  105. package/components/hy-loading/index.scss +2 -2
  106. package/components/hy-loading/typing.d.ts +1 -2
  107. package/components/hy-login/TheUserLogin.vue +63 -106
  108. package/components/hy-login/hy-login.vue +15 -10
  109. package/components/hy-login/props.ts +1 -1
  110. package/components/hy-login/typing.d.ts +6 -1
  111. package/components/hy-modal/hy-modal.vue +15 -7
  112. package/components/hy-modal/index.scss +19 -3
  113. package/components/hy-modal/typing.d.ts +1 -1
  114. package/components/hy-navbar/hy-navbar.vue +11 -0
  115. package/components/hy-navbar/index.scss +14 -3
  116. package/components/hy-navbar/props.ts +1 -1
  117. package/components/hy-navbar/typing.d.ts +1 -2
  118. package/components/hy-notice-bar/hy-notice-bar.vue +11 -0
  119. package/components/hy-notice-bar/index.scss +35 -35
  120. package/components/hy-notice-bar/typing.d.ts +1 -1
  121. package/components/hy-number-step/hy-number-step.vue +40 -18
  122. package/components/hy-number-step/index.scss +34 -25
  123. package/components/hy-number-step/props.ts +4 -4
  124. package/components/hy-number-step/typing.d.ts +8 -3
  125. package/components/hy-overlay/index.scss +3 -1
  126. package/components/hy-overlay/typing.d.ts +1 -1
  127. package/components/hy-parse/typing.d.ts +1 -1
  128. package/components/hy-picker/hy-picker.vue +30 -8
  129. package/components/hy-picker/index.scss +7 -3
  130. package/components/hy-picker/props.ts +2 -5
  131. package/components/hy-picker/typing.d.ts +4 -15
  132. package/components/hy-popup/hy-popup.vue +11 -0
  133. package/components/hy-popup/index.scss +10 -1
  134. package/components/hy-popup/typing.d.ts +1 -1
  135. package/components/hy-price/hy-price.vue +11 -0
  136. package/components/hy-price/index.scss +4 -1
  137. package/components/hy-price/typing.d.ts +1 -1
  138. package/components/hy-qrcode/hy-qrcode.vue +11 -0
  139. package/components/hy-qrcode/index.scss +4 -1
  140. package/components/hy-qrcode/typing.d.ts +1 -1
  141. package/components/hy-radio/hy-radio.vue +25 -5
  142. package/components/hy-radio/index.scss +17 -5
  143. package/components/hy-radio/props.ts +2 -3
  144. package/components/hy-radio/typing.d.ts +2 -2
  145. package/components/hy-rate/hy-rate.vue +11 -0
  146. package/components/hy-rate/index.scss +6 -6
  147. package/components/hy-rate/typing.d.ts +1 -1
  148. package/components/hy-read-more/hy-read-more.vue +23 -2
  149. package/components/hy-read-more/index.scss +29 -2
  150. package/components/hy-read-more/props.ts +2 -7
  151. package/components/hy-read-more/typing.d.ts +1 -1
  152. package/components/hy-scroll-list/hy-scroll-list.vue +31 -9
  153. package/components/hy-scroll-list/index.scss +10 -1
  154. package/components/hy-scroll-list/props.ts +2 -2
  155. package/components/hy-scroll-list/typing.d.ts +1 -1
  156. package/components/hy-search/hy-search.vue +23 -3
  157. package/components/hy-search/index.scss +25 -4
  158. package/components/hy-search/props.ts +3 -5
  159. package/components/hy-search/typing.d.ts +6 -13
  160. package/components/hy-slider/hy-slider.vue +11 -0
  161. package/components/hy-slider/index.scss +3 -2
  162. package/components/hy-slider/props.ts +1 -1
  163. package/components/hy-slider/typing.d.ts +1 -1
  164. package/components/hy-status-bar/typing.d.ts +1 -1
  165. package/components/hy-steps/hy-steps.vue +38 -20
  166. package/components/hy-steps/index.scss +57 -17
  167. package/components/hy-steps/props.ts +2 -2
  168. package/components/hy-steps/typing.d.ts +1 -1
  169. package/components/{hy-submitBar/hy-submitBar.vue → hy-submit-bar/hy-submit-bar.vue} +13 -34
  170. package/components/hy-submit-bar/index.scss +45 -0
  171. package/components/{hy-submitBar → hy-submit-bar}/typing.d.ts +1 -1
  172. package/components/hy-subsection/hy-subsection.vue +12 -0
  173. package/components/hy-subsection/index.scss +28 -8
  174. package/components/hy-subsection/props.ts +3 -3
  175. package/components/hy-subsection/typing.d.ts +1 -1
  176. package/components/hy-swipe-action/typing.d.ts +1 -1
  177. package/components/hy-swiper/hy-swiper.vue +11 -0
  178. package/components/hy-swiper/index.scss +13 -2
  179. package/components/hy-swiper/typing.d.ts +2 -5
  180. package/components/hy-switch/hy-switch.vue +28 -5
  181. package/components/hy-switch/index.scss +25 -7
  182. package/components/hy-switch/props.ts +1 -3
  183. package/components/hy-switch/typing.d.ts +6 -5
  184. package/components/hy-tabs/hy-tabs.vue +27 -15
  185. package/components/hy-tabs/index.scss +25 -4
  186. package/components/hy-tabs/props.ts +4 -10
  187. package/components/hy-tabs/typing.d.ts +1 -1
  188. package/components/hy-tag/hy-tag.vue +38 -22
  189. package/components/hy-tag/index.scss +27 -115
  190. package/components/hy-tag/props.ts +1 -2
  191. package/components/hy-tag/typing.d.ts +3 -10
  192. package/components/hy-text/hy-text.vue +12 -1
  193. package/components/hy-text/index.scss +20 -37
  194. package/components/hy-text/typing.d.ts +1 -1
  195. package/components/hy-textarea/hy-textarea.vue +17 -6
  196. package/components/hy-textarea/index.scss +16 -5
  197. package/components/hy-textarea/typing.d.ts +2 -2
  198. package/components/hy-toast/hy-toast.vue +13 -2
  199. package/components/hy-toast/index.scss +26 -26
  200. package/components/hy-toast/typing.d.ts +1 -1
  201. package/components/hy-tooltip/hy-tooltip.vue +11 -0
  202. package/components/hy-tooltip/index.scss +3 -3
  203. package/components/hy-tooltip/props.ts +1 -1
  204. package/components/hy-tooltip/typing.d.ts +1 -1
  205. package/components/hy-transition/typing.d.ts +1 -1
  206. package/components/hy-upload/hy-upload.vue +11 -0
  207. package/components/hy-upload/index.scss +12 -1
  208. package/components/hy-upload/typing.d.ts +1 -1
  209. package/components/hy-warn/hy-warn.vue +22 -11
  210. package/components/hy-warn/index.scss +46 -1
  211. package/components/hy-warn/typing.d.ts +1 -1
  212. package/components/hy-waterfall/hy-waterfall.vue +11 -0
  213. package/components/hy-waterfall/index.scss +1 -1
  214. package/components/hy-waterfall/typing.d.ts +1 -3
  215. package/components/index.ts +2 -2
  216. package/config/icon.ts +4 -0
  217. package/libs/css/common.scss +9 -0
  218. package/libs/css/mixin.scss +78 -0
  219. package/package.json +3 -3
  220. package/public/font/iconfont.css +3 -3
  221. package/store/userInfo.ts +26 -25
  222. package/theme.scss +76 -60
  223. package/typing/modules/common.d.ts +5 -1
  224. package/typing/modules/form.ts +29 -14
  225. package/utils/colorGradient.ts +1 -1
  226. package/utils/inside.ts +3 -0
  227. package/components/hy-submitBar/Index.vue +0 -17
  228. package/components/hy-submitBar/index.scss +0 -9
  229. /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
- .hy-button {
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
- &--large {
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
- &--medium {
32
+ @include m(medium) {
33
33
  padding: 0 12px;
34
34
  font-size: 14px;
35
35
  }
36
36
 
37
- &--small {
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
- &--mini {
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
- &--disabled {
55
+ @include m(disabled) {
56
56
  opacity: 0.5;
57
57
  }
58
58
 
59
- &--info {
60
- color: #323233;
61
- background-color: #fff;
62
- border: 1px solid #909399;
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
- &--success {
66
- color: #fff;
67
- background-color: $hy-success;
68
- border: 1px solid $hy-success;
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
- &--block {
73
+ @include m(block) {
90
74
  @include flex;
91
75
  width: 100%;
92
76
  }
93
77
 
94
- &--circle {
95
- border-radius: 100px;
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
- &--plain {
109
- color: v-bind(textColor);
110
- background-color: #fff;
111
- }
87
+ //&--plain {
88
+ // //color: v-bind(textColor);
89
+ // color: $hy-primary;
90
+ // background-color: #fff;
91
+ //}
112
92
 
113
- &--hairline {
93
+ @include m(hairline) {
114
94
  border-width: 0.5px;
115
95
  }
116
96
  }
@@ -26,8 +26,7 @@ const defaultProps: IProps = {
26
26
  hoverStartTime: 0,
27
27
  hoverStayTime: 200,
28
28
  text: "",
29
- icon: "",
30
- iconColor: "",
29
+ icon: {},
31
30
  color: "",
32
31
  stop: true,
33
32
  };
@@ -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 IProps {
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?: string | HyIconConfig;
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="u-calendar-header u-border-bottom">
3
- <text class="u-calendar-header__title" v-if="showTitle">{{ title }}</text>
4
- <text class="u-calendar-header__subtitle" v-if="showSubtitle">{{
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="u-calendar-header__weekdays">
8
- <text class="u-calendar-header__weekdays__weekday">{{
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="u-calendar-header__weekdays__weekday">{{
11
+ <text class="hy-calendar-header__weekdays__weekday">{{
12
12
  weekText[1]
13
13
  }}</text>
14
- <text class="u-calendar-header__weekdays__weekday">{{
14
+ <text class="hy-calendar-header__weekdays__weekday">{{
15
15
  weekText[2]
16
16
  }}</text>
17
- <text class="u-calendar-header__weekdays__weekday">{{
17
+ <text class="hy-calendar-header__weekdays__weekday">{{
18
18
  weekText[3]
19
19
  }}</text>
20
- <text class="u-calendar-header__weekdays__weekday">{{
20
+ <text class="hy-calendar-header__weekdays__weekday">{{
21
21
  weekText[4]
22
22
  }}</text>
23
- <text class="u-calendar-header__weekdays__weekday">{{
23
+ <text class="hy-calendar-header__weekdays__weekday">{{
24
24
  weekText[5]
25
25
  }}</text>
26
- <text class="u-calendar-header__weekdays__weekday">{{
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: "u-calendar-header",
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="u-calendar">
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="u-calendar__confirm">
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
- .u-calendar {
6
- &__confirm {
7
- padding: 7px 18px;
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
- .u-calendar-header {
13
- display: flex;
14
- flex-direction: column;
15
- padding-bottom: 4px;
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
- &__subtitle {
27
- font-size: 14px;
28
- color: $u-main-color;
29
- height: 40px;
30
- text-align: center;
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
- &__weekdays {
36
- @include flex;
37
- justify-content: space-between;
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
- &__weekday {
40
- font-size: 13px;
41
- color: $u-main-color;
42
- line-height: 30px;
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
- .u-calendar-month-wrapper {
51
- margin-top: 4px;
52
- }
42
+ &__weekdays {
43
+ @include flex;
44
+ justify-content: space-between;
53
45
 
54
- .u-calendar-month {
55
- &__title {
56
- display: flex;
57
- flex-direction: column;
58
- font-size: 14px;
59
- line-height: 42px;
60
- height: 42px;
61
- color: $u-main-color;
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
- &__text {
82
- font-size: 155px;
83
- color: rgba(231, 232, 234, 0.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
- &__day {
74
+ &__days {
75
+ position: relative;
88
76
  @include flex;
89
- padding: 2px;
90
- /* #ifndef APP-NVUE */
91
- // vue下使用css进行宽度计算,因为某些安卓机会无法进行js获取父元素宽度进行计算得出,会有偏移
92
- width: calc(100% / 7);
93
- box-sizing: border-box;
94
- /* #endif */
95
-
96
- &__select {
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
- position: relative;
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
- &__buttom-info {
114
- color: $u-content-color;
115
- text-align: center;
116
- position: absolute;
117
- bottom: 5px;
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
- &--selected {
124
- color: #ffffff;
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
- &--disabled {
128
- color: #cacbcd;
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
- &__info {
133
- text-align: center;
134
- font-size: 16px;
140
+ &__info {
141
+ text-align: center;
142
+ font-size: 16px;
135
143
 
136
- &--selected {
137
- color: #ffffff;
138
- }
144
+ &--selected {
145
+ color: #ffffff;
146
+ }
139
147
 
140
- &--disabled {
141
- color: #cacbcd;
148
+ &--disabled {
149
+ color: $hy-info-dark;
150
+ }
142
151
  }
143
- }
144
152
 
145
- &--selected {
146
- background-color: $u-primary;
147
- @include flex;
148
- justify-content: center;
149
- align-items: center;
150
- flex: 1;
151
- border-radius: 3px;
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
- &--range-selected {
155
- opacity: 0.3;
156
- border-radius: 0;
157
- }
162
+ &--range-selected {
163
+ opacity: 0.3;
164
+ border-radius: 0;
165
+ }
158
166
 
159
- &--range-start-selected {
160
- border-top-right-radius: 0;
161
- border-bottom-right-radius: 0;
162
- }
167
+ &--range-start-selected {
168
+ border-top-right-radius: 0;
169
+ border-bottom-right-radius: 0;
170
+ }
163
171
 
164
- &--range-end-selected {
165
- border-top-left-radius: 0;
166
- border-bottom-left-radius: 0;
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="u-calendar-month-wrapper" ref="u-calendar-month-wrapper">
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="[`u-calendar-month-${index}`]"
7
- :ref="`u-calendar-month-${index}`"
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="u-calendar-month__title"
10
+ <text v-if="index !== 0" class="hy-calendar-month__title"
11
11
  >{{ item.year }}年{{ item.month }}月</text
12
12
  >
13
- <view class="u-calendar-month__days">
13
+ <view class="hy-calendar-month__days">
14
14
  <view
15
15
  v-if="showMark"
16
- class="u-calendar-month__days__month-mark-wrapper"
16
+ class="hy-calendar-month__days__month-mark-wrapper"
17
17
  >
18
- <text class="u-calendar-month__days__month-mark-wrapper__text">{{
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="u-calendar-month__days__day"
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 && 'u-calendar-month__days__day__select--selected',
29
+ item1.selected && 'hy-calendar-month__days__day__select--selected',
30
30
  ]"
31
31
  >
32
32
  <view
33
- class="u-calendar-month__days__day__select"
33
+ class="hy-calendar-month__days__day__select"
34
34
  :style="[daySelectStyle(index, index1, item1)]"
35
35
  >
36
36
  <text
37
- class="u-calendar-month__days__day__select__info"
37
+ class="hy-calendar-month__days__day__select__info"
38
38
  :class="[
39
39
  item1.disabled || isForbid(item1)
40
- ? 'u-calendar-month__days__day__select__info--disabled'
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="u-calendar-month__days__day__select__buttom-info"
48
+ class="hy-calendar-month__days__day__select__buttom-info"
49
49
  :class="[
50
50
  item1.disabled || isForbid(item1)
51
- ? 'u-calendar-month__days__day__select__buttom-info--disabled'
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="u-calendar-month__days__day__select__dot"
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: "u-calendar-month",
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(".u-calendar-month-wrapper").then((size) => {
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(`u-calendar-month-${index}`),
374
+ this.getMonthRectByPromise(`hy-calendar-month-${index}`),
375
375
  );
376
376
  // 一次性返回
377
377
  Promise.all(promiseAllArr).then((sizes) => {
@@ -1,4 +1,4 @@
1
- export default interface IProps {
1
+ export default interface HyCalendarProps {
2
2
  /**
3
3
  * @description 是否显示日历弹窗 (默认 false )
4
4
  * */
@@ -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";