From d2bdf065390084a74cfe83a1ffb34c9d0ca3ee4e Mon Sep 17 00:00:00 2001
From: Krzysztof Budnik
Date: Thu, 3 Mar 2016 16:32:51 +0100
Subject: [PATCH 1/2] Added demos for Handsontable PRO and fixed tests
---
demo/js/demos.js | 29 ++++++++++++++++++-
index.html | 23 +++++++++++++--
.../hotTable/watchingOptions.spec.js | 3 +-
3 files changed, 50 insertions(+), 5 deletions(-)
diff --git a/demo/js/demos.js b/demo/js/demos.js
index 508610d9..87166c30 100644
--- a/demo/js/demos.js
+++ b/demo/js/demos.js
@@ -105,6 +105,33 @@
title: 'Custom renderer',
description: 'Custom renderer'
},
- }
+ },
+ 'PRO': {
+ 'collapsing-columns-with-nested-headers': {
+ url: getUrl('wilani/3'),
+ title: 'Collapsing columns with nested headers',
+ description: 'Create a nested, hierarchical structure of headers with expandable and collapsible columns'
+ },
+ 'filtering-simple': {
+ url: getUrl('fijida/3'),
+ title: 'Data filtering (simple example)',
+ description: 'Display rows that meet your criteria and hide the rest'
+ },
+ 'filtering-external-inputs': {
+ url: getUrl('rewefa/9'),
+ title: 'Data filtering (external inputs)',
+ description: 'Display rows that meet your criteria and hide the rest'
+ },
+ 'hiding-columns': {
+ url: getUrl('wapufa/2'),
+ title: 'Hiding columns',
+ description: 'Hide specific columns and show the rest'
+ },
+ 'hiding-rows': {
+ url: getUrl('roximi/3'),
+ title: 'Hiding rows',
+ description: 'Hide specific rows and show the rest'
+ },
+ },
};
}());
diff --git a/index.html b/index.html
index 987d6f3b..6deaa447 100644
--- a/index.html
+++ b/index.html
@@ -132,9 +132,26 @@ Code
It's recommended to put all your settings in one big object (settings="ctrl.settings"
).
Settings attribute unlike any other attributes is not watched so using this can be helpful to achieve higher performance.
-
- Click here to see more examples.
-
+
+ More demos
+
+
+ PRO features
+
+ To install Handsontable PRO overwrite regular handsontable version with new one:
+
+ $ bower install handsontable=git@git.handsontable.com:handsontable/handsontable-pro.git --save
+
+ If you don't have license for Pro yet, please click here for more info.
diff --git a/test/directives/hotTable/watchingOptions.spec.js b/test/directives/hotTable/watchingOptions.spec.js
index 2b8f8f4e..aff99bc8 100644
--- a/test/directives/hotTable/watchingOptions.spec.js
+++ b/test/directives/hotTable/watchingOptions.spec.js
@@ -20,7 +20,8 @@ describe('hotTable - Watching options', function() {
scope.$digest();
- expect(scope.hotInstance.getData()).toBe(rootScope.value);
+ expect(scope.hotInstance.getSourceData()).toBe(rootScope.value);
+ expect(scope.hotInstance.getData()).toEqual([[null]]);
});
it('should create table with `dataSchema` attribute', function() {
From 30c823356c4dc8597a7ed04a3b38569451825d88 Mon Sep 17 00:00:00 2001
From: Krzysztof Budnik
Date: Thu, 3 Mar 2016 16:36:34 +0100
Subject: [PATCH 2/2] 0.9.0
---
bower.json | 2 +-
demo/build/app.js | 31 +++++++++++++++++++++++++++++--
dist/ngHandsontable.js | 4 ++--
dist/ngHandsontable.min.js | 4 ++--
package.json | 2 +-
5 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/bower.json b/bower.json
index fc16eb44..c4bd8557 100644
--- a/bower.json
+++ b/bower.json
@@ -2,7 +2,7 @@
"name": "ngHandsontable",
"dependencies": {
"angular": "~1.4",
- "handsontable": "~0.22.0"
+ "handsontable": "~0.23.0"
},
"homepage": "https://github.com/handsontable/ngHandsontable",
"authors": [
diff --git a/demo/build/app.js b/demo/build/app.js
index e589531c..89a65bf7 100644
--- a/demo/build/app.js
+++ b/demo/build/app.js
@@ -38,7 +38,7 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ
}
config.$inject = ['$sceDelegateProvider', '$httpProvider', '$stateProvider', '$compileProvider', '$urlRouterProvider', 'demoMapProvider'];
- app.constant('version', 'v0.8.0');
+ app.constant('version', 'v0.9.0');
app.config(config);
angular.element(document).ready(function() {
@@ -346,7 +346,34 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ
title: 'Custom renderer',
description: 'Custom renderer'
},
- }
+ },
+ 'PRO': {
+ 'collapsing-columns-with-nested-headers': {
+ url: getUrl('wilani/3'),
+ title: 'Collapsing columns with nested headers',
+ description: 'Create a nested, hierarchical structure of headers with expandable and collapsible columns'
+ },
+ 'filtering-simple': {
+ url: getUrl('fijida/3'),
+ title: 'Data filtering (simple example)',
+ description: 'Display rows that meet your criteria and hide the rest'
+ },
+ 'filtering-external-inputs': {
+ url: getUrl('rewefa/9'),
+ title: 'Data filtering (external inputs)',
+ description: 'Display rows that meet your criteria and hide the rest'
+ },
+ 'hiding-columns': {
+ url: getUrl('wapufa/2'),
+ title: 'Hiding columns',
+ description: 'Hide specific columns and show the rest'
+ },
+ 'hiding-rows': {
+ url: getUrl('roximi/3'),
+ title: 'Hiding rows',
+ description: 'Hide specific rows and show the rest'
+ },
+ },
};
}());
diff --git a/dist/ngHandsontable.js b/dist/ngHandsontable.js
index 15545851..ccfa8736 100644
--- a/dist/ngHandsontable.js
+++ b/dist/ngHandsontable.js
@@ -1,11 +1,11 @@
/**
- * ngHandsontable 0.8.0
+ * ngHandsontable 0.9.0
*
* Copyright 2012-2015 Marcin Warpechowski
* Copyright 2015 Handsoncode sp. z o.o.
* Licensed under the MIT license.
* https://github.com/handsontable/ngHandsontable
- * Date: Thu Feb 11 2016 16:39:03 GMT+0100 (CET)
+ * Date: Thu Mar 03 2016 16:35:01 GMT+0100 (CET)
*/
if (document.all && !document.addEventListener) { // IE 8 and lower
diff --git a/dist/ngHandsontable.min.js b/dist/ngHandsontable.min.js
index 5be5e81d..3030a718 100644
--- a/dist/ngHandsontable.min.js
+++ b/dist/ngHandsontable.min.js
@@ -1,11 +1,11 @@
/**
- * ngHandsontable 0.8.0
+ * ngHandsontable 0.9.0
*
* Copyright 2012-2015 Marcin Warpechowski
* Copyright 2015 Handsoncode sp. z o.o.
* Licensed under the MIT license.
* https://github.com/handsontable/ngHandsontable
- * Date: Thu Feb 11 2016 16:39:03 GMT+0100 (CET)
+ * Date: Thu Mar 03 2016 16:35:01 GMT+0100 (CET)
*/
document.all&&!document.addEventListener&&(document.createElement("hot-table"),document.createElement("hot-column"),document.createElement("hot-autocomplete")),angular.module("ngHandsontable.services",[]),angular.module("ngHandsontable.directives",[]),angular.module("ngHandsontable",["ngHandsontable.services","ngHandsontable.directives"]),Handsontable.hooks.add("afterContextMenuShow",function(){Handsontable.eventManager.isHotTableEnv=!1}),function(){function a(a){return{parseAutoComplete:function(b,c,d){b.source=function(e,f){var g=this.instance.getSelected()[0],h=[],i=c[g];if(i){var j=b.optionList;if(j&&j.object){if(angular.isArray(j.object))h=j.object;else{var k=a(j.object)(i);if(angular.isArray(k))if(d)for(var l=0,m=k.length;m>l;l++){var n=k[l][j.property];null!==n&&void 0!==n&&h.push(n)}else h=k;else h=k}f(h)}}}}}}a.$inject=["$parse"],angular.module("ngHandsontable.services").factory("autoCompleteFactory",a)}(),function(){function a(){var a={};return{getInstance:function(b){return a[b]},registerInstance:function(b,c){a[b]=c},removeInstance:function(b){a[b]=void 0}}}a.$inject=[],angular.module("ngHandsontable.services").factory("hotRegisterer",a)}(),function(){function a(a){return a.replace(/[A-Z]/g,function(a){return"-"+a.charAt(0).toLowerCase()})}function b(a){return a.substr(0,1).toUpperCase()+a.substr(1,a.length-1)}function c(c){return{containerClassName:"handsontable-container",initializeHandsontable:function(a,b){var d,e=document.createElement("div");return e.className=this.containerClassName,a[0].appendChild(e),d=new Handsontable(e,b),b.hotId&&c.registerInstance(b.hotId,d),d},updateHandsontableSettings:function(a,b){a&&a.updateSettings(b)},renderHandsontable:function(a){a&&a.render()},mergeSettingsFromScope:function(a,b){var c,d,e,f=angular.extend({},b);for(a=a||{},angular.extend(f,b.settings||{}),c=this.getAvailableSettings(),d=0,e=c.length;e>d;d++)"undefined"!=typeof f[c[d]]&&(a[c[d]]=f[c[d]]);return a},mergeHooksFromScope:function(a,c){var d,e,f,g,h=angular.extend({},c);for(a=a||{},angular.extend(h,c.settings||{}),d=this.getAvailableHooks(),e=0,f=d.length;f>e;e++)g="on"+b(d[e]),("function"==typeof h[d[e]]||"function"==typeof h[g])&&(a[d[e]]=h[d[e]]||h[g]);return a},trimScopeDefinitionAccordingToAttrs:function(a,b){for(var c in a)a.hasOwnProperty(c)&&void 0===b[c]&&void 0===b[a[c].substr(1,a[c].length)]&&delete a[c];return a},getTableScopeDefinition:function(){var a={};return this.applyAvailableSettingsScopeDef(a),this.applyAvailableHooksScopeDef(a),a.datarows="=",a.dataschema="=",a.observeDomVisibility="=",a},getColumnScopeDefinition:function(){var a={};return this.applyAvailableSettingsScopeDef(a),a.data="@",a},applyAvailableSettingsScopeDef:function(a){var b,c,d;for(b=this.getAvailableSettings(),c=0,d=b.length;d>c;c++)a[b[c]]="=";return a},applyAvailableHooksScopeDef:function(a){var c,d,e;for(c=this.getAvailableHooks(),d=0,e=c.length;e>d;d++)a[c[d]]="=on"+b(c[d]);return a},getAvailableSettings:function(b){var c=Object.keys(Handsontable.DefaultSettings.prototype);return-1===c.indexOf("contextMenuCopyPaste")&&c.push("contextMenuCopyPaste"),-1===c.indexOf("handsontable")&&c.push("handsontable"),c.indexOf("settings")>=0&&c.splice(c.indexOf("settings"),1),b&&(c=c.map(a)),c},getAvailableHooks:function(b){var c=Handsontable.hooks.getRegistered();return b&&(c=c.map(function(b){return"on-"+a(b)})),c}}}c.$inject=["hotRegisterer"],angular.module("ngHandsontable.services").factory("settingFactory",c)}(),function(){function a(){return{restrict:"EA",scope:!0,require:"^hotColumn",link:function(a,b,c,d){var e=c.datarows;d.setColumnOptionList(e)}}}a.$inject=[],angular.module("ngHandsontable.directives").directive("hotAutocomplete",a)}(),function(){function a(a){return{restrict:"EA",require:"^hotTable",scope:{},controller:["$scope",function(a){this.setColumnOptionList=function(b){a.column||(a.column={});var c={},d=b.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)\s*$/);d?(c.property=d[1],c.object=d[2]):c.object=b.split(","),a.column.optionList=c}}],compile:function(b,c){var d=this;return this.scope=a.trimScopeDefinitionAccordingToAttrs(a.getColumnScopeDefinition(),c),angular.forEach(Object.keys(this.scope),function(a){d.$$isolateBindings[a]={attrName:a,collection:!1,mode:"data"===a?"@":"=",optional:!1}}),function(b,c,d,e){var f={};angular.forEach(Object.keys(d),function(a){"$"!==a.charAt(0)&&""===d[a]&&(f[a]=!0)}),a.mergeSettingsFromScope(f,b),b.column||(b.column={}),angular.extend(b.column,f),e.setColumnSetting(b.column),b.$on("$destroy",function(){e.removeColumnSetting(b.column)})}}}}a.$inject=["settingFactory"],angular.module("ngHandsontable.directives").directive("hotColumn",a)}(),function(){function a(a,b,c,d){return{restrict:"EA",scope:{},priority:-400,controller:["$scope",function(b){this.setColumnSetting=function(c){b.htSettings||(b.htSettings={}),b.htSettings.columns||(b.htSettings.columns=[]),b.htSettings.columns.push(c),a.updateHandsontableSettings(b.hotInstance,b.htSettings)},this.removeColumnSetting=function(c){b.htSettings.columns.indexOf(c)>-1&&(b.htSettings.columns.splice(b.htSettings.columns.indexOf(c),1),a.updateHandsontableSettings(b.hotInstance,b.htSettings))}}],compile:function(e,f){var g,h=this;return this.scope=a.trimScopeDefinitionAccordingToAttrs(a.getTableScopeDefinition(),f),g=Object.keys(this.scope),angular.forEach(g,function(a){var b=h.scope[a].charAt(0);h.$$isolateBindings[a]={attrName:h.scope[a].length>1?h.scope[a].substr(1,h.scope[a].length):a,collection:"datarows"===a,mode:b,optional:!1}}),function(e,f,h){if(e.settings=d(h.settings)(e.$parent),e.htSettings||(e.htSettings={}),angular.forEach(Object.keys(h),function(a){"$"!==a.charAt(0)&&""===h[a]&&(e.htSettings[a]=!0)}),a.mergeSettingsFromScope(e.htSettings,e),a.mergeHooksFromScope(e.htSettings,e),e.htSettings.data||(e.htSettings.data=e.datarows),e.htSettings.dataSchema=e.dataschema,e.htSettings.hotId=h.hotId,e.htSettings.observeDOMVisibility=e.observeDomVisibility,e.htSettings.columns)for(var i=0,j=e.htSettings.columns.length;j>i;i++){var k=e.htSettings.columns[i];if("autocomplete"===k.type&&k.optionList){if("string"==typeof k.optionList){var l={},m=k.optionList.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)\s*$/);m?(l.property=m[1],l.object=m[2]):l.object=l,k.optionList=l}b.parseAutoComplete(k,e.datarows,!0)}}var n=e.htSettings.afterChange;e.htSettings.afterChange=function(){n&&n.apply(this,arguments),c.$$phase||e.$apply()},e.hotInstance=a.initializeHandsontable(f,e.htSettings),angular.forEach(g,function(b){e.$watch(b,function(c,d){void 0!==c&&("datarows"===b?e.hotInstance.getSettings().data===c?a.renderHandsontable(e.hotInstance):(e.hotInstance.loadData(c),e.htSettings.data=c):c!==d&&(e.htSettings[b]=c,a.updateHandsontableSettings(e.hotInstance,e.htSettings)))},["datarows","columns","rowHeights","colWidths","rowHeaders","colHeaders"].indexOf(b)>=0)}),e.$watchCollection("datarows",function(b,c){c&&c.length===e.htSettings.minSpareRows&&b.length!==e.htSettings.minSpareRows&&(e.htSettings.data=e.datarows,a.updateHandsontableSettings(e.hotInstance,e.htSettings))})}}}}a.$inject=["settingFactory","autoCompleteFactory","$rootScope","$parse"],angular.module("ngHandsontable.directives").directive("hotTable",a)}();
\ No newline at end of file
diff --git a/package.json b/package.json
index 4709a7c8..dac8fcd0 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
"url": "https://github.com/handsontable/ngHandsontable/issues"
},
"author": "Marcin Warpechowski ",
- "version": "0.8.0",
+ "version": "0.9.0",
"devDependencies": {
"angular": "^1.4.2",
"angular-mocks": "^1.4.2",