All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.util.getFastNavigationGroups.js.map Maven / Gradle / Ivy

{"version":3,"file":"getFastNavigationGroups.js","sourceRoot":"","sources":["../../src/util/getFastNavigationGroups.ts"],"names":[],"mappings":"AAAA,IAAI,MAAM,GAAuB,EAAE,CAAC;AAEpC,MAAM,sBAAsB,GAAG,CAAC,EAAe,EAAE,EAAE;IAClD,OAAO,EAAE,CAAC,YAAY,CAAC,0BAA0B,CAAC,KAAK,MAAM,CAAC;AAC/D,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,EAAe,EAAE,EAAE;IAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAE1C,OAAO,KAAK,CAAC,KAAK,KAAK,KAAK;WACxB,KAAK,CAAC,MAAM,KAAK,KAAK;WACtB,KAAK,CAAC,OAAO,KAAK,GAAG;WACrB,KAAK,CAAC,OAAO,KAAK,MAAM;WACxB,KAAK,CAAC,UAAU,KAAK,QAAQ,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAAC,SAAsB,EAAE,kBAA4B,EAAE,EAAE;IACzF,IAAI,KAAK,EACR,gBAAgB,EAChB,KAAK,GAAG,CAAC,CAAC;IAEX,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE;QACjC,OAAO;KACP;IAED,IAAI,sBAAsB,CAAC,SAAS,CAAC,EAAE;QACtC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACvB;IAED,IAAI,SAAS,CAAC,UAAU,EAAE;QACzB,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC;KACxC;SAAM,IAAI,SAAS,YAAY,eAAe,IAAI,SAAS,CAAC,aAAa,EAAE,EAAE;QAC7E,gBAAgB,GAAG,SAAS,CAAC,aAAa,EAAE,CAAC;QAC7C,KAAK,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;KAC5B;SAAM,IAAI,kBAAkB,EAAE;QAC9B,KAAK,GAAG,SAAS,CAAC;KAClB;SAAM;QACN,KAAK,GAAG,SAAS,CAAC,iBAAiB,CAAC;KACpC;IAED,OAAO,KAAK,EAAE;QACb,MAAM,aAAa,GAAgB,KAAoB,CAAC;QACxD,IAAI,CAAC,KAAK,EAAE;YACX,OAAO;SACP;QAED,IAAI,KAAK,CAAC,QAAQ,KAAK,CAAC,EAAE;YACzB,wBAAwB,CAAC,KAAoB,EAAE,KAAK,CAAC,CAAC;SACtD;QAED,KAAK,GAAG,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,kBAAkB,CAAC;KACnH;AACF,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,SAAsB,EAAE,EAAE;IAC1D,MAAM,GAAG,EAAE,CAAC;IAEZ,wBAAwB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAE1C,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC","sourcesContent":["let groups: Array = [];\n\nconst isFastNavGroupElemenet = (el: HTMLElement) => {\n\treturn el.getAttribute(\"data-sap-ui-fastnavgroup\") === \"true\";\n};\n\nconst isElementVisible = (el: HTMLElement) => {\n\tconst style = window.getComputedStyle(el);\n\n\treturn style.width !== \"0px\"\n\t\t&& style.height !== \"0px\"\n\t\t&& style.opacity !== \"0\"\n\t\t&& style.display !== \"none\"\n\t\t&& style.visibility !== \"hidden\";\n};\n\nconst findFastNavigationGroups = (container: HTMLElement, startFromContainer?: boolean) => {\n\tlet child,\n\t\tassignedElements,\n\t\tindex = 0;\n\n\tif (!isElementVisible(container)) {\n\t\treturn;\n\t}\n\n\tif (isFastNavGroupElemenet(container)) {\n\t\tgroups.push(container);\n\t}\n\n\tif (container.shadowRoot) {\n\t\tchild = container.shadowRoot.firstChild;\n\t} else if (container instanceof HTMLSlotElement && container.assignedNodes()) {\n\t\tassignedElements = container.assignedNodes();\n\t\tchild = assignedElements[0];\n\t} else if (startFromContainer) {\n\t\tchild = container;\n\t} else {\n\t\tchild = container.firstElementChild;\n\t}\n\n\twhile (child) {\n\t\tconst originalChild: HTMLElement = child as HTMLElement;\n\t\tif (!child) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (child.nodeType === 1) {\n\t\t\tfindFastNavigationGroups(child as HTMLElement, false);\n\t\t}\n\n\t\tchild = assignedElements && assignedElements.length ? assignedElements[++index] : originalChild.nextElementSibling;\n\t}\n};\n\nconst getFastNavigationGroups = (container: HTMLElement) => {\n\tgroups = [];\n\n\tfindFastNavigationGroups(container, true);\n\n\treturn groups;\n};\n\nexport default getFastNavigationGroups;\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy