twico-ui 1.18.0 → 1.18.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.
package/dist/index.mjs CHANGED
@@ -8325,8 +8325,8 @@ var DT_CSS = `
8325
8325
  .twc-dt__row[data-pinned-row="top"] > .twc-dt__td { border-bottom: var(--border-medium) solid var(--color-primary-border); box-shadow: 0 1px 0 var(--color-primary-border); }
8326
8326
  .twc-dt__row[data-pinned-row="bottom"] > .twc-dt__td { border-top: var(--border-medium) solid var(--color-primary-border); }
8327
8327
 
8328
- /* Row reordering */
8329
- .twc-dt__row[data-reorderable] { cursor: grab; }
8328
+ /* Row reordering \u2014 the grab affordance lives on the drag handle only (#263), not the whole row, so
8329
+ hovering a normal data cell isn't presented as draggable (the row stays a drag source for the mouse). */
8330
8330
  .twc-dt__row[data-row-dragging] { opacity: 0.4; }
8331
8331
  /* #239 diff mode: row op tint + before\u2192after cells (single-line, clipped by the td's own overflow). */
8332
8332
  .twc-dt__row[data-op="added"] > .twc-dt__td { background: color-mix(in srgb, var(--color-success) 7%, transparent); }
@@ -8357,6 +8357,7 @@ var DT_CSS = `
8357
8357
  .twc-dt__row:hover .twc-dt__row-handle, .twc-dt__row-handle:focus-visible { opacity: 0.7; }
8358
8358
  .twc-dt__row-handle:focus-visible { outline: none; box-shadow: var(--ring); color: var(--color-primary); }
8359
8359
  .twc-dt__row-handle[data-grabbed="true"] { opacity: 1; color: var(--color-primary); }
8360
+ .twc-dt__row-handle:active, .twc-dt__row-handle[data-grabbed="true"] { cursor: grabbing; }
8360
8361
  .twc-dt__row-handle svg { width: 14px; height: 14px; }
8361
8362
  /* Visually-hidden aria-live region for reorder announcements */
8362
8363
  .twc-dt__sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@@ -9430,7 +9431,8 @@ function Datatable({
9430
9431
  return [...L, ...mid, ...R];
9431
9432
  }, [pins, hidden, visibleCols, colByField, order]);
9432
9433
  const NUM_W = 56;
9433
- const numLeft = checkboxSelection ? 44 : 0;
9434
+ const CHK_W = checkboxSelection ? rowReorder ? 68 : 44 : 0;
9435
+ const numLeft = CHK_W;
9434
9436
  const leadW = numLeft + (showRowNum ? NUM_W : 0);
