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
package/README.md
CHANGED
package/api/http.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
HttpRequestConfig,
|
|
3
3
|
HttpInterceptorManager,
|
|
4
|
-
HttpResponse
|
|
4
|
+
HttpResponse,
|
|
5
5
|
} from "../typing";
|
|
6
6
|
import { objectToUrlParams } from "../utils";
|
|
7
7
|
|
|
@@ -17,7 +17,7 @@ export default class Http {
|
|
|
17
17
|
header: {},
|
|
18
18
|
method: "POST",
|
|
19
19
|
responseType: "text",
|
|
20
|
-
timeout: 10000
|
|
20
|
+
timeout: 10000,
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -40,7 +40,7 @@ export default class Http {
|
|
|
40
40
|
*/
|
|
41
41
|
response: (
|
|
42
42
|
success: (response: HttpResponse) => any,
|
|
43
|
-
fail: (error: HttpResponse) => any
|
|
43
|
+
fail: (error: HttpResponse) => any,
|
|
44
44
|
) => {
|
|
45
45
|
if (success) {
|
|
46
46
|
this.responseSuccess = success;
|
|
@@ -48,7 +48,7 @@ export default class Http {
|
|
|
48
48
|
if (fail) {
|
|
49
49
|
this.responseFail = fail;
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
},
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
/**
|
|
@@ -99,7 +99,7 @@ export default class Http {
|
|
|
99
99
|
},
|
|
100
100
|
fail: (error: UniNamespace.GeneralCallbackResult) => {
|
|
101
101
|
reject(this.responseFail(error));
|
|
102
|
-
}
|
|
102
|
+
},
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
}
|
|
@@ -115,7 +115,7 @@ export default class Http {
|
|
|
115
115
|
url: url,
|
|
116
116
|
method: "POST",
|
|
117
117
|
data: params,
|
|
118
|
-
...options
|
|
118
|
+
...options,
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -132,7 +132,7 @@ export default class Http {
|
|
|
132
132
|
return this.request({
|
|
133
133
|
url: url,
|
|
134
134
|
method: "GET",
|
|
135
|
-
...options
|
|
135
|
+
...options,
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createApp } from "vue";
|
|
2
|
-
import AlertDialogCom, { DialogParam } from "./TheDialog.vue";
|
|
3
|
-
import { ResultParam } from "../../typing";
|
|
2
|
+
import AlertDialogCom, { type DialogParam } from "./TheDialog.vue";
|
|
3
|
+
import type { ResultParam } from "../../typing";
|
|
4
4
|
|
|
5
5
|
export default class Dialog {
|
|
6
6
|
private static mountNode: HTMLElement | null = null;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<slot name="trigger" :value="inputValue">
|
|
9
9
|
<HyInput
|
|
10
10
|
:placeholder="placeholder"
|
|
11
|
-
:readonly="
|
|
11
|
+
:readonly="true"
|
|
12
12
|
v-model="inputValue"
|
|
13
13
|
:disabled="disabled"
|
|
14
14
|
:shape="shape"
|
|
@@ -50,15 +50,13 @@
|
|
|
50
50
|
<slot name="toolbar-bottom"> </slot>
|
|
51
51
|
</template>
|
|
52
52
|
</HyPicker>
|
|
53
|
-
|
|
54
|
-
<HyList container-height="" list=""></HyList>
|
|
55
53
|
</view>
|
|
56
54
|
</template>
|
|
57
55
|
|
|
58
56
|
<script setup lang="ts">
|
|
59
57
|
import { onMounted, ref, toRefs } from "vue";
|
|
60
58
|
import defaultProps from "./props";
|
|
61
|
-
import IProps from "./typing";
|
|
59
|
+
import type IProps from "./typing";
|
|
62
60
|
import address from "../../utils/address.json";
|
|
63
61
|
|
|
64
62
|
// 组件
|
|
@@ -73,12 +71,12 @@ const emit = defineEmits([
|
|
|
73
71
|
"cancel",
|
|
74
72
|
"confirm",
|
|
75
73
|
"change",
|
|
76
|
-
"update:modelValue"
|
|
74
|
+
"update:modelValue",
|
|
77
75
|
]);
|
|
78
76
|
|
|
79
77
|
// 原来的日期选择器不方便,这里增加一个hasInput选项支持类似element的自带输入框的功能。
|
|
80
78
|
const inputValue = ref<string>(""); // 表单显示值
|
|
81
|
-
const showByClickInput = ref<boolean>(false); // 是否在hasInput
|
|
79
|
+
const showByClickInput = ref<boolean>(false); // 是否在hasInput模式下显示日期选择
|
|
82
80
|
const columns = ref<any[]>([]);
|
|
83
81
|
const uPickerRef = ref<InstanceType<typeof HyPicker> | null>();
|
|
84
82
|
const defaultIndex = ref<number[]>([]);
|
|
@@ -111,16 +109,16 @@ const updateColumnValue = (value: string) => {
|
|
|
111
109
|
const addressArr = value.split(separator.value);
|
|
112
110
|
// 查出省索引
|
|
113
111
|
provinceIndex = address.findIndex((item) =>
|
|
114
|
-
areCitiesEqual(item.name, addressArr[0])
|
|
112
|
+
areCitiesEqual(item.name, addressArr[0]),
|
|
115
113
|
);
|
|
116
114
|
// 查出市索引
|
|
117
115
|
cityIndex = address[provinceIndex].areas.findIndex((item) =>
|
|
118
|
-
areCitiesEqual(item.name, addressArr[1])
|
|
116
|
+
areCitiesEqual(item.name, addressArr[1]),
|
|
119
117
|
);
|
|
120
118
|
|
|
121
119
|
// 查出县/区索引
|
|
122
120
|
countyIndex = address[provinceIndex].areas[cityIndex].areas.findIndex(
|
|
123
|
-
(item) => areCitiesEqual(item.name, addressArr[2])
|
|
121
|
+
(item) => areCitiesEqual(item.name, addressArr[2]),
|
|
124
122
|
);
|
|
125
123
|
} else {
|
|
126
124
|
provinceIndex = 0;
|
|
@@ -130,12 +128,12 @@ const updateColumnValue = (value: string) => {
|
|
|
130
128
|
// 省级数组
|
|
131
129
|
const provinceData = address.map((item) => ({
|
|
132
130
|
name: item.name,
|
|
133
|
-
code: item.code
|
|
131
|
+
code: item.code,
|
|
134
132
|
}));
|
|
135
133
|
// 市级数组
|
|
136
134
|
const cityData = address[provinceIndex].areas.map((item) => ({
|
|
137
135
|
name: item.name,
|
|
138
|
-
code: item.code
|
|
136
|
+
code: item.code,
|
|
139
137
|
}));
|
|
140
138
|
// 县/区级数组
|
|
141
139
|
const areaData = address[provinceIndex].areas[cityIndex].areas;
|
|
@@ -188,7 +186,7 @@ const confirm = ({ value }: { value: Record<string, any>[] }) => {
|
|
|
188
186
|
showByClickInput.value = false;
|
|
189
187
|
emit("update:modelValue", inputValue.value);
|
|
190
188
|
emit("confirm", {
|
|
191
|
-
value: inputValue.value
|
|
189
|
+
value: inputValue.value,
|
|
192
190
|
});
|
|
193
191
|
};
|
|
194
192
|
|
|
@@ -205,7 +203,7 @@ const change = (e: any) => {
|
|
|
205
203
|
uPickerRef.value?.setColumnValues(1, children1);
|
|
206
204
|
//更换 第二列数据
|
|
207
205
|
const children2 = address[index].areas[indexs[1]].areas.map((item) => ({
|
|
208
|
-
...item
|
|
206
|
+
...item,
|
|
209
207
|
}));
|
|
210
208
|
uPickerRef.value?.setColumnValues(2, children2);
|
|
211
209
|
//更换 第三列数据
|
|
@@ -213,14 +211,14 @@ const change = (e: any) => {
|
|
|
213
211
|
if (columnIndex === 1) {
|
|
214
212
|
//如果改变的是第二列
|
|
215
213
|
const children3 = address[indexs[0]].areas[indexs[1]].areas.map((item) => ({
|
|
216
|
-
...item
|
|
214
|
+
...item,
|
|
217
215
|
}));
|
|
218
216
|
uPickerRef.value?.setColumnValues(2, children3);
|
|
219
217
|
}
|
|
220
218
|
|
|
221
219
|
// 发出change时间,value为当前选中的时间戳
|
|
222
220
|
emit("change", {
|
|
223
|
-
...e
|
|
221
|
+
...e,
|
|
224
222
|
});
|
|
225
223
|
};
|
|
226
224
|
|
|
@@ -232,31 +230,5 @@ const onShowByClickInput = () => {
|
|
|
232
230
|
</script>
|
|
233
231
|
|
|
234
232
|
<style lang="scss" scoped>
|
|
235
|
-
@import "
|
|
236
|
-
.hy-datetime-picker {
|
|
237
|
-
flex: 1;
|
|
238
|
-
&__has-input {
|
|
239
|
-
position: relative;
|
|
240
|
-
display: flex;
|
|
241
|
-
flex-direction: column;
|
|
242
|
-
justify-content: center;
|
|
243
|
-
/* #ifndef APP-NVUE */
|
|
244
|
-
width: 100%;
|
|
245
|
-
/* #endif */
|
|
246
|
-
.input-cover {
|
|
247
|
-
opacity: 0;
|
|
248
|
-
position: absolute;
|
|
249
|
-
top: 0;
|
|
250
|
-
bottom: 0;
|
|
251
|
-
left: 0;
|
|
252
|
-
right: 0;
|
|
253
|
-
display: flex;
|
|
254
|
-
flex-direction: column;
|
|
255
|
-
justify-content: center;
|
|
256
|
-
border-radius: 4px;
|
|
257
|
-
border: 1px solid #eee;
|
|
258
|
-
padding: 0 10px;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
233
|
+
@import "./index.scss";
|
|
262
234
|
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
+
.hy-datetime-picker {
|
|
3
|
+
flex: 1;
|
|
4
|
+
&__has-input {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
/* #ifndef APP-NVUE */
|
|
10
|
+
width: 100%;
|
|
11
|
+
/* #endif */
|
|
12
|
+
.input-cover {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
bottom: 0;
|
|
17
|
+
left: 0;
|
|
18
|
+
right: 0;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
border-radius: 4px;
|
|
23
|
+
border: 1px solid #eee;
|
|
24
|
+
padding: 0 10px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
2
|
-
import { DateModeEnum } from "../../typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
3
2
|
|
|
4
3
|
const defaultProps: IProps = {
|
|
5
4
|
show: false,
|
|
@@ -21,7 +20,7 @@ const defaultProps: IProps = {
|
|
|
21
20
|
hasInput: false,
|
|
22
21
|
placeholder: "请选择地址",
|
|
23
22
|
disabledColor: "#F5F5F5",
|
|
24
|
-
toolbarRightSlot: false
|
|
23
|
+
toolbarRightSlot: false,
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
export default defaultProps;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
:style="[
|
|
14
14
|
{
|
|
15
15
|
width: addUnit(size),
|
|
16
|
-
height: addUnit(size)
|
|
17
|
-
}
|
|
16
|
+
height: addUnit(size),
|
|
17
|
+
},
|
|
18
18
|
]"
|
|
19
19
|
/>
|
|
20
20
|
<!-- #endif -->
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
justifyContent: 'center',
|
|
34
34
|
textAlign: 'center',
|
|
35
35
|
color: color,
|
|
36
|
-
fontSize: fontSize
|
|
36
|
+
fontSize: fontSize,
|
|
37
37
|
}"
|
|
38
38
|
>{{ text }}</text
|
|
39
39
|
>
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<script setup lang="ts">
|
|
53
|
-
import { computed, CSSProperties, toRefs, ref, watch } from "vue";
|
|
53
|
+
import { computed, type CSSProperties, toRefs, ref, watch } from "vue";
|
|
54
54
|
import defaultProps from "./props";
|
|
55
|
-
import IProps from "./typing";
|
|
55
|
+
import type IProps from "./typing";
|
|
56
56
|
import { addUnit, random } from "../../utils";
|
|
57
57
|
|
|
58
58
|
// 组件
|
|
@@ -70,7 +70,7 @@ const {
|
|
|
70
70
|
size,
|
|
71
71
|
shape,
|
|
72
72
|
name,
|
|
73
|
-
customStyle
|
|
73
|
+
customStyle,
|
|
74
74
|
} = toRefs(props);
|
|
75
75
|
const emit = defineEmits(["click"]);
|
|
76
76
|
|
|
@@ -97,7 +97,7 @@ const colors = ref<string[]>([
|
|
|
97
97
|
"#86cefa",
|
|
98
98
|
"#98d1ee",
|
|
99
99
|
"#73d1f1",
|
|
100
|
-
"#80a7dc"
|
|
100
|
+
"#80a7dc",
|
|
101
101
|
]);
|
|
102
102
|
const avatarUrl = ref(src.value);
|
|
103
103
|
const allowMp = ref<boolean>(false);
|
|
@@ -111,7 +111,7 @@ watch(
|
|
|
111
111
|
errorHandler();
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
{ immediate: true }
|
|
114
|
+
{ immediate: true },
|
|
115
115
|
);
|
|
116
116
|
|
|
117
117
|
const avatarStyle = computed<CSSProperties>(() => {
|
|
@@ -121,7 +121,7 @@ const avatarStyle = computed<CSSProperties>(() => {
|
|
|
121
121
|
? randomBgColor.value
|
|
122
122
|
? colors.value[colorIndex.value ? colorIndex.value : random(0, 19)]
|
|
123
123
|
: bgColor.value
|
|
124
|
-
: "transparent"
|
|
124
|
+
: "transparent",
|
|
125
125
|
};
|
|
126
126
|
if (typeof size.value === "number") {
|
|
127
127
|
style.width = addUnit(size.value);
|
|
@@ -169,49 +169,5 @@ const clickHandler = (e: Event) => {
|
|
|
169
169
|
</script>
|
|
170
170
|
|
|
171
171
|
<style lang="scss" scoped>
|
|
172
|
-
@import "
|
|
173
|
-
@import "../../theme.scss";
|
|
174
|
-
|
|
175
|
-
.hy-avatar {
|
|
176
|
-
@include flex;
|
|
177
|
-
align-items: center;
|
|
178
|
-
justify-content: center;
|
|
179
|
-
|
|
180
|
-
&--circle {
|
|
181
|
-
border-radius: $hy-border-radius-circle;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
&--square {
|
|
185
|
-
border-radius: $hy-border-margin-padding-sm;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
&--small {
|
|
189
|
-
width: $hy-avatar-size-sm;
|
|
190
|
-
height: $hy-avatar-size-sm;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
&--medium {
|
|
194
|
-
width: $hy-avatar-size-base;
|
|
195
|
-
height: $hy-avatar-size-base;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
&--large {
|
|
199
|
-
width: $hy-avatar-size-lg;
|
|
200
|
-
height: $hy-avatar-size-lg;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
&__image {
|
|
204
|
-
width: 100%;
|
|
205
|
-
height: 100%;
|
|
206
|
-
|
|
207
|
-
&--circle {
|
|
208
|
-
border-radius: $hy-border-radius-circle;
|
|
209
|
-
overflow: hidden;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
&--square {
|
|
213
|
-
border-radius: $hy-border-margin-padding-sm;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
172
|
+
@import "./index.scss";
|
|
217
173
|
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
+
@use "../../theme.scss" as *;
|
|
3
|
+
|
|
4
|
+
.hy-avatar {
|
|
5
|
+
@include flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
|
|
9
|
+
&--circle {
|
|
10
|
+
border-radius: $hy-border-radius-circle;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&--square {
|
|
14
|
+
border-radius: $hy-border-margin-padding-sm;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&--small {
|
|
18
|
+
width: $hy-avatar-size-sm;
|
|
19
|
+
height: $hy-avatar-size-sm;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--medium {
|
|
23
|
+
width: $hy-avatar-size-base;
|
|
24
|
+
height: $hy-avatar-size-base;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--large {
|
|
28
|
+
width: $hy-avatar-size-lg;
|
|
29
|
+
height: $hy-avatar-size-lg;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__image {
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
|
|
36
|
+
&--circle {
|
|
37
|
+
border-radius: $hy-border-radius-circle;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--square {
|
|
42
|
+
border-radius: $hy-border-margin-padding-sm;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
|
|
3
3
|
const defaultProps: IProps = {
|
|
4
4
|
src: "",
|
|
@@ -14,7 +14,7 @@ const defaultProps: IProps = {
|
|
|
14
14
|
randomBgColor: false,
|
|
15
15
|
defaultUrl: "",
|
|
16
16
|
colorIndex: 0,
|
|
17
|
-
name: ""
|
|
17
|
+
name: "",
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export default defaultProps;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CSSProperties } from "vue";
|
|
1
|
+
import type { CSSProperties } from "vue";
|
|
2
2
|
|
|
3
3
|
export default interface IProps {
|
|
4
4
|
/**
|
|
5
5
|
* @description 头像路径,如加载失败,将会显示默认头像(不能为相对路径)
|
|
6
6
|
* */
|
|
7
|
-
src
|
|
7
|
+
src?: string;
|
|
8
8
|
/**
|
|
9
9
|
* @description 头像形状 ( circle (默认) | square)
|
|
10
10
|
* */
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script setup lang="ts">
|
|
13
|
-
import { computed, CSSProperties, toRefs } from "vue";
|
|
14
|
-
import defaultProps from "
|
|
15
|
-
import IProps from "
|
|
13
|
+
import { computed, type CSSProperties, toRefs } from "vue";
|
|
14
|
+
import defaultProps from "./props";
|
|
15
|
+
import type IProps from "./typing";
|
|
16
16
|
// 组件
|
|
17
17
|
import HyTransition from "../hy-transition/hy-transition.vue";
|
|
18
18
|
import HyIcon from "../hy-icon/hy-icon.vue";
|
|
@@ -30,12 +30,12 @@ const backTopStyle = computed<CSSProperties>(() => {
|
|
|
30
30
|
width: "40px",
|
|
31
31
|
height: "40px",
|
|
32
32
|
position: "fixed",
|
|
33
|
-
zIndex: 10
|
|
33
|
+
zIndex: 10,
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
36
|
const contentStyle = computed<CSSProperties>(() => {
|
|
37
37
|
const style: CSSProperties = {
|
|
38
|
-
borderRadius: mode.value === "circle" ? "50%" : "4px"
|
|
38
|
+
borderRadius: mode.value === "circle" ? "50%" : "4px",
|
|
39
39
|
};
|
|
40
40
|
return Object.assign(style, customStyle.value);
|
|
41
41
|
});
|
|
@@ -45,27 +45,12 @@ const show = computed<boolean>(() => {
|
|
|
45
45
|
const backToTop = () => {
|
|
46
46
|
uni.pageScrollTo({
|
|
47
47
|
scrollTop: 0,
|
|
48
|
-
duration: duration.value
|
|
48
|
+
duration: duration.value,
|
|
49
49
|
});
|
|
50
50
|
emit("click");
|
|
51
51
|
};
|
|
52
52
|
</script>
|
|
53
53
|
|
|
54
54
|
<style lang="scss" scoped>
|
|
55
|
-
@import "
|
|
56
|
-
|
|
57
|
-
.hy-back-top {
|
|
58
|
-
@include flex;
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
align-items: center;
|
|
61
|
-
flex: 1;
|
|
62
|
-
height: 100%;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
background-color: #e1e1e1;
|
|
65
|
-
|
|
66
|
-
&__tips {
|
|
67
|
-
font-size: 12px;
|
|
68
|
-
transform: scale(0.8);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
55
|
+
@import "./index.scss";
|
|
71
56
|
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@use "../../libs/css/mixin.scss" as *;
|
|
2
|
+
|
|
3
|
+
.hy-back-top {
|
|
4
|
+
@include flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: center;
|
|
7
|
+
flex: 1;
|
|
8
|
+
height: 100%;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
background-color: #e1e1e1;
|
|
11
|
+
|
|
12
|
+
&__tips {
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
transform: scale(0.8);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import IProps from "./typing";
|
|
1
|
+
import type IProps from "./typing";
|
|
2
2
|
import { IconConfig } from "../../config";
|
|
3
3
|
|
|
4
4
|
const defaultProps: IProps = {
|
|
@@ -13,11 +13,11 @@ const defaultProps: IProps = {
|
|
|
13
13
|
zIndex: 888,
|
|
14
14
|
iconStyle: {
|
|
15
15
|
color: "#909399",
|
|
16
|
-
fontSize: "19px"
|
|
16
|
+
fontSize: "19px",
|
|
17
17
|
},
|
|
18
18
|
customStyle: {
|
|
19
|
-
transform: "rotate(180deg)"
|
|
20
|
-
}
|
|
19
|
+
transform: "rotate(180deg)",
|
|
20
|
+
},
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export default defaultProps;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from "vue";
|
|
2
|
-
import { IconConfig } from "../../config";
|
|
1
|
+
import type { CSSProperties } from "vue";
|
|
3
2
|
|
|
4
3
|
export default interface IProps {
|
|
5
4
|
/**
|
|
@@ -21,7 +20,7 @@ export default interface IProps {
|
|
|
21
20
|
/**
|
|
22
21
|
* @description 滚动距离 (默认 0 )
|
|
23
22
|
* */
|
|
24
|
-
scrollTop
|
|
23
|
+
scrollTop: number;
|
|
25
24
|
/**
|
|
26
25
|
* @description 距离顶部多少距离显示,单位px (默认 400 )
|
|
27
26
|
* */
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
isDot ? 'hy-badge--dot' : 'hy-badge--not-dot',
|
|
7
7
|
inverted && 'hy-badge--inverted',
|
|
8
8
|
shape === 'horn' && 'hy-badge--horn',
|
|
9
|
-
`hy-badge--${type}${inverted ? '--inverted' : ''}
|
|
9
|
+
`hy-badge--${type}${inverted ? '--inverted' : ''}`,
|
|
10
10
|
]"
|
|
11
11
|
:style="[customStyle, badgeStyle]"
|
|
12
12
|
>{{ isDot ? "" : showValue }}</text
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
|
-
import IProps from "./typing";
|
|
17
|
+
import type IProps from "./typing";
|
|
18
18
|
import defaultProps from "./props";
|
|
19
|
-
import { computed, CSSProperties, toRefs } from "vue";
|
|
19
|
+
import { computed, type CSSProperties, toRefs } from "vue";
|
|
20
20
|
import { addUnit } from "../../utils";
|
|
21
21
|
|
|
22
22
|
const props = withDefaults(defineProps<IProps>(), defaultProps);
|
|
@@ -29,7 +29,7 @@ const {
|
|
|
29
29
|
offset,
|
|
30
30
|
inverted,
|
|
31
31
|
max,
|
|
32
|
-
customStyle
|
|
32
|
+
customStyle,
|
|
33
33
|
} = toRefs(props);
|
|
34
34
|
const emit = defineEmits(["click"]);
|
|
35
35
|
|
|
@@ -81,75 +81,5 @@ const showValue = computed(() => {
|
|
|
81
81
|
</script>
|
|
82
82
|
|
|
83
83
|
<style lang="scss" scoped>
|
|
84
|
-
@import "
|
|
85
|
-
@import "../../theme.scss";
|
|
86
|
-
|
|
87
|
-
$hy-badge-dot-size: 8px !default;
|
|
88
|
-
$hy-badge-text-font-size: 11px !default;
|
|
89
|
-
|
|
90
|
-
.hy-badge {
|
|
91
|
-
border-radius: 100px;
|
|
92
|
-
@include flex;
|
|
93
|
-
line-height: $hy-badge-text-font-size;
|
|
94
|
-
text-align: center;
|
|
95
|
-
font-size: $hy-badge-text-font-size;
|
|
96
|
-
color: $hy-text-color-inverse;
|
|
97
|
-
|
|
98
|
-
&--dot {
|
|
99
|
-
height: $hy-badge-dot-size;
|
|
100
|
-
width: $hy-badge-dot-size;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
&--inverted {
|
|
104
|
-
font-size: 13px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
&--not-dot {
|
|
108
|
-
padding: 2px 5px;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&--horn {
|
|
112
|
-
border-bottom-left-radius: 0;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&--primary {
|
|
116
|
-
background-color: $hy-primary;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
&--primary--inverted {
|
|
120
|
-
color: $hy-primary;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
&--error {
|
|
124
|
-
background-color: $hy-error;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
&--error--inverted {
|
|
128
|
-
color: $hy-error;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&--success {
|
|
132
|
-
background-color: $hy-success;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
&--success--inverted {
|
|
136
|
-
color: $hy-success;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
&--info {
|
|
140
|
-
background-color: $hy-info;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
&--info--inverted {
|
|
144
|
-
color: $hy-info;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
&--warning {
|
|
148
|
-
background-color: $hy-warning;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
&--warning--inverted {
|
|
152
|
-
color: $hy-warning;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
84
|
+
@import "./index.scss";
|
|
155
85
|
</style>
|