@cratis/scene.blueprint.inventory 0.0.0-stage → 4.50.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 (138) hide show
  1. package/blueprint.ts +16 -0
  2. package/blueprintCatalog.json +190 -0
  3. package/dist/cjs/blueprint.js +19 -0
  4. package/dist/cjs/blueprint.js.map +1 -0
  5. package/dist/cjs/index.js +72 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/cjs/inventoryApplication.js +49 -0
  8. package/dist/cjs/inventoryApplication.js.map +1 -0
  9. package/dist/cjs/inventoryParts.js +131 -0
  10. package/dist/cjs/inventoryParts.js.map +1 -0
  11. package/dist/cjs/inventoryQueries.js +72 -0
  12. package/dist/cjs/inventoryQueries.js.map +1 -0
  13. package/dist/cjs/inventoryScreenSet.js +69 -0
  14. package/dist/cjs/inventoryScreenSet.js.map +1 -0
  15. package/dist/cjs/manifest.js +65 -0
  16. package/dist/cjs/manifest.js.map +1 -0
  17. package/dist/cjs/navigation.js +143 -0
  18. package/dist/cjs/navigation.js.map +1 -0
  19. package/dist/cjs/package.json +3 -0
  20. package/dist/cjs/packageName.js +8 -0
  21. package/dist/cjs/packageName.js.map +1 -0
  22. package/dist/cjs/screens/index.js +22 -0
  23. package/dist/cjs/screens/index.js.map +1 -0
  24. package/dist/cjs/templateProvenance.js +24 -0
  25. package/dist/cjs/templateProvenance.js.map +1 -0
  26. package/dist/cjs/templates/dashboardTemplate.js +92 -0
  27. package/dist/cjs/templates/dashboardTemplate.js.map +1 -0
  28. package/dist/cjs/templates/formTemplates.js +94 -0
  29. package/dist/cjs/templates/formTemplates.js.map +1 -0
  30. package/dist/cjs/templates/index.js +34 -0
  31. package/dist/cjs/templates/index.js.map +1 -0
  32. package/dist/cjs/templates/listTemplates.js +212 -0
  33. package/dist/cjs/templates/listTemplates.js.map +1 -0
  34. package/dist/cjs/templates/locationsTemplate.js +63 -0
  35. package/dist/cjs/templates/locationsTemplate.js.map +1 -0
  36. package/dist/cjs/templates/recordTemplates.js +111 -0
  37. package/dist/cjs/templates/recordTemplates.js.map +1 -0
  38. package/dist/esm/blueprint.d.ts +3 -0
  39. package/dist/esm/blueprint.d.ts.map +1 -0
  40. package/dist/esm/blueprint.js +17 -0
  41. package/dist/esm/blueprint.js.map +1 -0
  42. package/dist/esm/index.d.ts +12 -0
  43. package/dist/esm/index.d.ts.map +1 -0
  44. package/dist/esm/index.js +18 -0
  45. package/dist/esm/index.js.map +1 -0
  46. package/dist/esm/inventoryApplication.d.ts +10 -0
  47. package/dist/esm/inventoryApplication.d.ts.map +1 -0
  48. package/dist/esm/inventoryApplication.js +44 -0
  49. package/dist/esm/inventoryApplication.js.map +1 -0
  50. package/dist/esm/inventoryParts.d.ts +15 -0
  51. package/dist/esm/inventoryParts.d.ts.map +1 -0
  52. package/dist/esm/inventoryParts.js +114 -0
  53. package/dist/esm/inventoryParts.js.map +1 -0
  54. package/dist/esm/inventoryQueries.d.ts +44 -0
  55. package/dist/esm/inventoryQueries.d.ts.map +1 -0
  56. package/dist/esm/inventoryQueries.js +64 -0
  57. package/dist/esm/inventoryQueries.js.map +1 -0
  58. package/dist/esm/inventoryScreenSet.d.ts +7 -0
  59. package/dist/esm/inventoryScreenSet.d.ts.map +1 -0
  60. package/dist/esm/inventoryScreenSet.js +67 -0
  61. package/dist/esm/inventoryScreenSet.js.map +1 -0
  62. package/dist/esm/manifest.d.ts +3 -0
  63. package/dist/esm/manifest.d.ts.map +1 -0
  64. package/dist/esm/manifest.js +63 -0
  65. package/dist/esm/manifest.js.map +1 -0
  66. package/dist/esm/navigation.d.ts +5 -0
  67. package/dist/esm/navigation.d.ts.map +1 -0
  68. package/dist/esm/navigation.js +139 -0
  69. package/dist/esm/navigation.js.map +1 -0
  70. package/dist/esm/package.json +3 -0
  71. package/dist/esm/packageName.d.ts +2 -0
  72. package/dist/esm/packageName.d.ts.map +1 -0
  73. package/dist/esm/packageName.js +6 -0
  74. package/dist/esm/packageName.js.map +1 -0
  75. package/dist/esm/screens/index.d.ts +3 -0
  76. package/dist/esm/screens/index.d.ts.map +1 -0
  77. package/dist/esm/screens/index.js +20 -0
  78. package/dist/esm/screens/index.js.map +1 -0
  79. package/dist/esm/templateProvenance.d.ts +3 -0
  80. package/dist/esm/templateProvenance.d.ts.map +1 -0
  81. package/dist/esm/templateProvenance.js +22 -0
  82. package/dist/esm/templateProvenance.js.map +1 -0
  83. package/dist/esm/templates/dashboardTemplate.d.ts +3 -0
  84. package/dist/esm/templates/dashboardTemplate.d.ts.map +1 -0
  85. package/dist/esm/templates/dashboardTemplate.js +90 -0
  86. package/dist/esm/templates/dashboardTemplate.js.map +1 -0
  87. package/dist/esm/templates/formTemplates.d.ts +5 -0
  88. package/dist/esm/templates/formTemplates.d.ts.map +1 -0
  89. package/dist/esm/templates/formTemplates.js +90 -0
  90. package/dist/esm/templates/formTemplates.js.map +1 -0
  91. package/dist/esm/templates/index.d.ts +8 -0
  92. package/dist/esm/templates/index.d.ts.map +1 -0
  93. package/dist/esm/templates/index.js +22 -0
  94. package/dist/esm/templates/index.js.map +1 -0
  95. package/dist/esm/templates/listTemplates.d.ts +6 -0
  96. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  97. package/dist/esm/templates/listTemplates.js +207 -0
  98. package/dist/esm/templates/listTemplates.js.map +1 -0
  99. package/dist/esm/templates/locationsTemplate.d.ts +3 -0
  100. package/dist/esm/templates/locationsTemplate.d.ts.map +1 -0
  101. package/dist/esm/templates/locationsTemplate.js +61 -0
  102. package/dist/esm/templates/locationsTemplate.js.map +1 -0
  103. package/dist/esm/templates/recordTemplates.d.ts +3 -0
  104. package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
  105. package/dist/esm/templates/recordTemplates.js +109 -0
  106. package/dist/esm/templates/recordTemplates.js.map +1 -0
  107. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  108. package/index.ts +14 -0
  109. package/inventoryApplication.ts +28 -0
  110. package/inventoryParts.ts +52 -0
  111. package/inventoryQueries.ts +64 -0
  112. package/inventoryScreenSet.ts +25 -0
  113. package/manifest.ts +41 -0
  114. package/navigation.ts +60 -0
  115. package/package.json +79 -5
  116. package/packageName.ts +5 -0
  117. package/sampleData/inventory-warehouse.json +1770 -0
  118. package/screens/index.ts +20 -0
  119. package/templateProvenance.ts +15 -0
  120. package/templates/dashboardTemplate.ts +45 -0
  121. package/templates/formTemplates.ts +60 -0
  122. package/templates/index.ts +25 -0
  123. package/templates/listTemplates.ts +109 -0
  124. package/templates/locationsTemplate.ts +36 -0
  125. package/templates/recordTemplates.ts +45 -0
  126. package/thumbnails/InventoryAdjustStock.svg +12 -0
  127. package/thumbnails/InventoryCheckInOut.svg +17 -0
  128. package/thumbnails/InventoryDashboard.svg +14 -0
  129. package/thumbnails/InventoryItemGallery.svg +29 -0
  130. package/thumbnails/InventoryItemList.svg +13 -0
  131. package/thumbnails/InventoryItemPage.svg +18 -0
  132. package/thumbnails/InventoryLocations.svg +20 -0
  133. package/thumbnails/InventoryMovementList.svg +13 -0
  134. package/thumbnails/InventoryQuickCreateItem.svg +12 -0
  135. package/thumbnails/InventoryQuickCreateSupplier.svg +12 -0
  136. package/thumbnails/InventorySupplierList.svg +13 -0
  137. package/thumbnails/inventory.svg +14 -0
  138. package/README.md +0 -3
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var dashboardTemplate = require('./dashboardTemplate.js');
4
+ var formTemplates = require('./formTemplates.js');
5
+ var listTemplates = require('./listTemplates.js');
6
+ var locationsTemplate = require('./locationsTemplate.js');
7
+ var recordTemplates = require('./recordTemplates.js');
8
+
9
+ // Copyright (c) Cratis. All rights reserved.
10
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
11
+ /** Every screen template this blueprint provides, in the order the manifest lists them. */ const inventoryScreenTemplates = [
12
+ dashboardTemplate.inventoryDashboardTemplate,
13
+ listTemplates.inventoryItemListTemplate,
14
+ listTemplates.inventoryItemGalleryTemplate,
15
+ recordTemplates.inventoryItemPageTemplate,
16
+ locationsTemplate.inventoryLocationsTemplate,
17
+ listTemplates.inventoryMovementListTemplate,
18
+ ...formTemplates.inventoryFormTemplates,
19
+ listTemplates.inventorySupplierListTemplate
20
+ ];
21
+
22
+ exports.inventoryDashboardTemplate = dashboardTemplate.inventoryDashboardTemplate;
23
+ exports.inventoryCheckInOutTemplate = formTemplates.inventoryCheckInOutTemplate;
24
+ exports.inventoryDialogTemplates = formTemplates.inventoryQuickCreateDialogs;
25
+ exports.inventoryFormTemplates = formTemplates.inventoryFormTemplates;
26
+ exports.inventoryQuickCreateDialogs = formTemplates.inventoryQuickCreateDialogs;
27
+ exports.inventoryItemGalleryTemplate = listTemplates.inventoryItemGalleryTemplate;
28
+ exports.inventoryItemListTemplate = listTemplates.inventoryItemListTemplate;
29
+ exports.inventoryMovementListTemplate = listTemplates.inventoryMovementListTemplate;
30
+ exports.inventorySupplierListTemplate = listTemplates.inventorySupplierListTemplate;
31
+ exports.inventoryLocationsTemplate = locationsTemplate.inventoryLocationsTemplate;
32
+ exports.inventoryItemPageTemplate = recordTemplates.inventoryItemPageTemplate;
33
+ exports.inventoryScreenTemplates = inventoryScreenTemplates;
34
+ //# 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 { inventoryDashboardTemplate } from './dashboardTemplate';\nimport { inventoryFormTemplates } from './formTemplates';\nimport { inventoryItemGalleryTemplate, inventoryItemListTemplate, inventoryMovementListTemplate, inventorySupplierListTemplate } from './listTemplates';\nimport { inventoryLocationsTemplate } from './locationsTemplate';\nimport { inventoryItemPageTemplate } from './recordTemplates';\n\nexport * from './dashboardTemplate';\nexport * from './listTemplates';\nexport * from './recordTemplates';\nexport * from './locationsTemplate';\nexport * from './formTemplates';\n\n/** Every screen template this blueprint provides, in the order the manifest lists them. */\nexport const inventoryScreenTemplates = [\n inventoryDashboardTemplate,\n inventoryItemListTemplate, inventoryItemGalleryTemplate, inventoryItemPageTemplate,\n inventoryLocationsTemplate,\n inventoryMovementListTemplate, ...inventoryFormTemplates,\n inventorySupplierListTemplate,\n];\n\nexport { inventoryQuickCreateDialogs as inventoryDialogTemplates } from './formTemplates';\n"],"names":["inventoryScreenTemplates","inventoryDashboardTemplate","inventoryItemListTemplate","inventoryItemGalleryTemplate","inventoryItemPageTemplate","inventoryLocationsTemplate","inventoryMovementListTemplate","inventoryFormTemplates","inventorySupplierListTemplate"],"mappings":";;;;;;;;AAAA;AACA;AAcA,4FACO,MAAMA,wBAAAA,GAA2B;AACpCC,IAAAA,4CAAAA;AACAC,IAAAA,uCAAAA;AAA2BC,IAAAA,0CAAAA;AAA8BC,IAAAA,yCAAAA;AACzDC,IAAAA,4CAAAA;AACAC,IAAAA,2CAAAA;AAAkCC,IAAAA,GAAAA,oCAAAA;AAClCC,IAAAA;;;;;;;;;;;;;;"}
@@ -0,0 +1,212 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
5
+ var inventoryQueries = require('../inventoryQueries.js');
6
+ var inventoryParts = require('../inventoryParts.js');
7
+
8
+ // Copyright (c) Cratis. All rights reserved.
9
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
10
+ const listScopes = [
11
+ scene_model.TemplateScope.Module,
12
+ scene_model.TemplateScope.Feature
13
+ ];
14
+ /** The Export button: it tells the user the export has started, which is what the shell does for a long-running action it does not wait on. */ const exportAction = (id)=>inventoryParts.withBehaviors(inventoryParts.actionButton(id, 'Export', 'secondary'), [
15
+ {
16
+ bindings: [
17
+ {
18
+ trigger: {
19
+ kind: scene_model.InteractionTriggerKind.Click
20
+ },
21
+ actions: [
22
+ {
23
+ kind: scene_model.InteractionActionKind.Notify,
24
+ level: scene_model.NotificationLevel.Info,
25
+ message: {
26
+ text: 'The export has started.'
27
+ }
28
+ }
29
+ ]
30
+ }
31
+ ]
32
+ }
33
+ ]);
34
+ /**
35
+ * One Inventory list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled for an entity. The slots, arrangement and
36
+ * every behavior - sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.
37
+ */ function listTemplateOf(options) {
38
+ const queries = inventoryQueries.inventoryQueriesOf(options.entity);
39
+ const id = options.name;
40
+ const listId = `${id}-records`;
41
+ const primary = inventoryParts.withBehaviors(inventoryParts.actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? inventoryParts.opensDialog(options.primary.dialog) : inventoryParts.goesTo(options.primary.screen));
42
+ const list = scene_blueprint_default.component(listId, 'dataList', {
43
+ label: options.title,
44
+ rows: inventoryQueries.fromQuery(queries.rows),
45
+ columns: inventoryQueries.fromQuery(queries.columns),
46
+ titleField: options.titleField,
47
+ pageSize: options.cards ? 12 : 10,
48
+ urlKey: options.urlKey,
49
+ ...inventoryQueries.localeOfData,
50
+ rowActions: options.rowActions,
51
+ ...options.readOnly ? {} : {
52
+ selectionMode: options.recordScreen ? 'single' : 'multiple'
53
+ },
54
+ ...options.cards ? {
55
+ variant: 'cards',
56
+ imageField: options.cards.imageField
57
+ } : {},
58
+ ...options.toneField ? {
59
+ toneField: options.toneField
60
+ } : {}
61
+ });
62
+ return {
63
+ name: options.name,
64
+ fitsSlot: 'content',
65
+ slots: scene_blueprint_default.listScreenTemplate.slots,
66
+ arrangement: scene_blueprint_default.listScreenTemplate.arrangement,
67
+ content: {
68
+ header: [
69
+ scene_blueprint_default.component(`${id}-header`, 'pageHeader', {
70
+ title: options.title,
71
+ subtitle: options.subtitle
72
+ }, {
73
+ actions: [
74
+ exportAction(`${id}-export`),
75
+ primary
76
+ ]
77
+ })
78
+ ],
79
+ toolbar: [
80
+ scene_blueprint_default.component(`${id}-search`, 'globalSearch', {
81
+ placeholder: options.searchLabel,
82
+ label: options.searchLabel,
83
+ urlKey: `${options.urlKey}q`
84
+ }),
85
+ scene_blueprint_default.component(`${id}-views`, 'savedViewsMenu', {
86
+ views: inventoryQueries.fromQuery(queries.views),
87
+ savePermission: 'enabled',
88
+ managePermission: 'enabled'
89
+ }),
90
+ scene_blueprint_default.component(`${id}-columns`, 'columnChooser', {
91
+ columns: inventoryQueries.fromQuery(queries.columnChoices)
92
+ })
93
+ ],
94
+ filters: [
95
+ scene_blueprint_default.component(`${id}-filter`, 'filterBuilder', {
96
+ fields: inventoryQueries.fromQuery(queries.filterFields),
97
+ ...inventoryQueries.localeOfData
98
+ })
99
+ ],
100
+ list: [
101
+ options.recordScreen ? inventoryParts.withBehaviors(list, inventoryParts.opensRecordOnSelect(listId, options.recordScreen)) : list
102
+ ],
103
+ bulkBar: options.recordScreen || options.readOnly ? [] : [
104
+ scene_blueprint_default.component(`${id}-bulk`, 'bulkBar', {
105
+ selection: inventoryQueries.fromQuery(queries.selection),
106
+ actions: options.bulkActions
107
+ })
108
+ ],
109
+ footer: []
110
+ },
111
+ displayName: options.displayName,
112
+ description: options.description,
113
+ metadata: inventoryParts.inventoryMetadata(options.name, 'List', listScopes)
114
+ };
115
+ }
116
+ /** The items: what is stored, how much of it and where. Items running low are tinted and say "Low stock" in their status. Choosing a row opens the item. */ const inventoryItemListTemplate = listTemplateOf({
117
+ name: 'InventoryItemList',
118
+ entity: inventoryQueries.InventoryEntityKind.Item,
119
+ displayName: 'Inventory items',
120
+ description: 'Items with sku, category, location, quantity and status, low stock highlighted, filtered by category, location and status.',
121
+ title: 'Items',
122
+ subtitle: 'Everything in stock, low stock highlighted',
123
+ searchLabel: 'Search items',
124
+ urlKey: 'items',
125
+ primary: {
126
+ label: 'New item',
127
+ dialog: 'InventoryQuickCreateItem'
128
+ },
129
+ rowActions: [
130
+ 'Adjust stock',
131
+ 'Check out',
132
+ 'Archive'
133
+ ],
134
+ bulkActions: [],
135
+ titleField: 'name',
136
+ recordScreen: 'inventory.items.record',
137
+ toneField: 'tone'
138
+ });
139
+ /** The items as a gallery: the same records as cards, each with its picture, for finding a thing by how it looks. */ const inventoryItemGalleryTemplate = listTemplateOf({
140
+ name: 'InventoryItemGallery',
141
+ entity: inventoryQueries.InventoryEntityKind.Item,
142
+ displayName: 'Inventory item gallery',
143
+ description: 'Items as cards with a picture, sku, quantity and status, low stock highlighted.',
144
+ title: 'Item gallery',
145
+ subtitle: 'Items by how they look',
146
+ searchLabel: 'Search items',
147
+ urlKey: 'gallery',
148
+ primary: {
149
+ label: 'New item',
150
+ dialog: 'InventoryQuickCreateItem'
151
+ },
152
+ rowActions: [
153
+ 'Adjust stock',
154
+ 'Check out',
155
+ 'Archive'
156
+ ],
157
+ bulkActions: [],
158
+ titleField: 'name',
159
+ recordScreen: 'inventory.items.record',
160
+ toneField: 'tone',
161
+ cards: {
162
+ imageField: 'photo'
163
+ }
164
+ });
165
+ /** The movements: every time stock came in, went out, moved or was corrected, newest first. Nothing in it is edited. */ const inventoryMovementListTemplate = listTemplateOf({
166
+ name: 'InventoryMovementList',
167
+ entity: inventoryQueries.InventoryEntityKind.Movement,
168
+ displayName: 'Inventory movements',
169
+ description: 'Check ins, check outs, transfers and adjustments with the item, quantity, location and who did it.',
170
+ title: 'Movements',
171
+ subtitle: 'What came in, went out and moved',
172
+ searchLabel: 'Search movements',
173
+ urlKey: 'movements',
174
+ primary: {
175
+ label: 'Check in or out',
176
+ screen: 'inventory.movements.check'
177
+ },
178
+ rowActions: [
179
+ 'View item'
180
+ ],
181
+ bulkActions: [],
182
+ titleField: 'item',
183
+ readOnly: true
184
+ });
185
+ /** The suppliers: who items are bought from, how to reach them and how many items they supply. */ const inventorySupplierListTemplate = listTemplateOf({
186
+ name: 'InventorySupplierList',
187
+ entity: inventoryQueries.InventoryEntityKind.Supplier,
188
+ displayName: 'Inventory suppliers',
189
+ description: 'Suppliers with their contact, the items they supply and their status.',
190
+ title: 'Suppliers',
191
+ subtitle: 'Where the stock comes from',
192
+ searchLabel: 'Search suppliers',
193
+ urlKey: 'suppliers',
194
+ primary: {
195
+ label: 'New supplier',
196
+ dialog: 'InventoryQuickCreateSupplier'
197
+ },
198
+ rowActions: [
199
+ 'Edit',
200
+ 'Deactivate'
201
+ ],
202
+ bulkActions: [
203
+ 'Deactivate'
204
+ ],
205
+ titleField: 'name'
206
+ });
207
+
208
+ exports.inventoryItemGalleryTemplate = inventoryItemGalleryTemplate;
209
+ exports.inventoryItemListTemplate = inventoryItemListTemplate;
210
+ exports.inventoryMovementListTemplate = inventoryMovementListTemplate;
211
+ exports.inventorySupplierListTemplate = inventorySupplierListTemplate;
212
+ //# sourceMappingURL=listTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTemplates.js","sources":["../../../templates/listTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { InteractionActionKind, InteractionTriggerKind, NotificationLevel, NotifyAction, ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { listScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { InventoryEntityKind, fromQuery, inventoryQueriesOf, localeOfData } from '../inventoryQueries';\nimport { actionButton, component, goesTo, inventoryMetadata, opensDialog, opensRecordOnSelect, withBehaviors } from '../inventoryParts';\n\nconst listScopes = [TemplateScope.Module, TemplateScope.Feature];\n\n/** The Export button: it tells the user the export has started, which is what the shell does for a long-running action it does not wait on. */\nconst exportAction = (id: string) => withBehaviors(actionButton(id, 'Export', 'secondary'), [{\n bindings: [{\n trigger: { kind: InteractionTriggerKind.Click },\n actions: [{ kind: InteractionActionKind.Notify, level: NotificationLevel.Info, message: { text: 'The export has started.' } } as unknown as NotifyAction],\n }],\n}]);\n\ninterface ListOptions {\n name: string;\n entity: InventoryEntityKind;\n displayName: string;\n description: string;\n title: string;\n subtitle: string;\n searchLabel: string;\n urlKey: string;\n /** The primary action of the header: a quick-create dialog to open, or a screen to go to. */\n primary: { label: string; dialog?: string; screen?: string };\n rowActions: string[];\n bulkActions: string[];\n titleField: string;\n /** The screen a chosen row opens; the list then selects one row at a time. Absent, rows are selected many at a time for the bulk bar. */\n recordScreen?: string;\n /** Rows are not selectable at all: a record of what happened, which nobody edits. */\n readOnly?: boolean;\n /** Show the records as cards, each with the picture its `imageField` names. */\n cards?: { imageField: string };\n /** Tint a row by the tone in this field (always beside a status column that says the same in words). */\n toneField?: string;\n}\n\n/**\n * One Inventory list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled for an entity. The slots, arrangement and\n * every behavior - sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.\n */\nfunction listTemplateOf(options: ListOptions): ScreenTemplate {\n const queries = inventoryQueriesOf(options.entity);\n const id = options.name;\n const listId = `${id}-records`;\n const primary = withBehaviors(actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? opensDialog(options.primary.dialog) : goesTo(options.primary.screen!));\n const list = component(listId, 'dataList', {\n label: options.title, rows: fromQuery(queries.rows), columns: fromQuery(queries.columns), titleField: options.titleField, pageSize: options.cards ? 12 : 10, urlKey: options.urlKey, ...localeOfData,\n rowActions: options.rowActions,\n ...(options.readOnly ? {} : { selectionMode: options.recordScreen ? 'single' : 'multiple' }),\n ...(options.cards ? { variant: 'cards', imageField: options.cards.imageField } : {}),\n ...(options.toneField ? { toneField: options.toneField } : {}),\n });\n\n return {\n name: options.name,\n fitsSlot: 'content',\n slots: listScreenTemplate.slots,\n arrangement: listScreenTemplate.arrangement,\n content: {\n header: [component(`${id}-header`, 'pageHeader', { title: options.title, subtitle: options.subtitle }, { actions: [exportAction(`${id}-export`), primary] })],\n toolbar: [\n component(`${id}-search`, 'globalSearch', { placeholder: options.searchLabel, label: options.searchLabel, urlKey: `${options.urlKey}q` }),\n component(`${id}-views`, 'savedViewsMenu', { views: fromQuery(queries.views), savePermission: 'enabled', managePermission: 'enabled' }),\n component(`${id}-columns`, 'columnChooser', { columns: fromQuery(queries.columnChoices) }),\n ],\n filters: [component(`${id}-filter`, 'filterBuilder', { fields: fromQuery(queries.filterFields), ...localeOfData })],\n list: [options.recordScreen ? withBehaviors(list, opensRecordOnSelect(listId, options.recordScreen)) : list],\n bulkBar: options.recordScreen || options.readOnly ? [] : [component(`${id}-bulk`, 'bulkBar', { selection: fromQuery(queries.selection), actions: options.bulkActions })],\n footer: [],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: inventoryMetadata(options.name, 'List', listScopes),\n };\n}\n\n/** The items: what is stored, how much of it and where. Items running low are tinted and say \"Low stock\" in their status. Choosing a row opens the item. */\nexport const inventoryItemListTemplate = listTemplateOf({\n name: 'InventoryItemList', entity: InventoryEntityKind.Item, displayName: 'Inventory items', description: 'Items with sku, category, location, quantity and status, low stock highlighted, filtered by category, location and status.',\n title: 'Items', subtitle: 'Everything in stock, low stock highlighted', searchLabel: 'Search items', urlKey: 'items', primary: { label: 'New item', dialog: 'InventoryQuickCreateItem' },\n rowActions: ['Adjust stock', 'Check out', 'Archive'], bulkActions: [], titleField: 'name', recordScreen: 'inventory.items.record', toneField: 'tone',\n});\n\n/** The items as a gallery: the same records as cards, each with its picture, for finding a thing by how it looks. */\nexport const inventoryItemGalleryTemplate = listTemplateOf({\n name: 'InventoryItemGallery', entity: InventoryEntityKind.Item, displayName: 'Inventory item gallery', description: 'Items as cards with a picture, sku, quantity and status, low stock highlighted.',\n title: 'Item gallery', subtitle: 'Items by how they look', searchLabel: 'Search items', urlKey: 'gallery', primary: { label: 'New item', dialog: 'InventoryQuickCreateItem' },\n rowActions: ['Adjust stock', 'Check out', 'Archive'], bulkActions: [], titleField: 'name', recordScreen: 'inventory.items.record', toneField: 'tone', cards: { imageField: 'photo' },\n});\n\n/** The movements: every time stock came in, went out, moved or was corrected, newest first. Nothing in it is edited. */\nexport const inventoryMovementListTemplate = listTemplateOf({\n name: 'InventoryMovementList', entity: InventoryEntityKind.Movement, displayName: 'Inventory movements', description: 'Check ins, check outs, transfers and adjustments with the item, quantity, location and who did it.',\n title: 'Movements', subtitle: 'What came in, went out and moved', searchLabel: 'Search movements', urlKey: 'movements', primary: { label: 'Check in or out', screen: 'inventory.movements.check' },\n rowActions: ['View item'], bulkActions: [], titleField: 'item', readOnly: true,\n});\n\n/** The suppliers: who items are bought from, how to reach them and how many items they supply. */\nexport const inventorySupplierListTemplate = listTemplateOf({\n name: 'InventorySupplierList', entity: InventoryEntityKind.Supplier, displayName: 'Inventory suppliers', description: 'Suppliers with their contact, the items they supply and their status.',\n title: 'Suppliers', subtitle: 'Where the stock comes from', searchLabel: 'Search suppliers', urlKey: 'suppliers', primary: { label: 'New supplier', dialog: 'InventoryQuickCreateSupplier' },\n rowActions: ['Edit', 'Deactivate'], bulkActions: ['Deactivate'], titleField: 'name',\n});\n"],"names":["listScopes","TemplateScope","Module","Feature","exportAction","id","withBehaviors","actionButton","bindings","trigger","kind","InteractionTriggerKind","Click","actions","InteractionActionKind","Notify","level","NotificationLevel","Info","message","text","listTemplateOf","options","queries","inventoryQueriesOf","entity","name","listId","primary","label","dialog","opensDialog","goesTo","screen","list","component","title","rows","fromQuery","columns","titleField","pageSize","cards","urlKey","localeOfData","rowActions","readOnly","selectionMode","recordScreen","variant","imageField","toneField","fitsSlot","slots","listScreenTemplate","arrangement","content","header","subtitle","toolbar","placeholder","searchLabel","views","savePermission","managePermission","columnChoices","filters","fields","filterFields","opensRecordOnSelect","bulkBar","selection","bulkActions","footer","displayName","description","metadata","inventoryMetadata","inventoryItemListTemplate","InventoryEntityKind","Item","inventoryItemGalleryTemplate","inventoryMovementListTemplate","Movement","inventorySupplierListTemplate","Supplier"],"mappings":";;;;;;;AAAA;AACA;AAOA,MAAMA,UAAAA,GAAa;AAACC,IAAAA,yBAAAA,CAAcC,MAAM;AAAED,IAAAA,yBAAAA,CAAcE;AAAQ,CAAA;AAEhE,gJACA,MAAMC,YAAAA,GAAe,CAACC,KAAeC,4BAAAA,CAAcC,2BAAAA,CAAaF,EAAAA,EAAI,QAAA,EAAU,WAAA,CAAA,EAAc;AAAC,QAAA;YACzFG,QAAAA,EAAU;AAAC,gBAA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AAA;;;;;"}
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
5
+ var inventoryQueries = require('../inventoryQueries.js');
6
+ var inventoryParts = require('../inventoryParts.js');
7
+
8
+ // Copyright (c) Cratis. All rights reserved.
9
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
10
+ /**
11
+ * The locations: the foundation `MasterDetail` with the tree of locations - warehouse, aisle, shelf - on the left and, on the right, what is stored in the one
12
+ * chosen, or in everything beneath it. The tree keeps the chosen location in the address under the parameter the contents list searches by, and a
13
+ * location's id is its path, so the contents are every row whose location starts with it - and a link or a refresh restores the choice. On a phone the two become a navigation stack. It fills the shell's `content` slot itself
14
+ * rather than the module workspace's, so a module without a workspace can use it.
15
+ */ const inventoryLocationsTemplate = {
16
+ name: 'InventoryLocations',
17
+ fitsSlot: 'content',
18
+ slots: scene_blueprint_default.masterDetailScreenTemplate.slots,
19
+ arrangement: scene_blueprint_default.masterDetailScreenTemplate.arrangement,
20
+ content: {
21
+ list: [
22
+ scene_blueprint_default.component('inventory-locations-tree', 'orgTree', {
23
+ nodes: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.LocationNodes),
24
+ expandedDepth: 2,
25
+ urlKey: 'contentsq',
26
+ strings: {
27
+ orgTree: 'Locations',
28
+ orgReports: '{count} locations beneath'
29
+ },
30
+ ...inventoryQueries.localeOfData
31
+ })
32
+ ],
33
+ details: [
34
+ scene_blueprint_default.component('inventory-locations-header', 'pageHeader', {
35
+ title: 'Contents',
36
+ subtitle: 'What is stored in the chosen location and beneath it'
37
+ }, {
38
+ actions: [
39
+ inventoryParts.withBehaviors(inventoryParts.actionButton('inventory-locations-adjust', 'Adjust stock', 'primary'), inventoryParts.opensDialog('InventoryAdjustStock'))
40
+ ]
41
+ }),
42
+ scene_blueprint_default.component('inventory-locations-contents', 'dataList', {
43
+ label: 'Location contents',
44
+ rows: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.LocationContents),
45
+ columns: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.LocationContentColumns),
46
+ titleField: 'name',
47
+ pageSize: 10,
48
+ toneField: 'tone',
49
+ urlKey: 'contents',
50
+ ...inventoryQueries.localeOfData
51
+ })
52
+ ]
53
+ },
54
+ displayName: 'Inventory locations',
55
+ description: 'The tree of locations beside what is stored in the chosen location.',
56
+ metadata: inventoryParts.inventoryMetadata('InventoryLocations', 'Workspace', [
57
+ scene_model.TemplateScope.Module,
58
+ scene_model.TemplateScope.Feature
59
+ ])
60
+ };
61
+
62
+ exports.inventoryLocationsTemplate = inventoryLocationsTemplate;
63
+ //# sourceMappingURL=locationsTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locationsTemplate.js","sources":["../../../templates/locationsTemplate.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 { masterDetailScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { InventoryQuery, fromQuery, localeOfData } from '../inventoryQueries';\nimport { actionButton, component, inventoryMetadata, opensDialog, withBehaviors } from '../inventoryParts';\n\n/**\n * The locations: the foundation `MasterDetail` with the tree of locations - warehouse, aisle, shelf - on the left and, on the right, what is stored in the one\n * chosen, or in everything beneath it. The tree keeps the chosen location in the address under the parameter the contents list searches by, and a\n * location's id is its path, so the contents are every row whose location starts with it - and a link or a refresh restores the choice. On a phone the two become a navigation stack. It fills the shell's `content` slot itself\n * rather than the module workspace's, so a module without a workspace can use it.\n */\nexport const inventoryLocationsTemplate: ScreenTemplate = {\n name: 'InventoryLocations',\n fitsSlot: 'content',\n slots: masterDetailScreenTemplate.slots,\n arrangement: masterDetailScreenTemplate.arrangement,\n content: {\n list: [component('inventory-locations-tree', 'orgTree', {\n nodes: fromQuery(InventoryQuery.LocationNodes), expandedDepth: 2, urlKey: 'contentsq', strings: { orgTree: 'Locations', orgReports: '{count} locations beneath' }, ...localeOfData,\n })],\n details: [\n component('inventory-locations-header', 'pageHeader', { title: 'Contents', subtitle: 'What is stored in the chosen location and beneath it' }, {\n actions: [withBehaviors(actionButton('inventory-locations-adjust', 'Adjust stock', 'primary'), opensDialog('InventoryAdjustStock'))],\n }),\n component('inventory-locations-contents', 'dataList', {\n label: 'Location contents', rows: fromQuery(InventoryQuery.LocationContents), columns: fromQuery(InventoryQuery.LocationContentColumns), titleField: 'name', pageSize: 10, toneField: 'tone', urlKey: 'contents', ...localeOfData,\n }),\n ],\n },\n displayName: 'Inventory locations',\n description: 'The tree of locations beside what is stored in the chosen location.',\n metadata: inventoryMetadata('InventoryLocations', 'Workspace', [TemplateScope.Module, TemplateScope.Feature]),\n};\n"],"names":["inventoryLocationsTemplate","name","fitsSlot","slots","masterDetailScreenTemplate","arrangement","content","list","component","nodes","fromQuery","InventoryQuery","LocationNodes","expandedDepth","urlKey","strings","orgTree","orgReports","localeOfData","details","title","subtitle","actions","withBehaviors","actionButton","opensDialog","label","rows","LocationContents","columns","LocationContentColumns","titleField","pageSize","toneField","displayName","description","metadata","inventoryMetadata","TemplateScope","Module","Feature"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;UAMaA,0BAAAA,GAA6C;IACtDC,IAAAA,EAAM,oBAAA;IACNC,QAAAA,EAAU,SAAA;AACVC,IAAAA,KAAAA,EAAOC,mDAA2BD,KAAK;AACvCE,IAAAA,WAAAA,EAAaD,mDAA2BC,WAAW;IACnDC,OAAAA,EAAS;QACLC,IAAAA,EAAM;AAACC,YAAAA,iCAAAA,CAAU,4BAA4B,SAAA,EAAW;gBACpDC,KAAAA,EAAOC,0BAAAA,CAAUC,gCAAeC,aAAa,CAAA;gBAAGC,aAAAA,EAAe,CAAA;gBAAGC,MAAAA,EAAQ,WAAA;gBAAaC,OAAAA,EAAS;oBAAEC,OAAAA,EAAS,WAAA;oBAAaC,UAAAA,EAAY;AAA4B,iBAAA;AAAG,gBAAA,GAAGC;AAC1K,aAAA;AAAG,SAAA;QACHC,OAAAA,EAAS;AACLX,YAAAA,iCAAAA,CAAU,8BAA8B,YAAA,EAAc;gBAAEY,KAAAA,EAAO,UAAA;gBAAYC,QAAAA,EAAU;aAAuD,EAAG;gBAC3IC,OAAAA,EAAS;AAACC,oBAAAA,4BAAAA,CAAcC,2BAAAA,CAAa,4BAAA,EAA8B,cAAA,EAAgB,SAAA,CAAA,EAAYC,0BAAAA,CAAY,sBAAA,CAAA;AAAyB;AACxI,aAAA,CAAA;AACAjB,YAAAA,iCAAAA,CAAU,gCAAgC,UAAA,EAAY;gBAClDkB,KAAAA,EAAO,mBAAA;gBAAqBC,IAAAA,EAAMjB,0BAAAA,CAAUC,gCAAeiB,gBAAgB,CAAA;gBAAGC,OAAAA,EAASnB,0BAAAA,CAAUC,gCAAemB,sBAAsB,CAAA;gBAAGC,UAAAA,EAAY,MAAA;gBAAQC,QAAAA,EAAU,EAAA;gBAAIC,SAAAA,EAAW,MAAA;gBAAQnB,MAAAA,EAAQ,UAAA;AAAY,gBAAA,GAAGI;AACzN,aAAA;AACH;AACL,KAAA;IACAgB,WAAAA,EAAa,qBAAA;IACbC,WAAAA,EAAa,qEAAA;IACbC,QAAAA,EAAUC,gCAAAA,CAAkB,sBAAsB,WAAA,EAAa;AAACC,QAAAA,yBAAAA,CAAcC,MAAM;AAAED,QAAAA,yBAAAA,CAAcE;AAAQ,KAAA;AAChH;;"}
@@ -0,0 +1,111 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
5
+ var inventoryQueries = require('../inventoryQueries.js');
6
+ var inventoryParts = require('../inventoryParts.js');
7
+
8
+ // Copyright (c) Cratis. All rights reserved.
9
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
10
+ const queries = inventoryQueries.inventoryQueriesOf(inventoryQueries.InventoryEntityKind.Item);
11
+ /**
12
+ * The item page: the foundation `RecordPage` with the item's name as its title, Adjust stock and Check out as its actions, its key facts under it, the record's
13
+ * fields with the supplier's details, the stock of the item in each location and its movement history as related lists, and the cycle counts to do beside it.
14
+ */ const inventoryItemPageTemplate = {
15
+ name: 'InventoryItemPage',
16
+ fitsSlot: 'content',
17
+ slots: scene_blueprint_default.recordPageTemplate.slots,
18
+ arrangement: scene_blueprint_default.recordPageTemplate.arrangement,
19
+ content: {
20
+ header: [
21
+ scene_blueprint_default.component('InventoryItemPage-header', 'pageHeader', {
22
+ title: inventoryQueries.fromQuery(queries.record, '0.name'),
23
+ subtitle: 'Item'
24
+ }, {
25
+ actions: [
26
+ inventoryParts.withBehaviors(inventoryParts.actionButton('InventoryItemPage-check', 'Check out', 'secondary'), inventoryParts.goesTo('inventory.movements.check')),
27
+ inventoryParts.withBehaviors(inventoryParts.actionButton('InventoryItemPage-adjust', 'Adjust stock', 'primary'), inventoryParts.opensDialog('InventoryAdjustStock'))
28
+ ]
29
+ })
30
+ ],
31
+ summary: [
32
+ scene_blueprint_default.component('InventoryItemPage-status', 'statusChip', {
33
+ status: inventoryQueries.fromQuery(queries.summary, '0.status'),
34
+ tone: inventoryQueries.fromQuery(queries.summary, '0.tone')
35
+ }),
36
+ scene_blueprint_default.component('InventoryItemPage-onhand', 'statCard', {
37
+ label: 'On hand',
38
+ value: inventoryQueries.fromQuery(queries.summary, '0.onHand'),
39
+ ...inventoryQueries.localeOfData
40
+ }),
41
+ scene_blueprint_default.component('InventoryItemPage-reorder', 'statCard', {
42
+ label: 'Reorder level',
43
+ value: inventoryQueries.fromQuery(queries.summary, '0.reorderLevel'),
44
+ ...inventoryQueries.localeOfData
45
+ }),
46
+ scene_blueprint_default.component('InventoryItemPage-value', 'statCard', {
47
+ label: 'Stock value',
48
+ value: inventoryQueries.fromQuery(queries.summary, '0.stockValue'),
49
+ format: 'currency',
50
+ fractionDigits: 0,
51
+ ...inventoryQueries.currencyOfData
52
+ })
53
+ ],
54
+ tabs: [
55
+ scene_blueprint_default.component('InventoryItemPage-tabs', 'tabSet', {
56
+ tabs: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.RecordTabs),
57
+ urlKey: 'tab',
58
+ label: 'Item sections'
59
+ })
60
+ ],
61
+ main: [
62
+ scene_blueprint_default.component('InventoryItemPage-form', 'formScreenBody', {
63
+ mode: 'readOnly',
64
+ sections: inventoryQueries.fromQuery(queries.sections),
65
+ values: inventoryQueries.fromQuery(queries.record, '0'),
66
+ ...inventoryQueries.localeOfData
67
+ })
68
+ ],
69
+ related: [
70
+ scene_blueprint_default.component('InventoryItemPage-stock', 'dataList', {
71
+ label: 'Stock by location',
72
+ rows: inventoryQueries.fromQuery(queries.stockByLocation),
73
+ columns: inventoryQueries.fromQuery('StockByLocationColumns'),
74
+ titleField: 'location',
75
+ pageSize: 5,
76
+ ...inventoryQueries.localeOfData
77
+ }),
78
+ scene_blueprint_default.component('InventoryItemPage-movements', 'dataList', {
79
+ label: 'Movement history',
80
+ rows: inventoryQueries.fromQuery(queries.movements),
81
+ columns: inventoryQueries.fromQuery(inventoryQueries.inventoryQueriesOf(inventoryQueries.InventoryEntityKind.Movement).columns),
82
+ titleField: 'item',
83
+ pageSize: 5,
84
+ ...inventoryQueries.localeOfData
85
+ })
86
+ ],
87
+ activity: [
88
+ scene_blueprint_default.component('InventoryItemPage-activity', 'activityFeed', {
89
+ label: 'Activity',
90
+ entries: inventoryQueries.fromQuery(queries.activity),
91
+ ...inventoryQueries.localeOfData
92
+ })
93
+ ],
94
+ aside: [
95
+ scene_blueprint_default.component('InventoryItemPage-tasks', 'checklistSection', {
96
+ label: 'Cycle counts',
97
+ sections: inventoryQueries.fromQuery(queries.tasks),
98
+ ...inventoryQueries.localeOfData
99
+ })
100
+ ]
101
+ },
102
+ displayName: 'Inventory item page',
103
+ description: 'One item: key facts, its fields and supplier, its stock by location and its movement history.',
104
+ metadata: inventoryParts.inventoryMetadata('InventoryItemPage', 'Detail', [
105
+ scene_model.TemplateScope.Feature,
106
+ scene_model.TemplateScope.Subfeature
107
+ ])
108
+ };
109
+
110
+ exports.inventoryItemPageTemplate = inventoryItemPageTemplate;
111
+ //# sourceMappingURL=recordTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recordTemplates.js","sources":["../../../templates/recordTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { recordPageTemplate } from '@cratis/scene.blueprint.default';\nimport { InventoryEntityKind, InventoryQuery, currencyOfData, fromQuery, inventoryQueriesOf, localeOfData } from '../inventoryQueries';\nimport { actionButton, component, goesTo, inventoryMetadata, opensDialog, withBehaviors } from '../inventoryParts';\n\nconst queries = inventoryQueriesOf(InventoryEntityKind.Item);\n\n/**\n * The item page: the foundation `RecordPage` with the item's name as its title, Adjust stock and Check out as its actions, its key facts under it, the record's\n * fields with the supplier's details, the stock of the item in each location and its movement history as related lists, and the cycle counts to do beside it.\n */\nexport const inventoryItemPageTemplate: ScreenTemplate = {\n name: 'InventoryItemPage',\n fitsSlot: 'content',\n slots: recordPageTemplate.slots,\n arrangement: recordPageTemplate.arrangement,\n content: {\n header: [component('InventoryItemPage-header', 'pageHeader', { title: fromQuery(queries.record, '0.name'), subtitle: 'Item' }, {\n actions: [\n withBehaviors(actionButton('InventoryItemPage-check', 'Check out', 'secondary'), goesTo('inventory.movements.check')),\n withBehaviors(actionButton('InventoryItemPage-adjust', 'Adjust stock', 'primary'), opensDialog('InventoryAdjustStock')),\n ],\n })],\n summary: [\n component('InventoryItemPage-status', 'statusChip', { status: fromQuery(queries.summary, '0.status'), tone: fromQuery(queries.summary, '0.tone') }),\n component('InventoryItemPage-onhand', 'statCard', { label: 'On hand', value: fromQuery(queries.summary, '0.onHand'), ...localeOfData }),\n component('InventoryItemPage-reorder', 'statCard', { label: 'Reorder level', value: fromQuery(queries.summary, '0.reorderLevel'), ...localeOfData }),\n component('InventoryItemPage-value', 'statCard', { label: 'Stock value', value: fromQuery(queries.summary, '0.stockValue'), format: 'currency', fractionDigits: 0, ...currencyOfData }),\n ],\n tabs: [component('InventoryItemPage-tabs', 'tabSet', { tabs: fromQuery(InventoryQuery.RecordTabs), urlKey: 'tab', label: 'Item sections' })],\n main: [component('InventoryItemPage-form', 'formScreenBody', { mode: 'readOnly', sections: fromQuery(queries.sections), values: fromQuery(queries.record, '0'), ...localeOfData })],\n related: [\n component('InventoryItemPage-stock', 'dataList', { label: 'Stock by location', rows: fromQuery(queries.stockByLocation), columns: fromQuery('StockByLocationColumns'), titleField: 'location', pageSize: 5, ...localeOfData }),\n component('InventoryItemPage-movements', 'dataList', { label: 'Movement history', rows: fromQuery(queries.movements), columns: fromQuery(inventoryQueriesOf(InventoryEntityKind.Movement).columns), titleField: 'item', pageSize: 5, ...localeOfData }),\n ],\n activity: [component('InventoryItemPage-activity', 'activityFeed', { label: 'Activity', entries: fromQuery(queries.activity), ...localeOfData })],\n aside: [component('InventoryItemPage-tasks', 'checklistSection', { label: 'Cycle counts', sections: fromQuery(queries.tasks), ...localeOfData })],\n },\n displayName: 'Inventory item page',\n description: 'One item: key facts, its fields and supplier, its stock by location and its movement history.',\n metadata: inventoryMetadata('InventoryItemPage', 'Detail', [TemplateScope.Feature, TemplateScope.Subfeature]),\n};\n"],"names":["queries","inventoryQueriesOf","InventoryEntityKind","Item","inventoryItemPageTemplate","name","fitsSlot","slots","recordPageTemplate","arrangement","content","header","component","title","fromQuery","record","subtitle","actions","withBehaviors","actionButton","goesTo","opensDialog","summary","status","tone","label","value","localeOfData","format","fractionDigits","currencyOfData","tabs","InventoryQuery","RecordTabs","urlKey","main","mode","sections","values","related","rows","stockByLocation","columns","titleField","pageSize","movements","Movement","activity","entries","aside","tasks","displayName","description","metadata","inventoryMetadata","TemplateScope","Feature","Subfeature"],"mappings":";;;;;;;AAAA;AACA;AAOA,MAAMA,OAAAA,GAAUC,mCAAAA,CAAmBC,oCAAAA,CAAoB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;gBAAoBe,IAAAA,EAAM1B,0BAAAA,CAAUd,QAAQ6C,SAAS,CAAA;AAAGH,gBAAAA,OAAAA,EAAS5B,0BAAAA,CAAUb,mCAAAA,CAAmBC,oCAAAA,CAAoB4C,QAAQ,EAAEJ,OAAO,CAAA;gBAAGC,UAAAA,EAAY,MAAA;gBAAQC,QAAAA,EAAU,CAAA;AAAG,gBAAA,GAAGjB;AAAa,aAAA;AACxP,SAAA;QACDoB,QAAAA,EAAU;AAACnC,YAAAA,iCAAAA,CAAU,8BAA8B,cAAA,EAAgB;gBAAEa,KAAAA,EAAO,UAAA;gBAAYuB,OAAAA,EAASlC,0BAAAA,CAAUd,QAAQ+C,QAAQ,CAAA;AAAG,gBAAA,GAAGpB;AAAa,aAAA;AAAG,SAAA;QACjJsB,KAAAA,EAAO;AAACrC,YAAAA,iCAAAA,CAAU,2BAA2B,kBAAA,EAAoB;gBAAEa,KAAAA,EAAO,cAAA;gBAAgBY,QAAAA,EAAUvB,0BAAAA,CAAUd,QAAQkD,KAAK,CAAA;AAAG,gBAAA,GAAGvB;AAAa,aAAA;AAAG;AACrJ,KAAA;IACAwB,WAAAA,EAAa,qBAAA;IACbC,WAAAA,EAAa,+FAAA;IACbC,QAAAA,EAAUC,gCAAAA,CAAkB,qBAAqB,QAAA,EAAU;AAACC,QAAAA,yBAAAA,CAAcC,OAAO;AAAED,QAAAA,yBAAAA,CAAcE;AAAW,KAAA;AAChH;;"}
@@ -0,0 +1,3 @@
1
+ import { ScenePackageBundle } from '@cratis/scene.react';
2
+ export declare const inventoryBlueprint: ScenePackageBundle;
3
+ //# sourceMappingURL=blueprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../blueprint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAMzD,eAAO,MAAM,kBAAkB,EAAE,kBAMhC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { inventoryBlueprintManifest } from './manifest.js';
2
+ import { inventoryScreens } from './screens/index.js';
3
+ import { inventoryScreenTemplates } from './templates/index.js';
4
+ import { inventoryQuickCreateDialogs } from './templates/formTemplates.js';
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */ const inventoryBlueprint = {
9
+ manifest: inventoryBlueprintManifest,
10
+ components: {},
11
+ screenTemplates: inventoryScreenTemplates,
12
+ dialogTemplates: inventoryQuickCreateDialogs,
13
+ screens: inventoryScreens
14
+ };
15
+
16
+ export { inventoryBlueprint };
17
+ //# sourceMappingURL=blueprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint.js","sources":["../../blueprint.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { inventoryBlueprintManifest } from './manifest';\nimport { inventoryScreens } from './screens';\nimport { inventoryDialogTemplates, inventoryScreenTemplates } 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 inventoryBlueprint: ScenePackageBundle = {\n manifest: inventoryBlueprintManifest,\n components: {},\n screenTemplates: inventoryScreenTemplates,\n dialogTemplates: inventoryDialogTemplates,\n screens: inventoryScreens,\n};\n"],"names":["inventoryBlueprint","manifest","inventoryBlueprintManifest","components","screenTemplates","inventoryScreenTemplates","dialogTemplates","inventoryDialogTemplates","screens","inventoryScreens"],"mappings":";;;;;AAAA;AACA;AAOA,2JACO,MAAMA,kBAAAA,GAAyC;IAClDC,QAAAA,EAAUC,0BAAAA;AACVC,IAAAA,UAAAA,EAAY,EAAC;IACbC,eAAAA,EAAiBC,wBAAAA;IACjBC,eAAAA,EAAiBC,2BAAAA;IACjBC,OAAAA,EAASC;AACb;;"}
@@ -0,0 +1,12 @@
1
+ export * from './packageName';
2
+ export * from './templateProvenance';
3
+ export * from './inventoryQueries';
4
+ export * from './inventoryParts';
5
+ export * from './inventoryScreenSet';
6
+ export * from './templates';
7
+ export * from './screens';
8
+ export * from './navigation';
9
+ export * from './manifest';
10
+ export * from './blueprint';
11
+ export * from './inventoryApplication';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,18 @@
1
+ export { inventoryBlueprintName } from './packageName.js';
2
+ export { inventoryTemplateProvenance } from './templateProvenance.js';
3
+ export { InventoryEntityKind, InventoryQuery, currencyOfData, fromQuery, inventoryEntityPlural, inventoryQueriesOf, localeOfData } from './inventoryQueries.js';
4
+ export { actionButton, closesDialog, goesTo, inventoryCategory, inventoryMetadata, opensDialog, opensRecordOnSelect, thumbnailOf, withBehaviors } from './inventoryParts.js';
5
+ export { inventoryScreenDefinitions } from './inventoryScreenSet.js';
6
+ export { inventoryScreenTemplates } from './templates/index.js';
7
+ export { inventoryScreens } from './screens/index.js';
8
+ export { inventoryModule, inventoryNavigation, inventoryStructure } from './navigation.js';
9
+ export { inventoryBlueprintManifest } from './manifest.js';
10
+ export { inventoryBlueprint } from './blueprint.js';
11
+ export { inventoryApplication, inventoryComposition, inventoryDefaultSampleDataId, inventoryNavigationModel } from './inventoryApplication.js';
12
+ export { component, panel } from '@cratis/scene.blueprint.default';
13
+ export { inventoryCheckInOutTemplate, inventoryQuickCreateDialogs as inventoryDialogTemplates, inventoryFormTemplates, inventoryQuickCreateDialogs } from './templates/formTemplates.js';
14
+ export { inventoryDashboardTemplate } from './templates/dashboardTemplate.js';
15
+ export { inventoryItemGalleryTemplate, inventoryItemListTemplate, inventoryMovementListTemplate, inventorySupplierListTemplate } from './templates/listTemplates.js';
16
+ export { inventoryItemPageTemplate } from './templates/recordTemplates.js';
17
+ export { inventoryLocationsTemplate } from './templates/locationsTemplate.js';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ import { ApplicationStructureIndex } from '@cratis/scene.engine';
2
+ import { ApplicationDocument, CompositionOptions } from '@cratis/scene.blueprint.default';
3
+ export declare const inventoryDefaultSampleDataId = "inventory-warehouse";
4
+ export declare function inventoryApplication(sampleData?: string): ApplicationDocument;
5
+ export declare const inventoryComposition: CompositionOptions;
6
+ export declare const inventoryNavigationModel: () => {
7
+ structure: ApplicationStructureIndex;
8
+ navigation: import("@cratis/scene.model").NavigationModel;
9
+ };
10
+ //# sourceMappingURL=inventoryApplication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inventoryApplication.d.ts","sourceRoot":"","sources":["../../inventoryApplication.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAkC,MAAM,iCAAiC,CAAC;AAM1H,eAAO,MAAM,4BAA4B,wBAAwB,CAAC;AAOlE,wBAAgB,oBAAoB,CAAC,UAAU,GAAE,MAAqC,GAAG,mBAAmB,CAG3G;AAGD,eAAO,MAAM,oBAAoB,EAAE,kBAAmE,CAAC;AAGvG,eAAO,MAAM,wBAAwB;IAAY,SAAS;IAAqD,UAAU;CAAwB,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { ApplicationStructureIndex } from '@cratis/scene.engine';
2
+ import { previewProfile, defaultLayouts } from '@cratis/scene.blueprint.default';
3
+ import { inventoryNavigation, inventoryStructure } from './navigation.js';
4
+ import { inventoryScreens } from './screens/index.js';
5
+ import { inventoryScreenTemplates } from './templates/index.js';
6
+ import { inventoryQuickCreateDialogs } from './templates/formTemplates.js';
7
+
8
+ // Copyright (c) Cratis. All rights reserved.
9
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
10
+ /** The id of the sample-data pack a new application starts with. */ const inventoryDefaultSampleDataId = 'inventory-warehouse';
11
+ /**
12
+ * The example application of the blueprint: the foundation's layouts, the Inventory and Assets templates and quick-create dialogs and its eight screens, rendering against the
13
+ * foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture
14
+ * (`Samples/Inventory/inventory.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.
15
+ */ function inventoryApplication(sampleData = inventoryDefaultSampleDataId) {
16
+ const profile = {
17
+ ...previewProfile(undefined),
18
+ name: 'Inventory and Assets',
19
+ sampleData: {
20
+ activePack: sampleData,
21
+ mappings: [],
22
+ bindings: []
23
+ }
24
+ };
25
+ return {
26
+ layouts: defaultLayouts,
27
+ screenTemplates: inventoryScreenTemplates,
28
+ dialogTemplates: inventoryQuickCreateDialogs,
29
+ screens: inventoryScreens,
30
+ uiProfiles: [
31
+ profile
32
+ ]
33
+ };
34
+ }
35
+ /** What a host composes the screens with: the application's logo, which the shell's topbar shows. */ const inventoryComposition = {
36
+ logo: inventoryNavigation.application.logo
37
+ };
38
+ /** The structure and navigation the shell's regions show and the items' destinations resolve against. */ const inventoryNavigationModel = ()=>({
39
+ structure: new ApplicationStructureIndex(inventoryStructure),
40
+ navigation: inventoryNavigation
41
+ });
42
+
43
+ export { inventoryApplication, inventoryComposition, inventoryDefaultSampleDataId, inventoryNavigationModel };
44
+ //# sourceMappingURL=inventoryApplication.js.map