hy-app 0.2.0 → 0.2.2

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 (104) hide show
  1. package/README.md +2 -1
  2. package/components/hy-back-top/index.scss +1 -10
  3. package/components/hy-badge/index.scss +5 -5
  4. package/components/hy-button/hy-button.vue +6 -7
  5. package/components/hy-button/index.scss +4 -11
  6. package/components/hy-calendar/index.scss +21 -24
  7. package/components/hy-calendar/month.vue +28 -6
  8. package/components/hy-calendar/props.ts +1 -1
  9. package/components/hy-card/index.scss +2 -11
  10. package/components/hy-cell/index.scss +9 -22
  11. package/components/hy-checkbox/hy-checkbox.vue +9 -6
  12. package/components/hy-checkbox/index.scss +14 -17
  13. package/components/hy-code-input/hy-code-input.vue +223 -0
  14. package/components/hy-code-input/index.scss +108 -0
  15. package/components/hy-code-input/props.ts +21 -0
  16. package/components/hy-code-input/typing.d.ts +65 -0
  17. package/components/hy-config-provider/hy-config-provider.vue +2 -1
  18. package/components/hy-config-provider/index.scss +2 -6
  19. package/components/hy-count-down/index.scss +0 -9
  20. package/components/hy-count-to/index.scss +1 -9
  21. package/components/hy-divider/index.scss +2 -1
  22. package/components/hy-divider/props.ts +2 -2
  23. package/components/hy-dropdown/index.scss +1 -1
  24. package/components/hy-dropdown/props.ts +1 -1
  25. package/components/hy-dropdown-item/hy-dropdown-item.vue +2 -5
  26. package/components/hy-dropdown-item/index.scss +13 -30
  27. package/components/hy-empty/index.scss +1 -10
  28. package/components/hy-float-button/index.scss +4 -9
  29. package/components/hy-form/index.scss +1 -8
  30. package/components/hy-grid/hy-grid.vue +5 -5
  31. package/components/hy-grid/index.scss +1 -1
  32. package/components/hy-icon/index.scss +4 -9
  33. package/components/hy-image/hy-image.vue +5 -5
  34. package/components/hy-image/index.scss +2 -2
  35. package/components/hy-image/props.ts +1 -1
  36. package/components/hy-input/hy-input.vue +9 -14
  37. package/components/hy-input/index.scss +10 -12
  38. package/components/hy-input/props.ts +1 -1
  39. package/components/hy-line/index.scss +1 -0
  40. package/components/hy-line/props.ts +1 -1
  41. package/components/hy-line-progress/index.scss +1 -12
  42. package/components/hy-loading/index.scss +2 -2
  43. package/components/hy-modal/hy-modal.vue +8 -5
  44. package/components/hy-modal/index.scss +7 -25
  45. package/components/hy-modal/props.ts +3 -3
  46. package/components/hy-navbar/index.scss +3 -14
  47. package/components/hy-notice-bar/index.scss +31 -41
  48. package/components/hy-notice-bar/props.ts +2 -2
  49. package/components/hy-notify/hy-notify.vue +169 -0
  50. package/components/hy-notify/index.scss +25 -0
  51. package/components/hy-notify/props.ts +14 -0
  52. package/components/hy-notify/typing.d.ts +44 -0
  53. package/components/hy-number-step/index.scss +6 -24
  54. package/components/hy-pagination/hy-pagination.vue +125 -0
  55. package/components/hy-pagination/index.scss +46 -0
  56. package/components/hy-pagination/props.ts +15 -0
  57. package/components/hy-pagination/typing.d.ts +44 -0
  58. package/components/hy-picker/index.scss +5 -1
  59. package/components/hy-popup/index.scss +1 -10
  60. package/components/hy-price/index.scss +0 -6
  61. package/components/hy-qrcode/index.scss +1 -1
  62. package/components/hy-radio/hy-radio.vue +8 -5
  63. package/components/hy-radio/index.scss +16 -18
  64. package/components/hy-rate/index.scss +1 -6
  65. package/components/hy-read-more/index.scss +3 -20
  66. package/components/hy-scroll-list/index.scss +1 -1
  67. package/components/hy-search/index.scss +6 -26
  68. package/components/hy-signature/canvasHelper.ts +51 -0
  69. package/components/hy-signature/hy-signature.vue +656 -0
  70. package/components/hy-signature/index.scss +31 -0
  71. package/components/hy-signature/props.ts +28 -0
  72. package/components/hy-signature/typing.d.ts +177 -0
  73. package/components/hy-slider/index.scss +6 -2
  74. package/components/hy-slider/props.ts +2 -2
  75. package/components/hy-steps/hy-steps.vue +38 -20
  76. package/components/hy-steps/index.scss +6 -17
  77. package/components/hy-submit-bar/index.scss +1 -9
  78. package/components/hy-subsection/index.scss +2 -16
  79. package/components/hy-swipe-action/hy-swipe-action.vue +288 -248
  80. package/components/hy-swipe-action/index.scss +32 -7
  81. package/components/hy-swipe-action/index.ts +34 -0
  82. package/components/hy-swipe-action/props.ts +15 -9
  83. package/components/hy-swipe-action/typing.d.ts +20 -22
  84. package/components/hy-swiper/index.scss +5 -10
  85. package/components/hy-switch/index.scss +19 -18
  86. package/components/hy-switch/props.ts +0 -1
  87. package/components/hy-tabs/index.scss +4 -18
  88. package/components/hy-tag/index.scss +3 -3
  89. package/components/hy-text/hy-text.vue +5 -4
  90. package/components/hy-text/index.scss +3 -15
  91. package/components/hy-textarea/hy-textarea.vue +5 -5
  92. package/components/hy-textarea/index.scss +8 -20
  93. package/components/hy-toast/index.scss +5 -22
  94. package/components/hy-tooltip/index.scss +7 -5
  95. package/components/hy-upload/index.scss +5 -15
  96. package/composables/index.ts +1 -0
  97. package/composables/useTouch.ts +48 -0
  98. package/index.scss +1 -0
  99. package/libs/css/mixin.scss +58 -13
  100. package/libs/css/vars.css +53 -0
  101. package/package.json +2 -2
  102. package/theme.scss +42 -54
  103. package/components/hy-swipe-action/index.wxs +0 -235
  104. package/components/hy-swipe-action/wxs.js +0 -15
