pict-section-form 1.3.14 → 1.3.16

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 (80) hide show
  1. package/docs/Injection_Conformance.md +137 -0
  2. package/docs/Providers.md +12 -7
  3. package/docs/_sidebar.md +3 -0
  4. package/docs/input_providers/016-facet-filter.md +106 -0
  5. package/docs/input_providers/README.md +1 -0
  6. package/example_applications/README.md +6 -0
  7. package/example_applications/facet_filter/.quackage.json +9 -0
  8. package/example_applications/facet_filter/Facet-Filter-Application.js +210 -0
  9. package/example_applications/facet_filter/Facet-Filter-Server.js +233 -0
  10. package/example_applications/facet_filter/Facet-Filter-Smoke-Runner.js +101 -0
  11. package/example_applications/facet_filter/FacetFilterData.json +44 -0
  12. package/example_applications/facet_filter/README-FacetFilter.md +70 -0
  13. package/example_applications/facet_filter/html/Facet-Filter-Smoke.js +128 -0
  14. package/example_applications/facet_filter/html/index.html +74 -0
  15. package/example_applications/facet_filter/package.json +27 -0
  16. package/example_applications/nested_distill_sandbox/Sandbox-Driver-Headlight.js +17 -0
  17. package/example_applications/nested_distill_sandbox/Sandbox-Driver.js +369 -0
  18. package/example_applications/nested_distill_sandbox/Sandbox-Runner.js +372 -0
  19. package/example_applications/nested_distill_sandbox/approaches/A1-tabular-trigger-group.js +67 -0
  20. package/example_applications/nested_distill_sandbox/approaches/A3-crossmap-selectoptionsrefresh.js +61 -0
  21. package/example_applications/nested_distill_sandbox/approaches/A4-graph-solvers-flat-list.js +53 -0
  22. package/example_applications/nested_distill_sandbox/approaches/A5-facet-filter.js +75 -0
  23. package/example_applications/nested_distill_sandbox/approaches/A5b-facet-filter-symmetric.js +15 -0
  24. package/example_applications/nested_distill_sandbox/approaches/A5h-facet-filter-headlight-picker.js +15 -0
  25. package/example_applications/nested_distill_sandbox/approaches/R0-original-jmf-manifest-headlight.js +27 -0
  26. package/example_applications/nested_distill_sandbox/approaches/R1-real-jmf-manifest-headlight.js +136 -0
  27. package/example_applications/nested_distill_sandbox/approaches/_Common.js +344 -0
  28. package/example_applications/nested_distill_sandbox/approaches/_Scenarios.js +262 -0
  29. package/package.json +6 -5
  30. package/source/providers/Pict-Provider-DynamicFormSolverBehaviors.js +73 -5
  31. package/source/providers/Pict-Provider-DynamicSolver.js +22 -2
  32. package/source/providers/Pict-Provider-ListDistilling.js +266 -1
  33. package/source/providers/Pict-Provider-MetaLists.js +16 -2
  34. package/source/providers/inputs/Pict-Provider-Input-FacetFilter.js +232 -0
  35. package/source/providers/inputs/Pict-Provider-Input-Select.js +41 -1
  36. package/source/views/Pict-View-Form-Metacontroller.js +690 -93
  37. package/test/Pict-Provider-DynamicFormSolverBehaviors-OrdinalScope_tests.js +105 -0
  38. package/test/Pict-Provider-ListDistilling-Facet_tests.js +375 -0
  39. package/test/Pict-View-Form-Metacontroller-DistinctManifest_tests.js +410 -0
  40. package/test/PictSectionForm-Injection-Conformance_tests.js +762 -0
  41. package/test/browser/Injection-Conformance-Differential-Scenario.js +346 -0
  42. package/test/browser/Injection-Conformance-EdgeCase-Scenario.js +168 -0
  43. package/test/browser/Injection-Conformance-Harness-Driver.js +538 -0
  44. package/test/browser/Injection-Conformance-Harness-Runner.js +487 -0
  45. package/test/browser/Injection-Conformance-Reconstitution-Scenario.js +191 -0
  46. package/test/browser/Injection-Conformance-Standalone-Scenario.js +114 -0
  47. package/test/fixtures/injection/Injection-Fixture-Cases.js +204 -0
  48. package/test/fixtures/injection/Injection-Fixture-Manifest.json +381 -0
  49. package/types/source/providers/Pict-Provider-DynamicFormSolverBehaviors.d.ts +110 -1
  50. package/types/source/providers/Pict-Provider-DynamicFormSolverBehaviors.d.ts.map +1 -1
  51. package/types/source/providers/Pict-Provider-DynamicSolver.d.ts.map +1 -1
  52. package/types/source/providers/Pict-Provider-DynamicTabularData.d.ts +17 -1
  53. package/types/source/providers/Pict-Provider-DynamicTabularData.d.ts.map +1 -1
  54. package/types/source/providers/Pict-Provider-InputExtension.d.ts +31 -0
  55. package/types/source/providers/Pict-Provider-InputExtension.d.ts.map +1 -1
  56. package/types/source/providers/Pict-Provider-ListDistilling.d.ts +90 -1
  57. package/types/source/providers/Pict-Provider-ListDistilling.d.ts.map +1 -1
  58. package/types/source/providers/Pict-Provider-MetaLists.d.ts.map +1 -1
  59. package/types/source/providers/inputs/Pict-Provider-Input-Chart-CSS.d.ts +16 -0
  60. package/types/source/providers/inputs/Pict-Provider-Input-Chart-CSS.d.ts.map +1 -0
  61. package/types/source/providers/inputs/Pict-Provider-Input-Chart.d.ts +47 -0
  62. package/types/source/providers/inputs/Pict-Provider-Input-Chart.d.ts.map +1 -1
  63. package/types/source/providers/inputs/Pict-Provider-Input-Diagram.d.ts +86 -0
  64. package/types/source/providers/inputs/Pict-Provider-Input-Diagram.d.ts.map +1 -1
  65. package/types/source/providers/inputs/Pict-Provider-Input-FacetFilter.d.ts +103 -0
  66. package/types/source/providers/inputs/Pict-Provider-Input-FacetFilter.d.ts.map +1 -0
  67. package/types/source/providers/inputs/Pict-Provider-Input-ObjectEditor.d.ts +128 -0
  68. package/types/source/providers/inputs/Pict-Provider-Input-ObjectEditor.d.ts.map +1 -0
  69. package/types/source/providers/inputs/Pict-Provider-Input-PreciseNumber.d.ts.map +1 -1
  70. package/types/source/providers/inputs/Pict-Provider-Input-Select.d.ts +12 -0
  71. package/types/source/providers/inputs/Pict-Provider-Input-Select.d.ts.map +1 -1
  72. package/types/source/providers/inputs/Pict-Provider-Input-TabGroupSelector.d.ts +10 -1
  73. package/types/source/providers/inputs/Pict-Provider-Input-TabGroupSelector.d.ts.map +1 -1
  74. package/types/source/providers/inputs/Pict-Provider-Input-TabSectionSelector.d.ts +10 -1
  75. package/types/source/providers/inputs/Pict-Provider-Input-TabSectionSelector.d.ts.map +1 -1
  76. package/types/source/providers/layouts/Pict-Layout-Tabular.d.ts +76 -4
  77. package/types/source/providers/layouts/Pict-Layout-Tabular.d.ts.map +1 -1
  78. package/types/source/views/Pict-View-DynamicForm.d.ts.map +1 -1
  79. package/types/source/views/Pict-View-Form-Metacontroller.d.ts +63 -2
  80. package/types/source/views/Pict-View-Form-Metacontroller.d.ts.map +1 -1
