@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
package/blueprint.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { ScenePackageBundle } from '@cratis/scene.react';
|
|
5
|
+
import { inventoryBlueprintManifest } from './manifest';
|
|
6
|
+
import { inventoryScreens } from './screens';
|
|
7
|
+
import { inventoryDialogTemplates, inventoryScreenTemplates } from './templates';
|
|
8
|
+
|
|
9
|
+
/** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */
|
|
10
|
+
export const inventoryBlueprint: ScenePackageBundle = {
|
|
11
|
+
manifest: inventoryBlueprintManifest,
|
|
12
|
+
components: {},
|
|
13
|
+
screenTemplates: inventoryScreenTemplates,
|
|
14
|
+
dialogTemplates: inventoryDialogTemplates,
|
|
15
|
+
screens: inventoryScreens,
|
|
16
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 1,
|
|
3
|
+
"blueprints": [
|
|
4
|
+
{
|
|
5
|
+
"package": "Cratis.Blueprint.Inventory",
|
|
6
|
+
"version": "1.0.0",
|
|
7
|
+
"domain": "inventory",
|
|
8
|
+
"displayName": "Inventory and Assets",
|
|
9
|
+
"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.",
|
|
10
|
+
"thumbnail": "thumbnails/inventory.svg",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"licenseUrl": "https://github.com/Cratis/Scene/blob/main/LICENSE",
|
|
13
|
+
"dependencies": [
|
|
14
|
+
{
|
|
15
|
+
"name": "Cratis.Blueprint.Default",
|
|
16
|
+
"versionRange": "^1.0.0"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"screens": [
|
|
20
|
+
{
|
|
21
|
+
"name": "inventory.dashboard",
|
|
22
|
+
"title": "Dashboard",
|
|
23
|
+
"description": "Low stock, stock value, top movers and recent movements.",
|
|
24
|
+
"template": "InventoryDashboard",
|
|
25
|
+
"order": 0
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "inventory.items",
|
|
29
|
+
"title": "Items",
|
|
30
|
+
"description": "Every item with its stock, low stock highlighted.",
|
|
31
|
+
"template": "InventoryItemList",
|
|
32
|
+
"order": 1
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "inventory.items.gallery",
|
|
36
|
+
"title": "Item gallery",
|
|
37
|
+
"description": "Every item as a card with its picture.",
|
|
38
|
+
"template": "InventoryItemGallery",
|
|
39
|
+
"parent": "inventory.items",
|
|
40
|
+
"order": 0
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "inventory.items.record",
|
|
44
|
+
"title": "Item",
|
|
45
|
+
"description": "One item with its stock by location, movement history and supplier.",
|
|
46
|
+
"template": "InventoryItemPage",
|
|
47
|
+
"parent": "inventory.items"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "inventory.locations",
|
|
51
|
+
"title": "Locations",
|
|
52
|
+
"description": "The location tree beside what is stored in the chosen location.",
|
|
53
|
+
"template": "InventoryLocations",
|
|
54
|
+
"order": 2
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "inventory.movements",
|
|
58
|
+
"title": "Movements",
|
|
59
|
+
"description": "Every check in, check out, transfer and adjustment.",
|
|
60
|
+
"template": "InventoryMovementList",
|
|
61
|
+
"order": 3
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "inventory.movements.check",
|
|
65
|
+
"title": "Check in or out",
|
|
66
|
+
"description": "Scan or search an item and check it in or out, from a phone.",
|
|
67
|
+
"template": "InventoryCheckInOut",
|
|
68
|
+
"parent": "inventory.movements"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "inventory.suppliers",
|
|
72
|
+
"title": "Suppliers",
|
|
73
|
+
"description": "The suppliers items are bought from.",
|
|
74
|
+
"template": "InventorySupplierList",
|
|
75
|
+
"order": 4
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"templates": [
|
|
79
|
+
{
|
|
80
|
+
"name": "InventoryDashboard",
|
|
81
|
+
"kind": "ScreenTemplate",
|
|
82
|
+
"displayName": "Inventory dashboard",
|
|
83
|
+
"description": "Low stock count, stock value, top movers, recent movements and the items to reorder.",
|
|
84
|
+
"type": "Dashboard",
|
|
85
|
+
"category": "Business / Inventory",
|
|
86
|
+
"thumbnail": "thumbnails/InventoryDashboard.svg"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "InventoryItemList",
|
|
90
|
+
"kind": "ScreenTemplate",
|
|
91
|
+
"displayName": "Inventory items",
|
|
92
|
+
"description": "Items with sku, category, location, quantity and status, low stock highlighted, filtered by category, location and status.",
|
|
93
|
+
"type": "List",
|
|
94
|
+
"category": "Business / Inventory",
|
|
95
|
+
"thumbnail": "thumbnails/InventoryItemList.svg"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "InventoryItemGallery",
|
|
99
|
+
"kind": "ScreenTemplate",
|
|
100
|
+
"displayName": "Inventory item gallery",
|
|
101
|
+
"description": "Items as cards with a picture, sku, quantity and status, low stock highlighted.",
|
|
102
|
+
"type": "List",
|
|
103
|
+
"category": "Business / Inventory",
|
|
104
|
+
"thumbnail": "thumbnails/InventoryItemGallery.svg"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "InventoryItemPage",
|
|
108
|
+
"kind": "ScreenTemplate",
|
|
109
|
+
"displayName": "Inventory item page",
|
|
110
|
+
"description": "One item: key facts, its fields and supplier, its stock by location and its movement history.",
|
|
111
|
+
"type": "Detail",
|
|
112
|
+
"category": "Business / Inventory",
|
|
113
|
+
"thumbnail": "thumbnails/InventoryItemPage.svg"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "InventoryLocations",
|
|
117
|
+
"kind": "ScreenTemplate",
|
|
118
|
+
"displayName": "Inventory locations",
|
|
119
|
+
"description": "The tree of locations beside what is stored in the chosen location.",
|
|
120
|
+
"type": "Workspace",
|
|
121
|
+
"category": "Business / Inventory",
|
|
122
|
+
"thumbnail": "thumbnails/InventoryLocations.svg"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "InventoryMovementList",
|
|
126
|
+
"kind": "ScreenTemplate",
|
|
127
|
+
"displayName": "Inventory movements",
|
|
128
|
+
"description": "Check ins, check outs, transfers and adjustments with the item, quantity, location and who did it.",
|
|
129
|
+
"type": "List",
|
|
130
|
+
"category": "Business / Inventory",
|
|
131
|
+
"thumbnail": "thumbnails/InventoryMovementList.svg"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "InventoryCheckInOut",
|
|
135
|
+
"kind": "ScreenTemplate",
|
|
136
|
+
"displayName": "Inventory check in and out",
|
|
137
|
+
"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.",
|
|
138
|
+
"type": "Form",
|
|
139
|
+
"category": "Business / Inventory",
|
|
140
|
+
"thumbnail": "thumbnails/InventoryCheckInOut.svg"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "InventorySupplierList",
|
|
144
|
+
"kind": "ScreenTemplate",
|
|
145
|
+
"displayName": "Inventory suppliers",
|
|
146
|
+
"description": "Suppliers with their contact, the items they supply and their status.",
|
|
147
|
+
"type": "List",
|
|
148
|
+
"category": "Business / Inventory",
|
|
149
|
+
"thumbnail": "thumbnails/InventorySupplierList.svg"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "InventoryAdjustStock",
|
|
153
|
+
"kind": "DialogTemplate",
|
|
154
|
+
"displayName": "Inventory quick create stock adjustment",
|
|
155
|
+
"description": "A short form that adjusts the stock of one item without leaving the page.",
|
|
156
|
+
"type": "Dialog",
|
|
157
|
+
"category": "Business / Inventory",
|
|
158
|
+
"thumbnail": "thumbnails/InventoryAdjustStock.svg"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "InventoryQuickCreateItem",
|
|
162
|
+
"kind": "DialogTemplate",
|
|
163
|
+
"displayName": "Inventory quick create item",
|
|
164
|
+
"description": "A short form that creates one item without leaving the page.",
|
|
165
|
+
"type": "Dialog",
|
|
166
|
+
"category": "Business / Inventory",
|
|
167
|
+
"thumbnail": "thumbnails/InventoryQuickCreateItem.svg"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"name": "InventoryQuickCreateSupplier",
|
|
171
|
+
"kind": "DialogTemplate",
|
|
172
|
+
"displayName": "Inventory quick create supplier",
|
|
173
|
+
"description": "A short form that creates one supplier without leaving the page.",
|
|
174
|
+
"type": "Dialog",
|
|
175
|
+
"category": "Business / Inventory",
|
|
176
|
+
"thumbnail": "thumbnails/InventoryQuickCreateSupplier.svg"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"sampleData": [
|
|
180
|
+
{
|
|
181
|
+
"id": "inventory-warehouse",
|
|
182
|
+
"title": "Inventory · Warehouse",
|
|
183
|
+
"locale": "en-GB",
|
|
184
|
+
"path": "sampleData/inventory-warehouse.json",
|
|
185
|
+
"default": true
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var manifest = require('./manifest.js');
|
|
4
|
+
var index = require('./screens/index.js');
|
|
5
|
+
var index$1 = require('./templates/index.js');
|
|
6
|
+
var formTemplates = require('./templates/formTemplates.js');
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
/** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */ const inventoryBlueprint = {
|
|
11
|
+
manifest: manifest.inventoryBlueprintManifest,
|
|
12
|
+
components: {},
|
|
13
|
+
screenTemplates: index$1.inventoryScreenTemplates,
|
|
14
|
+
dialogTemplates: formTemplates.inventoryQuickCreateDialogs,
|
|
15
|
+
screens: index.inventoryScreens
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.inventoryBlueprint = inventoryBlueprint;
|
|
19
|
+
//# sourceMappingURL=blueprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.js","sources":["../../blueprint.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { inventoryBlueprintManifest } from './manifest';\nimport { inventoryScreens } from './screens';\nimport { inventoryDialogTemplates, inventoryScreenTemplates } from './templates';\n\n/** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */\nexport const inventoryBlueprint: ScenePackageBundle = {\n manifest: inventoryBlueprintManifest,\n components: {},\n screenTemplates: inventoryScreenTemplates,\n dialogTemplates: inventoryDialogTemplates,\n screens: inventoryScreens,\n};\n"],"names":["inventoryBlueprint","manifest","inventoryBlueprintManifest","components","screenTemplates","inventoryScreenTemplates","dialogTemplates","inventoryDialogTemplates","screens","inventoryScreens"],"mappings":";;;;;;;AAAA;AACA;AAOA,2JACO,MAAMA,kBAAAA,GAAyC;IAClDC,QAAAA,EAAUC,mCAAAA;AACVC,IAAAA,UAAAA,EAAY,EAAC;IACbC,eAAAA,EAAiBC,gCAAAA;IACjBC,eAAAA,EAAiBC,yCAAAA;IACjBC,OAAAA,EAASC;AACb;;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var packageName = require('./packageName.js');
|
|
4
|
+
var templateProvenance = require('./templateProvenance.js');
|
|
5
|
+
var inventoryQueries = require('./inventoryQueries.js');
|
|
6
|
+
var inventoryParts = require('./inventoryParts.js');
|
|
7
|
+
var inventoryScreenSet = require('./inventoryScreenSet.js');
|
|
8
|
+
var index = require('./templates/index.js');
|
|
9
|
+
var index$1 = require('./screens/index.js');
|
|
10
|
+
var navigation = require('./navigation.js');
|
|
11
|
+
var manifest = require('./manifest.js');
|
|
12
|
+
var blueprint = require('./blueprint.js');
|
|
13
|
+
var inventoryApplication = require('./inventoryApplication.js');
|
|
14
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
15
|
+
var formTemplates = require('./templates/formTemplates.js');
|
|
16
|
+
var dashboardTemplate = require('./templates/dashboardTemplate.js');
|
|
17
|
+
var listTemplates = require('./templates/listTemplates.js');
|
|
18
|
+
var recordTemplates = require('./templates/recordTemplates.js');
|
|
19
|
+
var locationsTemplate = require('./templates/locationsTemplate.js');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
exports.inventoryBlueprintName = packageName.inventoryBlueprintName;
|
|
24
|
+
exports.inventoryTemplateProvenance = templateProvenance.inventoryTemplateProvenance;
|
|
25
|
+
exports.InventoryEntityKind = inventoryQueries.InventoryEntityKind;
|
|
26
|
+
exports.InventoryQuery = inventoryQueries.InventoryQuery;
|
|
27
|
+
exports.currencyOfData = inventoryQueries.currencyOfData;
|
|
28
|
+
exports.fromQuery = inventoryQueries.fromQuery;
|
|
29
|
+
exports.inventoryEntityPlural = inventoryQueries.inventoryEntityPlural;
|
|
30
|
+
exports.inventoryQueriesOf = inventoryQueries.inventoryQueriesOf;
|
|
31
|
+
exports.localeOfData = inventoryQueries.localeOfData;
|
|
32
|
+
exports.actionButton = inventoryParts.actionButton;
|
|
33
|
+
exports.closesDialog = inventoryParts.closesDialog;
|
|
34
|
+
exports.goesTo = inventoryParts.goesTo;
|
|
35
|
+
exports.inventoryCategory = inventoryParts.inventoryCategory;
|
|
36
|
+
exports.inventoryMetadata = inventoryParts.inventoryMetadata;
|
|
37
|
+
exports.opensDialog = inventoryParts.opensDialog;
|
|
38
|
+
exports.opensRecordOnSelect = inventoryParts.opensRecordOnSelect;
|
|
39
|
+
exports.thumbnailOf = inventoryParts.thumbnailOf;
|
|
40
|
+
exports.withBehaviors = inventoryParts.withBehaviors;
|
|
41
|
+
exports.inventoryScreenDefinitions = inventoryScreenSet.inventoryScreenDefinitions;
|
|
42
|
+
exports.inventoryScreenTemplates = index.inventoryScreenTemplates;
|
|
43
|
+
exports.inventoryScreens = index$1.inventoryScreens;
|
|
44
|
+
exports.inventoryModule = navigation.inventoryModule;
|
|
45
|
+
exports.inventoryNavigation = navigation.inventoryNavigation;
|
|
46
|
+
exports.inventoryStructure = navigation.inventoryStructure;
|
|
47
|
+
exports.inventoryBlueprintManifest = manifest.inventoryBlueprintManifest;
|
|
48
|
+
exports.inventoryBlueprint = blueprint.inventoryBlueprint;
|
|
49
|
+
exports.inventoryApplication = inventoryApplication.inventoryApplication;
|
|
50
|
+
exports.inventoryComposition = inventoryApplication.inventoryComposition;
|
|
51
|
+
exports.inventoryDefaultSampleDataId = inventoryApplication.inventoryDefaultSampleDataId;
|
|
52
|
+
exports.inventoryNavigationModel = inventoryApplication.inventoryNavigationModel;
|
|
53
|
+
Object.defineProperty(exports, "component", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return scene_blueprint_default.component; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "panel", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return scene_blueprint_default.panel; }
|
|
60
|
+
});
|
|
61
|
+
exports.inventoryCheckInOutTemplate = formTemplates.inventoryCheckInOutTemplate;
|
|
62
|
+
exports.inventoryDialogTemplates = formTemplates.inventoryQuickCreateDialogs;
|
|
63
|
+
exports.inventoryFormTemplates = formTemplates.inventoryFormTemplates;
|
|
64
|
+
exports.inventoryQuickCreateDialogs = formTemplates.inventoryQuickCreateDialogs;
|
|
65
|
+
exports.inventoryDashboardTemplate = dashboardTemplate.inventoryDashboardTemplate;
|
|
66
|
+
exports.inventoryItemGalleryTemplate = listTemplates.inventoryItemGalleryTemplate;
|
|
67
|
+
exports.inventoryItemListTemplate = listTemplates.inventoryItemListTemplate;
|
|
68
|
+
exports.inventoryMovementListTemplate = listTemplates.inventoryMovementListTemplate;
|
|
69
|
+
exports.inventorySupplierListTemplate = listTemplates.inventorySupplierListTemplate;
|
|
70
|
+
exports.inventoryItemPageTemplate = recordTemplates.inventoryItemPageTemplate;
|
|
71
|
+
exports.inventoryLocationsTemplate = locationsTemplate.inventoryLocationsTemplate;
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_engine = require('@cratis/scene.engine');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var navigation = require('./navigation.js');
|
|
6
|
+
var index = require('./screens/index.js');
|
|
7
|
+
var index$1 = require('./templates/index.js');
|
|
8
|
+
var formTemplates = require('./templates/formTemplates.js');
|
|
9
|
+
|
|
10
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
11
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
12
|
+
/** The id of the sample-data pack a new application starts with. */ const inventoryDefaultSampleDataId = 'inventory-warehouse';
|
|
13
|
+
/**
|
|
14
|
+
* The example application of the blueprint: the foundation's layouts, the Inventory and Assets templates and quick-create dialogs and its eight screens, rendering against the
|
|
15
|
+
* foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture
|
|
16
|
+
* (`Samples/Inventory/inventory.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.
|
|
17
|
+
*/ function inventoryApplication(sampleData = inventoryDefaultSampleDataId) {
|
|
18
|
+
const profile = {
|
|
19
|
+
...scene_blueprint_default.previewProfile(undefined),
|
|
20
|
+
name: 'Inventory and Assets',
|
|
21
|
+
sampleData: {
|
|
22
|
+
activePack: sampleData,
|
|
23
|
+
mappings: [],
|
|
24
|
+
bindings: []
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
layouts: scene_blueprint_default.defaultLayouts,
|
|
29
|
+
screenTemplates: index$1.inventoryScreenTemplates,
|
|
30
|
+
dialogTemplates: formTemplates.inventoryQuickCreateDialogs,
|
|
31
|
+
screens: index.inventoryScreens,
|
|
32
|
+
uiProfiles: [
|
|
33
|
+
profile
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** What a host composes the screens with: the application's logo, which the shell's topbar shows. */ const inventoryComposition = {
|
|
38
|
+
logo: navigation.inventoryNavigation.application.logo
|
|
39
|
+
};
|
|
40
|
+
/** The structure and navigation the shell's regions show and the items' destinations resolve against. */ const inventoryNavigationModel = ()=>({
|
|
41
|
+
structure: new scene_engine.ApplicationStructureIndex(navigation.inventoryStructure),
|
|
42
|
+
navigation: navigation.inventoryNavigation
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
exports.inventoryApplication = inventoryApplication;
|
|
46
|
+
exports.inventoryComposition = inventoryComposition;
|
|
47
|
+
exports.inventoryDefaultSampleDataId = inventoryDefaultSampleDataId;
|
|
48
|
+
exports.inventoryNavigationModel = inventoryNavigationModel;
|
|
49
|
+
//# sourceMappingURL=inventoryApplication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventoryApplication.js","sources":["../../inventoryApplication.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { UiProfile } from '@cratis/scene.model';\nimport { ApplicationStructureIndex } from '@cratis/scene.engine';\nimport { ApplicationDocument, CompositionOptions, defaultLayouts, previewProfile } from '@cratis/scene.blueprint.default';\nimport { inventoryNavigation, inventoryStructure } from './navigation';\nimport { inventoryScreens } from './screens';\nimport { inventoryDialogTemplates, inventoryScreenTemplates } from './templates';\n\n/** The id of the sample-data pack a new application starts with. */\nexport const inventoryDefaultSampleDataId = 'inventory-warehouse';\n\n/**\n * The example application of the blueprint: the foundation's layouts, the Inventory and Assets templates and quick-create dialogs and its eight screens, rendering against the\n * foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture\n * (`Samples/Inventory/inventory.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.\n */\nexport function inventoryApplication(sampleData: string = inventoryDefaultSampleDataId): ApplicationDocument {\n const profile: UiProfile = { ...previewProfile(undefined), name: 'Inventory and Assets', sampleData: { activePack: sampleData, mappings: [], bindings: [] } };\n return { layouts: defaultLayouts, screenTemplates: inventoryScreenTemplates, dialogTemplates: inventoryDialogTemplates, screens: inventoryScreens, uiProfiles: [profile] };\n}\n\n/** What a host composes the screens with: the application's logo, which the shell's topbar shows. */\nexport const inventoryComposition: CompositionOptions = { logo: inventoryNavigation.application.logo };\n\n/** The structure and navigation the shell's regions show and the items' destinations resolve against. */\nexport const inventoryNavigationModel = () => ({ structure: new ApplicationStructureIndex(inventoryStructure), navigation: inventoryNavigation });\n"],"names":["inventoryDefaultSampleDataId","inventoryApplication","sampleData","profile","previewProfile","undefined","name","activePack","mappings","bindings","layouts","defaultLayouts","screenTemplates","inventoryScreenTemplates","dialogTemplates","inventoryDialogTemplates","screens","inventoryScreens","uiProfiles","inventoryComposition","logo","inventoryNavigation","application","inventoryNavigationModel","structure","ApplicationStructureIndex","inventoryStructure","navigation"],"mappings":";;;;;;;;;AAAA;AACA;AASA,qEACO,MAAMA,4BAAAA,GAA+B;AAE5C;;;;AAIC,IACM,SAASC,oBAAAA,CAAqBC,UAAAA,GAAqBF,4BAA4B,EAAA;AAClF,IAAA,MAAMG,OAAAA,GAAqB;AAAE,QAAA,GAAGC,uCAAeC,SAAAA,CAAU;QAAEC,IAAAA,EAAM,sBAAA;QAAwBJ,UAAAA,EAAY;YAAEK,UAAAA,EAAYL,UAAAA;AAAYM,YAAAA,QAAAA,EAAU,EAAE;AAAEC,YAAAA,QAAAA,EAAU;AAAG;AAAE,KAAA;IAC5J,OAAO;QAAEC,OAAAA,EAASC,sCAAAA;QAAgBC,eAAAA,EAAiBC,gCAAAA;QAA0BC,eAAAA,EAAiBC,yCAAAA;QAA0BC,OAAAA,EAASC,sBAAAA;QAAkBC,UAAAA,EAAY;AAACf,YAAAA;AAAQ;AAAC,KAAA;AAC7K;AAEA,sGACO,MAAMgB,oBAAAA,GAA2C;IAAEC,IAAAA,EAAMC,8BAAAA,CAAoBC,WAAW,CAACF;AAAK;AAErG,0GACO,MAAMG,wBAAAA,GAA2B,KAAO;AAAEC,QAAAA,SAAAA,EAAW,IAAIC,sCAAAA,CAA0BC,6BAAAA,CAAAA;QAAqBC,UAAAA,EAAYN;AAAoB,KAAA;;;;;"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var templateProvenance = require('./templateProvenance.js');
|
|
6
|
+
|
|
7
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
8
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
9
|
+
/** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */ const inventoryCategory = 'Business / Inventory';
|
|
10
|
+
/** The package-relative thumbnail of a template. */ const thumbnailOf = (templateName)=>`thumbnails/${templateName}.svg`;
|
|
11
|
+
/** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */ const inventoryMetadata = (name, type, scopes)=>({
|
|
12
|
+
...templateProvenance.inventoryTemplateProvenance,
|
|
13
|
+
type,
|
|
14
|
+
category: inventoryCategory,
|
|
15
|
+
thumbnail: thumbnailOf(name),
|
|
16
|
+
scopes
|
|
17
|
+
});
|
|
18
|
+
/** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */ const actionButton = (id, label, emphasis, extra = {}, behaviors)=>({
|
|
19
|
+
...scene_blueprint_default.component(id, 'actionButton', {
|
|
20
|
+
label,
|
|
21
|
+
emphasis,
|
|
22
|
+
permission: 'enabled',
|
|
23
|
+
...extra
|
|
24
|
+
}),
|
|
25
|
+
...behaviors ? {
|
|
26
|
+
behaviors
|
|
27
|
+
} : {}
|
|
28
|
+
});
|
|
29
|
+
/** What pressing an element does: open the named dialog template over the page. */ const opensDialog = (dialogTemplate)=>[
|
|
30
|
+
{
|
|
31
|
+
bindings: [
|
|
32
|
+
{
|
|
33
|
+
trigger: {
|
|
34
|
+
kind: scene_model.InteractionTriggerKind.Click
|
|
35
|
+
},
|
|
36
|
+
actions: [
|
|
37
|
+
{
|
|
38
|
+
kind: scene_model.InteractionActionKind.OpenDialog,
|
|
39
|
+
dialogTemplate
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
/** What pressing an element does: go to the named screen. */ const goesTo = (screen)=>[
|
|
47
|
+
{
|
|
48
|
+
bindings: [
|
|
49
|
+
{
|
|
50
|
+
trigger: {
|
|
51
|
+
kind: scene_model.InteractionTriggerKind.Click
|
|
52
|
+
},
|
|
53
|
+
actions: [
|
|
54
|
+
{
|
|
55
|
+
kind: scene_model.InteractionActionKind.Navigate,
|
|
56
|
+
screen
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
/**
|
|
64
|
+
* What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is
|
|
65
|
+
* opening it - the way a table of records works everywhere.
|
|
66
|
+
*/ const opensRecordOnSelect = (listId, screen)=>[
|
|
67
|
+
{
|
|
68
|
+
bindings: [
|
|
69
|
+
{
|
|
70
|
+
trigger: {
|
|
71
|
+
kind: scene_model.InteractionTriggerKind.Select
|
|
72
|
+
},
|
|
73
|
+
actions: [
|
|
74
|
+
{
|
|
75
|
+
kind: scene_model.InteractionActionKind.Navigate,
|
|
76
|
+
screen,
|
|
77
|
+
arguments: [
|
|
78
|
+
{
|
|
79
|
+
name: 'id',
|
|
80
|
+
value: {
|
|
81
|
+
kind: scene_model.BindingSourceKind.ComponentProperty,
|
|
82
|
+
componentId: listId,
|
|
83
|
+
path: 'value'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
/** What a Cancel or Close control does: close the dialog it was opened from. */ const closesDialog = ()=>[
|
|
94
|
+
{
|
|
95
|
+
bindings: [
|
|
96
|
+
{
|
|
97
|
+
trigger: {
|
|
98
|
+
kind: scene_model.InteractionTriggerKind.Click
|
|
99
|
+
},
|
|
100
|
+
actions: [
|
|
101
|
+
{
|
|
102
|
+
kind: scene_model.InteractionActionKind.CloseDialog
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
/** An element with the given behaviors attached. */ const withBehaviors = (element, behaviors)=>({
|
|
110
|
+
...element,
|
|
111
|
+
behaviors
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
Object.defineProperty(exports, "component", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () { return scene_blueprint_default.component; }
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "panel", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () { return scene_blueprint_default.panel; }
|
|
121
|
+
});
|
|
122
|
+
exports.actionButton = actionButton;
|
|
123
|
+
exports.closesDialog = closesDialog;
|
|
124
|
+
exports.goesTo = goesTo;
|
|
125
|
+
exports.inventoryCategory = inventoryCategory;
|
|
126
|
+
exports.inventoryMetadata = inventoryMetadata;
|
|
127
|
+
exports.opensDialog = opensDialog;
|
|
128
|
+
exports.opensRecordOnSelect = opensRecordOnSelect;
|
|
129
|
+
exports.thumbnailOf = thumbnailOf;
|
|
130
|
+
exports.withBehaviors = withBehaviors;
|
|
131
|
+
//# sourceMappingURL=inventoryParts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventoryParts.js","sources":["../../inventoryParts.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n Behavior, BindingSourceKind, DialogTemplate, ExternalComponent, InteractionActionKind, InteractionTriggerKind, NavigateAction, OpenDialogAction, SceneElement, ScreenTemplate, TemplateMetadata, TemplateScope,\n} from '@cratis/scene.model';\nimport { component, panel } from '@cratis/scene.blueprint.default';\nimport { inventoryTemplateProvenance } from './templateProvenance';\n\nexport { component, panel };\n\n/** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */\nexport const inventoryCategory = 'Business / Inventory';\n\n/** The package-relative thumbnail of a template. */\nexport const thumbnailOf = (templateName: string): string => `thumbnails/${templateName}.svg`;\n\n/** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */\nexport const inventoryMetadata = (name: string, type: 'Dashboard' | 'List' | 'Board' | 'Detail' | 'Form' | 'Dialog' | 'Workspace', scopes: TemplateScope[]): TemplateMetadata =>\n ({ ...inventoryTemplateProvenance, type, category: inventoryCategory, thumbnail: thumbnailOf(name), scopes });\n\n/** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */\nexport const actionButton = (id: string, label: string, emphasis: 'primary' | 'secondary' | 'quiet' | 'danger', extra: Record<string, unknown> = {}, behaviors?: Behavior[]): ExternalComponent =>\n ({ ...component(id, 'actionButton', { label, emphasis, permission: 'enabled', ...extra }), ...(behaviors ? { behaviors } : {}) });\n\n/** What pressing an element does: open the named dialog template over the page. */\nexport const opensDialog = (dialogTemplate: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];\n\n/** What pressing an element does: go to the named screen. */\nexport const goesTo = (screen: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.Navigate, screen } as NavigateAction] }] }];\n\n/**\n * What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is\n * opening it - the way a table of records works everywhere.\n */\nexport const opensRecordOnSelect = (listId: string, screen: string): Behavior[] => [{\n bindings: [{\n trigger: { kind: InteractionTriggerKind.Select },\n actions: [{ kind: InteractionActionKind.Navigate, screen, arguments: [{ name: 'id', value: { kind: BindingSourceKind.ComponentProperty, componentId: listId, path: 'value' } }] } as NavigateAction],\n }],\n}];\n\n/** What a Cancel or Close control does: close the dialog it was opened from. */\nexport const closesDialog = (): Behavior[] => [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.CloseDialog }] }] }];\n\n/** An element with the given behaviors attached. */\nexport const withBehaviors = <T extends SceneElement>(element: T, behaviors: Behavior[]): T => ({ ...element, behaviors });\n\nexport type InventoryScreenTemplate = ScreenTemplate;\nexport type InventoryDialogTemplate = DialogTemplate;\n"],"names":["inventoryCategory","thumbnailOf","templateName","inventoryMetadata","name","type","scopes","inventoryTemplateProvenance","category","thumbnail","actionButton","id","label","emphasis","extra","behaviors","component","permission","opensDialog","dialogTemplate","bindings","trigger","kind","InteractionTriggerKind","Click","actions","InteractionActionKind","OpenDialog","goesTo","screen","Navigate","opensRecordOnSelect","listId","Select","arguments","value","BindingSourceKind","ComponentProperty","componentId","path","closesDialog","CloseDialog","withBehaviors","element"],"mappings":";;;;;;AAAA;AACA;AAUA,kGACO,MAAMA,iBAAAA,GAAoB;AAEjC,qDACO,MAAMC,WAAAA,GAAc,CAACC,YAAAA,GAAiC,CAAC,WAAW,EAAEA,YAAAA,CAAa,IAAI;AAE5F,4JACO,MAAMC,iBAAAA,GAAoB,CAACC,IAAAA,EAAcC,IAAAA,EAAmFC,UAC9H;AAAE,QAAA,GAAGC,8CAA2B;AAAEF,QAAAA,IAAAA;QAAMG,QAAAA,EAAUR,iBAAAA;AAAmBS,QAAAA,SAAAA,EAAWR,WAAAA,CAAYG,IAAAA,CAAAA;AAAOE,QAAAA;AAAO,KAAA;AAE/G,0HACO,MAAMI,YAAAA,GAAe,CAACC,EAAAA,EAAYC,KAAAA,EAAeC,QAAAA,EAAwDC,KAAAA,GAAiC,EAAE,EAAEC,aAChJ;QAAE,GAAGC,iCAAAA,CAAUL,IAAI,cAAA,EAAgB;AAAEC,YAAAA,KAAAA;AAAOC,YAAAA,QAAAA;YAAUI,UAAAA,EAAY,SAAA;AAAW,YAAA,GAAGH;SAAM,CAAE;AAAE,QAAA,GAAIC,SAAAA,GAAY;AAAEA,YAAAA;AAAU,SAAA,GAAI;AAAI,KAAA;AAEnI,oFACO,MAAMG,WAAAA,GAAc,CAACC,cAAAA,GACxB;AAAC,QAAA;YAAEC,QAAAA,EAAU;AAAC,gBAAA;oBAAEC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBC;AAAM,qBAAA;oBAAGC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBC,UAAU;AAAER,4BAAAA;AAAe;AAAsB;AAAC;AAAE;AAAC;;AAElK,8DACO,MAAMS,MAAAA,GAAS,CAACC,MAAAA,GACnB;AAAC,QAAA;YAAET,QAAAA,EAAU;AAAC,gBAAA;oBAAEC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBC;AAAM,qBAAA;oBAAGC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBI,QAAQ;AAAED,4BAAAA;AAAO;AAAoB;AAAC;AAAE;AAAC;;AAEtJ;;;AAGC,IACM,MAAME,mBAAAA,GAAsB,CAACC,QAAgBH,MAAAA,GAA+B;AAAC,QAAA;YAChFT,QAAAA,EAAU;AAAC,gBAAA;oBACPC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBU;AAAO,qBAAA;oBAC/CR,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBI,QAAQ;AAAED,4BAAAA,MAAAA;4BAAQK,SAAAA,EAAW;AAAC,gCAAA;oCAAE9B,IAAAA,EAAM,IAAA;oCAAM+B,KAAAA,EAAO;AAAEb,wCAAAA,IAAAA,EAAMc,8BAAkBC,iBAAiB;wCAAEC,WAAAA,EAAaN,MAAAA;wCAAQO,IAAAA,EAAM;AAAQ;AAAE;AAAE;AAAC;AAAoB;AACxM;AAAE;AACN;;AAEA,iFACO,MAAMC,YAAAA,GAAe,IAAkB;AAAC,QAAA;YAAEpB,QAAAA,EAAU;AAAC,gBAAA;oBAAEC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBC;AAAM,qBAAA;oBAAGC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBe;AAAY;AAAE;AAAC;AAAE;AAAC;;AAEzK,qDACO,MAAMC,gBAAgB,CAAyBC,OAAAA,EAAY5B,aAA8B;AAAE,QAAA,GAAG4B,OAAO;AAAE5B,QAAAA;AAAU,KAAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* A property taken from a query result - never a value. An Inventory template declares *where* its data comes from and the sample-data pack, or the real
|
|
9
|
+
* query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).
|
|
10
|
+
*/ const fromQuery = (query, path = '')=>({
|
|
11
|
+
kind: scene_model.BindingSourceKind.QueryResult,
|
|
12
|
+
query,
|
|
13
|
+
path
|
|
14
|
+
});
|
|
15
|
+
/** The queries of the dashboard, the pages and the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */ const InventoryQuery = {
|
|
16
|
+
/** One row: the `locale` the figures and dates are formatted in and the `currency` of the amounts. */ Settings: 'InventorySettings',
|
|
17
|
+
Kpis: 'InventoryKpis',
|
|
18
|
+
TopMovers: 'InventoryTopMovers',
|
|
19
|
+
LowStock: 'InventoryLowStock',
|
|
20
|
+
RecentMovements: 'RecentMovements',
|
|
21
|
+
RecordTabs: 'InventoryRecordTabs',
|
|
22
|
+
LocationNodes: 'LocationNodes',
|
|
23
|
+
LocationContents: 'LocationContents',
|
|
24
|
+
LocationContentColumns: 'LocationContentColumns',
|
|
25
|
+
FormErrors: 'InventoryFormErrors'
|
|
26
|
+
};
|
|
27
|
+
/** The Inventory entities a template is made for. */ var InventoryEntityKind = /*#__PURE__*/ function(InventoryEntityKind) {
|
|
28
|
+
InventoryEntityKind["Item"] = "Item";
|
|
29
|
+
InventoryEntityKind["Movement"] = "Movement";
|
|
30
|
+
InventoryEntityKind["Supplier"] = "Supplier";
|
|
31
|
+
return InventoryEntityKind;
|
|
32
|
+
}({});
|
|
33
|
+
/** The plural of each entity: the read model (and so the shape) its records are queried from. */ const inventoryEntityPlural = {
|
|
34
|
+
["Item"]: 'Items',
|
|
35
|
+
["Movement"]: 'Movements',
|
|
36
|
+
["Supplier"]: 'Suppliers'
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the
|
|
40
|
+
* list, its saved views and column choices, the selection, the sections of the full and the quick form, and the record the page shows.
|
|
41
|
+
*/ const inventoryQueriesOf = (entity)=>({
|
|
42
|
+
rows: inventoryEntityPlural[entity],
|
|
43
|
+
columns: `${entity}Columns`,
|
|
44
|
+
filterFields: `${entity}FilterFields`,
|
|
45
|
+
views: `${entity}Views`,
|
|
46
|
+
columnChoices: `${entity}ColumnChoices`,
|
|
47
|
+
selection: `${entity}Selection`,
|
|
48
|
+
sections: `${entity}Sections`,
|
|
49
|
+
quickSections: `${entity}QuickSections`,
|
|
50
|
+
record: `${entity}Record`,
|
|
51
|
+
summary: `${entity}Summary`,
|
|
52
|
+
stockByLocation: `${entity}StockByLocation`,
|
|
53
|
+
movements: `${entity}Movements`,
|
|
54
|
+
activity: `${entity}Activity`,
|
|
55
|
+
tasks: `${entity}Tasks`
|
|
56
|
+
});
|
|
57
|
+
/** The locale and currency of the data, bound onto every component that formats a figure or a date. */ const localeOfData = {
|
|
58
|
+
locale: fromQuery(InventoryQuery.Settings, '0.locale')
|
|
59
|
+
};
|
|
60
|
+
const currencyOfData = {
|
|
61
|
+
...localeOfData,
|
|
62
|
+
currency: fromQuery(InventoryQuery.Settings, '0.currency')
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
exports.InventoryEntityKind = InventoryEntityKind;
|
|
66
|
+
exports.InventoryQuery = InventoryQuery;
|
|
67
|
+
exports.currencyOfData = currencyOfData;
|
|
68
|
+
exports.fromQuery = fromQuery;
|
|
69
|
+
exports.inventoryEntityPlural = inventoryEntityPlural;
|
|
70
|
+
exports.inventoryQueriesOf = inventoryQueriesOf;
|
|
71
|
+
exports.localeOfData = localeOfData;
|
|
72
|
+
//# sourceMappingURL=inventoryQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventoryQueries.js","sources":["../../inventoryQueries.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BindingExpression, BindingSourceKind } from '@cratis/scene.model';\n\n/**\n * A property taken from a query result - never a value. An Inventory template declares *where* its data comes from and the sample-data pack, or the real\n * query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).\n */\nexport const fromQuery = (query: string, path = ''): BindingExpression => ({ kind: BindingSourceKind.QueryResult, query, path });\n\n/** The queries of the dashboard, the pages and the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */\nexport const InventoryQuery = {\n /** One row: the `locale` the figures and dates are formatted in and the `currency` of the amounts. */\n Settings: 'InventorySettings',\n Kpis: 'InventoryKpis',\n TopMovers: 'InventoryTopMovers',\n LowStock: 'InventoryLowStock',\n RecentMovements: 'RecentMovements',\n RecordTabs: 'InventoryRecordTabs',\n LocationNodes: 'LocationNodes',\n LocationContents: 'LocationContents',\n LocationContentColumns: 'LocationContentColumns',\n FormErrors: 'InventoryFormErrors',\n} as const;\n\n/** The Inventory entities a template is made for. */\nexport enum InventoryEntityKind {\n Item = 'Item',\n Movement = 'Movement',\n Supplier = 'Supplier',\n}\n\n/** The plural of each entity: the read model (and so the shape) its records are queried from. */\nexport const inventoryEntityPlural: Record<InventoryEntityKind, string> = {\n [InventoryEntityKind.Item]: 'Items',\n [InventoryEntityKind.Movement]: 'Movements',\n [InventoryEntityKind.Supplier]: 'Suppliers',\n};\n\n/**\n * The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the\n * list, its saved views and column choices, the selection, the sections of the full and the quick form, and the record the page shows.\n */\nexport const inventoryQueriesOf = (entity: InventoryEntityKind) => ({\n rows: inventoryEntityPlural[entity],\n columns: `${entity}Columns`,\n filterFields: `${entity}FilterFields`,\n views: `${entity}Views`,\n columnChoices: `${entity}ColumnChoices`,\n selection: `${entity}Selection`,\n sections: `${entity}Sections`,\n quickSections: `${entity}QuickSections`,\n record: `${entity}Record`,\n summary: `${entity}Summary`,\n stockByLocation: `${entity}StockByLocation`,\n movements: `${entity}Movements`,\n activity: `${entity}Activity`,\n tasks: `${entity}Tasks`,\n});\n\n/** The locale and currency of the data, bound onto every component that formats a figure or a date. */\nexport const localeOfData = { locale: fromQuery(InventoryQuery.Settings, '0.locale') };\nexport const currencyOfData = { ...localeOfData, currency: fromQuery(InventoryQuery.Settings, '0.currency') };\n"],"names":["fromQuery","query","path","kind","BindingSourceKind","QueryResult","InventoryQuery","Settings","Kpis","TopMovers","LowStock","RecentMovements","RecordTabs","LocationNodes","LocationContents","LocationContentColumns","FormErrors","InventoryEntityKind","inventoryEntityPlural","inventoryQueriesOf","entity","rows","columns","filterFields","views","columnChoices","selection","sections","quickSections","record","summary","stockByLocation","movements","activity","tasks","localeOfData","locale","currencyOfData","currency"],"mappings":";;;;AAAA;AACA;AAIA;;;UAIaA,SAAAA,GAAY,CAACC,OAAeC,IAAAA,GAAO,EAAE,IAAyB;AAAEC,QAAAA,IAAAA,EAAMC,8BAAkBC,WAAW;AAAEJ,QAAAA,KAAAA;AAAOC,QAAAA;AAAK,KAAA;AAE9H,kJACO,MAAMI,cAAAA,GAAiB;AAC1B,2GACAC,QAAAA,EAAU,mBAAA;IACVC,IAAAA,EAAM,eAAA;IACNC,SAAAA,EAAW,oBAAA;IACXC,QAAAA,EAAU,mBAAA;IACVC,eAAAA,EAAiB,iBAAA;IACjBC,UAAAA,EAAY,qBAAA;IACZC,aAAAA,EAAe,eAAA;IACfC,gBAAAA,EAAkB,kBAAA;IAClBC,sBAAAA,EAAwB,wBAAA;IACxBC,UAAAA,EAAY;AAChB;AAEA,sDACO,IAAKC,mBAAAA,iBAAAA,SAAAA,mBAAAA,EAAAA;;;;AAAAA,IAAAA,OAAAA,mBAAAA;AAIX,CAAA,CAAA,EAAA;AAED,kGACO,MAAMC,qBAAAA,GAA6D;AACtE,IAAA,CAAA,MAAA,GAA4B,OAAA;AAC5B,IAAA,CAAA,UAAA,GAAgC,WAAA;AAChC,IAAA,CAAA,UAAA,GAAgC;AACpC;AAEA;;;AAGC,IACM,MAAMC,kBAAAA,GAAqB,CAACC,UAAiC;QAChEC,IAAAA,EAAMH,qBAAqB,CAACE,MAAAA,CAAO;QACnCE,OAAAA,EAAS,CAAA,EAAGF,MAAAA,CAAO,OAAO,CAAC;QAC3BG,YAAAA,EAAc,CAAA,EAAGH,MAAAA,CAAO,YAAY,CAAC;QACrCI,KAAAA,EAAO,CAAA,EAAGJ,MAAAA,CAAO,KAAK,CAAC;QACvBK,aAAAA,EAAe,CAAA,EAAGL,MAAAA,CAAO,aAAa,CAAC;QACvCM,SAAAA,EAAW,CAAA,EAAGN,MAAAA,CAAO,SAAS,CAAC;QAC/BO,QAAAA,EAAU,CAAA,EAAGP,MAAAA,CAAO,QAAQ,CAAC;QAC7BQ,aAAAA,EAAe,CAAA,EAAGR,MAAAA,CAAO,aAAa,CAAC;QACvCS,MAAAA,EAAQ,CAAA,EAAGT,MAAAA,CAAO,MAAM,CAAC;QACzBU,OAAAA,EAAS,CAAA,EAAGV,MAAAA,CAAO,OAAO,CAAC;QAC3BW,eAAAA,EAAiB,CAAA,EAAGX,MAAAA,CAAO,eAAe,CAAC;QAC3CY,SAAAA,EAAW,CAAA,EAAGZ,MAAAA,CAAO,SAAS,CAAC;QAC/Ba,QAAAA,EAAU,CAAA,EAAGb,MAAAA,CAAO,QAAQ,CAAC;QAC7Bc,KAAAA,EAAO,CAAA,EAAGd,MAAAA,CAAO,KAAK;AAC1B,KAAA;AAEA,wGACO,MAAMe,YAAAA,GAAe;IAAEC,MAAAA,EAAQpC,SAAAA,CAAUM,cAAAA,CAAeC,QAAQ,EAAE,UAAA;AAAY;MACxE8B,cAAAA,GAAiB;AAAE,IAAA,GAAGF,YAAY;IAAEG,QAAAA,EAAUtC,SAAAA,CAAUM,cAAAA,CAAeC,QAAQ,EAAE,YAAA;AAAc;;;;;;;;"}
|