UNPKG

@taiga-ui/cdk

Version:

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

87 lines 3.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HTML_COMMENTS = void 0; const elements_1 = require("../../../../utils/templates/elements"); const inputs_1 = require("../../../../utils/templates/inputs"); const dom_traversal_1 = require("../../../utils/templates/dom-traversal"); const migrate_css_variables_1 = require("../migrate-css-variables"); const STRING_LITERAL_RE = /^'[^']*'$/; exports.HTML_COMMENTS = [ { tag: '*', withAttrs: ['[appearance]'], filterFn: (element) => { var _a, _b; const value = (_b = (_a = (0, inputs_1.findAttr)(element.attrs, '[appearance]')) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.trim(); if (!value) { return false; } const alreadyMigrated = value.includes('positive') || value.includes('negative'); return !STRING_LITERAL_RE.test(value) && !alreadyMigrated; }, comment: '[appearance] binding uses a dynamic expression. If it can produce "error"/"success"/"glass", replace with "negative"/"positive"/"secondary-grayscale"', }, { tag: 'input', withAttrs: ['keySteps'], filterFn: (element) => (0, elements_1.hasElementAttribute)(element, 'max'), comment: 'dont use [max] property with [keySteps] – use [step]. When [keySteps] property is enabled, [step] means percentage of total track length. Learn more: https://taiga-ui.dev/next/components/slider#key-steps', }, { tag: 'tui-range', withAttrs: ['(activeThumbChange)'], comment: '(activeThumbChange) emits "start"/"end" instead of "left"/"right". Adjust your code accordingly', }, { tag: 'tui-accordion-item', withAttrs: [], comment: 'tui-accordion-item has been removed. Use new tuiAccordion instead. See example https://taiga-ui.dev/components/accordion', }, { tag: 'tui-accordion', filterFn: (element) => (0, dom_traversal_1.hasChild)(element, 'tui-accordion-item'), withAttrs: [], comment: 'tui-accordion-item has been removed. Use new tuiAccordion instead. See example https://taiga-ui.dev/components/accordion', }, { tag: '*', withAttrs: [ '[style.--tui-thickness.rem]', '[style.--tui-thickness.px]', '[style.--tui-thickness]', ], comment: migrate_css_variables_1.TUI_THICKNESS_COMMENT, }, { tag: 'tui-pagination', filterFn: (el) => (0, elements_1.hasElementAttributeWithValue)(el, 'size', 's'), withAttrs: ['size'], comment: 'use tui-pager instead', }, { tag: 'tui-accordion', withAttrs: ['rounded'], comment: 'rounded input has been removed. The previous rounded look can still be achieved with CSS. See example https://taiga-ui.dev/components/accordion#custom', }, { tag: 'timeline-steps', withAttrs: [], comment: 'timeline-steps has been removed. Use TuiStepper instead. See example https://taiga-ui.dev/navigation/stepper', }, { tag: '*', withAttrs: ['[directionOrder]', '(directionOrderChange)', '[(directionOrder)]'], comment: 'tuiDirectionOrder removed. Update types: TuiSortDirection (1 | -1) instead of "asc" | "desc"', }, { tag: 'tui-tag', withAttrs: [], comment: 'tui-tag/tuiTag migrated to tuiChip. Check visuals and content manually', }, { tag: 'button', withAttrs: ['tuiTag'], comment: 'tui-tag/tuiTag migrated to tuiChip. Check visuals and content manually', }, ]; //# sourceMappingURL=html-comments.js.map