@ppg_pl/pallete 2.0.23 → 2.0.26

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.
Files changed (90) hide show
  1. package/README.md +12 -5
  2. package/dist/cjs/{index-53e78fc8.js → index-d74cbc0d.js} +33 -2
  3. package/dist/cjs/index-d74cbc0d.js.map +1 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/loader.cjs.js.map +1 -1
  6. package/dist/cjs/my-backdrop_8.cjs.entry.js +1651 -1286
  7. package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
  8. package/dist/cjs/pallete.cjs.js +2 -2
  9. package/dist/cjs/pallete.cjs.js.map +1 -1
  10. package/dist/collection/components/my-backdrop/my-backdrop.css +7 -0
  11. package/dist/collection/components/my-colorbox/my-colorbox.css +7 -0
  12. package/dist/collection/components/my-colorinfo/assets/Shape.svg +4 -0
  13. package/dist/collection/components/my-colorinfo/assets/close.png +0 -0
  14. package/dist/collection/components/my-colorinfo/assets/shape.png +0 -0
  15. package/dist/collection/components/my-colorinfo/my-colorinfo.css +350 -0
  16. package/dist/collection/components/my-colorinfo/my-colorinfo.js +135 -1
  17. package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -1
  18. package/dist/collection/components/my-component/my-component.js +68 -1
  19. package/dist/collection/components/my-component/my-component.js.map +1 -1
  20. package/dist/collection/components/my-modal/my-modal.css +8 -239
  21. package/dist/collection/components/my-modal/my-modal.js +42 -2
  22. package/dist/collection/components/my-modal/my-modal.js.map +1 -1
  23. package/dist/collection/components/my-search/my-search.css +7 -0
  24. package/dist/collection/components/my-slider/index.js +9 -6
  25. package/dist/collection/components/my-slider/index.js.map +1 -1
  26. package/dist/collection/components/my-slider/my-slider.css +12 -3
  27. package/dist/collection/types.js.map +1 -1
  28. package/dist/components/index3.js +10 -7
  29. package/dist/components/index3.js.map +1 -1
  30. package/dist/components/my-backdrop2.js +1 -1
  31. package/dist/components/my-backdrop2.js.map +1 -1
  32. package/dist/components/my-colorbox2.js +1 -1
  33. package/dist/components/my-colorbox2.js.map +1 -1
  34. package/dist/components/my-colorinfo2.js +46 -3
  35. package/dist/components/my-colorinfo2.js.map +1 -1
  36. package/dist/components/my-component.js +15 -3
  37. package/dist/components/my-component.js.map +1 -1
  38. package/dist/components/my-modal2.js +1589 -1274
  39. package/dist/components/my-modal2.js.map +1 -1
  40. package/dist/components/my-search2.js +1 -1
  41. package/dist/components/my-search2.js.map +1 -1
  42. package/dist/esm/{index-b0145abf.js → index-45a30349.js} +33 -2
  43. package/dist/esm/index-45a30349.js.map +1 -0
  44. package/dist/esm/loader.js +3 -3
  45. package/dist/esm/loader.js.map +1 -1
  46. package/dist/esm/my-backdrop_8.entry.js +1651 -1286
  47. package/dist/esm/my-backdrop_8.entry.js.map +1 -1
  48. package/dist/esm/pallete.js +3 -3
  49. package/dist/esm/pallete.js.map +1 -1
  50. package/dist/pallete/assets/Shape.svg +4 -0
  51. package/dist/pallete/assets/shape.png +0 -0
  52. package/dist/pallete/p-2394bcec.entry.js +2 -0
  53. package/dist/pallete/p-2394bcec.entry.js.map +1 -0
  54. package/dist/pallete/p-a3449132.js +3 -0
  55. package/dist/pallete/p-a3449132.js.map +1 -0
  56. package/dist/pallete/pallete.css +1 -1
  57. package/dist/pallete/pallete.esm.js +1 -1
  58. package/dist/pallete/pallete.esm.js.map +1 -1
  59. package/dist/types/components/my-colorinfo/my-colorinfo.d.ts +11 -1
  60. package/dist/types/components/my-component/my-component.d.ts +9 -0
  61. package/dist/types/components/my-modal/my-modal.d.ts +3 -1
  62. package/dist/types/components.d.ts +24 -2
  63. package/dist/types/types.d.ts +4 -0
  64. package/package.json +5 -4
  65. package/www/build/assets/Shape.svg +4 -0
  66. package/www/build/assets/shape.png +0 -0
  67. package/www/build/p-2394bcec.entry.js +2 -0
  68. package/www/build/p-2394bcec.entry.js.map +1 -0
  69. package/www/build/p-a3449132.js +3 -0
  70. package/www/build/p-a3449132.js.map +1 -0
  71. package/www/build/p-c5910eb7.js +2 -0
  72. package/www/build/p-f8a0208d.css +1 -0
  73. package/www/build/pallete.css +1 -1
  74. package/www/build/pallete.esm.js +1 -1
  75. package/www/build/pallete.esm.js.map +1 -1
  76. package/www/index.html +62 -10
  77. package/dist/cjs/index-53e78fc8.js.map +0 -1
  78. package/dist/esm/index-b0145abf.js.map +0 -1
  79. package/dist/pallete/p-bdb05818.entry.js +0 -2
  80. package/dist/pallete/p-bdb05818.entry.js.map +0 -1
  81. package/dist/pallete/p-c6a049a2.js +0 -3
  82. package/dist/pallete/p-c6a049a2.js.map +0 -1
  83. package/www/build/p-bdb05818.entry.js +0 -2
  84. package/www/build/p-bdb05818.entry.js.map +0 -1
  85. package/www/build/p-c6a049a2.js +0 -3
  86. package/www/build/p-c6a049a2.js.map +0 -1
  87. /package/www/{build/assets → assets}/fonts/Galatea-Regular.eot +0 -0
  88. /package/www/{build/assets → assets}/fonts/Galatea-Regular.ttf +0 -0
  89. /package/www/{build/assets → assets}/fonts/Galatea-Regular.woff +0 -0
  90. /package/www/{build/assets → assets}/fonts/Galatea-Regular.woff2 +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"my-colorinfo.js","sourceRoot":"","sources":["../../../src/components/my-colorinfo/my-colorinfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAK7C,MAAM,OAAO,WAAW;;IAYtB,gBAAW,GAAG,GAAG,EAAE;;MACjB,IAAI,CAAC,YAAY;QACf,YAAY,CAAC;UACX,KAAK,EAAE,aAAa;UACpB,IAAI,EAAE,IAAI,CAAC,IAAI;UACf,OAAO,EAAE,IAAI,CAAC,OAAO;UACrB,KAAK,EAAE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ils';\nimport { Color, Link, Product } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorinfo',\n})\nexport class MyColorInfo {\n @Prop() currentColor: Color;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n\n @Event() closeInfoBox: EventEmitter;\n\n goToProduct = () => {\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n });\n this.closeInfoBox.emit();\n };\n\n onCloseButtonClick = () => {\n this.closeInfoBox.emit();\n };\n\n renderSliderOrImage = () => {\n if (this.currentColor.imageInsteadHex) {\n return <img class={'color-big-image'} src={`${APIURL}/assets/${this.currentColor.bigImage}?access_token=${accessToken}`} alt=\"color-image\" />;\n } else {\n return <my-slider color={this.currentColor.name} shop={this.shop} product={this.product} slides={this.data?.images}></my-slider>;\n }\n };\n\n getHref = () => {\n if (this.baselink) {\n return `${this.baselink}/${this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path}`;\n } else {\n return this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path;\n }\n };\n\n capitalizeFirstLetter = (string: string) => {\n return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();\n };\n\n render() {\n return (\n <div\n class={`boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`}\n style={{\n background: this.currentColor.imageInsteadHex ? 'white' : this.currentColor.hex,\n maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,\n }}\n >\n {this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <div\n class=\"boxes__box-content__info\"\n style={{\n maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,\n }}\n >\n {!this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <h2>{this.capitalizeFirstLetter(this.currentColor.name)}</h2>\n {!this.isMobile && <h4>{this.currentColor.number}</h4>}\n\n <div class=\"boxes__box-content__info__value\">\n {/* <div class=\"boxes__box-content__info__value-image\">\n {this.currentColor?.image! && <img src={`${APIURL}/assets/${this.currentColor.image}?access_token=${accessToken}`} alt=\"color-image\" />}\n </div> */}\n <div class=\"boxes__box-content__info__value-product\">\n {/* <div>\n {!this.isMobile && <p>Produkt:</p>}\n {this.isMobile && <h2>{this.currentColor?.name}</h2>} <p>{this.product}</p>\n </div> */}\n\n {this.isMobile && <div class={'divider'}></div>}\n {this.currentColor && this.currentColor.links?.find((link: Link) => link?.shop === this.shop) && (\n <a\n onClick={this.goToProduct}\n href={this.getHref()}\n class={`button ${this.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}`}\n >\n wybierz kolor\n </a>\n )}\n </div>\n </div>\n </div>\n <div class=\"boxes__box-content__slider\">{this.renderSliderOrImage()}</div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"my-colorinfo.js","sourceRoot":"","sources":["../../../src/components/my-colorinfo/my-colorinfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAQ7C,MAAM,OAAO,WAAW;;IAiBtB,gBAAW,GAAG,GAAG,EAAE;;MACjB,IAAI,CAAC,YAAY;QACf,YAAY,CAAC;UACX,KAAK,EAAE,aAAa;UACpB,IAAI,EAAE,IAAI,CAAC,IAAI;UACf,OAAO,EAAE,IAAI,CAAC,OAAO;UACrB,KAAK,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { AvailableTester, Color, Link, Product } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorinfo',\n styleUrl: 'my-colorinfo.scss',\n assetsDirs: ['assets'],\n scoped: true,\n})\nexport class MyColorInfo {\n @Prop() currentColor: Color;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() availableTesters: AvailableTester | null;\n @Prop() price: number | null;\n @Prop() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n @Prop() shapeImage = 'Shape.svg';\n @Prop() buttonBlocked = false;\n\n @Event() closeInfoBox: EventEmitter;\n @Event({ bubbles: true, composed: true }) addToBasket: EventEmitter<{ id: number }>;\n\n goToProduct = () => {\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n });\n this.closeInfoBox.emit();\n };\n\n onCloseButtonClick = () => {\n this.closeInfoBox.emit();\n };\n\n renderSliderOrImage = () => {\n if (this.currentColor.imageInsteadHex) {\n return <img class={'color-big-image'} src={`${APIURL}/assets/${this.currentColor.bigImage}?access_token=${accessToken}`} alt=\"color-image\" />;\n } else {\n return <my-slider color={this.currentColor.name} shop={this.shop} product={this.product} slides={this.data?.images}></my-slider>;\n }\n };\n\n getHref = () => {\n if (this.baselink) {\n return `${this.baselink}/${this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path}`;\n } else {\n return this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path;\n }\n };\n\n capitalizeFirstLetter = (string: string) => {\n return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();\n };\n\n isVeryLightBackground = (): boolean => {\n if (this.currentColor.imageInsteadHex) return true;\n const hex = this.currentColor.hex?.replace('#', '') ?? '';\n if (hex.length !== 6 && hex.length !== 3) return false;\n const r = parseInt(hex.length === 3 ? hex[0] + hex[0] : hex.slice(0, 2), 16) / 255;\n const g = parseInt(hex.length === 3 ? hex[1] + hex[1] : hex.slice(2, 4), 16) / 255;\n const b = parseInt(hex.length === 3 ? hex[2] + hex[2] : hex.slice(4, 6), 16) / 255;\n const luminance = 0.299 * r + 0.587 * g + 0.114 * b;\n return luminance > 0.96; // only near-white: dark button; rest: white button\n };\n\n getButtonClass = () => {\n if (this.currentColor.imageInsteadHex) return 'brown';\n return this.isVeryLightBackground() ? 'inverse' : '';\n };\n\n handleAddToBasket = () => {\n if (!this.availableTesters?.id_product_attribute) return;\n this.buttonBlocked = true;\n this.addToBasket.emit({\n id: this.availableTesters.id_product_attribute,\n });\n\n setTimeout(() => {\n this.buttonBlocked = false;\n }, 10000);\n };\n\n render() {\n return (\n <div\n class={`boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`}\n style={{\n background: this.currentColor.imageInsteadHex ? 'white' : this.currentColor.hex,\n maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,\n }}\n >\n {this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <div\n class=\"boxes__box-content__info\"\n style={{\n maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,\n }}\n >\n <div class=\"boxes__box-content__info__header\">\n {!this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <h2>{this.capitalizeFirstLetter(this.currentColor.name)}</h2>\n {!this.isMobile && <h4>{this.currentColor.number}</h4>}\n {this.currentColor && this.currentColor.links?.find((link: Link) => link?.shop === this.shop) && (\n <a onClick={this.goToProduct} href={this.getHref()} class={`button ${this.getButtonClass()}`}>\n wybierz kolor\n </a>\n )}\n </div>\n <div class=\"boxes__box-content__info__value\">\n <div class=\"divider\"></div>\n\n <div class=\"boxes__box-content__info__tester\">\n {' '}\n <div class=\"divider\"></div>\n <div class=\"tester-text\">\n <h2>Zamów tester</h2>\n <p>Sprawdź go na swojej ścianie.</p>\n </div>\n <div class=\"tester-buy\">\n <div class=\"price\">{this.price ? `${this.price} zł` : ''}</div>\n\n <button\n class={`button fit ${this.getButtonClass()} ${!this.availableTesters ? 'disabled' : ''}`}\n onClick={this.handleAddToBasket}\n disabled={!this.availableTesters || this.buttonBlocked}\n >\n <span class=\"shape-icon\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"16\" viewBox=\"0 0 15 16\">\n <path\n class=\"shape-icon__path\"\n transform=\"translate(0.0867462 0)\"\n d=\"M13.246571 12.763281L11.931726 4.961875C11.801879 4.1936703 11.13567 3.6319427 10.35657 3.63375L9.7429771 3.63375L9.7429771 3.1025C9.7429771 1.3890365 8.35394 0 6.6404767 0C4.9270134 0 3.537977 1.3890365 3.537977 3.1025L3.537977 3.63375L2.9217269 3.63375C2.1426277 3.6319427 1.4764187 4.1936703 1.3465706 4.961875L0.034383144 12.763281C-0.086738147 13.483807 0.11555123 14.221112 0.58740741 14.778946C1.0592636 15.336781 1.7528107 15.658594 2.4834456 15.658594L10.797508 15.658594C11.528143 15.658594 12.22169 15.336781 12.693546 14.778946C13.165402 14.221112 13.367692 13.483807 13.246571 12.763281L13.246571 12.763281ZM4.3348517 3.0892186C4.3348517 1.8158572 5.3671155 0.78359371 6.6404767 0.78359371C7.9138384 0.78359371 8.9461021 1.8158572 8.9461021 3.0892186L8.9461021 3.6204686L4.3348517 3.6204686L4.3348517 3.0892186ZM12.08579 14.264063C11.765244 14.643165 11.293964 14.86172 10.797508 14.86172L2.4834456 14.86172C1.9871488 14.862442 1.5158025 14.644215 1.195269 14.265309C0.87473541 13.886404 0.73765546 13.385406 0.82063317 12.896093L2.1248519 5.092031C2.1891608 4.703371 2.5278175 4.4200282 2.9217269 4.4252396L3.5353208 4.4252396L3.5353208 5.5834374C3.5353208 5.8034883 3.7137072 5.9818749 3.9337583 5.9818749C4.1538091 5.9818749 4.3321958 5.8034883 4.3321958 5.5834374L4.3321958 4.4252396L8.9461021 4.4252396L8.9461021 5.5834374C8.9461021 5.8034883 9.1244888 5.9818749 9.3445396 5.9818749C9.5645905 5.9818749 9.7429771 5.8034883 9.7429771 5.5834374L9.7429771 4.4252396L10.359227 4.4252396C10.753137 4.4200282 11.091793 4.703371 11.156102 5.092031L12.46032 12.896093C12.542204 13.384947 12.40527 13.885097 12.08579 14.264063L12.08579 14.264063Z\"\n />\n </svg>\n </span>\n \n\n {this.buttonBlocked ? 'Dodano do koszyka…' : !this.availableTesters ? 'Tester obecnie niedostępny' : 'Dodaj do koszyka'}\n </button>\n </div>\n </div>\n </div>\n </div>\n <div class=\"boxes__box-content__slider\">{this.renderSliderOrImage()}</div>\n </div>\n );\n }\n}\n"]}
@@ -6,6 +6,8 @@ export class MyModalBundle {
6
6
  this.product = undefined;
7
7
  this.baselink = undefined;
8
8
  this.colorname = undefined;
9
+ this.available_testers = undefined;
10
+ this.price = undefined;
9
11
  this.show = false;
10
12
  this.readyToClose = false;
11
13
  }
@@ -22,10 +24,17 @@ export class MyModalBundle {
22
24
  this.show = false;
23
25
  this.readyToClose = false;
24
26
  }
27
+ addToBasketHandler(event) {
28
+ const { id } = event.detail;
29
+ return id;
30
+ }
25
31
  render() {
26
32
  let content = null;
27
33
  if (this.show) {
28
- content = [h("my-backdrop", null), h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink, selectedcolor: this.colorname })];
34
+ content = [
35
+ h("my-backdrop", null),
36
+ h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink, selectedcolor: this.colorname, available_testers: this.available_testers ? JSON.parse(this.available_testers) : null, price: this.price }),
37
+ ];
29
38
  }
