hy-app 0.1.5 → 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 (166) hide show
  1. package/components/hy-address-picker/hy-address-picker.vue +11 -0
  2. package/components/hy-address-picker/index.scss +1 -1
  3. package/components/hy-avatar/hy-avatar.vue +11 -0
  4. package/components/hy-avatar/index.scss +8 -8
  5. package/components/hy-back-top/hy-back-top.vue +13 -2
  6. package/components/hy-back-top/index.scss +11 -1
  7. package/components/hy-badge/hy-badge.vue +11 -0
  8. package/components/hy-badge/index.scss +18 -40
  9. package/components/hy-button/hy-button.vue +15 -5
  10. package/components/hy-button/index.scss +25 -45
  11. package/components/hy-calendar/header.vue +12 -12
  12. package/components/hy-calendar/hy-calendar.vue +11 -2
  13. package/components/hy-calendar/index.scss +140 -131
  14. package/components/hy-calendar/month.vue +18 -18
  15. package/components/hy-card/hy-card.vue +11 -0
  16. package/components/hy-card/index.scss +12 -12
  17. package/components/hy-card/props.ts +2 -2
  18. package/components/hy-cell/hy-cell.vue +22 -13
  19. package/components/hy-cell/index.scss +55 -28
  20. package/components/hy-cell/props.ts +2 -3
  21. package/components/hy-cell/typing.d.ts +3 -10
  22. package/components/hy-check-button/hy-check-button.vue +13 -2
  23. package/components/hy-check-button/index.scss +0 -5
  24. package/components/hy-checkbox/hy-checkbox.vue +31 -8
  25. package/components/hy-checkbox/index.scss +15 -5
  26. package/components/hy-checkbox/props.ts +1 -2
  27. package/components/hy-checkbox/typing.d.ts +1 -1
  28. package/components/hy-config-provider/hy-config-provider.vue +52 -0
  29. package/components/hy-config-provider/index.scss +21 -0
  30. package/components/hy-config-provider/props.ts +13 -0
  31. package/components/hy-config-provider/typing.d.ts +28 -0
  32. package/components/hy-count-down/hy-count-down.vue +11 -0
  33. package/components/hy-count-down/index.scss +13 -1
  34. package/components/hy-count-to/hy-count-to.vue +12 -1
  35. package/components/hy-count-to/index.scss +14 -1
  36. package/components/hy-count-to/props.ts +1 -1
  37. package/components/hy-datetime-picker/hy-datetime-picker.vue +11 -0
  38. package/components/hy-datetime-picker/index.scss +1 -1
  39. package/components/hy-divider/hy-divider.vue +11 -0
  40. package/components/hy-divider/index.scss +1 -1
  41. package/components/hy-dropdown/hy-dropdown.vue +13 -1
  42. package/components/hy-dropdown/index.scss +4 -1
  43. package/components/hy-dropdown/props.ts +2 -2
  44. package/components/hy-dropdown-item/hy-dropdown-item.vue +21 -3
  45. package/components/hy-dropdown-item/index.scss +35 -2
  46. package/components/hy-empty/hy-empty.vue +22 -10
  47. package/components/hy-empty/index.scss +17 -3
  48. package/components/hy-empty/props.ts +1 -5
  49. package/components/hy-empty/typing.d.ts +3 -18
  50. package/components/hy-float-button/hy-float-button.vue +11 -0
  51. package/components/hy-float-button/index.scss +13 -2
  52. package/components/hy-float-button/props.ts +3 -3
  53. package/components/hy-folding-panel/hy-folding-panel.vue +11 -0
  54. package/components/hy-folding-panel/index.scss +4 -1
  55. package/components/hy-form/hy-form.vue +25 -9
  56. package/components/hy-form/index.scss +12 -2
  57. package/components/hy-grid/hy-grid.vue +11 -0
  58. package/components/hy-grid/index.scss +1 -1
  59. package/components/hy-icon/hy-icon.vue +12 -1
  60. package/components/hy-icon/index.scss +16 -7
  61. package/components/hy-icon/props.ts +2 -2
  62. package/components/hy-image/hy-image.vue +11 -0
  63. package/components/hy-image/index.scss +4 -3
  64. package/components/hy-input/hy-input.vue +31 -3
  65. package/components/hy-input/index.scss +12 -2
  66. package/components/hy-input/props.ts +1 -1
  67. package/components/hy-input/typing.d.ts +8 -0
  68. package/components/hy-line/hy-line.vue +11 -0
  69. package/components/hy-line/index.scss +4 -1
  70. package/components/hy-line-progress/hy-line-progress.vue +17 -2
  71. package/components/hy-line-progress/index.scss +20 -8
  72. package/components/hy-line-progress/props.ts +4 -4
  73. package/components/hy-line-progress/typing.d.ts +4 -0
  74. package/components/hy-list/hy-list.vue +23 -8
  75. package/components/hy-list/index.scss +1 -4
  76. package/components/hy-loading/hy-loading.vue +11 -0
  77. package/components/hy-loading/index.scss +2 -2
  78. package/components/hy-login/TheUserLogin.vue +63 -106
  79. package/components/hy-login/hy-login.vue +269 -266
  80. package/components/hy-login/props.ts +1 -1
  81. package/components/hy-login/typing.d.ts +5 -0
  82. package/components/hy-modal/hy-modal.vue +15 -7
  83. package/components/hy-modal/index.scss +19 -3
  84. package/components/hy-navbar/hy-navbar.vue +11 -0
  85. package/components/hy-navbar/index.scss +14 -3
  86. package/components/hy-navbar/props.ts +1 -1
  87. package/components/hy-notice-bar/hy-notice-bar.vue +11 -0
  88. package/components/hy-notice-bar/index.scss +35 -35
  89. package/components/hy-number-step/hy-number-step.vue +15 -8
  90. package/components/hy-number-step/index.scss +34 -25
  91. package/components/hy-number-step/props.ts +4 -4
  92. package/components/hy-overlay/index.scss +3 -1
  93. package/components/hy-picker/hy-picker.vue +12 -0
  94. package/components/hy-picker/index.scss +7 -3
  95. package/components/hy-picker/props.ts +1 -1
  96. package/components/hy-popup/hy-popup.vue +11 -0
  97. package/components/hy-popup/index.scss +10 -1
  98. package/components/hy-price/hy-price.vue +11 -0
  99. package/components/hy-price/index.scss +4 -1
  100. package/components/hy-qrcode/hy-qrcode.vue +11 -0
  101. package/components/hy-qrcode/index.scss +4 -1
  102. package/components/hy-radio/hy-radio.vue +19 -3
  103. package/components/hy-radio/index.scss +17 -5
  104. package/components/hy-radio/props.ts +1 -2
  105. package/components/hy-rate/hy-rate.vue +11 -0
  106. package/components/hy-rate/index.scss +6 -6
  107. package/components/hy-read-more/hy-read-more.vue +23 -2
  108. package/components/hy-read-more/index.scss +29 -2
  109. package/components/hy-read-more/props.ts +2 -7
  110. package/components/hy-scroll-list/hy-scroll-list.vue +31 -9
  111. package/components/hy-scroll-list/index.scss +10 -1
  112. package/components/hy-scroll-list/props.ts +2 -2
  113. package/components/hy-search/hy-search.vue +11 -0
  114. package/components/hy-search/index.scss +25 -4
  115. package/components/hy-search/props.ts +2 -2
  116. package/components/hy-slider/hy-slider.vue +11 -0
  117. package/components/hy-slider/index.scss +3 -2
  118. package/components/hy-slider/props.ts +1 -1
  119. package/components/hy-steps/hy-steps.vue +38 -20
  120. package/components/hy-steps/index.scss +57 -17
  121. package/components/hy-steps/props.ts +2 -2
  122. package/components/{hy-submitBar/hy-submitBar.vue → hy-submit-bar/hy-submit-bar.vue} +13 -34
  123. package/components/hy-submit-bar/index.scss +45 -0
  124. package/components/hy-subsection/hy-subsection.vue +12 -0
  125. package/components/hy-subsection/index.scss +28 -8
  126. package/components/hy-subsection/props.ts +3 -3
  127. package/components/hy-swiper/hy-swiper.vue +11 -0
  128. package/components/hy-swiper/index.scss +13 -2
  129. package/components/hy-switch/hy-switch.vue +17 -3
  130. package/components/hy-switch/index.scss +25 -7
  131. package/components/hy-switch/props.ts +1 -2
  132. package/components/hy-switch/typing.d.ts +3 -3
  133. package/components/hy-tabs/hy-tabs.vue +27 -15
  134. package/components/hy-tabs/index.scss +25 -4
  135. package/components/hy-tabs/props.ts +4 -10
  136. package/components/hy-tag/hy-tag.vue +13 -7
  137. package/components/hy-tag/index.scss +27 -115
  138. package/components/hy-text/hy-text.vue +12 -1
  139. package/components/hy-text/index.scss +20 -37
  140. package/components/hy-textarea/hy-textarea.vue +16 -5
  141. package/components/hy-textarea/index.scss +16 -5
  142. package/components/hy-toast/hy-toast.vue +12 -1
  143. package/components/hy-toast/index.scss +26 -26
  144. package/components/hy-tooltip/hy-tooltip.vue +11 -0
  145. package/components/hy-tooltip/index.scss +3 -3
  146. package/components/hy-tooltip/props.ts +1 -1
  147. package/components/hy-upload/hy-upload.vue +11 -0
  148. package/components/hy-upload/index.scss +12 -1
  149. package/components/hy-warn/hy-warn.vue +22 -11
  150. package/components/hy-warn/index.scss +46 -1
  151. package/components/hy-waterfall/hy-waterfall.vue +11 -0
  152. package/components/hy-waterfall/index.scss +1 -1
  153. package/config/icon.ts +4 -0
  154. package/libs/css/common.scss +9 -0
  155. package/libs/css/mixin.scss +78 -0
  156. package/package.json +2 -2
  157. package/public/font/iconfont.css +3 -3
  158. package/store/userInfo.ts +26 -25
  159. package/theme.scss +76 -60
  160. package/typing/modules/common.d.ts +4 -0
  161. package/utils/colorGradient.ts +1 -1
  162. package/utils/inside.ts +3 -0
  163. package/components/hy-submitBar/Index.vue +0 -17
  164. package/components/hy-submitBar/index.scss +0 -9
  165. /package/components/{hy-submitBar → hy-submit-bar}/props.ts +0 -0
  166. /package/components/{hy-submitBar → hy-submit-bar}/typing.d.ts +0 -0
