@genesislcap/design-system-configurator 14.92.3 → 14.92.4

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.
@@ -169,7 +169,7 @@
169
169
  `)}
170
170
  `;class V extends s.Avatar{}const U={delegatesFocus:!0,mode:"open"},Y={media:z},W=V.compose(Object.assign({baseName:"avatar",template:G,styles:B,shadowOptions:U},Y)),q=(e,t)=>l.css`
171
171
  ${(0,s.badgeStyles)(e,t)}
172
- `,X=(e,t)=>(0,n.badgeTemplate)(e,t);class K extends s.Badge{}const Z=void 0,Q={},J=K.compose(Object.assign({baseName:"badge",template:X,styles:q,shadowOptions:Z},Q));var ee=o(30299);const te=(0,ee.createLogger)("foundation-ui"),oe=l.css`
172
+ `,X=(e,t)=>(0,n.badgeTemplate)(e,t);class K extends s.Badge{}const Z=void 0,Q={},J=K.compose(Object.assign({baseName:"badge",template:X,styles:q,shadowOptions:Z},Q));var ee=o(49235);const te=(0,ee.createLogger)("foundation-ui"),oe=l.css`
173
173
  @keyframes delete-animate {
174
174
  from {
175
175
  height: 100px;
@@ -244,16 +244,19 @@
244
244
  <div class="banner ${e=>e.dismissAnimation}" ${(0,l.ref)("banner")}>
245
245
  <div part="content" class="content">
246
246
  <slot name="content">
247
- <div>
248
- <div>${e=>{var t;return(null===(t=e.notification)||void 0===t?void 0:t.body)||"Place holder for notification message"}}</div>
249
- </div>
247
+ ${(0,l.when)((e=>e.notification),l.html`
248
+ <div>
249
+ <div>${e=>{var t;return(null===(t=e.notification)||void 0===t?void 0:t.body)||"Place holder for notification message"}}</div>
250
+ </div>
251
+ `)}
250
252
  </slot>
251
253
  </div>
252
254
  <div part="action" class="action">
253
255
  <slot name="action" class="action">
256
+ ${(0,l.when)((e=>e.notification),l.html`
254
257
  <${e}-button slot="action" appearance="lightweight" @click=${e=>e.dismiss()}>
255
258
  ${e=>{var t,o,i,a;return(null===(a=null===(i=null===(o=null===(t=e.notification)||void 0===t?void 0:t.config)||void 0===o?void 0:o.banner)||void 0===i?void 0:i.dismissingAction)||void 0===a?void 0:a.label)||"Ignore"}}
256
- </${e}-button>
259
+ </${e}-button>`)}
257
260
  ${(0,l.repeat)((e=>{var t,o;return null===(o=null===(t=e.notification)||void 0===t?void 0:t.config)||void 0===o?void 0:o.banner.confirmingActions}),l.html`
258
261
  <${e}-button
259
262
  slot="action"
