@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
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const Frame: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
showPanel?: boolean;
|
|
21
|
-
panelMode?: "expanded" | "reduced";
|
|
22
|
-
}, {
|
|
23
|
-
leftNav: {};
|
|
24
|
-
default: {};
|
|
25
|
-
}>, {
|
|
26
|
-
[evt: string]: CustomEvent<any>;
|
|
27
|
-
}, {
|
|
28
|
-
leftNav: {};
|
|
29
|
-
default: {};
|
|
30
|
-
}, {}, string>;
|
|
31
|
-
type Frame = InstanceType<typeof Frame>;
|
|
32
|
-
export default Frame;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
let className = '';
|
|
3
|
-
export let title: string | undefined = undefined;
|
|
4
|
-
export let vertical: boolean = false;
|
|
5
|
-
export { className as class };
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
{#if $$slots.input && !title}
|
|
9
|
-
<div class="w-full py-2 text-sm font-semibold">
|
|
10
|
-
{title}
|
|
11
|
-
</div>
|
|
12
|
-
{/if}
|
|
13
|
-
<div class="{vertical ? 'flex-v' : 'flex-align-middle'} gap-4 py-4">
|
|
14
|
-
<div class="flex flex-1 text-sm">
|
|
15
|
-
<div class="flex-1 font-semibold"><slot name="input">- {title}</slot></div>
|
|
16
|
-
<slot name="titleButton" />
|
|
17
|
-
</div>
|
|
18
|
-
<div class="{vertical ? 'px-2' : ''} {className}">
|
|
19
|
-
<slot />
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const InfoLine: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
title?: string | undefined;
|
|
21
|
-
vertical?: boolean;
|
|
22
|
-
class?: string;
|
|
23
|
-
}, {
|
|
24
|
-
input: {};
|
|
25
|
-
titleButton: {};
|
|
26
|
-
default: {};
|
|
27
|
-
}>, {
|
|
28
|
-
[evt: string]: CustomEvent<any>;
|
|
29
|
-
}, {
|
|
30
|
-
input: {};
|
|
31
|
-
titleButton: {};
|
|
32
|
-
default: {};
|
|
33
|
-
}, {}, string>;
|
|
34
|
-
type InfoLine = InstanceType<typeof InfoLine>;
|
|
35
|
-
export default InfoLine;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
let className: string = '';
|
|
3
|
-
export let data: any[];
|
|
4
|
-
export { className as class };
|
|
5
|
-
export let naked = false;
|
|
6
|
-
export let title: string = '';
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
{#if naked}
|
|
10
|
-
{title}
|
|
11
|
-
{#each data ?? [] as item}
|
|
12
|
-
<slot {item} />
|
|
13
|
-
{/each}
|
|
14
|
-
{:else}
|
|
15
|
-
{title}
|
|
16
|
-
<div class={className}>
|
|
17
|
-
{#each data ?? [] as item, idx}
|
|
18
|
-
<slot {item} {idx} />
|
|
19
|
-
{/each}
|
|
20
|
-
</div>
|
|
21
|
-
{/if}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const List: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
data: any[];
|
|
21
|
-
class?: string;
|
|
22
|
-
naked?: boolean;
|
|
23
|
-
title?: string;
|
|
24
|
-
}, {
|
|
25
|
-
default: {
|
|
26
|
-
item: any;
|
|
27
|
-
idx: any;
|
|
28
|
-
};
|
|
29
|
-
}>, {
|
|
30
|
-
[evt: string]: CustomEvent<any>;
|
|
31
|
-
}, {
|
|
32
|
-
default: {
|
|
33
|
-
item: any;
|
|
34
|
-
idx: any;
|
|
35
|
-
};
|
|
36
|
-
}, {}, string>;
|
|
37
|
-
type List = InstanceType<typeof List>;
|
|
38
|
-
export default List;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
let className = '';
|
|
3
|
-
export let values: any = [];
|
|
4
|
-
export let value: any | undefined = undefined;
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
{#each values as valueO}
|
|
8
|
-
<div class={' ' + (valueO == value ? 'active ' : 'inactive')}>
|
|
9
|
-
<slot item={valueO} active={valueO === value} />
|
|
10
|
-
</div>
|
|
11
|
-
{/each}
|
|
12
|
-
{#if !values.length}
|
|
13
|
-
<slot name="selectorFallback" />
|
|
14
|
-
{/if}
|
|
15
|
-
|
|
16
|
-
<style>
|
|
17
|
-
@reference "../../styles/references.css";
|
|
18
|
-
.active {
|
|
19
|
-
@apply border border-b-2 border-neutral-500; /* active */
|
|
20
|
-
}
|
|
21
|
-
.inactive {
|
|
22
|
-
@apply border border-b-2 border-transparent opacity-60; /* inactive */
|
|
23
|
-
}
|
|
24
|
-
/* @apply border border-b-2 border-neutral-500;
|
|
25
|
-
@apply opacity-60 border border-b-2 border-transparent; */
|
|
26
|
-
</style>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const Selector: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
values?: any;
|
|
21
|
-
value?: any | undefined;
|
|
22
|
-
}, {
|
|
23
|
-
default: {
|
|
24
|
-
item: unknown;
|
|
25
|
-
active: boolean;
|
|
26
|
-
};
|
|
27
|
-
selectorFallback: {};
|
|
28
|
-
}>, {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {
|
|
31
|
-
default: {
|
|
32
|
-
item: unknown;
|
|
33
|
-
active: boolean;
|
|
34
|
-
};
|
|
35
|
-
selectorFallback: {};
|
|
36
|
-
}, {}, string>;
|
|
37
|
-
type Selector = InstanceType<typeof Selector>;
|
|
38
|
-
export default Selector;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { TplCollectionName, Tpl, IdbqModel, TplFields } from "@medyll/idae-idbql";
|
|
2
|
-
import { MachineDb, type IDbFieldRules } from "../machineDb.js";
|
|
3
|
-
import { IDbFormValidate } from "./IDbFormValidate.js";
|
|
4
|
-
import { IDbCollectionFieldForge } from "./IDbCollectionFieldForge.js";
|
|
5
|
-
import { IDbCollectionValues } from "./IDbCollectionValues.js";
|
|
6
|
-
/**
|
|
7
|
-
* IDbCollection
|
|
8
|
-
*
|
|
9
|
-
* Represents a single collection template, providing access to its schema, fields, and metadata.
|
|
10
|
-
*
|
|
11
|
-
* Main responsibilities:
|
|
12
|
-
* - Holds references to the collection name, template, and model.
|
|
13
|
-
* - Provides access to field rules, presentation, and foreign keys.
|
|
14
|
-
* - Supplies utilities for retrieving collection values and templates.
|
|
15
|
-
*
|
|
16
|
-
* Usage:
|
|
17
|
-
* const collection = new IDbCollection('agents', idbBase, model);
|
|
18
|
-
* const fields = collection.fields;
|
|
19
|
-
* const presentation = collection.getPresentation();
|
|
20
|
-
*
|
|
21
|
-
* This class is typically used for schema-driven applications and dynamic UI generation.
|
|
22
|
-
*/
|
|
23
|
-
export declare class IDbCollection {
|
|
24
|
-
#private;
|
|
25
|
-
/** The collection name. */
|
|
26
|
-
collection: TplCollectionName;
|
|
27
|
-
/**
|
|
28
|
-
* Create a new IDbCollection instance.
|
|
29
|
-
* @param collectionName The collection name.
|
|
30
|
-
* @param idbBase The MachineDb instance.
|
|
31
|
-
* @param model The IdbqModel instance.
|
|
32
|
-
*/
|
|
33
|
-
constructor(collectionName: TplCollectionName, idbBase: MachineDb, model: IdbqModel);
|
|
34
|
-
/**
|
|
35
|
-
* Get the collection model.
|
|
36
|
-
*/
|
|
37
|
-
get model(): import("@medyll/idae-idbql").CollectionModel<Record<string, any>>;
|
|
38
|
-
/**
|
|
39
|
-
* Get the collection fields.
|
|
40
|
-
*/
|
|
41
|
-
get fields(): TplFields;
|
|
42
|
-
/**
|
|
43
|
-
* Get the presentation string for the collection.
|
|
44
|
-
*/
|
|
45
|
-
getPresentation(): string;
|
|
46
|
-
/**
|
|
47
|
-
* Get the field rule for a given field name.
|
|
48
|
-
* @param fieldName The field name.
|
|
49
|
-
*/
|
|
50
|
-
getFieldRule(fieldName: keyof TplFields): IDbFieldRules | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Get the collection template.
|
|
53
|
-
*/
|
|
54
|
-
getTemplate(): Tpl;
|
|
55
|
-
/**
|
|
56
|
-
* Get the foreign keys from the model template.
|
|
57
|
-
*/
|
|
58
|
-
getModelTemplateFks(): Tpl["fks"];
|
|
59
|
-
/**
|
|
60
|
-
* Get the index name for the collection.
|
|
61
|
-
*/
|
|
62
|
-
getIndexName(): string;
|
|
63
|
-
/**
|
|
64
|
-
* Get a new IDbCollectionValues instance for this collection.
|
|
65
|
-
*/
|
|
66
|
-
collectionValues(): IDbCollectionValues<Record<string, any>>;
|
|
67
|
-
fieldForge<T extends Record<string, any>>(fieldName: keyof T, data: T): IDbCollectionFieldForge<T>;
|
|
68
|
-
getFormValidate(): IDbFormValidate;
|
|
69
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { MachineDb } from "../machineDb.js";
|
|
2
|
-
import { IDbFormValidate } from "./IDbFormValidate.js";
|
|
3
|
-
import { IDbCollectionFieldForge } from "./IDbCollectionFieldForge.js";
|
|
4
|
-
import { IDbCollectionValues } from "./IDbCollectionValues.js";
|
|
5
|
-
/**
|
|
6
|
-
* IDbCollection
|
|
7
|
-
*
|
|
8
|
-
* Represents a single collection template, providing access to its schema, fields, and metadata.
|
|
9
|
-
*
|
|
10
|
-
* Main responsibilities:
|
|
11
|
-
* - Holds references to the collection name, template, and model.
|
|
12
|
-
* - Provides access to field rules, presentation, and foreign keys.
|
|
13
|
-
* - Supplies utilities for retrieving collection values and templates.
|
|
14
|
-
*
|
|
15
|
-
* Usage:
|
|
16
|
-
* const collection = new IDbCollection('agents', idbBase, model);
|
|
17
|
-
* const fields = collection.fields;
|
|
18
|
-
* const presentation = collection.getPresentation();
|
|
19
|
-
*
|
|
20
|
-
* This class is typically used for schema-driven applications and dynamic UI generation.
|
|
21
|
-
*/
|
|
22
|
-
export class IDbCollection {
|
|
23
|
-
/** The collection name. */
|
|
24
|
-
collection;
|
|
25
|
-
/** The collection template. */
|
|
26
|
-
#template;
|
|
27
|
-
/** The MachineDb instance. */
|
|
28
|
-
#machineDb;
|
|
29
|
-
/** The collection model. */
|
|
30
|
-
#model;
|
|
31
|
-
/**
|
|
32
|
-
* Create a new IDbCollection instance.
|
|
33
|
-
* @param collectionName The collection name.
|
|
34
|
-
* @param idbBase The MachineDb instance.
|
|
35
|
-
* @param model The IdbqModel instance.
|
|
36
|
-
*/
|
|
37
|
-
constructor(collectionName, idbBase, model) {
|
|
38
|
-
this.collection = collectionName;
|
|
39
|
-
this.#machineDb = idbBase;
|
|
40
|
-
this.#model = model[String(collectionName)];
|
|
41
|
-
this.#template = this.#model["template"];
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Get the collection model.
|
|
45
|
-
*/
|
|
46
|
-
get model() {
|
|
47
|
-
return this.#model;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Get the collection fields.
|
|
51
|
-
*/
|
|
52
|
-
get fields() {
|
|
53
|
-
return this.#template?.fields;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Get the presentation string for the collection.
|
|
57
|
-
*/
|
|
58
|
-
getPresentation() {
|
|
59
|
-
return this.#template?.presentation;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get the field rule for a given field name.
|
|
63
|
-
* @param fieldName The field name.
|
|
64
|
-
*/
|
|
65
|
-
getFieldRule(fieldName) {
|
|
66
|
-
return this.fields[String(fieldName)];
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Get the collection template.
|
|
70
|
-
*/
|
|
71
|
-
getTemplate() {
|
|
72
|
-
return this.#template;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Get the foreign keys from the model template.
|
|
76
|
-
*/
|
|
77
|
-
getModelTemplateFks() {
|
|
78
|
-
return this.#template?.fks;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Get the index name for the collection.
|
|
82
|
-
*/
|
|
83
|
-
getIndexName() {
|
|
84
|
-
return this.#template?.index;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Get a new IDbCollectionValues instance for this collection.
|
|
88
|
-
*/
|
|
89
|
-
collectionValues() {
|
|
90
|
-
return new IDbCollectionValues(this.collection, this.#machineDb);
|
|
91
|
-
}
|
|
92
|
-
fieldForge(fieldName, data) {
|
|
93
|
-
return new IDbCollectionFieldForge(this.collection, fieldName, data, this.collectionValues());
|
|
94
|
-
}
|
|
95
|
-
getFormValidate() {
|
|
96
|
-
return new IDbFormValidate(this.collection, this.#machineDb);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { TplCollectionName } from '@medyll/idae-idbql';
|
|
2
|
-
import { IDbCollectionValues } from './IDbCollectionValues.js';
|
|
3
|
-
import type { IDbForgeArgs, IDbFieldType } from '../machineDb.js';
|
|
4
|
-
import type { IDbForge } from '../machineForge.js';
|
|
5
|
-
/**
|
|
6
|
-
* IDbCollectionFieldForge
|
|
7
|
-
*
|
|
8
|
-
* This class provides advanced metadata and formatting for a single field of a collection, given a data object.
|
|
9
|
-
* It is designed for dynamic UI generation, form rendering, and introspection in schema-driven applications.
|
|
10
|
-
*
|
|
11
|
-
* Main responsibilities:
|
|
12
|
-
* - Holds references to the collection name, field name, and the data object for context.
|
|
13
|
-
* - Provides access to the parsed field metadata (IDbForge) for the field, including type, rules, and arguments.
|
|
14
|
-
* - Offers formatting utilities for the field value, adapting to type (number, text, array, object, etc.).
|
|
15
|
-
* - Supplies input attributes and type hints for form generation (e.g., htmlInputType, inputDataSet).
|
|
16
|
-
* - Supports iteration over array/object fields for complex form layouts.
|
|
17
|
-
* - Enables extraction of raw data and field arguments for validation and UI logic.
|
|
18
|
-
*
|
|
19
|
-
* Usage:
|
|
20
|
-
* const forge = new IDbCollectionFieldForge('agents', 'name', agentData);
|
|
21
|
-
* const formatted = forge.format; // formatted value for display
|
|
22
|
-
* const inputType = forge.htmlInputType; // e.g. 'text', 'area', 'email', etc.
|
|
23
|
-
* const meta = forge.forge; // IDbForge metadata for the field
|
|
24
|
-
*
|
|
25
|
-
* This class is typically used via IDbBase.getCollectionFieldForge for shared instance management.
|
|
26
|
-
*/
|
|
27
|
-
export declare class IDbCollectionFieldForge<T extends Record<string, any>> {
|
|
28
|
-
#private;
|
|
29
|
-
constructor(collection: TplCollectionName, fieldName: any, data: T, collectionValues?: IDbCollectionValues<T>);
|
|
30
|
-
get format(): string;
|
|
31
|
-
get inputDataSet(): Record<"data-fieldArgs" | "data-fieldType" | "data-fieldName" | "data-collection" | "data-collectionId", string>;
|
|
32
|
-
get forge(): IDbForge | undefined;
|
|
33
|
-
get fieldArgs(): IDbForgeArgs | undefined;
|
|
34
|
-
get fieldType(): IDbFieldType | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* will return text.inputBase for ['url', 'email', 'number', 'date', 'time', 'datetime', 'phone', 'password']
|
|
37
|
-
*/
|
|
38
|
-
get htmlInputType(): string | 'text' | 'area';
|
|
39
|
-
get rawData(): T;
|
|
40
|
-
iterateArray(fieldName: string, data: any[]): IDbForge[];
|
|
41
|
-
iterateObject(fieldName: string, data: Record<string, any>): IDbForge[];
|
|
42
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { IDbCollectionValues } from './IDbCollectionValues.js';
|
|
2
|
-
/**
|
|
3
|
-
* IDbCollectionFieldForge
|
|
4
|
-
*
|
|
5
|
-
* This class provides advanced metadata and formatting for a single field of a collection, given a data object.
|
|
6
|
-
* It is designed for dynamic UI generation, form rendering, and introspection in schema-driven applications.
|
|
7
|
-
*
|
|
8
|
-
* Main responsibilities:
|
|
9
|
-
* - Holds references to the collection name, field name, and the data object for context.
|
|
10
|
-
* - Provides access to the parsed field metadata (IDbForge) for the field, including type, rules, and arguments.
|
|
11
|
-
* - Offers formatting utilities for the field value, adapting to type (number, text, array, object, etc.).
|
|
12
|
-
* - Supplies input attributes and type hints for form generation (e.g., htmlInputType, inputDataSet).
|
|
13
|
-
* - Supports iteration over array/object fields for complex form layouts.
|
|
14
|
-
* - Enables extraction of raw data and field arguments for validation and UI logic.
|
|
15
|
-
*
|
|
16
|
-
* Usage:
|
|
17
|
-
* const forge = new IDbCollectionFieldForge('agents', 'name', agentData);
|
|
18
|
-
* const formatted = forge.format; // formatted value for display
|
|
19
|
-
* const inputType = forge.htmlInputType; // e.g. 'text', 'area', 'email', etc.
|
|
20
|
-
* const meta = forge.forge; // IDbForge metadata for the field
|
|
21
|
-
*
|
|
22
|
-
* This class is typically used via IDbBase.getCollectionFieldForge for shared instance management.
|
|
23
|
-
*/
|
|
24
|
-
export class IDbCollectionFieldForge {
|
|
25
|
-
#collection;
|
|
26
|
-
#collectionValues;
|
|
27
|
-
#fieldName;
|
|
28
|
-
#data;
|
|
29
|
-
constructor(collection, fieldName, data, collectionValues) {
|
|
30
|
-
this.#collection = collection;
|
|
31
|
-
this.#collectionValues = collectionValues ?? new IDbCollectionValues(collection);
|
|
32
|
-
this.#fieldName = String(fieldName);
|
|
33
|
-
this.#data = data;
|
|
34
|
-
}
|
|
35
|
-
get format() {
|
|
36
|
-
return this.#collectionValues.format(String(this.#fieldName), this.#data);
|
|
37
|
-
}
|
|
38
|
-
get inputDataSet() {
|
|
39
|
-
return this.#collectionValues.getInputDataSet(String(this.#fieldName), this.#data);
|
|
40
|
-
}
|
|
41
|
-
// renamed from parseCollectionFieldName
|
|
42
|
-
get forge() {
|
|
43
|
-
return this.#collectionValues.idbBase.parseCollectionFieldName(this.#collection, String(this.#fieldName));
|
|
44
|
-
}
|
|
45
|
-
get fieldArgs() {
|
|
46
|
-
return this.forge?.fieldArgs;
|
|
47
|
-
}
|
|
48
|
-
get fieldType() {
|
|
49
|
-
return this.forge?.fieldType;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* will return text.inputBase for ['url', 'email', 'number', 'date', 'time', 'datetime', 'phone', 'password']
|
|
53
|
-
*/
|
|
54
|
-
get htmlInputType() {
|
|
55
|
-
let variant = this?.fieldType?.split('text-')?.[1] ?? this.fieldType;
|
|
56
|
-
if (variant === 'area')
|
|
57
|
-
return variant;
|
|
58
|
-
if (this.forge?.fieldType?.startsWith('text-'))
|
|
59
|
-
return 'text';
|
|
60
|
-
if (['url', 'email', 'number', 'date', 'time', 'datetime', 'phone', 'password'].includes(this.forge?.fieldType ?? '')) {
|
|
61
|
-
return this.forge?.fieldType?.trim?.() ?? 'text';
|
|
62
|
-
}
|
|
63
|
-
return 'text';
|
|
64
|
-
}
|
|
65
|
-
get rawData() {
|
|
66
|
-
return this.#data;
|
|
67
|
-
}
|
|
68
|
-
iterateArray(fieldName, data) {
|
|
69
|
-
return this.#collectionValues.iterateArrayField(fieldName, data);
|
|
70
|
-
}
|
|
71
|
-
iterateObject(fieldName, data) {
|
|
72
|
-
return this.#collectionValues.iterateObjectField(fieldName, data);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { TplCollectionName, TplFields } from '@medyll/idae-idbql';
|
|
2
|
-
import { IDbCollectionValues } from './IDbCollectionValues.js';
|
|
3
|
-
import type { IDbForge } from '../machineForge.js';
|
|
4
|
-
/**
|
|
5
|
-
* IDbCollectionFieldValues
|
|
6
|
-
*
|
|
7
|
-
* Provides utilities to introspect and format field values for a given collection and data object.
|
|
8
|
-
*
|
|
9
|
-
* Main responsibilities:
|
|
10
|
-
* - Holds references to the collection, data, and collection values instance.
|
|
11
|
-
* - Provides methods to get field metadata, format values, and generate input attributes.
|
|
12
|
-
* - Supports iteration over array and object fields for advanced UI layouts.
|
|
13
|
-
*
|
|
14
|
-
* Usage:
|
|
15
|
-
* const fieldValues = new IDbCollectionFieldValues('agents', agentData);
|
|
16
|
-
* const forge = fieldValues.getForge('name');
|
|
17
|
-
* const formatted = fieldValues.format('name');
|
|
18
|
-
*
|
|
19
|
-
* @template T - The type of the data object for the collection.
|
|
20
|
-
*/
|
|
21
|
-
export declare class IDbCollectionFieldValues<T extends Record<string, any>> {
|
|
22
|
-
#private;
|
|
23
|
-
/**
|
|
24
|
-
* Create a new IDbCollectionFieldValues instance.
|
|
25
|
-
* @param collection The collection name.
|
|
26
|
-
* @param data The data object.
|
|
27
|
-
* @param collectionValues Optional IDbCollectionValues instance.
|
|
28
|
-
*/
|
|
29
|
-
constructor(collection: TplCollectionName, data: T, collectionValues?: IDbCollectionValues<T>);
|
|
30
|
-
/**
|
|
31
|
-
* Iterate over an array field and return an array of IDbForge objects for each element.
|
|
32
|
-
* @param fieldName The field name.
|
|
33
|
-
* @param data The array data.
|
|
34
|
-
* @returns An array of IDbForge objects.
|
|
35
|
-
* @deprecated use IDbCollectionValues.iterateArrayField instead
|
|
36
|
-
*/
|
|
37
|
-
iterateArrayField(fieldName: keyof TplFields, data: any[]): IDbForge[];
|
|
38
|
-
/**
|
|
39
|
-
* Iterate over an object field and return an array of IDbForge objects for each property.
|
|
40
|
-
* @param fieldName The field name.
|
|
41
|
-
* @param data The object data.
|
|
42
|
-
* @returns An array of IDbForge objects.
|
|
43
|
-
* @deprecated use IDbCollectionValues.iterateObjectField instead
|
|
44
|
-
*/
|
|
45
|
-
iterateObjectField(fieldName: keyof TplFields, data: Record<string, unknown>): IDbForge[];
|
|
46
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { IDbCollectionValues } from './IDbCollectionValues.js';
|
|
2
|
-
/**
|
|
3
|
-
* IDbCollectionFieldValues
|
|
4
|
-
*
|
|
5
|
-
* Provides utilities to introspect and format field values for a given collection and data object.
|
|
6
|
-
*
|
|
7
|
-
* Main responsibilities:
|
|
8
|
-
* - Holds references to the collection, data, and collection values instance.
|
|
9
|
-
* - Provides methods to get field metadata, format values, and generate input attributes.
|
|
10
|
-
* - Supports iteration over array and object fields for advanced UI layouts.
|
|
11
|
-
*
|
|
12
|
-
* Usage:
|
|
13
|
-
* const fieldValues = new IDbCollectionFieldValues('agents', agentData);
|
|
14
|
-
* const forge = fieldValues.getForge('name');
|
|
15
|
-
* const formatted = fieldValues.format('name');
|
|
16
|
-
*
|
|
17
|
-
* @template T - The type of the data object for the collection.
|
|
18
|
-
*/
|
|
19
|
-
export class IDbCollectionFieldValues {
|
|
20
|
-
#collection;
|
|
21
|
-
#collectionValues;
|
|
22
|
-
#data;
|
|
23
|
-
/**
|
|
24
|
-
* Create a new IDbCollectionFieldValues instance.
|
|
25
|
-
* @param collection The collection name.
|
|
26
|
-
* @param data The data object.
|
|
27
|
-
* @param collectionValues Optional IDbCollectionValues instance.
|
|
28
|
-
*/
|
|
29
|
-
constructor(collection, data, collectionValues) {
|
|
30
|
-
this.#collection = collection;
|
|
31
|
-
this.#collectionValues = collectionValues ?? new IDbCollectionValues(collection);
|
|
32
|
-
this.#data = data;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Iterate over an array field and return an array of IDbForge objects for each element.
|
|
36
|
-
* @param fieldName The field name.
|
|
37
|
-
* @param data The array data.
|
|
38
|
-
* @returns An array of IDbForge objects.
|
|
39
|
-
* @deprecated use IDbCollectionValues.iterateArrayField instead
|
|
40
|
-
*/
|
|
41
|
-
iterateArrayField(fieldName, data) {
|
|
42
|
-
const fieldInfo = this.#collectionValues.idbBase.parseCollectionFieldName(this.#collection, fieldName);
|
|
43
|
-
if (fieldInfo?.is !== 'array' || !Array.isArray(data)) {
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
46
|
-
return data.map((_, idx) => ({ ...fieldInfo, fieldName: `${String(fieldName)}[${idx}]` }));
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Iterate over an object field and return an array of IDbForge objects for each property.
|
|
50
|
-
* @param fieldName The field name.
|
|
51
|
-
* @param data The object data.
|
|
52
|
-
* @returns An array of IDbForge objects.
|
|
53
|
-
* @deprecated use IDbCollectionValues.iterateObjectField instead
|
|
54
|
-
*/
|
|
55
|
-
iterateObjectField(fieldName, data) {
|
|
56
|
-
const fieldInfo = this.#collectionValues.idbBase.parseCollectionFieldName(this.#collection, fieldName);
|
|
57
|
-
if (fieldInfo?.is !== 'object' || typeof data !== 'object' || data === null) {
|
|
58
|
-
return [];
|
|
59
|
-
}
|
|
60
|
-
return Object.keys(data).map((key) => ({ ...fieldInfo, fieldName: `${String(fieldName)}.${key}` }));
|
|
61
|
-
}
|
|
62
|
-
}
|