@ni/nimble-angular 17.1.17 → 17.1.19
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.
- package/directives/combobox/nimble-combobox-control-value-accessor.directive.d.ts +6 -2
- package/directives/list-option/nimble-combobox-list-option.directive.d.ts +3 -4
- package/esm2020/directives/combobox/nimble-combobox-control-value-accessor.directive.mjs +12 -1
- package/esm2020/directives/list-option/nimble-combobox-list-option.directive.mjs +5 -9
- package/esm2020/table-column/number-text/ni-nimble-angular-table-column-number-text.mjs +5 -0
- package/esm2020/table-column/number-text/nimble-table-column-number-text.directive.mjs +98 -0
- package/esm2020/table-column/number-text/nimble-table-column-number-text.module.mjs +19 -0
- package/esm2020/table-column/number-text/public-api.mjs +3 -0
- package/fesm2015/ni-nimble-angular-table-column-number-text.mjs +119 -0
- package/fesm2015/ni-nimble-angular-table-column-number-text.mjs.map +1 -0
- package/fesm2015/ni-nimble-angular.mjs +15 -8
- package/fesm2015/ni-nimble-angular.mjs.map +1 -1
- package/fesm2020/ni-nimble-angular-table-column-number-text.mjs +119 -0
- package/fesm2020/ni-nimble-angular-table-column-number-text.mjs.map +1 -0
- package/fesm2020/ni-nimble-angular.mjs +15 -8
- package/fesm2020/ni-nimble-angular.mjs.map +1 -1
- package/package.json +9 -1
- package/table-column/number-text/index.d.ts +5 -0
- package/table-column/number-text/nimble-table-column-number-text.directive.d.ts +30 -0
- package/table-column/number-text/nimble-table-column-number-text.module.d.ts +9 -0
- package/table-column/number-text/public-api.d.ts +2 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, Input, NgModule } from '@angular/core';
|
|
3
|
+
import { toNullableNumberProperty, toBooleanProperty } from '@ni/nimble-angular/internal-utilities';
|
|
4
|
+
import { NimbleTableColumnBaseDirective } from '@ni/nimble-angular/table-column';
|
|
5
|
+
export { tableColumnNumberTextTag } from '@ni/nimble-components/dist/esm/table-column/number-text';
|
|
6
|
+
export { NumberTextFormat } from '@ni/nimble-components/dist/esm/table-column/number-text/types';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Directive to provide Angular integration for the table column element for number text.
|
|
11
|
+
*/
|
|
12
|
+
class NimbleTableColumnNumberTextDirective extends NimbleTableColumnBaseDirective {
|
|
13
|
+
constructor(renderer, elementRef) {
|
|
14
|
+
super(renderer, elementRef);
|
|
15
|
+
}
|
|
16
|
+
get fieldName() {
|
|
17
|
+
return this.elementRef.nativeElement.fieldName;
|
|
18
|
+
}
|
|
19
|
+
// Renaming because property should have camel casing, but attribute should not
|
|
20
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
21
|
+
set fieldName(value) {
|
|
22
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'fieldName', value);
|
|
23
|
+
}
|
|
24
|
+
get format() {
|
|
25
|
+
return this.elementRef.nativeElement.format;
|
|
26
|
+
}
|
|
27
|
+
set format(value) {
|
|
28
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'format', value);
|
|
29
|
+
}
|
|
30
|
+
get decimalDigits() {
|
|
31
|
+
return this.elementRef.nativeElement.decimalDigits;
|
|
32
|
+
}
|
|
33
|
+
// Renaming because property should have camel casing, but attribute should not
|
|
34
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
35
|
+
set decimalDigits(value) {
|
|
36
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'decimalDigits', toNullableNumberProperty(value));
|
|
37
|
+
}
|
|
38
|
+
get fractionalWidth() {
|
|
39
|
+
return this.elementRef.nativeElement.fractionalWidth;
|
|
40
|
+
}
|
|
41
|
+
// Renaming because property should have camel casing, but attribute should not
|
|
42
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
43
|
+
set fractionalWidth(value) {
|
|
44
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'fractionalWidth', toNullableNumberProperty(value));
|
|
45
|
+
}
|
|
46
|
+
get minPixelWidth() {
|
|
47
|
+
return this.elementRef.nativeElement.minPixelWidth;
|
|
48
|
+
}
|
|
49
|
+
// Renaming because property should have camel casing, but attribute should not
|
|
50
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
51
|
+
set minPixelWidth(value) {
|
|
52
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'minPixelWidth', toNullableNumberProperty(value));
|
|
53
|
+
}
|
|
54
|
+
get groupIndex() {
|
|
55
|
+
return this.elementRef.nativeElement.groupIndex;
|
|
56
|
+
}
|
|
57
|
+
// Renaming because property should have camel casing, but attribute should not
|
|
58
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
59
|
+
set groupIndex(value) {
|
|
60
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'groupIndex', toNullableNumberProperty(value));
|
|
61
|
+
}
|
|
62
|
+
get groupingDisabled() {
|
|
63
|
+
return this.elementRef.nativeElement.groupingDisabled;
|
|
64
|
+
}
|
|
65
|
+
// Renaming because property should have camel casing, but attribute should not
|
|
66
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
67
|
+
set groupingDisabled(value) {
|
|
68
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'groupingDisabled', toBooleanProperty(value));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
NimbleTableColumnNumberTextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NimbleTableColumnNumberTextDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
72
|
+
NimbleTableColumnNumberTextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NimbleTableColumnNumberTextDirective, selector: "nimble-table-column-number-text", inputs: { fieldName: ["field-name", "fieldName"], format: "format", decimalDigits: ["decimal-digits", "decimalDigits"], fractionalWidth: ["fractional-width", "fractionalWidth"], minPixelWidth: ["min-pixel-width", "minPixelWidth"], groupIndex: ["group-index", "groupIndex"], groupingDisabled: ["grouping-disabled", "groupingDisabled"] }, usesInheritance: true, ngImport: i0 });
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NimbleTableColumnNumberTextDirective, decorators: [{
|
|
74
|
+
type: Directive,
|
|
75
|
+
args: [{
|
|
76
|
+
selector: 'nimble-table-column-number-text'
|
|
77
|
+
}]
|
|
78
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { fieldName: [{
|
|
79
|
+
type: Input,
|
|
80
|
+
args: ['field-name']
|
|
81
|
+
}], format: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], decimalDigits: [{
|
|
84
|
+
type: Input,
|
|
85
|
+
args: ['decimal-digits']
|
|
86
|
+
}], fractionalWidth: [{
|
|
87
|
+
type: Input,
|
|
88
|
+
args: ['fractional-width']
|
|
89
|
+
}], minPixelWidth: [{
|
|
90
|
+
type: Input,
|
|
91
|
+
args: ['min-pixel-width']
|
|
92
|
+
}], groupIndex: [{
|
|
93
|
+
type: Input,
|
|
94
|
+
args: ['group-index']
|
|
95
|
+
}], groupingDisabled: [{
|
|
96
|
+
type: Input,
|
|
97
|
+
args: ['grouping-disabled']
|
|
98
|
+
}] } });
|
|
99
|
+
|
|
100
|
+
class NimbleTableColumnNumberTextModule {
|
|
101
|
+
}
|
|
102
|
+
NimbleTableColumnNumberTextModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NimbleTableColumnNumberTextModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
103
|
+
NimbleTableColumnNumberTextModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: NimbleTableColumnNumberTextModule, declarations: [NimbleTableColumnNumberTextDirective], imports: [CommonModule], exports: [NimbleTableColumnNumberTextDirective] });
|
|
104
|
+
NimbleTableColumnNumberTextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NimbleTableColumnNumberTextModule, imports: [CommonModule] });
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NimbleTableColumnNumberTextModule, decorators: [{
|
|
106
|
+
type: NgModule,
|
|
107
|
+
args: [{
|
|
108
|
+
declarations: [NimbleTableColumnNumberTextDirective],
|
|
109
|
+
imports: [CommonModule],
|
|
110
|
+
exports: [NimbleTableColumnNumberTextDirective]
|
|
111
|
+
}]
|
|
112
|
+
}] });
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Generated bundle index. Do not edit.
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
export { NimbleTableColumnNumberTextDirective, NimbleTableColumnNumberTextModule };
|
|
119
|
+
//# sourceMappingURL=ni-nimble-angular-table-column-number-text.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ni-nimble-angular-table-column-number-text.mjs","sources":["../../../../projects/ni/nimble-angular/table-column/number-text/nimble-table-column-number-text.directive.ts","../../../../projects/ni/nimble-angular/table-column/number-text/nimble-table-column-number-text.module.ts","../../../../projects/ni/nimble-angular/table-column/number-text/ni-nimble-angular-table-column-number-text.ts"],"sourcesContent":["import { Directive, ElementRef, Input, Renderer2 } from '@angular/core';\nimport { BooleanValueOrAttribute, NumberValueOrAttribute, toBooleanProperty, toNullableNumberProperty } from '@ni/nimble-angular/internal-utilities';\nimport { NimbleTableColumnBaseDirective } from '@ni/nimble-angular/table-column';\nimport { type TableColumnNumberText, tableColumnNumberTextTag } from '@ni/nimble-components/dist/esm/table-column/number-text';\nimport { NumberTextFormat } from '@ni/nimble-components/dist/esm/table-column/number-text/types';\n\nexport type { TableColumnNumberText };\nexport { tableColumnNumberTextTag, NumberTextFormat };\n\n/**\n * Directive to provide Angular integration for the table column element for number text.\n */\n@Directive({\n selector: 'nimble-table-column-number-text'\n})\nexport class NimbleTableColumnNumberTextDirective extends NimbleTableColumnBaseDirective<TableColumnNumberText> {\n public get fieldName(): string | undefined {\n return this.elementRef.nativeElement.fieldName;\n }\n\n // Renaming because property should have camel casing, but attribute should not\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('field-name') public set fieldName(value: string | undefined) {\n this.renderer.setProperty(this.elementRef.nativeElement, 'fieldName', value);\n }\n\n public get format(): NumberTextFormat {\n return this.elementRef.nativeElement.format;\n }\n\n @Input() public set format(value: NumberTextFormat) {\n this.renderer.setProperty(this.elementRef.nativeElement, 'format', value);\n }\n\n public get decimalDigits(): number | null | undefined {\n return this.elementRef.nativeElement.decimalDigits;\n }\n\n // Renaming because property should have camel casing, but attribute should not\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('decimal-digits') public set decimalDigits(value: NumberValueOrAttribute | null | undefined) {\n this.renderer.setProperty(this.elementRef.nativeElement, 'decimalDigits', toNullableNumberProperty(value));\n }\n\n public get fractionalWidth(): number | null | undefined {\n return this.elementRef.nativeElement.fractionalWidth;\n }\n\n // Renaming because property should have camel casing, but attribute should not\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('fractional-width') public set fractionalWidth(value: NumberValueOrAttribute | null | undefined) {\n this.renderer.setProperty(this.elementRef.nativeElement, 'fractionalWidth', toNullableNumberProperty(value));\n }\n\n public get minPixelWidth(): number | null | undefined {\n return this.elementRef.nativeElement.minPixelWidth;\n }\n\n // Renaming because property should have camel casing, but attribute should not\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('min-pixel-width') public set minPixelWidth(value: NumberValueOrAttribute | null | undefined) {\n this.renderer.setProperty(this.elementRef.nativeElement, 'minPixelWidth', toNullableNumberProperty(value));\n }\n\n public get groupIndex(): number | null | undefined {\n return this.elementRef.nativeElement.groupIndex;\n }\n\n // Renaming because property should have camel casing, but attribute should not\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('group-index') public set groupIndex(value: NumberValueOrAttribute | null | undefined) {\n this.renderer.setProperty(this.elementRef.nativeElement, 'groupIndex', toNullableNumberProperty(value));\n }\n\n public get groupingDisabled(): boolean {\n return this.elementRef.nativeElement.groupingDisabled;\n }\n\n // Renaming because property should have camel casing, but attribute should not\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('grouping-disabled') public set groupingDisabled(value: BooleanValueOrAttribute) {\n this.renderer.setProperty(this.elementRef.nativeElement, 'groupingDisabled', toBooleanProperty(value));\n }\n\n public constructor(renderer: Renderer2, elementRef: ElementRef<TableColumnNumberText>) {\n super(renderer, elementRef);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NimbleTableColumnNumberTextDirective } from './nimble-table-column-number-text.directive';\n\nimport '@ni/nimble-components/dist/esm/table-column/number-text';\n\n@NgModule({\n declarations: [NimbleTableColumnNumberTextDirective],\n imports: [CommonModule],\n exports: [NimbleTableColumnNumberTextDirective]\n})\nexport class NimbleTableColumnNumberTextModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AASA;;AAEG;AAIG,MAAO,oCAAqC,SAAQ,8BAAqD,CAAA;IAqE3G,WAAmB,CAAA,QAAmB,EAAE,UAA6C,EAAA;AACjF,QAAA,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;KAC/B;AAtED,IAAA,IAAW,SAAS,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;KAClD;;;IAID,IAAgC,SAAS,CAAC,KAAyB,EAAA;AAC/D,QAAA,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;KAChF;AAED,IAAA,IAAW,MAAM,GAAA;AACb,QAAA,OAAO,IAAI,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,6 +1240,7 @@ class NimbleComboboxControlValueAccessorDirective {
|
|
|
1240
1240
|
this._renderer = _renderer;
|
|
1241
1241
|
this._elementRef = _elementRef;
|
|
1242
1242
|
this._optionMap = new Map();
|
|
1243
|
+
this._optionUpdateQueue = [];
|
|
1243
1244
|
this._compareWith = Object.is;
|
|
1244
1245
|
}
|
|
1245
1246
|
/**
|
|
@@ -1253,6 +1254,12 @@ class NimbleComboboxControlValueAccessorDirective {
|
|
|
1253
1254
|
}
|
|
1254
1255
|
this._compareWith = fn;
|
|
1255
1256
|
}
|
|
1257
|
+
ngAfterViewChecked() {
|
|
1258
|
+
for (const updateValue of this._optionUpdateQueue) {
|
|
1259
|
+
this.addOption(updateValue.listOption.text, updateValue.modelValue);
|
|
1260
|
+
}
|
|
1261
|
+
this._optionUpdateQueue = [];
|
|
1262
|
+
}
|
|
1256
1263
|
/**
|
|
1257
1264
|
* Updates the underlying nimble-combobox value with the expected display string.
|
|
1258
1265
|
* @param value The ngValue set on the nimble-combobox
|
|
@@ -1302,6 +1309,10 @@ class NimbleComboboxControlValueAccessorDirective {
|
|
|
1302
1309
|
removeOption(displayValue) {
|
|
1303
1310
|
this._optionMap.delete(displayValue);
|
|
1304
1311
|
}
|
|
1312
|
+
queueOptionUpdate(listOption, modelValue) {
|
|
1313
|
+
this.removeOption(listOption.text);
|
|
1314
|
+
this._optionUpdateQueue.push({ listOption, modelValue });
|
|
1315
|
+
}
|
|
1305
1316
|
updateDisplayValue() {
|
|
1306
1317
|
const valueAsString = this.getValueStringFromValue(this._modelValue);
|
|
1307
1318
|
this.setProperty('value', valueAsString ?? '');
|
|
@@ -6491,10 +6502,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
6491
6502
|
* Directive to provide Angular integration for the list option when used with a combobox.
|
|
6492
6503
|
*/
|
|
6493
6504
|
class NimbleComboboxListOptionDirective {
|
|
6494
|
-
constructor(elementRef, renderer,
|
|
6505
|
+
constructor(elementRef, renderer, combobox) {
|
|
6495
6506
|
this.elementRef = elementRef;
|
|
6496
6507
|
this.renderer = renderer;
|
|
6497
|
-
this.changeDetector = changeDetector;
|
|
6498
6508
|
this.combobox = combobox;
|
|
6499
6509
|
this._modelValue = undefined;
|
|
6500
6510
|
}
|
|
@@ -6526,20 +6536,17 @@ class NimbleComboboxListOptionDirective {
|
|
|
6526
6536
|
}
|
|
6527
6537
|
}
|
|
6528
6538
|
updateComboboxValue(value) {
|
|
6529
|
-
this.combobox.
|
|
6530
|
-
this.changeDetector.detectChanges();
|
|
6531
|
-
this._currentTextContent = this.elementRef.nativeElement.text;
|
|
6532
|
-
this.combobox.addOption(this._currentTextContent, value);
|
|
6539
|
+
this.combobox.queueOptionUpdate(this.elementRef.nativeElement, value);
|
|
6533
6540
|
}
|
|
6534
6541
|
}
|
|
6535
|
-
NimbleComboboxListOptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NimbleComboboxListOptionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token:
|
|
6542
|
+
NimbleComboboxListOptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NimbleComboboxListOptionDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: NimbleComboboxControlValueAccessorDirective, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6536
6543
|
NimbleComboboxListOptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: NimbleComboboxListOptionDirective, selector: "nimble-list-option", inputs: { disabled: "disabled", ngValue: "ngValue" }, ngImport: i0 });
|
|
6537
6544
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: NimbleComboboxListOptionDirective, decorators: [{
|
|
6538
6545
|
type: Directive,
|
|
6539
6546
|
args: [{
|
|
6540
6547
|
selector: 'nimble-list-option'
|
|
6541
6548
|
}]
|
|
6542
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type:
|
|
6549
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: NimbleComboboxControlValueAccessorDirective, decorators: [{
|
|
6543
6550
|
type: Inject,
|
|
6544
6551
|
args: [NimbleComboboxControlValueAccessorDirective]
|
|
6545
6552
|
}, {
|