@cratis/scene.blueprint.hr 0.0.0-stage → 4.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -2
- package/blueprint.ts +16 -0
- package/blueprintCatalog.json +164 -0
- package/dist/cjs/blueprint.js +19 -0
- package/dist/cjs/blueprint.js.map +1 -0
- package/dist/cjs/hrApplication.js +49 -0
- package/dist/cjs/hrApplication.js.map +1 -0
- package/dist/cjs/hrParts.js +131 -0
- package/dist/cjs/hrParts.js.map +1 -0
- package/dist/cjs/hrQueries.js +67 -0
- package/dist/cjs/hrQueries.js.map +1 -0
- package/dist/cjs/hrScreenSet.js +61 -0
- package/dist/cjs/hrScreenSet.js.map +1 -0
- package/dist/cjs/index.js +69 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/manifest.js +65 -0
- package/dist/cjs/manifest.js.map +1 -0
- package/dist/cjs/navigation.js +135 -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/formTemplates.js +51 -0
- package/dist/cjs/templates/formTemplates.js.map +1 -0
- package/dist/cjs/templates/index.js +30 -0
- package/dist/cjs/templates/index.js.map +1 -0
- package/dist/cjs/templates/listTemplates.js +210 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -0
- package/dist/cjs/templates/orgChartTemplate.js +63 -0
- package/dist/cjs/templates/orgChartTemplate.js.map +1 -0
- package/dist/cjs/templates/recordTemplates.js +181 -0
- package/dist/cjs/templates/recordTemplates.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/hrApplication.d.ts +10 -0
- package/dist/esm/hrApplication.d.ts.map +1 -0
- package/dist/esm/hrApplication.js +44 -0
- package/dist/esm/hrApplication.js.map +1 -0
- package/dist/esm/hrParts.d.ts +15 -0
- package/dist/esm/hrParts.d.ts.map +1 -0
- package/dist/esm/hrParts.js +114 -0
- package/dist/esm/hrParts.js.map +1 -0
- package/dist/esm/hrQueries.d.ts +38 -0
- package/dist/esm/hrQueries.d.ts.map +1 -0
- package/dist/esm/hrQueries.js +59 -0
- package/dist/esm/hrQueries.js.map +1 -0
- package/dist/esm/hrScreenSet.d.ts +7 -0
- package/dist/esm/hrScreenSet.d.ts.map +1 -0
- package/dist/esm/hrScreenSet.js +59 -0
- package/dist/esm/hrScreenSet.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 +17 -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 +63 -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 +131 -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/formTemplates.d.ts +3 -0
- package/dist/esm/templates/formTemplates.d.ts.map +1 -0
- package/dist/esm/templates/formTemplates.js +49 -0
- package/dist/esm/templates/formTemplates.js.map +1 -0
- package/dist/esm/templates/index.d.ts +7 -0
- package/dist/esm/templates/index.d.ts.map +1 -0
- package/dist/esm/templates/index.js +19 -0
- package/dist/esm/templates/index.js.map +1 -0
- package/dist/esm/templates/listTemplates.d.ts +6 -0
- package/dist/esm/templates/listTemplates.d.ts.map +1 -0
- package/dist/esm/templates/listTemplates.js +205 -0
- package/dist/esm/templates/listTemplates.js.map +1 -0
- package/dist/esm/templates/orgChartTemplate.d.ts +3 -0
- package/dist/esm/templates/orgChartTemplate.d.ts.map +1 -0
- package/dist/esm/templates/orgChartTemplate.js +61 -0
- package/dist/esm/templates/orgChartTemplate.js.map +1 -0
- package/dist/esm/templates/recordTemplates.d.ts +4 -0
- package/dist/esm/templates/recordTemplates.d.ts.map +1 -0
- package/dist/esm/templates/recordTemplates.js +178 -0
- package/dist/esm/templates/recordTemplates.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/hrApplication.ts +28 -0
- package/hrParts.ts +52 -0
- package/hrQueries.ts +59 -0
- package/hrScreenSet.ts +24 -0
- package/index.ts +14 -0
- package/manifest.ts +41 -0
- package/navigation.ts +59 -0
- package/package.json +78 -4
- package/packageName.ts +5 -0
- package/sampleData/hr-nordic.json +1659 -0
- package/screens/index.ts +20 -0
- package/templateProvenance.ts +15 -0
- package/templates/formTemplates.ts +34 -0
- package/templates/index.ts +21 -0
- package/templates/listTemplates.ts +109 -0
- package/templates/orgChartTemplate.ts +27 -0
- package/templates/recordTemplates.ts +75 -0
- package/thumbnails/HrEmployeeDirectory.svg +29 -0
- package/thumbnails/HrEmployeePage.svg +18 -0
- package/thumbnails/HrOnboardingChecklist.svg +18 -0
- package/thumbnails/HrOnboardingList.svg +13 -0
- package/thumbnails/HrOrgChart.svg +20 -0
- package/thumbnails/HrQuickCreateEmployee.svg +12 -0
- package/thumbnails/HrRequestTimeOff.svg +12 -0
- package/thumbnails/HrTimeOffBalanceList.svg +13 -0
- package/thumbnails/HrTimeOffList.svg +13 -0
- package/thumbnails/hr.svg +14 -0
package/README.md
CHANGED
|
@@ -1,3 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Scene
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Describing a user interface without describing a platform** — Scene is the UI model of the Cratis
|
|
4
|
+
model-first layer (experimental).
|
|
5
|
+
|
|
6
|
+
The object model and runtime for Screenplay-based UIs: `Scene.Model` (platform-agnostic screens, layouts,
|
|
7
|
+
forms, contribution points, ui profiles and themes), `Scene.Engine` (binding/resolution runtime), and
|
|
8
|
+
`Scene.React` (the React renderer).
|
|
9
|
+
|
|
10
|
+
## Packages / Deployables
|
|
11
|
+
|
|
12
|
+
[](http://nuget.org/packages/Cratis.Scene.Model)
|
|
13
|
+
[](https://www.npmjs.com/package/@cratis/scene.model)
|
|
14
|
+
[](https://www.npmjs.com/package/@cratis/scene.engine)
|
|
15
|
+
[](https://www.npmjs.com/package/@cratis/scene.react)
|
|
16
|
+
|
|
17
|
+
## Builds
|
|
18
|
+
|
|
19
|
+
[](https://github.com/cratis/scene/actions/workflows/dotnet-build.yml)
|
|
20
|
+
[](https://github.com/cratis/scene/actions/workflows/javascript-build.yml)
|
|
21
|
+
|
|
22
|
+
## Description
|
|
23
|
+
|
|
24
|
+
Scene owns the *object model and runtime* half of the Screenplay stack. In the model-first pipeline,
|
|
25
|
+
[Screenplay](https://github.com/Cratis/Screenplay) describes an event-sourced, CQRS system,
|
|
26
|
+
[Stage](https://github.com/Cratis/Stage) renders it into a running application, and Scene is how that
|
|
27
|
+
application's user interface is described — independently of any rendering platform.
|
|
28
|
+
|
|
29
|
+
`Scene.Model` is the platform-agnostic
|
|
30
|
+
C# object model that [Stage](https://github.com/Cratis/Stage) translates Screenplay's parsed language constructs into, and that [Studio](https://github.com/Cratis/Studio)'s
|
|
31
|
+
design-time tooling reads and writes. `Scene.Engine` walks that graph, resolves bindings (data, action, form,
|
|
32
|
+
navigation contribution) and drives whichever renderer is plugged in — it does not know React exists.
|
|
33
|
+
`Scene.React` is one renderer implementing the abstract vocabulary against real React/DOM; sibling positions
|
|
34
|
+
are reserved for future `Scene.Native` / `Scene.Desktop` renderers. Vendor and internal component packages
|
|
35
|
+
(PrimeReact, internal widget libraries) are adapters plugging into the renderer contract, not part of it.
|
|
36
|
+
|
|
37
|
+
The design-time editor built on top of this object model lives in Studio, not here — see
|
|
38
|
+
[StudioIssues#156](https://github.com/Cratis/StudioIssues/issues/156).
|
|
39
|
+
|
|
40
|
+
## Support
|
|
41
|
+
|
|
42
|
+
Cratis is an open community, and we are glad to help users, teams evaluating the stack, and contributors.
|
|
43
|
+
|
|
44
|
+
| Channel | Details |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Discord | Join the community on [Discord](https://discord.gg/kt4AMpV8WV) for questions and discussions |
|
|
47
|
+
| GitHub Issues | [Report bugs or request features](https://github.com/Cratis/Scene/issues) |
|
|
48
|
+
| Documentation | Read the docs at [cratis.io](https://cratis.io) |
|
|
49
|
+
|
|
50
|
+
## The Cratis ecosystem
|
|
51
|
+
|
|
52
|
+
This project is part of [Cratis](https://www.cratis.io) — free, MIT-licensed tools for building event-sourced and CQRS applications.
|
|
53
|
+
|
|
54
|
+
- **[Chronicle](https://github.com/Cratis/Chronicle)** — event-sourcing database and runtime. Orleans-based kernel, pluggable storage (MongoDB default; PostgreSQL, SQL Server, SQLite, in-memory), language-agnostic gRPC contracts. [Docs](https://www.cratis.io/chronicle/)
|
|
55
|
+
- **Chronicle clients** — first-class [.NET SDK](https://github.com/Cratis/Chronicle), plus [TypeScript](https://github.com/Cratis/Chronicle.TypeScript), [Kotlin/Java](https://github.com/Cratis/Chronicle.Kotlin), and [Elixir](https://github.com/Cratis/Chronicle.Elixir); [Python](https://github.com/Cratis/Chronicle.Python) coming soon (pre-alpha). AI agents connect through the [Chronicle MCP server](https://github.com/Cratis/Chronicle.Mcp).
|
|
56
|
+
- **[Arc](https://github.com/Cratis/Arc)** — opinionated CQRS framework for ASP.NET Core with commands, queries, validation, authorization, and TypeScript proxy generation. Works without event sourcing. [Docs](https://www.cratis.io/arc/)
|
|
57
|
+
- **[Components](https://github.com/Cratis/Components)** — React components aligned with Arc patterns. [Docs](https://www.cratis.io/components/)
|
|
58
|
+
- **[CLI](https://github.com/Cratis/cli) + Workbench** — inspect and diagnose Chronicle from the terminal or the browser. [Docs](https://www.cratis.io/cli/)
|
|
59
|
+
- **Model-first layer (experimental)** — [Studio](https://github.com/Cratis/Studio), [Screenplay](https://github.com/Cratis/Screenplay), [Stage](https://github.com/Cratis/Stage), Scene (this repository), [Prologue](https://github.com/Cratis/Prologue)
|
|
60
|
+
- **Supporting** — [Fundamentals](https://github.com/Cratis/Fundamentals), [Specifications](https://github.com/Cratis/Specifications), [Synopsis](https://github.com/Cratis/Synopsis), [Lens](https://github.com/Cratis/Lens), [Narrator](https://github.com/Cratis/Narrator), and free [AI tooling](https://github.com/Cratis/AI) (preview); [Ensemble](https://github.com/Cratis/Ensemble) coming soon (pre-release)
|
|
61
|
+
- **[Samples](https://github.com/Cratis/Samples)** — runnable event sourcing and CQRS samples for the whole stack
|
|
62
|
+
|
|
63
|
+
Everything Cratis publishes today is MIT licensed and free to use.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
Part of the [Cratis](https://www.cratis.io) platform · [MIT](./LICENSE)
|
package/blueprint.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { ScenePackageBundle } from '@cratis/scene.react';
|
|
5
|
+
import { hrBlueprintManifest } from './manifest';
|
|
6
|
+
import { hrScreens } from './screens';
|
|
7
|
+
import { hrDialogTemplates, hrScreenTemplates } from './templates';
|
|
8
|
+
|
|
9
|
+
/** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */
|
|
10
|
+
export const hrBlueprint: ScenePackageBundle = {
|
|
11
|
+
manifest: hrBlueprintManifest,
|
|
12
|
+
components: {},
|
|
13
|
+
screenTemplates: hrScreenTemplates,
|
|
14
|
+
dialogTemplates: hrDialogTemplates,
|
|
15
|
+
screens: hrScreens,
|
|
16
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 1,
|
|
3
|
+
"blueprints": [
|
|
4
|
+
{
|
|
5
|
+
"package": "Cratis.Blueprint.Hr",
|
|
6
|
+
"version": "1.0.0",
|
|
7
|
+
"domain": "hr",
|
|
8
|
+
"displayName": "HR People and Time Off",
|
|
9
|
+
"description": "People, the org chart, time off and onboarding for an HR team: a directory of cards, employee pages, an org tree, time-off requests and balances, and onboarding checklists.",
|
|
10
|
+
"thumbnail": "thumbnails/hr.svg",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"licenseUrl": "https://github.com/Cratis/Scene/blob/main/LICENSE",
|
|
13
|
+
"dependencies": [
|
|
14
|
+
{
|
|
15
|
+
"name": "Cratis.Blueprint.Default",
|
|
16
|
+
"versionRange": "^1.0.0"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"screens": [
|
|
20
|
+
{
|
|
21
|
+
"name": "hr.directory",
|
|
22
|
+
"title": "Directory",
|
|
23
|
+
"description": "Everyone in the company as cards with their photo, title, department and contact.",
|
|
24
|
+
"template": "HrEmployeeDirectory",
|
|
25
|
+
"order": 0
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "hr.directory.record",
|
|
29
|
+
"title": "Employee",
|
|
30
|
+
"description": "One employee: personal and job information, documents and time-off balance.",
|
|
31
|
+
"template": "HrEmployeePage",
|
|
32
|
+
"parent": "hr.directory"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "hr.org",
|
|
36
|
+
"title": "Org chart",
|
|
37
|
+
"description": "Who reports to whom, as a tree.",
|
|
38
|
+
"template": "HrOrgChart",
|
|
39
|
+
"order": 1
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "hr.timeoff",
|
|
43
|
+
"title": "Time off",
|
|
44
|
+
"description": "Time-off requests to approve, with who is away and for how long.",
|
|
45
|
+
"template": "HrTimeOffList",
|
|
46
|
+
"order": 2
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "hr.timeoff.balances",
|
|
50
|
+
"title": "Balances",
|
|
51
|
+
"description": "What each employee has taken and has left.",
|
|
52
|
+
"template": "HrTimeOffBalanceList",
|
|
53
|
+
"parent": "hr.timeoff"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "hr.onboarding",
|
|
57
|
+
"title": "Onboarding",
|
|
58
|
+
"description": "New hires and how far along their onboarding is.",
|
|
59
|
+
"template": "HrOnboardingList",
|
|
60
|
+
"order": 3
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "hr.onboarding.record",
|
|
64
|
+
"title": "Onboarding checklist",
|
|
65
|
+
"description": "One new hire's checklist: sections of tasks, each with an owner and a due date.",
|
|
66
|
+
"template": "HrOnboardingChecklist",
|
|
67
|
+
"parent": "hr.onboarding"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"templates": [
|
|
71
|
+
{
|
|
72
|
+
"name": "HrEmployeeDirectory",
|
|
73
|
+
"kind": "ScreenTemplate",
|
|
74
|
+
"displayName": "HR employee directory",
|
|
75
|
+
"description": "Employees as cards with photo, name, title, department and contact, filtered by department, location and status.",
|
|
76
|
+
"type": "List",
|
|
77
|
+
"category": "Business / HR",
|
|
78
|
+
"thumbnail": "thumbnails/HrEmployeeDirectory.svg"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "HrEmployeePage",
|
|
82
|
+
"kind": "ScreenTemplate",
|
|
83
|
+
"displayName": "HR employee page",
|
|
84
|
+
"description": "One employee: personal and job information, documents and time-off balance.",
|
|
85
|
+
"type": "Detail",
|
|
86
|
+
"category": "Business / HR",
|
|
87
|
+
"thumbnail": "thumbnails/HrEmployeePage.svg"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "HrOrgChart",
|
|
91
|
+
"kind": "ScreenTemplate",
|
|
92
|
+
"displayName": "HR org chart",
|
|
93
|
+
"description": "The company as a tree of who reports to whom, with titles and report counts.",
|
|
94
|
+
"type": "Detail",
|
|
95
|
+
"category": "Business / HR",
|
|
96
|
+
"thumbnail": "thumbnails/HrOrgChart.svg"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "HrTimeOffList",
|
|
100
|
+
"kind": "ScreenTemplate",
|
|
101
|
+
"displayName": "HR time off",
|
|
102
|
+
"description": "Time-off requests with the employee, type, dates, days and status, filtered by type, status and period.",
|
|
103
|
+
"type": "List",
|
|
104
|
+
"category": "Business / HR",
|
|
105
|
+
"thumbnail": "thumbnails/HrTimeOffList.svg"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "HrTimeOffBalanceList",
|
|
109
|
+
"kind": "ScreenTemplate",
|
|
110
|
+
"displayName": "HR time-off balances",
|
|
111
|
+
"description": "Each employee's entitlement, days taken and days left, with how much of it is used.",
|
|
112
|
+
"type": "List",
|
|
113
|
+
"category": "Business / HR",
|
|
114
|
+
"thumbnail": "thumbnails/HrTimeOffBalanceList.svg"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "HrOnboardingList",
|
|
118
|
+
"kind": "ScreenTemplate",
|
|
119
|
+
"displayName": "HR onboarding",
|
|
120
|
+
"description": "New hires with their start date, owner and a progress bar of their checklist.",
|
|
121
|
+
"type": "List",
|
|
122
|
+
"category": "Business / HR",
|
|
123
|
+
"thumbnail": "thumbnails/HrOnboardingList.svg"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "HrOnboardingChecklist",
|
|
127
|
+
"kind": "ScreenTemplate",
|
|
128
|
+
"displayName": "HR onboarding checklist",
|
|
129
|
+
"description": "One new hire's onboarding: checklist sections with an owner and a due date for each task, and the key facts of the hire.",
|
|
130
|
+
"type": "Detail",
|
|
131
|
+
"category": "Business / HR",
|
|
132
|
+
"thumbnail": "thumbnails/HrOnboardingChecklist.svg"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "HrRequestTimeOff",
|
|
136
|
+
"kind": "DialogTemplate",
|
|
137
|
+
"displayName": "HR quick create time-off request",
|
|
138
|
+
"description": "A short form that asks for time off without leaving the page.",
|
|
139
|
+
"type": "Dialog",
|
|
140
|
+
"category": "Business / HR",
|
|
141
|
+
"thumbnail": "thumbnails/HrRequestTimeOff.svg"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "HrQuickCreateEmployee",
|
|
145
|
+
"kind": "DialogTemplate",
|
|
146
|
+
"displayName": "HR quick create employee",
|
|
147
|
+
"description": "A short form that creates one employee without leaving the page.",
|
|
148
|
+
"type": "Dialog",
|
|
149
|
+
"category": "Business / HR",
|
|
150
|
+
"thumbnail": "thumbnails/HrQuickCreateEmployee.svg"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"sampleData": [
|
|
154
|
+
{
|
|
155
|
+
"id": "hr-nordic",
|
|
156
|
+
"title": "HR · Nordic",
|
|
157
|
+
"locale": "nb-NO",
|
|
158
|
+
"path": "sampleData/hr-nordic.json",
|
|
159
|
+
"default": true
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var manifest = require('./manifest.js');
|
|
4
|
+
var index = require('./screens/index.js');
|
|
5
|
+
var index$1 = require('./templates/index.js');
|
|
6
|
+
var formTemplates = require('./templates/formTemplates.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
|
+
/** This blueprint as a loadable bundle: the manifest names things, this provides them. It provides no component - every component is the foundation's. */ const hrBlueprint = {
|
|
11
|
+
manifest: manifest.hrBlueprintManifest,
|
|
12
|
+
components: {},
|
|
13
|
+
screenTemplates: index$1.hrScreenTemplates,
|
|
14
|
+
dialogTemplates: formTemplates.hrQuickCreateDialogs,
|
|
15
|
+
screens: index.hrScreens
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.hrBlueprint = hrBlueprint;
|
|
19
|
+
//# 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 { hrBlueprintManifest } from './manifest';\nimport { hrScreens } from './screens';\nimport { hrDialogTemplates, hrScreenTemplates } 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 hrBlueprint: ScenePackageBundle = {\n manifest: hrBlueprintManifest,\n components: {},\n screenTemplates: hrScreenTemplates,\n dialogTemplates: hrDialogTemplates,\n screens: hrScreens,\n};\n"],"names":["hrBlueprint","manifest","hrBlueprintManifest","components","screenTemplates","hrScreenTemplates","dialogTemplates","hrDialogTemplates","screens","hrScreens"],"mappings":";;;;;;;AAAA;AACA;AAOA,2JACO,MAAMA,WAAAA,GAAkC;IAC3CC,QAAAA,EAAUC,4BAAAA;AACVC,IAAAA,UAAAA,EAAY,EAAC;IACbC,eAAAA,EAAiBC,yBAAAA;IACjBC,eAAAA,EAAiBC,kCAAAA;IACjBC,OAAAA,EAASC;AACb;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_engine = require('@cratis/scene.engine');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var navigation = require('./navigation.js');
|
|
6
|
+
var index = require('./screens/index.js');
|
|
7
|
+
var index$1 = require('./templates/index.js');
|
|
8
|
+
var formTemplates = require('./templates/formTemplates.js');
|
|
9
|
+
|
|
10
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
11
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
12
|
+
/** The id of the sample-data pack a new application starts with. */ const hrDefaultSampleDataId = 'hr-nordic';
|
|
13
|
+
/**
|
|
14
|
+
* The example application of the blueprint: the foundation's layouts, the HR People and Time Off templates and quick-create dialogs and its seven screens, rendering against the
|
|
15
|
+
* foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture
|
|
16
|
+
* (`Samples/Hr/hr.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.
|
|
17
|
+
*/ function hrApplication(sampleData = hrDefaultSampleDataId) {
|
|
18
|
+
const profile = {
|
|
19
|
+
...scene_blueprint_default.previewProfile(undefined),
|
|
20
|
+
name: 'HR People and Time Off',
|
|
21
|
+
sampleData: {
|
|
22
|
+
activePack: sampleData,
|
|
23
|
+
mappings: [],
|
|
24
|
+
bindings: []
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
layouts: scene_blueprint_default.defaultLayouts,
|
|
29
|
+
screenTemplates: index$1.hrScreenTemplates,
|
|
30
|
+
dialogTemplates: formTemplates.hrQuickCreateDialogs,
|
|
31
|
+
screens: index.hrScreens,
|
|
32
|
+
uiProfiles: [
|
|
33
|
+
profile
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** What a host composes the screens with: the application's logo, which the shell's topbar shows. */ const hrComposition = {
|
|
38
|
+
logo: navigation.hrNavigation.application.logo
|
|
39
|
+
};
|
|
40
|
+
/** The structure and navigation the shell's regions show and the items' destinations resolve against. */ const hrNavigationModel = ()=>({
|
|
41
|
+
structure: new scene_engine.ApplicationStructureIndex(navigation.hrStructure),
|
|
42
|
+
navigation: navigation.hrNavigation
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
exports.hrApplication = hrApplication;
|
|
46
|
+
exports.hrComposition = hrComposition;
|
|
47
|
+
exports.hrDefaultSampleDataId = hrDefaultSampleDataId;
|
|
48
|
+
exports.hrNavigationModel = hrNavigationModel;
|
|
49
|
+
//# sourceMappingURL=hrApplication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hrApplication.js","sources":["../../hrApplication.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 { UiProfile } from '@cratis/scene.model';\nimport { ApplicationStructureIndex } from '@cratis/scene.engine';\nimport { ApplicationDocument, CompositionOptions, defaultLayouts, previewProfile } from '@cratis/scene.blueprint.default';\nimport { hrNavigation, hrStructure } from './navigation';\nimport { hrScreens } from './screens';\nimport { hrDialogTemplates, hrScreenTemplates } from './templates';\n\n/** The id of the sample-data pack a new application starts with. */\nexport const hrDefaultSampleDataId = 'hr-nordic';\n\n/**\n * The example application of the blueprint: the foundation's layouts, the HR People and Time Off templates and quick-create dialogs and its seven screens, rendering against the\n * foundation's packages with the default sample-data pack chosen. This is what a gallery previews and what the conformance fixture\n * (`Samples/Hr/hr.play`) declares in Screenplay: the document, the structure and the navigation are the three things an application is made of.\n */\nexport function hrApplication(sampleData: string = hrDefaultSampleDataId): ApplicationDocument {\n const profile: UiProfile = { ...previewProfile(undefined), name: 'HR People and Time Off', sampleData: { activePack: sampleData, mappings: [], bindings: [] } };\n return { layouts: defaultLayouts, screenTemplates: hrScreenTemplates, dialogTemplates: hrDialogTemplates, screens: hrScreens, uiProfiles: [profile] };\n}\n\n/** What a host composes the screens with: the application's logo, which the shell's topbar shows. */\nexport const hrComposition: CompositionOptions = { logo: hrNavigation.application.logo };\n\n/** The structure and navigation the shell's regions show and the items' destinations resolve against. */\nexport const hrNavigationModel = () => ({ structure: new ApplicationStructureIndex(hrStructure), navigation: hrNavigation });\n"],"names":["hrDefaultSampleDataId","hrApplication","sampleData","profile","previewProfile","undefined","name","activePack","mappings","bindings","layouts","defaultLayouts","screenTemplates","hrScreenTemplates","dialogTemplates","hrDialogTemplates","screens","hrScreens","uiProfiles","hrComposition","logo","hrNavigation","application","hrNavigationModel","structure","ApplicationStructureIndex","hrStructure","navigation"],"mappings":";;;;;;;;;AAAA;AACA;AASA,qEACO,MAAMA,qBAAAA,GAAwB;AAErC;;;;AAIC,IACM,SAASC,aAAAA,CAAcC,UAAAA,GAAqBF,qBAAqB,EAAA;AACpE,IAAA,MAAMG,OAAAA,GAAqB;AAAE,QAAA,GAAGC,uCAAeC,SAAAA,CAAU;QAAEC,IAAAA,EAAM,wBAAA;QAA0BJ,UAAAA,EAAY;YAAEK,UAAAA,EAAYL,UAAAA;AAAYM,YAAAA,QAAAA,EAAU,EAAE;AAAEC,YAAAA,QAAAA,EAAU;AAAG;AAAE,KAAA;IAC9J,OAAO;QAAEC,OAAAA,EAASC,sCAAAA;QAAgBC,eAAAA,EAAiBC,yBAAAA;QAAmBC,eAAAA,EAAiBC,kCAAAA;QAAmBC,OAAAA,EAASC,eAAAA;QAAWC,UAAAA,EAAY;AAACf,YAAAA;AAAQ;AAAC,KAAA;AACxJ;AAEA,sGACO,MAAMgB,aAAAA,GAAoC;IAAEC,IAAAA,EAAMC,uBAAAA,CAAaC,WAAW,CAACF;AAAK;AAEvF,0GACO,MAAMG,iBAAAA,GAAoB,KAAO;AAAEC,QAAAA,SAAAA,EAAW,IAAIC,sCAAAA,CAA0BC,sBAAAA,CAAAA;QAAcC,UAAAA,EAAYN;AAAa,KAAA;;;;;"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var scene_blueprint_default = require('@cratis/scene.blueprint.default');
|
|
5
|
+
var templateProvenance = require('./templateProvenance.js');
|
|
6
|
+
|
|
7
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
8
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
9
|
+
/** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */ const hrCategory = 'Business / HR';
|
|
10
|
+
/** The package-relative thumbnail of a template. */ const thumbnailOf = (templateName)=>`thumbnails/${templateName}.svg`;
|
|
11
|
+
/** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */ const hrMetadata = (name, type, scopes)=>({
|
|
12
|
+
...templateProvenance.hrTemplateProvenance,
|
|
13
|
+
type,
|
|
14
|
+
category: hrCategory,
|
|
15
|
+
thumbnail: thumbnailOf(name),
|
|
16
|
+
scopes
|
|
17
|
+
});
|
|
18
|
+
/** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */ const actionButton = (id, label, emphasis, extra = {}, behaviors)=>({
|
|
19
|
+
...scene_blueprint_default.component(id, 'actionButton', {
|
|
20
|
+
label,
|
|
21
|
+
emphasis,
|
|
22
|
+
permission: 'enabled',
|
|
23
|
+
...extra
|
|
24
|
+
}),
|
|
25
|
+
...behaviors ? {
|
|
26
|
+
behaviors
|
|
27
|
+
} : {}
|
|
28
|
+
});
|
|
29
|
+
/** What pressing an element does: open the named dialog template over the page. */ const opensDialog = (dialogTemplate)=>[
|
|
30
|
+
{
|
|
31
|
+
bindings: [
|
|
32
|
+
{
|
|
33
|
+
trigger: {
|
|
34
|
+
kind: scene_model.InteractionTriggerKind.Click
|
|
35
|
+
},
|
|
36
|
+
actions: [
|
|
37
|
+
{
|
|
38
|
+
kind: scene_model.InteractionActionKind.OpenDialog,
|
|
39
|
+
dialogTemplate
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
/** What pressing an element does: go to the named screen. */ const goesTo = (screen)=>[
|
|
47
|
+
{
|
|
48
|
+
bindings: [
|
|
49
|
+
{
|
|
50
|
+
trigger: {
|
|
51
|
+
kind: scene_model.InteractionTriggerKind.Click
|
|
52
|
+
},
|
|
53
|
+
actions: [
|
|
54
|
+
{
|
|
55
|
+
kind: scene_model.InteractionActionKind.Navigate,
|
|
56
|
+
screen
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
/**
|
|
64
|
+
* What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is
|
|
65
|
+
* opening it - the way a table of records works everywhere.
|
|
66
|
+
*/ const opensRecordOnSelect = (listId, screen)=>[
|
|
67
|
+
{
|
|
68
|
+
bindings: [
|
|
69
|
+
{
|
|
70
|
+
trigger: {
|
|
71
|
+
kind: scene_model.InteractionTriggerKind.Select
|
|
72
|
+
},
|
|
73
|
+
actions: [
|
|
74
|
+
{
|
|
75
|
+
kind: scene_model.InteractionActionKind.Navigate,
|
|
76
|
+
screen,
|
|
77
|
+
arguments: [
|
|
78
|
+
{
|
|
79
|
+
name: 'id',
|
|
80
|
+
value: {
|
|
81
|
+
kind: scene_model.BindingSourceKind.ComponentProperty,
|
|
82
|
+
componentId: listId,
|
|
83
|
+
path: 'value'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
/** What a Cancel or Close control does: close the dialog it was opened from. */ const closesDialog = ()=>[
|
|
94
|
+
{
|
|
95
|
+
bindings: [
|
|
96
|
+
{
|
|
97
|
+
trigger: {
|
|
98
|
+
kind: scene_model.InteractionTriggerKind.Click
|
|
99
|
+
},
|
|
100
|
+
actions: [
|
|
101
|
+
{
|
|
102
|
+
kind: scene_model.InteractionActionKind.CloseDialog
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
/** An element with the given behaviors attached. */ const withBehaviors = (element, behaviors)=>({
|
|
110
|
+
...element,
|
|
111
|
+
behaviors
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
Object.defineProperty(exports, "component", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () { return scene_blueprint_default.component; }
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "panel", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () { return scene_blueprint_default.panel; }
|
|
121
|
+
});
|
|
122
|
+
exports.actionButton = actionButton;
|
|
123
|
+
exports.closesDialog = closesDialog;
|
|
124
|
+
exports.goesTo = goesTo;
|
|
125
|
+
exports.hrCategory = hrCategory;
|
|
126
|
+
exports.hrMetadata = hrMetadata;
|
|
127
|
+
exports.opensDialog = opensDialog;
|
|
128
|
+
exports.opensRecordOnSelect = opensRecordOnSelect;
|
|
129
|
+
exports.thumbnailOf = thumbnailOf;
|
|
130
|
+
exports.withBehaviors = withBehaviors;
|
|
131
|
+
//# sourceMappingURL=hrParts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hrParts.js","sources":["../../hrParts.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 {\n Behavior, BindingSourceKind, DialogTemplate, ExternalComponent, InteractionActionKind, InteractionTriggerKind, NavigateAction, OpenDialogAction, SceneElement, ScreenTemplate, TemplateMetadata, TemplateScope,\n} from '@cratis/scene.model';\nimport { component, panel } from '@cratis/scene.blueprint.default';\nimport { hrTemplateProvenance } from './templateProvenance';\n\nexport { component, panel };\n\n/** The category of every template of this blueprint (spec Part B 1.2: `Business / <domain>`). */\nexport const hrCategory = 'Business / HR';\n\n/** The package-relative thumbnail of a template. */\nexport const thumbnailOf = (templateName: string): string => `thumbnails/${templateName}.svg`;\n\n/** The metadata of a screen template of this blueprint: provenance, a type from the vocabulary, the category, a thumbnail and the levels it applies at. */\nexport const hrMetadata = (name: string, type: 'Dashboard' | 'List' | 'Board' | 'Detail' | 'Form' | 'Dialog' | 'Workspace', scopes: TemplateScope[]): TemplateMetadata =>\n ({ ...hrTemplateProvenance, type, category: hrCategory, thumbnail: thumbnailOf(name), scopes });\n\n/** A button of the foundation: a verb, its emphasis, and the permission rule every action declares (spec Part B 1.5). */\nexport const actionButton = (id: string, label: string, emphasis: 'primary' | 'secondary' | 'quiet' | 'danger', extra: Record<string, unknown> = {}, behaviors?: Behavior[]): ExternalComponent =>\n ({ ...component(id, 'actionButton', { label, emphasis, permission: 'enabled', ...extra }), ...(behaviors ? { behaviors } : {}) });\n\n/** What pressing an element does: open the named dialog template over the page. */\nexport const opensDialog = (dialogTemplate: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.OpenDialog, dialogTemplate } as OpenDialogAction] }] }];\n\n/** What pressing an element does: go to the named screen. */\nexport const goesTo = (screen: string): Behavior[] =>\n [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.Navigate, screen } as NavigateAction] }] }];\n\n/**\n * What choosing a row of a list does: open the record page, handing it the chosen row's id. The list is single-selection, so choosing a row is\n * opening it - the way a table of records works everywhere.\n */\nexport const opensRecordOnSelect = (listId: string, screen: string): Behavior[] => [{\n bindings: [{\n trigger: { kind: InteractionTriggerKind.Select },\n actions: [{ kind: InteractionActionKind.Navigate, screen, arguments: [{ name: 'id', value: { kind: BindingSourceKind.ComponentProperty, componentId: listId, path: 'value' } }] } as NavigateAction],\n }],\n}];\n\n/** What a Cancel or Close control does: close the dialog it was opened from. */\nexport const closesDialog = (): Behavior[] => [{ bindings: [{ trigger: { kind: InteractionTriggerKind.Click }, actions: [{ kind: InteractionActionKind.CloseDialog }] }] }];\n\n/** An element with the given behaviors attached. */\nexport const withBehaviors = <T extends SceneElement>(element: T, behaviors: Behavior[]): T => ({ ...element, behaviors });\n\nexport type HrScreenTemplate = ScreenTemplate;\nexport type HrDialogTemplate = DialogTemplate;\n"],"names":["hrCategory","thumbnailOf","templateName","hrMetadata","name","type","scopes","hrTemplateProvenance","category","thumbnail","actionButton","id","label","emphasis","extra","behaviors","component","permission","opensDialog","dialogTemplate","bindings","trigger","kind","InteractionTriggerKind","Click","actions","InteractionActionKind","OpenDialog","goesTo","screen","Navigate","opensRecordOnSelect","listId","Select","arguments","value","BindingSourceKind","ComponentProperty","componentId","path","closesDialog","CloseDialog","withBehaviors","element"],"mappings":";;;;;;AAAA;AACA;AAUA,kGACO,MAAMA,UAAAA,GAAa;AAE1B,qDACO,MAAMC,WAAAA,GAAc,CAACC,YAAAA,GAAiC,CAAC,WAAW,EAAEA,YAAAA,CAAa,IAAI;AAE5F,4JACO,MAAMC,UAAAA,GAAa,CAACC,IAAAA,EAAcC,IAAAA,EAAmFC,UACvH;AAAE,QAAA,GAAGC,uCAAoB;AAAEF,QAAAA,IAAAA;QAAMG,QAAAA,EAAUR,UAAAA;AAAYS,QAAAA,SAAAA,EAAWR,WAAAA,CAAYG,IAAAA,CAAAA;AAAOE,QAAAA;AAAO,KAAA;AAEjG,0HACO,MAAMI,YAAAA,GAAe,CAACC,EAAAA,EAAYC,KAAAA,EAAeC,QAAAA,EAAwDC,KAAAA,GAAiC,EAAE,EAAEC,aAChJ;QAAE,GAAGC,iCAAAA,CAAUL,IAAI,cAAA,EAAgB;AAAEC,YAAAA,KAAAA;AAAOC,YAAAA,QAAAA;YAAUI,UAAAA,EAAY,SAAA;AAAW,YAAA,GAAGH;SAAM,CAAE;AAAE,QAAA,GAAIC,SAAAA,GAAY;AAAEA,YAAAA;AAAU,SAAA,GAAI;AAAI,KAAA;AAEnI,oFACO,MAAMG,WAAAA,GAAc,CAACC,cAAAA,GACxB;AAAC,QAAA;YAAEC,QAAAA,EAAU;AAAC,gBAAA;oBAAEC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBC;AAAM,qBAAA;oBAAGC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBC,UAAU;AAAER,4BAAAA;AAAe;AAAsB;AAAC;AAAE;AAAC;;AAElK,8DACO,MAAMS,MAAAA,GAAS,CAACC,MAAAA,GACnB;AAAC,QAAA;YAAET,QAAAA,EAAU;AAAC,gBAAA;oBAAEC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBC;AAAM,qBAAA;oBAAGC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBI,QAAQ;AAAED,4BAAAA;AAAO;AAAoB;AAAC;AAAE;AAAC;;AAEtJ;;;AAGC,IACM,MAAME,mBAAAA,GAAsB,CAACC,QAAgBH,MAAAA,GAA+B;AAAC,QAAA;YAChFT,QAAAA,EAAU;AAAC,gBAAA;oBACPC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBU;AAAO,qBAAA;oBAC/CR,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBI,QAAQ;AAAED,4BAAAA,MAAAA;4BAAQK,SAAAA,EAAW;AAAC,gCAAA;oCAAE9B,IAAAA,EAAM,IAAA;oCAAM+B,KAAAA,EAAO;AAAEb,wCAAAA,IAAAA,EAAMc,8BAAkBC,iBAAiB;wCAAEC,WAAAA,EAAaN,MAAAA;wCAAQO,IAAAA,EAAM;AAAQ;AAAE;AAAE;AAAC;AAAoB;AACxM;AAAE;AACN;;AAEA,iFACO,MAAMC,YAAAA,GAAe,IAAkB;AAAC,QAAA;YAAEpB,QAAAA,EAAU;AAAC,gBAAA;oBAAEC,OAAAA,EAAS;AAAEC,wBAAAA,IAAAA,EAAMC,mCAAuBC;AAAM,qBAAA;oBAAGC,OAAAA,EAAS;AAAC,wBAAA;AAAEH,4BAAAA,IAAAA,EAAMI,kCAAsBe;AAAY;AAAE;AAAC;AAAE;AAAC;;AAEzK,qDACO,MAAMC,gBAAgB,CAAyBC,OAAAA,EAAY5B,aAA8B;AAAE,QAAA,GAAG4B,OAAO;AAAE5B,QAAAA;AAAU,KAAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* A property taken from a query result - never a value. An HR template declares *where* its data comes from and the sample-data pack, or the real
|
|
9
|
+
* query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).
|
|
10
|
+
*/ const fromQuery = (query, path = '')=>({
|
|
11
|
+
kind: scene_model.BindingSourceKind.QueryResult,
|
|
12
|
+
query,
|
|
13
|
+
path
|
|
14
|
+
});
|
|
15
|
+
/** The queries of the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */ const HrQuery = {
|
|
16
|
+
/** One row: the `locale` the figures and dates are formatted in. */ Settings: 'HrSettings',
|
|
17
|
+
RecordTabs: 'HrRecordTabs',
|
|
18
|
+
OrgNodes: 'OrgNodes',
|
|
19
|
+
FormErrors: 'HrFormErrors'
|
|
20
|
+
};
|
|
21
|
+
/** The HR entities a template is made for. */ var HrEntityKind = /*#__PURE__*/ function(HrEntityKind) {
|
|
22
|
+
HrEntityKind["Employee"] = "Employee";
|
|
23
|
+
HrEntityKind["TimeOff"] = "TimeOff";
|
|
24
|
+
HrEntityKind["Balance"] = "Balance";
|
|
25
|
+
HrEntityKind["Onboarding"] = "Onboarding";
|
|
26
|
+
return HrEntityKind;
|
|
27
|
+
}({});
|
|
28
|
+
/** The read model (and so the shape) the records of each entity are queried from. */ const hrEntityPlural = {
|
|
29
|
+
["Employee"]: 'Employees',
|
|
30
|
+
["TimeOff"]: 'TimeOffRequests',
|
|
31
|
+
["Balance"]: 'Balances',
|
|
32
|
+
["Onboarding"]: 'Onboardings'
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the
|
|
36
|
+
* list, its saved views and column choices, the selection, the sections of the full and the quick form, and the record the page shows.
|
|
37
|
+
*/ const hrQueriesOf = (entity)=>({
|
|
38
|
+
rows: hrEntityPlural[entity],
|
|
39
|
+
columns: `${entity}Columns`,
|
|
40
|
+
filterFields: `${entity}FilterFields`,
|
|
41
|
+
views: `${entity}Views`,
|
|
42
|
+
columnChoices: `${entity}ColumnChoices`,
|
|
43
|
+
selection: `${entity}Selection`,
|
|
44
|
+
sections: `${entity}Sections`,
|
|
45
|
+
quickSections: `${entity}QuickSections`,
|
|
46
|
+
record: `${entity}Record`,
|
|
47
|
+
summary: `${entity}Summary`,
|
|
48
|
+
documents: `${entity}Documents`,
|
|
49
|
+
activity: `${entity}Activity`,
|
|
50
|
+
tasks: `${entity}Tasks`
|
|
51
|
+
});
|
|
52
|
+
/** The locale and currency of the data, bound onto every component that formats a figure or a date. */ const localeOfData = {
|
|
53
|
+
locale: fromQuery(HrQuery.Settings, '0.locale')
|
|
54
|
+
};
|
|
55
|
+
const currencyOfData = {
|
|
56
|
+
...localeOfData,
|
|
57
|
+
currency: fromQuery(HrQuery.Settings, '0.currency')
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.HrEntityKind = HrEntityKind;
|
|
61
|
+
exports.HrQuery = HrQuery;
|
|
62
|
+
exports.currencyOfData = currencyOfData;
|
|
63
|
+
exports.fromQuery = fromQuery;
|
|
64
|
+
exports.hrEntityPlural = hrEntityPlural;
|
|
65
|
+
exports.hrQueriesOf = hrQueriesOf;
|
|
66
|
+
exports.localeOfData = localeOfData;
|
|
67
|
+
//# sourceMappingURL=hrQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hrQueries.js","sources":["../../hrQueries.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 { BindingExpression, BindingSourceKind } from '@cratis/scene.model';\n\n/**\n * A property taken from a query result - never a value. An HR template declares *where* its data comes from and the sample-data pack, or the real\n * query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).\n */\nexport const fromQuery = (query: string, path = ''): BindingExpression => ({ kind: BindingSourceKind.QueryResult, query, path });\n\n/** The queries of the screens that are not a plain list. Each is a shape the sample-data pack supplies rows for. */\nexport const HrQuery = {\n /** One row: the `locale` the figures and dates are formatted in. */\n Settings: 'HrSettings',\n RecordTabs: 'HrRecordTabs',\n OrgNodes: 'OrgNodes',\n FormErrors: 'HrFormErrors',\n} as const;\n\n/** The HR entities a template is made for. */\nexport enum HrEntityKind {\n Employee = 'Employee',\n TimeOff = 'TimeOff',\n Balance = 'Balance',\n Onboarding = 'Onboarding',\n}\n\n/** The read model (and so the shape) the records of each entity are queried from. */\nexport const hrEntityPlural: Record<HrEntityKind, string> = {\n [HrEntityKind.Employee]: 'Employees',\n [HrEntityKind.TimeOff]: 'TimeOffRequests',\n [HrEntityKind.Balance]: 'Balances',\n [HrEntityKind.Onboarding]: 'Onboardings',\n};\n\n/**\n * The queries one entity's templates bind to, named from the entity so a template never spells one out: the records, the columns and filter fields of the\n * list, its saved views and column choices, the selection, the sections of the full and the quick form, and the record the page shows.\n */\nexport const hrQueriesOf = (entity: HrEntityKind) => ({\n rows: hrEntityPlural[entity],\n columns: `${entity}Columns`,\n filterFields: `${entity}FilterFields`,\n views: `${entity}Views`,\n columnChoices: `${entity}ColumnChoices`,\n selection: `${entity}Selection`,\n sections: `${entity}Sections`,\n quickSections: `${entity}QuickSections`,\n record: `${entity}Record`,\n summary: `${entity}Summary`,\n documents: `${entity}Documents`,\n activity: `${entity}Activity`,\n tasks: `${entity}Tasks`,\n});\n\n/** The locale and currency of the data, bound onto every component that formats a figure or a date. */\nexport const localeOfData = { locale: fromQuery(HrQuery.Settings, '0.locale') };\nexport const currencyOfData = { ...localeOfData, currency: fromQuery(HrQuery.Settings, '0.currency') };\n"],"names":["fromQuery","query","path","kind","BindingSourceKind","QueryResult","HrQuery","Settings","RecordTabs","OrgNodes","FormErrors","HrEntityKind","hrEntityPlural","hrQueriesOf","entity","rows","columns","filterFields","views","columnChoices","selection","sections","quickSections","record","summary","documents","activity","tasks","localeOfData","locale","currencyOfData","currency"],"mappings":";;;;AAAA;AACA;AAIA;;;UAIaA,SAAAA,GAAY,CAACC,OAAeC,IAAAA,GAAO,EAAE,IAAyB;AAAEC,QAAAA,IAAAA,EAAMC,8BAAkBC,WAAW;AAAEJ,QAAAA,KAAAA;AAAOC,QAAAA;AAAK,KAAA;AAE9H,qHACO,MAAMI,OAAAA,GAAU;AACnB,yEACAC,QAAAA,EAAU,YAAA;IACVC,UAAAA,EAAY,cAAA;IACZC,QAAAA,EAAU,UAAA;IACVC,UAAAA,EAAY;AAChB;AAEA,+CACO,IAAKC,YAAAA,iBAAAA,SAAAA,YAAAA,EAAAA;;;;;AAAAA,IAAAA,OAAAA,YAAAA;AAKX,CAAA,CAAA,EAAA;AAED,sFACO,MAAMC,cAAAA,GAA+C;AACxD,IAAA,CAAA,UAAA,GAAyB,WAAA;AACzB,IAAA,CAAA,SAAA,GAAwB,iBAAA;AACxB,IAAA,CAAA,SAAA,GAAwB,UAAA;AACxB,IAAA,CAAA,YAAA,GAA2B;AAC/B;AAEA;;;AAGC,IACM,MAAMC,WAAAA,GAAc,CAACC,UAA0B;QAClDC,IAAAA,EAAMH,cAAc,CAACE,MAAAA,CAAO;QAC5BE,OAAAA,EAAS,CAAA,EAAGF,MAAAA,CAAO,OAAO,CAAC;QAC3BG,YAAAA,EAAc,CAAA,EAAGH,MAAAA,CAAO,YAAY,CAAC;QACrCI,KAAAA,EAAO,CAAA,EAAGJ,MAAAA,CAAO,KAAK,CAAC;QACvBK,aAAAA,EAAe,CAAA,EAAGL,MAAAA,CAAO,aAAa,CAAC;QACvCM,SAAAA,EAAW,CAAA,EAAGN,MAAAA,CAAO,SAAS,CAAC;QAC/BO,QAAAA,EAAU,CAAA,EAAGP,MAAAA,CAAO,QAAQ,CAAC;QAC7BQ,aAAAA,EAAe,CAAA,EAAGR,MAAAA,CAAO,aAAa,CAAC;QACvCS,MAAAA,EAAQ,CAAA,EAAGT,MAAAA,CAAO,MAAM,CAAC;QACzBU,OAAAA,EAAS,CAAA,EAAGV,MAAAA,CAAO,OAAO,CAAC;QAC3BW,SAAAA,EAAW,CAAA,EAAGX,MAAAA,CAAO,SAAS,CAAC;QAC/BY,QAAAA,EAAU,CAAA,EAAGZ,MAAAA,CAAO,QAAQ,CAAC;QAC7Ba,KAAAA,EAAO,CAAA,EAAGb,MAAAA,CAAO,KAAK;AAC1B,KAAA;AAEA,wGACO,MAAMc,YAAAA,GAAe;IAAEC,MAAAA,EAAQ7B,SAAAA,CAAUM,OAAAA,CAAQC,QAAQ,EAAE,UAAA;AAAY;MACjEuB,cAAAA,GAAiB;AAAE,IAAA,GAAGF,YAAY;IAAEG,QAAAA,EAAU/B,SAAAA,CAAUM,OAAAA,CAAQC,QAAQ,EAAE,YAAA;AAAc;;;;;;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* The screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure
|
|
7
|
+
* and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.
|
|
8
|
+
*/ const hrScreenDefinitions = [
|
|
9
|
+
{
|
|
10
|
+
name: 'hr.directory',
|
|
11
|
+
title: 'Directory',
|
|
12
|
+
template: 'HrEmployeeDirectory',
|
|
13
|
+
order: 0,
|
|
14
|
+
description: 'Everyone in the company as cards with their photo, title, department and contact.'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'hr.directory.record',
|
|
18
|
+
title: 'Employee',
|
|
19
|
+
template: 'HrEmployeePage',
|
|
20
|
+
parent: 'hr.directory',
|
|
21
|
+
description: 'One employee: personal and job information, documents and time-off balance.'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'hr.org',
|
|
25
|
+
title: 'Org chart',
|
|
26
|
+
template: 'HrOrgChart',
|
|
27
|
+
order: 1,
|
|
28
|
+
description: 'Who reports to whom, as a tree.'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'hr.timeoff',
|
|
32
|
+
title: 'Time off',
|
|
33
|
+
template: 'HrTimeOffList',
|
|
34
|
+
order: 2,
|
|
35
|
+
description: 'Time-off requests to approve, with who is away and for how long.'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'hr.timeoff.balances',
|
|
39
|
+
title: 'Balances',
|
|
40
|
+
template: 'HrTimeOffBalanceList',
|
|
41
|
+
parent: 'hr.timeoff',
|
|
42
|
+
description: 'What each employee has taken and has left.'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'hr.onboarding',
|
|
46
|
+
title: 'Onboarding',
|
|
47
|
+
template: 'HrOnboardingList',
|
|
48
|
+
order: 3,
|
|
49
|
+
description: 'New hires and how far along their onboarding is.'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'hr.onboarding.record',
|
|
53
|
+
title: 'Onboarding checklist',
|
|
54
|
+
template: 'HrOnboardingChecklist',
|
|
55
|
+
parent: 'hr.onboarding',
|
|
56
|
+
description: 'One new hire\'s checklist: sections of tasks, each with an owner and a due date.'
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
exports.hrScreenDefinitions = hrScreenDefinitions;
|
|
61
|
+
//# sourceMappingURL=hrScreenSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hrScreenSet.js","sources":["../../hrScreenSet.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 { BlueprintScreen } from '@cratis/scene.model';\n\n/** One ready-to-use screen: the qualified name that is also its place in the application (`hr.directory.record` is the `record` feature of `directory` in the `hr` module). */\nexport interface HrScreenDefinition extends BlueprintScreen {\n template: string;\n description: string;\n}\n\n/**\n * The screens the blueprint brings, in navigation order. This one list is what the manifest's screen set, the `Screen` instances, the application structure\n * and the navigation are all derived from, so they cannot disagree about which screens exist or where they sit.\n */\nexport const hrScreenDefinitions: HrScreenDefinition[] = [\n { name: 'hr.directory', title: 'Directory', template: 'HrEmployeeDirectory', order: 0, description: 'Everyone in the company as cards with their photo, title, department and contact.' },\n { name: 'hr.directory.record', title: 'Employee', template: 'HrEmployeePage', parent: 'hr.directory', description: 'One employee: personal and job information, documents and time-off balance.' },\n { name: 'hr.org', title: 'Org chart', template: 'HrOrgChart', order: 1, description: 'Who reports to whom, as a tree.' },\n { name: 'hr.timeoff', title: 'Time off', template: 'HrTimeOffList', order: 2, description: 'Time-off requests to approve, with who is away and for how long.' },\n { name: 'hr.timeoff.balances', title: 'Balances', template: 'HrTimeOffBalanceList', parent: 'hr.timeoff', description: 'What each employee has taken and has left.' },\n { name: 'hr.onboarding', title: 'Onboarding', template: 'HrOnboardingList', order: 3, description: 'New hires and how far along their onboarding is.' },\n { name: 'hr.onboarding.record', title: 'Onboarding checklist', template: 'HrOnboardingChecklist', parent: 'hr.onboarding', description: 'One new hire\\'s checklist: sections of tasks, each with an owner and a due date.' },\n];\n"],"names":["hrScreenDefinitions","name","title","template","order","description","parent"],"mappings":";;AAAA;AACA;AAUA;;;UAIaA,mBAAAA,GAA4C;AACrD,IAAA;QAAEC,IAAAA,EAAM,cAAA;QAAgBC,KAAAA,EAAO,WAAA;QAAaC,QAAAA,EAAU,qBAAA;QAAuBC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAAoF,KAAA;AACxL,IAAA;QAAEJ,IAAAA,EAAM,qBAAA;QAAuBC,KAAAA,EAAO,UAAA;QAAYC,QAAAA,EAAU,gBAAA;QAAkBG,MAAAA,EAAQ,cAAA;QAAgBD,WAAAA,EAAa;AAA8E,KAAA;AACjM,IAAA;QAAEJ,IAAAA,EAAM,QAAA;QAAUC,KAAAA,EAAO,WAAA;QAAaC,QAAAA,EAAU,YAAA;QAAcC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAAkC,KAAA;AACvH,IAAA;QAAEJ,IAAAA,EAAM,YAAA;QAAcC,KAAAA,EAAO,UAAA;QAAYC,QAAAA,EAAU,eAAA;QAAiBC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAAmE,KAAA;AAC9J,IAAA;QAAEJ,IAAAA,EAAM,qBAAA;QAAuBC,KAAAA,EAAO,UAAA;QAAYC,QAAAA,EAAU,sBAAA;QAAwBG,MAAAA,EAAQ,YAAA;QAAcD,WAAAA,EAAa;AAA6C,KAAA;AACpK,IAAA;QAAEJ,IAAAA,EAAM,eAAA;QAAiBC,KAAAA,EAAO,YAAA;QAAcC,QAAAA,EAAU,kBAAA;QAAoBC,KAAAA,EAAO,CAAA;QAAGC,WAAAA,EAAa;AAAmD,KAAA;AACtJ,IAAA;QAAEJ,IAAAA,EAAM,sBAAA;QAAwBC,KAAAA,EAAO,sBAAA;QAAwBC,QAAAA,EAAU,uBAAA;QAAyBG,MAAAA,EAAQ,eAAA;QAAiBD,WAAAA,EAAa;AAAmF;;;"}
|