@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,3 @@
1
+ import { Screen } from '@cratis/scene.model';
2
+ export declare const invoicingScreens: Screen[];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../screens/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ7C,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAQlC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { LayoutName } from '@cratis/scene.blueprint.default';
2
+ import { invoicingScreenDefinitions } from '../invoicingScreenSet.js';
3
+
4
+ // Copyright (c) Cratis. All rights reserved.
5
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
6
+ /**
7
+ * 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
8
+ * the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`invoicingNavigation`).
9
+ */ const invoicingScreens = invoicingScreenDefinitions.map((definition)=>({
10
+ name: definition.name,
11
+ layout: LayoutName.AppShell,
12
+ screenTemplate: definition.template,
13
+ slotContent: {},
14
+ forms: [],
15
+ contributions: [],
16
+ path: definition.name.split('.')
17
+ }));
18
+
19
+ export { invoicingScreens };
20
+ //# 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,0BAAAA,CAA2BC,GAAG,CAACC,CAAAA,cAAe;AACpFC,QAAAA,IAAAA,EAAMD,WAAWC,IAAI;AACrBC,QAAAA,MAAAA,EAAQC,WAAWC,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,3 @@
1
+ import { TemplateMetadata } from '@cratis/scene.model';
2
+ export declare const invoicingTemplateProvenance: Pick<TemplateMetadata, 'compatibility' | 'attribution' | 'license' | 'licenseUrl'>;
3
+ //# sourceMappingURL=templateProvenance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templateProvenance.d.ts","sourceRoot":"","sources":["../../templateProvenance.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,eAAO,MAAM,2BAA2B,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAQ1H,CAAC"}
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /** The compatibility, attribution and license metadata every template this blueprint ships carries. */ const invoicingTemplateProvenance = {
4
+ compatibility: {
5
+ scene: '^4.13.0',
6
+ packages: [
7
+ {
8
+ name: 'Cratis.Blueprint.Default',
9
+ versionRange: '^1.0.0'
10
+ }
11
+ ]
12
+ },
13
+ attribution: {
14
+ author: 'Cratis',
15
+ url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.invoicing'
16
+ },
17
+ license: 'MIT',
18
+ licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
19
+ };
20
+
21
+ export { invoicingTemplateProvenance };
22
+ //# 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,3 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const invoicingDueDatesTemplate: ScreenTemplate;
3
+ //# sourceMappingURL=calendarTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendarTemplate.d.ts","sourceRoot":"","sources":["../../../templates/calendarTemplate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiC,MAAM,qBAAqB,CAAC;AAiDpF,eAAO,MAAM,yBAAyB,gBAIpC,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { WidthSizeClass, TemplateScope } from '@cratis/scene.model';
2
+ import { component, column, slotLeaf, grid } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, InvoicingQuery } from '../invoicingQueries.js';
4
+ import { invoicingMetadata, withBehaviors, opensDialog, goesTo, actionButton } from '../invoicingParts.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
+ * 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
10
+ * address so a link shares the calendar as it is, and the list beside it names everything in the period.
11
+ */ function calendarOf(options) {
12
+ const id = options.name;
13
+ return {
14
+ name: options.name,
15
+ fitsSlot: 'content',
16
+ slots: [
17
+ {
18
+ name: 'header'
19
+ },
20
+ {
21
+ name: 'calendar'
22
+ },
23
+ {
24
+ name: 'due'
25
+ }
26
+ ],
27
+ arrangement: {
28
+ root: column([
29
+ slotLeaf('header'),
30
+ grid([
31
+ slotLeaf('calendar', {
32
+ span: 2
33
+ }),
34
+ slotLeaf('due')
35
+ ], 3, 16)
36
+ ], 16),
37
+ overrides: [
38
+ {
39
+ width: WidthSizeClass.Compact,
40
+ root: column([
41
+ slotLeaf('header'),
42
+ slotLeaf('calendar'),
43
+ slotLeaf('due')
44
+ ], 16)
45
+ }
46
+ ]
47
+ },
48
+ content: {
49
+ header: [
50
+ component(`${id}-header`, 'pageHeader', {
51
+ title: options.title,
52
+ subtitle: options.subtitle
53
+ }, {
54
+ actions: options.actions.map((action)=>withBehaviors(actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? opensDialog(action.dialog) : goesTo(action.screen)))
55
+ })
56
+ ],
57
+ calendar: [
58
+ component(`${id}-grid`, 'calendarGrid', {
59
+ label: options.label,
60
+ events: fromQuery(options.events),
61
+ date: fromQuery(InvoicingQuery.Settings, '0.today'),
62
+ urlKey: 'day',
63
+ ...localeOfData
64
+ })
65
+ ],
66
+ due: [
67
+ component(`${id}-list`, 'dataList', {
68
+ label: options.listLabel,
69
+ rows: fromQuery(options.events),
70
+ columns: fromQuery(options.columns),
71
+ titleField: options.titleField,
72
+ pageSize: 6,
73
+ ...localeOfData
74
+ })
75
+ ]
76
+ },
77
+ displayName: options.displayName,
78
+ description: options.description,
79
+ metadata: invoicingMetadata(options.name, 'Calendar', [
80
+ TemplateScope.Module,
81
+ TemplateScope.Feature
82
+ ])
83
+ };
84
+ }
85
+ /** 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({
86
+ name: 'InvoicingDueDates',
87
+ displayName: 'Invoicing due-date calendar',
88
+ description: 'The day each invoice falls due, on a month, a week or as an agenda, with the status told in words.',
89
+ title: 'Due dates',
90
+ subtitle: 'When each invoice falls due',
91
+ label: 'Invoice due dates',
92
+ listLabel: 'Due in this period',
93
+ events: InvoicingQuery.DueDates,
94
+ columns: InvoicingQuery.DueColumns,
95
+ titleField: 'title',
96
+ actions: [
97
+ {
98
+ id: 'invoices',
99
+ label: 'Open the invoices',
100
+ emphasis: 'secondary',
101
+ screen: 'invoicing.list'
102
+ }
103
+ ]
104
+ });
105
+
106
+ export { invoicingDueDatesTemplate };
107
+ //# 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","invoicingDueDatesTemplate","DueDates","DueColumns"],"mappings":";;;;;AAAA;AACA;AAuBA;;;IAIA,SAASA,WAAWC,OAAwB,EAAA;IACxC,MAAMC,EAAAA,GAAKD,QAAQE,IAAI;IACvB,OAAO;AACHA,QAAAA,IAAAA,EAAMF,QAAQE,IAAI;QAClBC,QAAAA,EAAU,SAAA;QACVC,KAAAA,EAAO;AAAC,YAAA;gBAAEF,IAAAA,EAAM;AAAS,aAAA;AAAG,YAAA;gBAAEA,IAAAA,EAAM;AAAW,aAAA;AAAG,YAAA;gBAAEA,IAAAA,EAAM;AAAM;AAAE,SAAA;QAClEG,WAAAA,EAAa;AACTC,YAAAA,IAAAA,EAAMC,MAAAA,CAAO;gBAACC,QAAAA,CAAS,QAAA,CAAA;gBAAWC,IAAAA,CAAK;AAACD,oBAAAA,QAAAA,CAAS,UAAA,EAAY;wBAAEE,IAAAA,EAAM;AAAE,qBAAA,CAAA;oBAAIF,QAAAA,CAAS,KAAA;AAAO,iBAAA,EAAE,CAAA,EAAG,EAAA;aAAI,EAAE,EAAA,CAAA;YACtGG,SAAAA,EAAW;AAAC,gBAAA;AAAEC,oBAAAA,KAAAA,EAAOC,eAAeC,OAAO;AAAER,oBAAAA,IAAAA,EAAMC,MAAAA,CAAO;wBAACC,QAAAA,CAAS,QAAA,CAAA;wBAAWA,QAAAA,CAAS,UAAA,CAAA;wBAAaA,QAAAA,CAAS,KAAA;qBAAO,EAAE,EAAA;AAAI;AAAE;AACjI,SAAA;QACAO,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,SAAAA,CAAU,CAAA,EAAGhB,EAAAA,CAAG,OAAO,CAAC,EAAE,YAAA,EAAc;AAAEiB,oBAAAA,KAAAA,EAAOlB,QAAQkB,KAAK;AA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Aa7C,QAAQ6C,WAAW;AAChCC,QAAAA,WAAAA,EAAa9C,QAAQ8C,WAAW;AAChCC,QAAAA,QAAAA,EAAUC,iBAAAA,CAAkBhD,OAAAA,CAAQE,IAAI,EAAE,UAAA,EAAY;AAAC+C,YAAAA,aAAAA,CAAcC,MAAM;AAAED,YAAAA,aAAAA,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,eAAekB,QAAQ;AAAEX,IAAAA,OAAAA,EAASP,eAAemB,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,3 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const invoicingOverviewTemplate: ScreenTemplate;
3
+ //# sourceMappingURL=dashboardTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboardTemplates.d.ts","sourceRoot":"","sources":["../../../templates/dashboardTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AA0DpE,eAAO,MAAM,yBAAyB,gBAcpC,CAAC"}
@@ -0,0 +1,151 @@
1
+ import { TemplateScope } from '@cratis/scene.model';
2
+ import { dashboardScreenTemplate, component } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, currencyOfData, InvoicingQuery, invoicingQueriesOf, InvoicingEntityKind } from '../invoicingQueries.js';
4
+ import { invoicingMetadata, withBehaviors, opensDialog, goesTo, actionButton } from '../invoicingParts.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
+ * 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
10
+ * loading, empty and error states, so one failed query leaves the others on the page.
11
+ */ function dashboardOf(options) {
12
+ const id = options.name;
13
+ return {
14
+ name: options.name,
15
+ fitsSlot: 'content',
16
+ slots: dashboardScreenTemplate.slots,
17
+ arrangement: dashboardScreenTemplate.arrangement,
18
+ content: {
19
+ header: [
20
+ component(`${id}-header`, 'pageHeader', {
21
+ title: options.title,
22
+ subtitle: options.subtitle
23
+ }, {
24
+ actions: options.actions.map((action)=>withBehaviors(actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? opensDialog(action.dialog) : goesTo(action.screen)))
25
+ })
26
+ ],
27
+ kpis: options.figures.map((figure)=>component(`${id}-${figure.id}`, 'statCard', {
28
+ label: figure.label,
29
+ value: fromQuery(figure.query, `${figure.index}.value`),
30
+ change: fromQuery(figure.query, `${figure.index}.change`),
31
+ comparison: figure.comparison,
32
+ ...figure.format ? {
33
+ format: figure.format
34
+ } : {},
35
+ ...figure.fractionDigits === undefined ? {} : {
36
+ fractionDigits: figure.fractionDigits
37
+ },
38
+ ...figure.goodDirection ? {
39
+ goodDirection: figure.goodDirection
40
+ } : {},
41
+ ...currencyOfData
42
+ })),
43
+ charts: options.charts.map((chart)=>component(`${id}-${chart.id}`, 'chartWrapper', {
44
+ title: chart.title,
45
+ kind: chart.kind,
46
+ categories: fromQuery(chart.query, '0.categories'),
47
+ series: fromQuery(chart.query, '0.series'),
48
+ ...localeOfData
49
+ })),
50
+ tables: [
51
+ component(`${id}-table`, 'dataList', {
52
+ label: options.table.label,
53
+ rows: fromQuery(options.table.rows),
54
+ columns: fromQuery(options.table.columns),
55
+ titleField: options.table.titleField,
56
+ pageSize: options.table.pageSize,
57
+ ...localeOfData
58
+ })
59
+ ],
60
+ aside: [
61
+ options.aside.kind === 'activity' ? component(`${id}-aside`, 'activityFeed', {
62
+ label: options.aside.label,
63
+ entries: fromQuery(options.aside.query),
64
+ ...localeOfData
65
+ }) : component(`${id}-aside`, 'checklistSection', {
66
+ label: options.aside.label,
67
+ sections: fromQuery(options.aside.query),
68
+ ...localeOfData
69
+ })
70
+ ]
71
+ },
72
+ displayName: options.displayName,
73
+ description: options.description,
74
+ metadata: invoicingMetadata(options.name, 'Dashboard', [
75
+ TemplateScope.Module,
76
+ TemplateScope.Feature
77
+ ])
78
+ };
79
+ }
80
+ /** 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({
81
+ name: 'InvoicingOverview',
82
+ displayName: 'Invoicing overview',
83
+ description: 'Outstanding, overdue and collected this month, receivables by age, invoiced against collected and the invoices to chase.',
84
+ title: 'Receivables overview',
85
+ subtitle: 'What is owed and what has come in',
86
+ figures: [
87
+ {
88
+ id: 'outstanding',
89
+ label: 'Outstanding',
90
+ query: InvoicingQuery.Kpis,
91
+ index: 0,
92
+ format: 'currency',
93
+ goodDirection: 'down',
94
+ comparison: 'last month'
95
+ },
96
+ {
97
+ id: 'overdue',
98
+ label: 'Overdue',
99
+ query: InvoicingQuery.Kpis,
100
+ index: 1,
101
+ format: 'currency',
102
+ goodDirection: 'down',
103
+ comparison: 'last month'
104
+ },
105
+ {
106
+ id: 'collected',
107
+ label: 'Collected this month',
108
+ query: InvoicingQuery.Kpis,
109
+ index: 2,
110
+ format: 'currency',
111
+ comparison: 'last month'
112
+ }
113
+ ],
114
+ charts: [
115
+ {
116
+ id: 'aging',
117
+ title: 'Receivables by age',
118
+ kind: 'bar',
119
+ query: InvoicingQuery.Aging
120
+ },
121
+ {
122
+ id: 'flow',
123
+ title: 'Invoiced and collected',
124
+ kind: 'line',
125
+ query: InvoicingQuery.InvoicedAndCollected
126
+ }
127
+ ],
128
+ table: {
129
+ label: 'Invoices',
130
+ titleField: 'number',
131
+ pageSize: 5,
132
+ rows: invoicingQueriesOf(InvoicingEntityKind.Invoice).rows,
133
+ columns: invoicingQueriesOf(InvoicingEntityKind.Invoice).columns
134
+ },
135
+ aside: {
136
+ kind: 'activity',
137
+ label: 'Latest activity',
138
+ query: InvoicingQuery.Activity
139
+ },
140
+ actions: [
141
+ {
142
+ id: 'new',
143
+ label: 'New invoice',
144
+ emphasis: 'primary',
145
+ dialog: 'InvoicingQuickCreateInvoice'
146
+ }
147
+ ]
148
+ });
149
+
150
+ export { invoicingOverviewTemplate };
151
+ //# sourceMappingURL=dashboardTemplates.js.map
@@ -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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BC,OAAO,CAAA,CAAErB,IAAI;AAAEC,QAAAA,OAAAA,EAASkB,kBAAAA,CAAmBC,mBAAAA,CAAoBC,OAAO,CAAA,CAAEpB;AAAQ,KAAA;IAC5LG,KAAAA,EAAO;QAAEV,IAAAA,EAAM,UAAA;QAAYtB,KAAAA,EAAO,iBAAA;AAAmBW,QAAAA,KAAAA,EAAOgC,eAAeO;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,3 @@
1
+ import { DialogTemplate } from '@cratis/scene.model';
2
+ export declare const invoicingDialogs: DialogTemplate[];
3
+ //# sourceMappingURL=formTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formTemplates.d.ts","sourceRoot":"","sources":["../../../templates/formTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AA2BpE,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAG5C,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { TemplateScope } from '@cratis/scene.model';
2
+ import { quickCreateDialogTemplate, component } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, InvoicingQuery } from '../invoicingQueries.js';
4
+ import { invoicingMetadata, withBehaviors, closesDialog } from '../invoicingParts.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
+ * One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields
10
+ * that thing needs to get started.
11
+ */ function quickCreateOf(name, title, sections, noun, submit) {
12
+ return {
13
+ name,
14
+ slots: quickCreateDialogTemplate.slots,
15
+ content: {
16
+ header: [
17
+ component(`${name}-frame`, 'dialogFrame', {
18
+ title,
19
+ subtitle: 'Only what is needed to get started'
20
+ })
21
+ ],
22
+ body: [
23
+ withBehaviors(component(`${name}-form`, 'formScreenBody', {
24
+ mode: 'create',
25
+ saveAndNew: false,
26
+ strings: {
27
+ formSave: submit
28
+ },
29
+ sections: fromQuery(sections),
30
+ errors: fromQuery(InvoicingQuery.FormErrors, '0'),
31
+ ...localeOfData
32
+ }), closesDialog())
33
+ ],
34
+ actions: []
35
+ },
36
+ displayName: `Invoicing quick create ${noun}`,
37
+ description: `A short form that creates one ${noun} without leaving the page.`,
38
+ metadata: invoicingMetadata(name, 'Dialog', [
39
+ TemplateScope.Slice
40
+ ])
41
+ };
42
+ }
43
+ /** The quick dialogs of the blueprint. */ const invoicingDialogs = [
44
+ quickCreateOf('InvoicingQuickCreateInvoice', 'New invoice', 'InvoiceQuickSections', 'invoice', 'Create'),
45
+ quickCreateOf('InvoicingRecordPayment', 'Record a payment', 'InvoicingRecordPaymentSections', 'payment', 'Record payment')
46
+ ];
47
+
48
+ export { invoicingDialogs };
49
+ //# 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,0BAA0BD,KAAK;QACtCE,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,SAAAA,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,aAAAA,CAAcH,UAAU,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,SAAAA,CAAUf,QAAAA,CAAAA;oBAAWgB,MAAAA,EAAQD,SAAAA,CAAUE,cAAAA,CAAeC,UAAU,EAAE,GAAA,CAAA;AAAM,oBAAA,GAAGC;iBAC3J,CAAA,EAAIC,YAAAA,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,iBAAAA,CAAkB3B,MAAM,QAAA,EAAU;AAAC4B,YAAAA,aAAAA,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,8 @@
1
+ export * from './dashboardTemplates';
2
+ export * from './listTemplates';
3
+ export * from './recordTemplates';
4
+ export * from './calendarTemplate';
5
+ export * from './formTemplates';
6
+ export declare const invoicingScreenTemplates: import("@cratis/scene.model/screens").ScreenTemplate[];
7
+ export { invoicingDialogs as invoicingDialogTemplates } from './formTemplates';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../templates/index.ts"],"names":[],"mappings":"AAQA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAGhC,eAAO,MAAM,wBAAwB,wDAA0H,CAAC;AAEhK,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { invoicingOverviewTemplate } from './dashboardTemplates.js';
2
+ import { invoicesListTemplate, paymentsListTemplate } from './listTemplates.js';
3
+ import { invoicePageTemplate } from './recordTemplates.js';
4
+ import { invoicingDueDatesTemplate } from './calendarTemplate.js';
5
+ export { invoicingDialogs as invoicingDialogTemplates, invoicingDialogs } from './formTemplates.js';
6
+
7
+ // Copyright (c) Cratis. All rights reserved.
8
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
9
+ /** Every screen template this blueprint provides, in the order the manifest lists them. */ const invoicingScreenTemplates = [
10
+ invoicingOverviewTemplate,
11
+ invoicesListTemplate,
12
+ invoicePageTemplate,
13
+ paymentsListTemplate,
14
+ invoicingDueDatesTemplate
15
+ ];
16
+
17
+ export { invoicePageTemplate, invoicesListTemplate, invoicingDueDatesTemplate, invoicingOverviewTemplate, invoicingScreenTemplates, paymentsListTemplate };
18
+ //# 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,yBAAAA;AAA2BC,IAAAA,oBAAAA;AAAsBC,IAAAA,mBAAAA;AAAqBC,IAAAA,oBAAAA;AAAsBC,IAAAA;;;"}
@@ -0,0 +1,4 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const invoicesListTemplate: ScreenTemplate;
3
+ export declare const paymentsListTemplate: ScreenTemplate;
4
+ //# sourceMappingURL=listTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTemplates.d.ts","sourceRoot":"","sources":["../../../templates/listTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkF,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAsFpJ,eAAO,MAAM,oBAAoB,gBAM/B,CAAC;AAGH,eAAO,MAAM,oBAAoB,gBAO/B,CAAC"}