vueless 0.0.55 → 0.0.57
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/directive.tooltip/index.js +13 -4
- package/index.js +2 -0
- package/package.json +1 -1
- package/ui.button/index.vue +1 -1
- package/ui.data-table/index.vue +1 -1
- package/ui.image-icon/index.vue +2 -0
- package/{ui.other-loader → ui.loader}/index.stories.js +4 -4
- package/ui.loader-rendering/Docs.mdx +21 -0
- package/ui.loader-rendering/index.stories.js +55 -0
- package/ui.loader-rendering/index.vue +1 -1
- package/ui.loader-top/Docs.mdx +32 -0
- package/{ui.other-loader-top → ui.loader-top}/composables/useLoaderTop.js +2 -2
- package/ui.loader-top/index.stories.js +69 -0
- package/{ui.other-loader-top → ui.loader-top}/index.vue +0 -9
- package/ui.notify/configs/default.config.js +9 -3
- package/ui.notify/index.vue +1 -1
- package/web-types.json +3 -12
- /package/{ui.other-loader → ui.loader}/composables/attrs.composable.js +0 -0
- /package/{ui.other-loader → ui.loader}/configs/default.config.js +0 -0
- /package/{ui.other-loader → ui.loader}/constants/index.js +0 -0
- /package/{ui.other-loader → ui.loader}/index.vue +0 -0
- /package/{ui.other-loader-top → ui.loader-top}/composables/attrs.composable.js +0 -0
- /package/{ui.other-loader-top → ui.loader-top}/configs/default.config.js +0 -0
- /package/{ui.other-loader-top → ui.loader-top}/constants/index.js +0 -0
- /package/{ui.other-loader-top → ui.loader-top}/services/loaderTop.service.js +0 -0
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import tippy from "tippy.js";
|
|
2
|
+
import merge from "lodash.merge";
|
|
2
3
|
|
|
3
|
-
import vuelessConfig from "
|
|
4
|
+
import vuelessConfig from "../../../vueless.config.js";
|
|
4
5
|
|
|
5
6
|
import "tippy.js/dist/tippy.css";
|
|
6
7
|
import "tippy.js/themes/light.css";
|
|
7
8
|
import "tippy.js/animations/shift-away.css";
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
const globalSettings = vuelessConfig?.directive?.tooltip || {};
|
|
11
|
+
const defaultSettings = {
|
|
12
|
+
arrow: true,
|
|
13
|
+
theme: "light",
|
|
14
|
+
animation: "shift-away",
|
|
15
|
+
};
|
|
16
|
+
const mergedSettings = merge(defaultSettings, globalSettings);
|
|
17
|
+
|
|
18
|
+
tippy.setDefaultProps(mergedSettings);
|
|
10
19
|
|
|
11
20
|
export default {
|
|
12
21
|
mounted(el, bindings) {
|
|
13
|
-
tippy(el, bindings.value);
|
|
22
|
+
tippy(el, merge(mergedSettings, bindings.value || {}));
|
|
14
23
|
},
|
|
15
24
|
updated(el, bindings) {
|
|
16
25
|
if (!el._tippy) return;
|
|
17
26
|
|
|
18
|
-
el._tippy.setProps(bindings);
|
|
27
|
+
el._tippy.setProps(merge(mergedSettings, bindings.value || {}));
|
|
19
28
|
},
|
|
20
29
|
unmounted(el) {
|
|
21
30
|
if (!el._tippy) return;
|
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
package/ui.button/index.vue
CHANGED
|
@@ -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.
|
|
29
|
+
import ULoader from "../ui.loader";
|
|
30
30
|
|
|
31
31
|
import defaultConfig from "./configs/default.config";
|
|
32
32
|
import { useAttrs } from "./composables/attrs.composable";
|
package/ui.data-table/index.vue
CHANGED
|
@@ -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.
|
|
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";
|
package/ui.image-icon/index.vue
CHANGED
|
@@ -21,6 +21,8 @@ import { UIcon } from "./constants";
|
|
|
21
21
|
import defaultConfig from "./configs/default.config";
|
|
22
22
|
import { useAttrs } from "./composables/attrs.composable";
|
|
23
23
|
|
|
24
|
+
import vTooltip from "../directive.tooltip";
|
|
25
|
+
|
|
24
26
|
/* Should be a string for correct web-types gen */
|
|
25
27
|
defineOptions({
|
|
26
28
|
name: "UIcon",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import ULoader from "../ui.
|
|
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: "
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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"
|
|
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(
|
|
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
|
|
@@ -31,9 +31,15 @@ export default /*tw*/ {
|
|
|
31
31
|
long: 12000,
|
|
32
32
|
},
|
|
33
33
|
i18n: {
|
|
34
|
-
success:
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
success: {
|
|
35
|
+
default: "Operation successful.",
|
|
36
|
+
},
|
|
37
|
+
warning: {
|
|
38
|
+
default: "Operation warning.",
|
|
39
|
+
},
|
|
40
|
+
error: {
|
|
41
|
+
default: "Operation error.",
|
|
42
|
+
},
|
|
37
43
|
},
|
|
38
44
|
positionClasses: {
|
|
39
45
|
page: "UNotifyPage",
|
package/ui.notify/index.vue
CHANGED
|
@@ -211,7 +211,7 @@ function setPosition() {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
function getText(notificationText, type) {
|
|
214
|
-
return notificationText || currentLocale.value[type];
|
|
214
|
+
return notificationText || currentLocale.value[type]?.default;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
function getNotificationClasses(notification) {
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.57",
|
|
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.
|
|
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.
|
|
4457
|
+
"module": "vueless/ui.loader-top/index.vue",
|
|
4467
4458
|
"symbol": "default"
|
|
4468
4459
|
}
|
|
4469
4460
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|