@ni/nimble-components 24.1.7 → 24.1.9

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.
Files changed (83) hide show
  1. package/dist/all-components-bundle.js +102 -117
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +2560 -2557
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/src/table-column/anchor/index.d.ts +4 -3
  6. package/dist/esm/src/table-column/base/index.d.ts +4 -3
  7. package/dist/esm/src/table-column/base/models/column-internals.d.ts +10 -8
  8. package/dist/esm/src/table-column/base/models/column-validator.d.ts +2 -3
  9. package/dist/esm/src/table-column/base/template.d.ts +1 -1
  10. package/dist/esm/src/table-column/date-text/index.d.ts +26 -6
  11. package/dist/esm/src/table-column/date-text/models/table-column-date-text-validator.d.ts +1 -2
  12. package/dist/esm/src/table-column/duration-text/index.d.ts +27 -2
  13. package/dist/esm/src/table-column/enum-base/index.d.ts +1 -4
  14. package/dist/esm/src/table-column/enum-base/models/table-column-enum-base-validator.d.ts +1 -2
  15. package/dist/esm/src/table-column/enum-text/index.d.ts +3 -6
  16. package/dist/esm/src/table-column/enum-text/models/table-column-enum-text-validator.d.ts +1 -2
  17. package/dist/esm/src/table-column/icon/index.d.ts +3 -6
  18. package/dist/esm/src/table-column/icon/models/table-column-icon-validator.d.ts +1 -2
  19. package/dist/esm/src/table-column/mixins/fractional-width-column.d.ts +1 -1
  20. package/dist/esm/src/table-column/mixins/groupable-column.d.ts +1 -1
  21. package/dist/esm/src/table-column/number-text/index.d.ts +26 -6
  22. package/dist/esm/src/table-column/number-text/models/table-column-number-text-validator.d.ts +1 -2
  23. package/dist/esm/src/table-column/text/index.d.ts +26 -1
  24. package/dist/esm/src/table-column/text-base/index.d.ts +13 -11
  25. package/dist/esm/table/index.js +9 -6
  26. package/dist/esm/table/index.js.map +1 -1
  27. package/dist/esm/table/models/table-validator.js +1 -1
  28. package/dist/esm/table/models/table-validator.js.map +1 -1
  29. package/dist/esm/table-column/anchor/index.d.ts +4 -3
  30. package/dist/esm/table-column/anchor/index.js +3 -1
  31. package/dist/esm/table-column/anchor/index.js.map +1 -1
  32. package/dist/esm/table-column/base/index.d.ts +4 -3
  33. package/dist/esm/table-column/base/index.js +2 -2
  34. package/dist/esm/table-column/base/index.js.map +1 -1
  35. package/dist/esm/table-column/base/models/column-internals.d.ts +10 -8
  36. package/dist/esm/table-column/base/models/column-internals.js +1 -7
  37. package/dist/esm/table-column/base/models/column-internals.js.map +1 -1
  38. package/dist/esm/table-column/base/models/column-validator.d.ts +2 -3
  39. package/dist/esm/table-column/base/models/column-validator.js +8 -3
  40. package/dist/esm/table-column/base/models/column-validator.js.map +1 -1
  41. package/dist/esm/table-column/base/template.d.ts +1 -1
  42. package/dist/esm/table-column/date-text/index.d.ts +26 -6
  43. package/dist/esm/table-column/date-text/index.js +6 -10
  44. package/dist/esm/table-column/date-text/index.js.map +1 -1
  45. package/dist/esm/table-column/date-text/models/table-column-date-text-validator.d.ts +1 -2
  46. package/dist/esm/table-column/date-text/models/table-column-date-text-validator.js +2 -2
  47. package/dist/esm/table-column/date-text/models/table-column-date-text-validator.js.map +1 -1
  48. package/dist/esm/table-column/duration-text/index.d.ts +27 -2
  49. package/dist/esm/table-column/duration-text/index.js +5 -3
  50. package/dist/esm/table-column/duration-text/index.js.map +1 -1
  51. package/dist/esm/table-column/enum-base/index.d.ts +1 -4
  52. package/dist/esm/table-column/enum-base/index.js +2 -6
  53. package/dist/esm/table-column/enum-base/index.js.map +1 -1
  54. package/dist/esm/table-column/enum-base/models/table-column-enum-base-validator.d.ts +1 -2
  55. package/dist/esm/table-column/enum-base/models/table-column-enum-base-validator.js +2 -2
  56. package/dist/esm/table-column/enum-base/models/table-column-enum-base-validator.js.map +1 -1
  57. package/dist/esm/table-column/enum-text/index.d.ts +3 -6
  58. package/dist/esm/table-column/enum-text/index.js +2 -7
  59. package/dist/esm/table-column/enum-text/index.js.map +1 -1
  60. package/dist/esm/table-column/enum-text/models/table-column-enum-text-validator.d.ts +1 -2
  61. package/dist/esm/table-column/enum-text/models/table-column-enum-text-validator.js +2 -2
  62. package/dist/esm/table-column/enum-text/models/table-column-enum-text-validator.js.map +1 -1
  63. package/dist/esm/table-column/icon/index.d.ts +3 -6
  64. package/dist/esm/table-column/icon/index.js +2 -7
  65. package/dist/esm/table-column/icon/index.js.map +1 -1
  66. package/dist/esm/table-column/icon/models/table-column-icon-validator.d.ts +1 -2
  67. package/dist/esm/table-column/icon/models/table-column-icon-validator.js +2 -2
  68. package/dist/esm/table-column/icon/models/table-column-icon-validator.js.map +1 -1
  69. package/dist/esm/table-column/mixins/fractional-width-column.d.ts +1 -1
  70. package/dist/esm/table-column/mixins/groupable-column.d.ts +1 -1
  71. package/dist/esm/table-column/number-text/index.d.ts +26 -6
  72. package/dist/esm/table-column/number-text/index.js +10 -13
  73. package/dist/esm/table-column/number-text/index.js.map +1 -1
  74. package/dist/esm/table-column/number-text/models/table-column-number-text-validator.d.ts +1 -2
  75. package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js +2 -2
  76. package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js.map +1 -1
  77. package/dist/esm/table-column/text/index.d.ts +26 -1
  78. package/dist/esm/table-column/text/index.js +5 -3
  79. package/dist/esm/table-column/text/index.js.map +1 -1
  80. package/dist/esm/table-column/text-base/index.d.ts +13 -11
  81. package/dist/esm/table-column/text-base/index.js +6 -2
  82. package/dist/esm/table-column/text-base/index.js.map +1 -1
  83. package/package.json +1 -1
