@cratis/scene.blueprint.bookings 0.0.0-stage → 4.71.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 (133) hide show
  1. package/README.md +66 -2
  2. package/blueprint.ts +16 -0
  3. package/blueprintCatalog.json +123 -0
  4. package/bookingsApplication.ts +28 -0
  5. package/bookingsParts.ts +58 -0
  6. package/bookingsQueries.ts +60 -0
  7. package/bookingsScreenSet.ts +22 -0
  8. package/dist/cjs/blueprint.js +19 -0
  9. package/dist/cjs/blueprint.js.map +1 -0
  10. package/dist/cjs/bookingsApplication.js +49 -0
  11. package/dist/cjs/bookingsApplication.js.map +1 -0
  12. package/dist/cjs/bookingsParts.js +151 -0
  13. package/dist/cjs/bookingsParts.js.map +1 -0
  14. package/dist/cjs/bookingsQueries.js +68 -0
  15. package/dist/cjs/bookingsQueries.js.map +1 -0
  16. package/dist/cjs/bookingsScreenSet.js +47 -0
  17. package/dist/cjs/bookingsScreenSet.js.map +1 -0
  18. package/dist/cjs/index.js +69 -0
  19. package/dist/cjs/index.js.map +1 -0
  20. package/dist/cjs/manifest.js +90 -0
  21. package/dist/cjs/manifest.js.map +1 -0
  22. package/dist/cjs/navigation.js +117 -0
  23. package/dist/cjs/navigation.js.map +1 -0
  24. package/dist/cjs/package.json +3 -0
  25. package/dist/cjs/packageName.js +8 -0
  26. package/dist/cjs/packageName.js.map +1 -0
  27. package/dist/cjs/screens/index.js +22 -0
  28. package/dist/cjs/screens/index.js.map +1 -0
  29. package/dist/cjs/templateProvenance.js +24 -0
  30. package/dist/cjs/templateProvenance.js.map +1 -0
  31. package/dist/cjs/templates/calendarTemplate.js +109 -0
  32. package/dist/cjs/templates/calendarTemplate.js.map +1 -0
  33. package/dist/cjs/templates/formTemplates.js +50 -0
  34. package/dist/cjs/templates/formTemplates.js.map +1 -0
  35. package/dist/cjs/templates/index.js +27 -0
  36. package/dist/cjs/templates/index.js.map +1 -0
  37. package/dist/cjs/templates/listTemplates.js +167 -0
  38. package/dist/cjs/templates/listTemplates.js.map +1 -0
  39. package/dist/cjs/templates/recordTemplates.js +129 -0
  40. package/dist/cjs/templates/recordTemplates.js.map +1 -0
  41. package/dist/cjs/templates/wizardTemplate.js +73 -0
  42. package/dist/cjs/templates/wizardTemplate.js.map +1 -0
  43. package/dist/esm/blueprint.d.ts +3 -0
  44. package/dist/esm/blueprint.d.ts.map +1 -0
  45. package/dist/esm/blueprint.js +17 -0
  46. package/dist/esm/blueprint.js.map +1 -0
  47. package/dist/esm/bookingsApplication.d.ts +10 -0
  48. package/dist/esm/bookingsApplication.d.ts.map +1 -0
  49. package/dist/esm/bookingsApplication.js +44 -0
  50. package/dist/esm/bookingsApplication.js.map +1 -0
  51. package/dist/esm/bookingsParts.d.ts +16 -0
  52. package/dist/esm/bookingsParts.d.ts.map +1 -0
  53. package/dist/esm/bookingsParts.js +133 -0
  54. package/dist/esm/bookingsParts.js.map +1 -0
  55. package/dist/esm/bookingsQueries.d.ts +41 -0
  56. package/dist/esm/bookingsQueries.d.ts.map +1 -0
  57. package/dist/esm/bookingsQueries.js +60 -0
  58. package/dist/esm/bookingsQueries.js.map +1 -0
  59. package/dist/esm/bookingsScreenSet.d.ts +7 -0
  60. package/dist/esm/bookingsScreenSet.d.ts.map +1 -0
  61. package/dist/esm/bookingsScreenSet.js +45 -0
  62. package/dist/esm/bookingsScreenSet.js.map +1 -0
  63. package/dist/esm/index.d.ts +12 -0
  64. package/dist/esm/index.d.ts.map +1 -0
  65. package/dist/esm/index.js +18 -0
  66. package/dist/esm/index.js.map +1 -0
  67. package/dist/esm/manifest.d.ts +3 -0
  68. package/dist/esm/manifest.d.ts.map +1 -0
  69. package/dist/esm/manifest.js +88 -0
  70. package/dist/esm/manifest.js.map +1 -0
  71. package/dist/esm/navigation.d.ts +5 -0
  72. package/dist/esm/navigation.d.ts.map +1 -0
  73. package/dist/esm/navigation.js +113 -0
  74. package/dist/esm/navigation.js.map +1 -0
  75. package/dist/esm/package.json +3 -0
  76. package/dist/esm/packageName.d.ts +2 -0
  77. package/dist/esm/packageName.d.ts.map +1 -0
  78. package/dist/esm/packageName.js +6 -0
  79. package/dist/esm/packageName.js.map +1 -0
  80. package/dist/esm/screens/index.d.ts +3 -0
  81. package/dist/esm/screens/index.d.ts.map +1 -0
  82. package/dist/esm/screens/index.js +20 -0
  83. package/dist/esm/screens/index.js.map +1 -0
  84. package/dist/esm/templateProvenance.d.ts +3 -0
  85. package/dist/esm/templateProvenance.d.ts.map +1 -0
  86. package/dist/esm/templateProvenance.js +22 -0
  87. package/dist/esm/templateProvenance.js.map +1 -0
  88. package/dist/esm/templates/calendarTemplate.d.ts +3 -0
  89. package/dist/esm/templates/calendarTemplate.d.ts.map +1 -0
  90. package/dist/esm/templates/calendarTemplate.js +107 -0
  91. package/dist/esm/templates/calendarTemplate.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 +18 -0
  99. package/dist/esm/templates/index.js.map +1 -0
  100. package/dist/esm/templates/listTemplates.d.ts +4 -0
  101. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  102. package/dist/esm/templates/listTemplates.js +164 -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 +127 -0
  107. package/dist/esm/templates/recordTemplates.js.map +1 -0
  108. package/dist/esm/templates/wizardTemplate.d.ts +3 -0
  109. package/dist/esm/templates/wizardTemplate.d.ts.map +1 -0
  110. package/dist/esm/templates/wizardTemplate.js +71 -0
  111. package/dist/esm/templates/wizardTemplate.js.map +1 -0
  112. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  113. package/index.ts +14 -0
  114. package/manifest.ts +41 -0
  115. package/navigation.ts +54 -0
  116. package/package.json +78 -4
  117. package/packageName.ts +5 -0
  118. package/sampleData/bookings-en.json +1057 -0
  119. package/screens/index.ts +20 -0
  120. package/templateProvenance.ts +15 -0
  121. package/templates/calendarTemplate.ts +57 -0
  122. package/templates/formTemplates.ts +33 -0
  123. package/templates/index.ts +18 -0
  124. package/templates/listTemplates.ts +106 -0
  125. package/templates/recordTemplates.ts +78 -0
  126. package/templates/wizardTemplate.ts +29 -0
  127. package/thumbnails/BookingPage.svg +17 -0
  128. package/thumbnails/BookingsCalendar.svg +34 -0
  129. package/thumbnails/BookingsList.svg +29 -0
  130. package/thumbnails/BookingsQuickCreateBooking.svg +12 -0
  131. package/thumbnails/NewBookingWizard.svg +15 -0
  132. package/thumbnails/ResourcesList.svg +29 -0
  133. package/thumbnails/bookings.svg +14 -0
