@taiga-ui/addon-commerce
Version:
Extension package for Taiga UI related to commerce, payment systems, currencies etc.
28 lines (24 loc) • 1.19 kB
JavaScript
import * as i0 from '@angular/core';
import { Pipe } from '@angular/core';
import { CHAR_NO_BREAK_SPACE } from '@taiga-ui/cdk/constants';
class TuiFormatCardPipe {
transform(value = '', cardPrefilled = false) {
return value && !cardPrefilled
? value
.split('')
.map((char, index) => index && index % 4 === 0 ? `${CHAR_NO_BREAK_SPACE}${char}` : char)
.join('')
: '';
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TuiFormatCardPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.21", ngImport: i0, type: TuiFormatCardPipe, isStandalone: true, name: "tuiFormatCard" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: TuiFormatCardPipe, decorators: [{
type: Pipe,
args: [{ name: 'tuiFormatCard' }]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { TuiFormatCardPipe };
//# sourceMappingURL=taiga-ui-addon-commerce-pipes-format-card.mjs.map