hy-app 0.3.0 → 0.3.2
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/avatar.zip +0 -0
- 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-avatar/hy-avatar.vue +84 -85
- package/components/hy-back-top/hy-back-top.vue +8 -6
- package/components/hy-badge/hy-badge.vue +47 -46
- package/components/hy-button/hy-button.vue +117 -93
- package/components/hy-calendar/hy-calendar.vue +168 -160
- package/components/hy-card/hy-card.vue +50 -43
- package/components/hy-card/typing.d.ts +33 -32
- package/components/hy-cell/hy-cell.vue +73 -51
- package/components/hy-check-button/hy-check-button.vue +54 -47
- package/components/hy-checkbox/hy-checkbox.vue +97 -105
- package/components/hy-code-input/hy-code-input.vue +80 -89
- package/components/hy-config-provider/hy-config-provider.vue +20 -21
- 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 +42 -42
- package/components/hy-flex/hy-flex.vue +99 -0
- package/components/hy-flex/index.scss +8 -0
- package/components/hy-flex/typing.d.ts +23 -0
- 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 -252
- package/components/hy-form/typing.d.ts +4 -0
- package/components/hy-form-group/hy-form-group.vue +114 -183
- package/components/hy-form-item/hy-form-item.vue +12 -10
- package/components/hy-form-item/index.scss +2 -2
- package/components/hy-form-item/typing.d.ts +3 -6
- 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-login/TheUserLogin.vue +1 -1
- 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-notice-bar.vue +26 -27
- 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-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 +73 -66
- 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 +195 -153
- 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 +90 -86
- 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 +294 -152
- package/components/hy-upload/typing.d.ts +41 -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/components/index.ts +1 -1
- package/composables/usePopover.ts +236 -221
- package/composables/useQueue.ts +53 -52
- package/global.d.ts +1 -0
- package/package.json +2 -2
- package/store/index.ts +9 -1
- package/theme.scss +5 -5
- package/typing/index.ts +0 -1
- package/typing/modules/common.d.ts +0 -2
- package/web-types.json +1 -1
|
@@ -1,221 +1,236 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
placement ===
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
[
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
1
|
+
import { getCurrentInstance, ref } from "vue";
|
|
2
|
+
import type { CSSProperties } from "vue";
|
|
3
|
+
import { getRect, isObject } from "../utils";
|
|
4
|
+
import type { IOffset, IPlacementVo } from "../components/hy-popover/typing";
|
|
5
|
+
|
|
6
|
+
export function usePopover(visibleArrow = true) {
|
|
7
|
+
const instance = getCurrentInstance();
|
|
8
|
+
const popStyle = ref<CSSProperties>();
|
|
9
|
+
const arrowStyle = ref<string>("");
|
|
10
|
+
const showStyle = ref<string>("");
|
|
11
|
+
const arrowClass = ref<string>("");
|
|
12
|
+
const popWidth = ref<number>(0);
|
|
13
|
+
const popHeight = ref<number>(0);
|
|
14
|
+
const left = ref<number>(0);
|
|
15
|
+
const bottom = ref<number>(0);
|
|
16
|
+
const width = ref<number>(0);
|
|
17
|
+
const height = ref<number>(0);
|
|
18
|
+
const top = ref<number>(0);
|
|
19
|
+
|
|
20
|
+
function noop() {}
|
|
21
|
+
|
|
22
|
+
function init(
|
|
23
|
+
placement: IPlacementVo,
|
|
24
|
+
visibleArrow: boolean,
|
|
25
|
+
selector: string,
|
|
26
|
+
) {
|
|
27
|
+
// 初始化 class
|
|
28
|
+
if (visibleArrow) {
|
|
29
|
+
const arrowClassArr = [
|
|
30
|
+
`hy-${selector}__arrow`,
|
|
31
|
+
placement === "bottom" ||
|
|
32
|
+
placement === "bottom-start" ||
|
|
33
|
+
placement === "bottom-end"
|
|
34
|
+
? `hy-${selector}__arrow-up`
|
|
35
|
+
: "",
|
|
36
|
+
placement === "left" ||
|
|
37
|
+
placement === "left-start" ||
|
|
38
|
+
placement === "left-end"
|
|
39
|
+
? `hy-${selector}__arrow-right`
|
|
40
|
+
: "",
|
|
41
|
+
placement === "right" ||
|
|
42
|
+
placement === "right-start" ||
|
|
43
|
+
placement === "right-end"
|
|
44
|
+
? `hy-${selector}__arrow-left`
|
|
45
|
+
: "",
|
|
46
|
+
placement === "top" ||
|
|
47
|
+
placement === "top-start" ||
|
|
48
|
+
placement === "top-end"
|
|
49
|
+
? `hy-${selector}__arrow-down`
|
|
50
|
+
: "",
|
|
51
|
+
];
|
|
52
|
+
arrowClass.value = arrowClassArr.join(" ");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 初始化数据获取
|
|
56
|
+
getRect("#target", false, instance).then((rect) => {
|
|
57
|
+
if (!rect) return;
|
|
58
|
+
left.value = rect.left as number;
|
|
59
|
+
bottom.value = rect.bottom as number;
|
|
60
|
+
width.value = rect.width as number;
|
|
61
|
+
height.value = rect.height as number;
|
|
62
|
+
top.value = rect.top as number;
|
|
63
|
+
});
|
|
64
|
+
// 用透明度可在初始化时获取到pop尺寸
|
|
65
|
+
getRect("#pos", false, instance).then((rect) => {
|
|
66
|
+
if (!rect) return;
|
|
67
|
+
popWidth.value = rect.width as number;
|
|
68
|
+
popHeight.value = rect.height as number;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function control(placement: IPlacementVo, offset: IOffset) {
|
|
73
|
+
// arrow size
|
|
74
|
+
const arrowSize = visibleArrow ? 9 : 0;
|
|
75
|
+
// 上下位(纵轴)对应的距离左边的距离
|
|
76
|
+
const verticalX = width.value / 2;
|
|
77
|
+
// 上下位(纵轴)对应的距离底部的距离
|
|
78
|
+
const verticalY = arrowSize + height.value + 5;
|
|
79
|
+
// 左右位(横轴)对应的距离左边的距离
|
|
80
|
+
const horizontalX = width.value + arrowSize + 5;
|
|
81
|
+
// 左右位(横轴)对应的距离底部的距离
|
|
82
|
+
const horizontalY = height.value / 2;
|
|
83
|
+
|
|
84
|
+
let offsetX = 0;
|
|
85
|
+
let offsetY = 0;
|
|
86
|
+
if (Array.isArray(offset)) {
|
|
87
|
+
offsetX = (verticalX - 17 > 0 ? 0 : verticalX - 25) + offset[0];
|
|
88
|
+
offsetY =
|
|
89
|
+
(horizontalY - 17 > 0 ? 0 : horizontalY - 25) +
|
|
90
|
+
(offset[1] ? offset[1] : offset[0]);
|
|
91
|
+
} else if (isObject(offset)) {
|
|
92
|
+
offsetX = (verticalX - 17 > 0 ? 0 : verticalX - 25) + offset.x;
|
|
93
|
+
offsetY = (horizontalY - 17 > 0 ? 0 : horizontalY - 25) + offset.y;
|
|
94
|
+
} else {
|
|
95
|
+
offsetX = (verticalX - 17 > 0 ? 0 : verticalX - 25) + offset;
|
|
96
|
+
offsetY = (horizontalY - 17 > 0 ? 0 : horizontalY - 25) + offset;
|
|
97
|
+
}
|
|
98
|
+
// const offsetX = (verticalX - 17 > 0 ? 0 : verticalX - 25) + offset
|
|
99
|
+
// const offsetY = (horizontalY - 17 > 0 ? 0 : horizontalY - 25) + offset
|
|
100
|
+
|
|
101
|
+
const placements = new Map([
|
|
102
|
+
// 上
|
|
103
|
+
[
|
|
104
|
+
"top",
|
|
105
|
+
[
|
|
106
|
+
{
|
|
107
|
+
left: `${verticalX}px`,
|
|
108
|
+
bottom: `${verticalY}px`,
|
|
109
|
+
transform: "translateX(-50%)",
|
|
110
|
+
},
|
|
111
|
+
"left: 50%;",
|
|
112
|
+
],
|
|
113
|
+
],
|
|
114
|
+
[
|
|
115
|
+
"top-start",
|
|
116
|
+
[
|
|
117
|
+
{
|
|
118
|
+
left: `${offsetX}px`,
|
|
119
|
+
bottom: `${verticalY}px`,
|
|
120
|
+
},
|
|
121
|
+
`left: ${(popWidth.value >= width.value ? width.value / 2 : popWidth.value - 25) - offsetX}px;`,
|
|
122
|
+
],
|
|
123
|
+
],
|
|
124
|
+
[
|
|
125
|
+
"top-end",
|
|
126
|
+
[
|
|
127
|
+
{
|
|
128
|
+
right: `${offsetX}px`,
|
|
129
|
+
bottom: `${verticalY}px`,
|
|
130
|
+
},
|
|
131
|
+
`right: ${(popWidth.value >= width.value ? width.value / 2 : popWidth.value - 25) - offsetX}px; transform: translateX(50%);`,
|
|
132
|
+
],
|
|
133
|
+
],
|
|
134
|
+
// 下
|
|
135
|
+
[
|
|
136
|
+
"bottom",
|
|
137
|
+
[
|
|
138
|
+
{
|
|
139
|
+
left: verticalX + "px",
|
|
140
|
+
top: verticalY + "px",
|
|
141
|
+
transform: "translateX(-50%)",
|
|
142
|
+
},
|
|
143
|
+
"left: 50%;",
|
|
144
|
+
],
|
|
145
|
+
],
|
|
146
|
+
[
|
|
147
|
+
"bottom-start",
|
|
148
|
+
[
|
|
149
|
+
{
|
|
150
|
+
left: `${offsetX}px`,
|
|
151
|
+
top: `${verticalY}px`,
|
|
152
|
+
},
|
|
153
|
+
`left: ${(popWidth.value >= width.value ? width.value / 2 : popWidth.value - 25) - offsetX}px;`,
|
|
154
|
+
],
|
|
155
|
+
],
|
|
156
|
+
[
|
|
157
|
+
"bottom-end",
|
|
158
|
+
[
|
|
159
|
+
{
|
|
160
|
+
right: `${offsetX}px`,
|
|
161
|
+
top: `${verticalY}px`,
|
|
162
|
+
},
|
|
163
|
+
`right: ${(popWidth.value >= width.value ? width.value / 2 : popWidth.value - 25) - offsetX}px; transform: translateX(50%);`,
|
|
164
|
+
],
|
|
165
|
+
],
|
|
166
|
+
// 左
|
|
167
|
+
[
|
|
168
|
+
"left",
|
|
169
|
+
[
|
|
170
|
+
{
|
|
171
|
+
right: `${horizontalX}px`,
|
|
172
|
+
top: `${horizontalY}px`,
|
|
173
|
+
transform: "translateY(-50%)",
|
|
174
|
+
},
|
|
175
|
+
"top: 50%",
|
|
176
|
+
],
|
|
177
|
+
],
|
|
178
|
+
[
|
|
179
|
+
"left-start",
|
|
180
|
+
[
|
|
181
|
+
{
|
|
182
|
+
right: `${horizontalX}px`,
|
|
183
|
+
top: `${offsetY}px`,
|
|
184
|
+
},
|
|
185
|
+
`top: ${(popHeight.value >= height.value ? height.value / 2 : popHeight.value - 20) - offsetY}px;`,
|
|
186
|
+
],
|
|
187
|
+
],
|
|
188
|
+
[
|
|
189
|
+
"left-end",
|
|
190
|
+
[
|
|
191
|
+
{
|
|
192
|
+
right: `${horizontalX}px`,
|
|
193
|
+
bottom: `${offsetY}px`,
|
|
194
|
+
},
|
|
195
|
+
`bottom: ${(popHeight.value >= height.value ? height.value / 2 : popHeight.value - 20) - offsetY}px; transform: translateY(50%);`,
|
|
196
|
+
],
|
|
197
|
+
],
|
|
198
|
+
// 右
|
|
199
|
+
[
|
|
200
|
+
"right",
|
|
201
|
+
[
|
|
202
|
+
{
|
|
203
|
+
left: `${horizontalX}px`,
|
|
204
|
+
top: `${horizontalY}px`,
|
|
205
|
+
transform: "translateY(-50%)",
|
|
206
|
+
},
|
|
207
|
+
"top: 50%",
|
|
208
|
+
],
|
|
209
|
+
],
|
|
210
|
+
[
|
|
211
|
+
"right-start",
|
|
212
|
+
[
|
|
213
|
+
{
|
|
214
|
+
left: `${horizontalX}px`,
|
|
215
|
+
top: `${offsetY}px`,
|
|
216
|
+
},
|
|
217
|
+
`top: ${(popHeight.value >= height.value ? height.value / 2 : popHeight.value - 20) - offsetY}px;`,
|
|
218
|
+
],
|
|
219
|
+
],
|
|
220
|
+
[
|
|
221
|
+
"right-end",
|
|
222
|
+
[
|
|
223
|
+
{
|
|
224
|
+
left: `${horizontalX}px`,
|
|
225
|
+
bottom: `${offsetY}px`,
|
|
226
|
+
},
|
|
227
|
+
`bottom: ${(popHeight.value >= height.value ? height.value / 2 : popHeight.value - 20) - offsetY}px; transform: translateY(50%);`,
|
|
228
|
+
],
|
|
229
|
+
],
|
|
230
|
+
]);
|
|
231
|
+
popStyle.value = placements.get(placement)![0] as CSSProperties;
|
|
232
|
+
arrowStyle.value = placements.get(placement)![1] as string;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return { popStyle, arrowStyle, showStyle, arrowClass, init, control, noop };
|
|
236
|
+
}
|
package/composables/useQueue.ts
CHANGED
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
1
|
+
import { provide, ref } from "vue";
|
|
2
|
+
import type { Ref } from "vue";
|
|
3
|
+
|
|
4
|
+
export const queueKey = "__QUEUE_KEY__";
|
|
5
|
+
|
|
6
|
+
export interface Queue {
|
|
7
|
+
queue: Ref<any[]>;
|
|
8
|
+
pushToQueue: (comp: any) => void;
|
|
9
|
+
removeFromQueue: (comp: any) => void;
|
|
10
|
+
closeOther: (comp: any) => void;
|
|
11
|
+
closeOutside: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function useQueue() {
|
|
15
|
+
const queue = ref<any[]>([]);
|
|
16
|
+
|
|
17
|
+
function pushToQueue(comp: any) {
|
|
18
|
+
queue.value.push(comp);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function removeFromQueue(comp: any) {
|
|
22
|
+
queue.value = queue.value.filter((item) => {
|
|
23
|
+
return item.$.uid !== comp.$.uid;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function closeOther(comp: any) {
|
|
28
|
+
queue.value.forEach((item) => {
|
|
29
|
+
if (item.$.uid !== comp.$.uid) {
|
|
30
|
+
item.$.exposed.close();
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function closeOutside() {
|
|
36
|
+
queue.value.forEach((item) => {
|
|
37
|
+
item.$.exposed.close();
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
provide(queueKey, {
|
|
42
|
+
queue,
|
|
43
|
+
pushToQueue,
|
|
44
|
+
removeFromQueue,
|
|
45
|
+
closeOther,
|
|
46
|
+
closeOutside,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
closeOther,
|
|
51
|
+
closeOutside,
|
|
52
|
+
};
|
|
53
|
+
}
|
package/global.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare module 'vue' {
|
|
|
22
22
|
HyDropdown: (typeof import('./components/hy-dropdown/hy-dropdown.vue'))['default']
|
|
23
23
|
HyDropdownItem: (typeof import('./components/hy-dropdown-item/hy-dropdown-item.vue'))['default']
|
|
24
24
|
HyEmpty: (typeof import('./components/hy-empty/hy-empty.vue'))['default']
|
|
25
|
+
HyFlex: (typeof import('./components/hy-flex/hy-flex.vue'))['default']
|
|
25
26
|
HyFloatButton: (typeof import('./components/hy-float-button/hy-float-button.vue'))['default']
|
|
26
27
|
HyFloatingPanel: (typeof import('./components/hy-floating-panel/hy-floating-panel.vue'))['default']
|
|
27
28
|
HyForm: (typeof import('@/package/components/hy-form-group/hy-form.vue'))['default']
|
package/package.json
CHANGED
package/store/index.ts
CHANGED
package/theme.scss
CHANGED
|
@@ -40,14 +40,14 @@ $hy-text-color--hover: var(--hy-text-color--hover, #58595b)!default; // 点击
|
|
|
40
40
|
/* 背景色 */
|
|
41
41
|
$hy-background: var(--hy-background, #f8f8f8) !default; // 背景色
|
|
42
42
|
$hy-background--2: var(--hy-background--2, #ffffff) !default; // 弹窗背景色
|
|
43
|
-
$hy-background--3: var(--hy-background--3,
|
|
43
|
+
$hy-background--3: var(--hy-background--3, rgb(238, 238, 239)) !default; // 弹窗背景色
|
|
44
44
|
$hy-background--container: var(--hy-background--container, #ffffff) !default; // 容器背景色
|
|
45
|
-
$hy-background--disabled: var(--hy-background--disabled,
|
|
45
|
+
$hy-background--disabled: var(--hy-background--disabled, rgba(0, 0, 0, 0.04)); // 禁用背景色
|
|
46
46
|
$hy-background--track: var(--hy-background--track, #F6F6F6) !default; // 轨道背景色
|
|
47
47
|
$hy-background--empty: var(--hy-background--empty, #F3F3F3) !default; // 搜索背景色
|
|
48
|
-
$hy-background--hover: var(--hy-background--hover, rgba(0,0,0,0.
|
|
48
|
+
$hy-background--hover: var(--hy-background--hover, rgba(0,0,0,0.05)) !default; // 点击状态
|
|
49
49
|
$hy-light-background-mask: var(--hy-light-background-mask, rgba(0, 0, 0, 0.5)); //遮罩颜色
|
|
50
|
-
$hy-background--active: var(--hy-background--active, #
|
|
50
|
+
$hy-background--active: var(--hy-background--active, #FFFFFF); // 选中背景色
|
|
51
51
|
$hy-background--close: var(--hy-background--close, #f0f0f0); // 选中背景色
|
|
52
52
|
|
|
53
53
|
/* 文字尺寸 */
|
|
@@ -88,4 +88,4 @@ $hy-border-margin-padding-sm: var(--hy-border-margin-padding-sm, 10rpx) !default
|
|
|
88
88
|
$hy-border-margin-padding-base: var(--hy-border-margin-padding-base, 20rpx) !default;
|
|
89
89
|
$hy-border-margin-padding-lg: var(--hy-border-margin-padding-lg, 30rpx) !default;
|
|
90
90
|
/* 底部线条 */
|
|
91
|
-
$hy-border-line: var(--hy-border-line, 1rpx solid
|
|
91
|
+
$hy-border-line: var(--hy-border-line, 1rpx solid #e8e8e8) !default;
|
package/typing/index.ts
CHANGED