@syncfusion/ej2-navigations 22.2.7 → 22.2.11

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/ej2-navigations.min.js +2 -2
  3. package/dist/ej2-navigations.umd.min.js +2 -2
  4. package/dist/ej2-navigations.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-navigations.es2015.js +86 -28
  6. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  7. package/dist/es6/ej2-navigations.es5.js +88 -28
  8. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  9. package/dist/global/ej2-navigations.min.js +2 -2
  10. package/dist/global/ej2-navigations.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +10 -10
  13. package/src/breadcrumb/breadcrumb-model.d.ts +1 -1
  14. package/src/breadcrumb/breadcrumb.js +9 -2
  15. package/src/carousel/carousel.d.ts +1 -0
  16. package/src/carousel/carousel.js +9 -0
  17. package/src/tab/tab-model.d.ts +6 -0
  18. package/src/tab/tab.d.ts +5 -0
  19. package/src/tab/tab.js +11 -0
  20. package/src/toolbar/toolbar.d.ts +1 -0
  21. package/src/toolbar/toolbar.js +48 -26
  22. package/src/treeview/treeview-model.d.ts +1 -1
  23. package/src/treeview/treeview.js +11 -0
  24. package/styles/accordion/material.css +1 -1
  25. package/styles/appbar/material.css +1 -1
  26. package/styles/breadcrumb/material.css +1 -1
  27. package/styles/carousel/material.css +1 -1
  28. package/styles/context-menu/material.css +1 -1
  29. package/styles/h-scroll/material.css +1 -1
  30. package/styles/material.css +1 -1
  31. package/styles/menu/material.css +1 -1
  32. package/styles/pager/material.css +1 -1
  33. package/styles/sidebar/material.css +1 -1
  34. package/styles/tab/material.css +1 -1
  35. package/styles/toolbar/material.css +1 -1
  36. package/styles/treeview/material.css +1 -1
  37. package/styles/v-scroll/material.css +1 -1
@@ -1,4 +1,4 @@
1
- import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Droppable, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getElement, getInstance, getRandomId, getUniqueID, getValue, isBlazor, isNullOrUndefined, isRippleEnabled, isUndefined, isVisible, matches, merge, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
1
+ import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Droppable, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getElement, getInstance, getRandomId, getUniqueID, getValue, initializeCSPTemplate, isBlazor, isNullOrUndefined, isRippleEnabled, isUndefined, isVisible, matches, merge, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
2
2
  import { ListBase } from '@syncfusion/ej2-lists';
