pict-section-recordset 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/package.json +5 -1
  2. package/source/views/RecordSet-Filters.js +196 -72
  3. package/source/views/filters/RecordSet-Filter-Base.js +86 -8
  4. package/source/views/read/RecordSet-Read.js +308 -2
  5. package/types/providers/Filter-Data-Provider.d.ts +1 -1
  6. package/types/providers/Filter-Data-Provider.d.ts.map +1 -1
  7. package/types/views/Filter-PersistenceView.d.ts +23 -2
  8. package/types/views/Filter-PersistenceView.d.ts.map +1 -1
  9. package/types/views/RecordSet-Filters.d.ts +54 -2
  10. package/types/views/RecordSet-Filters.d.ts.map +1 -1
  11. package/types/views/filters/RecordSet-Filter-Base.d.ts +14 -0
  12. package/types/views/filters/RecordSet-Filter-Base.d.ts.map +1 -1
  13. package/types/views/list/RecordSet-List.d.ts.map +1 -1
  14. package/types/views/read/RecordSet-Read.d.ts +51 -0
  15. package/types/views/read/RecordSet-Read.d.ts.map +1 -1
  16. package/.vscode/launch.json +0 -46
  17. package/CONTRIBUTING.md +0 -50
  18. package/debug/Harness.js +0 -0
  19. package/docs/.nojekyll +0 -0
  20. package/docs/README.md +0 -76
  21. package/docs/_brand.json +0 -18
  22. package/docs/_cover.md +0 -11
  23. package/docs/_sidebar.md +0 -19
  24. package/docs/_version.json +0 -7
  25. package/docs/api-reference.md +0 -233
  26. package/docs/filters.md +0 -151
  27. package/docs/index.html +0 -38
  28. package/docs/record-providers.md +0 -155
  29. package/docs/retold-catalog.json +0 -87
  30. package/docs/retold-keyword-index.json +0 -5227
  31. package/docs/views/create/README.md +0 -181
  32. package/docs/views/dashboard/README.md +0 -308
  33. package/docs/views/list/README.md +0 -260
  34. package/docs/views/read/README.md +0 -216
  35. package/eslint.config.mjs +0 -10
  36. package/example_applications/README.md +0 -39
  37. package/example_applications/ServeExamples.js +0 -82
  38. package/example_applications/bookstore/.quackage.json +0 -9
  39. package/example_applications/bookstore/Bookstore-Application-Configuration.json +0 -4
  40. package/example_applications/bookstore/Bookstore-Application.js +0 -671
  41. package/example_applications/bookstore/css/bookstore.css +0 -729
  42. package/example_applications/bookstore/css/pure.min.css +0 -11
  43. package/example_applications/bookstore/html/index.html +0 -46
  44. package/example_applications/bookstore/package.json +0 -34
  45. package/example_applications/bookstore/providers/PictRouter-Bookstore.json +0 -32
  46. package/example_applications/bookstore/views/PictView-Bookstore-Content-About.json +0 -21
  47. package/example_applications/bookstore/views/PictView-Bookstore-Content-Legal.json +0 -21
  48. package/example_applications/bookstore/views/PictView-Bookstore-Dashboard.js +0 -147
  49. package/example_applications/bookstore/views/PictView-Bookstore-Layout.js +0 -85
  50. package/example_applications/bookstore/views/PictView-Bookstore-Login.js +0 -58
  51. package/example_applications/bookstore/views/PictView-Bookstore-Navigation.js +0 -228
  52. package/example_applications/index.html +0 -50
  53. package/example_applications/mocks/book-edit-view.html +0 -173
  54. package/example_applications/mocks/book-read-view.html +0 -166
  55. package/example_applications/mocks/list-view.html +0 -185
  56. package/example_applications/package.json +0 -16
  57. package/example_applications/simple_entity/.quackage.json +0 -9
  58. package/example_applications/simple_entity/README-Simple-RecordSet.md +0 -8
  59. package/example_applications/simple_entity/Simple-RecordSet-Application.js +0 -887
  60. package/example_applications/simple_entity/html/index.html +0 -207
  61. package/example_applications/simple_entity/package.json +0 -27
  62. package/test/PictSectionRecordSet-Basic_tests.js +0 -205
  63. package/test/PictSectionRecordSet-Filter-Data-Provider_tests.js +0 -263
  64. package/test/PictSectionRecordSet-Filter-InstanceViews-Render_tests.js +0 -328
  65. package/test/PictSectionRecordSet-RecordProvider-Meadow_tests.js +0 -216
  66. package/tsconfig.build.json +0 -16
  67. package/tsconfig.json +0 -16
