hy-app 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +6 -3
  2. package/common/shakeService.ts +31 -29
  3. package/components/hy-action-sheet/hy-action-sheet.vue +71 -46
  4. package/components/hy-address-picker/hy-address-picker.vue +94 -83
  5. package/components/hy-address-picker/index.scss +1 -1
  6. package/components/hy-avatar/hy-avatar.vue +87 -91
  7. package/components/hy-avatar/index.scss +1 -1
  8. package/components/hy-back-top/index.scss +1 -1
  9. package/components/hy-badge/hy-badge.vue +47 -46
  10. package/components/hy-button/hy-button.vue +117 -93
  11. package/components/hy-button/index.scss +2 -2
  12. package/components/hy-calendar/header.vue +11 -11
  13. package/components/hy-calendar/hy-calendar.vue +168 -160
  14. package/components/hy-calendar/index.scss +25 -25
  15. package/components/hy-calendar/month.vue +18 -19
  16. package/components/hy-card/hy-card.vue +55 -50
  17. package/components/hy-card/index.scss +11 -9
  18. package/components/hy-card/typing.d.ts +33 -32
  19. package/components/hy-cell/hy-cell.vue +81 -59
  20. package/components/hy-cell/index.scss +15 -15
  21. package/components/hy-check-button/hy-check-button.vue +54 -47
  22. package/components/hy-checkbox/hy-checkbox.vue +103 -111
  23. package/components/hy-checkbox/index.scss +24 -23
  24. package/components/hy-code-input/hy-code-input.vue +80 -89
  25. package/components/hy-config-provider/hy-config-provider.vue +19 -20
  26. package/components/hy-count-down/hy-count-down.vue +66 -67
  27. package/components/hy-count-to/hy-count-to.vue +105 -99
  28. package/components/hy-count-to/typing.d.ts +13 -12
  29. package/components/hy-datetime-picker/hy-datetime-picker.vue +261 -253
  30. package/components/hy-datetime-picker/typing.d.ts +42 -40
  31. package/components/hy-divider/hy-divider.vue +68 -73
  32. package/components/hy-dropdown/hy-dropdown.vue +20 -19
  33. package/components/hy-dropdown-item/hy-dropdown-item.vue +66 -61
  34. package/components/hy-dropdown-item/typing.d.ts +9 -9
  35. package/components/hy-empty/hy-empty.vue +53 -50
  36. package/components/hy-empty/icon.ts +32 -58
  37. package/components/hy-empty/index.scss +2 -2
  38. package/components/hy-empty/typing.d.ts +48 -35
  39. package/components/hy-flex/hy-flex.vue +52 -26
  40. package/components/hy-float-button/hy-float-button.vue +218 -210
  41. package/components/hy-folding-panel/hy-folding-panel.vue +32 -33
  42. package/components/hy-form/hy-form.vue +264 -259
  43. package/components/hy-grid/hy-grid.vue +44 -43
  44. package/components/hy-icon/hy-icon.vue +61 -67
  45. package/components/hy-image/hy-image.vue +112 -88
  46. package/components/hy-image/typing.d.ts +27 -23
  47. package/components/hy-input/hy-input.vue +157 -127
  48. package/components/hy-input/typing.d.ts +53 -47
  49. package/components/hy-line/hy-line.vue +26 -26
  50. package/components/hy-line-progress/hy-line-progress.vue +42 -35
  51. package/components/hy-list/hy-list.vue +76 -85
  52. package/components/hy-loading/hy-loading.vue +26 -23
  53. package/components/hy-menu/hy-menu.vue +48 -43
  54. package/components/hy-menu/typing.d.ts +18 -17
  55. package/components/hy-modal/hy-modal.vue +39 -35
  56. package/components/hy-navbar/hy-navbar.vue +25 -25
  57. package/components/hy-navbar/typing.d.ts +24 -22
  58. package/components/hy-notice-bar/hy-column-notice.vue +2 -2
  59. package/components/hy-notice-bar/hy-notice-bar.vue +26 -27
  60. package/components/hy-notice-bar/hy-row-notice.vue +1 -1
  61. package/components/hy-notice-bar/index.scss +6 -0
  62. package/components/hy-notify/hy-notify.vue +53 -53
  63. package/components/hy-number-step/hy-number-step.vue +134 -146
  64. package/components/hy-number-step/typing.d.ts +35 -35
  65. package/components/hy-overlay/hy-overlay.vue +23 -21
  66. package/components/hy-pagination/hy-pagination.vue +41 -36
  67. package/components/hy-picker/hy-picker.vue +184 -154
  68. package/components/hy-picker/typing.d.ts +39 -39
  69. package/components/hy-popover/hy-popover.vue +97 -77
  70. package/components/hy-popover/index.scss +3 -3
  71. package/components/hy-popup/hy-popup.vue +107 -98
  72. package/components/hy-price/hy-price.vue +38 -34
  73. package/components/hy-qrcode/hy-qrcode.vue +50 -51
  74. package/components/hy-radio/hy-radio.vue +101 -113
  75. package/components/hy-rate/hy-rate.vue +107 -88
  76. package/components/hy-read-more/hy-read-more.vue +64 -49
  77. package/components/hy-scroll-list/hy-scroll-list.vue +45 -48
  78. package/components/hy-search/hy-search.vue +75 -75
  79. package/components/hy-search/typing.d.ts +36 -35
  80. package/components/hy-signature/hy-signature.vue +282 -240
  81. package/components/hy-slider/hy-slider.vue +194 -152
  82. package/components/hy-slider/typing.d.ts +21 -21
  83. package/components/hy-steps/hy-steps.vue +118 -90
  84. package/components/hy-steps/index.scss +31 -21
  85. package/components/hy-submit-bar/hy-submit-bar.vue +61 -70
  86. package/components/hy-subsection/hy-subsection.vue +99 -102
  87. package/components/hy-subsection/typing.d.ts +19 -19
  88. package/components/hy-swipe-action/hy-swipe-action.vue +131 -118
  89. package/components/hy-swiper/hy-swiper.vue +85 -71
  90. package/components/hy-switch/hy-switch.vue +67 -72
  91. package/components/hy-switch/typing.d.ts +21 -19
  92. package/components/hy-tabs/hy-tabs.vue +168 -113
  93. package/components/hy-tag/hy-tag.vue +91 -87
  94. package/components/hy-tag/index.scss +13 -12
  95. package/components/hy-tag/typing.d.ts +26 -21
  96. package/components/hy-text/hy-text.vue +119 -111
  97. package/components/hy-textarea/hy-textarea.vue +100 -93
  98. package/components/hy-textarea/typing.d.ts +36 -31
  99. package/components/hy-toast/hy-toast.vue +77 -67
  100. package/components/hy-tooltip/hy-tooltip.vue +109 -91
  101. package/components/hy-transition/hy-transition.vue +62 -66
  102. package/components/hy-upload/hy-upload.vue +289 -154
  103. package/components/hy-upload/typing.d.ts +62 -36
  104. package/components/hy-warn/hy-warn.vue +34 -27
  105. package/components/hy-waterfall/hy-waterfall.vue +83 -74
  106. package/components/hy-watermark/hy-watermark.vue +134 -115
  107. package/composables/usePopover.ts +236 -221
  108. package/composables/useQueue.ts +53 -52
  109. package/libs/css/mixin.scss +4 -1
  110. package/libs/css/vars.css +2 -0
  111. package/package.json +2 -2
  112. package/store/index.ts +9 -1
  113. package/theme.scss +1 -0
  114. package/typing/index.ts +0 -1
  115. package/typing/modules/common.d.ts +0 -2
  116. package/web-types.json +1 -1
