@luigi-project/core 2.5.2-dev.202309200029 → 2.6.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/luigi.js +1 -1
- package/luigi.js.map +1 -1
- package/package.json +1 -1
package/luigi.js
CHANGED
|
@@ -5,7 +5,7 @@ Static and dynamic nodes cannot be used together on the same level. Static node
|
|
|
5
5
|
Remove the static node from the configuration to resolve this warning.
|
|
6
6
|
Affected pathSegment:`,e,"Children:",t),t=t.filter(s=>s.pathSegment&&s.pathSegment.startsWith(":"))),r>1)?(console.error(`Invalid node setup detected.
|
|
7
7
|
Multiple dynamic nodes are not allowed on the same level. Stopped navigation.
|
|
8
|
-
Invalid Children:`,t),null):(t.some(s=>{if(s.pathSegment===e||s.pathSegment&&s.pathSegment.startsWith(":"))return n=s,!0}),n)}onNodeChange(e,t){const n=re.getConfigValue("navigation.nodeChangeHook");typeof n=="function"?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}getNodesToDisplay(e,t){if(e&&e.length>0)return{children:e};if(t.length>2){const n=t[t.length-2];if(Wn.hasChildren(n))return{children:this.getChildrenFromCache(n),parent:n}}return{children:[]}}getGroupedChildren(e,t){const n=this.getNodesToDisplay(e,t.pathData);return Array.isArray(n)?Ce.groupNodesBy(n,"category",!0):{children:Ce.groupNodesBy(n.children,"category",!0),parent:n.parent}}getTruncatedChildren(e){let t=!1,n=[];return e.slice().reverse().forEach(l=>{(!t||l.tabNav)&&(l.keepSelectedForChildren===!1?t=!0:(l.keepSelectedForChildren||l.tabNav&&!me.isDynamicNode(l))&&(t=!0,n=[])),n.push(l)}),n.reverse()}async getLeftNavData(e,t){const n={};if(e.pathData&&1<e.pathData.length){const
|
|
8
|
+
Invalid Children:`,t),null):(t.some(s=>{if(s.pathSegment===e||s.pathSegment&&s.pathSegment.startsWith(":"))return n=s,!0}),n)}onNodeChange(e,t){const n=re.getConfigValue("navigation.nodeChangeHook");typeof n=="function"?n(e,t):n!==void 0&&console.warn("nodeChangeHook is not a function!")}getNodesToDisplay(e,t){if(e&&e.length>0)return{children:e};if(t.length>2){const n=t[t.length-2];if(Wn.hasChildren(n))return{children:this.getChildrenFromCache(n),parent:n}}return{children:[]}}getGroupedChildren(e,t){const n=this.getNodesToDisplay(e,t.pathData);return Array.isArray(n)?Ce.groupNodesBy(n,"category",!0):{children:Ce.groupNodesBy(n.children,"category",!0),parent:n.parent}}getTruncatedChildren(e){let t=!1,n=[];return e.slice().reverse().forEach(l=>{(!t||l.tabNav)&&(l.keepSelectedForChildren===!1?t=!0:(l.keepSelectedForChildren||l.tabNav&&!me.isDynamicNode(l))&&(t=!0,n=[])),n.push(l)}),n.reverse()}async getLeftNavData(e,t){var l;const n={};if(e.pathData&&1<e.pathData.length){const r=this.getTruncatedChildren(t.pathData);let s=[...r].pop(),o;(s.keepSelectedForChildren||s.tabNav)&&(o=s,r.pop(),s=[...r].pop());const c=await this.getChildren(s,(l=t.pathData)==null?void 0:l._context),g=this.getGroupedChildren(c,e);n.navParent=g.parent||s,n.context=e.pathData._context,n.hasCategoriesWithIcon=!1;const h=g.children;Object.values(h).forEach(p=>{!n.hasCategoriesWithIcon&&p&&p.metaInfo&&p.metaInfo.icon&&(n.hasCategoriesWithIcon=!0)}),n.selectedNode=o||s,n.children=h,re.getConfigValue("settings.expandCategoryByNavigation")&&this.expandCategoriesByNavigationFn(n.children,n.selectedNode,Ce.getSideNavAccordionMode(n.selectedNode))}return n}expandCategoriesByNavigationFn(e,t,n){if(e)for(const[l,r]of Object.entries(e))r.forEach(s=>{s===t&&r.metaInfo&&r.metaInfo.collapsible&&Ce.storeExpandedState(r.metaInfo.categoryUid,!0,n)})}getTruncatedChildrenForTabNav(e){const t=[];for(let n=0;n<e.length;n++)if(t.push(e[n]),e[n].tabNav){n<e.length-1&&t.push(e[n+1]);break}return t}async getTabNavData(e,t){var l;const n={};if(e.pathData&&1<e.pathData.length){let s=[...this.getTruncatedChildrenForTabNav(t.pathData)].pop();const o=await this.getChildren(s.tabNav?s:s.parent,(l=e.pathData)==null?void 0:l._context),c=this.getGroupedChildren(o,e).children;n.selectedNode=s,n.selectedNodeForTabNav=s,n.children=c}return n}async extractDataFromPath(e){const t=await this.getNavigationPath(re.getConfigValueAsync("navigation.nodes"),e);return{nodeObject:me.getLastNodeObject(t),pathData:t}}async shouldPreventNavigation(e){return!!(e&&le.isFunction(e.onNodeActivation)&&await e.onNodeActivation(e)===!1)}}const Vt=new Bw,ul={logout:{label:"Sign Out",icon:"log"},userSettingsProfileMenuEntry:{label:"Settings",icon:"settings"},userSettingsDialog:{dialogHeader:"User Settings",saveBtn:"Save",dismissBtn:"Cancel"},globalSearchCenteredCancelButton:"Cancel"},Hw={externalLink:{sameWindow:!1}};class hr{constructor(e){e?(this.rendererObject=e,this.config=e.config||{}):this.config={}}createCompoundContainer(){return document.createElement("div")}createCompoundItemContainer(){return document.createElement("div")}attachCompoundItem(e,t){e.appendChild(t)}}class Ww extends hr{constructor(e){super(e||{use:{}}),e&&e.use&&e.use.extends&&(this.superRenderer=h_({use:e.use.extends,config:e.config}))}createCompoundContainer(){return this.rendererObject.use.createCompoundContainer?this.rendererObject.use.createCompoundContainer(this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundContainer():super.createCompoundContainer()}createCompoundItemContainer(e){return this.rendererObject.use.createCompoundItemContainer?this.rendererObject.use.createCompoundItemContainer(e,this.config,this.superRenderer):this.superRenderer?this.superRenderer.createCompoundItemContainer(e):super.createCompoundItemContainer(e)}attachCompoundItem(e,t){this.rendererObject.use.attachCompoundItem?this.rendererObject.use.attachCompoundItem(e,t,this.superRenderer):this.superRenderer?this.superRenderer.attachCompoundItem(e,t):super.attachCompoundItem(e,t)}}class zw extends hr{createCompoundContainer(){const e="__lui_compound_"+new Date().getTime(),t=document.createElement("div");t.classList.add(e);let n="";return this.config.layouts&&this.config.layouts.forEach(l=>{if(l.minWidth||l.maxWidth){let r="@media only screen ";l.minWidth!=null&&(r+=`and (min-width: ${l.minWidth}px) `),l.maxWidth!=null&&(r+=`and (max-width: ${l.maxWidth}px) `),r+=`{
|
|
9
9
|
.${e} {
|
|
10
10
|
grid-template-columns: ${l.columns||"auto"};
|
|
11
11
|
grid-template-rows: ${l.rows||"auto"};
|