@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.
- package/blueprint.ts +16 -0
- package/blueprintCatalog.json +190 -0
- package/dist/cjs/blueprint.js +19 -0
- package/dist/cjs/blueprint.js.map +1 -0
- package/dist/cjs/index.js +72 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/inventoryApplication.js +49 -0
- package/dist/cjs/inventoryApplication.js.map +1 -0
- package/dist/cjs/inventoryParts.js +131 -0
- package/dist/cjs/inventoryParts.js.map +1 -0
- package/dist/cjs/inventoryQueries.js +72 -0
- package/dist/cjs/inventoryQueries.js.map +1 -0
- package/dist/cjs/inventoryScreenSet.js +69 -0
- package/dist/cjs/inventoryScreenSet.js.map +1 -0
- package/dist/cjs/manifest.js +65 -0
- package/dist/cjs/manifest.js.map +1 -0
- package/dist/cjs/navigation.js +143 -0
- package/dist/cjs/navigation.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/packageName.js +8 -0
- package/dist/cjs/packageName.js.map +1 -0
- package/dist/cjs/screens/index.js +22 -0
- package/dist/cjs/screens/index.js.map +1 -0
- package/dist/cjs/templateProvenance.js +24 -0
- package/dist/cjs/templateProvenance.js.map +1 -0
- package/dist/cjs/templates/dashboardTemplate.js +92 -0
- package/dist/cjs/templates/dashboardTemplate.js.map +1 -0
- package/dist/cjs/templates/formTemplates.js +94 -0
- package/dist/cjs/templates/formTemplates.js.map +1 -0
- package/dist/cjs/templates/index.js +34 -0
- package/dist/cjs/templates/index.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +212 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/locationsTemplate.js +63 -0
- package/dist/cjs/templates/locationsTemplate.js.map +1 -0
- package/dist/cjs/templates/recordTemplates.js +111 -0
- package/dist/cjs/templates/recordTemplates.js.map +1 -0
- package/dist/esm/blueprint.d.ts +3 -0
- package/dist/esm/blueprint.d.ts.map +1 -0
- package/dist/esm/blueprint.js +17 -0
- package/dist/esm/blueprint.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/inventoryApplication.d.ts +10 -0
- package/dist/esm/inventoryApplication.d.ts.map +1 -0
- package/dist/esm/inventoryApplication.js +44 -0
- package/dist/esm/inventoryApplication.js.map +1 -0
- package/dist/esm/inventoryParts.d.ts +15 -0
- package/dist/esm/inventoryParts.d.ts.map +1 -0
- package/dist/esm/inventoryParts.js +114 -0
- package/dist/esm/inventoryParts.js.map +1 -0
- package/dist/esm/inventoryQueries.d.ts +44 -0
- package/dist/esm/inventoryQueries.d.ts.map +1 -0
- package/dist/esm/inventoryQueries.js +64 -0
- package/dist/esm/inventoryQueries.js.map +1 -0
- package/dist/esm/inventoryScreenSet.d.ts +7 -0
- package/dist/esm/inventoryScreenSet.d.ts.map +1 -0
- package/dist/esm/inventoryScreenSet.js +67 -0
- package/dist/esm/inventoryScreenSet.js.map +1 -0
- package/dist/esm/manifest.d.ts +3 -0
- package/dist/esm/manifest.d.ts.map +1 -0
- package/dist/esm/manifest.js +63 -0
- package/dist/esm/manifest.js.map +1 -0
- package/dist/esm/navigation.d.ts +5 -0
- package/dist/esm/navigation.d.ts.map +1 -0
- package/dist/esm/navigation.js +139 -0
- package/dist/esm/navigation.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/packageName.d.ts +2 -0
- package/dist/esm/packageName.d.ts.map +1 -0
- package/dist/esm/packageName.js +6 -0
- package/dist/esm/packageName.js.map +1 -0
- package/dist/esm/screens/index.d.ts +3 -0
- package/dist/esm/screens/index.d.ts.map +1 -0
- package/dist/esm/screens/index.js +20 -0
- package/dist/esm/screens/index.js.map +1 -0
- package/dist/esm/templateProvenance.d.ts +3 -0
- package/dist/esm/templateProvenance.d.ts.map +1 -0
- package/dist/esm/templateProvenance.js +22 -0
- package/dist/esm/templateProvenance.js.map +1 -0
- package/dist/esm/templates/dashboardTemplate.d.ts +3 -0
- package/dist/esm/templates/dashboardTemplate.d.ts.map +1 -0
- package/dist/esm/templates/dashboardTemplate.js +90 -0
- package/dist/esm/templates/dashboardTemplate.js.map +1 -0
- package/dist/esm/templates/formTemplates.d.ts +5 -0
- package/dist/esm/templates/formTemplates.d.ts.map +1 -0
- package/dist/esm/templates/formTemplates.js +90 -0
- package/dist/esm/templates/formTemplates.js.map +1 -0
- package/dist/esm/templates/index.d.ts +8 -0
- package/dist/esm/templates/index.d.ts.map +1 -0
- package/dist/esm/templates/index.js +22 -0
- package/dist/esm/templates/index.js.map +1 -0
- package/dist/esm/templates/listTemplates.d.ts +6 -0
- package/dist/esm/templates/listTemplates.d.ts.map +1 -0
- package/dist/esm/templates/listTemplates.js +207 -0
- package/dist/esm/templates/listTemplates.js.map +1 -0
- package/dist/esm/templates/locationsTemplate.d.ts +3 -0
- package/dist/esm/templates/locationsTemplate.d.ts.map +1 -0
- package/dist/esm/templates/locationsTemplate.js +61 -0
- package/dist/esm/templates/locationsTemplate.js.map +1 -0
- package/dist/esm/templates/recordTemplates.d.ts +3 -0
- package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
- package/dist/esm/templates/recordTemplates.js +109 -0
- package/dist/esm/templates/recordTemplates.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/index.ts +14 -0
- package/inventoryApplication.ts +28 -0
- package/inventoryParts.ts +52 -0
- package/inventoryQueries.ts +64 -0
- package/inventoryScreenSet.ts +25 -0
- package/manifest.ts +41 -0
- package/navigation.ts +60 -0
- package/package.json +79 -5
- package/packageName.ts +5 -0
- package/sampleData/inventory-warehouse.json +1770 -0
- package/screens/index.ts +20 -0
- package/templateProvenance.ts +15 -0
- package/templates/dashboardTemplate.ts +45 -0
- package/templates/formTemplates.ts +60 -0
- package/templates/index.ts +25 -0
- package/templates/listTemplates.ts +109 -0
- package/templates/locationsTemplate.ts +36 -0
- package/templates/recordTemplates.ts +45 -0
- package/thumbnails/InventoryAdjustStock.svg +12 -0
- package/thumbnails/InventoryCheckInOut.svg +17 -0
- package/thumbnails/InventoryDashboard.svg +14 -0
- package/thumbnails/InventoryItemGallery.svg +29 -0
- package/thumbnails/InventoryItemList.svg +13 -0
- package/thumbnails/InventoryItemPage.svg +18 -0
- package/thumbnails/InventoryLocations.svg +20 -0
- package/thumbnails/InventoryMovementList.svg +13 -0
- package/thumbnails/InventoryQuickCreateItem.svg +12 -0
- package/thumbnails/InventoryQuickCreateSupplier.svg +12 -0
- package/thumbnails/InventorySupplierList.svg +13 -0
- package/thumbnails/inventory.svg +14 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageName.d.ts","sourceRoot":"","sources":["../../packageName.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */ const inventoryBlueprintName = 'Cratis.Blueprint.Inventory';
|
|
4
|
+
|
|
5
|
+
export { inventoryBlueprintName };
|
|
6
|
+
//# sourceMappingURL=packageName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageName.js","sources":["../../packageName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */\nexport const inventoryBlueprintName = 'Cratis.Blueprint.Inventory';\n"],"names":["inventoryBlueprintName"],"mappings":"AAAA;AACA;AAEA,iHACO,MAAMA,sBAAAA,GAAyB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../screens/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ7C,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAQlC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LayoutName } from '@cratis/scene.blueprint.default';
|
|
2
|
+
import { inventoryScreenDefinitions } from '../inventoryScreenSet.js';
|
|
3
|
+
|
|
4
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
5
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
6
|
+
/**
|
|
7
|
+
* The ready-to-use screens: real `Screen` instances, one for each entry of the manifest's `blueprint.screenSet`, each filling the screen template it names in
|
|
8
|
+
* the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`inventoryNavigation`).
|
|
9
|
+
*/ const inventoryScreens = inventoryScreenDefinitions.map((definition)=>({
|
|
10
|
+
name: definition.name,
|
|
11
|
+
layout: LayoutName.AppShell,
|
|
12
|
+
screenTemplate: definition.template,
|
|
13
|
+
slotContent: {},
|
|
14
|
+
forms: [],
|
|
15
|
+
contributions: [],
|
|
16
|
+
path: definition.name.split('.')
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
export { inventoryScreens };
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../screens/index.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Screen } from '@cratis/scene.model';\nimport { LayoutName } from '@cratis/scene.blueprint.default';\nimport { inventoryScreenDefinitions } from '../inventoryScreenSet';\n\n/**\n * The ready-to-use screens: real `Screen` instances, one for each entry of the manifest's `blueprint.screenSet`, each filling the screen template it names in\n * the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`inventoryNavigation`).\n */\nexport const inventoryScreens: Screen[] = inventoryScreenDefinitions.map(definition => ({\n name: definition.name,\n layout: LayoutName.AppShell,\n screenTemplate: definition.template,\n slotContent: {},\n forms: [],\n contributions: [],\n path: definition.name.split('.'),\n}));\n"],"names":["inventoryScreens","inventoryScreenDefinitions","map","definition","name","layout","LayoutName","AppShell","screenTemplate","template","slotContent","forms","contributions","path","split"],"mappings":";;;AAAA;AACA;AAMA;;;UAIaA,gBAAAA,GAA6BC,0BAAAA,CAA2BC,GAAG,CAACC,CAAAA,cAAe;AACpFC,QAAAA,IAAAA,EAAMD,WAAWC,IAAI;AACrBC,QAAAA,MAAAA,EAAQC,WAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBL,WAAWM,QAAQ;AACnCC,QAAAA,WAAAA,EAAa,EAAC;AACdC,QAAAA,KAAAA,EAAO,EAAE;AACTC,QAAAA,aAAAA,EAAe,EAAE;AACjBC,QAAAA,IAAAA,EAAMV,UAAAA,CAAWC,IAAI,CAACU,KAAK,CAAC,GAAA;AAChC,KAAA,CAAA;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateProvenance.d.ts","sourceRoot":"","sources":["../../templateProvenance.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,eAAO,MAAM,2BAA2B,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAQ1H,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/** The compatibility, attribution and license metadata every template this blueprint ships carries. */ const inventoryTemplateProvenance = {
|
|
4
|
+
compatibility: {
|
|
5
|
+
scene: '^4.13.0',
|
|
6
|
+
packages: [
|
|
7
|
+
{
|
|
8
|
+
name: 'Cratis.Blueprint.Default',
|
|
9
|
+
versionRange: '^1.0.0'
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
attribution: {
|
|
14
|
+
author: 'Cratis',
|
|
15
|
+
url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.inventory'
|
|
16
|
+
},
|
|
17
|
+
license: 'MIT',
|
|
18
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { inventoryTemplateProvenance };
|
|
22
|
+
//# sourceMappingURL=templateProvenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateProvenance.js","sources":["../../templateProvenance.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { TemplateMetadata } from '@cratis/scene.model';\n\n/** The compatibility, attribution and license metadata every template this blueprint ships carries. */\nexport const inventoryTemplateProvenance: Pick<TemplateMetadata, 'compatibility' | 'attribution' | 'license' | 'licenseUrl'> = {\n compatibility: {\n scene: '^4.13.0',\n packages: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],\n },\n attribution: { author: 'Cratis', url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.inventory' },\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n"],"names":["inventoryTemplateProvenance","compatibility","scene","packages","name","versionRange","attribution","author","url","license","licenseUrl"],"mappings":"AAAA;AACA;AAIA,wGACO,MAAMA,2BAAAA,GAAkH;IAC3HC,aAAAA,EAAe;QACXC,KAAAA,EAAO,SAAA;QACPC,QAAAA,EAAU;AAAC,YAAA;gBAAEC,IAAAA,EAAM,0BAAA;gBAA4BC,YAAAA,EAAc;AAAS;AAAE;AAC5E,KAAA;IACAC,WAAAA,EAAa;QAAEC,MAAAA,EAAQ,QAAA;QAAUC,GAAAA,EAAK;AAAkF,KAAA;IACxHC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardTemplate.d.ts","sourceRoot":"","sources":["../../../templates/dashboardTemplate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAUpE,eAAO,MAAM,0BAA0B,EAAE,cA+BxC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { TemplateScope } from '@cratis/scene.model';
|
|
2
|
+
import { component, dashboardScreenTemplate } from '@cratis/scene.blueprint.default';
|
|
3
|
+
import { localeOfData, fromQuery, inventoryQueriesOf, InventoryQuery, currencyOfData, InventoryEntityKind } from '../inventoryQueries.js';
|
|
4
|
+
import { inventoryMetadata } from '../inventoryParts.js';
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
/**
|
|
9
|
+
* The inventory dashboard (the foundation Dashboard, Operational variant): what is running low and what the stock is worth as key figures, the items
|
|
10
|
+
* that move most as a chart, the movements of the last days beneath, and the items to reorder beside them. Every region is its own component with its own
|
|
11
|
+
* loading, empty and error states, so one failed query leaves the others.
|
|
12
|
+
*/ const inventoryDashboardTemplate = {
|
|
13
|
+
name: 'InventoryDashboard',
|
|
14
|
+
fitsSlot: 'content',
|
|
15
|
+
slots: dashboardScreenTemplate.slots,
|
|
16
|
+
arrangement: dashboardScreenTemplate.arrangement,
|
|
17
|
+
content: {
|
|
18
|
+
header: [
|
|
19
|
+
component('inventory-dashboard-header', 'pageHeader', {
|
|
20
|
+
title: 'Inventory dashboard',
|
|
21
|
+
subtitle: 'Stock levels and movements this week'
|
|
22
|
+
})
|
|
23
|
+
],
|
|
24
|
+
kpis: [
|
|
25
|
+
component('inventory-kpi-low', 'statCard', {
|
|
26
|
+
label: 'Low stock items',
|
|
27
|
+
value: fromQuery(InventoryQuery.Kpis, '0.value'),
|
|
28
|
+
change: fromQuery(InventoryQuery.Kpis, '0.change'),
|
|
29
|
+
goodDirection: 'down',
|
|
30
|
+
comparison: 'last week',
|
|
31
|
+
...localeOfData
|
|
32
|
+
}),
|
|
33
|
+
component('inventory-kpi-value', 'statCard', {
|
|
34
|
+
label: 'Stock value',
|
|
35
|
+
value: fromQuery(InventoryQuery.Kpis, '1.value'),
|
|
36
|
+
change: fromQuery(InventoryQuery.Kpis, '1.change'),
|
|
37
|
+
format: 'currency',
|
|
38
|
+
fractionDigits: 0,
|
|
39
|
+
comparison: 'last week',
|
|
40
|
+
...currencyOfData
|
|
41
|
+
}),
|
|
42
|
+
component('inventory-kpi-movements', 'statCard', {
|
|
43
|
+
label: 'Movements this week',
|
|
44
|
+
value: fromQuery(InventoryQuery.Kpis, '2.value'),
|
|
45
|
+
change: fromQuery(InventoryQuery.Kpis, '2.change'),
|
|
46
|
+
comparison: 'last week',
|
|
47
|
+
...localeOfData
|
|
48
|
+
})
|
|
49
|
+
],
|
|
50
|
+
charts: [
|
|
51
|
+
component('inventory-chart-movers', 'chartWrapper', {
|
|
52
|
+
title: 'Top movers',
|
|
53
|
+
kind: 'bar',
|
|
54
|
+
categories: fromQuery(InventoryQuery.TopMovers, '0.categories'),
|
|
55
|
+
series: fromQuery(InventoryQuery.TopMovers, '0.series'),
|
|
56
|
+
...localeOfData
|
|
57
|
+
})
|
|
58
|
+
],
|
|
59
|
+
tables: [
|
|
60
|
+
component('inventory-dashboard-movements', 'dataList', {
|
|
61
|
+
label: 'Recent movements',
|
|
62
|
+
rows: fromQuery(InventoryQuery.RecentMovements),
|
|
63
|
+
columns: fromQuery(inventoryQueriesOf(InventoryEntityKind.Movement).columns),
|
|
64
|
+
titleField: 'item',
|
|
65
|
+
pageSize: 5,
|
|
66
|
+
...localeOfData
|
|
67
|
+
})
|
|
68
|
+
],
|
|
69
|
+
aside: [
|
|
70
|
+
component('inventory-dashboard-low', 'dataList', {
|
|
71
|
+
label: 'Reorder soon',
|
|
72
|
+
rows: fromQuery(InventoryQuery.LowStock),
|
|
73
|
+
columns: fromQuery(inventoryQueriesOf(InventoryEntityKind.Item).columns),
|
|
74
|
+
titleField: 'name',
|
|
75
|
+
toneField: 'tone',
|
|
76
|
+
pageSize: 5,
|
|
77
|
+
...localeOfData
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
displayName: 'Inventory dashboard',
|
|
82
|
+
description: 'Low stock count, stock value, top movers, recent movements and the items to reorder.',
|
|
83
|
+
metadata: inventoryMetadata('InventoryDashboard', 'Dashboard', [
|
|
84
|
+
TemplateScope.Module,
|
|
85
|
+
TemplateScope.Feature
|
|
86
|
+
])
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { inventoryDashboardTemplate };
|
|
90
|
+
//# sourceMappingURL=dashboardTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboardTemplate.js","sources":["../../../templates/dashboardTemplate.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { dashboardScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { InventoryEntityKind, InventoryQuery, currencyOfData, fromQuery, inventoryQueriesOf, localeOfData } from '../inventoryQueries';\nimport { component, inventoryMetadata } from '../inventoryParts';\n\n/**\n * The inventory dashboard (the foundation Dashboard, Operational variant): what is running low and what the stock is worth as key figures, the items\n * that move most as a chart, the movements of the last days beneath, and the items to reorder beside them. Every region is its own component with its own\n * loading, empty and error states, so one failed query leaves the others.\n */\nexport const inventoryDashboardTemplate: ScreenTemplate = {\n name: 'InventoryDashboard',\n fitsSlot: 'content',\n slots: dashboardScreenTemplate.slots,\n arrangement: dashboardScreenTemplate.arrangement,\n content: {\n header: [component('inventory-dashboard-header', 'pageHeader', { title: 'Inventory dashboard', subtitle: 'Stock levels and movements this week' })],\n kpis: [\n component('inventory-kpi-low', 'statCard', {\n label: 'Low stock items', value: fromQuery(InventoryQuery.Kpis, '0.value'), change: fromQuery(InventoryQuery.Kpis, '0.change'), goodDirection: 'down', comparison: 'last week', ...localeOfData,\n }),\n component('inventory-kpi-value', 'statCard', {\n label: 'Stock value', value: fromQuery(InventoryQuery.Kpis, '1.value'), change: fromQuery(InventoryQuery.Kpis, '1.change'), format: 'currency', fractionDigits: 0, comparison: 'last week', ...currencyOfData,\n }),\n component('inventory-kpi-movements', 'statCard', {\n label: 'Movements this week', value: fromQuery(InventoryQuery.Kpis, '2.value'), change: fromQuery(InventoryQuery.Kpis, '2.change'), comparison: 'last week', ...localeOfData,\n }),\n ],\n charts: [component('inventory-chart-movers', 'chartWrapper', {\n title: 'Top movers', kind: 'bar', categories: fromQuery(InventoryQuery.TopMovers, '0.categories'), series: fromQuery(InventoryQuery.TopMovers, '0.series'), ...localeOfData,\n })],\n tables: [component('inventory-dashboard-movements', 'dataList', {\n label: 'Recent movements', rows: fromQuery(InventoryQuery.RecentMovements), columns: fromQuery(inventoryQueriesOf(InventoryEntityKind.Movement).columns), titleField: 'item', pageSize: 5, ...localeOfData,\n })],\n aside: [component('inventory-dashboard-low', 'dataList', {\n label: 'Reorder soon', rows: fromQuery(InventoryQuery.LowStock), columns: fromQuery(inventoryQueriesOf(InventoryEntityKind.Item).columns), titleField: 'name', toneField: 'tone', pageSize: 5, ...localeOfData,\n })],\n },\n displayName: 'Inventory dashboard',\n description: 'Low stock count, stock value, top movers, recent movements and the items to reorder.',\n metadata: inventoryMetadata('InventoryDashboard', 'Dashboard', [TemplateScope.Module, TemplateScope.Feature]),\n};\n"],"names":["inventoryDashboardTemplate","name","fitsSlot","slots","dashboardScreenTemplate","arrangement","content","header","component","title","subtitle","kpis","label","value","fromQuery","InventoryQuery","Kpis","change","goodDirection","comparison","localeOfData","format","fractionDigits","currencyOfData","charts","kind","categories","TopMovers","series","tables","rows","RecentMovements","columns","inventoryQueriesOf","InventoryEntityKind","Movement","titleField","pageSize","aside","LowStock","Item","toneField","displayName","description","metadata","inventoryMetadata","TemplateScope","Module","Feature"],"mappings":";;;;;AAAA;AACA;AAOA;;;;UAKaA,0BAAAA,GAA6C;IACtDC,IAAAA,EAAM,oBAAA;IACNC,QAAAA,EAAU,SAAA;AACVC,IAAAA,KAAAA,EAAOC,wBAAwBD,KAAK;AACpCE,IAAAA,WAAAA,EAAaD,wBAAwBC,WAAW;IAChDC,OAAAA,EAAS;QACLC,MAAAA,EAAQ;AAACC,YAAAA,SAAAA,CAAU,8BAA8B,YAAA,EAAc;gBAAEC,KAAAA,EAAO,qBAAA;gBAAuBC,QAAAA,EAAU;AAAuC,aAAA;AAAG,SAAA;QACnJC,IAAAA,EAAM;AACFH,YAAAA,SAAAA,CAAU,qBAAqB,UAAA,EAAY;gBACvCI,KAAAA,EAAO,iBAAA;gBAAmBC,KAAAA,EAAOC,SAAAA,CAAUC,cAAAA,CAAeC,IAAI,EAAE,SAAA,CAAA;gBAAYC,MAAAA,EAAQH,SAAAA,CAAUC,cAAAA,CAAeC,IAAI,EAAE,UAAA,CAAA;gBAAaE,aAAAA,EAAe,MAAA;gBAAQC,UAAAA,EAAY,WAAA;AAAa,gBAAA,GAAGC;AACvL,aAAA,CAAA;AACAZ,YAAAA,SAAAA,CAAU,uBAAuB,UAAA,EAAY;gBACzCI,KAAAA,EAAO,aAAA;gBAAeC,KAAAA,EAAOC,SAAAA,CAAUC,cAAAA,CAAeC,IAAI,EAAE,SAAA,CAAA;gBAAYC,MAAAA,EAAQH,SAAAA,CAAUC,cAAAA,CAAeC,IAAI,EAAE,UAAA,CAAA;gBAAaK,MAAAA,EAAQ,UAAA;gBAAYC,cAAAA,EAAgB,CAAA;gBAAGH,UAAAA,EAAY,WAAA;AAAa,gBAAA,GAAGI;AACnM,aAAA,CAAA;AACAf,YAAAA,SAAAA,CAAU,2BAA2B,UAAA,EAAY;gBAC7CI,KAAAA,EAAO,qBAAA;gBAAuBC,KAAAA,E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AAU,CAAA;AAAG,gBAAA,GAAGjB;AACtM,aAAA;AAAG;AACP,KAAA;IACAsB,WAAAA,EAAa,qBAAA;IACbC,WAAAA,EAAa,sFAAA;IACbC,QAAAA,EAAUC,iBAAAA,CAAkB,sBAAsB,WAAA,EAAa;AAACC,QAAAA,aAAAA,CAAcC,MAAM;AAAED,QAAAA,aAAAA,CAAcE;AAAQ,KAAA;AAChH;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DialogTemplate, ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
export declare const inventoryCheckInOutTemplate: ScreenTemplate;
|
|
3
|
+
export declare const inventoryFormTemplates: ScreenTemplate[];
|
|
4
|
+
export declare const inventoryQuickCreateDialogs: DialogTemplate[];
|
|
5
|
+
//# sourceMappingURL=formTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplates.d.ts","sourceRoot":"","sources":["../../../templates/formTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAUpF,eAAO,MAAM,2BAA2B,EAAE,cAezC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAAkC,CAAC;AAwBtF,eAAO,MAAM,2BAA2B,EAAE,cAAc,EAIvD,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { TemplateScope } from '@cratis/scene.model';
|
|
2
|
+
import { component, formScreenTemplate, quickCreateDialogTemplate } from '@cratis/scene.blueprint.default';
|
|
3
|
+
import { currencyOfData, fromQuery, InventoryQuery, localeOfData } from '../inventoryQueries.js';
|
|
4
|
+
import { inventoryMetadata, withBehaviors, closesDialog } from '../inventoryParts.js';
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
/**
|
|
9
|
+
* Check in or out, made for a phone held in one hand beside a shelf: one column of large fields, the item first - scanned or searched for in the same field -
|
|
10
|
+
* then the direction, how many, who has it and when it is due back. The foundation `FormScreen` supplies the sections, validation, Save and the unsaved-changes
|
|
11
|
+
* guard; what is particular here is that nothing is arranged side by side.
|
|
12
|
+
*/ const inventoryCheckInOutTemplate = {
|
|
13
|
+
name: 'InventoryCheckInOut',
|
|
14
|
+
fitsSlot: 'content',
|
|
15
|
+
slots: formScreenTemplate.slots,
|
|
16
|
+
arrangement: formScreenTemplate.arrangement,
|
|
17
|
+
content: {
|
|
18
|
+
header: [
|
|
19
|
+
component('InventoryCheckInOut-header', 'pageHeader', {
|
|
20
|
+
title: 'Check in or out',
|
|
21
|
+
subtitle: 'Scan or search for the item first'
|
|
22
|
+
})
|
|
23
|
+
],
|
|
24
|
+
body: [
|
|
25
|
+
component('InventoryCheckInOut-body', 'formScreenBody', {
|
|
26
|
+
mode: 'create',
|
|
27
|
+
saveAndNew: true,
|
|
28
|
+
strings: {
|
|
29
|
+
formSave: 'Record movement'
|
|
30
|
+
},
|
|
31
|
+
sections: fromQuery('CheckInOutSections'),
|
|
32
|
+
errors: fromQuery(InventoryQuery.FormErrors, '0'),
|
|
33
|
+
...currencyOfData
|
|
34
|
+
})
|
|
35
|
+
],
|
|
36
|
+
actions: []
|
|
37
|
+
},
|
|
38
|
+
displayName: 'Inventory check in and out',
|
|
39
|
+
description: 'A mobile-first form to scan or search for an item and check it in or out, with who has it and when it is due back.',
|
|
40
|
+
metadata: inventoryMetadata('InventoryCheckInOut', 'Form', [
|
|
41
|
+
TemplateScope.Feature,
|
|
42
|
+
TemplateScope.Subfeature
|
|
43
|
+
])
|
|
44
|
+
};
|
|
45
|
+
/** The screen templates that are forms. */ const inventoryFormTemplates = [
|
|
46
|
+
inventoryCheckInOutTemplate
|
|
47
|
+
];
|
|
48
|
+
/**
|
|
49
|
+
* One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields
|
|
50
|
+
* that thing needs to get started.
|
|
51
|
+
*/ function quickCreateOf(name, title, subtitle, sections, noun, create) {
|
|
52
|
+
return {
|
|
53
|
+
name,
|
|
54
|
+
slots: quickCreateDialogTemplate.slots,
|
|
55
|
+
content: {
|
|
56
|
+
header: [
|
|
57
|
+
component(`${name}-frame`, 'dialogFrame', {
|
|
58
|
+
title,
|
|
59
|
+
subtitle
|
|
60
|
+
})
|
|
61
|
+
],
|
|
62
|
+
body: [
|
|
63
|
+
withBehaviors(component(`${name}-form`, 'formScreenBody', {
|
|
64
|
+
mode: 'create',
|
|
65
|
+
saveAndNew: false,
|
|
66
|
+
strings: {
|
|
67
|
+
formSave: create
|
|
68
|
+
},
|
|
69
|
+
sections: fromQuery(sections),
|
|
70
|
+
errors: fromQuery(InventoryQuery.FormErrors, '0'),
|
|
71
|
+
...localeOfData
|
|
72
|
+
}), closesDialog())
|
|
73
|
+
],
|
|
74
|
+
actions: []
|
|
75
|
+
},
|
|
76
|
+
displayName: `Inventory quick create ${noun}`,
|
|
77
|
+
description: `A short form that ${noun === 'stock adjustment' ? 'adjusts the stock of one item' : `creates one ${noun}`} without leaving the page.`,
|
|
78
|
+
metadata: inventoryMetadata(name, 'Dialog', [
|
|
79
|
+
TemplateScope.Slice
|
|
80
|
+
])
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Adjust stock (an item, a quantity change and a reason), and the quick creation of an item and of a supplier. */ const inventoryQuickCreateDialogs = [
|
|
84
|
+
quickCreateOf('InventoryAdjustStock', 'Adjust stock', 'Count what is on the shelf and say why it changed', 'AdjustStockSections', 'stock adjustment', 'Adjust'),
|
|
85
|
+
quickCreateOf('InventoryQuickCreateItem', 'New item', 'Only what is needed to get started', 'ItemQuickSections', 'item', 'Create'),
|
|
86
|
+
quickCreateOf('InventoryQuickCreateSupplier', 'New supplier', 'Only what is needed to get started', 'SupplierQuickSections', 'supplier', 'Create')
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
export { inventoryCheckInOutTemplate, inventoryFormTemplates, inventoryQuickCreateDialogs };
|
|
90
|
+
//# sourceMappingURL=formTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplates.js","sources":["../../../templates/formTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogTemplate, ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { formScreenTemplate, quickCreateDialogTemplate } from '@cratis/scene.blueprint.default';\nimport { InventoryQuery, currencyOfData, fromQuery, localeOfData } from '../inventoryQueries';\nimport { closesDialog, component, inventoryMetadata, withBehaviors } from '../inventoryParts';\n\n/**\n * Check in or out, made for a phone held in one hand beside a shelf: one column of large fields, the item first - scanned or searched for in the same field -\n * then the direction, how many, who has it and when it is due back. The foundation `FormScreen` supplies the sections, validation, Save and the unsaved-changes\n * guard; what is particular here is that nothing is arranged side by side.\n */\nexport const inventoryCheckInOutTemplate: ScreenTemplate = {\n name: 'InventoryCheckInOut',\n fitsSlot: 'content',\n slots: formScreenTemplate.slots,\n arrangement: formScreenTemplate.arrangement,\n content: {\n header: [component('InventoryCheckInOut-header', 'pageHeader', { title: 'Check in or out', subtitle: 'Scan or search for the item first' })],\n body: [component('InventoryCheckInOut-body', 'formScreenBody', {\n mode: 'create', saveAndNew: true, strings: { formSave: 'Record movement' }, sections: fromQuery('CheckInOutSections'), errors: fromQuery(InventoryQuery.FormErrors, '0'), ...currencyOfData,\n })],\n actions: [],\n },\n displayName: 'Inventory check in and out',\n description: 'A mobile-first form to scan or search for an item and check it in or out, with who has it and when it is due back.',\n metadata: inventoryMetadata('InventoryCheckInOut', 'Form', [TemplateScope.Feature, TemplateScope.Subfeature]),\n};\n\n/** The screen templates that are forms. */\nexport const inventoryFormTemplates: ScreenTemplate[] = [inventoryCheckInOutTemplate];\n\n/**\n * One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields\n * that thing needs to get started.\n */\nfunction quickCreateOf(name: string, title: string, subtitle: string, sections: string, noun: string, create: string): DialogTemplate {\n return {\n name,\n slots: quickCreateDialogTemplate.slots,\n content: {\n header: [component(`${name}-frame`, 'dialogFrame', { title, subtitle })],\n body: [withBehaviors(component(`${name}-form`, 'formScreenBody', {\n mode: 'create', saveAndNew: false, strings: { formSave: create }, sections: fromQuery(sections), errors: fromQuery(InventoryQuery.FormErrors, '0'), ...localeOfData,\n }), closesDialog())],\n actions: [],\n },\n displayName: `Inventory quick create ${noun}`,\n description: `A short form that ${noun === 'stock adjustment' ? 'adjusts the stock of one item' : `creates one ${noun}`} without leaving the page.`,\n metadata: inventoryMetadata(name, 'Dialog', [TemplateScope.Slice]),\n };\n}\n\n/** Adjust stock (an item, a quantity change and a reason), and the quick creation of an item and of a supplier. */\nexport const inventoryQuickCreateDialogs: DialogTemplate[] = [\n quickCreateOf('InventoryAdjustStock', 'Adjust stock', 'Count what is on the shelf and say why it changed', 'AdjustStockSections', 'stock adjustment', 'Adjust'),\n quickCreateOf('InventoryQuickCreateItem', 'New item', 'Only what is needed to get started', 'ItemQuickSections', 'item', 'Create'),\n quickCreateOf('InventoryQuickCreateSupplier', 'New supplier', 'Only what is needed to get started', 'SupplierQuickSections', 'supplier', 'Create'),\n];\n"],"names":["inventoryCheckInOutTemplate","name","fitsSlot","slots","formScreenTemplate","arrangement","content","header","component","title","subtitle","body","mode","saveAndNew","strings","formSave","sections","fromQuery","errors","InventoryQuery","FormErrors","currencyOfData","actions","displayName","description","metadata","inventoryMetadata","TemplateScope","Feature","Subfeature","inventoryFormTemplates","quickCreateOf","noun","create","quickCreateDialogTemplate","withBehaviors","localeOfData","closesDialog","Slice","inventoryQuickCreateDialogs"],"mappings":";;;;;AAAA;AACA;AAOA;;;;UAKaA,2BAAAA,GAA8C;IACvDC,IAAAA,EAAM,qBAAA;IACNC,QAAAA,EAAU,SAAA;AACVC,IAAAA,KAAAA,EAAOC,mBAAmBD,KAAK;AAC/BE,IAAAA,WAA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2
|
+
export * from './listTemplates';
|
|
3
|
+
export * from './recordTemplates';
|
|
4
|
+
export * from './locationsTemplate';
|
|
5
|
+
export * from './formTemplates';
|
|
6
|
+
export declare const inventoryScreenTemplates: import("@cratis/scene.model/screens").ScreenTemplate[];
|
|
7
|
+
export { inventoryQuickCreateDialogs as inventoryDialogTemplates } from './formTemplates';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../templates/index.ts"],"names":[],"mappings":"AASA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAGhC,eAAO,MAAM,wBAAwB,wDAMpC,CAAC;AAEF,OAAO,EAAE,2BAA2B,IAAI,wBAAwB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { inventoryDashboardTemplate } from './dashboardTemplate.js';
|
|
2
|
+
import { inventoryFormTemplates } from './formTemplates.js';
|
|
3
|
+
export { inventoryCheckInOutTemplate, inventoryQuickCreateDialogs as inventoryDialogTemplates, inventoryQuickCreateDialogs } from './formTemplates.js';
|
|
4
|
+
import { inventoryItemListTemplate, inventoryItemGalleryTemplate, inventoryMovementListTemplate, inventorySupplierListTemplate } from './listTemplates.js';
|
|
5
|
+
import { inventoryLocationsTemplate } from './locationsTemplate.js';
|
|
6
|
+
import { inventoryItemPageTemplate } from './recordTemplates.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
|
+
/** Every screen template this blueprint provides, in the order the manifest lists them. */ const inventoryScreenTemplates = [
|
|
11
|
+
inventoryDashboardTemplate,
|
|
12
|
+
inventoryItemListTemplate,
|
|
13
|
+
inventoryItemGalleryTemplate,
|
|
14
|
+
inventoryItemPageTemplate,
|
|
15
|
+
inventoryLocationsTemplate,
|
|
16
|
+
inventoryMovementListTemplate,
|
|
17
|
+
...inventoryFormTemplates,
|
|
18
|
+
inventorySupplierListTemplate
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export { inventoryDashboardTemplate, inventoryFormTemplates, inventoryItemGalleryTemplate, inventoryItemListTemplate, inventoryItemPageTemplate, inventoryLocationsTemplate, inventoryMovementListTemplate, inventoryScreenTemplates, inventorySupplierListTemplate };
|
|
22
|
+
//# 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,0BAAAA;AACAC,IAAAA,yBAAAA;AAA2BC,IAAAA,4BAAAA;AAA8BC,IAAAA,yBAAAA;AACzDC,IAAAA,0BAAAA;AACAC,IAAAA,6BAAAA;AAAkCC,IAAAA,GAAAA,sBAAAA;AAClCC,IAAAA;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
export declare const inventoryItemListTemplate: ScreenTemplate;
|
|
3
|
+
export declare const inventoryItemGalleryTemplate: ScreenTemplate;
|
|
4
|
+
export declare const inventoryMovementListTemplate: ScreenTemplate;
|
|
5
|
+
export declare const inventorySupplierListTemplate: ScreenTemplate;
|
|
6
|
+
//# sourceMappingURL=listTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listTemplates.d.ts","sourceRoot":"","sources":["../../../templates/listTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkF,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAgFpJ,eAAO,MAAM,yBAAyB,gBAIpC,CAAC;AAGH,eAAO,MAAM,4BAA4B,gBAIvC,CAAC;AAGH,eAAO,MAAM,6BAA6B,gBAIxC,CAAC;AAGH,eAAO,MAAM,6BAA6B,gBAIxC,CAAC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { TemplateScope, NotificationLevel, InteractionActionKind, InteractionTriggerKind } from '@cratis/scene.model';
|
|
2
|
+
import { component, listScreenTemplate } from '@cratis/scene.blueprint.default';
|
|
3
|
+
import { inventoryQueriesOf, localeOfData, fromQuery, InventoryEntityKind } from '../inventoryQueries.js';
|
|
4
|
+
import { withBehaviors, opensDialog, goesTo, actionButton, inventoryMetadata, opensRecordOnSelect } from '../inventoryParts.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
|
+
const listScopes = [
|
|
9
|
+
TemplateScope.Module,
|
|
10
|
+
TemplateScope.Feature
|
|
11
|
+
];
|
|
12
|
+
/** 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)=>withBehaviors(actionButton(id, 'Export', 'secondary'), [
|
|
13
|
+
{
|
|
14
|
+
bindings: [
|
|
15
|
+
{
|
|
16
|
+
trigger: {
|
|
17
|
+
kind: InteractionTriggerKind.Click
|
|
18
|
+
},
|
|
19
|
+
actions: [
|
|
20
|
+
{
|
|
21
|
+
kind: InteractionActionKind.Notify,
|
|
22
|
+
level: NotificationLevel.Info,
|
|
23
|
+
message: {
|
|
24
|
+
text: 'The export has started.'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]);
|
|
32
|
+
/**
|
|
33
|
+
* One Inventory list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled for an entity. The slots, arrangement and
|
|
34
|
+
* every behavior - sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.
|
|
35
|
+
*/ function listTemplateOf(options) {
|
|
36
|
+
const queries = inventoryQueriesOf(options.entity);
|
|
37
|
+
const id = options.name;
|
|
38
|
+
const listId = `${id}-records`;
|
|
39
|
+
const primary = withBehaviors(actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? opensDialog(options.primary.dialog) : goesTo(options.primary.screen));
|
|
40
|
+
const list = component(listId, 'dataList', {
|
|
41
|
+
label: options.title,
|
|
42
|
+
rows: fromQuery(queries.rows),
|
|
43
|
+
columns: fromQuery(queries.columns),
|
|
44
|
+
titleField: options.titleField,
|
|
45
|
+
pageSize: options.cards ? 12 : 10,
|
|
46
|
+
urlKey: options.urlKey,
|
|
47
|
+
...localeOfData,
|
|
48
|
+
rowActions: options.rowActions,
|
|
49
|
+
...options.readOnly ? {} : {
|
|
50
|
+
selectionMode: options.recordScreen ? 'single' : 'multiple'
|
|
51
|
+
},
|
|
52
|
+
...options.cards ? {
|
|
53
|
+
variant: 'cards',
|
|
54
|
+
imageField: options.cards.imageField
|
|
55
|
+
} : {},
|
|
56
|
+
...options.toneField ? {
|
|
57
|
+
toneField: options.toneField
|
|
58
|
+
} : {}
|
|
59
|
+
});
|
|
60
|
+
return {
|
|
61
|
+
name: options.name,
|
|
62
|
+
fitsSlot: 'content',
|
|
63
|
+
slots: listScreenTemplate.slots,
|
|
64
|
+
arrangement: listScreenTemplate.arrangement,
|
|
65
|
+
content: {
|
|
66
|
+
header: [
|
|
67
|
+
component(`${id}-header`, 'pageHeader', {
|
|
68
|
+
title: options.title,
|
|
69
|
+
subtitle: options.subtitle
|
|
70
|
+
}, {
|
|
71
|
+
actions: [
|
|
72
|
+
exportAction(`${id}-export`),
|
|
73
|
+
primary
|
|
74
|
+
]
|
|
75
|
+
})
|
|
76
|
+
],
|
|
77
|
+
toolbar: [
|
|
78
|
+
component(`${id}-search`, 'globalSearch', {
|
|
79
|
+
placeholder: options.searchLabel,
|
|
80
|
+
label: options.searchLabel,
|
|
81
|
+
urlKey: `${options.urlKey}q`
|
|
82
|
+
}),
|
|
83
|
+
component(`${id}-views`, 'savedViewsMenu', {
|
|
84
|
+
views: fromQuery(queries.views),
|
|
85
|
+
savePermission: 'enabled',
|
|
86
|
+
managePermission: 'enabled'
|
|
87
|
+
}),
|
|
88
|
+
component(`${id}-columns`, 'columnChooser', {
|
|
89
|
+
columns: fromQuery(queries.columnChoices)
|
|
90
|
+
})
|
|
91
|
+
],
|
|
92
|
+
filters: [
|
|
93
|
+
component(`${id}-filter`, 'filterBuilder', {
|
|
94
|
+
fields: fromQuery(queries.filterFields),
|
|
95
|
+
...localeOfData
|
|
96
|
+
})
|
|
97
|
+
],
|
|
98
|
+
list: [
|
|
99
|
+
options.recordScreen ? withBehaviors(list, opensRecordOnSelect(listId, options.recordScreen)) : list
|
|
100
|
+
],
|
|
101
|
+
bulkBar: options.recordScreen || options.readOnly ? [] : [
|
|
102
|
+
component(`${id}-bulk`, 'bulkBar', {
|
|
103
|
+
selection: fromQuery(queries.selection),
|
|
104
|
+
actions: options.bulkActions
|
|
105
|
+
})
|
|
106
|
+
],
|
|
107
|
+
footer: []
|
|
108
|
+
},
|
|
109
|
+
displayName: options.displayName,
|
|
110
|
+
description: options.description,
|
|
111
|
+
metadata: inventoryMetadata(options.name, 'List', listScopes)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/** 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({
|
|
115
|
+
name: 'InventoryItemList',
|
|
116
|
+
entity: InventoryEntityKind.Item,
|
|
117
|
+
displayName: 'Inventory items',
|
|
118
|
+
description: 'Items with sku, category, location, quantity and status, low stock highlighted, filtered by category, location and status.',
|
|
119
|
+
title: 'Items',
|
|
120
|
+
subtitle: 'Everything in stock, low stock highlighted',
|
|
121
|
+
searchLabel: 'Search items',
|
|
122
|
+
urlKey: 'items',
|
|
123
|
+
primary: {
|
|
124
|
+
label: 'New item',
|
|
125
|
+
dialog: 'InventoryQuickCreateItem'
|
|
126
|
+
},
|
|
127
|
+
rowActions: [
|
|
128
|
+
'Adjust stock',
|
|
129
|
+
'Check out',
|
|
130
|
+
'Archive'
|
|
131
|
+
],
|
|
132
|
+
bulkActions: [],
|
|
133
|
+
titleField: 'name',
|
|
134
|
+
recordScreen: 'inventory.items.record',
|
|
135
|
+
toneField: 'tone'
|
|
136
|
+
});
|
|
137
|
+
/** 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({
|
|
138
|
+
name: 'InventoryItemGallery',
|
|
139
|
+
entity: InventoryEntityKind.Item,
|
|
140
|
+
displayName: 'Inventory item gallery',
|
|
141
|
+
description: 'Items as cards with a picture, sku, quantity and status, low stock highlighted.',
|
|
142
|
+
title: 'Item gallery',
|
|
143
|
+
subtitle: 'Items by how they look',
|
|
144
|
+
searchLabel: 'Search items',
|
|
145
|
+
urlKey: 'gallery',
|
|
146
|
+
primary: {
|
|
147
|
+
label: 'New item',
|
|
148
|
+
dialog: 'InventoryQuickCreateItem'
|
|
149
|
+
},
|
|
150
|
+
rowActions: [
|
|
151
|
+
'Adjust stock',
|
|
152
|
+
'Check out',
|
|
153
|
+
'Archive'
|
|
154
|
+
],
|
|
155
|
+
bulkActions: [],
|
|
156
|
+
titleField: 'name',
|
|
157
|
+
recordScreen: 'inventory.items.record',
|
|
158
|
+
toneField: 'tone',
|
|
159
|
+
cards: {
|
|
160
|
+
imageField: 'photo'
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
/** The movements: every time stock came in, went out, moved or was corrected, newest first. Nothing in it is edited. */ const inventoryMovementListTemplate = listTemplateOf({
|
|
164
|
+
name: 'InventoryMovementList',
|
|
165
|
+
entity: InventoryEntityKind.Movement,
|
|
166
|
+
displayName: 'Inventory movements',
|
|
167
|
+
description: 'Check ins, check outs, transfers and adjustments with the item, quantity, location and who did it.',
|
|
168
|
+
title: 'Movements',
|
|
169
|
+
subtitle: 'What came in, went out and moved',
|
|
170
|
+
searchLabel: 'Search movements',
|
|
171
|
+
urlKey: 'movements',
|
|
172
|
+
primary: {
|
|
173
|
+
label: 'Check in or out',
|
|
174
|
+
screen: 'inventory.movements.check'
|
|
175
|
+
},
|
|
176
|
+
rowActions: [
|
|
177
|
+
'View item'
|
|
178
|
+
],
|
|
179
|
+
bulkActions: [],
|
|
180
|
+
titleField: 'item',
|
|
181
|
+
readOnly: true
|
|
182
|
+
});
|
|
183
|
+
/** The suppliers: who items are bought from, how to reach them and how many items they supply. */ const inventorySupplierListTemplate = listTemplateOf({
|
|
184
|
+
name: 'InventorySupplierList',
|
|
185
|
+
entity: InventoryEntityKind.Supplier,
|
|
186
|
+
displayName: 'Inventory suppliers',
|
|
187
|
+
description: 'Suppliers with their contact, the items they supply and their status.',
|
|
188
|
+
title: 'Suppliers',
|
|
189
|
+
subtitle: 'Where the stock comes from',
|
|
190
|
+
searchLabel: 'Search suppliers',
|
|
191
|
+
urlKey: 'suppliers',
|
|
192
|
+
primary: {
|
|
193
|
+
label: 'New supplier',
|
|
194
|
+
dialog: 'InventoryQuickCreateSupplier'
|
|
195
|
+
},
|
|
196
|
+
rowActions: [
|
|
197
|
+
'Edit',
|
|
198
|
+
'Deactivate'
|
|
199
|
+
],
|
|
200
|
+
bulkActions: [
|
|
201
|
+
'Deactivate'
|
|
202
|
+
],
|
|
203
|
+
titleField: 'name'
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
export { inventoryItemGalleryTemplate, inventoryItemListTemplate, inventoryMovementListTemplate, inventorySupplierListTemplate };
|
|
207
|
+
//# 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,aAAAA,CAAcC,MAAM;AAAED,IAAAA,aAAAA,CAAcE;AAAQ,CAAA;AAEhE,gJACA,MAAMC,YAAAA,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