@sebgroup/green-core 3.22.1 → 3.23.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/components/calendar/calendar.component.js +2 -3
- package/components/context-menu/context-menu.component.d.ts +8 -0
- package/components/context-menu/context-menu.component.js +5 -0
- package/components/dropdown/dropdown.component.js +25 -2
- package/components/dropdown/option.component.js +1 -0
- package/components/radio/radio-group/radio-group.component.js +2 -0
- package/components/table/table.component.d.ts +7 -0
- package/components/table/table.component.js +32 -18
- package/custom-elements.json +33635 -33606
- package/gds-element.js +1 -1
- package/generated/mcp/checkbox/guidelines.md +24 -16
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/context-menu/api.md +1 -0
- package/generated/mcp/datepicker/guidelines.md +19 -16
- package/generated/mcp/dropdown/guidelines.md +20 -13
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/input/guidelines.md +5 -0
- package/generated/mcp/radio/guidelines.md +23 -14
- package/generated/mcp/select/guidelines.md +6 -0
- package/generated/mcp/switch/guidelines.md +6 -0
- package/generated/mcp/textarea/guidelines.md +18 -9
- package/generated/mcp/tokens.json +1 -1
- package/generated/react/context-menu/index.d.ts +1 -0
- package/generated/react/index.d.ts +2 -2
- package/generated/react/index.js +2 -2
- package/package.json +1 -1
- package/utils/decorators/resize-observer.d.ts +20 -1
- package/utils/decorators/resize-observer.js +21 -3
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -154,9 +154,7 @@ let GdsCalendar = class extends GdsElement {
|
|
|
154
154
|
const shouldRenderBlank = this.hideExtraneousDays && isOutsideCurrentMonth;
|
|
155
155
|
return shouldRenderBlank ? html`<td inert></td>` : html`
|
|
156
156
|
<td
|
|
157
|
-
role="
|
|
158
|
-
isDisabled ? void 0 : "gridcell"
|
|
159
|
-
)}"
|
|
157
|
+
role="gridcell"
|
|
160
158
|
class="${classMap({
|
|
161
159
|
small: Boolean(this.size === "small"),
|
|
162
160
|
"custom-date": Boolean(customization),
|
|
@@ -165,6 +163,7 @@ let GdsCalendar = class extends GdsElement {
|
|
|
165
163
|
"outside-month": isOutsideCurrentMonth
|
|
166
164
|
})}"
|
|
167
165
|
?disabled=${isDisabled}
|
|
166
|
+
aria-disabled="${isDisabled ? "true" : "false"}"
|
|
168
167
|
tabindex="${isSameDay(this.focusedDate, day) ? 0 : -1}"
|
|
169
168
|
aria-selected="${this.value && isSameDay(this.value, day) ? "true" : "false"}"
|
|
170
169
|
aria-label="${this.dateLabelTemplate(day)}"
|
|
@@ -43,6 +43,14 @@ export declare class GdsContextMenu extends GdsContextMenu_base {
|
|
|
43
43
|
* The placement of the popover relative to the trigger.
|
|
44
44
|
*/
|
|
45
45
|
placement: Placement;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the context menu popover is nonmodal. When true, the popover will not trap focus,
|
|
48
|
+
* and other elements on the page (including other context menu triggers) will still be
|
|
49
|
+
* interactable while the menu is open. Enable this when rendering multiple `gds-context-menu`
|
|
50
|
+
* instances in the same view, so that clicking one trigger while another menu is open closes
|
|
51
|
+
* the first and opens the second in a single click.
|
|
52
|
+
*/
|
|
53
|
+
nonmodal: boolean;
|
|
46
54
|
private _elTriggerSlot;
|
|
47
55
|
connectedCallback(): void;
|
|
48
56
|
render(): any;
|
|
@@ -45,6 +45,7 @@ let GdsContextMenu = class extends withMarginProps(
|
|
|
45
45
|
this.label = "";
|
|
46
46
|
this.maxHeight = 500;
|
|
47
47
|
this.placement = "bottom-start";
|
|
48
|
+
this.nonmodal = false;
|
|
48
49
|
__privateAdd(this, _elTriggerBtn, void 0);
|
|
49
50
|
__privateAdd(this, _setupButton, () => {
|
|
50
51
|
if (!__privateGet(this, _elTriggerBtn))
|
|
@@ -84,6 +85,7 @@ let GdsContextMenu = class extends withMarginProps(
|
|
|
84
85
|
.placement=${this.placement}
|
|
85
86
|
.popupRole=${"menu"}
|
|
86
87
|
.calcMaxHeight=${__privateGet(this, _calcMaxHeight)}
|
|
88
|
+
.nonmodal=${this.nonmodal}
|
|
87
89
|
@gds-ui-state=${(e) => this.open = e.detail.open}
|
|
88
90
|
>
|
|
89
91
|
<gds-menu
|
|
@@ -172,6 +174,9 @@ __decorateClass([
|
|
|
172
174
|
__decorateClass([
|
|
173
175
|
property()
|
|
174
176
|
], GdsContextMenu.prototype, "placement", 2);
|
|
177
|
+
__decorateClass([
|
|
178
|
+
property({ type: Boolean, reflect: true })
|
|
179
|
+
], GdsContextMenu.prototype, "nonmodal", 2);
|
|
175
180
|
__decorateClass([
|
|
176
181
|
query('slot[name="trigger"]')
|
|
177
182
|
], GdsContextMenu.prototype, "_elTriggerSlot", 2);
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__privateMethod,
|
|
6
6
|
__privateSet
|
|
7
7
|
} from "../../chunks/chunk.CAV4X6PU.js";
|
|
8
|
-
var _optionElements, _shouldShowFooter, shouldShowFooter_fn, _renderCombobox, _renderTriggerButton, _handleBlur, _calcMaxHeight, _dispatchUISateEvent, _handlePopoverStateChange, _handleClearButton, _handleSearchFieldInput, _handleSearchFieldKeyDown, _handleListboxKeyDown, _handleOptionFocusChange, _handleOptionSelect, _toggleOptionValue, toggleOptionValue_fn, _syncOptionSelection, syncOptionSelection_fn, _focusListbox, _isCommitting, _commitSelection, commitSelection_fn, _registerAutoCloseListener, registerAutoCloseListener_fn, _unregisterAutoCloseListener, unregisterAutoCloseListener_fn, _blurCloseListener, _tabCloseListener;
|
|
8
|
+
var _optionElements, _shouldShowFooter, shouldShowFooter_fn, _renderCombobox, _renderTriggerButton, _handleBlur, _calcMaxHeight, _dispatchUISateEvent, _handlePopoverStateChange, _handleClearButton, _handleSearchFieldInput, _handleSearchFieldKeyDown, _handleListboxKeyDown, _handleOptionFocusChange, _handleOptionSelect, _toggleOptionValue, toggleOptionValue_fn, _syncOptionSelection, syncOptionSelection_fn, _focusListbox, _isPointerPressedInListbox, _handleListboxPointerDown, _handleListboxFocus, _isCommitting, _commitSelection, commitSelection_fn, _registerAutoCloseListener, registerAutoCloseListener_fn, _unregisterAutoCloseListener, unregisterAutoCloseListener_fn, _blurCloseListener, _tabCloseListener;
|
|
9
9
|
import { localized, msg, str } from "@lit/localize";
|
|
10
10
|
import { nothing } from "lit";
|
|
11
11
|
import { property, query } from "lit/decorators.js";
|
|
@@ -258,6 +258,25 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
258
258
|
(items.find((o) => o.selected) || items[0])?.focus();
|
|
259
259
|
});
|
|
260
260
|
});
|
|
261
|
+
__privateAdd(this, _isPointerPressedInListbox, false);
|
|
262
|
+
__privateAdd(this, _handleListboxPointerDown, () => {
|
|
263
|
+
__privateSet(this, _isPointerPressedInListbox, true);
|
|
264
|
+
window.addEventListener(
|
|
265
|
+
"pointerup",
|
|
266
|
+
() => __privateSet(this, _isPointerPressedInListbox, false),
|
|
267
|
+
{ once: true }
|
|
268
|
+
);
|
|
269
|
+
});
|
|
270
|
+
/**
|
|
271
|
+
* A pointer press moves focus to the listbox container when it lands somewhere that is not an
|
|
272
|
+
* option. Handing that focus on to the selected option would scroll the list out from under the
|
|
273
|
+
* pointer, so the redirect is limited to programmatic focus.
|
|
274
|
+
*/
|
|
275
|
+
__privateAdd(this, _handleListboxFocus, () => {
|
|
276
|
+
if (__privateGet(this, _isPointerPressedInListbox))
|
|
277
|
+
return;
|
|
278
|
+
__privateGet(this, _focusListbox).call(this);
|
|
279
|
+
});
|
|
261
280
|
__privateAdd(this, _isCommitting, false);
|
|
262
281
|
/**
|
|
263
282
|
* A listener to close the dropdown when any other element is focused.
|
|
@@ -454,7 +473,8 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
454
473
|
role="listbox"
|
|
455
474
|
aria-multiselectable="${this.multiple}"
|
|
456
475
|
tabindex="-1"
|
|
457
|
-
@focus="${__privateGet(this,
|
|
476
|
+
@focus="${__privateGet(this, _handleListboxFocus)}"
|
|
477
|
+
@pointerdown="${__privateGet(this, _handleListboxPointerDown)}"
|
|
458
478
|
@gds-select="${__privateGet(this, _handleOptionSelect)}"
|
|
459
479
|
@gds-focus="${__privateGet(this, _handleOptionFocusChange)}"
|
|
460
480
|
@keydown=${__privateGet(this, _handleListboxKeyDown)}
|
|
@@ -572,6 +592,9 @@ syncOptionSelection_fn = function() {
|
|
|
572
592
|
});
|
|
573
593
|
};
|
|
574
594
|
_focusListbox = new WeakMap();
|
|
595
|
+
_isPointerPressedInListbox = new WeakMap();
|
|
596
|
+
_handleListboxPointerDown = new WeakMap();
|
|
597
|
+
_handleListboxFocus = new WeakMap();
|
|
575
598
|
_isCommitting = new WeakMap();
|
|
576
599
|
_commitSelection = new WeakSet();
|
|
577
600
|
commitSelection_fn = function(value, options = {}) {
|
|
@@ -44,6 +44,7 @@ let GdsOption = class extends Focusable(GdsElement) {
|
|
|
44
44
|
connectedCallback() {
|
|
45
45
|
super.connectedCallback();
|
|
46
46
|
this.setAttribute("role", "option");
|
|
47
|
+
this.setAttribute("tabindex", "-1");
|
|
47
48
|
this.updateComplete.then(() => {
|
|
48
49
|
if (this.isPlaceholder) {
|
|
49
50
|
this.hidden = true;
|
|
@@ -57,11 +57,13 @@ let RadioGroup = class extends GdsFormControlElement {
|
|
|
57
57
|
__privateMethod(this, _initializeFocusable, initializeFocusable_fn).call(this);
|
|
58
58
|
});
|
|
59
59
|
this.addEventListener("invalid", this._syncRadioStates);
|
|
60
|
+
this.addEventListener("gds-validity-state", this._syncRadioStates);
|
|
60
61
|
}
|
|
61
62
|
disconnectedCallback() {
|
|
62
63
|
super.disconnectedCallback();
|
|
63
64
|
this._isConnected = false;
|
|
64
65
|
this.removeEventListener("invalid", this._syncRadioStates);
|
|
66
|
+
this.removeEventListener("gds-validity-state", this._syncRadioStates);
|
|
65
67
|
}
|
|
66
68
|
focus(options) {
|
|
67
69
|
this._getValidityAnchor()?.focus(options);
|
|
@@ -166,6 +166,13 @@ export declare class GdsTable<T extends Types.Row = Types.Row> extends GdsTable_
|
|
|
166
166
|
private _onColumnsChange;
|
|
167
167
|
connectedCallback(): void;
|
|
168
168
|
private _handleLightDOMSlotsChange;
|
|
169
|
+
/**
|
|
170
|
+
* Sticky offsets are derived from measured column widths, so they go stale whenever a
|
|
171
|
+
* sticky column changes size after it was last rendered — for example when cell content
|
|
172
|
+
* is projected into the slots after the table has rendered, when webfonts load, or when
|
|
173
|
+
* the available width changes.
|
|
174
|
+
*/
|
|
175
|
+
private _handleStickyColumnResize;
|
|
169
176
|
updated(changedProperties: Map<string, unknown>): void;
|
|
170
177
|
render(): any;
|
|
171
178
|
/**
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__privateMethod,
|
|
6
6
|
__privateSet
|
|
7
7
|
} from "../../chunks/chunk.CAV4X6PU.js";
|
|
8
|
-
var _cache, _cacheDuration, _isResponsiveStacked, isResponsiveStacked_get, _isExpandableEnabled, isExpandableEnabled_get, _isSelectableEnabled, isSelectableEnabled_get, _Density, Density_get, _expandTransitionTimers, _expandedLoadingExitDuration, _expandedLoadingDelay, _expandedFullSlotKeys, _pendingExpandedFullSlotRefresh, _hasSelection, hasSelection_get, _isAllSelected, isAllSelected_get, _isPartialSelection, isPartialSelection_get, _expandableIndices, expandableIndices_get, _isAllExpanded, isAllExpanded_get, _getCacheKey, getCacheKey_fn, _clearExpansionTransitionTimer, clearExpansionTransitionTimer_fn, _clearExpansionLoadingState, clearExpansionLoadingState_fn, _clearAllExpansionLoadingStates, clearAllExpansionLoadingStates_fn, _scheduleExpansionContentReveal, scheduleExpansionContentReveal_fn, _isCacheValid, isCacheValid_fn, _getControlledColumnSort, getControlledColumnSort_fn, _loadData, loadData_fn, _queueExpandedFullSlotRefresh, queueExpandedFullSlotRefresh_fn, _getStickyBorderKeys, getStickyBorderKeys_fn, _updateStickyOffsets, updateStickyOffsets_fn, _getRowKey, getRowKey_fn, _renderCellWrapped, renderCellWrapped_fn, _renderMobileLabel, renderMobileLabel_fn, _renderSlotElement, renderSlotElement_fn, _renderCellContent, renderCellContent_fn, _renderSortIcon, renderSortIcon_fn, _hasHeaderContent, hasHeaderContent_fn, _renderHeaderControls, renderHeaderControls_fn, _renderColumnHeader, renderColumnHeader_fn, _renderSelectableHeader, renderSelectableHeader_fn, _renderExpandableHeader, renderExpandableHeader_fn, _getRowSubRowsSource, getRowSubRowsSource_fn, _getRowFullContentSource, getRowFullContentSource_fn, _getExpandedRows, getExpandedRows_fn, _hasAsyncSubRows, hasAsyncSubRows_fn, _hasAsyncFullContent, hasAsyncFullContent_fn, _getSubRowCount, getSubRowCount_fn, _hasExpandedFullSlot, hasExpandedFullSlot_fn, _hasExpandedFullContent, hasExpandedFullContent_fn, _refreshExpandedFullSlotKeys, refreshExpandedFullSlotKeys_fn, _isRowExpandable, isRowExpandable_fn, _getExpandedGroupId, getExpandedGroupId_fn, _getRenderedColumnCount, getRenderedColumnCount_fn, _renderColumnHeaders, renderColumnHeaders_fn, _renderTableHeader, renderTableHeader_fn, _renderTableCell, renderTableCell_fn, _renderExpandableCell, renderExpandableCell_fn, _renderSelectableCell, renderSelectableCell_fn, _renderRowCells, renderRowCells_fn, _renderFullWidthDetailsRow, renderFullWidthDetailsRow_fn, _renderExpandedLoadingRow, renderExpandedLoadingRow_fn, _renderExpandedLoadingRows, renderExpandedLoadingRows_fn, _renderExpandedFullLoadingRow, renderExpandedFullLoadingRow_fn, _getExpandedChildRowClasses, getExpandedChildRowClasses_fn, _getTableRowClasses, getTableRowClasses_fn, _getRowAriaExpanded, getRowAriaExpanded_fn, _getTableRowPresentation, getTableRowPresentation_fn, _renderExpandedChildRow, renderExpandedChildRow_fn, _getRowExpansionLoadingKind, getRowExpansionLoadingKind_fn, _getRowExpansionState, getRowExpansionState_fn, _renderExpandedRowContent, renderExpandedRowContent_fn, _renderTableRow, renderTableRow_fn, _renderCheckbox, renderCheckbox_fn, _renderSkeletonCell, renderSkeletonCell_fn, _renderSkeletonRow, renderSkeletonRow_fn, _renderTableBody, renderTableBody_fn, _renderTableFoot, renderTableFoot_fn, _renderTable, renderTable_fn, _renderErrorState, renderErrorState_fn, _renderEmptyState, renderEmptyState_fn, _renderFooter, renderFooter_fn, _renderHeadline, renderHeadline_fn, _handleSearch, handleSearch_fn, _handleSearchClear, handleSearchClear_fn, _handleSort, handleSort_fn, _handlePageChange, handlePageChange_fn, _handlePageSizeChange, handlePageSizeChange_fn, _handleColumnVisibility, handleColumnVisibility_fn, _handleSelectAll, handleSelectAll_fn, _handleRowSelect, handleRowSelect_fn, _handleExpandToggle, handleExpandToggle_fn, _handleExpandAll, handleExpandAll_fn, _emitExpandChange, emitExpandChange_fn, _resolveExpandedContent, resolveExpandedContent_fn, _setRowExpanded, setRowExpanded_fn, _selectAllInternal, selectAllInternal_fn, _clearSelectionInternal, clearSelectionInternal_fn, _emitSelectionChange, emitSelectionChange_fn, _initializeScrollTracking, initializeScrollTracking_fn, _updateVerticalScrollState, updateVerticalScrollState_fn, _updateHorizontalScrollState, updateHorizontalScrollState_fn;
|
|
8
|
+
var _cache, _cacheDuration, _isResponsiveStacked, isResponsiveStacked_get, _isExpandableEnabled, isExpandableEnabled_get, _isSelectableEnabled, isSelectableEnabled_get, _Density, Density_get, _expandTransitionTimers, _expandedLoadingExitDuration, _expandedLoadingDelay, _expandedFullSlotKeys, _pendingExpandedFullSlotRefresh, _appliedStickyOffsets, _hasSelection, hasSelection_get, _isAllSelected, isAllSelected_get, _isPartialSelection, isPartialSelection_get, _expandableIndices, expandableIndices_get, _isAllExpanded, isAllExpanded_get, _getCacheKey, getCacheKey_fn, _clearExpansionTransitionTimer, clearExpansionTransitionTimer_fn, _clearExpansionLoadingState, clearExpansionLoadingState_fn, _clearAllExpansionLoadingStates, clearAllExpansionLoadingStates_fn, _scheduleExpansionContentReveal, scheduleExpansionContentReveal_fn, _isCacheValid, isCacheValid_fn, _getControlledColumnSort, getControlledColumnSort_fn, _loadData, loadData_fn, _queueExpandedFullSlotRefresh, queueExpandedFullSlotRefresh_fn, _getStickyBorderKeys, getStickyBorderKeys_fn, _updateStickyOffsets, updateStickyOffsets_fn, _getRowKey, getRowKey_fn, _renderCellWrapped, renderCellWrapped_fn, _renderMobileLabel, renderMobileLabel_fn, _renderSlotElement, renderSlotElement_fn, _renderCellContent, renderCellContent_fn, _renderSortIcon, renderSortIcon_fn, _hasHeaderContent, hasHeaderContent_fn, _renderHeaderControls, renderHeaderControls_fn, _renderColumnHeader, renderColumnHeader_fn, _renderSelectableHeader, renderSelectableHeader_fn, _renderExpandableHeader, renderExpandableHeader_fn, _getRowSubRowsSource, getRowSubRowsSource_fn, _getRowFullContentSource, getRowFullContentSource_fn, _getExpandedRows, getExpandedRows_fn, _hasAsyncSubRows, hasAsyncSubRows_fn, _hasAsyncFullContent, hasAsyncFullContent_fn, _getSubRowCount, getSubRowCount_fn, _hasExpandedFullSlot, hasExpandedFullSlot_fn, _hasExpandedFullContent, hasExpandedFullContent_fn, _refreshExpandedFullSlotKeys, refreshExpandedFullSlotKeys_fn, _isRowExpandable, isRowExpandable_fn, _getExpandedGroupId, getExpandedGroupId_fn, _getRenderedColumnCount, getRenderedColumnCount_fn, _renderColumnHeaders, renderColumnHeaders_fn, _renderTableHeader, renderTableHeader_fn, _renderTableCell, renderTableCell_fn, _renderExpandableCell, renderExpandableCell_fn, _renderSelectableCell, renderSelectableCell_fn, _renderRowCells, renderRowCells_fn, _renderFullWidthDetailsRow, renderFullWidthDetailsRow_fn, _renderExpandedLoadingRow, renderExpandedLoadingRow_fn, _renderExpandedLoadingRows, renderExpandedLoadingRows_fn, _renderExpandedFullLoadingRow, renderExpandedFullLoadingRow_fn, _getExpandedChildRowClasses, getExpandedChildRowClasses_fn, _getTableRowClasses, getTableRowClasses_fn, _getRowAriaExpanded, getRowAriaExpanded_fn, _getTableRowPresentation, getTableRowPresentation_fn, _renderExpandedChildRow, renderExpandedChildRow_fn, _getRowExpansionLoadingKind, getRowExpansionLoadingKind_fn, _getRowExpansionState, getRowExpansionState_fn, _renderExpandedRowContent, renderExpandedRowContent_fn, _renderTableRow, renderTableRow_fn, _renderCheckbox, renderCheckbox_fn, _renderSkeletonCell, renderSkeletonCell_fn, _renderSkeletonRow, renderSkeletonRow_fn, _renderTableBody, renderTableBody_fn, _renderTableFoot, renderTableFoot_fn, _renderTable, renderTable_fn, _renderErrorState, renderErrorState_fn, _renderEmptyState, renderEmptyState_fn, _renderFooter, renderFooter_fn, _renderHeadline, renderHeadline_fn, _handleSearch, handleSearch_fn, _handleSearchClear, handleSearchClear_fn, _handleSort, handleSort_fn, _handlePageChange, handlePageChange_fn, _handlePageSizeChange, handlePageSizeChange_fn, _handleColumnVisibility, handleColumnVisibility_fn, _handleSelectAll, handleSelectAll_fn, _handleRowSelect, handleRowSelect_fn, _handleExpandToggle, handleExpandToggle_fn, _handleExpandAll, handleExpandAll_fn, _emitExpandChange, emitExpandChange_fn, _resolveExpandedContent, resolveExpandedContent_fn, _setRowExpanded, setRowExpanded_fn, _selectAllInternal, selectAllInternal_fn, _clearSelectionInternal, clearSelectionInternal_fn, _emitSelectionChange, emitSelectionChange_fn, _initializeScrollTracking, initializeScrollTracking_fn, _updateVerticalScrollState, updateVerticalScrollState_fn, _updateHorizontalScrollState, updateHorizontalScrollState_fn;
|
|
9
9
|
import { localized, msg } from "@lit/localize";
|
|
10
10
|
import { property, state } from "lit/decorators.js";
|
|
11
11
|
import { classMap } from "lit/directives/class-map.js";
|
|
@@ -18,6 +18,7 @@ import { GdsElement } from "../../gds-element.js";
|
|
|
18
18
|
import { watchMediaQuery } from "../../utils/decorators/index.js";
|
|
19
19
|
import { ariaForwarding } from "../../utils/decorators/aria-forwarding.js";
|
|
20
20
|
import { observeLightDOM } from "../../utils/decorators/observe-light-dom.js";
|
|
21
|
+
import { resizeObserver } from "../../utils/decorators/resize-observer.js";
|
|
21
22
|
import { styleExpressionProperty } from "../../utils/decorators/style-expression-property.js";
|
|
22
23
|
import { watch } from "../../utils/decorators/watch.js";
|
|
23
24
|
import { forSpaceTokensAndCustomValues } from "../../utils/helpers/index.js";
|
|
@@ -249,6 +250,7 @@ let GdsTable = class extends withSizeXProps(
|
|
|
249
250
|
__privateAdd(this, _expandedLoadingDelay, 100);
|
|
250
251
|
__privateAdd(this, _expandedFullSlotKeys, /* @__PURE__ */ new Set());
|
|
251
252
|
__privateAdd(this, _pendingExpandedFullSlotRefresh, false);
|
|
253
|
+
__privateAdd(this, _appliedStickyOffsets, null);
|
|
252
254
|
}
|
|
253
255
|
_handleMobile(matches) {
|
|
254
256
|
this._isMobile = matches;
|
|
@@ -296,8 +298,12 @@ let GdsTable = class extends withSizeXProps(
|
|
|
296
298
|
_handleLightDOMSlotsChange() {
|
|
297
299
|
__privateMethod(this, _queueExpandedFullSlotRefresh, queueExpandedFullSlotRefresh_fn).call(this);
|
|
298
300
|
}
|
|
301
|
+
_handleStickyColumnResize() {
|
|
302
|
+
__privateMethod(this, _updateStickyOffsets, updateStickyOffsets_fn).call(this);
|
|
303
|
+
}
|
|
299
304
|
updated(changedProperties) {
|
|
300
305
|
super.updated(changedProperties);
|
|
306
|
+
__privateSet(this, _appliedStickyOffsets, null);
|
|
301
307
|
__privateMethod(this, _updateStickyOffsets, updateStickyOffsets_fn).call(this);
|
|
302
308
|
}
|
|
303
309
|
render() {
|
|
@@ -414,6 +420,7 @@ _expandedLoadingExitDuration = new WeakMap();
|
|
|
414
420
|
_expandedLoadingDelay = new WeakMap();
|
|
415
421
|
_expandedFullSlotKeys = new WeakMap();
|
|
416
422
|
_pendingExpandedFullSlotRefresh = new WeakMap();
|
|
423
|
+
_appliedStickyOffsets = new WeakMap();
|
|
417
424
|
_hasSelection = new WeakSet();
|
|
418
425
|
hasSelection_get = function() {
|
|
419
426
|
return this._selected.size > 0;
|
|
@@ -617,28 +624,30 @@ updateStickyOffsets_fn = function() {
|
|
|
617
624
|
const checkboxTh = root.querySelector("thead th.checkbox-cell");
|
|
618
625
|
if (!leftHeaders.length && !rightHeaders.length)
|
|
619
626
|
return;
|
|
620
|
-
|
|
621
|
-
el.style.left = "";
|
|
622
|
-
el.style.right = "";
|
|
623
|
-
});
|
|
627
|
+
const offsets = [];
|
|
624
628
|
let leftAccum = (expanderTh?.offsetWidth ?? 0) + (checkboxTh?.offsetWidth ?? 0);
|
|
625
629
|
for (const th of leftHeaders) {
|
|
626
|
-
|
|
627
|
-
const offset = `${leftAccum}px`;
|
|
628
|
-
th.style.left = offset;
|
|
630
|
+
offsets.push({ th, side: "left", offset: `${leftAccum}px` });
|
|
629
631
|
leftAccum += th.offsetWidth;
|
|
630
|
-
if (key) {
|
|
631
|
-
root.querySelectorAll(`[data-col-key="${key}"]`).forEach((el) => el.style.left = offset);
|
|
632
|
-
}
|
|
633
632
|
}
|
|
634
633
|
let rightAccum = 0;
|
|
635
634
|
for (const th of [...rightHeaders].reverse()) {
|
|
636
|
-
|
|
637
|
-
const offset = `${rightAccum}px`;
|
|
638
|
-
th.style.right = offset;
|
|
635
|
+
offsets.push({ th, side: "right", offset: `${rightAccum}px` });
|
|
639
636
|
rightAccum += th.offsetWidth;
|
|
637
|
+
}
|
|
638
|
+
const appliedOffsets = offsets.map(({ th, side, offset }) => `${side}:${th.dataset.colKey}:${offset}`).join("|");
|
|
639
|
+
if (appliedOffsets === __privateGet(this, _appliedStickyOffsets))
|
|
640
|
+
return;
|
|
641
|
+
__privateSet(this, _appliedStickyOffsets, appliedOffsets);
|
|
642
|
+
root.querySelectorAll("[data-col-key]").forEach((el) => {
|
|
643
|
+
el.style.left = "";
|
|
644
|
+
el.style.right = "";
|
|
645
|
+
});
|
|
646
|
+
for (const { th, side, offset } of offsets) {
|
|
647
|
+
const key = th.dataset.colKey;
|
|
648
|
+
th.style[side] = offset;
|
|
640
649
|
if (key) {
|
|
641
|
-
root.querySelectorAll(`[data-col-key="${key}"]`).forEach((el) => el.style
|
|
650
|
+
root.querySelectorAll(`[data-col-key="${key}"]`).forEach((el) => el.style[side] = offset);
|
|
642
651
|
}
|
|
643
652
|
}
|
|
644
653
|
};
|
|
@@ -1840,11 +1849,11 @@ initializeScrollTracking_fn = function() {
|
|
|
1840
1849
|
__privateMethod(this, _updateHorizontalScrollState, updateHorizontalScrollState_fn).call(this, dataContainer);
|
|
1841
1850
|
};
|
|
1842
1851
|
dataContainer.addEventListener("scroll", updateScrollState);
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1852
|
+
const resizeObserver2 = new ResizeObserver(() => updateScrollState());
|
|
1853
|
+
resizeObserver2.observe(dataContainer);
|
|
1845
1854
|
const innerTable = dataContainer.querySelector("table");
|
|
1846
1855
|
if (innerTable)
|
|
1847
|
-
|
|
1856
|
+
resizeObserver2.observe(innerTable);
|
|
1848
1857
|
updateScrollState();
|
|
1849
1858
|
};
|
|
1850
1859
|
_updateVerticalScrollState = new WeakSet();
|
|
@@ -2027,6 +2036,11 @@ __decorateClass([
|
|
|
2027
2036
|
attributeOldValue: true
|
|
2028
2037
|
})
|
|
2029
2038
|
], GdsTable.prototype, "_handleLightDOMSlotsChange", 1);
|
|
2039
|
+
__decorateClass([
|
|
2040
|
+
resizeObserver({
|
|
2041
|
+
selector: "thead th.sticky-left, thead th.sticky-right, thead th.expander-cell, thead th.checkbox-cell"
|
|
2042
|
+
})
|
|
2043
|
+
], GdsTable.prototype, "_handleStickyColumnResize", 1);
|
|
2030
2044
|
GdsTable = __decorateClass([
|
|
2031
2045
|
localized(),
|
|
2032
2046
|
gdsCustomElement("gds-table", {
|