blixify-ui-web 1.3.3 → 1.3.4

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.
@@ -3357,16 +3357,20 @@ var NewTable = function (rawProps) {
3357
3357
  // has no hover to reveal the button by. On a cell that is read it shows while
3358
3358
  // the cell is hovered; on an open text, number or date field it stays, over
3359
3359
  // the field's right edge.
3360
- var renderClearCellButton = function (col, rowId, rowData, onHover) { return (react_2.default.createElement("button", { type: "button", "aria-label": "Clear ".concat(typeof col.title === "string" ? col.title : col.key), "data-testid": "cell-clear", className: "absolute right-1.5 top-1/2 z-[3] hidden h-5 w-5 -translate-y-1/2 items-center justify-center rounded ".concat(onHover ? "[@media(hover:hover)_and_(pointer:fine)]:group-hover/clear:flex" : "[@media(hover:hover)_and_(pointer:fine)]:flex", " ").concat(props.darkMode ? "bg-gray-700 text-gray-300 hover:bg-gray-600" : "bg-gray-100 text-gray-500 hover:bg-gray-200"),
3361
- // INFO: a field being typed in keeps its focus, or its blur would save
3362
- // the value being cleared and close the cell under the click
3363
- onMouseDown: function (e) { return e.preventDefault(); }, onClick: function (e) {
3364
- e.stopPropagation();
3365
- handleOpenAfterLeaving(e.currentTarget, function () {
3366
- handleClearCell(rowId, col, rowData);
3367
- });
3368
- } },
3369
- react_2.default.createElement(solid_2.XMarkIcon, { className: "h-3.5 w-3.5", "aria-hidden": "true" }))); };
3360
+ var renderClearCellButton = function (col, rowId, rowData, onHover) { return (
3361
+ // INFO: the tooltip's wrapper is pinned to the cell's edge in the button's
3362
+ // place, so the tooltip points at the "x"
3363
+ react_2.default.createElement(hoverTooltip_1.HoverTooltip, { text: "Clear", className: "absolute right-1.5 top-1/2 z-[3] hidden -translate-y-1/2 ".concat(onHover ? "[@media(hover:hover)_and_(pointer:fine)]:group-hover/clear:flex" : "[@media(hover:hover)_and_(pointer:fine)]:flex") },
3364
+ react_2.default.createElement("button", { type: "button", "aria-label": "Clear ".concat(typeof col.title === "string" ? col.title : col.key), "data-testid": "cell-clear", className: "flex h-5 w-5 items-center justify-center rounded ".concat(props.darkMode ? "bg-gray-700 text-gray-300 hover:bg-gray-600" : "bg-gray-100 text-gray-500 hover:bg-gray-200"),
3365
+ // INFO: a field being typed in keeps its focus, or its blur would save
3366
+ // the value being cleared and close the cell under the click
3367
+ onMouseDown: function (e) { return e.preventDefault(); }, onClick: function (e) {
3368
+ e.stopPropagation();
3369
+ handleOpenAfterLeaving(e.currentTarget, function () {
3370
+ handleClearCell(rowId, col, rowData);
3371
+ });
3372
+ } },
3373
+ react_2.default.createElement(solid_2.XMarkIcon, { className: "h-3.5 w-3.5", "aria-hidden": "true" })))); };
3370
3374
  // INFO: a filled cell's copy icon. It sits left of the cell's "x" when the
3371
3375
  // cell has one, and left of the title cell's row actions on the first column.
3372
3376
  var renderCellCopyButton = function (col, colIndex, row, spaceRow, hasClearButton, inline) {
@@ -3510,13 +3514,14 @@ var NewTable = function (rawProps) {
3510
3514
  var _a;
3511
3515
  if (!((_a = props.deleteable) === null || _a === void 0 ? void 0 : _a.active))
3512
3516
  return null;
3513
- return (react_2.default.createElement("button", { onClick: function (e) {
3514
- var _a;
3515
- e.preventDefault();
3516
- e.stopPropagation();
3517
- (_a = props.deleteable) === null || _a === void 0 ? void 0 : _a.onDeleteData(rowId);
3518
- }, className: "text-red-500 hover:text-red-700 hover:bg-red-50 p-1 rounded" },
3519
- react_2.default.createElement(outline_1.TrashIcon, { className: "h-4 w-4" })));
3517
+ return (react_2.default.createElement(hoverTooltip_1.HoverTooltip, { text: "Delete row", className: "inline-flex" },
3518
+ react_2.default.createElement("button", { type: "button", "aria-label": "Delete row", onClick: function (e) {
3519
+ var _a;
3520
+ e.preventDefault();
3521
+ e.stopPropagation();
3522
+ (_a = props.deleteable) === null || _a === void 0 ? void 0 : _a.onDeleteData(rowId);
3523
+ }, className: "text-red-500 hover:text-red-700 hover:bg-red-50 p-1 rounded" },
3524
+ react_2.default.createElement(outline_1.TrashIcon, { className: "h-4 w-4", "aria-hidden": "true" }))));
3520
3525
  };
3521
3526
  // INFO: the header emits a cell for the add-column control, so every row must
3522
3527
  // emit one too or the body ends up a column narrower than the header and each
@@ -3628,8 +3633,10 @@ var NewTable = function (rawProps) {
3628
3633
  renderAddColumnCell(),
3629
3634
  react_2.default.createElement("td", { className: "".concat(gridLines === "all" ? editCellPadding : cellPadding, " text-sm ").concat(handleGetActionCellPin(false).className), style: handleGetActionCellPin(false).style },
3630
3635
  react_2.default.createElement("div", { className: "flex flex-row ".concat(gridLines === "all" ? "gap-1" : "gap-2") },
3631
- react_2.default.createElement(iconButton_1.IconButton, { testId: "table-add-row-confirm", size: gridLines === "all" ? "small" : undefined, darkMode: gridLines === "all" ? props.darkMode : undefined, icon: react_2.default.createElement(solid_2.CheckIcon, { className: "".concat(gridLines === "all" ? "h-4 w-4" : "h-5 w-5", " text-green-500") }), onClick: function () { return handleCommitAdd(false); } }),
3632
- react_2.default.createElement(iconButton_1.IconButton, { testId: "table-add-row-cancel", size: gridLines === "all" ? "small" : undefined, darkMode: gridLines === "all" ? props.darkMode : undefined, icon: react_2.default.createElement(solid_2.XMarkIcon, { className: "".concat(gridLines === "all" ? "h-4 w-4" : "h-5 w-5", " text-red-500") }), onClick: handleCancelAdd })))));
3636
+ react_2.default.createElement(hoverTooltip_1.HoverTooltip, { text: "Save row", className: "inline-flex" },
3637
+ react_2.default.createElement(iconButton_1.IconButton, { testId: "table-add-row-confirm", size: gridLines === "all" ? "small" : undefined, darkMode: gridLines === "all" ? props.darkMode : undefined, icon: react_2.default.createElement(solid_2.CheckIcon, { className: "".concat(gridLines === "all" ? "h-4 w-4" : "h-5 w-5", " text-green-500") }), onClick: function () { return handleCommitAdd(false); } })),
3638
+ react_2.default.createElement(hoverTooltip_1.HoverTooltip, { text: "Cancel", className: "inline-flex" },
3639
+ react_2.default.createElement(iconButton_1.IconButton, { testId: "table-add-row-cancel", size: gridLines === "all" ? "small" : undefined, darkMode: gridLines === "all" ? props.darkMode : undefined, icon: react_2.default.createElement(solid_2.XMarkIcon, { className: "".concat(gridLines === "all" ? "h-4 w-4" : "h-5 w-5", " text-red-500") }), onClick: handleCancelAdd }))))));
3633
3640
  };
