pict-section-recordset 1.0.0 → 1.0.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.
Files changed (98) hide show
  1. package/.vscode/launch.json +46 -0
  2. package/debug/Harness.js +0 -7
  3. package/example_applications/list_view/index.html +125 -0
  4. package/example_applications/simple_entity/Simple-RecordSet-Application.js +32 -26
  5. package/example_applications/simple_entity/html/index.html +3 -3
  6. package/package.json +9 -6
  7. package/source/Pict-Section-RecordSet.js +6 -2
  8. package/source/application/Pict-Application-RecordSet.js +11 -0
  9. package/source/providers/RecordSet-RecordProvider-Base.js +217 -0
  10. package/source/providers/RecordSet-RecordProvider-MeadowEndpoints.js +339 -0
  11. package/source/services/RecordsSet-MetaController.js +196 -0
  12. package/source/views/RecordSet-Filter.js +91 -0
  13. package/source/views/RecordsSet-MacroView.js +0 -0
  14. package/source/views/dashboard/RecordSet-Dashboard-HeaderDashboard.js +63 -0
  15. package/source/views/dashboard/RecordSet-Dashboard-RecordSetDashboard.js +63 -0
  16. package/source/views/dashboard/RecordSet-Dashboard-TabBarDashboard.js +63 -0
  17. package/source/views/dashboard/RecordSet-Dashboard.js +63 -0
  18. package/source/views/edit/RecordSet-Edit-HeaderEdit.js +63 -0
  19. package/source/views/edit/RecordSet-Edit-RecordEdit.js +63 -0
  20. package/source/views/edit/RecordSet-Edit-RecordEditControls.js +63 -0
  21. package/source/views/edit/RecordSet-Edit-RecordEditExtra.js +63 -0
  22. package/source/views/edit/RecordSet-Edit-TabBarEdit.js +63 -0
  23. package/source/views/edit/RecordSet-Edit.js +63 -0
  24. package/source/views/list/RecordSet-List-HeaderList.js +63 -0
  25. package/source/views/list/RecordSet-List-PaginationBottom.js +67 -0
  26. package/source/views/list/RecordSet-List-PaginationTop.js +115 -0
  27. package/source/views/list/RecordSet-List-RecordList.js +79 -0
  28. package/source/views/list/RecordSet-List-RecordListEntry.js +92 -0
  29. package/source/views/list/RecordSet-List-RecordListHeader.js +87 -0
  30. package/source/views/list/RecordSet-List-Title.js +67 -0
  31. package/source/views/list/RecordSet-List.js +167 -0
  32. package/source/views/read/RecordSet-Read-HeaderRead.js +63 -0
  33. package/source/views/read/RecordSet-Read-RecordRead.js +63 -0
  34. package/source/views/read/RecordSet-Read-RecordReadExtra.js +63 -0
  35. package/source/views/read/RecordSet-Read-TabBarRead.js +63 -0
  36. package/source/views/read/RecordSet-Read.js +63 -0
  37. package/test/PictSectionRecordSet-Basic_tests.js +1 -1
  38. package/test/PictSectionRecordSet-RecordProvider-Meadow_tests.js +203 -0
  39. package/tsconfig.build.json +16 -0
  40. package/tsconfig.json +1 -1
  41. package/types/Pict-Section-RecordSet.d.ts +5 -1
  42. package/types/application/Pict-Application-RecordSet.d.ts.map +1 -1
  43. package/types/providers/RecordSet-RecordProvider-Base.d.ts +207 -0
  44. package/types/providers/RecordSet-RecordProvider-Base.d.ts.map +1 -1
  45. package/types/providers/RecordSet-RecordProvider-MeadowEndpoints.d.ts +100 -0
  46. package/types/providers/RecordSet-RecordProvider-MeadowEndpoints.d.ts.map +1 -0
  47. package/types/services/RecordsSet-MetaController.d.ts +30 -0
  48. package/types/services/RecordsSet-MetaController.d.ts.map +1 -0
  49. package/types/views/RecordSet-Filter.d.ts +34 -0
  50. package/types/views/RecordSet-Filter.d.ts.map +1 -0
  51. package/types/views/RecordsSet-MacroView.d.ts +1 -0
  52. package/types/views/RecordsSet-MacroView.d.ts.map +1 -0
  53. package/types/views/dashboard/RecordSet-Dashboard-HeaderDashboard.d.ts +34 -0
  54. package/types/views/dashboard/RecordSet-Dashboard-HeaderDashboard.d.ts.map +1 -0
  55. package/types/views/dashboard/RecordSet-Dashboard-RecordSetDashboard.d.ts +34 -0
  56. package/types/views/dashboard/RecordSet-Dashboard-RecordSetDashboard.d.ts.map +1 -0
  57. package/types/views/dashboard/RecordSet-Dashboard-TabBarDashboard.d.ts +34 -0
  58. package/types/views/dashboard/RecordSet-Dashboard-TabBarDashboard.d.ts.map +1 -0
  59. package/types/views/dashboard/RecordSet-Dashboard.d.ts +34 -0
  60. package/types/views/dashboard/RecordSet-Dashboard.d.ts.map +1 -0
  61. package/types/views/edit/RecordSet-Edit-HeaderEdit.d.ts +34 -0
  62. package/types/views/edit/RecordSet-Edit-HeaderEdit.d.ts.map +1 -0
  63. package/types/views/edit/RecordSet-Edit-RecordEdit.d.ts +34 -0
  64. package/types/views/edit/RecordSet-Edit-RecordEdit.d.ts.map +1 -0
  65. package/types/views/edit/RecordSet-Edit-RecordEditControls.d.ts +34 -0
  66. package/types/views/edit/RecordSet-Edit-RecordEditControls.d.ts.map +1 -0
  67. package/types/views/edit/RecordSet-Edit-RecordEditExtra.d.ts +34 -0
  68. package/types/views/edit/RecordSet-Edit-RecordEditExtra.d.ts.map +1 -0
  69. package/types/views/edit/RecordSet-Edit-TabBarEdit.d.ts +34 -0
  70. package/types/views/edit/RecordSet-Edit-TabBarEdit.d.ts.map +1 -0
  71. package/types/views/edit/RecordSet-Edit.d.ts +34 -0
  72. package/types/views/edit/RecordSet-Edit.d.ts.map +1 -0
  73. package/types/views/list/RecordSet-List-HeaderList.d.ts +34 -0
  74. package/types/views/list/RecordSet-List-HeaderList.d.ts.map +1 -0
  75. package/types/views/list/RecordSet-List-PaginationBottom.d.ts +34 -0
  76. package/types/views/list/RecordSet-List-PaginationBottom.d.ts.map +1 -0
  77. package/types/views/list/RecordSet-List-PaginationTop.d.ts +34 -0
  78. package/types/views/list/RecordSet-List-PaginationTop.d.ts.map +1 -0
  79. package/types/views/list/RecordSet-List-RecordList.d.ts +34 -0
  80. package/types/views/list/RecordSet-List-RecordList.d.ts.map +1 -0
  81. package/types/views/list/RecordSet-List-RecordListEntry.d.ts +34 -0
  82. package/types/views/list/RecordSet-List-RecordListEntry.d.ts.map +1 -0
  83. package/types/views/list/RecordSet-List-RecordListHeader.d.ts +34 -0
  84. package/types/views/list/RecordSet-List-RecordListHeader.d.ts.map +1 -0
  85. package/types/views/list/RecordSet-List-Title.d.ts +34 -0
  86. package/types/views/list/RecordSet-List-Title.d.ts.map +1 -0
  87. package/types/views/list/RecordSet-List.d.ts +43 -0
  88. package/types/views/list/RecordSet-List.d.ts.map +1 -0
  89. package/types/views/read/RecordSet-Read-HeaderRead.d.ts +34 -0
  90. package/types/views/read/RecordSet-Read-HeaderRead.d.ts.map +1 -0
  91. package/types/views/read/RecordSet-Read-RecordRead.d.ts +34 -0
  92. package/types/views/read/RecordSet-Read-RecordRead.d.ts.map +1 -0
  93. package/types/views/read/RecordSet-Read-RecordReadExtra.d.ts +34 -0
  94. package/types/views/read/RecordSet-Read-RecordReadExtra.d.ts.map +1 -0
  95. package/types/views/read/RecordSet-Read-TabBarRead.d.ts +34 -0
  96. package/types/views/read/RecordSet-Read-TabBarRead.d.ts.map +1 -0
  97. package/types/views/read/RecordSet-Read.d.ts +34 -0
  98. package/types/views/read/RecordSet-Read.d.ts.map +1 -0
