vueless 0.0.67 → 0.0.69

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 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 { default as useLoaderRendering } from "./ui.loader-rendering/composables/useLoaderRendering";
6
- export { default as useLoaderTop } from "./ui.loader-top/composables/useLoaderTop";
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,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.67",
3
+ "version": "0.0.69",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -65,8 +65,10 @@ export default /*tw*/ {
65
65
  color: "brand",
66
66
  type: "link",
67
67
  size: "md",
68
- activeClass: "group/router-link-active",
69
- exactActiveClass: "group/router-link-exact-active",
68
+ activeClass: "",
69
+ exactActiveClass: "",
70
+ wrapperActiveClass: "",
71
+ wrapperExactActiveClass: "",
70
72
  underlined: undefined,
71
73
  block: false,
72
74
  noRing: false,
@@ -126,7 +126,7 @@ const props = defineProps({
126
126
  * Apply classes to the link when its route is active or when it matches any parent route.
127
127
  */
128
128
  activeClass: {
129
- type: Boolean,
129
+ type: String,
130
130
  default: UIService.get(defaultConfig, ULink).default.activeClass,
131
131
  },
132
132
 
@@ -134,7 +134,7 @@ const props = defineProps({
134
134
  * Apply classes to the link when its route is active.
135
135
  */
136
136
  exactActiveClass: {
137
- type: Boolean,
137
+ type: String,
138
138
  default: UIService.get(defaultConfig, ULink).default.exactActiveClass,
139
139
  },
140
140
 
@@ -142,7 +142,7 @@ const props = defineProps({
142
142
  * Apply classes to the wrapper div when link route is active or when it matches any parent route.
143
143
  */
144
144
  wrapperActiveClass: {
145
- type: Boolean,
145
+ type: String,
146
146
  default: UIService.get(defaultConfig, ULink).default.wrapperActiveClass,
147
147
  },
148
148
 
@@ -150,7 +150,7 @@ const props = defineProps({
150
150
  * Apply classes to the wrapper div when link route is active.
151
151
  */
152
152
  wrapperExactActiveClass: {
153
- type: Boolean,
153
+ type: String,
154
154
  default: UIService.get(defaultConfig, ULink).default.wrapperExactActiveClass,
155
155
  },
156
156
 
@@ -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 default function useLoaderRendering() {
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
- // Should be uncommented after fixing composable bug.
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
- // const { isRenderingPage } = useLoaderRendering();
29
+ const { isRenderingPage } = useLoaderRendering();
31
30
 
32
31
  const showLoader = computed(() => {
33
- return props.loading; // || isRenderingPage.value;
32
+ return props.loading || isRenderingPage.value;
34
33
  });
35
34
  </script>
36
35
 
@@ -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 { useLoaderRendeuseLoaderTopring } from "vueless";
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
- } = useLoaderRendering();
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 default function useLoaderTop() {
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
 
@@ -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";
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.67",
4
+ "version": "0.0.69",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -4289,36 +4289,36 @@
4289
4289
  "description": "Apply classes to the link when its route is active or when it matches any parent route.",
4290
4290
  "value": {
4291
4291
  "kind": "expression",
4292
- "type": "boolean"
4292
+ "type": "string"
4293
4293
  },
4294
- "default": "group/router-link-active"
4294
+ "default": ""
4295
4295
  },
4296
4296
  {
4297
4297
  "name": "exactActiveClass",
4298
4298
  "description": "Apply classes to the link when its route is active.",
4299
4299
  "value": {
4300
4300
  "kind": "expression",
4301
- "type": "boolean"
4301
+ "type": "string"
4302
4302
  },
4303
- "default": "group/router-link-exact-active"
4303
+ "default": ""
4304
4304
  },
4305
4305
  {
4306
4306
  "name": "wrapperActiveClass",
4307
4307
  "description": "Apply classes to the wrapper div when link route is active or when it matches any parent route.",
4308
4308
  "value": {
4309
4309
  "kind": "expression",
4310
- "type": "boolean"
4310
+ "type": "string"
4311
4311
  },
4312
- "default": "UIService.get(defaultConfig, ULink).default.wrapperActiveClass"
4312
+ "default": ""
4313
4313
  },
4314
4314
  {
4315
4315
  "name": "wrapperExactActiveClass",
4316
4316
  "description": "Apply classes to the wrapper div when link route is active.",
4317
4317
  "value": {
4318
4318
  "kind": "expression",
4319
- "type": "boolean"
4319
+ "type": "string"
4320
4320
  },
4321
- "default": "UIService.get(defaultConfig, ULink).default.wrapperExactActiveClass"
4321
+ "default": ""
4322
4322
  },
4323
4323
  {
4324
4324
  "name": "underlined",