twico-ui 1.17.0 → 1.17.1

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
@@ -10038,6 +10038,7 @@ function Datatable({
10038
10038
  [cols, editMode, batchEditKey]
10039
10039
  // eslint-disable-line react-hooks/exhaustive-deps
10040
10040
  );
10041
+ const hasBatchEditor = showBatchEdit && batchEditableCols.length > 0;
10041
10042
  const [batchEdit, setBatchEdit] = React51__default.useState(null);
10042
10043
  const [batchEditPos, openBatchEdit, closeBatchEdit] = useFloating();
10043
10044
  function openBatchEditor(el) {
@@ -10051,7 +10052,7 @@ function Datatable({
10051
10052
  closeBatchEdit();
10052
10053
  };
10053
10054
  const onDown = (e) => {
10054
- if (!e.target.closest(".twc-dt__pop") && !e.target.closest(".twc-dt__batch")) close();
10055
+ if (!e.target.closest(".twc-dt__pop") && !e.target.closest(".twc-dt__batch") && !e.target.closest(".twc-pop")) close();
10055
10056
  };
10056
10057
  const onKey = (e) => {
10057
10058
  if (e.key === "Escape") close();
@@ -10464,14 +10465,14 @@ function Datatable({
10464
10465
  return /* @__PURE__ */ jsxs("div", { className: `twc-dt ${className}`, ref: rootRef, "data-density": density, "data-resizing": resizing || void 0, ...rest, children: [
10465
10466
  __twcStyles,
10466
10467
  /* @__PURE__ */ jsxs("div", { className: "twc-dt__toolbar", "data-compact": compact || void 0, children: [
10467
- batchActions.length && selected.size > 0 ? /* @__PURE__ */ jsxs("div", { className: "twc-dt__batch", children: [
10468
+ (batchActions.length || hasBatchEditor) && selected.size > 0 ? /* @__PURE__ */ jsxs("div", { className: "twc-dt__batch", children: [
10468
10469
  /* @__PURE__ */ jsx("button", { type: "button", className: "twc-dt__batch-x", onClick: clearSelection, "aria-label": "Clear selection", children: /* @__PURE__ */ jsx(Svg, { d: I.x }) }),
10469
10470
  /* @__PURE__ */ jsxs("span", { className: "twc-dt__batch-count", children: [
10470
10471
  selected.size,
10471
10472
  " selected"
10472
10473
  ] }),
10473
10474
  /* @__PURE__ */ jsxs("div", { className: "twc-dt__batch-actions", children: [
10474
- showBatchEdit && batchEditableCols.length ? /* @__PURE__ */ jsxs("button", { type: "button", className: "twc-dt__batch-btn", onClick: (e) => openBatchEditor(e.currentTarget), children: [
10475
+ hasBatchEditor ? /* @__PURE__ */ jsxs("button", { type: "button", className: "twc-dt__batch-btn", onClick: (e) => openBatchEditor(e.currentTarget), children: [
10475
10476
  /* @__PURE__ */ jsx(Svg, { d: I.pencil }),
10476
10477
  "Edit"
10477
10478
  ] }) : null,