@cratis/scene.blueprint.invoicing 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 +132 -0
- package/dist/cjs/blueprint.js +19 -0
- package/dist/cjs/blueprint.js.map +1 -0
- package/dist/cjs/index.js +69 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/invoicingApplication.js +49 -0
- package/dist/cjs/invoicingApplication.js.map +1 -0
- package/dist/cjs/invoicingParts.js +151 -0
- package/dist/cjs/invoicingParts.js.map +1 -0
- package/dist/cjs/invoicingQueries.js +66 -0
- package/dist/cjs/invoicingQueries.js.map +1 -0
- package/dist/cjs/invoicingScreenSet.js +47 -0
- package/dist/cjs/invoicingScreenSet.js.map +1 -0
- package/dist/cjs/manifest.js +87 -0
- package/dist/cjs/manifest.js.map +1 -0
- package/dist/cjs/navigation.js +117 -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/calendarTemplate.js +109 -0
- package/dist/cjs/templates/calendarTemplate.js.map +1 -0
- package/dist/cjs/templates/dashboardTemplates.js +153 -0
- package/dist/cjs/templates/dashboardTemplates.js.map +1 -0
- package/dist/cjs/templates/formTemplates.js +51 -0
- package/dist/cjs/templates/formTemplates.js.map +1 -0
- package/dist/cjs/templates/index.js +27 -0
- package/dist/cjs/templates/index.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +166 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/recordTemplates.js +144 -0
- package/dist/cjs/templates/recordTemplates.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/invoicingApplication.d.ts +10 -0
- package/dist/esm/invoicingApplication.d.ts.map +1 -0
- package/dist/esm/invoicingApplication.js +44 -0
- package/dist/esm/invoicingApplication.js.map +1 -0
- package/dist/esm/invoicingParts.d.ts +16 -0
- package/dist/esm/invoicingParts.d.ts.map +1 -0
- package/dist/esm/invoicingParts.js +133 -0
- package/dist/esm/invoicingParts.js.map +1 -0
- package/dist/esm/invoicingQueries.d.ts +39 -0
- package/dist/esm/invoicingQueries.d.ts.map +1 -0
- package/dist/esm/invoicingQueries.js +58 -0
- package/dist/esm/invoicingQueries.js.map +1 -0
- package/dist/esm/invoicingScreenSet.d.ts +7 -0
- package/dist/esm/invoicingScreenSet.d.ts.map +1 -0
- package/dist/esm/invoicingScreenSet.js +45 -0
- package/dist/esm/invoicingScreenSet.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 +113 -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/calendarTemplate.d.ts +3 -0
- package/dist/esm/templates/calendarTemplate.d.ts.map +1 -0
- package/dist/esm/templates/calendarTemplate.js +107 -0
- package/dist/esm/templates/calendarTemplate.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 +151 -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 +49 -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 +18 -0
- package/dist/esm/templates/index.js.map +1 -0
- package/dist/esm/templates/listTemplates.d.ts +4 -0
- package/dist/esm/templates/listTemplates.d.ts.map +1 -0
- package/dist/esm/templates/listTemplates.js +163 -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 +142 -0
- package/dist/esm/templates/recordTemplates.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/index.ts +14 -0
- package/invoicingApplication.ts +28 -0
- package/invoicingParts.ts +58 -0
- package/invoicingQueries.ts +58 -0
- package/invoicingScreenSet.ts +22 -0
- package/manifest.ts +41 -0
- package/navigation.ts +54 -0
- package/package.json +78 -4
- package/packageName.ts +5 -0
- package/sampleData/invoicing-en.json +988 -0
- package/screens/index.ts +20 -0
- package/templateProvenance.ts +15 -0
- package/templates/calendarTemplate.ts +57 -0
- package/templates/dashboardTemplates.ts +76 -0
- package/templates/formTemplates.ts +34 -0
- package/templates/index.ts +18 -0
- package/templates/listTemplates.ts +106 -0
- package/templates/recordTemplates.ts +79 -0
- package/thumbnails/InvoicePage.svg +17 -0
- package/thumbnails/InvoicesList.svg +29 -0
- package/thumbnails/InvoicingDueDates.svg +34 -0
- package/thumbnails/InvoicingOverview.svg +15 -0
- package/thumbnails/InvoicingQuickCreateInvoice.svg +12 -0
- package/thumbnails/InvoicingRecordPayment.svg +12 -0
- package/thumbnails/PaymentsList.svg +29 -0
- package/thumbnails/invoicing.svg +14 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardTemplates.js","sources":["../../../templates/dashboardTemplates.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 { dashboardScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { InvoicingEntityKind, InvoicingQuery, currencyOfData, fromQuery, localeOfData, invoicingQueriesOf } from '../invoicingQueries';\nimport { actionButton, component, goesTo, invoicingMetadata, opensDialog, withBehaviors } from '../invoicingParts';\n\ninterface KeyFigure { id: string; label: string; query: string; index: number; format?: 'currency' | 'percent'; fractionDigits?: number; goodDirection?: 'up' | 'down'; comparison: string }\ninterface Chart { id: string; title: string; kind: 'bar' | 'line' | 'donut' | 'funnel'; query: string }\ninterface Action { id: string; label: string; emphasis: 'primary' | 'secondary' | 'quiet' | 'danger'; dialog?: string; screen?: string }\n\ninterface DashboardOptions {\n name: string;\n displayName: string;\n description: string;\n title: string;\n subtitle: string;\n figures: KeyFigure[];\n charts: Chart[];\n table: { label: string; rows: string; columns: string; titleField: string; pageSize: number };\n aside: { kind: 'activity'; label: string; query: string } | { kind: 'checklist'; label: string; query: string };\n actions: Action[];\n}\n\n/**\n * One dashboard: the foundation `DashboardScreen` - key figures over two charts, a table beneath and a list beside - with every region its own component with its own\n * loading, empty and error states, so one failed query leaves the others on the page.\n */\nfunction dashboardOf(options: DashboardOptions): ScreenTemplate {\n const id = options.name;\n return {\n name: options.name,\n fitsSlot: 'content',\n slots: dashboardScreenTemplate.slots,\n arrangement: dashboardScreenTemplate.arrangement,\n content: {\n header: [component(`${id}-header`, 'pageHeader', { title: options.title, subtitle: options.subtitle }, {\n actions: options.actions.map(action => withBehaviors(actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? opensDialog(action.dialog) : goesTo(action.screen!))),\n })],\n kpis: options.figures.map(figure => component(`${id}-${figure.id}`, 'statCard', {\n label: figure.label, value: fromQuery(figure.query, `${figure.index}.value`), change: fromQuery(figure.query, `${figure.index}.change`), comparison: figure.comparison,\n ...(figure.format ? { format: figure.format } : {}), ...(figure.fractionDigits === undefined ? {} : { fractionDigits: figure.fractionDigits }), ...(figure.goodDirection ? { goodDirection: figure.goodDirection } : {}), ...currencyOfData,\n })),\n charts: options.charts.map(chart => component(`${id}-${chart.id}`, 'chartWrapper', {\n title: chart.title, kind: chart.kind, categories: fromQuery(chart.query, '0.categories'), series: fromQuery(chart.query, '0.series'), ...localeOfData,\n })),\n tables: [component(`${id}-table`, 'dataList', {\n label: options.table.label, rows: fromQuery(options.table.rows), columns: fromQuery(options.table.columns), titleField: options.table.titleField, pageSize: options.table.pageSize, ...localeOfData,\n })],\n aside: [options.aside.kind === 'activity'\n ? component(`${id}-aside`, 'activityFeed', { label: options.aside.label, entries: fromQuery(options.aside.query), ...localeOfData })\n : component(`${id}-aside`, 'checklistSection', { label: options.aside.label, sections: fromQuery(options.aside.query), ...localeOfData })],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: invoicingMetadata(options.name, 'Dashboard', [TemplateScope.Module, TemplateScope.Feature]),\n };\n}\n\n/** The receivables overview: three key figures over two charts - receivables by age and invoiced against collected - with the invoices beneath and the latest activity beside them. */\nexport const invoicingOverviewTemplate = dashboardOf({\n name: 'InvoicingOverview', displayName: 'Invoicing overview', description: 'Outstanding, overdue and collected this month, receivables by age, invoiced against collected and the invoices to chase.', title: 'Receivables overview', subtitle: 'What is owed and what has come in',\n figures: [\n { id: 'outstanding', label: 'Outstanding', query: InvoicingQuery.Kpis, index: 0, format: 'currency', goodDirection: 'down', comparison: 'last month' },\n { id: 'overdue', label: 'Overdue', query: InvoicingQuery.Kpis, index: 1, format: 'currency', goodDirection: 'down', comparison: 'last month' },\n { id: 'collected', label: 'Collected this month', query: InvoicingQuery.Kpis, index: 2, format: 'currency', comparison: 'last month' },\n ],\n charts: [\n { id: 'aging', title: 'Receivables by age', kind: 'bar', query: InvoicingQuery.Aging },\n { id: 'flow', title: 'Invoiced and collected', kind: 'line', query: InvoicingQuery.InvoicedAndCollected },\n ],\n table: { label: 'Invoices', titleField: 'number', pageSize: 5, rows: invoicingQueriesOf(InvoicingEntityKind.Invoice).rows, columns: invoicingQueriesOf(InvoicingEntityKind.Invoice).columns },\n aside: { kind: 'activity', label: 'Latest activity', query: InvoicingQuery.Activity },\n actions: [{ id: 'new', label: 'New invoice', emphasis: 'primary', dialog: 'InvoicingQuickCreateInvoice' }],\n});\n"],"names":["dashboardOf","options","id","name","fitsSlot","slots","dashboardScreenTemplate","arrangement","content","header","component","title","subtitle","actions","map","action","withBehaviors","actionButton","label","emphasis","dialog","opensDialog","goesTo","screen","kpis","figures","figure","value","fromQuery","query","index","change","comparison","format","fractionDigits","undefined","goodDirection","currencyOfData","charts","chart","kind","categories","series","localeOfData","tables","table","rows","columns","titleField","pageSize","aside","entries","sections","displayName","description","metadata","invoicingMetadata","TemplateScope","Module","Feature","invoicingOverviewTemplate","InvoicingQuery","Kpis","Aging","InvoicedAndCollected","invoicingQueriesOf","InvoicingEntityKind","Invoice","Activity"],"mappings":";;;;;;;AAAA;AACA;AAwBA;;;IAIA,SAASA,YAAYC,OAAyB,EAAA;IAC1C,MAAMC,EAAAA,GAAKD,QAAQE,IAAI;IACvB,OAAO;AACHA,QAAAA,IAAAA,EAAMF,QAAQE,IAAI;QAClBC,QAAAA,EAAU,SAAA;AACVC,QAAAA,KAAAA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,KAAA;IAC5LG,KAAAA,EAAO;QAAEV,IAAAA,EAAM,UAAA;QAAYtB,KAAAA,EAAO,iBAAA;AAAmBW,QAAAA,KAAAA,EAAOgC,gCAAeO;AAAS,KAAA;IACpFvD,OAAAA,EAAS;AAAC,QAAA;YAAEX,EAAAA,EAAI,KAAA;YAAOgB,KAAAA,EAAO,aAAA;YAAeC,QAAAA,EAAU,SAAA;YAAWC,MAAAA,EAAQ;AAA8B;AAAE;AAC9G,CAAA;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var invoicingQueries = require('../invoicingQueries.js');
|
|
6
|
+
var invoicingParts = require('../invoicingParts.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 quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields
|
|
12
|
+
* that thing needs to get started.
|
|
13
|
+
*/ function quickCreateOf(name, title, sections, noun, submit) {
|
|
14
|
+
return {
|
|
15
|
+
name,
|
|
16
|
+
slots: scene_blueprint_default.quickCreateDialogTemplate.slots,
|
|
17
|
+
content: {
|
|
18
|
+
header: [
|
|
19
|
+
scene_blueprint_default.component(`${name}-frame`, 'dialogFrame', {
|
|
20
|
+
title,
|
|
21
|
+
subtitle: 'Only what is needed to get started'
|
|
22
|
+
})
|
|
23
|
+
],
|
|
24
|
+
body: [
|
|
25
|
+
invoicingParts.withBehaviors(scene_blueprint_default.component(`${name}-form`, 'formScreenBody', {
|
|
26
|
+
mode: 'create',
|
|
27
|
+
saveAndNew: false,
|
|
28
|
+
strings: {
|
|
29
|
+
formSave: submit
|
|
30
|
+
},
|
|
31
|
+
sections: invoicingQueries.fromQuery(sections),
|
|
32
|
+
errors: invoicingQueries.fromQuery(invoicingQueries.InvoicingQuery.FormErrors, '0'),
|
|
33
|
+
...invoicingQueries.localeOfData
|
|
34
|
+
}), invoicingParts.closesDialog())
|
|
35
|
+
],
|
|
36
|
+
actions: []
|
|
37
|
+
},
|
|
38
|
+
displayName: `Invoicing quick create ${noun}`,
|
|
39
|
+
description: `A short form that creates one ${noun} without leaving the page.`,
|
|
40
|
+
metadata: invoicingParts.invoicingMetadata(name, 'Dialog', [
|
|
41
|
+
scene_model.TemplateScope.Slice
|
|
42
|
+
])
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** The quick dialogs of the blueprint. */ const invoicingDialogs = [
|
|
46
|
+
quickCreateOf('InvoicingQuickCreateInvoice', 'New invoice', 'InvoiceQuickSections', 'invoice', 'Create'),
|
|
47
|
+
quickCreateOf('InvoicingRecordPayment', 'Record a payment', 'InvoicingRecordPaymentSections', 'payment', 'Record payment')
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
exports.invoicingDialogs = invoicingDialogs;
|
|
51
|
+
//# sourceMappingURL=formTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplates.js","sources":["../../../templates/formTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogTemplate, TemplateScope } from '@cratis/scene.model';\nimport { quickCreateDialogTemplate } from '@cratis/scene.blueprint.default';\nimport { InvoicingQuery, fromQuery, localeOfData } from '../invoicingQueries';\nimport { closesDialog, component, invoicingMetadata, withBehaviors } from '../invoicingParts';\n\n/**\n * One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields\n * that thing needs to get started.\n */\nfunction quickCreateOf(name: string, title: string, sections: string, noun: string, submit: string): DialogTemplate {\n return {\n name,\n slots: quickCreateDialogTemplate.slots,\n content: {\n header: [component(`${name}-frame`, 'dialogFrame', { title, subtitle: 'Only what is needed to get started' })],\n body: [withBehaviors(component(`${name}-form`, 'formScreenBody', {\n mode: 'create', saveAndNew: false, strings: { formSave: submit }, sections: fromQuery(sections), errors: fromQuery(InvoicingQuery.FormErrors, '0'), ...localeOfData,\n }), closesDialog())],\n actions: [],\n },\n displayName: `Invoicing quick create ${noun}`,\n description: `A short form that creates one ${noun} without leaving the page.`,\n metadata: invoicingMetadata(name, 'Dialog', [TemplateScope.Slice]),\n };\n}\n\n/** The quick dialogs of the blueprint. */\nexport const invoicingDialogs: DialogTemplate[] = [\n quickCreateOf('InvoicingQuickCreateInvoice', 'New invoice', 'InvoiceQuickSections', 'invoice', 'Create'),\n quickCreateOf('InvoicingRecordPayment', 'Record a payment', 'InvoicingRecordPaymentSections', 'payment', 'Record payment'),\n];\n"],"names":["quickCreateOf","name","title","sections","noun","submit","slots","quickCreateDialogTemplate","content","header","component","subtitle","body","withBehaviors","mode","saveAndNew","strings","formSave","fromQuery","errors","InvoicingQuery","FormErrors","localeOfData","closesDialog","actions","displayName","description","metadata","invoicingMetadata","TemplateScope","Slice","invoicingDialogs"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;IAIA,SAASA,aAAAA,CAAcC,IAAY,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,IAAY,EAAEC,MAAc,EAAA;IAC9F,OAAO;AACHJ,QAAAA,IAAAA;AACAK,QAAAA,KAAAA,EAAOC,kDAA0BD,KAAK;QACtCE,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,iCAAAA,CAAU,CAAA,EAAGT,IAAAA,CAAK,MAAM,CAAC,EAAE,aAAA,EAAe;AAAEC,oBAAAA,KAAAA;oBAAOS,QAAAA,EAAU;AAAqC,iBAAA;AAAG,aAAA;YAC9GC,IAAAA,EAAM;AAACC,gBAAAA,4BAAAA,CAAcH,kCAAU,CAAA,EAAGT,IAAAA,CAAK,KAAK,CAAC,EAAE,gBAAA,EAAkB;oBAC7Da,IAAAA,EAAM,QAAA;oBAAUC,UAAAA,EAAY,KAAA;oBAAOC,OAAAA,EAAS;wBAAEC,QAAAA,EAAUZ;AAAO,qBAAA;AAAGF,oBAAAA,QAAAA,EAAUe,0BAAAA,CAAUf,QAAAA,CAAAA;oBAAWgB,MAAAA,EAAQD,0BAAAA,CAAUE,+BAAAA,CAAeC,UAAU,EAAE,GAAA,CAAA;AAAM,oBAAA,GAAGC;iBAC3J,CAAA,EAAIC,2BAAAA,EAAAA;AAAgB,aAAA;AACpBC,YAAAA,OAAAA,EAAS;AACb,SAAA;QACAC,WAAAA,EAAa,CAAC,uBAAuB,EAAErB,IAAAA,CAAAA,CAAM;AAC7CsB,QAAAA,WAAAA,EAAa,CAAC,8BAA8B,EAAEtB,IAAAA,CAAK,0BAA0B,CAAC;QAC9EuB,QAAAA,EAAUC,gCAAAA,CAAkB3B,MAAM,QAAA,EAAU;AAAC4B,YAAAA,yBAAAA,CAAcC;AAAM,SAAA;AACrE,KAAA;AACJ;AAEA,2CACO,MAAMC,gBAAAA,GAAqC;IAC9C/B,aAAAA,CAAc,6BAAA,EAA+B,aAAA,EAAe,sBAAA,EAAwB,SAAA,EAAW,QAAA,CAAA;IAC/FA,aAAAA,CAAc,wBAAA,EAA0B,kBAAA,EAAoB,gCAAA,EAAkC,SAAA,EAAW,gBAAA;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dashboardTemplates = require('./dashboardTemplates.js');
|
|
4
|
+
var listTemplates = require('./listTemplates.js');
|
|
5
|
+
var recordTemplates = require('./recordTemplates.js');
|
|
6
|
+
var calendarTemplate = require('./calendarTemplate.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 invoicingScreenTemplates = [
|
|
12
|
+
dashboardTemplates.invoicingOverviewTemplate,
|
|
13
|
+
listTemplates.invoicesListTemplate,
|
|
14
|
+
recordTemplates.invoicePageTemplate,
|
|
15
|
+
listTemplates.paymentsListTemplate,
|
|
16
|
+
calendarTemplate.invoicingDueDatesTemplate
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
exports.invoicingOverviewTemplate = dashboardTemplates.invoicingOverviewTemplate;
|
|
20
|
+
exports.invoicesListTemplate = listTemplates.invoicesListTemplate;
|
|
21
|
+
exports.paymentsListTemplate = listTemplates.paymentsListTemplate;
|
|
22
|
+
exports.invoicePageTemplate = recordTemplates.invoicePageTemplate;
|
|
23
|
+
exports.invoicingDueDatesTemplate = calendarTemplate.invoicingDueDatesTemplate;
|
|
24
|
+
exports.invoicingDialogTemplates = formTemplates.invoicingDialogs;
|
|
25
|
+
exports.invoicingDialogs = formTemplates.invoicingDialogs;
|
|
26
|
+
exports.invoicingScreenTemplates = invoicingScreenTemplates;
|
|
27
|
+
//# 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 { invoicingOverviewTemplate } from './dashboardTemplates';\nimport { invoicesListTemplate, paymentsListTemplate } from './listTemplates';\nimport { invoicePageTemplate } from './recordTemplates';\nimport { invoicingDueDatesTemplate } from './calendarTemplate';\n\nexport * from './dashboardTemplates';\nexport * from './listTemplates';\nexport * from './recordTemplates';\nexport * from './calendarTemplate';\nexport * from './formTemplates';\n\n/** Every screen template this blueprint provides, in the order the manifest lists them. */\nexport const invoicingScreenTemplates = [invoicingOverviewTemplate, invoicesListTemplate, invoicePageTemplate, paymentsListTemplate, invoicingDueDatesTemplate];\n\nexport { invoicingDialogs as invoicingDialogTemplates } from './formTemplates';\n"],"names":["invoicingScreenTemplates","invoicingOverviewTemplate","invoicesListTemplate","invoicePageTemplate","paymentsListTemplate","invoicingDueDatesTemplate"],"mappings":";;;;;;;;AAAA;AACA;AAaA,4FACO,MAAMA,wBAAAA,GAA2B;AAACC,IAAAA,4CAAAA;AAA2BC,IAAAA,kCAAAA;AAAsBC,IAAAA,mCAAAA;AAAqBC,IAAAA,kCAAAA;AAAsBC,IAAAA;;;;;;;;;;"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var invoicingQueries = require('../invoicingQueries.js');
|
|
6
|
+
var invoicingParts = require('../invoicingParts.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)=>invoicingParts.withBehaviors(invoicingParts.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 = invoicingQueries.invoicingQueriesOf(options.entity);
|
|
39
|
+
const id = options.name;
|
|
40
|
+
const listId = `${id}-records`;
|
|
41
|
+
const primary = invoicingParts.withBehaviors(invoicingParts.actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? invoicingParts.opensDialog(options.primary.dialog) : invoicingParts.goesTo(options.primary.screen));
|
|
42
|
+
const list = scene_blueprint_default.component(listId, 'dataList', {
|
|
43
|
+
label: options.title,
|
|
44
|
+
rows: invoicingQueries.fromQuery(queries.rows),
|
|
45
|
+
columns: invoicingQueries.fromQuery(queries.columns),
|
|
46
|
+
titleField: options.titleField,
|
|
47
|
+
pageSize: options.cards ? 12 : 10,
|
|
48
|
+
urlKey: options.urlKey,
|
|
49
|
+
...invoicingQueries.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: invoicingQueries.fromQuery(queries.views),
|
|
93
|
+
savePermission: 'enabled',
|
|
94
|
+
managePermission: 'enabled'
|
|
95
|
+
}),
|
|
96
|
+
scene_blueprint_default.component(`${id}-columns`, 'columnChooser', {
|
|
97
|
+
columns: invoicingQueries.fromQuery(queries.columnChoices)
|
|
98
|
+
})
|
|
99
|
+
],
|
|
100
|
+
filters: [
|
|
101
|
+
scene_blueprint_default.component(`${id}-filter`, 'filterBuilder', {
|
|
102
|
+
fields: invoicingQueries.fromQuery(queries.filterFields),
|
|
103
|
+
...invoicingQueries.localeOfData
|
|
104
|
+
})
|
|
105
|
+
],
|
|
106
|
+
list: [
|
|
107
|
+
options.recordScreen ? invoicingParts.withBehaviors(list, invoicingParts.opensRecordOnSelect(listId, options.recordScreen)) : options.recordDialog ? invoicingParts.withBehaviors(list, invoicingParts.opensDialogOnSelect(options.recordDialog)) : list
|
|
108
|
+
],
|
|
109
|
+
bulkBar: options.recordScreen || options.recordDialog || options.readOnly ? [] : [
|
|
110
|
+
scene_blueprint_default.component(`${id}-bulk`, 'bulkBar', {
|
|
111
|
+
selection: invoicingQueries.fromQuery(queries.selection),
|
|
112
|
+
actions: options.bulkActions
|
|
113
|
+
})
|
|
114
|
+
],
|
|
115
|
+
footer: []
|
|
116
|
+
},
|
|
117
|
+
displayName: options.displayName,
|
|
118
|
+
description: options.description,
|
|
119
|
+
metadata: invoicingParts.invoicingMetadata(options.name, 'List', listScopes)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/** The invoices: every invoice with its customer, issue and due dates, amount and status. Choosing an invoice opens it. */ const invoicesListTemplate = listTemplateOf({
|
|
123
|
+
name: 'InvoicesList',
|
|
124
|
+
entity: invoicingQueries.InvoicingEntityKind.Invoice,
|
|
125
|
+
displayName: 'Invoices list',
|
|
126
|
+
description: 'Every invoice with its customer, issue and due dates, amount and status, filtered by customer, status and date.',
|
|
127
|
+
title: 'Invoices',
|
|
128
|
+
subtitle: 'Everything you have billed',
|
|
129
|
+
searchLabel: 'Search invoices',
|
|
130
|
+
urlKey: 'invoices',
|
|
131
|
+
primary: {
|
|
132
|
+
label: 'New invoice',
|
|
133
|
+
dialog: 'InvoicingQuickCreateInvoice'
|
|
134
|
+
},
|
|
135
|
+
rowActions: [
|
|
136
|
+
'Open',
|
|
137
|
+
'Send reminder'
|
|
138
|
+
],
|
|
139
|
+
bulkActions: [],
|
|
140
|
+
titleField: 'number',
|
|
141
|
+
recordScreen: 'invoicing.record'
|
|
142
|
+
});
|
|
143
|
+
/** The payments: what came in, which invoice it settled, when and by what method. A record of what happened, which nobody edits. */ const paymentsListTemplate = listTemplateOf({
|
|
144
|
+
name: 'PaymentsList',
|
|
145
|
+
entity: invoicingQueries.InvoicingEntityKind.Payment,
|
|
146
|
+
displayName: 'Payments list',
|
|
147
|
+
description: 'The payments received with the invoice each settled, when and how, filtered by method and date.',
|
|
148
|
+
title: 'Payments',
|
|
149
|
+
subtitle: 'What has come in',
|
|
150
|
+
searchLabel: 'Search payments',
|
|
151
|
+
urlKey: 'payments',
|
|
152
|
+
primary: {
|
|
153
|
+
label: 'Open the invoices',
|
|
154
|
+
screen: 'invoicing.list'
|
|
155
|
+
},
|
|
156
|
+
rowActions: [
|
|
157
|
+
'Open invoice'
|
|
158
|
+
],
|
|
159
|
+
bulkActions: [],
|
|
160
|
+
titleField: 'reference',
|
|
161
|
+
readOnly: true
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
exports.invoicesListTemplate = invoicesListTemplate;
|
|
165
|
+
exports.paymentsListTemplate = paymentsListTemplate;
|
|
166
|
+
//# 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 { InvoicingEntityKind, fromQuery, invoicingQueriesOf, localeOfData } from '../invoicingQueries';\nimport { actionButton, component, goesTo, invoicingMetadata, opensDialog, opensDialogOnSelect, opensRecordOnSelect, withBehaviors } from '../invoicingParts';\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: InvoicingEntityKind;\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 = invoicingQueriesOf(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: invoicingMetadata(options.name, 'List', listScopes),\n };\n}\n\n\n/** The invoices: every invoice with its customer, issue and due dates, amount and status. Choosing an invoice opens it. */\nexport const invoicesListTemplate = listTemplateOf({\n name: 'InvoicesList',\n entity: InvoicingEntityKind.Invoice, displayName: 'Invoices list', description: 'Every invoice with its customer, issue and due dates, amount and status, filtered by customer, status and date.', title: 'Invoices', subtitle: 'Everything you have billed', searchLabel: 'Search invoices', urlKey: 'invoices',\n primary: { label: 'New invoice', dialog: 'InvoicingQuickCreateInvoice' },\n rowActions: ['Open', 'Send reminder'], bulkActions: [],\n titleField: 'number', recordScreen: 'invoicing.record'\n});\n\n/** The payments: what came in, which invoice it settled, when and by what method. A record of what happened, which nobody edits. */\nexport const paymentsListTemplate = listTemplateOf({\n name: 'PaymentsList',\n entity: InvoicingEntityKind.Payment, displayName: 'Payments list', description: 'The payments received with the invoice each settled, when and how, filtered by method and date.', title: 'Payments', subtitle: 'What has come in', searchLabel: 'Search payments', urlKey: 'payments',\n primary: { label: 'Open the invoices', screen: 'invoicing.list' },\n rowActions: ['Open invoice'], bulkActions: [],\n titleField: 'reference',\n readOnly: true\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","invoicingQueriesOf","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","invoicingMetadata","invoicesListTemplate","InvoicingEntityKind","Invoice","paymentsListTemplate","Payment"],"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;oBACPC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBC;AAAM,qBAAA;oBAC9CC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBC,MAAM;AAAEC,4BAAAA,KAAAA,EAAOC,8BAAkBC,IAAI;4BAAEC,OAAAA,EAAS;gCAAEC,IAAAA,EAAM;AAA0B;AAAE;AAA6B;AAC7J;AAAE;AACN;AAAE,KAAA,CAAA;AA8BF;;;IAIA,SAASC,eAAeC,OAAoB,EAAA;IACxC,MAAMC,OAAAA,GAAUC,mCAAAA,CAAmBF,OAAAA,CAAQG,MAAM,CAAA;IACjD,MAAMpB,EAAAA,GAAKiB,QAAQI,IAAI;AACvB,IAAA,MAAMC,MAAAA,GAAS,CAAA,EAAGtB,EAAAA,CAAG,QAAQ,CAAC;AAC9B,IAAA,MAAMuB,OAAAA,GAAUtB,4BAAAA,CAAcC,2BAAAA,CAAa,CAAA,EAAGF,EAAAA,CAAG,QAAQ,CAAC,EAAEiB,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cAAAA,CAAe;IAC/CK,IAAAA,EAAM,cAAA;AACND,IAAAA,MAAAA,EAAQ0D,qCAAoBC,OAAO;IAAEN,WAAAA,EAAa,eAAA;IAAiBC,WAAAA,EAAa,iHAAA;IAAmH3C,KAAAA,EAAO,UAAA;IAAYyB,QAAAA,EAAU,4BAAA;IAA8BG,WAAAA,EAAa,iBAAA;IAAmBrB,MAAAA,EAAQ,UAAA;IACtSf,OAAAA,EAAS;QAAEC,KAAAA,EAAO,aAAA;QAAeC,MAAAA,EAAQ;AAA8B,KAAA;IACvEe,UAAAA,EAAY;AAAC,QAAA,MAAA;AAAQ,QAAA;AAAgB,KAAA;AAAE+B,IAAAA,WAAAA,EAAa,EAAE;IACtDpC,UAAAA,EAAY,QAAA;IAAUQ,YAAAA,EAAc;AACxC,CAAA;AAEA,qIACO,MAAMqC,oBAAAA,GAAuBhE,cAAAA,CAAe;IAC/CK,IAAAA,EAAM,cAAA;AACND,IAAAA,MAAAA,EAAQ0D,qCAAoBG,OAAO;IAAER,WAAAA,EAAa,eAAA;IAAiBC,WAAAA,EAAa,iGAAA;IAAmG3C,KAAAA,EAAO,UAAA;IAAYyB,QAAAA,EAAU,kBAAA;IAAoBG,WAAAA,EAAa,iBAAA;IAAmBrB,MAAAA,EAAQ,UAAA;IAC5Qf,OAAAA,EAAS;QAAEC,KAAAA,EAAO,mBAAA;QAAqBI,MAAAA,EAAQ;AAAiB,KAAA;IAChEY,UAAAA,EAAY;AAAC,QAAA;AAAe,KAAA;AAAE+B,IAAAA,WAAAA,EAAa,EAAE;IAC7CpC,UAAAA,EAAY,WAAA;IACZM,QAAAA,EAAU;AACd,CAAA;;;"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var invoicingQueries = require('../invoicingQueries.js');
|
|
6
|
+
var invoicingParts = require('../invoicingParts.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 = invoicingQueries.invoicingQueriesOf(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: invoicingQueries.fromQuery(queries.record, `0.${options.titleField}`),
|
|
25
|
+
subtitle: invoicingQueries.fromQuery(queries.record, '0.summary')
|
|
26
|
+
}, {
|
|
27
|
+
actions: [
|
|
28
|
+
invoicingParts.withBehaviors(invoicingParts.actionButton(`${id}-back`, options.backLabel, 'secondary'), invoicingParts.goesTo(options.backScreen)),
|
|
29
|
+
...options.actions.map((action)=>invoicingParts.withBehaviors(invoicingParts.actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? invoicingParts.opensDialog(action.dialog) : invoicingParts.goesTo(action.screen)))
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
],
|
|
33
|
+
summary: [
|
|
34
|
+
scene_blueprint_default.component(`${id}-status`, 'statusChip', {
|
|
35
|
+
status: invoicingQueries.fromQuery(queries.summary, '0.status'),
|
|
36
|
+
tone: invoicingQueries.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: invoicingQueries.fromQuery(queries.summary, `0.${fact.field}`),
|
|
41
|
+
...fact.format ? {
|
|
42
|
+
format: fact.format
|
|
43
|
+
} : {},
|
|
44
|
+
...invoicingQueries.currencyOfData
|
|
45
|
+
}))
|
|
46
|
+
],
|
|
47
|
+
tabs: [
|
|
48
|
+
scene_blueprint_default.component(`${id}-tabs`, 'tabSet', {
|
|
49
|
+
tabs: invoicingQueries.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: invoicingQueries.fromQuery(queries.sections),
|
|
58
|
+
values: invoicingQueries.fromQuery(queries.record, '0'),
|
|
59
|
+
...invoicingQueries.currencyOfData
|
|
60
|
+
}),
|
|
61
|
+
...options.extras.map((extra)=>scene_blueprint_default.component(`${id}-${extra.key.toLowerCase()}`, 'dataList', {
|
|
62
|
+
label: extra.label,
|
|
63
|
+
rows: invoicingQueries.fromQuery(`${options.entity}${extra.key}`),
|
|
64
|
+
columns: invoicingQueries.fromQuery(`${options.entity}${extra.key}Columns`),
|
|
65
|
+
titleField: extra.titleField,
|
|
66
|
+
pageSize: extra.pageSize ?? 8,
|
|
67
|
+
...invoicingQueries.currencyOfData
|
|
68
|
+
}))
|
|
69
|
+
],
|
|
70
|
+
related: [],
|
|
71
|
+
activity: [
|
|
72
|
+
scene_blueprint_default.component(`${id}-activity`, 'activityFeed', {
|
|
73
|
+
label: 'Activity',
|
|
74
|
+
entries: invoicingQueries.fromQuery(queries.activity),
|
|
75
|
+
...invoicingQueries.localeOfData
|
|
76
|
+
})
|
|
77
|
+
],
|
|
78
|
+
aside: []
|
|
79
|
+
},
|
|
80
|
+
displayName: options.displayName,
|
|
81
|
+
description: options.description,
|
|
82
|
+
metadata: invoicingParts.invoicingMetadata(options.name, 'Detail', [
|
|
83
|
+
scene_model.TemplateScope.Feature,
|
|
84
|
+
scene_model.TemplateScope.Subfeature
|
|
85
|
+
])
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** The invoice page: the invoice number as its title, its status, total, paid amount and balance due at the top, its fields, lines and payments in the main region, and the activity beside it. */ const invoicePageTemplate = recordPageOf({
|
|
89
|
+
name: 'InvoicePage',
|
|
90
|
+
entity: invoicingQueries.InvoicingEntityKind.Invoice,
|
|
91
|
+
displayName: 'Invoice page',
|
|
92
|
+
description: 'One invoice: status, total, paid and balance due, its details, lines and payments, and its activity.',
|
|
93
|
+
titleField: 'number',
|
|
94
|
+
backScreen: 'invoicing.list',
|
|
95
|
+
backLabel: 'Back to invoices',
|
|
96
|
+
facts: [
|
|
97
|
+
{
|
|
98
|
+
id: 'total',
|
|
99
|
+
label: 'Invoice total',
|
|
100
|
+
field: 'total',
|
|
101
|
+
format: 'currency'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'paid',
|
|
105
|
+
label: 'Paid',
|
|
106
|
+
field: 'paid',
|
|
107
|
+
format: 'currency'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'balance',
|
|
111
|
+
label: 'Balance due',
|
|
112
|
+
field: 'balance',
|
|
113
|
+
format: 'currency'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'days',
|
|
117
|
+
label: 'Days to due date',
|
|
118
|
+
field: 'daysToDue'
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
extras: [
|
|
122
|
+
{
|
|
123
|
+
key: 'Lines',
|
|
124
|
+
label: 'Invoice lines',
|
|
125
|
+
titleField: 'description'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
key: 'Payments',
|
|
129
|
+
label: 'Payments',
|
|
130
|
+
titleField: 'reference'
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
actions: [
|
|
134
|
+
{
|
|
135
|
+
id: 'pay',
|
|
136
|
+
label: 'Record payment',
|
|
137
|
+
emphasis: 'primary',
|
|
138
|
+
dialog: 'InvoicingRecordPayment'
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
exports.invoicePageTemplate = invoicePageTemplate;
|
|
144
|
+
//# 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 { InvoicingEntityKind, currencyOfData, fromQuery, localeOfData, invoicingQueriesOf } from '../invoicingQueries';\nimport { actionButton, component, goesTo, invoicingMetadata, opensDialog, withBehaviors } from '../invoicingParts';\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: InvoicingEntityKind;\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 = invoicingQueriesOf(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: invoicingMetadata(options.name, 'Detail', [TemplateScope.Feature, TemplateScope.Subfeature]),\n };\n}\n\n/** The invoice page: the invoice number as its title, its status, total, paid amount and balance due at the top, its fields, lines and payments in the main region, and the activity beside it. */\nexport const invoicePageTemplate = recordPageOf({\n name: 'InvoicePage', entity: InvoicingEntityKind.Invoice, displayName: 'Invoice page', description: 'One invoice: status, total, paid and balance due, its details, lines and payments, and its activity.', titleField: 'number', backScreen: 'invoicing.list', backLabel: 'Back to invoices',\n facts: [\n { id: 'total', label: 'Invoice total', field: 'total', format: 'currency' },\n { id: 'paid', label: 'Paid', field: 'paid', format: 'currency' },\n { id: 'balance', label: 'Balance due', field: 'balance', format: 'currency' },\n { id: 'days', label: 'Days to due date', field: 'daysToDue' },\n ],\n extras: [{ key: 'Lines', label: 'Invoice lines', titleField: 'description' }, { key: 'Payments', label: 'Payments', titleField: 'reference' }],\n actions: [{ id: 'pay', label: 'Record payment', emphasis: 'primary', dialog: 'InvoicingRecordPayment' }],\n});\n"],"names":["recordPageOf","options","queries","invoicingQueriesOf","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","invoicingMetadata","TemplateScope","Feature","Subfeature","invoicePageTemplate","InvoicingEntityKind","Invoice"],"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,EA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KAAAA,EAAO,OAAA;YAASC,MAAAA,EAAQ;AAAW,SAAA;AAC1E,QAAA;YAAElC,EAAAA,EAAI,MAAA;YAAQsB,KAAAA,EAAO,MAAA;YAAQW,KAAAA,EAAO,MAAA;YAAQC,MAAAA,EAAQ;AAAW,SAAA;AAC/D,QAAA;YAAElC,EAAAA,EAAI,SAAA;YAAWsB,KAAAA,EAAO,aAAA;YAAeW,KAAAA,EAAO,SAAA;YAAWC,MAAAA,EAAQ;AAAW,SAAA;AAC5E,QAAA;YAAElC,EAAAA,EAAI,MAAA;YAAQsB,KAAAA,EAAO,kBAAA;YAAoBW,KAAAA,EAAO;AAAY;AAC/D,KAAA;IACDU,MAAAA,EAAQ;AAAC,QAAA;YAAEE,GAAAA,EAAK,OAAA;YAASvB,KAAAA,EAAO,eAAA;YAAiBV,UAAAA,EAAY;AAAc,SAAA;AAAG,QAAA;YAAEiC,GAAAA,EAAK,UAAA;YAAYvB,KAAAA,EAAO,UAAA;YAAYV,UAAAA,EAAY;AAAY;AAAE,KAAA;IAC9IE,OAAAA,EAAS;AAAC,QAAA;YAAEd,EAAAA,EAAI,KAAA;YAAOsB,KAAAA,EAAO,gBAAA;YAAkBC,QAAAA,EAAU,SAAA;YAAWC,MAAAA,EAAQ;AAAyB;AAAE;AAC5G,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 { invoicingBlueprintManifest } from './manifest.js';
|
|
2
|
+
import { invoicingScreens } from './screens/index.js';
|
|
3
|
+
import { invoicingScreenTemplates } from './templates/index.js';
|
|
4
|
+
import { invoicingDialogs } 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 invoicingBlueprint = {
|
|
9
|
+
manifest: invoicingBlueprintManifest,
|
|
10
|
+
components: {},
|
|
11
|
+
screenTemplates: invoicingScreenTemplates,
|
|
12
|
+
dialogTemplates: invoicingDialogs,
|
|
13
|
+
screens: invoicingScreens
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { invoicingBlueprint };
|
|
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 { invoicingBlueprintManifest } from './manifest';\nimport { invoicingScreens } from './screens';\nimport { invoicingDialogTemplates, invoicingScreenTemplates } 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 invoicingBlueprint: ScenePackageBundle = {\n manifest: invoicingBlueprintManifest,\n components: {},\n screenTemplates: invoicingScreenTemplates,\n dialogTemplates: invoicingDialogTemplates,\n screens: invoicingScreens,\n};\n"],"names":["invoicingBlueprint","manifest","invoicingBlueprintManifest","components","screenTemplates","invoicingScreenTemplates","dialogTemplates","invoicingDialogTemplates","screens","invoicingScreens"],"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,12 @@
|
|
|
1
|
+
export * from './packageName';
|
|
2
|
+
export * from './templateProvenance';
|
|
3
|
+
export * from './invoicingQueries';
|
|
4
|
+
export * from './invoicingParts';
|
|
5
|
+
export * from './invoicingScreenSet';
|
|
6
|
+
export * from './templates';
|
|
7
|
+
export * from './screens';
|
|
8
|
+
export * from './navigation';
|
|
9
|
+
export * from './manifest';
|
|
10
|
+
export * from './blueprint';
|
|
11
|
+
export * from './invoicingApplication';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { invoicingBlueprintName } from './packageName.js';
|
|
2
|
+
export { invoicingTemplateProvenance } from './templateProvenance.js';
|
|
3
|
+
export { InvoicingEntityKind, InvoicingQuery, currencyOfData, fromQuery, invoicingEntityPlural, invoicingQueriesOf, localeOfData } from './invoicingQueries.js';
|
|
4
|
+
export { actionButton, closesDialog, goesTo, invoicingCategory, invoicingMetadata, opensDialog, opensDialogOnSelect, opensRecordOnSelect, thumbnailOf, withBehaviors } from './invoicingParts.js';
|
|
5
|
+
export { invoicingScreenDefinitions } from './invoicingScreenSet.js';
|
|
6
|
+
export { invoicingScreenTemplates } from './templates/index.js';
|
|
7
|
+
export { invoicingScreens } from './screens/index.js';
|
|
8
|
+
export { invoicingModule, invoicingNavigation, invoicingStructure } from './navigation.js';
|
|
9
|
+
export { invoicingBlueprintManifest } from './manifest.js';
|
|
10
|
+
export { invoicingBlueprint } from './blueprint.js';
|
|
11
|
+
export { invoicingApplication, invoicingComposition, invoicingDefaultSampleDataId, invoicingNavigationModel } from './invoicingApplication.js';
|
|
12
|
+
export { component, panel } from '@cratis/scene.blueprint.default';
|
|
13
|
+
export { invoicePageTemplate } from './templates/recordTemplates.js';
|
|
14
|
+
export { invoicesListTemplate, paymentsListTemplate } from './templates/listTemplates.js';
|
|
15
|
+
export { invoicingDialogs as invoicingDialogTemplates, invoicingDialogs } from './templates/formTemplates.js';
|
|
16
|
+
export { invoicingDueDatesTemplate } from './templates/calendarTemplate.js';
|
|
17
|
+
export { invoicingOverviewTemplate } from './templates/dashboardTemplates.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApplicationStructureIndex } from '@cratis/scene.engine';
|
|
2
|
+
import { ApplicationDocument, CompositionOptions } from '@cratis/scene.blueprint.default';
|
|
3
|
+
export declare const invoicingDefaultSampleDataId = "invoicing-en";
|
|
4
|
+
export declare function invoicingApplication(sampleData?: string): ApplicationDocument;
|
|
5
|
+
export declare const invoicingComposition: CompositionOptions;
|
|
6
|
+
export declare const invoicingNavigationModel: () => {
|
|
7
|
+
structure: ApplicationStructureIndex;
|
|
8
|
+
navigation: import("@cratis/scene.model").NavigationModel;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=invoicingApplication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoicingApplication.d.ts","sourceRoot":"","sources":["../../invoicingApplication.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 { invoicingNavigation, invoicingStructure } from './navigation.js';
|
|
4
|
+
import { invoicingScreens } from './screens/index.js';
|
|
5
|
+
import { invoicingScreenTemplates } from './templates/index.js';
|
|
6
|
+
import { invoicingDialogs } 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 invoicingDefaultSampleDataId = 'invoicing-en';
|
|
11
|
+
/**
|
|
12
|
+
* The example application of the blueprint: the foundation's layouts, the Invoicing templates, the quick-create dialogs and their 5 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/Invoicing/invoicing.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.
|
|
15
|
+
*/ function invoicingApplication(sampleData = invoicingDefaultSampleDataId) {
|
|
16
|
+
const profile = {
|
|
17
|
+
...previewProfile(undefined),
|
|
18
|
+
name: 'Invoicing',
|
|
19
|
+
sampleData: {
|
|
20
|
+
activePack: sampleData,
|
|
21
|
+
mappings: [],
|
|
22
|
+
bindings: []
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
layouts: defaultLayouts,
|
|
27
|
+
screenTemplates: invoicingScreenTemplates,
|
|
28
|
+
dialogTemplates: invoicingDialogs,
|
|
29
|
+
screens: invoicingScreens,
|
|
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 invoicingComposition = {
|
|
36
|
+
logo: invoicingNavigation.application.logo
|
|
37
|
+
};
|
|
38
|
+
/** The structure and navigation the shell's regions show and the items' destinations resolve against. */ const invoicingNavigationModel = ()=>({
|
|
39
|
+
structure: new ApplicationStructureIndex(invoicingStructure),
|
|
40
|
+
navigation: invoicingNavigation
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export { invoicingApplication, invoicingComposition, invoicingDefaultSampleDataId, invoicingNavigationModel };
|
|
44
|
+
//# sourceMappingURL=invoicingApplication.js.map
|