@ni/nimble-angular 34.0.1 → 34.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Pipe, LOCALE_ID, Inject } from '@angular/core';
|
|
3
3
|
import { diacriticInsensitiveStringNormalizer } from '@ni/nimble-components/dist/esm/utilities/models/string-normalizers';
|
|
4
|
+
import { DateTextFormatter } from '@ni/nimble-components/dist/esm/table-column/date-text/models/date-text-formatter';
|
|
4
5
|
import { DurationFormatter } from '@ni/nimble-components/dist/esm/table-column/duration-text/models/duration-formatter';
|
|
5
6
|
import { UnitFormatNumberText } from '@ni/nimble-components/dist/esm/table-column/number-text/models/unit-format-number-text';
|
|
6
7
|
export { unitScaleByte } from '@ni/unit-format/unit-scale/byte';
|
|
@@ -28,6 +29,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
28
29
|
}]
|
|
29
30
|
}] });
|
|
30
31
|
|
|
32
|
+
/**
|
|
33
|
+
* A pipe that transforms date values into localized date strings.
|
|
34
|
+
*/
|
|
35
|
+
class DateTextPipe {
|
|
36
|
+
constructor(locale) {
|
|
37
|
+
this.locale = locale;
|
|
38
|
+
}
|
|
39
|
+
transform(value, options) {
|
|
40
|
+
if (!this.dateTextFormatter?.optionsMatch(options)) {
|
|
41
|
+
this.dateTextFormatter = new DateTextFormatter(this.locale, options);
|
|
42
|
+
}
|
|
43
|
+
return this.dateTextFormatter.format(value);
|
|
44
|
+
}
|
|
45
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: DateTextPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
46
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.23", ngImport: i0, type: DateTextPipe, isStandalone: true, name: "dateText" }); }
|
|
47
|
+
}
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: DateTextPipe, decorators: [{
|
|
49
|
+
type: Pipe,
|
|
50
|
+
args: [{
|
|
51
|
+
name: 'dateText',
|
|
52
|
+
standalone: true
|
|
53
|
+
}]
|
|
54
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
55
|
+
type: Inject,
|
|
56
|
+
args: [LOCALE_ID]
|
|
57
|
+
}] }] });
|
|
58
|
+
|
|
31
59
|
/**
|
|
32
60
|
* A pipe that transforms a number of milliseconds (string/number) into a string formatted like "1 day, 2 hr, 3 min, 4.567 sec"
|
|
33
61
|
*/
|
|
@@ -87,5 +115,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
87
115
|
* Generated bundle index. Do not edit.
|
|
88
116
|
*/
|
|
89
117
|
|
|
90
|
-
export { DiacriticInsensitivePipe, DurationPipe, NumberTextPipe };
|
|
118
|
+
export { DateTextPipe, DiacriticInsensitivePipe, DurationPipe, NumberTextPipe };
|
|
91
119
|
//# sourceMappingURL=ni-nimble-angular-pipes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ni-nimble-angular-pipes.mjs","sources":["../../../nimble-angular/pipes/diacritic-insensitive.pipe.ts","../../../nimble-angular/pipes/duration.pipe.ts","../../../nimble-angular/pipes/number-text.pipe.ts","../../../nimble-angular/pipes/ni-nimble-angular-pipes.ts"],"sourcesContent":["import { Pipe, type PipeTransform } from '@angular/core';\nimport { diacriticInsensitiveStringNormalizer } from '@ni/nimble-components/dist/esm/utilities/models/string-normalizers';\n\n/**\n * Generic normalize pipe that removes the accents and special characters.\n * This pipe can be used to normalize a string before performing diacritic-insensitive string comparisons.\n */\n@Pipe({\n name: 'diacritic-insensitive',\n standalone: true\n})\nexport class DiacriticInsensitivePipe implements PipeTransform {\n public transform(value: string): string {\n return diacriticInsensitiveStringNormalizer(value);\n }\n}\n","import { Inject, LOCALE_ID, Pipe, type PipeTransform } from '@angular/core';\nimport { DurationFormatter } from '@ni/nimble-components/dist/esm/table-column/duration-text/models/duration-formatter';\n\n/**\n * A pipe that transforms a number of milliseconds (string/number) into a string formatted like \"1 day, 2 hr, 3 min, 4.567 sec\"\n */\n@Pipe({\n name: 'duration',\n standalone: true\n})\nexport class DurationPipe implements PipeTransform {\n private readonly durationFormatter;\n\n public constructor(@Inject(LOCALE_ID) locale: string) {\n this.durationFormatter = new DurationFormatter(locale);\n }\n\n public transform(timeInMilliseconds: string | number | null | undefined): string {\n const milliseconds = this.parseDuration(timeInMilliseconds);\n return this.durationFormatter.format(milliseconds);\n }\n\n private parseDuration(duration: string | number | null | undefined): number | null | undefined {\n return typeof duration === 'string' ? parseFloat(duration) : duration;\n }\n}\n","import { Inject, LOCALE_ID, Pipe, type PipeTransform } from '@angular/core';\nimport { UnitFormatNumberText, type UnitFormatNumberTextOptions } from '@ni/nimble-components/dist/esm/table-column/number-text/models/unit-format-number-text';\n\n/**\n * A pipe that transforms a number into a string with optional unit\n */\n@Pipe({\n name: 'numberText',\n standalone: true\n})\nexport class NumberTextPipe implements PipeTransform {\n /**\n * @internal\n */\n public unitFormatNumberText?: UnitFormatNumberText;\n\n public constructor(@Inject(LOCALE_ID) private readonly locale: string) {}\n\n public transform(value: number, options?: UnitFormatNumberTextOptions): string {\n if (!this.unitFormatNumberText?.optionsMatch(options)) {\n this.unitFormatNumberText = new UnitFormatNumberText(this.locale, options);\n }\n return this.unitFormatNumberText.format(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ni-nimble-angular-pipes.mjs","sources":["../../../nimble-angular/pipes/diacritic-insensitive.pipe.ts","../../../nimble-angular/pipes/date-text.pipe.ts","../../../nimble-angular/pipes/duration.pipe.ts","../../../nimble-angular/pipes/number-text.pipe.ts","../../../nimble-angular/pipes/ni-nimble-angular-pipes.ts"],"sourcesContent":["import { Pipe, type PipeTransform } from '@angular/core';\nimport { diacriticInsensitiveStringNormalizer } from '@ni/nimble-components/dist/esm/utilities/models/string-normalizers';\n\n/**\n * Generic normalize pipe that removes the accents and special characters.\n * This pipe can be used to normalize a string before performing diacritic-insensitive string comparisons.\n */\n@Pipe({\n name: 'diacritic-insensitive',\n standalone: true\n})\nexport class DiacriticInsensitivePipe implements PipeTransform {\n public transform(value: string): string {\n return diacriticInsensitiveStringNormalizer(value);\n }\n}\n","import { Inject, LOCALE_ID, Pipe, type PipeTransform } from '@angular/core';\nimport { DateTextFormatter } from '@ni/nimble-components/dist/esm/table-column/date-text/models/date-text-formatter';\nimport type { SupportedIntlDateTimeFormatOptions } from '@ni/nimble-components/dist/esm/table-column/date-text/types';\n\n/**\n * A pipe that transforms date values into localized date strings.\n */\n@Pipe({\n name: 'dateText',\n standalone: true\n})\nexport class DateTextPipe implements PipeTransform {\n private dateTextFormatter?: DateTextFormatter;\n\n public constructor(@Inject(LOCALE_ID) private readonly locale: string) {}\n\n public transform(\n value: Date | number | null | undefined,\n options?: SupportedIntlDateTimeFormatOptions\n ): string {\n if (!this.dateTextFormatter?.optionsMatch(options)) {\n this.dateTextFormatter = new DateTextFormatter(this.locale, options);\n }\n return this.dateTextFormatter.format(value);\n }\n}","import { Inject, LOCALE_ID, Pipe, type PipeTransform } from '@angular/core';\nimport { DurationFormatter } from '@ni/nimble-components/dist/esm/table-column/duration-text/models/duration-formatter';\n\n/**\n * A pipe that transforms a number of milliseconds (string/number) into a string formatted like \"1 day, 2 hr, 3 min, 4.567 sec\"\n */\n@Pipe({\n name: 'duration',\n standalone: true\n})\nexport class DurationPipe implements PipeTransform {\n private readonly durationFormatter;\n\n public constructor(@Inject(LOCALE_ID) locale: string) {\n this.durationFormatter = new DurationFormatter(locale);\n }\n\n public transform(timeInMilliseconds: string | number | null | undefined): string {\n const milliseconds = this.parseDuration(timeInMilliseconds);\n return this.durationFormatter.format(milliseconds);\n }\n\n private parseDuration(duration: string | number | null | undefined): number | null | undefined {\n return typeof duration === 'string' ? parseFloat(duration) : duration;\n }\n}\n","import { Inject, LOCALE_ID, Pipe, type PipeTransform } from '@angular/core';\nimport { UnitFormatNumberText, type UnitFormatNumberTextOptions } from '@ni/nimble-components/dist/esm/table-column/number-text/models/unit-format-number-text';\n\n/**\n * A pipe that transforms a number into a string with optional unit\n */\n@Pipe({\n name: 'numberText',\n standalone: true\n})\nexport class NumberTextPipe implements PipeTransform {\n /**\n * @internal\n */\n public unitFormatNumberText?: UnitFormatNumberText;\n\n public constructor(@Inject(LOCALE_ID) private readonly locale: string) {}\n\n public transform(value: number, options?: UnitFormatNumberTextOptions): string {\n if (!this.unitFormatNumberText?.optionsMatch(options)) {\n this.unitFormatNumberText = new UnitFormatNumberText(this.locale, options);\n }\n return this.unitFormatNumberText.format(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAGA;;;AAGG;MAKU,wBAAwB,CAAA;AAC1B,IAAA,SAAS,CAAC,KAAa,EAAA;AAC1B,QAAA,OAAO,oCAAoC,CAAC,KAAK,CAAC;IACtD;+GAHS,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,uBAAA,EAAA,CAAA,CAAA;;4FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,uBAAuB;AAC7B,oBAAA,UAAU,EAAE;AACf,iBAAA;;;ACND;;AAEG;MAKU,YAAY,CAAA;AAGrB,IAAA,WAAA,CAAuD,MAAc,EAAA;QAAd,IAAA,CAAA,MA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cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,YAAY;AAClB,oBAAA,UAAU,EAAE;AACf,iBAAA;;0BAOuB,MAAM;2BAAC,SAAS;;;AChBxC;;AAEG;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ni/nimble-angular",
|
|
3
|
-
"version": "34.0
|
|
3
|
+
"version": "34.1.0",
|
|
4
4
|
"description": "Angular components for the NI Nimble Design System",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
"@angular/forms": "^21.2.21",
|
|
224
224
|
"@angular/localize": "^21.2.21",
|
|
225
225
|
"@angular/router": "^21.2.21",
|
|
226
|
-
"@ni/nimble-components": "^35.
|
|
226
|
+
"@ni/nimble-components": "^35.14.0",
|
|
227
227
|
"@ni/unit-format": "^1.0.7"
|
|
228
228
|
},
|
|
229
229
|
"module": "fesm2022/ni-nimble-angular.mjs",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
|
+
import { SupportedIntlDateTimeFormatOptions } from '@ni/nimble-components/dist/esm/table-column/date-text/types';
|
|
3
4
|
import { UnitFormatNumberText, UnitFormatNumberTextOptions } from '@ni/nimble-components/dist/esm/table-column/number-text/models/unit-format-number-text';
|
|
4
5
|
export { unitScaleByte } from '@ni/unit-format/unit-scale/byte';
|
|
5
6
|
export { unitScaleByte1024 } from '@ni/unit-format/unit-scale/byte-1024';
|
|
@@ -17,6 +18,18 @@ declare class DiacriticInsensitivePipe implements PipeTransform {
|
|
|
17
18
|
static ɵpipe: i0.ɵɵPipeDeclaration<DiacriticInsensitivePipe, "diacritic-insensitive", true>;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
/**
|
|
22
|
+
* A pipe that transforms date values into localized date strings.
|
|
23
|
+
*/
|
|
24
|
+
declare class DateTextPipe implements PipeTransform {
|
|
25
|
+
private readonly locale;
|
|
26
|
+
private dateTextFormatter?;
|
|
27
|
+
constructor(locale: string);
|
|
28
|
+
transform(value: Date | number | null | undefined, options?: SupportedIntlDateTimeFormatOptions): string;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DateTextPipe, never>;
|
|
30
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<DateTextPipe, "dateText", true>;
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
/**
|
|
21
34
|
* A pipe that transforms a number of milliseconds (string/number) into a string formatted like "1 day, 2 hr, 3 min, 4.567 sec"
|
|
22
35
|
*/
|
|
@@ -44,4 +57,4 @@ declare class NumberTextPipe implements PipeTransform {
|
|
|
44
57
|
static ɵpipe: i0.ɵɵPipeDeclaration<NumberTextPipe, "numberText", true>;
|
|
45
58
|
}
|
|
46
59
|
|
|
47
|
-
export { DiacriticInsensitivePipe, DurationPipe, NumberTextPipe };
|
|
60
|
+
export { DateTextPipe, DiacriticInsensitivePipe, DurationPipe, NumberTextPipe };
|