@@ -1,14 +1,6 @@
1
1
  @use "../../theme.scss" as *;
2
2
  @use "../../libs/css/mixin.scss" as *;
3
3
 
4
- /* 暗色主题 */
5
- @include b(theme){
6
- @include m(dark) {
7
- @include b(radio__label-wrap) {
8
- color: $hy-dark-color;
9
- }
10
- }
11
- }
12
4
 
13
5
  @include b(radio) {
14
6
  @include flex(row);
@@ -64,28 +56,34 @@
64
56
 
65
57
  /* #endif */
66
58
 
67
- &--circle {
59
+ @include m(circle) {
68
60
  border-radius: 50%;
69
61
  }
70
62
 
71
- &--square {
63
+ @include m(square) {
72
64
  border-radius: 3px;
73
65
  }
74
66
 
75
- &--checked {
67
+ @include m(checked) {
76
68
  color: #FFFFFF;
77
69
  background-color: $hy-primary;
78
70
  border-color: $hy-primary;
79
71
  }
80
72
 
81
- &--disabled {
82
- background-color: $hy-light-background-disabled;
73
+ @include m(disabled) {
74
+ background-color: $hy-text-color--disabled;
75
+ :deep(.hy-icon) {
76
+ display: none;
77
+ }
83
78
  }
84
79
 
85
- &--disabled--checked {
80
+ @include m(disabled--checked) {
86
81
  background-color: $hy-primary;
87
82
  border-color: $hy-primary;
88
83
  opacity: 0.5;
84
+ :deep(.hy-icon) {
85
+ display: block;
86
+ }
89
87
  }
90
88
  }
91
89
 
@@ -93,13 +91,13 @@
93
91
  /* #ifndef APP-NVUE */
94
92
  word-wrap: break-word;
95
93
  /* #endif */
96
- color:
97
- $hy-light-color;
94
+
95
+ color: $hy-text-color;
98
96
  font-size: $hy-font-size-base;
99
97
  margin-right: $hy-border-margin-padding-sm;
100
98
 
101
- &--disabled {
102
- color: $hy-text-color-disable;
99
+ @include m(disabled) {
100
+ color: $hy-text-color--disabled;
103
101
  }
104
102
  }
105
103
  }
@@ -25,9 +25,4 @@
25
25
  }
26
26
  }
27
27
  }
28
- }
29
- //.hy-icon {
30
- // /* #ifndef APP-NVUE */
31
- // box-sizing: border-box;
32
- // /* #endif */
33
- //}
28
+ }
@@ -1,21 +1,6 @@
1
1
  @use "../../theme.scss" as *;
2
2
  @use "../../libs/css/mixin.scss" as *;
3
3
 
