@disy/cadenza.js 3.0.3 → 3.0.4

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 (46) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/apidoc/classes/AbortError.html +3 -3
  3. package/apidoc/classes/CadenzaClient.html +114 -35
  4. package/apidoc/classes/CadenzaError.html +5 -5
  5. package/apidoc/functions/cadenza.html +3 -3
  6. package/apidoc/index.html +2 -2
  7. package/apidoc/interfaces/CadenzaClientOptions.html +5 -5
  8. package/apidoc/interfaces/CadenzaEvent.html +4 -4
  9. package/apidoc/interfaces/Distance.html +2 -2
  10. package/apidoc/interfaces/ExternalLinkKey.html +4 -4
  11. package/apidoc/interfaces/Feature.html +7 -7
  12. package/apidoc/interfaces/FeatureCollection.html +3 -3
  13. package/apidoc/interfaces/Geometry.html +3 -3
  14. package/apidoc/interfaces/GeometryExtentStrategy.html +4 -4
  15. package/apidoc/interfaces/PageSource.html +3 -3
  16. package/apidoc/modules.html +2 -2
  17. package/apidoc/types/CadenzaActionEvent.html +2 -2
  18. package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -2
  19. package/apidoc/types/CadenzaDrillThroughEvent.html +2 -2
  20. package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -2
  21. package/apidoc/types/CadenzaEditGeometryOkEvent.html +2 -2
  22. package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +2 -2
  23. package/apidoc/types/CadenzaErrorEvent.html +2 -2
  24. package/apidoc/types/CadenzaEventByType.html +1 -1
  25. package/apidoc/types/CadenzaEventType.html +2 -2
  26. package/apidoc/types/CadenzaObjectInfoEvent.html +2 -2
  27. package/apidoc/types/CadenzaReloadEvent.html +2 -2
  28. package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
  29. package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
  30. package/apidoc/types/CustomValidityType.html +2 -2
  31. package/apidoc/types/DataType.html +2 -2
  32. package/apidoc/types/EmbeddingTargetId.html +2 -2
  33. package/apidoc/types/Extent.html +2 -2
  34. package/apidoc/types/ExtentStrategy.html +2 -2
  35. package/apidoc/types/FilterVariables.html +2 -2
  36. package/apidoc/types/GeometryType.html +2 -2
  37. package/apidoc/types/GlobalId.html +2 -2
  38. package/apidoc/types/LengthUnit.html +1 -1
  39. package/apidoc/types/OpaqueString.html +2 -2
  40. package/apidoc/types/OperationMode.html +2 -2
  41. package/apidoc/types/TablePart.html +2 -2
  42. package/apidoc/types/UiFeature.html +2 -2
  43. package/apidoc/types/WorkbookLayerPath.html +2 -2
  44. package/cadenza.d.ts +78 -70
  45. package/cadenza.js +120 -72
  46. package/package.json +1 -1
