hy-app 0.1.1 → 0.1.3

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 (264) hide show
  1. package/README.md +1 -1
  2. package/api/http.ts +8 -8
  3. package/components/dialog/index.ts +2 -2
  4. package/components/hy-address-picker/hy-address-picker.vue +14 -42
  5. package/components/hy-address-picker/index.scss +27 -0
  6. package/components/hy-address-picker/props.ts +2 -3
  7. package/components/hy-address-picker/typing.d.ts +1 -2
  8. package/components/hy-avatar/hy-avatar.vue +10 -54
  9. package/components/hy-avatar/index.scss +45 -0
  10. package/components/hy-avatar/props.ts +2 -2
  11. package/components/hy-avatar/typing.d.ts +2 -2
  12. package/components/hy-back-top/hy-back-top.vue +7 -22
  13. package/components/hy-back-top/index.scss +16 -0
  14. package/components/hy-back-top/props.ts +4 -4
  15. package/components/hy-back-top/typing.d.ts +2 -3
  16. package/components/hy-badge/hy-badge.vue +5 -75
  17. package/components/hy-badge/index.scss +72 -0
  18. package/components/hy-badge/props.ts +2 -2
  19. package/components/hy-badge/typing.d.ts +2 -2
  20. package/components/hy-button/hy-button.vue +22 -134
  21. package/components/hy-button/index.scss +116 -0
  22. package/components/hy-button/props.ts +4 -5
  23. package/components/hy-button/typing.d.ts +3 -3
  24. package/components/hy-calendar/header.vue +76 -0
  25. package/components/hy-calendar/hy-calendar.vue +366 -0
  26. package/components/hy-calendar/index.scss +171 -0
  27. package/components/hy-calendar/month.vue +524 -0
  28. package/components/hy-calendar/props.ts +37 -0
  29. package/components/hy-calendar/typing.d.ts +126 -0
  30. package/components/hy-card/hy-card.vue +21 -84
  31. package/components/hy-card/index.scss +57 -0
  32. package/components/hy-card/props.ts +2 -2
  33. package/components/hy-card/typing.d.ts +1 -1
  34. package/components/hy-cell/hy-cell.vue +30 -131
  35. package/components/hy-cell/index.scss +137 -0
  36. package/components/hy-cell/props.ts +2 -2
  37. package/components/hy-cell/typing.d.ts +4 -3
  38. package/components/hy-check-button/hy-check-button.vue +14 -7
  39. package/components/hy-check-button/index.scss +5 -0
  40. package/components/hy-check-button/props.ts +3 -3
  41. package/components/hy-checkbox/hy-checkbox.vue +24 -107
  42. package/components/hy-checkbox/index.scss +94 -0
  43. package/components/hy-checkbox/props.ts +4 -5
  44. package/components/hy-checkbox/typing.d.ts +3 -7
  45. package/components/hy-count-down/hy-count-down.vue +150 -0
  46. package/components/hy-count-down/index.scss +6 -0
  47. package/components/hy-count-down/index.ts +52 -0
  48. package/components/hy-count-down/props.ts +10 -0
  49. package/components/hy-count-down/typing.d.ts +20 -0
  50. package/components/hy-count-to/hy-count-to.vue +213 -0
  51. package/components/hy-count-to/index.scss +6 -0
  52. package/components/hy-count-to/props.ts +17 -0
  53. package/components/hy-count-to/typing.d.ts +48 -0
  54. package/components/hy-datetime-picker/hy-datetime-picker.vue +38 -64
  55. package/components/hy-datetime-picker/index.scss +28 -0
  56. package/components/hy-datetime-picker/props.ts +2 -2
  57. package/components/hy-datetime-picker/typing.d.ts +1 -1
  58. package/components/hy-divider/hy-divider.vue +24 -49
  59. package/components/hy-divider/index.scss +25 -0
  60. package/components/hy-divider/props.ts +2 -2
  61. package/components/hy-divider/typing.d.ts +1 -1
  62. package/components/hy-dropdown/hy-dropdown.vue +43 -0
  63. package/components/hy-dropdown/index.scss +17 -0
  64. package/components/hy-dropdown/props.ts +17 -0
  65. package/components/hy-dropdown/typing.d.ts +48 -0
  66. package/components/hy-dropdown-item/hy-dropdown-item.vue +194 -0
  67. package/components/hy-dropdown-item/index.scss +96 -0
  68. package/components/hy-dropdown-item/props.ts +10 -0
  69. package/components/hy-dropdown-item/typing.d.ts +31 -0
  70. package/components/hy-empty/hy-empty.vue +8 -26
  71. package/components/hy-empty/index.scss +19 -0
  72. package/components/hy-empty/props.ts +2 -2
  73. package/components/hy-empty/typing.d.ts +1 -1
  74. package/components/hy-float-button/hy-float-button.vue +201 -0
  75. package/components/hy-float-button/index.scss +69 -0
  76. package/components/hy-float-button/props.ts +25 -0
  77. package/components/hy-float-button/typing.d.ts +93 -0
  78. package/components/hy-folding-panel/hy-folding-panel.vue +9 -12
  79. package/components/hy-folding-panel/index.scss +6 -0
  80. package/components/hy-folding-panel/props.ts +2 -2
  81. package/components/hy-folding-panel/typing.d.ts +2 -2
  82. package/components/hy-form/hy-form.vue +22 -39
  83. package/components/hy-form/index.scss +30 -0
  84. package/components/hy-form/props.ts +4 -2
  85. package/components/hy-form/typing.d.ts +10 -2
  86. package/components/hy-grid/hy-grid.vue +4 -45
  87. package/components/hy-grid/index.scss +40 -0
  88. package/components/hy-grid/props.ts +5 -5
  89. package/components/hy-grid/typing.d.ts +2 -2
  90. package/components/hy-icon/hy-icon.vue +7 -97
  91. package/components/hy-icon/index.scss +84 -0
  92. package/components/hy-icon/props.ts +5 -5
  93. package/components/hy-image/hy-image.vue +212 -0
  94. package/components/hy-image/index.scss +26 -0
  95. package/components/hy-image/props.ts +24 -0
  96. package/components/hy-image/typing.d.ts +76 -0
  97. package/components/hy-input/hy-input.vue +11 -82
  98. package/components/hy-input/index.scss +65 -0
  99. package/components/hy-input/props.ts +2 -2
  100. package/components/hy-input/typing.d.ts +2 -2
  101. package/components/hy-line/hy-line.vue +4 -8
  102. package/components/hy-line/index.scss +5 -0
  103. package/components/hy-line/props.ts +3 -3
  104. package/components/hy-line/typing.d.ts +2 -2
  105. package/components/hy-line-progress/hy-line-progress.vue +15 -44
  106. package/components/hy-line-progress/index.scss +38 -0
  107. package/components/hy-line-progress/props.ts +2 -2
  108. package/components/hy-line-progress/typing.d.ts +1 -1
  109. package/components/hy-list/hy-list.vue +11 -41
  110. package/components/hy-list/index.scss +32 -0
  111. package/components/hy-list/props.ts +2 -2
  112. package/components/hy-loading/hy-loading.vue +95 -0
  113. package/components/hy-loading/index.scss +103 -0
  114. package/components/hy-loading/props.ts +17 -0
  115. package/components/hy-loading/typing.d.ts +52 -0
  116. package/components/hy-login/TheUserLogin.vue +16 -16
  117. package/components/hy-login/hy-login.vue +9 -9
  118. package/components/hy-login/props.ts +4 -4
  119. package/components/hy-modal/hy-modal.vue +11 -89
  120. package/components/hy-modal/index.scss +77 -0
  121. package/components/hy-modal/props.ts +2 -2
  122. package/components/hy-modal/typing.d.ts +1 -1
  123. package/components/hy-navbar/hy-navbar.vue +20 -92
  124. package/components/hy-navbar/index.scss +67 -0
  125. package/components/hy-navbar/props.ts +2 -2
  126. package/components/hy-navbar/typing.d.ts +1 -1
  127. package/components/hy-notice-bar/hy-column-notice.vue +11 -39
  128. package/components/hy-notice-bar/hy-notice-bar.vue +10 -12
  129. package/components/hy-notice-bar/hy-row-notice.vue +5 -56
  130. package/components/hy-notice-bar/index.scss +93 -0
  131. package/components/hy-notice-bar/props.ts +4 -2
  132. package/components/hy-notice-bar/typing.d.ts +13 -3
  133. package/components/hy-number-step/hy-number-step.vue +55 -105
  134. package/components/hy-number-step/index.scss +71 -0
  135. package/components/hy-number-step/props.ts +2 -2
  136. package/components/hy-number-step/typing.d.ts +1 -1
  137. package/components/hy-overlay/hy-overlay.vue +5 -17
  138. package/components/hy-overlay/index.scss +9 -0
  139. package/components/hy-overlay/props.ts +2 -2
  140. package/components/hy-overlay/typing.d.ts +1 -1
  141. package/components/hy-picker/hy-picker.vue +21 -87
  142. package/components/hy-picker/index.scss +68 -0
  143. package/components/hy-picker/props.ts +3 -2
  144. package/components/hy-picker/typing.d.ts +5 -1
  145. package/components/hy-popup/hy-popup.vue +7 -80
  146. package/components/hy-popup/index.scss +60 -0
  147. package/components/hy-popup/props.ts +2 -2
  148. package/components/hy-popup/typing.d.ts +1 -1
  149. package/components/hy-price/hy-price.vue +5 -15
  150. package/components/hy-price/index.scss +11 -0
  151. package/components/hy-price/props.ts +2 -2
  152. package/components/hy-price/typing.d.ts +1 -1
  153. package/components/hy-qrcode/hy-qrcode.vue +15 -37
  154. package/components/hy-qrcode/index.scss +23 -0
  155. package/components/hy-qrcode/props.ts +2 -2
  156. package/components/hy-qrcode/typing.d.ts +2 -2
  157. package/components/hy-radio/hy-radio.vue +27 -113
  158. package/components/hy-radio/index.scss +93 -0
  159. package/components/hy-radio/props.ts +4 -4
  160. package/components/hy-radio/typing.d.ts +2 -2
  161. package/components/hy-rate/hy-rate.vue +33 -53
  162. package/components/hy-rate/index.scss +33 -0
  163. package/components/hy-rate/props.ts +4 -3
  164. package/components/hy-rate/typing.d.ts +1 -1
  165. package/components/hy-read-more/hy-read-more.vue +7 -30
  166. package/components/hy-read-more/index.scss +25 -0
  167. package/components/hy-read-more/props.ts +3 -3
  168. package/components/hy-read-more/typing.d.ts +1 -1
  169. package/components/hy-safe-bottom/hy-safe-bottom.vue +5 -9
  170. package/components/hy-safe-bottom/index.scss +5 -0
  171. package/components/hy-scroll-list/hy-scroll-list.vue +13 -43
  172. package/components/hy-scroll-list/index.scss +34 -0
  173. package/components/hy-scroll-list/props.ts +2 -2
  174. package/components/hy-scroll-list/typing.d.ts +1 -1
  175. package/components/hy-search/hy-search.vue +12 -94
  176. package/components/hy-search/index.scss +83 -0
  177. package/components/hy-search/props.ts +2 -2
  178. package/components/hy-search/typing.d.ts +1 -2
  179. package/components/hy-slider/hy-slider.vue +42 -119
  180. package/components/hy-slider/index.scss +77 -0
  181. package/components/hy-slider/props.ts +2 -2
  182. package/components/hy-status-bar/hy-status-bar.vue +41 -0
  183. package/components/hy-status-bar/index.scss +6 -0
  184. package/components/hy-status-bar/props.ts +8 -0
  185. package/components/hy-status-bar/typing.d.ts +12 -0
  186. package/components/hy-steps/hy-steps.vue +36 -163
  187. package/components/hy-steps/index.scss +131 -0
  188. package/components/hy-steps/props.ts +2 -2
  189. package/components/hy-steps/typing.d.ts +2 -2
  190. package/components/hy-subsection/hy-subsection.vue +62 -125
  191. package/components/hy-subsection/index.scss +82 -0
  192. package/components/hy-subsection/props.ts +7 -3
  193. package/components/hy-subsection/typing.d.ts +20 -8
  194. package/components/hy-swipe-action/hy-swipe-action.vue +294 -0
  195. package/components/hy-swipe-action/index.scss +9 -0
  196. package/components/hy-swipe-action/index.wxs +235 -0
  197. package/components/hy-swipe-action/props.ts +16 -0
  198. package/components/hy-swipe-action/typing.d.ts +55 -0
  199. package/components/hy-swipe-action/wxs.js +15 -0
  200. package/components/hy-swiper/hy-swiper-indicator.vue +5 -35
  201. package/components/hy-swiper/hy-swiper.vue +45 -65
  202. package/components/hy-swiper/index.scss +82 -0
  203. package/components/hy-swiper/props.ts +3 -3
  204. package/components/hy-swiper/typing.d.ts +7 -4
  205. package/components/hy-switch/hy-switch.vue +65 -68
  206. package/components/hy-switch/index.scss +46 -0
  207. package/components/hy-switch/props.ts +6 -3
  208. package/components/hy-switch/typing.d.ts +14 -1
  209. package/components/hy-tabs/hy-tabs.vue +22 -81
  210. package/components/hy-tabs/index.scss +63 -0
  211. package/components/hy-tabs/props.ts +5 -5
  212. package/components/hy-tabs/typing.d.ts +1 -1
  213. package/components/hy-tag/hy-tag.vue +15 -230
  214. package/components/hy-tag/index.scss +204 -0
  215. package/components/hy-tag/props.ts +2 -2
  216. package/components/hy-tag/typing.d.ts +2 -2
  217. package/components/hy-text/hy-text.vue +238 -0
  218. package/components/hy-text/index.scss +70 -0
  219. package/components/hy-text/index.ts +0 -0
  220. package/components/hy-text/props.ts +30 -0
  221. package/components/hy-text/typing.d.ts +98 -0
  222. package/components/hy-textarea/hy-textarea.vue +13 -51
  223. package/components/hy-textarea/index.scss +40 -0
  224. package/components/hy-textarea/props.ts +2 -2
  225. package/components/hy-textarea/typing.d.ts +1 -1
  226. package/components/hy-tooltip/hy-tooltip.vue +42 -95
  227. package/components/hy-tooltip/index.scss +64 -0
  228. package/components/hy-tooltip/props.ts +2 -2
  229. package/components/hy-tooltip/typing.d.ts +1 -1
  230. package/components/hy-transition/hy-transition.vue +17 -8
  231. package/components/hy-transition/props.ts +2 -2
  232. package/components/hy-transition/typing.d.ts +2 -14
  233. package/components/hy-upload/hy-upload.vue +37 -182
  234. package/components/hy-upload/index.scss +147 -0
  235. package/components/hy-upload/props.ts +2 -2
  236. package/components/hy-upload/typing.d.ts +11 -11
  237. package/components/hy-warn/hy-warn.vue +15 -123
  238. package/components/hy-warn/index.scss +109 -0
  239. package/components/hy-warn/props.ts +3 -3
  240. package/components/hy-warn/typing.d.ts +4 -3
  241. package/components/hy-waterfall/index.scss +82 -0
  242. package/components/index.ts +25 -1
  243. package/components/message/index.ts +54 -54
  244. package/config/color.ts +2 -1
  245. package/global/index.ts +6 -6
  246. package/global/register-properties.ts +2 -2
  247. package/index.scss +2 -0
  248. package/libs/css/common.scss +16 -0
  249. package/package.json +4 -4
  250. package/{libs/css → public/font}/iconfont.css +5 -5
  251. package/{libs/css → public/font}/iconfont.ttf +0 -0
  252. package/public/font/iconfont.woff +0 -0
  253. package/public/font/iconfont.woff2 +0 -0
  254. package/theme.scss +9 -7
  255. package/typing/index.ts +0 -1
  256. package/typing/modules/common.d.ts +66 -1
  257. package/typing/modules/form.ts +3 -3
  258. package/utils/calendar.js +1021 -0
  259. package/utils/colorGradient.ts +112 -0
  260. package/utils/index.ts +2 -0
  261. package/utils/inside.ts +80 -34
  262. package/utils/inspect.ts +66 -0
  263. package/utils/utils.ts +27 -19
  264. package/typing/modules/img.ts +0 -15
