dap-design-system 0.62.0 → 0.62.2

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.
Files changed (45) hide show
  1. package/dist/components/combobox/comboboxBase.d.ts +6 -0
  2. package/dist/components/combobox/comboboxBase.js +79 -61
  3. package/dist/components/combobox/comboboxBase.js.map +1 -1
  4. package/dist/components/command/command-item.scss.js +1 -1
  5. package/dist/components/command/command.component.js +12 -12
  6. package/dist/components/command/command.component.js.map +1 -1
  7. package/dist/components/datatable/datatable.component.d.ts +2 -0
  8. package/dist/components/datatable/datatable.component.js +131 -112
  9. package/dist/components/datatable/datatable.component.js.map +1 -1
  10. package/dist/components/datatable/datatable.scss.js +1 -1
  11. package/dist/components/icon-button/icon-button.component.js +15 -12
  12. package/dist/components/icon-button/icon-button.component.js.map +1 -1
  13. package/dist/components/input/input-base-element.js +42 -38
  14. package/dist/components/input/input-base-element.js.map +1 -1
  15. package/dist/components/input/input.component.d.ts +1 -0
  16. package/dist/components/input/input.component.js.map +1 -1
  17. package/dist/components/option-list/option-list.component.js +16 -12
  18. package/dist/components/option-list/option-list.component.js.map +1 -1
  19. package/dist/components/select/select.component.js +71 -66
  20. package/dist/components/select/select.component.js.map +1 -1
  21. package/dist/components/snackbar/snackbar-message.component.js +16 -18
  22. package/dist/components/snackbar/snackbar-message.component.js.map +1 -1
  23. package/dist/components/snackbar/snackbar.component.js +48 -35
  24. package/dist/components/snackbar/snackbar.component.js.map +1 -1
  25. package/dist/components/table/table.component.d.ts +3 -0
  26. package/dist/components/table/table.component.js +30 -27
  27. package/dist/components/table/table.component.js.map +1 -1
  28. package/dist/components/textarea/textarea.component.d.ts +6 -1
  29. package/dist/components/textarea/textarea.component.js +43 -36
  30. package/dist/components/textarea/textarea.component.js.map +1 -1
  31. package/dist/components/tooltip/tooltip.component.d.ts +2 -0
  32. package/dist/components/tooltip/tooltip.component.js +51 -53
  33. package/dist/components/tooltip/tooltip.component.js.map +1 -1
  34. package/dist/internal/mixin/labelableMixin.d.ts +3 -0
  35. package/dist/internal/mixin/labelableMixin.js +15 -12
  36. package/dist/internal/mixin/labelableMixin.js.map +1 -1
  37. package/dist/manifest/types/vue/index.d.ts +87 -84
  38. package/dist/manifest/vscode.html-custom-data.json +64 -60
  39. package/dist/manifest/web-types.json +83 -73
  40. package/dist/react/dap-ds-input/index.d.ts +1 -0
  41. package/dist/react/dap-ds-input/index.js.map +1 -1
  42. package/dist/react/index.d.ts +4 -4
  43. package/dist/react-types.ts +4 -4
  44. package/dist/react.js +22 -22
  45. package/package.json +1 -1
@@ -1,28 +1,28 @@
1
- var O = Object.defineProperty, M = Object.defineProperties;
1
+ var D = Object.defineProperty, H = Object.defineProperties;
2
2
  var N = Object.getOwnPropertyDescriptors;
3
3
  var C = Object.getOwnPropertySymbols;
