nuxt-glorious 2.0.0-develop-33 → 2.0.0-develop-35

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.
Files changed (32) hide show
  1. package/dist/module.d.mts +4 -183
  2. package/dist/module.d.ts +4 -183
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +7 -0
  5. package/dist/runtime/components/Button.vue +65 -0
  6. package/dist/runtime/components/Checkbox.vue +46 -0
  7. package/dist/runtime/components/{G/ErrorText.vue → ErrorText.vue} +7 -5
  8. package/dist/runtime/components/G/Tooltip.vue +17 -17
  9. package/dist/runtime/components/{G/Icon.vue → Icon.vue} +39 -9
  10. package/dist/runtime/components/Input.vue +69 -0
  11. package/dist/runtime/components/InputPassword.vue +42 -0
  12. package/dist/runtime/components/Loading.vue +22 -0
  13. package/dist/runtime/components/props/Icon.d.ts +0 -20
  14. package/dist/runtime/components/props/Icon.mjs +1 -5
  15. package/dist/runtime/composables/helper/useGloriousFetch/gloriousFetchOptionsInterface.d.ts +15 -15
  16. package/dist/runtime/middlewares/AuthStrategy.mjs +9 -1
  17. package/dist/runtime/middlewares/LoadColor.d.ts +2 -0
  18. package/dist/runtime/middlewares/LoadColor.mjs +21 -0
  19. package/dist/runtime/plugins/tailwindColor.d.ts +0 -0
  20. package/dist/runtime/plugins/tailwindColor.mjs +0 -0
  21. package/dist/runtime/stores/GloriousStore.d.ts +38 -5
  22. package/dist/runtime/stores/GloriousStore.mjs +12 -1
  23. package/dist/runtime/style/style.css +350 -1303
  24. package/package.json +4 -3
  25. package/dist/runtime/components/G/Button.vue +0 -43
  26. package/dist/runtime/components/G/Checkbox.vue +0 -28
  27. package/dist/runtime/components/G/Input.vue +0 -280
  28. package/dist/runtime/components/G/Loading.vue +0 -22
  29. package/dist/runtime/components/props/Button.d.ts +0 -52
  30. package/dist/runtime/components/props/Button.mjs +0 -20
  31. package/dist/runtime/components/props/Input.d.ts +0 -125
  32. 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,8 +1,4 @@
1
- import { name, hashColor, intSize, stroke, hoverColor } from "./common/index.mjs";
1
+ import { hoverColor } from "./common/index.mjs";
2
2
  export default {
3
- ...name,
4
- ...hashColor,
5
- ...intSize(),
6
- ...stroke(),
7
3
  ...hoverColor()
8
4
  };
@@ -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
  });
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { defineNuxtRouteMiddleware, useNuxtApp } from "#imports";
2
+ import { GloriousStore } from "../stores/GloriousStore.mjs";
3
+ import colors from "tailwindcss/colors";
4
+ export default defineNuxtRouteMiddleware(() => {
5
+ const nuxtApp = useNuxtApp();
6
+ const gs = GloriousStore();
7
+ nuxtApp.hook("app:mounted", () => {
8
+ const styles = getComputedStyle(document.documentElement);
9
+ let colorVars = {};
10
+ for (let i = 0; i < styles.length; i++) {
11
+ const name = styles[i];
12
+ if (name.startsWith("--color-")) {
13
+ colorVars[name] = styles.getPropertyValue(name).trim();
14
+ }
15
+ }
16
+ gs.ui.colors = {
17
+ tailwind: colors,
18
+ dom: colorVars
19
+ };
20
+ });
21
+ });
File without changes
File without changes
@@ -1,9 +1,42 @@
1
- export declare const GloriousStore: import("pinia").StoreDefinition<"GloriousStore", any, {
1
+ interface AuthState {
2
+ loaded: boolean;
3
+ user: Record<string, any>;
4
+ }
5
+ interface UIColors {
6
+ dom: Record<string, string>;
7
+ tailwind: Record<string, string | Record<string, string>>;
8
+ }
9
+ interface UIState {
10
+ colors: UIColors;
11
+ isDark: boolean;
12
+ }
13
+ interface FormsState {
14
+ [key: string]: {
15
+ form: Record<string, any>;
16
+ errors: any[];
17
+ };
18
+ }
19
+ interface GloriousState {
20
+ auth: AuthState;
21
+ loading: Record<string, any>;
22
+ keepData: Record<string, any>;
23
+ forms: FormsState;
24
+ response: Record<string, any>;
25
+ modals: Record<string, any>;
26
+ keepResponse: any[];
27
+ ui: UIState;
28
+ }
29
+ interface GloriousGetters {
30
+ [key: string]: (...args: any[]) => any;
2
31
  authIsLogin(): boolean;
3
- }, {
4
- formCreate(key: string | Array<string>): void;
32
+ }
33
+ interface GloriousActions {
34
+ tc(color: string): string | undefined;
35
+ formCreate(key: string | string[]): void;
5
36
  authLogout(): void;
6
37
  authSetToken(token: string, to?: string | null): void;
7
- authParseToken(token: any): any;
38
+ authParseToken(token: string): any;
8
39
  authGetUser(token?: string): void;
9
- }>;
40
+ }
41
+ export declare const GloriousStore: import("pinia").StoreDefinition<"GloriousStore", GloriousState, GloriousGetters, GloriousActions>;
42
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { defineStore } from "pinia";
2
2
  import { navigateTo, useCookie, useRuntimeConfig, useFetch } from "#imports";
3
+ import { default as loadColor } from "../../scripts/store/tc";
3
4
  export const GloriousStore = defineStore("GloriousStore", {
4
5
  state: () => ({
5
6
  auth: {
@@ -11,7 +12,14 @@ export const GloriousStore = defineStore("GloriousStore", {
11
12
  forms: {},
12
13
  response: {},
13
14
  modals: {},
14
- keepResponse: []
15
+ keepResponse: [],
16
+ ui: {
17
+ colors: {
18
+ dom: {},
19
+ tailwind: {}
20
+ },
21
+ isDark: false
22
+ }
15
23
  }),
16
24
  getters: {
17
25
  authIsLogin() {
@@ -21,6 +29,9 @@ export const GloriousStore = defineStore("GloriousStore", {
21
29
  }
22
30
  },
23
31
  actions: {
32
+ tc(color) {
33
+ return loadColor(color, this);
34
+ },
24
35
  formCreate(key) {
25
36
  this.forms = {};
26
37
  if (typeof key === "string")