@@ -5,7 +5,7 @@
5
5
  class="hy-card__head"
6
6
  :style="[{ padding: addUnit(paddingHead || padding) }, headStyle]"
7
7
  :class="{
8
- 'hy-border-bottom': headBorderBottom
8
+ 'hy-border__bottom': headBorderBottom,
9
9
  }"
10
10
  @tap="headClick"
11
11
  >
@@ -19,14 +19,14 @@
19
19
  :style="{
20
20
  height: addUnit(thumbWidth),
21
21
  width: addUnit(thumbWidth),
22
- borderRadius: thumbCircle ? '50px' : '4px'
22
+ borderRadius: thumbCircle ? '50px' : '4px',
23
23
  }"
24
24
  ></image>
25
25
  <text
26
26
  class="hy-card__head--left__title"
27
27
  :style="{
28
28
  fontSize: addUnit(titleSize),
29
- color: titleColor
29
+ color: titleColor,
30
30
  }"
31
31
  >
32
32
  {{ title }}
@@ -37,7 +37,7 @@
37
37
  class="hy-card__head__title__text"
38
38
  :style="{
39
39
  fontSize: addUnit(subTitleSize),
40
- color: subTitleColor
40
+ color: subTitleColor,
41
41
  }"
42
42
  >
43
43
  {{ subTitle }}
