@mptw/skylens-ui 1.1.1 → 1.2.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/app.vue +1 -0
- package/components/SLPillLabel.vue +4 -0
- package/components/SLSelect.vue +6 -1
- package/package.json +2 -2
- package/utils/index.ts +26 -0
package/app.vue
CHANGED
|
@@ -36,6 +36,7 @@ export default defineComponent({
|
|
|
36
36
|
"blue-1",
|
|
37
37
|
"blue-2",
|
|
38
38
|
"white",
|
|
39
|
+
"secondary-new",
|
|
39
40
|
].includes(value),
|
|
40
41
|
},
|
|
41
42
|
},
|
|
@@ -96,6 +97,9 @@ export default defineComponent({
|
|
|
96
97
|
&.pill-label-blue-2
|
|
97
98
|
@apply bg-blue-2 border-blue-2
|
|
98
99
|
|
|
100
|
+
&.pill-label-secondary-new
|
|
101
|
+
@apply bg-secondary-new border-secondary-new
|
|
102
|
+
|
|
99
103
|
.icon
|
|
100
104
|
@apply inline-block ml-2
|
|
101
105
|
</style>
|
package/components/SLSelect.vue
CHANGED
|
@@ -224,7 +224,12 @@ export default defineComponent({
|
|
|
224
224
|
function subscribeClick() {
|
|
225
225
|
clickSubscriber = fromEvent(window, "click").subscribe((e) => {
|
|
226
226
|
const { target } = e;
|
|
227
|
-
if (
|
|
227
|
+
if (
|
|
228
|
+
select.value &&
|
|
229
|
+
!select.value.contains(target as HTMLElement) &&
|
|
230
|
+
optionList.value &&
|
|
231
|
+
!optionList.value.contains(target as HTMLElement)
|
|
232
|
+
) {
|
|
228
233
|
hide();
|
|
229
234
|
}
|
|
230
235
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mptw/skylens-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "nuxi dev .playground",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/commonmark": "^0.27.9",
|
|
29
29
|
"@types/dompurify": "^3.0.5",
|
|
30
30
|
"@types/google.maps": "^3.55.7",
|
|
31
|
-
"@types/lodash": "^4.17.
|
|
31
|
+
"@types/lodash-es": "^4.17.12",
|
|
32
32
|
"@types/sortablejs": "^1.15.8",
|
|
33
33
|
"@vue/language-plugin-pug": "^2.0.13",
|
|
34
34
|
"commonmark": "^0.31.0",
|
package/utils/index.ts
CHANGED
|
@@ -537,3 +537,29 @@ export const isValidDate = (d: any) => {
|
|
|
537
537
|
return false;
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
+
|
|
541
|
+
export const waitForTime = (ms: number) => {
|
|
542
|
+
return new Promise(r => setTimeout(r, ms));
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export const waitForever = () => {
|
|
546
|
+
return new Promise(r => {});
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export const waitFor = async (condition: () => boolean, pollInterval = 50, timeoutAfter: number) => {
|
|
550
|
+
const startTime = Date.now();
|
|
551
|
+
|
|
552
|
+
while(true) {
|
|
553
|
+
if (typeof(timeoutAfter) === 'number' && Date.now() > startTime + timeoutAfter) {
|
|
554
|
+
throw 'Condition not met before timeout';
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
const result = await condition();
|
|
558
|
+
|
|
559
|
+
if (result) {
|
|
560
|
+
return result;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
await new Promise(r => setTimeout(r, pollInterval));
|
|
564
|
+
}
|
|
565
|
+
}
|