nuxt-glorious 1.2.0 → 1.2.9-5
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 +38 -1
- package/dist/module.d.ts +38 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +45 -36
- package/dist/runtime/assets/icons/glorious-eye-fill.svg +1 -1
- package/dist/runtime/assets/icons/glorious-eye-off-fill.svg +1 -1
- package/dist/runtime/assets/icons/glorious-star-fill.svg +3 -0
- package/dist/runtime/assets/icons/glorious-star-half.svg +3 -0
- package/dist/runtime/assets/icons/glorious-star-line.svg +3 -0
- package/dist/runtime/components/G/Alert.vue +16 -0
- package/dist/runtime/components/G/Avatar.vue +16 -0
- package/dist/runtime/components/G/Breadcrumb.vue +37 -0
- package/dist/runtime/components/G/Button.vue +13 -154
- package/dist/runtime/components/G/Checkbox.vue +26 -0
- package/dist/runtime/components/G/CountDown.vue +33 -43
- package/dist/runtime/components/G/Drawer.vue +16 -75
- package/dist/runtime/components/G/Dropdown.vue +17 -31
- package/dist/runtime/components/G/ErrorText.vue +7 -11
- package/dist/runtime/components/G/File.vue +25 -117
- package/dist/runtime/components/G/Icon.vue +125 -0
- package/dist/runtime/components/G/Input.vue +126 -250
- package/dist/runtime/components/G/Loading.vue +4 -21
- package/dist/runtime/components/G/Modal.vue +51 -138
- package/dist/runtime/components/G/Paginate.vue +24 -57
- package/dist/runtime/components/G/Radio.vue +18 -27
- package/dist/runtime/components/G/Rating.vue +30 -0
- package/dist/runtime/components/G/Select.vue +27 -112
- package/dist/runtime/components/G/Switch.vue +28 -0
- package/dist/runtime/components/G/Tab.vue +80 -44
- package/dist/runtime/components/G/Table.vue +62 -0
- package/dist/runtime/components/G/textarea.vue +17 -120
- package/dist/runtime/components/G/timeline.vue +28 -0
- package/dist/runtime/components/helper.d.ts +3 -0
- package/dist/runtime/components/helper.mjs +37 -0
- package/dist/runtime/components/props/Alert.d.ts +8 -0
- package/dist/runtime/components/props/Alert.mjs +4 -0
- package/dist/runtime/components/props/Avatar.d.ts +12 -0
- package/dist/runtime/components/props/Avatar.mjs +9 -0
- package/dist/runtime/components/props/Breadcrumb.d.ts +26 -0
- package/dist/runtime/components/props/Breadcrumb.mjs +11 -0
- package/dist/runtime/components/props/Button.d.ts +47 -0
- package/dist/runtime/components/props/Button.mjs +14 -0
- package/dist/runtime/components/props/CheckBox.d.ts +23 -0
- package/dist/runtime/components/props/CheckBox.mjs +7 -0
- package/dist/runtime/components/props/CountDown.d.ts +7 -0
- package/dist/runtime/components/props/CountDown.mjs +6 -0
- package/dist/runtime/components/props/Drawer.d.ts +8 -0
- package/dist/runtime/components/props/Drawer.mjs +7 -0
- package/dist/runtime/components/props/ErrorText.d.ts +8 -0
- package/dist/runtime/components/props/ErrorText.mjs +4 -0
- package/dist/runtime/components/props/File.d.ts +28 -0
- package/dist/runtime/components/props/File.mjs +9 -0
- package/dist/runtime/components/props/Icon.d.ts +23 -0
- package/dist/runtime/components/props/Icon.mjs +7 -0
- package/dist/runtime/components/props/Input.d.ts +91 -0
- package/dist/runtime/components/props/Input.mjs +50 -0
- package/dist/runtime/components/props/Loading.d.ts +18 -0
- package/dist/runtime/components/props/Loading.mjs +6 -0
- package/dist/runtime/components/props/Modal.d.ts +48 -0
- package/dist/runtime/components/props/Modal.mjs +38 -0
- package/dist/runtime/components/props/Paginate.d.ts +18 -0
- package/dist/runtime/components/props/Paginate.mjs +17 -0
- package/dist/runtime/components/props/Radio.d.ts +33 -0
- package/dist/runtime/components/props/Radio.mjs +9 -0
- package/dist/runtime/components/props/Select.d.ts +61 -0
- package/dist/runtime/components/props/Select.mjs +23 -0
- package/dist/runtime/components/props/Switch.d.ts +13 -0
- package/dist/runtime/components/props/Switch.mjs +5 -0
- package/dist/runtime/components/props/Tab.d.ts +21 -0
- package/dist/runtime/components/props/Tab.mjs +7 -0
- package/dist/runtime/components/props/Table.d.ts +49 -0
- package/dist/runtime/components/props/Table.mjs +19 -0
- package/dist/runtime/components/props/Textarea.d.ts +38 -0
- package/dist/runtime/components/props/Textarea.mjs +14 -0
- package/dist/runtime/components/props/Timeline.d.ts +11 -0
- package/dist/runtime/components/props/Timeline.mjs +7 -0
- package/dist/runtime/components/props/common/index.d.ts +161 -0
- package/dist/runtime/components/props/common/index.mjs +147 -0
- package/dist/runtime/composables/useGloriousCore.d.ts +1 -1
- package/dist/runtime/composables/useGloriousCore.mjs +1 -1
- package/dist/runtime/composables/useGloriousFetch.d.ts +4 -3
- package/dist/runtime/composables/useGloriousFetch.mjs +6 -5
- package/dist/runtime/middlewares/AuthStrategy.mjs +2 -6
- package/dist/runtime/middlewares/ResponseGloriousStore.mjs +9 -0
- package/dist/runtime/plugins/InputComponent.d.ts +2 -0
- package/dist/runtime/plugins/InputComponent.mjs +13 -0
- package/dist/runtime/plugins/module.d.ts +4 -0
- package/dist/runtime/plugins/module.mjs +94 -0
- package/dist/runtime/stores/GloriousStore.d.ts +0 -1
- package/dist/runtime/stores/GloriousStore.mjs +3 -13
- package/dist/runtime/style/components/alert.css +33 -0
- package/dist/runtime/style/components/alert.scss +7 -0
- package/dist/runtime/style/components/avatar.css +57 -0
- package/dist/runtime/style/components/avatar.scss +13 -0
- package/dist/runtime/style/components/breadcrumb.css +6 -0
- package/dist/runtime/style/components/breadcrumb.scss +6 -0
- package/dist/runtime/style/components/button.css +113 -0
- package/dist/runtime/style/components/button.scss +30 -0
- package/dist/runtime/style/components/checkbox.css +94 -0
- package/dist/runtime/style/components/checkbox.scss +52 -0
- package/dist/runtime/{assets/style → style}/components/drawer.css +14 -18
- package/dist/runtime/style/components/drawer.scss +57 -0
- package/dist/runtime/style/components/dropdown.scss +19 -0
- package/dist/runtime/style/components/editor.scss +4 -0
- package/dist/runtime/style/components/file.css +134 -0
- package/dist/runtime/style/components/file.scss +19 -0
- package/dist/runtime/style/components/input.css +187 -0
- package/dist/runtime/style/components/input.scss +87 -0
- package/dist/runtime/style/components/loading.css +43 -0
- package/dist/runtime/style/components/loading.scss +92 -0
- package/dist/runtime/style/components/modal.css +66 -0
- package/dist/runtime/style/components/modal.scss +76 -0
- package/dist/runtime/style/components/paginate.scss +18 -0
- package/dist/runtime/style/components/radio.css +121 -0
- package/dist/runtime/style/components/radio.scss +59 -0
- package/dist/runtime/style/components/rating.css +26 -0
- package/dist/runtime/style/components/rating.scss +25 -0
- package/dist/runtime/style/components/select.css +46 -0
- package/dist/runtime/style/components/select.scss +40 -0
- package/dist/runtime/style/components/switch.css +61 -0
- package/dist/runtime/style/components/switch.scss +74 -0
- package/dist/runtime/{assets/style → style}/components/tab.css +3 -3
- package/dist/runtime/style/components/tab.scss +11 -0
- package/dist/runtime/style/components/table.css +99 -0
- package/dist/runtime/style/components/table.scss +41 -0
- package/dist/runtime/style/components/textarea.css +64 -0
- package/dist/runtime/style/components/textarea.scss +43 -0
- package/dist/runtime/style/components/timeline.css +47 -0
- package/dist/runtime/style/components/timeline.scss +40 -0
- package/dist/runtime/style/mixin.css +0 -0
- package/dist/runtime/style/mixin.scss +40 -0
- package/dist/runtime/style/variable.css +0 -0
- package/dist/runtime/style/variable.scss +19 -0
- package/dist/types.d.mts +2 -10
- package/dist/types.d.ts +2 -10
- package/package.json +9 -7
- package/dist/runtime/assets/style/components/buttons.css +0 -107
- package/dist/runtime/assets/style/components/file.css +0 -65
- package/dist/runtime/assets/style/components/input.css +0 -91
- package/dist/runtime/assets/style/components/modal.css +0 -57
- package/dist/runtime/assets/style/components/select.css +0 -54
- package/dist/runtime/assets/style/components/textarea.css +0 -64
- package/dist/runtime/components/G/Breadcrump.vue +0 -46
- package/dist/runtime/components/G/Icon/index.vue +0 -143
- package/dist/runtime/plugins/Drawer.mjs +0 -35
- package/dist/runtime/utils/gTailwindColor.d.ts +0 -1
- package/dist/runtime/utils/gTailwindColor.mjs +0 -5
- /package/dist/runtime/{plugins/Drawer.d.ts → middlewares/ResponseGloriousStore.d.ts} +0 -0
- /package/dist/runtime/{assets/style → style}/components/dropdown.css +0 -0
- /package/dist/runtime/{assets/style → style}/components/editor.css +0 -0
- /package/dist/runtime/{assets/style → style}/components/paginate.css +0 -0
@@ -0,0 +1,161 @@
|
|
1
|
+
import type { colors, sizes, rounded as roundedType } from '../../../../types';
|
2
|
+
export declare const color: (def?: string) => {
|
3
|
+
color: {
|
4
|
+
required: boolean;
|
5
|
+
default: string;
|
6
|
+
type: () => colors;
|
7
|
+
};
|
8
|
+
};
|
9
|
+
export declare const size: (def?: sizes) => {
|
10
|
+
size: {
|
11
|
+
required: boolean;
|
12
|
+
default: sizes;
|
13
|
+
type: () => sizes;
|
14
|
+
};
|
15
|
+
};
|
16
|
+
export declare const rounded: {
|
17
|
+
size: {
|
18
|
+
required: boolean;
|
19
|
+
default: string;
|
20
|
+
type: () => roundedType;
|
21
|
+
};
|
22
|
+
};
|
23
|
+
export declare const disabled: {
|
24
|
+
disabled: {
|
25
|
+
required: boolean;
|
26
|
+
default: boolean;
|
27
|
+
type: BooleanConstructor;
|
28
|
+
};
|
29
|
+
};
|
30
|
+
export declare const loading: {
|
31
|
+
loading: {
|
32
|
+
required: boolean;
|
33
|
+
default: boolean;
|
34
|
+
type: BooleanConstructor;
|
35
|
+
};
|
36
|
+
loadingOption: {
|
37
|
+
required: boolean;
|
38
|
+
default: {
|
39
|
+
color: string;
|
40
|
+
};
|
41
|
+
type: {
|
42
|
+
color: StringConstructor;
|
43
|
+
};
|
44
|
+
};
|
45
|
+
};
|
46
|
+
export declare const to: {
|
47
|
+
to: {
|
48
|
+
required: boolean;
|
49
|
+
default: string;
|
50
|
+
type: StringConstructor;
|
51
|
+
};
|
52
|
+
};
|
53
|
+
export declare const ariaLabel: {
|
54
|
+
ariaLabel: {
|
55
|
+
required: boolean;
|
56
|
+
default: string;
|
57
|
+
type: StringConstructor;
|
58
|
+
};
|
59
|
+
};
|
60
|
+
export declare const checked: {
|
61
|
+
checked: {
|
62
|
+
required: boolean;
|
63
|
+
default: boolean;
|
64
|
+
type: BooleanConstructor;
|
65
|
+
};
|
66
|
+
};
|
67
|
+
export declare const error: {
|
68
|
+
error: {
|
69
|
+
required: boolean;
|
70
|
+
default: string;
|
71
|
+
type: StringConstructor;
|
72
|
+
};
|
73
|
+
};
|
74
|
+
export declare const placeholder: (def?: string) => {
|
75
|
+
placeholder: {
|
76
|
+
required: boolean;
|
77
|
+
default: string;
|
78
|
+
type: StringConstructor;
|
79
|
+
};
|
80
|
+
};
|
81
|
+
export declare const title: (def?: string) => {
|
82
|
+
title: {
|
83
|
+
required: boolean;
|
84
|
+
default: string;
|
85
|
+
type: StringConstructor;
|
86
|
+
};
|
87
|
+
};
|
88
|
+
export declare const text: (def?: string) => {
|
89
|
+
text: {
|
90
|
+
required: boolean;
|
91
|
+
default: string;
|
92
|
+
type: StringConstructor;
|
93
|
+
};
|
94
|
+
};
|
95
|
+
export declare const name: {
|
96
|
+
name: {
|
97
|
+
required: boolean;
|
98
|
+
type: StringConstructor;
|
99
|
+
default: string;
|
100
|
+
};
|
101
|
+
};
|
102
|
+
export declare const hashColor: {
|
103
|
+
color: {
|
104
|
+
required: boolean;
|
105
|
+
type: StringConstructor;
|
106
|
+
default: string;
|
107
|
+
};
|
108
|
+
};
|
109
|
+
export declare const intSize: (def?: number) => {
|
110
|
+
size: {
|
111
|
+
required: boolean;
|
112
|
+
type: NumberConstructor;
|
113
|
+
default: number;
|
114
|
+
};
|
115
|
+
};
|
116
|
+
export declare const stroke: (def?: number | null) => {
|
117
|
+
stroke: {
|
118
|
+
required: boolean;
|
119
|
+
type: (NumberConstructor | null)[];
|
120
|
+
default: number | null;
|
121
|
+
};
|
122
|
+
};
|
123
|
+
export declare const icon: {
|
124
|
+
icon: {
|
125
|
+
required: boolean;
|
126
|
+
default: string;
|
127
|
+
type: StringConstructor;
|
128
|
+
};
|
129
|
+
};
|
130
|
+
export declare const options: {
|
131
|
+
options: {
|
132
|
+
required: boolean;
|
133
|
+
default: never[];
|
134
|
+
type: {
|
135
|
+
(arrayLength: number): object[];
|
136
|
+
(...items: object[]): object[];
|
137
|
+
new (arrayLength: number): object[];
|
138
|
+
new (...items: object[]): object[];
|
139
|
+
isArray(arg: any): arg is any[];
|
140
|
+
readonly prototype: any[];
|
141
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
142
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
143
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
144
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
145
|
+
of<T>(...items: T[]): T[];
|
146
|
+
readonly [Symbol.species]: ArrayConstructor;
|
147
|
+
};
|
148
|
+
};
|
149
|
+
loadingOptions: {
|
150
|
+
required: boolean;
|
151
|
+
default: boolean;
|
152
|
+
type: BooleanConstructor;
|
153
|
+
};
|
154
|
+
};
|
155
|
+
export declare const value: () => {
|
156
|
+
value: {
|
157
|
+
required: boolean;
|
158
|
+
default: string;
|
159
|
+
type: StringConstructor;
|
160
|
+
};
|
161
|
+
};
|
@@ -0,0 +1,147 @@
|
|
1
|
+
export const color = (def = "green") => ({
|
2
|
+
color: {
|
3
|
+
required: false,
|
4
|
+
default: def,
|
5
|
+
type: String
|
6
|
+
}
|
7
|
+
});
|
8
|
+
export const size = (def = "md") => ({
|
9
|
+
size: {
|
10
|
+
required: false,
|
11
|
+
default: def,
|
12
|
+
type: String
|
13
|
+
}
|
14
|
+
});
|
15
|
+
export const rounded = {
|
16
|
+
size: {
|
17
|
+
required: false,
|
18
|
+
default: "md",
|
19
|
+
type: String
|
20
|
+
}
|
21
|
+
};
|
22
|
+
export const disabled = {
|
23
|
+
disabled: {
|
24
|
+
required: false,
|
25
|
+
default: false,
|
26
|
+
type: Boolean
|
27
|
+
}
|
28
|
+
};
|
29
|
+
export const loading = {
|
30
|
+
loading: {
|
31
|
+
required: false,
|
32
|
+
default: false,
|
33
|
+
type: Boolean
|
34
|
+
},
|
35
|
+
loadingOption: {
|
36
|
+
required: false,
|
37
|
+
default: {
|
38
|
+
color: "green"
|
39
|
+
},
|
40
|
+
type: {
|
41
|
+
color: String
|
42
|
+
}
|
43
|
+
}
|
44
|
+
};
|
45
|
+
export const to = {
|
46
|
+
to: {
|
47
|
+
required: false,
|
48
|
+
default: "",
|
49
|
+
type: String
|
50
|
+
}
|
51
|
+
};
|
52
|
+
export const ariaLabel = {
|
53
|
+
ariaLabel: {
|
54
|
+
required: false,
|
55
|
+
default: "",
|
56
|
+
type: String
|
57
|
+
}
|
58
|
+
};
|
59
|
+
export const checked = {
|
60
|
+
checked: {
|
61
|
+
required: false,
|
62
|
+
default: false,
|
63
|
+
type: Boolean
|
64
|
+
}
|
65
|
+
};
|
66
|
+
export const error = {
|
67
|
+
error: {
|
68
|
+
required: false,
|
69
|
+
default: "|",
|
70
|
+
type: String
|
71
|
+
}
|
72
|
+
};
|
73
|
+
export const placeholder = (def = "") => ({
|
74
|
+
placeholder: {
|
75
|
+
required: false,
|
76
|
+
default: def,
|
77
|
+
type: String
|
78
|
+
}
|
79
|
+
});
|
80
|
+
export const title = (def = "") => ({
|
81
|
+
title: {
|
82
|
+
required: false,
|
83
|
+
default: def,
|
84
|
+
type: String
|
85
|
+
}
|
86
|
+
});
|
87
|
+
export const text = (def = "") => ({
|
88
|
+
text: {
|
89
|
+
required: false,
|
90
|
+
default: def,
|
91
|
+
type: String
|
92
|
+
}
|
93
|
+
});
|
94
|
+
export const name = {
|
95
|
+
name: {
|
96
|
+
required: true,
|
97
|
+
type: String,
|
98
|
+
default: ""
|
99
|
+
}
|
100
|
+
};
|
101
|
+
export const hashColor = {
|
102
|
+
color: {
|
103
|
+
required: false,
|
104
|
+
type: String,
|
105
|
+
default: "#000"
|
106
|
+
}
|
107
|
+
};
|
108
|
+
export const intSize = (def = 20) => ({
|
109
|
+
size: {
|
110
|
+
required: false,
|
111
|
+
type: Number,
|
112
|
+
default: def
|
113
|
+
}
|
114
|
+
});
|
115
|
+
export const stroke = (def = null) => ({
|
116
|
+
stroke: {
|
117
|
+
required: false,
|
118
|
+
type: [Number, null],
|
119
|
+
default: def
|
120
|
+
}
|
121
|
+
});
|
122
|
+
export const icon = {
|
123
|
+
icon: {
|
124
|
+
required: false,
|
125
|
+
default: "",
|
126
|
+
type: String
|
127
|
+
}
|
128
|
+
};
|
129
|
+
export const options = {
|
130
|
+
options: {
|
131
|
+
required: false,
|
132
|
+
default: [],
|
133
|
+
type: Array
|
134
|
+
},
|
135
|
+
loadingOptions: {
|
136
|
+
required: false,
|
137
|
+
default: false,
|
138
|
+
type: Boolean
|
139
|
+
}
|
140
|
+
};
|
141
|
+
export const value = () => ({
|
142
|
+
value: {
|
143
|
+
required: false,
|
144
|
+
default: "",
|
145
|
+
type: String
|
146
|
+
}
|
147
|
+
});
|
@@ -6,9 +6,10 @@ interface gloriousFetchOptions {
|
|
6
6
|
lazy?: Boolean;
|
7
7
|
headers?: Object;
|
8
8
|
body?: Object;
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
keepResponse?: Boolean;
|
10
|
+
bodyType?: 'formData' | 'formDataCustom' | 'normal';
|
11
|
+
method?: 'POST' | 'GET' | 'PATCH' | 'PUT' | 'DELETE' | 'HEAD';
|
12
|
+
credentials?: 'same-origin' | 'include';
|
12
13
|
watch?: Array<Object>;
|
13
14
|
}
|
14
15
|
export default function (url: string, options?: gloriousFetchOptions): Promise<unknown>;
|
@@ -6,6 +6,7 @@ const defaultOptions = {
|
|
6
6
|
method: "GET",
|
7
7
|
lazy: true,
|
8
8
|
is$: true,
|
9
|
+
keepResponse: false,
|
9
10
|
params: {},
|
10
11
|
headers: {
|
11
12
|
Accept: "application/json"
|
@@ -29,12 +30,11 @@ export default function(url, options = defaultOptions) {
|
|
29
30
|
} catch (e) {
|
30
31
|
}
|
31
32
|
},
|
32
|
-
onResponse({ response
|
33
|
+
onResponse({ response }) {
|
34
|
+
gs.response[gKey] = response._data;
|
33
35
|
try {
|
34
36
|
gs.loading[gKey] = false;
|
35
37
|
gs.forms[gKey].errors = [];
|
36
|
-
if (res.status >= 200 && res.status <= 299 && Object.prototype.hasOwnProperty.call(options, "saveBody") && !options.saveBody)
|
37
|
-
gs.forms[gKey].form = {};
|
38
38
|
} catch (e) {
|
39
39
|
}
|
40
40
|
},
|
@@ -55,6 +55,8 @@ export default function(url, options = defaultOptions) {
|
|
55
55
|
}
|
56
56
|
}
|
57
57
|
};
|
58
|
+
if (opt.keepResponse && !gs.keepResponse.includes(gKey))
|
59
|
+
gs.keepResponse.push(gKey);
|
58
60
|
if (opt.method === "GET" && typeof opt.body !== "undefined") {
|
59
61
|
opt.method = "POST";
|
60
62
|
return $fetch(url, opt);
|
@@ -83,9 +85,8 @@ function computeAuth() {
|
|
83
85
|
function computeFormData(options) {
|
84
86
|
const form = new FormData();
|
85
87
|
Object.entries(options.body).forEach((item) => {
|
86
|
-
console.log(item[1]);
|
87
88
|
if (item[1] === null) return;
|
88
|
-
if (typeof item[1] === "object" && typeof item[1].lastModifiedDate === "undefined" &&
|
89
|
+
if (typeof item[1] === "object" && typeof item[1].lastModifiedDate === "undefined" && typeof item[1].type === "undefined" && typeof item[1].size === "undefined")
|
89
90
|
Object.entries(item[1]).forEach((nestedItem, index) => {
|
90
91
|
form.append(`${item[0]}[${index}]`, nestedItem[1]);
|
91
92
|
});
|
@@ -1,9 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
defineNuxtRouteMiddleware,
|
4
|
-
useCookie,
|
5
|
-
useNuxtApp
|
6
|
-
} from "#imports";
|
1
|
+
import { defineNuxtRouteMiddleware, useCookie, useNuxtApp } from "#imports";
|
2
|
+
import { GloriousStore } from "../stores/GloriousStore.mjs";
|
7
3
|
export default defineNuxtRouteMiddleware(() => {
|
8
4
|
const nuxtApp = useNuxtApp();
|
9
5
|
const moduleConfig = nuxtApp.$config.public.glorious;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { defineNuxtRouteMiddleware } from "#imports";
|
2
|
+
import { GloriousStore } from "../stores/GloriousStore.mjs";
|
3
|
+
export default defineNuxtRouteMiddleware((to, from) => {
|
4
|
+
if (to.path === from.path) return;
|
5
|
+
const gs = GloriousStore();
|
6
|
+
Object.entries(gs.response).forEach((element) => {
|
7
|
+
if (!gs.keepResponse.includes(element[0])) delete gs.response[element[0]];
|
8
|
+
});
|
9
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { defineNuxtPlugin } from "#imports";
|
2
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
3
|
+
nuxtApp.hook("app:beforeMount", () => {
|
4
|
+
window.addEventListener("click", (event) => {
|
5
|
+
if (!event.target.matches(".glorious-input-field")) {
|
6
|
+
const options = document.querySelectorAll(".glorious-input-options");
|
7
|
+
options.forEach((el) => {
|
8
|
+
el.classList.add("hidden");
|
9
|
+
});
|
10
|
+
}
|
11
|
+
});
|
12
|
+
});
|
13
|
+
});
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import {
|
2
|
+
defineNuxtModule,
|
3
|
+
addPlugin,
|
4
|
+
addComponentsDir,
|
5
|
+
createResolver,
|
6
|
+
addImportsDir,
|
7
|
+
installModule,
|
8
|
+
addRouteMiddleware
|
9
|
+
} from "@nuxt/kit";
|
10
|
+
import defu from "defu";
|
11
|
+
export default defineNuxtModule({
|
12
|
+
meta: {
|
13
|
+
name: "glorious",
|
14
|
+
configKey: "glorious"
|
15
|
+
},
|
16
|
+
// Default configuration options of the Nuxt module
|
17
|
+
defaults: {},
|
18
|
+
async setup(options, nuxt) {
|
19
|
+
const resolver = createResolver(import.meta.url);
|
20
|
+
nuxt.options.runtimeConfig.public.glorious = defu(nuxt.options.glorious, {
|
21
|
+
fetch: {
|
22
|
+
baseURL: "/",
|
23
|
+
credentials: "same-origin"
|
24
|
+
},
|
25
|
+
seo: {
|
26
|
+
suffix: "",
|
27
|
+
title: "",
|
28
|
+
description: ""
|
29
|
+
},
|
30
|
+
auth: {
|
31
|
+
cookie: {
|
32
|
+
name: "ga-token",
|
33
|
+
httpOnly: false
|
34
|
+
},
|
35
|
+
redirect: {
|
36
|
+
logout: "/login",
|
37
|
+
login: "/login"
|
38
|
+
},
|
39
|
+
strategy: {
|
40
|
+
provider: "",
|
41
|
+
//[laravel-passport]
|
42
|
+
endpoints: {
|
43
|
+
userInfo: {
|
44
|
+
url: "/",
|
45
|
+
method: "GET",
|
46
|
+
pick: ""
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
});
|
52
|
+
await installModule("@nuxtjs/tailwindcss", {
|
53
|
+
// module configuration
|
54
|
+
exposeConfig: true,
|
55
|
+
config: {
|
56
|
+
darkMode: "class",
|
57
|
+
content: {
|
58
|
+
files: [
|
59
|
+
resolver.resolve("./runtime/components/G/**/*.{vue,mjs,ts}"),
|
60
|
+
resolver.resolve("./runtime/*.{mjs,js,ts}")
|
61
|
+
]
|
62
|
+
}
|
63
|
+
}
|
64
|
+
});
|
65
|
+
await installModule("@pinia/nuxt");
|
66
|
+
addImportsDir(resolver.resolve("runtime/composables"));
|
67
|
+
addImportsDir(resolver.resolve("runtime/stores"));
|
68
|
+
addImportsDir(resolver.resolve("runtime/middlewares"));
|
69
|
+
addComponentsDir({
|
70
|
+
path: resolver.resolve("runtime/components"),
|
71
|
+
global: true,
|
72
|
+
watch: false
|
73
|
+
});
|
74
|
+
nuxt.hook("nitro:config", async (nitro) => {
|
75
|
+
nitro.publicAssets.push({
|
76
|
+
dir: resolver.resolve("./runtime/assets")
|
77
|
+
});
|
78
|
+
});
|
79
|
+
addPlugin(resolver.resolve("./runtime/plugins/glorious-app-setting"));
|
80
|
+
addPlugin({
|
81
|
+
src: resolver.resolve("./runtime/plugins/InputComponent"),
|
82
|
+
mode: "client"
|
83
|
+
});
|
84
|
+
addRouteMiddleware({
|
85
|
+
name: "g-auth-strategy",
|
86
|
+
path: resolver.resolve("./runtime/middlewares/AuthStrategy"),
|
87
|
+
global: true
|
88
|
+
});
|
89
|
+
addRouteMiddleware({
|
90
|
+
name: "g-auth",
|
91
|
+
path: resolver.resolve("./runtime/middlewares/Auth")
|
92
|
+
});
|
93
|
+
}
|
94
|
+
});
|
@@ -2,7 +2,6 @@ export declare const GloriousStore: import("pinia").StoreDefinition<"GloriousSto
|
|
2
2
|
authIsLogin(): boolean;
|
3
3
|
}, {
|
4
4
|
formCreate(key: string | Array<string>): void;
|
5
|
-
modalCreate(key: string | Array<string>): void;
|
6
5
|
authLogout(): void;
|
7
6
|
authSetToken(token: string, to?: string | null): void;
|
8
7
|
authParseToken(token: any): any;
|
@@ -8,7 +8,9 @@ export const GloriousStore = defineStore("GloriousStore", {
|
|
8
8
|
},
|
9
9
|
loading: {},
|
10
10
|
keepData: {},
|
11
|
-
forms: {}
|
11
|
+
forms: {},
|
12
|
+
response: {},
|
13
|
+
keepResponse: []
|
12
14
|
}),
|
13
15
|
getters: {
|
14
16
|
authIsLogin() {
|
@@ -33,18 +35,6 @@ export const GloriousStore = defineStore("GloriousStore", {
|
|
33
35
|
};
|
34
36
|
});
|
35
37
|
},
|
36
|
-
modalCreate(key) {
|
37
|
-
this.modals = {};
|
38
|
-
const defaultValue = {
|
39
|
-
show: false,
|
40
|
-
keepData: {}
|
41
|
-
};
|
42
|
-
if (typeof key === "string") this.modals[key] = defaultValue;
|
43
|
-
else
|
44
|
-
key.map((item) => {
|
45
|
-
this.modals[item] = defaultValue;
|
46
|
-
});
|
47
|
-
},
|
48
38
|
authLogout() {
|
49
39
|
const moduleConfig = useRuntimeConfig();
|
50
40
|
const token = useCookie(moduleConfig.public.glorious.auth.cookie.name);
|
@@ -0,0 +1,33 @@
|
|
1
|
+
.glorious-alert {
|
2
|
+
@apply p-3 rounded shadow;
|
3
|
+
}
|
4
|
+
.glorious-alert.color-orange {
|
5
|
+
@apply bg-orange-100;
|
6
|
+
}
|
7
|
+
.glorious-alert.color-blue {
|
8
|
+
@apply bg-blue-100;
|
9
|
+
}
|
10
|
+
.glorious-alert.color-gray {
|
11
|
+
@apply bg-gray-100;
|
12
|
+
}
|
13
|
+
.glorious-alert.color-red {
|
14
|
+
@apply bg-red-100;
|
15
|
+
}
|
16
|
+
.glorious-alert.color-green {
|
17
|
+
@apply bg-green-100;
|
18
|
+
}
|
19
|
+
.glorious-alert.color-orange {
|
20
|
+
@apply border border-orange-300;
|
21
|
+
}
|
22
|
+
.glorious-alert.color-blue {
|
23
|
+
@apply border border-blue-300;
|
24
|
+
}
|
25
|
+
.glorious-alert.color-gray {
|
26
|
+
@apply border border-gray-300;
|
27
|
+
}
|
28
|
+
.glorious-alert.color-red {
|
29
|
+
@apply border border-red-300;
|
30
|
+
}
|
31
|
+
.glorious-alert.color-green {
|
32
|
+
@apply border border-green-300;
|
33
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
.glorious-avatar {
|
2
|
+
@apply overflow-hidden;
|
3
|
+
}
|
4
|
+
.glorious-avatar.size-5xl {
|
5
|
+
@apply w-[58px] h-[58px];
|
6
|
+
}
|
7
|
+
.glorious-avatar.size-5xl > img {
|
8
|
+
@apply w-[58px] h-[58px];
|
9
|
+
}
|
10
|
+
.glorious-avatar.size-4xl {
|
11
|
+
@apply w-[54px] h-[54px];
|
12
|
+
}
|
13
|
+
.glorious-avatar.size-4xl > img {
|
14
|
+
@apply w-[54px] h-[54px];
|
15
|
+
}
|
16
|
+
.glorious-avatar.size-3xl {
|
17
|
+
@apply w-[50px] h-[50px];
|
18
|
+
}
|
19
|
+
.glorious-avatar.size-3xl > img {
|
20
|
+
@apply w-[50px] h-[50px];
|
21
|
+
}
|
22
|
+
.glorious-avatar.size-2xl {
|
23
|
+
@apply w-[46px] h-[46px];
|
24
|
+
}
|
25
|
+
.glorious-avatar.size-2xl > img {
|
26
|
+
@apply w-[46px] h-[46px];
|
27
|
+
}
|
28
|
+
.glorious-avatar.size-xl {
|
29
|
+
@apply w-[42px] h-[42px];
|
30
|
+
}
|
31
|
+
.glorious-avatar.size-xl > img {
|
32
|
+
@apply w-[42px] h-[42px];
|
33
|
+
}
|
34
|
+
.glorious-avatar.size-lg {
|
35
|
+
@apply w-[36px] h-[36px];
|
36
|
+
}
|
37
|
+
.glorious-avatar.size-lg > img {
|
38
|
+
@apply w-[36px] h-[36px];
|
39
|
+
}
|
40
|
+
.glorious-avatar.size-md {
|
41
|
+
@apply w-[32px] h-[32px];
|
42
|
+
}
|
43
|
+
.glorious-avatar.size-md > img {
|
44
|
+
@apply w-[32px] h-[32px];
|
45
|
+
}
|
46
|
+
.glorious-avatar.size-sm {
|
47
|
+
@apply w-[28px] h-[28px];
|
48
|
+
}
|
49
|
+
.glorious-avatar.size-sm > img {
|
50
|
+
@apply w-[28px] h-[28px];
|
51
|
+
}
|
52
|
+
.glorious-avatar.size-xs {
|
53
|
+
@apply w-[24px] h-[24px];
|
54
|
+
}
|
55
|
+
.glorious-avatar.size-xs > img {
|
56
|
+
@apply w-[24px] h-[24px];
|
57
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
@use '../variable.scss' as var;
|
2
|
+
|
3
|
+
.glorious-avatar {
|
4
|
+
@apply overflow-hidden;
|
5
|
+
@each $key, $value in var.$sizes {
|
6
|
+
&.#{'size-' + $key} {
|
7
|
+
@apply #{"w-[" + ($value + 4 ) + "px] h-[" + ($value + 4 ) + "px]"};
|
8
|
+
> img {
|
9
|
+
@apply #{"w-[" + ($value + 4 ) + "px] h-[" + ($value + 4 ) + "px]"};
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|