@cratis/scene.blueprint.contracts 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/contractsApplication.ts +28 -0
- package/contractsParts.ts +58 -0
- package/contractsQueries.ts +56 -0
- package/contractsScreenSet.ts +21 -0
- package/dist/cjs/blueprint.js +19 -0
- package/dist/cjs/blueprint.js.map +1 -0
- package/dist/cjs/contractsApplication.js +49 -0
- package/dist/cjs/contractsApplication.js.map +1 -0
- package/dist/cjs/contractsParts.js +151 -0
- package/dist/cjs/contractsParts.js.map +1 -0
- package/dist/cjs/contractsQueries.js +64 -0
- package/dist/cjs/contractsQueries.js.map +1 -0
- package/dist/cjs/contractsScreenSet.js +40 -0
- package/dist/cjs/contractsScreenSet.js.map +1 -0
- package/dist/cjs/index.js +68 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/manifest.js +88 -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/formTemplates.js +50 -0
- package/dist/cjs/templates/formTemplates.js.map +1 -0
- package/dist/cjs/templates/inboxTemplate.js +55 -0
- package/dist/cjs/templates/inboxTemplate.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/templates/timelineTemplate.js +85 -0
- package/dist/cjs/templates/timelineTemplate.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/contractsApplication.d.ts +10 -0
- package/dist/esm/contractsApplication.d.ts.map +1 -0
- package/dist/esm/contractsApplication.js +44 -0
- package/dist/esm/contractsApplication.js.map +1 -0
- package/dist/esm/contractsParts.d.ts +16 -0
- package/dist/esm/contractsParts.d.ts.map +1 -0
- package/dist/esm/contractsParts.js +133 -0
- package/dist/esm/contractsParts.js.map +1 -0
- package/dist/esm/contractsQueries.d.ts +38 -0
- package/dist/esm/contractsQueries.d.ts.map +1 -0
- package/dist/esm/contractsQueries.js +56 -0
- package/dist/esm/contractsQueries.js.map +1 -0
- package/dist/esm/contractsScreenSet.d.ts +7 -0
- package/dist/esm/contractsScreenSet.d.ts.map +1 -0
- package/dist/esm/contractsScreenSet.js +38 -0
- package/dist/esm/contractsScreenSet.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 +86 -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/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/inboxTemplate.d.ts +3 -0
- package/dist/esm/templates/inboxTemplate.d.ts.map +1 -0
- package/dist/esm/templates/inboxTemplate.js +53 -0
- package/dist/esm/templates/inboxTemplate.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/templates/timelineTemplate.d.ts +3 -0
- package/dist/esm/templates/timelineTemplate.d.ts.map +1 -0
- package/dist/esm/templates/timelineTemplate.js +83 -0
- package/dist/esm/templates/timelineTemplate.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +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/contracts-en.json +892 -0
- package/screens/index.ts +20 -0
- package/templateProvenance.ts +15 -0
- package/templates/formTemplates.ts +33 -0
- package/templates/inboxTemplate.ts +24 -0
- package/templates/index.ts +18 -0
- package/templates/listTemplates.ts +96 -0
- package/templates/recordTemplates.ts +78 -0
- package/templates/timelineTemplate.ts +54 -0
- package/thumbnails/ContractPage.svg +17 -0
- package/thumbnails/ContractsList.svg +29 -0
- package/thumbnails/ContractsQuickCreateContract.svg +12 -0
- package/thumbnails/ContractsReview.svg +19 -0
- package/thumbnails/ContractsTimeline.svg +11 -0
- package/thumbnails/contracts.svg +14 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var listTemplates = require('./listTemplates.js');
|
|
4
|
+
var recordTemplates = require('./recordTemplates.js');
|
|
5
|
+
var timelineTemplate = require('./timelineTemplate.js');
|
|
6
|
+
var inboxTemplate = require('./inboxTemplate.js');
|
|
7
|
+
var formTemplates = require('./formTemplates.js');
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
10
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
11
|
+
/** Every screen template this blueprint provides, in the order the manifest lists them. */ const contractsScreenTemplates = [
|
|
12
|
+
listTemplates.contractsListTemplate,
|
|
13
|
+
recordTemplates.contractPageTemplate,
|
|
14
|
+
timelineTemplate.contractsTimelineTemplate,
|
|
15
|
+
inboxTemplate.contractsReviewTemplate
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
exports.contractsListTemplate = listTemplates.contractsListTemplate;
|
|
19
|
+
exports.contractPageTemplate = recordTemplates.contractPageTemplate;
|
|
20
|
+
exports.contractsTimelineTemplate = timelineTemplate.contractsTimelineTemplate;
|
|
21
|
+
exports.contractsReviewTemplate = inboxTemplate.contractsReviewTemplate;
|
|
22
|
+
exports.contractsDialogTemplates = formTemplates.contractsDialogs;
|
|
23
|
+
exports.contractsDialogs = formTemplates.contractsDialogs;
|
|
24
|
+
exports.contractsScreenTemplates = contractsScreenTemplates;
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../templates/index.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 { contractsListTemplate } from './listTemplates';\nimport { contractPageTemplate } from './recordTemplates';\nimport { contractsTimelineTemplate } from './timelineTemplate';\nimport { contractsReviewTemplate } from './inboxTemplate';\n\nexport * from './listTemplates';\nexport * from './recordTemplates';\nexport * from './timelineTemplate';\nexport * from './inboxTemplate';\nexport * from './formTemplates';\n\n/** Every screen template this blueprint provides, in the order the manifest lists them. */\nexport const contractsScreenTemplates = [contractsListTemplate, contractPageTemplate, contractsTimelineTemplate, contractsReviewTemplate];\n\nexport { contractsDialogs as contractsDialogTemplates } from './formTemplates';\n"],"names":["contractsScreenTemplates","contractsListTemplate","contractPageTemplate","contractsTimelineTemplate","contractsReviewTemplate"],"mappings":";;;;;;;;AAAA;AACA;AAaA,4FACO,MAAMA,wBAAAA,GAA2B;AAACC,IAAAA,mCAAAA;AAAuBC,IAAAA,oCAAAA;AAAsBC,IAAAA,0CAAAA;AAA2BC,IAAAA;;;;;;;;;"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var contractsQueries = require('../contractsQueries.js');
|
|
6
|
+
var contractsParts = require('../contractsParts.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
|
+
const listScopes = [
|
|
11
|
+
scene_model.TemplateScope.Module,
|
|
12
|
+
scene_model.TemplateScope.Feature
|
|
13
|
+
];
|
|
14
|
+
/** The Export button: it tells the user the export has started, which is what the shell does for a long-running action it does not wait on. */ const exportAction = (id)=>contractsParts.withBehaviors(contractsParts.actionButton(id, 'Export', 'secondary'), [
|
|
15
|
+
{
|
|
16
|
+
bindings: [
|
|
17
|
+
{
|
|
18
|
+
trigger: {
|
|
19
|
+
kind: scene_model.InteractionTriggerKind.Click
|
|
20
|
+
},
|
|
21
|
+
actions: [
|
|
22
|
+
{
|
|
23
|
+
kind: scene_model.InteractionActionKind.Notify,
|
|
24
|
+
level: scene_model.NotificationLevel.Info,
|
|
25
|
+
message: {
|
|
26
|
+
text: 'The export has started.'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]);
|
|
34
|
+
/**
|
|
35
|
+
* One list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled for an entity. The slots, arrangement and
|
|
36
|
+
* every behavior - sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.
|
|
37
|
+
*/ function listTemplateOf(options) {
|
|
38
|
+
const queries = contractsQueries.contractsQueriesOf(options.entity);
|
|
39
|
+
const id = options.name;
|
|
40
|
+
const listId = `${id}-records`;
|
|
41
|
+
const primary = contractsParts.withBehaviors(contractsParts.actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? contractsParts.opensDialog(options.primary.dialog) : contractsParts.goesTo(options.primary.screen));
|
|
42
|
+
const list = scene_blueprint_default.component(listId, 'dataList', {
|
|
43
|
+
label: options.title,
|
|
44
|
+
rows: contractsQueries.fromQuery(queries.rows),
|
|
45
|
+
columns: contractsQueries.fromQuery(queries.columns),
|
|
46
|
+
titleField: options.titleField,
|
|
47
|
+
pageSize: options.cards ? 12 : 10,
|
|
48
|
+
urlKey: options.urlKey,
|
|
49
|
+
...contractsQueries.localeOfData,
|
|
50
|
+
rowActions: options.rowActions,
|
|
51
|
+
...options.readOnly ? {} : {
|
|
52
|
+
selectionMode: options.recordScreen || options.recordDialog ? 'single' : 'multiple'
|
|
53
|
+
},
|
|
54
|
+
...options.cards ? {
|
|
55
|
+
variant: 'cards',
|
|
56
|
+
...options.cards.imageField ? {
|
|
57
|
+
imageField: options.cards.imageField
|
|
58
|
+
} : {}
|
|
59
|
+
} : {},
|
|
60
|
+
...options.grouped ? {
|
|
61
|
+
variant: 'grouped',
|
|
62
|
+
groupBy: options.grouped.groupBy
|
|
63
|
+
} : {},
|
|
64
|
+
...options.toneField ? {
|
|
65
|
+
toneField: options.toneField
|
|
66
|
+
} : {}
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
name: options.name,
|
|
70
|
+
fitsSlot: 'content',
|
|
71
|
+
slots: scene_blueprint_default.listScreenTemplate.slots,
|
|
72
|
+
arrangement: scene_blueprint_default.listScreenTemplate.arrangement,
|
|
73
|
+
content: {
|
|
74
|
+
header: [
|
|
75
|
+
scene_blueprint_default.component(`${id}-header`, 'pageHeader', {
|
|
76
|
+
title: options.title,
|
|
77
|
+
subtitle: options.subtitle
|
|
78
|
+
}, {
|
|
79
|
+
actions: [
|
|
80
|
+
exportAction(`${id}-export`),
|
|
81
|
+
primary
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
],
|
|
85
|
+
toolbar: [
|
|
86
|
+
scene_blueprint_default.component(`${id}-search`, 'globalSearch', {
|
|
87
|
+
placeholder: options.searchLabel,
|
|
88
|
+
label: options.searchLabel,
|
|
89
|
+
urlKey: `${options.urlKey}q`
|
|
90
|
+
}),
|
|
91
|
+
scene_blueprint_default.component(`${id}-views`, 'savedViewsMenu', {
|
|
92
|
+
views: contractsQueries.fromQuery(queries.views),
|
|
93
|
+
savePermission: 'enabled',
|
|
94
|
+
managePermission: 'enabled'
|
|
95
|
+
}),
|
|
96
|
+
scene_blueprint_default.component(`${id}-columns`, 'columnChooser', {
|
|
97
|
+
columns: contractsQueries.fromQuery(queries.columnChoices)
|
|
98
|
+
})
|
|
99
|
+
],
|
|
100
|
+
filters: [
|
|
101
|
+
scene_blueprint_default.component(`${id}-filter`, 'filterBuilder', {
|
|
102
|
+
fields: contractsQueries.fromQuery(queries.filterFields),
|
|
103
|
+
...contractsQueries.localeOfData
|
|
104
|
+
})
|
|
105
|
+
],
|
|
106
|
+
list: [
|
|
107
|
+
options.recordScreen ? contractsParts.withBehaviors(list, contractsParts.opensRecordOnSelect(listId, options.recordScreen)) : options.recordDialog ? contractsParts.withBehaviors(list, contractsParts.opensDialogOnSelect(options.recordDialog)) : list
|
|
108
|
+
],
|
|
109
|
+
bulkBar: options.recordScreen || options.recordDialog || options.readOnly ? [] : [
|
|
110
|
+
scene_blueprint_default.component(`${id}-bulk`, 'bulkBar', {
|
|
111
|
+
selection: contractsQueries.fromQuery(queries.selection),
|
|
112
|
+
actions: options.bulkActions
|
|
113
|
+
})
|
|
114
|
+
],
|
|
115
|
+
footer: []
|
|
116
|
+
},
|
|
117
|
+
displayName: options.displayName,
|
|
118
|
+
description: options.description,
|
|
119
|
+
metadata: contractsParts.contractsMetadata(options.name, 'List', listScopes)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/** The contracts: every contract with its counterparty, type, end date, value and status. Choosing a contract opens it. */ const contractsListTemplate = listTemplateOf({
|
|
123
|
+
name: 'ContractsList',
|
|
124
|
+
entity: contractsQueries.ContractsEntityKind.Contract,
|
|
125
|
+
displayName: 'Contracts list',
|
|
126
|
+
description: 'Every contract with its counterparty, type, end date, value and status, filtered by status, type, owner and date.',
|
|
127
|
+
title: 'Contracts',
|
|
128
|
+
subtitle: 'Every agreement you are bound by',
|
|
129
|
+
searchLabel: 'Search contracts',
|
|
130
|
+
urlKey: 'contracts',
|
|
131
|
+
primary: {
|
|
132
|
+
label: 'New contract',
|
|
133
|
+
dialog: 'ContractsQuickCreateContract'
|
|
134
|
+
},
|
|
135
|
+
rowActions: [
|
|
136
|
+
'Open',
|
|
137
|
+
'Start renewal'
|
|
138
|
+
],
|
|
139
|
+
bulkActions: [],
|
|
140
|
+
titleField: 'title',
|
|
141
|
+
recordScreen: 'contracts.record'
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
exports.contractsListTemplate = contractsListTemplate;
|
|
145
|
+
//# 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 { InteractionActionKind, InteractionTriggerKind, NotificationLevel, NotifyAction, ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { listScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { ContractsEntityKind, fromQuery, contractsQueriesOf, localeOfData } from '../contractsQueries';\nimport { actionButton, component, goesTo, contractsMetadata, opensDialog, opensDialogOnSelect, opensRecordOnSelect, withBehaviors } from '../contractsParts';\n\nconst listScopes = [TemplateScope.Module, TemplateScope.Feature];\n\n/** The Export button: it tells the user the export has started, which is what the shell does for a long-running action it does not wait on. */\nconst exportAction = (id: string) => withBehaviors(actionButton(id, 'Export', 'secondary'), [{\n bindings: [{\n trigger: { kind: InteractionTriggerKind.Click },\n actions: [{ kind: InteractionActionKind.Notify, level: NotificationLevel.Info, message: { text: 'The export has started.' } } as unknown as NotifyAction],\n }],\n}]);\n\ninterface ListOptions {\n name: string;\n entity: ContractsEntityKind;\n displayName: string;\n description: string;\n title: string;\n subtitle: string;\n searchLabel: string;\n urlKey: string;\n /** The primary action of the header: a quick-create dialog to open, or a screen to go to. */\n primary: { label: string; dialog?: string; screen?: string };\n rowActions: string[];\n bulkActions: string[];\n titleField: string;\n /** The screen a chosen row opens; the list then selects one row at a time. Absent, rows are selected many at a time for the bulk bar. */\n recordScreen?: string;\n /** The side sheet a chosen row opens instead of a record page; the list then selects one row at a time. */\n recordDialog?: string;\n /** Group the rows (`variant: grouped`) by this field. */\n grouped?: { groupBy: string };\n /** Rows are not selectable at all: a record of what happened, which nobody edits. */\n readOnly?: boolean;\n /** Show the records as cards, each with the picture its `imageField` names. */\n cards?: { imageField?: string };\n /** Tint a row by the tone in this field (always beside a status column that says the same in words). */\n toneField?: string;\n}\n\n/**\n * One list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled for an entity. The slots, arrangement and\n * every behavior - sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.\n */\nfunction listTemplateOf(options: ListOptions): ScreenTemplate {\n const queries = contractsQueriesOf(options.entity);\n const id = options.name;\n const listId = `${id}-records`;\n const primary = withBehaviors(actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? opensDialog(options.primary.dialog) : goesTo(options.primary.screen!));\n const list = component(listId, 'dataList', {\n label: options.title, rows: fromQuery(queries.rows), columns: fromQuery(queries.columns), titleField: options.titleField, pageSize: options.cards ? 12 : 10, urlKey: options.urlKey, ...localeOfData,\n rowActions: options.rowActions,\n ...(options.readOnly ? {} : { selectionMode: options.recordScreen || options.recordDialog ? 'single' : 'multiple' }),\n ...(options.cards ? { variant: 'cards', ...(options.cards.imageField ? { imageField: options.cards.imageField } : {}) } : {}),\n ...(options.grouped ? { variant: 'grouped', groupBy: options.grouped.groupBy } : {}),\n ...(options.toneField ? { toneField: options.toneField } : {}),\n });\n\n return {\n name: options.name,\n fitsSlot: 'content',\n slots: listScreenTemplate.slots,\n arrangement: listScreenTemplate.arrangement,\n content: {\n header: [component(`${id}-header`, 'pageHeader', { title: options.title, subtitle: options.subtitle }, { actions: [exportAction(`${id}-export`), primary] })],\n toolbar: [\n component(`${id}-search`, 'globalSearch', { placeholder: options.searchLabel, label: options.searchLabel, urlKey: `${options.urlKey}q` }),\n component(`${id}-views`, 'savedViewsMenu', { views: fromQuery(queries.views), savePermission: 'enabled', managePermission: 'enabled' }),\n component(`${id}-columns`, 'columnChooser', { columns: fromQuery(queries.columnChoices) }),\n ],\n filters: [component(`${id}-filter`, 'filterBuilder', { fields: fromQuery(queries.filterFields), ...localeOfData })],\n list: [options.recordScreen ? withBehaviors(list, opensRecordOnSelect(listId, options.recordScreen)) : options.recordDialog ? withBehaviors(list, opensDialogOnSelect(options.recordDialog)) : list],\n bulkBar: options.recordScreen || options.recordDialog || options.readOnly ? [] : [component(`${id}-bulk`, 'bulkBar', { selection: fromQuery(queries.selection), actions: options.bulkActions })],\n footer: [],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: contractsMetadata(options.name, 'List', listScopes),\n };\n}\n\n\n/** The contracts: every contract with its counterparty, type, end date, value and status. Choosing a contract opens it. */\nexport const contractsListTemplate = listTemplateOf({\n name: 'ContractsList',\n entity: ContractsEntityKind.Contract, displayName: 'Contracts list', description: 'Every contract with its counterparty, type, end date, value and status, filtered by status, type, owner and date.', title: 'Contracts', subtitle: 'Every agreement you are bound by', searchLabel: 'Search contracts', urlKey: 'contracts',\n primary: { label: 'New contract', dialog: 'ContractsQuickCreateContract' },\n rowActions: ['Open', 'Start renewal'], bulkActions: [],\n titleField: 'title', recordScreen: 'contracts.record'\n});\n"],"names":["listScopes","TemplateScope","Module","Feature","exportAction","id","withBehaviors","actionButton","bindings","trigger","kind","InteractionTriggerKind","Click","actions","InteractionActionKind","Notify","level","NotificationLevel","Info","message","text","listTemplateOf","options","queries","contractsQueriesOf","entity","name","listId","primary","label","dialog","opensDialog","goesTo","screen","list","component","title","rows","fromQuery","columns","titleField","pageSize","cards","urlKey","localeOfData","rowActions","readOnly","selectionMode","recordScreen","recordDialog","variant","imageField","grouped","groupBy","toneField","fitsSlot","slots","listScreenTemplate","arrangement","content","header","subtitle","toolbar","placeholder","searchLabel","views","savePermission","managePermission","columnChoices","filters","fields","filterFields","opensRecordOnSelect","opensDialogOnSelect","bulkBar","selection","bulkActions","footer","displayName","description","metadata","contractsMetadata","contractsListTemplate","ContractsEntityKind","Contract"],"mappings":";;;;;;;AAAA;AACA;AAOA,MAAMA,UAAAA,GAAa;AAACC,IAAAA,yBAAAA,CAAcC,MAAM;AAAED,IAAAA,yBAAAA,CAAcE;AAAQ,CAAA;AAEhE,gJACA,MAAMC,YAAAA,GAAe,CAACC,KAAeC,4BAAAA,CAAcC,2BAAAA,CAAaF,EAAAA,EAAI,QAAA,EAAU,WAAA,CAAA,EAAc;AAAC,QAAA;YACzFG,QAAAA,EAAU;AAAC,gBAAA;oB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is/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var contractsQueries = require('../contractsQueries.js');
|
|
6
|
+
var contractsParts = require('../contractsParts.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
|
+
* One record page: the foundation `RecordPage` with the record's own title, its status and key facts at the top, its fields and the lists that belong to it in the
|
|
12
|
+
* main region, and the activity beside it. What it shows is the record the list handed it the id of.
|
|
13
|
+
*/ function recordPageOf(options) {
|
|
14
|
+
const queries = contractsQueries.contractsQueriesOf(options.entity);
|
|
15
|
+
const id = options.name;
|
|
16
|
+
return {
|
|
17
|
+
name: options.name,
|
|
18
|
+
fitsSlot: 'content',
|
|
19
|
+
slots: scene_blueprint_default.recordPageTemplate.slots,
|
|
20
|
+
arrangement: scene_blueprint_default.recordPageTemplate.arrangement,
|
|
21
|
+
content: {
|
|
22
|
+
header: [
|
|
23
|
+
scene_blueprint_default.component(`${id}-header`, 'pageHeader', {
|
|
24
|
+
title: contractsQueries.fromQuery(queries.record, `0.${options.titleField}`),
|
|
25
|
+
subtitle: contractsQueries.fromQuery(queries.record, '0.summary')
|
|
26
|
+
}, {
|
|
27
|
+
actions: [
|
|
28
|
+
contractsParts.withBehaviors(contractsParts.actionButton(`${id}-back`, options.backLabel, 'secondary'), contractsParts.goesTo(options.backScreen)),
|
|
29
|
+
...options.actions.map((action)=>contractsParts.withBehaviors(contractsParts.actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? contractsParts.opensDialog(action.dialog) : contractsParts.goesTo(action.screen)))
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
],
|
|
33
|
+
summary: [
|
|
34
|
+
scene_blueprint_default.component(`${id}-status`, 'statusChip', {
|
|
35
|
+
status: contractsQueries.fromQuery(queries.summary, '0.status'),
|
|
36
|
+
tone: contractsQueries.fromQuery(queries.summary, '0.tone')
|
|
37
|
+
}),
|
|
38
|
+
...options.facts.map((fact)=>scene_blueprint_default.component(`${id}-${fact.id}`, 'statCard', {
|
|
39
|
+
label: fact.label,
|
|
40
|
+
value: contractsQueries.fromQuery(queries.summary, `0.${fact.field}`),
|
|
41
|
+
...fact.format ? {
|
|
42
|
+
format: fact.format
|
|
43
|
+
} : {},
|
|
44
|
+
...contractsQueries.currencyOfData
|
|
45
|
+
}))
|
|
46
|
+
],
|
|
47
|
+
tabs: [
|
|
48
|
+
scene_blueprint_default.component(`${id}-tabs`, 'tabSet', {
|
|
49
|
+
tabs: contractsQueries.fromQuery(queries.tabs),
|
|
50
|
+
urlKey: 'tab',
|
|
51
|
+
label: `${options.displayName} sections`
|
|
52
|
+
})
|
|
53
|
+
],
|
|
54
|
+
main: [
|
|
55
|
+
scene_blueprint_default.component(`${id}-form`, 'formScreenBody', {
|
|
56
|
+
mode: 'readOnly',
|
|
57
|
+
sections: contractsQueries.fromQuery(queries.sections),
|
|
58
|
+
values: contractsQueries.fromQuery(queries.record, '0'),
|
|
59
|
+
...contractsQueries.currencyOfData
|
|
60
|
+
}),
|
|
61
|
+
...options.extras.map((extra)=>scene_blueprint_default.component(`${id}-${extra.key.toLowerCase()}`, 'dataList', {
|
|
62
|
+
label: extra.label,
|
|
63
|
+
rows: contractsQueries.fromQuery(`${options.entity}${extra.key}`),
|
|
64
|
+
columns: contractsQueries.fromQuery(`${options.entity}${extra.key}Columns`),
|
|
65
|
+
titleField: extra.titleField,
|
|
66
|
+
pageSize: extra.pageSize ?? 8,
|
|
67
|
+
...contractsQueries.currencyOfData
|
|
68
|
+
}))
|
|
69
|
+
],
|
|
70
|
+
related: [],
|
|
71
|
+
activity: [
|
|
72
|
+
scene_blueprint_default.component(`${id}-activity`, 'activityFeed', {
|
|
73
|
+
label: 'Activity',
|
|
74
|
+
entries: contractsQueries.fromQuery(queries.activity),
|
|
75
|
+
...contractsQueries.localeOfData
|
|
76
|
+
})
|
|
77
|
+
],
|
|
78
|
+
aside: []
|
|
79
|
+
},
|
|
80
|
+
displayName: options.displayName,
|
|
81
|
+
description: options.description,
|
|
82
|
+
metadata: contractsParts.contractsMetadata(options.name, 'Detail', [
|
|
83
|
+
scene_model.TemplateScope.Feature,
|
|
84
|
+
scene_model.TemplateScope.Subfeature
|
|
85
|
+
])
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** The contract page: the contract number as its title, its status, value, days to its end and notice period at the top, its details, parties, obligations and amendments in the main region, and the activity beside it. */ const contractPageTemplate = recordPageOf({
|
|
89
|
+
name: 'ContractPage',
|
|
90
|
+
entity: contractsQueries.ContractsEntityKind.Contract,
|
|
91
|
+
displayName: 'Contract page',
|
|
92
|
+
description: 'One contract: status, value, days to its end and notice period, its details, parties, obligations and amendments, and its activity.',
|
|
93
|
+
titleField: 'number',
|
|
94
|
+
backScreen: 'contracts.list',
|
|
95
|
+
backLabel: 'Back to contracts',
|
|
96
|
+
facts: [
|
|
97
|
+
{
|
|
98
|
+
id: 'value',
|
|
99
|
+
label: 'Contract value',
|
|
100
|
+
field: 'value',
|
|
101
|
+
format: 'currency'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'days',
|
|
105
|
+
label: 'Days to end',
|
|
106
|
+
field: 'daysToEnd'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: 'notice',
|
|
110
|
+
label: 'Notice (days)',
|
|
111
|
+
field: 'noticeDays'
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
extras: [
|
|
115
|
+
{
|
|
116
|
+
key: 'Parties',
|
|
117
|
+
label: 'Parties',
|
|
118
|
+
titleField: 'name'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
key: 'Obligations',
|
|
122
|
+
label: 'Obligations',
|
|
123
|
+
titleField: 'summary'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: 'Amendments',
|
|
127
|
+
label: 'Amendments',
|
|
128
|
+
titleField: 'number'
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
actions: []
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
exports.contractPageTemplate = contractPageTemplate;
|
|
135
|
+
//# sourceMappingURL=recordTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordTemplates.js","sources":["../../../templates/recordTemplates.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, TemplateScope } from '@cratis/scene.model';\nimport { recordPageTemplate } from '@cratis/scene.blueprint.default';\nimport { ContractsEntityKind, currencyOfData, fromQuery, localeOfData, contractsQueriesOf } from '../contractsQueries';\nimport { actionButton, component, goesTo, contractsMetadata, opensDialog, withBehaviors } from '../contractsParts';\n\ninterface Fact { id: string; label: string; field: string; format?: 'currency' | 'percent' }\ninterface Extra { key: string; label: string; titleField: string; pageSize?: number }\ninterface Action { id: string; label: string; emphasis: 'primary' | 'secondary' | 'quiet' | 'danger'; dialog?: string; screen?: string }\n\ninterface RecordOptions {\n name: string;\n entity: ContractsEntityKind;\n displayName: string;\n description: string;\n titleField: string;\n backScreen: string;\n backLabel: string;\n facts: Fact[];\n extras: Extra[];\n actions: Action[];\n}\n\n/**\n * One record page: the foundation `RecordPage` with the record's own title, its status and key facts at the top, its fields and the lists that belong to it in the\n * main region, and the activity beside it. What it shows is the record the list handed it the id of.\n */\nfunction recordPageOf(options: RecordOptions): ScreenTemplate {\n const queries = contractsQueriesOf(options.entity);\n const id = options.name;\n return {\n name: options.name,\n fitsSlot: 'content',\n slots: recordPageTemplate.slots,\n arrangement: recordPageTemplate.arrangement,\n content: {\n header: [component(`${id}-header`, 'pageHeader', { title: fromQuery(queries.record, `0.${options.titleField}`), subtitle: fromQuery(queries.record, '0.summary') }, {\n actions: [\n withBehaviors(actionButton(`${id}-back`, options.backLabel, 'secondary'), goesTo(options.backScreen)),\n ...options.actions.map(action => withBehaviors(actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? opensDialog(action.dialog) : goesTo(action.screen!))),\n ],\n })],\n summary: [\n component(`${id}-status`, 'statusChip', { status: fromQuery(queries.summary, '0.status'), tone: fromQuery(queries.summary, '0.tone') }),\n ...options.facts.map(fact => component(`${id}-${fact.id}`, 'statCard', {\n label: fact.label, value: fromQuery(queries.summary, `0.${fact.field}`), ...(fact.format ? { format: fact.format } : {}), ...currencyOfData,\n })),\n ],\n tabs: [component(`${id}-tabs`, 'tabSet', { tabs: fromQuery(queries.tabs), urlKey: 'tab', label: `${options.displayName} sections` })],\n main: [\n component(`${id}-form`, 'formScreenBody', { mode: 'readOnly', sections: fromQuery(queries.sections), values: fromQuery(queries.record, '0'), ...currencyOfData }),\n ...options.extras.map(extra => component(`${id}-${extra.key.toLowerCase()}`, 'dataList', {\n label: extra.label, rows: fromQuery(`${options.entity}${extra.key}`), columns: fromQuery(`${options.entity}${extra.key}Columns`), titleField: extra.titleField, pageSize: extra.pageSize ?? 8, ...currencyOfData,\n })),\n ],\n related: [],\n activity: [component(`${id}-activity`, 'activityFeed', { label: 'Activity', entries: fromQuery(queries.activity), ...localeOfData })],\n aside: [],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: contractsMetadata(options.name, 'Detail', [TemplateScope.Feature, TemplateScope.Subfeature]),\n };\n}\n\n/** The contract page: the contract number as its title, its status, value, days to its end and notice period at the top, its details, parties, obligations and amendments in the main region, and the activity beside it. */\nexport const contractPageTemplate = recordPageOf({\n name: 'ContractPage', entity: ContractsEntityKind.Contract, displayName: 'Contract page', description: 'One contract: status, value, days to its end and notice period, its details, parties, obligations and amendments, and its activity.', titleField: 'number', backScreen: 'contracts.list', backLabel: 'Back to contracts',\n facts: [\n { id: 'value', label: 'Contract value', field: 'value', format: 'currency' },\n { id: 'days', label: 'Days to end', field: 'daysToEnd' },\n { id: 'notice', label: 'Notice (days)', field: 'noticeDays' },\n ],\n extras: [{ key: 'Parties', label: 'Parties', titleField: 'name' }, { key: 'Obligations', label: 'Obligations', titleField: 'summary' }, { key: 'Amendments', label: 'Amendments', titleField: 'number' }],\n actions: [],\n});\n"],"names":["recordPageOf","options","queries","contractsQueriesOf","entity","id","name","fitsSlot","slots","recordPageTemplate","arrangement","content","header","component","title","fromQuery","record","titleField","subtitle","actions","withBehaviors","actionButton","backLabel","goesTo","backScreen","map","action","label","emphasis","dialog","opensDialog","screen","summary","status","tone","facts","fact","value","field","format","currencyOfData","tabs","urlKey","displayName","main","mode","sections","values","extras","extra","key","toLowerCase","rows","columns","pageSize","related","activity","entries","localeOfData","aside","description","metadata","contractsMetadata","TemplateScope","Feature","Subfeature","contractPageTemplate","ContractsEntityKind","Contract"],"mappings":";;;;;;;AAAA;AACA;AAwBA;;;IAIA,SAASA,aAAaC,OAAsB,EAAA;IACxC,MAAMC,OAAAA,GAAUC,mCAAAA,CAAmBF,OAAAA,CAAQG,MAAM,CAAA;IACjD,MAAMC,EAAAA,GAAKJ,QAAQK,IAAI;IACvB,OAAO;AACHA,QAAAA,IAAAA,EAAML,QAAQK,IAAI;QAClBC,QAAAA,EAAU,SAAA;AACVC,QAAAA,KAAAA,EAAOC,2CAAmBD,KAAK;AAC/BE,QAAAA,WAAAA,EAAaD,2CAAmBC,WAAW;QAC3CC,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,iCAAAA,CAAU,CAAA,EAAGR,EAAAA,CAAG,OAAO,CAAC,EAAE,YAAA,EAAc;oBAAES,KAAAA,EAAOC,0BAAAA,CAAUb,QAAQc,MAAM,EAAE,CAAC,EAAE,EAAEf,OAAAA,CAAQgB,UAAU,CAAA,CAAE,CAAA;oBAAGC,QAAAA,EAAUH,0BAAAA,CAAUb,OAAAA,CAAQc,MAAM,EAAE,WAAA;iBAAa,EAAG;oBAChKG,OAAAA,EAAS;AACLC,wBAAAA,4BAAAA,CAAcC,2BAAAA,CAAa,CAAA,EAAGhB,EAAAA,CAAG,KAAK,CAAC,EAAEJ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AAA,EAAI,QAAA;YAAUsB,KAAAA,EAAO,eAAA;YAAiBW,KAAAA,EAAO;AAAa;AAC/D,KAAA;IACDU,MAAAA,EAAQ;AAAC,QAAA;YAAEE,GAAAA,EAAK,SAAA;YAAWvB,KAAAA,EAAO,SAAA;YAAWV,UAAAA,EAAY;AAAO,SAAA;AAAG,QAAA;YAAEiC,GAAAA,EAAK,aAAA;YAAevB,KAAAA,EAAO,aAAA;YAAeV,UAAAA,EAAY;AAAU,SAAA;AAAG,QAAA;YAAEiC,GAAAA,EAAK,YAAA;YAAcvB,KAAAA,EAAO,YAAA;YAAcV,UAAAA,EAAY;AAAS;AAAE,KAAA;AACzME,IAAAA,OAAAA,EAAS;AACb,CAAA;;"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var contractsQueries = require('../contractsQueries.js');
|
|
6
|
+
var contractsParts = require('../contractsParts.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
|
+
* One timeline: the foundation `TimelineScreen` with every item as a bar in a lane, how far along it is, the milestones, what waits on what, and a conflict told in
|
|
12
|
+
* words when one lane's bars overlap. The scale is kept in the address; on a phone the schedule is the table, and the same items are listed beneath.
|
|
13
|
+
*/ function timelineOf(options) {
|
|
14
|
+
const id = options.name;
|
|
15
|
+
return {
|
|
16
|
+
name: options.name,
|
|
17
|
+
fitsSlot: 'content',
|
|
18
|
+
slots: scene_blueprint_default.timelineScreenTemplate.slots,
|
|
19
|
+
arrangement: scene_blueprint_default.timelineScreenTemplate.arrangement,
|
|
20
|
+
content: {
|
|
21
|
+
header: [
|
|
22
|
+
scene_blueprint_default.component(`${id}-header`, 'pageHeader', {
|
|
23
|
+
title: options.title,
|
|
24
|
+
subtitle: options.subtitle
|
|
25
|
+
}, {
|
|
26
|
+
actions: [
|
|
27
|
+
contractsParts.withBehaviors(contractsParts.actionButton(`${id}-back`, options.back.label, 'secondary'), contractsParts.goesTo(options.back.screen))
|
|
28
|
+
]
|
|
29
|
+
})
|
|
30
|
+
],
|
|
31
|
+
toolbar: [
|
|
32
|
+
scene_blueprint_default.component(`${id}-search`, 'globalSearch', {
|
|
33
|
+
placeholder: options.searchLabel,
|
|
34
|
+
label: options.searchLabel,
|
|
35
|
+
urlKey: 'timelineq'
|
|
36
|
+
})
|
|
37
|
+
],
|
|
38
|
+
timeline: [
|
|
39
|
+
scene_blueprint_default.component(`${id}-grid`, 'timelineGrid', {
|
|
40
|
+
label: options.label,
|
|
41
|
+
items: contractsQueries.fromQuery(options.items),
|
|
42
|
+
today: contractsQueries.fromQuery(contractsQueries.ContractsQuery.Settings, '0.today'),
|
|
43
|
+
firstDay: contractsQueries.fromQuery(contractsQueries.ContractsQuery.Settings, '0.firstDay'),
|
|
44
|
+
urlKey: 'scale',
|
|
45
|
+
...contractsQueries.localeOfData
|
|
46
|
+
})
|
|
47
|
+
],
|
|
48
|
+
list: [
|
|
49
|
+
scene_blueprint_default.component(`${id}-list`, 'dataList', {
|
|
50
|
+
label: options.listLabel,
|
|
51
|
+
rows: contractsQueries.fromQuery(options.items),
|
|
52
|
+
columns: contractsQueries.fromQuery(options.columns),
|
|
53
|
+
titleField: 'title',
|
|
54
|
+
pageSize: 8,
|
|
55
|
+
...contractsQueries.localeOfData
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
displayName: options.displayName,
|
|
60
|
+
description: options.description,
|
|
61
|
+
metadata: contractsParts.contractsMetadata(options.name, 'Timeline', [
|
|
62
|
+
scene_model.TemplateScope.Module,
|
|
63
|
+
scene_model.TemplateScope.Feature
|
|
64
|
+
])
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/** The contracts timeline: each live contract as a bar in a lane for its counterparty, how far through its term it is, and a milestone for each notice date; the list beneath names the same terms. */ const contractsTimelineTemplate = timelineOf({
|
|
68
|
+
name: 'ContractsTimeline',
|
|
69
|
+
displayName: 'Contracts timeline',
|
|
70
|
+
description: 'Every live contract as a bar from start to end in a lane for each counterparty, with how far through it is and the notice dates that matter.',
|
|
71
|
+
title: 'Timeline',
|
|
72
|
+
subtitle: 'Terms and notice dates by counterparty',
|
|
73
|
+
label: 'Contract terms',
|
|
74
|
+
listLabel: 'Terms',
|
|
75
|
+
searchLabel: 'Search the timeline',
|
|
76
|
+
items: contractsQueries.ContractsQuery.ContractTimelineItems,
|
|
77
|
+
columns: contractsQueries.ContractsQuery.ContractTimelineColumns,
|
|
78
|
+
back: {
|
|
79
|
+
label: 'Open the contracts',
|
|
80
|
+
screen: 'contracts.list'
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
exports.contractsTimelineTemplate = contractsTimelineTemplate;
|
|
85
|
+
//# sourceMappingURL=timelineTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timelineTemplate.js","sources":["../../../templates/timelineTemplate.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, TemplateScope } from '@cratis/scene.model';\nimport { timelineScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { ContractsQuery, fromQuery, localeOfData } from '../contractsQueries';\nimport { actionButton, component, goesTo, contractsMetadata, withBehaviors } from '../contractsParts';\n\ninterface TimelineOptions {\n name: string;\n displayName: string;\n description: string;\n title: string;\n subtitle: string;\n label: string;\n listLabel: string;\n searchLabel: string;\n items: string;\n columns: string;\n back: { label: string; screen: string };\n}\n\n/**\n * One timeline: the foundation `TimelineScreen` with every item as a bar in a lane, how far along it is, the milestones, what waits on what, and a conflict told in\n * words when one lane's bars overlap. The scale is kept in the address; on a phone the schedule is the table, and the same items are listed beneath.\n */\nfunction timelineOf(options: TimelineOptions): ScreenTemplate {\n const id = options.name;\n return {\n name: options.name,\n fitsSlot: 'content',\n slots: timelineScreenTemplate.slots,\n arrangement: timelineScreenTemplate.arrangement,\n content: {\n header: [component(`${id}-header`, 'pageHeader', { title: options.title, subtitle: options.subtitle }, {\n actions: [withBehaviors(actionButton(`${id}-back`, options.back.label, 'secondary'), goesTo(options.back.screen))],\n })],\n toolbar: [component(`${id}-search`, 'globalSearch', { placeholder: options.searchLabel, label: options.searchLabel, urlKey: 'timelineq' })],\n timeline: [component(`${id}-grid`, 'timelineGrid', {\n label: options.label, items: fromQuery(options.items), today: fromQuery(ContractsQuery.Settings, '0.today'), firstDay: fromQuery(ContractsQuery.Settings, '0.firstDay'), urlKey: 'scale', ...localeOfData,\n })],\n list: [component(`${id}-list`, 'dataList', { label: options.listLabel, rows: fromQuery(options.items), columns: fromQuery(options.columns), titleField: 'title', pageSize: 8, ...localeOfData })],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: contractsMetadata(options.name, 'Timeline', [TemplateScope.Module, TemplateScope.Feature]),\n };\n}\n\n/** The contracts timeline: each live contract as a bar in a lane for its counterparty, how far through its term it is, and a milestone for each notice date; the list beneath names the same terms. */\nexport const contractsTimelineTemplate = timelineOf({\n name: 'ContractsTimeline', displayName: 'Contracts timeline', description: 'Every live contract as a bar from start to end in a lane for each counterparty, with how far through it is and the notice dates that matter.', title: 'Timeline', subtitle: 'Terms and notice dates by counterparty', label: 'Contract terms', listLabel: 'Terms',\n searchLabel: 'Search the timeline', items: ContractsQuery.ContractTimelineItems, columns: ContractsQuery.ContractTimelineColumns, back: { label: 'Open the contracts', screen: 'contracts.list' },\n});\n"],"names":["timelineOf","options","id","name","fitsSlot","slots","timelineScreenTemplate","arrangement","content","header","component","title","subtitle","actions","withBehaviors","actionButton","back","label","goesTo","screen","toolbar","placeholder","searchLabel","urlKey","timeline","items","fromQuery","today","ContractsQuery","Settings","firstDay","localeOfData","list","listLabel","rows","columns","titleField","pageSize","displayName","description","metadata","contractsMetadata","TemplateScope","Module","Feature","contractsTimelineTemplate","ContractTimelineItems","ContractTimelineColumns"],"mappings":";;;;;;;AAAA;AACA;AAqBA;;;IAIA,SAASA,WAAWC,OAAwB,EAAA;IACxC,MAAMC,EAAAA,GAAKD,QAAQE,IAAI;IACvB,OAAO;AACHA,QAAAA,IAAAA,EAAMF,QAAQE,IAAI;QAClBC,QAAAA,EAAU,SAAA;AACVC,QAAAA,KAAAA,EAAOC,+CAAuBD,KAAK;AACnCE,QAAAA,WAAAA,EAAaD,+CAAuBC,WAAW;QAC/CC,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,iCAAAA,CAAU,CAAA,EAAGR,EAAAA,CAAG,OAAO,CAAC,EAAE,YAAA,EAAc;AAAES,oBAAAA,KAAAA,EAAOV,QAAQU,KAAK;AAAEC,oBAAAA,QAAAA,EAAUX,QAAQW;iBAAS,EAAG;oBACnGC,OAAAA,EAAS;AAACC,wBAAAA,4BAAAA,CAAcC,4BAAa,CAAA,EAAGb,EAAAA,CAAG,KAAK,CAAC,EAAED,OAAAA,CAAQe,IAAI,CAACC,KAAK,EAAE,WAAA,CAAA,EAAcC,qBAAAA,CAAOjB,OAAAA,CAAQe,IAAI,CAACG,MAAM,CAAA;AAAG;AACtH,iBAAA;AAAG,aAAA;YACHC,OAAAA,EAAS;AAACV,gBAAAA,iCAAAA,CAAU,CAAA,EAAGR,EAAAA,CAAG,OAAO,CAAC,EAAE,cAAA,EAAgB;AAAEmB,oBAAAA,WAAAA,EAAapB,QAAQqB,WAAW;AAAEL,oBAAAA,KAAAA,EAAOhB,QAAQqB,WAAW;oBAAEC,MAAAA,EAAQ;AAAY,iBAAA;AAAG,aAAA;YAC3IC,QAAAA,EAAU;AAACd,gBAAAA,iCAAAA,CAAU,CAAA,EAAGR,EAAAA,CAAG,KAAK,CAAC,EAAE,cAAA,EAAgB;AAC/Ce,oBAAAA,KAAAA,EAAOhB,QAAQgB,KAAK;oBA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,KAAAA,EAAOG,gCAAekB,qBAAqB;AAAEX,IAAAA,OAAAA,EAASP,gCAAemB,uBAAuB;IAAE/B,IAAAA,EAAM;QAAEC,KAAAA,EAAO,oBAAA;QAAsBE,MAAAA,EAAQ;AAAiB;AACpM,CAAA;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../blueprint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAMzD,eAAO,MAAM,kBAAkB,EAAE,kBAMhC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { contractsBlueprintManifest } from './manifest.js';
|
|
2
|
+
import { contractsScreens } from './screens/index.js';
|
|
3
|
+
import { contractsScreenTemplates } from './templates/index.js';
|
|
4
|
+
import { contractsDialogs } from './templates/formTemplates.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
|
+
/** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */ const contractsBlueprint = {
|
|
9
|
+
manifest: contractsBlueprintManifest,
|
|
10
|
+
components: {},
|
|
11
|
+
screenTemplates: contractsScreenTemplates,
|
|
12
|
+
dialogTemplates: contractsDialogs,
|
|
13
|
+
screens: contractsScreens
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { contractsBlueprint };
|
|
17
|
+
//# sourceMappingURL=blueprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.js","sources":["../../blueprint.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 { ScenePackageBundle } from '@cratis/scene.react';\nimport { contractsBlueprintManifest } from './manifest';\nimport { contractsScreens } from './screens';\nimport { contractsDialogTemplates, contractsScreenTemplates } from './templates';\n\n/** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */\nexport const contractsBlueprint: ScenePackageBundle = {\n manifest: contractsBlueprintManifest,\n components: {},\n screenTemplates: contractsScreenTemplates,\n dialogTemplates: contractsDialogTemplates,\n screens: contractsScreens,\n};\n"],"names":["contractsBlueprint","manifest","contractsBlueprintManifest","components","screenTemplates","contractsScreenTemplates","dialogTemplates","contractsDialogTemplates","screens","contractsScreens"],"mappings":";;;;;AAAA;AACA;AAOA,2JACO,MAAMA,kBAAAA,GAAyC;IAClDC,QAAAA,EAAUC,0BAAAA;AACVC,IAAAA,UAAAA,EAAY,EAAC;IACbC,eAAAA,EAAiBC,wBAAAA;IACjBC,eAAAA,EAAiBC,gBAAAA;IACjBC,OAAAA,EAASC;AACb;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApplicationStructureIndex } from '@cratis/scene.engine';
|
|
2
|
+
import { ApplicationDocument, CompositionOptions } from '@cratis/scene.blueprint.default';
|
|
3
|
+
export declare const contractsDefaultSampleDataId = "contracts-en";
|
|
4
|
+
export declare function contractsApplication(sampleData?: string): ApplicationDocument;
|
|
5
|
+
export declare const contractsComposition: CompositionOptions;
|
|
6
|
+
export declare const contractsNavigationModel: () => {
|
|
7
|
+
structure: ApplicationStructureIndex;
|
|
8
|
+
navigation: import("@cratis/scene.model").NavigationModel;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=contractsApplication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractsApplication.d.ts","sourceRoot":"","sources":["../../contractsApplication.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAkC,MAAM,iCAAiC,CAAC;AAM1H,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAO3D,wBAAgB,oBAAoB,CAAC,UAAU,GAAE,MAAqC,GAAG,mBAAmB,CAG3G;AAGD,eAAO,MAAM,oBAAoB,EAAE,kBAAmE,CAAC;AAGvG,eAAO,MAAM,wBAAwB;IAAY,SAAS;IAAqD,UAAU;CAAwB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ApplicationStructureIndex } from '@cratis/scene.engine';
|
|
2
|
+
import { previewProfile, defaultLayouts } from '@cratis/scene.blueprint.default';
|
|
3
|
+
import { contractsNavigation, contractsStructure } from './navigation.js';
|
|
4
|
+
import { contractsScreens } from './screens/index.js';
|
|
5
|
+
import { contractsScreenTemplates } from './templates/index.js';
|
|
6
|
+
import { contractsDialogs } 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 contractsDefaultSampleDataId = 'contracts-en';
|
|
11
|
+
/**
|
|
12
|
+
* The example application of the blueprint: the foundation's layouts, the Contracts 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/Contracts/contracts.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.
|
|
15
|
+
*/ function contractsApplication(sampleData = contractsDefaultSampleDataId) {
|
|
16
|
+
const profile = {
|
|
17
|
+
...previewProfile(undefined),
|
|
18
|
+
name: 'Contracts',
|
|
19
|
+
sampleData: {
|
|
20
|
+
activePack: sampleData,
|
|
21
|
+
mappings: [],
|
|
22
|
+
bindings: []
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
layouts: defaultLayouts,
|
|
27
|
+
screenTemplates: contractsScreenTemplates,
|
|
28
|
+
dialogTemplates: contractsDialogs,
|
|
29
|
+
screens: contractsScreens,
|
|
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 contractsComposition = {
|
|
36
|
+
logo: contractsNavigation.application.logo
|
|
37
|
+
};
|
|
38
|
+
/** The structure and navigation the shell's regions show and the items' destinations resolve against. */ const contractsNavigationModel = ()=>({
|
|
39
|
+
structure: new ApplicationStructureIndex(contractsStructure),
|
|
40
|
+
navigation: contractsNavigation
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export { contractsApplication, contractsComposition, contractsDefaultSampleDataId, contractsNavigationModel };
|
|
44
|
+
//# sourceMappingURL=contractsApplication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractsApplication.js","sources":["../../contractsApplication.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 { contractsNavigation, contractsStructure } from './navigation';\nimport { contractsScreens } from './screens';\nimport { contractsDialogTemplates, contractsScreenTemplates } from './templates';\n\n/** The id of the sample-data pack a new application starts with. */\nexport const contractsDefaultSampleDataId = 'contracts-en';\n\n/**\n * The example application of the blueprint: the foundation's layouts, the Contracts 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/Contracts/contracts.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.\n */\nexport function contractsApplication(sampleData: string = contractsDefaultSampleDataId): ApplicationDocument {\n const profile: UiProfile = { ...previewProfile(undefined), name: 'Contracts', sampleData: { activePack: sampleData, mappings: [], bindings: [] } };\n return { layouts: defaultLayouts, screenTemplates: contractsScreenTemplates, dialogTemplates: contractsDialogTemplates, screens: contractsScreens, uiProfiles: [profile] };\n}\n\n/** What a host composes the screens with: the application's logo, which the shell's topbar shows. */\nexport const contractsComposition: CompositionOptions = { logo: contractsNavigation.application.logo };\n\n/** The structure and navigation the shell's regions show and the items' destinations resolve against. */\nexport const contractsNavigationModel = () => ({ structure: new ApplicationStructureIndex(contractsStructure), navigation: contractsNavigation });\n"],"names":["contractsDefaultSampleDataId","contractsApplication","sampleData","profile","previewProfile","undefined","name","activePack","mappings","bindings","layouts","defaultLayouts","screenTemplates","contractsScreenTemplates","dialogTemplates","contractsDialogTemplates","screens","contractsScreens","uiProfiles","contractsComposition","logo","contractsNavigation","application","contractsNavigationModel","structure","ApplicationStructureIndex","contractsStructure","navigation"],"mappings":";;;;;;;AAAA;AACA;AASA,qEACO,MAAMA,4BAAAA,GAA+B;AAE5C;;;;AAIC,IACM,SAASC,oBAAAA,CAAqBC,UAAAA,GAAqBF,4BAA4B,EAAA;AAClF,IAAA,MAAMG,OAAAA,GAAqB;AAAE,QAAA,GAAGC,eAAeC,SAAAA,CAAU;QAAEC,IAAAA,EAAM,WAAA;QAAaJ,UAAAA,EAAY;YAAEK,UAAAA,EAAYL,UAAAA;AAAYM,YAAAA,QAAAA,EAAU,EAAE;AAAEC,YAAAA,QAAAA,EAAU;AAAG;AAAE,KAAA;IACjJ,OAAO;QAAEC,OAAAA,EAASC,cAAAA;QAAgBC,eAAAA,EAAiBC,wBAAAA;QAA0BC,eAAAA,EAAiBC,gBAAAA;QAA0BC,OAAAA,EAASC,gBAAAA;QAAkBC,UAAAA,EAAY;AAACf,YAAAA;AAAQ;AAAC,KAAA;AAC7K;AAEA,sGACO,MAAMgB,oBAAAA,GAA2C;IAAEC,IAAAA,EAAMC,mBAAAA,CAAoBC,WAAW,CAACF;AAAK;AAErG,0GACO,MAAMG,wBAAAA,GAA2B,KAAO;AAAEC,QAAAA,SAAAA,EAAW,IAAIC,yBAAAA,CAA0BC,kBAAAA,CAAAA;QAAqBC,UAAAA,EAAYN;AAAoB,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 contractsCategory = "Business / Contracts";
|
|
5
|
+
export declare const thumbnailOf: (templateName: string) => string;
|
|
6
|
+
export declare const contractsMetadata: (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 ContractsScreenTemplate = ScreenTemplate;
|
|
15
|
+
export type ContractsDialogTemplate = DialogTemplate;
|
|
16
|
+
//# sourceMappingURL=contractsParts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractsParts.d.ts","sourceRoot":"","sources":["../../contractsParts.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,CA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