@lobb-js/studio 0.33.0 → 0.35.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/applyUITheme.d.ts +2 -0
- package/dist/{applyStudioTheme.js → applyUITheme.js} +4 -4
- package/dist/components/LlmButton.svelte +4 -2
- package/dist/components/LlmButton.svelte.d.ts +1 -0
- package/dist/components/Studio.svelte +15 -7
- package/dist/components/codeEditor.svelte +1 -1
- package/dist/components/createManyButton.svelte +2 -2
- package/dist/components/dataTable/dataTable.svelte +1 -1
- package/dist/components/dataTable/dataTableTabs.svelte +1 -1
- package/dist/components/dataTable/filter.svelte +3 -2
- package/dist/components/dataTable/filterButton.svelte +1 -1
- package/dist/components/dataTable/footer.svelte +1 -1
- package/dist/components/dataTable/header.svelte +14 -21
- package/dist/components/dataTable/listViewChildren.svelte +1 -1
- package/dist/components/dataTable/sort.svelte +1 -1
- package/dist/components/dataTable/sortButton.svelte +1 -1
- package/dist/components/dataTable/table.svelte +8 -8
- package/dist/components/dataTable/utils.js +2 -1
- package/dist/components/dataTablePopup/dataTablePopup.svelte +1 -1
- package/dist/components/detailView/create/children.svelte +1 -1
- package/dist/components/detailView/create/createDetailView.svelte +2 -2
- package/dist/components/detailView/create/createDetailViewButton.svelte +2 -0
- package/dist/components/detailView/create/createDetailViewButton.svelte.d.ts +1 -0
- package/dist/components/detailView/create/createDetailViewChildren.svelte +4 -4
- package/dist/components/detailView/create/createManyView.svelte +4 -4
- package/dist/components/detailView/detailView.svelte +2 -1
- package/dist/components/detailView/fieldInput.svelte +10 -10
- package/dist/components/detailView/fieldInputReplacement.svelte +7 -7
- package/dist/components/detailView/passwordInput.svelte +1 -1
- package/dist/components/detailView/update/updateDetailView.svelte +2 -2
- package/dist/components/detailView/update/updateDetailViewButton.svelte +2 -0
- package/dist/components/detailView/update/updateDetailViewButton.svelte.d.ts +1 -0
- package/dist/components/detailView/update/updateDetailViewChildren.svelte +4 -4
- package/dist/components/diffViewer.svelte +1 -1
- package/dist/components/drawer.svelte +2 -2
- package/dist/components/foreingKeyInput.svelte +2 -2
- package/dist/components/horizontalNav.svelte +85 -0
- package/dist/components/horizontalNav.svelte.d.ts +3 -0
- package/dist/components/importButton.svelte +7 -7
- package/dist/components/mainNav.svelte +15 -0
- package/dist/components/mainNav.svelte.d.ts +6 -0
- package/dist/components/mainNavShared.d.ts +10 -0
- package/dist/components/mainNavShared.js +62 -0
- package/dist/components/polymorphicInput.svelte +1 -1
- package/dist/components/rangeCalendarButton.svelte +11 -12
- package/dist/components/richTextEditor.svelte +1 -1
- package/dist/components/routes/extensions/publicExtension.svelte +1 -1
- package/dist/components/routes/home.svelte +1 -1
- package/dist/components/routes/workflows/workflows.svelte +1 -1
- package/dist/components/setServerPage.svelte +1 -1
- package/dist/components/sidebar/sidebar.svelte +3 -3
- package/dist/components/sidebar/sidebarElements.svelte +4 -4
- package/dist/components/singletone.svelte +2 -2
- package/dist/components/ui/skeleton/skeleton.svelte +1 -1
- package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/dist/components/verticalNav.svelte +174 -0
- package/dist/components/verticalNav.svelte.d.ts +3 -0
- package/dist/components/workflowEditor.svelte +2 -2
- package/dist/store.types.d.ts +4 -3
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +12 -0
- package/package.json +2 -2
- package/src/app.css +50 -76
- package/src/lib/{applyStudioTheme.ts → applyUITheme.ts} +5 -5
- package/src/lib/components/LlmButton.svelte +4 -2
- package/src/lib/components/Studio.svelte +15 -7
- package/src/lib/components/codeEditor.svelte +1 -1
- package/src/lib/components/createManyButton.svelte +2 -2
- package/src/lib/components/dataTable/dataTable.svelte +1 -1
- package/src/lib/components/dataTable/dataTableTabs.svelte +1 -1
- package/src/lib/components/dataTable/filter.svelte +3 -2
- package/src/lib/components/dataTable/filterButton.svelte +1 -1
- package/src/lib/components/dataTable/footer.svelte +1 -1
- package/src/lib/components/dataTable/header.svelte +14 -21
- package/src/lib/components/dataTable/listViewChildren.svelte +1 -1
- package/src/lib/components/dataTable/sort.svelte +1 -1
- package/src/lib/components/dataTable/sortButton.svelte +1 -1
- package/src/lib/components/dataTable/table.svelte +8 -8
- package/src/lib/components/dataTable/utils.ts +2 -1
- package/src/lib/components/dataTablePopup/dataTablePopup.svelte +1 -1
- package/src/lib/components/detailView/create/children.svelte +1 -1
- package/src/lib/components/detailView/create/createDetailView.svelte +2 -2
- package/src/lib/components/detailView/create/createDetailViewButton.svelte +2 -0
- package/src/lib/components/detailView/create/createDetailViewChildren.svelte +4 -4
- package/src/lib/components/detailView/create/createManyView.svelte +4 -4
- package/src/lib/components/detailView/detailView.svelte +2 -1
- package/src/lib/components/detailView/fieldInput.svelte +10 -10
- package/src/lib/components/detailView/fieldInputReplacement.svelte +7 -7
- package/src/lib/components/detailView/passwordInput.svelte +1 -1
- package/src/lib/components/detailView/update/updateDetailView.svelte +2 -2
- package/src/lib/components/detailView/update/updateDetailViewButton.svelte +2 -0
- package/src/lib/components/detailView/update/updateDetailViewChildren.svelte +4 -4
- package/src/lib/components/diffViewer.svelte +1 -1
- package/src/lib/components/drawer.svelte +2 -2
- package/src/lib/components/foreingKeyInput.svelte +2 -2
- package/src/lib/components/horizontalNav.svelte +85 -0
- package/src/lib/components/importButton.svelte +7 -7
- package/src/lib/components/mainNav.svelte +15 -0
- package/src/lib/components/mainNavShared.ts +67 -0
- package/src/lib/components/polymorphicInput.svelte +1 -1
- package/src/lib/components/rangeCalendarButton.svelte +11 -12
- package/src/lib/components/richTextEditor.svelte +1 -1
- package/src/lib/components/routes/extensions/publicExtension.svelte +1 -1
- package/src/lib/components/routes/home.svelte +1 -1
- package/src/lib/components/routes/workflows/workflows.svelte +1 -1
- package/src/lib/components/setServerPage.svelte +1 -1
- package/src/lib/components/sidebar/sidebar.svelte +3 -3
- package/src/lib/components/sidebar/sidebarElements.svelte +4 -4
- package/src/lib/components/singletone.svelte +2 -2
- package/src/lib/components/ui/skeleton/skeleton.svelte +1 -1
- package/src/lib/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/src/lib/components/verticalNav.svelte +174 -0
- package/src/lib/components/workflowEditor.svelte +2 -2
- package/src/lib/store.types.ts +2 -2
- package/src/lib/utils.ts +12 -0
- package/dist/applyStudioTheme.d.ts +0 -2
- package/dist/components/miniSidebar.svelte +0 -300
- package/dist/components/miniSidebar.svelte.d.ts +0 -5
- package/src/lib/components/miniSidebar.svelte +0 -300
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// UI theme injection. Writes the configured CSS-variable overrides into
|
|
2
|
+
// a single <style> tag — light overrides under `:root`, dark under
|
|
3
3
|
// `.dark` — so each mode picks up its own variant. Idempotent: re-runs
|
|
4
4
|
// replace the previous block.
|
|
5
|
-
const STYLE_ID = "lobb-
|
|
5
|
+
const STYLE_ID = "lobb-ui-theme";
|
|
6
6
|
function buildDeclarations(vars) {
|
|
7
7
|
if (!vars)
|
|
8
8
|
return "";
|
|
@@ -14,7 +14,7 @@ function buildDeclarations(vars) {
|
|
|
14
14
|
}
|
|
15
15
|
return out.join(" ");
|
|
16
16
|
}
|
|
17
|
-
export function
|
|
17
|
+
export function applyUITheme(theme) {
|
|
18
18
|
if (typeof document === "undefined")
|
|
19
19
|
return;
|
|
20
20
|
document.getElementById(STYLE_ID)?.remove();
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
format?: any;
|
|
17
17
|
messages?: any[];
|
|
18
18
|
variant?: ButtonProps["variant"];
|
|
19
|
+
size?: ButtonProps["size"];
|
|
19
20
|
class?: ButtonProps["class"];
|
|
20
21
|
Icon?: ButtonProps["Icon"];
|
|
21
22
|
children?: ButtonProps["children"];
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
description,
|
|
29
30
|
placeholder = "write prompt description",
|
|
30
31
|
variant = "default",
|
|
32
|
+
size,
|
|
31
33
|
Icon = Brain,
|
|
32
34
|
onApiResponseComplete,
|
|
33
35
|
messages,
|
|
@@ -98,7 +100,7 @@
|
|
|
98
100
|
{#if ctx.meta.extensions.llm && ctx.meta.collections.llm_chat}
|
|
99
101
|
<Popover.Root bind:open={popoverOpen}>
|
|
100
102
|
<Popover.Trigger>
|
|
101
|
-
<Button {variant} class={props.class}>
|
|
103
|
+
<Button {variant} {size} class={props.class}>
|
|
102
104
|
{#if loading}
|
|
103
105
|
<LoaderIcon class="animate-spin" />
|
|
104
106
|
{:else}
|
|
@@ -129,7 +131,7 @@
|
|
|
129
131
|
<Button
|
|
130
132
|
type="submit"
|
|
131
133
|
Icon={Send}
|
|
132
|
-
|
|
134
|
+
size="sm">Submit</Button
|
|
133
135
|
>
|
|
134
136
|
</form>
|
|
135
137
|
</Popover.Content>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { createLobb } from "../store.svelte";
|
|
6
6
|
import { setStudioContext } from "../context";
|
|
7
7
|
import { LoaderCircle, ServerOff } from "lucide-svelte";
|
|
8
|
-
import
|
|
8
|
+
import MainNav from "./mainNav.svelte";
|
|
9
9
|
import * as Tooltip from "./ui/tooltip";
|
|
10
10
|
import { page } from "$app/state";
|
|
11
11
|
import { afterNavigate } from "$app/navigation";
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
} from "../extensions/extensionUtils";
|
|
18
18
|
import extensionMap from 'virtual:lobb-studio-extensions';
|
|
19
19
|
import { mediaQueries } from "../utils";
|
|
20
|
-
import {
|
|
20
|
+
import { applyUITheme } from "../applyUITheme";
|
|
21
21
|
import Home from "./routes/home.svelte";
|
|
22
22
|
import DataModel from "./routes/data_model/dataModel.svelte";
|
|
23
23
|
import Collections from "./routes/collections/collections.svelte";
|
|
@@ -44,6 +44,12 @@
|
|
|
44
44
|
|
|
45
45
|
let status: "loading" | "error" | "ready" = $state("loading");
|
|
46
46
|
let isSmallScreen = $derived(!mediaQueries.sm.current);
|
|
47
|
+
// Horizontal nav forces the layout to row mode (top bar instead of
|
|
48
|
+
// left rail). Falls back to vertical when small-screen mode is on,
|
|
49
|
+
// since there's no useful horizontal layout below 640px.
|
|
50
|
+
const horizontalNav = $derived(
|
|
51
|
+
(ctx.meta as any)?.ui?.horizontalNav === true && !isSmallScreen,
|
|
52
|
+
);
|
|
47
53
|
|
|
48
54
|
onMount(async () => {
|
|
49
55
|
// Remove the static loading screen defined in app.html — it shows instantly
|
|
@@ -51,7 +57,7 @@
|
|
|
51
57
|
document.getElementById("app-loading")?.remove();
|
|
52
58
|
try {
|
|
53
59
|
ctx.meta = await lobb.getMeta();
|
|
54
|
-
|
|
60
|
+
applyUITheme(ctx.meta.ui?.theme);
|
|
55
61
|
ctx.extensions = await loadExtensions(lobb, ctx, extensionMap);
|
|
56
62
|
await executeExtensionsOnStartup(lobb, ctx);
|
|
57
63
|
loadExtensionWorkflows(ctx as any);
|
|
@@ -104,11 +110,13 @@
|
|
|
104
110
|
{:else}
|
|
105
111
|
<Tooltip.Provider delayDuration={0} disableHoverableContent={true}>
|
|
106
112
|
<main
|
|
107
|
-
class="bg-muted h-screen w-screen"
|
|
108
|
-
style=
|
|
113
|
+
class="bg-muted h-screen w-screen overflow-hidden"
|
|
114
|
+
style={horizontalNav
|
|
115
|
+
? "display: grid; grid-template-rows: 3rem 1fr;"
|
|
116
|
+
: `display: grid; grid-template-columns: ${isSmallScreen ? '1fr' : '3.5rem 1fr'};`}
|
|
109
117
|
>
|
|
110
|
-
<
|
|
111
|
-
<div class="min-h-0 h-
|
|
118
|
+
<MainNav orientation={horizontalNav ? "horizontal" : "vertical"} />
|
|
119
|
+
<div class="min-h-0 h-full overflow-hidden">
|
|
112
120
|
{#if page.url.pathname.replace(/\/$/, "") === "/studio"}
|
|
113
121
|
<Home />
|
|
114
122
|
{:else if page.url.pathname.startsWith("/studio/collections")}
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
});
|
|
133
133
|
</script>
|
|
134
134
|
|
|
135
|
-
<div class={cn('resize-y rounded-md border bg-muted
|
|
135
|
+
<div class={cn('resize-y rounded-md border bg-muted h-60', className)}>
|
|
136
136
|
<div bind:this={editorContainer} class="h-full w-full pl-2" />
|
|
137
137
|
</div>
|
|
138
138
|
|
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
<Button
|
|
91
91
|
variant="outline"
|
|
92
92
|
onclick={() => hideDrawer()}
|
|
93
|
-
|
|
93
|
+
size="sm"
|
|
94
94
|
Icon={X}
|
|
95
95
|
>
|
|
96
96
|
Cancel
|
|
97
97
|
</Button>
|
|
98
98
|
<Button
|
|
99
99
|
variant="default"
|
|
100
|
-
|
|
100
|
+
size="sm"
|
|
101
101
|
Icon={Plus}
|
|
102
102
|
onclick={handleCreateMany}
|
|
103
103
|
>
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
|
|
280
280
|
<div
|
|
281
281
|
bind:clientWidth={dataTableContainerWidth}
|
|
282
|
-
class="flex flex-col overflow-auto h-full w-full"
|
|
282
|
+
class="flex flex-col overflow-auto h-full w-full bg-card"
|
|
283
283
|
>
|
|
284
284
|
{#snippet rowActionsSnippet(entry: Record<string, any>)}
|
|
285
285
|
<ExtensionsComponents
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
</script>
|
|
45
45
|
|
|
46
46
|
{#if tabs}
|
|
47
|
-
<div class="flex items-center gap-1 px-3 py-1.5 border-b shrink-0 bg-
|
|
47
|
+
<div class="flex items-center gap-1 px-3 py-1.5 border-b shrink-0 bg-card">
|
|
48
48
|
{#each tabs as tab}
|
|
49
49
|
{@const key = tab.id ?? tab.label}
|
|
50
50
|
{@const isActive = activeTab ? activeTab === key : (tab.default ?? tabs[0] === tab)}
|
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
<Popover.Trigger
|
|
72
72
|
class={buttonVariants({
|
|
73
73
|
variant: "ghost",
|
|
74
|
-
|
|
74
|
+
size: "sm",
|
|
75
|
+
class: "text-muted-foreground",
|
|
75
76
|
})}
|
|
76
77
|
>
|
|
77
78
|
<Plus />
|
|
@@ -184,7 +185,7 @@
|
|
|
184
185
|
<Popover.Trigger
|
|
185
186
|
class={buttonVariants({
|
|
186
187
|
variant: "ghost",
|
|
187
|
-
|
|
188
|
+
size: "sm",
|
|
188
189
|
})}
|
|
189
190
|
>
|
|
190
191
|
<Plus />
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import type { ParentContext } from "./dataTable.svelte";
|
|
5
5
|
import CanAccess from "../canAccess.svelte";
|
|
6
6
|
import { Download, ListRestart, Plus, Trash, Link } from "lucide-svelte";
|
|
7
|
-
import * as Tooltip from "../ui/tooltip";
|
|
8
7
|
import LlmButton from "../LlmButton.svelte";
|
|
9
8
|
import FilterButton from "./filterButton.svelte";
|
|
10
9
|
import SortButton from "./sortButton.svelte";
|
|
@@ -105,7 +104,7 @@
|
|
|
105
104
|
</script>
|
|
106
105
|
|
|
107
106
|
<div
|
|
108
|
-
class="flex justify-between items-center gap-2 p-2 border-b bg-
|
|
107
|
+
class="flex justify-between items-center gap-2 p-2 border-b bg-card h-12"
|
|
109
108
|
bind:clientWidth={headerWidth}
|
|
110
109
|
>
|
|
111
110
|
<div class="flex items-center gap-1">
|
|
@@ -115,7 +114,7 @@
|
|
|
115
114
|
Icon={Trash}
|
|
116
115
|
onclick={handleDeleteButton}
|
|
117
116
|
variant="outline"
|
|
118
|
-
|
|
117
|
+
size="sm"
|
|
119
118
|
>
|
|
120
119
|
Delete {selectedRecords.length}
|
|
121
120
|
{selectedRecords.length > 1 ? "records" : "record"}
|
|
@@ -135,7 +134,7 @@
|
|
|
135
134
|
variant="outline"
|
|
136
135
|
title="Filter table with AI"
|
|
137
136
|
description="Tell the AI how do you want to filter the table"
|
|
138
|
-
|
|
137
|
+
size="sm"
|
|
139
138
|
format={{
|
|
140
139
|
type: "json_object",
|
|
141
140
|
}}
|
|
@@ -161,7 +160,8 @@
|
|
|
161
160
|
<div>
|
|
162
161
|
<Button
|
|
163
162
|
variant="ghost"
|
|
164
|
-
|
|
163
|
+
size="sm"
|
|
164
|
+
class="text-muted-foreground"
|
|
165
165
|
Icon={ListRestart}
|
|
166
166
|
onclick={() => (params = { ...params })}
|
|
167
167
|
>
|
|
@@ -169,20 +169,13 @@
|
|
|
169
169
|
</Button>
|
|
170
170
|
{#if showImport}
|
|
171
171
|
<CanAccess collection={collectionName} action="create">
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
Icon={Download}
|
|
180
|
-
onSuccessfullSave={() => (params = { ...params })}
|
|
181
|
-
/>
|
|
182
|
-
</Tooltip.Trigger>
|
|
183
|
-
<Tooltip.Content>Import</Tooltip.Content>
|
|
184
|
-
</Tooltip.Root>
|
|
185
|
-
</Tooltip.Provider>
|
|
172
|
+
<ImportButton
|
|
173
|
+
{collectionName}
|
|
174
|
+
variant="outline"
|
|
175
|
+
size="sm"
|
|
176
|
+
Icon={Download}
|
|
177
|
+
onSuccessfullSave={() => (params = { ...params })}
|
|
178
|
+
/>
|
|
186
179
|
</CanAccess>
|
|
187
180
|
{/if}
|
|
188
181
|
<ExtensionsComponents
|
|
@@ -195,7 +188,7 @@
|
|
|
195
188
|
<SelectRecord
|
|
196
189
|
{collectionName}
|
|
197
190
|
variant="outline"
|
|
198
|
-
|
|
191
|
+
size="sm"
|
|
199
192
|
Icon={Link}
|
|
200
193
|
onSelect={handleLink}
|
|
201
194
|
>
|
|
@@ -206,7 +199,7 @@
|
|
|
206
199
|
<CreateDetailViewButton
|
|
207
200
|
{collectionName}
|
|
208
201
|
variant="default"
|
|
209
|
-
|
|
202
|
+
size="sm"
|
|
210
203
|
Icon={Plus}
|
|
211
204
|
onChanges={onCreate ? handleCreate : undefined}
|
|
212
205
|
onSuccessfullSave={onCreate ? undefined : handleCreate}
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<CreateDetailViewButton
|
|
62
62
|
collectionName={child.collection}
|
|
63
63
|
variant="ghost"
|
|
64
|
-
|
|
64
|
+
size="sm"
|
|
65
65
|
Icon={Plus}
|
|
66
66
|
values={{ [child.field]: recordId }}
|
|
67
67
|
onSuccessfullSave={async () => { refreshDataTable = !refreshDataTable; }}
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
flex items-center p-2.5 text-xs h-10
|
|
183
183
|
border-r border-b gap-2
|
|
184
184
|
{headerBorderTop ? 'border-t' : ''}
|
|
185
|
-
bg-muted
|
|
185
|
+
bg-muted
|
|
186
186
|
"
|
|
187
187
|
>
|
|
188
188
|
<!-- collapsable toggle -->
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
class="
|
|
208
208
|
sticky top-0 z-10
|
|
209
209
|
flex items-center p-2.5 text-xs h-10
|
|
210
|
-
bg-muted
|
|
210
|
+
bg-muted
|
|
211
211
|
{lastColumn && !showLastColumnBorder ? '' : 'border-r'}
|
|
212
212
|
border-b gap-2
|
|
213
213
|
{headerBorderTop ? 'border-t' : ''}
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
class="
|
|
235
235
|
sticky top-0 right-0 z-20
|
|
236
236
|
flex items-center p-2.5 h-10
|
|
237
|
-
bg-muted
|
|
237
|
+
bg-muted
|
|
238
238
|
border-l border-b
|
|
239
239
|
{headerBorderTop ? 'border-t' : ''}
|
|
240
240
|
"
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
class="
|
|
250
250
|
sticky left-0
|
|
251
251
|
flex items-center p-2.5 text-xs h-10
|
|
252
|
-
bg-
|
|
252
|
+
bg-card
|
|
253
253
|
border-r gap-2
|
|
254
254
|
"
|
|
255
255
|
>
|
|
@@ -295,8 +295,8 @@
|
|
|
295
295
|
}}
|
|
296
296
|
class="
|
|
297
297
|
flex items-center p-2.5 text-xs h-10 text-nowrap overflow-clip
|
|
298
|
-
{select ? 'cursor-pointer' : ''}
|
|
299
|
-
bg-
|
|
298
|
+
{select ? 'cursor-pointer hover:bg-accent' : ''}
|
|
299
|
+
bg-card
|
|
300
300
|
{lastColumn && !showLastColumnBorder ? '' : 'border-r'}
|
|
301
301
|
"
|
|
302
302
|
>
|
|
@@ -313,7 +313,7 @@
|
|
|
313
313
|
sticky right-0 z-10
|
|
314
314
|
flex items-center p-2.5 text-xs h-10
|
|
315
315
|
border-l gap-2
|
|
316
|
-
bg-
|
|
316
|
+
bg-card
|
|
317
317
|
"
|
|
318
318
|
>
|
|
319
319
|
{@render rowActions?.(entry, index)}
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
{expandedRows[index] ? '' : 'height: 0px;'}
|
|
335
335
|
"
|
|
336
336
|
class="
|
|
337
|
-
sticky left-0 top-0 overflow-auto bg-muted
|
|
337
|
+
sticky left-0 top-0 overflow-auto bg-muted
|
|
338
338
|
|
|
339
339
|
{expandedRows[index] ? 'border-t' : ''}
|
|
340
340
|
"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getFieldRelationTarget } from "../../relations";
|
|
2
|
+
import { getFieldTypeLabel } from "../../utils";
|
|
2
3
|
import { Binary, Braces, Brackets, Calendar, CalendarClock, Clock, Hash, Key, Link, Text, Type, } from "lucide-svelte/icons";
|
|
3
4
|
import { icons } from "lucide-svelte";
|
|
4
5
|
export function getCollectionColumns(ctx, collectionName) {
|
|
@@ -10,7 +11,7 @@ export function getCollectionColumns(ctx, collectionName) {
|
|
|
10
11
|
continue;
|
|
11
12
|
headers.push({
|
|
12
13
|
id: field.key,
|
|
13
|
-
subtext: field.type,
|
|
14
|
+
subtext: getFieldTypeLabel(field.type),
|
|
14
15
|
icon: getFieldIcon(ctx, fieldName, collectionName),
|
|
15
16
|
});
|
|
16
17
|
}
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
<div
|
|
61
61
|
transition:scale={{ duration: 200, easing: cubicOut, start: 0.95 }}
|
|
62
|
-
class="fixed left-1/2 top-1/2 z-40 flex h-[85vh] w-[95vw] max-w-7xl -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border bg-
|
|
62
|
+
class="fixed left-1/2 top-1/2 z-40 flex h-[85vh] w-[95vw] max-w-7xl -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-lg border bg-card shadow-2xl"
|
|
63
63
|
>
|
|
64
64
|
<div class="flex h-12 shrink-0 items-center justify-between gap-4 border-b px-4">
|
|
65
65
|
<div class="text-sm font-medium">{title ?? collectionName}</div>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
parentCollectionName={collectionName}
|
|
38
38
|
collectionName={child.collection}
|
|
39
39
|
parentRecord={{ id: entry.id, collectionName }}
|
|
40
|
-
class="bg-muted
|
|
40
|
+
class="bg-muted border rounded-md overflow-hidden"
|
|
41
41
|
bind:value={entry[child.collection]}
|
|
42
42
|
>
|
|
43
43
|
<CreateManyView
|
|
@@ -143,14 +143,14 @@
|
|
|
143
143
|
<Button
|
|
144
144
|
variant="outline"
|
|
145
145
|
onclick={handleCancel}
|
|
146
|
-
|
|
146
|
+
size="sm"
|
|
147
147
|
Icon={X}
|
|
148
148
|
>
|
|
149
149
|
Cancel
|
|
150
150
|
</Button>
|
|
151
151
|
<Button
|
|
152
152
|
variant="default"
|
|
153
|
-
|
|
153
|
+
size="sm"
|
|
154
154
|
Icon={submitButton?.icon ? submitButton.icon : Plus}
|
|
155
155
|
onclick={handleSave}
|
|
156
156
|
>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
interface LocalProp extends CreateDetailViewProp {
|
|
8
8
|
variant?: ButtonProps["variant"];
|
|
9
|
+
size?: ButtonProps["size"];
|
|
9
10
|
class?: ButtonProps["class"];
|
|
10
11
|
Icon?: ButtonProps["Icon"];
|
|
11
12
|
children?: ButtonProps["children"];
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
|
|
18
19
|
<Button
|
|
19
20
|
variant={props.variant}
|
|
21
|
+
size={props.size}
|
|
20
22
|
class={props.class}
|
|
21
23
|
Icon={props.Icon}
|
|
22
24
|
onclick={() => { open = true; }}
|
|
@@ -2,6 +2,7 @@ import type { CreateDetailViewProp } from "./createDetailView.svelte";
|
|
|
2
2
|
import type { ButtonProps } from "../../ui/button/button.svelte";
|
|
3
3
|
interface LocalProp extends CreateDetailViewProp {
|
|
4
4
|
variant?: ButtonProps["variant"];
|
|
5
|
+
size?: ButtonProps["size"];
|
|
5
6
|
class?: ButtonProps["class"];
|
|
6
7
|
Icon?: ButtonProps["Icon"];
|
|
7
8
|
children?: ButtonProps["children"];
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
{#each children as child}
|
|
55
55
|
{@const localAdditions = (localChildren[child.collection]?.created.length ?? 0) + (localChildren[child.collection]?.linked.length ?? 0)}
|
|
56
56
|
{#if localAdditions === 0}
|
|
57
|
-
<div class="rounded-lg border bg-muted
|
|
57
|
+
<div class="rounded-lg border bg-muted overflow-hidden flex flex-col">
|
|
58
58
|
<div class="flex flex-col items-center justify-center gap-3 py-6 px-4">
|
|
59
59
|
<div class="flex flex-col items-center gap-2 text-center">
|
|
60
60
|
<div class="flex items-center gap-1.5 text-sm font-medium text-muted-foreground">
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
<SelectRecord
|
|
68
68
|
collectionName={child.collection}
|
|
69
69
|
variant="outline"
|
|
70
|
-
|
|
70
|
+
size="sm"
|
|
71
71
|
Icon={Link}
|
|
72
72
|
onSelect={(r) => handleEmptyLink(child.collection, r)}
|
|
73
73
|
>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<CreateDetailViewButton
|
|
77
77
|
collectionName={child.collection}
|
|
78
78
|
variant="default"
|
|
79
|
-
|
|
79
|
+
size="sm"
|
|
80
80
|
Icon={Plus}
|
|
81
81
|
onChanges={(c) => handleEmptyCreate(child.collection, c)}
|
|
82
82
|
>
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
88
|
{:else}
|
|
89
|
-
<div class="rounded-lg border bg-
|
|
89
|
+
<div class="rounded-lg border bg-card overflow-hidden flex flex-col max-h-96">
|
|
90
90
|
<DataTable
|
|
91
91
|
collectionName={child.collection}
|
|
92
92
|
searchParams={{ children_of: collectionName, parent_id: -1 }}
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
>
|
|
113
113
|
<div
|
|
114
114
|
class="
|
|
115
|
-
flex items-center justify-between px-2 h-10 bg-muted
|
|
115
|
+
flex items-center justify-between px-2 h-10 bg-muted
|
|
116
116
|
{expanded ? 'border-b' : ''}
|
|
117
117
|
"
|
|
118
118
|
>
|
|
@@ -137,12 +137,12 @@
|
|
|
137
137
|
text="Select existing"
|
|
138
138
|
onSelect={onRecordSelect}
|
|
139
139
|
filter={selectRecordFilter}
|
|
140
|
-
|
|
140
|
+
size="sm"
|
|
141
141
|
variant="ghost"
|
|
142
142
|
/>
|
|
143
143
|
<CreateDetailViewButton
|
|
144
144
|
variant="ghost"
|
|
145
|
-
|
|
145
|
+
size="sm"
|
|
146
146
|
Icon={Plus}
|
|
147
147
|
{collectionName}
|
|
148
148
|
onChanges={(updated) => { addChanges = updated; }}
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
</div>
|
|
166
166
|
</div>
|
|
167
167
|
{#if expanded}
|
|
168
|
-
<div bind:clientWidth={tableWidth} class="bg-muted
|
|
168
|
+
<div bind:clientWidth={tableWidth} class="bg-muted overflow-auto">
|
|
169
169
|
<Table
|
|
170
170
|
data={entries}
|
|
171
171
|
{columns}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { getExtensionUtils } from "../../extensions/extensionUtils";
|
|
7
7
|
import { getField, getFieldIcon } from "../dataTable/utils";
|
|
8
8
|
import FieldInput from "./fieldInput.svelte";
|
|
9
|
+
import { getFieldTypeLabel } from "../../utils";
|
|
9
10
|
|
|
10
11
|
interface Props {
|
|
11
12
|
collectionName: string;
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
<div class="h-fit">{field.label}</div>
|
|
51
52
|
<div class="flex h-fit items-center gap-1 text-[0.7rem] text-muted-foreground">
|
|
52
53
|
<FieldIcon size="12" />
|
|
53
|
-
{field.type}
|
|
54
|
+
{getFieldTypeLabel(field.type)}
|
|
54
55
|
</div>
|
|
55
56
|
</div>
|
|
56
57
|
</ExtensionsComponents>
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
{:else if field.label === "id"}
|
|
88
88
|
<Input
|
|
89
89
|
placeholder="AUTO GENERATED"
|
|
90
|
-
class="bg-muted
|
|
90
|
+
class="bg-muted text-xs"
|
|
91
91
|
bind:value
|
|
92
92
|
/>
|
|
93
93
|
{:else if fieldRelationTarget && entry}
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
>
|
|
128
128
|
<Select.Trigger
|
|
129
129
|
class="
|
|
130
|
-
h-9 w-full bg-muted
|
|
130
|
+
h-9 w-full bg-muted pr-8
|
|
131
131
|
{destructive ? 'border-destructive bg-destructive/10' : ''}
|
|
132
132
|
"
|
|
133
133
|
>
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
placeholder={ui?.placeholder ? ui.placeholder : "NULL"}
|
|
160
160
|
type="text"
|
|
161
161
|
class="
|
|
162
|
-
bg-muted
|
|
162
|
+
bg-muted text-xs
|
|
163
163
|
{destructive ? 'border-destructive bg-destructive/10' : ''}
|
|
164
164
|
"
|
|
165
165
|
bind:value
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
placeholder={ui?.placeholder ? ui.placeholder : value === "" ? "EMPTY STRING" : "NULL"}
|
|
170
170
|
rows={5}
|
|
171
171
|
class="
|
|
172
|
-
bg-muted
|
|
172
|
+
bg-muted text-xs
|
|
173
173
|
{destructive ? 'border-destructive bg-destructive/10' : ''}
|
|
174
174
|
"
|
|
175
175
|
bind:value
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
type="date"
|
|
180
180
|
placeholder={ui?.placeholder ? ui.placeholder : "NULL"}
|
|
181
181
|
class="
|
|
182
|
-
dateInput block w-full bg-muted
|
|
182
|
+
dateInput block w-full bg-muted pr-9 text-xs
|
|
183
183
|
{destructive ? 'border-destructive bg-destructive/10' : ''}
|
|
184
184
|
"
|
|
185
185
|
bind:value={
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
type="time"
|
|
199
199
|
placeholder={ui?.placeholder ? ui.placeholder : "NULL"}
|
|
200
200
|
class="
|
|
201
|
-
dateInput block w-full bg-muted
|
|
201
|
+
dateInput block w-full bg-muted pr-9 text-xs
|
|
202
202
|
{destructive ? 'border-destructive bg-destructive/10' : ''}
|
|
203
203
|
"
|
|
204
204
|
bind:value={
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
type="datetime-local"
|
|
217
217
|
placeholder={ui?.placeholder ? ui.placeholder : "NULL"}
|
|
218
218
|
class="
|
|
219
|
-
dateInput block w-full bg-muted
|
|
219
|
+
dateInput block w-full bg-muted pr-9 text-xs
|
|
220
220
|
{destructive ? 'border-destructive bg-destructive/10' : ''}
|
|
221
221
|
"
|
|
222
222
|
bind:value={
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
<Select.Trigger
|
|
238
238
|
placeholder={ui?.placeholder ? ui.placeholder : "NULL"}
|
|
239
239
|
class="
|
|
240
|
-
bg-muted
|
|
240
|
+
bg-muted pr-9
|
|
241
241
|
{destructive ? 'border-destructive bg-destructive/10' : ''}
|
|
242
242
|
"
|
|
243
243
|
>
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
scale={isFloat ? 20 : 0}
|
|
266
266
|
groupDigits={ui?.groupDigits ?? false}
|
|
267
267
|
class="
|
|
268
|
-
bg-muted
|
|
268
|
+
bg-muted text-xs
|
|
269
269
|
{destructive ? 'border-destructive bg-destructive/10' : ''}
|
|
270
270
|
"
|
|
271
271
|
bind:value
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
placeholder={ui?.placeholder ? ui.placeholder : "NULL"}
|
|
276
276
|
type="text"
|
|
277
277
|
class="
|
|
278
|
-
bg-muted
|
|
278
|
+
bg-muted text-xs
|
|
279
279
|
{destructive ? 'border-destructive bg-destructive/10' : ''}
|
|
280
280
|
"
|
|
281
281
|
bind:value
|