Releases: fin-hypergrid/core
Hypergrid v2.1.14
- This patch release
v2.1.14
supersedesv2.1.13
- Reflects PRs #731
- Note that there were no releases
v2.1.1
,v2.1.9
,v2.1.11
, or2.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
- Add support for Tree column & Row number column cell properties
- New demo:
filter-row.html
- Add
editor
property for filter row cells - Add
Base.prototype.atLeastVersion
- Add support for cell renderer overlays
- New demo:
over-render.html
- Add
fin-row-header-click
event (cancelable)
Bug fixes
- Fixed issues with registry synonyms
- 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 theTag
cell renderer:SimpleCell
— The first cell renderer listed should render the cell contents, including possibly the cell background color (as needed per grid renderer strategy).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 definedtagbands
property. For example, cells with the followingtagbands
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 atagband
property will actually render tags. (It would of course be more efficient to only set those cells'renderer
properties to an array that includesTag
and leave the rest of the cells set to the scalarSimpleCell
.)
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
See also
In addition to the release notes below, please refer also to:
- Release Notes: v2.1.0 wiki page
- All release notes for
v2.1.2
throughv2.1.10
(below)
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
, or2.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
- Support for non-US keyboard layouts (resolves Issues #621 and #623; supersedes PRs #622 and #626)
- Scrolling speed (resolves Issue #290; supersedes PR #620)
- Fix
fin-button-pressed
event handler in TestBench (demo) - Fix
Renderer.prototype.findCell
- Add
config.clickRect
write-only prop for cell renderer - Draw frame around last row or column selection
- Add "collapse cell selections" testbench feature
- Allow auto-row and -column selection without cell selection
- Improve
Textfield
cell editor - Improve cell editor base class (CellEditor.js)
- Fix and enhance testbench's
Time
cell editor - 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 returnskeyboardEvent.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 eventsfin-keydown
,fin-keyup
,fin-editor-keydown
,fin-editor-keypress
, andfin-editor-keyup
: e.char
is still set as before bygrid.canvas.getKeyChar(e)
but now contains the new resulte.legacyChar
(new prop) is the olde.char
value, when available (depends onkeyCode
still working and charMap coverage)- for non-printable chars (
e.legacyChar.length > 1
),e.char === e.legacyChar
(still)
There are two breaking changes:
- The space bar previously returned
e.char === 'SPACE'
and therefore was considered a non-printable char. It is now considered a printable char, ande.char === ' '
instead. - 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 whilee.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 ofWheelEvent#deltaX
(received by the horizontal scrollbar's listener).wheelVFactor: 0.05
- multiplier for vertical mouse wheel movement, applied to values ofWheelEvent#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
objectconfig.buttonCells
object (reference togrid.renderer.buttonCells
grid.renderer.isViewableButton(c, r)
methodgrid.isViewableButton(c, r)
method (stub that calls therenderer
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 thecellEvent[]
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 actualcellEvent
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 newclickRect
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 (akafin.Hypergrid.rectangular.Rectangle
in thefin-hypergrid.js
build) in theconfig.clickRect
property, which the grid renderer then copies back onto thecellEvent
object. - The
fin-canvas-click
event received from the canvas was previously always re-fired as thefin-click
event. This event is now ignored however in the following cases:- 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. - 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 theclickRect
(as it was when it was the mouse button was depressed).
- 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
- Note that
fin-mouseup
andfin-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...
Hypergrid v2.1.12
Merge pull request #727 from fin-hypergrid/develop hot fix to demo file
Hypergrid v2.1.10
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
andbehaviorStateChanged
were causing recursionreindex
,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 (pergridLinesV
).gridLinesRowHeader
— Whether horizontal grid lines are drawn between row headers (pergridLinesH
).gridLinesUserDataArea
— Whether vertical and/or horizontal grid lines are drawn between column headers (pergridLinesH
andgridLinesV
).
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 thefin-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 (pergridLinesUserDataArea
); but when set (andgridLinesUserDataArea
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
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
andallColumns
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
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
-mutatedconfig.format
now used to formatconfig.value
asconfig.formatValue
for cell renderer (Issue #708).- Added row properties optimization to
assignProps
to make use of the fact that it now hasgrid.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 propertybox-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 ofgridLinesHWidth
(i.e., 1 pixel) to compensate. - Cells are spread apart horizontally by
gridLinesVWidth
pixels (rendered contiguously whengridLinesVWidth === 0
). - Cells are spread apart vertically by
gridLinesHWidth
(rendered contiguously whengridLinesHWidth === 0
).
- This will be the default setting in v3.0.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
andbehavior.autoSizeTreeColumn
methods
- Add
- 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
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 thecheckboxOnlyRowSelections
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()
andbehavior.getActiveColumns()
arrays now also serve as column name dictionaries (point to column objects). This makesbehavior.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 saygrid.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)
andbehavior.addState(state)
— new methods that do not callclearState
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 withstate.columns
(column collection by name), it is now always blacklisted bygrid.saveState
(so onlystate.columns
is output).
grid.reindex()
— Similarly torepaint()
,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
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 neitheroptions.Behavior
noroptions.data
were passed tonew 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
andgrabber
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
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 usingfunction
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 defaultpropClassLayers
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]
- Suppressed warning regarding
- 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) orHypergrid.theme
(global theme) to{}
or a falsy value. - Setters now call
repaint()
.
- Finished
- New read-only
- CDN: Made the CDN
doc
folder a sym-link to the latest version folder'sdoc
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
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 newpropClassLayers
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).