9435
9437
  const stickyOf = (field) => {
9436
9438
  if (pins.left.includes(field)) {
@@ -10353,7 +10355,7 @@ function Datatable({
10353
10355
  onDragEnd: reorderable ? () => setRowDrag({ from: null, over: null, after: false }) : void 0,
10354
10356
  onClick: (e) => handleRowClick(e, k, row),
10355
10357
  children: [
10356
- checkboxSelection ? /* @__PURE__ */ jsxs("td", { className: "twc-dt__td", role: "gridcell", "data-pin": "left", "data-pin-edge": pins.left.length || showRowNum ? void 0 : "left", style: { insetInlineStart: 0, width: 44 }, children: [
10358
+ checkboxSelection ? /* @__PURE__ */ jsxs("td", { className: "twc-dt__td", role: "gridcell", "data-pin": "left", "data-pin-edge": pins.left.length || showRowNum ? void 0 : "left", style: { insetInlineStart: 0, width: CHK_W }, children: [
10357
10359
  /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
10358
10360
  reorderable ? rowHandle(k, midIdx, row) : null,
10359
10361
  /* @__PURE__ */ jsx(
@@ -10761,7 +10763,7 @@ function Datatable({
10761
10763
  onKeyDown: onGridKeyDown,
10762
10764
  children: [
10763
10765
  /* @__PURE__ */ jsx("thead", { ref: theadRef, children: /* @__PURE__ */ jsxs("tr", { role: "row", "aria-rowindex": 1, children: [
10764
- checkboxSelection ? /* @__PURE__ */ jsx("th", { className: "twc-dt__th", role: "columnheader", "aria-label": "Select", "data-pin": "left", "data-pin-edge": pins.left.length || showRowNum ? void 0 : "left", style: { insetInlineStart: 0, width: 44, minWidth: 44 }, children: /* @__PURE__ */ jsx("div", { className: "twc-dt__th-inner", style: { justifyContent: "center", padding: 0 }, children: /* @__PURE__ */ jsx(
10766
+ checkboxSelection ? /* @__PURE__ */ jsx("th", { className: "twc-dt__th", role: "columnheader", "aria-label": "Select", "data-pin": "left", "data-pin-edge": pins.left.length || showRowNum ? void 0 : "left", style: { insetInlineStart: 0, width: CHK_W, minWidth: CHK_W }, children: /* @__PURE__ */ jsx("div", { className: "twc-dt__th-inner", style: { justifyContent: "center", padding: 0 }, children: /* @__PURE__ */ jsx(
10765
10767
  "span",
10766
10768
  {
10767
10769
  className: "twc-dt__check",
@@ -10937,7 +10939,7 @@ function Datatable({
10937
10939
  })
10938
10940
  ] }) }),
10939
10941
  /* @__PURE__ */ jsx("tbody", { children: loading ? Array.from({ length: paginated ? Math.min(sizeVal, 8) : 8 }).map((_, ri) => /* @__PURE__ */ jsxs("tr", { className: "twc-dt__row", role: "row", children: [
10940
- checkboxSelection ? /* @__PURE__ */ jsx("td", { className: "twc-dt__td", role: "gridcell", "data-pin": "left", style: { insetInlineStart: 0, width: 44 }, children: /* @__PURE__ */ jsx("span", { className: "twc-dt__sk", "aria-hidden": "true", style: { "--_w": "18px", height: 18, borderRadius: 4 } }) }) : null,
10942
+ checkboxSelection ? /* @__PURE__ */ jsx("td", { className: "twc-dt__td", role: "gridcell", "data-pin": "left", style: { insetInlineStart: 0, width: CHK_W }, children: /* @__PURE__ */ jsx("span", { className: "twc-dt__sk", "aria-hidden": "true", style: { "--_w": "18px", height: 18, borderRadius: 4 } }) }) : null,
10941
10943
  showRowNum ? /* @__PURE__ */ jsx("td", { className: "twc-dt__td twc-dt__rownum", role: "gridcell", "aria-hidden": "true", "data-pin": "left", style: { insetInlineStart: numLeft, width: NUM_W }, children: /* @__PURE__ */ jsx("span", { className: "twc-dt__sk", "aria-hidden": "true", style: { "--_w": "16px", height: 14, borderRadius: 4 } }) }) : null,
10942
10944
  ordered.map((c, ci) => {
10943
10945
  const st = stickyOf(c.field);
@@ -10959,7 +10961,7 @@ function Datatable({
10959
10961
  pinnedBottomRows.map((row) => renderLeaf(row, keyIndex.get(keyOf(row)), "bottom"))
10960
10962
  ] }) }),
10961
10963
  hasAggregation && aggOn && !loading && paged.length > 0 ? /* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsxs("tr", { role: "row", children: [
10962
- checkboxSelection ? /* @__PURE__ */ jsx("td", { role: "gridcell", "data-pin": "left", "data-pin-edge": pins.left.length || showRowNum ? void 0 : "left", style: { insetInlineStart: 0, width: 44 } }) : null,
10964
+ checkboxSelection ? /* @__PURE__ */ jsx("td", { role: "gridcell", "data-pin": "left", "data-pin-edge": pins.left.length || showRowNum ? void 0 : "left", style: { insetInlineStart: 0, width: CHK_W } }) : null,
10963
10965
  showRowNum ? /* @__PURE__ */ jsx("td", { className: "twc-dt__rownum", role: "gridcell", "aria-hidden": "true", "data-pin": "left", "data-pin-edge": pins.left.length ? void 0 : "left", style: { insetInlineStart: numLeft, width: NUM_W } }) : null,
10964
10966
  ordered.map((c) => {
10965
10967
  const st = stickyOf(c.field);