twico-ui 1.20.2 → 1.21.0

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.d.cts CHANGED
@@ -1810,6 +1810,10 @@ interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivEleme
1810
1810
  quickFilter?: string;
1811
1811
  /** Fires with the new quick-search string as the user types (and when a host sets it). */
1812
1812
  onQuickFilterChange?: (value: string) => void;
1813
+ /** Custom node rendered in a **leading slot** of the toolbar row, before the built-in Columns/Filters
1814
+ * cluster (#286) — for host controls like an "Add row" button or bulk actions. Mirrors `CardGrid`'s
1815
+ * `toolbar` prop, so no internal-class/absolute-position hacks are needed. */
1816
+ toolbarActions?: React.ReactNode;
1813
1817
  /**
1814
1818
  * Actions shown in the toolbar when one or more rows are selected (requires
1815
1819
  * `checkboxSelection`). Each handler receives the selected keys, the resolved
package/dist/index.d.ts CHANGED
@@ -1810,6 +1810,10 @@ interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivEleme
1810
1810
  quickFilter?: string;
1811
1811
  /** Fires with the new quick-search string as the user types (and when a host sets it). */
1812
1812
  onQuickFilterChange?: (value: string) => void;
1813
+ /** Custom node rendered in a **leading slot** of the toolbar row, before the built-in Columns/Filters
1814
+ * cluster (#286) — for host controls like an "Add row" button or bulk actions. Mirrors `CardGrid`'s
1815
+ * `toolbar` prop, so no internal-class/absolute-position hacks are needed. */
1816
+ toolbarActions?: React.ReactNode;
1813
1817
  /**
1814
1818
  * Actions shown in the toolbar when one or more rows are selected (requires
1815
1819
  * `checkboxSelection`). Each handler receives the selected keys, the resolved
package/dist/index.mjs CHANGED
@@ -8107,6 +8107,8 @@ var DT_CSS = `
8107
8107
  /* Toolbar */
8108
8108
  .twc-dt__toolbar { position: relative; z-index: 10; display: flex; align-items: center; gap: 6px; padding: 8px 10px;
8109
8109
  border-bottom: var(--border-thin) solid var(--color-divider); flex-wrap: wrap; }
8110
+ /* #286: host-supplied leading toolbar slot \u2014 a flex cluster so multiple buttons align with the built-ins. */
8111
+ .twc-dt__toolbar-actions { display: inline-flex; align-items: center; gap: 6px; }
8110
8112
  /* z-index above the scroll area's sticky header (z:3) so a toolbar button's
8111
8113
  hover tooltip (a ::after that hangs below the bar) paints over the table
8112
8114
  instead of being covered by the header/first rows. */
@@ -9061,6 +9063,7 @@ function Datatable({
9061
9063
  searchable = true,
9062
9064
  quickFilter,
9063
9065
  onQuickFilterChange,
9066
+ toolbarActions,
9064
9067
  rowPinning = false,
9065
9068
  rowReorder = false,
9066
9069
  rowResize = false,
@@ -10643,6 +10646,7 @@ function Datatable({
10643
10646
  return /* @__PURE__ */ jsxs("div", { className: `twc-dt ${className}`, ref: rootRef, "data-density": density, "data-resizing": resizing || void 0, ...rest, children: [
10644
10647
  __twcStyles,
10645
10648
  /* @__PURE__ */ jsxs("div", { className: "twc-dt__toolbar", "data-compact": compact || void 0, children: [
10649
+ toolbarActions != null ? /* @__PURE__ */ jsx("div", { className: "twc-dt__toolbar-actions", children: toolbarActions }) : null,
10646
10650
  (batchActions.length || hasBatchEditor) && selected.size > 0 ? /* @__PURE__ */ jsxs("div", { className: "twc-dt__batch", children: [
10647
10651
  /* @__PURE__ */ jsx("button", { type: "button", className: "twc-dt__batch-x", onClick: clearSelection, "aria-label": "Clear selection", children: /* @__PURE__ */ jsx(Svg, { d: I.x }) }),
10648
10652
  /* @__PURE__ */ jsxs("span", { className: "twc-dt__batch-count", children: [