@disy/cadenza.js 10.5.6 → 10.5.8
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 +7 -0
- package/apidoc/assets/navigation.js +1 -1
- package/apidoc/assets/search.js +1 -1
- package/apidoc/classes/AbortError.html +3 -3
- package/apidoc/classes/CadenzaClient.html +31 -31
- package/apidoc/classes/CadenzaError.html +5 -5
- package/apidoc/functions/cadenza.html +4 -4
- package/apidoc/index.html +6 -6
- package/apidoc/interfaces/AreaIntersectionsResult.html +4 -4
- package/apidoc/interfaces/CadenzaClientOptions.html +6 -6
- package/apidoc/interfaces/CadenzaEvent.html +4 -4
- package/apidoc/interfaces/CommonEditGeometryOptions.html +12 -12
- package/apidoc/interfaces/Distance.html +2 -2
- package/apidoc/interfaces/ExternalLinkKey.html +4 -4
- package/apidoc/interfaces/Feature.html +9 -9
- package/apidoc/interfaces/FeatureCollection.html +4 -4
- package/apidoc/interfaces/Geometry.html +4 -4
- package/apidoc/interfaces/GeometryExtentStrategy.html +4 -4
- package/apidoc/interfaces/LayerDataExtentStrategy.html +4 -4
- package/apidoc/interfaces/LayerDefinition.html +4 -4
- package/apidoc/interfaces/LocationFinderExtentStrategy.html +4 -4
- package/apidoc/interfaces/PageSource.html +3 -3
- package/apidoc/interfaces/ProblemDetails.html +6 -6
- package/apidoc/interfaces/SnappingOptions.html +3 -3
- package/apidoc/interfaces/SpatialFilterValue.html +4 -4
- package/apidoc/interfaces/StaticExtentStrategy.html +4 -4
- package/apidoc/modules.html +1 -1
- package/apidoc/types/AttributeValue.html +3 -0
- package/apidoc/types/CadenzaActionEvent.html +2 -2
- package/apidoc/types/CadenzaChangeExtentEvent.html +2 -2
- package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -2
- package/apidoc/types/CadenzaDrillThroughEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryCreateEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryDeleteEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryEditEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryOkEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +2 -2
- package/apidoc/types/CadenzaErrorEvent.html +2 -2
- package/apidoc/types/CadenzaEventByType.html +1 -1
- package/apidoc/types/CadenzaEventType.html +2 -2
- package/apidoc/types/CadenzaReloadEvent.html +2 -2
- package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
- package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
- package/apidoc/types/Coordinate.html +2 -2
- package/apidoc/types/CustomValidityType.html +2 -2
- package/apidoc/types/DataType.html +2 -2
- package/apidoc/types/EmbeddingTargetId.html +2 -2
- package/apidoc/types/Extent.html +2 -2
- package/apidoc/types/ExtentStrategy.html +2 -2
- package/apidoc/types/FilterVariables.html +7 -6
- package/apidoc/types/GeometryType.html +2 -2
- package/apidoc/types/GlobalId.html +2 -2
- package/apidoc/types/Layout.html +2 -2
- package/apidoc/types/LengthUnit.html +1 -1
- package/apidoc/types/LenientAttributeValue.html +21 -0
- package/apidoc/types/OpaqueString.html +2 -2
- package/apidoc/types/OperationMode.html +2 -2
- package/apidoc/types/Polygon.html +1 -1
- package/apidoc/types/SpatialRelation.html +2 -2
- package/apidoc/types/TablePart.html +2 -2
- package/apidoc/types/UiFeature.html +2 -2
- package/apidoc/types/WorkbookLayerPath.html +2 -2
- package/apidoc/types/WorksheetPlaceholders.html +2 -2
- package/cadenza.d.ts +36 -21
- package/cadenza.js +76 -31
- package/package.json +1 -1
- package/sandbox.html +1 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorkbookLayerPath | Cadenza JS - v10.5.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorkbookLayerPath | Cadenza JS - v10.5.8</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/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><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" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"><a href="https://github.com/DisyInformationssysteme/cadenza.js">Cadenza JS on GitHub</a></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Cadenza JS - v10.5.8</a></div><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" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Cadenza JS</a></li><li><a href="WorkbookLayerPath.html">WorkbookLayerPath</a></li></ul><h1>Type Alias WorkbookLayerPath</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">WorkbookLayerPath</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>Identifies a layer within a workbook map view
|
|
2
2
|
using the print names of the layer and - if the layer is grouped - its ancestors</p>
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/e474d6e17734ab27895594f9bf52ca529a56464e/src/cadenza.js#L106">src/cadenza.js:106</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><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><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><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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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><div class="site-menu"><nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://github.com/DisyInformationssysteme/cadenza.js" class="tsd-nav-link">Cadenza JS on GitHub</a></nav><nav class="tsd-navigation"><a href="../modules.html">Cadenza JS - v10.5.8</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorksheetPlaceholders | Cadenza JS - v10.5.
|
|
2
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base=".."><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorksheetPlaceholders | Cadenza JS - v10.5.8</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/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search"><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" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"><a href="https://github.com/DisyInformationssysteme/cadenza.js">Cadenza JS on GitHub</a></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Cadenza JS - v10.5.8</a></div><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" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Cadenza JS</a></li><li><a href="WorksheetPlaceholders.html">WorksheetPlaceholders</a></li></ul><h1>Type Alias WorksheetPlaceholders</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">WorksheetPlaceholders</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></div><div class="tsd-comment tsd-typography"><p>Maps the worksheet placeholder IDs in report embeddings to the print names of the worksheets to replace them with.</p>
|
|
2
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/e474d6e17734ab27895594f9bf52ca529a56464e/src/cadenza.js#L255">src/cadenza.js:255</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><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><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><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></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><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><div class="site-menu"><nav id="tsd-sidebar-links" class="tsd-navigation"><a href="https://github.com/DisyInformationssysteme/cadenza.js" class="tsd-nav-link">Cadenza JS on GitHub</a></nav><nav class="tsd-navigation"><a href="../modules.html">Cadenza JS - v10.5.8</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/cadenza.d.ts
CHANGED
|
@@ -192,39 +192,39 @@ export class CadenzaClient {
|
|
|
192
192
|
* Set the selection in the currently shown workbook map view.
|
|
193
193
|
*
|
|
194
194
|
* @param {WorkbookLayerPath | string} layer - The data view layer to set the selection in
|
|
195
|
-
* @param {
|
|
195
|
+
* @param {LenientAttributeValue[][]} values - The IDs of the objects to select
|
|
196
196
|
* @param {object} [__namedParameters]
|
|
197
197
|
* @param {GeometryExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the new map extent
|
|
198
198
|
* @return {Promise<void>} A `Promise` for when the selection was set.
|
|
199
199
|
* @postMessage
|
|
200
200
|
*/
|
|
201
|
-
setSelection(layer: WorkbookLayerPath | string, values:
|
|
201
|
+
setSelection(layer: WorkbookLayerPath | string, values: LenientAttributeValue[][], { extentStrategy }?: {
|
|
202
202
|
extentStrategy?: GeometryExtentStrategy | undefined;
|
|
203
203
|
} | undefined, ...args: any[]): Promise<void>;
|
|
204
204
|
/**
|
|
205
205
|
* Add to the selection in the currently shown workbook map view.
|
|
206
206
|
*
|
|
207
207
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
208
|
-
* @param {
|
|
208
|
+
* @param {LenientAttributeValue[][]} values - The IDs of the objects to select
|
|
209
209
|
* @param {object} [__namedParameters]
|
|
210
210
|
* @param {GeometryExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the new map extent
|
|
211
211
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
212
212
|
* @postMessage
|
|
213
213
|
*/
|
|
214
|
-
addSelection(layer: WorkbookLayerPath | string, values:
|
|
214
|
+
addSelection(layer: WorkbookLayerPath | string, values: LenientAttributeValue[][], { extentStrategy }?: {
|
|
215
215
|
extentStrategy?: GeometryExtentStrategy | undefined;
|
|
216
216
|
} | undefined, ...args: any[]): Promise<void>;
|
|
217
217
|
/**
|
|
218
218
|
* Remove from the selection in the currently shown workbook map view.
|
|
219
219
|
*
|
|
220
220
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
221
|
-
* @param {
|
|
221
|
+
* @param {LenientAttributeValue[][]} values - The IDs of the objects to unselect
|
|
222
222
|
* @param {object} [__namedParameters]
|
|
223
223
|
* @param {GeometryExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the new map extent
|
|
224
224
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
225
225
|
* @postMessage
|
|
226
226
|
*/
|
|
227
|
-
removeSelection(layer: WorkbookLayerPath | string, values:
|
|
227
|
+
removeSelection(layer: WorkbookLayerPath | string, values: LenientAttributeValue[][], { extentStrategy }?: {
|
|
228
228
|
extentStrategy?: GeometryExtentStrategy | undefined;
|
|
229
229
|
} | undefined, ...args: any[]): Promise<void>;
|
|
230
230
|
/**
|
|
@@ -390,7 +390,7 @@ export class CadenzaClient {
|
|
|
390
390
|
* @param {EmbeddingTargetId} source - The workbook view to fetch object info from.
|
|
391
391
|
* @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
|
|
392
392
|
* (identified using layer paths or print names)
|
|
393
|
-
* @param {
|
|
393
|
+
* @param {LenientAttributeValue[][]} objectIds - The IDs of the objects to select
|
|
394
394
|
* @param {object} [__namedParameters] - Options
|
|
395
395
|
* @param {FilterVariables} [__namedParameters.filter] - Filter variables
|
|
396
396
|
* @param {Boolean} [__namedParameters.fullGeometries] - Return non-simplified geometries
|
|
@@ -399,7 +399,7 @@ export class CadenzaClient {
|
|
|
399
399
|
* @return {Promise<FeatureCollection>} A `Promise` for the fetch response
|
|
400
400
|
* @throws For invalid arguments
|
|
401
401
|
*/
|
|
402
|
-
fetchObjectInfo(source: EmbeddingTargetId, layerPath: (WorkbookLayerPath | string)[], objectIds:
|
|
402
|
+
fetchObjectInfo(source: EmbeddingTargetId, layerPath: (WorkbookLayerPath | string)[], objectIds: LenientAttributeValue[][], { filter, signal, fullGeometries, useMapSrs }?: {
|
|
403
403
|
filter?: FilterVariables | undefined;
|
|
404
404
|
fullGeometries?: boolean | undefined;
|
|
405
405
|
signal?: AbortSignal | undefined;
|
|
@@ -501,12 +501,12 @@ export class CadenzaClient {
|
|
|
501
501
|
* The extent is transformed according to the `useMapSrs` option.
|
|
502
502
|
*/
|
|
503
503
|
/**
|
|
504
|
-
* @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values:
|
|
504
|
+
* @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values: AttributeValue[][]}>} CadenzaChangeSelectionEvent - When the user changed the selection. `undefined` if no objects were selected.
|
|
505
505
|
*
|
|
506
506
|
* For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
|
|
507
507
|
*/
|
|
508
508
|
/**
|
|
509
|
-
* @typedef {CadenzaEvent<'drillThrough', {context?: string, values:
|
|
509
|
+
* @typedef {CadenzaEvent<'drillThrough', {context?: string, values: AttributeValue[][]}>} CadenzaDrillThroughEvent - When the user executed a POST message drill-through.
|
|
510
510
|
* <p>
|
|
511
511
|
* The event includes a data row for every item in the workbook selection, each row consisting of the values of
|
|
512
512
|
* the attributes that were selected for the POST message content. If the drill-through was executed from a map
|
|
@@ -522,7 +522,7 @@ export class CadenzaClient {
|
|
|
522
522
|
/** @typedef {CadenzaEvent<'editGeometry:cancel'>} CadenzaEditGeometryCancelEvent - When the user cancelled the geometry editing. */
|
|
523
523
|
/** @typedef {CadenzaEvent<'error', {type: string, message?: string}>} CadenzaErrorEvent - An error event that is mapped to a {@link CadenzaError} */
|
|
524
524
|
/**
|
|
525
|
-
* @typedef {CadenzaEvent<'selectObjects:ok', undefined | {layer: WorkbookLayerPath, values:
|
|
525
|
+
* @typedef {CadenzaEvent<'selectObjects:ok', undefined | {layer: WorkbookLayerPath, values: AttributeValue[][]}>} CadenzaSelectObjectsOkEvent - When the user submitted the selection. `undefined` if no objects were selected.
|
|
526
526
|
*
|
|
527
527
|
* For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
|
|
528
528
|
*/
|
|
@@ -820,15 +820,30 @@ export type DataType = 'csv' | 'excel' | 'json' | 'pdf' | 'png';
|
|
|
820
820
|
*/
|
|
821
821
|
export type TablePart = 'columns' | 'values' | 'totals';
|
|
822
822
|
/**
|
|
823
|
-
* -
|
|
823
|
+
* - The value of a Cadenza attribute
|
|
824
|
+
*
|
|
825
|
+
* The exact representation is described in [JSON Representation of Cadenza Object Data](../index.html#json-representation-of-cadenza-object-data).
|
|
826
|
+
*/
|
|
827
|
+
export type AttributeValue = string | number;
|
|
828
|
+
/**
|
|
829
|
+
* - A lenient variant of {@link AttributeValue } that - for convenience - allows more values.
|
|
824
830
|
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
831
|
+
* Here's how the values are converted to proper attribute values:
|
|
832
|
+
*
|
|
833
|
+
* | `LenientAttributeValue` | Conversion to `AttributeType` |
|
|
834
|
+
* |-------------------------|-------------------------------|
|
|
835
|
+
* | `bigint` | `value.toString()` |
|
|
836
|
+
* | `Date` | `value.toISOString()` |
|
|
837
|
+
*/
|
|
838
|
+
export type LenientAttributeValue = AttributeValue | bigint | Date;
|
|
839
|
+
/**
|
|
840
|
+
* - Filter variable names and values
|
|
827
841
|
*
|
|
828
|
-
*
|
|
829
|
-
*
|
|
842
|
+
* - Use `null` to unset a filter variable.
|
|
843
|
+
* - Use a `string` array to pass multiple values for a variable that is used in an `IN` expression.
|
|
844
|
+
* - The name "$spatial" reflects a Spatial filter value and must adhere to type {@link SpatialFilterValue }.
|
|
830
845
|
*/
|
|
831
|
-
export type FilterVariables = Record<string,
|
|
846
|
+
export type FilterVariables = Record<string, LenientAttributeValue | string[] | SpatialFilterValue | null>;
|
|
832
847
|
/**
|
|
833
848
|
* - Defines a spatial filter variable value.
|
|
834
849
|
*/
|
|
@@ -858,7 +873,7 @@ export type Feature = {
|
|
|
858
873
|
/**
|
|
859
874
|
* - The id of the feature
|
|
860
875
|
*/
|
|
861
|
-
objectId:
|
|
876
|
+
objectId: AttributeValue[];
|
|
862
877
|
/**
|
|
863
878
|
* - The geometry
|
|
864
879
|
*/
|
|
@@ -989,7 +1004,7 @@ export type CadenzaChangeExtentEvent = CadenzaEvent<'change:extent', {
|
|
|
989
1004
|
*/
|
|
990
1005
|
export type CadenzaChangeSelectionEvent = CadenzaEvent<'change:selection', undefined | {
|
|
991
1006
|
layer: string[];
|
|
992
|
-
values:
|
|
1007
|
+
values: AttributeValue[][];
|
|
993
1008
|
}>;
|
|
994
1009
|
/**
|
|
995
1010
|
* - When the user executed a POST message drill-through.
|
|
@@ -1002,7 +1017,7 @@ export type CadenzaChangeSelectionEvent = CadenzaEvent<'change:selection', undef
|
|
|
1002
1017
|
*/
|
|
1003
1018
|
export type CadenzaDrillThroughEvent = CadenzaEvent<'drillThrough', {
|
|
1004
1019
|
context?: string;
|
|
1005
|
-
values:
|
|
1020
|
+
values: AttributeValue[][];
|
|
1006
1021
|
}>;
|
|
1007
1022
|
/**
|
|
1008
1023
|
* - When the user changed the geometry. `FeatureCollection` if multiple features are present on the edit layer, but the original defined type is not multi-geometry. This is also the case if the dialog was instantiated from a geometry and the original defined type is inherited. `undefined` if no feature is present on the edit layer.
|
|
@@ -1044,7 +1059,7 @@ export type CadenzaErrorEvent = CadenzaEvent<'error', {
|
|
|
1044
1059
|
*/
|
|
1045
1060
|
export type CadenzaSelectObjectsOkEvent = CadenzaEvent<'selectObjects:ok', undefined | {
|
|
1046
1061
|
layer: string[];
|
|
1047
|
-
values:
|
|
1062
|
+
values: AttributeValue[][];
|
|
1048
1063
|
}>;
|
|
1049
1064
|
/**
|
|
1050
1065
|
* - When the user cancelled the selection.
|
package/cadenza.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
// This placeholder is replaced when Cadenza JS is released,
|
|
20
20
|
// i.e. during development, the version is not available.
|
|
21
|
-
const CADENZAJS_VERSION = '10.5.
|
|
21
|
+
const CADENZAJS_VERSION = '10.5.8';
|
|
22
22
|
/**
|
|
23
23
|
* Creates an instance of the Cadenza JS client.
|
|
24
24
|
*
|
|
@@ -187,13 +187,26 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
187
187
|
*/
|
|
188
188
|
/** @typedef {'columns' | 'values' | 'totals'} TablePart - A part of a table to export */
|
|
189
189
|
/**
|
|
190
|
-
* @typedef {
|
|
190
|
+
* @typedef {string | number} AttributeValue - The value of a Cadenza attribute
|
|
191
191
|
*
|
|
192
|
-
*
|
|
193
|
-
|
|
192
|
+
* The exact representation is described in [JSON Representation of Cadenza Object Data](../index.html#json-representation-of-cadenza-object-data).
|
|
193
|
+
*/
|
|
194
|
+
/**
|
|
195
|
+
* @typedef {AttributeValue | bigint | Date} LenientAttributeValue - A lenient variant of {@link AttributeValue} that - for convenience - allows more values.
|
|
196
|
+
*
|
|
197
|
+
* Here's how the values are converted to proper attribute values:
|
|
198
|
+
*
|
|
199
|
+
* | `LenientAttributeValue` | Conversion to `AttributeType` |
|
|
200
|
+
* |-------------------------|-------------------------------|
|
|
201
|
+
* | `bigint` | `value.toString()` |
|
|
202
|
+
* | `Date` | `value.toISOString()` |
|
|
203
|
+
*/
|
|
204
|
+
/**
|
|
205
|
+
* @typedef {Record<string, LenientAttributeValue | string[] | SpatialFilterValue | null>} FilterVariables - Filter variable names and values
|
|
194
206
|
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
207
|
+
* - Use `null` to unset a filter variable.
|
|
208
|
+
* - Use a `string` array to pass multiple values for a variable that is used in an `IN` expression.
|
|
209
|
+
* - The name "$spatial" reflects a Spatial filter value and must adhere to type {@link SpatialFilterValue}.
|
|
197
210
|
*/
|
|
198
211
|
/**
|
|
199
212
|
* @typedef SpatialFilterValue - Defines a spatial filter variable value.
|
|
@@ -208,7 +221,7 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
208
221
|
/**
|
|
209
222
|
* @typedef Feature - A adapted [GeoJSON](https://geojson.org/) feature object.
|
|
210
223
|
* @property {'Feature'} type - The object's type
|
|
211
|
-
* @property {
|
|
224
|
+
* @property {AttributeValue[]} objectId - The id of the feature
|
|
212
225
|
* @property {Geometry} geometry - The geometry
|
|
213
226
|
* @property {Record<string, string>} properties - The formated properties
|
|
214
227
|
* @property {number} [area] - The area of a `Polygon` feature
|
|
@@ -506,8 +519,9 @@ export class CadenzaClient {
|
|
|
506
519
|
*/
|
|
507
520
|
setFilter(filter) {
|
|
508
521
|
this.#log('CadenzaClient#setFilter', ...arguments);
|
|
509
|
-
|
|
510
|
-
|
|
522
|
+
return this.#postRequest('setFilter', {
|
|
523
|
+
filter: sanitizeAndValidateFilterVariables(filter),
|
|
524
|
+
});
|
|
511
525
|
}
|
|
512
526
|
/**
|
|
513
527
|
* Set the visibility of a layer in the currently shown workbook map view.
|
|
@@ -532,7 +546,7 @@ export class CadenzaClient {
|
|
|
532
546
|
* Set the selection in the currently shown workbook map view.
|
|
533
547
|
*
|
|
534
548
|
* @param {WorkbookLayerPath | string} layer - The data view layer to set the selection in
|
|
535
|
-
* @param {
|
|
549
|
+
* @param {LenientAttributeValue[][]} values - The IDs of the objects to select
|
|
536
550
|
* @param {object} [__namedParameters]
|
|
537
551
|
* @param {GeometryExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the new map extent
|
|
538
552
|
* @return {Promise<void>} A `Promise` for when the selection was set.
|
|
@@ -542,7 +556,7 @@ export class CadenzaClient {
|
|
|
542
556
|
this.#log('CadenzaClient#setSelection', ...arguments);
|
|
543
557
|
const selectionResult = this.#postRequest('setSelection', {
|
|
544
558
|
layer: array(layer),
|
|
545
|
-
values,
|
|
559
|
+
values: values.map(sanitizeAndValidateAttributeValues),
|
|
546
560
|
});
|
|
547
561
|
this.#setExtentStrategy(extentStrategy);
|
|
548
562
|
return selectionResult;
|
|
@@ -551,7 +565,7 @@ export class CadenzaClient {
|
|
|
551
565
|
* Add to the selection in the currently shown workbook map view.
|
|
552
566
|
*
|
|
553
567
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
554
|
-
* @param {
|
|
568
|
+
* @param {LenientAttributeValue[][]} values - The IDs of the objects to select
|
|
555
569
|
* @param {object} [__namedParameters]
|
|
556
570
|
* @param {GeometryExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the new map extent
|
|
557
571
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
@@ -561,7 +575,7 @@ export class CadenzaClient {
|
|
|
561
575
|
this.#log('CadenzaClient#addSelection', ...arguments);
|
|
562
576
|
const selectionResult = this.#postRequest('addSelection', {
|
|
563
577
|
layer: array(layer),
|
|
564
|
-
values,
|
|
578
|
+
values: values.map(sanitizeAndValidateAttributeValues),
|
|
565
579
|
});
|
|
566
580
|
this.#setExtentStrategy(extentStrategy);
|
|
567
581
|
return selectionResult;
|
|
@@ -570,7 +584,7 @@ export class CadenzaClient {
|
|
|
570
584
|
* Remove from the selection in the currently shown workbook map view.
|
|
571
585
|
*
|
|
572
586
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
573
|
-
* @param {
|
|
587
|
+
* @param {LenientAttributeValue[][]} values - The IDs of the objects to unselect
|
|
574
588
|
* @param {object} [__namedParameters]
|
|
575
589
|
* @param {GeometryExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the new map extent
|
|
576
590
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
@@ -580,7 +594,7 @@ export class CadenzaClient {
|
|
|
580
594
|
this.#log('CadenzaClient#removeSelection', ...arguments);
|
|
581
595
|
const selectionResult = this.#postRequest('removeSelection', {
|
|
582
596
|
layer: array(layer),
|
|
583
|
-
values,
|
|
597
|
+
values: values.map(sanitizeAndValidateAttributeValues),
|
|
584
598
|
});
|
|
585
599
|
this.#setExtentStrategy(extentStrategy);
|
|
586
600
|
return selectionResult;
|
|
@@ -1107,7 +1121,7 @@ export class CadenzaClient {
|
|
|
1107
1121
|
* @param {EmbeddingTargetId} source - The workbook view to fetch object info from.
|
|
1108
1122
|
* @param {(WorkbookLayerPath | string)[]} layerPath - Layer path to identify the layer
|
|
1109
1123
|
* (identified using layer paths or print names)
|
|
1110
|
-
* @param {
|
|
1124
|
+
* @param {LenientAttributeValue[][]} objectIds - The IDs of the objects to select
|
|
1111
1125
|
* @param {object} [__namedParameters] - Options
|
|
1112
1126
|
* @param {FilterVariables} [__namedParameters.filter] - Filter variables
|
|
1113
1127
|
* @param {Boolean} [__namedParameters.fullGeometries] - Return non-simplified geometries
|
|
@@ -1123,7 +1137,7 @@ export class CadenzaClient {
|
|
|
1123
1137
|
});
|
|
1124
1138
|
return this.#fetch(resolvePath(source) + '/objectinfo', params, signal, JSON.stringify({
|
|
1125
1139
|
fullGeometries,
|
|
1126
|
-
objectIds,
|
|
1140
|
+
objectIds: objectIds.map(sanitizeAndValidateAttributeValues),
|
|
1127
1141
|
layerPath: array(layerPath),
|
|
1128
1142
|
useMapSrs,
|
|
1129
1143
|
})).then((response) => response.json());
|
|
@@ -1268,7 +1282,7 @@ export class CadenzaClient {
|
|
|
1268
1282
|
disabledUiFeatures.forEach((feature) => assert(validUiFeature(feature), `Invalid UI feature: ${feature}`));
|
|
1269
1283
|
}
|
|
1270
1284
|
if (filter) {
|
|
1271
|
-
|
|
1285
|
+
filter = sanitizeAndValidateFilterVariables(filter);
|
|
1272
1286
|
}
|
|
1273
1287
|
if (geometryType) {
|
|
1274
1288
|
assertValidGeometryType(geometryType);
|
|
@@ -1307,7 +1321,7 @@ export class CadenzaClient {
|
|
|
1307
1321
|
...(filter &&
|
|
1308
1322
|
Object.fromEntries(Object.entries(filter).map(([variable, value]) => [
|
|
1309
1323
|
`filter.${variable}`,
|
|
1310
|
-
|
|
1324
|
+
value,
|
|
1311
1325
|
]))),
|
|
1312
1326
|
...(worksheetPlaceholders &&
|
|
1313
1327
|
Object.fromEntries(Object.entries(worksheetPlaceholders).map(([placeholderId, worksheetPrintName]) => [
|
|
@@ -1442,10 +1456,7 @@ function assertSupportedDataType(
|
|
|
1442
1456
|
assert(supportedTypes.includes(type), `Invalid data type: ${type}`);
|
|
1443
1457
|
}
|
|
1444
1458
|
function validSpatialFilterValue(/** @type SpatialFilterValue */ $spatial) {
|
|
1445
|
-
if ($spatial === null) {
|
|
1446
|
-
return true;
|
|
1447
|
-
}
|
|
1448
|
-
if (typeof $spatial === 'object') {
|
|
1459
|
+
if (typeof $spatial === 'object' && $spatial != null) {
|
|
1449
1460
|
return (validSpatialRelation($spatial.spatialRelation) &&
|
|
1450
1461
|
validSpatialFilterGeometry($spatial.geometry));
|
|
1451
1462
|
}
|
|
@@ -1457,11 +1468,45 @@ function validSpatialRelation(/** @type SpatialRelation */ spatialRelation) {
|
|
|
1457
1468
|
function validSpatialFilterGeometry(/** @type Polygon */ geometry) {
|
|
1458
1469
|
return typeof geometry === 'object' && geometry.type === 'Polygon';
|
|
1459
1470
|
}
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1471
|
+
/** @return {AttributeValue} */
|
|
1472
|
+
function sanitizeAttributeValue(/** @type {LenientAttributeValue} */ value) {
|
|
1473
|
+
if (typeof value === 'bigint') {
|
|
1474
|
+
value = value.toString();
|
|
1475
|
+
}
|
|
1476
|
+
if (value instanceof Date) {
|
|
1477
|
+
value = value.toISOString();
|
|
1478
|
+
}
|
|
1479
|
+
return value;
|
|
1480
|
+
}
|
|
1481
|
+
function validAttributeValue(/** @type unknown */ value) {
|
|
1482
|
+
return typeof value === 'string' || typeof value === 'number';
|
|
1483
|
+
}
|
|
1484
|
+
function sanitizeAndValidateAttributeValues(
|
|
1485
|
+
/** @type {LenientAttributeValue[]} */ values) {
|
|
1486
|
+
return values.map((value) => {
|
|
1487
|
+
value = sanitizeAttributeValue(value);
|
|
1488
|
+
assert(validAttributeValue(value), `Invalid attribute value`);
|
|
1489
|
+
return value;
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
function sanitizeAndValidateFilterVariables(
|
|
1493
|
+
/** @type {FilterVariables} */ filter) {
|
|
1494
|
+
return Object.fromEntries(Object.entries(filter).map(([varName, value = null]) => {
|
|
1495
|
+
if (varName === '$spatial') {
|
|
1496
|
+
assert(value == null ||
|
|
1497
|
+
validSpatialFilterValue(/** @type {SpatialFilterValue} */ (value)), 'Invalid value for spatial filter ($spatial)');
|
|
1498
|
+
}
|
|
1499
|
+
else {
|
|
1500
|
+
assert(validKebabCaseString(varName), `Invalid filter variable name: ${varName}`);
|
|
1501
|
+
if (value != null &&
|
|
1502
|
+
!(Array.isArray(value) && value.every((v) => typeof v === 'string'))) {
|
|
1503
|
+
value = sanitizeAttributeValue(
|
|
1504
|
+
/** @type {LenientAttributeValue} */ (value));
|
|
1505
|
+
assert(validAttributeValue(value), `Invalid value for filter variable "${varName}"`);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
return [varName, value];
|
|
1509
|
+
}));
|
|
1465
1510
|
}
|
|
1466
1511
|
function assertValidWorksheetPlaceholdersValues(
|
|
1467
1512
|
/** @type {WorksheetPlaceholders} */ worksheetPlaceholders) {
|
|
@@ -1577,12 +1622,12 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
|
|
|
1577
1622
|
* The extent is transformed according to the `useMapSrs` option.
|
|
1578
1623
|
*/
|
|
1579
1624
|
/**
|
|
1580
|
-
* @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values:
|
|
1625
|
+
* @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values: AttributeValue[][]}>} CadenzaChangeSelectionEvent - When the user changed the selection. `undefined` if no objects were selected.
|
|
1581
1626
|
*
|
|
1582
1627
|
* For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
|
|
1583
1628
|
*/
|
|
1584
1629
|
/**
|
|
1585
|
-
* @typedef {CadenzaEvent<'drillThrough', {context?: string, values:
|
|
1630
|
+
* @typedef {CadenzaEvent<'drillThrough', {context?: string, values: AttributeValue[][]}>} CadenzaDrillThroughEvent - When the user executed a POST message drill-through.
|
|
1586
1631
|
* <p>
|
|
1587
1632
|
* The event includes a data row for every item in the workbook selection, each row consisting of the values of
|
|
1588
1633
|
* the attributes that were selected for the POST message content. If the drill-through was executed from a map
|
|
@@ -1598,7 +1643,7 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
|
|
|
1598
1643
|
/** @typedef {CadenzaEvent<'editGeometry:cancel'>} CadenzaEditGeometryCancelEvent - When the user cancelled the geometry editing. */
|
|
1599
1644
|
/** @typedef {CadenzaEvent<'error', {type: string, message?: string}>} CadenzaErrorEvent - An error event that is mapped to a {@link CadenzaError} */
|
|
1600
1645
|
/**
|
|
1601
|
-
* @typedef {CadenzaEvent<'selectObjects:ok', undefined | {layer: WorkbookLayerPath, values:
|
|
1646
|
+
* @typedef {CadenzaEvent<'selectObjects:ok', undefined | {layer: WorkbookLayerPath, values: AttributeValue[][]}>} CadenzaSelectObjectsOkEvent - When the user submitted the selection. `undefined` if no objects were selected.
|
|
1602
1647
|
*
|
|
1603
1648
|
* For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
|
|
1604
1649
|
*/
|
package/package.json
CHANGED
package/sandbox.html
CHANGED
|
@@ -448,6 +448,7 @@
|
|
|
448
448
|
<small>
|
|
449
449
|
<p>A JSON object with filter variable names and values</p>
|
|
450
450
|
<p>Dates need to be ISO strings<br>(e.g. <code>"2023-11-17T17:12:06.175Z"</code>).<br>Use <code>"{{currentDate}}"</code> for the current date.</p>
|
|
451
|
+
<p>Longs need to be strings (e.g. <code>"1234567890"</code>).</p>
|
|
451
452
|
<p>Pass multiple values for an <code>IN</code> expression as <code>["a", "b", ...]</code></p>
|
|
452
453
|
<p>Spatial filter values can be set using the dedicated <code>"$spatial"</code> variable name:
|
|
453
454
|
<ul>
|