twico-ui 1.17.1 → 1.17.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/CHANGELOG.md +7 -0
- package/dist/index.cjs +8 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10307,6 +10307,8 @@ function Datatable({
|
|
|
10307
10307
|
const editable = isColEditable(c);
|
|
10308
10308
|
const isEditing = editing && editing.key === k && editing.field === c.field;
|
|
10309
10309
|
const cellActive = selectionMode === "cell" && activeCell && activeCell.key === k && activeCell.field === c.field;
|
|
10310
|
+
const display = c.valueFormatter ? c.valueFormatter(val, row) : val;
|
|
10311
|
+
const cellTitle = !isActions && !c.renderCell && !isEditing && (typeof display === "string" || typeof display === "number") ? String(display) : void 0;
|
|
10310
10312
|
return /* @__PURE__ */ jsxs(
|
|
10311
10313
|
"td",
|
|
10312
10314
|
{
|
|
@@ -10325,14 +10327,14 @@ function Datatable({
|
|
|
10325
10327
|
"data-pin": st.pin,
|
|
10326
10328
|
"data-pin-edge": st.edge,
|
|
10327
10329
|
style: { width: widthOf(c), ...st.style },
|
|
10328
|
-
title:
|
|
10330
|
+
title: cellTitle,
|
|
10329
10331
|
onClick: selectionMode === "cell" ? (e) => handleCellClick(e, k, row, c) : void 0,
|
|
10330
10332
|
onFocus: () => setFocus((f) => f.r === ri && f.c === ci ? f : { r: ri, c: ci }),
|
|
10331
10333
|
onDoubleClick: editable ? () => beginEdit(k, c, row) : void 0,
|
|
10332
10334
|
children: [
|
|
10333
10335
|
!checkboxSelection && reorderable && ci === 0 && !isEditing ? /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 6, maxWidth: "100%" }, children: [
|
|
10334
10336
|
rowHandle(k, midIdx, row),
|
|
10335
|
-
/* @__PURE__ */ jsx("span", { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: isActions ? renderActions(c, row) : c.renderCell ? c.renderCell(val, row) :
|
|
10337
|
+
/* @__PURE__ */ jsx("span", { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: isActions ? renderActions(c, row) : c.renderCell ? c.renderCell(val, row) : display })
|
|
10336
10338
|
] }) : isEditing ? c.renderEditCell ? (
|
|
10337
10339
|
// #236: full escape hatch — the host drops in its own editor (searchable/creatable/
|
|
10338
10340
|
// async Combobox, …) and drives the lifecycle via commit/cancel. Wrapped in
|
|
@@ -10351,7 +10353,7 @@ function Datatable({
|
|
|
10351
10353
|
onCancel: cancelEdit,
|
|
10352
10354
|
onKeyDown: onEditKey
|
|
10353
10355
|
}
|
|
10354
|
-
) : isActions ? renderActions(c, row) : c.renderCell ? c.renderCell(val, row) :
|
|
10356
|
+
) : isActions ? renderActions(c, row) : c.renderCell ? c.renderCell(val, row) : display,
|
|
10355
10357
|
editable && !isEditing ? /* @__PURE__ */ jsx("span", { className: "twc-dt__edit-hint", "aria-hidden": "true", children: /* @__PURE__ */ jsx(Svg, { d: I.pencil }) }) : null
|
|
10356
10358
|
]
|
|
10357
10359
|
},
|
|
@@ -10767,6 +10769,7 @@ function Datatable({
|
|
|
10767
10769
|
className: "twc-dt__th-label",
|
|
10768
10770
|
role: c.sortable ? "button" : void 0,
|
|
10769
10771
|
tabIndex: c.sortable ? 0 : void 0,
|
|
10772
|
+
title: typeof c.headerName === "string" ? c.headerName : void 0,
|
|
10770
10773
|
"aria-label": c.sortable ? `${c.headerName}, sort` : void 0,
|
|
10771
10774
|
draggable: reorderable || void 0,
|
|
10772
10775
|
onDragStart: reorderable ? (e) => {
|
|
@@ -10898,8 +10901,8 @@ function Datatable({
|
|
|
10898
10901
|
const nf = (n) => n.toLocaleString();
|
|
10899
10902
|
if (totalRows === 0) return "No rows";
|
|
10900
10903
|
const shown = paged.length;
|
|
10901
|
-
const start = paginated ? pageVal * sizeVal + 1 : 1;
|
|
10902
|
-
const end = paginated ? start + shown - 1 : shown;
|
|
10904
|
+
const start = paginated ? Math.min(pageVal * sizeVal + 1, totalRows) : 1;
|
|
10905
|
+
const end = paginated ? Math.min(start + shown - 1, totalRows) : shown;
|
|
10903
10906
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10904
10907
|
paginated ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10905
10908
|
"Showing ",
|