@@ -0,0 +1,233 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ A small meadow-endpoints stand-in for the Facet Filter example: serves the built app from ./dist and the
4
+ catalog in FacetFilterData.json over the read routes the pict EntityProvider uses, logging every request.
5
+
6
+ node Facet-Filter-Server.js [--port 8086] [--latency 0]
7
+
8
+ Routes (all GET, under /1.0/):
9
+ <Entity>/Schema capability probe; answers with no Query support
10
+ <Entity>/<ID> one record
11
+ <Entity>s[/FilteredTo/<filter>][/<begin>/<cap>] a page of records
12
+ <Entity>s/Count[/FilteredTo/<filter>] { Count }
13
+
14
+ Filters are meadow FilteredTo stanzas joined by "~": FBV~Field~Operator~Value (EQ, NE, LT, LE, GT, GE, LK)
15
+ and FBL~Field~INN~a,b,c. Anything else answers 400, so a malformed filter is visible rather than ignored.
16
+ Deleted records are left out the way meadow-endpoints leaves them out.
17
+ */
18
+
19
+ const libHTTP = require('http');
20
+ const libFS = require('fs');
21
+ const libPath = require('path');
22
+
23
+ const DIST_DIRECTORY = libPath.join(__dirname, 'dist');
24
+ const DATA = JSON.parse(libFS.readFileSync(libPath.join(__dirname, 'FacetFilterData.json'), 'utf8'));
25
+ const CONTENT_TYPES = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8', '.map': 'application/json', '.css': 'text/css', '.json': 'application/json' };
26
+
27
+ /**
28
+ * @param {Array<string>} pArguments
29
+ * @return {{ Port: number, Latency: number }}
30
+ */
31
+ function parseArguments(pArguments)
32
+ {
33
+ const tmpOptions = { Port: 8086, Latency: 0 };
34
+ for (let i = 0; i < pArguments.length; i++)
35
+ {
36
+ if (pArguments[i] === '--port')
37
+ {
38
+ tmpOptions.Port = parseInt(pArguments[++i], 10);
39
+ }
40
+ else if (pArguments[i] === '--latency')
41
+ {
42
+ tmpOptions.Latency = parseInt(pArguments[++i], 10);
43
+ }
44
+ }
45
+ return tmpOptions;
46
+ }
47
+
48
+ /**
49
+ * @param {any} pLeft - the record's value
50
+ * @param {string} pOperator
51
+ * @param {string} pRight - the filter's value
52
+ * @return {boolean}
53
+ */
54
+ function compare(pLeft, pOperator, pRight)
55
+ {
56
+ if ((pLeft === undefined) || (pLeft === null))
57
+ {
58
+ return pOperator === 'NE';
59
+ }
60
+ const tmpNumeric = (pRight !== '') && !isNaN(Number(pRight)) && !isNaN(Number(pLeft));
61
+ let tmpLeft = tmpNumeric ? Number(pLeft) : String(pLeft);
62
+ const tmpRight = tmpNumeric ? Number(pRight) : pRight;
63
+ // A bare date compares against the date part of a timestamp, as the database does.
64
+ if (!tmpNumeric && /^\d{4}-\d{2}-\d{2}$/.test(pRight) && /^\d{4}-\d{2}-\d{2}T/.test(tmpLeft))
65
+ {
66
+ tmpLeft = tmpLeft.substring(0, 10);
67
+ }
68
+ switch (pOperator)
69
+ {
70
+ case 'EQ':
71
+ return tmpLeft === tmpRight;
72
+ case 'NE':
73
+ return tmpLeft !== tmpRight;
74
+ case 'LT':
75
+ return tmpLeft < tmpRight;
76
+ case 'LE':
77
+ return tmpLeft <= tmpRight;
78
+ case 'GT':
79
+ return tmpLeft > tmpRight;
80
+ case 'GE':
81
+ return tmpLeft >= tmpRight;
82
+ case 'LK':
83
+ return new RegExp(`^${String(tmpRight).split('%').map((pPart) => pPart.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('.*')}$`, 'i').test(String(tmpLeft));
84
+ default:
85
+ throw new Error(`Unsupported operator [${pOperator}]`);
86
+ }
87
+ }
88
+
89
+ /**
90
+ * @param {string} pFilter - decoded FilteredTo expression
91
+ * @return {(pRecord: Record<string, any>) => boolean}
92
+ */
93
+ function buildPredicate(pFilter)
94
+ {
95
+ const tmpParts = pFilter.split('~');
96
+ if ((tmpParts.length % 4) !== 0)
97
+ {
98
+ throw new Error(`Filter [${pFilter}] is not a list of Type~Field~Operator~Value stanzas`);
99
+ }
100
+ const tmpClauses = [];
101
+ for (let i = 0; i < tmpParts.length; i += 4)
102
+ {
103
+ const [ tmpType, tmpField, tmpOperator, tmpValue ] = tmpParts.slice(i, i + 4);
104
+ if (tmpType === 'FSF')
105
+ {
106
+ continue;
107
+ }
108
+ if ((tmpType === 'FBL') && (tmpOperator === 'INN'))
109
+ {
110
+ const tmpSet = new Set(tmpValue.split(',').filter((pEntry) => pEntry !== ''));
111
+ tmpClauses.push((pRecord) => tmpSet.has(String(pRecord[tmpField])));
112
+ continue;
113
+ }
114
+ if ((tmpType === 'FBV') && [ 'EQ', 'NE', 'LT', 'LE', 'GT', 'GE', 'LK' ].includes(tmpOperator))
115
+ {
116
+ tmpClauses.push((pRecord) => compare(pRecord[tmpField], tmpOperator, tmpValue));
117
+ continue;
118
+ }
119
+ throw new Error(`Unsupported filter stanza [${tmpType}~${tmpField}~${tmpOperator}]`);
120
+ }
121
+ return (pRecord) => tmpClauses.every((fClause) => fClause(pRecord));
122
+ }
123
+
124
+ /**
125
+ * @param {string} pPath - the path after /1.0/
126
+ * @return {{ Status: number, Body: any }}
127
+ */
128
+ function answerAPI(pPath)
129
+ {
130
+ const tmpSegments = pPath.split('/').filter((pSegment) => pSegment !== '').map((pSegment) => decodeURIComponent(pSegment));
131
+ const tmpHead = tmpSegments[0] || '';
132
+ if (DATA[tmpHead] && (tmpSegments[1] === 'Schema'))
133
+ {
134
+ return { Status: 200, Body: { Entity: tmpHead } };
135
+ }
136
+ if (DATA[tmpHead] && /^\d+$/.test(tmpSegments[1] || ''))
137
+ {
138
+ const tmpRecord = DATA[tmpHead].find((pRecord) => String(pRecord[`ID${tmpHead}`]) === tmpSegments[1] && !pRecord.Deleted);
139
+ return tmpRecord ? { Status: 200, Body: tmpRecord } : { Status: 404, Body: { Error: 'Record not found' } };
140
+ }
141
+ const tmpEntity = tmpHead.endsWith('s') ? tmpHead.slice(0, -1) : '';
142
+ if (!DATA[tmpEntity])
143
+ {
144
+ return { Status: 404, Body: { Error: `No route for [${pPath}]` } };
145
+ }
146
+ let tmpRest = tmpSegments.slice(1);
147
+ const tmpCount = (tmpRest[0] === 'Count');
148
+ if (tmpCount)
149
+ {
150
+ tmpRest = tmpRest.slice(1);
151
+ }
152
+ let tmpPredicate = () => true;
153
+ if (tmpRest[0] === 'FilteredTo')
154
+ {
155
+ tmpPredicate = buildPredicate(tmpRest[1] || '');
156
+ tmpRest = tmpRest.slice(2);
157
+ }
158
+ const tmpRecords = DATA[tmpEntity].filter((pRecord) => !pRecord.Deleted && tmpPredicate(pRecord));
159
+ if (tmpCount)
160
+ {
161
+ return { Status: 200, Body: { Count: tmpRecords.length } };
162
+ }
163
+ const tmpBegin = (tmpRest.length >= 2) ? parseInt(tmpRest[0], 10) : 0;
164
+ const tmpCap = (tmpRest.length >= 2) ? parseInt(tmpRest[1], 10) : tmpRecords.length;
165
+ return { Status: 200, Body: tmpRecords.slice(tmpBegin, tmpBegin + tmpCap) };
166
+ }
167
+
168
+ /**
169
+ * @param {import('http').ServerResponse} pResponse
170
+ * @param {string} pURLPath
171
+ */
172
+ function serveStatic(pResponse, pURLPath)
173
+ {
174
+ const tmpRelative = (pURLPath === '/') ? 'index.html' : decodeURIComponent(pURLPath).replace(/^\/+/, '');
175
+ const tmpPath = libPath.join(DIST_DIRECTORY, tmpRelative);
176
+ if (!tmpPath.startsWith(DIST_DIRECTORY) || !libFS.existsSync(tmpPath) || !libFS.statSync(tmpPath).isFile())
177
+ {
178
+ pResponse.writeHead(404, { 'Content-Type': 'text/plain' });
179
+ pResponse.end(libFS.existsSync(DIST_DIRECTORY) ? 'Not found' : 'No dist/ yet -- run `npm run build` first.');
180
+ return;
181
+ }
182
+ pResponse.writeHead(200, { 'Content-Type': CONTENT_TYPES[libPath.extname(tmpPath)] || 'application/octet-stream', 'Cache-Control': 'no-store' });
183
+ libFS.createReadStream(tmpPath).pipe(pResponse);
184
+ }
185
+
186
+ function main()
187
+ {
188
+ const tmpOptions = parseArguments(process.argv.slice(2));
189
+ const tmpServer = libHTTP.createServer((pRequest, pResponse) =>
190
+ {
191
+ const tmpURL = new URL(pRequest.url, 'http://localhost');
192
+ if (!tmpURL.pathname.startsWith('/1.0/'))
193
+ {
194
+ return serveStatic(pResponse, tmpURL.pathname);
195
+ }
196
+ const tmpStart = Date.now();
197
+ let tmpAnswer;
198
+ if (pRequest.method !== 'GET')
199
+ {
200
+ tmpAnswer = { Status: 405, Body: { Error: `${pRequest.method} is not served by this example` } };
201
+ }
202
+ else
203
+ {
204
+ try
205
+ {
206
+ tmpAnswer = answerAPI(tmpURL.pathname.substring('/1.0/'.length));
207
+ }
208
+ catch (pError)
209
+ {
210
+ tmpAnswer = { Status: 400, Body: { Error: pError.message } };
211
+ }
212
+ }
213
+ setTimeout(() =>
214
+ {
215
+ const tmpBody = JSON.stringify(tmpAnswer.Body);
216
+ pResponse.writeHead(tmpAnswer.Status, { 'Content-Type': 'application/json' });
217
+ pResponse.end(tmpBody);
218
+ const tmpSummary = Array.isArray(tmpAnswer.Body) ? `${tmpAnswer.Body.length} record(s)` : (tmpAnswer.Body.Error || JSON.stringify(tmpAnswer.Body));
219
+ console.log(`${new Date().toISOString()} ${pRequest.method} ${decodeURIComponent(tmpURL.pathname)} -> ${tmpAnswer.Status} ${tmpSummary} (${Date.now() - tmpStart} ms)`);
220
+ }, tmpOptions.Latency);
221
+ });
222
+ tmpServer.listen(tmpOptions.Port, () =>
223
+ {
224
+ console.log(`Facet Filter example: http://localhost:${tmpOptions.Port}/ (API latency ${tmpOptions.Latency} ms)`);
225
+ });
226
+ }
227
+
228
+ if (require.main === module)
229
+ {
230
+ main();
231
+ }
232
+
233
+ module.exports = { answerAPI, buildPredicate };
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ Starts the example server, loads http://localhost:<port>/?smoke=1 in jsdom -- which fetches the page and
4
+ its scripts from the server and makes the app's reads over real HTTP -- and prints the walkthrough's
5
+ [ok] / [fail] checks with the server's request log. Build first (npm run build).
6
+
7
+ node Facet-Filter-Smoke-Runner.js [--port 8087]
8
+ */
9
+
10
+ const libChildProcess = require('child_process');
11
+ const libFS = require('fs');
12
+ const libPath = require('path');
13
+
14
+ const libJSDOM = require('jsdom');
15
+
16
+ const TIMEOUT_MS = 30000;
17
+
18
+ /**
19
+ * @param {number} pMilliseconds
20
+ * @return {Promise<void>}
21
+ */
22
+ function wait(pMilliseconds)
23
+ {
24
+ return new Promise((fResolve) => setTimeout(fResolve, pMilliseconds));
25
+ }
26
+
27
+ async function main()
28
+ {
29
+ const tmpPortIndex = process.argv.indexOf('--port');
30
+ const tmpPort = (tmpPortIndex > 0) ? process.argv[tmpPortIndex + 1] : '8087';
31
+ if (!libFS.existsSync(libPath.join(__dirname, 'dist', 'index.html')))
32
+ {
33
+ console.error('No dist/ -- run `npm run build` first.');
34
+ return 2;
35
+ }
36
+ const tmpServer = libChildProcess.spawn(process.execPath, [ libPath.join(__dirname, 'Facet-Filter-Server.js'), '--port', tmpPort ], { stdio: [ 'ignore', 'pipe', 'inherit' ] });
37
+ const tmpServerLog = [];
38
+ try
39
+ {
40
+ await new Promise((fResolve, fReject) =>
41
+ {
42
+ tmpServer.on('exit', (pCode) => fReject(new Error(`The server exited (${pCode}); is port ${tmpPort} free?`)));
43
+ tmpServer.stdout.on('data', (pChunk) =>
44
+ {
45
+ tmpServerLog.push(String(pChunk));
46
+ if (String(pChunk).includes('Facet Filter example:'))
47
+ {
48
+ fResolve();
49
+ }
50
+ });
51
+ });
52
+
53
+ const tmpConsole = new libJSDOM.VirtualConsole();
54
+ const tmpPageErrors = [];
55
+ tmpConsole.on('jsdomError', (pError) => tmpPageErrors.push(String(pError && pError.message ? pError.message : pError)));
56
+ const tmpDOM = await libJSDOM.JSDOM.fromURL(`http://localhost:${tmpPort}/?smoke=1`, { runScripts: 'dangerously', resources: 'usable', pretendToBeVisual: true, virtualConsole: tmpConsole });
57
+
58
+ const tmpStart = Date.now();
59
+ let tmpResults = null;
60
+ while (!tmpResults && ((Date.now() - tmpStart) < TIMEOUT_MS))
61
+ {
62
+ const tmpElement = tmpDOM.window.document.getElementById('Facet-Filter-Smoke-Results');
63
+ if (tmpElement)
64
+ {
65
+ tmpResults = JSON.parse(Buffer.from(tmpElement.getAttribute('data-results'), 'base64').toString('utf8'));
66
+ }
67
+ await wait(100);
68
+ }
69
+ tmpDOM.window.close();
70
+
71
+ console.log('Server requests:');
72
+ for (const tmpLine of tmpServerLog.join('').split('\n').filter((pLine) => pLine.includes(' GET ')))
73
+ {
74
+ console.log(` ${tmpLine}`);
75
+ }
76
+ if (tmpPageErrors.length)
77
+ {
78
+ console.log(`Page errors:\n ${tmpPageErrors.slice(0, 10).join('\n ')}`);
79
+ }
80
+ if (!tmpResults)
81
+ {
82
+ console.error(`The walkthrough published no results within ${TIMEOUT_MS} ms.`);
83
+ return 1;
84
+ }
85
+ let tmpFailures = 0;
86
+ console.log('Walkthrough:');
87
+ for (const tmpCheck of tmpResults)
88
+ {
89
+ tmpFailures += tmpCheck.Passed ? 0 : 1;
90
+ console.log(` [${tmpCheck.Passed ? 'ok' : 'fail'}] ${tmpCheck.Label}${tmpCheck.Passed ? '' : ' -- ' + JSON.stringify(tmpCheck.Detail)}`);
91
+ }
92
+ console.log(`${tmpResults.length - tmpFailures} of ${tmpResults.length} passed.`);
93
+ return tmpFailures ? 1 : 0;
94
+ }
95
+ finally
96
+ {
97
+ tmpServer.kill();
98
+ }
99
+ }
100
+
101
+ main().then((pCode) => { process.exitCode = pCode; }, (pError) => { console.error(pError); process.exitCode = 2; });
@@ -0,0 +1,44 @@
1
+ {
2
+ "Publisher":
3
+ [
4
+ { "IDPublisher": 1, "Name": "Harbor House", "Active": 1, "Deleted": 0 },
5
+ { "IDPublisher": 2, "Name": "Lantern Press", "Active": 1, "Deleted": 0 },
6
+ { "IDPublisher": 3, "Name": "Northwind Books", "Active": 1, "Deleted": 0 },
7
+ { "IDPublisher": 4, "Name": "Old Mill Editions", "Active": 0, "Deleted": 0 }
8
+ ],
9
+ "Book":
10
+ [
11
+ { "IDBook": 101, "Title": "The Quiet Harbor", "IDPublisher": 1, "InPrintFrom": "2019-03-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
12
+ "Details": { "Genre": "Mystery", "Author": "A. Marlowe", "Language": "EN", "Current": { "Price": 14.5, "Format": "Paperback" } } },
13
+ { "IDBook": 102, "Title": "Salt and Shadow", "IDPublisher": 1, "InPrintFrom": "2020-06-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
14
+ "Details": { "Genre": "Mystery", "Author": "A. Marlowe", "Language": "EN", "Current": { "Price": 16, "Format": "Hardcover" } } },
15
+ { "IDBook": 103, "Title": "Lamplight Alley", "IDPublisher": 2, "InPrintFrom": "2021-01-15T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
16
+ "Details": { "Genre": "Mystery", "Author": "A. Marlowe", "Language": "EN", "Current": { "Price": 12, "Format": "Paperback" } } },
17
+ { "IDBook": 104, "Title": "La Maison du Canal", "IDPublisher": 3, "InPrintFrom": "2018-09-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
18
+ "Details": { "Genre": "Mystery", "Author": "C. Duval", "Language": "FR", "Current": { "Price": 18, "Format": "Paperback" } } },
19
+ { "IDBook": 105, "Title": "Le Quai Froid", "IDPublisher": 3, "InPrintFrom": "2022-02-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
20
+ "Details": { "Genre": "Mystery", "Author": "C. Duval", "Language": "FR", "Current": { "Price": 19.5, "Format": "Hardcover" } } },
21
+ { "IDBook": 106, "Title": "Tides in Verse", "IDPublisher": 2, "InPrintFrom": "2017-04-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
22
+ "Details": { "Genre": "Poetry", "Author": "A. Marlowe", "Language": "EN", "Current": { "Price": 11, "Format": "Paperback" } } },
23
+ { "IDBook": 107, "Title": "Paper Cranes", "IDPublisher": 2, "InPrintFrom": "2016-05-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
24
+ "Details": { "Genre": "Poetry", "Author": "E. Sato", "Language": "EN", "Current": { "Price": 9.5, "Format": "Paperback" } } },
25
+ { "IDBook": 108, "Title": "Small Worlds", "IDPublisher": 1, "InPrintFrom": "2023-08-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
26
+ "Details": { "Genre": "Science", "Author": "R. Okafor", "Language": "EN", "Current": { "Price": 24, "Format": "Hardcover" } } },
27
+ { "IDBook": 109, "Title": "Das Leise Licht", "IDPublisher": 3, "InPrintFrom": "2015-01-01T00:00:00.000Z", "InPrintUntil": "2024-06-30T00:00:00.000Z", "Deleted": 0,
28
+ "Details": { "Genre": "Science", "Author": "L. Brandt", "Language": "DE", "Current": { "Price": 21, "Format": "Hardcover" } } },
29
+ { "IDBook": 110, "Title": "Kalte Sterne", "IDPublisher": 3, "InPrintFrom": "2021-10-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
30
+ "Details": { "Genre": "Science", "Author": "L. Brandt", "Language": "DE", "Current": { "Price": 22.5, "Format": "Paperback" } } },
31
+ { "IDBook": 111, "Title": "Rivers of the Steppe", "IDPublisher": 1, "InPrintFrom": "2019-11-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
32
+ "Details": { "Genre": "History", "Author": "M. Petrov", "Language": "EN", "Current": { "Price": 27, "Format": "Hardcover" } } },
33
+ { "IDBook": 112, "Title": "The Winter Ports", "IDPublisher": 1, "InPrintFrom": "2022-03-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
34
+ "Details": { "Genre": "History", "Author": "M. Petrov", "Language": "EN", "Current": { "Price": 25, "Format": "Paperback" } } },
35
+ { "IDBook": 113, "Title": "Collected Fragments", "IDPublisher": 2, "InPrintFrom": "2020-01-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
36
+ "Details": { "Author": "Various", "Language": "EN", "Current": { "Price": 8, "Format": "Paperback" } } },
37
+ { "IDBook": 114, "Title": "Harbor Lights (First Edition)", "IDPublisher": 1, "InPrintFrom": "2012-01-01T00:00:00.000Z", "InPrintUntil": "2023-12-31T00:00:00.000Z", "Deleted": 0,
38
+ "Details": { "Genre": "Mystery", "Author": "A. Marlowe", "Language": "EN", "Current": { "Price": 30, "Format": "Hardcover" } } },
39
+ { "IDBook": 115, "Title": "Northern Almanac", "IDPublisher": 2, "InPrintFrom": "2027-03-01T00:00:00.000Z", "InPrintUntil": "2035-12-31T00:00:00.000Z", "Deleted": 0,
40
+ "Details": { "Genre": "Science", "Author": "R. Okafor", "Language": "EN", "Current": { "Price": 26, "Format": "Hardcover" } } },
41
+ { "IDBook": 116, "Title": "The Mill Race", "IDPublisher": 4, "InPrintFrom": "2019-01-01T00:00:00.000Z", "InPrintUntil": "2030-12-31T00:00:00.000Z", "Deleted": 0,
42
+ "Details": { "Genre": "History", "Author": "M. Petrov", "Language": "EN", "Current": { "Price": 20, "Format": "Paperback" } } }
43
+ ]
44
+ }
@@ -0,0 +1,70 @@
1
+ # Facet Filter
2
+
3
+ Order lines that pick **Genre -> Author -> Book** from one shared catalog. Each dropdown is narrowed by the
4
+ other choices in its own row, a pick fills in whatever is left with a single option, a change clears what it
5
+ contradicts, and the chosen book's price and format are carried into the row. The catalog comes from a small
6
+ REST server that ships with the example, so the whole path -- bundle load over HTTP, graph, lists, change
7
+ handling, solve -- runs for real.
8
+
9
+ What it exercises (see [the FacetFilter provider docs](../../docs/input_providers/016-facet-filter.md)):
10
+
11
+ | Behaviour | Where to see it |
12
+ |---|---|
13
+ | Form-level `InitialBundle`: active publishers, then their books (`FBL~IDPublisher~INN~...`), flattened by `ProjectDataset` from each book's nested `Details` | the server log on load -- two reads, nothing afterwards |
14
+ | `ListSourceAddressGlobal` picklists built from that graph; `SkipEmpty` leaves out the book with no genre | the Genre list |
15
+ | `Facet` rule, row-scoped and joint | pick in one row, open the same list in another |
16
+ | `NarrowBy: Preceding` vs `NarrowBy: All` | the two tables |
17
+ | `Facets` with `ValueAddress` and date `Operator`s | the Language and In print on fields |
18
+ | `Pict-Input-FacetFilter`: fill-single, clear-invalid, `CarryFields` | Price / Format / Line Total, and the live `AppData.Order` panel |
19
+ | `KeepCurrentValue` and carried values kept as saved | the pre-filled first line |
20
+
21
+ ## Run it
22
+
23
+ ```bash
24
+ cd example_applications/facet_filter
25
+ npm run build
26
+ npm start # http://localhost:8086/ (--port N, --latency MS)
27
+ ```
28
+
29
+ The server logs every API request. Open the page and watch: the catalog loads in two requests, and picking
30
+ things afterwards makes none.
31
+
32
+ `npm run smoke` (after a build) starts the server on 8087, loads `/?smoke=1` in jsdom (which
33
+ fetches the page and scripts from the server and makes the app's reads over HTTP) and prints 20 checks. The
34
+ same `?smoke=1` works in a desktop browser -- the checks print to the console.
35
+
36
+ ## Things to try
37
+
38
+ 1. **The saved line.** Row 1 of the first table was "saved earlier": *Das Leise Licht*, which went out of
39
+ print in 2024, at a price of 18 (the catalog now says 21). It still shows in its own row, the other rows do
40
+ not offer it, and its price stays 18.
41
+ 2. **History.** In row 2 pick Genre *History*. Author fills with *M. Petrov* (his third book is at an inactive
42
+ publisher, so it was never loaded) and Book narrows to his two books but stays blank. Pick *The Winter
43
+ Ports*: Price 25 and Format fill, Line Total and the order total update in the same step.
44
+ 3. **One-book author.** In row 3 pick Author *R. Okafor*: Genre *Science* and Book *Small Worlds* fill in.
45
+ *Northern Almanac* is his too but is not in print until 2027. Set **In print on** to `2027-06-01` and it
46
+ becomes a choice.
47
+ 4. **A change that contradicts.** Still in row 3, change Genre to *Poetry*: Author and Book clear (Okafor
48
+ writes no poetry here), Price and Format clear with them, and the Author list narrows to Poetry authors.
49
+ Row 2 is untouched.
50
+ 5. **Shared author, joint narrowing.** Pick Author *A. Marlowe*: Genre offers Mystery and Poetry. Pick Poetry:
51
+ Book narrows to *Tides in Verse* alone and fills.
52
+ 6. **Left-narrowing vs symmetric.** In the second table pick Book *Le Quai Froid*: Genre and Author fill, and
53
+ that row's Genre list now holds only *Mystery* -- to change genre there you would first clear the book. In
54
+ the first table a filled row's Genre list stays whole, so you can re-pick and the row adjusts.
55
+ 7. **Form-level facets.** Set Language to *French*: every row's lists narrow to French books, but rows already
56
+ filled keep their values (and keep offering them) -- the form-level filters scope what can be picked, they
57
+ do not rewrite what was picked.
58
+
59
+ Note: pict-section-form's base `Option` dropdown has no empty entry, so a choice cannot be cleared from the
60
+ dropdown itself here (delete the row instead). Hosts that render `Option` with a clearable picker show step 4's
61
+ "clear sticks" behaviour when you clear the Book: the rest of the row stays and the Book is not refilled.
62
+
63
+ ## Files
64
+
65
+ | File | What |
66
+ |---|---|
67
+ | `Facet-Filter-Application.js` | The form: bundle, picklists, two order tables. Configuration only. |
68
+ | `Facet-Filter-Server.js` | Static server for `dist/` plus a meadow-endpoints-shaped read API over `FacetFilterData.json` (`FBV` EQ/NE/LT/LE/GT/GE/LK, `FBL` INN, paging, Count, Schema). |
69
+ | `FacetFilterData.json` | 4 publishers (one inactive), 16 books with nested `Details`. |
70
+ | `html/Facet-Filter-Smoke.js`, `Facet-Filter-Smoke-Runner.js` | The `?smoke=1` walkthrough and its runner. |
@@ -0,0 +1,128 @@
1
+ /*
2
+ Scripted walkthrough of the Facet Filter example, run only when the page is opened with ?smoke=1.
3
+ It drives the real dropdowns the way a user does and writes its checks to #Facet-Filter-Smoke-Results
4
+ (data-results, base64 JSON) for Facet-Filter-Smoke-Runner.js; the same checks print to the console.
5
+ */
6
+ (function ()
7
+ {
8
+ if (!/[?&]smoke=1\b/.test(window.location.search))
9
+ {
10
+ return;
11
+ }
12
+
13
+ var tmpChecks = [];
14
+ var fWait = function (pMilliseconds)
15
+ {
16
+ return new Promise(function (fResolve) { setTimeout(fResolve, pMilliseconds); });
17
+ };
18
+ var fCheck = function (pLabel, pPassed, pDetail)
19
+ {
20
+ tmpChecks.push({ Label: pLabel, Passed: !!pPassed, Detail: pPassed ? undefined : pDetail });
21
+ console.log((pPassed ? '[ok] ' : '[fail] ') + pLabel + (pPassed ? '' : ' -- ' + JSON.stringify(pDetail)));
22
+ };
23
+ var fSame = function (pLeft, pRight)
24
+ {
25
+ return JSON.stringify((pLeft || []).slice().sort()) === JSON.stringify((pRight || []).slice().sort());
26
+ };
27
+ var fPublish = function ()
28
+ {
29
+ var tmpElement = document.createElement('div');
30
+ tmpElement.id = 'Facet-Filter-Smoke-Results';
31
+ tmpElement.setAttribute('data-results', window.btoa(unescape(encodeURIComponent(JSON.stringify(tmpChecks)))));
32
+ document.body.appendChild(tmpElement);
33
+ document.title = 'FacetFilterSmoke:done';
34
+ };
35
+
36
+ var fView = function () { return window._Pict.views['PictSectionForm-Order']; };
37
+ var fColumn = function (pGroupHash, pKey)
38
+ {
39
+ var tmpView = fView();
40
+ var tmpGroupIndex = tmpView.getGroupIndexFromHash(pGroupHash);
41
+ var tmpInputIndex = tmpView.getGroup(tmpGroupIndex).supportingManifest.elementAddresses.indexOf(pKey);
42
+ return { GroupIndex: tmpGroupIndex, InputIndex: tmpInputIndex, Input: tmpView.getTabularRecordInput(tmpGroupIndex, tmpInputIndex) };
43
+ };
44
+ var fSelect = function (pGroupHash, pKey, pRow)
45
+ {
46
+ return document.getElementById('SELECT-TABULAR-DROPDOWN-' + fColumn(pGroupHash, pKey).Input.Macro.RawHTMLID + '-' + pRow);
47
+ };
48
+ var fOffered = function (pGroupHash, pKey, pRow)
49
+ {
50
+ return Array.prototype.map.call(fSelect(pGroupHash, pKey, pRow).options, function (pOption) { return pOption.value; });
51
+ };
52
+ var fRow = function (pGroupHash, pRow)
53
+ {
54
+ var tmpColumn = fColumn(pGroupHash, 'Book');
55
+ return fView().getTabularRecordData(tmpColumn.GroupIndex, pRow) || {};
56
+ };
57
+ var fChoose = function (pGroupHash, pKey, pRow, pValue)
58
+ {
59
+ var tmpColumn = fColumn(pGroupHash, pKey);
60
+ fSelect(pGroupHash, pKey, pRow).value = pValue;
61
+ fView().inputDataRequestTabular(String(tmpColumn.GroupIndex), String(tmpColumn.InputIndex), String(pRow));
62
+ };
63
+
64
+ var fRun = async function ()
65
+ {
66
+ var tmpStart = Date.now();
67
+ while (!(window._Pict && window._Pict.views.PictFormMetacontroller && window._Pict.views.PictFormMetacontroller.FirstRenderCompleted && fView()))
68
+ {
69
+ if ((Date.now() - tmpStart) > 20000)
70
+ {
71
+ fCheck('the form rendered', false, 'timed out');
72
+ return fPublish();
73
+ }
74
+ await fWait(50);
75
+ }
76
+ await fWait(200);
77
+ var tmpOrder = window._Pict.AppData.Order;
78
+
79
+ fCheck('the catalog graph loaded once, active publishers only', (window._Pict.AppData.Catalog.Graph || []).length === 15, (window._Pict.AppData.Catalog.Graph || []).length);
80
+ fCheck('the Genre list skips the book without a genre (SkipEmpty)', fSame(fOffered('Lines', 'Genre', 1), [ 'History', 'Mystery', 'Poetry', 'Science' ]), fOffered('Lines', 'Genre', 1));
81
+ fCheck('the saved out-of-print book still shows on its own row (KeepCurrentValue)', fSelect('Lines', 'Book', 0).value === '109', fSelect('Lines', 'Book', 0).value);
82
+ fCheck('...but is not offered on another row', fOffered('Lines', 'Book', 1).indexOf('109') < 0, fOffered('Lines', 'Book', 1));
83
+ fCheck('the saved line keeps the price carried when it was picked', tmpOrder.Lines[0].Price === 18, tmpOrder.Lines[0].Price);
84
+
85
+ fChoose('Lines', 'Genre', 1, 'History');
86
+ await fWait(50);
87
+ fCheck('picking History fills its only author', fRow('Lines', 1).Author === 'M. Petrov', fRow('Lines', 1));
88
+ fCheck('...narrows Book to that author\'s in-print books at active publishers', fSame(fOffered('Lines', 'Book', 1), [ '111', '112' ]), fOffered('Lines', 'Book', 1));
89
+ fCheck('...and leaves Book blank because two remain', !fRow('Lines', 1).Book, fRow('Lines', 1));
90
+
91
+ fChoose('Lines', 'Book', 1, '112');
92
+ await fWait(50);
93
+ fCheck('picking a book carries its price and format', (fRow('Lines', 1).Price === 25) && (fRow('Lines', 1).Format === 'Paperback'), fRow('Lines', 1));
94
+ fCheck('the order total sees it in the same solve', Number(tmpOrder.Total) === 61, { Total: tmpOrder.Total, Lines: tmpOrder.Lines });
95
+
96
+ fChoose('Lines', 'Author', 2, 'R. Okafor');
97
+ await fWait(50);
98
+ fCheck('picking an author with one in-print book fills genre and book', (fRow('Lines', 2).Genre === 'Science') && (fRow('Lines', 2).Book === '108') && (fRow('Lines', 2).Price === 24), fRow('Lines', 2));
99
+
100
+ fChoose('Lines', 'Genre', 2, 'Poetry');
101
+ await fWait(50);
102
+ fCheck('changing the genre keeps it and clears the author and book it contradicts', (fRow('Lines', 2).Genre === 'Poetry') && !fRow('Lines', 2).Author && !fRow('Lines', 2).Book && !fRow('Lines', 2).Price, fRow('Lines', 2));
103
+ fCheck('the Author list narrows to the new genre', fSame(fOffered('Lines', 'Author', 2), [ 'A. Marlowe', 'E. Sato' ]), fOffered('Lines', 'Author', 2));
104
+ fCheck('other rows are untouched', fRow('Lines', 1).Book === '112', fRow('Lines', 1));
105
+
106
+ fChoose('CompareLines', 'Book', 0, '104');
107
+ await fWait(50);
108
+ fCheck('symmetric table: picking a book fills its genre and author', (fRow('CompareLines', 0).Genre === 'Mystery') && (fRow('CompareLines', 0).Author === 'C. Duval'), fRow('CompareLines', 0));
109
+ fCheck('symmetric table: that row\'s Genre list now holds only the book\'s genre', fSame(fOffered('CompareLines', 'Genre', 0), [ 'Mystery' ]), fOffered('CompareLines', 'Genre', 0));
110
+ fCheck('left-narrowing table: its Genre list stays whole', fSame(fOffered('Lines', 'Genre', 2), [ 'History', 'Mystery', 'Poetry', 'Science' ]), fOffered('Lines', 'Genre', 2));
111
+
112
+ var tmpLanguageSelect = document.getElementById('SELECT-FOR-' + fView().getInputFromHash('OrderLanguage').Macro.RawHTMLID);
113
+ tmpLanguageSelect.value = 'FR';
114
+ fView().inputDataRequest('OrderLanguage');
115
+ await fWait(50);
116
+ fCheck('a form-level Language narrows every row\'s lists', fSame(fOffered('CompareLines', 'Author', 1), [ 'C. Duval' ]), fOffered('CompareLines', 'Author', 1));
117
+ fCheck('...but a row keeps offering the value it already holds (Poetry stays next to French Mystery)', fSame(fOffered('Lines', 'Genre', 2), [ 'Mystery', 'Poetry' ]), fOffered('Lines', 'Genre', 2));
118
+ fCheck('...without rewriting rows already chosen', fRow('Lines', 1).Book === '112', fRow('Lines', 1));
119
+
120
+ fPublish();
121
+ };
122
+
123
+ fRun().catch(function (pError)
124
+ {
125
+ fCheck('the walkthrough ran', false, String(pError && pError.stack ? pError.stack : pError));
126
+ fPublish();
127
+ });
128
+ })();
@@ -0,0 +1,74 @@
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>Facet Filter - 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
+ /* --- Content Area --- */
22
+ .pict-example-content { padding: 1.5rem; }
23
+ #Pict-Form-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); }
24
+
25
+ /* --- Form Element Styling --- */
26
+ #Pict-Form-Container input[type="text"],
27
+ #Pict-Form-Container input[type="number"],
28
+ #Pict-Form-Container input[type="email"],
29
+ #Pict-Form-Container input[type="date"],
30
+ #Pict-Form-Container textarea,
31
+ #Pict-Form-Container select { border: 1px solid #D4C4A8; background: #FFFCF7; padding: 0.45rem 0.6rem; border-radius: 4px; font-size: 0.9rem; color: #264653; width: 100%; }
32
+ #Pict-Form-Container input:focus,
33
+ #Pict-Form-Container textarea:focus,
34
+ #Pict-Form-Container select:focus { outline: none; border-color: #E76F51; box-shadow: 0 0 0 2px rgba(231,111,81,0.15); }
35
+ #Pict-Form-Container label { color: #264653; font-weight: 600; font-size: 0.85rem; }
36
+ #Pict-Form-Container h2, #Pict-Form-Container h3, #Pict-Form-Container h4 { color: #264653; }
37
+ #Pict-Form-Container button,
38
+ #Pict-Form-Container input[type="button"],
39
+ #Pict-Form-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; }
40
+ #Order-Data { background: #264653; color: #FAEDCD; padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.75rem; max-height: 28rem; overflow: auto; }
41
+ .facet-filter-notes { margin-top: 1rem; font-size: 0.85rem; }
42
+ </style>
43
+ <script src="./pict.min.js" type="text/javascript"></script>
44
+ <script type="text/javascript">Pict.safeOnDocumentReady(() => { Pict.safeLoadPictApplication(FacetFilterApplication, 1)});</script>
45
+ </head>
46
+ <body>
47
+ <div class="pict-example-header">
48
+ <div class="pict-example-badge">
49
+ <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>
50
+ Pict Example
51
+ </div>
52
+ <div class="pict-example-app-name">Facet Filter</div>
53
+ <div class="pict-example-module">pict-section-form</div>
54
+ </div>
55
+ <div class="pict-example-content">
56
+ <div id="Pict-Form-Container"></div>
57
+ <div class="facet-filter-notes">
58
+ <p><strong>AppData.Order</strong>, live (what the rows store):</p>
59
+ <pre id="Order-Data"></pre>
60
+ </div>
61
+ </div>
62
+ <script src="./facet_filter_application.js" type="text/javascript"></script>
63
+ <script src="./Facet-Filter-Smoke.js" type="text/javascript"></script>
64
+ <script type="text/javascript">
65
+ setInterval(function ()
66
+ {
67
+ if (window._Pict && window._Pict.AppData && window._Pict.AppData.Order)
68
+ {
69
+ document.getElementById('Order-Data').textContent = JSON.stringify(window._Pict.AppData.Order, null, 2);
70
+ }
71
+ }, 500);
72
+ </script>
73
+ </body>
74
+ </html>