@@ -1,181 +0,0 @@
1
- # Create View
2
-
3
- The Create view provides a form interface for creating new records in a record set.
4
-
5
- ## Overview
6
-
7
- The Create view automatically generates a form based on your record schema or a custom manifest. It handles form rendering, validation, and record submission through the configured record provider.
8
-
9
- ## Routes
10
-
11
- | Route | Description |
12
- |-------|-------------|
13
- | `/PSRS/:RecordSet/Create` | Opens the create form for the specified record set |
14
-
15
- ## Configuration
16
-
17
- Configure the Create view in your record set provider configuration:
18
-
19
- ```javascript
20
- const recordSetConfig = {
21
- RecordSet: 'User',
22
-
23
- // Use manifest-based form (recommended for custom layouts)
24
- RecordSetCreateManifestOnly: true,
25
- RecordSetCreateDefaultManifest: 'UserCreateForm',
26
- RecordSetCreateManifests: ['UserCreateForm', 'UserQuickCreate'],
27
-
28
- // Or let the view auto-generate from schema
29
- RecordSetCreateManifestOnly: false
30
- };
31
- ```
32
-
33
- ## Manifest Configuration
34
-
35
- When using `RecordSetCreateManifestOnly: true`, provide a manifest that defines the form structure:
36
-
37
- ```javascript
38
- const createManifest = {
39
- Form: 'UserCreateForm',
40
- Scope: 'UserDetails',
41
- Descriptors: {
42
- 'UserDetails.Name': {
43
- Name: 'Full Name',
44
- Hash: 'User-Name',
45
- DataType: 'String',
46
- PictForm: {
47
- Row: '1',
48
- Section: 'BasicInfo',
49
- Group: 'NameGroup'
50
- }
51
- },
52
- 'UserDetails.Email': {
53
- Name: 'Email Address',
54
- Hash: 'User-Email',
55
- DataType: 'String',
56
- PictForm: {
57
- Row: '2',
58
- Section: 'BasicInfo',
59
- Group: 'ContactGroup',
60
- InputType: 'Email'
61
- }
62
- }
63
- },
64
- Sections: [
65
- {
66
- Name: 'Basic Information',
67
- Hash: 'BasicInfo',
68
- ShowTitle: true,
69
- Groups: [
70
- {
71
- Name: 'Name',
72
- Hash: 'NameGroup',
73
- Rows: [],
74
- ShowTitle: false
75
- },
76
- {
77
- Name: 'Contact',
78
- Hash: 'ContactGroup',
79
- Rows: [],
80
- ShowTitle: true
81
- }
82
- ]
83
- }
84
- ]
85
- };
86
- ```
87
-
88
- ## Auto-Generated Forms
89
-
90
- When `RecordSetCreateManifestOnly` is `false` (or not set), the Create view automatically generates a form from the record schema. The following fields are excluded by default:
91
-
92
- - ID field (e.g., `IDUser`)
93
- - GUID field (e.g., `GUIDUser`)
94
- - `CreatingIDUser`
95
- - `UpdatingIDUser`
96
- - `DeletingIDUser`
97
- - `Deleted`
98
- - `CreateDate`
99
- - `UpdateDate`
100
- - `DeleteDate`
101
-
102
- ## Data Type Mapping
103
-
104
- Schema types are mapped to form input types:
105
-
106
- | Schema Type | Form DataType | Input Type |
107
- |-------------|---------------|------------|
108
- | `string`, `autoguid` | String | Text |
109
- | `datetime`, `date` | String | DateTime |
110
- | `boolean`, `deleted` | Boolean | Checkbox |
111
- | `integer`, `decimal` | Number | Number |
112
-
113
- ## Lifecycle Hooks
114
-
115
- Override these methods in a custom view class to add behavior:
116
-
117
- ```javascript
118
- class CustomCreateView extends viewRecordSetCreate {
119
- async onBeforeRenderCreate(pRecordConfiguration, pProviderHash) {
120
- // Called before rendering the form
121
- // Use for pre-population or validation setup
122
- }
123
-
124
- async onBeforeClear() {
125
- // Called before clearing the form
126
- // Use for confirmation dialogs
127
- }
128
-
129
- async onBeforeSave() {
130
- // Called before saving the record
131
- // Use for validation or data transformation
132
- }
133
- }
134
- ```
135
-
136
- ## Button Bar
137
-
138
- The default button bar includes:
139
-
140
- - **Clear** - Resets the form to empty state
141
- - **Save** - Creates the record via the provider's `createRecord` method
142
-
143
- After successful save, the view navigates to the Read view for the new record.
144
-
145
- ## Templates
146
-
147
- The Create view uses these templates:
148
-
149
- | Template Hash | Purpose |
150
- |---------------|---------|
151
- | `PRSP-Create-Basic-Template` | Main container template |
152
- | `PRSP-Create-RecordButtonBar-Template` | Save/Clear button bar |
153
- | `PRSP-Create-Link-Name-Template` | Link text for navigation |
154
- | `PRSP-Create-Link-URL-Template` | Link URL pattern |
155
-
156
- ## Customizing Templates
157
-
158
- Override templates by adding them before initialization:
159
-
160
- ```javascript
161
- pict.TemplateProvider.addTemplate('PRSP-Create-RecordButtonBar-Template', /*html*/`
162
- <div class="my-button-bar">
163
- <button onclick="_Pict.views['RSP-RecordSet-Create'].clear()">Reset</button>
164
- <button onclick="_Pict.views['RSP-RecordSet-Create'].save()">Create User</button>
165
- <button onclick="window.history.back()">Cancel</button>
166
- </div>
167
- `);
168
- ```
169
-
170
- ## Example Usage
171
-
172
- ```javascript
173
- // Navigate to create form programmatically
174
- pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/User/Create');
175
-
176
- // Access the create view
177
- const createView = pict.views['RSP-RecordSet-Create'];
178
-
179
- // Manually trigger save
180
- await createView.save();
181
- ```
@@ -1,308 +0,0 @@
1
- # Dashboard View
2
-
3
- The Dashboard view provides a configurable, manifest-driven interface for displaying record sets with enhanced visualization and computed columns.
4
-
5
- ## Overview
6
-
7
- The Dashboard view extends the list functionality with support for manifests that define computed columns, custom cell rendering, and dynamic data transformation. It's ideal for analytics, reporting, and complex data displays.
8
-
9
- ## Routes
10
-
11
- | Route | Description |
12
- |-------|-------------|
13
- | `/PSRS/:RecordSet/Dashboard` | Default dashboard |
14
- | `/PSRS/:RecordSet/Dashboard/:Offset` | Dashboard with offset |
15
- | `/PSRS/:RecordSet/Dashboard/:Offset/:PageSize` | Dashboard with pagination |
16
- | `/PSRS/:RecordSet/Dashboard/FilteredTo/:FilterString` | Dashboard with filter |
17
- | `/PSRS/:RecordSet/SpecificDashboard/:DashboardHash` | Named dashboard |
18
- | `/PSRS/:RecordSet/SpecificDashboard/:DashboardHash/:Offset/:PageSize` | Named dashboard with pagination |
19
-
20
- ## Configuration
21
-
22
- ```javascript
23
- const recordSetConfig = {
24
- RecordSet: 'Sales',
25
- Title: 'Sales Dashboard',
26
-
27
- // Use manifest-based dashboard
28
- RecordSetDashboardManifestOnly: true,
29
- RecordSetDashboardDefaultManifest: 'SalesOverview',
30
- RecordSetDashboardManifests: ['SalesOverview', 'SalesByRegion', 'TopSellers']
31
- };
32
- ```
33
-
34
- ## Dashboard Manifests
35
-
36
- Manifests define the dashboard structure, columns, and computed values:
37
-
38
- ```javascript
39
- const dashboardManifest = {
40
- Scope: 'SalesData',
41
- TitleTemplate: 'Sales Dashboard - {~D:Record.RecordSet~}',
42
-
43
- TableCells: [
44
- {
45
- Key: 'ProductName',
46
- DisplayName: 'Product',
47
- PictDashboard: {
48
- ValueTemplate: '{~D:Record.Data.ProductName~}'
49
- }
50
- },
51
- {
52
- Key: 'Revenue',
53
- DisplayName: 'Revenue',
54
- ManifestHash: 'Currency',
55
- PictDashboard: {
56
- ValueTemplate: '${~D:Record.Data.Revenue~}'
57
- }
58
- },
59
- {
60
- Key: 'GrowthRate',
61
- DisplayName: 'Growth',
62
- PictDashboard: {
63
- // Computed column using solver
64
- Solver: 'ComputeGrowthRate',
65
- ValueTemplate: '<span class="{~D:Record.Computed.GrowthClass~}">{~D:Record.Computed.GrowthRate~}%</span>'
66
- }
67
- }
68
- ],
69
-
70
- Descriptors: {
71
- 'GrowthRate': {
72
- Hash: 'GrowthRate',
73
- PictDashboard: {
74
- Solver: 'ComputeGrowthRate'
75
- }
76
- }
77
- }
78
- };
79
- ```
80
-
81
- ## Specific Dashboards
82
-
83
- Use the `SpecificDashboard` route to render a named dashboard:
84
-
85
- ```javascript
86
- // Navigate to specific dashboard
87
- pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/Sales/SpecificDashboard/SalesByRegion');
88
-
89
- // With pagination
90
- pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/Sales/SpecificDashboard/TopSellers/0/50');
91
- ```
92
-
93
- ## Child Views
94
-
95
- The Dashboard view uses these child views:
96
-
97
- | View | Purpose |
98
- |------|---------|
99
- | `PRSP-Dashboard-HeaderDashboard` | Dashboard header actions |
100
- | `PRSP-Dashboard-Title` | Dashboard title |
101
- | `PRSP-Filters` | Filter controls |
102
- | `PRSP-Dashboard-PaginationTop` | Top pagination |
103
- | `PRSP-Dashboard-RecordList` | Record table |
104
- | `PRSP-Dashboard-RecordListHeader` | Table headers |
105
- | `PRSP-Dashboard-RecordListEntry` | Table rows |
106
- | `PRSP-Dashboard-PaginationBottom` | Bottom pagination |
107
-
108
- ## Dynamic Solver
109
-
110
- The Dashboard view integrates with `DynamicRecordsetSolver` to compute values:
111
-
112
- ```javascript
113
- // Solver is called automatically during render
114
- pict.providers.DynamicRecordsetSolver.solveDashboard(manifest, records);
115
- ```
116
-
117
- This processes each record, running solvers defined in the manifest to populate computed fields.
118
-
119
- ## Column Definition
120
-
121
- ### Simple Columns
122
-
123
- ```javascript
124
- TableCells: [
125
- {
126
- Key: 'Name',
127
- DisplayName: 'Name',
128
- PictDashboard: {
129
- ValueTemplate: '{~D:Record.Data.Name~}'
130
- }
131
- }
132
- ]
133
- ```
134
-
135
- ### Computed Columns
136
-
137
- ```javascript
138
- TableCells: [
139
- {
140
- Key: 'Total',
141
- DisplayName: 'Total',
142
- PictDashboard: {
143
- Solver: 'ComputeTotal',
144
- ValueTemplate: '{~D:Record.Computed.Total~}'
145
- }
146
- }
147
- ]
148
- ```
149
-
150
- ### Custom Rendering
151
-
152
- ```javascript
153
- TableCells: [
154
- {
155
- Key: 'Status',
156
- DisplayName: 'Status',
157
- PictDashboard: {
158
- ValueTemplate: /*html*/`
159
- <span class="badge badge-{~D:Record.Data.Status~}">
160
- {~D:Record.Data.Status~}
161
- </span>
162
- `
163
- }
164
- }
165
- ]
166
- ```
167
-
168
- ## Lifecycle Hooks
169
-
170
- ```javascript
171
- class CustomDashboardView extends viewRecordSetDashboard {
172
- onBeforeRenderList(pRecordListData) {
173
- // Add custom data processing
174
- // Compute totals, add summary rows, etc.
175
- return pRecordListData;
176
- }
177
-
178
- dynamicallyGenerateColumns(pRecordListData) {
179
- // Customize auto-generated columns
180
- return super.dynamicallyGenerateColumns(pRecordListData);
181
- }
182
- }
183
- ```
184
-
185
- ## Templates
186
-
187
- | Template Hash | Purpose |
188
- |---------------|---------|
189
- | `PRSP-Dashboard-Template` | Main dashboard container |
190
- | `PRSP-Dashboard-Template-Record` | Record template |
191
-
192
- ## Filter Integration
193
-
194
- Dashboards support the same filtering as List views:
195
-
196
- ```javascript
197
- // With filter
198
- '/PSRS/Sales/Dashboard/FilteredTo/FBV~Region~EQ~North'
199
-
200
- // With filter experience (serialized filter state)
201
- '/PSRS/Sales/Dashboard/FilterExperience/eyJmaWx0ZXJzIjpbXX0='
202
- ```
203
-
204
- ## Decorated Records
205
-
206
- The Dashboard uses `getDecoratedRecords` instead of `getRecords`, which allows providers to add computed or transformed data:
207
-
208
- ```javascript
209
- // In provider
210
- async getDecoratedRecords(pFilter) {
211
- const records = await this.getRecords(pFilter);
212
-
213
- // Add decorations
214
- records.Records = records.Records.map(record => ({
215
- ...record,
216
- DisplayStatus: this.getStatusLabel(record.Status),
217
- FormattedDate: this.formatDate(record.CreatedDate)
218
- }));
219
-
220
- return records;
221
- }
222
- ```
223
-
224
- ## Example Usage
225
-
226
- ```javascript
227
- // Navigate to default dashboard
228
- pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/Sales/Dashboard');
229
-
230
- // Navigate to specific dashboard
231
- pict.providers.RecordSetRouter.pictRouter.navigate('/PSRS/Sales/SpecificDashboard/TopSellers');
232
-
233
- // Access the dashboard view
234
- const dashboardView = pict.views['RSP-RecordSet-Dashboard'];
235
-
236
- // Render programmatically
237
- const config = pict.PictSectionRecordSet.recordSetProviderConfigurations['Sales'];
238
- await dashboardView.renderDashboard(config, 'RSP-Provider-Sales', '', '', 0, 100);
239
-
240
- // Render specific dashboard
241
- await dashboardView.renderSpecificDashboard(
242
- 'TopSellers',
243
- config,
244
- 'RSP-Provider-Sales',
245
- '', // filterString
246
- '', // filterExperience
247
- 0, // offset
248
- 50 // pageSize
249
- );
250
- ```
251
-
252
- ## Data Structure
253
-
254
- The dashboard provides this data structure to templates:
255
-
256
- ```javascript
257
- {
258
- Title: 'Sales Dashboard',
259
- RecordSet: 'Sales',
260
- RecordSetConfiguration: { ... },
261
- RenderDestination: '#PRSP_Container',
262
- DashboardHash: 'TopSellers', // For specific dashboards
263
- FilterString: '',
264
- Records: { Records: [...] },
265
- TotalRecordCount: { Count: 500 },
266
- RecordSchema: { properties: { ... } },
267
- GUIDAddress: 'GUIDSales',
268
- TableCells: [
269
- {
270
- Key: 'ProductName',
271
- DisplayName: 'Product',
272
- ManifestHash: 'Default',
273
- PictDashboard: { ValueTemplate: '...' }
274
- }
275
- ],
276
- // Pagination data...
277
- }
278
- ```
279
-
280
- ## Multiple Dashboards
281
-
282
- Configure multiple dashboards for different views of the same data:
283
-
284
- ```javascript
285
- const recordSetConfig = {
286
- RecordSet: 'Sales',
287
- RecordSetDashboardManifests: ['Overview', 'ByRegion', 'ByProduct', 'TimeSeries']
288
- };
289
-
290
- // Register manifests
291
- pict.PictSectionRecordSet.addManifest('Overview', overviewManifest);
292
- pict.PictSectionRecordSet.addManifest('ByRegion', regionManifest);
293
- pict.PictSectionRecordSet.addManifest('ByProduct', productManifest);
294
- pict.PictSectionRecordSet.addManifest('TimeSeries', timeSeriesManifest);
295
- ```
296
-
297
- Then navigate between them:
298
-
299
- ```javascript
300
- // Overview
301
- '/PSRS/Sales/SpecificDashboard/Overview'
302
-
303
- // By Region
304
- '/PSRS/Sales/SpecificDashboard/ByRegion'
305
-
306
- // By Product
307
- '/PSRS/Sales/SpecificDashboard/ByProduct'
308
- ```