@ni/nimble-components 27.0.4 → 27.1.0
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 +198 -60
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +466 -445
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/src/table/components/header/index.d.ts +1 -0
- package/dist/esm/src/table/models/table-layout-manager.d.ts +20 -0
- package/dist/esm/src/table-column/base/models/column-internals.d.ts +9 -0
- package/dist/esm/src/table-column/base/types.d.ts +1 -0
- package/dist/esm/src/table-column/icon/index.d.ts +5 -0
- package/dist/esm/src/table-column/icon/types.d.ts +8 -0
- package/dist/esm/table/components/header/index.d.ts +1 -0
- package/dist/esm/table/components/header/index.js +4 -0
- package/dist/esm/table/components/header/index.js.map +1 -1
- package/dist/esm/table/components/header/template.js +25 -22
- package/dist/esm/table/components/header/template.js.map +1 -1
- package/dist/esm/table/models/table-layout-manager.d.ts +20 -0
- package/dist/esm/table/models/table-layout-manager.js +98 -23
- package/dist/esm/table/models/table-layout-manager.js.map +1 -1
- package/dist/esm/table/models/table-update-tracker.js +1 -1
- package/dist/esm/table/models/table-update-tracker.js.map +1 -1
- package/dist/esm/table/styles.js +2 -2
- package/dist/esm/table/styles.js.map +1 -1
- package/dist/esm/table/template.js +3 -0
- package/dist/esm/table/template.js.map +1 -1
- package/dist/esm/table-column/base/models/column-internals.d.ts +9 -0
- package/dist/esm/table-column/base/models/column-internals.js +15 -0
- package/dist/esm/table-column/base/models/column-internals.js.map +1 -1
- package/dist/esm/table-column/base/types.d.ts +1 -0
- package/dist/esm/table-column/base/types.js +13 -11
- package/dist/esm/table-column/base/types.js.map +1 -1
- package/dist/esm/table-column/icon/index.d.ts +5 -0
- package/dist/esm/table-column/icon/index.js +32 -1
- package/dist/esm/table-column/icon/index.js.map +1 -1
- package/dist/esm/table-column/icon/types.d.ts +8 -0
- package/dist/esm/table-column/icon/types.js +8 -0
- package/dist/esm/table-column/icon/types.js.map +1 -0
- package/package.json +2 -2
|
@@ -16333,7 +16333,7 @@
|
|
|
16333
16333
|
|
|
16334
16334
|
/**
|
|
16335
16335
|
* Do not edit directly
|
|
16336
|
-
* Generated on
|
|
16336
|
+
* Generated on Tue, 30 Apr 2024 21:12:32 GMT
|
|
16337
16337
|
*/
|
|
16338
16338
|
|
|
16339
16339
|
const Information100DarkUi = "#a46eff";
|
|
@@ -63397,20 +63397,22 @@ img.ProseMirror-separator {
|
|
|
63397
63397
|
*/
|
|
63398
63398
|
localeAwareCaseSensitive: 'localeAwareCaseSensitive'
|
|
63399
63399
|
};
|
|
63400
|
-
const
|
|
63401
|
-
const
|
|
63402
|
-
const
|
|
63403
|
-
const menuDropdownSize = 24;
|
|
63400
|
+
const columnIconSize = 16; // `iconSize` token
|
|
63401
|
+
const columnSpacing = 8; // `mediumPadding` token
|
|
63402
|
+
const menuDropdownSize = 24; // `controlSlimHeight` token
|
|
63404
63403
|
const oneCharPlusEllipsisSize = 21;
|
|
63405
|
-
const defaultMinPixelWidth =
|
|
63404
|
+
const defaultMinPixelWidth = columnSpacing // left cell padding
|
|
63406
63405
|
+ oneCharPlusEllipsisSize
|
|
63407
|
-
+
|
|
63408
|
-
+
|
|
63409
|
-
+
|
|
63410
|
-
+
|
|
63411
|
-
+
|
|
63406
|
+
+ columnSpacing
|
|
63407
|
+
+ columnIconSize // sort icon
|
|
63408
|
+
+ columnSpacing
|
|
63409
|
+
+ columnIconSize // group icon
|
|
63410
|
+
+ columnSpacing
|
|
63412
63411
|
+ menuDropdownSize
|
|
63413
|
-
+
|
|
63412
|
+
+ columnSpacing; // right cell padding
|
|
63413
|
+
const singleIconColumnWidth = columnSpacing // left cell padding
|
|
63414
|
+
+ columnIconSize
|
|
63415
|
+
+ columnSpacing; // right cell padding
|
|
63414
63416
|
const defaultFractionalWidth = 1;
|
|
63415
63417
|
|
|
63416
63418
|
/**
|
|
@@ -63563,6 +63565,15 @@ img.ProseMirror-separator {
|
|
|
63563
63565
|
* The minimum size in pixels according to the design doc
|
|
63564
63566
|
*/
|
|
63565
63567
|
this.minPixelWidth = defaultMinPixelWidth;
|
|
63568
|
+
/**
|
|
63569
|
+
* Whether or not resizing the column has been disabled.
|
|
63570
|
+
*/
|
|
63571
|
+
this.resizingDisabled = false;
|
|
63572
|
+
/**
|
|
63573
|
+
* Whether or not the grouping and sorting indicators should be hidden in the column header
|
|
63574
|
+
* when the column is grouped or sorted.
|
|
63575
|
+
*/
|
|
63576
|
+
this.hideHeaderIndicators = false;
|
|
63566
63577
|
/**
|
|
63567
63578
|
* @internal Do not write to this value directly. It is used by the Table in order to store
|
|
63568
63579
|
* the resolved value of the fractionalWidth after updates programmatic or interactive updates.
|
|
@@ -63614,6 +63625,12 @@ img.ProseMirror-separator {
|
|
|
63614
63625
|
__decorate$1([
|
|
63615
63626
|
observable
|
|
63616
63627
|
], ColumnInternals.prototype, "minPixelWidth", void 0);
|
|
63628
|
+
__decorate$1([
|
|
63629
|
+
observable
|
|
63630
|
+
], ColumnInternals.prototype, "resizingDisabled", void 0);
|
|
63631
|
+
__decorate$1([
|
|
63632
|
+
observable
|
|
63633
|
+
], ColumnInternals.prototype, "hideHeaderIndicators", void 0);
|
|
63617
63634
|
__decorate$1([
|
|
63618
63635
|
observable
|
|
63619
63636
|
], ColumnInternals.prototype, "currentFractionalWidth", void 0);
|
|
@@ -63949,8 +63966,8 @@ img.ProseMirror-separator {
|
|
|
63949
63966
|
border-color: ${borderHoverColor};
|
|
63950
63967
|
}
|
|
63951
63968
|
|
|
63952
|
-
.column-divider.column-active,
|
|
63953
|
-
.header-container:hover .column-divider {
|
|
63969
|
+
.column-divider.column-active.draggable,
|
|
63970
|
+
.header-container:hover .column-divider.draggable {
|
|
63954
63971
|
display: block;
|
|
63955
63972
|
}
|
|
63956
63973
|
|
|
@@ -64057,28 +64074,31 @@ img.ProseMirror-separator {
|
|
|
64057
64074
|
@mousedown="${(_x, c) => !(c.event.detail > 1)}"
|
|
64058
64075
|
>
|
|
64059
64076
|
<slot></slot>
|
|
64060
|
-
|
|
64061
|
-
${when(x => x.
|
|
64062
|
-
|
|
64063
|
-
|
|
64064
|
-
|
|
64065
|
-
|
|
64066
|
-
|
|
64067
|
-
|
|
64068
|
-
|
|
64069
|
-
|
|
64070
|
-
|
|
64071
|
-
|
|
64072
|
-
|
|
64073
|
-
|
|
64074
|
-
|
|
64075
|
-
|
|
64076
|
-
|
|
64077
|
-
|
|
64078
|
-
|
|
64079
|
-
|
|
64080
|
-
|
|
64081
|
-
|
|
64077
|
+
|
|
64078
|
+
${when(x => !x.indicatorsHidden, html `
|
|
64079
|
+
${'' /* Set aria-hidden="true" on sort indicators because aria-sort is set on the 1st sorted column */}
|
|
64080
|
+
${when(x => x.sortDirection === TableColumnSortDirection.ascending, html `
|
|
64081
|
+
<${iconArrowUpTag}
|
|
64082
|
+
class="sort-indicator"
|
|
64083
|
+
title="${x => tableColumnHeaderSortedAscendingLabel.getValueFor(x)}"
|
|
64084
|
+
aria-hidden="true"
|
|
64085
|
+
></${iconArrowUpTag}>
|
|
64086
|
+
`)}
|
|
64087
|
+
${when(x => x.sortDirection === TableColumnSortDirection.descending, html `
|
|
64088
|
+
<${iconArrowDownTag}
|
|
64089
|
+
class="sort-indicator"
|
|
64090
|
+
title="${x => tableColumnHeaderSortedDescendingLabel.getValueFor(x)}"
|
|
64091
|
+
aria-hidden="true"
|
|
64092
|
+
></${iconArrowDownTag}>
|
|
64093
|
+
`)}
|
|
64094
|
+
${when(x => x.isGrouped, html `
|
|
64095
|
+
<${iconTwoSquaresInBracketsTag}
|
|
64096
|
+
class="grouped-indicator"
|
|
64097
|
+
title="${x => tableColumnHeaderGroupedLabel.getValueFor(x)}"
|
|
64098
|
+
role="img"
|
|
64099
|
+
aria-label="${x => tableColumnHeaderGroupedLabel.getValueFor(x)}"
|
|
64100
|
+
></${iconTwoSquaresInBracketsTag}>
|
|
64101
|
+
`)}
|
|
64082
64102
|
`)}
|
|
64083
64103
|
</template>
|
|
64084
64104
|
`;
|
|
@@ -64092,6 +64112,7 @@ img.ProseMirror-separator {
|
|
|
64092
64112
|
super(...arguments);
|
|
64093
64113
|
this.sortDirection = TableColumnSortDirection.none;
|
|
64094
64114
|
this.firstSortedColumn = false;
|
|
64115
|
+
this.indicatorsHidden = false;
|
|
64095
64116
|
this.isGrouped = false;
|
|
64096
64117
|
}
|
|
64097
64118
|
sortDirectionChanged(_prev, _next) {
|
|
@@ -64119,6 +64140,9 @@ img.ProseMirror-separator {
|
|
|
64119
64140
|
__decorate$1([
|
|
64120
64141
|
attr({ attribute: 'first-sorted-column', mode: 'boolean' })
|
|
64121
64142
|
], TableHeader.prototype, "firstSortedColumn", void 0);
|
|
64143
|
+
__decorate$1([
|
|
64144
|
+
attr({ attribute: 'indicators-hidden', mode: 'boolean' })
|
|
64145
|
+
], TableHeader.prototype, "indicatorsHidden", void 0);
|
|
64122
64146
|
__decorate$1([
|
|
64123
64147
|
observable
|
|
64124
64148
|
], TableHeader.prototype, "isGrouped", void 0);
|
|
@@ -65021,6 +65045,7 @@ img.ProseMirror-separator {
|
|
|
65021
65045
|
left
|
|
65022
65046
|
${(_, c) => `${c.parent.layoutManager.activeColumnIndex === c.index ? 'column-active' : ''}`}
|
|
65023
65047
|
${(_, c) => `${c.parent.layoutManager.activeColumnDivider === c.parent.getLeftDividerIndex(c.index) ? 'divider-active' : ''}`}
|
|
65048
|
+
${(_, c) => `${c.parent.layoutManager.hasResizableColumnToLeft(c.index - 1) ? 'draggable' : ''}`}
|
|
65024
65049
|
"
|
|
65025
65050
|
@mousedown="${(_, c) => c.parent.onLeftDividerMouseDown(c.event, c.index)}">
|
|
65026
65051
|
</div>
|
|
@@ -65029,6 +65054,7 @@ img.ProseMirror-separator {
|
|
|
65029
65054
|
class="header"
|
|
65030
65055
|
sort-direction="${x => (typeof x.columnInternals.currentSortIndex === 'number' ? x.columnInternals.currentSortDirection : TableColumnSortDirection.none)}"
|
|
65031
65056
|
?first-sorted-column="${(x, c) => x === c.parent.firstSortedColumn}"
|
|
65057
|
+
?indicators-hidden="${x => x.columnInternals.hideHeaderIndicators}"
|
|
65032
65058
|
@click="${(x, c) => c.parent.toggleColumnSort(x, c.event.shiftKey)}"
|
|
65033
65059
|
:isGrouped=${x => (typeof x.columnInternals.groupIndex === 'number' && !x.columnInternals.groupingDisabled)}
|
|
65034
65060
|
>
|
|
@@ -65041,6 +65067,7 @@ img.ProseMirror-separator {
|
|
|
65041
65067
|
right
|
|
65042
65068
|
${(_, c) => `${c.parent.layoutManager.activeColumnIndex === c.index ? 'column-active' : ''}`}
|
|
65043
65069
|
${(_, c) => `${c.parent.layoutManager.activeColumnDivider === c.parent.getRightDividerIndex(c.index) ? 'divider-active' : ''}`}
|
|
65070
|
+
${(_, c) => `${c.parent.layoutManager.hasResizableColumnToLeft(c.index) ? 'draggable' : ''}`}
|
|
65044
65071
|
"
|
|
65045
65072
|
@mousedown="${(_, c) => c.parent.onRightDividerMouseDown(c.event, c.index)}">
|
|
65046
65073
|
</div>
|
|
@@ -65974,6 +66001,7 @@ img.ProseMirror-separator {
|
|
|
65974
66001
|
this.isColumnBeingSized = false;
|
|
65975
66002
|
this.activeColumnIndex = undefined;
|
|
65976
66003
|
this.activeColumnDivider = undefined;
|
|
66004
|
+
this.visibleColumns = [];
|
|
65977
66005
|
};
|
|
65978
66006
|
}
|
|
65979
66007
|
getGridTemplateColumns() {
|
|
@@ -66009,6 +66037,18 @@ img.ProseMirror-separator {
|
|
|
66009
66037
|
document.addEventListener('mousemove', this.onDividerMouseMove);
|
|
66010
66038
|
document.addEventListener('mouseup', this.onDividerMouseUp);
|
|
66011
66039
|
}
|
|
66040
|
+
/**
|
|
66041
|
+
* Determines if the specified column or any columns to the left are resizable.
|
|
66042
|
+
*/
|
|
66043
|
+
hasResizableColumnToLeft(columnIndex) {
|
|
66044
|
+
return this.getFirstLeftResizableColumnIndex(columnIndex) !== -1;
|
|
66045
|
+
}
|
|
66046
|
+
/**
|
|
66047
|
+
* Determines if the specified column or any columns to the right are resizable.
|
|
66048
|
+
*/
|
|
66049
|
+
hasResizableColumnToRight(columnIndex) {
|
|
66050
|
+
return this.getFirstRightResizableColumnIndex(columnIndex) !== -1;
|
|
66051
|
+
}
|
|
66012
66052
|
getTotalColumnFixedWidth() {
|
|
66013
66053
|
let totalColumnFixedWidth = 0;
|
|
66014
66054
|
for (const column of this.visibleColumns) {
|
|
@@ -66029,49 +66069,112 @@ img.ProseMirror-separator {
|
|
|
66029
66069
|
let availableSpace = 0;
|
|
66030
66070
|
if (requestedResizeAmount > 0) {
|
|
66031
66071
|
// size right
|
|
66032
|
-
return
|
|
66072
|
+
return this.hasResizableColumnToLeft(this.leftColumnIndex)
|
|
66073
|
+
? requestedResizeAmount
|
|
66074
|
+
: 0;
|
|
66033
66075
|
}
|
|
66034
66076
|
// size left
|
|
66035
|
-
|
|
66036
|
-
|
|
66037
|
-
|
|
66038
|
-
|
|
66039
|
-
|
|
66040
|
-
|
|
66041
|
-
|
|
66077
|
+
if (!this.hasResizableColumnToRight(this.rightColumnIndex)) {
|
|
66078
|
+
return 0;
|
|
66079
|
+
}
|
|
66080
|
+
for (let i = this.leftColumnIndex; i >= 0; i--) {
|
|
66081
|
+
const columnInitialWidths = this.initialColumnWidths[i];
|
|
66082
|
+
const column = this.visibleColumns[i];
|
|
66083
|
+
if (!column.columnInternals.resizingDisabled) {
|
|
66084
|
+
availableSpace
|
|
66085
|
+
+= columnInitialWidths.initialPixelWidth
|
|
66086
|
+
- column.columnInternals.minPixelWidth;
|
|
66087
|
+
}
|
|
66042
66088
|
}
|
|
66043
66089
|
return Math.max(requestedResizeAmount, -availableSpace);
|
|
66044
66090
|
}
|
|
66091
|
+
/**
|
|
66092
|
+
* Gets the index of the first resizable column starting with
|
|
66093
|
+
* `columnIndex` and moving to the left. If no resizable column
|
|
66094
|
+
* is found, returns -1.
|
|
66095
|
+
*/
|
|
66096
|
+
getFirstLeftResizableColumnIndex(columnIndex) {
|
|
66097
|
+
const visibleColumns = this.visibleColumns.length === 0
|
|
66098
|
+
? this.getVisibleColumns()
|
|
66099
|
+
: this.visibleColumns;
|
|
66100
|
+
for (let i = columnIndex; i >= 0; i--) {
|
|
66101
|
+
const column = visibleColumns[i];
|
|
66102
|
+
if (!column) {
|
|
66103
|
+
return -1;
|
|
66104
|
+
}
|
|
66105
|
+
if (!column.columnInternals.resizingDisabled) {
|
|
66106
|
+
return i;
|
|
66107
|
+
}
|
|
66108
|
+
}
|
|
66109
|
+
return -1;
|
|
66110
|
+
}
|
|
66111
|
+
/**
|
|
66112
|
+
* Gets the index of the first resizable column starting with
|
|
66113
|
+
* `columnIndex` and moving to the right. If no resizable column
|
|
66114
|
+
* is found, returns -1.
|
|
66115
|
+
*/
|
|
66116
|
+
getFirstRightResizableColumnIndex(columnIndex) {
|
|
66117
|
+
const visibleColumns = this.visibleColumns.length === 0
|
|
66118
|
+
? this.getVisibleColumns()
|
|
66119
|
+
: this.visibleColumns;
|
|
66120
|
+
for (let i = columnIndex; i < visibleColumns.length; i++) {
|
|
66121
|
+
const column = visibleColumns[i];
|
|
66122
|
+
if (!column) {
|
|
66123
|
+
return -1;
|
|
66124
|
+
}
|
|
66125
|
+
if (!column.columnInternals.resizingDisabled) {
|
|
66126
|
+
return i;
|
|
66127
|
+
}
|
|
66128
|
+
}
|
|
66129
|
+
return -1;
|
|
66130
|
+
}
|
|
66045
66131
|
performCascadeSizeLeft(leftColumnIndex, delta) {
|
|
66132
|
+
const firstLeftResizableColumn = this.getFirstLeftResizableColumnIndex(leftColumnIndex);
|
|
66133
|
+
if (firstLeftResizableColumn === -1) {
|
|
66134
|
+
return;
|
|
66135
|
+
}
|
|
66046
66136
|
let currentDelta = delta;
|
|
66047
|
-
const
|
|
66137
|
+
const leftColumn = this.visibleColumns[firstLeftResizableColumn];
|
|
66138
|
+
const leftColumnInitialWidths = this.initialColumnWidths[firstLeftResizableColumn];
|
|
66048
66139
|
const allowedDelta = delta < 0
|
|
66049
|
-
? Math.max(
|
|
66140
|
+
? Math.max(leftColumn.columnInternals.minPixelWidth
|
|
66050
66141
|
- leftColumnInitialWidths.initialPixelWidth, currentDelta)
|
|
66051
66142
|
: delta;
|
|
66052
66143
|
const actualDelta = allowedDelta;
|
|
66053
|
-
const leftColumn = this.visibleColumns[leftColumnIndex];
|
|
66054
66144
|
leftColumn.columnInternals.currentPixelWidth += actualDelta;
|
|
66055
|
-
if (actualDelta > currentDelta
|
|
66145
|
+
if (actualDelta > currentDelta
|
|
66146
|
+
&& firstLeftResizableColumn > 0
|
|
66147
|
+
&& delta < 0) {
|
|
66056
66148
|
currentDelta -= allowedDelta;
|
|
66057
|
-
this.performCascadeSizeLeft(
|
|
66149
|
+
this.performCascadeSizeLeft(firstLeftResizableColumn - 1, currentDelta);
|
|
66058
66150
|
}
|
|
66059
66151
|
}
|
|
66060
66152
|
performCascadeSizeRight(rightColumnIndex, delta) {
|
|
66153
|
+
const firstRightResizableColumn = this.getFirstRightResizableColumnIndex(rightColumnIndex);
|
|
66154
|
+
if (firstRightResizableColumn === -1) {
|
|
66155
|
+
return;
|
|
66156
|
+
}
|
|
66061
66157
|
let currentDelta = delta;
|
|
66062
|
-
const
|
|
66063
|
-
const
|
|
66064
|
-
|
|
66065
|
-
|
|
66066
|
-
|
|
66158
|
+
const rightColumn = this.visibleColumns[firstRightResizableColumn];
|
|
66159
|
+
const rightColumnInitialWidths = this.initialColumnWidths[firstRightResizableColumn];
|
|
66160
|
+
let allowedDelta;
|
|
66161
|
+
if (rightColumn.columnInternals.resizingDisabled) {
|
|
66162
|
+
allowedDelta = 0;
|
|
66163
|
+
}
|
|
66164
|
+
else if (delta > 0) {
|
|
66165
|
+
allowedDelta = Math.min(rightColumnInitialWidths.initialPixelWidth
|
|
66166
|
+
- rightColumn.columnInternals.minPixelWidth, currentDelta);
|
|
66167
|
+
}
|
|
66168
|
+
else {
|
|
66169
|
+
allowedDelta = delta;
|
|
66170
|
+
}
|
|
66067
66171
|
const actualDelta = allowedDelta;
|
|
66068
|
-
const rightColumn = this.visibleColumns[rightColumnIndex];
|
|
66069
66172
|
rightColumn.columnInternals.currentPixelWidth -= actualDelta;
|
|
66070
66173
|
if (actualDelta < currentDelta
|
|
66071
|
-
&&
|
|
66174
|
+
&& firstRightResizableColumn < this.visibleColumns.length - 1
|
|
66072
66175
|
&& delta > 0) {
|
|
66073
66176
|
currentDelta -= allowedDelta;
|
|
66074
|
-
this.performCascadeSizeRight(
|
|
66177
|
+
this.performCascadeSizeRight(firstRightResizableColumn + 1, currentDelta);
|
|
66075
66178
|
}
|
|
66076
66179
|
}
|
|
66077
66180
|
cacheGridSizedColumns() {
|
|
@@ -66087,8 +66190,7 @@ img.ProseMirror-separator {
|
|
|
66087
66190
|
for (const column of this.visibleColumns) {
|
|
66088
66191
|
this.initialColumnWidths.push({
|
|
66089
66192
|
initalColumnFractionalWidth: column.columnInternals.currentFractionalWidth,
|
|
66090
|
-
initialPixelWidth: column.columnInternals.currentPixelWidth
|
|
66091
|
-
minPixelWidth: column.columnInternals.minPixelWidth
|
|
66193
|
+
initialPixelWidth: column.columnInternals.currentPixelWidth
|
|
66092
66194
|
});
|
|
66093
66195
|
}
|
|
66094
66196
|
}
|
|
@@ -66215,7 +66317,7 @@ img.ProseMirror-separator {
|
|
|
66215
66317
|
this.track('columnSort');
|
|
66216
66318
|
}
|
|
66217
66319
|
else if (isColumnProperty(changedColumnProperty, 'columnHidden')
|
|
66218
|
-
|| isColumnInternalsProperty(changedColumnProperty, 'currentFractionalWidth', 'currentPixelWidth', 'minPixelWidth')) {
|
|
66320
|
+
|| isColumnInternalsProperty(changedColumnProperty, 'currentFractionalWidth', 'currentPixelWidth', 'minPixelWidth', 'resizingDisabled')) {
|
|
66219
66321
|
this.track('columnWidths');
|
|
66220
66322
|
}
|
|
66221
66323
|
else if (isColumnProperty(changedColumnProperty, 'actionMenuSlot')) {
|
|
@@ -69812,10 +69914,23 @@ img.ProseMirror-separator {
|
|
|
69812
69914
|
DesignSystem.getOrCreate().withPrefix('nimble').register(iconCellView());
|
|
69813
69915
|
const tableColumnIconCellViewTag = 'nimble-table-column-icon-cell-view';
|
|
69814
69916
|
|
|
69917
|
+
/**
|
|
69918
|
+
* Width mode for the icon column
|
|
69919
|
+
*/
|
|
69920
|
+
const TableColumnMappingWidthMode = {
|
|
69921
|
+
default: undefined,
|
|
69922
|
+
iconSize: 'icon-size'
|
|
69923
|
+
};
|
|
69924
|
+
|
|
69815
69925
|
/**
|
|
69816
69926
|
* Table column that maps values to icons / spinners
|
|
69817
69927
|
*/
|
|
69818
69928
|
class TableColumnIcon extends mixinGroupableColumnAPI(mixinFractionalWidthColumnAPI((TableColumnEnumBase))) {
|
|
69929
|
+
minPixelWidthChanged() {
|
|
69930
|
+
if (this.widthMode !== TableColumnMappingWidthMode.iconSize) {
|
|
69931
|
+
this.columnInternals.minPixelWidth = this.getConfiguredMinPixelWidth();
|
|
69932
|
+
}
|
|
69933
|
+
}
|
|
69819
69934
|
getColumnInternalsOptions() {
|
|
69820
69935
|
return {
|
|
69821
69936
|
cellRecordFieldNames: ['value'],
|
|
@@ -69845,7 +69960,30 @@ img.ProseMirror-separator {
|
|
|
69845
69960
|
// this function from running when there is an unsupported mapping.
|
|
69846
69961
|
throw new Error('Unsupported mapping');
|
|
69847
69962
|
}
|
|
69963
|
+
widthModeChanged() {
|
|
69964
|
+
if (this.widthMode === TableColumnMappingWidthMode.iconSize) {
|
|
69965
|
+
this.columnInternals.resizingDisabled = true;
|
|
69966
|
+
this.columnInternals.hideHeaderIndicators = true;
|
|
69967
|
+
this.columnInternals.pixelWidth = singleIconColumnWidth;
|
|
69968
|
+
this.columnInternals.minPixelWidth = singleIconColumnWidth;
|
|
69969
|
+
}
|
|
69970
|
+
else {
|
|
69971
|
+
this.columnInternals.resizingDisabled = false;
|
|
69972
|
+
this.columnInternals.hideHeaderIndicators = false;
|
|
69973
|
+
this.columnInternals.pixelWidth = undefined;
|
|
69974
|
+
this.columnInternals.minPixelWidth = this.getConfiguredMinPixelWidth();
|
|
69975
|
+
}
|
|
69976
|
+
}
|
|
69977
|
+
getConfiguredMinPixelWidth() {
|
|
69978
|
+
if (typeof this.minPixelWidth === 'number') {
|
|
69979
|
+
return this.minPixelWidth;
|
|
69980
|
+
}
|
|
69981
|
+
return defaultMinPixelWidth;
|
|
69982
|
+
}
|
|
69848
69983
|
}
|
|
69984
|
+
__decorate$1([
|
|
69985
|
+
attr({ attribute: 'width-mode' })
|
|
69986
|
+
], TableColumnIcon.prototype, "widthMode", void 0);
|
|
69849
69987
|
const nimbleTableColumnIcon = TableColumnIcon.compose({
|
|
69850
69988
|
baseName: 'table-column-icon',
|
|
69851
69989
|
template: template$8,
|