canvas-datagrid 0.25.3 → 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/lib/defaults.js CHANGED
@@ -6,6 +6,7 @@ export default function (self) {
6
6
  self.defaults = {
7
7
  attributes: [
8
8
  ['allowColumnReordering', true],
9
+ ['allowColumnSelection', true],
9
10
  ['allowColumnResize', true],
10
11
  ['allowColumnResizeFromCell', false],
11
12
  ['allowFreezingRows', false],
@@ -16,12 +17,22 @@ export default function (self) {
16
17
  ['allowRowResize', true],
17
18
  ['allowRowResizeFromCell', false],
18
19
  ['allowSorting', true],
20
+ ['allowGroupingRows', true],
21
+ ['allowGroupingColumns', true],
22
+ ['allowGridExpandOnPaste', false],
23
+ ['animationDurationShowContextMenu', 50],
24
+ ['animationDurationHideContextMenu', 50],
19
25
  ['autoGenerateSchema', false],
26
+ ['fillLastColumn', false],
20
27
  ['autoResizeColumns', false],
21
28
  ['autoResizeRows', false],
29
+ ['autoScrollOnMousemove', false],
30
+ ['autoScrollMargin', 5],
31
+ ['allowShrinkingSelection', false],
22
32
  ['blanksText', '(Blanks)'],
23
33
  ['borderDragBehavior', 'none'],
24
34
  ['borderResizeZone', 10],
35
+ ['clearCellsWhenShrinkingSelection', false],
25
36
  ['clearSettingsOptionText', 'Clear saved settings'],
26
37
  ['columnHeaderClickBehavior', 'sort'],
27
38
  ['columnSelectorHiddenText', '   '],
@@ -36,8 +47,15 @@ export default function (self) {
36
47
  ['ellipsisText', '...'],
37
48
  ['filterOptionText', 'Filter %s'],
38
49
  ['filterTextPrefix', '(filtered) '],
50
+ ['filterFrozenRows', true],
39
51
  ['globalRowResize', false],
40
52
  ['hideColumnText', 'Hide %s'],
53
+ ['showUnhideColumnsIndicator', false],
54
+ ['showUnhideRowsIndicator', false],
55
+ ['showHideRow', 'Hide row %s'],
56
+ ['showHideRows', 'Hide rows %s'],
57
+ ['hoverMode', 'cell'],
58
+ ['keepFocusOnMouseOut', false],
41
59
  ['maxAutoCompleteItems', 200],
42
60
  ['multiLine', false],
43
61
  ['name', ''],
@@ -46,8 +64,10 @@ export default function (self) {
46
64
  ['persistantSelectionMode', false],
47
65
  ['removeFilterOptionText', 'Remove filter on %s'],
48
66
  ['reorderDeadZone', 3],
67
+ ['resizeAfterDragged', false],
49
68
  ['resizeScrollZone', 20],
50
69
  ['rowGrabZoneSize', 5],
70
+ ['columnGrabZoneSize', 30],
51
71
  ['saveAppearance', true],
52
72
  ['scrollAnimationPPSThreshold', 0.75],
53
73
  ['scrollPointerLock', false],
@@ -62,16 +82,33 @@ export default function (self) {
62
82
  ['showColumnSelector', true],
63
83
  ['showCopy', false],
64
84
  ['showFilter', true],
85
+ ['showFilterInCell', false],
65
86
  ['showNewRow', false],
66
87
  ['showOrderByOption', true],
67
88
  ['showOrderByOptionTextAsc', 'Order by %s ascending'],
68
89
  ['showOrderByOptionTextDesc', 'Order by %s descending'],
90
+ //#region grouping
91
+ ['showGroupColumns', 'Group columns %s'],
92
+ ['showGroupRows', 'Group rows %s'],
93
+ ['showRemoveGroupColumns', 'Remove group %s'],
94
+ ['showRemoveGroupRows', 'Remove group %s'],
95
+ ['showRemoveAllGroupColumns', 'Remove all column groups'],
96
+ ['showRemoveAllGroupRows', 'Remove all row groups'],
97
+ ['showExpandAllGroupColumns', 'Expand all column groups'],
98
+ ['showExpandAllGroupRows', 'Expand all row groups'],
99
+ ['showCollapseAllGroupColumns', 'Collapse all column groups'],
100
+ ['showCollapseAllGroupRows', 'Collapse all row groups'],
101
+ ['columnGroupIndicatorPosition', 'right'],
102
+ ['rowGroupIndicatorPosition', 'bottom'],
103
+ //#endregion grouping
69
104
  ['showPaste', false],
70
105
  ['showPerformance', false],
71
106
  ['showRowHeaders', true],
72
107
  ['showRowNumbers', true],
108
+ ['showRowNumberGaps', true],
73
109
  ['singleSelectionMode', false],
74
110
  ['snapToRow', false],
111
+ ['sortFrozenRows', true],
75
112
  ['touchContextMenuTimeMs', 800],
76
113
  ['touchDeadZone', 3],
77
114
  ['touchEasingMethod', 'easeOutQuad'],
@@ -83,8 +120,14 @@ export default function (self) {
83
120
  ['touchZoomMin', 0.5],
84
121
  ['touchZoomMax', 1.75],
85
122
  ['maxPixelRatio', 2],
123
+ ['maxCanvasSize', 16384],
86
124
  ['tree', false],
87
125
  ['treeHorizontalScroll', false],
126
+ ['rowTree', []],
127
+ ['rowTreeColIndex', 0],
128
+ ['columnTree', []],
129
+ ['columnTreeRowStartIndex', 0],
130
+ ['columnTreeRowEndIndex', 0],
88
131
  ],
89
132
  styles: [
90
133
  ['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'],
@@ -111,6 +154,16 @@ export default function (self) {
111
154
  ['autocompleteBottomMargin', 60],
112
155
  ['autosizeHeaderCellPadding', 8],
113
156
  ['autosizePadding', 5],
157
+ ['buttonActiveBackgroundColor', 'rgba(255, 255, 255, 1)'],
158
+ ['buttonActiveBorderColor', 'rgba(110, 168, 255, 1)'],
159
+ ['buttonArrowColor', 'rgba(50, 50, 50, 1)'],
160
+ ['buttonArrowDownHTML', '▼'],
161
+ ['buttonZIndex', 10000],
162
+ ['buttonBackgroundColor', 'rgba(255, 255, 255, 1)'],
163
+ ['buttonBorderColor', 'rgba(172, 172, 172, 1)'],
164
+ ['buttonHoverBackgroundColor', 'rgba(240, 240, 240, 1)'],
165
+ ['buttonMenuWindowMargin', 30],
166
+ ['buttonPadding', '3px'],
114
167
  ['cellAutoResizePadding', 13],
115
168
  ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'],
116
169
  ['cellBorderColor', 'rgba(195, 199, 202, 1)'],
@@ -129,6 +182,15 @@ export default function (self) {
129
182
  ['cellPaddingTop', 5],
130
183
  ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'],
131
184
  ['cellSelectedColor', 'rgba(0, 0, 0, 1)'],
185
+ ['cellTreeIconBorderColor', 'rgba(162, 174, 207, 1)'],
186
+ ['cellTreeIconFillColor', 'rgba(240, 240, 240, 1)'],
187
+ ['cellTreeIconHoverFillColor', 'rgba(198, 217, 233, 1)'],
188
+ ['cellTreeIconLineColor', 'rgba(43, 53, 81, 1)'],
189
+ ['cellTreeIconLineWidth', 1.5],
190
+ ['cellTreeIconMarginLeft', 0],
191
+ ['cellTreeIconMarginRight', 5],
192
+ ['cellTreeIconMarginTop', 6],
193
+ ['cellTreeIconWidth', 13],
132
194
  ['cellVerticalAlignment', 'center'],
133
195
  ['cellWidth', 250],
134
196
  ['cellWidthWithChildGrid', 250],
@@ -139,6 +201,7 @@ export default function (self) {
139
201
  ['childContextMenuArrowHTML', '►'],
140
202
  ['childContextMenuMarginLeft', -11],
141
203
  ['childContextMenuMarginTop', -6],
204
+ ['columnGroupRowHeight', 25],
142
205
  ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],
143
206
  ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'],
144
207
  ['columnHeaderCellBorderWidth', 1],
@@ -225,18 +288,37 @@ export default function (self) {
225
288
  ['editCellFontSize', '16px'],
226
289
  ['editCellPaddingLeft', 4],
227
290
  ['editCellZIndex', 10000],
228
- ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'],
229
- ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'],
230
- ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'],
231
- ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'],
232
- ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'],
233
- ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'],
291
+ ['filterButtonActiveBackgroundColor', 'rgba(225, 225, 225, 1)'],
292
+ ['filterButtonArrowBorderColor', 'rgba(195, 199, 202, 1)'],
293
+ ['filterButtonArrowBorderWidth', 1],
294
+ ['filterButtonArrowClickRadius', 5],
295
+ ['filterButtonArrowColor', 'rgba(50, 50, 50, 1)'],
296
+ ['filterButtonArrowHeight', 5],
297
+ ['filterButtonArrowWidth', 8],
298
+ ['filterButtonBackgroundColor', 'rgba(240, 240, 240, 1)'],
299
+ ['filterButtonBorderColor', 'rgba(172, 172, 172, 1)'],
300
+ ['filterButtonBorderRadius', 3],
301
+ ['filterButtonHeight', 20],
302
+ ['filterButtonHoverBackgroundColor', 'rgba(235, 235, 235, 1)'],
303
+ ['filterButtonMenuOffsetTop', 10],
304
+ ['filterButtonWidth', 20],
305
+ ['frozenMarkerHoverColor', 'rgba(165, 198, 254, 1)'],
306
+ ['frozenMarkerHoverBorderColor', 'rgba(165, 198, 254, 1)'],
307
+ ['frozenMarkerActiveColor', 'rgba(165, 198, 254, 0.2)'],
308
+ ['frozenMarkerActiveBorderColor', 'rgba(165, 198, 254, 0.5)'],
309
+ ['frozenMarkerActiveHeaderColor', 'rgba(165, 198, 254, 1)'],
310
+ ['frozenMarkerColor', 'rgba(221, 221, 221, 1)'],
311
+ ['frozenMarkerBorderColor', 'rgba(221, 221, 221, 1)'],
234
312
  ['frozenMarkerBorderWidth', 1],
235
- ['frozenMarkerWidth', 2],
313
+ ['frozenMarkerHeaderColor', 'rgba(188, 188, 188, 1)'],
314
+ ['frozenMarkerWidth', 4],
315
+ ['groupingAreaBackgroundColor', 'rgba(240, 240, 240, 1)'],
236
316
  ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'],
237
317
  ['gridBorderCollapse', 'collapse'],
238
318
  ['gridBorderColor', 'rgba(202, 202, 202, 1)'],
239
319
  ['gridBorderWidth', 1],
320
+ ['groupIndicatorColor', 'rgba(155, 155, 155, 1)'],
321
+ ['groupIndicatorBackgroundColor', 'rgba(255, 255, 255, 1)'],
240
322
  ['height', 'auto'],
241
323
  ['maxHeight', 'inherit'],
242
324
  ['maxWidth', 'inherit'],
@@ -259,6 +341,9 @@ export default function (self) {
259
341
  ['reorderMarkerBorderWidth', 1.25],
260
342
  ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'],
261
343
  ['reorderMarkerIndexBorderWidth', 2.75],
344
+ ['resizeMarkerColor', 'rgba(0, 0, 0, 0.2)'],
345
+ ['resizeMarkerSize', 2],
346
+ ['rowGroupColumnWidth', 25],
262
347
  ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'],
263
348
  ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'],
264
349
  ['rowHeaderCellBorderWidth', 1],
@@ -272,6 +357,8 @@ export default function (self) {
272
357
  ['rowHeaderCellPaddingLeft', 5],
273
358
  ['rowHeaderCellPaddingRight', 5],
274
359
  ['rowHeaderCellPaddingTop', 5],
360
+ ['rowHeaderCellRowNumberGapHeight', 5],
361
+ ['rowHeaderCellRowNumberGapColor', 'rgba(50, 50, 50, 1)'],
275
362
  ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'],
276
363
  ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'],
277
364
  ['rowHeaderCellVerticalAlignment', 'center'],
@@ -293,6 +380,8 @@ export default function (self) {
293
380
  ['selectionHandleColor', 'rgba(66, 133, 244, 1)'],
294
381
  ['selectionHandleSize', 8],
295
382
  ['selectionHandleType', 'square'],
383
+ ['fillOverlayBorderColor', 'rgba(127, 127, 127, 1)'],
384
+ ['fillOverlayBorderWidth', 2],
296
385
  ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'],
297
386
  ['selectionOverlayBorderWidth', 1],
298
387
  ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'],
@@ -305,6 +394,10 @@ export default function (self) {
305
394
  ['treeArrowMarginTop', 6],
306
395
  ['treeArrowWidth', 13],
307
396
  ['treeGridHeight', 250],
397
+ ['unhideIndicatorColor', 'rgba(0, 0, 0, 1)'],
398
+ ['unhideIndicatorBackgroundColor', 'rgba(255, 255, 255, 1)'],
399
+ ['unhideIndicatorBorderColor', 'rgba(174, 193, 232, 1)'],
400
+ ['unhideIndicatorSize', 16],
308
401
  ['width', 'auto'],
309
402
  ],
310
403
  };
package/lib/docs.js CHANGED
@@ -14,7 +14,7 @@
14
14
  * @param {HTMLElement} args.parentNode HTML element that will hold the grid. This block element must have a height, canvas-datagrid will add a canvas itself and will match itself to this element's dimensions. It will resize itself on window.resize events, and DOM mutation. But you may need to invoke canvas-datagrid.resize() manually if you find it does not maintain size in your use case. When using the non web component the parentNode can be a canvas.
15
15
  * @param {string} [args.name] Optional value that will allow the saving of column height, row width, etc. to the browser's local store. This name should be unique to this grid.
16
16
  * @param {boolean} [args.tree=false] - When true, an arrow will be drawn on each row that when clicked raises the See {@link canvasDatagrid#event:expandtree} event for that row and creates an inner grid. See {@link tutorial--Allow-users-to-open-trees}.
17
- * @param {boolean} [args.treeHorizontalScroll=false] - When true, expanded child grids will scroll horizontally with the parent columns. When false, when scrolling horizontally child grids will remain stationary. This does not impact vertical scrolling behavior.
17
+ * @param {boolean} [args.treeHorizontalScroll=false] - Reserved. Intended to make expanded child grids scroll horizontally with the parent columns; the option is accepted but not implemented yet (see issue #314), child grids always stay stationary.
18
18
  * @param {object} [args.cellGridAttributes] - Attributes used for cell grids. These child grids are different than the tree grids. See the {@link canvasDatagrid.data} property for more information about cell grids.
19
19
  * @param {object} [args.treeGridAttributes] - Attributes used for tree grids. These child grids are different than the cell grids. See the {@link canvasDatagrid.data} property for more information about tree grids.
20
20
  * @param {boolean} [args.showNewRow=true] - When true, a row will appear at the bottom of the data set. schema[].defaultValue will define a default value for each cell. defaultValue can be a string or a function. When a function is used, the arguments header and index will be passed to the function. The value returned by the function will be the value in the new cell. See {@link canvasDatagrid.header.defaultValue}
@@ -25,20 +25,33 @@
25
25
  * @param {boolean} [args.editable=true] - When true, cells can be edited. When false, grid is read only to the user.
26
26
  * @param {string} [args.borderDragBehavior='none'] - Can be set to 'resize', 'move', or 'none'. If set to 'move', `allowMovingSelection` should also be set true. If set to 'resize', `allowRowResizeFromCell` and/or `allowColumnResizeFromCell` should be set true.
27
27
  * @param {boolean} [args.autoGenerateSchema=false] - When true, every time data is set the schema will be automatically generated from the data overwriting any existing schema.
28
+ * @param {boolean} [args.autoScrollOnMousemove=false] - Only trigger auto scrolling when mouse moves in horizontal or vertical direction.
29
+ * @param {number} [args.autoScrollMargin=5] - Number of pixels of mouse movement to trigger auto scroll.
28
30
  * @param {boolean} [args.allowFreezingRows=false] - When true, the UI provides a drag-able cutter to freeze rows.
29
31
  * @param {boolean} [args.allowFreezingColumns=false] - When true, the UI provides a drag-able cutter to freeze columns.
32
+ * @param {boolean} [args.allowShrinkingSelection=false] - When true, this allows users to shrink the selection by dragging and dropping the handle inwards, similar to Excel. (Not supported yet.)
33
+ * @param {boolean} [args.clearCellsWhenShrinkingSelection=false] - When true, this allows the clearing of the previously selected cells after the handle is moved inwards. (Not supported yet.)
34
+ * @param {boolean} [args.filterFrozenRows=true] - When false, rows on and above {@link canvasDatagrid#property:frozenRow}` will be ignored by filters when {@link canvasDatagrid#param:allowFreezingRows} is true.
35
+ * @param {boolean} [args.sortFrozenRows=true] - When false, rows on and above {@link canvasDatagrid#property:frozenRow}` will be ignored by sorters when {@link canvasDatagrid#param:allowSorting} is true.
30
36
  * @param {boolean} [args.allowColumnReordering=true] - When true columns can be reordered.
31
37
  * @param {boolean} [args.allowMovingSelection=false] - When true selected data can be moved by clicking and dragging on the border of the selection.
32
38
  * @param {boolean} [args.allowRowReordering=false] - When true rows can be reordered.
33
39
  * @param {string} [args.blanksText=(Blanks)] - The text that appears on the context menu for filtering blank values (i.e. `undefined`, `null`, `''`).
34
40
  * @param {string} [args.ellipsisText=...] - The text used as ellipsis text on truncated values.
35
41
  * @param {boolean} [args.allowSorting=true] - Allow user to sort rows by clicking on column headers.
42
+ * @param {boolean} [args.allowColumnSelection=true] - When false, clicking or touching a column header never selects (highlights) the column, so with `columnHeaderClickBehavior: 'sort'` an existing row selection survives sorting. Columns can still be selected through the API.
43
+ * @param {boolean} [args.allowGridExpandOnPaste=false] - Allow adding new rows and columns if pasted data dimensions are bigger than existing grid dimensions.
44
+ * @param {boolean} [args.allowGroupingColumns=true] - Allow user to group columns by clicking on column headers.
45
+ * @param {boolean} [args.allowGroupingRows=true] - Allow user to group rows by clicking on rows headers.
36
46
  * @param {boolean} [args.showFilter=true] - When true, filter will be an option in the context menu.
37
47
  * @param {number} [args.pageUpDownOverlap=1] - Amount of rows to overlap when pageup/pagedown is used.
38
48
  * @param {boolean} [args.persistantSelectionMode=false] - When true, selections will behave as if the command/control key is held down at all times. Conflicts with singleSelectionMode.
39
49
  * @param {boolean} [args.singleSelectionMode=false] - When true, selections will ignore the command/control key. Conflicts with persistantSelectionMode.
50
+ * @param {boolean} [args.keepFocusOnMouseOut=false] - When true, grid will continue to handle keydown events when mouse is outside of the grid.
40
51
  * @param {string} [args.selectionMode='cell'] - Can be 'cell', or 'row'. This setting dictates what will be selected when the user clicks a cell. The cell, or the entire row respectively.
52
+ * @param {string} [args.hoverMode='cell'] - Can be 'cell', or 'row'. This setting dictates whether to highlight either the individual cell, or the entire row when hovering over a cell.
41
53
  * @param {boolean} [args.autoResizeColumns=false] - When true, all columns will be automatically resized to fit the data in them. Warning! Expensive for large (>100k ~2 seconds) datasets.
54
+ * @param {boolean} [args.fillLastColumn=false] - When true, the last visible column expands to the right edge of the grid when the columns do not fill its width. The outer edge of that column cannot be resized.
42
55
  * @param {boolean} [args.autoResizeRows=false] - When true, rows will be automatically resized to fit the data in them if text-wrapping is enabled.
43
56
  * @param {boolean} [args.allowRowHeaderResize=true] - When true, the user can resize the width of the row headers.
44
57
  * @param {boolean} [args.allowColumnResize=true] - When true, the user can resize the width of the columns.
@@ -50,14 +63,29 @@
50
63
  * @param {number} [args.borderResizeZone=10] - Number of pixels in total around a border that count as resize zones.
51
64
  * @param {boolean} [args.showColumnHeaders=true] - When true, headers are shown.
52
65
  * @param {boolean} [args.showRowNumbers=true] - When true, row numbers are shown in the row headers.
66
+ * @param {boolean} [args.showRowNumberGaps=true] - When true, gaps between row numbers due to filtering are shown in the row headers using a colored bar.
53
67
  * @param {boolean} [args.showRowHeaders=true] - When true, row headers are shown.
54
68
  * @param {number} [args.reorderDeadZone=3] - Number of pixels needed to move before column reordering occurs.
69
+ * @param {number} [args.selectionScrollZone=20] - Number of pixels to auto scroll in in horizontal or vertical direction.
55
70
  * @param {boolean} [args.showClearSettingsOption=true] - Show an option on the context menu to clear saved settings.
56
71
  * @param {string} [args.clearSettingsOptionText='Clear saved settings'] - Text that appears on the clear settings option.
57
72
  * @param {string} [args.showOrderByOptionTextDesc='Order by %s ascending'] - Text that appears on the order by descending option.
58
73
  * @param {string} [args.showOrderByOptionTextAsc='Order by %s desc'] - Text that appears on the order by ascending option.
74
+ * @param {string} [args.showGroupColumns='Group columns %s'] - Text that appears on the group columns option.
75
+ * @param {string} [args.showGroupRows='Group row %s'] - Text that appears on the group rows option.
76
+ * @param {string} [args.showRemoveGroupColumns='Remove group %s'] - Text that appears on the remove columns group option.
77
+ * @param {string} [args.showRemoveGroupRows='Remove group %s'] - Text that appears on the remove rows group option.
78
+ * @param {string} [args.showRemoveAllGroupColumns='Remove all column groups'] - Text that appears on the remove all column groups option.
79
+ * @param {string} [args.showRemoveAllGroupRows='Remove all row groups'] - Text that appears on the remove all row groups option.
80
+ * @param {string} [args.showExpandAllGroupColumns='Expand all column groups'] - Text that appears on the expand all column groups option.
81
+ * @param {string} [args.showExpandAllGroupRows='Expand all row groups'] - Text that appears on the expand all row groups option.
82
+ * @param {string} [args.showCollapseAllGroupColumns='Collapse all column groups'] - Text that appears on the collapsed all column groups option.
83
+ * @param {string} [args.showCollapseAllGroupRows='Collapse all row groups'] - Text that appears on the collapsed all row groups option.
84
+ * @param {string} [args.columnGroupIndicatorPosition='right'] - The position of the column group inidcator(icon), available values: 'left' and 'right'.
85
+ * @param {string} [args.rowGroupIndicatorPosition='bottom'] - Ths position of the row group indicator(icon), available values: 'top' and 'bottom'.
59
86
  * @param {boolean} [args.showOrderByOption=true] - Show an option on the context menu sort rows.
60
87
  * @param {boolean} [args.showPaste=false] - Show the paste option in the context menu when applicable.
88
+ * @param {boolean} [args.resizeAfterDragged] - Resize after the handle is dropped, similar to Excel.
61
89
  * @param {array} [args.schema=[]] - Sets the schema. See {@link canvasDatagrid.schema}.
62
90
  * @param {array} [args.data=[]] - Sets the data. See {@link canvasDatagrid.data}.
63
91
  * @param {number} [args.touchReleaseAnimationDurationMs=2000] - How long the ease animation runs after touch release.
@@ -69,7 +97,7 @@
69
97
  * @param {string} [args.copyText=Copy] - The text that appears on the context menu when copy is available.
70
98
  * @param {string} [args.columnHeaderClickBehavior=sort] - Can be any of sort, select, none. When sort is selected, left clicking a column header will result in sorting ascending, then sorting descending if already sorted by this column. If select is selected then clicking a column header will result in the column becoming selected. Holding control/command or shift will select multiple columns in this mode.
71
99
  * @param {boolean} [args.scrollPointerLock=false] - When true, clicking on the scroll box to scroll will cause the mouse cursor to disappear to prevent it from exiting the area observable to the grid.
72
- * @param {string} [args.selectionHandleBehavior='none'] - When set to a value other than none a handle will appear in the lower right corner of the desktop version of the grid. It does nothing but will be used in a future version of the grid.
100
+ * @param {string} [args.selectionHandleBehavior='none'] - When set to a value other than none, a handle will appear in the lower right corner of the desktop version of the grid.
73
101
  * @param {string} [args.columnSelectorVisibleText='  &nbsp '] - When a column is hidden, this is the value to the left of the title in the column selector content menu.
74
102
  * @param {string} [args.columnSelectorHiddenText='\u2713'] - When a column is visible, this is the value to the left of the title in the column selector content menu.
75
103
  * @param {string} [args.columnSelectorText='Add/remove columns'] - The text of the column selector context menu.
@@ -84,6 +112,8 @@
84
112
  * @param {number} [args.touchZoomMin=0.5] - The minimum zoom scale.
85
113
  * @param {number} [args.touchZoomMax=1.75] - The maximum zoom scale.
86
114
  * @param {number} [args.maxPixelRatio=1.5] - The maximum pixel ratio for high DPI displays. High DPI displays can cause sluggish performance, this caps resolution the grid is rendered at. Standard resolution (e.g.: 1920x1080) have a pixel ratio of 1:1 while higher resolution displays can be higher (e.g.: Retina display 2:1). Higher numbers are sharper (higher resolution) up to the max of your display (usually 2), lower numbers are lower resolution, down to 1. It might be fun to set a value lower than 1, I've never done it.
115
+ * @param {number} [args.maxCanvasSize=16384] - Largest width or height, in CSS pixels, an auto-sized grid (`style.width`/`style.height` set to `auto`) may grow to. Browsers cannot paint larger canvases. Past this size the grid stops growing and shows a scroll bar for the rest of the data.
116
+ * @param {object} [args.fillCellCallback] - The callback function that is called when a cell is filled.
87
117
  * @param {canvasDatagrid.style} [args.style={}] - Sets selected values in style.
88
118
  * @param {canvasDatagrid.filter} [args.filters={}] - Sets selected values in filters. See {@link canvasDatagrid.filters}.
89
119
  * @param {canvasDatagrid.sorter} [args.sorters={}] - Sets selected values in sorters. See {@link canvasDatagrid.sorters}.
@@ -108,6 +138,7 @@
108
138
  * @property {canvasDatagrid.formatter} formatters - Object that contains formatting functions for displaying text. The properties in this object match the `schema[].type` property. For example, if the schema for a given column was of the type `date` the grid would look for a formatter called `formatters.date` if a formatter cannot be found for a given data type a warning will be logged and the string formatter will be used. Formatters must return a string value to be displayed in the cell. See {@link canvasDatagrid.formatters}.
109
139
  * @property {canvasDatagrid.sorter} sorters - Object that contains a list of sorting functions for sorting columns. See {@tutorial sorters}.
110
140
  * @property {canvasDatagrid.filter} filters - Object that contains a list of filters for filtering data. The properties in this object match the `schema[].type` property. For example, if the schema for a given column was of the type `date` the grid would look for a filter called `filters.date` if a filter cannot be found for a given data type a warning will be logged and the string/RegExp filter will be used. See {@link canvasDatagrid.filters}.
141
+ * @property {boolean} hasActiveFilters - When true, grid data is being filtered.
111
142
  * @property {canvasDatagrid.data} data - This is how data is set in the grid. Data must be an array of objects that conform to a schema. Data values can be any primitive type. However if a cell value is another data array, an inner grid will be rendered into the cell. This "cell grid" is different than a "tree grid" (the sort you drill in with a row header arrow) and uses the `cellGridAttributes` attribute for properties and styling. See {@link canvasDatagrid.data}.
112
143
  * @property {canvasDatagrid.schema} schema - Schema is optional. Schema is an array of {canvasDatagrid.header} objects. If no schema is provided one will be generated from the data, in that case all data will be assumed to be string data. See {@link canvasDatagrid.schema}.
113
144
  * @property {number} scrollHeight - The total number of pixels that can be scrolled down.
@@ -124,7 +155,7 @@
124
155
  * @property {HTMLElement} shadowRoot - The shadow root element.
125
156
  * @property {array} rowOrder - Gets or sets the order of the rows. This allows you to modify the appearance of the data without modifying the data itself. The order of the array dictates the order of the rows, e.g.: [0, 1, 2] is normal order, [2, 1, 0] is reverse. The array length must be equal to or greater than the number of rows.
126
157
  * @property {array} columnOrder - Gets or sets the order of the columns. This allows you to modify the appearance of the schema without modifying the data itself. The order of the array dictates the order of the columns, e.g.: [0, 1, 2] is normal order, [2, 1, 0] is reverse. The array length must be equal to or greater than the number of columns.
127
- * @property {object} activeCell - Gets the active cell. Consists of the properties rowIndex and columnIndex.
158
+ * @property {object} activeCell - Gets the active cell as `{rowIndex, columnIndex}` (view indexes). The active cell is the one that receives keyboard input and edits and is drawn with the `activeCell*` styles. It is independent of the selection: keyboard navigation moves it, `selectNone()` keeps it, and a range selection has exactly one active cell (the one the drag started from). Move it with `setActiveCell(columnIndex, rowIndex)` and listen to `activecellchanged` to follow it.
128
159
  * @property {boolean} hasFocus - When true, the grid is has focus.
129
160
  * @property {array} visibleRowHeights - The heights of the visible rows.
130
161
  * @property {boolean} isChildGrid - When true, this grid is within another grid.
@@ -233,6 +264,32 @@
233
264
  * @property {object} text.width - The width of the text, including truncation and ellipsis.
234
265
  * @property {object} text.value - The value of the text, including truncation and ellipsis.
235
266
  */
267
+ /**
268
+ * The additional function to invoke when a cell is filled. The return value of this
269
+ * function sets the new data of the cell.
270
+ * @function
271
+ * @name canvasDataGrid.fillCellCallback
272
+ * @param {object} args - Arguments that are passed to the function.
273
+ * @param {array} args.rows - Data that is being filled into all the cells, including this one.
274
+ * @param {string} args.direction - Direction of the fill operation, which can be 'horizontal' for x axis, 'vertical' for y axis, or 'both' when it goes both ways, e.g., when pasting unevenly.
275
+ * @param {object} args.newRowData - New row data that is going to replace 'existingRowData'. The result of this function will be kept in this object.
276
+ * @param {object} args.existingRowData - Existing data of the row. This will be replaced with 'newRowData'.
277
+ * @param {number} args.rowIndex - Index of the row on the grid.
278
+ * @param {number} args.rowOffset - Position/offset of 'cells' in 'rows'. Starts with '0'.
279
+ * @param {array} args.cells - New data for all the cells, including this one, for the current row. This is the same as accessing 'rows' using 'rowOffset'.
280
+ * @param {boolean} args.reversed - Whether the fill operation is applied in the reverse order, meaning if horizontal, we are going from right to left, and if vertical, we are going from bottom to top.
281
+ * @param {boolean} args.isFillingRow - Whether the current row is being filled. If the 'direction' is 'vertical', this will always be true, or sometimes true if the 'direction' is 'both'.
282
+ * @param {number} args.fillingRowPosition - Increase in position since the first filling of the rows. This will be '-1' if 'isFillingRow' is false. Starts with '0'.
283
+ * @param {number} args.fillingRowLength - Total length that 'fillingRowPosition' will go. This will be '-1' if 'isFillingRow' is false.
284
+ * @param {object} args.column - Column that this cell is on.
285
+ * @param {number} args.columnIndex - The index of the column on the grid.
286
+ * @param {string} args.newCellData - Data from 'cells' to be set for this cell. You can modify this and return the result to set the new data for this cell.
287
+ * @param {string} args.existingCellData - Existing data on this cell that is about to be replaced with the data you will return.
288
+ * @param {number} args.columnOffset - Position/offset of the 'newCellData' in 'cells'. Starts with '0'.
289
+ * @param {boolean} args.isFillingColumn - Whether the current column is being filled. If the 'direction' is 'horizontal', this will always be true, or sometimes true if the 'direction' is 'both'.
290
+ * @param {number} args.fillingColumnPosition - Increase in position since the first filling of the columns. This will be '-1' if 'isFillingColumn' is false. Starts with '0'.
291
+ * @param {number} args.fillingColumnLength - Total length that 'fillingColumnPosition' will go. This will be '-1' if 'isFillingColumn' is false.
292
+ */
236
293
  /**
237
294
  * Styles for the canvas data grid. Standard CSS styles still apply but are not listed here.
238
295
  * @class
@@ -254,8 +311,8 @@
254
311
  * @property {string} [activeCellSelectedBackgroundColor=rgba(236, 243, 255, 1)] - Style of activeCellSelectedBackgroundColor.
255
312
  * @property {string} [activeCellSelectedColor=rgba(0, 0, 0, 1)] - Style of activeCellSelectedColor.
256
313
  * @property {string} [activeCellVerticalAlignment=center] - Style of activeCellVerticalAlignment.
257
- * @property {string} [activeHeaderCellBackgroundColor=rgba(225, 225, 225, 1)] - Style of activeHeaderCellBackgroundColor.
258
- * @property {string} [activeHeaderCellColor=rgba(0, 0, 0, 1)] - Style of activeHeaderCellColor.
314
+ * @property {string} [activeColumnHeaderCellBackgroundColor=rgba(225, 225, 225, 1)] - Style of activeColumnHeaderCellBackgroundColor.
315
+ * @property {string} [activeColumnHeaderCellColor=rgba(0, 0, 0, 1)] - Style of activeColumnHeaderCellColor.
259
316
  * @property {string} [activeRowHeaderCellBackgroundColor=rgba(225, 225, 225, 1)] - Style of activeRowHeaderCellBackgroundColor.
260
317
  * @property {string} [activeRowHeaderCellColor=rgba(0, 0, 0, 1)] - Style of activeRowHeaderCellColor.
261
318
  * @property {number} [autocompleteBottomMargin=60] - Style of autocompleteBottomMargin.
@@ -289,6 +346,7 @@
289
346
  * @property {number} [childContextMenuMarginTop=0] - Style of childContextMenuMarginTop.
290
347
  * @property {string} [childContextMenuArrowHTML=►] - Style of childContextMenuArrowHTML.
291
348
  * @property {string} [childContextMenuArrowColor=rgba(43, 48, 43, 1)] - Style of childContextMenuArrowColor.
349
+ * @property {number} [columnGroupRowHeight=25] - Style of columnGroupRowHeight.
292
350
  * @property {string} [contextMenuChildArrowFontSize=12px] - Style of contextMenuChildArrowFontSize.
293
351
  * @property {number} [cellWidth=250] - Style of cellWidth.
294
352
  * @property {string} [contextMenuBackground=rgba(240, 240, 240, 1)] - Style of contextMenuBackground.
@@ -340,12 +398,19 @@
340
398
  * @property {string} [editCellColor=black] - Style of editCellColor.
341
399
  * @property {string} [editCellBackgroundColor=white] - Style of editCellBackgroundColor.
342
400
  * @property {number} [editCellZIndex=10000] - Style of editCellZIndex.
401
+ * @property {string} [fillOverlayBorderColor=rgba(127, 127, 127, 1)] - Style of fillOverlayBorderColor.
402
+ * @property {number} [fillOverlayBorderWidth=2] - Style of fillOverlayBorderWidth.
343
403
  * @property {string} [gridBackgroundColor=rgba(240, 240, 240, 1)] - Style of gridBackgroundColor.
344
404
  * @property {string} [gridBorderColor=rgba(202, 202, 202, 1)] - Style of gridBorderColor.
345
405
  * @property {number} [gridBorderWidth=1] - Style of gridBorderWidth.
346
- * @property {string} [columnHeaderCellCapBackgroundColor=rgba(240, 240, 240, 1)] - Style of columnHeaderCellBackgroundColor.
347
- * @property {string} [columnHeaderCellCapBorderColor=rgba(172, 172, 172, 1)] - Style of columnHeaderCellBackgroundColor.
348
- * @property {number} [columnHeaderCellCapBorderWidth=1] - Style of columnHeaderCellBackgroundColor.
406
+ * @property {string} [groupIndicatorColor=rgba(155, 155, 155, 1)'] - Foreground color of the group indicator(icon).
407
+ * @property {string} [groupIndicatorBackgroundColor=rgba(255, 255, 255, 1)'] - Background color of the group indicator(icon).
408
+ * @property {string} [columnHeaderCellBackgroundColor=rgba(240, 240, 240, 1)] - Style of columnHeaderCellBackgroundColor.
409
+ * @property {string} [columnHeaderCellBorderColor=rgba(172, 172, 172, 1)] - Style of columnHeaderCellBackgroundColor.
410
+ * @property {number} [columnHeaderCellBorderWidth=1] - Style of columnHeaderCellBackgroundColor.
411
+ * @property {string} [columnHeaderCellCapBackgroundColor=rgba(240, 240, 240, 1)] - Style of columnHeaderCellCapBackgroundColor.
412
+ * @property {string} [columnHeaderCellCapBorderColor=rgba(172, 172, 172, 1)] - Style of columnHeaderCellCapBackgroundColor.
413
+ * @property {number} [columnHeaderCellCapBorderWidth=1] - Style of columnHeaderCellCapBackgroundColor.
349
414
  * @property {string} [columnHeaderCellBorderColor=rgba(152, 152, 152, 1)] - Style of columnHeaderCellBorderColor.
350
415
  * @property {number} [columnHeaderCellBorderWidth=0.25] - Style of columnHeaderCellBorderWidth.
351
416
  * @property {string} [columnHeaderCellColor=rgba(50, 50, 50, 1)] - Style of columnHeaderCellColor.
@@ -369,6 +434,7 @@
369
434
  * @property {number} [columnHeaderOrderByArrowWidth=13] - Style of columnHeaderOrderByArrowWidth.
370
435
  * @property {number} [rowHeaderCellWidth=57] - Style of rowHeaderCellWidth.
371
436
  * @property {number} [minColumnWidth=45] - Style of minColumnWidth.
437
+ * @property {(number|string)} [height=auto] - Style of height.
372
438
  * @property {number} [minHeight=24] - Style of minHeight.
373
439
  * @property {number} [minRowHeight=24] - Style of minRowHeight.
374
440
  * @property {string} [name=default] - Style of name.
@@ -377,6 +443,9 @@
377
443
  * @property {number} [reorderMarkerBorderWidth=1.25] - Style of reorderMarkerBorderWidth.
378
444
  * @property {string} [reorderMarkerIndexBorderColor=rgba(66, 133, 244, 1)] - Style of reorderMarkerIndexBorderColor.
379
445
  * @property {number} [reorderMarkerIndexBorderWidth=2.75] - Style of reorderMarkerIndexBorderWidth.
446
+ * @property {string} [resizeMarkerColor=rgba(0, 0, 0, 0.2)] - Style of resizeMarkerColor.
447
+ * @property {number} [resizeMarkerSize=2] - Style of resizeMarkerSize.
448
+ * @property {number} [rowGroupColumnWidth=25] - Style of rowGroupColumnWidth.
380
449
  * @property {string} [rowHeaderCellBackgroundColor=rgba(240, 240, 240, 1)] - Style of rowHeaderCellBackgroundColor.
381
450
  * @property {string} [rowHeaderCellBorderColor=rgba(152, 152, 152, 1)] - Style of rowHeaderCellBorderColor.
382
451
  * @property {number} [rowHeaderCellBorderWidth=0.25] - Style of rowHeaderCellBorderWidth.
@@ -390,6 +459,8 @@
390
459
  * @property {number} [rowHeaderCellPaddingLeft=5] - Style of rowHeaderCellPaddingLeft.
391
460
  * @property {number} [rowHeaderCellPaddingRight=5] - Style of rowHeaderCellPaddingRight.
392
461
  * @property {number} [rowHeaderCellPaddingTop=5] - Style of rowHeaderCellPaddingTop.
462
+ * @property {number} [rowHeaderCellRowNumberGapHeight=5] - Style of rowHeaderCellRowNumberGapHeight.
463
+ * @property {number} [rowHeaderCellRowNumberGapColor=rgba(50, 50, 50, 1)] - Style of rowHeaderCellRowNumberGapColor.
393
464
  * @property {string} [rowHeaderCellSelectedBackgroundColor=rgba(217, 217, 217, 1)] - Style of rowHeaderCellSelectedBackgroundColor.
394
465
  * @property {string} [rowHeaderCellSelectedColor=rgba(50, 50, 50, 1)] - Style of rowHeaderCellSelectedColor.
395
466
  * @property {string} [rowHeaderCellVerticalAlignment=center] - Style of rowHeaderCellVerticalAlignment.
@@ -433,10 +504,18 @@
433
504
  * @property {number} [frozenMarkerWidth=1] - Style of frozenMarkerWidth.
434
505
  * @property {string} [overflowY=auto] - When set to hidden, vertical scroll bar will be hidden. When set to auto vertical scroll bar will appear when data overflows the height. When set to scroll the vertical scrollbar will always be visible.
435
506
  * @property {string} [overflowX=auto] - When set to hidden, horizontal scroll bar will be hidden. When set to auto horizontal scroll bar will appear when data overflows the width. When set to scroll the horizontal scrollbar will always be visible.
507
+ * @property {(number|string)} [width=auto] - Style of width.
436
508
 
437
509
  ['', 'normal'],
438
510
  */
439
511
  // event docs go here
512
+ /**
513
+ * Fires when the active cell changes, e.g. by clicking a cell or moving with the keyboard.
514
+ * @event
515
+ * @name canvasDatagrid#activecellchanged
516
+ * @param {object} e Event object.
517
+ * @param {object} e.cell The new active cell as `{rowIndex, columnIndex}`.
518
+ */
440
519
  /**
441
520
  * Fires when the selection changes.
442
521
  * @event
@@ -446,6 +525,16 @@
446
525
  * @param {object} e.selectedData Selected data.
447
526
  * @param {array} e.selections Selections object. 2D matrix of selections.
448
527
  * @param {rectangle} e.selectionBounds rectangle object describing the selection bounds.
528
+ * @param {object} e.boundRowIndexMap Mapping of view data row to bound data row index.
529
+ * @param {object} e.boundColumnIndexMap Mapping of view column order to bound column order.
530
+ */
531
+ /**
532
+ * Fires when the selected is deleted by pressing backspace or delete key.
533
+ * @event
534
+ * @name canvasDatagrid#afterdelete
535
+ * @param {object} e Event object.
536
+ * @param {object} e.ctx Canvas context.
537
+ * @param {array} e.cells Cells affected by the delete action. Each item in the array is a tuple of [rowIndex, columnIndex, boundRowIndex, boundColumnIndex].
449
538
  */
450
539
  /**
451
540
  * Fires when the user clicks on the "drill in" arrow. When the arrow is clicked a new
@@ -480,12 +569,17 @@
480
569
  * @param {number} e.left The new scroll left.
481
570
  */
482
571
  /**
483
- * Fires when the data setter is set.
572
+ * Fires when the data changes: when the data setter is set and after every
573
+ * user or API mutation of the underlying data.
484
574
  * @event
485
575
  * @name canvasDatagrid#datachanged
486
576
  * @param {object} e Event object.
487
577
  * @param {object} e.ctx Canvas context.
488
- * @param {object} e.data Data.
578
+ * @param {object} e.data The bound (unfiltered, unsorted) data.
579
+ * @param {string} e.source What changed the data. One of `data` (the setter), `edit`, `paste`, `cut`, `delete`, `fill`, `addrow`, `insertrow`, `deleterow`, `addcolumn`, `insertcolumn`, `deletecolumn`.
580
+ * @param {array} [e.cells] For `paste`, `cut` and `delete`: the affected cells as `[rowIndex, columnIndex, boundRowIndex, boundColumnIndex(, value)]` tuples.
581
+ * @param {object} [e.cell] For `edit`: the edited cell.
582
+ * @param {*} [e.value] For `edit`: the new value.
489
583
  */
490
584
  /**
491
585
  * Fires when the schema setter is set.
@@ -539,7 +633,7 @@
539
633
  * @name canvasDatagrid#afterpaste
540
634
  * @param {object} e Event object
541
635
  * @param {object} e.ctx Canvas context.
542
- * @param {array} e.cells Cells affected by the paste action. Each item in the array is a tuple of [rowIndex, columnIndex].
636
+ * @param {array} e.cells Cells affected by the paste action. Each item in the array is a tuple of [rowIndex, columnIndex, boundRowIndex, boundColumnIndex, value], where `value` is the pasted value.
543
637
  */
544
638
  /**
545
639
  * Fired just before a cell is drawn onto the canvas. `e.preventDefault();` prevents the cell from being drawn.
@@ -934,6 +1028,22 @@
934
1028
  * @param {object} e.ctx Canvas context.
935
1029
  * @param {canvasDatagrid.cell} e.cell The cell being moved out of.
936
1030
  */
1031
+ /**
1032
+ * Fires column(s) are being hidden
1033
+ * @event
1034
+ * @name canvasDatagrid#columnhide
1035
+ * @param {object} e Event object.
1036
+ * @param {object} e.ctx Canvas context.
1037
+ * @param {columnIndex} e.columnIndex Index of column being hidden.
1038
+ */
1039
+ /**
1040
+ * Fires column(s) are being unhidden
1041
+ * @event
1042
+ * @name canvasDatagrid#columnunhide
1043
+ * @param {object} e Event object.
1044
+ * @param {object} e.ctx Canvas context.
1045
+ * @param {columnIndex} e.columnIndex Index of column being unhidden.
1046
+ */
937
1047
  /**
938
1048
  * Fires when the mouse enters a row.
939
1049
  * @event