@@ -1,6 +1,12 @@
1
1
  <template>
2
2
  <!-- 标题栏 -->
3
- <view class="hy-dropdown-item__header" @click="handleClick">
3
+ <view
4
+ :class="[
5
+ 'hy-dropdown-item__header',
6
+ isOpen && 'hy-dropdown-item__header--active',
7
+ ]"
8
+ @click="handleClick"
9
+ >
4
10
  <text
5
11
  class="hy-dropdown-item__header--title"
6
12
  :style="{ color: currentColor, fontSize: addUnit(titleSize) }"
@@ -31,7 +37,10 @@
31
37
  <!-- 选项 -->
32
38
  <view class="hy-dropdown-item__main--container__list" v-else>
33
39
  <view
34
- class="hy-dropdown-item__main--container__list-item"
40
+ :class="[
41
+ 'hy-dropdown-item__main--container__list-item',
42
+ isOpen && 'hy-dropdown-item__main--container__list--active',
43
+ ]"
35
44
  v-for="(item, index) in menus"
36
45
  :key="item.value || index"
37
46
  @click="onSelect(item, index)"
@@ -57,7 +66,16 @@
57
66
  </template>
58
67
 
59
68
  <script setup lang="ts">
60
- import {computed, inject, ref, onMounted, watch, useSlots, toRefs, getCurrentInstance} from "vue";
69
+ import {
70
+ computed,
71
+ inject,
72
+ ref,
73
+ onMounted,
74
+ watch,
75
+ useSlots,
76
+ toRefs,
77
+ getCurrentInstance,
78
+ } from "vue";
61
79
  import defaultProps from "./props";
