pukaad-ui-lib 1.434.0 → 1.436.0
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 +1 -1
- package/dist/runtime/assets/css/core.css +1 -1
- package/dist/runtime/components/chat/chat-conversation-item.d.vue.ts +2 -2
- package/dist/runtime/components/chat/chat-conversation-item.vue.d.ts +2 -2
- package/dist/runtime/components/chip.d.vue.ts +4 -2
- package/dist/runtime/components/chip.vue +5 -2
- package/dist/runtime/components/chip.vue.d.ts +4 -2
- package/dist/runtime/components/input/input-autocomplete.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-birth-date.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-birth-date.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-date-picker.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-date-picker.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-localized-name.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-tag-modal.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-tag-modal.vue.d.ts +1 -1
- package/dist/runtime/components/input/input-tag.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-tag.vue.d.ts +1 -1
- package/dist/runtime/components/ui/badge/index.d.ts +1 -1
- package/dist/runtime/components/ui/badge/index.js +2 -0
- package/dist/runtime/composables/useSso.d.ts +15 -0
- package/dist/runtime/composables/useSso.js +85 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "tailwindcss";@import "tw-animate-css";@import "./system.css";@import "./scroll-bar.css";@custom-variant dark (&:is(.dark *));@theme inline{--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary-foreground:var(--primary-foreground);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--color-sidebar:var(--sidebar);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-border:var(--sidebar-border);--color-sidebar-ring:var(--sidebar-ring);--color-red:var(--red);--color-error:var(--error);--color-success:var(--success);--color-green:var(--green);--color-warning:var(--warning);--color-yellow:var(--yellow);--color-pink:var(--pink);--color-primary:var(--primary);--color-secondary:var(--secondary);--color-info:var(--info);--color-info-foreground:var(--info-foreground);--color-black:var(--black);--color-dark:var(--dark);--color-gray:var(--gray);--color-cloud:var(--cloud);--color-mercury:var(--mercury);--color-green-light:var(--green-light);--color-red-light:var(--red-light);--color-yellow-light:var(--yellow-light);--color-bright:var(--bright);--color-silver:var(--silver);--color-smoke:var(--smoke);--z-index-content:10;--z-index-navbar:11;--z-index-dropdown:12;--z-index-overlay:13;--z-index-loading:14;--z-index-drawer:15;--z-index-modal:16;--z-index-toast:100;--z-index-loading-page:101}:root{--radius:0.625rem;--red:#b71c1c;--success:#43a047;--green:#1b5e20;--warning:#f9a825;--yellow:#fbc02d;--info:#e3f2fd;--info-foreground:var(--primary);--black:#212121;--dark:#424242;--gray:#616161;--cloud:#c4c4c4;--mercury:#e0e0e0;--green-light:#e3f5e3;--red-light:#fde3e3;--yellow-light:#fef3c7;--bright:#f5f5f5;--silver:#f7f7f7;--smoke:#fafafa;--white:#fff;--pink:#ffe6f4;--background:var(--white);--foreground:var(--black);--card:var(--background);--card-foreground:var(--foreground);--popover:var(--background);--popover-foreground:var(--foreground);--primary:#1976b8;--primary-foreground:var(--white);--secondary:#22a7ef;--secondary-foreground:var(--white);--muted:oklch(0.97 0 0);--muted-foreground:var(--cloud);--accent:oklch(0.97 0 0);--accent-foreground:oklch(0.205 0 0);--destructive:#d32f2f;--destructive-foreground:var(--white);--border:var(--color-mercury);--input:var(--color-mercury);--ring:var(--mercury);--chart-1:oklch(0.646 0.222 41.116);--chart-2:oklch(0.6 0.118 184.704);--chart-3:oklch(0.398 0.07 227.392);--chart-4:oklch(0.828 0.189 84.429);--chart-5:oklch(0.769 0.188 70.08);--sidebar:oklch(0.985 0 0);--sidebar-foreground:var(--foreground);--sidebar-primary:oklch(0.205 0 0);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.97 0 0);--sidebar-accent-foreground:oklch(0.205 0 0);--sidebar-border:var(--color-mercury);--sidebar-ring:var(--color-mercury)}.dark{--background:oklch(0.145 0 0);--foreground:oklch(0.985 0 0);--card:oklch(0.145 0 0);--card-foreground:oklch(0.985 0 0);--popover:oklch(0.145 0 0);--popover-foreground:oklch(0.985 0 0);--primary:oklch(0.985 0 0);--primary-foreground:oklch(0.205 0 0);--secondary:oklch(0.269 0 0);--secondary-foreground:oklch(0.985 0 0);--muted:oklch(0.269 0 0);--muted-foreground:oklch(0.708 0 0);--accent:oklch(0.269 0 0);--accent-foreground:oklch(0.985 0 0);--destructive:oklch(0.396 0.141 25.723);--destructive-foreground:oklch(0.637 0.237 25.331);--border:oklch(0.269 0 0);--input:oklch(0.269 0 0);--ring:oklch(0.439 0 0);--chart-1:oklch(0.488 0.243 264.376);--chart-2:oklch(0.696 0.17 162.48);--chart-3:oklch(0.769 0.188 70.08);--chart-4:oklch(0.627 0.265 303.9);--chart-5:oklch(0.645 0.246 16.439);--sidebar:oklch(0.205 0 0);--sidebar-foreground:oklch(0.985 0 0);--sidebar-primary:oklch(0.488 0.243 264.376);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.269 0 0);--sidebar-accent-foreground:oklch(0.985 0 0);--sidebar-border:oklch(0.269 0 0);--sidebar-ring:oklch(0.439 0 0)}@layer base{*{@apply border-border outline-ring/50}body{@apply bg-background text-foreground}}
|
|
1
|
+
@import "tailwindcss";@import "tw-animate-css";@import "./system.css";@import "./scroll-bar.css";@custom-variant dark (&:is(.dark *));@theme inline{--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary-foreground:var(--primary-foreground);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--color-sidebar:var(--sidebar);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-border:var(--sidebar-border);--color-sidebar-ring:var(--sidebar-ring);--color-red:var(--red);--color-error:var(--error);--color-success:var(--success);--color-green:var(--green);--color-warning:var(--warning);--color-yellow:var(--yellow);--color-pink:var(--pink);--color-primary:var(--primary);--color-secondary:var(--secondary);--color-info:var(--info);--color-info-foreground:var(--info-foreground);--color-black:var(--black);--color-dark:var(--dark);--color-gray:var(--gray);--color-cloud:var(--cloud);--color-mercury:var(--mercury);--color-green-light:var(--green-light);--color-red-light:var(--red-light);--color-yellow-light:var(--yellow-light);--color-bright:var(--bright);--color-silver:var(--silver);--color-smoke:var(--smoke);--color-orange:var(--orange);--color-orange-info:var(--orange-info);--z-index-content:10;--z-index-navbar:11;--z-index-dropdown:12;--z-index-overlay:13;--z-index-loading:14;--z-index-drawer:15;--z-index-modal:16;--z-index-toast:100;--z-index-loading-page:101}:root{--radius:0.625rem;--red:#b71c1c;--success:#43a047;--green:#1b5e20;--warning:#f9a825;--yellow:#fbc02d;--info:#e3f2fd;--info-foreground:var(--primary);--black:#212121;--dark:#424242;--gray:#616161;--cloud:#c4c4c4;--mercury:#e0e0e0;--green-light:#e3f5e3;--red-light:#fde3e3;--yellow-light:#fef3c7;--bright:#f5f5f5;--silver:#f7f7f7;--smoke:#fafafa;--white:#fff;--pink:#ffe6f4;--orange:#ed4d2d;--orange-info:#ffdac3;--background:var(--white);--foreground:var(--black);--card:var(--background);--card-foreground:var(--foreground);--popover:var(--background);--popover-foreground:var(--foreground);--primary:#1976b8;--primary-foreground:var(--white);--secondary:#22a7ef;--secondary-foreground:var(--white);--muted:oklch(0.97 0 0);--muted-foreground:var(--cloud);--accent:oklch(0.97 0 0);--accent-foreground:oklch(0.205 0 0);--destructive:#d32f2f;--destructive-foreground:var(--white);--border:var(--color-mercury);--input:var(--color-mercury);--ring:var(--mercury);--chart-1:oklch(0.646 0.222 41.116);--chart-2:oklch(0.6 0.118 184.704);--chart-3:oklch(0.398 0.07 227.392);--chart-4:oklch(0.828 0.189 84.429);--chart-5:oklch(0.769 0.188 70.08);--sidebar:oklch(0.985 0 0);--sidebar-foreground:var(--foreground);--sidebar-primary:oklch(0.205 0 0);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.97 0 0);--sidebar-accent-foreground:oklch(0.205 0 0);--sidebar-border:var(--color-mercury);--sidebar-ring:var(--color-mercury)}.dark{--background:oklch(0.145 0 0);--foreground:oklch(0.985 0 0);--card:oklch(0.145 0 0);--card-foreground:oklch(0.985 0 0);--popover:oklch(0.145 0 0);--popover-foreground:oklch(0.985 0 0);--primary:oklch(0.985 0 0);--primary-foreground:oklch(0.205 0 0);--secondary:oklch(0.269 0 0);--secondary-foreground:oklch(0.985 0 0);--muted:oklch(0.269 0 0);--muted-foreground:oklch(0.708 0 0);--accent:oklch(0.269 0 0);--accent-foreground:oklch(0.985 0 0);--destructive:oklch(0.396 0.141 25.723);--destructive-foreground:oklch(0.637 0.237 25.331);--border:oklch(0.269 0 0);--input:oklch(0.269 0 0);--ring:oklch(0.439 0 0);--chart-1:oklch(0.488 0.243 264.376);--chart-2:oklch(0.696 0.17 162.48);--chart-3:oklch(0.769 0.188 70.08);--chart-4:oklch(0.627 0.265 303.9);--chart-5:oklch(0.645 0.246 16.439);--sidebar:oklch(0.205 0 0);--sidebar-foreground:oklch(0.985 0 0);--sidebar-primary:oklch(0.488 0.243 264.376);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.269 0 0);--sidebar-accent-foreground:oklch(0.985 0 0);--sidebar-border:oklch(0.269 0 0);--sidebar-ring:oklch(0.439 0 0)}@layer base{*{@apply border-border outline-ring/50}body{@apply bg-background text-foreground}}
|
|
@@ -27,12 +27,12 @@ declare const __VLS_export: import("vue").DefineComponent<ChatConversationItemPr
|
|
|
27
27
|
avatar: string | null;
|
|
28
28
|
muted: boolean;
|
|
29
29
|
disabledMenu: boolean;
|
|
30
|
+
unreadCount: number;
|
|
31
|
+
pinned: boolean;
|
|
30
32
|
preview: string;
|
|
31
33
|
to: string;
|
|
32
34
|
active: boolean;
|
|
33
35
|
typing: boolean;
|
|
34
|
-
unreadCount: number;
|
|
35
|
-
pinned: boolean;
|
|
36
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
37
|
declare const _default: typeof __VLS_export;
|
|
38
38
|
export default _default;
|
|
@@ -27,12 +27,12 @@ declare const __VLS_export: import("vue").DefineComponent<ChatConversationItemPr
|
|
|
27
27
|
avatar: string | null;
|
|
28
28
|
muted: boolean;
|
|
29
29
|
disabledMenu: boolean;
|
|
30
|
+
unreadCount: number;
|
|
31
|
+
pinned: boolean;
|
|
30
32
|
preview: string;
|
|
31
33
|
to: string;
|
|
32
34
|
active: boolean;
|
|
33
35
|
typing: boolean;
|
|
34
|
-
unreadCount: number;
|
|
35
|
-
pinned: boolean;
|
|
36
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
37
|
declare const _default: typeof __VLS_export;
|
|
38
38
|
export default _default;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
1
|
+
import type { HTMLAttributes } from "vue";
|
|
2
|
+
export type ChipColor = "default" | "primary" | "success" | "warning" | "orange" | "gray" | "error" | "bright" | "outline";
|
|
3
|
+
export interface ChipProps {
|
|
4
|
+
class?: HTMLAttributes["class"];
|
|
3
5
|
color?: ChipColor;
|
|
4
6
|
closable?: boolean;
|
|
5
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Badge :variant="variant" class="gap-1">
|
|
2
|
+
<Badge :variant="variant" :class="['gap-1', props.class]">
|
|
3
3
|
<slot name="default" />
|
|
4
4
|
<div
|
|
5
5
|
v-if="props.closable"
|
|
@@ -16,6 +16,7 @@ import { computed } from "vue";
|
|
|
16
16
|
import Badge from "#pukaad-ui/runtime/components/ui/badge/Badge.vue";
|
|
17
17
|
const emit = defineEmits(["closable"]);
|
|
18
18
|
const props = defineProps({
|
|
19
|
+
class: { type: null, required: false },
|
|
19
20
|
color: { type: String, required: false, default: "default" },
|
|
20
21
|
closable: { type: Boolean, required: false, default: false }
|
|
21
22
|
});
|
|
@@ -25,10 +26,12 @@ const variant = computed(() => {
|
|
|
25
26
|
primary: "primary",
|
|
26
27
|
success: "success",
|
|
27
28
|
warning: "warning",
|
|
29
|
+
orange: "orange",
|
|
30
|
+
gray: "gray",
|
|
28
31
|
error: "destructive",
|
|
29
32
|
bright: "bright",
|
|
30
33
|
outline: "outline"
|
|
31
34
|
};
|
|
32
|
-
return colorToVariant[props.color];
|
|
35
|
+
return colorToVariant[props.color] || "default";
|
|
33
36
|
});
|
|
34
37
|
</script>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
1
|
+
import type { HTMLAttributes } from "vue";
|
|
2
|
+
export type ChipColor = "default" | "primary" | "success" | "warning" | "orange" | "gray" | "error" | "bright" | "outline";
|
|
3
|
+
export interface ChipProps {
|
|
4
|
+
class?: HTMLAttributes["class"];
|
|
3
5
|
color?: ChipColor;
|
|
4
6
|
closable?: boolean;
|
|
5
7
|
}
|
|
@@ -69,9 +69,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
69
69
|
name: string;
|
|
70
70
|
required: boolean;
|
|
71
71
|
description: string;
|
|
72
|
-
options: AutocompleteOption[] | string[] | number[];
|
|
73
72
|
labelKey: string;
|
|
74
73
|
placeholder: string;
|
|
74
|
+
options: AutocompleteOption[] | string[] | number[];
|
|
75
75
|
limit: number;
|
|
76
76
|
disabledErrorMessage: boolean;
|
|
77
77
|
disabledBorder: boolean;
|
|
@@ -69,9 +69,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
69
69
|
name: string;
|
|
70
70
|
required: boolean;
|
|
71
71
|
description: string;
|
|
72
|
-
options: AutocompleteOption[] | string[] | number[];
|
|
73
72
|
labelKey: string;
|
|
74
73
|
placeholder: string;
|
|
74
|
+
options: AutocompleteOption[] | string[] | number[];
|
|
75
75
|
limit: number;
|
|
76
76
|
disabledErrorMessage: boolean;
|
|
77
77
|
disabledBorder: boolean;
|
|
@@ -30,9 +30,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
30
30
|
id: string;
|
|
31
31
|
name: string;
|
|
32
32
|
required: boolean;
|
|
33
|
-
layout: "month-and-year" | "month-only" | "year-only";
|
|
34
33
|
locale: string;
|
|
35
34
|
placeholder: string;
|
|
35
|
+
layout: "month-and-year" | "month-only" | "year-only";
|
|
36
36
|
disabledErrorMessage: boolean;
|
|
37
37
|
dateFormat: string;
|
|
38
38
|
minAge: number;
|
|
@@ -30,9 +30,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
30
30
|
id: string;
|
|
31
31
|
name: string;
|
|
32
32
|
required: boolean;
|
|
33
|
-
layout: "month-and-year" | "month-only" | "year-only";
|
|
34
33
|
locale: string;
|
|
35
34
|
placeholder: string;
|
|
35
|
+
layout: "month-and-year" | "month-only" | "year-only";
|
|
36
36
|
disabledErrorMessage: boolean;
|
|
37
37
|
dateFormat: string;
|
|
38
38
|
minAge: number;
|
|
@@ -44,9 +44,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
44
44
|
id: string;
|
|
45
45
|
name: string;
|
|
46
46
|
required: boolean;
|
|
47
|
-
layout: "month-and-year" | "month-only" | "year-only";
|
|
48
47
|
locale: string;
|
|
49
48
|
placeholder: string;
|
|
49
|
+
layout: "month-and-year" | "month-only" | "year-only";
|
|
50
50
|
disabledErrorMessage: boolean;
|
|
51
51
|
dateFormat: string;
|
|
52
52
|
showTime: boolean;
|
|
@@ -44,9 +44,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
44
44
|
id: string;
|
|
45
45
|
name: string;
|
|
46
46
|
required: boolean;
|
|
47
|
-
layout: "month-and-year" | "month-only" | "year-only";
|
|
48
47
|
locale: string;
|
|
49
48
|
placeholder: string;
|
|
49
|
+
layout: "month-and-year" | "month-only" | "year-only";
|
|
50
50
|
disabledErrorMessage: boolean;
|
|
51
51
|
dateFormat: string;
|
|
52
52
|
showTime: boolean;
|
|
@@ -11,8 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
11
11
|
label: string;
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
|
-
options: InputSelectItem[];
|
|
15
14
|
placeholder: string;
|
|
15
|
+
options: InputSelectItem[];
|
|
16
16
|
limit: number;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
@@ -11,8 +11,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
11
11
|
label: string;
|
|
12
12
|
name: string;
|
|
13
13
|
modelValue: LocalizedNameItem[];
|
|
14
|
-
options: InputSelectItem[];
|
|
15
14
|
placeholder: string;
|
|
15
|
+
options: InputSelectItem[];
|
|
16
16
|
limit: number;
|
|
17
17
|
showCounter: boolean;
|
|
18
18
|
addLabel: string;
|
|
@@ -40,9 +40,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
40
40
|
id: string;
|
|
41
41
|
name: string;
|
|
42
42
|
required: boolean;
|
|
43
|
-
options: InputTagModalOption[];
|
|
44
43
|
labelKey: string;
|
|
45
44
|
placeholder: string;
|
|
45
|
+
options: InputTagModalOption[];
|
|
46
46
|
disabledErrorMessage: boolean;
|
|
47
47
|
valueKey: string;
|
|
48
48
|
searchPlaceholder: string;
|
|
@@ -40,9 +40,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
40
40
|
id: string;
|
|
41
41
|
name: string;
|
|
42
42
|
required: boolean;
|
|
43
|
-
options: InputTagModalOption[];
|
|
44
43
|
labelKey: string;
|
|
45
44
|
placeholder: string;
|
|
45
|
+
options: InputTagModalOption[];
|
|
46
46
|
disabledErrorMessage: boolean;
|
|
47
47
|
valueKey: string;
|
|
48
48
|
searchPlaceholder: string;
|
|
@@ -26,8 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
"onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
|
|
27
27
|
}>, {
|
|
28
28
|
name: string;
|
|
29
|
-
state: "user" | "admin";
|
|
30
29
|
placeholder: string;
|
|
30
|
+
state: "user" | "admin";
|
|
31
31
|
limit: number;
|
|
32
32
|
profileScope: "personal" | "business";
|
|
33
33
|
ignore: string[];
|
|
@@ -26,8 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
26
26
|
"onUpdate:modelValue"?: ((value: SelectedTag[]) => any) | undefined;
|
|
27
27
|
}>, {
|
|
28
28
|
name: string;
|
|
29
|
-
state: "user" | "admin";
|
|
30
29
|
placeholder: string;
|
|
30
|
+
state: "user" | "admin";
|
|
31
31
|
limit: number;
|
|
32
32
|
profileScope: "personal" | "business";
|
|
33
33
|
ignore: string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VariantProps } from "class-variance-authority";
|
|
2
2
|
export { default as Badge } from "./Badge.vue.js";
|
|
3
3
|
export declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "outline" | "primary" | "secondary" | "destructive" | "warning" | "success" | "bright" | null | undefined;
|
|
4
|
+
variant?: "default" | "outline" | "primary" | "secondary" | "destructive" | "warning" | "success" | "bright" | "orange" | "gray" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
@@ -12,6 +12,8 @@ export const badgeVariants = cva(
|
|
|
12
12
|
success: "border-transparent bg-success text-white [a&]:hover:bg-success/90",
|
|
13
13
|
warning: "border-warning bg-warning text-white [a&]:hover:bg-warning/80",
|
|
14
14
|
bright: "border-transparent bg-bright text-bright-foreground [a&]:hover:bg-bright/90",
|
|
15
|
+
orange: "border-transparent bg-orange text-white [a&]:hover:bg-orange/90",
|
|
16
|
+
gray: "border-transparent bg-gray text-white [a&]:hover:bg-gray/90",
|
|
15
17
|
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground "
|
|
16
18
|
}
|
|
17
19
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SsoSessionState {
|
|
2
|
+
reachable: boolean;
|
|
3
|
+
secId: string | null;
|
|
4
|
+
}
|
|
5
|
+
export interface SsoSyncResult {
|
|
6
|
+
secId: string | null;
|
|
7
|
+
changed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function useSso(): {
|
|
10
|
+
readSession: () => Promise<SsoSessionState>;
|
|
11
|
+
saveSession: (secId: string) => Promise<boolean>;
|
|
12
|
+
clearSession: () => Promise<boolean>;
|
|
13
|
+
revokeToken: (secId: string) => Promise<void>;
|
|
14
|
+
syncSession: (localSecId: string | null | undefined, isValid: (secId: string) => Promise<boolean>) => Promise<SsoSyncResult>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
|
+
import { useEventListener, useTimeoutFn } from "@vueuse/core";
|
|
3
|
+
const SSO_TIMEOUT_MS = 3e3;
|
|
4
|
+
const toOrigin = (url) => {
|
|
5
|
+
try {
|
|
6
|
+
return new URL(url).origin;
|
|
7
|
+
} catch {
|
|
8
|
+
return "";
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export function useSso() {
|
|
12
|
+
const { BASE_URL_SSO, BASE_URL_API } = useRuntimeConfig().public;
|
|
13
|
+
const ssoBase = String(BASE_URL_SSO || "").replace(/\/+$/, "");
|
|
14
|
+
const apiBase = String(BASE_URL_API || "").replace(/\/+$/, "");
|
|
15
|
+
const ssoOrigin = toOrigin(ssoBase);
|
|
16
|
+
const request = (path, message, expect) => {
|
|
17
|
+
if (typeof window === "undefined" || typeof document === "undefined" || !ssoOrigin) {
|
|
18
|
+
return Promise.resolve(null);
|
|
19
|
+
}
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
const iframe = document.createElement("iframe");
|
|
22
|
+
iframe.style.display = "none";
|
|
23
|
+
iframe.src = `${ssoBase}/${path}`;
|
|
24
|
+
const finish = (value) => {
|
|
25
|
+
stopTimeout();
|
|
26
|
+
stopMessage();
|
|
27
|
+
stopLoad();
|
|
28
|
+
iframe.remove();
|
|
29
|
+
resolve(value);
|
|
30
|
+
};
|
|
31
|
+
const { stop: stopTimeout } = useTimeoutFn(() => finish(null), SSO_TIMEOUT_MS);
|
|
32
|
+
const stopMessage = useEventListener(window, "message", (event) => {
|
|
33
|
+
if (event.origin !== ssoOrigin) return;
|
|
34
|
+
if (event.source !== iframe.contentWindow) return;
|
|
35
|
+
if (event.data?.type !== expect) return;
|
|
36
|
+
finish(event.data);
|
|
37
|
+
});
|
|
38
|
+
const stopLoad = useEventListener(iframe, "load", () => {
|
|
39
|
+
iframe.contentWindow?.postMessage(message, ssoOrigin);
|
|
40
|
+
});
|
|
41
|
+
document.body.appendChild(iframe);
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const readSession = async () => {
|
|
45
|
+
const res = await request("me", { type: "SSO_GET" }, "SSO_ME");
|
|
46
|
+
if (!res) return { reachable: false, secId: null };
|
|
47
|
+
return { reachable: true, secId: res.SEC_ID || null };
|
|
48
|
+
};
|
|
49
|
+
const saveSession = async (secId) => {
|
|
50
|
+
if (!secId) return false;
|
|
51
|
+
const res = await request("login", { type: "SSO_SET", SEC_ID: secId }, "SSO_SAVED");
|
|
52
|
+
return !!res;
|
|
53
|
+
};
|
|
54
|
+
const clearSession = async () => {
|
|
55
|
+
const res = await request("logout", { type: "SSO_CLEAR" }, "SSO_CLEARED");
|
|
56
|
+
return !!res;
|
|
57
|
+
};
|
|
58
|
+
const revokeToken = async (secId) => {
|
|
59
|
+
if (!secId || !apiBase) return;
|
|
60
|
+
try {
|
|
61
|
+
await $fetch(`${apiBase}/auth/logout`, {
|
|
62
|
+
method: "GET",
|
|
63
|
+
headers: { Authorization: `Bearer ${secId}` }
|
|
64
|
+
});
|
|
65
|
+
} catch {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const syncSession = async (localSecId, isValid) => {
|
|
70
|
+
const local = localSecId || null;
|
|
71
|
+
const sso = await readSession();
|
|
72
|
+
if (!sso.reachable) return { secId: local, changed: false };
|
|
73
|
+
if (sso.secId) {
|
|
74
|
+
if (local && local !== sso.secId) void revokeToken(local);
|
|
75
|
+
return { secId: sso.secId, changed: local !== sso.secId };
|
|
76
|
+
}
|
|
77
|
+
if (!local) return { secId: null, changed: false };
|
|
78
|
+
if (await isValid(local)) {
|
|
79
|
+
await saveSession(local);
|
|
80
|
+
return { secId: local, changed: false };
|
|
81
|
+
}
|
|
82
|
+
return { secId: null, changed: true };
|
|
83
|
+
};
|
|
84
|
+
return { readSession, saveSession, clearSession, revokeToken, syncSession };
|
|
85
|
+
}
|