@design.estate/dees-catalog 3.62.0 → 3.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_bundle/bundle.js +440 -107
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-dataview/dees-table/dees-table.d.ts +83 -1
- package/dist_ts_web/elements/00group-dataview/dees-table/dees-table.js +501 -99
- package/dist_ts_web/elements/00group-dataview/dees-table/styles.js +47 -18
- package/dist_watch/bundle.js +438 -105
- package/dist_watch/bundle.js.map +3 -3
- package/package.json +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-dataview/dees-table/dees-table.ts +496 -99
- package/ts_web/elements/00group-dataview/dees-table/styles.ts +46 -17
package/dist_watch/bundle.js
CHANGED
|
@@ -169260,29 +169260,48 @@ var tableStyles = [
|
|
|
169260
169260
|
border-bottom-width: 0px;
|
|
169261
169261
|
}
|
|
169262
169262
|
|
|
169263
|
+
/* Default mode (Mode B, page sticky): horizontal scroll lives on
|
|
169264
|
+
.tableScroll (so wide tables don't get clipped by an ancestor
|
|
169265
|
+
overflow:hidden such as dees-tile). Vertical sticky is handled by
|
|
169266
|
+
a JS-managed floating header (.floatingHeader, position:fixed),
|
|
169267
|
+
which is unaffected by ancestor overflow. */
|
|
169263
169268
|
.tableScroll {
|
|
169264
|
-
|
|
169269
|
+
position: relative;
|
|
169265
169270
|
overflow-x: auto;
|
|
169266
|
-
|
|
169267
|
-
|
|
169268
|
-
|
|
169271
|
+
overflow-y: visible;
|
|
169272
|
+
scrollbar-gutter: stable;
|
|
169273
|
+
}
|
|
169274
|
+
/* Mode A, internal scroll: opt-in via fixed-height attribute.
|
|
169275
|
+
The table scrolls inside its own box and the header sticks via plain CSS sticky. */
|
|
169276
|
+
:host([fixed-height]) .tableScroll {
|
|
169277
|
+
max-height: var(--table-max-height, 360px);
|
|
169278
|
+
overflow: auto;
|
|
169269
169279
|
scrollbar-gutter: stable both-edges;
|
|
169270
169280
|
}
|
|
169271
|
-
|
|
169272
|
-
|
|
169273
|
-
-ms-overflow-style: none; /* IE/Edge */
|
|
169274
|
-
scrollbar-width: none; /* Firefox (hides both axes) */
|
|
169281
|
+
:host([fixed-height]) .tableScroll::-webkit-scrollbar:horizontal {
|
|
169282
|
+
height: 0px;
|
|
169275
169283
|
}
|
|
169276
|
-
|
|
169277
|
-
|
|
169284
|
+
|
|
169285
|
+
/* Floating header overlay (Mode B). Position is managed by JS so it
|
|
169286
|
+
escapes any ancestor overflow:hidden (position:fixed is not clipped
|
|
169287
|
+
by overflow ancestors). */
|
|
169288
|
+
.floatingHeader {
|
|
169289
|
+
position: fixed;
|
|
169290
|
+
top: 0;
|
|
169291
|
+
left: 0;
|
|
169292
|
+
z-index: 100;
|
|
169293
|
+
visibility: hidden;
|
|
169294
|
+
overflow: hidden;
|
|
169295
|
+
pointer-events: none;
|
|
169278
169296
|
}
|
|
169279
|
-
|
|
169280
|
-
|
|
169281
|
-
height: 0px;
|
|
169297
|
+
.floatingHeader.active {
|
|
169298
|
+
visibility: visible;
|
|
169282
169299
|
}
|
|
169283
|
-
|
|
169284
|
-
|
|
169285
|
-
|
|
169300
|
+
.floatingHeader table {
|
|
169301
|
+
margin: 0;
|
|
169302
|
+
}
|
|
169303
|
+
.floatingHeader th {
|
|
169304
|
+
pointer-events: auto;
|
|
169286
169305
|
}
|
|
169287
169306
|
|
|
169288
169307
|
table {
|
|
@@ -169305,15 +169324,25 @@ var tableStyles = [
|
|
|
169305
169324
|
background: ${cssManager.bdTheme("hsl(210 40% 96.1%)", "hsl(0 0% 9%)")};
|
|
169306
169325
|
border-bottom: 1px solid var(--dees-color-border-strong);
|
|
169307
169326
|
}
|
|
169308
|
-
|
|
169327
|
+
/* th needs its own background so sticky cells paint over scrolled rows
|
|
169328
|
+
(browsers don't paint the <thead> box behind a sticky <th>). */
|
|
169329
|
+
th {
|
|
169330
|
+
background: ${cssManager.bdTheme("hsl(210 40% 96.1%)", "hsl(0 0% 9%)")};
|
|
169331
|
+
}
|
|
169332
|
+
/* Mode A — internal scroll sticky */
|
|
169333
|
+
:host([fixed-height]) thead th {
|
|
169309
169334
|
position: sticky;
|
|
169310
169335
|
top: 0;
|
|
169311
169336
|
z-index: 2;
|
|
169312
169337
|
}
|
|
169338
|
+
:host([fixed-height]) thead tr.filtersRow th {
|
|
169339
|
+
top: 36px; /* matches th { height: 36px } below */
|
|
169340
|
+
}
|
|
169313
169341
|
|
|
169314
169342
|
tbody tr {
|
|
169315
169343
|
transition: background-color 0.15s ease;
|
|
169316
169344
|
position: relative;
|
|
169345
|
+
user-select: none;
|
|
169317
169346
|
}
|
|
169318
169347
|
|
|
169319
169348
|
/* Default horizontal lines (bottom border only) */
|
|
@@ -169867,7 +169896,7 @@ __name(compileLucenePredicate, "compileLucenePredicate");
|
|
|
169867
169896
|
init_dist_ts30();
|
|
169868
169897
|
init_dist_ts29();
|
|
169869
169898
|
init_theme();
|
|
169870
|
-
var _selectedIds_dec, _selectionMode_dec, _searchMode_dec,
|
|
169899
|
+
var _selectedIds_dec, _selectionMode_dec, _searchMode_dec, _fixedHeight_dec, _showSelectionCheckbox_dec, _showColumnFilters_dec, _columnFilters_dec, _filterText_dec, _sortBy_dec, _showGrid_dec, _showHorizontalLines_dec, _showVerticalLines_dec, _editableFields_dec, _selectedDataRow_dec, _reverseDisplayFunction_dec, _displayFunction_dec, _augmentFromDisplayFunction_dec, _rowKey_dec, _columns_dec, _dataActions_dec, _searchable_dec, _dataName_dec, _required_dec3, _disabled_dec3, _label_dec3, _key_dec2, _data_dec, _heading2_dec, _heading1_dec, _a42, _DeesTable_decorators, _init39, _heading1, _heading22, _data, _key2, _label3, _disabled3, _required3, _dataName, _searchable, _dataActions, _columns, _rowKey, _augmentFromDisplayFunction, _displayFunction, _reverseDisplayFunction, _selectedDataRow, _editableFields, _showVerticalLines, _showHorizontalLines, _showGrid, _sortBy, _filterText, _columnFilters, _showColumnFilters, _showSelectionCheckbox, _fixedHeight, _searchMode, _selectionMode, _selectedIds;
|
|
169871
169900
|
function ordinalLabel(n12) {
|
|
169872
169901
|
const s10 = ["th", "st", "nd", "rd"];
|
|
169873
169902
|
const v5 = n12 % 100;
|
|
@@ -169916,7 +169945,7 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
|
|
|
169916
169945
|
type: Boolean,
|
|
169917
169946
|
reflect: true,
|
|
169918
169947
|
attribute: "show-grid"
|
|
169919
|
-
})], _sortBy_dec = [n5({ attribute: false })], _filterText_dec = [n5({ type: String })], _columnFilters_dec = [n5({ attribute: false })], _showColumnFilters_dec = [n5({ type: Boolean, attribute: "show-column-filters" })],
|
|
169948
|
+
})], _sortBy_dec = [n5({ attribute: false })], _filterText_dec = [n5({ type: String })], _columnFilters_dec = [n5({ attribute: false })], _showColumnFilters_dec = [n5({ type: Boolean, attribute: "show-column-filters" })], _showSelectionCheckbox_dec = [n5({ type: Boolean, reflect: true, attribute: "show-selection-checkbox" })], _fixedHeight_dec = [n5({ type: Boolean, reflect: true, attribute: "fixed-height" })], _searchMode_dec = [n5({ type: String })], _selectionMode_dec = [n5({ type: String })], _selectedIds_dec = [n5({ attribute: false })], _a42) {
|
|
169920
169949
|
constructor() {
|
|
169921
169950
|
super();
|
|
169922
169951
|
__privateAdd(this, _heading1, __runInitializers(_init39, 8, this, "heading 1")), __runInitializers(_init39, 11, this);
|
|
@@ -169947,21 +169976,84 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
|
|
|
169947
169976
|
__privateAdd(this, _filterText, __runInitializers(_init39, 92, this, "")), __runInitializers(_init39, 95, this);
|
|
169948
169977
|
__privateAdd(this, _columnFilters, __runInitializers(_init39, 96, this, {})), __runInitializers(_init39, 99, this);
|
|
169949
169978
|
__privateAdd(this, _showColumnFilters, __runInitializers(_init39, 100, this, false)), __runInitializers(_init39, 103, this);
|
|
169950
|
-
__privateAdd(this,
|
|
169951
|
-
__privateAdd(this,
|
|
169979
|
+
__privateAdd(this, _showSelectionCheckbox, __runInitializers(_init39, 104, this, false)), __runInitializers(_init39, 107, this);
|
|
169980
|
+
__privateAdd(this, _fixedHeight, __runInitializers(_init39, 108, this, false)), __runInitializers(_init39, 111, this);
|
|
169981
|
+
__privateAdd(this, _searchMode, __runInitializers(_init39, 112, this, "table")), __runInitializers(_init39, 115, this);
|
|
169952
169982
|
__publicField(this, "__searchTextSub");
|
|
169953
169983
|
__publicField(this, "__searchModeSub");
|
|
169954
|
-
__privateAdd(this, _selectionMode, __runInitializers(_init39,
|
|
169955
|
-
__privateAdd(this, _selectedIds, __runInitializers(_init39,
|
|
169984
|
+
__privateAdd(this, _selectionMode, __runInitializers(_init39, 116, this, "none")), __runInitializers(_init39, 119, this);
|
|
169985
|
+
__privateAdd(this, _selectedIds, __runInitializers(_init39, 120, this, /* @__PURE__ */ new Set())), __runInitializers(_init39, 123, this);
|
|
169956
169986
|
__publicField(this, "_rowIdMap", /* @__PURE__ */ new WeakMap());
|
|
169957
169987
|
__publicField(this, "_rowIdCounter", 0);
|
|
169988
|
+
/**
|
|
169989
|
+
* Anchor row id for shift+click range selection. Set whenever the user
|
|
169990
|
+
* makes a non-range click (plain or cmd/ctrl) so the next shift+click
|
|
169991
|
+
* can compute a contiguous range from this anchor.
|
|
169992
|
+
*/
|
|
169993
|
+
__publicField(this, "__selectionAnchorId");
|
|
169994
|
+
/**
|
|
169995
|
+
* Ctrl/Cmd+C copies the currently selected rows as a JSON array. Falls
|
|
169996
|
+
* back to copying the focused-row (`selectedDataRow`) if no multi
|
|
169997
|
+
* selection exists. No-op if a focused input/textarea would normally
|
|
169998
|
+
* receive the copy.
|
|
169999
|
+
*/
|
|
170000
|
+
__publicField(this, "__handleHostKeydown", /* @__PURE__ */ __name((eventArg) => {
|
|
170001
|
+
const isCopy = (eventArg.metaKey || eventArg.ctrlKey) && (eventArg.key === "c" || eventArg.key === "C");
|
|
170002
|
+
if (!isCopy) return;
|
|
170003
|
+
const path2 = eventArg.composedPath?.() || [];
|
|
170004
|
+
for (const t9 of path2) {
|
|
170005
|
+
const tag = t9?.tagName;
|
|
170006
|
+
if (tag === "INPUT" || tag === "TEXTAREA") return;
|
|
170007
|
+
if (t9?.isContentEditable) return;
|
|
170008
|
+
}
|
|
170009
|
+
const rows = [];
|
|
170010
|
+
if (this.selectedIds.size > 0) {
|
|
170011
|
+
for (const r11 of this.data) if (this.selectedIds.has(this.getRowId(r11))) rows.push(r11);
|
|
170012
|
+
} else if (this.selectedDataRow) {
|
|
170013
|
+
rows.push(this.selectedDataRow);
|
|
170014
|
+
}
|
|
170015
|
+
if (rows.length === 0) return;
|
|
170016
|
+
eventArg.preventDefault();
|
|
170017
|
+
this.__writeRowsAsJson(rows);
|
|
170018
|
+
}, "__handleHostKeydown"));
|
|
170019
|
+
// ─── Floating header (page-sticky) lifecycle ─────────────────────────
|
|
170020
|
+
__publicField(this, "__floatingResizeObserver");
|
|
170021
|
+
__publicField(this, "__floatingScrollHandler");
|
|
170022
|
+
__publicField(this, "__floatingActive", false);
|
|
170023
|
+
__publicField(this, "__scrollAncestors", []);
|
|
169958
170024
|
__publicField(this, "__debounceTimer");
|
|
170025
|
+
if (!this.hasAttribute("tabindex")) this.setAttribute("tabindex", "0");
|
|
170026
|
+
this.addEventListener("keydown", this.__handleHostKeydown);
|
|
169959
170027
|
}
|
|
169960
170028
|
get value() {
|
|
169961
170029
|
return this.data;
|
|
169962
170030
|
}
|
|
169963
170031
|
set value(_valueArg) {
|
|
169964
170032
|
}
|
|
170033
|
+
/**
|
|
170034
|
+
* Copies the current selection as a JSON array. If `fallbackRow` is given
|
|
170035
|
+
* and there is no multi-selection, that row is copied instead. Used both
|
|
170036
|
+
* by the Ctrl/Cmd+C handler and by the default context-menu action.
|
|
170037
|
+
*/
|
|
170038
|
+
copySelectionAsJson(fallbackRow) {
|
|
170039
|
+
const rows = [];
|
|
170040
|
+
if (this.selectedIds.size > 0) {
|
|
170041
|
+
for (const r11 of this.data) if (this.selectedIds.has(this.getRowId(r11))) rows.push(r11);
|
|
170042
|
+
} else if (fallbackRow) {
|
|
170043
|
+
rows.push(fallbackRow);
|
|
170044
|
+
} else if (this.selectedDataRow) {
|
|
170045
|
+
rows.push(this.selectedDataRow);
|
|
170046
|
+
}
|
|
170047
|
+
if (rows.length === 0) return;
|
|
170048
|
+
this.__writeRowsAsJson(rows);
|
|
170049
|
+
}
|
|
170050
|
+
__writeRowsAsJson(rows) {
|
|
170051
|
+
try {
|
|
170052
|
+
const json = JSON.stringify(rows, null, 2);
|
|
170053
|
+
navigator.clipboard?.writeText(json);
|
|
170054
|
+
} catch {
|
|
170055
|
+
}
|
|
170056
|
+
}
|
|
169965
170057
|
render() {
|
|
169966
170058
|
const usingColumns = Array.isArray(this.columns) && this.columns.length > 0;
|
|
169967
170059
|
const effectiveColumns = usingColumns ? computeEffectiveColumns(this.columns, this.augmentFromDisplayFunction, this.displayFunction, this.data) : computeColumnsFromDisplayFunction(this.displayFunction, this.data);
|
|
@@ -170045,58 +170137,7 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
|
|
|
170045
170137
|
<div class="tableScroll">
|
|
170046
170138
|
<table>
|
|
170047
170139
|
<thead>
|
|
170048
|
-
|
|
170049
|
-
${this.selectionMode !== "none" ? b2`
|
|
170050
|
-
<th style="width:42px; text-align:center;">
|
|
170051
|
-
${this.selectionMode === "multi" ? b2`
|
|
170052
|
-
<dees-input-checkbox
|
|
170053
|
-
.value=${this.areAllVisibleSelected()}
|
|
170054
|
-
.indeterminate=${this.isVisibleSelectionIndeterminate()}
|
|
170055
|
-
@newValue=${(e11) => {
|
|
170056
|
-
e11.stopPropagation();
|
|
170057
|
-
this.setSelectVisible(e11.detail === true);
|
|
170058
|
-
}}
|
|
170059
|
-
></dees-input-checkbox>
|
|
170060
|
-
` : b2``}
|
|
170061
|
-
</th>
|
|
170062
|
-
` : b2``}
|
|
170063
|
-
${effectiveColumns.filter((c11) => !c11.hidden).map((col) => {
|
|
170064
|
-
const isSortable = !!col.sortable;
|
|
170065
|
-
const ariaSort = this.getAriaSort(col);
|
|
170066
|
-
return b2`
|
|
170067
|
-
<th
|
|
170068
|
-
role="columnheader"
|
|
170069
|
-
aria-sort=${ariaSort}
|
|
170070
|
-
style="${isSortable ? "cursor: pointer;" : ""}"
|
|
170071
|
-
@click=${(eventArg) => isSortable ? this.handleHeaderClick(eventArg, col, effectiveColumns) : null}
|
|
170072
|
-
@contextmenu=${(eventArg) => isSortable ? this.openHeaderContextMenu(eventArg, col, effectiveColumns) : null}
|
|
170073
|
-
>
|
|
170074
|
-
${col.header ?? col.key}
|
|
170075
|
-
${this.renderSortIndicator(col)}
|
|
170076
|
-
</th>`;
|
|
170077
|
-
})}
|
|
170078
|
-
${(() => {
|
|
170079
|
-
if (this.dataActions && this.dataActions.length > 0) {
|
|
170080
|
-
return b2` <th class="actionsCol">Actions</th> `;
|
|
170081
|
-
}
|
|
170082
|
-
})()}
|
|
170083
|
-
</tr>
|
|
170084
|
-
${this.showColumnFilters ? b2`<tr class="filtersRow">
|
|
170085
|
-
${this.selectionMode !== "none" ? b2`<th style="width:42px;"></th>` : b2``}
|
|
170086
|
-
${effectiveColumns.filter((c11) => !c11.hidden).map((col) => {
|
|
170087
|
-
const key2 = String(col.key);
|
|
170088
|
-
if (col.filterable === false) return b2`<th></th>`;
|
|
170089
|
-
return b2`<th>
|
|
170090
|
-
<input type="text" placeholder="Filter..." .value=${this.columnFilters[key2] || ""}
|
|
170091
|
-
@input=${(e11) => this.setColumnFilter(key2, e11.target.value)} />
|
|
170092
|
-
</th>`;
|
|
170093
|
-
})}
|
|
170094
|
-
${(() => {
|
|
170095
|
-
if (this.dataActions && this.dataActions.length > 0) {
|
|
170096
|
-
return b2` <th></th> `;
|
|
170097
|
-
}
|
|
170098
|
-
})()}
|
|
170099
|
-
</tr>` : b2``}
|
|
170140
|
+
${this.renderHeaderRows(effectiveColumns)}
|
|
170100
170141
|
</thead>
|
|
170101
170142
|
<tbody>
|
|
170102
170143
|
${viewData.map((itemArg, rowIndex) => {
|
|
@@ -170109,15 +170150,9 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
|
|
|
170109
170150
|
}, "getTr");
|
|
170110
170151
|
return b2`
|
|
170111
170152
|
<tr
|
|
170112
|
-
@click=${() =>
|
|
170113
|
-
|
|
170114
|
-
if (this.selectionMode
|
|
170115
|
-
const id = this.getRowId(itemArg);
|
|
170116
|
-
this.selectedIds.clear();
|
|
170117
|
-
this.selectedIds.add(id);
|
|
170118
|
-
this.emitSelectionChange();
|
|
170119
|
-
this.requestUpdate();
|
|
170120
|
-
}
|
|
170153
|
+
@click=${(e11) => this.handleRowClick(e11, itemArg, rowIndex, viewData)}
|
|
170154
|
+
@mousedown=${(e11) => {
|
|
170155
|
+
if (e11.shiftKey && this.selectionMode !== "single") e11.preventDefault();
|
|
170121
170156
|
}}
|
|
170122
170157
|
@dragenter=${async (eventArg) => {
|
|
170123
170158
|
eventArg.preventDefault();
|
|
@@ -170152,27 +170187,43 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
|
|
|
170152
170187
|
}
|
|
170153
170188
|
}}
|
|
170154
170189
|
@contextmenu=${async (eventArg) => {
|
|
170155
|
-
|
|
170156
|
-
|
|
170157
|
-
this.
|
|
170158
|
-
|
|
170159
|
-
|
|
170160
|
-
|
|
170161
|
-
|
|
170162
|
-
|
|
170163
|
-
|
|
170164
|
-
|
|
170165
|
-
|
|
170166
|
-
|
|
170167
|
-
|
|
170168
|
-
|
|
170169
|
-
|
|
170170
|
-
|
|
170171
|
-
|
|
170190
|
+
if (!this.isRowSelected(itemArg)) {
|
|
170191
|
+
this.selectedDataRow = itemArg;
|
|
170192
|
+
this.selectedIds.clear();
|
|
170193
|
+
this.selectedIds.add(this.getRowId(itemArg));
|
|
170194
|
+
this.__selectionAnchorId = this.getRowId(itemArg);
|
|
170195
|
+
this.emitSelectionChange();
|
|
170196
|
+
this.requestUpdate();
|
|
170197
|
+
}
|
|
170198
|
+
const userItems = this.getActionsForType("contextmenu").map((action) => ({
|
|
170199
|
+
name: action.name,
|
|
170200
|
+
iconName: action.iconName,
|
|
170201
|
+
action: /* @__PURE__ */ __name(async () => {
|
|
170202
|
+
await action.actionFunc({
|
|
170203
|
+
item: itemArg,
|
|
170204
|
+
table: this
|
|
170205
|
+
});
|
|
170206
|
+
return null;
|
|
170207
|
+
}, "action")
|
|
170208
|
+
}));
|
|
170209
|
+
const defaultItems = [
|
|
170210
|
+
{
|
|
170211
|
+
name: this.selectedIds.size > 1 ? `Copy ${this.selectedIds.size} rows as JSON` : "Copy row as JSON",
|
|
170212
|
+
iconName: "lucide:Copy",
|
|
170213
|
+
action: /* @__PURE__ */ __name(async () => {
|
|
170214
|
+
this.copySelectionAsJson(itemArg);
|
|
170215
|
+
return null;
|
|
170216
|
+
}, "action")
|
|
170217
|
+
}
|
|
170218
|
+
];
|
|
170219
|
+
DeesContextmenu.openContextMenuWithOptions(eventArg, [
|
|
170220
|
+
...userItems,
|
|
170221
|
+
...defaultItems
|
|
170222
|
+
]);
|
|
170172
170223
|
}}
|
|
170173
|
-
class="${itemArg === this.selectedDataRow ? "selected" : ""}"
|
|
170224
|
+
class="${itemArg === this.selectedDataRow || this.isRowSelected(itemArg) ? "selected" : ""}"
|
|
170174
170225
|
>
|
|
170175
|
-
${this.
|
|
170226
|
+
${this.showSelectionCheckbox ? b2`<td style="width:42px; text-align:center;">
|
|
170176
170227
|
<dees-input-checkbox
|
|
170177
170228
|
.value=${this.isRowSelected(itemArg)}
|
|
170178
170229
|
@newValue=${(e11) => {
|
|
@@ -170230,6 +170281,13 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
|
|
|
170230
170281
|
</tbody>
|
|
170231
170282
|
</table>
|
|
170232
170283
|
</div>
|
|
170284
|
+
<div class="floatingHeader" aria-hidden="true">
|
|
170285
|
+
<table>
|
|
170286
|
+
<thead>
|
|
170287
|
+
${this.renderHeaderRows(effectiveColumns)}
|
|
170288
|
+
</thead>
|
|
170289
|
+
</table>
|
|
170290
|
+
</div>
|
|
170233
170291
|
` : b2` <div class="noDataSet">No data set!</div> `}
|
|
170234
170292
|
<div slot="footer" class="footer">
|
|
170235
170293
|
<div class="tableStatistics">
|
|
@@ -170264,11 +170322,226 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
|
|
|
170264
170322
|
</dees-tile>
|
|
170265
170323
|
`;
|
|
170266
170324
|
}
|
|
170325
|
+
/**
|
|
170326
|
+
* Renders the header rows. Used twice per render: once inside the real
|
|
170327
|
+
* `<thead>` and once inside the floating-header clone, so sort indicators
|
|
170328
|
+
* and filter inputs stay in sync automatically.
|
|
170329
|
+
*/
|
|
170330
|
+
renderHeaderRows(effectiveColumns) {
|
|
170331
|
+
return b2`
|
|
170332
|
+
<tr>
|
|
170333
|
+
${this.showSelectionCheckbox ? b2`
|
|
170334
|
+
<th style="width:42px; text-align:center;">
|
|
170335
|
+
${this.selectionMode === "multi" ? b2`
|
|
170336
|
+
<dees-input-checkbox
|
|
170337
|
+
.value=${this.areAllVisibleSelected()}
|
|
170338
|
+
.indeterminate=${this.isVisibleSelectionIndeterminate()}
|
|
170339
|
+
@newValue=${(e11) => {
|
|
170340
|
+
e11.stopPropagation();
|
|
170341
|
+
this.setSelectVisible(e11.detail === true);
|
|
170342
|
+
}}
|
|
170343
|
+
></dees-input-checkbox>
|
|
170344
|
+
` : b2``}
|
|
170345
|
+
</th>
|
|
170346
|
+
` : b2``}
|
|
170347
|
+
${effectiveColumns.filter((c11) => !c11.hidden).map((col) => {
|
|
170348
|
+
const isSortable = !!col.sortable;
|
|
170349
|
+
const ariaSort = this.getAriaSort(col);
|
|
170350
|
+
return b2`
|
|
170351
|
+
<th
|
|
170352
|
+
role="columnheader"
|
|
170353
|
+
aria-sort=${ariaSort}
|
|
170354
|
+
style="${isSortable ? "cursor: pointer;" : ""}"
|
|
170355
|
+
@click=${(eventArg) => isSortable ? this.handleHeaderClick(eventArg, col, effectiveColumns) : null}
|
|
170356
|
+
@contextmenu=${(eventArg) => isSortable ? this.openHeaderContextMenu(eventArg, col, effectiveColumns) : null}
|
|
170357
|
+
>
|
|
170358
|
+
${col.header ?? col.key}
|
|
170359
|
+
${this.renderSortIndicator(col)}
|
|
170360
|
+
</th>`;
|
|
170361
|
+
})}
|
|
170362
|
+
${this.dataActions && this.dataActions.length > 0 ? b2`<th class="actionsCol">Actions</th>` : b2``}
|
|
170363
|
+
</tr>
|
|
170364
|
+
${this.showColumnFilters ? b2`<tr class="filtersRow">
|
|
170365
|
+
${this.showSelectionCheckbox ? b2`<th style="width:42px;"></th>` : b2``}
|
|
170366
|
+
${effectiveColumns.filter((c11) => !c11.hidden).map((col) => {
|
|
170367
|
+
const key2 = String(col.key);
|
|
170368
|
+
if (col.filterable === false) return b2`<th></th>`;
|
|
170369
|
+
return b2`<th>
|
|
170370
|
+
<input type="text" placeholder="Filter..." .value=${this.columnFilters[key2] || ""}
|
|
170371
|
+
@input=${(e11) => this.setColumnFilter(key2, e11.target.value)} />
|
|
170372
|
+
</th>`;
|
|
170373
|
+
})}
|
|
170374
|
+
${this.dataActions && this.dataActions.length > 0 ? b2`<th></th>` : b2``}
|
|
170375
|
+
</tr>` : b2``}
|
|
170376
|
+
`;
|
|
170377
|
+
}
|
|
170378
|
+
get __floatingHeaderEl() {
|
|
170379
|
+
return this.shadowRoot?.querySelector(".floatingHeader") ?? null;
|
|
170380
|
+
}
|
|
170381
|
+
get __realTableEl() {
|
|
170382
|
+
return this.shadowRoot?.querySelector(".tableScroll > table") ?? null;
|
|
170383
|
+
}
|
|
170384
|
+
get __floatingTableEl() {
|
|
170385
|
+
return this.shadowRoot?.querySelector(".floatingHeader > table") ?? null;
|
|
170386
|
+
}
|
|
170387
|
+
/**
|
|
170388
|
+
* Walks up the DOM (and through shadow roots) collecting every ancestor
|
|
170389
|
+
* element whose computed `overflow-y` makes it a scroll container, plus
|
|
170390
|
+
* `window` at the end. We listen for scroll on all of them so the floating
|
|
170391
|
+
* header reacts whether the user scrolls the page or any nested container.
|
|
170392
|
+
*/
|
|
170393
|
+
__collectScrollAncestors() {
|
|
170394
|
+
const result = [];
|
|
170395
|
+
let node2 = this;
|
|
170396
|
+
const scrollish = /* @__PURE__ */ __name((v5) => v5 === "auto" || v5 === "scroll" || v5 === "overlay", "scrollish");
|
|
170397
|
+
while (node2) {
|
|
170398
|
+
if (node2 instanceof Element) {
|
|
170399
|
+
const style2 = getComputedStyle(node2);
|
|
170400
|
+
const sy = scrollish(style2.overflowY);
|
|
170401
|
+
const sx = scrollish(style2.overflowX);
|
|
170402
|
+
if (sy || sx) {
|
|
170403
|
+
result.push({ target: node2, scrollsY: sy, scrollsX: sx });
|
|
170404
|
+
}
|
|
170405
|
+
}
|
|
170406
|
+
const parent = node2.assignedSlot ? node2.assignedSlot : node2.parentNode;
|
|
170407
|
+
if (parent) {
|
|
170408
|
+
node2 = parent;
|
|
170409
|
+
} else if (node2.host) {
|
|
170410
|
+
node2 = node2.host;
|
|
170411
|
+
} else {
|
|
170412
|
+
node2 = null;
|
|
170413
|
+
}
|
|
170414
|
+
}
|
|
170415
|
+
result.push({ target: window, scrollsY: true, scrollsX: true });
|
|
170416
|
+
return result;
|
|
170417
|
+
}
|
|
170418
|
+
/**
|
|
170419
|
+
* Returns the "stick line" — the y-coordinate (in viewport space) at which
|
|
170420
|
+
* the floating header should appear. Defaults to 0 (page top), but if the
|
|
170421
|
+
* table is inside a scroll container we use that container's content-box
|
|
170422
|
+
* top so the header sits inside the container's border/padding instead of
|
|
170423
|
+
* floating over it.
|
|
170424
|
+
*/
|
|
170425
|
+
__getStickContext() {
|
|
170426
|
+
let top = 0;
|
|
170427
|
+
let left = 0;
|
|
170428
|
+
let right = window.innerWidth;
|
|
170429
|
+
for (const a5 of this.__scrollAncestors) {
|
|
170430
|
+
if (a5.target === window) continue;
|
|
170431
|
+
const el = a5.target;
|
|
170432
|
+
const r11 = el.getBoundingClientRect();
|
|
170433
|
+
const cs = getComputedStyle(el);
|
|
170434
|
+
if (a5.scrollsY) {
|
|
170435
|
+
const bt = parseFloat(cs.borderTopWidth) || 0;
|
|
170436
|
+
top = Math.max(top, r11.top + bt);
|
|
170437
|
+
}
|
|
170438
|
+
if (a5.scrollsX) {
|
|
170439
|
+
const bl = parseFloat(cs.borderLeftWidth) || 0;
|
|
170440
|
+
const br = parseFloat(cs.borderRightWidth) || 0;
|
|
170441
|
+
left = Math.max(left, r11.left + bl);
|
|
170442
|
+
right = Math.min(right, r11.right - br);
|
|
170443
|
+
}
|
|
170444
|
+
}
|
|
170445
|
+
return { top, left, right };
|
|
170446
|
+
}
|
|
170447
|
+
setupFloatingHeader() {
|
|
170448
|
+
this.teardownFloatingHeader();
|
|
170449
|
+
if (this.fixedHeight) return;
|
|
170450
|
+
const realTable = this.__realTableEl;
|
|
170451
|
+
if (!realTable) return;
|
|
170452
|
+
this.__scrollAncestors = this.__collectScrollAncestors();
|
|
170453
|
+
const tableScrollEl = this.shadowRoot?.querySelector(".tableScroll");
|
|
170454
|
+
if (tableScrollEl) {
|
|
170455
|
+
this.__scrollAncestors.unshift({ target: tableScrollEl, scrollsY: false, scrollsX: true });
|
|
170456
|
+
}
|
|
170457
|
+
this.__floatingResizeObserver = new ResizeObserver(() => {
|
|
170458
|
+
this.__syncFloatingHeader();
|
|
170459
|
+
});
|
|
170460
|
+
this.__floatingResizeObserver.observe(realTable);
|
|
170461
|
+
this.__floatingScrollHandler = () => this.__syncFloatingHeader();
|
|
170462
|
+
for (const a5 of this.__scrollAncestors) {
|
|
170463
|
+
a5.target.addEventListener("scroll", this.__floatingScrollHandler, { passive: true });
|
|
170464
|
+
}
|
|
170465
|
+
window.addEventListener("resize", this.__floatingScrollHandler, { passive: true });
|
|
170466
|
+
this.__syncFloatingHeader();
|
|
170467
|
+
}
|
|
170468
|
+
teardownFloatingHeader() {
|
|
170469
|
+
this.__floatingResizeObserver?.disconnect();
|
|
170470
|
+
this.__floatingResizeObserver = void 0;
|
|
170471
|
+
if (this.__floatingScrollHandler) {
|
|
170472
|
+
for (const a5 of this.__scrollAncestors) {
|
|
170473
|
+
a5.target.removeEventListener("scroll", this.__floatingScrollHandler);
|
|
170474
|
+
}
|
|
170475
|
+
window.removeEventListener("resize", this.__floatingScrollHandler);
|
|
170476
|
+
this.__floatingScrollHandler = void 0;
|
|
170477
|
+
}
|
|
170478
|
+
this.__scrollAncestors = [];
|
|
170479
|
+
this.__floatingActive = false;
|
|
170480
|
+
const fh = this.__floatingHeaderEl;
|
|
170481
|
+
if (fh) fh.classList.remove("active");
|
|
170482
|
+
}
|
|
170483
|
+
/**
|
|
170484
|
+
* Single function that drives both activation and geometry of the floating
|
|
170485
|
+
* header. Called on scroll, resize, table-resize, and after each render.
|
|
170486
|
+
*/
|
|
170487
|
+
__syncFloatingHeader() {
|
|
170488
|
+
const fh = this.__floatingHeaderEl;
|
|
170489
|
+
const realTable = this.__realTableEl;
|
|
170490
|
+
const floatTable = this.__floatingTableEl;
|
|
170491
|
+
if (!fh || !realTable || !floatTable) return;
|
|
170492
|
+
const tableRect = realTable.getBoundingClientRect();
|
|
170493
|
+
const stick = this.__getStickContext();
|
|
170494
|
+
floatTable.style.tableLayout = realTable.style.tableLayout || "auto";
|
|
170495
|
+
const realHeadRows = realTable.tHead?.rows;
|
|
170496
|
+
const floatHeadRows = floatTable.tHead?.rows;
|
|
170497
|
+
let headerHeight = 0;
|
|
170498
|
+
if (realHeadRows && floatHeadRows) {
|
|
170499
|
+
for (let r11 = 0; r11 < realHeadRows.length && r11 < floatHeadRows.length; r11++) {
|
|
170500
|
+
headerHeight += realHeadRows[r11].getBoundingClientRect().height;
|
|
170501
|
+
const realCells = realHeadRows[r11].cells;
|
|
170502
|
+
const floatCells = floatHeadRows[r11].cells;
|
|
170503
|
+
for (let c11 = 0; c11 < realCells.length && c11 < floatCells.length; c11++) {
|
|
170504
|
+
const w4 = realCells[c11].getBoundingClientRect().width;
|
|
170505
|
+
floatCells[c11].style.width = `${w4}px`;
|
|
170506
|
+
floatCells[c11].style.minWidth = `${w4}px`;
|
|
170507
|
+
floatCells[c11].style.maxWidth = `${w4}px`;
|
|
170508
|
+
}
|
|
170509
|
+
}
|
|
170510
|
+
}
|
|
170511
|
+
const shouldBeActive = tableRect.top < stick.top && tableRect.bottom > stick.top + Math.min(headerHeight, 1);
|
|
170512
|
+
if (shouldBeActive !== this.__floatingActive) {
|
|
170513
|
+
this.__floatingActive = shouldBeActive;
|
|
170514
|
+
fh.classList.toggle("active", shouldBeActive);
|
|
170515
|
+
}
|
|
170516
|
+
if (!shouldBeActive) return;
|
|
170517
|
+
const clipLeft = Math.max(tableRect.left, stick.left);
|
|
170518
|
+
const clipRight = Math.min(tableRect.right, stick.right);
|
|
170519
|
+
const clipWidth = Math.max(0, clipRight - clipLeft);
|
|
170520
|
+
fh.style.top = `${stick.top}px`;
|
|
170521
|
+
fh.style.left = `${clipLeft}px`;
|
|
170522
|
+
fh.style.width = `${clipWidth}px`;
|
|
170523
|
+
floatTable.style.width = `${tableRect.width}px`;
|
|
170524
|
+
floatTable.style.marginLeft = `${tableRect.left - clipLeft}px`;
|
|
170525
|
+
}
|
|
170526
|
+
async disconnectedCallback() {
|
|
170527
|
+
super.disconnectedCallback();
|
|
170528
|
+
this.teardownFloatingHeader();
|
|
170529
|
+
}
|
|
170267
170530
|
async firstUpdated() {
|
|
170268
170531
|
}
|
|
170269
170532
|
async updated(changedProperties) {
|
|
170270
170533
|
super.updated(changedProperties);
|
|
170271
170534
|
this.determineColumnWidths();
|
|
170535
|
+
if (changedProperties.has("fixedHeight") || changedProperties.has("data") || changedProperties.has("columns") || !this.__floatingScrollHandler) {
|
|
170536
|
+
if (!this.fixedHeight && this.data.length > 0) {
|
|
170537
|
+
this.setupFloatingHeader();
|
|
170538
|
+
} else {
|
|
170539
|
+
this.teardownFloatingHeader();
|
|
170540
|
+
}
|
|
170541
|
+
}
|
|
170542
|
+
if (!this.fixedHeight && this.data.length > 0) {
|
|
170543
|
+
this.__syncFloatingHeader();
|
|
170544
|
+
}
|
|
170272
170545
|
if (this.searchable) {
|
|
170273
170546
|
const existing = this.dataActions.find((actionArg) => actionArg.type?.includes("header") && actionArg.name === "Search");
|
|
170274
170547
|
if (!existing) {
|
|
@@ -170713,6 +170986,64 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
|
|
|
170713
170986
|
this.emitSelectionChange();
|
|
170714
170987
|
this.requestUpdate();
|
|
170715
170988
|
}
|
|
170989
|
+
/**
|
|
170990
|
+
* Handles row clicks with file-manager style selection semantics:
|
|
170991
|
+
* - plain click: select only this row, set anchor
|
|
170992
|
+
* - cmd/ctrl+click: toggle this row in/out, set anchor
|
|
170993
|
+
* - shift+click: select the contiguous range from the anchor to this row
|
|
170994
|
+
*
|
|
170995
|
+
* Multi-row click selection is always available (`selectionMode === 'none'`
|
|
170996
|
+
* and `'multi'` both behave this way) so consumers can always copy a set
|
|
170997
|
+
* of rows. Only `selectionMode === 'single'` restricts to one row.
|
|
170998
|
+
*/
|
|
170999
|
+
handleRowClick(eventArg, item, rowIndex, view) {
|
|
171000
|
+
const id = this.getRowId(item);
|
|
171001
|
+
if (this.selectionMode === "single") {
|
|
171002
|
+
this.selectedDataRow = item;
|
|
171003
|
+
this.selectedIds.clear();
|
|
171004
|
+
this.selectedIds.add(id);
|
|
171005
|
+
this.__selectionAnchorId = id;
|
|
171006
|
+
this.emitSelectionChange();
|
|
171007
|
+
this.requestUpdate();
|
|
171008
|
+
return;
|
|
171009
|
+
}
|
|
171010
|
+
const isToggle = eventArg.metaKey || eventArg.ctrlKey;
|
|
171011
|
+
const isRange = eventArg.shiftKey;
|
|
171012
|
+
if (isRange && this.__selectionAnchorId !== void 0) {
|
|
171013
|
+
window.getSelection?.()?.removeAllRanges();
|
|
171014
|
+
const anchorIdx = view.findIndex((r11) => this.getRowId(r11) === this.__selectionAnchorId);
|
|
171015
|
+
if (anchorIdx >= 0) {
|
|
171016
|
+
const [a5, b5] = anchorIdx <= rowIndex ? [anchorIdx, rowIndex] : [rowIndex, anchorIdx];
|
|
171017
|
+
this.selectedIds.clear();
|
|
171018
|
+
for (let i11 = a5; i11 <= b5; i11++) this.selectedIds.add(this.getRowId(view[i11]));
|
|
171019
|
+
} else {
|
|
171020
|
+
this.selectedIds.clear();
|
|
171021
|
+
this.selectedIds.add(id);
|
|
171022
|
+
this.__selectionAnchorId = id;
|
|
171023
|
+
}
|
|
171024
|
+
this.selectedDataRow = item;
|
|
171025
|
+
} else if (isToggle) {
|
|
171026
|
+
const wasSelected = this.selectedIds.has(id);
|
|
171027
|
+
if (wasSelected) {
|
|
171028
|
+
this.selectedIds.delete(id);
|
|
171029
|
+
if (this.selectedDataRow === item) {
|
|
171030
|
+
const remaining = view.find((r11) => this.selectedIds.has(this.getRowId(r11)));
|
|
171031
|
+
this.selectedDataRow = remaining;
|
|
171032
|
+
}
|
|
171033
|
+
} else {
|
|
171034
|
+
this.selectedIds.add(id);
|
|
171035
|
+
this.selectedDataRow = item;
|
|
171036
|
+
}
|
|
171037
|
+
this.__selectionAnchorId = id;
|
|
171038
|
+
} else {
|
|
171039
|
+
this.selectedDataRow = item;
|
|
171040
|
+
this.selectedIds.clear();
|
|
171041
|
+
this.selectedIds.add(id);
|
|
171042
|
+
this.__selectionAnchorId = id;
|
|
171043
|
+
}
|
|
171044
|
+
this.emitSelectionChange();
|
|
171045
|
+
this.requestUpdate();
|
|
171046
|
+
}
|
|
170716
171047
|
setRowSelected(row, checked) {
|
|
170717
171048
|
const id = this.getRowId(row);
|
|
170718
171049
|
if (this.selectionMode === "single") {
|
|
@@ -170829,7 +171160,8 @@ _sortBy = new WeakMap();
|
|
|
170829
171160
|
_filterText = new WeakMap();
|
|
170830
171161
|
_columnFilters = new WeakMap();
|
|
170831
171162
|
_showColumnFilters = new WeakMap();
|
|
170832
|
-
|
|
171163
|
+
_showSelectionCheckbox = new WeakMap();
|
|
171164
|
+
_fixedHeight = new WeakMap();
|
|
170833
171165
|
_searchMode = new WeakMap();
|
|
170834
171166
|
_selectionMode = new WeakMap();
|
|
170835
171167
|
_selectedIds = new WeakMap();
|
|
@@ -170857,7 +171189,8 @@ __decorateElement(_init39, 4, "sortBy", _sortBy_dec, _DeesTable, _sortBy);
|
|
|
170857
171189
|
__decorateElement(_init39, 4, "filterText", _filterText_dec, _DeesTable, _filterText);
|
|
170858
171190
|
__decorateElement(_init39, 4, "columnFilters", _columnFilters_dec, _DeesTable, _columnFilters);
|
|
170859
171191
|
__decorateElement(_init39, 4, "showColumnFilters", _showColumnFilters_dec, _DeesTable, _showColumnFilters);
|
|
170860
|
-
__decorateElement(_init39, 4, "
|
|
171192
|
+
__decorateElement(_init39, 4, "showSelectionCheckbox", _showSelectionCheckbox_dec, _DeesTable, _showSelectionCheckbox);
|
|
171193
|
+
__decorateElement(_init39, 4, "fixedHeight", _fixedHeight_dec, _DeesTable, _fixedHeight);
|
|
170861
171194
|
__decorateElement(_init39, 4, "searchMode", _searchMode_dec, _DeesTable, _searchMode);
|
|
170862
171195
|
__decorateElement(_init39, 4, "selectionMode", _selectionMode_dec, _DeesTable, _selectionMode);
|
|
170863
171196
|
__decorateElement(_init39, 4, "selectedIds", _selectedIds_dec, _DeesTable, _selectedIds);
|