twico-ui 1.17.2 → 1.18.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/llms.txt CHANGED
@@ -1611,6 +1611,9 @@ Props:
1611
1611
  - `onQuickFilterChange` — `(value: string) => void` — Fires with the new quick-search string as the user types in the built-in box (and when a host sets it).
1612
1612
  - `showBatchEdit` — `boolean` · default `true` — Render the built-in "Edit" button in the selection toolbar; set false to suppress it and ship your own batch-edit action via batchActions (avoids two Edit buttons).
1613
1613
  - `batchEditFields` — `string[]` — Allow-list the column fields the built-in batch editor offers; defaults to every editable column. Trims a wide grid's editor without touching editable (which would also disable inline editing).
1614
+ - `stateKey` — `string` — Persist the full view state (filters, sort, quick-search, page, page size, column order/widths/visibility/pinning, density) to localStorage under this key and restore it on mount. SSR-safe: storage is read in a mount effect, not during render, and unknown columns in a saved snapshot are dropped.
1615
+ - `initialState` — `Partial<DatatableState>` — Seed the view state on first mount (used only when stateKey has nothing stored yet). Omitted keys keep their defaults.
1616
+ - `onStateChange` — `(state: DatatableState) => void` — Fires with the complete DatatableState whenever the view changes, so you can persist it yourself (URL, server, …). Not fired on the initial mount for the default state; fires once after a stateKey/initialState restore.
1614
1617
  - `diff` — `DatatableDiff<T>` — Turn the grid into a two-dataset diff: pairs diff.from↔diff.to on a key, classifies each row added/removed/modified/moved, and renders modified cells as before→after — through this same engine, so density/resize/pin/sort/filter/group/export/virtualization apply. Adds a leading op-badge column + a toolbar summary and only-changed toggle; rows/serverMode/editMode are ignored.
1615
1618
 
1616
1619
  ```jsx
@@ -3284,7 +3287,7 @@ export function useLocalStorage<T>( key: string, initialValue: T ): [T, (value:
3284
3287
 
3285
3288
  ### useCopyToClipboard
3286
3289
 
3287
- Copy text to the clipboard with a `copied` flag that auto-resets.
3290
+ Copy text to the clipboard with a `copied` flag that auto-resets. Uses the async Clipboard API in a secure context and falls back to a legacy `execCommand("copy")` path over plain HTTP on a LAN IP (where `navigator.clipboard` is undefined) and in older browsers, so `copy()` works off-secure-origin.
3288
3291
 
3289
3292
  ```ts
3290
3293
  export function useCopyToClipboard(timeout?: number): { copied: boolean; copy: (text: string) => Promise<boolean>; };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twico-ui",
3
- "version": "1.17.2",
3
+ "version": "1.18.0",
4
4
  "description": "Twico UI — a free, modern, themeable React + Tailwind-friendly component library. 61 components with dark mode, motion, and accessibility built in.",
5
5
  "license": "MIT",
6
6
  "author": "Twico UI",