@coolon/angular-ui-powerups 2.0.0-alpha.19 → 2.0.0-alpha.20
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/CHANGELOG.md +7 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +30 -0
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/index.js.map +1 -1
- package/esm2015/lib/components/index.metadata.json +1 -1
- package/esm2015/lib/components/table/column-model.js +29 -0
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/table/mutable-cell-renderer.js +1 -0
- package/esm2015/lib/components/table/mutable-cell-renderer.js.map +1 -0
- package/esm2015/lib/components/table/mutable-cell-renderer.metadata.json +1 -0
- package/esm5/lib/components/index.js.map +1 -1
- package/esm5/lib/components/table/column-model.js +30 -0
- package/esm5/lib/components/table/column-model.js.map +1 -1
- package/esm5/lib/components/table/mutable-cell-renderer.js +1 -0
- package/esm5/lib/components/table/mutable-cell-renderer.js.map +1 -0
- package/fesm2015/coolon-angular-ui-powerups.js +29 -0
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +30 -0
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/table/column-model.d.ts +13 -15
- package/lib/components/table/mutable-cell-renderer.d.ts +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.0.0-alpha.20](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.19...v2.0.0-alpha.20) (2020-08-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* added support for mutable cell renderers for live table editing ([ce4e932](https://bitbucket.org/coolon/angular-ui-powerups/commit/ce4e93233a4240403b78a8c4b234744f140c202e))
|
|
11
|
+
|
|
5
12
|
## [2.0.0-alpha.19](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.18...v2.0.0-alpha.19) (2020-08-11)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -1860,6 +1860,7 @@
|
|
|
1860
1860
|
var noop = function () {
|
|
1861
1861
|
};
|
|
1862
1862
|
var ɵ0 = noop;
|
|
1863
|
+
var CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol("aup-cell-renderer:row-data-cache");
|
|
1863
1864
|
var ColumnModel = /** @class */ (function () {
|
|
1864
1865
|
function ColumnModel(columnId, defaults) {
|
|
1865
1866
|
this.columnId = columnId;
|
|
@@ -1977,6 +1978,35 @@
|
|
|
1977
1978
|
}));
|
|
1978
1979
|
return this;
|
|
1979
1980
|
};
|
|
1981
|
+
PropertyColumnModel.prototype.mutableCellRenderer = function (componentType, options) {
|
|
1982
|
+
var _this = this;
|
|
1983
|
+
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, function (component, rowData, firstTime) {
|
|
1984
|
+
// keep a local copy most recent row value so it's available to teh
|
|
1985
|
+
// edit callback without having to add/remove subscribers all the time.
|
|
1986
|
+
component[CELL_RENDERER_COMPONENT_ROW_CACHE] = rowData.row;
|
|
1987
|
+
var disableEditCallback = false;
|
|
1988
|
+
if (firstTime) {
|
|
1989
|
+
if (___default__default.isFunction(options === null || options === void 0 ? void 0 : options.onComponentInit)) {
|
|
1990
|
+
options.onComponentInit(component);
|
|
1991
|
+
}
|
|
1992
|
+
// install our edit callback
|
|
1993
|
+
component.onValueEdited(function (is, was) {
|
|
1994
|
+
if (!disableEditCallback) {
|
|
1995
|
+
options.onValueEdit(component[CELL_RENDERER_COMPONENT_ROW_CACHE], is, was);
|
|
1996
|
+
}
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
// now push the value the component and disable the callback just incase the component misbehaves
|
|
2000
|
+
// and fires a value change during the operation.
|
|
2001
|
+
disableEditCallback = true;
|
|
2002
|
+
component.value = rowData.row[_this.property];
|
|
2003
|
+
disableEditCallback = false;
|
|
2004
|
+
if (!___default__default.isFunction(options) && ___default__default.isFunction(options === null || options === void 0 ? void 0 : options.onRowUpdate)) {
|
|
2005
|
+
options.onRowUpdate(component, rowData.row);
|
|
2006
|
+
}
|
|
2007
|
+
}));
|
|
2008
|
+
return this;
|
|
2009
|
+
};
|
|
1980
2010
|
PropertyColumnModel.prototype.cellEditor = function (editor, validatorsOrInitialiser, onComponentInit) {
|
|
1981
2011
|
var _this = this;
|
|
1982
2012
|
var validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
|