vueless 0.0.55 → 0.0.56

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
@@ -2,6 +2,8 @@ import { createLocale, LocaleSymbol } from "./composable.locale";
2
2
 
3
3
  export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n";
4
4
  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";
5
7
  export { useLocale } from "./composable.locale";
6
8
  export {
7
9
  notify,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -26,7 +26,7 @@
26
26
  import { ref } from "vue";
27
27
 
28
28
  import UIService, { getRandomId } from "../service.ui";
29
- import ULoader from "../ui.other-loader";
29
+ import ULoader from "../ui.loader";
30
30
 
31
31
  import defaultConfig from "./configs/default.config";
32
32
  import { useAttrs } from "./composables/attrs.composable";
@@ -278,7 +278,7 @@ import UIcon from "../ui.image-icon";
278
278
  import UEmpty from "../ui.text-empty";
279
279
  import UDivider from "../ui.container-divider";
280
280
  import UCheckbox from "../ui.form-checkbox";
281
- import ULoaderTop from "../ui.other-loader-top";
281
+ import ULoaderTop from "../ui.loader-top";
282
282
  import UTableCell from "../ui.data-table-cell";
283
283
 
284
284
  import UIService from "../service.ui";
@@ -1,11 +1,11 @@
1
- import ULoader from "../ui.other-loader";
1
+ import ULoader from "../ui.loader";
2
2
  import URow from "../ui.container-row";
3
3
 
4
4
  import { getArgTypes } from "../service.storybook";
5
5
 
6
6
  export default {
7
7
  id: "9020",
8
- title: "Other / Loader",
8
+ title: "Loaders and Skeletons / Loader",
9
9
  component: ULoader,
10
10
  argTypes: {
11
11
  ...getArgTypes(ULoader.name),
@@ -31,14 +31,14 @@ const ColorsTemplate = (args, { argTypes } = {}) => ({
31
31
  };
32
32
  },
33
33
  template: `
34
- <URow>
34
+ <div class="flex gap-4 flex-wrap">
35
35
  <ULoader
36
36
  v-for="(color, index) in colors"
37
37
  :color="color"
38
38
  v-bind="args"
39
39
  :key="index"
40
40
  />
41
- </URow>
41
+ </div>
42
42
  `,
43
43
  });
44
44
 
@@ -0,0 +1,21 @@
1
+ import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source, Markdown } from "@storybook/blocks";
2
+ import { getSource } from "../service.storybook";
3
+
4
+ import * as stories from "./index.stories";
5
+
6
+ <Meta of={stories} />
7
+ <Title of={stories} />
8
+ <Subtitle of={stories} />
9
+ <Description of={stories} />
10
+ <Primary of={stories} />
11
+ <Controls of={stories.Default} />
12
+ <Stories of={stories} />
13
+
14
+ ## Control loader
15
+ You can control loader state using *useLoaderRendering* composable.
16
+
17
+ <Source code={`
18
+ import { useLoaderRendering } from "vueless";
19
+
20
+ const { setRenderingFinished, isRenderingPage, setRenderingStarted } = useLoaderRendering();
21
+ `} language="jsx" dark />
@@ -0,0 +1,55 @@
1
+ import ULoaderRendering from "../ui.loader-rendering";
2
+ import UButton from "../ui.button";
3
+
4
+ import useLoaderRendering from "./composables/useLoaderRendering";
5
+
6
+ import { getArgTypes } from "../service.storybook";
7
+
8
+ export default {
9
+ id: "9023",
10
+ title: "Loaders and Skeletons / Loader rendering",
11
+ component: ULoaderRendering,
12
+ argTypes: {
13
+ ...getArgTypes(ULoaderRendering.name),
14
+ },
15
+ };
16
+
17
+ const DefaultTemplate = (args) => ({
18
+ components: { ULoaderRendering },
19
+ setup() {
20
+ return { args };
21
+ },
22
+ template: `
23
+ <div>
24
+ <ULoaderRendering v-bind="args" class="!static !w-full" />
25
+ </div>
26
+ `,
27
+ });
28
+
29
+ const LoadingTemplate = (args) => ({
30
+ components: { ULoaderRendering, UButton },
31
+ setup() {
32
+ const { setRenderingFinished, isRenderingPage, setRenderingStarted } = useLoaderRendering();
33
+
34
+ return { args, setRenderingFinished, setRenderingStarted, isRenderingPage };
35
+ },
36
+ methods: {
37
+ toggleLoading() {
38
+ this.isRenderingPage ? this.setRenderingFinished() : this.setRenderingStarted();
39
+ },
40
+ },
41
+ template: `
42
+ <div class="flex justify-center items-center pb-4">
43
+ <UButton label="Toggle loading" @click="toggleLoading"/>
44
+ </div>
45
+ <div>
46
+ <ULoaderRendering v-bind="args" class="!static !w-full" />
47
+ </div>
48
+ `,
49
+ });
50
+
51
+ export const Default = DefaultTemplate.bind({});
52
+ Default.args = {};
53
+
54
+ export const LoadingOff = LoadingTemplate.bind({});
55
+ LoadingOff.args = { loading: false };
@@ -15,7 +15,7 @@ import { computed } from "vue";
15
15
  import useLoaderRendering from "./composables/useLoaderRendering";
