hy-app 0.1.2 → 0.1.4

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 (247) 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 +3 -29
  5. package/components/hy-address-picker/index.scss +27 -0
  6. package/components/hy-avatar/hy-avatar.vue +1 -45
  7. package/components/hy-avatar/index.scss +45 -0
  8. package/components/hy-avatar/typing.d.ts +1 -1
  9. package/components/hy-back-top/hy-back-top.vue +7 -22
  10. package/components/hy-back-top/index.scss +16 -0
  11. package/components/hy-back-top/props.ts +4 -4
  12. package/components/hy-back-top/typing.d.ts +2 -3
  13. package/components/hy-badge/hy-badge.vue +1 -72
  14. package/components/hy-badge/index.scss +72 -0
  15. package/components/hy-button/hy-button.vue +17 -128
  16. package/components/hy-button/index.scss +116 -0
  17. package/components/hy-button/typing.d.ts +1 -1
  18. package/components/hy-calendar/header.vue +76 -0
  19. package/components/hy-calendar/hy-calendar.vue +366 -0
  20. package/components/hy-calendar/index.scss +171 -0
  21. package/components/hy-calendar/month.vue +524 -0
  22. package/components/hy-calendar/props.ts +37 -0
  23. package/components/hy-calendar/typing.d.ts +126 -0
  24. package/components/hy-card/hy-card.vue +21 -84
  25. package/components/hy-card/index.scss +57 -0
  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 +1 -137
  29. package/components/hy-cell/index.scss +137 -0
  30. package/components/hy-check-button/hy-check-button.vue +1 -0
  31. package/components/hy-check-button/index.scss +5 -0
  32. package/components/hy-checkbox/hy-checkbox.vue +2 -95
  33. package/components/hy-checkbox/index.scss +94 -0
  34. package/components/hy-checkbox/typing.d.ts +1 -2
  35. package/components/hy-count-down/hy-count-down.vue +150 -0
  36. package/components/hy-count-down/index.scss +6 -0
  37. package/components/hy-count-down/index.ts +52 -0
  38. package/components/hy-count-down/props.ts +10 -0
  39. package/components/hy-count-down/typing.d.ts +20 -0
  40. package/components/hy-count-to/hy-count-to.vue +213 -0
  41. package/components/hy-count-to/index.scss +6 -0
  42. package/components/hy-count-to/props.ts +17 -0
  43. package/components/hy-count-to/typing.d.ts +48 -0
  44. package/components/hy-datetime-picker/hy-datetime-picker.vue +2 -28
  45. package/components/hy-datetime-picker/index.scss +28 -0
  46. package/components/hy-divider/hy-divider.vue +24 -49
  47. package/components/hy-divider/index.scss +26 -0
  48. package/components/hy-divider/props.ts +2 -2
  49. package/components/hy-divider/typing.d.ts +1 -1
  50. package/components/hy-dropdown/hy-dropdown.vue +43 -0
  51. package/components/hy-dropdown/index.scss +17 -0
  52. package/components/hy-dropdown/props.ts +17 -0
  53. package/components/hy-dropdown/typing.d.ts +48 -0
  54. package/components/hy-dropdown-item/hy-dropdown-item.vue +194 -0
  55. package/components/hy-dropdown-item/index.scss +96 -0
  56. package/components/hy-dropdown-item/props.ts +10 -0
  57. package/components/hy-dropdown-item/typing.d.ts +31 -0
  58. package/components/hy-empty/hy-empty.vue +8 -26
  59. package/components/hy-empty/index.scss +19 -0
  60. package/components/hy-empty/props.ts +2 -2
  61. package/components/hy-empty/typing.d.ts +1 -1
  62. package/components/hy-float-button/hy-float-button.vue +217 -0
  63. package/components/hy-float-button/index.scss +67 -0
  64. package/components/hy-float-button/props.ts +25 -0
  65. package/components/hy-float-button/typing.d.ts +93 -0
  66. package/components/hy-folding-panel/hy-folding-panel.vue +9 -12
  67. package/components/hy-folding-panel/index.scss +6 -0
  68. package/components/hy-folding-panel/props.ts +2 -2
  69. package/components/hy-folding-panel/typing.d.ts +2 -2
  70. package/components/hy-form/hy-form.vue +17 -34
  71. package/components/hy-form/index.scss +30 -0
  72. package/components/hy-form/props.ts +2 -0
  73. package/components/hy-form/typing.d.ts +9 -1
  74. package/components/hy-grid/hy-grid.vue +1 -43
  75. package/components/hy-grid/index.scss +40 -0
  76. package/components/hy-icon/hy-icon.vue +1 -93
  77. package/components/hy-icon/index.scss +84 -0
  78. package/components/hy-image/hy-image.vue +216 -0
  79. package/components/hy-image/index.scss +26 -0
  80. package/components/hy-image/props.ts +24 -0
  81. package/components/hy-image/typing.d.ts +76 -0
  82. package/components/hy-input/hy-input.vue +2 -72
  83. package/components/hy-input/index.scss +65 -0
  84. package/components/hy-line/hy-line.vue +4 -8
  85. package/components/hy-line/index.scss +5 -0
  86. package/components/hy-line/props.ts +3 -3
  87. package/components/hy-line/typing.d.ts +2 -2
  88. package/components/hy-line-progress/hy-line-progress.vue +15 -44
  89. package/components/hy-line-progress/index.scss +38 -0
  90. package/components/hy-line-progress/props.ts +2 -2
  91. package/components/hy-line-progress/typing.d.ts +1 -1
  92. package/components/hy-list/hy-list.vue +11 -41
  93. package/components/hy-list/index.scss +32 -0
  94. package/components/hy-list/props.ts +2 -2
  95. package/components/hy-loading/hy-loading.vue +95 -0
  96. package/components/hy-loading/index.scss +103 -0
  97. package/components/hy-loading/props.ts +17 -0
  98. package/components/hy-loading/typing.d.ts +53 -0
  99. package/components/hy-login/TheUserLogin.vue +20 -88
  100. package/components/hy-login/hy-login.vue +9 -9
  101. package/components/hy-login/props.ts +4 -4
  102. package/components/hy-modal/hy-modal.vue +11 -89
  103. package/components/hy-modal/index.scss +77 -0
  104. package/components/hy-modal/props.ts +2 -2
  105. package/components/hy-modal/typing.d.ts +1 -1
  106. package/components/hy-navbar/hy-navbar.vue +20 -92
  107. package/components/hy-navbar/index.scss +67 -0
  108. package/components/hy-navbar/props.ts +2 -2
  109. package/components/hy-navbar/typing.d.ts +1 -1
  110. package/components/hy-notice-bar/hy-column-notice.vue +11 -39
  111. package/components/hy-notice-bar/hy-notice-bar.vue +10 -12
  112. package/components/hy-notice-bar/hy-row-notice.vue +16 -58
  113. package/components/hy-notice-bar/index.scss +93 -0
  114. package/components/hy-notice-bar/props.ts +4 -2
  115. package/components/hy-notice-bar/typing.d.ts +13 -3
  116. package/components/hy-number-step/hy-number-step.vue +1 -70
  117. package/components/hy-number-step/index.scss +71 -0
  118. package/components/hy-overlay/hy-overlay.vue +2 -14
  119. package/components/hy-overlay/index.scss +9 -0
  120. package/components/hy-parse/hy-parse.vue +499 -0
  121. package/components/hy-parse/index.scss +9 -0
  122. package/components/hy-parse/node/node.vue +584 -0
  123. package/components/hy-parse/parser.js +1337 -0
  124. package/components/hy-parse/props.ts +19 -0
  125. package/components/hy-parse/typing.d.ts +68 -0
  126. package/components/hy-picker/hy-picker.vue +1 -68
  127. package/components/hy-picker/index.scss +68 -0
  128. package/components/hy-popup/hy-popup.vue +1 -74
  129. package/components/hy-popup/index.scss +60 -0
  130. package/components/hy-price/hy-price.vue +7 -19
  131. package/components/hy-price/index.scss +11 -0
  132. package/components/hy-price/props.ts +4 -3
  133. package/components/hy-price/typing.d.ts +8 -4
  134. package/components/hy-qrcode/hy-qrcode.vue +15 -37
  135. package/components/hy-qrcode/index.scss +23 -0
  136. package/components/hy-qrcode/props.ts +2 -2
  137. package/components/hy-qrcode/typing.d.ts +2 -2
  138. package/components/hy-radio/hy-radio.vue +2 -101
  139. package/components/hy-radio/index.scss +93 -0
  140. package/components/hy-radio/typing.d.ts +1 -2
  141. package/components/hy-rate/hy-rate.vue +1 -33
  142. package/components/hy-rate/index.scss +33 -0
  143. package/components/hy-read-more/hy-read-more.vue +7 -30
  144. package/components/hy-read-more/index.scss +25 -0
  145. package/components/hy-read-more/props.ts +3 -3
  146. package/components/hy-read-more/typing.d.ts +1 -1
  147. package/components/hy-safe-bottom/hy-safe-bottom.vue +5 -9
  148. package/components/hy-safe-bottom/index.scss +5 -0
  149. package/components/hy-scroll-list/hy-scroll-list.vue +13 -43
  150. package/components/hy-scroll-list/index.scss +34 -0
  151. package/components/hy-scroll-list/props.ts +2 -2
  152. package/components/hy-scroll-list/typing.d.ts +1 -1
  153. package/components/hy-search/hy-search.vue +1 -83
  154. package/components/hy-search/index.scss +83 -0
  155. package/components/hy-slider/hy-slider.vue +18 -95
  156. package/components/hy-slider/index.scss +77 -0
  157. package/components/hy-status-bar/hy-status-bar.vue +41 -0
  158. package/components/hy-status-bar/index.scss +6 -0
  159. package/components/hy-status-bar/props.ts +8 -0
  160. package/components/hy-status-bar/typing.d.ts +12 -0
  161. package/components/hy-steps/hy-steps.vue +36 -163
  162. package/components/hy-steps/index.scss +131 -0
  163. package/components/hy-steps/props.ts +2 -2
  164. package/components/hy-steps/typing.d.ts +2 -2
  165. package/components/hy-submitBar/Index.vue +17 -0
  166. package/components/hy-submitBar/hy-submitBar.vue +216 -0
  167. package/components/hy-submitBar/index.scss +9 -0
  168. package/components/hy-submitBar/props.ts +22 -0
  169. package/components/hy-submitBar/typing.d.ts +88 -0
  170. package/components/hy-subsection/hy-subsection.vue +40 -132
  171. package/components/hy-subsection/index.scss +82 -0
  172. package/components/hy-subsection/props.ts +1 -0
  173. package/components/hy-subsection/typing.d.ts +13 -4
  174. package/components/hy-swipe-action/hy-swipe-action.vue +294 -0
  175. package/components/hy-swipe-action/index.scss +9 -0
  176. package/components/hy-swipe-action/index.wxs +235 -0
  177. package/components/hy-swipe-action/props.ts +16 -0
  178. package/components/hy-swipe-action/typing.d.ts +55 -0
  179. package/components/hy-swipe-action/wxs.js +15 -0
  180. package/components/hy-swiper/hy-swiper-indicator.vue +5 -35
  181. package/components/hy-swiper/hy-swiper.vue +1 -54
  182. package/components/hy-swiper/index.scss +82 -0
  183. package/components/hy-switch/hy-switch.vue +62 -72
  184. package/components/hy-switch/index.scss +46 -0
  185. package/components/hy-switch/props.ts +4 -1
  186. package/components/hy-switch/typing.d.ts +14 -1
  187. package/components/hy-tabs/hy-tabs.vue +22 -81
  188. package/components/hy-tabs/index.scss +63 -0
  189. package/components/hy-tabs/props.ts +5 -5
  190. package/components/hy-tabs/typing.d.ts +1 -1
  191. package/components/hy-tag/hy-tag.vue +25 -220
  192. package/components/hy-tag/index.scss +205 -0
  193. package/components/hy-text/hy-text.vue +238 -0
  194. package/components/hy-text/index.scss +70 -0
  195. package/components/hy-text/index.ts +0 -0
  196. package/components/hy-text/props.ts +30 -0
  197. package/components/hy-text/typing.d.ts +98 -0
  198. package/components/hy-textarea/hy-textarea.vue +1 -46
  199. package/components/hy-textarea/index.scss +40 -0
  200. package/components/hy-toast/hy-toast.vue +175 -0
  201. package/components/hy-toast/index.scss +77 -0
  202. package/components/hy-toast/props.ts +3 -0
  203. package/components/hy-toast/typing.d.ts +38 -0
  204. package/components/hy-tooltip/hy-tooltip.vue +42 -95
  205. package/components/hy-tooltip/index.scss +64 -0
  206. package/components/hy-tooltip/props.ts +2 -2
  207. package/components/hy-tooltip/typing.d.ts +1 -1
  208. package/components/hy-transition/hy-transition.vue +4 -2
  209. package/components/hy-transition/typing.d.ts +1 -13
  210. package/components/hy-upload/hy-upload.vue +37 -182
  211. package/components/hy-upload/index.scss +147 -0
  212. package/components/hy-upload/props.ts +2 -2
  213. package/components/hy-upload/typing.d.ts +11 -11
  214. package/components/hy-warn/hy-warn.vue +17 -144
  215. package/components/hy-warn/index.scss +109 -0
  216. package/components/hy-warn/props.ts +3 -3
  217. package/components/hy-warn/typing.d.ts +4 -3
  218. package/components/hy-waterfall/hy-waterfall.vue +168 -38
  219. package/components/hy-waterfall/index.scss +16 -0
  220. package/components/hy-waterfall/props.ts +4 -5
  221. package/components/hy-waterfall/typing.d.ts +5 -9
  222. package/components/index.ts +25 -1
  223. package/components/message/index.ts +54 -54
  224. package/composables/index.ts +1 -0
  225. package/composables/useShare.ts +27 -0
  226. package/config/color.ts +3 -2
  227. package/config/icon.ts +21 -1
  228. package/global/index.ts +6 -6
  229. package/global/register-properties.ts +2 -2
  230. package/index.scss +2 -1
  231. package/index.ts +9 -8
  232. package/libs/css/common.scss +14 -2
  233. package/package.json +3 -2
  234. package/{libs/css → public/font}/iconfont.css +4 -4
  235. package/theme.scss +6 -4
  236. package/typing/index.ts +1 -1
  237. package/typing/modules/common.d.ts +36 -1
  238. package/utils/calendar.js +1021 -0
  239. package/utils/colorGradient.ts +112 -0
  240. package/utils/index.ts +2 -0
  241. package/utils/inside.ts +80 -34
  242. package/utils/inspect.ts +115 -0
  243. package/utils/utils.ts +20 -19
  244. package/libs/css/download.zip +0 -0
  245. /package/{libs/css → public/font}/iconfont.ttf +0 -0
  246. /package/{libs/css → public/font}/iconfont.woff +0 -0
  247. /package/{libs/css → public/font}/iconfont.woff2 +0 -0
