@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.149 → 2.0.0-next.150
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/bundle/openbridge-webcomponents.bundle.js +4443 -3841
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +381 -2
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js +94 -0
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js.map +1 -0
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts +72 -0
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts.map +1 -0
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js +396 -0
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js.map +1 -0
- package/dist/components/table/table.css.js +43 -0
- package/dist/components/table/table.css.js.map +1 -1
- package/dist/components/table/table.d.ts +31 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +124 -11
- package/dist/components/table/table.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/src/components/alert-list-details-experimental/alert-list-details-experimental.css +70 -0
- package/src/components/alert-list-details-experimental/alert-list-details-experimental.stories.ts +510 -0
- package/src/components/alert-list-details-experimental/alert-list-details-experimental.ts +457 -0
- package/src/components/table/table.css +42 -0
- package/src/components/table/table.stories.ts +279 -0
- package/src/components/table/table.ts +177 -13
- package/src/types.ts +6 -4
package/custom-elements.json
CHANGED
|
@@ -4900,6 +4900,51 @@
|
|
|
4900
4900
|
}
|
|
4901
4901
|
]
|
|
4902
4902
|
},
|
|
4903
|
+
{
|
|
4904
|
+
"kind": "javascript-module",
|
|
4905
|
+
"path": "dist/components/alert-list-details-experimental/alert-list-details-experimental.js",
|
|
4906
|
+
"declarations": [
|
|
4907
|
+
{
|
|
4908
|
+
"kind": "variable",
|
|
4909
|
+
"name": "ObcAlertListDetailsExperimental",
|
|
4910
|
+
"default": "class extends LitElement { constructor() { super(...arguments); this.selectedMode = \"all\"; this.alerts = []; this.showTime = false; this.timeFormatter = (time) => time.toLocaleTimeString(void 0, { hour12: false }); this.small = false; this.defaultExpanded = true; this.expansionOverrides = /* @__PURE__ */ new Map(); this.alertByRowId = /* @__PURE__ */ new Map(); } getVisibleAlerts() { const seen = /* @__PURE__ */ new Set(); return this.alertList.getAllVisibleRows().map((rowId) => this.alertByRowId.get(rowId)).filter((alert) => alert !== void 0).filter((alert) => { if (seen.has(alert.id)) { return false; } seen.add(alert.id); return true; }); } onRowClick(e) { const row = this.alertByRowId.get(e.detail.row.id); if (row) { this.dispatchEvent( new CustomEvent(\"row-click\", { detail: { alert: row } }) ); } } onCellButtonClick(e) { const row = this.alertByRowId.get(e.detail.rowId); if (row) { this.dispatchEvent( new CustomEvent(\"ack-click\", { detail: { alert: row }, bubbles: false }) ); } } onExpandToggle(e) { const overrides = new Map(this.expansionOverrides); overrides.set(e.detail.rowId, e.detail.expanded); this.expansionOverrides = overrides; } isExpanded(rowId) { return this.expansionOverrides.get(rowId) ?? this.defaultExpanded; } get columns() { if (this.small) { const columns = [ { label: \"Status\", key: \"status\", sortDirection: \"desc\", sortable: true, compareFunction: (_a, _b, aRow, bRow) => { const aAlert = this.alertByRowId.get(aRow.id); const bAlert = this.alertByRowId.get(bRow.id); if (aAlert && bAlert) { return comparePriorityAlerts(aAlert, bAlert); } return 0; } } ]; if (this.showTime) { columns.push({ label: \"Activated\", key: \"time\" }); } columns.push({ label: \"ACK-status\", key: \"action\" }); return columns; } else { const columns = [ { label: \"Status\", key: \"status\", sortDirection: \"desc\", sortable: true, compareFunction: (_a, _b, aRow, bRow) => { const aAlert = this.alertByRowId.get(aRow.id); const bAlert = this.alertByRowId.get(bRow.id); if (aAlert && bAlert) { return comparePriorityAlerts(aAlert, bAlert); } return 0; } }, { label: \"ACK-status\", key: \"action\", dividerRight: true } ]; if (this.showTime) { columns.push({ label: \"Activated\", key: \"time\", sortable: true, compareFunction: (_a, _b, aRow, bRow) => { const aAlert = this.alertByRowId.get(aRow.id); const bAlert = this.alertByRowId.get(bRow.id); if (aAlert && bAlert) { const aTime = new Date(aAlert.time); const bTime = new Date(bAlert.time); return aTime.getTime() - bTime.getTime(); } return 0; } }); } columns.push({ label: \"Tag ID\", key: \"tagId\", sortable: true, compareFunction: (a, b) => { const aText = a?.type === ObcTableCellType.Regular ? String(a.text ?? \"\") : \"\"; const bText = b?.type === ObcTableCellType.Regular ? String(b.text ?? \"\") : \"\"; return aText.localeCompare(bText); } }); return columns; } } get metadata() { return getAlertListModeData(this.selectedMode); } get filteredAlerts() { return this.alerts.filter(this.metadata.filter); } buildVisibleRows() { const alerts = this.filteredAlerts; const alertIds = new Set(alerts.map((alert) => alert.id)); const membersByGroupId = /* @__PURE__ */ new Map(); const roots = []; for (const alert of alerts) { const groupIds = (alert.memberOf ?? []).filter( (groupId) => groupId !== alert.id && alertIds.has(groupId) ); if (groupIds.length === 0) { roots.push(alert); continue; } for (const groupId of groupIds) { const members = membersByGroupId.get(groupId) ?? []; members.push(alert); membersByGroupId.set(groupId, members); } } const reachable = /* @__PURE__ */ new Set(); const markReachable = (alert) => { if (reachable.has(alert.id)) { return; } reachable.add(alert.id); for (const member of membersByGroupId.get(alert.id) ?? []) { markReachable(member); } }; roots.forEach(markReachable); for (const alert of alerts) { if (!reachable.has(alert.id)) { roots.push(alert); markReachable(alert); } } const rows = []; this.alertByRowId = /* @__PURE__ */ new Map(); const visit = (alert, level, parentRowId, ancestors) => { const segment = encodeURIComponent(alert.id); const rowId = parentRowId === void 0 ? segment : `${parentRowId}/${segment}`; const members = membersByGroupId.get(alert.id) ?? []; const expandableMembers = members.filter( (member) => !ancestors.has(member.id) ); const expanded = this.isExpanded(rowId); this.alertByRowId.set(rowId, alert); rows.push({ ...this.buildRowCells(alert), id: rowId, parentId: parentRowId, level, expandable: expandableMembers.length > 0, expanded }); if (!expanded) { return; } const nextAncestors = new Set(ancestors).add(alert.id); for (const member of expandableMembers) { visit(member, level + 1, rowId, nextAncestors); } }; for (const alert of roots) { visit(alert, 0, void 0, /* @__PURE__ */ new Set()); } return rows; } buildRowCells(alert) { let action = { type: ObcTableCellType.Regular }; if (!isAcknowledged(alert) && isActive(alert) && requiresAcknowledgement(alert.type)) { if (alert.noAck) { const icon = usesAlarmNoAckIcon(alert.type) ? html`<obi-alarm-noack-iec usecsscolor></obi-alarm-noack-iec>` : html`<obi-warning-noack-iec usecsscolor></obi-warning-noack-iec>`; action = { type: ObcTableCellType.Regular, largeIcon: true, icon, align: \"center\" }; } else { action = { type: ObcTableCellType.Button, text: msg(\"ACK\") }; } } const status = { type: ObcTableCellType.Regular, largeIcon: true, text: alert.text, title: alert.source, noWrap: true, icon: html`<obc-alert-icon .type=${alert.type} .acknowledged=${isAcknowledged(alert)} .active=${isActive(alert)} ></obc-alert-icon>` }; const time = this.showTime ? { type: ObcTableCellType.Regular, text: this.timeFormatter(alert.time), align: \"center\", neutral: true } : void 0; const tagId = this.small ? void 0 : { type: ObcTableCellType.Regular, text: \"#\" + alert.id, align: \"right\" }; return { status, time, action, tagId }; } render() { const selectedList = this.metadata; const data = this.buildVisibleRows(); return html` <div class=\"wrapper ${this.small ? \"small\" : \"\"}\"> ${data.length > 0 ? html` <obc-table class=\"alert-list\" .data=${data} .columns=${this.columns} .striped=${true} .showHeader=${!this.small} @row-click=${this.onRowClick} @cell-button-click=${this.onCellButtonClick} @expand-toggle=${this.onExpandToggle} ></obc-table> <div class=\"spacer\"></div>` : html` <div class=\"empty-list\"> <div class=\"icon\">${selectedList.emptyIcon}</div> <div class=\"empty-title\">${selectedList.emptyTitle}</div> </div>`} </div> `; } }"
|
|
4911
|
+
}
|
|
4912
|
+
],
|
|
4913
|
+
"exports": [
|
|
4914
|
+
{
|
|
4915
|
+
"kind": "js",
|
|
4916
|
+
"name": "AlertListMode",
|
|
4917
|
+
"declaration": {
|
|
4918
|
+
"name": "AlertListMode",
|
|
4919
|
+
"module": "dist/components/alert-list-details-experimental/alert-list-details-experimental.js"
|
|
4920
|
+
}
|
|
4921
|
+
},
|
|
4922
|
+
{
|
|
4923
|
+
"kind": "js",
|
|
4924
|
+
"name": "ObcAlertListDetailsExperimental",
|
|
4925
|
+
"declaration": {
|
|
4926
|
+
"name": "ObcAlertListDetailsExperimental",
|
|
4927
|
+
"module": "dist/components/alert-list-details-experimental/alert-list-details-experimental.js"
|
|
4928
|
+
}
|
|
4929
|
+
},
|
|
4930
|
+
{
|
|
4931
|
+
"kind": "js",
|
|
4932
|
+
"name": "canAckFilter",
|
|
4933
|
+
"declaration": {
|
|
4934
|
+
"name": "canAckFilter",
|
|
4935
|
+
"module": "dist/components/alert-list-details-experimental/alert-list-details-experimental.js"
|
|
4936
|
+
}
|
|
4937
|
+
},
|
|
4938
|
+
{
|
|
4939
|
+
"kind": "js",
|
|
4940
|
+
"name": "getAlertListModeData",
|
|
4941
|
+
"declaration": {
|
|
4942
|
+
"name": "getAlertListModeData",
|
|
4943
|
+
"module": "dist/components/alert-list-details-experimental/alert-list-details-experimental.js"
|
|
4944
|
+
}
|
|
4945
|
+
}
|
|
4946
|
+
]
|
|
4947
|
+
},
|
|
4903
4948
|
{
|
|
4904
4949
|
"kind": "javascript-module",
|
|
4905
4950
|
"path": "dist/components/alert-list-details/alert-list-details.js",
|
|
@@ -7706,7 +7751,7 @@
|
|
|
7706
7751
|
{
|
|
7707
7752
|
"kind": "variable",
|
|
7708
7753
|
"name": "ObcTable",
|
|
7709
|
-
"default": "class extends LitElement { constructor() { super(...arguments); this.data = []; this.columns = []; this.rowDivider = false; this.narrowHeader = false; this.showHeader = true; this.striped = false; this.selectable = false; this.selectAllAriaLabel = \"Select all rows\"; this._sortByColumnIdx = void 0; this._sortDirection = \"asc\"; this._selectedRowIds = /* @__PURE__ */ new Set(); this._previousPositions = []; this._hasRenderedRows = false; } get sortedData() { if (this._sortByColumnIdx === void 0) { return this.data; } const sortByColumn = this.columns[this._sortByColumnIdx]; if (sortByColumn === void 0) { console.warn(\"Sort by column is undefined\"); return this.data; } const sortDirection = this._sortDirection; const sortedData = [...this.data]; sortedData.sort((a, b) => { const aValue = a[sortByColumn.key]; const bValue = b[sortByColumn.key]; if (sortDirection === \"asc\") { return sortByColumn.compareFunction( aValue, bValue, a, b ); } else { return sortByColumn.compareFunction( bValue, aValue, b, a ); } }); return sortedData; } _handleSortClick(column) { if (!column.sortable) { return; } const newSortColumnIdx = this.columns.indexOf(column); if (newSortColumnIdx === this._sortByColumnIdx) { this._sortDirection = this._sortDirection === \"asc\" ? \"desc\" : \"asc\"; } else { this._sortByColumnIdx = newSortColumnIdx; this._sortDirection = \"asc\"; } } _handleRowClick(row) { this.dispatchEvent( new CustomEvent(\"row-click\", { detail: { row } }) ); } _focusFirstRow() { const firstRow = this.renderRoot.querySelector( 'button[role=\"row\"].grid-row' ); firstRow?.focus(); } _focusLeftHeaderItem() { this._focusHeaderByIndex(0); } _focusHeaderByIndex(index) { const headers = Array.from( this.renderRoot.querySelectorAll( '.grid-header [role=\"columnheader\"]' ) ); if (headers.length === 0) return; const clampedIndex = Math.max(0, Math.min(index, headers.length - 1)); const headerItem = headers[clampedIndex]; const innerButton = headerItem.shadowRoot?.querySelector(\"button\") ?? null; (innerButton ?? headerItem).focus(); } _handleHeaderKeyDown(event) { const key = event.key; if (key === \"ArrowDown\") { this._focusFirstRow(); event.preventDefault(); event.stopPropagation(); return; } if (key !== \"ArrowLeft\" && key !== \"ArrowRight\") { return; } const headers = Array.from( this.renderRoot.querySelectorAll( '.grid-header [role=\"columnheader\"]' ) ); if (headers.length === 0) return; const currentHeaderEl = event.currentTarget; const currentIndex = currentHeaderEl ? headers.indexOf(currentHeaderEl) : -1; if (currentIndex === -1) return; const nextIndex = key === \"ArrowRight\" ? Math.min(currentIndex + 1, headers.length - 1) : Math.max(currentIndex - 1, 0); if (nextIndex !== currentIndex) { this._focusHeaderByIndex(nextIndex); event.preventDefault(); event.stopPropagation(); } } _handleRowKeyDown(event) { const key = event.key; if (key !== \"ArrowDown\" && key !== \"ArrowUp\" && key !== \"Home\" && key !== \"End\") { return; } const target = event.currentTarget; if (!target) return; const rows = Array.from( this.renderRoot.querySelectorAll( 'button[role=\"row\"].grid-row' ) ); const currentIndex = rows.indexOf(target); if (currentIndex === -1) return; let nextIndex = currentIndex; switch (key) { case \"ArrowDown\": nextIndex = Math.min(currentIndex + 1, rows.length - 1); break; case \"ArrowUp\": if (currentIndex === 0) { this._focusLeftHeaderItem(); event.preventDefault(); event.stopPropagation(); return; } nextIndex = Math.max(currentIndex - 1, 0); break; case \"Home\": nextIndex = 0; break; case \"End\": nextIndex = rows.length - 1; break; } if (nextIndex !== currentIndex) { rows[nextIndex]?.focus(); event.preventDefault(); event.stopPropagation(); } else if (key === \"Home\" || key === \"End\") { event.preventDefault(); event.stopPropagation(); } } _getAllPositions() { const rows = Array.from( this.renderRoot.querySelectorAll( 'button[role=\"row\"].grid-row' ) ); const firstRow = rows[0]; if (!firstRow) { return []; } const firstRowRect = firstRow.getBoundingClientRect(); const firstRowHeight = firstRowRect.height; const computedStyle = getComputedStyle(firstRow); const computedHeight = parseFloat(computedStyle.height); const zoomFactor = computedHeight / firstRowHeight; return rows.map((row) => { const rect = row.getBoundingClientRect(); return { top: rect.top * zoomFactor, height: rect.height * zoomFactor, index: row.getAttribute(\"data-row-id\") ?? \"\", element: row }; }); } _animateRowChanges() { const previousPositions = this._previousPositions; const currentPositions = this._getAllPositions(); currentPositions.forEach((el) => { const previousPosition = previousPositions.find( (p) => p.index === el.index ); if (!previousPosition) { el.element.style.transform = `translateY(-${el.height}px)`; el.element.style.opacity = \"0\"; } else { el.element.style.transform = `translateY(${previousPosition.top - el.top}px)`; } el.element.style.transition = \"none\"; el.element.offsetHeight; el.element.style.transition = \"transform 100ms ease-in-out, opacity 100ms ease-in-out\"; el.element.style.transform = \"translateY(0px)\"; el.element.style.opacity = \"1\"; }); this._previousPositions = currentPositions; } willUpdate(changedProperties) { if (changedProperties.has(\"defaultSelectedRowIds\")) { if (this.selectedRowIds === void 0 && this._selectedRowIds.size === 0) { this._selectedRowIds = new Set(this.defaultSelectedRowIds ?? []); } } if (changedProperties.has(\"selectedRowIds\")) { if (this.selectedRowIds !== void 0) { this._selectedRowIds = new Set(this.selectedRowIds); } } if (changedProperties.has(\"data\")) { const availableIds = new Set(this.data.map((row) => row.id)); this._selectedRowIds.forEach((id) => { if (!availableIds.has(id)) { this._selectedRowIds.delete(id); } }); } if (changedProperties.has(\"data\") || changedProperties.has(\"_sortByColumnIdx\") || changedProperties.has(\"_sortDirection\")) { if (this._hasRenderedRows) { this._updatePositions(); } else { this.updateComplete.then(() => { this._hasRenderedRows = true; }); } } } updated(changedProperties) { if (changedProperties.has(\"columns\")) { this._sortByColumnIdx = this.columns.findIndex( (col) => \"sortDirection\" in col && col.sortDirection !== void 0 ); if (this._sortByColumnIdx === -1) { this._sortByColumnIdx = void 0; this._sortDirection = \"asc\"; } else { this._sortDirection = this.columns[this._sortByColumnIdx]?.sortDirection ?? \"asc\"; } } if (changedProperties.has(\"data\") || changedProperties.has(\"_sortByColumnIdx\") || changedProperties.has(\"_sortDirection\")) { if (this._hasRenderedRows) { this._animateRowChanges(); } } } _updatePositions() { const positions = this._getAllPositions(); this._previousPositions = positions; } render() { const effectiveColumns = this.selectable ? [ { label: \"\", key: \"__selection__\" }, ...this.columns ] : this.columns; const selectionColumnCount = this.selectable ? Math.max(0, effectiveColumns.length - 1) : effectiveColumns.length; return html` <div class=${classMap({ \"grid-container\": true, \"has-selection-column\": this.selectable })} part=\"grid\" style=\" --grid-columns: ${effectiveColumns.length}; --grid-columns-rest: ${selectionColumnCount}; --selection-column-width: var(--menu-navigation-components-table-item-touch-target-size); \" role=\"table\" > ${this.showHeader ? html` <div class=\"grid-header\" role=\"row\"> ${effectiveColumns.map((col) => { const isSelectionColumn = this.selectable && col.key === \"__selection__\"; const isNotLast = effectiveColumns.indexOf(col) !== effectiveColumns.length - 1; const icon = col.renderHeaderIcon ? html`<span slot=\"leading-icon\" >${col.renderHeaderIcon()}</span >` : nothing; const columnIndex = this.columns.findIndex( (column) => column.key === col.key ); const sorted = \"sortable\" in col && col.sortable && this._sortByColumnIdx === columnIndex; const sortDirection = sorted ? this._sortDirection : \"none\"; const headerType = col.headerType ?? (this.narrowHeader ? ObcTableHeaderItemType.Narrow : ObcTableHeaderItemType.Regular); if (\"sortable\" in col && col.sortable && !isSelectionColumn) { return html`<obc-table-header-item role=\"columnheader\" class=${isSelectionColumn ? \"selection-header\" : \"\"} .showDivider=${isNotLast} ?hasLeadingIcon=${icon !== nothing} .sortDirection=${sortDirection} .sortable=${true} type=${headerType} @click=${() => this._handleSortClick( col )} @keydown=${this._handleHeaderKeyDown} >${icon}${col.label}</obc-table-header-item > `; } else { if (isSelectionColumn) { return html`<div role=\"columnheader\" class=${classMap({ \"selection-header\": true })} tabindex=\"0\" @keydown=${this._handleHeaderKeyDown} > <obc-checkbox .status=${this._getSelectionStatus()} .disabled=${false} aria-label=${this.selectAllAriaLabel} @click=${(event) => { event.preventDefault(); event.stopPropagation(); }} @change=${() => this._toggleAllSelection()} ></obc-checkbox> </div>`; } return html`<obc-table-header-item role=\"columnheader\" class=${isSelectionColumn ? \"selection-header\" : \"\"} .showDivider=${isNotLast} ?hasLeadingIcon=${icon !== nothing} type=${headerType} >${icon}${col.label}</obc-table-header-item >`; } })} </div> <div class=\"grid-header-divider\"></div> ` : nothing} <div class=\"grid-body\" part=\"body\" style=\"grid-template-rows: repeat(${this.sortedData.length}, min-content)\" > ${repeat( this.sortedData, (row) => row.id, (row, rowIndex) => { const hasDivider = this.rowDivider && this.data.length - 1 !== rowIndex; const isStriped = this.striped && rowIndex % 2 === 1; const isRowSelected = (row.selected ?? false) || this.selectable && this._selectedRowIds.has(row.id); const previousRow = rowIndex > 0 ? this.sortedData[rowIndex - 1] : void 0; const nextRow = rowIndex < this.sortedData.length - 1 ? this.sortedData[rowIndex + 1] : void 0; const hasSelectedPreviousRow = previousRow !== void 0 && ((previousRow.selected ?? false) || this.selectable && this._selectedRowIds.has(previousRow.id)); const hasSelectedNextRow = nextRow !== void 0 && ((nextRow.selected ?? false) || this.selectable && this._selectedRowIds.has(nextRow.id)); return html` <button role=\"row\" class=${classMap({ \"grid-row\": true, selected: isRowSelected, \"selected-with-prev\": isRowSelected && hasSelectedPreviousRow, \"selected-with-next\": isRowSelected && hasSelectedNextRow, striped: isStriped })} @click=${() => this._handleRowClick(row)} @keydown=${this._handleRowKeyDown} data-row-id=${row.id} style=\"grid-row: ${rowIndex + 1}\" part=\"row\" > ${map(effectiveColumns, (col) => { if (this.selectable && col.key === \"__selection__\") { const checked = this._selectedRowIds.has(row.id); return html`<div class=\"grid-cell checkbox align-center selection\" role=\"cell\" > <obc-checkbox .status=${checked ? CheckboxStatus.checked : CheckboxStatus.unchecked} .disabled=${false} aria-label=${`Select row ${row.id}`} @click=${(event) => { event.preventDefault(); event.stopPropagation(); }} @change=${() => this._toggleRowSelection(row.id)} ></obc-checkbox> </div>`; } const value = row[col.key]; if (value === void 0) { return html`<div class=\"grid-cell\" role=\"cell\"></div>`; } if (col.renderCell) { return html`<div class=\"grid-cell ${col.dividerRight ? \"divider-right\" : \"\"}\" role=\"cell\" part=${ifDefined(value.cssPart)} > ${col.renderCell( value, row, row.id )} </div>`; } else { return this._renderCell( value, row, col ); } })} ${hasDivider ? html`<div class=\"grid-row-divider\"></div>` : nothing} </button> `; } )} ${repeat( effectiveColumns, (col) => col.key, (col, colIndex) => col.dividerRight ? html`<div class=\"grid-column-divider\" style=\"grid-column: ${colIndex + 1}; grid-row: 1/${this.sortedData.length + 1}\" ></div>` : nothing )} </div> </div> `; } getAllVisibleRows() { const rows = Array.from( this.renderRoot.querySelectorAll( 'button[role=\"row\"].grid-row' ) ); const bodyRect = this.renderRoot.querySelector(\".grid-body\")?.getBoundingClientRect(); if (!bodyRect) { return []; } const scrollTop = bodyRect.top; const scrollHeight = bodyRect.height; const scrollBottom = scrollTop + scrollHeight; return rows.filter((el) => el.checkVisibility()).filter( (el) => el.getBoundingClientRect().top >= scrollTop && el.getBoundingClientRect().bottom <= scrollBottom ).map((row) => row.getAttribute(\"data-row-id\")).filter((id) => id !== null); } _handleCellButtonClick(event, row, columnKey) { event.preventDefault(); event.stopPropagation(); const e = new CustomEvent(\"cell-button-click\", { detail: { rowId: row.id, columnKey } }); this.dispatchEvent(e); } _handleCellTagClick(event, row, columnKey, tagId) { event.preventDefault(); event.stopPropagation(); const e = new CustomEvent(\"cell-tag-click\", { detail: { rowId: row.id, columnKey, tagId } }); this.dispatchEvent(e); } _handleCellCheckboxChange(event, row, columnKey) { event.preventDefault(); event.stopPropagation(); const e = new CustomEvent( \"cell-checkbox-change\", { detail: { rowId: row.id, columnKey, status: event.detail.status, disabled: event.detail.disabled } } ); this.dispatchEvent(e); } _getSelectableRowIds() { return this.data.map((row) => row.id); } _getSelectionStatus() { const rowIds = this._getSelectableRowIds(); if (rowIds.length === 0) return CheckboxStatus.unchecked; const selectedCount = rowIds.filter( (id) => this._selectedRowIds.has(id) ).length; if (selectedCount === 0) return CheckboxStatus.unchecked; if (selectedCount === rowIds.length) return CheckboxStatus.checked; return CheckboxStatus.mixed; } _emitSelectionChange(selectedRowIds, source) { const selectedRows = this.data.filter( (row) => selectedRowIds.includes(row.id) ); const e = new CustomEvent( \"selection-change\", { detail: { selectedRowIds, selectedRows, source } } ); this.dispatchEvent(e); } _applySelectionChange(nextSelection, source) { const selectedRowIds = Array.from(nextSelection); this._emitSelectionChange(selectedRowIds, source); if (this.selectedRowIds === void 0) { this._selectedRowIds = nextSelection; this.requestUpdate(); } } _toggleRowSelection(rowId) { const nextSelection = new Set(this._selectedRowIds); if (nextSelection.has(rowId)) { nextSelection.delete(rowId); } else { nextSelection.add(rowId); } this._applySelectionChange(nextSelection, \"row\"); } _toggleAllSelection() { const rowIds = this._getSelectableRowIds(); const status = this._getSelectionStatus(); const nextSelection = status === CheckboxStatus.checked ? /* @__PURE__ */ new Set() : new Set(rowIds); this._applySelectionChange(nextSelection, \"header\"); } _renderCell(value, row, column) { if (value.type === \"regular\") { return html`<div class=${classMap({ \"grid-cell\": true, regular: true, neutral: value.neutral ?? false, \"large-icon\": value.largeIcon ?? false, \"no-wrap\": value.noWrap ?? false, [`align-${value.align ?? \"left\"}`]: true, \"divider-right\": column.dividerRight ?? false, vertical: value.vertical ?? false })} role=\"cell\" part=${ifDefined(cssPart(value, \"cell\"))} > ${value.icon3 ? html`<span class=\"icon\" part=${ifDefined(cssPart(value, \"icon3\"))} >${value.icon3}</span >` : nothing} ${value.icon2 ? html`<span class=\"icon\" part=${ifDefined(cssPart(value, \"icon2\"))} >${value.icon2}</span >` : nothing} ${value.icon ? html`<span class=\"icon\" part=${ifDefined(cssPart(value, \"icon\"))} >${value.icon}</span >` : nothing} ${value.title ? html`<span class=\"title\" part=${ifDefined(cssPart(value, \"title\"))} >${value.title}</span >` : nothing} ${value.text ? html`<span part=${ifDefined(cssPart(value, \"text\"))} >${value.text}</span >` : nothing} </div>`; } else if (value.type === \"button\") { return html`<div class=\"grid-cell button ${column.dividerRight ? \"divider-right\" : \"\"}\" role=\"cell\" > <obc-button variant=\"normal\" fullWidth .disabled=${value.disabled ?? false} ?showLeadingIcon=${value.icon !== void 0} part=${ifDefined(cssPart(value, \"button\"))} @click=${(event) => this._handleCellButtonClick(event, row, column.key)} > ${value.icon ? html`<span slot=\"leading-icon\" part=${ifDefined(cssPart(value, \"icon\"))} >${value.icon}</span >` : nothing} ${value.text ? html`<span part=${ifDefined(cssPart(value, \"text\"))} >${value.text}</span >` : nothing} </obc-button> </div>`; } else if (value.type === \"checkbox\") { const checkboxLabel = value.label ?? value.text ?? \"\"; const ariaLabel = checkboxLabel.trim() || column.label?.trim() || \"Checkbox\"; return html`<div class=${classMap({ \"grid-cell\": true, checkbox: true, [`align-${value.align ?? \"center\"}`]: true, \"divider-right\": column.dividerRight ?? false })} role=\"cell\" part=${ifDefined(cssPart(value, \"cell\"))} > <obc-checkbox .status=${value.status ?? CheckboxStatus.unchecked} .disabled=${value.disabled ?? false} aria-describedby=${ifDefined(value.ariaDescribedBy)} aria-label=${ariaLabel} part=${ifDefined(cssPart(value, \"checkbox\"))} @click=${(event) => { event.preventDefault(); event.stopPropagation(); }} @change=${(event) => this._handleCellCheckboxChange(event, row, column.key)} ></obc-checkbox> </div>`; } else if (value.type === \"tag\") { const tags = value.tags ?? (value.tag ? [value.tag] : void 0) ?? [ { id: value.tagId ?? \"tag\", label: value.label ?? value.text ?? \"Label\", color: value.color, hasIcon: value.hasIcon, icon: value.icon } ]; const wrap = value.wrap ?? value.tags !== void 0; const defaultMaxTags = value.tags ? 2 : void 0; const maxTags = (value.maxTags ?? defaultMaxTags) !== void 0 ? Math.max(0, Math.floor(value.maxTags ?? defaultMaxTags ?? 0)) : void 0; const visibleTags = maxTags !== void 0 ? tags.slice(0, maxTags) : tags; const overflowCount = maxTags !== void 0 ? Math.max(0, tags.length - maxTags) : 0; const overflowLabel = value.overflowLabel ?? `+${overflowCount.toString()}`; return html`<div class=${classMap({ \"grid-cell\": true, tags: tags.length > 1, wrap, [`align-${value.align ?? \"left\"}`]: true, \"divider-right\": column.dividerRight ?? false })} role=\"cell\" part=${ifDefined(cssPart(value, \"cell\"))} > ${visibleTags.map((tag) => { const hasIcon = tag.hasIcon ?? tag.icon !== void 0; return html`<obc-tag .label=${tag.label} color=${tag.color ?? TagColor.gray} ?hasIcon=${hasIcon} part=${ifDefined( [cssPart(value, \"tag\"), tag.cssPart].filter(Boolean).join(\" \") || void 0 )} @click=${(event) => this._handleCellTagClick(event, row, column.key, tag.id)} > ${hasIcon && tag.icon ? tag.icon : nothing} </obc-tag>`; })} ${overflowCount > 0 ? html`<span class=\"tag-overflow\" part=${ifDefined(cssPart(value, \"tag-overflow\"))} >${overflowLabel}</span >` : nothing} </div>`; } else if (value.type === \"horizontal-bar\") { const hasBar = value.hasBar ?? true; const hasScale = value.hasScale ?? false; const showLabels = !(value.hideLabels ?? true); const fixedAspectRatio = value.fixedAspectRatio ?? true; return html`<div class=${classMap({ \"grid-cell\": true, \"horizontal-bar\": true, [`align-${value.align ?? \"left\"}`]: true, \"divider-right\": column.dividerRight ?? false })} role=\"cell\" part=${ifDefined(cssPart(value, \"cell\"))} > <obc-bar-horizontal .minValue=${value.minValue ?? 0} .maxValue=${value.maxValue ?? 100} .value=${value.value} .setpoint=${value.setpoint} .hasBar=${hasBar} .hasScale=${hasScale} .showLabels=${showLabels} .priority=${value.priority ?? Priority.regular} .fillMode=${value.fillMode ?? FillMode.fill} .fillMin=${value.fillMin} .fillMax=${value.fillMax} .barThickness=${value.barThickness ?? 24} .scaleType=${value.scaleType ?? ScaleType.regular} .frameStyle=${value.frameStyle ?? FrameStyle.regular} .side=${value.side ?? ExternalScaleSide.bottom} .state=${value.state ?? InstrumentState.active} .fixedAspectRatio=${fixedAspectRatio} .scaleReferenceSize=${value.scaleReferenceSize ?? 384} part=${ifDefined(cssPart(value, \"bar\"))} ></obc-bar-horizontal> </div>`; } else { return nothing; } } }"
|
|
7754
|
+
"default": "class extends LitElement { constructor() { super(...arguments); this.data = []; this.columns = []; this.rowDivider = false; this.narrowHeader = false; this.showHeader = true; this.striped = false; this.selectable = false; this.selectAllAriaLabel = \"Select all rows\"; this._sortByColumnIdx = void 0; this._sortDirection = \"asc\"; this._selectedRowIds = /* @__PURE__ */ new Set(); this._previousPositions = []; this._hasRenderedRows = false; } get hasHierarchy() { return this.data.some( (row) => row.parentId !== void 0 || (row.level ?? 0) > 0 || row.expandable === true ); } sortWithinSiblings(rows, compare) { const ids = new Set(rows.map((row) => row.id)); const childrenByParent = /* @__PURE__ */ new Map(); const roots = []; for (const row of rows) { const parentId = row.parentId; if (parentId !== void 0 && parentId !== row.id && ids.has(parentId)) { const siblings = childrenByParent.get(parentId) ?? []; siblings.push(row); childrenByParent.set(parentId, siblings); } else { roots.push(row); } } const sorted = []; const visited = /* @__PURE__ */ new Set(); const visit = (siblings) => { for (const row of [...siblings].sort(compare)) { if (visited.has(row.id)) { continue; } visited.add(row.id); sorted.push(row); visit(childrenByParent.get(row.id) ?? []); } }; visit(roots); visit(rows.filter((row) => !visited.has(row.id))); return sorted; } get sortedData() { if (this._sortByColumnIdx === void 0) { return this.data; } const sortByColumn = this.columns[this._sortByColumnIdx]; if (sortByColumn === void 0) { console.warn(\"Sort by column is undefined\"); return this.data; } const sortDirection = this._sortDirection; const compare = (a, b) => { const aValue = a[sortByColumn.key]; const bValue = b[sortByColumn.key]; if (sortDirection === \"asc\") { return sortByColumn.compareFunction( aValue, bValue, a, b ); } else { return sortByColumn.compareFunction( bValue, aValue, b, a ); } }; if (this.hasHierarchy) { return this.sortWithinSiblings(this.data, compare); } const sortedData = [...this.data]; sortedData.sort(compare); return sortedData; } _handleSortClick(column) { if (!column.sortable) { return; } const newSortColumnIdx = this.columns.indexOf(column); if (newSortColumnIdx === this._sortByColumnIdx) { this._sortDirection = this._sortDirection === \"asc\" ? \"desc\" : \"asc\"; } else { this._sortByColumnIdx = newSortColumnIdx; this._sortDirection = \"asc\"; } } _handleRowClick(row) { this.dispatchEvent( new CustomEvent(\"row-click\", { detail: { row } }) ); } _handleExpandToggle(row, expanded) { if (!row.expandable) { return; } this.dispatchEvent( new CustomEvent(\"expand-toggle\", { detail: { rowId: row.id, expanded } }) ); } _renderRowExpander(row) { if (!this.hasHierarchy) { return nothing; } const level = row.level ?? 0; return html`<span class=\"row-expander\" style=\"--row-level: ${level}\" aria-hidden=\"true\" > ${row.expandable ? html`<span class=${classMap({ chevron: true, expanded: row.expanded ?? false })} @click=${(event) => { event.preventDefault(); event.stopPropagation(); this._handleExpandToggle(row, !(row.expanded ?? false)); }} > <obi-chevron-right-google></obi-chevron-right-google> </span>` : nothing} </span>`; } _focusFirstRow() { const firstRow = this.renderRoot.querySelector( 'button[role=\"row\"].grid-row' ); firstRow?.focus(); } _focusLeftHeaderItem() { this._focusHeaderByIndex(0); } _focusHeaderByIndex(index) { const headers = Array.from( this.renderRoot.querySelectorAll( '.grid-header [role=\"columnheader\"]' ) ); if (headers.length === 0) return; const clampedIndex = Math.max(0, Math.min(index, headers.length - 1)); const headerItem = headers[clampedIndex]; const innerButton = headerItem.shadowRoot?.querySelector(\"button\") ?? null; (innerButton ?? headerItem).focus(); } _handleHeaderKeyDown(event) { const key = event.key; if (key === \"ArrowDown\") { this._focusFirstRow(); event.preventDefault(); event.stopPropagation(); return; } if (key !== \"ArrowLeft\" && key !== \"ArrowRight\") { return; } const headers = Array.from( this.renderRoot.querySelectorAll( '.grid-header [role=\"columnheader\"]' ) ); if (headers.length === 0) return; const currentHeaderEl = event.currentTarget; const currentIndex = currentHeaderEl ? headers.indexOf(currentHeaderEl) : -1; if (currentIndex === -1) return; const nextIndex = key === \"ArrowRight\" ? Math.min(currentIndex + 1, headers.length - 1) : Math.max(currentIndex - 1, 0); if (nextIndex !== currentIndex) { this._focusHeaderByIndex(nextIndex); event.preventDefault(); event.stopPropagation(); } } _handleRowKeyDown(event) { const key = event.key; if (this.hasHierarchy && (key === \"ArrowRight\" || key === \"ArrowLeft\") && this._handleRowExpandKey(event, key)) { return; } if (key !== \"ArrowDown\" && key !== \"ArrowUp\" && key !== \"Home\" && key !== \"End\") { return; } const target = event.currentTarget; if (!target) return; const rows = Array.from( this.renderRoot.querySelectorAll( 'button[role=\"row\"].grid-row' ) ); const currentIndex = rows.indexOf(target); if (currentIndex === -1) return; let nextIndex = currentIndex; switch (key) { case \"ArrowDown\": nextIndex = Math.min(currentIndex + 1, rows.length - 1); break; case \"ArrowUp\": if (currentIndex === 0) { this._focusLeftHeaderItem(); event.preventDefault(); event.stopPropagation(); return; } nextIndex = Math.max(currentIndex - 1, 0); break; case \"Home\": nextIndex = 0; break; case \"End\": nextIndex = rows.length - 1; break; } if (nextIndex !== currentIndex) { rows[nextIndex]?.focus(); event.preventDefault(); event.stopPropagation(); } else if (key === \"Home\" || key === \"End\") { event.preventDefault(); event.stopPropagation(); } } _handleRowExpandKey(event, key) { const target = event.currentTarget; const rowId = target?.dataset.rowId; const row = this.sortedData.find((candidate) => candidate.id === rowId); if (!row) return false; const expanded = row.expanded ?? false; if (key === \"ArrowRight\" && row.expandable && !expanded) { this._handleExpandToggle(row, true); } else if (key === \"ArrowLeft\" && row.expandable && expanded) { this._handleExpandToggle(row, false); } else if (key === \"ArrowLeft\") { const parent = this.renderRoot.querySelector( `button[role=\"row\"].grid-row[data-row-id=\"${CSS.escape( row.parentId ?? \"\" )}\"]` ); if (!parent) return false; parent.focus(); } else { return false; } event.preventDefault(); event.stopPropagation(); return true; } _getAllPositions() { const rows = Array.from( this.renderRoot.querySelectorAll( 'button[role=\"row\"].grid-row' ) ); const firstRow = rows[0]; if (!firstRow) { return []; } const firstRowRect = firstRow.getBoundingClientRect(); const firstRowHeight = firstRowRect.height; const computedStyle = getComputedStyle(firstRow); const computedHeight = parseFloat(computedStyle.height); const zoomFactor = computedHeight / firstRowHeight; return rows.map((row) => { const rect = row.getBoundingClientRect(); return { top: rect.top * zoomFactor, height: rect.height * zoomFactor, index: row.getAttribute(\"data-row-id\") ?? \"\", element: row }; }); } _animateRowChanges() { const previousPositions = this._previousPositions; const currentPositions = this._getAllPositions(); currentPositions.forEach((el) => { const previousPosition = previousPositions.find( (p) => p.index === el.index ); if (!previousPosition) { el.element.style.transform = `translateY(-${el.height}px)`; el.element.style.opacity = \"0\"; } else { el.element.style.transform = `translateY(${previousPosition.top - el.top}px)`; } el.element.style.transition = \"none\"; el.element.offsetHeight; el.element.style.transition = \"transform 100ms ease-in-out, opacity 100ms ease-in-out\"; el.element.style.transform = \"translateY(0px)\"; el.element.style.opacity = \"1\"; }); this._previousPositions = currentPositions; } willUpdate(changedProperties) { if (changedProperties.has(\"defaultSelectedRowIds\")) { if (this.selectedRowIds === void 0 && this._selectedRowIds.size === 0) { this._selectedRowIds = new Set(this.defaultSelectedRowIds ?? []); } } if (changedProperties.has(\"selectedRowIds\")) { if (this.selectedRowIds !== void 0) { this._selectedRowIds = new Set(this.selectedRowIds); } } if (changedProperties.has(\"data\")) { const availableIds = new Set(this.data.map((row) => row.id)); this._selectedRowIds.forEach((id) => { if (!availableIds.has(id)) { this._selectedRowIds.delete(id); } }); } if (changedProperties.has(\"data\") || changedProperties.has(\"_sortByColumnIdx\") || changedProperties.has(\"_sortDirection\")) { if (this._hasRenderedRows) { this._updatePositions(); } else { this.updateComplete.then(() => { this._hasRenderedRows = true; }); } } } updated(changedProperties) { if (changedProperties.has(\"columns\")) { this._sortByColumnIdx = this.columns.findIndex( (col) => \"sortDirection\" in col && col.sortDirection !== void 0 ); if (this._sortByColumnIdx === -1) { this._sortByColumnIdx = void 0; this._sortDirection = \"asc\"; } else { this._sortDirection = this.columns[this._sortByColumnIdx]?.sortDirection ?? \"asc\"; } } if (changedProperties.has(\"data\") || changedProperties.has(\"_sortByColumnIdx\") || changedProperties.has(\"_sortDirection\")) { if (this._hasRenderedRows) { this._animateRowChanges(); } } } _updatePositions() { const positions = this._getAllPositions(); this._previousPositions = positions; } render() { const effectiveColumns = this.selectable ? [ { label: \"\", key: \"__selection__\" }, ...this.columns ] : this.columns; const selectionColumnCount = this.selectable ? Math.max(0, effectiveColumns.length - 1) : effectiveColumns.length; return html` <div class=${classMap({ \"grid-container\": true, \"has-selection-column\": this.selectable })} part=\"grid\" style=\" --grid-columns: ${effectiveColumns.length}; --grid-columns-rest: ${selectionColumnCount}; --selection-column-width: var(--menu-navigation-components-table-item-touch-target-size); \" role=${this.hasHierarchy ? \"treegrid\" : \"table\"} > ${this.showHeader ? html` <div class=\"grid-header\" role=\"row\"> ${effectiveColumns.map((col) => { const isSelectionColumn = this.selectable && col.key === \"__selection__\"; const isNotLast = effectiveColumns.indexOf(col) !== effectiveColumns.length - 1; const icon = col.renderHeaderIcon ? html`<span slot=\"leading-icon\" >${col.renderHeaderIcon()}</span >` : nothing; const columnIndex = this.columns.findIndex( (column) => column.key === col.key ); const sorted = \"sortable\" in col && col.sortable && this._sortByColumnIdx === columnIndex; const sortDirection = sorted ? this._sortDirection : \"none\"; const headerType = col.headerType ?? (this.narrowHeader ? ObcTableHeaderItemType.Narrow : ObcTableHeaderItemType.Regular); if (\"sortable\" in col && col.sortable && !isSelectionColumn) { return html`<obc-table-header-item role=\"columnheader\" class=${isSelectionColumn ? \"selection-header\" : \"\"} .showDivider=${isNotLast} ?hasLeadingIcon=${icon !== nothing} .sortDirection=${sortDirection} .sortable=${true} type=${headerType} @click=${() => this._handleSortClick( col )} @keydown=${this._handleHeaderKeyDown} >${icon}${col.label}</obc-table-header-item > `; } else { if (isSelectionColumn) { return html`<div role=\"columnheader\" class=${classMap({ \"selection-header\": true })} tabindex=\"0\" @keydown=${this._handleHeaderKeyDown} > <obc-checkbox .status=${this._getSelectionStatus()} .disabled=${false} aria-label=${this.selectAllAriaLabel} @click=${(event) => { event.preventDefault(); event.stopPropagation(); }} @change=${() => this._toggleAllSelection()} ></obc-checkbox> </div>`; } return html`<obc-table-header-item role=\"columnheader\" class=${isSelectionColumn ? \"selection-header\" : \"\"} .showDivider=${isNotLast} ?hasLeadingIcon=${icon !== nothing} type=${headerType} >${icon}${col.label}</obc-table-header-item >`; } })} </div> <div class=\"grid-header-divider\"></div> ` : nothing} <div class=\"grid-body\" part=\"body\" style=\"grid-template-rows: repeat(${this.sortedData.length}, min-content)\" > ${repeat( this.sortedData, (row) => row.id, (row, rowIndex) => { const hasDivider = this.rowDivider && this.data.length - 1 !== rowIndex; const isStriped = this.striped && rowIndex % 2 === 1; const isRowSelected = (row.selected ?? false) || this.selectable && this._selectedRowIds.has(row.id); const previousRow = rowIndex > 0 ? this.sortedData[rowIndex - 1] : void 0; const nextRow = rowIndex < this.sortedData.length - 1 ? this.sortedData[rowIndex + 1] : void 0; const hasSelectedPreviousRow = previousRow !== void 0 && ((previousRow.selected ?? false) || this.selectable && this._selectedRowIds.has(previousRow.id)); const hasSelectedNextRow = nextRow !== void 0 && ((nextRow.selected ?? false) || this.selectable && this._selectedRowIds.has(nextRow.id)); return html` <button role=\"row\" class=${classMap({ \"grid-row\": true, selected: isRowSelected, \"selected-with-prev\": isRowSelected && hasSelectedPreviousRow, \"selected-with-next\": isRowSelected && hasSelectedNextRow, striped: isStriped })} @click=${() => this._handleRowClick(row)} @keydown=${this._handleRowKeyDown} data-row-id=${row.id} style=\"grid-row: ${rowIndex + 1}\" part=\"row\" aria-level=${ifDefined( this.hasHierarchy ? (row.level ?? 0) + 1 : void 0 )} aria-expanded=${ifDefined( row.expandable ? row.expanded ?? false : void 0 )} > ${map(effectiveColumns, (col, colIndex) => { const expander = colIndex === (this.selectable ? 1 : 0) ? this._renderRowExpander(row) : nothing; if (this.selectable && col.key === \"__selection__\") { const checked = this._selectedRowIds.has(row.id); return html`<div class=\"grid-cell checkbox align-center selection\" role=\"cell\" > <obc-checkbox .status=${checked ? CheckboxStatus.checked : CheckboxStatus.unchecked} .disabled=${false} aria-label=${`Select row ${row.id}`} @click=${(event) => { event.preventDefault(); event.stopPropagation(); }} @change=${() => this._toggleRowSelection(row.id)} ></obc-checkbox> </div>`; } const value = row[col.key]; if (value === void 0) { return html`<div class=\"grid-cell\" role=\"cell\"> ${expander} </div>`; } if (col.renderCell) { return html`<div class=\"grid-cell ${col.dividerRight ? \"divider-right\" : \"\"}\" role=\"cell\" part=${ifDefined(value.cssPart)} > ${expander}${col.renderCell( value, row, row.id )} </div>`; } else { return this._renderCell( value, row, col, expander ); } })} ${hasDivider ? html`<div class=\"grid-row-divider\"></div>` : nothing} </button> `; } )} ${repeat( effectiveColumns, (col) => col.key, (col, colIndex) => col.dividerRight ? html`<div class=\"grid-column-divider\" style=\"grid-column: ${colIndex + 1}; grid-row: 1/${this.sortedData.length + 1}\" ></div>` : nothing )} </div> </div> `; } getAllVisibleRows() { const rows = Array.from( this.renderRoot.querySelectorAll( 'button[role=\"row\"].grid-row' ) ); const bodyRect = this.renderRoot.querySelector(\".grid-body\")?.getBoundingClientRect(); if (!bodyRect) { return []; } const scrollTop = bodyRect.top; const scrollHeight = bodyRect.height; const scrollBottom = scrollTop + scrollHeight; return rows.filter((el) => el.checkVisibility()).filter( (el) => el.getBoundingClientRect().top >= scrollTop && el.getBoundingClientRect().bottom <= scrollBottom ).map((row) => row.getAttribute(\"data-row-id\")).filter((id) => id !== null); } _handleCellButtonClick(event, row, columnKey) { event.preventDefault(); event.stopPropagation(); const e = new CustomEvent(\"cell-button-click\", { detail: { rowId: row.id, columnKey } }); this.dispatchEvent(e); } _handleCellTagClick(event, row, columnKey, tagId) { event.preventDefault(); event.stopPropagation(); const e = new CustomEvent(\"cell-tag-click\", { detail: { rowId: row.id, columnKey, tagId } }); this.dispatchEvent(e); } _handleCellCheckboxChange(event, row, columnKey) { event.preventDefault(); event.stopPropagation(); const e = new CustomEvent( \"cell-checkbox-change\", { detail: { rowId: row.id, columnKey, status: event.detail.status, disabled: event.detail.disabled } } ); this.dispatchEvent(e); } _getSelectableRowIds() { return this.data.map((row) => row.id); } _getSelectionStatus() { const rowIds = this._getSelectableRowIds(); if (rowIds.length === 0) return CheckboxStatus.unchecked; const selectedCount = rowIds.filter( (id) => this._selectedRowIds.has(id) ).length; if (selectedCount === 0) return CheckboxStatus.unchecked; if (selectedCount === rowIds.length) return CheckboxStatus.checked; return CheckboxStatus.mixed; } _emitSelectionChange(selectedRowIds, source) { const selectedRows = this.data.filter( (row) => selectedRowIds.includes(row.id) ); const e = new CustomEvent( \"selection-change\", { detail: { selectedRowIds, selectedRows, source } } ); this.dispatchEvent(e); } _applySelectionChange(nextSelection, source) { const selectedRowIds = Array.from(nextSelection); this._emitSelectionChange(selectedRowIds, source); if (this.selectedRowIds === void 0) { this._selectedRowIds = nextSelection; this.requestUpdate(); } } _toggleRowSelection(rowId) { const nextSelection = new Set(this._selectedRowIds); if (nextSelection.has(rowId)) { nextSelection.delete(rowId); } else { nextSelection.add(rowId); } this._applySelectionChange(nextSelection, \"row\"); } _toggleAllSelection() { const rowIds = this._getSelectableRowIds(); const status = this._getSelectionStatus(); const nextSelection = status === CheckboxStatus.checked ? /* @__PURE__ */ new Set() : new Set(rowIds); this._applySelectionChange(nextSelection, \"header\"); } _renderCell(value, row, column, expander = nothing) { if (value.type === \"regular\") { return html`<div class=${classMap({ \"grid-cell\": true, regular: true, neutral: value.neutral ?? false, \"large-icon\": value.largeIcon ?? false, \"no-wrap\": value.noWrap ?? false, [`align-${value.align ?? \"left\"}`]: true, \"divider-right\": column.dividerRight ?? false, vertical: value.vertical ?? false })} role=\"cell\" part=${ifDefined(cssPart(value, \"cell\"))} > ${expander}${value.icon3 ? html`<span class=\"icon\" part=${ifDefined(cssPart(value, \"icon3\"))} >${value.icon3}</span >` : nothing} ${value.icon2 ? html`<span class=\"icon\" part=${ifDefined(cssPart(value, \"icon2\"))} >${value.icon2}</span >` : nothing} ${value.icon ? html`<span class=\"icon\" part=${ifDefined(cssPart(value, \"icon\"))} >${value.icon}</span >` : nothing} ${value.title ? html`<span class=\"title\" part=${ifDefined(cssPart(value, \"title\"))} >${value.title}</span >` : nothing} ${value.text ? html`<span part=${ifDefined(cssPart(value, \"text\"))} >${value.text}</span >` : nothing} </div>`; } else if (value.type === \"button\") { return html`<div class=\"grid-cell button ${column.dividerRight ? \"divider-right\" : \"\"}\" role=\"cell\" > ${expander} <obc-button variant=\"normal\" fullWidth .disabled=${value.disabled ?? false} ?showLeadingIcon=${value.icon !== void 0} part=${ifDefined(cssPart(value, \"button\"))} @click=${(event) => this._handleCellButtonClick(event, row, column.key)} > ${value.icon ? html`<span slot=\"leading-icon\" part=${ifDefined(cssPart(value, \"icon\"))} >${value.icon}</span >` : nothing} ${value.text ? html`<span part=${ifDefined(cssPart(value, \"text\"))} >${value.text}</span >` : nothing} </obc-button> </div>`; } else if (value.type === \"checkbox\") { const checkboxLabel = value.label ?? value.text ?? \"\"; const ariaLabel = checkboxLabel.trim() || column.label?.trim() || \"Checkbox\"; return html`<div class=${classMap({ \"grid-cell\": true, checkbox: true, [`align-${value.align ?? \"center\"}`]: true, \"divider-right\": column.dividerRight ?? false })} role=\"cell\" part=${ifDefined(cssPart(value, \"cell\"))} > ${expander} <obc-checkbox .status=${value.status ?? CheckboxStatus.unchecked} .disabled=${value.disabled ?? false} aria-describedby=${ifDefined(value.ariaDescribedBy)} aria-label=${ariaLabel} part=${ifDefined(cssPart(value, \"checkbox\"))} @click=${(event) => { event.preventDefault(); event.stopPropagation(); }} @change=${(event) => this._handleCellCheckboxChange(event, row, column.key)} ></obc-checkbox> </div>`; } else if (value.type === \"tag\") { const tags = value.tags ?? (value.tag ? [value.tag] : void 0) ?? [ { id: value.tagId ?? \"tag\", label: value.label ?? value.text ?? \"Label\", color: value.color, hasIcon: value.hasIcon, icon: value.icon } ]; const wrap = value.wrap ?? value.tags !== void 0; const defaultMaxTags = value.tags ? 2 : void 0; const maxTags = (value.maxTags ?? defaultMaxTags) !== void 0 ? Math.max(0, Math.floor(value.maxTags ?? defaultMaxTags ?? 0)) : void 0; const visibleTags = maxTags !== void 0 ? tags.slice(0, maxTags) : tags; const overflowCount = maxTags !== void 0 ? Math.max(0, tags.length - maxTags) : 0; const overflowLabel = value.overflowLabel ?? `+${overflowCount.toString()}`; return html`<div class=${classMap({ \"grid-cell\": true, tags: tags.length > 1, wrap, [`align-${value.align ?? \"left\"}`]: true, \"divider-right\": column.dividerRight ?? false })} role=\"cell\" part=${ifDefined(cssPart(value, \"cell\"))} > ${expander}${visibleTags.map((tag) => { const hasIcon = tag.hasIcon ?? tag.icon !== void 0; return html`<obc-tag .label=${tag.label} color=${tag.color ?? TagColor.gray} ?hasIcon=${hasIcon} part=${ifDefined( [cssPart(value, \"tag\"), tag.cssPart].filter(Boolean).join(\" \") || void 0 )} @click=${(event) => this._handleCellTagClick(event, row, column.key, tag.id)} > ${hasIcon && tag.icon ? tag.icon : nothing} </obc-tag>`; })} ${overflowCount > 0 ? html`<span class=\"tag-overflow\" part=${ifDefined(cssPart(value, \"tag-overflow\"))} >${overflowLabel}</span >` : nothing} </div>`; } else if (value.type === \"horizontal-bar\") { const hasBar = value.hasBar ?? true; const hasScale = value.hasScale ?? false; const showLabels = !(value.hideLabels ?? true); const fixedAspectRatio = value.fixedAspectRatio ?? true; return html`<div class=${classMap({ \"grid-cell\": true, \"horizontal-bar\": true, [`align-${value.align ?? \"left\"}`]: true, \"divider-right\": column.dividerRight ?? false })} role=\"cell\" part=${ifDefined(cssPart(value, \"cell\"))} > ${expander} <obc-bar-horizontal .minValue=${value.minValue ?? 0} .maxValue=${value.maxValue ?? 100} .value=${value.value} .setpoint=${value.setpoint} .hasBar=${hasBar} .hasScale=${hasScale} .showLabels=${showLabels} .priority=${value.priority ?? Priority.regular} .fillMode=${value.fillMode ?? FillMode.fill} .fillMin=${value.fillMin} .fillMax=${value.fillMax} .barThickness=${value.barThickness ?? 24} .scaleType=${value.scaleType ?? ScaleType.regular} .frameStyle=${value.frameStyle ?? FrameStyle.regular} .side=${value.side ?? ExternalScaleSide.bottom} .state=${value.state ?? InstrumentState.active} .fixedAspectRatio=${fixedAspectRatio} .scaleReferenceSize=${value.scaleReferenceSize ?? 384} part=${ifDefined(cssPart(value, \"bar\"))} ></obc-bar-horizontal> </div>`; } else { return nothing; } } }"
|
|
7710
7755
|
}
|
|
7711
7756
|
],
|
|
7712
7757
|
"exports": [
|
|
@@ -48380,6 +48425,250 @@
|
|
|
48380
48425
|
}
|
|
48381
48426
|
]
|
|
48382
48427
|
},
|
|
48428
|
+
{
|
|
48429
|
+
"kind": "javascript-module",
|
|
48430
|
+
"path": "src/components/alert-list-details-experimental/alert-list-details-experimental.ts",
|
|
48431
|
+
"declarations": [
|
|
48432
|
+
{
|
|
48433
|
+
"kind": "class",
|
|
48434
|
+
"description": "",
|
|
48435
|
+
"name": "ObcAlertListDetailsExperimental",
|
|
48436
|
+
"members": [
|
|
48437
|
+
{
|
|
48438
|
+
"kind": "field",
|
|
48439
|
+
"name": "selectedMode",
|
|
48440
|
+
"type": {
|
|
48441
|
+
"text": "AlertListMode"
|
|
48442
|
+
}
|
|
48443
|
+
},
|
|
48444
|
+
{
|
|
48445
|
+
"kind": "field",
|
|
48446
|
+
"name": "alerts",
|
|
48447
|
+
"type": {
|
|
48448
|
+
"text": "Alert[]"
|
|
48449
|
+
},
|
|
48450
|
+
"default": "[]"
|
|
48451
|
+
},
|
|
48452
|
+
{
|
|
48453
|
+
"kind": "field",
|
|
48454
|
+
"name": "showTime",
|
|
48455
|
+
"type": {
|
|
48456
|
+
"text": "boolean"
|
|
48457
|
+
},
|
|
48458
|
+
"default": "false"
|
|
48459
|
+
},
|
|
48460
|
+
{
|
|
48461
|
+
"kind": "field",
|
|
48462
|
+
"name": "timeFormatter",
|
|
48463
|
+
"type": {
|
|
48464
|
+
"text": "(time: Date) => string"
|
|
48465
|
+
}
|
|
48466
|
+
},
|
|
48467
|
+
{
|
|
48468
|
+
"kind": "field",
|
|
48469
|
+
"name": "small",
|
|
48470
|
+
"type": {
|
|
48471
|
+
"text": "boolean"
|
|
48472
|
+
},
|
|
48473
|
+
"default": "false"
|
|
48474
|
+
},
|
|
48475
|
+
{
|
|
48476
|
+
"kind": "field",
|
|
48477
|
+
"name": "defaultExpanded",
|
|
48478
|
+
"type": {
|
|
48479
|
+
"text": "boolean"
|
|
48480
|
+
},
|
|
48481
|
+
"default": "true",
|
|
48482
|
+
"description": "Whether groups start expanded. Set false to open the list collapsed."
|
|
48483
|
+
},
|
|
48484
|
+
{
|
|
48485
|
+
"kind": "field",
|
|
48486
|
+
"name": "alertList",
|
|
48487
|
+
"type": {
|
|
48488
|
+
"text": "ObcTable"
|
|
48489
|
+
},
|
|
48490
|
+
"privacy": "private"
|
|
48491
|
+
},
|
|
48492
|
+
{
|
|
48493
|
+
"kind": "field",
|
|
48494
|
+
"name": "expansionOverrides",
|
|
48495
|
+
"privacy": "private",
|
|
48496
|
+
"default": "new Map<string, boolean>()"
|
|
48497
|
+
},
|
|
48498
|
+
{
|
|
48499
|
+
"kind": "field",
|
|
48500
|
+
"name": "alertByRowId",
|
|
48501
|
+
"privacy": "private",
|
|
48502
|
+
"default": "new Map<string, Alert>()"
|
|
48503
|
+
},
|
|
48504
|
+
{
|
|
48505
|
+
"kind": "method",
|
|
48506
|
+
"name": "getVisibleAlerts",
|
|
48507
|
+
"privacy": "public",
|
|
48508
|
+
"return": {
|
|
48509
|
+
"type": {
|
|
48510
|
+
"text": "Alert[]"
|
|
48511
|
+
}
|
|
48512
|
+
}
|
|
48513
|
+
},
|
|
48514
|
+
{
|
|
48515
|
+
"kind": "method",
|
|
48516
|
+
"name": "onRowClick",
|
|
48517
|
+
"privacy": "private",
|
|
48518
|
+
"parameters": [
|
|
48519
|
+
{
|
|
48520
|
+
"name": "e",
|
|
48521
|
+
"type": {
|
|
48522
|
+
"text": "ObcTableRowClickEvent"
|
|
48523
|
+
}
|
|
48524
|
+
}
|
|
48525
|
+
]
|
|
48526
|
+
},
|
|
48527
|
+
{
|
|
48528
|
+
"kind": "method",
|
|
48529
|
+
"name": "onCellButtonClick",
|
|
48530
|
+
"privacy": "private",
|
|
48531
|
+
"parameters": [
|
|
48532
|
+
{
|
|
48533
|
+
"name": "e",
|
|
48534
|
+
"type": {
|
|
48535
|
+
"text": "ObcTableCellClickEvent"
|
|
48536
|
+
}
|
|
48537
|
+
}
|
|
48538
|
+
]
|
|
48539
|
+
},
|
|
48540
|
+
{
|
|
48541
|
+
"kind": "method",
|
|
48542
|
+
"name": "onExpandToggle",
|
|
48543
|
+
"privacy": "private",
|
|
48544
|
+
"parameters": [
|
|
48545
|
+
{
|
|
48546
|
+
"name": "e",
|
|
48547
|
+
"type": {
|
|
48548
|
+
"text": "ObcTableExpandToggleEvent"
|
|
48549
|
+
}
|
|
48550
|
+
}
|
|
48551
|
+
]
|
|
48552
|
+
},
|
|
48553
|
+
{
|
|
48554
|
+
"kind": "method",
|
|
48555
|
+
"name": "isExpanded",
|
|
48556
|
+
"privacy": "private",
|
|
48557
|
+
"parameters": [
|
|
48558
|
+
{
|
|
48559
|
+
"name": "rowId",
|
|
48560
|
+
"type": {
|
|
48561
|
+
"text": "string"
|
|
48562
|
+
}
|
|
48563
|
+
}
|
|
48564
|
+
]
|
|
48565
|
+
},
|
|
48566
|
+
{
|
|
48567
|
+
"kind": "field",
|
|
48568
|
+
"name": "columns",
|
|
48569
|
+
"privacy": "private",
|
|
48570
|
+
"readonly": true
|
|
48571
|
+
},
|
|
48572
|
+
{
|
|
48573
|
+
"kind": "field",
|
|
48574
|
+
"name": "metadata",
|
|
48575
|
+
"privacy": "private",
|
|
48576
|
+
"readonly": true
|
|
48577
|
+
},
|
|
48578
|
+
{
|
|
48579
|
+
"kind": "field",
|
|
48580
|
+
"name": "filteredAlerts",
|
|
48581
|
+
"privacy": "private",
|
|
48582
|
+
"readonly": true
|
|
48583
|
+
},
|
|
48584
|
+
{
|
|
48585
|
+
"kind": "method",
|
|
48586
|
+
"name": "buildVisibleRows",
|
|
48587
|
+
"privacy": "private",
|
|
48588
|
+
"return": {
|
|
48589
|
+
"type": {
|
|
48590
|
+
"text": "ObcTableRow[]"
|
|
48591
|
+
}
|
|
48592
|
+
}
|
|
48593
|
+
},
|
|
48594
|
+
{
|
|
48595
|
+
"kind": "method",
|
|
48596
|
+
"name": "buildRowCells",
|
|
48597
|
+
"privacy": "private",
|
|
48598
|
+
"return": {
|
|
48599
|
+
"type": {
|
|
48600
|
+
"text": "Record<string, ObcTableCellData | undefined>"
|
|
48601
|
+
}
|
|
48602
|
+
},
|
|
48603
|
+
"parameters": [
|
|
48604
|
+
{
|
|
48605
|
+
"name": "alert",
|
|
48606
|
+
"type": {
|
|
48607
|
+
"text": "Alert"
|
|
48608
|
+
}
|
|
48609
|
+
}
|
|
48610
|
+
]
|
|
48611
|
+
},
|
|
48612
|
+
{
|
|
48613
|
+
"kind": "method",
|
|
48614
|
+
"name": "render"
|
|
48615
|
+
},
|
|
48616
|
+
{
|
|
48617
|
+
"kind": "field",
|
|
48618
|
+
"name": "styles",
|
|
48619
|
+
"static": true
|
|
48620
|
+
}
|
|
48621
|
+
],
|
|
48622
|
+
"events": [
|
|
48623
|
+
{
|
|
48624
|
+
"type": {
|
|
48625
|
+
"text": "ObcAckClickEvent"
|
|
48626
|
+
},
|
|
48627
|
+
"description": "Fired when the user clicks the \"ACK\" button.",
|
|
48628
|
+
"name": "ack-click"
|
|
48629
|
+
},
|
|
48630
|
+
{
|
|
48631
|
+
"type": {
|
|
48632
|
+
"text": "ObcRowClickEvent"
|
|
48633
|
+
},
|
|
48634
|
+
"description": "Fired when the user clicks a row.",
|
|
48635
|
+
"name": "row-click"
|
|
48636
|
+
}
|
|
48637
|
+
],
|
|
48638
|
+
"superclass": {
|
|
48639
|
+
"name": "LitElement",
|
|
48640
|
+
"package": "lit"
|
|
48641
|
+
},
|
|
48642
|
+
"customElement": true
|
|
48643
|
+
}
|
|
48644
|
+
],
|
|
48645
|
+
"exports": [
|
|
48646
|
+
{
|
|
48647
|
+
"kind": "js",
|
|
48648
|
+
"name": "getAlertListModeData",
|
|
48649
|
+
"declaration": {
|
|
48650
|
+
"name": "getAlertListModeData",
|
|
48651
|
+
"module": "src/components/alert-list-details-experimental/alert-list-details-experimental.ts"
|
|
48652
|
+
}
|
|
48653
|
+
},
|
|
48654
|
+
{
|
|
48655
|
+
"kind": "js",
|
|
48656
|
+
"name": "canAckFilter",
|
|
48657
|
+
"declaration": {
|
|
48658
|
+
"name": "canAckFilter",
|
|
48659
|
+
"module": "src/components/alert-list-details-experimental/alert-list-details-experimental.ts"
|
|
48660
|
+
}
|
|
48661
|
+
},
|
|
48662
|
+
{
|
|
48663
|
+
"kind": "js",
|
|
48664
|
+
"name": "ObcAlertListDetailsExperimental",
|
|
48665
|
+
"declaration": {
|
|
48666
|
+
"name": "ObcAlertListDetailsExperimental",
|
|
48667
|
+
"module": "src/components/alert-list-details-experimental/alert-list-details-experimental.ts"
|
|
48668
|
+
}
|
|
48669
|
+
}
|
|
48670
|
+
]
|
|
48671
|
+
},
|
|
48383
48672
|
{
|
|
48384
48673
|
"kind": "javascript-module",
|
|
48385
48674
|
"path": "src/components/alert-list-details/alert-list-details.ts",
|
|
@@ -65601,7 +65890,7 @@
|
|
|
65601
65890
|
"declarations": [
|
|
65602
65891
|
{
|
|
65603
65892
|
"kind": "class",
|
|
65604
|
-
"description": "`<obc-table>` renders tabular data with configurable columns and cell types.\n\nOverview\nUse this component to display structured datasets with optional selection, sorting, and rich cell\nrendering. It accepts `data` and `columns` and renders rows based on column configuration.\n\nFeatures/Variants\n- Selectable rows with header “select all” checkbox via `selectable=true`.\n- Cell rendering variants: `checkbox`, `tag`, `horizontal-bar`, and `button` cell types.\n- Visual variants: `rowDivider`, `striped`, `narrowHeader`, and `showHeader`.\n- Sorting support for sortable columns via column definitions.\n\nUsage Guidelines\n- Controlled selection: pass `selectedRowIds` and update it on `selection-change`.\n- Uncontrolled selection: pass `defaultSelectedRowIds` and listen to `selection-change`.\n- Use `selectAllAriaLabel` to customize the header checkbox accessibility label.\n\nSlots/Content\n- This component does not expose public slots. Provide content via `data` and `columns`.\n\nEvents\n- `row-click` fires when a row is clicked.\n- `cell-button-click` fires when a button cell is clicked.\n- `cell-checkbox-change` fires when a checkbox cell changes.\n- `cell-tag-click` fires when a tag inside a cell is clicked.\n- `selection-change` fires when row selection changes (source: `row` or `header`).\n\nBest Practices\n- Keep column `key` values stable across renders to avoid selection or sorting resets.\n- Prefer `selectedRowIds` for deterministic state in apps with external stores.\n- For dense tables, combine `narrowHeader` and `rowDivider` for visual clarity.\n\nExample (keywords: table, data grid, grid, tabular, datatable)\n```ts\nhtml`<obc-table\n .data=${rows}\n .columns=${columns}\n selectable\n striped",
|
|
65893
|
+
"description": "`<obc-table>` renders tabular data with configurable columns and cell types.\n\nOverview\nUse this component to display structured datasets with optional selection, sorting, and rich cell\nrendering. It accepts `data` and `columns` and renders rows based on column configuration.\n\nFeatures/Variants\n- Selectable rows with header “select all” checkbox via `selectable=true`.\n- Cell rendering variants: `checkbox`, `tag`, `horizontal-bar`, and `button` cell types.\n- Visual variants: `rowDivider`, `striped`, `narrowHeader`, and `showHeader`.\n- Sorting support for sortable columns via column definitions.\n- Hierarchical rows via `parentId`, `level`, `expandable` and `expanded`.\n\nUsage Guidelines\n- Controlled selection: pass `selectedRowIds` and update it on `selection-change`.\n- Uncontrolled selection: pass `defaultSelectedRowIds` and listen to `selection-change`.\n- Use `selectAllAriaLabel` to customize the header checkbox accessibility label.\n- Hierarchy is controlled, and flat: pass only the rows that are currently\n visible, each with the `parentId` of its parent row, and drop a collapsed\n group's descendants from `data` on `expand-toggle`. The table draws the\n indent and the chevron, keeps each sibling set sorted within its parent,\n and owns no expansion state of its own.\n\nSlots/Content\n- This component does not expose public slots. Provide content via `data` and `columns`.\n\nEvents\n- `row-click` fires when a row is clicked.\n- `cell-button-click` fires when a button cell is clicked.\n- `cell-checkbox-change` fires when a checkbox cell changes.\n- `cell-tag-click` fires when a tag inside a cell is clicked.\n- `selection-change` fires when row selection changes (source: `row` or `header`).\n- `expand-toggle` fires when a group row's chevron or expand key is used.\n\nAccessibility\nA table with hierarchical rows renders as a\n[treegrid](https://www.w3.org/WAI/ARIA/apg/patterns/treegrid/): rows carry\n`aria-level`, and group rows `aria-expanded`. Right expands a collapsed\ngroup, Left collapses an expanded one or moves to the parent row. Cell-level\narrow navigation, which the full pattern also specifies, is out of scope —\narrow keys move between rows, matching the flat table.\n\nBest Practices\n- Keep column `key` values stable across renders to avoid selection or sorting resets.\n- Prefer `selectedRowIds` for deterministic state in apps with external stores.\n- For dense tables, combine `narrowHeader` and `rowDivider` for visual clarity.\n\nExample (keywords: table, data grid, grid, tabular, datatable)\n```ts\nhtml`<obc-table\n .data=${rows}\n .columns=${columns}\n selectable\n striped",
|
|
65605
65894
|
"name": "ObcTable",
|
|
65606
65895
|
"members": [
|
|
65607
65896
|
{
|
|
@@ -65718,6 +66007,31 @@
|
|
|
65718
66007
|
"privacy": "private",
|
|
65719
66008
|
"default": "[]"
|
|
65720
66009
|
},
|
|
66010
|
+
{
|
|
66011
|
+
"kind": "field",
|
|
66012
|
+
"name": "hasHierarchy",
|
|
66013
|
+
"privacy": "private",
|
|
66014
|
+
"readonly": true
|
|
66015
|
+
},
|
|
66016
|
+
{
|
|
66017
|
+
"kind": "method",
|
|
66018
|
+
"name": "sortWithinSiblings",
|
|
66019
|
+
"privacy": "private",
|
|
66020
|
+
"parameters": [
|
|
66021
|
+
{
|
|
66022
|
+
"name": "rows",
|
|
66023
|
+
"type": {
|
|
66024
|
+
"text": "ObcTableRow[]"
|
|
66025
|
+
}
|
|
66026
|
+
},
|
|
66027
|
+
{
|
|
66028
|
+
"name": "compare",
|
|
66029
|
+
"type": {
|
|
66030
|
+
"text": "(a: ObcTableRow, b: ObcTableRow) => number"
|
|
66031
|
+
}
|
|
66032
|
+
}
|
|
66033
|
+
]
|
|
66034
|
+
},
|
|
65721
66035
|
{
|
|
65722
66036
|
"kind": "field",
|
|
65723
66037
|
"name": "sortedData",
|
|
@@ -65749,6 +66063,38 @@
|
|
|
65749
66063
|
}
|
|
65750
66064
|
]
|
|
65751
66065
|
},
|
|
66066
|
+
{
|
|
66067
|
+
"kind": "method",
|
|
66068
|
+
"name": "_handleExpandToggle",
|
|
66069
|
+
"privacy": "private",
|
|
66070
|
+
"parameters": [
|
|
66071
|
+
{
|
|
66072
|
+
"name": "row",
|
|
66073
|
+
"type": {
|
|
66074
|
+
"text": "ObcTableRow"
|
|
66075
|
+
}
|
|
66076
|
+
},
|
|
66077
|
+
{
|
|
66078
|
+
"name": "expanded",
|
|
66079
|
+
"type": {
|
|
66080
|
+
"text": "boolean"
|
|
66081
|
+
}
|
|
66082
|
+
}
|
|
66083
|
+
]
|
|
66084
|
+
},
|
|
66085
|
+
{
|
|
66086
|
+
"kind": "method",
|
|
66087
|
+
"name": "_renderRowExpander",
|
|
66088
|
+
"privacy": "private",
|
|
66089
|
+
"parameters": [
|
|
66090
|
+
{
|
|
66091
|
+
"name": "row",
|
|
66092
|
+
"type": {
|
|
66093
|
+
"text": "ObcTableRow"
|
|
66094
|
+
}
|
|
66095
|
+
}
|
|
66096
|
+
]
|
|
66097
|
+
},
|
|
65752
66098
|
{
|
|
65753
66099
|
"kind": "method",
|
|
65754
66100
|
"name": "_focusFirstRow",
|
|
@@ -65798,6 +66144,25 @@
|
|
|
65798
66144
|
}
|
|
65799
66145
|
]
|
|
65800
66146
|
},
|
|
66147
|
+
{
|
|
66148
|
+
"kind": "method",
|
|
66149
|
+
"name": "_handleRowExpandKey",
|
|
66150
|
+
"privacy": "private",
|
|
66151
|
+
"parameters": [
|
|
66152
|
+
{
|
|
66153
|
+
"name": "event",
|
|
66154
|
+
"type": {
|
|
66155
|
+
"text": "KeyboardEvent"
|
|
66156
|
+
}
|
|
66157
|
+
},
|
|
66158
|
+
{
|
|
66159
|
+
"name": "key",
|
|
66160
|
+
"type": {
|
|
66161
|
+
"text": "'ArrowRight' | 'ArrowLeft'"
|
|
66162
|
+
}
|
|
66163
|
+
}
|
|
66164
|
+
]
|
|
66165
|
+
},
|
|
65801
66166
|
{
|
|
65802
66167
|
"kind": "method",
|
|
65803
66168
|
"name": "_getAllPositions",
|
|
@@ -66044,6 +66409,13 @@
|
|
|
66044
66409
|
"type": {
|
|
66045
66410
|
"text": "ObcTableColumn<ObcTableCellData, ObcTableRow>"
|
|
66046
66411
|
}
|
|
66412
|
+
},
|
|
66413
|
+
{
|
|
66414
|
+
"name": "expander",
|
|
66415
|
+
"default": "nothing",
|
|
66416
|
+
"type": {
|
|
66417
|
+
"text": "HTMLTemplateResult | typeof nothing"
|
|
66418
|
+
}
|
|
66047
66419
|
}
|
|
66048
66420
|
]
|
|
66049
66421
|
},
|
|
@@ -66088,6 +66460,13 @@
|
|
|
66088
66460
|
},
|
|
66089
66461
|
"description": "Fired when row selection changes.",
|
|
66090
66462
|
"name": "selection-change"
|
|
66463
|
+
},
|
|
66464
|
+
{
|
|
66465
|
+
"type": {
|
|
66466
|
+
"text": "ObcTableExpandToggleEvent"
|
|
66467
|
+
},
|
|
66468
|
+
"description": "Fired when a group row is expanded or collapsed.",
|
|
66469
|
+
"name": "expand-toggle"
|
|
66091
66470
|
}
|
|
66092
66471
|
],
|
|
66093
66472
|
"superclass": {
|
package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
const compentStyle = css`* {
|
|
3
|
+
-webkit-tap-highlight-color: transparent;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.wrapper {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
height: 100%;
|
|
10
|
+
width: 100%;
|
|
11
|
+
user-select: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.alert-list {
|
|
15
|
+
min-height: 0;
|
|
16
|
+
flex-grow: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.spacer {
|
|
20
|
+
flex-grow: 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.action {
|
|
24
|
+
display: flex;
|
|
25
|
+
height: var(--app-components-tool-bar-touch-target-size);
|
|
26
|
+
padding: 0px var(--app-components-alert-toolbar-margin-horizontal);
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
align-items: center;
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
flex-grow: 0;
|
|
31
|
+
border-top: 1px solid var(--border-divider-color);
|
|
32
|
+
background: var(--container-section-color);
|
|
33
|
+
box-shadow: var(--shadow-flat);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.action .btn-group {
|
|
37
|
+
display: flex;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
obc-table::part(grid) {
|
|
41
|
+
grid-template-columns: 1fr repeat(4, min-content);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.wrapper.small obc-table::part(grid) {
|
|
45
|
+
grid-template-columns: 1fr min-content var(
|
|
46
|
+
--app-components-alert-table-row-ack-container-width-small
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.empty-list {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
height: 100%;
|
|
56
|
+
gap: var(--app-components-alert-menu-button-spacing);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.empty-list .icon {
|
|
60
|
+
height: 96px;
|
|
61
|
+
width: 96px;
|
|
62
|
+
color: var(--on-flat-neutral-color);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.empty-list .empty-title {
|
|
66
|
+
color: var(--element-active-color);
|
|
67
|
+
font-family: var(--global-typography-font-family);
|
|
68
|
+
font-weight: var(--global-typography-ui-body-active-font-weight);
|
|
69
|
+
font-size: var(--global-typography-ui-body-active-font-size);
|
|
70
|
+
line-height: var(--global-typography-ui-body-active-line-height);
|
|
71
|
+
font-feature-settings:
|
|
72
|
+
"liga" off,
|
|
73
|
+
"clig" off,
|
|
74
|
+
"ss04" on;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.empty-list .empty-description {
|
|
78
|
+
color: var(--element-neutral-color);
|
|
79
|
+
font-family: var(--global-typography-font-family);
|
|
80
|
+
font-weight: var(--global-typography-ui-body-font-weight);
|
|
81
|
+
font-size: var(--global-typography-ui-body-font-size);
|
|
82
|
+
line-height: var(--global-typography-ui-body-line-height);
|
|
83
|
+
font-feature-settings:
|
|
84
|
+
"liga" off,
|
|
85
|
+
"clig" off,
|
|
86
|
+
"ss04" on;
|
|
87
|
+
max-width: 344px;
|
|
88
|
+
text-align: center;
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
export {
|
|
92
|
+
compentStyle as default
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=alert-list-details-experimental.css.js.map
|
package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-list-details-experimental.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|