@genesislcap/design-system-configurator 15.96.3-GENC-1640.2 → 15.97.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.
- package/dist/{249.249.dda2352e74ae3698198a.js → 249.249.ae734bbba85331b942c3.js} +2 -2
- package/dist/249.da8d7567b6fd9c7cb5c05d5e25e3c06b.js.map +1 -0
- package/dist/{designSystemConfigurator.4cd6922293ded0ad2ab0226e630ee3db.js.map → designSystemConfigurator.a12840b77d29adf2b09a1f405a0fd532.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/{main.31b8d849ab3abbfa3229.js → main.5f757940641238a9998a.js} +2 -2
- package/dist/{main.c01a963ea4dbaff0ee6912e241c47389.js.map → main.67c682c01dbbe5a2fdfbd4e5d5f926c1.js.map} +1 -1
- package/dist/remoteEntry.js +2 -2
- package/package.json +11 -11
- package/dist/249.535bc8a2d59af88efe992d93b876ee80.js.map +0 -1
|
@@ -6688,7 +6688,7 @@ class="margin"
|
|
|
6688
6688
|
<template ${(0,l.ref)("notificationListener")}>
|
|
6689
6689
|
<slot></slot>
|
|
6690
6690
|
</template>
|
|
6691
|
-
`,Wg={mode:"open",delegatesFocus:!0};class qg extends a.FoundationElement{constructor(){super(...arguments),this.closeTimeout=0,this.toastButtons=[],this.reconnections=0,this.reconnection=Promise.resolve(),this.reconnectionWaitMs=1e4}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return(0,C.sH)(this,void 0,void 0,function*(){e.connectedCallback.call(this),this.addEventListener(ye.NOTIFICATION_EVENT,e=>{e.stopImmediatePropagation(),Te(e.detail,this.tagName,this.notificationListener)}),this.connectionSub=this.connect.isConnected$.subscribe(e=>{if(!e)return;const t=this.reconnections+=1;var i,o;this.reconnection=(i=this.reconnection,o=this.reconnectionWaitMs,new Promise(e=>{const t=setTimeout(e,o);i.finally(()=>{clearTimeout(t),e()})})).then(()=>this.handleReconnection(t)).catch(e=>dt.error(e))})})}handleReconnection(e){return(0,C.sH)(this,void 0,void 0,function*(){var t;const i=()=>e===this.reconnections&&this.isConnected;if(!this.resourceName||!i())return;null===(t=this.dataSub)||void 0===t||t.unsubscribe(),this.dataSub=void 0;const o=yield this.initializeDatasource();if(i()){if(!o)throw new Error(`Failed to initialize datasource for ${this.resourceName}`);this.setupDataSubscription()}})}initializeDatasource(){return(0,C.sH)(this,void 0,void 0,function*(){var e;return(null===(e=this.datasource)||void 0===e?void 0:e.initialized)&&this.datasource.destroy(),this.datasource.init({resourceName:this.resourceName},!0)})}setupDataSubscription(){this.datasource.stream?this.dataSub=this.datasource.stream.subscribe(e=>{e.ROW&&e.SEQUENCE_ID>1&&this.handleStreamUpdate((0,mi.d)(e))}):dt.warn(`No stream available for ${this.resourceName}`)}disconnectedCallback(){var e,t,i;super.disconnectedCallback(),null===(e=this.dataSub)||void 0===e||e.unsubscribe(),delete this.dataSub,null===(t=this.connectionSub)||void 0===t||t.unsubscribe(),delete this.connectionSub,null===(i=this.datasource)||void 0===i||i.destroy(),delete this.datasource}handleStreamUpdate(e){const t=e.inserts;t.length>0&&t.forEach(e=>{this.showNotificationToast(e)})}showNotificationToast(e){const{HEADER:t,MESSAGE:i,NOTIFY_SEVERITY:o}=e,n=e.CREATED_AT?new Date(e.CREATED_AT):void 0,s=e.EXPIRY?e.EXPIRY-e.CREATED_AT:void 0;let a=[];this.toastButtons&&this.toastButtons.length>0&&(a=this.toastButtons.filter(({condition:t})=>!t||t({details:e})));const r={title:t,body:i,createdAt:n,toast:{details:e,type:null==o?void 0:o.toLowerCase(),buttons:a,autoClose:void 0!==s?!!s:!!this.closeTimeout,closeTimeout:null!=s?s:this.closeTimeout,position:this.toastPosition}};$c(r,this.tagName)}}(0,C.Cg)([l.observable],qg.prototype,"notificationListener",void 0),(0,C.Cg)([bi.dm],qg.prototype,"connect",void 0),(0,C.Cg)([(0,l.attr)({attribute:"resource-name"})],qg.prototype,"resourceName",void 0),(0,C.Cg)([(0,l.attr)({attribute:"close-timeout",converter:l.nullableNumberConverter})],qg.prototype,"closeTimeout",void 0),(0,C.Cg)([l.observable],qg.prototype,"toastButtons",void 0),(0,C.Cg)([(0,l.attr)({attribute:"toast-position"})],qg.prototype,"toastPosition",void 0),(0,C.Cg)([yi.yW],qg.prototype,"datasource",void 0);const Kg=qg.compose({baseName:"notification-listener",template:Yg,shadowOptions:Wg}),Xg=(e,t)=>i=>{const o="function"==typeof t?t:(n=t,e=>Object.assign(Object.assign({},n),e));var n;return l.FASTElement.define(class extends e{},o(i))};function Jg(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 Qg;!function(e){e.controlClicked="controlClicked",e.routeChanged="routeChanged"}(Qg||(Qg={}));class Zg{trackEvent(e,t){Qs.v.debug(`FoundationAnalytics.trackEvent ${e} : ${JSON.stringify(t)}`)}}const ef=a.DI.createInterface(e=>e.singleton(Zg));var tf=i(98647),of=i(35044);const nf=(0,lt.createLogger)("foundation-router");var sf=i(36132),af=i(80751),rf=i(3479);const lf="$router",df=Object.freeze({getOrCreateFor:e=>{const t=e[lf];return void 0!==t?t:e[lf]=new cf(e)},find:e=>rf.Ix.find(e),from:e=>rf.Ix.from(e)});class cf extends rf.LK{}const uf=/^([a-z][a-z0-9+\-.]*:)?\/\//i;function hf(e){return uf.test(e)}function pf(e){return e.config instanceof tf.Y?e:df.find(e)}function mf(e){return pf(e).parent}function vf(e){let t=pf(e);for(;t&&t.level>0;)t=t.parent;return t}function gf(e,t="/",i=!1){const o=e.join(t).replace(new RegExp(t+"{1,}","g"),t);return!i&&o.endsWith(t)?o.slice(0,-1):o}function ff(e,t="/"){const i=e.split(t);return 2===i.length&&""===i[0]&&""!==i[1]?e:(i.length>1&&i.pop(),i.join(t))}function bf(e){return e.replace(`/*${af.N}`,"")}function yf(){null===document.querySelector("foundation-router, fast-router")&&window.dispatchEvent(new PopStateEvent("popstate"))}const wf=Object.freeze({path:Object.freeze({get current(){return sf.qh.path.current},generateRoute:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={}){let o=pf(e);for(;null!==o;){const e=yield o.config.generateRouteFromPath(t,i);if(null!==e)return e;o=o.parent}return null}),push:(e,t=!0)=>{e&&hf(e)?location.href=e:(history.pushState({},document.title,e),yf(),t&&wf.path.trigger(e))},replace:(e,t=!0)=>{e&&hf(e)?location.href=e:(history.replaceState({},document.title,e),yf(),t&&wf.path.trigger(e))},trigger:e=>{sf.qh.path.trigger(e)}}),name:Object.freeze({generateRoute:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={}){let o=pf(e);for(;null!==o;){const e=yield o.config.generateRouteFromName(t,i);if(null!==e)return e;o=o.parent}return null}),push:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={},o=!0){const n=yield wf.name.generateRoute(e,t,i);null!==n&&wf.path.push(n,o)}),replace:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={},o=!0){const n=yield wf.name.generateRoute(e,t,i);null!==n&&wf.path.replace(n,o)}),trigger:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={}){const o=yield wf.name.generateRoute(e,t,i);null!==o&&wf.path.trigger(o)})})}),Cf=e=>!e.navId||"header"===e.navId||"side-nav"===e.navId,xf=10;function $f(e,t=Cf,i=xf){const o=[];return e.filter(e=>e.navItems&&e.navItems.some(t)).forEach((e,n)=>{e.navItems.filter(t).map((t,o)=>{var s,a,r,l;const d=null!==(s=t.placementIndex)&&void 0!==s?s:n*i+o;return Object.assign(Object.assign({},t),{navId:null!==(a=t.navId)&&void 0!==a?a:"header",placementIndex:d,routePath:null!==(r=t.routePath)&&void 0!==r?r:e.path,routeName:null!==(l=t.routeName)&&void 0!==l?l:e.name})}).forEach(e=>o.push(e))}),o.sort((e,t)=>e.placementIndex-t.placementIndex)}class Sf extends af.s{constructor(){super(...arguments),this.definitions=[]}map(...e){const t=this.owner,i=!t.parent,o=t.basename;i&&(""!==o&&"/"!==o)&&(nf.debug("Route paths remap required due to detected sub-path deployment"),e=e.map(e=>{if(!e.path)return e;if(e.path.startsWith(o))return nf.debug(`'${e.path}' path okay as is`),e;const t="/"!==e.path.charAt(0)?"/":"",i=`${o}${t}${e.path}`;return nf.debug(`'${e.path}' path modified to '${i}'`),Object.assign(Object.assign({},e),{path:i})})),this.definitions=[...e,...this.definitions],super.map(...e)}}(0,C.Cg)([l.observable],Sf.prototype,"definitions",void 0);class Ef extends tf.Y{constructor(){super(),this.logger=nf,this.loginPath="login",this.notFoundPath="not-found",this.notPermittedPath="not-permitted",this.routes=new Sf(this),this.basename=as.OB,this.routes=new Sf(this)}getNavItems(e=Cf){return $f(this.routes.definitions,e)}configureAnalytics(){this.contributors.push({navigate:e=>(0,C.sH)(this,void 0,void 0,function*(){this.analytics.trackEvent(Qg.routeChanged,{path:e.route.endpoint.path})})})}configureRoutePermittedChecks(){this.contributors.push({navigate:e=>(0,C.sH)(this,void 0,void 0,function*(){var t;const{settings:i}=e.route;!1===(null===(t=null==i?void 0:i.isPermitted)||void 0===t?void 0:t.call(i))&&e.cancel(()=>{var t,o;if(this.user.isAuthenticated){const n=null!==(o=null===(t=i.notPermittedPath)||void 0===t?void 0:t.call(i))&&void 0!==o?o:this.notPermittedPath;this.logger.debug(`User not permitted to access route. Re-routing to ${n}.`),wf.name.replace(e.router,n)}else this.user.trackPath(),wf.name.replace(e.router,this.loginPath)})})})}configureFallbackRouteDefinition(){this.routes.fallback(()=>{let e={redirect:this.notFoundPath};return this.user.isAuthenticated||(this.user.trackPath(),this._session.captureReturnUrl(),e={redirect:this.loginPath}),this.logger.debug(`Route unresolved. Re-routing to ${e.redirect}.`),e})}navigationPhaseLoginRedirect(e){e.cancel(()=>{this.user.trackPath(),this._session.captureReturnUrl(),wf.name.replace(e.router,this.loginPath)})}generateRouteFromName(e,t){const i=Object.create(null,{generateRouteFromName:{get:()=>super.generateRouteFromName}});return(0,C.sH)(this,void 0,void 0,function*(){const o=yield i.generateRouteFromName.call(this,e,t);return o?this.generateNavigationPath(o):null})}navigateTo(e){return(0,C.sH)(this,void 0,void 0,function*(){if(e.name)return this.relativeTo||this.logger.error("unable to navigate by name as the relativeTo router is not set"),void(yield wf.name.push(this.relativeTo,e.name,e.params,e.trigger));e.path&&wf.path.push(this.generateNavigationPath(e.path,e.params),e.trigger)})}generateNavigationPath(e,t){const i=this.getNavigationPathBasename(),o=of.C.build(t);let n=i&&!e.startsWith(i)?gf([i,e]):e;return n=o?`${n}?${o}`:n,n}getNavigationPathBasename(){var e,t;const i=this.parent,o=null===(t=null===(e=null==i?void 0:i.relativeTo)||void 0===e?void 0:e.route)||void 0===t?void 0:t.endpoint.route.path;return o?bf(o):this.basename?this.basename:""}construct(e){return this.container.get(e)}}(0,C.Cg)([a.Container],Ef.prototype,"container",void 0),(0,C.Cg)([ef],Ef.prototype,"analytics",void 0),(0,C.Cg)([nd.KJ],Ef.prototype,"user",void 0),(0,C.Cg)([Ni.N],Ef.prototype,"_session",void 0);const Of="navigate-to",Tf="generate-navigation-path";let kf=class extends(df.from(l.FASTElement)){constructor(){super(...arguments),this.logger=nf,this.onNavigateTo=e=>{e.stopImmediatePropagation(),this.config.navigateTo(e.detail)},this.onGenerateNavigationPath=e=>{e.stopImmediatePropagation();const{path:t,params:i,callback:o}=e.detail;if(!o)return;o(this.config.generateNavigationPath(t,i))}}get router(){return this[lf]}connectedCallback(){var e,t;super.connectedCallback(),this.config.isConfigured||(null!==(e=(t=this.config).relativeTo)&&void 0!==e||(t.relativeTo=this.router),l.DOM.queueUpdate(()=>(0,C.sH)(this,void 0,void 0,function*(){this.router.config?this.router.connect():this.router.config=this.config})),this.addEventListeners())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListeners()}addEventListeners(){this.addEventListener(Of,this.onNavigateTo),this.addEventListener(Tf,this.onGenerateNavigationPath)}removeEventListeners(){this.removeEventListener(Of,this.onNavigateTo),this.removeEventListener(Tf,this.onGenerateNavigationPath)}};kf=(0,C.Cg)([(0,l.customElement)({name:"foundation-router"})],kf);const Df=e=>`control: ${e}-control, content: ${e}-content`,If=["background: progress-ring-background","progress: progress-ring-progress","indeterminate-indicator-1: progress-ring-indeterminate"].join(", "),Rf=e=>l.html`
|
|
6691
|
+
`,Wg={mode:"open",delegatesFocus:!0};class qg extends a.FoundationElement{constructor(){super(...arguments),this.closeTimeout=0,this.toastButtons=[],this.desktopNotifications=!1,this.reconnections=0,this.reconnection=Promise.resolve(),this.reconnectionWaitMs=1e4}desktopNotificationsChanged(){this.desktopNotifications&&this.isConnected&&"undefined"!=typeof document&&"visible"===document.visibilityState&&this.clearDesktopNotifications()}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return(0,C.sH)(this,void 0,void 0,function*(){e.connectedCallback.call(this),this.boundVisibilityChange=this.handleVisibilityChange.bind(this),"undefined"!=typeof document&&document.addEventListener("visibilitychange",this.boundVisibilityChange),this.addEventListener(ye.NOTIFICATION_EVENT,e=>{e.stopImmediatePropagation(),Te(e.detail,this.tagName,this.notificationListener)}),this.connectionSub=this.connect.isConnected$.subscribe(e=>{if(!e)return;const t=this.reconnections+=1;var i,o;this.reconnection=(i=this.reconnection,o=this.reconnectionWaitMs,new Promise(e=>{const t=setTimeout(e,o);i.finally(()=>{clearTimeout(t),e()})})).then(()=>this.handleReconnection(t)).catch(e=>dt.error(e))})})}handleReconnection(e){return(0,C.sH)(this,void 0,void 0,function*(){var t;const i=()=>e===this.reconnections&&this.isConnected;if(!this.resourceName||!i())return;null===(t=this.dataSub)||void 0===t||t.unsubscribe(),this.dataSub=void 0;const o=yield this.initializeDatasource();if(i()){if(!o)throw new Error(`Failed to initialize datasource for ${this.resourceName}`);this.setupDataSubscription()}})}initializeDatasource(){return(0,C.sH)(this,void 0,void 0,function*(){var e;return(null===(e=this.datasource)||void 0===e?void 0:e.initialized)&&this.datasource.destroy(),this.datasource.init({resourceName:this.resourceName},!0)})}setupDataSubscription(){this.datasource.stream?this.dataSub=this.datasource.stream.subscribe(e=>{e.ROW&&e.SEQUENCE_ID>1&&this.handleStreamUpdate((0,mi.d)(e))}):dt.warn(`No stream available for ${this.resourceName}`)}disconnectedCallback(){var e,t,i;super.disconnectedCallback(),"undefined"!=typeof document&&this.boundVisibilityChange&&document.removeEventListener("visibilitychange",this.boundVisibilityChange),delete this.boundVisibilityChange,null===(e=this.dataSub)||void 0===e||e.unsubscribe(),delete this.dataSub,null===(t=this.connectionSub)||void 0===t||t.unsubscribe(),delete this.connectionSub,null===(i=this.datasource)||void 0===i||i.destroy(),delete this.datasource}handleVisibilityChange(){this.desktopNotifications&&"undefined"!=typeof document&&"visible"===document.visibilityState&&this.clearDesktopNotifications()}clearDesktopNotifications(){this.postToServiceWorker({type:"genesis-clear-desktop-notifications"})}postToServiceWorker(e){"undefined"!=typeof navigator&&navigator.serviceWorker&&(navigator.serviceWorker.controller?navigator.serviceWorker.controller.postMessage(e):navigator.serviceWorker.ready&&navigator.serviceWorker.ready.then(t=>{var i;null===(i=null==t?void 0:t.active)||void 0===i||i.postMessage(e)}).catch(()=>{}))}handleStreamUpdate(e){const t=e.inserts;t.length>0&&t.forEach(e=>{this.showNotificationToast(e),this.handleDesktopNotification(e)})}handleDesktopNotification(e){if(this.desktopNotifications&&"undefined"!=typeof document&&"hidden"===document.visibilityState&&"undefined"!=typeof Notification&&"granted"===Notification.permission)try{const t=this.desktopNotificationFor(e);if(!t)return;this.postToServiceWorker({type:"genesis-desktop-notification",notification:t})}catch(e){dt.error(e)}}desktopNotificationFor(e){var t;return{title:e.HEADER,options:{body:e.MESSAGE,tag:`genesis-alert-${null!==(t=e.ALERT_ID)&&void 0!==t?t:""}`,data:{alertId:e.ALERT_ID}}}}showNotificationToast(e){const{HEADER:t,MESSAGE:i,NOTIFY_SEVERITY:o}=e,n=e.CREATED_AT?new Date(e.CREATED_AT):void 0,s=e.EXPIRY?e.EXPIRY-e.CREATED_AT:void 0;let a=[];this.toastButtons&&this.toastButtons.length>0&&(a=this.toastButtons.filter(({condition:t})=>!t||t({details:e})));const r={title:t,body:i,createdAt:n,toast:{details:e,type:null==o?void 0:o.toLowerCase(),buttons:a,autoClose:void 0!==s?!!s:!!this.closeTimeout,closeTimeout:null!=s?s:this.closeTimeout,position:this.toastPosition}};$c(r,this.tagName)}}(0,C.Cg)([l.observable],qg.prototype,"notificationListener",void 0),(0,C.Cg)([bi.dm],qg.prototype,"connect",void 0),(0,C.Cg)([(0,l.attr)({attribute:"resource-name"})],qg.prototype,"resourceName",void 0),(0,C.Cg)([(0,l.attr)({attribute:"close-timeout",converter:l.nullableNumberConverter})],qg.prototype,"closeTimeout",void 0),(0,C.Cg)([l.observable],qg.prototype,"toastButtons",void 0),(0,C.Cg)([(0,l.attr)({attribute:"toast-position"})],qg.prototype,"toastPosition",void 0),(0,C.Cg)([(0,l.attr)({attribute:"desktop-notifications",mode:"boolean"})],qg.prototype,"desktopNotifications",void 0),(0,C.Cg)([yi.yW],qg.prototype,"datasource",void 0);const Kg=qg.compose({baseName:"notification-listener",template:Yg,shadowOptions:Wg}),Xg=(e,t)=>i=>{const o="function"==typeof t?t:(n=t,e=>Object.assign(Object.assign({},n),e));var n;return l.FASTElement.define(class extends e{},o(i))};function Jg(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 Qg;!function(e){e.controlClicked="controlClicked",e.routeChanged="routeChanged"}(Qg||(Qg={}));class Zg{trackEvent(e,t){Qs.v.debug(`FoundationAnalytics.trackEvent ${e} : ${JSON.stringify(t)}`)}}const ef=a.DI.createInterface(e=>e.singleton(Zg));var tf=i(98647),of=i(35044);const nf=(0,lt.createLogger)("foundation-router");var sf=i(36132),af=i(80751),rf=i(3479);const lf="$router",df=Object.freeze({getOrCreateFor:e=>{const t=e[lf];return void 0!==t?t:e[lf]=new cf(e)},find:e=>rf.Ix.find(e),from:e=>rf.Ix.from(e)});class cf extends rf.LK{}const uf=/^([a-z][a-z0-9+\-.]*:)?\/\//i;function hf(e){return uf.test(e)}function pf(e){return e.config instanceof tf.Y?e:df.find(e)}function mf(e){return pf(e).parent}function vf(e){let t=pf(e);for(;t&&t.level>0;)t=t.parent;return t}function gf(e,t="/",i=!1){const o=e.join(t).replace(new RegExp(t+"{1,}","g"),t);return!i&&o.endsWith(t)?o.slice(0,-1):o}function ff(e,t="/"){const i=e.split(t);return 2===i.length&&""===i[0]&&""!==i[1]?e:(i.length>1&&i.pop(),i.join(t))}function bf(e){return e.replace(`/*${af.N}`,"")}function yf(){null===document.querySelector("foundation-router, fast-router")&&window.dispatchEvent(new PopStateEvent("popstate"))}const wf=Object.freeze({path:Object.freeze({get current(){return sf.qh.path.current},generateRoute:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={}){let o=pf(e);for(;null!==o;){const e=yield o.config.generateRouteFromPath(t,i);if(null!==e)return e;o=o.parent}return null}),push:(e,t=!0)=>{e&&hf(e)?location.href=e:(history.pushState({},document.title,e),yf(),t&&wf.path.trigger(e))},replace:(e,t=!0)=>{e&&hf(e)?location.href=e:(history.replaceState({},document.title,e),yf(),t&&wf.path.trigger(e))},trigger:e=>{sf.qh.path.trigger(e)}}),name:Object.freeze({generateRoute:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={}){let o=pf(e);for(;null!==o;){const e=yield o.config.generateRouteFromName(t,i);if(null!==e)return e;o=o.parent}return null}),push:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={},o=!0){const n=yield wf.name.generateRoute(e,t,i);null!==n&&wf.path.push(n,o)}),replace:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={},o=!0){const n=yield wf.name.generateRoute(e,t,i);null!==n&&wf.path.replace(n,o)}),trigger:(e,t,...i)=>(0,C.sH)(void 0,[e,t,...i],void 0,function*(e,t,i={}){const o=yield wf.name.generateRoute(e,t,i);null!==o&&wf.path.trigger(o)})})}),Cf=e=>!e.navId||"header"===e.navId||"side-nav"===e.navId,xf=10;function $f(e,t=Cf,i=xf){const o=[];return e.filter(e=>e.navItems&&e.navItems.some(t)).forEach((e,n)=>{e.navItems.filter(t).map((t,o)=>{var s,a,r,l;const d=null!==(s=t.placementIndex)&&void 0!==s?s:n*i+o;return Object.assign(Object.assign({},t),{navId:null!==(a=t.navId)&&void 0!==a?a:"header",placementIndex:d,routePath:null!==(r=t.routePath)&&void 0!==r?r:e.path,routeName:null!==(l=t.routeName)&&void 0!==l?l:e.name})}).forEach(e=>o.push(e))}),o.sort((e,t)=>e.placementIndex-t.placementIndex)}class Sf extends af.s{constructor(){super(...arguments),this.definitions=[]}map(...e){const t=this.owner,i=!t.parent,o=t.basename;i&&(""!==o&&"/"!==o)&&(nf.debug("Route paths remap required due to detected sub-path deployment"),e=e.map(e=>{if(!e.path)return e;if(e.path.startsWith(o))return nf.debug(`'${e.path}' path okay as is`),e;const t="/"!==e.path.charAt(0)?"/":"",i=`${o}${t}${e.path}`;return nf.debug(`'${e.path}' path modified to '${i}'`),Object.assign(Object.assign({},e),{path:i})})),this.definitions=[...e,...this.definitions],super.map(...e)}}(0,C.Cg)([l.observable],Sf.prototype,"definitions",void 0);class Ef extends tf.Y{constructor(){super(),this.logger=nf,this.loginPath="login",this.notFoundPath="not-found",this.notPermittedPath="not-permitted",this.routes=new Sf(this),this.basename=as.OB,this.routes=new Sf(this)}getNavItems(e=Cf){return $f(this.routes.definitions,e)}configureAnalytics(){this.contributors.push({navigate:e=>(0,C.sH)(this,void 0,void 0,function*(){this.analytics.trackEvent(Qg.routeChanged,{path:e.route.endpoint.path})})})}configureRoutePermittedChecks(){this.contributors.push({navigate:e=>(0,C.sH)(this,void 0,void 0,function*(){var t;const{settings:i}=e.route;!1===(null===(t=null==i?void 0:i.isPermitted)||void 0===t?void 0:t.call(i))&&e.cancel(()=>{var t,o;if(this.user.isAuthenticated){const n=null!==(o=null===(t=i.notPermittedPath)||void 0===t?void 0:t.call(i))&&void 0!==o?o:this.notPermittedPath;this.logger.debug(`User not permitted to access route. Re-routing to ${n}.`),wf.name.replace(e.router,n)}else this.user.trackPath(),wf.name.replace(e.router,this.loginPath)})})})}configureFallbackRouteDefinition(){this.routes.fallback(()=>{let e={redirect:this.notFoundPath};return this.user.isAuthenticated||(this.user.trackPath(),this._session.captureReturnUrl(),e={redirect:this.loginPath}),this.logger.debug(`Route unresolved. Re-routing to ${e.redirect}.`),e})}navigationPhaseLoginRedirect(e){e.cancel(()=>{this.user.trackPath(),this._session.captureReturnUrl(),wf.name.replace(e.router,this.loginPath)})}generateRouteFromName(e,t){const i=Object.create(null,{generateRouteFromName:{get:()=>super.generateRouteFromName}});return(0,C.sH)(this,void 0,void 0,function*(){const o=yield i.generateRouteFromName.call(this,e,t);return o?this.generateNavigationPath(o):null})}navigateTo(e){return(0,C.sH)(this,void 0,void 0,function*(){if(e.name)return this.relativeTo||this.logger.error("unable to navigate by name as the relativeTo router is not set"),void(yield wf.name.push(this.relativeTo,e.name,e.params,e.trigger));e.path&&wf.path.push(this.generateNavigationPath(e.path,e.params),e.trigger)})}generateNavigationPath(e,t){const i=this.getNavigationPathBasename(),o=of.C.build(t);let n=i&&!e.startsWith(i)?gf([i,e]):e;return n=o?`${n}?${o}`:n,n}getNavigationPathBasename(){var e,t;const i=this.parent,o=null===(t=null===(e=null==i?void 0:i.relativeTo)||void 0===e?void 0:e.route)||void 0===t?void 0:t.endpoint.route.path;return o?bf(o):this.basename?this.basename:""}construct(e){return this.container.get(e)}}(0,C.Cg)([a.Container],Ef.prototype,"container",void 0),(0,C.Cg)([ef],Ef.prototype,"analytics",void 0),(0,C.Cg)([nd.KJ],Ef.prototype,"user",void 0),(0,C.Cg)([Ni.N],Ef.prototype,"_session",void 0);const Of="navigate-to",Tf="generate-navigation-path";let kf=class extends(df.from(l.FASTElement)){constructor(){super(...arguments),this.logger=nf,this.onNavigateTo=e=>{e.stopImmediatePropagation(),this.config.navigateTo(e.detail)},this.onGenerateNavigationPath=e=>{e.stopImmediatePropagation();const{path:t,params:i,callback:o}=e.detail;if(!o)return;o(this.config.generateNavigationPath(t,i))}}get router(){return this[lf]}connectedCallback(){var e,t;super.connectedCallback(),this.config.isConfigured||(null!==(e=(t=this.config).relativeTo)&&void 0!==e||(t.relativeTo=this.router),l.DOM.queueUpdate(()=>(0,C.sH)(this,void 0,void 0,function*(){this.router.config?this.router.connect():this.router.config=this.config})),this.addEventListeners())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListeners()}addEventListeners(){this.addEventListener(Of,this.onNavigateTo),this.addEventListener(Tf,this.onGenerateNavigationPath)}removeEventListeners(){this.removeEventListener(Of,this.onNavigateTo),this.removeEventListener(Tf,this.onGenerateNavigationPath)}};kf=(0,C.Cg)([(0,l.customElement)({name:"foundation-router"})],kf);const Df=e=>`control: ${e}-control, content: ${e}-content`,If=["background: progress-ring-background","progress: progress-ring-progress","indeterminate-indicator-1: progress-ring-indeterminate"].join(", "),Rf=e=>l.html`
|
|
6692
6692
|
|
|
6693
6693
|
<${e}-card class=${e=>(0,$.x)("stepper-tab",["stepper-tab-hidden",e.hideTabs])} part="stepper-tab" @tab-clicked="${(e,t)=>e.handleStepClick(t.event.detail)}" role="stepper-tab" data-test-id="stepper-tab">
|
|
6694
6694
|
<div class=${e=>(0,$.x)("stepper-tab-menu",["stepper-tab-menu-hidden",e.hideTabs])} part="stepper-tab-menu">
|
|
@@ -6823,4 +6823,4 @@ class="margin"
|
|
|
6823
6823
|
height: 70px;
|
|
6824
6824
|
}
|
|
6825
6825
|
`;class Nf extends a.FoundationElement{constructor(){super(...arguments),this.hideProgress=!1,this.allowBackwardJumps=!1,this.allowForwardJumps=!1,this.hideAllButtons=!1,this.hideTabs=!1,this.indicatorOnly=!1,this.orientation=a.TabsOrientation.vertical,this.tabs=[],this.tabpanels=[],this.progressValue=0,this.activeTabIndex=0,this.pendingNextStep=!1,this.slotsInitialized=!1,this.setTabs=()=>{this.activeTabIndex=this.getActiveIndex(),this.tabs.forEach((e,t)=>{if("tab"===e.slot){const i=this.activeTabIndex===t,o=t+1===this.tabIds.length,n=this.tabIds[t],s=this.tabpanelIds[t];e.setAttribute("id",n),e.setAttribute("aria-selected",i?"true":"false"),e.setAttribute("aria-disabled",i?"false":"true"),l.DOM.setBooleanAttribute(e,"selected",i),e.setAttribute("orientation",this.orientation),s&&e.setAttribute("aria-controls",s),e.setAttribute("tab-position",String(t+1)),l.DOM.setBooleanAttribute(e,"isLast",o),l.DOM.setBooleanAttribute(e,"hideStepNumber",!0===this.hideStepNumber),e.setAttribute("tabindex",i?"0":"-1"),l.DOM.setBooleanAttribute(e,"showCursorPointer",t<=this.activeTabIndex&&this.allowBackwardJumps||t>this.activeTabIndex&&this.allowForwardJumps),i&&(this.activetab=e,this.activeid=n)}}),0===this.activeTabIndex&&this.resetCompletedState()},this.getCompletedTabs=()=>{let e=0;this.tabs.forEach(t=>{t.isCompleted()&&(e+=1)});const t=this.indicatorOnly?this.tabs.length:this.tabpanels.length;this.progressValue=t?Math.round(e/t*100):0},this.setTabPanels=()=>{this.tabpanels.forEach((e,t)=>{const i=this.tabIds[t],o=this.tabpanelIds[t];e.setAttribute("id",o),e.setAttribute("aria-labelledby",i),this.activeTabIndex!==t?e.setAttribute("hidden",""):e.removeAttribute("hidden")})}}orientationChanged(){this.$fastController.isConnected&&(this.setTabs(),this.setTabPanels())}activeidChanged(e,t){this.$fastController.isConnected&&(this.indicatorOnly||this.tabs.length<=this.tabpanels.length)&&(this.setTabs(),this.setTabPanels(),this.getCompletedTabs())}tabsChanged(){this.$fastController.isConnected&&(this.indicatorOnly||this.tabs.length<=this.tabpanels.length)&&(this.setTabsAndTabPanels(),this.checkAndExecutePendingNextStep())}tabpanelsChanged(){this.$fastController.isConnected&&this.tabpanels.length<=this.tabs.length&&(this.setTabsAndTabPanels(),this.checkAndExecutePendingNextStep())}connectedCallback(){super.connectedCallback(),this.tabIds=this.getTabIds(),this.tabpanelIds=this.getTabPanelIds(),this.activeTabIndex=this.getActiveIndex()}setTabsAndTabPanels(){this.tabIds=this.getTabIds(),this.tabpanelIds=this.getTabPanelIds(),this.setTabs(),this.setTabPanels(),this.getCompletedTabs(),this.slotsInitialized=this.tabs.length>0&&(this.indicatorOnly||this.tabpanels.length>0)}checkAndExecutePendingNextStep(){this.pendingNextStep&&this.slotsInitialized&&(this.pendingNextStep=!1,this.nextStep())}getActiveIndex(){return void 0!==this.activeid?-1===this.tabIds.indexOf(this.activeid)?0:this.tabIds.indexOf(this.activeid):0}goToStep(e,t=!1){const i=e-1;if(e<1||e>this.tabs.length)return dt.warn(`[Stepper] Invalid step number: ${e}. Must be between 1 and ${this.tabs.length}`),!1;if(i===this.activeTabIndex)return!1;if(t){if(i<this.activeTabIndex)return this.handleBackwardJump(i);if(i>this.activeTabIndex)return this.handleForwardJump(i)}if(i<this.activeTabIndex&&this.allowBackwardJumps){return this.handleBackwardJump(i)}if(i>this.activeTabIndex&&this.allowForwardJumps){return this.handleForwardJump(i)}return i===this.activeTabIndex+1?(this.nextStep(),!0):(dt.warn(`[Stepper] Cannot jump to step ${e}. Jumps are not allowed or step is not adjacent.`),!1)}goToFirstStep(){return this.goToStep(1,!0)}goToLastStep(){return this.goToStep(this.tabs.length,!0)}handleStepClick(e){e<this.activeTabIndex&&this.allowBackwardJumps?this.handleBackwardJump(e):e>this.activeTabIndex&&this.allowForwardJumps&&this.handleForwardJump(e)}handleBackwardJump(e){for(let t=e+1;t<=this.activeTabIndex;t+=1)this.tabs[t].completed=!1;return this.activeTabIndex=e,this.activetab=this.tabs[e],this.activeid=this.tabIds[e],this.$emit("step-click",{activetab:this.activetab,activeid:this.activeid}),!0}handleForwardJump(e){for(let t=this.activeTabIndex;t<e;t+=1)if(this.validation&&this.validation[t]){if(!this.validation[t].isValid())return this.tabs[t].completed=!1,this.tabs[t].error=!0,this.getCompletedTabs(),this.$emit("validation-failure",{stepIndex:t,stepId:this.tabIds[t],message:`Validation failed for step ${t+1}`}),!1;this.tabs[t].error=!1}for(let t=this.activeTabIndex;t<e;t+=1)this.tabs[t].completed=!0,this.tabs[t].error=!1;return this.tabs[e].completed=!1,this.tabs[e].error=!1,this.activeTabIndex=e,this.activetab=this.tabs[e],this.activeid=this.tabIds[e],this.getCompletedTabs(),this.$emit("step-click",{activetab:this.activetab,activeid:this.activeid}),!0}get disabledPreviousStep(){return 0===this.activeTabIndex}get isLastStep(){return this.activeTabIndex+1===this.tabs.length}get islastStepValid(){var e;const t=this.tabs.length-1;return this.activeTabIndex===t&&(this.validation&&(null===(e=this.validation[t])||void 0===e?void 0:e.isValid())||!this.validation||!this.validation[t])?(this.tabs[t].completed=!0,this.getCompletedTabs(),!1):(this.tabs[t].completed=!1,this.getCompletedTabs(),!0)}_submit(){this.$emit("submit")}nextStep(){var e;if(!this.slotsInitialized)return void(this.pendingNextStep=!0);if(this.validation&&this.validation[this.activeTabIndex]){if(!this.validation[this.activeTabIndex].isValid())return this.tabs[this.activeTabIndex].completed=!1,this.tabs[this.activeTabIndex].error=!0,void this.getCompletedTabs();this.tabs[this.activeTabIndex].error=!1}this.activeTabIndex+2<=this.tabIds.length&&(this.tabs[this.activeTabIndex].completed=!0,this.activeTabIndex=this.activeTabIndex+1,this.activeid=this.tabIds[this.activeTabIndex],this.$emit("next-step"),this.$emit("validation-success"));const t=this.tabs.length-1,i=this.activeTabIndex===t;this.hideSubmitButton&&i&&(this.validation&&(null===(e=this.validation[t])||void 0===e?void 0:e.isValid())||!this.validation||!this.validation[t])?(this.tabs[t].completed=!0,this.getCompletedTabs()):(this.tabs[t].completed=!1,this.getCompletedTabs())}previousStep(){0!==this.activeTabIndex&&(this.tabs[this.activeTabIndex].completed=!1,this.activeTabIndex=this.activeTabIndex-1,this.activeid=this.tabIds[this.activeTabIndex])}getTabIds(){return this.tabs.map(e=>{var t;return null!==(t=e.getAttribute("id"))&&void 0!==t?t:`tab-${(0,Ea.NF)()}`})}getTabPanelIds(){return this.tabpanels.map(e=>{var t;return null!==(t=e.getAttribute("id"))&&void 0!==t?t:`panel-${(0,Ea.NF)()}`})}resetCompletedState(){this.tabs.forEach(e=>e.completed=!1)}}(0,C.Cg)([(0,l.attr)({attribute:"hide-submit-button",mode:"boolean"})],Nf.prototype,"hideSubmitButton",void 0),(0,C.Cg)([(0,l.attr)({attribute:"hide-progress",mode:"boolean"})],Nf.prototype,"hideProgress",void 0),(0,C.Cg)([(0,l.attr)({attribute:"hide-step-number",mode:"boolean"})],Nf.prototype,"hideStepNumber",void 0),(0,C.Cg)([(0,l.attr)({attribute:"allow-backward-jumps",mode:"boolean"})],Nf.prototype,"allowBackwardJumps",void 0),(0,C.Cg)([(0,l.attr)({attribute:"allow-forward-jumps",mode:"boolean"})],Nf.prototype,"allowForwardJumps",void 0),(0,C.Cg)([(0,l.attr)({attribute:"hide-all-buttons",mode:"boolean"})],Nf.prototype,"hideAllButtons",void 0),(0,C.Cg)([(0,l.attr)({attribute:"hide-tabs",mode:"boolean"})],Nf.prototype,"hideTabs",void 0),(0,C.Cg)([(0,l.attr)({attribute:"indicator-only",mode:"boolean"})],Nf.prototype,"indicatorOnly",void 0),(0,C.Cg)([l.attr],Nf.prototype,"orientation",void 0),(0,C.Cg)([l.attr],Nf.prototype,"activeid",void 0),(0,C.Cg)([l.observable],Nf.prototype,"tabs",void 0),(0,C.Cg)([l.observable],Nf.prototype,"tabpanels",void 0),(0,C.Cg)([l.observable],Nf.prototype,"validation",void 0),(0,C.Cg)([l.observable],Nf.prototype,"progressValue",void 0),(0,C.Cg)([l.observable],Nf.prototype,"activeTabIndex",void 0),(0,C.Cg)([l.volatile],Nf.prototype,"disabledPreviousStep",null),(0,C.Cg)([l.volatile],Nf.prototype,"isLastStep",null),(0,C.Cg)([l.volatile],Nf.prototype,"islastStepValid",null);const Ff=void 0,Mf={},_f=Nf.compose(Object.assign({baseName:"stepper",template:Af,styles:Lf,shadowOptions:Ff},Mf)),Pf=["input","textarea","select",'[contenteditable="true"]','[contenteditable=""]','[role="textbox"]','[role="searchbox"]','[role="combobox"]'],Hf={rapid:(zf="rapid",["text-field","text-area","combobox"].map(e=>`${zf}-${e}`))};var zf;function Uf(e,t=[]){const i=e.flatMap(e=>{var t;return null!==(t=Hf[e])&&void 0!==t?t:[]}),o=t.filter(Boolean);return Array.from(new Set([...Pf,...i,...o])).join(",")}Uf(["rapid"]);const Bf=()=>Id().register(ov)},70997(e,t,i){"use strict";function o(e,t,i){const o=e=>"function"==typeof e?e:()=>e,n=o(t),s=o(i);return(t,i)=>e(t,i)?n(t,i):s(t,i)}i.d(t,{q:()=>o})},80273(e,t,i){"use strict";i.d(t,{Du:()=>l,IT:()=>a,WP:()=>n,f4:()=>r,zz:()=>s});var o=i(52945);const n=(e,t)=>{(0,o.O5)(e,t)};var s,a;!function(e){e.Italic="italic",e.Normal="normal"}(s||(s={})),function(e){e[e.Thin=100]="Thin",e[e.Light=300]="Light",e[e.Regular=400]="Regular",e[e.Medium=500]="Medium",e[e.Bold=700]="Bold",e[e.Black=900]="Black"}(a||(a={}));const r=(e,t=s.Normal,i=a.Regular)=>`\n font-family: ${e};\n font-style: ${t};\n font-weight: ${i};\n`,l={minusOne:-1,minusTwo:-2,plusOne:1,plusTwo:2,plusThree:3,plusFour:4,plusFive:5,plusSix:6}}}]);
|
|
6826
|
-
//# sourceMappingURL=249.
|
|
6826
|
+
//# sourceMappingURL=249.da8d7567b6fd9c7cb5c05d5e25e3c06b.js.map
|