@revenexx/studio-shared 0.1.2 → 0.2.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/README.md +22 -12
- package/dist/module.d.mts +9 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +27 -0
- package/dist/runtime/components/DataTable/ColumnsMenu.d.vue.ts +12 -0
- package/{components → dist/runtime/components}/DataTable/ColumnsMenu.vue +10 -17
- package/dist/runtime/components/DataTable/ColumnsMenu.vue.d.ts +12 -0
- package/dist/runtime/components/DataTable/DataTable.d.vue.ts +59 -0
- package/dist/runtime/components/DataTable/DataTable.vue +453 -0
- package/dist/runtime/components/DataTable/DataTable.vue.d.ts +59 -0
- package/dist/runtime/components/DataTable/FilterMenu.d.vue.ts +12 -0
- package/{components → dist/runtime/components}/DataTable/FilterMenu.vue +4 -8
- package/dist/runtime/components/DataTable/FilterMenu.vue.d.ts +12 -0
- package/dist/runtime/components/DataTable/types.d.ts +70 -0
- package/dist/runtime/components/DataTable/types.js +0 -0
- package/dist/runtime/components/Shared/BuildLogsFlyout.d.vue.ts +30 -0
- package/{components → dist/runtime/components}/Shared/BuildLogsFlyout.vue +27 -45
- package/dist/runtime/components/Shared/BuildLogsFlyout.vue.d.ts +30 -0
- package/dist/runtime/components/Shared/GitDeploymentSettings.d.vue.ts +17 -0
- package/{components → dist/runtime/components}/Shared/GitDeploymentSettings.vue +22 -35
- package/dist/runtime/components/Shared/GitDeploymentSettings.vue.d.ts +17 -0
- package/dist/runtime/components/Shared/KpiTile.d.vue.ts +13 -0
- package/{components → dist/runtime/components}/Shared/KpiTile.vue +11 -19
- package/dist/runtime/components/Shared/KpiTile.vue.d.ts +13 -0
- package/dist/runtime/components/Shared/PageHeader.d.vue.ts +23 -0
- package/{components → dist/runtime/components}/Shared/PageHeader.vue +6 -8
- package/dist/runtime/components/Shared/PageHeader.vue.d.ts +23 -0
- package/dist/runtime/components/Shared/SidebarNav.d.vue.ts +36 -0
- package/{components → dist/runtime/components}/Shared/SidebarNav.vue +15 -47
- package/dist/runtime/components/Shared/SidebarNav.vue.d.ts +36 -0
- package/dist/runtime/components/Shared/SortHeader.d.vue.ts +23 -0
- package/dist/runtime/components/Shared/SortHeader.vue +35 -0
- package/dist/runtime/components/Shared/SortHeader.vue.d.ts +23 -0
- package/dist/runtime/components/Shared/StateCard.d.vue.ts +32 -0
- package/{components → dist/runtime/components}/Shared/StateCard.vue +21 -36
- package/dist/runtime/components/Shared/StateCard.vue.d.ts +32 -0
- package/dist/runtime/components/Shared/StudioCard.d.vue.ts +15 -0
- package/dist/runtime/components/Shared/StudioCard.vue +19 -0
- package/dist/runtime/components/Shared/StudioCard.vue.d.ts +15 -0
- package/dist/runtime/components/Shared/TabBar.d.vue.ts +23 -0
- package/{components → dist/runtime/components}/Shared/TabBar.vue +7 -16
- package/dist/runtime/components/Shared/TabBar.vue.d.ts +23 -0
- package/dist/runtime/components/Shared/ViewTab.d.vue.ts +7 -0
- package/{components → dist/runtime/components}/Shared/ViewTab.vue +7 -9
- package/dist/runtime/components/Shared/ViewTab.vue.d.ts +7 -0
- package/dist/runtime/components/Shared/Wizard.d.vue.ts +47 -0
- package/{components → dist/runtime/components}/Shared/Wizard.vue +24 -41
- package/dist/runtime/components/Shared/Wizard.vue.d.ts +47 -0
- package/{composables/usePlatformAuth.ts → dist/runtime/composables/usePlatformAuth.d.ts} +3 -21
- package/dist/runtime/composables/usePlatformAuth.js +17 -0
- package/dist/runtime/composables/usePlatformTenant.d.ts +14 -0
- package/dist/runtime/composables/usePlatformTenant.js +18 -0
- package/dist/runtime/types/nav.d.ts +23 -0
- package/dist/runtime/types/nav.js +0 -0
- package/dist/types.d.mts +15 -0
- package/package.json +25 -13
- package/components/DataTable/DataTable.vue +0 -518
- package/components/DataTable/types.ts +0 -82
- package/components/Shared/SortHeader.vue +0 -50
- package/components/Shared/StudioCard.vue +0 -24
- package/composables/usePlatformTenant.ts +0 -35
- package/index.ts +0 -16
- package/nuxt.config.ts +0 -23
|
@@ -1,43 +1,28 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
/**
|
|
3
|
-
* Shared empty / loading / error / not-found state.
|
|
4
|
-
*
|
|
5
|
-
* One calm centered card used across the studios so every "nothing here
|
|
6
|
-
* yet", "still loading" and "something broke" surface looks the same.
|
|
7
|
-
* Pass copy via props; put a CTA in the `#actions` slot.
|
|
8
|
-
*/
|
|
9
|
-
import type { Component } from 'vue'
|
|
1
|
+
<script setup>
|
|
10
2
|
import {
|
|
11
|
-
Card,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
icon
|
|
21
|
-
title:
|
|
22
|
-
description
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
const defaultIcon: Record<Variant, Component> = {
|
|
3
|
+
Card,
|
|
4
|
+
CardContent,
|
|
5
|
+
CardDescription,
|
|
6
|
+
CardHeader,
|
|
7
|
+
CardTitle
|
|
8
|
+
} from "@revenexx/studio";
|
|
9
|
+
import { Box as Boxes, DangerTriangle as AlertTriangle, MagniferZoomIn as Magnifier } from "#solar-icons";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
variant: { type: String, required: false, default: "empty" },
|
|
12
|
+
icon: { type: null, required: false },
|
|
13
|
+
title: { type: String, required: true },
|
|
14
|
+
description: { type: String, required: false }
|
|
15
|
+
});
|
|
16
|
+
const defaultIcon = {
|
|
28
17
|
empty: Boxes,
|
|
29
18
|
loading: Boxes,
|
|
30
19
|
error: AlertTriangle,
|
|
31
|
-
notfound: Magnifier
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
props.variant === 'error'
|
|
38
|
-
? 'bg-rose-500/10 text-rose-600'
|
|
39
|
-
: 'bg-primary/10 text-primary',
|
|
40
|
-
)
|
|
20
|
+
notfound: Magnifier
|
|
21
|
+
};
|
|
22
|
+
const resolvedIcon = computed(() => props.icon ?? defaultIcon[props.variant]);
|
|
23
|
+
const tileClass = computed(
|
|
24
|
+
() => props.variant === "error" ? "bg-rose-500/10 text-rose-600" : "bg-primary/10 text-primary"
|
|
25
|
+
);
|
|
41
26
|
</script>
|
|
42
27
|
|
|
43
28
|
<template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared empty / loading / error / not-found state.
|
|
3
|
+
*
|
|
4
|
+
* One calm centered card used across the studios so every "nothing here
|
|
5
|
+
* yet", "still loading" and "something broke" surface looks the same.
|
|
6
|
+
* Pass copy via props; put a CTA in the `#actions` slot.
|
|
7
|
+
*/
|
|
8
|
+
import type { Component } from 'vue';
|
|
9
|
+
type Variant = 'empty' | 'loading' | 'error' | 'notfound';
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
variant?: Variant;
|
|
12
|
+
/** Override the default icon for the variant. */
|
|
13
|
+
icon?: Component;
|
|
14
|
+
title: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
};
|
|
17
|
+
declare var __VLS_22: {}, __VLS_28: {};
|
|
18
|
+
type __VLS_Slots = {} & {
|
|
19
|
+
description?: (props: typeof __VLS_22) => any;
|
|
20
|
+
} & {
|
|
21
|
+
actions?: (props: typeof __VLS_28) => any;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
|
+
variant: Variant;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
to?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_6: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_6) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NuxtLink } from "#components";
|
|
3
|
+
defineProps({
|
|
4
|
+
to: { type: String, required: false }
|
|
5
|
+
});
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<component
|
|
10
|
+
:is="to ? NuxtLink : 'div'"
|
|
11
|
+
:to="to"
|
|
12
|
+
class="block rounded-lg border border-gray-400/10 outline-1 outline-white/30"
|
|
13
|
+
:class="to ? 'transition-transform hover:-translate-y-0.5' : ''"
|
|
14
|
+
>
|
|
15
|
+
<div class="relative h-full overflow-hidden rounded-lg bg-white">
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
</component>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
to?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_6: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_6) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Underline tab bar — the standard cockpit detail-page tabs. A full-width
|
|
3
|
+
* hairline sits behind the row; the active/hover indicator is a 2px bar that
|
|
4
|
+
* spans exactly the label width (inset-x-3 = the px-3 padding), sitting on the
|
|
5
|
+
* baseline over the hairline. Active = primary; hover = soft primary. Tabs
|
|
6
|
+
* scroll horizontally on overflow. To bleed the line to the panel edges, pass
|
|
7
|
+
* e.g. `class="-mx-4 px-4"` from a padded page.
|
|
8
|
+
*/
|
|
9
|
+
export interface TabItem {
|
|
10
|
+
key: string;
|
|
11
|
+
label: string;
|
|
12
|
+
badge?: number | string | null;
|
|
13
|
+
}
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
tabs: TabItem[];
|
|
16
|
+
modelValue: string;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
"update:modelValue": (key: string) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((key: string) => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
export default _default;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* scroll horizontally on overflow. To bleed the line to the panel edges, pass
|
|
8
|
-
* e.g. `class="-mx-4 px-4"` from a padded page.
|
|
9
|
-
*/
|
|
10
|
-
export interface TabItem { key: string, label: string, badge?: number | string | null }
|
|
11
|
-
|
|
12
|
-
defineProps<{ tabs: TabItem[], modelValue: string }>()
|
|
13
|
-
defineEmits<{ 'update:modelValue': [key: string] }>()
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
tabs: { type: Array, required: true },
|
|
4
|
+
modelValue: { type: String, required: true }
|
|
5
|
+
});
|
|
6
|
+
defineEmits(["update:modelValue"]);
|
|
14
7
|
</script>
|
|
15
8
|
|
|
16
9
|
<template>
|
|
@@ -27,9 +20,7 @@ defineEmits<{ 'update:modelValue': [key: string] }>()
|
|
|
27
20
|
:key="t.key"
|
|
28
21
|
type="button"
|
|
29
22
|
class="group relative shrink-0 cursor-pointer whitespace-nowrap px-2.5 py-2 text-sm font-medium transition-colors"
|
|
30
|
-
:class="modelValue === t.key
|
|
31
|
-
? 'text-[#0B0522] hover:text-primary'
|
|
32
|
-
: 'text-[#0B0522]/80 hover:text-primary'"
|
|
23
|
+
:class="modelValue === t.key ? 'text-[#0B0522] hover:text-primary' : 'text-[#0B0522]/80 hover:text-primary'"
|
|
33
24
|
@click="$emit('update:modelValue', t.key)"
|
|
34
25
|
>
|
|
35
26
|
{{ t.label }}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Underline tab bar — the standard cockpit detail-page tabs. A full-width
|
|
3
|
+
* hairline sits behind the row; the active/hover indicator is a 2px bar that
|
|
4
|
+
* spans exactly the label width (inset-x-3 = the px-3 padding), sitting on the
|
|
5
|
+
* baseline over the hairline. Active = primary; hover = soft primary. Tabs
|
|
6
|
+
* scroll horizontally on overflow. To bleed the line to the panel edges, pass
|
|
7
|
+
* e.g. `class="-mx-4 px-4"` from a padded page.
|
|
8
|
+
*/
|
|
9
|
+
export interface TabItem {
|
|
10
|
+
key: string;
|
|
11
|
+
label: string;
|
|
12
|
+
badge?: number | string | null;
|
|
13
|
+
}
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
tabs: TabItem[];
|
|
16
|
+
modelValue: string;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
"update:modelValue": (key: string) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((key: string) => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
active?: boolean;
|
|
3
|
+
icon?: unknown;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
defineProps
|
|
3
|
-
active
|
|
4
|
-
icon
|
|
5
|
-
label:
|
|
6
|
-
}
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
active: { type: Boolean, required: false },
|
|
4
|
+
icon: { type: null, required: false },
|
|
5
|
+
label: { type: String, required: true }
|
|
6
|
+
});
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<template>
|
|
10
10
|
<button
|
|
11
11
|
type="button"
|
|
12
12
|
class="group flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium transition-colors"
|
|
13
|
-
:class="active
|
|
14
|
-
? 'bg-[#f3f1fa] text-[#0B0522]'
|
|
15
|
-
: 'text-foreground/70 hover:bg-muted/50 hover:text-foreground'"
|
|
13
|
+
:class="active ? 'bg-[#f3f1fa] text-[#0B0522]' : 'text-foreground/70 hover:bg-muted/50 hover:text-foreground'"
|
|
16
14
|
>
|
|
17
15
|
<component
|
|
18
16
|
:is="icon"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
active?: boolean;
|
|
3
|
+
icon?: unknown;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
interface Step {
|
|
2
|
+
key: string;
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
steps: Step[];
|
|
8
|
+
modelValue?: number;
|
|
9
|
+
/** Gate the Next/Finish button for the current step. */
|
|
10
|
+
canAdvance?: boolean;
|
|
11
|
+
busy?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare var __VLS_1: {
|
|
14
|
+
step: any;
|
|
15
|
+
index: any;
|
|
16
|
+
}, __VLS_3: {
|
|
17
|
+
back: any;
|
|
18
|
+
next: any;
|
|
19
|
+
isFirst: any;
|
|
20
|
+
isLast: any;
|
|
21
|
+
canAdvance: any;
|
|
22
|
+
busy: any;
|
|
23
|
+
index: any;
|
|
24
|
+
};
|
|
25
|
+
type __VLS_Slots = {} & {
|
|
26
|
+
default?: (props: typeof __VLS_1) => any;
|
|
27
|
+
} & {
|
|
28
|
+
footer?: (props: typeof __VLS_3) => any;
|
|
29
|
+
};
|
|
30
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
+
"update:modelValue": (args_0: number) => any;
|
|
32
|
+
finish: () => any;
|
|
33
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
|
+
"onUpdate:modelValue"?: ((args_0: number) => any) | undefined;
|
|
35
|
+
onFinish?: (() => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
modelValue: number;
|
|
38
|
+
canAdvance: boolean;
|
|
39
|
+
busy: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
42
|
+
export default _default;
|
|
43
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -1,47 +1,30 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* <Wizard :steps="steps" v-model="step" :can-advance="valid" @finish="submit">
|
|
11
|
-
* <template #default="{ step }">…fields for `step.key`…</template>
|
|
12
|
-
* </Wizard>
|
|
13
|
-
*/
|
|
14
|
-
import { Button } from '@revenexx/studio'
|
|
15
|
-
|
|
16
|
-
interface Step { key: string, title: string, description?: string }
|
|
17
|
-
|
|
18
|
-
const props = withDefaults(defineProps<{
|
|
19
|
-
steps: Step[]
|
|
20
|
-
modelValue?: number
|
|
21
|
-
/** Gate the Next/Finish button for the current step. */
|
|
22
|
-
canAdvance?: boolean
|
|
23
|
-
busy?: boolean
|
|
24
|
-
}>(), { modelValue: 0, canAdvance: true, busy: false })
|
|
25
|
-
|
|
26
|
-
const emit = defineEmits<{ 'update:modelValue': [number], 'finish': [] }>()
|
|
27
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Button } from "@revenexx/studio";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
steps: { type: Array, required: true },
|
|
5
|
+
modelValue: { type: Number, required: false, default: 0 },
|
|
6
|
+
canAdvance: { type: Boolean, required: false, default: true },
|
|
7
|
+
busy: { type: Boolean, required: false, default: false }
|
|
8
|
+
});
|
|
9
|
+
const emit = defineEmits(["update:modelValue", "finish"]);
|
|
28
10
|
const index = computed({
|
|
29
11
|
get: () => props.modelValue,
|
|
30
|
-
set: v => emit(
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
12
|
+
set: (v) => emit("update:modelValue", v)
|
|
13
|
+
});
|
|
14
|
+
const isFirst = computed(() => index.value === 0);
|
|
15
|
+
const isLast = computed(() => index.value === props.steps.length - 1);
|
|
16
|
+
const activeStep = computed(() => props.steps[index.value]);
|
|
17
|
+
function back() {
|
|
18
|
+
if (!isFirst.value) index.value--;
|
|
19
|
+
}
|
|
38
20
|
function next() {
|
|
39
|
-
if (!props.canAdvance || props.busy) return
|
|
40
|
-
if (isLast.value) emit(
|
|
41
|
-
else index.value
|
|
21
|
+
if (!props.canAdvance || props.busy) return;
|
|
22
|
+
if (isLast.value) emit("finish");
|
|
23
|
+
else index.value++;
|
|
24
|
+
}
|
|
25
|
+
function goTo(i) {
|
|
26
|
+
if (i < index.value) index.value = i;
|
|
42
27
|
}
|
|
43
|
-
// Allow jumping back to a completed step via the stepper header.
|
|
44
|
-
function goTo(i: number) { if (i < index.value) index.value = i }
|
|
45
28
|
</script>
|
|
46
29
|
|
|
47
30
|
<template>
|
|
@@ -72,7 +55,7 @@ function goTo(i: number) { if (i < index.value) index.value = i }
|
|
|
72
55
|
<slot name="footer" :back="back" :next="next" :is-first="isFirst" :is-last="isLast" :can-advance="canAdvance" :busy="busy" :index="index">
|
|
73
56
|
<Button variant="ghost" :disabled="isFirst || busy" @click="back">Back</Button>
|
|
74
57
|
<Button :disabled="!canAdvance || busy" class="gap-1" @click="next">
|
|
75
|
-
{{ isLast ?
|
|
58
|
+
{{ isLast ? "Finish" : "Next" }}
|
|
76
59
|
</Button>
|
|
77
60
|
</slot>
|
|
78
61
|
</div>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
interface Step {
|
|
2
|
+
key: string;
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
steps: Step[];
|
|
8
|
+
modelValue?: number;
|
|
9
|
+
/** Gate the Next/Finish button for the current step. */
|
|
10
|
+
canAdvance?: boolean;
|
|
11
|
+
busy?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare var __VLS_1: {
|
|
14
|
+
step: any;
|
|
15
|
+
index: any;
|
|
16
|
+
}, __VLS_3: {
|
|
17
|
+
back: any;
|
|
18
|
+
next: any;
|
|
19
|
+
isFirst: any;
|
|
20
|
+
isLast: any;
|
|
21
|
+
canAdvance: any;
|
|
22
|
+
busy: any;
|
|
23
|
+
index: any;
|
|
24
|
+
};
|
|
25
|
+
type __VLS_Slots = {} & {
|
|
26
|
+
default?: (props: typeof __VLS_1) => any;
|
|
27
|
+
} & {
|
|
28
|
+
footer?: (props: typeof __VLS_3) => any;
|
|
29
|
+
};
|
|
30
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
+
"update:modelValue": (args_0: number) => any;
|
|
32
|
+
finish: () => any;
|
|
33
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
|
+
"onUpdate:modelValue"?: ((args_0: number) => any) | undefined;
|
|
35
|
+
onFinish?: (() => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
modelValue: number;
|
|
38
|
+
canAdvance: boolean;
|
|
39
|
+
busy: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
42
|
+
export default _default;
|
|
43
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -5,31 +5,13 @@
|
|
|
5
5
|
* This is the **standalone default**: it sources a bearer token from runtime
|
|
6
6
|
* config (`NUXT_PUBLIC_DEV_TOKEN`) or `localStorage['console.token']`. The
|
|
7
7
|
* full cockpit ships an override at `app/composables/usePlatformAuth.ts`
|
|
8
|
-
* (app-level auto-imports take precedence over this
|
|
8
|
+
* (app-level auto-imports take precedence over this module's) that returns the
|
|
9
9
|
* real Appwrite/Console-sourced operator token.
|
|
10
10
|
*
|
|
11
11
|
* Studio modules (e.g. `@revenexx/studio-integrations`) call this instead of
|
|
12
12
|
* `useConsoleAuth` directly, so they carry no cockpit-only dependency.
|
|
13
13
|
*/
|
|
14
14
|
export interface PlatformAuth {
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function usePlatformAuth(): PlatformAuth {
|
|
19
|
-
const config = useRuntimeConfig()
|
|
20
|
-
return {
|
|
21
|
-
async getToken() {
|
|
22
|
-
const fromConfig = (config.public.devToken as string | undefined) || null
|
|
23
|
-
if (fromConfig) return fromConfig
|
|
24
|
-
if (import.meta.client) {
|
|
25
|
-
try {
|
|
26
|
-
return localStorage.getItem('console.token')
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return null
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return null
|
|
33
|
-
},
|
|
34
|
-
}
|
|
15
|
+
getToken: () => Promise<string | null>;
|
|
35
16
|
}
|
|
17
|
+
export declare function usePlatformAuth(): PlatformAuth;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function usePlatformAuth() {
|
|
2
|
+
const config = useRuntimeConfig();
|
|
3
|
+
return {
|
|
4
|
+
async getToken() {
|
|
5
|
+
const fromConfig = config.public.devToken || null;
|
|
6
|
+
if (fromConfig) return fromConfig;
|
|
7
|
+
if (import.meta.client) {
|
|
8
|
+
try {
|
|
9
|
+
return localStorage.getItem("console.token");
|
|
10
|
+
} catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Platform tenant provider — companion to `usePlatformAuth`.
|
|
4
|
+
*
|
|
5
|
+
* Standalone default: the active tenant slug comes from runtime config
|
|
6
|
+
* (`NUXT_PUBLIC_DEV_TENANT`) or `localStorage['cockpit.devTenant']`. The full
|
|
7
|
+
* cockpit overrides this at `app/composables/usePlatformTenant.ts` to return
|
|
8
|
+
* the real active-tenant slug from `useConsoleTenants`.
|
|
9
|
+
*/
|
|
10
|
+
export interface PlatformTenant {
|
|
11
|
+
slug: Ref<string | null>;
|
|
12
|
+
load: () => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function usePlatformTenant(): PlatformTenant;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { computed, ref } from "vue";
|
|
2
|
+
export function usePlatformTenant() {
|
|
3
|
+
const config = useRuntimeConfig();
|
|
4
|
+
const stored = ref(null);
|
|
5
|
+
if (import.meta.client) {
|
|
6
|
+
try {
|
|
7
|
+
stored.value = localStorage.getItem("cockpit.devTenant");
|
|
8
|
+
} catch {
|
|
9
|
+
stored.value = null;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
const slug = computed(() => config.public.devTenant || stored.value);
|
|
13
|
+
return {
|
|
14
|
+
slug,
|
|
15
|
+
async load() {
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* SidebarNav data shapes. They live in a plain .ts file (not the SFC) so the
|
|
4
|
+
* package barrel can re-export them without dragging a `.vue` import into
|
|
5
|
+
* node-side type resolution (the module dts build / plain tsc can't follow
|
|
6
|
+
* type re-exports through an SFC).
|
|
7
|
+
*/
|
|
8
|
+
export type SidebarNavItem = {
|
|
9
|
+
label: string;
|
|
10
|
+
to: string;
|
|
11
|
+
icon?: Component;
|
|
12
|
+
badge?: number | string | null;
|
|
13
|
+
/** Dim + show a "soon" tag (not-yet-shipped surfaces). */
|
|
14
|
+
preview?: boolean;
|
|
15
|
+
/** Match the route exactly (for studio roots like `/settings`). */
|
|
16
|
+
exact?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type SidebarNavSection = {
|
|
19
|
+
key: string;
|
|
20
|
+
/** Empty/omitted → no group label (pinned items at the top). */
|
|
21
|
+
label?: string;
|
|
22
|
+
items: SidebarNavItem[];
|
|
23
|
+
};
|
|
File without changes
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
+
|
|
3
|
+
import type { default as Module } from './module.mjs'
|
|
4
|
+
|
|
5
|
+
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
+
|
|
7
|
+
export { type SidebarNavItem, type SidebarNavSection } from '../dist/runtime/types/nav.js'
|
|
8
|
+
|
|
9
|
+
export { type PlatformAuth } from '../dist/runtime/composables/usePlatformAuth.js'
|
|
10
|
+
|
|
11
|
+
export { type PlatformTenant } from '../dist/runtime/composables/usePlatformTenant.js'
|
|
12
|
+
|
|
13
|
+
export { default } from './module.mjs'
|
|
14
|
+
|
|
15
|
+
export * from '../dist/runtime/components/DataTable/types.js'
|
package/package.json
CHANGED
|
@@ -1,32 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revenexx/studio-shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Shared revenexx Studio shell primitives (PageHeader, SidebarNav, StateCard, DataTable, …) + the platform provider contract (usePlatformAuth/usePlatformTenant). A Nuxt
|
|
6
|
-
"main": "./
|
|
5
|
+
"description": "Shared revenexx Studio shell primitives (PageHeader, SidebarNav, StateCard, DataTable, …) + the platform provider contract (usePlatformAuth/usePlatformTenant). A Nuxt module — add it to `modules`.",
|
|
6
|
+
"main": "./dist/module.mjs",
|
|
7
|
+
"types": "./dist/types.d.mts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
|
-
"types": "./
|
|
10
|
-
"import": "./
|
|
10
|
+
"types": "./dist/types.d.mts",
|
|
11
|
+
"import": "./dist/module.mjs"
|
|
11
12
|
},
|
|
12
|
-
"./
|
|
13
|
-
"./components/*": "./components/*"
|
|
13
|
+
"./components/*": "./dist/runtime/components/*"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"
|
|
17
|
-
"index.ts",
|
|
18
|
-
"components",
|
|
19
|
-
"composables",
|
|
16
|
+
"dist",
|
|
20
17
|
"LICENSE"
|
|
21
18
|
],
|
|
22
19
|
"publishConfig": {
|
|
23
20
|
"registry": "https://registry.npmjs.org/",
|
|
24
21
|
"access": "public"
|
|
25
22
|
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@nuxt/kit": "^4.0.0"
|
|
25
|
+
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@revenexx/studio": "*",
|
|
28
|
+
"@solar-icons/nuxt": "^1.2.0",
|
|
28
29
|
"nuxt": "^4.0.0",
|
|
29
|
-
"vue": "^3.5.0"
|
|
30
|
+
"vue": "^3.5.0",
|
|
31
|
+
"vue-sonner": "^2.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
35
|
+
"@nuxt/kit": "^4.0.0",
|
|
36
|
+
"nuxt": "^4.2.2",
|
|
37
|
+
"vue": "^3.5.26",
|
|
38
|
+
"vue-tsc": "^2.2.0"
|
|
30
39
|
},
|
|
31
|
-
"license": "SEE LICENSE IN LICENSE"
|
|
40
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "nuxt-module-build build"
|
|
43
|
+
}
|
|
32
44
|
}
|