hy-app 0.1.1 → 0.1.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 +1 -1
- package/api/http.ts +8 -8
- package/components/dialog/index.ts +2 -2
- package/components/hy-address-picker/hy-address-picker.vue +14 -42
- package/components/hy-address-picker/index.scss +27 -0
- package/components/hy-address-picker/props.ts +2 -3
- package/components/hy-address-picker/typing.d.ts +1 -2
- package/components/hy-avatar/hy-avatar.vue +10 -54
- package/components/hy-avatar/index.scss +45 -0
- package/components/hy-avatar/props.ts +2 -2
- package/components/hy-avatar/typing.d.ts +2 -2
- package/components/hy-back-top/hy-back-top.vue +7 -22
- package/components/hy-back-top/index.scss +16 -0
- package/components/hy-back-top/props.ts +4 -4
- package/components/hy-back-top/typing.d.ts +2 -3
- package/components/hy-badge/hy-badge.vue +5 -75
- package/components/hy-badge/index.scss +72 -0
- package/components/hy-badge/props.ts +2 -2
- package/components/hy-badge/typing.d.ts +2 -2
- package/components/hy-button/hy-button.vue +22 -134
- package/components/hy-button/index.scss +116 -0
- package/components/hy-button/props.ts +4 -5
- package/components/hy-button/typing.d.ts +3 -3
- package/components/hy-calendar/header.vue +76 -0
- package/components/hy-calendar/hy-calendar.vue +366 -0
- package/components/hy-calendar/index.scss +171 -0
- package/components/hy-calendar/month.vue +524 -0
- package/components/hy-calendar/props.ts +37 -0
- package/components/hy-calendar/typing.d.ts +126 -0
- package/components/hy-card/hy-card.vue +21 -84
- package/components/hy-card/index.scss +57 -0
- package/components/hy-card/props.ts +2 -2
- package/components/hy-card/typing.d.ts +1 -1
- package/components/hy-cell/hy-cell.vue +30 -131
- package/components/hy-cell/index.scss +137 -0
- package/components/hy-cell/props.ts +2 -2
- package/components/hy-cell/typing.d.ts +4 -3
- package/components/hy-check-button/hy-check-button.vue +14 -7
- package/components/hy-check-button/index.scss +5 -0
- package/components/hy-check-button/props.ts +3 -3
- package/components/hy-checkbox/hy-checkbox.vue +24 -107
- package/components/hy-checkbox/index.scss +94 -0
- package/components/hy-checkbox/props.ts +4 -5
- package/components/hy-checkbox/typing.d.ts +3 -7
- package/components/hy-count-down/hy-count-down.vue +150 -0
- package/components/hy-count-down/index.scss +6 -0
- package/components/hy-count-down/index.ts +52 -0
- package/components/hy-count-down/props.ts +10 -0
- package/components/hy-count-down/typing.d.ts +20 -0
- package/components/hy-count-to/hy-count-to.vue +213 -0
- package/components/hy-count-to/index.scss +6 -0
- package/components/hy-count-to/props.ts +17 -0
- package/components/hy-count-to/typing.d.ts +48 -0
- package/components/hy-datetime-picker/hy-datetime-picker.vue +38 -64
- package/components/hy-datetime-picker/index.scss +28 -0
- package/components/hy-datetime-picker/props.ts +2 -2
- package/components/hy-datetime-picker/typing.d.ts +1 -1
- package/components/hy-divider/hy-divider.vue +24 -49
- package/components/hy-divider/index.scss +25 -0
- package/components/hy-divider/props.ts +2 -2
- package/components/hy-divider/typing.d.ts +1 -1
- package/components/hy-dropdown/hy-dropdown.vue +43 -0
- package/components/hy-dropdown/index.scss +17 -0
- package/components/hy-dropdown/props.ts +17 -0
- package/components/hy-dropdown/typing.d.ts +48 -0
- package/components/hy-dropdown-item/hy-dropdown-item.vue +194 -0
- package/components/hy-dropdown-item/index.scss +96 -0
- package/components/hy-dropdown-item/props.ts +10 -0
- package/components/hy-dropdown-item/typing.d.ts +31 -0
- package/components/hy-empty/hy-empty.vue +8 -26
- package/components/hy-empty/index.scss +19 -0
- package/components/hy-empty/props.ts +2 -2
- package/components/hy-empty/typing.d.ts +1 -1
- package/components/hy-float-button/hy-float-button.vue +201 -0
- package/components/hy-float-button/index.scss +69 -0
- package/components/hy-float-button/props.ts +25 -0
- package/components/hy-float-button/typing.d.ts +93 -0
- package/components/hy-folding-panel/hy-folding-panel.vue +9 -12
- package/components/hy-folding-panel/index.scss +6 -0
- package/components/hy-folding-panel/props.ts +2 -2
- package/components/hy-folding-panel/typing.d.ts +2 -2
- package/components/hy-form/hy-form.vue +22 -39
- package/components/hy-form/index.scss +30 -0
- package/components/hy-form/props.ts +4 -2
- package/components/hy-form/typing.d.ts +10 -2
- package/components/hy-grid/hy-grid.vue +4 -45
- package/components/hy-grid/index.scss +40 -0
- package/components/hy-grid/props.ts +5 -5
- package/components/hy-grid/typing.d.ts +2 -2
- package/components/hy-icon/hy-icon.vue +7 -97
- package/components/hy-icon/index.scss +84 -0
- package/components/hy-icon/props.ts +5 -5
- package/components/hy-image/hy-image.vue +212 -0
- package/components/hy-image/index.scss +26 -0
- package/components/hy-image/props.ts +24 -0
- package/components/hy-image/typing.d.ts +76 -0
- package/components/hy-input/hy-input.vue +11 -82
- package/components/hy-input/index.scss +65 -0
- package/components/hy-input/props.ts +2 -2
- package/components/hy-input/typing.d.ts +2 -2
- package/components/hy-line/hy-line.vue +4 -8
- package/components/hy-line/index.scss +5 -0
- package/components/hy-line/props.ts +3 -3
- package/components/hy-line/typing.d.ts +2 -2
- package/components/hy-line-progress/hy-line-progress.vue +15 -44
- package/components/hy-line-progress/index.scss +38 -0
- package/components/hy-line-progress/props.ts +2 -2
- package/components/hy-line-progress/typing.d.ts +1 -1
- package/components/hy-list/hy-list.vue +11 -41
- package/components/hy-list/index.scss +32 -0
- package/components/hy-list/props.ts +2 -2
- package/components/hy-loading/hy-loading.vue +95 -0
- package/components/hy-loading/index.scss +103 -0
- package/components/hy-loading/props.ts +17 -0
- package/components/hy-loading/typing.d.ts +52 -0
- package/components/hy-login/TheUserLogin.vue +16 -16
- package/components/hy-login/hy-login.vue +9 -9
- package/components/hy-login/props.ts +4 -4
- package/components/hy-modal/hy-modal.vue +11 -89
- package/components/hy-modal/index.scss +77 -0
- package/components/hy-modal/props.ts +2 -2
- package/components/hy-modal/typing.d.ts +1 -1
- package/components/hy-navbar/hy-navbar.vue +20 -92
- package/components/hy-navbar/index.scss +67 -0
- package/components/hy-navbar/props.ts +2 -2
- package/components/hy-navbar/typing.d.ts +1 -1
- package/components/hy-notice-bar/hy-column-notice.vue +11 -39
- package/components/hy-notice-bar/hy-notice-bar.vue +10 -12
- package/components/hy-notice-bar/hy-row-notice.vue +5 -56
- package/components/hy-notice-bar/index.scss +93 -0
- package/components/hy-notice-bar/props.ts +4 -2
- package/components/hy-notice-bar/typing.d.ts +13 -3
- package/components/hy-number-step/hy-number-step.vue +55 -105
- package/components/hy-number-step/index.scss +71 -0
- package/components/hy-number-step/props.ts +2 -2
- package/components/hy-number-step/typing.d.ts +1 -1
- package/components/hy-overlay/hy-overlay.vue +5 -17
- package/components/hy-overlay/index.scss +9 -0
- package/components/hy-overlay/props.ts +2 -2
- package/components/hy-overlay/typing.d.ts +1 -1
- package/components/hy-picker/hy-picker.vue +21 -87
- package/components/hy-picker/index.scss +68 -0
- package/components/hy-picker/props.ts +3 -2
- package/components/hy-picker/typing.d.ts +5 -1
- package/components/hy-popup/hy-popup.vue +7 -80
- package/components/hy-popup/index.scss +60 -0
- package/components/hy-popup/props.ts +2 -2
- package/components/hy-popup/typing.d.ts +1 -1
- package/components/hy-price/hy-price.vue +5 -15
- package/components/hy-price/index.scss +11 -0
- package/components/hy-price/props.ts +2 -2
- package/components/hy-price/typing.d.ts +1 -1
- package/components/hy-qrcode/hy-qrcode.vue +15 -37
- package/components/hy-qrcode/index.scss +23 -0
- package/components/hy-qrcode/props.ts +2 -2
- package/components/hy-qrcode/typing.d.ts +2 -2
- package/components/hy-radio/hy-radio.vue +27 -113
- package/components/hy-radio/index.scss +93 -0
- package/components/hy-radio/props.ts +4 -4
- package/components/hy-radio/typing.d.ts +2 -2
- package/components/hy-rate/hy-rate.vue +33 -53
- package/components/hy-rate/index.scss +33 -0
- package/components/hy-rate/props.ts +4 -3
- package/components/hy-rate/typing.d.ts +1 -1
- package/components/hy-read-more/hy-read-more.vue +7 -30
- package/components/hy-read-more/index.scss +25 -0
- package/components/hy-read-more/props.ts +3 -3
- package/components/hy-read-more/typing.d.ts +1 -1
- package/components/hy-safe-bottom/hy-safe-bottom.vue +5 -9
- package/components/hy-safe-bottom/index.scss +5 -0
- package/components/hy-scroll-list/hy-scroll-list.vue +13 -43
- package/components/hy-scroll-list/index.scss +34 -0
- package/components/hy-scroll-list/props.ts +2 -2
- package/components/hy-scroll-list/typing.d.ts +1 -1
- package/components/hy-search/hy-search.vue +12 -94
- package/components/hy-search/index.scss +83 -0
- package/components/hy-search/props.ts +2 -2
- package/components/hy-search/typing.d.ts +1 -2
- package/components/hy-slider/hy-slider.vue +42 -119
- package/components/hy-slider/index.scss +77 -0
- package/components/hy-slider/props.ts +2 -2
- package/components/hy-status-bar/hy-status-bar.vue +41 -0
- package/components/hy-status-bar/index.scss +6 -0
- package/components/hy-status-bar/props.ts +8 -0
- package/components/hy-status-bar/typing.d.ts +12 -0
- package/components/hy-steps/hy-steps.vue +36 -163
- package/components/hy-steps/index.scss +131 -0
- package/components/hy-steps/props.ts +2 -2
- package/components/hy-steps/typing.d.ts +2 -2
- package/components/hy-subsection/hy-subsection.vue +62 -125
- package/components/hy-subsection/index.scss +82 -0
- package/components/hy-subsection/props.ts +7 -3
- package/components/hy-subsection/typing.d.ts +20 -8
- package/components/hy-swipe-action/hy-swipe-action.vue +294 -0
- package/components/hy-swipe-action/index.scss +9 -0
- package/components/hy-swipe-action/index.wxs +235 -0
- package/components/hy-swipe-action/props.ts +16 -0
- package/components/hy-swipe-action/typing.d.ts +55 -0
- package/components/hy-swipe-action/wxs.js +15 -0
- package/components/hy-swiper/hy-swiper-indicator.vue +5 -35
- package/components/hy-swiper/hy-swiper.vue +45 -65
- package/components/hy-swiper/index.scss +82 -0
- package/components/hy-swiper/props.ts +3 -3
- package/components/hy-swiper/typing.d.ts +7 -4
- package/components/hy-switch/hy-switch.vue +65 -68
- package/components/hy-switch/index.scss +46 -0
- package/components/hy-switch/props.ts +6 -3
- package/components/hy-switch/typing.d.ts +14 -1
- package/components/hy-tabs/hy-tabs.vue +22 -81
- package/components/hy-tabs/index.scss +63 -0
- package/components/hy-tabs/props.ts +5 -5
- package/components/hy-tabs/typing.d.ts +1 -1
- package/components/hy-tag/hy-tag.vue +15 -230
- package/components/hy-tag/index.scss +204 -0
- package/components/hy-tag/props.ts +2 -2
- package/components/hy-tag/typing.d.ts +2 -2
- package/components/hy-text/hy-text.vue +238 -0
- package/components/hy-text/index.scss +70 -0
- package/components/hy-text/index.ts +0 -0
- package/components/hy-text/props.ts +30 -0
- package/components/hy-text/typing.d.ts +98 -0
- package/components/hy-textarea/hy-textarea.vue +13 -51
- package/components/hy-textarea/index.scss +40 -0
- package/components/hy-textarea/props.ts +2 -2
- package/components/hy-textarea/typing.d.ts +1 -1
- package/components/hy-tooltip/hy-tooltip.vue +42 -95
- package/components/hy-tooltip/index.scss +64 -0
- package/components/hy-tooltip/props.ts +2 -2
- package/components/hy-tooltip/typing.d.ts +1 -1
- package/components/hy-transition/hy-transition.vue +17 -8
- package/components/hy-transition/props.ts +2 -2
- package/components/hy-transition/typing.d.ts +2 -14
- package/components/hy-upload/hy-upload.vue +37 -182
- package/components/hy-upload/index.scss +147 -0
- package/components/hy-upload/props.ts +2 -2
- package/components/hy-upload/typing.d.ts +11 -11
- package/components/hy-warn/hy-warn.vue +15 -123
- package/components/hy-warn/index.scss +109 -0
- package/components/hy-warn/props.ts +3 -3
- package/components/hy-warn/typing.d.ts +4 -3
- package/components/hy-waterfall/index.scss +82 -0
- package/components/index.ts +25 -1
- package/components/message/index.ts +54 -54
- package/config/color.ts +2 -1
- package/global/index.ts +6 -6
- package/global/register-properties.ts +2 -2
- package/index.scss +2 -0
- package/libs/css/common.scss +16 -0
- package/package.json +4 -4
- package/{libs/css → public/font}/iconfont.css +5 -5
- package/{libs/css → public/font}/iconfont.ttf +0 -0
- package/public/font/iconfont.woff +0 -0
- package/public/font/iconfont.woff2 +0 -0
- package/theme.scss +9 -7
- package/typing/index.ts +0 -1
- package/typing/modules/common.d.ts +66 -1
- package/typing/modules/form.ts +3 -3
- package/utils/calendar.js +1021 -0
- package/utils/colorGradient.ts +112 -0
- package/utils/index.ts +2 -0
- package/utils/inside.ts +80 -34
- package/utils/inspect.ts +66 -0
- package/utils/utils.ts +27 -19
- package/typing/modules/img.ts +0 -15
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
+
|
|
3
|
+
.hy-image {
|
|
4
|
+
position: relative;
|
|
5
|
+
transition: opacity 0.5s ease-in-out;
|
|
6
|
+
|
|
7
|
+
&__image {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__loading,
|
|
13
|
+
&__error {
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
@include flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
background-color: #f8f8f8ff;
|
|
23
|
+
color: #909193ff;
|
|
24
|
+
font-size: 46px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type IProps from "./typing";
|
|
2
|
+
import { IconConfig } from "../../config";
|
|
3
|
+
|
|
4
|
+
const defaultProps: IProps = {
|
|
5
|
+
src: "",
|
|
6
|
+
mode: "aspectFill",
|
|
7
|
+
width: "200",
|
|
8
|
+
height: "150",
|
|
9
|
+
shape: "square",
|
|
10
|
+
radius: 0,
|
|
11
|
+
lazyLoad: true,
|
|
12
|
+
showMenuByLongPress: true,
|
|
13
|
+
loadingIcon: IconConfig.LOADING,
|
|
14
|
+
errorIcon: IconConfig.NOTICE,
|
|
15
|
+
showLoading: true,
|
|
16
|
+
showError: true,
|
|
17
|
+
fade: true,
|
|
18
|
+
webp: false,
|
|
19
|
+
duration: 500,
|
|
20
|
+
bgColor: "#f3f4f6",
|
|
21
|
+
previewImage: false,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default defaultProps;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { CSSProperties } from "vue";
|
|
2
|
+
|
|
3
|
+
export default interface IProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 图片地址
|
|
6
|
+
* */
|
|
7
|
+
src?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description 裁剪模式,见官网说明 (默认 'aspectFill' )
|
|
10
|
+
* */
|
|
11
|
+
mode?: HyApp.ImageModeVo;
|
|
12
|
+
/**
|
|
13
|
+
* @description 宽度,单位任意,如果为数值,则为px单位 (默认 '300' )
|
|
14
|
+
* */
|
|
15
|
+
width?: string | number;
|
|
16
|
+
/**
|
|
17
|
+
* @description 高度,单位任意,如果为数值,则为px单位 (默认 '225' )
|
|
18
|
+
* */
|
|
19
|
+
height?: string | number;
|
|
20
|
+
/**
|
|
21
|
+
* @description 图片形状,circle-圆形,square-方形 (默认 'square' )
|
|
22
|
+
* */
|
|
23
|
+
shape?: HyApp.ShapeType;
|
|
24
|
+
/**
|
|
25
|
+
* @description 圆角值,单位任意,如果为数值,则为px单位 (默认 0 )
|
|
26
|
+
* */
|
|
27
|
+
radius?: number | string;
|
|
28
|
+
/**
|
|
29
|
+
* @description 是否懒加载,仅微信小程序、App、百度小程序、字节跳动小程序有效 (默认 true )
|
|
30
|
+
* */
|
|
31
|
+
lazyLoad?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @description 是否开启长按图片显示识别小程序码菜单,仅微信小程序有效 (默认 true )
|
|
34
|
+
* */
|
|
35
|
+
showMenuByLongPress?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @description 加载中的图标,或者小图片 (默认 'photo' )
|
|
38
|
+
* */
|
|
39
|
+
loadingIcon?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @description 加载失败的图标,或者小图片 (默认 'error-circle' )
|
|
42
|
+
* */
|
|
43
|
+
errorIcon?: string;
|
|
44
|
+
/**
|
|
45
|
+
* @description 是否显示加载中的图标或者自定义的slot (默认 true )
|
|
46
|
+
* */
|
|
47
|
+
showLoading?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* @description 是否显示加载错误的图标或者自定义的slot (默认 true )
|
|
50
|
+
* */
|
|
51
|
+
showError?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* @description 是否需要淡入效果 (默认 true )
|
|
54
|
+
* */
|
|
55
|
+
fade?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* @description 只支持网络资源,只对微信小程序有效 (默认 false )
|
|
58
|
+
* */
|
|
59
|
+
webp?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* @description 搭配fade参数的过渡时间,单位ms (默认 500 )
|
|
62
|
+
* */
|
|
63
|
+
duration?: number;
|
|
64
|
+
/**
|
|
65
|
+
* @description 背景颜色,用于深色页面加载图片时,为了和背景色融合 (默认 '#f3f4f6' )
|
|
66
|
+
* */
|
|
67
|
+
bgColor?: string;
|
|
68
|
+
/**
|
|
69
|
+
* @description 是否预览图片 (默认 false )
|
|
70
|
+
* */
|
|
71
|
+
previewImage?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @description 定义需要用到的外部样式
|
|
74
|
+
* */
|
|
75
|
+
customStyle?: CSSProperties;
|
|
76
|
+
}
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
@click="onClear"
|
|
58
58
|
>
|
|
59
59
|
<HyIcon
|
|
60
|
-
:name="IconConfig.
|
|
60
|
+
:name="IconConfig.CLOSE"
|
|
61
61
|
size="11"
|
|
62
62
|
color="#ffffff"
|
|
63
63
|
:customStyle="{ lineHeight: '12px' }"
|
|
@@ -82,19 +82,18 @@
|
|
|
82
82
|
<script setup lang="ts">
|
|
83
83
|
import {
|
|
84
84
|
computed,
|
|
85
|
-
CSSProperties,
|
|
86
|
-
inject,
|
|
87
85
|
nextTick,
|
|
88
86
|
ref,
|
|
89
87
|
toRefs,
|
|
90
88
|
watch,
|
|
91
|
-
getCurrentInstance
|
|
89
|
+
getCurrentInstance,
|
|
92
90
|
} from "vue";
|
|
91
|
+
import type { CSSProperties } from "vue";
|
|
93
92
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
94
|
-
import { addUnit, formatObject
|
|
93
|
+
import { addUnit, formatObject } from "../../utils";
|
|
95
94
|
import defaultProps from "./props";
|
|
96
95
|
import { ColorConfig, IconConfig } from "../../config";
|
|
97
|
-
import IProps from "./typing";
|
|
96
|
+
import type IProps from "./typing";
|
|
98
97
|
|
|
99
98
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
100
99
|
const {
|
|
@@ -106,7 +105,7 @@ const {
|
|
|
106
105
|
customStyle,
|
|
107
106
|
fontSize,
|
|
108
107
|
readonly,
|
|
109
|
-
placeholderStyle
|
|
108
|
+
placeholderStyle,
|
|
110
109
|
} = toRefs(props);
|
|
111
110
|
const emit = defineEmits([
|
|
112
111
|
"blur",
|
|
@@ -116,7 +115,7 @@ const emit = defineEmits([
|
|
|
116
115
|
"nicknamereview",
|
|
117
116
|
"change",
|
|
118
117
|
"update:modelValue",
|
|
119
|
-
"clear"
|
|
118
|
+
"clear",
|
|
120
119
|
]);
|
|
121
120
|
|
|
122
121
|
const instance = getCurrentInstance();
|
|
@@ -151,7 +150,7 @@ watch(
|
|
|
151
150
|
// 重置changeFromInner的值为false,标识下一次引起默认为外部引起的
|
|
152
151
|
changeFromInner.value = false;
|
|
153
152
|
},
|
|
154
|
-
{ immediate: true }
|
|
153
|
+
{ immediate: true },
|
|
155
154
|
);
|
|
156
155
|
|
|
157
156
|
/**
|
|
@@ -171,7 +170,7 @@ const inputClass = computed((): string => {
|
|
|
171
170
|
(classes = classes.concat(["hy-border", "hy-input--radius"]));
|
|
172
171
|
classes.push(`hy-input--${shape}`);
|
|
173
172
|
border === "bottom" &&
|
|
174
|
-
(classes = classes.concat(["hy-
|
|
173
|
+
(classes = classes.concat(["hy-border__bottom", "hy-input--no-radius"]));
|
|
175
174
|
return classes.join(" ");
|
|
176
175
|
});
|
|
177
176
|
|
|
@@ -203,7 +202,7 @@ const inputStyle = computed((): CSSProperties => {
|
|
|
203
202
|
return {
|
|
204
203
|
color: color.value,
|
|
205
204
|
fontSize: addUnit(fontSize.value),
|
|
206
|
-
textAlign: inputAlign.value
|
|
205
|
+
textAlign: inputAlign.value,
|
|
207
206
|
};
|
|
208
207
|
});
|
|
209
208
|
|
|
@@ -328,75 +327,5 @@ const clickHandler = () => {
|
|
|
328
327
|
</script>
|
|
329
328
|
|
|
330
329
|
<style lang="scss" scoped>
|
|
331
|
-
@import "
|
|
332
|
-
@import "../../theme.scss";
|
|
333
|
-
|
|
334
|
-
.hy-input {
|
|
335
|
-
@include flex(row);
|
|
336
|
-
align-items: center;
|
|
337
|
-
justify-content: space-between;
|
|
338
|
-
flex: 1;
|
|
339
|
-
|
|
340
|
-
&--radius,
|
|
341
|
-
&--square {
|
|
342
|
-
border-radius: 4px;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
&--no-radius {
|
|
346
|
-
border-radius: 0;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
&--circle {
|
|
350
|
-
border-radius: 100px;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
&__content {
|
|
354
|
-
flex: 1;
|
|
355
|
-
@include flex(row);
|
|
356
|
-
align-items: center;
|
|
357
|
-
justify-content: space-between;
|
|
358
|
-
|
|
359
|
-
&__field-wrapper {
|
|
360
|
-
position: relative;
|
|
361
|
-
@include flex(row);
|
|
362
|
-
margin: 0;
|
|
363
|
-
flex: 1;
|
|
364
|
-
|
|
365
|
-
&__field {
|
|
366
|
-
line-height: 26px;
|
|
367
|
-
text-align: left;
|
|
368
|
-
color: $hy-text-color;
|
|
369
|
-
height: 24px;
|
|
370
|
-
font-size: 15px;
|
|
371
|
-
flex: 1;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
&__clear {
|
|
376
|
-
width: 20px;
|
|
377
|
-
height: 20px;
|
|
378
|
-
border-radius: 100px;
|
|
379
|
-
background-color: #c6c7cb;
|
|
380
|
-
@include flex(row);
|
|
381
|
-
align-items: center;
|
|
382
|
-
justify-content: center;
|
|
383
|
-
transform: scale(0.82);
|
|
384
|
-
margin-left: 4px;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
&__subfix-icon {
|
|
388
|
-
margin-left: 4px;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
&__prefix-icon {
|
|
392
|
-
margin-right: 4px;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
.hy-border-bottom {
|
|
397
|
-
border-bottom: $hy-border-line;
|
|
398
|
-
}
|
|
399
|
-
.hy-border {
|
|
400
|
-
border: $hy-border-line;
|
|
401
|
-
}
|
|
330
|
+
@import "./index.scss";
|
|
402
331
|
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
+
@use "../../theme.scss" as *;
|
|
3
|
+
|
|
4
|
+
.hy-input {
|
|
5
|
+
@include flex(row);
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
flex: 1;
|
|
9
|
+
|
|
10
|
+
&--radius,
|
|
11
|
+
&--square {
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&--no-radius {
|
|
16
|
+
border-radius: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&--circle {
|
|
20
|
+
border-radius: 100px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&__content {
|
|
24
|
+
flex: 1;
|
|
25
|
+
@include flex(row);
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
|
|
29
|
+
&__field-wrapper {
|
|
30
|
+
position: relative;
|
|
31
|
+
@include flex(row);
|
|
32
|
+
margin: 0;
|
|
33
|
+
flex: 1;
|
|
34
|
+
|
|
35
|
+
&__field {
|
|
36
|
+
line-height: 26px;
|
|
37
|
+
text-align: left;
|
|
38
|
+
color: $hy-text-color;
|
|
39
|
+
height: 24px;
|
|
40
|
+
font-size: 15px;
|
|
41
|
+
flex: 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&__clear {
|
|
46
|
+
width: 20px;
|
|
47
|
+
height: 20px;
|
|
48
|
+
border-radius: 100px;
|
|
49
|
+
background-color: #c6c7cb;
|
|
50
|
+
@include flex(row);
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
transform: scale(0.82);
|
|
54
|
+
margin-left: 4px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&__subfix-icon {
|
|
58
|
+
margin-left: 4px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&__prefix-icon {
|
|
62
|
+
margin-right: 4px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
4
|
modelValue: "",
|
|
@@ -35,7 +35,7 @@ const defaultProps: IProps = {
|
|
|
35
35
|
readonly: false,
|
|
36
36
|
shape: "square",
|
|
37
37
|
formatter: null,
|
|
38
|
-
customStyle: {}
|
|
38
|
+
customStyle: {},
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export default defaultProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from "vue";
|
|
1
|
+
import type { CSSProperties } from "vue";
|
|
2
2
|
|
|
3
3
|
export default interface IProps {
|
|
4
4
|
/**
|
|
@@ -8,7 +8,7 @@ export default interface IProps {
|
|
|
8
8
|
/**
|
|
9
9
|
* @description 输入框类型,见上方说明 ( 默认 'text' )
|
|
10
10
|
* */
|
|
11
|
-
type?:
|
|
11
|
+
type?: HyApp.InputType;
|
|
12
12
|
/**
|
|
13
13
|
* @description 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 ( 默认 false )
|
|
14
14
|
* */
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
|
-
import { computed, CSSProperties, toRefs } from "vue";
|
|
6
|
+
import { computed, type CSSProperties, toRefs } from "vue";
|
|
7
7
|
import defaultProps from "./props";
|
|
8
|
-
import IProps from "./typing";
|
|
8
|
+
import type IProps from "./typing";
|
|
9
9
|
import { addUnit } from "../../utils";
|
|
10
10
|
|
|
11
11
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
@@ -21,7 +21,7 @@ const lineStyle = computed<CSSProperties>(() => {
|
|
|
21
21
|
style.borderBottomWidth = "1px";
|
|
22
22
|
style.borderBottomStyle = dashed.value ? "dashed" : "solid";
|
|
23
23
|
style.width = addUnit(length.value);
|
|
24
|
-
if (hairline.value) style.
|
|
24
|
+
if (!hairline.value) style.borderBottomWidth = "1.5px";
|
|
25
25
|
} else {
|
|
26
26
|
// 如果是竖向线条,边框宽度为1px,再通过transform缩小一半,就是0.5px了
|
|
27
27
|
style.borderLeftWidth = "1px";
|
|
@@ -36,9 +36,5 @@ const lineStyle = computed<CSSProperties>(() => {
|
|
|
36
36
|
</script>
|
|
37
37
|
|
|
38
38
|
<style lang="scss" scoped>
|
|
39
|
-
.
|
|
40
|
-
/* #ifndef APP-NVUE */
|
|
41
|
-
vertical-align: middle;
|
|
42
|
-
/* #endif */
|
|
43
|
-
}
|
|
39
|
+
@import "./index.scss";
|
|
44
40
|
</style>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
|
-
color: "#
|
|
4
|
+
color: "#dcdfe6",
|
|
5
5
|
length: "100%",
|
|
6
6
|
direction: "row",
|
|
7
7
|
hairline: true,
|
|
8
8
|
margin: "0",
|
|
9
|
-
dashed: false
|
|
9
|
+
dashed: false,
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export default defaultProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from "vue";
|
|
1
|
+
import type { CSSProperties } from "vue";
|
|
2
2
|
|
|
3
3
|
export default interface IProps {
|
|
4
4
|
/**
|
|
@@ -12,7 +12,7 @@ export default interface IProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* @description 线条的方向,row-横向,column-竖向 (默认 'row' )
|
|
14
14
|
* */
|
|
15
|
-
direction?: HyApp.
|
|
15
|
+
direction?: HyApp.DirectionType;
|
|
16
16
|
/**
|
|
17
17
|
* @description 是否显示细线条 (默认 true )
|
|
18
18
|
* */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
ref="hy-line-progress__background"
|
|
6
6
|
:style="{
|
|
7
7
|
backgroundColor: inactiveColor,
|
|
8
|
-
height: addUnit(height)
|
|
8
|
+
height: addUnit(height),
|
|
9
9
|
}"
|
|
10
10
|
>
|
|
11
11
|
</view>
|
|
@@ -22,19 +22,27 @@
|
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script setup lang="ts">
|
|
25
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
computed,
|
|
27
|
+
type CSSProperties, getCurrentInstance,
|
|
28
|
+
onMounted,
|
|
29
|
+
ref,
|
|
30
|
+
toRefs,
|
|
31
|
+
watch,
|
|
32
|
+
} from "vue";
|
|
26
33
|
import defaultProps from "./props";
|
|
27
|
-
import IProps from "./typing";
|
|
34
|
+
import type IProps from "./typing";
|
|
28
35
|
import { addUnit, getRect, range, sleep } from "../../utils";
|
|
29
36
|
|
|
30
37
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
31
38
|
const { percentage, activeColor, height } = toRefs(props);
|
|
32
39
|
|
|
40
|
+
const instance = getCurrentInstance();
|
|
33
41
|
const lineWidth = ref<string | number>(0);
|
|
34
42
|
|
|
35
43
|
watch(
|
|
36
44
|
() => percentage.value,
|
|
37
|
-
() => resizeProgressWidth()
|
|
45
|
+
() => resizeProgressWidth(),
|
|
38
46
|
);
|
|
39
47
|
|
|
40
48
|
const progressStyle = computed<CSSProperties>(() => {
|
|
@@ -61,7 +69,7 @@ const init = async () => {
|
|
|
61
69
|
const getProgressWidth = () => {
|
|
62
70
|
return new Promise((resolve) => {
|
|
63
71
|
// #ifndef APP-NVUE
|
|
64
|
-
resolve(getRect(".
|
|
72
|
+
resolve(getRect(".hy-line-progress__background", false, instance));
|
|
65
73
|
// #endif
|
|
66
74
|
});
|
|
67
75
|
};
|
|
@@ -72,47 +80,10 @@ const getProgressWidth = () => {
|
|
|
72
80
|
const resizeProgressWidth = async () => {
|
|
73
81
|
const { width } = await getProgressWidth();
|
|
74
82
|
// 通过设置的percentage值,计算其所占总长度的百分比
|
|
75
|
-
lineWidth.value = (width * innserPercentage.value) / 100
|
|
83
|
+
lineWidth.value = addUnit((width * innserPercentage.value) / 100);
|
|
76
84
|
};
|
|
77
85
|
</script>
|
|
78
86
|
|
|
79
87
|
<style lang="scss" scoped>
|
|
80
|
-
@import "
|
|
81
|
-
|
|
82
|
-
.hy-line-progress {
|
|
83
|
-
align-items: stretch;
|
|
84
|
-
position: relative;
|
|
85
|
-
@include flex(row);
|
|
86
|
-
flex: 1;
|
|
87
|
-
overflow: hidden;
|
|
88
|
-
border-radius: 100px;
|
|
89
|
-
|
|
90
|
-
&__background {
|
|
91
|
-
background-color: #ececec;
|
|
92
|
-
border-radius: 100px;
|
|
93
|
-
flex: 1;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
&__line {
|
|
97
|
-
position: absolute;
|
|
98
|
-
top: 0;
|
|
99
|
-
left: 0;
|
|
100
|
-
bottom: 0;
|
|
101
|
-
align-items: center;
|
|
102
|
-
@include flex(row);
|
|
103
|
-
color: #ffffff;
|
|
104
|
-
border-radius: 100px;
|
|
105
|
-
transition: width 0.5s ease;
|
|
106
|
-
justify-content: flex-end;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
&__text {
|
|
110
|
-
font-size: 10px;
|
|
111
|
-
align-items: center;
|
|
112
|
-
text-align: right;
|
|
113
|
-
color: #ffffff;
|
|
114
|
-
margin-right: 5px;
|
|
115
|
-
transform: scale(0.9);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
88
|
+
@import "./index.scss";
|
|
118
89
|
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
+
|
|
3
|
+
.hy-line-progress {
|
|
4
|
+
align-items: stretch;
|
|
5
|
+
position: relative;
|
|
6
|
+
@include flex(row);
|
|
7
|
+
flex: 1;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
border-radius: 100px;
|
|
10
|
+
|
|
11
|
+
&__background {
|
|
12
|
+
background-color: #ececec;
|
|
13
|
+
border-radius: 100px;
|
|
14
|
+
flex: 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__line {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
align-items: center;
|
|
23
|
+
@include flex(row);
|
|
24
|
+
color: #ffffff;
|
|
25
|
+
border-radius: 100px;
|
|
26
|
+
transition: width 0.5s ease;
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__text {
|
|
31
|
+
font-size: 10px;
|
|
32
|
+
align-items: center;
|
|
33
|
+
text-align: right;
|
|
34
|
+
color: #ffffff;
|
|
35
|
+
margin-right: 5px;
|
|
36
|
+
transform: scale(0.9);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
import { ColorConfig } from "../../config";
|
|
3
3
|
|
|
4
4
|
const defaultProps: IProps = {
|
|
@@ -6,7 +6,7 @@ const defaultProps: IProps = {
|
|
|
6
6
|
inactiveColor: "#ececec",
|
|
7
7
|
percentage: 0,
|
|
8
8
|
showText: true,
|
|
9
|
-
height: 12
|
|
9
|
+
height: 12,
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export default defaultProps;
|