@@ -0,0 +1,113 @@
1
+ import { NavigationRegionMode, NavigationRegionKind } from '@cratis/scene.model';
2
+ import { bookingsScreenDefinitions } from './bookingsScreenSet.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 bookingsModule = 'bookings';
7
+ /**
8
+ * The application structure the screen set implies: one module, `bookings`, a feature for each screen and the sub-features beneath it (`bookings.record` is the
9
+ * `record` feature of the module). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.
10
+ */ const bookingsStructure = (()=>{
11
+ const root = {
12
+ id: bookingsModule,
13
+ name: 'Bookings',
14
+ features: []};
15
+ for (const screen of bookingsScreenDefinitions){
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 places a team goes: Calendar, Bookings, Resources, New booking.
44
+ */ const bookingsNavigation = {
45
+ application: {
46
+ logo: {
47
+ image: '',
48
+ title: 'Bookings'
49
+ },
50
+ regions: [
51
+ {
52
+ region: NavigationRegionKind.Topbar,
53
+ items: [
54
+ {
55
+ id: 'bookings',
56
+ title: 'Bookings',
57
+ target: {
58
+ module: bookingsModule
59
+ }
60
+ }
61
+ ]
62
+ }
63
+ ]
64
+ },
65
+ modules: [
66
+ {
67
+ module: bookingsModule,
68
+ regions: [
69
+ {
70
+ region: NavigationRegionKind.Sidebar,
71
+ mode: NavigationRegionMode.Override,
72
+ items: [
73
+ {
74
+ id: 'calendar',
75
+ title: 'Calendar',
76
+ target: {
77
+ module: bookingsModule,
78
+ feature: 'calendar'
79
+ }
80
+ },
81
+ {
82
+ id: 'list',
83
+ title: 'Bookings',
84
+ target: {
85
+ module: bookingsModule,
86
+ feature: 'list'
87
+ }
88
+ },
89
+ {
90
+ id: 'resources',
91
+ title: 'Resources',
92
+ target: {
93
+ module: bookingsModule,
94
+ feature: 'resources'
95
+ }
96
+ },
97
+ {
98
+ id: 'new',
99
+ title: 'New booking',
100
+ target: {
101
+ module: bookingsModule,
102
+ feature: 'new'
103
+ }
104
+ }
105
+ ]
106
+ }
107
+ ]
108
+ }
109
+ ]
110
+ };
111
+
112
+ export { bookingsModule, bookingsNavigation, bookingsStructure };
113
+ //# 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 { bookingsScreenDefinitions } from './bookingsScreenSet';\n\n/** The module the blueprint's screens live in, and so the first segment of every screen's qualified name. */\nexport const bookingsModule = 'bookings';\n\n/**\n * The application structure the screen set implies: one module, `bookings`, a feature for each screen and the sub-features beneath it (`bookings.record` is the\n * `record` feature of the module). Derived from the screen names, so a screen added to the set is part of the structure without a second edit.\n */\nexport const bookingsStructure: ApplicationStructure = (() => {\n interface Node { id: string; name: string; features: Node[]; slices: never[] }\n const root: Node = { id: bookingsModule, name: 'Bookings', features: [], slices: [] };\n for (const screen of bookingsScreenDefinitions) {\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 places a team goes: Calendar, Bookings, Resources, New booking.\n */\nexport const bookingsNavigation: NavigationModel = {\n application: {\n logo: { image: '', title: 'Bookings' },\n regions: [{ region: NavigationRegionKind.Topbar, items: [{ id: 'bookings', title: 'Bookings', target: { module: bookingsModule } }] }],\n },\n modules: [{\n module: bookingsModule,\n regions: [{\n region: NavigationRegionKind.Sidebar,\n mode: NavigationRegionMode.Override,\n items: [\n { id: 'calendar', title: 'Calendar', target: { module: bookingsModule, feature: 'calendar' } },\n { id: 'list', title: 'Bookings', target: { module: bookingsModule, feature: 'list' } },\n { id: 'resources', title: 'Resources', target: { module: bookingsModule, feature: 'resources' } },\n { id: 'new', title: 'New booking', target: { module: bookingsModule, feature: 'new' } },\n ],\n }],\n }],\n};\n"],"names":["bookingsModule","bookingsStructure","root","id","name","features","screen","bookingsScreenDefinitions","parent","split","slice","node","find","candidate","title","slices","push","modules","bookingsNavigation","application","logo","image","regions","region","NavigationRegionKind","Topbar","items","target","module","Sidebar","mode","NavigationRegionMode","Override","feature"],"mappings":";;;AAAA;AACA;AAKA,8GACO,MAAMA,cAAAA,GAAiB;AAE9B;;;AAGC,IACM,MAAMC,iBAAAA,GAA2C,CAAA,IAAA;AAEpD,IAAA,MAAMC,IAAAA,GAAa;QAAEC,EAAAA,EAAIH,cAAAA;QAAgBI,IAAAA,EAAM,UAAA;AAAYC,QAAAA,QAAAA,EAAU,EAAe,CAAA;IACpF,KAAK,MAAMC,UAAUC,yBAAAA,CAA2B;AAC5C,QAAA,IAAIC,MAAAA,GAASN,IAAAA;QACb,KAAK,MAAMC,EAAAA,IAAMG,MAAAA,CAAOF,IAAI,CAACK,KAAK,CAAC,GAAA,CAAA,CAAKC,KAAK,CAAC,CAAA,CAAA,CAAI;YAC9C,IAAIC,IAAAA,GAAOH,MAAAA,CAAOH,QAAQ,CAACO,IAAI,CAACC,CAAAA,SAAAA,GAAaA,SAAAA,CAAUV,EAAE,KAAKA,EAAAA,CAAAA;AAC9D,YAAA,IAAI,CAACQ,IAAAA,EAAM;gBACPA,IAAAA,GAAO;AAAER,oBAAAA,EAAAA;AAAIC,oBAAAA,IAAAA,EAAME,OAAOQ,KAAK;AAAET,oBAAAA,QAAAA,EAAU,EAAE;AAAEU,oBAAAA,MAAAA,EAAQ;AAAG,iBAAA;gBAC1DP,MAAAA,CAAOH,QAAQ,CAACW,IAAI,CAACL,IAAAA,CAAAA;AACzB,YAAA;YACAH,MAAAA,GAASG,IAAAA;AACb,QAAA;AACJ,IAAA;IAEA,OAAO;QAAEM,OAAAA,EAAS;AAAC,YAAA;AAAEd,gBAAAA,EAAAA,EAAID,KAAKC,EAAE;AAAEC,gBAAAA,IAAAA,EAAMF,KAAKE,IAAI;AAAEC,gBAAAA,QAAAA,EAAUH,KAAKG;AAAS;AAAE;AAAC,KAAA;AAClF,CAAA;AAEA;;;UAIaa,kBAAAA,GAAsC;IAC/CC,WAAAA,EAAa;QACTC,IAAAA,EAAM;YAAEC,KAAAA,EAAO,EAAA;YAAIP,KAAAA,EAAO;AAAW,SAAA;QACrCQ,OAAAA,EAAS;AAAC,YAAA;AAAEC,gBAAAA,MAAAA,EAAQC,qBAAqBC,MAAM;gBAAEC,KAAAA,EAAO;AAAC,oBAAA;wBAAEvB,EAAAA,EAAI,UAAA;wBAAYW,KAAAA,EAAO,UAAA;wBAAYa,MAAAA,EAAQ;4BAAEC,MAAAA,EAAQ5B;AAAe;AAAE;AAAE;AAAC;AAAE;AAC1I,KAAA;IACAiB,OAAAA,EAAS;AAAC,QAAA;YACNW,MAAAA,EAAQ5B,cAAAA;YACRsB,OAAAA,EAAS;AAAC,gBAAA;AACNC,oBAAAA,MAAAA,EAAQC,qBAAqBK,OAAO;AACpCC,oBAAAA,IAAAA,EAAMC,qBAAqBC,QAAQ;oBACnCN,KAAAA,EAAO;AACH,wBAAA;4BAAEvB,EAAAA,EAAI,UAAA;4BAAYW,KAAAA,EAAO,UAAA;4BAAYa,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,cAAAA;gCAAgBiC,OAAAA,EAAS;AAAW;AAAE,yBAAA;AAC7F,wBAAA;4BAAE9B,EAAAA,EAAI,MAAA;4BAAQW,KAAAA,EAAO,UAAA;4BAAYa,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,cAAAA;gCAAgBiC,OAAAA,EAAS;AAAO;AAAE,yBAAA;AACrF,wBAAA;4BAAE9B,EAAAA,EAAI,WAAA;4BAAaW,KAAAA,EAAO,WAAA;4BAAaa,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,cAAAA;gCAAgBiC,OAAAA,EAAS;AAAY;AAAE,yBAAA;AAChG,wBAAA;4BAAE9B,EAAAA,EAAI,KAAA;4BAAOW,KAAAA,EAAO,aAAA;4BAAea,MAAAA,EAAQ;gCAAEC,MAAAA,EAAQ5B,cAAAA;gCAAgBiC,OAAAA,EAAS;AAAM;AAAE;AACzF;AACL;AAAE;AACN;AAAE;AACN;;"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,2 @@
1
+ export declare const bookingsBlueprintName = "Cratis.Blueprint.Bookings";
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,qBAAqB,8BAA8B,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 bookingsBlueprintName = 'Cratis.Blueprint.Bookings';
4
+
5
+ export { bookingsBlueprintName };
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 bookingsBlueprintName = 'Cratis.Blueprint.Bookings';\n"],"names":["bookingsBlueprintName"],"mappings":"AAAA;AACA;AAEA,iHACO,MAAMA,qBAAAA,GAAwB;;"}
@@ -0,0 +1,3 @@
1
+ import { Screen } from '@cratis/scene.model';
2
+ export declare const bookingsScreens: 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,eAAe,EAAE,MAAM,EAQjC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { LayoutName } from '@cratis/scene.blueprint.default';
2
+ import { bookingsScreenDefinitions } from '../bookingsScreenSet.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 (`bookingsNavigation`).
9
+ */ const bookingsScreens = bookingsScreenDefinitions.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 { bookingsScreens };
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 { bookingsScreenDefinitions } from '../bookingsScreenSet';\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 (`bookingsNavigation`).\n */\nexport const bookingsScreens: Screen[] = bookingsScreenDefinitions.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":["bookingsScreens","bookingsScreenDefinitions","map","definition","name","layout","LayoutName","AppShell","screenTemplate","template","slotContent","forms","contributions","path","split"],"mappings":";;;AAAA;AACA;AAMA;;;UAIaA,eAAAA,GAA4BC,yBAAAA,CAA0BC,GAAG,CAACC,CAAAA,cAAe;AAClFC,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 bookingsTemplateProvenance: 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,0BAA0B,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAQzH,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 bookingsTemplateProvenance = {
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.bookings'
16
+ },
17
+ license: 'MIT',
18
+ licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
19
+ };
20
+
21
+ export { bookingsTemplateProvenance };
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 bookingsTemplateProvenance: 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.bookings' },\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n"],"names":["bookingsTemplateProvenance","compatibility","scene","packages","name","versionRange","attribution","author","url","license","licenseUrl"],"mappings":"AAAA;AACA;AAIA,wGACO,MAAMA,0BAAAA,GAAiH;IAC1HC,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;AAAiF,KAAA;IACvHC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;;"}
@@ -0,0 +1,3 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const bookingsCalendarTemplate: ScreenTemplate;
3
+ //# sourceMappingURL=calendarTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendarTemplate.d.ts","sourceRoot":"","sources":["../../../templates/calendarTemplate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiC,MAAM,qBAAqB,CAAC;AAiDpF,eAAO,MAAM,wBAAwB,gBAInC,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { WidthSizeClass, TemplateScope } from '@cratis/scene.model';
2
+ import { component, column, slotLeaf, grid } from '@cratis/scene.blueprint.default';
3
+ import { localeOfData, fromQuery, BookingsQuery } from '../bookingsQueries.js';
4
+ import { bookingsMetadata, withBehaviors, opensDialog, goesTo, actionButton } from '../bookingsParts.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 calendar: the foundation's `calendarGrid` on a month, a week or as an agenda. The status is told in words as well as by color, the day and view are kept in the
10
+ * address so a link shares the calendar as it is, and the list beside it names everything in the period.
11
+ */ function calendarOf(options) {
12
+ const id = options.name;
13
+ return {
14
+ name: options.name,
15
+ fitsSlot: 'content',
16
+ slots: [
17
+ {
18
+ name: 'header'
19
+ },
20
+ {
21
+ name: 'calendar'
22
+ },
23
+ {
24
+ name: 'due'
25
+ }
26
+ ],
27
+ arrangement: {
28
+ root: column([
29
+ slotLeaf('header'),
30
+ grid([
31
+ slotLeaf('calendar', {
32
+ span: 2
33
+ }),
34
+ slotLeaf('due')
35
+ ], 3, 16)
36
+ ], 16),
37
+ overrides: [
38
+ {
39
+ width: WidthSizeClass.Compact,
40
+ root: column([
41
+ slotLeaf('header'),
42
+ slotLeaf('calendar'),
43
+ slotLeaf('due')
44
+ ], 16)
45
+ }
46
+ ]
47
+ },
48
+ content: {
49
+ header: [
50
+ component(`${id}-header`, 'pageHeader', {
51
+ title: options.title,
52
+ subtitle: options.subtitle
53
+ }, {
54
+ actions: options.actions.map((action)=>withBehaviors(actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? opensDialog(action.dialog) : goesTo(action.screen)))
55
+ })
56
+ ],
57
+ calendar: [
58
+ component(`${id}-grid`, 'calendarGrid', {
59
+ label: options.label,
60
+ events: fromQuery(options.events),
61
+ date: fromQuery(BookingsQuery.Settings, '0.today'),
62
+ urlKey: 'day',
63
+ ...localeOfData
64
+ })
65
+ ],
66
+ due: [
67
+ component(`${id}-list`, 'dataList', {
68
+ label: options.listLabel,
69
+ rows: fromQuery(options.events),
70
+ columns: fromQuery(options.columns),
71
+ titleField: options.titleField,
72
+ pageSize: 6,
73
+ ...localeOfData
74
+ })
75
+ ]
76
+ },
77
+ displayName: options.displayName,
78
+ description: options.description,
79
+ metadata: bookingsMetadata(options.name, 'Calendar', [
80
+ TemplateScope.Module,
81
+ TemplateScope.Feature
82
+ ])
83
+ };
84
+ }
85
+ /** The bookings calendar: each booking on its day on a month, a week or an agenda; the status is told in words as well as by color, and the list beside it names every booking in the period. */ const bookingsCalendarTemplate = calendarOf({
86
+ name: 'BookingsCalendar',
87
+ displayName: 'Bookings calendar',
88
+ description: 'Every booking on the day it falls, on a month, a week or as an agenda, with the status told in words.',
89
+ title: 'Calendar',
90
+ subtitle: 'Who has what, and when',
91
+ label: 'Bookings',
92
+ listLabel: 'Bookings in this period',
93
+ events: BookingsQuery.BookingEvents,
94
+ columns: BookingsQuery.BookingEventColumns,
95
+ titleField: 'title',
96
+ actions: [
97
+ {
98
+ id: 'book',
99
+ label: 'Book a resource',
100
+ emphasis: 'primary',
101
+ screen: 'bookings.new'
102
+ }
103
+ ]
104
+ });
105
+
106
+ export { bookingsCalendarTemplate };
107
+ //# sourceMappingURL=calendarTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendarTemplate.js","sources":["../../../templates/calendarTemplate.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 { BookingsQuery, fromQuery, localeOfData } from '../bookingsQueries';\nimport { actionButton, component, goesTo, bookingsMetadata, opensDialog, withBehaviors } from '../bookingsParts';\n\ninterface Action { id: string; label: string; emphasis: 'primary' | 'secondary' | 'quiet' | 'danger'; dialog?: string; screen?: string }\n\ninterface CalendarOptions {\n name: string;\n displayName: string;\n description: string;\n title: string;\n subtitle: string;\n label: string;\n listLabel: string;\n events: string;\n columns: string;\n titleField: string;\n actions: Action[];\n}\n\n/**\n * One calendar: the foundation's `calendarGrid` on a month, a week or as an agenda. The status is told in words as well as by color, the day and view are kept in the\n * address so a link shares the calendar as it is, and the list beside it names everything in the period.\n */\nfunction calendarOf(options: CalendarOptions): ScreenTemplate {\n const id = options.name;\n return {\n name: options.name,\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(`${id}-header`, 'pageHeader', { title: options.title, subtitle: options.subtitle }, {\n actions: options.actions.map(action => withBehaviors(actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? opensDialog(action.dialog) : goesTo(action.screen!))),\n })],\n calendar: [component(`${id}-grid`, 'calendarGrid', { label: options.label, events: fromQuery(options.events), date: fromQuery(BookingsQuery.Settings, '0.today'), urlKey: 'day', ...localeOfData })],\n due: [component(`${id}-list`, 'dataList', { label: options.listLabel, rows: fromQuery(options.events), columns: fromQuery(options.columns), titleField: options.titleField, pageSize: 6, ...localeOfData })],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: bookingsMetadata(options.name, 'Calendar', [TemplateScope.Module, TemplateScope.Feature]),\n };\n}\n\n/** The bookings calendar: each booking on its day on a month, a week or an agenda; the status is told in words as well as by color, and the list beside it names every booking in the period. */\nexport const bookingsCalendarTemplate = calendarOf({\n name: 'BookingsCalendar', displayName: 'Bookings calendar', description: 'Every booking on the day it falls, on a month, a week or as an agenda, with the status told in words.', title: 'Calendar', subtitle: 'Who has what, and when', label: 'Bookings', listLabel: 'Bookings in this period',\n events: BookingsQuery.BookingEvents, columns: BookingsQuery.BookingEventColumns, titleField: 'title',\n actions: [{ id: 'book', label: 'Book a resource', emphasis: 'primary', screen: 'bookings.new' }],\n});\n"],"names":["calendarOf","options","id","name","fitsSlot","slots","arrangement","root","column","slotLeaf","grid","span","overrides","width","WidthSizeClass","Compact","content","header","component","title","subtitle","actions","map","action","withBehaviors","actionButton","label","emphasis","dialog","opensDialog","goesTo","screen","calendar","events","fromQuery","date","BookingsQuery","Settings","urlKey","localeOfData","due","listLabel","rows","columns","titleField","pageSize","displayName","description","metadata","bookingsMetadata","TemplateScope","Module","Feature","bookingsCalendarTemplate","BookingEvents","BookingEventColumns"],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import { DialogTemplate } from '@cratis/scene.model';
2
+ export declare const bookingsDialogs: 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,eAAe,EAAE,cAAc,EAE3C,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, BookingsQuery } from '../bookingsQueries.js';
4
+ import { bookingsMetadata, withBehaviors, closesDialog } from '../bookingsParts.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, submit) {
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: submit
28
+ },
29
+ sections: fromQuery(sections),
30
+ errors: fromQuery(BookingsQuery.FormErrors, '0'),
31
+ ...localeOfData
32
+ }), closesDialog())
33
+ ],
34
+ actions: []
35
+ },
36
+ displayName: `Bookings quick create ${noun}`,
37
+ description: `A short form that creates one ${noun} without leaving the page.`,
38
+ metadata: bookingsMetadata(name, 'Dialog', [
39
+ TemplateScope.Slice
40
+ ])
41
+ };
42
+ }
43
+ /** The quick dialogs of the blueprint. */ const bookingsDialogs = [
44
+ quickCreateOf('BookingsQuickCreateBooking', 'Quick booking', 'BookingQuickSections', 'booking', 'Book')
45
+ ];
46
+
47
+ export { bookingsDialogs };
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 { BookingsQuery, fromQuery, localeOfData } from '../bookingsQueries';\nimport { closesDialog, component, bookingsMetadata, withBehaviors } from '../bookingsParts';\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, submit: 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: submit }, sections: fromQuery(sections), errors: fromQuery(BookingsQuery.FormErrors, '0'), ...localeOfData,\n }), closesDialog())],\n actions: [],\n },\n displayName: `Bookings quick create ${noun}`,\n description: `A short form that creates one ${noun} without leaving the page.`,\n metadata: bookingsMetadata(name, 'Dialog', [TemplateScope.Slice]),\n };\n}\n\n/** The quick dialogs of the blueprint. */\nexport const bookingsDialogs: DialogTemplate[] = [\n quickCreateOf('BookingsQuickCreateBooking', 'Quick booking', 'BookingQuickSections', 'booking', 'Book'),\n];\n"],"names":["quickCreateOf","name","title","sections","noun","submit","slots","quickCreateDialogTemplate","content","header","component","subtitle","body","withBehaviors","mode","saveAndNew","strings","formSave","fromQuery","errors","BookingsQuery","FormErrors","localeOfData","closesDialog","actions","displayName","description","metadata","bookingsMetadata","TemplateScope","Slice","bookingsDialogs"],"mappings":";;;;;AAAA;AACA;AAOA;;;IAIA,SAASA,aAAAA,CAAcC,IAAY,EAAEC,KAAa,EAAEC,QAAgB,EAAEC,IAAY,EAAEC,MAAc,EAAA;IAC9F,OAAO;AACHJ,QAAAA,IAAAA;AACAK,QAAAA,KAAAA,EAAOC,0BAA0BD,KAAK;QACtCE,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,SAAAA,CAAU,CAAA,EAAGT,IAAAA,CAAK,MAAM,CAAC,EAAE,aAAA,EAAe;AAAEC,oBAAAA,KAAAA;oBAAOS,QAAAA,EAAU;AAAqC,iBAAA;AAAG,aAAA;YAC9GC,IAAAA,EAAM;AAACC,gBAAAA,aAAAA,CAAcH,UAAU,CAAA,EAAGT,IAAAA,CAAK,KAAK,CAAC,EAAE,gBAAA,EAAkB;oBAC7Da,IAAAA,EAAM,QAAA;oBAAUC,UAAAA,EAAY,KAAA;oBAAOC,OAAAA,EAAS;wBAAEC,QAAAA,EAAUZ;AAAO,qBAAA;AAAGF,oBAAAA,QAAAA,EAAUe,SAAAA,CAAUf,QAAAA,CAAAA;oBAAWgB,MAAAA,EAAQD,SAAAA,CAAUE,aAAAA,CAAcC,UAAU,EAAE,GAAA,CAAA;AAAM,oBAAA,GAAGC;iBAC1J,CAAA,EAAIC,YAAAA,EAAAA;AAAgB,aAAA;AACpBC,YAAAA,OAAAA,EAAS;AACb,SAAA;QACAC,WAAAA,EAAa,CAAC,sBAAsB,EAAErB,IAAAA,CAAAA,CAAM;AAC5CsB,QAAAA,WAAAA,EAAa,CAAC,8BAA8B,EAAEtB,IAAAA,CAAK,0BAA0B,CAAC;QAC9EuB,QAAAA,EAAUC,gBAAAA,CAAiB3B,MAAM,QAAA,EAAU;AAAC4B,YAAAA,aAAAA,CAAcC;AAAM,SAAA;AACpE,KAAA;AACJ;AAEA,2CACO,MAAMC,eAAAA,GAAoC;IAC7C/B,aAAAA,CAAc,4BAAA,EAA8B,eAAA,EAAiB,sBAAA,EAAwB,SAAA,EAAW,MAAA;;;"}
@@ -0,0 +1,8 @@
1
+ export * from './calendarTemplate';
2
+ export * from './listTemplates';
3
+ export * from './recordTemplates';
4
+ export * from './wizardTemplate';
5
+ export * from './formTemplates';
6
+ export declare const bookingsScreenTemplates: import("@cratis/scene.model/screens").ScreenTemplate[];
7
+ export { bookingsDialogs as bookingsDialogTemplates } 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":"AAQA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAGhC,eAAO,MAAM,uBAAuB,wDAAyH,CAAC;AAE9J,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { bookingsCalendarTemplate } from './calendarTemplate.js';
2
+ import { bookingsListTemplate, resourcesListTemplate } from './listTemplates.js';
3
+ import { bookingPageTemplate } from './recordTemplates.js';
4
+ import { newBookingWizardTemplate } from './wizardTemplate.js';
5
+ export { bookingsDialogs as bookingsDialogTemplates, bookingsDialogs } from './formTemplates.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
+ /** Every screen template this blueprint provides, in the order the manifest lists them. */ const bookingsScreenTemplates = [
10
+ bookingsCalendarTemplate,
11
+ bookingsListTemplate,
12
+ bookingPageTemplate,
13
+ resourcesListTemplate,
14
+ newBookingWizardTemplate
15
+ ];
16
+
17
+ export { bookingPageTemplate, bookingsCalendarTemplate, bookingsListTemplate, bookingsScreenTemplates, newBookingWizardTemplate, resourcesListTemplate };
18
+ //# 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 { bookingsCalendarTemplate } from './calendarTemplate';\nimport { bookingsListTemplate, resourcesListTemplate } from './listTemplates';\nimport { bookingPageTemplate } from './recordTemplates';\nimport { newBookingWizardTemplate } from './wizardTemplate';\n\nexport * from './calendarTemplate';\nexport * from './listTemplates';\nexport * from './recordTemplates';\nexport * from './wizardTemplate';\nexport * from './formTemplates';\n\n/** Every screen template this blueprint provides, in the order the manifest lists them. */\nexport const bookingsScreenTemplates = [bookingsCalendarTemplate, bookingsListTemplate, bookingPageTemplate, resourcesListTemplate, newBookingWizardTemplate];\n\nexport { bookingsDialogs as bookingsDialogTemplates } from './formTemplates';\n"],"names":["bookingsScreenTemplates","bookingsCalendarTemplate","bookingsListTemplate","bookingPageTemplate","resourcesListTemplate","newBookingWizardTemplate"],"mappings":";;;;;;AAAA;AACA;AAaA,4FACO,MAAMA,uBAAAA,GAA0B;AAACC,IAAAA,wBAAAA;AAA0BC,IAAAA,oBAAAA;AAAsBC,IAAAA,mBAAAA;AAAqBC,IAAAA,qBAAAA;AAAuBC,IAAAA;;;"}
@@ -0,0 +1,4 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export declare const bookingsListTemplate: ScreenTemplate;
3
+ export declare const resourcesListTemplate: ScreenTemplate;
4
+ //# 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;AAsFpJ,eAAO,MAAM,oBAAoB,gBAM/B,CAAC;AAGH,eAAO,MAAM,qBAAqB,gBAOhC,CAAC"}
@@ -0,0 +1,164 @@
1
+ import { TemplateScope, NotificationLevel, InteractionActionKind, InteractionTriggerKind } from '@cratis/scene.model';
2
+ import { component, listScreenTemplate } from '@cratis/scene.blueprint.default';
3
+ import { bookingsQueriesOf, localeOfData, fromQuery, BookingsEntityKind } from '../bookingsQueries.js';
4
+ import { withBehaviors, opensDialog, goesTo, actionButton, bookingsMetadata, opensRecordOnSelect, opensDialogOnSelect } from '../bookingsParts.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 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 = bookingsQueriesOf(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)) : options.recordDialog ? withBehaviors(list, opensDialogOnSelect(options.recordDialog)) : 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: bookingsMetadata(options.name, 'List', listScopes)
118
+ };
119
+ }
120
+ /** The bookings: every booking with its resource, who booked it, when and its status. Choosing a booking opens it. */ const bookingsListTemplate = listTemplateOf({
121
+ name: 'BookingsList',
122
+ entity: BookingsEntityKind.Booking,
123
+ displayName: 'Bookings list',
124
+ description: 'Every booking with its resource, who booked it, date and time and status, filtered by resource, status, person and date.',
125
+ title: 'Bookings',
126
+ subtitle: 'Everything that has been booked',
127
+ searchLabel: 'Search bookings',
128
+ urlKey: 'bookings',
129
+ primary: {
130
+ label: 'Quick booking',
131
+ dialog: 'BookingsQuickCreateBooking'
132
+ },
133
+ rowActions: [
134
+ 'Open',
135
+ 'Cancel booking'
136
+ ],
137
+ bulkActions: [],
138
+ titleField: 'reference',
139
+ recordScreen: 'bookings.record'
140
+ });
141
+ /** The resources: the rooms, equipment and vehicles that can be booked, as cards with their type, capacity, location and whether each is free. */ const resourcesListTemplate = listTemplateOf({
142
+ name: 'ResourcesList',
143
+ entity: BookingsEntityKind.Resource,
144
+ displayName: 'Resources list',
145
+ description: 'The rooms, equipment and vehicles that can be booked, with their capacity, location and whether each is free.',
146
+ title: 'Resources',
147
+ subtitle: 'What can be booked',
148
+ searchLabel: 'Search resources',
149
+ urlKey: 'resources',
150
+ primary: {
151
+ label: 'Book a resource',
152
+ screen: 'bookings.new'
153
+ },
154
+ rowActions: [
155
+ 'Book'
156
+ ],
157
+ bulkActions: [],
158
+ titleField: 'name',
159
+ readOnly: true,
160
+ cards: {}
161
+ });
162
+
163
+ export { bookingsListTemplate, resourcesListTemplate };
164
+ //# sourceMappingURL=listTemplates.js.map