hy-app 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/components/hy-address-picker/hy-address-picker.vue +31 -10
  2. package/components/hy-address-picker/index.scss +1 -1
  3. package/components/hy-address-picker/props.ts +1 -3
  4. package/components/hy-address-picker/typing.d.ts +4 -11
  5. package/components/hy-avatar/hy-avatar.vue +11 -0
  6. package/components/hy-avatar/index.scss +8 -8
  7. package/components/hy-avatar/typing.d.ts +1 -1
  8. package/components/hy-back-top/hy-back-top.vue +27 -2
  9. package/components/hy-back-top/index.scss +11 -1
  10. package/components/hy-back-top/props.ts +1 -6
  11. package/components/hy-back-top/typing.d.ts +4 -7
  12. package/components/hy-badge/hy-badge.vue +11 -0
  13. package/components/hy-badge/index.scss +18 -40
  14. package/components/hy-badge/typing.d.ts +1 -1
  15. package/components/hy-button/hy-button.vue +44 -17
  16. package/components/hy-button/index.scss +25 -45
  17. package/components/hy-button/props.ts +1 -2
  18. package/components/hy-button/typing.d.ts +4 -7
  19. package/components/hy-calendar/header.vue +12 -12
  20. package/components/hy-calendar/hy-calendar.vue +11 -2
  21. package/components/hy-calendar/index.scss +140 -131
  22. package/components/hy-calendar/month.vue +18 -18
  23. package/components/hy-calendar/typing.d.ts +1 -1
  24. package/components/hy-card/hy-card.vue +11 -0
  25. package/components/hy-card/index.scss +12 -12
  26. package/components/hy-card/props.ts +2 -2
  27. package/components/hy-card/typing.d.ts +1 -1
  28. package/components/hy-cell/hy-cell.vue +57 -19
  29. package/components/hy-cell/index.scss +55 -28
  30. package/components/hy-cell/props.ts +4 -5
  31. package/components/hy-cell/typing.d.ts +11 -21
  32. package/components/hy-check-button/hy-check-button.vue +13 -2
  33. package/components/hy-check-button/index.scss +0 -5
  34. package/components/hy-check-button/typing.d.ts +1 -1
  35. package/components/hy-checkbox/hy-checkbox.vue +34 -10
  36. package/components/hy-checkbox/index.scss +15 -5
  37. package/components/hy-checkbox/props.ts +2 -3
  38. package/components/hy-checkbox/typing.d.ts +3 -3
  39. package/components/hy-config-provider/hy-config-provider.vue +52 -0
  40. package/components/hy-config-provider/index.scss +21 -0
  41. package/components/hy-config-provider/props.ts +13 -0
  42. package/components/hy-config-provider/typing.d.ts +28 -0
  43. package/components/hy-count-down/hy-count-down.vue +11 -0
  44. package/components/hy-count-down/index.scss +13 -1
  45. package/components/hy-count-down/typing.d.ts +1 -1
  46. package/components/hy-count-to/hy-count-to.vue +12 -1
  47. package/components/hy-count-to/index.scss +14 -1
  48. package/components/hy-count-to/props.ts +1 -1
  49. package/components/hy-count-to/typing.d.ts +1 -3
  50. package/components/hy-datetime-picker/hy-datetime-picker.vue +29 -14
  51. package/components/hy-datetime-picker/index.scss +1 -1
  52. package/components/hy-datetime-picker/props.ts +1 -3
  53. package/components/hy-datetime-picker/typing.d.ts +6 -13
  54. package/components/hy-divider/hy-divider.vue +11 -0
  55. package/components/hy-divider/index.scss +1 -1
  56. package/components/hy-divider/typing.d.ts +1 -1
  57. package/components/hy-dropdown/hy-dropdown.vue +13 -1
  58. package/components/hy-dropdown/index.scss +4 -1
  59. package/components/hy-dropdown/props.ts +2 -2
  60. package/components/hy-dropdown/typing.d.ts +1 -1
  61. package/components/hy-dropdown-item/hy-dropdown-item.vue +21 -3
  62. package/components/hy-dropdown-item/index.scss +35 -2
  63. package/components/hy-dropdown-item/typing.d.ts +1 -3
  64. package/components/hy-empty/hy-empty.vue +22 -10
  65. package/components/hy-empty/index.scss +17 -3
  66. package/components/hy-empty/props.ts +1 -5
  67. package/components/hy-empty/typing.d.ts +4 -19
  68. package/components/hy-float-button/hy-float-button.vue +11 -0
  69. package/components/hy-float-button/index.scss +13 -2
  70. package/components/hy-float-button/props.ts +3 -3
  71. package/components/hy-float-button/typing.d.ts +1 -1
  72. package/components/hy-folding-panel/hy-folding-panel.vue +11 -0
  73. package/components/hy-folding-panel/index.scss +4 -1
  74. package/components/hy-folding-panel/typing.d.ts +1 -1
  75. package/components/hy-form/hy-form.vue +214 -36
  76. package/components/hy-form/index.scss +13 -3
  77. package/components/hy-form/props.ts +0 -2
  78. package/components/hy-form/typing.d.ts +25 -7
  79. package/components/hy-grid/hy-grid.vue +27 -5
  80. package/components/hy-grid/index.scss +1 -1
  81. package/components/hy-grid/props.ts +1 -3
  82. package/components/hy-grid/typing.d.ts +13 -16
  83. package/components/hy-icon/hy-icon.vue +17 -10
  84. package/components/hy-icon/index.scss +16 -7
  85. package/components/hy-icon/props.ts +2 -2
  86. package/components/hy-icon/typing.d.ts +1 -1
  87. package/components/hy-image/hy-image.vue +11 -0
  88. package/components/hy-image/index.scss +4 -3
  89. package/components/hy-image/typing.d.ts +1 -1
  90. package/components/hy-input/hy-input.vue +58 -19
  91. package/components/hy-input/index.scss +12 -2
  92. package/components/hy-input/props.ts +3 -5
  93. package/components/hy-input/typing.d.ts +13 -12
  94. package/components/hy-line/hy-line.vue +11 -0
  95. package/components/hy-line/index.scss +4 -1
  96. package/components/hy-line/typing.d.ts +1 -1
  97. package/components/hy-line-progress/hy-line-progress.vue +17 -2
  98. package/components/hy-line-progress/index.scss +20 -8
  99. package/components/hy-line-progress/props.ts +4 -4
  100. package/components/hy-line-progress/typing.d.ts +5 -1
  101. package/components/hy-list/hy-list.vue +23 -8
  102. package/components/hy-list/index.scss +1 -4
  103. package/components/hy-list/typing.d.ts +1 -1
  104. package/components/hy-loading/hy-loading.vue +11 -0
  105. package/components/hy-loading/index.scss +2 -2
  106. package/components/hy-loading/typing.d.ts +1 -2
  107. package/components/hy-login/TheUserLogin.vue +63 -106
  108. package/components/hy-login/hy-login.vue +15 -10
  109. package/components/hy-login/props.ts +1 -1
  110. package/components/hy-login/typing.d.ts +6 -1
  111. package/components/hy-modal/hy-modal.vue +15 -7
  112. package/components/hy-modal/index.scss +19 -3
  113. package/components/hy-modal/typing.d.ts +1 -1
  114. package/components/hy-navbar/hy-navbar.vue +11 -0
  115. package/components/hy-navbar/index.scss +14 -3
  116. package/components/hy-navbar/props.ts +1 -1
  117. package/components/hy-navbar/typing.d.ts +1 -2
  118. package/components/hy-notice-bar/hy-notice-bar.vue +11 -0
  119. package/components/hy-notice-bar/index.scss +35 -35
  120. package/components/hy-notice-bar/typing.d.ts +1 -1
  121. package/components/hy-number-step/hy-number-step.vue +40 -18
  122. package/components/hy-number-step/index.scss +34 -25
  123. package/components/hy-number-step/props.ts +4 -4
  124. package/components/hy-number-step/typing.d.ts +8 -3
  125. package/components/hy-overlay/index.scss +3 -1
  126. package/components/hy-overlay/typing.d.ts +1 -1
  127. package/components/hy-parse/typing.d.ts +1 -1
  128. package/components/hy-picker/hy-picker.vue +30 -8
  129. package/components/hy-picker/index.scss +7 -3
  130. package/components/hy-picker/props.ts +2 -5
  131. package/components/hy-picker/typing.d.ts +4 -15
  132. package/components/hy-popup/hy-popup.vue +11 -0
  133. package/components/hy-popup/index.scss +10 -1
  134. package/components/hy-popup/typing.d.ts +1 -1
  135. package/components/hy-price/hy-price.vue +11 -0
  136. package/components/hy-price/index.scss +4 -1
  137. package/components/hy-price/typing.d.ts +1 -1
  138. package/components/hy-qrcode/hy-qrcode.vue +11 -0
  139. package/components/hy-qrcode/index.scss +4 -1
  140. package/components/hy-qrcode/typing.d.ts +1 -1
  141. package/components/hy-radio/hy-radio.vue +25 -5
  142. package/components/hy-radio/index.scss +17 -5
  143. package/components/hy-radio/props.ts +2 -3
  144. package/components/hy-radio/typing.d.ts +2 -2
  145. package/components/hy-rate/hy-rate.vue +11 -0
  146. package/components/hy-rate/index.scss +6 -6
  147. package/components/hy-rate/typing.d.ts +1 -1
  148. package/components/hy-read-more/hy-read-more.vue +23 -2
  149. package/components/hy-read-more/index.scss +29 -2
  150. package/components/hy-read-more/props.ts +2 -7
  151. package/components/hy-read-more/typing.d.ts +1 -1
  152. package/components/hy-scroll-list/hy-scroll-list.vue +31 -9
  153. package/components/hy-scroll-list/index.scss +10 -1
  154. package/components/hy-scroll-list/props.ts +2 -2
  155. package/components/hy-scroll-list/typing.d.ts +1 -1
  156. package/components/hy-search/hy-search.vue +23 -3
  157. package/components/hy-search/index.scss +25 -4
  158. package/components/hy-search/props.ts +3 -5
  159. package/components/hy-search/typing.d.ts +6 -13
  160. package/components/hy-slider/hy-slider.vue +11 -0
  161. package/components/hy-slider/index.scss +3 -2
  162. package/components/hy-slider/props.ts +1 -1
  163. package/components/hy-slider/typing.d.ts +1 -1
  164. package/components/hy-status-bar/typing.d.ts +1 -1
  165. package/components/hy-steps/hy-steps.vue +38 -20
  166. package/components/hy-steps/index.scss +57 -17
  167. package/components/hy-steps/props.ts +2 -2
  168. package/components/hy-steps/typing.d.ts +1 -1
  169. package/components/{hy-submitBar/hy-submitBar.vue → hy-submit-bar/hy-submit-bar.vue} +13 -34
  170. package/components/hy-submit-bar/index.scss +45 -0
  171. package/components/{hy-submitBar → hy-submit-bar}/typing.d.ts +1 -1
  172. package/components/hy-subsection/hy-subsection.vue +12 -0
  173. package/components/hy-subsection/index.scss +28 -8
  174. package/components/hy-subsection/props.ts +3 -3
  175. package/components/hy-subsection/typing.d.ts +1 -1
  176. package/components/hy-swipe-action/typing.d.ts +1 -1
  177. package/components/hy-swiper/hy-swiper.vue +11 -0
  178. package/components/hy-swiper/index.scss +13 -2
  179. package/components/hy-swiper/typing.d.ts +2 -5
  180. package/components/hy-switch/hy-switch.vue +28 -5
  181. package/components/hy-switch/index.scss +25 -7
  182. package/components/hy-switch/props.ts +1 -3
  183. package/components/hy-switch/typing.d.ts +6 -5
  184. package/components/hy-tabs/hy-tabs.vue +27 -15
  185. package/components/hy-tabs/index.scss +25 -4
  186. package/components/hy-tabs/props.ts +4 -10
  187. package/components/hy-tabs/typing.d.ts +1 -1
  188. package/components/hy-tag/hy-tag.vue +38 -22
  189. package/components/hy-tag/index.scss +27 -115
  190. package/components/hy-tag/props.ts +1 -2
  191. package/components/hy-tag/typing.d.ts +3 -10
  192. package/components/hy-text/hy-text.vue +12 -1
  193. package/components/hy-text/index.scss +20 -37
  194. package/components/hy-text/typing.d.ts +1 -1
  195. package/components/hy-textarea/hy-textarea.vue +17 -6
  196. package/components/hy-textarea/index.scss +16 -5
  197. package/components/hy-textarea/typing.d.ts +2 -2
  198. package/components/hy-toast/hy-toast.vue +13 -2
  199. package/components/hy-toast/index.scss +26 -26
  200. package/components/hy-toast/typing.d.ts +1 -1
  201. package/components/hy-tooltip/hy-tooltip.vue +11 -0
  202. package/components/hy-tooltip/index.scss +3 -3
  203. package/components/hy-tooltip/props.ts +1 -1
  204. package/components/hy-tooltip/typing.d.ts +1 -1
  205. package/components/hy-transition/typing.d.ts +1 -1
  206. package/components/hy-upload/hy-upload.vue +11 -0
  207. package/components/hy-upload/index.scss +12 -1
  208. package/components/hy-upload/typing.d.ts +1 -1
  209. package/components/hy-warn/hy-warn.vue +22 -11
  210. package/components/hy-warn/index.scss +46 -1
  211. package/components/hy-warn/typing.d.ts +1 -1
  212. package/components/hy-waterfall/hy-waterfall.vue +11 -0
  213. package/components/hy-waterfall/index.scss +1 -1
  214. package/components/hy-waterfall/typing.d.ts +1 -3
  215. package/components/index.ts +2 -2
  216. package/config/icon.ts +4 -0
  217. package/libs/css/common.scss +9 -0
  218. package/libs/css/mixin.scss +78 -0
  219. package/package.json +3 -3
  220. package/public/font/iconfont.css +3 -3
  221. package/store/userInfo.ts +26 -25
  222. package/theme.scss +76 -60
  223. package/typing/modules/common.d.ts +5 -1
  224. package/typing/modules/form.ts +29 -14
  225. package/utils/colorGradient.ts +1 -1
  226. package/utils/inside.ts +3 -0
  227. package/components/hy-submitBar/Index.vue +0 -17
  228. package/components/hy-submitBar/index.scss +0 -9
  229. /package/components/{hy-submitBar → hy-submit-bar}/props.ts +0 -0
