@naptics/vue-collection 0.0.1
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/README.md +27 -0
- package/lib/components/NAlert.d.ts +72 -0
- package/lib/components/NAlert.jsx +69 -0
- package/lib/components/NBadge.d.ts +174 -0
- package/lib/components/NBadge.jsx +58 -0
- package/lib/components/NBreadcrub.d.ts +161 -0
- package/lib/components/NBreadcrub.jsx +64 -0
- package/lib/components/NButton.d.ts +149 -0
- package/lib/components/NButton.jsx +58 -0
- package/lib/components/NCheckbox.d.ts +51 -0
- package/lib/components/NCheckbox.jsx +38 -0
- package/lib/components/NCheckboxLabel.d.ts +70 -0
- package/lib/components/NCheckboxLabel.jsx +42 -0
- package/lib/components/NCrudModal.d.ts +301 -0
- package/lib/components/NCrudModal.jsx +89 -0
- package/lib/components/NDialog.d.ts +190 -0
- package/lib/components/NDialog.jsx +144 -0
- package/lib/components/NDropdown.d.ts +116 -0
- package/lib/components/NDropdown.jsx +92 -0
- package/lib/components/NDropzone.d.ts +162 -0
- package/lib/components/NDropzone.jsx +211 -0
- package/lib/components/NForm.d.ts +43 -0
- package/lib/components/NForm.jsx +26 -0
- package/lib/components/NFormModal.d.ts +190 -0
- package/lib/components/NFormModal.jsx +48 -0
- package/lib/components/NIconButton.d.ts +202 -0
- package/lib/components/NIconButton.jsx +71 -0
- package/lib/components/NIconCircle.d.ts +135 -0
- package/lib/components/NIconCircle.jsx +67 -0
- package/lib/components/NInput.css +11 -0
- package/lib/components/NInput.d.ts +232 -0
- package/lib/components/NInput.jsx +97 -0
- package/lib/components/NInputPhone.d.ts +150 -0
- package/lib/components/NInputPhone.jsx +31 -0
- package/lib/components/NInputSelect.d.ts +271 -0
- package/lib/components/NInputSelect.jsx +89 -0
- package/lib/components/NInputSuggestion.d.ts +212 -0
- package/lib/components/NInputSuggestion.jsx +48 -0
- package/lib/components/NLink.d.ts +111 -0
- package/lib/components/NLink.jsx +58 -0
- package/lib/components/NList.d.ts +43 -0
- package/lib/components/NList.jsx +24 -0
- package/lib/components/NLoadingIndicator.css +46 -0
- package/lib/components/NLoadingIndicator.d.ts +77 -0
- package/lib/components/NLoadingIndicator.jsx +42 -0
- package/lib/components/NModal.d.ts +333 -0
- package/lib/components/NModal.jsx +170 -0
- package/lib/components/NPagination.css +15 -0
- package/lib/components/NPagination.d.ts +99 -0
- package/lib/components/NPagination.jsx +104 -0
- package/lib/components/NSearchbar.d.ts +94 -0
- package/lib/components/NSearchbar.jsx +58 -0
- package/lib/components/NSearchbarList.d.ts +90 -0
- package/lib/components/NSearchbarList.jsx +20 -0
- package/lib/components/NSelect.d.ts +159 -0
- package/lib/components/NSelect.jsx +81 -0
- package/lib/components/NSuggestionList.d.ts +275 -0
- package/lib/components/NSuggestionList.jsx +157 -0
- package/lib/components/NTable.css +3 -0
- package/lib/components/NTable.d.ts +187 -0
- package/lib/components/NTable.jsx +146 -0
- package/lib/components/NTableAction.d.ts +74 -0
- package/lib/components/NTableAction.jsx +35 -0
- package/lib/components/NTextArea.d.ts +252 -0
- package/lib/components/NTextArea.jsx +108 -0
- package/lib/components/NTooltip.css +37 -0
- package/lib/components/NTooltip.d.ts +186 -0
- package/lib/components/NTooltip.jsx +161 -0
- package/lib/components/NValInput.d.ts +297 -0
- package/lib/components/NValInput.jsx +101 -0
- package/lib/components/ValidatedForm.d.ts +34 -0
- package/lib/components/ValidatedForm.js +25 -0
- package/lib/i18n/de/template.json +10 -0
- package/lib/i18n/de/vue-collection.json +58 -0
- package/lib/i18n/de.d.ts +61 -0
- package/lib/i18n/de.js +5 -0
- package/lib/i18n/en/template.json +10 -0
- package/lib/i18n/en/vue-collection.json +58 -0
- package/lib/i18n/en.d.ts +61 -0
- package/lib/i18n/en.js +5 -0
- package/lib/i18n/index.d.ts +17 -0
- package/lib/i18n/index.js +34 -0
- package/lib/index.d.ts +64 -0
- package/lib/index.js +65 -0
- package/lib/utils/breakpoints.d.ts +15 -0
- package/lib/utils/breakpoints.js +37 -0
- package/lib/utils/component.d.ts +50 -0
- package/lib/utils/component.js +51 -0
- package/lib/utils/deferred.d.ts +13 -0
- package/lib/utils/deferred.js +17 -0
- package/lib/utils/identifiable.d.ts +57 -0
- package/lib/utils/identifiable.js +78 -0
- package/lib/utils/stringMaxLength.d.ts +14 -0
- package/lib/utils/stringMaxLength.js +28 -0
- package/lib/utils/tailwind.d.ts +2 -0
- package/lib/utils/tailwind.js +1 -0
- package/lib/utils/utils.d.ts +27 -0
- package/lib/utils/utils.js +26 -0
- package/lib/utils/vModel.d.ts +182 -0
- package/lib/utils/vModel.js +215 -0
- package/lib/utils/validation.d.ts +84 -0
- package/lib/utils/validation.js +163 -0
- package/lib/utils/vue.d.ts +13 -0
- package/lib/utils/vue.js +19 -0
- package/package.json +56 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { TWTextSize } from '../utils/tailwind';
|
|
2
|
+
import { type PropType } from 'vue';
|
|
3
|
+
import { type RouteLocationRaw } from 'vue-router';
|
|
4
|
+
export declare const nLinkProps: {
|
|
5
|
+
/**
|
|
6
|
+
* The text of the link. Can also be set in the default slot.
|
|
7
|
+
*/
|
|
8
|
+
text: StringConstructor;
|
|
9
|
+
/**
|
|
10
|
+
* The route of the link. If this is set,
|
|
11
|
+
* the link becomes a {@link RouterLink} and does not emit the `onClick` event.
|
|
12
|
+
*/
|
|
13
|
+
route: PropType<RouteLocationRaw>;
|
|
14
|
+
/**
|
|
15
|
+
* The color of the link.
|
|
16
|
+
*/
|
|
17
|
+
color: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The text size, a standard tailwind text-size class.
|
|
23
|
+
*/
|
|
24
|
+
textSize: PropType<TWTextSize>;
|
|
25
|
+
/**
|
|
26
|
+
* The shade of the link.
|
|
27
|
+
*/
|
|
28
|
+
shade: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* This is called when the link is clicked but only, if the `route` prop is not set.
|
|
34
|
+
* If the `route` prop is not set, the link will act as a regular button.
|
|
35
|
+
*/
|
|
36
|
+
onClick: PropType<() => void>;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The `NLink` is a styled text which can be used as a {@link RouterLink} or a regular button.
|
|
40
|
+
*/
|
|
41
|
+
declare const _default: import("vue").DefineComponent<{
|
|
42
|
+
/**
|
|
43
|
+
* The text of the link. Can also be set in the default slot.
|
|
44
|
+
*/
|
|
45
|
+
text: StringConstructor;
|
|
46
|
+
/**
|
|
47
|
+
* The route of the link. If this is set,
|
|
48
|
+
* the link becomes a {@link RouterLink} and does not emit the `onClick` event.
|
|
49
|
+
*/
|
|
50
|
+
route: PropType<RouteLocationRaw>;
|
|
51
|
+
/**
|
|
52
|
+
* The color of the link.
|
|
53
|
+
*/
|
|
54
|
+
color: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The text size, a standard tailwind text-size class.
|
|
60
|
+
*/
|
|
61
|
+
textSize: PropType<TWTextSize>;
|
|
62
|
+
/**
|
|
63
|
+
* The shade of the link.
|
|
64
|
+
*/
|
|
65
|
+
shade: {
|
|
66
|
+
type: NumberConstructor;
|
|
67
|
+
default: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* This is called when the link is clicked but only, if the `route` prop is not set.
|
|
71
|
+
* If the `route` prop is not set, the link will act as a regular button.
|
|
72
|
+
*/
|
|
73
|
+
onClick: PropType<() => void>;
|
|
74
|
+
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
75
|
+
/**
|
|
76
|
+
* The text of the link. Can also be set in the default slot.
|
|
77
|
+
*/
|
|
78
|
+
text: StringConstructor;
|
|
79
|
+
/**
|
|
80
|
+
* The route of the link. If this is set,
|
|
81
|
+
* the link becomes a {@link RouterLink} and does not emit the `onClick` event.
|
|
82
|
+
*/
|
|
83
|
+
route: PropType<RouteLocationRaw>;
|
|
84
|
+
/**
|
|
85
|
+
* The color of the link.
|
|
86
|
+
*/
|
|
87
|
+
color: {
|
|
88
|
+
type: StringConstructor;
|
|
89
|
+
default: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* The text size, a standard tailwind text-size class.
|
|
93
|
+
*/
|
|
94
|
+
textSize: PropType<TWTextSize>;
|
|
95
|
+
/**
|
|
96
|
+
* The shade of the link.
|
|
97
|
+
*/
|
|
98
|
+
shade: {
|
|
99
|
+
type: NumberConstructor;
|
|
100
|
+
default: number;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* This is called when the link is clicked but only, if the `route` prop is not set.
|
|
104
|
+
* If the `route` prop is not set, the link will act as a regular button.
|
|
105
|
+
*/
|
|
106
|
+
onClick: PropType<() => void>;
|
|
107
|
+
}>> & {}, {
|
|
108
|
+
color: string;
|
|
109
|
+
shade: number;
|
|
110
|
+
}>;
|
|
111
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createComponent, createProps } from '../utils/component';
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { RouterLink } from 'vue-router';
|
|
4
|
+
export const nLinkProps = createProps({
|
|
5
|
+
/**
|
|
6
|
+
* The text of the link. Can also be set in the default slot.
|
|
7
|
+
*/
|
|
8
|
+
text: String,
|
|
9
|
+
/**
|
|
10
|
+
* The route of the link. If this is set,
|
|
11
|
+
* the link becomes a {@link RouterLink} and does not emit the `onClick` event.
|
|
12
|
+
*/
|
|
13
|
+
route: [Object, String],
|
|
14
|
+
/**
|
|
15
|
+
* The color of the link.
|
|
16
|
+
*/
|
|
17
|
+
color: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'primary',
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* The text size, a standard tailwind text-size class.
|
|
23
|
+
*/
|
|
24
|
+
textSize: String,
|
|
25
|
+
/**
|
|
26
|
+
* The shade of the link.
|
|
27
|
+
*/
|
|
28
|
+
shade: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 500,
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* This is called when the link is clicked but only, if the `route` prop is not set.
|
|
34
|
+
* If the `route` prop is not set, the link will act as a regular button.
|
|
35
|
+
*/
|
|
36
|
+
onClick: Function,
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* The `NLink` is a styled text which can be used as a {@link RouterLink} or a regular button.
|
|
40
|
+
*/
|
|
41
|
+
export default createComponent('NLink', nLinkProps, (props, { slots }) => {
|
|
42
|
+
const hoverShade = computed(() => {
|
|
43
|
+
const shade = props.shade;
|
|
44
|
+
if (shade <= 500)
|
|
45
|
+
return shade + 100;
|
|
46
|
+
else
|
|
47
|
+
return shade - 200;
|
|
48
|
+
});
|
|
49
|
+
const classes = computed(() => [
|
|
50
|
+
'font-medium focus:outline-none focus-visible:ring-2 rounded-sm ring-offset-2 hover:underline text-left',
|
|
51
|
+
`${props.textSize} text-${props.color}-${props.shade} hover:text-${props.color}-${hoverShade.value} focus-visible:ring-${props.color}-${props.shade}`,
|
|
52
|
+
]);
|
|
53
|
+
return () => props.route ? (<RouterLink to={props.route} class={classes.value}>
|
|
54
|
+
{slots.default?.() || props.text}
|
|
55
|
+
</RouterLink>) : (<button onClick={props.onClick} class={classes.value}>
|
|
56
|
+
{slots.default?.() || props.text}
|
|
57
|
+
</button>);
|
|
58
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
export type ListItem = {
|
|
3
|
+
/**
|
|
4
|
+
* The title of the item.
|
|
5
|
+
*/
|
|
6
|
+
title: string;
|
|
7
|
+
/**
|
|
8
|
+
* The text of the item.
|
|
9
|
+
*/
|
|
10
|
+
text?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const nListProps: {
|
|
13
|
+
/**
|
|
14
|
+
* The items which are displayed in the list.
|
|
15
|
+
*/
|
|
16
|
+
items: {
|
|
17
|
+
type: PropType<ListItem[]>;
|
|
18
|
+
default: () => never[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The `NList` displays key-value data in an appealing way.
|
|
23
|
+
*/
|
|
24
|
+
declare const _default: import("vue").DefineComponent<{
|
|
25
|
+
/**
|
|
26
|
+
* The items which are displayed in the list.
|
|
27
|
+
*/
|
|
28
|
+
items: {
|
|
29
|
+
type: PropType<ListItem[]>;
|
|
30
|
+
default: () => never[];
|
|
31
|
+
};
|
|
32
|
+
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
/**
|
|
34
|
+
* The items which are displayed in the list.
|
|
35
|
+
*/
|
|
36
|
+
items: {
|
|
37
|
+
type: PropType<ListItem[]>;
|
|
38
|
+
default: () => never[];
|
|
39
|
+
};
|
|
40
|
+
}>> & {}, {
|
|
41
|
+
items: ListItem[];
|
|
42
|
+
}>;
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createComponent, createProps } from '../utils/component';
|
|
2
|
+
export const nListProps = createProps({
|
|
3
|
+
/**
|
|
4
|
+
* The items which are displayed in the list.
|
|
5
|
+
*/
|
|
6
|
+
items: {
|
|
7
|
+
type: Array,
|
|
8
|
+
default: () => [],
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* The `NList` displays key-value data in an appealing way.
|
|
13
|
+
*/
|
|
14
|
+
export default createComponent('NList', nListProps, props => {
|
|
15
|
+
return () => (<dl>
|
|
16
|
+
{props.items.map((item, index) => (<div key={index} class={[
|
|
17
|
+
'py-5 px-4 sm:grid sm:grid-cols-3 sm:gap-4',
|
|
18
|
+
index % 2 === 1 ? 'bg-white' : 'bg-default-50',
|
|
19
|
+
]}>
|
|
20
|
+
<dt class="text-sm font-medium text-default-500">{item.title}</dt>
|
|
21
|
+
<dd class="mt-1 text-sm sm:mt-0 sm:col-span-2">{item.text}</dd>
|
|
22
|
+
</div>))}
|
|
23
|
+
</dl>);
|
|
24
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.lds-ellipsis {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.lds-ellipsis div {
|
|
6
|
+
position: absolute;
|
|
7
|
+
border-radius: 50%;
|
|
8
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.lds-ellipsis div:nth-child(1) {
|
|
12
|
+
animation: lds-ellipsis1 0.6s infinite;
|
|
13
|
+
}
|
|
14
|
+
.lds-ellipsis div:nth-child(2) {
|
|
15
|
+
animation: lds-ellipsis2 0.6s infinite;
|
|
16
|
+
}
|
|
17
|
+
.lds-ellipsis div:nth-child(3) {
|
|
18
|
+
animation: lds-ellipsis2 0.6s infinite;
|
|
19
|
+
}
|
|
20
|
+
.lds-ellipsis div:nth-child(4) {
|
|
21
|
+
animation: lds-ellipsis3 0.6s infinite;
|
|
22
|
+
}
|
|
23
|
+
@keyframes lds-ellipsis1 {
|
|
24
|
+
0% {
|
|
25
|
+
transform: scale(0);
|
|
26
|
+
}
|
|
27
|
+
100% {
|
|
28
|
+
transform: scale(1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
@keyframes lds-ellipsis3 {
|
|
32
|
+
0% {
|
|
33
|
+
transform: scale(1);
|
|
34
|
+
}
|
|
35
|
+
100% {
|
|
36
|
+
transform: scale(0);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
@keyframes lds-ellipsis2 {
|
|
40
|
+
0% {
|
|
41
|
+
transform: translate(0, 0);
|
|
42
|
+
}
|
|
43
|
+
100% {
|
|
44
|
+
transform: translate(var(--n-loading-indicator-gap), 0);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import './NLoadingIndicator.css';
|
|
2
|
+
export declare const nLoadingIndicator: {
|
|
3
|
+
/**
|
|
4
|
+
* The color of the loading-indicator.
|
|
5
|
+
*/
|
|
6
|
+
color: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The shade of the loading-indicator.
|
|
12
|
+
*/
|
|
13
|
+
shade: {
|
|
14
|
+
type: NumberConstructor;
|
|
15
|
+
default: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The height of the loading-indicator in px.
|
|
19
|
+
*/
|
|
20
|
+
size: {
|
|
21
|
+
type: NumberConstructor;
|
|
22
|
+
default: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The `NLoadingIndicator` is a styled loading indicator.
|
|
27
|
+
*/
|
|
28
|
+
declare const _default: import("vue").DefineComponent<{
|
|
29
|
+
/**
|
|
30
|
+
* The color of the loading-indicator.
|
|
31
|
+
*/
|
|
32
|
+
color: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The shade of the loading-indicator.
|
|
38
|
+
*/
|
|
39
|
+
shade: {
|
|
40
|
+
type: NumberConstructor;
|
|
41
|
+
default: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The height of the loading-indicator in px.
|
|
45
|
+
*/
|
|
46
|
+
size: {
|
|
47
|
+
type: NumberConstructor;
|
|
48
|
+
default: number;
|
|
49
|
+
};
|
|
50
|
+
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
51
|
+
/**
|
|
52
|
+
* The color of the loading-indicator.
|
|
53
|
+
*/
|
|
54
|
+
color: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The shade of the loading-indicator.
|
|
60
|
+
*/
|
|
61
|
+
shade: {
|
|
62
|
+
type: NumberConstructor;
|
|
63
|
+
default: number;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The height of the loading-indicator in px.
|
|
67
|
+
*/
|
|
68
|
+
size: {
|
|
69
|
+
type: NumberConstructor;
|
|
70
|
+
default: number;
|
|
71
|
+
};
|
|
72
|
+
}>> & {}, {
|
|
73
|
+
color: string;
|
|
74
|
+
shade: number;
|
|
75
|
+
size: number;
|
|
76
|
+
}>;
|
|
77
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createComponent, createProps } from '../utils/component';
|
|
2
|
+
import { computed, useCssVars } from 'vue';
|
|
3
|
+
import './NLoadingIndicator.css';
|
|
4
|
+
export const nLoadingIndicator = createProps({
|
|
5
|
+
/**
|
|
6
|
+
* The color of the loading-indicator.
|
|
7
|
+
*/
|
|
8
|
+
color: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: 'primary',
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* The shade of the loading-indicator.
|
|
14
|
+
*/
|
|
15
|
+
shade: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 400,
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* The height of the loading-indicator in px.
|
|
21
|
+
*/
|
|
22
|
+
size: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 10,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* The `NLoadingIndicator` is a styled loading indicator.
|
|
29
|
+
*/
|
|
30
|
+
export default createComponent('NLoadingIndicator', nLoadingIndicator, props => {
|
|
31
|
+
const gap = computed(() => (props.size / 13) * 24);
|
|
32
|
+
const totalWidth = computed(() => gap.value * 2 + props.size);
|
|
33
|
+
useCssVars(() => ({
|
|
34
|
+
'n-loading-indicator-gap': `${gap.value}px`,
|
|
35
|
+
}));
|
|
36
|
+
return () => (<div class="lds-ellipsis" style={`height:${props.size}px;width:${totalWidth.value}px`}>
|
|
37
|
+
<div class={`bg-${props.color}-${props.shade}`} style={`height:${props.size}px;width:${props.size}px;left:0px`}/>
|
|
38
|
+
<div class={`bg-${props.color}-${props.shade}`} style={`height:${props.size}px;width:${props.size}px;left:0px`}/>
|
|
39
|
+
<div class={`bg-${props.color}-${props.shade}`} style={`height:${props.size}px;width:${props.size}px;left:${gap.value}px`}/>
|
|
40
|
+
<div class={`bg-${props.color}-${props.shade}`} style={`height:${props.size}px;width:${props.size}px;left:${2 * gap.value}px`}/>
|
|
41
|
+
</div>);
|
|
42
|
+
});
|