16
16
 
17
17
  /* Should be a string for correct web-types gen */
18
- defineOptions({ name: "ULoaderRendering", inheritAttrs: false });
18
+ defineOptions({ name: "ULoaderRendering" });
19
19
 
20
20
  const props = defineProps({
21
21
  loading: {
@@ -0,0 +1,32 @@
1
+ import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source, Markdown } from "@storybook/blocks";
2
+ import { getSource } from "../service.storybook";
3
+
4
+ import * as stories from "./index.stories";
5
+ import defaultConfig from "./configs/default.config?raw"
6
+
7
+ <Meta of={stories} />
8
+ <Title of={stories} />
9
+ <Subtitle of={stories} />
10
+ <Description of={stories} />
11
+ <Primary of={stories} />
12
+ <Controls of={stories.Default} />
13
+ <Stories of={stories} />
14
+
15
+ ## **Default config**
16
+ <Source code={getSource(defaultConfig)} language="jsx" dark />
17
+
18
+ ## Control loader
19
+ You can control loader state using *useLoaderRendering* composable.
20
+
21
+ <Source code={`
22
+ import { useLoaderRendeuseLoaderTopring } from "vueless";
23
+
24
+ const {
25
+ setLoadingOn,
26
+ setLoadingOff,
27
+ addRequestUrl,
28
+ removeRequestUrl,
29
+ setComponentRequestQueue,
30
+ removeComponentRequestQueue,
31
+ } = useLoaderRendering();
32
+ `} language="jsx" dark />
@@ -1,6 +1,6 @@
1
1
  import { ref, readonly } from "vue";
2
2
 
3
- const isLoading = ref(false);
3
+ const isLoading = ref(true);
4
4
  const requestQueue = ref([]);
5
5
  const loaderRequestQueue = ref([]);
6
6
  const loaderRequestTimeout = ref(0);
@@ -33,7 +33,7 @@ function removeRequestUrl(url) {
33
33
  }
34
34
 
35
35
  function setComponentRequestQueue(requests) {
36
- componentLoaderRequestQueue.value = [...componentLoaderRequestQueue, ...requests];
36
+ componentLoaderRequestQueue.value = [...componentLoaderRequestQueue.value, ...requests];
37
37
  }
38
38
 
39
39
  function removeComponentRequestQueue() {
@@ -0,0 +1,69 @@
1
+ import ULoaderTop from "../ui.loader-top";
2
+ import UButton from "../ui.button";
3
+
4
+ import useLoaderTop from "../ui.loader-top/composables/useLoaderTop";
5
+
6
+ import { getArgTypes } from "../service.storybook";
7
+
8
+ export default {
9
+ id: "9024",
10
+ title: "Loaders and Skeletons / Loader top",
11
+ component: ULoaderTop,
12
+ argTypes: {
13
+ ...getArgTypes(ULoaderTop.name),
14
+ },
15
+ };
16
+
17
+ const DefaultTemplate = (args) => ({
18
+ components: { ULoaderTop, UButton },
19
+ setup() {
20
+ const { setLoadingOn, setLoadingOff } = useLoaderTop();
21
+
22
+ return { args, setLoadingOn, setLoadingOff };
23
+ },
24
+ template: `
25
+ <div>
26
+ <ULoaderTop color="blue" v-bind="args" resource-names="https://api.publicapis.org/entries"/>
27
+
28
+ <div class="flex gap-2">
29
+ <UButton label="On" @click="setLoadingOn('https://api.publicapis.org/entries')" />
30
+ <UButton label="Off" @click="setLoadingOff('https://api.publicapis.org/entries')" />
31
+ </div>
32
+ </div>
33
+ `,
34
+ });
35
+
36
+ const ColorsTemplate = (args, { argTypes } = {}) => ({
37
+ components: { ULoaderTop, UButton },
38
+ setup() {
39
+ const { setLoadingOn, setLoadingOff } = useLoaderTop();
40
+
41
+ return {
42
+ args,
43
+ setLoadingOn,
44
+ setLoadingOff,
45
+ colors: argTypes.color.options,
46
+ };
47
+ },
48
+ template: `
49
+ <div class="flex gap-4 flex-col">
50
+ <ULoaderTop
51
+ class="static"
52
+ v-for="(color, index) in colors"
53
+ :color="color"
54
+ v-bind="args"
55
+ :key="index"
56
+ />
57
+ </div>
58
+ <div class="flex gap-2 pt-4">
59
+ <UButton label="On" @click="setLoadingOn('https://api.publicapis.org/entries')" />
60
+ <UButton label="Off" @click="setLoadingOff('https://api.publicapis.org/entries')" />
61
+ </div>
62
+ `,
63
+ });
64
+
65
+ export const Default = DefaultTemplate.bind({});
66
+ Default.args = {};
67
+
68
+ export const Color = ColorsTemplate.bind({});
69
+ Color.args = {};
@@ -27,15 +27,6 @@ const props = defineProps({
27
27
  default: "",
28
28
  },
29
29
 
30
- /**
31
- * Loader position.
32
- * @values fixed, absolute, relative
33
- */
34
- position: {
35
- type: String,
36
- default: UIService.get(defaultConfig, ULoaderTop).default.position,
37
- },
38
-
39
30
  /**
40
31
  * The color of the loader stripe.
41
32
  * @values gray, red, orange, yellow, green, blue, violet, fuchsia
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.55",
4
+ "version": "0.0.56",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -4408,7 +4408,7 @@
4408
4408
  }
4409
4409
  ],
4410
4410
  "source": {
4411
- "module": "vueless/ui.other-loader/index.vue",
4411
+ "module": "vueless/ui.loader/index.vue",
4412
4412
  "symbol": "default"
4413
4413
  }
4414
4414
  },
@@ -4443,15 +4443,6 @@
4443
4443
  },
4444
4444
  "default": "\"\""
4445
4445
  },
4446
- {
4447
- "name": "position",
4448
- "description": "Loader position.",
4449
- "value": {
4450
- "kind": "expression",
4451
- "type": "'fixed' | 'absolute' | 'relative'"
4452
- },
4453
- "default": "fixed"
4454
- },
4455
4446
  {
4456
4447
  "name": "color",
4457
4448
  "description": "The color of the loader stripe.",
@@ -4463,7 +4454,7 @@
4463
4454
  }
4464
4455
  ],
4465
4456
  "source": {
4466
- "module": "vueless/ui.other-loader-top/index.vue",
4457
+ "module": "vueless/ui.loader-top/index.vue",
4467
4458
  "symbol": "default"
4468
4459
  }
4469
4460
  },
File without changes