30
39
  return (h("div", { onClick: () => {
31
40
  if (this.readyToClose) {
@@ -123,6 +132,40 @@ export class MyModalBundle {
123
132
  },
124
133
  "attribute": "colorname",
125
134
  "reflect": false
135
+ },
136
+ "available_testers": {
137
+ "type": "string",
138
+ "mutable": false,
139
+ "complexType": {
140
+ "original": "string | null",
141
+ "resolved": "null | string",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": false,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": ""
149
+ },
150
+ "attribute": "available_testers",
151
+ "reflect": false
152
+ },
153
+ "price": {
154
+ "type": "number",
155
+ "mutable": false,
156
+ "complexType": {
157
+ "original": "number | null",
158
+ "resolved": "null | number",
159
+ "references": {}
160
+ },
161
+ "required": false,
162
+ "optional": false,
163
+ "docs": {
164
+ "tags": [],
165
+ "text": ""
166
+ },
167
+ "attribute": "price",
168
+ "reflect": false
126
169
  }
127
170
  };
128
171
  }
@@ -132,6 +175,24 @@ export class MyModalBundle {
132
175
  "readyToClose": {}
133
176
  };
134
177
  }
178
+ static get events() {
179
+ return [{
180
+ "method": "addToBasket",
181
+ "name": "addToBasket",
182
+ "bubbles": true,
183
+ "cancelable": true,
184
+ "composed": true,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": ""
188
+ },
189
+ "complexType": {
190
+ "original": "{ id: number }",
191
+ "resolved": "{ id: number; }",
192
+ "references": {}
193
+ }
194
+ }];
195
+ }
135
196
  static get methods() {
136
197
  return {
137
198
  "open": {
@@ -182,6 +243,12 @@ export class MyModalBundle {
182
243
  "target": undefined,
183
244
  "capture": false,
184
245
  "passive": false
246
+ }, {
247
+ "name": "addToBasket",
248
+ "method": "addToBasketHandler",
249
+ "target": undefined,
250
+ "capture": false,
251
+ "passive": false
185
252
  }];
186
253
  }
187
254
  }