@@ -2,6 +2,7 @@ import { TableColumn } from '../base';
2
2
  import type { TableStringField } from '../../table/types';
3
3
  import type { AnchorAppearance } from '../../anchor/types';
4
4
  import type { ColumnInternalsOptions } from '../base/models/column-internals';
5
+ import { ColumnValidator } from '../base/models/column-validator';
5
6
  export type TableColumnAnchorCellRecord = TableStringField<'label' | 'href'>;
6
7
  export interface TableColumnAnchorColumnConfig {
7
8
  appearance: AnchorAppearance;
@@ -25,17 +26,17 @@ declare const TableColumnAnchor_base: (abstract new (...args: any[]) => {
25
26
  groupIndex?: number | null | undefined;
26
27
  groupingDisabledChanged(): void;
27
28
  groupIndexChanged(): void;
28
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
29
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
29
30
  }) & (abstract new (...args: any[]) => {
30
31
  fractionalWidth?: number | null | undefined;
31
32
  minPixelWidth?: number | null | undefined;
32
33
  fractionalWidthChanged(): void;
33
34
  minPixelWidthChanged(): void;
34
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
35
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
35
36
  }) & (abstract new (...args: any[]) => {
36
37
  placeholder?: string | undefined;
37
38
  placeholderChanged(): void;
38
- }) & ((abstract new () => TableColumn<TableColumnAnchorColumnConfig>) & {
39
+ }) & ((abstract new () => TableColumn<TableColumnAnchorColumnConfig, ColumnValidator<[]>>) & {
39
40
  compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
40
41
  from<TBase extends {
41
42
  new (): HTMLElement;
@@ -2,16 +2,17 @@ import { FoundationElement } from '@microsoft/fast-foundation';
2
2
  import { TableColumnSortDirection } from '../../table/types';
3
3
  import { ColumnInternals, ColumnInternalsOptions } from './models/column-internals';
4
4
  import type { TableColumnValidity } from './types';
5
+ import type { ColumnValidator } from './models/column-validator';
5
6
  /**
6
7
  * The base class for table columns
7
8
  */
8
- export declare abstract class TableColumn<TColumnConfig = unknown> extends FoundationElement {
9
+ export declare abstract class TableColumn<TColumnConfig = unknown, TColumnValidator extends ColumnValidator<[]> = ColumnValidator<[]>> extends FoundationElement {
9
10
  /**
10
11
  * @internal
11
12
  *
12
13
  * Column properties configurable by plugin authors
13
14
  */
14
- readonly columnInternals: ColumnInternals<TColumnConfig>;
15
+ readonly columnInternals: ColumnInternals<TColumnConfig, TColumnValidator>;
15
16
  columnId?: string;
16
17
  actionMenuSlot?: string;
17
18
  actionMenuLabel?: string;
@@ -28,7 +29,7 @@ export declare abstract class TableColumn<TColumnConfig = unknown> extends Found
28
29
  /** @internal */
29
30
  get headerTextContent(): string;
30
31
  connectedCallback(): void;
31
- protected abstract getColumnInternalsOptions(): ColumnInternalsOptions;
32
+ protected abstract getColumnInternalsOptions(): ColumnInternalsOptions<TColumnValidator>;
32
33
  protected sortDirectionChanged(): void;
33
34
  protected sortIndexChanged(): void;
34
35
  protected sortingDisabledChanged(): void;
@@ -3,7 +3,8 @@ import { TableColumnSortDirection, TableFieldName } from '../../../table/types';
3
3
  import type { TableCell } from '../../../table/components/cell';
4
4
  import { TableColumnSortOperation } from '../types';
5
5
  import type { TableGroupRow } from '../../../table/components/group-row';
6
- export interface ColumnInternalsOptions {
6
+ import type { ColumnValidator } from './column-validator';
7
+ export interface ColumnInternalsOptions<TColumnValidator extends ColumnValidator<[]> = ColumnValidator<[]>> {
7
8
  /**
8
9
  * The tag (element name) of the custom element that renders the cell content for the column.
9
10
  * That element should derive from TableCellView<TCellRecord, TColumnConfig>.
@@ -27,12 +28,16 @@ export interface ColumnInternalsOptions {
27
28
  * The sort operation to use for the column (defaults to TableColumnSortOperation.basic)
28
29
  */
29
30
  readonly sortOperation?: TableColumnSortOperation;
31
+ /**
32
+ * The validator for the column
33
+ */
34
+ readonly validator: TColumnValidator;
30
35
  }
31
36
  /**
32
37
  * Internal column state configured by plugin authors
33
38
  * @internal
34
39
  */
35
- export declare class ColumnInternals<TColumnConfig> {
40
+ export declare class ColumnInternals<TColumnConfig, TColumnValidator extends ColumnValidator<[]>> {
36
41
  /**
37
42
  * @see ColumnInternalsOptions.cellRecordFieldNames
38
43
  */
@@ -53,10 +58,6 @@ export declare class ColumnInternals<TColumnConfig> {
53
58
  * The relevant, static configuration a column requires its cell view to have access to.
54
59
  */
55
60
  columnConfig?: TColumnConfig;
56
- /**
57
- * Whether this column has a valid configuration.
58
- */
59
- validConfiguration: boolean;
60
61
  /**
61
62
  * The name of the data field that will be used for operations on the table, such as sorting and grouping.
62
63
  */
@@ -117,8 +118,9 @@ export declare class ColumnInternals<TColumnConfig> {
117
118
  * the resolved value of the sortDirection after programmatic or interactive updates.
118
119
  */
119
120
  currentSortDirection: TableColumnSortDirection;
120
- constructor(options: ColumnInternalsOptions);
121
+ readonly validator: TColumnValidator;
122
+ constructor(options: ColumnInternalsOptions<TColumnValidator>);
121
123
  protected fractionalWidthChanged(): void;
122
124
  protected pixelWidthChanged(): void;
123
125
  }
124
- export declare function isColumnInternalsProperty(changedProperty: string, ...args: (keyof ColumnInternals<unknown>)[]): boolean;
126
+ export declare function isColumnInternalsProperty(changedProperty: string, ...args: (keyof ColumnInternals<unknown, ColumnValidator<[]>>)[]): boolean;
@@ -1,12 +1,11 @@
1
1
  import { Validator } from '../../../utilities/models/validator';
2
2
  import type { TableColumnValidity } from '../types';
3
- import type { ColumnInternals } from './column-internals';
4
3
  /**
5
4
  * Base column validator
6
5
  */
7
6
  export declare class ColumnValidator<ValidityFlagNames extends readonly string[]> extends Validator<ValidityFlagNames> {
8
- private readonly columnInternals;
9
- constructor(columnInternals: ColumnInternals<unknown>, configValidityKeys: ValidityFlagNames);
7
+ isColumnValid: boolean;
8
+ constructor(configValidityKeys: ValidityFlagNames);
10
9
  /**
11
10
  * @returns an object containing flags for various ways the configuation can be invalid
12
11
  */
@@ -1,2 +1,2 @@
1
1
  import type { TableColumn } from '.';
2
- export declare const template: import("@microsoft/fast-element").ViewTemplate<TableColumn<unknown>, any>;
2
+ export declare const template: import("@microsoft/fast-element").ViewTemplate<TableColumn<unknown, import("./models/column-validator").ColumnValidator<[]>>, any>;
@@ -1,6 +1,5 @@
1
1
  import type { TableNumberField } from '../../table/types';
2
2
  import { TableColumnTextBase } from '../text-base';
3
- import { TableColumnValidity } from '../base/types';
4
3
  import type { ColumnInternalsOptions } from '../base/models/column-internals';
5
4
  import { DateTextFormat, LocaleMatcherAlgorithm, EraFormat, YearFormat, DayFormat, HourFormat, MinuteFormat, SecondFormat, TimeZoneNameFormat, FormatMatcherAlgorithm, DayPeriodFormat, DateStyle, TimeStyle, HourCycleFormat, MonthFormat, WeekdayFormat } from './types';
6
5
  import { TableColumnDateTextValidator } from './models/table-column-date-text-validator';
@@ -14,12 +13,33 @@ declare global {
14
13
  'nimble-table-column-date-text': TableColumnDateText;
15
14
  }
16
15
  }
16
+ declare const TableColumnDateText_base: (abstract new (...args: any[]) => {
17
+ groupingDisabled: boolean;
18
+ groupIndex?: number | null | undefined;
19
+ groupingDisabledChanged(): void;
20
+ groupIndexChanged(): void;
21
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
22
+ }) & (abstract new (...args: any[]) => {
23
+ fractionalWidth?: number | null | undefined;
24
+ minPixelWidth?: number | null | undefined;
25
+ fractionalWidthChanged(): void;
26
+ minPixelWidthChanged(): void;
27
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
28
+ }) & (abstract new (...args: any[]) => {
29
+ placeholder?: string | undefined;
30
+ placeholderChanged(): void;
31
+ }) & ((abstract new () => TableColumnTextBase<TableColumnDateTextColumnConfig, TableColumnDateTextValidator>) & {
32
+ compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
33
+ from<TBase extends {
34
+ new (): HTMLElement;
35
+ prototype: HTMLElement;
36
+ }>(BaseType: TBase): new () => InstanceType<TBase> & import("@microsoft/fast-element").FASTElement;
37
+ define<TType extends Function>(type: TType, nameOrDef?: string | import("@microsoft/fast-element").PartialFASTElementDefinition | undefined): TType;
38
+ });
17
39
  /**
18
40
  * The table column for displaying dates/times as text.
19
41
  */
20
- export declare class TableColumnDateText extends TableColumnTextBase {
21
- /** @internal */
22
- validator: TableColumnDateTextValidator;
42
+ export declare class TableColumnDateText extends TableColumnDateText_base {
23
43
  format: DateTextFormat;
24
44
  customLocaleMatcher: LocaleMatcherAlgorithm;
25
45
  customWeekday: WeekdayFormat;
@@ -43,9 +63,8 @@ export declare class TableColumnDateText extends TableColumnTextBase {
43
63
  private readonly langSubscriber;
44
64
  connectedCallback(): void;
45
65
  disconnectedCallback(): void;
46
- get validity(): TableColumnValidity;
47
66
  placeholderChanged(): void;
48
- protected getColumnInternalsOptions(): ColumnInternalsOptions;
67
+ protected getColumnInternalsOptions(): ColumnInternalsOptions<TableColumnDateTextValidator>;
49
68
  protected formatChanged(): void;
50
69
  protected customLocaleMatcherChanged(): void;
51
70
  protected customWeekdayChanged(): void;
@@ -71,3 +90,4 @@ export declare class TableColumnDateText extends TableColumnTextBase {
71
90
  private getCustomFormattingOptions;
72
91
  }
73
92
  export declare const tableColumnDateTextTag = "nimble-table-column-date-text";
93
+ export {};
@@ -1,11 +1,10 @@
1
- import type { ColumnInternals } from '../../base/models/column-internals';
2
1
  import { ColumnValidator } from '../../base/models/column-validator';
3
2
  declare const dateTextValidityFlagNames: readonly ["invalidCustomOptionsCombination"];
4
3
  /**
5
4
  * Validator for TableColumnDateText.
6
5
  */
7
6
  export declare class TableColumnDateTextValidator extends ColumnValidator<typeof dateTextValidityFlagNames> {
8
- constructor(columnInternals: ColumnInternals<unknown>);
7
+ constructor();
9
8
  setCustomOptionsValidity(valid: boolean): void;
10
9
  }
11
10
  export {};
@@ -1,8 +1,9 @@
1
1
  import type { TableNumberField } from '../../table/types';
2
- import { TableColumnTextBase } from '../text-base';
3
2
  import type { ColumnInternalsOptions } from '../base/models/column-internals';
4
3
  import { DurationFormatter } from './models/duration-formatter';
5
4
  import type { TableColumnTextBaseColumnConfig } from '../text-base/cell-view';
5
+ import { TableColumnTextBase } from '../text-base';
6
+ import { ColumnValidator } from '../base/models/column-validator';
6
7
  export type TableColumnDurationTextCellRecord = TableNumberField<'value'>;
7
8
  export interface TableColumnDurationTextColumnConfig extends TableColumnTextBaseColumnConfig {
8
9
  formatter: DurationFormatter;
@@ -12,10 +13,33 @@ declare global {
12
13
  'nimble-table-column-duration-text': TableColumnDurationText;
13
14
  }
14
15
  }
16
+ declare const TableColumnDurationText_base: (abstract new (...args: any[]) => {
17
+ groupingDisabled: boolean;
18
+ groupIndex?: number | null | undefined;
19
+ groupingDisabledChanged(): void;
20
+ groupIndexChanged(): void;
21
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
22
+ }) & (abstract new (...args: any[]) => {
23
+ fractionalWidth?: number | null | undefined;
24
+ minPixelWidth?: number | null | undefined;
25
+ fractionalWidthChanged(): void;
26
+ minPixelWidthChanged(): void;
27
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
28
+ }) & (abstract new (...args: any[]) => {
29
+ placeholder?: string | undefined;
30
+ placeholderChanged(): void;
31
+ }) & ((abstract new () => TableColumnTextBase<TableColumnDurationTextColumnConfig, ColumnValidator<[]>>) & {
32
+ compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
33
+ from<TBase extends {
34
+ new (): HTMLElement;
35
+ prototype: HTMLElement;
36
+ }>(BaseType: TBase): new () => InstanceType<TBase> & import("@microsoft/fast-element").FASTElement;
37
+ define<TType extends Function>(type: TType, nameOrDef?: string | import("@microsoft/fast-element").PartialFASTElementDefinition | undefined): TType;
38
+ });
15
39
  /**
16
40
  * The table column for displaying a duration value as text.
17
41
  */
18
- export declare class TableColumnDurationText extends TableColumnTextBase {
42
+ export declare class TableColumnDurationText extends TableColumnDurationText_base {
19
43
  private readonly langSubscriber;
20
44
  connectedCallback(): void;
21
45
  disconnectedCallback(): void;
@@ -24,3 +48,4 @@ export declare class TableColumnDurationText extends TableColumnTextBase {
24
48
  private updateColumnConfig;
25
49
  }
26
50
  export declare const tableColumnDurationTextTag = "nimble-table-column-duration-text";
51
+ export {};
@@ -15,9 +15,7 @@ export interface TableColumnEnumColumnConfig extends TableColumnTextBaseColumnCo
15
15
  /**
16
16
  * Base class for table columns that map values to content (e.g. nimble-table-column-enum-text and nimble-table-column-icon)
17
17
  */
18
- export declare abstract class TableColumnEnumBase<TColumnConfig extends TableColumnEnumColumnConfig, TEnumValidator extends TableColumnEnumBaseValidator<[]>> extends TableColumn<TColumnConfig> implements Subscriber {
19
- /** @internal */
20
- validator: TEnumValidator;
18
+ export declare abstract class TableColumnEnumBase<TColumnConfig extends TableColumnEnumColumnConfig, TEnumValidator extends TableColumnEnumBaseValidator<[]>> extends TableColumn<TColumnConfig, TEnumValidator> implements Subscriber {
21
19
  /** @internal */
22
20
  mappingNotifiers: Notifier[];
23
21
  /** @internal */
@@ -31,7 +29,6 @@ export declare abstract class TableColumnEnumBase<TColumnConfig extends TableCol
31
29
  * a mapping is updated.
32
30
  */
33
31
  handleChange(source: unknown, args: unknown): void;
34
- abstract createValidator(): TEnumValidator;
35
32
  /**
36
33
  * Implementations should throw an error if an invalid Mapping is passed.
37
34
  */
@@ -1,5 +1,4 @@
1
1
  import { ColumnValidator } from '../../base/models/column-validator';
2
- import type { ColumnInternals } from '../../base/models/column-internals';
3
2
  import type { Mapping } from '../../../mapping/base';
4
3
  import type { MappingKeyType } from '../types';
5
4
  export declare const enumBaseValidityFlagNames: readonly ["invalidMappingKeyValueForType", "duplicateMappingKey", "missingKeyValue"];
@@ -7,7 +6,7 @@ export declare const enumBaseValidityFlagNames: readonly ["invalidMappingKeyValu
7
6
  * Validator for TableColumnEnumText. Implementations MUST include enumBaseValidityFlagNames in validity flag names set.
8
7
  */
9
8
  export declare abstract class TableColumnEnumBaseValidator<ValidityFlagNames extends readonly string[]> extends ColumnValidator<typeof enumBaseValidityFlagNames | ValidityFlagNames> {
10
- constructor(columnInternals: ColumnInternals<unknown>, configValidityKeys: ValidityFlagNames);
9
+ constructor(configValidityKeys: ValidityFlagNames);
11
10
  validate(mappings: Mapping<unknown>[], keyType: MappingKeyType): void;
12
11
  private validateKeyValuesForType;
13
12
  private validateUniqueKeys;
@@ -1,5 +1,4 @@
1
1
  import { MappingConfigs, TableColumnEnumBase, TableColumnEnumColumnConfig } from '../enum-base';
2
- import { TableColumnValidity } from '../base/types';
3
2
  import { TableColumnEnumTextValidator } from './models/table-column-enum-text-validator';
4
3
  import type { ColumnInternalsOptions } from '../base/models/column-internals';
5
4
  import type { Mapping } from '../../mapping/base';
@@ -14,13 +13,13 @@ declare const TableColumnEnumText_base: (abstract new (...args: any[]) => {
14
13
  groupIndex?: number | null | undefined;
15
14
  groupingDisabledChanged(): void;
16
15
  groupIndexChanged(): void;
17
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
16
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
18
17
  }) & (abstract new (...args: any[]) => {
19
18
  fractionalWidth?: number | null | undefined;
20
19
  minPixelWidth?: number | null | undefined;
21
20
  fractionalWidthChanged(): void;
22
21
  minPixelWidthChanged(): void;
23
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
22
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
24
23
  }) & ((abstract new () => TableColumnEnumBase<TableColumnEnumColumnConfig, TableColumnEnumTextValidator>) & {
25
24
  compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
26
25
  from<TBase extends {
@@ -33,9 +32,7 @@ declare const TableColumnEnumText_base: (abstract new (...args: any[]) => {
33
32
  * Table column that maps values to strings
34
33
  */
35
34
  export declare class TableColumnEnumText extends TableColumnEnumText_base {
36
- createValidator(): TableColumnEnumTextValidator;
37
- get validity(): TableColumnValidity;
38
- protected getColumnInternalsOptions(): ColumnInternalsOptions;
35
+ protected getColumnInternalsOptions(): ColumnInternalsOptions<TableColumnEnumTextValidator>;
39
36
  protected createColumnConfig(mappingConfigs: MappingConfigs): TableColumnEnumColumnConfig;
40
37
  protected createMappingConfig(mapping: Mapping<unknown>): MappingConfig;
41
38
  }
@@ -1,5 +1,4 @@
1
1
  import type { Mapping } from '../../../mapping/base';
2
- import type { ColumnInternals } from '../../base/models/column-internals';
3
2
  import { TableColumnEnumBaseValidator } from '../../enum-base/models/table-column-enum-base-validator';
4
3
  import type { MappingKeyType } from '../../enum-base/types';
5
4
  declare const enumTextValidityFlagNames: readonly ["invalidMappingKeyValueForType", "duplicateMappingKey", "missingKeyValue", "unsupportedMappingType", "missingTextValue"];
@@ -7,7 +6,7 @@ declare const enumTextValidityFlagNames: readonly ["invalidMappingKeyValueForTyp
7
6
  * Validator for TableColumnEnumText
8
7
  */
9
8
  export declare class TableColumnEnumTextValidator extends TableColumnEnumBaseValidator<typeof enumTextValidityFlagNames> {
10
- constructor(columnInternals: ColumnInternals<unknown>);
9
+ constructor();
11
10
  private static isSupportedMappingElement;
12
11
  validate(mappings: Mapping<unknown>[], keyType: MappingKeyType): void;
13
12
  private validateNoMissingText;
@@ -1,5 +1,4 @@
1
1
  import { MappingConfigs, TableColumnEnumBase, TableColumnEnumColumnConfig } from '../enum-base';
2
- import { TableColumnValidity } from '../base/types';
3
2
  import { TableColumnIconValidator } from './models/table-column-icon-validator';
4
3
  import type { ColumnInternalsOptions } from '../base/models/column-internals';
5
4
  import type { Mapping } from '../../mapping/base';
@@ -14,13 +13,13 @@ declare const TableColumnIcon_base: (abstract new (...args: any[]) => {
14
13
  groupIndex?: number | null | undefined;
15
14
  groupingDisabledChanged(): void;
16
15
  groupIndexChanged(): void;
17
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
16
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
18
17
  }) & (abstract new (...args: any[]) => {
19
18
  fractionalWidth?: number | null | undefined;
20
19
  minPixelWidth?: number | null | undefined;
21
20
  fractionalWidthChanged(): void;
22
21
  minPixelWidthChanged(): void;
23
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
22
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
24
23
  }) & ((abstract new () => TableColumnEnumBase<TableColumnEnumColumnConfig, TableColumnIconValidator>) & {
25
24
  compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
26
25
  from<TBase extends {
@@ -33,9 +32,7 @@ declare const TableColumnIcon_base: (abstract new (...args: any[]) => {
33
32
  * Table column that maps values to icons / spinners
34
33
  */
35
34
  export declare class TableColumnIcon extends TableColumnIcon_base {
36
- createValidator(): TableColumnIconValidator;
37
- get validity(): TableColumnValidity;
38
- protected getColumnInternalsOptions(): ColumnInternalsOptions;
35
+ protected getColumnInternalsOptions(): ColumnInternalsOptions<TableColumnIconValidator>;
39
36
  protected createColumnConfig(mappingConfigs: MappingConfigs): TableColumnEnumColumnConfig;
40
37
  protected createMappingConfig(mapping: Mapping<unknown>): MappingConfig;
41
38
  }
@@ -1,5 +1,4 @@
1
1
  import type { Mapping } from '../../../mapping/base';
2
- import type { ColumnInternals } from '../../base/models/column-internals';
3
2
  import { TableColumnEnumBaseValidator } from '../../enum-base/models/table-column-enum-base-validator';
4
3
  import type { MappingKeyType } from '../../enum-base/types';
5
4
  declare const iconValidityFlagNames: readonly ["invalidMappingKeyValueForType", "duplicateMappingKey", "missingKeyValue", "unsupportedMappingType", "invalidIconName", "missingTextValue"];
@@ -7,7 +6,7 @@ declare const iconValidityFlagNames: readonly ["invalidMappingKeyValueForType",
7
6
  * Validator for TableColumnIcon
8
7
  */
9
8
  export declare class TableColumnIconValidator extends TableColumnEnumBaseValidator<typeof iconValidityFlagNames> {
10
- constructor(columnInternals: ColumnInternals<unknown>);
9
+ constructor();
11
10
  private static isIconMappingElement;
12
11
  private static isSupportedMappingElement;
13
12
  private static hasUnresolvedIcon;
@@ -6,6 +6,6 @@ export declare function mixinFractionalWidthColumnAPI<TBase extends SizedTableCo
6
6
  minPixelWidth?: number | null | undefined;
7
7
  fractionalWidthChanged(): void;
8
8
  minPixelWidthChanged(): void;
9
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
9
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
10
10
  }) & TBase;
11
11
  export {};
@@ -6,6 +6,6 @@ export declare function mixinGroupableColumnAPI<TBase extends GroupableTableColu
6
6
  groupIndex?: number | null | undefined;
7
7
  groupingDisabledChanged(): void;
8
8
  groupIndexChanged(): void;
9
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
9
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
10
10
  }) & TBase;
11
11
  export {};
@@ -1,6 +1,5 @@
1
1
  import type { TableNumberField } from '../../table/types';
2
2
  import { TableColumnTextBase } from '../text-base';
3
- import { TableColumnValidity } from '../base/types';
4
3
  import type { ColumnInternalsOptions } from '../base/models/column-internals';
5
4
  import { NumberTextAlignment, NumberTextFormat } from './types';
6
5
  import type { UnitFormat } from '../../utilities/unit-format/unit-format';
@@ -17,12 +16,33 @@ declare global {
17
16
  'nimble-table-column-number-text': TableColumnNumberText;
18
17
  }
19
18
  }
19
+ declare const TableColumnNumberText_base: (abstract new (...args: any[]) => {
20
+ groupingDisabled: boolean;
21
+ groupIndex?: number | null | undefined;
22
+ groupingDisabledChanged(): void;
23
+ groupIndexChanged(): void;
24
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
25
+ }) & (abstract new (...args: any[]) => {
26
+ fractionalWidth?: number | null | undefined;
27
+ minPixelWidth?: number | null | undefined;
28
+ fractionalWidthChanged(): void;
29
+ minPixelWidthChanged(): void;
30
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
31
+ }) & (abstract new (...args: any[]) => {
32
+ placeholder?: string | undefined;
33
+ placeholderChanged(): void;
34
+ }) & ((abstract new () => TableColumnTextBase<TableColumnNumberTextColumnConfig, TableColumnNumberTextValidator>) & {
35
+ compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
36
+ from<TBase extends {
37
+ new (): HTMLElement;
38
+ prototype: HTMLElement;
39
+ }>(BaseType: TBase): new () => InstanceType<TBase> & import("@microsoft/fast-element").FASTElement;
40
+ define<TType extends Function>(type: TType, nameOrDef?: string | import("@microsoft/fast-element").PartialFASTElementDefinition | undefined): TType;
41
+ });
20
42
  /**
21
43
  * The table column for displaying numbers as text.
22
44
  */
23
- export declare class TableColumnNumberText extends TableColumnTextBase {
24
- /** @internal */
25
- validator: TableColumnNumberTextValidator;
45
+ export declare class TableColumnNumberText extends TableColumnNumberText_base {
26
46
  format: NumberTextFormat;
27
47
  alignment: NumberTextAlignment;
28
48
  decimalDigits?: number;
@@ -35,9 +55,8 @@ export declare class TableColumnNumberText extends TableColumnTextBase {
35
55
  private readonly unitSubscriber;
36
56
  connectedCallback(): void;
37
57
  disconnectedCallback(): void;
38
- get validity(): TableColumnValidity;
39
58
  placeholderChanged(): void;
40
- protected getColumnInternalsOptions(): ColumnInternalsOptions;
59
+ protected getColumnInternalsOptions(): ColumnInternalsOptions<TableColumnNumberTextValidator>;
41
60
  private updateUnitNotifier;
42
61
  private formatChanged;
43
62
  private alignmentChanged;
@@ -51,3 +70,4 @@ export declare class TableColumnNumberText extends TableColumnTextBase {
51
70
  private determineCellContentAlignment;
52
71
  }
53
72
  export declare const tableColumnNumberTextTag = "nimble-table-column-number-text";
73
+ export {};
@@ -1,4 +1,3 @@
1
- import type { ColumnInternals } from '../../base/models/column-internals';
2
1
  import { ColumnValidator } from '../../base/models/column-validator';
3
2
  import { NumberTextFormat } from '../types';
4
3
  declare const numberTextValidityFlagNames: readonly ["invalidDecimalDigits", "invalidDecimalMaximumDigits", "decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits", "moreThanOneUnitSpecified"];
@@ -6,7 +5,7 @@ declare const numberTextValidityFlagNames: readonly ["invalidDecimalDigits", "in
6
5
  * Validator for TableColumnNumberText.
7
6
  */
8
7
  export declare class TableColumnNumberTextValidator extends ColumnValidator<typeof numberTextValidityFlagNames> {
9
- constructor(columnInternals: ColumnInternals<unknown>);
8
+ constructor();
10
9
  validateDecimalDigits(format: NumberTextFormat, decimalDigits: number | undefined): void;
11
10
  validateDecimalMaximumDigits(format: NumberTextFormat, decimalMaximumDigits: number | undefined): void;
12
11
  validateNoMutuallyExclusiveProperties(format: NumberTextFormat, decimalDigits: number | undefined, decimalMaximumDigits: number | undefined): void;
@@ -2,6 +2,7 @@ import type { TableStringField } from '../../table/types';
2
2
  import { TableColumnTextBase } from '../text-base';
3
3
  import type { ColumnInternalsOptions } from '../base/models/column-internals';
4
4
  import type { TableColumnTextBaseColumnConfig } from '../text-base/cell-view';
5
+ import { ColumnValidator } from '../base/models/column-validator';
5
6
  export type TableColumnTextCellRecord = TableStringField<'value'>;
6
7
  export interface TableColumnTextColumnConfig extends TableColumnTextBaseColumnConfig {
7
8
  }
@@ -10,11 +11,35 @@ declare global {
10
11
  'nimble-table-column-text': TableColumnText;
11
12
  }
12
13
  }
14
+ declare const TableColumnText_base: (abstract new (...args: any[]) => {
15
+ groupingDisabled: boolean;
16
+ groupIndex?: number | null | undefined;
17
+ groupingDisabledChanged(): void;
18
+ groupIndexChanged(): void;
19
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
20
+ }) & (abstract new (...args: any[]) => {
21
+ fractionalWidth?: number | null | undefined;
22
+ minPixelWidth?: number | null | undefined;
23
+ fractionalWidthChanged(): void;
24
+ minPixelWidthChanged(): void;
25
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
26
+ }) & (abstract new (...args: any[]) => {
27
+ placeholder?: string | undefined;
28
+ placeholderChanged(): void;
29
+ }) & ((abstract new () => TableColumnTextBase<TableColumnTextColumnConfig, ColumnValidator<[]>>) & {
30
+ compose<T extends import("@microsoft/fast-foundation").FoundationElementDefinition = import("@microsoft/fast-foundation").FoundationElementDefinition, K extends import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement> = import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>(this: K, elementDefinition: T): (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<T> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<T, K>;
31
+ from<TBase extends {
32
+ new (): HTMLElement;
33
+ prototype: HTMLElement;
34
+ }>(BaseType: TBase): new () => InstanceType<TBase> & import("@microsoft/fast-element").FASTElement;
35
+ define<TType extends Function>(type: TType, nameOrDef?: string | import("@microsoft/fast-element").PartialFASTElementDefinition | undefined): TType;
36
+ });
13
37
  /**
14
38
  * The table column for displaying string fields as text.
15
39
  */
16
- export declare class TableColumnText extends TableColumnTextBase {
40
+ export declare class TableColumnText extends TableColumnText_base {
17
41
  placeholderChanged(): void;
18
42
  protected getColumnInternalsOptions(): ColumnInternalsOptions;
19
43
  }
20
44
  export declare const tableColumnTextTag = "nimble-table-column-text";
45
+ export {};
@@ -1,25 +1,27 @@
1
1
  import { TableColumn } from '../base';
2
- declare const TableColumnTextBase_base: (abstract new (...args: any[]) => {
2
+ import type { ColumnValidator } from '../base/models/column-validator';
3
+ /**
4
+ * The base class for table columns that display fields of any type as text.
5
+ */
6
+ export declare abstract class TableColumnTextBase<TColumnConfig, TColumnValidator extends ColumnValidator<[]> = ColumnValidator<[]>> extends TableColumn<TColumnConfig, TColumnValidator> {
7
+ fieldName?: string;
8
+ protected fieldNameChanged(): void;
9
+ }
10
+ type TableColumnBaseConstructor<TColumnConfig, TColumnValidator extends ColumnValidator<[]>> = abstract new (...args: any[]) => TableColumnTextBase<TColumnConfig, TColumnValidator>;
11
+ export declare function mixinTextBase<TBase extends TableColumnBaseConstructor<TColumnConfig, TColumnValidator>, TColumnConfig, TColumnValidator extends ColumnValidator<[]> = ColumnValidator<[]>>(base: TBase): (abstract new (...args: any[]) => {
3
12
  groupingDisabled: boolean;
4
13
  groupIndex?: number | null | undefined;
5
14
  groupingDisabledChanged(): void;
6
15
  groupIndexChanged(): void;
7
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
16
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
8
17
  }) & (abstract new (...args: any[]) => {
9
18
  fractionalWidth?: number | null | undefined;
10
19
  minPixelWidth?: number | null | undefined;
11
20
  fractionalWidthChanged(): void;
12
21
  minPixelWidthChanged(): void;
13
- readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown>;
22
+ readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
14
23
  }) & (abstract new (...args: any[]) => {
15
24
  placeholder?: string | undefined;
16
25
  placeholderChanged(): void;
17
- }) & typeof TableColumn;
18
- /**
19
- * The base class for table columns that display fields of any type as text.
20
- */
21
- export declare abstract class TableColumnTextBase extends TableColumnTextBase_base {
22
- fieldName?: string;
23
- protected fieldNameChanged(): void;
24
- }
26
+ }) & TBase;
25
27
  export {};
@@ -17,6 +17,7 @@ import { InteractiveSelectionManager } from './models/interactive-selection-mana
17
17
  import { DataHierarchyManager } from './models/data-hierarchy-manager';
18
18
  import { ExpansionManager } from './models/expansion-manager';
19
19
  import { waitUntilCustomElementsDefinedAsync } from '../utilities/wait-until-custom-elements-defined-async';
20
+ import { ColumnValidator } from '../table-column/base/models/column-validator';
20
21
  /**
21
22
  * A nimble-styled table.
22
23
  */
@@ -221,12 +222,11 @@ export class Table extends FoundationElement {
221
222
  if ((source instanceof TableColumn
222
223
  || source instanceof ColumnInternals)
223
224
  && typeof args === 'string') {
224
- if (args === 'validConfiguration') {
225
- this.tableValidator.validateColumnConfigurations(this.columns);
226
- }
227
- else {
228
- this.tableUpdateTracker.trackColumnPropertyChanged(args);
229
- }
225
+ this.tableUpdateTracker.trackColumnPropertyChanged(args);
226
+ }
227
+ else if (source instanceof ColumnValidator
228
+ && args === 'isColumnValid') {
229
+ this.tableValidator.validateColumnConfigurations(this.columns);
230
230
  }
231
231
  else if (source instanceof TableLayoutManager
232
232
  && args === 'isColumnBeingSized'
@@ -486,6 +486,9 @@ export class Table extends FoundationElement {
486
486
  const notifierInternals = Observable.getNotifier(column.columnInternals);
487
487
  notifierInternals.subscribe(this);
488
488
  this.columnNotifiers.push(notifierInternals);
489
+ const validatorNotifier = Observable.getNotifier(column.columnInternals.validator);
490
+ validatorNotifier.subscribe(this);
491
+ this.columnNotifiers.push(validatorNotifier);
489
492
  }
490
493
  }
491
494
  getColumnsParticipatingInSorting() {