@@ -1,83 +1,96 @@
1
- import type { CSSProperties } from 'vue'
2
- import type HyButtonProps from '../hy-button/typing'
1
+ import type { CSSProperties } from "vue";
2
+ import type HyButtonProps from "../hy-button/typing";
3
3
 
4
4
  type EmptyModeType =
5
- | 'car'
6
- | 'page'
7
- | 'search'
8
- | 'address'
9
- | 'wifi'
10
- | 'order'
11
- | 'coupon'
12
- | 'favor'
13
- | 'permission'
14
- | 'history'
15
- | 'message'
16
- | 'image'
17
- | 'video'
18
- | 'comment'
19
- | 'integral'
20
- | 'subscribe'
21
- | 'earnings'
22
- | 'announcement'
23
- | 'signIn'
5
+ | "car"
6
+ | "page"
7
+ | "search"
8
+ | "address"
9
+ | "wifi"
10
+ | "order"
11
+ | "coupon"
12
+ | "favor"
13
+ | "permission"
14
+ | "history"
15
+ | "message"
16
+ | "image"
17
+ | "video"
18
+ | "comment"
19
+ | "integral"
20
+ | "subscribe"
21
+ | "earnings"
22
+ | "announcement"
23
+ | "signIn";
24
+
25
+ export type IEmptyIcon = {
26
+ [key: string]: {
27
+ /**
28
+ * 提示信息
29
+ * */
30
+ desc: string;
31
+ /**
32
+ * 空状态图片地址
33
+ * */
34
+ icon: string;
35
+ };
36
+ };
24
37
 
