@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.
- package/README.md +66 -2
- package/blueprint.ts +16 -0
- package/blueprintCatalog.json +123 -0
- package/bookingsApplication.ts +28 -0
- package/bookingsParts.ts +58 -0
- package/bookingsQueries.ts +60 -0
- package/bookingsScreenSet.ts +22 -0
- package/dist/cjs/blueprint.js +19 -0
- package/dist/cjs/blueprint.js.map +1 -0
- package/dist/cjs/bookingsApplication.js +49 -0
- package/dist/cjs/bookingsApplication.js.map +1 -0
- package/dist/cjs/bookingsParts.js +151 -0
- package/dist/cjs/bookingsParts.js.map +1 -0
- package/dist/cjs/bookingsQueries.js +68 -0
- package/dist/cjs/bookingsQueries.js.map +1 -0
- package/dist/cjs/bookingsScreenSet.js +47 -0
- package/dist/cjs/bookingsScreenSet.js.map +1 -0
- package/dist/cjs/index.js +69 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/manifest.js +90 -0
- package/dist/cjs/manifest.js.map +1 -0
- package/dist/cjs/navigation.js +117 -0
- package/dist/cjs/navigation.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/packageName.js +8 -0
- package/dist/cjs/packageName.js.map +1 -0
- package/dist/cjs/screens/index.js +22 -0
- package/dist/cjs/screens/index.js.map +1 -0
- package/dist/cjs/templateProvenance.js +24 -0
- package/dist/cjs/templateProvenance.js.map +1 -0
- package/dist/cjs/templates/calendarTemplate.js +109 -0
- package/dist/cjs/templates/calendarTemplate.js.map +1 -0
- package/dist/cjs/templates/formTemplates.js +50 -0
- package/dist/cjs/templates/formTemplates.js.map +1 -0
- package/dist/cjs/templates/index.js +27 -0
- package/dist/cjs/templates/index.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +167 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/recordTemplates.js +129 -0
- package/dist/cjs/templates/recordTemplates.js.map +1 -0
- package/dist/cjs/templates/wizardTemplate.js +73 -0
- package/dist/cjs/templates/wizardTemplate.js.map +1 -0
- package/dist/esm/blueprint.d.ts +3 -0
- package/dist/esm/blueprint.d.ts.map +1 -0
- package/dist/esm/blueprint.js +17 -0
- package/dist/esm/blueprint.js.map +1 -0
- package/dist/esm/bookingsApplication.d.ts +10 -0
- package/dist/esm/bookingsApplication.d.ts.map +1 -0
- package/dist/esm/bookingsApplication.js +44 -0
- package/dist/esm/bookingsApplication.js.map +1 -0
- package/dist/esm/bookingsParts.d.ts +16 -0
- package/dist/esm/bookingsParts.d.ts.map +1 -0
- package/dist/esm/bookingsParts.js +133 -0
- package/dist/esm/bookingsParts.js.map +1 -0
- package/dist/esm/bookingsQueries.d.ts +41 -0
- package/dist/esm/bookingsQueries.d.ts.map +1 -0
- package/dist/esm/bookingsQueries.js +60 -0
- package/dist/esm/bookingsQueries.js.map +1 -0
- package/dist/esm/bookingsScreenSet.d.ts +7 -0
- package/dist/esm/bookingsScreenSet.d.ts.map +1 -0
- package/dist/esm/bookingsScreenSet.js +45 -0
- package/dist/esm/bookingsScreenSet.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/manifest.d.ts +3 -0
- package/dist/esm/manifest.d.ts.map +1 -0
- package/dist/esm/manifest.js +88 -0
- package/dist/esm/manifest.js.map +1 -0
- package/dist/esm/navigation.d.ts +5 -0
- package/dist/esm/navigation.d.ts.map +1 -0
- package/dist/esm/navigation.js +113 -0
- package/dist/esm/navigation.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/packageName.d.ts +2 -0
- package/dist/esm/packageName.d.ts.map +1 -0
- package/dist/esm/packageName.js +6 -0
- package/dist/esm/packageName.js.map +1 -0
- package/dist/esm/screens/index.d.ts +3 -0
- package/dist/esm/screens/index.d.ts.map +1 -0
- package/dist/esm/screens/index.js +20 -0
- package/dist/esm/screens/index.js.map +1 -0
- package/dist/esm/templateProvenance.d.ts +3 -0
- package/dist/esm/templateProvenance.d.ts.map +1 -0
- package/dist/esm/templateProvenance.js +22 -0
- package/dist/esm/templateProvenance.js.map +1 -0
- package/dist/esm/templates/calendarTemplate.d.ts +3 -0
- package/dist/esm/templates/calendarTemplate.d.ts.map +1 -0
- package/dist/esm/templates/calendarTemplate.js +107 -0
- package/dist/esm/templates/calendarTemplate.js.map +1 -0
- package/dist/esm/templates/formTemplates.d.ts +3 -0
- package/dist/esm/templates/formTemplates.d.ts.map +1 -0
- package/dist/esm/templates/formTemplates.js +48 -0
- package/dist/esm/templates/formTemplates.js.map +1 -0
- package/dist/esm/templates/index.d.ts +8 -0
- package/dist/esm/templates/index.d.ts.map +1 -0
- package/dist/esm/templates/index.js +18 -0
- package/dist/esm/templates/index.js.map +1 -0
- package/dist/esm/templates/listTemplates.d.ts +4 -0
- package/dist/esm/templates/listTemplates.d.ts.map +1 -0
- package/dist/esm/templates/listTemplates.js +164 -0
- package/dist/esm/templates/listTemplates.js.map +1 -0
- package/dist/esm/templates/recordTemplates.d.ts +3 -0
- package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
- package/dist/esm/templates/recordTemplates.js +127 -0
- package/dist/esm/templates/recordTemplates.js.map +1 -0
- package/dist/esm/templates/wizardTemplate.d.ts +3 -0
- package/dist/esm/templates/wizardTemplate.d.ts.map +1 -0
- package/dist/esm/templates/wizardTemplate.js +71 -0
- package/dist/esm/templates/wizardTemplate.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/index.ts +14 -0
- package/manifest.ts +41 -0
- package/navigation.ts +54 -0
- package/package.json +78 -4
- package/packageName.ts +5 -0
- package/sampleData/bookings-en.json +1057 -0
- package/screens/index.ts +20 -0
- package/templateProvenance.ts +15 -0
- package/templates/calendarTemplate.ts +57 -0
- package/templates/formTemplates.ts +33 -0
- package/templates/index.ts +18 -0
- package/templates/listTemplates.ts +106 -0
- package/templates/recordTemplates.ts +78 -0
- package/templates/wizardTemplate.ts +29 -0
- package/thumbnails/BookingPage.svg +17 -0
- package/thumbnails/BookingsCalendar.svg +34 -0
- package/thumbnails/BookingsList.svg +29 -0
- package/thumbnails/BookingsQuickCreateBooking.svg +12 -0
- package/thumbnails/NewBookingWizard.svg +15 -0
- package/thumbnails/ResourcesList.svg +29 -0
- package/thumbnails/bookings.svg +14 -0
|
@@ -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":";;;;;;;AAAA;AACA;AAuBA;;;IAIA,SAASA,WAAWC,OAAwB,EAAA;IACxC,MAAMC,EAAAA,GAAKD,QAAQE,IAAI;IACvB,OAAO;AACHA,QAAAA,IAA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,GAA2BrD,UAAAA,CAAW;IAC/CG,IAAAA,EAAM,kBAAA;IAAoB2C,WAAAA,EAAa,mBAAA;IAAqBC,WAAAA,EAAa,uGAAA;IAAyG5B,KAAAA,EAAO,UAAA;IAAYC,QAAAA,EAAU,wBAAA;IAA0BM,KAAAA,EAAO,UAAA;IAAYe,SAAAA,EAAW,yBAAA;AACvQR,IAAAA,MAAAA,EAAQG,8BAAckB,aAAa;AAAEX,IAAAA,OAAAA,EAASP,8BAAcmB,mBAAmB;IAAEX,UAAAA,EAAY,OAAA;IAC7FvB,OAAAA,EAAS;AAAC,QAAA;YAAEnB,EAAAA,EAAI,MAAA;YAAQwB,KAAAA,EAAO,iBAAA;YAAmBC,QAAAA,EAAU,SAAA;YAAWI,MAAAA,EAAQ;AAAe;AAAE;AACpG,CAAA;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var bookingsQueries = require('../bookingsQueries.js');
|
|
6
|
+
var bookingsParts = require('../bookingsParts.js');
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
/**
|
|
11
|
+
* One quick-create dialog: the foundation `QuickCreateDialog` - a short form opened from a page to make one record without leaving it - with the fields
|
|
12
|
+
* that thing needs to get started.
|
|
13
|
+
*/ function quickCreateOf(name, title, sections, noun, submit) {
|
|
14
|
+
return {
|
|
15
|
+
name,
|
|
16
|
+
slots: scene_blueprint_default.quickCreateDialogTemplate.slots,
|
|
17
|
+
content: {
|
|
18
|
+
header: [
|
|
19
|
+
scene_blueprint_default.component(`${name}-frame`, 'dialogFrame', {
|
|
20
|
+
title,
|
|
21
|
+
subtitle: 'Only what is needed to get started'
|
|
22
|
+
})
|
|
23
|
+
],
|
|
24
|
+
body: [
|
|
25
|
+
bookingsParts.withBehaviors(scene_blueprint_default.component(`${name}-form`, 'formScreenBody', {
|
|
26
|
+
mode: 'create',
|
|
27
|
+
saveAndNew: false,
|
|
28
|
+
strings: {
|
|
29
|
+
formSave: submit
|
|
30
|
+
},
|
|
31
|
+
sections: bookingsQueries.fromQuery(sections),
|
|
32
|
+
errors: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.FormErrors, '0'),
|
|
33
|
+
...bookingsQueries.localeOfData
|
|
34
|
+
}), bookingsParts.closesDialog())
|
|
35
|
+
],
|
|
36
|
+
actions: []
|
|
37
|
+
},
|
|
38
|
+
displayName: `Bookings quick create ${noun}`,
|
|
39
|
+
description: `A short form that creates one ${noun} without leaving the page.`,
|
|
40
|
+
metadata: bookingsParts.bookingsMetadata(name, 'Dialog', [
|
|
41
|
+
scene_model.TemplateScope.Slice
|
|
42
|
+
])
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** The quick dialogs of the blueprint. */ const bookingsDialogs = [
|
|
46
|
+
quickCreateOf('BookingsQuickCreateBooking', 'Quick booking', 'BookingQuickSections', 'booking', 'Book')
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
exports.bookingsDialogs = bookingsDialogs;
|
|
50
|
+
//# 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,kDAA0BD,KAAK;QACtCE,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,iCAAAA,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,2BAAAA,CAAcH,kCAAU,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,yBAAAA,CAAUf,QAAAA,CAAAA;oBAAWgB,MAAAA,EAAQD,yBAAAA,CAAUE,6BAAAA,CAAcC,UAAU,EAAE,GAAA,CAAA;AAAM,oBAAA,GAAGC;iBAC1J,CAAA,EAAIC,0BAAAA,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,8BAAAA,CAAiB3B,MAAM,QAAA,EAAU;AAAC4B,YAAAA,yBAAAA,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,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var calendarTemplate = require('./calendarTemplate.js');
|
|
4
|
+
var listTemplates = require('./listTemplates.js');
|
|
5
|
+
var recordTemplates = require('./recordTemplates.js');
|
|
6
|
+
var wizardTemplate = require('./wizardTemplate.js');
|
|
7
|
+
var formTemplates = require('./formTemplates.js');
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
10
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
11
|
+
/** Every screen template this blueprint provides, in the order the manifest lists them. */ const bookingsScreenTemplates = [
|
|
12
|
+
calendarTemplate.bookingsCalendarTemplate,
|
|
13
|
+
listTemplates.bookingsListTemplate,
|
|
14
|
+
recordTemplates.bookingPageTemplate,
|
|
15
|
+
listTemplates.resourcesListTemplate,
|
|
16
|
+
wizardTemplate.newBookingWizardTemplate
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
exports.bookingsCalendarTemplate = calendarTemplate.bookingsCalendarTemplate;
|
|
20
|
+
exports.bookingsListTemplate = listTemplates.bookingsListTemplate;
|
|
21
|
+
exports.resourcesListTemplate = listTemplates.resourcesListTemplate;
|
|
22
|
+
exports.bookingPageTemplate = recordTemplates.bookingPageTemplate;
|
|
23
|
+
exports.newBookingWizardTemplate = wizardTemplate.newBookingWizardTemplate;
|
|
24
|
+
exports.bookingsDialogTemplates = formTemplates.bookingsDialogs;
|
|
25
|
+
exports.bookingsDialogs = formTemplates.bookingsDialogs;
|
|
26
|
+
exports.bookingsScreenTemplates = bookingsScreenTemplates;
|
|
27
|
+
//# 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,yCAAAA;AAA0BC,IAAAA,kCAAAA;AAAsBC,IAAAA,mCAAAA;AAAqBC,IAAAA,mCAAAA;AAAuBC,IAAAA;;;;;;;;;;"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var bookingsQueries = require('../bookingsQueries.js');
|
|
6
|
+
var bookingsParts = require('../bookingsParts.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
|
+
const listScopes = [
|
|
11
|
+
scene_model.TemplateScope.Module,
|
|
12
|
+
scene_model.TemplateScope.Feature
|
|
13
|
+
];
|
|
14
|
+
/** 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)=>bookingsParts.withBehaviors(bookingsParts.actionButton(id, 'Export', 'secondary'), [
|
|
15
|
+
{
|
|
16
|
+
bindings: [
|
|
17
|
+
{
|
|
18
|
+
trigger: {
|
|
19
|
+
kind: scene_model.InteractionTriggerKind.Click
|
|
20
|
+
},
|
|
21
|
+
actions: [
|
|
22
|
+
{
|
|
23
|
+
kind: scene_model.InteractionActionKind.Notify,
|
|
24
|
+
level: scene_model.NotificationLevel.Info,
|
|
25
|
+
message: {
|
|
26
|
+
text: 'The export has started.'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]);
|
|
34
|
+
/**
|
|
35
|
+
* One list: the foundation `ListScreen` with its header, toolbar, filters, list and bulk bar filled for an entity. The slots, arrangement and
|
|
36
|
+
* every behavior - sort, search, paging and selection in the address, the table collapsing to cards on a phone - are the foundation's.
|
|
37
|
+
*/ function listTemplateOf(options) {
|
|
38
|
+
const queries = bookingsQueries.bookingsQueriesOf(options.entity);
|
|
39
|
+
const id = options.name;
|
|
40
|
+
const listId = `${id}-records`;
|
|
41
|
+
const primary = bookingsParts.withBehaviors(bookingsParts.actionButton(`${id}-primary`, options.primary.label, 'primary'), options.primary.dialog ? bookingsParts.opensDialog(options.primary.dialog) : bookingsParts.goesTo(options.primary.screen));
|
|
42
|
+
const list = scene_blueprint_default.component(listId, 'dataList', {
|
|
43
|
+
label: options.title,
|
|
44
|
+
rows: bookingsQueries.fromQuery(queries.rows),
|
|
45
|
+
columns: bookingsQueries.fromQuery(queries.columns),
|
|
46
|
+
titleField: options.titleField,
|
|
47
|
+
pageSize: options.cards ? 12 : 10,
|
|
48
|
+
urlKey: options.urlKey,
|
|
49
|
+
...bookingsQueries.localeOfData,
|
|
50
|
+
rowActions: options.rowActions,
|
|
51
|
+
...options.readOnly ? {} : {
|
|
52
|
+
selectionMode: options.recordScreen || options.recordDialog ? 'single' : 'multiple'
|
|
53
|
+
},
|
|
54
|
+
...options.cards ? {
|
|
55
|
+
variant: 'cards',
|
|
56
|
+
...options.cards.imageField ? {
|
|
57
|
+
imageField: options.cards.imageField
|
|
58
|
+
} : {}
|
|
59
|
+
} : {},
|
|
60
|
+
...options.grouped ? {
|
|
61
|
+
variant: 'grouped',
|
|
62
|
+
groupBy: options.grouped.groupBy
|
|
63
|
+
} : {},
|
|
64
|
+
...options.toneField ? {
|
|
65
|
+
toneField: options.toneField
|
|
66
|
+
} : {}
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
name: options.name,
|
|
70
|
+
fitsSlot: 'content',
|
|
71
|
+
slots: scene_blueprint_default.listScreenTemplate.slots,
|
|
72
|
+
arrangement: scene_blueprint_default.listScreenTemplate.arrangement,
|
|
73
|
+
content: {
|
|
74
|
+
header: [
|
|
75
|
+
scene_blueprint_default.component(`${id}-header`, 'pageHeader', {
|
|
76
|
+
title: options.title,
|
|
77
|
+
subtitle: options.subtitle
|
|
78
|
+
}, {
|
|
79
|
+
actions: [
|
|
80
|
+
exportAction(`${id}-export`),
|
|
81
|
+
primary
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
],
|
|
85
|
+
toolbar: [
|
|
86
|
+
scene_blueprint_default.component(`${id}-search`, 'globalSearch', {
|
|
87
|
+
placeholder: options.searchLabel,
|
|
88
|
+
label: options.searchLabel,
|
|
89
|
+
urlKey: `${options.urlKey}q`
|
|
90
|
+
}),
|
|
91
|
+
scene_blueprint_default.component(`${id}-views`, 'savedViewsMenu', {
|
|
92
|
+
views: bookingsQueries.fromQuery(queries.views),
|
|
93
|
+
savePermission: 'enabled',
|
|
94
|
+
managePermission: 'enabled'
|
|
95
|
+
}),
|
|
96
|
+
scene_blueprint_default.component(`${id}-columns`, 'columnChooser', {
|
|
97
|
+
columns: bookingsQueries.fromQuery(queries.columnChoices)
|
|
98
|
+
})
|
|
99
|
+
],
|
|
100
|
+
filters: [
|
|
101
|
+
scene_blueprint_default.component(`${id}-filter`, 'filterBuilder', {
|
|
102
|
+
fields: bookingsQueries.fromQuery(queries.filterFields),
|
|
103
|
+
...bookingsQueries.localeOfData
|
|
104
|
+
})
|
|
105
|
+
],
|
|
106
|
+
list: [
|
|
107
|
+
options.recordScreen ? bookingsParts.withBehaviors(list, bookingsParts.opensRecordOnSelect(listId, options.recordScreen)) : options.recordDialog ? bookingsParts.withBehaviors(list, bookingsParts.opensDialogOnSelect(options.recordDialog)) : list
|
|
108
|
+
],
|
|
109
|
+
bulkBar: options.recordScreen || options.recordDialog || options.readOnly ? [] : [
|
|
110
|
+
scene_blueprint_default.component(`${id}-bulk`, 'bulkBar', {
|
|
111
|
+
selection: bookingsQueries.fromQuery(queries.selection),
|
|
112
|
+
actions: options.bulkActions
|
|
113
|
+
})
|
|
114
|
+
],
|
|
115
|
+
footer: []
|
|
116
|
+
},
|
|
117
|
+
displayName: options.displayName,
|
|
118
|
+
description: options.description,
|
|
119
|
+
metadata: bookingsParts.bookingsMetadata(options.name, 'List', listScopes)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/** The bookings: every booking with its resource, who booked it, when and its status. Choosing a booking opens it. */ const bookingsListTemplate = listTemplateOf({
|
|
123
|
+
name: 'BookingsList',
|
|
124
|
+
entity: bookingsQueries.BookingsEntityKind.Booking,
|
|
125
|
+
displayName: 'Bookings list',
|
|
126
|
+
description: 'Every booking with its resource, who booked it, date and time and status, filtered by resource, status, person and date.',
|
|
127
|
+
title: 'Bookings',
|
|
128
|
+
subtitle: 'Everything that has been booked',
|
|
129
|
+
searchLabel: 'Search bookings',
|
|
130
|
+
urlKey: 'bookings',
|
|
131
|
+
primary: {
|
|
132
|
+
label: 'Quick booking',
|
|
133
|
+
dialog: 'BookingsQuickCreateBooking'
|
|
134
|
+
},
|
|
135
|
+
rowActions: [
|
|
136
|
+
'Open',
|
|
137
|
+
'Cancel booking'
|
|
138
|
+
],
|
|
139
|
+
bulkActions: [],
|
|
140
|
+
titleField: 'reference',
|
|
141
|
+
recordScreen: 'bookings.record'
|
|
142
|
+
});
|
|
143
|
+
/** 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({
|
|
144
|
+
name: 'ResourcesList',
|
|
145
|
+
entity: bookingsQueries.BookingsEntityKind.Resource,
|
|
146
|
+
displayName: 'Resources list',
|
|
147
|
+
description: 'The rooms, equipment and vehicles that can be booked, with their capacity, location and whether each is free.',
|
|
148
|
+
title: 'Resources',
|
|
149
|
+
subtitle: 'What can be booked',
|
|
150
|
+
searchLabel: 'Search resources',
|
|
151
|
+
urlKey: 'resources',
|
|
152
|
+
primary: {
|
|
153
|
+
label: 'Book a resource',
|
|
154
|
+
screen: 'bookings.new'
|
|
155
|
+
},
|
|
156
|
+
rowActions: [
|
|
157
|
+
'Book'
|
|
158
|
+
],
|
|
159
|
+
bulkActions: [],
|
|
160
|
+
titleField: 'name',
|
|
161
|
+
readOnly: true,
|
|
162
|
+
cards: {}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
exports.bookingsListTemplate = bookingsListTemplate;
|
|
166
|
+
exports.resourcesListTemplate = resourcesListTemplate;
|
|
167
|
+
//# 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 { BookingsEntityKind, fromQuery, bookingsQueriesOf, localeOfData } from '../bookingsQueries';\nimport { actionButton, component, goesTo, bookingsMetadata, opensDialog, opensDialogOnSelect, opensRecordOnSelect, withBehaviors } from '../bookingsParts';\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: BookingsEntityKind;\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 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 = bookingsQueriesOf(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)) : options.recordDialog ? withBehaviors(list, opensDialogOnSelect(options.recordDialog)) : 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: bookingsMetadata(options.name, 'List', listScopes),\n };\n}\n\n\n/** The bookings: every booking with its resource, who booked it, when and its status. Choosing a booking opens it. */\nexport const bookingsListTemplate = listTemplateOf({\n name: 'BookingsList',\n entity: BookingsEntityKind.Booking, displayName: 'Bookings list', description: 'Every booking with its resource, who booked it, date and time and status, filtered by resource, status, person and date.', title: 'Bookings', subtitle: 'Everything that has been booked', searchLabel: 'Search bookings', urlKey: 'bookings',\n primary: { label: 'Quick booking', dialog: 'BookingsQuickCreateBooking' },\n rowActions: ['Open', 'Cancel booking'], bulkActions: [],\n titleField: 'reference', recordScreen: 'bookings.record'\n});\n\n/** The resources: the rooms, equipment and vehicles that can be booked, as cards with their type, capacity, location and whether each is free. */\nexport const resourcesListTemplate = listTemplateOf({\n name: 'ResourcesList',\n entity: BookingsEntityKind.Resource, displayName: 'Resources list', description: 'The rooms, equipment and vehicles that can be booked, with their capacity, location and whether each is free.', title: 'Resources', subtitle: 'What can be booked', searchLabel: 'Search resources', urlKey: 'resources',\n primary: { label: 'Book a resource', screen: 'bookings.new' },\n rowActions: ['Book'], bulkActions: [],\n titleField: 'name',\n readOnly: true, cards: {}\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","bookingsQueriesOf","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","opensDialogOnSelect","bulkBar","selection","bulkActions","footer","displayName","description","metadata","bookingsMetadata","bookingsListTemplate","BookingsEntityKind","Booking","resourcesListTemplate","Resource"],"mappings":";;;;;;;AAAA;AACA;AAOA,MAAMA,UAAAA,GAAa;AAACC,IAAAA,yBAAAA,CAAcC,MAAM;AAAED,IAAAA,yBAAAA,CAAcE;AAAQ,CAAA;AAEhE,gJACA,MAAMC,YAAAA,GAAe,CAACC,KAAeC,2BAAAA,CAAcC,0BAAAA,CAAaF,EAAAA,EAAI,QAAA,EAAU,WAAA,CAAA,EAAc;AAAC,QAAA;YACzFG,QAAAA,EAAU;AAAC,gBAAA;oBACPC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBC;AAAM,qBAAA;oBAC9CC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBC,MAAM;AAAEC,4BAAAA,KAAAA,EAAOC,8BAAkBC,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,iCAAAA,CAAkBF,OAAAA,CAAQG,MAAM,CAAA;IAChD,MAAMpB,EAAAA,GAAKiB,QAAQI,IAAI;AACvB,IAAA,MAAMC,MAAAA,GAAS,CAAA,EAAGtB,EAAAA,CAAG,QAAQ,CAAC;AAC9B,IAAA,MAAMuB,OAAAA,GAAUtB,2BAAAA,CAAcC,0BAAAA,CAAa,CAAA,EAAGF,EAAAA,CAAG,QAAQ,CAAC,EAAEiB,OAAAA,CAAQM,OAAO,CAACC,KAAK,EAAE,SAAA,CAAA,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A,MAAAA,EAAQ0D,mCAAmBC,OAAO;IAAEN,WAAAA,EAAa,eAAA;IAAiBC,WAAAA,EAAa,0HAAA;IAA4H3C,KAAAA,EAAO,UAAA;IAAYyB,QAAAA,EAAU,iCAAA;IAAmCG,WAAAA,EAAa,iBAAA;IAAmBrB,MAAAA,EAAQ,UAAA;IACnTf,OAAAA,EAAS;QAAEC,KAAAA,EAAO,eAAA;QAAiBC,MAAAA,EAAQ;AAA6B,KAAA;IACxEe,UAAAA,EAAY;AAAC,QAAA,MAAA;AAAQ,QAAA;AAAiB,KAAA;AAAE+B,IAAAA,WAAAA,EAAa,EAAE;IACvDpC,UAAAA,EAAY,WAAA;IAAaQ,YAAAA,EAAc;AAC3C,CAAA;AAEA,mJACO,MAAMqC,qBAAAA,GAAwBhE,cAAAA,CAAe;IAChDK,IAAAA,EAAM,eAAA;AACND,IAAAA,MAAAA,EAAQ0D,mCAAmBG,QAAQ;IAAER,WAAAA,EAAa,gBAAA;IAAkBC,WAAAA,EAAa,+GAAA;IAAiH3C,KAAAA,EAAO,WAAA;IAAayB,QAAAA,EAAU,oBAAA;IAAsBG,WAAAA,EAAa,kBAAA;IAAoBrB,MAAAA,EAAQ,WAAA;IAC/Rf,OAAAA,EAAS;QAAEC,KAAAA,EAAO,iBAAA;QAAmBI,MAAAA,EAAQ;AAAe,KAAA;IAC5DY,UAAAA,EAAY;AAAC,QAAA;AAAO,KAAA;AAAE+B,IAAAA,WAAAA,EAAa,EAAE;IACrCpC,UAAAA,EAAY,MAAA;IACZM,QAAAA,EAAU,IAAA;AAAMJ,IAAAA,KAAAA,EAAO;AAC3B,CAAA;;;"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var bookingsQueries = require('../bookingsQueries.js');
|
|
6
|
+
var bookingsParts = require('../bookingsParts.js');
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
/**
|
|
11
|
+
* One record page: the foundation `RecordPage` with the record's own title, its status and key facts at the top, its fields and the lists that belong to it in the
|
|
12
|
+
* main region, and the activity beside it. What it shows is the record the list handed it the id of.
|
|
13
|
+
*/ function recordPageOf(options) {
|
|
14
|
+
const queries = bookingsQueries.bookingsQueriesOf(options.entity);
|
|
15
|
+
const id = options.name;
|
|
16
|
+
return {
|
|
17
|
+
name: options.name,
|
|
18
|
+
fitsSlot: 'content',
|
|
19
|
+
slots: scene_blueprint_default.recordPageTemplate.slots,
|
|
20
|
+
arrangement: scene_blueprint_default.recordPageTemplate.arrangement,
|
|
21
|
+
content: {
|
|
22
|
+
header: [
|
|
23
|
+
scene_blueprint_default.component(`${id}-header`, 'pageHeader', {
|
|
24
|
+
title: bookingsQueries.fromQuery(queries.record, `0.${options.titleField}`),
|
|
25
|
+
subtitle: bookingsQueries.fromQuery(queries.record, '0.summary')
|
|
26
|
+
}, {
|
|
27
|
+
actions: [
|
|
28
|
+
bookingsParts.withBehaviors(bookingsParts.actionButton(`${id}-back`, options.backLabel, 'secondary'), bookingsParts.goesTo(options.backScreen)),
|
|
29
|
+
...options.actions.map((action)=>bookingsParts.withBehaviors(bookingsParts.actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? bookingsParts.opensDialog(action.dialog) : bookingsParts.goesTo(action.screen)))
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
],
|
|
33
|
+
summary: [
|
|
34
|
+
scene_blueprint_default.component(`${id}-status`, 'statusChip', {
|
|
35
|
+
status: bookingsQueries.fromQuery(queries.summary, '0.status'),
|
|
36
|
+
tone: bookingsQueries.fromQuery(queries.summary, '0.tone')
|
|
37
|
+
}),
|
|
38
|
+
...options.facts.map((fact)=>scene_blueprint_default.component(`${id}-${fact.id}`, 'statCard', {
|
|
39
|
+
label: fact.label,
|
|
40
|
+
value: bookingsQueries.fromQuery(queries.summary, `0.${fact.field}`),
|
|
41
|
+
...fact.format ? {
|
|
42
|
+
format: fact.format
|
|
43
|
+
} : {},
|
|
44
|
+
...bookingsQueries.currencyOfData
|
|
45
|
+
}))
|
|
46
|
+
],
|
|
47
|
+
tabs: [
|
|
48
|
+
scene_blueprint_default.component(`${id}-tabs`, 'tabSet', {
|
|
49
|
+
tabs: bookingsQueries.fromQuery(queries.tabs),
|
|
50
|
+
urlKey: 'tab',
|
|
51
|
+
label: `${options.displayName} sections`
|
|
52
|
+
})
|
|
53
|
+
],
|
|
54
|
+
main: [
|
|
55
|
+
scene_blueprint_default.component(`${id}-form`, 'formScreenBody', {
|
|
56
|
+
mode: 'readOnly',
|
|
57
|
+
sections: bookingsQueries.fromQuery(queries.sections),
|
|
58
|
+
values: bookingsQueries.fromQuery(queries.record, '0'),
|
|
59
|
+
...bookingsQueries.currencyOfData
|
|
60
|
+
}),
|
|
61
|
+
...options.extras.map((extra)=>scene_blueprint_default.component(`${id}-${extra.key.toLowerCase()}`, 'dataList', {
|
|
62
|
+
label: extra.label,
|
|
63
|
+
rows: bookingsQueries.fromQuery(`${options.entity}${extra.key}`),
|
|
64
|
+
columns: bookingsQueries.fromQuery(`${options.entity}${extra.key}Columns`),
|
|
65
|
+
titleField: extra.titleField,
|
|
66
|
+
pageSize: extra.pageSize ?? 8,
|
|
67
|
+
...bookingsQueries.currencyOfData
|
|
68
|
+
}))
|
|
69
|
+
],
|
|
70
|
+
related: [],
|
|
71
|
+
activity: [
|
|
72
|
+
scene_blueprint_default.component(`${id}-activity`, 'activityFeed', {
|
|
73
|
+
label: 'Activity',
|
|
74
|
+
entries: bookingsQueries.fromQuery(queries.activity),
|
|
75
|
+
...bookingsQueries.localeOfData
|
|
76
|
+
})
|
|
77
|
+
],
|
|
78
|
+
aside: []
|
|
79
|
+
},
|
|
80
|
+
displayName: options.displayName,
|
|
81
|
+
description: options.description,
|
|
82
|
+
metadata: bookingsParts.bookingsMetadata(options.name, 'Detail', [
|
|
83
|
+
scene_model.TemplateScope.Feature,
|
|
84
|
+
scene_model.TemplateScope.Subfeature
|
|
85
|
+
])
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** The booking page: the booking reference as its title, its status, date, hours and people at the top, its details, attendees and extras in the main region, and the activity beside it. */ const bookingPageTemplate = recordPageOf({
|
|
89
|
+
name: 'BookingPage',
|
|
90
|
+
entity: bookingsQueries.BookingsEntityKind.Booking,
|
|
91
|
+
displayName: 'Booking page',
|
|
92
|
+
description: 'One booking: status, date, hours and people, its details, attendees and extras, and its activity.',
|
|
93
|
+
titleField: 'reference',
|
|
94
|
+
backScreen: 'bookings.list',
|
|
95
|
+
backLabel: 'Back to bookings',
|
|
96
|
+
facts: [
|
|
97
|
+
{
|
|
98
|
+
id: 'date',
|
|
99
|
+
label: 'Date',
|
|
100
|
+
field: 'date'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: 'hours',
|
|
104
|
+
label: 'Hours',
|
|
105
|
+
field: 'hours'
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: 'people',
|
|
109
|
+
label: 'People',
|
|
110
|
+
field: 'people'
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
extras: [
|
|
114
|
+
{
|
|
115
|
+
key: 'Attendees',
|
|
116
|
+
label: 'Attendees',
|
|
117
|
+
titleField: 'name'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
key: 'Extras',
|
|
121
|
+
label: 'Extras',
|
|
122
|
+
titleField: 'item'
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
actions: []
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
exports.bookingPageTemplate = bookingPageTemplate;
|
|
129
|
+
//# 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 { BookingsEntityKind, currencyOfData, fromQuery, localeOfData, bookingsQueriesOf } from '../bookingsQueries';\nimport { actionButton, component, goesTo, bookingsMetadata, opensDialog, withBehaviors } from '../bookingsParts';\n\ninterface Fact { id: string; label: string; field: string; format?: 'currency' | 'percent' }\ninterface Extra { key: string; label: string; titleField: string; pageSize?: number }\ninterface Action { id: string; label: string; emphasis: 'primary' | 'secondary' | 'quiet' | 'danger'; dialog?: string; screen?: string }\n\ninterface RecordOptions {\n name: string;\n entity: BookingsEntityKind;\n displayName: string;\n description: string;\n titleField: string;\n backScreen: string;\n backLabel: string;\n facts: Fact[];\n extras: Extra[];\n actions: Action[];\n}\n\n/**\n * One record page: the foundation `RecordPage` with the record's own title, its status and key facts at the top, its fields and the lists that belong to it in the\n * main region, and the activity beside it. What it shows is the record the list handed it the id of.\n */\nfunction recordPageOf(options: RecordOptions): ScreenTemplate {\n const queries = bookingsQueriesOf(options.entity);\n const id = options.name;\n return {\n name: options.name,\n fitsSlot: 'content',\n slots: recordPageTemplate.slots,\n arrangement: recordPageTemplate.arrangement,\n content: {\n header: [component(`${id}-header`, 'pageHeader', { title: fromQuery(queries.record, `0.${options.titleField}`), subtitle: fromQuery(queries.record, '0.summary') }, {\n actions: [\n withBehaviors(actionButton(`${id}-back`, options.backLabel, 'secondary'), goesTo(options.backScreen)),\n ...options.actions.map(action => withBehaviors(actionButton(`${id}-${action.id}`, action.label, action.emphasis), action.dialog ? opensDialog(action.dialog) : goesTo(action.screen!))),\n ],\n })],\n summary: [\n component(`${id}-status`, 'statusChip', { status: fromQuery(queries.summary, '0.status'), tone: fromQuery(queries.summary, '0.tone') }),\n ...options.facts.map(fact => component(`${id}-${fact.id}`, 'statCard', {\n label: fact.label, value: fromQuery(queries.summary, `0.${fact.field}`), ...(fact.format ? { format: fact.format } : {}), ...currencyOfData,\n })),\n ],\n tabs: [component(`${id}-tabs`, 'tabSet', { tabs: fromQuery(queries.tabs), urlKey: 'tab', label: `${options.displayName} sections` })],\n main: [\n component(`${id}-form`, 'formScreenBody', { mode: 'readOnly', sections: fromQuery(queries.sections), values: fromQuery(queries.record, '0'), ...currencyOfData }),\n ...options.extras.map(extra => component(`${id}-${extra.key.toLowerCase()}`, 'dataList', {\n label: extra.label, rows: fromQuery(`${options.entity}${extra.key}`), columns: fromQuery(`${options.entity}${extra.key}Columns`), titleField: extra.titleField, pageSize: extra.pageSize ?? 8, ...currencyOfData,\n })),\n ],\n related: [],\n activity: [component(`${id}-activity`, 'activityFeed', { label: 'Activity', entries: fromQuery(queries.activity), ...localeOfData })],\n aside: [],\n },\n displayName: options.displayName,\n description: options.description,\n metadata: bookingsMetadata(options.name, 'Detail', [TemplateScope.Feature, TemplateScope.Subfeature]),\n };\n}\n\n/** The booking page: the booking reference as its title, its status, date, hours and people at the top, its details, attendees and extras in the main region, and the activity beside it. */\nexport const bookingPageTemplate = recordPageOf({\n name: 'BookingPage', entity: BookingsEntityKind.Booking, displayName: 'Booking page', description: 'One booking: status, date, hours and people, its details, attendees and extras, and its activity.', titleField: 'reference', backScreen: 'bookings.list', backLabel: 'Back to bookings',\n facts: [\n { id: 'date', label: 'Date', field: 'date' },\n { id: 'hours', label: 'Hours', field: 'hours' },\n { id: 'people', label: 'People', field: 'people' },\n ],\n extras: [{ key: 'Attendees', label: 'Attendees', titleField: 'name' }, { key: 'Extras', label: 'Extras', titleField: 'item' }],\n actions: [],\n});\n"],"names":["recordPageOf","options","queries","bookingsQueriesOf","entity","id","name","fitsSlot","slots","recordPageTemplate","arrangement","content","header","component","title","fromQuery","record","titleField","subtitle","actions","withBehaviors","actionButton","backLabel","goesTo","backScreen","map","action","label","emphasis","dialog","opensDialog","screen","summary","status","tone","facts","fact","value","field","format","currencyOfData","tabs","urlKey","displayName","main","mode","sections","values","extras","extra","key","toLowerCase","rows","columns","pageSize","related","activity","entries","localeOfData","aside","description","metadata","bookingsMetadata","TemplateScope","Feature","Subfeature","bookingPageTemplate","BookingsEntityKind","Booking"],"mappings":";;;;;;;AAAA;AACA;AAwBA;;;IAIA,SAASA,aAAaC,OAAsB,EAAA;IACxC,MAAMC,OAAAA,GAAUC,iCAAAA,CAAkBF,OAAAA,CAAQG,MAAM,CAAA;IAChD,MAAMC,EAAAA,GAAKJ,QAAQK,IAAI;IACvB,OAAO;AACHA,QAAAA,IAAAA,EAAML,QAAQK,IAAI;QAClBC,QAAAA,EAAU,SAAA;AACVC,QAAAA,KAAAA,EAAOC,2CAAmBD,KAAK;AAC/BE,QAAAA,WAAAA,EAAaD,2CAAmBC,WAAW;QAC3CC,OAAAA,EAAS;YACLC,MAAAA,EAAQ;AAACC,gBAAAA,iCAAAA,CAAU,CAAA,EAAGR,EAAAA,CAAG,OAAO,CAAC,EAAE,YAAA,EAAc;oBAAES,KAAAA,EAAOC,yBAAAA,CAAUb,QAAQc,MAAM,EAAE,CAAC,EAAE,EAAEf,OAAAA,CAAQgB,UAAU,CAAA,CAAE,CAAA;oBAAGC,QAAAA,EAAUH,yBAAAA,CAAUb,OAAAA,CAAQc,MAAM,EAAE,WAAA;iBAAa,EAAG;oBAChKG,OAAAA,EAAS;AACLC,wBAAAA,2BAAAA,CAAcC,0BAAAA,CAAa,CAAA,EAAGhB,EAAAA,CAAG,KAAK,CAAC,EAAEJ,OAAAA,CAAQqB,SAAS,EAAE,WAAA,CAAA,EAAcC,oBAAAA,CAAOtB,OAAAA,CAAQuB,UAAU,CAAA,CAAA;AAChGvB,wBAAAA,GAAAA,OAAAA,CAAQkB,OAAO,CAACM,GAAG,CAACC,CAAAA,MAAAA,GAAUN,2BAAAA,CAAcC,0BAAAA,CAAa,CAAA,EAAGhB,EAAAA,CAAG,CAAC,EAAEqB,OAAOrB,EAAE,CAAA,CAAE,EAAEqB,MAAAA,CAAOC,KAAK,EAAED,MA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|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var bookingsQueries = require('../bookingsQueries.js');
|
|
6
|
+
var bookingsParts = require('../bookingsParts.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
|
+
/** The new-booking wizard: what you need, when you need it, a few details, then a review. The step the person has reached survives a refresh and an invalid step blocks Next and says why. */ const newBookingWizardTemplate = {
|
|
11
|
+
name: 'NewBookingWizard',
|
|
12
|
+
fitsSlot: 'content',
|
|
13
|
+
slots: scene_blueprint_default.wizardScreenTemplate.slots,
|
|
14
|
+
arrangement: scene_blueprint_default.wizardScreenTemplate.arrangement,
|
|
15
|
+
content: {
|
|
16
|
+
header: [
|
|
17
|
+
scene_blueprint_default.component('NewBookingWizard-header', 'pageHeader', {
|
|
18
|
+
title: 'New booking',
|
|
19
|
+
subtitle: 'Four short steps'
|
|
20
|
+
})
|
|
21
|
+
],
|
|
22
|
+
progress: [
|
|
23
|
+
scene_blueprint_default.component('NewBookingWizard-progress', 'wizardProgress', {
|
|
24
|
+
steps: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.BookingWizardSteps),
|
|
25
|
+
urlKey: 'step'
|
|
26
|
+
}, {
|
|
27
|
+
resource: [
|
|
28
|
+
scene_blueprint_default.component('NewBookingWizard-resource', 'formScreenBody', {
|
|
29
|
+
mode: 'create',
|
|
30
|
+
sections: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.BookingResourceSections),
|
|
31
|
+
errors: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.FormErrors, '0'),
|
|
32
|
+
...bookingsQueries.localeOfData
|
|
33
|
+
})
|
|
34
|
+
],
|
|
35
|
+
when: [
|
|
36
|
+
scene_blueprint_default.component('NewBookingWizard-when', 'formScreenBody', {
|
|
37
|
+
mode: 'create',
|
|
38
|
+
sections: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.BookingWhenSections),
|
|
39
|
+
errors: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.FormErrors, '0'),
|
|
40
|
+
...bookingsQueries.localeOfData
|
|
41
|
+
})
|
|
42
|
+
],
|
|
43
|
+
details: [
|
|
44
|
+
scene_blueprint_default.component('NewBookingWizard-details', 'formScreenBody', {
|
|
45
|
+
mode: 'create',
|
|
46
|
+
sections: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.BookingDetailSections),
|
|
47
|
+
errors: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.FormErrors, '0'),
|
|
48
|
+
...bookingsQueries.localeOfData
|
|
49
|
+
})
|
|
50
|
+
],
|
|
51
|
+
review: [
|
|
52
|
+
scene_blueprint_default.component('NewBookingWizard-review', 'formScreenBody', {
|
|
53
|
+
mode: 'readOnly',
|
|
54
|
+
sections: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.BookingReviewSections),
|
|
55
|
+
values: bookingsQueries.fromQuery(bookingsQueries.BookingsQuery.BookingReviewValues, '0'),
|
|
56
|
+
...bookingsQueries.currencyOfData
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
],
|
|
61
|
+
step: [],
|
|
62
|
+
actions: []
|
|
63
|
+
},
|
|
64
|
+
displayName: 'New booking wizard',
|
|
65
|
+
description: 'Resource, time, details, then review and book; the step survives a refresh and an invalid step blocks Next and says why.',
|
|
66
|
+
metadata: bookingsParts.bookingsMetadata('NewBookingWizard', 'Wizard', [
|
|
67
|
+
scene_model.TemplateScope.Feature,
|
|
68
|
+
scene_model.TemplateScope.Subfeature
|
|
69
|
+
])
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
exports.newBookingWizardTemplate = newBookingWizardTemplate;
|
|
73
|
+
//# sourceMappingURL=wizardTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizardTemplate.js","sources":["../../../templates/wizardTemplate.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 { wizardScreenTemplate } from '@cratis/scene.blueprint.default';\nimport { BookingsQuery, currencyOfData, fromQuery, localeOfData } from '../bookingsQueries';\nimport { bookingsMetadata, component } from '../bookingsParts';\n\n/** The new-booking wizard: what you need, when you need it, a few details, then a review. The step the person has reached survives a refresh and an invalid step blocks Next and says why. */\nexport const newBookingWizardTemplate: ScreenTemplate = {\n name: 'NewBookingWizard',\n fitsSlot: 'content',\n slots: wizardScreenTemplate.slots,\n arrangement: wizardScreenTemplate.arrangement,\n content: {\n header: [component('NewBookingWizard-header', 'pageHeader', { title: 'New booking', subtitle: 'Four short steps' })],\n progress: [component('NewBookingWizard-progress', 'wizardProgress', { steps: fromQuery(BookingsQuery.BookingWizardSteps), urlKey: 'step' }, {\n resource: [component('NewBookingWizard-resource', 'formScreenBody', { mode: 'create', sections: fromQuery(BookingsQuery.BookingResourceSections), errors: fromQuery(BookingsQuery.FormErrors, '0'), ...localeOfData })],\n when: [component('NewBookingWizard-when', 'formScreenBody', { mode: 'create', sections: fromQuery(BookingsQuery.BookingWhenSections), errors: fromQuery(BookingsQuery.FormErrors, '0'), ...localeOfData })],\n details: [component('NewBookingWizard-details', 'formScreenBody', { mode: 'create', sections: fromQuery(BookingsQuery.BookingDetailSections), errors: fromQuery(BookingsQuery.FormErrors, '0'), ...localeOfData })],\n review: [component('NewBookingWizard-review', 'formScreenBody', { mode: 'readOnly', sections: fromQuery(BookingsQuery.BookingReviewSections), values: fromQuery(BookingsQuery.BookingReviewValues, '0'), ...currencyOfData })],\n })],\n step: [],\n actions: [],\n },\n displayName: 'New booking wizard',\n description: 'Resource, time, details, then review and book; the step survives a refresh and an invalid step blocks Next and says why.',\n metadata: bookingsMetadata('NewBookingWizard', 'Wizard', [TemplateScope.Feature, TemplateScope.Subfeature]),\n};\n"],"names":["newBookingWizardTemplate","name","fitsSlot","slots","wizardScreenTemplate","arrangement","content","header","component","title","subtitle","progress","steps","fromQuery","BookingsQuery","BookingWizardSteps","urlKey","resource","mode","sections","BookingResourceSections","errors","FormErrors","localeOfData","when","BookingWhenSections","details","BookingDetailSections","review","BookingReviewSections","values","BookingReviewValues","currencyOfData","step","actions","displayName","description","metadata","bookingsMetadata","TemplateScope","Feature","Subfeature"],"mappings":";;;;;;;AAAA;AACA;AAOA,+LACO,MAAMA,wBAAAA,GAA2C;IACpDC,IAAAA,EAAM,kBAAA;IACNC,QAAAA,EAAU,SAAA;AACVC,IAAAA,KAAAA,EAAOC,6CAAqBD,KAAK;AACjCE,IAAAA,WAAAA,EAAaD,6CAAqBC,WAAW;IAC7CC,OAAAA,EAAS;QACLC,MAAAA,EAAQ;AAACC,YAAAA,iCAAAA,CAAU,2BAA2B,YAAA,EAAc;gBAAEC,KAAAA,EAAO,aAAA;gBAAeC,QAAAA,EAAU;AAAmB,aAAA;AAAG,SAAA;QACpHC,QAAAA,EAAU;AAACH,YAAAA,iCAAAA,CAAU,6BAA6B,gBAAA,EAAkB;gBAAEI,KAAAA,EAAOC,yBAAAA,CAAUC,8BAAcC,kBAAkB,CAAA;gBAAGC,MAAAA,EAAQ;aAAO,EAAG;gBACxIC,QAAAA,EAAU;AAACT,oBAAAA,iCAAAA,CAAU,6BAA6B,gBAAA,EAAkB;wBAAEU,IAAAA,EAAM,QAAA;wBAAUC,QAAAA,EAAUN,yBAAAA,CAAUC,8BAAcM,uBAAuB,CAAA;wBAAGC,MAAAA,EAAQR,yBAAAA,CAAUC,6BAAAA,CAAcQ,UAAU,EAAE,GAAA,CAAA;AAAM,wBAAA,GAAGC;AAAa,qBAAA;AAAG,iBAAA;gBACvNC,IAAAA,EAAM;AAAChB,oBAAAA,iCAAAA,CAAU,yBAAyB,gBAAA,EAAkB;wBAAEU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AMzD,eAAO,MAAM,iBAAiB,EAAE,kBAM/B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { bookingsBlueprintManifest } from './manifest.js';
|
|
2
|
+
import { bookingsScreens } from './screens/index.js';
|
|
3
|
+
import { bookingsScreenTemplates } from './templates/index.js';
|
|
4
|
+
import { bookingsDialogs } from './templates/formTemplates.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
|
+
/** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */ const bookingsBlueprint = {
|
|
9
|
+
manifest: bookingsBlueprintManifest,
|
|
10
|
+
components: {},
|
|
11
|
+
screenTemplates: bookingsScreenTemplates,
|
|
12
|
+
dialogTemplates: bookingsDialogs,
|
|
13
|
+
screens: bookingsScreens
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { bookingsBlueprint };
|
|
17
|
+
//# sourceMappingURL=blueprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.js","sources":["../../blueprint.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { bookingsBlueprintManifest } from './manifest';\nimport { bookingsScreens } from './screens';\nimport { bookingsDialogTemplates, bookingsScreenTemplates } from './templates';\n\n/** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */\nexport const bookingsBlueprint: ScenePackageBundle = {\n manifest: bookingsBlueprintManifest,\n components: {},\n screenTemplates: bookingsScreenTemplates,\n dialogTemplates: bookingsDialogTemplates,\n screens: bookingsScreens,\n};\n"],"names":["bookingsBlueprint","manifest","bookingsBlueprintManifest","components","screenTemplates","bookingsScreenTemplates","dialogTemplates","bookingsDialogTemplates","screens","bookingsScreens"],"mappings":";;;;;AAAA;AACA;AAOA,2JACO,MAAMA,iBAAAA,GAAwC;IACjDC,QAAAA,EAAUC,yBAAAA;AACVC,IAAAA,UAAAA,EAAY,EAAC;IACbC,eAAAA,EAAiBC,uBAAAA;IACjBC,eAAAA,EAAiBC,eAAAA;IACjBC,OAAAA,EAASC;AACb;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApplicationStructureIndex } from '@cratis/scene.engine';
|
|
2
|
+
import { ApplicationDocument, CompositionOptions } from '@cratis/scene.blueprint.default';
|
|
3
|
+
export declare const bookingsDefaultSampleDataId = "bookings-en";
|
|
4
|
+
export declare function bookingsApplication(sampleData?: string): ApplicationDocument;
|
|
5
|
+
export declare const bookingsComposition: CompositionOptions;
|
|
6
|
+
export declare const bookingsNavigationModel: () => {
|
|
7
|
+
structure: ApplicationStructureIndex;
|
|
8
|
+
navigation: import("@cratis/scene.model").NavigationModel;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=bookingsApplication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookingsApplication.d.ts","sourceRoot":"","sources":["../../bookingsApplication.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAkC,MAAM,iCAAiC,CAAC;AAM1H,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AAOzD,wBAAgB,mBAAmB,CAAC,UAAU,GAAE,MAAoC,GAAG,mBAAmB,CAGzG;AAGD,eAAO,MAAM,mBAAmB,EAAE,kBAAkE,CAAC;AAGrG,eAAO,MAAM,uBAAuB;IAAY,SAAS;IAAoD,UAAU;CAAuB,CAAC"}
|