3
3
  import { Popup, calculatePosition, createSpinner, fit, getScrollableParent, getZindexPartial, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
4
4
  import { Button, createCheckBox, rippleMouseHandler } from '@syncfusion/ej2-buttons';
@@ -5038,7 +5038,7 @@ let Toolbar = class Toolbar extends Component {
5038
5038
  this.tbarAlgEle[(this.items[parseInt(eleIdx.toString(), 10)].align + 's').toLowerCase()].splice(parseInt(indexAgn.toString(), 10), 1);
5039
5039
  }
5040
5040
  if (this.isReact) {
5041
- this.clearTemplate();
5041
+ this.clearToolbarTemplate(innerItems[parseInt(index.toString(), 10)]);
5042
5042
  }
5043
5043
  const btnItem = innerItems[parseInt(index.toString(), 10)].querySelector('.e-control.e-btn');
5044
5044
  if (!isNullOrUndefined(btnItem) && !isNullOrUndefined(btnItem.ej2_instances[0]) && !(btnItem.ej2_instances[0].isDestroyed)) {
@@ -5350,6 +5350,30 @@ let Toolbar = class Toolbar extends Component {
5350
5350
  nextEle = innerItems[++eleIndex];
5351
5351
  }
5352
5352
  }
5353
+ clearToolbarTemplate(templateEle) {
5354
+ if (this.registeredTemplate && this.registeredTemplate[`${'template'}`]) {
5355
+ const registeredTemplates = this.registeredTemplate;
5356
+ for (let index = 0; index < registeredTemplates[`${'template'}`].length; index++) {
5357
+ const registeredItem = registeredTemplates[`${'template'}`][parseInt(index.toString(), 10)].rootNodes[0];
5358
+ const closestItem = closest(registeredItem, '.' + CLS_ITEM);
5359
+ if (!isNullOrUndefined(closestItem) && closestItem === templateEle) {
5360
+ this.clearTemplate(['template'], [registeredTemplates[`${'template'}`][parseInt(index.toString(), 10)]]);
5361
+ break;
5362
+ }
5363
+ }
5364
+ }
5365
+ else if (this.portals && this.portals.length > 0) {
5366
+ const portals = this.portals;
5367
+ for (let index = 0; index < portals.length; index++) {
5368
+ const portalItem = portals[parseInt(index.toString(), 10)];
5369
+ const closestItem = closest(portalItem.containerInfo, '.' + CLS_ITEM);
5370
+ if (!isNullOrUndefined(closestItem) && closestItem === templateEle) {
5371
+ this.clearTemplate(['template'], index);
5372
+ break;
5373
+ }
5374
+ }
5375
+ }
5376
+ }
5353
5377
  /**
5354
5378
  * Gets called when the model property changes.The data that describes the old and new values of the property that changed.
5355
5379
  *
@@ -5371,31 +5395,29 @@ let Toolbar = class Toolbar extends Component {
5371
5395
  const index = parseInt(Object.keys(newProp.items)[parseInt(i.toString(), 10)], 10);
5372
5396
  const property = Object.keys(newProp.items[parseInt(index.toString(), 10)])[0];
5373
5397
  const newProperty = Object(newProp.items[parseInt(index.toString(), 10)])[`${property}`];
5374
- if (typeof newProperty !== 'function') {
5375
- if (this.tbarAlign || property === 'align') {
5376
- this.refresh();
5377
- this.trigger('created');
5378
- break;
5379
- }
5380
- const popupPriCheck = property === 'showAlwaysInPopup' && !newProperty;
5381
- const booleanCheck = property === 'overflow' && this.popupPriCount !== 0;
5382
- if ((popupPriCheck) || (this.items[parseInt(index.toString(), 10)].showAlwaysInPopup) && booleanCheck) {
5383
- --this.popupPriCount;
5384
- }
5385
- if (isNullOrUndefined(this.scrollModule)) {
5386
- this.destroyMode();
5387
- }
5388
- const itemCol = [].slice.call(selectAll('.' + CLS_ITEMS + ' .' + CLS_ITEM, tEle));
5389
- if (this.isReact && this.items[parseInt(index.toString(), 10)].template) {
5390
- this.clearTemplate();
5391
- }
5392
- detach(itemCol[parseInt(index.toString(), 10)]);
5393
- this.tbarEle.splice(index, 1);
5394
- this.addItems([this.items[parseInt(index.toString(), 10)]], index);
5395
- this.items.splice(index, 1);
5396
- if (this.items[parseInt(index.toString(), 10)].template) {
5397
- this.tbarEle.splice(this.items.length, 1);
5398
- }
5398
+ if (this.tbarAlign || property === 'align') {
5399
+ this.refresh();
5400
+ this.trigger('created');
5401
+ break;
5402
+ }
5403
+ const popupPriCheck = property === 'showAlwaysInPopup' && !newProperty;
5404
+ const booleanCheck = property === 'overflow' && this.popupPriCount !== 0;
5405
+ if ((popupPriCheck) || (this.items[parseInt(index.toString(), 10)].showAlwaysInPopup) && booleanCheck) {
5406
+ --this.popupPriCount;
5407
+ }
5408
+ if (isNullOrUndefined(this.scrollModule)) {
5409
+ this.destroyMode();
5410
+ }
5411
+ const itemCol = [].slice.call(selectAll('.' + CLS_ITEMS + ' .' + CLS_ITEM, tEle));
5412
+ if (this.isReact && this.items[parseInt(index.toString(), 10)].template) {
5413
+ this.clearToolbarTemplate(itemCol[parseInt(index.toString(), 10)]);
5414
+ }
5415
+ detach(itemCol[parseInt(index.toString(), 10)]);
5416
+ this.tbarEle.splice(index, 1);
5417
+ this.addItems([this.items[parseInt(index.toString(), 10)]], index);
5418
+ this.items.splice(index, 1);
5419
+ if (this.items[parseInt(index.toString(), 10)].template) {
5420
+ this.tbarEle.splice(this.items.length, 1);
5399
5421
  }
5400
5422
  }
5401
5423
  }
@@ -7570,6 +7592,11 @@ let Tab = class Tab extends Component {
7570
7592
  this.renderContainer();
7571
7593
  this.wireEvents();
7572
7594
  this.initRender = false;
7595
+ if (this.isReact && this.portals && this.portals.length > 0) {
7596
+ this.renderReactTemplates(function () {
7597
+ this.refreshActiveBorder();
7598
+ });
7599
+ }
7573
7600
  }
7574
7601
  renderContainer() {
7575
7602
  const ele = this.element;
@@ -8734,6 +8761,9 @@ let Tab = class Tab extends Component {
8734
8761
  }
8735
8762
  }
8736
8763
  clearTabTemplate(templateEle, templateName, className) {
8764
+ if (!this.clearTemplates) {
8765
+ return;
8766
+ }
8737
8767
  if (this.registeredTemplate && this.registeredTemplate[templateName]) {
8738
8768
  const registeredTemplates = this.registeredTemplate;
8739
8769
  for (let index = 0; index < registeredTemplates[templateName].length; index++) {
@@ -9626,6 +9656,9 @@ __decorate$7([
9626
9656
  __decorate$7([
9627
9657
  Property(false)
9628
9658
  ], Tab.prototype, "allowDragAndDrop", void 0);
9659
+ __decorate$7([
9660
+ Property(true)
9661
+ ], Tab.prototype, "clearTemplates", void 0);
9629
9662
  __decorate$7([
9630
9663
  Complex({}, TabAnimationSettings)
9631
9664
  ], Tab.prototype, "animation", void 0);
@@ -10494,6 +10527,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10494
10527
  }
10495
10528
  }
10496
10529
  let eNodes = selectAll('.' + EXPANDED, element);
10530
+ if (!this.loadOnDemand) {
10531
+ this.isInitalExpand = this.treeData.filter(e => e[this.fields.expanded] == true).length > 0 ? true : this.isInitalExpand;
10532
+ }
10497
10533
  if (!this.isInitalExpand) {
10498
10534
  for (let i = 0; i < eNodes.length; i++) {
10499
10535
  this.renderChildNodes(eNodes[i]);
@@ -10998,6 +11034,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10998
11034
  }
10999
11035
  doExpandAction() {
11000
11036
  let eUids = this.expandedNodes;
11037
+ if (!this.loadOnDemand) {
11038
+ this.isInitalExpand = this.treeData.filter(e => e[this.fields.expanded] == true).length > 0 ? true : this.isInitalExpand;
11039
+ }
11001
11040
  if (this.isInitalExpand && eUids.length > 0) {
11002
11041
  this.setProperties({ expandedNodes: [] }, true);
11003
11042
  /* eslint-disable */
@@ -11435,6 +11474,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11435
11474
  if (callback) {
11436
11475
  callback();
11437
11476
  }
11477
+ if (expandChild) {
11478
+ this.expandedNodes.push(parentLi.getAttribute('data-uid'));
11479
+ }
11438
11480
  if (this.treeList.length === 0 && !this.isLoaded) {
11439
11481
  this.finalize();
11440
11482
  }
@@ -15783,7 +15825,14 @@ let Breadcrumb = class Breadcrumb extends Component {
15783
15825
  if (i % 2) {
15784
15826
  // separator item
15785
15827
  wrapDiv = this.createElement('div', { className: 'e-breadcrumb-item-wrapper' });
15786
- listBaseOptions.template = this.separatorTemplate ? this.separatorTemplate : '/';
15828
+ if ((this.separatorTemplate && this.separatorTemplate === '/') || isNullOrUndefined(this.separatorTemplate)) {
15829
+ listBaseOptions.template = initializeCSPTemplate(function () {
15830
+ return '/';
15831
+ });
15832
+ }
15833
+ else {
15834
+ listBaseOptions.template = this.separatorTemplate;
15835
+ }
15787
15836
  listBaseOptions.itemClass = 'e-breadcrumb-separator';
15788
15837
  isSingleLevel = false;
15789
15838
  item = [{ previousItem: items[j], nextItem: items[j + 1] }];
@@ -17333,6 +17382,13 @@ let Carousel = class Carousel extends Component {
17333
17382
  EventHandler.add(this.itemsContainer, 'mouseup touchend', this.swipStop, this);
17334
17383
  }
17335
17384
  }
17385
+ resizeHandler() {
17386
+ if (this.itemsContainer && this.itemsContainer.firstElementChild) {
17387
+ const numOfItems = this.getNumOfItems();
17388
+ const slideWidth = this.itemsContainer.firstElementChild.clientWidth;
17389
+ this.itemsContainer.style.transform = this.getTranslateX(slideWidth, this.selectedIndex + numOfItems);
17390
+ }
17391
+ }
17336
17392
  wireEvents() {
17337
17393
  if (!(this.animationEffect === 'Custom')) {
17338
17394
  this.swipeModehandlers();
@@ -17341,6 +17397,7 @@ let Carousel = class Carousel extends Component {
17341
17397
  EventHandler.add(this.element, 'mouseenter mouseleave', this.onHoverActions, this);
17342
17398
  EventHandler.add(this.element.firstElementChild, 'animationend', this.onTransitionEnd, this);
17343
17399
  EventHandler.add(this.element.firstElementChild, 'transitionend', this.onTransitionEnd, this);
17400
+ EventHandler.add(window, 'resize', this.resizeHandler, this);
17344
17401
  }
17345
17402
  unWireEvents() {
17346
17403
  const indicators = [].slice.call(this.element.querySelectorAll(`.${CLS_INDICATOR_BAR}`));
@@ -17359,6 +17416,7 @@ let Carousel = class Carousel extends Component {
17359
17416
  EventHandler.remove(this.element.firstElementChild, 'transitionend', this.onTransitionEnd);
17360
17417
  EventHandler.clearEvents(this.element);
17361
17418
  EventHandler.clearEvents(this.itemsContainer);
17419
+ EventHandler.remove(window, 'resize', this.resizeHandler);
17362
17420
  }
17363
17421
  /**
17364
17422
  * Method to transit from the current slide to the previous slide.