@disy/cadenza.js 10.5.1 → 10.5.3
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 +13 -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 -24
- package/apidoc/classes/CadenzaError.html +5 -5
- package/apidoc/functions/cadenza.html +4 -4
- package/apidoc/index.html +19 -8
- 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/CadenzaActionEvent.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 -0
- package/apidoc/types/CadenzaEditGeometryDeleteEvent.html +2 -0
- package/apidoc/types/CadenzaEditGeometryEditEvent.html +2 -0
- 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 +2 -2
- 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/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 -0
- package/cadenza.d.ts +40 -5
- package/cadenza.js +41 -6
- package/package.json +1 -1
- package/sandbox.html +24 -3
package/cadenza.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export class CadenzaClient {
|
|
|
61
61
|
* @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
|
|
62
62
|
* @param {String} [__namedParameters.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
|
|
63
63
|
* @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
|
|
64
|
+
* @param {WorksheetPlaceholders} [__namedParameters.worksheetPlaceholders] - Maps the worksheet placeholder IDs in report embeddings to the print names of the worksheets to replace them with.
|
|
64
65
|
* @param {Layout} [__namedParameters.layout] - The layout to be used; the dashboard layout is used by default or the linear layout if there is not enough space.
|
|
65
66
|
* @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
|
|
66
67
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
@@ -70,7 +71,7 @@ export class CadenzaClient {
|
|
|
70
71
|
* - {@link CadenzaActionEvent}
|
|
71
72
|
* @embed
|
|
72
73
|
*/
|
|
73
|
-
show(source: PageSource | EmbeddingTargetId, { dataType, disabledUiFeatures, expandNavigator, filter, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, operationMode, layout, signal, }?: {
|
|
74
|
+
show(source: PageSource | EmbeddingTargetId, { dataType, disabledUiFeatures, expandNavigator, filter, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, operationMode, worksheetPlaceholders, layout, signal, }?: {
|
|
74
75
|
dataType?: DataType | undefined;
|
|
75
76
|
disabledUiFeatures?: UiFeature[] | undefined;
|
|
76
77
|
expandNavigator?: boolean | undefined;
|
|
@@ -80,6 +81,7 @@ export class CadenzaClient {
|
|
|
80
81
|
highlightGlobalId?: GlobalId | undefined;
|
|
81
82
|
labelSet?: string | undefined;
|
|
82
83
|
operationMode?: OperationMode | undefined;
|
|
84
|
+
worksheetPlaceholders?: WorksheetPlaceholders | undefined;
|
|
83
85
|
layout?: Layout | undefined;
|
|
84
86
|
signal?: AbortSignal | undefined;
|
|
85
87
|
} | undefined, ...args: any[]): Promise<void>;
|
|
@@ -104,7 +106,7 @@ export class CadenzaClient {
|
|
|
104
106
|
*
|
|
105
107
|
* @param {EmbeddingTargetId} mapView - The workbook map view to show
|
|
106
108
|
* @param {object} [__namedParameters] - Options
|
|
107
|
-
* @param {LayerDefinition[]} [__namedParameters.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing.
|
|
109
|
+
* @param {LayerDefinition[]} [__namedParameters.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing. IMPORTANT: The Cadenza referenced with `cadenzaClient` must be configured to support the import of GeoJSON, and the (system) privileges of the corresponding user must also be set in such a way that the import of GeoJSON is possible.
|
|
108
110
|
* @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
|
|
109
111
|
* @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
|
|
110
112
|
* @param {ExtentStrategy} [__namedParameters.extentStrategy] - Defines the initial map extent; If not given, Cadenza's default logic is used.
|
|
@@ -271,6 +273,9 @@ export class CadenzaClient {
|
|
|
271
273
|
* @fires
|
|
272
274
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
273
275
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
276
|
+
* - {@link CadenzaEditGeometryCreateEvent}
|
|
277
|
+
* - {@link CadenzaEditGeometryEditEvent}
|
|
278
|
+
* - {@link CadenzaEditGeometryDeleteEvent}
|
|
274
279
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
275
280
|
* @embed
|
|
276
281
|
*/
|
|
@@ -286,6 +291,9 @@ export class CadenzaClient {
|
|
|
286
291
|
* @fires
|
|
287
292
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
288
293
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
294
|
+
* - {@link CadenzaEditGeometryCreateEvent}
|
|
295
|
+
* - {@link CadenzaEditGeometryEditEvent}
|
|
296
|
+
* - {@link CadenzaEditGeometryDeleteEvent}
|
|
289
297
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
290
298
|
* @embed
|
|
291
299
|
*/
|
|
@@ -439,6 +447,9 @@ export class CadenzaClient {
|
|
|
439
447
|
* | 'change:selection'
|
|
440
448
|
* | 'drillThrough'
|
|
441
449
|
* | 'editGeometry:ok'
|
|
450
|
+
* | 'editGeometry:create'
|
|
451
|
+
* | 'editGeometry:edit'
|
|
452
|
+
* | 'editGeometry:delete'
|
|
442
453
|
* | 'editGeometry:update'
|
|
443
454
|
* | 'editGeometry:cancel'
|
|
444
455
|
* | 'reload'
|
|
@@ -453,6 +464,9 @@ export class CadenzaClient {
|
|
|
453
464
|
* : T extends 'drillThrough' ? CadenzaDrillThroughEvent
|
|
454
465
|
* : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent
|
|
455
466
|
* : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent
|
|
467
|
+
* : T extends 'editGeometry:create' ? CadenzaEditGeometryCreateEvent
|
|
468
|
+
* : T extends 'editGeometry:edit' ? CadenzaEditGeometryEditEvent
|
|
469
|
+
* : T extends 'editGeometry:delete' ? CadenzaEditGeometryDeleteEvent
|
|
456
470
|
* : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent
|
|
457
471
|
* : T extends 'reload' ? CadenzaReloadEvent
|
|
458
472
|
* : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
|
|
@@ -486,6 +500,9 @@ export class CadenzaClient {
|
|
|
486
500
|
*/
|
|
487
501
|
/** @typedef {CadenzaEvent<'editGeometry:update', FeatureCollection | Feature | undefined>} CadenzaEditGeometryUpdateEvent - 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. */
|
|
488
502
|
/** @typedef {CadenzaEvent<'editGeometry:ok', FeatureCollection | Feature>} CadenzaEditGeometryOkEvent - When the user submitted the geometry. `FeatureCollection` if batch editing is enabled. */
|
|
503
|
+
/** @typedef {CadenzaEvent<'editGeometry:create', FeatureCollection | Feature>} CadenzaEditGeometryCreateEvent - Whenever new geometry features were created. `Feature` if only one feature was created. Only available in batch mode */
|
|
504
|
+
/** @typedef {CadenzaEvent<'editGeometry:edit', Feature>} CadenzaEditGeometryEditEvent - Whenever a geometry feature was edited. Only available in batch mode */
|
|
505
|
+
/** @typedef {CadenzaEvent<'editGeometry:delete', {featureIds: any[][]}>} CadenzaEditGeometryDeleteEvent - Whenever geometry features were deleted. Only available in batch mode */
|
|
489
506
|
/** @typedef {CadenzaEvent<'editGeometry:cancel'>} CadenzaEditGeometryCancelEvent - When the user cancelled the geometry editing. */
|
|
490
507
|
/** @typedef {CadenzaEvent<'error', {type: string, message?: string}>} CadenzaErrorEvent - An error event that is mapped to a {@link CadenzaError} */
|
|
491
508
|
/**
|
|
@@ -736,7 +753,7 @@ export type StaticExtentStrategy = {
|
|
|
736
753
|
*/
|
|
737
754
|
export type CommonEditGeometryOptions = {
|
|
738
755
|
/**
|
|
739
|
-
* - Layer definitions to be imported and shown in the background, as a basis for the drawing.
|
|
756
|
+
* - Layer definitions to be imported and shown in the background, as a basis for the drawing. IMPORTANT: The Cadenza referenced with `cadenzaClient` must be configured to support the import of GeoJSON, and the (system) privileges of the corresponding user must also be set in such a way that the import of GeoJSON is possible.
|
|
740
757
|
*/
|
|
741
758
|
additionalLayers?: LayerDefinition[] | undefined;
|
|
742
759
|
/**
|
|
@@ -856,6 +873,10 @@ export type FeatureCollection = {
|
|
|
856
873
|
*/
|
|
857
874
|
features: Feature[];
|
|
858
875
|
};
|
|
876
|
+
/**
|
|
877
|
+
* - Maps the worksheet placeholder IDs in report embeddings to the print names of the worksheets to replace them with.
|
|
878
|
+
*/
|
|
879
|
+
export type WorksheetPlaceholders = Record<string, string>;
|
|
859
880
|
/**
|
|
860
881
|
* - Result object of function fetchAreaIntersections
|
|
861
882
|
*/
|
|
@@ -913,8 +934,8 @@ export type Layout = 'dashboard' | 'linear';
|
|
|
913
934
|
/**
|
|
914
935
|
* - An event type to subscribe to using {@link CadenzaClienton }
|
|
915
936
|
*/
|
|
916
|
-
export type CadenzaEventType = 'action' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:update' | 'editGeometry:cancel' | 'reload' | 'selectObjects:ok' | 'selectObjects:cancel';
|
|
917
|
-
export type CadenzaEventByType<T extends CadenzaEventType> = T extends 'action' ? CadenzaActionEvent : T extends 'change:selection' ? CadenzaChangeSelectionEvent : T extends 'drillThrough' ? CadenzaDrillThroughEvent : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent : T extends 'reload' ? CadenzaReloadEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : never;
|
|
937
|
+
export type CadenzaEventType = 'action' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:create' | 'editGeometry:edit' | 'editGeometry:delete' | 'editGeometry:update' | 'editGeometry:cancel' | 'reload' | 'selectObjects:ok' | 'selectObjects:cancel';
|
|
938
|
+
export type CadenzaEventByType<T extends CadenzaEventType> = T extends 'action' ? CadenzaActionEvent : T extends 'change:selection' ? CadenzaChangeSelectionEvent : T extends 'drillThrough' ? CadenzaDrillThroughEvent : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent : T extends 'editGeometry:create' ? CadenzaEditGeometryCreateEvent : T extends 'editGeometry:edit' ? CadenzaEditGeometryEditEvent : T extends 'editGeometry:delete' ? CadenzaEditGeometryDeleteEvent : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent : T extends 'reload' ? CadenzaReloadEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : never;
|
|
918
939
|
/**
|
|
919
940
|
* - A Cadenza `postMessage()` event
|
|
920
941
|
*/
|
|
@@ -964,6 +985,20 @@ export type CadenzaEditGeometryUpdateEvent = CadenzaEvent<'editGeometry:update',
|
|
|
964
985
|
* - When the user submitted the geometry. `FeatureCollection` if batch editing is enabled.
|
|
965
986
|
*/
|
|
966
987
|
export type CadenzaEditGeometryOkEvent = CadenzaEvent<'editGeometry:ok', FeatureCollection | Feature>;
|
|
988
|
+
/**
|
|
989
|
+
* - Whenever new geometry features were created. `Feature` if only one feature was created. Only available in batch mode
|
|
990
|
+
*/
|
|
991
|
+
export type CadenzaEditGeometryCreateEvent = CadenzaEvent<'editGeometry:create', FeatureCollection | Feature>;
|
|
992
|
+
/**
|
|
993
|
+
* - Whenever a geometry feature was edited. Only available in batch mode
|
|
994
|
+
*/
|
|
995
|
+
export type CadenzaEditGeometryEditEvent = CadenzaEvent<'editGeometry:edit', Feature>;
|
|
996
|
+
/**
|
|
997
|
+
* - Whenever geometry features were deleted. Only available in batch mode
|
|
998
|
+
*/
|
|
999
|
+
export type CadenzaEditGeometryDeleteEvent = CadenzaEvent<'editGeometry:delete', {
|
|
1000
|
+
featureIds: any[][];
|
|
1001
|
+
}>;
|
|
967
1002
|
/**
|
|
968
1003
|
* - When the user cancelled the geometry editing.
|
|
969
1004
|
*/
|
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.3';
|
|
22
22
|
/**
|
|
23
23
|
* Creates an instance of the Cadenza JS client.
|
|
24
24
|
*
|
|
@@ -169,7 +169,7 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
169
169
|
*/
|
|
170
170
|
/**
|
|
171
171
|
* @typedef CommonEditGeometryOptions - Common options for the initialization of the geometry editor.
|
|
172
|
-
* @property {LayerDefinition[]} [additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing.
|
|
172
|
+
* @property {LayerDefinition[]} [additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing. IMPORTANT: The Cadenza referenced with `cadenzaClient` must be configured to support the import of GeoJSON, and the (system) privileges of the corresponding user must also be set in such a way that the import of GeoJSON is possible.
|
|
173
173
|
* @property {UiFeature[]} [disabledUiFeatures] - Cadenza UI features to disable
|
|
174
174
|
* @property {ExtentStrategy} [extentStrategy] - Defines the initial map extent; If not given, Cadenza's default logic is used.
|
|
175
175
|
* @property {FilterVariables} [filter] - Filter variables
|
|
@@ -219,6 +219,9 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
219
219
|
* @property {'FeatureCollection'} type - The object's type
|
|
220
220
|
* @property {Feature[]} features - The features within this collection
|
|
221
221
|
*/
|
|
222
|
+
/**
|
|
223
|
+
* @typedef {Record<string, string>} WorksheetPlaceholders - Maps the worksheet placeholder IDs in report embeddings to the print names of the worksheets to replace them with.
|
|
224
|
+
*/
|
|
222
225
|
/**
|
|
223
226
|
* @typedef AreaIntersectionsResult - Result object of function fetchAreaIntersections
|
|
224
227
|
* @property {FeatureCollection} results - Results of the geometry intersection
|
|
@@ -348,6 +351,7 @@ export class CadenzaClient {
|
|
|
348
351
|
* @param {GlobalId} [__namedParameters.highlightGlobalId] - The ID of an item to highlight / expand in the navigator
|
|
349
352
|
* @param {String} [__namedParameters.labelSet] - The name of a label set defined in the `basicweb-config.xml` (only supported for the welcome page)
|
|
350
353
|
* @param {OperationMode} [__namedParameters.operationMode] - The mode in which a workbook should be operated
|
|
354
|
+
* @param {WorksheetPlaceholders} [__namedParameters.worksheetPlaceholders] - Maps the worksheet placeholder IDs in report embeddings to the print names of the worksheets to replace them with.
|
|
351
355
|
* @param {Layout} [__namedParameters.layout] - The layout to be used; the dashboard layout is used by default or the linear layout if there is not enough space.
|
|
352
356
|
* @param {AbortSignal} [__namedParameters.signal] - A signal to abort the iframe loading
|
|
353
357
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
@@ -357,7 +361,7 @@ export class CadenzaClient {
|
|
|
357
361
|
* - {@link CadenzaActionEvent}
|
|
358
362
|
* @embed
|
|
359
363
|
*/
|
|
360
|
-
show(source, { dataType, disabledUiFeatures, expandNavigator, filter, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, operationMode, layout, signal, } = {}) {
|
|
364
|
+
show(source, { dataType, disabledUiFeatures, expandNavigator, filter, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, operationMode, worksheetPlaceholders, layout, signal, } = {}) {
|
|
361
365
|
this.#log('CadenzaClient#show', ...arguments);
|
|
362
366
|
if (dataType) {
|
|
363
367
|
assertSupportedDataType(dataType, ['pdf']);
|
|
@@ -378,6 +382,7 @@ export class CadenzaClient {
|
|
|
378
382
|
labelSet,
|
|
379
383
|
operationMode,
|
|
380
384
|
layout,
|
|
385
|
+
worksheetPlaceholders,
|
|
381
386
|
});
|
|
382
387
|
return this.#show(resolvePath(source), params, signal);
|
|
383
388
|
}
|
|
@@ -407,7 +412,7 @@ export class CadenzaClient {
|
|
|
407
412
|
*
|
|
408
413
|
* @param {EmbeddingTargetId} mapView - The workbook map view to show
|
|
409
414
|
* @param {object} [__namedParameters] - Options
|
|
410
|
-
* @param {LayerDefinition[]} [__namedParameters.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing.
|
|
415
|
+
* @param {LayerDefinition[]} [__namedParameters.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing. IMPORTANT: The Cadenza referenced with `cadenzaClient` must be configured to support the import of GeoJSON, and the (system) privileges of the corresponding user must also be set in such a way that the import of GeoJSON is possible.
|
|
411
416
|
* @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
|
|
412
417
|
* @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
|
|
413
418
|
* @param {ExtentStrategy} [__namedParameters.extentStrategy] - Defines the initial map extent; If not given, Cadenza's default logic is used.
|
|
@@ -673,6 +678,9 @@ export class CadenzaClient {
|
|
|
673
678
|
* @fires
|
|
674
679
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
675
680
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
681
|
+
* - {@link CadenzaEditGeometryCreateEvent}
|
|
682
|
+
* - {@link CadenzaEditGeometryEditEvent}
|
|
683
|
+
* - {@link CadenzaEditGeometryDeleteEvent}
|
|
676
684
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
677
685
|
* @embed
|
|
678
686
|
*/
|
|
@@ -712,6 +720,9 @@ export class CadenzaClient {
|
|
|
712
720
|
* @fires
|
|
713
721
|
* - {@link CadenzaEditGeometryUpdateEvent}
|
|
714
722
|
* - {@link CadenzaEditGeometryOkEvent}
|
|
723
|
+
* - {@link CadenzaEditGeometryCreateEvent}
|
|
724
|
+
* - {@link CadenzaEditGeometryEditEvent}
|
|
725
|
+
* - {@link CadenzaEditGeometryDeleteEvent}
|
|
715
726
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
716
727
|
* @embed
|
|
717
728
|
*/
|
|
@@ -745,7 +756,7 @@ export class CadenzaClient {
|
|
|
745
756
|
/**
|
|
746
757
|
* @param {object} __namedParameters - Options
|
|
747
758
|
* @param [__namedParameters.geometry] {Geometry} - The geometry to edit
|
|
748
|
-
* @param [__namedParameters.additionalLayers] {LayerDefinition[]} - Layer definitions to be imported and shown in the background, as a basis for the drawing.
|
|
759
|
+
* @param [__namedParameters.additionalLayers] {LayerDefinition[]} - Layer definitions to be imported and shown in the background, as a basis for the drawing. IMPORTANT: The Cadenza referenced with `cadenzaClient` must be configured to support the import of GeoJSON, and the (system) privileges of the corresponding user must also be set in such a way that the import of GeoJSON is possible.
|
|
749
760
|
* @param [__namedParameters.validExtentStrategy] {ExtentStrategy} - Defines the initial map extent; If not given, Cadenza's default logic is used.
|
|
750
761
|
* @param [__namedParameters.features] {FeatureCollection} - The features to edit. The last feature in this collection is directly set up for editing.
|
|
751
762
|
* @returns {Promise<Awaited<unknown>[]>}
|
|
@@ -1181,6 +1192,7 @@ export class CadenzaClient {
|
|
|
1181
1192
|
* @param {WorkbookLayerPath[]} [params.layers]
|
|
1182
1193
|
* @param {number} [params.minScale]
|
|
1183
1194
|
* @param {OperationMode} [params.operationMode]
|
|
1195
|
+
* @param {WorksheetPlaceholders} [params.worksheetPlaceholders]
|
|
1184
1196
|
* @param {TablePart[]} [params.parts]
|
|
1185
1197
|
* @param {'MAP'} [params.targetType]
|
|
1186
1198
|
* @param {SnappingOptions} [params.snapping]
|
|
@@ -1189,7 +1201,7 @@ export class CadenzaClient {
|
|
|
1189
1201
|
* @param {Layout} [params.layout]
|
|
1190
1202
|
* @return {URLSearchParams}
|
|
1191
1203
|
*/
|
|
1192
|
-
#createParams({ action, batchModeEnabled, dataType, disabledUiFeatures, expandNavigator, fileName, filter, geometryType, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, layers, minScale, operationMode, parts, targetType, snapping, useMapSrs, validExtentStrategy, layout, }) {
|
|
1204
|
+
#createParams({ action, batchModeEnabled, dataType, disabledUiFeatures, expandNavigator, fileName, filter, geometryType, hideMainHeaderAndFooter, hideWorkbookToolBar, highlightGlobalId, labelSet, layers, minScale, operationMode, worksheetPlaceholders, parts, targetType, snapping, useMapSrs, validExtentStrategy, layout, }) {
|
|
1193
1205
|
if (disabledUiFeatures) {
|
|
1194
1206
|
disabledUiFeatures.forEach((feature) => assert(validUiFeature(feature), `Invalid UI feature: ${feature}`));
|
|
1195
1207
|
}
|
|
@@ -1208,6 +1220,9 @@ export class CadenzaClient {
|
|
|
1208
1220
|
if (parts) {
|
|
1209
1221
|
parts.forEach((part) => assert(validTablePart(part), `Invalid table part: ${part}`));
|
|
1210
1222
|
}
|
|
1223
|
+
if (worksheetPlaceholders) {
|
|
1224
|
+
assertValidWorksheetPlaceholdersValues(worksheetPlaceholders);
|
|
1225
|
+
}
|
|
1211
1226
|
let locationFinder;
|
|
1212
1227
|
let mapExtent;
|
|
1213
1228
|
if (validExtentStrategy) {
|
|
@@ -1232,6 +1247,11 @@ export class CadenzaClient {
|
|
|
1232
1247
|
`filter.${variable}`,
|
|
1233
1248
|
JSON.stringify(value instanceof Date ? value.toISOString() : value),
|
|
1234
1249
|
]))),
|
|
1250
|
+
...(worksheetPlaceholders &&
|
|
1251
|
+
Object.fromEntries(Object.entries(worksheetPlaceholders).map(([placeholderId, worksheetPrintName]) => [
|
|
1252
|
+
`worksheetPlaceholder.${placeholderId}`,
|
|
1253
|
+
JSON.stringify(worksheetPrintName),
|
|
1254
|
+
]))),
|
|
1235
1255
|
...(geometryType && { geometryType }),
|
|
1236
1256
|
...(hideMainHeaderAndFooter && { hideMainHeaderAndFooter: 'true' }),
|
|
1237
1257
|
...(hideWorkbookToolBar && { hideWorkbookToolBar: 'true' }),
|
|
@@ -1380,6 +1400,12 @@ function assertValidFilterVariables(/** @type {FilterVariables} */ filter) {
|
|
|
1380
1400
|
validSpatialFilterValue(/** @type {SpatialFilterValue} */ ($spatial)), 'Invalid value for spatial filter value under $spatial property');
|
|
1381
1401
|
Object.keys(otherFilter).forEach((varName) => assert(validKebabCaseString(varName), `Invalid filter variable name: ${varName}`));
|
|
1382
1402
|
}
|
|
1403
|
+
function assertValidWorksheetPlaceholdersValues(
|
|
1404
|
+
/** @type {WorksheetPlaceholders} */ worksheetPlaceholders) {
|
|
1405
|
+
Object.keys(worksheetPlaceholders).forEach((placeholderId) => {
|
|
1406
|
+
assert(validKebabCaseString(placeholderId), `Invalid worksheeet placeholderId value: ${placeholderId}`);
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1383
1409
|
function array(/** @type unknown */ value) {
|
|
1384
1410
|
return Array.isArray(value) ? value : [value];
|
|
1385
1411
|
}
|
|
@@ -1444,6 +1470,9 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
|
|
|
1444
1470
|
* | 'change:selection'
|
|
1445
1471
|
* | 'drillThrough'
|
|
1446
1472
|
* | 'editGeometry:ok'
|
|
1473
|
+
* | 'editGeometry:create'
|
|
1474
|
+
* | 'editGeometry:edit'
|
|
1475
|
+
* | 'editGeometry:delete'
|
|
1447
1476
|
* | 'editGeometry:update'
|
|
1448
1477
|
* | 'editGeometry:cancel'
|
|
1449
1478
|
* | 'reload'
|
|
@@ -1458,6 +1487,9 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
|
|
|
1458
1487
|
* : T extends 'drillThrough' ? CadenzaDrillThroughEvent
|
|
1459
1488
|
* : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent
|
|
1460
1489
|
* : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent
|
|
1490
|
+
* : T extends 'editGeometry:create' ? CadenzaEditGeometryCreateEvent
|
|
1491
|
+
* : T extends 'editGeometry:edit' ? CadenzaEditGeometryEditEvent
|
|
1492
|
+
* : T extends 'editGeometry:delete' ? CadenzaEditGeometryDeleteEvent
|
|
1461
1493
|
* : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent
|
|
1462
1494
|
* : T extends 'reload' ? CadenzaReloadEvent
|
|
1463
1495
|
* : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
|
|
@@ -1496,6 +1528,9 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
|
|
|
1496
1528
|
*/
|
|
1497
1529
|
/** @typedef {CadenzaEvent<'editGeometry:update', FeatureCollection | Feature | undefined>} CadenzaEditGeometryUpdateEvent - 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. */
|
|
1498
1530
|
/** @typedef {CadenzaEvent<'editGeometry:ok', FeatureCollection | Feature>} CadenzaEditGeometryOkEvent - When the user submitted the geometry. `FeatureCollection` if batch editing is enabled. */
|
|
1531
|
+
/** @typedef {CadenzaEvent<'editGeometry:create', FeatureCollection | Feature>} CadenzaEditGeometryCreateEvent - Whenever new geometry features were created. `Feature` if only one feature was created. Only available in batch mode */
|
|
1532
|
+
/** @typedef {CadenzaEvent<'editGeometry:edit', Feature>} CadenzaEditGeometryEditEvent - Whenever a geometry feature was edited. Only available in batch mode */
|
|
1533
|
+
/** @typedef {CadenzaEvent<'editGeometry:delete', {featureIds: any[][]}>} CadenzaEditGeometryDeleteEvent - Whenever geometry features were deleted. Only available in batch mode */
|
|
1499
1534
|
/** @typedef {CadenzaEvent<'editGeometry:cancel'>} CadenzaEditGeometryCancelEvent - When the user cancelled the geometry editing. */
|
|
1500
1535
|
/** @typedef {CadenzaEvent<'error', {type: string, message?: string}>} CadenzaErrorEvent - An error event that is mapped to a {@link CadenzaError} */
|
|
1501
1536
|
/**
|
package/package.json
CHANGED
package/sandbox.html
CHANGED
|
@@ -250,12 +250,12 @@
|
|
|
250
250
|
layout,
|
|
251
251
|
width,
|
|
252
252
|
withScale,
|
|
253
|
+
worksheetPlaceholders
|
|
253
254
|
}, formData) {
|
|
254
255
|
return {
|
|
255
256
|
additionalLayers: additionalLayers && JSON.parse(additionalLayers),
|
|
256
257
|
buffer: distance ? { value: Number(distance), lengthUnit: lengthUnit ? lengthUnit : 'm' } : undefined,
|
|
257
|
-
|
|
258
|
-
dataType: dataType,
|
|
258
|
+
dataType: dataType ?? (requestAsPdf === 'on' ? 'pdf' : undefined),
|
|
259
259
|
disabledUiFeatures: disabledUiFeatures && disabledUiFeatures.split(','),
|
|
260
260
|
expandNavigator: (expandNavigator === 'on'),
|
|
261
261
|
extentStrategy: extentStrategy && JSON.parse(extentStrategy),
|
|
@@ -282,6 +282,7 @@
|
|
|
282
282
|
layout: layout || undefined,
|
|
283
283
|
width: Number(width),
|
|
284
284
|
withScale: Boolean(withScale),
|
|
285
|
+
worksheetPlaceholders: (worksheetPlaceholders && JSON.parse(worksheetPlaceholders.trim())) || undefined,
|
|
285
286
|
};
|
|
286
287
|
}
|
|
287
288
|
|
|
@@ -418,6 +419,26 @@
|
|
|
418
419
|
</div>
|
|
419
420
|
</template>
|
|
420
421
|
|
|
422
|
+
<template id="common-worksheetPlaceholders">
|
|
423
|
+
<div>
|
|
424
|
+
<label for="worksheetPlaceholders">Worksheet placeholder IDs</label>
|
|
425
|
+
<textarea name="worksheetPlaceholders" id="worksheetPlaceholders" rows="5"></textarea>
|
|
426
|
+
<small>
|
|
427
|
+
<p>A JSON object with a mapping of (placeholderId -> worksheetPrintName).
|
|
428
|
+
Placeholder ID is defined in the worksheet placeholder element in the report template.
|
|
429
|
+
The placeholders are then replaced with worksheet elements.</p>
|
|
430
|
+
<p>Example:</p>
|
|
431
|
+
<pre>
|
|
432
|
+
{
|
|
433
|
+
"first": "Informationen zur Arbeitsmappe",
|
|
434
|
+
"second": "Häufigkeit der Messungen"
|
|
435
|
+
}
|
|
436
|
+
</pre>
|
|
437
|
+
</small>
|
|
438
|
+
|
|
439
|
+
</div>
|
|
440
|
+
</template>
|
|
441
|
+
|
|
421
442
|
<template id="common-filter">
|
|
422
443
|
<div>
|
|
423
444
|
<label for="filter">Filter</label>
|
|
@@ -496,7 +517,7 @@
|
|
|
496
517
|
</div>
|
|
497
518
|
</template>
|
|
498
519
|
|
|
499
|
-
<template data-action="show" data-common="showWorkbook,disabledUiFeatures,filter,show">
|
|
520
|
+
<template data-action="show" data-common="showWorkbook,disabledUiFeatures,worksheetPlaceholders,filter,show">
|
|
500
521
|
<div>
|
|
501
522
|
<label for="embeddingTargetId">Embedding target ID *</label>
|
|
502
523
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|