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.
Files changed (108) hide show
  1. package/README.md +6 -3
  2. package/common/shakeService.ts +31 -29
  3. package/components/avatar.zip +0 -0
  4. package/components/hy-action-sheet/hy-action-sheet.vue +71 -46
  5. package/components/hy-address-picker/hy-address-picker.vue +94 -83
  6. package/components/hy-avatar/hy-avatar.vue +84 -85
  7. package/components/hy-back-top/hy-back-top.vue +8 -6
  8. package/components/hy-badge/hy-badge.vue +47 -46
  9. package/components/hy-button/hy-button.vue +117 -93
  10. package/components/hy-calendar/hy-calendar.vue +168 -160
  11. package/components/hy-card/hy-card.vue +50 -43
  12. package/components/hy-card/typing.d.ts +33 -32
  13. package/components/hy-cell/hy-cell.vue +73 -51
  14. package/components/hy-check-button/hy-check-button.vue +54 -47
  15. package/components/hy-checkbox/hy-checkbox.vue +97 -105
  16. package/components/hy-code-input/hy-code-input.vue +80 -89
  17. package/components/hy-config-provider/hy-config-provider.vue +20 -21
  18. package/components/hy-count-down/hy-count-down.vue +66 -67
  19. package/components/hy-count-to/hy-count-to.vue +105 -99
  20. package/components/hy-count-to/typing.d.ts +13 -12
  21. package/components/hy-datetime-picker/hy-datetime-picker.vue +261 -253
  22. package/components/hy-datetime-picker/typing.d.ts +42 -40
  23. package/components/hy-divider/hy-divider.vue +68 -73
  24. package/components/hy-dropdown/hy-dropdown.vue +20 -19
  25. package/components/hy-dropdown-item/hy-dropdown-item.vue +66 -61
  26. package/components/hy-dropdown-item/typing.d.ts +9 -9
  27. package/components/hy-empty/hy-empty.vue +42 -42
  28. package/components/hy-flex/hy-flex.vue +99 -0
  29. package/components/hy-flex/index.scss +8 -0
  30. package/components/hy-flex/typing.d.ts +23 -0
  31. package/components/hy-float-button/hy-float-button.vue +218 -210
  32. package/components/hy-folding-panel/hy-folding-panel.vue +32 -33
  33. package/components/hy-form/hy-form.vue +264 -252
  34. package/components/hy-form/typing.d.ts +4 -0
  35. package/components/hy-form-group/hy-form-group.vue +114 -183
  36. package/components/hy-form-item/hy-form-item.vue +12 -10
  37. package/components/hy-form-item/index.scss +2 -2
  38. package/components/hy-form-item/typing.d.ts +3 -6
  39. package/components/hy-grid/hy-grid.vue +44 -43
  40. package/components/hy-icon/hy-icon.vue +61 -67
  41. package/components/hy-image/hy-image.vue +112 -88
  42. package/components/hy-image/typing.d.ts +27 -23
  43. package/components/hy-input/hy-input.vue +157 -127
  44. package/components/hy-input/typing.d.ts +53 -47
  45. package/components/hy-line/hy-line.vue +26 -26
  46. package/components/hy-line-progress/hy-line-progress.vue +42 -35
  47. package/components/hy-list/hy-list.vue +76 -85
  48. package/components/hy-loading/hy-loading.vue +26 -23
  49. package/components/hy-login/TheUserLogin.vue +1 -1
  50. package/components/hy-menu/hy-menu.vue +48 -43
  51. package/components/hy-menu/typing.d.ts +18 -17
  52. package/components/hy-modal/hy-modal.vue +39 -35
  53. package/components/hy-navbar/hy-navbar.vue +25 -25
  54. package/components/hy-navbar/typing.d.ts +24 -22
  55. package/components/hy-notice-bar/hy-notice-bar.vue +26 -27
  56. package/components/hy-notify/hy-notify.vue +53 -53
  57. package/components/hy-number-step/hy-number-step.vue +134 -146
  58. package/components/hy-number-step/typing.d.ts +35 -35
  59. package/components/hy-overlay/hy-overlay.vue +23 -21
  60. package/components/hy-pagination/hy-pagination.vue +41 -36
  61. package/components/hy-picker/hy-picker.vue +184 -154
  62. package/components/hy-picker/typing.d.ts +39 -39
  63. package/components/hy-popover/hy-popover.vue +97 -77
  64. package/components/hy-popup/hy-popup.vue +107 -98
  65. package/components/hy-price/hy-price.vue +38 -34
  66. package/components/hy-qrcode/hy-qrcode.vue +50 -51
  67. package/components/hy-radio/hy-radio.vue +101 -113
  68. package/components/hy-rate/hy-rate.vue +107 -88
  69. package/components/hy-read-more/hy-read-more.vue +64 -49
  70. package/components/hy-scroll-list/hy-scroll-list.vue +45 -48
  71. package/components/hy-search/hy-search.vue +73 -66
  72. package/components/hy-search/typing.d.ts +36 -35
  73. package/components/hy-signature/hy-signature.vue +282 -240
  74. package/components/hy-slider/hy-slider.vue +195 -153
  75. package/components/hy-slider/typing.d.ts +21 -21
  76. package/components/hy-steps/hy-steps.vue +118 -90
  77. package/components/hy-steps/index.scss +31 -21
  78. package/components/hy-submit-bar/hy-submit-bar.vue +61 -70
  79. package/components/hy-subsection/hy-subsection.vue +99 -102
  80. package/components/hy-subsection/typing.d.ts +19 -19
  81. package/components/hy-swipe-action/hy-swipe-action.vue +131 -118
  82. package/components/hy-swiper/hy-swiper.vue +85 -71
  83. package/components/hy-switch/hy-switch.vue +67 -72
  84. package/components/hy-switch/typing.d.ts +21 -19
  85. package/components/hy-tabs/hy-tabs.vue +168 -113
  86. package/components/hy-tag/hy-tag.vue +90 -86
  87. package/components/hy-tag/typing.d.ts +26 -21
  88. package/components/hy-text/hy-text.vue +119 -111
  89. package/components/hy-textarea/hy-textarea.vue +100 -93
  90. package/components/hy-textarea/typing.d.ts +36 -31
  91. package/components/hy-toast/hy-toast.vue +77 -67
  92. package/components/hy-tooltip/hy-tooltip.vue +109 -91
  93. package/components/hy-transition/hy-transition.vue +62 -66
  94. package/components/hy-upload/hy-upload.vue +294 -152
  95. package/components/hy-upload/typing.d.ts +41 -36
  96. package/components/hy-warn/hy-warn.vue +34 -27
  97. package/components/hy-waterfall/hy-waterfall.vue +83 -74
  98. package/components/hy-watermark/hy-watermark.vue +134 -115
  99. package/components/index.ts +1 -1
  100. package/composables/usePopover.ts +236 -221
  101. package/composables/useQueue.ts +53 -52
  102. package/global.d.ts +1 -0
  103. package/package.json +2 -2
  104. package/store/index.ts +9 -1
  105. package/theme.scss +5 -5
  106. package/typing/index.ts +0 -1
  107. package/typing/modules/common.d.ts +0 -2
  108. package/web-types.json +1 -1
