@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
package/README.md CHANGED
@@ -1,3 +1,67 @@
1
- # Temporary Holding Version
1
+ # Scene
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Describing a user interface without describing a platform** — Scene is the UI model of the Cratis
4
+ model-first layer (experimental).
5
+
6
+ The object model and runtime for Screenplay-based UIs: `Scene.Model` (platform-agnostic screens, layouts,
7
+ forms, contribution points, ui profiles and themes), `Scene.Engine` (binding/resolution runtime), and
8
+ `Scene.React` (the React renderer).
9
+
10
+ ## Packages / Deployables
11
+
12
+ [![Nuget](https://img.shields.io/nuget/v/Cratis.Scene.Model?logo=nuget)](http://nuget.org/packages/Cratis.Scene.Model)
13
+ [![NPM](https://img.shields.io/npm/v/@cratis/scene.model?label=@cratis/scene.model&logo=npm)](https://www.npmjs.com/package/@cratis/scene.model)
14
+ [![NPM](https://img.shields.io/npm/v/@cratis/scene.engine?label=@cratis/scene.engine&logo=npm)](https://www.npmjs.com/package/@cratis/scene.engine)
15
+ [![NPM](https://img.shields.io/npm/v/@cratis/scene.react?label=@cratis/scene.react&logo=npm)](https://www.npmjs.com/package/@cratis/scene.react)
16
+
17
+ ## Builds
18
+
19
+ [![.NET Build](https://github.com/cratis/scene/actions/workflows/dotnet-build.yml/badge.svg)](https://github.com/cratis/scene/actions/workflows/dotnet-build.yml)
20
+ [![JavaScript Build](https://github.com/cratis/scene/actions/workflows/javascript-build.yml/badge.svg)](https://github.com/cratis/scene/actions/workflows/javascript-build.yml)
21
+
22
+ ## Description
23
+
24
+ Scene owns the *object model and runtime* half of the Screenplay stack. In the model-first pipeline,
25
+ [Screenplay](https://github.com/Cratis/Screenplay) describes an event-sourced, CQRS system,
26
+ [Stage](https://github.com/Cratis/Stage) renders it into a running application, and Scene is how that
27
+ application's user interface is described — independently of any rendering platform.
28
+
29
+ `Scene.Model` is the platform-agnostic
30
+ C# object model that [Stage](https://github.com/Cratis/Stage) translates Screenplay's parsed language constructs into, and that [Studio](https://github.com/Cratis/Studio)'s
31
+ design-time tooling reads and writes. `Scene.Engine` walks that graph, resolves bindings (data, action, form,
32
+ navigation contribution) and drives whichever renderer is plugged in — it does not know React exists.
33
+ `Scene.React` is one renderer implementing the abstract vocabulary against real React/DOM; sibling positions
34
+ are reserved for future `Scene.Native` / `Scene.Desktop` renderers. Vendor and internal component packages
35
+ (PrimeReact, internal widget libraries) are adapters plugging into the renderer contract, not part of it.
36
+
37
+ The design-time editor built on top of this object model lives in Studio, not here — see
38
+ [StudioIssues#156](https://github.com/Cratis/StudioIssues/issues/156).
39
+
40
+ ## Support
41
+
42
+ Cratis is an open community, and we are glad to help users, teams evaluating the stack, and contributors.
43
+
44
+ | Channel | Details |
45
+ |---|---|
46
+ | Discord | Join the community on [Discord](https://discord.gg/kt4AMpV8WV) for questions and discussions |
47
+ | GitHub Issues | [Report bugs or request features](https://github.com/Cratis/Scene/issues) |
48
+ | Documentation | Read the docs at [cratis.io](https://cratis.io) |
49
+
50
+ ## The Cratis ecosystem
51
+
52
+ This project is part of [Cratis](https://www.cratis.io) — free, MIT-licensed tools for building event-sourced and CQRS applications.
53
+
54
+ - **[Chronicle](https://github.com/Cratis/Chronicle)** — event-sourcing database and runtime. Orleans-based kernel, pluggable storage (MongoDB default; PostgreSQL, SQL Server, SQLite, in-memory), language-agnostic gRPC contracts. [Docs](https://www.cratis.io/chronicle/)
55
+ - **Chronicle clients** — first-class [.NET SDK](https://github.com/Cratis/Chronicle), plus [TypeScript](https://github.com/Cratis/Chronicle.TypeScript), [Kotlin/Java](https://github.com/Cratis/Chronicle.Kotlin), and [Elixir](https://github.com/Cratis/Chronicle.Elixir); [Python](https://github.com/Cratis/Chronicle.Python) coming soon (pre-alpha). AI agents connect through the [Chronicle MCP server](https://github.com/Cratis/Chronicle.Mcp).
56
+ - **[Arc](https://github.com/Cratis/Arc)** — opinionated CQRS framework for ASP.NET Core with commands, queries, validation, authorization, and TypeScript proxy generation. Works without event sourcing. [Docs](https://www.cratis.io/arc/)
57
+ - **[Components](https://github.com/Cratis/Components)** — React components aligned with Arc patterns. [Docs](https://www.cratis.io/components/)
58
+ - **[CLI](https://github.com/Cratis/cli) + Workbench** — inspect and diagnose Chronicle from the terminal or the browser. [Docs](https://www.cratis.io/cli/)
59
+ - **Model-first layer (experimental)** — [Studio](https://github.com/Cratis/Studio), [Screenplay](https://github.com/Cratis/Screenplay), [Stage](https://github.com/Cratis/Stage), Scene (this repository), [Prologue](https://github.com/Cratis/Prologue)
60
+ - **Supporting** — [Fundamentals](https://github.com/Cratis/Fundamentals), [Specifications](https://github.com/Cratis/Specifications), [Synopsis](https://github.com/Cratis/Synopsis), [Lens](https://github.com/Cratis/Lens), [Narrator](https://github.com/Cratis/Narrator), and free [AI tooling](https://github.com/Cratis/AI) (preview); [Ensemble](https://github.com/Cratis/Ensemble) coming soon (pre-release)
61
+ - **[Samples](https://github.com/Cratis/Samples)** — runnable event sourcing and CQRS samples for the whole stack
62
+
63
+ Everything Cratis publishes today is MIT licensed and free to use.
64
+
65
+ ---
66
+
67
+ Part of the [Cratis](https://www.cratis.io) platform · [MIT](./LICENSE)
package/blueprint.ts ADDED
@@ -0,0 +1,16 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { ScenePackageBundle } from '@cratis/scene.react';
5
+ import { invoicingBlueprintManifest } from './manifest';
6
+ import { invoicingScreens } from './screens';
7
+ import { invoicingDialogTemplates, invoicingScreenTemplates } from './templates';
8
+
9
+ /** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */
10
+ export const invoicingBlueprint: ScenePackageBundle = {
11
+ manifest: invoicingBlueprintManifest,
12
+ components: {},
13
+ screenTemplates: invoicingScreenTemplates,
14
+ dialogTemplates: invoicingDialogTemplates,
15
+ screens: invoicingScreens,
16
+ };
@@ -0,0 +1,132 @@
1
+ {
2
+ "schema": 1,
3
+ "blueprints": [
4
+ {
5
+ "package": "Cratis.Blueprint.Invoicing",
6
+ "version": "1.0.0",
7
+ "domain": "invoicing",
8
+ "displayName": "Invoicing",
9
+ "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.",
10
+ "thumbnail": "thumbnails/invoicing.svg",
11
+ "license": "MIT",
12
+ "licenseUrl": "https://github.com/Cratis/Scene/blob/main/LICENSE",
13
+ "dependencies": [
14
+ {
15
+ "name": "Cratis.Blueprint.Default",
16
+ "versionRange": "^1.0.0"
17
+ }
18
+ ],
19
+ "screens": [
20
+ {
21
+ "name": "invoicing.overview",
22
+ "title": "Overview",
23
+ "description": "What is owed, what is overdue and what came in this month.",
24
+ "template": "InvoicingOverview",
25
+ "order": 0
26
+ },
27
+ {
28
+ "name": "invoicing.list",
29
+ "title": "Invoices",
30
+ "description": "Every invoice with what is owed and its status.",
31
+ "template": "InvoicesList",
32
+ "order": 1
33
+ },
34
+ {
35
+ "name": "invoicing.record",
36
+ "title": "Invoice",
37
+ "description": "One invoice: key facts, its lines, its payments and its activity.",
38
+ "template": "InvoicePage",
39
+ "parent": "invoicing.list"
40
+ },
41
+ {
42
+ "name": "invoicing.payments",
43
+ "title": "Payments",
44
+ "description": "The payments received and the invoices they settled.",
45
+ "template": "PaymentsList",
46
+ "order": 2
47
+ },
48
+ {
49
+ "name": "invoicing.due",
50
+ "title": "Due dates",
51
+ "description": "The day each invoice falls due, on a calendar.",
52
+ "template": "InvoicingDueDates",
53
+ "order": 3
54
+ }
55
+ ],
56
+ "templates": [
57
+ {
58
+ "name": "InvoicingOverview",
59
+ "kind": "ScreenTemplate",
60
+ "displayName": "Invoicing overview",
61
+ "description": "Outstanding, overdue and collected this month, receivables by age, invoiced against collected and the invoices to chase.",
62
+ "type": "Dashboard",
63
+ "category": "Business / Invoicing",
64
+ "thumbnail": "thumbnails/InvoicingOverview.svg"
65
+ },
66
+ {
67
+ "name": "InvoicesList",
68
+ "kind": "ScreenTemplate",
69
+ "displayName": "Invoices list",
70
+ "description": "Every invoice with its customer, issue and due dates, amount and status, filtered by customer, status and date.",
71
+ "type": "List",
72
+ "category": "Business / Invoicing",
73
+ "thumbnail": "thumbnails/InvoicesList.svg"
74
+ },
75
+ {
76
+ "name": "InvoicePage",
77
+ "kind": "ScreenTemplate",
78
+ "displayName": "Invoice page",
79
+ "description": "One invoice: status, total, paid and balance due, its details, lines and payments, and its activity.",
80
+ "type": "Detail",
81
+ "category": "Business / Invoicing",
82
+ "thumbnail": "thumbnails/InvoicePage.svg"
83
+ },
84
+ {
85
+ "name": "PaymentsList",
86
+ "kind": "ScreenTemplate",
87
+ "displayName": "Payments list",
88
+ "description": "The payments received with the invoice each settled, when and how, filtered by method and date.",
89
+ "type": "List",
90
+ "category": "Business / Invoicing",
91
+ "thumbnail": "thumbnails/PaymentsList.svg"
92
+ },
93
+ {
94
+ "name": "InvoicingDueDates",
95
+ "kind": "ScreenTemplate",
96
+ "displayName": "Invoicing due-date calendar",
97
+ "description": "The day each invoice falls due, on a month, a week or as an agenda, with the status told in words.",
98
+ "type": "Calendar",
99
+ "category": "Business / Invoicing",
100
+ "thumbnail": "thumbnails/InvoicingDueDates.svg"
101
+ },
102
+ {
103
+ "name": "InvoicingQuickCreateInvoice",
104
+ "kind": "DialogTemplate",
105
+ "displayName": "Invoicing quick create invoice",
106
+ "description": "A short form that creates one invoice without leaving the page.",
107
+ "type": "Dialog",
108
+ "category": "Business / Invoicing",
109
+ "thumbnail": "thumbnails/InvoicingQuickCreateInvoice.svg"
110
+ },
111
+ {
112
+ "name": "InvoicingRecordPayment",
113
+ "kind": "DialogTemplate",
114
+ "displayName": "Invoicing quick create payment",
115
+ "description": "A short form that creates one payment without leaving the page.",
116
+ "type": "Dialog",
117
+ "category": "Business / Invoicing",
118
+ "thumbnail": "thumbnails/InvoicingRecordPayment.svg"
119
+ }
120
+ ],
121
+ "sampleData": [
122
+ {
123
+ "id": "invoicing-en",
124
+ "title": "Invoicing · English",
125
+ "locale": "en-GB",
126
+ "path": "sampleData/invoicing-en.json",
127
+ "default": true
128
+ }
129
+ ]
130
+ }
131
+ ]
132
+ }
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var manifest = require('./manifest.js');
4
+ var index = require('./screens/index.js');
5
+ var index$1 = require('./templates/index.js');
6
+ var formTemplates = require('./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
+ /** 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 = {
11
+ manifest: manifest.invoicingBlueprintManifest,
12
+ components: {},
13
+ screenTemplates: index$1.invoicingScreenTemplates,
14
+ dialogTemplates: formTemplates.invoicingDialogs,
15
+ screens: index.invoicingScreens
16
+ };
17
+
18
+ exports.invoicingBlueprint = invoicingBlueprint;
19
+ //# 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,mCAAAA;AACVC,IAAAA,UAAAA,EAAY,EAAC;IACbC,eAAAA,EAAiBC,gCAAAA;IACjBC,eAAAA,EAAiBC,8BAAAA;IACjBC,OAAAA,EAASC;AACb;;"}
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ var packageName = require('./packageName.js');
4
+ var templateProvenance = require('./templateProvenance.js');
5
+ var invoicingQueries = require('./invoicingQueries.js');
6
+ var invoicingParts = require('./invoicingParts.js');
7
+ var invoicingScreenSet = require('./invoicingScreenSet.js');
8
+ var index = require('./templates/index.js');
9
+ var index$1 = require('./screens/index.js');
10
+ var navigation = require('./navigation.js');
11
+ var manifest = require('./manifest.js');
12
+ var blueprint = require('./blueprint.js');
13
+ var invoicingApplication = require('./invoicingApplication.js');
14
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
15
+ var recordTemplates = require('./templates/recordTemplates.js');
16
+ var listTemplates = require('./templates/listTemplates.js');
17
+ var formTemplates = require('./templates/formTemplates.js');
18
+ var calendarTemplate = require('./templates/calendarTemplate.js');
19
+ var dashboardTemplates = require('./templates/dashboardTemplates.js');
20
+
21
+
22
+
23
+ exports.invoicingBlueprintName = packageName.invoicingBlueprintName;
24
+ exports.invoicingTemplateProvenance = templateProvenance.invoicingTemplateProvenance;
25
+ exports.InvoicingEntityKind = invoicingQueries.InvoicingEntityKind;
26
+ exports.InvoicingQuery = invoicingQueries.InvoicingQuery;
27
+ exports.currencyOfData = invoicingQueries.currencyOfData;
28
+ exports.fromQuery = invoicingQueries.fromQuery;
29
+ exports.invoicingEntityPlural = invoicingQueries.invoicingEntityPlural;
30
+ exports.invoicingQueriesOf = invoicingQueries.invoicingQueriesOf;
31
+ exports.localeOfData = invoicingQueries.localeOfData;
32
+ exports.actionButton = invoicingParts.actionButton;
33
+ exports.closesDialog = invoicingParts.closesDialog;
34
+ exports.goesTo = invoicingParts.goesTo;
35
+ exports.invoicingCategory = invoicingParts.invoicingCategory;
36
+ exports.invoicingMetadata = invoicingParts.invoicingMetadata;
37
+ exports.opensDialog = invoicingParts.opensDialog;
38
+ exports.opensDialogOnSelect = invoicingParts.opensDialogOnSelect;
39
+ exports.opensRecordOnSelect = invoicingParts.opensRecordOnSelect;
40
+ exports.thumbnailOf = invoicingParts.thumbnailOf;
41
+ exports.withBehaviors = invoicingParts.withBehaviors;
42
+ exports.invoicingScreenDefinitions = invoicingScreenSet.invoicingScreenDefinitions;
43
+ exports.invoicingScreenTemplates = index.invoicingScreenTemplates;
44
+ exports.invoicingScreens = index$1.invoicingScreens;
45
+ exports.invoicingModule = navigation.invoicingModule;
46
+ exports.invoicingNavigation = navigation.invoicingNavigation;
47
+ exports.invoicingStructure = navigation.invoicingStructure;
48
+ exports.invoicingBlueprintManifest = manifest.invoicingBlueprintManifest;
49
+ exports.invoicingBlueprint = blueprint.invoicingBlueprint;
50
+ exports.invoicingApplication = invoicingApplication.invoicingApplication;
51
+ exports.invoicingComposition = invoicingApplication.invoicingComposition;
52
+ exports.invoicingDefaultSampleDataId = invoicingApplication.invoicingDefaultSampleDataId;
53
+ exports.invoicingNavigationModel = invoicingApplication.invoicingNavigationModel;
54
+ Object.defineProperty(exports, "component", {
55
+ enumerable: true,
56
+ get: function () { return scene_blueprint_default.component; }
57
+ });
58
+ Object.defineProperty(exports, "panel", {
59
+ enumerable: true,
60
+ get: function () { return scene_blueprint_default.panel; }
61
+ });
62
+ exports.invoicePageTemplate = recordTemplates.invoicePageTemplate;
63
+ exports.invoicesListTemplate = listTemplates.invoicesListTemplate;
64
+ exports.paymentsListTemplate = listTemplates.paymentsListTemplate;
65
+ exports.invoicingDialogTemplates = formTemplates.invoicingDialogs;
66
+ exports.invoicingDialogs = formTemplates.invoicingDialogs;
67
+ exports.invoicingDueDatesTemplate = calendarTemplate.invoicingDueDatesTemplate;
68
+ exports.invoicingOverviewTemplate = dashboardTemplates.invoicingOverviewTemplate;
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+
3
+ var scene_engine = require('@cratis/scene.engine');
4
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
5
+ var navigation = require('./navigation.js');
6
+ var index = require('./screens/index.js');
7
+ var index$1 = require('./templates/index.js');
8
+ var formTemplates = require('./templates/formTemplates.js');
9
+
10
+ // Copyright (c) Cratis. All rights reserved.
11
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
12
+ /** The id of the sample-data pack a new application starts with. */ const invoicingDefaultSampleDataId = 'invoicing-en';
13
+ /**
14
+ * The example application of the blueprint: the foundation's layouts, the Invoicing templates, the quick-create dialogs and their 5 screens, rendering against the
15
+ * foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture
16
+ * (`Samples/Invoicing/invoicing.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.
17
+ */ function invoicingApplication(sampleData = invoicingDefaultSampleDataId) {
18
+ const profile = {
19
+ ...scene_blueprint_default.previewProfile(undefined),
20
+ name: 'Invoicing',
21
+ sampleData: {
22
+ activePack: sampleData,
23
+ mappings: [],
24
+ bindings: []
25
+ }
26
+ };
27
+ return {
28
+ layouts: scene_blueprint_default.defaultLayouts,
29
+ screenTemplates: index$1.invoicingScreenTemplates,
30
+ dialogTemplates: formTemplates.invoicingDialogs,
31
+ screens: index.invoicingScreens,
32
+ uiProfiles: [
33
+ profile
34
+ ]
35
+ };
36
+ }
37
+ /** What a host composes the screens with: the application's logo, which the shell's topbar shows. */ const invoicingComposition = {
38
+ logo: navigation.invoicingNavigation.application.logo
39
+ };
40
+ /** The structure and navigation the shell's regions show and the items' destinations resolve against. */ const invoicingNavigationModel = ()=>({
41
+ structure: new scene_engine.ApplicationStructureIndex(navigation.invoicingStructure),
42
+ navigation: navigation.invoicingNavigation
43
+ });
44
+
45
+ exports.invoicingApplication = invoicingApplication;
46
+ exports.invoicingComposition = invoicingComposition;
47
+ exports.invoicingDefaultSampleDataId = invoicingDefaultSampleDataId;
48
+ exports.invoicingNavigationModel = invoicingNavigationModel;
49
+ //# sourceMappingURL=invoicingApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoicingApplication.js","sources":["../../invoicingApplication.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { UiProfile } from '@cratis/scene.model';\nimport { ApplicationStructureIndex } from '@cratis/scene.engine';\nimport { ApplicationDocument, CompositionOptions, defaultLayouts, previewProfile } from '@cratis/scene.blueprint.default';\nimport { invoicingNavigation, invoicingStructure } from './navigation';\nimport { invoicingScreens } from './screens';\nimport { invoicingDialogTemplates, invoicingScreenTemplates } from './templates';\n\n/** The id of the sample-data pack a new application starts with. */\nexport const invoicingDefaultSampleDataId = 'invoicing-en';\n\n/**\n * The example application of the blueprint: the foundation's layouts, the Invoicing templates, the quick-create dialogs and their 5 screens, rendering against the\n * foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture\n * (`Samples/Invoicing/invoicing.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.\n */\nexport function invoicingApplication(sampleData: string = invoicingDefaultSampleDataId): ApplicationDocument {\n const profile: UiProfile = { ...previewProfile(undefined), name: 'Invoicing', sampleData: { activePack: sampleData, mappings: [], bindings: [] } };\n return { layouts: defaultLayouts, screenTemplates: invoicingScreenTemplates, dialogTemplates: invoicingDialogTemplates, screens: invoicingScreens, uiProfiles: [profile] };\n}\n\n/** What a host composes the screens with: the application's logo, which the shell's topbar shows. */\nexport const invoicingComposition: CompositionOptions = { logo: invoicingNavigation.application.logo };\n\n/** The structure and navigation the shell's regions show and the items' destinations resolve against. */\nexport const invoicingNavigationModel = () => ({ structure: new ApplicationStructureIndex(invoicingStructure), navigation: invoicingNavigation });\n"],"names":["invoicingDefaultSampleDataId","invoicingApplication","sampleData","profile","previewProfile","undefined","name","activePack","mappings","bindings","layouts","defaultLayouts","screenTemplates","invoicingScreenTemplates","dialogTemplates","invoicingDialogTemplates","screens","invoicingScreens","uiProfiles","invoicingComposition","logo","invoicingNavigation","application","invoicingNavigationModel","structure","ApplicationStructureIndex","invoicingStructure","navigation"],"mappings":";;;;;;;;;AAAA;AACA;AASA,qEACO,MAAMA,4BAAAA,GAA+B;AAE5C;;;;AAIC,IACM,SAASC,oBAAAA,CAAqBC,UAAAA,GAAqBF,4BAA4B,EAAA;AAClF,IAAA,MAAMG,OAAAA,GAAqB;AAAE,QAAA,GAAGC,uCAAeC,SAAAA,CAAU;QAAEC,IAAAA,EAAM,WAAA;QAAaJ,UAAAA,EAAY;YAAEK,UAAAA,EAAYL,UAAAA;AAAYM,YAAAA,QAAAA,EAAU,EAAE;AAAEC,YAAAA,QAAAA,EAAU;AAAG;AAAE,KAAA;IACjJ,OAAO;QAAEC,OAAAA,EAASC,sCAAAA;QAAgBC,eAAAA,EAAiBC,gCAAAA;QAA0BC,eAAAA,EAAiBC,8BAAAA;QAA0BC,OAAAA,EAASC,sBAAAA;QAAkBC,UAAAA,EAAY;AAACf,YAAAA;AAAQ;AAAC,KAAA;AAC7K;AAEA,sGACO,MAAMgB,oBAAAA,GAA2C;IAAEC,IAAAA,EAAMC,8BAAAA,CAAoBC,WAAW,CAACF;AAAK;AAErG,0GACO,MAAMG,wBAAAA,GAA2B,KAAO;AAAEC,QAAAA,SAAAA,EAAW,IAAIC,sCAAAA,CAA0BC,6BAAAA,CAAAA;QAAqBC,UAAAA,EAAYN;AAAoB,KAAA;;;;;"}
@@ -0,0 +1,151 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
5
+ var templateProvenance = require('./templateProvenance.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
+ /** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */ const invoicingCategory = 'Business / Invoicing';
10
+ /** The package-relative thumbnail of a template. */ const thumbnailOf = (templateName)=>`thumbnails/${templateName}.svg`;
11
+ /** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */ const invoicingMetadata = (name, type, scopes)=>({
12
+ ...templateProvenance.invoicingTemplateProvenance,
13
+ type,
14
+ category: invoicingCategory,
15
+ thumbnail: thumbnailOf(name),
16
+ scopes
17
+ });
18
+ /** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */ const actionButton = (id, label, emphasis, extra = {}, behaviors)=>({
19
+ ...scene_blueprint_default.component(id, 'actionButton', {
20
+ label,
21
+ emphasis,
22
+ permission: 'enabled',
23
+ ...extra
24
+ }),
25
+ ...behaviors ? {
26
+ behaviors
27
+ } : {}
28
+ });
29
+ /** What pressing an element does: open the named dialog template over the page. */ const opensDialog = (dialogTemplate)=>[
30
+ {
31
+ bindings: [
32
+ {
33
+ trigger: {
34
+ kind: scene_model.InteractionTriggerKind.Click
35
+ },
36
+ actions: [
37
+ {
38
+ kind: scene_model.InteractionActionKind.OpenDialog,
39
+ dialogTemplate
40
+ }
41
+ ]
42
+ }
43
+ ]
44
+ }
45
+ ];
46
+ /** What pressing an element does: go to the named screen. */ const goesTo = (screen)=>[
47
+ {
48
+ bindings: [
49
+ {
50
+ trigger: {
51
+ kind: scene_model.InteractionTriggerKind.Click
52
+ },
53
+ actions: [
54
+ {
55
+ kind: scene_model.InteractionActionKind.Navigate,
56
+ screen
57
+ }
58
+ ]
59
+ }
60
+ ]
61
+ }
62
+ ];
63
+ /**
64
+ * What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is
65
+ * opening it - the way a table of records works everywhere.
66
+ */ const opensRecordOnSelect = (listId, screen)=>[
67
+ {
68
+ bindings: [
69
+ {
70
+ trigger: {
71
+ kind: scene_model.InteractionTriggerKind.Select
72
+ },
73
+ actions: [
74
+ {
75
+ kind: scene_model.InteractionActionKind.Navigate,
76
+ screen,
77
+ arguments: [
78
+ {
79
+ name: 'id',
80
+ value: {
81
+ kind: scene_model.BindingSourceKind.ComponentProperty,
82
+ componentId: listId,
83
+ path: 'value'
84
+ }
85
+ }
86
+ ]
87
+ }
88
+ ]
89
+ }
90
+ ]
91
+ }
92
+ ];
93
+ /**
94
+ * What choosing a row of a list does: open the named dialog over the page - a side sheet with the row's detail, so the list stays where it was.
95
+ */ const opensDialogOnSelect = (dialogTemplate)=>[
96
+ {
97
+ bindings: [
98
+ {
99
+ trigger: {
100
+ kind: scene_model.InteractionTriggerKind.Select
101
+ },
102
+ actions: [
103
+ {
104
+ kind: scene_model.InteractionActionKind.OpenDialog,
105
+ dialogTemplate
106
+ }
107
+ ]
108
+ }
109
+ ]
110
+ }
111
+ ];
112
+ /** What a Cancel or Close control does: close the dialog it was opened from. */ const closesDialog = ()=>[
113
+ {
114
+ bindings: [
115
+ {
116
+ trigger: {
117
+ kind: scene_model.InteractionTriggerKind.Click
118
+ },
119
+ actions: [
120
+ {
121
+ kind: scene_model.InteractionActionKind.CloseDialog
122
+ }
123
+ ]
124
+ }
125
+ ]
126
+ }
127
+ ];
128
+ /** An element with the given behaviors attached. */ const withBehaviors = (element, behaviors)=>({
129
+ ...element,
130
+ behaviors
131
+ });
132
+
133
+ Object.defineProperty(exports, "component", {
134
+ enumerable: true,
135
+ get: function () { return scene_blueprint_default.component; }
136
+ });
137
+ Object.defineProperty(exports, "panel", {
138
+ enumerable: true,
139
+ get: function () { return scene_blueprint_default.panel; }
140
+ });
141
+ exports.actionButton = actionButton;
142
+ exports.closesDialog = closesDialog;
143
+ exports.goesTo = goesTo;
144
+ exports.invoicingCategory = invoicingCategory;
145
+ exports.invoicingMetadata = invoicingMetadata;
146
+ exports.opensDialog = opensDialog;
147
+ exports.opensDialogOnSelect = opensDialogOnSelect;
148
+ exports.opensRecordOnSelect = opensRecordOnSelect;
149
+ exports.thumbnailOf = thumbnailOf;
150
+ exports.withBehaviors = withBehaviors;
151
+ //# sourceMappingURL=invoicingParts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoicingParts.js","sources":["../../invoicingParts.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n Behavior, BindingSourceKind, DialogTemplate, ExternalComponent, InteractionActionKind, InteractionTriggerKind, NavigateAction, OpenDialogAction, SceneElement, ScreenTemplate, TemplateMetadata, TemplateScope,\n} from '@cratis/scene.model';\nimport { component, panel } from '@cratis/scene.blueprint.default';\nimport { invoicingTemplateProvenance } from './templateProvenance';\n\nexport { component, panel };\n\n/** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */\nexport const invoicingCategory = 'Business / Invoicing';\n\n/** The package-relative thumbnail of a template. */\nexport const thumbnailOf = (templateName: string): string => `thumbnails/${templateName}.svg`;\n\n/** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */\nexport const invoicingMetadata = (name: string, type: 'Dashboard' | 'List' | 'Board' | 'Detail' | 'Form' | 'Dialog' | 'Workspace' | 'Calendar' | 'Timeline' | 'Inbox' | 'Profile' | 'Wizard', scopes: TemplateScope[]): TemplateMetadata =>\n ({ ...invoicingTemplateProvenance, type, category: invoicingCategory, thumbnail: thumbnailOf(name), scopes });\n\n/** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */\nexport const actionButton = (id: string, label: string, emphasis: 'primary' | 'secondary' | 'quiet' | 'danger', extra: Record<string, unknown> = {}, behaviors?: Behavior[]): ExternalComponent =>\n ({ ...component(id, 'actionButton', { label, emphasis, permission: 'enabled', ...extra }), ...(behaviors ? { behaviors } : {}) });\n\n/** What pressing an element does: open the named dialog template over the page. */\nexport const opensDialog = (dialogTemplate: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];\n\n/** What pressing an element does: go to the named screen. */\nexport const goesTo = (screen: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.Navigate, screen } as NavigateAction] }] }];\n\n/**\n * What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is\n * opening it - the way a table of records works everywhere.\n */\nexport const opensRecordOnSelect = (listId: string, screen: string): Behavior[] => [{\n bindings: [{\n trigger: { kind: InteractionTriggerKind.Select },\n actions: [{ kind: InteractionActionKind.Navigate, screen, arguments: [{ name: 'id', value: { kind: BindingSourceKind.ComponentProperty, componentId: listId, path: 'value' } }] } as NavigateAction],\n }],\n}];\n\n/**\n * What choosing a row of a list does: open the named dialog over the page - a side sheet with the row's detail, so the list stays where it was.\n */\nexport const opensDialogOnSelect = (dialogTemplate: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Select }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];\n\n/** What a Cancel or Close control does: close the dialog it was opened from. */\nexport const closesDialog = (): Behavior[] => [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.CloseDialog }] }] }];\n\n/** An element with the given behaviors attached. */\nexport const withBehaviors = <T extends SceneElement>(element: T, behaviors: Behavior[]): T => ({ ...element, behaviors });\n\nexport type InvoicingScreenTemplate = ScreenTemplate;\nexport type InvoicingDialogTemplate = DialogTemplate;\n"],"names":["invoicingCategory","thumbnailOf","templateName","invoicingMetadata","name","type","scopes","invoicingTemplateProvenance","category","thumbnail","actionButton","id","label","emphasis","extra","behaviors","component","permission","opensDialog","dialogTemplate","bindings","trigger","kind","InteractionTriggerKind","Click","actions","InteractionActionKind","OpenDialog","goesTo","screen","Navigate","opensRecordOnSelect","listId","Select","arguments","value","BindingSourceKind","ComponentProperty","componentId","path","opensDialogOnSelect","closesDialog","CloseDialog","withBehaviors","element"],"mappings":"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"}
@@ -0,0 +1,66 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ /**
8
+ * A property taken from a query result - never a value. A invoicing template declares *where* its data comes from and the sample-data pack, or the real
9
+ * query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).
10
+ */ const fromQuery = (query, path = '')=>({
11
+ kind: scene_model.BindingSourceKind.QueryResult,
12
+ query,
13
+ path
14
+ });
15
+ /** The queries of the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */ const InvoicingQuery = {
16
+ /** One row: the `locale` and `currency` the figures and dates are formatted in. */ Settings: 'InvoicingSettings',
17
+ Kpis: 'InvoicingKpis',
18
+ Aging: 'InvoicingAging',
19
+ InvoicedAndCollected: 'InvoicingInvoicedAndCollected',
20
+ Activity: 'InvoicingActivity',
21
+ DueDates: 'InvoicingDueDates',
22
+ DueColumns: 'InvoicingDueColumns',
23
+ FormErrors: 'InvoicingFormErrors'
24
+ };
25
+ /** The entities a template is made for. */ var InvoicingEntityKind = /*#__PURE__*/ function(InvoicingEntityKind) {
26
+ InvoicingEntityKind["Invoice"] = "Invoice";
27
+ InvoicingEntityKind["Payment"] = "Payment";
28
+ return InvoicingEntityKind;
29
+ }({});
30
+ /** The read model (and so the shape) the records of each entity are queried from. */ const invoicingEntityPlural = {
31
+ ["Invoice"]: 'Invoices',
32
+ ["Payment"]: 'Payments'
33
+ };
34
+ /**
35
+ * The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the
36
+ * list, its saved views and column choices, the selection, the sections of the quick form, and what the record page shows.
37
+ */ const invoicingQueriesOf = (entity)=>({
38
+ rows: invoicingEntityPlural[entity],
39
+ columns: `${entity}Columns`,
40
+ filterFields: `${entity}FilterFields`,
41
+ views: `${entity}Views`,
42
+ columnChoices: `${entity}ColumnChoices`,
43
+ selection: `${entity}Selection`,
44
+ quickSections: `${entity}QuickSections`,
45
+ record: `${entity}Record`,
46
+ sections: `${entity}Sections`,
47
+ summary: `${entity}Summary`,
48
+ activity: `${entity}Activity`,
49
+ tabs: `${entity}Tabs`
50
+ });
51
+ /** The locale and currency of the data, bound onto every component that formats a figure or a date. */ const localeOfData = {
52
+ locale: fromQuery(InvoicingQuery.Settings, '0.locale')
53
+ };
54
+ const currencyOfData = {
55
+ ...localeOfData,
56
+ currency: fromQuery(InvoicingQuery.Settings, '0.currency')
57
+ };
58
+
59
+ exports.InvoicingEntityKind = InvoicingEntityKind;
60
+ exports.InvoicingQuery = InvoicingQuery;
61
+ exports.currencyOfData = currencyOfData;
62
+ exports.fromQuery = fromQuery;
63
+ exports.invoicingEntityPlural = invoicingEntityPlural;
64
+ exports.invoicingQueriesOf = invoicingQueriesOf;
65
+ exports.localeOfData = localeOfData;
66
+ //# sourceMappingURL=invoicingQueries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoicingQueries.js","sources":["../../invoicingQueries.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingExpression, BindingSourceKind } from '@cratis/scene.model';\n\n/**\n * A property taken from a query result - never a value. A invoicing template declares *where* its data comes from and the sample-data pack, or the real\n * query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).\n */\nexport const fromQuery = (query: string, path = ''): BindingExpression => ({ kind: BindingSourceKind.QueryResult, query, path });\n\n/** The queries of the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */\nexport const InvoicingQuery = {\n /** One row: the `locale` and `currency` the figures and dates are formatted in. */\n Settings: 'InvoicingSettings',\n Kpis: 'InvoicingKpis',\n Aging: 'InvoicingAging',\n InvoicedAndCollected: 'InvoicingInvoicedAndCollected',\n Activity: 'InvoicingActivity',\n DueDates: 'InvoicingDueDates',\n DueColumns: 'InvoicingDueColumns',\n FormErrors: 'InvoicingFormErrors',\n} as const;\n\n/** The entities a template is made for. */\nexport enum InvoicingEntityKind {\n Invoice = 'Invoice',\n Payment = 'Payment',\n}\n\n/** The read model (and so the shape) the records of each entity are queried from. */\nexport const invoicingEntityPlural: Record<InvoicingEntityKind, string> = {\n [InvoicingEntityKind.Invoice]: 'Invoices',\n [InvoicingEntityKind.Payment]: 'Payments',\n};\n\n/**\n * The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the\n * list, its saved views and column choices, the selection, the sections of the quick form, and what the record page shows.\n */\nexport const invoicingQueriesOf = (entity: InvoicingEntityKind) => ({\n rows: invoicingEntityPlural[entity],\n columns: `${entity}Columns`,\n filterFields: `${entity}FilterFields`,\n views: `${entity}Views`,\n columnChoices: `${entity}ColumnChoices`,\n selection: `${entity}Selection`,\n quickSections: `${entity}QuickSections`,\n record: `${entity}Record`,\n sections: `${entity}Sections`,\n summary: `${entity}Summary`,\n activity: `${entity}Activity`,\n tabs: `${entity}Tabs`,\n});\n\n/** The locale and currency of the data, bound onto every component that formats a figure or a date. */\nexport const localeOfData = { locale: fromQuery(InvoicingQuery.Settings, '0.locale') };\nexport const currencyOfData = { ...localeOfData, currency: fromQuery(InvoicingQuery.Settings, '0.currency') };\n"],"names":["fromQuery","query","path","kind","BindingSourceKind","QueryResult","InvoicingQuery","Settings","Kpis","Aging","InvoicedAndCollected","Activity","DueDates","DueColumns","FormErrors","InvoicingEntityKind","invoicingEntityPlural","invoicingQueriesOf","entity","rows","columns","filterFields","views","columnChoices","selection","quickSections","record","sections","summary","activity","tabs","localeOfData","locale","currencyOfData","currency"],"mappings":";;;;AAAA;AACA;AAIA;;;UAIaA,SAAAA,GAAY,CAACC,OAAeC,IAAAA,GAAO,EAAE,IAAyB;AAAEC,QAAAA,IAAAA,EAAMC,8BAAkBC,WAAW;AAAEJ,QAAAA,KAAAA;AAAOC,QAAAA;AAAK,KAAA;AAE9H,qHACO,MAAMI,cAAAA,GAAiB;AAC1B,wFACAC,QAAAA,EAAU,mBAAA;IACVC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO,gBAAA;IACPC,oBAAAA,EAAsB,+BAAA;IACtBC,QAAAA,EAAU,mBAAA;IACVC,QAAAA,EAAU,mBAAA;IACVC,UAAAA,EAAY,qBAAA;IACZC,UAAAA,EAAY;AAChB;AAEA,4CACO,IAAKC,mBAAAA,iBAAAA,SAAAA,mBAAAA,EAAAA;;;AAAAA,IAAAA,OAAAA,mBAAAA;AAGX,CAAA,CAAA,EAAA;AAED,sFACO,MAAMC,qBAAAA,GAA6D;AACtE,IAAA,CAAA,SAAA,GAA+B,UAAA;AAC/B,IAAA,CAAA,SAAA,GAA+B;AACnC;AAEA;;;AAGC,IACM,MAAMC,kBAAAA,GAAqB,CAACC,UAAiC;QAChEC,IAAAA,EAAMH,qBAAqB,CAACE,MAAAA,CAAO;QACnCE,OAAAA,EAAS,CAAA,EAAGF,MAAAA,CAAO,OAAO,CAAC;QAC3BG,YAAAA,EAAc,CAAA,EAAGH,MAAAA,CAAO,YAAY,CAAC;QACrCI,KAAAA,EAAO,CAAA,EAAGJ,MAAAA,CAAO,KAAK,CAAC;QACvBK,aAAAA,EAAe,CAAA,EAAGL,MAAAA,CAAO,aAAa,CAAC;QACvCM,SAAAA,EAAW,CAAA,EAAGN,MAAAA,CAAO,SAAS,CAAC;QAC/BO,aAAAA,EAAe,CAAA,EAAGP,MAAAA,CAAO,aAAa,CAAC;QACvCQ,MAAAA,EAAQ,CAAA,EAAGR,MAAAA,CAAO,MAAM,CAAC;QACzBS,QAAAA,EAAU,CAAA,EAAGT,MAAAA,CAAO,QAAQ,CAAC;QAC7BU,OAAAA,EAAS,CAAA,EAAGV,MAAAA,CAAO,OAAO,CAAC;QAC3BW,QAAAA,EAAU,CAAA,EAAGX,MAAAA,CAAO,QAAQ,CAAC;QAC7BY,IAAAA,EAAM,CAAA,EAAGZ,MAAAA,CAAO,IAAI;AACxB,KAAA;AAEA,wGACO,MAAMa,YAAAA,GAAe;IAAEC,MAAAA,EAAQhC,SAAAA,CAAUM,cAAAA,CAAeC,QAAQ,EAAE,UAAA;AAAY;MACxE0B,cAAAA,GAAiB;AAAE,IAAA,GAAGF,YAAY;IAAEG,QAAAA,EAAUlC,SAAAA,CAAUM,cAAAA,CAAeC,QAAQ,EAAE,YAAA;AAAc;;;;;;;;"}