@shoper/phoenix_design_system 0.2.1 → 0.2.2-0

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 (83) hide show
  1. package/build/cjs/external/lit-html/async-directive.js +16 -0
  2. package/build/cjs/external/lit-html/async-directive.js.map +1 -0
  3. package/build/cjs/external/lit-html/directive-helpers.js +14 -0
  4. package/build/cjs/external/lit-html/directive-helpers.js.map +1 -0
  5. package/build/cjs/external/lit-html/directive.js +15 -0
  6. package/build/cjs/external/lit-html/directive.js.map +1 -0
  7. package/build/cjs/external/lit-html/directives/ref.js +17 -0
  8. package/build/cjs/external/lit-html/directives/ref.js.map +1 -0
  9. package/build/cjs/external/lit-html/lit-html.js +14 -0
  10. package/build/cjs/external/lit-html/lit-html.js.map +1 -0
  11. package/build/cjs/packages/phoenix/src/components/modal/modal.js +170 -0
  12. package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -0
  13. package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js +65 -0
  14. package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js.map +1 -0
  15. package/build/cjs/packages/phoenix/src/components/modal/modal_body.js +19 -0
  16. package/build/cjs/packages/phoenix/src/components/modal/modal_body.js.map +1 -0
  17. package/build/cjs/packages/phoenix/src/components/modal/modal_close.js +41 -0
  18. package/build/cjs/packages/phoenix/src/components/modal/modal_close.js.map +1 -0
  19. package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js +19 -0
  20. package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js.map +1 -0
  21. package/build/cjs/packages/phoenix/src/components/modal/modal_footer.js +19 -0
  22. package/build/cjs/packages/phoenix/src/components/modal/modal_footer.js.map +1 -0
  23. package/build/cjs/packages/phoenix/src/components/modal/modal_header.js +19 -0
  24. package/build/cjs/packages/phoenix/src/components/modal/modal_header.js.map +1 -0
  25. package/build/cjs/packages/phoenix/src/components/portal/portal.js +10 -5
  26. package/build/cjs/packages/phoenix/src/components/portal/portal.js.map +1 -1
  27. package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js +3 -1
  28. package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js.map +1 -1
  29. package/build/cjs/packages/phoenix/src/components/portal/portal_target.js +7 -7
  30. package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element.js +34 -1
  31. package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element.js.map +1 -1
  32. package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js +8 -0
  33. package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js.map +1 -0
  34. package/build/cjs/packages/phoenix/src/index.js +45 -3
  35. package/build/cjs/packages/phoenix/src/index.js.map +1 -1
  36. package/build/esm/external/lit-html/async-directive.js +12 -0
  37. package/build/esm/external/lit-html/async-directive.js.map +1 -0
  38. package/build/esm/external/lit-html/directive-helpers.js +10 -0
  39. package/build/esm/external/lit-html/directive-helpers.js.map +1 -0
  40. package/build/esm/external/lit-html/directive.js +9 -0
  41. package/build/esm/external/lit-html/directive.js.map +1 -0
  42. package/build/esm/external/lit-html/directives/ref.js +12 -0
  43. package/build/esm/external/lit-html/directives/ref.js.map +1 -0
  44. package/build/esm/external/lit-html/lit-html.js +9 -0
  45. package/build/esm/external/lit-html/lit-html.js.map +1 -0
  46. package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +29 -0
  47. package/build/esm/packages/phoenix/src/components/modal/modal.js +168 -0
  48. package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -0
  49. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.d.ts +12 -0
  50. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js +63 -0
  51. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js.map +1 -0
  52. package/build/esm/packages/phoenix/src/components/modal/modal_body.d.ts +4 -0
  53. package/build/esm/packages/phoenix/src/components/modal/modal_body.js +17 -0
  54. package/build/esm/packages/phoenix/src/components/modal/modal_body.js.map +1 -0
  55. package/build/esm/packages/phoenix/src/components/modal/modal_close.d.ts +8 -0
  56. package/build/esm/packages/phoenix/src/components/modal/modal_close.js +39 -0
  57. package/build/esm/packages/phoenix/src/components/modal/modal_close.js.map +1 -0
  58. package/build/esm/packages/phoenix/src/components/modal/modal_constants.d.ts +9 -0
  59. package/build/esm/packages/phoenix/src/components/modal/modal_constants.js +12 -0
  60. package/build/esm/packages/phoenix/src/components/modal/modal_constants.js.map +1 -0
  61. package/build/esm/packages/phoenix/src/components/modal/modal_footer.d.ts +4 -0
  62. package/build/esm/packages/phoenix/src/components/modal/modal_footer.js +17 -0
  63. package/build/esm/packages/phoenix/src/components/modal/modal_footer.js.map +1 -0
  64. package/build/esm/packages/phoenix/src/components/modal/modal_header.d.ts +4 -0
  65. package/build/esm/packages/phoenix/src/components/modal/modal_header.js +17 -0
  66. package/build/esm/packages/phoenix/src/components/modal/modal_header.js.map +1 -0
  67. package/build/esm/packages/phoenix/src/components/portal/portal.d.ts +1 -1
  68. package/build/esm/packages/phoenix/src/components/portal/portal.js +10 -5
  69. package/build/esm/packages/phoenix/src/components/portal/portal.js.map +1 -1
  70. package/build/esm/packages/phoenix/src/components/portal/portal_constants.d.ts +3 -0
  71. package/build/esm/packages/phoenix/src/components/portal/portal_constants.js +3 -2
  72. package/build/esm/packages/phoenix/src/components/portal/portal_constants.js.map +1 -1
  73. package/build/esm/packages/phoenix/src/components/portal/portal_target.js +7 -7
  74. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.d.ts +6 -1
  75. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.js +35 -2
  76. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.js.map +1 -1
  77. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.d.ts +1 -0
  78. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js +4 -0
  79. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js.map +1 -0
  80. package/build/esm/packages/phoenix/src/index.d.ts +6 -0
  81. package/build/esm/packages/phoenix/src/index.js +7 -1
  82. package/build/esm/packages/phoenix/src/index.js.map +1 -1
  83. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var directiveHelpers = require('./directive-helpers.js');