3634
3641
  // INFO: an empty add row lightens on hover; its pinned cells, which carry
3635
3642
  // their own background, follow it
@@ -4219,7 +4226,8 @@ var NewTable = function (rawProps) {
4219
4226
  // INFO: an empty cell under gridLines="all" is blank,
4220
4227
  // as every other empty cell of the grid is
4221
4228
  gridLines === "all" ? null : (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add"))) : (react_2.default.createElement(hoverTooltip_1.HoverTooltip, { className: "min-w-0 truncate", onlyWhenClipped: true }, (0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))),
4222
- react_2.default.createElement(outline_1.PencilIcon, { className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" }))));
4229
+ react_2.default.createElement(hoverTooltip_1.HoverTooltip, { text: "Edit", className: "inline-flex flex-shrink-0" },
4230
+ react_2.default.createElement(outline_1.PencilIcon, { "aria-hidden": "true", className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" })))));
4223
4231
  }
4224
4232
  if (isModalEdit) {
4225
4233
  // INFO: of the modal-edited types, an address (its name) has
@@ -4245,7 +4253,8 @@ var NewTable = function (rawProps) {
4245
4253
  gridLines === "all" ? null : (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add"))) : (react_2.default.createElement(hoverTooltip_1.HoverTooltip, { className: "min-w-0 truncate", onlyWhenClipped: true }, (0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))),
4246
4254
  isCopyableModalCell &&
4247
4255
  renderCellCopyButton(col, colIndex, row, spaceRow, false, true),
4248
- react_2.default.createElement(outline_1.PencilIcon, { className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" }))));
4256
+ react_2.default.createElement(hoverTooltip_1.HoverTooltip, { text: "Edit", className: "inline-flex flex-shrink-0" },
4257
+ react_2.default.createElement(outline_1.PencilIcon, { "aria-hidden": "true", className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" })))));
4249
4258
  }
4250
4259
  // INFO: a multi-select shows its picks as one line of tags until it is
4251
4260
  // clicked — its editor stacks the input over the tags, which made every