vueless 0.0.67 → 0.0.68
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/index.js +11 -2
- package/package.json +1 -1
- package/ui.loader-rendering/composables/useLoaderRendering.js +10 -2
- package/ui.loader-rendering/index.stories.js +1 -1
- package/ui.loader-rendering/index.vue +3 -4
- package/ui.loader-top/Docs.mdx +2 -2
- package/ui.loader-top/composables/useLoaderTop.js +10 -2
- package/ui.loader-top/index.stories.js +1 -1
- package/ui.loader-top/index.vue +1 -1
- package/web-types.json +1 -1
package/index.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { createLocale, LocaleSymbol } from "./composable.locale";
|
|
2
|
+
import {
|
|
3
|
+
createLoaderRendering,
|
|
4
|
+
LoaderRenderingSymbol,
|
|
5
|
+
} from "./ui.loader-rendering/composables/useLoaderRendering";
|
|
6
|
+
import { createLoaderTop, LoaderTopSymbol } from "./ui.loader-top/composables/useLoaderTop";
|
|
2
7
|
|
|
3
8
|
export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n";
|
|
4
9
|
export { default as defaultEnLocale } from "./adatper.locale/locales/en";
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
10
|
+
export { useLoaderRendering } from "./ui.loader-rendering/composables/useLoaderRendering";
|
|
11
|
+
export { useLoaderTop } from "./ui.loader-top/composables/useLoaderTop";
|
|
7
12
|
export { useLocale } from "./composable.locale";
|
|
8
13
|
export {
|
|
9
14
|
notify,
|
|
@@ -17,9 +22,13 @@ export {
|
|
|
17
22
|
|
|
18
23
|
export function createVueless(options = {}) {
|
|
19
24
|
const i18n = createLocale(options.i18n);
|
|
25
|
+
const loaderRenderingState = createLoaderRendering();
|
|
26
|
+
const loaderTopState = createLoaderTop();
|
|
20
27
|
|
|
21
28
|
const install = (app) => {
|
|
22
29
|
app.provide(LocaleSymbol, i18n);
|
|
30
|
+
app.provide(LoaderRenderingSymbol, loaderRenderingState);
|
|
31
|
+
app.provide(LoaderTopSymbol, loaderTopState);
|
|
23
32
|
};
|
|
24
33
|
|
|
25
34
|
return {
|
package/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { readonly, ref } from "vue";
|
|
1
|
+
import { readonly, ref, inject } from "vue";
|
|
2
|
+
|
|
3
|
+
export const LoaderRenderingSymbol = Symbol.for("vueless:loader-rendering");
|
|
2
4
|
|
|
3
5
|
const isRenderingPage = ref(true);
|
|
4
6
|
|
|
@@ -10,10 +12,16 @@ function setRenderingFinished() {
|
|
|
10
12
|
isRenderingPage.value = false;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
export
|
|
15
|
+
export function createLoaderRendering() {
|
|
14
16
|
return {
|
|
15
17
|
isRenderingPage: readonly(isRenderingPage),
|
|
16
18
|
setRenderingStarted,
|
|
17
19
|
setRenderingFinished,
|
|
18
20
|
};
|
|
19
21
|
}
|
|
22
|
+
|
|
23
|
+
export function useLoaderRendering() {
|
|
24
|
+
const loaderRenderingState = inject(LoaderRenderingSymbol);
|
|
25
|
+
|
|
26
|
+
return loaderRenderingState;
|
|
27
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ULoaderRendering from "../ui.loader-rendering";
|
|
2
2
|
import UButton from "../ui.button";
|
|
3
3
|
|
|
4
|
-
import useLoaderRendering from "./composables/useLoaderRendering";
|
|
4
|
+
import { useLoaderRendering } from "./composables/useLoaderRendering";
|
|
5
5
|
|
|
6
6
|
import { getArgTypes } from "../service.storybook";
|
|
7
7
|
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
import { computed } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useAttrs } from "./composables/attrs.composable";
|
|
16
|
-
|
|
17
|
-
// import useLoaderRendering from "./composables/useLoaderRendering";
|
|
16
|
+
import { useLoaderRendering } from "./composables/useLoaderRendering";
|
|
18
17
|
|
|
19
18
|
/* Should be a string for correct web-types gen */
|
|
20
19
|
defineOptions({ name: "ULoaderRendering", inheritAttrs: false });
|
|
@@ -27,10 +26,10 @@ const props = defineProps({
|
|
|
27
26
|
});
|
|
28
27
|
|
|
29
28
|
const { wrapperAttrs, loaderAttrs, rippleAttrs, rippleElementAttrs, config } = useAttrs(props);
|
|
30
|
-
|
|
29
|
+
const { isRenderingPage } = useLoaderRendering();
|
|
31
30
|
|
|
32
31
|
const showLoader = computed(() => {
|
|
33
|
-
return props.loading
|
|
32
|
+
return props.loading || isRenderingPage.value;
|
|
34
33
|
});
|
|
35
34
|
</script>
|
|
36
35
|
|
package/ui.loader-top/Docs.mdx
CHANGED
|
@@ -19,7 +19,7 @@ import defaultConfig from "./configs/default.config?raw"
|
|
|
19
19
|
You can control loader state using *useLoaderRendering* composable.
|
|
20
20
|
|
|
21
21
|
<Source code={`
|
|
22
|
-
import {
|
|
22
|
+
import { useLoaderTop } from "vueless";
|
|
23
23
|
|
|
24
24
|
const {
|
|
25
25
|
setLoadingOn,
|
|
@@ -28,5 +28,5 @@ const {
|
|
|
28
28
|
removeRequestUrl,
|
|
29
29
|
setComponentRequestQueue,
|
|
30
30
|
removeComponentRequestQueue,
|
|
31
|
-
} =
|
|
31
|
+
} = useLoaderTop();
|
|
32
32
|
`} language="jsx" dark />
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ref, readonly } from "vue";
|
|
1
|
+
import { ref, readonly, inject } from "vue";
|
|
2
|
+
|
|
3
|
+
export const LoaderTopSymbol = Symbol.for("vueless:loader-top");
|
|
2
4
|
|
|
3
5
|
const isLoading = ref(true);
|
|
4
6
|
const requestQueue = ref([]);
|
|
@@ -40,7 +42,7 @@ function removeComponentRequestQueue() {
|
|
|
40
42
|
componentLoaderRequestQueue.value = [];
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
export
|
|
45
|
+
export function createLoaderTop() {
|
|
44
46
|
return {
|
|
45
47
|
isLoading: readonly(isLoading),
|
|
46
48
|
requestQueue: readonly(requestQueue),
|
|
@@ -55,3 +57,9 @@ export default function useLoaderTop() {
|
|
|
55
57
|
removeComponentRequestQueue,
|
|
56
58
|
};
|
|
57
59
|
}
|
|
60
|
+
|
|
61
|
+
export function useLoaderTop() {
|
|
62
|
+
const loaderTopState = inject(LoaderTopSymbol);
|
|
63
|
+
|
|
64
|
+
return loaderTopState;
|
|
65
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ULoaderTop from "../ui.loader-top";
|
|
2
2
|
import UButton from "../ui.button";
|
|
3
3
|
|
|
4
|
-
import useLoaderTop from "../ui.loader-top/composables/useLoaderTop";
|
|
4
|
+
import { useLoaderTop } from "../ui.loader-top/composables/useLoaderTop";
|
|
5
5
|
|
|
6
6
|
import { getArgTypes } from "../service.storybook";
|
|
7
7
|
|
package/ui.loader-top/index.vue
CHANGED
|
@@ -9,7 +9,7 @@ import { computed, onBeforeUnmount, watch, ref } from "vue";
|
|
|
9
9
|
|
|
10
10
|
import UIService, { isMobileApp } from "../service.ui";
|
|
11
11
|
import { clamp, queue } from "./services/loaderTop.service";
|
|
12
|
-
import useLoaderTop from "./composables/useLoaderTop";
|
|
12
|
+
import { useLoaderTop } from "./composables/useLoaderTop";
|
|
13
13
|
|
|
14
14
|
import { ULoaderTop, MAXIMUM, SPEED } from "./constants";
|
|
15
15
|
import defaultConfig from "./configs/default.config";
|