@lobb-js/studio 0.1.32 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/{dist → src/lib/components}/LlmButton.svelte +2 -2
- package/{dist → src/lib/components}/Studio.svelte +10 -10
- package/{dist → src/lib/components}/alertView.svelte +1 -1
- package/{dist → src/lib/components}/breadCrumbs.svelte +2 -2
- package/{dist → src/lib/components}/combobox.svelte +4 -4
- package/{dist → src/lib/components}/confirmationDialog/confirmationDialog.svelte +1 -1
- package/src/lib/components/confirmationDialog/store.svelte.ts +28 -0
- package/{dist → src/lib/components}/createManyButton.svelte +2 -2
- package/{dist → src/lib/components}/dataTable/childRecords.svelte +2 -2
- package/{dist → src/lib/components}/dataTable/dataTable.svelte +3 -3
- package/{dist → src/lib/components}/dataTable/fieldCell.svelte +1 -1
- package/{dist → src/lib/components}/dataTable/filter.svelte +2 -2
- package/{dist → src/lib/components}/dataTable/filterButton.svelte +1 -1
- package/{dist → src/lib/components}/dataTable/header.svelte +2 -2
- package/{dist → src/lib/components}/dataTable/sort.svelte +2 -2
- package/{dist → src/lib/components}/dataTable/sortButton.svelte +2 -2
- package/src/lib/components/dataTable/utils.ts +127 -0
- package/{dist → src/lib/components}/detailView/create/children.svelte +3 -3
- package/{dist → src/lib/components}/detailView/create/createDetailView.svelte +6 -6
- package/{dist → src/lib/components}/detailView/create/createDetailViewButton.svelte +2 -2
- package/{dist → src/lib/components}/detailView/create/createManyView.svelte +5 -5
- package/{dist → src/lib/components}/detailView/create/subRecords.svelte +1 -1
- package/{dist → src/lib/components}/detailView/fieldInput.svelte +4 -4
- package/{dist → src/lib/components}/detailView/fieldInputReplacement.svelte +1 -1
- package/src/lib/components/detailView/store.svelte.ts +61 -0
- package/{dist → src/lib/components}/detailView/update/children.svelte +4 -4
- package/{dist → src/lib/components}/detailView/update/updateDetailView.svelte +6 -6
- package/{dist → src/lib/components}/detailView/update/updateDetailViewButton.svelte +2 -2
- package/src/lib/components/detailView/utils.ts +177 -0
- package/{dist → src/lib/components}/diffViewer.svelte +1 -1
- package/{dist → src/lib/components}/drawer.svelte +1 -1
- package/{dist → src/lib/components}/extensionsComponents.svelte +1 -1
- package/{dist → src/lib/components}/header.svelte +1 -1
- package/src/lib/components/loadingTypesForMonacoEditor.ts +36 -0
- package/{dist → src/lib/components}/miniSidebar.svelte +7 -7
- package/{dist → src/lib/components}/monacoEditor.svelte +1 -1
- package/{dist → src/lib/components}/rangeCalendarButton.svelte +4 -4
- package/{dist → src/lib/components}/selectRecord.svelte +1 -1
- package/{dist → src/lib/components}/setServerPage.svelte +2 -2
- package/{dist/sidebar/index.d.ts → src/lib/components/sidebar/index.ts} +2 -1
- package/{dist → src/lib/components}/sidebar/sidebar.svelte +1 -1
- package/{dist → src/lib/components}/singletone.svelte +1 -1
- package/{dist → src/lib/components}/ui/accordion/accordion-content.svelte +1 -1
- package/{dist → src/lib/components}/ui/accordion/accordion-item.svelte +1 -1
- package/{dist → src/lib/components}/ui/accordion/accordion-trigger.svelte +1 -1
- package/{dist/ui/accordion/index.js → src/lib/components/ui/accordion/index.ts} +13 -4
- package/{dist → src/lib/components}/ui/alert/alert-description.svelte +1 -1
- package/{dist → src/lib/components}/ui/alert/alert-title.svelte +1 -1
- package/{dist → src/lib/components}/ui/alert/alert.svelte +1 -1
- package/{dist/ui/alert/index.d.ts → src/lib/components/ui/alert/index.ts} +10 -1
- package/{dist → src/lib/components}/ui/alert-dialog/alert-dialog-action.svelte +2 -2
- package/{dist → src/lib/components}/ui/alert-dialog/alert-dialog-cancel.svelte +2 -2
- package/{dist → src/lib/components}/ui/alert-dialog/alert-dialog-content.svelte +1 -1
- package/{dist → src/lib/components}/ui/alert-dialog/alert-dialog-description.svelte +1 -1
- package/{dist → src/lib/components}/ui/alert-dialog/alert-dialog-footer.svelte +1 -1
- package/{dist → src/lib/components}/ui/alert-dialog/alert-dialog-header.svelte +1 -1
- package/{dist → src/lib/components}/ui/alert-dialog/alert-dialog-overlay.svelte +1 -1
- package/{dist → src/lib/components}/ui/alert-dialog/alert-dialog-title.svelte +1 -1
- package/src/lib/components/ui/alert-dialog/index.ts +40 -0
- package/{dist → src/lib/components}/ui/breadcrumb/breadcrumb-ellipsis.svelte +1 -1
- package/{dist → src/lib/components}/ui/breadcrumb/breadcrumb-item.svelte +1 -1
- package/{dist → src/lib/components}/ui/breadcrumb/breadcrumb-link.svelte +1 -1
- package/{dist → src/lib/components}/ui/breadcrumb/breadcrumb-list.svelte +1 -1
- package/{dist → src/lib/components}/ui/breadcrumb/breadcrumb-page.svelte +1 -1
- package/{dist → src/lib/components}/ui/breadcrumb/breadcrumb-separator.svelte +1 -1
- package/{dist/ui/breadcrumb/index.d.ts → src/lib/components/ui/breadcrumb/index.ts} +18 -1
- package/{dist → src/lib/components}/ui/button/button.svelte +1 -1
- package/src/lib/components/ui/button/index.ts +17 -0
- package/{dist → src/lib/components}/ui/checkbox/checkbox.svelte +1 -1
- package/src/lib/components/ui/checkbox/index.ts +6 -0
- package/{dist → src/lib/components}/ui/command/command-dialog.svelte +1 -1
- package/{dist → src/lib/components}/ui/command/command-empty.svelte +1 -1
- package/{dist → src/lib/components}/ui/command/command-group.svelte +1 -1
- package/{dist → src/lib/components}/ui/command/command-input.svelte +1 -1
- package/{dist → src/lib/components}/ui/command/command-item.svelte +1 -1
- package/{dist → src/lib/components}/ui/command/command-link-item.svelte +1 -1
- package/{dist → src/lib/components}/ui/command/command-list.svelte +1 -1
- package/{dist → src/lib/components}/ui/command/command-separator.svelte +1 -1
- package/{dist → src/lib/components}/ui/command/command-shortcut.svelte +1 -1
- package/{dist → src/lib/components}/ui/command/command.svelte +1 -1
- package/{dist/ui/command/index.d.ts → src/lib/components/ui/command/index.ts} +29 -2
- package/{dist → src/lib/components}/ui/dialog/dialog-content.svelte +1 -1
- package/{dist → src/lib/components}/ui/dialog/dialog-description.svelte +1 -1
- package/{dist → src/lib/components}/ui/dialog/dialog-footer.svelte +1 -1
- package/{dist → src/lib/components}/ui/dialog/dialog-header.svelte +1 -1
- package/{dist → src/lib/components}/ui/dialog/dialog-overlay.svelte +1 -1
- package/{dist → src/lib/components}/ui/dialog/dialog-title.svelte +1 -1
- package/src/lib/components/ui/dialog/index.ts +37 -0
- package/src/lib/components/ui/input/index.ts +7 -0
- package/{dist → src/lib/components}/ui/input/input.svelte +1 -1
- package/src/lib/components/ui/label/index.ts +7 -0
- package/{dist → src/lib/components}/ui/label/label.svelte +1 -1
- package/src/lib/components/ui/popover/index.ts +17 -0
- package/{dist → src/lib/components}/ui/popover/popover-content.svelte +1 -1
- package/{dist/ui/range-calendar/index.d.ts → src/lib/components/ui/range-calendar/index.ts} +17 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-cell.svelte +1 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-day.svelte +2 -2
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-grid-body.svelte +1 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-grid-head.svelte +1 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-grid-row.svelte +1 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-grid.svelte +1 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-head-cell.svelte +1 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-header.svelte +1 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-heading.svelte +1 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-months.svelte +1 -1
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-next-button.svelte +2 -2
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar-prev-button.svelte +2 -2
- package/{dist → src/lib/components}/ui/range-calendar/range-calendar.svelte +1 -1
- package/src/lib/components/ui/select/index.ts +34 -0
- package/{dist → src/lib/components}/ui/select/select-content.svelte +1 -1
- package/{dist → src/lib/components}/ui/select/select-group-heading.svelte +1 -1
- package/{dist → src/lib/components}/ui/select/select-item.svelte +1 -1
- package/{dist → src/lib/components}/ui/select/select-scroll-down-button.svelte +1 -1
- package/{dist → src/lib/components}/ui/select/select-scroll-up-button.svelte +1 -1
- package/{dist → src/lib/components}/ui/select/select-separator.svelte +2 -2
- package/{dist → src/lib/components}/ui/select/select-trigger.svelte +1 -1
- package/src/lib/components/ui/separator/index.ts +7 -0
- package/{dist → src/lib/components}/ui/separator/separator.svelte +1 -1
- package/src/lib/components/ui/skeleton/index.ts +7 -0
- package/{dist → src/lib/components}/ui/skeleton/skeleton.svelte +1 -1
- package/src/lib/components/ui/switch/index.ts +7 -0
- package/{dist → src/lib/components}/ui/switch/switch.svelte +1 -1
- package/src/lib/components/ui/textarea/index.ts +7 -0
- package/{dist → src/lib/components}/ui/textarea/textarea.svelte +1 -1
- package/src/lib/components/ui/tooltip/index.ts +18 -0
- package/{dist → src/lib/components}/ui/tooltip/tooltip-content.svelte +1 -1
- package/{dist → src/lib/components}/workflowEditor.svelte +5 -5
- package/vite-plugins/contextual-lib-alias.js +7 -2
- package/dist/LlmButton.svelte.d.ts +0 -17
- package/dist/Studio.svelte.d.ts +0 -6
- package/dist/alertView.svelte.d.ts +0 -8
- package/dist/breadCrumbs.svelte.d.ts +0 -3
- package/dist/combobox.svelte.d.ts +0 -15
- package/dist/confirmationDialog/confirmationDialog.svelte.d.ts +0 -8
- package/dist/confirmationDialog/store.svelte.d.ts +0 -1
- package/dist/confirmationDialog/store.svelte.js +0 -69
- package/dist/createManyButton.svelte.d.ts +0 -8
- package/dist/dataTable/childRecords.svelte.d.ts +0 -9
- package/dist/dataTable/dataTable.svelte.d.ts +0 -15
- package/dist/dataTable/fieldCell.svelte.d.ts +0 -10
- package/dist/dataTable/filter.svelte.d.ts +0 -10
- package/dist/dataTable/filterButton.svelte.d.ts +0 -8
- package/dist/dataTable/footer.svelte.d.ts +0 -8
- package/dist/dataTable/header.svelte.d.ts +0 -10
- package/dist/dataTable/sort.svelte.d.ts +0 -8
- package/dist/dataTable/sortButton.svelte.d.ts +0 -8
- package/dist/dataTable/table.svelte.d.ts +0 -32
- package/dist/dataTable/utils.d.ts +0 -7
- package/dist/dataTable/utils.js +0 -111
- package/dist/detailView/create/children.svelte.d.ts +0 -8
- package/dist/detailView/create/createDetailView.svelte.d.ts +0 -18
- package/dist/detailView/create/createDetailViewButton.svelte.d.ts +0 -11
- package/dist/detailView/create/createManyView.svelte.d.ts +0 -16
- package/dist/detailView/create/subRecords.svelte.d.ts +0 -8
- package/dist/detailView/detailViewForm.svelte.d.ts +0 -48
- package/dist/detailView/fieldCustomInput.svelte.d.ts +0 -10
- package/dist/detailView/fieldInput.svelte.d.ts +0 -10
- package/dist/detailView/fieldInputReplacement.svelte.d.ts +0 -11
- package/dist/detailView/store.svelte.d.ts +0 -4
- package/dist/detailView/store.svelte.js +0 -125
- package/dist/detailView/update/children.svelte.d.ts +0 -7
- package/dist/detailView/update/updateDetailView.svelte.d.ts +0 -19
- package/dist/detailView/update/updateDetailViewButton.svelte.d.ts +0 -11
- package/dist/detailView/utils.d.ts +0 -8
- package/dist/detailView/utils.js +0 -165
- package/dist/diffViewer.svelte.d.ts +0 -9
- package/dist/drawer.svelte.d.ts +0 -8
- package/dist/extensionsComponents.svelte.d.ts +0 -11
- package/dist/foreingKeyInput.svelte.d.ts +0 -11
- package/dist/header.svelte.d.ts +0 -6
- package/dist/loadingTypesForMonacoEditor.d.ts +0 -7
- package/dist/loadingTypesForMonacoEditor.js +0 -72
- package/dist/miniSidebar.svelte.d.ts +0 -20
- package/dist/monacoEditor.svelte.d.ts +0 -13
- package/dist/rangeCalendarButton.svelte.d.ts +0 -7
- package/dist/selectRecord.svelte.d.ts +0 -15
- package/dist/setServerPage.svelte.d.ts +0 -18
- package/dist/sidebar/index.js +0 -3
- package/dist/sidebar/sidebar.svelte.d.ts +0 -17
- package/dist/sidebar/sidebarElements.svelte.d.ts +0 -19
- package/dist/sidebar/sidebarTrigger.svelte.d.ts +0 -7
- package/dist/singletone.svelte.d.ts +0 -6
- package/dist/ui/accordion/accordion-content.svelte.d.ts +0 -4
- package/dist/ui/accordion/accordion-item.svelte.d.ts +0 -4
- package/dist/ui/accordion/accordion-trigger.svelte.d.ts +0 -7
- package/dist/ui/accordion/index.d.ts +0 -6
- package/dist/ui/alert/alert-description.svelte.d.ts +0 -5
- package/dist/ui/alert/alert-title.svelte.d.ts +0 -8
- package/dist/ui/alert/alert.svelte.d.ts +0 -26
- package/dist/ui/alert/index.js +0 -7
- package/dist/ui/alert-dialog/alert-dialog-action.svelte.d.ts +0 -4
- package/dist/ui/alert-dialog/alert-dialog-cancel.svelte.d.ts +0 -4
- package/dist/ui/alert-dialog/alert-dialog-content.svelte.d.ts +0 -7
- package/dist/ui/alert-dialog/alert-dialog-description.svelte.d.ts +0 -4
- package/dist/ui/alert-dialog/alert-dialog-footer.svelte.d.ts +0 -5
- package/dist/ui/alert-dialog/alert-dialog-header.svelte.d.ts +0 -5
- package/dist/ui/alert-dialog/alert-dialog-overlay.svelte.d.ts +0 -4
- package/dist/ui/alert-dialog/alert-dialog-title.svelte.d.ts +0 -4
- package/dist/ui/alert-dialog/index.d.ts +0 -13
- package/dist/ui/alert-dialog/index.js +0 -15
- package/dist/ui/breadcrumb/breadcrumb-ellipsis.svelte.d.ts +0 -5
- package/dist/ui/breadcrumb/breadcrumb-item.svelte.d.ts +0 -5
- package/dist/ui/breadcrumb/breadcrumb-link.svelte.d.ts +0 -11
- package/dist/ui/breadcrumb/breadcrumb-list.svelte.d.ts +0 -5
- package/dist/ui/breadcrumb/breadcrumb-page.svelte.d.ts +0 -5
- package/dist/ui/breadcrumb/breadcrumb-separator.svelte.d.ts +0 -5
- package/dist/ui/breadcrumb/breadcrumb.svelte.d.ts +0 -5
- package/dist/ui/breadcrumb/index.js +0 -10
- package/dist/ui/button/button.svelte.d.ts +0 -60
- package/dist/ui/button/index.d.ts +0 -2
- package/dist/ui/button/index.js +0 -4
- package/dist/ui/checkbox/checkbox.svelte.d.ts +0 -4
- package/dist/ui/checkbox/index.d.ts +0 -2
- package/dist/ui/checkbox/index.js +0 -4
- package/dist/ui/command/command-dialog.svelte.d.ts +0 -9
- package/dist/ui/command/command-empty.svelte.d.ts +0 -4
- package/dist/ui/command/command-group.svelte.d.ts +0 -7
- package/dist/ui/command/command-input.svelte.d.ts +0 -4
- package/dist/ui/command/command-item.svelte.d.ts +0 -4
- package/dist/ui/command/command-link-item.svelte.d.ts +0 -4
- package/dist/ui/command/command-list.svelte.d.ts +0 -4
- package/dist/ui/command/command-separator.svelte.d.ts +0 -4
- package/dist/ui/command/command-shortcut.svelte.d.ts +0 -5
- package/dist/ui/command/command.svelte.d.ts +0 -4
- package/dist/ui/command/index.js +0 -15
- package/dist/ui/dialog/dialog-content.svelte.d.ts +0 -9
- package/dist/ui/dialog/dialog-description.svelte.d.ts +0 -4
- package/dist/ui/dialog/dialog-footer.svelte.d.ts +0 -5
- package/dist/ui/dialog/dialog-header.svelte.d.ts +0 -5
- package/dist/ui/dialog/dialog-overlay.svelte.d.ts +0 -4
- package/dist/ui/dialog/dialog-title.svelte.d.ts +0 -4
- package/dist/ui/dialog/index.d.ts +0 -12
- package/dist/ui/dialog/index.js +0 -14
- package/dist/ui/input/index.d.ts +0 -2
- package/dist/ui/input/index.js +0 -4
- package/dist/ui/input/input.svelte.d.ts +0 -13
- package/dist/ui/label/index.d.ts +0 -2
- package/dist/ui/label/index.js +0 -4
- package/dist/ui/label/label.svelte.d.ts +0 -4
- package/dist/ui/popover/index.d.ts +0 -6
- package/dist/ui/popover/index.js +0 -8
- package/dist/ui/popover/popover-content.svelte.d.ts +0 -7
- package/dist/ui/range-calendar/index.js +0 -16
- package/dist/ui/range-calendar/range-calendar-cell.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar-day.svelte.d.ts +0 -6
- package/dist/ui/range-calendar/range-calendar-grid-body.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar-grid-head.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar-grid-row.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar-grid.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar-head-cell.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar-header.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar-heading.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar-months.svelte.d.ts +0 -5
- package/dist/ui/range-calendar/range-calendar-next-button.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar-prev-button.svelte.d.ts +0 -4
- package/dist/ui/range-calendar/range-calendar.svelte.d.ts +0 -5
- package/dist/ui/select/index.d.ts +0 -11
- package/dist/ui/select/index.js +0 -13
- package/dist/ui/select/select-content.svelte.d.ts +0 -7
- package/dist/ui/select/select-group-heading.svelte.d.ts +0 -4
- package/dist/ui/select/select-item.svelte.d.ts +0 -4
- package/dist/ui/select/select-scroll-down-button.svelte.d.ts +0 -4
- package/dist/ui/select/select-scroll-up-button.svelte.d.ts +0 -4
- package/dist/ui/select/select-separator.svelte.d.ts +0 -4
- package/dist/ui/select/select-trigger.svelte.d.ts +0 -4
- package/dist/ui/separator/index.d.ts +0 -2
- package/dist/ui/separator/index.js +0 -4
- package/dist/ui/separator/separator.svelte.d.ts +0 -4
- package/dist/ui/skeleton/index.d.ts +0 -2
- package/dist/ui/skeleton/index.js +0 -4
- package/dist/ui/skeleton/skeleton.svelte.d.ts +0 -5
- package/dist/ui/sonner/index.js +0 -1
- package/dist/ui/sonner/sonner.svelte.d.ts +0 -4
- package/dist/ui/switch/index.d.ts +0 -2
- package/dist/ui/switch/index.js +0 -4
- package/dist/ui/switch/switch.svelte.d.ts +0 -4
- package/dist/ui/textarea/index.d.ts +0 -2
- package/dist/ui/textarea/index.js +0 -4
- package/dist/ui/textarea/textarea.svelte.d.ts +0 -5
- package/dist/ui/tooltip/index.d.ts +0 -6
- package/dist/ui/tooltip/index.js +0 -8
- package/dist/ui/tooltip/tooltip-content.svelte.d.ts +0 -4
- package/dist/workflowEditor.svelte.d.ts +0 -16
- /package/{dist → src/lib/components}/dataTable/footer.svelte +0 -0
- /package/{dist → src/lib/components}/dataTable/table.svelte +0 -0
- /package/{dist → src/lib/components}/detailView/detailViewForm.svelte +0 -0
- /package/{dist → src/lib/components}/detailView/fieldCustomInput.svelte +0 -0
- /package/{dist → src/lib/components}/foreingKeyInput.svelte +0 -0
- /package/{dist → src/lib/components}/sidebar/sidebarElements.svelte +0 -0
- /package/{dist → src/lib/components}/sidebar/sidebarTrigger.svelte +0 -0
- /package/{dist → src/lib/components}/ui/breadcrumb/breadcrumb.svelte +0 -0
- /package/{dist/ui/sonner/index.d.ts → src/lib/components/ui/sonner/index.ts} +0 -0
- /package/{dist → src/lib/components}/ui/sonner/sonner.svelte +0 -0
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { lobb } from "
|
|
2
|
+
import { lobb } from "$lib";
|
|
3
3
|
import { Brain, LoaderIcon, Send } from "lucide-svelte";
|
|
4
4
|
import Button, { type ButtonProps } from "./ui/button/button.svelte";
|
|
5
5
|
import * as Popover from "./ui/popover";
|
|
6
6
|
import Textarea from "./ui/textarea/textarea.svelte";
|
|
7
7
|
import { toast } from "svelte-sonner";
|
|
8
|
-
import { ctx } from "
|
|
8
|
+
import { ctx } from "$lib/store.svelte";
|
|
9
9
|
|
|
10
10
|
interface LocalProp {
|
|
11
11
|
value?: any;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Toaster } from "
|
|
2
|
+
import { Toaster } from "$lib/components/ui/sonner";
|
|
3
3
|
import { onMount, onDestroy } from "svelte";
|
|
4
4
|
import { ModeWatcher } from "mode-watcher";
|
|
5
|
-
import { ctx } from "
|
|
6
|
-
import { lobb } from "
|
|
7
|
-
import Header from "
|
|
5
|
+
import { ctx } from "$lib/store.svelte";
|
|
6
|
+
import { lobb } from "$lib";
|
|
7
|
+
import Header from "$lib/components/header.svelte";
|
|
8
8
|
import { LoaderCircle, ServerOff } from "lucide-svelte";
|
|
9
|
-
import Dialog from "
|
|
10
|
-
import MiniSidebar from "
|
|
11
|
-
import SetServerPage from "
|
|
12
|
-
import * as Tooltip from "
|
|
9
|
+
import Dialog from "$lib/components/confirmationDialog/confirmationDialog.svelte";
|
|
10
|
+
import MiniSidebar from "$lib/components/miniSidebar.svelte";
|
|
11
|
+
import SetServerPage from "$lib/components/setServerPage.svelte";
|
|
12
|
+
import * as Tooltip from "$lib/components/ui/tooltip";
|
|
13
13
|
import { Router, Route, Fallback, init as initRouter, } from "@wjfe/n-savant";
|
|
14
14
|
import {
|
|
15
15
|
executeExtensionsOnStartup,
|
|
16
16
|
loadExtensions,
|
|
17
|
-
} from "
|
|
18
|
-
import { mediaQueries } from "
|
|
17
|
+
} from "$lib/extensions/extensionUtils";
|
|
18
|
+
import { mediaQueries } from "$lib/utils";
|
|
19
19
|
import Home from "../../routes/home.svelte";
|
|
20
20
|
import DataModel from "../../routes/data_model/dataModel.svelte";
|
|
21
21
|
import Collections from "../../routes/collections/collections.svelte";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import * as Breadcrumb from "./ui/breadcrumb";
|
|
3
|
-
import { ctx } from "
|
|
4
|
-
import { mediaQueries } from "
|
|
3
|
+
import { ctx } from "$lib/store.svelte";
|
|
4
|
+
import { mediaQueries } from "$lib/utils";
|
|
5
5
|
import { location } from "@wjfe/n-savant";
|
|
6
6
|
|
|
7
7
|
const isSmall = $derived(!mediaQueries.sm.current);
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import CheckIcon from "@lucide/svelte/icons/check";
|
|
3
3
|
import ChevronsUpDownIcon from "@lucide/svelte/icons/chevrons-up-down";
|
|
4
4
|
import { tick } from "svelte";
|
|
5
|
-
import * as Command from "
|
|
6
|
-
import * as Popover from "
|
|
7
|
-
import { Button } from "
|
|
8
|
-
import { cn } from "
|
|
5
|
+
import * as Command from "$lib/components/ui/command/index.js";
|
|
6
|
+
import * as Popover from "$lib/components/ui/popover/index.js";
|
|
7
|
+
import { Button } from "$lib/components/ui/button/index.js";
|
|
8
|
+
import { cn } from "$lib/utils.js";
|
|
9
9
|
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
10
10
|
|
|
11
11
|
interface Option {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { mount, unmount } from "svelte";
|
|
2
|
+
import ConfirmationDialog from "./confirmationDialog.svelte";
|
|
3
|
+
|
|
4
|
+
export function showDialog(title: string, description: string): Promise<boolean> {
|
|
5
|
+
return new Promise((resolve) => {
|
|
6
|
+
const targetElement = document.querySelector('main');
|
|
7
|
+
|
|
8
|
+
if (!targetElement) {
|
|
9
|
+
throw new Error("main html element doesn't exist for some reason");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const mountedElement = mount(ConfirmationDialog, {
|
|
13
|
+
target: targetElement,
|
|
14
|
+
props: {
|
|
15
|
+
title,
|
|
16
|
+
description,
|
|
17
|
+
onDecision: async (result: boolean) => {
|
|
18
|
+
resolve(result);
|
|
19
|
+
await unmount(mountedElement, {
|
|
20
|
+
outro: true
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
console.log("the dialog is mounted man")
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import Button, { type ButtonProps } from "./ui/button/button.svelte";
|
|
5
5
|
import { toast } from "svelte-sonner";
|
|
6
6
|
import MonacoEditor from "./monacoEditor.svelte";
|
|
7
|
-
import { lobb } from "
|
|
8
|
-
import { calculateDrawerWidth } from "
|
|
7
|
+
import { lobb } from "$lib";
|
|
8
|
+
import { calculateDrawerWidth } from "$lib/utils";
|
|
9
9
|
import Drawer from "./drawer.svelte";
|
|
10
10
|
|
|
11
11
|
interface LocalProps extends ButtonProps {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { ctx } from "
|
|
2
|
+
import { ctx } from "$lib/store.svelte";
|
|
3
3
|
import { ChevronRight, Plus, Smartphone, Table } from "lucide-svelte";
|
|
4
4
|
import DataTable from "./dataTable.svelte";
|
|
5
5
|
import CreateDetailViewButton from "../detailView/create/createDetailViewButton.svelte";
|
|
6
6
|
import ExtensionsComponents from "../extensionsComponents.svelte";
|
|
7
|
-
import { getExtensionUtils } from "
|
|
7
|
+
import { getExtensionUtils } from "$lib/extensions/extensionUtils";
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
10
10
|
collectionName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import _ from "lodash";
|
|
3
|
-
import { lobb } from "
|
|
3
|
+
import { lobb } from "$lib";
|
|
4
4
|
import Footer from "./footer.svelte";
|
|
5
5
|
import Header from "./header.svelte";
|
|
6
6
|
import Table, { type TableProps } from "./table.svelte";
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
import ChildRecords from "./childRecords.svelte";
|
|
11
11
|
import FieldCell from "./fieldCell.svelte";
|
|
12
12
|
import Skeleton from "../ui/skeleton/skeleton.svelte";
|
|
13
|
-
import { ctx } from "
|
|
13
|
+
import { ctx } from "$lib/store.svelte";
|
|
14
14
|
import Button from "../ui/button/button.svelte";
|
|
15
15
|
import { showDialog } from "../confirmationDialog/store.svelte";
|
|
16
16
|
import UpdateDetailViewButton from "../detailView/update/updateDetailViewButton.svelte";
|
|
17
|
-
import { emitEvent } from "
|
|
17
|
+
import { emitEvent } from "$lib/eventSystem";
|
|
18
18
|
import type { Snippet } from "svelte";
|
|
19
19
|
|
|
20
20
|
interface Props {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getFieldRelation } from "
|
|
2
|
+
import { getFieldRelation } from "$lib/utils";
|
|
3
3
|
import { ExternalLink } from "lucide-svelte";
|
|
4
4
|
import UpdateDetailViewButton from "../detailView/update/updateDetailViewButton.svelte";
|
|
5
5
|
import { getField } from "./utils";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import * as Popover from "
|
|
2
|
+
import * as Popover from "$lib/components/ui/popover/index.js";
|
|
3
3
|
import Filter from "./filter.svelte";
|
|
4
4
|
import {
|
|
5
5
|
Plus,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
} from "lucide-svelte";
|
|
12
12
|
import { buttonVariants } from "../ui/button";
|
|
13
13
|
import _ from "lodash";
|
|
14
|
-
import { ctx } from "
|
|
14
|
+
import { ctx } from "$lib/store.svelte";
|
|
15
15
|
import Button from "../ui/button/button.svelte";
|
|
16
16
|
|
|
17
17
|
interface Props {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import * as Popover from "
|
|
2
|
+
import * as Popover from "$lib/components/ui/popover/index.js";
|
|
3
3
|
import { ListFilter } from "lucide-svelte";
|
|
4
4
|
import { buttonVariants } from "../ui/button";
|
|
5
5
|
import Filter from "./filter.svelte";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { ctx } from "
|
|
2
|
+
import { ctx } from "$lib/store.svelte";
|
|
3
3
|
import { ListRestart, Plus, SquareStack, Trash } from "lucide-svelte";
|
|
4
4
|
import LlmButton from "../LlmButton.svelte";
|
|
5
5
|
import FilterButton from "./filterButton.svelte";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import Button from "../ui/button/button.svelte";
|
|
8
8
|
import CreateManyButton from "../createManyButton.svelte";
|
|
9
9
|
import { showDialog } from "../confirmationDialog/store.svelte";
|
|
10
|
-
import { lobb } from "
|
|
10
|
+
import { lobb } from "$lib";
|
|
11
11
|
import CreateDetailViewButton from "../detailView/create/createDetailViewButton.svelte";
|
|
12
12
|
import type { Snippet } from "svelte";
|
|
13
13
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import _ from "lodash";
|
|
3
3
|
|
|
4
|
-
import * as Popover from "
|
|
4
|
+
import * as Popover from "$lib/components/ui/popover/index.js";
|
|
5
5
|
import { ArrowDown, ArrowUp, GripVertical, Plus, X } from "lucide-svelte";
|
|
6
6
|
import Button, { buttonVariants } from "../ui/button/button.svelte";
|
|
7
7
|
import Label from "../ui/label/label.svelte";
|
|
8
8
|
import Switch from "../ui/switch/switch.svelte";
|
|
9
|
-
import { ctx } from "
|
|
9
|
+
import { ctx } from "$lib/store.svelte";
|
|
10
10
|
import { getFieldIcon } from "./utils";
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import * as Popover from "
|
|
2
|
+
import * as Popover from "$lib/components/ui/popover/index.js";
|
|
3
3
|
import { ArrowDownWideNarrow } from "lucide-svelte";
|
|
4
|
-
import { buttonVariants } from "
|
|
4
|
+
import { buttonVariants } from "$lib/components/ui/button";
|
|
5
5
|
import Sort from "./sort.svelte";
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { TableProps } from "./table.svelte";
|
|
2
|
+
|
|
3
|
+
import { ctx } from "$lib/store.svelte";
|
|
4
|
+
import {
|
|
5
|
+
Binary,
|
|
6
|
+
Braces,
|
|
7
|
+
Brackets,
|
|
8
|
+
Calendar,
|
|
9
|
+
CalendarClock,
|
|
10
|
+
Clock,
|
|
11
|
+
Hash,
|
|
12
|
+
Key,
|
|
13
|
+
Text,
|
|
14
|
+
Type,
|
|
15
|
+
} from "lucide-svelte/icons";
|
|
16
|
+
|
|
17
|
+
export function getCollectionColumns(collectionName: string): TableProps['columns'] {
|
|
18
|
+
const collectionFields = getFields(collectionName);
|
|
19
|
+
const headers: TableProps['columns'] = [];
|
|
20
|
+
for (const fieldName in collectionFields) {
|
|
21
|
+
const field = collectionFields[fieldName];
|
|
22
|
+
headers.push({
|
|
23
|
+
id: field.key,
|
|
24
|
+
subtext: field.type,
|
|
25
|
+
icon: getFieldIcon(fieldName, collectionName),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return headers;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getFieldIcon(fieldName: string, collectionName: string) {
|
|
32
|
+
const field = getField(fieldName, collectionName);
|
|
33
|
+
if (fieldName === "id") {
|
|
34
|
+
return Key;
|
|
35
|
+
} else if (field.type === "string") {
|
|
36
|
+
return Type;
|
|
37
|
+
} else if (field.type === "text") {
|
|
38
|
+
return Text;
|
|
39
|
+
} else if (field.type === "object") {
|
|
40
|
+
return Braces;
|
|
41
|
+
} else if (field.type === "array") {
|
|
42
|
+
return Brackets;
|
|
43
|
+
} else if (field.type === "bool") {
|
|
44
|
+
return Binary;
|
|
45
|
+
} else if (field.type === "integer") {
|
|
46
|
+
return Hash;
|
|
47
|
+
} else if (field.type === "long") {
|
|
48
|
+
return Hash;
|
|
49
|
+
} else if (field.type === "float") {
|
|
50
|
+
return Hash;
|
|
51
|
+
} else if (field.type === "decimal") {
|
|
52
|
+
return Hash;
|
|
53
|
+
} else if (field.type === "date") {
|
|
54
|
+
return Calendar;
|
|
55
|
+
} else if (field.type === "datetime") {
|
|
56
|
+
return CalendarClock;
|
|
57
|
+
} else if (field.type === "time") {
|
|
58
|
+
return Clock;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
throw new Error(`(${field.type}) doesnt have an icon`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function getFields(collectionName: string) {
|
|
65
|
+
return ctx.meta.collections[collectionName].fields;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function getField(fieldName: string, collectionName: string) {
|
|
69
|
+
return getFields(collectionName)[fieldName];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function getCollectionPrimaryField(collectionName: string): string | undefined {
|
|
73
|
+
const collectionFields =
|
|
74
|
+
ctx.meta.collections[collectionName].fields;
|
|
75
|
+
|
|
76
|
+
const primaryFieldObject: any = Object.values(collectionFields).find(
|
|
77
|
+
(field) => (field as any).type === "string",
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
if (
|
|
81
|
+
primaryFieldObject &&
|
|
82
|
+
typeof primaryFieldObject === "object" &&
|
|
83
|
+
"key" in primaryFieldObject
|
|
84
|
+
) {
|
|
85
|
+
const fieldName = primaryFieldObject.key;
|
|
86
|
+
return fieldName;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function getCollectionParamsFields(collectionName: string, allFields = false) {
|
|
91
|
+
const relations = ctx.meta.relations;
|
|
92
|
+
const foreignFields = relations
|
|
93
|
+
.filter((relation) => {
|
|
94
|
+
return relation.from.collection === collectionName
|
|
95
|
+
})
|
|
96
|
+
.map((relation) => {
|
|
97
|
+
return {
|
|
98
|
+
field: relation.from.field,
|
|
99
|
+
collection: relation.to.collection,
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const columns = [];
|
|
104
|
+
for (let index = 0; index < foreignFields.length; index++) {
|
|
105
|
+
const foreignField = foreignFields[index];
|
|
106
|
+
if (!foreignField.collection) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
columns.push(`${foreignField.field}.id`);
|
|
110
|
+
|
|
111
|
+
if (!allFields) {
|
|
112
|
+
const primaryField = getCollectionPrimaryField(foreignField.collection)
|
|
113
|
+
if (primaryField) {
|
|
114
|
+
columns.push(`${foreignField.field}.${primaryField}`);
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
const fieldNames = Object.keys(ctx.meta.collections[foreignField.collection].fields);
|
|
118
|
+
for (let index = 0; index < fieldNames.length; index++) {
|
|
119
|
+
const fieldName = fieldNames[index];
|
|
120
|
+
columns.push(`${foreignField.field}.${fieldName}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const foreignColumns = columns.join(",");
|
|
126
|
+
return `*${foreignColumns ? `,${foreignColumns}` : ""}`;
|
|
127
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { ctx } from "
|
|
2
|
+
import { ctx } from "$lib/store.svelte";
|
|
3
3
|
import { Link } from "lucide-svelte";
|
|
4
4
|
import CreateManyView from "./createManyView.svelte";
|
|
5
|
-
import ExtensionsComponents from "
|
|
6
|
-
import { getExtensionUtils } from "
|
|
5
|
+
import ExtensionsComponents from "$lib/components/extensionsComponents.svelte";
|
|
6
|
+
import { getExtensionUtils } from "$lib/extensions/extensionUtils";
|
|
7
7
|
|
|
8
8
|
interface LocalProp {
|
|
9
9
|
collectionName: string;
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
|
|
19
19
|
<script lang="ts">
|
|
20
20
|
import { ArrowLeft, Plus, X } from "lucide-svelte";
|
|
21
|
-
import Button from "
|
|
22
|
-
import { lobb } from "
|
|
21
|
+
import Button from "$lib/components/ui/button/button.svelte";
|
|
22
|
+
import { lobb } from "$lib";
|
|
23
23
|
import { toast } from "svelte-sonner";
|
|
24
|
-
import { ctx } from "
|
|
24
|
+
import { ctx } from "$lib/store.svelte";
|
|
25
25
|
import ExtensionsComponents from "../../extensionsComponents.svelte";
|
|
26
|
-
import { getExtensionUtils } from "
|
|
26
|
+
import { getExtensionUtils } from "$lib/extensions/extensionUtils";
|
|
27
27
|
import { getField, getFieldIcon } from "../../dataTable/utils";
|
|
28
28
|
import Children from "./children.svelte";
|
|
29
29
|
import {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
} from "../utils";
|
|
35
35
|
import type { Snippet } from "svelte";
|
|
36
36
|
import FieldInput from "../fieldInput.svelte";
|
|
37
|
-
import { emitEvent } from "
|
|
38
|
-
import Drawer from "
|
|
37
|
+
import { emitEvent } from "$lib/eventSystem";
|
|
38
|
+
import Drawer from "$lib/components/drawer.svelte";
|
|
39
39
|
|
|
40
40
|
let {
|
|
41
41
|
collectionName,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { CreateDetailViewProp } from "./createDetailView.svelte";
|
|
3
|
-
import type { ButtonProps } from "
|
|
4
|
-
import Button from "
|
|
3
|
+
import type { ButtonProps } from "$lib/components/ui/button/button.svelte";
|
|
4
|
+
import Button from "$lib/components/ui/button/button.svelte";
|
|
5
5
|
import { openCreateDetailView } from "../store.svelte";
|
|
6
6
|
|
|
7
7
|
interface LocalProp extends CreateDetailViewProp {
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
import Table, { type TableProps } from "../../dataTable/table.svelte";
|
|
12
12
|
import Button from "../../ui/button/button.svelte";
|
|
13
13
|
import CreateDetailViewButton from "./createDetailViewButton.svelte";
|
|
14
|
-
import { getCollectionColumns } from "
|
|
15
|
-
import SelectRecord from "
|
|
16
|
-
import FieldCell from "
|
|
14
|
+
import { getCollectionColumns } from "$lib/components/dataTable/utils";
|
|
15
|
+
import SelectRecord from "$lib/components/selectRecord.svelte";
|
|
16
|
+
import FieldCell from "$lib/components/dataTable/fieldCell.svelte";
|
|
17
17
|
import SubRecords from "./subRecords.svelte";
|
|
18
|
-
import ChildRecords from "
|
|
19
|
-
import { ctx } from "
|
|
18
|
+
import ChildRecords from "$lib/components/dataTable/childRecords.svelte";
|
|
19
|
+
import { ctx } from "$lib/store.svelte";
|
|
20
20
|
|
|
21
21
|
interface ParentRecord {
|
|
22
22
|
id: string;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { ctx } from "
|
|
2
|
+
import { ctx } from "$lib/store.svelte";
|
|
3
3
|
import {
|
|
4
4
|
getDiscriminatorFieldRelation,
|
|
5
5
|
getFieldRelation,
|
|
6
|
-
} from "
|
|
6
|
+
} from "$lib/utils";
|
|
7
7
|
import { Ban, Check, CircleAlert, X } from "lucide-svelte";
|
|
8
8
|
import { getField } from "../dataTable/utils";
|
|
9
9
|
import Button from "../ui/button/button.svelte";
|
|
10
10
|
import FieldCustomInput from "./fieldCustomInput.svelte";
|
|
11
11
|
import Input from "../ui/input/input.svelte";
|
|
12
12
|
import Combobox from "../combobox.svelte";
|
|
13
|
-
import * as Select from "
|
|
13
|
+
import * as Select from "$lib/components/ui/select/index";
|
|
14
14
|
import Textarea from "../ui/textarea/textarea.svelte";
|
|
15
15
|
import ForeingKeyInput from "../foreingKeyInput.svelte";
|
|
16
16
|
import ExtensionsComponents from "../extensionsComponents.svelte";
|
|
17
|
-
import { getExtensionUtils } from "
|
|
17
|
+
import { getExtensionUtils } from "$lib/extensions/extensionUtils";
|
|
18
18
|
|
|
19
19
|
interface Props {
|
|
20
20
|
collectionName: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Ban, Check, CircleAlert, X } from "lucide-svelte";
|
|
3
3
|
import Button from "../ui/button/button.svelte";
|
|
4
4
|
import Input from "../ui/input/input.svelte";
|
|
5
|
-
import * as Select from "
|
|
5
|
+
import * as Select from "$lib/components/ui/select/index";
|
|
6
6
|
import Textarea from "../ui/textarea/textarea.svelte";
|
|
7
7
|
import type { EntryField } from "./detailViewForm.svelte";
|
|
8
8
|
import type { Snippet } from "svelte";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CreateDetailViewProp } from "./create/createDetailView.svelte";
|
|
2
|
+
import type { UpdateDetailViewProp } from "./update/updateDetailView.svelte";
|
|
3
|
+
import CreateDetailView from "./create/createDetailView.svelte";
|
|
4
|
+
import UpdateDetailView from "./update/updateDetailView.svelte";
|
|
5
|
+
import { lobb } from "$lib";
|
|
6
|
+
import { getCollectionParamsFields } from "../dataTable/utils";
|
|
7
|
+
import { mount, unmount } from "svelte";
|
|
8
|
+
|
|
9
|
+
export function openCreateDetailView(props: CreateDetailViewProp) {
|
|
10
|
+
const targetElement = document.querySelector('main');
|
|
11
|
+
|
|
12
|
+
if (!targetElement) {
|
|
13
|
+
throw new Error("main html element doesn't exist for some reason")
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const mountedCreateDetailView = mount(CreateDetailView, {
|
|
17
|
+
target: targetElement,
|
|
18
|
+
props: {
|
|
19
|
+
...props,
|
|
20
|
+
onCancel: async () => {
|
|
21
|
+
props.onCancel?.()
|
|
22
|
+
await unmount(mountedCreateDetailView, {
|
|
23
|
+
outro: true
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export async function openUpdateDetailView(props: UpdateDetailViewProp) {
|
|
31
|
+
let params = {
|
|
32
|
+
fields: getCollectionParamsFields(props.collectionName, true),
|
|
33
|
+
filter: {
|
|
34
|
+
id: props.recordId,
|
|
35
|
+
},
|
|
36
|
+
limit: 1,
|
|
37
|
+
};
|
|
38
|
+
const response = await lobb.findAll(props.collectionName, params);
|
|
39
|
+
const result = await response.json();
|
|
40
|
+
const entry = result.data[0];
|
|
41
|
+
|
|
42
|
+
const targetElement = document.querySelector('main');
|
|
43
|
+
|
|
44
|
+
if (!targetElement) {
|
|
45
|
+
throw new Error("main html element doesn't exist for some reason")
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const mountedUpdateDetailView = mount(UpdateDetailView, {
|
|
49
|
+
target: targetElement,
|
|
50
|
+
props: {
|
|
51
|
+
...props,
|
|
52
|
+
onCancel: async () => {
|
|
53
|
+
props.onCancel?.()
|
|
54
|
+
await unmount(mountedUpdateDetailView, {
|
|
55
|
+
outro: true
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
values: entry,
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import DataTable from "
|
|
3
|
-
import { ctx } from "
|
|
2
|
+
import DataTable from "$lib/components/dataTable/dataTable.svelte";
|
|
3
|
+
import { ctx } from "$lib/store.svelte";
|
|
4
4
|
import { Link, Plus, TableIcon } from "lucide-svelte";
|
|
5
5
|
import CreateDetailViewButton from "../create/createDetailViewButton.svelte";
|
|
6
|
-
import ExtensionsComponents from "
|
|
7
|
-
import { getExtensionUtils } from "
|
|
6
|
+
import ExtensionsComponents from "$lib/components/extensionsComponents.svelte";
|
|
7
|
+
import { getExtensionUtils } from "$lib/extensions/extensionUtils";
|
|
8
8
|
|
|
9
9
|
interface LocalProp {
|
|
10
10
|
collectionName: string;
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
|
|
20
20
|
<script lang="ts">
|
|
21
21
|
import { ArrowLeft, Pencil, X } from "lucide-svelte";
|
|
22
|
-
import Button from "
|
|
22
|
+
import Button from "$lib/components/ui/button/button.svelte";
|
|
23
23
|
import { fade, fly } from "svelte/transition";
|
|
24
|
-
import { lobb } from "
|
|
24
|
+
import { lobb } from "$lib";
|
|
25
25
|
import { toast } from "svelte-sonner";
|
|
26
|
-
import { ctx } from "
|
|
26
|
+
import { ctx } from "$lib/store.svelte";
|
|
27
27
|
import ExtensionsComponents from "../../extensionsComponents.svelte";
|
|
28
|
-
import { getExtensionUtils } from "
|
|
29
|
-
import { calculateDrawerWidth, getChangedProperties } from "
|
|
28
|
+
import { getExtensionUtils } from "$lib/extensions/extensionUtils";
|
|
29
|
+
import { calculateDrawerWidth, getChangedProperties } from "$lib/utils";
|
|
30
30
|
import { getField, getFieldIcon } from "../../dataTable/utils";
|
|
31
31
|
import Children from "../update/children.svelte";
|
|
32
32
|
import type { Snippet } from "svelte";
|
|
33
33
|
import { getDefaultEntry, parseDetailViewValues, serializeEntry } from "../utils";
|
|
34
34
|
import FieldInput from "../fieldInput.svelte";
|
|
35
|
-
import Drawer from "
|
|
35
|
+
import Drawer from "$lib/components/drawer.svelte";
|
|
36
36
|
|
|
37
37
|
let {
|
|
38
38
|
collectionName,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { UpdateDetailViewProp } from "./updateDetailView.svelte";
|
|
3
|
-
import type { ButtonProps } from "
|
|
4
|
-
import Button from "
|
|
3
|
+
import type { ButtonProps } from "$lib/components/ui/button/button.svelte";
|
|
4
|
+
import Button from "$lib/components/ui/button/button.svelte";
|
|
5
5
|
import { openUpdateDetailView } from "../store.svelte";
|
|
6
6
|
|
|
7
7
|
interface LocalProp extends UpdateDetailViewProp {
|