@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,43 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FieldBoolean.svelte
|
|
3
|
+
Boolean field atom — checkbox/toggle. Show mode renders read-only state.
|
|
4
|
+
@role field-atom
|
|
5
|
+
@prop {boolean} value - Current value (bindable)
|
|
6
|
+
-->
|
|
7
|
+
<script module lang="ts">
|
|
8
|
+
export interface FieldBooleanProps {
|
|
9
|
+
value?: boolean;
|
|
10
|
+
mode?: 'show' | 'create' | 'update';
|
|
11
|
+
id?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
form?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
onchange?: (next: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
let {
|
|
21
|
+
value = $bindable(),
|
|
22
|
+
mode = 'show',
|
|
23
|
+
id,
|
|
24
|
+
name,
|
|
25
|
+
form,
|
|
26
|
+
disabled = false,
|
|
27
|
+
onchange
|
|
28
|
+
}: FieldBooleanProps = $props();
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#if mode === 'show'}
|
|
32
|
+
<input type="checkbox" checked={!!value} disabled />
|
|
33
|
+
{:else}
|
|
34
|
+
<input
|
|
35
|
+
type="checkbox"
|
|
36
|
+
bind:checked={value}
|
|
37
|
+
{id}
|
|
38
|
+
{name}
|
|
39
|
+
{form}
|
|
40
|
+
{disabled}
|
|
41
|
+
onchange={(e) => onchange?.((e.target as HTMLInputElement).checked)}
|
|
42
|
+
/>
|
|
43
|
+
{/if}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface FieldBooleanProps {
|
|
2
|
+
value?: boolean;
|
|
3
|
+
mode?: 'show' | 'create' | 'update';
|
|
4
|
+
id?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
form?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
onchange?: (next: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const FieldBoolean: import("svelte").Component<FieldBooleanProps, {}, "value">;
|
|
11
|
+
type FieldBoolean = ReturnType<typeof FieldBoolean>;
|
|
12
|
+
export default FieldBoolean;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FieldColor.svelte
|
|
3
|
+
Color field atom — swatch in show mode, color picker in edit.
|
|
4
|
+
@role field-atom
|
|
5
|
+
@prop {string} value - Current value (bindable)
|
|
6
|
+
-->
|
|
7
|
+
<script module lang="ts">
|
|
8
|
+
export interface FieldColorProps {
|
|
9
|
+
value?: string;
|
|
10
|
+
mode?: 'show' | 'create' | 'update';
|
|
11
|
+
id?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
form?: string;
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
let {
|
|
19
|
+
value = $bindable<string | undefined>(),
|
|
20
|
+
mode = 'show',
|
|
21
|
+
id,
|
|
22
|
+
name,
|
|
23
|
+
form
|
|
24
|
+
}: FieldColorProps = $props();
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#if mode === 'show'}
|
|
28
|
+
<span class="color-swatch" style="background:{value}" title={value}></span>
|
|
29
|
+
{:else}
|
|
30
|
+
<input
|
|
31
|
+
type="color"
|
|
32
|
+
bind:value
|
|
33
|
+
{id}
|
|
34
|
+
{name}
|
|
35
|
+
{form}
|
|
36
|
+
/>
|
|
37
|
+
{/if}
|
|
38
|
+
|
|
39
|
+
<style>
|
|
40
|
+
.color-swatch {
|
|
41
|
+
display: inline-block;
|
|
42
|
+
width: var(--icon-size-sm);
|
|
43
|
+
height: var(--icon-size-sm);
|
|
44
|
+
border-radius: var(--radius-xs);
|
|
45
|
+
border: var(--border-width) solid var(--color-border);
|
|
46
|
+
vertical-align: middle;
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface FieldColorProps {
|
|
2
|
+
value?: string;
|
|
3
|
+
mode?: 'show' | 'create' | 'update';
|
|
4
|
+
id?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
form?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const FieldColor: import("svelte").Component<FieldColorProps, {}, "value">;
|
|
9
|
+
type FieldColor = ReturnType<typeof FieldColor>;
|
|
10
|
+
export default FieldColor;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FieldCurrency.svelte
|
|
3
|
+
Currency field atom — formatted display in show mode, formatted input in edit.
|
|
4
|
+
@role field-atom
|
|
5
|
+
@prop {number|string} value - Current value (bindable)
|
|
6
|
+
@prop {string} [display] - Pre-formatted display string (from scheme)
|
|
7
|
+
-->
|
|
8
|
+
<script module lang="ts">
|
|
9
|
+
export interface FieldCurrencyProps {
|
|
10
|
+
value?: number | string;
|
|
11
|
+
display?: string;
|
|
12
|
+
mode?: 'show' | 'create' | 'update';
|
|
13
|
+
error?: string | null;
|
|
14
|
+
currencySymbol?: string;
|
|
15
|
+
decimalPlaces?: number;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
id?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
form?: string;
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { untrack } from 'svelte';
|
|
25
|
+
let {
|
|
26
|
+
value = $bindable<number | string | undefined>(),
|
|
27
|
+
display = undefined as string | undefined,
|
|
28
|
+
mode = 'show',
|
|
29
|
+
error = null as string | null,
|
|
30
|
+
currencySymbol = '$',
|
|
31
|
+
decimalPlaces = 2,
|
|
32
|
+
disabled = false,
|
|
33
|
+
id = undefined as string | undefined,
|
|
34
|
+
name = undefined as string | undefined,
|
|
35
|
+
form = undefined as string | undefined
|
|
36
|
+
}: FieldCurrencyProps = $props();
|
|
37
|
+
|
|
38
|
+
let inputValue = $state<string>('');
|
|
39
|
+
|
|
40
|
+
$effect(() => {
|
|
41
|
+
const currentValue = value;
|
|
42
|
+
if (typeof currentValue === 'number') {
|
|
43
|
+
untrack(() => { inputValue = currentValue.toFixed(decimalPlaces); });
|
|
44
|
+
} else {
|
|
45
|
+
untrack(() => { inputValue = String(currentValue ?? ''); });
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
function formatValue(val: string): string {
|
|
50
|
+
const numeric = val.replace(/[^0-9.]/g, '');
|
|
51
|
+
const parts = numeric.split('.');
|
|
52
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
53
|
+
return parts.join('.');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function handleChange(event: Event): void {
|
|
57
|
+
const input = event.target as HTMLInputElement;
|
|
58
|
+
const rawValue = input.value.replace(/,/g, '');
|
|
59
|
+
|
|
60
|
+
inputValue = formatValue(rawValue);
|
|
61
|
+
|
|
62
|
+
if (rawValue === '') {
|
|
63
|
+
value = '';
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const numValue = parseFloat(rawValue);
|
|
68
|
+
if (!isNaN(numValue)) value = numValue;
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
{#if mode === 'show'}
|
|
73
|
+
<span class="field-value">{display ?? `${currencySymbol}${value ?? ''}`}</span>
|
|
74
|
+
{:else}
|
|
75
|
+
<div class="field-currency" class:has-error={error}>
|
|
76
|
+
<div class="input-wrapper">
|
|
77
|
+
<span class="currency-symbol">{currencySymbol}</span>
|
|
78
|
+
<input
|
|
79
|
+
type="text"
|
|
80
|
+
bind:value={inputValue}
|
|
81
|
+
oninput={handleChange}
|
|
82
|
+
{disabled}
|
|
83
|
+
{id}
|
|
84
|
+
{name}
|
|
85
|
+
{form}
|
|
86
|
+
placeholder="0.00"
|
|
87
|
+
class="currency-input"
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
{#if error}
|
|
91
|
+
<span class="error-message">{error}</span>
|
|
92
|
+
{/if}
|
|
93
|
+
</div>
|
|
94
|
+
{/if}
|
|
95
|
+
|
|
96
|
+
<style>
|
|
97
|
+
.field-currency { display: flex; flex-direction: column; gap: var(--gutter-xs); width: 100%; }
|
|
98
|
+
.input-wrapper { display: flex; align-items: center; min-height: var(--control-height); border: var(--focus-ring-width) solid var(--color-border); border-radius: var(--radius-sm); padding: var(--pad-xs) var(--pad-sm); background: var(--color-surface-raised); }
|
|
99
|
+
.input-wrapper:focus-within { border-color: var(--color-primary); box-shadow: none; }
|
|
100
|
+
.field-currency.has-error .input-wrapper { border-color: var(--color-critical); }
|
|
101
|
+
.currency-symbol { color: var(--color-text-muted); margin-right: var(--marg-sm); font-weight: var(--font-medium); }
|
|
102
|
+
.currency-input { border: none; outline: none; flex: 1; font-size: var(--text-sm); text-align: right; }
|
|
103
|
+
.error-message { color: var(--color-critical); font-size: var(--text-xs); }
|
|
104
|
+
input:disabled { background: var(--color-surface-alt); cursor: not-allowed; }
|
|
105
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface FieldCurrencyProps {
|
|
2
|
+
value?: number | string;
|
|
3
|
+
display?: string;
|
|
4
|
+
mode?: 'show' | 'create' | 'update';
|
|
5
|
+
error?: string | null;
|
|
6
|
+
currencySymbol?: string;
|
|
7
|
+
decimalPlaces?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
id?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
form?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const FieldCurrency: import("svelte").Component<FieldCurrencyProps, {}, "value">;
|
|
14
|
+
type FieldCurrency = ReturnType<typeof FieldCurrency>;
|
|
15
|
+
export default FieldCurrency;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FieldEmail.svelte
|
|
3
|
+
Email field atom. Show mode renders a mailto link.
|
|
4
|
+
@role field-atom
|
|
5
|
+
@prop {string} value - Current value (bindable)
|
|
6
|
+
@prop {string} [error] - Error message
|
|
7
|
+
-->
|
|
8
|
+
<script module lang="ts">
|
|
9
|
+
export interface FieldEmailProps {
|
|
10
|
+
value?: string;
|
|
11
|
+
mode?: 'show' | 'create' | 'update';
|
|
12
|
+
error?: string | null;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
id?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
form?: string;
|
|
18
|
+
oninput?: (e: Event) => void;
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script lang="ts">
|
|
23
|
+
let {
|
|
24
|
+
value = $bindable(),
|
|
25
|
+
mode = 'show',
|
|
26
|
+
error = null as string | null,
|
|
27
|
+
required = false,
|
|
28
|
+
disabled = false,
|
|
29
|
+
id = undefined as string | undefined,
|
|
30
|
+
name = undefined as string | undefined,
|
|
31
|
+
form = undefined as string | undefined,
|
|
32
|
+
oninput = undefined as ((e: Event) => void) | undefined
|
|
33
|
+
}: FieldEmailProps = $props();
|
|
34
|
+
|
|
35
|
+
function validateEmail(email: string): boolean {
|
|
36
|
+
if (!email && !required) return true;
|
|
37
|
+
if (!email && required) return false;
|
|
38
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
39
|
+
return emailRegex.test(email);
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
{#if mode === 'show'}
|
|
44
|
+
{#if value}
|
|
45
|
+
<a class="field-email-link" href={`mailto:${value}`}>{value}</a>
|
|
46
|
+
{:else}
|
|
47
|
+
<span class="field-empty">—</span>
|
|
48
|
+
{/if}
|
|
49
|
+
{:else}
|
|
50
|
+
<div class="field-email" class:has-error={error}>
|
|
51
|
+
<input
|
|
52
|
+
type="email"
|
|
53
|
+
bind:value
|
|
54
|
+
{oninput}
|
|
55
|
+
{disabled}
|
|
56
|
+
{required}
|
|
57
|
+
{id}
|
|
58
|
+
{name}
|
|
59
|
+
{form}
|
|
60
|
+
placeholder="email@example.com"
|
|
61
|
+
class="email-input"
|
|
62
|
+
/>
|
|
63
|
+
{#if error}
|
|
64
|
+
<span class="error-message">{error}</span>
|
|
65
|
+
{/if}
|
|
66
|
+
</div>
|
|
67
|
+
{/if}
|
|
68
|
+
|
|
69
|
+
<style>
|
|
70
|
+
.field-email { display: flex; flex-direction: column; gap: var(--gutter-xs); width: 100%; }
|
|
71
|
+
.email-input { width: 100%; padding: var(--pad-xs) var(--pad-sm); border: var(--focus-ring-width) solid var(--color-border); border-radius: var(--radius-sm); font-size: var(--text-sm); }
|
|
72
|
+
.email-input:focus { border-color: var(--color-primary); outline: none; box-shadow: none; }
|
|
73
|
+
.field-email.has-error .email-input { border-color: var(--color-critical); }
|
|
74
|
+
.error-message { color: var(--color-critical); font-size: var(--text-xs); }
|
|
75
|
+
input:disabled { background: var(--color-surface-alt); cursor: not-allowed; }
|
|
76
|
+
.field-empty { color: var(--color-text-muted); }
|
|
77
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FieldEmailProps {
|
|
2
|
+
value?: string;
|
|
3
|
+
mode?: 'show' | 'create' | 'update';
|
|
4
|
+
error?: string | null;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
form?: string;
|
|
10
|
+
oninput?: (e: Event) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const FieldEmail: import("svelte").Component<FieldEmailProps, {}, "value">;
|
|
13
|
+
type FieldEmail = ReturnType<typeof FieldEmail>;
|
|
14
|
+
export default FieldEmail;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FieldIcon.svelte
|
|
3
|
+
Icon field atom — renders icon glyph in show mode, icon picker in edit.
|
|
4
|
+
@role field-atom
|
|
5
|
+
@prop {string} value - Current value (bindable, iconify name)
|
|
6
|
+
@prop {'xs'|'sm'|'md'|'lg'} [size] - Glyph size preset (maps to --icon-size-* tokens). Default 'sm'.
|
|
7
|
+
-->
|
|
8
|
+
<script module lang="ts">
|
|
9
|
+
export interface FieldIconProps {
|
|
10
|
+
value?: string;
|
|
11
|
+
mode?: 'show' | 'create' | 'update';
|
|
12
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
13
|
+
id?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
form?: string;
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import Icon from '@iconify/svelte';
|
|
21
|
+
|
|
22
|
+
let {
|
|
23
|
+
value = $bindable<string | undefined>(),
|
|
24
|
+
mode = 'show',
|
|
25
|
+
size = 'md',
|
|
26
|
+
id,
|
|
27
|
+
name,
|
|
28
|
+
form
|
|
29
|
+
}: FieldIconProps = $props();
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
{#if mode === 'show'}
|
|
33
|
+
{#if value}
|
|
34
|
+
<Icon icon={value.includes(':') ? value : 'ph:' + value} class="icon-field icon-size-{size}" />
|
|
35
|
+
{:else}
|
|
36
|
+
<span class="icon-empty">—</span>
|
|
37
|
+
{/if}
|
|
38
|
+
{:else}
|
|
39
|
+
<div class="icon-edit">
|
|
40
|
+
{#if value}
|
|
41
|
+
<Icon icon={value.includes(':') ? value : 'ph:' + value} class="icon-preview icon-size-{size}" />
|
|
42
|
+
{/if}
|
|
43
|
+
<input
|
|
44
|
+
type="text"
|
|
45
|
+
bind:value
|
|
46
|
+
placeholder="ex: home"
|
|
47
|
+
{id}
|
|
48
|
+
{name}
|
|
49
|
+
{form}
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
{/if}
|
|
53
|
+
|
|
54
|
+
<style>
|
|
55
|
+
@layer components {
|
|
56
|
+
.icon-edit {
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: var(--gap-xs);
|
|
60
|
+
}
|
|
61
|
+
.icon-edit input {
|
|
62
|
+
flex: 1;
|
|
63
|
+
}
|
|
64
|
+
/* Iconify <Icon> scales to font-size (default 1em). Size presets mirror
|
|
65
|
+
the inputSize t-shirt taxonomy and resolve to css-base --icon-size-* tokens. */
|
|
66
|
+
:global(.icon-size-xs) { font-size: var(--icon-size-xs); }
|
|
67
|
+
:global(.icon-size-sm) { font-size: var(--icon-size-sm); }
|
|
68
|
+
:global(.icon-size-md) { font-size: var(--icon-size-md); }
|
|
69
|
+
:global(.icon-size-lg) { font-size: var(--icon-size-lg); }
|
|
70
|
+
:global(.icon-field),
|
|
71
|
+
:global(.icon-preview) { flex-shrink: 0; }
|
|
72
|
+
}
|
|
73
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface FieldIconProps {
|
|
2
|
+
value?: string;
|
|
3
|
+
mode?: 'show' | 'create' | 'update';
|
|
4
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
form?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const FieldIcon: import("svelte").Component<FieldIconProps, {}, "value">;
|
|
10
|
+
type FieldIcon = ReturnType<typeof FieldIcon>;
|
|
11
|
+
export default FieldIcon;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FieldSelect.svelte
|
|
3
|
+
FK-aware select field atom. Show mode renders the resolved FK label
|
|
4
|
+
(passed via `display`); edit mode queries machine store for options.
|
|
5
|
+
@role field-atom
|
|
6
|
+
@prop {unknown} value - Current FK value (bindable)
|
|
7
|
+
@prop {string} [display] - Resolved FK label for show mode
|
|
8
|
+
@prop {string} collection - Target collection name (from fk-collection.field)
|
|
9
|
+
@prop {string} [targetField] - Target field written as option value. Defaults to scheme index.
|
|
10
|
+
-->
|
|
11
|
+
<script module lang="ts">
|
|
12
|
+
export interface FieldSelectProps {
|
|
13
|
+
value?: unknown;
|
|
14
|
+
display?: string;
|
|
15
|
+
mode?: 'show' | 'create' | 'update';
|
|
16
|
+
collection: string;
|
|
17
|
+
targetField?: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
form?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
multiple?: boolean;
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import { machine } from '../../../main/machine.js';
|
|
28
|
+
|
|
29
|
+
let {
|
|
30
|
+
value = $bindable(undefined),
|
|
31
|
+
display = undefined as string | undefined,
|
|
32
|
+
mode = 'show',
|
|
33
|
+
collection,
|
|
34
|
+
targetField,
|
|
35
|
+
id,
|
|
36
|
+
name,
|
|
37
|
+
form,
|
|
38
|
+
disabled = false,
|
|
39
|
+
multiple = false
|
|
40
|
+
}: FieldSelectProps = $props();
|
|
41
|
+
|
|
42
|
+
const scheme = $derived(machine.logic.collection(collection));
|
|
43
|
+
const indexField = $derived(targetField ?? scheme?.index ?? 'id');
|
|
44
|
+
const store = $derived(machine.store(collection));
|
|
45
|
+
const items = $derived(store.records ?? []);
|
|
46
|
+
|
|
47
|
+
function getLabel(item: Record<string, unknown>): string {
|
|
48
|
+
return scheme?.collectionValues.presentation(item) || String(item[indexField] ?? '—');
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
{#if mode === 'show'}
|
|
53
|
+
<span class="field-value">{display ?? '—'}</span>
|
|
54
|
+
{:else if multiple}
|
|
55
|
+
<select multiple bind:value={value as string[]} {id} {name} {form} {disabled}>
|
|
56
|
+
{#each items as item (item[indexField])}
|
|
57
|
+
<option value={item[indexField]}>{getLabel(item)}</option>
|
|
58
|
+
{/each}
|
|
59
|
+
</select>
|
|
60
|
+
{:else}
|
|
61
|
+
<select bind:value {id} {name} {form} {disabled}>
|
|
62
|
+
<option value={undefined}>—</option>
|
|
63
|
+
{#each items as item (item[indexField])}
|
|
64
|
+
<option value={item[indexField]}>{getLabel(item)}</option>
|
|
65
|
+
{/each}
|
|
66
|
+
</select>
|
|
67
|
+
{/if}
|
|
68
|
+
|
|
69
|
+
<style>
|
|
70
|
+
select { width: 100%; }
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface FieldSelectProps {
|
|
2
|
+
value?: unknown;
|
|
3
|
+
display?: string;
|
|
4
|
+
mode?: 'show' | 'create' | 'update';
|
|
5
|
+
collection: string;
|
|
6
|
+
targetField?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
form?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
multiple?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const FieldSelect: import("svelte").Component<FieldSelectProps, {}, "value">;
|
|
14
|
+
type FieldSelect = ReturnType<typeof FieldSelect>;
|
|
15
|
+
export default FieldSelect;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FieldText.svelte
|
|
3
|
+
Generic field atom — text/number/date/datetime/time/password/url/phone.
|
|
4
|
+
Handles both show (formatted display) and edit (typed input) via `mode`.
|
|
5
|
+
@role field-atom
|
|
6
|
+
@prop {unknown} value - Raw value (bindable)
|
|
7
|
+
@prop {string} [display] - Canonical formatted string (from scheme) for show mode
|
|
8
|
+
@prop {string} [type] - HTML input type for edit mode
|
|
9
|
+
-->
|
|
10
|
+
<script module lang="ts">
|
|
11
|
+
export interface FieldTextProps {
|
|
12
|
+
value?: unknown;
|
|
13
|
+
display?: string;
|
|
14
|
+
mode?: 'show' | 'create' | 'update';
|
|
15
|
+
type?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
form?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
let {
|
|
25
|
+
value = $bindable(),
|
|
26
|
+
display = undefined as string | undefined,
|
|
27
|
+
mode = 'show',
|
|
28
|
+
type = 'text',
|
|
29
|
+
id,
|
|
30
|
+
name,
|
|
31
|
+
form,
|
|
32
|
+
disabled = false
|
|
33
|
+
}: FieldTextProps = $props();
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
{#if mode === 'show'}
|
|
37
|
+
<span class="field-value">{display ?? (value ?? '')}</span>
|
|
38
|
+
{:else}
|
|
39
|
+
<input
|
|
40
|
+
{type}
|
|
41
|
+
bind:value
|
|
42
|
+
{id}
|
|
43
|
+
{name}
|
|
44
|
+
{form}
|
|
45
|
+
{disabled}
|
|
46
|
+
/>
|
|
47
|
+
{/if}
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
.field-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
51
|
+
input { width: 100%; }
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface FieldTextProps {
|
|
2
|
+
value?: unknown;
|
|
3
|
+
display?: string;
|
|
4
|
+
mode?: 'show' | 'create' | 'update';
|
|
5
|
+
type?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
form?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const FieldText: import("svelte").Component<FieldTextProps, {}, "value">;
|
|
12
|
+
type FieldText = ReturnType<typeof FieldText>;
|
|
13
|
+
export default FieldText;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FieldTextarea.svelte
|
|
3
|
+
Long-text field atom. Show mode renders wrapped text.
|
|
4
|
+
@role field-atom
|
|
5
|
+
@prop {string} value - Current value (bindable)
|
|
6
|
+
@prop {string} [display] - Pre-formatted display string (from scheme)
|
|
7
|
+
-->
|
|
8
|
+
<script module lang="ts">
|
|
9
|
+
export interface FieldTextareaProps {
|
|
10
|
+
value?: string;
|
|
11
|
+
display?: string;
|
|
12
|
+
mode?: 'show' | 'create' | 'update';
|
|
13
|
+
rows?: number;
|
|
14
|
+
id?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
form?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
let {
|
|
23
|
+
value = $bindable(),
|
|
24
|
+
display = undefined as string | undefined,
|
|
25
|
+
mode = 'show',
|
|
26
|
+
rows = 4,
|
|
27
|
+
id,
|
|
28
|
+
name,
|
|
29
|
+
form,
|
|
30
|
+
disabled = false
|
|
31
|
+
}: FieldTextareaProps = $props();
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
{#if mode === 'show'}
|
|
35
|
+
<span class="field-value field-value-area">{display ?? (value ?? '')}</span>
|
|
36
|
+
{:else}
|
|
37
|
+
<textarea
|
|
38
|
+
bind:value
|
|
39
|
+
{rows}
|
|
40
|
+
{id}
|
|
41
|
+
{name}
|
|
42
|
+
{form}
|
|
43
|
+
{disabled}
|
|
44
|
+
></textarea>
|
|
45
|
+
{/if}
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.field-value-area { white-space: pre-wrap; }
|
|
49
|
+
textarea { width: 100%; max-width: 100%; resize: vertical; }
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface FieldTextareaProps {
|
|
2
|
+
value?: string;
|
|
3
|
+
display?: string;
|
|
4
|
+
mode?: 'show' | 'create' | 'update';
|
|
5
|
+
rows?: number;
|
|
6
|
+
id?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
form?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const FieldTextarea: import("svelte").Component<FieldTextareaProps, {}, "value">;
|
|
12
|
+
type FieldTextarea = ReturnType<typeof FieldTextarea>;
|
|
13
|
+
export default FieldTextarea;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as FieldText } from './FieldText.svelte';
|
|
2
|
+
export { default as FieldBoolean } from './FieldBoolean.svelte';
|
|
3
|
+
export { default as FieldEmail } from './FieldEmail.svelte';
|
|
4
|
+
export { default as FieldCurrency } from './FieldCurrency.svelte';
|
|
5
|
+
export { default as FieldTextarea } from './FieldTextarea.svelte';
|
|
6
|
+
export { default as FieldColor } from './FieldColor.svelte';
|
|
7
|
+
export { default as FieldIcon } from './FieldIcon.svelte';
|
|
8
|
+
export { default as FieldSelect } from './FieldSelect.svelte';
|
|
9
|
+
export { default as FieldAiPrompt } from './FieldAiPrompt.svelte';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Field atom components barrel export
|
|
2
|
+
export { default as FieldText } from './FieldText.svelte';
|
|
3
|
+
export { default as FieldBoolean } from './FieldBoolean.svelte';
|
|
4
|
+
export { default as FieldEmail } from './FieldEmail.svelte';
|
|
5
|
+
export { default as FieldCurrency } from './FieldCurrency.svelte';
|
|
6
|
+
export { default as FieldTextarea } from './FieldTextarea.svelte';
|
|
7
|
+
export { default as FieldColor } from './FieldColor.svelte';
|
|
8
|
+
export { default as FieldIcon } from './FieldIcon.svelte';
|
|
9
|
+
export { default as FieldSelect } from './FieldSelect.svelte';
|
|
10
|
+
export { default as FieldAiPrompt } from './FieldAiPrompt.svelte';
|