@ppg_pl/pallete 2.0.26 → 2.0.27

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 (78) hide show
  1. package/dist/cjs/{index-d74cbc0d.js → index-e6121396.js} +19 -6
  2. package/dist/cjs/index-e6121396.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/my-backdrop_8.cjs.entry.js +43 -29
  5. package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
  6. package/dist/cjs/pallete.cjs.js +2 -2
  7. package/dist/collection/components/my-backdrop/my-backdrop.css +13 -1
  8. package/dist/collection/components/my-backdrop/my-backdrop.js +1 -0
  9. package/dist/collection/components/my-backdrop/my-backdrop.js.map +1 -1
  10. package/dist/collection/components/my-colorbox/my-colorbox.css +11 -0
  11. package/dist/collection/components/my-colorbox/my-colorbox.js +1 -0
  12. package/dist/collection/components/my-colorbox/my-colorbox.js.map +1 -1
  13. package/dist/collection/components/my-colorinfo/my-colorinfo.css +11 -0
  14. package/dist/collection/components/my-colorinfo/my-colorinfo.js +1 -1
  15. package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -1
  16. package/dist/collection/components/my-component/my-component.js +1 -1
  17. package/dist/collection/components/my-component/my-component.js.map +1 -1
  18. package/dist/collection/components/my-loader/my-loader.js +1 -1
  19. package/dist/collection/components/my-loader/my-loader.js.map +1 -1
  20. package/dist/collection/components/my-modal/my-modal.css +12 -1
  21. package/dist/collection/components/my-modal/my-modal.js +6 -3
  22. package/dist/collection/components/my-modal/my-modal.js.map +1 -1
  23. package/dist/collection/components/my-search/my-search.css +11 -0
  24. package/dist/collection/components/my-search/my-search.js +1 -1
  25. package/dist/collection/components/my-search/my-search.js.map +1 -1
  26. package/dist/collection/components/my-slider/index.js +30 -18
  27. package/dist/collection/components/my-slider/index.js.map +1 -1
  28. package/dist/collection/components/my-slider/my-slider.css +30 -3
  29. package/dist/components/index3.js +32 -20
  30. package/dist/components/index3.js.map +1 -1
  31. package/dist/components/my-backdrop2.js +3 -2
  32. package/dist/components/my-backdrop2.js.map +1 -1
  33. package/dist/components/my-colorbox2.js +3 -2
  34. package/dist/components/my-colorbox2.js.map +1 -1
  35. package/dist/components/my-colorinfo2.js +3 -2
  36. package/dist/components/my-colorinfo2.js.map +1 -1
  37. package/dist/components/my-component.js +3 -2
  38. package/dist/components/my-component.js.map +1 -1
  39. package/dist/components/my-loader2.js +3 -2
  40. package/dist/components/my-loader2.js.map +1 -1
  41. package/dist/components/my-modal2.js +8 -4
  42. package/dist/components/my-modal2.js.map +1 -1
  43. package/dist/components/my-search2.js +3 -2
  44. package/dist/components/my-search2.js.map +1 -1
  45. package/dist/esm/{index-45a30349.js → index-bfca3bb0.js} +19 -6
  46. package/dist/esm/index-bfca3bb0.js.map +1 -0
  47. package/dist/esm/loader.js +3 -3
  48. package/dist/esm/my-backdrop_8.entry.js +43 -29
  49. package/dist/esm/my-backdrop_8.entry.js.map +1 -1
  50. package/dist/esm/pallete.js +3 -3
  51. package/dist/pallete/p-28521606.entry.js +2 -0
  52. package/dist/pallete/p-28521606.entry.js.map +1 -0
  53. package/dist/pallete/p-a9353643.js +3 -0
  54. package/dist/pallete/p-a9353643.js.map +1 -0
  55. package/dist/pallete/pallete.css +1 -1
  56. package/dist/pallete/pallete.esm.js +1 -1
  57. package/package.json +1 -1
  58. package/www/build/p-28521606.entry.js +2 -0
  59. package/www/build/p-28521606.entry.js.map +1 -0
  60. package/www/build/p-a9353643.js +3 -0
  61. package/www/build/p-a9353643.js.map +1 -0
  62. package/www/build/p-e0d7f1b0.js +163 -0
  63. package/www/build/p-e724a1ee.css +21 -0
  64. package/www/build/pallete.css +1 -1
  65. package/www/build/pallete.esm.js +1 -1
  66. package/www/index.html +1 -1
  67. package/dist/cjs/index-d74cbc0d.js.map +0 -1
  68. package/dist/esm/index-45a30349.js.map +0 -1
  69. package/dist/pallete/p-2394bcec.entry.js +0 -2
  70. package/dist/pallete/p-2394bcec.entry.js.map +0 -1
  71. package/dist/pallete/p-a3449132.js +0 -3
  72. package/dist/pallete/p-a3449132.js.map +0 -1
  73. package/www/build/p-2394bcec.entry.js +0 -2
  74. package/www/build/p-2394bcec.entry.js.map +0 -1
  75. package/www/build/p-a3449132.js +0 -3
  76. package/www/build/p-a3449132.js.map +0 -1
  77. package/www/build/p-c5910eb7.js +0 -2
  78. package/www/build/p-f8a0208d.css +0 -1
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, getAssetPath } from '@stencil/core/internal/client';
2
2
  import { s as setDataLayer } from './gtmUtils.js';
3
3
 
4
- const mySearchCss = "@font-face{font-family:\"Galatea\";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\");font-weight:normal;font-style:normal;font-display:swap}.pallete-wrapper.sc-my-search *.sc-my-search{font-family:\"Galatea\", sans-serif}.search.sc-my-search{position:relative;width:400px}@media (max-width: 768px){.search.sc-my-search{width:100%}}.search.sc-my-search input.sc-my-search{font-size:16px;padding:19px;border-radius:27.35px;border:1px solid #dfdfdf;width:100%;color:#4c4c4c}.search.sc-my-search button.sc-my-search{position:absolute;border:none;background-color:transparent;right:10px;top:0;width:50px;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}";
4
+ const mySearchCss = "@font-face{font-family:\"Galatea\";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\");font-weight:normal;font-style:normal;font-display:swap}@font-face{font-family:swiper-icons;src:url(\"data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAA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8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/markup/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8telefonCBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA\");font-weight:400;font-style:normal}.pallete-wrapper *{font-family:\"Galatea\", sans-serif}:host,:host *{font-family:\"Galatea\", sans-serif}.search{position:relative;width:400px}@media (max-width: 768px){.search{width:100%}}.search input{font-size:16px;padding:19px;border-radius:27.35px;border:1px solid #dfdfdf;width:100%;color:#4c4c4c}.search button{position:absolute;border:none;background-color:transparent;right:10px;top:0;width:50px;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}";
5
5
 
6
6
  function debounce(func, wait) {
7
7
  let timeout;
@@ -18,6 +18,7 @@ const MySearch = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
18
18
  constructor() {
19
19
  super();
20
20
  this.__registerHost();
21
+ this.__attachShadow();
21
22
  this.searchColors = createEvent(this, "searchColors", 7);
22
23
  this.fetchColorsByName = (text) => {
23
24
  this.searchColors.emit(text);
@@ -61,7 +62,7 @@ const MySearch = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
61
62
  "searchText": ["fetchColorsByNameHandle"]
62
63
  }; }
63
64
  static get style() { return mySearchCss; }
64
- }, [2, "my-search", {
65
+ }, [1, "my-search", {
65
66
  "productname": [1],
66
67
  "shopname": [1],
67
68
  "isMobile": [4, "is-mobile"],
@@ -1 +1 @@
1
- {"file":"my-search2.js","mappings":";;;AAAA,MAAM,WAAW,GAAG,i1BAAi1B;;ACGr2B,SAAS,QAAQ,CAAC,IAAc,EAAE,IAAY;EAC5C,IAAI,OAAsC,CAAC;EAC3C,OAAO,SAAS,gBAAgB,CAAC,GAAG,IAAW;IAC7C,MAAM,KAAK,GAAG;MACZ,YAAY,CAAC,OAAO,CAAC,CAAC;MACtB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;KACf,CAAC;IACF,YAAY,CAAC,OAAO,CAAC,CAAC;IACtB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;GACnC,CAAC;AACJ,CAAC;MAQY,QAAQ;;;;;IAQnB,sBAAiB,GAAG,CAAC,IAAY;MAC/B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC9B,CAAC;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ACnE,CACL,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-search/my-search.scss?tag=my-search&encapsulation=scoped","./src/components/my-search/my-search.tsx"],"sourcesContent":["@import '../../global/app.scss';\n\n.search {\n position: relative;\n width: 400px;\n @media (max-width: $small) {\n width: 100%;\n }\n input {\n font-size: 16px;\n padding: 19px;\n border-radius: 27.35px;\n border: 1px solid #dfdfdf;\n width: 100%;\n color: #4c4c4c;\n }\n\n button {\n position: absolute;\n border: none;\n background-color: transparent;\n right: 10px;\n top: 0;\n width: 50px;\n height: calc(100%);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n}\n","import { Component, Prop, h, State, Listen, getAssetPath, EventEmitter, Event, Watch } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\n\nfunction debounce(func: Function, wait: number) {\n let timeout: ReturnType<typeof setTimeout>;\n return function executedFunction(...args: any[]) {\n const later = () => {\n clearTimeout(timeout);\n func(...args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n}\n\n@Component({\n tag: 'my-search',\n styleUrl: 'my-search.scss',\n assetsDirs: ['assets'],\n scoped: true,\n})\nexport class MySearch {\n @Prop() productname: string;\n @Prop() shopname: string;\n @Prop() isMobile: boolean;\n @Prop() searchIcon = 'search.svg';\n @State() searchText: string | null = null;\n @Event() searchColors: EventEmitter;\n\n fetchColorsByName = (text: string) => {\n this.searchColors.emit(text);\n };\n\n private debouncedInputChangeValue = debounce((value: string) => {\n this.fetchColorsByName(value);\n this.searchText = value;\n }, 500);\n\n private onInputChangeValue(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n this.debouncedInputChangeValue(value);\n }\n\n @Watch('searchText')\n fetchColorsByNameHandle(newValue: string) {\n if (newValue.length >= 3) {\n setDataLayer({\n event: 'ColorSearch',\n shop: this.shopname,\n product: this.productname,\n search_term: newValue,\n });\n }\n\n this.fetchColorsByName(newValue);\n }\n\n @Listen('clearSearchText', { target: 'document' })\n clearSearchTextHandler() {\n this.searchText = null;\n }\n\n render() {\n return (\n <div class={'search'}>\n <input placeholder={this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie'} value={this.searchText || ''} type=\"text\" onInput={this.onInputChangeValue.bind(this)} />\n\n <button\n onClick={() => {\n this.searchText && this.fetchColorsByName(this.searchText);\n\n this.searchText = '';\n }}\n >\n <img src={getAssetPath(`./assets/${this.searchIcon}`)} alt=\"arrow_down\" />\n </button>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"my-search2.js","mappings":";;;AAAA,MAAM,WAAW,GAAG,8iGAA8iG;;ACGlkG,SAAS,QAAQ,CAAC,IAAc,EAAE,IAAY;EAC5C,IAAI,OAAsC,CAAC;EAC3C,OAAO,SAAS,gBAAgB,CAAC,GAAG,IAAW;IAC7C,MAAM,KAAK,GAAG;MACZ,YAAY,CAAC,OAAO,CAAC,CAAC;MACtB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;KACf,CAAC;IACF,YAAY,CAAC,OAAO,CAAC,CAAC;IACtB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;GACnC,CAAC;AACJ,CAAC;MAQY,QAAQ;;;;;;IAQnB,sBAAiB,GAAG,CAAC,IAAY;MAC/B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC9B,CAAC;IAEM,8BAAyB,GAAG,QAAQ,CAAC,CAAC,KAAa;MACzD,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;MAC9B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;KACzB,EAAE,GAAG,CAAC,CAAC;;;;sBAXa,YAAY;sBACI,IAAI;;EAYjC,kBAAkB,CAAC,KAAY;IACrC,MAAM,KAAK,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK,CAAC;IACvD,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;GACvC;EAGD,uBAAuB,CAAC,QAAgB;IACtC,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE;MACxB,YAAY,CAAC;QACX,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,IAAI,CAAC,QAAQ;QACnB,OAAO,EAAE,IAAI,CAAC,WAAW;QACzB,WAAW,EAAE,QAAQ;OACtB,CAAC,CAAC;KACJ;IAED,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;GAClC;EAGD,sBAAsB;IACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;GACxB;EAED,MAAM;IACJ,QACE,WAAK,KAAK,EAAE,QAAQ,IAClB,aAAO,WAAW,EAAE,IAAI,CAAC,QAAQ,GAAG,gBAAgB,GAAG,0BAA0B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE,EAAE,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAI,EAE5K,cACE,OAAO,EAAE;QACP,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE3D,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;OACtB,IAED,WAAK,GAAG,EAAE,YAAY,CAAC,YAAY,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,GAAG,EAAC,YAAY,GAAG,CACnE,CACL,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-search/my-search.scss?tag=my-search&encapsulation=shadow","./src/components/my-search/my-search.tsx"],"sourcesContent":["@import '../../global/app.scss';\n\n.search {\n position: relative;\n width: 400px;\n @media (max-width: $small) {\n width: 100%;\n }\n input {\n font-size: 16px;\n padding: 19px;\n border-radius: 27.35px;\n border: 1px solid #dfdfdf;\n width: 100%;\n color: #4c4c4c;\n }\n\n button {\n position: absolute;\n border: none;\n background-color: transparent;\n right: 10px;\n top: 0;\n width: 50px;\n height: calc(100%);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n}\n","import { Component, Prop, h, State, Listen, getAssetPath, EventEmitter, Event, Watch } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\n\nfunction debounce(func: Function, wait: number) {\n let timeout: ReturnType<typeof setTimeout>;\n return function executedFunction(...args: any[]) {\n const later = () => {\n clearTimeout(timeout);\n func(...args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n}\n\n@Component({\n tag: 'my-search',\n styleUrl: 'my-search.scss',\n assetsDirs: ['assets'],\n shadow: true,\n})\nexport class MySearch {\n @Prop() productname: string;\n @Prop() shopname: string;\n @Prop() isMobile: boolean;\n @Prop() searchIcon = 'search.svg';\n @State() searchText: string | null = null;\n @Event({ bubbles: true, composed: true }) searchColors: EventEmitter;\n\n fetchColorsByName = (text: string) => {\n this.searchColors.emit(text);\n };\n\n private debouncedInputChangeValue = debounce((value: string) => {\n this.fetchColorsByName(value);\n this.searchText = value;\n }, 500);\n\n private onInputChangeValue(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n this.debouncedInputChangeValue(value);\n }\n\n @Watch('searchText')\n fetchColorsByNameHandle(newValue: string) {\n if (newValue.length >= 3) {\n setDataLayer({\n event: 'ColorSearch',\n shop: this.shopname,\n product: this.productname,\n search_term: newValue,\n });\n }\n\n this.fetchColorsByName(newValue);\n }\n\n @Listen('clearSearchText', { target: 'document' })\n clearSearchTextHandler() {\n this.searchText = null;\n }\n\n render() {\n return (\n <div class={'search'}>\n <input placeholder={this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie'} value={this.searchText || ''} type=\"text\" onInput={this.onInputChangeValue.bind(this)} />\n\n <button\n onClick={() => {\n this.searchText && this.fetchColorsByName(this.searchText);\n\n this.searchText = '';\n }}\n >\n <img src={getAssetPath(`./assets/${this.searchIcon}`)} alt=\"arrow_down\" />\n </button>\n </div>\n );\n }\n}\n"],"version":3}
@@ -9,6 +9,7 @@ const NAMESPACE = 'pallete';
9
9
  * Modified for Stencil's renderer and slot projection
10
10
  */
11
11
  let scopeId;
12
+ let hostTagName;
12
13
  let isSvgMode = false;
13
14
  let queuePending = false;
14
15
  const getAssetPath = (path) => {
@@ -358,7 +359,7 @@ const attachStyles = (hostRef) => {
358
359
  const elm = hostRef.$hostElement$;
359
360
  const flags = cmpMeta.$flags$;
360
361
  const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
361
- const scopeId = addStyle(elm.getRootNode(), cmpMeta);
362
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
362
363
  // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
363
364
  if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
364
365
  // only required when we're NOT using native shadow dom (slot)
@@ -370,9 +371,6 @@ const attachStyles = (hostRef) => {
370
371
  // DOM WRITE!!
371
372
  elm['s-sc'] = scopeId;
372
373
  elm.classList.add(scopeId + '-h');
373
- if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
374
- elm.classList.add(scopeId + '-s');
375
- }
376
374
  }
377
375
  endAttachStyles();
378
376
  };
@@ -604,6 +602,9 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
604
602
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
605
603
  let containerElm = (parentElm);
606
604
  let childNode;
605
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
606
+ containerElm = containerElm.shadowRoot;
607
+ }
607
608
  for (; startIdx <= endIdx; ++startIdx) {
608
609
  if (vnodes[startIdx]) {
609
610
  childNode = createElm(null, parentVNode, startIdx);
@@ -945,10 +946,11 @@ const renderVdom = (hostRef, renderFnResults) => {
945
946
  const hostElm = hostRef.$hostElement$;
946
947
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
947
948
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
949
+ hostTagName = hostElm.tagName;
948
950
  rootVnode.$tag$ = null;
949
951
  rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
950
952
  hostRef.$vnode$ = rootVnode;
951
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
953
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
952
954
  {
953
955
  scopeId = hostElm['s-sc'];
954
956
  }
@@ -1456,6 +1458,17 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1456
1458
  super(self);
1457
1459
  self = this;
1458
1460
  registerHost(self, cmpMeta);
1461
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1462
+ // this component is using shadow dom
1463
+ // and this browser supports shadow dom
1464
+ // add the read-only property "shadowRoot" to the host element
1465
+ // adding the shadow root build conditionals to minimize runtime
1466
+ {
1467
+ {
1468
+ self.attachShadow({ mode: 'open' });
1469
+ }
1470
+ }
1471
+ }
1459
1472
  }
1460
1473
  connectedCallback() {
1461
1474
  if (appLoadFallback) {
@@ -1662,4 +1675,4 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1662
1675
 
1663
1676
  export { getElement as a, bootstrapLazy as b, createEvent as c, getAssetPath as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1664
1677
 
1665
- //# sourceMappingURL=index-45a30349.js.map
1678
+ //# sourceMappingURL=index-bfca3bb0.js.map