payload-reserve 1.0.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/LICENSE +21 -0
- package/README.md +1145 -0
- package/dist/collections/Reservations.d.ts +3 -0
- package/dist/collections/Reservations.js +124 -0
- package/dist/collections/Reservations.js.map +1 -0
- package/dist/collections/Resources.d.ts +3 -0
- package/dist/collections/Resources.js +53 -0
- package/dist/collections/Resources.js.map +1 -0
- package/dist/collections/Schedules.d.ts +3 -0
- package/dist/collections/Schedules.js +182 -0
- package/dist/collections/Schedules.js.map +1 -0
- package/dist/collections/Services.d.ts +3 -0
- package/dist/collections/Services.js +75 -0
- package/dist/collections/Services.js.map +1 -0
- package/dist/components/AvailabilityOverview/AvailabilityOverview.module.css +103 -0
- package/dist/components/AvailabilityOverview/index.d.ts +2 -0
- package/dist/components/AvailabilityOverview/index.js +277 -0
- package/dist/components/AvailabilityOverview/index.js.map +1 -0
- package/dist/components/CalendarView/CalendarView.module.css +283 -0
- package/dist/components/CalendarView/index.d.ts +3 -0
- package/dist/components/CalendarView/index.js +508 -0
- package/dist/components/CalendarView/index.js.map +1 -0
- package/dist/components/DashboardWidget/DashboardWidget.module.css +53 -0
- package/dist/components/DashboardWidget/DashboardWidgetServer.d.ts +2 -0
- package/dist/components/DashboardWidget/DashboardWidgetServer.js +126 -0
- package/dist/components/DashboardWidget/DashboardWidgetServer.js.map +1 -0
- package/dist/defaults.d.ts +12 -0
- package/dist/defaults.js +29 -0
- package/dist/defaults.js.map +1 -0
- package/dist/exports/client.d.ts +2 -0
- package/dist/exports/client.js +4 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +3 -0
- package/dist/exports/rsc.js.map +1 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/reservations/calculateEndTime.d.ts +3 -0
- package/dist/hooks/reservations/calculateEndTime.js +22 -0
- package/dist/hooks/reservations/calculateEndTime.js.map +1 -0
- package/dist/hooks/reservations/validateCancellation.d.ts +3 -0
- package/dist/hooks/reservations/validateCancellation.js +38 -0
- package/dist/hooks/reservations/validateCancellation.js.map +1 -0
- package/dist/hooks/reservations/validateConflicts.d.ts +3 -0
- package/dist/hooks/reservations/validateConflicts.js +86 -0
- package/dist/hooks/reservations/validateConflicts.js.map +1 -0
- package/dist/hooks/reservations/validateStatusTransition.d.ts +2 -0
- package/dist/hooks/reservations/validateStatusTransition.js +54 -0
- package/dist/hooks/reservations/validateStatusTransition.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.js +106 -0
- package/dist/plugin.js.map +1 -0
- package/dist/translations/en.json +86 -0
- package/dist/translations/index.d.ts +3 -0
- package/dist/translations/index.js +8 -0
- package/dist/translations/index.js.map +1 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/utilities/scheduleUtils.d.ts +54 -0
- package/dist/utilities/scheduleUtils.js +87 -0
- package/dist/utilities/scheduleUtils.js.map +1 -0
- package/dist/utilities/slotUtils.d.ts +21 -0
- package/dist/utilities/slotUtils.js +28 -0
- package/dist/utilities/slotUtils.js.map +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { calculateEndTime } from '../hooks/reservations/calculateEndTime.js';
|
|
2
|
+
import { validateCancellation } from '../hooks/reservations/validateCancellation.js';
|
|
3
|
+
import { validateConflicts } from '../hooks/reservations/validateConflicts.js';
|
|
4
|
+
import { validateStatusTransition } from '../hooks/reservations/validateStatusTransition.js';
|
|
5
|
+
export function createReservationsCollection(config) {
|
|
6
|
+
return {
|
|
7
|
+
slug: config.slugs.reservations,
|
|
8
|
+
access: config.access.reservations ?? {},
|
|
9
|
+
admin: {
|
|
10
|
+
components: {
|
|
11
|
+
views: {
|
|
12
|
+
list: {
|
|
13
|
+
Component: 'payload-reserve/client#CalendarView'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
group: config.adminGroup,
|
|
18
|
+
listSearchableFields: [
|
|
19
|
+
'status'
|
|
20
|
+
],
|
|
21
|
+
useAsTitle: 'startTime'
|
|
22
|
+
},
|
|
23
|
+
fields: [
|
|
24
|
+
{
|
|
25
|
+
name: 'service',
|
|
26
|
+
type: 'relationship',
|
|
27
|
+
label: ({ t })=>t('reservation:fieldService'),
|
|
28
|
+
relationTo: config.slugs.services,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'resource',
|
|
33
|
+
type: 'relationship',
|
|
34
|
+
label: ({ t })=>t('reservation:fieldResource'),
|
|
35
|
+
relationTo: config.slugs.resources,
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'customer',
|
|
40
|
+
type: 'relationship',
|
|
41
|
+
label: ({ t })=>t('reservation:fieldCustomer'),
|
|
42
|
+
relationTo: config.userCollection,
|
|
43
|
+
required: true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'startTime',
|
|
47
|
+
type: 'date',
|
|
48
|
+
admin: {
|
|
49
|
+
date: {
|
|
50
|
+
pickerAppearance: 'dayAndTime'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
label: ({ t })=>t('reservation:fieldStartTime'),
|
|
54
|
+
required: true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'endTime',
|
|
58
|
+
type: 'date',
|
|
59
|
+
admin: {
|
|
60
|
+
date: {
|
|
61
|
+
pickerAppearance: 'dayAndTime'
|
|
62
|
+
},
|
|
63
|
+
readOnly: true
|
|
64
|
+
},
|
|
65
|
+
label: ({ t })=>t('reservation:fieldEndTime')
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'status',
|
|
69
|
+
type: 'select',
|
|
70
|
+
defaultValue: 'pending',
|
|
71
|
+
label: ({ t })=>t('reservation:fieldStatus'),
|
|
72
|
+
options: [
|
|
73
|
+
{
|
|
74
|
+
label: ({ t })=>t('reservation:statusPending'),
|
|
75
|
+
value: 'pending'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: ({ t })=>t('reservation:statusConfirmed'),
|
|
79
|
+
value: 'confirmed'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: ({ t })=>t('reservation:statusCompleted'),
|
|
83
|
+
value: 'completed'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
label: ({ t })=>t('reservation:statusCancelled'),
|
|
87
|
+
value: 'cancelled'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: ({ t })=>t('reservation:statusNoShow'),
|
|
91
|
+
value: 'no-show'
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'cancellationReason',
|
|
97
|
+
type: 'textarea',
|
|
98
|
+
admin: {
|
|
99
|
+
condition: (_, siblingData)=>siblingData?.status === 'cancelled'
|
|
100
|
+
},
|
|
101
|
+
label: ({ t })=>t('reservation:fieldCancellationReason')
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'notes',
|
|
105
|
+
type: 'textarea',
|
|
106
|
+
label: ({ t })=>t('reservation:fieldNotes')
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
hooks: {
|
|
110
|
+
beforeChange: [
|
|
111
|
+
calculateEndTime(config),
|
|
112
|
+
validateConflicts(config),
|
|
113
|
+
validateStatusTransition(),
|
|
114
|
+
validateCancellation(config)
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
labels: {
|
|
118
|
+
plural: ({ t })=>t('reservation:collectionReservations'),
|
|
119
|
+
singular: ({ t })=>t('reservation:collectionReservations')
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
//# sourceMappingURL=Reservations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/Reservations.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport type { PluginT } from '../translations/index.js'\nimport type { ResolvedReservationPluginConfig } from '../types.js'\n\nimport { calculateEndTime } from '../hooks/reservations/calculateEndTime.js'\nimport { validateCancellation } from '../hooks/reservations/validateCancellation.js'\nimport { validateConflicts } from '../hooks/reservations/validateConflicts.js'\nimport { validateStatusTransition } from '../hooks/reservations/validateStatusTransition.js'\n\nexport function createReservationsCollection(\n config: ResolvedReservationPluginConfig,\n): CollectionConfig {\n return {\n slug: config.slugs.reservations,\n access: config.access.reservations ?? {},\n admin: {\n components: {\n views: {\n list: {\n Component: 'payload-reserve/client#CalendarView',\n },\n },\n },\n group: config.adminGroup,\n listSearchableFields: ['status'],\n useAsTitle: 'startTime',\n },\n fields: [\n {\n name: 'service',\n type: 'relationship',\n label: ({ t }) => (t as PluginT)('reservation:fieldService'),\n relationTo: config.slugs.services,\n required: true,\n },\n {\n name: 'resource',\n type: 'relationship',\n label: ({ t }) => (t as PluginT)('reservation:fieldResource'),\n relationTo: config.slugs.resources,\n required: true,\n },\n {\n name: 'customer',\n type: 'relationship',\n label: ({ t }) => (t as PluginT)('reservation:fieldCustomer'),\n relationTo: config.userCollection,\n required: true,\n },\n {\n name: 'startTime',\n type: 'date',\n admin: {\n date: {\n pickerAppearance: 'dayAndTime',\n },\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldStartTime'),\n required: true,\n },\n {\n name: 'endTime',\n type: 'date',\n admin: {\n date: {\n pickerAppearance: 'dayAndTime',\n },\n readOnly: true,\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldEndTime'),\n },\n {\n name: 'status',\n type: 'select',\n defaultValue: 'pending',\n label: ({ t }) => (t as PluginT)('reservation:fieldStatus'),\n options: [\n { label: ({ t }) => (t as PluginT)('reservation:statusPending'), value: 'pending' },\n { label: ({ t }) => (t as PluginT)('reservation:statusConfirmed'), value: 'confirmed' },\n { label: ({ t }) => (t as PluginT)('reservation:statusCompleted'), value: 'completed' },\n { label: ({ t }) => (t as PluginT)('reservation:statusCancelled'), value: 'cancelled' },\n { label: ({ t }) => (t as PluginT)('reservation:statusNoShow'), value: 'no-show' },\n ],\n },\n {\n name: 'cancellationReason',\n type: 'textarea',\n admin: {\n condition: (_, siblingData) => siblingData?.status === 'cancelled',\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldCancellationReason'),\n },\n {\n name: 'notes',\n type: 'textarea',\n label: ({ t }) => (t as PluginT)('reservation:fieldNotes'),\n },\n ],\n hooks: {\n beforeChange: [\n calculateEndTime(config),\n validateConflicts(config),\n validateStatusTransition(),\n validateCancellation(config),\n ],\n },\n labels: {\n plural: ({ t }) => (t as PluginT)('reservation:collectionReservations'),\n singular: ({ t }) => (t as PluginT)('reservation:collectionReservations'),\n },\n }\n}\n"],"names":["calculateEndTime","validateCancellation","validateConflicts","validateStatusTransition","createReservationsCollection","config","slug","slugs","reservations","access","admin","components","views","list","Component","group","adminGroup","listSearchableFields","useAsTitle","fields","name","type","label","t","relationTo","services","required","resources","userCollection","date","pickerAppearance","readOnly","defaultValue","options","value","condition","_","siblingData","status","hooks","beforeChange","labels","plural","singular"],"mappings":"AAKA,SAASA,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,gDAA+C;AACpF,SAASC,iBAAiB,QAAQ,6CAA4C;AAC9E,SAASC,wBAAwB,QAAQ,oDAAmD;AAE5F,OAAO,SAASC,6BACdC,MAAuC;IAEvC,OAAO;QACLC,MAAMD,OAAOE,KAAK,CAACC,YAAY;QAC/BC,QAAQJ,OAAOI,MAAM,CAACD,YAAY,IAAI,CAAC;QACvCE,OAAO;YACLC,YAAY;gBACVC,OAAO;oBACLC,MAAM;wBACJC,WAAW;oBACb;gBACF;YACF;YACAC,OAAOV,OAAOW,UAAU;YACxBC,sBA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EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;wBAAgCW,OAAO;oBAAY;oBACtF;wBAAEZ,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;wBAA6BW,OAAO;oBAAU;iBAClF;YACH;YACA;gBACEd,MAAM;gBACNC,MAAM;gBACNX,OAAO;oBACLyB,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,WAAW;gBACzD;gBACAhB,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;YACnC;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;YACnC;SACD;QACDgB,OAAO;YACLC,cAAc;gBACZxC,iBAAiBK;gBACjBH,kBAAkBG;gBAClBF;gBACAF,qBAAqBI;aACtB;QACH;QACAoC,QAAQ;YACNC,QAAQ,CAAC,EAAEnB,CAAC,EAAE,GAAK,AAACA,EAAc;YAClCoB,UAAU,CAAC,EAAEpB,CAAC,EAAE,GAAK,AAACA,EAAc;QACtC;IACF;AACF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export function createResourcesCollection(config) {
|
|
2
|
+
return {
|
|
3
|
+
slug: config.slugs.resources,
|
|
4
|
+
access: config.access.resources ?? {},
|
|
5
|
+
admin: {
|
|
6
|
+
group: config.adminGroup,
|
|
7
|
+
useAsTitle: 'name'
|
|
8
|
+
},
|
|
9
|
+
fields: [
|
|
10
|
+
{
|
|
11
|
+
name: 'name',
|
|
12
|
+
type: 'text',
|
|
13
|
+
label: ({ t })=>t('reservation:fieldName'),
|
|
14
|
+
...config.localized ? {
|
|
15
|
+
localized: true
|
|
16
|
+
} : {},
|
|
17
|
+
maxLength: 200,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'description',
|
|
22
|
+
type: 'textarea',
|
|
23
|
+
label: ({ t })=>t('reservation:fieldDescription'),
|
|
24
|
+
...config.localized ? {
|
|
25
|
+
localized: true
|
|
26
|
+
} : {}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'services',
|
|
30
|
+
type: 'relationship',
|
|
31
|
+
hasMany: true,
|
|
32
|
+
label: ({ t })=>t('reservation:fieldServices'),
|
|
33
|
+
relationTo: config.slugs.services,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'active',
|
|
38
|
+
type: 'checkbox',
|
|
39
|
+
admin: {
|
|
40
|
+
position: 'sidebar'
|
|
41
|
+
},
|
|
42
|
+
defaultValue: true,
|
|
43
|
+
label: ({ t })=>t('reservation:fieldActive')
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
labels: {
|
|
47
|
+
plural: ({ t })=>t('reservation:collectionResources'),
|
|
48
|
+
singular: ({ t })=>t('reservation:collectionResources')
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=Resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/Resources.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport type { PluginT } from '../translations/index.js'\nimport type { ResolvedReservationPluginConfig } from '../types.js'\n\nexport function createResourcesCollection(\n config: ResolvedReservationPluginConfig,\n): CollectionConfig {\n return {\n slug: config.slugs.resources,\n access: config.access.resources ?? {},\n admin: {\n group: config.adminGroup,\n useAsTitle: 'name',\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n label: ({ t }) => (t as PluginT)('reservation:fieldName'),\n ...(config.localized ? { localized: true } : {}),\n maxLength: 200,\n required: true,\n },\n {\n name: 'description',\n type: 'textarea',\n label: ({ t }) => (t as PluginT)('reservation:fieldDescription'),\n ...(config.localized ? { localized: true } : {}),\n },\n {\n name: 'services',\n type: 'relationship',\n hasMany: true,\n label: ({ t }) => (t as PluginT)('reservation:fieldServices'),\n relationTo: config.slugs.services,\n required: true,\n },\n {\n name: 'active',\n type: 'checkbox',\n admin: {\n position: 'sidebar',\n },\n defaultValue: true,\n label: ({ t }) => (t as PluginT)('reservation:fieldActive'),\n },\n ],\n labels: {\n plural: ({ t }) => (t as PluginT)('reservation:collectionResources'),\n singular: ({ t }) => (t as PluginT)('reservation:collectionResources'),\n },\n }\n}\n"],"names":["createResourcesCollection","config","slug","slugs","resources","access","admin","group","adminGroup","useAsTitle","fields","name","type","label","t","localized","maxLength","required","hasMany","relationTo","services","position","defaultValue","labels","plural","singular"],"mappings":"AAKA,OAAO,SAASA,0BACdC,MAAuC;IAEvC,OAAO;QACLC,MAAMD,OAAOE,KAAK,CAACC,SAAS;QAC5BC,QAAQJ,OAAOI,MAAM,CAACD,SAAS,IAAI,CAAC;QACpCE,OAAO;YACLC,OAAON,OAAOO,UAAU;YACxBC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjC,GAAIb,OAAOc,SAAS,GAAG;oBAAEA,WAAW;gBAAK,IAAI,CAAC,CAAC;gBAC/CC,WAAW;gBACXC,UAAU;YACZ;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjC,GAAIb,OAAOc,SAAS,GAAG;oBAAEA,WAAW;gBAAK,IAAI,CAAC,CAAC;YACjD;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNM,SAAS;gBACTL,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjCK,YAAYlB,OAAOE,KAAK,CAACiB,QAAQ;gBACjCH,UAAU;YACZ;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNN,OAAO;oBACLe,UAAU;gBACZ;gBACAC,cAAc;gBACdT,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;YACnC;SACD;QACDS,QAAQ;YACNC,QAAQ,CAAC,EAAEV,CAAC,EAAE,GAAK,AAACA,EAAc;YAClCW,UAAU,CAAC,EAAEX,CAAC,EAAE,GAAK,AAACA,EAAc;QACtC;IACF;AACF"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
export function createSchedulesCollection(config) {
|
|
2
|
+
return {
|
|
3
|
+
slug: config.slugs.schedules,
|
|
4
|
+
access: config.access.schedules ?? {},
|
|
5
|
+
admin: {
|
|
6
|
+
group: config.adminGroup,
|
|
7
|
+
useAsTitle: 'name'
|
|
8
|
+
},
|
|
9
|
+
fields: [
|
|
10
|
+
{
|
|
11
|
+
name: 'name',
|
|
12
|
+
type: 'text',
|
|
13
|
+
label: ({ t })=>t('reservation:fieldName'),
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'resource',
|
|
18
|
+
type: 'relationship',
|
|
19
|
+
label: ({ t })=>t('reservation:fieldResource'),
|
|
20
|
+
relationTo: config.slugs.resources,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'scheduleType',
|
|
25
|
+
type: 'select',
|
|
26
|
+
defaultValue: 'recurring',
|
|
27
|
+
label: ({ t })=>t('reservation:fieldScheduleType'),
|
|
28
|
+
options: [
|
|
29
|
+
{
|
|
30
|
+
label: ({ t })=>t('reservation:scheduleTypeRecurring'),
|
|
31
|
+
value: 'recurring'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: ({ t })=>t('reservation:scheduleTypeManual'),
|
|
35
|
+
value: 'manual'
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'recurringSlots',
|
|
41
|
+
type: 'array',
|
|
42
|
+
admin: {
|
|
43
|
+
condition: (_, siblingData)=>siblingData?.scheduleType === 'recurring'
|
|
44
|
+
},
|
|
45
|
+
fields: [
|
|
46
|
+
{
|
|
47
|
+
name: 'day',
|
|
48
|
+
type: 'select',
|
|
49
|
+
label: ({ t })=>t('reservation:fieldDay'),
|
|
50
|
+
options: [
|
|
51
|
+
{
|
|
52
|
+
label: ({ t })=>t('reservation:dayMonday'),
|
|
53
|
+
value: 'mon'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: ({ t })=>t('reservation:dayTuesday'),
|
|
57
|
+
value: 'tue'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: ({ t })=>t('reservation:dayWednesday'),
|
|
61
|
+
value: 'wed'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: ({ t })=>t('reservation:dayThursday'),
|
|
65
|
+
value: 'thu'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: ({ t })=>t('reservation:dayFriday'),
|
|
69
|
+
value: 'fri'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: ({ t })=>t('reservation:daySaturday'),
|
|
73
|
+
value: 'sat'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: ({ t })=>t('reservation:daySunday'),
|
|
77
|
+
value: 'sun'
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
required: true
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'startTime',
|
|
84
|
+
type: 'text',
|
|
85
|
+
admin: {
|
|
86
|
+
placeholder: '09:00'
|
|
87
|
+
},
|
|
88
|
+
label: ({ t })=>t('reservation:fieldStartTimeHHmm'),
|
|
89
|
+
required: true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'endTime',
|
|
93
|
+
type: 'text',
|
|
94
|
+
admin: {
|
|
95
|
+
placeholder: '17:00'
|
|
96
|
+
},
|
|
97
|
+
label: ({ t })=>t('reservation:fieldEndTimeHHmm'),
|
|
98
|
+
required: true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
label: ({ t })=>t('reservation:fieldRecurringSlots')
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'manualSlots',
|
|
105
|
+
type: 'array',
|
|
106
|
+
admin: {
|
|
107
|
+
condition: (_, siblingData)=>siblingData?.scheduleType === 'manual'
|
|
108
|
+
},
|
|
109
|
+
fields: [
|
|
110
|
+
{
|
|
111
|
+
name: 'date',
|
|
112
|
+
type: 'date',
|
|
113
|
+
admin: {
|
|
114
|
+
date: {
|
|
115
|
+
pickerAppearance: 'dayOnly'
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
label: ({ t })=>t('reservation:fieldDate'),
|
|
119
|
+
required: true
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'startTime',
|
|
123
|
+
type: 'text',
|
|
124
|
+
admin: {
|
|
125
|
+
placeholder: '09:00'
|
|
126
|
+
},
|
|
127
|
+
label: ({ t })=>t('reservation:fieldStartTimeHHmm'),
|
|
128
|
+
required: true
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'endTime',
|
|
132
|
+
type: 'text',
|
|
133
|
+
admin: {
|
|
134
|
+
placeholder: '17:00'
|
|
135
|
+
},
|
|
136
|
+
label: ({ t })=>t('reservation:fieldEndTimeHHmm'),
|
|
137
|
+
required: true
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
label: ({ t })=>t('reservation:fieldManualSlots')
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'exceptions',
|
|
144
|
+
type: 'array',
|
|
145
|
+
fields: [
|
|
146
|
+
{
|
|
147
|
+
name: 'date',
|
|
148
|
+
type: 'date',
|
|
149
|
+
admin: {
|
|
150
|
+
date: {
|
|
151
|
+
pickerAppearance: 'dayOnly'
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
label: ({ t })=>t('reservation:fieldDate'),
|
|
155
|
+
required: true
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'reason',
|
|
159
|
+
type: 'text',
|
|
160
|
+
label: ({ t })=>t('reservation:fieldReason')
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
label: ({ t })=>t('reservation:fieldExceptions')
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'active',
|
|
167
|
+
type: 'checkbox',
|
|
168
|
+
admin: {
|
|
169
|
+
position: 'sidebar'
|
|
170
|
+
},
|
|
171
|
+
defaultValue: true,
|
|
172
|
+
label: ({ t })=>t('reservation:fieldActive')
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
labels: {
|
|
176
|
+
plural: ({ t })=>t('reservation:collectionSchedules'),
|
|
177
|
+
singular: ({ t })=>t('reservation:collectionSchedules')
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
//# sourceMappingURL=Schedules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/Schedules.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport type { PluginT } from '../translations/index.js'\nimport type { ResolvedReservationPluginConfig } from '../types.js'\n\nexport function createSchedulesCollection(\n config: ResolvedReservationPluginConfig,\n): CollectionConfig {\n return {\n slug: config.slugs.schedules,\n access: config.access.schedules ?? {},\n admin: {\n group: config.adminGroup,\n useAsTitle: 'name',\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n label: ({ t }) => (t as PluginT)('reservation:fieldName'),\n required: true,\n },\n {\n name: 'resource',\n type: 'relationship',\n label: ({ t }) => (t as PluginT)('reservation:fieldResource'),\n relationTo: config.slugs.resources,\n required: true,\n },\n {\n name: 'scheduleType',\n type: 'select',\n defaultValue: 'recurring',\n label: ({ t }) => (t as PluginT)('reservation:fieldScheduleType'),\n options: [\n {\n label: ({ t }) => (t as PluginT)('reservation:scheduleTypeRecurring'),\n value: 'recurring',\n },\n {\n label: ({ t }) => (t as PluginT)('reservation:scheduleTypeManual'),\n value: 'manual',\n },\n ],\n },\n {\n name: 'recurringSlots',\n type: 'array',\n admin: {\n condition: (_, siblingData) => siblingData?.scheduleType === 'recurring',\n },\n fields: [\n {\n name: 'day',\n type: 'select',\n label: ({ t }) => (t as PluginT)('reservation:fieldDay'),\n options: [\n { label: ({ t }) => (t as PluginT)('reservation:dayMonday'), value: 'mon' },\n { label: ({ t }) => (t as PluginT)('reservation:dayTuesday'), value: 'tue' },\n { label: ({ t }) => (t as PluginT)('reservation:dayWednesday'), value: 'wed' },\n { label: ({ t }) => (t as PluginT)('reservation:dayThursday'), value: 'thu' },\n { label: ({ t }) => (t as PluginT)('reservation:dayFriday'), value: 'fri' },\n { label: ({ t }) => (t as PluginT)('reservation:daySaturday'), value: 'sat' },\n { label: ({ t }) => (t as PluginT)('reservation:daySunday'), value: 'sun' },\n ],\n required: true,\n },\n {\n name: 'startTime',\n type: 'text',\n admin: {\n placeholder: '09:00',\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldStartTimeHHmm'),\n required: true,\n },\n {\n name: 'endTime',\n type: 'text',\n admin: {\n placeholder: '17:00',\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldEndTimeHHmm'),\n required: true,\n },\n ],\n label: ({ t }) => (t as PluginT)('reservation:fieldRecurringSlots'),\n },\n {\n name: 'manualSlots',\n type: 'array',\n admin: {\n condition: (_, siblingData) => siblingData?.scheduleType === 'manual',\n },\n fields: [\n {\n name: 'date',\n type: 'date',\n admin: {\n date: {\n pickerAppearance: 'dayOnly',\n },\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldDate'),\n required: true,\n },\n {\n name: 'startTime',\n type: 'text',\n admin: {\n placeholder: '09:00',\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldStartTimeHHmm'),\n required: true,\n },\n {\n name: 'endTime',\n type: 'text',\n admin: {\n placeholder: '17:00',\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldEndTimeHHmm'),\n required: true,\n },\n ],\n label: ({ t }) => (t as PluginT)('reservation:fieldManualSlots'),\n },\n {\n name: 'exceptions',\n type: 'array',\n fields: [\n {\n name: 'date',\n type: 'date',\n admin: {\n date: {\n pickerAppearance: 'dayOnly',\n },\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldDate'),\n required: true,\n },\n {\n name: 'reason',\n type: 'text',\n label: ({ t }) => (t as PluginT)('reservation:fieldReason'),\n },\n ],\n label: ({ t }) => (t as PluginT)('reservation:fieldExceptions'),\n },\n {\n name: 'active',\n type: 'checkbox',\n admin: {\n position: 'sidebar',\n },\n defaultValue: true,\n label: ({ t }) => (t as PluginT)('reservation:fieldActive'),\n },\n ],\n labels: {\n plural: ({ t }) => (t as PluginT)('reservation:collectionSchedules'),\n singular: ({ t }) => (t as PluginT)('reservation:collectionSchedules'),\n },\n }\n}\n"],"names":["createSchedulesCollection","config","slug","slugs","schedules","access","admin","group","adminGroup","useAsTitle","fields","name","type","label","t","required","relationTo","resources","defaultValue","options","value","condition","_","siblingData","scheduleType","placeholder","date","pickerAppearance","position","labels","plural","singular"],"mappings":"AAKA,OAAO,SAASA,0BACdC,MAAuC;IAEvC,OAAO;QACLC,MAAMD,OAAOE,KAAK,CAACC,SAAS;QAC5BC,QAAQJ,OAAOI,MAAM,CAACD,SAAS,IAAI,CAAC;QACpCE,OAAO;YACLC,OAAON,OAAOO,UAAU;YACxBC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjCC,UAAU;YACZ;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjCE,YAAYf,OAAOE,KAAK,CAACc,SAAS;gBAClCF,UAAU;YACZ;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNM,cAAc;gBACdL,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjCK,SAAS;oBACP;wBACEN,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;wBACjCM,OAAO;oBACT;oBACA;wBACEP,OAAO,C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Ac;YACnC;SACD;QACDe,QAAQ;YACNC,QAAQ,CAAC,EAAEhB,CAAC,EAAE,GAAK,AAACA,EAAc;YAClCiB,UAAU,CAAC,EAAEjB,CAAC,EAAE,GAAK,AAACA,EAAc;QACtC;IACF;AACF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export function createServicesCollection(config) {
|
|
2
|
+
return {
|
|
3
|
+
slug: config.slugs.services,
|
|
4
|
+
access: config.access.services ?? {},
|
|
5
|
+
admin: {
|
|
6
|
+
group: config.adminGroup,
|
|
7
|
+
useAsTitle: 'name'
|
|
8
|
+
},
|
|
9
|
+
fields: [
|
|
10
|
+
{
|
|
11
|
+
name: 'name',
|
|
12
|
+
type: 'text',
|
|
13
|
+
label: ({ t })=>t('reservation:fieldName'),
|
|
14
|
+
...config.localized ? {
|
|
15
|
+
localized: true
|
|
16
|
+
} : {},
|
|
17
|
+
maxLength: 200,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'description',
|
|
22
|
+
type: 'textarea',
|
|
23
|
+
label: ({ t })=>t('reservation:fieldDescription'),
|
|
24
|
+
...config.localized ? {
|
|
25
|
+
localized: true
|
|
26
|
+
} : {}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'duration',
|
|
30
|
+
type: 'number',
|
|
31
|
+
label: ({ t })=>t('reservation:fieldDurationMinutes'),
|
|
32
|
+
min: 1,
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'price',
|
|
37
|
+
type: 'number',
|
|
38
|
+
admin: {
|
|
39
|
+
step: 0.01
|
|
40
|
+
},
|
|
41
|
+
label: ({ t })=>t('reservation:fieldPrice'),
|
|
42
|
+
min: 0
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'bufferTimeBefore',
|
|
46
|
+
type: 'number',
|
|
47
|
+
defaultValue: 0,
|
|
48
|
+
label: ({ t })=>t('reservation:fieldBufferTimeBefore'),
|
|
49
|
+
min: 0
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'bufferTimeAfter',
|
|
53
|
+
type: 'number',
|
|
54
|
+
defaultValue: 0,
|
|
55
|
+
label: ({ t })=>t('reservation:fieldBufferTimeAfter'),
|
|
56
|
+
min: 0
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'active',
|
|
60
|
+
type: 'checkbox',
|
|
61
|
+
admin: {
|
|
62
|
+
position: 'sidebar'
|
|
63
|
+
},
|
|
64
|
+
defaultValue: true,
|
|
65
|
+
label: ({ t })=>t('reservation:fieldActive')
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
labels: {
|
|
69
|
+
plural: ({ t })=>t('reservation:collectionServices'),
|
|
70
|
+
singular: ({ t })=>t('reservation:collectionServices')
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=Services.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/Services.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport type { PluginT } from '../translations/index.js'\nimport type { ResolvedReservationPluginConfig } from '../types.js'\n\nexport function createServicesCollection(config: ResolvedReservationPluginConfig): CollectionConfig {\n return {\n slug: config.slugs.services,\n access: config.access.services ?? {},\n admin: {\n group: config.adminGroup,\n useAsTitle: 'name',\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n label: ({ t }) => (t as PluginT)('reservation:fieldName'),\n ...(config.localized ? { localized: true } : {}),\n maxLength: 200,\n required: true,\n },\n {\n name: 'description',\n type: 'textarea',\n label: ({ t }) => (t as PluginT)('reservation:fieldDescription'),\n ...(config.localized ? { localized: true } : {}),\n },\n {\n name: 'duration',\n type: 'number',\n label: ({ t }) => (t as PluginT)('reservation:fieldDurationMinutes'),\n min: 1,\n required: true,\n },\n {\n name: 'price',\n type: 'number',\n admin: {\n step: 0.01,\n },\n label: ({ t }) => (t as PluginT)('reservation:fieldPrice'),\n min: 0,\n },\n {\n name: 'bufferTimeBefore',\n type: 'number',\n defaultValue: 0,\n label: ({ t }) => (t as PluginT)('reservation:fieldBufferTimeBefore'),\n min: 0,\n },\n {\n name: 'bufferTimeAfter',\n type: 'number',\n defaultValue: 0,\n label: ({ t }) => (t as PluginT)('reservation:fieldBufferTimeAfter'),\n min: 0,\n },\n {\n name: 'active',\n type: 'checkbox',\n admin: {\n position: 'sidebar',\n },\n defaultValue: true,\n label: ({ t }) => (t as PluginT)('reservation:fieldActive'),\n },\n ],\n labels: {\n plural: ({ t }) => (t as PluginT)('reservation:collectionServices'),\n singular: ({ t }) => (t as PluginT)('reservation:collectionServices'),\n },\n }\n}\n"],"names":["createServicesCollection","config","slug","slugs","services","access","admin","group","adminGroup","useAsTitle","fields","name","type","label","t","localized","maxLength","required","min","step","defaultValue","position","labels","plural","singular"],"mappings":"AAKA,OAAO,SAASA,yBAAyBC,MAAuC;IAC9E,OAAO;QACLC,MAAMD,OAAOE,KAAK,CAACC,QAAQ;QAC3BC,QAAQJ,OAAOI,MAAM,CAACD,QAAQ,IAAI,CAAC;QACnCE,OAAO;YACLC,OAAON,OAAOO,UAAU;YACxBC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjC,GAAIb,OAAOc,SAAS,GAAG;oBAAEA,WAAW;gBAAK,IAAI,CAAC,CAAC;gBAC/CC,WAAW;gBACXC,UAAU;YACZ;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjC,GAAIb,OAAOc,SAAS,GAAG;oBAAEA,WAAW;gBAAK,IAAI,CAAC,CAAC;YACjD;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjCI,KAAK;gBACLD,UAAU;YACZ;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNN,OAAO;oBACLa,MAAM;gBACR;gBACAN,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjCI,KAAK;YACP;YACA;gBACEP,MAAM;gBACNC,MAAM;gBACNQ,cAAc;gBACdP,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjCI,KAAK;YACP;YACA;gBACEP,MAAM;gBACNC,MAAM;gBACNQ,cAAc;gBACdP,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;gBACjCI,KAAK;YACP;YACA;gBACEP,MAAM;gBACNC,MAAM;gBACNN,OAAO;oBACLe,UAAU;gBACZ;gBACAD,cAAc;gBACdP,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAK,AAACA,EAAc;YACnC;SACD;QACDQ,QAAQ;YACNC,QAAQ,CAAC,EAAET,CAAC,EAAE,GAAK,AAACA,EAAc;YAClCU,UAAU,CAAC,EAAEV,CAAC,EAAE,GAAK,AAACA,EAAc;QACtC;IACF;AACF"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
.wrapper {
|
|
2
|
+
padding: 20px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.title {
|
|
6
|
+
margin: 0 0 16px;
|
|
7
|
+
font-size: 1.25rem;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.navigation {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 8px;
|
|
14
|
+
margin-bottom: 16px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.navButton {
|
|
18
|
+
background: var(--theme-elevation-100);
|
|
19
|
+
border: 1px solid var(--theme-elevation-200);
|
|
20
|
+
border-radius: 4px;
|
|
21
|
+
padding: 6px 12px;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
font-size: 0.875rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.navButton:hover {
|
|
27
|
+
background: var(--theme-elevation-200);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.weekLabel {
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.grid {
|
|
35
|
+
display: grid;
|
|
36
|
+
gap: 1px;
|
|
37
|
+
background: var(--theme-elevation-150);
|
|
38
|
+
border: 1px solid var(--theme-elevation-150);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.headerCell {
|
|
42
|
+
padding: 8px;
|
|
43
|
+
text-align: center;
|
|
44
|
+
font-size: 0.75rem;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
background: var(--theme-elevation-50);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.resourceName {
|
|
50
|
+
padding: 8px;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
font-size: 0.8125rem;
|
|
53
|
+
background: var(--theme-bg);
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.cell {
|
|
59
|
+
padding: 4px;
|
|
60
|
+
background: var(--theme-bg);
|
|
61
|
+
min-height: 60px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.slotAvailable {
|
|
65
|
+
font-size: 0.625rem;
|
|
66
|
+
padding: 2px 4px;
|
|
67
|
+
margin-bottom: 1px;
|
|
68
|
+
border-radius: 2px;
|
|
69
|
+
background: #d1fae5;
|
|
70
|
+
color: #065f46;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.slotBooked {
|
|
74
|
+
font-size: 0.625rem;
|
|
75
|
+
padding: 2px 4px;
|
|
76
|
+
margin-bottom: 1px;
|
|
77
|
+
border-radius: 2px;
|
|
78
|
+
background: #dbeafe;
|
|
79
|
+
color: #1e40af;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.slotException {
|
|
83
|
+
font-size: 0.625rem;
|
|
84
|
+
padding: 2px 4px;
|
|
85
|
+
margin-bottom: 1px;
|
|
86
|
+
border-radius: 2px;
|
|
87
|
+
background: #e5e7eb;
|
|
88
|
+
color: #6b7280;
|
|
89
|
+
font-style: italic;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.loading {
|
|
93
|
+
text-align: center;
|
|
94
|
+
padding: 40px;
|
|
95
|
+
color: var(--theme-elevation-400);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.noResources {
|
|
99
|
+
text-align: center;
|
|
100
|
+
padding: 40px;
|
|
101
|
+
color: var(--theme-elevation-400);
|
|
102
|
+
font-style: italic;
|
|
103
|
+
}
|