@@ -59,10 +59,10 @@
59
59
  @tap="footClick"
60
60
  :style="[
61
61
  { padding: $slots.foot ? addUnit(paddingFoot || padding) : 0 },
62
- footStyle
62
+ footStyle,
63
63
  ]"
64
64
  :class="{
65
- 'hy-border-top': footBorderTop
65
+ 'hy-border-top': footBorderTop,
66
66
  }"
67
67
  >
68
68
  <slot name="footer" />
@@ -72,7 +72,7 @@
72
72
 
73
73
  <script setup lang="ts">
74
74
  import defaultProps from "./props";
75
- import IProps from "./typing";
75
+ import type IProps from "./typing";
76
76
  import { addUnit } from "../../utils";
77
77
  import { computed, toRefs } from "vue";
78
78
 
@@ -89,19 +89,22 @@ const cardClass = computed(() => {
89
89
  (typeof borderRadius.value === "number"
90
90
  ? borderRadius.value
91
91
  : parseInt(borderRadius.value.replace(/px|rpx|vw|vh/g, "")) > 0) &&
92
- "hy-card--border"
92
+ "hy-card--border",
93
93
  ].filter(Boolean);
94
94
  });
95
95
  const cardStyle = computed(() => {
96
- return Object.assign(customStyle.value, {
97
- borderRadius: addUnit(borderRadius.value),
98
- margin: margin.value,
99
- boxShadow: boxShadow.value
100
- ? typeof boxShadow.value === "boolean"
101
- ? "0 0 10rpx 4rpx rgba(0, 0, 0, 0.16)"
102
- : boxShadow.value
103
- : ""
104
- });
96
+ return Object.assign(
97
+ {
98
+ borderRadius: addUnit(borderRadius.value),
99
+ margin: margin.value,
100
+ boxShadow: boxShadow.value
101
+ ? typeof boxShadow.value === "boolean"
102
+ ? "0 0 10rpx 4rpx rgba(0, 0, 0, 0.16)"
103
+ : boxShadow.value
104
+ : "",
105
+ },
106
+ customStyle.value,
107
+ );
105
108
  });