4
- /* 暗色主题 */
5
- @include b(theme){
6
- @include m(dark) {
7
- @include b(read-more) {
8
- color: $hy-dark-color;
9
- &__toggle--mask {
10
- background-image:
11
- linear-gradient(-180deg, rgba(0, 0, 0, 0) 0%, $hy-dark-background 80%);
12
- padding-top: 100px;
13
- margin-top: -100px;
14
- }
15
- }
16
- }
17
- }
18
-
19
4
  @include b(read-more) {
20
5
  &__content {
21
6
  overflow: hidden;
@@ -31,7 +16,7 @@
31
16
 
32
17
  &--mask {
33
18
  background-image:
34
- linear-gradient(-180deg, rgba(0, 0, 0, 0) 0%, #fff 80%);
19
+ linear-gradient(-180deg, rgba(0, 0, 0, 0) 0%, $hy-background--2 80%);
35
20
  padding-top: 100px;
36
21
  margin-top: -100px;
37
22
  }
@@ -42,10 +27,8 @@
42
27
  justify-content: center;
43
28
  margin-top: 5px;
44
29
  color: $hy-primary;
45
- :deep() {
46
- @include b(icon) {
47
- color: $hy-primary;
48
- }
30
+ :deep(.hy-icon) {
31
+ color: $hy-primary;
49
32
  }
50
33
  }
51
34
  }
@@ -30,7 +30,7 @@
30
30
  height: 4px;
31
31
  border-radius: $hy-border-radius-semicircle;
32
32
  overflow: hidden;
33
- background-color: var(--hy-theme-color--light, $hy-border-color);
33
+ background-color: $hy-background--empty;
34
34
 
35
35
  &__bar {
36
36
  width: 20px;
@@ -10,24 +10,6 @@ $hy-search-close-size: 20px !default;
10
10
  }
11
11
  /* #endif */
12
12
 
13
- /* 暗色主题 */
14
- @include b(theme){
15
- @include m(dark) {
16
- @include b(search) {
17
- color: $hy-dark-color;
18
- &__content {
19
- background-color: $hy-dark-background--empty;
20
- &__input {
21
- color: $hy-dark-color;
22
- }
23
- }
24
- &__action {
25
- color: $hy-dark-color;
26
- }
27
- }
28
- }
29
- }
30
-
31
13
  @include b(search) {
32
14
  @include flex(row);
33
15
  align-items: center;
@@ -43,6 +25,7 @@ $hy-search-close-size: 20px !default;
43
25
  border-color: transparent;
44
26
  border-style: solid;
45
27
  overflow: hidden;
28
+ background-color: $hy-background--empty;
46
29
 
47
30
  &__icon {
48
31
  @include flex;
@@ -50,8 +33,7 @@ $hy-search-close-size: 20px !default;
50
33
  }
51
34
 
52
35
  &__label {
53
- color:
54
- $hy-light-color;
36
+ color: $hy-text-color;
55
37
  font-size: $hy-font-size-base;
56
38
  margin: 0 4px;
57
39
  }
@@ -61,7 +43,7 @@ $hy-light-color;
61
43
  width: $hy-search-close-size;
62
44
  height: $hy-search-close-size;
63
45
  border-radius: $hy-border-radius-circle;
64
- background-color: #c6c7cb;
46
+ background-color: $hy-background--track;
65
47
  @include flex(row);
66
48
  align-items: center;
67
49
  justify-content: center;
@@ -74,19 +56,17 @@ $hy-light-color;
74
56
  font-size: $hy-font-size-base;
75
57
  line-height: 1;
76
58
  margin: 0 $hy-border-margin-padding-sm;
77
- color:
78
- $hy-light-color;
59
+ color: $hy-text-color;
79
60
 
80
61
  &--placeholder {
81
- color: $hy-text-color-grey;
62
+ color: $hy-text-color--placeholder;
82
63
  }
83
64
  }
84
65
  }
85
66
 
86
67
  &__action {
87
68
  font-size: $hy-font-size-base;
88
- color:
89
- $hy-light-color;
69
+ color: $hy-text-color;
90
70
  width: 0;
91
71
  overflow: hidden;
92
72
  transition-property: width;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * 适配 canvas 2d 上下文
3
+ * @param ctx canvas 2d 上下文
4
+ * @returns
5
+ */
6
+ export function canvas2dAdapter(
7
+ ctx: CanvasRenderingContext2D,
8
+ ): UniApp.CanvasContext {
9
+ return Object.assign(ctx, {
10
+ setFillStyle(color: string | CanvasGradient) {
11
+ ctx.fillStyle = color;
12
+ },
13
+ setStrokeStyle(color: string | CanvasGradient | CanvasPattern) {
14
+ ctx.strokeStyle = color;
15
+ },
16
+ setLineWidth(lineWidth: number) {
17
+ ctx.lineWidth = lineWidth;
18
+ },
19
+ setLineCap(lineCap: "butt" | "round" | "square") {
20
+ ctx.lineCap = lineCap;
21
+ },
22
+
23
+ setFontSize(font: string) {
24
+ ctx.font = font;
25
+ },
26
+ setGlobalAlpha(alpha: number) {
27
+ ctx.globalAlpha = alpha;
28
+ },
29
+ setLineJoin(lineJoin: "bevel" | "round" | "miter") {
30
+ ctx.lineJoin = lineJoin;
31
+ },
32
+ setTextAlign(align: "left" | "center" | "right") {
33
+ ctx.textAlign = align;
34
+ },
35
+ setMiterLimit(miterLimit: number) {
36
+ ctx.miterLimit = miterLimit;
37
+ },
38
+ setShadow(offsetX: number, offsetY: number, blur: number, color: string) {
39
+ ctx.shadowOffsetX = offsetX;
40
+ ctx.shadowOffsetY = offsetY;
41
+ ctx.shadowBlur = blur;
42
+ ctx.shadowColor = color;
43
+ },
44
+ setTextBaseline(textBaseline: "top" | "bottom" | "middle") {
45
+ ctx.textBaseline = textBaseline;
46
+ },
47
+ createCircularGradient() {},
48
+ draw() {},
49
+ addColorStop() {},
50
+ }) as unknown as UniApp.CanvasContext;
51
+ }