@design.estate/dees-catalog 24.0.2 → 24.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4169,6 +4169,16 @@ var demoMovements = [
4169
4169
  { id: "m7", booked: "2026-08-12", payee: "Telekom", account: "sparkasse", month: "2026-08", amount: -39.95, private: false }
4170
4170
  ];
4171
4171
  var accountNames = { sparkasse: "Sparkasse", n26: "N26" };
4172
+ var demoTickets = [
4173
+ { id: "t1", opened: "2026-09-29", summary: "Invoices from the Hamburg office arrive twice since the mail gateway moved, and the second copy is booked as a new document", owner: "Finance" },
4174
+ { id: "t2", opened: "2026-09-24", summary: "Scanner in the hallway stops after forty pages", owner: "Facilities" },
4175
+ { id: "t3", opened: "2026-09-18", summary: "Single sign-on asks new colleagues to choose an organization they do not belong to, and a wrong choice cannot be undone without an administrator", owner: "Platform" }
4176
+ ];
4177
+ var ticketColumns = [
4178
+ { key: "opened", header: "Opened" },
4179
+ { key: "summary", header: "Summary", wrap: true },
4180
+ { key: "owner", header: "Owner" }
4181
+ ];
4172
4182
  var euro = new Intl.NumberFormat("en-US", { style: "currency", currency: "EUR" });