6
+ var directive = require('./directive.js');
7
+
8
+ /**
9
+ * @license
10
+ * Copyright 2017 Google LLC
11
+ * SPDX-License-Identifier: BSD-3-Clause
12
+ */const e=(i,t)=>{var s,o;const n=i._$AN;if(void 0===n)return !1;for(const i of n)null===(o=(s=i)._$AO)||void 0===o||o.call(s,t,!1),e(i,t);return !0},o=i=>{let t,s;do{if(void 0===(t=i._$AM))break;s=t._$AN,s.delete(i),i=t;}while(0===(null==s?void 0:s.size))},n=i=>{for(let t;t=i._$AM;i=t){let s=t._$AN;if(void 0===s)t._$AN=s=new Set;else if(s.has(i))break;s.add(i),l(t);}};function r(i){void 0!==this._$AN?(o(this),this._$AM=i,n(this)):this._$AM=i;}function h(i,t=!1,s=0){const n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(n))for(let i=s;i<n.length;i++)e(n[i],!1),o(n[i]);else null!=n&&(e(n,!1),o(n));else e(this,i);}const l=i=>{var t,e,o,n;i.type==directive.PartType.CHILD&&(null!==(t=(o=i)._$AP)&&void 0!==t||(o._$AP=h),null!==(e=(n=i)._$AQ)&&void 0!==e||(n._$AQ=r));};class d extends directive.Directive{constructor(){super(...arguments),this._$AN=void 0;}_$AT(i,t,s){super._$AT(i,t,s),n(this),this.isConnected=i._$AU;}_$AO(i,t=!0){var s,n;i!==this.isConnected&&(this.isConnected=i,i?null===(s=this.reconnected)||void 0===s||s.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),t&&(e(this,i),o(this));}setValue(t){if(directiveHelpers.isSingleExpression(this._$Ct))this._$Ct._$AI(t,this);else {const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0);}}disconnected(){}reconnected(){}}
13
+
14
+ exports.directive = directive.directive;
15
+ exports.AsyncDirective = d;
16
+ //# sourceMappingURL=async-directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('./lit-html.js');
6
+
7
+ /**
8
+ * @license
9
+ * Copyright 2020 Google LLC
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */const r=o=>void 0===o.strings;
12
+
13
+ exports.isSingleExpression = r;
14
+ //# sourceMappingURL=directive-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ /**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */
10
+ const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
11
+
12
+ exports.Directive = i;
13
+ exports.PartType = t;
14
+ exports.directive = e;
15
+ //# sourceMappingURL=directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var litHtml = require('../lit-html.js');
6
+ var directive = require('../directive.js');
7
+ var asyncDirective = require('../async-directive.js');
8
+
9
+ /**
10
+ * @license
11
+ * Copyright 2020 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */const e=()=>new o;class o{}const h=new WeakMap,n=directive.directive(class extends asyncDirective.AsyncDirective{render(t){return litHtml.nothing}update(t,[s]){var e;const o=s!==this.U;return o&&void 0!==this.U&&this.ot(void 0),(o||this.rt!==this.lt)&&(this.U=s,this.ht=null===(e=t.options)||void 0===e?void 0:e.host,this.ot(this.lt=t.element)),litHtml.nothing}ot(i){var t;if("function"==typeof this.U){const s=null!==(t=this.ht)&&void 0!==t?t:globalThis;let e=h.get(s);void 0===e&&(e=new WeakMap,h.set(s,e)),void 0!==e.get(this.U)&&this.U.call(this.ht,void 0),e.set(this.U,i),void 0!==i&&this.U.call(this.ht,i);}else this.U.value=i;}get rt(){var i,t,s;return "function"==typeof this.U?null===(t=h.get(null!==(i=this.ht)&&void 0!==i?i:globalThis))||void 0===t?void 0:t.get(this.U):null===(s=this.U)||void 0===s?void 0:s.value}disconnected(){this.rt===this.lt&&this.ot(void 0);}reconnected(){this.ot(this.lt);}});
14
+
15
+ exports.createRef = e;
16
+ exports.ref = n;
17
+ //# sourceMappingURL=ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ /**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */
10
+ var t;const i=globalThis.trustedTypes,s=i?i.createPolicy("lit-html",{createHTML:t=>t}):void 0,e=`lit$${(Math.random()+"").slice(9)}$`,o="?"+e,n=`<${o}>`,l=document,h=(t="")=>l.createComment(t),r=t=>null===t||"object"!=typeof t&&"function"!=typeof t,d=Array.isArray,u=t=>{var i;return d(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])},c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,a=/>/g,f=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,_=/'/g,m=/"/g,g=/^(?:script|style|textarea|title)$/i,b=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),T=new WeakMap,A=l.createTreeWalker(l,129,null,!1),C=(t,i)=>{const o=t.length-1,l=[];let h,r=2===i?"<svg>":"",d=c;for(let i=0;i<o;i++){const s=t[i];let o,u,p=-1,$=0;for(;$<s.length&&(d.lastIndex=$,u=d.exec(s),null!==u);)$=d.lastIndex,d===c?"!--"===u[1]?d=v:void 0!==u[1]?d=a:void 0!==u[2]?(g.test(u[2])&&(h=RegExp("</"+u[2],"g")),d=f):void 0!==u[3]&&(d=f):d===f?">"===u[0]?(d=null!=h?h:c,p=-1):void 0===u[1]?p=-2:(p=d.lastIndex-u[2].length,o=u[1],d=void 0===u[3]?f:'"'===u[3]?m:_):d===m||d===_?d=f:d===v||d===a?d=c:(d=f,h=void 0);const y=d===f&&t[i+1].startsWith("/>")?" ":"";r+=d===c?s+n:p>=0?(l.push(o),s.slice(0,p)+"$lit$"+s.slice(p)+e+y):s+e+(-2===p?(l.push(void 0),i):y);}const u=r+(t[o]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return [void 0!==s?s.createHTML(u):u,l]};class E{constructor({strings:t,_$litType$:s},n){let l;this.parts=[];let r=0,d=0;const u=t.length-1,c=this.parts,[v,a]=C(t,s);if(this.el=E.createElement(v,n),A.currentNode=this.el.content,2===s){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(l=A.nextNode())&&c.length<u;){if(1===l.nodeType){if(l.hasAttributes()){const t=[];for(const i of l.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(e)){const s=a[d++];if(t.push(i),void 0!==s){const t=l.getAttribute(s.toLowerCase()+"$lit$").split(e),i=/([.?@])?(.*)/.exec(s);c.push({type:1,index:r,name:i[2],strings:t,ctor:"."===i[1]?M:"?"===i[1]?H:"@"===i[1]?I:S});}else c.push({type:6,index:r});}for(const i of t)l.removeAttribute(i);}if(g.test(l.tagName)){const t=l.textContent.split(e),s=t.length-1;if(s>0){l.textContent=i?i.emptyScript:"";for(let i=0;i<s;i++)l.append(t[i],h()),A.nextNode(),c.push({type:2,index:++r});l.append(t[s],h());}}}else if(8===l.nodeType)if(l.data===o)c.push({type:2,index:r});else {let t=-1;for(;-1!==(t=l.data.indexOf(e,t+1));)c.push({type:7,index:r}),t+=e.length-1;}r++;}}static createElement(t,i){const s=l.createElement("template");return s.innerHTML=t,s}}function P(t,i,s=t,e){var o,n,l,h;if(i===b)return i;let d=void 0!==e?null===(o=s._$Cl)||void 0===o?void 0:o[e]:s._$Cu;const u=r(i)?void 0:i._$litDirective$;return (null==d?void 0:d.constructor)!==u&&(null===(n=null==d?void 0:d._$AO)||void 0===n||n.call(d,!1),void 0===u?d=void 0:(d=new u(t),d._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Cl)&&void 0!==l?l:h._$Cl=[])[e]=d:s._$Cu=d),void 0!==d&&(i=P(t,d._$AS(t,i.values),d,e)),i}class V{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:l).importNode(s,!0);A.currentNode=o;let n=A.nextNode(),h=0,r=0,d=e[0];for(;void 0!==d;){if(h===d.index){let i;2===d.type?i=new N(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new L(n,this,t)),this.v.push(i),d=e[++r];}h!==(null==d?void 0:d.index)&&(n=A.nextNode(),h++);}return o}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class N{constructor(t,i,s,e){var o;this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cg=null===(o=null==e?void 0:e.isConnected)||void 0===o||o;}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=P(this,t,i),r(t)?t===w||null==t||""===t?(this._$AH!==w&&this._$AR(),this._$AH=w):t!==this._$AH&&t!==b&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):u(t)?this.S(t):this.$(t);}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t));}$(t){this._$AH!==w&&r(this._$AH)?this._$AA.nextSibling.data=t:this.k(l.createTextNode(t)),this._$AH=t;}T(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=E.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.m(s);else {const t=new V(o,this),i=t.p(this.options);t.m(s),this.k(i),this._$AH=t;}}_$AC(t){let i=T.get(t.strings);return void 0===i&&T.set(t.strings,i=new E(t)),i}S(t){d(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new N(this.M(h()),this.M(h()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t));}}class S{constructor(t,i,s,e,o){this.type=1,this._$AH=w,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=w;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=P(this,t,i,0),n=!r(t)||t!==this._$AH&&t!==b,n&&(this._$AH=t);else {const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=P(this,e[s+l],i,l),h===b&&(h=this._$AH[l]),n||(n=!r(h)||h!==this._$AH[l]),h===w?t=w:t!==w&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h;}n&&!e&&this.C(t);}C(t){t===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"");}}class M extends S{constructor(){super(...arguments),this.type=3;}C(t){this.element[this.name]=t===w?void 0:t;}}const k=i?i.emptyScript:"";class H extends S{constructor(){super(...arguments),this.type=4;}C(t){t&&t!==w?this.element.setAttribute(this.name,k):this.element.removeAttribute(this.name);}}class I extends S{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5;}_$AI(t,i=this){var s;if((t=null!==(s=P(this,t,i,0))&&void 0!==s?s:w)===b)return;const e=this._$AH,o=t===w&&e!==w||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==w&&(e===w||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t);}}class L{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t);}}const z=window.litHtmlPolyfillSupport;null==z||z(E,N),(null!==(t=globalThis.litHtmlVersions)&&void 0!==t?t:globalThis.litHtmlVersions=[]).push("2.2.5");
11
+
12
+ exports.noChange = b;
13
+ exports.nothing = w;
14
+ //# sourceMappingURL=lit-html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,170 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
+ var lit = require('lit');
7
+ var decorators = require('lit/decorators');
8
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
9
+ var portal_constants = require('../portal/portal_constants.js');
10
+ var modal_constants = require('./modal_constants.js');
11
+ var ref = require('../../../../../external/lit-html/directives/ref.js');
12
+
13
+ var HModal_1;
14
+ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.PhoenixLightLitElement {
15
+ constructor() {
16
+ super();
17
+ this.opened = false;
18
+ this._firstFocusableElement = undefined;
19
+ this._focusableElements = null;
20
+ this._lastFocusableElement = undefined;
21
+ this._contentRef = ref.createRef();
22
+ this._focusSentinelStart = ref.createRef();
23
+ this._focusSentinelEnd = ref.createRef();
24
+ this._propsChangeStrategies = {
25
+ [modal_constants.MODAL_OPENED_PROP]: {
26
+ true: () => {
27
+ HModal_1.openModals = [...HModal_1.openModals, this];
28
+ document.addEventListener('keydown', this._bindCloseOnEsc);
29
+ setTimeout(() => {
30
+ var _a;
31
+ (_a = this._firstFocusableElement) === null || _a === void 0 ? void 0 : _a.focus();
32
+ }, 0);
33
+ },
34
+ false: () => {
35
+ HModal_1.openModals = HModal_1.openModals.filter((modal) => modal !== this);
36
+ document.removeEventListener('keydown', this._bindCloseOnEsc);
37
+ }
38
+ }
39
+ };
40
+ this._keepFocusWithinModal = (ev) => {
41
+ var _a, _b;
42
+ const isTabPressed = ev.code === 'Tab';
43
+ if (isTabPressed) {
44
+ if (ev.shiftKey) {
45
+ if (document.activeElement === this._firstFocusableElement) {
46
+ (_a = this._lastFocusableElement) === null || _a === void 0 ? void 0 : _a.focus();
47
+ ev.preventDefault();
48
+ }
49
+ }
50
+ else if (document.activeElement === this._lastFocusableElement) {
51
+ (_b = this._firstFocusableElement) === null || _b === void 0 ? void 0 : _b.focus();
52
+ ev.preventDefault();
53
+ }
54
+ }
55
+ };
56
+ this._handleCloseFromCloseComponent = (ev) => {
57
+ var _a;
58
+ ev.stopPropagation();
59
+ if ((_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.contains(ev.target)) {
60
+ this.close();
61
+ }
62
+ };
63
+ this._bindCloseOnEsc = (ev) => {
64
+ ev.stopImmediatePropagation();
65
+ const closeConditions = [ev.key === 'Escape', ev.ctrlKey === false, ev.shiftKey === false, ev.altKey === false];
66
+ const shouldCloseModal = closeConditions.every((condition) => condition);
67
+ if (shouldCloseModal) {
68
+ const [modalToClose] = HModal_1.openModals.slice(-1);
69
+ modalToClose === null || modalToClose === void 0 ? void 0 : modalToClose.close();
70
+ }
71
+ };
72
+ this._focusableElements = [...this.querySelectorAll(modal_constants.FOCUSABLE_ELEMENTS_WITHIN_MODAL)];
73
+ }
74
+ static _appendModalsPortal() {
75
+ const $modalsPortalTarget = document.querySelector(`h-portal-target[name="${modal_constants.MODALS_PORTAL_NAME}"]`);
76
+ if (!$modalsPortalTarget) {
77
+ const $portalTarget = document.createElement('h-portal-target');
78
+ $portalTarget.setAttribute(portal_constants.PORTAL_TARGET_NAME_PROP, modal_constants.MODALS_PORTAL_NAME);
79
+ document.body.appendChild($portalTarget);
80
+ }
81
+ }
82
+ static _appendModalsBackdrop() {
83
+ const $modalsBackdrop = document.querySelector('h-modal-backdrop');
84
+ if (!$modalsBackdrop) {
85
+ const $backdrop = document.createElement('h-modal-backdrop');
86
+ document.body.appendChild($backdrop);
87
+ }
88
+ }
89
+ static isSomeModalOpen() {
90
+ return HModal_1.openModals.some((modal) => modal.opened);
91
+ }
92
+ connectedCallback() {
93
+ super.connectedCallback();
94
+ HModal_1._appendModalsPortal();
95
+ HModal_1._appendModalsBackdrop();
96
+ document.addEventListener('keydown', this._keepFocusWithinModal);
97
+ document.addEventListener(modal_constants.MODAL_EVENTS.close, this._handleCloseFromCloseComponent);
98
+ }
99
+ disconnectedCallback() {
100
+ super.disconnectedCallback();
101
+ document.removeEventListener(modal_constants.MODAL_EVENTS.close, this._handleCloseFromCloseComponent);
102
+ document.removeEventListener('keydown', this._bindCloseOnEsc);
103
+ }
104
+ firstUpdated() {
105
+ this._firstFocusableElement = this._focusSentinelStart.value;
106
+ this._lastFocusableElement = this._focusSentinelEnd.value;
107
+ }
108
+ updated(changedProps) {
109
+ if (changedProps.has(modal_constants.MODAL_OPENED_PROP)) {
110
+ this._propsChangeStrategies[modal_constants.MODAL_OPENED_PROP][String(this[modal_constants.MODAL_OPENED_PROP])]();
111
+ }
112
+ }
113
+ open() {
114
+ if (!this[modal_constants.MODAL_OPENED_PROP]) {
115
+ this[modal_constants.MODAL_OPENED_PROP] = true;
116
+ this._dispatchModalOpenedEvent();
117
+ }
118
+ }
119
+ _dispatchModalOpenedEvent() {
120
+ const openModalEvent = new CustomEvent(modal_constants.MODAL_EVENTS.opened, {
121
+ bubbles: true
122
+ });
123
+ this.dispatchEvent(openModalEvent);
124
+ }
125
+ close() {
126
+ if (this[modal_constants.MODAL_OPENED_PROP]) {
127
+ this[modal_constants.MODAL_OPENED_PROP] = false;
128
+ this._dispatchModalClosedEvent();
129
+ }
130
+ }
131
+ _dispatchModalClosedEvent() {
132
+ const closeModalEvent = new CustomEvent(modal_constants.MODAL_EVENTS.closed, {
133
+ bubbles: true
134
+ });
135
+ this.dispatchEvent(closeModalEvent);
136
+ }
137
+ render() {
138
+ return lit.html `
139
+ <h-portal ?disabled="${!this.opened}" to="${modal_constants.MODALS_PORTAL_NAME}" hidden>
140
+ <div tabindex="0" ${ref.ref(this._focusSentinelStart)}></div>
141
+ <div ${ref.ref(this._contentRef)} class="modal" role="dialog">
142
+ ${this.getSlot('header')} ${this.getSlot('default')} ${this.getSlot('footer')}
143
+ </div>
144
+ <div tabindex="0" ${ref.ref(this._focusSentinelEnd)}></div>
145
+ </h-portal>
146
+ `;
147
+ }
148
+ };
149
+ exports.HModal.openModals = [];
150
+ tslib_es6.__decorate([
151
+ decorators.property({ type: Boolean, reflect: true }),
152
+ tslib_es6.__metadata("design:type", Object)
153
+ ], exports.HModal.prototype, "opened", void 0);
154
+ tslib_es6.__decorate([
155
+ decorators.state(),
156
+ tslib_es6.__metadata("design:type", Object)
157
+ ], exports.HModal.prototype, "_firstFocusableElement", void 0);
158
+ tslib_es6.__decorate([
159
+ decorators.state(),
160
+ tslib_es6.__metadata("design:type", Object)
161
+ ], exports.HModal.prototype, "_focusableElements", void 0);
162
+ tslib_es6.__decorate([
163
+ decorators.state(),
164
+ tslib_es6.__metadata("design:type", Object)
165
+ ], exports.HModal.prototype, "_lastFocusableElement", void 0);
166
+ exports.HModal = HModal_1 = tslib_es6.__decorate([
167
+ decorators.customElement('h-modal'),
168
+ tslib_es6.__metadata("design:paramtypes", [])
169
+ ], exports.HModal);
170
+ //# sourceMappingURL=modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA,kBAAkB,oDAAwD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
+ var lit = require('lit');
7
+ var decorators = require('lit/decorators');
8
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
9
+ var modal_constants = require('./modal_constants.js');
10
+ var modal = require('./modal.js');
11
+
12
+ exports.HModalBackdrop = class HModalBackdrop extends phoenix_light_lit_element.PhoenixLightLitElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.visible = false;
16
+ this._show = () => {
17
+ if (!this.visible) {
18
+ this.visible = true;
19
+ }
20
+ };
21
+ this._hide = () => {
22
+ if (!modal.HModal.isSomeModalOpen()) {
23
+ this.visible = false;
24
+ }
25
+ };
26
+ }
27
+ connectedCallback() {
28
+ super.connectedCallback();
29
+ document.addEventListener(modal_constants.MODAL_EVENTS.opened, this._show);
30
+ document.addEventListener(modal_constants.MODAL_EVENTS.closed, this._hide);
31
+ }
32
+ disconnectedCallback() {
33
+ super.disconnectedCallback();
34
+ document.removeEventListener(modal_constants.MODAL_EVENTS.opened, this._show);
35
+ document.removeEventListener(modal_constants.MODAL_EVENTS.closed, this._hide);
36
+ }
37
+ updated() {
38
+ if (modal.HModal.isSomeModalOpen()) {
39
+ this.visible = true;
40
+ this._disableScrolling();
41
+ }
42
+ else {
43
+ this._enableScrolling();
44
+ }
45
+ }
46
+ _disableScrolling() {
47
+ document.body.style.overflow = 'hidden';
48
+ document.body.style.paddingRight = '15px';
49
+ }
50
+ _enableScrolling() {
51
+ document.body.style.removeProperty('overflow');
52
+ document.body.style.removeProperty('padding-right');
53
+ }
54
+ render() {
55
+ return lit.html `<div aria-hidden="true" ?hidden="${!this.visible}" class="modal-backdrop"></div>`;
56
+ }
57
+ };
58
+ tslib_es6.__decorate([
59
+ decorators.property({ type: Boolean }),
60
+ tslib_es6.__metadata("design:type", Object)
61
+ ], exports.HModalBackdrop.prototype, "visible", void 0);
62
+ exports.HModalBackdrop = tslib_es6.__decorate([
63
+ decorators.customElement('h-modal-backdrop')
64
+ ], exports.HModalBackdrop);
65
+ //# sourceMappingURL=modal_backdrop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
+ var decorators = require('lit/decorators');
7
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
8
+
9
+ exports.HModalBody = class HModalBody extends phoenix_light_lit_element.PhoenixLightLitElement {
10
+ constructor() {
11
+ super();
12
+ this.slot = this.hasAttribute('slot') ? this.slot : 'default';
13
+ }
14
+ };
15
+ exports.HModalBody = tslib_es6.__decorate([
16
+ decorators.customElement('h-modal-body'),
17
+ tslib_es6.__metadata("design:paramtypes", [])
18
+ ], exports.HModalBody);
19
+ //# sourceMappingURL=modal_body.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
+ var decorators = require('lit/decorators');
7
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
8
+ var modal_constants = require('./modal_constants.js');
9
+
10
+ exports.HModalClose = class HModalClose extends phoenix_light_lit_element.PhoenixLightLitElement {
11
+ constructor() {
12
+ super();
13
+ this.tabIndex = 0;
14
+ this.setAttribute('role', 'button');
15
+ }
16
+ connectedCallback() {
17
+ super.connectedCallback();
18
+ this.addEventListener('click', this._dispatchModalCloseEvent);
19
+ this.addEventListener('keydown', this._dispatchModalCloseOnEnterEvent);
20
+ }
21
+ disconnectedCallback() {
22
+ this.removeEventListener('click', this._dispatchModalCloseEvent);
23
+ this.removeEventListener('keydown', this._dispatchModalCloseOnEnterEvent);
24
+ }
25
+ _dispatchModalCloseEvent() {
26
+ const closeModalEvent = new CustomEvent(modal_constants.MODAL_EVENTS.close, {
27
+ bubbles: true
28
+ });
29
+ this.dispatchEvent(closeModalEvent);
30
+ }
31
+ _dispatchModalCloseOnEnterEvent(ev) {
32
+ if (ev.code === 'Enter' || ev.code === 'Space') {
33
+ this._dispatchModalCloseEvent();
34
+ }
35
+ }
36
+ };
37
+ exports.HModalClose = tslib_es6.__decorate([
38
+ decorators.customElement('h-modal-close'),
39
+ tslib_es6.__metadata("design:paramtypes", [])
40
+ ], exports.HModalClose);
41
+ //# sourceMappingURL=modal_close.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const MODALS_PORTAL_NAME = 'modals';
6
+ const MODAL_EVENTS = {
7
+ open: 'modal.open',
8
+ close: 'modal.close',
9
+ opened: 'modal.opened',
10
+ closed: 'modal.closed'
11
+ };
12
+ const MODAL_OPENED_PROP = 'opened';
13
+ const FOCUSABLE_ELEMENTS_WITHIN_MODAL = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
14
+
15
+ exports.FOCUSABLE_ELEMENTS_WITHIN_MODAL = FOCUSABLE_ELEMENTS_WITHIN_MODAL;
16
+ exports.MODALS_PORTAL_NAME = MODALS_PORTAL_NAME;
17
+ exports.MODAL_EVENTS = MODAL_EVENTS;
18
+ exports.MODAL_OPENED_PROP = MODAL_OPENED_PROP;
19
+ //# sourceMappingURL=modal_constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
+ var decorators = require('lit/decorators');
7
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
8
+
9
+ exports.HModalFooter = class HModalFooter extends phoenix_light_lit_element.PhoenixLightLitElement {
10
+ constructor() {
11
+ super();
12
+ this.slot = this.hasAttribute('slot') ? this.slot : 'footer';
13
+ }
14
+ };
15
+ exports.HModalFooter = tslib_es6.__decorate([
16
+ decorators.customElement('h-modal-footer'),
17
+ tslib_es6.__metadata("design:paramtypes", [])
18
+ ], exports.HModalFooter);
19
+ //# sourceMappingURL=modal_footer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
+ var decorators = require('lit/decorators');
7
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
8
+
9
+ exports.HModalHeader = class HModalHeader extends phoenix_light_lit_element.PhoenixLightLitElement {
10
+ constructor() {
11
+ super();
12
+ this.slot = this.hasAttribute('slot') ? this.slot : 'header';
13
+ }
14
+ };
15
+ exports.HModalHeader = tslib_es6.__decorate([
16
+ decorators.customElement('h-modal-header'),
17
+ tslib_es6.__metadata("design:paramtypes", [])
18
+ ], exports.HModalHeader);
19
+ //# sourceMappingURL=modal_header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
7
6
  var decorators = require('lit/decorators');
