Skip to content

Releases: fin-hypergrid/core

Hypergrid v2.1.14

25 Jun 20:55
a1c2dad
Compare
Choose a tag to compare
  • This patch release v2.1.14 supersedes v2.1.13
  • Reflects PRs #731
  • Note that there were no releases v2.1.1, v2.1.9, v2.1.11, or 2.1.12

See also

In addition to the release notes below, please refer also to:

  • Release Notes: v2.1.0 wiki page
  • Notes for all subsequent releases through v2.1.13 (following these notes)

Published to npm

This release has been published as a module to the npm registry.

Pre-bundled build file

A bundled build of this release is available on the CDN.

Synopsis

This release adds some new features and fixes some bugs:

New features

  1. Add support for Tree column & Row number column cell properties
  2. New demo: filter-row.html
  3. Add editor property for filter row cells
  4. Add Base.prototype.atLeastVersion
  5. Add support for cell renderer overlays
  6. New demo: over-render.html
  7. Add fin-row-header-click event (cancelable)

Bug fixes

  1. Fixed issues with registry synonyms
  2. Faster renderer lookup

New features

1. Add support for Tree column & Row number column cell properties

  • Properties set on Individual cells in these columns now function correctly.
  • Among other things, the top-left cell can now be bound to a custom cell renderer:
    var b = myGrid.behavior;
    b.setCellProperty(b.rowColumnIndex, 0, 'renderer', ‘custom’, b.subgrids.lookup.header);
  • Row number column now has a name: RowHeader (previously was empty string).

2. New demo: filter-row.html

Demonstrates how to:

  • Create and display a filter cell row
  • Bind a cell editor to it.

The included cell editor demonstrates how to:

  • Trigger the fin-filter-applied event when a column filter changes.
  • Implement "immediate keypress" mode (issues a filter event on every keypress rather than waiting for the editor to be closed).

3. Add editor property for filter row cells

This new property makes it much simpler to bind a cell editor to cells in the filter. Serializes as filterEditor. See the filter-row.html demo code for example of how to bind with and without this new property.

4. Add Base.prototype.atLeastVersion

if (grid.atLeastVersion('2.1.14')) {
    . . . // use a new feature
}

5. Add support for cell renderer overlays

