@ai-matrx/design-system 0.28.0 → 0.30.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/data-table/copy-helpers.d.cts +1 -1
  3. package/dist/data-table/copy-helpers.d.ts +1 -1
  4. package/dist/data-table/filter-engine.d.cts +1 -1
  5. package/dist/data-table/filter-engine.d.ts +1 -1
  6. package/dist/data-table/host.d.cts +1 -1
  7. package/dist/data-table/host.d.ts +1 -1
  8. package/dist/data-table/index.cjs +39 -7
  9. package/dist/data-table/index.cjs.map +1 -1
  10. package/dist/data-table/index.d.cts +3 -3
  11. package/dist/data-table/index.d.ts +3 -3
  12. package/dist/data-table/index.js +39 -7
  13. package/dist/data-table/index.js.map +1 -1
  14. package/dist/data-table/infer-filter.d.cts +1 -1
  15. package/dist/data-table/infer-filter.d.ts +1 -1
  16. package/dist/data-table/layered-filters.d.cts +1 -1
  17. package/dist/data-table/layered-filters.d.ts +1 -1
  18. package/dist/data-table/query-control.d.cts +1 -1
  19. package/dist/data-table/query-control.d.ts +1 -1
  20. package/dist/data-table/spreadsheet.cjs +37 -6
  21. package/dist/data-table/spreadsheet.cjs.map +1 -1
  22. package/dist/data-table/spreadsheet.d.cts +35 -1
  23. package/dist/data-table/spreadsheet.d.ts +35 -1
  24. package/dist/data-table/spreadsheet.js +37 -6
  25. package/dist/data-table/spreadsheet.js.map +1 -1
  26. package/dist/data-table/types.cjs.map +1 -1
  27. package/dist/data-table/types.d.cts +2 -2
  28. package/dist/data-table/types.d.ts +2 -2
  29. package/dist/data-table/url-state.d.cts +1 -1
  30. package/dist/data-table/url-state.d.ts +1 -1
  31. package/dist/data-table/xlsx.d.cts +1 -1
  32. package/dist/data-table/xlsx.d.ts +1 -1
  33. package/dist/index.cjs +8 -4
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.js +8 -4
  36. package/dist/index.js.map +1 -1
  37. package/dist/{types-D9JBR6ZU.d.ts → types-CFmCZXVn.d.ts} +24 -1
  38. package/dist/{types-jQddSUnj.d.cts → types-CYkwg9jR.d.cts} +24 -1
  39. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, f as ColumnFilterKind } from '../types-jQddSUnj.cjs';
1
+ import { M as MatrxColumnDef, f as ColumnFilterKind } from '../types-CYkwg9jR.cjs';
2
2
  import '../content-transfer.cjs';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, f as ColumnFilterKind } from '../types-D9JBR6ZU.js';
1
+ import { M as MatrxColumnDef, f as ColumnFilterKind } from '../types-CFmCZXVn.js';
2
2
  import '../content-transfer.js';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- export { aq as LAYERED_FILTER_OPERATORS, ar as LAYERED_FILTER_OPERATOR_LABELS, as as LayeredFilterField, at as LayeredFilterOperator, L as LayeredFilterRule, au as columnFiltersToLayeredRules, av as completeLayeredFilterRules, aw as decodeLayeredFilterRules, ax as encodeLayeredFilterRules, ay as isCompleteLayeredFilterRule, az as isLayeredFilterOperator, aA as layeredFilterMatchesValue, aB as layeredFilterNeedsValue, aC as layeredFilterRuleSummary, aD as operatorsForLayeredField } from '../types-jQddSUnj.cjs';
1
+ export { aq as LAYERED_FILTER_OPERATORS, ar as LAYERED_FILTER_OPERATOR_LABELS, as as LayeredFilterField, at as LayeredFilterOperator, L as LayeredFilterRule, au as columnFiltersToLayeredRules, av as completeLayeredFilterRules, aw as decodeLayeredFilterRules, ax as encodeLayeredFilterRules, ay as isCompleteLayeredFilterRule, az as isLayeredFilterOperator, aA as layeredFilterMatchesValue, aB as layeredFilterNeedsValue, aC as layeredFilterRuleSummary, aD as operatorsForLayeredField } from '../types-CYkwg9jR.cjs';
2
2
  import '../content-transfer.cjs';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- export { aq as LAYERED_FILTER_OPERATORS, ar as LAYERED_FILTER_OPERATOR_LABELS, as as LayeredFilterField, at as LayeredFilterOperator, L as LayeredFilterRule, au as columnFiltersToLayeredRules, av as completeLayeredFilterRules, aw as decodeLayeredFilterRules, ax as encodeLayeredFilterRules, ay as isCompleteLayeredFilterRule, az as isLayeredFilterOperator, aA as layeredFilterMatchesValue, aB as layeredFilterNeedsValue, aC as layeredFilterRuleSummary, aD as operatorsForLayeredField } from '../types-D9JBR6ZU.js';
