twico-ui 1.31.0 → 1.32.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/CHANGELOG.md +22 -0
- package/dist/index.cjs +398 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -2
- package/dist/index.d.ts +35 -2
- package/dist/index.mjs +398 -71
- package/dist/index.mjs.map +1 -1
- package/llms.txt +5 -0
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1924,6 +1924,12 @@ interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
1924
1924
|
* column, or **double-click** that edge to auto-fit the column to its widest visible content
|
|
1925
1925
|
* (header + rendered cells), Excel-style. @default false */
|
|
1926
1926
|
disableColumnResize?: boolean;
|
|
1927
|
+
/** #339: let end-users build their own combined columns at runtime. Adds a **"Combine columns…"** item to
|
|
1928
|
+
* each column's ⋮ menu that opens an editor to fold other columns' data into that column (they show in its
|
|
1929
|
+
* cell and their own columns hide); layout (inline/stacked) + labels are configurable, and "Uncombine"
|
|
1930
|
+
* restores them. The result is the same as a declarative `column.combine` and persists via `stateKey`.
|
|
1931
|
+
* @default false */
|
|
1932
|
+
columnCombining?: boolean;
|
|
1927
1933
|
/** Make all columns editable by default (double-click a cell to edit; per-column `editable` overrides). @default false */
|
|
1928
1934
|
editMode?: boolean;
|
|
1929
1935
|
/** Called when a cell edit is committed: (updatedRow, originalRow, field). */
|
|
@@ -2112,11 +2118,17 @@ interface DatatableState {
|
|
|
2112
2118
|
density: "compact" | "standard" | "comfortable";
|
|
2113
2119
|
/** #292: user-resized Filters popover size (px). Absent until the user drags the panel grip. */
|
|
2114
2120
|
filterPanelSize?: { w?: number; h?: number };
|
|
2115
|
-
/** #292: user-resized Filters field widths (px, panel-global — not per data column). Absent until dragged.
|
|
2116
|
-
|
|
2121
|
+
/** #292: user-resized Filters field widths (px, panel-global — not per data column). Absent until dragged.
|
|
2122
|
+
* `logic` is the #330 And/Or connector field. */
|
|
2123
|
+
filterFieldWidths?: { col?: number; op?: number; val?: number; logic?: number };
|
|
2117
2124
|
/** #304: user-resized sizes of the other toolbar popovers (Columns/Aggregation/Pivot/Batch-edit),
|
|
2118
2125
|
* keyed by popover id → `{ w, h }` in px. Absent until a popover is dragged with `resizablePopovers`. */
|
|
2119
2126
|
popoverSizes?: Record<string, { w?: number; h?: number }>;
|
|
2127
|
+
/** #339: runtime user-defined combined columns (from `columnCombining`), keyed by target field →
|
|
2128
|
+
* `{ fields:[target, ...sources], layout, separator, labels }`. Absent until the user combines columns. */
|
|
2129
|
+
columnCombine?: Record<string, { fields: string[]; layout?: "inline" | "stack"; separator?: string; labels?: boolean }>;
|
|
2130
|
+
/** #341: user-resized width (px) of the batch-editor's column-name field. Absent until the user drags it. */
|
|
2131
|
+
batchNameWidth?: number;
|
|
2120
2132
|
}
|
|
2121
2133
|
|
|
2122
2134
|
interface DatatableColumn<T = any> {
|
|
@@ -2126,6 +2138,18 @@ interface DatatableColumn<T = any> {
|
|
|
2126
2138
|
* quick-search, grouping, aggregation, the default cell render, and export. Falls back to
|
|
2127
2139
|
* `row[field]` when omitted. Inline edits still write to the raw `field`. */
|
|
2128
2140
|
valueGetter?: (row: T) => unknown;
|
|
2141
|
+
/** #338: merge several other columns' values into this one column — a convenience layer over
|
|
2142
|
+
* `valueGetter`. Give the source `fields` (or the shorthand `combine: ["a", "b"]`); Twico auto-derives
|
|
2143
|
+
* the combined value — so sort, filter, quick-search, grouping, aggregation, and export all operate on
|
|
2144
|
+
* it — and the cell render. `layout: "inline"` (default) joins the values with `separator` (default
|
|
2145
|
+
* `" · "`) on one line; `"stack"` puts each on its own line and auto-wraps the row. `labels` prefixes
|
|
2146
|
+
* each value with its source column's header. Note the split: the derived **value** used for
|
|
2147
|
+
* sort/filter/quick-search/grouping/aggregation/export is the raw source values joined by `separator`
|
|
2148
|
+
* (label-prefixed when `labels`), while the **cell render** additionally applies each source column's
|
|
2149
|
+
* `valueFormatter`. The combined value is synthetic, so the column is display-only (never inline-editable).
|
|
2150
|
+
* Supplying your own `valueGetter` and/or `renderCell` overrides the derived one(s) independently —
|
|
2151
|
+
* override `valueGetter` alone and the cell shows that value (not the source-join). */
|
|
2152
|
+
combine?: string[] | { fields: string[]; layout?: "inline" | "stack"; separator?: string; labels?: boolean };
|
|
2129
2153
|
/** Header label. @default field ("Actions" for actions columns) */
|
|
2130
2154
|
headerName?: string;
|
|
2131
2155
|
/** Data type. "actions" renders per-row action buttons via getActions. @default "string" */
|
|
@@ -2996,6 +3020,15 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
2996
3020
|
size?: "xs" | "sm" | "md" | "lg";
|
|
2997
3021
|
/** Fully rounded (circular). @default false */
|
|
2998
3022
|
round?: boolean;
|
|
3023
|
+
/** #342: render as a different element — use `"a"` for an icon **link** (GitHub icon, external nav, …) so
|
|
3024
|
+
* navigation is a real link, not a button. @default "button" */
|
|
3025
|
+
as?: "button" | "a";
|
|
3026
|
+
/** Link destination — only used with `as="a"`; scheme-sanitized (javascript:/data:/vbscript: drop the href). */
|
|
3027
|
+
href?: string;
|
|
3028
|
+
/** Anchor target — only used with `as="a"` (e.g. "_blank"). */
|
|
3029
|
+
target?: React.HTMLAttributeAnchorTarget;
|
|
3030
|
+
/** Anchor rel — only used with `as="a"`; pair "noopener noreferrer" with target="_blank". */
|
|
3031
|
+
rel?: string;
|
|
2999
3032
|
/** Accessible label — required for icon-only buttons. */
|
|
3000
3033
|
"aria-label": string;
|
|
3001
3034
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1924,6 +1924,12 @@ interface DatatableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
1924
1924
|
* column, or **double-click** that edge to auto-fit the column to its widest visible content
|
|
1925
1925
|
* (header + rendered cells), Excel-style. @default false */
|
|
1926
1926
|
disableColumnResize?: boolean;
|
|
1927
|
+
/** #339: let end-users build their own combined columns at runtime. Adds a **"Combine columns…"** item to
|
|
1928
|
+
* each column's ⋮ menu that opens an editor to fold other columns' data into that column (they show in its
|
|
1929
|
+
* cell and their own columns hide); layout (inline/stacked) + labels are configurable, and "Uncombine"
|
|
1930
|
+
* restores them. The result is the same as a declarative `column.combine` and persists via `stateKey`.
|
|
1931
|
+
* @default false */
|
|
1932
|
+
columnCombining?: boolean;
|
|
1927
1933
|
/** Make all columns editable by default (double-click a cell to edit; per-column `editable` overrides). @default false */
|
|
1928
1934
|
editMode?: boolean;
|
|
1929
1935
|
/** Called when a cell edit is committed: (updatedRow, originalRow, field). */
|
|
@@ -2112,11 +2118,17 @@ interface DatatableState {
|
|
|
2112
2118
|
density: "compact" | "standard" | "comfortable";
|
|
2113
2119
|
/** #292: user-resized Filters popover size (px). Absent until the user drags the panel grip. */
|
|
2114
2120
|
filterPanelSize?: { w?: number; h?: number };
|
|
2115
|
-
/** #292: user-resized Filters field widths (px, panel-global — not per data column). Absent until dragged.
|
|
2116
|
-
|
|
2121
|
+
/** #292: user-resized Filters field widths (px, panel-global — not per data column). Absent until dragged.
|
|
2122
|
+
* `logic` is the #330 And/Or connector field. */
|
|
2123
|
+
filterFieldWidths?: { col?: number; op?: number; val?: number; logic?: number };
|
|
2117
2124
|
/** #304: user-resized sizes of the other toolbar popovers (Columns/Aggregation/Pivot/Batch-edit),
|
|
2118
2125
|
* keyed by popover id → `{ w, h }` in px. Absent until a popover is dragged with `resizablePopovers`. */
|
|
2119
2126
|
popoverSizes?: Record<string, { w?: number; h?: number }>;
|
|
2127
|
+
/** #339: runtime user-defined combined columns (from `columnCombining`), keyed by target field →
|
|
2128
|
+
* `{ fields:[target, ...sources], layout, separator, labels }`. Absent until the user combines columns. */
|
|
2129
|
+
columnCombine?: Record<string, { fields: string[]; layout?: "inline" | "stack"; separator?: string; labels?: boolean }>;
|
|
2130
|
+
/** #341: user-resized width (px) of the batch-editor's column-name field. Absent until the user drags it. */
|
|
2131
|
+
batchNameWidth?: number;
|
|
2120
2132
|
}
|
|
2121
2133
|
|
|
2122
2134
|
interface DatatableColumn<T = any> {
|
|
@@ -2126,6 +2138,18 @@ interface DatatableColumn<T = any> {
|
|
|
2126
2138
|
* quick-search, grouping, aggregation, the default cell render, and export. Falls back to
|
|
2127
2139
|
* `row[field]` when omitted. Inline edits still write to the raw `field`. */
|
|
2128
2140
|
valueGetter?: (row: T) => unknown;
|
|
2141
|
+
/** #338: merge several other columns' values into this one column — a convenience layer over
|
|
2142
|
+
* `valueGetter`. Give the source `fields` (or the shorthand `combine: ["a", "b"]`); Twico auto-derives
|
|
2143
|
+
* the combined value — so sort, filter, quick-search, grouping, aggregation, and export all operate on
|
|
2144
|
+
* it — and the cell render. `layout: "inline"` (default) joins the values with `separator` (default
|
|
2145
|
+
* `" · "`) on one line; `"stack"` puts each on its own line and auto-wraps the row. `labels` prefixes
|
|
2146
|
+
* each value with its source column's header. Note the split: the derived **value** used for
|
|
2147
|
+
* sort/filter/quick-search/grouping/aggregation/export is the raw source values joined by `separator`
|
|
2148
|
+
* (label-prefixed when `labels`), while the **cell render** additionally applies each source column's
|
|
2149
|
+
* `valueFormatter`. The combined value is synthetic, so the column is display-only (never inline-editable).
|
|
2150
|
+
* Supplying your own `valueGetter` and/or `renderCell` overrides the derived one(s) independently —
|
|
2151
|
+
* override `valueGetter` alone and the cell shows that value (not the source-join). */
|
|
2152
|
+
combine?: string[] | { fields: string[]; layout?: "inline" | "stack"; separator?: string; labels?: boolean };
|
|
2129
2153
|
/** Header label. @default field ("Actions" for actions columns) */
|
|
2130
2154
|
headerName?: string;
|
|
2131
2155
|
/** Data type. "actions" renders per-row action buttons via getActions. @default "string" */
|
|
@@ -2996,6 +3020,15 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
2996
3020
|
size?: "xs" | "sm" | "md" | "lg";
|
|
2997
3021
|
/** Fully rounded (circular). @default false */
|
|
2998
3022
|
round?: boolean;
|
|
3023
|
+
/** #342: render as a different element — use `"a"` for an icon **link** (GitHub icon, external nav, …) so
|
|
3024
|
+
* navigation is a real link, not a button. @default "button" */
|
|
3025
|
+
as?: "button" | "a";
|
|
3026
|
+
/** Link destination — only used with `as="a"`; scheme-sanitized (javascript:/data:/vbscript: drop the href). */
|
|
3027
|
+
href?: string;
|
|
3028
|
+
/** Anchor target — only used with `as="a"` (e.g. "_blank"). */
|
|
3029
|
+
target?: React.HTMLAttributeAnchorTarget;
|
|
3030
|
+
/** Anchor rel — only used with `as="a"`; pair "noopener noreferrer" with target="_blank". */
|
|
3031
|
+
rel?: string;
|
|
2999
3032
|
/** Accessible label — required for icon-only buttons. */
|
|
3000
3033
|
"aria-label": string;
|
|
3001
3034
|
}
|