@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.
Files changed (134) hide show
  1. package/README.md +66 -2
  2. package/blueprint.ts +16 -0
  3. package/blueprintCatalog.json +132 -0
  4. package/dist/cjs/blueprint.js +19 -0
  5. package/dist/cjs/blueprint.js.map +1 -0
  6. package/dist/cjs/index.js +69 -0
  7. package/dist/cjs/index.js.map +1 -0
  8. package/dist/cjs/invoicingApplication.js +49 -0
  9. package/dist/cjs/invoicingApplication.js.map +1 -0
  10. package/dist/cjs/invoicingParts.js +151 -0
  11. package/dist/cjs/invoicingParts.js.map +1 -0
  12. package/dist/cjs/invoicingQueries.js +66 -0
  13. package/dist/cjs/invoicingQueries.js.map +1 -0
  14. package/dist/cjs/invoicingScreenSet.js +47 -0
  15. package/dist/cjs/invoicingScreenSet.js.map +1 -0
  16. package/dist/cjs/manifest.js +87 -0
  17. package/dist/cjs/manifest.js.map +1 -0
  18. package/dist/cjs/navigation.js +117 -0
  19. package/dist/cjs/navigation.js.map +1 -0
  20. package/dist/cjs/package.json +3 -0
  21. package/dist/cjs/packageName.js +8 -0
  22. package/dist/cjs/packageName.js.map +1 -0
  23. package/dist/cjs/screens/index.js +22 -0
  24. package/dist/cjs/screens/index.js.map +1 -0
  25. package/dist/cjs/templateProvenance.js +24 -0
  26. package/dist/cjs/templateProvenance.js.map +1 -0
  27. package/dist/cjs/templates/calendarTemplate.js +109 -0
  28. package/dist/cjs/templates/calendarTemplate.js.map +1 -0
  29. package/dist/cjs/templates/dashboardTemplates.js +153 -0
  30. package/dist/cjs/templates/dashboardTemplates.js.map +1 -0
  31. package/dist/cjs/templates/formTemplates.js +51 -0
  32. package/dist/cjs/templates/formTemplates.js.map +1 -0
  33. package/dist/cjs/templates/index.js +27 -0
  34. package/dist/cjs/templates/index.js.map +1 -0
  35. package/dist/cjs/templates/listTemplates.js +166 -0
  36. package/dist/cjs/templates/listTemplates.js.map +1 -0
  37. package/dist/cjs/templates/recordTemplates.js +144 -0
  38. package/dist/cjs/templates/recordTemplates.js.map +1 -0
  39. package/dist/esm/blueprint.d.ts +3 -0
  40. package/dist/esm/blueprint.d.ts.map +1 -0
  41. package/dist/esm/blueprint.js +17 -0
  42. package/dist/esm/blueprint.js.map +1 -0
  43. package/dist/esm/index.d.ts +12 -0
  44. package/dist/esm/index.d.ts.map +1 -0
  45. package/dist/esm/index.js +18 -0
  46. package/dist/esm/index.js.map +1 -0
  47. package/dist/esm/invoicingApplication.d.ts +10 -0
  48. package/dist/esm/invoicingApplication.d.ts.map +1 -0
  49. package/dist/esm/invoicingApplication.js +44 -0
  50. package/dist/esm/invoicingApplication.js.map +1 -0
  51. package/dist/esm/invoicingParts.d.ts +16 -0
  52. package/dist/esm/invoicingParts.d.ts.map +1 -0
  53. package/dist/esm/invoicingParts.js +133 -0
  54. package/dist/esm/invoicingParts.js.map +1 -0
  55. package/dist/esm/invoicingQueries.d.ts +39 -0
  56. package/dist/esm/invoicingQueries.d.ts.map +1 -0
  57. package/dist/esm/invoicingQueries.js +58 -0
  58. package/dist/esm/invoicingQueries.js.map +1 -0
  59. package/dist/esm/invoicingScreenSet.d.ts +7 -0
  60. package/dist/esm/invoicingScreenSet.d.ts.map +1 -0
  61. package/dist/esm/invoicingScreenSet.js +45 -0
  62. package/dist/esm/invoicingScreenSet.js.map +1 -0
  63. package/dist/esm/manifest.d.ts +3 -0
  64. package/dist/esm/manifest.d.ts.map +1 -0
  65. package/dist/esm/manifest.js +85 -0
  66. package/dist/esm/manifest.js.map +1 -0
  67. package/dist/esm/navigation.d.ts +5 -0
  68. package/dist/esm/navigation.d.ts.map +1 -0
  69. package/dist/esm/navigation.js +113 -0
  70. package/dist/esm/navigation.js.map +1 -0
  71. package/dist/esm/package.json +3 -0
  72. package/dist/esm/packageName.d.ts +2 -0
  73. package/dist/esm/packageName.d.ts.map +1 -0
  74. package/dist/esm/packageName.js +6 -0
  75. package/dist/esm/packageName.js.map +1 -0
  76. package/dist/esm/screens/index.d.ts +3 -0
  77. package/dist/esm/screens/index.d.ts.map +1 -0
  78. package/dist/esm/screens/index.js +20 -0
  79. package/dist/esm/screens/index.js.map +1 -0
  80. package/dist/esm/templateProvenance.d.ts +3 -0
  81. package/dist/esm/templateProvenance.d.ts.map +1 -0
  82. package/dist/esm/templateProvenance.js +22 -0
  83. package/dist/esm/templateProvenance.js.map +1 -0
  84. package/dist/esm/templates/calendarTemplate.d.ts +3 -0
  85. package/dist/esm/templates/calendarTemplate.d.ts.map +1 -0
  86. package/dist/esm/templates/calendarTemplate.js +107 -0
  87. package/dist/esm/templates/calendarTemplate.js.map +1 -0
  88. package/dist/esm/templates/dashboardTemplates.d.ts +3 -0
  89. package/dist/esm/templates/dashboardTemplates.d.ts.map +1 -0
  90. package/dist/esm/templates/dashboardTemplates.js +151 -0
  91. package/dist/esm/templates/dashboardTemplates.js.map +1 -0
  92. package/dist/esm/templates/formTemplates.d.ts +3 -0
  93. package/dist/esm/templates/formTemplates.d.ts.map +1 -0
  94. package/dist/esm/templates/formTemplates.js +49 -0
  95. package/dist/esm/templates/formTemplates.js.map +1 -0
  96. package/dist/esm/templates/index.d.ts +8 -0
  97. package/dist/esm/templates/index.d.ts.map +1 -0
  98. package/dist/esm/templates/index.js +18 -0
  99. package/dist/esm/templates/index.js.map +1 -0
  100. package/dist/esm/templates/listTemplates.d.ts +4 -0
  101. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  102. package/dist/esm/templates/listTemplates.js +163 -0
  103. package/dist/esm/templates/listTemplates.js.map +1 -0
  104. package/dist/esm/templates/recordTemplates.d.ts +3 -0
  105. package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
  106. package/dist/esm/templates/recordTemplates.js +142 -0
  107. package/dist/esm/templates/recordTemplates.js.map +1 -0
  108. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  109. package/index.ts +14 -0
  110. package/invoicingApplication.ts +28 -0
  111. package/invoicingParts.ts +58 -0
  112. package/invoicingQueries.ts +58 -0
  113. package/invoicingScreenSet.ts +22 -0
  114. package/manifest.ts +41 -0
  115. package/navigation.ts +54 -0
  116. package/package.json +78 -4
  117. package/packageName.ts +5 -0
  118. package/sampleData/invoicing-en.json +988 -0
  119. package/screens/index.ts +20 -0
  120. package/templateProvenance.ts +15 -0
  121. package/templates/calendarTemplate.ts +57 -0
  122. package/templates/dashboardTemplates.ts +76 -0
  123. package/templates/formTemplates.ts +34 -0
  124. package/templates/index.ts +18 -0
  125. package/templates/listTemplates.ts +106 -0
  126. package/templates/recordTemplates.ts +79 -0
  127. package/thumbnails/InvoicePage.svg +17 -0
  128. package/thumbnails/InvoicesList.svg +29 -0
  129. package/thumbnails/InvoicingDueDates.svg +34 -0
  130. package/thumbnails/InvoicingOverview.svg +15 -0
  131. package/thumbnails/InvoicingQuickCreateInvoice.svg +12 -0
  132. package/thumbnails/InvoicingRecordPayment.svg +12 -0
  133. package/thumbnails/PaymentsList.svg +29 -0
  134. package/thumbnails/invoicing.svg +14 -0
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * The screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure
7
+ * and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.
8
+ */ const invoicingScreenDefinitions = [
9
+ {
10
+ name: 'invoicing.overview',
11
+ title: 'Overview',
12
+ template: 'InvoicingOverview',
13
+ order: 0,
14
+ description: 'What is owed, what is overdue and what came in this month.'
15
+ },
16
+ {
17
+ name: 'invoicing.list',
18
+ title: 'Invoices',
19
+ template: 'InvoicesList',
20
+ order: 1,
21
+ description: 'Every invoice with what is owed and its status.'
22
+ },
23
+ {
24
+ name: 'invoicing.record',
25
+ title: 'Invoice',
26
+ template: 'InvoicePage',
27
+ parent: 'invoicing.list',
28
+ description: 'One invoice: key facts, its lines, its payments and its activity.'
29
+ },
30
+ {
31
+ name: 'invoicing.payments',
32
+ title: 'Payments',
33
+ template: 'PaymentsList',
34
+ order: 2,
35
+ description: 'The payments received and the invoices they settled.'
36
+ },
37
+ {
38
+ name: 'invoicing.due',
39
+ title: 'Due dates',
40
+ template: 'InvoicingDueDates',
41
+ order: 3,
42
+ description: 'The day each invoice falls due, on a calendar.'
43
+ }
44
+ ];
45
+
46
+ exports.invoicingScreenDefinitions = invoicingScreenDefinitions;
47
+ //# sourceMappingURL=invoicingScreenSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoicingScreenSet.js","sources":["../../invoicingScreenSet.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BlueprintScreen } from '@cratis/scene.model';\n\n/** One ready-to-use screen: the qualified name that is also its place in the application (`invoicing.list.record` would be the `record` feature of `list`). */\nexport interface InvoicingScreenDefinition extends BlueprintScreen {\n template: string;\n description: string;\n}\n\n/**\n * The screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure\n * and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.\n */\nexport const invoicingScreenDefinitions: InvoicingScreenDefinition[] = [\n { name: 'invoicing.overview', title: 'Overview', template: 'InvoicingOverview', order: 0, description: 'What is owed, what is overdue and what came in this month.' },\n { name: 'invoicing.list', title: 'Invoices', template: 'InvoicesList', order: 1, description: 'Every invoice with what is owed and its status.' },\n { name: 'invoicing.record', title: 'Invoice', template: 'InvoicePage', parent: 'invoicing.list', description: 'One invoice: key facts, its lines, its payments and its activity.' },\n { name: 'invoicing.payments', title: 'Payments', template: 'PaymentsList', order: 2, description: 'The payments received and the invoices they settled.' },\n { name: 'invoicing.due', title: 'Due dates', template: 'InvoicingDueDates', order: 3, description: 'The day each invoice falls due, on a calendar.' },\n];\n"],"names":["invoicingScreenDefinitions","name","title","template","order","description","parent"],"mappings":";;AAAA;AACA;AAUA;;;UAIaA,0BAAAA,GAA0D;AACnE,IAAA;QAAEC,IAAAA,EAAM,oBAAA;QAAsBC,KAAAA,EAAO,UAAA;QAAYC,QAAAA,EAAU,mBAAA;QAAqBC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAA6D,KAAA;AACpK,IAAA;QAAEJ,IAAAA,EAAM,gBAAA;QAAkBC,KAAAA,EAAO,UAAA;QAAYC,QAAAA,EAAU,cAAA;QAAgBC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAAkD,KAAA;AAChJ,IAAA;QAAEJ,IAAAA,EAAM,kBAAA;QAAoBC,KAAAA,EAAO,SAAA;QAAWC,QAAAA,EAAU,aAAA;QAAeG,MAAAA,EAAQ,gBAAA;QAAkBD,WAAAA,EAAa;AAAoE,KAAA;AAClL,IAAA;QAAEJ,IAAAA,EAAM,oBAAA;QAAsBC,KAAAA,EAAO,UAAA;QAAYC,QAAAA,EAAU,cAAA;QAAgBC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAAuD,KAAA;AACzJ,IAAA;QAAEJ,IAAAA,EAAM,eAAA;QAAiBC,KAAAA,EAAO,WAAA;QAAaC,QAAAA,EAAU,mBAAA;QAAqBC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAAiD;;;"}
@@ -0,0 +1,87 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+ var packageName = require('./packageName.js');
5
+ var invoicingScreenSet = require('./invoicingScreenSet.js');
6
+ var index = require('./templates/index.js');
7
+ var formTemplates = require('./templates/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
+ const description = 'Invoices for a finance team: a receivables overview, an invoice list, an invoice page with its lines and payments, the payments received and a due-date calendar.';
12
+ /**
13
+ * This blueprint's declaration. A domain blueprint depends on the foundation set (`Cratis.Blueprint.Default`) and reuses its layouts, slots,
14
+ * components and themes - it ships none of its own - and adds what is specific to the domain: templates, a ready-to-use screen set, sample data
15
+ * and thumbnails. The package `version` is the blueprint's version: it is what a template reference pins and what "update available" compares.
16
+ */ const invoicingBlueprintManifest = {
17
+ name: packageName.invoicingBlueprintName,
18
+ version: '1.0.0',
19
+ kind: scene_model.PackageKind.Blueprint,
20
+ dependencies: [
21
+ {
22
+ name: 'Cratis.Blueprint.Default',
23
+ versionRange: '^1.0.0'
24
+ }
25
+ ],
26
+ components: [],
27
+ layouts: [],
28
+ screenTemplates: index.invoicingScreenTemplates.map((template)=>template.name),
29
+ dialogTemplates: formTemplates.invoicingDialogs.map((template)=>template.name),
30
+ themes: [],
31
+ displayName: 'Invoicing',
32
+ description,
33
+ module: '@cratis/scene.blueprint.invoicing',
34
+ license: 'MIT',
35
+ licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
36
+ sampleData: [
37
+ {
38
+ id: 'invoicing-en',
39
+ title: 'Invoicing · English',
40
+ locale: 'en-GB',
41
+ path: 'sampleData/invoicing-en.json',
42
+ description: 'English invoicing data: twelve invoices for six customers from draft to paid, one invoice\'s lines and payments, the payments received and the receivables figures.',
43
+ columns: [
44
+ 'Invoice',
45
+ 'Customer',
46
+ 'Issued',
47
+ 'Due',
48
+ 'Amount'
49
+ ],
50
+ statusColumn: 'Status',
51
+ statuses: {
52
+ good: [
53
+ 'Paid'
54
+ ],
55
+ pending: [
56
+ 'Draft',
57
+ 'Sent'
58
+ ],
59
+ bad: [
60
+ 'Overdue',
61
+ 'Void'
62
+ ]
63
+ }
64
+ }
65
+ ],
66
+ blueprint: {
67
+ domain: 'invoicing',
68
+ description,
69
+ thumbnail: 'thumbnails/invoicing.svg',
70
+ screenSet: invoicingScreenSet.invoicingScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order })=>({
71
+ name,
72
+ title,
73
+ description: screenDescription,
74
+ template,
75
+ ...parent === undefined ? {} : {
76
+ parent
77
+ },
78
+ ...order === undefined ? {} : {
79
+ order
80
+ }
81
+ })),
82
+ defaultSampleData: 'invoicing-en'
83
+ }
84
+ };
85
+
86
+ exports.invoicingBlueprintManifest = invoicingBlueprintManifest;
87
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sources":["../../manifest.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 { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { invoicingBlueprintName } from './packageName';\nimport { invoicingScreenDefinitions } from './invoicingScreenSet';\nimport { invoicingDialogTemplates, invoicingScreenTemplates } from './templates';\n\nconst description = 'Invoices for a finance team: a receivables overview, an invoice list, an invoice page with its lines and payments, the payments received and a due-date calendar.';\n\n/**\n * This blueprint's declaration. A domain blueprint depends on the foundation set (`Cratis.Blueprint.Default`) and reuses its layouts, slots,\n * components and themes - it ships none of its own - and adds what is specific to the domain: templates, a ready-to-use screen set, sample data\n * and thumbnails. The package `version` is the blueprint's version: it is what a template reference pins and what \"update available\" compares.\n */\nexport const invoicingBlueprintManifest: ScenePackage = {\n name: invoicingBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],\n components: [],\n layouts: [],\n screenTemplates: invoicingScreenTemplates.map(template => template.name),\n dialogTemplates: invoicingDialogTemplates.map(template => template.name),\n themes: [],\n displayName: 'Invoicing',\n description,\n module: '@cratis/scene.blueprint.invoicing',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n sampleData: [{ id: 'invoicing-en', title: 'Invoicing · English', locale: 'en-GB', path: 'sampleData/invoicing-en.json', description: 'English invoicing data: twelve invoices for six customers from draft to paid, one invoice\\'s lines and payments, the payments received and the receivables figures.', columns: ['Invoice', 'Customer', 'Issued', 'Due', 'Amount'], statusColumn: 'Status', statuses: { good: ['Paid'], pending: ['Draft', 'Sent'], bad: ['Overdue', 'Void'] } }],\n blueprint: {\n domain: 'invoicing',\n description,\n thumbnail: 'thumbnails/invoicing.svg',\n screenSet: invoicingScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order }) => ({\n name, title, description: screenDescription, template, ...(parent === undefined ? {} : { parent }), ...(order === undefined ? {} : { order }),\n })),\n defaultSampleData: 'invoicing-en',\n },\n};\n"],"names":["description","invoicingBlueprintManifest","name","invoicingBlueprintName","version","kind","PackageKind","Blueprint","dependencies","versionRange","components","layouts","screenTemplates","invoicingScreenTemplates","map","template","dialogTemplates","invoicingDialogTemplates","themes","displayName","module","license","licenseUrl","sampleData","id","title","locale","path","columns","statusColumn","statuses","good","pending","bad","blueprint","domain","thumbnail","screenSet","invoicingScreenDefinitions","screenDescription","parent","order","undefined","defaultSampleData"],"mappings":";;;;;;;;AAAA;AACA;AAOA,MAAMA,WAAAA,GAAc,mKAAA;AAEpB;;;;UAKaC,0BAAAA,GAA2C;IACpDC,IAAAA,EAAMC,kCAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM,0BAAA;YAA4BO,YAAAA,EAAc;AAAS;AAAE,KAAA;AAC5EC,IAAAA,UAAAA,EAAY,EAAE;AACdC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiBC,+BAAyBC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASb,IAAI,CAAA;AACvEc,IAAAA,eAAAA,EAAiBC,+BAAyBH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASb,IAAI,CAAA;AACvEgB,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,WAAA;AACbnB,IAAAA,WAAAA;IACAoB,MAAAA,EAAQ,mCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY,mDAAA;IACZC,UAAAA,EAAY;AAAC,QAAA;YAAEC,EAAAA,EAAI,cAAA;YAAgBC,KAAAA,EAAO,qBAAA;YAAuBC,MAAAA,EAAQ,OAAA;YAASC,IAAAA,EAAM,8BAAA;YAAgC3B,WAAAA,EAAa,qKAAA;YAAuK4B,OAAAA,EAAS;AAAC,gBAAA,SAAA;AAAW,gBAAA,UAAA;AAAY,gBAAA,QAAA;AAAU,gBAAA,KAAA;AAAO,gBAAA;AAAS,aAAA;YAAEC,YAAAA,EAAc,QAAA;YAAUC,QAAAA,EAAU;gBAAEC,IAAAA,EAAM;AAAC,oBAAA;AAAO,iBAAA;gBAAEC,OAAAA,EAAS;AAAC,oBAAA,OAAA;AAAS,oBAAA;AAAO,iBAAA;gBAAEC,GAAAA,EAAK;AAAC,oBAAA,SAAA;AAAW,oBAAA;AAAO;AAAC;AAAE;AAAE,KAAA;IACtdC,SAAAA,EAAW;QACPC,MAAAA,EAAQ,WAAA;AACRnC,QAAAA,WAAAA;QACAoC,SAAAA,EAAW,0BAAA;AACXC,QAAAA,SAAAA,EAAWC,8CAA2BxB,GAAG,CAAC,CAAC,EAAEZ,IAAI,EAAEuB,KAAK,EAAEzB,aAAauC,iBAAiB,EAAExB,QAAQ,EAAEyB,MAAM,EAAEC,KAAK,EAAE,IAAM;AACrHvC,gBAAAA,IAAAA;AAAMuB,gBAAAA,KAAAA;gBAAOzB,WAAAA,EAAauC,iBAAAA;AAAmBxB,gBAAAA,QAAAA;gBAAU,GAAIyB,MAAAA,KAAWE,SAAAA,GAAY,EAAC,GAAI;AAAEF,oBAAAA;iBAAQ;gBAAG,GAAIC,KAAAA,KAAUC,SAAAA,GAAY,EAAC,GAAI;AAAED,oBAAAA;;aACzI,CAAA,CAAA;QACAE,iBAAAA,EAAmB;AACvB;AACJ;;"}
@@ -0,0 +1,117 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+ var invoicingScreenSet = require('./invoicingScreenSet.js');
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */ const invoicingModule = 'invoicing';
9
+ /**
10
+ * The application structure the screen set implies: one module, `invoicing`, a feature for each screen and the sub-features beneath it (`invoicing.record` is the
11
+ * `record` feature of the module). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.
12
+ */ const invoicingStructure = (()=>{
13
+ const root = {
14
+ id: invoicingModule,
15
+ name: 'Invoicing',
16
+ features: []};
17
+ for (const screen of invoicingScreenSet.invoicingScreenDefinitions){
18
+ let parent = root;
19
+ for (const id of screen.name.split('.').slice(1)){
20
+ let node = parent.features.find((candidate)=>candidate.id === id);
21
+ if (!node) {
22
+ node = {
23
+ id,
24
+ name: screen.title,
25
+ features: [],
26
+ slices: []
27
+ };
28
+ parent.features.push(node);
29
+ }
30
+ parent = node;
31
+ }
32
+ }
33
+ return {
34
+ modules: [
35
+ {
36
+ id: root.id,
37
+ name: root.name,
38
+ features: root.features
39
+ }
40
+ ]
41
+ };
42
+ })();
43
+ /**
44
+ * The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists
45
+ * the places a team goes: Overview, Invoices, Payments, Due dates.
46
+ */ const invoicingNavigation = {
47
+ application: {
48
+ logo: {
49
+ image: '',
50
+ title: 'Invoicing'
51
+ },
52
+ regions: [
53
+ {
54
+ region: scene_model.NavigationRegionKind.Topbar,
55
+ items: [
56
+ {
57
+ id: 'invoicing',
58
+ title: 'Invoicing',
59
+ target: {
60
+ module: invoicingModule
61
+ }
62
+ }
63
+ ]
64
+ }
65
+ ]
66
+ },
67
+ modules: [
68
+ {
69
+ module: invoicingModule,
70
+ regions: [
71
+ {
72
+ region: scene_model.NavigationRegionKind.Sidebar,
73
+ mode: scene_model.NavigationRegionMode.Override,
74
+ items: [
75
+ {
76
+ id: 'overview',
77
+ title: 'Overview',
78
+ target: {
79
+ module: invoicingModule,
80
+ feature: 'overview'
81
+ }
82
+ },
83
+ {
84
+ id: 'list',
85
+ title: 'Invoices',
86
+ target: {
87
+ module: invoicingModule,
88
+ feature: 'list'
89
+ }
90
+ },
91
+ {
92
+ id: 'payments',
93
+ title: 'Payments',
94
+ target: {
95
+ module: invoicingModule,
96
+ feature: 'payments'
97
+ }
98
+ },
99
+ {
100
+ id: 'due',
101
+ title: 'Due dates',
102
+ target: {
103
+ module: invoicingModule,
104
+ feature: 'due'
105
+ }
106
+ }
107
+ ]
108
+ }
109
+ ]
110
+ }
111
+ ]
112
+ };
113
+
114
+ exports.invoicingModule = invoicingModule;
115
+ exports.invoicingNavigation = invoicingNavigation;
116
+ exports.invoicingStructure = invoicingStructure;
117
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sources":["../../navigation.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 { ApplicationStructure, NavigationModel, NavigationRegionKind, NavigationRegionMode } from '@cratis/scene.model';\nimport { invoicingScreenDefinitions } from './invoicingScreenSet';\n\n/** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */\nexport const invoicingModule = 'invoicing';\n\n/**\n * The application structure the screen set implies: one module, `invoicing`, a feature for each screen and the sub-features beneath it (`invoicing.record` is the\n * `record` feature of the module). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.\n */\nexport const invoicingStructure: ApplicationStructure = (() => {\n interface Node { id: string; name: string; features: Node[]; slices: never[] }\n const root: Node = { id: invoicingModule, name: 'Invoicing', features: [], slices: [] };\n for (const screen of invoicingScreenDefinitions) {\n let parent = root;\n for (const id of screen.name.split('.').slice(1)) {\n let node = parent.features.find(candidate => candidate.id === id);\n if (!node) {\n node = { id, name: screen.title, features: [], slices: [] };\n parent.features.push(node);\n }\n parent = node;\n }\n }\n\n return { modules: [{ id: root.id, name: root.name, features: root.features }] } as unknown as ApplicationStructure;\n})();\n\n/**\n * The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists\n * the places a team goes: Overview, Invoices, Payments, Due dates.\n */\nexport const invoicingNavigation: NavigationModel = {\n application: {\n logo: { image: '', title: 'Invoicing' },\n regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'invoicing', title: 'Invoicing', target: { module: invoicingModule } }] }],\n },\n modules: [{\n module: invoicingModule,\n regions: [{\n region: NavigationRegionKind.Sidebar,\n mode: NavigationRegionMode.Override,\n items: [\n { id: 'overview', title: 'Overview', target: { module: invoicingModule, feature: 'overview' } },\n { id: 'list', title: 'Invoices', target: { module: invoicingModule, feature: 'list' } },\n { id: 'payments', title: 'Payments', target: { module: invoicingModule, feature: 'payments' } },\n { id: 'due', title: 'Due dates', target: { module: invoicingModule, feature: 'due' } },\n ],\n }],\n }],\n};\n"],"names":["invoicingModule","invoicingStructure","root","id","name","features","screen","invoicingScreenDefinitions","parent","split","slice","node","find","candidate","title","slices","push","modules","invoicingNavigation","application","logo","image","regions","region","NavigationRegionKind","Topbar","items","target","module","Sidebar","mode","NavigationRegionMode","Override","feature"],"mappings":";;;;;AAAA;AACA;AAKA,8GACO,MAAMA,eAAAA,GAAkB;AAE/B;;;AAGC,IACM,MAAMC,kBAAAA,GAA4C,CAAA,IAAA;AAErD,IAAA,MAAMC,IAAAA,GAAa;QAAEC,EAAAA,EAAIH,eAAAA;QAAiBI,IAAAA,EAAM,WAAA;AAAaC,QAAAA,QAAAA,EAAU,EAAe,CAAA;IACtF,KAAK,MAAMC,UAAUC,6CAAAA,CAA4B;AAC7C,QAAA,IAAIC,MAAAA,GAASN,IAAAA;QACb,KAAK,MAAMC,EAAAA,IAAMG,MAAAA,CAAOF,IAAI,CAACK,KAAK,CAAC,GAAA,CAAA,CAAKC,KAAK,CAAC,CAAA,CAAA,CAAI;YAC9C,IAAIC,IAAAA,GAAOH,MAAAA,CAAOH,QAAQ,CAACO,IAAI,CAACC,CAAAA,SAAAA,GAAaA,SAAAA,CAAUV,EAAE,KAAKA,EAAAA,CAAAA;AAC9D,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,EAAQ5B,eAAAA;gCAAiBiC,OAAAA,EAAS;AAAW;AAAE,yBAAA;AAC9F,wBAAA;4BAAE9B,EAAAA,EAAI,MAAA;4BAAQW,KAAAA,EAAO,UAAA;4BAAYa,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,eAAAA;gCAAiBiC,OAAAA,EAAS;AAAO;AAAE,yBAAA;AACtF,wBAAA;4BAAE9B,EAAAA,EAAI,UAAA;4BAAYW,KAAAA,EAAO,UAAA;4BAAYa,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,eAAAA;gCAAiBiC,OAAAA,EAAS;AAAW;AAAE,yBAAA;AAC9F,wBAAA;4BAAE9B,EAAAA,EAAI,KAAA;4BAAOW,KAAAA,EAAO,WAAA;4BAAaa,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,eAAAA;gCAAiBiC,OAAAA,EAAS;AAAM;AAAE;AACxF;AACL;AAAE;AACN;AAAE;AACN;;;;"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */ const invoicingBlueprintName = 'Cratis.Blueprint.Invoicing';
6
+
7
+ exports.invoicingBlueprintName = invoicingBlueprintName;
8
+ //# sourceMappingURL=packageName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageName.js","sources":["../../packageName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */\nexport const invoicingBlueprintName = 'Cratis.Blueprint.Invoicing';\n"],"names":["invoicingBlueprintName"],"mappings":";;AAAA;AACA;AAEA,iHACO,MAAMA,sBAAAA,GAAyB;;"}
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
4
+ var invoicingScreenSet = require('../invoicingScreenSet.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
+ /**
9
+ * The ready-to-use screens: real `Screen` instances, one for each entry of the manifest's `blueprint.screenSet`, each filling the screen template it names in
10
+ * the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`invoicingNavigation`).
11
+ */ const invoicingScreens = invoicingScreenSet.invoicingScreenDefinitions.map((definition)=>({
12
+ name: definition.name,
13
+ layout: scene_blueprint_default.LayoutName.AppShell,
14
+ screenTemplate: definition.template,
15
+ slotContent: {},
16
+ forms: [],
17
+ contributions: [],
18
+ path: definition.name.split('.')
19
+ }));
20
+
21
+ exports.invoicingScreens = invoicingScreens;
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../screens/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 { Screen } from '@cratis/scene.model';\nimport { LayoutName } from '@cratis/scene.blueprint.default';\nimport { invoicingScreenDefinitions } from '../invoicingScreenSet';\n\n/**\n * The ready-to-use screens: real `Screen` instances, one for each entry of the manifest's `blueprint.screenSet`, each filling the screen template it names in\n * the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`invoicingNavigation`).\n */\nexport const invoicingScreens: Screen[] = invoicingScreenDefinitions.map(definition => ({\n name: definition.name,\n layout: LayoutName.AppShell,\n screenTemplate: definition.template,\n slotContent: {},\n forms: [],\n contributions: [],\n path: definition.name.split('.'),\n}));\n"],"names":["invoicingScreens","invoicingScreenDefinitions","map","definition","name","layout","LayoutName","AppShell","screenTemplate","template","slotContent","forms","contributions","path","split"],"mappings":";;;;;AAAA;AACA;AAMA;;;UAIaA,gBAAAA,GAA6BC,6CAAAA,CAA2BC,GAAG,CAACC,CAAAA,cAAe;AACpFC,QAAAA,IAAAA,EAAMD,WAAWC,IAAI;AACrBC,QAAAA,MAAAA,EAAQC,mCAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBL,WAAWM,QAAQ;AACnCC,QAAAA,WAAAA,EAAa,EAAC;AACdC,QAAAA,KAAAA,EAAO,EAAE;AACTC,QAAAA,aAAAA,EAAe,EAAE;AACjBC,QAAAA,IAAAA,EAAMV,UAAAA,CAAWC,IAAI,CAACU,KAAK,CAAC,GAAA;AAChC,KAAA,CAAA;;"}
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /** The compatibility, attribution and license metadata every template this blueprint ships carries. */ const invoicingTemplateProvenance = {
6
+ compatibility: {
7
+ scene: '^4.13.0',
8
+ packages: [
9
+ {
10
+ name: 'Cratis.Blueprint.Default',
11
+ versionRange: '^1.0.0'
12
+ }
13
+ ]
14
+ },
15
+ attribution: {
16
+ author: 'Cratis',
17
+ url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.invoicing'
18
+ },
19
+ license: 'MIT',
20
+ licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
21
+ };
22
+
23
+ exports.invoicingTemplateProvenance = invoicingTemplateProvenance;
24
+ //# sourceMappingURL=templateProvenance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templateProvenance.js","sources":["../../templateProvenance.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 { TemplateMetadata } from '@cratis/scene.model';\n\n/** The compatibility, attribution and license metadata every template this blueprint ships carries. */\nexport const invoicingTemplateProvenance: Pick<TemplateMetadata, 'compatibility' | 'attribution' | 'license' | 'licenseUrl'> = {\n compatibility: {\n scene: '^4.13.0',\n packages: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],\n },\n attribution: { author: 'Cratis', url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.invoicing' },\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n"],"names":["invoicingTemplateProvenance","compatibility","scene","packages","name","versionRange","attribution","author","url","license","licenseUrl"],"mappings":";;AAAA;AACA;AAIA,wGACO,MAAMA,2BAAAA,GAAkH;IAC3HC,aAAAA,EAAe;QACXC,KAAAA,EAAO,SAAA;QACPC,QAAAA,EAAU;AAAC,YAAA;gBAAEC,IAAAA,EAAM,0BAAA;gBAA4BC,YAAAA,EAAc;AAAS;AAAE;AAC5E,KAAA;IACAC,WAAAA,EAAa;QAAEC,MAAAA,EAAQ,QAAA;QAAUC,GAAAA,EAAK;AAAkF,KAAA;IACxHC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;;"}
@@ -0,0 +1,109 @@
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 calendar: the foundation's `calendarGrid` on a month, a week or as an agenda. The status is told in words as well as by color, the day and view are kept in the
12
+ * address so a link shares the calendar as it is, and the list beside it names everything in the period.
13
+ */ function calendarOf(options) {
14
+ const id = options.name;
15
+ return {
16
+ name: options.name,
17
+ fitsSlot: 'content',
18
+ slots: [
19
+ {
20
+ name: 'header'
21
+ },
22
+ {
23
+ name: 'calendar'
24
+ },
25
+ {
26
+ name: 'due'
27
+ }
28
+ ],
29
+ arrangement: {
30
+ root: scene_blueprint_default.column([
31
+ scene_blueprint_default.slotLeaf('header'),
32
+ scene_blueprint_default.grid([
33
+ scene_blueprint_default.slotLeaf('calendar', {
34
+ span: 2
35
+ }),
36
+ scene_blueprint_default.slotLeaf('due')
37
+ ], 3, 16)
38
+ ], 16),
39
+ overrides: [
40
+ {
41
+ width: scene_model.WidthSizeClass.Compact,
42
+ root: scene_blueprint_default.column([
43
+ scene_blueprint_default.slotLeaf('header'),
44
+ scene_blueprint_default.slotLeaf('calendar'),
45
+ scene_blueprint_default.slotLeaf('due')
46
+ ], 16)
47
+ }
48
+ ]
49
+ },
50
+ content: {
51
+ header: [
52
+ scene_blueprint_default.component(`${id}-header`, 'pageHeader', {
53
+ title: options.title,
54
+ subtitle: options.subtitle
55
+ }, {
56
+ actions: 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)))
57
+ })
58
+ ],
59
+ calendar: [
60
+ scene_blueprint_default.component(`${id}-grid`, 'calendarGrid', {
61
+ label: options.label,
62
+ events: invoicingQueries.fromQuery(options.events),
63
+ date: invoicingQueries.fromQuery(invoicingQueries.InvoicingQuery.Settings, '0.today'),
64
+ urlKey: 'day',
65
+ ...invoicingQueries.localeOfData
66
+ })
67
+ ],
68
+ due: [
69
+ scene_blueprint_default.component(`${id}-list`, 'dataList', {
70
+ label: options.listLabel,
71
+ rows: invoicingQueries.fromQuery(options.events),
72
+ columns: invoicingQueries.fromQuery(options.columns),
73
+ titleField: options.titleField,
74
+ pageSize: 6,
75
+ ...invoicingQueries.localeOfData
76
+ })
77
+ ]
78
+ },
79
+ displayName: options.displayName,
80
+ description: options.description,
81
+ metadata: invoicingParts.invoicingMetadata(options.name, 'Calendar', [
82
+ scene_model.TemplateScope.Module,
83
+ scene_model.TemplateScope.Feature
84
+ ])
85
+ };
86
+ }
87
+ /** The due-date calendar: the day each invoice falls due on a month, a week or an agenda; the status is told in words as well as by color, and the list beside it names every invoice due in the period. */ const invoicingDueDatesTemplate = calendarOf({
88
+ name: 'InvoicingDueDates',
89
+ displayName: 'Invoicing due-date calendar',
90
+ description: 'The day each invoice falls due, on a month, a week or as an agenda, with the status told in words.',
91
+ title: 'Due dates',
92
+ subtitle: 'When each invoice falls due',
93
+ label: 'Invoice due dates',
94
+ listLabel: 'Due in this period',
95
+ events: invoicingQueries.InvoicingQuery.DueDates,
96
+ columns: invoicingQueries.InvoicingQuery.DueColumns,
97
+ titleField: 'title',
98
+ actions: [
99
+ {
100
+ id: 'invoices',
101
+ label: 'Open the invoices',
102
+ emphasis: 'secondary',
103
+ screen: 'invoicing.list'
104
+ }
105
+ ]
106
+ });
107
+
108
+ exports.invoicingDueDatesTemplate = invoicingDueDatesTemplate;
109
+ //# sourceMappingURL=calendarTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendarTemplate.js","sources":["../../../templates/calendarTemplate.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, WidthSizeClass } from '@cratis/scene.model';\nimport { column, grid, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { InvoicingQuery, fromQuery, localeOfData } from '../invoicingQueries';\nimport { actionButton, component, goesTo, invoicingMetadata, opensDialog, withBehaviors } from '../invoicingParts';\n\ninterface Action { id: string; label: string; emphasis: 'primary' | 'secondary' | 'quiet' | 'danger'; dialog?: string; screen?: string }\n\ninterface CalendarOptions {\n name: string;\n displayName: string;\n description: string;\n title: string;\n subtitle: string;\n label: string;\n listLabel: string;\n events: string;\n columns: string;\n titleField: string;\n actions: Action[];\n}\n\n/**\n * One calendar: the foundation's `calendarGrid` on a month, a week or as an agenda. The status is told in words as well as by color, the day and view are kept in the\n * address so a link shares the calendar as it is, and the list beside it names everything in the period.\n */\nfunction calendarOf(options: CalendarOptions): ScreenTemplate {\n const id = options.name;\n return {\n name: options.name,\n fitsSlot: 'content',\n slots: [{ name: 'header' }, { name: 'calendar' }, { name: 'due' }],\n arrangement: {\n root: column([slotLeaf('header'), grid([slotLeaf('calendar', { span: 2 }), slotLeaf('due')], 3, 16)], 16),\n overrides: [{ width: WidthSizeClass.Compact, root: column([slotLeaf('header'), slotLeaf('calendar'), slotLeaf('due')], 16) }],\n },\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 calendar: [component(`${id}-grid`, 'calendarGrid', { label: options.label, events: fromQuery(options.events), date: fromQuery(InvoicingQuery.Settings, '0.today'), urlKey: 'day', ...localeOfData })],\n due: [component(`${id}-list`, 'dataList', { label: options.listLabel, rows: fromQuery(options.events), columns: fromQuery(options.columns), titleField: options.titleField, pageSize: 6, ...localeOfData })],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: invoicingMetadata(options.name, 'Calendar', [TemplateScope.Module, TemplateScope.Feature]),\n };\n}\n\n/** The due-date calendar: the day each invoice falls due on a month, a week or an agenda; the status is told in words as well as by color, and the list beside it names every invoice due in the period. */\nexport const invoicingDueDatesTemplate = calendarOf({\n name: 'InvoicingDueDates', displayName: 'Invoicing due-date calendar', description: 'The day each invoice falls due, on a month, a week or as an agenda, with the status told in words.', title: 'Due dates', subtitle: 'When each invoice falls due', label: 'Invoice due dates', listLabel: 'Due in this period',\n events: InvoicingQuery.DueDates, columns: InvoicingQuery.DueColumns, titleField: 'title',\n actions: [{ id: 'invoices', label: 'Open the invoices', emphasis: 'secondary', screen: 'invoicing.list' }],\n});\n"],"names":["calendarOf","options","id","name","fitsSlot","slots","arrangement","root","column","slotLeaf","grid","span","overrides","width","WidthSizeClass","Compact","content","header","component","title","subtitle","actions","map","action","withBehaviors","actionButton","label","emphasis","dialog","opensDialog","goesTo","screen","calendar","events","fromQuery","date","InvoicingQuery","Settings","urlKey","localeOfData","due","listLabel","rows","columns","titleField","pageSize","displayName","description","metadata","invoicingMetadata","TemplateScope","Module","Feature","invoicingDueDatesT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,CAAQE,IAAI,EAAE,UAAA,EAAY;AAAC+C,YAAAA,yBAAAA,CAAcC,MAAM;AAAED,YAAAA,yBAAAA,CAAcE;AAAQ,SAAA;AACvG,KAAA;AACJ;AAEA,6MACO,MAAMC,yBAAAA,GAA4BrD,UAAAA,CAAW;IAChDG,IAAAA,EAAM,mBAAA;IAAqB2C,WAAAA,EAAa,6BAAA;IAA+BC,WAAAA,EAAa,oGAAA;IAAsG5B,KAAAA,EAAO,WAAA;IAAaC,QAAAA,EAAU,6BAAA;IAA+BM,KAAAA,EAAO,mBAAA;IAAqBe,SAAAA,EAAW,oBAAA;AAC9RR,IAAAA,MAAAA,EAAQG,gCAAekB,QAAQ;AAAEX,IAAAA,OAAAA,EAASP,gCAAemB,UAAU;IAAEX,UAAAA,EAAY,OAAA;IACjFvB,OAAAA,EAAS;AAAC,QAAA;YAAEnB,EAAAA,EAAI,UAAA;YAAYwB,KAAAA,EAAO,mBAAA;YAAqBC,QAAAA,EAAU,WAAA;YAAaI,MAAAA,EAAQ;AAAiB;AAAE;AAC9G,CAAA;;"}
@@ -0,0 +1,153 @@
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 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
12
+ * loading, empty and error states, so one failed query leaves the others on the page.
13
+ */ function dashboardOf(options) {
14
+ const id = options.name;
15
+ return {
16
+ name: options.name,
17
+ fitsSlot: 'content',
18
+ slots: scene_blueprint_default.dashboardScreenTemplate.slots,
19
+ arrangement: scene_blueprint_default.dashboardScreenTemplate.arrangement,
20
+ content: {
21
+ header: [
22
+ scene_blueprint_default.component(`${id}-header`, 'pageHeader', {
23
+ title: options.title,
24
+ subtitle: options.subtitle
25
+ }, {
26
+ actions: 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)))
27
+ })
28
+ ],
29
+ kpis: options.figures.map((figure)=>scene_blueprint_default.component(`${id}-${figure.id}`, 'statCard', {
30
+ label: figure.label,
31
+ value: invoicingQueries.fromQuery(figure.query, `${figure.index}.value`),
32
+ change: invoicingQueries.fromQuery(figure.query, `${figure.index}.change`),
33
+ comparison: figure.comparison,
34
+ ...figure.format ? {
35
+ format: figure.format
36
+ } : {},
37
+ ...figure.fractionDigits === undefined ? {} : {
38
+ fractionDigits: figure.fractionDigits
39
+ },
40
+ ...figure.goodDirection ? {
41
+ goodDirection: figure.goodDirection
42
+ } : {},
43
+ ...invoicingQueries.currencyOfData
44
+ })),
45
+ charts: options.charts.map((chart)=>scene_blueprint_default.component(`${id}-${chart.id}`, 'chartWrapper', {
46
+ title: chart.title,
47
+ kind: chart.kind,
48
+ categories: invoicingQueries.fromQuery(chart.query, '0.categories'),
49
+ series: invoicingQueries.fromQuery(chart.query, '0.series'),
50
+ ...invoicingQueries.localeOfData
51
+ })),
52
+ tables: [
53
+ scene_blueprint_default.component(`${id}-table`, 'dataList', {
54
+ label: options.table.label,
55
+ rows: invoicingQueries.fromQuery(options.table.rows),
56
+ columns: invoicingQueries.fromQuery(options.table.columns),
57
+ titleField: options.table.titleField,
58
+ pageSize: options.table.pageSize,
59
+ ...invoicingQueries.localeOfData
60
+ })
61
+ ],
62
+ aside: [
63
+ options.aside.kind === 'activity' ? scene_blueprint_default.component(`${id}-aside`, 'activityFeed', {
64
+ label: options.aside.label,
65
+ entries: invoicingQueries.fromQuery(options.aside.query),
66
+ ...invoicingQueries.localeOfData
67
+ }) : scene_blueprint_default.component(`${id}-aside`, 'checklistSection', {
68
+ label: options.aside.label,
69
+ sections: invoicingQueries.fromQuery(options.aside.query),
70
+ ...invoicingQueries.localeOfData
71
+ })
72
+ ]
73
+ },
74
+ displayName: options.displayName,
75
+ description: options.description,
76
+ metadata: invoicingParts.invoicingMetadata(options.name, 'Dashboard', [
77
+ scene_model.TemplateScope.Module,
78
+ scene_model.TemplateScope.Feature
79
+ ])
80
+ };
81
+ }
82
+ /** 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. */ const invoicingOverviewTemplate = dashboardOf({
83
+ name: 'InvoicingOverview',
84
+ displayName: 'Invoicing overview',
85
+ description: 'Outstanding, overdue and collected this month, receivables by age, invoiced against collected and the invoices to chase.',
86
+ title: 'Receivables overview',
87
+ subtitle: 'What is owed and what has come in',
88
+ figures: [
89
+ {
90
+ id: 'outstanding',
91
+ label: 'Outstanding',
92
+ query: invoicingQueries.InvoicingQuery.Kpis,
93
+ index: 0,
94
+ format: 'currency',
95
+ goodDirection: 'down',
96
+ comparison: 'last month'
97
+ },
98
+ {
99
+ id: 'overdue',
100
+ label: 'Overdue',
101
+ query: invoicingQueries.InvoicingQuery.Kpis,
102
+ index: 1,
103
+ format: 'currency',
104
+ goodDirection: 'down',
105
+ comparison: 'last month'
106
+ },
107
+ {
108
+ id: 'collected',
109
+ label: 'Collected this month',
110
+ query: invoicingQueries.InvoicingQuery.Kpis,
111
+ index: 2,
112
+ format: 'currency',
113
+ comparison: 'last month'
114
+ }
115
+ ],
116
+ charts: [
117
+ {
118
+ id: 'aging',
119
+ title: 'Receivables by age',
120
+ kind: 'bar',
121
+ query: invoicingQueries.InvoicingQuery.Aging
122
+ },
123
+ {
124
+ id: 'flow',
125
+ title: 'Invoiced and collected',
126
+ kind: 'line',
127
+ query: invoicingQueries.InvoicingQuery.InvoicedAndCollected
128
+ }
129
+ ],
130
+ table: {
131
+ label: 'Invoices',
132
+ titleField: 'number',
133
+ pageSize: 5,
134
+ rows: invoicingQueries.invoicingQueriesOf(invoicingQueries.InvoicingEntityKind.Invoice).rows,
135
+ columns: invoicingQueries.invoicingQueriesOf(invoicingQueries.InvoicingEntityKind.Invoice).columns
136
+ },
137
+ aside: {
138
+ kind: 'activity',
139
+ label: 'Latest activity',
140
+ query: invoicingQueries.InvoicingQuery.Activity
141
+ },
142
+ actions: [
143
+ {
144
+ id: 'new',
145
+ label: 'New invoice',
146
+ emphasis: 'primary',
147
+ dialog: 'InvoicingQuickCreateInvoice'
148
+ }
149
+ ]
150
+ });
151
+
152
+ exports.invoicingOverviewTemplate = invoicingOverviewTemplate;
153
+ //# sourceMappingURL=dashboardTemplates.js.map