UNPKG

@progress/kendo-angular-grid

Version:

Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.

38 lines (37 loc) 1.78 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Pipe } from '@angular/core'; import { isString } from '../../utils'; import { IntlService } from '@progress/kendo-angular-intl'; import * as i0 from "@angular/core"; import * as i1 from "@progress/kendo-angular-intl"; const FORMAT_REGEX = /\{\d+:?/; /** * @hidden */ export class FormatPipe { intlService; constructor(intlService) { this.intlService = intlService; } transform(value, format) { const intl = this.intlService; if (isString(format) && FORMAT_REGEX.exec(format)) { return intl.format(format, value); } return intl.toString(value, format); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormatPipe, deps: [{ token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Pipe }); static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.14", ngImport: i0, type: FormatPipe, isStandalone: true, name: "format", pure: false }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: FormatPipe, decorators: [{ type: Pipe, args: [{ // eslint-disable-next-line @angular-eslint/pipe-prefix name: 'format', pure: false, standalone: true }] }], ctorParameters: () => [{ type: i1.IntlService }] });