@ptcwebops/ptcw-design 0.1.5 → 0.1.6

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.
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["ptc-card.cjs",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link.cjs",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie.cjs",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["list-item.cjs",[[4,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"]}]]],["my-component.cjs",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-avatar.cjs",[[1,"ptc-avatar"]]],["ptc-footer.cjs",[[1,"ptc-footer"]]],["ptc-img.cjs",[[0,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["ptc-list.cjs",[[0,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-nav.cjs",[[1,"ptc-nav"]]],["ptc-nav-item.cjs",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-overlay.cjs",[[4,"ptc-overlay"]]],["ptc-picture.cjs",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-spacer.cjs",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span.cjs",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title.cjs",[[1,"ptc-title",{"type":[1],"textAlign":[1,"text-align"],"upperline":[1]}]]],["lottie-player.cjs",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date.cjs",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateStyles":[1,"date-styles"]}]]],["icon-asset_5.cjs",[[1,"ptc-announcement",{"btnText":[513,"btn-text"],"visible":[1540],"btnLink":[513,"btn-link"],"tempContainer":[4,"temp-container"]}],[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraMargin":[1,"para-margin"]}],[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"target":[1],"rel":[1]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"]}],[0,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
17
+ return index.bootstrapLazy([["ptc-card.cjs",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link.cjs",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie.cjs",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["list-item.cjs",[[4,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"]}]]],["my-component.cjs",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-avatar.cjs",[[1,"ptc-avatar"]]],["ptc-footer.cjs",[[1,"ptc-footer"]]],["ptc-img.cjs",[[0,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["ptc-list.cjs",[[0,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-nav.cjs",[[1,"ptc-nav"]]],["ptc-nav-item.cjs",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-overlay.cjs",[[4,"ptc-overlay"]]],["ptc-picture.cjs",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"styles":[1],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-spacer.cjs",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span.cjs",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title.cjs",[[1,"ptc-title",{"type":[1],"textAlign":[1,"text-align"],"upperline":[1]}]]],["lottie-player.cjs",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date.cjs",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateStyles":[1,"date-styles"]}]]],["icon-asset_5.cjs",[[1,"ptc-announcement",{"btnText":[513,"btn-text"],"visible":[1540],"btnLink":[513,"btn-link"],"tempContainer":[4,"temp-container"]}],[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraMargin":[1,"para-margin"]}],[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"target":[1],"rel":[1]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"]}],[0,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -5,11 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-ac192914.js');
6
6
  const interfaces = require('./interfaces-0ecd8027.js');
7
7
 
8
- const ptcPictureCss = ":host{display:block;overflow:hidden}.cover{object-fit:cover}.fill{object-fit:fill}.contain{object-fit:contain}.scale-down{object-fit:scale-down}.none{object-fit:none}.initial{object-fit:initial}.inherit{object-fit:inherit}";
8
+ const ptcPictureCss = ":host{display:block;overflow:hidden}img{max-width:100%;height:auto}.cover{object-fit:cover}.fill{object-fit:fill}.contain{object-fit:contain}.scale-down{object-fit:scale-down}.none{object-fit:none}.initial{object-fit:initial}.inherit{object-fit:inherit}";
9
9
 
10
10
  const PtcPicture = class {
11
11
  constructor(hostRef) {
12
12
  index.registerInstance(this, hostRef);
13
+ /**
14
+ * Image alt
15
+ */
16
+ this.alt = "image";
13
17
  /**
14
18
  * Image size for smallest screen
15
19
  * <=767px
@@ -34,16 +38,6 @@ const PtcPicture = class {
34
38
  * Image border shape
35
39
  */
36
40
  this.borderRadius = '';
37
- /**
38
- * Set height
39
- * Width will be auto by default
40
- */
41
- this.height = 'auto';
42
- /**
43
- * Set Width
44
- * height will be 100% by default
45
- */
46
- this.width = '100%';
47
41
  /**
48
42
  * Object Fit
49
43
  * Default: cover
@@ -96,8 +90,6 @@ const PtcPicture = class {
96
90
  setResponsiveBg() {
97
91
  // Define local variables
98
92
  let backgrounds = (this.el.shadowRoot || document).querySelectorAll('img'), el, elData, currentBreakpoint = this.getCurrentBreakPoints();
99
- //console.log('current breakpoint: ' + currentBreakpoint);
100
- // Loop through all target elements
101
93
  for (var i = 0, len = backgrounds.length; i < len; i++) {
102
94
  // Set current variables
103
95
  el = backgrounds[i];
@@ -115,7 +107,7 @@ const PtcPicture = class {
115
107
  }
116
108
  render() {
117
109
  const classMap = this.getCssClassMap();
118
- return (index.h(index.Host, null, index.h("style", null, `img{width:${this.width};height:${this.height};}`), index.h("img", { class: classMap, "data-xs": `${this.src}:${this.sizeXs}`, "data-sm": `${this.src}:${this.sizeSm}`, "data-md": `${this.src}:${this.sizeMd}`, "data-lg": `${this.src}:${this.sizeLg}`, alt: this.alt })));
110
+ return (index.h(index.Host, null, this.styles && index.h("style", null, this.styles), index.h("img", Object.assign({ class: classMap, "data-xs": `${this.src}:${this.sizeXs}`, "data-sm": `${this.src}:${this.sizeSm}`, "data-md": `${this.src}:${this.sizeMd}`, "data-lg": `${this.src}:${this.sizeLg}` }, (!!this.width ? { width: this.width } : {}), (!!this.height ? { height: this.height } : {}), { alt: this.alt }))));
119
111
  }
120
112
  getCurrentBreakPoints() {
121
113
  // Define local variables
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["ptc-card.cjs",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link.cjs",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie.cjs",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["list-item.cjs",[[4,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"]}]]],["my-component.cjs",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-avatar.cjs",[[1,"ptc-avatar"]]],["ptc-footer.cjs",[[1,"ptc-footer"]]],["ptc-img.cjs",[[0,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["ptc-list.cjs",[[0,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-nav.cjs",[[1,"ptc-nav"]]],["ptc-nav-item.cjs",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-overlay.cjs",[[4,"ptc-overlay"]]],["ptc-picture.cjs",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-spacer.cjs",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span.cjs",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title.cjs",[[1,"ptc-title",{"type":[1],"textAlign":[1,"text-align"],"upperline":[1]}]]],["lottie-player.cjs",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date.cjs",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateStyles":[1,"date-styles"]}]]],["icon-asset_5.cjs",[[1,"ptc-announcement",{"btnText":[513,"btn-text"],"visible":[1540],"btnLink":[513,"btn-link"],"tempContainer":[4,"temp-container"]}],[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraMargin":[1,"para-margin"]}],[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"target":[1],"rel":[1]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"]}],[0,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
18
+ return index.bootstrapLazy([["ptc-card.cjs",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link.cjs",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie.cjs",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["list-item.cjs",[[4,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"]}]]],["my-component.cjs",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-avatar.cjs",[[1,"ptc-avatar"]]],["ptc-footer.cjs",[[1,"ptc-footer"]]],["ptc-img.cjs",[[0,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["ptc-list.cjs",[[0,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-nav.cjs",[[1,"ptc-nav"]]],["ptc-nav-item.cjs",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-overlay.cjs",[[4,"ptc-overlay"]]],["ptc-picture.cjs",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"styles":[1],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-spacer.cjs",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span.cjs",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title.cjs",[[1,"ptc-title",{"type":[1],"textAlign":[1,"text-align"],"upperline":[1]}]]],["lottie-player.cjs",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date.cjs",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateStyles":[1,"date-styles"]}]]],["icon-asset_5.cjs",[[1,"ptc-announcement",{"btnText":[513,"btn-text"],"visible":[1540],"btnLink":[513,"btn-link"],"tempContainer":[4,"temp-container"]}],[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraMargin":[1,"para-margin"]}],[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"target":[1],"rel":[1]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"]}],[0,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
19
19
  });
@@ -3,6 +3,11 @@
3
3
  overflow: hidden;
4
4
  }
5
5
 
6
+ img {
7
+ max-width: 100%;
8
+ height: auto;
9
+ }
10
+
6
11
  .cover {
7
12
  object-fit: cover;
8
13
  }
@@ -2,6 +2,10 @@ import { Component, Prop, h, Element, Listen, State, Host } from '@stencil/core'
2
2
  import { ResponsivePictureVariables } from '../../utils/interfaces';
3
3
  export class PtcPicture {
4
4
  constructor() {
5
+ /**
6
+ * Image alt
7
+ */
8
+ this.alt = "image";
5
9
  /**
6
10
  * Image size for smallest screen
7
11
  * <=767px
@@ -26,16 +30,6 @@ export class PtcPicture {
26
30
  * Image border shape
27
31
  */
28
32
  this.borderRadius = '';
29
- /**
30
- * Set height
31
- * Width will be auto by default
32
- */
33
- this.height = 'auto';
34
- /**
35
- * Set Width
36
- * height will be 100% by default
37
- */
38
- this.width = '100%';
39
33
  /**
40
34
  * Object Fit
41
35
  * Default: cover
@@ -88,8 +82,6 @@ export class PtcPicture {
88
82
  setResponsiveBg() {
89
83
  // Define local variables
90
84
  let backgrounds = (this.el.shadowRoot || document).querySelectorAll('img'), el, elData, currentBreakpoint = this.getCurrentBreakPoints();
91
- //console.log('current breakpoint: ' + currentBreakpoint);
92
- // Loop through all target elements
93
85
  for (var i = 0, len = backgrounds.length; i < len; i++) {
94
86
  // Set current variables
95
87
  el = backgrounds[i];
@@ -108,8 +100,8 @@ export class PtcPicture {
108
100
  render() {
109
101
  const classMap = this.getCssClassMap();
110
102
  return (h(Host, null,
111
- h("style", null, `img{width:${this.width};height:${this.height};}`),
112
- h("img", { class: classMap, "data-xs": `${this.src}:${this.sizeXs}`, "data-sm": `${this.src}:${this.sizeSm}`, "data-md": `${this.src}:${this.sizeMd}`, "data-lg": `${this.src}:${this.sizeLg}`, alt: this.alt })));
103
+ this.styles && h("style", null, this.styles),
104
+ h("img", Object.assign({ class: classMap, "data-xs": `${this.src}:${this.sizeXs}`, "data-sm": `${this.src}:${this.sizeSm}`, "data-md": `${this.src}:${this.sizeMd}`, "data-lg": `${this.src}:${this.sizeLg}` }, (!!this.width ? { width: this.width } : {}), (!!this.height ? { height: this.height } : {}), { alt: this.alt }))));
113
105
  }
114
106
  getCurrentBreakPoints() {
115
107
  // Define local variables
@@ -195,7 +187,8 @@ export class PtcPicture {
195
187
  "text": "Image alt"
196
188
  },
197
189
  "attribute": "alt",
198
- "reflect": false
190
+ "reflect": false,
191
+ "defaultValue": "\"image\""
199
192
  },
200
193
  "sizeXs": {
201
194
  "type": "string",
@@ -296,14 +289,13 @@ export class PtcPicture {
296
289
  "references": {}
297
290
  },
298
291
  "required": false,
299
- "optional": false,
292
+ "optional": true,
300
293
  "docs": {
301
294
  "tags": [],
302
- "text": "Set height\nWidth will be auto by default"
295
+ "text": "Set height\nValue unit: pixles\nJust put numbers without unit"
303
296
  },
304
297
  "attribute": "height",
305
- "reflect": false,
306
- "defaultValue": "'auto'"
298
+ "reflect": false
307
299
  },
308
300
  "width": {
309
301
  "type": "string",
@@ -314,14 +306,13 @@ export class PtcPicture {
314
306
  "references": {}
315
307
  },
316
308
  "required": false,
317
- "optional": false,
309
+ "optional": true,
318
310
  "docs": {
319
311
  "tags": [],
320
- "text": "Set Width\nheight will be 100% by default"
312
+ "text": "Set Width\nvalue unit: pixles\nJust put numbers without unit"
321
313
  },
322
314
  "attribute": "width",
323
- "reflect": false,
324
- "defaultValue": "'100%'"
315
+ "reflect": false
325
316
  },
326
317
  "objectFit": {
327
318
  "type": "string",
@@ -340,6 +331,23 @@ export class PtcPicture {
340
331
  "attribute": "object-fit",
341
332
  "reflect": false,
342
333
  "defaultValue": "'cover'"
334
+ },
335
+ "styles": {
336
+ "type": "string",
337
+ "mutable": false,
338
+ "complexType": {
339
+ "original": "string",
340
+ "resolved": "string",
341
+ "references": {}
342
+ },
343
+ "required": false,
344
+ "optional": true,
345
+ "docs": {
346
+ "tags": [],
347
+ "text": "(optional) Injected CSS styles"
348
+ },
349
+ "attribute": "styles",
350
+ "reflect": false
343
351
  }
344
352
  }; }
345
353
  static get states() { return {
@@ -14201,13 +14201,17 @@ const PtcPara$1 = class extends HTMLElement {
14201
14201
  static get style() { return ptcParaCss; }
14202
14202
  };
14203
14203
 
14204
- const ptcPictureCss = ":host{display:block;overflow:hidden}.cover{object-fit:cover}.fill{object-fit:fill}.contain{object-fit:contain}.scale-down{object-fit:scale-down}.none{object-fit:none}.initial{object-fit:initial}.inherit{object-fit:inherit}";
14204
+ const ptcPictureCss = ":host{display:block;overflow:hidden}img{max-width:100%;height:auto}.cover{object-fit:cover}.fill{object-fit:fill}.contain{object-fit:contain}.scale-down{object-fit:scale-down}.none{object-fit:none}.initial{object-fit:initial}.inherit{object-fit:inherit}";
14205
14205
 
14206
14206
  const PtcPicture$1 = class extends HTMLElement {
14207
14207
  constructor() {
14208
14208
  super();
14209
14209
  this.__registerHost();
14210
14210
  attachShadow(this);
14211
+ /**
14212
+ * Image alt
14213
+ */
14214
+ this.alt = "image";
14211
14215
  /**
14212
14216
  * Image size for smallest screen
14213
14217
  * <=767px
@@ -14232,16 +14236,6 @@ const PtcPicture$1 = class extends HTMLElement {
14232
14236
  * Image border shape
14233
14237
  */
14234
14238
  this.borderRadius = '';
14235
- /**
14236
- * Set height
14237
- * Width will be auto by default
14238
- */
14239
- this.height = 'auto';
14240
- /**
14241
- * Set Width
14242
- * height will be 100% by default
14243
- */
14244
- this.width = '100%';
14245
14239
  /**
14246
14240
  * Object Fit
14247
14241
  * Default: cover
@@ -14294,8 +14288,6 @@ const PtcPicture$1 = class extends HTMLElement {
14294
14288
  setResponsiveBg() {
14295
14289
  // Define local variables
14296
14290
  let backgrounds = (this.el.shadowRoot || document).querySelectorAll('img'), el, elData, currentBreakpoint = this.getCurrentBreakPoints();
14297
- //console.log('current breakpoint: ' + currentBreakpoint);
14298
- // Loop through all target elements
14299
14291
  for (var i = 0, len = backgrounds.length; i < len; i++) {
14300
14292
  // Set current variables
14301
14293
  el = backgrounds[i];
@@ -14313,7 +14305,7 @@ const PtcPicture$1 = class extends HTMLElement {
14313
14305
  }
14314
14306
  render() {
14315
14307
  const classMap = this.getCssClassMap();
14316
- return (h(Host, null, h("style", null, `img{width:${this.width};height:${this.height};}`), h("img", { class: classMap, "data-xs": `${this.src}:${this.sizeXs}`, "data-sm": `${this.src}:${this.sizeSm}`, "data-md": `${this.src}:${this.sizeMd}`, "data-lg": `${this.src}:${this.sizeLg}`, alt: this.alt })));
14308
+ return (h(Host, null, this.styles && h("style", null, this.styles), h("img", Object.assign({ class: classMap, "data-xs": `${this.src}:${this.sizeXs}`, "data-sm": `${this.src}:${this.sizeSm}`, "data-md": `${this.src}:${this.sizeMd}`, "data-lg": `${this.src}:${this.sizeLg}` }, (!!this.width ? { width: this.width } : {}), (!!this.height ? { height: this.height } : {}), { alt: this.alt }))));
14317
14309
  }
14318
14310
  getCurrentBreakPoints() {
14319
14311
  // Define local variables
@@ -14517,7 +14509,7 @@ const PtcNav = /*@__PURE__*/proxyCustomElement(PtcNav$1, [1,"ptc-nav"]);
14517
14509
  const PtcNavItem = /*@__PURE__*/proxyCustomElement(PtcNavItem$1, [1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]);
14518
14510
  const PtcOverlay = /*@__PURE__*/proxyCustomElement(PtcOverlay$1, [4,"ptc-overlay"]);
14519
14511
  const PtcPara = /*@__PURE__*/proxyCustomElement(PtcPara$1, [1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraMargin":[1,"para-margin"]}]);
14520
- const PtcPicture = /*@__PURE__*/proxyCustomElement(PtcPicture$1, [1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"oldSrc":[32]},[[9,"resize","WindowResize"]]]);
14512
+ const PtcPicture = /*@__PURE__*/proxyCustomElement(PtcPicture$1, [1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"styles":[1],"oldSrc":[32]},[[9,"resize","WindowResize"]]]);
14521
14513
  const PtcSpacer = /*@__PURE__*/proxyCustomElement(PtcSpacer$1, [1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]);
14522
14514
  const PtcSpan = /*@__PURE__*/proxyCustomElement(PtcSpan$1, [1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]);
14523
14515
  const PtcSvgBtn = /*@__PURE__*/proxyCustomElement(PtcSvgBtn$1, [1,"ptc-svg-btn",{"svgName":[1,"svg-name"]}]);
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["ptc-card",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["list-item",[[4,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"]}]]],["my-component",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-avatar",[[1,"ptc-avatar"]]],["ptc-footer",[[1,"ptc-footer"]]],["ptc-img",[[0,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["ptc-list",[[0,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-nav",[[1,"ptc-nav"]]],["ptc-nav-item",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-overlay",[[4,"ptc-overlay"]]],["ptc-picture",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-spacer",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title",[[1,"ptc-title",{"type":[1],"textAlign":[1,"text-align"],"upperline":[1]}]]],["lottie-player",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateStyles":[1,"date-styles"]}]]],["icon-asset_5",[[1,"ptc-announcement",{"btnText":[513,"btn-text"],"visible":[1540],"btnLink":[513,"btn-link"],"tempContainer":[4,"temp-container"]}],[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraMargin":[1,"para-margin"]}],[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"target":[1],"rel":[1]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"]}],[0,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
13
+ return bootstrapLazy([["ptc-card",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["list-item",[[4,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"]}]]],["my-component",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-avatar",[[1,"ptc-avatar"]]],["ptc-footer",[[1,"ptc-footer"]]],["ptc-img",[[0,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["ptc-list",[[0,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-nav",[[1,"ptc-nav"]]],["ptc-nav-item",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-overlay",[[4,"ptc-overlay"]]],["ptc-picture",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"styles":[1],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-spacer",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title",[[1,"ptc-title",{"type":[1],"textAlign":[1,"text-align"],"upperline":[1]}]]],["lottie-player",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateStyles":[1,"date-styles"]}]]],["icon-asset_5",[[1,"ptc-announcement",{"btnText":[513,"btn-text"],"visible":[1540],"btnLink":[513,"btn-link"],"tempContainer":[4,"temp-container"]}],[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraMargin":[1,"para-margin"]}],[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"target":[1],"rel":[1]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"]}],[0,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -1,11 +1,15 @@
1
1
  import { r as registerInstance, h, H as Host, a as getElement } from './index-7a3883ee.js';
2
2
  import { a as ResponsivePictureVariables } from './interfaces-3cb94654.js';
3
3
 
4
- const ptcPictureCss = ":host{display:block;overflow:hidden}.cover{object-fit:cover}.fill{object-fit:fill}.contain{object-fit:contain}.scale-down{object-fit:scale-down}.none{object-fit:none}.initial{object-fit:initial}.inherit{object-fit:inherit}";
4
+ const ptcPictureCss = ":host{display:block;overflow:hidden}img{max-width:100%;height:auto}.cover{object-fit:cover}.fill{object-fit:fill}.contain{object-fit:contain}.scale-down{object-fit:scale-down}.none{object-fit:none}.initial{object-fit:initial}.inherit{object-fit:inherit}";
5
5
 
6
6
  const PtcPicture = class {
7
7
  constructor(hostRef) {
8
8
  registerInstance(this, hostRef);
9
+ /**
10
+ * Image alt
11
+ */
12
+ this.alt = "image";
9
13
  /**
10
14
  * Image size for smallest screen
11
15
  * <=767px
@@ -30,16 +34,6 @@ const PtcPicture = class {
30
34
  * Image border shape
31
35
  */
32
36
  this.borderRadius = '';
33
- /**
34
- * Set height
35
- * Width will be auto by default
36
- */
37
- this.height = 'auto';
38
- /**
39
- * Set Width
40
- * height will be 100% by default
41
- */
42
- this.width = '100%';
43
37
  /**
44
38
  * Object Fit
45
39
  * Default: cover
@@ -92,8 +86,6 @@ const PtcPicture = class {
92
86
  setResponsiveBg() {
93
87
  // Define local variables
94
88
  let backgrounds = (this.el.shadowRoot || document).querySelectorAll('img'), el, elData, currentBreakpoint = this.getCurrentBreakPoints();
95
- //console.log('current breakpoint: ' + currentBreakpoint);
96
- // Loop through all target elements
97
89
  for (var i = 0, len = backgrounds.length; i < len; i++) {
98
90
  // Set current variables
99
91
  el = backgrounds[i];
@@ -111,7 +103,7 @@ const PtcPicture = class {
111
103
  }
112
104
  render() {
113
105
  const classMap = this.getCssClassMap();
114
- return (h(Host, null, h("style", null, `img{width:${this.width};height:${this.height};}`), h("img", { class: classMap, "data-xs": `${this.src}:${this.sizeXs}`, "data-sm": `${this.src}:${this.sizeSm}`, "data-md": `${this.src}:${this.sizeMd}`, "data-lg": `${this.src}:${this.sizeLg}`, alt: this.alt })));
106
+ return (h(Host, null, this.styles && h("style", null, this.styles), h("img", Object.assign({ class: classMap, "data-xs": `${this.src}:${this.sizeXs}`, "data-sm": `${this.src}:${this.sizeSm}`, "data-md": `${this.src}:${this.sizeMd}`, "data-lg": `${this.src}:${this.sizeLg}` }, (!!this.width ? { width: this.width } : {}), (!!this.height ? { height: this.height } : {}), { alt: this.alt }))));
115
107
  }
116
108
  getCurrentBreakPoints() {
117
109
  // Define local variables
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["ptc-card",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["list-item",[[4,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"]}]]],["my-component",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-avatar",[[1,"ptc-avatar"]]],["ptc-footer",[[1,"ptc-footer"]]],["ptc-img",[[0,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["ptc-list",[[0,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-nav",[[1,"ptc-nav"]]],["ptc-nav-item",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-overlay",[[4,"ptc-overlay"]]],["ptc-picture",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-spacer",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title",[[1,"ptc-title",{"type":[1],"textAlign":[1,"text-align"],"upperline":[1]}]]],["lottie-player",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateStyles":[1,"date-styles"]}]]],["icon-asset_5",[[1,"ptc-announcement",{"btnText":[513,"btn-text"],"visible":[1540],"btnLink":[513,"btn-link"],"tempContainer":[4,"temp-container"]}],[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraMargin":[1,"para-margin"]}],[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"target":[1],"rel":[1]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"]}],[0,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
16
+ return bootstrapLazy([["ptc-card",[[1,"ptc-card",{"cardType":[1,"card-type"],"cardHref":[1,"card-href"],"target":[1],"rel":[1],"hasImage":[4,"has-image"],"hasVideo":[4,"has-video"],"hasLottie":[4,"has-lottie"],"heading":[1],"cardDate":[1,"card-date"],"styles":[1]}]]],["ptc-link",[[1,"ptc-link",{"disabled":[516],"external":[516],"href":[1],"target":[1],"linkTitle":[1,"link-title"],"theme":[1],"uppercase":[4],"fontSize":[1,"font-size"]}]]],["ptc-lottie",[[1,"ptc-lottie",{"jsonSrc":[1025,"json-src"],"speed":[1026]}]]],["list-item",[[4,"list-item",{"listType":[1,"list-type"],"linkHref":[1,"link-href"]}]]],["my-component",[[1,"my-component",{"first":[1],"middle":[1],"last":[1]}]]],["ptc-avatar",[[1,"ptc-avatar"]]],["ptc-footer",[[1,"ptc-footer"]]],["ptc-img",[[0,"ptc-img",{"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"imgUrl":[1,"img-url"],"imageType":[1,"image-type"],"borderRadius":[1,"border-radius"],"loadMode":[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["ptc-list",[[0,"ptc-list",{"listType":[1,"list-type"],"listItems":[16]}]]],["ptc-nav",[[1,"ptc-nav"]]],["ptc-nav-item",[[1,"ptc-nav-item",{"url":[1025],"label":[1025],"ariaExpanded":[1028,"aria-expanded"],"depth":[1538],"hasChildren":[1028,"has-children"],"parentExpanded":[1540,"parent-expanded"],"navType":[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["ptc-overlay",[[4,"ptc-overlay"]]],["ptc-picture",[[1,"ptc-picture",{"src":[1],"alt":[1],"sizeXs":[1025,"size-xs"],"sizeSm":[1025,"size-sm"],"sizeMd":[1025,"size-md"],"sizeLg":[1025,"size-lg"],"borderRadius":[1,"border-radius"],"height":[1],"width":[1],"objectFit":[1,"object-fit"],"styles":[1],"oldSrc":[32]},[[9,"resize","WindowResize"]]]]],["ptc-spacer",[[1,"ptc-spacer",{"breakpoint":[1],"size":[1],"direction":[1]}]]],["ptc-span",[[1,"ptc-span",{"spanStyle":[1,"span-style"],"display":[1],"styles":[1]}]]],["ptc-title",[[1,"ptc-title",{"type":[1],"textAlign":[1,"text-align"],"upperline":[1]}]]],["lottie-player",[[1,"lottie-player",{"mode":[1],"autoplay":[4],"background":[513],"controls":[4],"count":[2],"direction":[2],"hover":[4],"loop":[516],"renderer":[1],"speed":[2],"src":[1],"currentState":[1,"current-state"],"seeker":[8],"intermission":[2],"play":[64],"pause":[64],"stop":[64],"seek":[64],"getLottie":[64],"setSpeed":[64],"setDirection":[64],"setLooping":[64],"togglePlay":[64],"toggleLooping":[64]}]]],["ptc-date",[[1,"ptc-date",{"year":[2],"month":[2],"day":[2],"country":[1],"dateString":[1,"date-string"],"dateStyles":[1,"date-styles"]}]]],["icon-asset_5",[[1,"ptc-announcement",{"btnText":[513,"btn-text"],"visible":[1540],"btnLink":[513,"btn-link"],"tempContainer":[4,"temp-container"]}],[1,"ptc-para",{"fontSize":[1,"font-size"],"fontWeight":[1,"font-weight"],"paraStyle":[1,"para-style"],"paraMargin":[1,"para-margin"]}],[1,"ptc-button",{"disabled":[516],"type":[1],"color":[1],"iconAnimation":[1,"icon-animation"],"iconPosition":[1,"icon-position"],"linkHref":[1,"link-href"],"target":[1],"rel":[1]}],[1,"ptc-svg-btn",{"svgName":[1,"svg-name"]}],[0,"icon-asset",{"name":[1],"size":[1],"type":[1],"spin":[1],"pulse":[1],"color":[1]}]]]], options);
17
17
  });
@@ -0,0 +1 @@
1
+ import{r as t,h as i,H as e,a as s}from"./p-50923c9a.js";import{a as n}from"./p-240733ce.js";const o=class{constructor(i){t(this,i),this.alt="image",this.sizeXs="510x340",this.sizeSm="1240x496",this.sizeMd="1366x500",this.sizeLg="1920x1080",this.borderRadius="",this.objectFit="cover"}WindowResize(){this.addIntersectionObserver()}componentDidLoad(){this.addIntersectionObserver()}componentWillUpdate(){this.src!==this.oldSrc&&this.addIntersectionObserver(),this.oldSrc=this.src}addIntersectionObserver(){if(this.src)if("IntersectionObserver"in window){let t=new IntersectionObserver((i=>{i.forEach((i=>{if(i.isIntersecting){const i=this.el.shadowRoot.querySelector("img");i.src=this.setResponsiveBg(),console.log("loaded"),t.unobserve(i)}}))}));t.observe(this.el.shadowRoot.querySelector("img"))}else setTimeout((()=>{const t=this.el.shadowRoot.querySelector("img");t.src=this.setResponsiveBg(),t.onload=()=>{t.removeAttribute("data-src"),console.log("loaded fallback")}}),5e3)}setResponsiveBg(){let t,i,e=(this.el.shadowRoot||document).querySelectorAll("img"),s=this.getCurrentBreakPoints();for(var n=0,o=e.length;n<o;n++){if(t=e[n],i=t.getAttribute("data-"+s),null!==i)return i;"object"==typeof console&&console.warn("Data attribute: data-"+s+" not found on element:\n\n"+t.outerHTML+"\n\n\n")}}render(){const t=this.getCssClassMap();return i(e,null,this.styles&&i("style",null,this.styles),i("img",Object.assign({class:t,"data-xs":`${this.src}:${this.sizeXs}`,"data-sm":`${this.src}:${this.sizeSm}`,"data-md":`${this.src}:${this.sizeMd}`,"data-lg":`${this.src}:${this.sizeLg}`},this.width?{width:this.width}:{},this.height?{height:this.height}:{},{alt:this.alt})))}getCurrentBreakPoints(){let t,i=window.document,e=i.createElement("div");i.body.appendChild(e);for(let s=n.envs.length-1;s>=0;s--)if(t=n.envs[s],e.className="hidden-"+t,null===e.offsetParent)return i.body.removeChild(e),console.log("remove test node"),t;return i.body.removeChild(e),this.getFallbackBreakpoint()}getFallbackBreakpoint(){return window.matchMedia("(min-width: 992px)").matches?"lg":window.matchMedia("(min-width: 768px)").matches?"md":window.matchMedia("(min-width: 576px)").matches?"sm":"xs"}getCssClassMap(){return{[this.borderRadius]:!0,[this.objectFit]:!0}}get el(){return s(this)}};o.style=":host{display:block;overflow:hidden}img{max-width:100%;height:auto}.cover{object-fit:cover}.fill{object-fit:fill}.contain{object-fit:contain}.scale-down{object-fit:scale-down}.none{object-fit:none}.initial{object-fit:initial}.inherit{object-fit:inherit}";export{o as ptc_picture}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-50923c9a.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-ff28ce2d",[[1,"ptc-card",{cardType:[1,"card-type"],cardHref:[1,"card-href"],target:[1],rel:[1],hasImage:[4,"has-image"],hasVideo:[4,"has-video"],hasLottie:[4,"has-lottie"],heading:[1],cardDate:[1,"card-date"],styles:[1]}]]],["p-5f776886",[[1,"ptc-link",{disabled:[516],external:[516],href:[1],target:[1],linkTitle:[1,"link-title"],theme:[1],uppercase:[4],fontSize:[1,"font-size"]}]]],["p-ef250898",[[1,"ptc-lottie",{jsonSrc:[1025,"json-src"],speed:[1026]}]]],["p-90402319",[[4,"list-item",{listType:[1,"list-type"],linkHref:[1,"link-href"]}]]],["p-f80152dc",[[1,"my-component",{first:[1],middle:[1],last:[1]}]]],["p-73e2418e",[[1,"ptc-avatar"]]],["p-66ffa30c",[[1,"ptc-footer"]]],["p-f694e46a",[[0,"ptc-img",{sizeXs:[1025,"size-xs"],sizeSm:[1025,"size-sm"],sizeMd:[1025,"size-md"],sizeLg:[1025,"size-lg"],imgUrl:[1,"img-url"],imageType:[1,"image-type"],borderRadius:[1,"border-radius"],loadMode:[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["p-919311d2",[[0,"ptc-list",{listType:[1,"list-type"],listItems:[16]}]]],["p-2d5f8cff",[[1,"ptc-nav"]]],["p-186beb2c",[[1,"ptc-nav-item",{url:[1025],label:[1025],ariaExpanded:[1028,"aria-expanded"],depth:[1538],hasChildren:[1028,"has-children"],parentExpanded:[1540,"parent-expanded"],navType:[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["p-ac449734",[[4,"ptc-overlay"]]],["p-78a47bf1",[[1,"ptc-picture",{src:[1],alt:[1],sizeXs:[1025,"size-xs"],sizeSm:[1025,"size-sm"],sizeMd:[1025,"size-md"],sizeLg:[1025,"size-lg"],borderRadius:[1,"border-radius"],height:[1],width:[1],objectFit:[1,"object-fit"],oldSrc:[32]},[[9,"resize","WindowResize"]]]]],["p-d6553853",[[1,"ptc-spacer",{breakpoint:[1],size:[1],direction:[1]}]]],["p-6b1a35e1",[[1,"ptc-span",{spanStyle:[1,"span-style"],display:[1],styles:[1]}]]],["p-0c8df906",[[1,"ptc-title",{type:[1],textAlign:[1,"text-align"],upperline:[1]}]]],["p-51a3e9e6",[[1,"lottie-player",{mode:[1],autoplay:[4],background:[513],controls:[4],count:[2],direction:[2],hover:[4],loop:[516],renderer:[1],speed:[2],src:[1],currentState:[1,"current-state"],seeker:[8],intermission:[2],play:[64],pause:[64],stop:[64],seek:[64],getLottie:[64],setSpeed:[64],setDirection:[64],setLooping:[64],togglePlay:[64],toggleLooping:[64]}]]],["p-796b8287",[[1,"ptc-date",{year:[2],month:[2],day:[2],country:[1],dateString:[1,"date-string"],dateStyles:[1,"date-styles"]}]]],["p-18092cf1",[[1,"ptc-announcement",{btnText:[513,"btn-text"],visible:[1540],btnLink:[513,"btn-link"],tempContainer:[4,"temp-container"]}],[1,"ptc-para",{fontSize:[1,"font-size"],fontWeight:[1,"font-weight"],paraStyle:[1,"para-style"],paraMargin:[1,"para-margin"]}],[1,"ptc-button",{disabled:[516],type:[1],color:[1],iconAnimation:[1,"icon-animation"],iconPosition:[1,"icon-position"],linkHref:[1,"link-href"],target:[1],rel:[1]}],[1,"ptc-svg-btn",{svgName:[1,"svg-name"]}],[0,"icon-asset",{name:[1],size:[1],type:[1],spin:[1],pulse:[1],color:[1]}]]]],e)));
1
+ import{p as e,b as t}from"./p-50923c9a.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-ff28ce2d",[[1,"ptc-card",{cardType:[1,"card-type"],cardHref:[1,"card-href"],target:[1],rel:[1],hasImage:[4,"has-image"],hasVideo:[4,"has-video"],hasLottie:[4,"has-lottie"],heading:[1],cardDate:[1,"card-date"],styles:[1]}]]],["p-5f776886",[[1,"ptc-link",{disabled:[516],external:[516],href:[1],target:[1],linkTitle:[1,"link-title"],theme:[1],uppercase:[4],fontSize:[1,"font-size"]}]]],["p-ef250898",[[1,"ptc-lottie",{jsonSrc:[1025,"json-src"],speed:[1026]}]]],["p-90402319",[[4,"list-item",{listType:[1,"list-type"],linkHref:[1,"link-href"]}]]],["p-f80152dc",[[1,"my-component",{first:[1],middle:[1],last:[1]}]]],["p-73e2418e",[[1,"ptc-avatar"]]],["p-66ffa30c",[[1,"ptc-footer"]]],["p-f694e46a",[[0,"ptc-img",{sizeXs:[1025,"size-xs"],sizeSm:[1025,"size-sm"],sizeMd:[1025,"size-md"],sizeLg:[1025,"size-lg"],imgUrl:[1,"img-url"],imageType:[1,"image-type"],borderRadius:[1,"border-radius"],loadMode:[1,"load-mode"]},[[9,"resize","WindowResize"]]]]],["p-919311d2",[[0,"ptc-list",{listType:[1,"list-type"],listItems:[16]}]]],["p-2d5f8cff",[[1,"ptc-nav"]]],["p-186beb2c",[[1,"ptc-nav-item",{url:[1025],label:[1025],ariaExpanded:[1028,"aria-expanded"],depth:[1538],hasChildren:[1028,"has-children"],parentExpanded:[1540,"parent-expanded"],navType:[1,"nav-type"]},[[0,"handleClick","handleClick"],[9,"resize","handleResize"]]]]],["p-ac449734",[[4,"ptc-overlay"]]],["p-b1af353d",[[1,"ptc-picture",{src:[1],alt:[1],sizeXs:[1025,"size-xs"],sizeSm:[1025,"size-sm"],sizeMd:[1025,"size-md"],sizeLg:[1025,"size-lg"],borderRadius:[1,"border-radius"],height:[1],width:[1],objectFit:[1,"object-fit"],styles:[1],oldSrc:[32]},[[9,"resize","WindowResize"]]]]],["p-d6553853",[[1,"ptc-spacer",{breakpoint:[1],size:[1],direction:[1]}]]],["p-6b1a35e1",[[1,"ptc-span",{spanStyle:[1,"span-style"],display:[1],styles:[1]}]]],["p-0c8df906",[[1,"ptc-title",{type:[1],textAlign:[1,"text-align"],upperline:[1]}]]],["p-51a3e9e6",[[1,"lottie-player",{mode:[1],autoplay:[4],background:[513],controls:[4],count:[2],direction:[2],hover:[4],loop:[516],renderer:[1],speed:[2],src:[1],currentState:[1,"current-state"],seeker:[8],intermission:[2],play:[64],pause:[64],stop:[64],seek:[64],getLottie:[64],setSpeed:[64],setDirection:[64],setLooping:[64],togglePlay:[64],toggleLooping:[64]}]]],["p-796b8287",[[1,"ptc-date",{year:[2],month:[2],day:[2],country:[1],dateString:[1,"date-string"],dateStyles:[1,"date-styles"]}]]],["p-18092cf1",[[1,"ptc-announcement",{btnText:[513,"btn-text"],visible:[1540],btnLink:[513,"btn-link"],tempContainer:[4,"temp-container"]}],[1,"ptc-para",{fontSize:[1,"font-size"],fontWeight:[1,"font-weight"],paraStyle:[1,"para-style"],paraMargin:[1,"para-margin"]}],[1,"ptc-button",{disabled:[516],type:[1],color:[1],iconAnimation:[1,"icon-animation"],iconPosition:[1,"icon-position"],linkHref:[1,"link-href"],target:[1],rel:[1]}],[1,"ptc-svg-btn",{svgName:[1,"svg-name"]}],[0,"icon-asset",{name:[1],size:[1],type:[1],spin:[1],pulse:[1],color:[1]}]]]],e)));
@@ -38,19 +38,25 @@ export declare class PtcPicture {
38
38
  borderRadius: 'radius-sm' | 'radius-md' | 'radius-lg' | '';
39
39
  /**
40
40
  * Set height
41
- * Width will be auto by default
41
+ * Value unit: pixles
42
+ * Just put numbers without unit
42
43
  */
43
- height: string;
44
+ height?: string;
44
45
  /**
45
46
  * Set Width
46
- * height will be 100% by default
47
+ * value unit: pixles
48
+ * Just put numbers without unit
47
49
  */
48
- width: string;
50
+ width?: string;
49
51
  /**
50
52
  * Object Fit
51
53
  * Default: cover
52
54
  */
53
55
  objectFit: 'cover' | 'fill' | 'contain' | 'scale-down' | 'none' | 'initial' | 'inherit';
56
+ /**
57
+ * (optional) Injected CSS styles
58
+ **/
59
+ styles?: string;
54
60
  WindowResize(): void;
55
61
  io: IntersectionObserver;
56
62
  componentDidLoad(): void;
@@ -318,9 +318,9 @@ export namespace Components {
318
318
  */
319
319
  "borderRadius": 'radius-sm' | 'radius-md' | 'radius-lg' | '';
320
320
  /**
321
- * Set height Width will be auto by default
321
+ * Set height Value unit: pixles Just put numbers without unit
322
322
  */
323
- "height": string;
323
+ "height"?: string;
324
324
  /**
325
325
  * Object Fit Default: cover
326
326
  */
@@ -346,9 +346,13 @@ export namespace Components {
346
346
  */
347
347
  "src": string;
348
348
  /**
349
- * Set Width height will be 100% by default
349
+ * (optional) Injected CSS styles
350
+ */
351
+ "styles"?: string;
352
+ /**
353
+ * Set Width value unit: pixles Just put numbers without unit
350
354
  */
351
- "width": string;
355
+ "width"?: string;
352
356
  }
353
357
  interface PtcSpacer {
354
358
  /**
@@ -876,7 +880,7 @@ declare namespace LocalJSX {
876
880
  */
877
881
  "borderRadius"?: 'radius-sm' | 'radius-md' | 'radius-lg' | '';
878
882
  /**
879
- * Set height Width will be auto by default
883
+ * Set height Value unit: pixles Just put numbers without unit
880
884
  */
881
885
  "height"?: string;
882
886
  /**
@@ -904,7 +908,11 @@ declare namespace LocalJSX {
904
908
  */
905
909
  "src"?: string;
906
910
  /**
907
- * Set Width height will be 100% by default
911
+ * (optional) Injected CSS styles
912
+ */
913
+ "styles"?: string;
914
+ /**
915
+ * Set Width value unit: pixles Just put numbers without unit
908
916
  */
909
917
  "width"?: string;
910
918
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptcwebops/ptcw-design",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1 +0,0 @@
1
- import{r as t,h as i,H as e,a as s}from"./p-50923c9a.js";import{a as n}from"./p-240733ce.js";const o=class{constructor(i){t(this,i),this.sizeXs="510x340",this.sizeSm="1240x496",this.sizeMd="1366x500",this.sizeLg="1920x1080",this.borderRadius="",this.height="auto",this.width="100%",this.objectFit="cover"}WindowResize(){this.addIntersectionObserver()}componentDidLoad(){this.addIntersectionObserver()}componentWillUpdate(){this.src!==this.oldSrc&&this.addIntersectionObserver(),this.oldSrc=this.src}addIntersectionObserver(){if(this.src)if("IntersectionObserver"in window){let t=new IntersectionObserver((i=>{i.forEach((i=>{if(i.isIntersecting){const i=this.el.shadowRoot.querySelector("img");i.src=this.setResponsiveBg(),console.log("loaded"),t.unobserve(i)}}))}));t.observe(this.el.shadowRoot.querySelector("img"))}else setTimeout((()=>{const t=this.el.shadowRoot.querySelector("img");t.src=this.setResponsiveBg(),t.onload=()=>{t.removeAttribute("data-src"),console.log("loaded fallback")}}),5e3)}setResponsiveBg(){let t,i,e=(this.el.shadowRoot||document).querySelectorAll("img"),s=this.getCurrentBreakPoints();for(var n=0,o=e.length;n<o;n++){if(t=e[n],i=t.getAttribute("data-"+s),null!==i)return i;"object"==typeof console&&console.warn("Data attribute: data-"+s+" not found on element:\n\n"+t.outerHTML+"\n\n\n")}}render(){const t=this.getCssClassMap();return i(e,null,i("style",null,`img{width:${this.width};height:${this.height};}`),i("img",{class:t,"data-xs":`${this.src}:${this.sizeXs}`,"data-sm":`${this.src}:${this.sizeSm}`,"data-md":`${this.src}:${this.sizeMd}`,"data-lg":`${this.src}:${this.sizeLg}`,alt:this.alt}))}getCurrentBreakPoints(){let t,i=window.document,e=i.createElement("div");i.body.appendChild(e);for(let s=n.envs.length-1;s>=0;s--)if(t=n.envs[s],e.className="hidden-"+t,null===e.offsetParent)return i.body.removeChild(e),console.log("remove test node"),t;return i.body.removeChild(e),this.getFallbackBreakpoint()}getFallbackBreakpoint(){return window.matchMedia("(min-width: 992px)").matches?"lg":window.matchMedia("(min-width: 768px)").matches?"md":window.matchMedia("(min-width: 576px)").matches?"sm":"xs"}getCssClassMap(){return{[this.borderRadius]:!0,[this.objectFit]:!0}}get el(){return s(this)}};o.style=":host{display:block;overflow:hidden}.cover{object-fit:cover}.fill{object-fit:fill}.contain{object-fit:contain}.scale-down{object-fit:scale-down}.none{object-fit:none}.initial{object-fit:initial}.inherit{object-fit:inherit}";export{o as ptc_picture}