@@ -1,221 +1,236 @@
1
- import { CSSProperties, getCurrentInstance, ref } from 'vue'
2
- import { getRect, isObject } from '../utils'
3
- import { IOffset, IPlacementVo } from '@/package/components/hy-popover/typing'
4
-
5
- export function usePopover(visibleArrow = true) {
6
- const instance = getCurrentInstance()
7
- const popStyle = ref<CSSProperties>()
8
- const arrowStyle = ref<string>('')
9
- const showStyle = ref<string>('')
10
- const arrowClass = ref<string>('')
11
- const popWidth = ref<number>(0)
12
- const popHeight = ref<number>(0)
13
- const left = ref<number>(0)
14
- const bottom = ref<number>(0)
15
- const width = ref<number>(0)
16
- const height = ref<number>(0)
17
- const top = ref<number>(0)
18
-
19
- function noop() {}
20
-
21
- function init(placement: IPlacementVo, visibleArrow: boolean, selector: string) {
22
- // 初始化 class
23
- if (visibleArrow) {
24
- const arrowClassArr = [
25
- `hy-${selector}__arrow`,
26
- placement === 'bottom' || placement === 'bottom-start' || placement === 'bottom-end'
27
- ? `hy-${selector}__arrow-up`
28
- : '',
29
- placement === 'left' || placement === 'left-start' || placement === 'left-end'
30
- ? `hy-${selector}__arrow-right`
31
- : '',
32
- placement === 'right' || placement === 'right-start' || placement === 'right-end'
33
- ? `hy-${selector}__arrow-left`
34
- : '',
35
- placement === 'top' || placement === 'top-start' || placement === 'top-end'
36
- ? `hy-${selector}__arrow-down`
37
- : '',
38
- ]
39
- arrowClass.value = arrowClassArr.join(' ')
40
- }
41
-
42
- // 初始化数据获取
43
- getRect('#target', false, instance).then((rect) => {
44
- if (!rect) return
45
- left.value = rect.left as number
46
- bottom.value = rect.bottom as number
47
- width.value = rect.width as number
48
- height.value = rect.height as number
49
- top.value = rect.top as number
50
- })
51
- // 用透明度可在初始化时获取到pop尺寸
52
- getRect('#pos', false, instance).then((rect) => {
53
- if (!rect) return
54
- popWidth.value = rect.width as number
55
- popHeight.value = rect.height as number
56
- })
57
- }
58
-
59
- function control(placement: IPlacementVo, offset: IOffset) {
60
- // arrow size
61
- const arrowSize = visibleArrow ? 9 : 0
62
- // 上下位(纵轴)对应的距离左边的距离
63
- const verticalX = width.value / 2
64
- // 上下位(纵轴)对应的距离底部的距离
65
- const verticalY = arrowSize + height.value + 5
66
- // 左右位(横轴)对应的距离左边的距离
67
- const horizontalX = width.value + arrowSize + 5
68
- // 左右位(横轴)对应的距离底部的距离
69
- const horizontalY = height.value / 2
70
-
71
- let offsetX = 0
72
- let offsetY = 0
73
- if (Array.isArray(offset)) {
74
- offsetX = (verticalX - 17 > 0 ? 0 : verticalX - 25) + offset[0]
75
- offsetY = (horizontalY - 17 > 0 ? 0 : horizontalY - 25) + (offset[1] ? offset[1] : offset[0])
76
- } else if (isObject(offset)) {
77
- offsetX = (verticalX - 17 > 0 ? 0 : verticalX - 25) + offset.x
78
- offsetY = (horizontalY - 17 > 0 ? 0 : horizontalY - 25) + offset.y
79
- } else {
80
- offsetX = (verticalX - 17 > 0 ? 0 : verticalX - 25) + offset
81
- offsetY = (horizontalY - 17 > 0 ? 0 : horizontalY - 25) + offset
82
- }
83
- // const offsetX = (verticalX - 17 > 0 ? 0 : verticalX - 25) + offset
84
- // const offsetY = (horizontalY - 17 > 0 ? 0 : horizontalY - 25) + offset
85
-
86
- const placements = new Map([
87
- //
88
- [
89
- 'top',
90
- [
91
- {
92
- left: `${verticalX}px`,
93
- bottom: `${verticalY}px`,
94
- transform: 'translateX(-50%)',
95
- },
96
- 'left: 50%;',
97
- ],
98
- ],
99
- [
100
- 'top-start',
101
- [
102
- {
103
- left: `${offsetX}px`,
104
- bottom: `${verticalY}px`,
105
- },
106
- `left: ${(popWidth.value >= width.value ? width.value / 2 : popWidth.value - 25) - offsetX}px;`,
107
- ],
108
- ],
109
- [
110
- 'top-end',
111
- [
112
- {
113
- right: `${offsetX}px`,
114
- bottom: `${verticalY}px`,
115
- },
116
- `right: ${(popWidth.value >= width.value ? width.value / 2 : popWidth.value - 25) - offsetX}px; transform: translateX(50%);`,
117
- ],
118
- ],
119
- //
120
- [
121
- 'bottom',
122
- [
123
- {
124
- left: verticalX + 'px',
125
- top: verticalY + 'px',
126
- transform: 'translateX(-50%)',
127
- },
128
- 'left: 50%;',
129
- ],
130
- ],
131
- [
132
- 'bottom-start',
133
- [
134
- {
135
- left: `${offsetX}px`,
136
- top: `${verticalY}px`,
137
- },
138
- `left: ${(popWidth.value >= width.value ? width.value / 2 : popWidth.value - 25) - offsetX}px;`,
139
- ],
140
- ],
141
- [
142
- 'bottom-end',
143
- [
144
- {
145
- right: `${offsetX}px`,
146
- top: `${verticalY}px`,
147
- },
148
- `right: ${(popWidth.value >= width.value ? width.value / 2 : popWidth.value - 25) - offsetX}px; transform: translateX(50%);`,
149
- ],
150
- ],
151
- //
152
- [
153
- 'left',
154
- [
155
- {
156
- right: `${horizontalX}px`,
157
- top: `${horizontalY}px`,
158
- transform: 'translateY(-50%)',
159
- },
160
- 'top: 50%',
161
- ],
162
- ],
163
- [
164
- 'left-start',
165
- [
166
- {
167
- right: `${horizontalX}px`,
168
- top: `${offsetY}px`,
169
- },
170
- `top: ${(popHeight.value >= height.value ? height.value / 2 : popHeight.value - 20) - offsetY}px;`,
171
- ],
172
- ],
173
- [
174
- 'left-end',
175
- [
176
- {
177
- right: `${horizontalX}px`,
178
- bottom: `${offsetY}px`,
179
- },
180
- `bottom: ${(popHeight.value >= height.value ? height.value / 2 : popHeight.value - 20) - offsetY}px; transform: translateY(50%);`,
181
- ],
182
- ],
183
- //
184
- [
185
- 'right',
186
- [
187
- {
188
- left: `${horizontalX}px`,
189
- top: `${horizontalY}px`,
190
- transform: 'translateY(-50%)',
191
- },
192
- 'top: 50%',
193
- ],
194
- ],
195
- [
196
- 'right-start',
197
- [
198
- {
199
- left: `${horizontalX}px`,
200
- top: `${offsetY}px`,
201
- },
202
- `top: ${(popHeight.value >= height.value ? height.value / 2 : popHeight.value - 20) - offsetY}px;`,
203
- ],
204
- ],
205
- [
206
- 'right-end',
207
- [
208
- {
209
- left: `${horizontalX}px`,
210
- bottom: `${offsetY}px`,
211
- },
212
- `bottom: ${(popHeight.value >= height.value ? height.value / 2 : popHeight.value - 20) - offsetY}px; transform: translateY(50%);`,
213
- ],
214
- ],
215
- ])
216
- popStyle.value = placements.get(placement)![0] as CSSProperties
217
- arrowStyle.value = placements.get(placement)![1] as string
218
- }
219
-
220
- return { popStyle, arrowStyle, showStyle, arrowClass, init, control, noop }
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
+ }
@@ -1,52 +1,53 @@
1
- import { type Ref, provide, ref } from 'vue'
2
-
3
- export const queueKey = '__QUEUE_KEY__'
4
-
5
- export interface Queue {
6
- queue: Ref<any[]>
7
- pushToQueue: (comp: any) => void
8
- removeFromQueue: (comp: any) => void
9
- closeOther: (comp: any) => void
10
- closeOutside: () => void
11
- }
12
-
13
- export function useQueue() {
14
- const queue = ref<any[]>([])
15
-
16
- function pushToQueue(comp: any) {
17
- queue.value.push(comp)
18
- }
19
-
20
- function removeFromQueue(comp: any) {
21
- queue.value = queue.value.filter((item) => {
22
- return item.$.uid !== comp.$.uid
23
- })
24
- }
25
-
26
- function closeOther(comp: any) {
27
- queue.value.forEach((item) => {
28
- if (item.$.uid !== comp.$.uid) {
29
- item.$.exposed.close()
30
- }
31
- })
32
- }
33
-
34
- function closeOutside() {
35
- queue.value.forEach((item) => {
36
- item.$.exposed.close()
37
- })
38
- }
39
-
40
- provide(queueKey, {
41
- queue,
42
- pushToQueue,
43
- removeFromQueue,
44
- closeOther,
45
- closeOutside
46
- })
47
-
48
- return {
49
- closeOther,
50
- closeOutside
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hy-app",
3
- "version": "0.3.0",
4
- "description": "添加分离式表单组件",
3
+ "version": "0.3.2",
4
+ "description": "修复上传提示功能",
5
5
  "main": "./index.ts",
6
6
  "private": false,
7
7
  "scripts": {},
package/store/index.ts CHANGED
@@ -1 +1,9 @@
1
- export * from "./userInfo";
1
+ import { createPinia } from "pinia";
2
+ import { createUnistorage } from "pinia-plugin-unistorage"; // 数据持久化
3
+
4
+ const store = createPinia();
5
+ store.use(createUnistorage());
6
+
7
+ export default store;
8
+
9
+ export * from "./userInfo";
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, #646566) !default; // 弹窗背景色
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, #F5F5F5); // 禁用背景色
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.1)) !default; // 点击状态
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, #131313); // 选中背景色
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 rgba(0, 0, 0, 0.02)) !default;
91
+ $hy-border-line: var(--hy-border-line, 1rpx solid #e8e8e8) !default;
package/typing/index.ts CHANGED
@@ -3,4 +3,3 @@ export * from "./modules/dialog";
3
3
  export * from "./modules/http";
4
4
  export * from "./modules/enum";
5
5
  export * from "./modules/rect";
6
- // export * from "./modules/common";
@@ -1,5 +1,3 @@
1
- import type { IFieldNames } from "@/package/components/hy-check-button/typing";
2
-
3
1
  declare namespace HyApp {
4
2
  /**
5
3
  * @description dark:暗色、light:亮色