@taiga-ui/cdk
Version:
Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance
67 lines • 2.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ATTR_WITH_VALUES_TO_REPLACE = void 0;
const elements_1 = require("../../../../utils/templates/elements");
const hasPseudoInvalid = [
'tui-checkbox',
'tui-checkbox-block',
'tui-radio',
'tui-radio-block',
'tui-radio-labeled',
'tui-checkbox-labeled',
'tui-toggle',
];
const hasPseudo = [...hasPseudoInvalid, 'button', 'a'];
exports.ATTR_WITH_VALUES_TO_REPLACE = [
{
attrNames: ['shape'],
newAttrName: '[style.border-radius.%]',
valueReplacer: [{ from: 'rounded', to: '100' }],
withTagNames: ['button'],
filterFn: (el) => (0, elements_1.hasElementAttribute)(el, 'tuiButton') ||
(0, elements_1.hasElementAttribute)(el, 'tuiIconButton'),
},
{
attrNames: ['tuiMode'],
newAttrName: 'tuiTheme',
valueReplacer: [
{ from: 'onDark', to: 'dark' },
{ from: 'onLight', to: 'light' },
],
},
{
attrNames: ['tuiHintAppearance'],
newAttrName: 'tuiHintAppearance',
valueReplacer: [{ from: 'onDark', to: 'dark' }],
},
{
attrNames: ['[pseudoActive]'],
newAttrName: '[tuiAppearanceState]',
withTagNames: hasPseudo,
valueReplacer: (condition) => `${condition} ? 'active' : null`,
},
{
attrNames: ['[pseudoInvalid]'],
newAttrName: '[tuiAppearanceMode]',
withTagNames: hasPseudoInvalid,
valueReplacer: (condition) => `${condition} ? 'invalid' : null`,
},
{
attrNames: ['[pseudoHover]'],
newAttrName: '[tuiAppearanceState]',
withTagNames: hasPseudo,
valueReplacer: (condition) => `${condition} ? 'hover' : null`,
},
{
attrNames: ['[pseudoDisabled]'],
newAttrName: '[tuiAppearanceState]',
withTagNames: ['tui-radio-block', 'tui-radio-labeled', 'tui-radio'],
valueReplacer: (condition) => `${condition} ? 'disabled' : null`,
},
{
attrNames: ['size'],
withTagNames: ['tui-data-list-wrapper'],
valueReplacer: [{ from: 'xs', to: 's' }],
},
];
//# sourceMappingURL=attr-with-values-to-replace.js.map