@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,182 @@
|
|
|
1
|
+
import { WidthSizeClass } from '@cratis/scene.model';
|
|
2
|
+
import { TemplateSlotName, SlotName, column, slotLeaf, row } from '@cratis/scene.blueprint.default';
|
|
3
|
+
import { dataPage, observableDataTable, invoiceTableOptions, invoiceColumns } from './dataElements.js';
|
|
4
|
+
import { objectNavigationalBar, objectContentEditor, timeMachine } from './editorElements.js';
|
|
5
|
+
import { arcPageHeader, toolbar, toolbarButton, toolbarSeparator, toolbarGroup, page } from './elements.js';
|
|
6
|
+
import { SampleBindingName } from './SampleBindingName.js';
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
/**
|
|
11
|
+
* The three list shapes an Arc application repeats: a list, a live list, and a list with the selected
|
|
12
|
+
* record beside it.
|
|
13
|
+
*
|
|
14
|
+
* All three fill the application shell's `content` slot, which is the only slot the default blueprint's
|
|
15
|
+
* `AppShell` layout declares for a screen - so an application that has picked the default blueprint can
|
|
16
|
+
* drop any of these in without arranging anything.
|
|
17
|
+
*
|
|
18
|
+
* What makes them worth shipping is what is *already wired*. A list page is not "a table in a slot"; it is
|
|
19
|
+
* a query name, a set of columns, an empty message, a data key, a filter field list, a header that states
|
|
20
|
+
* what the page is bound to, and an action bar. Every one of those is a decision, and repeating all seven
|
|
21
|
+
* per screen is how a list page ends up subtly different on every screen of an application.
|
|
22
|
+
*/ /**
|
|
23
|
+
* The archetype: a `dataPage` filling the body, under a header that says what it is bound to.
|
|
24
|
+
*
|
|
25
|
+
* `dataPage` is the single highest-leverage name `Cratis.Components` exposes - the library's whole
|
|
26
|
+
* list-screen composite, with its title bar, menubar, filterable table and optional details pane driven
|
|
27
|
+
* from one query. Building the same thing out of a `table` and a `toolbar` in a screen is pages of
|
|
28
|
+
* modeling for a worse result, and this template is the answer to that: an application supplies a query
|
|
29
|
+
* name and has a working list page.
|
|
30
|
+
*/ const dataListPageTemplate = {
|
|
31
|
+
name: 'DataListPage',
|
|
32
|
+
fitsSlot: SlotName.Content,
|
|
33
|
+
slots: [
|
|
34
|
+
{
|
|
35
|
+
name: TemplateSlotName.Header
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: TemplateSlotName.Body
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
content: {
|
|
42
|
+
[TemplateSlotName.Header]: [
|
|
43
|
+
arcPageHeader('data-list-header', {
|
|
44
|
+
title: 'Invoices',
|
|
45
|
+
subtitle: 'Every invoice, filterable and paged against the server',
|
|
46
|
+
section: 'Billing',
|
|
47
|
+
query: SampleBindingName.AllInvoices
|
|
48
|
+
}, [
|
|
49
|
+
toolbar('data-list-actions', [
|
|
50
|
+
toolbarButton('data-list-new', 'Register an invoice', 'pi pi-plus', 'New'),
|
|
51
|
+
toolbarButton('data-list-refresh', 'Refresh', 'pi pi-refresh'),
|
|
52
|
+
toolbarSeparator('data-list-separator'),
|
|
53
|
+
toolbarGroup('data-list-export', [
|
|
54
|
+
toolbarButton('data-list-download', 'Download as CSV', 'pi pi-download'),
|
|
55
|
+
toolbarButton('data-list-print', 'Print', 'pi pi-print')
|
|
56
|
+
])
|
|
57
|
+
])
|
|
58
|
+
])
|
|
59
|
+
],
|
|
60
|
+
[TemplateSlotName.Body]: [
|
|
61
|
+
dataPage('data-list-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
displayName: 'Data list page',
|
|
65
|
+
description: 'A dataPage bound to one query, under a header that states the binding - the whole list screen in two elements.'
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The live variant: the same page shape over an observable query.
|
|
69
|
+
*
|
|
70
|
+
* A separate template rather than a flag, for the same reason `observableDataTable` is a separate name
|
|
71
|
+
* from `dataTable`: the difference lives in the *proxy* a host registers, not in how the page is
|
|
72
|
+
* configured. An observable query opens a subscription and the page re-renders when the read model
|
|
73
|
+
* changes on the server. Choosing this template is an application saying its data is live, and that is a
|
|
74
|
+
* decision worth being able to read off the screen rather than infer from a property.
|
|
75
|
+
*/ const observableDataListPageTemplate = {
|
|
76
|
+
name: 'ObservableDataListPage',
|
|
77
|
+
fitsSlot: SlotName.Content,
|
|
78
|
+
slots: [
|
|
79
|
+
{
|
|
80
|
+
name: TemplateSlotName.Header
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: TemplateSlotName.Body
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
content: {
|
|
87
|
+
[TemplateSlotName.Header]: [
|
|
88
|
+
arcPageHeader('observable-list-header', {
|
|
89
|
+
title: 'Invoices in flight',
|
|
90
|
+
subtitle: 'Updates as the read model changes - no refresh button, because there is nothing to refresh',
|
|
91
|
+
section: 'Billing',
|
|
92
|
+
query: SampleBindingName.InvoicesInFlight
|
|
93
|
+
})
|
|
94
|
+
],
|
|
95
|
+
[TemplateSlotName.Body]: [
|
|
96
|
+
page('observable-list-body', 'In flight', [
|
|
97
|
+
observableDataTable('observable-list-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns)
|
|
98
|
+
])
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
displayName: 'Observable data list page',
|
|
102
|
+
description: 'A live list over an observable query, which re-renders when the read model changes on the server.'
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* List plus detail: the whole list screen, with the selected record's document and history beside it.
|
|
106
|
+
*
|
|
107
|
+
* The detail region is built from the library's Arc-free editors, which is the interesting part. They read
|
|
108
|
+
* their content out of the property bag rather than from a query, so this half of the page renders fully
|
|
109
|
+
* at design time while the list half is still a placeholder - and in an event-sourced application the
|
|
110
|
+
* record's *history* is as natural a thing to show as its current values, which is why the time machine is
|
|
111
|
+
* here rather than in some optional extra.
|
|
112
|
+
*
|
|
113
|
+
* Its arrangement drops the detail column below the list at a compact width, because a document editor and
|
|
114
|
+
* a paged table side by side on a phone are two unreadable slivers.
|
|
115
|
+
*/ const dataListWithDetailPageTemplate = {
|
|
116
|
+
name: 'DataListWithDetailPage',
|
|
117
|
+
fitsSlot: SlotName.Content,
|
|
118
|
+
slots: [
|
|
119
|
+
{
|
|
120
|
+
name: TemplateSlotName.Header
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: TemplateSlotName.Body
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: TemplateSlotName.SidePanel
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
arrangement: {
|
|
130
|
+
root: column([
|
|
131
|
+
slotLeaf(TemplateSlotName.Header),
|
|
132
|
+
row([
|
|
133
|
+
slotLeaf(TemplateSlotName.Body, {
|
|
134
|
+
grow: 2
|
|
135
|
+
}),
|
|
136
|
+
slotLeaf(TemplateSlotName.SidePanel, {
|
|
137
|
+
grow: 1
|
|
138
|
+
})
|
|
139
|
+
], 16)
|
|
140
|
+
]),
|
|
141
|
+
overrides: [
|
|
142
|
+
{
|
|
143
|
+
width: WidthSizeClass.Compact,
|
|
144
|
+
root: column([
|
|
145
|
+
slotLeaf(TemplateSlotName.Header),
|
|
146
|
+
slotLeaf(TemplateSlotName.Body),
|
|
147
|
+
slotLeaf(TemplateSlotName.SidePanel)
|
|
148
|
+
], 16)
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
content: {
|
|
153
|
+
[TemplateSlotName.Header]: [
|
|
154
|
+
arcPageHeader('list-detail-header', {
|
|
155
|
+
title: 'Invoices',
|
|
156
|
+
subtitle: 'The list, with the selected invoice beside it',
|
|
157
|
+
section: 'Billing',
|
|
158
|
+
query: SampleBindingName.AllInvoices
|
|
159
|
+
})
|
|
160
|
+
],
|
|
161
|
+
[TemplateSlotName.Body]: [
|
|
162
|
+
dataPage('list-detail-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)
|
|
163
|
+
],
|
|
164
|
+
[TemplateSlotName.SidePanel]: [
|
|
165
|
+
page('list-detail-panel', 'Selected invoice', [
|
|
166
|
+
objectNavigationalBar('list-detail-trail'),
|
|
167
|
+
objectContentEditor('list-detail-document', false),
|
|
168
|
+
timeMachine('list-detail-history')
|
|
169
|
+
])
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
displayName: 'Data list with detail page',
|
|
173
|
+
description: 'A dataPage beside a detail region showing the selected record document and its history.'
|
|
174
|
+
};
|
|
175
|
+
/** The three list-shaped templates. */ const listTemplates = [
|
|
176
|
+
dataListPageTemplate,
|
|
177
|
+
observableDataListPageTemplate,
|
|
178
|
+
dataListWithDetailPageTemplate
|
|
179
|
+
];
|
|
180
|
+
|
|
181
|
+
export { dataListPageTemplate, dataListWithDetailPageTemplate, listTemplates, observableDataListPageTemplate };
|
|
182
|
+
//# sourceMappingURL=listTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listTemplates.js","sources":["../../../templates/listTemplates.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 { ScreenTemplate, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { dataPage, invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { objectContentEditor, objectNavigationalBar, timeMachine } from './editorElements';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarGroup, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The three list shapes an Arc application repeats: a list, a live list, and a list with the selected\n * record beside it.\n *\n * All three fill the application shell's `content` slot, which is the only slot the default blueprint's\n * `AppShell` layout declares for a screen - so an application that has picked the default blueprint can\n * drop any of these in without arranging anything.\n *\n * What makes them worth shipping is what is *already wired*. A list page is not \"a table in a slot\"; it is\n * a query name, a set of columns, an empty message, a data key, a filter field list, a header that states\n * what the page is bound to, and an action bar. Every one of those is a decision, and repeating all seven\n * per screen is how a list page ends up subtly different on every screen of an application.\n */\n\n/**\n * The archetype: a `dataPage` filling the body, under a header that says what it is bound to.\n *\n * `dataPage` is the single highest-leverage name `Cratis.Components` exposes - the library's whole\n * list-screen composite, with its title bar, menubar, filterable table and optional details pane driven\n * from one query. Building the same thing out of a `table` and a `toolbar` in a screen is pages of\n * modeling for a worse result, and this template is the answer to that: an application supplies a query\n * name and has a working list page.\n */\nexport const dataListPageTemplate: ScreenTemplate = {\n name: 'DataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader(\n 'data-list-header',\n { title: 'Invoices', subtitle: 'Every invoice, filterable and paged against the server', section: 'Billing', query: SampleBindingName.AllInvoices },\n [\n toolbar('data-list-actions', [\n toolbarButton('data-list-new', 'Register an invoice', 'pi pi-plus', 'New'),\n toolbarButton('data-list-refresh', 'Refresh', 'pi pi-refresh'),\n toolbarSeparator('data-list-separator'),\n toolbarGroup('data-list-export', [\n toolbarButton('data-list-download', 'Download as CSV', 'pi pi-download'),\n toolbarButton('data-list-print', 'Print', 'pi pi-print'),\n ]),\n ]),\n ],\n ),\n ],\n [TemplateSlotName.Body]: [dataPage('data-list-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n },\n displayName: 'Data list page',\n description: 'A dataPage bound to one query, under a header that states the binding - the whole list screen in two elements.',\n};\n\n/**\n * The live variant: the same page shape over an observable query.\n *\n * A separate template rather than a flag, for the same reason `observableDataTable` is a separate name\n * from `dataTable`: the difference lives in the *proxy* a host registers, not in how the page is\n * configured. An observable query opens a subscription and the page re-renders when the read model\n * changes on the server. Choosing this template is an application saying its data is live, and that is a\n * decision worth being able to read off the screen rather than infer from a property.\n */\nexport const observableDataListPageTemplate: ScreenTemplate = {\n name: 'ObservableDataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('observable-list-header', {\n title: 'Invoices in flight',\n subtitle: 'Updates as the read model changes - no refresh button, because there is nothing to refresh',\n section: 'Billing',\n query: SampleBindingName.InvoicesInFlight,\n }),\n ],\n [TemplateSlotName.Body]: [\n page('observable-list-body', 'In flight', [\n observableDataTable('observable-list-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n },\n displayName: 'Observable data list page',\n description: 'A live list over an observable query, which re-renders when the read model changes on the server.',\n};\n\n/**\n * List plus detail: the whole list screen, with the selected record's document and history beside it.\n *\n * The detail region is built from the library's Arc-free editors, which is the interesting part. They read\n * their content out of the property bag rather than from a query, so this half of the page renders fully\n * at design time while the list half is still a placeholder - and in an event-sourced application the\n * record's *history* is as natural a thing to show as its current values, which is why the time machine is\n * here rather than in some optional extra.\n *\n * Its arrangement drops the detail column below the list at a compact width, because a document editor and\n * a paged table side by side on a phone are two unreadable slivers.\n */\nexport const dataListWithDetailPageTemplate: ScreenTemplate = {\n name: 'DataListWithDetailPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body), slotLeaf(TemplateSlotName.SidePanel)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('list-detail-header', {\n title: 'Invoices',\n subtitle: 'The list, with the selected invoice beside it',\n section: 'Billing',\n query: SampleBindingName.AllInvoices,\n }),\n ],\n [TemplateSlotName.Body]: [dataPage('list-detail-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n [TemplateSlotName.SidePanel]: [\n page('list-detail-panel', 'Selected invoice', [\n objectNavigationalBar('list-detail-trail'),\n objectContentEditor('list-detail-document', false),\n timeMachine('list-detail-history'),\n ]),\n ],\n },\n displayName: 'Data list with detail page',\n description: 'A dataPage beside a detail region showing the selected record document and its history.',\n};\n\n/** The three list-shaped templates. */\nexport const listTemplates: ScreenTemplate[] = [dataListPageTemplate, observableDataListPageTemplate, dataListWithDetailPageTemplate];\n"],"names":["dataListPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","content","arcPageHeader","title","subtitle","section","query","SampleBindingName","AllInvoices","toolbar","toolbarButton","toolbarSeparator","toolbarGroup","dataPage","invoiceTableOptions","invoiceColumns","displayName","description","observableDataListPageTemplate","InvoicesInFlight","page","observableDataTable","dataListWithDetailPageTemplate","SidePanel","arrangement","root","column","slotLeaf","row","grow","overrides","width","WidthSizeClass","Compact","objectNavigationalBar","objectContentEditor","timeMachine","listTemplates"],"mappings":";;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;UAuBaA,oBAAAA,GAAuC;IAChDC,IAAAA,EAAM,cAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAK;AAAE,KAAA;IAC3EC,OAAAA,EAAS;QACL,CAACH,gBAAAA,CAAiBC,MAAM,GAAG;AACvBG,YAAAA,aAAAA,CACI,kBAAA,EACA;gBAAEC,KAAAA,EAAO,UAAA;gBAAYC,QAAAA,EAAU,wDAAA;gBAA0DC,OAAAA,EAAS,SAAA;AAAWC,gBAAAA,KAAAA,EAAOC,kBAAkBC;aAAY,EAClJ;AACIC,gBAAAA,OAAAA,CAAQ,mBAAA,EAAqB;oBACzBC,aAAAA,CAAc,eAAA,EAAiB,uBAAuB,YAAA,EAAc,KAAA,CAAA;AACpEA,oBAAAA,aAAAA,CAAc,qBAAqB,SAAA,EAAW,eAAA,CAAA;oBAC9CC,gBAAAA,CAAiB,qBAAA,CAAA;AACjBC,oBAAAA,YAAAA,CAAa,kBAAA,EAAoB;AAC7BF,wBAAAA,aAAAA,CAAc,sBAAsB,iBAAA,EAAmB,gBAAA,CAAA;AACvDA,wBAAAA,aAAAA,CAAc,mBAAmB,OAAA,EAAS,aAAA;AAC7C,qBAAA;AACJ,iBAAA;AACJ,aAAA;A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qBAAqB,kBAAA,EAAoB;gBAC1Cc,qBAAAA,CAAsB,mBAAA,CAAA;AACtBC,gBAAAA,mBAAAA,CAAoB,sBAAA,EAAwB,KAAA,CAAA;gBAC5CC,WAAAA,CAAY,qBAAA;AACf,aAAA;AACJ;AACL,KAAA;IACApB,WAAAA,EAAa,4BAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,wCACO,MAAMoB,aAAAA,GAAkC;AAAC7C,IAAAA,oBAAAA;AAAsB0B,IAAAA,8BAAAA;AAAgCI,IAAAA;;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
export declare const dataModulePageTemplate: ScreenTemplate;
|
|
3
|
+
export declare const dataFeatureSectionTemplate: ScreenTemplate;
|
|
4
|
+
export declare const commandSliceSectionTemplate: ScreenTemplate;
|
|
5
|
+
export declare const nestingChainTemplates: ScreenTemplate[];
|
|
6
|
+
//# sourceMappingURL=nesting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nesting.d.ts","sourceRoot":"","sources":["../../../templates/nesting.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAiCrD,eAAO,MAAM,sBAAsB,EAAE,cAgBpC,CAAC;AASF,eAAO,MAAM,0BAA0B,EAAE,cAqBxC,CAAC;AAUF,eAAO,MAAM,2BAA2B,EAAE,cAsBzC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,cAAc,EAAsF,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { TemplateSlotName, SlotName } from '@cratis/scene.blueprint.default';
|
|
2
|
+
import { observableDataTable, invoiceTableOptions, invoiceColumns } from './dataElements.js';
|
|
3
|
+
import { filterPanel } from './editorElements.js';
|
|
4
|
+
import { page, arcPageHeader, toolbar, toolbarButton, toolbarSeparator } from './elements.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
|
+
* A worked three-level chain, from the application layout down to one behavior.
|
|
11
|
+
*
|
|
12
|
+
* The nesting rule is one rule applied at every depth: a template names, in `fitsSlot`, a slot declared by
|
|
13
|
+
* whatever contains it. A module's template fits the application layout's `content`; a feature's fits a
|
|
14
|
+
* slot the module's declares; a slice's fits one the feature's declares. Nothing here is a special case
|
|
15
|
+
* for a particular level, which is exactly why the hierarchy can be arbitrarily deep with no second
|
|
16
|
+
* mechanism.
|
|
17
|
+
*
|
|
18
|
+
* The slot names are chosen so that each fitted name is declared by exactly one container in the chain -
|
|
19
|
+
* `body` only by the module, `primary` only by the feature. That is not decoration: `resolveScreenTemplates`
|
|
20
|
+
* places a template only when the containers in scope agree on exactly one home for it, and reports it as
|
|
21
|
+
* unplaced rather than guessing when two of them declare the same name. A chain that reused `body` at
|
|
22
|
+
* three levels would read fine and resolve to nothing.
|
|
23
|
+
*
|
|
24
|
+
* The whole chain is Arc-bound, which is the point of it living in *this* blueprint rather than being a
|
|
25
|
+
* second copy of the default one's. It ends where a Cratis slice really ends: a button that summons the
|
|
26
|
+
* command dialog.
|
|
27
|
+
*/ /**
|
|
28
|
+
* Module level: fits the application shell's `content` slot.
|
|
29
|
+
*
|
|
30
|
+
* A module always has a name and a description, so it brings its own header, and it offers a body for the
|
|
31
|
+
* feature inside it plus a side panel for the filters that apply across the whole module.
|
|
32
|
+
*/ const dataModulePageTemplate = {
|
|
33
|
+
name: 'DataModulePage',
|
|
34
|
+
fitsSlot: SlotName.Content,
|
|
35
|
+
slots: [
|
|
36
|
+
{
|
|
37
|
+
name: TemplateSlotName.Header
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: TemplateSlotName.Body
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: TemplateSlotName.SidePanel
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
content: {
|
|
47
|
+
[TemplateSlotName.Header]: [
|
|
48
|
+
arcPageHeader('module-header', {
|
|
49
|
+
title: 'Billing',
|
|
50
|
+
subtitle: 'Everything the billing module owns',
|
|
51
|
+
section: 'Operations'
|
|
52
|
+
})
|
|
53
|
+
],
|
|
54
|
+
[TemplateSlotName.SidePanel]: [
|
|
55
|
+
page('module-filters', 'Filters', [
|
|
56
|
+
filterPanel('module-filter-panel', 'Filter the module')
|
|
57
|
+
])
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
displayName: 'Data module page',
|
|
61
|
+
description: 'Module level: fits the application layout content slot and offers a body for one feature.'
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Feature level: fits the module page's `body` slot.
|
|
65
|
+
*
|
|
66
|
+
* A feature is where actions belong - a module is a grouping and a slice is one behavior, and the feature
|
|
67
|
+
* in between is what a user thinks of as "the screen with the buttons on it". It offers a primary region
|
|
68
|
+
* for the slice and a secondary one for the live view of what that slice is doing.
|
|
69
|
+
*/ const dataFeatureSectionTemplate = {
|
|
70
|
+
name: 'DataFeatureSection',
|
|
71
|
+
fitsSlot: TemplateSlotName.Body,
|
|
72
|
+
slots: [
|
|
73
|
+
{
|
|
74
|
+
name: TemplateSlotName.Toolbar
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: TemplateSlotName.Primary
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: TemplateSlotName.Secondary
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
content: {
|
|
84
|
+
[TemplateSlotName.Toolbar]: [
|
|
85
|
+
toolbar('feature-toolbar', [
|
|
86
|
+
toolbarButton('feature-new', 'Register an invoice', 'pi pi-plus', 'New'),
|
|
87
|
+
toolbarButton('feature-adjust', 'Record an adjustment', 'pi pi-pencil', 'Adjust'),
|
|
88
|
+
toolbarSeparator('feature-separator'),
|
|
89
|
+
toolbarButton('feature-export', 'Export the feature data', 'pi pi-download')
|
|
90
|
+
])
|
|
91
|
+
],
|
|
92
|
+
[TemplateSlotName.Secondary]: [
|
|
93
|
+
page('feature-live', 'In flight', [
|
|
94
|
+
observableDataTable('feature-live-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns)
|
|
95
|
+
])
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
displayName: 'Data feature section',
|
|
99
|
+
description: 'Feature level: fits a module page body slot, brings the action toolbar and a live view.'
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Slice level: fits the feature section's `primary` slot.
|
|
103
|
+
*
|
|
104
|
+
* The end of the chain, and deliberately the thinnest thing in it. A slice is one behavior, and in a
|
|
105
|
+
* Cratis application that behavior is one command - so its surface is a header saying what the command is
|
|
106
|
+
* and whether it is wired, and the action that summons it. The capture itself happens in the `CommandDialog`
|
|
107
|
+
* dialog template, which is why this template has no form on it and does not need one.
|
|
108
|
+
*/ const commandSliceSectionTemplate = {
|
|
109
|
+
name: 'CommandSliceSection',
|
|
110
|
+
fitsSlot: TemplateSlotName.Primary,
|
|
111
|
+
slots: [
|
|
112
|
+
{
|
|
113
|
+
name: TemplateSlotName.Header
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: TemplateSlotName.Actions
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
content: {
|
|
120
|
+
[TemplateSlotName.Header]: [
|
|
121
|
+
arcPageHeader('slice-header', {
|
|
122
|
+
title: 'Record an adjustment',
|
|
123
|
+
subtitle: 'One behavior, one command, one button',
|
|
124
|
+
section: 'Adjustments',
|
|
125
|
+
command: SampleBindingName.RecordAdjustment
|
|
126
|
+
})
|
|
127
|
+
],
|
|
128
|
+
[TemplateSlotName.Actions]: [
|
|
129
|
+
toolbar('slice-actions', [
|
|
130
|
+
toolbarButton('slice-record', 'Record an adjustment', 'pi pi-check', 'Record'),
|
|
131
|
+
toolbarButton('slice-cancel', 'Leave the invoice as it is', 'pi pi-times', 'Cancel')
|
|
132
|
+
])
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
displayName: 'Command slice section',
|
|
136
|
+
description: 'Slice level: fits a feature section primary slot and hosts one command behavior.'
|
|
137
|
+
};
|
|
138
|
+
/** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */ const nestingChainTemplates = [
|
|
139
|
+
dataModulePageTemplate,
|
|
140
|
+
dataFeatureSectionTemplate,
|
|
141
|
+
commandSliceSectionTemplate
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
export { commandSliceSectionTemplate, dataFeatureSectionTemplate, dataModulePageTemplate, nestingChainTemplates };
|
|
145
|
+
//# sourceMappingURL=nesting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nesting.js","sources":["../../../templates/nesting.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 { ScreenTemplate } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName } from '@cratis/scene.blueprint.default';\nimport { invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { filterPanel } from './editorElements';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * A worked three-level chain, from the application layout down to one behavior.\n *\n * The nesting rule is one rule applied at every depth: a template names, in `fitsSlot`, a slot declared by\n * whatever contains it. A module's template fits the application layout's `content`; a feature's fits a\n * slot the module's declares; a slice's fits one the feature's declares. Nothing here is a special case\n * for a particular level, which is exactly why the hierarchy can be arbitrarily deep with no second\n * mechanism.\n *\n * The slot names are chosen so that each fitted name is declared by exactly one container in the chain -\n * `body` only by the module, `primary` only by the feature. That is not decoration: `resolveScreenTemplates`\n * places a template only when the containers in scope agree on exactly one home for it, and reports it as\n * unplaced rather than guessing when two of them declare the same name. A chain that reused `body` at\n * three levels would read fine and resolve to nothing.\n *\n * The whole chain is Arc-bound, which is the point of it living in *this* blueprint rather than being a\n * second copy of the default one's. It ends where a Cratis slice really ends: a button that summons the\n * command dialog.\n */\n\n/**\n * Module level: fits the application shell's `content` slot.\n *\n * A module always has a name and a description, so it brings its own header, and it offers a body for the\n * feature inside it plus a side panel for the filters that apply across the whole module.\n */\nexport const dataModulePageTemplate: ScreenTemplate = {\n name: 'DataModulePage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('module-header', {\n title: 'Billing',\n subtitle: 'Everything the billing module owns',\n section: 'Operations',\n }),\n ],\n [TemplateSlotName.SidePanel]: [page('module-filters', 'Filters', [filterPanel('module-filter-panel', 'Filter the module')])],\n },\n displayName: 'Data module page',\n description: 'Module level: fits the application layout content slot and offers a body for one feature.',\n};\n\n/**\n * Feature level: fits the module page's `body` slot.\n *\n * A feature is where actions belong - a module is a grouping and a slice is one behavior, and the feature\n * in between is what a user thinks of as \"the screen with the buttons on it\". It offers a primary region\n * for the slice and a secondary one for the live view of what that slice is doing.\n */\nexport const dataFeatureSectionTemplate: ScreenTemplate = {\n name: 'DataFeatureSection',\n fitsSlot: TemplateSlotName.Body,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Primary }, { name: TemplateSlotName.Secondary }],\n content: {\n [TemplateSlotName.Toolbar]: [\n toolbar('feature-toolbar', [\n toolbarButton('feature-new', 'Register an invoice', 'pi pi-plus', 'New'),\n toolbarButton('feature-adjust', 'Record an adjustment', 'pi pi-pencil', 'Adjust'),\n toolbarSeparator('feature-separator'),\n toolbarButton('feature-export', 'Export the feature data', 'pi pi-download'),\n ]),\n ],\n [TemplateSlotName.Secondary]: [\n page('feature-live', 'In flight', [\n observableDataTable('feature-live-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n },\n displayName: 'Data feature section',\n description: 'Feature level: fits a module page body slot, brings the action toolbar and a live view.',\n};\n\n/**\n * Slice level: fits the feature section's `primary` slot.\n *\n * The end of the chain, and deliberately the thinnest thing in it. A slice is one behavior, and in a\n * Cratis application that behavior is one command - so its surface is a header saying what the command is\n * and whether it is wired, and the action that summons it. The capture itself happens in the `CommandDialog`\n * dialog template, which is why this template has no form on it and does not need one.\n */\nexport const commandSliceSectionTemplate: ScreenTemplate = {\n name: 'CommandSliceSection',\n fitsSlot: TemplateSlotName.Primary,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('slice-header', {\n title: 'Record an adjustment',\n subtitle: 'One behavior, one command, one button',\n section: 'Adjustments',\n command: SampleBindingName.RecordAdjustment,\n }),\n ],\n [TemplateSlotName.Actions]: [\n toolbar('slice-actions', [\n toolbarButton('slice-record', 'Record an adjustment', 'pi pi-check', 'Record'),\n toolbarButton('slice-cancel', 'Leave the invoice as it is', 'pi pi-times', 'Cancel'),\n ]),\n ],\n },\n displayName: 'Command slice section',\n description: 'Slice level: fits a feature section primary slot and hosts one command behavior.',\n};\n\n/** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */\nexport const nestingChainTemplates: ScreenTemplate[] = [dataModulePageTemplate, dataFeatureSectionTemplate, commandSliceSectionTemplate];\n"],"names":["dataModulePageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","SidePanel","content","arcPageHeader","title","subtitle","section","page","filterPanel","displayName","description","dataFeatureSectionTemplate","Toolbar","Primary","Secondary","toolbar","toolbarButton","toolbarSeparator","observableDataTable","SampleBindingName","InvoicesInFlight","invoiceTableOptions","invoiceColumns","commandSliceSectionTemplate","Actions","command","RecordAdjustment","nestingChainTemplates"],"mappings":";;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;;;;UA0BaA,sBAAAA,GAAyC;IAClDC,IAAAA,EAAM,gBAAA;AACNC,IAAAA,QAAAA,EAA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A0C;AAACnC,IAAAA,sBAAAA;AAAwBmB,IAAAA,0BAAAA;AAA4BY,IAAAA;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const invoiceSchema: Record<string, unknown>;
|
|
2
|
+
export declare const invoiceDocument: Record<string, unknown>;
|
|
3
|
+
export declare const invoiceNavigationPath: string[];
|
|
4
|
+
export declare const invoiceVersions: Record<string, unknown>[];
|
|
5
|
+
export declare const invoiceFilters: Record<string, unknown>[];
|
|
6
|
+
export declare const statusOptions: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}[];
|
|
10
|
+
//# sourceMappingURL=sampleData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleData.d.ts","sourceRoot":"","sources":["../../../templates/sampleData.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAUjD,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAMnD,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAA0B,CAAC;AASrE,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAIpD,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAcnD,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAI3D,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* The seeded content the Arc-free composites in this package's templates render.
|
|
5
|
+
*
|
|
6
|
+
* There is a real split running through this blueprint, and it is worth naming rather than hiding. Most of
|
|
7
|
+
* `@cratis/components` is Arc-bound: a data page, a table, a command form and a command dialog all need a
|
|
8
|
+
* registered proxy and a live backend before they show anything, so at design time they are placeholders,
|
|
9
|
+
* and that is correct.
|
|
10
|
+
*
|
|
11
|
+
* The editors are not. A schema editor, a document editor, a navigational bar and a time machine all take
|
|
12
|
+
* their content from the property bag, so a template that seeds them renders as a working page with no
|
|
13
|
+
* backend at all. That is why the editor templates carry this data: it makes two of this package's pages
|
|
14
|
+
* genuinely usable in a preview, rather than eight pages of dashed boxes.
|
|
15
|
+
*
|
|
16
|
+
* The shape is an invoice throughout, matching the query and command names the other templates bind to, so
|
|
17
|
+
* the whole package reads as one small application rather than eight unrelated demonstrations.
|
|
18
|
+
*/ /** A JSON schema in the shape Chronicle emits for an event type - what `schemaEditor` edits. */ const invoiceSchema = {
|
|
19
|
+
title: 'InvoiceRegistered',
|
|
20
|
+
type: 'object',
|
|
21
|
+
properties: {
|
|
22
|
+
number: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'The invoice number as printed on the document.'
|
|
25
|
+
},
|
|
26
|
+
customer: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
description: 'The customer the invoice is addressed to.'
|
|
29
|
+
},
|
|
30
|
+
issued: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
format: 'date-time',
|
|
33
|
+
description: 'When the invoice was issued.'
|
|
34
|
+
},
|
|
35
|
+
amount: {
|
|
36
|
+
type: 'number',
|
|
37
|
+
description: 'The gross amount, in the invoice currency.'
|
|
38
|
+
},
|
|
39
|
+
currency: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'The ISO currency code.'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/** One invoice as a plain document - what `objectContentEditor` renders against {@link invoiceSchema}. */ const invoiceDocument = {
|
|
46
|
+
number: 'INV-2043',
|
|
47
|
+
customer: 'Northwind Traders',
|
|
48
|
+
issued: '2026-01-05T09:30:00Z',
|
|
49
|
+
amount: 4200,
|
|
50
|
+
currency: 'USD'
|
|
51
|
+
};
|
|
52
|
+
/** Where in the document the navigational bar currently is. */ const invoiceNavigationPath = [
|
|
53
|
+
'lines',
|
|
54
|
+
'shipping'
|
|
55
|
+
];
|
|
56
|
+
/**
|
|
57
|
+
* Successive versions of the invoice, for the time machine.
|
|
58
|
+
*
|
|
59
|
+
* Every entry has an id, a label and a parseable timestamp, because the adapter drops any that does not -
|
|
60
|
+
* a version invented at the epoch would not be a slightly wrong entry, it would silently reorder every
|
|
61
|
+
* real one around it.
|
|
62
|
+
*/ const invoiceVersions = [
|
|
63
|
+
{
|
|
64
|
+
id: 'v3',
|
|
65
|
+
label: 'Adjustment recorded',
|
|
66
|
+
timestamp: '2026-01-12T14:05:00Z',
|
|
67
|
+
content: 'Amount reduced by 120.00 - damaged goods'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'v2',
|
|
71
|
+
label: 'Approved',
|
|
72
|
+
timestamp: '2026-01-07T08:15:00Z',
|
|
73
|
+
content: 'Approved by Amelia Nyquist'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'v1',
|
|
77
|
+
label: 'Registered',
|
|
78
|
+
timestamp: '2026-01-05T09:30:00Z',
|
|
79
|
+
content: 'Registered from the supplier portal'
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
/** The filters the list templates offer, in the shape `filterPanel` reads. */ const invoiceFilters = [
|
|
83
|
+
{
|
|
84
|
+
key: 'status',
|
|
85
|
+
label: 'Status',
|
|
86
|
+
type: 'string',
|
|
87
|
+
multi: true,
|
|
88
|
+
options: [
|
|
89
|
+
{
|
|
90
|
+
key: 'draft',
|
|
91
|
+
label: 'Draft',
|
|
92
|
+
count: 12
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'approved',
|
|
96
|
+
label: 'Approved',
|
|
97
|
+
count: 44
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: 'paid',
|
|
101
|
+
label: 'Paid',
|
|
102
|
+
count: 108
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: 'amount',
|
|
108
|
+
label: 'Amount',
|
|
109
|
+
type: 'number',
|
|
110
|
+
buckets: 4
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: 'issued',
|
|
114
|
+
label: 'Issued',
|
|
115
|
+
type: 'date'
|
|
116
|
+
}
|
|
117
|
+
];
|
|
118
|
+
/** The status choices a command form's dropdown offers. */ const statusOptions = [
|
|
119
|
+
{
|
|
120
|
+
label: 'Draft',
|
|
121
|
+
value: 'draft'
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: 'Approved',
|
|
125
|
+
value: 'approved'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
label: 'Paid',
|
|
129
|
+
value: 'paid'
|
|
130
|
+
}
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
export { invoiceDocument, invoiceFilters, invoiceNavigationPath, invoiceSchema, invoiceVersions, statusOptions };
|
|
134
|
+
//# sourceMappingURL=sampleData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleData.js","sources":["../../../templates/sampleData.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\n/**\n * The seeded content the Arc-free composites in this package's templates render.\n *\n * There is a real split running through this blueprint, and it is worth naming rather than hiding. Most of\n * `@cratis/components` is Arc-bound: a data page, a table, a command form and a command dialog all need a\n * registered proxy and a live backend before they show anything, so at design time they are placeholders,\n * and that is correct.\n *\n * The editors are not. A schema editor, a document editor, a navigational bar and a time machine all take\n * their content from the property bag, so a template that seeds them renders as a working page with no\n * backend at all. That is why the editor templates carry this data: it makes two of this package's pages\n * genuinely usable in a preview, rather than eight pages of dashed boxes.\n *\n * The shape is an invoice throughout, matching the query and command names the other templates bind to, so\n * the whole package reads as one small application rather than eight unrelated demonstrations.\n */\n\n/** A JSON schema in the shape Chronicle emits for an event type - what `schemaEditor` edits. */\nexport const invoiceSchema: Record<string, unknown> = {\n title: 'InvoiceRegistered',\n type: 'object',\n properties: {\n number: { type: 'string', description: 'The invoice number as printed on the document.' },\n customer: { type: 'string', description: 'The customer the invoice is addressed to.' },\n issued: { type: 'string', format: 'date-time', description: 'When the invoice was issued.' },\n amount: { type: 'number', description: 'The gross amount, in the invoice currency.' },\n currency: { type: 'string', description: 'The ISO currency code.' },\n },\n};\n\n/** One invoice as a plain document - what `objectContentEditor` renders against {@link invoiceSchema}. */\nexport const invoiceDocument: Record<string, unknown> = {\n number: 'INV-2043',\n customer: 'Northwind Traders',\n issued: '2026-01-05T09:30:00Z',\n amount: 4200,\n currency: 'USD',\n};\n\n/** Where in the document the navigational bar currently is. */\nexport const invoiceNavigationPath: string[] = ['lines', 'shipping'];\n\n/**\n * Successive versions of the invoice, for the time machine.\n *\n * Every entry has an id, a label and a parseable timestamp, because the adapter drops any that does not -\n * a version invented at the epoch would not be a slightly wrong entry, it would silently reorder every\n * real one around it.\n */\nexport const invoiceVersions: Record<string, unknown>[] = [\n { id: 'v3', label: 'Adjustment recorded', timestamp: '2026-01-12T14:05:00Z', content: 'Amount reduced by 120.00 - damaged goods' },\n { id: 'v2', label: 'Approved', timestamp: '2026-01-07T08:15:00Z', content: 'Approved by Amelia Nyquist' },\n { id: 'v1', label: 'Registered', timestamp: '2026-01-05T09:30:00Z', content: 'Registered from the supplier portal' },\n];\n\n/** The filters the list templates offer, in the shape `filterPanel` reads. */\nexport const invoiceFilters: Record<string, unknown>[] = [\n {\n key: 'status',\n label: 'Status',\n type: 'string',\n multi: true,\n options: [\n { key: 'draft', label: 'Draft', count: 12 },\n { key: 'approved', label: 'Approved', count: 44 },\n { key: 'paid', label: 'Paid', count: 108 },\n ],\n },\n { key: 'amount', label: 'Amount', type: 'number', buckets: 4 },\n { key: 'issued', label: 'Issued', type: 'date' },\n];\n\n/** The status choices a command form's dropdown offers. */\nexport const statusOptions: { label: string; value: string }[] = [\n { label: 'Draft', value: 'draft' },\n { label: 'Approved', value: 'approved' },\n { label: 'Paid', value: 'paid' },\n];\n"],"names":["invoiceSchema","title","type","properties","number","description","customer","issued","format","amount","currency","invoiceDocument","invoiceNavigationPath","invoiceVersions","id","label","timestamp","content","invoiceFilters","key","multi","options","count","buckets","statusOptions","value"],"mappings":"AAAA;AACA;AAEA;;;;;;;;;;;;;;;AAeC,qGAGM,MAAMA,aAAAA,GAAyC;IAClDC,KAAAA,EAAO,mBAAA;IACPC,IAAAA,EAAM,QAAA;IACNC,UAAAA,EAAY;QACRC,MAAAA,EAAQ;YAAEF,IAAAA,EAAM,QAAA;YAAUG,WAAAA,EAAa;AAAiD,SAAA;QACxFC,QAAAA,EAAU;YAAEJ,IAAAA,EAAM,QAAA;YAAUG,WAAAA,EAAa;AAA4C,SAAA;QACrFE,MAAAA,EAAQ;YAAEL,IAAAA,EAAM,QAAA;YAAUM,MAAAA,EAAQ,WAAA;YAAaH,WAAAA,EAAa;AAA+B,SAAA;QAC3FI,MAAAA,EAAQ;YAAEP,IAAAA,EAAM,QAAA;YAAUG,WAAAA,EAAa;AAA6C,SAAA;QACpFK,QAAAA,EAAU;YAAER,IAAAA,EAAM,QAAA;YAAUG,WAAAA,EAAa;AAAyB;AACtE;AACJ;AAEA,2GACO,MAAMM,eAAAA,GAA2C;IACpDP,MAAAA,EAAQ,UAAA;IACRE,QAAAA,EAAU,mBAAA;IACVC,MAAAA,EAAQ,sBAAA;IACRE,MAAAA,EAAQ,IAAA;IACRC,QAAAA,EAAU;AACd;AAEA,gEACO,MAAME,qBAAAA,GAAkC;AAAC,IAAA,OAAA;AAAS,IAAA;;AAEzD;;;;;;UAOaC,eAAAA,GAA6C;AACtD,IAAA;QAAEC,EAAAA,EAAI,IAAA;QAAMC,KAAAA,EAAO,qBAAA;QAAuBC,SAAAA,EAAW,sBAAA;QAAwBC,OAAAA,EAAS;AAA2C,KAAA;AACjI,IAA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
+
{"version":3,"file":"screenTemplates.d.ts","sourceRoot":"","sources":["../../../templates/screenTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAcrD,eAAO,MAAM,yBAAyB,EAAE,cAAc,EAMrD,CAAC;AAWF,eAAO,MAAM,uBAAuB,EAAE,cAAc,EAAuF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { commandTemplates } from './commandTemplates.js';
|
|
2
|
+
import { editorTemplates } from './editorTemplates.js';
|
|
3
|
+
import { listTemplates } from './listTemplates.js';
|
|
4
|
+
import { nestingChainTemplates } from './nesting.js';
|
|
5
|
+
import { workspaceTemplates } from './workspaceTemplates.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 screen templates this blueprint provides.
|
|
11
|
+
*
|
|
12
|
+
* Eight whole pages that fill the application shell's `content` slot, plus the three-level chain that
|
|
13
|
+
* demonstrates how `fitsSlot` composes at module, feature and slice level. The list is what the manifest's
|
|
14
|
+
* `screenTemplates` names and what the bundle provides; `validatePackageBundle` proves the two agree.
|
|
15
|
+
*/ const componentsScreenTemplates = [
|
|
16
|
+
...listTemplates,
|
|
17
|
+
...workspaceTemplates,
|
|
18
|
+
...commandTemplates,
|
|
19
|
+
...editorTemplates,
|
|
20
|
+
...nestingChainTemplates
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* The eight templates that fill the application layout's own `content` slot directly.
|
|
24
|
+
*
|
|
25
|
+
* Kept apart from the nesting chain because `fitsSlot` is resolved against *the containers in scope*, and
|
|
26
|
+
* these two groups are never in scope together. Each of these is a whole page an application places on its
|
|
27
|
+
* own; the chain's three are one page assembled from three levels. Resolving them as one set would ask
|
|
28
|
+
* `resolveScreenTemplates` which of eight `body`-declaring templates the feature section belongs to, and it
|
|
29
|
+
* would rightly answer that it cannot tell.
|
|
30
|
+
*/ const componentsPageTemplates = [
|
|
31
|
+
...listTemplates,
|
|
32
|
+
...workspaceTemplates,
|
|
33
|
+
...commandTemplates,
|
|
34
|
+
...editorTemplates
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export { componentsPageTemplates, componentsScreenTemplates };
|
|
38
|
+
//# sourceMappingURL=screenTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenTemplates.js","sources":["../../../templates/screenTemplates.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 { ScreenTemplate } from '@cratis/scene.model';\nimport { commandTemplates } from './commandTemplates';\nimport { editorTemplates } from './editorTemplates';\nimport { listTemplates } from './listTemplates';\nimport { nestingChainTemplates } from './nesting';\nimport { workspaceTemplates } from './workspaceTemplates';\n\n/**\n * The screen templates this blueprint provides.\n *\n * Eight whole pages that fill the application shell's `content` slot, plus the three-level chain that\n * demonstrates how `fitsSlot` composes at module, feature and slice level. The list is what the manifest's\n * `screenTemplates` names and what the bundle provides; `validatePackageBundle` proves the two agree.\n */\nexport const componentsScreenTemplates: ScreenTemplate[] = [\n ...listTemplates,\n ...workspaceTemplates,\n ...commandTemplates,\n ...editorTemplates,\n ...nestingChainTemplates,\n];\n\n/**\n * The eight templates that fill the application layout's own `content` slot directly.\n *\n * Kept apart from the nesting chain because `fitsSlot` is resolved against *the containers in scope*, and\n * these two groups are never in scope together. Each of these is a whole page an application places on its\n * own; the chain's three are one page assembled from three levels. Resolving them as one set would ask\n * `resolveScreenTemplates` which of eight `body`-declaring templates the feature section belongs to, and it\n * would rightly answer that it cannot tell.\n */\nexport const componentsPageTemplates: ScreenTemplate[] = [...listTemplates, ...workspaceTemplates, ...commandTemplates, ...editorTemplates];\n"],"names":["componentsScreenTemplates","listTemplates","workspaceTemplates","commandTemplates","editorTemplates","nestingChainTemplates","componentsPageTemplates"],"mappings":";;;;;;AAAA;AACA;AASA;;;;;;UAOaA,yBAAAA,GAA8C;AACpDC,IAAAA,GAAAA,aAAAA;AACAC,IAAAA,GAAAA,kBAAAA;AACAC,IAAAA,GAAAA,gBAAAA;AACAC,IAAAA,GAAAA,eAAAA;AACAC,IAAAA,GAAAA;;AAGP;;;;;;;;UASaC,uBAAAA,GAA4C;AAAIL,IAAAA,GAAAA,aAAAA;AAAkBC,IAAAA,GAAAA,kBAAAA;AAAuBC,IAAAA,GAAAA,gBAAAA;AAAqBC,IAAAA,GAAAA;;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
export declare const masterDetailPageTemplate: ScreenTemplate;
|
|
3
|
+
export declare const dashboardPageTemplate: ScreenTemplate;
|
|
4
|
+
export declare const workspaceTemplates: ScreenTemplate[];
|
|
5
|
+
//# sourceMappingURL=workspaceTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaceTemplates.d.ts","sourceRoot":"","sources":["../../../templates/workspaceTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AA+CrE,eAAO,MAAM,wBAAwB,EAAE,cAkCtC,CAAC;AAYF,eAAO,MAAM,qBAAqB,EAAE,cA+DnC,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cAAc,EAAsD,CAAC"}
|