4173
4183
  var movementColumns = [
4174
4184
  { key: "booked", header: "Booked" },
@@ -4525,6 +4535,13 @@ var _DeesDemoTableWorkspace = class _DeesDemoTableWorkspace extends (_b2 = DeesE
4525
4535
  .displayFunction=${(person) => ({ name: person.name, Email: person.email, Team: person.team })}
4526
4536
  .data=${[{ name: "Alex Morgan", email: "alex@example.com", team: "Design" }, { name: "Sam Rivera", email: "sam@example.com", team: "Engineering" }, { name: "Jamie Chen", email: "jamie@example.com", team: "Product" }]}></dees-table>
4527
4537
  </section>
4538
+ <section class="example">
4539
+ <p class="caption">A wrapping column fits the table to its container: the columns beside it keep their one line,
4540
+ it takes the room they leave and wraps within it, and the rows grow. Narrow the window to watch it. Only when a
4541
+ wrapping column would fall below 20ch does the table scroll sideways.</p>
4542
+ <dees-table heading1="Support tickets" heading2="A wrapping column" dataName="tickets"
4543
+ .columns=${ticketColumns} .data=${demoTickets} .rowKey=${"id"}></dees-table>
4544
+ </section>
4528
4545
  <section class="example">
4529
4546
  <p class="caption">Rows can offer different actions: an e-invoice can be validated and shows its XML source from the
4530
4547
  "…" menu, a PDF cannot. Each action keeps its place in the actions column, and a row leaves the place of an action
@@ -8413,6 +8430,13 @@ var tableStyles = [
8413
8430
  .floatingHeader table { margin: 0; }
8414
8431
  .floatingHeader th { pointer-events: auto; }
8415
8432
  table { width: max-content; min-width: 100%; caption-side: bottom; font-size: inherit; border-collapse: separate; border-spacing: 0; }
8433
+ /* With a wrapping column the table fits its container: automatic layout gives every column its
8434
+ minimum, which for a cell that stays on one line is that line, and hands what is left to the
8435
+ columns that can use it, the wrapping ones. Scoped to the data rows: the empty state wraps. */
8436
+ table.wrapsCells { width: 100%; }
8437
+ table.wrapsCells th, table.wrapsCells tr[data-row-idx] > td { white-space: nowrap; }
8438
+ table.wrapsCells tr[data-row-idx] > td.wrapCell { white-space: normal; overflow-wrap: break-word; }
8439
+ table.wrapsCells tr[data-row-idx] > td.wrapCell .innerCellContainer { min-width: 20ch; }
8416
8440
  th, td { box-sizing: border-box; padding: 6px 16px; text-align: start; vertical-align: middle; }
8417
8441
  th { height: var(--table-header-height); background: var(--table-head-surface); color: var(--dees-color-text-secondary); font-size: 12px; font-weight: 500; border-bottom: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle); }
8418
8442
  td { height: 40px; position: relative; color: var(--dees-color-text-primary); border-bottom: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle); font-size: 13px; }
@@ -10809,6 +10833,8 @@ var _DeesTable = class _DeesTable extends (_a17 = DeesElement, _heading1_dec = [
10809
10833
  * width, in the windows shown since the widths were frozen.
10810
10834
  */
10811
10835
  __publicField(this, "__columnContentWidths");
10836
+ /** The container's width the column widths were measured at, for a table that fits it. */
10837
+ __publicField(this, "__columnsFittedTo");
10812
10838
  __publicField(this, "__virtualSettleFrame");
10813
10839
  __privateAdd(this, ___virtualRange, __runInitializers(_init19, 212, this, { start: 0, end: 0 })), __runInitializers(_init19, 215, this);
10814
10840
  /** The row that holds the rows' tab stop in a table whose rows activate. */
@@ -11233,7 +11259,8 @@ var _DeesTable = class _DeesTable extends (_a17 = DeesElement, _heading1_dec = [
11233
11259
  ${this.loading && viewData.length && showRows ? b`<div class="refreshBar" aria-hidden="true"></div>` : ""}
11234
11260
  <div class="tableScrollFrame">
11235
11261
  <div class="tableScroll">
11236
- <table aria-label=${this.label || this.heading1 || this.__dataNames?.other || this.t("table.data")}>
11262
+ <table class=${effectiveColumns.some((col) => col.wrap && !col.hidden) ? "wrapsCells" : ""}
11263
+ aria-label=${this.label || this.heading1 || this.__dataNames?.other || this.t("table.data")}>
11237
11264
  <thead>
11238
11265
  ${this.renderHeaderRows(effectiveColumns)}
11239
11266
  </thead>
@@ -11286,6 +11313,7 @@ var _DeesTable = class _DeesTable extends (_a17 = DeesElement, _heading1_dec = [
11286
11313
  const isFlashing = flashToken !== void 0;
11287
11314
  const useFlashBorder = isFlashing && !!col.flashBorder;
11288
11315
  const cellClasses = [
11316
+ col.wrap ? "wrapCell" : "",
11289
11317
  isEditable ? "editable" : "",
11290
11318
  isFocused && !isEditing ? "focused" : "",
11291
11319
  isEditing ? "editingCell" : ""
@@ -11377,6 +11405,7 @@ var _DeesTable = class _DeesTable extends (_a17 = DeesElement, _heading1_dec = [
11377
11405
  const ariaSort = this.getAriaSort(col, underColumns);
11378
11406
  return b`
11379
11407
  <th
11408
+ class=${col.wrap ? "wrapCell" : ""}
11380
11409
  role="columnheader"
11381
11410
  scope="col"
11382
11411
  aria-sort=${ariaSort}
@@ -11565,6 +11594,7 @@ var _DeesTable = class _DeesTable extends (_a17 = DeesElement, _heading1_dec = [
11565
11594
  });
11566
11595
  }
11567
11596
  this.__floatingResizeObserver = new ResizeObserver(() => {
11597
+ this.__refitWrappingColumns();
11568
11598
  this.__syncViewportWidth();
11569
11599
  this.__syncScrollport();
11570
11600
  this.__syncPinnedActions();
@@ -11836,8 +11866,10 @@ var _DeesTable = class _DeesTable extends (_a17 = DeesElement, _heading1_dec = [
11836
11866
  * A column that needs more than it has takes the room the columns were
11837
11867
  * stretched by to fill the table's container, shared out in proportion to
11838
11868
  * what each needs as the browser shares it; the table grows wider than its
11839
- * container only once the columns need more than it holds. Returns whether
11840
- * a column's width changed.
11869
+ * container only once the columns need more than it holds. A wrapping column
11870
+ * needs no more than it has: it gives the columns beside it the room they
11871
+ * need, down to what it can narrow to. Returns whether a column's width
11872
+ * changed.
11841
11873
  */
11842
11874
  __growColumnWidths() {
11843
11875
  const table = this.__realTableEl;
@@ -11846,6 +11878,7 @@ var _DeesTable = class _DeesTable extends (_a17 = DeesElement, _heading1_dec = [
11846
11878
  const cells = Array.from(headerRow.cells).filter(
11847
11879
  (cell) => !cell.classList.contains("actionsCol") && !cell.classList.contains("selectionCol")
11848
11880
  );
11881
+ const wrapping = cells.map((cell) => cell.classList.contains("wrapCell"));
11849
11882
  const frozen = cells.map((cell) => parseFloat(cell.style.width) || 0);
11850
11883
  table.style.tableLayout = "auto";
11851
11884
  table.style.minWidth = "0";
@@ -11855,19 +11888,44 @@ var _DeesTable = class _DeesTable extends (_a17 = DeesElement, _heading1_dec = [
11855
11888
  const natural = cells.map((cell) => parseFloat(getComputedStyle(cell).width) || 0);
11856
11889
  const naturalTotal = natural.reduce((sum, width) => sum + width, 0);
11857
11890
  const naturalTableWidth = parseFloat(getComputedStyle(table).width) || 0;
11891
+ let narrowest = [];
11892
+ if (wrapping.includes(true)) {
11893
+ table.style.width = "min-content";
11894
+ narrowest = cells.map((cell) => parseFloat(getComputedStyle(cell).width) || 0);
11895
+ table.style.width = "";
11896
+ }
11858
11897
  table.style.minWidth = "";
11859
11898
  const room = (parseFloat(getComputedStyle(table).width) || 0) - (naturalTableWidth - naturalTotal);
11860
11899
  const before = this.__columnContentWidths?.length === cells.length ? this.__columnContentWidths : [];
11861
- const needed = natural.map((width, index) => Math.max(before[index] ?? 0, width));
11900
+ const needed = natural.map((width, index) => wrapping[index] ? width : Math.max(before[index] ?? 0, width));
11862
11901
  this.__columnContentWidths = needed;
11863
11902
  const neededTotal = needed.reduce((sum, width) => sum + width, 0);
11864
- const widths = !needed.some((width, index) => width > frozen[index] + 0.5) ? frozen : neededTotal >= room ? needed : needed.map((width) => width + Math.floor((room - neededTotal) * width / neededTotal));
11903
+ const leftToWrap = room - needed.reduce((sum, width, index) => sum + (wrapping[index] ? 0 : width), 0);
11904
+ const wrappingTotal = frozen.reduce((sum, width, index) => sum + (wrapping[index] ? width : 0), 0);
11905
+ const widths = !needed.some((width, index) => !wrapping[index] && width > frozen[index] + 0.5) ? frozen : wrapping.includes(true) ? needed.map((width, index) => wrapping[index] ? Math.max(narrowest[index], Math.floor(leftToWrap * frozen[index] / wrappingTotal)) : width) : neededTotal >= room ? needed : needed.map((width) => width + Math.floor((room - neededTotal) * width / neededTotal));
11865
11906
  cells.forEach((cell, index) => {
11866
11907
  cell.style.width = `${widths[index]}px`;
11867
11908
  });
11868
11909
  table.style.tableLayout = "fixed";
11869
11910
  return widths.some((width, index) => Math.abs(width - frozen[index]) > 0.5);
11870
11911
  }
11912
+ /**
11913
+ * A table with a wrapping column fits its container, so widths frozen at one
11914
+ * width hold for that width only: when the container's width changes, the
11915
+ * columns are measured again and the rows wrap anew.
11916
+ */
11917
+ __refitWrappingColumns() {
11918
+ const table = this.__realTableEl;
11919
+ if (!table?.classList.contains("wrapsCells")) return;
11920
+ if (table.parentElement?.clientWidth === this.__columnsFittedTo) return;
11921
+ void this.determineColumnWidths().then(() => {
11922
+ if (!this.fixedHeight) this.__syncFloatingHeader();
11923
+ if (!this.virtualized) return;
11924
+ this.__rowHeights.clear();
11925
+ this.__virtualColumnsCheckedFor = void 0;
11926
+ this.__scheduleVirtualSettle();
11927
+ });
11928
+ }
11871
11929
  /** Settles the window on the next frame: at most one range change per frame. */
11872
11930
  __scheduleVirtualSettle() {
11873
11931
  if (this.__virtualSettleFrame !== void 0) return;
@@ -12478,6 +12536,7 @@ var _DeesTable = class _DeesTable extends (_a17 = DeesElement, _heading1_dec = [
12478
12536
  cell.style.width = "";
12479
12537
  });
12480
12538
  this.__columnContentWidths = void 0;
12539
+ this.__columnsFittedTo = table.parentElement?.clientWidth;
12481
12540
  if (!table.querySelector("tbody tr[data-row-idx]")) return;
12482
12541
  if (this.virtualized) {
12483
12542
  table.style.minWidth = "0";
@@ -135040,7 +135099,7 @@ var bright = {
135040
135099
  // ts_web/00_commitinfo_data.ts
135041
135100
  var commitinfo = {
135042
135101
  name: "@design.estate/dees-catalog",
135043
- version: "24.0.2",
135102
+ version: "24.1.0",
135044
135103
  description: "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."
135045
135104
  };
135046
135105
  export {