commons-shared-web-ui 0.0.22 → 0.0.23
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/fesm2022/commons-shared-web-ui.mjs +108 -27
- package/fesm2022/commons-shared-web-ui.mjs.map +1 -1
- package/index.d.ts +108 -16
- package/package.json +1 -1
- package/src/lib/styles/global.scss +1 -0
package/index.d.ts
CHANGED
|
@@ -342,6 +342,94 @@ interface RangeConfig {
|
|
|
342
342
|
minDate?: string;
|
|
343
343
|
maxDate?: string;
|
|
344
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* Describes a single query-parameter for a parameterised API URL.
|
|
347
|
+
* Supports static values (baked into the JSON config) and dynamic values
|
|
348
|
+
* resolved at runtime from a context object via dot-notation `sourcePath`.
|
|
349
|
+
*
|
|
350
|
+
* Used inside `LibraryUploadConfig.params` to declaratively list all
|
|
351
|
+
* query params the library-image sync API needs.
|
|
352
|
+
*/
|
|
353
|
+
interface ApiQueryParam {
|
|
354
|
+
/** The query-param key sent to the backend (e.g. 'entityType', 'completeUrl'). */
|
|
355
|
+
key: string;
|
|
356
|
+
/**
|
|
357
|
+
* A static value baked into the JSON config
|
|
358
|
+
* (e.g. 'ENTITY_TYPE.OPPORTUNITY_GALLERY').
|
|
359
|
+
* Leave unset when the value must be resolved dynamically at runtime.
|
|
360
|
+
*/
|
|
361
|
+
staticValue?: string;
|
|
362
|
+
/**
|
|
363
|
+
* A dot-notation path resolved against a runtime context object
|
|
364
|
+
* (e.g. 'libraryItem.url'). Takes precedence over `staticValue`
|
|
365
|
+
* when the context provides a non-null value.
|
|
366
|
+
*/
|
|
367
|
+
sourcePath?: string;
|
|
368
|
+
/**
|
|
369
|
+
* When true the HTTP request is aborted if this param cannot be resolved
|
|
370
|
+
* to a non-empty value.
|
|
371
|
+
*/
|
|
372
|
+
required?: boolean;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Structured config for the library-image sync POST API.
|
|
376
|
+
* Declare each query param as an `ApiQueryParam` so the set can grow
|
|
377
|
+
* without any code changes.
|
|
378
|
+
*
|
|
379
|
+
* Example:
|
|
380
|
+
* {
|
|
381
|
+
* "baseUrl": "gateway/commons-opportunity-service/api/v1/attachments/upload-url",
|
|
382
|
+
* "params": [
|
|
383
|
+
* { "key": "entityType", "staticValue": "ENTITY_TYPE.OPPORTUNITY_GALLERY", "required": true },
|
|
384
|
+
* { "key": "completeUrl", "sourcePath": "libraryItem.url", "required": true }
|
|
385
|
+
* ]
|
|
386
|
+
* }
|
|
387
|
+
*/
|
|
388
|
+
interface LibraryUploadConfig {
|
|
389
|
+
/** Base URL without any query string. */
|
|
390
|
+
baseUrl: string;
|
|
391
|
+
/**
|
|
392
|
+
* Declared query params. Static values are embedded in the config;
|
|
393
|
+
* dynamic values (e.g. `completeUrl`) are resolved at call time from
|
|
394
|
+
* a runtime context object using `sourcePath`.
|
|
395
|
+
*/
|
|
396
|
+
params?: ApiQueryParam[];
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* All library-image picker settings grouped under one roof.
|
|
400
|
+
* Used as the `libraryConfig` key inside `AttachmentConfig`.
|
|
401
|
+
*
|
|
402
|
+
* Example:
|
|
403
|
+
* {
|
|
404
|
+
* "apiUrl": "gateway/.../attachments/bulk/public?entityIds=1&entityType=...",
|
|
405
|
+
* "dataPath": "data",
|
|
406
|
+
* "urlPath": "completeURL",
|
|
407
|
+
* "idPath": "id",
|
|
408
|
+
* "uploadConfig": {
|
|
409
|
+
* "baseUrl": "gateway/.../attachments/upload-url",
|
|
410
|
+
* "params": [
|
|
411
|
+
* { "key": "entityType", "staticValue": "ENTITY_TYPE.OPPORTUNITY_GALLERY", "required": true },
|
|
412
|
+
* { "key": "completeUrl", "sourcePath": "libraryItem.url", "required": true }
|
|
413
|
+
* ]
|
|
414
|
+
* }
|
|
415
|
+
* }
|
|
416
|
+
*/
|
|
417
|
+
interface LibraryConfig {
|
|
418
|
+
/** API endpoint (GET) to load the library image list. */
|
|
419
|
+
apiUrl: string;
|
|
420
|
+
/** Dot-notation path to the image array in the API response (e.g. 'data.items'). */
|
|
421
|
+
dataPath?: string;
|
|
422
|
+
/** Dot-notation path to the image URL within each item (e.g. 'completeURL'). */
|
|
423
|
+
urlPath?: string;
|
|
424
|
+
/** Dot-notation path to the image ID within each item (e.g. 'id'). */
|
|
425
|
+
idPath?: string;
|
|
426
|
+
/**
|
|
427
|
+
* Structured config for the library-image sync POST API.
|
|
428
|
+
* Declare each query param as an `ApiQueryParam` so the set can
|
|
429
|
+
* grow without any code changes.
|
|
430
|
+
*/
|
|
431
|
+
uploadConfig?: LibraryUploadConfig;
|
|
432
|
+
}
|
|
345
433
|
/**
|
|
346
434
|
* Unified attachment / file-upload configuration.
|
|
347
435
|
* Used by FILE_UPLOAD fields for any kind of upload — images, documents, PDFs, etc.
|
|
@@ -374,22 +462,20 @@ interface AttachmentConfig {
|
|
|
374
462
|
* API endpoint to delete the file. Called when an uploaded file with an ID != 0 is removed.
|
|
375
463
|
*/
|
|
376
464
|
deleteUrl?: string;
|
|
377
|
-
/**
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
/** Dot-notation path to the image ID within each library item */
|
|
384
|
-
libraryIdPath?: string;
|
|
465
|
+
/**
|
|
466
|
+
* All library-image picker settings (API, response paths, sync upload).
|
|
467
|
+
* Replaces the former flat `libraryApiUrl`, `libraryDataPath`,
|
|
468
|
+
* `libraryUrlPath`, `libraryIdPath`, and `libraryUploadConfig` fields.
|
|
469
|
+
*/
|
|
470
|
+
libraryConfig?: LibraryConfig;
|
|
385
471
|
/** Optional description shown in the left info panel for media upload */
|
|
386
472
|
description?: string;
|
|
387
473
|
/** Optional bullet-point feature lines shown in the left info panel for media upload */
|
|
388
474
|
features?: string[];
|
|
389
475
|
}
|
|
390
476
|
interface LocationConfig {
|
|
391
|
-
/** Default active tab
|
|
392
|
-
defaultTab?:
|
|
477
|
+
/** Default active tab (e.g. 'VENUE', 'ONLINE', 'TBA'). Defaults to 'VENUE' when not provided. */
|
|
478
|
+
defaultTab?: string;
|
|
393
479
|
/** Allow multiple locations. Replaces the need for maxLocations. */
|
|
394
480
|
allowMulti?: boolean;
|
|
395
481
|
/** Maximum number of venue locations allowed. Defaults to 5 if allowMulti is true. */
|
|
@@ -438,7 +524,8 @@ interface LocationItem {
|
|
|
438
524
|
* `tab` indicates which mode is active.
|
|
439
525
|
*/
|
|
440
526
|
interface LocationFieldValue {
|
|
441
|
-
tab
|
|
527
|
+
/** Active location tab (e.g. 'VENUE', 'ONLINE', 'TBA'). Defaults to 'VENUE'. */
|
|
528
|
+
tab: string;
|
|
442
529
|
/** Array of venue locations (only valid when tab === 'VENUE') */
|
|
443
530
|
venues?: LocationItem[];
|
|
444
531
|
/** Event URL (only valid when tab === 'ONLINE') */
|
|
@@ -468,8 +555,8 @@ interface ValidationResult {
|
|
|
468
555
|
interface MediaItem {
|
|
469
556
|
/** Server-assigned ID (for pre-filled items) */
|
|
470
557
|
id?: number;
|
|
471
|
-
/** 'image'
|
|
472
|
-
mediaType:
|
|
558
|
+
/** Media type (e.g. 'image', 'youtube'). Defaults to 'image'. */
|
|
559
|
+
mediaType: string;
|
|
473
560
|
/** Remote URL of the image returned by the upload API, or the YouTube embed URL */
|
|
474
561
|
url: string;
|
|
475
562
|
/** Thumbnail URL (for YouTube previews) */
|
|
@@ -1057,8 +1144,8 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
|
|
|
1057
1144
|
libraryLoading: boolean;
|
|
1058
1145
|
libraryError: string;
|
|
1059
1146
|
mediaUploadError: string;
|
|
1060
|
-
/** Active tab: VENUE
|
|
1061
|
-
locationActiveTab:
|
|
1147
|
+
/** Active tab: any string, e.g. 'VENUE', 'ONLINE', 'TBA'. Defaults to 'VENUE'. */
|
|
1148
|
+
locationActiveTab: string;
|
|
1062
1149
|
/** Current text in the venue search box */
|
|
1063
1150
|
locationSearchText: string;
|
|
1064
1151
|
/** Google Places autocomplete suggestions */
|
|
@@ -1227,6 +1314,11 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
|
|
|
1227
1314
|
private _extractYoutubeId;
|
|
1228
1315
|
onMediaMenuDevice(): void;
|
|
1229
1316
|
onMediaFileSelected(event: Event): void;
|
|
1317
|
+
/**
|
|
1318
|
+
* Resolves the library-image sync POST endpoint from `attachmentConfig.libraryConfig.uploadConfig`.
|
|
1319
|
+
* Returns `null` when not configured; the caller skips the API call.
|
|
1320
|
+
*/
|
|
1321
|
+
private buildLibraryUploadRequest;
|
|
1230
1322
|
onMediaMenuLibrary(): void;
|
|
1231
1323
|
private _loadLibraryImages;
|
|
1232
1324
|
getLibraryItemUrl(item: any): string;
|
|
@@ -1240,7 +1332,7 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
|
|
|
1240
1332
|
private showMediaError;
|
|
1241
1333
|
private initLocationField;
|
|
1242
1334
|
private _ensureGoogleMapsScript;
|
|
1243
|
-
onLocationTabChange(tab:
|
|
1335
|
+
onLocationTabChange(tab: string): void;
|
|
1244
1336
|
get locationValue(): LocationFieldValue;
|
|
1245
1337
|
get locationVenues(): LocationItem[];
|
|
1246
1338
|
get locationOnlineUrl(): string;
|
package/package.json
CHANGED