@wavemaker/angular-codegen 11.0.1-next.139042 → 11.0.1-next.23353

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.
@@ -38868,6 +38868,7 @@ var Operation;
38868
38868
  Operation["IS_BOUND_TO_LOCALE"] = "isBoundToLocale";
38869
38869
  Operation["GET_DEFAULT_LOCALE"] = "getDefaultLocale";
38870
38870
  Operation["CANCEL"] = "cancel";
38871
+ Operation["SET_PAGINATION"] = "setPagination";
38871
38872
  })(Operation || (Operation = {}));
38872
38873
  const DataSource = {
38873
38874
  Operation
@@ -41205,6 +41206,16 @@ class PaginationService {
41205
41206
  */
41206
41207
  updateFieldsOnPagination(parent, newVal) {
41207
41208
  let fieldDefs = parent.widgetType === 'wm-table' ? parent.gridData : parent.fieldDefs;
41209
+ // remove the deleted row from the list
41210
+ if (parent.widgetType === 'wm-table' && (parent.gridOptions.isNavTypeScrollOrOndemand()) && parent.gridOptions.deletedRowIndex !== -1) {
41211
+ fieldDefs.splice(parent.gridOptions.deletedRowIndex, 1);
41212
+ parent.gridOptions.setDeletedRowIndex(-1);
41213
+ }
41214
+ // reset fieldDefs if last action performed is search or sort
41215
+ if (parent.widgetType === 'wm-table' && (parent.gridOptions.isNavTypeScrollOrOndemand()) && (parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.SEARCH_OR_SORT || parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.FILTER_CRITERIA)) {
41216
+ fieldDefs = [];
41217
+ parent.gridOptions.setCurrentPage(1);
41218
+ }
41208
41219
  let currentPage = parent.currentPage;
41209
41220
  const dataNavigator = parent.dataNavigator;
41210
41221
  const pagesize = parent.pagesize;
@@ -41225,11 +41236,11 @@ class PaginationService {
41225
41236
  newVal = [];
41226
41237
  }
41227
41238
  else if (dataNavigator.dataSize < currentPage * pagesize) {
41228
- // if number of elements added to datanavigator is less than product of currentpage and pagesize we only add elements extra elements added
41239
+ // if number of elements added to dataNavigator is less than product of currentPage and pageSize we only add elements extra elements added
41229
41240
  itemsLength = dataNavigator.dataSize - fieldDefs.length;
41230
41241
  }
41231
41242
  else {
41232
- // if number of elements added to datanavigator is greater than product of currentpage and pagesize we add elements the extra elements in newVal
41243
+ // if number of elements added to dataNavigator is greater than product of currentPage and pageSize we add elements the extra elements in newVal
41233
41244
  itemsLength = currentPage * pagesize - fieldDefs.length;
41234
41245
  currentPage++;
41235
41246
  }
@@ -41242,9 +41253,36 @@ class PaginationService {
41242
41253
  }
41243
41254
  newVal = itemsToPush;
41244
41255
  }
41245
- fieldDefs = [...fieldDefs, ...newVal];
41256
+ // Add unique records to fieldDefs
41257
+ if (parent.widgetType === 'wm-table' && (parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.DELETE || parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.EDIT)) {
41258
+ fieldDefs = this.getUniqueRecordsInFieldDef(fieldDefs, newVal);
41259
+ }
41260
+ else {
41261
+ fieldDefs = [...fieldDefs, ...newVal];
41262
+ }
41246
41263
  return [fieldDefs, currentPage];
41247
41264
  }
41265
+ // Add the unique records to fieldDefs
41266
+ getUniqueRecordsInFieldDef(fieldDefs, newVal) {
41267
+ let flag = false;
41268
+ if (!fieldDefs.length) {
41269
+ fieldDefs = newVal;
41270
+ }
41271
+ else {
41272
+ newVal.forEach(function (newObj) {
41273
+ flag = false;
41274
+ fieldDefs.forEach(function (obj) {
41275
+ if (_.isEqual(newObj, obj)) {
41276
+ flag = true;
41277
+ }
41278
+ });
41279
+ if (flag === false) {
41280
+ fieldDefs.push(newObj);
41281
+ }
41282
+ });
41283
+ }
41284
+ return fieldDefs;
41285
+ }
41248
41286
  /**
41249
41287
  * @description
41250
41288
  * 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
@@ -41287,6 +41325,9 @@ class PaginationService {
41287
41325
  let scrollTop;
41288
41326
  // scrollingElement is undefined for IE, safari. use body as target Element
41289
41327
  target = target === document ? (target.scrollingElement || document.body) : target;
41328
+ if (parent.widgetType === 'wm-table' && parent.gridOptions.isNavTypeScrollOrOndemand()) {
41329
+ evt.stopPropagation();
41330
+ }
41290
41331
  clientHeight = target.clientHeight;
41291
41332
  totalHeight = target.scrollHeight;
41292
41333
  scrollTop = target === document.body ? $(window).scrollTop() : target.scrollTop;
@@ -41301,6 +41342,9 @@ class PaginationService {
41301
41342
  else {
41302
41343
  // if there is no scrollable element register wheel event on ul element
41303
41344
  $rootEl.on('wheel.scroll_evt', e => {
41345
+ if (parent.widgetType === 'wm-table' && parent.gridOptions.isNavTypeScrollOrOndemand()) {
41346
+ e.stopPropagation();
41347
+ }
41304
41348
  if (e.originalEvent.deltaY > 0) {
41305
41349
  $rootEl.off('wheel.scroll_evt');
41306
41350
  this.debouncedFetchNextDatasetOnScroll(dataNavigator, debounceNum, parent)();
@@ -41409,7 +41453,7 @@ const DIALOG_MODULE = [...NGX_MODAL_MODULE, ...INPUT_MODULE, { from: '@wm/compon
41409
41453
  const PAGINATION_MODULE = [...NG_FORM_MODULE, ...NGX_PAGINATION_MODULE, { from: '@wm/components/data/pagination', name: 'PaginationModule' }];
41410
41454
  const SEARCH_MODULE = [...NG_FORM_MODULE, ...NGX_TYPE_HEAD_MODULE, { from: '@wm/components/basic/search', name: 'SearchModule' }];
41411
41455
  const ACCORDION_MODULE = [{ from: '@wm/components/containers/accordion', name: 'AccordionModule' }];
41412
- const LINEAR_LAYOUT_MODULE = [{ from: ' @wm/components/containers/linear-layout', name: 'LinearLayoutModule' }];
41456
+ const LINEAR_LAYOUT_MODULE = [{ from: '@wm/components/containers/linear-layout', name: 'LinearLayoutModule' }];
41413
41457
  const ALERT_DIALOG_MODULE = [...DIALOG_MODULE, { from: '@wm/components/dialogs/alert-dialog', name: 'AlertDialogModule' }];
41414
41458
  const BARCODE_SCANNER_MODULE = [{ from: '@wm/mobile/components/device/barcode-scanner', name: 'BarcodeScannerModule' }];
41415
41459
  const MENU_MODULE = [...BASIC_MODULE, ...NGX_DROP_DOWN_MODULE, ...INPUT_MODULE, { from: '@wm/components/navigation/menu', name: 'MenuModule' }];
@@ -42381,7 +42425,7 @@ var search_build$1 = /*#__PURE__*/Object.freeze({
42381
42425
  const tagName$1m = 'div';
42382
42426
  register('wm-tree', () => {
42383
42427
  return {
42384
- pre: attrs => `<${tagName$1m} wmTree redrawable ${getAttrMarkup(attrs)}>`,
42428
+ pre: attrs => `<${tagName$1m} wmTree ${getAttrMarkup(attrs)}>`,
42385
42429
  post: () => `</${tagName$1m}>`
42386
42430
  };
42387
42431
  });
@@ -38868,6 +38868,7 @@ var Operation;
38868
38868
  Operation["IS_BOUND_TO_LOCALE"] = "isBoundToLocale";
38869
38869
  Operation["GET_DEFAULT_LOCALE"] = "getDefaultLocale";
38870
38870
  Operation["CANCEL"] = "cancel";
38871
+ Operation["SET_PAGINATION"] = "setPagination";
38871
38872
  })(Operation || (Operation = {}));
38872
38873
  const DataSource = {
38873
38874
  Operation
@@ -41205,6 +41206,16 @@ class PaginationService {
41205
41206
  */
41206
41207
  updateFieldsOnPagination(parent, newVal) {
41207
41208
  let fieldDefs = parent.widgetType === 'wm-table' ? parent.gridData : parent.fieldDefs;
41209
+ // remove the deleted row from the list
41210
+ if (parent.widgetType === 'wm-table' && (parent.gridOptions.isNavTypeScrollOrOndemand()) && parent.gridOptions.deletedRowIndex !== -1) {
41211
+ fieldDefs.splice(parent.gridOptions.deletedRowIndex, 1);
41212
+ parent.gridOptions.setDeletedRowIndex(-1);
41213
+ }
41214
+ // reset fieldDefs if last action performed is search or sort
41215
+ if (parent.widgetType === 'wm-table' && (parent.gridOptions.isNavTypeScrollOrOndemand()) && (parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.SEARCH_OR_SORT || parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.FILTER_CRITERIA)) {
41216
+ fieldDefs = [];
41217
+ parent.gridOptions.setCurrentPage(1);
41218
+ }
41208
41219
  let currentPage = parent.currentPage;
41209
41220
  const dataNavigator = parent.dataNavigator;
41210
41221
  const pagesize = parent.pagesize;
@@ -41225,11 +41236,11 @@ class PaginationService {
41225
41236
  newVal = [];
41226
41237
  }
41227
41238
  else if (dataNavigator.dataSize < currentPage * pagesize) {
41228
- // if number of elements added to datanavigator is less than product of currentpage and pagesize we only add elements extra elements added
41239
+ // if number of elements added to dataNavigator is less than product of currentPage and pageSize we only add elements extra elements added
41229
41240
  itemsLength = dataNavigator.dataSize - fieldDefs.length;
41230
41241
  }
41231
41242
  else {
41232
- // if number of elements added to datanavigator is greater than product of currentpage and pagesize we add elements the extra elements in newVal
41243
+ // if number of elements added to dataNavigator is greater than product of currentPage and pageSize we add elements the extra elements in newVal
41233
41244
  itemsLength = currentPage * pagesize - fieldDefs.length;
41234
41245
  currentPage++;
41235
41246
  }
@@ -41242,9 +41253,36 @@ class PaginationService {
41242
41253
  }
41243
41254
  newVal = itemsToPush;
41244
41255
  }
41245
- fieldDefs = [...fieldDefs, ...newVal];
41256
+ // Add unique records to fieldDefs
41257
+ if (parent.widgetType === 'wm-table' && (parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.DELETE || parent.gridOptions.lastActionPerformed === parent.gridOptions.ACTIONS.EDIT)) {
41258
+ fieldDefs = this.getUniqueRecordsInFieldDef(fieldDefs, newVal);
41259
+ }
41260
+ else {
41261
+ fieldDefs = [...fieldDefs, ...newVal];
41262
+ }
41246
41263
  return [fieldDefs, currentPage];
41247
41264
  }
41265
+ // Add the unique records to fieldDefs
41266
+ getUniqueRecordsInFieldDef(fieldDefs, newVal) {
41267
+ let flag = false;
41268
+ if (!fieldDefs.length) {
41269
+ fieldDefs = newVal;
41270
+ }
41271
+ else {
41272
+ newVal.forEach(function (newObj) {
41273
+ flag = false;
41274
+ fieldDefs.forEach(function (obj) {
41275
+ if (_.isEqual(newObj, obj)) {
41276
+ flag = true;
41277
+ }
41278
+ });
41279
+ if (flag === false) {
41280
+ fieldDefs.push(newObj);
41281
+ }
41282
+ });
41283
+ }
41284
+ return fieldDefs;
41285
+ }
41248
41286
  /**
41249
41287
  * @description
41250
41288
  * 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
@@ -41287,6 +41325,9 @@ class PaginationService {
41287
41325
  let scrollTop;
41288
41326
  // scrollingElement is undefined for IE, safari. use body as target Element
41289
41327
  target = target === document ? (target.scrollingElement || document.body) : target;
41328
+ if (parent.widgetType === 'wm-table' && parent.gridOptions.isNavTypeScrollOrOndemand()) {
41329
+ evt.stopPropagation();
41330
+ }
41290
41331
  clientHeight = target.clientHeight;
41291
41332
  totalHeight = target.scrollHeight;
41292
41333
  scrollTop = target === document.body ? $(window).scrollTop() : target.scrollTop;
@@ -41301,6 +41342,9 @@ class PaginationService {
41301
41342
  else {
41302
41343
  // if there is no scrollable element register wheel event on ul element
41303
41344
  $rootEl.on('wheel.scroll_evt', e => {
41345
+ if (parent.widgetType === 'wm-table' && parent.gridOptions.isNavTypeScrollOrOndemand()) {
41346
+ e.stopPropagation();
41347
+ }
41304
41348
  if (e.originalEvent.deltaY > 0) {
41305
41349
  $rootEl.off('wheel.scroll_evt');
41306
41350
  this.debouncedFetchNextDatasetOnScroll(dataNavigator, debounceNum, parent)();
@@ -41409,7 +41453,7 @@ const DIALOG_MODULE = [...NGX_MODAL_MODULE, ...INPUT_MODULE, { from: '@wm/compon
41409
41453
  const PAGINATION_MODULE = [...NG_FORM_MODULE, ...NGX_PAGINATION_MODULE, { from: '@wm/components/data/pagination', name: 'PaginationModule' }];
41410
41454
  const SEARCH_MODULE = [...NG_FORM_MODULE, ...NGX_TYPE_HEAD_MODULE, { from: '@wm/components/basic/search', name: 'SearchModule' }];
41411
41455
  const ACCORDION_MODULE = [{ from: '@wm/components/containers/accordion', name: 'AccordionModule' }];
41412
- const LINEAR_LAYOUT_MODULE = [{ from: ' @wm/components/containers/linear-layout', name: 'LinearLayoutModule' }];
41456
+ const LINEAR_LAYOUT_MODULE = [{ from: '@wm/components/containers/linear-layout', name: 'LinearLayoutModule' }];
41413
41457
  const ALERT_DIALOG_MODULE = [...DIALOG_MODULE, { from: '@wm/components/dialogs/alert-dialog', name: 'AlertDialogModule' }];
41414
41458
  const BARCODE_SCANNER_MODULE = [{ from: '@wm/mobile/components/device/barcode-scanner', name: 'BarcodeScannerModule' }];
41415
41459
  const MENU_MODULE = [...BASIC_MODULE, ...NGX_DROP_DOWN_MODULE, ...INPUT_MODULE, { from: '@wm/components/navigation/menu', name: 'MenuModule' }];
@@ -42381,7 +42425,7 @@ var search_build$1 = /*#__PURE__*/Object.freeze({
42381
42425
  const tagName$1m = 'div';
42382
42426
  register('wm-tree', () => {
42383
42427
  return {
42384
- pre: attrs => `<${tagName$1m} wmTree redrawable ${getAttrMarkup(attrs)}>`,
42428
+ pre: attrs => `<${tagName$1m} wmTree ${getAttrMarkup(attrs)}>`,
42385
42429
  post: () => `</${tagName$1m}>`
42386
42430
  };
42387
42431
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-codegen",
3
- "version": "11.0.1-next.139042",
3
+ "version": "11.0.1-next.23353",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {