@cratis/scene.blueprint.orders 0.0.0-stage → 4.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +66 -2
  2. package/blueprint.ts +16 -0
  3. package/blueprintCatalog.json +107 -0
  4. package/dist/cjs/blueprint.js +19 -0
  5. package/dist/cjs/blueprint.js.map +1 -0
  6. package/dist/cjs/index.js +68 -0
  7. package/dist/cjs/index.js.map +1 -0
  8. package/dist/cjs/manifest.js +65 -0
  9. package/dist/cjs/manifest.js.map +1 -0
  10. package/dist/cjs/navigation.js +109 -0
  11. package/dist/cjs/navigation.js.map +1 -0
  12. package/dist/cjs/ordersApplication.js +49 -0
  13. package/dist/cjs/ordersApplication.js.map +1 -0
  14. package/dist/cjs/ordersParts.js +151 -0
  15. package/dist/cjs/ordersParts.js.map +1 -0
  16. package/dist/cjs/ordersQueries.js +66 -0
  17. package/dist/cjs/ordersQueries.js.map +1 -0
  18. package/dist/cjs/ordersScreenSet.js +40 -0
  19. package/dist/cjs/ordersScreenSet.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/boardTemplate.js +60 -0
  28. package/dist/cjs/templates/boardTemplate.js.map +1 -0
  29. package/dist/cjs/templates/deliveryTemplate.js +88 -0
  30. package/dist/cjs/templates/deliveryTemplate.js.map +1 -0
  31. package/dist/cjs/templates/formTemplates.js +50 -0
  32. package/dist/cjs/templates/formTemplates.js.map +1 -0
  33. package/dist/cjs/templates/index.js +23 -0
  34. package/dist/cjs/templates/index.js.map +1 -0
  35. package/dist/cjs/templates/listTemplates.js +145 -0
  36. package/dist/cjs/templates/listTemplates.js.map +1 -0
  37. package/dist/cjs/templates/recordTemplates.js +101 -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/manifest.d.ts +3 -0
  48. package/dist/esm/manifest.d.ts.map +1 -0
  49. package/dist/esm/manifest.js +63 -0
  50. package/dist/esm/manifest.js.map +1 -0
  51. package/dist/esm/navigation.d.ts +5 -0
  52. package/dist/esm/navigation.d.ts.map +1 -0
  53. package/dist/esm/navigation.js +105 -0
  54. package/dist/esm/navigation.js.map +1 -0
  55. package/dist/esm/ordersApplication.d.ts +10 -0
  56. package/dist/esm/ordersApplication.d.ts.map +1 -0
  57. package/dist/esm/ordersApplication.js +44 -0
  58. package/dist/esm/ordersApplication.js.map +1 -0
  59. package/dist/esm/ordersParts.d.ts +16 -0
  60. package/dist/esm/ordersParts.d.ts.map +1 -0
  61. package/dist/esm/ordersParts.js +133 -0
  62. package/dist/esm/ordersParts.js.map +1 -0
  63. package/dist/esm/ordersQueries.d.ts +40 -0
  64. package/dist/esm/ordersQueries.d.ts.map +1 -0
  65. package/dist/esm/ordersQueries.js +58 -0
  66. package/dist/esm/ordersQueries.js.map +1 -0
  67. package/dist/esm/ordersScreenSet.d.ts +7 -0
  68. package/dist/esm/ordersScreenSet.d.ts.map +1 -0
  69. package/dist/esm/ordersScreenSet.js +38 -0
  70. package/dist/esm/ordersScreenSet.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/boardTemplate.d.ts +3 -0
  85. package/dist/esm/templates/boardTemplate.d.ts.map +1 -0
  86. package/dist/esm/templates/boardTemplate.js +58 -0
  87. package/dist/esm/templates/boardTemplate.js.map +1 -0
  88. package/dist/esm/templates/deliveryTemplate.d.ts +3 -0
  89. package/dist/esm/templates/deliveryTemplate.d.ts.map +1 -0
  90. package/dist/esm/templates/deliveryTemplate.js +86 -0
  91. package/dist/esm/templates/deliveryTemplate.js.map +1 -0
  92. package/dist/esm/templates/formTemplates.d.ts +3 -0
  93. package/dist/esm/templates/formTemplates.d.ts.map +1 -0
  94. package/dist/esm/templates/formTemplates.js +48 -0
  95. package/dist/esm/templates/formTemplates.js.map +1 -0
  96. package/dist/esm/templates/index.d.ts +8 -0
  97. package/dist/esm/templates/index.d.ts.map +1 -0
  98. package/dist/esm/templates/index.js +15 -0
  99. package/dist/esm/templates/index.js.map +1 -0
  100. package/dist/esm/templates/listTemplates.d.ts +3 -0
  101. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  102. package/dist/esm/templates/listTemplates.js +143 -0
  103. package/dist/esm/templates/listTemplates.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 +99 -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/manifest.ts +41 -0
  111. package/navigation.ts +53 -0
  112. package/ordersApplication.ts +28 -0
  113. package/ordersParts.ts +58 -0
  114. package/ordersQueries.ts +58 -0
  115. package/ordersScreenSet.ts +21 -0
  116. package/package.json +78 -4
  117. package/packageName.ts +5 -0
  118. package/sampleData/orders-en.json +952 -0
  119. package/screens/index.ts +20 -0
  120. package/templateProvenance.ts +15 -0
  121. package/templates/boardTemplate.ts +34 -0
  122. package/templates/deliveryTemplate.ts +31 -0
  123. package/templates/formTemplates.ts +33 -0
  124. package/templates/index.ts +15 -0
  125. package/templates/listTemplates.ts +93 -0
  126. package/templates/recordTemplates.ts +43 -0
  127. package/thumbnails/OrderPage.svg +18 -0
  128. package/thumbnails/OrdersDeliveryCalendar.svg +16 -0
  129. package/thumbnails/OrdersFulfilmentBoard.svg +23 -0
  130. package/thumbnails/OrdersList.svg +29 -0
  131. package/thumbnails/OrdersQuickCreateOrder.svg +12 -0
  132. package/thumbnails/orders.svg +14 -0
@@ -0,0 +1,86 @@
1
+ import { TemplateScope, WidthSizeClass } from '@cratis/scene.model';
2
+ import { component, column, slotLeaf, grid } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, OrdersQuery } from '../ordersQueries.js';
4
+ import { ordersMetadata, withBehaviors, goesTo, actionButton } from '../ordersParts.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 delivery calendar: the day each open order is due to arrive, on a month, a week or as an agenda (the foundation's `calendarGrid`). The status is told in
10
+ * words as well as by color, the day and view are kept in the address, and the list beside it names every order due in the period.
11
+ */ const deliveryCalendarTemplate = {
12
+ name: 'OrdersDeliveryCalendar',
13
+ fitsSlot: 'content',
14
+ slots: [
15
+ {
16
+ name: 'header'
17
+ },
18
+ {
19
+ name: 'calendar'
20
+ },
21
+ {
22
+ name: 'due'
23
+ }
24
+ ],
25
+ arrangement: {
26
+ root: column([
27
+ slotLeaf('header'),
28
+ grid([
29
+ slotLeaf('calendar', {
30
+ span: 2
31
+ }),
32
+ slotLeaf('due')
33
+ ], 3, 16)
34
+ ], 16),
35
+ overrides: [
36
+ {
37
+ width: WidthSizeClass.Compact,
38
+ root: column([
39
+ slotLeaf('header'),
40
+ slotLeaf('calendar'),
41
+ slotLeaf('due')
42
+ ], 16)
43
+ }
44
+ ]
45
+ },
46
+ content: {
47
+ header: [
48
+ component('OrdersDeliveryCalendar-header', 'pageHeader', {
49
+ title: 'Deliveries',
50
+ subtitle: 'When each order is due to arrive'
51
+ }, {
52
+ actions: [
53
+ withBehaviors(actionButton('OrdersDeliveryCalendar-orders', 'Open the orders', 'secondary'), goesTo('orders.list'))
54
+ ]
55
+ })
56
+ ],
57
+ calendar: [
58
+ component('OrdersDeliveryCalendar-grid', 'calendarGrid', {
59
+ label: 'Deliveries',
60
+ events: fromQuery(OrdersQuery.DeliveryEvents),
61
+ date: fromQuery(OrdersQuery.Settings, '0.today'),
62
+ urlKey: 'day',
63
+ ...localeOfData
64
+ })
65
+ ],
66
+ due: [
67
+ component('OrdersDeliveryCalendar-due', 'dataList', {
68
+ label: 'Due in this period',
69
+ rows: fromQuery(OrdersQuery.DeliveryEvents),
70
+ columns: fromQuery(OrdersQuery.DeliveryColumns),
71
+ titleField: 'title',
72
+ pageSize: 6,
73
+ ...localeOfData
74
+ })
75
+ ]
76
+ },
77
+ displayName: 'Orders delivery calendar',
78
+ description: 'The day each open order is due to arrive, on a month, a week or as an agenda.',
79
+ metadata: ordersMetadata('OrdersDeliveryCalendar', 'Calendar', [
80
+ TemplateScope.Module,
81
+ TemplateScope.Feature
82
+ ])
83
+ };
84
+
85
+ export { deliveryCalendarTemplate };
86
+ //# sourceMappingURL=deliveryTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliveryTemplate.js","sources":["../../../templates/deliveryTemplate.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, WidthSizeClass } from '@cratis/scene.model';\nimport { column, grid, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { OrdersQuery, fromQuery, localeOfData } from '../ordersQueries';\nimport { actionButton, component, goesTo, ordersMetadata, withBehaviors } from '../ordersParts';\n\n/**\n * The delivery calendar: the day each open order is due to arrive, on a month, a week or as an agenda (the foundation's `calendarGrid`). The status is told in\n * words as well as by color, the day and view are kept in the address, and the list beside it names every order due in the period.\n */\nexport const deliveryCalendarTemplate: ScreenTemplate = {\n name: 'OrdersDeliveryCalendar',\n fitsSlot: 'content',\n slots: [{ name: 'header' }, { name: 'calendar' }, { name: 'due' }],\n arrangement: {\n root: column([slotLeaf('header'), grid([slotLeaf('calendar', { span: 2 }), slotLeaf('due')], 3, 16)], 16),\n overrides: [{ width: WidthSizeClass.Compact, root: column([slotLeaf('header'), slotLeaf('calendar'), slotLeaf('due')], 16) }],\n },\n content: {\n header: [component('OrdersDeliveryCalendar-header', 'pageHeader', { title: 'Deliveries', subtitle: 'When each order is due to arrive' }, {\n actions: [withBehaviors(actionButton('OrdersDeliveryCalendar-orders', 'Open the orders', 'secondary'), goesTo('orders.list'))],\n })],\n calendar: [component('OrdersDeliveryCalendar-grid', 'calendarGrid', { label: 'Deliveries', events: fromQuery(OrdersQuery.DeliveryEvents), date: fromQuery(OrdersQuery.Settings, '0.today'), urlKey: 'day', ...localeOfData })],\n due: [component('OrdersDeliveryCalendar-due', 'dataList', { label: 'Due in this period', rows: fromQuery(OrdersQuery.DeliveryEvents), columns: fromQuery(OrdersQuery.DeliveryColumns), titleField: 'title', pageSize: 6, ...localeOfData })],\n },\n displayName: 'Orders delivery calendar',\n description: 'The day each open order is due to arrive, on a month, a week or as an agenda.',\n metadata: ordersMetadata('OrdersDeliveryCalendar', 'Calendar', [TemplateScope.Module, TemplateScope.Feature]),\n};\n"],"names":["deliveryCalendarTemplate","name","fitsSlot","slots","arrangement","root","column","slotLeaf","grid","span","overrides","width","WidthSizeClass","Compact","content","header","component","title","subtitle","actions","withBehaviors","actionButton","goesTo","calendar","label","events","fromQuery","OrdersQuery","DeliveryEvents","date","Settings","urlKey","localeOfData","due","rows","columns","DeliveryColumns","titleField","pageSize","displayName","description","metadata","ordersMetadata","TemplateScope","Module","Feature"],"mappings":";;;;;AAAA;AACA;AAOA;;;UAIaA,wBAAAA,GAA2C;IACpDC,IAAAA,EAAM,wBAAA;IACNC,QAAAA,EAAU,SAAA;IACVC,KAAAA,EAAO;AAAC,QAAA;YAAEF,IAAAA,EAAM;AAAS,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAW,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAM;AAAE,KAAA;IAClEG,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,MAAAA,CAAO;YAACC,QAAAA,CAAS,QAAA,CAAA;YAAWC,IAAAA,CAAK;AAACD,gBAAAA,QAAAA,CAAS,UAAA,EAAY;oBAAEE,IAAAA,EAAM;AAAE,iBAAA,CAAA;gBAAIF,QAAAA,CAAS,KAAA;AAAO,aAAA,EAAE,CAAA,EAAG,EAAA;SAAI,EAAE,EAAA,CAAA;QACtGG,SAAAA,EAAW;AAAC,YAAA;AAAEC,gBAAAA,KAAAA,EAAOC,eAAeC,OAAO;AAAER,gBAAAA,IAAAA,EAAMC,MAAAA,CAAO;oBAACC,QAAAA,CAAS,QAAA,CAAA;oBAAWA,QAAAA,CAAS,UAAA,CAAA;oBAAaA,QAAAA,CAAS,KAAA;iBAAO,EAAE,EAAA;AAAI;AAAE;AACjI,KAAA;IACAO,OAAAA,EAAS;QACLC,MAAAA,EAAQ;AAACC,YAAAA,SAAAA,CAAU,iCAAiC,YAAA,EAAc;gBAAEC,KAAAA,EAAO,YAAA;gBAAcC,QAAAA,EAAU;aAAmC,EAAG;gBACrIC,OAAAA,EAAS;AAACC,oBAAAA,aAAAA,CAAcC,YAAAA,CAAa,+BAAA,EAAiC,iBAAA,EAAmB,WAAA,CAAA,EAAcC,MAAAA,CAAO,aAAA,CAAA;AAAgB;AAClI,aAAA;AAAG,SAAA;QACHC,QAAAA,EAAU;AAACP,YAAAA,SAAAA,CAAU,+BAA+B,cAAA,EAAgB;gBAAEQ,KAAAA,EAAO,YAAA;gBAAcC,MAAAA,EAAQC,SAAAA,CAAUC,YAAYC,cAAc,CAAA;gBAAGC,IAAAA,EAAMH,SAAAA,CAAUC,WAAAA,CAAYG,QAAQ,EAAE,SAAA,CAAA;gBAAYC,MAAAA,EAAQ,KAAA;AAAO,gBAAA,GAAGC;AAAa,aAAA;AAAG,SAAA;QAC9NC,GAAAA,EAAK;AAACjB,YAAAA,SAAAA,CAAU,8BAA8B,UAAA,EAAY;gBAAEQ,KAAAA,EAAO,oBAAA;gBAAsBU,IAAAA,EAAMR,SAAAA,CAAUC,YAAYC,cAAc,CAAA;gBAAGO,OAAAA,EAAST,SAAAA,CAAUC,YAAYS,eAAe,CAAA;gBAAGC,UAAAA,EAAY,OAAA;gBAASC,QAAAA,EAAU,CAAA;AAAG,gBAAA,GAAGN;AAAa,aAAA;AAAG;AAChP,KAAA;IACAO,WAAAA,EAAa,0BAAA;IACbC,WAAAA,EAAa,+EAAA;IACbC,QAAAA,EAAUC,cAAAA,CAAe,0BAA0B,UAAA,EAAY;AAACC,QAAAA,aAAAA,CAAcC,MAAM;AAAED,QAAAA,aAAAA,CAAcE;AAAQ,KAAA;AAChH;;"}
@@ -0,0 +1,3 @@
1
+ import { DialogTemplate } from '@cratis/scene.model';
2
+ export declare const ordersDialogs: DialogTemplate[];
3
+ //# 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,EAAiB,MAAM,qBAAqB,CAAC;AA2BpE,eAAO,MAAM,aAAa,EAAE,cAAc,EAEzC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { TemplateScope } from '@cratis/scene.model';
2
+ import { quickCreateDialogTemplate, component } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, OrdersQuery } from '../ordersQueries.js';
4
+ import { ordersMetadata, withBehaviors, closesDialog } from '../ordersParts.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
+ * One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields
10
+ * that thing needs to get started.
11
+ */ function quickCreateOf(name, title, sections, noun) {
12
+ return {
13
+ name,
14
+ slots: quickCreateDialogTemplate.slots,
15
+ content: {
16
+ header: [
17
+ component(`${name}-frame`, 'dialogFrame', {
18
+ title,
19
+ subtitle: 'Only what is needed to get started'
20
+ })
21
+ ],
22
+ body: [
23
+ withBehaviors(component(`${name}-form`, 'formScreenBody', {
24
+ mode: 'create',
25
+ saveAndNew: false,
26
+ strings: {
27
+ formSave: 'Create'
28
+ },
29
+ sections: fromQuery(sections),
30
+ errors: fromQuery(OrdersQuery.FormErrors, '0'),
31
+ ...localeOfData
32
+ }), closesDialog())
33
+ ],
34
+ actions: []
35
+ },
36
+ displayName: `Orders quick create ${noun}`,
37
+ description: `A short form that creates one ${noun} without leaving the page.`,
38
+ metadata: ordersMetadata(name, 'Dialog', [
39
+ TemplateScope.Slice
40
+ ])
41
+ };
42
+ }
43
+ /** The quick creation of an order. */ const ordersDialogs = [
44
+ quickCreateOf('OrdersQuickCreateOrder', 'New order', 'OrderQuickSections', 'order')
45
+ ];
46
+
47
+ export { ordersDialogs };
48
+ //# 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, TemplateScope } from '@cratis/scene.model';\nimport { quickCreateDialogTemplate } from '@cratis/scene.blueprint.default';\nimport { OrdersQuery, fromQuery, localeOfData } from '../ordersQueries';\nimport { closesDialog, component, ordersMetadata, withBehaviors } from '../ordersParts';\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, sections: string, noun: string): DialogTemplate {\n return {\n name,\n slots: quickCreateDialogTemplate.slots,\n content: {\n header: [component(`${name}-frame`, 'dialogFrame', { title, subtitle: 'Only what is needed to get started' })],\n body: [withBehaviors(component(`${name}-form`, 'formScreenBody', {\n mode: 'create', saveAndNew: false, strings: { formSave: 'Create' }, sections: fromQuery(sections), errors: fromQuery(OrdersQuery.FormErrors, '0'), ...localeOfData,\n }), closesDialog())],\n actions: [],\n },\n displayName: `Orders quick create ${noun}`,\n description: `A short form that creates one ${noun} without leaving the page.`,\n metadata: ordersMetadata(name, 'Dialog', [TemplateScope.Slice]),\n };\n}\n\n/** The quick creation of an order. */\nexport const ordersDialogs: DialogTemplate[] = [\n quickCreateOf('OrdersQuickCreateOrder', 'New order', 'OrderQuickSections', 'order'),\n];\n"],"names":["quickCreateOf","name","title","sections","noun","slots","quickCreateDialogTemplate","content","header","component","subtitle","body","withBehaviors","mode","saveAndNew","strings","formSave","fromQuery","errors","OrdersQuery","FormErrors","localeOfData","closesDialog","actions","displayName","description","metadata","ordersMetadata","TemplateScope","Slice","ordersDialogs"],"mappings":";;;;;AAAA;AACA;AAOA;;;IAIA,SAASA,cAAcC,IAAY,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,IAAY,EAAA;IAC9E,OAAO;AACHH,QAAAA,IAAAA;AACAI,QAAAA,KAAAA,EAAOC,0BAA0BD,KAAK;QACtCE,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,SAAAA,CAAU,CAAA,EAAGR,IAAAA,CAAK,MAAM,CAAC,EAAE,aAAA,EAAe;AAAEC,oBAAAA,KAAAA;oBAAOQ,QAAAA,EAAU;AAAqC,iBAAA;AAAG,aAAA;YAC9GC,IAAAA,EAAM;AAACC,gBAAAA,aAAAA,CAAcH,UAAU,CAAA,EAAGR,IAAAA,CAAK,KAAK,CAAC,EAAE,gBAAA,EAAkB;oBAC7DY,IAAAA,EAAM,QAAA;oBAAUC,UAAAA,EAAY,KAAA;oBAAOC,OAAAA,EAAS;wBAAEC,QAAAA,EAAU;AAAS,qBAAA;AAAGb,oBAAAA,QAAAA,EAAUc,SAAAA,CAAUd,QAAAA,CAAAA;oBAAWe,MAAAA,EAAQD,SAAAA,CAAUE,WAAAA,CAAYC,UAAU,EAAE,GAAA,CAAA;AAAM,oBAAA,GAAGC;iBAC1J,CAAA,EAAIC,YAAAA,EAAAA;AAAgB,aAAA;AACpBC,YAAAA,OAAAA,EAAS;AACb,SAAA;QACAC,WAAAA,EAAa,CAAC,oBAAoB,EAAEpB,IAAAA,CAAAA,CAAM;AAC1CqB,QAAAA,WAAAA,EAAa,CAAC,8BAA8B,EAAErB,IAAAA,CAAK,0BAA0B,CAAC;QAC9EsB,QAAAA,EAAUC,cAAAA,CAAe1B,MAAM,QAAA,EAAU;AAAC2B,YAAAA,aAAAA,CAAcC;AAAM,SAAA;AAClE,KAAA;AACJ;AAEA,uCACO,MAAMC,aAAAA,GAAkC;IAC3C9B,aAAAA,CAAc,wBAAA,EAA0B,aAAa,oBAAA,EAAsB,OAAA;;;"}
@@ -0,0 +1,8 @@
1
+ export * from './listTemplates';
2
+ export * from './recordTemplates';
3
+ export * from './boardTemplate';
4
+ export * from './deliveryTemplate';
5
+ export * from './formTemplates';
6
+ export declare const ordersScreenTemplates: import("@cratis/scene.model/screens").ScreenTemplate[];
7
+ export { ordersDialogs as ordersDialogTemplates } 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":"AAKA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAGhC,eAAO,MAAM,qBAAqB,wDAA6F,CAAC;AAEhI,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { fulfilmentBoardTemplate } from './boardTemplate.js';
2
+ import { deliveryCalendarTemplate } from './deliveryTemplate.js';
3
+ import { ordersListTemplate } from './listTemplates.js';
4
+ import { orderPageTemplate } from './recordTemplates.js';
5
+ export { ordersDialogs as ordersDialogTemplates, ordersDialogs } from './formTemplates.js';
6
+
7
+ /** Every screen template this blueprint provides, in the order the manifest lists them. */ const ordersScreenTemplates = [
8
+ ordersListTemplate,
9
+ orderPageTemplate,
10
+ fulfilmentBoardTemplate,
11
+ deliveryCalendarTemplate
12
+ ];
13
+
14
+ export { deliveryCalendarTemplate, fulfilmentBoardTemplate, orderPageTemplate, ordersListTemplate, ordersScreenTemplates };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../templates/index.ts"],"sourcesContent":["import { fulfilmentBoardTemplate } from './boardTemplate';\nimport { deliveryCalendarTemplate } from './deliveryTemplate';\nimport { ordersListTemplate } from './listTemplates';\nimport { orderPageTemplate } from './recordTemplates';\n\nexport * from './listTemplates';\nexport * from './recordTemplates';\nexport * from './boardTemplate';\nexport * from './deliveryTemplate';\nexport * from './formTemplates';\n\n/** Every screen template this blueprint provides, in the order the manifest lists them. */\nexport const ordersScreenTemplates = [ordersListTemplate, orderPageTemplate, fulfilmentBoardTemplate, deliveryCalendarTemplate];\n\nexport { ordersDialogs as ordersDialogTemplates } from './formTemplates';\n"],"names":["ordersScreenTemplates","ordersListTemplate","orderPageTemplate","fulfilmentBoardTemplate","deliveryCalendarTemplate"],"mappings":";;;;;;AAWA,4FACO,MAAMA,qBAAAA,GAAwB;AAACC,IAAAA,kBAAAA;AAAoBC,IAAAA,iBAAAA;AAAmBC,IAAAA,uBAAAA;AAAyBC,IAAAA;;;"}
@@ -0,0 +1,3 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const ordersListTemplate: ScreenTemplate;
3
+ //# 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;AAqFpJ,eAAO,MAAM,kBAAkB,gBAI7B,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { TemplateScope, NotificationLevel, InteractionActionKind, InteractionTriggerKind } from '@cratis/scene.model';
2
+ import { component, listScreenTemplate } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, ordersQueriesOf, OrdersEntityKind } from '../ordersQueries.js';
4
+ import { withBehaviors, opensDialog, goesTo, actionButton, ordersMetadata, opensRecordOnSelect } from '../ordersParts.js';
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ const listScopes = [
9
+ TemplateScope.Module,
10
+ TemplateScope.Feature
11
+ ];
12
+ /** The Export button: it tells the user the export has started, which is what the shell does for a long-running action it does not wait on. */ const exportAction = (id)=>withBehaviors(actionButton(id, 'Export', 'secondary'), [
13
+ {
14
+ bindings: [
15
+ {
16
+ trigger: {
17
+ kind: InteractionTriggerKind.Click
18
+ },
19
+ actions: [
20
+ {
21
+ kind: InteractionActionKind.Notify,
22
+ level: NotificationLevel.Info,
23
+ message: {
24
+ text: 'The export has started.'
25
+ }
26
+ }
27
+ ]
28
+ }
29
+ ]
30
+ }
31
+ ]);
32
+ /**
33
+ * One orders list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled for an entity. The slots, arrangement and
34
+ * every behavior - sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.
35
+ */ function listTemplateOf(options) {
36
+ const queries = ordersQueriesOf(options.entity);
37
+ const id = options.name;
38
+ const listId = `${id}-records`;
39
+ const primary = withBehaviors(actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? opensDialog(options.primary.dialog) : goesTo(options.primary.screen));
40
+ const list = component(listId, 'dataList', {
41
+ label: options.title,
42
+ rows: fromQuery(queries.rows),
43
+ columns: fromQuery(queries.columns),
44
+ titleField: options.titleField,
45
+ pageSize: options.cards ? 12 : 10,
46
+ urlKey: options.urlKey,
47
+ ...localeOfData,
48
+ rowActions: options.rowActions,
49
+ ...options.readOnly ? {} : {
50
+ selectionMode: options.recordScreen || options.recordDialog ? 'single' : 'multiple'
51
+ },
52
+ ...options.cards ? {
53
+ variant: 'cards',
54
+ ...options.cards.imageField ? {
55
+ imageField: options.cards.imageField
56
+ } : {}
57
+ } : {},
58
+ ...options.grouped ? {
59
+ variant: 'grouped',
60
+ groupBy: options.grouped.groupBy
61
+ } : {},
62
+ ...options.toneField ? {
63
+ toneField: options.toneField
64
+ } : {}
65
+ });
66
+ return {
67
+ name: options.name,
68
+ fitsSlot: 'content',
69
+ slots: listScreenTemplate.slots,
70
+ arrangement: listScreenTemplate.arrangement,
71
+ content: {
72
+ header: [
73
+ component(`${id}-header`, 'pageHeader', {
74
+ title: options.title,
75
+ subtitle: options.subtitle
76
+ }, {
77
+ actions: [
78
+ exportAction(`${id}-export`),
79
+ primary
80
+ ]
81
+ })
82
+ ],
83
+ toolbar: [
84
+ component(`${id}-search`, 'globalSearch', {
85
+ placeholder: options.searchLabel,
86
+ label: options.searchLabel,
87
+ urlKey: `${options.urlKey}q`
88
+ }),
89
+ component(`${id}-views`, 'savedViewsMenu', {
90
+ views: fromQuery(queries.views),
91
+ savePermission: 'enabled',
92
+ managePermission: 'enabled'
93
+ }),
94
+ component(`${id}-columns`, 'columnChooser', {
95
+ columns: fromQuery(queries.columnChoices)
96
+ })
97
+ ],
98
+ filters: [
99
+ component(`${id}-filter`, 'filterBuilder', {
100
+ fields: fromQuery(queries.filterFields),
101
+ ...localeOfData
102
+ })
103
+ ],
104
+ list: [
105
+ options.recordScreen ? withBehaviors(list, opensRecordOnSelect(listId, options.recordScreen)) : list
106
+ ],
107
+ bulkBar: options.recordScreen || options.recordDialog || options.readOnly ? [] : [
108
+ component(`${id}-bulk`, 'bulkBar', {
109
+ selection: fromQuery(queries.selection),
110
+ actions: options.bulkActions
111
+ })
112
+ ],
113
+ footer: []
114
+ },
115
+ displayName: options.displayName,
116
+ description: options.description,
117
+ metadata: ordersMetadata(options.name, 'List', listScopes)
118
+ };
119
+ }
120
+ /** The orders: every order with its customer, dates, total and status, filtered by customer, status and channel. Choosing an order opens it. */ const ordersListTemplate = listTemplateOf({
121
+ name: 'OrdersList',
122
+ entity: OrdersEntityKind.Order,
123
+ displayName: 'Orders list',
124
+ description: 'Every order with customer, placed and delivery dates, total and status, filtered by customer, status, channel and date.',
125
+ title: 'Orders',
126
+ subtitle: 'Everything customers have ordered',
127
+ searchLabel: 'Search orders',
128
+ urlKey: 'orders',
129
+ primary: {
130
+ label: 'New order',
131
+ dialog: 'OrdersQuickCreateOrder'
132
+ },
133
+ rowActions: [
134
+ 'Open',
135
+ 'Cancel order'
136
+ ],
137
+ bulkActions: [],
138
+ titleField: 'number',
139
+ recordScreen: 'orders.record'
140
+ });
141
+
142
+ export { ordersListTemplate };
143
+ //# sourceMappingURL=listTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listTemplates.js","sources":["../../../templates/listTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { InteractionActionKind, InteractionTriggerKind, NotificationLevel, NotifyAction, ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { listScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { OrdersEntityKind, fromQuery, ordersQueriesOf, localeOfData } from '../ordersQueries';\nimport { actionButton, component, goesTo, ordersMetadata, opensDialog, opensRecordOnSelect, withBehaviors } from '../ordersParts';\n\nconst listScopes = [TemplateScope.Module, TemplateScope.Feature];\n\n/** The Export button: it tells the user the export has started, which is what the shell does for a long-running action it does not wait on. */\nconst exportAction = (id: string) => withBehaviors(actionButton(id, 'Export', 'secondary'), [{\n bindings: [{\n trigger: { kind: InteractionTriggerKind.Click },\n actions: [{ kind: InteractionActionKind.Notify, level: NotificationLevel.Info, message: { text: 'The export has started.' } } as unknown as NotifyAction],\n }],\n}]);\n\ninterface ListOptions {\n name: string;\n entity: OrdersEntityKind;\n displayName: string;\n description: string;\n title: string;\n subtitle: string;\n searchLabel: string;\n urlKey: string;\n /** The primary action of the header: a quick-create dialog to open, or a screen to go to. */\n primary: { label: string; dialog?: string; screen?: string };\n rowActions: string[];\n bulkActions: string[];\n titleField: string;\n /** The screen a chosen row opens; the list then selects one row at a time. Absent, rows are selected many at a time for the bulk bar. */\n recordScreen?: string;\n /** The side sheet a chosen row opens instead of a record page; the list then selects one row at a time. */\n recordDialog?: string;\n /** Group the rows (`variant: grouped`) by this field. */\n grouped?: { groupBy: string };\n /** Rows are not selectable at all: a record of what happened, which nobody edits. */\n readOnly?: boolean;\n /** Show the records as cards, each with the picture its `imageField` names. */\n cards?: { imageField?: string };\n /** Tint a row by the tone in this field (always beside a status column that says the same in words). */\n toneField?: string;\n}\n\n/**\n * One orders list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled for an entity. The slots, arrangement and\n * every behavior - sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.\n */\nfunction listTemplateOf(options: ListOptions): ScreenTemplate {\n const queries = ordersQueriesOf(options.entity);\n const id = options.name;\n const listId = `${id}-records`;\n const primary = withBehaviors(actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? opensDialog(options.primary.dialog) : goesTo(options.primary.screen!));\n const list = component(listId, 'dataList', {\n label: options.title, rows: fromQuery(queries.rows), columns: fromQuery(queries.columns), titleField: options.titleField, pageSize: options.cards ? 12 : 10, urlKey: options.urlKey, ...localeOfData,\n rowActions: options.rowActions,\n ...(options.readOnly ? {} : { selectionMode: options.recordScreen || options.recordDialog ? 'single' : 'multiple' }),\n ...(options.cards ? { variant: 'cards', ...(options.cards.imageField ? { imageField: options.cards.imageField } : {}) } : {}),\n ...(options.grouped ? { variant: 'grouped', groupBy: options.grouped.groupBy } : {}),\n ...(options.toneField ? { toneField: options.toneField } : {}),\n });\n\n return {\n name: options.name,\n fitsSlot: 'content',\n slots: listScreenTemplate.slots,\n arrangement: listScreenTemplate.arrangement,\n content: {\n header: [component(`${id}-header`, 'pageHeader', { title: options.title, subtitle: options.subtitle }, { actions: [exportAction(`${id}-export`), primary] })],\n toolbar: [\n component(`${id}-search`, 'globalSearch', { placeholder: options.searchLabel, label: options.searchLabel, urlKey: `${options.urlKey}q` }),\n component(`${id}-views`, 'savedViewsMenu', { views: fromQuery(queries.views), savePermission: 'enabled', managePermission: 'enabled' }),\n component(`${id}-columns`, 'columnChooser', { columns: fromQuery(queries.columnChoices) }),\n ],\n filters: [component(`${id}-filter`, 'filterBuilder', { fields: fromQuery(queries.filterFields), ...localeOfData })],\n list: [options.recordScreen ? withBehaviors(list, opensRecordOnSelect(listId, options.recordScreen)) : list],\n bulkBar: options.recordScreen || options.recordDialog || options.readOnly ? [] : [component(`${id}-bulk`, 'bulkBar', { selection: fromQuery(queries.selection), actions: options.bulkActions })],\n footer: [],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: ordersMetadata(options.name, 'List', listScopes),\n };\n}\n\n/** The orders: every order with its customer, dates, total and status, filtered by customer, status and channel. Choosing an order opens it. */\nexport const ordersListTemplate = listTemplateOf({\n name: 'OrdersList', entity: OrdersEntityKind.Order, displayName: 'Orders list', description: 'Every order with customer, placed and delivery dates, total and status, filtered by customer, status, channel and date.',\n title: 'Orders', subtitle: 'Everything customers have ordered', searchLabel: 'Search orders', urlKey: 'orders', primary: { label: 'New order', dialog: 'OrdersQuickCreateOrder' },\n rowActions: ['Open', 'Cancel order'], bulkActions: [], titleField: 'number', recordScreen: 'orders.record',\n});\n"],"names":["listScopes","TemplateScope","Module","Feature","exportAction","id","withBehaviors","actionButton","bindings","trigger","kind","InteractionTriggerKind","Click","actions","InteractionActionKind","Notify","level","NotificationLevel","Info","message","text","listTemplateOf","options","queries","ordersQueriesOf","entity","name","listId","primary","label","dialog","opensDialog","goesTo","screen","list","component","title","rows","fromQuery","columns","titleField","pageSize","cards","urlKey","localeOfData","rowActions","readOnly","selectionMode","recordScreen","recordDialog","variant","imageField","grouped","groupBy","toneField","fitsSlot","slots","listScreenTemplate","arrangement","content","header","subtitle","toolbar","placeholder","searchLabel","views","savePermission","managePermission","columnChoices","filters","fields","filterFields","opensRecordOnSelect","bulkBar","selection","bulkActions","footer","displayName","description","metadata","ordersMetadata","ordersListTemplate","OrdersEntityKind","Order"],"mappings":";;;;;AAAA;AACA;AAOA,MAAMA,UAAAA,GAAa;AAACC,IAAAA,aAAAA,CAAcC,MAAM;AAAED,IAAAA,aAAAA,CAAcE;AAAQ,CAAA;AAEhE,gJACA,MAAMC,YAAAA,GAAe,CAACC,KAAeC,aAAAA,CAAcC,YAAAA,CAAaF,EAAAA,EAAI,QAAA,EAAU,WAAA,CAAA,EAAc;AAAC,QAAA;YACzFG,QAAAA,EAAU;AAAC,gBAAA;oBACPC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,uBAAuBC;AAAM,qBAAA;oBAC9CC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,sBAAsBC,MAAM;AAAEC,4BAAAA,KAAAA,EAAOC,kBAAkBC,IAAI;4BAAEC,OAAAA,EAAS;gCAAEC,IAAAA,EAAM;AAA0B;AAAE;AAA6B;AAC7J;AAAE;AACN;AAAE,KAAA,CAAA;AA8BF;;;IAIA,SAASC,eAAeC,OAAoB,EAAA;IACxC,MAAMC,OAAAA,GAAUC,eAAAA,CAAgBF,OAAAA,CAAQG,MAAM,CAAA;IAC9C,MAAMpB,EAAAA,GAAKiB,QAAQI,IAAI;AACvB,IA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JACO,MAAMiF,kBAAAA,GAAqB5D,cAAAA,CAAe;IAC7CK,IAAAA,EAAM,YAAA;AAAcD,IAAAA,MAAAA,EAAQyD,iBAAiBC,KAAK;IAAEN,WAAAA,EAAa,aAAA;IAAeC,WAAAA,EAAa,yHAAA;IAC7F1C,KAAAA,EAAO,QAAA;IAAUyB,QAAAA,EAAU,mCAAA;IAAqCG,WAAAA,EAAa,eAAA;IAAiBrB,MAAAA,EAAQ,QAAA;IAAUf,OAAAA,EAAS;QAAEC,KAAAA,EAAO,WAAA;QAAaC,MAAAA,EAAQ;AAAyB,KAAA;IAChLe,UAAAA,EAAY;AAAC,QAAA,MAAA;AAAQ,QAAA;AAAe,KAAA;AAAE8B,IAAAA,WAAAA,EAAa,EAAE;IAAEnC,UAAAA,EAAY,QAAA;IAAUQ,YAAAA,EAAc;AAC/F,CAAA;;"}
@@ -0,0 +1,3 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const orderPageTemplate: ScreenTemplate;
3
+ //# sourceMappingURL=recordTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recordTemplates.d.ts","sourceRoot":"","sources":["../../../templates/recordTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AAWpE,eAAO,MAAM,iBAAiB,EAAE,cA4B/B,CAAC"}
@@ -0,0 +1,99 @@
1
+ import { TemplateScope } from '@cratis/scene.model';
2
+ import { component, recordPageTemplate } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, currencyOfData, OrdersQuery, ordersQueriesOf, OrdersEntityKind } from '../ordersQueries.js';
4
+ import { ordersMetadata, withBehaviors, goesTo, actionButton } from '../ordersParts.js';
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ const order = ordersQueriesOf(OrdersEntityKind.Order);
9
+ /**
10
+ * The order page: the foundation `RecordPage` with the order number as its title, its status, total and days to delivery as key facts, the order's fields, its
11
+ * lines and shipments in the main region, and the activity beside it.
12
+ */ const orderPageTemplate = {
13
+ name: 'OrderPage',
14
+ fitsSlot: 'content',
15
+ slots: recordPageTemplate.slots,
16
+ arrangement: recordPageTemplate.arrangement,
17
+ content: {
18
+ header: [
19
+ component('OrderPage-header', 'pageHeader', {
20
+ title: fromQuery(order.record, '0.number'),
21
+ subtitle: fromQuery(order.record, '0.summary')
22
+ }, {
23
+ actions: [
24
+ withBehaviors(actionButton('OrderPage-back', 'Back to orders', 'secondary'), goesTo('orders.list'))
25
+ ]
26
+ })
27
+ ],
28
+ summary: [
29
+ component('OrderPage-status', 'statusChip', {
30
+ status: fromQuery(order.summary, '0.status'),
31
+ tone: fromQuery(order.summary, '0.tone')
32
+ }),
33
+ component('OrderPage-total', 'statCard', {
34
+ label: 'Order total',
35
+ value: fromQuery(order.summary, '0.total'),
36
+ format: 'currency',
37
+ ...currencyOfData
38
+ }),
39
+ component('OrderPage-items', 'statCard', {
40
+ label: 'Items',
41
+ value: fromQuery(order.summary, '0.items'),
42
+ ...localeOfData
43
+ }),
44
+ component('OrderPage-days', 'statCard', {
45
+ label: 'Days to delivery',
46
+ value: fromQuery(order.summary, '0.daysToDelivery'),
47
+ ...localeOfData
48
+ })
49
+ ],
50
+ tabs: [
51
+ component('OrderPage-tabs', 'tabSet', {
52
+ tabs: fromQuery(OrdersQuery.RecordTabs),
53
+ urlKey: 'tab',
54
+ label: 'Order sections'
55
+ })
56
+ ],
57
+ main: [
58
+ component('OrderPage-form', 'formScreenBody', {
59
+ mode: 'readOnly',
60
+ sections: fromQuery(order.sections),
61
+ values: fromQuery(order.record, '0'),
62
+ ...currencyOfData
63
+ }),
64
+ component('OrderPage-lines', 'dataList', {
65
+ label: 'Order lines',
66
+ rows: fromQuery(OrdersQuery.Lines),
67
+ columns: fromQuery(OrdersQuery.LineColumns),
68
+ titleField: 'name',
69
+ pageSize: 8,
70
+ ...currencyOfData
71
+ }),
72
+ component('OrderPage-shipments', 'dataList', {
73
+ label: 'Shipments',
74
+ rows: fromQuery(OrdersQuery.Shipments),
75
+ columns: fromQuery(OrdersQuery.ShipmentColumns),
76
+ titleField: 'reference',
77
+ ...localeOfData
78
+ })
79
+ ],
80
+ related: [],
81
+ activity: [
82
+ component('OrderPage-activity', 'activityFeed', {
83
+ label: 'Activity',
84
+ entries: fromQuery(order.activity),
85
+ ...localeOfData
86
+ })
87
+ ],
88
+ aside: []
89
+ },
90
+ displayName: 'Order page',
91
+ description: 'One order: key facts, its lines and shipments, and its activity.',
92
+ metadata: ordersMetadata('OrderPage', 'Detail', [
93
+ TemplateScope.Feature,
94
+ TemplateScope.Subfeature
95
+ ])
96
+ };
97
+
98
+ export { orderPageTemplate };
99
+ //# sourceMappingURL=recordTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recordTemplates.js","sources":["../../../templates/recordTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { recordPageTemplate } from '@cratis/scene.blueprint.default';\nimport { OrdersEntityKind, OrdersQuery, fromQuery, localeOfData, ordersQueriesOf, currencyOfData } from '../ordersQueries';\nimport { actionButton, component, goesTo, ordersMetadata, withBehaviors } from '../ordersParts';\n\nconst order = ordersQueriesOf(OrdersEntityKind.Order);\n\n/**\n * The order page: the foundation `RecordPage` with the order number as its title, its status, total and days to delivery as key facts, the order's fields, its\n * lines and shipments in the main region, and the activity beside it.\n */\nexport const orderPageTemplate: ScreenTemplate = {\n name: 'OrderPage',\n fitsSlot: 'content',\n slots: recordPageTemplate.slots,\n arrangement: recordPageTemplate.arrangement,\n content: {\n header: [component('OrderPage-header', 'pageHeader', { title: fromQuery(order.record, '0.number'), subtitle: fromQuery(order.record, '0.summary') }, {\n actions: [withBehaviors(actionButton('OrderPage-back', 'Back to orders', 'secondary'), goesTo('orders.list'))],\n })],\n summary: [\n component('OrderPage-status', 'statusChip', { status: fromQuery(order.summary, '0.status'), tone: fromQuery(order.summary, '0.tone') }),\n component('OrderPage-total', 'statCard', { label: 'Order total', value: fromQuery(order.summary, '0.total'), format: 'currency', ...currencyOfData }),\n component('OrderPage-items', 'statCard', { label: 'Items', value: fromQuery(order.summary, '0.items'), ...localeOfData }),\n component('OrderPage-days', 'statCard', { label: 'Days to delivery', value: fromQuery(order.summary, '0.daysToDelivery'), ...localeOfData }),\n ],\n tabs: [component('OrderPage-tabs', 'tabSet', { tabs: fromQuery(OrdersQuery.RecordTabs), urlKey: 'tab', label: 'Order sections' })],\n main: [\n component('OrderPage-form', 'formScreenBody', { mode: 'readOnly', sections: fromQuery(order.sections), values: fromQuery(order.record, '0'), ...currencyOfData }),\n component('OrderPage-lines', 'dataList', { label: 'Order lines', rows: fromQuery(OrdersQuery.Lines), columns: fromQuery(OrdersQuery.LineColumns), titleField: 'name', pageSize: 8, ...currencyOfData }),\n component('OrderPage-shipments', 'dataList', { label: 'Shipments', rows: fromQuery(OrdersQuery.Shipments), columns: fromQuery(OrdersQuery.ShipmentColumns), titleField: 'reference', ...localeOfData }),\n ],\n related: [],\n activity: [component('OrderPage-activity', 'activityFeed', { label: 'Activity', entries: fromQuery(order.activity), ...localeOfData })],\n aside: [],\n },\n displayName: 'Order page',\n description: 'One order: key facts, its lines and shipments, and its activity.',\n metadata: ordersMetadata('OrderPage', 'Detail', [TemplateScope.Feature, TemplateScope.Subfeature]),\n};\n"],"names":["order","ordersQueriesOf","OrdersEntityKind","Order","orderPageTemplate","name","fitsSlot","slots","recordPageTemplate","arrangement","content","header","component","title","fromQuery","record","subtitle","actions","withBehaviors","actionButton","goesTo","summary","status","tone","label","value","format","currencyOfData","localeOfData","tabs","OrdersQuery","RecordTabs","urlKey","main","mode","sections","values","rows","Lines","columns","LineColumns","titleField","pageSize","Shipments","ShipmentColumns","related","activity","entries","aside","displayName","description","metadata","ordersMetadata","TemplateScope","Feature","Subfeature"],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