25
38
  export default interface HyEmptyProps {
26
39
  /**
27
40
  * @description 是否显示空状态
28
41
  * */
29
- show?: boolean
42
+ show?: boolean;
30
43
  /**
31
44
  * @description 缺省页内容
32
45
  * */
33
- mode?: EmptyModeType
46
+ mode?: EmptyModeType;
34
47
  /**
35
48
  * @description 空状态图片
36
49
  * */
37
- imageUrl?: string
50
+ imageUrl?: string;
38
51
  /**
39
52
  * @description 组件层级
40
53
  * */
41
- zIndex?: number
54
+ zIndex?: number;
42
55
  /**
43
56
  * @description icon宽度
44
57
  * */
45
- width?: number | string
58
+ width?: number | string;
46
59
  /**
47
60
  * @description icon高度
48
61
  * */
49
- height?: number | string
62
+ height?: number | string;
50
63
  /**
51
64
  * @description 提示信息
52
65
  * */
53
- description?: string
66
+ description?: string;
54
67
  /**
55
68
  * @description 提示信息大小
56
69
  * */
57
- desSize?: string | number
70
+ desSize?: string | number;
58
71
  /**
59
72
  * @description 提示信息颜色
60
73
  * */
61
- desColor?: string
74
+ desColor?: string;
62
75
  /**
63
76
  * @description 图片margin
64
77
  * */
65
- imgMargin?: string
78
+ imgMargin?: string;
66
79
  /**
67
80
  * @description 按钮属性只
68
81
  * */
69
- button?: HyButtonProps
82
+ button?: HyButtonProps;
70
83
  /**
71
84
  * @description 跳转地址
72
85
  * */
73
- navigateUrl?: string
86
+ navigateUrl?: string;
74
87
  /**
75
88
  * @description 自定义输入框外部样式
76
89
  * */
77
- customStyle?: CSSProperties
90
+ customStyle?: CSSProperties;
78
91
  }
79
92
 
80
93
  export interface IEmptyEmits {
81
94
  /** 点击按钮触发 */
82
- (e: 'click'): void
95
+ (e: "click"): void;
83
96
  }
@@ -4,10 +4,22 @@
4
4
  </view>
5
5
  </template>
6
6
 
7
+ <script lang="ts">
8
+ export default {
9
+ name: "hy-flex",
10
+ options: {
11
+ addGlobalClass: true,
12
+ virtualHost: true,
13
+ styleIsolation: "shared",
14
+ },
15
+ };
16
+ </script>
17
+
7
18
  <script setup lang="ts">
8
- import { computed, PropType } from 'vue'
9
- import { FlexAlign, FlexDirection, FlexJustify, FlexWrap } from './typing'
10
- import { addUnit, isArray } from '../../utils'
19
+ import { computed } from "vue";
20
+ import type { PropType } from "vue";
21
+ import type { FlexAlign, FlexDirection, FlexJustify, FlexWrap } from "./typing";
22
+ import { addUnit, isArray } from "../../utils";
11
23
 
