@cratis/scene.blueprint.vendors 0.0.0-stage → 4.71.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/README.md +66 -2
- package/blueprint.ts +16 -0
- package/blueprintCatalog.json +107 -0
- package/dist/cjs/blueprint.js +19 -0
- package/dist/cjs/blueprint.js.map +1 -0
- package/dist/cjs/index.js +68 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/manifest.js +87 -0
- package/dist/cjs/manifest.js.map +1 -0
- package/dist/cjs/navigation.js +109 -0
- package/dist/cjs/navigation.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/packageName.js +8 -0
- package/dist/cjs/packageName.js.map +1 -0
- package/dist/cjs/screens/index.js +22 -0
- package/dist/cjs/screens/index.js.map +1 -0
- package/dist/cjs/templateProvenance.js +24 -0
- package/dist/cjs/templateProvenance.js.map +1 -0
- package/dist/cjs/templates/boardTemplate.js +78 -0
- package/dist/cjs/templates/boardTemplate.js.map +1 -0
- package/dist/cjs/templates/dashboardTemplates.js +151 -0
- package/dist/cjs/templates/dashboardTemplates.js.map +1 -0
- package/dist/cjs/templates/formTemplates.js +50 -0
- package/dist/cjs/templates/formTemplates.js.map +1 -0
- package/dist/cjs/templates/index.js +25 -0
- package/dist/cjs/templates/index.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +145 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/recordTemplates.js +135 -0
- package/dist/cjs/templates/recordTemplates.js.map +1 -0
- package/dist/cjs/vendorsApplication.js +49 -0
- package/dist/cjs/vendorsApplication.js.map +1 -0
- package/dist/cjs/vendorsParts.js +151 -0
- package/dist/cjs/vendorsParts.js.map +1 -0
- package/dist/cjs/vendorsQueries.js +64 -0
- package/dist/cjs/vendorsQueries.js.map +1 -0
- package/dist/cjs/vendorsScreenSet.js +40 -0
- package/dist/cjs/vendorsScreenSet.js.map +1 -0
- package/dist/esm/blueprint.d.ts +3 -0
- package/dist/esm/blueprint.d.ts.map +1 -0
- package/dist/esm/blueprint.js +17 -0
- package/dist/esm/blueprint.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/manifest.d.ts +3 -0
- package/dist/esm/manifest.d.ts.map +1 -0
- package/dist/esm/manifest.js +85 -0
- package/dist/esm/manifest.js.map +1 -0
- package/dist/esm/navigation.d.ts +5 -0
- package/dist/esm/navigation.d.ts.map +1 -0
- package/dist/esm/navigation.js +105 -0
- package/dist/esm/navigation.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 +6 -0
- package/dist/esm/packageName.js.map +1 -0
- package/dist/esm/screens/index.d.ts +3 -0
- package/dist/esm/screens/index.d.ts.map +1 -0
- package/dist/esm/screens/index.js +20 -0
- package/dist/esm/screens/index.js.map +1 -0
- package/dist/esm/templateProvenance.d.ts +3 -0
- package/dist/esm/templateProvenance.d.ts.map +1 -0
- package/dist/esm/templateProvenance.js +22 -0
- package/dist/esm/templateProvenance.js.map +1 -0
- package/dist/esm/templates/boardTemplate.d.ts +3 -0
- package/dist/esm/templates/boardTemplate.d.ts.map +1 -0
- package/dist/esm/templates/boardTemplate.js +76 -0
- package/dist/esm/templates/boardTemplate.js.map +1 -0
- package/dist/esm/templates/dashboardTemplates.d.ts +3 -0
- package/dist/esm/templates/dashboardTemplates.d.ts.map +1 -0
- package/dist/esm/templates/dashboardTemplates.js +149 -0
- package/dist/esm/templates/dashboardTemplates.js.map +1 -0
- package/dist/esm/templates/formTemplates.d.ts +3 -0
- package/dist/esm/templates/formTemplates.d.ts.map +1 -0
- package/dist/esm/templates/formTemplates.js +48 -0
- package/dist/esm/templates/formTemplates.js.map +1 -0
- package/dist/esm/templates/index.d.ts +8 -0
- package/dist/esm/templates/index.d.ts.map +1 -0
- package/dist/esm/templates/index.js +17 -0
- package/dist/esm/templates/index.js.map +1 -0
- package/dist/esm/templates/listTemplates.d.ts +3 -0
- package/dist/esm/templates/listTemplates.d.ts.map +1 -0
- package/dist/esm/templates/listTemplates.js +143 -0
- package/dist/esm/templates/listTemplates.js.map +1 -0
- package/dist/esm/templates/recordTemplates.d.ts +3 -0
- package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
- package/dist/esm/templates/recordTemplates.js +133 -0
- package/dist/esm/templates/recordTemplates.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/dist/esm/vendorsApplication.d.ts +10 -0
- package/dist/esm/vendorsApplication.d.ts.map +1 -0
- package/dist/esm/vendorsApplication.js +44 -0
- package/dist/esm/vendorsApplication.js.map +1 -0
- package/dist/esm/vendorsParts.d.ts +16 -0
- package/dist/esm/vendorsParts.d.ts.map +1 -0
- package/dist/esm/vendorsParts.js +133 -0
- package/dist/esm/vendorsParts.js.map +1 -0
- package/dist/esm/vendorsQueries.d.ts +38 -0
- package/dist/esm/vendorsQueries.d.ts.map +1 -0
- package/dist/esm/vendorsQueries.js +56 -0
- package/dist/esm/vendorsQueries.js.map +1 -0
- package/dist/esm/vendorsScreenSet.d.ts +7 -0
- package/dist/esm/vendorsScreenSet.d.ts.map +1 -0
- package/dist/esm/vendorsScreenSet.js +38 -0
- package/dist/esm/vendorsScreenSet.js.map +1 -0
- package/index.ts +14 -0
- package/manifest.ts +41 -0
- package/navigation.ts +53 -0
- package/package.json +78 -4
- package/packageName.ts +5 -0
- package/sampleData/vendors-en.json +863 -0
- package/screens/index.ts +20 -0
- package/templateProvenance.ts +15 -0
- package/templates/boardTemplate.ts +54 -0
- package/templates/dashboardTemplates.ts +76 -0
- package/templates/formTemplates.ts +33 -0
- package/templates/index.ts +18 -0
- package/templates/listTemplates.ts +96 -0
- package/templates/recordTemplates.ts +78 -0
- package/thumbnails/VendorPage.svg +17 -0
- package/thumbnails/VendorsList.svg +29 -0
- package/thumbnails/VendorsOnboardingBoard.svg +23 -0
- package/thumbnails/VendorsPerformance.svg +15 -0
- package/thumbnails/VendorsQuickCreateVendor.svg +12 -0
- package/thumbnails/vendors.svg +14 -0
- package/vendorsApplication.ts +28 -0
- package/vendorsParts.ts +58 -0
- package/vendorsQueries.ts +56 -0
- package/vendorsScreenSet.ts +21 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApplicationStructureIndex } from '@cratis/scene.engine';
|
|
2
|
+
import { ApplicationDocument, CompositionOptions } from '@cratis/scene.blueprint.default';
|
|
3
|
+
export declare const vendorsDefaultSampleDataId = "vendors-en";
|
|
4
|
+
export declare function vendorsApplication(sampleData?: string): ApplicationDocument;
|
|
5
|
+
export declare const vendorsComposition: CompositionOptions;
|
|
6
|
+
export declare const vendorsNavigationModel: () => {
|
|
7
|
+
structure: ApplicationStructureIndex;
|
|
8
|
+
navigation: import("@cratis/scene.model").NavigationModel;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=vendorsApplication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsApplication.d.ts","sourceRoot":"","sources":["../../vendorsApplication.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAkC,MAAM,iCAAiC,CAAC;AAM1H,eAAO,MAAM,0BAA0B,eAAe,CAAC;AAOvD,wBAAgB,kBAAkB,CAAC,UAAU,GAAE,MAAmC,GAAG,mBAAmB,CAGvG;AAGD,eAAO,MAAM,kBAAkB,EAAE,kBAAiE,CAAC;AAGnG,eAAO,MAAM,sBAAsB;IAAY,SAAS;IAAmD,UAAU;CAAsB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ApplicationStructureIndex } from '@cratis/scene.engine';
|
|
2
|
+
import { previewProfile, defaultLayouts } from '@cratis/scene.blueprint.default';
|
|
3
|
+
import { vendorsNavigation, vendorsStructure } from './navigation.js';
|
|
4
|
+
import { vendorsScreens } from './screens/index.js';
|
|
5
|
+
import { vendorsScreenTemplates } from './templates/index.js';
|
|
6
|
+
import { vendorsDialogs } from './templates/formTemplates.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
|
+
/** The id of the sample-data pack a new application starts with. */ const vendorsDefaultSampleDataId = 'vendors-en';
|
|
11
|
+
/**
|
|
12
|
+
* The example application of the blueprint: the foundation's layouts, the Vendors templates, the quick-create dialogs and their 4 screens, rendering against the
|
|
13
|
+
* foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture
|
|
14
|
+
* (`Samples/Vendors/vendors.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.
|
|
15
|
+
*/ function vendorsApplication(sampleData = vendorsDefaultSampleDataId) {
|
|
16
|
+
const profile = {
|
|
17
|
+
...previewProfile(undefined),
|
|
18
|
+
name: 'Vendors',
|
|
19
|
+
sampleData: {
|
|
20
|
+
activePack: sampleData,
|
|
21
|
+
mappings: [],
|
|
22
|
+
bindings: []
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
layouts: defaultLayouts,
|
|
27
|
+
screenTemplates: vendorsScreenTemplates,
|
|
28
|
+
dialogTemplates: vendorsDialogs,
|
|
29
|
+
screens: vendorsScreens,
|
|
30
|
+
uiProfiles: [
|
|
31
|
+
profile
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** What a host composes the screens with: the application's logo, which the shell's topbar shows. */ const vendorsComposition = {
|
|
36
|
+
logo: vendorsNavigation.application.logo
|
|
37
|
+
};
|
|
38
|
+
/** The structure and navigation the shell's regions show and the items' destinations resolve against. */ const vendorsNavigationModel = ()=>({
|
|
39
|
+
structure: new ApplicationStructureIndex(vendorsStructure),
|
|
40
|
+
navigation: vendorsNavigation
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export { vendorsApplication, vendorsComposition, vendorsDefaultSampleDataId, vendorsNavigationModel };
|
|
44
|
+
//# sourceMappingURL=vendorsApplication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsApplication.js","sources":["../../vendorsApplication.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 { UiProfile } from '@cratis/scene.model';\nimport { ApplicationStructureIndex } from '@cratis/scene.engine';\nimport { ApplicationDocument, CompositionOptions, defaultLayouts, previewProfile } from '@cratis/scene.blueprint.default';\nimport { vendorsNavigation, vendorsStructure } from './navigation';\nimport { vendorsScreens } from './screens';\nimport { vendorsDialogTemplates, vendorsScreenTemplates } from './templates';\n\n/** The id of the sample-data pack a new application starts with. */\nexport const vendorsDefaultSampleDataId = 'vendors-en';\n\n/**\n * The example application of the blueprint: the foundation's layouts, the Vendors templates, the quick-create dialogs and their 4 screens, rendering against the\n * foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture\n * (`Samples/Vendors/vendors.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.\n */\nexport function vendorsApplication(sampleData: string = vendorsDefaultSampleDataId): ApplicationDocument {\n const profile: UiProfile = { ...previewProfile(undefined), name: 'Vendors', sampleData: { activePack: sampleData, mappings: [], bindings: [] } };\n return { layouts: defaultLayouts, screenTemplates: vendorsScreenTemplates, dialogTemplates: vendorsDialogTemplates, screens: vendorsScreens, uiProfiles: [profile] };\n}\n\n/** What a host composes the screens with: the application's logo, which the shell's topbar shows. */\nexport const vendorsComposition: CompositionOptions = { logo: vendorsNavigation.application.logo };\n\n/** The structure and navigation the shell's regions show and the items' destinations resolve against. */\nexport const vendorsNavigationModel = () => ({ structure: new ApplicationStructureIndex(vendorsStructure), navigation: vendorsNavigation });\n"],"names":["vendorsDefaultSampleDataId","vendorsApplication","sampleData","profile","previewProfile","undefined","name","activePack","mappings","bindings","layouts","defaultLayouts","screenTemplates","vendorsScreenTemplates","dialogTemplates","vendorsDialogTemplates","screens","vendorsScreens","uiProfiles","vendorsComposition","logo","vendorsNavigation","application","vendorsNavigationModel","structure","ApplicationStructureIndex","vendorsStructure","navigation"],"mappings":";;;;;;;AAAA;AACA;AASA,qEACO,MAAMA,0BAAAA,GAA6B;AAE1C;;;;AAIC,IACM,SAASC,kBAAAA,CAAmBC,UAAAA,GAAqBF,0BAA0B,EAAA;AAC9E,IAAA,MAAMG,OAAAA,GAAqB;AAAE,QAAA,GAAGC,eAAeC,SAAAA,CAAU;QAAEC,IAAAA,EAAM,SAAA;QAAWJ,UAAAA,EAAY;YAAEK,UAAAA,EAAYL,UAAAA;AAAYM,YAAAA,QAAAA,EAAU,EAAE;AAAEC,YAAAA,QAAAA,EAAU;AAAG;AAAE,KAAA;IAC/I,OAAO;QAAEC,OAAAA,EAASC,cAAAA;QAAgBC,eAAAA,EAAiBC,sBAAAA;QAAwBC,eAAAA,EAAiBC,cAAAA;QAAwBC,OAAAA,EAASC,cAAAA;QAAgBC,UAAAA,EAAY;AAACf,YAAAA;AAAQ;AAAC,KAAA;AACvK;AAEA,sGACO,MAAMgB,kBAAAA,GAAyC;IAAEC,IAAAA,EAAMC,iBAAAA,CAAkBC,WAAW,CAACF;AAAK;AAEjG,0GACO,MAAMG,sBAAAA,GAAyB,KAAO;AAAEC,QAAAA,SAAAA,EAAW,IAAIC,yBAAAA,CAA0BC,gBAAAA,CAAAA;QAAmBC,UAAAA,EAAYN;AAAkB,KAAA;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Behavior, DialogTemplate, ExternalComponent, SceneElement, ScreenTemplate, TemplateMetadata, TemplateScope } from '@cratis/scene.model';
|
|
2
|
+
import { component, panel } from '@cratis/scene.blueprint.default';
|
|
3
|
+
export { component, panel };
|
|
4
|
+
export declare const vendorsCategory = "Business / Vendors";
|
|
5
|
+
export declare const thumbnailOf: (templateName: string) => string;
|
|
6
|
+
export declare const vendorsMetadata: (name: string, type: 'Dashboard' | 'List' | 'Board' | 'Detail' | 'Form' | 'Dialog' | 'Workspace' | 'Calendar' | 'Timeline' | 'Inbox' | 'Profile' | 'Wizard', scopes: TemplateScope[]) => TemplateMetadata;
|
|
7
|
+
export declare const actionButton: (id: string, label: string, emphasis: 'primary' | 'secondary' | 'quiet' | 'danger', extra?: Record<string, unknown>, behaviors?: Behavior[]) => ExternalComponent;
|
|
8
|
+
export declare const opensDialog: (dialogTemplate: string) => Behavior[];
|
|
9
|
+
export declare const goesTo: (screen: string) => Behavior[];
|
|
10
|
+
export declare const opensRecordOnSelect: (listId: string, screen: string) => Behavior[];
|
|
11
|
+
export declare const opensDialogOnSelect: (dialogTemplate: string) => Behavior[];
|
|
12
|
+
export declare const closesDialog: () => Behavior[];
|
|
13
|
+
export declare const withBehaviors: <T extends SceneElement>(element: T, behaviors: Behavior[]) => T;
|
|
14
|
+
export type VendorsScreenTemplate = ScreenTemplate;
|
|
15
|
+
export type VendorsDialogTemplate = DialogTemplate;
|
|
16
|
+
//# sourceMappingURL=vendorsParts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsParts.d.ts","sourceRoot":"","sources":["../../vendorsParts.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,QAAQ,EAAqB,cAAc,EAAE,iBAAiB,EAAmF,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EACjN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAGnE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAG5B,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAGpD,eAAO,MAAM,WAAW,iBAAkB,MAAM,KAAG,MAA0C,CAAC;AAG9F,eAAO,MAAM,eAAe,SAAU,MAAM,QAAQ,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,UAAU,aAAa,EAAE,KAAG,gBACzG,CAAC;AAG9G,eAAO,MAAM,YAAY,OAAQ,MAAM,SAAS,MAAM,YAAY,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,UAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,cAAmB,QAAQ,EAAE,KAAG,iBACzC,CAAC;AAGtI,eAAO,MAAM,WAAW,mBAAoB,MAAM,KAAG,QAAQ,EACuG,CAAC;AAGrK,eAAO,MAAM,MAAM,WAAY,MAAM,KAAG,QAAQ,EACwG,CAAC;AAMzJ,eAAO,MAAM,mBAAmB,WAAY,MAAM,UAAU,MAAM,KAAG,QAAQ,EAK3E,CAAC;AAKH,eAAO,MAAM,mBAAmB,mBAAoB,MAAM,KAAG,QAAQ,EACgG,CAAC;AAGtK,eAAO,MAAM,YAAY,QAAO,QAAQ,EAAmI,CAAC;AAG5K,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,YAAY,WAAW,CAAC,aAAa,QAAQ,EAAE,KAAG,CAAgC,CAAC;AAE3H,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC;AACnD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { InteractionActionKind, InteractionTriggerKind, BindingSourceKind } from '@cratis/scene.model';
|
|
2
|
+
import { component } from '@cratis/scene.blueprint.default';
|
|
3
|
+
export { component, panel } from '@cratis/scene.blueprint.default';
|
|
4
|
+
import { vendorsTemplateProvenance } from './templateProvenance.js';
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
/** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */ const vendorsCategory = 'Business / Vendors';
|
|
9
|
+
/** The package-relative thumbnail of a template. */ const thumbnailOf = (templateName)=>`thumbnails/${templateName}.svg`;
|
|
10
|
+
/** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */ const vendorsMetadata = (name, type, scopes)=>({
|
|
11
|
+
...vendorsTemplateProvenance,
|
|
12
|
+
type,
|
|
13
|
+
category: vendorsCategory,
|
|
14
|
+
thumbnail: thumbnailOf(name),
|
|
15
|
+
scopes
|
|
16
|
+
});
|
|
17
|
+
/** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */ const actionButton = (id, label, emphasis, extra = {}, behaviors)=>({
|
|
18
|
+
...component(id, 'actionButton', {
|
|
19
|
+
label,
|
|
20
|
+
emphasis,
|
|
21
|
+
permission: 'enabled',
|
|
22
|
+
...extra
|
|
23
|
+
}),
|
|
24
|
+
...behaviors ? {
|
|
25
|
+
behaviors
|
|
26
|
+
} : {}
|
|
27
|
+
});
|
|
28
|
+
/** What pressing an element does: open the named dialog template over the page. */ const opensDialog = (dialogTemplate)=>[
|
|
29
|
+
{
|
|
30
|
+
bindings: [
|
|
31
|
+
{
|
|
32
|
+
trigger: {
|
|
33
|
+
kind: InteractionTriggerKind.Click
|
|
34
|
+
},
|
|
35
|
+
actions: [
|
|
36
|
+
{
|
|
37
|
+
kind: InteractionActionKind.OpenDialog,
|
|
38
|
+
dialogTemplate
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
/** What pressing an element does: go to the named screen. */ const goesTo = (screen)=>[
|
|
46
|
+
{
|
|
47
|
+
bindings: [
|
|
48
|
+
{
|
|
49
|
+
trigger: {
|
|
50
|
+
kind: InteractionTriggerKind.Click
|
|
51
|
+
},
|
|
52
|
+
actions: [
|
|
53
|
+
{
|
|
54
|
+
kind: InteractionActionKind.Navigate,
|
|
55
|
+
screen
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
];
|
|
62
|
+
/**
|
|
63
|
+
* What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is
|
|
64
|
+
* opening it - the way a table of records works everywhere.
|
|
65
|
+
*/ const opensRecordOnSelect = (listId, screen)=>[
|
|
66
|
+
{
|
|
67
|
+
bindings: [
|
|
68
|
+
{
|
|
69
|
+
trigger: {
|
|
70
|
+
kind: InteractionTriggerKind.Select
|
|
71
|
+
},
|
|
72
|
+
actions: [
|
|
73
|
+
{
|
|
74
|
+
kind: InteractionActionKind.Navigate,
|
|
75
|
+
screen,
|
|
76
|
+
arguments: [
|
|
77
|
+
{
|
|
78
|
+
name: 'id',
|
|
79
|
+
value: {
|
|
80
|
+
kind: BindingSourceKind.ComponentProperty,
|
|
81
|
+
componentId: listId,
|
|
82
|
+
path: 'value'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
/**
|
|
93
|
+
* What choosing a row of a list does: open the named dialog over the page - a side sheet with the row's detail, so the list stays where it was.
|
|
94
|
+
*/ const opensDialogOnSelect = (dialogTemplate)=>[
|
|
95
|
+
{
|
|
96
|
+
bindings: [
|
|
97
|
+
{
|
|
98
|
+
trigger: {
|
|
99
|
+
kind: InteractionTriggerKind.Select
|
|
100
|
+
},
|
|
101
|
+
actions: [
|
|
102
|
+
{
|
|
103
|
+
kind: InteractionActionKind.OpenDialog,
|
|
104
|
+
dialogTemplate
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
];
|
|
111
|
+
/** What a Cancel or Close control does: close the dialog it was opened from. */ const closesDialog = ()=>[
|
|
112
|
+
{
|
|
113
|
+
bindings: [
|
|
114
|
+
{
|
|
115
|
+
trigger: {
|
|
116
|
+
kind: InteractionTriggerKind.Click
|
|
117
|
+
},
|
|
118
|
+
actions: [
|
|
119
|
+
{
|
|
120
|
+
kind: InteractionActionKind.CloseDialog
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
];
|
|
127
|
+
/** An element with the given behaviors attached. */ const withBehaviors = (element, behaviors)=>({
|
|
128
|
+
...element,
|
|
129
|
+
behaviors
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export { actionButton, closesDialog, goesTo, opensDialog, opensDialogOnSelect, opensRecordOnSelect, thumbnailOf, vendorsCategory, vendorsMetadata, withBehaviors };
|
|
133
|
+
//# sourceMappingURL=vendorsParts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsParts.js","sources":["../../vendorsParts.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 {\n Behavior, BindingSourceKind, DialogTemplate, ExternalComponent, InteractionActionKind, InteractionTriggerKind, NavigateAction, OpenDialogAction, SceneElement, ScreenTemplate, TemplateMetadata, TemplateScope,\n} from '@cratis/scene.model';\nimport { component, panel } from '@cratis/scene.blueprint.default';\nimport { vendorsTemplateProvenance } from './templateProvenance';\n\nexport { component, panel };\n\n/** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */\nexport const vendorsCategory = 'Business / Vendors';\n\n/** The package-relative thumbnail of a template. */\nexport const thumbnailOf = (templateName: string): string => `thumbnails/${templateName}.svg`;\n\n/** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */\nexport const vendorsMetadata = (name: string, type: 'Dashboard' | 'List' | 'Board' | 'Detail' | 'Form' | 'Dialog' | 'Workspace' | 'Calendar' | 'Timeline' | 'Inbox' | 'Profile' | 'Wizard', scopes: TemplateScope[]): TemplateMetadata =>\n ({ ...vendorsTemplateProvenance, type, category: vendorsCategory, thumbnail: thumbnailOf(name), scopes });\n\n/** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */\nexport const actionButton = (id: string, label: string, emphasis: 'primary' | 'secondary' | 'quiet' | 'danger', extra: Record<string, unknown> = {}, behaviors?: Behavior[]): ExternalComponent =>\n ({ ...component(id, 'actionButton', { label, emphasis, permission: 'enabled', ...extra }), ...(behaviors ? { behaviors } : {}) });\n\n/** What pressing an element does: open the named dialog template over the page. */\nexport const opensDialog = (dialogTemplate: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];\n\n/** What pressing an element does: go to the named screen. */\nexport const goesTo = (screen: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.Navigate, screen } as NavigateAction] }] }];\n\n/**\n * What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is\n * opening it - the way a table of records works everywhere.\n */\nexport const opensRecordOnSelect = (listId: string, screen: string): Behavior[] => [{\n bindings: [{\n trigger: { kind: InteractionTriggerKind.Select },\n actions: [{ kind: InteractionActionKind.Navigate, screen, arguments: [{ name: 'id', value: { kind: BindingSourceKind.ComponentProperty, componentId: listId, path: 'value' } }] } as NavigateAction],\n }],\n}];\n\n/**\n * What choosing a row of a list does: open the named dialog over the page - a side sheet with the row's detail, so the list stays where it was.\n */\nexport const opensDialogOnSelect = (dialogTemplate: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Select }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];\n\n/** What a Cancel or Close control does: close the dialog it was opened from. */\nexport const closesDialog = (): Behavior[] => [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.CloseDialog }] }] }];\n\n/** An element with the given behaviors attached. */\nexport const withBehaviors = <T extends SceneElement>(element: T, behaviors: Behavior[]): T => ({ ...element, behaviors });\n\nexport type VendorsScreenTemplate = ScreenTemplate;\nexport type VendorsDialogTemplate = DialogTemplate;\n"],"names":["vendorsCategory","thumbnailOf","templateName","vendorsMetadata","name","type","scopes","vendorsTemplateProvenance","category","thumbnail","actionButton","id","label","emphasis","extra","behaviors","component","permission","opensDialog","dialogTemplate","bindings","trigger","kind","InteractionTriggerKind","Click","actions","InteractionActionKind","OpenDialog","goesTo","screen","Navigate","opensRecordOnSelect","listId","Select","arguments","value","BindingSourceKind","ComponentProperty","componentId","path","opensDialogOnSelect","closesDialog","CloseDialog","withBehaviors","element"],"mappings":"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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BindingExpression } from '@cratis/scene.model';
|
|
2
|
+
export declare const fromQuery: (query: string, path?: string) => BindingExpression;
|
|
3
|
+
export declare const VendorsQuery: {
|
|
4
|
+
readonly Settings: 'VendorsSettings';
|
|
5
|
+
readonly OnboardingColumns: 'OnboardingColumns';
|
|
6
|
+
readonly OnboardingCards: 'OnboardingCards';
|
|
7
|
+
readonly Kpis: 'VendorsKpis';
|
|
8
|
+
readonly SpendByCategory: 'VendorsSpendByCategory';
|
|
9
|
+
readonly OnTimeDelivery: 'VendorsOnTimeDelivery';
|
|
10
|
+
readonly Activity: 'VendorsActivity';
|
|
11
|
+
readonly FormErrors: 'VendorsFormErrors';
|
|
12
|
+
};
|
|
13
|
+
export declare enum VendorsEntityKind {
|
|
14
|
+
Vendor = "Vendor"
|
|
15
|
+
}
|
|
16
|
+
export declare const vendorsEntityPlural: Record<VendorsEntityKind, string>;
|
|
17
|
+
export declare const vendorsQueriesOf: (entity: VendorsEntityKind) => {
|
|
18
|
+
rows: string;
|
|
19
|
+
columns: string;
|
|
20
|
+
filterFields: string;
|
|
21
|
+
views: string;
|
|
22
|
+
columnChoices: string;
|
|
23
|
+
selection: string;
|
|
24
|
+
quickSections: string;
|
|
25
|
+
record: string;
|
|
26
|
+
sections: string;
|
|
27
|
+
summary: string;
|
|
28
|
+
activity: string;
|
|
29
|
+
tabs: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const localeOfData: {
|
|
32
|
+
locale: BindingExpression;
|
|
33
|
+
};
|
|
34
|
+
export declare const currencyOfData: {
|
|
35
|
+
locale: BindingExpression;
|
|
36
|
+
currency: BindingExpression;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=vendorsQueries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsQueries.d.ts","sourceRoot":"","sources":["../../vendorsQueries.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAqB,MAAM,qBAAqB,CAAC;AAM3E,eAAO,MAAM,SAAS,UAAW,MAAM,oBAAc,iBAA2E,CAAC;AAGjI,eAAO,MAAM,YAAY;aAErB,QAAQ,EAAE,iBAAiB;aAC3B,iBAAiB,EAAE,mBAAmB;aACtC,eAAe,EAAE,iBAAiB;aAClC,IAAI,EAAE,aAAa;aACnB,eAAe,EAAE,wBAAwB;aACzC,cAAc,EAAE,uBAAuB;aACvC,QAAQ,EAAE,iBAAiB;aAC3B,UAAU,EAAE,mBAAmB;CACzB,CAAC;AAGX,oBAAY,iBAAiB;IACzB,MAAM,WAAW;CACpB;AAGD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAEjE,CAAC;AAMF,eAAO,MAAM,gBAAgB,WAAY,iBAAiB;IACtD,IAAI;IACJ,OAAO;IACP,YAAY;IACZ,KAAK;IACL,aAAa;IACb,SAAS;IACT,aAAa;IACb,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,IAAI;CACN,CAAC;AAGH,eAAO,MAAM,YAAY;IAAK,MAAM;CAAgD,CAAC;AACrF,eAAO,MAAM,cAAc;;;CAAgF,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BindingSourceKind } from '@cratis/scene.model';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* A property taken from a query result - never a value. A vendors template declares *where* its data comes from and the sample-data pack, or the real
|
|
7
|
+
* query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).
|
|
8
|
+
*/ const fromQuery = (query, path = '')=>({
|
|
9
|
+
kind: BindingSourceKind.QueryResult,
|
|
10
|
+
query,
|
|
11
|
+
path
|
|
12
|
+
});
|
|
13
|
+
/** The queries of the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */ const VendorsQuery = {
|
|
14
|
+
/** One row: the `locale` and `currency` the figures and dates are formatted in. */ Settings: 'VendorsSettings',
|
|
15
|
+
OnboardingColumns: 'OnboardingColumns',
|
|
16
|
+
OnboardingCards: 'OnboardingCards',
|
|
17
|
+
Kpis: 'VendorsKpis',
|
|
18
|
+
SpendByCategory: 'VendorsSpendByCategory',
|
|
19
|
+
OnTimeDelivery: 'VendorsOnTimeDelivery',
|
|
20
|
+
Activity: 'VendorsActivity',
|
|
21
|
+
FormErrors: 'VendorsFormErrors'
|
|
22
|
+
};
|
|
23
|
+
/** The entities a template is made for. */ var VendorsEntityKind = /*#__PURE__*/ function(VendorsEntityKind) {
|
|
24
|
+
VendorsEntityKind["Vendor"] = "Vendor";
|
|
25
|
+
return VendorsEntityKind;
|
|
26
|
+
}({});
|
|
27
|
+
/** The read model (and so the shape) the records of each entity are queried from. */ const vendorsEntityPlural = {
|
|
28
|
+
["Vendor"]: 'Vendors'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the
|
|
32
|
+
* list, its saved views and column choices, the selection, the sections of the quick form, and what the record page shows.
|
|
33
|
+
*/ const vendorsQueriesOf = (entity)=>({
|
|
34
|
+
rows: vendorsEntityPlural[entity],
|
|
35
|
+
columns: `${entity}Columns`,
|
|
36
|
+
filterFields: `${entity}FilterFields`,
|
|
37
|
+
views: `${entity}Views`,
|
|
38
|
+
columnChoices: `${entity}ColumnChoices`,
|
|
39
|
+
selection: `${entity}Selection`,
|
|
40
|
+
quickSections: `${entity}QuickSections`,
|
|
41
|
+
record: `${entity}Record`,
|
|
42
|
+
sections: `${entity}Sections`,
|
|
43
|
+
summary: `${entity}Summary`,
|
|
44
|
+
activity: `${entity}Activity`,
|
|
45
|
+
tabs: `${entity}Tabs`
|
|
46
|
+
});
|
|
47
|
+
/** The locale and currency of the data, bound onto every component that formats a figure or a date. */ const localeOfData = {
|
|
48
|
+
locale: fromQuery(VendorsQuery.Settings, '0.locale')
|
|
49
|
+
};
|
|
50
|
+
const currencyOfData = {
|
|
51
|
+
...localeOfData,
|
|
52
|
+
currency: fromQuery(VendorsQuery.Settings, '0.currency')
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { VendorsEntityKind, VendorsQuery, currencyOfData, fromQuery, localeOfData, vendorsEntityPlural, vendorsQueriesOf };
|
|
56
|
+
//# sourceMappingURL=vendorsQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsQueries.js","sources":["../../vendorsQueries.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 { BindingExpression, BindingSourceKind } from '@cratis/scene.model';\n\n/**\n * A property taken from a query result - never a value. A vendors template declares *where* its data comes from and the sample-data pack, or the real\n * query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).\n */\nexport const fromQuery = (query: string, path = ''): BindingExpression => ({ kind: BindingSourceKind.QueryResult, query, path });\n\n/** The queries of the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */\nexport const VendorsQuery = {\n /** One row: the `locale` and `currency` the figures and dates are formatted in. */\n Settings: 'VendorsSettings',\n OnboardingColumns: 'OnboardingColumns',\n OnboardingCards: 'OnboardingCards',\n Kpis: 'VendorsKpis',\n SpendByCategory: 'VendorsSpendByCategory',\n OnTimeDelivery: 'VendorsOnTimeDelivery',\n Activity: 'VendorsActivity',\n FormErrors: 'VendorsFormErrors',\n} as const;\n\n/** The entities a template is made for. */\nexport enum VendorsEntityKind {\n Vendor = 'Vendor',\n}\n\n/** The read model (and so the shape) the records of each entity are queried from. */\nexport const vendorsEntityPlural: Record<VendorsEntityKind, string> = {\n [VendorsEntityKind.Vendor]: 'Vendors',\n};\n\n/**\n * The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the\n * list, its saved views and column choices, the selection, the sections of the quick form, and what the record page shows.\n */\nexport const vendorsQueriesOf = (entity: VendorsEntityKind) => ({\n rows: vendorsEntityPlural[entity],\n columns: `${entity}Columns`,\n filterFields: `${entity}FilterFields`,\n views: `${entity}Views`,\n columnChoices: `${entity}ColumnChoices`,\n selection: `${entity}Selection`,\n quickSections: `${entity}QuickSections`,\n record: `${entity}Record`,\n sections: `${entity}Sections`,\n summary: `${entity}Summary`,\n activity: `${entity}Activity`,\n tabs: `${entity}Tabs`,\n});\n\n/** The locale and currency of the data, bound onto every component that formats a figure or a date. */\nexport const localeOfData = { locale: fromQuery(VendorsQuery.Settings, '0.locale') };\nexport const currencyOfData = { ...localeOfData, currency: fromQuery(VendorsQuery.Settings, '0.currency') };\n"],"names":["fromQuery","query","path","kind","BindingSourceKind","QueryResult","VendorsQuery","Settings","OnboardingColumns","OnboardingCards","Kpis","SpendByCategory","OnTimeDelivery","Activity","FormErrors","VendorsEntityKind","vendorsEntityPlural","vendorsQueriesOf","entity","rows","columns","filterFields","views","columnChoices","selection","quickSections","record","sections","summary","activity","tabs","localeOfData","locale","currencyOfData","currency"],"mappings":";;AAAA;AACA;AAIA;;;UAIaA,SAAAA,GAAY,CAACC,OAAeC,IAAAA,GAAO,EAAE,IAAyB;AAAEC,QAAAA,IAAAA,EAAMC,kBAAkBC,WAAW;AAAEJ,QAAAA,KAAAA;AAAOC,QAAAA;AAAK,KAAA;AAE9H,qHACO,MAAMI,YAAAA,GAAe;AACxB,wFACAC,QAAAA,EAAU,iBAAA;IACVC,iBAAAA,EAAmB,mBAAA;IACnBC,eAAAA,EAAiB,iBAAA;IACjBC,IAAAA,EAAM,aAAA;IACNC,eAAAA,EAAiB,wBAAA;IACjBC,cAAAA,EAAgB,uBAAA;IAChBC,QAAAA,EAAU,iBAAA;IACVC,UAAAA,EAAY;AAChB;AAEA,4CACO,IAAKC,iBAAAA,iBAAAA,SAAAA,iBAAAA,EAAAA;;AAAAA,IAAAA,OAAAA,iBAAAA;AAEX,CAAA,CAAA,EAAA;AAED,sFACO,MAAMC,mBAAAA,GAAyD;AAClE,IAAA,CAAA,QAAA,GAA4B;AAChC;AAEA;;;AAGC,IACM,MAAMC,gBAAAA,GAAmB,CAACC,UAA+B;QAC5DC,IAAAA,EAAMH,mBAAmB,CAACE,MAAAA,CAAO;QACjCE,OAAAA,EAAS,CAAA,EAAGF,MAAAA,CAAO,OAAO,CAAC;QAC3BG,YAAAA,EAAc,CAAA,EAAGH,MAAAA,CAAO,YAAY,CAAC;QACrCI,KAAAA,EAAO,CAAA,EAAGJ,MAAAA,CAAO,KAAK,CAAC;QACvBK,aAAAA,EAAe,CAAA,EAAGL,MAAAA,CAAO,aAAa,CAAC;QACvCM,SAAAA,EAAW,CAAA,EAAGN,MAAAA,CAAO,SAAS,CAAC;QAC/BO,aAAAA,EAAe,CAAA,EAAGP,MAAAA,CAAO,aAAa,CAAC;QACvCQ,MAAAA,EAAQ,CAAA,EAAGR,MAAAA,CAAO,MAAM,CAAC;QACzBS,QAAAA,EAAU,CAAA,EAAGT,MAAAA,CAAO,QAAQ,CAAC;QAC7BU,OAAAA,EAAS,CAAA,EAAGV,MAAAA,CAAO,OAAO,CAAC;QAC3BW,QAAAA,EAAU,CAAA,EAAGX,MAAAA,CAAO,QAAQ,CAAC;QAC7BY,IAAAA,EAAM,CAAA,EAAGZ,MAAAA,CAAO,IAAI;AACxB,KAAA;AAEA,wGACO,MAAMa,YAAAA,GAAe;IAAEC,MAAAA,EAAQhC,SAAAA,CAAUM,YAAAA,CAAaC,QAAQ,EAAE,UAAA;AAAY;MACtE0B,cAAAA,GAAiB;AAAE,IAAA,GAAGF,YAAY;IAAEG,QAAAA,EAAUlC,SAAAA,CAAUM,YAAAA,CAAaC,QAAQ,EAAE,YAAA;AAAc;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BlueprintScreen } from '@cratis/scene.model';
|
|
2
|
+
export interface VendorsScreenDefinition extends BlueprintScreen {
|
|
3
|
+
template: string;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const vendorsScreenDefinitions: VendorsScreenDefinition[];
|
|
7
|
+
//# sourceMappingURL=vendorsScreenSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsScreenSet.d.ts","sourceRoot":"","sources":["../../vendorsScreenSet.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB;AAMD,eAAO,MAAM,wBAAwB,EAAE,uBAAuB,EAK7D,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure
|
|
5
|
+
* and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.
|
|
6
|
+
*/ const vendorsScreenDefinitions = [
|
|
7
|
+
{
|
|
8
|
+
name: 'vendors.list',
|
|
9
|
+
title: 'Vendors',
|
|
10
|
+
template: 'VendorsList',
|
|
11
|
+
order: 0,
|
|
12
|
+
description: 'Every vendor with what you spend with them and how they perform.'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'vendors.record',
|
|
16
|
+
title: 'Vendor',
|
|
17
|
+
template: 'VendorPage',
|
|
18
|
+
parent: 'vendors.list',
|
|
19
|
+
description: 'One vendor: key facts, contacts, purchase orders, certificates and activity.'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'vendors.onboarding',
|
|
23
|
+
title: 'Onboarding',
|
|
24
|
+
template: 'VendorsOnboardingBoard',
|
|
25
|
+
order: 1,
|
|
26
|
+
description: 'Vendors in a column for each onboarding step: prospect, in review, approved and active.'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'vendors.performance',
|
|
30
|
+
title: 'Performance',
|
|
31
|
+
template: 'VendorsPerformance',
|
|
32
|
+
order: 2,
|
|
33
|
+
description: 'How vendors perform: spend, on-time delivery and the vendors to watch.'
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export { vendorsScreenDefinitions };
|
|
38
|
+
//# sourceMappingURL=vendorsScreenSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorsScreenSet.js","sources":["../../vendorsScreenSet.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 { BlueprintScreen } from '@cratis/scene.model';\n\n/** One ready-to-use screen: the qualified name that is also its place in the application (`vendors.list.record` would be the `record` feature of `list`). */\nexport interface VendorsScreenDefinition extends BlueprintScreen {\n template: string;\n description: string;\n}\n\n/**\n * The screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure\n * and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.\n */\nexport const vendorsScreenDefinitions: VendorsScreenDefinition[] = [\n { name: 'vendors.list', title: 'Vendors', template: 'VendorsList', order: 0, description: 'Every vendor with what you spend with them and how they perform.' },\n { name: 'vendors.record', title: 'Vendor', template: 'VendorPage', parent: 'vendors.list', description: 'One vendor: key facts, contacts, purchase orders, certificates and activity.' },\n { name: 'vendors.onboarding', title: 'Onboarding', template: 'VendorsOnboardingBoard', order: 1, description: 'Vendors in a column for each onboarding step: prospect, in review, approved and active.' },\n { name: 'vendors.performance', title: 'Performance', template: 'VendorsPerformance', order: 2, description: 'How vendors perform: spend, on-time delivery and the vendors to watch.' },\n];\n"],"names":["vendorsScreenDefinitions","name","title","template","order","description","parent"],"mappings":"AAAA;AACA;AAUA;;;UAIaA,wBAAAA,GAAsD;AAC/D,IAAA;QAAEC,IAAAA,EAAM,cAAA;QAAgBC,KAAAA,EAAO,SAAA;QAAWC,QAAAA,EAAU,aAAA;QAAeC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAAmE,KAAA;AAC7J,IAAA;QAAEJ,IAAAA,EAAM,gBAAA;QAAkBC,KAAAA,EAAO,QAAA;QAAUC,QAAAA,EAAU,YAAA;QAAcG,MAAAA,EAAQ,cAAA;QAAgBD,WAAAA,EAAa;AAA+E,KAAA;AACvL,IAAA;QAAEJ,IAAAA,EAAM,oBAAA;QAAsBC,KAAAA,EAAO,YAAA;QAAcC,QAAAA,EAAU,wBAAA;QAA0BC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAA0F,KAAA;AACxM,IAAA;QAAEJ,IAAAA,EAAM,qBAAA;QAAuBC,KAAAA,EAAO,aAAA;QAAeC,QAAAA,EAAU,oBAAA;QAAsBC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAAyE;;;"}
|
package/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
export * from './packageName';
|
|
5
|
+
export * from './templateProvenance';
|
|
6
|
+
export * from './vendorsQueries';
|
|
7
|
+
export * from './vendorsParts';
|
|
8
|
+
export * from './vendorsScreenSet';
|
|
9
|
+
export * from './templates';
|
|
10
|
+
export * from './screens';
|
|
11
|
+
export * from './navigation';
|
|
12
|
+
export * from './manifest';
|
|
13
|
+
export * from './blueprint';
|
|
14
|
+
export * from './vendorsApplication';
|
package/manifest.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
import { PackageKind, ScenePackage } from '@cratis/scene.model';
|
|
5
|
+
import { vendorsBlueprintName } from './packageName';
|
|
6
|
+
import { vendorsScreenDefinitions } from './vendorsScreenSet';
|
|
7
|
+
import { vendorsDialogTemplates, vendorsScreenTemplates } from './templates';
|
|
8
|
+
|
|
9
|
+
const description = 'Vendors for a purchasing team: a vendor list, a vendor page with its contacts, orders and certificates, an onboarding board and a performance dashboard.';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This blueprint's declaration. A domain blueprint depends on the foundation set (`Cratis.Blueprint.Default`) and reuses its layouts, slots,
|
|
13
|
+
* components and themes - it ships none of its own - and adds what is specific to the domain: templates, a ready-to-use screen set, sample data
|
|
14
|
+
* and thumbnails. The package `version` is the blueprint's version: it is what a template reference pins and what "update available" compares.
|
|
15
|
+
*/
|
|
16
|
+
export const vendorsBlueprintManifest: ScenePackage = {
|
|
17
|
+
name: vendorsBlueprintName,
|
|
18
|
+
version: '1.0.0',
|
|
19
|
+
kind: PackageKind.Blueprint,
|
|
20
|
+
dependencies: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],
|
|
21
|
+
components: [],
|
|
22
|
+
layouts: [],
|
|
23
|
+
screenTemplates: vendorsScreenTemplates.map(template => template.name),
|
|
24
|
+
dialogTemplates: vendorsDialogTemplates.map(template => template.name),
|
|
25
|
+
themes: [],
|
|
26
|
+
displayName: 'Vendors',
|
|
27
|
+
description,
|
|
28
|
+
module: '@cratis/scene.blueprint.vendors',
|
|
29
|
+
license: 'MIT',
|
|
30
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
|
|
31
|
+
sampleData: [{ id: 'vendors-en', title: 'Vendors · English', locale: 'en-GB', path: 'sampleData/vendors-en.json', description: 'English vendor data: twelve vendors from prospect to active, one vendor\'s contacts, purchase orders and certificates, the onboarding steps and performance figures.', columns: ['Vendor', 'Category', 'Country', 'Spend', 'Rating'], statusColumn: 'Status', statuses: { good: ['Active', 'Approved'], pending: ['Prospect', 'In review'], bad: ['Suspended'] } }],
|
|
32
|
+
blueprint: {
|
|
33
|
+
domain: 'vendors',
|
|
34
|
+
description,
|
|
35
|
+
thumbnail: 'thumbnails/vendors.svg',
|
|
36
|
+
screenSet: vendorsScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order }) => ({
|
|
37
|
+
name, title, description: screenDescription, template, ...(parent === undefined ? {} : { parent }), ...(order === undefined ? {} : { order }),
|
|
38
|
+
})),
|
|
39
|
+
defaultSampleData: 'vendors-en',
|
|
40
|
+
},
|
|
41
|
+
};
|
package/navigation.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
import { ApplicationStructure, NavigationModel, NavigationRegionKind, NavigationRegionMode } from '@cratis/scene.model';
|
|
5
|
+
import { vendorsScreenDefinitions } from './vendorsScreenSet';
|
|
6
|
+
|
|
7
|
+
/** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */
|
|
8
|
+
export const vendorsModule = 'vendors';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The application structure the screen set implies: one module, `vendors`, a feature for each screen and the sub-features beneath it (`vendors.record` is the
|
|
12
|
+
* `record` feature of the module). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.
|
|
13
|
+
*/
|
|
14
|
+
export const vendorsStructure: ApplicationStructure = (() => {
|
|
15
|
+
interface Node { id: string; name: string; features: Node[]; slices: never[] }
|
|
16
|
+
const root: Node = { id: vendorsModule, name: 'Vendors', features: [], slices: [] };
|
|
17
|
+
for (const screen of vendorsScreenDefinitions) {
|
|
18
|
+
let parent = root;
|
|
19
|
+
for (const id of screen.name.split('.').slice(1)) {
|
|
20
|
+
let node = parent.features.find(candidate => candidate.id === id);
|
|
21
|
+
if (!node) {
|
|
22
|
+
node = { id, name: screen.title, features: [], slices: [] };
|
|
23
|
+
parent.features.push(node);
|
|
24
|
+
}
|
|
25
|
+
parent = node;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return { modules: [{ id: root.id, name: root.name, features: root.features }] } as unknown as ApplicationStructure;
|
|
30
|
+
})();
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists
|
|
34
|
+
* the places a team goes: Vendors, Onboarding, Performance.
|
|
35
|
+
*/
|
|
36
|
+
export const vendorsNavigation: NavigationModel = {
|
|
37
|
+
application: {
|
|
38
|
+
logo: { image: '', title: 'Vendors' },
|
|
39
|
+
regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'vendors', title: 'Vendors', target: { module: vendorsModule } }] }],
|
|
40
|
+
},
|
|
41
|
+
modules: [{
|
|
42
|
+
module: vendorsModule,
|
|
43
|
+
regions: [{
|
|
44
|
+
region: NavigationRegionKind.Sidebar,
|
|
45
|
+
mode: NavigationRegionMode.Override,
|
|
46
|
+
items: [
|
|
47
|
+
{ id: 'list', title: 'Vendors', target: { module: vendorsModule, feature: 'list' } },
|
|
48
|
+
{ id: 'onboarding', title: 'Onboarding', target: { module: vendorsModule, feature: 'onboarding' } },
|
|
49
|
+
{ id: 'performance', title: 'Performance', target: { module: vendorsModule, feature: 'performance' } },
|
|
50
|
+
],
|
|
51
|
+
}],
|
|
52
|
+
}],
|
|
53
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,80 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"name": "@cratis/scene.blueprint.vendors",
|
|
3
|
+
"version": "4.71.0",
|
|
4
|
+
"description": "Vendors for a purchasing team: a vendor list, a vendor page with its contacts, orders and certificates, an onboarding board and a performance dashboard.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cratis",
|
|
7
|
+
"scene",
|
|
8
|
+
"react",
|
|
9
|
+
"ui",
|
|
10
|
+
"blueprint",
|
|
11
|
+
"vendors"
|
|
12
|
+
],
|
|
13
|
+
"author": "Cratis",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/Cratis/Scene.git"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"sampleData",
|
|
25
|
+
"thumbnails",
|
|
26
|
+
"blueprintCatalog.json",
|
|
27
|
+
"**/*.ts",
|
|
28
|
+
"**/*.tsx",
|
|
29
|
+
"!**/for_*/**"
|
|
30
|
+
],
|
|
31
|
+
"main": "dist/cjs/index.js",
|
|
32
|
+
"module": "dist/esm/index.js",
|
|
33
|
+
"types": "dist/esm/index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
"./package.json": "./package.json",
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/esm/index.d.ts",
|
|
38
|
+
"require": "./dist/cjs/index.js",
|
|
39
|
+
"import": "./dist/esm/index.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"prepare": "yarn g:build",
|
|
44
|
+
"clean": "yarn g:clean",
|
|
45
|
+
"build": "yarn g:build",
|
|
46
|
+
"lint": "yarn g:lint",
|
|
47
|
+
"lint:ci": "yarn g:lint:ci",
|
|
48
|
+
"test": "yarn g:test",
|
|
49
|
+
"test:browser": "yarn g:test --config ./vitest.browser.config.mts",
|
|
50
|
+
"ci": "yarn g:ci",
|
|
51
|
+
"up": "yarn g:up"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@cratis/scene.blueprint.default": "4.71.0",
|
|
55
|
+
"@cratis/scene.engine": "4.71.0",
|
|
56
|
+
"@cratis/scene.model": "4.71.0",
|
|
57
|
+
"@cratis/scene.react": "4.71.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@cratis/scene.blueprint.default": "4.71.0",
|
|
61
|
+
"@cratis/scene.engine": "4.71.0",
|
|
62
|
+
"@cratis/scene.model": "4.71.0",
|
|
63
|
+
"@cratis/scene.react": "4.71.0",
|
|
64
|
+
"@primereact/core": "11.2.0",
|
|
65
|
+
"@primereact/headless": "11.2.0",
|
|
66
|
+
"primeicons": "8.0.2",
|
|
67
|
+
"primereact": "11.2.0",
|
|
68
|
+
"react": "^19.3.0",
|
|
69
|
+
"react-dom": "^19.3.0"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"@cratis/components": "^4.1.1",
|
|
73
|
+
"@primereact/core": "^11.0.0",
|
|
74
|
+
"@primereact/headless": "^11.0.0",
|
|
75
|
+
"primeicons": "^8.0.0",
|
|
76
|
+
"primereact": "^11.0.0",
|
|
77
|
+
"react": "^19.0.0",
|
|
78
|
+
"react-dom": "^19.0.0"
|
|
79
|
+
}
|
|
6
80
|
}
|
package/packageName.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
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 name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */
|
|
5
|
+
export const vendorsBlueprintName = 'Cratis.Blueprint.Vendors';
|