package/cadenza.d.ts CHANGED
@@ -36,7 +36,7 @@ export class CadenzaClient {
36
36
  /**
37
37
  *
38
38
  * @hidden
39
- * @param {CadenzaClientOptions} [options]
39
+ * @param {CadenzaClientOptions} [__namedParameters]
40
40
  */
41
41
  constructor({ baseUrl, debug, iframe, webApplication }?: CadenzaClientOptions | undefined);
42
42
  /** The base URL of the Cadenza server this client is requesting */
@@ -47,18 +47,18 @@ export class CadenzaClient {
47
47
  * Show a page, workbook, worksheet or workbook view in an iframe.
48
48
  *
49
49
  * @param {PageSource | EmbeddingTargetId} source - The source to show
50
- * @param {object} [options]
51
- * @param {DataType} [options.dataType] - Set to 'pdf' for views of type "JasperReports report"
50
+ * @param {object} [__namedParameters]
51
+ * @param {DataType} [__namedParameters.dataType] - Set to 'pdf' for views of type "JasperReports report"
52
52
  * to show the report PDF directly, without any Cadenza headers or footers.
53
- * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
54
- * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
55
- * @param {FilterVariables} [options.filter] - Filter variables
56
- * @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
57
- * @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
58
- * @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
59
- * @param {String} [options.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
60
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
61
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
53
+ * @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
54
+ * @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
55
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
56
+ * @param {boolean} [__namedParameters.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
57
+ * @param {boolean} [__namedParameters.hideWorkbookToolBar] - Whether to hide the workbook toolbar
58
+ * @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
59
+ * @param {String} [__namedParameters.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
60
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
61
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
62
62
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
63
63
  * @throws For invalid arguments
64
64
  * @fires
@@ -80,8 +80,8 @@ export class CadenzaClient {
80
80
  } | undefined, ...args: any[]): Promise<void>;
81
81
  /**
82
82
  * Reload the views of a worksheet.
83
- * @param {object} [options] - Options
84
- * @param {boolean} [options.invalidateCaches] - When true, caches will be invalidated for objecttypes used
83
+ * @param {object} [__namedParameters] - Options
84
+ * @param {boolean} [__namedParameters.invalidateCaches] - When true, caches will be invalidated for objecttypes used
85
85
  * in the worksheet
86
86
  * @return {Promise<void>} A `Promise` which resolves when the views of the worksheet have finished reloading
87
87
  * @postMessage
@@ -98,20 +98,24 @@ export class CadenzaClient {
98
98
  * Show a workbook map view in an iframe.
99
99
  *
100
100
  * @param {EmbeddingTargetId} mapView - The workbook map view to show
101
- * @param {object} [options] - Options
102
- * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
103
- * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
104
- * @param {FilterVariables} [options.filter] - Filter variables
105
- * @param {Geometry} [options.geometry] - A geometry to show on the map
106
- * @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
107
- * @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
108
- * @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
109
- * @param {string} [options.locationFinder] - A search query for the location finder
110
- * @param {Extent} [options.mapExtent] - A map extent to set
111
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
112
- * @param {boolean} [options.useMapSrs] - Whether the geometry and the extent are in the map's SRS (otherwise EPSG:4326 is assumed)
113
- * @param {ExtentStrategy} [options.extentStrategy] - Strategy to define the new map extent
114
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
101
+ * @param {object} [__namedParameters] - Options
102
+ * @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
103
+ * @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
104
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
105
+ * @param {Geometry} [__namedParameters.geometry] - A geometry to show on the map
106
+ * @param {boolean} [__namedParameters.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
107
+ * @param {boolean} [__namedParameters.hideWorkbookToolBar] - Whether to hide the workbook toolbar
108
+ * @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
109
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
110
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
111
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
112
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry and the extent are in the map's SRS (otherwise EPSG:4326 is assumed)
113
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the initial map extent. A given extentStrategy
114
+ * trumps zooming to a specified mapExtent
115
+ * which trumps zooming to a locationFinder result
116
+ * which trumps zooming to the initial extent of the opened mapView.
117
+ * If a specified {@link GeometryExtentStrategy} doesn't contain a 'geometry', the 'geometry' of this API call is used.
118
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
115
119
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
116
120
  * @throws For invalid arguments
117
121
  * @fires
@@ -226,14 +230,14 @@ export class CadenzaClient {
226
230
  *
227
231
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
228
232
  * @param {GeometryType} geometryType - The geometry type
229
- * @param {object} [options] - Options
230
- * @param {FilterVariables} [options.filter] - Filter variables
231
- * @param {string} [options.locationFinder] - A search query for the location finder
232
- * @param {Extent} [options.mapExtent] - A map extent to set
233
- * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
234
- * @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
235
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
236
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
233
+ * @param {object} [__namedParameters] - Options
234
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
235
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
236
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
237
+ * @param {number} [__namedParameters.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
238
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
239
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
240
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
237
241
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
238
242
  * @throws For invalid arguments
239
243
  * @fires
@@ -256,15 +260,19 @@ export class CadenzaClient {
256
260
  *
257
261
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
258
262
  * @param {Geometry} geometry - The geometry
259
- * @param {object} [options] - Options
260
- * @param {FilterVariables} [options.filter] - Filter variables
261
- * @param {string} [options.locationFinder] - A search query for the location finder
262
- * @param {Extent} [options.mapExtent] - A map extent to set
263
- * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
264
- * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
265
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
266
- * @param {ExtentStrategy} [options.extentStrategy] - Strategy to define the new map extent
267
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
263
+ * @param {object} [__namedParameters] - Options
264
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
265
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
266
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
267
+ * @param {number} [__namedParameters.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
268
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
269
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
270
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the initial map extent. A given extentStrategy
271
+ * trumps zooming to a specified mapExtent
272
+ * which trumps zooming to a locationFinder result
273
+ * which trumps zooming to the initial extent of the opened mapView.
274
+ * If a specified {@link GeometryExtentStrategy} doesn't contain a 'geometry', the 'geometry' of this API call is used.
275
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
268
276
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
269
277
  * @throws For invalid arguments
270
278
  * @fires
@@ -297,15 +305,15 @@ export class CadenzaClient {
297
305
  * Select objects in a workbook map.
298
306
  *
299
307
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view
300
- * @param {object} [options] - Options
301
- * @param {FilterVariables} [options.filter] - Filter variables
302
- * @param {(WorkbookLayerPath | string)[]} [options.layers] - Layers to restrict the selection to
308
+ * @param {object} [__namedParameters] - Options
309
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
310
+ * @param {(WorkbookLayerPath | string)[]} [__namedParameters.layers] - Layers to restrict the selection to
303
311
  * (identified using layer paths or print names)
304
- * @param {string} [options.locationFinder] - A search query for the location finder
305
- * @param {Extent} [options.mapExtent] - A map extent to set
306
- * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
307
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
308
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
312
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
313
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
314
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
315
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
316
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
309
317
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
310
318
  * @throws For invalid arguments
311
319
  * @fires
@@ -346,10 +354,10 @@ export class CadenzaClient {
346
354
  * @param {DataType} dataType - The data type you want to get back from the server.
347
355
  * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
348
356
  * and `"pdf"` for views of type "JasperReports report".
349
- * @param {object} [options] - Options
350
- * @param {FilterVariables} [options.filter] - Filter variables
351
- * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
352
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
357
+ * @param {object} [__namedParameters] - Options
358
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
359
+ * @param {TablePart[]} [__namedParameters.parts] - Table parts to export; If not specified, all parts are exported.
360
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
353
361
  * @return {Promise<Response>} A `Promise` for the fetch response
354
362
  * @throws For invalid arguments
355
363
  * @server
@@ -366,11 +374,11 @@ export class CadenzaClient {
366
374
  * @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
367
375
  * (identified using layer paths or print names)
368
376
  * @param {unknown[][]} objectIds - The IDs of the objects to select
369
- * @param {object} [options] - Options
370
- * @param {FilterVariables} [options.filter] - Filter variables
371
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
372
- * @param {Boolean} [options.useMapSrs] - Use the map SRS instead of WGS84
373
- * @param {Boolean} [options.fullGeometries] - Return non-simplified geometries
377
+ * @param {object} [__namedParameters] - Options
378
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
379
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
380
+ * @param {Boolean} [__namedParameters.useMapSrs] - Use the map SRS instead of WGS84
381
+ * @param {Boolean} [__namedParameters.fullGeometries] - Return non-simplified geometries
374
382
  * @return {Promise<FeatureCollection>} A `Promise` for the fetch response
375
383
  * @throws For invalid arguments
376
384
  */
@@ -387,10 +395,10 @@ export class CadenzaClient {
387
395
  * @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
388
396
  * (identified using layer paths or print names)
389
397
  * @param {Geometry} geometry - The intersection geometry
390
- * @param {object} [options] - Options
391
- * @param {boolean} [options.useMapSrs] - The intersection geometry and the result geometries are in the map's SRS (otherwise EPSG:4326 is assumed)
392
- * @param {Distance} [options.buffer] - Buffer size for geometry of the transition
393
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
398
+ * @param {object} [__namedParameters] - Options
399
+ * @param {boolean} [__namedParameters.useMapSrs] - The intersection geometry and the result geometries are in the map's SRS (otherwise EPSG:4326 is assumed)
400
+ * @param {Distance} [__namedParameters.buffer] - Buffer size for geometry of the transition
401
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
394
402
  * @return {Promise<FeatureCollection>} A `Promise` for the fetch response
395
403
  * @server
396
404
  */
@@ -408,10 +416,10 @@ export class CadenzaClient {
408
416
  * @param {DataType} dataType - The data type you want to get back from the server.
409
417
  * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
410
418
  * and `"pdf"` for views of type "JasperReports report".
411
- * @param {object} [options] - Options
412
- * @param {string} [options.fileName] - The file name to use; The file extension is appended by Cadenza.
413
- * @param {FilterVariables} [options.filter] - Filter variables
414
- * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
419
+ * @param {object} [__namedParameters] - Options
420
+ * @param {string} [__namedParameters.fileName] - The file name to use; The file extension is appended by Cadenza.
421
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
422
+ * @param {TablePart[]} [__namedParameters.parts] - Table parts to export; If not specified, all parts are exported.
415
423
  * @throws For invalid arguments
416
424
  * @server
417
425
  */
package/cadenza.js CHANGED
@@ -184,7 +184,7 @@ export class CadenzaClient {
184
184
  /**
185
185
  *
186
186
  * @hidden
187
- * @param {CadenzaClientOptions} [options]
187
+ * @param {CadenzaClientOptions} [__namedParameters]
188
188
  */
189
189
  constructor({ baseUrl, debug = false, iframe, webApplication } = {}) {
190
190
  if (webApplication) {
@@ -241,18 +241,18 @@ export class CadenzaClient {
241
241
  * Show a page, workbook, worksheet or workbook view in an iframe.
242
242
  *
243
243
  * @param {PageSource | EmbeddingTargetId} source - The source to show
244
- * @param {object} [options]
245
- * @param {DataType} [options.dataType] - Set to 'pdf' for views of type "JasperReports report"
244
+ * @param {object} [__namedParameters]
245
+ * @param {DataType} [__namedParameters.dataType] - Set to 'pdf' for views of type "JasperReports report"
246
246
  * to show the report PDF directly, without any Cadenza headers or footers.
247
- * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
248
- * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
249
- * @param {FilterVariables} [options.filter] - Filter variables
250
- * @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
251
- * @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
252
- * @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
253
- * @param {String} [options.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
254
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
255
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
247
+ * @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
248
+ * @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
249
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
250
+ * @param {boolean} [__namedParameters.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
251
+ * @param {boolean} [__namedParameters.hideWorkbookToolBar] - Whether to hide the workbook toolbar
252
+ * @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
253
+ * @param {String} [__namedParameters.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
254
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
255
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
256
256
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
257
257
  * @throws For invalid arguments
258
258
  * @fires
@@ -285,8 +285,8 @@ export class CadenzaClient {
285
285
  }
286
286
  /**
287
287
  * Reload the views of a worksheet.
288
- * @param {object} [options] - Options
289
- * @param {boolean} [options.invalidateCaches] - When true, caches will be invalidated for objecttypes used
288
+ * @param {object} [__namedParameters] - Options
289
+ * @param {boolean} [__namedParameters.invalidateCaches] - When true, caches will be invalidated for objecttypes used
290
290
  * in the worksheet
291
291
  * @return {Promise<void>} A `Promise` which resolves when the views of the worksheet have finished reloading
292
292
  * @postMessage
@@ -308,20 +308,24 @@ export class CadenzaClient {
308
308
  * Show a workbook map view in an iframe.
309
309
  *
310
310
  * @param {EmbeddingTargetId} mapView - The workbook map view to show
311
- * @param {object} [options] - Options
312
- * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
313
- * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
314
- * @param {FilterVariables} [options.filter] - Filter variables
315
- * @param {Geometry} [options.geometry] - A geometry to show on the map
316
- * @param {boolean} [options.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
317
- * @param {boolean} [options.hideWorkbookToolBar] - Whether to hide the workbook toolbar
318
- * @param {GlobalId} [options.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
319
- * @param {string} [options.locationFinder] - A search query for the location finder
320
- * @param {Extent} [options.mapExtent] - A map extent to set
321
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
322
- * @param {boolean} [options.useMapSrs] - Whether the geometry and the extent are in the map's SRS (otherwise EPSG:4326 is assumed)
323
- * @param {ExtentStrategy} [options.extentStrategy] - Strategy to define the new map extent
324
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
311
+ * @param {object} [__namedParameters] - Options
312
+ * @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
313
+ * @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
314
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
315
+ * @param {Geometry} [__namedParameters.geometry] - A geometry to show on the map
316
+ * @param {boolean} [__namedParameters.hideMainHeaderAndFooter] - Whether to hide the main Cadenza header and footer
317
+ * @param {boolean} [__namedParameters.hideWorkbookToolBar] - Whether to hide the workbook toolbar
318
+ * @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
319
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
320
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
321
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
322
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry and the extent are in the map's SRS (otherwise EPSG:4326 is assumed)
323
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the initial map extent. A given extentStrategy
324
+ * trumps zooming to a specified mapExtent
325
+ * which trumps zooming to a locationFinder result
326
+ * which trumps zooming to the initial extent of the opened mapView.
327
+ * If a specified {@link GeometryExtentStrategy} doesn't contain a 'geometry', the 'geometry' of this API call is used.
328
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
325
329
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
326
330
  * @throws For invalid arguments
327
331
  * @fires
@@ -334,7 +338,12 @@ export class CadenzaClient {
334
338
  if (geometry) {
335
339
  assertValidGeometryType(geometry.type);
336
340
  }
337
- const zoomToGeometry = geometry && extentStrategy?.type === 'geometry';
341
+ const validExtentStrategy = sanitizeExtentStrategy({
342
+ geometry,
343
+ extentStrategy,
344
+ });
345
+ const zoomToGeometry = validExtentStrategy?.type === 'geometry' &&
346
+ validExtentStrategy?.geometry === geometry;
338
347
  const params = createParams({
339
348
  disabledUiFeatures,
340
349
  expandNavigator,
@@ -357,6 +366,9 @@ export class CadenzaClient {
357
366
  zoomToGeometry,
358
367
  });
359
368
  }
369
+ if (!zoomToGeometry && validExtentStrategy) {
370
+ this.#setExtentStrategy(validExtentStrategy);
371
+ }
360
372
  }
361
373
  /**
362
374
  * Expand/collapse the navigator.
@@ -495,14 +507,14 @@ export class CadenzaClient {
495
507
  *
496
508
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
497
509
  * @param {GeometryType} geometryType - The geometry type
498
- * @param {object} [options] - Options
499
- * @param {FilterVariables} [options.filter] - Filter variables
500
- * @param {string} [options.locationFinder] - A search query for the location finder
501
- * @param {Extent} [options.mapExtent] - A map extent to set
502
- * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
503
- * @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
504
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
505
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
510
+ * @param {object} [__namedParameters] - Options
511
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
512
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
513
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
514
+ * @param {number} [__namedParameters.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
515
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
516
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
517
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
506
518
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
507
519
  * @throws For invalid arguments
508
520
  * @fires
@@ -530,15 +542,19 @@ export class CadenzaClient {
530
542
  *
531
543
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
532
544
  * @param {Geometry} geometry - The geometry
533
- * @param {object} [options] - Options
534
- * @param {FilterVariables} [options.filter] - Filter variables
535
- * @param {string} [options.locationFinder] - A search query for the location finder
536
- * @param {Extent} [options.mapExtent] - A map extent to set
537
- * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
538
- * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
539
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
540
- * @param {ExtentStrategy} [options.extentStrategy] - Strategy to define the new map extent
541
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
545
+ * @param {object} [__namedParameters] - Options
546
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
547
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
548
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
549
+ * @param {number} [__namedParameters.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
550
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
551
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
552
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the initial map extent. A given extentStrategy
553
+ * trumps zooming to a specified mapExtent
554
+ * which trumps zooming to a locationFinder result
555
+ * which trumps zooming to the initial extent of the opened mapView.
556
+ * If a specified {@link GeometryExtentStrategy} doesn't contain a 'geometry', the 'geometry' of this API call is used.
557
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
542
558
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
543
559
  * @throws For invalid arguments
544
560
  * @fires
@@ -550,7 +566,12 @@ export class CadenzaClient {
550
566
  async editGeometry(backgroundMapView, geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, extentStrategy, operationMode, signal, } = {}) {
551
567
  this.#log('CadenzaClient#editGeometry', ...arguments);
552
568
  assertValidGeometryType(geometry.type);
553
- const zoomToGeometry = geometry && extentStrategy?.type === 'geometry';
569
+ const validExtentStrategy = sanitizeExtentStrategy({
570
+ geometry,
571
+ extentStrategy,
572
+ });
573
+ const zoomToGeometry = validExtentStrategy?.type === 'geometry' &&
574
+ validExtentStrategy?.geometry === geometry;
554
575
  const params = createParams({
555
576
  action: 'editGeometry',
556
577
  filter,
@@ -569,6 +590,9 @@ export class CadenzaClient {
569
590
  zoomToGeometry,
570
591
  });
571
592
  }
593
+ if (!zoomToGeometry && validExtentStrategy) {
594
+ this.#setExtentStrategy(validExtentStrategy);
595
+ }
572
596
  }
573
597
  /**
574
598
  * Set custom validity state of the geometry editor in addition to the default validation state (including errors and
@@ -587,15 +611,15 @@ export class CadenzaClient {
587
611
  * Select objects in a workbook map.
588
612
  *
589
613
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view
590
- * @param {object} [options] - Options
591
- * @param {FilterVariables} [options.filter] - Filter variables
592
- * @param {(WorkbookLayerPath | string)[]} [options.layers] - Layers to restrict the selection to
614
+ * @param {object} [__namedParameters] - Options
615
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
616
+ * @param {(WorkbookLayerPath | string)[]} [__namedParameters.layers] - Layers to restrict the selection to
593
617
  * (identified using layer paths or print names)
594
- * @param {string} [options.locationFinder] - A search query for the location finder
595
- * @param {Extent} [options.mapExtent] - A map extent to set
596
- * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
597
- * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
598
- * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
618
+ * @param {string} [__namedParameters.locationFinder] - A search query for the location finder
619
+ * @param {Extent} [__namedParameters.mapExtent] - A map extent to set
620
+ * @param {boolean} [__namedParameters.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
621
+ * @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
622
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
599
623
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
600
624
  * @throws For invalid arguments
601
625
  * @fires
@@ -801,10 +825,10 @@ export class CadenzaClient {
801
825
  * @param {DataType} dataType - The data type you want to get back from the server.
802
826
  * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
803
827
  * and `"pdf"` for views of type "JasperReports report".
804
- * @param {object} [options] - Options
805
- * @param {FilterVariables} [options.filter] - Filter variables
806
- * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
807
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
828
+ * @param {object} [__namedParameters] - Options
829
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
830
+ * @param {TablePart[]} [__namedParameters.parts] - Table parts to export; If not specified, all parts are exported.
831
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
808
832
  * @return {Promise<Response>} A `Promise` for the fetch response
809
833
  * @throws For invalid arguments
810
834
  * @server
@@ -822,11 +846,11 @@ export class CadenzaClient {
822
846
  * @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
823
847
  * (identified using layer paths or print names)
824
848
  * @param {unknown[][]} objectIds - The IDs of the objects to select
825
- * @param {object} [options] - Options
826
- * @param {FilterVariables} [options.filter] - Filter variables
827
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
828
- * @param {Boolean} [options.useMapSrs] - Use the map SRS instead of WGS84
829
- * @param {Boolean} [options.fullGeometries] - Return non-simplified geometries
849
+ * @param {object} [__namedParameters] - Options
850
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
851
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
852
+ * @param {Boolean} [__namedParameters.useMapSrs] - Use the map SRS instead of WGS84
853
+ * @param {Boolean} [__namedParameters.fullGeometries] - Return non-simplified geometries
830
854
  * @return {Promise<FeatureCollection>} A `Promise` for the fetch response
831
855
  * @throws For invalid arguments
832
856
  */
@@ -849,10 +873,10 @@ export class CadenzaClient {
849
873
  * @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
850
874
  * (identified using layer paths or print names)
851
875
  * @param {Geometry} geometry - The intersection geometry
852
- * @param {object} [options] - Options
853
- * @param {boolean} [options.useMapSrs] - The intersection geometry and the result geometries are in the map's SRS (otherwise EPSG:4326 is assumed)
854
- * @param {Distance} [options.buffer] - Buffer size for geometry of the transition
855
- * @param {AbortSignal} [options.signal] - A signal to abort the data fetching
876
+ * @param {object} [__namedParameters] - Options
877
+ * @param {boolean} [__namedParameters.useMapSrs] - The intersection geometry and the result geometries are in the map's SRS (otherwise EPSG:4326 is assumed)
878
+ * @param {Distance} [__namedParameters.buffer] - Buffer size for geometry of the transition
879
+ * @param {AbortSignal} [__namedParameters.signal] - A signal to abort the data fetching
856
880
  * @return {Promise<FeatureCollection>} A `Promise` for the fetch response
857
881
  * @server
858
882
  */
@@ -904,10 +928,10 @@ export class CadenzaClient {
904
928
  * @param {DataType} dataType - The data type you want to get back from the server.
905
929
  * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
906
930
  * and `"pdf"` for views of type "JasperReports report".
907
- * @param {object} [options] - Options
908
- * @param {string} [options.fileName] - The file name to use; The file extension is appended by Cadenza.
909
- * @param {FilterVariables} [options.filter] - Filter variables
910
- * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
931
+ * @param {object} [__namedParameters] - Options
932
+ * @param {string} [__namedParameters.fileName] - The file name to use; The file extension is appended by Cadenza.
933
+ * @param {FilterVariables} [__namedParameters.filter] - Filter variables
934
+ * @param {TablePart[]} [__namedParameters.parts] - Table parts to export; If not specified, all parts are exported.
911
935
  * @throws For invalid arguments
912
936
  * @server
913
937
  */
@@ -1106,6 +1130,30 @@ function createParams({ action, dataType, disabledUiFeatures, expandNavigator, f
1106
1130
  function array(/** @type unknown */ value) {
1107
1131
  return Array.isArray(value) ? value : [value];
1108
1132
  }
1133
+ /**
1134
+ * Creates a valid extent strategy
1135
+ *
1136
+ * If the result is not a valid extent strategy, the return value is undefined.
1137
+ *
1138
+ * @param {object} __namedParameters
1139
+ * @param {Geometry} [__namedParameters.geometry]
1140
+ * @param {ExtentStrategy} [__namedParameters.extentStrategy]
1141
+ * @return {ExtentStrategy | undefined}
1142
+ */
1143
+ function sanitizeExtentStrategy({ extentStrategy, geometry } = {}) {
1144
+ if (extentStrategy) {
1145
+ switch (extentStrategy.type) {
1146
+ case 'geometry':
1147
+ geometry = extentStrategy.geometry ?? geometry;
1148
+ if (geometry) {
1149
+ return { type: 'geometry', geometry };
1150
+ }
1151
+ break;
1152
+ default:
1153
+ return extentStrategy;
1154
+ }
1155
+ }
1156
+ }
1109
1157
  // Please do not add internal event types like 'ready' here.
1110
1158
  /**
1111
1159
  * @typedef {'action'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@disy/cadenza.js",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "license": "Apache-2.0",
5
5
  "repository": "github:DisyInformationssysteme/cadenza.js",
6
6
  "type": "module",