@ni/nimble-components 18.6.2 → 18.6.4
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 +354 -80
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +581 -555
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table/components/row/styles.js +4 -1
- package/dist/esm/table/components/row/styles.js.map +1 -1
- package/dist/esm/table/index.d.ts +24 -6
- package/dist/esm/table/index.js +101 -65
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/table-layout-helper.d.ts +8 -0
- package/dist/esm/table/models/table-layout-helper.js +24 -0
- package/dist/esm/table/models/table-layout-helper.js.map +1 -0
- package/dist/esm/table/models/update-tracker.d.ts +26 -0
- package/dist/esm/table/models/update-tracker.js +106 -0
- package/dist/esm/table/models/update-tracker.js.map +1 -0
- package/dist/esm/table/models/virtualizer.js +1 -1
- package/dist/esm/table/styles.js +13 -3
- package/dist/esm/table/styles.js.map +1 -1
- package/dist/esm/table/template.js +11 -5
- package/dist/esm/table/template.js.map +1 -1
- package/dist/esm/table-column/base/index.d.ts +30 -0
- package/dist/esm/table-column/base/index.js +39 -1
- package/dist/esm/table-column/base/index.js.map +1 -1
- package/dist/esm/table-column/base/styles.js +6 -0
- package/dist/esm/table-column/base/styles.js.map +1 -1
- package/dist/esm/table-column/base/template.js +3 -1
- package/dist/esm/table-column/base/template.js.map +1 -1
- package/dist/esm/table-column/base/types.d.ts +2 -0
- package/dist/esm/table-column/base/types.js +2 -0
- package/dist/esm/table-column/base/types.js.map +1 -1
- package/dist/esm/table-column/mixins/fractional-width-column.d.ts +12 -0
- package/dist/esm/table-column/mixins/fractional-width-column.js +41 -0
- package/dist/esm/table-column/mixins/fractional-width-column.js.map +1 -0
- package/dist/esm/table-column/text/index.d.ts +16 -2
- package/dist/esm/table-column/text/index.js +14 -7
- package/dist/esm/table-column/text/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,13 @@ import { TableColumnSortDirection } from './types';
|
|
|
6
6
|
// prettier-ignore
|
|
7
7
|
export const template = html `
|
|
8
8
|
<template role="table" ${children({ property: 'childItems', filter: elements() })}>
|
|
9
|
-
<div class="table-container"
|
|
9
|
+
<div class="table-container" style="
|
|
10
|
+
--ni-private-table-scroll-x: -${x => x.scrollX}px;
|
|
11
|
+
--ni-private-table-header-scrollbar-spacer-width: ${x => x.virtualizer.headerContainerMarginRight}px;
|
|
12
|
+
--ni-private-table-scroll-height: ${x => x.virtualizer.allRowsHeight}px;
|
|
13
|
+
--ni-private-table-row-container-top: ${x => x.virtualizer.rowContainerYOffset}px;
|
|
14
|
+
--ni-private-table-row-grid-columns: ${x => x.rowGridColumns ?? ''}
|
|
15
|
+
">
|
|
10
16
|
<div role="rowgroup" class="header-container">
|
|
11
17
|
<div class="header-row" role="row">
|
|
12
18
|
${repeat(x => x.columns, html `
|
|
@@ -20,12 +26,13 @@ export const template = html `
|
|
|
20
26
|
</${DesignSystem.tagFor(TableHeader)}>
|
|
21
27
|
`)}
|
|
22
28
|
`)}
|
|
23
|
-
<div class="header-scrollbar-spacer"
|
|
29
|
+
<div class="header-scrollbar-spacer"></div>
|
|
24
30
|
</div>
|
|
25
31
|
</div>
|
|
26
32
|
<div class="table-viewport" ${ref('viewport')}>
|
|
27
|
-
<div class="table-scroll"
|
|
28
|
-
<div class="table-row-container"
|
|
33
|
+
<div class="table-scroll"></div>
|
|
34
|
+
<div class="table-row-container"
|
|
35
|
+
role="rowgroup">
|
|
29
36
|
${when(x => x.columns.length > 0 && x.canRenderRows, html `
|
|
30
37
|
${repeat(x => x.virtualizer.visibleItems, html `
|
|
31
38
|
<${DesignSystem.tagFor(TableRow)}
|
|
@@ -35,7 +42,6 @@ export const template = html `
|
|
|
35
42
|
:columns="${(_, c) => c.parent.columns}"
|
|
36
43
|
@row-action-menu-beforetoggle="${(_, c) => c.parent.onRowActionMenuBeforeToggle(c.event)}"
|
|
37
44
|
@row-action-menu-toggle="${(_, c) => c.parent.onRowActionMenuToggle(c.event)}"
|
|
38
|
-
style="height: ${x => x.size}px;"
|
|
39
45
|
>
|
|
40
46
|
${when((x, c) => c.parent.openActionMenuRecordId === c.parent.tableData[x.index]?.id, html `
|
|
41
47
|
${repeat((_, c) => c.parent.actionMenuSlots, html `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/table/template.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,MAAM,EACN,IAAI,EACP,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAEH,wBAAwB,EAC3B,MAAM,SAAS,CAAC;AAEjB,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAO;6BACN,QAAQ,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/table/template.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,MAAM,EACN,IAAI,EACP,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAEH,wBAAwB,EAC3B,MAAM,SAAS,CAAC;AAEjB,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAO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|
|
14
14
|
sortDirection: TableColumnSortDirection;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
* Used by the Table in order to give a column a specific pixel width.
|
|
18
|
+
* When set 'currentFractionalWidth' will be ignored.
|
|
19
|
+
*/
|
|
20
|
+
currentPixelWidth?: number;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
* Used by the Table in order to size a column proportionally to the available
|
|
24
|
+
* width of a row.
|
|
25
|
+
*/
|
|
26
|
+
currentFractionalWidth: number;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* Used by column plugins to set a specific pixel width. Sets currentPixelWidth when changed.
|
|
30
|
+
*/
|
|
31
|
+
internalPixelWidth?: number;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
* Used by column plugins to size a column proportionally to the available
|
|
35
|
+
* width of a row. Sets currentFractionalWidth when changed.
|
|
36
|
+
*/
|
|
37
|
+
internalFractionalWidth: number;
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
* The minimum size in pixels according to the design doc
|
|
41
|
+
*/
|
|
42
|
+
internalMinPixelWidth: number;
|
|
15
43
|
/**
|
|
16
44
|
* @internal
|
|
17
45
|
*
|
|
@@ -67,4 +95,6 @@ export declare abstract class TableColumn<TCellRecord extends TableCellRecord =
|
|
|
67
95
|
* @internal
|
|
68
96
|
*/
|
|
69
97
|
connectedCallback(): void;
|
|
98
|
+
protected internalFractionalWidthChanged(): void;
|
|
99
|
+
protected internalPixelWidthChanged(): void;
|
|
70
100
|
}
|
|
@@ -3,7 +3,7 @@ import { attr, nullableNumberConverter, observable } from '@microsoft/fast-eleme
|
|
|
3
3
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
4
4
|
import { uniqueId } from '@microsoft/fast-web-utilities';
|
|
5
5
|
import { TableColumnSortDirection } from '../../table/types';
|
|
6
|
-
import { TableColumnSortOperation } from './types';
|
|
6
|
+
import { defaultFractionalWidth, defaultMinPixelWidth, TableColumnSortOperation } from './types';
|
|
7
7
|
/**
|
|
8
8
|
* The base class for table columns
|
|
9
9
|
*/
|
|
@@ -12,6 +12,23 @@ export class TableColumn extends FoundationElement {
|
|
|
12
12
|
super();
|
|
13
13
|
this.columnHidden = false;
|
|
14
14
|
this.sortDirection = TableColumnSortDirection.none;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
* Used by the Table in order to size a column proportionally to the available
|
|
18
|
+
* width of a row.
|
|
19
|
+
*/
|
|
20
|
+
this.currentFractionalWidth = defaultFractionalWidth;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
* Used by column plugins to size a column proportionally to the available
|
|
24
|
+
* width of a row. Sets currentFractionalWidth when changed.
|
|
25
|
+
*/
|
|
26
|
+
this.internalFractionalWidth = defaultFractionalWidth;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* The minimum size in pixels according to the design doc
|
|
30
|
+
*/
|
|
31
|
+
this.internalMinPixelWidth = defaultMinPixelWidth;
|
|
15
32
|
/**
|
|
16
33
|
* @internal
|
|
17
34
|
*
|
|
@@ -34,6 +51,12 @@ export class TableColumn extends FoundationElement {
|
|
|
34
51
|
super.connectedCallback();
|
|
35
52
|
this.setAttribute('slot', this.internalUniqueId);
|
|
36
53
|
}
|
|
54
|
+
internalFractionalWidthChanged() {
|
|
55
|
+
this.currentFractionalWidth = this.internalFractionalWidth;
|
|
56
|
+
}
|
|
57
|
+
internalPixelWidthChanged() {
|
|
58
|
+
this.currentPixelWidth = this.internalPixelWidth;
|
|
59
|
+
}
|
|
37
60
|
}
|
|
38
61
|
__decorate([
|
|
39
62
|
attr({ attribute: 'column-id' })
|
|
@@ -53,6 +76,21 @@ __decorate([
|
|
|
53
76
|
__decorate([
|
|
54
77
|
attr({ attribute: 'sort-direction' })
|
|
55
78
|
], TableColumn.prototype, "sortDirection", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
observable
|
|
81
|
+
], TableColumn.prototype, "currentPixelWidth", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
observable
|
|
84
|
+
], TableColumn.prototype, "currentFractionalWidth", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
observable
|
|
87
|
+
], TableColumn.prototype, "internalPixelWidth", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
observable
|
|
90
|
+
], TableColumn.prototype, "internalFractionalWidth", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
observable
|
|
93
|
+
], TableColumn.prototype, "internalMinPixelWidth", void 0);
|
|
56
94
|
__decorate([
|
|
57
95
|
observable
|
|
58
96
|
], TableColumn.prototype, "dataRecordFieldNames", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/base/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,IAAI,EAEJ,uBAAuB,EACvB,UAAU,EAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAkB,MAAM,mBAAmB,CAAC;AAC7E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/base/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,IAAI,EAEJ,uBAAuB,EACvB,UAAU,EAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAkB,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EACH,sBAAsB,EACtB,oBAAoB,EAGpB,wBAAwB,EAC3B,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,OAAgB,WAGpB,SAAQ,iBAAiB;IAwHvB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AAC;kDACyC;AAQ/E;IADC,UAAU;sDACuB;AAQlC;IADC,UAAU;2DAC4C;AAOvD;IADC,UAAU;uDACwB;AAQnC;IADC,UAAU;4DAC6C;AAOxD;IADC,UAAU;0DACyC;AAgCpD;IADC,UAAU;yDAC+D;AAQ1E;IADC,UAAU;iDACyB;AAQpC;IADC,UAAU;+DACwC;AAQnD;IADC,UAAU;kDACqE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/table-column/base/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAE9C,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/table-column/base/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAE9C,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;CAUxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/table-column/base/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAA
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/table-column/base/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAA;;;;;;CAM3B,CAAC"}
|
|
@@ -24,3 +24,5 @@ export declare const TableColumnSortOperation: {
|
|
|
24
24
|
readonly localeAwareCaseSensitive: "localeAwareCaseSensitive";
|
|
25
25
|
};
|
|
26
26
|
export declare type TableColumnSortOperation = (typeof TableColumnSortOperation)[keyof typeof TableColumnSortOperation];
|
|
27
|
+
export declare const defaultMinPixelWidth = 88;
|
|
28
|
+
export declare const defaultFractionalWidth = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/base/types.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;;OAGG;IACH,wBAAwB,EAAE,0BAA0B;CAC9C,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/table-column/base/types.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;;OAGG;IACH,wBAAwB,EAAE,0BAA0B;CAC9C,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TableColumn } from '../base';
|
|
2
|
+
declare type SizedTableColumn = Pick<TableColumn, 'internalFractionalWidth' | 'internalMinPixelWidth'>;
|
|
3
|
+
declare type SizedTableColumnConstructor = abstract new (...args: any[]) => SizedTableColumn;
|
|
4
|
+
export declare function mixinFractionalWidthColumnAPI<TBase extends SizedTableColumnConstructor>(base: TBase): (abstract new (...args: any[]) => {
|
|
5
|
+
fractionalWidth?: number | null | undefined;
|
|
6
|
+
minPixelWidth?: number | null | undefined;
|
|
7
|
+
fractionalWidthChanged(): void;
|
|
8
|
+
minPixelWidthChanged(): void;
|
|
9
|
+
internalFractionalWidth: number;
|
|
10
|
+
internalMinPixelWidth: number;
|
|
11
|
+
}) & TBase;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { attr, nullableNumberConverter } from '@microsoft/fast-element';
|
|
2
|
+
import { defaultMinPixelWidth, defaultFractionalWidth } from '../base/types';
|
|
3
|
+
// As the returned class is internal to the function, we can't write a signature that uses is directly, so rely on inference
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
|
|
5
|
+
export function mixinFractionalWidthColumnAPI(base) {
|
|
6
|
+
/**
|
|
7
|
+
* The Mixin that provides a concrete column with the API to support being resized
|
|
8
|
+
* proportionally within a Table.
|
|
9
|
+
*/
|
|
10
|
+
class FractionalWidthColumn extends base {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.fractionalWidth = defaultFractionalWidth;
|
|
14
|
+
this.minPixelWidth = defaultMinPixelWidth;
|
|
15
|
+
}
|
|
16
|
+
fractionalWidthChanged() {
|
|
17
|
+
if (typeof this.fractionalWidth === 'number') {
|
|
18
|
+
this.internalFractionalWidth = this.fractionalWidth;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this.internalFractionalWidth = defaultFractionalWidth;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
minPixelWidthChanged() {
|
|
25
|
+
if (typeof this.minPixelWidth === 'number') {
|
|
26
|
+
this.internalMinPixelWidth = this.minPixelWidth;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.internalMinPixelWidth = defaultMinPixelWidth;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
attr({ attribute: 'fractional-width', converter: nullableNumberConverter })(
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
35
|
+
FractionalWidthColumn.prototype, 'fractionalWidth');
|
|
36
|
+
attr({ attribute: 'min-pixel-width', converter: nullableNumberConverter })(
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
38
|
+
FractionalWidthColumn.prototype, 'minPixelWidth');
|
|
39
|
+
return FractionalWidthColumn;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=fractional-width-column.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fractional-width-column.js","sourceRoot":"","sources":["../../../../src/table-column/mixins/fractional-width-column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAW7E,4HAA4H;AAC5H,+HAA+H;AAC/H,MAAM,UAAU,6BAA6B,CAE3C,IAAW;IACT;;;OAGG;IACH,MAAe,qBAAsB,SAAQ,IAAI;QAAjD;;YACW,oBAAe,GAAmB,sBAAsB,CAAC;YAEzD,kBAAa,GAAmB,oBAAoB,CAAC;QAiBhE,CAAC;QAfU,sBAAsB;YACzB,IAAI,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;gBAC1C,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,eAAe,CAAC;aACvD;iBAAM;gBACH,IAAI,CAAC,uBAAuB,GAAG,sBAAsB,CAAC;aACzD;QACL,CAAC;QAEM,oBAAoB;YACvB,IAAI,OAAO,IAAI,CAAC,aAAa,KAAK,QAAQ,EAAE;gBACxC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,aAAa,CAAC;aACnD;iBAAM;gBACH,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;aACrD;QACL,CAAC;KACJ;IAED,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IACvE,iEAAiE;IACjE,qBAAqB,CAAC,SAAS,EAC/B,iBAAiB,CACpB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;IACtE,iEAAiE;IACjE,qBAAqB,CAAC,SAAS,EAC/B,eAAe,CAClB,CAAC;IACF,OAAO,qBAAqB,CAAC;AACjC,CAAC"}
|
|
@@ -10,9 +10,9 @@ declare global {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* The table column for displaying strings.
|
|
13
|
+
* The base class for a table column for displaying strings.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
declare class TableColumnTextBase extends TableColumn<TableColumnTextCellRecord, TableColumnTextColumnConfig> {
|
|
16
16
|
cellRecordFieldNames: readonly ["value"];
|
|
17
17
|
fieldName?: string;
|
|
18
18
|
placeholder?: string;
|
|
@@ -22,4 +22,18 @@ export declare class TableColumnText extends TableColumn<TableColumnTextCellReco
|
|
|
22
22
|
protected fieldNameChanged(): void;
|
|
23
23
|
protected placeholderChanged(): void;
|
|
24
24
|
}
|
|
25
|
+
declare const TableColumnText_base: (abstract new (...args: any[]) => {
|
|
26
|
+
fractionalWidth?: number | null | undefined;
|
|
27
|
+
minPixelWidth?: number | null | undefined;
|
|
28
|
+
fractionalWidthChanged(): void;
|
|
29
|
+
minPixelWidthChanged(): void;
|
|
30
|
+
internalFractionalWidth: number;
|
|
31
|
+
internalMinPixelWidth: number;
|
|
32
|
+
}) & typeof TableColumnTextBase;
|
|
33
|
+
/**
|
|
34
|
+
* The table column for displaying strings.
|
|
35
|
+
*/
|
|
36
|
+
export declare class TableColumnText extends TableColumnText_base {
|
|
37
|
+
}
|
|
25
38
|
export declare const tableColumnTextTag: string;
|
|
39
|
+
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
|
|
2
|
+
/* eslint-disable max-classes-per-file */
|
|
3
3
|
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
4
|
-
import {
|
|
5
|
-
import { TableColumn } from '../base';
|
|
4
|
+
import { attr } from '@microsoft/fast-element';
|
|
6
5
|
import { styles } from '../base/styles';
|
|
7
6
|
import { template } from '../base/template';
|
|
7
|
+
import { mixinFractionalWidthColumnAPI } from '../mixins/fractional-width-column';
|
|
8
|
+
import { TableColumn } from '../base';
|
|
9
|
+
import { TableColumnSortOperation } from '../base/types';
|
|
8
10
|
import { cellStyles } from './styles';
|
|
9
11
|
import { cellTemplate } from './template';
|
|
10
12
|
/**
|
|
11
|
-
* The table column for displaying strings.
|
|
13
|
+
* The base class for a table column for displaying strings.
|
|
12
14
|
*/
|
|
13
|
-
|
|
15
|
+
class TableColumnTextBase extends TableColumn {
|
|
14
16
|
constructor() {
|
|
15
17
|
super();
|
|
16
18
|
this.cellRecordFieldNames = ['value'];
|
|
@@ -28,10 +30,15 @@ export class TableColumnText extends TableColumn {
|
|
|
28
30
|
}
|
|
29
31
|
__decorate([
|
|
30
32
|
attr({ attribute: 'field-name' })
|
|
31
|
-
],
|
|
33
|
+
], TableColumnTextBase.prototype, "fieldName", void 0);
|
|
32
34
|
__decorate([
|
|
33
35
|
attr
|
|
34
|
-
],
|
|
36
|
+
], TableColumnTextBase.prototype, "placeholder", void 0);
|
|
37
|
+
/**
|
|
38
|
+
* The table column for displaying strings.
|
|
39
|
+
*/
|
|
40
|
+
export class TableColumnText extends mixinFractionalWidthColumnAPI(TableColumnTextBase) {
|
|
41
|
+
}
|
|
35
42
|
const nimbleTableColumnText = TableColumnText.compose({
|
|
36
43
|
baseName: 'table-column-text',
|
|
37
44
|
template,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/text/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/text/index.ts"],"names":[],"mappings":";AAAA,yCAAyC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,E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CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ni/nimble-components",
|
|
3
|
-
"version": "18.6.
|
|
3
|
+
"version": "18.6.4",
|
|
4
4
|
"description": "Styled web components for the NI Nimble Design System",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run generate-icons && npm run build-components && npm run bundle-components && npm run generate-scss && npm run build-storybook",
|