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.renderer.executeTemplate.js.map Maven / Gradle / Ivy
{"version":3,"file":"executeTemplate.js","sourceRoot":"","sources":["../../src/renderer/executeTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAM1G;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,CAAC,QAA0B,EAAE,SAAqB,EAA0B,EAAE;IACrG,MAAM,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,8BAA8B,EAAE,CAAC;IAC/C,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,cAAc,GAAG,CAAC,SAAqB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,SAAS,CAAC,WAAgC,CAAC;IAExD,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,CAAC;IACrD,MAAM,WAAW,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC,CAAC,GAAsB,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAElJ,IAAI,wBAAwB,CAAC,YAAY,CAAC,EAAE;QAC3C,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAC/B;IAED,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,CAAC","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"]}