7
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
8
8
  var portal_constants = require('./portal_constants.js');
9
9
  var v4 = require('../../../../../external/uuid/dist/esm-browser/v4.js');
10
10
 
@@ -23,12 +23,17 @@ exports.HPortal = class HPortal extends phoenix_light_lit_element.PhoenixLightLi
23
23
  this.openPortal();
24
24
  }
25
25
  }
26
- updated(changedProps) {
27
- const disabledValue = changedProps.get('disabled');
28
- if (disabledValue === true) {
26
+ updated() {
27
+ if (this.children.length > 0) {
28
+ if (!this.disabled) {
29
+ this._initialChildren = [...this.children];
30
+ this.openPortal();
31
+ }
32
+ }
33
+ if (this.disabled === true) {
29
34
  this.closePortal();
30
35
  }
31
- else if (disabledValue === false) {
36
+ else if (this.disabled === false) {
32
37
  this.openPortal();
33
38
  }
34
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA,iBAAiB,qDAAyD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA,iBAAiB,qDAAyD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -5,7 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const PORTAL_EVENTS = {
6
6
  open: `portal.open`,
7
7
  close: 'portal.close'
8
- };
8
+ };
9
+ const PORTAL_TARGET_NAME_PROP = 'name';
9
10
 
10
11
  exports.PORTAL_EVENTS = PORTAL_EVENTS;
12
+ exports.PORTAL_TARGET_NAME_PROP = PORTAL_TARGET_NAME_PROP;
11
13
  //# sourceMappingURL=portal_constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
7
6
  var decorators = require('lit/decorators');
8
- var portal_constants = require('./portal_constants.js');
7
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
9
8
  var portal_target_error = require('./portal_target_error.js');
9
+ var portal_constants = require('./portal_constants.js');
10
10
 
11
11
  var HPortalTarget_1;
12
12
  exports.HPortalTarget = HPortalTarget_1 = class HPortalTarget extends phoenix_light_lit_element.PhoenixLightLitElement {
@@ -48,17 +48,17 @@ exports.HPortalTarget = HPortalTarget_1 = class HPortalTarget extends phoenix_li
48
48
  super.disconnectedCallback();
49
49
  document.removeEventListener(portal_constants.PORTAL_EVENTS.open, this.portalElements);
50
50
  document.removeEventListener(portal_constants.PORTAL_EVENTS.close, this.removeTeleportedItems);
51
- HPortalTarget_1.portalTargetsNames.delete(this.name);
51
+ HPortalTarget_1.portalTargetsNames.delete(this[portal_constants.PORTAL_TARGET_NAME_PROP]);
52
52
  }
53
53
  doesDestinationMatch(destination) {
54
- return destination === this.name;
54
+ return destination === this[portal_constants.PORTAL_TARGET_NAME_PROP];
55
55
  }
56
56
  allowOnlyOnePortalTargetWithName() {
57
- if (HPortalTarget_1.portalTargetsNames.has(this.name)) {
57
+ if (HPortalTarget_1.portalTargetsNames.has(this[portal_constants.PORTAL_TARGET_NAME_PROP])) {
58
58
  this.remove();
59
- throw new portal_target_error.PortalTargetError(`Portal target with name "${this.name}" already exists.`);
59
+ throw new portal_target_error.PortalTargetError(`Portal target with name "${this[portal_constants.PORTAL_TARGET_NAME_PROP]}" already exists.`);
60
60
  }
61
- HPortalTarget_1.portalTargetsNames.add(this.name);
61
+ HPortalTarget_1.portalTargetsNames.add(this[portal_constants.PORTAL_TARGET_NAME_PROP]);
62
62
  }
63
63
  };
64
64
  exports.HPortalTarget.portalTargetsNames = new Set();
@@ -2,13 +2,46 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib_es6 = require('../../../../external/tslib/tslib.es6.js');
5
6
  var lit = require('lit');
7
+ var phoenix_light_lit_elements_constants = require('./phoenix_light_lit_elements_constants.js');
8
+ var decorators = require('lit/decorators');
6
9
 
7
10
  class PhoenixLightLitElement extends lit.LitElement {
11
+ constructor() {
12
+ super();
13
+ this._slots = {};
14
+ }
15
+ connectedCallback() {
16
+ super.connectedCallback();
17
+ this._slots = this._assignSlots();
18
+ }
19
+ _assignSlots() {
20
+ return [...this.querySelectorAll('[slot]')].reduce((acc, $el) => {
21
+ var _a;
22
+ const slotName = $el.slot || phoenix_light_lit_elements_constants.DEFAULT_SLOT_NAME;
23
+ acc[slotName] = acc[slotName] || [];
24
+ acc[slotName].push(lit.html `${$el}`);
25
+ (_a = $el.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild($el);
26
+ $el.removeAttribute('slot');
27
+ return acc;
28
+ }, this._slots);
29
+ }
30
+ getSlot(name) {
31
+ try {
32
+ return this._slots[name];
33
+ }
34
+ catch (_a) { }
35
+ return lit.nothing;
36
+ }
8
37
  createRenderRoot() {
9
38
  return this;
10
39
  }
11
- }
40
+ }
41
+ tslib_es6.__decorate([
42
+ decorators.state(),
43
+ tslib_es6.__metadata("design:type", Object)
44
+ ], PhoenixLightLitElement.prototype, "_slots", void 0);
12
45
 
13
46
  exports.PhoenixLightLitElement = PhoenixLightLitElement;
14
47
  //# sourceMappingURL=phoenix_light_lit_element.js.map