@ni/nimble-components 19.4.3 → 19.4.5
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 +75 -50
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +519 -526
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/combobox/index.js +4 -0
- package/dist/esm/combobox/index.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-base/cell-view/index.d.ts +1 -3
- package/dist/esm/src/table-column/text-base/group-header-view/index.d.ts +0 -6
- 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-base/cell-view/index.d.ts +1 -3
- package/dist/esm/table-column/text-base/cell-view/index.js +2 -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 +0 -6
- package/dist/esm/table-column/text-base/group-header-view/index.js +0 -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
|
@@ -97,6 +97,10 @@ export class Combobox extends FoundationCombobox {
|
|
|
97
97
|
this.valueBeforeTextUpdate = this.value;
|
|
98
98
|
}
|
|
99
99
|
this.valueUpdatedByInput = true;
|
|
100
|
+
// This is a workaround for this FAST issue: https://github.com/microsoft/fast/issues/6776
|
|
101
|
+
if (this.value !== this.control.value) {
|
|
102
|
+
this.focusAndScrollOptionIntoView();
|
|
103
|
+
}
|
|
100
104
|
this.value = this.control.value;
|
|
101
105
|
return returnValue;
|
|
102
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/combobox/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACH,YAAY,EACZ,QAAQ,IAAI,kBAAkB,EAEjC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,EACX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAgB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,QACT,SAAQ,kBAAkB;IAD9B;;QAIW,eAAU,GAAuB,kBAAkB,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BAElB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,KAAK,CAAC;2BAC5C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,KAAK,CAAC;4BAC7C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,KAAsB,CAAC;;;;iCAI3D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;;;mBAGzB,wBAAwB;;;;oBAIvB,wBAAwB;gBAC5B,eAAe;;UAErB,iBAAiB;KACtB;CACJ,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -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;
|
|
@@ -5,9 +5,7 @@ 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
10
|
* Text to render in the cell when it contains a valid value (i.e. when shouldUsePlaceholder is false).
|
|
13
11
|
*/
|
|
@@ -5,8 +5,6 @@ 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
|
/**
|
|
@@ -22,8 +20,4 @@ export declare abstract class TableColumnTextGroupHeaderViewBase<TGroupValue = T
|
|
|
22
20
|
*/
|
|
23
21
|
shouldUsePlaceholder: boolean;
|
|
24
22
|
get content(): string;
|
|
25
|
-
/** @internal */
|
|
26
|
-
updateTitleOverflow(): void;
|
|
27
|
-
/** @internal */
|
|
28
|
-
clearTitleOverflow(): void;
|
|
29
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,IA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AC,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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,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"}
|
|
@@ -5,9 +5,7 @@ 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
10
|
* Text to render in the cell when it contains a valid value (i.e. when shouldUsePlaceholder is false).
|
|
13
11
|
*/
|
|
@@ -8,7 +8,7 @@ export class TableColumnTextCellViewBase extends TableCellView {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
10
|
/** @internal */
|
|
11
|
-
this.
|
|
11
|
+
this.hasOverflow = false;
|
|
12
12
|
/**
|
|
13
13
|
* Text to render in the cell when it contains a valid value (i.e. when shouldUsePlaceholder is false).
|
|
14
14
|
*/
|
|
@@ -28,7 +28,7 @@ export class TableColumnTextCellViewBase extends TableCellView {
|
|
|
28
28
|
}
|
|
29
29
|
__decorate([
|
|
30
30
|
observable
|
|
31
|
-
], TableColumnTextCellViewBase.prototype, "
|
|
31
|
+
], TableColumnTextCellViewBase.prototype, "hasOverflow", void 0);
|
|
32
32
|
__decorate([
|
|
33
33
|
observable
|
|
34
34
|
], TableColumnTextCellViewBase.prototype, "text", void 0);
|
|
@@ -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,8 +5,6 @@ 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
|
/**
|
|
@@ -22,8 +20,4 @@ export declare abstract class TableColumnTextGroupHeaderViewBase<TGroupValue = T
|
|
|
22
20
|
*/
|
|
23
21
|
shouldUsePlaceholder: boolean;
|
|
24
22
|
get content(): string;
|
|
25
|
-
/** @internal */
|
|
26
|
-
updateTitleOverflow(): void;
|
|
27
|
-
/** @internal */
|
|
28
|
-
clearTitleOverflow(): void;
|
|
29
23
|
}
|
|
@@ -25,14 +25,6 @@ export class TableColumnTextGroupHeaderViewBase extends TableGroupHeaderView {
|
|
|
25
25
|
get content() {
|
|
26
26
|
return this.shouldUsePlaceholder ? this.placeholder : this.text;
|
|
27
27
|
}
|
|
28
|
-
/** @internal */
|
|
29
|
-
updateTitleOverflow() {
|
|
30
|
-
this.hasOverflow = this.textSpan.offsetWidth < this.textSpan.scrollWidth;
|
|
31
|
-
}
|
|
32
|
-
/** @internal */
|
|
33
|
-
clearTitleOverflow() {
|
|
34
|
-
this.hasOverflow = false;
|
|
35
|
-
}
|
|
36
28
|
}
|
|
37
29
|
__decorate([
|
|
38
30
|
observable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIpE;;GAEG;AACH,MAAM,OAAgB,kCAGpB,SAAQ,oBAAgD;IAH1D;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIpE;;GAEG;AACH,MAAM,OAAgB,kCAGpB,SAAQ,oBAAgD;IAH1D;;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;uEACgB;AAM3B;IADC,UAAU;gEACM;AAMjB;IADC,UAAU;uEACa;AAMxB;IADC,UAAU;gFACwB;AAGnC;IADC,QAAQ;iEAGR"}
|
|
@@ -1,10 +1,9 @@
|
|
|
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
|
-
@mouseover="${x => x.updateTitleOverflow()}"
|
|
7
|
-
@mouseout="${x => x.clearTitleOverflow()}"
|
|
8
7
|
title="${x => (x.hasOverflow && x.content ? x.content : undefined)}"
|
|
9
8
|
>
|
|
10
9
|
${x => x.content}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table-column/text-base/group-header-view/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAoC;;UAEtD,QAAQ,CAAC,aAAa,CAAC;iBAChB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;iBAClD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;;UAEhE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;;CAEvB,CAAC"}
|
|
@@ -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>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AttachedBehaviorHTMLDirective } from '@microsoft/fast-element';
|
|
2
|
+
/**
|
|
3
|
+
* The runtime behavior for template overflow detection.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export class OverflowBehavior {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of OverflowBehavior.
|
|
9
|
+
* @param target - The element to check for overflow.
|
|
10
|
+
* @param propertyName - The name of the property to assign the overflow state to.
|
|
11
|
+
*/
|
|
12
|
+
constructor(target, propertyName) {
|
|
13
|
+
this.target = target;
|
|
14
|
+
this.propertyName = propertyName;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Bind this behavior to the source.
|
|
18
|
+
* @param source - The source to bind to.
|
|
19
|
+
* @param context - The execution context that the binding is operating within.
|
|
20
|
+
*/
|
|
21
|
+
bind(source) {
|
|
22
|
+
this.source = source;
|
|
23
|
+
this.setSourceValue(false);
|
|
24
|
+
this.mouseOverHandler = () => {
|
|
25
|
+
const hasOverflow = this.target.offsetWidth < this.target.scrollWidth;
|
|
26
|
+
this.setSourceValue(hasOverflow);
|
|
27
|
+
};
|
|
28
|
+
this.mouseOutHandler = () => {
|
|
29
|
+
this.setSourceValue(false);
|
|
30
|
+
};
|
|
31
|
+
this.target.addEventListener('mouseover', this.mouseOverHandler);
|
|
32
|
+
this.target.addEventListener('mouseout', this.mouseOutHandler);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Unbinds this behavior from the source.
|
|
36
|
+
* @param source - The source to unbind from.
|
|
37
|
+
*/
|
|
38
|
+
unbind() {
|
|
39
|
+
this.source = undefined;
|
|
40
|
+
this.target.removeEventListener('mouseover', this.mouseOverHandler);
|
|
41
|
+
this.target.removeEventListener('mouseout', this.mouseOutHandler);
|
|
42
|
+
}
|
|
43
|
+
setSourceValue(value) {
|
|
44
|
+
// @ts-expect-error set property on source
|
|
45
|
+
this.source[this.propertyName] = value;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A directive that observes if an element has overflow and sets a flag.
|
|
50
|
+
* @param propertyName - The name of the property to assign the overflow flag.
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export function overflow(propertyName) {
|
|
54
|
+
return new AttachedBehaviorHTMLDirective('nimble-overflow', OverflowBehavior, propertyName);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=overflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overflow.js","sourceRoot":"","sources":["../../../../src/utilities/directive/overflow.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,6BAA6B,EAGhC,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAKzB;;;;OAIG;IACH,YACqB,MAAmB,EAC5B,YAAoB;QADX,WAAM,GAAN,MAAM,CAAa;QAC5B,iBAAY,GAAZ,YAAY,CAAQ;IAC7B,CAAC;IAEJ;;;;OAIG;IACI,IAAI,CAAC,MAAe;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,gBAAgB,GAAG,GAAG,EAAE;YACzB,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;YACtE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACrC,CAAC,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,GAAG,EAAE;YACxB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACI,MAAM;QACT,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACtE,CAAC;IAEO,cAAc,CAAC,KAAc;QACjC,0CAA0C;QAC1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;IAC3C,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CACpB,YAA8B;IAE9B,OAAO,IAAI,6BAA6B,CACpC,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,CACf,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ni/nimble-components",
|
|
3
|
-
"version": "19.4.
|
|
3
|
+
"version": "19.4.5",
|
|
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",
|