twico-ui 1.16.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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to Twico UI are documented here (newest first). This file is generated automatically on each release by [semantic-release](https://semantic-release.gitbook.io/) from [Conventional Commits](https://www.conventionalcommits.org/) — do not edit it by hand. The same notes appear on each [GitHub Release](https://github.com/EncryptionL/twico-ui/releases).
4
4
 
5
+ ## [1.17.1](https://github.com/EncryptionL/twico-ui/compare/v1.17.0...v1.17.1) (2026-07-15)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **datatable:** batch editor survives portaled dropdowns + stands alone ([#249](https://github.com/EncryptionL/twico-ui/issues/249), [#250](https://github.com/EncryptionL/twico-ui/issues/250)) ([1b5ad91](https://github.com/EncryptionL/twico-ui/commit/1b5ad916f3a61e34f339a5a51e21bff06680cf62)), closes [#244](https://github.com/EncryptionL/twico-ui/issues/244) [#247](https://github.com/EncryptionL/twico-ui/issues/247) [#244](https://github.com/EncryptionL/twico-ui/issues/244)
11
+
12
+ # [1.17.0](https://github.com/EncryptionL/twico-ui/compare/v1.16.0...v1.17.0) (2026-07-15)
13
+
14
+
15
+ ### Features
16
+
17
+ * **datatable:** batch action anchorEl + renderBatchEditCell ([#246](https://github.com/EncryptionL/twico-ui/issues/246), [#247](https://github.com/EncryptionL/twico-ui/issues/247)) ([1c84dca](https://github.com/EncryptionL/twico-ui/commit/1c84dcaa7da1d7e9f3edb7481bd1e9ad2671639f)), closes [#236](https://github.com/EncryptionL/twico-ui/issues/236)
18
+
5
19
  # [1.16.0](https://github.com/EncryptionL/twico-ui/compare/v1.15.1...v1.16.0) (2026-07-15)
6
20
 
7
21
 
package/dist/index.cjs CHANGED
@@ -10059,6 +10059,7 @@ function Datatable({
10059
10059
  [cols, editMode, batchEditKey]
10060
10060
  // eslint-disable-line react-hooks/exhaustive-deps
10061
10061
  );
10062
+ const hasBatchEditor = showBatchEdit && batchEditableCols.length > 0;
10062
10063
  const [batchEdit, setBatchEdit] = React51__namespace.default.useState(null);
10063
10064
  const [batchEditPos, openBatchEdit, closeBatchEdit] = useFloating();
10064
10065
  function openBatchEditor(el) {
@@ -10072,7 +10073,7 @@ function Datatable({
10072
10073
  closeBatchEdit();
10073
10074
  };
10074
10075
  const onDown = (e) => {
10075
- if (!e.target.closest(".twc-dt__pop") && !e.target.closest(".twc-dt__batch")) close();
10076
+ if (!e.target.closest(".twc-dt__pop") && !e.target.closest(".twc-dt__batch") && !e.target.closest(".twc-pop")) close();
10076
10077
  };
10077
10078
  const onKey = (e) => {
10078
10079
  if (e.key === "Escape") close();
@@ -10485,14 +10486,14 @@ function Datatable({
10485
10486
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `twc-dt ${className}`, ref: rootRef, "data-density": density, "data-resizing": resizing || void 0, ...rest, children: [
10486
10487
  __twcStyles,
10487
10488
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "twc-dt__toolbar", "data-compact": compact || void 0, children: [
10488
- batchActions.length && selected.size > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "twc-dt__batch", children: [
10489
+ (batchActions.length || hasBatchEditor) && selected.size > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "twc-dt__batch", children: [
10489
10490
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "twc-dt__batch-x", onClick: clearSelection, "aria-label": "Clear selection", children: /* @__PURE__ */ jsxRuntime.jsx(Svg, { d: I.x }) }),
10490
10491
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "twc-dt__batch-count", children: [
10491
10492
  selected.size,
10492
10493
  " selected"
10493
10494
  ] }),
10494
10495
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "twc-dt__batch-actions", children: [
10495
- showBatchEdit && batchEditableCols.length ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "twc-dt__batch-btn", onClick: (e) => openBatchEditor(e.currentTarget), children: [
10496
+ hasBatchEditor ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "twc-dt__batch-btn", onClick: (e) => openBatchEditor(e.currentTarget), children: [
10496
10497
  /* @__PURE__ */ jsxRuntime.jsx(Svg, { d: I.pencil }),
10497
10498
  "Edit"
10498
10499
  ] }) : null,
@@ -10503,7 +10504,7 @@ function Datatable({
10503
10504
  className: "twc-dt__batch-btn",
10504
10505
  "data-danger": a.danger || void 0,
10505
10506
  disabled: a.disabled,
10506
- onClick: () => a.onClick?.([...selected], selectedRows, clearSelection),
10507
+ onClick: (e) => a.onClick?.([...selected], selectedRows, clearSelection, { anchorEl: e.currentTarget }),
10507
10508
  children: [
10508
10509
  a.icon,
10509
10510
  a.label
@@ -11019,7 +11020,11 @@ function Datatable({
11019
11020
  const opts = c.valueOptions ? c.valueOptions.map((o) => typeof o === "string" ? { value: o, label: o } : o) : null;
11020
11021
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "twc-dt__be-row", children: [
11021
11022
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "twc-dt__be-name", title: String(c.headerName ?? c.field), children: c.headerName }),
11022
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "twc-dt__be-ctl", children: opts ? /* @__PURE__ */ jsxRuntime.jsx(
11023
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "twc-dt__be-ctl", children: c.renderBatchEditCell ? c.renderBatchEditCell({
11024
+ value: batchEdit.values[c.field],
11025
+ field: c.field,
11026
+ commit: (v) => setBatchEdit((b) => ({ ...b, values: { ...b.values, [c.field]: v } }))
11027
+ }) : opts ? /* @__PURE__ */ jsxRuntime.jsx(
11023
11028
  Select,
11024
11029
  {
11025
11030
  size: "sm",