@ni/nimble-components 20.1.14 → 20.1.16
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/dist/all-components-bundle.js +31 -12
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +381 -373
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/docs/types.d.ts +6 -0
- package/dist/esm/src/table-column/base/models/column-validator.d.ts +0 -4
- package/dist/esm/src/table-column/number-text/index.d.ts +13 -1
- package/dist/esm/src/table-column/number-text/models/decimal-formatter.d.ts +9 -0
- package/dist/esm/src/table-column/number-text/models/table-column-number-text-validitor.d.ts +13 -0
- package/dist/esm/src/table-column/number-text/types.d.ts +11 -0
- package/dist/esm/src/table-column/text-base/cell-view/index.d.ts +5 -0
- package/dist/esm/src/table-column/text-base/cell-view/types.d.ts +8 -0
- package/dist/esm/table-column/base/models/column-validator.d.ts +0 -4
- package/dist/esm/table-column/base/models/column-validator.js +0 -6
- package/dist/esm/table-column/base/models/column-validator.js.map +1 -1
- package/dist/esm/table-column/number-text/cell-view/index.js +2 -0
- package/dist/esm/table-column/number-text/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/number-text/index.d.ts +13 -1
- package/dist/esm/table-column/number-text/index.js +53 -6
- package/dist/esm/table-column/number-text/index.js.map +1 -1
- package/dist/esm/table-column/number-text/models/decimal-formatter.d.ts +9 -0
- package/dist/esm/table-column/number-text/models/decimal-formatter.js +21 -0
- package/dist/esm/table-column/number-text/models/decimal-formatter.js.map +1 -0
- package/dist/esm/table-column/number-text/models/table-column-number-text-validitor.d.ts +13 -0
- package/dist/esm/table-column/number-text/models/table-column-number-text-validitor.js +28 -0
- package/dist/esm/table-column/number-text/models/table-column-number-text-validitor.js.map +1 -0
- package/dist/esm/table-column/number-text/types.d.ts +11 -0
- package/dist/esm/table-column/number-text/types.js +11 -1
- package/dist/esm/table-column/number-text/types.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/index.d.ts +5 -0
- package/dist/esm/table-column/text-base/cell-view/index.js +8 -0
- package/dist/esm/table-column/text-base/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/styles.js +4 -0
- package/dist/esm/table-column/text-base/cell-view/styles.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/template.js +12 -5
- package/dist/esm/table-column/text-base/cell-view/template.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/types.d.ts +8 -0
- package/dist/esm/table-column/text-base/cell-view/types.js +8 -0
- package/dist/esm/table-column/text-base/cell-view/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const ComponentFrameworkStatus: {
|
|
2
|
+
readonly ready: "ready";
|
|
3
|
+
readonly incubating: "incubating";
|
|
4
|
+
readonly doesNotExist: "does_not_exist";
|
|
5
|
+
};
|
|
6
|
+
export declare type ComponentFrameworkStatus = (typeof ComponentFrameworkStatus)[keyof typeof ComponentFrameworkStatus];
|
|
@@ -7,10 +7,6 @@ import type { ColumnInternals } from './column-internals';
|
|
|
7
7
|
export declare class ColumnValidator<ValidityFlagNames extends readonly string[]> extends Validator<ValidityFlagNames> {
|
|
8
8
|
private readonly columnInternals;
|
|
9
9
|
constructor(columnInternals: ColumnInternals<unknown>, configValidityKeys: ValidityFlagNames);
|
|
10
|
-
/**
|
|
11
|
-
* @returns whether the entire column configuration is valid
|
|
12
|
-
*/
|
|
13
|
-
isValidColumn(): boolean;
|
|
14
10
|
/**
|
|
15
11
|
* @returns an object containing flags for various ways the configuation can be invalid
|
|
16
12
|
*/
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { TableNumberField } from '../../table/types';
|
|
2
2
|
import { TableColumnTextBase } from '../text-base';
|
|
3
|
+
import { TableColumnValidity } from '../base/types';
|
|
3
4
|
import type { ColumnInternalsOptions } from '../base/models/column-internals';
|
|
4
|
-
import { NumberTextFormat } from './types';
|
|
5
|
+
import { NumberTextAlignment, NumberTextFormat } from './types';
|
|
5
6
|
import type { NumberFormatter } from './models/number-formatter';
|
|
7
|
+
import { TableColumnNumberTextValidator } from './models/table-column-number-text-validitor';
|
|
8
|
+
import { TextCellViewBaseAlignment } from '../text-base/cell-view/types';
|
|
6
9
|
export declare type TableColumnNumberTextCellRecord = TableNumberField<'value'>;
|
|
7
10
|
export interface TableColumnNumberTextColumnConfig {
|
|
8
11
|
formatter: NumberFormatter;
|
|
12
|
+
alignment: TextCellViewBaseAlignment;
|
|
9
13
|
}
|
|
10
14
|
declare global {
|
|
11
15
|
interface HTMLElementTagNameMap {
|
|
@@ -16,11 +20,19 @@ declare global {
|
|
|
16
20
|
* The table column for displaying numbers as text.
|
|
17
21
|
*/
|
|
18
22
|
export declare class TableColumnNumberText extends TableColumnTextBase {
|
|
23
|
+
/** @internal */
|
|
24
|
+
validator: TableColumnNumberTextValidator;
|
|
19
25
|
format: NumberTextFormat;
|
|
26
|
+
alignment: NumberTextAlignment;
|
|
27
|
+
decimalDigits?: number;
|
|
20
28
|
connectedCallback(): void;
|
|
29
|
+
get validity(): TableColumnValidity;
|
|
21
30
|
protected getColumnInternalsOptions(): ColumnInternalsOptions;
|
|
22
31
|
private formatChanged;
|
|
32
|
+
private alignmentChanged;
|
|
33
|
+
private decimalDigitsChanged;
|
|
23
34
|
private updateColumnConfig;
|
|
24
35
|
private createFormatter;
|
|
36
|
+
private determineCellContentAlignment;
|
|
25
37
|
}
|
|
26
38
|
export declare const tableColumnNumberTextTag: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NumberFormatter } from './number-formatter';
|
|
2
|
+
/**
|
|
3
|
+
* The formatter for a number-text column whose format is configured to be 'decimal'.
|
|
4
|
+
*/
|
|
5
|
+
export declare class DecimalFormatter extends NumberFormatter {
|
|
6
|
+
private readonly formatter;
|
|
7
|
+
constructor(decimalsToDisplay: number);
|
|
8
|
+
protected format(number: number): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ColumnInternals } from '../../base/models/column-internals';
|
|
2
|
+
import { ColumnValidator } from '../../base/models/column-validator';
|
|
3
|
+
import { NumberTextFormat } from '../types';
|
|
4
|
+
declare const numberTextValidityFlagNames: readonly ["invalidDecimalDigits"];
|
|
5
|
+
/**
|
|
6
|
+
* Validator for TableColumnNumberText.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TableColumnNumberTextValidator extends ColumnValidator<typeof numberTextValidityFlagNames> {
|
|
9
|
+
constructor(columnInternals: ColumnInternals<unknown>);
|
|
10
|
+
validateDecimalDigits(format: NumberTextFormat, decimalDigits: number | undefined): void;
|
|
11
|
+
private isInvalidDecimalDigitsValue;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -4,5 +4,16 @@
|
|
|
4
4
|
export declare const NumberTextFormat: {
|
|
5
5
|
readonly default: undefined;
|
|
6
6
|
readonly roundToInteger: "round-to-integer";
|
|
7
|
+
readonly decimal: "decimal";
|
|
7
8
|
};
|
|
8
9
|
export declare type NumberTextFormat = (typeof NumberTextFormat)[keyof typeof NumberTextFormat];
|
|
10
|
+
/**
|
|
11
|
+
* The aligment of the value in the number-text table column.
|
|
12
|
+
* The `default` alignment is determined by the column's `NumberTextFormat`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const NumberTextAlignment: {
|
|
15
|
+
readonly default: undefined;
|
|
16
|
+
readonly left: "left";
|
|
17
|
+
readonly right: "right";
|
|
18
|
+
};
|
|
19
|
+
export declare type NumberTextAlignment = (typeof NumberTextAlignment)[keyof typeof NumberTextAlignment];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TableCellView } from '../../base/cell-view';
|
|
2
2
|
import type { TableCellRecord } from '../../base/types';
|
|
3
|
+
import { TextCellViewBaseAlignment } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* The cell view base class for displaying fields of any type as text.
|
|
5
6
|
*/
|
|
@@ -10,4 +11,8 @@ export declare abstract class TableColumnTextCellViewBase<TCellRecord extends Ta
|
|
|
10
11
|
* Text to render in the cell.
|
|
11
12
|
*/
|
|
12
13
|
text: string;
|
|
14
|
+
/**
|
|
15
|
+
* The alignment of the text within the cell.
|
|
16
|
+
*/
|
|
17
|
+
alignment: TextCellViewBaseAlignment;
|
|
13
18
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The aligment of the value in a TableColumnTextCellViewBase instance.
|
|
3
|
+
*/
|
|
4
|
+
export declare const TextCellViewBaseAlignment: {
|
|
5
|
+
readonly left: "left";
|
|
6
|
+
readonly right: "right";
|
|
7
|
+
};
|
|
8
|
+
export declare type TextCellViewBaseAlignment = (typeof TextCellViewBaseAlignment)[keyof typeof TextCellViewBaseAlignment];
|
|
@@ -7,10 +7,6 @@ import type { ColumnInternals } from './column-internals';
|
|
|
7
7
|
export declare class ColumnValidator<ValidityFlagNames extends readonly string[]> extends Validator<ValidityFlagNames> {
|
|
8
8
|
private readonly columnInternals;
|
|
9
9
|
constructor(columnInternals: ColumnInternals<unknown>, configValidityKeys: ValidityFlagNames);
|
|
10
|
-
/**
|
|
11
|
-
* @returns whether the entire column configuration is valid
|
|
12
|
-
*/
|
|
13
|
-
isValidColumn(): boolean;
|
|
14
10
|
/**
|
|
15
11
|
* @returns an object containing flags for various ways the configuation can be invalid
|
|
16
12
|
*/
|
|
@@ -7,12 +7,6 @@ export class ColumnValidator extends Validator {
|
|
|
7
7
|
super(configValidityKeys);
|
|
8
8
|
this.columnInternals = columnInternals;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* @returns whether the entire column configuration is valid
|
|
12
|
-
*/
|
|
13
|
-
isValidColumn() {
|
|
14
|
-
return this.isValid();
|
|
15
|
-
}
|
|
16
10
|
/**
|
|
17
11
|
* @returns an object containing flags for various ways the configuation can be invalid
|
|
18
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-validator.js","sourceRoot":"","sources":["../../../../../src/table-column/base/models/column-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAIhE;;GAEG;AACH,MAAM,OAAO,eAEX,SAAQ,SAA4B;IAClC,YACqB,eAAyC,EAC1D,kBAAqC;QAErC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAHT,oBAAe,GAAf,eAAe,CAA0B;IAI9D,CAAC;IAED;;OAEG;IACI,
|
|
1
|
+
{"version":3,"file":"column-validator.js","sourceRoot":"","sources":["../../../../../src/table-column/base/models/column-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAIhE;;GAEG;AACH,MAAM,OAAO,eAEX,SAAQ,SAA4B;IAClC,YACqB,eAAyC,EAC1D,kBAAqC;QAErC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAHT,oBAAe,GAAf,eAAe,CAA0B;IAI9D,CAAC;IAED;;OAEG;IACI,WAAW;QACd,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC;IACrC,CAAC;IAED;;OAEG;IACO,iBAAiB,CACvB,IAAgE,EAChE,SAAkB;QAElB,IAAI,SAAS,EAAE;YACX,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACpB;aAAM;YACH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB;QACD,IAAI,CAAC,yBAAyB,EAAE,CAAC;IACrC,CAAC;IAEO,yBAAyB;QAC7B,IAAI,CAAC,eAAe,CAAC,kBAAkB,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC7D,CAAC;CACJ"}
|
|
@@ -2,12 +2,14 @@ import { DesignSystem } from '@microsoft/fast-foundation';
|
|
|
2
2
|
import { template } from '../../text-base/cell-view/template';
|
|
3
3
|
import { styles } from '../../text-base/cell-view/styles';
|
|
4
4
|
import { TableColumnTextCellViewBase } from '../../text-base/cell-view';
|
|
5
|
+
import { TextCellViewBaseAlignment } from '../../text-base/cell-view/types';
|
|
5
6
|
/**
|
|
6
7
|
* A cell view for displaying number fields as text
|
|
7
8
|
*/
|
|
8
9
|
export class TableColumnNumberTextCellView extends TableColumnTextCellViewBase {
|
|
9
10
|
columnConfigChanged() {
|
|
10
11
|
this.updateText();
|
|
12
|
+
this.alignment = this.columnConfig?.alignment ?? TextCellViewBaseAlignment.left;
|
|
11
13
|
}
|
|
12
14
|
cellRecordChanged() {
|
|
13
15
|
this.updateText();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/cell-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAK9D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/cell-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAK9D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAQ5E;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,2BAGlD;IACW,mBAAmB;QACvB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,IAAI,yBAAyB,CAAC,IAAI,CAAC;IACpF,CAAC;IAEO,iBAAiB;QACrB,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAEO,UAAU;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;eACtE,EAAE,CAAC;IACd,CAAC;CACJ;AAED,MAAM,kBAAkB,GAAG,6BAA6B,CAAC,OAAO,CAAC;IAC7D,QAAQ,EAAE,oCAAoC;IAC9C,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAC/E,MAAM,CAAC,MAAM,gCAAgC,GAAG,YAAY,CAAC,MAAM,CAC/D,6BAA6B,CAChC,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { TableNumberField } from '../../table/types';
|
|
2
2
|
import { TableColumnTextBase } from '../text-base';
|
|
3
|
+
import { TableColumnValidity } from '../base/types';
|
|
3
4
|
import type { ColumnInternalsOptions } from '../base/models/column-internals';
|
|
4
|
-
import { NumberTextFormat } from './types';
|
|
5
|
+
import { NumberTextAlignment, NumberTextFormat } from './types';
|
|
5
6
|
import type { NumberFormatter } from './models/number-formatter';
|
|
7
|
+
import { TableColumnNumberTextValidator } from './models/table-column-number-text-validitor';
|
|
8
|
+
import { TextCellViewBaseAlignment } from '../text-base/cell-view/types';
|
|
6
9
|
export declare type TableColumnNumberTextCellRecord = TableNumberField<'value'>;
|
|
7
10
|
export interface TableColumnNumberTextColumnConfig {
|
|
8
11
|
formatter: NumberFormatter;
|
|
12
|
+
alignment: TextCellViewBaseAlignment;
|
|
9
13
|
}
|
|
10
14
|
declare global {
|
|
11
15
|
interface HTMLElementTagNameMap {
|
|
@@ -16,11 +20,19 @@ declare global {
|
|
|
16
20
|
* The table column for displaying numbers as text.
|
|
17
21
|
*/
|
|
18
22
|
export declare class TableColumnNumberText extends TableColumnTextBase {
|
|
23
|
+
/** @internal */
|
|
24
|
+
validator: TableColumnNumberTextValidator;
|
|
19
25
|
format: NumberTextFormat;
|
|
26
|
+
alignment: NumberTextAlignment;
|
|
27
|
+
decimalDigits?: number;
|
|
20
28
|
connectedCallback(): void;
|
|
29
|
+
get validity(): TableColumnValidity;
|
|
21
30
|
protected getColumnInternalsOptions(): ColumnInternalsOptions;
|
|
22
31
|
private formatChanged;
|
|
32
|
+
private alignmentChanged;
|
|
33
|
+
private decimalDigitsChanged;
|
|
23
34
|
private updateColumnConfig;
|
|
24
35
|
private createFormatter;
|
|
36
|
+
private determineCellContentAlignment;
|
|
25
37
|
}
|
|
26
38
|
export declare const tableColumnNumberTextTag: string;
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
3
|
-
import { attr } from '@microsoft/fast-element';
|
|
3
|
+
import { attr, nullableNumberConverter } from '@microsoft/fast-element';
|
|
4
4
|
import { styles } from '../base/styles';
|
|
5
5
|
import { template } from '../base/template';
|
|
6
6
|
import { TableColumnTextBase } from '../text-base';
|
|
7
7
|
import { TableColumnSortOperation } from '../base/types';
|
|
8
8
|
import { tableColumnNumberTextGroupHeaderTag } from './group-header-view';
|
|
9
9
|
import { tableColumnNumberTextCellViewTag } from './cell-view';
|
|
10
|
-
import { NumberTextFormat } from './types';
|
|
10
|
+
import { NumberTextAlignment, NumberTextFormat } from './types';
|
|
11
11
|
import { RoundToIntegerFormatter } from './models/round-to-integer-formatter';
|
|
12
12
|
import { DefaultFormatter } from './models/default-formatter';
|
|
13
|
+
import { DecimalFormatter } from './models/decimal-formatter';
|
|
14
|
+
import { TableColumnNumberTextValidator } from './models/table-column-number-text-validitor';
|
|
15
|
+
import { TextCellViewBaseAlignment } from '../text-base/cell-view/types';
|
|
16
|
+
const defaultDecimalDigits = 2;
|
|
13
17
|
/**
|
|
14
18
|
* The table column for displaying numbers as text.
|
|
15
19
|
*/
|
|
16
20
|
export class TableColumnNumberText extends TableColumnTextBase {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
/** @internal */
|
|
24
|
+
this.validator = new TableColumnNumberTextValidator(this.columnInternals);
|
|
25
|
+
}
|
|
17
26
|
connectedCallback() {
|
|
18
27
|
super.connectedCallback();
|
|
19
28
|
this.updateColumnConfig();
|
|
20
29
|
}
|
|
30
|
+
get validity() {
|
|
31
|
+
return this.validator.getValidity();
|
|
32
|
+
}
|
|
21
33
|
getColumnInternalsOptions() {
|
|
22
34
|
return {
|
|
23
35
|
cellRecordFieldNames: ['value'],
|
|
@@ -30,24 +42,59 @@ export class TableColumnNumberText extends TableColumnTextBase {
|
|
|
30
42
|
formatChanged() {
|
|
31
43
|
this.updateColumnConfig();
|
|
32
44
|
}
|
|
45
|
+
alignmentChanged() {
|
|
46
|
+
this.updateColumnConfig();
|
|
47
|
+
}
|
|
48
|
+
decimalDigitsChanged() {
|
|
49
|
+
this.updateColumnConfig();
|
|
50
|
+
}
|
|
33
51
|
updateColumnConfig() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
52
|
+
this.validator.validateDecimalDigits(this.format, this.decimalDigits);
|
|
53
|
+
if (this.validator.isValid()) {
|
|
54
|
+
const columnConfig = {
|
|
55
|
+
formatter: this.createFormatter(),
|
|
56
|
+
alignment: this.determineCellContentAlignment()
|
|
57
|
+
};
|
|
58
|
+
this.columnInternals.columnConfig = columnConfig;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.columnInternals.columnConfig = undefined;
|
|
62
|
+
}
|
|
38
63
|
}
|
|
39
64
|
createFormatter() {
|
|
40
65
|
switch (this.format) {
|
|
41
66
|
case NumberTextFormat.roundToInteger:
|
|
42
67
|
return new RoundToIntegerFormatter();
|
|
68
|
+
case NumberTextFormat.decimal:
|
|
69
|
+
return new DecimalFormatter(this.decimalDigits ?? defaultDecimalDigits);
|
|
43
70
|
default:
|
|
44
71
|
return new DefaultFormatter();
|
|
45
72
|
}
|
|
46
73
|
}
|
|
74
|
+
determineCellContentAlignment() {
|
|
75
|
+
if (this.alignment === NumberTextAlignment.left) {
|
|
76
|
+
return TextCellViewBaseAlignment.left;
|
|
77
|
+
}
|
|
78
|
+
if (this.alignment === NumberTextAlignment.right) {
|
|
79
|
+
return TextCellViewBaseAlignment.right;
|
|
80
|
+
}
|
|
81
|
+
// Look at format to determine the default alignment
|
|
82
|
+
if (this.format === NumberTextFormat.roundToInteger
|
|
83
|
+
|| this.format === NumberTextFormat.decimal) {
|
|
84
|
+
return TextCellViewBaseAlignment.right;
|
|
85
|
+
}
|
|
86
|
+
return TextCellViewBaseAlignment.left;
|
|
87
|
+
}
|
|
47
88
|
}
|
|
48
89
|
__decorate([
|
|
49
90
|
attr
|
|
50
91
|
], TableColumnNumberText.prototype, "format", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
attr
|
|
94
|
+
], TableColumnNumberText.prototype, "alignment", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
attr({ attribute: 'decimal-digits', converter: nullableNumberConverter })
|
|
97
|
+
], TableColumnNumberText.prototype, "decimalDigits", void 0);
|
|
51
98
|
const nimbleTableColumnNumberText = TableColumnNumberText.compose({
|
|
52
99
|
baseName: 'table-column-number-text',
|
|
53
100
|
template,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/number-text/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/number-text/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NumberFormatter } from './number-formatter';
|
|
2
|
+
/**
|
|
3
|
+
* The formatter for a number-text column whose format is configured to be 'decimal'.
|
|
4
|
+
*/
|
|
5
|
+
export declare class DecimalFormatter extends NumberFormatter {
|
|
6
|
+
private readonly formatter;
|
|
7
|
+
constructor(decimalsToDisplay: number);
|
|
8
|
+
protected format(number: number): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NumberFormatter } from './number-formatter';
|
|
2
|
+
/**
|
|
3
|
+
* The formatter for a number-text column whose format is configured to be 'decimal'.
|
|
4
|
+
*/
|
|
5
|
+
export class DecimalFormatter extends NumberFormatter {
|
|
6
|
+
constructor(decimalsToDisplay) {
|
|
7
|
+
super();
|
|
8
|
+
this.formatter = new Intl.NumberFormat(undefined, {
|
|
9
|
+
maximumFractionDigits: decimalsToDisplay,
|
|
10
|
+
minimumFractionDigits: decimalsToDisplay,
|
|
11
|
+
useGrouping: true
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
format(number) {
|
|
15
|
+
// The NumberFormat option of `signDisplay: "negative"` is not supported in all browsers nimble supports.
|
|
16
|
+
// Because that option cannot be used to avoid rendering "-0", coerce the value -0 to 0 prior to formatting.
|
|
17
|
+
const valueToFormat = number === 0 ? 0 : number;
|
|
18
|
+
return this.formatter.format(valueToFormat);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=decimal-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decimal-formatter.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/models/decimal-formatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAGjD,YAAmB,iBAAyB;QACxC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;YAC9C,qBAAqB,EAAE,iBAAiB;YACxC,qBAAqB,EAAE,iBAAiB;YACxC,WAAW,EAAE,IAAI;SACpB,CAAC,CAAC;IACP,CAAC;IAES,MAAM,CAAC,MAAc;QAC3B,yGAAyG;QACzG,4GAA4G;QAC5G,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAChD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAChD,CAAC;CACJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ColumnInternals } from '../../base/models/column-internals';
|
|
2
|
+
import { ColumnValidator } from '../../base/models/column-validator';
|
|
3
|
+
import { NumberTextFormat } from '../types';
|
|
4
|
+
declare const numberTextValidityFlagNames: readonly ["invalidDecimalDigits"];
|
|
5
|
+
/**
|
|
6
|
+
* Validator for TableColumnNumberText.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TableColumnNumberTextValidator extends ColumnValidator<typeof numberTextValidityFlagNames> {
|
|
9
|
+
constructor(columnInternals: ColumnInternals<unknown>);
|
|
10
|
+
validateDecimalDigits(format: NumberTextFormat, decimalDigits: number | undefined): void;
|
|
11
|
+
private isInvalidDecimalDigitsValue;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ColumnValidator } from '../../base/models/column-validator';
|
|
2
|
+
import { NumberTextFormat } from '../types';
|
|
3
|
+
const numberTextValidityFlagNames = ['invalidDecimalDigits'];
|
|
4
|
+
// The maximum and minimum allowed configuration for 'maximumFractionDigits'
|
|
5
|
+
// and 'minimumFractionDigits' on the NumberFormat.
|
|
6
|
+
const minimumValidDecimalDigits = 0;
|
|
7
|
+
const maximumValidDecimalDigits = 20;
|
|
8
|
+
/**
|
|
9
|
+
* Validator for TableColumnNumberText.
|
|
10
|
+
*/
|
|
11
|
+
export class TableColumnNumberTextValidator extends ColumnValidator {
|
|
12
|
+
constructor(columnInternals) {
|
|
13
|
+
super(columnInternals, numberTextValidityFlagNames);
|
|
14
|
+
}
|
|
15
|
+
validateDecimalDigits(format, decimalDigits) {
|
|
16
|
+
const shouldValidateDecimalDigitsValue = format === NumberTextFormat.decimal
|
|
17
|
+
&& typeof decimalDigits === 'number';
|
|
18
|
+
const invalid = shouldValidateDecimalDigitsValue
|
|
19
|
+
? this.isInvalidDecimalDigitsValue(decimalDigits)
|
|
20
|
+
: false;
|
|
21
|
+
this.setConditionValue('invalidDecimalDigits', invalid);
|
|
22
|
+
}
|
|
23
|
+
isInvalidDecimalDigitsValue(decimalDigits) {
|
|
24
|
+
return (decimalDigits < minimumValidDecimalDigits
|
|
25
|
+
|| decimalDigits > maximumValidDecimalDigits);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=table-column-number-text-validitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-column-number-text-validitor.js","sourceRoot":"","sources":["../../../../../src/table-column/number-text/models/table-column-number-text-validitor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,2BAA2B,GAAG,CAAC,sBAAsB,CAAU,CAAC;AAEtE,4EAA4E;AAC5E,mDAAmD;AACnD,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,eAEnD;IACG,YAAmB,eAAyC;QACxD,KAAK,CAAC,eAAe,EAAE,2BAA2B,CAAC,CAAC;IACxD,CAAC;IAEM,qBAAqB,CACxB,MAAwB,EACxB,aAAiC;QAEjC,MAAM,gCAAgC,GAAG,MAAM,KAAK,gBAAgB,CAAC,OAAO;eACrE,OAAO,aAAa,KAAK,QAAQ,CAAC;QACzC,MAAM,OAAO,GAAG,gCAAgC;YAC5C,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,aAAa,CAAC;YACjD,CAAC,CAAC,KAAK,CAAC;QACZ,IAAI,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAEO,2BAA2B,CAAC,aAAqB;QACrD,OAAO,CACH,aAAa,GAAG,yBAAyB;eACtC,aAAa,GAAG,yBAAyB,CAC/C,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -4,5 +4,16 @@
|
|
|
4
4
|
export declare const NumberTextFormat: {
|
|
5
5
|
readonly default: undefined;
|
|
6
6
|
readonly roundToInteger: "round-to-integer";
|
|
7
|
+
readonly decimal: "decimal";
|
|
7
8
|
};
|
|
8
9
|
export declare type NumberTextFormat = (typeof NumberTextFormat)[keyof typeof NumberTextFormat];
|
|
10
|
+
/**
|
|
11
|
+
* The aligment of the value in the number-text table column.
|
|
12
|
+
* The `default` alignment is determined by the column's `NumberTextFormat`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const NumberTextAlignment: {
|
|
15
|
+
readonly default: undefined;
|
|
16
|
+
readonly left: "left";
|
|
17
|
+
readonly right: "right";
|
|
18
|
+
};
|
|
19
|
+
export declare type NumberTextAlignment = (typeof NumberTextAlignment)[keyof typeof NumberTextAlignment];
|
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const NumberTextFormat = {
|
|
5
5
|
default: undefined,
|
|
6
|
-
roundToInteger: 'round-to-integer'
|
|
6
|
+
roundToInteger: 'round-to-integer',
|
|
7
|
+
decimal: 'decimal'
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The aligment of the value in the number-text table column.
|
|
11
|
+
* The `default` alignment is determined by the column's `NumberTextFormat`.
|
|
12
|
+
*/
|
|
13
|
+
export const NumberTextAlignment = {
|
|
14
|
+
default: undefined,
|
|
15
|
+
left: 'left',
|
|
16
|
+
right: 'right'
|
|
7
17
|
};
|
|
8
18
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/number-text/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,kBAAkB;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/number-text/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,kBAAkB;IAClC,OAAO,EAAE,SAAS;CACZ,CAAC;AAIX;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TableCellView } from '../../base/cell-view';
|
|
2
2
|
import type { TableCellRecord } from '../../base/types';
|
|
3
|
+
import { TextCellViewBaseAlignment } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* The cell view base class for displaying fields of any type as text.
|
|
5
6
|
*/
|
|
@@ -10,4 +11,8 @@ export declare abstract class TableColumnTextCellViewBase<TCellRecord extends Ta
|
|
|
10
11
|
* Text to render in the cell.
|
|
11
12
|
*/
|
|
12
13
|
text: string;
|
|
14
|
+
/**
|
|
15
|
+
* The alignment of the text within the cell.
|
|
16
|
+
*/
|
|
17
|
+
alignment: TextCellViewBaseAlignment;
|
|
13
18
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { observable } from '@microsoft/fast-element';
|
|
3
3
|
import { TableCellView } from '../../base/cell-view';
|
|
4
|
+
import { TextCellViewBaseAlignment } from './types';
|
|
4
5
|
/**
|
|
5
6
|
* The cell view base class for displaying fields of any type as text.
|
|
6
7
|
*/
|
|
@@ -13,6 +14,10 @@ export class TableColumnTextCellViewBase extends TableCellView {
|
|
|
13
14
|
* Text to render in the cell.
|
|
14
15
|
*/
|
|
15
16
|
this.text = '';
|
|
17
|
+
/**
|
|
18
|
+
* The alignment of the text within the cell.
|
|
19
|
+
*/
|
|
20
|
+
this.alignment = TextCellViewBaseAlignment.left;
|
|
16
21
|
}
|
|
17
22
|
}
|
|
18
23
|
__decorate([
|
|
@@ -21,4 +26,7 @@ __decorate([
|
|
|
21
26
|
__decorate([
|
|
22
27
|
observable
|
|
23
28
|
], TableColumnTextCellViewBase.prototype, "text", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
observable
|
|
31
|
+
], TableColumnTextCellViewBase.prototype, "alignment", void 0);
|
|
24
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAgB,2BAGpB,SAAQ,aAAyC;IAHnD;;QAII,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;QAE3B;;WAEG;QAEI,SAAI,GAAG,EAAE,CAAC;QAEjB;;WAEG;QAEI,cAAS,GAA8B,yBAAyB,CAAC,IAAI,CAAC;IACjF,CAAC;CAAA;AAbG;IADC,UAAU;gEACgB;AAM3B;IADC,UAAU;yDACM;AAMjB;IADC,UAAU;8DACkE"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
2
|
import { bodyFont, bodyFontColor } from '../../../theme-provider/design-tokens';
|
|
3
3
|
export const styles = css `
|
|
4
|
+
:host(.right-align) {
|
|
5
|
+
margin-left: auto;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
span {
|
|
5
9
|
font: ${bodyFont};
|
|
6
10
|
color: ${bodyFontColor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEhF,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEhF,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;gBAMT,QAAQ;iBACP,aAAa;;;;;CAK7B,CAAC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { html } from '@microsoft/fast-element';
|
|
2
2
|
import { overflow } from '../../../utilities/directive/overflow';
|
|
3
|
+
import { TextCellViewBaseAlignment } from './types';
|
|
3
4
|
export const template = html `
|
|
4
|
-
<
|
|
5
|
-
${
|
|
6
|
-
|
|
5
|
+
<template
|
|
6
|
+
class="${x => (x.alignment === TextCellViewBaseAlignment.right
|
|
7
|
+
? 'right-align'
|
|
8
|
+
: '')}"
|
|
7
9
|
>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
<span
|
|
11
|
+
${overflow('hasOverflow')}
|
|
12
|
+
title=${x => (x.hasOverflow && x.text ? x.text : null)}
|
|
13
|
+
>
|
|
14
|
+
${x => x.text}
|
|
15
|
+
</span>
|
|
16
|
+
</template>
|
|
10
17
|
`;
|
|
11
18
|
//# sourceMappingURL=template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAA6B;;iBAExC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,yBAAyB,CAAC,KAAK;IAC9D,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,EAAE,CAAC;;;cAGC,QAAQ,CAAC,aAAa,CAAC;oBACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;;cAEpD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;;;CAGxB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The aligment of the value in a TableColumnTextCellViewBase instance.
|
|
3
|
+
*/
|
|
4
|
+
export declare const TextCellViewBaseAlignment: {
|
|
5
|
+
readonly left: "left";
|
|
6
|
+
readonly right: "right";
|
|
7
|
+
};
|
|
8
|
+
export declare type TextCellViewBaseAlignment = (typeof TextCellViewBaseAlignment)[keyof typeof TextCellViewBaseAlignment];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ni/nimble-components",
|
|
3
|
-
"version": "20.1.
|
|
3
|
+
"version": "20.1.16",
|
|
4
4
|
"description": "Styled web components for the NI Nimble Design System",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run generate-icons && npm run build-components && npm run bundle-components && npm run generate-scss && npm run build-storybook",
|