4
- var I = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
5
- var B = (d, t, e) => t in d ? O(d, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[t] = e, m = (d, t) => {
4
+ var I = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
5
+ var B = (d, t, e) => t in d ? D(d, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[t] = e, m = (d, t) => {
6
6
  for (var e in t || (t = {}))
7
7
  I.call(t, e) && B(d, e, t[e]);
8
8
  if (C)
9
9
  for (var e of C(t))
10
- P.call(t, e) && B(d, e, t[e]);
10
+ T.call(t, e) && B(d, e, t[e]);
11
11
  return d;
12
- }, S = (d, t) => M(d, N(t));
13
- var E = (d) => typeof d == "symbol" ? d : d + "", T = (d, t) => {
12
+ }, S = (d, t) => H(d, N(t));
13
+ var P = (d) => typeof d == "symbol" ? d : d + "", E = (d, t) => {
14
14
  var e = {};
15
15
  for (var i in d)
16
16
  I.call(d, i) && t.indexOf(i) < 0 && (e[i] = d[i]);
17
17
  if (d != null && C)
18
18
  for (var i of C(d))
19
- t.indexOf(i) < 0 && P.call(d, i) && (e[i] = d[i]);
19
+ t.indexOf(i) < 0 && T.call(d, i) && (e[i] = d[i]);
20
20
  return e;
21
21
  };
22
- import { TableController as U, flexRender as R } from "../../node_modules/@tanstack/lit-table/build/lib/index.js";
23
- import { clsx as y } from "../../node_modules/clsx/dist/clsx.js";
22
+ import { TableController as U, flexRender as _ } from "../../node_modules/@tanstack/lit-table/build/lib/index.js";
23
+ import { clsx as f } from "../../node_modules/clsx/dist/clsx.js";
24
24
  import "../../node_modules/@lit/reactive-element/reactive-element.js";
25
- import { nothing as f } from "../../node_modules/lit-html/lit-html.js";
25
+ import { nothing as y } from "../../node_modules/lit-html/lit-html.js";
26
26
  import "../../node_modules/lit-element/lit-element.js";
27
27
  import { property as l } from "../../node_modules/@lit/reactive-element/decorators/property.js";
28
28
  import { state as z } from "../../node_modules/@lit/reactive-element/decorators/state.js";
@@ -31,9 +31,9 @@ import { repeat as w } from "../../node_modules/lit-html/directives/repeat.js";
31
31
  import { html as p, unsafeStatic as L } from "../../node_modules/lit-html/static.js";
32
32
  import { DdsElement as K } from "../../internal/dds-hu-element.js";
33
33
  import "../../localization/localization.js";
34
- import F from "../checkbox/checkbox.component.js";
35
- import j from "../icons/arrows/arrows-arrow-down-s-line/arrows-arrow-down-s-line.component.js";
36
- import W from "../icons/arrows/arrows-arrow-up-s-line/arrows-arrow-up-s-line.component.js";
34
+ import W from "../checkbox/checkbox.component.js";
35
+ import F from "../icons/arrows/arrows-arrow-down-s-line/arrows-arrow-down-s-line.component.js";
36
+ import j from "../icons/arrows/arrows-arrow-up-s-line/arrows-arrow-up-s-line.component.js";
37
37
  import X from "../pager/pager.component.js";
38
38
  import Z from "../skeleton/skeleton.component.js";
39
39
  import G from "../spinner/spinner.component.js";
@@ -43,11 +43,11 @@ import { t as u } from "../../node_modules/i18next/dist/esm/i18next.js";
43
43
  import { getPaginationRowModel as q, getSortedRowModel as J, getCoreRowModel as Q } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
44
44
  import { unsafeCSS as tt } from "../../node_modules/@lit/reactive-element/css-tag.js";
45
45
  var et = Object.defineProperty, r = (d, t, e, i) => {
46
- for (var n = void 0, s = d.length - 1, o; s >= 0; s--)
47
- (o = d[s]) && (n = o(t, e, n) || n);
48
- return n && et(t, e, n), n;
46
+ for (var o = void 0, s = d.length - 1, n; s >= 0; s--)
47
+ (n = d[s]) && (o = n(t, e, o) || o);
48
+ return o && et(t, e, o), o;
49
49
  };
50
- const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
50
+ const x = "__multiSelect__", it = 40, nt = 100, A = 10, $ = class $ extends K {
51
51
  constructor() {
52
52
  super(...arguments), this.tableController = new U(this), this.stickyOffsets = /* @__PURE__ */ new Map(), this.data = [], this.columns = [], this.rowKey = "id", this.enableRowSelection = !1, this.stickySelectionColumn = !1, this.enableSorting = !1, this.enableColumnResizing = !1, this.manualSorting = !1, this.manualPagination = !1, this.autoResetPageIndex = !1, this.enableRowClick = !1, this.loading = !1, this.enableStripedRows = !1, this.loadingType = "spinner", this.loadingVariant = "neutral", this.loadingSize = "lg", this.disableHeaderOnEmpty = "true", this.showPagerOnEmpty = !1, this.pager = !1, this.showPageSizeOptions = "true", this.showPageIndex = "true", this.showPageCount = "true", this.showFirstButton = "true", this.showPreviousButton = "true", this.showNextButton = "true", this.showLastButton = "true", this.showPageNumbers = "false", this.siblingCount = 1, this.sortButtonTestId = "datatable-sort-button", this.pageSizeOptions = [10, 25, 50, 100], this._sorting = [], this._rowSelection = {}, this._pagination = {
53
53
  pageIndex: 0,
@@ -85,11 +85,12 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
85
85
  <colgroup>
86
86
  ${w(
87
87
  e,
88
- (n, s) => n.id || `col-${s}`,
89
- (n) => {
90
- const s = n;
91
- let o;
92
- return i && s.id && i[s.id] ? o = `${i[s.id]}px` : s.size ? o = `${s.size}px` : o = "auto", p`<col style="width: ${o};" />`;
88
+ (o, s) => o.id || `col-${s}`,
89
+ (o) => {
90
+ const s = o;
91
+ let n;
92
+ const c = this.columnIdOf(s);
93
+ return c && i[c] ? n = `${i[c]}px` : s.size ? n = `${s.size}px` : n = "auto", p`<col style="width: ${n};" />`;
93
94
  }
94
95
  )}
95
96
  </colgroup>
@@ -102,7 +103,7 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
102
103
  (e) => p`
103
104
  <tr
104
105
  part="header-row"
105
- class=${y("data-table-header-row", {
106
+ class=${f("data-table-header-row", {
106
107
  "data-table-header-row--striped": this.enableStripedRows
107
108
  })}>
108
109
  ${w(
@@ -116,14 +117,14 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
116
117
  </thead>
117
118
  `, this.renderSkeletonRows = (t, e) => p`
118
119
  ${w(
119
- Array.from({ length: t }, (i, n) => n),
120
+ Array.from({ length: t }, (i, o) => o),
120
121
  (i) => i,
121
122
  (i) => p`
122
123
  <tr class="data-table-row">
123
124
  ${w(
124
- Array.from({ length: e }, (n, s) => s),
125
- (n) => n,
126
- (n) => p`<td class="data-table-cell">
125
+ Array.from({ length: e }, (o, s) => s),
126
+ (o) => o,
127
+ (o) => p`<td class="data-table-cell">
127
128
  <dap-ds-skeleton></dap-ds-skeleton>
128
129
  </td>`
129
130
  )}
@@ -171,34 +172,34 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
171
172
  </div>
172
173
  </td>
173
174
  </tr>` : t.getRowModel().rows.map(
174
- (n, s) => p`
175
+ (o, s) => p`
175
176
  <tr
176
177
  part="row"
177
178
  role=${this.enableRowClick ? "button" : "row"}
178
179
  tabindex=${this.enableRowClick ? 0 : -1}
179
- aria-selected=${n.getIsSelected()}
180
+ aria-selected=${o.getIsSelected()}
180
181
  aria-rowindex=${s + 2}
181
- class=${y("data-table-row", {
182
- "data-table-row--selected": n.getIsSelected(),
182
+ class=${f("data-table-row", {
183
+ "data-table-row--selected": o.getIsSelected(),
183
184
  "data-table-row--clickable": this.enableRowClick,
184
185
  "data-table-row--striped": this.enableStripedRows
185
186
  })}
186
- @click=${() => this.handleRowClick(n)}
187
- @keydown=${(o) => this.handleRowKeydown(o, n)}>
188
- ${n.getVisibleCells().map((o) => {
189
- const g = o.column.columnDef, c = this.stickyOffsets.get(o.column.id), h = [
190
- g.textAlign && `text-align: ${g.textAlign};`,
191
- this.getStickyStyle(o.column.id)
187
+ @click=${() => this.handleRowClick(o)}
188
+ @keydown=${(n) => this.handleRowKeydown(n, o)}>
189
+ ${o.getVisibleCells().map((n) => {
190
+ const c = n.column.columnDef, g = this.stickyOffsets.get(n.column.id), h = [
191
+ c.textAlign && `text-align: ${c.textAlign};`,
192
+ this.getStickyStyle(n.column.id)
192
193
  ].filter(Boolean).join(" ") || void 0;
193
194
  return p`
194
195
  <td
195
196
  part="cell"
196
- class=${y(
197
+ class=${f(
197
198
  "data-table-cell",
198
- c && `data-table-cell--sticky-${c.side}`
199
+ g && `data-table-cell--sticky-${g.side}`
199
200
  )}
200
201
  style="${b(h)}">
201
- ${this.renderCell(o)}
202
+ ${this.renderCell(n)}
202
203
  </td>
203
204
  `;
204
205
  })}
@@ -244,14 +245,14 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
244
245
  // without a size contributes 0 and the next one on that side would overlap it.
245
246
  computeStickyOffsets(t) {
246
247
  const e = /* @__PURE__ */ new Map(), i = t.getVisibleLeafColumns();
247
- let n = 0;
248
- for (let o = i.length - 1; o >= 0; o--) {
249
- const g = i[o];
250
- g.columnDef.sticky === "right" && (e.set(g.id, { side: "right", offset: n }), n += g.getSize());
248
+ let o = 0;
249
+ for (let n = i.length - 1; n >= 0; n--) {
250
+ const c = i[n];
251
+ c.columnDef.sticky === "right" && (e.set(c.id, { side: "right", offset: o }), o += c.getSize());
251
252
  }
252
253
  let s = 0;
253
- for (const o of i)
254
- o.columnDef.sticky === "left" && (e.set(o.id, { side: "left", offset: s }), s += o.getSize());
254
+ for (const n of i)
255
+ n.columnDef.sticky === "left" && (e.set(n.id, { side: "left", offset: s }), s += n.getSize());
255
256
  this.stickyOffsets = e;
256
257
  }
257
258
  // Inline sticky positioning for a pinned column. z-index lifts the cell above
@@ -265,31 +266,31 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
265
266
  }
266
267
  renderHeaderCell(t, e = !1) {
267
268
  var k;
268
- const i = t.column.columnDef, n = t.column.getCanSort(), s = t.column.getIsSorted(), o = t.column.getNextSortingOrder(), g = (k = i.disableDefaultSorting) != null ? k : !1, c = this.stickyOffsets.get(t.column.id), h = [this.getHeaderCellStyle(t), this.getStickyStyle(t.column.id)].filter(Boolean).join(" ") || void 0, v = i.headerTextAlign ? `justify-content: ${i.headerTextAlign};` : void 0, D = this.getSortIcon(s), H = this.getSortTitle(n, o), _ = this.getCanResize(t);
269
+ const i = t.column.columnDef, o = t.column.getCanSort(), s = t.column.getIsSorted(), n = t.column.getNextSortingOrder(), c = (k = i.disableDefaultSorting) != null ? k : !1, g = this.stickyOffsets.get(t.column.id), h = [this.getHeaderCellStyle(t), this.getStickyStyle(t.column.id)].filter(Boolean).join(" ") || void 0, v = i.headerTextAlign ? `justify-content: ${i.headerTextAlign};` : void 0, O = this.getSortIcon(s), M = this.getSortTitle(o, n), R = this.getCanResize(t);
269
270
  return p`
270
271
  <th
271
272
  colspan="${t.colSpan}"
272
273
  rowspan="${t.rowSpan}"
273
274
  part="header-cell"
274
275
  id="${this.getHeaderCellId(t.column.id)}"
275
- class=${y(
276
+ class=${f(
276
277
  "data-table-header-cell",
277
- c && `data-table-header-cell--sticky-${c.side}`,
278
- _ && "data-table-header-cell--resizable"
278
+ g && `data-table-header-cell--sticky-${g.side}`,
279
+ R && "data-table-header-cell--resizable"
279
280
  )}
280
281
  scope="col"
281
- aria-sort=${n && !this.shouldDisableHeaderActions ? this.getAriaSortValue(s) : "none"}
282
+ aria-sort=${o && !this.shouldDisableHeaderActions ? this.getAriaSortValue(s) : "none"}
282
283
  style="${b(h)}">
283
284
  ${this.renderHeaderCellContent(
284
285
  t,
285
286
  i,
286
- n,
287
- g,
288
- H,
287
+ o,
288
+ c,
289
+ M,
289
290
  v,
290
- D
291
+ O
291
292
  )}
292
- ${_ ? this.renderResizeHandle(t) : f}
293
+ ${R ? this.renderResizeHandle(t) : y}
293
294
  </th>
294
295
  `;
295
296
  }
@@ -316,12 +317,12 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
316
317
  var s;
317
318
  const i = (s = this._columnSizing[t.column.id]) != null ? s : t.column.columnDef.size;
318
319
  if (i) return i;
319
- const n = e.closest("th");
320
- return (n == null ? void 0 : n.getBoundingClientRect().width) || t.column.getSize();
320
+ const o = e.closest("th");
321
+ return (o == null ? void 0 : o.getBoundingClientRect().width) || t.column.getSize();
321
322
  }
322
323
  setColumnWidth(t, e) {
323
- const { min: i, max: n } = this.getResizeBounds(t), s = Math.round(
324
- Math.min(Math.max(e, i), n != null ? n : Number.POSITIVE_INFINITY)
324
+ const { min: i, max: o } = this.getResizeBounds(t), s = Math.round(
325
+ Math.min(Math.max(e, i), o != null ? o : Number.POSITIVE_INFINITY)
325
326
  );
326
327
  return this._columnSizing[t.column.id] === s ? !1 : (this._columnSizing = S(m({}, this._columnSizing), { [t.column.id]: s }), !0);
327
328
  }
@@ -333,45 +334,45 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
333
334
  handleResizePointerDown(t, e) {
334
335
  if (t.button !== 0) return;
335
336
  t.preventDefault(), t.stopPropagation();
336
- const i = t.currentTarget, n = t.clientX, s = this.getStartWidth(e, i);
337
- let o = !1;
337
+ const i = t.currentTarget, o = t.clientX, s = this.getStartWidth(e, i);
338
+ let n = !1;
338
339
  try {
339
340
  i.setPointerCapture(t.pointerId);
340
341
  } catch (h) {
341
342
  }
342
343
  this.toggleAttribute("resizing", !0);
343
- const g = (h) => {
344
- o = this.setColumnWidth(e, s + h.clientX - n) || o;
345
- }, c = () => {
346
- window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", c), this.toggleAttribute("resizing", !1), o && this.emitColumnSizingChange();
344
+ const c = (h) => {
345
+ n = this.setColumnWidth(e, s + h.clientX - o) || n;
346
+ }, g = () => {
347
+ window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", g), window.removeEventListener("pointercancel", g), this.toggleAttribute("resizing", !1), n && this.emitColumnSizingChange();
347
348
  };
348
- window.addEventListener("pointermove", g), window.addEventListener("pointerup", c), window.addEventListener("pointercancel", c);
349
+ window.addEventListener("pointermove", c), window.addEventListener("pointerup", g), window.addEventListener("pointercancel", g);
349
350
  }
350
351
  handleResizeKeydown(t, e) {
351
- const { min: i, max: n } = this.getResizeBounds(e), s = this.getStartWidth(e, t.currentTarget), o = {
352
+ const { min: i, max: o } = this.getResizeBounds(e), s = this.getStartWidth(e, t.currentTarget), n = {
352
353
  ArrowLeft: s - A,
353
354
  ArrowRight: s + A,
354
355
  Home: i,
355
- End: n
356
+ End: o
356
357
  };
357
- if (!(t.key in o)) return;
358
+ if (!(t.key in n)) return;
358
359
  t.preventDefault(), t.stopPropagation();
359
- const g = o[t.key];
360
- g !== void 0 && this.setColumnWidth(e, g) && this.emitColumnSizingChange();
360
+ const c = n[t.key];
361
+ c !== void 0 && this.setColumnWidth(e, c) && this.emitColumnSizingChange();
361
362
  }
362
363
  // Double-click drops the override, so the column falls back to its defined size
363
364
  handleResizeReset(t, e) {
364
365
  var s;
365
366
  if (t.preventDefault(), t.stopPropagation(), !(e.column.id in this._columnSizing)) return;
366
- const o = this._columnSizing, { [s = e.column.id]: i } = o, n = T(o, [E(s)]);
367
- this._columnSizing = n, this.emitColumnSizingChange();
367
+ const n = this._columnSizing, { [s = e.column.id]: i } = n, o = E(n, [P(s)]);
368
+ this._columnSizing = o, this.emitColumnSizingChange();
368
369
  }
369
370
  // A focusable splitter (WAI-ARIA window splitter pattern): drag with the
370
371
  // pointer, ArrowLeft/ArrowRight to step, Home/End for the bounds. It is a
371
372
  // sibling of the sort button, so its clicks never toggle sorting.
372
373
  renderResizeHandle(t) {
373
374
  var s;
374
- const { min: e, max: i } = this.getResizeBounds(t), n = Math.round(
375
+ const { min: e, max: i } = this.getResizeBounds(t), o = Math.round(
375
376
  (s = this._columnSizing[t.column.id]) != null ? s : t.column.getSize()
376
377
  );
377
378
  return p`<div
@@ -383,19 +384,19 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
383
384
  aria-labelledby="data-table-resize-label ${this.getHeaderCellId(
384
385
  t.column.id
385
386
  )}"
386
- aria-valuenow=${n}
387
+ aria-valuenow=${o}
387
388
  aria-valuemin=${e}
388
389
  aria-valuemax=${b(i)}
389
- @pointerdown=${(o) => this.handleResizePointerDown(o, t)}
390
- @keydown=${(o) => this.handleResizeKeydown(o, t)}
391
- @dblclick=${(o) => this.handleResizeReset(o, t)}
392
- @click=${(o) => o.stopPropagation()}></div>`;
390
+ @pointerdown=${(n) => this.handleResizePointerDown(n, t)}
391
+ @keydown=${(n) => this.handleResizeKeydown(n, t)}
392
+ @dblclick=${(n) => this.handleResizeReset(n, t)}
393
+ @click=${(n) => n.stopPropagation()}></div>`;
393
394
  }
394
- renderHeaderCellContent(t, e, i, n, s, o, g) {
395
+ renderHeaderCellContent(t, e, i, o, s, n, c) {
395
396
  if (!i)
396
- return R(e.header, t.getContext());
397
- const c = n || this.shouldDisableHeaderActions ? "div" : "dap-ds-button", h = !n && !this.shouldDisableHeaderActions ? t.column.getToggleSortingHandler() : null, v = i && !this.shouldDisableHeaderActions ? "pointer" : "not-allowed";
398
- return p`<${L(c)}
397
+ return _(e.header, t.getContext());
398
+ const g = o || this.shouldDisableHeaderActions ? "div" : "dap-ds-button", h = !o && !this.shouldDisableHeaderActions ? t.column.getToggleSortingHandler() : null, v = i && !this.shouldDisableHeaderActions ? "pointer" : "not-allowed";
399
+ return p`<${L(g)}
399
400
  class="data-table-header-cell__controller"
400
401
  variant="clean"
401
402
  data-testid="${this.sortButtonTestId}-${t.column.id}"
@@ -405,15 +406,15 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
405
406
  <span
406
407
  part="content"
407
408
  class="data-table-header-cell__content"
408
- style="${b(o)}">
409
- ${R(e.header, t.getContext())}
410
- ${g}
409
+ style="${b(n)}">
410
+ ${_(e.header, t.getContext())}
411
+ ${c}
411
412
  </span>
412
- </${L(c)}>`;
413
+ </${L(g)}>`;
413
414
  }
414
415
  getHeaderCellStyle(t) {
415
- var n;
416
- const e = t.column.columnDef, i = (n = this._columnSizing[t.column.id]) != null ? n : e.size;
416
+ var o;
417
+ const e = t.column.columnDef, i = (o = this._columnSizing[t.column.id]) != null ? o : e.size;
417
418
  if (!(!i && !e.maxSize && !e.headerTextAlign))
418
419
  return `
419
420
  ${i ? `width: ${i}px;` : ""}
@@ -440,8 +441,8 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
440
441
  * render callbacks, and Lit templates
441
442
  */
442
443
  renderCell(t) {
443
- const e = t.column.columnDef.cell, i = t.getContext(), n = typeof e == "function" ? e(i) : e, s = Y(n);
444
- return typeof s == "string" || typeof s == "number" || typeof s == "boolean" || s === null || s === void 0 || s instanceof HTMLElement ? s : R(e, i);
444
+ const e = t.column.columnDef.cell, i = t.getContext(), o = typeof e == "function" ? e(i) : e, s = Y(o);
445
+ return typeof s == "string" || typeof s == "number" || typeof s == "boolean" || s === null || s === void 0 || s instanceof HTMLElement ? s : _(e, i);
445
446
  }
446
447
  handleRowClick(t) {
447
448
  this.enableRowClick && this.emit("dds-row-click", { row: t });
@@ -455,8 +456,25 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
455
456
  t.preventDefault(), this.handleRowClick(e);
456
457
  }
457
458
  }
459
+ // The id TanStack keys sizing state by: an explicit id, else the accessorKey
460
+ columnIdOf(t) {
461
+ var e;
462
+ return (e = t.id) != null ? e : t.accessorKey;
463
+ }
464
+ // The table's min-width: the sum of every column's nominal width. A fixed-layout
465
+ // table only grows to its sized columns, so without this the auto columns get
466
+ // squeezed out. (`min-width: max-content` is not an option: Firefox resolves a
467
+ // fixed-layout table's max-content to infinity and stretches the first column.)
468
+ // Reads the column definitions, not table.getAllLeafColumns(): TanStack merges
469
+ // its default 150px size into every column, which would hide the auto ones.
470
+ getTableMinWidth() {
471
+ return this.columnsMemo().reduce((t, e) => {
472
+ const i = e, o = this.columnIdOf(i), s = o && this._columnSizing[o] || i.size || i.minSize || nt;
473
+ return t + s;
474
+ }, 0);
475
+ }
458
476
  render() {
459
- var e, i, n, s;
477
+ var e, i, o, s;
460
478
  const t = this.tableController.table(S(m({
461
479
  data: this.data,
462
480
  columns: this.columnsMemo(),
@@ -472,26 +490,26 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
472
490
  enableRowSelection: this.enableRowSelection,
473
491
  manualPagination: this.manualPagination,
474
492
  autoResetPageIndex: this.autoResetPageIndex,
475
- onSortingChange: (o) => {
476
- typeof o == "function" ? this._sorting = o(this._sorting) : this._sorting = o, this.emit("dds-sorting-change", { sorting: this._sorting });
493
+ onSortingChange: (n) => {
494
+ typeof n == "function" ? this._sorting = n(this._sorting) : this._sorting = n, this.emit("dds-sorting-change", { sorting: this._sorting });
477
495
  },
478
496
  getCoreRowModel: Q()
479
497
  }, !this.manualSorting && {
480
498
  getSortedRowModel: J()
481
499
  }), {
482
500
  getPaginationRowModel: q(),
483
- onPaginationChange: (o) => {
484
- typeof o == "function" ? this._pagination = o(this._pagination) : this._pagination = o, this.emit("dds-pagination-change", {
501
+ onPaginationChange: (n) => {
502
+ typeof n == "function" ? this._pagination = n(this._pagination) : this._pagination = n, this.emit("dds-pagination-change", {
485
503
  pagination: {
486
504
  pageIndex: this._pagination.pageIndex,
487
505
  pageSize: this._pagination.pageSize
488
506
  }
489
507
  });
490
508
  },
491
- onRowSelectionChange: (o) => {
492
- typeof o == "function" ? this._rowSelection = o(this._rowSelection) : this._rowSelection = o, this.emit("dds-selection-change", { selection: this._rowSelection });
509
+ onRowSelectionChange: (n) => {
510
+ typeof n == "function" ? this._rowSelection = n(this._rowSelection) : this._rowSelection = n, this.emit("dds-selection-change", { selection: this._rowSelection });
493
511
  },
494
- getRowId: (o) => o[this.rowKey],
512
+ getRowId: (n) => n[this.rowKey],
495
513
  rowCount: (e = this.rowCount) != null ? e : this.data ? this.data.length : 0,
496
514
  debugTable: this.debug,
497
515
  debugHeaders: this.debug,
@@ -506,27 +524,28 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
506
524
  (i = this.ariaLabel) != null ? i : u("datatable.tableDescription")
507
525
  )}
508
526
  aria-describedby=${b(this.ariaDescribedBy)}
509
- aria-rowcount=${(n = this.rowCount) != null ? n : this.data ? this.data.length : 0}
510
- class=${y("data-table", {
527
+ aria-rowcount=${(o = this.rowCount) != null ? o : this.data ? this.data.length : 0}
528
+ class=${f("data-table", {
511
529
  "data-table--loading": this.loading
512
- })}>
530
+ })}
531
+ style="min-width: ${this.getTableMinWidth()}px;">
513
532
  ${this.caption ? p`<caption class="visually-hidden">
514
533
  ${this.caption}
515
- </caption>` : f}
534
+ </caption>` : y}
516
535
  ${this.renderColgroup(t)} ${this.renderHeader(t)}
517
536
  ${this.renderBody(t)}
518
537
  </table>
519
538
  </div>
520
539
  ${this.enableColumnResizing ? p`<span id="data-table-resize-label" hidden
521
540
  >${u("datatable.resizeColumn")}</span
522
- >` : f}
541
+ >` : y}
523
542
  ${this._statusMessage ? p`<div
524
543
  aria-live="polite"
525
544
  aria-atomic="true"
526
545
  class="visually-hidden"
527
546
  id="table-status">
528
547
  ${this._statusMessage}
529
- </div>` : f}
548
+ </div>` : y}
530
549
  ${this.pager && !this.isTableEmpty || this.pager && this.showPagerOnEmpty && this.isTableEmpty ? p`<dap-ds-pager
531
550
  class="data-table-pager"
532
551
  part="pager"
@@ -551,8 +570,8 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
551
570
  .lastButtonLabel=${this.lastButtonLabel}
552
571
  .pageStateText=${this.pageStateText}
553
572
  exportparts="base:pager-base, first:pager-first, previous:pager-previous, next:pager-next, last:pager-last, page-size:pager-page-size-select, page-size-select-base:page-size-select-base, page-size-select-trigger:page-size-select-trigger, pager-button-first-base:pager-button-first-base, pager-button-first-content:pager-button-first-content, pager-button-previous-base:pager-button-previous-base, pager-button-previous-content:pager-button-previous-content, pager-button-next-base:pager-button-next-base, pager-button-next-content:pager-button-next-content, pager-button-last-base:pager-button-last-base, pager-button-last-content:pager-button-last-content, page-numbers:pager-page-numbers, page-number:pager-page-number, page-number-active:pager-page-number-active, page-number-base:pager-page-number-base, page-number-content:pager-page-number-content, page-info:pager-page-info"
554
- @dds-pagination-change=${(o) => {
555
- o.preventDefault(), o.stopPropagation(), o.detail.action === "pageSize" ? t.setPageSize(o.detail.pagination.pageSize) : t.setPageIndex(o.detail.pagination.pageIndex);
573
+ @dds-pagination-change=${(n) => {
574
+ n.preventDefault(), n.stopPropagation(), n.detail.action === "pageSize" ? t.setPageSize(n.detail.pagination.pageSize) : t.setPageIndex(n.detail.pagination.pageIndex);
556
575
  }}>
557
576
  <slot name="first-button-label" slot="first-button-label">
558
577
  ${this.firstButtonLabel || u("pager.first")}
@@ -566,14 +585,14 @@ const x = "__multiSelect__", it = 40, A = 10, $ = class $ extends K {
566
585
  <slot name="last-button-label" slot="last-button-label">
567
586
  ${this.lastButtonLabel || u("pager.last")}
568
587
  </slot>
569
- </dap-ds-pager>` : f}
588
+ </dap-ds-pager>` : y}
570
589
  `;
571
590
  }
572
591
  };
573
592
  $.tagName = "dap-ds-datatable", $.dependencies = {
574
- "dap-ds-checkbox": F,
575
- "dap-ds-icon-arrow-up-s-line": W,
576
- "dap-ds-icon-arrow-down-s-line": j,
593
+ "dap-ds-checkbox": W,
594
+ "dap-ds-icon-arrow-up-s-line": j,
595
+ "dap-ds-icon-arrow-down-s-line": F,
577
596
  "dap-ds-skeleton": Z,
578
597
  "dap-ds-spinner": G,
579
598
  "dap-ds-pager": X