1
+ export { aq as LAYERED_FILTER_OPERATORS, ar as LAYERED_FILTER_OPERATOR_LABELS, as as LayeredFilterField, at as LayeredFilterOperator, L as LayeredFilterRule, au as columnFiltersToLayeredRules, av as completeLayeredFilterRules, aw as decodeLayeredFilterRules, ax as encodeLayeredFilterRules, ay as isCompleteLayeredFilterRule, az as isLayeredFilterOperator, aA as layeredFilterMatchesValue, aB as layeredFilterNeedsValue, aC as layeredFilterRuleSummary, aD as operatorsForLayeredField } from '../types-CFmCZXVn.js';
2
2
  import '../content-transfer.js';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -1,5 +1,5 @@
1
1
  import { ResolvedFilterKind } from './infer-filter.cjs';
2
- import { e as MatrxDataTableQueryState, M as MatrxColumnDef } from '../types-jQddSUnj.cjs';
2
+ import { e as MatrxDataTableQueryState, M as MatrxColumnDef } from '../types-CYkwg9jR.cjs';
3
3
  import '../content-transfer.cjs';
4
4
  import 'react';
5
5
  import '@ai-matrx/kit/content-transfer';
@@ -1,5 +1,5 @@
1
1
  import { ResolvedFilterKind } from './infer-filter.js';
2
- import { e as MatrxDataTableQueryState, M as MatrxColumnDef } from '../types-D9JBR6ZU.js';
2
+ import { e as MatrxDataTableQueryState, M as MatrxColumnDef } from '../types-CFmCZXVn.js';
3
3
  import '../content-transfer.js';
4
4
  import 'react';
5
5
  import '@ai-matrx/kit/content-transfer';
@@ -681,7 +681,7 @@ function useSpreadsheetGrid(options) {
681
681
  } catch {
682
682
  reason = void 0;
683
683
  }
684
- if (reason) refusals.push({ columnId: patch.columnId, reason });
684
+ if (reason) refusals.push({ rowId: patch.rowId, columnId: patch.columnId, reason });
685
685
  else accepted.push(patch);
686
686
  }
687
687
  return { accepted, refusals };
@@ -760,6 +760,7 @@ function useSpreadsheetGrid(options) {
760
760
  if (rowId === void 0 || columnId === void 0) continue;
761
761
  if (!current.isColumnWritable(columnId)) {
762
762
  skipped.push({
763
+ rowId,
763
764
  columnId,
764
765
  reason: current.columnRefusal?.(columnId) ?? `${columnId} cannot be cleared.`
765
766
  });
@@ -923,18 +924,33 @@ function useSpreadsheetGrid(options) {
923
924
  if (startRow === -1 || startCol === -1) return;
924
925
  const patches = [];
925
926
  const skipped = [];
926
- let outside = 0;
927
+ let pastRightEdge = 0;
928
+ const overflow = [];
927
929
  for (let r = 0; r < block.length; r += 1) {
928
930
  const line = block[r] ?? [];
931
+ const rowId = rowIds[startRow + r];
932
+ if (rowId === void 0) {
933
+ const beyond = {};
934
+ for (let c = 0; c < line.length; c += 1) {
935
+ const columnId = columnIds[startCol + c];
936
+ if (columnId === void 0) {
937
+ pastRightEdge += 1;
938
+ continue;
939
+ }
940
+ beyond[columnId] = line[c] ?? "";
941
+ }
942
+ overflow.push(beyond);
943
+ continue;
944
+ }
929
945
  for (let c = 0; c < line.length; c += 1) {
930
- const rowId = rowIds[startRow + r];
931
946
  const columnId = columnIds[startCol + c];
932
- if (rowId === void 0 || columnId === void 0) {
933
- outside += 1;
947
+ if (columnId === void 0) {
948
+ pastRightEdge += 1;
934
949
  continue;
935
950
  }
936
951
  if (!current.isColumnWritable(columnId)) {
937
952
  skipped.push({
953
+ rowId,
938
954
  columnId,
939
955
  reason: current.columnRefusal?.(columnId) ?? `${columnId} cannot take a pasted value.`
940
956
  });
@@ -944,9 +960,24 @@ function useSpreadsheetGrid(options) {
944
960
  }
945
961
  }
946
962
  const screened = screenPatches(patches);
963
+ const refusals = [...skipped, ...screened.refusals];
964
+ if (current.onPastePlan) {
965
+ const accepted = screened.accepted;
966
+ current.onPastePlan({
967
+ accepted,
968
+ refusals,
969
+ overflow,
970
+ pastRightEdge,
971
+ apply: async () => {
972
+ await applyPatches(accepted, "paste", "Pasted");
973
+ }
974
+ });
975
+ return;
976
+ }
947
977
  void applyPatches(screened.accepted, "paste", "Pasted");
978
+ const outside = pastRightEdge + overflow.reduce((n, row) => n + Object.keys(row).length, 0);
948
979
  const tail = outside > 0 ? ` ${outside} landed past the edge of the table and were ignored.` : "";
949
- announceSkips([...skipped, ...screened.refusals], `Pasted ${screened.accepted.length} cells.${tail}`);
980
+ announceSkips(refusals, `Pasted ${screened.accepted.length} cells.${tail}`);
950
981
  },
951
982
  [range, rowIds, columnIds, applyPatches, announceSkips, screenPatches]
952
983
  );