oasys-lib 2.35.2 → 2.35.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.
@@ -942,7 +942,7 @@ class ImageComponent {
942
942
  image_fill = false;
943
943
  fetchpriority = 'auto';
944
944
  loading = 'lazy';
945
- preload_aspect_ratio = '1:1';
945
+ preload_aspect_ratio = null;
946
946
  image_width = null; // explicit rendered width in px, when known by the consumer
947
947
  image_sizes = null; // fallback `sizes` value for non-lazy / no-auto-support cases
948
948
  image_loaded = new EventEmitter();
@@ -972,19 +972,19 @@ class ImageComponent {
972
972
  * Creates the image object with the provided properties.
973
973
  */
974
974
  createImage() {
975
- const ratios = this.preload_aspect_ratio.split(':');
975
+ const ratios = this.preload_aspect_ratio?.split(':');
976
976
  const imageUrlResponse = this.imageUrlProvider.generateImageUrl(this.image_src, this.breakpoints, this.fallbackBreakpoint);
977
977
  const loading = this.resolveLoading();
978
978
  const newImage = {
979
979
  ...imageUrlResponse,
980
- ratioWidth: parseInt(ratios[0], 10),
981
- ratioHeight: parseInt(ratios[1], 10),
980
+ ratioWidth: ratios ? parseInt(ratios[0], 10) : undefined,
981
+ ratioHeight: ratios ? parseInt(ratios[1], 10) : undefined,
982
982
  loading,
983
983
  fill: this.image_fill,
984
984
  fetchpriority: this.fetchpriority,
985
985
  preloadAspectRatio: this.preload_aspect_ratio,
986
986
  width: this.image_width ? `${this.image_width}px` : null,
987
- sizes: this.resolveSizes(loading),
987
+ sizes: this.resolveSizes(),
988
988
  altText: this.image_alt_text,
989
989
  ariaDescribedby: this.image_aria_describedby ?? null,
990
990
  };
@@ -993,19 +993,18 @@ class ImageComponent {
993
993
  resolveLoading() {
994
994
  return this.fetchpriority === 'high' ? 'eager' : this.loading;
995
995
  }
996
- resolveSizes(loading) {
996
+ resolveSizes() {
997
997
  if (this.image_width) {
998
998
  return `${this.image_width}px`;
999
999
  }
1000
- const fallback = this.image_sizes ?? '100vw';
1001
- return loading === 'lazy' ? `auto, ${fallback}` : fallback;
1000
+ return this.image_sizes ?? '100vw';
1002
1001
  }
1003
1002
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1004
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: ImageComponent, isStandalone: true, selector: "ui-image", inputs: { image_src: "image_src", image_alt_text: "image_alt_text", image_aria_describedby: "image_aria_describedby", image_fill: "image_fill", fetchpriority: "fetchpriority", loading: "loading", preload_aspect_ratio: "preload_aspect_ratio", image_width: "image_width", image_sizes: "image_sizes" }, outputs: { image_loaded: "image_loaded" }, host: { properties: { "class": "this.class" } }, usesOnChanges: true, ngImport: i0, template: "@if (image()) {\n <picture>\n <source\n [attr.srcset]=\"image().srcSetUrls\"\n [attr.sizes]=\"image().sizes\"\n type=\"image/webp\"\n />\n\n <img\n [class.imageFill]=\"image().fill\"\n [attr.width]=\"image().ratioWidth\"\n [attr.height]=\"image().ratioHeight\"\n [attr.src]=\"image().fallbackUrl\"\n [attr.sizes]=\"image().sizes\"\n [attr.loading]=\"image().loading\"\n [attr.fetchpriority]=\"image().fetchpriority\"\n [attr.alt]=\"image().altText\"\n [attr.aria-describedby]=\"image().ariaDescribedby\"\n [ngStyle]=\"{ 'aspect-ratio': image().preloadAspectRatio }\"\n (load)=\"image_loaded.emit()\"\n [attr.role]=\"image().altText?.length > 0 ? 'img' : 'presentation'\"\n />\n </picture>\n}\n", styles: [":host.imageFill{display:block;width:100%;height:100%}:host.imageFill picture,:host.imageFill img{display:block;width:100%;height:100%}:host.imageFill img{object-fit:cover}:host{display:block}img{display:block;width:100%;height:auto}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1003
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: ImageComponent, isStandalone: true, selector: "ui-image", inputs: { image_src: "image_src", image_alt_text: "image_alt_text", image_aria_describedby: "image_aria_describedby", image_fill: "image_fill", fetchpriority: "fetchpriority", loading: "loading", preload_aspect_ratio: "preload_aspect_ratio", image_width: "image_width", image_sizes: "image_sizes" }, outputs: { image_loaded: "image_loaded" }, host: { properties: { "class": "this.class" } }, usesOnChanges: true, ngImport: i0, template: "@if (image()) {\n <picture>\n <source\n [attr.srcset]=\"image().srcSetUrls\"\n [attr.sizes]=\"image().sizes\"\n type=\"image/webp\"\n />\n\n <img\n [class.imageFill]=\"image().fill\"\n [attr.width]=\"image().ratioWidth\"\n [attr.height]=\"image().ratioHeight\"\n [attr.src]=\"image().fallbackUrl\"\n [attr.sizes]=\"image().sizes\"\n [attr.loading]=\"image().loading\"\n [attr.fetchpriority]=\"image().fetchpriority\"\n [attr.alt]=\"image().altText\"\n [attr.aria-describedby]=\"image().ariaDescribedby\"\n [ngStyle]=\"image().preloadAspectRatio ? { 'aspect-ratio': image().preloadAspectRatio } : {}\"\n (load)=\"image_loaded.emit()\"\n [attr.role]=\"image().altText?.length > 0 ? 'img' : 'presentation'\"\n />\n </picture>\n}\n", styles: [":host.imageFill{display:block;width:100%;height:100%}:host.imageFill picture,:host.imageFill img{display:block;width:100%;height:100%}:host.imageFill img{object-fit:cover}:host{display:block}img{display:block;width:100%;height:auto}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1005
1004
  }
1006
1005
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: ImageComponent, decorators: [{
1007
1006
  type: Component,
1008
- args: [{ standalone: true, imports: [NgStyle], selector: 'ui-image', template: "@if (image()) {\n <picture>\n <source\n [attr.srcset]=\"image().srcSetUrls\"\n [attr.sizes]=\"image().sizes\"\n type=\"image/webp\"\n />\n\n <img\n [class.imageFill]=\"image().fill\"\n [attr.width]=\"image().ratioWidth\"\n [attr.height]=\"image().ratioHeight\"\n [attr.src]=\"image().fallbackUrl\"\n [attr.sizes]=\"image().sizes\"\n [attr.loading]=\"image().loading\"\n [attr.fetchpriority]=\"image().fetchpriority\"\n [attr.alt]=\"image().altText\"\n [attr.aria-describedby]=\"image().ariaDescribedby\"\n [ngStyle]=\"{ 'aspect-ratio': image().preloadAspectRatio }\"\n (load)=\"image_loaded.emit()\"\n [attr.role]=\"image().altText?.length > 0 ? 'img' : 'presentation'\"\n />\n </picture>\n}\n", styles: [":host.imageFill{display:block;width:100%;height:100%}:host.imageFill picture,:host.imageFill img{display:block;width:100%;height:100%}:host.imageFill img{object-fit:cover}:host{display:block}img{display:block;width:100%;height:auto}\n"] }]
1007
+ args: [{ standalone: true, imports: [NgStyle], selector: 'ui-image', template: "@if (image()) {\n <picture>\n <source\n [attr.srcset]=\"image().srcSetUrls\"\n [attr.sizes]=\"image().sizes\"\n type=\"image/webp\"\n />\n\n <img\n [class.imageFill]=\"image().fill\"\n [attr.width]=\"image().ratioWidth\"\n [attr.height]=\"image().ratioHeight\"\n [attr.src]=\"image().fallbackUrl\"\n [attr.sizes]=\"image().sizes\"\n [attr.loading]=\"image().loading\"\n [attr.fetchpriority]=\"image().fetchpriority\"\n [attr.alt]=\"image().altText\"\n [attr.aria-describedby]=\"image().ariaDescribedby\"\n [ngStyle]=\"image().preloadAspectRatio ? { 'aspect-ratio': image().preloadAspectRatio } : {}\"\n (load)=\"image_loaded.emit()\"\n [attr.role]=\"image().altText?.length > 0 ? 'img' : 'presentation'\"\n />\n </picture>\n}\n", styles: [":host.imageFill{display:block;width:100%;height:100%}:host.imageFill picture,:host.imageFill img{display:block;width:100%;height:100%}:host.imageFill img{object-fit:cover}:host{display:block}img{display:block;width:100%;height:auto}\n"] }]
1009
1008
  }], propDecorators: { image_src: [{
1010
1009
  type: Input,
1011
1010
  args: [{ required: true }]