pict-section-recordset 1.0.0 → 1.0.2
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/.vscode/launch.json +46 -0
- package/debug/Harness.js +0 -7
- package/example_applications/ServeExamples.js +1 -1
- package/example_applications/mocks/book-edit-view.html +145 -0
- package/example_applications/mocks/book-read-view.html +139 -0
- package/example_applications/mocks/list-view.html +125 -0
- package/example_applications/simple_entity/Simple-RecordSet-Application.js +33 -27
- package/example_applications/simple_entity/html/index.html +3 -3
- package/package.json +12 -8
- package/source/Pict-Section-RecordSet.js +6 -2
- package/source/application/Pict-Application-RecordSet.js +23 -4
- package/source/providers/RecordSet-RecordProvider-Base.js +217 -0
- package/source/providers/RecordSet-RecordProvider-MeadowEndpoints.js +339 -0
- package/source/providers/RecordSet-Router.js +64 -0
- package/source/services/RecordsSet-MetaController.js +268 -0
- package/source/views/RecordSet-Filter.js +91 -0
- package/source/views/RecordSet-RecordBaseView.js +84 -0
- package/source/views/RecordsSet-MacroView.js +63 -0
- package/source/views/dashboard/RecordSet-Dashboard-HeaderDashboard.js +63 -0
- package/source/views/dashboard/RecordSet-Dashboard-RecordSetDashboard.js +63 -0
- package/source/views/dashboard/RecordSet-Dashboard-TabBarDashboard.js +63 -0
- package/source/views/dashboard/RecordSet-Dashboard.js +63 -0
- package/source/views/edit/RecordSet-Edit-HeaderEdit.js +63 -0
- package/source/views/edit/RecordSet-Edit-RecordEdit.js +63 -0
- package/source/views/edit/RecordSet-Edit-RecordEditControls.js +63 -0
- package/source/views/edit/RecordSet-Edit-RecordEditExtra.js +63 -0
- package/source/views/edit/RecordSet-Edit-TabBarEdit.js +63 -0
- package/source/views/edit/RecordSet-Edit.js +63 -0
- package/source/views/list/RecordSet-List-HeaderList.js +63 -0
- package/source/views/list/RecordSet-List-PaginationBottom.js +67 -0
- package/source/views/list/RecordSet-List-PaginationTop.js +127 -0
- package/source/views/list/RecordSet-List-RecordList.js +79 -0
- package/source/views/list/RecordSet-List-RecordListEntry.js +86 -0
- package/source/views/list/RecordSet-List-RecordListHeader.js +77 -0
- package/source/views/list/RecordSet-List-Title.js +66 -0
- package/source/views/list/RecordSet-List.js +310 -0
- package/source/views/read/RecordSet-Read-HeaderRead.js +63 -0
- package/source/views/read/RecordSet-Read-RecordRead.js +63 -0
- package/source/views/read/RecordSet-Read-RecordReadExtra.js +63 -0
- package/source/views/read/RecordSet-Read-TabBarRead.js +63 -0
- package/source/views/read/RecordSet-Read.js +162 -0
- package/test/PictSectionRecordSet-Basic_tests.js +6 -2
- package/test/PictSectionRecordSet-RecordProvider-Meadow_tests.js +203 -0
- package/tsconfig.build.json +16 -0
- package/tsconfig.json +1 -1
- package/types/Pict-Section-RecordSet.d.ts +9 -1
- package/types/application/Pict-Application-RecordSet.d.ts +5 -5
- package/types/application/Pict-Application-RecordSet.d.ts.map +1 -1
- package/types/providers/RecordSet-RecordProvider-Base.d.ts +207 -0
- package/types/providers/RecordSet-RecordProvider-Base.d.ts.map +1 -1
- package/types/providers/RecordSet-RecordProvider-MeadowEndpoints.d.ts +100 -0
- package/types/providers/RecordSet-RecordProvider-MeadowEndpoints.d.ts.map +1 -0
- package/types/providers/RecordSet-Router.d.ts +36 -0
- package/types/providers/RecordSet-Router.d.ts.map +1 -0
- package/types/services/RecordsSet-MetaController.d.ts +36 -0
- package/types/services/RecordsSet-MetaController.d.ts.map +1 -0
- package/types/views/RecordSet-Filter.d.ts +34 -0
- package/types/views/RecordSet-Filter.d.ts.map +1 -0
- package/types/views/RecordSet-RecordBaseView.d.ts +49 -0
- package/types/views/RecordSet-RecordBaseView.d.ts.map +1 -0
- package/types/views/RecordsSet-MacroView.d.ts +34 -0
- package/types/views/RecordsSet-MacroView.d.ts.map +1 -0
- package/types/views/dashboard/RecordSet-Dashboard-HeaderDashboard.d.ts +34 -0
- package/types/views/dashboard/RecordSet-Dashboard-HeaderDashboard.d.ts.map +1 -0
- package/types/views/dashboard/RecordSet-Dashboard-RecordSetDashboard.d.ts +34 -0
- package/types/views/dashboard/RecordSet-Dashboard-RecordSetDashboard.d.ts.map +1 -0
- package/types/views/dashboard/RecordSet-Dashboard-TabBarDashboard.d.ts +34 -0
- package/types/views/dashboard/RecordSet-Dashboard-TabBarDashboard.d.ts.map +1 -0
- package/types/views/dashboard/RecordSet-Dashboard.d.ts +33 -0
- package/types/views/dashboard/RecordSet-Dashboard.d.ts.map +1 -0
- package/types/views/edit/RecordSet-Edit-HeaderEdit.d.ts +34 -0
- package/types/views/edit/RecordSet-Edit-HeaderEdit.d.ts.map +1 -0
- package/types/views/edit/RecordSet-Edit-RecordEdit.d.ts +34 -0
- package/types/views/edit/RecordSet-Edit-RecordEdit.d.ts.map +1 -0
- package/types/views/edit/RecordSet-Edit-RecordEditControls.d.ts +34 -0
- package/types/views/edit/RecordSet-Edit-RecordEditControls.d.ts.map +1 -0
- package/types/views/edit/RecordSet-Edit-RecordEditExtra.d.ts +34 -0
- package/types/views/edit/RecordSet-Edit-RecordEditExtra.d.ts.map +1 -0
- package/types/views/edit/RecordSet-Edit-TabBarEdit.d.ts +34 -0
- package/types/views/edit/RecordSet-Edit-TabBarEdit.d.ts.map +1 -0
- package/types/views/edit/RecordSet-Edit.d.ts +33 -0
- package/types/views/edit/RecordSet-Edit.d.ts.map +1 -0
- package/types/views/list/RecordSet-List-HeaderList.d.ts +34 -0
- package/types/views/list/RecordSet-List-HeaderList.d.ts.map +1 -0
- package/types/views/list/RecordSet-List-PaginationBottom.d.ts +34 -0
- package/types/views/list/RecordSet-List-PaginationBottom.d.ts.map +1 -0
- package/types/views/list/RecordSet-List-PaginationTop.d.ts +34 -0
- package/types/views/list/RecordSet-List-PaginationTop.d.ts.map +1 -0
- package/types/views/list/RecordSet-List-RecordList.d.ts +34 -0
- package/types/views/list/RecordSet-List-RecordList.d.ts.map +1 -0
- package/types/views/list/RecordSet-List-RecordListEntry.d.ts +34 -0
- package/types/views/list/RecordSet-List-RecordListEntry.d.ts.map +1 -0
- package/types/views/list/RecordSet-List-RecordListHeader.d.ts +34 -0
- package/types/views/list/RecordSet-List-RecordListHeader.d.ts.map +1 -0
- package/types/views/list/RecordSet-List-Title.d.ts +34 -0
- package/types/views/list/RecordSet-List-Title.d.ts.map +1 -0
- package/types/views/list/RecordSet-List.d.ts +47 -0
- package/types/views/list/RecordSet-List.d.ts.map +1 -0
- package/types/views/read/RecordSet-Read-HeaderRead.d.ts +34 -0
- package/types/views/read/RecordSet-Read-HeaderRead.d.ts.map +1 -0
- package/types/views/read/RecordSet-Read-RecordRead.d.ts +34 -0
- package/types/views/read/RecordSet-Read-RecordRead.d.ts.map +1 -0
- package/types/views/read/RecordSet-Read-RecordReadExtra.d.ts +34 -0
- package/types/views/read/RecordSet-Read-RecordReadExtra.d.ts.map +1 -0
- package/types/views/read/RecordSet-Read-TabBarRead.d.ts +34 -0
- package/types/views/read/RecordSet-Read-TabBarRead.d.ts.map +1 -0
- package/types/views/read/RecordSet-Read.d.ts +44 -0
- package/types/views/read/RecordSet-Read.d.ts.map +1 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
const libFableServiceProviderBase = require('fable-serviceproviderbase');
|
|
2
|
+
|
|
3
|
+
const viewRecordSetList = require('../views/list/RecordSet-List.js');
|
|
4
|
+
const viewRecordSetEdit = require('../views/edit/RecordSet-Edit.js');
|
|
5
|
+
const viewRecordSetRead = require('../views/read/RecordSet-Read.js');
|
|
6
|
+
const viewRecordSetDashboard = require('../views/dashboard/RecordSet-Dashboard.js');
|
|
7
|
+
|
|
8
|
+
//_Pict.addProvider('BooksProvider', { Entity: 'Book', URLPrefix: 'http://www.datadebase.com:8086/1.0/' }, require('../source/providers/RecordSet-RecordProvider-MeadowEndpoints.js'));
|
|
9
|
+
const providerBase = require('../providers/RecordSet-RecordProvider-Base.js');
|
|
10
|
+
const providerMeadowEndpoints = require('../providers/RecordSet-RecordProvider-MeadowEndpoints.js');
|
|
11
|
+
|
|
12
|
+
const providerRouter = require('../providers/RecordSet-Router.js');
|
|
13
|
+
|
|
14
|
+
const _DEFAULT_CONFIGURATION =
|
|
15
|
+
{
|
|
16
|
+
DefaultMeadowURLPrefix: '/1.0/'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
class RecordSetMetacontroller extends libFableServiceProviderBase
|
|
20
|
+
{
|
|
21
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
22
|
+
{
|
|
23
|
+
let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION, pOptions);
|
|
24
|
+
super(pFable, tmpOptions, pServiceHash);
|
|
25
|
+
|
|
26
|
+
/** @type {import('pict') & { addAndInstantiateSingletonService: (hash: string, options: any, prototype: any) => any }} */
|
|
27
|
+
this.fable;
|
|
28
|
+
/** @type {any} */
|
|
29
|
+
this.log;
|
|
30
|
+
/** @type {any} */
|
|
31
|
+
this.options;
|
|
32
|
+
/** @type {string} */
|
|
33
|
+
this.UUID;
|
|
34
|
+
|
|
35
|
+
this.childViews = {
|
|
36
|
+
list: null,
|
|
37
|
+
edit: null,
|
|
38
|
+
read: null,
|
|
39
|
+
dashboard: null
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
this.recordSetProviders = {};
|
|
43
|
+
this.recordSetProviderConfigurations = {};
|
|
44
|
+
|
|
45
|
+
this.has_initialized = false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
"DefaultRecordSetConfigurations":
|
|
50
|
+
[
|
|
51
|
+
{
|
|
52
|
+
"RecordSet": "Book",
|
|
53
|
+
|
|
54
|
+
"RecordSetType": "MeadowEndpoint", // Could be "Custom" which would require a provider to already be created for the record set.
|
|
55
|
+
"RecordSetMeadowEntity": "Book", // This leverages the /Schema endpoint to get the record set columns.
|
|
56
|
+
|
|
57
|
+
"RecordSetURLPrefix": "http://www.datadebase.com:8086/1.0/"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"RecordSet": "Author",
|
|
61
|
+
|
|
62
|
+
"RecordSetType": "MeadowEndpoint",
|
|
63
|
+
"RecordSetMeadowEntity": "Author",
|
|
64
|
+
|
|
65
|
+
"RecordSetURLPrefix": "http://www.datadebase.com:8086/1.0/"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"RecordSet": "RandomizedValues",
|
|
69
|
+
|
|
70
|
+
"RecordSetType": "Custom" // This means the `PS-RSP-RandomizedValues` provider will be checked for to get records.
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
*/
|
|
74
|
+
loadRecordSetConfiguration(pRecordSetConfiguration)
|
|
75
|
+
{
|
|
76
|
+
if (typeof pRecordSetConfiguration !== 'object')
|
|
77
|
+
{
|
|
78
|
+
this.fable.log.error(`RecordSetMetacontroller: ${this.UUID} loadRecordSetConfiguration called with invalid configuration.`);
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if ((!('RecordSet' in pRecordSetConfiguration)) || (pRecordSetConfiguration.RecordSet === ''))
|
|
82
|
+
{
|
|
83
|
+
this.fable.log.error(`RecordSetMetacontroller: ${this.UUID} loadRecordSetConfiguration called with invalid configuration. Missing RecordSet.`);
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
let tmpProvider = false;
|
|
88
|
+
|
|
89
|
+
const providerConfiguration = Object.assign({}, {Hash: `RSP-Provider-${pRecordSetConfiguration.RecordSet}`}, pRecordSetConfiguration);
|
|
90
|
+
this.recordSetProviderConfigurations[providerConfiguration.RecordSet] = providerConfiguration;
|
|
91
|
+
|
|
92
|
+
switch (pRecordSetConfiguration.RecordSetType)
|
|
93
|
+
{
|
|
94
|
+
case 'MeadowEndpoint':
|
|
95
|
+
// Create a Meadow Endpoints provider
|
|
96
|
+
// Allow the Record Set to optionally point to a different entity
|
|
97
|
+
if (`RecordSetMeadowEntity` in pRecordSetConfiguration)
|
|
98
|
+
{
|
|
99
|
+
providerConfiguration.Entity = pRecordSetConfiguration.RecordSetMeadowEntity;
|
|
100
|
+
}
|
|
101
|
+
else
|
|
102
|
+
{
|
|
103
|
+
providerConfiguration.Entity = pRecordSetConfiguration.RecordSet;
|
|
104
|
+
}
|
|
105
|
+
// Default the URLPrefix to the base URLPrefix
|
|
106
|
+
if (`RecordSetURLPrefix` in pRecordSetConfiguration)
|
|
107
|
+
{
|
|
108
|
+
providerConfiguration.URLPrefix = pRecordSetConfiguration.RecordSetURLPrefix;
|
|
109
|
+
}
|
|
110
|
+
else
|
|
111
|
+
{
|
|
112
|
+
providerConfiguration.URLPrefix = '/1.0/';
|
|
113
|
+
}
|
|
114
|
+
tmpProvider = this.recordSetProviders[pRecordSetConfiguration.RecordSet] = this.fable.addProvider(providerConfiguration.Hash, providerConfiguration, providerMeadowEndpoints);
|
|
115
|
+
break;
|
|
116
|
+
default:
|
|
117
|
+
case 'Custom':
|
|
118
|
+
// Create a custom provider
|
|
119
|
+
if (`ProviderHash` in providerConfiguration)
|
|
120
|
+
{
|
|
121
|
+
if (!(providerConfiguration.ProviderHash in this.fable.servicesMap))
|
|
122
|
+
{
|
|
123
|
+
this.fable.log.error(`RecordSetMetacontroller: ${this.UUID} loadRecordSetConfiguration called with invalid configuration. ProviderHash ${providerConfiguration.ProviderHash} not found. Falling back to base.`);
|
|
124
|
+
tmpProvider = this.recordSetProviders[providerConfiguration.RecordSet] = this.fable.servicesMap[providerConfiguration.ProviderHash];
|
|
125
|
+
}
|
|
126
|
+
else
|
|
127
|
+
{
|
|
128
|
+
tmpProvider = this.recordSetProviders[providerConfiguration.RecordSet] = this.fable.addProvider(providerConfiguration.Hash, providerConfiguration, providerBase);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else
|
|
132
|
+
{
|
|
133
|
+
tmpProvider = this.recordSetProviders[providerConfiguration.RecordSet] = this.fable.addProvider(providerConfiguration.Hash, providerConfiguration, providerBase);
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return tmpProvider;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
loadRecordSetConfigurationArray(pRecordSetConfigurationArray)
|
|
142
|
+
{
|
|
143
|
+
if (!Array.isArray(pRecordSetConfigurationArray))
|
|
144
|
+
{
|
|
145
|
+
this.fable.log.error(`RecordSetMetacontroller: ${this.UUID} loadRecordSetConfigurationArray called with invalid configuration.`);
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
if (pRecordSetConfigurationArray.length === 0)
|
|
149
|
+
{
|
|
150
|
+
this.fable.log.error(`RecordSetMetacontroller: ${this.UUID} loadRecordSetConfigurationArray called with empty configuration.`);
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
for (let i = 0; i < pRecordSetConfigurationArray.length; i++)
|
|
154
|
+
{
|
|
155
|
+
if (!this.loadRecordSetConfiguration(pRecordSetConfigurationArray[i]))
|
|
156
|
+
{
|
|
157
|
+
this.fable.log.error(`RecordSetMetacontroller: ${this.UUID} loadRecordSetConfigurationArray called with invalid configuration:`,pRecordSetConfigurationArray[i]);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
loadRecordSetDynamcally(pRecordSet, pEntity, pDefaultFilter)
|
|
163
|
+
{
|
|
164
|
+
if (typeof(pRecordSet) === 'object')
|
|
165
|
+
{
|
|
166
|
+
const tmpRecordSetProviderHash = `RSP-Provider-${pRecordSet.RecordSet}`;
|
|
167
|
+
this.loadRecordSetConfiguration(pRecordSet);
|
|
168
|
+
|
|
169
|
+
return this.fable.providers[tmpRecordSetProviderHash].initializeAsync((pError) =>
|
|
170
|
+
{
|
|
171
|
+
this.log.trace(`RecordSet [${pRecordSet.RecordSet} dynamically loaded.`);
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (typeof(pRecordSet) === 'string')
|
|
176
|
+
{
|
|
177
|
+
const tmpRecordSet = pRecordSet;
|
|
178
|
+
const tmpRecordSetProviderHash = `RSP-Provider-${tmpRecordSet}`;
|
|
179
|
+
|
|
180
|
+
const tmpEntity = (typeof(pEntity) === 'string') ? pEntity : tmpRecordSet;
|
|
181
|
+
const tmpDefaultFilter = (typeof(pDefaultFilter) === 'string') ? pDefaultFilter : '';
|
|
182
|
+
const tmpRecordSetConfiguration = {
|
|
183
|
+
"RecordSet": tmpRecordSet,
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
"RecordSetType": "MeadowEndpoint",
|
|
187
|
+
"RecordSetMeadowEntity": tmpEntity,
|
|
188
|
+
"RecordSetDefaultFilter": tmpDefaultFilter,
|
|
189
|
+
|
|
190
|
+
"RecordSetURLPrefix": "/1.0/"
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
this.loadRecordSetConfiguration(tmpRecordSetConfiguration);
|
|
194
|
+
return this.fable.providers[tmpRecordSetProviderHash].initializeAsync(
|
|
195
|
+
(pError) =>
|
|
196
|
+
{
|
|
197
|
+
this.log.trace(`RecordSet [${tmpRecordSetConfiguration.RecordSet} dynamically loaded.`);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
this.log.error(`RecordSet MetaController loadRecordSetDynamically called with invalid parameter (expected an Object or String - parameter was ${typeof(pRecordSet)}.`);
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
handleLoadDynamicRecordSetRoute(pRoutePayload)
|
|
206
|
+
{
|
|
207
|
+
if (typeof(pRoutePayload) != 'object')
|
|
208
|
+
{
|
|
209
|
+
throw new Error(`Pict RecordSet List view route handler called with invalid route payload.`);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const tmpRecordSet = pRoutePayload.data.RecordSet;
|
|
213
|
+
|
|
214
|
+
const tmpEntity = pRoutePayload.data.Entity ? pRoutePayload.data.Entity : tmpRecordSet;
|
|
215
|
+
const tmpDefaultFilter = pRoutePayload.data.DefaultFilter ? pRoutePayload.data.DefaultFilter : '';
|
|
216
|
+
|
|
217
|
+
return this.loadRecordSetDynamcally(tmpRecordSet, tmpEntity, tmpDefaultFilter);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
addRoutes(pPictRouter)
|
|
221
|
+
{
|
|
222
|
+
pPictRouter.addRoute('/PSRS/:RecordSet/LoadDynamic', this.handleLoadDynamicRecordSetRoute.bind(this));
|
|
223
|
+
pPictRouter.addRoute('/PSRS/:RecordSet/LoadDynamic/:Entity', this.handleLoadDynamicRecordSetRoute.bind(this));
|
|
224
|
+
pPictRouter.addRoute('/PSRS/:RecordSet/LoadDynamic/:Entity/:DefaultFilter', this.handleLoadDynamicRecordSetRoute.bind(this));
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
initialize()
|
|
229
|
+
{
|
|
230
|
+
if (this.has_initialized)
|
|
231
|
+
{
|
|
232
|
+
this.fable.log.warn(`RecordSetMetacontroller: ${this.UUID} already initialized and initialized was called a second time.`);
|
|
233
|
+
return this;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// Add the subviews internally and externally
|
|
237
|
+
this.childViews.list = this.fable.addView('RSP-RecordSet-List', this.options, viewRecordSetList);
|
|
238
|
+
this.childViews.edit = this.fable.addView('RSP-RecordSet-Edit', this.options, viewRecordSetEdit);
|
|
239
|
+
this.childViews.read = this.fable.addView('RSP-RecordSet-Read', this.options, viewRecordSetRead);
|
|
240
|
+
this.childViews.dashboard = this.fable.addView('RSP-RecordSet-Dashboard', this.options, viewRecordSetDashboard);
|
|
241
|
+
|
|
242
|
+
// Initialize the subviews
|
|
243
|
+
this.childViews.list.initialize();
|
|
244
|
+
this.childViews.edit.initialize();
|
|
245
|
+
this.childViews.read.initialize();
|
|
246
|
+
this.childViews.dashboard.initialize();
|
|
247
|
+
|
|
248
|
+
// Now initialize the router
|
|
249
|
+
|
|
250
|
+
if (this.fable.settings.hasOwnProperty('DefaultRecordSetConfigurations'))
|
|
251
|
+
{
|
|
252
|
+
this.loadRecordSetConfigurationArray(this.fable.settings.DefaultRecordSetConfigurations);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
this.has_initialized = true; // Load pict-router if it isn't loaded
|
|
256
|
+
if (!('RecordSetRouter' in this.fable.providers))
|
|
257
|
+
{
|
|
258
|
+
this.fable.addProvider('RecordSetRouter', {}, providerRouter);
|
|
259
|
+
this.fable.providers.RecordSetRouter.initialize();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return true;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
module.exports = RecordSetMetacontroller;
|
|
267
|
+
|
|
268
|
+
RecordSetMetacontroller.default_configuration = _DEFAULT_CONFIGURATION;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const libPictView = require('pict-view');
|
|
2
|
+
|
|
3
|
+
const _DEFAULT_CONFIGURATION_SUBSET_Filter = (
|
|
4
|
+
{
|
|
5
|
+
ViewIdentifier: 'PRSP-SUBSET-Filter',
|
|
6
|
+
|
|
7
|
+
DefaultRenderable: 'PRSP_Renderable_Filter',
|
|
8
|
+
DefaultDestinationAddress: '#PRSP_Filter_Container',
|
|
9
|
+
DefaultTemplateRecordAddress: false,
|
|
10
|
+
|
|
11
|
+
// If this is set to true, when the App initializes this will.
|
|
12
|
+
// While the App initializes, initialize will be called.
|
|
13
|
+
AutoInitialize: false,
|
|
14
|
+
AutoInitializeOrdinal: 0,
|
|
15
|
+
|
|
16
|
+
// If this is set to true, when the App autorenders (on load) this will.
|
|
17
|
+
// After the App initializes, render will be called.
|
|
18
|
+
AutoRender: false,
|
|
19
|
+
AutoRenderOrdinal: 0,
|
|
20
|
+
|
|
21
|
+
AutoSolveWithApp: false,
|
|
22
|
+
AutoSolveOrdinal: 0,
|
|
23
|
+
|
|
24
|
+
CSS: false,
|
|
25
|
+
CSSPriority: 500,
|
|
26
|
+
|
|
27
|
+
Templates:
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
Hash: 'PRSP-SUBSET-Filter-Template',
|
|
31
|
+
Template: /*html*/`
|
|
32
|
+
<!-- DefaultPackage pict view template: [PRSP-SUBSET-Filter-Template] -->
|
|
33
|
+
<section id="PRSP_Filter_Container">
|
|
34
|
+
<form id="PRSP_Filter_Form">
|
|
35
|
+
{~T:PRSP-SUBSET-Filter-Template-Input-Fieldset~}
|
|
36
|
+
{~T:PRSP-SUBSET-Filter-Template-Button-Fieldset~}
|
|
37
|
+
</form>
|
|
38
|
+
</section>
|
|
39
|
+
<!-- DefaultPackage end view template: [PRSP-SUBSET-Filter-Template] -->
|
|
40
|
+
`
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
Hash: 'PRSP-SUBSET-Filter-Template-Input-Fieldset',
|
|
44
|
+
Template: /*html*/`
|
|
45
|
+
<!-- DefaultPackage pict view template: [PRSP-SUBSET-Filter-Template-Input-Fieldset] -->
|
|
46
|
+
<fieldset>
|
|
47
|
+
<label for="filter">Filter:</label>
|
|
48
|
+
<input type="text" name="filter">
|
|
49
|
+
</fieldset>
|
|
50
|
+
<!-- DefaultPackage end view template: [PRSP-SUBSET-Filter-Template-Input-Fieldset] -->
|
|
51
|
+
`
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
Hash: 'PRSP-SUBSET-Filter-Template-Button-Fieldset',
|
|
55
|
+
Template: /*html*/`
|
|
56
|
+
<!-- DefaultPackage pict view template: [PRSP-SUBSET-Filter-Template-Button-Fieldset] -->
|
|
57
|
+
<fieldset>
|
|
58
|
+
<button type="button" id="PRSP_Filter_Button_Reset">Reset</button>
|
|
59
|
+
<button type="submit" id="PRSP_Filter_Button_Apply">Apply</button>
|
|
60
|
+
</fieldset>
|
|
61
|
+
<!-- DefaultPackage end view template: [PRSP-SUBSET-Filter-Template-Button-Fieldset] -->
|
|
62
|
+
`
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
|
|
66
|
+
Renderables:
|
|
67
|
+
[
|
|
68
|
+
{
|
|
69
|
+
RenderableHash: 'PRSP_Renderable_Filter',
|
|
70
|
+
TemplateHash: 'PRSP-SUBSET-Filter-Template',
|
|
71
|
+
DestinationAddress: '#PRSP_Filter_Container',
|
|
72
|
+
RenderMethod: 'replace'
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
|
|
76
|
+
Manifests: {}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
class viewRecordSetSUBSETFilter extends libPictView
|
|
80
|
+
{
|
|
81
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
82
|
+
{
|
|
83
|
+
let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_SUBSET_Filter, pOptions);
|
|
84
|
+
super(pFable, tmpOptions, pServiceHash);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
module.exports = viewRecordSetSUBSETFilter;
|
|
89
|
+
|
|
90
|
+
module.exports.default_configuration = _DEFAULT_CONFIGURATION_SUBSET_Filter;
|
|
91
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const libPictView = require('pict-view');
|
|
2
|
+
|
|
3
|
+
const _DEFAULT_CONFIGURATION_Base_View = (
|
|
4
|
+
{
|
|
5
|
+
ViewIdentifier: 'PRSP-RecordSet-View-Base',
|
|
6
|
+
|
|
7
|
+
DefaultRenderable: 'PRSP_Base_Recordset',
|
|
8
|
+
DefaultDestinationAddress: '#PictRecordSetContainer',
|
|
9
|
+
DefaultTemplateRecordAddress: false,
|
|
10
|
+
|
|
11
|
+
// If this is set to true, when the App initializes this will.
|
|
12
|
+
// While the App initializes, initialize will be called.
|
|
13
|
+
AutoInitialize: false,
|
|
14
|
+
AutoInitializeOrdinal: 0,
|
|
15
|
+
|
|
16
|
+
// If this is set to true, when the App autorenders (on load) this will.
|
|
17
|
+
// After the App initializes, render will be called.
|
|
18
|
+
AutoRender: false,
|
|
19
|
+
AutoRenderOrdinal: 0,
|
|
20
|
+
|
|
21
|
+
AutoSolveWithApp: false,
|
|
22
|
+
AutoSolveOrdinal: 0,
|
|
23
|
+
|
|
24
|
+
CSS: false,
|
|
25
|
+
CSSPriority: 500,
|
|
26
|
+
|
|
27
|
+
Templates:
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
Hash: 'PRSP-Base-View-Template',
|
|
31
|
+
Template: /*html*/`
|
|
32
|
+
<!-- DefaultPackage pict view template: [PRSP-Base-View-Template] -->
|
|
33
|
+
<!--
|
|
34
|
+
If this is being rendered, the RecordSet view has not taken control of its render function.
|
|
35
|
+
While the view may not need custom templating it is strongly encouraged to still override
|
|
36
|
+
the template and put informative messaging into an HTML comment.
|
|
37
|
+
|
|
38
|
+
Record JSON:
|
|
39
|
+
\`\`\`json
|
|
40
|
+
{~DataJson:Record~}
|
|
41
|
+
\`\`\`
|
|
42
|
+
--!
|
|
43
|
+
<!-- DefaultPackage end view template: [PRSP-Base-View-Template] -->
|
|
44
|
+
`
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
Renderables:
|
|
49
|
+
[
|
|
50
|
+
{
|
|
51
|
+
RenderableHash: 'PRSP_Base_Recordset',
|
|
52
|
+
TemplateHash: 'PRSP-Base-View-Template',
|
|
53
|
+
DestinationAddress: '#PictRecordSetContainer',
|
|
54
|
+
RenderMethod: 'replace'
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
|
|
58
|
+
Manifests: {}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
class viewPictSectionRecordSetViewBase extends libPictView
|
|
62
|
+
{
|
|
63
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
64
|
+
{
|
|
65
|
+
let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_Base_View, pOptions);
|
|
66
|
+
super(pFable, tmpOptions, pServiceHash);
|
|
67
|
+
/** @type {import('pict') & {
|
|
68
|
+
* log: any,
|
|
69
|
+
* instantiateServiceProviderWithoutRegistration: (hash: String) => any,
|
|
70
|
+
* PictSectionRecordSet: InstanceType<import('../Pict-Section-RecordSet.js')> }
|
|
71
|
+
* } */
|
|
72
|
+
this.pict;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
addRoutes(pPictRouter)
|
|
76
|
+
{
|
|
77
|
+
this.pict.log.trace(`View [${this.options.ViewIdentifier}]::[${this.Hash}] addRoutes called.`);
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = viewPictSectionRecordSetViewBase;
|
|
83
|
+
|
|
84
|
+
module.exports.default_configuration = _DEFAULT_CONFIGURATION_Base_View;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const libPictView = require('pict-view');
|
|
2
|
+
|
|
3
|
+
const _DEFAULT_CONFIGURATION_Dashboard_HeaderDashboard = (
|
|
4
|
+
{
|
|
5
|
+
ViewIdentifier: 'PRSP-Main',
|
|
6
|
+
|
|
7
|
+
DefaultRenderable: 'PRSP_Main_Container',
|
|
8
|
+
DefaultDestinationAddress: '#PictRecordSetContainer',
|
|
9
|
+
DefaultTemplateRecordAddress: false,
|
|
10
|
+
|
|
11
|
+
// If this is set to true, when the App initializes this will.
|
|
12
|
+
// While the App initializes, initialize will be called.
|
|
13
|
+
AutoInitialize: false,
|
|
14
|
+
AutoInitializeOrdinal: 0,
|
|
15
|
+
|
|
16
|
+
// If this is set to true, when the App autorenders (on load) this will.
|
|
17
|
+
// After the App initializes, render will be called.
|
|
18
|
+
AutoRender: false,
|
|
19
|
+
AutoRenderOrdinal: 0,
|
|
20
|
+
|
|
21
|
+
AutoSolveWithApp: false,
|
|
22
|
+
AutoSolveOrdinal: 0,
|
|
23
|
+
|
|
24
|
+
CSS: false,
|
|
25
|
+
CSSPriority: 500,
|
|
26
|
+
|
|
27
|
+
Templates:
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
Hash: 'PRSP-Main-Container-Template',
|
|
31
|
+
Template: /*html*/`
|
|
32
|
+
<!-- DefaultPackage pict view template: [PRSP-Main-Container-Template] -->
|
|
33
|
+
<!-- DefaultPackage end view template: [PRSP-Main-Container-Template] -->
|
|
34
|
+
`
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
|
|
38
|
+
Renderables:
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
RenderableHash: 'PRSP_Renderable_HeaderDashboard',
|
|
42
|
+
TemplateHash: 'PRSP-Main-Container-Template',
|
|
43
|
+
DestinationAddress: '#PRSP_Main_Container',
|
|
44
|
+
RenderMethod: 'replace'
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
Manifests: {}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
class viewPictSectionRecordSetMain extends libPictView
|
|
52
|
+
{
|
|
53
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
54
|
+
{
|
|
55
|
+
let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_Dashboard_HeaderDashboard, pOptions);
|
|
56
|
+
super(pFable, tmpOptions, pServiceHash);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = viewPictSectionRecordSetMain;
|
|
61
|
+
|
|
62
|
+
module.exports.default_configuration = _DEFAULT_CONFIGURATION_Dashboard_HeaderDashboard;
|
|
63
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const libPictView = require('pict-view');
|
|
2
|
+
|
|
3
|
+
const _DEFAULT_CONFIGURATION_Dashboard_HeaderDashboard = (
|
|
4
|
+
{
|
|
5
|
+
ViewIdentifier: 'PRSP-Dashboard-HeaderDashboard',
|
|
6
|
+
|
|
7
|
+
DefaultRenderable: 'PRSP_Renderable_HeaderDashboard',
|
|
8
|
+
DefaultDestinationAddress: '#PRSP_HeaderDashboard_Container',
|
|
9
|
+
DefaultTemplateRecordAddress: false,
|
|
10
|
+
|
|
11
|
+
// If this is set to true, when the App initializes this will.
|
|
12
|
+
// While the App initializes, initialize will be called.
|
|
13
|
+
AutoInitialize: false,
|
|
14
|
+
AutoInitializeOrdinal: 0,
|
|
15
|
+
|
|
16
|
+
// If this is set to true, when the App autorenders (on load) this will.
|
|
17
|
+
// After the App initializes, render will be called.
|
|
18
|
+
AutoRender: false,
|
|
19
|
+
AutoRenderOrdinal: 0,
|
|
20
|
+
|
|
21
|
+
AutoSolveWithApp: false,
|
|
22
|
+
AutoSolveOrdinal: 0,
|
|
23
|
+
|
|
24
|
+
CSS: false,
|
|
25
|
+
CSSPriority: 500,
|
|
26
|
+
|
|
27
|
+
Templates:
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
Hash: 'PRSP-Dashboard-HeaderDashboard-Template',
|
|
31
|
+
Template: /*html*/`
|
|
32
|
+
<!-- DefaultPackage pict view template: [PRSP-Dashboard-HeaderDashboard-Template] -->
|
|
33
|
+
<!-- DefaultPackage end view template: [PRSP-Dashboard-HeaderDashboard-Template] -->
|
|
34
|
+
`
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
|
|
38
|
+
Renderables:
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
RenderableHash: 'PRSP_Renderable_HeaderDashboard',
|
|
42
|
+
TemplateHash: 'PRSP-Dashboard-HeaderDashboard-Template',
|
|
43
|
+
DestinationAddress: '#PRSP_HeaderDashboard_Container',
|
|
44
|
+
RenderMethod: 'replace'
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
Manifests: {}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
class viewRecordSetDashboardHeaderDashboard extends libPictView
|
|
52
|
+
{
|
|
53
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
54
|
+
{
|
|
55
|
+
let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_Dashboard_HeaderDashboard, pOptions);
|
|
56
|
+
super(pFable, tmpOptions, pServiceHash);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = viewRecordSetDashboardHeaderDashboard;
|
|
61
|
+
|
|
62
|
+
module.exports.default_configuration = _DEFAULT_CONFIGURATION_Dashboard_HeaderDashboard;
|
|
63
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const libPictView = require('pict-view');
|
|
2
|
+
|
|
3
|
+
const _DEFAULT_CONFIGURATION_Dashboard_RecordSetDashboard = (
|
|
4
|
+
{
|
|
5
|
+
ViewIdentifier: 'PRSP-Dashboard-RecordSetDashboard',
|
|
6
|
+
|
|
7
|
+
DefaultRenderable: 'PRSP_Renderable_RecordSetDashboard',
|
|
8
|
+
DefaultDestinationAddress: '#PRSP_RecordSetDashboard_Container',
|
|
9
|
+
DefaultTemplateRecordAddress: false,
|
|
10
|
+
|
|
11
|
+
// If this is set to true, when the App initializes this will.
|
|
12
|
+
// While the App initializes, initialize will be called.
|
|
13
|
+
AutoInitialize: false,
|
|
14
|
+
AutoInitializeOrdinal: 0,
|
|
15
|
+
|
|
16
|
+
// If this is set to true, when the App autorenders (on load) this will.
|
|
17
|
+
// After the App initializes, render will be called.
|
|
18
|
+
AutoRender: false,
|
|
19
|
+
AutoRenderOrdinal: 0,
|
|
20
|
+
|
|
21
|
+
AutoSolveWithApp: false,
|
|
22
|
+
AutoSolveOrdinal: 0,
|
|
23
|
+
|
|
24
|
+
CSS: false,
|
|
25
|
+
CSSPriority: 500,
|
|
26
|
+
|
|
27
|
+
Templates:
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
Hash: 'PRSP-Dashboard-RecordSetDashboard-Template',
|
|
31
|
+
Template: /*html*/`
|
|
32
|
+
<!-- DefaultPackage pict view template: [PRSP-Dashboard-RecordSetDashboard-Template] -->
|
|
33
|
+
<!-- DefaultPackage end view template: [PRSP-Dashboard-RecordSetDashboard-Template] -->
|
|
34
|
+
`
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
|
|
38
|
+
Renderables:
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
RenderableHash: 'PRSP_Renderable_RecordSetDashboard',
|
|
42
|
+
TemplateHash: 'PRSP-Dashboard-RecordSetDashboard-Template',
|
|
43
|
+
DestinationAddress: '#PRSP_RecordSetDashboard_Container',
|
|
44
|
+
RenderMethod: 'replace'
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
Manifests: {}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
class viewRecordSetDashboardRecordSetDashboard extends libPictView
|
|
52
|
+
{
|
|
53
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
54
|
+
{
|
|
55
|
+
let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_Dashboard_RecordSetDashboard, pOptions);
|
|
56
|
+
super(pFable, tmpOptions, pServiceHash);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = viewRecordSetDashboardRecordSetDashboard;
|
|
61
|
+
|
|
62
|
+
module.exports.default_configuration = _DEFAULT_CONFIGURATION_Dashboard_RecordSetDashboard;
|
|
63
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const libPictView = require('pict-view');
|
|
2
|
+
|
|
3
|
+
const _DEFAULT_CONFIGURATION_Dashboard_TabBarDashboard = (
|
|
4
|
+
{
|
|
5
|
+
ViewIdentifier: 'PRSP-Dashboard-TabBarDashboard',
|
|
6
|
+
|
|
7
|
+
DefaultRenderable: 'PRSP_Renderable_TabBarDashboard',
|
|
8
|
+
DefaultDestinationAddress: '#PRSP_TabBarDashboard_Container',
|
|
9
|
+
DefaultTemplateRecordAddress: false,
|
|
10
|
+
|
|
11
|
+
// If this is set to true, when the App initializes this will.
|
|
12
|
+
// While the App initializes, initialize will be called.
|
|
13
|
+
AutoInitialize: false,
|
|
14
|
+
AutoInitializeOrdinal: 0,
|
|
15
|
+
|
|
16
|
+
// If this is set to true, when the App autorenders (on load) this will.
|
|
17
|
+
// After the App initializes, render will be called.
|
|
18
|
+
AutoRender: false,
|
|
19
|
+
AutoRenderOrdinal: 0,
|
|
20
|
+
|
|
21
|
+
AutoSolveWithApp: false,
|
|
22
|
+
AutoSolveOrdinal: 0,
|
|
23
|
+
|
|
24
|
+
CSS: false,
|
|
25
|
+
CSSPriority: 500,
|
|
26
|
+
|
|
27
|
+
Templates:
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
Hash: 'PRSP-Dashboard-TabBarDashboard-Template',
|
|
31
|
+
Template: /*html*/`
|
|
32
|
+
<!-- DefaultPackage pict view template: [PRSP-Dashboard-TabBarDashboard-Template] -->
|
|
33
|
+
<!-- DefaultPackage end view template: [PRSP-Dashboard-TabBarDashboard-Template] -->
|
|
34
|
+
`
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
|
|
38
|
+
Renderables:
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
RenderableHash: 'PRSP_Renderable_TabBarDashboard',
|
|
42
|
+
TemplateHash: 'PRSP-Dashboard-TabBarDashboard-Template',
|
|
43
|
+
DestinationAddress: '#PRSP_TabBarDashboard_Container',
|
|
44
|
+
RenderMethod: 'replace'
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
Manifests: {}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
class viewRecordSetDashboardTabBarDashboard extends libPictView
|
|
52
|
+
{
|
|
53
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
54
|
+
{
|
|
55
|
+
let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_Dashboard_TabBarDashboard, pOptions);
|
|
56
|
+
super(pFable, tmpOptions, pServiceHash);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = viewRecordSetDashboardTabBarDashboard;
|
|
61
|
+
|
|
62
|
+
module.exports.default_configuration = _DEFAULT_CONFIGURATION_Dashboard_TabBarDashboard;
|
|
63
|
+
|