106
109
 
107
110
  const click = () => {
@@ -128,71 +131,5 @@ const footClick = () => {
128
131
  </script>
129
132
 
130
133
  <style lang="scss" scoped>
131
- @import "../../libs/css/mixin.scss";
132
- @import "../../theme.scss";
133
-
134
- .hy-card {
135
- position: relative;
136
- overflow: hidden;
137
- font-size: 28rpx;
138
- background-color: #ffffff;
139
- box-sizing: border-box;
140
-
141
- &-full {
142
- // 如果是与屏幕之间不留空隙,应该设置左右边距为0
143
- margin-left: 0 !important;
144
- margin-right: 0 !important;
145
- width: 100%;
146
- }
147
-
148
- &--border:after {
149
- border-radius: 16rpx;
150
- }
151
-
152
- &__head {
153
- &--flex {
154
- display: flex;
155
- align-items: center;
156
- justify-content: space-between;
157
- }
158
-
159
- &--left {
160
- color: #303133ff;
161
- display: flex;
162
-
163
- &__thumb {
164
- margin-right: 16rpx;
165
- }
166
-
167
- &__title {
168
- max-width: 400rpx;
169
- height: 20px;
170
- @include line-feed;
171
- }
172
- }
173
-
174
- &--right {
175
- color: $hy-text-color-grey;
176
- margin-left: 6rpx;
177
- }
178
- }
179
-
180
- &__body {
181
- color: $hy-bg-color;
182
- }
183
-
184
- &__foot {
185
- color: $hy-text-color-grey;
186
- }
187
- }
188
- .hy-border-bottom {
189
- border-bottom: $hy-border-line;
190
- }
191
-
192
- .hy-border-top {
193
- border-top: $hy-border-line;
194
- }
195
- .hy-border {
196
- border: $hy-border-line;
197
- }
134
+ @import "./index.scss";
198
135
  </style>
@@ -0,0 +1,57 @@
1
+ @use "../../libs/css/mixin.scss" as *;
2
+ @use "../../theme.scss" as *;
3
+
4
+ .hy-card {
5
+ position: relative;
6
+ overflow: hidden;
7
+ font-size: 28rpx;
8
+ background-color: #ffffff;
9
+ box-sizing: border-box;
10
+
11
+ &-full {
12
+ // 如果是与屏幕之间不留空隙,应该设置左右边距为0
13
+ margin-left: 0 !important;
14
+ margin-right: 0 !important;
15
+ width: 100%;
16
+ }
17
+
18
+ &--border:after {
19
+ border-radius: 16rpx;
20
+ }
21
+
22
+ &__head {
23
+ &--flex {
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: space-between;
27
+ }
28
+
29
+ &--left {
30
+ color: #303133ff;
31
+ display: flex;
32
+
33
+ &__thumb {
34
+ margin-right: 16rpx;
35
+ }
36
+
37
+ &__title {
38
+ max-width: 400rpx;
39
+ height: 20px;
40
+ @include line-feed;
41
+ }
42
+ }
43
+
44
+ &--right {
45
+ color: $hy-text-color-grey;
46
+ margin-left: 6rpx;
47
+ }
48
+ }
49
+
50
+ &__body {
51
+ color: $hy-bg-color;
52
+ }
53
+
54
+ &__foot {
55
+ color: $hy-text-color-grey;
56
+ }
57
+ }
@@ -1,4 +1,4 @@
1
- import IProps from "./typing";
1
+ import type IProps from "./typing";
2
2
 
3
3
  const defaultProps: IProps = {
4
4
  full: false,
@@ -23,7 +23,7 @@ const defaultProps: IProps = {
23
23
  paddingFoot: "",
24
24
  showHead: true,
25
25
  showFoot: true,
26
- boxShadow: true
26
+ boxShadow: true,
27
27
  };
28
28
 
29
29
  export default defaultProps;
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from "vue";
1
+ import type { CSSProperties } from "vue";
2
2
 
3
3
  export default interface IProps {
4
4
  /**
@@ -20,7 +20,7 @@
20
20
  <slot>
21
21
  <template v-for="(item, i) in list" :key="i">
22
22
  <view
23
- class="hy-cell__body--container"
23
+ :class="ItemClass"
24
24
  :hover-class="containerClass(item)"
25
25
  :hover-stay-time="250"
26
26
  :style="{ borderBottom: border ? '1rpx solid #c8c7cc66' : '' }"
@@ -30,7 +30,7 @@
30
30
  <view class="hy-cell__body--container__content-icon">
31
31
  <slot name="icon" :icon="item?.icon">
32
32
  <HyIcon
33
- size="25"
33
+ :size="iconSize"
34
34
  :name="item?.icon"
35
35
  :color="disabled || item?.disabled ? '#c0c0c0' : ''"
36
36
  ></HyIcon>
@@ -42,7 +42,7 @@
42
42
  <text
43
43
  class="hy-cell__body--container__content-title--text"
44
44
  :class="[
45
- (disabled || item?.disabled) && 'hy-cell--disabled'
45
+ (disabled || item?.disabled) && 'hy-cell--disabled',
46
46
  ]"
47
47
  >{{ item?.title }}</text
48
48
  >
@@ -63,8 +63,8 @@
63
63
  arrange === 'left'
64
64
  ? 'flex-start'
65
65
  : arrange === 'right'
66
- ? 'flex-end'
67
- : 'center'
66
+ ? 'flex-end'
67
+ : 'center',
68
68
  }"
69
69
  >
70
70
  <slot name="value" :record="item">
@@ -81,7 +81,7 @@
81
81
  :class="[
82
82
  `hy-cell__body--container__right-icon--${
83
83
  item?.arrowDirection || arrowDirection
84
- }`
84
+ }`,
85
85
  ]"
86
86
  >
87
87
  <slot name="right-icon" :icon="item?.rightIcon || rightIcon">
@@ -89,7 +89,7 @@
89
89
  :name="item?.rightIcon || rightIcon"
90
90
  :custom-style="rightIconStyle"
91
91
  :color="disabled || item?.disabled ? '#c0c0c0' : 'info'"
92
- :size="size === 'large' ? 18 : 16"
92
+ :size="iconSize"
93
93
  ></HyIcon>
94
94
  </slot>
95
95
  </view>
@@ -104,13 +104,14 @@
104
104
 
105
105
  <script setup lang="ts">
106
106
  import defaultProps from "./props";
107
- import IProps, { CellContentVo } from "./typing";
107
+ import type IProps from "./typing";
108
+ import type { CellContentVo } from "./typing";
108
109
 
109
110
  import HyIcon from "../hy-icon/hy-icon.vue";
110
111
  import { computed, toRefs } from "vue";
111
112
 
112
113
  const props = withDefaults(defineProps<IProps>(), defaultProps);
113
- const { disabled, clickable } = toRefs(props);
114
+ const { size, disabled, clickable } = toRefs(props);
114
115
  const emit = defineEmits(["click"]);
115
116
 
116
117
  /**
@@ -122,12 +123,29 @@ const containerClass = computed(() => {
122
123
  !disabled.value &&
123
124
  !temp?.disabled &&
124
125
  clickable.value &&
125
- "hy-cell__body--container__clickable"
126
+ "hy-cell__body--container__clickable",
126
127
  ]
127
128
  .filter(Boolean)
128
129
  .join();
129
130
  };
130
131
  });
132
+ const ItemClass = computed(() => {
133
+ return [
134
+ "hy-cell__body--container",
135
+ `hy-cell__body--container__${size.value}`,
136
+ ];
137
+ });
138
+
139
+ const iconSize = computed(() => {
140
+ switch (size.value) {
141
+ case "large":
142
+ return 25;
143
+ case "medium":
144
+ return 20;
145
+ case "small":
146
+ return 15;
147
+ }
148
+ });
131
149
 
132
150
  /**
133
151
  * @description 点击cell
@@ -137,7 +155,7 @@ const clickHandler = (e: Event, temp: CellContentVo, index: number) => {
137
155
  emit("click", temp, index);
138
156
  if (temp?.url) {
139
157
  uni.navigateTo({
140
- url: temp.url
158
+ url: temp.url,
141
159
  });
142
160
  }
143
161
  e.stopPropagation();
@@ -145,124 +163,5 @@ const clickHandler = (e: Event, temp: CellContentVo, index: number) => {
145
163
  </script>
146
164
 
147
165
  <style lang="scss" scoped>
148
- @import "../../libs/css/mixin.scss";
149
- @import "../../theme.scss";
150
-
151
- .hy-cell {
152
- flex: 1;
153
-
154
- /*标题*/
155
- &__title {
156
- padding: $hy-border-margin-padding-lg $hy-border-margin-padding-sm;
157
-
158
- &-nav {
159
- display: flex;
160
- align-items: center;
161
-
162
- &--ver {
163
- border-radius: 4rpx;
164
- width: 4px;
165
- height: 20px;
166
- margin-right: 16rpx;
167
- }
168
- &--text {
169
- font-size: $hy-font-size-subtitle;
170
- line-height: 16px;
171
- color: $hy-color-title;
172
- }
173
- }
174
- }
175
-
176
- /*row内容*/
177
- &__body {
178
- /* #ifndef APP-NVUE */
179
- box-sizing: border-box;
180
- /* #endif */
181
- font-size: $hy-font-size-paragraph;
182
- color: $hy-color-paragraph;
183
- // line-height: $u-cell-line-height;
184
- align-items: center;
185
- //justify-content: space-between;
186
-
187
- &--container {
188
- @include flex(row);
189
- align-items: center;
190
- justify-content: space-between;
191
- flex: 1;
192
- padding: $hy-border-margin-padding-lg $hy-border-margin-padding-base;
193
-
194
- /*点击状态*/
195
- &__clickable {
196
- background-color: $hy-bg-color-grey;
197
- }
198
-
199
- &__content {
200
- @include flex(row);
201
- /*左边icon*/
202
- &-icon {
203
- @include flex();
204
- align-items: center;
205
- font-size: 16px;
206
- margin-right: 10px;
207
- }
208
- /*行头部*/
209
- &-title {
210
- flex: $hy-font-size-subtitle;
211
- line-height: 25px;
212
- display: flex;
213
- flex-direction: column;
214
-
215
- /*标题*/
216
- &--text {
217
- font-size: $hy-font-size-lg;
218
- line-height: 22px;
219
- color: $hy-color-title;
220
- }
221
-
222
- /*sub值*/
223
- &--sub {
224
- margin-top: $hy-border-margin-padding-sm;
225
- font-size: $hy-font-size-base;
226
- color: $hy-text-color-grey;
227
- line-height: 18px;
228
- }
229
- }
230
- }
231
-
232
- /*cell值*/
233
- &__center {
234
- @include flex();
235
- max-width: 90%;
236
- flex: 1;
237
- &__value {
238
- //text-align: right;
239
- font-size: $hy-font-size-base;
240
- line-height: 24px;
241
- color: $hy-text-color-grey;
242
- margin-right: $hy-border-margin-padding-sm;
243
- }
244
- }
245
-
246
- /*右边icon*/
247
- &__right-icon {
248
- transition: transform 0.3s;
249
-
250
- &--up {
251
- transform: rotate(-90deg);
252
- }
253
-
254
- &--down {
255
- transform: rotate(90deg);
256
- }
257
- }
258
- }
259
- }
260
-
261
- &--disabled {
262
- color: $hy-text-color-disable;
263
- /* #ifndef APP-NVUE */
264
- cursor: not-allowed;
265
- /* #endif */
266
- }
267
- }
166
+ @import "./index.scss";
268
167
  </style>
@@ -0,0 +1,137 @@
1
+ @use "../../libs/css/mixin.scss" as *;
2
+ @use "../../theme.scss" as *;
3
+
4
+ .hy-cell {
5
+ flex: 1;
6
+
7
+ /*标题*/
8
+ &__title {
9
+ padding: $hy-border-margin-padding-lg $hy-border-margin-padding-sm;
10
+
11
+ &-nav {
12
+ display: flex;
13
+ align-items: center;
14
+
15
+ &--ver {
16
+ border-radius: 4rpx;
17
+ width: 4px;
18
+ height: 20px;
19
+ margin-right: 16rpx;
20
+ }
21
+ &--text {
22
+ font-size: $hy-font-size-subtitle;
23
+ line-height: 16px;
24
+ color: $hy-color-title;
25
+ }
26
+ }
27
+ }
28
+
29
+ /*row内容*/
30
+ &__body {
31
+ /* #ifndef APP-NVUE */
32
+ box-sizing: border-box;
33
+ /* #endif */
34
+ font-size: $hy-font-size-paragraph;
35
+ color: $hy-color-paragraph;
36
+ // line-height: $u-cell-line-height;
37
+ align-items: center;
38
+ //justify-content: space-between;
39
+
40
+ &--container {
41
+ @include flex(row);
42
+ align-items: center;
43
+ justify-content: space-between;
44
+ flex: 1;
45
+
46
+ /* 大 */
47
+ &__large {
48
+ font-size: $hy-font-size-lg;
49
+ padding: 35rpx;
50
+ line-height: 25px;
51
+ }
52
+
53
+ /* 默认 */
54
+ &__medium {
55
+ font-size: $hy-font-size-base;
56
+ padding: 30rpx;
57
+ line-height: 20px;
58
+ }
59
+
60
+ /* 小 */
61
+ &__small {
62
+ font-size: $hy-font-size-sm;
63
+ padding: 25rpx;
64
+ line-height: 15px;
65
+ }
66
+
67
+ /*点击状态*/
68
+ &__clickable {
69
+ background-color: $hy-bg-color-grey;
70
+ }
71
+
72
+ &__content {
73
+ @include flex(row);
74
+ /*左边icon*/
75
+ &-icon {
76
+ @include flex();
77
+ align-items: center;
78
+ margin-right: 10px;
79
+ }
80
+ /*行头部*/
81
+ &-title {
82
+ margin-right: $hy-border-margin-padding-sm;
83
+ flex: $hy-font-size-subtitle;
84
+ display: flex;
85
+ flex-direction: column;
86
+
87
+ /*标题*/
88
+ &--text {
89
+ color: $hy-color-title;
90
+ }
91
+
92
+ /*sub值*/
93
+ &--sub {
94
+ margin-top: $hy-border-margin-padding-sm;
95
+ color: $hy-text-color-grey;
96
+ }
97
+ }
98
+ }
99
+
100
+ /*cell值*/
101
+ &__center {
102
+ @include flex();
103
+ max-width: 90%;
104
+ flex: 1;
105
+ &__value {
106
+ line-height: 24px;
107
+ color: $hy-text-color-grey;
108
+ margin-right: $hy-border-margin-padding-sm;
109
+ }
110
+ }
111
+
112
+ /*右边icon*/
113
+ &__right-icon {
114
+ transition: transform 0.3s;
115
+
116
+ &--up {
117
+ transform: rotate(-90deg);
118
+ }
119
+
120
+ &--left {
121
+ transform: rotate(180deg);
122
+ }
123
+
124
+ &--down {
125
+ transform: rotate(90deg);
126
+ }
127
+ }
128
+ }
129
+ }
130
+
131
+ &--disabled {
132
+ color: $hy-text-color-disable;
133
+ /* #ifndef APP-NVUE */
134
+ cursor: not-allowed;
135
+ /* #endif */
136
+ }
137
+ }
@@ -1,4 +1,4 @@
1
- import IProps from "./typing";
1
+ import type IProps from "./typing";
2
2
  import { ColorConfig, IconConfig } from "../../config";
3
3
 
4
4
  const defaultProps: IProps = {
@@ -14,7 +14,7 @@ const defaultProps: IProps = {
14
14
  value: "",
15
15
  arrange: "right",
16
16
  rightIcon: IconConfig.RIGHT,
17
- arrowDirection: "left"
17
+ arrowDirection: "right",
18
18
  };
19
19
 
20
20
  export default defaultProps;
@@ -1,4 +1,5 @@
1
- import { CSSProperties } from "vue";
1
+ import type { CSSProperties } from "vue";
2
+ import { HyApp } from "@/package/typing/modules/common";
2
3
 
3
4
  export interface CellContentVo extends AnyObject {
4
5
  /**
@@ -32,7 +33,7 @@ export interface CellContentVo extends AnyObject {
32
33
  /**
33
34
  * @description 单元格右侧箭头的方向,可选值为:left,up,down
34
35
  * */
35
- arrowDirection?: "left" | "up" | "down";
36
+ arrowDirection?: HyApp.RotateType;
36
37
  }
37
38
  export default interface IProps {
38
39
  /**
@@ -86,7 +87,7 @@ export default interface IProps {
86
87
  /**
87
88
  * @description 右侧箭头的方向,可选值为:left,up,down
88
89
  * */
89
- arrowDirection?: "left" | "up" | "down";
90
+ arrowDirection?: "left" | "up" | "down" | "right";
90
91
  /**
91
92
  * @description 自定义右侧icon样式
92
93
  * */
@@ -18,7 +18,8 @@
18
18
  <script setup lang="ts">
19
19
  import { toRefs, watch, ref } from "vue";
20
20
  import defaultProps from "./props";
21
- import IProps, { CheckboxColumnsVo } from "./typing";
21
+ import type IProps from "./typing";
22
+ import type { CheckboxColumnsVo } from "./typing";
22
23
  import HyTag from "../hy-tag/hy-tag.vue";
23
24
 
24
25
  const props = withDefaults(defineProps<IProps>(), defaultProps);
@@ -32,16 +33,21 @@ const columns_1 = ref<CheckboxColumnsVo[]>();
32
33
 
33
34
  watch(
34
35
  () => modelValue.value,
35
- (newValue: string | (string | number)[]) => {
36
+ (newValue: string | number | (string | number)[]) => {
36
37
  if (!columns.value.length) return;
37
38
  columns_1.value = columns.value.map((item) => {
38
- item[fieldNames.value.checked] = newValue.includes(
39
- item[fieldNames.value.value] as string
40
- );
39
+ if (Array.isArray(newValue)) {
40
+ item[fieldNames.value.checked] = newValue.includes(
41
+ item[fieldNames.value.value] as string,
42
+ );
43
+ } else {
44
+ item[fieldNames.value.checked] =
45
+ newValue === item[fieldNames.value.value];
46
+ }
41
47
  return item;
42
48
  });
43
49
  },
44
- { immediate: true }
50
+ { immediate: true },
45
51
  );
46
52
 
47
53
  const onCheckbox = ({ name }: { name: number }) => {
@@ -52,7 +58,7 @@ const onCheckbox = ({ name }: { name: number }) => {
52
58
  "update:modelValue",
53
59
  columns.value
54
60
  .filter((item) => item[fieldNames.value.checked])
55
- .map((item) => item[fieldNames.value.value])
61
+ .map((item) => item[fieldNames.value.value]),
56
62
  );
57
63
  } else {
58
64
  emit("update:modelValue", columns.value[name][fieldNames.value.value]);
@@ -63,6 +69,7 @@ const onCheckbox = ({ name }: { name: number }) => {
63
69
  </script>
64
70
 
65
71
  <style lang="scss" scoped>
72
+ //@import "./index.scss";
66
73
  .hy-check-button {
67
74
  display: grid;
68
75
  grid-template-columns: v-bind(col);