@disy/cadenza.js 1.4.0 → 1.6.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/apidoc/assets/main.js +4 -3
- package/apidoc/assets/navigation.js +1 -0
- package/apidoc/assets/search.js +1 -1
- package/apidoc/assets/style.css +26 -10
- package/apidoc/classes/AbortError.html +6 -494
- package/apidoc/classes/CadenzaClient.html +85 -760
- package/apidoc/classes/CadenzaError.html +11 -227
- package/apidoc/functions/cadenza.html +8 -102
- package/apidoc/index.html +7 -110
- package/apidoc/interfaces/CadenzaEvent.html +5 -110
- package/apidoc/interfaces/ExternalLinkKey.html +5 -104
- package/apidoc/interfaces/Geometry.html +4 -95
- package/apidoc/interfaces/PageSource.html +4 -95
- package/apidoc/interfaces/WorkbookKey.html +5 -104
- package/apidoc/interfaces/WorkbookViewKey.html +6 -113
- package/apidoc/interfaces/WorksheetKey.html +6 -113
- package/apidoc/modules.html +16 -88
- package/apidoc/types/CadenzaErrorEvent.html +2 -74
- package/apidoc/types/EmbeddingTargetId.html +2 -67
- package/apidoc/types/Extent.html +2 -67
- package/apidoc/types/GeometryType.html +2 -67
- package/apidoc/types/GlobalId.html +2 -67
- package/apidoc/types/MediaType.html +2 -67
- package/apidoc/types/OperationMode.html +2 -67
- package/apidoc/types/TablePart.html +2 -67
- package/apidoc/types/UiFeature.html +2 -67
- package/apidoc/types/WorkbookSource.html +2 -67
- package/apidoc/types/WorkbookViewSource.html +2 -67
- package/apidoc/types/WorksheetSource.html +2 -67
- package/cadenza.js +1 -1
- package/package.json +7 -7
- package/sandbox.cjs +7 -1
- package/sandbox.html +109 -156
package/sandbox.html
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
label {
|
|
42
42
|
font-weight: 600;
|
|
43
43
|
}
|
|
44
|
-
select, input:is(:not([type]), [type=text], [type=number]), textarea {
|
|
44
|
+
select, input:is(:not([type]), [type=text], [type=number]), textarea, hr {
|
|
45
45
|
display: block;
|
|
46
46
|
width: 100%
|
|
47
47
|
}
|
|
@@ -57,6 +57,12 @@
|
|
|
57
57
|
const action = actionSelect.value;
|
|
58
58
|
const settingsTemplate = document.querySelector(`[data-action=${action}]`);
|
|
59
59
|
settingsContainer.append(settingsTemplate.content.cloneNode(true));
|
|
60
|
+
const commonSettingsTemplate = document.getElementById(`common-${settingsTemplate.dataset.common}`);
|
|
61
|
+
if (commonSettingsTemplate) {
|
|
62
|
+
settingsContainer.append(
|
|
63
|
+
document.createElement('hr'),
|
|
64
|
+
commonSettingsTemplate.content.cloneNode(true));
|
|
65
|
+
}
|
|
60
66
|
|
|
61
67
|
const data = localStorage.getItem(`cadenzajs-sandbox-${action}`);
|
|
62
68
|
if (data) {
|
|
@@ -68,66 +74,21 @@
|
|
|
68
74
|
history.replaceState(null, '', url);
|
|
69
75
|
};
|
|
70
76
|
|
|
71
|
-
const contextPath = new URLSearchParams(location.search).get('contextPath')
|
|
77
|
+
const contextPath = new URLSearchParams(location.search).get('contextPath')
|
|
78
|
+
?? location.pathname.slice(0, location.pathname.indexOf('/sandbox'));
|
|
72
79
|
const cadenzaClient = cadenza(location.origin + contextPath, { iframe: 'iframe', debug: true });
|
|
73
80
|
const actionHandlers = {
|
|
74
|
-
show (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
...(operationMode === 'on' && { operationMode: 'normal' }),
|
|
82
|
-
disabledUiFeatures: disabledUiFeatures && disabledUiFeatures.split(',')
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
showPage ({ page, expandNavigator, highlightGlobalId }) {
|
|
86
|
-
cadenzaClient.show({ page: page }, {
|
|
87
|
-
expandNavigator: (expandNavigator === 'on'),
|
|
88
|
-
highlightGlobalId
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
expandNavigator ({ expandNavigator }) {
|
|
92
|
-
cadenzaClient.expandNavigator(expandNavigator === 'on');
|
|
93
|
-
},
|
|
94
|
-
showMap ({ embeddingTargetId, useMapSrs, geometry, mapExtent, locationFinder, highlightGlobalId }) {
|
|
95
|
-
cadenzaClient.showMap(embeddingTargetId, {
|
|
96
|
-
useMapSrs: useMapSrs === 'on',
|
|
97
|
-
geometry: geometry && JSON.parse(geometry),
|
|
98
|
-
mapExtent: mapExtent && mapExtent.split(','),
|
|
99
|
-
locationFinder,
|
|
100
|
-
highlightGlobalId
|
|
101
|
-
});
|
|
102
|
-
},
|
|
103
|
-
createGeometry ({ embeddingTargetId, geometryType, useMapSrs, minScale, mapExtent, locationFinder }) {
|
|
104
|
-
cadenzaClient.createGeometry(embeddingTargetId, geometryType, {
|
|
105
|
-
useMapSrs: useMapSrs === 'on',
|
|
106
|
-
minScale,
|
|
107
|
-
mapExtent: mapExtent && mapExtent.split(','),
|
|
108
|
-
locationFinder
|
|
109
|
-
});
|
|
110
|
-
},
|
|
111
|
-
editGeometry ({ embeddingTargetId, geometry, useMapSrs, minScale, mapExtent, locationFinder }) {
|
|
112
|
-
cadenzaClient.editGeometry(embeddingTargetId, JSON.parse(geometry), {
|
|
113
|
-
useMapSrs: useMapSrs === 'on',
|
|
114
|
-
minScale,
|
|
115
|
-
mapExtent: mapExtent && mapExtent.split(','),
|
|
116
|
-
locationFinder
|
|
117
|
-
});
|
|
118
|
-
},
|
|
119
|
-
fetchData ({ embeddingTargetId, mediaType, parts }) {
|
|
81
|
+
show: data => cadenzaClient.show(data.embeddingTargetId, getOptions(data)),
|
|
82
|
+
showPage: data => cadenzaClient.show({ page: data.page }, getOptions(data)),
|
|
83
|
+
expandNavigator: data => cadenzaClient.expandNavigator(data.expandNavigator === 'on'),
|
|
84
|
+
showMap: data => cadenzaClient.showMap(data.embeddingTargetId, getOptions(data)),
|
|
85
|
+
createGeometry: data => cadenzaClient.createGeometry(data.embeddingTargetId, data.geometryType, getOptions(data)),
|
|
86
|
+
editGeometry: data => cadenzaClient.editGeometry(data.embeddingTargetId, JSON.parse(data.geometry), getOptions(data)),
|
|
87
|
+
fetchData: data => {
|
|
120
88
|
console.log('Inspect the fetchData() request in the devtools.');
|
|
121
|
-
cadenzaClient.fetchData(embeddingTargetId, mediaType,
|
|
122
|
-
parts: parts && parts.split(',')
|
|
123
|
-
});
|
|
89
|
+
cadenzaClient.fetchData(data.embeddingTargetId, data.mediaType, getOptions(data));
|
|
124
90
|
},
|
|
125
|
-
downloadData (
|
|
126
|
-
cadenzaClient.downloadData(embeddingTargetId, mediaType, {
|
|
127
|
-
fileName,
|
|
128
|
-
parts: parts && parts.split(',')
|
|
129
|
-
});
|
|
130
|
-
}
|
|
91
|
+
downloadData: data => cadenzaClient.downloadData(data.embeddingTargetId, data.mediaType, getOptions(data))
|
|
131
92
|
};
|
|
132
93
|
|
|
133
94
|
const form = document.getElementById('form');
|
|
@@ -153,6 +114,40 @@
|
|
|
153
114
|
}
|
|
154
115
|
}
|
|
155
116
|
}
|
|
117
|
+
|
|
118
|
+
function getOptions ({
|
|
119
|
+
disabledUiFeatures,
|
|
120
|
+
expandNavigator,
|
|
121
|
+
geometry,
|
|
122
|
+
hideMainHeaderAndFooter,
|
|
123
|
+
hideWorkbookToolBar,
|
|
124
|
+
highlightGlobalId,
|
|
125
|
+
jasperReportAsPdf,
|
|
126
|
+
labelSet,
|
|
127
|
+
locationFinder,
|
|
128
|
+
mapExtent,
|
|
129
|
+
minScale,
|
|
130
|
+
parts,
|
|
131
|
+
simplifiedOperationMode,
|
|
132
|
+
useMapSrs
|
|
133
|
+
}) {
|
|
134
|
+
return {
|
|
135
|
+
disabledUiFeatures: disabledUiFeatures && disabledUiFeatures.split(','),
|
|
136
|
+
expandNavigator: (expandNavigator === 'on'),
|
|
137
|
+
geometry: geometry && JSON.parse(geometry),
|
|
138
|
+
hideMainHeaderAndFooter: (hideMainHeaderAndFooter === 'on'),
|
|
139
|
+
hideWorkbookToolBar: (hideWorkbookToolBar === 'on'),
|
|
140
|
+
highlightGlobalId,
|
|
141
|
+
...(jasperReportAsPdf === 'on' && { mediaType: 'application/pdf' }),
|
|
142
|
+
labelSet,
|
|
143
|
+
locationFinder,
|
|
144
|
+
mapExtent: mapExtent && mapExtent.split(','),
|
|
145
|
+
minScale,
|
|
146
|
+
parts: parts && parts.split(','),
|
|
147
|
+
...(simplifiedOperationMode === 'on' && { operationMode: 'simplified' }),
|
|
148
|
+
useMapSrs: useMapSrs === 'on'
|
|
149
|
+
};
|
|
150
|
+
}
|
|
156
151
|
</script>
|
|
157
152
|
</head>
|
|
158
153
|
<body>
|
|
@@ -184,17 +179,7 @@
|
|
|
184
179
|
<iframe id="iframe"></iframe>
|
|
185
180
|
</main>
|
|
186
181
|
|
|
187
|
-
<template
|
|
188
|
-
<div>
|
|
189
|
-
<label for="embeddingTargetId">Embedding target ID *</label>
|
|
190
|
-
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
191
|
-
</div>
|
|
192
|
-
<div>
|
|
193
|
-
<label>
|
|
194
|
-
<input type="checkbox" name="jasperReportAsPdf" id="jasperReportAsPdf"/>
|
|
195
|
-
Show Jasper Report as PDF
|
|
196
|
-
</label>
|
|
197
|
-
</div>
|
|
182
|
+
<template id="common-show">
|
|
198
183
|
<div>
|
|
199
184
|
<label>
|
|
200
185
|
<input type="checkbox" name="expandNavigator">
|
|
@@ -215,8 +200,8 @@
|
|
|
215
200
|
</div>
|
|
216
201
|
<div>
|
|
217
202
|
<label>
|
|
218
|
-
<input type="checkbox" name="
|
|
219
|
-
|
|
203
|
+
<input type="checkbox" name="simplifiedOperationMode">
|
|
204
|
+
Simplified operation mode
|
|
220
205
|
</label>
|
|
221
206
|
</div>
|
|
222
207
|
<div>
|
|
@@ -229,23 +214,63 @@
|
|
|
229
214
|
</div>
|
|
230
215
|
</template>
|
|
231
216
|
|
|
232
|
-
<template
|
|
217
|
+
<template id="common-map">
|
|
233
218
|
<div>
|
|
234
|
-
<label
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
219
|
+
<label>
|
|
220
|
+
<input type="checkbox" name="useMapSrs">
|
|
221
|
+
Use map SRS
|
|
222
|
+
</label>
|
|
223
|
+
</div>
|
|
224
|
+
<div>
|
|
225
|
+
<label for="mapExtent">Map extent coordinates</label>
|
|
226
|
+
<input name="mapExtent" id="mapExtent" placeholder="minX,minY,maxX,maxY">
|
|
227
|
+
</div>
|
|
228
|
+
<div>
|
|
229
|
+
<label for="locationFinder">Location finder search query</label>
|
|
230
|
+
<input name="locationFinder" id="locationFinder">
|
|
231
|
+
</div>
|
|
232
|
+
</template>
|
|
233
|
+
|
|
234
|
+
<template id="common-data">
|
|
235
|
+
<div>
|
|
236
|
+
<label for="mediaType">Media type *</label>
|
|
237
|
+
<select name="mediaType" id="mediaType" required>
|
|
238
|
+
<option>text/csv</option>
|
|
239
|
+
<option>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</option>
|
|
240
|
+
<option>application/json</option>
|
|
241
|
+
<option>application/pdf</option>
|
|
238
242
|
</select>
|
|
239
243
|
</div>
|
|
244
|
+
<div>
|
|
245
|
+
<label for="parts">Parts</label>
|
|
246
|
+
<input name="parts" id="parts" placeholder="columns,values,totals">
|
|
247
|
+
</div>
|
|
248
|
+
</template>
|
|
249
|
+
|
|
250
|
+
<template data-action="show" data-common="show">
|
|
251
|
+
<div>
|
|
252
|
+
<label for="embeddingTargetId">Embedding target ID *</label>
|
|
253
|
+
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
254
|
+
</div>
|
|
240
255
|
<div>
|
|
241
256
|
<label>
|
|
242
|
-
<input type="checkbox" name="
|
|
243
|
-
|
|
257
|
+
<input type="checkbox" name="jasperReportAsPdf" id="jasperReportAsPdf"/>
|
|
258
|
+
Show Jasper Report as PDF
|
|
244
259
|
</label>
|
|
245
260
|
</div>
|
|
261
|
+
</template>
|
|
262
|
+
|
|
263
|
+
<template data-action="showPage" data-common="show">
|
|
246
264
|
<div>
|
|
247
|
-
<label for="
|
|
248
|
-
<
|
|
265
|
+
<label for="page">Page *</label>
|
|
266
|
+
<select name="page" id="page" required>
|
|
267
|
+
<option>welcome</option>
|
|
268
|
+
<option>an-invalid-page-name</option>
|
|
269
|
+
</select>
|
|
270
|
+
</div>
|
|
271
|
+
<div>
|
|
272
|
+
<label for="labelSet">Label Set</label>
|
|
273
|
+
<input name="labelSet" id="labelSet">
|
|
249
274
|
</div>
|
|
250
275
|
</template>
|
|
251
276
|
|
|
@@ -258,46 +283,22 @@
|
|
|
258
283
|
</div>
|
|
259
284
|
</template>
|
|
260
285
|
|
|
261
|
-
<template data-action="showMap">
|
|
286
|
+
<template data-action="showMap" data-common="show">
|
|
262
287
|
<div>
|
|
263
288
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
264
289
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
265
290
|
</div>
|
|
266
|
-
<div>
|
|
267
|
-
<label>
|
|
268
|
-
<input type="checkbox" name="useMapSrs">
|
|
269
|
-
Use map SRS
|
|
270
|
-
</label>
|
|
271
|
-
</div>
|
|
272
291
|
<div>
|
|
273
292
|
<label for="geometry">Geometry (GeoJSON)</label>
|
|
274
293
|
<textarea name="geometry" id="geometry" rows="5"></textarea>
|
|
275
294
|
</div>
|
|
276
|
-
<div>
|
|
277
|
-
<label for="mapExtent">Map extent coordinates</label>
|
|
278
|
-
<input name="mapExtent" id="mapExtent" placeholder="minX,minY,maxX,maxY">
|
|
279
|
-
</div>
|
|
280
|
-
<div>
|
|
281
|
-
<label for="locationFinder">Location finder search query</label>
|
|
282
|
-
<input name="locationFinder" id="locationFinder">
|
|
283
|
-
</div>
|
|
284
|
-
<div>
|
|
285
|
-
<label for="highlightGlobalId">Highlighted Global ID</label>
|
|
286
|
-
<input name="highlightGlobalId" id="highlightGlobalId">
|
|
287
|
-
</div>
|
|
288
295
|
</template>
|
|
289
296
|
|
|
290
|
-
<template data-action="createGeometry">
|
|
297
|
+
<template data-action="createGeometry" data-common="map">
|
|
291
298
|
<div>
|
|
292
299
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
293
300
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
294
301
|
</div>
|
|
295
|
-
<div>
|
|
296
|
-
<label>
|
|
297
|
-
<input type="checkbox" name="useMapSrs">
|
|
298
|
-
Use map SRS
|
|
299
|
-
</label>
|
|
300
|
-
</div>
|
|
301
302
|
<div>
|
|
302
303
|
<label for="geometryType">Geometry type</label>
|
|
303
304
|
<select name="geometryType" id="geometryType">
|
|
@@ -313,27 +314,13 @@
|
|
|
313
314
|
<label for="minScale">Minimum Scale</label>
|
|
314
315
|
<input type="number" name="minScale" id="minScale">
|
|
315
316
|
</div>
|
|
316
|
-
<div>
|
|
317
|
-
<label for="mapExtent">Map extent coordinates</label>
|
|
318
|
-
<input name="mapExtent" id="mapExtent" placeholder="minX,minY,maxX,maxY">
|
|
319
|
-
</div>
|
|
320
|
-
<div>
|
|
321
|
-
<label for="locationFinder">Location finder search query</label>
|
|
322
|
-
<input name="locationFinder" id="locationFinder">
|
|
323
|
-
</div>
|
|
324
317
|
</template>
|
|
325
318
|
|
|
326
|
-
<template data-action="editGeometry">
|
|
319
|
+
<template data-action="editGeometry" data-common="map">
|
|
327
320
|
<div>
|
|
328
321
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
329
322
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
330
323
|
</div>
|
|
331
|
-
<div>
|
|
332
|
-
<label>
|
|
333
|
-
<input type="checkbox" name="useMapSrs">
|
|
334
|
-
Use map SRS
|
|
335
|
-
</label>
|
|
336
|
-
</div>
|
|
337
324
|
<div>
|
|
338
325
|
<label for="geometry">Geometry (GeoJSON) *</label>
|
|
339
326
|
<textarea name="geometry" id="geometry" rows="5" required></textarea>
|
|
@@ -342,58 +329,24 @@
|
|
|
342
329
|
<label for="minScale">Minimum Scale</label>
|
|
343
330
|
<input type="number" name="minScale" id="minScale">
|
|
344
331
|
</div>
|
|
345
|
-
<div>
|
|
346
|
-
<label for="mapExtent">Map extent coordinates</label>
|
|
347
|
-
<input name="mapExtent" id="mapExtent" placeholder="minX,minY,maxX,maxY">
|
|
348
|
-
</div>
|
|
349
|
-
<div>
|
|
350
|
-
<label for="locationFinder">Location finder search query</label>
|
|
351
|
-
<input name="locationFinder" id="locationFinder">
|
|
352
|
-
</div>
|
|
353
332
|
</template>
|
|
354
333
|
|
|
355
|
-
<template data-action="downloadData">
|
|
334
|
+
<template data-action="downloadData" data-common="data">
|
|
356
335
|
<div>
|
|
357
336
|
<label for="embeddingTargetId">Embedding target ID *</label>
|
|
358
337
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
359
338
|
</div>
|
|
360
|
-
<div>
|
|
361
|
-
<label for="parts">Parts</label>
|
|
362
|
-
<input name="parts" id="parts" placeholder="columns,values,totals">
|
|
363
|
-
</div>
|
|
364
|
-
<div>
|
|
365
|
-
<label for="mediaType">Media type *</label>
|
|
366
|
-
<select name="mediaType" id="mediaType" required>
|
|
367
|
-
<option>text/csv</option>
|
|
368
|
-
<option>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</option>
|
|
369
|
-
<option>application/json</option>
|
|
370
|
-
<option>application/pdf</option>
|
|
371
|
-
</select>
|
|
372
|
-
</div>
|
|
373
339
|
<div>
|
|
374
340
|
<label for="fileName">Filename</label>
|
|
375
341
|
<input name="fileName" id="fileName">
|
|
376
342
|
</div>
|
|
377
343
|
</template>
|
|
378
344
|
|
|
379
|
-
<template data-action="fetchData">
|
|
345
|
+
<template data-action="fetchData" data-common="data">
|
|
380
346
|
<div>
|
|
381
347
|
<label for="embeddingTargetId">Embedding target ID *</label>
|
|
382
348
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
383
349
|
</div>
|
|
384
|
-
<div>
|
|
385
|
-
<label for="parts">Parts</label>
|
|
386
|
-
<input name="parts" id="parts" placeholder="columns,values,totals">
|
|
387
|
-
</div>
|
|
388
|
-
<div>
|
|
389
|
-
<label for="mediaType">Media type *</label>
|
|
390
|
-
<select name="mediaType" id="mediaType" required>
|
|
391
|
-
<option>text/csv</option>
|
|
392
|
-
<option>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</option>
|
|
393
|
-
<option>application/json</option>
|
|
394
|
-
<option>application/pdf</option>
|
|
395
|
-
</select>
|
|
396
|
-
</div>
|
|
397
350
|
</template>
|
|
398
351
|
|
|
399
352
|
</body>
|