62
80
  import type IProps from "./typing";
63
81
  import type FatherIProps from "../hy-dropdown/typing";
@@ -1,6 +1,22 @@
1
1
  @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
2
3
 
3
- .hy-dropdown-item {
4
+ /* 暗色主题 */
5
+ @include b(theme){
6
+ @include m(dark) {
7
+ @include b(dropdown-item) {
8
+ color: $hy-dark-color;
9
+ &__header {
10
+ background-color: $hy-dark-background--container;
11
+ }
12
+ &__main--container {
13
+ background-color: $hy-dark-background--container;
14
+ }
15
+ }
16
+ }
17
+ }
18
+
19
+ @include b(dropdown-item) {
4
20
  &__header {
5
21
  width: 100%;
6
22
  height: 100%;
@@ -15,6 +31,15 @@
15
31
  position: relative;
16
32
  z-index: 999;
17
33
  background-color: #ffffff;
34
+
35
+ &--active {
36
+ color: $hy-primary;
37
+ :deep() {
38
+ @include b(icon) {
39
+ color: $hy-primary;
40
+ }
41
+ }
42
+ }
18
43
  }
19
44
 
20
45
  &__main {
@@ -47,6 +72,14 @@
47
72
  width: 100%;
48
73
  padding: 0 35rpx;
49
74
  box-sizing: border-box;
75
+ &--active {
76
+ color: $hy-primary;
77
+ :deep() {
78
+ @include b(icon) {
79
+ color: $hy-primary;
80
+ }
81
+ }
82
+ }
50
83
  &-item {
51
84
  width: 100%;
52
85
  padding: 30rpx 0;
@@ -55,7 +88,7 @@
55
88
  align-items: center;
56
89
 
57
90
  &:not(:last-of-type) {
58
- border-bottom: 1px solid #f2f2f2;
91
+ border-bottom: $hy-border-line;
59
92
  }
60
93
 
61
94
  &--label {
@@ -14,20 +14,32 @@
14
14
  <view class="hy-empty__description" v-else>
15
15
  <slot v-if="$slots.description" name="description"></slot>
16
16
  <text v-else :style="descriptionStyle">{{ emptyDescription }}</text>
17
- <HyButton
18
- class="hy-empty__button"
19
- v-if="btnText"
20
- :text="btnText"
21
- :size="btnSize"
22
- :type="btnType"
23
- :shape="btnShape"
24
- :plain="btnPlain"
25
- @click="handleClick"
26
- ></HyButton>
17
+ <view class="hy-empty__button" v-if="button?.text">
18
+ <HyButton
19
+ :text="button?.text"
20
+ :size="button?.size"
21
+ :type="button?.type"
22
+ :shape="button?.shape"
23
+ :plain="button?.plain"
24
+ :custom-style="button?.customStyle"
25
+ @click="handleClick"
26
+ ></HyButton>
27
+ </view>
27
28
  </view>
28
29
  </view>
29
30
  </template>
30
31
 
32
+ <script lang="ts">
33
+ export default {
34
+ name: "hy-empty",
35
+ options: {
36
+ addGlobalClass: true,
37
+ virtualHost: true,
38
+ styleIsolation: "shared",
39
+ },
40
+ };
41
+ </script>
42
+
31
43
  <script setup lang="ts">
32
44
  import { computed, type CSSProperties, toRefs } from "vue";
33
45
  import defaultProps from "./props";
@@ -1,4 +1,17 @@
1
- .hy-empty {
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+ /* 暗色主题 */
5
+ @include b(theme){
6
+ @include m(dark) {
7
+ @include b(empty) {
8
+ background-color: $hy-dark-background;
9
+ color: $hy-dark-color;
10
+ }
11
+ }
12
+ }
13
+
14
+ @include b(empty) {
2
15
  top: 0;
3
16
  left: 0;
4
17
  width: 100%;
@@ -7,13 +20,14 @@
7
20
  justify-content: center;
8
21
  align-items: center;
9
22
  flex-direction: column;
10
- background: rgb(255, 255, 255);
23
+ background: $hy-light-background;
11
24
  &__description {
12
25
  width: 70%;
13
26
  text-align: center;
27
+ margin-top: $hy-border-margin-padding-base;
14
28
  }
15
29
 
16
30
  &__button {
17
- margin-top: 80rpx;
31
+ margin-top: 100rpx;
18
32
  }
19
33
  }
@@ -10,11 +10,7 @@ const defaultProps: IProps = {
10
10
  desSize: 15,
11
11
  desColor: "#5e6d82",
12
12
  imgMargin: "",
13
- btnText: "",
14
- btnSize: "normal",
15
- btnType: "primary",
16
- btnShape: "square",
17
- btnPlain: false,
13
+ button: {},
18
14
  navigateUrl: "",
19
15
  };
20
16
 
@@ -1,4 +1,5 @@
1
1
  import type { CSSProperties } from "vue";
2
+ import type HyButtonProps from "../hy-button/typing";
2
3
 
3
4
  export default interface HyEmptyProps {
4
5
  /**
@@ -38,25 +39,9 @@ export default interface HyEmptyProps {
38
39
  * */
39
40
  imgMargin?: string;
40
41
  /**
41
- * @description 按钮文字
42
+ * @description 按钮属性只
42
43
  * */
43
- btnText?: string;
44
- /**
45
- * @description 按钮尺寸,large,normal,mini (默认 normal)
46
- * */
47
- btnSize?: "normal" | "large" | "small" | "mini";
48
- /**
49
- * @description 按钮的预置样式,info,primary,error,warning,success (默认 'info' )
50
- * */
51
- btnType?: HyApp.ThemeType;
52
- /**
53
- * @description 按钮形状,circle(两边为半圆),square(带圆角) (默认 'square' )
54
- * */
55
- btnShape?: HyApp.ShapeType;
56
- /**
57
- * @description 按钮是否镂空,背景色透明 (默认 false)
58
- * */
59
- btnPlain?: boolean;
44
+ button?: HyButtonProps;
60
45
  /**
61
46
  * @description 跳转地址
62
47
  * */
@@ -57,6 +57,17 @@
57
57
  </view>
58
58
  </template>
59
59
 
60
+ <script lang="ts">
61
+ export default {
62
+ name: 'hy-float-button',
63
+ options: {
64
+ addGlobalClass: true,
65
+ virtualHost: true,
66
+ styleIsolation: 'shared'
67
+ }
68
+ }
69
+ </script>
70
+
60
71
  <script lang="ts" setup>
61
72
  import {
62
73
  computed,
@@ -1,10 +1,19 @@
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(float-button) {
8
+ //color: $hy-dark-color;
9
+ }
10
+ }
11
+ }
4
12
 
5
- .hy-float-button {
13
+ @include b(float-button) {
6
14
  position: relative;
7
- opacity: v-bind(opacity);
15
+ background-color: $hy-primary;
16
+ color: $hy-dark-color;
8
17
  &__circle {
9
18
  border-radius: $hy-border-radius-semicircle;
10
19
  }
@@ -38,6 +47,7 @@
38
47
  justify-content: center;
39
48
  align-items: center;
40
49
  transition: 0.4s ease;
50
+ background-color: $hy-primary;
41
51
  }
42
52
 
43
53
  &__menus {
@@ -46,6 +56,7 @@
46
56
  overflow: hidden;
47
57
  max-height: 250px;
48
58
  box-sizing: border-box;
59
+ background-color: $hy-primary;
49
60
  &--item {
50
61
  font-size: 28rpx;
51
62
  box-sizing: border-box;
@@ -6,14 +6,14 @@ const defaultProps: IProps = {
6
6
  direction: "column",
7
7
  icon: IconConfig.PLUS,
8
8
  iconSize: "",
9
- iconColor: "#FFFFFF",
9
+ iconColor: "",
10
10
  bottom: 80,
11
11
  left: 20,
12
12
  zIndex: 10086,
13
- bgColor: "#3D7EFF",
13
+ bgColor: "",
14
14
  text: "",
15
15
  fontSize: "12px",
16
- textColor: "#FFFFFF",
16
+ textColor: "",
17
17
  size: "medium",
18
18
  shape: "circle",
19
19
  opacity: 1,
@@ -38,6 +38,17 @@
38
38
  </view>
39
39
  </template>
40
40
 
41
+ <script lang="ts">
42
+ export default {
43
+ name: 'hy-folding-panel',
44
+ options: {
45
+ addGlobalClass: true,
46
+ virtualHost: true,
47
+ styleIsolation: 'shared'
48
+ }
49
+ }
50
+ </script>
51
+
41
52
  <script setup lang="ts">
42
53
  import { toRefs, ref, watch } from "vue";
43
54
  import defaultProps from "./props";
@@ -1,4 +1,7 @@
1
- .hy-folding-panel {
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+ @include b(folding-panel) {
2
5
  &__main {
3
6
  overflow: auto;
4
7
  transition: height 0.5s ease;
@@ -15,14 +15,7 @@
15
15
  <view class="hy-form--item__container">
16
16
  <view class="hy-form--item__container-content">
17
17
  <!-- 输入框 -->
18
- <view
19
- class="flex"
20
- v-if="
21
- item.type === FormTypeEnum.TEXT ||
22
- item.type === FormTypeEnum.NUMBER ||
23
- item.type === FormTypeEnum.PASSWORD
24
- "
25
- >
18
+ <view class="flex" v-if="isInput(item.type)">
26
19
  <HyInput
27
20
  v-model="formData[item.field]"
28
21
  :type="item.type"
@@ -67,6 +60,8 @@
67
60
  :customStyle="errorStyle(!!errors[item.field])"
68
61
  @change="handleChange($event, item)"
69
62
  @blur="handleBlur($event, item)"
63
+ @onPrefix="item?.input?.onPrefix"
64
+ @onSuffix="item?.input?.onSuffix"
70
65
  ></HyInput>
71
66
  </view>
72
67
  <!-- 输入框 -->
@@ -318,6 +313,17 @@
318
313
  </view>
319
314
  </template>
320
315
 
316
+ <script lang="ts">
317
+ export default {
318
+ name: 'hy-form',
319
+ options: {
320
+ addGlobalClass: true,
321
+ virtualHost: true,
322
+ styleIsolation: 'shared'
323
+ }
324
+ }
325
+ </script>
326
+
321
327
  <script setup lang="ts">
322
328
  import { computed, type CSSProperties, reactive, toRefs } from "vue";
323
329
  import type IProps from "./typing";
@@ -350,6 +356,10 @@ const {
350
356
  const emit = defineEmits(["click"]);
351
357
 
352
358
  const labelPos = labelPosition.value === "top" ? "column" : "row";
359
+ const isInput = (type: FormTypeEnum) =>
360
+ type === FormTypeEnum.TEXT ||
361
+ type === FormTypeEnum.NUMBER ||
362
+ type === FormTypeEnum.PASSWORD;
353
363
 
354
364
  /**
355
365
  * @description 错误输入框样式
@@ -358,7 +368,7 @@ const errorStyle = computed(() => {
358
368
  return (err: boolean) => {
359
369
  const style: CSSProperties = {};
360
370
  if (err) {
361
- style.background = "#FFF2F0";
371
+ style.background = "#dd6161";
362
372
  }
363
373
 
364
374
  return style;
@@ -494,12 +504,18 @@ const handleSubmit = () => {
494
504
  * @description 输入值触发
495
505
  * */
496
506
  const handleChange = (event: string, temp: FormColumnsType) => {
507
+ if (isInput(temp.type) && temp?.input?.onChange) {
508
+ temp.input.onChange(event, temp);
509
+ }
497
510
  validateField(temp.rules, event, temp.field, "change");
498
511
  };
499
512
  /**
500
513
  * @description 输入值触发
501
514
  * */
502
515
  const handleBlur = (event: string, temp: FormColumnsType) => {
516
+ if (isInput(temp.type) && temp?.input?.onBlur) {
517
+ temp.input.onBlur(event, temp);
518
+ }
503
519
  validateField(temp.rules, event, temp.field, "blur");
504
520
  };
505
521
 
@@ -1,7 +1,17 @@
1
1
  @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
2
3
 
3
- .hy-form {
4
- &--item {
4
+ /* 暗色主题 */
5
+ @include b(theme){
6
+ @include m(dark) {
7
+ @include b(form) {
8
+ color: $hy-dark-color;
9
+ }
10
+ }
11
+ }
12
+
13
+ @include b(form) {
14
+ @include m(item) {
5
15
  display: flex;
6
16
  //align-items: center;
7
17
  margin-bottom: $hy-border-margin-padding-lg;
@@ -35,6 +35,17 @@
35
35
  </view>
36
36
  </template>
37
37
 
38
+ <script lang="ts">
39
+ export default {
40
+ name: 'hy-grid',
41
+ options: {
42
+ addGlobalClass: true,
43
+ virtualHost: true,
44
+ styleIsolation: 'shared'
45
+ }
46
+ }
47
+ </script>
48
+
38
49
  <script setup lang="ts">
39
50
  import { computed, type CSSProperties, toRefs } from "vue";
40
51
  import defaultProps from "./props";
@@ -1,7 +1,7 @@
1
1
  @use "../../libs/css/mixin.scss" as *;
2
2
  @use "../../theme.scss" as *;
3
3
 
4
- .hy-grid {
4
+ @include b(grid) {
5
5
  justify-content: center;
6
6
  @include flex;
7
7
  flex-wrap: wrap;
@@ -28,6 +28,17 @@
28
28
  </view>
29
29
  </template>
30
30
 
31
+ <script lang="ts">
32
+ export default {
33
+ name: 'hy-icon',
34
+ options: {
35
+ addGlobalClass: true,
36
+ virtualHost: true,
37
+ styleIsolation: 'shared'
38
+ }
39
+ }
40
+ </script>
41
+
31
42
  <script setup lang="ts">
32
43
  import { computed, type CSSProperties, toRefs } from "vue";
33
44
  import { addUnit } from "../../utils";
@@ -77,7 +88,7 @@ const iconStyle = computed<CSSProperties>(() => {
77
88
  // 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
78
89
  top: addUnit(top.value),
79
90
  borderRadius: addUnit(round.value),
80
- color: color.value ? color.value : "#606266",
91
+ color: color.value,
81
92
  };
82
93
 
83
94
  return style;
@@ -2,29 +2,38 @@
2
2
  @use "../../public/font/iconfont.css" as *;
3
3
  @use "../../theme.scss" as *;
4
4
 
5
+ /* 暗色主题 */
6
+ @include b(theme){
7
+ @include m(dark) {
8
+ @include b(icon) {
9
+ color: $hy-dark-color;
10
+ }
11
+ }
12
+ }
5
13
 
6
- .hy-icon {
14
+ @include b(icon) {
7
15
  /* #ifndef APP-NVUE */
8
16
  display: flex;
9
17
  /* #endif */
10
18
  align-items: center;
19
+ color: $hy-text-color-grey;
11
20
 
12
- &--left {
21
+ @include m(left) {
13
22
  flex-direction: row-reverse;
14
23
  align-items: center;
15
24
  }
16
25
 
17
- &--right {
26
+ @include m(right) {
18
27
  flex-direction: row;
19
28
  align-items: center;
20
29
  }
21
30
 
22
- &--top {
31
+ @include m(top) {
23
32
  flex-direction: column-reverse;
24
33
  justify-content: center;
25
34
  }
26
35
 
27
- &--bottom {
36
+ @include m(bottom) {
28
37
  flex-direction: column;
29
38
  justify-content: center;
30
39
  }
@@ -63,14 +72,14 @@
63
72
  }
64
73
 
65
74
  &__label {
66
- @include line-feed();
75
+ @include lineEllipsis;
67
76
  overflow: hidden;
68
77
  /* #ifndef APP-NVUE */
69
78
  line-height: 1;
70
79
  /* #endif */
71
80
  }
72
81
  }
73
- .hy-rotate {
82
+ @include b(rotate) {
74
83
  animation: hy-rotate 1s infinite linear;
75
84
  @keyframes hy-rotate {
76
85
  0% {
@@ -9,8 +9,8 @@ const defaultProps: IProps = {
9
9
  customPrefix: "hy-icon",
10
10
  label: "",
11
11
  labelPos: "right",
12
- labelSize: "11px",
13
- labelColor: "#606266",
12
+ labelSize: "",
13
+ labelColor: "",
14
14
  space: "2px",
15
15
  imgMode: "",
16
16
  width: "",
@@ -54,6 +54,17 @@
54
54
  </HyTransition>
55
55
  </template>
56
56
 
57
+ <script lang="ts">
58
+ export default {
59
+ name: 'hy-image',
60
+ options: {
61
+ addGlobalClass: true,
62
+ virtualHost: true,
63
+ styleIsolation: 'shared'
64
+ }
65
+ }
66
+ </script>
67
+
57
68
  <script setup lang="ts">
58
69
  import {
59
70
  computed,
@@ -1,6 +1,7 @@
1
1
  @use "../../libs/css/mixin.scss" as *;
2
+ @use "../../theme.scss" as *;
2
3
 
3
- .hy-image {
4
+ @include b(image) {
4
5
  position: relative;
5
6
  transition: opacity 0.5s ease-in-out;
6
7
 
@@ -19,8 +20,8 @@
19
20
  @include flex;
20
21
  align-items: center;
21
22
  justify-content: center;
22
- background-color: #f8f8f8ff;
23
- color: #909193ff;
23
+ background-color: $hy-light-background-image;
24
+ color: $hy-text-color-grey;
24
25
  font-size: 46px;
25
26
  }
26
27
  }
@@ -7,6 +7,7 @@
7
7
  <view
8
8
  class="hy-input__content__prefix-icon"
9
9
  v-if="prefixIcon?.name || $slots.prefix"
10
+ @tap="onPrefix"
10
11
  >
11
12
  <slot name="prefix">
12
13
  <HyIcon
@@ -75,6 +76,7 @@
75
76
  <view
76
77
  class="hy-input__content__subfix-icon"
77
78
  v-if="suffixIcon?.name || $slots.suffix"
79
+ @tap="onSuffix"
78
80
  >
79
81
  <slot name="suffix">
80
82
  <HyIcon
@@ -97,6 +99,17 @@
97
99
  </view>
98
100
  </template>
99
101
 
102
+ <script lang="ts">
103
+ export default {
104
+ name: 'hy-input',
105
+ options: {
106
+ addGlobalClass: true,
107
+ virtualHost: true,
108
+ styleIsolation: 'shared'
109
+ }
110
+ }
111
+ </script>
112
+
100
113
  <script setup lang="ts">
101
114
  import {
102
115
  computed,
@@ -110,7 +123,7 @@ import type { CSSProperties } from "vue";
110
123
  import HyIcon from "../hy-icon/hy-icon.vue";
111
124
  import { addUnit, formatObject } from "../../utils";
112
125
  import defaultProps from "./props";
113
- import { ColorConfig, IconConfig } from "../../config";
126
+ import { IconConfig } from "../../config";
114
127
  import type IProps from "./typing";
115
128
 
116
129
  const props = withDefaults(defineProps<IProps>(), defaultProps);
@@ -134,6 +147,8 @@ const emit = defineEmits([
134
147
  "change",
135
148
  "update:modelValue",
136
149
  "clear",
150
+ "onPrefix",
151
+ "onSuffix",
137
152
  ]);
138
153
 
139
154
  const instance = getCurrentInstance();
@@ -233,10 +248,10 @@ const borderStyle = computed(() => {
233
248
  if (isFocus) {
234
249
  switch (border.value) {
235
250
  case "surround":
236
- style = { border: `1px solid ${ColorConfig.primary}` };
251
+ style = { border: `1px solid var(--hy-theme-color, #3c9cff)` };
237
252
  break;
238
253
  case "bottom":
239
- style = { borderBottom: `1px solid ${ColorConfig.primary}` };
254
+ style = { borderBottom: `1px solid var(--hy-theme-color, #3c9cff)` };
240
255
  break;
241
256
  default:
242
257
  break;
@@ -335,6 +350,19 @@ const clickHandler = () => {
335
350
  uni.hideKeyboard();
336
351
  }
337
352
  };
353
+
354
+ /**
355
+ * @description 点击前缀
356
+ * */
357
+ const onPrefix = () => {
358
+ emit("onPrefix");
359
+ };
360
+ /**
361
+ * @description 点击后缀
362
+ * */
363
+ const onSuffix = () => {
364
+ emit("onSuffix");
365
+ };
338
366
  </script>
339
367
 
340
368
  <style lang="scss" scoped>