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

package.dist.IgnoreCustomElements.js.map Maven / Gradle / Ivy

{"version":3,"file":"IgnoreCustomElements.js","sourceRoot":"","sources":["../src/IgnoreCustomElements.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,GAAkB,EAAE,CAAC;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,oBAAoB,GAAG,CAAC,SAAiB,EAAE,EAAE;IAClD,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;QACvD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;KAC5D;IAED,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,yBAAyB,GAAG,CAAC,GAAW,EAAW,EAAE;IAC1D,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,OAAO,EACN,oBAAoB,EACpB,yBAAyB,GACzB,CAAC","sourcesContent":["/**\n * The tag prefixes to be ignored.\n */\nconst tagPrefixes: Array = [];\n\n/**\n * Ignores all custom HTML elements with a given tag prefix to improve the rendering performance of the UI5 Web Components.\n *\n * **When used:** the UI5 Web Components framework treats all custom HTML elements,\n * starting with the given prefix as if they are standard HTML elements, such as: `div`, `span`, etc, without additional processing.\n *\n * **When not used:** the framework waits for the slotted children to be defined and registered first,\n * because the state or visual appearance of the parent may rely on the slotted elements/children.\n *\n * **Note:** We recommend using `ignoreCustomElements` when slotting custom HTML elements (with only semantic purpose)\n * inside UI5 Web Components, to improve the time to render.\n *\n * @public\n * @since 1.14.0\n * @param { string } tagPrefix\n */\nconst ignoreCustomElements = (tagPrefix: string) => {\n\tif (typeof tagPrefix !== \"string\" || !tagPrefix.length) {\n\t\tthrow new Error(\"Only string characters for a tag prefix.\");\n\t}\n\n\ttagPrefixes.push(tagPrefix);\n};\n\n/**\n * Determines whether custom elements with the given tag should be ignored.\n *\n * @private\n * @param { string } tag\n */\nconst shouldIgnoreCustomElement = (tag: string): boolean => {\n\treturn tagPrefixes.some(pref => tag.startsWith(pref));\n};\n\nexport {\n\tignoreCustomElements,\n\tshouldIgnoreCustomElement,\n};\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy