@ai-matrx/design-system 0.41.0 → 0.42.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/data-table/copy-helpers.d.cts +2 -1
  3. package/dist/data-table/copy-helpers.d.ts +2 -1
  4. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  5. package/dist/data-table/data-row-inspector.js.map +1 -1
  6. package/dist/data-table/data-row-window.cjs.map +1 -1
  7. package/dist/data-table/data-row-window.js.map +1 -1
  8. package/dist/data-table/filter-engine.d.cts +2 -1
  9. package/dist/data-table/filter-engine.d.ts +2 -1
  10. package/dist/data-table/host.cjs.map +1 -1
  11. package/dist/data-table/host.d.cts +18 -4
  12. package/dist/data-table/host.d.ts +18 -4
  13. package/dist/data-table/host.js.map +1 -1
  14. package/dist/data-table/index.cjs +2990 -2778
  15. package/dist/data-table/index.cjs.map +1 -1
  16. package/dist/data-table/index.d.cts +4 -4
  17. package/dist/data-table/index.d.ts +4 -4
  18. package/dist/data-table/index.js +2999 -2787
  19. package/dist/data-table/index.js.map +1 -1
  20. package/dist/data-table/infer-filter.d.cts +2 -1
  21. package/dist/data-table/infer-filter.d.ts +2 -1
  22. package/dist/data-table/layered-filters.d.cts +2 -1
  23. package/dist/data-table/layered-filters.d.ts +2 -1
  24. package/dist/data-table/menu-targets.cjs +27 -0
  25. package/dist/data-table/menu-targets.cjs.map +1 -1
  26. package/dist/data-table/menu-targets.d.cts +49 -1
  27. package/dist/data-table/menu-targets.d.ts +49 -1
  28. package/dist/data-table/menu-targets.js +27 -0
  29. package/dist/data-table/menu-targets.js.map +1 -1
  30. package/dist/data-table/pagination.cjs.map +1 -1
  31. package/dist/data-table/pagination.js.map +1 -1
  32. package/dist/data-table/query-control.d.cts +2 -1
  33. package/dist/data-table/query-control.d.ts +2 -1
  34. package/dist/data-table/spreadsheet.cjs +24 -8
  35. package/dist/data-table/spreadsheet.cjs.map +1 -1
  36. package/dist/data-table/spreadsheet.d.cts +20 -3
  37. package/dist/data-table/spreadsheet.d.ts +20 -3
  38. package/dist/data-table/spreadsheet.js +24 -8
  39. package/dist/data-table/spreadsheet.js.map +1 -1
  40. package/dist/data-table/types.cjs.map +1 -1
  41. package/dist/data-table/types.d.cts +2 -1
  42. package/dist/data-table/types.d.ts +2 -1
  43. package/dist/data-table/url-state.d.cts +2 -1
  44. package/dist/data-table/url-state.d.ts +2 -1
  45. package/dist/data-table/uuid-cell.cjs.map +1 -1
  46. package/dist/data-table/uuid-cell.js.map +1 -1
  47. package/dist/data-table/xlsx.d.cts +2 -1
  48. package/dist/data-table/xlsx.d.ts +2 -1
  49. package/dist/index.cjs +534 -468
  50. package/dist/index.cjs.map +1 -1
  51. package/dist/index.d.cts +67 -1
  52. package/dist/index.d.ts +67 -1
  53. package/dist/index.js +541 -475
  54. package/dist/index.js.map +1 -1
  55. package/dist/{types-Dx5hJgCi.d.ts → types-afUz93xo.d.ts} +33 -1
  56. package/dist/{types-DNkbHRVK.d.cts → types-q5ficDSo.d.cts} +33 -1
  57. package/package.json +1 -1
@@ -8,6 +8,7 @@ import { CellPatch } from './data-table/fill.js';
8
8
  import { ColumnFacets } from './data-table/facets.js';
9
9
  import { SpreadsheetIntent, SpreadsheetPastePlan } from './data-table/spreadsheet.js';
