nuxt-glorious 2.0.0-develop-32 → 2.0.0-develop-34
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 +4 -183
- package/dist/module.d.ts +4 -183
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -0
- package/dist/runtime/components/Button.vue +65 -0
- package/dist/runtime/components/Checkbox.vue +46 -0
- package/dist/runtime/components/{G/ErrorText.vue → ErrorText.vue} +7 -5
- package/dist/runtime/components/G/Tooltip.vue +17 -17
- package/dist/runtime/components/{G/Icon.vue → Icon.vue} +39 -9
- package/dist/runtime/components/Input.vue +69 -0
- package/dist/runtime/components/InputPassword.vue +42 -0
- package/dist/runtime/components/Loading.vue +22 -0
- package/dist/runtime/components/props/Icon.d.ts +0 -20
- package/dist/runtime/components/props/Icon.mjs +1 -5
- package/dist/runtime/composables/helper/useGloriousFetch/gloriousFetchOptionsInterface.d.ts +15 -15
- package/dist/runtime/middlewares/AuthStrategy.mjs +9 -1
- package/dist/runtime/style/style.css +350 -1303
- package/package.json +4 -3
- package/dist/runtime/components/G/Button.vue +0 -43
- package/dist/runtime/components/G/Checkbox.vue +0 -28
- package/dist/runtime/components/G/Input.vue +0 -280
- package/dist/runtime/components/G/Loading.vue +0 -22
- package/dist/runtime/components/props/Button.d.ts +0 -52
- package/dist/runtime/components/props/Button.mjs +0 -20
- package/dist/runtime/components/props/Input.d.ts +0 -125
- package/dist/runtime/components/props/Input.mjs +0 -60
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { colorType, sizeType } from '~/src/types/props'
|
|
3
|
+
|
|
4
|
+
interface inputPropInterface {
|
|
5
|
+
color?: colorType
|
|
6
|
+
size?: sizeType
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
title?: string
|
|
9
|
+
placeholder?: string
|
|
10
|
+
error?: string
|
|
11
|
+
type?: string
|
|
12
|
+
icon?: string
|
|
13
|
+
iconColor?: string
|
|
14
|
+
iconPos?: 'right' | 'left'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const props: any = withDefaults(defineProps<inputPropInterface>(), {
|
|
18
|
+
color: 'primary',
|
|
19
|
+
size: 'md',
|
|
20
|
+
disabled: false,
|
|
21
|
+
title: '',
|
|
22
|
+
placeholder: '',
|
|
23
|
+
error: '|',
|
|
24
|
+
type: 'text',
|
|
25
|
+
icon: '',
|
|
26
|
+
iconPos: 'right',
|
|
27
|
+
iconColor: '#000',
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const emits = defineEmits(['iconClicked'])
|
|
31
|
+
const hasIcon = () => typeof props.icon !== 'undefined'
|
|
32
|
+
const iconClicked = () => emits('iconClicked')
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div class="glorious-input">
|
|
37
|
+
<span
|
|
38
|
+
v-if="props.title"
|
|
39
|
+
class="title"
|
|
40
|
+
>
|
|
41
|
+
{{ props.title }}
|
|
42
|
+
</span>
|
|
43
|
+
<div class="input-content">
|
|
44
|
+
<GIcon
|
|
45
|
+
v-if="hasIcon"
|
|
46
|
+
class="icon"
|
|
47
|
+
:class="[`icon-${props.iconPos}`]"
|
|
48
|
+
:size="props.size"
|
|
49
|
+
:color="props.iconColor"
|
|
50
|
+
:name="props.icon"
|
|
51
|
+
@click="iconClicked()"
|
|
52
|
+
/>
|
|
53
|
+
<input
|
|
54
|
+
:class="[
|
|
55
|
+
`color-${props.color}`,
|
|
56
|
+
`size-${props.size}`,
|
|
57
|
+
props.error !== '|' ? 'error' : '',
|
|
58
|
+
]"
|
|
59
|
+
:disabled="props.disabled"
|
|
60
|
+
:placeholder="props.placeholder"
|
|
61
|
+
:type="props.type"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
<GErrorText
|
|
65
|
+
v-if="props.error !== '|'"
|
|
66
|
+
:error="props.error"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { colorType, sizeType } from '~/src/types/props'
|
|
3
|
+
|
|
4
|
+
interface inputPropInterface {
|
|
5
|
+
color?: colorType
|
|
6
|
+
size?: sizeType
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
title?: string
|
|
9
|
+
placeholder?: string
|
|
10
|
+
error?: string
|
|
11
|
+
type?: string
|
|
12
|
+
iconColor?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props: any = withDefaults(defineProps<inputPropInterface>(), {
|
|
16
|
+
color: 'primary',
|
|
17
|
+
size: 'md',
|
|
18
|
+
disabled: false,
|
|
19
|
+
title: '',
|
|
20
|
+
placeholder: '',
|
|
21
|
+
error: '|',
|
|
22
|
+
type: 'password',
|
|
23
|
+
iconColor: '#000',
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const isPassword = ref(true)
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<GInput
|
|
31
|
+
:icon="isPassword ? 'glorious-eye-fill' : 'glorious-eye-off-fill'"
|
|
32
|
+
:type="isPassword ? 'text' : 'password'"
|
|
33
|
+
@icon-clicked="isPassword = !isPassword"
|
|
34
|
+
:color="props.color"
|
|
35
|
+
:size="props.size"
|
|
36
|
+
:disabled="props.disabled"
|
|
37
|
+
:title="props.title"
|
|
38
|
+
:placeholder="props.placeholder"
|
|
39
|
+
:error="props.error"
|
|
40
|
+
:icon-color="props.iconColor"
|
|
41
|
+
/>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { colorType, sizeType } from '~/src/types/props'
|
|
3
|
+
|
|
4
|
+
interface loadingPropInterface {
|
|
5
|
+
color?: colorType
|
|
6
|
+
size?: sizeType
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props: any = withDefaults(defineProps<loadingPropInterface>(), {
|
|
10
|
+
color: 'primary',
|
|
11
|
+
size: 'md',
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="inline">
|
|
17
|
+
<div
|
|
18
|
+
class="glorious-loading"
|
|
19
|
+
:class="[`color-${props.color}`, `size-${props.size}`]"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -3,25 +3,5 @@ declare const _default: {
|
|
|
3
3
|
required: boolean;
|
|
4
4
|
default: string;
|
|
5
5
|
};
|
|
6
|
-
stroke: {
|
|
7
|
-
required: boolean;
|
|
8
|
-
type: (NumberConstructor | null)[];
|
|
9
|
-
default: number | null;
|
|
10
|
-
};
|
|
11
|
-
size: {
|
|
12
|
-
required: boolean;
|
|
13
|
-
type: NumberConstructor;
|
|
14
|
-
default: number;
|
|
15
|
-
};
|
|
16
|
-
color: {
|
|
17
|
-
required: boolean;
|
|
18
|
-
type: StringConstructor;
|
|
19
|
-
default: string;
|
|
20
|
-
};
|
|
21
|
-
name: {
|
|
22
|
-
required: boolean;
|
|
23
|
-
type: StringConstructor;
|
|
24
|
-
default: string;
|
|
25
|
-
};
|
|
26
6
|
};
|
|
27
7
|
export default _default;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export interface gloriousFetchOptions {
|
|
2
|
-
validationRequest?: any
|
|
3
|
-
gKey?: String
|
|
4
|
-
params?: Object
|
|
5
|
-
server?: Boolean
|
|
6
|
-
is$?: Boolean
|
|
7
|
-
lazy?: Boolean
|
|
8
|
-
headers?: Object
|
|
9
|
-
body?: Object
|
|
10
|
-
keepResponse?: Boolean
|
|
11
|
-
bodyType?: 'formData' | 'formDataCustom' | 'normal'
|
|
12
|
-
method?: 'POST' | 'GET' | 'PATCH' | 'PUT' | 'DELETE' | 'HEAD'
|
|
13
|
-
credentials?: 'same-origin' | 'include'
|
|
14
|
-
watch?: Array<Object>
|
|
15
|
-
}
|
|
1
|
+
export interface gloriousFetchOptions {
|
|
2
|
+
validationRequest?: any
|
|
3
|
+
gKey?: String
|
|
4
|
+
params?: Object
|
|
5
|
+
server?: Boolean
|
|
6
|
+
is$?: Boolean
|
|
7
|
+
lazy?: Boolean
|
|
8
|
+
headers?: Object
|
|
9
|
+
body?: Object
|
|
10
|
+
keepResponse?: Boolean
|
|
11
|
+
bodyType?: 'formData' | 'formDataCustom' | 'normal'
|
|
12
|
+
method?: 'POST' | 'GET' | 'PATCH' | 'PUT' | 'DELETE' | 'HEAD'
|
|
13
|
+
credentials?: 'same-origin' | 'include'
|
|
14
|
+
watch?: Array<Object>
|
|
15
|
+
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { defineNuxtRouteMiddleware } from "#imports";
|
|
1
|
+
import { defineNuxtRouteMiddleware, useCookie, useNuxtApp } from "#imports";
|
|
2
|
+
import { GloriousStore } from "../stores/GloriousStore.mjs";
|
|
2
3
|
export default defineNuxtRouteMiddleware(() => {
|
|
4
|
+
const nuxtApp = useNuxtApp();
|
|
5
|
+
const moduleConfig = nuxtApp.$config.public.glorious;
|
|
6
|
+
const gs = GloriousStore();
|
|
7
|
+
if (moduleConfig.auth.strategy.provider === "") return;
|
|
8
|
+
const cookieToken = useCookie(moduleConfig.auth.cookie.name);
|
|
9
|
+
if (typeof cookieToken.value === "undefined") return;
|
|
10
|
+
nuxtApp.hook("app:beforeMount", () => gs.authGetUser(cookieToken.value));
|
|
3
11
|
});
|