@ni/nimble-components 19.4.2 → 19.4.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 +135 -64
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +518 -525
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/src/table-column/anchor/cell-view/index.d.ts +1 -3
- package/dist/esm/src/table-column/base/index.d.ts +1 -3
- package/dist/esm/src/table-column/text/cell-view/index.d.ts +2 -3
- package/dist/esm/src/table-column/text/group-header-view/index.d.ts +2 -3
- package/dist/esm/src/table-column/text-base/cell-view/index.d.ts +7 -15
- package/dist/esm/src/table-column/text-base/group-header-view/index.d.ts +6 -18
- package/dist/esm/src/utilities/directive/overflow.d.ts +36 -0
- package/dist/esm/table-column/anchor/cell-view/index.d.ts +1 -3
- package/dist/esm/table-column/anchor/cell-view/index.js +2 -2
- package/dist/esm/table-column/anchor/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/anchor/cell-view/template.js +5 -15
- package/dist/esm/table-column/anchor/cell-view/template.js.map +1 -1
- package/dist/esm/table-column/base/index.d.ts +1 -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/template.js +3 -9
- package/dist/esm/table-column/base/template.js.map +1 -1
- package/dist/esm/table-column/text/cell-view/index.d.ts +2 -3
- package/dist/esm/table-column/text/cell-view/index.js +11 -7
- package/dist/esm/table-column/text/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/text/group-header-view/index.d.ts +2 -3
- package/dist/esm/table-column/text/group-header-view/index.js +11 -7
- package/dist/esm/table-column/text/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/index.d.ts +7 -15
- package/dist/esm/table-column/text-base/cell-view/index.js +23 -2
- package/dist/esm/table-column/text-base/cell-view/index.js.map +1 -1
- package/dist/esm/table-column/text-base/cell-view/template.js +4 -9
- package/dist/esm/table-column/text-base/cell-view/template.js.map +1 -1
- package/dist/esm/table-column/text-base/group-header-view/index.d.ts +6 -18
- package/dist/esm/table-column/text-base/group-header-view/index.js +21 -8
- package/dist/esm/table-column/text-base/group-header-view/index.js.map +1 -1
- package/dist/esm/table-column/text-base/group-header-view/template.js +3 -4
- package/dist/esm/table-column/text-base/group-header-view/template.js.map +1 -1
- package/dist/esm/utilities/directive/overflow.d.ts +36 -0
- package/dist/esm/utilities/directive/overflow.js +56 -0
- package/dist/esm/utilities/directive/overflow.js.map +1 -0
- package/package.json +1 -1
|
@@ -11,11 +11,9 @@ declare global {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnAnchorCellView extends TableCellView<TableColumnAnchorCellRecord, TableColumnAnchorColumnConfig> {
|
|
13
13
|
/** @internal */
|
|
14
|
-
|
|
14
|
+
hasOverflow: boolean;
|
|
15
15
|
/** @internal */
|
|
16
16
|
anchor?: Anchor;
|
|
17
|
-
/** @internal */
|
|
18
|
-
textSpan?: HTMLSpanElement;
|
|
19
17
|
get content(): string;
|
|
20
18
|
focusedRecycleCallback(): void;
|
|
21
19
|
}
|
|
@@ -20,9 +20,7 @@ export declare abstract class TableColumn<TColumnConfig = unknown> extends Found
|
|
|
20
20
|
sortDirection: TableColumnSortDirection;
|
|
21
21
|
sortingDisabled: boolean;
|
|
22
22
|
/** @internal */
|
|
23
|
-
|
|
24
|
-
/** @internal */
|
|
25
|
-
headerSpan: HTMLSpanElement;
|
|
23
|
+
hasOverflow: boolean;
|
|
26
24
|
/** @internal */
|
|
27
25
|
contentSlot: HTMLSlotElement;
|
|
28
26
|
checkValidity(): boolean;
|
|
@@ -9,8 +9,7 @@ declare global {
|
|
|
9
9
|
* A cell view for displaying string fields as text
|
|
10
10
|
*/
|
|
11
11
|
export declare class TableColumnTextCellView extends TableColumnTextCellViewBase<TableColumnTextCellRecord, TableColumnTextColumnConfig> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
get shouldUsePlaceholder(): boolean;
|
|
12
|
+
private columnConfigChanged;
|
|
13
|
+
private cellRecordChanged;
|
|
15
14
|
}
|
|
16
15
|
export declare const tableColumnTextCellViewTag: string;
|
|
@@ -10,8 +10,7 @@ declare global {
|
|
|
10
10
|
* The group header view for displaying string fields as text.
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<TableStringFieldValue, TableColumnTextColumnConfig> {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
get shouldUsePlaceholder(): boolean;
|
|
13
|
+
private columnConfigChanged;
|
|
14
|
+
private groupHeaderValueChanged;
|
|
16
15
|
}
|
|
17
16
|
export declare const tableColumnTextGroupHeaderTag: string;
|
|
@@ -5,26 +5,18 @@ import type { TableCellRecord } from '../../base/types';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class TableColumnTextCellViewBase<TCellRecord extends TableCellRecord = TableCellRecord, TColumnConfig = unknown> extends TableCellView<TCellRecord, TColumnConfig> {
|
|
7
7
|
/** @internal */
|
|
8
|
-
|
|
9
|
-
/** @internal */
|
|
10
|
-
textSpan: HTMLElement;
|
|
8
|
+
hasOverflow: boolean;
|
|
11
9
|
/**
|
|
12
|
-
*
|
|
13
|
-
* If the implementation has branching code paths then it must be marked with @volatile.
|
|
14
|
-
* https://www.fast.design/docs/fast-element/observables-and-state/#observable-features
|
|
10
|
+
* Text to render in the cell when it contains a valid value (i.e. when shouldUsePlaceholder is false).
|
|
15
11
|
*/
|
|
16
|
-
|
|
12
|
+
text: string;
|
|
17
13
|
/**
|
|
18
|
-
*
|
|
19
|
-
* If the implementation has branching code paths then it must be marked with @volatile.
|
|
20
|
-
* https://www.fast.design/docs/fast-element/observables-and-state/#observable-features
|
|
14
|
+
* Text to render in the cell when it contains an invalid value (i.e. when shouldUsePlaceholder is true).
|
|
21
15
|
*/
|
|
22
|
-
|
|
16
|
+
placeholder: string;
|
|
23
17
|
/**
|
|
24
18
|
* Returns whether to display the placeholder value or the text value
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* */
|
|
28
|
-
abstract get shouldUsePlaceholder(): boolean;
|
|
19
|
+
*/
|
|
20
|
+
shouldUsePlaceholder: boolean;
|
|
29
21
|
get content(): string;
|
|
30
22
|
}
|
|
@@ -5,31 +5,19 @@ import type { TableColumnWithPlaceholderColumnConfig } from '../../base/types';
|
|
|
5
5
|
* The group header view base class for displaying fields of any type as text.
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class TableColumnTextGroupHeaderViewBase<TGroupValue = TableFieldValue, TColumnConfig = TableColumnWithPlaceholderColumnConfig> extends TableGroupHeaderView<TGroupValue, TColumnConfig> {
|
|
8
|
-
/** @internal */
|
|
9
|
-
textSpan: HTMLElement;
|
|
10
8
|
/** @internal */
|
|
11
9
|
hasOverflow: boolean;
|
|
12
10
|
/**
|
|
13
|
-
*
|
|
14
|
-
* If the implementation has branching code paths then it must be marked with @volatile.
|
|
15
|
-
* https://www.fast.design/docs/fast-element/observables-and-state/#observable-features
|
|
11
|
+
* Text to render in the cell when it contains a valid value (i.e. when shouldUsePlaceholder is false).
|
|
16
12
|
*/
|
|
17
|
-
|
|
13
|
+
text: string;
|
|
18
14
|
/**
|
|
19
|
-
*
|
|
20
|
-
* If the implementation has branching code paths then it must be marked with @volatile.
|
|
21
|
-
* https://www.fast.design/docs/fast-element/observables-and-state/#observable-features
|
|
15
|
+
* Text to render in the cell when it contains an invalid value (i.e. when shouldUsePlaceholder is true).
|
|
22
16
|
*/
|
|
23
|
-
|
|
17
|
+
placeholder: string;
|
|
24
18
|
/**
|
|
25
19
|
* Returns whether to display the placeholder value or the text value
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* */
|
|
29
|
-
abstract get shouldUsePlaceholder(): boolean;
|
|
20
|
+
*/
|
|
21
|
+
shouldUsePlaceholder: boolean;
|
|
30
22
|
get content(): string;
|
|
31
|
-
/** @internal */
|
|
32
|
-
updateTitleOverflow(): void;
|
|
33
|
-
/** @internal */
|
|
34
|
-
clearTitleOverflow(): void;
|
|
35
23
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Behavior, type CaptureType } from '@microsoft/fast-element';
|
|
2
|
+
/**
|
|
3
|
+
* The runtime behavior for template overflow detection.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare class OverflowBehavior implements Behavior {
|
|
7
|
+
private readonly target;
|
|
8
|
+
private propertyName;
|
|
9
|
+
private mouseOverHandler;
|
|
10
|
+
private mouseOutHandler;
|
|
11
|
+
private source;
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of OverflowBehavior.
|
|
14
|
+
* @param target - The element to check for overflow.
|
|
15
|
+
* @param propertyName - The name of the property to assign the overflow state to.
|
|
16
|
+
*/
|
|
17
|
+
constructor(target: HTMLElement, propertyName: string);
|
|
18
|
+
/**
|
|
19
|
+
* Bind this behavior to the source.
|
|
20
|
+
* @param source - The source to bind to.
|
|
21
|
+
* @param context - The execution context that the binding is operating within.
|
|
22
|
+
*/
|
|
23
|
+
bind(source: unknown): void;
|
|
24
|
+
/**
|
|
25
|
+
* Unbinds this behavior from the source.
|
|
26
|
+
* @param source - The source to unbind from.
|
|
27
|
+
*/
|
|
28
|
+
unbind(): void;
|
|
29
|
+
private setSourceValue;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A directive that observes if an element has overflow and sets a flag.
|
|
33
|
+
* @param propertyName - The name of the property to assign the overflow flag.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export declare function overflow<T = unknown>(propertyName: keyof T & string): CaptureType<T>;
|
|
@@ -11,11 +11,9 @@ declare global {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnAnchorCellView extends TableCellView<TableColumnAnchorCellRecord, TableColumnAnchorColumnConfig> {
|
|
13
13
|
/** @internal */
|
|
14
|
-
|
|
14
|
+
hasOverflow: boolean;
|
|
15
15
|
/** @internal */
|
|
16
16
|
anchor?: Anchor;
|
|
17
|
-
/** @internal */
|
|
18
|
-
textSpan?: HTMLSpanElement;
|
|
19
17
|
get content(): string;
|
|
20
18
|
focusedRecycleCallback(): void;
|
|
21
19
|
}
|
|
@@ -11,7 +11,7 @@ export class TableColumnAnchorCellView extends TableCellView {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
13
|
/** @internal */
|
|
14
|
-
this.
|
|
14
|
+
this.hasOverflow = false;
|
|
15
15
|
}
|
|
16
16
|
get content() {
|
|
17
17
|
if (typeof this.cellRecord.label === 'string') {
|
|
@@ -28,7 +28,7 @@ export class TableColumnAnchorCellView extends TableCellView {
|
|
|
28
28
|
}
|
|
29
29
|
__decorate([
|
|
30
30
|
observable
|
|
31
|
-
], TableColumnAnchorCellView.prototype, "
|
|
31
|
+
], TableColumnAnchorCellView.prototype, "hasOverflow", void 0);
|
|
32
32
|
__decorate([
|
|
33
33
|
volatile
|
|
34
34
|
], TableColumnAnchorCellView.prototype, "content", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/anchor/cell-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,aAG9C;IAHD;;QAII,gBAAgB;QAET,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/anchor/cell-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAM1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,aAG9C;IAHD;;QAII,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;IAmB/B,CAAC;IAbG,IAAW,OAAO;QACd,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK,QAAQ,EAAE;YAC3C,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;SAChC;QACD,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE;YAC1C,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;SAC/B;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;IACzC,CAAC;IAEe,sBAAsB;QAClC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC;IACxB,CAAC;CACJ;AAnBG;IADC,UAAU;8DACgB;AAM3B;IADC,QAAQ;wDASR;AAOL,MAAM,cAAc,GAAG,yBAAyB,CAAC,OAAO,CAAC;IACrD,QAAQ,EAAE,+BAA+B;IACzC,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,4BAA4B,GAAG,YAAY,CAAC,MAAM,CAC3D,yBAAyB,CAC5B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/indent */
|
|
2
2
|
import { html, ref, when } from '@microsoft/fast-element';
|
|
3
3
|
import { anchorTag } from '../../../anchor';
|
|
4
|
+
import { overflow } from '../../../utilities/directive/overflow';
|
|
4
5
|
// prettier-ignore
|
|
5
6
|
export const template = html `
|
|
6
7
|
<template
|
|
@@ -14,6 +15,7 @@ export const template = html `
|
|
|
14
15
|
${when(x => typeof x.cellRecord.href === 'string', html `
|
|
15
16
|
<${anchorTag}
|
|
16
17
|
${ref('anchor')}
|
|
18
|
+
${overflow('hasOverflow')}
|
|
17
19
|
href="${x => x.cellRecord.href}"
|
|
18
20
|
hreflang="${x => x.columnConfig.hreflang}"
|
|
19
21
|
ping="${x => x.columnConfig.ping}"
|
|
@@ -24,27 +26,15 @@ export const template = html `
|
|
|
24
26
|
download="${x => x.columnConfig.download}"
|
|
25
27
|
underline-hidden="${x => x.columnConfig.underlineHidden}"
|
|
26
28
|
appearance="${x => x.columnConfig.appearance}"
|
|
27
|
-
title=${x => (x.
|
|
28
|
-
@mouseover="${x => {
|
|
29
|
-
x.isValidContentAndHasOverflow = !!x.content && x.anchor.offsetWidth < x.anchor.scrollWidth;
|
|
30
|
-
}}"
|
|
31
|
-
@mouseout="${x => {
|
|
32
|
-
x.isValidContentAndHasOverflow = false;
|
|
33
|
-
}}"
|
|
29
|
+
title=${x => (x.hasOverflow && x.content ? x.content : null)}
|
|
34
30
|
>
|
|
35
31
|
${x => x.content}
|
|
36
32
|
</${anchorTag}>`)}
|
|
37
33
|
${when(x => typeof x.cellRecord.href !== 'string', html `
|
|
38
34
|
<span
|
|
39
|
-
${
|
|
35
|
+
${overflow('hasOverflow')}
|
|
40
36
|
class="${x => (typeof x.cellRecord.label === 'string' ? '' : 'placeholder')}"
|
|
41
|
-
title=${x => (x.
|
|
42
|
-
@mouseover="${x => {
|
|
43
|
-
x.isValidContentAndHasOverflow = !!x.content && x.textSpan.offsetWidth < x.textSpan.scrollWidth;
|
|
44
|
-
}}"
|
|
45
|
-
@mouseout="${x => {
|
|
46
|
-
x.isValidContentAndHasOverflow = false;
|
|
47
|
-
}}"
|
|
37
|
+
title=${x => (x.hasOverflow && x.content ? x.content : null)}
|
|
48
38
|
>
|
|
49
39
|
${x => x.content}
|
|
50
40
|
</span>`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/anchor/cell-view/template.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/anchor/cell-view/template.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAA2B;;kBAErC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;IACf,IAAI,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE;QACvC,CAAC,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;KAC7B;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;;UAEC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,IAAI,CAA2B;eAC3E,SAAS;kBACN,GAAG,CAAC,QAAQ,CAAC;kBACb,QAAQ,CAAC,aAAa,CAAC;wBACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI;4BAClB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ;wBAChC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI;kCACd,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc;uBAC7C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG;0BACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM;wBAC5B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI;4BACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ;oCACpB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,eAAe;8BACzC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU;wBACpC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;;kBAE1D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;gBAChB,SAAS,GAAG,CAAC;UACnB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,IAAI,CAA2B;;kBAExE,QAAQ,CAAC,aAAa,CAAC;yBAChB,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;wBACnE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;;kBAE1D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;oBACZ,CAAC;;CAEpB,CAAC"}
|
|
@@ -20,9 +20,7 @@ export declare abstract class TableColumn<TColumnConfig = unknown> extends Found
|
|
|
20
20
|
sortDirection: TableColumnSortDirection;
|
|
21
21
|
sortingDisabled: boolean;
|
|
22
22
|
/** @internal */
|
|
23
|
-
|
|
24
|
-
/** @internal */
|
|
25
|
-
headerSpan: HTMLSpanElement;
|
|
23
|
+
hasOverflow: boolean;
|
|
26
24
|
/** @internal */
|
|
27
25
|
contentSlot: HTMLSlotElement;
|
|
28
26
|
checkValidity(): boolean;
|
|
@@ -19,7 +19,7 @@ export class TableColumn extends FoundationElement {
|
|
|
19
19
|
this.sortDirection = TableColumnSortDirection.none;
|
|
20
20
|
this.sortingDisabled = false;
|
|
21
21
|
/** @internal */
|
|
22
|
-
this.
|
|
22
|
+
this.hasOverflow = false;
|
|
23
23
|
}
|
|
24
24
|
checkValidity() {
|
|
25
25
|
return this.columnInternals.validConfiguration;
|
|
@@ -78,5 +78,5 @@ __decorate([
|
|
|
78
78
|
], TableColumn.prototype, "sortingDisabled", void 0);
|
|
79
79
|
__decorate([
|
|
80
80
|
observable
|
|
81
|
-
], TableColumn.prototype, "
|
|
81
|
+
], TableColumn.prototype, "hasOverflow", void 0);
|
|
82
82
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/base/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,IAAI,EACJ,uBAAuB,EACvB,UAAU,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACH,eAAe,EAElB,MAAM,2BAA2B,CAAC;AAGnC;;GAEG;AACH,MAAM,OAAgB,WAEpB,SAAQ,iBAAiB;IAF3B;;QAGI;;;;WAIG;QACa,oBAAe,GAAmC,IAAI,eAAe,CAAC,IAAI,CAAC,yBAAyB,EAAE,CAAC,CAAC;QAYjH,iBAAY,GAAG,KAAK,CAAC;QAMrB,kBAAa,GAA6B,wBAAwB,CAAC,IAAI,CAAC;QAGxE,oBAAe,GAAG,KAAK,CAAC;QAE/B,gBAAgB;QAET,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table-column/base/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,IAAI,EACJ,uBAAuB,EACvB,UAAU,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACH,eAAe,EAElB,MAAM,2BAA2B,CAAC;AAGnC;;GAEG;AACH,MAAM,OAAgB,WAEpB,SAAQ,iBAAiB;IAF3B;;QAGI;;;;WAIG;QACa,oBAAe,GAAmC,IAAI,eAAe,CAAC,IAAI,CAAC,yBAAyB,EAAE,CAAC,CAAC;QAYjH,iBAAY,GAAG,KAAK,CAAC;QAMrB,kBAAa,GAA6B,wBAAwB,CAAC,IAAI,CAAC;QAGxE,oBAAe,GAAG,KAAK,CAAC;QAE/B,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;IA4C/B,CAAC;IAvCU,aAAa;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;IACnD,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,EAAE,CAAC;IACd,CAAC;IAED,gBAAgB;IAChB,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,WAAW;aAClB,aAAa,EAAE;aACf,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;aACrC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IAIS,oBAAoB;QAC1B,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACvB,IAAI,CAAC,eAAe,CAAC,oBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC;SAClE;IACL,CAAC;IAES,gBAAgB;QACtB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACvB,IAAI,CAAC,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC;SAC1D;IACL,CAAC;IAES,sBAAsB;QAC5B,IAAI,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,eAAe,CAAC,oBAAoB,GAAG,wBAAwB,CAAC,IAAI,CAAC;YAC1E,IAAI,CAAC,eAAe,CAAC,gBAAgB,GAAG,SAAS,CAAC;SACrD;aAAM;YACH,IAAI,CAAC,eAAe,CAAC,oBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC;YAC/D,IAAI,CAAC,eAAe,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC;SAC1D;IACL,CAAC;CACJ;AAlEG;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;6CACR;AAGzB;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;mDACT;AAG/B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;oDACT;AAGhC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;iDAC1B;AAG5B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;8CACrC;AAGjC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;kDACyC;AAG/E;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;oDAC1B;AAI/B;IADC,UAAU;gDACgB"}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { html, ref } from '@microsoft/fast-element';
|
|
2
|
+
import { overflow } from '../../utilities/directive/overflow';
|
|
2
3
|
// prettier-ignore
|
|
3
4
|
export const template = html `
|
|
4
5
|
<template slot="${x => x.columnInternals.uniqueId}">
|
|
5
6
|
<span
|
|
6
|
-
${
|
|
7
|
+
${overflow('hasOverflow')}
|
|
7
8
|
class="header-content"
|
|
8
|
-
|
|
9
|
-
x.isValidContentAndHasOverflow = !!x.headerTextContent
|
|
10
|
-
&& x.headerSpan.offsetWidth < x.headerSpan.scrollWidth;
|
|
11
|
-
}}"
|
|
12
|
-
@mouseout="${x => {
|
|
13
|
-
x.isValidContentAndHasOverflow = false;
|
|
14
|
-
}}"
|
|
15
|
-
title=${x => (x.isValidContentAndHasOverflow ? x.headerTextContent : null)}
|
|
9
|
+
title=${x => (x.hasOverflow && x.headerTextContent ? x.headerTextContent : null)}
|
|
16
10
|
>
|
|
17
11
|
<slot ${ref('contentSlot')}></slot>
|
|
18
12
|
</span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/table-column/base/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/table-column/base/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAE9D,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAa;sBACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ;;cAEvC,QAAQ,CAAC,aAAa,CAAC;;oBAEjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC;;oBAExE,GAAG,CAAC,aAAa,CAAC;;;CAGrC,CAAC"}
|
|
@@ -9,8 +9,7 @@ declare global {
|
|
|
9
9
|
* A cell view for displaying string fields as text
|
|
10
10
|
*/
|
|
11
11
|
export declare class TableColumnTextCellView extends TableColumnTextCellViewBase<TableColumnTextCellRecord, TableColumnTextColumnConfig> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
get shouldUsePlaceholder(): boolean;
|
|
12
|
+
private columnConfigChanged;
|
|
13
|
+
private cellRecordChanged;
|
|
15
14
|
}
|
|
16
15
|
export declare const tableColumnTextCellViewTag: string;
|
|
@@ -6,14 +6,18 @@ import { TableColumnTextCellViewBase } from '../../text-base/cell-view';
|
|
|
6
6
|
* A cell view for displaying string fields as text
|
|
7
7
|
*/
|
|
8
8
|
export class TableColumnTextCellView extends TableColumnTextCellViewBase {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
columnConfigChanged() {
|
|
10
|
+
this.placeholder = this.columnConfig.placeholder;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
cellRecordChanged() {
|
|
13
|
+
if (typeof this.cellRecord.value === 'string') {
|
|
14
|
+
this.text = this.cellRecord.value;
|
|
15
|
+
this.shouldUsePlaceholder = false;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.text = '';
|
|
19
|
+
this.shouldUsePlaceholder = true;
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
const textCellView = TableColumnTextCellView.compose({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text/cell-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAK9D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAQxE;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,2BAG5C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text/cell-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAK9D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAQxE;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,2BAG5C;IACW,mBAAmB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;IACrD,CAAC;IAEO,iBAAiB;QACrB,IAAI,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK,QAAQ,EAAE;YAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;YAClC,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;SACrC;aAAM;YACH,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;SACpC;IACL,CAAC;CACJ;AAED,MAAM,YAAY,GAAG,uBAAuB,CAAC,OAAO,CAAC;IACjD,QAAQ,EAAE,6BAA6B;IACvC,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,0BAA0B,GAAG,YAAY,CAAC,MAAM,CACzD,uBAAuB,CAC1B,CAAC"}
|
|
@@ -10,8 +10,7 @@ declare global {
|
|
|
10
10
|
* The group header view for displaying string fields as text.
|
|
11
11
|
*/
|
|
12
12
|
export declare class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase<TableStringFieldValue, TableColumnTextColumnConfig> {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
get shouldUsePlaceholder(): boolean;
|
|
13
|
+
private columnConfigChanged;
|
|
14
|
+
private groupHeaderValueChanged;
|
|
16
15
|
}
|
|
17
16
|
export declare const tableColumnTextGroupHeaderTag: string;
|
|
@@ -6,14 +6,18 @@ import { styles } from '../../text-base/group-header-view/styles';
|
|
|
6
6
|
* The group header view for displaying string fields as text.
|
|
7
7
|
*/
|
|
8
8
|
export class TableColumnTextGroupHeaderView extends TableColumnTextGroupHeaderViewBase {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
columnConfigChanged() {
|
|
10
|
+
this.placeholder = this.columnConfig?.placeholder ?? '';
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
groupHeaderValueChanged() {
|
|
13
|
+
if (typeof this.groupHeaderValue === 'string') {
|
|
14
|
+
this.text = this.groupHeaderValue;
|
|
15
|
+
this.shouldUsePlaceholder = false;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.text = '';
|
|
19
|
+
this.shouldUsePlaceholder = true;
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
const tableColumnTextGroupHeaderView = TableColumnTextGroupHeaderView.compose({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kCAGnD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text/group-header-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQlE;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kCAGnD;IACW,mBAAmB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,IAAI,EAAE,CAAC;IAC5D,CAAC;IAEO,uBAAuB;QAC3B,IAAI,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ,EAAE;YAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC;YAClC,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;SACrC;aAAM;YACH,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;SACpC;IACL,CAAC;CACJ;AAED,MAAM,8BAA8B,GAAG,8BAA8B,CAAC,OAAO,CAAC;IAC1E,QAAQ,EAAE,gCAAgC;IAC1C,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AACH,YAAY,CAAC,WAAW,EAAE;KACrB,UAAU,CAAC,QAAQ,CAAC;KACpB,QAAQ,CAAC,8BAA8B,EAAE,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,6BAA6B,GAAG,YAAY,CAAC,MAAM,CAC5D,8BAA8B,CACjC,CAAC"}
|
|
@@ -5,26 +5,18 @@ import type { TableCellRecord } from '../../base/types';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class TableColumnTextCellViewBase<TCellRecord extends TableCellRecord = TableCellRecord, TColumnConfig = unknown> extends TableCellView<TCellRecord, TColumnConfig> {
|
|
7
7
|
/** @internal */
|
|
8
|
-
|
|
9
|
-
/** @internal */
|
|
10
|
-
textSpan: HTMLElement;
|
|
8
|
+
hasOverflow: boolean;
|
|
11
9
|
/**
|
|
12
|
-
*
|
|
13
|
-
* If the implementation has branching code paths then it must be marked with @volatile.
|
|
14
|
-
* https://www.fast.design/docs/fast-element/observables-and-state/#observable-features
|
|
10
|
+
* Text to render in the cell when it contains a valid value (i.e. when shouldUsePlaceholder is false).
|
|
15
11
|
*/
|
|
16
|
-
|
|
12
|
+
text: string;
|
|
17
13
|
/**
|
|
18
|
-
*
|
|
19
|
-
* If the implementation has branching code paths then it must be marked with @volatile.
|
|
20
|
-
* https://www.fast.design/docs/fast-element/observables-and-state/#observable-features
|
|
14
|
+
* Text to render in the cell when it contains an invalid value (i.e. when shouldUsePlaceholder is true).
|
|
21
15
|
*/
|
|
22
|
-
|
|
16
|
+
placeholder: string;
|
|
23
17
|
/**
|
|
24
18
|
* Returns whether to display the placeholder value or the text value
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* */
|
|
28
|
-
abstract get shouldUsePlaceholder(): boolean;
|
|
19
|
+
*/
|
|
20
|
+
shouldUsePlaceholder: boolean;
|
|
29
21
|
get content(): string;
|
|
30
22
|
}
|
|
@@ -8,7 +8,19 @@ export class TableColumnTextCellViewBase extends TableCellView {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
10
|
/** @internal */
|
|
11
|
-
this.
|
|
11
|
+
this.hasOverflow = false;
|
|
12
|
+
/**
|
|
13
|
+
* Text to render in the cell when it contains a valid value (i.e. when shouldUsePlaceholder is false).
|
|
14
|
+
*/
|
|
15
|
+
this.text = '';
|
|
16
|
+
/**
|
|
17
|
+
* Text to render in the cell when it contains an invalid value (i.e. when shouldUsePlaceholder is true).
|
|
18
|
+
*/
|
|
19
|
+
this.placeholder = '';
|
|
20
|
+
/**
|
|
21
|
+
* Returns whether to display the placeholder value or the text value
|
|
22
|
+
*/
|
|
23
|
+
this.shouldUsePlaceholder = true;
|
|
12
24
|
}
|
|
13
25
|
get content() {
|
|
14
26
|
return this.shouldUsePlaceholder ? this.placeholder : this.text;
|
|
@@ -16,7 +28,16 @@ export class TableColumnTextCellViewBase extends TableCellView {
|
|
|
16
28
|
}
|
|
17
29
|
__decorate([
|
|
18
30
|
observable
|
|
19
|
-
], TableColumnTextCellViewBase.prototype, "
|
|
31
|
+
], TableColumnTextCellViewBase.prototype, "hasOverflow", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
observable
|
|
34
|
+
], TableColumnTextCellViewBase.prototype, "text", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
observable
|
|
37
|
+
], TableColumnTextCellViewBase.prototype, "placeholder", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
observable
|
|
40
|
+
], TableColumnTextCellViewBase.prototype, "shouldUsePlaceholder", void 0);
|
|
20
41
|
__decorate([
|
|
21
42
|
volatile
|
|
22
43
|
], TableColumnTextCellViewBase.prototype, "content", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;GAEG;AACH,MAAM,OAAgB,2BAGpB,SAAQ,aAAyC;IAHnD;;QAII,gBAAgB;QAET,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;GAEG;AACH,MAAM,OAAgB,2BAGpB,SAAQ,aAAyC;IAHnD;;QAII,gBAAgB;QAET,gBAAW,GAAG,KAAK,CAAC;QAE3B;;WAEG;QAEI,SAAI,GAAG,EAAE,CAAC;QAEjB;;WAEG;QAEI,gBAAW,GAAG,EAAE,CAAC;QAExB;;WAEG;QAEI,yBAAoB,GAAG,IAAI,CAAC;IAMvC,CAAC;IAHG,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACpE,CAAC;CACJ;AAxBG;IADC,UAAU;gEACgB;AAM3B;IADC,UAAU;yDACM;AAMjB;IADC,UAAU;gEACa;AAMxB;IADC,UAAU;yEACwB;AAGnC;IADC,QAAQ;0DAGR"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { html
|
|
1
|
+
import { html } from '@microsoft/fast-element';
|
|
2
|
+
import { overflow } from '../../../utilities/directive/overflow';
|
|
2
3
|
export const template = html `
|
|
3
4
|
<span
|
|
4
|
-
${
|
|
5
|
+
${overflow('hasOverflow')}
|
|
5
6
|
class="${x => (x.shouldUsePlaceholder ? 'placeholder' : '')}"
|
|
6
|
-
|
|
7
|
-
x.isValidContentAndHasOverflow = !!x.content && x.textSpan.offsetWidth < x.textSpan.scrollWidth;
|
|
8
|
-
}}"
|
|
9
|
-
@mouseout="${x => {
|
|
10
|
-
x.isValidContentAndHasOverflow = false;
|
|
11
|
-
}}"
|
|
12
|
-
title=${x => (x.isValidContentAndHasOverflow ? x.content : null)}
|
|
7
|
+
title=${x => (x.hasOverflow && x.content ? x.content : null)}
|
|
13
8
|
>
|
|
14
9
|
${x => x.content}
|
|
15
10
|
</span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/cell-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAA6B;;UAE/C,QAAQ,CAAC,aAAa,CAAC;iBAChB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;;UAE1D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;;CAEvB,CAAC"}
|
|
@@ -5,31 +5,19 @@ import type { TableColumnWithPlaceholderColumnConfig } from '../../base/types';
|
|
|
5
5
|
* The group header view base class for displaying fields of any type as text.
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class TableColumnTextGroupHeaderViewBase<TGroupValue = TableFieldValue, TColumnConfig = TableColumnWithPlaceholderColumnConfig> extends TableGroupHeaderView<TGroupValue, TColumnConfig> {
|
|
8
|
-
/** @internal */
|
|
9
|
-
textSpan: HTMLElement;
|
|
10
8
|
/** @internal */
|
|
11
9
|
hasOverflow: boolean;
|
|
12
10
|
/**
|
|
13
|
-
*
|
|
14
|
-
* If the implementation has branching code paths then it must be marked with @volatile.
|
|
15
|
-
* https://www.fast.design/docs/fast-element/observables-and-state/#observable-features
|
|
11
|
+
* Text to render in the cell when it contains a valid value (i.e. when shouldUsePlaceholder is false).
|
|
16
12
|
*/
|
|
17
|
-
|
|
13
|
+
text: string;
|
|
18
14
|
/**
|
|
19
|
-
*
|
|
20
|
-
* If the implementation has branching code paths then it must be marked with @volatile.
|
|
21
|
-
* https://www.fast.design/docs/fast-element/observables-and-state/#observable-features
|
|
15
|
+
* Text to render in the cell when it contains an invalid value (i.e. when shouldUsePlaceholder is true).
|
|
22
16
|
*/
|
|
23
|
-
|
|
17
|
+
placeholder: string;
|
|
24
18
|
/**
|
|
25
19
|
* Returns whether to display the placeholder value or the text value
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* */
|
|
29
|
-
abstract get shouldUsePlaceholder(): boolean;
|
|
20
|
+
*/
|
|
21
|
+
shouldUsePlaceholder: boolean;
|
|
30
22
|
get content(): string;
|
|
31
|
-
/** @internal */
|
|
32
|
-
updateTitleOverflow(): void;
|
|
33
|
-
/** @internal */
|
|
34
|
-
clearTitleOverflow(): void;
|
|
35
23
|
}
|
|
@@ -9,22 +9,35 @@ export class TableColumnTextGroupHeaderViewBase extends TableGroupHeaderView {
|
|
|
9
9
|
super(...arguments);
|
|
10
10
|
/** @internal */
|
|
11
11
|
this.hasOverflow = false;
|
|
12
|
+
/**
|
|
13
|
+
* Text to render in the cell when it contains a valid value (i.e. when shouldUsePlaceholder is false).
|
|
14
|
+
*/
|
|
15
|
+
this.text = '';
|
|
16
|
+
/**
|
|
17
|
+
* Text to render in the cell when it contains an invalid value (i.e. when shouldUsePlaceholder is true).
|
|
18
|
+
*/
|
|
19
|
+
this.placeholder = '';
|
|
20
|
+
/**
|
|
21
|
+
* Returns whether to display the placeholder value or the text value
|
|
22
|
+
*/
|
|
23
|
+
this.shouldUsePlaceholder = true;
|
|
12
24
|
}
|
|
13
25
|
get content() {
|
|
14
26
|
return this.shouldUsePlaceholder ? this.placeholder : this.text;
|
|
15
27
|
}
|
|
16
|
-
/** @internal */
|
|
17
|
-
updateTitleOverflow() {
|
|
18
|
-
this.hasOverflow = this.textSpan.offsetWidth < this.textSpan.scrollWidth;
|
|
19
|
-
}
|
|
20
|
-
/** @internal */
|
|
21
|
-
clearTitleOverflow() {
|
|
22
|
-
this.hasOverflow = false;
|
|
23
|
-
}
|
|
24
28
|
}
|
|
25
29
|
__decorate([
|
|
26
30
|
observable
|
|
27
31
|
], TableColumnTextGroupHeaderViewBase.prototype, "hasOverflow", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
observable
|
|
34
|
+
], TableColumnTextGroupHeaderViewBase.prototype, "text", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
observable
|
|
37
|
+
], TableColumnTextGroupHeaderViewBase.prototype, "placeholder", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
observable
|
|
40
|
+
], TableColumnTextGroupHeaderViewBase.prototype, "shouldUsePlaceholder", void 0);
|
|
28
41
|
__decorate([
|
|
29
42
|
volatile
|
|
30
43
|
], TableColumnTextGroupHeaderViewBase.prototype, "content", null);
|