Icard/angular-clarity-master(work.../node_modules/primeng/fesm2022/primeng-dom.mjs.map

1 line
58 KiB
Plaintext
Raw Normal View History

2024-07-16 15:23:22 +00:00
{"version":3,"file":"primeng-dom.mjs","sources":["../../src/app/components/dom/domhandler.ts","../../src/app/components/dom/connectedoverlayscrollhandler.ts","../../src/app/components/dom/primeng-dom.ts"],"sourcesContent":["/**\n * @dynamic is for runtime initializing DomHandler.browser\n *\n * If delete below comment, we can see this error message:\n * Metadata collected contains an error that will be reported at runtime:\n * Only initialized variables and constants can be referenced\n * because the value of this variable is needed by the template compiler.\n */\n// @dynamic\nexport class DomHandler {\n public static zindex: number = 1000;\n\n private static calculatedScrollbarWidth: number = null;\n\n private static calculatedScrollbarHeight: number = null;\n\n private static browser: any;\n\n public static addClass(element: any, className: string): void {\n if (element && className) {\n if (element.classList) element.classList.add(className);\n else element.className += ' ' + className;\n }\n }\n\n public static addMultipleClasses(element: any, className: string): void {\n if (element && className) {\n if (element.classList) {\n let styles: string[] = className.trim().split(' ');\n for (let i = 0; i < styles.length; i++) {\n element.classList.add(styles[i]);\n }\n } else {\n let styles: string[] = className.split(' ');\n for (let i = 0; i < styles.length; i++) {\n element.className += ' ' + styles[i];\n }\n }\n }\n }\n\n public static removeClass(element: any, className: string): void {\n if (element && className) {\n if (element.classList) element.classList.remove(className);\n else element.className = element.className.replace(new RegExp('(^|\\\\b)' + className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' ');\n }\n }\n\n public static removeMultipleClasses(element, classNames) {\n if (element && classNames) {\n [classNames]\n .flat()\n .filter(Boolean)\n .forEach((cNames) => cNames.split(' ').forEach((className) => this.removeClass(element, className)));\n }\n }\n\n public static hasClass(element: any, className: string): boolean {\n if (element && className) {\n if (element.classList) return element.classList.contains(className);\n else return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);\n }\n\n return false;\n }\n\n public static siblings(element: any): any {\n return Array.prototype.filter.call(element.parentNode.children, function (child) {\n return child !== element;\n });\n }\n\n public static find(element: any, selector: string): any[] {\n return Array.from(element.querySelectorAll(selector));\n }\n\n public static findSingle(element: any, selector: string): any {\n return this.isElement(element) ? element.querySelector(selector) : null;\n }\n\n public static index(element: any): number {\n let children = element.parentNode.childNodes;\n let num = 0;\n for (var i = 0; i < children.length; i++) {\n if (children[i] == element) return num;\n if (children[i].nodeType == 1) num++;\n }\n return -1;\n }\n\n public static indexWithinGroup(element: any, attributeName: string): number {\n let children = element.parentNode ? element.parentNode.childNodes : [];\n let num = 0;\n for (var i = 0; i < children.length; i++) {\n if (children[i] == element) return num;\n if (children[i].attributes && children[i].attributes[attributeName] && children[i].nodeType == 1) num++;\n }\n return -1;\n }\n\n public static appendOverlay(overlay: any, target: any, appendTo: any = 'self') {\n if (appendTo !== 'self' && overla