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.
- package/package.json +5 -1
- package/source/views/RecordSet-Filters.js +196 -72
- 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 +54 -2
- 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,207 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<title>Simple Entity - Pict Example</title>
|
|
7
|
-
<!-- PICT Dynamic View CSS Container -->
|
|
8
|
-
<style id="PICT-CSS"></style>
|
|
9
|
-
<!-- Red Rock Mesa Theme — Pict Example App -->
|
|
10
|
-
<style>
|
|
11
|
-
*, *::before, *::after { box-sizing: border-box; }
|
|
12
|
-
body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: #FAEDCD; color: #264653; }
|
|
13
|
-
|
|
14
|
-
/* --- Header Bar --- */
|
|
15
|
-
.pict-example-header { display: flex; align-items: stretch; background: #264653; border-bottom: 3px solid #E76F51; }
|
|
16
|
-
.pict-example-badge { background: #E76F51; color: var(--theme-color-background-panel, #fff); padding: 0.6rem 1rem; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; display: flex; align-items: center; gap: 0.5rem; }
|
|
17
|
-
.pict-example-badge svg { width: 14px; height: 14px; fill: var(--theme-color-background-panel, #fff); flex-shrink: 0; }
|
|
18
|
-
.pict-example-app-name { padding: 0.6rem 1rem; color: #FAEDCD; font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; }
|
|
19
|
-
.pict-example-module { margin-left: auto; padding: 0.6rem 1rem; color: #D4A373; font-size: 0.75rem; display: flex; align-items: center; letter-spacing: 0.03em; }
|
|
20
|
-
|
|
21
|
-
/* --- Navigation Bar --- */
|
|
22
|
-
.pict-example-nav { background: #2A3F4D; padding: 0 1rem; }
|
|
23
|
-
.pict-example-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; }
|
|
24
|
-
.pict-example-nav li a { display: block; padding: 0.6rem 1rem; color: #FAEDCD; text-decoration: none; font-size: 0.85rem; font-weight: 500; border-bottom: 2px solid transparent; transition: border-color 0.15s, color 0.15s; }
|
|
25
|
-
.pict-example-nav li a:hover { color: #E76F51; border-bottom-color: #E76F51; }
|
|
26
|
-
|
|
27
|
-
/* --- Content Area --- */
|
|
28
|
-
.pict-example-content { padding: 1.5rem; }
|
|
29
|
-
#PRSP_Container { background: var(--theme-color-background-panel, #fff); border: 1px solid #D4A373; border-top: 4px solid #E76F51; border-radius: 6px; padding: 1.25rem; box-shadow: 0 2px 8px rgba(38,70,83,0.08); }
|
|
30
|
-
|
|
31
|
-
/* --- Form Element Styling --- */
|
|
32
|
-
#PRSP_Container input[type="text"],
|
|
33
|
-
#PRSP_Container input[type="number"],
|
|
34
|
-
#PRSP_Container input[type="email"],
|
|
35
|
-
#PRSP_Container input[type="date"],
|
|
36
|
-
#PRSP_Container textarea,
|
|
37
|
-
#PRSP_Container select { border: 1px solid #D4C4A8; background: #FFFCF7; padding: 0.45rem 0.6rem; border-radius: 4px; font-size: 0.9rem; color: #264653; width: 100%; }
|
|
38
|
-
#PRSP_Container input:focus,
|
|
39
|
-
#PRSP_Container textarea:focus,
|
|
40
|
-
#PRSP_Container select:focus { outline: none; border-color: #E76F51; box-shadow: 0 0 0 2px rgba(231,111,81,0.15); }
|
|
41
|
-
#PRSP_Container label { color: #264653; font-weight: 600; font-size: 0.85rem; }
|
|
42
|
-
#PRSP_Container h1, #PRSP_Container h2, #PRSP_Container h3, #PRSP_Container h4 { color: #264653; }
|
|
43
|
-
#PRSP_Container button,
|
|
44
|
-
#PRSP_Container input[type="button"],
|
|
45
|
-
#PRSP_Container input[type="submit"] { background: #E76F51; color: var(--theme-color-background-panel, #fff); border: none; padding: 0.5rem 1.25rem; border-radius: 4px; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
|
|
46
|
-
#PRSP_Container button:hover,
|
|
47
|
-
#PRSP_Container input[type="button"]:hover,
|
|
48
|
-
#PRSP_Container input[type="submit"]:hover { background: #C45A3E; }
|
|
49
|
-
#PRSP_Container table { width: 100%; border-collapse: collapse; }
|
|
50
|
-
#PRSP_Container th { background: #264653; color: #FAEDCD; padding: 0.5rem 0.75rem; text-align: left; font-size: 0.8rem; }
|
|
51
|
-
#PRSP_Container td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #E8D9C0; font-size: 0.85rem; }
|
|
52
|
-
#PRSP_Container tr:nth-child(even) td { background: #FFF9F0; }
|
|
53
|
-
|
|
54
|
-
/* --- Title Section --- */
|
|
55
|
-
#PRSP_Title_Container { margin-bottom: 1rem; }
|
|
56
|
-
#PRSP_Title_Container h1 { margin: 0 0 0.15rem; font-size: 1.4rem; }
|
|
57
|
-
#PRSP_Title_Container h2 { margin: 0; font-size: 0.95rem; font-weight: 400; color: #D4A373; }
|
|
58
|
-
|
|
59
|
-
/* --- Filter Section --- */
|
|
60
|
-
#PRSP_Filters_Container { background: #FFF9F0; border: 1px solid #D4A373; border-radius: 6px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
|
|
61
|
-
#PRSP_Filter_Form { display: flex; flex-direction: column; gap: 0.75rem; }
|
|
62
|
-
#PRSP_Filter_Form > fieldset { border: none; padding: 0; margin: 0; }
|
|
63
|
-
|
|
64
|
-
/* Search filter row */
|
|
65
|
-
#PRSP_Filter_Form > fieldset:first-child { display: flex; align-items: center; gap: 0.75rem; }
|
|
66
|
-
#PRSP_Filter_Form > fieldset:first-child label { flex-shrink: 0; font-weight: 600; font-size: 0.85rem; color: #264653; }
|
|
67
|
-
#PRSP_Filter_Form > fieldset:first-child input[type="text"] { flex: 1; }
|
|
68
|
-
|
|
69
|
-
/* Filter instances container */
|
|
70
|
-
#PRSP_Filter_Instances { display: flex; flex-direction: column; gap: 0.5rem; }
|
|
71
|
-
#PRSP_Filter_Instances > div { display: flex; align-items: center; gap: 0.5rem; background: var(--theme-color-background-panel, #fff); border: 1px solid #E8D9C0; border-radius: 4px; padding: 0.5rem 0.75rem; flex-wrap: wrap; }
|
|
72
|
-
|
|
73
|
-
/* Remove (-) buttons in filter rows */
|
|
74
|
-
#PRSP_Filter_Instances > div > button[type="button"] { background: #B33030; color: var(--theme-color-background-panel, #fff); border: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-size: 0.85rem; font-weight: 700; cursor: pointer; flex-shrink: 0; padding: 0; display: flex; align-items: center; justify-content: center; line-height: 1; }
|
|
75
|
-
#PRSP_Filter_Instances > div > button[type="button"]:hover { background: #8B2020; }
|
|
76
|
-
|
|
77
|
-
/* Filter labels (spans) */
|
|
78
|
-
#PRSP_Filter_Instances span { font-size: 0.85rem; font-weight: 600; color: #264653; white-space: nowrap; }
|
|
79
|
-
|
|
80
|
-
/* Date inputs in filters */
|
|
81
|
-
#PRSP_Filter_Instances input[type="datetime-local"] { border: 1px solid #D4C4A8; background: #FFFCF7; padding: 0.35rem 0.5rem; border-radius: 4px; font-size: 0.85rem; color: #264653; }
|
|
82
|
-
#PRSP_Filter_Instances input[type="datetime-local"]:focus { outline: none; border-color: #E76F51; box-shadow: 0 0 0 2px rgba(231,111,81,0.15); }
|
|
83
|
-
|
|
84
|
-
/* Text inputs in filters */
|
|
85
|
-
#PRSP_Filter_Instances input[type="text"] { border: 1px solid #D4C4A8; background: #FFFCF7; padding: 0.35rem 0.5rem; border-radius: 4px; font-size: 0.85rem; color: #264653; flex: 1; min-width: 120px; }
|
|
86
|
-
|
|
87
|
-
/* Tables inside filter instances (join selectors) */
|
|
88
|
-
#PRSP_Filter_Instances table { width: auto; border-collapse: collapse; flex: 1; }
|
|
89
|
-
#PRSP_Filter_Instances table td { border: none; padding: 0.25rem 0.35rem; background: transparent !important; vertical-align: top; }
|
|
90
|
-
#PRSP_Filter_Instances table tr:nth-child(even) td { background: transparent !important; }
|
|
91
|
-
#PRSP_Filter_Instances table th { background: #264653; color: #FAEDCD; padding: 0.25rem 0.5rem; font-size: 0.75rem; }
|
|
92
|
-
#PRSP_Filter_Instances table select { border: 1px solid #D4C4A8; background: #FFFCF7; padding: 0.35rem 0.5rem; border-radius: 4px; font-size: 0.85rem; color: #264653; min-width: 100px; max-height: 150px; }
|
|
93
|
-
#PRSP_Filter_Instances table input[type="text"] { min-width: 150px; }
|
|
94
|
-
#PRSP_Filter_Instances table label { font-size: 0.8rem; font-weight: 600; color: #264653; white-space: nowrap; }
|
|
95
|
-
#PRSP_Filter_Instances table button[type="submit"],
|
|
96
|
-
#PRSP_Filter_Instances table button[type="button"] { background: #264653; color: #FAEDCD; border: none; padding: 0.35rem 0.75rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
|
|
97
|
-
#PRSP_Filter_Instances table button[type="submit"]:hover,
|
|
98
|
-
#PRSP_Filter_Instances table button[type="button"]:hover { background: #1A3340; }
|
|
99
|
-
|
|
100
|
-
/* Constrain large multi-select boxes in join filters */
|
|
101
|
-
#PRSP_Filter_Instances > div > table > tbody > tr > td > select[size] { max-height: 120px; overflow-y: auto; }
|
|
102
|
-
/* Direct selects in filter containers */
|
|
103
|
-
#PRSP_Filter_Instances select[size] { max-height: 120px; overflow-y: auto; }
|
|
104
|
-
|
|
105
|
-
/* Hidden inputs in filters shouldn't take space */
|
|
106
|
-
#PRSP_Filter_Instances input[type="hidden"] { display: none; }
|
|
107
|
-
|
|
108
|
-
/* Action button fieldsets (Clear/Reset/Apply, +, Manage) */
|
|
109
|
-
#PRSP_Filter_Form > fieldset:nth-child(n+3) { display: flex; align-items: center; gap: 0.5rem; padding-top: 0.35rem; }
|
|
110
|
-
/* First action row gets a separator line */
|
|
111
|
-
#PRSP_Filter_Form > fieldset:nth-child(3) { border-top: 1px solid #E8D9C0; margin-top: 0.25rem; padding-top: 0.6rem; }
|
|
112
|
-
#PRSP_Filter_Button_Clear { background: #264653 !important; color: #FAEDCD !important; }
|
|
113
|
-
#PRSP_Filter_Button_Clear:hover { background: #1A3340 !important; }
|
|
114
|
-
#PRSP_Filter_Button_Reset { background: #D4A373 !important; color: var(--theme-color-background-panel, #fff) !important; }
|
|
115
|
-
#PRSP_Filter_Button_Reset:hover { background: #B88A5C !important; }
|
|
116
|
-
#PRSP_Filter_Button_Apply { background: #E76F51 !important; color: var(--theme-color-background-panel, #fff) !important; }
|
|
117
|
-
#PRSP_Filter_Button_Apply:hover { background: #C45A3E !important; }
|
|
118
|
-
#PRSP_Filter_Button_Add { background: #264653 !important; color: #FAEDCD !important; width: 2rem; height: 2rem; border-radius: 50% !important; font-size: 1rem; font-weight: 700; display: flex !important; align-items: center; justify-content: center; padding: 0 !important; }
|
|
119
|
-
#PRSP_Filter_Button_Add:hover { background: #1A3340 !important; }
|
|
120
|
-
#PRSP_Filter_Button_Manage { background: #264653 !important; color: #FAEDCD !important; }
|
|
121
|
-
#PRSP_Filter_Button_Manage:hover { background: #1A3340 !important; }
|
|
122
|
-
|
|
123
|
-
/* Dropdowns / popovers inside filters */
|
|
124
|
-
#PRSP-SUBSET-Filters-Template-Add-Filter-Container { background: var(--theme-color-background-panel, #fff); border: 1px solid #D4A373; border-radius: 4px; padding: 0.5rem; margin-top: 0.25rem; box-shadow: 0 2px 8px rgba(38,70,83,0.12); }
|
|
125
|
-
#FilterPersistenceView-Container { background: var(--theme-color-background-panel, #fff); border: 1px solid #D4A373; border-radius: 4px; padding: 0.5rem; margin-top: 0.25rem; box-shadow: 0 2px 8px rgba(38,70,83,0.12); }
|
|
126
|
-
|
|
127
|
-
/* --- Pagination --- */
|
|
128
|
-
#RSP_Upper_Pagination_Container,
|
|
129
|
-
#RSP_Lower_Pagination_Container { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; margin-bottom: 0.25rem; font-size: 0.85rem; color: #264653; }
|
|
130
|
-
#RSP_Upper_Pagination_Container div,
|
|
131
|
-
#RSP_Lower_Pagination_Container div { display: flex; align-items: center; gap: 0.35rem; }
|
|
132
|
-
#RSP_Upper_Pagination_Container div span,
|
|
133
|
-
#RSP_Lower_Pagination_Container div span { font-size: 0.85rem; }
|
|
134
|
-
#RSP_Upper_Pagination_Container ul,
|
|
135
|
-
#RSP_Lower_Pagination_Container ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; }
|
|
136
|
-
#RSP_Upper_Pagination_Container ul li a,
|
|
137
|
-
#RSP_Lower_Pagination_Container ul li a { display: block; padding: 0.35rem 0.75rem; border: 1px solid #D4A373; border-radius: 4px; text-decoration: none; color: #264653; font-size: 0.8rem; font-weight: 500; transition: background 0.15s, color 0.15s; }
|
|
138
|
-
#RSP_Upper_Pagination_Container ul li a:hover,
|
|
139
|
-
#RSP_Lower_Pagination_Container ul li a:hover { background: #E76F51; color: var(--theme-color-background-panel, #fff); border-color: #E76F51; }
|
|
140
|
-
|
|
141
|
-
/* --- Page Number Links --- */
|
|
142
|
-
#PRSP_List_Container > div { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.5rem; }
|
|
143
|
-
a[class^="page-offset"] { display: inline-block; padding: 0.3rem 0.6rem; border: 1px solid #D4A373; border-radius: 4px; text-decoration: none; color: #264653; font-size: 0.8rem; font-weight: 500; transition: background 0.15s, color 0.15s; background: var(--theme-color-background-panel, #fff); }
|
|
144
|
-
a[class^="page-offset"]:hover { background: #E76F51; color: var(--theme-color-background-panel, #fff); border-color: #E76F51; }
|
|
145
|
-
|
|
146
|
-
/* --- List Table Refinements --- */
|
|
147
|
-
#PRSP_List_Table { width: 100%; border-collapse: collapse; }
|
|
148
|
-
#PRSP_List_Table th { background: #264653 !important; color: #FAEDCD !important; padding: 0.6rem 0.75rem !important; border-bottom: none !important; text-align: left; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
|
|
149
|
-
#PRSP_List_Table td { padding: 0.6rem 0.75rem !important; border-bottom: 1px solid #E8D9C0 !important; font-size: 0.85rem; background: var(--theme-color-background-panel, #fff); vertical-align: middle; }
|
|
150
|
-
#PRSP_List_Table tr:nth-child(even) td { background: #FFF9F0; }
|
|
151
|
-
#PRSP_List_Table tr:hover td { background: #FFF0E0; }
|
|
152
|
-
#PRSP_List_Table img { max-width: 80px; max-height: 100px; border-radius: 3px; border: 1px solid #E8D9C0; }
|
|
153
|
-
#PRSP_List_Table a { color: #E76F51; font-weight: 600; text-decoration: none; }
|
|
154
|
-
#PRSP_List_Table a:hover { color: #C45A3E; text-decoration: underline; }
|
|
155
|
-
|
|
156
|
-
/* List container wrapper (contains title, filters, pagination, AND table) */
|
|
157
|
-
#PRSP_List_Container { margin-bottom: 0.5rem; }
|
|
158
|
-
|
|
159
|
-
/* The actual list table wrapper */
|
|
160
|
-
#PRSP_List_Container > section { border: 1px solid #D4A373; border-top: 4px solid #E76F51; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(38,70,83,0.08); margin-bottom: 0.5rem; }
|
|
161
|
-
|
|
162
|
-
/* --- Record View Tabs --- */
|
|
163
|
-
#PRSP-Read-Tabs-Container { margin-top: 0.5rem; }
|
|
164
|
-
#PRSP-Read-Tab-Nav { display: flex; gap: 0; border-bottom: 2px solid #D4A373; margin-bottom: 0; }
|
|
165
|
-
.psrs-tab { padding: 0.55rem 1.25rem; font-size: 0.9rem; font-weight: 500; color: #264653; cursor: pointer; border: 1px solid transparent; border-bottom: none; border-radius: 4px 4px 0 0; margin-bottom: -2px; transition: background 0.15s, color 0.15s; }
|
|
166
|
-
.psrs-tab:hover { background: #FFF9F0; }
|
|
167
|
-
.psrs-tab.is-active { background: #264653; color: #FAEDCD; border-color: #264653; }
|
|
168
|
-
.psrs-tab-body { display: none; padding: 1rem 0 0; }
|
|
169
|
-
.psrs-tab-body.is-active { display: block; }
|
|
170
|
-
|
|
171
|
-
/* --- Record View Content --- */
|
|
172
|
-
#PRSP_Container h2 { font-size: 1.1rem; margin: 0.75rem 0 0.5rem; color: #264653; }
|
|
173
|
-
#PRSP_Container h3 { font-size: 0.95rem; margin: 0.5rem 0 0.35rem; color: #D4A373; }
|
|
174
|
-
|
|
175
|
-
/* --- Utility --- */
|
|
176
|
-
.is-hidden { display: none; }
|
|
177
|
-
</style>
|
|
178
|
-
<script src="./pict.js" type="text/javascript"></script>
|
|
179
|
-
<script type="text/javascript">Pict.safeOnDocumentReady(() => { Pict.safeLoadPictApplication(SimpleApplication, 1)});</script>
|
|
180
|
-
</head>
|
|
181
|
-
<body>
|
|
182
|
-
<div class="pict-example-header">
|
|
183
|
-
<div class="pict-example-badge">
|
|
184
|
-
<svg viewBox="0 0 16 16"><polygon points="8,1 10,6 16,6 11,9.5 13,15 8,11.5 3,15 5,9.5 0,6 6,6"/></svg>
|
|
185
|
-
Pict Example
|
|
186
|
-
</div>
|
|
187
|
-
<div class="pict-example-app-name">Simple Entity</div>
|
|
188
|
-
<div class="pict-example-module">pict-section-recordset</div>
|
|
189
|
-
</div>
|
|
190
|
-
<nav class="pict-example-nav">
|
|
191
|
-
<ul>
|
|
192
|
-
<li><a href="#/PSRS/Book/List">Book List</a></li>
|
|
193
|
-
<li><a href="#/PSRS/Author/List">Author List</a></li>
|
|
194
|
-
<li><a href="#/PSRS/Book/Create">Book Create</a></li>
|
|
195
|
-
<li><a href="#/PSRS/Author/Create">Author Create</a></li>
|
|
196
|
-
<li><a href="#/PSRS/BookstoreInventory/Dashboard">Bestsellers</a></li>
|
|
197
|
-
<li><a href="#/PSRS/BookstoreInventory/SpecificDashboard/Underdogs">Underdogs</a></li>
|
|
198
|
-
<li><a href="#/PSRS/BookstoreInventory/SpecificDashboard/NewReleases">New Releases</a></li>
|
|
199
|
-
<li><a href="#/PSRS/BookstoreInventory/SpecificDashboard/BookFormDashboardExample">Form Dashboard Example</a></li>
|
|
200
|
-
</ul>
|
|
201
|
-
</nav>
|
|
202
|
-
<div class="pict-example-content">
|
|
203
|
-
<div id="PRSP_Container"></div>
|
|
204
|
-
</div>
|
|
205
|
-
<script src="./simple_application.js" type="text/javascript"></script>
|
|
206
|
-
</body>
|
|
207
|
-
</html>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "simple_application",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "The most basic forms application ever!",
|
|
5
|
-
"main": "Simple-RecordSet-Application.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"start": "node Simple-RecordSet-Application.js",
|
|
8
|
-
"build": "npx quack build && npx quack copy"
|
|
9
|
-
},
|
|
10
|
-
"author": "steven",
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
},
|
|
14
|
-
"copyFilesSettings": {
|
|
15
|
-
"whenFileExists": "overwrite"
|
|
16
|
-
},
|
|
17
|
-
"copyFiles": [
|
|
18
|
-
{
|
|
19
|
-
"from": "./html/*",
|
|
20
|
-
"to": "./dist/"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"from": "../../node_modules/pict/dist/*",
|
|
24
|
-
"to": "./dist/"
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Unit tests for PictSectionRecordSet Basic
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const libBrowserEnv = require('browser-env');
|
|
7
|
-
|
|
8
|
-
const libPictView = require('pict-view');
|
|
9
|
-
|
|
10
|
-
const sinon = require('sinon');
|
|
11
|
-
const Chai = require('chai');
|
|
12
|
-
const Expect = Chai.expect;
|
|
13
|
-
|
|
14
|
-
const libPict = require('pict');
|
|
15
|
-
|
|
16
|
-
const libPictSectionRecordSet = require('../source/Pict-Section-RecordSet.js');
|
|
17
|
-
|
|
18
|
-
class DoNothingApplication extends libPictSectionRecordSet.PictRecordSetApplication
|
|
19
|
-
{
|
|
20
|
-
constructor(pFable, pOptions, pServiceHash)
|
|
21
|
-
{
|
|
22
|
-
super(pFable, pOptions, pServiceHash);
|
|
23
|
-
|
|
24
|
-
this.pict.addView('DoNothingView', {}, DoNothingView);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @param {function} fDone - Callback that finishes the test
|
|
29
|
-
*/
|
|
30
|
-
set testDone(fDone)
|
|
31
|
-
{
|
|
32
|
-
this._testDone = fDone;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
onAfterInitialize()
|
|
36
|
-
{
|
|
37
|
-
this.solve();
|
|
38
|
-
this._testDone();
|
|
39
|
-
return super.onAfterInitialize();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
class DoNothingView extends libPictView
|
|
44
|
-
{
|
|
45
|
-
constructor(pPict, pOptions)
|
|
46
|
-
{
|
|
47
|
-
super(pPict, pOptions);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
suite
|
|
52
|
-
(
|
|
53
|
-
'PictSectionRecordSet Basic',
|
|
54
|
-
() =>
|
|
55
|
-
{
|
|
56
|
-
let originalLocalStorage;
|
|
57
|
-
|
|
58
|
-
setup(() =>
|
|
59
|
-
{
|
|
60
|
-
libBrowserEnv({
|
|
61
|
-
url: "http://localhost/",
|
|
62
|
-
});
|
|
63
|
-
originalLocalStorage = localStorage;
|
|
64
|
-
// @ts-ignore
|
|
65
|
-
localStorage = {
|
|
66
|
-
getItem: sinon.stub(),
|
|
67
|
-
setItem: sinon.stub(),
|
|
68
|
-
removeItem: sinon.stub(),
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
teardown(() =>
|
|
73
|
-
{
|
|
74
|
-
sinon.restore();
|
|
75
|
-
// @ts-ignore
|
|
76
|
-
delete localStorage;
|
|
77
|
-
localStorage = originalLocalStorage;
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
suite
|
|
81
|
-
(
|
|
82
|
-
'Basic Basic Tests',
|
|
83
|
-
() =>
|
|
84
|
-
{
|
|
85
|
-
test(
|
|
86
|
-
'Basic Initialization',
|
|
87
|
-
(fDone) =>
|
|
88
|
-
{
|
|
89
|
-
let _Pict = new libPict();
|
|
90
|
-
_Pict.LogNoisiness = 1;
|
|
91
|
-
//let _PictEnvironment = new libPict.EnvironmentObject(_Pict);
|
|
92
|
-
localStorage = originalLocalStorage;
|
|
93
|
-
|
|
94
|
-
// Define view configuration
|
|
95
|
-
let _Application = new DoNothingApplication(_Pict, {});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
Expect(_Application).to.be.an('object', 'Application should be an object.');
|
|
99
|
-
Expect(_Application).to.be.an.instanceof(libPictSectionRecordSet.PictRecordSetApplication, 'Application should be an instance of PictRecordSetApplication.');
|
|
100
|
-
|
|
101
|
-
_Application.testDone = fDone;
|
|
102
|
-
|
|
103
|
-
_Application.initialize();
|
|
104
|
-
|
|
105
|
-
let _PictSectionRecordSet = _Pict.addView(tmpViewHash, tmpViewConfiguration, libPictSectionRecordSet);
|
|
106
|
-
|
|
107
|
-
Expect(_PictSectionRecordSet).to.be.an('object');
|
|
108
|
-
|
|
109
|
-
// Test package anthropology
|
|
110
|
-
Expect(_PictSectionRecordSet._PackageFableServiceProvider).to.be.an('object', 'Fable should have a _PackageFableServiceProvider object.');
|
|
111
|
-
Expect(_PictSectionRecordSet._PackageFableServiceProvider.name).equal('fable-serviceproviderbase', 'Fable _PackageFableServiceProvider.package.name should be set.');
|
|
112
|
-
Expect(_PictSectionRecordSet._PackagePictView).to.be.an('object', 'Should have a _PackagePictView object.');
|
|
113
|
-
Expect(_PictSectionRecordSet._PackagePictView.name).to.equal('pict-view', '_PackagePictView.package.name should be set.');
|
|
114
|
-
Expect(_PictSectionRecordSet._Package).to.be.an('object', 'Should have a _Package object.');
|
|
115
|
-
Expect(_PictSectionRecordSet._Package.name).to.equal('pict-section-recordset', '_Package.package.name should be set.');
|
|
116
|
-
|
|
117
|
-
return fDone();
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
});
|
|
121
|
-
suite
|
|
122
|
-
(
|
|
123
|
-
'MetaController addManifest',
|
|
124
|
-
() =>
|
|
125
|
-
{
|
|
126
|
-
test(
|
|
127
|
-
'should register a manifest at runtime',
|
|
128
|
-
(fDone) =>
|
|
129
|
-
{
|
|
130
|
-
let _Pict = new libPict();
|
|
131
|
-
_Pict.LogNoisiness = 0;
|
|
132
|
-
localStorage = originalLocalStorage;
|
|
133
|
-
|
|
134
|
-
let _Application = new DoNothingApplication(_Pict, {});
|
|
135
|
-
_Application.testDone = () =>
|
|
136
|
-
{
|
|
137
|
-
let _MetaController = _Pict.services.PictSectionRecordSet;
|
|
138
|
-
|
|
139
|
-
Expect(_MetaController).to.be.an('object', 'MetaController should exist.');
|
|
140
|
-
Expect(_MetaController.addManifest).to.be.a('function', 'addManifest should be a function.');
|
|
141
|
-
|
|
142
|
-
// Before adding, manifest should not exist
|
|
143
|
-
Expect(_MetaController.getManifest('TestDashboard')).to.equal(undefined);
|
|
144
|
-
|
|
145
|
-
// Add a manifest
|
|
146
|
-
_MetaController.addManifest({
|
|
147
|
-
Scope: 'TestDashboard',
|
|
148
|
-
CoreEntity: 'PhysicalAsset',
|
|
149
|
-
TitleTemplate: 'Test Dashboard',
|
|
150
|
-
Descriptors:
|
|
151
|
-
{
|
|
152
|
-
'Name':
|
|
153
|
-
{
|
|
154
|
-
'Name': 'Name',
|
|
155
|
-
'Hash': 'Name',
|
|
156
|
-
'PictDashboard': {}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
// After adding, manifest should be retrievable
|
|
162
|
-
let tmpManifest = _MetaController.getManifest('TestDashboard');
|
|
163
|
-
Expect(tmpManifest).to.be.an('object', 'Manifest should be retrievable after addManifest.');
|
|
164
|
-
|
|
165
|
-
// The manifest definition should also be registered
|
|
166
|
-
Expect(_MetaController.manifestDefinitions['TestDashboard']).to.be.an('object');
|
|
167
|
-
Expect(_MetaController.manifestDefinitions['TestDashboard'].Scope).to.equal('TestDashboard');
|
|
168
|
-
Expect(_MetaController.manifestDefinitions['TestDashboard'].TitleTemplate).to.equal('Test Dashboard');
|
|
169
|
-
|
|
170
|
-
fDone();
|
|
171
|
-
};
|
|
172
|
-
_Application.initialize();
|
|
173
|
-
}
|
|
174
|
-
);
|
|
175
|
-
|
|
176
|
-
test(
|
|
177
|
-
'should reject invalid manifests',
|
|
178
|
-
(fDone) =>
|
|
179
|
-
{
|
|
180
|
-
let _Pict = new libPict();
|
|
181
|
-
_Pict.LogNoisiness = 0;
|
|
182
|
-
localStorage = originalLocalStorage;
|
|
183
|
-
|
|
184
|
-
let _Application = new DoNothingApplication(_Pict, {});
|
|
185
|
-
_Application.testDone = () =>
|
|
186
|
-
{
|
|
187
|
-
let _MetaController = _Pict.services.PictSectionRecordSet;
|
|
188
|
-
|
|
189
|
-
// Should not throw on invalid input
|
|
190
|
-
_MetaController.addManifest(null);
|
|
191
|
-
_MetaController.addManifest({});
|
|
192
|
-
_MetaController.addManifest({ Scope: 'NoDescriptors' });
|
|
193
|
-
|
|
194
|
-
// None of these should have been registered
|
|
195
|
-
Expect(_MetaController.getManifest('NoDescriptors')).to.equal(undefined);
|
|
196
|
-
|
|
197
|
-
fDone();
|
|
198
|
-
};
|
|
199
|
-
_Application.initialize();
|
|
200
|
-
}
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
);
|