@shoper/phoenix_design_system 0.2.1 → 0.2.2-2
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.
- package/build/cjs/external/lit-html/async-directive.js +16 -0
- package/build/cjs/external/lit-html/async-directive.js.map +1 -0
- package/build/cjs/external/lit-html/directive-helpers.js +14 -0
- package/build/cjs/external/lit-html/directive-helpers.js.map +1 -0
- package/build/cjs/external/lit-html/directive.js +15 -0
- package/build/cjs/external/lit-html/directive.js.map +1 -0
- package/build/cjs/external/lit-html/directives/ref.js +17 -0
- package/build/cjs/external/lit-html/directives/ref.js.map +1 -0
- package/build/cjs/external/lit-html/lit-html.js +14 -0
- package/build/cjs/external/lit-html/lit-html.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal.js +206 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js +65 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_body.js +19 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_body.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_close.js +41 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_close.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js +19 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_footer.js +19 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_footer.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_header.js +19 -0
- package/build/cjs/packages/phoenix/src/components/modal/modal_header.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/portal/portal.js +10 -5
- package/build/cjs/packages/phoenix/src/components/portal/portal.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js +3 -1
- package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/portal/portal_target.js +7 -7
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element.js +34 -1
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element.js.map +1 -1
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js +8 -0
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/index.js +45 -3
- package/build/cjs/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/external/lit-html/async-directive.js +12 -0
- package/build/esm/external/lit-html/async-directive.js.map +1 -0
- package/build/esm/external/lit-html/directive-helpers.js +10 -0
- package/build/esm/external/lit-html/directive-helpers.js.map +1 -0
- package/build/esm/external/lit-html/directive.js +9 -0
- package/build/esm/external/lit-html/directive.js.map +1 -0
- package/build/esm/external/lit-html/directives/ref.js +12 -0
- package/build/esm/external/lit-html/directives/ref.js.map +1 -0
- package/build/esm/external/lit-html/lit-html.js +9 -0
- package/build/esm/external/lit-html/lit-html.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +31 -0
- package/build/esm/packages/phoenix/src/components/modal/modal.js +204 -0
- package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.d.ts +12 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js +63 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_body.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_body.js +17 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_body.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_close.d.ts +8 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_close.js +39 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_close.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_constants.d.ts +9 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_constants.js +12 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_footer.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_footer.js +17 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_footer.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_header.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_header.js +17 -0
- package/build/esm/packages/phoenix/src/components/modal/modal_header.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/portal/portal.d.ts +1 -1
- package/build/esm/packages/phoenix/src/components/portal/portal.js +10 -5
- package/build/esm/packages/phoenix/src/components/portal/portal.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/portal/portal_constants.d.ts +3 -0
- package/build/esm/packages/phoenix/src/components/portal/portal_constants.js +3 -2
- package/build/esm/packages/phoenix/src/components/portal/portal_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/portal/portal_target.js +7 -7
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.d.ts +6 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.js +35 -2
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.js.map +1 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.d.ts +1 -0
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js +4 -0
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/index.d.ts +6 -0
- package/build/esm/packages/phoenix/src/index.js +7 -1
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- 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,206 @@
|
|
|
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.customClass = '';
|
|
19
|
+
this.transition = 'slide-in-top';
|
|
20
|
+
this._firstFocusableElement = undefined;
|
|
21
|
+
this._focusableElements = null;
|
|
22
|
+
this._lastFocusableElement = undefined;
|
|
23
|
+
this._contentRef = ref.createRef();
|
|
24
|
+
this._focusSentinelStart = ref.createRef();
|
|
25
|
+
this._focusSentinelEnd = ref.createRef();
|
|
26
|
+
this._propsChangeStrategies = {
|
|
27
|
+
[modal_constants.MODAL_OPENED_PROP]: {
|
|
28
|
+
true: () => {
|
|
29
|
+
const scrollY = window.scrollY;
|
|
30
|
+
HModal_1.openModals = [...HModal_1.openModals, this];
|
|
31
|
+
document.addEventListener('keydown', this._bindCloseOnEsc);
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = this._firstFocusableElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
35
|
+
window.scrollTo(0, scrollY);
|
|
36
|
+
}, 0);
|
|
37
|
+
},
|
|
38
|
+
false: () => {
|
|
39
|
+
HModal_1.openModals = HModal_1.openModals.filter((modal) => modal !== this);
|
|
40
|
+
document.removeEventListener('keydown', this._bindCloseOnEsc);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
this._keepFocusWithinModal = (ev) => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
const isTabPressed = ev.code === 'Tab';
|
|
47
|
+
if (isTabPressed) {
|
|
48
|
+
if (ev.shiftKey) {
|
|
49
|
+
if (document.activeElement === this._firstFocusableElement) {
|
|
50
|
+
(_a = this._lastFocusableElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
51
|
+
ev.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (document.activeElement === this._lastFocusableElement) {
|
|
55
|
+
(_b = this._firstFocusableElement) === null || _b === void 0 ? void 0 : _b.focus();
|
|
56
|
+
ev.preventDefault();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
this._handleCloseFromCloseComponent = (ev) => {
|
|
61
|
+
var _a;
|
|
62
|
+
ev.stopPropagation();
|
|
63
|
+
if ((_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.contains(ev.target)) {
|
|
64
|
+
this.close();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
this._bindCloseOnEsc = (ev) => {
|
|
68
|
+
ev.stopImmediatePropagation();
|
|
69
|
+
const closeConditions = [ev.key === 'Escape', ev.ctrlKey === false, ev.shiftKey === false, ev.altKey === false];
|
|
70
|
+
const shouldCloseModal = closeConditions.every((condition) => condition);
|
|
71
|
+
if (shouldCloseModal) {
|
|
72
|
+
const [modalToClose] = HModal_1.openModals.slice(-1);
|
|
73
|
+
modalToClose === null || modalToClose === void 0 ? void 0 : modalToClose.close();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
this.hidden = true;
|
|
77
|
+
this._focusableElements = [...this.querySelectorAll(modal_constants.FOCUSABLE_ELEMENTS_WITHIN_MODAL)];
|
|
78
|
+
}
|
|
79
|
+
static _appendModalsPortal() {
|
|
80
|
+
const $modalsPortalTarget = document.querySelector(`h-portal-target[name="${modal_constants.MODALS_PORTAL_NAME}"]`);
|
|
81
|
+
if (!$modalsPortalTarget) {
|
|
82
|
+
const $portalTarget = document.createElement('h-portal-target');
|
|
83
|
+
$portalTarget.setAttribute(portal_constants.PORTAL_TARGET_NAME_PROP, modal_constants.MODALS_PORTAL_NAME);
|
|
84
|
+
document.body.appendChild($portalTarget);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
static _appendModalsBackdrop() {
|
|
88
|
+
const $modalsBackdrop = document.querySelector('h-modal-backdrop');
|
|
89
|
+
if (!$modalsBackdrop) {
|
|
90
|
+
const $backdrop = document.createElement('h-modal-backdrop');
|
|
91
|
+
document.body.appendChild($backdrop);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
static isSomeModalOpen() {
|
|
95
|
+
return HModal_1.openModals.some((modal) => modal.opened);
|
|
96
|
+
}
|
|
97
|
+
connectedCallback() {
|
|
98
|
+
super.connectedCallback();
|
|
99
|
+
HModal_1._appendModalsPortal();
|
|
100
|
+
HModal_1._appendModalsBackdrop();
|
|
101
|
+
document.addEventListener('keydown', this._keepFocusWithinModal);
|
|
102
|
+
document.addEventListener(modal_constants.MODAL_EVENTS.close, this._handleCloseFromCloseComponent);
|
|
103
|
+
}
|
|
104
|
+
disconnectedCallback() {
|
|
105
|
+
super.disconnectedCallback();
|
|
106
|
+
document.removeEventListener(modal_constants.MODAL_EVENTS.close, this._handleCloseFromCloseComponent);
|
|
107
|
+
document.removeEventListener('keydown', this._bindCloseOnEsc);
|
|
108
|
+
}
|
|
109
|
+
firstUpdated() {
|
|
110
|
+
this._firstFocusableElement = this._focusSentinelStart.value;
|
|
111
|
+
this._lastFocusableElement = this._focusSentinelEnd.value;
|
|
112
|
+
}
|
|
113
|
+
updated(changedProps) {
|
|
114
|
+
if (changedProps.has(modal_constants.MODAL_OPENED_PROP)) {
|
|
115
|
+
this._propsChangeStrategies[modal_constants.MODAL_OPENED_PROP][String(this[modal_constants.MODAL_OPENED_PROP])]();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
open() {
|
|
119
|
+
var _a;
|
|
120
|
+
if (!this[modal_constants.MODAL_OPENED_PROP]) {
|
|
121
|
+
this[modal_constants.MODAL_OPENED_PROP] = true;
|
|
122
|
+
(_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_visible`, `modal_show-${this.transition}-start`);
|
|
123
|
+
window.requestAnimationFrame(() => {
|
|
124
|
+
setTimeout(() => {
|
|
125
|
+
var _a;
|
|
126
|
+
(_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_show-${this.transition}-end`);
|
|
127
|
+
}, 0);
|
|
128
|
+
const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
|
|
129
|
+
setTimeout(() => {
|
|
130
|
+
var _a;
|
|
131
|
+
(_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_show-${this.transition}-start`, `modal_show-${this.transition}-end`);
|
|
132
|
+
this._dispatchModalOpenedEvent();
|
|
133
|
+
}, transitionDuration);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
_dispatchModalOpenedEvent() {
|
|
138
|
+
const openModalEvent = new CustomEvent(modal_constants.MODAL_EVENTS.opened, {
|
|
139
|
+
bubbles: true
|
|
140
|
+
});
|
|
141
|
+
this.dispatchEvent(openModalEvent);
|
|
142
|
+
}
|
|
143
|
+
close() {
|
|
144
|
+
if (this[modal_constants.MODAL_OPENED_PROP]) {
|
|
145
|
+
const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
|
|
146
|
+
window.requestAnimationFrame(() => {
|
|
147
|
+
var _a, _b;
|
|
148
|
+
(_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`);
|
|
149
|
+
(_b = this._contentRef.value) === null || _b === void 0 ? void 0 : _b.classList.add(`modal_hide-${this.transition}-end`);
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
var _a;
|
|
152
|
+
(_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`, `modal_hide-${this.transition}-end`);
|
|
153
|
+
this[modal_constants.MODAL_OPENED_PROP] = false;
|
|
154
|
+
this._dispatchModalClosedEvent();
|
|
155
|
+
}, transitionDuration);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
_dispatchModalClosedEvent() {
|
|
160
|
+
const closeModalEvent = new CustomEvent(modal_constants.MODAL_EVENTS.closed, {
|
|
161
|
+
bubbles: true
|
|
162
|
+
});
|
|
163
|
+
this.dispatchEvent(closeModalEvent);
|
|
164
|
+
}
|
|
165
|
+
render() {
|
|
166
|
+
return lit.html `
|
|
167
|
+
<h-portal ?disabled="${!this.opened}" to="${modal_constants.MODALS_PORTAL_NAME}" hidden>
|
|
168
|
+
<div tabindex="0" ${ref.ref(this._focusSentinelStart)}></div>
|
|
169
|
+
<div ${ref.ref(this._contentRef)} class="modal ${this.customClass}" role="dialog">
|
|
170
|
+
<div class="modal__container">${this.getSlot('header')} ${this.getSlot('default')} ${this.getSlot('footer')}</div>
|
|
171
|
+
</div>
|
|
172
|
+
<div tabindex="0" ${ref.ref(this._focusSentinelEnd)}></div>
|
|
173
|
+
</h-portal>
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
exports.HModal.openModals = [];
|
|
178
|
+
tslib_es6.__decorate([
|
|
179
|
+
decorators.property({ type: Boolean, reflect: true }),
|
|
180
|
+
tslib_es6.__metadata("design:type", Object)
|
|
181
|
+
], exports.HModal.prototype, "opened", void 0);
|
|
182
|
+
tslib_es6.__decorate([
|
|
183
|
+
decorators.property({ type: String }),
|
|
184
|
+
tslib_es6.__metadata("design:type", Object)
|
|
185
|
+
], exports.HModal.prototype, "customClass", void 0);
|
|
186
|
+
tslib_es6.__decorate([
|
|
187
|
+
decorators.property({ type: String }),
|
|
188
|
+
tslib_es6.__metadata("design:type", Object)
|
|
189
|
+
], exports.HModal.prototype, "transition", void 0);
|
|
190
|
+
tslib_es6.__decorate([
|
|
191
|
+
decorators.state(),
|
|
192
|
+
tslib_es6.__metadata("design:type", Object)
|
|
193
|
+
], exports.HModal.prototype, "_firstFocusableElement", void 0);
|
|
194
|
+
tslib_es6.__decorate([
|
|
195
|
+
decorators.state(),
|
|
196
|
+
tslib_es6.__metadata("design:type", Object)
|
|
197
|
+
], exports.HModal.prototype, "_focusableElements", void 0);
|
|
198
|
+
tslib_es6.__decorate([
|
|
199
|
+
decorators.state(),
|
|
200
|
+
tslib_es6.__metadata("design:type", Object)
|
|
201
|
+
], exports.HModal.prototype, "_lastFocusableElement", void 0);
|
|
202
|
+
exports.HModal = HModal_1 = tslib_es6.__decorate([
|
|
203
|
+
decorators.customElement('h-modal'),
|
|
204
|
+
tslib_es6.__metadata("design:paramtypes", [])
|
|
205
|
+
], exports.HModal);
|
|
206
|
+
//# 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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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(
|
|
27
|
-
|
|
28
|
-
|
|
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 (
|
|
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
|
|
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.
|
|
51
|
+
HPortalTarget_1.portalTargetsNames.delete(this[portal_constants.PORTAL_TARGET_NAME_PROP]);
|
|
52
52
|
}
|
|
53
53
|
doesDestinationMatch(destination) {
|
|
54
|
-
return destination === this.
|
|
54
|
+
return destination === this[portal_constants.PORTAL_TARGET_NAME_PROP];
|
|
55
55
|
}
|
|
56
56
|
allowOnlyOnePortalTargetWithName() {
|
|
57
|
-
if (HPortalTarget_1.portalTargetsNames.has(this.
|
|
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.
|
|
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.
|
|
61
|
+
HPortalTarget_1.portalTargetsNames.add(this[portal_constants.PORTAL_TARGET_NAME_PROP]);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
exports.HPortalTarget.portalTargetsNames = new Set();
|