10
10
  import { DateColumnFilterValue } from './data-table/date-filter.js';
11
+ import { MatrxTableMenuItem, MatrxTableMenuPayload, MatrxTableMenuSection } from './data-table/menu-targets.js';
11
12
 
12
13
  type TableSearchRole = "id" | "name" | "description" | "other";
13
14
  interface TableSearchScope {
@@ -147,6 +148,14 @@ interface MatrxColumnDef<T> {
147
148
  * again clears it.
148
149
  */
149
150
  filterSingle?: boolean;
151
+ /**
152
+ * THE CONSUMER'S OWN COLUMN ACTIONS, in the header's one menu — rename,
153
+ * insert left/right, use as the row label, colour by, settings — drawn under
154
+ * the built-in sort and filter, in the same popover, never a second control
155
+ * beside it. An item with `disabledReason` stays visible and says why it
156
+ * cannot run here. Absent or empty, the header menu is exactly what it was.
157
+ */
158
+ headerMenu?: MatrxTableMenuItem[];
150
159
  /** Allow an exact typed value not present in loaded select options. */
151
160
  filterAllowCustom?: boolean;
152
161
  /**
@@ -864,6 +873,16 @@ interface MatrxDataTableContextMenuConfig<T> {
864
873
  rowCount: number;
865
874
  columnIds: string[];
866
875
  }) => unknown;
876
+ /**
877
+ * NEUTRAL SECTIONS for whatever was right-clicked. Asked each time the menu
878
+ * opens, with the level's own payload — the cell's row, column and value; the
879
+ * row; the column's label and values; the selected range's ids and TSV; the
880
+ * table's row count — and answered with plain `MatrxTableMenuSection`s the
881
+ * host draws in its own right-click menu, beside what it already offers.
882
+ * Nothing here names a menu system. Absent, the right-click menu is exactly
883
+ * what it was.
884
+ */
885
+ sections?: (payload: MatrxTableMenuPayload<T>) => MatrxTableMenuSection[];
867
886
  }
868
887
  interface MatrxDataTableWindowConfig<T> {
869
888
  /** Window title. */
@@ -1177,7 +1196,20 @@ interface MatrxDataTableSpreadsheetConfig<T> {
1177
1196
  * clear, an undo and a redo. The table re-reads from `data`, so a write the
1178
1197
  * caller refuses simply never appears.
1179
1198
  */
1180
- onPatch: (patches: CellPatch[], intent: SpreadsheetIntent) => void | Promise<void>;
1199
+ onPatch?: ((patches: CellPatch[], intent: SpreadsheetIntent) => void | Promise<void>) | undefined;
1200
+ /**
1201
+ * RANGE SELECTION AND COPY FOR A READER — a flag of its own, separate from
1202
+ * editing. A person who may not change a table may still drag out a range,
1203
+ * move it with the arrows, select all and press Cmd-C (or right-click the
1204
+ * range) to take a real Excel/Sheets block out of it. With `readOnly` the
1205
+ * grid offers every selection gesture and no write: no fill handle, no
1206
+ * editor on Enter or typing, and cut, paste, clear, fill-down, undo and redo
1207
+ * each say `readOnlyReason` rather than doing anything. `onPatch` is not
1208
+ * needed. Default false.
1209
+ */
1210
+ readOnly?: boolean | undefined;
1211
+ /** What a refused write says on a read-only grid. Defaults to a plain view-only sentence. */
1212
+ readOnlyReason?: string | undefined;
1181
1213
  /** Column ids a patch may target. Defaults to every column marked `editable`. */
1182
1214
  writableColumnIds?: string[] | undefined;
1183
1215
  /** Why a column refuses a write, as a sentence a person can act on. */
@@ -8,6 +8,7 @@ import { CellPatch } from './data-table/fill.cjs';
8
8
  import { ColumnFacets } from './data-table/facets.cjs';
9
9
  import { SpreadsheetIntent, SpreadsheetPastePlan } from './data-table/spreadsheet.cjs';
10
10
  import { DateColumnFilterValue } from './data-table/date-filter.cjs';
11
+ import { MatrxTableMenuItem, MatrxTableMenuPayload, MatrxTableMenuSection } from './data-table/menu-targets.cjs';
11
12
 
12
13
  type TableSearchRole = "id" | "name" | "description" | "other";
13
14
  interface TableSearchScope {
@@ -147,6 +148,14 @@ interface MatrxColumnDef<T> {
147
148
  * again clears it.
148
149
  */
149
150
  filterSingle?: boolean;
151
+ /**
152
+ * THE CONSUMER'S OWN COLUMN ACTIONS, in the header's one menu — rename,
153
+ * insert left/right, use as the row label, colour by, settings — drawn under
154
+ * the built-in sort and filter, in the same popover, never a second control
155
+ * beside it. An item with `disabledReason` stays visible and says why it
156
+ * cannot run here. Absent or empty, the header menu is exactly what it was.
157
+ */
158
+ headerMenu?: MatrxTableMenuItem[];
150
159
  /** Allow an exact typed value not present in loaded select options. */
151
160
  filterAllowCustom?: boolean;
152
161
  /**
@@ -864,6 +873,16 @@ interface MatrxDataTableContextMenuConfig<T> {
864
873
  rowCount: number;
865
874
  columnIds: string[];
866
875
  }) => unknown;
876
+ /**
877
+ * NEUTRAL SECTIONS for whatever was right-clicked. Asked each time the menu
878
+ * opens, with the level's own payload — the cell's row, column and value; the
879
+ * row; the column's label and values; the selected range's ids and TSV; the
880
+ * table's row count — and answered with plain `MatrxTableMenuSection`s the
881
+ * host draws in its own right-click menu, beside what it already offers.
882
+ * Nothing here names a menu system. Absent, the right-click menu is exactly
883
+ * what it was.
884
+ */
885
+ sections?: (payload: MatrxTableMenuPayload<T>) => MatrxTableMenuSection[];
867
886
  }
868
887
  interface MatrxDataTableWindowConfig<T> {
869
888
  /** Window title. */
@@ -1177,7 +1196,20 @@ interface MatrxDataTableSpreadsheetConfig<T> {
1177
1196
  * clear, an undo and a redo. The table re-reads from `data`, so a write the
1178
1197
  * caller refuses simply never appears.
1179
1198
  */
1180
- onPatch: (patches: CellPatch[], intent: SpreadsheetIntent) => void | Promise<void>;
1199
+ onPatch?: ((patches: CellPatch[], intent: SpreadsheetIntent) => void | Promise<void>) | undefined;
1200
+ /**
1201
+ * RANGE SELECTION AND COPY FOR A READER — a flag of its own, separate from
1202
+ * editing. A person who may not change a table may still drag out a range,
1203
+ * move it with the arrows, select all and press Cmd-C (or right-click the
1204
+ * range) to take a real Excel/Sheets block out of it. With `readOnly` the
1205
+ * grid offers every selection gesture and no write: no fill handle, no
1206
+ * editor on Enter or typing, and cut, paste, clear, fill-down, undo and redo
1207
+ * each say `readOnlyReason` rather than doing anything. `onPatch` is not
1208
+ * needed. Default false.
1209
+ */
1210
+ readOnly?: boolean | undefined;
1211
+ /** What a refused write says on a read-only grid. Defaults to a plain view-only sentence. */
1212
+ readOnlyReason?: string | undefined;
1181
1213
  /** Column ids a patch may target. Defaults to every column marked `editable`. */
1182
1214
  writableColumnIds?: string[] | undefined;
1183
1215
  /** Why a column refuses a write, as a sentence a person can act on. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/design-system",
3
- "version": "0.41.0",
3
+ "version": "0.42.1",
4
4
  "description": "AI Matrx semantic React primitives shared across Vite, Next.js, desktop, and customer-built applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",