@cratis/scene.blueprint.inventory 0.0.0-stage → 4.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +66 -2
  2. package/blueprint.ts +16 -0
  3. package/blueprintCatalog.json +190 -0
  4. package/dist/cjs/blueprint.js +19 -0
  5. package/dist/cjs/blueprint.js.map +1 -0
  6. package/dist/cjs/index.js +72 -0
  7. package/dist/cjs/index.js.map +1 -0
  8. package/dist/cjs/inventoryApplication.js +49 -0
  9. package/dist/cjs/inventoryApplication.js.map +1 -0
  10. package/dist/cjs/inventoryParts.js +131 -0
  11. package/dist/cjs/inventoryParts.js.map +1 -0
  12. package/dist/cjs/inventoryQueries.js +72 -0
  13. package/dist/cjs/inventoryQueries.js.map +1 -0
  14. package/dist/cjs/inventoryScreenSet.js +69 -0
  15. package/dist/cjs/inventoryScreenSet.js.map +1 -0
  16. package/dist/cjs/manifest.js +65 -0
  17. package/dist/cjs/manifest.js.map +1 -0
  18. package/dist/cjs/navigation.js +143 -0
  19. package/dist/cjs/navigation.js.map +1 -0
  20. package/dist/cjs/package.json +3 -0
  21. package/dist/cjs/packageName.js +8 -0
  22. package/dist/cjs/packageName.js.map +1 -0
  23. package/dist/cjs/screens/index.js +22 -0
  24. package/dist/cjs/screens/index.js.map +1 -0
  25. package/dist/cjs/templateProvenance.js +24 -0
  26. package/dist/cjs/templateProvenance.js.map +1 -0
  27. package/dist/cjs/templates/dashboardTemplate.js +92 -0
  28. package/dist/cjs/templates/dashboardTemplate.js.map +1 -0
  29. package/dist/cjs/templates/formTemplates.js +94 -0
  30. package/dist/cjs/templates/formTemplates.js.map +1 -0
  31. package/dist/cjs/templates/index.js +34 -0
  32. package/dist/cjs/templates/index.js.map +1 -0
  33. package/dist/cjs/templates/listTemplates.js +212 -0
  34. package/dist/cjs/templates/listTemplates.js.map +1 -0
  35. package/dist/cjs/templates/locationsTemplate.js +63 -0
  36. package/dist/cjs/templates/locationsTemplate.js.map +1 -0
  37. package/dist/cjs/templates/recordTemplates.js +111 -0
  38. package/dist/cjs/templates/recordTemplates.js.map +1 -0
  39. package/dist/esm/blueprint.d.ts +3 -0
  40. package/dist/esm/blueprint.d.ts.map +1 -0
  41. package/dist/esm/blueprint.js +17 -0
  42. package/dist/esm/blueprint.js.map +1 -0
  43. package/dist/esm/index.d.ts +12 -0
  44. package/dist/esm/index.d.ts.map +1 -0
  45. package/dist/esm/index.js +18 -0
  46. package/dist/esm/index.js.map +1 -0
  47. package/dist/esm/inventoryApplication.d.ts +10 -0
  48. package/dist/esm/inventoryApplication.d.ts.map +1 -0
  49. package/dist/esm/inventoryApplication.js +44 -0
  50. package/dist/esm/inventoryApplication.js.map +1 -0
  51. package/dist/esm/inventoryParts.d.ts +15 -0
  52. package/dist/esm/inventoryParts.d.ts.map +1 -0
  53. package/dist/esm/inventoryParts.js +114 -0
  54. package/dist/esm/inventoryParts.js.map +1 -0
  55. package/dist/esm/inventoryQueries.d.ts +44 -0
  56. package/dist/esm/inventoryQueries.d.ts.map +1 -0
  57. package/dist/esm/inventoryQueries.js +64 -0
  58. package/dist/esm/inventoryQueries.js.map +1 -0
  59. package/dist/esm/inventoryScreenSet.d.ts +7 -0
  60. package/dist/esm/inventoryScreenSet.d.ts.map +1 -0
  61. package/dist/esm/inventoryScreenSet.js +67 -0
  62. package/dist/esm/inventoryScreenSet.js.map +1 -0
  63. package/dist/esm/manifest.d.ts +3 -0
  64. package/dist/esm/manifest.d.ts.map +1 -0
  65. package/dist/esm/manifest.js +63 -0
  66. package/dist/esm/manifest.js.map +1 -0
  67. package/dist/esm/navigation.d.ts +5 -0
  68. package/dist/esm/navigation.d.ts.map +1 -0
  69. package/dist/esm/navigation.js +139 -0
  70. package/dist/esm/navigation.js.map +1 -0
  71. package/dist/esm/package.json +3 -0
  72. package/dist/esm/packageName.d.ts +2 -0
  73. package/dist/esm/packageName.d.ts.map +1 -0
  74. package/dist/esm/packageName.js +6 -0
  75. package/dist/esm/packageName.js.map +1 -0
  76. package/dist/esm/screens/index.d.ts +3 -0
  77. package/dist/esm/screens/index.d.ts.map +1 -0
  78. package/dist/esm/screens/index.js +20 -0
  79. package/dist/esm/screens/index.js.map +1 -0
  80. package/dist/esm/templateProvenance.d.ts +3 -0
  81. package/dist/esm/templateProvenance.d.ts.map +1 -0
  82. package/dist/esm/templateProvenance.js +22 -0
  83. package/dist/esm/templateProvenance.js.map +1 -0
  84. package/dist/esm/templates/dashboardTemplate.d.ts +3 -0
  85. package/dist/esm/templates/dashboardTemplate.d.ts.map +1 -0
  86. package/dist/esm/templates/dashboardTemplate.js +90 -0
  87. package/dist/esm/templates/dashboardTemplate.js.map +1 -0
  88. package/dist/esm/templates/formTemplates.d.ts +5 -0
  89. package/dist/esm/templates/formTemplates.d.ts.map +1 -0
  90. package/dist/esm/templates/formTemplates.js +90 -0
  91. package/dist/esm/templates/formTemplates.js.map +1 -0
  92. package/dist/esm/templates/index.d.ts +8 -0
  93. package/dist/esm/templates/index.d.ts.map +1 -0
  94. package/dist/esm/templates/index.js +22 -0
  95. package/dist/esm/templates/index.js.map +1 -0
  96. package/dist/esm/templates/listTemplates.d.ts +6 -0
  97. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  98. package/dist/esm/templates/listTemplates.js +207 -0
  99. package/dist/esm/templates/listTemplates.js.map +1 -0
  100. package/dist/esm/templates/locationsTemplate.d.ts +3 -0
  101. package/dist/esm/templates/locationsTemplate.d.ts.map +1 -0
  102. package/dist/esm/templates/locationsTemplate.js +61 -0
  103. package/dist/esm/templates/locationsTemplate.js.map +1 -0
  104. package/dist/esm/templates/recordTemplates.d.ts +3 -0
  105. package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
  106. package/dist/esm/templates/recordTemplates.js +109 -0
  107. package/dist/esm/templates/recordTemplates.js.map +1 -0
  108. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  109. package/index.ts +14 -0
  110. package/inventoryApplication.ts +28 -0
  111. package/inventoryParts.ts +52 -0
  112. package/inventoryQueries.ts +64 -0
  113. package/inventoryScreenSet.ts +25 -0
  114. package/manifest.ts +41 -0
  115. package/navigation.ts +60 -0
  116. package/package.json +78 -4
  117. package/packageName.ts +5 -0
  118. package/sampleData/inventory-warehouse.json +1770 -0
  119. package/screens/index.ts +20 -0
  120. package/templateProvenance.ts +15 -0
  121. package/templates/dashboardTemplate.ts +45 -0
  122. package/templates/formTemplates.ts +60 -0
  123. package/templates/index.ts +25 -0
  124. package/templates/listTemplates.ts +109 -0
  125. package/templates/locationsTemplate.ts +36 -0
  126. package/templates/recordTemplates.ts +45 -0
  127. package/thumbnails/InventoryAdjustStock.svg +12 -0
  128. package/thumbnails/InventoryCheckInOut.svg +17 -0
  129. package/thumbnails/InventoryDashboard.svg +14 -0
  130. package/thumbnails/InventoryItemGallery.svg +29 -0
  131. package/thumbnails/InventoryItemList.svg +13 -0
  132. package/thumbnails/InventoryItemPage.svg +18 -0
  133. package/thumbnails/InventoryLocations.svg +20 -0
  134. package/thumbnails/InventoryMovementList.svg +13 -0
  135. package/thumbnails/InventoryQuickCreateItem.svg +12 -0
  136. package/thumbnails/InventoryQuickCreateSupplier.svg +12 -0
  137. package/thumbnails/InventorySupplierList.svg +13 -0
  138. package/thumbnails/inventory.svg +14 -0
@@ -0,0 +1,139 @@
1
+ import { NavigationRegionMode, NavigationRegionKind } from '@cratis/scene.model';
2
+ import { inventoryScreenDefinitions } from './inventoryScreenSet.js';
3
+
4
+ // Copyright (c) Cratis. All rights reserved.
5
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
6
+ /** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */ const inventoryModule = 'inventory';
7
+ /**
8
+ * 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
9
+ * `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.
10
+ */ const inventoryStructure = (()=>{
11
+ const root = {
12
+ id: inventoryModule,
13
+ name: 'Inventory',
14
+ features: []};
15
+ for (const screen of inventoryScreenDefinitions){
16
+ let parent = root;
17
+ for (const id of screen.name.split('.').slice(1)){
18
+ let node = parent.features.find((candidate)=>candidate.id === id);
19
+ if (!node) {
20
+ node = {
21
+ id,
22
+ name: screen.title,
23
+ features: [],
24
+ slices: []
25
+ };
26
+ parent.features.push(node);
27
+ }
28
+ parent = node;
29
+ }
30
+ }
31
+ return {
32
+ modules: [
33
+ {
34
+ id: root.id,
35
+ name: root.name,
36
+ features: root.features
37
+ }
38
+ ]
39
+ };
40
+ })();
41
+ /**
42
+ * The navigation of the application the blueprint is: the topbar names the module, and the module's sidebar - which overrides the application's - lists
43
+ * the five places a warehouse goes: Dashboard, Items (with the table and the gallery beneath it), Locations, Movements and Suppliers.
44
+ */ const inventoryNavigation = {
45
+ application: {
46
+ logo: {
47
+ image: '',
48
+ title: 'Inventory'
49
+ },
50
+ regions: [
51
+ {
52
+ region: NavigationRegionKind.Topbar,
53
+ items: [
54
+ {
55
+ id: 'inventory',
56
+ title: 'Inventory',
57
+ target: {
58
+ module: inventoryModule
59
+ }
60
+ }
61
+ ]
62
+ }
63
+ ]
64
+ },
65
+ modules: [
66
+ {
67
+ module: inventoryModule,
68
+ regions: [
69
+ {
70
+ region: NavigationRegionKind.Sidebar,
71
+ mode: NavigationRegionMode.Override,
72
+ items: [
73
+ {
74
+ id: 'dashboard',
75
+ title: 'Dashboard',
76
+ target: {
77
+ module: inventoryModule,
78
+ feature: 'dashboard'
79
+ }
80
+ },
81
+ {
82
+ id: 'items',
83
+ title: 'Items',
84
+ target: {
85
+ module: inventoryModule,
86
+ feature: 'items'
87
+ },
88
+ children: [
89
+ {
90
+ id: 'item-table',
91
+ title: 'Table',
92
+ target: {
93
+ module: inventoryModule,
94
+ feature: 'items'
95
+ }
96
+ },
97
+ {
98
+ id: 'item-gallery',
99
+ title: 'Gallery',
100
+ target: {
101
+ module: inventoryModule,
102
+ feature: 'items.gallery'
103
+ }
104
+ }
105
+ ]
106
+ },
107
+ {
108
+ id: 'locations',
109
+ title: 'Locations',
110
+ target: {
111
+ module: inventoryModule,
112
+ feature: 'locations'
113
+ }
114
+ },
115
+ {
116
+ id: 'movements',
117
+ title: 'Movements',
118
+ target: {
119
+ module: inventoryModule,
120
+ feature: 'movements'
121
+ }
122
+ },
123
+ {
124
+ id: 'suppliers',
125
+ title: 'Suppliers',
126
+ target: {
127
+ module: inventoryModule,
128
+ feature: 'suppliers'
129
+ }
130
+ }
131
+ ]
132
+ }
133
+ ]
134
+ }
135
+ ]
136
+ };
137
+
138
+ export { inventoryModule, inventoryNavigation, inventoryStructure };
139
+ //# 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,0BAAAA,CAA4B;AAC7C,QAAA,IAAIC,MAAAA,GAASN,IAAAA;QACb,KAAK,MAAMC,EAAAA,IAAMG,MAAAA,CAAOF,IAAI,CAACK,KAAK,CAAC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AQ5B,eAAAA;gCAAiBiC,OAAAA,EAAS;AAAY;AAAE;AACpG;AACL;AAAE;AACN;AAAE;AACN;;"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,2 @@
1
+ export declare const inventoryBlueprintName = "Cratis.Blueprint.Inventory";
2
+ //# sourceMappingURL=packageName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageName.d.ts","sourceRoot":"","sources":["../../packageName.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,+BAA+B,CAAC"}
@@ -0,0 +1,6 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */ const inventoryBlueprintName = 'Cratis.Blueprint.Inventory';
4
+
5
+ export { inventoryBlueprintName };
6
+ //# sourceMappingURL=packageName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageName.js","sources":["../../packageName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** The name this blueprint is known by inside a `ui profile`; every component registry key is built from it. */\nexport const inventoryBlueprintName = 'Cratis.Blueprint.Inventory';\n"],"names":["inventoryBlueprintName"],"mappings":"AAAA;AACA;AAEA,iHACO,MAAMA,sBAAAA,GAAyB;;"}
@@ -0,0 +1,3 @@
1
+ import { Screen } from '@cratis/scene.model';
2
+ export declare const inventoryScreens: Screen[];
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../screens/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ7C,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAQlC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { LayoutName } from '@cratis/scene.blueprint.default';
2
+ import { inventoryScreenDefinitions } from '../inventoryScreenSet.js';
3
+
4
+ // Copyright (c) Cratis. All rights reserved.
5
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
6
+ /**
7
+ * The ready-to-use screens: real `Screen` instances, one for each entry of the manifest's `blueprint.screenSet`, each filling the screen template it names in
8
+ * the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`inventoryNavigation`).
9
+ */ const inventoryScreens = inventoryScreenDefinitions.map((definition)=>({
10
+ name: definition.name,
11
+ layout: LayoutName.AppShell,
12
+ screenTemplate: definition.template,
13
+ slotContent: {},
14
+ forms: [],
15
+ contributions: [],
16
+ path: definition.name.split('.')
17
+ }));
18
+
19
+ export { inventoryScreens };
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../screens/index.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Screen } from '@cratis/scene.model';\nimport { LayoutName } from '@cratis/scene.blueprint.default';\nimport { inventoryScreenDefinitions } from '../inventoryScreenSet';\n\n/**\n * The ready-to-use screens: real `Screen` instances, one for each entry of the manifest's `blueprint.screenSet`, each filling the screen template it names in\n * the foundation's application shell. A new application that adopts the blueprint gets these, wired into its navigation (`inventoryNavigation`).\n */\nexport const inventoryScreens: Screen[] = inventoryScreenDefinitions.map(definition => ({\n name: definition.name,\n layout: LayoutName.AppShell,\n screenTemplate: definition.template,\n slotContent: {},\n forms: [],\n contributions: [],\n path: definition.name.split('.'),\n}));\n"],"names":["inventoryScreens","inventoryScreenDefinitions","map","definition","name","layout","LayoutName","AppShell","screenTemplate","template","slotContent","forms","contributions","path","split"],"mappings":";;;AAAA;AACA;AAMA;;;UAIaA,gBAAAA,GAA6BC,0BAAAA,CAA2BC,GAAG,CAACC,CAAAA,cAAe;AACpFC,QAAAA,IAAAA,EAAMD,WAAWC,IAAI;AACrBC,QAAAA,MAAAA,EAAQC,WAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBL,WAAWM,QAAQ;AACnCC,QAAAA,WAAAA,EAAa,EAAC;AACdC,QAAAA,KAAAA,EAAO,EAAE;AACTC,QAAAA,aAAAA,EAAe,EAAE;AACjBC,QAAAA,IAAAA,EAAMV,UAAAA,CAAWC,IAAI,CAACU,KAAK,CAAC,GAAA;AAChC,KAAA,CAAA;;"}
@@ -0,0 +1,3 @@
1
+ import { TemplateMetadata } from '@cratis/scene.model';
2
+ export declare const inventoryTemplateProvenance: Pick<TemplateMetadata, 'compatibility' | 'attribution' | 'license' | 'licenseUrl'>;
3
+ //# sourceMappingURL=templateProvenance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templateProvenance.d.ts","sourceRoot":"","sources":["../../templateProvenance.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,eAAO,MAAM,2BAA2B,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAQ1H,CAAC"}
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /** The compatibility, attribution and license metadata every template this blueprint ships carries. */ const inventoryTemplateProvenance = {
4
+ compatibility: {
5
+ scene: '^4.13.0',
6
+ packages: [
7
+ {
8
+ name: 'Cratis.Blueprint.Default',
9
+ versionRange: '^1.0.0'
10
+ }
11
+ ]
12
+ },
13
+ attribution: {
14
+ author: 'Cratis',
15
+ url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.inventory'
16
+ },
17
+ license: 'MIT',
18
+ licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
19
+ };
20
+
21
+ export { inventoryTemplateProvenance };
22
+ //# sourceMappingURL=templateProvenance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templateProvenance.js","sources":["../../templateProvenance.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { TemplateMetadata } from '@cratis/scene.model';\n\n/** The compatibility, attribution and license metadata every template this blueprint ships carries. */\nexport const inventoryTemplateProvenance: Pick<TemplateMetadata, 'compatibility' | 'attribution' | 'license' | 'licenseUrl'> = {\n compatibility: {\n scene: '^4.13.0',\n packages: [{ name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' }],\n },\n attribution: { author: 'Cratis', url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.inventory' },\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n"],"names":["inventoryTemplateProvenance","compatibility","scene","packages","name","versionRange","attribution","author","url","license","licenseUrl"],"mappings":"AAAA;AACA;AAIA,wGACO,MAAMA,2BAAAA,GAAkH;IAC3HC,aAAAA,EAAe;QACXC,KAAAA,EAAO,SAAA;QACPC,QAAAA,EAAU;AAAC,YAAA;gBAAEC,IAAAA,EAAM,0BAAA;gBAA4BC,YAAAA,EAAc;AAAS;AAAE;AAC5E,KAAA;IACAC,WAAAA,EAAa;QAAEC,MAAAA,EAAQ,QAAA;QAAUC,GAAAA,EAAK;AAAkF,KAAA;IACxHC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;;"}
@@ -0,0 +1,3 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const inventoryDashboardTemplate: ScreenTemplate;
3
+ //# sourceMappingURL=dashboardTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboardTemplate.d.ts","sourceRoot":"","sources":["../../../templates/dashboardTemplate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAUpE,eAAO,MAAM,0BAA0B,EAAE,cA+BxC,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { TemplateScope } from '@cratis/scene.model';
2
+ import { component, dashboardScreenTemplate } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, inventoryQueriesOf, InventoryQuery, currencyOfData, InventoryEntityKind } from '../inventoryQueries.js';
4
+ import { inventoryMetadata } from '../inventoryParts.js';
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /**
9
+ * The inventory dashboard (the foundation Dashboard, Operational variant): what is running low and what the stock is worth as key figures, the items
10
+ * that move most as a chart, the movements of the last days beneath, and the items to reorder beside them. Every region is its own component with its own
11
+ * loading, empty and error states, so one failed query leaves the others.
12
+ */ const inventoryDashboardTemplate = {
13
+ name: 'InventoryDashboard',
14
+ fitsSlot: 'content',
15
+ slots: dashboardScreenTemplate.slots,
16
+ arrangement: dashboardScreenTemplate.arrangement,
17
+ content: {
18
+ header: [
19
+ component('inventory-dashboard-header', 'pageHeader', {
20
+ title: 'Inventory dashboard',
21
+ subtitle: 'Stock levels and movements this week'
22
+ })
23
+ ],
24
+ kpis: [
25
+ component('inventory-kpi-low', 'statCard', {
26
+ label: 'Low stock items',
27
+ value: fromQuery(InventoryQuery.Kpis, '0.value'),
28
+ change: fromQuery(InventoryQuery.Kpis, '0.change'),
29
+ goodDirection: 'down',
30
+ comparison: 'last week',
31
+ ...localeOfData
32
+ }),
33
+ component('inventory-kpi-value', 'statCard', {
34
+ label: 'Stock value',
35
+ value: fromQuery(InventoryQuery.Kpis, '1.value'),
36
+ change: fromQuery(InventoryQuery.Kpis, '1.change'),
37
+ format: 'currency',
38
+ fractionDigits: 0,
39
+ comparison: 'last week',
40
+ ...currencyOfData
41
+ }),
42
+ component('inventory-kpi-movements', 'statCard', {
43
+ label: 'Movements this week',
44
+ value: fromQuery(InventoryQuery.Kpis, '2.value'),
45
+ change: fromQuery(InventoryQuery.Kpis, '2.change'),
46
+ comparison: 'last week',
47
+ ...localeOfData
48
+ })
49
+ ],
50
+ charts: [
51
+ component('inventory-chart-movers', 'chartWrapper', {
52
+ title: 'Top movers',
53
+ kind: 'bar',
54
+ categories: fromQuery(InventoryQuery.TopMovers, '0.categories'),
55
+ series: fromQuery(InventoryQuery.TopMovers, '0.series'),
56
+ ...localeOfData
57
+ })
58
+ ],
59
+ tables: [
60
+ component('inventory-dashboard-movements', 'dataList', {
61
+ label: 'Recent movements',
62
+ rows: fromQuery(InventoryQuery.RecentMovements),
63
+ columns: fromQuery(inventoryQueriesOf(InventoryEntityKind.Movement).columns),
64
+ titleField: 'item',
65
+ pageSize: 5,
66
+ ...localeOfData
67
+ })
68
+ ],
69
+ aside: [
70
+ component('inventory-dashboard-low', 'dataList', {
71
+ label: 'Reorder soon',
72
+ rows: fromQuery(InventoryQuery.LowStock),
73
+ columns: fromQuery(inventoryQueriesOf(InventoryEntityKind.Item).columns),
74
+ titleField: 'name',
75
+ toneField: 'tone',
76
+ pageSize: 5,
77
+ ...localeOfData
78
+ })
79
+ ]
80
+ },
81
+ displayName: 'Inventory dashboard',
82
+ description: 'Low stock count, stock value, top movers, recent movements and the items to reorder.',
83
+ metadata: inventoryMetadata('InventoryDashboard', 'Dashboard', [
84
+ TemplateScope.Module,
85
+ TemplateScope.Feature
86
+ ])
87
+ };
88
+
89
+ export { inventoryDashboardTemplate };
90
+ //# sourceMappingURL=dashboardTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboardTemplate.js","sources":["../../../templates/dashboardTemplate.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { dashboardScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { InventoryEntityKind, InventoryQuery, currencyOfData, fromQuery, inventoryQueriesOf, localeOfData } from '../inventoryQueries';\nimport { component, inventoryMetadata } from '../inventoryParts';\n\n/**\n * The inventory dashboard (the foundation Dashboard, Operational variant): what is running low and what the stock is worth as key figures, the items\n * that move most as a chart, the movements of the last days beneath, and the items to reorder beside them. Every region is its own component with its own\n * loading, empty and error states, so one failed query leaves the others.\n */\nexport const inventoryDashboardTemplate: ScreenTemplate = {\n name: 'InventoryDashboard',\n fitsSlot: 'content',\n slots: dashboardScreenTemplate.slots,\n arrangement: dashboardScreenTemplate.arrangement,\n content: {\n header: [component('inventory-dashboard-header', 'pageHeader', { title: 'Inventory dashboard', subtitle: 'Stock levels and movements this week' })],\n kpis: [\n component('inventory-kpi-low', 'statCard', {\n label: 'Low stock items', value: fromQuery(InventoryQuery.Kpis, '0.value'), change: fromQuery(InventoryQuery.Kpis, '0.change'), goodDirection: 'down', comparison: 'last week', ...localeOfData,\n }),\n component('inventory-kpi-value', 'statCard', {\n label: 'Stock value', value: fromQuery(InventoryQuery.Kpis, '1.value'), change: fromQuery(InventoryQuery.Kpis, '1.change'), format: 'currency', fractionDigits: 0, comparison: 'last week', ...currencyOfData,\n }),\n component('inventory-kpi-movements', 'statCard', {\n label: 'Movements this week', value: fromQuery(InventoryQuery.Kpis, '2.value'), change: fromQuery(InventoryQuery.Kpis, '2.change'), comparison: 'last week', ...localeOfData,\n }),\n ],\n charts: [component('inventory-chart-movers', 'chartWrapper', {\n title: 'Top movers', kind: 'bar', categories: fromQuery(InventoryQuery.TopMovers, '0.categories'), series: fromQuery(InventoryQuery.TopMovers, '0.series'), ...localeOfData,\n })],\n tables: [component('inventory-dashboard-movements', 'dataList', {\n label: 'Recent movements', rows: fromQuery(InventoryQuery.RecentMovements), columns: fromQuery(inventoryQueriesOf(InventoryEntityKind.Movement).columns), titleField: 'item', pageSize: 5, ...localeOfData,\n })],\n aside: [component('inventory-dashboard-low', 'dataList', {\n label: 'Reorder soon', rows: fromQuery(InventoryQuery.LowStock), columns: fromQuery(inventoryQueriesOf(InventoryEntityKind.Item).columns), titleField: 'name', toneField: 'tone', pageSize: 5, ...localeOfData,\n })],\n },\n displayName: 'Inventory dashboard',\n description: 'Low stock count, stock value, top movers, recent movements and the items to reorder.',\n metadata: inventoryMetadata('InventoryDashboard', 'Dashboard', [TemplateScope.Module, TemplateScope.Feature]),\n};\n"],"names":["inventoryDashboardTemplate","name","fitsSlot","slots","dashboardScreenTemplate","arrangement","content","header","component","title","subtitle","kpis","label","value","fromQuery","InventoryQuery","Kpis","change","goodDirection","comparison","localeOfData","format","fractionDigits","currencyOfData","charts","kind","categories","TopMovers","series","tables","rows","RecentMovements","columns","inventoryQueriesOf","InventoryEntityKind","Movement","titleField","pageSize","aside","LowStock","Item","toneField","displayName","description","metadata","inventoryMetadata","TemplateScope","Module","Feature"],"mappings":";;;;;AAAA;AACA;AAOA;;;;UAKaA,0BAAAA,GAA6C;IACtDC,IAAAA,EAAM,oBAAA;IACNC,QAAAA,EAAU,SAAA;AACVC,IAAAA,KAAAA,EAAOC,wBAAwBD,KAAK;AACpCE,IAAAA,WAAAA,EAAaD,wBAAwBC,WAAW;IAChDC,OAAAA,EAAS;QACLC,MAAAA,EAAQ;AAACC,YAAAA,SAAAA,CAAU,8BAA8B,YAAA,EAAc;gBAAEC,KAAAA,EAAO,qBAAA;gBAAuBC,QAAAA,EAAU;AAAuC,aAAA;AAAG,SAAA;QACnJC,IAAAA,EAAM;AACFH,YAAAA,SAAAA,CAAU,qBAAqB,UAAA,EAAY;gBACvCI,KAAAA,EAAO,iBAAA;gBAAmBC,KAAAA,EAAOC,SAAAA,CAAUC,cAAAA,CAAeC,IAAI,EAAE,SAAA,CAAA;gBAAYC,MAAAA,EAAQH,SAAAA,CAAUC,cAAAA,CAAeC,IAAI,EAAE,UAAA,CAAA;gBAAaE,aAAAA,EAAe,MAAA;gBAAQC,UAAAA,EAAY,WAAA;AAAa,gBAAA,GAAGC;AACvL,aAAA,CAAA;AACAZ,YAAAA,SAAAA,CAAU,uBAAuB,UAAA,EAAY;gBACzCI,KAAAA,EAAO,aAAA;gBAAeC,KAAAA,EAAOC,SAAAA,CAAUC,cAAAA,CAAeC,IAAI,EAAE,SAAA,CAAA;gBAAYC,MAAAA,EAA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AA,EAAY;gBACrDI,KAAAA,EAAO,cAAA;gBAAgBkB,IAAAA,EAAMhB,SAAAA,CAAUC,eAAewB,QAAQ,CAAA;AAAGP,gBAAAA,OAAAA,EAASlB,SAAAA,CAAUmB,kBAAAA,CAAmBC,mBAAAA,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,iBAAAA,CAAkB,sBAAsB,WAAA,EAAa;AAACC,QAAAA,aAAAA,CAAcC,MAAM;AAAED,QAAAA,aAAAA,CAAcE;AAAQ,KAAA;AAChH;;"}
@@ -0,0 +1,5 @@
1
+ import { DialogTemplate, ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const inventoryCheckInOutTemplate: ScreenTemplate;
3
+ export declare const inventoryFormTemplates: ScreenTemplate[];
4
+ export declare const inventoryQuickCreateDialogs: DialogTemplate[];
5
+ //# sourceMappingURL=formTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formTemplates.d.ts","sourceRoot":"","sources":["../../../templates/formTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAUpF,eAAO,MAAM,2BAA2B,EAAE,cAezC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAAkC,CAAC;AAwBtF,eAAO,MAAM,2BAA2B,EAAE,cAAc,EAIvD,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { TemplateScope } from '@cratis/scene.model';
2
+ import { component, formScreenTemplate, quickCreateDialogTemplate } from '@cratis/scene.blueprint.default';
3
+ import { currencyOfData, fromQuery, InventoryQuery, localeOfData } from '../inventoryQueries.js';
4
+ import { inventoryMetadata, withBehaviors, closesDialog } from '../inventoryParts.js';
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /**
9
+ * Check in or out, made for a phone held in one hand beside a shelf: one column of large fields, the item first - scanned or searched for in the same field -
10
+ * then the direction, how many, who has it and when it is due back. The foundation `FormScreen` supplies the sections, validation, Save and the unsaved-changes
11
+ * guard; what is particular here is that nothing is arranged side by side.
12
+ */ const inventoryCheckInOutTemplate = {
13
+ name: 'InventoryCheckInOut',
14
+ fitsSlot: 'content',
15
+ slots: formScreenTemplate.slots,
16
+ arrangement: formScreenTemplate.arrangement,
17
+ content: {
18
+ header: [
19
+ component('InventoryCheckInOut-header', 'pageHeader', {
20
+ title: 'Check in or out',
21
+ subtitle: 'Scan or search for the item first'
22
+ })
23
+ ],
24
+ body: [
25
+ component('InventoryCheckInOut-body', 'formScreenBody', {
26
+ mode: 'create',
27
+ saveAndNew: true,
28
+ strings: {
29
+ formSave: 'Record movement'
30
+ },
31
+ sections: fromQuery('CheckInOutSections'),
32
+ errors: fromQuery(InventoryQuery.FormErrors, '0'),
33
+ ...currencyOfData
34
+ })
35
+ ],
36
+ actions: []
37
+ },
38
+ displayName: 'Inventory check in and out',
39
+ description: 'A mobile-first form to scan or search for an item and check it in or out, with who has it and when it is due back.',
40
+ metadata: inventoryMetadata('InventoryCheckInOut', 'Form', [
41
+ TemplateScope.Feature,
42
+ TemplateScope.Subfeature
43
+ ])
44
+ };
45
+ /** The screen templates that are forms. */ const inventoryFormTemplates = [
46
+ inventoryCheckInOutTemplate
47
+ ];
48
+ /**
49
+ * One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields
50
+ * that thing needs to get started.
51
+ */ function quickCreateOf(name, title, subtitle, sections, noun, create) {
52
+ return {
53
+ name,
54
+ slots: quickCreateDialogTemplate.slots,
55
+ content: {
56
+ header: [
57
+ component(`${name}-frame`, 'dialogFrame', {
58
+ title,
59
+ subtitle
60
+ })
61
+ ],
62
+ body: [
63
+ withBehaviors(component(`${name}-form`, 'formScreenBody', {
64
+ mode: 'create',
65
+ saveAndNew: false,
66
+ strings: {
67
+ formSave: create
68
+ },
69
+ sections: fromQuery(sections),
70
+ errors: fromQuery(InventoryQuery.FormErrors, '0'),
71
+ ...localeOfData
72
+ }), closesDialog())
73
+ ],
74
+ actions: []
75
+ },
76
+ displayName: `Inventory quick create ${noun}`,
77
+ description: `A short form that ${noun === 'stock adjustment' ? 'adjusts the stock of one item' : `creates one ${noun}`} without leaving the page.`,
78
+ metadata: inventoryMetadata(name, 'Dialog', [
79
+ TemplateScope.Slice
80
+ ])
81
+ };
82
+ }
83
+ /** Adjust stock (an item, a quantity change and a reason), and the quick creation of an item and of a supplier. */ const inventoryQuickCreateDialogs = [
84
+ quickCreateOf('InventoryAdjustStock', 'Adjust stock', 'Count what is on the shelf and say why it changed', 'AdjustStockSections', 'stock adjustment', 'Adjust'),
85
+ quickCreateOf('InventoryQuickCreateItem', 'New item', 'Only what is needed to get started', 'ItemQuickSections', 'item', 'Create'),
86
+ quickCreateOf('InventoryQuickCreateSupplier', 'New supplier', 'Only what is needed to get started', 'SupplierQuickSections', 'supplier', 'Create')
87
+ ];
88
+
89
+ export { inventoryCheckInOutTemplate, inventoryFormTemplates, inventoryQuickCreateDialogs };
90
+ //# sourceMappingURL=formTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formTemplates.js","sources":["../../../templates/formTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogTemplate, ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { formScreenTemplate, quickCreateDialogTemplate } from '@cratis/scene.blueprint.default';\nimport { InventoryQuery, currencyOfData, fromQuery, localeOfData } from '../inventoryQueries';\nimport { closesDialog, component, inventoryMetadata, withBehaviors } from '../inventoryParts';\n\n/**\n * Check in or out, made for a phone held in one hand beside a shelf: one column of large fields, the item first - scanned or searched for in the same field -\n * then the direction, how many, who has it and when it is due back. The foundation `FormScreen` supplies the sections, validation, Save and the unsaved-changes\n * guard; what is particular here is that nothing is arranged side by side.\n */\nexport const inventoryCheckInOutTemplate: ScreenTemplate = {\n name: 'InventoryCheckInOut',\n fitsSlot: 'content',\n slots: formScreenTemplate.slots,\n arrangement: formScreenTemplate.arrangement,\n content: {\n header: [component('InventoryCheckInOut-header', 'pageHeader', { title: 'Check in or out', subtitle: 'Scan or search for the item first' })],\n body: [component('InventoryCheckInOut-body', 'formScreenBody', {\n mode: 'create', saveAndNew: true, strings: { formSave: 'Record movement' }, sections: fromQuery('CheckInOutSections'), errors: fromQuery(InventoryQuery.FormErrors, '0'), ...currencyOfData,\n })],\n actions: [],\n },\n displayName: 'Inventory check in and out',\n description: 'A mobile-first form to scan or search for an item and check it in or out, with who has it and when it is due back.',\n metadata: inventoryMetadata('InventoryCheckInOut', 'Form', [TemplateScope.Feature, TemplateScope.Subfeature]),\n};\n\n/** The screen templates that are forms. */\nexport const inventoryFormTemplates: ScreenTemplate[] = [inventoryCheckInOutTemplate];\n\n/**\n * One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields\n * that thing needs to get started.\n */\nfunction quickCreateOf(name: string, title: string, subtitle: string, sections: string, noun: string, create: string): DialogTemplate {\n return {\n name,\n slots: quickCreateDialogTemplate.slots,\n content: {\n header: [component(`${name}-frame`, 'dialogFrame', { title, subtitle })],\n body: [withBehaviors(component(`${name}-form`, 'formScreenBody', {\n mode: 'create', saveAndNew: false, strings: { formSave: create }, sections: fromQuery(sections), errors: fromQuery(InventoryQuery.FormErrors, '0'), ...localeOfData,\n }), closesDialog())],\n actions: [],\n },\n displayName: `Inventory quick create ${noun}`,\n description: `A short form that ${noun === 'stock adjustment' ? 'adjusts the stock of one item' : `creates one ${noun}`} without leaving the page.`,\n metadata: inventoryMetadata(name, 'Dialog', [TemplateScope.Slice]),\n };\n}\n\n/** Adjust stock (an item, a quantity change and a reason), and the quick creation of an item and of a supplier. */\nexport const inventoryQuickCreateDialogs: DialogTemplate[] = [\n quickCreateOf('InventoryAdjustStock', 'Adjust stock', 'Count what is on the shelf and say why it changed', 'AdjustStockSections', 'stock adjustment', 'Adjust'),\n quickCreateOf('InventoryQuickCreateItem', 'New item', 'Only what is needed to get started', 'ItemQuickSections', 'item', 'Create'),\n quickCreateOf('InventoryQuickCreateSupplier', 'New supplier', 'Only what is needed to get started', 'SupplierQuickSections', 'supplier', 'Create'),\n];\n"],"names":["inventoryCheckInOutTemplate","name","fitsSlot","slots","formScreenTemplate","arrangement","content","header","component","title","subtitle","body","mode","saveAndNew","strings","formSave","sections","fromQuery","errors","InventoryQuery","FormErrors","currencyOfData","actions","displayName","description","metadata","inventoryMetadata","TemplateScope","Feature","Subfeature","inventoryFormTemplates","quickCreateOf","noun","create","quickCreateDialogTemplate","withBehaviors","localeOfData","closesDialog","Slice","inventoryQuickCreateDialogs"],"mappings":";;;;;AAAA;AACA;AAOA;;;;UAKaA,2BAAAA,GAA8C;IACvDC,IAAAA,EAAM,qBAAA;IACNC,QAAAA,EAAU,SAAA;AACVC,IAAAA,KAAAA,EAAOC,mBAAmBD,KAAK;AAC/BE,IAAAA,WAAAA,EAAaD,mBAAmBC,WAAW;IAC3CC,OAAAA,EAAS;QACLC,MAAAA,EAAQ;AAACC,YAAAA,SAAAA,CAAU,8BAA8B,YAAA,EAAc;gBAAEC,KAAAA,EAAO,iBAAA;gBAAmBC,QAAAA,EAAU;AAAoC,aAAA;AAAG,SAAA;QAC5IC,IAAAA,EAAM;AAACH,YAAAA,SAAAA,CAAU,4BAA4B,gBAAA,EAAkB;gBAC3DI,IAAAA,EAAM,QAAA;gBAAUC,UAAAA,EAAY,IAAA;gBAAMC,OAAAA,EAAS;oBAAEC,QAAAA,EAAU;AAAkB,iBAAA;AAAGC,gBAAAA,QAAAA,EAAUC,SAAAA,CAAU,oBAAA,CAAA;gBAAuBC,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f,YAAAA,OAAAA,EAAS;AACb,SAAA;QACAC,WAAAA,EAAa,CAAC,uBAAuB,EAAES,IAAAA,CAAAA,CAAM;AAC7CR,QAAAA,WAAAA,EAAa,CAAC,kBAAkB,EAAEQ,IAAAA,KAAS,kBAAA,GAAqB,+BAAA,GAAkC,CAAC,YAAY,EAAEA,IAAAA,CAAAA,CAAM,CAAC,0BAA0B,CAAC;QACnJP,QAAAA,EAAUC,iBAAAA,CAAkBzB,MAAM,QAAA,EAAU;AAAC0B,YAAAA,aAAAA,CAAcW;AAAM,SAAA;AACrE,KAAA;AACJ;AAEA,oHACO,MAAMC,2BAAAA,GAAgD;AACzDR,IAAAA,aAAAA,CAAc,sBAAA,EAAwB,cAAA,EAAgB,mDAAA,EAAqD,qBAAA,EAAuB,kBAAA,EAAoB,QAAA,CAAA;AACtJA,IAAAA,aAAAA,CAAc,0BAAA,EAA4B,UAAA,EAAY,oCAAA,EAAsC,mBAAA,EAAqB,MAAA,EAAQ,QAAA,CAAA;AACzHA,IAAAA,aAAAA,CAAc,8BAAA,EAAgC,cAAA,EAAgB,oCAAA,EAAsC,uBAAA,EAAyB,UAAA,EAAY,QAAA;;;"}
@@ -0,0 +1,8 @@
1
+ export * from './dashboardTemplate';
2
+ export * from './listTemplates';
3
+ export * from './recordTemplates';
4
+ export * from './locationsTemplate';
5
+ export * from './formTemplates';
6
+ export declare const inventoryScreenTemplates: import("@cratis/scene.model/screens").ScreenTemplate[];
7
+ export { inventoryQuickCreateDialogs as inventoryDialogTemplates } from './formTemplates';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../templates/index.ts"],"names":[],"mappings":"AASA,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAGhC,eAAO,MAAM,wBAAwB,wDAMpC,CAAC;AAEF,OAAO,EAAE,2BAA2B,IAAI,wBAAwB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { inventoryDashboardTemplate } from './dashboardTemplate.js';
2
+ import { inventoryFormTemplates } from './formTemplates.js';
3
+ export { inventoryCheckInOutTemplate, inventoryQuickCreateDialogs as inventoryDialogTemplates, inventoryQuickCreateDialogs } from './formTemplates.js';
4
+ import { inventoryItemListTemplate, inventoryItemGalleryTemplate, inventoryMovementListTemplate, inventorySupplierListTemplate } from './listTemplates.js';
5
+ import { inventoryLocationsTemplate } from './locationsTemplate.js';
6
+ import { inventoryItemPageTemplate } from './recordTemplates.js';
7
+
8
+ // Copyright (c) Cratis. All rights reserved.
9
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
10
+ /** Every screen template this blueprint provides, in the order the manifest lists them. */ const inventoryScreenTemplates = [
11
+ inventoryDashboardTemplate,
12
+ inventoryItemListTemplate,
13
+ inventoryItemGalleryTemplate,
14
+ inventoryItemPageTemplate,
15
+ inventoryLocationsTemplate,
16
+ inventoryMovementListTemplate,
17
+ ...inventoryFormTemplates,
18
+ inventorySupplierListTemplate
19
+ ];
20
+
21
+ export { inventoryDashboardTemplate, inventoryFormTemplates, inventoryItemGalleryTemplate, inventoryItemListTemplate, inventoryItemPageTemplate, inventoryLocationsTemplate, inventoryMovementListTemplate, inventoryScreenTemplates, inventorySupplierListTemplate };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../templates/index.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { inventoryDashboardTemplate } from './dashboardTemplate';\nimport { inventoryFormTemplates } from './formTemplates';\nimport { inventoryItemGalleryTemplate, inventoryItemListTemplate, inventoryMovementListTemplate, inventorySupplierListTemplate } from './listTemplates';\nimport { inventoryLocationsTemplate } from './locationsTemplate';\nimport { inventoryItemPageTemplate } from './recordTemplates';\n\nexport * from './dashboardTemplate';\nexport * from './listTemplates';\nexport * from './recordTemplates';\nexport * from './locationsTemplate';\nexport * from './formTemplates';\n\n/** Every screen template this blueprint provides, in the order the manifest lists them. */\nexport const inventoryScreenTemplates = [\n inventoryDashboardTemplate,\n inventoryItemListTemplate, inventoryItemGalleryTemplate, inventoryItemPageTemplate,\n inventoryLocationsTemplate,\n inventoryMovementListTemplate, ...inventoryFormTemplates,\n inventorySupplierListTemplate,\n];\n\nexport { inventoryQuickCreateDialogs as inventoryDialogTemplates } from './formTemplates';\n"],"names":["inventoryScreenTemplates","inventoryDashboardTemplate","inventoryItemListTemplate","inventoryItemGalleryTemplate","inventoryItemPageTemplate","inventoryLocationsTemplate","inventoryMovementListTemplate","inventoryFormTemplates","inventorySupplierListTemplate"],"mappings":";;;;;;;AAAA;AACA;AAcA,4FACO,MAAMA,wBAAAA,GAA2B;AACpCC,IAAAA,0BAAAA;AACAC,IAAAA,yBAAAA;AAA2BC,IAAAA,4BAAAA;AAA8BC,IAAAA,yBAAAA;AACzDC,IAAAA,0BAAAA;AACAC,IAAAA,6BAAAA;AAAkCC,IAAAA,GAAAA,sBAAAA;AAClCC,IAAAA;;;"}
@@ -0,0 +1,6 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const inventoryItemListTemplate: ScreenTemplate;
3
+ export declare const inventoryItemGalleryTemplate: ScreenTemplate;
4
+ export declare const inventoryMovementListTemplate: ScreenTemplate;
5
+ export declare const inventorySupplierListTemplate: ScreenTemplate;
6
+ //# sourceMappingURL=listTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTemplates.d.ts","sourceRoot":"","sources":["../../../templates/listTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkF,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAgFpJ,eAAO,MAAM,yBAAyB,gBAIpC,CAAC;AAGH,eAAO,MAAM,4BAA4B,gBAIvC,CAAC;AAGH,eAAO,MAAM,6BAA6B,gBAIxC,CAAC;AAGH,eAAO,MAAM,6BAA6B,gBAIxC,CAAC"}