@cratis/scene.blueprint.components 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +61 -0
- package/.storybook/preview.tsx +42 -0
- package/BorrowedComponentName.ts +22 -0
- package/ComponentName.ts +27 -0
- package/CompositeName.ts +97 -0
- package/README.md +40 -0
- package/componentsBlueprint.ts +72 -0
- package/componentsBlueprintComponents.ts +23 -0
- package/dist/cjs/BorrowedComponentName.js +25 -0
- package/dist/cjs/BorrowedComponentName.js.map +1 -0
- package/dist/cjs/ComponentName.js +30 -0
- package/dist/cjs/ComponentName.js.map +1 -0
- package/dist/cjs/CompositeName.js +52 -0
- package/dist/cjs/CompositeName.js.map +1 -0
- package/dist/cjs/componentsBlueprint.js +93 -0
- package/dist/cjs/componentsBlueprint.js.map +1 -0
- package/dist/cjs/componentsBlueprintComponents.js +27 -0
- package/dist/cjs/componentsBlueprintComponents.js.map +1 -0
- package/dist/cjs/gallery/DialogTemplatePreview.js +46 -0
- package/dist/cjs/gallery/DialogTemplatePreview.js.map +1 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js +65 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -0
- package/dist/cjs/gallery/applicationChrome.js +137 -0
- package/dist/cjs/gallery/applicationChrome.js.map +1 -0
- package/dist/cjs/gallery/navigation.js +128 -0
- package/dist/cjs/gallery/navigation.js.map +1 -0
- package/dist/cjs/gallery/previewProfile.js +87 -0
- package/dist/cjs/gallery/previewProfile.js.map +1 -0
- package/dist/cjs/gallery/screens.js +80 -0
- package/dist/cjs/gallery/screens.js.map +1 -0
- package/dist/cjs/header/ArcPageHeader.js +65 -0
- package/dist/cjs/header/ArcPageHeader.js.map +1 -0
- package/dist/cjs/header/deriveArcHeading.js +51 -0
- package/dist/cjs/header/deriveArcHeading.js.map +1 -0
- package/dist/cjs/header/humanizeBindingName.js +36 -0
- package/dist/cjs/header/humanizeBindingName.js.map +1 -0
- package/dist/cjs/index.js +119 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/packageName.js +15 -0
- package/dist/cjs/packageName.js.map +1 -0
- package/dist/cjs/templates/SampleBindingName.js +39 -0
- package/dist/cjs/templates/SampleBindingName.js.map +1 -0
- package/dist/cjs/templates/commandTemplates.js +82 -0
- package/dist/cjs/templates/commandTemplates.js.map +1 -0
- package/dist/cjs/templates/dataElements.js +131 -0
- package/dist/cjs/templates/dataElements.js.map +1 -0
- package/dist/cjs/templates/dialogElements.js +69 -0
- package/dist/cjs/templates/dialogElements.js.map +1 -0
- package/dist/cjs/templates/dialogTemplates.js +118 -0
- package/dist/cjs/templates/dialogTemplates.js.map +1 -0
- package/dist/cjs/templates/editorElements.js +81 -0
- package/dist/cjs/templates/editorElements.js.map +1 -0
- package/dist/cjs/templates/editorTemplates.js +172 -0
- package/dist/cjs/templates/editorTemplates.js.map +1 -0
- package/dist/cjs/templates/elements.js +101 -0
- package/dist/cjs/templates/elements.js.map +1 -0
- package/dist/cjs/templates/formElements.js +77 -0
- package/dist/cjs/templates/formElements.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +187 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/nesting.js +150 -0
- package/dist/cjs/templates/nesting.js.map +1 -0
- package/dist/cjs/templates/sampleData.js +141 -0
- package/dist/cjs/templates/sampleData.js.map +1 -0
- package/dist/cjs/templates/screenTemplates.js +41 -0
- package/dist/cjs/templates/screenTemplates.js.map +1 -0
- package/dist/cjs/templates/workspaceTemplates.js +212 -0
- package/dist/cjs/templates/workspaceTemplates.js.map +1 -0
- package/dist/esm/BorrowedComponentName.d.ts +4 -0
- package/dist/esm/BorrowedComponentName.d.ts.map +1 -0
- package/dist/esm/BorrowedComponentName.js +23 -0
- package/dist/esm/BorrowedComponentName.js.map +1 -0
- package/dist/esm/ComponentName.d.ts +4 -0
- package/dist/esm/ComponentName.d.ts.map +1 -0
- package/dist/esm/ComponentName.js +28 -0
- package/dist/esm/ComponentName.js.map +1 -0
- package/dist/esm/CompositeName.d.ts +28 -0
- package/dist/esm/CompositeName.d.ts.map +1 -0
- package/dist/esm/CompositeName.js +50 -0
- package/dist/esm/CompositeName.js.map +1 -0
- package/dist/esm/componentsBlueprint.d.ts +5 -0
- package/dist/esm/componentsBlueprint.d.ts.map +1 -0
- package/dist/esm/componentsBlueprint.js +90 -0
- package/dist/esm/componentsBlueprint.js.map +1 -0
- package/dist/esm/componentsBlueprintComponents.d.ts +3 -0
- package/dist/esm/componentsBlueprintComponents.d.ts.map +1 -0
- package/dist/esm/componentsBlueprintComponents.js +25 -0
- package/dist/esm/componentsBlueprintComponents.js.map +1 -0
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.d.ts +2 -0
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.d.ts.map +1 -0
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.js +57 -0
- package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.js.map +1 -0
- package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.d.ts +2 -0
- package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.d.ts.map +1 -0
- package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.js +26 -0
- package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.js.map +1 -0
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.d.ts +2 -0
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.d.ts.map +1 -0
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.js +65 -0
- package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.js.map +1 -0
- package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.d.ts +2 -0
- package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.d.ts.map +1 -0
- package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.js +41 -0
- package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.js.map +1 -0
- package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts +2 -0
- package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts.map +1 -0
- package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.js +38 -0
- package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.js.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts +2 -0
- package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js +47 -0
- package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.d.ts +2 -0
- package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.d.ts.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.js +56 -0
- package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.js.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.d.ts +2 -0
- package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.d.ts.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.js +31 -0
- package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.js.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.d.ts +2 -0
- package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.d.ts.map +1 -0
- package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.js +54 -0
- package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.js.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.d.ts +2 -0
- package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.d.ts.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.js +27 -0
- package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.js.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.d.ts +2 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.d.ts.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.js +18 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.js.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.d.ts +2 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.d.ts.map +1 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.js +26 -0
- package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.js.map +1 -0
- package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.d.ts +2 -0
- package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.d.ts.map +1 -0
- package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.js +25 -0
- package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.js.map +1 -0
- package/dist/esm/gallery/ArcPages.stories.d.ts +30 -0
- package/dist/esm/gallery/ArcPages.stories.d.ts.map +1 -0
- package/dist/esm/gallery/ArcPages.stories.js +34 -0
- package/dist/esm/gallery/ArcPages.stories.js.map +1 -0
- package/dist/esm/gallery/Bindings.stories.d.ts +22 -0
- package/dist/esm/gallery/Bindings.stories.d.ts.map +1 -0
- package/dist/esm/gallery/Bindings.stories.js +78 -0
- package/dist/esm/gallery/Bindings.stories.js.map +1 -0
- package/dist/esm/gallery/DialogTemplatePreview.d.ts +7 -0
- package/dist/esm/gallery/DialogTemplatePreview.d.ts.map +1 -0
- package/dist/esm/gallery/DialogTemplatePreview.js +44 -0
- package/dist/esm/gallery/DialogTemplatePreview.js.map +1 -0
- package/dist/esm/gallery/DialogTemplates.stories.d.ts +21 -0
- package/dist/esm/gallery/DialogTemplates.stories.d.ts.map +1 -0
- package/dist/esm/gallery/DialogTemplates.stories.js +23 -0
- package/dist/esm/gallery/DialogTemplates.stories.js.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.d.ts +10 -0
- package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.js +62 -0
- package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -0
- package/dist/esm/gallery/applicationChrome.d.ts +3 -0
- package/dist/esm/gallery/applicationChrome.d.ts.map +1 -0
- package/dist/esm/gallery/applicationChrome.js +135 -0
- package/dist/esm/gallery/applicationChrome.js.map +1 -0
- package/dist/esm/gallery/index.d.ts +7 -0
- package/dist/esm/gallery/index.d.ts.map +1 -0
- package/dist/esm/gallery/index.js +7 -0
- package/dist/esm/gallery/index.js.map +1 -0
- package/dist/esm/gallery/navigation.d.ts +9 -0
- package/dist/esm/gallery/navigation.d.ts.map +1 -0
- package/dist/esm/gallery/navigation.js +121 -0
- package/dist/esm/gallery/navigation.js.map +1 -0
- package/dist/esm/gallery/previewProfile.d.ts +6 -0
- package/dist/esm/gallery/previewProfile.d.ts.map +1 -0
- package/dist/esm/gallery/previewProfile.js +83 -0
- package/dist/esm/gallery/previewProfile.js.map +1 -0
- package/dist/esm/gallery/screens.d.ts +4 -0
- package/dist/esm/gallery/screens.d.ts.map +1 -0
- package/dist/esm/gallery/screens.js +77 -0
- package/dist/esm/gallery/screens.js.map +1 -0
- package/dist/esm/header/ArcHeading.d.ts +9 -0
- package/dist/esm/header/ArcHeading.d.ts.map +1 -0
- package/dist/esm/header/ArcHeading.js +2 -0
- package/dist/esm/header/ArcHeading.js.map +1 -0
- package/dist/esm/header/ArcPageHeader.d.ts +3 -0
- package/dist/esm/header/ArcPageHeader.d.ts.map +1 -0
- package/dist/esm/header/ArcPageHeader.js +63 -0
- package/dist/esm/header/ArcPageHeader.js.map +1 -0
- package/dist/esm/header/deriveArcHeading.d.ts +4 -0
- package/dist/esm/header/deriveArcHeading.d.ts.map +1 -0
- package/dist/esm/header/deriveArcHeading.js +49 -0
- package/dist/esm/header/deriveArcHeading.js.map +1 -0
- package/dist/esm/header/humanizeBindingName.d.ts +2 -0
- package/dist/esm/header/humanizeBindingName.d.ts.map +1 -0
- package/dist/esm/header/humanizeBindingName.js +34 -0
- package/dist/esm/header/humanizeBindingName.js.map +1 -0
- package/dist/esm/header/index.d.ts +5 -0
- package/dist/esm/header/index.d.ts.map +1 -0
- package/dist/esm/header/index.js +5 -0
- package/dist/esm/header/index.js.map +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +30 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/packageName.d.ts +2 -0
- package/dist/esm/packageName.d.ts.map +1 -0
- package/dist/esm/packageName.js +13 -0
- package/dist/esm/packageName.js.map +1 -0
- package/dist/esm/templates/ArcHeaderOptions.d.ts +8 -0
- package/dist/esm/templates/ArcHeaderOptions.d.ts.map +1 -0
- package/dist/esm/templates/ArcHeaderOptions.js +2 -0
- package/dist/esm/templates/ArcHeaderOptions.js.map +1 -0
- package/dist/esm/templates/ColumnDefinition.d.ts +5 -0
- package/dist/esm/templates/ColumnDefinition.d.ts.map +1 -0
- package/dist/esm/templates/ColumnDefinition.js +2 -0
- package/dist/esm/templates/ColumnDefinition.js.map +1 -0
- package/dist/esm/templates/SampleBindingName.d.ts +11 -0
- package/dist/esm/templates/SampleBindingName.d.ts.map +1 -0
- package/dist/esm/templates/SampleBindingName.js +37 -0
- package/dist/esm/templates/SampleBindingName.js.map +1 -0
- package/dist/esm/templates/TableOptions.d.ts +6 -0
- package/dist/esm/templates/TableOptions.d.ts.map +1 -0
- package/dist/esm/templates/TableOptions.js +2 -0
- package/dist/esm/templates/TableOptions.js.map +1 -0
- package/dist/esm/templates/commandTemplates.d.ts +4 -0
- package/dist/esm/templates/commandTemplates.d.ts.map +1 -0
- package/dist/esm/templates/commandTemplates.js +79 -0
- package/dist/esm/templates/commandTemplates.js.map +1 -0
- package/dist/esm/templates/dataElements.d.ts +11 -0
- package/dist/esm/templates/dataElements.d.ts.map +1 -0
- package/dist/esm/templates/dataElements.js +123 -0
- package/dist/esm/templates/dataElements.js.map +1 -0
- package/dist/esm/templates/dialogElements.d.ts +5 -0
- package/dist/esm/templates/dialogElements.d.ts.map +1 -0
- package/dist/esm/templates/dialogElements.js +65 -0
- package/dist/esm/templates/dialogElements.js.map +1 -0
- package/dist/esm/templates/dialogTemplates.d.ts +6 -0
- package/dist/esm/templates/dialogTemplates.d.ts.map +1 -0
- package/dist/esm/templates/dialogTemplates.js +113 -0
- package/dist/esm/templates/dialogTemplates.js.map +1 -0
- package/dist/esm/templates/editorElements.d.ts +11 -0
- package/dist/esm/templates/editorElements.d.ts.map +1 -0
- package/dist/esm/templates/editorElements.js +74 -0
- package/dist/esm/templates/editorElements.js.map +1 -0
- package/dist/esm/templates/editorTemplates.d.ts +5 -0
- package/dist/esm/templates/editorTemplates.d.ts.map +1 -0
- package/dist/esm/templates/editorTemplates.js +168 -0
- package/dist/esm/templates/editorTemplates.js.map +1 -0
- package/dist/esm/templates/elements.d.ts +11 -0
- package/dist/esm/templates/elements.d.ts.map +1 -0
- package/dist/esm/templates/elements.js +92 -0
- package/dist/esm/templates/elements.js.map +1 -0
- package/dist/esm/templates/formElements.d.ts +11 -0
- package/dist/esm/templates/formElements.d.ts.map +1 -0
- package/dist/esm/templates/formElements.js +70 -0
- package/dist/esm/templates/formElements.js.map +1 -0
- package/dist/esm/templates/index.d.ts +18 -0
- package/dist/esm/templates/index.d.ts.map +1 -0
- package/dist/esm/templates/index.js +18 -0
- package/dist/esm/templates/index.js.map +1 -0
- package/dist/esm/templates/listTemplates.d.ts +6 -0
- package/dist/esm/templates/listTemplates.d.ts.map +1 -0
- package/dist/esm/templates/listTemplates.js +182 -0
- package/dist/esm/templates/listTemplates.js.map +1 -0
- package/dist/esm/templates/nesting.d.ts +6 -0
- package/dist/esm/templates/nesting.d.ts.map +1 -0
- package/dist/esm/templates/nesting.js +145 -0
- package/dist/esm/templates/nesting.js.map +1 -0
- package/dist/esm/templates/sampleData.d.ts +10 -0
- package/dist/esm/templates/sampleData.d.ts.map +1 -0
- package/dist/esm/templates/sampleData.js +134 -0
- package/dist/esm/templates/sampleData.js.map +1 -0
- package/dist/esm/templates/screenTemplates.d.ts +4 -0
- package/dist/esm/templates/screenTemplates.d.ts.map +1 -0
- package/dist/esm/templates/screenTemplates.js +38 -0
- package/dist/esm/templates/screenTemplates.js.map +1 -0
- package/dist/esm/templates/workspaceTemplates.d.ts +5 -0
- package/dist/esm/templates/workspaceTemplates.d.ts.map +1 -0
- package/dist/esm/templates/workspaceTemplates.js +208 -0
- package/dist/esm/templates/workspaceTemplates.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/for_ArcPageHeader/when_rendering_a_gallery_screen.tsx +79 -0
- package/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.ts +41 -0
- package/for_componentsBlueprint/when_resolving_its_dependencies.ts +85 -0
- package/for_componentsBlueprint/when_validating_the_bundle.ts +55 -0
- package/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.ts +56 -0
- package/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts +66 -0
- package/for_componentsScreenTemplates/when_following_the_nesting_chain.ts +83 -0
- package/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.ts +51 -0
- package/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.ts +72 -0
- package/for_deriveArcHeading/when_no_binding_is_named.ts +42 -0
- package/for_deriveArcHeading/when_the_binding_is_not_registered.ts +25 -0
- package/for_deriveArcHeading/when_the_binding_is_registered.ts +35 -0
- package/for_humanizeBindingName/when_reading_a_proxy_name.ts +34 -0
- package/gallery/ArcPages.stories.tsx +80 -0
- package/gallery/Bindings.stories.tsx +134 -0
- package/gallery/DialogTemplatePreview.tsx +49 -0
- package/gallery/DialogTemplates.stories.tsx +44 -0
- package/gallery/GalleryScreenPreview.tsx +70 -0
- package/gallery/applicationChrome.ts +108 -0
- package/gallery/index.ts +9 -0
- package/gallery/navigation.ts +63 -0
- package/gallery/previewProfile.ts +68 -0
- package/gallery/screens.ts +75 -0
- package/header/ArcHeading.ts +39 -0
- package/header/ArcPageHeader.tsx +44 -0
- package/header/deriveArcHeading.ts +47 -0
- package/header/humanizeBindingName.ts +36 -0
- package/header/index.ts +7 -0
- package/index.ts +12 -0
- package/package.json +71 -0
- package/packageName.ts +12 -0
- package/templates/ArcHeaderOptions.ts +27 -0
- package/templates/ColumnDefinition.ts +18 -0
- package/templates/SampleBindingName.ts +50 -0
- package/templates/TableOptions.ts +22 -0
- package/templates/commandTemplates.ts +59 -0
- package/templates/dataElements.ts +97 -0
- package/templates/dialogElements.ts +53 -0
- package/templates/dialogTemplates.ts +105 -0
- package/templates/editorElements.ts +69 -0
- package/templates/editorTemplates.ts +129 -0
- package/templates/elements.ts +81 -0
- package/templates/formElements.ts +61 -0
- package/templates/index.ts +20 -0
- package/templates/listTemplates.ts +142 -0
- package/templates/nesting.ts +118 -0
- package/templates/sampleData.ts +81 -0
- package/templates/screenTemplates.ts +35 -0
- package/templates/workspaceTemplates.ts +163 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { externalComponent } from '@cratis/scene.blueprint.default';
|
|
2
|
+
import { BorrowedComponentName } from '../BorrowedComponentName.js';
|
|
3
|
+
import { CompositeName } from '../CompositeName.js';
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* The Arc-bound data elements this blueprint's templates are built from.
|
|
9
|
+
*
|
|
10
|
+
* Each one is a single `ExternalComponent` carrying a query *name* in its property bag, which is the whole
|
|
11
|
+
* contract: `resolveElementBinding` in `@cratis/scene.components` reads that name out at render time and
|
|
12
|
+
* looks it up in the binding registry, and a name nothing is registered under renders as a placeholder
|
|
13
|
+
* naming what it wanted. Nothing here invents a second way to reach a backend, because there is only one
|
|
14
|
+
* and it belongs to the component library.
|
|
15
|
+
*/ /**
|
|
16
|
+
* The columns of a data table, as the `content` slot children the library's tables take.
|
|
17
|
+
*
|
|
18
|
+
* The name is PrimeReact's rather than `Cratis.Components`' - see {@link BorrowedComponentName.Column} for
|
|
19
|
+
* why - and `sortable` is set on every column because a table that performs a real query can sort against
|
|
20
|
+
* the server, and a column that quietly cannot is the more surprising default.
|
|
21
|
+
*/ function columns(id, definitions) {
|
|
22
|
+
return definitions.map((definition)=>externalComponent(`${id}-${definition.field}`, BorrowedComponentName.Column, {
|
|
23
|
+
field: definition.field,
|
|
24
|
+
header: definition.header,
|
|
25
|
+
sortable: true
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A `dataPage` - the library's whole list-screen composite, driven from one query.
|
|
30
|
+
*
|
|
31
|
+
* This is the archetype the package exists for. Reproducing it out of a table, a toolbar and a filter in a
|
|
32
|
+
* screen would be pages of modeling for a worse result, and every one of those pages would then be an
|
|
33
|
+
* application's to maintain. Here it is one element with a name in it.
|
|
34
|
+
*
|
|
35
|
+
* Its own `title` is deliberately empty. Every template in this package opens with an `arcPageHeader`, and
|
|
36
|
+
* that header already states the page's name, its trail and what it is bound to; letting the composite
|
|
37
|
+
* print the same word again directly underneath would be two sources for one fact, and they would
|
|
38
|
+
* disagree the first time either changed.
|
|
39
|
+
*/ function dataPage(id, query, options, definitions) {
|
|
40
|
+
return externalComponent(id, CompositeName.DataPage, {
|
|
41
|
+
query,
|
|
42
|
+
title: '',
|
|
43
|
+
...options
|
|
44
|
+
}, {
|
|
45
|
+
content: columns(`${id}-column`, definitions)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A `dataTable` - the same server-side querying without the page chrome around it.
|
|
50
|
+
*
|
|
51
|
+
* Used where a template already has a header of its own and only needs the rows, which is most places a
|
|
52
|
+
* table appears inside a larger page.
|
|
53
|
+
*/ function dataTable(id, query, options, definitions) {
|
|
54
|
+
return externalComponent(id, CompositeName.DataTable, {
|
|
55
|
+
query,
|
|
56
|
+
...options
|
|
57
|
+
}, {
|
|
58
|
+
content: columns(`${id}-column`, definitions)
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* An `observableDataTable` - the live variant.
|
|
63
|
+
*
|
|
64
|
+
* A separate element rather than a flag, because the difference is in the *proxy* a host registers: an
|
|
65
|
+
* observable query opens a subscription and re-renders when the read model changes, and a plain one does
|
|
66
|
+
* not. A template that names an observable query is stating that its data is live, which is a design
|
|
67
|
+
* decision worth being able to read off the page.
|
|
68
|
+
*/ function observableDataTable(id, query, options, definitions) {
|
|
69
|
+
return externalComponent(id, CompositeName.ObservableDataTable, {
|
|
70
|
+
query,
|
|
71
|
+
...options
|
|
72
|
+
}, {
|
|
73
|
+
content: columns(`${id}-column`, definitions)
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** The columns of the invoice list every list-shaped template in this package shows. */ const invoiceColumns = [
|
|
77
|
+
{
|
|
78
|
+
field: 'number',
|
|
79
|
+
header: 'Number'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
field: 'customer',
|
|
83
|
+
header: 'Customer'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
field: 'issued',
|
|
87
|
+
header: 'Issued'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
field: 'amount',
|
|
91
|
+
header: 'Amount'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
field: 'status',
|
|
95
|
+
header: 'Status'
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
/** The columns of the adjustment list, for the templates that show one. */ const adjustmentColumns = [
|
|
99
|
+
{
|
|
100
|
+
field: 'recorded',
|
|
101
|
+
header: 'Recorded'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
field: 'reason',
|
|
105
|
+
header: 'Reason'
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
field: 'amount',
|
|
109
|
+
header: 'Amount'
|
|
110
|
+
}
|
|
111
|
+
];
|
|
112
|
+
/** The table options an invoice list uses, so eight templates cannot disagree about the empty message. */ const invoiceTableOptions = {
|
|
113
|
+
emptyMessage: 'No invoices yet',
|
|
114
|
+
dataKey: 'invoiceId',
|
|
115
|
+
globalFilterFields: [
|
|
116
|
+
'number',
|
|
117
|
+
'customer',
|
|
118
|
+
'status'
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export { adjustmentColumns, columns, dataPage, dataTable, invoiceColumns, invoiceTableOptions, observableDataTable };
|
|
123
|
+
//# sourceMappingURL=dataElements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataElements.js","sources":["../../../templates/dataElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { externalComponent } from '@cratis/scene.blueprint.default';\nimport { BorrowedComponentName } from '../BorrowedComponentName';\nimport { CompositeName } from '../CompositeName';\nimport { ColumnDefinition } from './ColumnDefinition';\nimport { TableOptions } from './TableOptions';\n\n/**\n * The Arc-bound data elements this blueprint's templates are built from.\n *\n * Each one is a single `ExternalComponent` carrying a query *name* in its property bag, which is the whole\n * contract: `resolveElementBinding` in `@cratis/scene.components` reads that name out at render time and\n * looks it up in the binding registry, and a name nothing is registered under renders as a placeholder\n * naming what it wanted. Nothing here invents a second way to reach a backend, because there is only one\n * and it belongs to the component library.\n */\n\n/**\n * The columns of a data table, as the `content` slot children the library's tables take.\n *\n * The name is PrimeReact's rather than `Cratis.Components`' - see {@link BorrowedComponentName.Column} for\n * why - and `sortable` is set on every column because a table that performs a real query can sort against\n * the server, and a column that quietly cannot is the more surprising default.\n */\nexport function columns(id: string, definitions: ColumnDefinition[]): SceneElement[] {\n return definitions.map(definition =>\n externalComponent(`${id}-${definition.field}`, BorrowedComponentName.Column, {\n field: definition.field,\n header: definition.header,\n sortable: true,\n }),\n );\n}\n\n/**\n * A `dataPage` - the library's whole list-screen composite, driven from one query.\n *\n * This is the archetype the package exists for. Reproducing it out of a table, a toolbar and a filter in a\n * screen would be pages of modeling for a worse result, and every one of those pages would then be an\n * application's to maintain. Here it is one element with a name in it.\n *\n * Its own `title` is deliberately empty. Every template in this package opens with an `arcPageHeader`, and\n * that header already states the page's name, its trail and what it is bound to; letting the composite\n * print the same word again directly underneath would be two sources for one fact, and they would\n * disagree the first time either changed.\n */\nexport function dataPage(id: string, query: string, options: TableOptions, definitions: ColumnDefinition[]): SceneElement {\n return externalComponent(id, CompositeName.DataPage, { query, title: '', ...options }, { content: columns(`${id}-column`, definitions) });\n}\n\n/**\n * A `dataTable` - the same server-side querying without the page chrome around it.\n *\n * Used where a template already has a header of its own and only needs the rows, which is most places a\n * table appears inside a larger page.\n */\nexport function dataTable(id: string, query: string, options: TableOptions, definitions: ColumnDefinition[]): SceneElement {\n return externalComponent(id, CompositeName.DataTable, { query, ...options }, { content: columns(`${id}-column`, definitions) });\n}\n\n/**\n * An `observableDataTable` - the live variant.\n *\n * A separate element rather than a flag, because the difference is in the *proxy* a host registers: an\n * observable query opens a subscription and re-renders when the read model changes, and a plain one does\n * not. A template that names an observable query is stating that its data is live, which is a design\n * decision worth being able to read off the page.\n */\nexport function observableDataTable(id: string, query: string, options: TableOptions, definitions: ColumnDefinition[]): SceneElement {\n return externalComponent(id, CompositeName.ObservableDataTable, { query, ...options }, { content: columns(`${id}-column`, definitions) });\n}\n\n/** The columns of the invoice list every list-shaped template in this package shows. */\nexport const invoiceColumns: ColumnDefinition[] = [\n { field: 'number', header: 'Number' },\n { field: 'customer', header: 'Customer' },\n { field: 'issued', header: 'Issued' },\n { field: 'amount', header: 'Amount' },\n { field: 'status', header: 'Status' },\n];\n\n/** The columns of the adjustment list, for the templates that show one. */\nexport const adjustmentColumns: ColumnDefinition[] = [\n { field: 'recorded', header: 'Recorded' },\n { field: 'reason', header: 'Reason' },\n { field: 'amount', header: 'Amount' },\n];\n\n/** The table options an invoice list uses, so eight templates cannot disagree about the empty message. */\nexport const invoiceTableOptions: TableOptions = {\n emptyMessage: 'No invoices yet',\n dataKey: 'invoiceId',\n globalFilterFields: ['number', 'customer', 'status'],\n};\n"],"names":["columns","id","definitions","map","definition","externalComponent","field","BorrowedComponentName","Column","header","sortable","dataPage","query","options","CompositeName","DataPage","title","content","dataTable","DataTable","observableDataTable","ObservableDataTable","invoiceColumns","adjustmentColumns","invoiceTableOptions","emptyMessage","dataKey","globalFilterFields"],"mappings":";;;;AAAA;AACA;AASA;;;;;;;;;;;;;;AAgBC,IACM,SAASA,OAAAA,CAAQC,EAAU,EAAEC,WAA+B,EAAA;AAC/D,IAAA,OAAOA,YAAYC,GAAG,CAACC,CAAAA,UAAAA,GACnBC,kBAAkB,CAAA,EAAGJ,EAAAA,CAAG,CAAC,EAAEG,WAAWE,KAAK,CAAA,CAAE,EAAEC,qBAAAA,CAAsBC,MAAM,EAAE;AACzEF,YAAAA,KAAAA,EAAOF,WAAWE,KAAK;AACvBG,YAAAA,MAAAA,EAAQL,WAAWK,MAAM;YACzBC,QAAAA,EAAU;AACd,SAAA,CAAA,CAAA;AAER;AAEA;;;;;;;;;;;IAYO,SAASC,QAAAA,CAASV,EAAU,EAAEW,KAAa,EAAEC,OAAqB,EAAEX,WAA+B,EAAA;AACtG,IAAA,OAAOG,iBAAAA,CAAkBJ,EAAAA,EAAIa,aAAAA,CAAcC,QAAQ,EAAE;AAAEH,QAAAA,KAAAA;QAAOI,KAAAA,EAAO,EAAA;AAAI,QAAA,GAAGH;KAAQ,EAAG;AAAEI,QAAAA,OAAAA,EAASjB,OAAAA,CAAQ,CAAA,EAAGC,EAAAA,CAAG,OAAO,CAAC,EAAEC,WAAAA;AAAa,KAAA,CAAA;AAC3I;AAEA;;;;;IAMO,SAASgB,SAAAA,CAAUjB,EAAU,EAAEW,KAAa,EAAEC,OAAqB,EAAEX,WAA+B,EAAA;AACvG,IAAA,OAAOG,iBAAAA,CAAkBJ,EAAAA,EAAIa,aAAAA,CAAcK,SAAS,EAAE;AAAEP,QAAAA,KAAAA;AAAO,QAAA,GAAGC;KAAQ,EAAG;AAAEI,QAAAA,OAAAA,EAASjB,OAAAA,CAAQ,CAAA,EAAGC,EAAAA,CAAG,OAAO,CAAC,EAAEC,WAAAA;AAAa,KAAA,CAAA;AACjI;AAEA;;;;;;;IAQO,SAASkB,mBAAAA,CAAoBnB,EAAU,EAAEW,KAAa,EAAEC,OAAqB,EAAEX,WAA+B,EAAA;AACjH,IAAA,OAAOG,iBAAAA,CAAkBJ,EAAAA,EAAIa,aAAAA,CAAcO,mBAAmB,EAAE;AAAET,QAAAA,KAAAA;AAAO,QAAA,GAAGC;KAAQ,EAAG;AAAEI,QAAAA,OAAAA,EAASjB,OAAAA,CAAQ,CAAA,EAAGC,EAAAA,CAAG,OAAO,CAAC,EAAEC,WAAAA;AAAa,KAAA,CAAA;AAC3I;AAEA,yFACO,MAAMoB,cAAAA,GAAqC;AAC9C,IAAA;QAAEhB,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,UAAA;QAAYG,MAAAA,EAAQ;AAAW,KAAA;AACxC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS;;AAGxC,4EACO,MAAMc,iBAAAA,GAAwC;AACjD,IAAA;QAAEjB,KAAAA,EAAO,UAAA;QAAYG,MAAAA,EAAQ;AAAW,KAAA;AACxC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS;;AAGxC,2GACO,MAAMe,mBAAAA,GAAoC;IAC7CC,YAAAA,EAAc,iBAAA;IACdC,OAAAA,EAAS,WAAA;IACTC,kBAAAA,EAAoB;AAAC,QAAA,QAAA;AAAU,QAAA,UAAA;AAAY,QAAA;AAAS;AACxD;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SceneElement } from '@cratis/scene.model';
|
|
2
|
+
export declare function dialog(id: string, title: string, okLabel: string, cancelLabel: string, content: SceneElement[]): SceneElement;
|
|
3
|
+
export declare function commandDialog(id: string, command: string, title: string, okLabel: string, fields: SceneElement[]): SceneElement;
|
|
4
|
+
export declare function busyIndicatorDialog(id: string, title: string, message: string): SceneElement;
|
|
5
|
+
//# sourceMappingURL=dialogElements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialogElements.d.ts","sourceRoot":"","sources":["../../../templates/dialogElements.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAwBnD,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,YAAY,CAE7H;AASD,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,YAAY,CAE/H;AAUD,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAE5F"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { externalComponent } from '@cratis/scene.blueprint.default';
|
|
2
|
+
import { CompositeName } from '../CompositeName.js';
|
|
3
|
+
|
|
4
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
5
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
6
|
+
/**
|
|
7
|
+
* The dialog elements this blueprint's dialog templates are built from.
|
|
8
|
+
*
|
|
9
|
+
* Each is a whole dialog rather than a piece of one, and that is why this package's dialog templates look
|
|
10
|
+
* so different from the default blueprint's. The default blueprint composes a dialog out of primitives - a
|
|
11
|
+
* title, a message, a row of buttons - because it has nothing better available. Here the library ships
|
|
12
|
+
* dialogs that resolve their result through Arc's dialog context, so the frame, the buttons and the
|
|
13
|
+
* protocol behind them all belong to the composite. A template's job is to configure one, not to rebuild it.
|
|
14
|
+
*/ /**
|
|
15
|
+
* The Arc-aware dialog: a frame whose result resolves through Arc's dialog context.
|
|
16
|
+
*
|
|
17
|
+
* Worth shadowing PrimeReact's `dialog` for. PrimeReact's is a modal frame and nothing more; this one lets
|
|
18
|
+
* a caller `await` a `DialogResult` instead of threading `visible` state and callbacks by hand, which is
|
|
19
|
+
* the difference between a dialog you can call and a dialog you have to wire.
|
|
20
|
+
*
|
|
21
|
+
* `visible` is left at the adapter's default of `true`, because a dialog placed in a template is placed to
|
|
22
|
+
* be seen; a host that drives visibility sets the property itself.
|
|
23
|
+
*/ function dialog(id, title, okLabel, cancelLabel, content) {
|
|
24
|
+
return externalComponent(id, CompositeName.Dialog, {
|
|
25
|
+
title,
|
|
26
|
+
okLabel,
|
|
27
|
+
cancelLabel,
|
|
28
|
+
width: '28rem'
|
|
29
|
+
}, {
|
|
30
|
+
content
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A dialog whose confirm button *is* the command's execution.
|
|
35
|
+
*
|
|
36
|
+
* Worth using instead of composing `dialog` with `commandForm`, because a hand-composed pair has no way to
|
|
37
|
+
* keep the dialog open on a rejected command without reimplementing the protocol: this one submits, feeds
|
|
38
|
+
* the backend's validation results back onto the fields, and only closes when the command succeeded.
|
|
39
|
+
*/ function commandDialog(id, command, title, okLabel, fields) {
|
|
40
|
+
return externalComponent(id, CompositeName.CommandDialog, {
|
|
41
|
+
command,
|
|
42
|
+
title,
|
|
43
|
+
okLabel,
|
|
44
|
+
cancelLabel: 'Cancel',
|
|
45
|
+
width: '32rem'
|
|
46
|
+
}, {
|
|
47
|
+
content: fields
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The blocking spinner shown while a long-running command is in flight.
|
|
52
|
+
*
|
|
53
|
+
* In a running application it is the Arc dialog host that renders this, threading its own title and
|
|
54
|
+
* message through. Shipping it as a template is what lets its wording and placement be *designed* rather
|
|
55
|
+
* than discovered the first time an operation takes a while - which is the only moment anyone ever sees it,
|
|
56
|
+
* and the worst moment to be reading a sentence nobody wrote on purpose.
|
|
57
|
+
*/ function busyIndicatorDialog(id, title, message) {
|
|
58
|
+
return externalComponent(id, CompositeName.BusyIndicatorDialog, {
|
|
59
|
+
title,
|
|
60
|
+
message
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { busyIndicatorDialog, commandDialog, dialog };
|
|
65
|
+
//# sourceMappingURL=dialogElements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialogElements.js","sources":["../../../templates/dialogElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { externalComponent } from '@cratis/scene.blueprint.default';\nimport { CompositeName } from '../CompositeName';\n\n/**\n * The dialog elements this blueprint's dialog templates are built from.\n *\n * Each is a whole dialog rather than a piece of one, and that is why this package's dialog templates look\n * so different from the default blueprint's. The default blueprint composes a dialog out of primitives - a\n * title, a message, a row of buttons - because it has nothing better available. Here the library ships\n * dialogs that resolve their result through Arc's dialog context, so the frame, the buttons and the\n * protocol behind them all belong to the composite. A template's job is to configure one, not to rebuild it.\n */\n\n/**\n * The Arc-aware dialog: a frame whose result resolves through Arc's dialog context.\n *\n * Worth shadowing PrimeReact's `dialog` for. PrimeReact's is a modal frame and nothing more; this one lets\n * a caller `await` a `DialogResult` instead of threading `visible` state and callbacks by hand, which is\n * the difference between a dialog you can call and a dialog you have to wire.\n *\n * `visible` is left at the adapter's default of `true`, because a dialog placed in a template is placed to\n * be seen; a host that drives visibility sets the property itself.\n */\nexport function dialog(id: string, title: string, okLabel: string, cancelLabel: string, content: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.Dialog, { title, okLabel, cancelLabel, width: '28rem' }, { content });\n}\n\n/**\n * A dialog whose confirm button *is* the command's execution.\n *\n * Worth using instead of composing `dialog` with `commandForm`, because a hand-composed pair has no way to\n * keep the dialog open on a rejected command without reimplementing the protocol: this one submits, feeds\n * the backend's validation results back onto the fields, and only closes when the command succeeded.\n */\nexport function commandDialog(id: string, command: string, title: string, okLabel: string, fields: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.CommandDialog, { command, title, okLabel, cancelLabel: 'Cancel', width: '32rem' }, { content: fields });\n}\n\n/**\n * The blocking spinner shown while a long-running command is in flight.\n *\n * In a running application it is the Arc dialog host that renders this, threading its own title and\n * message through. Shipping it as a template is what lets its wording and placement be *designed* rather\n * than discovered the first time an operation takes a while - which is the only moment anyone ever sees it,\n * and the worst moment to be reading a sentence nobody wrote on purpose.\n */\nexport function busyIndicatorDialog(id: string, title: string, message: string): SceneElement {\n return externalComponent(id, CompositeName.BusyIndicatorDialog, { title, message });\n}\n"],"names":["dialog","id","title","okLabel","cancelLabel","content","externalComponent","CompositeName","Dialog","width","commandDialog","command","fields","CommandDialog","busyIndicatorDialog","message","BusyIndicatorDialog"],"mappings":";;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;IAoBO,SAASA,MAAAA,CAAOC,EAAU,EAAEC,KAAa,EAAEC,OAAe,EAAEC,WAAmB,EAAEC,OAAuB,EAAA;AAC3G,IAAA,OAAOC,iBAAAA,CAAkBL,EAAAA,EAAIM,aAAAA,CAAcC,MAAM,EAAE;AAAEN,QAAAA,KAAAA;AAAOC,QAAAA,OAAAA;AAASC,QAAAA,WAAAA;QAAaK,KAAAA,EAAO;KAAQ,EAAG;AAAEJ,QAAAA;AAAQ,KAAA,CAAA;AAClH;AAEA;;;;;;IAOO,SAASK,aAAAA,CAAcT,EAAU,EAAEU,OAAe,EAAET,KAAa,EAAEC,OAAe,EAAES,MAAsB,EAAA;AAC7G,IAAA,OAAON,iBAAAA,CAAkBL,EAAAA,EAAIM,aAAAA,CAAcM,aAAa,EAAE;AAAEF,QAAAA,OAAAA;AAAST,QAAAA,KAAAA;AAAOC,QAAAA,OAAAA;QAASC,WAAAA,EAAa,QAAA;QAAUK,KAAAA,EAAO;KAAQ,EAAG;QAAEJ,OAAAA,EAASO;AAAO,KAAA,CAAA;AACpJ;AAEA;;;;;;;AAOC,IACM,SAASE,mBAAAA,CAAoBb,EAAU,EAAEC,KAAa,EAAEa,OAAe,EAAA;AAC1E,IAAA,OAAOT,iBAAAA,CAAkBL,EAAAA,EAAIM,aAAAA,CAAcS,mBAAmB,EAAE;AAAEd,QAAAA,KAAAA;AAAOa,QAAAA;AAAQ,KAAA,CAAA;AACrF;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DialogTemplate } from '@cratis/scene.model';
|
|
2
|
+
export declare const commandDialogTemplate: DialogTemplate;
|
|
3
|
+
export declare const confirmDialogTemplate: DialogTemplate;
|
|
4
|
+
export declare const busyDialogTemplate: DialogTemplate;
|
|
5
|
+
export declare const componentsDialogTemplates: DialogTemplate[];
|
|
6
|
+
//# sourceMappingURL=dialogTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialogTemplates.d.ts","sourceRoot":"","sources":["../../../templates/dialogTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAqCrD,eAAO,MAAM,qBAAqB,EAAE,cAenC,CAAC;AAaF,eAAO,MAAM,qBAAqB,EAAE,cAanC,CAAC;AAUF,eAAO,MAAM,kBAAkB,EAAE,cAUhC,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,cAAc,EAAuE,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { TemplateSlotName } from '@cratis/scene.blueprint.default';
|
|
2
|
+
import { commandDialog, dialog, busyIndicatorDialog } from './dialogElements.js';
|
|
3
|
+
import { icon } from './elements.js';
|
|
4
|
+
import { numberField, inputTextField, calendarField, textAreaField } from './formElements.js';
|
|
5
|
+
import { SampleBindingName } from './SampleBindingName.js';
|
|
6
|
+
|
|
7
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
8
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
9
|
+
/**
|
|
10
|
+
* The three dialog shapes an Arc application repeats: submit a command, confirm something destructive, and
|
|
11
|
+
* say that something long-running is in flight.
|
|
12
|
+
*
|
|
13
|
+
* A dialog template has no `fitsSlot`, and that absence is the whole distinction from a screen template. A
|
|
14
|
+
* screen template is *placed* - it fills a slot on whatever contains it, and the containment chain decides
|
|
15
|
+
* where it appears. A dialog is *summoned*: it opens over the application from wherever the code that
|
|
16
|
+
* opened it happens to be, so there is no parent slot for it to name.
|
|
17
|
+
*
|
|
18
|
+
* Every one of these declares exactly one slot, which is a real departure from how the default blueprint
|
|
19
|
+
* builds its dialogs, and the reason is worth stating. The default blueprint composes a dialog out of
|
|
20
|
+
* primitives - a title, a message, a row of buttons - because primitives are all it has. Here the library
|
|
21
|
+
* ships whole dialogs that resolve their result through Arc's dialog context, so the frame, the title bar
|
|
22
|
+
* and the buttons all belong to the composite. A template that declared `header` and `actions` slots would
|
|
23
|
+
* be offering regions that render *outside* the modal, which is worse than not offering them: a screen
|
|
24
|
+
* would fill them, and the content would appear somewhere nobody expected.
|
|
25
|
+
*/ /**
|
|
26
|
+
* A command dialog: a short capture whose confirm button is the command's execution.
|
|
27
|
+
*
|
|
28
|
+
* Worth reaching for instead of composing `dialog` with `commandForm`, because a hand-composed pair has no
|
|
29
|
+
* way to keep the dialog open on a rejected command without reimplementing the protocol. This one submits,
|
|
30
|
+
* feeds the backend's validation results back onto the fields, and only closes when the command succeeded.
|
|
31
|
+
*
|
|
32
|
+
* The fields are placed by hand rather than generated, which is the opposite choice from `CommandFormPage`
|
|
33
|
+
* and deliberate. A dialog is a *short* capture: three or four properties chosen because they are the ones
|
|
34
|
+
* a person can answer in an overlay. Generating every property of the command would turn an overlay into a
|
|
35
|
+
* page, which is precisely the decision a dialog is supposed to have already made.
|
|
36
|
+
*/ const commandDialogTemplate = {
|
|
37
|
+
name: 'CommandDialog',
|
|
38
|
+
slots: [
|
|
39
|
+
{
|
|
40
|
+
name: TemplateSlotName.Body
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
content: {
|
|
44
|
+
[TemplateSlotName.Body]: [
|
|
45
|
+
commandDialog('command-dialog', SampleBindingName.RecordAdjustment, 'Record an adjustment', 'Record', [
|
|
46
|
+
numberField('command-dialog-amount', 'amount', 'Amount'),
|
|
47
|
+
inputTextField('command-dialog-reason', 'reason', 'Reason', 'Damaged goods'),
|
|
48
|
+
calendarField('command-dialog-effective', 'effective', 'Effective from'),
|
|
49
|
+
textAreaField('command-dialog-note', 'note', 'Note', 3)
|
|
50
|
+
])
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
displayName: 'Command dialog',
|
|
54
|
+
description: 'A short capture whose confirm button submits the command and only closes when it succeeded.'
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* A confirmation dialog: one question, the consequence spelled out, and a way back.
|
|
58
|
+
*
|
|
59
|
+
* The Arc-aware `dialog` rather than PrimeReact's, because a caller `await`s a `DialogResult` from it
|
|
60
|
+
* instead of threading `visible` state and callbacks by hand - which is the difference between a
|
|
61
|
+
* confirmation you can call from a handler and one you have to wire into a component's state.
|
|
62
|
+
*
|
|
63
|
+
* The confirm label says what will happen rather than `OK`. A confirmation whose buttons are `OK` and
|
|
64
|
+
* `Cancel` makes the reader map the question onto the answer under time pressure, which is exactly when
|
|
65
|
+
* they will get it wrong.
|
|
66
|
+
*/ const confirmDialogTemplate = {
|
|
67
|
+
name: 'ConfirmDialog',
|
|
68
|
+
slots: [
|
|
69
|
+
{
|
|
70
|
+
name: TemplateSlotName.Body
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
content: {
|
|
74
|
+
[TemplateSlotName.Body]: [
|
|
75
|
+
dialog('confirm-dialog', 'Void this invoice?', 'Void it', 'Keep it', [
|
|
76
|
+
icon('confirm-dialog-icon', 'pi pi-exclamation-triangle'),
|
|
77
|
+
inputTextField('confirm-dialog-reason', 'reason', 'Why is it being voided?', 'Duplicate of INV-2041')
|
|
78
|
+
])
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
displayName: 'Confirmation dialog',
|
|
82
|
+
description: 'One question with the consequence spelled out, answered through Arc dialog context.'
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* A busy dialog: the blocking spinner shown while a long-running command is in flight.
|
|
86
|
+
*
|
|
87
|
+
* In a running application the Arc dialog host renders this, threading its own title and message through.
|
|
88
|
+
* Shipping it as a template is what lets its wording be *designed* rather than discovered the first time an
|
|
89
|
+
* operation takes a while - which is the only moment anyone ever sees it, and the worst possible moment to
|
|
90
|
+
* be reading a sentence nobody wrote on purpose.
|
|
91
|
+
*/ const busyDialogTemplate = {
|
|
92
|
+
name: 'BusyDialog',
|
|
93
|
+
slots: [
|
|
94
|
+
{
|
|
95
|
+
name: TemplateSlotName.Body
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
content: {
|
|
99
|
+
[TemplateSlotName.Body]: [
|
|
100
|
+
busyIndicatorDialog('busy-dialog', 'Recording the adjustment', 'The invoice will reappear as soon as the read model catches up.')
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
displayName: 'Busy dialog',
|
|
104
|
+
description: 'The blocking spinner shown while a long-running command is in flight, with wording chosen up front.'
|
|
105
|
+
};
|
|
106
|
+
/** The dialog templates this blueprint provides. */ const componentsDialogTemplates = [
|
|
107
|
+
commandDialogTemplate,
|
|
108
|
+
confirmDialogTemplate,
|
|
109
|
+
busyDialogTemplate
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
export { busyDialogTemplate, commandDialogTemplate, componentsDialogTemplates, confirmDialogTemplate };
|
|
113
|
+
//# sourceMappingURL=dialogTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialogTemplates.js","sources":["../../../templates/dialogTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogTemplate } from '@cratis/scene.model';\nimport { TemplateSlotName } from '@cratis/scene.blueprint.default';\nimport { busyIndicatorDialog, commandDialog, dialog } from './dialogElements';\nimport { icon } from './elements';\nimport { calendarField, inputTextField, numberField, textAreaField } from './formElements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The three dialog shapes an Arc application repeats: submit a command, confirm something destructive, and\n * say that something long-running is in flight.\n *\n * A dialog template has no `fitsSlot`, and that absence is the whole distinction from a screen template. A\n * screen template is *placed* - it fills a slot on whatever contains it, and the containment chain decides\n * where it appears. A dialog is *summoned*: it opens over the application from wherever the code that\n * opened it happens to be, so there is no parent slot for it to name.\n *\n * Every one of these declares exactly one slot, which is a real departure from how the default blueprint\n * builds its dialogs, and the reason is worth stating. The default blueprint composes a dialog out of\n * primitives - a title, a message, a row of buttons - because primitives are all it has. Here the library\n * ships whole dialogs that resolve their result through Arc's dialog context, so the frame, the title bar\n * and the buttons all belong to the composite. A template that declared `header` and `actions` slots would\n * be offering regions that render *outside* the modal, which is worse than not offering them: a screen\n * would fill them, and the content would appear somewhere nobody expected.\n */\n\n/**\n * A command dialog: a short capture whose confirm button is the command's execution.\n *\n * Worth reaching for instead of composing `dialog` with `commandForm`, because a hand-composed pair has no\n * way to keep the dialog open on a rejected command without reimplementing the protocol. This one submits,\n * feeds the backend's validation results back onto the fields, and only closes when the command succeeded.\n *\n * The fields are placed by hand rather than generated, which is the opposite choice from `CommandFormPage`\n * and deliberate. A dialog is a *short* capture: three or four properties chosen because they are the ones\n * a person can answer in an overlay. Generating every property of the command would turn an overlay into a\n * page, which is precisely the decision a dialog is supposed to have already made.\n */\nexport const commandDialogTemplate: DialogTemplate = {\n name: 'CommandDialog',\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n commandDialog('command-dialog', SampleBindingName.RecordAdjustment, 'Record an adjustment', 'Record', [\n numberField('command-dialog-amount', 'amount', 'Amount'),\n inputTextField('command-dialog-reason', 'reason', 'Reason', 'Damaged goods'),\n calendarField('command-dialog-effective', 'effective', 'Effective from'),\n textAreaField('command-dialog-note', 'note', 'Note', 3),\n ]),\n ],\n },\n displayName: 'Command dialog',\n description: 'A short capture whose confirm button submits the command and only closes when it succeeded.',\n};\n\n/**\n * A confirmation dialog: one question, the consequence spelled out, and a way back.\n *\n * The Arc-aware `dialog` rather than PrimeReact's, because a caller `await`s a `DialogResult` from it\n * instead of threading `visible` state and callbacks by hand - which is the difference between a\n * confirmation you can call from a handler and one you have to wire into a component's state.\n *\n * The confirm label says what will happen rather than `OK`. A confirmation whose buttons are `OK` and\n * `Cancel` makes the reader map the question onto the answer under time pressure, which is exactly when\n * they will get it wrong.\n */\nexport const confirmDialogTemplate: DialogTemplate = {\n name: 'ConfirmDialog',\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n dialog('confirm-dialog', 'Void this invoice?', 'Void it', 'Keep it', [\n icon('confirm-dialog-icon', 'pi pi-exclamation-triangle'),\n inputTextField('confirm-dialog-reason', 'reason', 'Why is it being voided?', 'Duplicate of INV-2041'),\n ]),\n ],\n },\n displayName: 'Confirmation dialog',\n description: 'One question with the consequence spelled out, answered through Arc dialog context.',\n};\n\n/**\n * A busy dialog: the blocking spinner shown while a long-running command is in flight.\n *\n * In a running application the Arc dialog host renders this, threading its own title and message through.\n * Shipping it as a template is what lets its wording be *designed* rather than discovered the first time an\n * operation takes a while - which is the only moment anyone ever sees it, and the worst possible moment to\n * be reading a sentence nobody wrote on purpose.\n */\nexport const busyDialogTemplate: DialogTemplate = {\n name: 'BusyDialog',\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n busyIndicatorDialog('busy-dialog', 'Recording the adjustment', 'The invoice will reappear as soon as the read model catches up.'),\n ],\n },\n displayName: 'Busy dialog',\n description: 'The blocking spinner shown while a long-running command is in flight, with wording chosen up front.',\n};\n\n/** The dialog templates this blueprint provides. */\nexport const componentsDialogTemplates: DialogTemplate[] = [commandDialogTemplate, confirmDialogTemplate, busyDialogTemplate];\n"],"names":["commandDialogTemplate","name","slots","TemplateSlotName","Body","content","commandDialog","SampleBindingName","RecordAdjustment","numberField","inputTextField","calendarField","textAreaField","displayName","description","confirmDialogTemplate","dialog","icon","busyDialogTemplate","busyIndicatorDialog","componentsDialogTemplates"],"mappings":";;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BaA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;AACrBE,YAAAA,aAAAA,CAAc,gBAAA,EAAkBC,iBAAAA,CAAkBC,gBAAgB,EAAE,wBAAwB,QAAA,EAAU;AAClGC,gBAAAA,WAAAA,CAAY,yBAAyB,QAAA,EAAU,QAAA,CAAA;gBAC/CC,cAAAA,CAAe,uBAAA,EAAyB,UAAU,QAAA,EAAU,eAAA,CAAA;AAC5DC,gBAAAA,aAAAA,CAAc,4BAA4B,WAAA,EAAa,gBAAA,CAAA;gBACvDC,aAAAA,CAAc,qBAAA,EAAuB,QAAQ,MAAA,EAAQ,CAAA;AACxD,aAAA;AACJ;AACL,KAAA;IACAC,WAAAA,EAAa,gBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA;;;;;;;;;;UAWaC,qBAAAA,GAAwC;IACjDd,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;YACrBY,MAAAA,CAAO,gBAAA,EAAkB,oBAAA,EAAsB,SAAA,EAAW,SAAA,EAAW;AACjEC,gBAAAA,IAAAA,CAAK,qBAAA,EAAuB,4BAAA,CAAA;gBAC5BP,cAAAA,CAAe,uBAAA,EAAyB,UAAU,yBAAA,EAA2B,uBAAA;AAChF,aAAA;AACJ;AACL,KAAA;IACAG,WAAAA,EAAa,qBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA;;;;;;;UAQaI,kBAAAA,GAAqC;IAC9CjB,IAAAA,EAAM,YAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;AACrBe,YAAAA,mBAAAA,CAAoB,eAAe,0BAAA,EAA4B,iEAAA;AAClE;AACL,KAAA;IACAN,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,qDACO,MAAMM,yBAAAA,GAA8C;AAACpB,IAAAA,qBAAAA;AAAuBe,IAAAA,qBAAAA;AAAuBG,IAAAA;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SceneElement } from '@cratis/scene.model';
|
|
2
|
+
export declare function schemaEditor(id: string, eventTypeName: string, canEdit: boolean, canNotEditReason?: string): SceneElement;
|
|
3
|
+
export declare function objectContentEditor(id: string, editMode: boolean): SceneElement;
|
|
4
|
+
export declare function objectNavigationalBar(id: string): SceneElement;
|
|
5
|
+
export declare function timeMachine(id: string): SceneElement;
|
|
6
|
+
export declare function filterPanel(id: string, label: string): SceneElement;
|
|
7
|
+
export declare function dropdown(id: string, placeholder: string, options: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}[]): SceneElement;
|
|
11
|
+
//# sourceMappingURL=editorElements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editorElements.d.ts","sourceRoot":"","sources":["../../../templates/editorElements.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAoBnD,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,YAAY,CAQzH;AAGD,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,YAAY,CAE/E;AAGD,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,CAE9D;AASD,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,CAEpD;AASD,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAEnE;AAGD,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,YAAY,CAEnH"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { externalComponent } from '@cratis/scene.blueprint.default';
|
|
2
|
+
import { CompositeName } from '../CompositeName.js';
|
|
3
|
+
import { invoiceNavigationPath, invoiceSchema, invoiceDocument, invoiceVersions, invoiceFilters } from './sampleData.js';
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* The Arc-free editing and inspection elements this blueprint's templates are built from.
|
|
9
|
+
*
|
|
10
|
+
* Unlike everything else in this package these need no binding at all - they take their content straight
|
|
11
|
+
* out of the property bag - so a template built from them renders as a working page with no host, no
|
|
12
|
+
* proxies and no backend. That is what makes the editor templates the ones to open first when looking at
|
|
13
|
+
* this blueprint.
|
|
14
|
+
*/ /**
|
|
15
|
+
* A JSON schema edited as a typed property tree rather than as text.
|
|
16
|
+
*
|
|
17
|
+
* `canEdit` and `canNotEditReason` belong together: in an event-sourced application a schema is very often
|
|
18
|
+
* deliberately read-only, and saying *why* in the same place is what keeps that from looking like a bug.
|
|
19
|
+
*/ function schemaEditor(id, eventTypeName, canEdit, canNotEditReason) {
|
|
20
|
+
return externalComponent(id, CompositeName.SchemaEditor, {
|
|
21
|
+
schema: invoiceSchema,
|
|
22
|
+
eventTypeName,
|
|
23
|
+
canEdit,
|
|
24
|
+
canNotEditReason,
|
|
25
|
+
editMode: canEdit
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/** A document rendered against its schema, so nested values are navigable and each is edited by its declared type. */ function objectContentEditor(id, editMode) {
|
|
29
|
+
return externalComponent(id, CompositeName.ObjectContentEditor, {
|
|
30
|
+
object: invoiceDocument,
|
|
31
|
+
schema: invoiceSchema,
|
|
32
|
+
editMode
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** The trail saying where you are inside a nested document, and the way back out. */ function objectNavigationalBar(id) {
|
|
36
|
+
return externalComponent(id, CompositeName.ObjectNavigationalBar, {
|
|
37
|
+
navigationPath: invoiceNavigationPath
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The timeline of successive versions.
|
|
42
|
+
*
|
|
43
|
+
* Worth a place on a detail page in a way it would not be in a CRUD application: in an event-sourced
|
|
44
|
+
* system everything *has* a history rather than only a current value, so scrubbing through it is the
|
|
45
|
+
* natural way to look at a record rather than a special feature.
|
|
46
|
+
*/ function timeMachine(id) {
|
|
47
|
+
return externalComponent(id, CompositeName.TimeMachine, {
|
|
48
|
+
versions: invoiceVersions,
|
|
49
|
+
currentVersionIndex: 0
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The filter toggle and the panel it anchors, as one element.
|
|
54
|
+
*
|
|
55
|
+
* One element rather than two because `FilterPanel` is a portal anchored to a button - it renders next to
|
|
56
|
+
* whatever opened it, so it cannot be placed on its own, and the element tree has no way to express an
|
|
57
|
+
* anchor relationship. The adapter owns both halves, and a template places one thing.
|
|
58
|
+
*/ function filterPanel(id, label) {
|
|
59
|
+
return externalComponent(id, CompositeName.FilterPanel, {
|
|
60
|
+
label,
|
|
61
|
+
filters: invoiceFilters,
|
|
62
|
+
searchPlaceholder: 'Search filters'
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/** A standalone selection control, not bound to a command property. */ function dropdown(id, placeholder, options) {
|
|
66
|
+
return externalComponent(id, CompositeName.Dropdown, {
|
|
67
|
+
placeholder,
|
|
68
|
+
options,
|
|
69
|
+
showClear: true
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { dropdown, filterPanel, objectContentEditor, objectNavigationalBar, schemaEditor, timeMachine };
|
|
74
|
+
//# sourceMappingURL=editorElements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editorElements.js","sources":["../../../templates/editorElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { externalComponent } from '@cratis/scene.blueprint.default';\nimport { CompositeName } from '../CompositeName';\nimport { invoiceDocument, invoiceFilters, invoiceNavigationPath, invoiceSchema, invoiceVersions } from './sampleData';\n\n/**\n * The Arc-free editing and inspection elements this blueprint's templates are built from.\n *\n * Unlike everything else in this package these need no binding at all - they take their content straight\n * out of the property bag - so a template built from them renders as a working page with no host, no\n * proxies and no backend. That is what makes the editor templates the ones to open first when looking at\n * this blueprint.\n */\n\n/**\n * A JSON schema edited as a typed property tree rather than as text.\n *\n * `canEdit` and `canNotEditReason` belong together: in an event-sourced application a schema is very often\n * deliberately read-only, and saying *why* in the same place is what keeps that from looking like a bug.\n */\nexport function schemaEditor(id: string, eventTypeName: string, canEdit: boolean, canNotEditReason?: string): SceneElement {\n return externalComponent(id, CompositeName.SchemaEditor, {\n schema: invoiceSchema,\n eventTypeName,\n canEdit,\n canNotEditReason,\n editMode: canEdit,\n });\n}\n\n/** A document rendered against its schema, so nested values are navigable and each is edited by its declared type. */\nexport function objectContentEditor(id: string, editMode: boolean): SceneElement {\n return externalComponent(id, CompositeName.ObjectContentEditor, { object: invoiceDocument, schema: invoiceSchema, editMode });\n}\n\n/** The trail saying where you are inside a nested document, and the way back out. */\nexport function objectNavigationalBar(id: string): SceneElement {\n return externalComponent(id, CompositeName.ObjectNavigationalBar, { navigationPath: invoiceNavigationPath });\n}\n\n/**\n * The timeline of successive versions.\n *\n * Worth a place on a detail page in a way it would not be in a CRUD application: in an event-sourced\n * system everything *has* a history rather than only a current value, so scrubbing through it is the\n * natural way to look at a record rather than a special feature.\n */\nexport function timeMachine(id: string): SceneElement {\n return externalComponent(id, CompositeName.TimeMachine, { versions: invoiceVersions, currentVersionIndex: 0 });\n}\n\n/**\n * The filter toggle and the panel it anchors, as one element.\n *\n * One element rather than two because `FilterPanel` is a portal anchored to a button - it renders next to\n * whatever opened it, so it cannot be placed on its own, and the element tree has no way to express an\n * anchor relationship. The adapter owns both halves, and a template places one thing.\n */\nexport function filterPanel(id: string, label: string): SceneElement {\n return externalComponent(id, CompositeName.FilterPanel, { label, filters: invoiceFilters, searchPlaceholder: 'Search filters' });\n}\n\n/** A standalone selection control, not bound to a command property. */\nexport function dropdown(id: string, placeholder: string, options: { label: string; value: string }[]): SceneElement {\n return externalComponent(id, CompositeName.Dropdown, { placeholder, options, showClear: true });\n}\n"],"names":["schemaEditor","id","eventTypeName","canEdit","canNotEditReason","externalComponent","CompositeName","SchemaEditor","schema","invoiceSchema","editMode","objectContentEditor","ObjectContentEditor","object","invoiceDocument","objectNavigationalBar","ObjectNavigationalBar","navigationPath","invoiceNavigationPath","timeMachine","TimeMachine","versions","invoiceVersions","currentVersionIndex","filterPanel","label","FilterPanel","filters","invoiceFilters","searchPlaceholder","dropdown","placeholder","options","Dropdown","showClear"],"mappings":";;;;AAAA;AACA;AAOA;;;;;;;;;;;;IAeO,SAASA,YAAAA,CAAaC,EAAU,EAAEC,aAAqB,EAAEC,OAAgB,EAAEC,gBAAyB,EAAA;AACvG,IAAA,OAAOC,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcC,YAAY,EAAE;QACrDC,MAAAA,EAAQC,aAAAA;AACRP,QAAAA,aAAAA;AACAC,QAAAA,OAAAA;AACAC,QAAAA,gBAAAA;QACAM,QAAAA,EAAUP;AACd,KAAA,CAAA;AACJ;AAEA,uHACO,SAASQ,mBAAAA,CAAoBV,EAAU,EAAES,QAAiB,EAAA;AAC7D,IAAA,OAAOL,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcM,mBAAmB,EAAE;QAAEC,MAAAA,EAAQC,eAAAA;QAAiBN,MAAAA,EAAQC,aAAAA;AAAeC,QAAAA;AAAS,KAAA,CAAA;AAC/H;AAEA,sFACO,SAASK,qBAAAA,CAAsBd,EAAU,EAAA;AAC5C,IAAA,OAAOI,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcU,qBAAqB,EAAE;QAAEC,cAAAA,EAAgBC;AAAsB,KAAA,CAAA;AAC9G;AAEA;;;;;;IAOO,SAASC,WAAAA,CAAYlB,EAAU,EAAA;AAClC,IAAA,OAAOI,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcc,WAAW,EAAE;QAAEC,QAAAA,EAAUC,eAAAA;QAAiBC,mBAAAA,EAAqB;AAAE,KAAA,CAAA;AAChH;AAEA;;;;;;AAMC,IACM,SAASC,WAAAA,CAAYvB,EAAU,EAAEwB,KAAa,EAAA;AACjD,IAAA,OAAOpB,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcoB,WAAW,EAAE;AAAED,QAAAA,KAAAA;QAAOE,OAAAA,EAASC,cAAAA;QAAgBC,iBAAAA,EAAmB;AAAiB,KAAA,CAAA;AAClI;AAEA,wEACO,SAASC,QAAAA,CAAS7B,EAAU,EAAE8B,WAAmB,EAAEC,OAA2C,EAAA;AACjG,IAAA,OAAO3B,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAc2B,QAAQ,EAAE;AAAEF,QAAAA,WAAAA;AAAaC,QAAAA,OAAAA;QAASE,SAAAA,EAAW;AAAK,KAAA,CAAA;AACjG;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
export declare const schemaEditorPageTemplate: ScreenTemplate;
|
|
3
|
+
export declare const objectEditorPageTemplate: ScreenTemplate;
|
|
4
|
+
export declare const editorTemplates: ScreenTemplate[];
|
|
5
|
+
//# sourceMappingURL=editorTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editorTemplates.d.ts","sourceRoot":"","sources":["../../../templates/editorTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AA+BrE,eAAO,MAAM,wBAAwB,EAAE,cA6BtC,CAAC;AAeF,eAAO,MAAM,wBAAwB,EAAE,cA+CtC,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,cAAc,EAAyD,CAAC"}
|