@papernote/ui 1.10.21 → 1.10.23

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.
@@ -44,6 +44,10 @@ export interface DataGridColumn {
44
44
  prefix?: string;
45
45
  suffix?: string;
46
46
  };
47
+ /** Column group identifier for visual banding (e.g., "SalesAmount" groups base column with comparison variants) */
48
+ group?: string;
49
+ /** Variant type within a group: "current", "prior", "variance", "variancePct" */
50
+ variant?: 'current' | 'prior' | 'variance' | 'variancePct';
47
51
  }
48
52
  /**
49
53
  * Sort configuration
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../src/components/DataGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAuBf;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,KAAK,EAAE,SAAS,CAAC;IACjB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB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,MAAM,IAAI,CAAC;IACpC,2BAA2B;IAC3B,aAAa,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC9C;AA8CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,QAAQ,sFAszBpB,CAAC;AAIF,eAAe,QAAQ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5690,6 +5690,10 @@ interface DataGridColumn {
5690
5690
  prefix?: string;
5691
5691
  suffix?: string;
5692
5692
  };
5693
+ /** Column group identifier for visual banding (e.g., "SalesAmount" groups base column with comparison variants) */
5694
+ group?: string;
5695
+ /** Variant type within a group: "current", "prior", "variance", "variancePct" */
5696
+ variant?: 'current' | 'prior' | 'variance' | 'variancePct';
5693
5697
  }
5694
5698
  /**
5695
5699
  * Frozen row mode options
package/dist/index.esm.js CHANGED
@@ -15037,52 +15037,44 @@ function getAugmentedNamespace(n) {
15037
15037
  * (A1, A1:C5, ...)
15038
15038
  */
15039
15039
 
15040
- var collection;
15041
- var hasRequiredCollection;
15042
-
15043
- function requireCollection () {
15044
- if (hasRequiredCollection) return collection;
15045
- hasRequiredCollection = 1;
15046
- class Collection {
15047
-
15048
- constructor(data, refs) {
15049
- if (data == null && refs == null) {
15050
- this._data = [];
15051
- this._refs = [];
15052
- } else {
15053
- if (data.length !== refs.length)
15054
- throw Error('Collection: data length should match references length.');
15055
- this._data = data;
15056
- this._refs = refs;
15057
- }
15058
- }
15040
+ let Collection$3 = class Collection {
15059
15041
 
15060
- get data() {
15061
- return this._data;
15062
- }
15042
+ constructor(data, refs) {
15043
+ if (data == null && refs == null) {
15044
+ this._data = [];
15045
+ this._refs = [];
15046
+ } else {
15047
+ if (data.length !== refs.length)
15048
+ throw Error('Collection: data length should match references length.');
15049
+ this._data = data;
15050
+ this._refs = refs;
15051
+ }
15052
+ }
15063
15053
 
15064
- get refs() {
15065
- return this._refs;
15066
- }
15054
+ get data() {
15055
+ return this._data;
15056
+ }
15067
15057
 
15068
- get length() {
15069
- return this._data.length;
15070
- }
15058
+ get refs() {
15059
+ return this._refs;
15060
+ }
15071
15061
 
15072
- /**
15073
- * Add data and references to this collection.
15074
- * @param {{}} obj - data
15075
- * @param {{}} ref - reference
15076
- */
15077
- add(obj, ref) {
15078
- this._data.push(obj);
15079
- this._refs.push(ref);
15080
- }
15081
- }
15062
+ get length() {
15063
+ return this._data.length;
15064
+ }
15082
15065
 
15083
- collection = Collection;
15084
- return collection;
15085
- }
15066
+ /**
15067
+ * Add data and references to this collection.
15068
+ * @param {{}} obj - data
15069
+ * @param {{}} ref - reference
15070
+ */
15071
+ add(obj, ref) {
15072
+ this._data.push(obj);
15073
+ this._refs.push(ref);
15074
+ }
15075
+ };
15076
+
15077
+ var collection = Collection$3;
15086
15078
 
15087
15079
  var helpers;
15088
15080
  var hasRequiredHelpers;