12
24
  const props = defineProps({
13
25
  /** flex 主轴的方向是否垂直,使用 flex-direction: column */
@@ -15,59 +27,73 @@ const props = defineProps({
15
27
  type: Boolean,
16
28
  default: false,
17
29
  },
18
- /** 快捷设置 flex-direction */
30
+ /**
31
+ * 快捷设置 flex-direction
32
+ * @values row,row-reverse,column,column-reverse
33
+ * */
19
34
  direction: String as PropType<FlexDirection>,
20
- /** 设置元素在主轴方向上的对齐方式 */
35
+ /**
36
+ * 设置元素在主轴方向上的对齐方式
37
+ * @values flex-start,flex-end,space-between,space-around,space-evenly,center
38
+ * */
21
39
  justify: {
22
40
  type: String as PropType<FlexJustify>,
23
- default: 'flex-start',
41
+ default: "flex-start",
24
42
  },
25
- /** 设置元素在交叉轴方向上的对齐方式 */
43
+ /**
44
+ * 设置元素在交叉轴方向上的对齐方式
45
+ * @values flex-start,center,flex-end,stretch,baseline
46
+ * */
26
47
  align: {
27
48
  type: String as PropType<FlexAlign>,
28
- default: 'flex-start',
49
+ default: "flex-start",
29
50
  },
30
- /** 设置元素单行显示还是多行显示 */
51
+ /**
52
+ * 设置元素单行显示还是多行显示
53
+ * @values nowrap,wrap,wrap-reverse
54
+ * */
31
55
  wrap: {
32
56
  type: String as PropType<FlexWrap>,
33
- default: 'nowrap',
57
+ default: "nowrap",
34
58
  },
35
59
  /** flex 属性,支持数字或字符串。如 1 或 'none' */
36
60
  flex: {
37
61
  type: [String, Number],
38
- default: 'initial',
62
+ default: "initial",
39
63
  },
40
64
  /** 设置网格之间的间隙 */
41
65
  gap: {
42
- type: [String, Number, Array] as PropType<string | number | (string | number)[]>,
66
+ type: [String, Number, Array] as PropType<
67
+ string | number | (string | number)[]
68
+ >,
43
69
  default: 0,
44
70
  },
45
71
  /** 快捷设置 */
46
72
  basis: {
47
73
  type: [String, Number],
48
- default: 'auto',
74
+ default: "auto",
49
75
  },
50
- })
76
+ });
51
77
 
52
78
  // 计算 class
53
- const cls = computed(() => ['hy-flex', props.vertical && 'hy-flex--vertical'])
79
+ const cls = computed(() => ["hy-flex", props.vertical && "hy-flex--vertical"]);
54
80
 
55
81
  // 计算 style
56
82
  const style = computed(() => {
57
- const gap = isArray(props.gap) ? props.gap : [props.gap, props.gap]
58
- const [rowGap, colGap] = gap.map((v) => addUnit(v))
83
+ const gap = isArray(props.gap) ? props.gap : [props.gap, props.gap];
84
+ const [rowGap, colGap] = gap.map((v) => addUnit(v));
59
85
 
60
86
  return {
61
- display: 'flex',
62
- 'justify-content': props.justify,
63
- 'align-items': props.align,
64
- 'flex-wrap': props.wrap,
87
+ display: "flex",
88
+ "justify-content": props.justify,
89
+ "align-items": props.align,
90
+ "flex-wrap": props.wrap,
65
91
  flex: props.flex,
66
- 'flex-basis': props.basis,
67
- 'row-gap': colGap,
68
- 'column-gap': rowGap,
69
- }
70
- })
92
+ "flex-basis": props.basis,
93
+ "row-gap": colGap,
94
+ "column-gap": rowGap,
95
+ };
96
+ });
71
97
  </script>
72
98
 
73
99
  <style scoped></style>