pict-section-recordset 1.1.0 → 1.2.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/package.json +5 -1
- package/source/views/RecordSet-Filters.js +20 -2
- package/source/views/filters/RecordSet-Filter-Base.js +86 -8
- package/source/views/read/RecordSet-Read.js +308 -2
- package/types/providers/Filter-Data-Provider.d.ts +1 -1
- package/types/providers/Filter-Data-Provider.d.ts.map +1 -1
- package/types/views/Filter-PersistenceView.d.ts +23 -2
- package/types/views/Filter-PersistenceView.d.ts.map +1 -1
- package/types/views/RecordSet-Filters.d.ts +26 -1
- package/types/views/RecordSet-Filters.d.ts.map +1 -1
- package/types/views/filters/RecordSet-Filter-Base.d.ts +14 -0
- package/types/views/filters/RecordSet-Filter-Base.d.ts.map +1 -1
- package/types/views/list/RecordSet-List.d.ts.map +1 -1
- package/types/views/read/RecordSet-Read.d.ts +51 -0
- package/types/views/read/RecordSet-Read.d.ts.map +1 -1
- package/.vscode/launch.json +0 -46
- package/CONTRIBUTING.md +0 -50
- package/debug/Harness.js +0 -0
- package/docs/.nojekyll +0 -0
- package/docs/README.md +0 -76
- package/docs/_brand.json +0 -18
- package/docs/_cover.md +0 -11
- package/docs/_sidebar.md +0 -19
- package/docs/_version.json +0 -7
- package/docs/api-reference.md +0 -233
- package/docs/filters.md +0 -151
- package/docs/index.html +0 -38
- package/docs/record-providers.md +0 -155
- package/docs/retold-catalog.json +0 -87
- package/docs/retold-keyword-index.json +0 -5227
- package/docs/views/create/README.md +0 -181
- package/docs/views/dashboard/README.md +0 -308
- package/docs/views/list/README.md +0 -260
- package/docs/views/read/README.md +0 -216
- package/eslint.config.mjs +0 -10
- package/example_applications/README.md +0 -39
- package/example_applications/ServeExamples.js +0 -82
- package/example_applications/bookstore/.quackage.json +0 -9
- package/example_applications/bookstore/Bookstore-Application-Configuration.json +0 -4
- package/example_applications/bookstore/Bookstore-Application.js +0 -671
- package/example_applications/bookstore/css/bookstore.css +0 -729
- package/example_applications/bookstore/css/pure.min.css +0 -11
- package/example_applications/bookstore/html/index.html +0 -46
- package/example_applications/bookstore/package.json +0 -34
- package/example_applications/bookstore/providers/PictRouter-Bookstore.json +0 -32
- package/example_applications/bookstore/views/PictView-Bookstore-Content-About.json +0 -21
- package/example_applications/bookstore/views/PictView-Bookstore-Content-Legal.json +0 -21
- package/example_applications/bookstore/views/PictView-Bookstore-Dashboard.js +0 -147
- package/example_applications/bookstore/views/PictView-Bookstore-Layout.js +0 -85
- package/example_applications/bookstore/views/PictView-Bookstore-Login.js +0 -58
- package/example_applications/bookstore/views/PictView-Bookstore-Navigation.js +0 -228
- package/example_applications/index.html +0 -50
- package/example_applications/mocks/book-edit-view.html +0 -173
- package/example_applications/mocks/book-read-view.html +0 -166
- package/example_applications/mocks/list-view.html +0 -185
- package/example_applications/package.json +0 -16
- package/example_applications/simple_entity/.quackage.json +0 -9
- package/example_applications/simple_entity/README-Simple-RecordSet.md +0 -8
- package/example_applications/simple_entity/Simple-RecordSet-Application.js +0 -887
- package/example_applications/simple_entity/html/index.html +0 -207
- package/example_applications/simple_entity/package.json +0 -27
- package/test/PictSectionRecordSet-Basic_tests.js +0 -205
- package/test/PictSectionRecordSet-Filter-Data-Provider_tests.js +0 -263
- package/test/PictSectionRecordSet-Filter-InstanceViews-Render_tests.js +0 -328
- package/test/PictSectionRecordSet-RecordProvider-Meadow_tests.js +0 -216
- package/tsconfig.build.json +0 -16
- package/tsconfig.json +0 -16
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
# List View
|
|
2
|
-
|
|
3
|
-
The List view displays records in a table format with pagination, filtering, and sorting capabilities.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The List view fetches and displays multiple records in a configurable table layout. It supports automatic column generation from schema, custom column definitions, pagination, filtering, and navigation to individual records.
|
|
8
|
-
|
|
9
|
-
## Routes
|
|
10
|
-
|
|
11
|
-
| Route | Description |
|
|
12
|
-
|-------|-------------|
|
|
13
|
-
| `/PSRS/:RecordSet/List` | List all records |
|
|
14
|
-
| `/PSRS/:RecordSet/List/:Offset` | List with offset |
|
|
15
|
-
| `/PSRS/:RecordSet/List/:Offset/:PageSize` | List with offset and page size |
|
|
16
|
-
| `/PSRS/:RecordSet/List/FilteredTo/:FilterString` | List with filter |
|
|
17
|
-
| `/PSRS/:RecordSet/List/FilteredTo/:FilterString/:Offset/:PageSize` | List with filter and pagination |
|
|
18
|
-
| `/PSRS/:RecordSet/List/FilterExperience/:FilterExperience` | List with serialized filter state |
|
|
19
|
-
|
|
20
|
-
## Configuration
|
|
21
|
-
|
|
22
|
-
```javascript
|
|
23
|
-
const recordSetConfig = {
|
|
24
|
-
RecordSet: 'User',
|
|
25
|
-
Title: 'Users',
|
|
26
|
-
|
|
27
|
-
// Use manifest for column configuration
|
|
28
|
-
RecordSetListManifestOnly: true,
|
|
29
|
-
RecordSetListDefaultManifest: 'UserListManifest',
|
|
30
|
-
RecordSetListManifests: ['UserListManifest', 'UserCompactList'],
|
|
31
|
-
|
|
32
|
-
// Or define columns directly
|
|
33
|
-
RecordSetListColumns: [
|
|
34
|
-
'Name',
|
|
35
|
-
'Email',
|
|
36
|
-
{
|
|
37
|
-
Key: 'Status',
|
|
38
|
-
DisplayName: 'User Status',
|
|
39
|
-
ManifestHash: 'Default',
|
|
40
|
-
PictDashboard: {
|
|
41
|
-
ValueTemplate: '{~ProcessCell:Record.Data.Key~}'
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
};
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Column Configuration
|
|
49
|
-
|
|
50
|
-
### Simple Columns
|
|
51
|
-
|
|
52
|
-
Specify column keys as strings:
|
|
53
|
-
|
|
54
|
-
```javascript
|
|
55
|
-
RecordSetListColumns: ['Name', 'Email', 'CreatedDate']
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Advanced Columns
|
|
59
|
-
|
|
60
|
-
Use objects for custom display and formatting:
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
RecordSetListColumns: [
|
|
64
|
-
{
|
|
65
|
-
Key: 'Name',
|
|
66
|
-
DisplayName: 'Full Name',
|
|
67
|
-
ManifestHash: 'Default',
|
|
68
|
-
PictDashboard: {
|
|
69
|
-
ValueTemplate: '{~D:Record.Data.Name~}'
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
Key: 'Status',
|
|
74
|
-
DisplayName: 'Account Status',
|
|
75
|
-
PictDashboard: {
|
|
76
|
-
ValueTemplate: '<span class="status-{~D:Record.Data.Status~}">{~D:Record.Data.Status~}</span>'
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Auto-Generated Columns
|
|
83
|
-
|
|
84
|
-
When no `RecordSetListColumns` or manifest is provided, columns are generated automatically from the record schema. The following fields are excluded by default:
|
|
85
|
-
|
|
86
|
-
- ID field (e.g., `IDUser`)
|
|
87
|
-
- GUID field (e.g., `GUIDUser`)
|
|
88
|
-
- `CreateDate`
|
|
89
|
-
- `CreatingIDUser`
|
|
90
|
-
- `DeleteDate`
|
|
91
|
-
- `Deleted`
|
|
92
|
-
- `DeletingIDUser`
|
|
93
|
-
- `UpdateDate`
|
|
94
|
-
- `UpdatingIDUser`
|
|
95
|
-
|
|
96
|
-
## Manifest Configuration
|
|
97
|
-
|
|
98
|
-
For complex list displays, define a manifest:
|
|
99
|
-
|
|
100
|
-
```javascript
|
|
101
|
-
const listManifest = {
|
|
102
|
-
TitleTemplate: '{~D:Record.RecordSet~} Directory',
|
|
103
|
-
TableCells: [
|
|
104
|
-
{
|
|
105
|
-
Key: 'Name',
|
|
106
|
-
DisplayName: 'Name',
|
|
107
|
-
PictDashboard: {
|
|
108
|
-
ValueTemplate: '<a href="#/PSRS/User/View/{~D:Record.Data.GUIDUser~}">{~D:Record.Data.Name~}</a>'
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
Key: 'Email',
|
|
113
|
-
DisplayName: 'Email',
|
|
114
|
-
PictDashboard: {
|
|
115
|
-
ValueTemplate: '<a href="mailto:{~D:Record.Data.Email~}">{~D:Record.Data.Email~}</a>'
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
};
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Child Views
|
|
123
|
-
|
|
124
|
-
The List view is composed of several child views:
|
|
125
|
-
|
|
126
|
-
| View | Purpose |
|
|
127
|
-
|------|---------|
|
|
128
|
-
| `PRSP-List-HeaderList` | Header actions and navigation |
|
|
129
|
-
| `PRSP-List-Title` | Page title |
|
|
130
|
-
| `PRSP-Filters` | Filter controls |
|
|
131
|
-
| `PRSP-List-PaginationTop` | Top pagination controls |
|
|
132
|
-
| `PRSP-List-RecordList` | Record table container |
|
|
133
|
-
| `PRSP-List-RecordListHeader` | Table header row |
|
|
134
|
-
| `PRSP-List-RecordListEntry` | Individual record rows |
|
|
135
|
-
| `PRSP-List-PaginationBottom` | Bottom pagination controls |
|
|
136
|
-
|
|
137
|
-
## Pagination
|
|
138
|
-
|
|
139
|
-
Pagination data is automatically calculated and available in templates:
|
|
140
|
-
|
|
141
|
-
```javascript
|
|
142
|
-
{
|
|
143
|
-
Offset: 0, // Current offset
|
|
144
|
-
PageSize: 100, // Records per page
|
|
145
|
-
PageEnd: 100, // Last record number on current page
|
|
146
|
-
PageCount: 10, // Total number of pages
|
|
147
|
-
TotalRecordCount: { Count: 1000 },
|
|
148
|
-
|
|
149
|
-
PageLinks: [ // All page links
|
|
150
|
-
{ Page: 1, URL: '#/PSRS/User/List/0/100', RelativeOffset: 0 }
|
|
151
|
-
],
|
|
152
|
-
PageLinksLimited: [], // Limited range of page links (±10 pages)
|
|
153
|
-
|
|
154
|
-
PageLinkBookmarks: {
|
|
155
|
-
Current: 0,
|
|
156
|
-
Previous: false,
|
|
157
|
-
Next: 1,
|
|
158
|
-
PreviousLink: false,
|
|
159
|
-
NextLink: { Page: 2, URL: '...' },
|
|
160
|
-
ShowPreviousLink: false,
|
|
161
|
-
ShowNextLink: true
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Lifecycle Hooks
|
|
167
|
-
|
|
168
|
-
```javascript
|
|
169
|
-
class CustomListView extends viewRecordSetList {
|
|
170
|
-
onBeforeRenderList(pRecordListData) {
|
|
171
|
-
// Modify data before rendering
|
|
172
|
-
// Add computed columns, filter records, etc.
|
|
173
|
-
return pRecordListData;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
dynamicallyGenerateColumns(pRecordListData) {
|
|
177
|
-
// Customize auto-generated columns
|
|
178
|
-
// Call super or implement custom logic
|
|
179
|
-
return super.dynamicallyGenerateColumns(pRecordListData);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
## Templates
|
|
185
|
-
|
|
186
|
-
| Template Hash | Purpose |
|
|
187
|
-
|---------------|---------|
|
|
188
|
-
| `PRSP-List-Template` | Main list container |
|
|
189
|
-
| `PRSP-List-Template-Record` | Individual record template |
|
|
190
|
-
|
|
191
|
-
## Filter Integration
|
|
192
|
-
|
|
193
|
-
The List view integrates with the filter system. Filter state is maintained in:
|
|
194
|
-
|
|
195
|
-
```javascript
|
|
196
|
-
pict.Bundle._ActiveFilterState[RecordSet].FilterClauses
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
Filters can be serialized into URLs using the `FilterExperience` parameter for shareable filtered views.
|
|
200
|
-
|
|
201
|
-
## Example Usage
|
|
202
|
-
|
|
203
|
-
```javascript
|
|
204
|
-
// Navigate to list
|
|
205
|
-
pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/User/List');
|
|
206
|
-
|
|
207
|
-
// Navigate with pagination
|
|
208
|
-
pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/User/List/100/50');
|
|
209
|
-
|
|
210
|
-
// Navigate with filter
|
|
211
|
-
pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/User/List/FilteredTo/FBV~Status~EQ~active');
|
|
212
|
-
|
|
213
|
-
// Access the list view
|
|
214
|
-
const listView = pict.views['RSP-RecordSet-List'];
|
|
215
|
-
|
|
216
|
-
// Render list programmatically
|
|
217
|
-
const config = pict.PictSectionRecordSet.recordSetProviderConfigurations['User'];
|
|
218
|
-
await listView.renderList(config, 'RSP-Provider-User', '', '', 0, 100);
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
## Manifest-Based Rendering
|
|
222
|
-
|
|
223
|
-
For manifest-only configurations, use `renderListFromManifest`:
|
|
224
|
-
|
|
225
|
-
```javascript
|
|
226
|
-
const manifest = pict.PictSectionRecordSet.manifestDefinitions['UserListManifest'];
|
|
227
|
-
const config = pict.PictSectionRecordSet.recordSetProviderConfigurations['User'];
|
|
228
|
-
|
|
229
|
-
await listView.renderListFromManifest(
|
|
230
|
-
manifest,
|
|
231
|
-
config,
|
|
232
|
-
'RSP-Provider-User',
|
|
233
|
-
'', // filterString
|
|
234
|
-
'', // filterExperience
|
|
235
|
-
0, // offset
|
|
236
|
-
100 // pageSize
|
|
237
|
-
);
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
## Data Structure
|
|
241
|
-
|
|
242
|
-
The `renderList` method provides this data structure to templates:
|
|
243
|
-
|
|
244
|
-
```javascript
|
|
245
|
-
{
|
|
246
|
-
Title: 'Users',
|
|
247
|
-
RecordSet: 'User',
|
|
248
|
-
RecordSetConfiguration: { ... },
|
|
249
|
-
RenderDestination: '#PRSP_Container',
|
|
250
|
-
FilterString: 'FBV~Status~EQ~active',
|
|
251
|
-
Records: { Records: [...] },
|
|
252
|
-
TotalRecordCount: { Count: 1000 },
|
|
253
|
-
RecordSchema: { properties: { ... } },
|
|
254
|
-
GUIDAddress: 'GUIDUser',
|
|
255
|
-
TableCells: [
|
|
256
|
-
{ Key: 'Name', DisplayName: 'Name', PictDashboard: { ... } }
|
|
257
|
-
],
|
|
258
|
-
// Pagination data...
|
|
259
|
-
}
|
|
260
|
-
```
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
# Read View
|
|
2
|
-
|
|
3
|
-
The Read view displays a single record and supports both viewing and editing modes.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The Read view fetches and displays a single record by its GUID. It supports multiple layout types (Basic, Split, Tab) and can toggle between read-only viewing and edit mode for updating records.
|
|
8
|
-
|
|
9
|
-
## Routes
|
|
10
|
-
|
|
11
|
-
| Route | Description |
|
|
12
|
-
|-------|-------------|
|
|
13
|
-
| `/PSRS/:RecordSet/View/:GUIDRecord` | View a record (read-only) |
|
|
14
|
-
| `/PSRS/:RecordSet/Edit/:GUIDRecord` | Edit a record (editable form) |
|
|
15
|
-
|
|
16
|
-
## Layout Types
|
|
17
|
-
|
|
18
|
-
Configure the layout type in your record set configuration:
|
|
19
|
-
|
|
20
|
-
```javascript
|
|
21
|
-
const recordSetConfig = {
|
|
22
|
-
RecordSet: 'User',
|
|
23
|
-
ReadLayout: 'Basic' // Options: 'Basic', 'Split', 'Tab'
|
|
24
|
-
};
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Basic Layout
|
|
28
|
-
|
|
29
|
-
Single column display of record fields with a button bar.
|
|
30
|
-
|
|
31
|
-
### Split Layout
|
|
32
|
-
|
|
33
|
-
Two-panel layout with record fields on the left and tabbed content on the right. Includes a draggable divider for resizing.
|
|
34
|
-
|
|
35
|
-
### Tab Layout
|
|
36
|
-
|
|
37
|
-
Tabbed interface where the main record is one tab among others.
|
|
38
|
-
|
|
39
|
-
## Configuration
|
|
40
|
-
|
|
41
|
-
```javascript
|
|
42
|
-
const recordSetConfig = {
|
|
43
|
-
RecordSet: 'User',
|
|
44
|
-
|
|
45
|
-
// Layout type
|
|
46
|
-
ReadLayout: 'Split',
|
|
47
|
-
|
|
48
|
-
// Use manifest-based display
|
|
49
|
-
RecordSetReadManifestOnly: true,
|
|
50
|
-
RecordSetReadDefaultManifestView: 'UserViewManifest',
|
|
51
|
-
RecordSetReadDefaultManifestEdit: 'UserEditManifest',
|
|
52
|
-
|
|
53
|
-
// Override read-only behavior in View mode
|
|
54
|
-
RecordSetReadOverrideReadOnly: false,
|
|
55
|
-
|
|
56
|
-
// Tab configuration (for Split/Tab layouts)
|
|
57
|
-
RecordSetReadTabTitle: 'User Details',
|
|
58
|
-
RecordSetReadTabs: [
|
|
59
|
-
{
|
|
60
|
-
Title: 'Activity',
|
|
61
|
-
Hash: 'Activity',
|
|
62
|
-
Type: 'View',
|
|
63
|
-
View: 'UserActivityView'
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
Title: 'Settings',
|
|
67
|
-
Hash: 'Settings',
|
|
68
|
-
Type: 'Manifest',
|
|
69
|
-
Manifest: 'UserSettingsManifest'
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
};
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Tab Types
|
|
76
|
-
|
|
77
|
-
### View Tab
|
|
78
|
-
|
|
79
|
-
Renders a registered Pict view:
|
|
80
|
-
|
|
81
|
-
```javascript
|
|
82
|
-
{
|
|
83
|
-
Title: 'Activity Log',
|
|
84
|
-
Hash: 'Activity',
|
|
85
|
-
Type: 'View',
|
|
86
|
-
View: 'UserActivityView' // Must be registered with pict.addView()
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Manifest Tab
|
|
91
|
-
|
|
92
|
-
Renders a manifest-based form section:
|
|
93
|
-
|
|
94
|
-
```javascript
|
|
95
|
-
{
|
|
96
|
-
Title: 'Profile',
|
|
97
|
-
Hash: 'Profile',
|
|
98
|
-
Type: 'Manifest',
|
|
99
|
-
Manifest: 'UserProfileManifest'
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Attached Record Tab
|
|
104
|
-
|
|
105
|
-
Displays a related record from another record set:
|
|
106
|
-
|
|
107
|
-
```javascript
|
|
108
|
-
{
|
|
109
|
-
Title: 'Organization',
|
|
110
|
-
Hash: 'Organization',
|
|
111
|
-
Type: 'AttachedRecord',
|
|
112
|
-
RecordSet: 'Organization',
|
|
113
|
-
JoinField: 'IDOrganization',
|
|
114
|
-
// Optional: for indirect joins
|
|
115
|
-
JoiningRecordSet: 'UserOrganization',
|
|
116
|
-
BaseField: 'IDUser'
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## View vs Edit Mode
|
|
121
|
-
|
|
122
|
-
In **View mode**, all form fields are rendered as read-only. In **Edit mode**, fields are editable based on their manifest configuration.
|
|
123
|
-
|
|
124
|
-
The button bar adapts to the current mode:
|
|
125
|
-
- View mode: Shows Edit button
|
|
126
|
-
- Edit mode: Shows Save and Cancel buttons
|
|
127
|
-
|
|
128
|
-
## Lifecycle Hooks
|
|
129
|
-
|
|
130
|
-
```javascript
|
|
131
|
-
class CustomReadView extends viewRecordSetRead {
|
|
132
|
-
onBeforeRenderRead(pRecordReadData) {
|
|
133
|
-
// Called before rendering, receives record data
|
|
134
|
-
// Modify pRecordReadData.Record or pRecordReadData.DisplayFields
|
|
135
|
-
return pRecordReadData;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
async onBeforeEdit() {
|
|
139
|
-
// Called when transitioning to edit mode
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
async onBeforeSave() {
|
|
143
|
-
// Called before saving changes
|
|
144
|
-
// Use for validation
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
async onBeforeView() {
|
|
148
|
-
// Called when transitioning to view mode
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
async onBeforeTabChange() {
|
|
152
|
-
// Called when switching between tabs
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
## Button Bar Actions
|
|
158
|
-
|
|
159
|
-
| Button | Action | Method |
|
|
160
|
-
|--------|--------|--------|
|
|
161
|
-
| Edit | Switch to edit mode | `edit()` |
|
|
162
|
-
| Save | Save changes and return to view | `save()` |
|
|
163
|
-
| Cancel | Discard changes and return to view | `cancel()` |
|
|
164
|
-
|
|
165
|
-
## Templates
|
|
166
|
-
|
|
167
|
-
| Template Hash | Purpose |
|
|
168
|
-
|---------------|---------|
|
|
169
|
-
| `PRSP-Read-Basic-Template` | Basic layout container |
|
|
170
|
-
| `PRSP-Read-Split-Template` | Split layout container |
|
|
171
|
-
| `PRSP-Read-Tab-Template` | Tab layout container |
|
|
172
|
-
| `PRSP-Read-RecordRead-Template` | Record field display |
|
|
173
|
-
| `PRSP-Read-RecordRead-Template-Row` | Individual field row |
|
|
174
|
-
| `PRSP-Read-RecordButtonBar-Template` | Edit/Save/Cancel buttons |
|
|
175
|
-
| `PRSP-Read-RecordTab-Template` | Tab content container |
|
|
176
|
-
| `PRSP-Read-RecordTabNav-Template` | Tab navigation |
|
|
177
|
-
|
|
178
|
-
## Renderables
|
|
179
|
-
|
|
180
|
-
| Renderable Hash | Template | Use |
|
|
181
|
-
|-----------------|----------|-----|
|
|
182
|
-
| `PRSP_Renderable_Read_Basic` | Basic template | Single column layout |
|
|
183
|
-
| `PRSP_Renderable_Read_Split` | Split template | Two-panel layout |
|
|
184
|
-
| `PRSP_Renderable_Read_Tab` | Tab template | Tabbed layout |
|
|
185
|
-
|
|
186
|
-
## Example Usage
|
|
187
|
-
|
|
188
|
-
```javascript
|
|
189
|
-
// Navigate to view a record
|
|
190
|
-
pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/User/View/abc-123-def');
|
|
191
|
-
|
|
192
|
-
// Navigate to edit a record
|
|
193
|
-
pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/User/Edit/abc-123-def');
|
|
194
|
-
|
|
195
|
-
// Access the read view
|
|
196
|
-
const readView = pict.views['RSP-RecordSet-Read'];
|
|
197
|
-
|
|
198
|
-
// Switch modes programmatically
|
|
199
|
-
await readView.edit(); // To edit mode
|
|
200
|
-
await readView.save(); // Save and return to view
|
|
201
|
-
await readView.cancel(); // Cancel and return to view
|
|
202
|
-
|
|
203
|
-
// Switch tabs
|
|
204
|
-
readView.setTab('Activity');
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
## Updating Records
|
|
208
|
-
|
|
209
|
-
When in edit mode and the user clicks Save:
|
|
210
|
-
|
|
211
|
-
1. `onBeforeSave()` hook is called
|
|
212
|
-
2. The provider's `updateRecord()` method is called with form data
|
|
213
|
-
3. `onBeforeView()` hook is called
|
|
214
|
-
4. Navigation returns to view mode
|
|
215
|
-
|
|
216
|
-
The record data is stored at `pict.AppData['{RecordSet}Details']`.
|
package/eslint.config.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import globals from "globals";
|
|
2
|
-
import pluginJs from "@eslint/js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default [
|
|
6
|
-
{ files: ["source/**", "test/**"], languageOptions: { sourceType: "commonjs" } },
|
|
7
|
-
{ languageOptions: { globals: { ...globals.browser, ...globals.mocha, } } },
|
|
8
|
-
pluginJs.configs.recommended,
|
|
9
|
-
{ rules: { "no-prototype-builtins": "off", "no-unused-vars": "warn" } },
|
|
10
|
-
];
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Example Applications
|
|
2
|
-
|
|
3
|
-
These applications exercise the library from very basic to complex.
|
|
4
|
-
|
|
5
|
-
## The Basics
|
|
6
|
-
|
|
7
|
-
These forms are meant to provide simple configuration-based test
|
|
8
|
-
suites for the framework.
|
|
9
|
-
|
|
10
|
-
### Simple RecordSet
|
|
11
|
-
|
|
12
|
-
The most basic example. Some lists, etc. for Book and Author
|
|
13
|
-
records.
|
|
14
|
-
|
|
15
|
-
<http://localhost:9090/simple_entity/dist/index.html>
|
|
16
|
-
|
|
17
|
-
### How to run example app for developers (Docker)
|
|
18
|
-
|
|
19
|
-
#### Retold Harness
|
|
20
|
-
|
|
21
|
-
- Install `retold-harness` separately
|
|
22
|
-
- From `retold-harness` do `npm i`
|
|
23
|
-
- Run `npm run docker-dev-build`
|
|
24
|
-
- Run `npm run docker-dev-run`
|
|
25
|
-
|
|
26
|
-
#### In this repository
|
|
27
|
-
|
|
28
|
-
- Run `npm i`
|
|
29
|
-
- Run `npm run build`
|
|
30
|
-
- Go to `./example_applications`
|
|
31
|
-
- Run `npm i`
|
|
32
|
-
- Go to `./example_applications/simple_entity`
|
|
33
|
-
- Run `npm i`
|
|
34
|
-
- Run `npm run build`
|
|
35
|
-
- Go to `./example_applications`
|
|
36
|
-
- Run `npm run start`
|
|
37
|
-
- Go to a browser at: `http://localhost:9090/simple_entity/dist/index.html`
|
|
38
|
-
|
|
39
|
-
_NOTE: Making changes to the libraray only, just need to rebuild the base, but if altering the simple entity example app, you will need to rebuild in there as well._
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
const libFable = require('fable');
|
|
2
|
-
|
|
3
|
-
const defaultFableSettings = (
|
|
4
|
-
{
|
|
5
|
-
Product:'PictSectionFormExampleServer',
|
|
6
|
-
ProductVersion: '1.0.0',
|
|
7
|
-
APIServerPort: 9090,
|
|
8
|
-
|
|
9
|
-
OratorHTTPProxyDestinationURL: 'http://localhost:8086/',
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// Initialize Fable
|
|
13
|
-
let _Fable = new libFable(defaultFableSettings);
|
|
14
|
-
|
|
15
|
-
// Now initialize the Restify ServiceServer Fable Service
|
|
16
|
-
_Fable.serviceManager.addServiceType('OratorServiceServer', require('orator-serviceserver-restify'));
|
|
17
|
-
_Fable.serviceManager.instantiateServiceProvider('OratorServiceServer',
|
|
18
|
-
{
|
|
19
|
-
RestifyConfiguration: { strictNext: true }
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// Now add the orator service to Fable
|
|
23
|
-
_Fable.serviceManager.addServiceType('Orator', require('orator'));
|
|
24
|
-
let _Orator = _Fable.serviceManager.instantiateServiceProvider('Orator', {});
|
|
25
|
-
|
|
26
|
-
let tmpAnticipate = _Fable.newAnticipate();
|
|
27
|
-
|
|
28
|
-
// Initialize the Orator server
|
|
29
|
-
tmpAnticipate.anticipate(_Orator.initialize.bind(_Orator));
|
|
30
|
-
|
|
31
|
-
// Create a simple custom endpoint on the server.
|
|
32
|
-
tmpAnticipate.anticipate(
|
|
33
|
-
(fStageComplete)=>
|
|
34
|
-
{
|
|
35
|
-
// Create an endpoint. This can also be done after the service is started.
|
|
36
|
-
_Orator.serviceServer.get
|
|
37
|
-
(
|
|
38
|
-
'/1.0/test/:hash',
|
|
39
|
-
(pRequest, pResponse, fNext) =>
|
|
40
|
-
{
|
|
41
|
-
// Send back the request parameters
|
|
42
|
-
pResponse.send(pRequest.params);
|
|
43
|
-
_Orator.fable.log.info(`Endpoint sent parameters object:`, pRequest.params);
|
|
44
|
-
return fNext();
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
return fStageComplete();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
tmpAnticipate.anticipate(
|
|
51
|
-
(fStageComplete) =>
|
|
52
|
-
{
|
|
53
|
-
_Orator.addStaticRoute(`${__dirname}/`);
|
|
54
|
-
return fStageComplete();
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
// Add the http proxy service
|
|
59
|
-
const libOratorHTTPProxy = require(`orator-http-proxy`);
|
|
60
|
-
_Fable.serviceManager.addServiceType('OratorHTTPProxy', libOratorHTTPProxy);
|
|
61
|
-
_Fable.serviceManager.instantiateServiceProvider('OratorHTTPProxy', {LogLevel: 2});
|
|
62
|
-
// Proxy all /1.0/ requests to the locally-running bookstore service (you need to run this from https://github.com/fable-retold/retold-harness ... it's a one-liner to start the service)
|
|
63
|
-
tmpAnticipate.anticipate(
|
|
64
|
-
(fNext)=>
|
|
65
|
-
{
|
|
66
|
-
_Fable.OratorHTTPProxy.connectProxyRoutes();
|
|
67
|
-
return fNext();
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// Now start the service server.
|
|
72
|
-
tmpAnticipate.anticipate(_Orator.startService.bind(_Orator));
|
|
73
|
-
|
|
74
|
-
tmpAnticipate.wait(
|
|
75
|
-
(pError)=>
|
|
76
|
-
{
|
|
77
|
-
if (pError)
|
|
78
|
-
{
|
|
79
|
-
_Fable.log.error('Error initializing Orator Service Server: '+pError.message, pError);
|
|
80
|
-
}
|
|
81
|
-
_Fable.log.info('Orator Service Server Initialized.');
|
|
82
|
-
});
|