@ni/nimble-components 24.1.8 → 24.1.10
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 +147 -148
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +5243 -5238
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/anchor-menu-item/index.js +1 -15
- package/dist/esm/anchor-menu-item/index.js.map +1 -1
- package/dist/esm/src/table-column/anchor/index.d.ts +4 -3
- package/dist/esm/src/table-column/base/index.d.ts +4 -3
- package/dist/esm/src/table-column/base/models/column-internals.d.ts +10 -8
- package/dist/esm/src/table-column/base/models/column-validator.d.ts +2 -3
- package/dist/esm/src/table-column/base/template.d.ts +1 -1
- package/dist/esm/src/table-column/date-text/index.d.ts +4 -8
- package/dist/esm/src/table-column/date-text/models/table-column-date-text-validator.d.ts +1 -2
- package/dist/esm/src/table-column/duration-text/index.d.ts +4 -3
- package/dist/esm/src/table-column/enum-base/index.d.ts +1 -4
- package/dist/esm/src/table-column/enum-base/models/table-column-enum-base-validator.d.ts +1 -2
- package/dist/esm/src/table-column/enum-text/index.d.ts +3 -6
- package/dist/esm/src/table-column/enum-text/models/table-column-enum-text-validator.d.ts +1 -2
- package/dist/esm/src/table-column/icon/index.d.ts +3 -6
- package/dist/esm/src/table-column/icon/models/table-column-icon-validator.d.ts +1 -2
- package/dist/esm/src/table-column/mixins/fractional-width-column.d.ts +1 -1
- package/dist/esm/src/table-column/mixins/groupable-column.d.ts +1 -1
- package/dist/esm/src/table-column/number-text/index.d.ts +4 -8
- package/dist/esm/src/table-column/number-text/models/table-column-number-text-validator.d.ts +1 -2
- package/dist/esm/src/table-column/text/index.d.ts +4 -3
- package/dist/esm/src/table-column/text-base/index.d.ts +6 -5
- package/dist/esm/table/index.js +9 -6
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/table-validator.js +1 -1
- package/dist/esm/table/models/table-validator.js.map +1 -1
- package/dist/esm/table-column/anchor/index.d.ts +4 -3
- package/dist/esm/table-column/anchor/index.js +3 -1
- package/dist/esm/table-column/anchor/index.js.map +1 -1
- package/dist/esm/table-column/base/index.d.ts +4 -3
- package/dist/esm/table-column/base/index.js +2 -2
- package/dist/esm/table-column/base/index.js.map +1 -1
- package/dist/esm/table-column/base/models/column-internals.d.ts +10 -8
- package/dist/esm/table-column/base/models/column-internals.js +1 -7
- package/dist/esm/table-column/base/models/column-internals.js.map +1 -1
- package/dist/esm/table-column/base/models/column-validator.d.ts +2 -3
- package/dist/esm/table-column/base/models/column-validator.js +8 -3
- package/dist/esm/table-column/base/models/column-validator.js.map +1 -1
- package/dist/esm/table-column/base/template.d.ts +1 -1
- package/dist/esm/table-column/date-text/index.d.ts +4 -8
- package/dist/esm/table-column/date-text/index.js +4 -8
- package/dist/esm/table-column/date-text/index.js.map +1 -1
- package/dist/esm/table-column/date-text/models/table-column-date-text-validator.d.ts +1 -2
- package/dist/esm/table-column/date-text/models/table-column-date-text-validator.js +2 -2
- package/dist/esm/table-column/date-text/models/table-column-date-text-validator.js.map +1 -1
- package/dist/esm/table-column/duration-text/index.d.ts +4 -3
- package/dist/esm/table-column/duration-text/index.js +3 -1
- package/dist/esm/table-column/duration-text/index.js.map +1 -1
- package/dist/esm/table-column/enum-base/index.d.ts +1 -4
- package/dist/esm/table-column/enum-base/index.js +2 -6
- package/dist/esm/table-column/enum-base/index.js.map +1 -1
- package/dist/esm/table-column/enum-base/models/table-column-enum-base-validator.d.ts +1 -2
- package/dist/esm/table-column/enum-base/models/table-column-enum-base-validator.js +2 -2
- package/dist/esm/table-column/enum-base/models/table-column-enum-base-validator.js.map +1 -1
- package/dist/esm/table-column/enum-text/index.d.ts +3 -6
- package/dist/esm/table-column/enum-text/index.js +2 -7
- package/dist/esm/table-column/enum-text/index.js.map +1 -1
- package/dist/esm/table-column/enum-text/models/table-column-enum-text-validator.d.ts +1 -2
- package/dist/esm/table-column/enum-text/models/table-column-enum-text-validator.js +2 -2
- package/dist/esm/table-column/enum-text/models/table-column-enum-text-validator.js.map +1 -1
- package/dist/esm/table-column/icon/index.d.ts +3 -6
- package/dist/esm/table-column/icon/index.js +2 -7
- package/dist/esm/table-column/icon/index.js.map +1 -1
- package/dist/esm/table-column/icon/models/table-column-icon-validator.d.ts +1 -2
- package/dist/esm/table-column/icon/models/table-column-icon-validator.js +2 -2
- package/dist/esm/table-column/icon/models/table-column-icon-validator.js.map +1 -1
- package/dist/esm/table-column/mixins/fractional-width-column.d.ts +1 -1
- package/dist/esm/table-column/mixins/groupable-column.d.ts +1 -1
- package/dist/esm/table-column/number-text/index.d.ts +4 -8
- package/dist/esm/table-column/number-text/index.js +8 -11
- package/dist/esm/table-column/number-text/index.js.map +1 -1
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.d.ts +1 -2
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js +2 -2
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js.map +1 -1
- package/dist/esm/table-column/text/index.d.ts +4 -3
- package/dist/esm/table-column/text/index.js +3 -1
- package/dist/esm/table-column/text/index.js.map +1 -1
- package/dist/esm/table-column/text-base/index.d.ts +6 -5
- package/dist/esm/table-column/text-base/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { attr, observable } from '@microsoft/fast-element';
|
|
3
|
-
import { DesignSystem
|
|
3
|
+
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
4
4
|
import { keyEnter } from '@microsoft/fast-web-utilities';
|
|
5
5
|
import { AnchorBase } from '../anchor-base';
|
|
6
6
|
import { styles } from './styles';
|
|
@@ -87,18 +87,4 @@ DesignSystem.getOrCreate()
|
|
|
87
87
|
.withPrefix('nimble')
|
|
88
88
|
.register(nimbleAnchorMenuItem());
|
|
89
89
|
export const anchorMenuItemTag = 'nimble-anchor-menu-item';
|
|
90
|
-
// This is a workaround for the fact that FAST's menu uses `instanceof MenuItem`
|
|
91
|
-
// in their logic for indenting menu items. Since our AnchorMenuItem derives from
|
|
92
|
-
// AnchorBase and not FAST's MenuItem, we need to change their MenuItem's definition
|
|
93
|
-
// of `hasInstance` so that it includes our AnchorMenuItem, too.
|
|
94
|
-
//
|
|
95
|
-
// If/when we change FAST to test for the presence of `startColumnCount` instead
|
|
96
|
-
// of using `instanceof MenuItem`, we can remove this workaround. Here is the
|
|
97
|
-
// PR into FAST: https://github.com/microsoft/fast/pull/6667
|
|
98
|
-
const originalInstanceOf = FoundationMenuItem[Symbol.hasInstance].bind(FoundationMenuItem);
|
|
99
|
-
Object.defineProperty(FoundationMenuItem, Symbol.hasInstance, {
|
|
100
|
-
value(instance) {
|
|
101
|
-
return (originalInstanceOf(instance) || instance instanceof AnchorMenuItem);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
90
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/anchor-menu-item/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACH,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/anchor-menu-item/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACH,YAAY,EAGf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IAA9C;;QAEW,aAAQ,GAAG,KAAK,CAAC;QAQxB;;;;;WAKG;QAEI,qBAAgB,GAAwB,CAAC,CAAC;IAkDrD,CAAC;IAhDG,4FAA4F;IAC5F,uGAAuG;IACvG,gGAAgG;IAChG,gEAAgE;IAEhE;;OAEG;IACI,YAAY,CAAC,CAAa;QAC7B,CAAC,CAAC,eAAe,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,CAAgB;QAClC,IAAI,CAAC,CAAC,gBAAgB,EAAE;YACpB,OAAO,KAAK,CAAC;SAChB;QACD,QAAQ,CAAC,CAAC,GAAG,EAAE;YACX,KAAK,QAAQ;gBACT,CAAC,CAAC,eAAe,EAAE,CAAC;gBACpB,MAAM;YACV,QAAQ;SACX;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,0DAA0D;IAC1D,4EAA4E;IAC5E,6EAA6E;IAC7E,oEAAoE;IACpD,YAAY,CAAC,aAAqB,EAAE,KAAa;QAC7D,IAAI,aAAa,KAAK,UAAU,EAAE;YAC9B,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;SAClD;aAAM;YACH,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;SAC5C;IACL,CAAC;IAED,IAAoB,QAAQ;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAChC,CAAC;IAED,IAAoB,QAAQ,CAAC,KAAa;QACtC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;IACjC,CAAC;CACJ;AAjEG;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;gDACF;AAMxB;IADC,UAAU;8CACuB;AASlC;IADC,UAAU;wDACsC;AAoDrD,uFAAuF;AAEvF,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,CAAgB;IAC/D,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ;IACR,MAAM;IACN,aAAa,EAAE;QACX,cAAc,EAAE,IAAI;KACvB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,oBAAoB,EAAE,CAAC,CAAC;AACtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,yBAAyB,CAAC","sourcesContent":["import { attr, observable } from '@microsoft/fast-element';\nimport {\n DesignSystem,\n AnchorOptions,\n MenuItemColumnCount\n} from '@microsoft/fast-foundation';\nimport { keyEnter } from '@microsoft/fast-web-utilities';\nimport { AnchorBase } from '../anchor-base';\nimport { styles } from './styles';\nimport { template } from './template';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-anchor-menu-item': AnchorMenuItem;\n }\n}\n\n/**\n * A nimble-styled anchor menu-item\n */\nexport class AnchorMenuItem extends AnchorBase {\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n /**\n * @internal\n */\n @observable\n public anchor!: HTMLAnchorElement;\n\n /**\n * There is an assumption that this component is styled using a grid display, and this property\n * controls which grid column contains the menu item text (i.e. the indentation of the text).\n * The parent menu sets this value on all its child menu items so their indentations align.\n * @internal\n */\n @observable\n public startColumnCount: MenuItemColumnCount = 0;\n\n // The following two handlers are workarounds for issues with anchor menu items in submenus.\n // Events can bubble up the DOM and get handled by the menu item in the parent menu. When that happens,\n // the menu item's handlers (FAST) return false and prevent the default action, i.e. navigation.\n // See tech debt issue: https://github.com/ni/nimble/issues/1740\n\n /**\n * @internal\n */\n public clickHandler(e: MouseEvent): boolean {\n e.stopPropagation();\n return true;\n }\n\n /**\n * @internal\n */\n public keydownHandler(e: KeyboardEvent): boolean {\n if (e.defaultPrevented) {\n return false;\n }\n switch (e.key) {\n case keyEnter:\n e.stopPropagation();\n break;\n default:\n }\n return true;\n }\n\n // The FAST Menu manages the `tabindex` of its menu items.\n // When keyboard navigating to an item, it sets that item's `tabindex` to 0.\n // We need to pass this on to the anchor, otherwise an anchor without an href\n // will not be focusable and will prevent arrowing through the menu.\n public override setAttribute(qualifiedName: string, value: string): void {\n if (qualifiedName === 'tabindex') {\n this.anchor.setAttribute(qualifiedName, value);\n } else {\n super.setAttribute(qualifiedName, value);\n }\n }\n\n public override get tabIndex(): number {\n return this.anchor.tabIndex;\n }\n\n public override set tabIndex(value: number) {\n this.anchor.tabIndex = value;\n }\n}\n\n// FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.\n\nconst nimbleAnchorMenuItem = AnchorMenuItem.compose<AnchorOptions>({\n baseName: 'anchor-menu-item',\n template,\n styles,\n shadowOptions: {\n delegatesFocus: true\n }\n});\n\nDesignSystem.getOrCreate()\n .withPrefix('nimble')\n .register(nimbleAnchorMenuItem());\nexport const anchorMenuItemTag = 'nimble-anchor-menu-item';\n"]}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
9
|
-
constructor(
|
|
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
|
|
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';
|
|
@@ -19,17 +18,17 @@ declare const TableColumnDateText_base: (abstract new (...args: any[]) => {
|
|
|
19
18
|
groupIndex?: number | null | undefined;
|
|
20
19
|
groupingDisabledChanged(): void;
|
|
21
20
|
groupIndexChanged(): void;
|
|
22
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
21
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
|
|
23
22
|
}) & (abstract new (...args: any[]) => {
|
|
24
23
|
fractionalWidth?: number | null | undefined;
|
|
25
24
|
minPixelWidth?: number | null | undefined;
|
|
26
25
|
fractionalWidthChanged(): void;
|
|
27
26
|
minPixelWidthChanged(): void;
|
|
28
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
27
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
|
|
29
28
|
}) & (abstract new (...args: any[]) => {
|
|
30
29
|
placeholder?: string | undefined;
|
|
31
30
|
placeholderChanged(): void;
|
|
32
|
-
}) & ((abstract new () => TableColumnTextBase<TableColumnDateTextColumnConfig>) & {
|
|
31
|
+
}) & ((abstract new () => TableColumnTextBase<TableColumnDateTextColumnConfig, TableColumnDateTextValidator>) & {
|
|
33
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>;
|
|
34
33
|
from<TBase extends {
|
|
35
34
|
new (): HTMLElement;
|
|
@@ -41,8 +40,6 @@ declare const TableColumnDateText_base: (abstract new (...args: any[]) => {
|
|
|
41
40
|
* The table column for displaying dates/times as text.
|
|
42
41
|
*/
|
|
43
42
|
export declare class TableColumnDateText extends TableColumnDateText_base {
|
|
44
|
-
/** @internal */
|
|
45
|
-
validator: TableColumnDateTextValidator;
|
|
46
43
|
format: DateTextFormat;
|
|
47
44
|
customLocaleMatcher: LocaleMatcherAlgorithm;
|
|
48
45
|
customWeekday: WeekdayFormat;
|
|
@@ -66,9 +63,8 @@ export declare class TableColumnDateText extends TableColumnDateText_base {
|
|
|
66
63
|
private readonly langSubscriber;
|
|
67
64
|
connectedCallback(): void;
|
|
68
65
|
disconnectedCallback(): void;
|
|
69
|
-
get validity(): TableColumnValidity;
|
|
70
66
|
placeholderChanged(): void;
|
|
71
|
-
protected getColumnInternalsOptions(): ColumnInternalsOptions
|
|
67
|
+
protected getColumnInternalsOptions(): ColumnInternalsOptions<TableColumnDateTextValidator>;
|
|
72
68
|
protected formatChanged(): void;
|
|
73
69
|
protected customLocaleMatcherChanged(): void;
|
|
74
70
|
protected customWeekdayChanged(): void;
|
|
@@ -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(
|
|
7
|
+
constructor();
|
|
9
8
|
setCustomOptionsValidity(valid: boolean): void;
|
|
10
9
|
}
|
|
11
10
|
export {};
|
|
@@ -3,6 +3,7 @@ import type { ColumnInternalsOptions } from '../base/models/column-internals';
|
|
|
3
3
|
import { DurationFormatter } from './models/duration-formatter';
|
|
4
4
|
import type { TableColumnTextBaseColumnConfig } from '../text-base/cell-view';
|
|
5
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;
|
|
@@ -17,17 +18,17 @@ declare const TableColumnDurationText_base: (abstract new (...args: any[]) => {
|
|
|
17
18
|
groupIndex?: number | null | undefined;
|
|
18
19
|
groupingDisabledChanged(): void;
|
|
19
20
|
groupIndexChanged(): void;
|
|
20
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
21
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
|
|
21
22
|
}) & (abstract new (...args: any[]) => {
|
|
22
23
|
fractionalWidth?: number | null | undefined;
|
|
23
24
|
minPixelWidth?: number | null | undefined;
|
|
24
25
|
fractionalWidthChanged(): void;
|
|
25
26
|
minPixelWidthChanged(): void;
|
|
26
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
27
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
|
|
27
28
|
}) & (abstract new (...args: any[]) => {
|
|
28
29
|
placeholder?: string | undefined;
|
|
29
30
|
placeholderChanged(): void;
|
|
30
|
-
}) & ((abstract new () => TableColumnTextBase<TableColumnDurationTextColumnConfig
|
|
31
|
+
}) & ((abstract new () => TableColumnTextBase<TableColumnDurationTextColumnConfig, ColumnValidator<[]>>) & {
|
|
31
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>;
|
|
32
33
|
from<TBase extends {
|
|
33
34
|
new (): HTMLElement;
|
|
@@ -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(
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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';
|
|
@@ -22,17 +21,17 @@ declare const TableColumnNumberText_base: (abstract new (...args: any[]) => {
|
|
|
22
21
|
groupIndex?: number | null | undefined;
|
|
23
22
|
groupingDisabledChanged(): void;
|
|
24
23
|
groupIndexChanged(): void;
|
|
25
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
24
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
|
|
26
25
|
}) & (abstract new (...args: any[]) => {
|
|
27
26
|
fractionalWidth?: number | null | undefined;
|
|
28
27
|
minPixelWidth?: number | null | undefined;
|
|
29
28
|
fractionalWidthChanged(): void;
|
|
30
29
|
minPixelWidthChanged(): void;
|
|
31
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
30
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, import("../base/models/column-validator").ColumnValidator<[]>>;
|
|
32
31
|
}) & (abstract new (...args: any[]) => {
|
|
33
32
|
placeholder?: string | undefined;
|
|
34
33
|
placeholderChanged(): void;
|
|
35
|
-
}) & ((abstract new () => TableColumnTextBase<TableColumnNumberTextColumnConfig>) & {
|
|
34
|
+
}) & ((abstract new () => TableColumnTextBase<TableColumnNumberTextColumnConfig, TableColumnNumberTextValidator>) & {
|
|
36
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>;
|
|
37
36
|
from<TBase extends {
|
|
38
37
|
new (): HTMLElement;
|
|
@@ -44,8 +43,6 @@ declare const TableColumnNumberText_base: (abstract new (...args: any[]) => {
|
|
|
44
43
|
* The table column for displaying numbers as text.
|
|
45
44
|
*/
|
|
46
45
|
export declare class TableColumnNumberText extends TableColumnNumberText_base {
|
|
47
|
-
/** @internal */
|
|
48
|
-
validator: TableColumnNumberTextValidator;
|
|
49
46
|
format: NumberTextFormat;
|
|
50
47
|
alignment: NumberTextAlignment;
|
|
51
48
|
decimalDigits?: number;
|
|
@@ -58,9 +55,8 @@ export declare class TableColumnNumberText extends TableColumnNumberText_base {
|
|
|
58
55
|
private readonly unitSubscriber;
|
|
59
56
|
connectedCallback(): void;
|
|
60
57
|
disconnectedCallback(): void;
|
|
61
|
-
get validity(): TableColumnValidity;
|
|
62
58
|
placeholderChanged(): void;
|
|
63
|
-
protected getColumnInternalsOptions(): ColumnInternalsOptions
|
|
59
|
+
protected getColumnInternalsOptions(): ColumnInternalsOptions<TableColumnNumberTextValidator>;
|
|
64
60
|
private updateUnitNotifier;
|
|
65
61
|
private formatChanged;
|
|
66
62
|
private alignmentChanged;
|
package/dist/esm/src/table-column/number-text/models/table-column-number-text-validator.d.ts
CHANGED
|
@@ -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(
|
|
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
|
}
|
|
@@ -15,17 +16,17 @@ declare const TableColumnText_base: (abstract new (...args: any[]) => {
|
|
|
15
16
|
groupIndex?: number | null | undefined;
|
|
16
17
|
groupingDisabledChanged(): void;
|
|
17
18
|
groupIndexChanged(): void;
|
|
18
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
19
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
|
|
19
20
|
}) & (abstract new (...args: any[]) => {
|
|
20
21
|
fractionalWidth?: number | null | undefined;
|
|
21
22
|
minPixelWidth?: number | null | undefined;
|
|
22
23
|
fractionalWidthChanged(): void;
|
|
23
24
|
minPixelWidthChanged(): void;
|
|
24
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
25
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
|
|
25
26
|
}) & (abstract new (...args: any[]) => {
|
|
26
27
|
placeholder?: string | undefined;
|
|
27
28
|
placeholderChanged(): void;
|
|
28
|
-
}) & ((abstract new () => TableColumnTextBase<TableColumnTextColumnConfig
|
|
29
|
+
}) & ((abstract new () => TableColumnTextBase<TableColumnTextColumnConfig, ColumnValidator<[]>>) & {
|
|
29
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>;
|
|
30
31
|
from<TBase extends {
|
|
31
32
|
new (): HTMLElement;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { TableColumn } from '../base';
|
|
2
|
+
import type { ColumnValidator } from '../base/models/column-validator';
|
|
2
3
|
/**
|
|
3
4
|
* The base class for table columns that display fields of any type as text.
|
|
4
5
|
*/
|
|
5
|
-
export declare abstract class TableColumnTextBase<TColumnConfig> extends TableColumn<TColumnConfig> {
|
|
6
|
+
export declare abstract class TableColumnTextBase<TColumnConfig, TColumnValidator extends ColumnValidator<[]> = ColumnValidator<[]>> extends TableColumn<TColumnConfig, TColumnValidator> {
|
|
6
7
|
fieldName?: string;
|
|
7
8
|
protected fieldNameChanged(): void;
|
|
8
9
|
}
|
|
9
|
-
type TableColumnBaseConstructor<TColumnConfig
|
|
10
|
-
export declare function mixinTextBase<TBase extends TableColumnBaseConstructor<TColumnConfig>, TColumnConfig>(base: TBase): (abstract new (...args: any[]) => {
|
|
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[]) => {
|
|
11
12
|
groupingDisabled: boolean;
|
|
12
13
|
groupIndex?: number | null | undefined;
|
|
13
14
|
groupingDisabledChanged(): void;
|
|
14
15
|
groupIndexChanged(): void;
|
|
15
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
16
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
|
|
16
17
|
}) & (abstract new (...args: any[]) => {
|
|
17
18
|
fractionalWidth?: number | null | undefined;
|
|
18
19
|
minPixelWidth?: number | null | undefined;
|
|
19
20
|
fractionalWidthChanged(): void;
|
|
20
21
|
minPixelWidthChanged(): void;
|
|
21
|
-
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown
|
|
22
|
+
readonly columnInternals: import("../base/models/column-internals").ColumnInternals<unknown, ColumnValidator<[]>>;
|
|
22
23
|
}) & (abstract new (...args: any[]) => {
|
|
23
24
|
placeholder?: string | undefined;
|
|
24
25
|
placeholderChanged(): void;
|
package/dist/esm/table/index.js
CHANGED
|
@@ -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
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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() {
|