@@ -15091,7 +15083,7 @@ function requireHelpers () {
15091
15083
  if (hasRequiredHelpers) return helpers;
15092
15084
  hasRequiredHelpers = 1;
15093
15085
  const FormulaError = requireError();
15094
- const Collection = requireCollection();
15086
+ const Collection = collection;
15095
15087
 
15096
15088
  const Types = {
15097
15089
  NUMBER: 0,
@@ -24745,7 +24737,7 @@ var engineering = EngineeringFunctions;
24745
24737
 
24746
24738
  const FormulaError$b = requireError();
24747
24739
  const {FormulaHelpers: FormulaHelpers$8, Types: Types$6, WildCard, Address: Address$3} = requireHelpers();
24748
- const Collection$2 = requireCollection();
24740
+ const Collection$2 = collection;
24749
24741
  const H$5 = FormulaHelpers$8;
24750
24742
 
24751
24743
  const ReferenceFunctions$1 = {
@@ -36373,7 +36365,7 @@ var parsing = {
36373
36365
  const FormulaError$4 = requireError();
36374
36366
  const {Address: Address$1} = requireHelpers();
36375
36367
  const {Prefix: Prefix$1, Postfix: Postfix$1, Infix: Infix$1, Operators: Operators$1} = operators;
36376
- const Collection$1 = requireCollection();
36368
+ const Collection$1 = collection;
36377
36369
  const MAX_ROW$1 = 1048576, MAX_COLUMN$1 = 16384;
36378
36370
  const {NotAllInputParsedException} = require$$4;
36379
36371
 
@@ -37135,7 +37127,7 @@ var hooks$1 = {
37135
37127
  const FormulaError$2 = requireError();
37136
37128
  const {FormulaHelpers: FormulaHelpers$1, Types, Address} = requireHelpers();
37137
37129
  const {Prefix, Postfix, Infix, Operators} = operators;
37138
- const Collection = requireCollection();
37130
+ const Collection = collection;
37139
37131
  const MAX_ROW = 1048576, MAX_COLUMN = 16384;
37140
37132
 
37141
37133
  let Utils$1 = class Utils {
@@ -39054,6 +39046,30 @@ const colIndexToLetter = (index) => {
39054
39046
  };
39055
39047
  // Note: parseRef is available for future formula reference parsing
39056
39048
  // const parseRef = (ref: string): { row: number; col: number } | null => { ... }
39049
+ /**
39050
+ * Color banding for column groups (e.g., comparison columns)
39051
+ * Alternates between color sets to visually distinguish groups
39052
+ */
39053
+ const COLUMN_GROUP_COLORS = [
39054
+ { header: 'bg-sky-100', cell: 'bg-sky-50', cellAlt: 'bg-sky-100/50' },
39055
+ { header: 'bg-amber-100', cell: 'bg-amber-50', cellAlt: 'bg-amber-100/50' },
39056
+ { header: 'bg-emerald-100', cell: 'bg-emerald-50', cellAlt: 'bg-emerald-100/50' },
39057
+ { header: 'bg-pink-100', cell: 'bg-pink-50', cellAlt: 'bg-pink-100/50' },
39058
+ ];
39059
+ /**
39060
+ * Build a map of group names to color indices for column banding
39061
+ */
39062
+ const buildGroupColorMap = (columns) => {
39063
+ const groupColorMap = new Map();
39064
+ let colorIndex = 0;
39065
+ for (const col of columns) {
39066
+ if (col.group && !groupColorMap.has(col.group)) {
39067
+ groupColorMap.set(col.group, colorIndex % COLUMN_GROUP_COLORS.length);
39068
+ colorIndex++;
39069
+ }
39070
+ }
39071
+ return groupColorMap;
39072
+ };
39057
39073
  /**
39058
39074
  * DataGrid - Excel-like data grid component with formulas
39059
39075
  *
@@ -39123,6 +39139,34 @@ const DataGrid = forwardRef(({ data: initialData, columns, onChange, rowHeaders
39123
39139
  return frozenRowsState;
39124
39140
  return 0;
39125
39141
  }, [frozenRowsState, selectedCell]);
39142
+ // Build group color map for column banding
39143
+ const groupColorMap = useMemo(() => buildGroupColorMap(columns), [columns]);
39144
+ // Get header background class for a column (considers group banding)
39145
+ const getHeaderBgClass = useCallback((column) => {
39146
+ if (column.group) {
39147
+ const colorIdx = groupColorMap.get(column.group);
39148
+ if (colorIdx !== undefined) {
39149
+ return COLUMN_GROUP_COLORS[colorIdx].header;
39150
+ }
39151
+ }
39152
+ return 'bg-stone-100';
39153
+ }, [groupColorMap]);
39154
+ // Get cell background class for a column (considers group banding and zebra)
39155
+ const getCellBgClass = useCallback((column, isZebra, isFrozenCol) => {
39156
+ if (column.group) {
39157
+ const colorIdx = groupColorMap.get(column.group);
39158
+ if (colorIdx !== undefined) {
39159
+ const colors = COLUMN_GROUP_COLORS[colorIdx];
39160
+ return isZebra ? colors.cellAlt : colors.cell;
39161
+ }
39162
+ }
39163
+ // Default behavior
39164
+ if (isZebra && isFrozenCol)
39165
+ return 'bg-paper-50';
39166
+ if (isFrozenCol)
39167
+ return 'bg-white';
39168
+ return '';
39169
+ }, [groupColorMap]);
39126
39170
  // Check if a specific row is frozen
39127
39171
  const isRowFrozen = useCallback((rowIndex) => {
39128
39172
  if (frozenRowsState === 'none')
@@ -39497,7 +39541,8 @@ const DataGrid = forwardRef(({ data: initialData, columns, onChange, rowHeaders
39497
39541
  }) })), jsx("div", { ref: tableRef, className: "relative overflow-auto border border-stone-200 rounded-lg bg-white", style: { height }, onKeyDown: handleKeyDown, tabIndex: 0, children: jsxs("table", { className: "border-collapse", style: { tableLayout: 'auto' }, children: [jsx("thead", { className: "sticky top-0 z-20 bg-stone-100", children: jsxs("tr", { children: [rowHeaders && (jsx("th", { className: `${cellPadding} border-b border-r border-stone-200 bg-stone-100 text-left font-semibold text-ink-600 sticky left-0 z-30`, style: { width: 50, minWidth: 50, maxWidth: 50 }, children: "#" })), columns.map((column, colIndex) => {
39498
39542
  const isFrozen = colIndex < frozenColumns;
39499
39543
  const leftOffset = rowHeaders ? 50 + columns.slice(0, colIndex).reduce((sum, c) => sum + (c.width || 100), 0) : columns.slice(0, colIndex).reduce((sum, c) => sum + (c.width || 100), 0);
39500
- return (jsx("th", { className: `${cellPadding} border-b border-r border-stone-200 bg-stone-100 font-semibold text-ink-600 text-${column.align || 'left'} ${isFrozen ? 'sticky z-30' : ''}`, style: {
39544
+ const headerBgClass = getHeaderBgClass(column);
39545
+ return (jsx("th", { className: `${cellPadding} border-b border-r border-stone-200 ${headerBgClass} font-semibold text-ink-600 text-${column.align || 'left'} ${isFrozen ? 'sticky z-30' : ''}`, style: {
39501
39546
  width: column.width,
39502
39547
  minWidth: column.minWidth || 80,
39503
39548
  left: isFrozen ? leftOffset : undefined,
@@ -39523,7 +39568,8 @@ const DataGrid = forwardRef(({ data: initialData, columns, onChange, rowHeaders
39523
39568
  const leftOffset = rowHeaders
39524
39569
  ? 50 + columns.slice(0, colIndex).reduce((sum, c) => sum + (c.width || 100), 0)
39525
39570
  : columns.slice(0, colIndex).reduce((sum, c) => sum + (c.width || 100), 0);
39526
- return (jsx("td", { className: `${cellPadding} border-b border-r border-stone-200 text-${column?.align || 'left'} ${isFrozenCol ? 'sticky z-10' : ''} ${isZebra && isFrozenCol ? 'bg-paper-50' : isFrozenCol ? 'bg-white' : ''} ${isSelected ? 'ring-2 ring-inset ring-primary-500' : ''} ${hasFormula ? 'bg-blue-50' : ''} ${cell?.className || ''}`, style: {
39571
+ const cellBgClass = getCellBgClass(column, isZebra, isFrozenCol);
39572
+ return (jsx("td", { className: `${cellPadding} border-b border-r border-stone-200 text-${column?.align || 'left'} ${isFrozenCol ? 'sticky z-10' : ''} ${cellBgClass} ${isSelected ? 'ring-2 ring-inset ring-primary-500' : ''} ${hasFormula ? 'bg-blue-50' : ''} ${cell?.className || ''}`, style: {
39527
39573
  left: isFrozenCol ? leftOffset : undefined,
39528
39574
  minWidth: column?.minWidth || 80,
39529
39575
  }, onClick: () => handleCellClick(rowIndex, colIndex), onDoubleClick: (e) => handleCellDoubleClick(rowIndex, colIndex, e.currentTarget), children: isEditing ? (formulas ? (jsx(FormulaAutocomplete, { value: editValue, onChange: setEditValue, onComplete: handleEditComplete, onCancel: handleEditCancel, anchorRect: editingCellRect, autoFocus: true })) : (jsx("input", { ref: inputRef, type: "text", value: editValue, onChange: (e) => setEditValue(e.target.value), onBlur: handleEditComplete, onKeyDown: handleEditKeyDown, className: "w-full h-full border-none outline-none bg-transparent", style: { margin: '-4px', padding: '4px' } }))) : (formatValue(cell?.value, column)) }, colIndex));