Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.prod.renderer.executeTemplate.js.map Maven / Gradle / Ivy
{
"version": 3,
"sources": ["../../../src/renderer/executeTemplate.ts"],
"sourcesContent": ["import { getCustomElementsScopingSuffix, shouldScopeCustomElement } from \"../CustomElementsScopeUtils.js\";\nimport type UI5Element from \"../UI5Element.js\";\n\ntype TemplateFunctionResult = object;\ntype TemplateFunction = (component: UI5Element, tagsToScope: Array, scope: string | undefined) => TemplateFunctionResult;\n\n/**\n * Runs a component's template with the component's current state, while also scoping HTML\n *\n * @param template - the template to execute\n * @param component - the component\n * @public\n */\nconst executeTemplate = (template: TemplateFunction, component: UI5Element): TemplateFunctionResult => {\n\tconst tagsToScope = getTagsToScope(component);\n\tconst scope = getCustomElementsScopingSuffix();\n\treturn template.call(component, component, tagsToScope, scope);\n};\n\n/**\n * Returns all tags, used inside component's template subject to scoping.\n * @param component - the component\n * @returns {Array[]}\n * @private\n */\nconst getTagsToScope = (component: UI5Element) => {\n\tconst ctor = component.constructor as typeof UI5Element;\n\n\tconst componentTag = ctor.getMetadata().getPureTag();\n\tconst tagsToScope = ctor.getUniqueDependencies().map((dep: typeof UI5Element) => dep.getMetadata().getPureTag()).filter(shouldScopeCustomElement);\n\n\tif (shouldScopeCustomElement(componentTag)) {\n\t\ttagsToScope.push(componentTag);\n\t}\n\n\treturn tagsToScope;\n};\n\nexport default executeTemplate;\nexport { getTagsToScope };\nexport type { TemplateFunction, TemplateFunctionResult };\n"],
"mappings": "aAAA,OAAS,kCAAAA,EAAgC,4BAAAC,MAAgC,iCAazE,MAAMC,EAAkB,CAACC,EAA4BC,IAAkD,CACtG,MAAMC,EAAcC,EAAeF,CAAS,EACtCG,EAAQP,EAA+B,EAC7C,OAAOG,EAAS,KAAKC,EAAWA,EAAWC,EAAaE,CAAK,CAC9D,EAQMD,EAAkBF,GAA0B,CACjD,MAAMI,EAAOJ,EAAU,YAEjBK,EAAeD,EAAK,YAAY,EAAE,WAAW,EAC7CH,EAAcG,EAAK,sBAAsB,EAAE,IAAKE,GAA2BA,EAAI,YAAY,EAAE,WAAW,CAAC,EAAE,OAAOT,CAAwB,EAEhJ,OAAIA,EAAyBQ,CAAY,GACxCJ,EAAY,KAAKI,CAAY,EAGvBJ,CACR,EAEA,eAAeH,EACf,OAASI,KAAA",
"names": ["getCustomElementsScopingSuffix", "shouldScopeCustomElement", "executeTemplate", "template", "component", "tagsToScope", "getTagsToScope", "scope", "ctor", "componentTag", "dep"]
}