@@ -630,16 +633,20 @@
630
633
  `)}
631
634
  </div>
632
635
  <slot>
633
- <div class="details">
634
- ${e=>{var t;return(null===(t=e.notification)||void 0===t?void 0:t.body)||"Place holder for notification message"}}
635
- </div>
636
+ ${(0,l.when)((e=>e.notification),l.html`
637
+ <div class="details">
638
+ ${e=>{var t;return(null===(t=e.notification)||void 0===t?void 0:t.body)||"Place holder for notification message"}}
639
+ </div>
640
+ `)}
636
641
  </slot>
637
642
  <div part="bottom" class="bottom">
638
643
  <slot name="bottom">
639
- <${e}-button appearance="lightweight" @click=${e=>{e.dismiss()}}>
640
- ${e=>{var t,o,i,a;return(null===(a=null===(i=null===(o=null===(t=e.notification)||void 0===t?void 0:t.config)||void 0===o?void 0:o.dialog)||void 0===i?void 0:i.dismissingAction)||void 0===a?void 0:a.label)||"Ignore"}}
641
- </${e}-button>
642
- ${(0,l.repeat)((e=>{var t,o;return null===(o=null===(t=e.notification)||void 0===t?void 0:t.config)||void 0===o?void 0:o.dialog.confirmingActions}),l.html`
644
+ ${(0,l.when)((e=>e.notification),l.html`
645
+ <${e}-button appearance="lightweight" @click=${e=>{e.dismiss()}}>
646
+ ${e=>{var t,o,i,a;return(null===(a=null===(i=null===(o=null===(t=e.notification)||void 0===t?void 0:t.config)||void 0===o?void 0:o.dialog)||void 0===i?void 0:i.dismissingAction)||void 0===a?void 0:a.label)||"Ignore"}}
647
+ </${e}-button>
648
+ `)}
649
+ ${(0,l.repeat)((e=>{var t,o;return null===(o=null===(t=e.notification)||void 0===t?void 0:t.config)||void 0===o?void 0:o.dialog.confirmingActions}),l.html`
643
650
  <${e}-button
644
651
  appearance="lightweight"
645
652
  @click=${(e,t)=>{null==e||e.action(),t.parent.closeDialog()}}
@@ -2387,4 +2394,4 @@
2387
2394
  <slot></slot>
2388
2395
  </template>
2389
2396
  `;var xd;!function(e){e.NOTIFICATION_EVENT="notification-event"}(xd||(xd={}));const Fd=e=>{var t,o;return`${null!==(t=null==e?void 0:e.title)&&void 0!==t?t:"Error"}: ${null!==(o=null==e?void 0:e.body)&&void 0!==o?o:"Something went wrong"}`},$d=(e,t)=>{const o=t.split("-")[0];let i=document.querySelector(`#${e}`);if(!i){i=document.createElement("div"),i.setAttribute("id",e);const t=document.createElement(`${o}-design-system-provider`);t.appendChild(i),document.body.appendChild(t)}return i},Sd=()=>{const e=document.createElement("div");return e.setAttribute("id","banner-anchor"),e.style.position="relative",document.body.insertBefore(e,document.body.firstChild),e},Cd=(0,ee.createLogger)("foundation-notifications"),Dd={alert:e=>{alert(Fd(e))},toast:(e,t)=>{var o,i,a,n,s,l,r,d,c,u,p,h,m,v,g,f,b,y;const w=t.split("-")[0],x=$d("notify-container",t);if(x)switch(x.style.position="fixed",null===(i=null===(o=null==e?void 0:e.config)||void 0===o?void 0:o.toast)||void 0===i?void 0:i.position){case"top-left":x.style.top="0",x.style.left="0";break;case"bottom-left":x.style.bottom="0",x.style.left="0";break;case"bottom-right":x.style.bottom="0",x.style.right="0";break;default:x.style.top="0",x.style.right="0"}const F=document.createElement(`${w}-toast`),$=document.createElement("div");$.setAttribute("slot","top"),$.textContent=e.title;const S=document.createElement("div");S.setAttribute("slot","content"),S.textContent=(null==e?void 0:e.body)||"";const C=document.createElement("div");let D;C.setAttribute("slot","date"),C.textContent=(null===(a=null==e?void 0:e.createdAt)||void 0===a?void 0:a.toLocaleTimeString())||"",(null===(s=null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.toast)||void 0===s?void 0:s.buttons)&&(null===(d=null===(r=null===(l=null==e?void 0:e.config)||void 0===l?void 0:l.toast)||void 0===r?void 0:r.buttons)||void 0===d?void 0:d.length)&&(D=document.createElement("div"),D.setAttribute("slot","bottom"),e.config.toast.buttons.forEach((t=>{const o=document.createElement(`${w}-button`);o.textContent=t.placeholder||"example placeholder",o.addEventListener("click",(()=>{const{details:i}=e.config.toast;if(t.action)return t.action({details:i,buttonElement:o,toastElement:F})})),t.appearance&&o.setAttribute("appearance",t.appearance),D.appendChild(o)}))),F.setAttribute("notify",(null===(u=null===(c=null==e?void 0:e.config)||void 0===c?void 0:c.toast)||void 0===u?void 0:u.type)||""),(null===(h=null===(p=null==e?void 0:e.config)||void 0===p?void 0:p.toast)||void 0===h?void 0:h.autoClose)&&F.setAttribute("auto-close",`${null===(v=null===(m=null==e?void 0:e.config)||void 0===m?void 0:m.toast)||void 0===v?void 0:v.autoClose}`),(null===(f=null===(g=null==e?void 0:e.config)||void 0===g?void 0:g.toast)||void 0===f?void 0:f.closeTimeout)&&F.setAttribute("close-timeout",`${null===(y=null===(b=null==e?void 0:e.config)||void 0===b?void 0:b.toast)||void 0===y?void 0:y.closeTimeout}`),F.appendChild($),F.appendChild(S),F.appendChild(C),D&&F.appendChild(D),x.appendChild(F)},dialog:(e,t)=>{const o=t.split("-")[0],i=document.createElement(`${o}-dialog`);$d("dialog-container",t).appendChild(i),i.notification=e,i.show()},snackbar:(e,t)=>{const o=t.split("-")[0],i=document.createElement(`${o}-snackbar`);$d("snack-container",t).appendChild(i),i.notification=e},banner:(e,t,o)=>{var i;const a=t.split("-")[0],n=document.createElement(`${a}-banner`),s=(e=>{for(var t,o;e&&!(e instanceof ShadowRoot);){const i=null===(t=null==e?void 0:e.getRootNode())||void 0===t?void 0:t.getElementById("banner-anchor");if(i)return i.style.position="relative",i;e=null===(o=null==e?void 0:e.getRootNode())||void 0===o?void 0:o.host}return Sd()})(o);(null===(i=null==s?void 0:s.children)||void 0===i?void 0:i.length)>0&&(n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.width="100%"),s.appendChild(n),n.notification=e}},_d=(e,t,o)=>{var i,a;Cd.log({message:Fd(e),level:(i=e,(null==i?void 0:i.logLevel)||(null===(a=null==i?void 0:i.config)||void 0===a?void 0:a.logLevel)||ee.LogLevel.Debug)});Object.keys((null==e?void 0:e.config)||{}).forEach((i=>{Dd[i]&&Dd[i](e,t,o)}))};class Od{withTitle(e){return this.title=e,this}withBody(e){return this.body=e,this}withCreatedAt(e){return this.createdAt=e,this}withLogLevel(e){return this.logLevel=e,this}withAlert(e){return this.alert=e,this}withToast(e){return this.toast=e,this}withBanner(e){return this.banner=e,this}withSnackbar(e){return this.snackbar=e,this}withDialog(e){return this.dialog=e,this}build(){if(!this.title)throw new Error("Title is required");if(!this.body)throw new Error("Missing required param 'body'");let e={title:this.title,body:this.body},t={};return this.createdAt&&(e=Object.assign({createdAt:this.createdAt},e)),this.logLevel in ee.LogLevel&&(e=Object.assign({logLevel:this.logLevel},e)),this.alert&&(t=Object.assign({alert:this.alert},t),e=Object.assign({config:t},e)),this.toast&&(t=Object.assign({toast:this.toast},t),e=Object.assign({config:t},e)),this.banner&&(t=Object.assign({banner:this.banner},t),e=Object.assign({config:t},e)),this.snackbar&&(t=Object.assign({snackbar:this.snackbar},t),e=Object.assign({config:t},e)),this.dialog&&(t=Object.assign({dialog:this.dialog},t),e=Object.assign({config:t},e)),e}}class kd{withPosition(e){return this.position=e,this}withAutoClose(e){return this.autoClose=e,this}withCloseTimeout(e){return this.closeTimeout=e,this}withType(e){return this.type=e,this}withDetails(e){return this.details=e,this}withButtons(e){return this.buttons=e,this}build(){let e={};return this.position&&(e=Object.assign({position:this.position},e)),this.autoClose&&(e=Object.assign({autoClose:this.autoClose},e)),this.closeTimeout&&(e=Object.assign({closeTimeout:this.closeTimeout},e)),this.type&&(e=Object.assign({type:this.type},e)),this.details&&(e=Object.assign({details:this.details},e)),this.buttons&&(e=Object.assign({buttons:this.buttons},e)),e}}const Td={mode:"open",delegatesFocus:!0};class Ld extends n.FoundationElement{constructor(){super(...arguments),this.closeTimeout=0,this.toastButtons=[]}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t;return(0,w.__awaiter)(this,void 0,void 0,(function*(){e.connectedCallback.call(this),this.addEventListener(xd.NOTIFICATION_EVENT,(e=>{e.stopImmediatePropagation(),_d(e.detail,this.tagName,this.notificationListener)})),this.resourceName&&(yield this.datasource.init({resourceName:this.resourceName},!0),null===(t=this.datasource.stream)||void 0===t||t.subscribe((e=>{e.ROW&&e.SEQUENCE_ID>1&&this.handleStreamUpdate((0,gd.$)(e))})))}))}handleStreamUpdate(e){const t=e.inserts;t.length>0&&t.forEach((e=>{var t;const{HEADER:o,MESSAGE:i,NOTIFY_SEVERITY:a}=e,n=e.CREATED_AT?new Date(e.CREATED_AT):void 0,s=e.EXPIRY?e.EXPIRY-e.CREATED_AT:0;let l=[];this.toastButtons&&this.toastButtons.length>0&&(l=this.toastButtons.filter((({condition:t})=>!t||t({details:e})))),_d((new Od).withTitle(o).withBody(i).withCreatedAt(n).withToast((new kd).withDetails(e).withType(null==a?void 0:a.toLowerCase()).withButtons(l).withAutoClose(null!==(t=!!s)&&void 0!==t?t:!!this.closeTimeout).withCloseTimeout(null!=s?s:this.closeTimeout).build()).build(),this.tagName,this.notificationListener)}))}}(0,w.__decorate)([l.observable],Ld.prototype,"notificationListener",void 0),(0,w.__decorate)([(0,l.attr)({attribute:"resource-name"})],Ld.prototype,"resourceName",void 0),(0,w.__decorate)([(0,l.attr)({attribute:"close-timeout",converter:l.nullableNumberConverter})],Ld.prototype,"closeTimeout",void 0),(0,w.__decorate)([l.observable],Ld.prototype,"toastButtons",void 0),(0,w.__decorate)([mi.Yh],Ld.prototype,"datasource",void 0);const Ad=Ld.compose({baseName:"notification-listener",template:wd,shadowOptions:Td});var Rd;let Ed=Rd=class extends bd{constructor(){super(...arguments),this.optionElement="fast-option",this.isSnapshot=!0}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t;return(0,w.__awaiter)(this,void 0,void 0,(function*(){e.connectedCallback.call(this),this.fields=this.labelField?null===(t=this.valueField)||void 0===t?void 0:t.concat(" ",this.labelField):this.valueField,this.select=this.parentElement,this.select.addEventListener("change",(e=>{const t=this.options.find((t=>t.label===e.target.value));this.select.$emit("value-change",t)})),this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&this.fetchGenesisData(),this.valueField||te.warn('Specify field for values in options (e.g value-field="VALUE") and optionally field for label (e.g label-field="NAME")')}))}clearData(){Array.from(this.select.children).forEach((e=>{e instanceof Rd||this.select.removeChild(e)})),this.select.value="",this.select.initialValue=""}syncComponentData(e){var t;const o=null!=e?e:Array.from(this.rowsSyncedWithStream.values());this.options=o.map((e=>({value:e[this.valueField],label:this.labelFormatter?this.labelFormatter(e[this.labelField]):e[this.labelField]})));this.options.map((({value:e,label:t})=>{const o=document.createElement(this.optionElement);return o.textContent=t||e,o.value=e,o})).forEach((e=>{this.select.appendChild(e)}));const i=this.initialSelectedValue||0===this.initialSelectedValue?null===(t=this.options.find((e=>e.value===this.initialSelectedValue)))||void 0===t?void 0:t.label:"";l.DOM.queueUpdate((()=>{this.select.value=i}))}handleStreamInserts(e){te.debug("handleStreamInserts - Method not implemented.")}handleStreamDeletes(e){te.debug("handleStreamDeletes - Method not implemented.")}handleStreamUpdates(e){te.debug("handleStreamUpdates - Method not implemented.")}};(0,w.__decorate)([(0,l.attr)({attribute:"label-field"})],Ed.prototype,"labelField",void 0),(0,w.__decorate)([(0,l.attr)({attribute:"value-field"})],Ed.prototype,"valueField",void 0),(0,w.__decorate)([l.observable],Ed.prototype,"labelFormatter",void 0),Ed=Rd=(0,w.__decorate)([(0,l.customElement)({name:"options-datasource"})],Ed);let Nd=class extends bd{constructor(){super(...arguments),this.isSnapshot=!0}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t;return(0,w.__awaiter)(this,void 0,void 0,(function*(){e.connectedCallback.call(this),this.fields=this.labelField?null===(t=this.valueField)||void 0===t?void 0:t.concat(" ",this.labelField):this.valueField,this.select=this.parentElement,this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&this.fetchGenesisData(),this.valueField||te.warn('Specify field for values in options (e.g value-field="VALUE") and optionally field for label which is supported only in select and combobox (e.g label-field="NAME")')}))}clearData(){this.select.options=[]}syncComponentData(e){const t=(null!=e?e:Array.from(this.rowsSyncedWithStream.values())).map((e=>({value:e[this.valueField],label:e[this.labelField]})));this.select.options=t}handleStreamInserts(e){te.debug("handleStreamInserts - Method not implemented.")}handleStreamDeletes(e){te.debug("handleStreamDeletes - Method not implemented.")}handleStreamUpdates(e){te.debug("handleStreamUpdates - Method not implemented.")}};(0,w.__decorate)([(0,l.attr)({attribute:"value-field"})],Nd.prototype,"valueField",void 0),(0,w.__decorate)([(0,l.attr)({attribute:"label-field"})],Nd.prototype,"labelField",void 0),Nd=(0,w.__decorate)([(0,l.customElement)({name:"multiselect-datasource"})],Nd);const Md=(e,t)=>o=>{const i="function"==typeof t?t:(a=t,e=>Object.assign(Object.assign({},a),e));var a;return l.FASTElement.define(class extends e{},i(o))};function Id(e){if("string"==typeof e)return e;if("function"==typeof e&&!(e=l.FASTElementDefinition.forType(e)))throw new Error("Missing FASTElement definition.");return e.name}var Pd=o(1279);let Hd=class extends(Pd.F0.from(l.FASTElement)){connectedCallback(){super.connectedCallback(),l.DOM.queueUpdate((()=>(0,w.__awaiter)(this,void 0,void 0,(function*(){this.$router.config=this.config}))))}};Hd=(0,w.__decorate)([(0,l.customElement)({name:"foundation-router"})],Hd);const jd=()=>ud().register(dd)}}]);
2390
- //# sourceMappingURL=701.12b13f7327a6c83702b37b8598afc1e3.js.map
2397
+ //# sourceMappingURL=701.b2cfeaa6d319cae6bea875db80ac3adb.js.map