@medyll/idae-machine 0.129.0 → 0.136.1
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 +462 -300
- package/cli.cjs +22 -0
- package/dist/__fixtures__/demoModel.d.ts +79 -0
- package/dist/__fixtures__/demoModel.js +146 -0
- package/dist/ai/frame/AiChatSession.svelte +152 -0
- package/dist/ai/frame/AiChatSession.svelte.d.ts +7 -0
- package/dist/ai/frame/index.d.ts +1 -0
- package/dist/ai/frame/index.js +2 -0
- package/dist/ai/index.d.ts +9 -0
- package/dist/ai/index.js +12 -0
- package/dist/ai/schema/ai-catalogs.d.ts +2 -0
- package/dist/ai/schema/ai-catalogs.js +86 -0
- package/dist/ai/schema/ai-chat-session.d.ts +2 -0
- package/dist/ai/schema/ai-chat-session.js +35 -0
- package/dist/ai/schema/ai-companion.d.ts +2 -0
- package/dist/ai/schema/ai-companion.js +25 -0
- package/dist/ai/schema/ai-message.d.ts +2 -0
- package/dist/ai/schema/ai-message.js +20 -0
- package/dist/ai/schema/ai-tool-call.d.ts +2 -0
- package/dist/ai/schema/ai-tool-call.js +18 -0
- package/dist/ai/schema/ai-user-prompt.d.ts +2 -0
- package/dist/ai/schema/ai-user-prompt.js +17 -0
- package/dist/ai/schema/tag.d.ts +2 -0
- package/dist/ai/schema/tag.js +14 -0
- package/dist/ai/streamIntoRecord.d.ts +31 -0
- package/dist/ai/streamIntoRecord.js +79 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.js +19 -0
- package/dist/data-ui/controls/AlphabetFilter.svelte +114 -0
- package/dist/data-ui/controls/AlphabetFilter.svelte.d.ts +10 -0
- package/dist/data-ui/controls/ButtonAction.svelte +151 -0
- package/dist/data-ui/controls/ButtonAction.svelte.d.ts +18 -0
- package/dist/data-ui/controls/DataFind.svelte +174 -0
- package/dist/data-ui/controls/DataFind.svelte.d.ts +10 -0
- package/dist/data-ui/controls/DataGroup.svelte +150 -0
- package/dist/data-ui/controls/DataGroup.svelte.d.ts +7 -0
- package/dist/data-ui/controls/DataSort.svelte +78 -0
- package/dist/data-ui/controls/DataSort.svelte.d.ts +9 -0
- package/dist/data-ui/controls/DataToolbar.svelte +67 -0
- package/dist/data-ui/controls/DataToolbar.svelte.d.ts +11 -0
- package/dist/data-ui/controls/Find.svelte +38 -0
- package/dist/data-ui/controls/Find.svelte.d.ts +9 -0
- package/dist/data-ui/controls/FkFilter.svelte +94 -0
- package/dist/data-ui/controls/FkFilter.svelte.d.ts +11 -0
- package/dist/data-ui/controls/Group.svelte +36 -0
- package/dist/data-ui/controls/Group.svelte.d.ts +8 -0
- package/dist/data-ui/controls/ListMode.svelte +79 -0
- package/dist/data-ui/controls/ListMode.svelte.d.ts +10 -0
- package/dist/data-ui/controls/Sort.svelte +100 -0
- package/dist/data-ui/controls/Sort.svelte.d.ts +8 -0
- package/dist/data-ui/data/DataCount.svelte +67 -0
- package/dist/data-ui/data/DataCount.svelte.d.ts +36 -0
- package/dist/data-ui/data/DataFk.svelte +54 -0
- package/dist/data-ui/data/DataFk.svelte.d.ts +11 -0
- package/dist/data-ui/data/DataForm.svelte +191 -0
- package/dist/data-ui/data/DataForm.svelte.d.ts +15 -0
- package/dist/data-ui/data/DataList.svelte +645 -0
- package/dist/data-ui/data/DataList.svelte.d.ts +75 -0
- package/dist/data-ui/data/DataListFk.svelte +111 -0
- package/dist/data-ui/data/DataListFk.svelte.d.ts +13 -0
- package/dist/data-ui/data/DataListRfk.svelte +111 -0
- package/dist/data-ui/data/DataListRfk.svelte.d.ts +13 -0
- package/dist/data-ui/data/DataRecord.svelte +167 -0
- package/dist/data-ui/data/DataRecord.svelte.d.ts +22 -0
- package/dist/data-ui/data/DataRfk.svelte +73 -0
- package/dist/data-ui/data/DataRfk.svelte.d.ts +15 -0
- package/dist/data-ui/data/index.d.ts +7 -0
- package/dist/data-ui/data/index.js +8 -0
- package/dist/data-ui/field/DataField.svelte +343 -0
- package/dist/data-ui/field/DataField.svelte.d.ts +33 -0
- package/dist/data-ui/field/DataFieldEdit.svelte +103 -0
- package/dist/data-ui/field/DataFieldEdit.svelte.d.ts +14 -0
- package/dist/data-ui/field/index.d.ts +2 -0
- package/dist/data-ui/field/index.js +3 -0
- package/dist/data-ui/field/snippets/FieldAiPrompt.svelte +145 -0
- package/dist/data-ui/field/snippets/FieldAiPrompt.svelte.d.ts +14 -0
- package/dist/data-ui/field/snippets/FieldBoolean.svelte +43 -0
- package/dist/data-ui/field/snippets/FieldBoolean.svelte.d.ts +12 -0
- package/dist/data-ui/field/snippets/FieldColor.svelte +48 -0
- package/dist/data-ui/field/snippets/FieldColor.svelte.d.ts +10 -0
- package/dist/data-ui/field/snippets/FieldCurrency.svelte +105 -0
- package/dist/data-ui/field/snippets/FieldCurrency.svelte.d.ts +15 -0
- package/dist/data-ui/field/snippets/FieldEmail.svelte +77 -0
- package/dist/data-ui/field/snippets/FieldEmail.svelte.d.ts +14 -0
- package/dist/data-ui/field/snippets/FieldIcon.svelte +73 -0
- package/dist/data-ui/field/snippets/FieldIcon.svelte.d.ts +11 -0
- package/dist/data-ui/field/snippets/FieldSelect.svelte +71 -0
- package/dist/data-ui/field/snippets/FieldSelect.svelte.d.ts +15 -0
- package/dist/data-ui/field/snippets/FieldText.svelte +52 -0
- package/dist/data-ui/field/snippets/FieldText.svelte.d.ts +13 -0
- package/dist/data-ui/field/snippets/FieldTextarea.svelte +50 -0
- package/dist/data-ui/field/snippets/FieldTextarea.svelte.d.ts +13 -0
- package/dist/data-ui/field/snippets/index.d.ts +9 -0
- package/dist/data-ui/field/snippets/index.js +10 -0
- package/dist/data-ui/fragments/ContextMenu.svelte +109 -0
- package/dist/data-ui/fragments/ContextMenu.svelte.d.ts +4 -0
- package/dist/data-ui/fragments/ContextMenuContent.svelte +275 -0
- package/dist/data-ui/fragments/ContextMenuContent.svelte.d.ts +8 -0
- package/dist/data-ui/fragments/Frame.svelte +43 -0
- package/dist/data-ui/fragments/Frame.svelte.d.ts +10 -0
- package/dist/data-ui/fragments/InfoLine.svelte +123 -0
- package/dist/data-ui/fragments/InfoLine.svelte.d.ts +12 -0
- package/dist/data-ui/fragments/Selector.svelte +56 -0
- package/dist/data-ui/fragments/Selector.svelte.d.ts +10 -0
- package/dist/{fragments → data-ui/fragments}/Skeleton.svelte +3 -3
- package/dist/data-ui/fragments/Tile.svelte +126 -0
- package/dist/data-ui/fragments/Tile.svelte.d.ts +14 -0
- package/dist/data-ui/fragments/contextMenu.svelte.d.ts +22 -0
- package/dist/data-ui/fragments/contextMenu.svelte.js +31 -0
- package/dist/data-ui/fragments/dialog/Dialog.svelte +185 -0
- package/dist/data-ui/fragments/dialog/Dialog.svelte.d.ts +29 -0
- package/dist/data-ui/fragments/dialog/dialog.svelte.d.ts +27 -0
- package/dist/data-ui/fragments/dialog/dialog.svelte.js +41 -0
- package/dist/data-ui/fragments/index.d.ts +11 -0
- package/dist/data-ui/fragments/index.js +11 -0
- package/dist/data-ui/utils/__tests__/HostProbe.svelte +18 -0
- package/dist/data-ui/utils/__tests__/HostProbe.svelte.d.ts +8 -0
- package/dist/data-ui/utils/data-utils.d.ts +29 -0
- package/dist/data-ui/utils/data-utils.js +83 -0
- package/dist/data-ui/utils/dataRelationUtils.d.ts +37 -0
- package/dist/data-ui/utils/dataRelationUtils.js +125 -0
- package/dist/data-ui/utils/diagramUtils.d.ts +6 -0
- package/dist/data-ui/utils/diagramUtils.js +131 -0
- package/dist/data-ui/utils/draggable.d.ts +15 -0
- package/dist/data-ui/utils/draggable.js +61 -0
- package/dist/data-ui/utils/menuPrefs.d.ts +80 -0
- package/dist/data-ui/utils/menuPrefs.js +119 -0
- package/dist/data-ui/utils/useMachinePrefs.svelte.d.ts +38 -0
- package/dist/data-ui/utils/useMachinePrefs.svelte.js +117 -0
- package/dist/data-ui/utils/useMenuTree.svelte.d.ts +26 -0
- package/dist/data-ui/utils/useMenuTree.svelte.js +68 -0
- package/dist/data-ui/utils/useRecordData.svelte.d.ts +22 -0
- package/dist/data-ui/utils/useRecordData.svelte.js +50 -0
- package/dist/data-ui/utils/useViewFields.svelte.d.ts +22 -0
- package/dist/data-ui/utils/useViewFields.svelte.js +59 -0
- package/dist/demo/.gitkeep +0 -0
- package/dist/demo/demo-status.json +9 -0
- package/dist/idae/boot.d.ts +28 -0
- package/dist/idae/boot.js +43 -0
- package/dist/idae/bridge/register.d.ts +4 -0
- package/dist/idae/bridge/register.js +15 -0
- package/dist/idae/capabilities/Capabilities.d.ts +10 -0
- package/dist/idae/capabilities/Capabilities.js +34 -0
- package/dist/idae/codefield/CodeFieldConvention.d.ts +3 -0
- package/dist/idae/codefield/CodeFieldConvention.js +25 -0
- package/dist/idae/fieldcatalog/defaultFieldTypesDef.d.ts +2 -0
- package/dist/idae/fieldcatalog/defaultFieldTypesDef.js +104 -0
- package/dist/idae/frames/FrameCatalog.d.ts +31 -0
- package/dist/idae/frames/FrameCatalog.js +31 -0
- package/dist/idae/index.d.ts +14 -0
- package/dist/idae/index.js +13 -0
- package/dist/idae/menu/IdaeMenuManager.d.ts +79 -0
- package/dist/idae/menu/IdaeMenuManager.js +108 -0
- package/dist/idae/menu/IdaeMenuStore.d.ts +77 -0
- package/dist/idae/menu/IdaeMenuStore.js +68 -0
- package/dist/idae/menu/menuSnapshot.d.ts +30 -0
- package/dist/idae/menu/menuSnapshot.js +30 -0
- package/dist/idae/meta/MetaModelProvider.d.ts +11 -0
- package/dist/idae/meta/MetaModelProvider.js +43 -0
- package/dist/idae/relations/RelationPolicy.d.ts +19 -0
- package/dist/idae/relations/RelationPolicy.js +125 -0
- package/dist/idae/rights/RightsPolicy.d.ts +16 -0
- package/dist/idae/rights/RightsPolicy.js +80 -0
- package/dist/idae/userscope/UserScopePolicy.d.ts +9 -0
- package/dist/idae/userscope/UserScopePolicy.js +42 -0
- package/dist/idae/userscope/navTracking.d.ts +11 -0
- package/dist/idae/userscope/navTracking.js +15 -0
- package/dist/index.d.ts +68 -43
- package/dist/index.js +82 -44
- package/dist/main/__tests__/_relationTestUtils.d.ts +12 -0
- package/dist/main/__tests__/_relationTestUtils.js +53 -0
- package/dist/main/__tests__/helpers/mockCollection.d.ts +21 -0
- package/dist/main/__tests__/helpers/mockCollection.js +27 -0
- package/dist/main/api/types.d.ts +29 -0
- package/dist/main/ext/hooks.d.ts +32 -0
- package/dist/main/ext/hooks.js +31 -0
- package/dist/main/ext/interfaces.d.ts +69 -0
- package/dist/main/ext/interfaces.js +3 -0
- package/dist/main/ext/registry.d.ts +29 -0
- package/dist/main/ext/registry.js +30 -0
- package/dist/main/frame/MachineFrameManager.d.ts +187 -0
- package/dist/main/frame/MachineFrameManager.js +403 -0
- package/dist/main/frame/contextMenuSetup.d.ts +9 -0
- package/dist/main/frame/contextMenuSetup.js +42 -0
- package/dist/main/frame/frameUrl.d.ts +1 -0
- package/dist/main/frame/frameUrl.js +8 -0
- package/dist/main/frame/frameUtils.d.ts +16 -0
- package/dist/main/frame/frameUtils.js +26 -0
- package/dist/main/frame/linkParser.d.ts +9 -0
- package/dist/main/frame/linkParser.js +15 -0
- package/dist/main/index.d.ts +15 -0
- package/dist/main/index.js +19 -0
- package/dist/main/machine/MachineAction.d.ts +62 -0
- package/dist/main/machine/MachineAction.js +96 -0
- package/dist/main/machine/MachineError.d.ts +33 -0
- package/dist/main/machine/MachineError.js +49 -0
- package/dist/main/machine/MachineErrorValidation.d.ts +19 -0
- package/dist/main/machine/MachineErrorValidation.js +24 -0
- package/dist/main/machine/MachineFieldType.d.ts +140 -0
- package/dist/main/machine/MachineFieldType.js +341 -0
- package/dist/main/machine/MachineFkFold.d.ts +34 -0
- package/dist/main/machine/MachineFkFold.js +57 -0
- package/dist/main/machine/MachineRecordIdentity.d.ts +26 -0
- package/dist/main/machine/MachineRecordIdentity.js +44 -0
- package/dist/main/machine/MachineRights.d.ts +50 -0
- package/dist/main/machine/MachineRights.js +133 -0
- package/dist/main/machine/MachineRouter.d.ts +56 -0
- package/dist/main/machine/MachineRouter.js +250 -0
- package/dist/main/machine/MachineScheme.d.ts +54 -0
- package/dist/main/machine/MachineScheme.js +159 -0
- package/dist/main/machine/MachineSchemeField.js +67 -0
- package/dist/main/machine/MachineSchemeFieldForge.d.ts +84 -0
- package/dist/main/machine/MachineSchemeFieldForge.js +140 -0
- package/dist/main/machine/MachineSchemeFieldValues.d.ts +68 -0
- package/dist/main/machine/MachineSchemeFieldValues.js +97 -0
- package/dist/main/machine/MachineSchemeValidate.d.ts +107 -0
- package/dist/main/machine/MachineSchemeValidate.js +247 -0
- package/dist/main/machine/MachineSchemeValues.d.ts +120 -0
- package/dist/main/machine/MachineSchemeValues.js +306 -0
- package/dist/main/machine/SchemeFieldDefaultValues.d.ts +76 -0
- package/dist/main/machine/SchemeFieldDefaultValues.js +104 -0
- package/dist/main/machine/authState.svelte.d.ts +11 -0
- package/dist/main/machine/authState.svelte.js +17 -0
- package/dist/main/machine/fieldBuilder.d.ts +23 -0
- package/dist/main/machine/fieldBuilder.d.ts.map +1 -0
- package/dist/main/machine/fieldBuilder.js +10 -0
- package/dist/main/machine/fieldBuilder.js.map +1 -0
- package/dist/main/machine/machineLabel.d.ts +11 -0
- package/dist/main/machine/machineLabel.js +23 -0
- package/dist/main/machine/validateRules.d.ts +38 -0
- package/dist/main/machine/validateRules.js +109 -0
- package/dist/main/machine.d.ts +227 -61
- package/dist/main/machine.js +503 -86
- package/dist/main/machineDb.d.ts +25 -54
- package/dist/main/machineDb.js +40 -94
- package/dist/main/machineIdbAdapter.d.ts +83 -0
- package/dist/main/machineIdbAdapter.js +347 -0
- package/dist/main/machineModelBuilder.d.ts +31 -0
- package/dist/main/machineModelBuilder.js +58 -0
- package/dist/main/machineParserForge.d.ts +38 -0
- package/dist/main/machineParserForge.js +168 -0
- package/dist/main/machineSchemaCache.d.ts +8 -0
- package/dist/main/machineSchemaCache.js +58 -0
- package/dist/main/machineSchemaDoctor.d.ts +17 -0
- package/dist/main/machineSchemaDoctor.js +73 -0
- package/dist/main/machineSchemaLoader.d.ts +18 -0
- package/dist/main/machineSchemaLoader.js +43 -0
- package/dist/main/machineSeed.d.ts +21 -0
- package/dist/main/machineSeed.js +44 -0
- package/dist/main/router/componentRegistry.d.ts +35 -0
- package/dist/main/router/componentRegistry.js +35 -0
- package/dist/main/router/urlParser.d.ts +17 -0
- package/dist/main/router/urlParser.js +41 -0
- package/dist/main/warmupUtils.d.ts +40 -0
- package/dist/main/warmupUtils.js +73 -0
- package/dist/mcp/MachineMcpClient.d.ts +43 -0
- package/dist/mcp/MachineMcpClient.js +175 -0
- package/dist/shell/Frame.svelte +67 -0
- package/dist/shell/Frame.svelte.d.ts +11 -0
- package/dist/shell/auth/Login.svelte +244 -0
- package/dist/shell/auth/Login.svelte.d.ts +3 -0
- package/dist/shell/frame/dashboard/Dashboard.svelte +0 -0
- package/dist/shell/frame/dashboard/Dashboard.svelte.d.ts +26 -0
- package/dist/shell/frame/diagram/Diagram.svelte +244 -0
- package/dist/shell/frame/diagram/Diagram.svelte.d.ts +9 -0
- package/dist/shell/frame/explorer/Explorer.svelte +86 -0
- package/dist/shell/frame/explorer/Explorer.svelte.d.ts +29 -0
- package/dist/shell/frame/explorer/ExplorerContent.svelte +126 -0
- package/dist/shell/frame/explorer/ExplorerContent.svelte.d.ts +32 -0
- package/dist/shell/frame/index.d.ts +8 -0
- package/dist/shell/frame/index.js +9 -0
- package/dist/shell/frame/main-menu-content/MainMenuContent.svelte +100 -0
- package/dist/shell/frame/main-menu-content/MainMenuContent.svelte.d.ts +6 -0
- package/dist/shell/frame/planning/Planning.svelte +426 -0
- package/dist/shell/frame/planning/Planning.svelte.d.ts +12 -0
- package/dist/shell/frame/rbac/RbacMatrix.svelte +197 -0
- package/dist/shell/frame/rbac/RbacMatrix.svelte.d.ts +7 -0
- package/dist/shell/frame/space/Space.svelte +554 -0
- package/dist/shell/frame/space/Space.svelte.d.ts +8 -0
- package/dist/shell/frame/synthesis/Synthesis.svelte +383 -0
- package/dist/shell/frame/synthesis/Synthesis.svelte.d.ts +8 -0
- package/dist/shell/frame/today/Today.svelte +174 -0
- package/dist/shell/frame/today/Today.svelte.d.ts +3 -0
- package/dist/shell/layout/App.svelte +30 -0
- package/dist/shell/layout/App.svelte.d.ts +3 -0
- package/dist/shell/layout/Breadcrumb.svelte +67 -0
- package/dist/shell/layout/Breadcrumb.svelte.d.ts +12 -0
- package/dist/shell/layout/Columner.svelte +214 -0
- package/dist/shell/layout/Columner.svelte.d.ts +16 -0
- package/dist/shell/layout/DevResetPanel.svelte +194 -0
- package/dist/shell/layout/DevResetPanel.svelte.d.ts +7 -0
- package/dist/shell/layout/Fiche.svelte +111 -0
- package/dist/shell/layout/Fiche.svelte.d.ts +7 -0
- package/dist/shell/layout/FicheUpdate.svelte +53 -0
- package/dist/shell/layout/FicheUpdate.svelte.d.ts +7 -0
- package/dist/shell/layout/MainMenu.svelte +256 -0
- package/dist/shell/layout/MainMenu.svelte.d.ts +6 -0
- package/dist/shell/layout/MenuSettings.svelte +182 -0
- package/dist/shell/layout/MenuSettings.svelte.d.ts +6 -0
- package/dist/shell/layout/RecordTimeline.svelte +199 -0
- package/dist/shell/layout/RecordTimeline.svelte.d.ts +8 -0
- package/dist/shell/layout/RecordToolbar.svelte +39 -0
- package/dist/shell/layout/RecordToolbar.svelte.d.ts +7 -0
- package/dist/shell/layout/TaskBar.svelte +118 -0
- package/dist/shell/layout/TaskBar.svelte.d.ts +7 -0
- package/dist/shell/layout/TemplateShell.svelte +48 -0
- package/dist/shell/layout/TemplateShell.svelte.d.ts +15 -0
- package/dist/shell/layout/ThemeToggle.svelte +46 -0
- package/dist/shell/layout/ThemeToggle.svelte.d.ts +3 -0
- package/dist/shell/layout/index.d.ts +8 -0
- package/dist/shell/layout/index.js +9 -0
- package/dist/storage/ApiStorageAdapter.d.ts +41 -0
- package/dist/storage/ApiStorageAdapter.js +111 -0
- package/dist/storage/IdbStorageAdapter.d.ts +31 -0
- package/dist/storage/IdbStorageAdapter.js +72 -0
- package/dist/storage/MemoryStorageAdapter.d.ts +33 -0
- package/dist/storage/MemoryStorageAdapter.js +132 -0
- package/dist/storage/README.md +222 -0
- package/dist/storage/StorageAdapter.d.ts +75 -0
- package/dist/storage/StorageAdapter.js +7 -0
- package/dist/storage/demo/storage-demo.d.ts +22 -0
- package/dist/storage/demo/storage-demo.js +107 -0
- package/dist/storage/index.d.ts +9 -0
- package/dist/storage/index.js +9 -0
- package/dist/types/entity-types.d.ts +444 -0
- package/dist/types/entity-types.js +16 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +6 -0
- package/dist/types/machine-model.d.ts +198 -0
- package/dist/types/machine-model.js +5 -0
- package/dist/types/qoolie-svelte.d.ts +11 -0
- package/dist/types/schema-utils.d.ts +32 -0
- package/dist/types/schema-utils.js +103 -0
- package/dist/utils/generateCode.d.ts +5 -0
- package/dist/utils/generateCode.js +9 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.js +20 -0
- package/package.json +70 -31
- package/dist/db/CrudService.d.ts +0 -9
- package/dist/db/CrudService.js +0 -45
- package/dist/db/dbSchema.d.ts +0 -201
- package/dist/db/dbSchema.js +0 -205
- package/dist/db/fieldTypes.d.ts +0 -13
- package/dist/db/fieldTypes.js +0 -67
- package/dist/db/types.d.ts +0 -124
- package/dist/demo/form/CreateUpdate.svelte +0 -198
- package/dist/demo/form/CreateUpdate.svelte.d.ts +0 -29
- package/dist/demo/form/CrudZone.svelte +0 -22
- package/dist/demo/form/CrudZone.svelte.d.ts +0 -29
- package/dist/demo/form/DataProvider.svelte +0 -20
- package/dist/demo/form/DataProvider.svelte.d.ts +0 -9
- package/dist/demo/form/FieldInPlace.svelte +0 -49
- package/dist/demo/form/FieldInPlace.svelte.d.ts +0 -11
- package/dist/demo/form/FieldValue.svelte +0 -212
- package/dist/demo/form/FieldValue.svelte.d.ts +0 -35
- package/dist/demo/form/types.d.ts +0 -17
- package/dist/demo/form/types.js +0 -1
- package/dist/demo/testDbSchema.d.ts +0 -6
- package/dist/demo/testDbSchema.js +0 -58
- package/dist/demo/types.d.ts +0 -140
- package/dist/demo/types.js +0 -1
- package/dist/fragments/Confirm.svelte +0 -58
- package/dist/fragments/Confirm.svelte.d.ts +0 -11
- package/dist/fragments/Frame.svelte +0 -19
- package/dist/fragments/Frame.svelte.d.ts +0 -32
- package/dist/fragments/InfoLine.svelte +0 -21
- package/dist/fragments/InfoLine.svelte.d.ts +0 -35
- package/dist/fragments/List.svelte +0 -21
- package/dist/fragments/List.svelte.d.ts +0 -38
- package/dist/fragments/Selector.svelte +0 -26
- package/dist/fragments/Selector.svelte.d.ts +0 -38
- package/dist/main/machine/IDbCollection.d.ts +0 -69
- package/dist/main/machine/IDbCollection.js +0 -98
- package/dist/main/machine/IDbCollectionFieldForge.d.ts +0 -42
- package/dist/main/machine/IDbCollectionFieldForge.js +0 -74
- package/dist/main/machine/IDbCollectionFieldValues.d.ts +0 -46
- package/dist/main/machine/IDbCollectionFieldValues.js +0 -62
- package/dist/main/machine/IDbCollectionValues.d.ts +0 -78
- package/dist/main/machine/IDbCollectionValues.js +0 -203
- package/dist/main/machine/IDbError.d.ts +0 -6
- package/dist/main/machine/IDbError.js +0 -61
- package/dist/main/machine/IDbFormValidate.d.ts +0 -55
- package/dist/main/machine/IDbFormValidate.js +0 -183
- package/dist/main/machine/IDbValidationError.d.ts +0 -19
- package/dist/main/machine/IDbValidationError.js +0 -24
- package/dist/main/machine/types.d.ts +0 -1
- package/dist/main/machine/types.js +0 -1
- package/dist/main/machineForge.d.ts +0 -57
- package/dist/main/machineForge.js +0 -105
- package/dist/types/appschemeTypes.d.ts +0 -71
- package/dist/types/appschemeTypes.js +0 -83
- package/dist/ui/CollectionButton.svelte +0 -26
- package/dist/ui/CollectionButton.svelte.d.ts +0 -29
- package/dist/ui/CollectionFieldGuess.svelte +0 -29
- package/dist/ui/CollectionFieldGuess.svelte.d.ts +0 -11
- package/dist/ui/CollectionFks.svelte +0 -24
- package/dist/ui/CollectionFks.svelte.d.ts +0 -9
- package/dist/ui/CollectionList.svelte +0 -95
- package/dist/ui/CollectionList.svelte.d.ts +0 -37
- package/dist/ui/CollectionListMenu.svelte +0 -47
- package/dist/ui/CollectionListMenu.svelte.d.ts +0 -34
- package/dist/ui/CollectionReverseFks.svelte +0 -56
- package/dist/ui/CollectionReverseFks.svelte.d.ts +0 -18
- /package/dist/{fragments → data-ui/fragments}/Skeleton.svelte.d.ts +0 -0
- /package/dist/{db → main/api}/types.js +0 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { machine } from '../../../main/machine.js';
|
|
3
|
+
import { buildGraph } from '../../../data-ui/utils/diagramUtils.js';
|
|
4
|
+
import type { DiagramEdge, DiagramGraph, DiagramNode } from '../../../types/index.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
collection,
|
|
8
|
+
collectionId,
|
|
9
|
+
depth = 1,
|
|
10
|
+
direction = 'both',
|
|
11
|
+
}: {
|
|
12
|
+
collection: string;
|
|
13
|
+
collectionId: string | number;
|
|
14
|
+
depth?: number;
|
|
15
|
+
direction?: 'forward' | 'reverse' | 'both';
|
|
16
|
+
} = $props();
|
|
17
|
+
|
|
18
|
+
let graph: DiagramGraph | null = $state(null);
|
|
19
|
+
let status: 'loading' | 'ready' | 'error' = $state('loading');
|
|
20
|
+
let errorMsg: string = $state('');
|
|
21
|
+
|
|
22
|
+
$effect(() => {
|
|
23
|
+
status = 'loading';
|
|
24
|
+
graph = null;
|
|
25
|
+
errorMsg = '';
|
|
26
|
+
|
|
27
|
+
// Check if collection exists before trying to build graph
|
|
28
|
+
try {
|
|
29
|
+
const collectionExists = machine.logic.collection(collection);
|
|
30
|
+
if (!collectionExists) {
|
|
31
|
+
throw new Error(`Collection "${collection}" not found in the data model.`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
buildGraph(collection, collectionId, { depth, direction })
|
|
35
|
+
.then(g => { graph = g; status = 'ready'; })
|
|
36
|
+
.catch(e => {
|
|
37
|
+
console.error('[Diagram] Error building graph:', e);
|
|
38
|
+
errorMsg = String(e);
|
|
39
|
+
status = 'error';
|
|
40
|
+
});
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.error('[Diagram] Error initializing:', e);
|
|
43
|
+
errorMsg = String(e);
|
|
44
|
+
status = 'error';
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// ── SVG layout ────────────────────────────────────────────────────────────
|
|
49
|
+
const CX = 300, CY = 300, ORBIT = 200, R_ROOT = 28, R_NODE = 20;
|
|
50
|
+
|
|
51
|
+
interface PositionedNode extends DiagramNode {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
isRoot: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const positionedNodes = $derived.by((): PositionedNode[] => {
|
|
58
|
+
const g = graph;
|
|
59
|
+
if (!g) return [];
|
|
60
|
+
const root = g.nodes.find(n => n.id === g.root);
|
|
61
|
+
if (!root) return [];
|
|
62
|
+
const neighbors = g.nodes.filter(n => n.id !== g.root);
|
|
63
|
+
const N = neighbors.length;
|
|
64
|
+
const result: PositionedNode[] = [{ ...root, x: CX, y: CY, isRoot: true }];
|
|
65
|
+
neighbors.forEach((n, i) => {
|
|
66
|
+
const angle = N === 1
|
|
67
|
+
? 0
|
|
68
|
+
: (i / N) * 2 * Math.PI - Math.PI / 2;
|
|
69
|
+
result.push({
|
|
70
|
+
...n,
|
|
71
|
+
x: CX + ORBIT * Math.cos(angle),
|
|
72
|
+
y: CY + ORBIT * Math.sin(angle),
|
|
73
|
+
isRoot: false,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
return result;
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const dedupedEdges = $derived.by((): DiagramEdge[] => {
|
|
80
|
+
const g = graph;
|
|
81
|
+
if (!g) return [];
|
|
82
|
+
const seen = new Set<string>();
|
|
83
|
+
return g.edges.filter(e => {
|
|
84
|
+
const key = `${e.from}→${e.to}:${e.relationKey}`;
|
|
85
|
+
if (seen.has(key)) return false;
|
|
86
|
+
seen.add(key);
|
|
87
|
+
return true;
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
function nodePos(id: string): PositionedNode | undefined {
|
|
92
|
+
return positionedNodes.find(n => n.id === id);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function openRecord(node: PositionedNode) {
|
|
96
|
+
if (node.isRoot) return;
|
|
97
|
+
void machine.framer.loadInDialog('fiche', node.collection, node.record['id'] as string | number | undefined);
|
|
98
|
+
}
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<diagram-component>
|
|
102
|
+
{#if status === 'loading'}
|
|
103
|
+
<p class="diagram-status">Loading…</p>
|
|
104
|
+
{:else if status === 'error'}
|
|
105
|
+
<p class="diagram-status diagram-status--error">
|
|
106
|
+
{errorMsg}
|
|
107
|
+
{#if errorMsg.includes('not found')}
|
|
108
|
+
<br><br>
|
|
109
|
+
<small>Tip: Check that you're viewing a valid record and that the collection exists in your data model.</small>
|
|
110
|
+
{/if}
|
|
111
|
+
</p>
|
|
112
|
+
{:else if graph}
|
|
113
|
+
<diagram-canvas>
|
|
114
|
+
<svg viewBox="0 0 600 600" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Relation diagram for {collection}">
|
|
115
|
+
<defs>
|
|
116
|
+
<marker id="arrow-fwd" markerWidth="8" markerHeight="8" refX="6" refY="3" orient="auto">
|
|
117
|
+
<path d="M0,0 L0,6 L8,3 z" fill="var(--color-primary)" />
|
|
118
|
+
</marker>
|
|
119
|
+
<marker id="arrow-rev" markerWidth="8" markerHeight="8" refX="6" refY="3" orient="auto">
|
|
120
|
+
<path d="M0,0 L0,6 L8,3 z" fill="var(--color-secondary)" />
|
|
121
|
+
</marker>
|
|
122
|
+
</defs>
|
|
123
|
+
|
|
124
|
+
<!-- Edges -->
|
|
125
|
+
{#each dedupedEdges as edge (edge.from + edge.to + edge.relationKey)}
|
|
126
|
+
{@const from = nodePos(edge.from)}
|
|
127
|
+
{@const to = nodePos(edge.to)}
|
|
128
|
+
{#if from && to}
|
|
129
|
+
{@const mx = (from.x + to.x) / 2}
|
|
130
|
+
{@const my = (from.y + to.y) / 2}
|
|
131
|
+
<line
|
|
132
|
+
x1={from.x} y1={from.y}
|
|
133
|
+
x2={to.x} y2={to.y}
|
|
134
|
+
stroke={edge.direction === 'forward' ? 'var(--color-primary)' : 'var(--color-secondary)'}
|
|
135
|
+
stroke-width="1.5"
|
|
136
|
+
stroke-dasharray={edge.direction === 'reverse' ? '5 3' : undefined}
|
|
137
|
+
marker-end="url(#{edge.direction === 'forward' ? 'arrow-fwd' : 'arrow-rev'})"
|
|
138
|
+
/>
|
|
139
|
+
<text x={mx} y={my - 5} class="edge-label">{edge.relationKey}</text>
|
|
140
|
+
{/if}
|
|
141
|
+
{/each}
|
|
142
|
+
|
|
143
|
+
<!-- Nodes -->
|
|
144
|
+
{#each positionedNodes as node (node.id)}
|
|
145
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -- g acts as a button only for non-root nodes (role/tabindex set conditionally) -->
|
|
146
|
+
<g
|
|
147
|
+
class="diagram-node"
|
|
148
|
+
class:diagram-node--root={node.isRoot}
|
|
149
|
+
class:diagram-node--neighbor={!node.isRoot}
|
|
150
|
+
role={node.isRoot ? undefined : 'button'}
|
|
151
|
+
tabindex={node.isRoot ? undefined : 0}
|
|
152
|
+
aria-label={node.isRoot ? undefined : `Open ${node.collection} ${node.label}`}
|
|
153
|
+
onclick={() => openRecord(node)}
|
|
154
|
+
onkeydown={e => (e.key === 'Enter' || e.key === ' ') && openRecord(node)}
|
|
155
|
+
>
|
|
156
|
+
<circle
|
|
157
|
+
cx={node.x} cy={node.y}
|
|
158
|
+
r={node.isRoot ? R_ROOT : R_NODE}
|
|
159
|
+
fill={node.isRoot ? 'var(--color-primary)' : 'var(--color-surface)'}
|
|
160
|
+
stroke={node.isRoot ? 'var(--color-primary-hover)' : 'var(--color-border)'}
|
|
161
|
+
stroke-width="2"
|
|
162
|
+
/>
|
|
163
|
+
<text x={node.x} y={node.y + (node.isRoot ? R_ROOT : R_NODE) + 14} class="node-label">
|
|
164
|
+
{node.label}
|
|
165
|
+
</text>
|
|
166
|
+
<text x={node.x} y={node.y + (node.isRoot ? R_ROOT : R_NODE) + 26} class="node-collection">
|
|
167
|
+
{node.collection}
|
|
168
|
+
</text>
|
|
169
|
+
</g>
|
|
170
|
+
{/each}
|
|
171
|
+
</svg>
|
|
172
|
+
</diagram-canvas>
|
|
173
|
+
{/if}
|
|
174
|
+
</diagram-component>
|
|
175
|
+
|
|
176
|
+
<style>
|
|
177
|
+
@layer components {
|
|
178
|
+
:global(diagram-component) {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
width: 100%;
|
|
182
|
+
height: 100%;
|
|
183
|
+
overflow: auto;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
:global(diagram-canvas) {
|
|
187
|
+
display: block;
|
|
188
|
+
flex: 1;
|
|
189
|
+
min-height: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
svg {
|
|
193
|
+
width: 100%;
|
|
194
|
+
height: 100%;
|
|
195
|
+
min-height: 50vh;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.diagram-status {
|
|
199
|
+
padding: var(--pad-md);
|
|
200
|
+
color: var(--color-text-muted);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.diagram-status--error {
|
|
204
|
+
color: var(--color-critical);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.node-label {
|
|
208
|
+
font-size: var(--default-font-size);
|
|
209
|
+
text-anchor: middle;
|
|
210
|
+
fill: var(--color-text);
|
|
211
|
+
pointer-events: none;
|
|
212
|
+
user-select: none;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.node-collection {
|
|
216
|
+
font-size: calc(var(--default-font-size) * 0.8);
|
|
217
|
+
text-anchor: middle;
|
|
218
|
+
fill: var(--color-text-muted);
|
|
219
|
+
pointer-events: none;
|
|
220
|
+
user-select: none;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.edge-label {
|
|
224
|
+
font-size: calc(var(--default-font-size) * 0.8);
|
|
225
|
+
text-anchor: middle;
|
|
226
|
+
fill: var(--color-text-muted);
|
|
227
|
+
pointer-events: none;
|
|
228
|
+
user-select: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.diagram-node--neighbor {
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* --color-primary-light/--color-primary-dark requested but not in css-base
|
|
236
|
+
tokens — substituted with the closest seeded variants: -muted (lighter
|
|
237
|
+
tint) and -hover (darker shade). */
|
|
238
|
+
.diagram-node--neighbor:hover circle,
|
|
239
|
+
.diagram-node--neighbor:focus circle {
|
|
240
|
+
fill: var(--color-primary-muted);
|
|
241
|
+
stroke: var(--color-primary);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
collection: string;
|
|
3
|
+
collectionId: string | number;
|
|
4
|
+
depth?: number;
|
|
5
|
+
direction?: 'forward' | 'reverse' | 'both';
|
|
6
|
+
};
|
|
7
|
+
declare const Diagram: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type Diagram = ReturnType<typeof Diagram>;
|
|
9
|
+
export default Diagram;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Explorer.svelte
|
|
3
|
+
Unified collection browser — TemplateShell layout: collection nav sidebar + content zone.
|
|
4
|
+
Content zone starts empty; sidebar clicks loadIn ExplorerContent into this Explorer's
|
|
5
|
+
zone (toggle, state preserved across collection switches).
|
|
6
|
+
Sidebar = DataList over appscheme, grouped by fks.appscheme_base.code (company services).
|
|
7
|
+
@role explorer
|
|
8
|
+
-->
|
|
9
|
+
<script lang="ts" generics="COL = Record<string, unknown>">
|
|
10
|
+
import DataList from '../../../data-ui/data/DataList.svelte';
|
|
11
|
+
import TemplateShell from '../../layout/TemplateShell.svelte';
|
|
12
|
+
import Icon from '@iconify/svelte';
|
|
13
|
+
import { untrack } from 'svelte';
|
|
14
|
+
import { generateFrameId } from '../../../main/frame/frameUtils.js';
|
|
15
|
+
import { machine } from '../../../main/machine.js';
|
|
16
|
+
import type { SortBy } from '../../../types/index.js';
|
|
17
|
+
|
|
18
|
+
// Bare appscheme icon names are Phosphor ('ph:'); pass through already-prefixed
|
|
19
|
+
// values, drop free-text/numeric junk to a safe default.
|
|
20
|
+
function schemeIcon(icon: unknown): string {
|
|
21
|
+
if (typeof icon !== 'string') return 'ph:table';
|
|
22
|
+
const t = icon.trim();
|
|
23
|
+
if (!t || /^\d+$/.test(t) || /\s/.test(t)) return 'ph:table';
|
|
24
|
+
return t.includes(':') ? t : `ph:${t}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let {
|
|
28
|
+
collection,
|
|
29
|
+
sortBy
|
|
30
|
+
}: {
|
|
31
|
+
collection: string;
|
|
32
|
+
sortBy?: SortBy;
|
|
33
|
+
} = $props();
|
|
34
|
+
|
|
35
|
+
const frameId = untrack(() => generateFrameId(collection));
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<TemplateShell zoneId={frameId} collection={collection}>
|
|
39
|
+
{#snippet leftbar()}
|
|
40
|
+
<DataList collection="appscheme" {sortBy} linkCollectionField="code" groupBy="fks.appscheme_base.code">
|
|
41
|
+
{#snippet dataRecord({ data })}
|
|
42
|
+
{@const scheme = data as { code: string; name?: string; icon?: string }}
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
class="explorer-scheme-item"
|
|
46
|
+
onclick={() => machine.framer.loadIn('explorer.content', scheme.code, { zone: frameId })}
|
|
47
|
+
>
|
|
48
|
+
<Icon icon={schemeIcon(scheme.icon)} class="explorer-scheme-icon" />
|
|
49
|
+
<span class="explorer-scheme-label">{scheme.name ?? scheme.code}</span>
|
|
50
|
+
</button>
|
|
51
|
+
{/snippet}
|
|
52
|
+
</DataList>
|
|
53
|
+
{/snippet}
|
|
54
|
+
</TemplateShell>
|
|
55
|
+
|
|
56
|
+
<style>
|
|
57
|
+
@layer components {
|
|
58
|
+
.explorer-scheme-item {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: var(--gutter-sm);
|
|
62
|
+
width: 100%;
|
|
63
|
+
padding: var(--pad-xs) var(--pad-sm);
|
|
64
|
+
border: none;
|
|
65
|
+
background: transparent;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
color: var(--color-text);
|
|
68
|
+
text-align: left;
|
|
69
|
+
|
|
70
|
+
&:hover {
|
|
71
|
+
background: var(--color-surface-hover);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
.explorer-scheme-item :global(.explorer-scheme-icon) {
|
|
75
|
+
flex-shrink: 0;
|
|
76
|
+
font-size: var(--icon-size-sm);
|
|
77
|
+
color: var(--color-text-muted);
|
|
78
|
+
}
|
|
79
|
+
.explorer-scheme-label {
|
|
80
|
+
flex: 1;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
text-overflow: ellipsis;
|
|
83
|
+
white-space: nowrap;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SortBy } from '../../../types/index.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
collection: string;
|
|
4
|
+
sortBy?: SortBy;
|
|
5
|
+
};
|
|
6
|
+
declare function $$render<COL = Record<string, unknown>>(): {
|
|
7
|
+
props: $$ComponentProps;
|
|
8
|
+
exports: {};
|
|
9
|
+
bindings: "";
|
|
10
|
+
slots: {};
|
|
11
|
+
events: {};
|
|
12
|
+
};
|
|
13
|
+
declare class __sveltets_Render<COL = Record<string, unknown>> {
|
|
14
|
+
props(): ReturnType<typeof $$render<COL>>['props'];
|
|
15
|
+
events(): ReturnType<typeof $$render<COL>>['events'];
|
|
16
|
+
slots(): ReturnType<typeof $$render<COL>>['slots'];
|
|
17
|
+
bindings(): "";
|
|
18
|
+
exports(): {};
|
|
19
|
+
}
|
|
20
|
+
interface $$IsomorphicComponent {
|
|
21
|
+
new <COL = Record<string, unknown>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<COL>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<COL>['props']>, ReturnType<__sveltets_Render<COL>['events']>, ReturnType<__sveltets_Render<COL>['slots']>> & {
|
|
22
|
+
$$bindings?: ReturnType<__sveltets_Render<COL>['bindings']>;
|
|
23
|
+
} & ReturnType<__sveltets_Render<COL>['exports']>;
|
|
24
|
+
<COL = Record<string, unknown>>(internal: unknown, props: ReturnType<__sveltets_Render<COL>['props']> & {}): ReturnType<__sveltets_Render<COL>['exports']>;
|
|
25
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
26
|
+
}
|
|
27
|
+
declare const Explorer: $$IsomorphicComponent;
|
|
28
|
+
type Explorer<COL = Record<string, unknown>> = InstanceType<typeof Explorer<COL>>;
|
|
29
|
+
export default Explorer;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
ExplorerContent.svelte
|
|
3
|
+
Bare collection body — DataList (list/table/grid) or Columner (column) view.
|
|
4
|
+
Loadable into an Explorer zone via loadIn (sidebar collection click).
|
|
5
|
+
@role explorer.content
|
|
6
|
+
-->
|
|
7
|
+
<script lang="ts" generics="COL = Record<string, unknown>">
|
|
8
|
+
import { untrack } from 'svelte';
|
|
9
|
+
import Icon from '@iconify/svelte';
|
|
10
|
+
import DataList from '../../../data-ui/data/DataList.svelte';
|
|
11
|
+
import DataToolbar from '../../../data-ui/controls/DataToolbar.svelte';
|
|
12
|
+
import Find from '../../../data-ui/controls/Find.svelte';
|
|
13
|
+
import Group from '../../../data-ui/controls/Group.svelte';
|
|
14
|
+
import ListMode from '../../../data-ui/controls/ListMode.svelte';
|
|
15
|
+
import Sort from '../../../data-ui/controls/Sort.svelte';
|
|
16
|
+
import Columner from '../../layout/Columner.svelte';
|
|
17
|
+
import type { SortBy, Where } from '../../../types/index.js';
|
|
18
|
+
|
|
19
|
+
type ViewMode = 'list' | 'table' | 'grid' | 'column' | 'accordion';
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
collection,
|
|
23
|
+
mode: modeProp = 'list',
|
|
24
|
+
where,
|
|
25
|
+
sortBy,
|
|
26
|
+
groupBy,
|
|
27
|
+
pageSize = 20
|
|
28
|
+
}: {
|
|
29
|
+
collection: string;
|
|
30
|
+
mode?: ViewMode;
|
|
31
|
+
where?: Where<COL>;
|
|
32
|
+
sortBy?: SortBy;
|
|
33
|
+
groupBy?: string;
|
|
34
|
+
pageSize?: number;
|
|
35
|
+
} = $props();
|
|
36
|
+
|
|
37
|
+
let columnMode = $state(untrack(() => modeProp === 'column'));
|
|
38
|
+
const listModeProp = $derived(modeProp === 'column' ? 'list' : modeProp);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<explorer-content>
|
|
42
|
+
<DataToolbar>
|
|
43
|
+
{#snippet find()}<Find {collection} advanced />{/snippet}
|
|
44
|
+
{#snippet sort()}<Sort {collection} />{/snippet}
|
|
45
|
+
{#snippet group()}<Group {collection} />{/snippet}
|
|
46
|
+
{#snippet extras()}
|
|
47
|
+
<ListMode {collection} onModeChange={() => (columnMode = false)} />
|
|
48
|
+
<button
|
|
49
|
+
type="button"
|
|
50
|
+
class="btn-icon"
|
|
51
|
+
class:active={columnMode}
|
|
52
|
+
aria-label="Column view"
|
|
53
|
+
aria-pressed={columnMode}
|
|
54
|
+
onclick={() => (columnMode = !columnMode)}
|
|
55
|
+
>
|
|
56
|
+
<Icon icon="ph:columns" />
|
|
57
|
+
</button>
|
|
58
|
+
{/snippet}
|
|
59
|
+
</DataToolbar>
|
|
60
|
+
|
|
61
|
+
<explorer-body>
|
|
62
|
+
{#if columnMode}
|
|
63
|
+
<Columner
|
|
64
|
+
{collection}
|
|
65
|
+
componentProps={{
|
|
66
|
+
link: 'loadIn:record',
|
|
67
|
+
listClass: 'list list-grid',
|
|
68
|
+
groupClass: 'explorer-group'
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
71
|
+
{:else}
|
|
72
|
+
<DataList
|
|
73
|
+
{collection}
|
|
74
|
+
{where}
|
|
75
|
+
{sortBy}
|
|
76
|
+
{groupBy}
|
|
77
|
+
{pageSize}
|
|
78
|
+
mode={listModeProp}
|
|
79
|
+
link="loadInDialog:fiche"
|
|
80
|
+
listClass="list list-grid"
|
|
81
|
+
groupClass="explorer-group"
|
|
82
|
+
>
|
|
83
|
+
{#snippet dataListHeader({ key })}
|
|
84
|
+
<header class="section-header section-header-bordered">
|
|
85
|
+
<h3>{key}</h3>
|
|
86
|
+
</header>
|
|
87
|
+
{/snippet}
|
|
88
|
+
|
|
89
|
+
{#snippet empty()}
|
|
90
|
+
<div class="empty-state">
|
|
91
|
+
<div class="empty-state-icon">📭</div>
|
|
92
|
+
<p class="empty-state-title">No records</p>
|
|
93
|
+
<p class="empty-state-text">This collection is empty.</p>
|
|
94
|
+
</div>
|
|
95
|
+
{/snippet}
|
|
96
|
+
</DataList>
|
|
97
|
+
{/if}
|
|
98
|
+
</explorer-body>
|
|
99
|
+
</explorer-content>
|
|
100
|
+
|
|
101
|
+
<style>
|
|
102
|
+
@layer components {
|
|
103
|
+
explorer-content {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
height: 100%;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
explorer-body {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex: 1;
|
|
113
|
+
min-height: 0;
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.btn-icon.active {
|
|
118
|
+
background: var(--color-surface-active);
|
|
119
|
+
color: var(--color-primary);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:global(.explorer-group) {
|
|
123
|
+
margin-bottom: var(--gutter-md);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SortBy, Where } from '../../../types/index.js';
|
|
2
|
+
declare function $$render<COL = Record<string, unknown>>(): {
|
|
3
|
+
props: {
|
|
4
|
+
collection: string;
|
|
5
|
+
mode?: "list" | "table" | "grid" | "accordion" | "column";
|
|
6
|
+
where?: Where<COL>;
|
|
7
|
+
sortBy?: SortBy;
|
|
8
|
+
groupBy?: string;
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
};
|
|
11
|
+
exports: {};
|
|
12
|
+
bindings: "";
|
|
13
|
+
slots: {};
|
|
14
|
+
events: {};
|
|
15
|
+
};
|
|
16
|
+
declare class __sveltets_Render<COL = Record<string, unknown>> {
|
|
17
|
+
props(): ReturnType<typeof $$render<COL>>['props'];
|
|
18
|
+
events(): ReturnType<typeof $$render<COL>>['events'];
|
|
19
|
+
slots(): ReturnType<typeof $$render<COL>>['slots'];
|
|
20
|
+
bindings(): "";
|
|
21
|
+
exports(): {};
|
|
22
|
+
}
|
|
23
|
+
interface $$IsomorphicComponent {
|
|
24
|
+
new <COL = Record<string, unknown>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<COL>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<COL>['props']>, ReturnType<__sveltets_Render<COL>['events']>, ReturnType<__sveltets_Render<COL>['slots']>> & {
|
|
25
|
+
$$bindings?: ReturnType<__sveltets_Render<COL>['bindings']>;
|
|
26
|
+
} & ReturnType<__sveltets_Render<COL>['exports']>;
|
|
27
|
+
<COL = Record<string, unknown>>(internal: unknown, props: ReturnType<__sveltets_Render<COL>['props']> & {}): ReturnType<__sveltets_Render<COL>['exports']>;
|
|
28
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
29
|
+
}
|
|
30
|
+
declare const ExplorerContent: $$IsomorphicComponent;
|
|
31
|
+
type ExplorerContent<COL = Record<string, unknown>> = InstanceType<typeof ExplorerContent<COL>>;
|
|
32
|
+
export default ExplorerContent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Explorer } from './explorer/Explorer.svelte';
|
|
2
|
+
export { default as ExplorerContent } from './explorer/ExplorerContent.svelte';
|
|
3
|
+
export { default as Synthesis } from './synthesis/Synthesis.svelte';
|
|
4
|
+
export { default as RbacMatrix } from './rbac/RbacMatrix.svelte';
|
|
5
|
+
export { default as Diagram } from './diagram/Diagram.svelte';
|
|
6
|
+
export { default as Dashboard } from './dashboard/Dashboard.svelte';
|
|
7
|
+
export { default as Today } from './today/Today.svelte';
|
|
8
|
+
export { default as Space } from './space/Space.svelte';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Shell frame components barrel export
|
|
2
|
+
export { default as Explorer } from './explorer/Explorer.svelte';
|
|
3
|
+
export { default as ExplorerContent } from './explorer/ExplorerContent.svelte';
|
|
4
|
+
export { default as Synthesis } from './synthesis/Synthesis.svelte';
|
|
5
|
+
export { default as RbacMatrix } from './rbac/RbacMatrix.svelte';
|
|
6
|
+
export { default as Diagram } from './diagram/Diagram.svelte';
|
|
7
|
+
export { default as Dashboard } from './dashboard/Dashboard.svelte';
|
|
8
|
+
export { default as Today } from './today/Today.svelte';
|
|
9
|
+
export { default as Space } from './space/Space.svelte';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
MainMenuContent.svelte
|
|
3
|
+
Right-hand content of the global start menu.
|
|
4
|
+
Loaded via machine.framer.loadIn('main-menu.content', collection, { zone: 'main-menu-content' }).
|
|
5
|
+
|
|
6
|
+
@prop {string} collection - currently selected collection
|
|
7
|
+
-->
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { machine } from '../../../main/machine.js';
|
|
10
|
+
|
|
11
|
+
let { collection }: { collection: string } = $props();
|
|
12
|
+
|
|
13
|
+
const data = $derived(machine.store(collection, {}));
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<main-menu-content-frame>
|
|
17
|
+
<h4 class="mmc-title">{collection}</h4>
|
|
18
|
+
<p class="mmc-meta">
|
|
19
|
+
{data.records?.length ?? 0} enregistrement(s)
|
|
20
|
+
</p>
|
|
21
|
+
<main-menu-content-actions>
|
|
22
|
+
<button
|
|
23
|
+
type="button"
|
|
24
|
+
class="mmc-action"
|
|
25
|
+
onclick={() => machine.framer.loadFrame('space', collection)}
|
|
26
|
+
>
|
|
27
|
+
Espace
|
|
28
|
+
</button>
|
|
29
|
+
<button
|
|
30
|
+
type="button"
|
|
31
|
+
class="mmc-action"
|
|
32
|
+
onclick={() => machine.framer.loadFrame('explorer', collection)}
|
|
33
|
+
>
|
|
34
|
+
Parcourir
|
|
35
|
+
</button>
|
|
36
|
+
<button
|
|
37
|
+
type="button"
|
|
38
|
+
class="mmc-action mmc-action--primary"
|
|
39
|
+
onclick={() => machine.framer.loadInDialog('form', collection, undefined, { vars: { mode: 'create' } })}
|
|
40
|
+
>
|
|
41
|
+
Créer
|
|
42
|
+
</button>
|
|
43
|
+
</main-menu-content-actions>
|
|
44
|
+
</main-menu-content-frame>
|
|
45
|
+
|
|
46
|
+
<style>
|
|
47
|
+
@layer components {
|
|
48
|
+
main-menu-content-frame {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: var(--gutter-sm);
|
|
52
|
+
padding: var(--pad-sm);
|
|
53
|
+
background: var(--color-surface-raised);
|
|
54
|
+
color: var(--color-text);
|
|
55
|
+
overflow-y: auto;
|
|
56
|
+
}
|
|
57
|
+
.mmc-title {
|
|
58
|
+
margin: 0;
|
|
59
|
+
font-size: var(--text-md);
|
|
60
|
+
font-weight: var(--font-semibold);
|
|
61
|
+
}
|
|
62
|
+
.mmc-meta {
|
|
63
|
+
margin: 0;
|
|
64
|
+
color: var(--color-text-muted);
|
|
65
|
+
font-size: var(--text-sm);
|
|
66
|
+
}
|
|
67
|
+
main-menu-content-actions {
|
|
68
|
+
display: flex;
|
|
69
|
+
gap: var(--gutter-xs);
|
|
70
|
+
flex-wrap: wrap;
|
|
71
|
+
}
|
|
72
|
+
.mmc-action {
|
|
73
|
+
all: unset;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
min-height: var(--control-height);
|
|
79
|
+
padding: 0 var(--pad-sm);
|
|
80
|
+
border-radius: var(--radius-sm);
|
|
81
|
+
background: var(--color-surface-raised);
|
|
82
|
+
border: var(--border-width) solid var(--color-border-strong);
|
|
83
|
+
color: var(--color-text);
|
|
84
|
+
font-size: var(--text-sm);
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
.mmc-action:hover {
|
|
88
|
+
background: var(--color-surface-hover);
|
|
89
|
+
}
|
|
90
|
+
.mmc-action--primary {
|
|
91
|
+
background: var(--color-primary);
|
|
92
|
+
border-color: var(--color-primary-hover);
|
|
93
|
+
color: var(--default-color-surface-light);
|
|
94
|
+
}
|
|
95
|
+
.mmc-action--primary:hover {
|
|
96
|
+
background: var(--color-primary-hover);
|
|
97
|
+
border-color: var(--color-primary-hover);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</style>
|