nuxt-glorious 2.0.0-develop-9 → 2.0.0-develop-11
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/dist/module.json
CHANGED
@@ -13,7 +13,7 @@ const computeProps = (icon: any) => {
|
|
13
13
|
const stroke = getAttribute(props.color, 'icon', 'color')
|
14
14
|
|
15
15
|
return icon
|
16
|
-
.replace(/width="(\d+)"/g, `width="${size}"`)
|
16
|
+
.replace(/width="(\d+)"/g, `class="g-icon-${props.name}" width="${size}"`)
|
17
17
|
.replace(/height="(\d+)"/g, `height="${size}"`)
|
18
18
|
.replace(/fill="(?!none)([^"]+)"/g, `fill="${color}"`)
|
19
19
|
.replace(/stroke="(?!none)([^"]+)"/g, `stroke="${stroke}"`)
|
@@ -6,60 +6,64 @@ const props = defineProps(_props)
|
|
6
6
|
</script>
|
7
7
|
|
8
8
|
<template>
|
9
|
-
<
|
10
|
-
<div
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<
|
16
|
-
<
|
17
|
-
<
|
18
|
-
|
19
|
-
|
9
|
+
<ClientOnly>
|
10
|
+
<div class="flex flex-col">
|
11
|
+
<div
|
12
|
+
class="glorious-table"
|
13
|
+
:class="[`color-${getAttribute(props.color, 'table', 'color')}`]"
|
14
|
+
>
|
15
|
+
<table>
|
16
|
+
<thead>
|
17
|
+
<tr>
|
18
|
+
<th
|
19
|
+
v-for="(headItem, index) in props.header"
|
20
|
+
:key="index"
|
21
|
+
>
|
22
|
+
{{ headItem }}
|
23
|
+
</th>
|
24
|
+
</tr>
|
25
|
+
</thead>
|
26
|
+
<tbody v-if="!getAttribute(props.loading, 'table', 'loading')">
|
27
|
+
<tr
|
28
|
+
v-for="(bodyItem, bodyIndex) in props.body"
|
29
|
+
:key="bodyIndex"
|
20
30
|
>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
!getAttribute(props.loading, 'table', 'loading') &&
|
57
|
-
props.body.length === 0
|
58
|
-
"
|
59
|
-
>
|
60
|
-
<div class="bg-white shadow p-2 rounded w-max">
|
61
|
-
<span> {{ getAttribute(props.emptyText, 'table', 'emptyText') }} </span>
|
31
|
+
<td
|
32
|
+
v-for="(headItem, headKey, headIndex) in props.header"
|
33
|
+
:key="headIndex"
|
34
|
+
>
|
35
|
+
<slot
|
36
|
+
v-if="typeof $slots[headKey] !== 'undefined'"
|
37
|
+
:name="headKey"
|
38
|
+
:item="{ ...bodyItem, index: bodyIndex }"
|
39
|
+
/>
|
40
|
+
<template v-else>
|
41
|
+
{{ bodyItem[headKey] }}
|
42
|
+
</template>
|
43
|
+
</td>
|
44
|
+
</tr>
|
45
|
+
</tbody>
|
46
|
+
</table>
|
47
|
+
</div>
|
48
|
+
<div
|
49
|
+
v-if="getAttribute(props.loading, 'table', 'loading')"
|
50
|
+
class="flex justify-center mt-3"
|
51
|
+
>
|
52
|
+
<GLoading :color="getAttribute(props.loading, 'table', 'loading')" />
|
53
|
+
</div>
|
54
|
+
<div
|
55
|
+
class="flex justify-center mt-3"
|
56
|
+
v-if="
|
57
|
+
!getAttribute(props.loading, 'table', 'loading') &&
|
58
|
+
props.body.length === 0
|
59
|
+
"
|
60
|
+
>
|
61
|
+
<div class="bg-white shadow p-2 rounded w-max">
|
62
|
+
<span>
|
63
|
+
{{ getAttribute(props.emptyText, 'table', 'emptyText') }}
|
64
|
+
</span>
|
65
|
+
</div>
|
62
66
|
</div>
|
63
67
|
</div>
|
64
|
-
</
|
68
|
+
</ClientOnly>
|
65
69
|
</template>
|
@@ -26,12 +26,10 @@ export const hasValidationError = (errorProp) => {
|
|
26
26
|
return condition;
|
27
27
|
};
|
28
28
|
export const getAttribute = (propsValue, componentName, prop) => {
|
29
|
-
let mount;
|
29
|
+
let mount = propsValue;
|
30
30
|
if (import.meta.client) {
|
31
31
|
const config = useRuntimeConfig();
|
32
|
-
|
33
|
-
} else {
|
34
|
-
mount = propsValue;
|
32
|
+
mount = config.public?.glorious?.components?.[componentName]?.props?.[prop] || propsValue;
|
35
33
|
}
|
36
34
|
return mount;
|
37
35
|
};
|
@@ -1116,13 +1116,13 @@ label.checked {
|
|
1116
1116
|
@apply rounded-t-md overflow-hidden;
|
1117
1117
|
}
|
1118
1118
|
.glorious-table.color-orange > table > thead > tr > th:first-child {
|
1119
|
-
@apply
|
1119
|
+
@apply rtl:rounded-tr-lg ltr:rounded-tl-lg bg-orange-400;
|
1120
1120
|
}
|
1121
1121
|
.glorious-table.color-orange > table > thead > tr > th {
|
1122
1122
|
@apply bg-orange-400;
|
1123
1123
|
}
|
1124
1124
|
.glorious-table.color-orange > table > thead > tr > th:last-child {
|
1125
|
-
@apply rounded-
|
1125
|
+
@apply rtl:rounded-tl-lg ltr:rounded-tr-lg bg-orange-400;
|
1126
1126
|
}
|
1127
1127
|
.glorious-table.color-orange > table > tbody > tr:nth-child(even) {
|
1128
1128
|
@apply bg-orange-50;
|
@@ -1134,13 +1134,13 @@ label.checked {
|
|
1134
1134
|
@apply rounded-t-md overflow-hidden;
|
1135
1135
|
}
|
1136
1136
|
.glorious-table.color-blue > table > thead > tr > th:first-child {
|
1137
|
-
@apply
|
1137
|
+
@apply rtl:rounded-tr-lg ltr:rounded-tl-lg bg-blue-400;
|
1138
1138
|
}
|
1139
1139
|
.glorious-table.color-blue > table > thead > tr > th {
|
1140
1140
|
@apply bg-blue-400;
|
1141
1141
|
}
|
1142
1142
|
.glorious-table.color-blue > table > thead > tr > th:last-child {
|
1143
|
-
@apply rounded-
|
1143
|
+
@apply rtl:rounded-tl-lg ltr:rounded-tr-lg bg-blue-400;
|
1144
1144
|
}
|
1145
1145
|
.glorious-table.color-blue > table > tbody > tr:nth-child(even) {
|
1146
1146
|
@apply bg-blue-50;
|
@@ -1152,13 +1152,13 @@ label.checked {
|
|
1152
1152
|
@apply rounded-t-md overflow-hidden;
|
1153
1153
|
}
|
1154
1154
|
.glorious-table.color-gray > table > thead > tr > th:first-child {
|
1155
|
-
@apply
|
1155
|
+
@apply rtl:rounded-tr-lg ltr:rounded-tl-lg bg-gray-400;
|
1156
1156
|
}
|
1157
1157
|
.glorious-table.color-gray > table > thead > tr > th {
|
1158
1158
|
@apply bg-gray-400;
|
1159
1159
|
}
|
1160
1160
|
.glorious-table.color-gray > table > thead > tr > th:last-child {
|
1161
|
-
@apply rounded-
|
1161
|
+
@apply rtl:rounded-tl-lg ltr:rounded-tr-lg bg-gray-400;
|
1162
1162
|
}
|
1163
1163
|
.glorious-table.color-gray > table > tbody > tr:nth-child(even) {
|
1164
1164
|
@apply bg-gray-50;
|
@@ -1170,13 +1170,13 @@ label.checked {
|
|
1170
1170
|
@apply rounded-t-md overflow-hidden;
|
1171
1171
|
}
|
1172
1172
|
.glorious-table.color-red > table > thead > tr > th:first-child {
|
1173
|
-
@apply
|
1173
|
+
@apply rtl:rounded-tr-lg ltr:rounded-tl-lg bg-red-400;
|
1174
1174
|
}
|
1175
1175
|
.glorious-table.color-red > table > thead > tr > th {
|
1176
1176
|
@apply bg-red-400;
|
1177
1177
|
}
|
1178
1178
|
.glorious-table.color-red > table > thead > tr > th:last-child {
|
1179
|
-
@apply rounded-
|
1179
|
+
@apply rtl:rounded-tl-lg ltr:rounded-tr-lg bg-red-400;
|
1180
1180
|
}
|
1181
1181
|
.glorious-table.color-red > table > tbody > tr:nth-child(even) {
|
1182
1182
|
@apply bg-red-50;
|
@@ -1188,13 +1188,13 @@ label.checked {
|
|
1188
1188
|
@apply rounded-t-md overflow-hidden;
|
1189
1189
|
}
|
1190
1190
|
.glorious-table.color-green > table > thead > tr > th:first-child {
|
1191
|
-
@apply
|
1191
|
+
@apply rtl:rounded-tr-lg ltr:rounded-tl-lg bg-green-400;
|
1192
1192
|
}
|
1193
1193
|
.glorious-table.color-green > table > thead > tr > th {
|
1194
1194
|
@apply bg-green-400;
|
1195
1195
|
}
|
1196
1196
|
.glorious-table.color-green > table > thead > tr > th:last-child {
|
1197
|
-
@apply rounded-
|
1197
|
+
@apply rtl:rounded-tl-lg ltr:rounded-tr-lg bg-green-400;
|
1198
1198
|
}
|
1199
1199
|
.glorious-table.color-green > table > tbody > tr:nth-child(even) {
|
1200
1200
|
@apply bg-green-50;
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "2.0.0-develop-
|
2
|
+
"version": "2.0.0-develop-11",
|
3
3
|
"name": "nuxt-glorious",
|
4
4
|
"description": "This package provides many things needed by a project, including server requests and authentication, SEO and other requirements of a project.",
|
5
5
|
"repository": "sajadhzj/nuxt-glorious",
|