@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,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* The screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure
|
|
7
|
+
* and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.
|
|
8
|
+
*/ const inventoryScreenDefinitions = [
|
|
9
|
+
{
|
|
10
|
+
name: 'inventory.dashboard',
|
|
11
|
+
title: 'Dashboard',
|
|
12
|
+
template: 'InventoryDashboard',
|
|
13
|
+
order: 0,
|
|
14
|
+
description: 'Low stock, stock value, top movers and recent movements.'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'inventory.items',
|
|
18
|
+
title: 'Items',
|
|
19
|
+
template: 'InventoryItemList',
|
|
20
|
+
order: 1,
|
|
21
|
+
description: 'Every item with its stock, low stock highlighted.'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'inventory.items.gallery',
|
|
25
|
+
title: 'Item gallery',
|
|
26
|
+
template: 'InventoryItemGallery',
|
|
27
|
+
parent: 'inventory.items',
|
|
28
|
+
order: 0,
|
|
29
|
+
description: 'Every item as a card with its picture.'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'inventory.items.record',
|
|
33
|
+
title: 'Item',
|
|
34
|
+
template: 'InventoryItemPage',
|
|
35
|
+
parent: 'inventory.items',
|
|
36
|
+
description: 'One item with its stock by location, movement history and supplier.'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'inventory.locations',
|
|
40
|
+
title: 'Locations',
|
|
41
|
+
template: 'InventoryLocations',
|
|
42
|
+
order: 2,
|
|
43
|
+
description: 'The location tree beside what is stored in the chosen location.'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'inventory.movements',
|
|
47
|
+
title: 'Movements',
|
|
48
|
+
template: 'InventoryMovementList',
|
|
49
|
+
order: 3,
|
|
50
|
+
description: 'Every check in, check out, transfer and adjustment.'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'inventory.movements.check',
|
|
54
|
+
title: 'Check in or out',
|
|
55
|
+
template: 'InventoryCheckInOut',
|
|
56
|
+
parent: 'inventory.movements',
|
|
57
|
+
description: 'Scan or search an item and check it in or out, from a phone.'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'inventory.suppliers',
|
|
61
|
+
title: 'Suppliers',
|
|
62
|
+
template: 'InventorySupplierList',
|
|
63
|
+
order: 4,
|
|
64
|
+
description: 'The suppliers items are bought from.'
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
exports.inventoryScreenDefinitions = inventoryScreenDefinitions;
|
|
69
|
+
//# sourceMappingURL=inventoryScreenSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventoryScreenSet.js","sources":["../../inventoryScreenSet.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BlueprintScreen } from '@cratis/scene.model';\n\n/** One ready-to-use screen: the qualified name that is also its place in the application (`inventory.items.record` is the `record` feature of `items` in the `inventory` module). */\nexport interface InventoryScreenDefinition extends BlueprintScreen {\n template: string;\n description: string;\n}\n\n/**\n * The screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure\n * and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.\n */\nexport const inventoryScreenDefinitions: InventoryScreenDefinition[] = [\n { name: 'inventory.dashboard', title: 'Dashboard', template: 'InventoryDashboard', order: 0, description: 'Low stock, stock value, top movers and recent movements.' },\n { name: 'inventory.items', title: 'Items', template: 'InventoryItemList', order: 1, description: 'Every item with its stock, low stock highlighted.' },\n { name: 'inventory.items.gallery', title: 'Item gallery', template: 'InventoryItemGallery', parent: 'inventory.items', order: 0, description: 'Every item as a card with its picture.' },\n { name: 'inventory.items.record', title: 'Item', template: 'InventoryItemPage', parent: 'inventory.items', description: 'One item with its stock by location, movement history and supplier.' },\n { name: 'inventory.locations', title: 'Locations', template: 'InventoryLocations', order: 2, description: 'The location tree beside what is stored in the chosen location.' },\n { name: 'inventory.movements', title: 'Movements', template: 'InventoryMovementList', order: 3, description: 'Every check in, check out, transfer and adjustment.' },\n { name: 'inventory.movements.check', title: 'Check in or out', template: 'InventoryCheckInOut', parent: 'inventory.movements', description: 'Scan or search an item and check it in or out, from a phone.' },\n { name: 'inventory.suppliers', title: 'Suppliers', template: 'InventorySupplierList', order: 4, description: 'The suppliers items are bought from.' },\n];\n"],"names":["inventoryScreenDefinitions","name","title","template","order","description","parent"],"mappings":";;AAAA;AACA;AAUA;;;UAIaA,0BAAAA,GAA0D;AACnE,IAAA;QAAEC,IAAAA,EAAM,qBAAA;QAAuBC,KAAAA,EAAO,WAAA;QAAaC,QAAAA,EAAU,oBAAA;QAAsBC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAA2D,KAAA;AACrK,IAAA;QAAEJ,IAAAA,EAAM,iBAAA;QAAmBC,KAAAA,EAAO,OAAA;QAASC,Q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Set.js');
|
|
6
|
+
var index = require('./templates/index.js');
|
|
7
|
+
var formTemplates = require('./templates/formTemplates.js');
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
10
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
11
|
+
const description = 'Items, locations, movements and suppliers for a warehouse: a dashboard, item lists and cards, item pages, a location tree, stock adjustment and check in and out.';
|
|
12
|
+
/**
|
|
13
|
+
* This blueprint's declaration. A domain blueprint depends on the foundation set (`Cratis.Blueprint.Default`) and reuses its layouts, slots,
|
|
14
|
+
* components and themes - it ships none of its own - and adds what is specific to the domain: templates, a ready-to-use screen set, sample data
|
|
15
|
+
* and thumbnails. The package `version` is the blueprint's version: it is what a template reference pins and what "update available" compares.
|
|
16
|
+
*/ const inventoryBlueprintManifest = {
|
|
17
|
+
name: packageName.inventoryBlueprintName,
|
|
18
|
+
version: '1.0.0',
|
|
19
|
+
kind: scene_model.PackageKind.Blueprint,
|
|
20
|
+
dependencies: [
|
|
21
|
+
{
|
|
22
|
+
name: 'Cratis.Blueprint.Default',
|
|
23
|
+
versionRange: '^1.0.0'
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
components: [],
|
|
27
|
+
layouts: [],
|
|
28
|
+
screenTemplates: index.inventoryScreenTemplates.map((template)=>template.name),
|
|
29
|
+
dialogTemplates: formTemplates.inventoryQuickCreateDialogs.map((template)=>template.name),
|
|
30
|
+
themes: [],
|
|
31
|
+
displayName: 'Inventory and Assets',
|
|
32
|
+
description,
|
|
33
|
+
module: '@cratis/scene.blueprint.inventory',
|
|
34
|
+
license: 'MIT',
|
|
35
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',
|
|
36
|
+
sampleData: [
|
|
37
|
+
{
|
|
38
|
+
id: 'inventory-warehouse',
|
|
39
|
+
title: 'Inventory · Warehouse',
|
|
40
|
+
locale: 'en-GB',
|
|
41
|
+
path: 'sampleData/inventory-warehouse.json'
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
blueprint: {
|
|
45
|
+
domain: 'inventory',
|
|
46
|
+
description,
|
|
47
|
+
thumbnail: 'thumbnails/inventory.svg',
|
|
48
|
+
screenSet: inventoryScreenSet.inventoryScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order })=>({
|
|
49
|
+
name,
|
|
50
|
+
title,
|
|
51
|
+
description: screenDescription,
|
|
52
|
+
template,
|
|
53
|
+
...parent === undefined ? {} : {
|
|
54
|
+
parent
|
|
55
|
+
},
|
|
56
|
+
...order === undefined ? {} : {
|
|
57
|
+
order
|
|
58
|
+
}
|
|
59
|
+
})),
|
|
60
|
+
defaultSampleData: 'inventory-warehouse'
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
exports.inventoryBlueprintManifest = inventoryBlueprintManifest;
|
|
65
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sources":["../../manifest.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { inventoryBlueprintName } from './packageName';\nimport { inventoryScreenDefinitions } from './inventoryScreenSet';\nimport { inventoryDialogTemplates, inventoryScreenTemplates } from './templates';\n\nconst description = 'Items, locations, movements and suppliers for a warehouse: a dashboard, item lists and cards, item pages, a location tree, stock adjustment and check in and out.';\n\n/**\n * This blueprint's declaration. A domain blueprint depends on the foundation set (`Cratis.Blueprint.Default`) and reuses its layouts, slots,\n * components and themes - it ships none of its own - and adds what is specific to the domain: templates, a ready-to-use screen set, sample data\n * and thumbnails. The package `version` is the blueprint's version: it is what a template reference pins and what \"update available\" compares.\n */\nexport const inventoryBlueprintManifest: ScenePackage = {\n name: inventoryBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],\n components: [],\n layouts: [],\n screenTemplates: inventoryScreenTemplates.map(template => template.name),\n dialogTemplates: inventoryDialogTemplates.map(template => template.name),\n themes: [],\n displayName: 'Inventory and Assets',\n description,\n module: '@cratis/scene.blueprint.inventory',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n sampleData: [{ id: 'inventory-warehouse', title: 'Inventory · Warehouse', locale: 'en-GB', path: 'sampleData/inventory-warehouse.json' }],\n blueprint: {\n domain: 'inventory',\n description,\n thumbnail: 'thumbnails/inventory.svg',\n screenSet: inventoryScreenDefinitions.map(({ name, title, description: screenDescription, template, parent, order }) => ({\n name, title, description: screenDescription, template, ...(parent === undefined ? {} : { parent }), ...(order === undefined ? {} : { order }),\n })),\n defaultSampleData: 'inventory-warehouse',\n },\n};\n"],"names":["description","inventoryBlueprintManifest","name","inventoryBlueprintName","version","kind","PackageKind","Blueprint","dependencies","versionRange","components","layouts","screenTemplates","inventoryScreenTemplates","map","template","dialogTemplates","inventoryDialogTemplates","themes","displayName","module","license","licenseUrl","sampleData","id","title","locale","path","blueprint","domain","thumbnail","screenSet","inventoryScreenDefinitions","screenDescription","parent","order","undefined","defaultSampleData"],"mappings":";;;;;;;;AAAA;AACA;AAOA,MAAMA,WAAAA,GAAc,mKAAA;AAEpB;;;;UAKaC,0BAAAA,GAA2C;IACpDC,IAAAA,EAAMC,kCAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM,0BAAA;YAA4BO,YAAAA,EAAc;AAAS;AAAE,KAAA;AAC5EC,IAAAA,UAAAA,EAAY,EAAE;AACdC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiBC,+BAAyBC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASb,IAAI,CAAA;AACvEc,IAAAA,eAAAA,EAAiBC,0CAAyBH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASb,IAAI,CAAA;AACvEgB,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,sBAAA;AACbnB,IAAAA,WAAAA;IACAoB,MAAAA,EAAQ,mCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY,mDAAA;IACZC,UAAAA,EAAY;AAAC,QAAA;YAAEC,EAAAA,EAAI,qBAAA;YAAuBC,KAAAA,EAAO,uBAAA;YAAyBC,MAAAA,EAAQ,OAAA;YAASC,IAAAA,EAAM;AAAsC;AAAE,KAAA;IACzIC,SAAAA,EAAW;QACPC,MAAAA,EAAQ,WAAA;AACR7B,QAAAA,WAAAA;QACA8B,SAAAA,EAAW,0BAAA;AACXC,QAAAA,SAAAA,EAAWC,8CAA2BlB,GAAG,CAAC,CAAC,EAAEZ,IAAI,EAAEuB,KAAK,EAAEzB,aAAaiC,iBAAiB,EAAElB,QAAQ,EAAEmB,MAAM,EAAEC,KAAK,EAAE,IAAM;AACrHjC,gBAAAA,IAAAA;AAAMuB,gBAAAA,KAAAA;gBAAOzB,WAAAA,EAAaiC,iBAAAA;AAAmBlB,gBAAAA,QAAAA;gBAAU,GAAImB,MAAAA,KAAWE,SAAAA,GAAY,EAAC,GAAI;AAAEF,oBAAAA;iBAAQ;gBAAG,GAAIC,KAAAA,KAAUC,SAAAA,GAAY,EAAC,GAAI;AAAED,oBAAAA;;aACzI,CAAA,CAAA;QACAE,iBAAAA,EAAmB;AACvB;AACJ;;"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var inventoryScreenSet = require('./inventoryScreenSet.js');
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
/** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */ const inventoryModule = 'inventory';
|
|
9
|
+
/**
|
|
10
|
+
* The application structure the screen set implies: one module, `inventory`, a feature for each screen and the sub-features beneath it (`inventory.items.record` is the
|
|
11
|
+
* `record` feature of `items`). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.
|
|
12
|
+
*/ const inventoryStructure = (()=>{
|
|
13
|
+
const root = {
|
|
14
|
+
id: inventoryModule,
|
|
15
|
+
name: 'Inventory',
|
|
16
|
+
features: []};
|
|
17
|
+
for (const screen of inventoryScreenSet.inventoryScreenDefinitions){
|
|
18
|
+
let parent = root;
|
|
19
|
+
for (const id of screen.name.split('.').slice(1)){
|
|
20
|
+
let node = parent.features.find((candidate)=>candidate.id === id);
|
|
21
|
+
if (!node) {
|
|
22
|
+
node = {
|
|
23
|
+
id,
|
|
24
|
+
name: screen.title,
|
|
25
|
+
features: [],
|
|
26
|
+
slices: []
|
|
27
|
+
};
|
|
28
|
+
parent.features.push(node);
|
|
29
|
+
}
|
|
30
|
+
parent = node;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
modules: [
|
|
35
|
+
{
|
|
36
|
+
id: root.id,
|
|
37
|
+
name: root.name,
|
|
38
|
+
features: root.features
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
/**
|
|
44
|
+
* The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists
|
|
45
|
+
* the five places a warehouse goes: Dashboard, Items (with the table and the gallery beneath it), Locations, Movements and Suppliers.
|
|
46
|
+
*/ const inventoryNavigation = {
|
|
47
|
+
application: {
|
|
48
|
+
logo: {
|
|
49
|
+
image: '',
|
|
50
|
+
title: 'Inventory'
|
|
51
|
+
},
|
|
52
|
+
regions: [
|
|
53
|
+
{
|
|
54
|
+
region: scene_model.NavigationRegionKind.Topbar,
|
|
55
|
+
items: [
|
|
56
|
+
{
|
|
57
|
+
id: 'inventory',
|
|
58
|
+
title: 'Inventory',
|
|
59
|
+
target: {
|
|
60
|
+
module: inventoryModule
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
modules: [
|
|
68
|
+
{
|
|
69
|
+
module: inventoryModule,
|
|
70
|
+
regions: [
|
|
71
|
+
{
|
|
72
|
+
region: scene_model.NavigationRegionKind.Sidebar,
|
|
73
|
+
mode: scene_model.NavigationRegionMode.Override,
|
|
74
|
+
items: [
|
|
75
|
+
{
|
|
76
|
+
id: 'dashboard',
|
|
77
|
+
title: 'Dashboard',
|
|
78
|
+
target: {
|
|
79
|
+
module: inventoryModule,
|
|
80
|
+
feature: 'dashboard'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'items',
|
|
85
|
+
title: 'Items',
|
|
86
|
+
target: {
|
|
87
|
+
module: inventoryModule,
|
|
88
|
+
feature: 'items'
|
|
89
|
+
},
|
|
90
|
+
children: [
|
|
91
|
+
{
|
|
92
|
+
id: 'item-table',
|
|
93
|
+
title: 'Table',
|
|
94
|
+
target: {
|
|
95
|
+
module: inventoryModule,
|
|
96
|
+
feature: 'items'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 'item-gallery',
|
|
101
|
+
title: 'Gallery',
|
|
102
|
+
target: {
|
|
103
|
+
module: inventoryModule,
|
|
104
|
+
feature: 'items.gallery'
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'locations',
|
|
111
|
+
title: 'Locations',
|
|
112
|
+
target: {
|
|
113
|
+
module: inventoryModule,
|
|
114
|
+
feature: 'locations'
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: 'movements',
|
|
119
|
+
title: 'Movements',
|
|
120
|
+
target: {
|
|
121
|
+
module: inventoryModule,
|
|
122
|
+
feature: 'movements'
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 'suppliers',
|
|
127
|
+
title: 'Suppliers',
|
|
128
|
+
target: {
|
|
129
|
+
module: inventoryModule,
|
|
130
|
+
feature: 'suppliers'
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
exports.inventoryModule = inventoryModule;
|
|
141
|
+
exports.inventoryNavigation = inventoryNavigation;
|
|
142
|
+
exports.inventoryStructure = inventoryStructure;
|
|
143
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.js","sources":["../../navigation.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ApplicationStructure, NavigationModel, NavigationRegionKind, NavigationRegionMode } from '@cratis/scene.model';\nimport { inventoryScreenDefinitions } from './inventoryScreenSet';\n\n/** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */\nexport const inventoryModule = 'inventory';\n\n/**\n * The application structure the screen set implies: one module, `inventory`, a feature for each screen and the sub-features beneath it (`inventory.items.record` is the\n * `record` feature of `items`). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.\n */\nexport const inventoryStructure: ApplicationStructure = (() => {\n interface Node { id: string; name: string; features: Node[]; slices: never[] }\n const root: Node = { id: inventoryModule, name: 'Inventory', features: [], slices: [] };\n for (const screen of inventoryScreenDefinitions) {\n let parent = root;\n for (const id of screen.name.split('.').slice(1)) {\n let node = parent.features.find(candidate => candidate.id === id);\n if (!node) {\n node = { id, name: screen.title, features: [], slices: [] };\n parent.features.push(node);\n }\n parent = node;\n }\n }\n\n return { modules: [{ id: root.id, name: root.name, features: root.features }] } as unknown as ApplicationStructure;\n})();\n\n/**\n * The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists\n * the five places a warehouse goes: Dashboard, Items (with the table and the gallery beneath it), Locations, Movements and Suppliers.\n */\nexport const inventoryNavigation: NavigationModel = {\n application: {\n logo: { image: '', title: 'Inventory' },\n regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'inventory', title: 'Inventory', target: { module: inventoryModule } }] }],\n },\n modules: [{\n module: inventoryModule,\n regions: [{\n region: NavigationRegionKind.Sidebar,\n mode: NavigationRegionMode.Override,\n items: [\n { id: 'dashboard', title: 'Dashboard', target: { module: inventoryModule, feature: 'dashboard' } },\n {\n id: 'items', title: 'Items', target: { module: inventoryModule, feature: 'items' }, children: [\n { id: 'item-table', title: 'Table', target: { module: inventoryModule, feature: 'items' } },\n { id: 'item-gallery', title: 'Gallery', target: { module: inventoryModule, feature: 'items.gallery' } },\n ],\n },\n { id: 'locations', title: 'Locations', target: { module: inventoryModule, feature: 'locations' } },\n { id: 'movements', title: 'Movements', target: { module: inventoryModule, feature: 'movements' } },\n { id: 'suppliers', title: 'Suppliers', target: { module: inventoryModule, feature: 'suppliers' } },\n ],\n }],\n }],\n};\n"],"names":["inventoryModule","inventoryStructure","root","id","name","features","screen","inventoryScreenDefinitions","parent","split","slice","node","find","candidate","title","slices","push","modules","inventoryNavigation","application","logo","image","regions","region","NavigationRegionKind","Topbar","items","target","module","Sidebar","mode","NavigationRegionMode","Override","feature","children"],"mappings":";;;;;AAAA;AACA;AAKA,8GACO,MAAMA,eAAAA,GAAkB;AAE/B;;;AAGC,IACM,MAAMC,kBAAAA,GAA4C,CAAA,IAAA;AAErD,IAAA,MAAMC,IAAAA,GAAa;QAAEC,EAAAA,EAAIH,eAAAA;QAAiBI,IAAAA,EAAM,WAAA;AAAaC,QAAAA,QAAAA,EAAU,EAAe,CAAA;IACtF,KAAK,MAAMC,UAAUC,6CAAAA,CAA4B;AAC7C,QAAA,IAAIC,MAAAA,GAASN,IAAAA;QACb,KAAK,MAAMC,EAAAA,IA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;4BAAaa,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,eAAAA;gCAAiBiC,OAAAA,EAAS;AAAY;AAAE;AACpG;AACL;AAAE;AACN;AAAE;AACN;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */ const inventoryBlueprintName = 'Cratis.Blueprint.Inventory';
|
|
6
|
+
|
|
7
|
+
exports.inventoryBlueprintName = inventoryBlueprintName;
|
|
8
|
+
//# sourceMappingURL=packageName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageName.js","sources":["../../packageName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */\nexport const inventoryBlueprintName = 'Cratis.Blueprint.Inventory';\n"],"names":["inventoryBlueprintName"],"mappings":";;AAAA;AACA;AAEA,iHACO,MAAMA,sBAAAA,GAAyB;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
4
|
+
var inventoryScreenSet = require('../inventoryScreenSet.js');
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
/**
|
|
9
|
+
* The ready-to-use screens: real `Screen` instances, one for each entry of the manifest's `blueprint.screenSet`, each filling the screen template it names in
|
|
10
|
+
* the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`inventoryNavigation`).
|
|
11
|
+
*/ const inventoryScreens = inventoryScreenSet.inventoryScreenDefinitions.map((definition)=>({
|
|
12
|
+
name: definition.name,
|
|
13
|
+
layout: scene_blueprint_default.LayoutName.AppShell,
|
|
14
|
+
screenTemplate: definition.template,
|
|
15
|
+
slotContent: {},
|
|
16
|
+
forms: [],
|
|
17
|
+
contributions: [],
|
|
18
|
+
path: definition.name.split('.')
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
exports.inventoryScreens = inventoryScreens;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../screens/index.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Screen } from '@cratis/scene.model';\nimport { LayoutName } from '@cratis/scene.blueprint.default';\nimport { 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,6CAAAA,CAA2BC,GAAG,CAACC,CAAAA,cAAe;AACpFC,QAAAA,IAAAA,EAAMD,WAAWC,IAAI;AACrBC,QAAAA,MAAAA,EAAQC,mCAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBL,WAAWM,QAAQ;AACnCC,QAAAA,WAAAA,EAAa,EAAC;AACdC,QAAAA,KAAAA,EAAO,EAAE;AACTC,QAAAA,aAAAA,EAAe,EAAE;AACjBC,QAAAA,IAAAA,EAAMV,UAAAA,CAAWC,IAAI,CAACU,KAAK,CAAC,GAAA;AAChC,KAAA,CAAA;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/** The compatibility, attribution and license metadata every template this blueprint ships carries. */ const inventoryTemplateProvenance = {
|
|
6
|
+
compatibility: {
|
|
7
|
+
scene: '^4.13.0',
|
|
8
|
+
packages: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Cratis.Blueprint.Default',
|
|
11
|
+
versionRange: '^1.0.0'
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
attribution: {
|
|
16
|
+
author: 'Cratis',
|
|
17
|
+
url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.inventory'
|
|
18
|
+
},
|
|
19
|
+
license: 'MIT',
|
|
20
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.inventoryTemplateProvenance = inventoryTemplateProvenance;
|
|
24
|
+
//# sourceMappingURL=templateProvenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateProvenance.js","sources":["../../templateProvenance.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { TemplateMetadata } from '@cratis/scene.model';\n\n/** The compatibility, attribution and license metadata every template this blueprint ships carries. */\nexport const 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,92 @@
|
|
|
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 inventory dashboard (the foundation Dashboard, Operational variant): what is running low and what the stock is worth as key figures, the items
|
|
12
|
+
* 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
|
|
13
|
+
* loading, empty and error states, so one failed query leaves the others.
|
|
14
|
+
*/ const inventoryDashboardTemplate = {
|
|
15
|
+
name: 'InventoryDashboard',
|
|
16
|
+
fitsSlot: 'content',
|
|
17
|
+
slots: scene_blueprint_default.dashboardScreenTemplate.slots,
|
|
18
|
+
arrangement: scene_blueprint_default.dashboardScreenTemplate.arrangement,
|
|
19
|
+
content: {
|
|
20
|
+
header: [
|
|
21
|
+
scene_blueprint_default.component('inventory-dashboard-header', 'pageHeader', {
|
|
22
|
+
title: 'Inventory dashboard',
|
|
23
|
+
subtitle: 'Stock levels and movements this week'
|
|
24
|
+
})
|
|
25
|
+
],
|
|
26
|
+
kpis: [
|
|
27
|
+
scene_blueprint_default.component('inventory-kpi-low', 'statCard', {
|
|
28
|
+
label: 'Low stock items',
|
|
29
|
+
value: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.Kpis, '0.value'),
|
|
30
|
+
change: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.Kpis, '0.change'),
|
|
31
|
+
goodDirection: 'down',
|
|
32
|
+
comparison: 'last week',
|
|
33
|
+
...inventoryQueries.localeOfData
|
|
34
|
+
}),
|
|
35
|
+
scene_blueprint_default.component('inventory-kpi-value', 'statCard', {
|
|
36
|
+
label: 'Stock value',
|
|
37
|
+
value: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.Kpis, '1.value'),
|
|
38
|
+
change: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.Kpis, '1.change'),
|
|
39
|
+
format: 'currency',
|
|
40
|
+
fractionDigits: 0,
|
|
41
|
+
comparison: 'last week',
|
|
42
|
+
...inventoryQueries.currencyOfData
|
|
43
|
+
}),
|
|
44
|
+
scene_blueprint_default.component('inventory-kpi-movements', 'statCard', {
|
|
45
|
+
label: 'Movements this week',
|
|
46
|
+
value: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.Kpis, '2.value'),
|
|
47
|
+
change: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.Kpis, '2.change'),
|
|
48
|
+
comparison: 'last week',
|
|
49
|
+
...inventoryQueries.localeOfData
|
|
50
|
+
})
|
|
51
|
+
],
|
|
52
|
+
charts: [
|
|
53
|
+
scene_blueprint_default.component('inventory-chart-movers', 'chartWrapper', {
|
|
54
|
+
title: 'Top movers',
|
|
55
|
+
kind: 'bar',
|
|
56
|
+
categories: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.TopMovers, '0.categories'),
|
|
57
|
+
series: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.TopMovers, '0.series'),
|
|
58
|
+
...inventoryQueries.localeOfData
|
|
59
|
+
})
|
|
60
|
+
],
|
|
61
|
+
tables: [
|
|
62
|
+
scene_blueprint_default.component('inventory-dashboard-movements', 'dataList', {
|
|
63
|
+
label: 'Recent movements',
|
|
64
|
+
rows: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.RecentMovements),
|
|
65
|
+
columns: inventoryQueries.fromQuery(inventoryQueries.inventoryQueriesOf(inventoryQueries.InventoryEntityKind.Movement).columns),
|
|
66
|
+
titleField: 'item',
|
|
67
|
+
pageSize: 5,
|
|
68
|
+
...inventoryQueries.localeOfData
|
|
69
|
+
})
|
|
70
|
+
],
|
|
71
|
+
aside: [
|
|
72
|
+
scene_blueprint_default.component('inventory-dashboard-low', 'dataList', {
|
|
73
|
+
label: 'Reorder soon',
|
|
74
|
+
rows: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.LowStock),
|
|
75
|
+
columns: inventoryQueries.fromQuery(inventoryQueries.inventoryQueriesOf(inventoryQueries.InventoryEntityKind.Item).columns),
|
|
76
|
+
titleField: 'name',
|
|
77
|
+
toneField: 'tone',
|
|
78
|
+
pageSize: 5,
|
|
79
|
+
...inventoryQueries.localeOfData
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
displayName: 'Inventory dashboard',
|
|
84
|
+
description: 'Low stock count, stock value, top movers, recent movements and the items to reorder.',
|
|
85
|
+
metadata: inventoryParts.inventoryMetadata('InventoryDashboard', 'Dashboard', [
|
|
86
|
+
scene_model.TemplateScope.Module,
|
|
87
|
+
scene_model.TemplateScope.Feature
|
|
88
|
+
])
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
exports.inventoryDashboardTemplate = inventoryDashboardTemplate;
|
|
92
|
+
//# 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,gDAAwBD,KAAK;AACpCE,IAAAA,WAAAA,EAAaD,gDAAwBC,WAAW;IAChDC,OAAAA,EAAS;QACLC,MAAAA,EAAQ;AAACC,YAAAA,iCAAAA,CAAU,8BAA8B,YAAA,EAAc;gBAAEC,KAAAA,EAAO,qBAAA;gBAAuBC,QAAAA,EAAU;AAAuC,aAAA;AAAG,SAAA;QACnJC,IAAAA,EAAM;AACFH,YAAAA,iCAAAA,CAAU,qBAAqB,UAAA,EAAY;gBACvCI,KAAAA,EAAO,iBAAA;gBAAmBC,KAAAA,EAAOC,0BAAAA,CAAUC,+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,YAAAA,iCAAAA,CAAU,iCAAiC,UAAA,EAAY;gBAC5DI,KAAAA,EAAO,kBAAA;gBAAoBkB,IAAAA,EAAMhB,0BAAAA,CAAUC,gCAAegB,eAAe,CAAA;AAAGC,gBAAAA,OAAAA,EAASlB,0BAAAA,CAAUmB,mCAAAA,CAAmBC,oCAAAA,CAAoBC,QAAQ,EAAEH,OAAO,CAAA;gBAAGI,UAAAA,EAAY,MAAA;gBAAQC,QAAAA,EAAU,CAAA;AAAG,gBAAA,GAAGjB;AAClM,aAAA;AAAG,SAAA;QACHkB,KAAAA,EAAO;AAAC9B,YAAAA,iCAAAA,CAAU,2BAA2B,UAAA,EAAY;gBACrDI,KAAAA,EAAO,cAAA;gBAAgBkB,IAAAA,EAAMhB,0BAAAA,CAAUC,gCAAewB,QAAQ,CAAA;AAAGP,gBAAAA,OAAAA,EAASlB,0BAAAA,CAAUmB,mCAAAA,CAAmBC,oCAAAA,CAAoBM,IAAI,EAAER,OAAO,CAAA;gBAAGI,UAAAA,EAAY,MAAA;gBAAQK,SAAAA,EAAW,MAAA;gBAAQJ,QAAAA,EAAU,CAAA;AAAG,gBAAA,GAAGjB;AACtM,aAAA;AAAG;AACP,KAAA;IACAsB,WAAAA,EAAa,qBAAA;IACbC,WAAAA,EAAa,sFAAA;IACbC,QAAAA,EAAUC,gCAAAA,CAAkB,sBAAsB,WAAA,EAAa;AAACC,QAAAA,yBAAAA,CAAcC,MAAM;AAAED,QAAAA,yBAAAA,CAAcE;AAAQ,KAAA;AAChH;;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
* 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 -
|
|
12
|
+
* 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
|
|
13
|
+
* guard; what is particular here is that nothing is arranged side by side.
|
|
14
|
+
*/ const inventoryCheckInOutTemplate = {
|
|
15
|
+
name: 'InventoryCheckInOut',
|
|
16
|
+
fitsSlot: 'content',
|
|
17
|
+
slots: scene_blueprint_default.formScreenTemplate.slots,
|
|
18
|
+
arrangement: scene_blueprint_default.formScreenTemplate.arrangement,
|
|
19
|
+
content: {
|
|
20
|
+
header: [
|
|
21
|
+
scene_blueprint_default.component('InventoryCheckInOut-header', 'pageHeader', {
|
|
22
|
+
title: 'Check in or out',
|
|
23
|
+
subtitle: 'Scan or search for the item first'
|
|
24
|
+
})
|
|
25
|
+
],
|
|
26
|
+
body: [
|
|
27
|
+
scene_blueprint_default.component('InventoryCheckInOut-body', 'formScreenBody', {
|
|
28
|
+
mode: 'create',
|
|
29
|
+
saveAndNew: true,
|
|
30
|
+
strings: {
|
|
31
|
+
formSave: 'Record movement'
|
|
32
|
+
},
|
|
33
|
+
sections: inventoryQueries.fromQuery('CheckInOutSections'),
|
|
34
|
+
errors: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.FormErrors, '0'),
|
|
35
|
+
...inventoryQueries.currencyOfData
|
|
36
|
+
})
|
|
37
|
+
],
|
|
38
|
+
actions: []
|
|
39
|
+
},
|
|
40
|
+
displayName: 'Inventory check in and out',
|
|
41
|
+
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.',
|
|
42
|
+
metadata: inventoryParts.inventoryMetadata('InventoryCheckInOut', 'Form', [
|
|
43
|
+
scene_model.TemplateScope.Feature,
|
|
44
|
+
scene_model.TemplateScope.Subfeature
|
|
45
|
+
])
|
|
46
|
+
};
|
|
47
|
+
/** The screen templates that are forms. */ const inventoryFormTemplates = [
|
|
48
|
+
inventoryCheckInOutTemplate
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields
|
|
52
|
+
* that thing needs to get started.
|
|
53
|
+
*/ function quickCreateOf(name, title, subtitle, sections, noun, create) {
|
|
54
|
+
return {
|
|
55
|
+
name,
|
|
56
|
+
slots: scene_blueprint_default.quickCreateDialogTemplate.slots,
|
|
57
|
+
content: {
|
|
58
|
+
header: [
|
|
59
|
+
scene_blueprint_default.component(`${name}-frame`, 'dialogFrame', {
|
|
60
|
+
title,
|
|
61
|
+
subtitle
|
|
62
|
+
})
|
|
63
|
+
],
|
|
64
|
+
body: [
|
|
65
|
+
inventoryParts.withBehaviors(scene_blueprint_default.component(`${name}-form`, 'formScreenBody', {
|
|
66
|
+
mode: 'create',
|
|
67
|
+
saveAndNew: false,
|
|
68
|
+
strings: {
|
|
69
|
+
formSave: create
|
|
70
|
+
},
|
|
71
|
+
sections: inventoryQueries.fromQuery(sections),
|
|
72
|
+
errors: inventoryQueries.fromQuery(inventoryQueries.InventoryQuery.FormErrors, '0'),
|
|
73
|
+
...inventoryQueries.localeOfData
|
|
74
|
+
}), inventoryParts.closesDialog())
|
|
75
|
+
],
|
|
76
|
+
actions: []
|
|
77
|
+
},
|
|
78
|
+
displayName: `Inventory quick create ${noun}`,
|
|
79
|
+
description: `A short form that ${noun === 'stock adjustment' ? 'adjusts the stock of one item' : `creates one ${noun}`} without leaving the page.`,
|
|
80
|
+
metadata: inventoryParts.inventoryMetadata(name, 'Dialog', [
|
|
81
|
+
scene_model.TemplateScope.Slice
|
|
82
|
+
])
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Adjust stock (an item, a quantity change and a reason), and the quick creation of an item and of a supplier. */ const inventoryQuickCreateDialogs = [
|
|
86
|
+
quickCreateOf('InventoryAdjustStock', 'Adjust stock', 'Count what is on the shelf and say why it changed', 'AdjustStockSections', 'stock adjustment', 'Adjust'),
|
|
87
|
+
quickCreateOf('InventoryQuickCreateItem', 'New item', 'Only what is needed to get started', 'ItemQuickSections', 'item', 'Create'),
|
|
88
|
+
quickCreateOf('InventoryQuickCreateSupplier', 'New supplier', 'Only what is needed to get started', 'SupplierQuickSections', 'supplier', 'Create')
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
exports.inventoryCheckInOutTemplate = inventoryCheckInOutTemplate;
|
|
92
|
+
exports.inventoryFormTemplates = inventoryFormTemplates;
|
|
93
|
+
exports.inventoryQuickCreateDialogs = inventoryQuickCreateDialogs;
|
|
94
|
+
//# 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,2CAAmBD,KAAK;AAC/BE,IAAAA,WAAAA,EAAaD,2CAAmBC,WAAW;IAC3CC,OAAAA,EAAS;QACLC,MAAAA,EAAQ;AAACC,YAAAA,iCAAAA,CAAU,8BAA8B,YAAA,EAAc;gBAAEC,KAAAA,EAAO,iBAAA;gBAAmBC,QAAAA,EAAU;AAAoC,aAAA;AAAG,SAAA;QAC5IC,IAAAA,EAAM;AAACH,YAAAA,iCAAAA,CAAU,4BAA4B,gBAAA,EAAkB;gBAC3DI,IAAAA,EAAM,QAAA;gBAAUC,UAAAA,EAAY,IAAA;gBAAMC,OAAAA,EAAS;oBAAEC,QAAAA,EAAU;AAAkB,iBAAA;AAAGC,gBAAAA,QAAAA,EAAUC,0BAAAA,CAAU,oBAAA,CAAA;gBAAuBC,MAAAA,EAAQD,0BAAAA,CAAUE,+BAAAA,CAAeC,UAAU,EAAE,GAAA,CAAA;AAAM,gBAAA,GAAGC;AACjL,aAAA;AAAG,SAAA;AACHC,QAAAA,OAAAA,EAAS;AACb,KAAA;IACAC,WAAAA,EAAa,4BAAA;IACbC,WAAAA,EAAa,oHAAA;IACbC,QAAAA,EAAUC,gCAAAA,CAAkB,uBAAuB,MAAA,EAAQ;AAACC,QAAAA,yBAAAA,CAAcC,OAAO;AAAED,QAAAA,yBAAAA,CAAcE;AAAW,KAAA;AAChH;AAEA,4CACO,MAAMC,sBAAAA,GAA2C;AAAC9B,IAAAA;;AAEzD;;;AAGC,IAC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