UNPKG

@taiga-ui/cdk

Version:

Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance

16 lines 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.dropdownRefComment = void 0; const elements_1 = require("../../../../utils/templates/elements"); const template_resource_1 = require("../../../../utils/templates/template-resource"); function dropdownRefComment({ resource, recorder, fileSystem, }) { const template = (0, template_resource_1.getTemplateFromTemplateResource)(resource, fileSystem); const templateOffset = (0, template_resource_1.getTemplateOffset)(resource); (0, elements_1.findElementsByTagName)(template, 'tui-hosted-dropdown', (element) => !!element.attrs.find((attr) => attr.name.startsWith('#'))).forEach(({ sourceCodeLocation, attrs }) => { var _a; const attr = attrs.find((attr) => attr.name.startsWith('#')); recorder.insertLeft(((_a = sourceCodeLocation === null || sourceCodeLocation === void 0 ? void 0 : sourceCodeLocation.startOffset) !== null && _a !== void 0 ? _a : 0) + templateOffset, `<!-- TODO: (Taiga UI migration) use <div ... tuiDropdown ${attr === null || attr === void 0 ? void 0 : attr.name}="tuiDropdown"> and (event)="${attr === null || attr === void 0 ? void 0 : attr.name}.toggle(false)" -->\n`); }); } exports.dropdownRefComment = dropdownRefComment; //# sourceMappingURL=dropdown-ref-comment.js.map