@@ -170,7 +170,7 @@ const inputClass = computed((): string => {
170
170
  (classes = classes.concat(["hy-border", "hy-input--radius"]));
171
171
  classes.push(`hy-input--${shape}`);
172
172
  border === "bottom" &&
173
- (classes = classes.concat(["hy-border-bottom", "hy-input--no-radius"]));
173
+ (classes = classes.concat(["hy-border__bottom", "hy-input--no-radius"]));
174
174
  return classes.join(" ");
175
175
  });
176
176
 
@@ -327,75 +327,5 @@ const clickHandler = () => {
327
327
  </script>
328
328
 
329
329
  <style lang="scss" scoped>
330
- @import "../../libs/css/mixin.scss";
331
- @import "../../theme.scss";
332
-
333
- .hy-input {
334
- @include flex(row);
335
- align-items: center;
336
- justify-content: space-between;
337
- flex: 1;
338
-
339
- &--radius,
340
- &--square {
341
- border-radius: 4px;
342
- }
343
-
344
- &--no-radius {
345
- border-radius: 0;
346
- }
347
-
348
- &--circle {
349
- border-radius: 100px;
350
- }
351
-
352
- &__content {
353
- flex: 1;
354
- @include flex(row);
355
- align-items: center;
356
- justify-content: space-between;
357
-
358
- &__field-wrapper {
359
- position: relative;
360
- @include flex(row);
361
- margin: 0;
362
- flex: 1;
363
-
364
- &__field {
365
- line-height: 26px;
366
- text-align: left;
367
- color: $hy-text-color;
368
- height: 24px;
369
- font-size: 15px;
370
- flex: 1;
371
- }
372
- }
373
-
374
- &__clear {
375
- width: 20px;
376
- height: 20px;
377
- border-radius: 100px;
378
- background-color: #c6c7cb;
379
- @include flex(row);
380
- align-items: center;
381
- justify-content: center;
382
- transform: scale(0.82);
383
- margin-left: 4px;
384
- }
385
-
386
- &__subfix-icon {
387
- margin-left: 4px;
388
- }
389
-
390
- &__prefix-icon {
391
- margin-right: 4px;
392
- }
393
- }
394
- }
395
- .hy-border-bottom {
396
- border-bottom: $hy-border-line;
397
- }
398
- .hy-border {
399
- border: $hy-border-line;
400
- }
330
+ @import "./index.scss";
401
331
  </style>
@@ -0,0 +1,65 @@
1
+ @use "../../libs/css/mixin.scss" as *;
2
+ @use "../../theme.scss" as *;
3
+
4
+ .hy-input {
5
+ @include flex(row);
6
+ align-items: center;
7
+ justify-content: space-between;
8
+ flex: 1;
9
+
10
+ &--radius,
11
+ &--square {
12
+ border-radius: 4px;
13
+ }
14
+
15
+ &--no-radius {
16
+ border-radius: 0;
17
+ }
18
+
19
+ &--circle {
20
+ border-radius: 100px;
21
+ }
22
+
23
+ &__content {
24
+ flex: 1;
25
+ @include flex(row);
26
+ align-items: center;
27
+ justify-content: space-between;
28
+
29
+ &__field-wrapper {
30
+ position: relative;
31
+ @include flex(row);
32
+ margin: 0;
33
+ flex: 1;
34
+
35
+ &__field {
36
+ line-height: 26px;
37
+ text-align: left;
38
+ color: $hy-text-color;
39
+ height: 24px;
40
+ font-size: 15px;
41
+ flex: 1;
42
+ }
43
+ }
44
+
45
+ &__clear {
46
+ width: 20px;
47
+ height: 20px;
48
+ border-radius: 100px;
49
+ background-color: #c6c7cb;
50
+ @include flex(row);
51
+ align-items: center;
52
+ justify-content: center;
53
+ transform: scale(0.82);
54
+ margin-left: 4px;
55
+ }
56
+
57
+ &__subfix-icon {
58
+ margin-left: 4px;
59
+ }
60
+
61
+ &__prefix-icon {
62
+ margin-right: 4px;
63
+ }
64
+ }
65
+ }
@@ -3,9 +3,9 @@
3
3
  </template>
4
4
 
5
5
  <script setup lang="ts">
6
- import { computed, CSSProperties, toRefs } from "vue";
6
+ import { computed, type CSSProperties, toRefs } from "vue";
7
7
  import defaultProps from "./props";
8
- import IProps from "./typing";
8
+ import type IProps from "./typing";
9
9
  import { addUnit } from "../../utils";
10
10
 
11
11
  const props = withDefaults(defineProps<IProps>(), defaultProps);
@@ -21,7 +21,7 @@ const lineStyle = computed<CSSProperties>(() => {
21
21
  style.borderBottomWidth = "1px";
22
22
  style.borderBottomStyle = dashed.value ? "dashed" : "solid";
23
23
  style.width = addUnit(length.value);
24
- if (hairline.value) style.transform = "scaleY(0.5)";
24
+ if (!hairline.value) style.borderBottomWidth = "1.5px";
25
25
  } else {
26
26
  // 如果是竖向线条,边框宽度为1px,再通过transform缩小一半,就是0.5px了
27
27
  style.borderLeftWidth = "1px";
@@ -36,9 +36,5 @@ const lineStyle = computed<CSSProperties>(() => {
36
36
  </script>
37
37
 
38
38
  <style lang="scss" scoped>
39
- .hy-line {
40
- /* #ifndef APP-NVUE */
41
- vertical-align: middle;
42
- /* #endif */
43
- }
39
+ @import "./index.scss";
44
40
  </style>
@@ -0,0 +1,5 @@
1
+ .hy-line {
2
+ /* #ifndef APP-NVUE */
3
+ vertical-align: middle;
4
+ /* #endif */
5
+ }
@@ -1,12 +1,12 @@
1
- import IProps from "./typing";
1
+ import type IProps from "./typing";
2
2
 
3
3
  const defaultProps: IProps = {
4
- color: "#d6d7d9",
4
+ color: "#dcdfe6",
5
5
  length: "100%",
6
6
  direction: "row",
7
7
  hairline: true,
8
8
  margin: "0",
9
- dashed: false
9
+ dashed: false,
10
10
  };
11
11
 
12
12
  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
  /**
@@ -12,7 +12,7 @@ export default interface IProps {
12
12
  /**
13
13
  * @description 线条的方向,row-横向,column-竖向 (默认 'row' )
14
14
  * */
15
- direction?: HyApp.PermutationType;
15
+ direction?: HyApp.DirectionType;
16
16
  /**
17
17
  * @description 是否显示细线条 (默认 true )
18
18
  * */
@@ -5,7 +5,7 @@
5
5
  ref="hy-line-progress__background"
6
6
  :style="{
7
7
  backgroundColor: inactiveColor,
8
- height: addUnit(height)
8
+ height: addUnit(height),
9
9
  }"
10
10
  >
11
11
  </view>
@@ -22,19 +22,27 @@
22
22
  </template>
23
23
 
24
24
  <script setup lang="ts">
25
- import { computed, CSSProperties, onMounted, ref, toRefs, watch } from "vue";
25
+ import {
26
+ computed,
27
+ type CSSProperties, getCurrentInstance,
28
+ onMounted,
29
+ ref,
30
+ toRefs,
31
+ watch,
32
+ } from "vue";
26
33
  import defaultProps from "./props";
27
- import IProps from "./typing";
34
+ import type IProps from "./typing";
28
35
  import { addUnit, getRect, range, sleep } from "../../utils";
29
36
 
30
37
  const props = withDefaults(defineProps<IProps>(), defaultProps);
31
38
  const { percentage, activeColor, height } = toRefs(props);
32
39
 
40
+ const instance = getCurrentInstance();
33
41
  const lineWidth = ref<string | number>(0);
34
42
 
35
43
  watch(
36
44
  () => percentage.value,
37
- () => resizeProgressWidth()
45
+ () => resizeProgressWidth(),
38
46
  );
39
47
 
40
48
  const progressStyle = computed<CSSProperties>(() => {
@@ -61,7 +69,7 @@ const init = async () => {
61
69
  const getProgressWidth = () => {
62
70
  return new Promise((resolve) => {
63
71
  // #ifndef APP-NVUE
64
- resolve(getRect(".u-line-progress__background"));
72
+ resolve(getRect(".hy-line-progress__background", false, instance));
65
73
  // #endif
66
74
  });
67
75
  };
@@ -72,47 +80,10 @@ const getProgressWidth = () => {
72
80
  const resizeProgressWidth = async () => {
73
81
  const { width } = await getProgressWidth();
74
82
  // 通过设置的percentage值,计算其所占总长度的百分比
75
- lineWidth.value = (width * innserPercentage.value) / 100 + "px";
83
+ lineWidth.value = addUnit((width * innserPercentage.value) / 100);
76
84
  };
77
85
  </script>
78
86
 
79
87
  <style lang="scss" scoped>
80
- @import "../../libs/css/mixin.scss";
81
-
82
- .hy-line-progress {
83
- align-items: stretch;
84
- position: relative;
85
- @include flex(row);
86
- flex: 1;
87
- overflow: hidden;
88
- border-radius: 100px;
89
-
90
- &__background {
91
- background-color: #ececec;
92
- border-radius: 100px;
93
- flex: 1;
94
- }
95
-
96
- &__line {
97
- position: absolute;
98
- top: 0;
99
- left: 0;
100
- bottom: 0;
101
- align-items: center;
102
- @include flex(row);
103
- color: #ffffff;
104
- border-radius: 100px;
105
- transition: width 0.5s ease;
106
- justify-content: flex-end;
107
- }
108
-
109
- &__text {
110
- font-size: 10px;
111
- align-items: center;
112
- text-align: right;
113
- color: #ffffff;
114
- margin-right: 5px;
115
- transform: scale(0.9);
116
- }
117
- }
88
+ @import "./index.scss";
118
89
  </style>
@@ -0,0 +1,38 @@
1
+ @use "../../libs/css/mixin.scss" as *;
2
+
3
+ .hy-line-progress {
4
+ align-items: stretch;
5
+ position: relative;
6
+ @include flex(row);
7
+ flex: 1;
8
+ overflow: hidden;
9
+ border-radius: 100px;
10
+
11
+ &__background {
12
+ background-color: #ececec;
13
+ border-radius: 100px;
14
+ flex: 1;
15
+ }
16
+
17
+ &__line {
18
+ position: absolute;
19
+ top: 0;
20
+ left: 0;
21
+ bottom: 0;
22
+ align-items: center;
23
+ @include flex(row);
24
+ color: #ffffff;
25
+ border-radius: 100px;
26
+ transition: width 0.5s ease;
27
+ justify-content: flex-end;
28
+ }
29
+
30
+ &__text {
31
+ font-size: 10px;
32
+ align-items: center;
33
+ text-align: right;
34
+ color: #ffffff;
35
+ margin-right: 5px;
36
+ transform: scale(0.9);
37
+ }
38
+ }
@@ -1,4 +1,4 @@
1
- import IProps from "./typing";
1
+ import type IProps from "./typing";
2
2
  import { ColorConfig } from "../../config";
3
3
 
4
4
  const defaultProps: IProps = {
@@ -6,7 +6,7 @@ const defaultProps: IProps = {
6
6
  inactiveColor: "#ececec",
7
7
  percentage: 0,
8
8
  showText: true,
9
- height: 12
9
+ height: 12,
10
10
  };
11
11
 
12
12
  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
  /**
@@ -67,26 +67,26 @@
67
67
  <script lang="ts">
68
68
  export default {
69
69
  options: {
70
- virtualHost: true
71
- }
70
+ virtualHost: true,
71
+ },
72
72
  };
73
73
  </script>
74
74
 
75
75
  <script lang="ts" setup>
76
76
  import {
77
77
  computed,
78
- CSSProperties,
78
+ type CSSProperties,
79
79
  nextTick,
80
80
  onMounted,
81
81
  reactive,
82
82
  ref,
83
83
  toRefs,
84
84
  useSlots,
85
- watch
85
+ watch,
86
86
  } from "vue";
87
87
  import { addUnit, debounce, getPx, getRect } from "../../utils";
88
88
  import HyDivider from "../hy-divider/hy-divider.vue";
89
- import IProps from "./typing";
89
+ import type IProps from "./typing";
90
90
  import defaultProps from "./props";
91
91
 
92
92
  const props = withDefaults(defineProps<IProps>(), defaultProps);
@@ -100,7 +100,7 @@ const {
100
100
  padding,
101
101
  borderRadius,
102
102
  background,
103
- border
103
+ border,
104
104
  } = toRefs(props);
105
105
  const emit = defineEmits(["scrollButton", "click"]);
106
106
 
@@ -111,7 +111,7 @@ const scrollTop = ref(0);
111
111
  const viewHeight = ref(0);
112
112
  const waterfall: { left: AnyObject[]; right: AnyObject[] } = reactive({
113
113
  left: [],
114
- right: []
114
+ right: [],
115
115
  });
116
116
  // 排列方式
117
117
  const arrange = computed(() => (line.value === 1 ? "column" : "row"));
@@ -132,7 +132,7 @@ const itemStyle = computed((): CSSProperties => {
132
132
  marginBottom: addUnit(marginBottom.value),
133
133
  borderRadius: addUnit(borderRadius.value),
134
134
  background: background.value,
135
- border: border.value ? "1px solid #dadbde" : ""
135
+ border: border.value ? "1px solid #dadbde" : "",
136
136
  };
137
137
  });
138
138
 
@@ -149,7 +149,7 @@ const start = computed(() => {
149
149
  */
150
150
  const over = computed(() => {
151
151
  const o = Math.floor(
152
- (scrollTop.value + viewHeight.value + 1) / boxHeight + 5
152
+ (scrollTop.value + viewHeight.value + 1) / boxHeight + 5,
153
153
  );
154
154
  return Math.min(list.value.length, o * line.value);
155
155
  });
@@ -185,7 +185,7 @@ watch(
185
185
  });
186
186
  }
187
187
  },
188
- { immediate: true, deep: true }
188
+ { immediate: true, deep: true },
189
189
  );
190
190
 
191
191
  /**
@@ -216,35 +216,5 @@ const slotDefault = useSlots().default;
216
216
  </script>
217
217
 
218
218
  <style lang="scss" scoped>
219
- @import "../../theme.scss";
220
- @import "../../libs/css/mixin.scss";
221
- .hy-virtual-container {
222
- height: v-bind(listHeight);
223
- padding: 0 $hy-border-margin-padding-base;
224
- box-sizing: border-box;
225
-
226
- &__list {
227
- padding: v-bind(paddingAttr);
228
- @include flex(v-bind(arrange));
229
- overflow-anchor: none;
230
- &--item {
231
- box-sizing: border-box;
232
- }
233
-
234
- &--left {
235
- margin-right: $hy-border-margin-padding-base;
236
- }
237
- &--box {
238
- box-sizing: border-box;
239
- width: 50%;
240
- display: flex;
241
- flex-direction: column;
242
- &-item {
243
- box-sizing: border-box;
244
- position: relative;
245
- overflow: hidden;
246
- }
247
- }
248
- }
249
- }
219
+ @import "./index.scss";
250
220
  </style>
@@ -0,0 +1,32 @@
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+ .hy-virtual-container {
5
+ height: v-bind(listHeight);
6
+ padding: 0 $hy-border-margin-padding-base;
7
+ box-sizing: border-box;
8
+
9
+ &__list {
10
+ padding: v-bind(paddingAttr);
11
+ @include flex(v-bind(arrange));
12
+ overflow-anchor: none;
13
+ &--item {
14
+ box-sizing: border-box;
15
+ }
16
+
17
+ &--left {
18
+ margin-right: $hy-border-margin-padding-base;
19
+ }
20
+ &--box {
21
+ box-sizing: border-box;
22
+ width: 50%;
23
+ display: flex;
24
+ flex-direction: column;
25
+ &-item {
26
+ box-sizing: border-box;
27
+ position: relative;
28
+ overflow: hidden;
29
+ }
30
+ }
31
+ }
32
+ }
@@ -1,4 +1,4 @@
1
- import IProps from "./typing";
1
+ import type IProps from "./typing";
2
2
 
3
3
  const defaultProps: IProps = {
4
4
  list: [],
@@ -12,7 +12,7 @@ const defaultProps: IProps = {
12
12
  line: 1,
13
13
  keyField: "id",
14
14
  load: "loadMore",
15
- showDivider: true
15
+ showDivider: true,
16
16
  };
17
17
 
18
18
  export default defaultProps;
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <view
3
+ class="hy-loading-icon"
4
+ :style="customStyle"
5
+ :class="[vertical && 'hy-loading-icon--vertical']"
6
+ v-if="show"
7
+ >
8
+ <view
9
+ v-if="!webviewHide"
10
+ class="hy-loading-icon__spinner"
11
+ :class="[`hy-loading-icon__spinner--${mode}`]"
12
+ ref="ani"
13
+ :style="{
14
+ color: color,
15
+ width: addUnit(size),
16
+ height: addUnit(size),
17
+ borderTopColor: color,
18
+ borderBottomColor: otherBorderColor,
19
+ borderLeftColor: otherBorderColor,
20
+ borderRightColor: otherBorderColor,
21
+ 'animation-duration': `${duration}ms`,
22
+ 'animation-timing-function':
23
+ mode === 'semicircle' || mode === 'circle' ? timingFunction : '',
24
+ }"
25
+ >
26
+ <block v-if="mode === 'spinner'">
27
+ <!-- #ifndef APP-NVUE -->
28
+ <view
29
+ v-for="(item, index) in array12"
30
+ :key="index"
31
+ class="hy-loading-icon__dot"
32
+ >
33
+ </view>
34
+ <!-- #endif -->
35
+ </block>
36
+ </view>
37
+ <text
38
+ v-if="text"
39
+ class="hy-loading-icon__text"
40
+ :style="{
41
+ fontSize: addUnit(textSize),
42
+ color: textColor,
43
+ }"
44
+ >{{ text }}</text
45
+ >
46
+ </view>
47
+ </template>
48
+
49
+ <script setup lang="ts">
50
+ import defaultProps from "./props";
51
+ import type IProps from "./typing";
52
+ import { toRefs, ref, computed } from "vue";
53
+ import { addUnit, colorGradient } from "../../utils";
54
+
55
+ const props = withDefaults(defineProps<IProps>(), defaultProps);
56
+ const { show, size, color, mode, inactiveColor } = toRefs(props);
57
+ const emit = defineEmits(["update:modelValue", "change"]);
58
+
59
+ //动画旋转角度
60
+ const aniAngel = ref(360);
61
+ const array12 = Array.from({
62
+ length: 12,
63
+ });
64
+ const webviewHide = ref(false);
65
+
66
+ const otherBorderColor = computed(() => {
67
+ const lightColor = colorGradient(color.value, "#ffffff", 100)[80];
68
+ if (mode.value === "circle") {
69
+ return inactiveColor.value ? inactiveColor.value : lightColor;
70
+ } else {
71
+ return "transparent";
72
+ }
73
+ });
74
+
75
+ // 监听webview的显示与隐藏
76
+ // const addEventListenerToWebview = () => {
77
+ // // webview的堆栈
78
+ // const pages = getCurrentPages()
79
+ // // 当前页面
80
+ // const page = pages[pages.length - 1]
81
+ // // 当前页面的webview实例
82
+ // const currentWebview = page.$getAppWebview()
83
+ // // 监听webview的显示与隐藏,从而停止或者开始动画(为了性能)
84
+ // currentWebview.addEventListener('hide', () => {
85
+ // webviewHide.value = true
86
+ // })
87
+ // currentWebview.addEventListener('show', () => {
88
+ // webviewHide.value = false
89
+ // })
90
+ // }
91
+ </script>
92
+
93
+ <style lang="scss" scoped>
94
+ @import "./index.scss";
95
+ </style>