fin-hypergrid
Advanced tools
Comparing version 2.1.13 to 2.1.15-umd
{ | ||
"name": "fin-hypergrid", | ||
"version": "2.1.13", | ||
"version": "2.1.15-umd", | ||
"description": "Canvas-based high-performance grid", | ||
@@ -18,3 +18,2 @@ "repository": { | ||
"dependencies": { | ||
"chai": "^3.5.0", | ||
"extend-me": "^2.7.0", | ||
@@ -35,2 +34,3 @@ "fin-hypergrid-data-source-base": "^0.4.10", | ||
"browserify": "^15.1.0", | ||
"chai": "^3.5.0", | ||
"css-injector": "^1.1.0", | ||
@@ -47,3 +47,3 @@ "gulp": "^3.9.0", | ||
"gulp-mirror": "^0.4.0", | ||
"gulp-mocha": "^2.2.0", | ||
"gulp-mocha": "^6.0.0", | ||
"gulp-rename": "^1.2.2", | ||
@@ -50,0 +50,0 @@ "gulp-replace": "^0.5.4", |
@@ -11,3 +11,3 @@ [![Build Status](https://travis-ci.org/openfin/fin-hypergrid.svg?branch=develop)](https://travis-ci.org/openfin/fin-hypergrid) | ||
## Table of Contents | ||
* [Current Release](#current-release-2111---12-june-2018) | ||
* [Current Release](#current-release-2115---29-june-2018) | ||
* [Demos](#demos) | ||
@@ -20,5 +20,5 @@ * [Features](#features) | ||
### Current Release (2.1.13 - 12 June 2018) | ||
### Current Release (2.1.15 - 29 June 2018) | ||
**Hypergrid 2.1.13** includes bug fixes, new features, and a couple of additional demos. | ||
**Hypergrid 2.1.15** includes bug fixes and new features. | ||
@@ -57,3 +57,3 @@ _For a complete list of changes, see the [release notes](https://github.com/fin-hypergrid/core/releases)._ | ||
We also maintain versioned [online API documentation](https://fin-hypergrid.github.io/core/2.1.13/doc/Hypergrid.html) for all public objects and modules. This documentation is necessarily an on-going work-in-progress. | ||
We also maintain versioned [online API documentation](https://fin-hypergrid.github.io/core/2.1.15/doc/Hypergrid.html) for all public objects and modules. This documentation is necessarily an on-going work-in-progress. | ||
@@ -64,3 +64,3 @@ (Cell editor information can be found [here](https://github.com/fin-hypergrid/core/wiki/Cell-Editors).) | ||
Hypergrid global configurations can be found [here](https://fin-hypergrid.github.io/core/2.1.13/doc/module-defaults.html). | ||
Hypergrid global configurations can be found [here](https://fin-hypergrid.github.io/core/2.1.15/doc/module-defaults.html). | ||
@@ -67,0 +67,0 @@ ### Roadmap |
@@ -22,2 +22,12 @@ /* globals alert */ | ||
Base.prototype.atLeastVersion = function(neededVersion) { | ||
var neededParts = neededVersion.split('.'), | ||
thisParts = this.version.split('.'), | ||
delta; | ||
neededParts.find(function(neededPart, i) { | ||
return (delta = neededPart - thisParts[i]); | ||
}); | ||
return delta >= 0; | ||
}; | ||
Base.prototype.deprecated = require('./lib/deprecated'); | ||
@@ -24,0 +34,0 @@ Base.prototype.HypergridError = require('./lib/error'); |
@@ -10,3 +10,2 @@ 'use strict'; | ||
var Synonomous = require('synonomous'); | ||
var propClassEnum = require('../defaults.js').propClassEnum; | ||
var assignOrDelete = require('../lib/misc').assignOrDelete; | ||
@@ -170,11 +169,11 @@ | ||
schema[tc] = schema[tc] || { | ||
name: 'Tree', | ||
header: 'Tree' | ||
}; | ||
schema[tc] = schema[tc] || {}; | ||
schema[tc].index = tc; | ||
if (schema[tc].name === undefined) { schema[tc].name = 'Tree'; } | ||
if (schema[tc].header === undefined) { schema[tc].header = 'Tree'; } | ||
schema[rc] = schema[rc] || { | ||
name: '', | ||
header: '' | ||
}; | ||
schema[rc] = schema[rc] || {}; | ||
schema[rc].index = rc; | ||
if (schema[rc].name === undefined) { schema[rc].name = 'RowHeader'; } | ||
if (schema[rc].header === undefined) { schema[rc].header = ''; } | ||
@@ -193,12 +192,6 @@ /** | ||
this.allColumns[tc] = this.columns[tc] = this.newColumn({ | ||
index: tc, | ||
header: schema[tc].header | ||
}); | ||
this.allColumns[rc] = this.columns[rc] = this.newColumn({ | ||
index: rc, | ||
header: schema[rc].header | ||
}); | ||
this.allColumns[tc] = this.columns[tc] = this.newColumn(schema[tc]); | ||
this.allColumns[rc] = this.columns[rc] = this.newColumn(schema[rc]); | ||
this.columns[tc].properties.propClassLayers = this.columns[rc].properties.propClassLayers = [propClassEnum.COLUMNS]; | ||
this.columns[tc].properties.propClassLayers = this.columns[rc].properties.propClassLayers = this.grid.properties.propClassLayersMap.NO_ROWS; | ||
@@ -205,0 +198,0 @@ // Signal the renderer to size the now-reset handle column before next render |
@@ -157,3 +157,3 @@ /* eslint-env bro wser */ | ||
switch (this._index) { | ||
switch (this.index) { | ||
case this.behavior.treeColumnIndex: | ||
@@ -165,2 +165,6 @@ props = this.properties.treeHeader; | ||
break; | ||
default: | ||
if (dataModel && dataModel.type === 'filter') { | ||
props = this.properties.filterProperties; | ||
} | ||
} | ||
@@ -167,0 +171,0 @@ |
@@ -338,2 +338,12 @@ 'use strict'; | ||
}, | ||
editor: { | ||
configurable: true, | ||
enumerable: true, | ||
get: function() { | ||
return this.filterEditor; | ||
}, | ||
set: function(value) { | ||
this.filterEditor = value; | ||
} | ||
}, | ||
rightIcon: { | ||
@@ -340,0 +350,0 @@ configurable: true, |
@@ -385,3 +385,3 @@ /* eslint-env browser */ | ||
getEditorValue: function(str) { | ||
return this.localizer.parse(str); | ||
return this.localizer.parse(str || this.input.value); | ||
}, | ||
@@ -397,3 +397,3 @@ | ||
validateEditorValue: function(str) { | ||
return this.localizer.invalid && this.localizer.invalid(str); | ||
return this.localizer.invalid && this.localizer.invalid(str || this.input.value); | ||
}, | ||
@@ -400,0 +400,0 @@ |
@@ -13,3 +13,2 @@ 'use strict'; | ||
* @summary The default cell rendering function for a button cell. | ||
* @implements paintFunction | ||
* @memberOf Button.prototype | ||
@@ -16,0 +15,0 @@ */ |
@@ -25,3 +25,5 @@ 'use strict'; | ||
this.add(require('./ErrorCell')); | ||
this.add(require('./Tag')); | ||
this.add(require('./TreeCell')); | ||
this.add('emptycell', this.BaseClass); // remove this when deprecation below retired | ||
}, | ||
@@ -40,3 +42,10 @@ | ||
get: function(name) { | ||
if (name && name.toLowerCase() === 'emptycell') { | ||
if (name.map) { | ||
return name.map(function(name) { | ||
return Registry.prototype.get.call(this, name); | ||
}, this); | ||
} | ||
var cellRenderer = Registry.prototype.get.call(this, name); | ||
if (cellRenderer === this.items.emptycell) { | ||
if (!warnedBaseClass) { | ||
@@ -47,5 +56,4 @@ console.warn('grid.cellRenderers.get("' + name + '").constructor has been deprecated as of v2.1.0 in favor of grid.cellRenderers.BaseClass property. (Will be removed in a future release.)'); | ||
this.BaseClass.constructor = this.BaseClass; | ||
return this.BaseClass; | ||
} | ||
return Registry.prototype.get.call(this, name); | ||
return cellRenderer; | ||
} | ||
@@ -52,0 +60,0 @@ |
@@ -13,3 +13,2 @@ 'use strict'; | ||
* @desc A rendering of the last Selection Model | ||
* @implements paintFunction | ||
* @memberOf LastSelection.prototype | ||
@@ -16,0 +15,0 @@ */ |
@@ -17,3 +17,2 @@ 'use strict'; | ||
* @desc Great care has been taken in crafting this function as it needs to perform extremely fast. Reads on the gc object are expensive but not quite as expensive as writes to it. We do our best to avoid writes, then avoid reads. Clipping bounds are not set here as this is also an expensive operation. Instead, we truncate overflowing text and content by filling a rectangle with background color column by column instead of cell by cell. This column by column fill happens higher up on the stack in a calling function from fin-hypergrid-renderer. Take note we do not do cell by cell border rendering as that is expensive. Instead we render many fewer gridlines after all cells are rendered. | ||
* @implements paintFunction | ||
* @memberOf SimpleCell.prototype | ||
@@ -20,0 +19,0 @@ */ |
@@ -13,3 +13,2 @@ 'use strict'; | ||
* @desc Emerson's paint function for a slider button. currently the user cannot interact with it | ||
* @implements paintFunction | ||
* @memberOf Slider.prototype | ||
@@ -16,0 +15,0 @@ */ |
@@ -13,3 +13,2 @@ 'use strict'; | ||
* @desc A simple implementation of a sparkline, because it's a barchart we've changed the name ;). | ||
* @implements paintFunction | ||
* @memberOf SparkBar.prototype | ||
@@ -16,0 +15,0 @@ */ |
@@ -13,3 +13,2 @@ 'use strict'; | ||
* @desc A simple implementation of a sparkline. see [Edward Tufte sparkline](http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR) | ||
* @implements paintFunction | ||
* @memberOf SparkLine.prototype | ||
@@ -16,0 +15,0 @@ */ |
@@ -13,3 +13,2 @@ 'use strict'; | ||
* @desc A simple implementation of a tree cell renderer for use mainly with the tree column. | ||
* @implements paintFunction | ||
* @memberOf TreeCell.prototype | ||
@@ -16,0 +15,0 @@ */ |
@@ -368,2 +368,9 @@ 'use strict'; | ||
* @default | ||
* @type {string} | ||
* @memberOf module:defaults | ||
*/ | ||
filterEditor: undefined, | ||
/** | ||
* @default | ||
* @type {boolean} | ||
@@ -370,0 +377,0 @@ * @memberOf module:defaults |
@@ -102,3 +102,3 @@ /* eslint-env browser */ | ||
document.body.appendChild(dragger); | ||
draggerCTX = dragger.getContext('2d'); | ||
draggerCTX = dragger.getContext('2d', { alpha: false }); | ||
} | ||
@@ -112,3 +112,3 @@ if (!floatColumn) { | ||
document.body.appendChild(floatColumn); | ||
floatColumnCTX = floatColumn.getContext('2d'); | ||
floatColumnCTX = floatColumn.getContext('2d', { alpha: false }); | ||
} | ||
@@ -115,0 +115,0 @@ |
@@ -69,8 +69,11 @@ 'use strict'; | ||
handleMouseDown: function(grid, event) { | ||
var rowSelectable = grid.properties.rowSelection && | ||
!event.primitiveEvent.detail.isRightClick && ( | ||
grid.properties.autoSelectRows || | ||
grid.properties.showRowNumbers && event.isHandleColumn | ||
); | ||
var leftClick = !event.primitiveEvent.detail.isRightClick, | ||
rowNumberClick = leftClick && grid.properties.showRowNumbers && event.isHandleColumn; | ||
if (rowNumberClick && !grid.fireSyntheticRowHeaderClickedEvent(event)) { | ||
return; | ||
} | ||
var rowSelectable = grid.properties.rowSelection && (leftClick && grid.properties.autoSelectRows || rowNumberClick); | ||
if (rowSelectable && event.isHeaderHandle) { | ||
@@ -77,0 +80,0 @@ //global row selection |
@@ -25,3 +25,3 @@ /* eslint-env browser */ | ||
function Canvas(div, component) { | ||
function Canvas(div, component, contextAttributes) { | ||
var self = this; | ||
@@ -41,4 +41,4 @@ | ||
// create and append the canvas | ||
this.gc = getCachedContext(this.canvas = document.createElement('canvas')); | ||
this.bc = getCachedContext(this.buffer = document.createElement('canvas')); | ||
this.gc = getCachedContext(this.canvas = document.createElement('canvas'), contextAttributes); | ||
this.bc = getCachedContext(this.buffer = document.createElement('canvas'), contextAttributes); | ||
@@ -796,4 +796,4 @@ this.div.appendChild(this.canvas); | ||
function getCachedContext(canvasElement, type) { | ||
var gc = canvasElement.getContext(type || '2d'), | ||
function getCachedContext(canvasElement, contextAttributes) { | ||
var gc = canvasElement.getContext('2d', contextAttributes), | ||
props = {}, | ||
@@ -800,0 +800,0 @@ values = {}; |
@@ -9,2 +9,8 @@ /* eslint-env browser */ | ||
/** | ||
* Additions to `Hypergrid.prototype` for handling and firing events. | ||
* | ||
* All members are documented on the {@link Hypergrid} page. | ||
* @mixin events.mixin | ||
*/ | ||
module.exports = { | ||
@@ -155,2 +161,6 @@ | ||
fireSyntheticRowHeaderClickedEvent: function(event) { | ||
return dispatchEvent.call(this, 'fin-row-header-clicked', true, {}, event); | ||
}, | ||
/** | ||
@@ -157,0 +167,0 @@ * @memberOf Hypergrid# |
@@ -41,3 +41,11 @@ 'use strict'; | ||
return (this.items[name] = item); | ||
this.items[name] = item; | ||
// update existing keys that differ only in case | ||
name = name.toLowerCase(); | ||
Object.keys(this.items) | ||
.filter(function(key) { return key.toLowerCase() === name; }) | ||
.forEach(function(key) { this.items[key] = item; }, this); | ||
return item; | ||
}, | ||
@@ -53,3 +61,3 @@ | ||
addSynonym: function(synonymName, existingName) { | ||
return (this.items[synonymName] = this.get(existingName)); | ||
return (this.items[synonymName] = this.items[existingName]); | ||
}, | ||
@@ -56,0 +64,0 @@ |
@@ -7,3 +7,5 @@ 'use strict'; | ||
* Additions to `Hypergrid.prototype` for scrollbar support. | ||
* @mixin | ||
* | ||
* All members are documented on the {@link Hypergrid} page. | ||
* @mixin scrolling.mixin | ||
*/ | ||
@@ -27,3 +29,4 @@ exports.mixin = { | ||
/** | ||
* @property {fin-vampire-bar} sbVScroller - An instance of {@link https://github.com/openfin/finbars|FinBar}. | ||
* The verticl scroll bar model/controller. | ||
* @type {FinBar} | ||
* @memberOf Hypergrid# | ||
@@ -34,2 +37,9 @@ */ | ||
/** | ||
* The horizontal scroll bar model/controller. | ||
* @type {FinBar} | ||
* @memberOf Hypergrid# | ||
*/ | ||
sbHScroller: null, | ||
/** | ||
* The previous value of sbVScrollVal. | ||
@@ -36,0 +46,0 @@ * @type {number} |
@@ -7,2 +7,8 @@ /* eslint-env browser */ | ||
/** | ||
* Additions to `Hypergrid.prototype` for modeling cell, row, and column selections. | ||
* | ||
* All members are documented on the {@link Hypergrid} page. | ||
* @mixin selection.mixin | ||
*/ | ||
module.exports = { | ||
@@ -9,0 +15,0 @@ selectionInitialize: function() { |
@@ -84,2 +84,6 @@ 'use strict'; | ||
// gc.clipRestore(clipToGrid); | ||
if (this.grid.properties.boxSizing === 'border-box') { | ||
this.paintGridlines(gc); | ||
} | ||
} | ||
@@ -86,0 +90,0 @@ |
@@ -10,3 +10,3 @@ 'use strict'; | ||
* | ||
* Then, if there are any columns with their own background color _that differs from the grid background color,_ these are consolidated and the consolidated groups of column backgrounds are all drawn before iterating through cells. Note that these column rects are _not_ suitable for clipping overflow text from previous columns. If you have overflow text, either turn on clipping (big performance hit) or turn on one of the `truncateTextWithEllipsis` options. | ||
* Then, if there are any columns with their own background color _that differs from the grid background color,_ these are consolidated and the consolidated groups of column backgrounds are all drawn before iterating through cells. Note that these column rects are _not_ suitable for clipping overflow text from previous columns. If you have overflow text, either turn on clipping (`grid.properties.columnClip = true` but big performance hit) or turn on one of the `truncateTextWithEllipsis` options. | ||
* | ||
@@ -13,0 +13,0 @@ * `try...catch` surrounds each cell paint in case a cell renderer throws an error. |
@@ -1105,3 +1105,9 @@ /* eslint-env browser */ | ||
// Render the cell | ||
cellRenderer.paint(gc, config); | ||
if (cellRenderer.forEach) { | ||
cellRenderer.forEach(function(subrenderer) { | ||
subrenderer.paint(gc, config); | ||
}); | ||
} else { | ||
cellRenderer.paint(gc, config); | ||
} | ||
@@ -1108,0 +1114,0 @@ // Following supports partial render: |
@@ -166,3 +166,5 @@ 'use strict'; | ||
* Additions to `Hypergrid.prototype` for setting an instance theme. | ||
* @mixin | ||
* | ||
* All members are documented on the {@link Hypergrid} page. | ||
* @mixin themes.mixin | ||
*/ | ||
@@ -222,4 +224,6 @@ var mixin = { | ||
/** | ||
* Shared properties of `Hypergrid` for registering themes and setting a global theme. | ||
* @mixin | ||
* Shared properties of `Hypergrid` "class" (_i.e.,_ "static" properties of constructor function) for registering themes and setting a global theme. | ||
* | ||
* All members are documented on the {@link Hypergrid} page (annotated as "(static)"). | ||
* @mixin themes.sharedMixin | ||
*/ | ||
@@ -235,3 +239,2 @@ var sharedMixin = { | ||
* ``` | ||
* @this {Hypergrid.constructor} | ||
* @memberOf Hypergrid. | ||
@@ -279,3 +282,3 @@ */ | ||
* the `defaults` layer at the bottom of the properties hierarchy. | ||
* @this {Hypergrid.constructor} | ||
* @this {Hypergrid.} | ||
* @param {object|string} [theme=registry.default] - One of: | ||
@@ -282,0 +285,0 @@ * * **string:** A registered theme name. |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3295072
11
91
46376
27
3
4
2
- Removedchai@^3.5.0
- Removedassertion-error@1.1.0(transitive)
- Removedchai@3.5.0(transitive)
- Removeddeep-eql@0.1.3(transitive)
- Removedtype-detect@0.1.11.0.0(transitive)