@acorex/platform 20.9.26 → 20.9.28

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.
@@ -7,7 +7,7 @@ class AXPImagePreviewPopupComponent extends AXBasePageComponent {
7
7
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPImagePreviewPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
8
8
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: AXPImagePreviewPopupComponent, isStandalone: true, selector: "axp-image-preview-popup", usesInheritance: true, ngImport: i0, template: `
9
9
  <div class="ax-flex ax-justify-center ax-items-center ax-p-4">
10
- <img [src]="src" alt="Preview" />
10
+ <img [src]="src" alt="Preview" class="ax-max-h-[70vh] ax-max-w-full ax-object-contain" />
11
11
  </div>
12
12
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }] }); }
13
13
  }
@@ -19,11 +19,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
19
19
  imports: [AXButtonModule],
20
20
  template: `
21
21
  <div class="ax-flex ax-justify-center ax-items-center ax-p-4">
22
- <img [src]="src" alt="Preview" />
22
+ <img [src]="src" alt="Preview" class="ax-max-h-[70vh] ax-max-w-full ax-object-contain" />
23
23
  </div>
24
24
  `,
25
25
  }]
26
26
  }] });
27
27
 
28
28
  export { AXPImagePreviewPopupComponent };
29
- //# sourceMappingURL=acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map
29
+ //# sourceMappingURL=acorex-platform-layout-widgets-image-preview.popup-n5Lcs-RM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-layout-widgets-image-preview.popup-n5Lcs-RM.mjs","sources":["../../../../libs/platform/layout/widgets/src/lib/widgets/advance/image/image-preview.popup.ts"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXBasePageComponent } from '@acorex/components/page';\n\nimport { Component } from '@angular/core';\n\n@Component({\n standalone: true,\n selector: 'axp-image-preview-popup',\n imports: [AXButtonModule],\n template: `\n <div class=\"ax-flex ax-justify-center ax-items-center ax-p-4\">\n <img [src]=\"src\" alt=\"Preview\" class=\"ax-max-h-[70vh] ax-max-w-full ax-object-contain\" />\n </div>\n `,\n})\nexport class AXPImagePreviewPopupComponent extends AXBasePageComponent {\n src: string;\n}\n"],"names":[],"mappings":";;;;;AAeM,MAAO,6BAA8B,SAAQ,mBAAmB,CAAA;8GAAzD,6BAA6B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA7B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAN9B;;;;AAIT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EALS,cAAc,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAOb,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAVzC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,yBAAyB;oBACnC,OAAO,EAAE,CAAC,cAAc,CAAC;AACzB,oBAAA,QAAQ,EAAE;;;;AAIT,EAAA,CAAA;AACF,iBAAA;;;;;"}
@@ -12782,20 +12782,46 @@ const AXPOutcomeResultsViewerWidget = {
12782
12782
 
12783
12783
  class AXPMapWidgetEditComponent extends AXPValueWidgetComponent {
12784
12784
  onMarkerChanged($event) {
12785
- this.setValue({ polygons: this.getValue()?.polygons ?? [], markers: $event, pois: this.getValue()?.pois ?? [] });
12785
+ this.setValue({ ...this.mapData(), markers: $event });
12786
12786
  }
12787
12787
  onPolygonChanged($event) {
12788
- this.setValue({ polygons: $event, markers: this.getValue()?.markers ?? [], pois: this.getValue()?.pois ?? [] });
12788
+ this.setValue({ ...this.mapData(), polygons: $event });
12789
+ }
12790
+ onPolylineChanged($event) {
12791
+ this.setValue({ ...this.mapData(), polylines: $event });
12792
+ }
12793
+ onRectangleChanged($event) {
12794
+ this.setValue({ ...this.mapData(), rectangles: $event });
12795
+ }
12796
+ onCircleChanged($event) {
12797
+ this.setValue({ ...this.mapData(), circles: $event });
12798
+ }
12799
+ mapData() {
12800
+ const value = this.getValue();
12801
+ return {
12802
+ markers: value?.markers ?? [],
12803
+ polygons: value?.polygons ?? [],
12804
+ polylines: value?.polylines ?? [],
12805
+ rectangles: value?.rectangles ?? [],
12806
+ circles: value?.circles ?? [],
12807
+ pois: value?.pois ?? [],
12808
+ };
12789
12809
  }
12790
12810
  constructor() {
12791
12811
  super();
12792
12812
  this.cdr = inject(ChangeDetectorRef);
12793
12813
  this.markers = computed(() => this.getValue()?.markers ?? [], ...(ngDevMode ? [{ debugName: "markers" }] : /* istanbul ignore next */ []));
12794
12814
  this.polygons = computed(() => this.getValue()?.polygons ?? [], ...(ngDevMode ? [{ debugName: "polygons" }] : /* istanbul ignore next */ []));
12815
+ this.polylines = computed(() => this.getValue()?.polylines ?? [], ...(ngDevMode ? [{ debugName: "polylines" }] : /* istanbul ignore next */ []));
12816
+ this.rectangles = computed(() => this.getValue()?.rectangles ?? [], ...(ngDevMode ? [{ debugName: "rectangles" }] : /* istanbul ignore next */ []));
12817
+ this.circles = computed(() => this.getValue()?.circles ?? [], ...(ngDevMode ? [{ debugName: "circles" }] : /* istanbul ignore next */ []));
12795
12818
  this.hasDraw = computed(() => this.options()['hasDraw'] ?? false, ...(ngDevMode ? [{ debugName: "hasDraw" }] : /* istanbul ignore next */ []));
12796
12819
  this.hasLocate = computed(() => this.options()['hasLocate'] ?? false, ...(ngDevMode ? [{ debugName: "hasLocate" }] : /* istanbul ignore next */ []));
12797
12820
  this.maxMarker = computed(() => this.options()['maxMarker'] ?? 1, ...(ngDevMode ? [{ debugName: "maxMarker" }] : /* istanbul ignore next */ []));
12798
12821
  this.maxPolygon = computed(() => this.options()['maxPolygon'] ?? 1, ...(ngDevMode ? [{ debugName: "maxPolygon" }] : /* istanbul ignore next */ []));
12822
+ this.maxPolyline = computed(() => this.options()['maxPolyline'] ?? 1, ...(ngDevMode ? [{ debugName: "maxPolyline" }] : /* istanbul ignore next */ []));
12823
+ this.maxRectangle = computed(() => this.options()['maxRectangle'] ?? 1, ...(ngDevMode ? [{ debugName: "maxRectangle" }] : /* istanbul ignore next */ []));
12824
+ this.maxCircle = computed(() => this.options()['maxCircle'] ?? 1, ...(ngDevMode ? [{ debugName: "maxCircle" }] : /* istanbul ignore next */ []));
12799
12825
  this.zoomLevel = computed(() => this.options()['zoomLevel'] ?? 13, ...(ngDevMode ? [{ debugName: "zoomLevel" }] : /* istanbul ignore next */ []));
12800
12826
  this.latitude = computed(() => this.options()['latitude'] ?? 35, ...(ngDevMode ? [{ debugName: "latitude" }] : /* istanbul ignore next */ []));
12801
12827
  this.longitude = computed(() => this.options()['longitude'] ?? 51, ...(ngDevMode ? [{ debugName: "longitude" }] : /* istanbul ignore next */ []));
@@ -12823,6 +12849,9 @@ class AXPMapWidgetEditComponent extends AXPValueWidgetComponent {
12823
12849
  class="ax-h-full"
12824
12850
  (onMarkerChanged)="onMarkerChanged($event)"
12825
12851
  (onPolygonChanged)="onPolygonChanged($event)"
12852
+ (onPolylineChanged)="onPolylineChanged($event)"
12853
+ (onRectangleChanged)="onRectangleChanged($event)"
12854
+ (onCircleChanged)="onCircleChanged($event)"
12826
12855
  [hasLocator]="hasLocate()"
12827
12856
  [hasDraw]="hasDraw()"
12828
12857
  [latitude]="latitude()"
@@ -12830,8 +12859,14 @@ class AXPMapWidgetEditComponent extends AXPValueWidgetComponent {
12830
12859
  [zoomLevel]="zoomLevel()"
12831
12860
  [maxMarker]="maxMarker()"
12832
12861
  [maxPolygon]="maxPolygon()"
12862
+ [maxPolyline]="maxPolyline()"
12863
+ [maxRectangle]="maxRectangle()"
12864
+ [maxCircle]="maxCircle()"
12833
12865
  [markers]="markers()"
12834
12866
  [polygons]="polygons()"
12867
+ [polylines]="polylines()"
12868
+ [rectangles]="rectangles()"
12869
+ [circles]="circles()"
12835
12870
  [fitToDraw]="fitToDraw()"
12836
12871
  [limitDraw]="limitDraw()!"
12837
12872
  [pois]="pois()"
@@ -12839,7 +12874,7 @@ class AXPMapWidgetEditComponent extends AXPValueWidgetComponent {
12839
12874
  [readonly]="readonly()"
12840
12875
  >
12841
12876
  </ax-map>
12842
- </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXMapModule }, { kind: "component", type: i1$g.AXMapComponent, selector: "ax-map", inputs: ["zoomLevel", "latitude", "longitude", "maxMarker", "maxPolygon", "hasDraw", "hasLocator", "fitToDraw", "limitDraw", "addPoiToFitDraw", "addMarkerOnTap", "readonly", "disabled", "markerPlace", "locatePlace", "poiMinZoom", "markers", "polygons", "pois"], outputs: ["zoomLevelChange", "latitudeChange", "longitudeChange", "onMarkerAdded", "onMarkerClick", "onMarkerChanged", "onPolygonAdded", "onPolygonClick", "onPolygonChanged", "onLocationFound", "onPoiChanged", "onPoiAdded", "onMapReady", "onLoadError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
12877
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXMapModule }, { kind: "component", type: i1$g.AXMapComponent, selector: "ax-map", inputs: ["zoomLevel", "latitude", "longitude", "maxMarker", "maxPolygon", "maxPolyline", "maxRectangle", "maxCircle", "hasDraw", "hasLocator", "fitToDraw", "limitDraw", "addPoiToFitDraw", "addMarkerOnTap", "readonly", "disabled", "markerPlace", "locatePlace", "poiMinZoom", "markers", "polygons", "polylines", "rectangles", "circles", "pois"], outputs: ["zoomLevelChange", "latitudeChange", "longitudeChange", "onMarkerAdded", "onMarkerClick", "onMarkerChanged", "onPolygonAdded", "onPolygonClick", "onPolygonChanged", "onPolylineAdded", "onPolylineClick", "onPolylineChanged", "onRectangleAdded", "onRectangleClick", "onRectangleChanged", "onCircleAdded", "onCircleClick", "onCircleChanged", "onLocationFound", "onPoiChanged", "onPoiAdded", "onMapReady", "onLoadError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
12843
12878
  }
12844
12879
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPMapWidgetEditComponent, decorators: [{
12845
12880
  type: Component,
@@ -12850,6 +12885,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
12850
12885
  class="ax-h-full"
12851
12886
  (onMarkerChanged)="onMarkerChanged($event)"
12852
12887
  (onPolygonChanged)="onPolygonChanged($event)"
12888
+ (onPolylineChanged)="onPolylineChanged($event)"
12889
+ (onRectangleChanged)="onRectangleChanged($event)"
12890
+ (onCircleChanged)="onCircleChanged($event)"
12853
12891
  [hasLocator]="hasLocate()"
12854
12892
  [hasDraw]="hasDraw()"
12855
12893
  [latitude]="latitude()"
@@ -12857,8 +12895,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
12857
12895
  [zoomLevel]="zoomLevel()"
12858
12896
  [maxMarker]="maxMarker()"
12859
12897
  [maxPolygon]="maxPolygon()"
12898
+ [maxPolyline]="maxPolyline()"
12899
+ [maxRectangle]="maxRectangle()"
12900
+ [maxCircle]="maxCircle()"
12860
12901
  [markers]="markers()"
12861
12902
  [polygons]="polygons()"
12903
+ [polylines]="polylines()"
12904
+ [rectangles]="rectangles()"
12905
+ [circles]="circles()"
12862
12906
  [fitToDraw]="fitToDraw()"
12863
12907
  [limitDraw]="limitDraw()!"
12864
12908
  [pois]="pois()"
@@ -12886,6 +12930,9 @@ class AXPMapWidgetViewComponent extends AXPValueWidgetComponent {
12886
12930
  super();
12887
12931
  this.markers = computed(() => this.getValue()?.markers ?? [], ...(ngDevMode ? [{ debugName: "markers" }] : /* istanbul ignore next */ []));
12888
12932
  this.polygons = computed(() => this.getValue()?.polygons ?? [], ...(ngDevMode ? [{ debugName: "polygons" }] : /* istanbul ignore next */ []));
12933
+ this.polylines = computed(() => this.getValue()?.polylines ?? [], ...(ngDevMode ? [{ debugName: "polylines" }] : /* istanbul ignore next */ []));
12934
+ this.rectangles = computed(() => this.getValue()?.rectangles ?? [], ...(ngDevMode ? [{ debugName: "rectangles" }] : /* istanbul ignore next */ []));
12935
+ this.circles = computed(() => this.getValue()?.circles ?? [], ...(ngDevMode ? [{ debugName: "circles" }] : /* istanbul ignore next */ []));
12889
12936
  this.height = computed(() => this.options()['height'] ?? 300, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
12890
12937
  this.zoomLevel = computed(() => this.options()['zoomLevel'] ?? 13, ...(ngDevMode ? [{ debugName: "zoomLevel" }] : /* istanbul ignore next */ []));
12891
12938
  this.latitude = computed(() => this.options()['latitude'] ?? 35, ...(ngDevMode ? [{ debugName: "latitude" }] : /* istanbul ignore next */ []));
@@ -12902,6 +12949,9 @@ class AXPMapWidgetViewComponent extends AXPValueWidgetComponent {
12902
12949
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: AXPMapWidgetViewComponent, isStandalone: true, selector: "axp-map-box-widget-view", usesInheritance: true, ngImport: i0, template: `<div [style.height.px]="height()" class="ax-w-full">
12903
12950
  <ax-map
12904
12951
  [polygons]="polygons()"
12952
+ [polylines]="polylines()"
12953
+ [rectangles]="rectangles()"
12954
+ [circles]="circles()"
12905
12955
  [zoomLevel]="zoomLevel()"
12906
12956
  [latitude]="latitude()"
12907
12957
  [longitude]="longitude()"
@@ -12909,7 +12959,7 @@ class AXPMapWidgetViewComponent extends AXPValueWidgetComponent {
12909
12959
  [disabled]="disabled()"
12910
12960
  [readonly]="readonly()"
12911
12961
  ></ax-map>
12912
- </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXMapModule }, { kind: "component", type: i1$g.AXMapComponent, selector: "ax-map", inputs: ["zoomLevel", "latitude", "longitude", "maxMarker", "maxPolygon", "hasDraw", "hasLocator", "fitToDraw", "limitDraw", "addPoiToFitDraw", "addMarkerOnTap", "readonly", "disabled", "markerPlace", "locatePlace", "poiMinZoom", "markers", "polygons", "pois"], outputs: ["zoomLevelChange", "latitudeChange", "longitudeChange", "onMarkerAdded", "onMarkerClick", "onMarkerChanged", "onPolygonAdded", "onPolygonClick", "onPolygonChanged", "onLocationFound", "onPoiChanged", "onPoiAdded", "onMapReady", "onLoadError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
12962
+ </div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXMapModule }, { kind: "component", type: i1$g.AXMapComponent, selector: "ax-map", inputs: ["zoomLevel", "latitude", "longitude", "maxMarker", "maxPolygon", "maxPolyline", "maxRectangle", "maxCircle", "hasDraw", "hasLocator", "fitToDraw", "limitDraw", "addPoiToFitDraw", "addMarkerOnTap", "readonly", "disabled", "markerPlace", "locatePlace", "poiMinZoom", "markers", "polygons", "polylines", "rectangles", "circles", "pois"], outputs: ["zoomLevelChange", "latitudeChange", "longitudeChange", "onMarkerAdded", "onMarkerClick", "onMarkerChanged", "onPolygonAdded", "onPolygonClick", "onPolygonChanged", "onPolylineAdded", "onPolylineClick", "onPolylineChanged", "onRectangleAdded", "onRectangleClick", "onRectangleChanged", "onCircleAdded", "onCircleClick", "onCircleChanged", "onLocationFound", "onPoiChanged", "onPoiAdded", "onMapReady", "onLoadError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
12913
12963
  }
12914
12964
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPMapWidgetViewComponent, decorators: [{
12915
12965
  type: Component,
@@ -12918,6 +12968,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
12918
12968
  template: `<div [style.height.px]="height()" class="ax-w-full">
12919
12969
  <ax-map
12920
12970
  [polygons]="polygons()"
12971
+ [polylines]="polylines()"
12972
+ [rectangles]="rectangles()"
12973
+ [circles]="circles()"
12921
12974
  [zoomLevel]="zoomLevel()"
12922
12975
  [latitude]="latitude()"
12923
12976
  [longitude]="longitude()"
@@ -23086,144 +23139,231 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
23086
23139
  args: [{ providedIn: 'root' }]
23087
23140
  }] });
23088
23141
 
23142
+ //#region ---- Stored image URL resolver ----
23143
+ const FILE_STORAGE_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
23144
+ const FILE_STORAGE_PREFIX = 'file:';
23145
+ /** Strips the file-cast prefix and whitespace from a stored image reference. */
23146
+ function normalizeStoredImageRef(value) {
23147
+ if (!value) {
23148
+ return null;
23149
+ }
23150
+ const trimmed = value.trim();
23151
+ if (!trimmed || trimmed === 'null') {
23152
+ return null;
23153
+ }
23154
+ return trimmed.startsWith(FILE_STORAGE_PREFIX) ? trimmed.slice(FILE_STORAGE_PREFIX.length) : trimmed;
23155
+ }
23156
+ function isStoredImageFileId(value) {
23157
+ const normalized = normalizeStoredImageRef(value);
23158
+ if (!normalized) {
23159
+ return false;
23160
+ }
23161
+ return FILE_STORAGE_ID_PATTERN.test(normalized);
23162
+ }
23163
+ async function resolveStoredImageDisplayUrl(value, resolveFile) {
23164
+ const normalized = normalizeStoredImageRef(value);
23165
+ if (!normalized) {
23166
+ return '';
23167
+ }
23168
+ if (normalized.startsWith('http://') ||
23169
+ normalized.startsWith('https://') ||
23170
+ normalized.startsWith('data:image/') ||
23171
+ normalized.startsWith('blob:')) {
23172
+ return normalized;
23173
+ }
23174
+ if (isStoredImageFileId(normalized)) {
23175
+ const info = await resolveFile(normalized);
23176
+ if (info.url) {
23177
+ return info.url;
23178
+ }
23179
+ if (info.binary) {
23180
+ return URL.createObjectURL(info.binary);
23181
+ }
23182
+ return '';
23183
+ }
23184
+ return normalized;
23185
+ }
23186
+ //#endregion
23187
+
23089
23188
  //#region ---- Component: Image Widget Column ----
23090
23189
  class AXPImageWidgetColumnComponent extends AXPColumnWidgetComponent {
23190
+ //#endregion
23191
+ //#region ---- Lifecycle ----
23091
23192
  constructor() {
23092
23193
  super();
23093
- this.layoutBuilder = inject(AXPLayoutBuilderService);
23194
+ //#region ---- Services & Dependencies ----
23195
+ this.popupService = inject(AXPopupService);
23094
23196
  this.imageDef = inject(AXPImageDefinitionService);
23095
- this.width = computed(() => {
23096
- const provided = this.providerSettings();
23097
- const optW = this.options?.columnWidth;
23098
- const optH = this.options?.columnHeight;
23099
- const baseW = optW ?? provided?.width;
23100
- const baseH = optH ?? provided?.height;
23101
- if (baseW != null && baseW !== '')
23102
- return baseW;
23103
- if ((baseW == null || baseW === '') && (baseH == null || baseH === ''))
23104
- return '100%';
23105
- return undefined;
23106
- }, ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
23107
- this.height = computed(() => {
23108
- const provided = this.providerSettings();
23109
- const optH = this.options?.columnHeight;
23110
- const baseH = optH ?? provided?.height;
23111
- if (baseH != null && baseH !== '')
23112
- return baseH;
23113
- return undefined;
23114
- }, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
23197
+ this.fileStorage = inject(AXPFileStorageService, { optional: true });
23198
+ //#endregion
23199
+ //#region ---- Computed Properties ----
23115
23200
  this.typeName = computed(() => this.options?.type, ...(ngDevMode ? [{ debugName: "typeName" }] : /* istanbul ignore next */ []));
23116
23201
  this.providerSettings = computed(() => this.imageDef.resolve(this.typeName() ?? null), ...(ngDevMode ? [{ debugName: "providerSettings" }] : /* istanbul ignore next */ []));
23117
- this.aspectRatio = computed(() => {
23118
- const opt = this.options?.aspectRatio;
23119
- const def = this.providerSettings()?.aspectRatio;
23120
- return (opt ?? def ?? undefined);
23121
- }, ...(ngDevMode ? [{ debugName: "aspectRatio" }] : /* istanbul ignore next */ []));
23122
- this.objectFit = computed(() => {
23123
- const optVal = this.options?.objectFit;
23202
+ this.thumbnailSize = computed(() => {
23203
+ const options = this.options;
23204
+ const optW = options?.columnWidth;
23205
+ const optH = options?.columnHeight;
23206
+ if (optW) {
23207
+ return optW;
23208
+ }
23209
+ if (optH) {
23210
+ return optH;
23211
+ }
23212
+ return '40px';
23213
+ }, ...(ngDevMode ? [{ debugName: "thumbnailSize" }] : /* istanbul ignore next */ []));
23214
+ this.thumbnailObjectFit = computed(() => {
23215
+ const options = this.options;
23216
+ const optVal = options?.objectFit;
23124
23217
  const provided = this.providerSettings();
23125
23218
  const normalized = typeof optVal === 'string' ? optVal : optVal?.id;
23126
- return normalized ?? provided?.objectFit ?? 'contain';
23127
- }, ...(ngDevMode ? [{ debugName: "objectFit" }] : /* istanbul ignore next */ []));
23219
+ return normalized ?? provided?.objectFit ?? 'cover';
23220
+ }, ...(ngDevMode ? [{ debugName: "thumbnailObjectFit" }] : /* istanbul ignore next */ []));
23221
+ this.thumbnailBorderRadius = computed(() => {
23222
+ const options = this.options;
23223
+ return options?.borderRadius ?? this.providerSettings()?.borderRadius ?? '4px';
23224
+ }, ...(ngDevMode ? [{ debugName: "thumbnailBorderRadius" }] : /* istanbul ignore next */ []));
23225
+ //#endregion
23226
+ //#region ---- State ----
23128
23227
  this.imageUrl = signal(null, ...(ngDevMode ? [{ debugName: "imageUrl" }] : /* istanbul ignore next */ []));
23228
+ this.blobObjectUrl = null;
23229
+ this.hydrateRequestId = 0;
23129
23230
  effect(() => {
23130
- const value = this.rawValue;
23131
- const currentUrl = this.imageUrl();
23132
- if (currentUrl && currentUrl.startsWith('blob:')) {
23133
- URL.revokeObjectURL(currentUrl);
23134
- }
23135
- if (typeof value === 'string') {
23136
- this.imageUrl.set(value);
23137
- }
23138
- else if (value instanceof URL) {
23139
- this.imageUrl.set(value.href);
23140
- }
23141
- else if (value instanceof Blob) {
23142
- this.imageUrl.set(URL.createObjectURL(value));
23143
- }
23144
- else if (value instanceof ArrayBuffer) {
23145
- const blob = new Blob([value]);
23146
- this.imageUrl.set(URL.createObjectURL(blob));
23147
- }
23148
- else {
23149
- this.imageUrl.set(null);
23150
- }
23231
+ void this.hydrateImageUrl(this.rawValue);
23151
23232
  });
23152
23233
  }
23234
+ //#endregion
23235
+ //#region ---- UI Handlers ----
23153
23236
  async showPopup() {
23154
- const url = this.imageUrl();
23155
- if (!url) {
23237
+ const src = this.imageUrl();
23238
+ if (!src) {
23156
23239
  return;
23157
23240
  }
23158
- const ref = await this.layoutBuilder
23159
- .create()
23160
- .dialog((dialog) => {
23161
- dialog
23162
- .setTitle('Image')
23163
- .setSize('lg')
23164
- .content((layoutBuilder) => {
23165
- layoutBuilder.flex((flex) => {
23166
- flex.mode('view').formField('Preview', (field) => {
23167
- field.readonly(true).customWidget('image', {
23168
- src: url,
23169
- type: this.typeName(),
23170
- width: '100%',
23171
- aspectRatio: this.aspectRatio(),
23172
- objectFit: this.objectFit(),
23173
- });
23174
- });
23175
- });
23176
- })
23177
- .setActions((actions) => {
23178
- actions.cancel('@general:actions.cancel.title');
23179
- });
23180
- })
23181
- .show();
23182
- ref.close();
23241
+ const { AXPImagePreviewPopupComponent } = await import('./acorex-platform-layout-widgets-image-preview.popup-n5Lcs-RM.mjs');
23242
+ await this.popupService.open(AXPImagePreviewPopupComponent, {
23243
+ title: '@platform-layout-widgets:widgets.image.dialog.title',
23244
+ size: 'lg',
23245
+ closeButton: true,
23246
+ closeOnBackdropClick: true,
23247
+ data: { src },
23248
+ });
23183
23249
  }
23184
23250
  ngOnDestroy() {
23185
- const currentUrl = this.imageUrl();
23186
- if (currentUrl && currentUrl.startsWith('blob:')) {
23187
- URL.revokeObjectURL(currentUrl);
23251
+ this.revokeBlobUrl();
23252
+ }
23253
+ //#endregion
23254
+ //#region ---- Utility Methods ----
23255
+ async hydrateImageUrl(value) {
23256
+ const requestId = ++this.hydrateRequestId;
23257
+ this.revokeBlobUrl();
23258
+ if (typeof value === 'string') {
23259
+ if (this.fileStorage && isStoredImageFileId(value)) {
23260
+ try {
23261
+ const displayUrl = await resolveStoredImageDisplayUrl(value, (fileId) => this.fileStorage.getInfo(fileId));
23262
+ if (requestId !== this.hydrateRequestId) {
23263
+ if (displayUrl.startsWith('blob:')) {
23264
+ URL.revokeObjectURL(displayUrl);
23265
+ }
23266
+ return;
23267
+ }
23268
+ if (displayUrl.startsWith('blob:')) {
23269
+ this.blobObjectUrl = displayUrl;
23270
+ }
23271
+ this.imageUrl.set(displayUrl || null);
23272
+ return;
23273
+ }
23274
+ catch {
23275
+ if (requestId === this.hydrateRequestId) {
23276
+ this.imageUrl.set(null);
23277
+ }
23278
+ return;
23279
+ }
23280
+ }
23281
+ if (requestId === this.hydrateRequestId) {
23282
+ this.imageUrl.set(value);
23283
+ }
23284
+ return;
23285
+ }
23286
+ if (requestId !== this.hydrateRequestId) {
23287
+ return;
23288
+ }
23289
+ if (value instanceof URL) {
23290
+ this.imageUrl.set(value.href);
23291
+ }
23292
+ else if (value instanceof Blob) {
23293
+ this.blobObjectUrl = URL.createObjectURL(value);
23294
+ this.imageUrl.set(this.blobObjectUrl);
23295
+ }
23296
+ else if (value instanceof ArrayBuffer) {
23297
+ const blob = new Blob([value]);
23298
+ this.blobObjectUrl = URL.createObjectURL(blob);
23299
+ this.imageUrl.set(this.blobObjectUrl);
23300
+ }
23301
+ else {
23302
+ this.imageUrl.set(null);
23303
+ }
23304
+ }
23305
+ revokeBlobUrl() {
23306
+ if (this.blobObjectUrl) {
23307
+ URL.revokeObjectURL(this.blobObjectUrl);
23308
+ this.blobObjectUrl = null;
23188
23309
  }
23189
23310
  }
23190
23311
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPImageWidgetColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
23191
23312
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: AXPImageWidgetColumnComponent, isStandalone: true, selector: "axp-image-widget-column", inputs: { rawValue: "rawValue", rowData: "rowData" }, usesInheritance: true, ngImport: i0, template: `
23192
23313
  <div class="ax-flex ax-items-center ax-gap-2">
23193
23314
  @if (imageUrl()) {
23194
- <span> Image </span>
23195
- <ax-button color="default" (click)="showPopup()">
23196
- <ax-icon>
23197
- <i class="fa-regular fa-info-image"></i>
23198
- </ax-icon>
23199
- </ax-button>
23315
+ <button
23316
+ type="button"
23317
+ class="ax-inline-flex ax-shrink-0 ax-overflow-hidden ax-cursor-pointer ax-border ax-border-border-light-surface ax-bg-transparent ax-p-0"
23318
+ [style.width]="thumbnailSize()"
23319
+ [style.height]="thumbnailSize()"
23320
+ [style.border-radius]="thumbnailBorderRadius()"
23321
+ (click)="showPopup()"
23322
+ >
23323
+ <img
23324
+ [src]="imageUrl()!"
23325
+ alt=""
23326
+ class="ax-size-full"
23327
+ [style.object-fit]="thumbnailObjectFit()"
23328
+ [style.border-radius]="thumbnailBorderRadius()"
23329
+ />
23330
+ </button>
23200
23331
  } @else {
23201
23332
  <span>-</span>
23202
23333
  }
23203
23334
  </div>
23204
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
23335
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
23205
23336
  }
23206
23337
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPImageWidgetColumnComponent, decorators: [{
23207
23338
  type: Component,
23208
23339
  args: [{
23209
23340
  selector: 'axp-image-widget-column',
23210
- imports: [AXButtonModule, AXDecoratorModule],
23211
23341
  template: `
23212
23342
  <div class="ax-flex ax-items-center ax-gap-2">
23213
23343
  @if (imageUrl()) {
23214
- <span> Image </span>
23215
- <ax-button color="default" (click)="showPopup()">
23216
- <ax-icon>
23217
- <i class="fa-regular fa-info-image"></i>
23218
- </ax-icon>
23219
- </ax-button>
23344
+ <button
23345
+ type="button"
23346
+ class="ax-inline-flex ax-shrink-0 ax-overflow-hidden ax-cursor-pointer ax-border ax-border-border-light-surface ax-bg-transparent ax-p-0"
23347
+ [style.width]="thumbnailSize()"
23348
+ [style.height]="thumbnailSize()"
23349
+ [style.border-radius]="thumbnailBorderRadius()"
23350
+ (click)="showPopup()"
23351
+ >
23352
+ <img
23353
+ [src]="imageUrl()!"
23354
+ alt=""
23355
+ class="ax-size-full"
23356
+ [style.object-fit]="thumbnailObjectFit()"
23357
+ [style.border-radius]="thumbnailBorderRadius()"
23358
+ />
23359
+ </button>
23220
23360
  } @else {
23221
23361
  <span>-</span>
23222
23362
  }
23223
23363
  </div>
23224
23364
  `,
23225
23365
  changeDetection: ChangeDetectionStrategy.OnPush,
23226
- inputs: ['rawValue', 'rowData']
23366
+ inputs: ['rawValue', 'rowData'],
23227
23367
  }]
23228
23368
  }], ctorParameters: () => [] });
23229
23369
 
@@ -23465,7 +23605,7 @@ class AXPImageWidgetEditComponent extends AXPValueWidgetComponent {
23465
23605
  if (!src) {
23466
23606
  return;
23467
23607
  }
23468
- const { AXPImagePreviewPopupComponent } = await import('./acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs');
23608
+ const { AXPImagePreviewPopupComponent } = await import('./acorex-platform-layout-widgets-image-preview.popup-n5Lcs-RM.mjs');
23469
23609
  await this.popupService.open(AXPImagePreviewPopupComponent, {
23470
23610
  title: 'Image Preview',
23471
23611
  size: 'lg',
@@ -24091,6 +24231,30 @@ const AXPMapWidget = {
24091
24231
  defaultValue: 1,
24092
24232
  options: { minValue: 0, maxValue: 100 },
24093
24233
  }),
24234
+ createNumberProperty({
24235
+ name: 'maxPolyline',
24236
+ title: 'Max Polyline',
24237
+ path: 'options.maxPolyline',
24238
+ group: AXP_DATA_PROPERTY_GROUP,
24239
+ defaultValue: 1,
24240
+ options: { minValue: 0, maxValue: 100 },
24241
+ }),
24242
+ createNumberProperty({
24243
+ name: 'maxRectangle',
24244
+ title: 'Max Rectangle',
24245
+ path: 'options.maxRectangle',
24246
+ group: AXP_DATA_PROPERTY_GROUP,
24247
+ defaultValue: 1,
24248
+ options: { minValue: 0, maxValue: 100 },
24249
+ }),
24250
+ createNumberProperty({
24251
+ name: 'maxCircle',
24252
+ title: 'Max Circle',
24253
+ path: 'options.maxCircle',
24254
+ group: AXP_DATA_PROPERTY_GROUP,
24255
+ defaultValue: 1,
24256
+ options: { minValue: 0, maxValue: 100 },
24257
+ }),
24094
24258
  createNumberProperty({
24095
24259
  name: 'latitude',
24096
24260
  title: 'Latitude',