@@ -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,6 +1,7 @@
1
1
  import type { CSSProperties } from "vue";
2
+ import type HyButtonProps from "../hy-button/typing";
2
3
 
3
- export default interface IProps {
4
+ export default interface HyEmptyProps {
4
5
  /**
5
6
  * @description 是否显示空状态
6
7
  * */
@@ -38,25 +39,9 @@ export default interface IProps {
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,
@@ -13,7 +13,7 @@ interface MenusVo {
13
13
 
14
14
  export type MenusType = MenusVo | string;
15
15
 
16
- export default interface IProps {
16
+ export default interface HyFloatButtonProps {
17
17
  /**
18
18
  * @description 菜单栏集合
19
19
  * */
@@ -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;
@@ -11,7 +11,7 @@ export interface PanelVo extends CellContentVo {
11
11
  * */
12
12
  content?: string;
13
13
  }
14
- export default interface IProps {
14
+ export default interface HyFoldingPanelProps {
15
15
  /**
16
16
  * @description 数据集
17
17
  * */
@@ -15,26 +15,53 @@
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"
29
- :placeholder="item.placeholder"
30
- :disabled="disabled || item.disabled"
31
- :clearable="item.clearable"
32
- :readonly="item.readonly"
33
- :shape="shape || item.shape"
34
- :border="border || item.border"
22
+ :disabled="item?.input?.disabled || input?.disabled"
23
+ :disabledColor="
24
+ item?.input?.disabledColor || input?.disabledColor
25
+ "
26
+ :maxlength="item?.input?.maxlength || input?.maxlength"
27
+ :password="item?.input?.password"
28
+ :clearable="item?.input?.clearable || input?.clearable"
29
+ :readonly="item?.input?.readonly || input?.readonly"
30
+ :placeholder="item?.input?.placeholder"
31
+ :placeholderClass="
32
+ item?.input?.placeholderClass || input?.placeholderClass
33
+ "
34
+ :placeholderStyle="
35
+ item?.input?.placeholderStyle || input?.placeholderStyle
36
+ "
37
+ :showWordLimit="
38
+ item?.input?.showWordLimit || input?.showWordLimit
39
+ "
40
+ :confirmType="item?.input?.confirmType || input?.confirmType"
41
+ :confirmHold="item?.input?.confirmHold || input?.confirmHold"
42
+ :holdKeyboard="item?.input?.holdKeyboard || input?.holdKeyboard"
43
+ :focus="item?.input?.focus || input?.focus"
44
+ :autoBlur="item?.input?.autoBlur || input?.autoBlur"
45
+ :selectionStart="
46
+ item?.input?.selectionStart || input?.selectionStart
47
+ "
48
+ :selectionEnd="item?.input?.selectionEnd || input?.selectionEnd"
49
+ :adjustPosition="
50
+ item?.input?.adjustPosition || input?.adjustPosition
51
+ "
52
+ :inputAlign="item?.input?.inputAlign || input?.inputAlign"
53
+ :fontSize="item?.input?.fontSize || input?.fontSize"
54
+ :color="item?.input?.color || input?.color"
55
+ :prefixIcon="item?.input?.prefixIcon || input?.prefixIcon"
56
+ :suffixIcon="item?.input?.suffixIcon || input?.suffixIcon"
57
+ :formatter="item?.input?.formatter || input?.formatter"
58
+ :shape="item?.input?.shape || input?.shape"
59
+ :border="item?.input?.border || input?.border"
35
60
  :customStyle="errorStyle(!!errors[item.field])"
36
61
  @change="handleChange($event, item)"
37
62
  @blur="handleBlur($event, item)"
63
+ @onPrefix="item?.input?.onPrefix"
64
+ @onSuffix="item?.input?.onSuffix"
38
65
  ></HyInput>
39
66
  </view>
40
67
  <!-- 输入框 -->
@@ -61,25 +88,76 @@
61
88
  <view class="flex" v-if="item.type === FormTypeEnum.TEXTAREA">
62
89
  <HyTextarea
63
90
  v-model="formData[item.field]"
64
- :disabled="disabled || item.disabled"
65
- :placeholder="item.placeholder"
66
- :clearable="item.clearable"
67
- :readonly="item.readonly"
68
- :shape="shape || item.shape"
69
- :border="border || item.border"
91
+ :disabled="item?.textarea?.disabled || textarea?.disabled"
92
+ :maxlength="item?.textarea?.maxlength || textarea?.maxlength"
93
+ :placeholder="item?.textarea?.placeholder"
94
+ :placeholderClass="
95
+ item?.textarea?.placeholderClass || textarea?.placeholderClass
96
+ "
97
+ :placeholderStyle="
98
+ item?.textarea?.placeholderStyle || textarea?.placeholderStyle
99
+ "
100
+ :holdKeyboard="
101
+ item?.textarea?.holdKeyboard || textarea?.holdKeyboard
102
+ "
103
+ :focus="item?.textarea?.focus || textarea?.focus"
104
+ :selectionStart="
105
+ item?.textarea?.selectionStart || textarea?.selectionStart
106
+ "
107
+ :selectionEnd="
108
+ item?.textarea?.selectionEnd || textarea?.selectionEnd
109
+ "
110
+ :adjustPosition="
111
+ item?.textarea?.adjustPosition || textarea?.adjustPosition
112
+ "
113
+ :formatter="item?.textarea?.formatter || textarea?.formatter"
114
+ :border="item?.textarea?.border || textarea?.border"
70
115
  :customStyle="errorStyle(!!errors[item.field])"
116
+ :height="textarea?.height || item?.textarea?.height"
71
117
  @change="handleChange($event, item)"
72
118
  @blur="handleBlur($event, item)"
73
119
  ></HyTextarea>
74
120
  </view>
75
121
  <!-- 文本域 -->
76
122
 
123
+ <!-- 复选框/单选框 -->
124
+ <template v-if="item.type === FormTypeEnum.CHECK_BUTTON">
125
+ <hy-check-button
126
+ v-model="formData[item.field]"
127
+ :columns="item.actions"
128
+ :type="item?.checkButton?.type || checkButton?.type"
129
+ :shape="item?.checkButton?.shape || checkButton?.shape"
130
+ :size="item?.checkButton?.size || checkButton?.size"
131
+ :col="item?.checkButton?.col || checkButton?.col"
132
+ :gap="item?.checkButton?.gap || checkButton?.gap"
133
+ :fieldNames="
134
+ item?.checkButton?.fieldNames || checkButton?.fieldNames
135
+ "
136
+ :disabled="item?.checkButton?.size || checkButton?.disabled"
137
+ :selectType="
138
+ item?.checkButton?.selectType || checkButton?.selectType
139
+ "
140
+ ></hy-check-button>
141
+ </template>
142
+ <!-- 复选框/单选框 -->
143
+
77
144
  <!-- 单选框 -->
78
- <template v-if="item.type === 'radio'">
145
+ <template v-if="item.type === FormTypeEnum.RADIO">
79
146
  <HyRadio
80
147
  v-model="formData[item.field]"
81
- :disabled="disabled || item.disabled"
82
148
  :columns="item.actions"
149
+ :fieldNames="item?.radio?.fieldNames || radio?.fieldNames"
150
+ :shape="item?.radio?.shape || radio?.shape"
151
+ :disabled="item?.radio?.disabled || radio?.disabled"
152
+ :size="item?.radio?.size || radio?.size"
153
+ :activeColor="item?.radio?.activeColor || radio?.activeColor"
154
+ :inactiveColor="
155
+ item?.radio?.inactiveColor || radio?.inactiveColor
156
+ "
157
+ :iconSize="item?.radio?.iconSize || radio?.iconSize"
158
+ :iconColor="item?.radio?.iconColor || radio?.iconColor"
159
+ :labelDisabled="item?.radio?.disabled || radio?.labelDisabled"
160
+ :placement="item?.radio?.placement || radio?.placement"
83
161
  ></HyRadio>
84
162
  </template>
85
163
  <!-- 单选框 -->
@@ -88,7 +166,28 @@
88
166
  <template v-if="item.type === FormTypeEnum.SWITCH">
89
167
  <HySwitch
90
168
  v-model="formData[item.field]"
91
- :disabled="disabled || item.disabled"
169
+ :loading="item?.switchItem?.loading || switchItem?.loading"
170
+ :disabled="item?.switchItem?.disabled || switchItem?.disabled"
171
+ :size="item?.switchItem?.size || switchItem?.size"
172
+ :activeColor="
173
+ item?.switchItem?.activeColor || switchItem?.activeColor
174
+ "
175
+ :inactiveColor="
176
+ item?.switchItem?.inactiveColor || switchItem?.inactiveColor
177
+ "
178
+ :activeValue="
179
+ item?.switchItem?.activeValue || switchItem?.activeValue
180
+ "
181
+ :inactiveValue="
182
+ item?.switchItem?.inactiveValue || switchItem?.inactiveValue
183
+ "
184
+ :activeIcon="
185
+ item?.switchItem?.activeIcon || switchItem?.activeIcon
186
+ "
187
+ :inactiveIcon="
188
+ item?.switchItem?.inactiveIcon || switchItem?.inactiveIcon
189
+ "
190
+ :space="item?.switchItem?.space || switchItem?.space"
92
191
  ></HySwitch>
93
192
  </template>
94
193
  <!-- 开关 -->
@@ -99,11 +198,29 @@
99
198
  v-model="formData[item.field]"
100
199
  :columns="item.select"
101
200
  has-input
102
- :disabled="disabled || item.disabled"
103
- :placeholder="item.placeholder"
104
- :shape="shape || item.shape"
105
- :border="border || item.border"
201
+ :separator="item?.picker?.separator || picker?.separator"
202
+ :itemHeight="item?.picker?.itemHeight || picker?.itemHeight"
203
+ :cancelText="item?.picker?.cancelText || picker?.cancelText"
204
+ :confirmText="item?.picker?.confirmText || picker?.confirmText"
205
+ :cancelColor="item?.picker?.cancelColor || picker?.cancelColor"
206
+ :confirmColor="item?.picker?.confirmColor || picker?.confirmColor"
207
+ :visibleItemCount="
208
+ item?.picker?.visibleItemCount || picker?.visibleItemCount
209
+ "
210
+ :closeOnClickOverlay="
211
+ item?.picker?.closeOnClickOverlay || picker?.closeOnClickOverlay
212
+ "
213
+ :title="item?.picker?.title || picker?.title"
214
+ :showToolbar="item?.picker?.showToolbar || picker?.showToolbar"
106
215
  :customStyle="errorStyle(!!errors[item.field])"
216
+ :input="{
217
+ disabled:
218
+ item?.picker?.input?.disabled || picker?.input?.disabled,
219
+ placeholder: item.picker?.input?.placeholder,
220
+ shape: item?.picker?.input?.shape || picker?.input?.shape,
221
+ border: item?.picker?.input?.border || picker?.input?.border,
222
+ customStyle: errorStyle(!!errors[item.field]),
223
+ }"
107
224
  ></HyPicker>
108
225
  </template>
109
226
  <!-- 自定义选择器 -->
@@ -114,11 +231,29 @@
114
231
  v-model="formData[item.field]"
115
232
  has-input
116
233
  :mode="item.mode"
117
- :disabled="disabled || item.disabled"
118
- :placeholder="item.placeholder"
119
- :shape="shape || item.shape"
120
- :border="border || item.border"
234
+ :separator="item?.picker?.separator || picker?.separator"
235
+ :itemHeight="item?.picker?.itemHeight || picker?.itemHeight"
236
+ :cancelText="item?.picker?.cancelText || picker?.cancelText"
237
+ :confirmText="item?.picker?.confirmText || picker?.confirmText"
238
+ :cancelColor="item?.picker?.cancelColor || picker?.cancelColor"
239
+ :confirmColor="item?.picker?.confirmColor || picker?.confirmColor"
240
+ :visibleItemCount="
241
+ item?.picker?.visibleItemCount || picker?.visibleItemCount
242
+ "
243
+ :closeOnClickOverlay="
244
+ item?.picker?.closeOnClickOverlay || picker?.closeOnClickOverlay
245
+ "
246
+ :title="item?.picker?.title || picker?.title"
247
+ :showToolbar="item?.picker?.showToolbar || picker?.showToolbar"
121
248
  :customStyle="errorStyle(!!errors[item.field])"
249
+ :input="{
250
+ disabled:
251
+ item?.picker?.input?.disabled || picker?.input?.disabled,
252
+ placeholder: item.picker?.input?.placeholder,
253
+ shape: item?.picker?.input?.shape || picker?.input?.shape,
254
+ border: item?.picker?.input?.border || picker?.input?.border,
255
+ customStyle: errorStyle(!!errors[item.field]),
256
+ }"
122
257
  ></HyDatetimePicker>
123
258
  </template>
124
259
  <!-- 时间选择器 -->
@@ -128,11 +263,29 @@
128
263
  <HyAddressPicker
129
264
  v-model="formData[item.field]"
130
265
  has-input
131
- :disabled="disabled || item.disabled"
132
- :placeholder="item.placeholder"
133
- :shape="shape || item.shape"
134
- :border="border || item.border"
266
+ :separator="item?.picker?.separator || picker?.separator"
267
+ :itemHeight="item?.picker?.itemHeight || picker?.itemHeight"
268
+ :cancelText="item?.picker?.cancelText || picker?.cancelText"
269
+ :confirmText="item?.picker?.confirmText || picker?.confirmText"
270
+ :cancelColor="item?.picker?.cancelColor || picker?.cancelColor"
271
+ :confirmColor="item?.picker?.confirmColor || picker?.confirmColor"
272
+ :visibleItemCount="
273
+ item?.picker?.visibleItemCount || picker?.visibleItemCount
274
+ "
275
+ :closeOnClickOverlay="
276
+ item?.picker?.closeOnClickOverlay || picker?.closeOnClickOverlay
277
+ "
278
+ :title="item?.picker?.title || picker?.title"
279
+ :showToolbar="item?.picker?.showToolbar || picker?.showToolbar"
135
280
  :customStyle="errorStyle(!!errors[item.field])"
281
+ :input="{
282
+ disabled:
283
+ item?.picker?.input?.disabled || picker?.input?.disabled,
284
+ placeholder: item.picker?.input?.placeholder,
285
+ shape: item?.picker?.input?.shape || picker?.input?.shape,
286
+ border: item?.picker?.input?.border || picker?.input?.border,
287
+ customStyle: errorStyle(!!errors[item.field]),
288
+ }"
136
289
  ></HyAddressPicker>
137
290
  </template>
138
291
  <!-- 地址选择器 -->
@@ -160,6 +313,17 @@
160
313
  </view>
161
314
  </template>
162
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
+
163
327
  <script setup lang="ts">
164
328
  import { computed, type CSSProperties, reactive, toRefs } from "vue";
165
329
  import type IProps from "./typing";
@@ -178,6 +342,7 @@ import HyRadio from "../hy-radio/hy-radio.vue";
178
342
  import HyDatetimePicker from "../hy-datetime-picker/hy-datetime-picker.vue";
179
343
  import HyAddressPicker from "../hy-address-picker/hy-address-picker.vue";
180
344
  import HyTransition from "../hy-transition/hy-transition.vue";
345
+ import HyCheckButton from "../hy-check-button/hy-check-button.vue";
181
346
 
182
347
  const props = withDefaults(defineProps<IProps>(), defaultProps);
183
348
  const {
@@ -191,6 +356,10 @@ const {
191
356
  const emit = defineEmits(["click"]);
192
357
 
193
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;
194
363
 
195
364
  /**
196
365
  * @description 错误输入框样式
@@ -199,7 +368,7 @@ const errorStyle = computed(() => {
199
368
  return (err: boolean) => {
200
369
  const style: CSSProperties = {};
201
370
  if (err) {
202
- style.background = "#FFF2F0";
371
+ style.background = "#dd6161";
203
372
  }
204
373
 
205
374
  return style;
@@ -335,12 +504,18 @@ const handleSubmit = () => {
335
504
  * @description 输入值触发
336
505
  * */
337
506
  const handleChange = (event: string, temp: FormColumnsType) => {
507
+ if (isInput(temp.type) && temp?.input?.onChange) {
508
+ temp.input.onChange(event, temp);
509
+ }
338
510
  validateField(temp.rules, event, temp.field, "change");
339
511
  };
340
512
  /**
341
513
  * @description 输入值触发
342
514
  * */
343
515
  const handleBlur = (event: string, temp: FormColumnsType) => {
516
+ if (isInput(temp.type) && temp?.input?.onBlur) {
517
+ temp.input.onBlur(event, temp);
518
+ }
344
519
  validateField(temp.rules, event, temp.field, "blur");
345
520
  };
346
521
 
@@ -352,4 +527,7 @@ defineExpose({
352
527
 
353
528
  <style lang="scss" scoped>
354
529
  @import "./index.scss";
530
+ .hy-form--item {
531
+ flex-direction: v-bind(labelPos);
532
+ }
355
533
  </style>
@@ -1,11 +1,21 @@
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
- flex-direction: v-bind(labelPos);
7
16
  //align-items: center;
8
17
  margin-bottom: $hy-border-margin-padding-lg;
18
+ padding-bottom: $hy-border-margin-padding-sm;
9
19
  &__label {
10
20
  padding: $hy-border-margin-padding-base 0;
11
21
  }
@@ -8,8 +8,6 @@ const defaultProps: IProps = {
8
8
  borderBottom: false,
9
9
  right: false,
10
10
  itemHeight: 40,
11
- shape: "square",
12
- border: "surround",
13
11
  columns: [],
14
12
  formData: {},
15
13
  };
@@ -1,6 +1,12 @@
1
1
  import type { FormColumnsType } from "../../typing";
2
+ import type HyInputProps from "../hy-input/typing";
3
+ import type HyTextareaProps from "../hy-textarea/typing";
4
+ import type HySwitchProps from "../hy-switch/typing";
5
+ import type HyPickerProps from "../hy-picker/typing";
6
+ import type HyRadioProps from "../hy-radio/typing";
7
+ import type HyCheckButtonProps from "../hy-check-button/typing";
2
8
 
3
- export default interface IProps {
9
+ export default interface HyFormProps {
4
10
  /**
5
11
  * @description 表单域提示文字的位置
6
12
  * left - 左侧
@@ -37,17 +43,29 @@ export default interface IProps {
37
43
  * */
38
44
  itemHeight?: number | string;
39
45
  /**
40
- * @description 是否全部禁用
46
+ * @description 输入框属性api集合
41
47
  * */
42
- disabled?: boolean;
48
+ input?: Partial<HyInputProps>;
43
49
  /**
44
- * @description 输入框形状
50
+ * @description 文本域属性api集合
45
51
  * */
46
- shape?: HyApp.ShapeType;
52
+ textarea?: Partial<HyTextareaProps>;
47
53
  /**
48
- * @description 输入框边框
54
+ * @description 选择器属性api集合
49
55
  * */
50
- border?: HyApp.BorderType;
56
+ picker?: Partial<HyPickerProps>;
57
+ /**
58
+ * @description 开关属性api集合
59
+ * */
60
+ switchItem?: Partial<HySwitchProps>;
61
+ /**
62
+ * @description 单选属性api集合
63
+ * */
64
+ radio?: Partial<HyRadioProps>;
65
+ /**
66
+ * @description 选择按钮属性api集合
67
+ * */
68
+ checkButton?: Partial<HyCheckButtonProps>;
51
69
  /**
52
70
  * @description 表单配置
53
71
  * */
@@ -10,12 +10,23 @@
10
10
  >
11
11
  <slot :record="item">
12
12
  <HyIcon
13
- :name="item.icon"
14
- :size="iconSize"
15
- :round="round"
13
+ :name="item?.icon"
16
14
  label-pos="bottom"
17
- :space="space"
18
- :label="item.name"
15
+ :label="item?.name"
16
+ :space="item?.iconConfig?.space || iconConfig?.space || 12"
17
+ :color="item?.iconConfig?.color || iconConfig?.color"
18
+ :size="item?.iconConfig?.size || iconConfig?.size || 30"
19
+ :bold="item?.iconConfig?.bold || iconConfig?.bold"
20
+ :customPrefix="item?.iconConfig?.customPrefix"
21
+ :imgMode="item?.iconConfig?.imgMode || iconConfig?.imgMode"
22
+ :width="item?.iconConfig?.width || iconConfig?.width"
23
+ :height="item?.iconConfig?.height || iconConfig?.height"
24
+ :top="item?.iconConfig?.top || iconConfig?.top"
25
+ :stop="item?.iconConfig?.stop || iconConfig?.stop"
26
+ :round="item?.iconConfig?.round || iconConfig?.round || 6"
27
+ :customStyle="
28
+ item?.iconConfig?.customStyle || iconConfig?.customStyle
29
+ "
19
30
  ></HyIcon>
20
31
  <!-- <view class="hy-grid-item__title">{{ item.name }}</view>-->
21
32
  </slot>
@@ -24,6 +35,17 @@
24
35
  </view>
25
36
  </template>
26
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
+
27
49
  <script setup lang="ts">
28
50
  import { computed, type CSSProperties, toRefs } from "vue";
29
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;