@disy/cadenza.js 1.3.0 → 1.5.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 +12 -0
- package/README.md +48 -13
- 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 -495
- package/apidoc/classes/CadenzaClient.html +85 -756
- package/apidoc/classes/CadenzaError.html +11 -228
- package/apidoc/functions/cadenza.html +8 -103
- package/apidoc/index.html +31 -107
- package/apidoc/interfaces/CadenzaEvent.html +5 -111
- package/apidoc/interfaces/ExternalLinkKey.html +5 -105
- package/apidoc/interfaces/Geometry.html +4 -96
- package/apidoc/interfaces/PageSource.html +4 -96
- package/apidoc/interfaces/WorkbookKey.html +5 -105
- package/apidoc/interfaces/WorkbookViewKey.html +6 -114
- package/apidoc/interfaces/WorksheetKey.html +6 -114
- package/apidoc/modules.html +16 -90
- package/apidoc/types/CadenzaErrorEvent.html +2 -75
- package/apidoc/types/EmbeddingTargetId.html +2 -68
- package/apidoc/types/Extent.html +2 -68
- package/apidoc/types/GeometryType.html +2 -68
- package/apidoc/types/GlobalId.html +2 -68
- package/apidoc/types/MediaType.html +2 -68
- package/apidoc/types/OperationMode.html +2 -68
- package/apidoc/types/TablePart.html +2 -68
- package/apidoc/types/UiFeature.html +2 -68
- package/apidoc/types/WorkbookSource.html +2 -68
- package/apidoc/types/WorkbookViewSource.html +2 -68
- package/apidoc/types/WorksheetSource.html +2 -68
- package/cadenza.d.ts +31 -29
- package/cadenza.js +32 -33
- package/package.json +7 -7
- package/sandbox.cjs +8 -2
- package/sandbox.html +7 -2
- package/apidoc/types/PageType.html +0 -68
package/cadenza.d.ts
CHANGED
|
@@ -37,6 +37,10 @@ export function cadenza(baseUrl: string, options?: {
|
|
|
37
37
|
* @property {string} workbookId - The ID of the workbook
|
|
38
38
|
* @property {string} viewId - The ID of the view
|
|
39
39
|
*/
|
|
40
|
+
/**
|
|
41
|
+
* @typedef PageSource - A well-known Cadenza page
|
|
42
|
+
* @property {'welcome'} page - The name of the page (Only `"welcome"` is currently supported.)
|
|
43
|
+
*/
|
|
40
44
|
/** @typedef {EmbeddingTargetId | WorkbookKey} WorkbookSource - A workbook source */
|
|
41
45
|
/** @typedef {EmbeddingTargetId | WorksheetKey} WorksheetSource - A worksheet source */
|
|
42
46
|
/** @typedef {EmbeddingTargetId | WorkbookViewKey} WorkbookViewSource - A workbook view source */
|
|
@@ -48,12 +52,6 @@ export function cadenza(baseUrl: string, options?: {
|
|
|
48
52
|
* * 'workbook-design' - The workbook designer
|
|
49
53
|
* * 'workbook-view-management' - Add/Edit/Remove workbook views (Is included in 'workbook-design'.)
|
|
50
54
|
* */
|
|
51
|
-
/**
|
|
52
|
-
* @typedef PageSource - A well-known Cadenza page
|
|
53
|
-
* @property {PageType} page - The name of the page
|
|
54
|
-
*
|
|
55
|
-
* @typedef {'welcome'} PageType - A Cadenza well-known page name
|
|
56
|
-
*/
|
|
57
55
|
/**
|
|
58
56
|
* @typedef Geometry - A [GeoJSON](https://geojson.org/) geometry object
|
|
59
57
|
* @property {GeometryType} type - The type of the geometry
|
|
@@ -64,6 +62,12 @@ export function cadenza(baseUrl: string, options?: {
|
|
|
64
62
|
* _Note:_ The GeoJSON geometry type "GeometryCollection" is currently not supported.
|
|
65
63
|
*/
|
|
66
64
|
/** @typedef {[number,number,number,number]} Extent - An array of numbers representing an extent: [minx, miny, maxx, maxy] */
|
|
65
|
+
/**
|
|
66
|
+
* @typedef {string} MediaType - A media type
|
|
67
|
+
*
|
|
68
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types}
|
|
69
|
+
*/
|
|
70
|
+
/** @typedef {'columns' | 'values' | 'totals'} TablePart - A part of a table to export. */
|
|
67
71
|
/**
|
|
68
72
|
* _Notes:_
|
|
69
73
|
* * Most public methods can be aborted using an [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal).
|
|
@@ -100,6 +104,7 @@ export class CadenzaClient {
|
|
|
100
104
|
* @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
|
|
101
105
|
* @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
|
|
102
106
|
* @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
|
|
107
|
+
* @param {String} [options.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
|
|
103
108
|
* @param {MediaType} [options.mediaType] - Set to 'application/pdf' for views of type "JasperReports report"
|
|
104
109
|
* to show the report PDF directly, without any Cadenza headers or footers.
|
|
105
110
|
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
@@ -107,12 +112,13 @@ export class CadenzaClient {
|
|
|
107
112
|
* @return {Promise<void>} A Promise for when the iframe is loaded
|
|
108
113
|
* @throws For invalid arguments
|
|
109
114
|
*/
|
|
110
|
-
show(source: PageSource | WorkbookSource | WorksheetSource | WorkbookViewSource, { disabledUiFeatures, expandNavigator, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, mediaType, operationMode, signal, }?: {
|
|
115
|
+
show(source: PageSource | WorkbookSource | WorksheetSource | WorkbookViewSource, { disabledUiFeatures, expandNavigator, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, mediaType, operationMode, signal, }?: {
|
|
111
116
|
disabledUiFeatures?: UiFeature[] | undefined;
|
|
112
117
|
expandNavigator?: boolean | undefined;
|
|
113
118
|
hideMainHeaderAndFooter?: boolean | undefined;
|
|
114
119
|
hideWorkbookToolBar?: boolean | undefined;
|
|
115
120
|
highlightGlobalId?: string | undefined;
|
|
121
|
+
labelSet?: string | undefined;
|
|
116
122
|
mediaType?: string | undefined;
|
|
117
123
|
operationMode?: OperationMode | undefined;
|
|
118
124
|
signal?: AbortSignal | undefined;
|
|
@@ -150,11 +156,11 @@ export class CadenzaClient {
|
|
|
150
156
|
signal?: AbortSignal | undefined;
|
|
151
157
|
} | undefined): Promise<void>;
|
|
152
158
|
/**
|
|
153
|
-
* Expand/collapse the navigator
|
|
159
|
+
* Expand/collapse the navigator.
|
|
154
160
|
*
|
|
155
|
-
* @param {boolean}
|
|
161
|
+
* @param {boolean} expanded - The expansion state of the navigator
|
|
156
162
|
*/
|
|
157
|
-
expandNavigator(
|
|
163
|
+
expandNavigator(expanded?: boolean): void;
|
|
158
164
|
/**
|
|
159
165
|
* Create a geometry.
|
|
160
166
|
*
|
|
@@ -225,7 +231,7 @@ export class CadenzaClient {
|
|
|
225
231
|
* * 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' (Excel)
|
|
226
232
|
* * 'text/csv'
|
|
227
233
|
* @param {object} options - Options
|
|
228
|
-
* @param {TablePart[]} [options.parts] -
|
|
234
|
+
* @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
|
|
229
235
|
* @param {AbortSignal} [options.signal] - A signal to abort the data fetching
|
|
230
236
|
* @return {Promise<Response>} A Promise for the fetch response
|
|
231
237
|
* @throws For invalid arguments
|
|
@@ -247,7 +253,7 @@ export class CadenzaClient {
|
|
|
247
253
|
* * 'text/csv'
|
|
248
254
|
* @param {object} options - Options
|
|
249
255
|
* @param {string} [options.fileName] - The file name to use; The file extension is appended by Cadenza.
|
|
250
|
-
* @param {TablePart[]} [options.parts] -
|
|
256
|
+
* @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
|
|
251
257
|
* @throws For invalid arguments
|
|
252
258
|
*/
|
|
253
259
|
downloadData(source: WorkbookViewSource, mediaType: MediaType, { fileName, parts }: {
|
|
@@ -280,10 +286,6 @@ export class CadenzaError extends Error {
|
|
|
280
286
|
get type(): string;
|
|
281
287
|
#private;
|
|
282
288
|
}
|
|
283
|
-
/**
|
|
284
|
-
* - A part of a table to export.
|
|
285
|
-
*/
|
|
286
|
-
export type TablePart = 'columns' | 'values' | 'totals';
|
|
287
289
|
/**
|
|
288
290
|
* - The ID of an embedding target
|
|
289
291
|
*/
|
|
@@ -352,6 +354,15 @@ export type WorkbookViewKey = {
|
|
|
352
354
|
*/
|
|
353
355
|
viewId: string;
|
|
354
356
|
};
|
|
357
|
+
/**
|
|
358
|
+
* - A well-known Cadenza page
|
|
359
|
+
*/
|
|
360
|
+
export type PageSource = {
|
|
361
|
+
/**
|
|
362
|
+
* - The name of the page (Only `"welcome"` is currently supported.)
|
|
363
|
+
*/
|
|
364
|
+
page: 'welcome';
|
|
365
|
+
};
|
|
355
366
|
/**
|
|
356
367
|
* - A workbook source
|
|
357
368
|
*/
|
|
@@ -376,19 +387,6 @@ export type OperationMode = 'normal' | 'simplified';
|
|
|
376
387
|
* * 'workbook-view-management' - Add/Edit/Remove workbook views (Is included in 'workbook-design'.)
|
|
377
388
|
*/
|
|
378
389
|
export type UiFeature = 'workbook-design' | 'workbook-view-management';
|
|
379
|
-
/**
|
|
380
|
-
* - A well-known Cadenza page
|
|
381
|
-
*/
|
|
382
|
-
export type PageSource = {
|
|
383
|
-
/**
|
|
384
|
-
* - The name of the page
|
|
385
|
-
*/
|
|
386
|
-
page: PageType;
|
|
387
|
-
};
|
|
388
|
-
/**
|
|
389
|
-
* - A Cadenza well-known page name
|
|
390
|
-
*/
|
|
391
|
-
export type PageType = 'welcome';
|
|
392
390
|
/**
|
|
393
391
|
* - A [GeoJSON](https://geojson.org/) geometry object
|
|
394
392
|
*/
|
|
@@ -414,6 +412,10 @@ export type Extent = [number, number, number, number];
|
|
|
414
412
|
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types}
|
|
415
413
|
*/
|
|
416
414
|
export type MediaType = string;
|
|
415
|
+
/**
|
|
416
|
+
* - A part of a table to export.
|
|
417
|
+
*/
|
|
418
|
+
export type TablePart = 'columns' | 'values' | 'totals';
|
|
417
419
|
/**
|
|
418
420
|
* - A Cadenza `postMessage()` event
|
|
419
421
|
*/
|
package/cadenza.js
CHANGED
|
@@ -43,6 +43,10 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
43
43
|
* @property {string} workbookId - The ID of the workbook
|
|
44
44
|
* @property {string} viewId - The ID of the view
|
|
45
45
|
*/
|
|
46
|
+
/**
|
|
47
|
+
* @typedef PageSource - A well-known Cadenza page
|
|
48
|
+
* @property {'welcome'} page - The name of the page (Only `"welcome"` is currently supported.)
|
|
49
|
+
*/
|
|
46
50
|
/** @typedef {EmbeddingTargetId | WorkbookKey} WorkbookSource - A workbook source */
|
|
47
51
|
/** @typedef {EmbeddingTargetId | WorksheetKey} WorksheetSource - A worksheet source */
|
|
48
52
|
/** @typedef {EmbeddingTargetId | WorkbookViewKey} WorkbookViewSource - A workbook view source */
|
|
@@ -54,12 +58,6 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
54
58
|
* * 'workbook-design' - The workbook designer
|
|
55
59
|
* * 'workbook-view-management' - Add/Edit/Remove workbook views (Is included in 'workbook-design'.)
|
|
56
60
|
* */
|
|
57
|
-
/**
|
|
58
|
-
* @typedef PageSource - A well-known Cadenza page
|
|
59
|
-
* @property {PageType} page - The name of the page
|
|
60
|
-
*
|
|
61
|
-
* @typedef {'welcome'} PageType - A Cadenza well-known page name
|
|
62
|
-
*/
|
|
63
61
|
/**
|
|
64
62
|
* @typedef Geometry - A [GeoJSON](https://geojson.org/) geometry object
|
|
65
63
|
* @property {GeometryType} type - The type of the geometry
|
|
@@ -70,6 +68,12 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
70
68
|
* _Note:_ The GeoJSON geometry type "GeometryCollection" is currently not supported.
|
|
71
69
|
*/
|
|
72
70
|
/** @typedef {[number,number,number,number]} Extent - An array of numbers representing an extent: [minx, miny, maxx, maxy] */
|
|
71
|
+
/**
|
|
72
|
+
* @typedef {string} MediaType - A media type
|
|
73
|
+
*
|
|
74
|
+
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types}
|
|
75
|
+
*/
|
|
76
|
+
/** @typedef {'columns' | 'values' | 'totals'} TablePart - A part of a table to export. */
|
|
73
77
|
/**
|
|
74
78
|
* _Notes:_
|
|
75
79
|
* * Most public methods can be aborted using an [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal).
|
|
@@ -148,6 +152,7 @@ export class CadenzaClient {
|
|
|
148
152
|
* @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
|
|
149
153
|
* @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
|
|
150
154
|
* @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
|
|
155
|
+
* @param {String} [options.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
|
|
151
156
|
* @param {MediaType} [options.mediaType] - Set to 'application/pdf' for views of type "JasperReports report"
|
|
152
157
|
* to show the report PDF directly, without any Cadenza headers or footers.
|
|
153
158
|
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
@@ -155,19 +160,25 @@ export class CadenzaClient {
|
|
|
155
160
|
* @return {Promise<void>} A Promise for when the iframe is loaded
|
|
156
161
|
* @throws For invalid arguments
|
|
157
162
|
*/
|
|
158
|
-
show(source, { disabledUiFeatures, expandNavigator, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, mediaType, operationMode, signal, } = {}) {
|
|
163
|
+
show(source, { disabledUiFeatures, expandNavigator, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, mediaType, operationMode, signal, } = {}) {
|
|
159
164
|
this.#log('CadenzaClient#show', source);
|
|
160
165
|
if (mediaType) {
|
|
161
166
|
assertSupportedMediaType(mediaType, [MediaType.PDF]);
|
|
162
167
|
}
|
|
168
|
+
if (labelSet) {
|
|
169
|
+
assert(typeof source !== 'string' &&
|
|
170
|
+
'page' in source &&
|
|
171
|
+
source.page === 'welcome', 'labelSet is only supported on the welcome page');
|
|
172
|
+
}
|
|
163
173
|
const params = createParams({
|
|
164
174
|
disabledUiFeatures,
|
|
165
175
|
expandNavigator,
|
|
166
176
|
hideMainHeaderAndFooter,
|
|
167
177
|
hideWorkbookToolBar,
|
|
168
178
|
highlightGlobalId,
|
|
169
|
-
|
|
179
|
+
labelSet,
|
|
170
180
|
mediaType,
|
|
181
|
+
operationMode,
|
|
171
182
|
webApplication: this.#webApplication,
|
|
172
183
|
});
|
|
173
184
|
return this.#show(resolvePath(source), params, signal);
|
|
@@ -212,13 +223,13 @@ export class CadenzaClient {
|
|
|
212
223
|
this.#postEvent('setGeometry', { geometry });
|
|
213
224
|
}
|
|
214
225
|
/**
|
|
215
|
-
* Expand/collapse the navigator
|
|
226
|
+
* Expand/collapse the navigator.
|
|
216
227
|
*
|
|
217
|
-
* @param {boolean}
|
|
228
|
+
* @param {boolean} expanded - The expansion state of the navigator
|
|
218
229
|
*/
|
|
219
|
-
expandNavigator(
|
|
220
|
-
this.#log('CadenzaClient#expandNavigator',
|
|
221
|
-
this.#postEvent('expandNavigator', { expandNavigator:
|
|
230
|
+
expandNavigator(expanded = true) {
|
|
231
|
+
this.#log('CadenzaClient#expandNavigator', expanded);
|
|
232
|
+
this.#postEvent('expandNavigator', { expandNavigator: Boolean(expanded) });
|
|
222
233
|
}
|
|
223
234
|
/**
|
|
224
235
|
* Create a geometry.
|
|
@@ -385,7 +396,7 @@ export class CadenzaClient {
|
|
|
385
396
|
* * 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' (Excel)
|
|
386
397
|
* * 'text/csv'
|
|
387
398
|
* @param {object} options - Options
|
|
388
|
-
* @param {TablePart[]} [options.parts] -
|
|
399
|
+
* @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
|
|
389
400
|
* @param {AbortSignal} [options.signal] - A signal to abort the data fetching
|
|
390
401
|
* @return {Promise<Response>} A Promise for the fetch response
|
|
391
402
|
* @throws For invalid arguments
|
|
@@ -393,7 +404,6 @@ export class CadenzaClient {
|
|
|
393
404
|
fetchData(source, mediaType, { parts, signal } = {}) {
|
|
394
405
|
this.#log('CadenzaClient#fetchData', source, mediaType);
|
|
395
406
|
assertSupportedMediaType(mediaType);
|
|
396
|
-
assertValidTableParts(parts);
|
|
397
407
|
const params = createParams({ mediaType, parts });
|
|
398
408
|
return this.#fetch(resolvePath(source), params, signal);
|
|
399
409
|
}
|
|
@@ -427,13 +437,12 @@ export class CadenzaClient {
|
|
|
427
437
|
* * 'text/csv'
|
|
428
438
|
* @param {object} options - Options
|
|
429
439
|
* @param {string} [options.fileName] - The file name to use; The file extension is appended by Cadenza.
|
|
430
|
-
* @param {TablePart[]} [options.parts] -
|
|
440
|
+
* @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
|
|
431
441
|
* @throws For invalid arguments
|
|
432
442
|
*/
|
|
433
443
|
downloadData(source, mediaType, { fileName, parts }) {
|
|
434
444
|
this.#log('CadenzaClient#downloadData', source, mediaType);
|
|
435
445
|
assertSupportedMediaType(mediaType);
|
|
436
|
-
assertValidTableParts(parts);
|
|
437
446
|
const params = createParams({ fileName, mediaType, parts });
|
|
438
447
|
this.#download(resolvePath(source), params);
|
|
439
448
|
}
|
|
@@ -543,30 +552,15 @@ function validGeometryType(/** @type string */ value) {
|
|
|
543
552
|
'MultiPolygon',
|
|
544
553
|
].includes(value);
|
|
545
554
|
}
|
|
546
|
-
/** @typedef {'columns' | 'values' | 'totals'} TablePart - A part of a table to export. */
|
|
547
555
|
function validTablePart(/** @type TablePart */ value) {
|
|
548
556
|
return ['columns', 'values', 'totals'].includes(value);
|
|
549
557
|
}
|
|
550
|
-
function assertValidTablePart(/** @type TablePart */ value) {
|
|
551
|
-
assert(validTablePart(value));
|
|
552
|
-
}
|
|
553
|
-
function assertValidTableParts(/** @type TablePart[] | undefined */ parts) {
|
|
554
|
-
if (parts) {
|
|
555
|
-
assert(Array.isArray(parts), `'parts' argument must be an array`);
|
|
556
|
-
parts.forEach(assertValidTablePart);
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
558
|
function validOperationMode(/** @type string */ value) {
|
|
560
559
|
return ['normal', 'simplified'].includes(value);
|
|
561
560
|
}
|
|
562
561
|
function validUiFeature(/** @type string */ value) {
|
|
563
562
|
return ['workbook-design', 'workbook-view-management'].includes(value);
|
|
564
563
|
}
|
|
565
|
-
/**
|
|
566
|
-
* @typedef {string} MediaType - A media type
|
|
567
|
-
*
|
|
568
|
-
* See {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types}
|
|
569
|
-
*/
|
|
570
564
|
const MediaType = /** @type {Record<string, MediaType>} */ {
|
|
571
565
|
CSV: 'text/csv',
|
|
572
566
|
EXCEL: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
@@ -588,6 +582,7 @@ function assertSupportedMediaType(
|
|
|
588
582
|
* @param {boolean} [params.hideMainHeaderAndFooter]
|
|
589
583
|
* @param {boolean} [params.hideWorkbookToolBar]
|
|
590
584
|
* @param {GlobalId} [params.highlightGlobalId]
|
|
585
|
+
* @param {string} [params.labelSet]
|
|
591
586
|
* @param {string} [params.locationFinder]
|
|
592
587
|
* @param {Extent} [params.mapExtent]
|
|
593
588
|
* @param {MediaType} [params.mediaType]
|
|
@@ -598,7 +593,7 @@ function assertSupportedMediaType(
|
|
|
598
593
|
* @param {ExternalLinkKey} [params.webApplication]
|
|
599
594
|
* @return {URLSearchParams}
|
|
600
595
|
*/
|
|
601
|
-
function createParams({ action, expandNavigator, fileName, geometryType, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, locationFinder, mapExtent, mediaType, minScale, parts, useMapSrs, webApplication, operationMode, disabledUiFeatures, }) {
|
|
596
|
+
function createParams({ action, expandNavigator, fileName, geometryType, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, locationFinder, mapExtent, mediaType, minScale, parts, useMapSrs, webApplication, operationMode, disabledUiFeatures, }) {
|
|
602
597
|
if (disabledUiFeatures) {
|
|
603
598
|
disabledUiFeatures.forEach((feature) => assert(validUiFeature(feature), `Invalid UI feature: ${feature}`));
|
|
604
599
|
}
|
|
@@ -608,6 +603,9 @@ function createParams({ action, expandNavigator, fileName, geometryType, hideMai
|
|
|
608
603
|
if (operationMode) {
|
|
609
604
|
assert(validOperationMode(operationMode), `Invalid operation mode: ${operationMode}`);
|
|
610
605
|
}
|
|
606
|
+
if (parts) {
|
|
607
|
+
parts.forEach((part) => assert(validTablePart(part), `Invalid table part: ${part}`));
|
|
608
|
+
}
|
|
611
609
|
return new URLSearchParams({
|
|
612
610
|
...(action && { action }),
|
|
613
611
|
...(disabledUiFeatures && {
|
|
@@ -619,6 +617,7 @@ function createParams({ action, expandNavigator, fileName, geometryType, hideMai
|
|
|
619
617
|
...(hideMainHeaderAndFooter && { hideMainHeaderAndFooter: 'true' }),
|
|
620
618
|
...(hideWorkbookToolBar && { hideWorkbookToolBar: 'true' }),
|
|
621
619
|
...(highlightGlobalId && { highlightGlobalId }),
|
|
620
|
+
...(labelSet && { labelSet }),
|
|
622
621
|
...(locationFinder && { locationFinder }),
|
|
623
622
|
...(mapExtent && { mapExtent: mapExtent.join() }),
|
|
624
623
|
...(mediaType && { mediaType }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@disy/cadenza.js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": "github:DisyInformationssysteme/cadenza.js",
|
|
6
6
|
"type": "module",
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
"sandbox": "node ./sandbox.cjs"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@types/jest": "29.5.
|
|
33
|
+
"@types/jest": "29.5.8",
|
|
34
34
|
"cross-env": "7.0.3",
|
|
35
35
|
"gh-pages": "6.0.0",
|
|
36
36
|
"http-server": "14.1.1",
|
|
37
|
-
"jest": "29.
|
|
38
|
-
"jest-environment-jsdom": "29.
|
|
39
|
-
"keep-a-changelog": "2.
|
|
37
|
+
"jest": "29.7.0",
|
|
38
|
+
"jest-environment-jsdom": "29.7.0",
|
|
39
|
+
"keep-a-changelog": "2.5.2",
|
|
40
40
|
"npm-run-all": "4.1.5",
|
|
41
41
|
"onchange": "7.1.0",
|
|
42
|
-
"prettier": "3.
|
|
42
|
+
"prettier": "3.1.0",
|
|
43
43
|
"ts-jest": "29.1.1",
|
|
44
|
-
"typedoc": "0.
|
|
44
|
+
"typedoc": "0.25.3"
|
|
45
45
|
},
|
|
46
46
|
"volta": {
|
|
47
47
|
"node": "16.13.1"
|
package/sandbox.cjs
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
const { execSync } = require('child_process');
|
|
2
2
|
const { URL } = require('url');
|
|
3
3
|
|
|
4
|
+
const CADENZA_URL_PARAM = '--cadenza-url';
|
|
4
5
|
const DEFAULT_CADENZA_URL = 'http://localhost:8080/cadenza';
|
|
5
|
-
const cadenzaUrl = new URL((process.argv[2] === '--cadenza-url' && process.argv[3]) || process.env.CADENZA_URL || DEFAULT_CADENZA_URL);
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const index = process.argv.indexOf(CADENZA_URL_PARAM);
|
|
8
|
+
const cadenzaUrlFromArgs = index !== -1
|
|
9
|
+
? process.argv[index + 1]
|
|
10
|
+
: process.argv.find(arg => arg.startsWith(CADENZA_URL_PARAM + '='))?.slice(CADENZA_URL_PARAM.length + 1);
|
|
11
|
+
const cadenzaUrl = new URL(cadenzaUrlFromArgs || process.env.CADENZA_URL || DEFAULT_CADENZA_URL);
|
|
12
|
+
|
|
13
|
+
execSync(`npx --yes http-server -a localhost -c-1 -d false --proxy ${cadenzaUrl.origin} --proxy-options.headers.Origin ${cadenzaUrl.origin} -o /sandbox.html${cadenzaUrl.pathname !== '/' ? `?contextPath=${cadenzaUrl.pathname}` : ''}`, { stdio: 'inherit' });
|
package/sandbox.html
CHANGED
|
@@ -82,10 +82,11 @@
|
|
|
82
82
|
disabledUiFeatures: disabledUiFeatures && disabledUiFeatures.split(',')
|
|
83
83
|
});
|
|
84
84
|
},
|
|
85
|
-
showPage ({ page, expandNavigator, highlightGlobalId }) {
|
|
85
|
+
showPage ({ page, expandNavigator, highlightGlobalId, labelSet }) {
|
|
86
86
|
cadenzaClient.show({ page: page }, {
|
|
87
87
|
expandNavigator: (expandNavigator === 'on'),
|
|
88
|
-
highlightGlobalId
|
|
88
|
+
highlightGlobalId,
|
|
89
|
+
labelSet
|
|
89
90
|
});
|
|
90
91
|
},
|
|
91
92
|
expandNavigator ({ expandNavigator }) {
|
|
@@ -247,6 +248,10 @@
|
|
|
247
248
|
<label for="highlightGlobalId">Highlighted Global ID</label>
|
|
248
249
|
<input name="highlightGlobalId" id="highlightGlobalId">
|
|
249
250
|
</div>
|
|
251
|
+
<div>
|
|
252
|
+
<label for="labelSet">Label Set</label>
|
|
253
|
+
<input name="labelSet" id="labelSet">
|
|
254
|
+
</div>
|
|
250
255
|
</template>
|
|
251
256
|
|
|
252
257
|
<template data-action="expandNavigator">
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PageType | Cadenza JS</title><meta name="description" content="Documentation for Cadenza JS"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
|
-
<div class="tsd-toolbar-contents container">
|
|
3
|
-
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
|
-
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
5
|
-
<div class="field">
|
|
6
|
-
<div id="tsd-toolbar-links"></div></div>
|
|
7
|
-
<ul class="results">
|
|
8
|
-
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Cadenza JS</a></div>
|
|
10
|
-
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
|
-
<div class="container container-main">
|
|
12
|
-
<div class="col-content">
|
|
13
|
-
<div class="tsd-page-title">
|
|
14
|
-
<ul class="tsd-breadcrumb">
|
|
15
|
-
<li><a href="../modules.html">Cadenza JS</a></li>
|
|
16
|
-
<li><a href="PageType.html">PageType</a></li></ul>
|
|
17
|
-
<h1>Type alias PageType</h1></div>
|
|
18
|
-
<div class="tsd-signature"><span class="tsd-kind-type-alias">Page<wbr/>Type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"welcome"</span></div>
|
|
19
|
-
<div class="tsd-comment tsd-typography"><p>A Cadenza well-known page name</p>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
22
|
-
<ul>
|
|
23
|
-
<li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/23b23d8/src/cadenza.js#L70">src/cadenza.js:70</a></li></ul></aside></div>
|
|
24
|
-
<div class="col-sidebar">
|
|
25
|
-
<div class="page-menu">
|
|
26
|
-
<div class="tsd-navigation settings">
|
|
27
|
-
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
28
|
-
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
|
|
29
|
-
<div class="tsd-accordion-details">
|
|
30
|
-
<div class="tsd-filter-visibility">
|
|
31
|
-
<h4 class="uppercase">Member Visibility</h4><form>
|
|
32
|
-
<ul id="tsd-filter-options">
|
|
33
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
34
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
|
|
35
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
|
|
36
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
|
|
37
|
-
<div class="tsd-theme-toggle">
|
|
38
|
-
<h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
|
|
39
|
-
<div class="site-menu">
|
|
40
|
-
<nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>Cadenza JS</span></a>
|
|
41
|
-
<ul class="tsd-small-nested-navigation">
|
|
42
|
-
<li><a href="../classes/AbortError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>Abort<wbr/>Error</span></a></li>
|
|
43
|
-
<li><a href="../classes/CadenzaClient.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Cadenza<wbr/>Client</span></a></li>
|
|
44
|
-
<li><a href="../classes/CadenzaError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Cadenza<wbr/>Error</span></a></li>
|
|
45
|
-
<li><a href="../interfaces/CadenzaEvent.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>Cadenza<wbr/>Event</span></a></li>
|
|
46
|
-
<li><a href="../interfaces/ExternalLinkKey.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>External<wbr/>Link<wbr/>Key</span></a></li>
|
|
47
|
-
<li><a href="../interfaces/Geometry.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Geometry</span></a></li>
|
|
48
|
-
<li><a href="../interfaces/PageSource.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Page<wbr/>Source</span></a></li>
|
|
49
|
-
<li><a href="../interfaces/WorkbookKey.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Workbook<wbr/>Key</span></a></li>
|
|
50
|
-
<li><a href="../interfaces/WorkbookViewKey.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Workbook<wbr/>View<wbr/>Key</span></a></li>
|
|
51
|
-
<li><a href="../interfaces/WorksheetKey.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Worksheet<wbr/>Key</span></a></li>
|
|
52
|
-
<li><a href="CadenzaErrorEvent.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>Cadenza<wbr/>Error<wbr/>Event</span></a></li>
|
|
53
|
-
<li><a href="EmbeddingTargetId.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Embedding<wbr/>Target<wbr/>Id</span></a></li>
|
|
54
|
-
<li><a href="Extent.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Extent</span></a></li>
|
|
55
|
-
<li><a href="GeometryType.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Geometry<wbr/>Type</span></a></li>
|
|
56
|
-
<li><a href="GlobalId.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Global<wbr/>Id</span></a></li>
|
|
57
|
-
<li><a href="MediaType.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Media<wbr/>Type</span></a></li>
|
|
58
|
-
<li><a href="OperationMode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Operation<wbr/>Mode</span></a></li>
|
|
59
|
-
<li><a href="PageType.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Page<wbr/>Type</span></a></li>
|
|
60
|
-
<li><a href="TablePart.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Table<wbr/>Part</span></a></li>
|
|
61
|
-
<li><a href="UiFeature.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Ui<wbr/>Feature</span></a></li>
|
|
62
|
-
<li><a href="WorkbookSource.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Workbook<wbr/>Source</span></a></li>
|
|
63
|
-
<li><a href="WorkbookViewSource.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Workbook<wbr/>View<wbr/>Source</span></a></li>
|
|
64
|
-
<li><a href="WorksheetSource.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Worksheet<wbr/>Source</span></a></li>
|
|
65
|
-
<li><a href="../functions/cadenza.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>cadenza</span></a></li></ul></nav></div></div></div>
|
|
66
|
-
<div class="tsd-generator">
|
|
67
|
-
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
68
|
-
<div class="overlay"></div></body></html>
|