nuxt-glorious 2.0.0-develop-30 → 2.0.0-develop-32
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.d.mts +5 -0
- package/dist/module.d.ts +5 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/G/Accordion.vue +40 -0
- package/dist/runtime/components/G/ErrorText.vue +21 -6
- package/dist/runtime/components/G/Input.vue +3 -0
- package/dist/runtime/components/props/Accordion.d.ts +8 -0
- package/dist/runtime/components/props/Accordion.mjs +4 -0
- package/dist/runtime/style/style.css +94 -1
- package/package.json +1 -1
- package/dist/runtime/composables/useGloriousAppSetting.d.ts +0 -11
- package/dist/runtime/composables/useGloriousAppSetting.mjs +0 -36
- package/dist/runtime/plugins/glorious-app-setting.d.ts +0 -2
- package/dist/runtime/plugins/glorious-app-setting.mjs +0 -11
package/dist/module.d.mts
CHANGED
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import _props from './../props/Accordion'
|
3
|
+
import { getAttribute } from '../helper'
|
4
|
+
|
5
|
+
const props = defineProps(_props)
|
6
|
+
const openAccordion = (e: Event) => {
|
7
|
+
const headerElement = e.currentTarget as HTMLElement
|
8
|
+
const bodyElement = headerElement.nextElementSibling as HTMLElement
|
9
|
+
if (bodyElement.style.maxHeight) {
|
10
|
+
headerElement.classList.remove('accordion-open')
|
11
|
+
bodyElement.style.removeProperty('max-height')
|
12
|
+
} else {
|
13
|
+
headerElement.classList.add('accordion-open')
|
14
|
+
bodyElement.style.maxHeight = bodyElement.scrollHeight + 24 + 'px'
|
15
|
+
}
|
16
|
+
}
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<template>
|
20
|
+
<div
|
21
|
+
class="glorious-accordion"
|
22
|
+
:class="`color-${getAttribute(props.color, 'accordion', 'color')}`"
|
23
|
+
>
|
24
|
+
<div
|
25
|
+
class="header"
|
26
|
+
@click="openAccordion"
|
27
|
+
>
|
28
|
+
<div>
|
29
|
+
<slot name="header" />
|
30
|
+
</div>
|
31
|
+
<GIcon
|
32
|
+
name="glorious-arrow"
|
33
|
+
:size="10"
|
34
|
+
/>
|
35
|
+
</div>
|
36
|
+
<div class="body">
|
37
|
+
<slot name="body" />
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</template>
|
@@ -5,12 +5,27 @@ import _props from '../props/ErrorText'
|
|
5
5
|
const props = defineProps(_props)
|
6
6
|
const gs = GloriousStore()
|
7
7
|
const error: any = props.error.split('|')
|
8
|
+
const isAll = () => error.length === 1
|
8
9
|
</script>
|
9
10
|
<template>
|
10
|
-
<
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
<div>
|
12
|
+
<span
|
13
|
+
v-if="gs.forms[error[0]]?.errors[error[1]] && !isAll()"
|
14
|
+
class="validation-error-text text-red-500 text-sm"
|
15
|
+
>
|
16
|
+
{{ gs.forms[error[0]].errors[error[1]][0] }}
|
17
|
+
</span>
|
18
|
+
<ul
|
19
|
+
v-else-if="isAll()"
|
20
|
+
class="flex flex-col list-disc ltr:ml-4 rtl:mr-4"
|
21
|
+
>
|
22
|
+
<li
|
23
|
+
v-for="(item, index) in gs.forms[error[0]].errors"
|
24
|
+
:key="index"
|
25
|
+
class="text-sm"
|
26
|
+
>
|
27
|
+
<span class="validation-error-text">{{ item[0] }}</span>
|
28
|
+
</li>
|
29
|
+
</ul>
|
30
|
+
</div>
|
16
31
|
</template>
|
@@ -79,6 +79,9 @@ const isSelected = (value: any): boolean => {
|
|
79
79
|
)
|
80
80
|
}
|
81
81
|
const addTagViaOption = (option: any, event: any) => {
|
82
|
+
if (event.currentTarget.classList.contains('disabled')) {
|
83
|
+
event.stopPropagation()
|
84
|
+
}
|
82
85
|
// event.stopPropagation() if want not close with window
|
83
86
|
if (
|
84
87
|
typeof tags.value === 'string' ||
|
@@ -1,4 +1,68 @@
|
|
1
1
|
@charset "UTF-8";
|
2
|
+
.glorious-accordion {
|
3
|
+
@apply border rounded h-max text-sm cursor-pointer;
|
4
|
+
}
|
5
|
+
.glorious-accordion.color-orange {
|
6
|
+
@apply border-orange-500;
|
7
|
+
}
|
8
|
+
.glorious-accordion.color-orange div.header:hover {
|
9
|
+
@apply rounded bg-orange-100;
|
10
|
+
}
|
11
|
+
.glorious-accordion.color-orange.accordion-open + div.body {
|
12
|
+
@apply mt-2 pt-3 border-t border-orange-500;
|
13
|
+
}
|
14
|
+
.glorious-accordion.color-blue {
|
15
|
+
@apply border-blue-500;
|
16
|
+
}
|
17
|
+
.glorious-accordion.color-blue div.header:hover {
|
18
|
+
@apply rounded bg-blue-100;
|
19
|
+
}
|
20
|
+
.glorious-accordion.color-blue.accordion-open + div.body {
|
21
|
+
@apply mt-2 pt-3 border-t border-blue-500;
|
22
|
+
}
|
23
|
+
.glorious-accordion.color-gray {
|
24
|
+
@apply border-gray-500;
|
25
|
+
}
|
26
|
+
.glorious-accordion.color-gray div.header:hover {
|
27
|
+
@apply rounded bg-gray-100;
|
28
|
+
}
|
29
|
+
.glorious-accordion.color-gray.accordion-open + div.body {
|
30
|
+
@apply mt-2 pt-3 border-t border-gray-500;
|
31
|
+
}
|
32
|
+
.glorious-accordion.color-red {
|
33
|
+
@apply border-red-500;
|
34
|
+
}
|
35
|
+
.glorious-accordion.color-red div.header:hover {
|
36
|
+
@apply rounded bg-red-100;
|
37
|
+
}
|
38
|
+
.glorious-accordion.color-red.accordion-open + div.body {
|
39
|
+
@apply mt-2 pt-3 border-t border-red-500;
|
40
|
+
}
|
41
|
+
.glorious-accordion.color-green {
|
42
|
+
@apply border-green-500;
|
43
|
+
}
|
44
|
+
.glorious-accordion.color-green div.header:hover {
|
45
|
+
@apply rounded bg-green-100;
|
46
|
+
}
|
47
|
+
.glorious-accordion.color-green.accordion-open + div.body {
|
48
|
+
@apply mt-2 pt-3 border-t border-green-500;
|
49
|
+
}
|
50
|
+
.glorious-accordion div.header {
|
51
|
+
@apply p-3 flex justify-between items-center;
|
52
|
+
}
|
53
|
+
.glorious-accordion div.header div:last-child {
|
54
|
+
@apply rotate-90 transition-[rotate] duration-300 ease-out text-sm;
|
55
|
+
}
|
56
|
+
.glorious-accordion div.header.accordion-open div:last-child {
|
57
|
+
@apply rotate-270 transition-[rotate] duration-300 ease-out;
|
58
|
+
}
|
59
|
+
.glorious-accordion div.header.accordion-open + div.body {
|
60
|
+
@apply border-t py-3;
|
61
|
+
}
|
62
|
+
.glorious-accordion div.body {
|
63
|
+
@apply px-3 max-h-0 overflow-hidden transition-all duration-300 ease-out text-sm;
|
64
|
+
}
|
65
|
+
|
2
66
|
.glorious-alert {
|
3
67
|
@apply p-3 rounded-md shadow-md;
|
4
68
|
}
|
@@ -733,6 +797,13 @@ button:focus-visible {
|
|
733
797
|
transform: scaleY(-1) rotate(-135deg);
|
734
798
|
}
|
735
799
|
}
|
800
|
+
html:has(.glorious-scaffold-modal.open) {
|
801
|
+
@apply overflow-hidden;
|
802
|
+
}
|
803
|
+
html:has(.glorious-scaffold-modal.open) div.glorious-input-options {
|
804
|
+
@apply md:!fixed !absolute;
|
805
|
+
}
|
806
|
+
|
736
807
|
.glorious-scaffold-modal {
|
737
808
|
@apply fixed bg-white md:top-[15%] z-50 right-0 left-0 mx-auto md:rounded-md rounded-t-md md:bottom-0 bottom-0;
|
738
809
|
}
|
@@ -743,7 +814,7 @@ button:focus-visible {
|
|
743
814
|
@apply flex justify-between items-center px-3 pt-3;
|
744
815
|
}
|
745
816
|
.glorious-scaffold-modal-content {
|
746
|
-
@apply overflow-y-auto max-h-
|
817
|
+
@apply overflow-y-auto max-h-[50vh] px-3 pb-3;
|
747
818
|
}
|
748
819
|
.glorious-scaffold-modal-footer {
|
749
820
|
@apply flex justify-center gap-3 my-3;
|
@@ -1359,6 +1430,28 @@ label.checked {
|
|
1359
1430
|
display: inline-block !important;
|
1360
1431
|
}
|
1361
1432
|
}
|
1433
|
+
.validation-error-text {
|
1434
|
+
display: inline-block;
|
1435
|
+
animation: vibrateErrorTextLR 0.3s ease-in-out 1;
|
1436
|
+
}
|
1437
|
+
|
1438
|
+
@keyframes vibrateErrorTextLR {
|
1439
|
+
0% {
|
1440
|
+
transform: translateX(0);
|
1441
|
+
}
|
1442
|
+
25% {
|
1443
|
+
transform: translateX(-5px);
|
1444
|
+
}
|
1445
|
+
50% {
|
1446
|
+
transform: translateX(5px);
|
1447
|
+
}
|
1448
|
+
75% {
|
1449
|
+
transform: translateX(-5px);
|
1450
|
+
}
|
1451
|
+
100% {
|
1452
|
+
transform: translateX(0);
|
1453
|
+
}
|
1454
|
+
}
|
1362
1455
|
.glorious-backdrop {
|
1363
1456
|
@apply backdrop-blur-md fixed top-0 w-full h-full bg-gray-500/50 z-40;
|
1364
1457
|
}
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "2.0.0-develop-
|
2
|
+
"version": "2.0.0-develop-32",
|
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",
|
@@ -1,11 +0,0 @@
|
|
1
|
-
interface appSettingInterface {
|
2
|
-
dir?: String;
|
3
|
-
darkMode?: Boolean;
|
4
|
-
}
|
5
|
-
export declare const useGloriousAppSetting: {
|
6
|
-
getSetting: () => appSettingInterface;
|
7
|
-
setSetting: (key: any, value: any) => void;
|
8
|
-
setDarkMode: () => void;
|
9
|
-
setDir: (type: "rtl" | "ltr") => void;
|
10
|
-
};
|
11
|
-
export {};
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import { useCookie } from "#imports";
|
2
|
-
import defu from "defu";
|
3
|
-
const defaultSetting = {
|
4
|
-
dir: "rtl",
|
5
|
-
darkMode: false
|
6
|
-
};
|
7
|
-
export const useGloriousAppSetting = {
|
8
|
-
getSetting: () => {
|
9
|
-
const appSetting = useCookie("glorious-app-setting");
|
10
|
-
let result = {};
|
11
|
-
if (typeof appSetting.value === "undefined") {
|
12
|
-
appSetting.value = defaultSetting;
|
13
|
-
result = defaultSetting;
|
14
|
-
} else result = defu(appSetting.value, defaultSetting);
|
15
|
-
return result;
|
16
|
-
},
|
17
|
-
setSetting: (key, value) => {
|
18
|
-
const setting = useGloriousAppSetting.getSetting();
|
19
|
-
setting[key] = value;
|
20
|
-
const appSetting = useCookie("glorious-app-setting");
|
21
|
-
appSetting.value[key] = value;
|
22
|
-
},
|
23
|
-
setDarkMode: () => {
|
24
|
-
const html = document.getElementsByTagName("html")[0];
|
25
|
-
useGloriousAppSetting.setSetting(
|
26
|
-
"darkMode",
|
27
|
-
!html.classList.contains("dark")
|
28
|
-
);
|
29
|
-
html.classList.toggle("dark");
|
30
|
-
},
|
31
|
-
setDir: (type) => {
|
32
|
-
const html = document.getElementsByTagName("html")[0];
|
33
|
-
html.dir = type;
|
34
|
-
useGloriousAppSetting.setSetting("dir", type);
|
35
|
-
}
|
36
|
-
};
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { defineNuxtPlugin, useHead } from "#imports";
|
2
|
-
import { useGloriousAppSetting } from "../composables/useGloriousAppSetting.mjs";
|
3
|
-
export default defineNuxtPlugin(() => {
|
4
|
-
const gloriousAppSetting = useGloriousAppSetting.getSetting();
|
5
|
-
useHead({
|
6
|
-
htmlAttrs: {
|
7
|
-
dir: gloriousAppSetting.dir,
|
8
|
-
class: [gloriousAppSetting.darkMode ? "dark" : ""]
|
9
|
-
}
|
10
|
-
});
|
11
|
-
});
|