@disy/cadenza.js 2.13.1 → 2.14.1
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 +8 -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 +34 -26
- package/apidoc/classes/CadenzaError.html +5 -5
- package/apidoc/functions/cadenza.html +3 -3
- package/apidoc/index.html +4 -4
- package/apidoc/interfaces/CadenzaClientOptions.html +5 -5
- package/apidoc/interfaces/CadenzaEvent.html +4 -4
- package/apidoc/interfaces/Distance.html +2 -2
- package/apidoc/interfaces/ExternalLinkKey.html +4 -4
- package/apidoc/interfaces/Feature.html +7 -7
- package/apidoc/interfaces/FeatureCollection.html +3 -3
- package/apidoc/interfaces/Geometry.html +3 -3
- package/apidoc/interfaces/GeometryZoomTarget.html +3 -3
- package/apidoc/interfaces/PageSource.html +3 -3
- package/apidoc/modules.html +4 -2
- 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/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/CadenzaObjectInfoEvent.html +2 -2
- package/apidoc/types/CadenzaReloadEvent.html +5 -0
- package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
- package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
- package/apidoc/types/CustomValidityType.html +2 -0
- package/apidoc/types/DataType.html +2 -2
- package/apidoc/types/EmbeddingTargetId.html +2 -2
- package/apidoc/types/Extent.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/LengthUnit.html +1 -1
- package/apidoc/types/OpaqueString.html +2 -2
- package/apidoc/types/OperationMode.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/ZoomTarget.html +2 -2
- package/cadenza.d.ts +42 -5
- package/cadenza.js +33 -4
- package/package.json +1 -1
- package/sandbox.html +36 -2
package/cadenza.d.ts
CHANGED
|
@@ -219,6 +219,7 @@ export class CadenzaClient {
|
|
|
219
219
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
220
220
|
* @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.
|
|
221
221
|
* @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
|
|
222
|
+
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
222
223
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
223
224
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
224
225
|
* @throws For invalid arguments
|
|
@@ -228,12 +229,13 @@ export class CadenzaClient {
|
|
|
228
229
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
229
230
|
* @embed
|
|
230
231
|
*/
|
|
231
|
-
createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, signal }?: {
|
|
232
|
+
createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, }?: {
|
|
232
233
|
filter?: FilterVariables | undefined;
|
|
233
234
|
locationFinder?: string | undefined;
|
|
234
235
|
mapExtent?: Extent | undefined;
|
|
235
236
|
minScale?: number | undefined;
|
|
236
237
|
useMapSrs?: boolean | undefined;
|
|
238
|
+
operationMode?: OperationMode | undefined;
|
|
237
239
|
signal?: AbortSignal | undefined;
|
|
238
240
|
} | undefined, ...args: any[]): Promise<void>;
|
|
239
241
|
/**
|
|
@@ -247,6 +249,7 @@ export class CadenzaClient {
|
|
|
247
249
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
248
250
|
* @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.
|
|
249
251
|
* @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
|
|
252
|
+
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
250
253
|
* @param {ZoomTarget} [options.zoomTarget] - A target Cadenza should zoom to
|
|
251
254
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
252
255
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
@@ -257,15 +260,26 @@ export class CadenzaClient {
|
|
|
257
260
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
258
261
|
* @embed
|
|
259
262
|
*/
|
|
260
|
-
editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, signal, }?: {
|
|
263
|
+
editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, }?: {
|
|
261
264
|
filter?: FilterVariables | undefined;
|
|
262
265
|
locationFinder?: string | undefined;
|
|
263
266
|
mapExtent?: Extent | undefined;
|
|
264
267
|
minScale?: number | undefined;
|
|
265
268
|
useMapSrs?: boolean | undefined;
|
|
269
|
+
operationMode?: OperationMode | undefined;
|
|
266
270
|
zoomTarget?: GeometryZoomTarget | undefined;
|
|
267
271
|
signal?: AbortSignal | undefined;
|
|
268
272
|
} | undefined, ...args: any[]): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Set custom validity state of the geometry editor in addition to the default validation state (including errors and
|
|
275
|
+
* warnings). When set to error the dialog submission is blocked.
|
|
276
|
+
* If there already is a custom state set it will override it.
|
|
277
|
+
* Passing '' will reset the custom state to undefined, meaning no custom state is displayed.
|
|
278
|
+
* If no geometry editing is started, the method call has no effect.
|
|
279
|
+
* @param {string} message The message to show in the dialog
|
|
280
|
+
* @param {CustomValidityType} [type] The type of message (defaults to 'error')
|
|
281
|
+
*/
|
|
282
|
+
setCustomValidity(message: string, type?: CustomValidityType | undefined): void;
|
|
269
283
|
/**
|
|
270
284
|
* Select objects in a workbook map.
|
|
271
285
|
*
|
|
@@ -277,6 +291,7 @@ export class CadenzaClient {
|
|
|
277
291
|
* @param {string} [options.locationFinder] - A search query for the location finder
|
|
278
292
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
279
293
|
* @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
|
|
294
|
+
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
280
295
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
281
296
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
282
297
|
* @throws For invalid arguments
|
|
@@ -287,12 +302,13 @@ export class CadenzaClient {
|
|
|
287
302
|
* - {@link CadenzaSelectObjectsCancelEvent}
|
|
288
303
|
* @embed
|
|
289
304
|
*/
|
|
290
|
-
selectObjects(backgroundMapView: EmbeddingTargetId, { filter, layers, locationFinder, mapExtent, useMapSrs, signal }?: {
|
|
305
|
+
selectObjects(backgroundMapView: EmbeddingTargetId, { filter, layers, locationFinder, mapExtent, useMapSrs, operationMode, signal, }?: {
|
|
291
306
|
filter?: FilterVariables | undefined;
|
|
292
307
|
layers?: (string | WorkbookLayerPath)[] | undefined;
|
|
293
308
|
locationFinder?: string | undefined;
|
|
294
309
|
mapExtent?: Extent | undefined;
|
|
295
310
|
useMapSrs?: boolean | undefined;
|
|
311
|
+
operationMode?: OperationMode | undefined;
|
|
296
312
|
signal?: AbortSignal | undefined;
|
|
297
313
|
} | undefined, ...args: any[]): Promise<void>;
|
|
298
314
|
/**
|
|
@@ -403,6 +419,7 @@ export class CadenzaClient {
|
|
|
403
419
|
* | 'objectInfo'
|
|
404
420
|
* | 'selectObjects:ok'
|
|
405
421
|
* | 'selectObjects:cancel'
|
|
422
|
+
* | 'reload'
|
|
406
423
|
* } CadenzaEventType - An event type to subscribe to using {@link CadenzaClient#on}
|
|
407
424
|
*/
|
|
408
425
|
/**
|
|
@@ -416,6 +433,7 @@ export class CadenzaClient {
|
|
|
416
433
|
* : T extends 'objectInfo' ? CadenzaObjectInfoEvent
|
|
417
434
|
* : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
|
|
418
435
|
* : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent
|
|
436
|
+
* : T extends 'reload' ? CadenzaReloadEvent
|
|
419
437
|
* : never
|
|
420
438
|
* } CadenzaEventByType
|
|
421
439
|
*/
|
|
@@ -454,6 +472,13 @@ export class CadenzaClient {
|
|
|
454
472
|
* For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
|
|
455
473
|
*/
|
|
456
474
|
/** @typedef {CadenzaEvent<'selectObjects:cancel'>} CadenzaSelectObjectsCancelEvent - When the user cancelled the selection. */
|
|
475
|
+
/**
|
|
476
|
+
* @typedef {CadenzaEvent<'reload'>} CadenzaReloadEvent - When the user clicked on the 'reload' button in the embedding standby page
|
|
477
|
+
*
|
|
478
|
+
* If a user does not interact with the iframe displaying the Cadenza content for a while, a standby embed page is displayed
|
|
479
|
+
* and the user can click a reload button there. Then the application using Cadenza JS can re-trigger the loading of the iframe
|
|
480
|
+
* with the correct original URL and parameters and do what was originally done when displaying that iframe.
|
|
481
|
+
*/
|
|
457
482
|
export class AbortError extends DOMException {
|
|
458
483
|
constructor();
|
|
459
484
|
}
|
|
@@ -655,11 +680,15 @@ export type FeatureCollection = {
|
|
|
655
680
|
*/
|
|
656
681
|
features: Feature[];
|
|
657
682
|
};
|
|
683
|
+
/**
|
|
684
|
+
* - The type of custom validity used for disclose on visual presentation and form submission behavior
|
|
685
|
+
*/
|
|
686
|
+
export type CustomValidityType = 'error' | 'warning' | 'info' | 'success';
|
|
658
687
|
/**
|
|
659
688
|
* - An event type to subscribe to using {@link CadenzaClienton }
|
|
660
689
|
*/
|
|
661
|
-
export type CadenzaEventType = 'action' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:update' | 'editGeometry:cancel' | 'objectInfo' | 'selectObjects:ok' | 'selectObjects:cancel';
|
|
662
|
-
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 'objectInfo' ? CadenzaObjectInfoEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : never;
|
|
690
|
+
export type CadenzaEventType = 'action' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:update' | 'editGeometry:cancel' | 'objectInfo' | 'selectObjects:ok' | 'selectObjects:cancel' | 'reload';
|
|
691
|
+
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 'objectInfo' ? CadenzaObjectInfoEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : T extends 'reload' ? CadenzaReloadEvent : never;
|
|
663
692
|
/**
|
|
664
693
|
* - A Cadenza `postMessage()` event
|
|
665
694
|
*/
|
|
@@ -750,3 +779,11 @@ export type CadenzaSelectObjectsOkEvent = CadenzaEvent<'selectObjects:ok', {
|
|
|
750
779
|
* - When the user cancelled the selection.
|
|
751
780
|
*/
|
|
752
781
|
export type CadenzaSelectObjectsCancelEvent = CadenzaEvent<'selectObjects:cancel'>;
|
|
782
|
+
/**
|
|
783
|
+
* - When the user clicked on the 'reload' button in the embedding standby page
|
|
784
|
+
*
|
|
785
|
+
* If a user does not interact with the iframe displaying the Cadenza content for a while, a standby embed page is displayed
|
|
786
|
+
* and the user can click a reload button there. Then the application using Cadenza JS can re-trigger the loading of the iframe
|
|
787
|
+
* with the correct original URL and parameters and do what was originally done when displaying that iframe.
|
|
788
|
+
*/
|
|
789
|
+
export type CadenzaReloadEvent = CadenzaEvent<'reload'>;
|
package/cadenza.js
CHANGED
|
@@ -147,6 +147,7 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
|
|
|
147
147
|
* @typedef FeatureCollection - A adapted [GeoJSON](https://geojson.org/) feature collection object
|
|
148
148
|
* @property {Feature[]} features - The features within this collection
|
|
149
149
|
*/
|
|
150
|
+
/** @typedef {'error'|'warning'|'info'|'success'} CustomValidityType - The type of custom validity used for disclose on visual presentation and form submission behavior */
|
|
150
151
|
let hasCadenzaSession = false;
|
|
151
152
|
/** @type {Promise<void> | undefined} */
|
|
152
153
|
let firstEmbeddingTargetShown;
|
|
@@ -469,6 +470,7 @@ export class CadenzaClient {
|
|
|
469
470
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
470
471
|
* @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.
|
|
471
472
|
* @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
|
|
473
|
+
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
472
474
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
473
475
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
474
476
|
* @throws For invalid arguments
|
|
@@ -478,7 +480,7 @@ export class CadenzaClient {
|
|
|
478
480
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
479
481
|
* @embed
|
|
480
482
|
*/
|
|
481
|
-
createGeometry(backgroundMapView, geometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, signal } = {}) {
|
|
483
|
+
createGeometry(backgroundMapView, geometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, } = {}) {
|
|
482
484
|
this.#log('CadenzaClient#createGeometry', ...arguments);
|
|
483
485
|
const params = createParams({
|
|
484
486
|
action: 'editGeometry',
|
|
@@ -488,6 +490,7 @@ export class CadenzaClient {
|
|
|
488
490
|
mapExtent,
|
|
489
491
|
minScale,
|
|
490
492
|
useMapSrs,
|
|
493
|
+
operationMode,
|
|
491
494
|
});
|
|
492
495
|
return this.#show(resolvePath(backgroundMapView), params, signal);
|
|
493
496
|
}
|
|
@@ -502,6 +505,7 @@ export class CadenzaClient {
|
|
|
502
505
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
503
506
|
* @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.
|
|
504
507
|
* @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
|
|
508
|
+
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
505
509
|
* @param {ZoomTarget} [options.zoomTarget] - A target Cadenza should zoom to
|
|
506
510
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
507
511
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
@@ -512,7 +516,7 @@ export class CadenzaClient {
|
|
|
512
516
|
* - {@link CadenzaEditGeometryCancelEvent}
|
|
513
517
|
* @embed
|
|
514
518
|
*/
|
|
515
|
-
async editGeometry(backgroundMapView, geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, signal, } = {}) {
|
|
519
|
+
async editGeometry(backgroundMapView, geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, } = {}) {
|
|
516
520
|
this.#log('CadenzaClient#editGeometry', ...arguments);
|
|
517
521
|
assertValidGeometryType(geometry.type);
|
|
518
522
|
const zoomToGeometry = geometry && zoomTarget?.type === 'geometry';
|
|
@@ -525,6 +529,7 @@ export class CadenzaClient {
|
|
|
525
529
|
mapExtent,
|
|
526
530
|
minScale,
|
|
527
531
|
useMapSrs,
|
|
532
|
+
operationMode,
|
|
528
533
|
});
|
|
529
534
|
await this.#show(resolvePath(backgroundMapView), params, signal);
|
|
530
535
|
if (geometry) {
|
|
@@ -534,6 +539,19 @@ export class CadenzaClient {
|
|
|
534
539
|
});
|
|
535
540
|
}
|
|
536
541
|
}
|
|
542
|
+
/**
|
|
543
|
+
* Set custom validity state of the geometry editor in addition to the default validation state (including errors and
|
|
544
|
+
* warnings). When set to error the dialog submission is blocked.
|
|
545
|
+
* If there already is a custom state set it will override it.
|
|
546
|
+
* Passing '' will reset the custom state to undefined, meaning no custom state is displayed.
|
|
547
|
+
* If no geometry editing is started, the method call has no effect.
|
|
548
|
+
* @param {string} message The message to show in the dialog
|
|
549
|
+
* @param {CustomValidityType} [type] The type of message (defaults to 'error')
|
|
550
|
+
*/
|
|
551
|
+
setCustomValidity(message, type = 'error') {
|
|
552
|
+
assert(['error', 'warning', 'info', 'success'].includes(type), `Invalid validity type: ${type}`);
|
|
553
|
+
this.#postEvent('setCustomValidity', { message, type });
|
|
554
|
+
}
|
|
537
555
|
/**
|
|
538
556
|
* Select objects in a workbook map.
|
|
539
557
|
*
|
|
@@ -545,6 +563,7 @@ export class CadenzaClient {
|
|
|
545
563
|
* @param {string} [options.locationFinder] - A search query for the location finder
|
|
546
564
|
* @param {Extent} [options.mapExtent] - A map extent to set
|
|
547
565
|
* @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
|
|
566
|
+
* @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
|
|
548
567
|
* @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
|
|
549
568
|
* @return {Promise<void>} A `Promise` for when the iframe is loaded
|
|
550
569
|
* @throws For invalid arguments
|
|
@@ -555,7 +574,7 @@ export class CadenzaClient {
|
|
|
555
574
|
* - {@link CadenzaSelectObjectsCancelEvent}
|
|
556
575
|
* @embed
|
|
557
576
|
*/
|
|
558
|
-
selectObjects(backgroundMapView, { filter, layers, locationFinder, mapExtent, useMapSrs, signal } = {}) {
|
|
577
|
+
selectObjects(backgroundMapView, { filter, layers, locationFinder, mapExtent, useMapSrs, operationMode, signal, } = {}) {
|
|
559
578
|
this.#log('CadenzaClient#selectObjects', ...arguments);
|
|
560
579
|
const params = createParams({
|
|
561
580
|
action: 'selectObjects',
|
|
@@ -564,6 +583,7 @@ export class CadenzaClient {
|
|
|
564
583
|
locationFinder,
|
|
565
584
|
mapExtent,
|
|
566
585
|
useMapSrs,
|
|
586
|
+
operationMode,
|
|
567
587
|
});
|
|
568
588
|
return this.#show(resolvePath(backgroundMapView), params, signal);
|
|
569
589
|
}
|
|
@@ -1046,7 +1066,7 @@ function createParams({ action, dataType, disabledUiFeatures, expandNavigator, f
|
|
|
1046
1066
|
...(locationFinder && { locationFinder }),
|
|
1047
1067
|
...(mapExtent && { mapExtent: mapExtent.join() }),
|
|
1048
1068
|
...(minScale && { minScale: String(minScale) }),
|
|
1049
|
-
...(operationMode &&
|
|
1069
|
+
...(operationMode && { operationMode }),
|
|
1050
1070
|
...(parts && { parts: parts.join() }),
|
|
1051
1071
|
...(targetType && { targetType }),
|
|
1052
1072
|
...(useMapSrs && { useMapSrs: 'true' }),
|
|
@@ -1066,6 +1086,7 @@ function array(/** @type unknown */ value) {
|
|
|
1066
1086
|
* | 'objectInfo'
|
|
1067
1087
|
* | 'selectObjects:ok'
|
|
1068
1088
|
* | 'selectObjects:cancel'
|
|
1089
|
+
* | 'reload'
|
|
1069
1090
|
* } CadenzaEventType - An event type to subscribe to using {@link CadenzaClient#on}
|
|
1070
1091
|
*/
|
|
1071
1092
|
/**
|
|
@@ -1079,6 +1100,7 @@ function array(/** @type unknown */ value) {
|
|
|
1079
1100
|
* : T extends 'objectInfo' ? CadenzaObjectInfoEvent
|
|
1080
1101
|
* : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
|
|
1081
1102
|
* : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent
|
|
1103
|
+
* : T extends 'reload' ? CadenzaReloadEvent
|
|
1082
1104
|
* : never
|
|
1083
1105
|
* } CadenzaEventByType
|
|
1084
1106
|
*/
|
|
@@ -1122,6 +1144,13 @@ function array(/** @type unknown */ value) {
|
|
|
1122
1144
|
* For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
|
|
1123
1145
|
*/
|
|
1124
1146
|
/** @typedef {CadenzaEvent<'selectObjects:cancel'>} CadenzaSelectObjectsCancelEvent - When the user cancelled the selection. */
|
|
1147
|
+
/**
|
|
1148
|
+
* @typedef {CadenzaEvent<'reload'>} CadenzaReloadEvent - When the user clicked on the 'reload' button in the embedding standby page
|
|
1149
|
+
*
|
|
1150
|
+
* If a user does not interact with the iframe displaying the Cadenza content for a while, a standby embed page is displayed
|
|
1151
|
+
* and the user can click a reload button there. Then the application using Cadenza JS can re-trigger the loading of the iframe
|
|
1152
|
+
* with the correct original URL and parameters and do what was originally done when displaying that iframe.
|
|
1153
|
+
*/
|
|
1125
1154
|
export class AbortError extends DOMException {
|
|
1126
1155
|
constructor() {
|
|
1127
1156
|
super('Aborted', 'AbortError');
|
package/package.json
CHANGED
package/sandbox.html
CHANGED
|
@@ -181,7 +181,8 @@
|
|
|
181
181
|
cadenzaClient.fetchAreaIntersections(data.embeddingTargetId, JSON.parse(data.layer), JSON.parse(data.geometry), getOptions(data))
|
|
182
182
|
.then(console.log);
|
|
183
183
|
},
|
|
184
|
-
downloadData: data => cadenzaClient.downloadData(data.embeddingTargetId, data.dataType, getOptions(data))
|
|
184
|
+
downloadData: data => cadenzaClient.downloadData(data.embeddingTargetId, data.dataType, getOptions(data)),
|
|
185
|
+
setCustomValidity: data => cadenzaClient.setCustomValidity(data.message, data.type || undefined)
|
|
185
186
|
};
|
|
186
187
|
|
|
187
188
|
const form = document.getElementById('form');
|
|
@@ -247,7 +248,7 @@
|
|
|
247
248
|
mapExtent: mapExtent && mapExtent.split(',').map(Number),
|
|
248
249
|
minScale: minScale && Number(minScale),
|
|
249
250
|
parts: parts && parts.split(','),
|
|
250
|
-
|
|
251
|
+
operationMode: (simplifiedOperationMode === 'on' ? 'simplified' : 'normal' ),
|
|
251
252
|
layers: layers ? JSON.parse(layers) : undefined,
|
|
252
253
|
useMapSrs: useMapSrs === 'on',
|
|
253
254
|
fullGeometries: fullGeometries === 'on',
|
|
@@ -297,6 +298,7 @@
|
|
|
297
298
|
<option value="createGeometry">Create Geometry</option>
|
|
298
299
|
<option value="editGeometry">Edit Geometry</option>
|
|
299
300
|
<option value="selectObjects">Select Objects</option>
|
|
301
|
+
<option value="setCustomValidity">Set Custom Validity</option>
|
|
300
302
|
</optgroup>
|
|
301
303
|
<optgroup label="Without Iframe">
|
|
302
304
|
<option value="downloadData">Download data</option>
|
|
@@ -472,6 +474,20 @@
|
|
|
472
474
|
</div>
|
|
473
475
|
</template>
|
|
474
476
|
|
|
477
|
+
<template data-action="setCustomValidity">
|
|
478
|
+
<p>Requires a geometry editing UI (Create / Edit Geometry actions) to be opened first.</p>
|
|
479
|
+
<label for="message">Message</label>
|
|
480
|
+
<input type="text" name="message" id="message">
|
|
481
|
+
<label for="type">Type</label>
|
|
482
|
+
<select name="type" id="type">
|
|
483
|
+
<option selected></option>
|
|
484
|
+
<option>success</option>
|
|
485
|
+
<option>info</option>
|
|
486
|
+
<option>warning</option>
|
|
487
|
+
<option>error</option>
|
|
488
|
+
</select>
|
|
489
|
+
</template>
|
|
490
|
+
|
|
475
491
|
<template data-action="setFilter" data-common="filter"></template>
|
|
476
492
|
|
|
477
493
|
<template data-action="createGeometry" data-common="map,filter">
|
|
@@ -490,6 +506,12 @@
|
|
|
490
506
|
<option>MultiPolygon</option>
|
|
491
507
|
</select>
|
|
492
508
|
</div>
|
|
509
|
+
<div>
|
|
510
|
+
<label>
|
|
511
|
+
<input type="checkbox" name="simplifiedOperationMode">
|
|
512
|
+
Simplified operation mode
|
|
513
|
+
</label>
|
|
514
|
+
</div>
|
|
493
515
|
<div>
|
|
494
516
|
<label for="minScale">Minimum Scale</label>
|
|
495
517
|
<input type="number" name="minScale" id="minScale">
|
|
@@ -505,6 +527,12 @@
|
|
|
505
527
|
<label for="geometry">Geometry (GeoJSON) *</label>
|
|
506
528
|
<textarea name="geometry" id="geometry" rows="5" required></textarea>
|
|
507
529
|
</div>
|
|
530
|
+
<div>
|
|
531
|
+
<label>
|
|
532
|
+
<input type="checkbox" name="simplifiedOperationMode">
|
|
533
|
+
Simplified operation mode
|
|
534
|
+
</label>
|
|
535
|
+
</div>
|
|
508
536
|
<div>
|
|
509
537
|
<label for="minScale">Minimum Scale</label>
|
|
510
538
|
<input type="number" name="minScale" id="minScale">
|
|
@@ -516,6 +544,12 @@
|
|
|
516
544
|
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
|
|
517
545
|
<input name="embeddingTargetId" id="embeddingTargetId" required>
|
|
518
546
|
</div>
|
|
547
|
+
<div>
|
|
548
|
+
<label>
|
|
549
|
+
<input type="checkbox" name="simplifiedOperationMode">
|
|
550
|
+
Simplified operation mode
|
|
551
|
+
</label>
|
|
552
|
+
</div>
|
|
519
553
|
<div>
|
|
520
554
|
<label for="layers">Layers</label>
|
|
521
555
|
<input name="layers" id="layers">
|