@ai-matrx/design-system 0.22.0 → 0.26.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 +227 -0
- package/dist/data-table/cell-undo.cjs +98 -0
- package/dist/data-table/cell-undo.cjs.map +1 -0
- package/dist/data-table/cell-undo.d.cts +85 -0
- package/dist/data-table/cell-undo.d.ts +85 -0
- package/dist/data-table/cell-undo.js +78 -0
- package/dist/data-table/cell-undo.js.map +1 -0
- package/dist/data-table/copy-helpers.d.cts +7 -2
- package/dist/data-table/copy-helpers.d.ts +7 -2
- package/dist/data-table/coverage.cjs +116 -0
- package/dist/data-table/coverage.cjs.map +1 -0
- package/dist/data-table/coverage.d.cts +65 -0
- package/dist/data-table/coverage.d.ts +65 -0
- package/dist/data-table/coverage.js +96 -0
- package/dist/data-table/coverage.js.map +1 -0
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/facets.cjs +118 -0
- package/dist/data-table/facets.cjs.map +1 -0
- package/dist/data-table/facets.d.cts +100 -0
- package/dist/data-table/facets.d.ts +100 -0
- package/dist/data-table/facets.js +98 -0
- package/dist/data-table/facets.js.map +1 -0
- package/dist/data-table/fill.cjs +299 -0
- package/dist/data-table/fill.cjs.map +1 -0
- package/dist/data-table/fill.d.cts +129 -0
- package/dist/data-table/fill.d.ts +129 -0
- package/dist/data-table/fill.js +277 -0
- package/dist/data-table/fill.js.map +1 -0
- package/dist/data-table/filter-engine.d.cts +7 -2
- package/dist/data-table/filter-engine.d.ts +7 -2
- package/dist/data-table/grid-clipboard.cjs +165 -0
- package/dist/data-table/grid-clipboard.cjs.map +1 -0
- package/dist/data-table/grid-clipboard.d.cts +85 -0
- package/dist/data-table/grid-clipboard.d.ts +85 -0
- package/dist/data-table/grid-clipboard.js +145 -0
- package/dist/data-table/grid-clipboard.js.map +1 -0
- package/dist/data-table/grid-selection.cjs +258 -0
- package/dist/data-table/grid-selection.cjs.map +1 -0
- package/dist/data-table/grid-selection.d.cts +166 -0
- package/dist/data-table/grid-selection.d.ts +166 -0
- package/dist/data-table/grid-selection.js +238 -0
- package/dist/data-table/grid-selection.js.map +1 -0
- package/dist/data-table/grouping.cjs +302 -0
- package/dist/data-table/grouping.cjs.map +1 -0
- package/dist/data-table/grouping.d.cts +119 -0
- package/dist/data-table/grouping.d.ts +119 -0
- package/dist/data-table/grouping.js +282 -0
- package/dist/data-table/grouping.js.map +1 -0
- package/dist/data-table/host.cjs.map +1 -1
- package/dist/data-table/host.d.cts +18 -4
- package/dist/data-table/host.d.ts +18 -4
- package/dist/data-table/host.js.map +1 -1
- package/dist/data-table/index.cjs +3173 -451
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +13 -3
- package/dist/data-table/index.d.ts +13 -3
- package/dist/data-table/index.js +3174 -451
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +7 -2
- package/dist/data-table/infer-filter.d.ts +7 -2
- package/dist/data-table/layered-filters.d.cts +7 -2
- package/dist/data-table/layered-filters.d.ts +7 -2
- package/dist/data-table/menu-targets.cjs +77 -0
- package/dist/data-table/menu-targets.cjs.map +1 -0
- package/dist/data-table/menu-targets.d.cts +108 -0
- package/dist/data-table/menu-targets.d.ts +108 -0
- package/dist/data-table/menu-targets.js +57 -0
- package/dist/data-table/menu-targets.js.map +1 -0
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +7 -2
- package/dist/data-table/query-control.d.ts +7 -2
- package/dist/data-table/spreadsheet.cjs +1062 -0
- package/dist/data-table/spreadsheet.cjs.map +1 -0
- package/dist/data-table/spreadsheet.d.cts +153 -0
- package/dist/data-table/spreadsheet.d.ts +153 -0
- package/dist/data-table/spreadsheet.js +1042 -0
- package/dist/data-table/spreadsheet.js.map +1 -0
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +7 -2
- package/dist/data-table/types.d.ts +7 -2
- package/dist/data-table/url-state.d.cts +7 -2
- package/dist/data-table/url-state.d.ts +7 -2
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js.map +1 -1
- package/dist/data-table/validation.cjs +229 -0
- package/dist/data-table/validation.cjs.map +1 -0
- package/dist/data-table/validation.d.cts +125 -0
- package/dist/data-table/validation.d.ts +125 -0
- package/dist/data-table/validation.js +209 -0
- package/dist/data-table/validation.js.map +1 -0
- package/dist/data-table/virtual-window.cjs +203 -0
- package/dist/data-table/virtual-window.cjs.map +1 -0
- package/dist/data-table/virtual-window.d.cts +84 -0
- package/dist/data-table/virtual-window.d.ts +84 -0
- package/dist/data-table/virtual-window.js +183 -0
- package/dist/data-table/virtual-window.js.map +1 -0
- package/dist/data-table/xlsx.d.cts +7 -2
- package/dist/data-table/xlsx.d.ts +7 -2
- package/dist/field-formats/index.d.cts +2 -2
- package/dist/field-formats/index.d.ts +2 -2
- package/dist/formulas/index.cjs +1041 -0
- package/dist/formulas/index.cjs.map +1 -0
- package/dist/formulas/index.d.cts +389 -0
- package/dist/formulas/index.d.ts +389 -0
- package/dist/formulas/index.js +1019 -0
- package/dist/formulas/index.js.map +1 -0
- package/dist/{types-BdbvlF9-.d.cts → types-CJWU1Gae.d.cts} +1 -1
- package/dist/{types-BdbvlF9-.d.ts → types-CJWU1Gae.d.ts} +1 -1
- package/dist/{types-D-flTpK0.d.ts → types-Cu5_eUG1.d.ts} +268 -4
- package/dist/{types-Sn249eoy.d.cts → types-DrJXAAoD.d.cts} +268 -4
- package/package.json +129 -2
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { ContentTransferReference } from './content-transfer.cjs';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { AiVariant, AiCustomSource, CopyExportConfig } from './data-table/copy-types.cjs';
|
|
4
|
-
import {
|
|
4
|
+
import { F as FieldFormatConfig } from './types-CJWU1Gae.cjs';
|
|
5
|
+
import { GroupAggregateSpec, GroupOrder } from './data-table/grouping.cjs';
|
|
6
|
+
import { CellPatch } from './data-table/fill.cjs';
|
|
7
|
+
import { ColumnFacets } from './data-table/facets.cjs';
|
|
8
|
+
import { SpreadsheetIntent } from './data-table/spreadsheet.cjs';
|
|
5
9
|
|
|
6
10
|
type TableSearchRole = "id" | "name" | "description" | "other";
|
|
7
11
|
interface TableSearchScope {
|
|
@@ -900,9 +904,49 @@ interface MatrxDataTableExpandedDetailConfig<T> {
|
|
|
900
904
|
render: (row: T, controls: MatrxDataTableRecordControls) => ReactNode;
|
|
901
905
|
className?: string;
|
|
902
906
|
}
|
|
903
|
-
/**
|
|
907
|
+
/**
|
|
908
|
+
* THE FOUR LEVELS of a right-click, as opaque host-owned descriptors.
|
|
909
|
+
*
|
|
910
|
+
* A spreadsheet's right-click menu is four menus, chosen by where the pointer
|
|
911
|
+
* was: the CELL, the ROW it sits in, the COLUMN it sits under, and — when the
|
|
912
|
+
* click lands inside an extended range — the SELECTION. The canonical table
|
|
913
|
+
* used to expose exactly one of them, which is why every surface that wanted
|
|
914
|
+
* the other three forked the table.
|
|
915
|
+
*
|
|
916
|
+
* Each resolver is optional and each returns something the package never
|
|
917
|
+
* interprets; the host builds its menu from it. A level with no resolver here
|
|
918
|
+
* falls back to the host's own `createDefaultMenuContext`, so a table that
|
|
919
|
+
* declares nothing still gets all four through the platform's universal menu.
|
|
920
|
+
*/
|
|
904
921
|
interface MatrxDataTableContextMenuConfig<T> {
|
|
905
|
-
resolveRowContext
|
|
922
|
+
resolveRowContext?: (row: T, controls: MatrxDataTableRecordControls) => unknown;
|
|
923
|
+
resolveCellContext?: (args: {
|
|
924
|
+
row: T;
|
|
925
|
+
rowId: string;
|
|
926
|
+
columnId: string;
|
|
927
|
+
columnLabel: string;
|
|
928
|
+
value: unknown;
|
|
929
|
+
/** The cell's value as text, for the menu's own Copy. */
|
|
930
|
+
text: string;
|
|
931
|
+
controls: MatrxDataTableRecordControls;
|
|
932
|
+
}) => unknown;
|
|
933
|
+
resolveColumnContext?: (args: {
|
|
934
|
+
columnId: string;
|
|
935
|
+
columnLabel: string;
|
|
936
|
+
/** Every rendered row's value for this column, in visual order. */
|
|
937
|
+
values: unknown[];
|
|
938
|
+
}) => unknown;
|
|
939
|
+
resolveSelectionContext?: (args: {
|
|
940
|
+
rowIds: string[];
|
|
941
|
+
columnIds: string[];
|
|
942
|
+
/** The selected rectangle as an Excel/Sheets-compatible TSV block. */
|
|
943
|
+
tsv: string;
|
|
944
|
+
cellCount: number;
|
|
945
|
+
}) => unknown;
|
|
946
|
+
resolveTableContext?: (args: {
|
|
947
|
+
rowCount: number;
|
|
948
|
+
columnIds: string[];
|
|
949
|
+
}) => unknown;
|
|
906
950
|
}
|
|
907
951
|
interface MatrxDataTableWindowConfig<T> {
|
|
908
952
|
/** Window title. */
|
|
@@ -959,6 +1003,24 @@ interface MatrxDataTableEditConfig<T> {
|
|
|
959
1003
|
autoSave?: boolean;
|
|
960
1004
|
/** Optional cancel hook (draft already discarded). */
|
|
961
1005
|
onCancel?: () => void;
|
|
1006
|
+
/**
|
|
1007
|
+
* Judge a value the person MEANT to write, before it enters the draft.
|
|
1008
|
+
*
|
|
1009
|
+
* Return a sentence to REFUSE it: the editor stays open, the value is not
|
|
1010
|
+
* taken, and the sentence is shown IN THE CELL, where the person is standing.
|
|
1011
|
+
* Return undefined to accept. Excel's posture, and the reason is the product —
|
|
1012
|
+
* "Amount must be at least 0" is a thing a person can act on; a silent revert
|
|
1013
|
+
* is not.
|
|
1014
|
+
*
|
|
1015
|
+
* It never judges what is already stored: a value that predates the rule is
|
|
1016
|
+
* legal, is never rewritten, and is the point of declaring a rule at all.
|
|
1017
|
+
*/
|
|
1018
|
+
validate?: ((args: {
|
|
1019
|
+
row: T;
|
|
1020
|
+
rowId: string;
|
|
1021
|
+
columnId: string;
|
|
1022
|
+
value: unknown;
|
|
1023
|
+
}) => string | undefined) | undefined;
|
|
962
1024
|
}
|
|
963
1025
|
interface MatrxDataTableHierarchyConfig<T> {
|
|
964
1026
|
/** Complete hierarchy when `data` is only the current controlled page. */
|
|
@@ -1064,6 +1126,186 @@ interface MatrxDataTableStyleConfig<T> {
|
|
|
1064
1126
|
*/
|
|
1065
1127
|
choiceColorFor?: ChoiceColorLookup;
|
|
1066
1128
|
}
|
|
1129
|
+
/**
|
|
1130
|
+
* GROUPING — "group these rows by Status" with collapsible sections, a count
|
|
1131
|
+
* and a subtotal on each.
|
|
1132
|
+
*
|
|
1133
|
+
* This is the primitive's answer to the biggest gap against Airtable, Google
|
|
1134
|
+
* Sheets and Notion. It is opt-in, and it is CONTROLLED for the two pieces of
|
|
1135
|
+
* state a person expects to survive: which column groups, and which sections
|
|
1136
|
+
* are shut. Both are ordinary values, so a saved view carries them like any
|
|
1137
|
+
* other reading of the table.
|
|
1138
|
+
*
|
|
1139
|
+
* Grouping runs AFTER local processing and over the rows the table is about to
|
|
1140
|
+
* render. It never re-sorts inside a group: the sort the person chose is the
|
|
1141
|
+
* order they see.
|
|
1142
|
+
*/
|
|
1143
|
+
interface MatrxDataTableGroupingConfig<T> {
|
|
1144
|
+
/** Column id to group by. `null` means grouping is available but off. */
|
|
1145
|
+
columnId: string | null;
|
|
1146
|
+
/** Emitted when the person picks a different column (or clears it). */
|
|
1147
|
+
onColumnIdChange?: ((columnId: string | null) => void) | undefined;
|
|
1148
|
+
/**
|
|
1149
|
+
* Columns offered in the group-by control. Defaults to every visible column
|
|
1150
|
+
* that is not an actions column. A column with thousands of distinct values
|
|
1151
|
+
* is a bad grouping and the consumer is the only one who knows that.
|
|
1152
|
+
*/
|
|
1153
|
+
groupableColumnIds?: string[] | undefined;
|
|
1154
|
+
/** Per-column subtotal shown on every group header, keyed by column id. */
|
|
1155
|
+
aggregates?: Record<string, GroupAggregateSpec> | undefined;
|
|
1156
|
+
/** Controlled collapsed group keys (`TableGroup.key`). */
|
|
1157
|
+
collapsed?: string[] | undefined;
|
|
1158
|
+
onCollapsedChange?: ((collapsed: string[]) => void) | undefined;
|
|
1159
|
+
/** Section order. Default `"value-asc"`; blanks always sort last. */
|
|
1160
|
+
order?: GroupOrder | undefined;
|
|
1161
|
+
/** Label for the section of rows whose grouping value is blank. */
|
|
1162
|
+
emptyLabel?: string | undefined;
|
|
1163
|
+
/** Singular noun for a group's summary ("job" → "12 jobs"). */
|
|
1164
|
+
rowNoun?: string | undefined;
|
|
1165
|
+
/**
|
|
1166
|
+
* Reads the grouping value for a column. Defaults to the column's own
|
|
1167
|
+
* accessor.
|
|
1168
|
+
*
|
|
1169
|
+
* NOT named `valueOf`: every object in JavaScript already has one, so an
|
|
1170
|
+
* optional config field by that name is always "present" and a `config.valueOf
|
|
1171
|
+
* ? … : …` check silently calls `Object.prototype.valueOf` and groups every
|
|
1172
|
+
* row under the config object itself. It did exactly that here once.
|
|
1173
|
+
*/
|
|
1174
|
+
readCell?: ((row: T, columnId: string) => unknown) | undefined;
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* VIRTUALIZATION — render the rows a person can actually see.
|
|
1178
|
+
*
|
|
1179
|
+
* Off by default, because most tables in the product are short and a windowed
|
|
1180
|
+
* body costs a scroll container contract that a short table does not need.
|
|
1181
|
+
* On, it engages only past `threshold` rows, so a 40-row table behaves exactly
|
|
1182
|
+
* as it always did and a 100,000-row table scrolls.
|
|
1183
|
+
*/
|
|
1184
|
+
interface MatrxDataTableVirtualizeConfig {
|
|
1185
|
+
enabled?: boolean | undefined;
|
|
1186
|
+
/** Row height in px used for the window math. Default follows density. */
|
|
1187
|
+
rowHeight?: number | undefined;
|
|
1188
|
+
/** Rows rendered beyond each edge of the viewport. Default 8. */
|
|
1189
|
+
overscan?: number | undefined;
|
|
1190
|
+
/** Row count below which the body renders whole. Default 150. */
|
|
1191
|
+
threshold?: number | undefined;
|
|
1192
|
+
/**
|
|
1193
|
+
* Window the COLUMNS too, for tables hundreds of columns wide. Frozen
|
|
1194
|
+
* columns are always rendered, never windowed out.
|
|
1195
|
+
*/
|
|
1196
|
+
columns?: boolean | undefined;
|
|
1197
|
+
/** Column width in px used for the horizontal window. Default 160. */
|
|
1198
|
+
columnWidth?: number | undefined;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* THE HONEST COUNT.
|
|
1202
|
+
*
|
|
1203
|
+
* A table that filters over part of its rows and says nothing is a screen that
|
|
1204
|
+
* lies. Declare what the answer actually covers and the table states it, in
|
|
1205
|
+
* plain English, above the rows — and never presents a partial count as exact.
|
|
1206
|
+
*
|
|
1207
|
+
* Omit this entirely and the table says nothing, which is correct for a table
|
|
1208
|
+
* whose rows are all in hand.
|
|
1209
|
+
*/
|
|
1210
|
+
interface MatrxDataTableCoverageConfig {
|
|
1211
|
+
/** Rows the source says match the current query, when it can say. */
|
|
1212
|
+
matched?: number | undefined;
|
|
1213
|
+
/** Rows in the table irrespective of the query, when known. */
|
|
1214
|
+
total?: number | undefined;
|
|
1215
|
+
/** A ceiling the source imposed on this answer (a fetch cap). */
|
|
1216
|
+
cap?: number | undefined;
|
|
1217
|
+
/** Who answered the filters and sort. Default `"client"`. */
|
|
1218
|
+
answeredBy?: "source" | "client" | undefined;
|
|
1219
|
+
/** Singular noun for the sentence. Default "row". */
|
|
1220
|
+
noun?: string | undefined;
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* SPREADSHEET GESTURES — range selection, Excel paste, fill, undo.
|
|
1224
|
+
*
|
|
1225
|
+
* The `/data` grid had all of this and nothing else in the product could reach
|
|
1226
|
+
* it. Opt-in, because a reference table with one editable column does not want
|
|
1227
|
+
* a cell cursor; a table a person works IN does.
|
|
1228
|
+
*
|
|
1229
|
+
* The table owns the gestures and the selection rectangle; the CONSUMER owns
|
|
1230
|
+
* the writes. Every mutation arrives as a list of `CellPatch`, so the caller
|
|
1231
|
+
* applies it through the door it already has and the table never invents a
|
|
1232
|
+
* persistence path of its own. That is also what makes undo honest: the stack
|
|
1233
|
+
* holds before-values, and an undo is just another patch list.
|
|
1234
|
+
*/
|
|
1235
|
+
interface MatrxDataTableSpreadsheetConfig<T> {
|
|
1236
|
+
enabled?: boolean | undefined;
|
|
1237
|
+
/**
|
|
1238
|
+
* Apply cell writes. Called for a paste, a fill-down, a fill-handle drag, a
|
|
1239
|
+
* clear, an undo and a redo. The table re-reads from `data`, so a write the
|
|
1240
|
+
* caller refuses simply never appears.
|
|
1241
|
+
*/
|
|
1242
|
+
onPatch: (patches: CellPatch[], intent: SpreadsheetIntent) => void | Promise<void>;
|
|
1243
|
+
/** Column ids a patch may target. Defaults to every column marked `editable`. */
|
|
1244
|
+
writableColumnIds?: string[] | undefined;
|
|
1245
|
+
/** Why a column refuses a write, as a sentence a person can act on. */
|
|
1246
|
+
columnRefusal?: ((columnId: string) => string | undefined) | undefined;
|
|
1247
|
+
/** Reads a cell for copy and fill. Defaults to the column's own accessor. */
|
|
1248
|
+
readCell?: ((row: T, columnId: string) => unknown) | undefined;
|
|
1249
|
+
/** The little square at the corner of a selection. Default true. */
|
|
1250
|
+
fillHandle?: boolean | undefined;
|
|
1251
|
+
/** Paste real Excel/Sheets TSV into the selection. Default true. */
|
|
1252
|
+
paste?: boolean | undefined;
|
|
1253
|
+
/** Undo depth. 0 turns undo off. Default 100. */
|
|
1254
|
+
undoDepth?: number | undefined;
|
|
1255
|
+
/** Says what just happened, and why something did not. */
|
|
1256
|
+
notify?: ((message: string) => void) | undefined;
|
|
1257
|
+
/**
|
|
1258
|
+
* Judge ONE value before it is written, for a paste, a fill or a clear.
|
|
1259
|
+
*
|
|
1260
|
+
* Return a sentence to REFUSE it — the cell is left alone and the sentence is
|
|
1261
|
+
* what the person is told. Return undefined to accept. This is the same rule
|
|
1262
|
+
* the inline editor enforces (`edit.validate`), asked in the one other place
|
|
1263
|
+
* a value can enter a cell, because a rule a paste can walk around is not a
|
|
1264
|
+
* rule.
|
|
1265
|
+
*/
|
|
1266
|
+
validateCell?: ((args: {
|
|
1267
|
+
rowId: string;
|
|
1268
|
+
columnId: string;
|
|
1269
|
+
value: unknown;
|
|
1270
|
+
}) => string | undefined) | undefined;
|
|
1271
|
+
}
|
|
1272
|
+
/**
|
|
1273
|
+
* THE VALUES A COLUMN HOLDS, with a count beside each one.
|
|
1274
|
+
*
|
|
1275
|
+
* A filter that only offers "Contains…" asks the reader to already know what is
|
|
1276
|
+
* in the column. The checklist tells them, and the counts are what make it
|
|
1277
|
+
* usable: "Blocked 12" is a decision, "Blocked" is a guess.
|
|
1278
|
+
*
|
|
1279
|
+
* THE HONESTY RULE: counts are computed in the browser ONLY when the browser
|
|
1280
|
+
* holds every row they describe. Otherwise `source` is asked — the database
|
|
1281
|
+
* counts over the whole column — and if there is no source, the popover SAYS
|
|
1282
|
+
* the counts cover only the loaded rows. A partial count is never printed as if
|
|
1283
|
+
* it were the whole truth.
|
|
1284
|
+
*/
|
|
1285
|
+
interface MatrxDataTableFacetsConfig<T> {
|
|
1286
|
+
enabled?: boolean | undefined;
|
|
1287
|
+
/**
|
|
1288
|
+
* Database-computed values and counts for one column. Called only when the
|
|
1289
|
+
* rows in the browser do not cover `totalRows` — local-data-first is the same
|
|
1290
|
+
* rule for every source. Return null (or throw) and the popover says so and
|
|
1291
|
+
* falls back to matching text.
|
|
1292
|
+
*/
|
|
1293
|
+
source?: ((args: {
|
|
1294
|
+
columnId: string;
|
|
1295
|
+
search: string;
|
|
1296
|
+
limit: number;
|
|
1297
|
+
}) => Promise<ColumnFacets | null>) | undefined;
|
|
1298
|
+
/**
|
|
1299
|
+
* Rows the whole table holds after the active search. This is how the table
|
|
1300
|
+
* knows whether the rows it has are all of them. Omit it and the table treats
|
|
1301
|
+
* its own rows as a partial answer and says so.
|
|
1302
|
+
*/
|
|
1303
|
+
totalRows?: number | undefined;
|
|
1304
|
+
/** Most values to list. Default 200, hard ceiling 500. */
|
|
1305
|
+
limit?: number | undefined;
|
|
1306
|
+
/** Reads a cell for counting. Defaults to the column's own filter accessor. */
|
|
1307
|
+
readCell?: ((row: T, columnId: string) => unknown) | undefined;
|
|
1308
|
+
}
|
|
1067
1309
|
interface MatrxDataTableProps<T> {
|
|
1068
1310
|
data: T[];
|
|
1069
1311
|
columns: MatrxColumnDef<T>[];
|
|
@@ -1193,6 +1435,28 @@ interface MatrxDataTableProps<T> {
|
|
|
1193
1435
|
* person edits it.
|
|
1194
1436
|
*/
|
|
1195
1437
|
tableStyle?: MatrxDataTableStyleConfig<T>;
|
|
1438
|
+
/**
|
|
1439
|
+
* GROUPS — collapsible sections by a column, with a count and per-column
|
|
1440
|
+
* subtotals on each header. Opt-in and controlled; see the config's own doc.
|
|
1441
|
+
*/
|
|
1442
|
+
grouping?: MatrxDataTableGroupingConfig<T>;
|
|
1443
|
+
/** Render only the rows in view. Opt-in; engages past its own threshold. */
|
|
1444
|
+
virtualize?: boolean | MatrxDataTableVirtualizeConfig;
|
|
1445
|
+
/**
|
|
1446
|
+
* What the current answer actually covers. Declare it and the table says so
|
|
1447
|
+
* on screen when a filter is answering over part of the table, instead of
|
|
1448
|
+
* presenting a partial count as the whole truth.
|
|
1449
|
+
*/
|
|
1450
|
+
coverage?: MatrxDataTableCoverageConfig;
|
|
1451
|
+
/** Range selection, Excel paste, fill handle, fill-down, undo. Opt-in. */
|
|
1452
|
+
spreadsheet?: MatrxDataTableSpreadsheetConfig<T>;
|
|
1453
|
+
/** Real values with their counts in every column filter popover. */
|
|
1454
|
+
facets?: MatrxDataTableFacetsConfig<T>;
|
|
1455
|
+
/**
|
|
1456
|
+
* Explicit body row height in px. Overrides the density default. Use it when
|
|
1457
|
+
* a saved view remembers a row height the person chose.
|
|
1458
|
+
*/
|
|
1459
|
+
rowHeight?: number;
|
|
1196
1460
|
/** Highlight an index in the currently rendered page without selecting it. */
|
|
1197
1461
|
highlightedIndex?: number | undefined;
|
|
1198
1462
|
/** Receives the complete visible local view after local processing, before paging. Attaching after absence receives one snapshot; callback identity changes alone do not notify. */
|
|
@@ -1258,4 +1522,4 @@ interface MatrxDataTableProps<T> {
|
|
|
1258
1522
|
onRowOpen?: (row: T) => void;
|
|
1259
1523
|
}
|
|
1260
1524
|
|
|
1261
|
-
export {
|
|
1525
|
+
export { SWATCH_CLASS as $, type AnyOfColumnSearch as A, BOOLEAN_TRUE_COLOR as B, type ColumnFiltersState as C, type MatrxDataTableFilterUi as D, EMPTY_TABLE_STYLE as E, type MatrxDataTableGroupingConfig as F, type MatrxDataTableHierarchyConfig as G, type MatrxDataTableHierarchyMove as H, type MatrxDataTableMobileCardControls as I, type MatrxDataTableQueryControl as J, type MatrxDataTableSelectionConfig as K, type LayeredFilterRule as L, type MatrxColumnDef as M, type MatrxDataTableSourceProcessing as N, type MatrxDataTableSpreadsheetConfig as O, type MatrxDataTableStyleConfig as P, type MatrxDataTableToolbar as Q, type MatrxDataTableUrlStateConfig as R, type SortState as S, type TableSearchMatchMode as T, type MatrxDataTableVirtualizeConfig as U, type MatrxDataTableWindowConfig as V, type MatrxTablePagination as W, OPS_WITH_VALUE as X, ROW_TINT_CLASS as Y, STYLE_COLORS as Z, STYLE_COLOR_LABELS as _, type ColumnFilterValue as a, type SortDirection as a0, type StyleColor as a1, type StylePath as a2, type StyleTarget as a3, TABLE_STYLE_METADATA_KEY as a4, TABLE_STYLE_VERSION as a5, type TableRankedSearchOptions as a6, type TableSearchRole as a7, type TableSearchScope as a8, type TableStyle as a9, layeredFilterMatchesValue as aA, layeredFilterNeedsValue as aB, layeredFilterRuleSummary as aC, operatorsForLayeredField as aD, type TableViewQuery as aa, type TextFilterMode as ab, type ToolbarFacet as ac, applyStylePath as ad, colorForChoice as ae, evaluateRule as af, inferTableSearchRole as ag, isStyleColor as ah, parseTableStyle as ai, rankTableSearchRows as aj, resolveCellColor as ak, resolveRowColor as al, resolveTableSearchScopes as am, stylePath as an, tableStyleFromMetadata as ao, tableStyleIsEmpty as ap, LAYERED_FILTER_OPERATORS as aq, LAYERED_FILTER_OPERATOR_LABELS as ar, type LayeredFilterField as as, type LayeredFilterOperator as at, columnFiltersToLayeredRules as au, completeLayeredFilterRules as av, decodeLayeredFilterRules as aw, encodeLayeredFilterRules as ax, isCompleteLayeredFilterRule as ay, isLayeredFilterOperator as az, type TableSavedViewsProps as b, type MatrxDataTableDensity as c, type MatrxDataTableRecordControls as d, type MatrxDataTableQueryState as e, type ColumnFilterKind as f, type MatrxDataTableCopyConfig as g, type MatrxDataTableProps as h, type TableViewSnapshot as i, type ColumnMarker as j, CELL_TINT_CLASS as k, COLOR_RULE_OPS as l, COLOR_RULE_OP_LABELS as m, type CellEditType as n, type CellEditsMap as o, type ChoiceColorLookup as p, type ColorBy as q, type ColorRule as r, type ColorRuleOp as s, type MatrxDataTableContextMenuConfig as t, type MatrxDataTableCoverageConfig as u, type MatrxDataTableDetailConfig as v, type MatrxDataTableEditConfig as w, type MatrxDataTableEmptyState as x, type MatrxDataTableExpandedDetailConfig as y, type MatrxDataTableFacetsConfig as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
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",
|
|
@@ -88,6 +88,16 @@
|
|
|
88
88
|
"default": "./dist/field-formats/index.cjs"
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
|
+
"./formulas": {
|
|
92
|
+
"import": {
|
|
93
|
+
"types": "./dist/formulas/index.d.ts",
|
|
94
|
+
"default": "./dist/formulas/index.js"
|
|
95
|
+
},
|
|
96
|
+
"require": {
|
|
97
|
+
"types": "./dist/formulas/index.d.cts",
|
|
98
|
+
"default": "./dist/formulas/index.cjs"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
91
101
|
"./data-table/host": {
|
|
92
102
|
"import": {
|
|
93
103
|
"types": "./dist/data-table/host.d.ts",
|
|
@@ -238,6 +248,116 @@
|
|
|
238
248
|
"default": "./dist/data-table/copy-types.cjs"
|
|
239
249
|
}
|
|
240
250
|
},
|
|
251
|
+
"./data-table/validation": {
|
|
252
|
+
"import": {
|
|
253
|
+
"types": "./dist/data-table/validation.d.ts",
|
|
254
|
+
"default": "./dist/data-table/validation.js"
|
|
255
|
+
},
|
|
256
|
+
"require": {
|
|
257
|
+
"types": "./dist/data-table/validation.d.cts",
|
|
258
|
+
"default": "./dist/data-table/validation.cjs"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"./data-table/grid-clipboard": {
|
|
262
|
+
"import": {
|
|
263
|
+
"types": "./dist/data-table/grid-clipboard.d.ts",
|
|
264
|
+
"default": "./dist/data-table/grid-clipboard.js"
|
|
265
|
+
},
|
|
266
|
+
"require": {
|
|
267
|
+
"types": "./dist/data-table/grid-clipboard.d.cts",
|
|
268
|
+
"default": "./dist/data-table/grid-clipboard.cjs"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"./data-table/grid-selection": {
|
|
272
|
+
"import": {
|
|
273
|
+
"types": "./dist/data-table/grid-selection.d.ts",
|
|
274
|
+
"default": "./dist/data-table/grid-selection.js"
|
|
275
|
+
},
|
|
276
|
+
"require": {
|
|
277
|
+
"types": "./dist/data-table/grid-selection.d.cts",
|
|
278
|
+
"default": "./dist/data-table/grid-selection.cjs"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"./data-table/cell-undo": {
|
|
282
|
+
"import": {
|
|
283
|
+
"types": "./dist/data-table/cell-undo.d.ts",
|
|
284
|
+
"default": "./dist/data-table/cell-undo.js"
|
|
285
|
+
},
|
|
286
|
+
"require": {
|
|
287
|
+
"types": "./dist/data-table/cell-undo.d.cts",
|
|
288
|
+
"default": "./dist/data-table/cell-undo.cjs"
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"./data-table/fill": {
|
|
292
|
+
"import": {
|
|
293
|
+
"types": "./dist/data-table/fill.d.ts",
|
|
294
|
+
"default": "./dist/data-table/fill.js"
|
|
295
|
+
},
|
|
296
|
+
"require": {
|
|
297
|
+
"types": "./dist/data-table/fill.d.cts",
|
|
298
|
+
"default": "./dist/data-table/fill.cjs"
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
"./data-table/coverage": {
|
|
302
|
+
"import": {
|
|
303
|
+
"types": "./dist/data-table/coverage.d.ts",
|
|
304
|
+
"default": "./dist/data-table/coverage.js"
|
|
305
|
+
},
|
|
306
|
+
"require": {
|
|
307
|
+
"types": "./dist/data-table/coverage.d.cts",
|
|
308
|
+
"default": "./dist/data-table/coverage.cjs"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"./data-table/virtual-window": {
|
|
312
|
+
"import": {
|
|
313
|
+
"types": "./dist/data-table/virtual-window.d.ts",
|
|
314
|
+
"default": "./dist/data-table/virtual-window.js"
|
|
315
|
+
},
|
|
316
|
+
"require": {
|
|
317
|
+
"types": "./dist/data-table/virtual-window.d.cts",
|
|
318
|
+
"default": "./dist/data-table/virtual-window.cjs"
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"./data-table/grouping": {
|
|
322
|
+
"import": {
|
|
323
|
+
"types": "./dist/data-table/grouping.d.ts",
|
|
324
|
+
"default": "./dist/data-table/grouping.js"
|
|
325
|
+
},
|
|
326
|
+
"require": {
|
|
327
|
+
"types": "./dist/data-table/grouping.d.cts",
|
|
328
|
+
"default": "./dist/data-table/grouping.cjs"
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"./data-table/spreadsheet": {
|
|
332
|
+
"import": {
|
|
333
|
+
"types": "./dist/data-table/spreadsheet.d.ts",
|
|
334
|
+
"default": "./dist/data-table/spreadsheet.js"
|
|
335
|
+
},
|
|
336
|
+
"require": {
|
|
337
|
+
"types": "./dist/data-table/spreadsheet.d.cts",
|
|
338
|
+
"default": "./dist/data-table/spreadsheet.cjs"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"./data-table/facets": {
|
|
342
|
+
"import": {
|
|
343
|
+
"types": "./dist/data-table/facets.d.ts",
|
|
344
|
+
"default": "./dist/data-table/facets.js"
|
|
345
|
+
},
|
|
346
|
+
"require": {
|
|
347
|
+
"types": "./dist/data-table/facets.d.cts",
|
|
348
|
+
"default": "./dist/data-table/facets.cjs"
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"./data-table/menu-targets": {
|
|
352
|
+
"import": {
|
|
353
|
+
"types": "./dist/data-table/menu-targets.d.ts",
|
|
354
|
+
"default": "./dist/data-table/menu-targets.js"
|
|
355
|
+
},
|
|
356
|
+
"require": {
|
|
357
|
+
"types": "./dist/data-table/menu-targets.d.cts",
|
|
358
|
+
"default": "./dist/data-table/menu-targets.cjs"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
241
361
|
"./package.json": "./package.json"
|
|
242
362
|
},
|
|
243
363
|
"dependencies": {
|
|
@@ -282,16 +402,20 @@
|
|
|
282
402
|
},
|
|
283
403
|
"devDependencies": {
|
|
284
404
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
405
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
285
406
|
"@testing-library/react": "^16.3.3",
|
|
286
407
|
"@types/node": "^26.6.1",
|
|
287
408
|
"@types/react": "19.3.0",
|
|
288
409
|
"@types/react-dom": "19.3.0",
|
|
410
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
289
411
|
"jsdom": "^30.0.1",
|
|
290
412
|
"publint": "^0.3.24",
|
|
291
413
|
"react": "^19.3.0",
|
|
292
414
|
"react-dom": "^19.3.0",
|
|
415
|
+
"tailwindcss": "^4.3.3",
|
|
293
416
|
"tsup": "^8.5.1",
|
|
294
417
|
"typescript": "^5.9.3",
|
|
418
|
+
"vite": "^7.3.1",
|
|
295
419
|
"vitest": "^5.0.1"
|
|
296
420
|
},
|
|
297
421
|
"publishConfig": {
|
|
@@ -315,6 +439,9 @@
|
|
|
315
439
|
"typecheck": "tsc --noEmit",
|
|
316
440
|
"test": "vitest run",
|
|
317
441
|
"verify:tarball": "node ./scripts/verify-tarball.mjs",
|
|
318
|
-
"verify:workspace-tarballs": "MATRX_VERIFY_LOCAL_KIT=1 node ./scripts/verify-tarball.mjs"
|
|
442
|
+
"verify:workspace-tarballs": "MATRX_VERIFY_LOCAL_KIT=1 node ./scripts/verify-tarball.mjs",
|
|
443
|
+
"demo": "vite --config demo/vite.config.ts",
|
|
444
|
+
"demo:build": "vite build --config demo/vite.config.ts",
|
|
445
|
+
"demo:preview": "vite preview --config demo/vite.config.ts"
|
|
319
446
|
}
|
|
320
447
|
}
|