@@ -0,0 +1,115 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION_List_PaginationTop = (
4
+ {
5
+ ViewIdentifier: 'PRSP-List-PaginationTop',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_PaginationTop',
8
+ DefaultDestinationAddress: '#PRSP_PaginationTop_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-List-PaginationTop-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-List-PaginationTop-Template] -->
33
+ <nav id="RSP_Upper_Pagination_Container">
34
+ {~T:PRSP-List-Pagination-Template-Description~}
35
+ {~T:PRSP-List-Pagination-Template-Buttons~}
36
+ </nav>
37
+ <!-- DefaultPackage end view template: [PRSP-List-PaginationTop-Template] -->
38
+ `
39
+ },
40
+ {
41
+ Hash: 'PRSP-List-Pagination-Template-Description',
42
+ Template: /*html*/`
43
+ <!-- DefaultPackage pict view template: [PRSP-List-Pagination-Template-Description] -->
44
+ <p id="PRSP_Pagination_Description">
45
+ <span id="PRSP_Pagination_Description_Records_Start">1</span> to
46
+ <span id="PRSP_Pagination_Description_Records_End">10</span> of
47
+ <span id="PRSP_Pagination_Description_Records_Total">100</span> records
48
+ </p>
49
+ <!-- DefaultPackage end view template: [PRSP-List-Pagination-Template-Description] -->
50
+ `
51
+ },
52
+ {
53
+ Hash: 'PRSP-List-Pagination-Template-Buttons',
54
+ Template: /*html*/`
55
+ <!-- DefaultPackage pict view template: [PRSP-List-Pagination-Template-Buttons] -->
56
+ <ul>
57
+ {~T:PRSP-List-Pagination-Template-Button-Previous~}
58
+ {~TS:PRSP-List-Pagination-Template-Button-Page~}
59
+ {~T:PRSP-List-Pagination-Template-Button-Next~}
60
+ </ul>
61
+ <!-- DefaultPackage end view template: [PRSP-List-Pagination-Template-Buttons] -->
62
+ `
63
+ },
64
+ {
65
+ Hash: 'PRSP-List-Pagination-Template-Button-Previous',
66
+ Template: /*html*/`
67
+ <!-- DefaultPackage pict view template: [PRSP-List-Pagination-Template-Button-Previous] -->
68
+ <li><a href="#">&laquo; Previous</a></li>
69
+ <!-- DefaultPackage end view template: [PRSP-List-Pagination-Template-Button-Previous] -->
70
+ `
71
+ },
72
+ {
73
+ Hash: 'PRSP-List-Pagination-Template-Button-Next',
74
+ Template: /*html*/`
75
+ <!-- DefaultPackage pict view template: [PRSP-List-Pagination-Template-Button-Next] -->
76
+ <li><a href="#">Next &raquo;</a></li>
77
+ <!-- DefaultPackage end view template: [PRSP-List-Pagination-Template-Button-Next] -->
78
+ `
79
+ },
80
+ {
81
+ Hash: 'PRSP-List-Pagination-Template-Button-Page',
82
+ Template: /*html*/`
83
+ <!-- DefaultPackage pict view template: [PRSP-List-Pagination-Template-Button-Page] -->
84
+ <li><a href="#">{~D:Record.Page~}</a></li>
85
+ <!-- DefaultPackage end view template: [PRSP-List-Pagination-Template-Button-Page] -->
86
+ `
87
+ }
88
+ ],
89
+
90
+ Renderables:
91
+ [
92
+ {
93
+ RenderableHash: 'PRSP_Renderable_PaginationTop',
94
+ TemplateHash: 'PRSP-List-PaginationTop-Template',
95
+ DestinationAddress: '#PRSP_PaginationTop_Container',
96
+ RenderMethod: 'replace'
97
+ }
98
+ ],
99
+
100
+ Manifests: {}
101
+ });
102
+
103
+ class viewRecordSetListPaginationTop extends libPictView
104
+ {
105
+ constructor(pFable, pOptions, pServiceHash)
106
+ {
107
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_List_PaginationTop, pOptions);
108
+ super(pFable, tmpOptions, pServiceHash);
109
+ }
110
+ }
111
+
112
+ module.exports = viewRecordSetListPaginationTop;
113
+
114
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION_List_PaginationTop;
115
+
@@ -0,0 +1,79 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION_List_RecordList = (
4
+ {
5
+ ViewIdentifier: 'PRSP-List-RecordList',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_RecordList',
8
+ DefaultDestinationAddress: '#PRSP_RecordList_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-List-RecordList-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-List-RecordList-Template] -->
33
+ <section id="PRSP_List_Container">
34
+ {~T:PRSP-List-RecordList-Template-Table~}
35
+ </section>
36
+ <!-- DefaultPackage end view template: [PRSP-List-RecordList-Template] -->
37
+ `
38
+ },
39
+ {
40
+ Hash: 'PRSP-List-RecordList-Template-Table',
41
+ Template: /*html*/`
42
+ <!-- DefaultPackage pict view template: [PRSP-List-RecordList-Template-Table] -->
43
+ <table id="PRSP_List_Table">
44
+ <thead>{~T:PRSP-List-RecordList-Template-Table-Header~}</thead>
45
+ <tbody id="PRSP_RecordList_Container_Entries">
46
+ {~TS:PRSP-List-RecordListEntry-Template:Record.Records.Records~}
47
+ </tbody>
48
+ </table>
49
+ <!-- DefaultPackage end view template: [PRSP-List-RecordList-Template-Table] -->
50
+ `
51
+ }
52
+ ],
53
+
54
+ Renderables:
55
+ [
56
+ {
57
+ RenderableHash: 'PRSP_Renderable_RecordList',
58
+ TemplateHash: 'PRSP-List-RecordList-Template',
59
+ DestinationAddress: '#PRSP_RecordList_Container',
60
+ RenderMethod: 'replace'
61
+ }
62
+ ],
63
+
64
+ Manifests: {}
65
+ });
66
+
67
+ class viewRecordSetListRecordList extends libPictView
68
+ {
69
+ constructor(pFable, pOptions, pServiceHash)
70
+ {
71
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_List_RecordList, pOptions);
72
+ super(pFable, tmpOptions, pServiceHash);
73
+ }
74
+ }
75
+
76
+ module.exports = viewRecordSetListRecordList;
77
+
78
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION_List_RecordList;
79
+
@@ -0,0 +1,92 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION_List_RecordListEntry = (
4
+ {
5
+ ViewIdentifier: 'PRSP-List-RecordListEntry',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_RecordListEntry',
8
+ DefaultDestinationAddress: '#PRSP_RecordListEntry_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-List-RecordListEntry-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-List-RecordListEntry-Template] -->
33
+ {~T:PRSP-List-RecordListEntry-Template-Entry~}
34
+ <!-- DefaultPackage end view template: [PRSP-List-RecordListEntry-Template] -->
35
+ `
36
+ },
37
+ {
38
+ Hash: 'PRSP-List-RecordListEntry-Template-Entry',
39
+ Template: /*html*/`
40
+ <!-- DefaultPackage pict view template: [PRSP-List-RecordListEntry-Template-Entry] -->
41
+ <tr>
42
+ {~T:PRSP-List-RecordListEntry-Template-Entry-Cell~}
43
+ {~T:PRSP-List-RecordListEntry-Template-Extra-Cell~}
44
+ </tr>
45
+ <!-- DefaultPackage end view template: [PRSP-List-RecordListEntry-Template-Entry] -->
46
+ `
47
+ },
48
+ {
49
+ Hash: 'PRSP-List-RecordListEntry-Template-Entry-Cell',
50
+ Template: /*html*/`
51
+ <!-- DefaultPackage pict view template: [PRSP-List-RecordListEntry-Template-Entry-Cell] -->
52
+ <td>
53
+ {~DJ:Record~}
54
+ </td>
55
+ <!-- DefaultPackage end view template: [PRSP-List-RecordListEntry-Template-Entry-Cell] -->
56
+ `
57
+ },
58
+ {
59
+ Hash: 'PRSP-List-RecordListEntry-Template-Extra-Cell',
60
+ Template: /*html*/`
61
+ <!-- DefaultPackage pict view template: [PRSP-List-RecordListEntry-Template-Extra-Cell] -->
62
+ <!-- DefaultPackage end view template: [PRSP-List-RecordListEntry-Template-Extra-Cell] -->
63
+ `
64
+ }
65
+ ],
66
+
67
+ Renderables:
68
+ [
69
+ {
70
+ RenderableHash: 'PRSP_Renderable_RecordListEntry',
71
+ TemplateHash: 'PRSP-List-RecordListEntry-Template',
72
+ DestinationAddress: '#PRSP_RecordListEntry_Container',
73
+ RenderMethod: 'replace'
74
+ }
75
+ ],
76
+
77
+ Manifests: {}
78
+ });
79
+
80
+ class viewRecordSetListRecordListEntry extends libPictView
81
+ {
82
+ constructor(pFable, pOptions, pServiceHash)
83
+ {
84
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_List_RecordListEntry, pOptions);
85
+ super(pFable, tmpOptions, pServiceHash);
86
+ }
87
+ }
88
+
89
+ module.exports = viewRecordSetListRecordListEntry;
90
+
91
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION_List_RecordListEntry;
92
+
@@ -0,0 +1,87 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION_List_RecordListHeader = (
4
+ {
5
+ ViewIdentifier: 'PRSP-List-RecordListHeader',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_RecordListHeader',
8
+ DefaultDestinationAddress: '#PRSP_RecordListHeader_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-List-RecordListHeader-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-List-RecordListHeader-Template] -->
33
+ <tr>
34
+ {~T:PRSP-List-RecordListHeader-Template-Header~}
35
+ {~T:PRSP-List-RecordListHeader-Template-Extra-Header~}
36
+ </tr>
37
+ <!-- DefaultPackage end view template: [PRSP-List-RecordListHeader-Template] -->
38
+ `
39
+ },
40
+ {
41
+ Hash: 'PRSP-List-RecordListHeader-Template-Header',
42
+ Template: /*html*/`
43
+ <!-- DefaultPackage pict view template: [PRSP-List-RecordListHeader-Template-Header] -->
44
+ <th>
45
+ {~D:Record~}
46
+ </th>
47
+ <!-- DefaultPackage end view template: [PRSP-List-RecordListHeader-Template-Header] -->
48
+ `
49
+ },
50
+ {
51
+ Hash: 'PRSP-List-RecordListHeader-Template-Extra-Header',
52
+ Template: /*html*/`
53
+ <!-- DefaultPackage pict view template: [PRSP-List-RecordListHeader-Template-Extra-Header] -->
54
+ <th>
55
+ {~D:Record~}
56
+ </th>
57
+ <!-- DefaultPackage end view template: [PRSP-List-RecordListHeader-Template-Extra-Header] -->
58
+ `
59
+ }
60
+ ],
61
+
62
+ Renderables:
63
+ [
64
+ {
65
+ RenderableHash: 'PRSP_Renderable_RecordListHeader',
66
+ TemplateHash: 'PRSP-List-RecordListHeader-Template',
67
+ DestinationAddress: '#PRSP_RecordListHeader_Container',
68
+ RenderMethod: 'replace'
69
+ }
70
+ ],
71
+
72
+ Manifests: {}
73
+ });
74
+
75
+ class viewRecordSetListRecordListHeader extends libPictView
76
+ {
77
+ constructor(pFable, pOptions, pServiceHash)
78
+ {
79
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_List_RecordListHeader, pOptions);
80
+ super(pFable, tmpOptions, pServiceHash);
81
+ }
82
+ }
83
+
84
+ module.exports = viewRecordSetListRecordListHeader;
85
+
86
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION_List_RecordListHeader;
87
+
@@ -0,0 +1,67 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION_List_Title = (
4
+ {
5
+ ViewIdentifier: 'PRSP-List-Title',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_Title',
8
+ DefaultDestinationAddress: '#PRSP_Title_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-List-Title-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-List-Title-Template] -->
33
+ <header id="PRSP_Title_Container">
34
+ <h1 id="PRSP_Title">{~D:Record.Title~}</h1>
35
+ <h2 id="PRSP_Subtitle">{~D:Record.Subtitle~}</h2>
36
+ </header>
37
+ <!-- DefaultPackage end view template: [PRSP-List-Title-Template] -->
38
+ `
39
+ }
40
+ ],
41
+
42
+ Renderables:
43
+ [
44
+ {
45
+ RenderableHash: 'PRSP_Renderable_Title',
46
+ TemplateHash: 'PRSP-List-Title-Template',
47
+ DestinationAddress: '#PRSP_Title_Container',
48
+ RenderMethod: 'replace'
49
+ }
50
+ ],
51
+
52
+ Manifests: {}
53
+ });
54
+
55
+ class viewRecordSetListTitle extends libPictView
56
+ {
57
+ constructor(pFable, pOptions, pServiceHash)
58
+ {
59
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_List_Title, pOptions);
60
+ super(pFable, tmpOptions, pServiceHash);
61
+ }
62
+ }
63
+
64
+ module.exports = viewRecordSetListTitle;
65
+
66
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION_List_Title;
67
+
@@ -0,0 +1,167 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const viewHeaderList = require('./RecordSet-List-HeaderList.js');
4
+ const viewTitle = require('./RecordSet-List-Title.js');
5
+ const viewPaginationTop = require('./RecordSet-List-PaginationTop.js');
6
+ const viewRecordList = require('./RecordSet-List-RecordList.js');
7
+ const viewRecordListHeader = require('./RecordSet-List-RecordListHeader.js');
8
+ const viewRecordListEntry = require('./RecordSet-List-RecordListEntry.js');
9
+ const viewPaginationBottom = require('./RecordSet-List-PaginationBottom.js');
10
+
11
+ const _DEFAULT_CONFIGURATION__List = (
12
+ {
13
+ ViewIdentifier: 'PRSP-List',
14
+
15
+ DefaultRenderable: 'PRSP_Renderable_List',
16
+ DefaultDestinationAddress: '#PRSP_List_Container',
17
+ DefaultTemplateRecordAddress: false,
18
+
19
+ // If this is set to true, when the App initializes this will.
20
+ // While the App initializes, initialize will be called.
21
+ AutoInitialize: false,
22
+ AutoInitializeOrdinal: 0,
23
+
24
+ // If this is set to true, when the App autorenders (on load) this will.
25
+ // After the App initializes, render will be called.
26
+ AutoRender: false,
27
+ AutoRenderOrdinal: 0,
28
+
29
+ AutoSolveWithApp: false,
30
+ AutoSolveOrdinal: 0,
31
+
32
+ CSS: false,
33
+ CSSPriority: 500,
34
+
35
+ Templates:
36
+ [
37
+ {
38
+ Hash: 'PRSP-List-Template',
39
+ Template: /*html*/`
40
+ <!-- DefaultPackage pict view template: [PRSP-List-Template] -->
41
+ <section id="PRSP_List_Container">
42
+ {~V:PRSP-List-Title~}
43
+ {~V:PRSP-List-HeaderList~}
44
+ {~V:PRSP-List-PaginationTop~}
45
+ {~V:PRSP-List-RecordList~}
46
+ {~V:PRSP-List-PaginationBottom~}
47
+ </section>
48
+ <!-- DefaultPackage end view template: [PRSP-List-Template] -->
49
+ `
50
+ },
51
+ {
52
+ Hash: 'PRSP-List-Template-Record',
53
+ Template: /*html*/`
54
+ <!-- DefaultPackage end view template: [PRSP-List-Template] -->
55
+ `
56
+ }
57
+ ],
58
+
59
+ Renderables:
60
+ [
61
+ {
62
+ RenderableHash: 'PRSP_Renderable_List',
63
+ TemplateHash: 'PRSP-List-Template',
64
+ DestinationAddress: '#PRSP_List_Container',
65
+ RenderMethod: 'replace'
66
+ }
67
+ ],
68
+
69
+ Manifests: {}
70
+ });
71
+
72
+ class viewRecordSetList extends libPictView
73
+ {
74
+ constructor(pFable, pOptions, pServiceHash)
75
+ {
76
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION__List, pOptions);
77
+ super(pFable, tmpOptions, pServiceHash);
78
+
79
+ this.childViews = {
80
+ headerList: null,
81
+ title: null,
82
+ paginationTop: null,
83
+ recordList: null,
84
+ recordListHeader: null,
85
+ recordListEntry: null,
86
+ paginationBottom: null
87
+ };
88
+ }
89
+
90
+ async renderList(pRecordSetConfiguration, pProviderHash, pFilterString, pOffset, pPageSize)
91
+ {
92
+ // Get the records
93
+ if (!(pProviderHash in this.pict.providers))
94
+ {
95
+ this.pict.log.error(`RecordSetList: No provider found for ${pProviderHash} in ${pRecordSetConfiguration.RecordSet}. List Render failed.`);
96
+ return false;
97
+ }
98
+
99
+ let tmpResponse =
100
+ {
101
+ "Title": pRecordSetConfiguration.RecordSet,
102
+
103
+ "RecordSet": pRecordSetConfiguration.RecordSet,
104
+ "RecordSetConfiguration": pRecordSetConfiguration,
105
+
106
+ "RenderDestination": this.options.DefaultDestinationAddress,
107
+
108
+ "FilterString": pFilterString || '',
109
+
110
+ "Records": [],
111
+ "TotalRecordCount": -1,
112
+
113
+ "Offset": pOffset || 0,
114
+ "PageSize": pPageSize || 100
115
+ };
116
+
117
+ tmpResponse.Records = await this.pict.providers[pProviderHash].getRecords({Offset:tmpResponse.Offset, PageSize:tmpResponse.PageSize});
118
+ tmpResponse.TotalRecordCount = await this.pict.providers[pProviderHash].getRecordSetCount({Offset:tmpResponse.Offset, PageSize:tmpResponse.PageSize});
119
+
120
+ this.renderAsync('PRSP_Renderable_List', tmpResponse.RenderDestination, tmpResponse,
121
+ function (pError)
122
+ {
123
+ if (pError)
124
+ {
125
+ this.pict.log.error(`RecordSetList: Error rendering list ${pError}`, tmpResponse);
126
+ return false;
127
+ }
128
+
129
+ if (this.pict.LogNoisiness > 0)
130
+ {
131
+ this.pict.log.info(`RecordSetList: Rendered list ${tmpResponse.RecordSet} with ${tmpResponse.Records.length} records.`, tmpResponse);
132
+ }
133
+ else
134
+ {
135
+ this.pict.log.info(`RecordSetList: Rendered list ${tmpResponse.RecordSet} with ${tmpResponse.Records.length} records.`);
136
+ }
137
+ return true;
138
+ }.bind(this));
139
+ }
140
+
141
+ onInitialize()
142
+ {
143
+ this.childViews.headerList = this.pict.addView('PRSP-List-HeaderList', viewHeaderList.default_configuration, viewHeaderList);
144
+ this.childViews.title = this.pict.addView('PRSP-List-Title', viewTitle.default_configuration, viewTitle);
145
+ this.childViews.paginationTop = this.pict.addView('PRSP-List-PaginationTop', viewPaginationTop.default_configuration, viewPaginationTop);
146
+ this.childViews.recordList = this.pict.addView('PRSP-List-RecordList', viewRecordList.default_configuration, viewRecordList);
147
+ this.childViews.recordListHeader = this.pict.addView('PRSP-List-RecordListHeader', viewRecordListHeader.default_configuration, viewRecordListHeader);
148
+ this.childViews.recordListEntry = this.pict.addView('PRSP-List-RecordListEntry', viewRecordListEntry.default_configuration, viewRecordListEntry);
149
+ this.childViews.paginationBottom = this.pict.addView('PRSP-List-PaginationBottom', viewPaginationBottom.default_configuration, viewPaginationBottom);
150
+
151
+ // Initialize the subviews
152
+ this.childViews.headerList.initialize();
153
+ this.childViews.title.initialize();
154
+ this.childViews.paginationTop.initialize();
155
+ this.childViews.recordList.initialize();
156
+ this.childViews.recordListHeader.initialize();
157
+ this.childViews.recordListEntry.initialize();
158
+ this.childViews.paginationBottom.initialize();
159
+
160
+ return super.onInitialize();
161
+ }
162
+ }
163
+
164
+ module.exports = viewRecordSetList;
165
+
166
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION__List;
167
+
@@ -0,0 +1,63 @@
1
+ const libPictView = require('pict-view');
2
+
3
+ const _DEFAULT_CONFIGURATION_Read_HeaderRead = (
4
+ {
5
+ ViewIdentifier: 'PRSP-Read-HeaderRead',
6
+
7
+ DefaultRenderable: 'PRSP_Renderable_HeaderRead',
8
+ DefaultDestinationAddress: '#PRSP_HeaderRead_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-Read-HeaderRead-Template',
31
+ Template: /*html*/`
32
+ <!-- DefaultPackage pict view template: [PRSP-Read-HeaderRead-Template] -->
33
+ <!-- DefaultPackage end view template: [PRSP-Read-HeaderRead-Template] -->
34
+ `
35
+ }
36
+ ],
37
+
38
+ Renderables:
39
+ [
40
+ {
41
+ RenderableHash: 'PRSP_Renderable_HeaderRead',
42
+ TemplateHash: 'PRSP-Read-HeaderRead-Template',
43
+ DestinationAddress: '#PRSP_HeaderRead_Container',
44
+ RenderMethod: 'replace'
45
+ }
46
+ ],
47
+
48
+ Manifests: {}
49
+ });
50
+
51
+ class viewRecordSetReadHeaderRead extends libPictView
52
+ {
53
+ constructor(pFable, pOptions, pServiceHash)
54
+ {
55
+ let tmpOptions = Object.assign({}, _DEFAULT_CONFIGURATION_Read_HeaderRead, pOptions);
56
+ super(pFable, tmpOptions, pServiceHash);
57
+ }
58
+ }
59
+
60
+ module.exports = viewRecordSetReadHeaderRead;
61
+
62
+ module.exports.default_configuration = _DEFAULT_CONFIGURATION_Read_HeaderRead;
63
+