@@ -1 +1 @@
1
- {"version":3,"file":"my-component.js","sourceRoot":"","sources":["../../../src/components/my-component/my-component.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOnF,MAAM,OAAO,aAAa;;;;;;gBAQR,KAAK;wBACG,KAAK;;EAG7B,KAAK,CAAC,IAAI;IACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;EACnB,CAAC;EAGD,KAAK,CAAC,KAAK;IACT,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;EACpB,CAAC;EAGD,sBAAsB,CAAC,KAAkB;IACvC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;EAC9C,CAAC;EAGD,iBAAiB;IACf,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IAClB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;EAC5B,CAAC;EAED,MAAM;IACJ,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,IAAI,CAAC,IAAI,EAAE;MACb,OAAO,GAAG,CAAC,sBAA2B,EAAE,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,GAAa,CAAC,CAAC;KAChK;IACD,OAAO,CACL,WACE,OAAO,EAAE,GAAG,EAAE;QACZ,IAAI,IAAI,CAAC,YAAY,EAAE;UACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC1B;MACH,CAAC;MAED,EAAC,MAAM;QACL,kBACG;;;;;;;;;kEASqD,CAC/C,CACF;MACT,WAAK,KAAK,EAAC,iBAAiB,IAAE,OAAO,CAAO;MAC5C;QACE,cAAQ,GAAG,EAAC,yDAAyD,EAAC,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAW,CAC7I,CACP,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import Helmet from '@stencil/helmet';\nimport { Component, Prop, Method, Element, State, Listen, h } from '@stencil/core';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.scss',\n scoped: true,\n})\nexport class MyModalBundle {\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() colorname: string | null;\n\n @State() show = false;\n @State() readyToClose = false;\n\n @Method()\n async open() {\n this.show = true;\n }\n\n @Method()\n async close() {\n this.show = false;\n }\n\n @Listen('readyToCLose')\n setReadyToCloseHandler(value: CustomEvent) {\n this.readyToClose = value.detail.observable;\n }\n\n @Listen('close')\n closeModalHandler() {\n this.show = false;\n this.readyToClose = false;\n }\n\n render() {\n let content = null;\n if (this.show) {\n content = [<my-backdrop></my-backdrop>, <my-modal shop={this.shop} product={this.product} baselink={this.baselink} selectedcolor={this.colorname}></my-modal>];\n }\n return (\n <div\n onClick={() => {\n if (this.readyToClose) {\n this.closeModalHandler();\n }\n }}\n >\n <Helmet>\n <script>\n {`(function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ 'gtm.start': new Date().getTime(), 'event': 'gtm.js' });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != 'dataLayer' ? '&l=' + l : '';\n j.async = true;\n j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', 'GTM-PMTKHDX');`}\n </script>\n </Helmet>\n <div class=\"pallete-wrapper\">{content}</div>\n <noscript>\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-PMTKHDX\" height=\"0\" width=\"0\" style={{ display: 'none', visibility: 'hidden' }}></iframe>\n </noscript>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"my-component.js","sourceRoot":"","sources":["../../../src/components/my-component/my-component.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,eAAe,CAAC;AAOxG,MAAM,OAAO,aAAa;;;;;;;;gBAWR,KAAK;wBACG,KAAK;;EAG7B,KAAK,CAAC,IAAI;IACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;EACnB,CAAC;EAGD,KAAK,CAAC,KAAK;IACT,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;EACpB,CAAC;EAGD,sBAAsB,CAAC,KAAkB;IACvC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;EAC9C,CAAC;EAGD,iBAAiB;IACf,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IAClB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;EAC5B,CAAC;EAGD,kBAAkB,CAAC,KAAkC;IACnD,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IAE5B,OAAO,EAAE,CAAC;EACZ,CAAC;EAED,MAAM;IACJ,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,IAAI,CAAC,IAAI,EAAE;MACb,OAAO,GAAG;QACR,sBAA2B;QAC3B,gBACE,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,aAAa,EAAE,IAAI,CAAC,SAAS,EAC7B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,IAAI,EACrF,KAAK,EAAE,IAAI,CAAC,KAAK,GACP;OACb,CAAC;KACH;IACD,OAAO,CACL,WACE,OAAO,EAAE,GAAG,EAAE;QACZ,IAAI,IAAI,CAAC,YAAY,EAAE;UACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC1B;MACH,CAAC;MAED,EAAC,MAAM;QACL,kBACG;;;;;;;;;kEASqD,CAC/C,CACF;MACT,WAAK,KAAK,EAAC,iBAAiB,IAAE,OAAO,CAAO;MAC5C;QACE,cAAQ,GAAG,EAAC,yDAAyD,EAAC,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAW,CAC7I,CACP,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import Helmet from '@stencil/helmet';\nimport { Component, Prop, Method, Element, State, Listen, Event, EventEmitter, h } from '@stencil/core';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.scss',\n scoped: true,\n})\nexport class MyModalBundle {\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() colorname: string | null;\n @Prop() available_testers: string | null;\n @Prop() price: number | null;\n @Event({ bubbles: true, composed: true }) addToBasket: EventEmitter<{ id: number }>;\n\n @State() show = false;\n @State() readyToClose = false;\n\n @Method()\n async open() {\n this.show = true;\n }\n\n @Method()\n async close() {\n this.show = false;\n }\n\n @Listen('readyToCLose')\n setReadyToCloseHandler(value: CustomEvent) {\n this.readyToClose = value.detail.observable;\n }\n\n @Listen('close')\n closeModalHandler() {\n this.show = false;\n this.readyToClose = false;\n }\n\n @Listen('addToBasket')\n addToBasketHandler(event: CustomEvent<{ id: number }>) {\n const { id } = event.detail;\n\n return id;\n }\n\n render() {\n let content = null;\n if (this.show) {\n content = [\n <my-backdrop></my-backdrop>,\n <my-modal\n shop={this.shop}\n product={this.product}\n baselink={this.baselink}\n selectedcolor={this.colorname}\n available_testers={this.available_testers ? JSON.parse(this.available_testers) : null}\n price={this.price}\n ></my-modal>,\n ];\n }\n return (\n <div\n onClick={() => {\n if (this.readyToClose) {\n this.closeModalHandler();\n }\n }}\n >\n <Helmet>\n <script>\n {`(function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ 'gtm.start': new Date().getTime(), 'event': 'gtm.js' });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != 'dataLayer' ? '&l=' + l : '';\n j.async = true;\n j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', 'GTM-PMTKHDX');`}\n </script>\n </Helmet>\n <div class=\"pallete-wrapper\">{content}</div>\n <noscript>\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-PMTKHDX\" height=\"0\" width=\"0\" style={{ display: 'none', visibility: 'hidden' }}></iframe>\n </noscript>\n </div>\n );\n }\n}\n"]}
@@ -1,3 +1,10 @@
1
+ @font-face {
2
+ font-family: "Galatea";
3
+ src: url("/assets/fonts/Galatea-Regular.woff2") format("woff2"), url("/assets/fonts/Galatea-Regular.woff") format("woff"), url("/assets/fonts/Galatea-Regular.ttf") format("truetype");
4
+ font-weight: normal;
5
+ font-style: normal;
6
+ font-display: swap;
7
+ }
1
8
  .pallete-wrapper * {
2
9
  font-family: "Galatea", sans-serif;
3
10
  }
@@ -144,191 +151,6 @@
144
151
  justify-content: center;
145
152
  }
146
153
  }
147
- .my-modal__wrapper .boxes__box-content {
148
- width: 100%;
149
- margin-bottom: 5px;
150
- height: 500px;
151
- text-align: left;
152
- display: flex;
153
- flex-direction: row;
154
- justify-content: space-between;
155
- position: relative;
156
- }
157
- .my-modal__wrapper .boxes__box-content .closebtn {
158
- position: absolute;
159
- right: 10px;
160
- top: 10px;
161
- width: 53px;
162
- height: 53px;
163
- cursor: pointer;
164
- object-fit: cover;
165
- z-index: 9999;
166
- }
167
- @media (max-width: 1024px) {
168
- .my-modal__wrapper .boxes__box-content {
169
- flex-direction: column-reverse;
170
- height: auto;
171
- }
172
- }
173
- @media (max-width: 768px) {
174
- .my-modal__wrapper .boxes__box-content {
175
- margin: 0 auto;
176
- }
177
- }
178
- .my-modal__wrapper .boxes__box-content__info {
179
- width: 40%;
180
- padding: 50px 40px;
181
- position: relative;
182
- }
183
- @media (max-width: 1024px) {
184
- .my-modal__wrapper .boxes__box-content__info {
185
- width: 100%;
186
- padding: 15px;
187
- min-height: 100px;
188
- }
189
- }
190
- @media (max-width: 768px) {
191
- .my-modal__wrapper .boxes__box-content__info {
192
- min-height: auto;
193
- }
194
- }
195
- .my-modal__wrapper .boxes__box-content__info h2 {
196
- font-size: 35px;
197
- font-weight: normal;
198
- margin-bottom: 30px;
199
- color: #232323;
200
- }
201
- @media (max-width: 768px) {
202
- .my-modal__wrapper .boxes__box-content__info h2 {
203
- font-size: 16px;
204
- text-align: center;
205
- margin-bottom: 15px;
206
- margin-top: 5px;
207
- }
208
- }
209
- .my-modal__wrapper .boxes__box-content__info h4 {
210
- margin-top: 0px;
211
- margin-bottom: 15px;
212
- font-size: 16px;
213
- color: #4c4c4c;
214
- }
215
- .my-modal__wrapper .boxes__box-content__info .divider {
216
- border: 1px solid #4c4c4c;
217
- opacity: 0.2;
218
- margin-bottom: 20px;
219
- }
220
- @media (max-width: 768px) {
221
- .my-modal__wrapper .boxes__box-content__info .divider {
222
- margin: 10px 0px;
223
- display: none;
224
- }
225
- }
226
- .my-modal__wrapper .boxes__box-content__info__value {
227
- display: flex;
228
- flex-direction: row;
229
- justify-content: flex-start;
230
- }
231
- @media (max-width: 1024px) {
232
- .my-modal__wrapper .boxes__box-content__info__value {
233
- justify-content: flex-start;
234
- }
235
- }
236
- @media (max-width: 768px) {
237
- .my-modal__wrapper .boxes__box-content__info__value {
238
- flex-direction: column;
239
- }
240
- }
241
- @media (max-width: 768px) {
242
- .my-modal__wrapper .boxes__box-content__info__value-image {
243
- margin: 0 auto;
244
- margin-bottom: 10px;
245
- }
246
- }
247
- .my-modal__wrapper .boxes__box-content__info__value-image img {
248
- width: 114px;
249
- object-fit: cover;
250
- }
251
- @media (max-width: 1024px) {
252
- .my-modal__wrapper .boxes__box-content__info__value-image img {
253
- width: 75px;
254
- }
255
- }
256
- .my-modal__wrapper .boxes__box-content__info__value-product {
257
- color: #232323;
258
- margin-left: 10px;
259
- }
260
- @media (max-width: 1024px) {
261
- .my-modal__wrapper .boxes__box-content__info__value-product h2 {
262
- font-size: 26px;
263
- margin: 0;
264
- margin-right: 10px;
265
- }
266
- }
267
- @media (max-width: 768px) {
268
- .my-modal__wrapper .boxes__box-content__info__value-product h2 {
269
- font-size: 16px;
270
- }
271
- }
272
- .my-modal__wrapper .boxes__box-content__info__value-product p {
273
- font-size: 20px;
274
- margin-top: 0px;
275
- margin-bottom: 0px;
276
- }
277
- .my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type {
278
- margin-bottom: 20px;
279
- }
280
- @media (max-width: 1024px) {
281
- .my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type {
282
- margin-bottom: 0;
283
- }
284
- }
285
- @media (max-width: 768px) {
286
- .my-modal__wrapper .boxes__box-content__info__value-product p {
287
- font-size: 10px;
288
- }
289
- }
290
- @media (max-width: 1024px) {
291
- .my-modal__wrapper .boxes__box-content__info__value-product > div {
292
- display: flex;
293
- justify-content: flex-start;
294
- align-items: center;
295
- }
296
- }
297
- @media (max-width: 768px) {
298
- .my-modal__wrapper .boxes__box-content__info__value-product > div {
299
- flex-direction: column;
300
- }
301
- }
302
- .my-modal__wrapper .boxes__box-content__slider {
303
- width: 60%;
304
- min-width: 60%;
305
- max-width: 60%;
306
- position: relative;
307
- }
308
- @media (max-width: 1024px) {
309
- .my-modal__wrapper .boxes__box-content__slider {
310
- width: 100%;
311
- display: block;
312
- min-width: 100%;
313
- max-width: 100%;
314
- }
315
- }
316
- .my-modal__wrapper .boxes__box-content__slider .color-big-image {
317
- width: 100%;
318
- height: 100%;
319
- object-fit: cover;
320
- }
321
- @media (max-width: 1024px) {
322
- .my-modal__wrapper .boxes__box-content__slider .color-big-image {
323
- height: 300px;
324
- }
325
- }
326
- .my-modal__wrapper .boxes__box-content__white * {
327
- color: #fff;
328
- }
329
- .my-modal__wrapper .boxes__box-content__white h2 {
330
- color: #fff;
331
- }
332
154
  .my-modal__wrapper .pagination {
333
155
  margin: 10px 0px;
334
156
  font-size: 16px;
@@ -384,60 +206,7 @@
384
206
  .my-modal .categories__slide-information span:last-of-type {
385
207
  margin-right: 7px;
386
208
  }
387
- .my-modal .button,
388
- .my-modal a {
389
- background-color: #fff;
390
- font-size: 16px;
391
- box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);
392
- border-radius: 22px;
393
- padding: 10px 35px;
394
- color: #232323;
395
- text-decoration: none;
396
- display: block;
397
- text-align: center;
398
- transition: all 0.7s ease-in-out;
399
- border: none;
400
- cursor: pointer;
401
- }
402
- .my-modal .button:hover,
403
- .my-modal a:hover {
404
- color: #fff;
405
- background-color: #232323;
406
- }
407
- .my-modal .button.brown,
408
- .my-modal a.brown {
409
- background-color: #3c2114;
410
- color: #fff;
411
- }
412
- .my-modal .button.brown:hover,
413
- .my-modal a.brown:hover {
414
- color: #fff;
415
- background-color: #232323;
416
- }
417
- .my-modal .button.inverse,
418
- .my-modal a.inverse {
419
- background-color: #232323;
420
- color: #fff;
421
- }
422
- .my-modal .button.inverse:hover,
423
- .my-modal a.inverse:hover {
424
- color: #232323;
425
- background-color: #fff;
426
- }
427
- @media (max-width: 1024px) {
428
- .my-modal .button,
429
- .my-modal a {
430
- max-width: 150px;
431
- font-size: 13px;
432
- padding: 12px 25px;
433
- }
434
- }
435
- @media (max-width: 768px) {
436
- .my-modal .button,
437
- .my-modal a {
438
- margin: 0 auto;
439
- }
440
- }
209
+
441
210
  .my-modal > .button {
442
211
  margin: 10px auto;
443
212
  }
@@ -178,6 +178,8 @@ export class MyModal {
178
178
  this.shop = undefined;
179
179
  this.product = undefined;
180
180
  this.baselink = undefined;
181
+ this.available_testers = undefined;
182
+ this.price = undefined;
181
183
  this.selectedcolor = undefined;
182
184
  this.closeImage = 'close.png';
183
185
  this.arrowDown = 'arrow_down.png';
@@ -295,7 +297,7 @@ export class MyModal {
295
297
  render() {
296
298
  var _a, _b;
297
299
  return (h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (h("div", { class: 'loader' }, h("my-loader", null))), !this.preloader && this.data && (h("div", { class: `my-modal__header` }, h("div", { class: "image-wrapper" }, h("img", { src: `${APIURL}/assets/${(_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo}?access_token=${accessToken}`, alt: "modal-logo" }), !this.preloader && this.data && (h("p", { class: "my-modal__see-more" }, (_b = this.data) === null || _b === void 0 ? void 0 : _b.modalDescription))), h("div", { class: "search-wrapper" }, !this.preloader && h("my-search", { shopname: this.shop, productname: this.data.name, isMobile: this.isMobile }), !this.preloader && (h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, h("img", { src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" })))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
298
- var _a;
300
+ var _a, _b;
299
301
  return (h("div", { key: index, class: "boxes" }, h("div", { class: "boxes__list" }, color.map((c) => {
300
302
  var _a;
301
303
  return (h("my-colorbox", { key: c.id, onClick: () => {
@@ -315,13 +317,14 @@ export class MyModal {
315
317
  isImageInsteadHex: c.imageInsteadHex,
316
318
  bigImage: c.bigImage,
317
319
  } }));
318
- })), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth, baselink: this.baselink }))));
320
+ })), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth, baselink: this.baselink, availableTesters: (_b = this.available_testers) === null || _b === void 0 ? void 0 : _b.find((t) => { var _a, _b, _c; return ((_a = t.color_name) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === ((_c = (_b = this.currentColor) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.trim().toLowerCase()); }), price: this.price }))));
319
321
  })) : (h("p", null, "Brak wynik\u00F3w")), this.colors.pagination.filter_count > limit && (h("div", { class: 'pagination' }, Array.from({ length: Math.ceil(this.colors.pagination.filter_count / limit) }).map((_, i) => (h("span", { class: i + 1 === this.page ? 'current' : '', onClick: e => {
320
322
  e.preventDefault();
321
323
  this.onPage(i + 1);
322
324
  }, key: `#${i + 1}` }, i + 1)))))))), !this.preloader && this.isMobile && (h("button", { class: "button", onClick: () => this.closeModalHandler() }, "Zamknij"))));
323
325
  }
324
326
  static get is() { return "my-modal"; }
327
+ static get encapsulation() { return "scoped"; }
325
328
  static get originalStyleUrls() {
326
329
  return {
327
330
  "$": ["my-modal.scss"]
@@ -386,6 +389,43 @@ export class MyModal {
386
389
  "attribute": "baselink",
387
390
  "reflect": false
388
391
  },
392
+ "available_testers": {
393
+ "type": "unknown",
394
+ "mutable": false,
395
+ "complexType": {
396
+ "original": "AvailableTester[] | null",
397
+ "resolved": "AvailableTester[] | null",
398
+ "references": {
399
+ "AvailableTester": {
400
+ "location": "import",
401
+ "path": "../../types"
402
+ }
403
+ }
404
+ },
405
+ "required": false,
406
+ "optional": false,
407
+ "docs": {
408
+ "tags": [],
409
+ "text": ""
410
+ }
411
+ },
412
+ "price": {
413
+ "type": "number",
414
+ "mutable": false,
415
+ "complexType": {
416
+ "original": "number | null",
417
+ "resolved": "null | number",
418
+ "references": {}
419
+ },
420
+ "required": false,
421
+ "optional": false,
422
+ "docs": {
423
+ "tags": [],
424
+ "text": ""
425
+ },
426
+ "attribute": "price",
427
+ "reflect": false
428
+ },
389
429
  "selectedcolor": {
390
430
  "type": "string",
391
431
  "mutable": false,