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.
- package/README.md +6 -3
- package/common/shakeService.ts +31 -29
- package/components/hy-action-sheet/hy-action-sheet.vue +71 -46
- package/components/hy-address-picker/hy-address-picker.vue +94 -83
- package/components/hy-address-picker/index.scss +1 -1
- package/components/hy-avatar/hy-avatar.vue +87 -91
- package/components/hy-avatar/index.scss +1 -1
- package/components/hy-back-top/index.scss +1 -1
- package/components/hy-badge/hy-badge.vue +47 -46
- package/components/hy-button/hy-button.vue +117 -93
- package/components/hy-button/index.scss +2 -2
- package/components/hy-calendar/header.vue +11 -11
- package/components/hy-calendar/hy-calendar.vue +168 -160
- package/components/hy-calendar/index.scss +25 -25
- package/components/hy-calendar/month.vue +18 -19
- package/components/hy-card/hy-card.vue +55 -50
- package/components/hy-card/index.scss +11 -9
- package/components/hy-card/typing.d.ts +33 -32
- package/components/hy-cell/hy-cell.vue +81 -59
- package/components/hy-cell/index.scss +15 -15
- package/components/hy-check-button/hy-check-button.vue +54 -47
- package/components/hy-checkbox/hy-checkbox.vue +103 -111
- package/components/hy-checkbox/index.scss +24 -23
- package/components/hy-code-input/hy-code-input.vue +80 -89
- package/components/hy-config-provider/hy-config-provider.vue +19 -20
- package/components/hy-count-down/hy-count-down.vue +66 -67
- package/components/hy-count-to/hy-count-to.vue +105 -99
- package/components/hy-count-to/typing.d.ts +13 -12
- package/components/hy-datetime-picker/hy-datetime-picker.vue +261 -253
- package/components/hy-datetime-picker/typing.d.ts +42 -40
- package/components/hy-divider/hy-divider.vue +68 -73
- package/components/hy-dropdown/hy-dropdown.vue +20 -19
- package/components/hy-dropdown-item/hy-dropdown-item.vue +66 -61
- package/components/hy-dropdown-item/typing.d.ts +9 -9
- package/components/hy-empty/hy-empty.vue +53 -50
- package/components/hy-empty/icon.ts +32 -58
- package/components/hy-empty/index.scss +2 -2
- package/components/hy-empty/typing.d.ts +48 -35
- package/components/hy-flex/hy-flex.vue +52 -26
- package/components/hy-float-button/hy-float-button.vue +218 -210
- package/components/hy-folding-panel/hy-folding-panel.vue +32 -33
- package/components/hy-form/hy-form.vue +264 -259
- package/components/hy-grid/hy-grid.vue +44 -43
- package/components/hy-icon/hy-icon.vue +61 -67
- package/components/hy-image/hy-image.vue +112 -88
- package/components/hy-image/typing.d.ts +27 -23
- package/components/hy-input/hy-input.vue +157 -127
- package/components/hy-input/typing.d.ts +53 -47
- package/components/hy-line/hy-line.vue +26 -26
- package/components/hy-line-progress/hy-line-progress.vue +42 -35
- package/components/hy-list/hy-list.vue +76 -85
- package/components/hy-loading/hy-loading.vue +26 -23
- package/components/hy-menu/hy-menu.vue +48 -43
- package/components/hy-menu/typing.d.ts +18 -17
- package/components/hy-modal/hy-modal.vue +39 -35
- package/components/hy-navbar/hy-navbar.vue +25 -25
- package/components/hy-navbar/typing.d.ts +24 -22
- package/components/hy-notice-bar/hy-column-notice.vue +2 -2
- package/components/hy-notice-bar/hy-notice-bar.vue +26 -27
- package/components/hy-notice-bar/hy-row-notice.vue +1 -1
- package/components/hy-notice-bar/index.scss +6 -0
- package/components/hy-notify/hy-notify.vue +53 -53
- package/components/hy-number-step/hy-number-step.vue +134 -146
- package/components/hy-number-step/typing.d.ts +35 -35
- package/components/hy-overlay/hy-overlay.vue +23 -21
- package/components/hy-pagination/hy-pagination.vue +41 -36
- package/components/hy-picker/hy-picker.vue +184 -154
- package/components/hy-picker/typing.d.ts +39 -39
- package/components/hy-popover/hy-popover.vue +97 -77
- package/components/hy-popover/index.scss +3 -3
- package/components/hy-popup/hy-popup.vue +107 -98
- package/components/hy-price/hy-price.vue +38 -34
- package/components/hy-qrcode/hy-qrcode.vue +50 -51
- package/components/hy-radio/hy-radio.vue +101 -113
- package/components/hy-rate/hy-rate.vue +107 -88
- package/components/hy-read-more/hy-read-more.vue +64 -49
- package/components/hy-scroll-list/hy-scroll-list.vue +45 -48
- package/components/hy-search/hy-search.vue +75 -75
- package/components/hy-search/typing.d.ts +36 -35
- package/components/hy-signature/hy-signature.vue +282 -240
- package/components/hy-slider/hy-slider.vue +194 -152
- package/components/hy-slider/typing.d.ts +21 -21
- package/components/hy-steps/hy-steps.vue +118 -90
- package/components/hy-steps/index.scss +31 -21
- package/components/hy-submit-bar/hy-submit-bar.vue +61 -70
- package/components/hy-subsection/hy-subsection.vue +99 -102
- package/components/hy-subsection/typing.d.ts +19 -19
- package/components/hy-swipe-action/hy-swipe-action.vue +131 -118
- package/components/hy-swiper/hy-swiper.vue +85 -71
- package/components/hy-switch/hy-switch.vue +67 -72
- package/components/hy-switch/typing.d.ts +21 -19
- package/components/hy-tabs/hy-tabs.vue +168 -113
- package/components/hy-tag/hy-tag.vue +91 -87
- package/components/hy-tag/index.scss +13 -12
- package/components/hy-tag/typing.d.ts +26 -21
- package/components/hy-text/hy-text.vue +119 -111
- package/components/hy-textarea/hy-textarea.vue +100 -93
- package/components/hy-textarea/typing.d.ts +36 -31
- package/components/hy-toast/hy-toast.vue +77 -67
- package/components/hy-tooltip/hy-tooltip.vue +109 -91
- package/components/hy-transition/hy-transition.vue +62 -66
- package/components/hy-upload/hy-upload.vue +289 -154
- package/components/hy-upload/typing.d.ts +62 -36
- package/components/hy-warn/hy-warn.vue +34 -27
- package/components/hy-waterfall/hy-waterfall.vue +83 -74
- package/components/hy-watermark/hy-watermark.vue +134 -115
- package/composables/usePopover.ts +236 -221
- package/composables/useQueue.ts +53 -52
- package/libs/css/mixin.scss +4 -1
- package/libs/css/vars.css +2 -0
- package/package.json +2 -2
- package/store/index.ts +9 -1
- package/theme.scss +1 -0
- package/typing/index.ts +0 -1
- package/typing/modules/common.d.ts +0 -2
- package/web-types.json +1 -1
|
@@ -1,83 +1,96 @@
|
|
|
1
|
-
import type { CSSProperties } from
|
|
2
|
-
import type HyButtonProps from
|
|
1
|
+
import type { CSSProperties } from "vue";
|
|
2
|
+
import type HyButtonProps from "../hy-button/typing";
|
|
3
3
|
|
|
4
4
|
type EmptyModeType =
|
|
5
|
-
|
|
|
6
|
-
|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
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:
|
|
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
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
|
-
/**
|
|
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:
|
|
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:
|
|
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:
|
|
57
|
+
default: "nowrap",
|
|
34
58
|
},
|
|
35
59
|
/** flex 属性,支持数字或字符串。如 1 或 'none' */
|
|
36
60
|
flex: {
|
|
37
61
|
type: [String, Number],
|
|
38
|
-
default:
|
|
62
|
+
default: "initial",
|
|
39
63
|
},
|
|
40
64
|
/** 设置网格之间的间隙 */
|
|
41
65
|
gap: {
|
|
42
|
-
type: [String, Number, Array] as PropType<
|
|
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:
|
|
74
|
+
default: "auto",
|
|
49
75
|
},
|
|
50
|
-
})
|
|
76
|
+
});
|
|
51
77
|
|
|
52
78
|
// 计算 class
|
|
53
|
-
const cls = computed(() => [
|
|
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:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
87
|
+
display: "flex",
|
|
88
|
+
"justify-content": props.justify,
|
|
89
|
+
"align-items": props.align,
|
|
90
|
+
"flex-wrap": props.wrap,
|
|
65
91
|
flex: props.flex,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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>
|