This new feature coded to have minimal performance impact (as usual).

  • A cell's renderer prop may now accepts an array-of-string overload of cell renderer names:
    grid.properties.renderer = ['SimpleCell', 'Tag'];
  • Each listed cell renderer will be called in turn.
  • In the example above, we set the entire grid to call for every cell the SimpleCell cell renderer followed by the Tag cell renderer:
    1. SimpleCell — The first cell renderer listed should render the cell contents, including possibly the cell background color (as needed per grid renderer strategy).
    2. Tag — The remaining cell renderer(s) in the list are assumed to be "overlay renderer(s)" that add superimposed graphic elements. They are dependent on being preceded by a regular cell renderer for the basic cell contents.
  • The Tag cell renderer is provided as an example of a cell renderer intended to be used as an overlay. It renders a "tag" (small triangle) in the upper-right corner of the cell whose color is determined by the cell value.
  • Tag only renders a tag over cells with a defined tagbands property. For example, cells with the following tagbands definition will render a green tag for values ≥ 128; else yellow for values ≥ 64; else red for the remaining positive values.:
    myColumnOrCell.properties.tagbands = [
        { floor: 128, fillStyle: 'green' },
        { floor: 64, fillStyle: 'yellow' },
        { floor: 0, fillStyle: 'red' }
    ];
  • Note that although we set the entire grid to call render Tag overlays, only the cells with a tagband property will actually render tags. (It would of course be more efficient to only set those cells' renderer properties to an array that includes Tag and leave the rest of the cells set to the scalar SimpleCell.)

6. New demo: over-render.html

Demonstrates how cell renderer overlays work using the new Tag cell renderer.

7. Add fin-row-header-click event (cancelable)

Easy way to intercept a click in the row number cell to do something with the input in addition to selecting the row, or call event.preventDefault() in the handler to do something else rather than selecting a row.

Bug fixes

1. Fixed issues with registry synonyms

  • Registry.prototype.add now updates synonyms that differ only in case.
  • Fixed an issue with Registry.prototype.addSynonym issue.

2. Faster renderer lookup

The cellRenderers.get('emptycell') deprecation check is now faster by avoiding toLowerCase(name) on every renderer lookup.

API docs

Simplified cell renderer jsdoc pages.

Hypergrid v2.1.13

12 Jun 17:55
abfca3a
Compare
Choose a tag to compare

See also

In addition to the release notes below, please refer also to:

This patch release v2.1.13 supersedes v2.1.10

  • Reflects PRs #722 (v2.1.11) + #727 (v2.1.12) + #728 (v2.1.13)
  • Note that there were no releases v2.1.1, v2.1.9, v2.1.11, or 2.1.12

Published to npm

This release has been published as a module to the npm registry.

Pre-bundled build file

A bundled build of this release is available on the CDN.

Synopsis

  1. Support for non-US keyboard layouts (resolves Issues #621 and #623; supersedes PRs #622 and #626)
  2. Scrolling speed (resolves Issue #290; supersedes PR #620)
  3. Fix fin-button-pressed event handler in TestBench (demo)
  4. Fix Renderer.prototype.findCell
  5. Add config.clickRect write-only prop for cell renderer
  6. Draw frame around last row or column selection
  7. Add "collapse cell selections" testbench feature
  8. Allow auto-row and -column selection without cell selection
  9. Improve Textfield cell editor
  10. Improve cell editor base class (CellEditor.js)
  11. Fix and enhance testbench's Time cell editor
  12. New: demo/formatter-workbench

1. Support for non-US keyboard layouts

Hypergrid until now has depended on the long-deprecated KeyboardEvent#keyCode to infer the printable character. This assumes a particular keyboard layout and mapping of keyCode to physical keys.

Issue #621: Characters are wrongly mapped for non-US keyboards

This PR resolves this issue (Issue #621). The logic no longer depends on keyCode although the legacy logic is still in place and the legacy value is still available in event.legacyChar:

  • grid.canvas.getKeyChar(keyboardEvent) now returns keyboardEvent.key for "printable" chars, include the space char.
  • printable chars are discriminated from non-printable characters when key.length === 1
  • for the event e passed to events fin-keydown, fin-keyup, fin-editor-keydown, fin-editor-keypress, and fin-editor-keyup:
  • e.char is still set as before by grid.canvas.getKeyChar(e) but now contains the new result
  • e.legacyChar (new prop) is the old e.char value, when available (depends on keyCode still working and charMap coverage)
  • for non-printable chars (e.legacyChar.length > 1), e.char === e.legacyChar (still)

There are two breaking changes:

  1. The space bar previously returned e.char === 'SPACE' and therefore was considered a non-printable char. It is now considered a printable char, and e.char === ' ' instead.
  2. On the Mac, option (aka meta) + printable char generally returns generates some exotic printable char. Like non-US keyboard characters, these were previously lost. Now however e.char will contain the exotic char while e.legacyChar will contain the old value (the regular character as if the meta key was not down).

Issue #623: Space key does not open cell editor

The first breaking change above has the side-effect of also resolving #623: Space key does not open cell editor

2. Scrolling speed (Issue #290)

Added two new properties which are multipliers for the mouse wheel:

  • wheelHFactor: 0.02 - multiplier for horizontal mouse wheel movement, applied to values of WheelEvent#deltaX (received by the horizontal scrollbar's listener).
  • wheelVFactor: 0.05 - multiplier for vertical mouse wheel movement, applied to values of WheelEvent#deltaY (received by the vertical scrollbar's listener).

Caveat

Wheel granularity depends on the OS, the input device, and possibly the browser. Any setting you choose will work differently in different environments. If you don't know the user's environment, it is probably best to give users control of this setting so they can fine tune it themselves.

Default values

The particular default values shown above are a compromise. These settings seem to work well on the MacBook Pro trackpad. They also seem to work acceptably (though differently) with a mouse wheel on both Mac OS and Windows.

Be aware however that the trackpad scrolling speed can be adjusted by the Mac user at the OS level (System Preferences -> Accessibility -> Mouse & Trackpad -> Trackpad Options… -> Scrolling speed). Mouse wheel scrolling speed is also adjustable ( yada yada -> Mouse Options… -> Scrolling speed; or on Windows search for "Change mouse wheel settings" in the Start menu).

This setting feels good on trackpad (2-finger drag). It's much slower than it was, but the way it was was way to coarse and fast, scrolling hundreds of rows in a flash.

With this setting, a mouse connected to a Mac, the wheel requires 5 click-stops to scroll 1 row; the same mouse connected to Windows scrolls 5 rows per click-stop. (However, I may have changed the default settings on my machines; not sure.)

On Windows, the original vertical multiplier setting (i.e., 1.0) scrolled 100 grid rows on a single mouse wheel click-stop; the new default (0.05) scrolls 5 rows per click-stop. It stands to reason therefore that a setting of 0.01 will scroll 1:1 (1 row per 1 click-stop).

Hint

You can tell if the user is using a trackpad by listening for any deltaX (since a simple mouse wheel is deltaY only); and what OS by checking user agent.

3. Fix fin-button-pressed event handler in TestBench (demo)

Fixed an issue that prevented the fin-button-pressed event from being fired when user clicks on a cell rendered by the Button cell renderer.

Also retired the following core code which supported this event:

  • grid.renderer.buttonCells object
  • config.buttonCells object (reference to grid.renderer.buttonCells
  • grid.renderer.isViewableButton(c, r) method
  • grid.isViewableButton(c, r) method (stub that calls the renderer version)

The above code, intended for internal use only, tracked and identified the set of visible cells rendered by the Button cell renderer so that clicking them could dispatch the fin-button-pressed event. That solution may have been left over from an early release that lacked general column properties (much less cell properties). In any case, it has been updated to simply check the cell's cell renderer name (event.properties.renderer === 'button').

4. Fix Renderer.prototype.findCell

  • Fixed a bug in Renderer.prototype.findCell where the cellEvent[] pool size was being miscalculated because it was not accounting for row number column and/or tree column (when present). Previously, when these columns were present the algorithm was failing to scan enough elements and was therefore missing targets in the last 1 or 2 columns.
  • Upgraded grid.renderer.getGridCellFromMousePoint to return the actual cellEvent from the pool (rather than a new one with the same coordinates) so that decorations added by the cell renderer are now available to mouse events, in particular the new clickRect property described below.

5. Add config.clickRect write-only prop for cell renderer

  • Using local cell coordinates, cell renderers can now at their option define a require('rectangular').Rectangle object (aka fin.Hypergrid.rectangular.Rectangle in the fin-hypergrid.js build) in the config.clickRect property, which the grid renderer then copies back onto the cellEvent object.
  • The fin-canvas-click event received from the canvas was previously always re-fired as the fin-click event. This event is now ignored however in the following cases:
    1. This event is now ignored if the mouse button was released when the mouse was no longer hovering over the cell it was over when the mouse button was depressed. Previously this event was always fired regardless because as it was is actually triggered by the browser on the entire <canvas> element, it fired even when the mouse was moved to another cell before releasing the mouse button.
    2. When and only when a clickRect subrect was defined on the event by the cell renderer: This event is now ignored if the mouse button was released when the mouse was no longer hovering over the clickRect (as it was when it was the mouse button was depressed).
  • Note that fin-mouseup and fin-double-click are unaffected by this change.

6. Draw frame around last row or column selection

  • Draw a frame around the visible portion of the last selection including row and column selections. Previously this feature only pertained to cell region selections. It now pertains to whatever was selected last. It is smart about deselecting.
  • Copy operation now copies the last selection (thing with the frame now drawn around it). Previously cell region selections always had priority, then row selections, then column selections.
  • Exception: The collapse cell region feature which collapses a cell region selection to a new row selection, continues to draw the frame around just the cells (the previous behavior). Note that this feature is only active when grid.properties.singleRowSelectionMode && !grid.properties.multipleSelections (which are the default settings).

7. Add "collapse cell selections" testbench feature

This feature has been imported from the "testbench" demo as a new option collapseCellSelections but it now defaults to false. You can turn it back on in the Dashboard -> Selections panel.

This feature basically causes row selections to move the last cell selection to the new row selection.

This feature only works in single row selection mode when selecting one row at a time (singleRowSelectionMode && !multipleSelections).

8. Allow auto-row and -colum...

Read more

Hypergrid v2.1.12

12 Jun 15:55
7b2e3db
Compare
Choose a tag to compare
Merge pull request #727 from fin-hypergrid/develop

hot fix to demo file

Hypergrid v2.1.10

06 May 19:45
0bc0c10
Compare
Choose a tag to compare

Please refer primarily to the Release Notes: v2.1.0 wiki page as well as the notes in the v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, and v2.1.8 patches.

NOTE: There was no v2.1.9 release.

Patch release v2.1.10 reflects PR #718.

Bug fixes

  • When the paint loop is not running (rarely used debug feature; not issues when paint loop is running normally):
    • behaviorShapeChanged and behaviorStateChanged were causing recursion
    • reindex, behaviorShapeChanged, behaviorStateChanged were not being called
  • Remove defunct row and tree column elements when clearing grid.renderer.visibleColumns array

New features

Added new boolean grid props to more finely control where grid lines are rendered (all true by default):

  • gridLinesColumnHeader — Whether vertical grid lines are drawn between column headers (per gridLinesV).
  • gridLinesRowHeader — Whether horizontal grid lines are drawn between row headers (per gridLinesH).
  • gridLinesUserDataArea — Whether vertical and/or horizontal grid lines are drawn between column headers (per gridLinesH and gridLinesV).

Column header grid lines

The lines drawn between column headers are now also subject to additional logic dictated by the top and bottom properties of the each column's element in grid.renderer.visibleColumns as follows:

  • Respect new .top prop when defined.
    This is always set by the fin-hypergrid-grouped-header-plugin to prevent lines from being drawn over group labels.
  • Respect new .bottom prop when defined.
    Could be set to prevent lines from being drawn between column headers (i.e., the bottom row of a grouped header, below the hierarchy of group labels). When not set, a single grid line can be drawn for both the header and the user data area (per gridLinesUserDataArea); but when set (and gridLinesUserDataArea set) two lines need to be drawn: one for the header, then the gap, then another line for the user data area. Although this feature was implemented, fin-hypergrid-grouped-header-plugin@1.1.2 does not currently set .bottom because the resulting visual effect was decidedly unpleasing. Nevertheless, the implementation remains in place and an option to set it could be added to the plug-in in a future version.

Published to npm

This release has been published as a module to the npm registry.

Pre-bundled build file

A bundled build of this release is available on the CDN.

Hypergrid v2.1.8

24 Apr 13:16
4e0a790
Compare
Choose a tag to compare

Please refer primarily to the Release Notes: v2.1.0 wiki page as well as the notes in the Hypergrid v2.1.2, Hypergrid v2.1.3, Hypergrid v2.1.4, Hypergrid v2.1.5, [Hypergrid v2.1.6](https://github.com/fin-hypergrid/core/releases/tag/v2.1.6, and Hypergrid v2.1.7 patches.

Patch release v2.1.8 reflects PR #713 and includes the following bug fixes:

This patch release includes:

  • fix deferred behavior change (good catch @nclsclsn!)
  • upgrade to synonomous@2.1.2 so integer synonyms are not added to columns and allColumns arrays

Published to npm

This release has been published as a module to the npm registry.

Pre-bundled build file

A bundled build of this release is available on the CDN.

Hypergrid v2.1.7

13 Apr 20:21
fe48730
Compare
Choose a tag to compare

Please refer primarily to the Release Notes: v2.1.0 wiki page as well as the notes in the Hypergrid v2.1.2, Hypergrid v2.1.3, Hypergrid v2.1.4, Hypergrid v2.1.5, and Hypergrid v2.1.6 patches.

Patch release v2.1.7 reflects PR #706 and includes bug fixes and some new features:

This patch release includes:

  • getCell-mutated config.format now used to format config.value as config.formatValue for cell renderer (Issue #708).
  • Added row properties optimization to assignProps to make use of the fact that it now has grid.properties as its prototype.
  • Optimized assignProps for these complex use cases:
    • column + cell
    • cell + column
    • cell + … + column
  • Render "fixed" vertical rule line to righty of any non-scrollable columns. Previously, when there were no fixed columns, the vertical fixed rule line was not rendered at all. It now renders to right of tree column when visible; else row number column when visible. Only when there are no such columns is it not rendered at all.
  • Fixed rule lines now have a minimum thickness equal to that of the grid lines.
  • boxSizing (new grid property, analogous to CSS property box-sizing) has two possible settings:
    • boxSizing === 'border-box'.
      • This is the default setting in v2.1.7.
      • Cells are always rendered contiguously.
      • Grid rule lines are rendered inside cell at right and bottom edges.
      • Fixed rule lines are also rendered inside the cell, except for any portion of thickness exceeding grid line thickness, which is rendered to right of and below the cell, pushing cells to right rightward and cells below down.
    • boxSizing === 'content-box':
      • This will be the default setting in v3.0.0; defaultRowHight default will be decremented by the value of gridLinesHWidth (i.e., 1 pixel) to compensate.
      • Cells are spread apart horizontally by gridLinesVWidth pixels (rendered contiguously when gridLinesVWidth === 0).
      • Cells are spread apart vertically by gridLinesHWidth (rendered contiguously when gridLinesHWidth === 0).
    • SimpleCell#paint cell renderer now renders text 1 pixel higher up on odd cell heights.
    • synchronizeScrollingBoundaries method corrected for better positioning of last row/column when scrolled all the way to the bottom/right.
      • Now respects cell gaps in calculating maximum scroll position so that the last row/column are positioned properly at bottom/right.
      • Now always called from grid.setData
  • Fix column auto-sizing (Issue #710)
  • Fix tree column auto-sizing:
    • Add treeColumnAutosizing property
    • Add behavior.getTreeColumn and behavior.autoSizeTreeColumn methods
  • Update package-lock.json (Issue #711)

Published to npm

This release has been published as a module to the npm registry.

Pre-bundled build file

A bundled build of this release is available on the CDN.

Hypergrid v2.1.6

22 Mar 03:31
6161e8d
Compare
Choose a tag to compare

Please refer primarily to the Release Notes: v2.1.0 wiki page.
In addition, review the notes in the Hypergrid v2.1.2, Hypergrid v2.1.3, Hypergrid v2.1.4, and Hypergrid v2.1.5 patches.

v2.1.6 fixes bugs and adds new features:

  • Fixed COPY (ctrl-C, command-C) regression (copy select data command)
  • Fixed single-column-after-fixed-column(s) render issue (was crashing renderer)
  • For restoring row selection(s) across data transformations (reindex calls):
    • restoreRowSelections — new property (formerly controlled by the checkboxOnlyRowSelections property which was creating logic conflicts)
    • restoreColumnSelections — new property to restore column selection(s) (new feature)
  • Behavior.prototype.getActiveColumnIndex — a new overload accepts a column name (string) in addition to existing overloads of a data row index (number) or column (object)
  • The behavior.getColumns() and behavior.getActiveColumns() arrays now also serve as column name dictionaries (point to column objects). This makes behavior.columnEnum (which are integers) obsolete (which will be deprecated in v3); if you need to know a column index, you can now ay for a column "per-cent" for example, grid.behavior.getColumns()['per-cent'].index. Names with punctuation are re-added as camel case, including even legal punctuation (_ and $); and names beginning with digit are prefixed with $. Thus, for "per-cent" you can also say grid.behavior.getColumns().perCent.index.
  • Column properties are now picked up from column schema on column create
    • This has advantages over declaring column properties in grid state object.
    • column.addProperties(newProps) — new method doesn't clear existing props first.
    • The demo shows how props can now come from schema as well as from state object (column 'height' has a prop coming each source).
  • Load state (setState) adjustments:
    • behavior.clearState() now clears columns' state as well.
    • grid.addState(state) and behavior.addState(state) — new methods that do not call clearState before applying state.
    • state.columnProperties (column array) can now be an object (with indexes as keys) as well as an array, which makes for easier sparse array JSON strings. Because this object competes with state.columns (column collection by name), it is now always blacklisted by grid.saveState (so only state.columns is output).
  • grid.reindex() — Similarly to repaint(), behaviorChanged, et al, this method can now be called repeatedly within a thread but will only ever be executed one time before the next render.
  • Assigning a value of undefined with the various set property methods now deletes the property from the properties object, revealing the underlying value from the prototype.
  • Row properties objects now have the grid properties object as their prototype (similar to column properties objects).
  • Registry.js has been simplified.
    • It no longer cares what kind of item is being registered.
    • It no longer has the ability to instantiate singletons from a constructor item.
    • It no longer supports global registries; all registries are now private.
  • CellEvent's row property support has been improved to be subgrid-aware. (This was an oversight.)
  • getActiveColumnIndex(columnOrIndexOrName: (object|number|string)) — The string overload is new and accepts a column name.
  • Some Column constructor overloads have been deprecated.

Published to npm

This release has been published as a module to the npm registry.

Pre-bundled build file

A bundled build of this release is available on the CDN.

Hypergrid v2.1.5

09 Mar 04:21
200b3bb
Compare
Choose a tag to compare

Please refer primarily to the Release Notes: v2.1.0 wiki page.
In addition, review the notes in the Hypergrid v2.1.2, Hypergrid v2.1.3, and Hypergrid v2.1.4 patches.

v2.1.5 fixes 5 bugs:

  • Fixed bug in grid.behavior.getValue() and .setValue()
  • Fixed bug in grid.behavior.getRowProperties() and .setRowProperties() (recently added methods)
  • Fixed issue when <canvas> element failed to initialize, which was use case where neither options.Behavior nor options.data were passed to new Hypergrid(options)
  • Fixed issue where events were being disabled when there were no data rows; events are now only being disabled when there are no rows of any kind
  • Fixed grab and grabber cursors for FF/Safari/Opera

This release has been published as a module to the npm registry.

A bundled build of this release is available on the CDN.

Hypergrid v2.1.4

22 Feb 17:28
665cd35
Compare
Choose a tag to compare

Please refer primarily to the Release Notes: v2.1.0 wiki page.
In addition, review the notes in the Hypergrid v2.1.2 and Hypergrid v2.1.3 patches.

This 2.1.4 release fixes 1 long-standing bug with computed column calculators and 1 issue with demo build, as well as back-porting some more v3 improvements.

  • Bug fix: The toFunction function bug noted by @joneit in Issue #696 has been fixed to properly parse functions. (This fixes parsing of functions using function keyword. Per comments in issue, arrow functions are not valid calculator functions and will not parse.) [d6fbc2a]
  • Demo:
    • Suppressed warning regarding reapplyCellProperties property by removing it from demo. The demo now works as expected without it due to the default propClassLayers property setting. This default setting renders cell props after row stripe props. [ec71c31]
    • Bug fix: Incorrect case in filename in require(). See Issue #692. Only affected build environments on case-sensitive file systems. [f8246c3]
  • Back-ported some fixes & improvements from the v3.0.0 branch:
    • New read-only grid.version property from v3 code base. [d57f615.]
    • Themes [f7d4533]:
      • Finished grid.themes setter implementation — which previously ignored its input (with a console warning).
      • Improved theme removal, by setting grid.theme (instance theme) or Hypergrid.theme (global theme) to {} or a falsy value.
      • Setters now call repaint().
  • CDN: Made the CDN doc folder a sym-link to the latest version folder's doc folder.

This release has been published as a module to the npm registry.

A bundled build of this release is available on the CDN.

NOTE: This is the last planned v2 update before the release of v3.0.0 before end-of-month (Feb. 2018).

Hypergrid v2.1.3

15 Feb 13:52
5dc8c9c
Compare
Choose a tag to compare

Please refer primarily to the Release Notes: v2.1.0 wiki page.
In addition, review the notes in the Hypergrid 2.1.2 patch.

This release fixes 1 regression and 1 bug:

  • Fixed a regression: Fixed double-click logic to not throw error on unknown cell editor. So if properties.editor contains a string unknown to grid.cellEditors.get() (internally, the list is kept in grid.cellEditors.items), before this fix an error was thrown; after this fix, the cell is simply uneditable.
  • Fixed a long-standing bug: Fixes a bug that was causing removeAllEventListeners to throw an error. The problem was trying to use each (which uses forEach) to delete a list's own members. Solution was to clone the list for the benefit of forEach.
  • Documentation: Added jsdoc comments for CellEvent.
  • Deprecation: Added a deprecation warning for the reapplyCellProperties prop in favor of using the new propClassLayers prop. Added a layering dictionary to make this easy.

This release has been published as a module to the npm registry.

A bundled build of this release is available on the CDN.

NOTE: This is the last planned v2 update before the release of v3.0.0 before end-of-month (Feb. 2018).