@wavemaker/angular-codegen 11.0.0-next.138551 → 11.0.0-next.138552
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.
- angular-codegen/angular-app/package-lock.json +3 -0
- angular-codegen/angular-app/package.json +1 -1
- angular-codegen/angular-app/src/assets/styles/css/wm-style.css +1 -1
- angular-codegen/dependencies/transpilation-mobile.cjs.js +47 -4
- angular-codegen/dependencies/transpilation-web.cjs.js +47 -4
- angular-codegen/package.json +1 -1
|
@@ -43911,6 +43911,16 @@ class PaginationService {
|
|
|
43911
43911
|
*/
|
|
43912
43912
|
updateFieldsOnPagination(parent, newVal) {
|
|
43913
43913
|
let fieldDefs = parent.widgetType === 'wm-table' ? parent.gridData : parent.fieldDefs;
|
|
43914
|
+
// remove the deleted row from the list
|
|
43915
|
+
if (parent.widgetType === 'wm-table' && (parent.gridOptions.isNavTypeScrollOrOndemand()) && parent.gridOptions.deletedRowIndex !== -1) {
|
|
43916
|
+
fieldDefs.splice(parent.gridOptions.deletedRowIndex, 1);
|
|
43917
|
+
parent.gridOptions.setDeletedRowIndex(-1);
|
|
43918
|
+
}
|
|
43919
|
+
// reset fieldDefs if last action performed is search or sort
|
|
43920
|
+
if (parent.widgetType === 'wm-table' && (parent.gridOptions.isNavTypeScrollOrOndemand()) && parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.SEARCH_OR_SORT) {
|
|
43921
|
+
fieldDefs = [];
|
|
43922
|
+
parent.gridOptions.setCurrentPage(1);
|
|
43923
|
+
}
|
|
43914
43924
|
let currentPage = parent.currentPage;
|
|
43915
43925
|
const dataNavigator = parent.dataNavigator;
|
|
43916
43926
|
const pagesize = parent.pagesize;
|
|
@@ -43931,11 +43941,11 @@ class PaginationService {
|
|
|
43931
43941
|
newVal = [];
|
|
43932
43942
|
}
|
|
43933
43943
|
else if (dataNavigator.dataSize < currentPage * pagesize) {
|
|
43934
|
-
// if number of elements added to
|
|
43944
|
+
// if number of elements added to dataNavigator is less than product of currentPage and pageSize we only add elements extra elements added
|
|
43935
43945
|
itemsLength = dataNavigator.dataSize - fieldDefs.length;
|
|
43936
43946
|
}
|
|
43937
43947
|
else {
|
|
43938
|
-
// if number of elements added to
|
|
43948
|
+
// if number of elements added to dataNavigator is greater than product of currentPage and pageSize we add elements the extra elements in newVal
|
|
43939
43949
|
itemsLength = currentPage * pagesize - fieldDefs.length;
|
|
43940
43950
|
currentPage++;
|
|
43941
43951
|
}
|
|
@@ -43948,9 +43958,36 @@ class PaginationService {
|
|
|
43948
43958
|
}
|
|
43949
43959
|
newVal = itemsToPush;
|
|
43950
43960
|
}
|
|
43951
|
-
|
|
43961
|
+
// Add unique records to fieldDefs
|
|
43962
|
+
if (parent.widgetType === 'wm-table' && (parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.DELETE || parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.EDIT)) {
|
|
43963
|
+
fieldDefs = this.getUniqueRecordsInFieldDef(fieldDefs, newVal);
|
|
43964
|
+
}
|
|
43965
|
+
else {
|
|
43966
|
+
fieldDefs = [...fieldDefs, ...newVal];
|
|
43967
|
+
}
|
|
43952
43968
|
return [fieldDefs, currentPage];
|
|
43953
43969
|
}
|
|
43970
|
+
// Add the unique records to fieldDefs
|
|
43971
|
+
getUniqueRecordsInFieldDef(fieldDefs, newVal) {
|
|
43972
|
+
let flag = false;
|
|
43973
|
+
if (!fieldDefs.length) {
|
|
43974
|
+
fieldDefs = newVal;
|
|
43975
|
+
}
|
|
43976
|
+
else {
|
|
43977
|
+
newVal.forEach(function (newObj) {
|
|
43978
|
+
flag = false;
|
|
43979
|
+
fieldDefs.forEach(function (obj) {
|
|
43980
|
+
if (_.isEqual(newObj, obj)) {
|
|
43981
|
+
flag = true;
|
|
43982
|
+
}
|
|
43983
|
+
});
|
|
43984
|
+
if (flag === false) {
|
|
43985
|
+
fieldDefs.push(newObj);
|
|
43986
|
+
}
|
|
43987
|
+
});
|
|
43988
|
+
}
|
|
43989
|
+
return fieldDefs;
|
|
43990
|
+
}
|
|
43954
43991
|
/**
|
|
43955
43992
|
* @description
|
|
43956
43993
|
* This function registers scroll events on the scrollable el, if the page doesn't have a scroll el then wheel event is registered on the requested node
|
|
@@ -43993,6 +44030,9 @@ class PaginationService {
|
|
|
43993
44030
|
let scrollTop;
|
|
43994
44031
|
// scrollingElement is undefined for IE, safari. use body as target Element
|
|
43995
44032
|
target = target === document ? (target.scrollingElement || document.body) : target;
|
|
44033
|
+
if (parent.widgetType === 'wm-table' && parent.gridOptions.isNavTypeScrollOrOndemand()) {
|
|
44034
|
+
evt.stopPropagation();
|
|
44035
|
+
}
|
|
43996
44036
|
clientHeight = target.clientHeight;
|
|
43997
44037
|
totalHeight = target.scrollHeight;
|
|
43998
44038
|
scrollTop = target === document.body ? $(window).scrollTop() : target.scrollTop;
|
|
@@ -44007,6 +44047,9 @@ class PaginationService {
|
|
|
44007
44047
|
else {
|
|
44008
44048
|
// if there is no scrollable element register wheel event on ul element
|
|
44009
44049
|
$rootEl.on('wheel.scroll_evt', e => {
|
|
44050
|
+
if (parent.widgetType === 'wm-table' && parent.gridOptions.isNavTypeScrollOrOndemand()) {
|
|
44051
|
+
e.stopPropagation();
|
|
44052
|
+
}
|
|
44010
44053
|
if (e.originalEvent.deltaY > 0) {
|
|
44011
44054
|
$rootEl.off('wheel.scroll_evt');
|
|
44012
44055
|
this.debouncedFetchNextDatasetOnScroll(dataNavigator, debounceNum, parent)();
|
|
@@ -45087,7 +45130,7 @@ var search_build$1 = /*#__PURE__*/Object.freeze({
|
|
|
45087
45130
|
const tagName$1m = 'div';
|
|
45088
45131
|
register('wm-tree', () => {
|
|
45089
45132
|
return {
|
|
45090
|
-
pre: attrs => `<${tagName$1m} wmTree
|
|
45133
|
+
pre: attrs => `<${tagName$1m} wmTree ${getAttrMarkup(attrs)}>`,
|
|
45091
45134
|
post: () => `</${tagName$1m}>`
|
|
45092
45135
|
};
|
|
45093
45136
|
});
|
|
@@ -43911,6 +43911,16 @@ class PaginationService {
|
|
|
43911
43911
|
*/
|
|
43912
43912
|
updateFieldsOnPagination(parent, newVal) {
|
|
43913
43913
|
let fieldDefs = parent.widgetType === 'wm-table' ? parent.gridData : parent.fieldDefs;
|
|
43914
|
+
// remove the deleted row from the list
|
|
43915
|
+
if (parent.widgetType === 'wm-table' && (parent.gridOptions.isNavTypeScrollOrOndemand()) && parent.gridOptions.deletedRowIndex !== -1) {
|
|
43916
|
+
fieldDefs.splice(parent.gridOptions.deletedRowIndex, 1);
|
|
43917
|
+
parent.gridOptions.setDeletedRowIndex(-1);
|
|
43918
|
+
}
|
|
43919
|
+
// reset fieldDefs if last action performed is search or sort
|
|
43920
|
+
if (parent.widgetType === 'wm-table' && (parent.gridOptions.isNavTypeScrollOrOndemand()) && parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.SEARCH_OR_SORT) {
|
|
43921
|
+
fieldDefs = [];
|
|
43922
|
+
parent.gridOptions.setCurrentPage(1);
|
|
43923
|
+
}
|
|
43914
43924
|
let currentPage = parent.currentPage;
|
|
43915
43925
|
const dataNavigator = parent.dataNavigator;
|
|
43916
43926
|
const pagesize = parent.pagesize;
|
|
@@ -43931,11 +43941,11 @@ class PaginationService {
|
|
|
43931
43941
|
newVal = [];
|
|
43932
43942
|
}
|
|
43933
43943
|
else if (dataNavigator.dataSize < currentPage * pagesize) {
|
|
43934
|
-
// if number of elements added to
|
|
43944
|
+
// if number of elements added to dataNavigator is less than product of currentPage and pageSize we only add elements extra elements added
|
|
43935
43945
|
itemsLength = dataNavigator.dataSize - fieldDefs.length;
|
|
43936
43946
|
}
|
|
43937
43947
|
else {
|
|
43938
|
-
// if number of elements added to
|
|
43948
|
+
// if number of elements added to dataNavigator is greater than product of currentPage and pageSize we add elements the extra elements in newVal
|
|
43939
43949
|
itemsLength = currentPage * pagesize - fieldDefs.length;
|
|
43940
43950
|
currentPage++;
|
|
43941
43951
|
}
|
|
@@ -43948,9 +43958,36 @@ class PaginationService {
|
|
|
43948
43958
|
}
|
|
43949
43959
|
newVal = itemsToPush;
|
|
43950
43960
|
}
|
|
43951
|
-
|
|
43961
|
+
// Add unique records to fieldDefs
|
|
43962
|
+
if (parent.widgetType === 'wm-table' && (parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.DELETE || parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.EDIT)) {
|
|
43963
|
+
fieldDefs = this.getUniqueRecordsInFieldDef(fieldDefs, newVal);
|
|
43964
|
+
}
|
|
43965
|
+
else {
|
|
43966
|
+
fieldDefs = [...fieldDefs, ...newVal];
|
|
43967
|
+
}
|
|
43952
43968
|
return [fieldDefs, currentPage];
|
|
43953
43969
|
}
|
|
43970
|
+
// Add the unique records to fieldDefs
|
|
43971
|
+
getUniqueRecordsInFieldDef(fieldDefs, newVal) {
|
|
43972
|
+
let flag = false;
|
|
43973
|
+
if (!fieldDefs.length) {
|
|
43974
|
+
fieldDefs = newVal;
|
|
43975
|
+
}
|
|
43976
|
+
else {
|
|
43977
|
+
newVal.forEach(function (newObj) {
|
|
43978
|
+
flag = false;
|
|
43979
|
+
fieldDefs.forEach(function (obj) {
|
|
43980
|
+
if (_.isEqual(newObj, obj)) {
|
|
43981
|
+
flag = true;
|
|
43982
|
+
}
|
|
43983
|
+
});
|
|
43984
|
+
if (flag === false) {
|
|
43985
|
+
fieldDefs.push(newObj);
|
|
43986
|
+
}
|
|
43987
|
+
});
|
|
43988
|
+
}
|
|
43989
|
+
return fieldDefs;
|
|
43990
|
+
}
|
|
43954
43991
|
/**
|
|
43955
43992
|
* @description
|
|
43956
43993
|
* This function registers scroll events on the scrollable el, if the page doesn't have a scroll el then wheel event is registered on the requested node
|
|
@@ -43993,6 +44030,9 @@ class PaginationService {
|
|
|
43993
44030
|
let scrollTop;
|
|
43994
44031
|
// scrollingElement is undefined for IE, safari. use body as target Element
|
|
43995
44032
|
target = target === document ? (target.scrollingElement || document.body) : target;
|
|
44033
|
+
if (parent.widgetType === 'wm-table' && parent.gridOptions.isNavTypeScrollOrOndemand()) {
|
|
44034
|
+
evt.stopPropagation();
|
|
44035
|
+
}
|
|
43996
44036
|
clientHeight = target.clientHeight;
|
|
43997
44037
|
totalHeight = target.scrollHeight;
|
|
43998
44038
|
scrollTop = target === document.body ? $(window).scrollTop() : target.scrollTop;
|
|
@@ -44007,6 +44047,9 @@ class PaginationService {
|
|
|
44007
44047
|
else {
|
|
44008
44048
|
// if there is no scrollable element register wheel event on ul element
|
|
44009
44049
|
$rootEl.on('wheel.scroll_evt', e => {
|
|
44050
|
+
if (parent.widgetType === 'wm-table' && parent.gridOptions.isNavTypeScrollOrOndemand()) {
|
|
44051
|
+
e.stopPropagation();
|
|
44052
|
+
}
|
|
44010
44053
|
if (e.originalEvent.deltaY > 0) {
|
|
44011
44054
|
$rootEl.off('wheel.scroll_evt');
|
|
44012
44055
|
this.debouncedFetchNextDatasetOnScroll(dataNavigator, debounceNum, parent)();
|
|
@@ -45087,7 +45130,7 @@ var search_build$1 = /*#__PURE__*/Object.freeze({
|
|
|
45087
45130
|
const tagName$1m = 'div';
|
|
45088
45131
|
register('wm-tree', () => {
|
|
45089
45132
|
return {
|
|
45090
|
-
pre: attrs => `<${tagName$1m} wmTree
|
|
45133
|
+
pre: attrs => `<${tagName$1m} wmTree ${getAttrMarkup(attrs)}>`,
|
|
45091
45134
|
post: () => `</${tagName$1m}>`
|
|
45092
45135
|
};
|
|
45093
45136
|
});
|