@syncfusion/ej2-ribbon 24.1.41 → 24.1.46

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 24.1.41
3
+ * version : 24.1.44
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-ribbon@*",
3
- "_id": "@syncfusion/ej2-ribbon@21.27.0",
3
+ "_id": "@syncfusion/ej2-ribbon@24.1.41",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-Yp291W26tAmLS4Vev1bAKc12r3ExMoy1eV3QNuoxM4mysAxjyUBRN0MjP4w8xpLrGgBZqosG3G7Ewc/IphDVww==",
5
+ "_integrity": "sha512-NBr5Cj/aZzyv/xVtzD/JCgb1R1bn48A6AHCcmJl+Bdq3fH8w4G085HP0mYLwX2M8S0EBcKLeUpnaiAqUDo7trw==",
6
6
  "_location": "/@syncfusion/ej2-ribbon",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-ribbon",
24
24
  "/@syncfusion/ej2-vue-ribbon"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-ribbon/-/ej2-ribbon-21.27.0.tgz",
27
- "_shasum": "93461696848f6b7ca64be65ee903922584f6b52c",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-ribbon/-/ej2-ribbon-24.1.41.tgz",
27
+ "_shasum": "bb6d15afff50ba34c654def48c011271701a480a",
28
28
  "_spec": "@syncfusion/ej2-ribbon@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
30
30
  "author": {
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~24.1.41",
39
- "@syncfusion/ej2-buttons": "~24.1.41",
40
- "@syncfusion/ej2-dropdowns": "~24.1.41",
41
- "@syncfusion/ej2-lists": "~24.1.41",
42
- "@syncfusion/ej2-navigations": "~24.1.41",
43
- "@syncfusion/ej2-popups": "~24.1.41",
44
- "@syncfusion/ej2-splitbuttons": "~24.1.41"
38
+ "@syncfusion/ej2-base": "~24.1.46",
39
+ "@syncfusion/ej2-buttons": "~24.1.46",
40
+ "@syncfusion/ej2-dropdowns": "~24.1.46",
41
+ "@syncfusion/ej2-lists": "~24.1.46",
42
+ "@syncfusion/ej2-navigations": "~24.1.46",
43
+ "@syncfusion/ej2-popups": "~24.1.46",
44
+ "@syncfusion/ej2-splitbuttons": "~24.1.46"
45
45
  },
46
46
  "deprecated": false,
47
47
  "description": "Essential JS 2 Component",
@@ -62,6 +62,6 @@
62
62
  "url": "git+https://github.com/syncfusion/ej2-ribbon-component.git"
63
63
  },
64
64
  "typings": "index.d.ts",
65
- "version": "24.1.41",
65
+ "version": "24.1.46",
66
66
  "sideEffects": false
67
67
  }
@@ -194,6 +194,8 @@ export declare class Ribbon extends Component<HTMLElement> implements INotifyPro
194
194
  private keyboardModuleRibbon;
195
195
  private keyConfigs;
196
196
  private initialPropsData;
197
+ private hiddenElements;
198
+ private hiddenGroups;
197
199
  /** @hidden */
198
200
  overflowDDB: DropDownButton;
199
201
  /** @hidden */
@@ -399,6 +401,13 @@ export declare class Ribbon extends Component<HTMLElement> implements INotifyPro
399
401
  */
400
402
  showGroup(groupID: string): void;
401
403
  private showHideGroup;
404
+ private updateHiddenElements;
405
+ private checkHiddenElements;
406
+ private updateItemsSimplifiedWidth;
407
+ private checkWidthDifference;
408
+ private calculateHiddenElementsWidth;
409
+ private calculateMediumDataWidth;
410
+ private calculateOverflowItemsWidth;
402
411
  /**
403
412
  * Disables a specific group within a ribbon tab.
404
413
  *
@@ -59,6 +59,8 @@ var Ribbon = /** @class */ (function (_super) {
59
59
  this.idIndex = 0;
60
60
  this.tooltipData = [];
61
61
  this.initialPropsData = {};
62
+ this.hiddenElements = {};
63
+ this.hiddenGroups = [];
62
64
  this.isAddRemove = false;
63
65
  this.keyConfigs = {
64
66
  leftarrow: 'leftarrow',
@@ -431,6 +433,7 @@ var Ribbon = /** @class */ (function (_super) {
431
433
  selectedIndex = selectedIndex === -1 ? this.selectedTab : selectedIndex;
432
434
  var eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex };
433
435
  this.setProperties({ selectedTab: selectedIndex }, true);
436
+ this.calculateHiddenElementsWidth(selectedIndex);
434
437
  this.checkOverflow(selectedIndex, e.selectedContent.firstChild);
435
438
  if (this.activeLayout === 'Simplified' && this.overflowDDB) {
436
439
  var overflowTarget = this.overflowDDB.target;
@@ -554,6 +557,7 @@ var Ribbon = /** @class */ (function (_super) {
554
557
  var orderedGroups = this.getGroupResizeOrder(true, tabIndex);
555
558
  var isEmptyCollection;
556
559
  for (var i = 0; ((i < orderedGroups.length) && (tabContent.offsetWidth < activeContent.offsetWidth)); i++) {
560
+ var isGroupUpdated = false;
557
561
  var group = orderedGroups[parseInt(i.toString(), 10)];
558
562
  var groupEle = tabContent.querySelector('#' + group.id);
559
563
  var groupContainer = groupEle.querySelector('#' + group.id + constants.CONTAINER_ID);
@@ -565,7 +569,67 @@ var Ribbon = /** @class */ (function (_super) {
565
569
  var itemContainer = collectionEle.querySelector('#' + item.id + constants.CONTAINER_ID);
566
570
  if (((item.displayOptions === DisplayMode.Auto) ||
567
571
  (item.displayOptions === (DisplayMode.Simplified | DisplayMode.Overflow))) && !isNullOrUndefined(itemContainer)) {
568
- itemContainer.setAttribute('data-simplified-width', activeContent.offsetWidth.toString());
572
+ var groupHidden = false;
573
+ var itemHidden = false;
574
+ var isAllItemHidden = false;
575
+ var isEmptyCollection_1 = false;
576
+ var groupItems = void 0;
577
+ if (groupEle.classList.contains('e-hidden') || groupEle.classList.contains('e-hide-group')) {
578
+ groupItems = groupEle.querySelectorAll('.e-ribbon-item.e-hidden');
579
+ if (groupItems.length) {
580
+ for (var i_1 = 0; i_1 < groupItems.length; i_1++) {
581
+ groupItems[parseInt(i_1.toString(), 10)].classList.remove('e-hidden');
582
+ }
583
+ }
584
+ if (groupEle.classList.contains('e-hide-group')) {
585
+ isAllItemHidden = true;
586
+ groupEle.classList.remove('e-hide-group');
587
+ groupEle.classList.remove('e-ribbon-emptyCollection');
588
+ if (this.hiddenGroups.indexOf(groupEle.id) !== -1) {
589
+ this.hiddenGroups.splice(this.hiddenGroups.indexOf(groupEle.id), 1);
590
+ }
591
+ }
592
+ else {
593
+ groupHidden = true;
594
+ groupEle.classList.remove('e-hidden');
595
+ }
596
+ if (!isGroupUpdated) {
597
+ this.calculateOverflowItemsWidth(groupEle.offsetWidth, false, tabIndex);
598
+ this.calculateMediumDataWidth(groupEle.offsetWidth, tabIndex, false);
599
+ isGroupUpdated = true;
600
+ }
601
+ }
602
+ else {
603
+ if (itemContainer.classList.contains('e-hidden')) {
604
+ itemHidden = true;
605
+ itemContainer.classList.remove('e-hidden');
606
+ if (groupEle.classList.contains('e-ribbon-emptyCollection')) {
607
+ isEmptyCollection_1 = true;
608
+ groupEle.classList.remove('e-ribbon-emptyCollection');
609
+ }
610
+ this.calculateOverflowItemsWidth(itemContainer.offsetWidth, false, tabIndex);
611
+ this.calculateMediumDataWidth(itemContainer.offsetWidth, tabIndex, false);
612
+ }
613
+ }
614
+ itemContainer.setAttribute('data-simplified-width', (activeContent.offsetWidth).toString());
615
+ if (itemHidden) {
616
+ itemContainer.classList.add('e-hidden');
617
+ }
618
+ if (groupItems && groupItems.length) {
619
+ for (var i_2 = 0; i_2 < groupItems.length; i_2++) {
620
+ groupItems[parseInt(i_2.toString(), 10)].classList.add('e-hidden');
621
+ }
622
+ }
623
+ if (groupHidden) {
624
+ groupEle.classList.add('e-hidden');
625
+ }
626
+ if (isAllItemHidden) {
627
+ groupEle.classList.add('e-hide-group');
628
+ groupEle.classList.add('e-ribbon-emptyCollection');
629
+ }
630
+ if (isEmptyCollection_1) {
631
+ groupEle.classList.add('e-ribbon-emptyCollection');
632
+ }
569
633
  this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemContainer, groupContainer, true);
570
634
  if (item.activeSize === RibbonItemSize.Small) {
571
635
  var itemEle = itemContainer.querySelector('#' + item.id);
@@ -659,31 +723,55 @@ var Ribbon = /** @class */ (function (_super) {
659
723
  if (((item.displayOptions === DisplayMode.Auto) ||
660
724
  (item.displayOptions === (DisplayMode.Simplified | DisplayMode.Overflow))) && !isNullOrUndefined(itemContainer)) {
661
725
  var width = parseInt(itemContainer.getAttribute('data-simplified-width'), 10);
726
+ var groupItemEle = tabContent.querySelector('#' + group.id);
727
+ if (itemContainer.classList.contains('e-hidden') || groupItemEle.classList.contains('e-hidden')) {
728
+ width = Math.abs(width - activeContent.offsetWidth);
729
+ }
662
730
  if (!isClear && (tabContent.offsetWidth < width)) {
663
731
  flag = false;
664
732
  break;
665
733
  }
666
- var groupEle_1 = tabContent.querySelector('#' + collection.id);
734
+ var groupEle = tabContent.querySelector('#' + collection.id);
667
735
  if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
668
736
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
669
737
  }
670
- groupEle_1.append(itemContainer);
738
+ groupEle.append(itemContainer);
739
+ if (itemContainer.classList.contains('e-hidden') || groupItemEle.classList.contains('e-hidden')) {
740
+ itemContainer.setAttribute('data-simplified-width', width.toString());
741
+ var isGroupHidden = false;
742
+ var widthDifference = 0;
743
+ if (itemContainer.classList.contains('e-hidden')) {
744
+ itemContainer.classList.remove('e-hidden');
745
+ if (groupItemEle.classList.contains('e-hide-group')) {
746
+ isGroupHidden = true;
747
+ widthDifference = this.checkWidthDifference(itemContainer, groupItemEle);
748
+ }
749
+ width = itemContainer.offsetWidth + widthDifference;
750
+ itemContainer.classList.add('e-hidden');
751
+ }
752
+ this.calculateOverflowItemsWidth(width, true, tabIndex);
753
+ this.calculateMediumDataWidth(width, tabIndex, true);
754
+ if (isGroupHidden) {
755
+ groupItemEle.classList.add('e-hide-group');
756
+ groupItemEle.classList.add('e-ribbon-emptyCollection');
757
+ }
758
+ }
671
759
  this.removeOverflowEvent(item, itemContainer);
672
760
  if (item.allowedSizes & RibbonItemSize.Small) {
673
761
  item.setProperties({ activeSize: RibbonItemSize.Small }, true);
674
762
  this.setItemSize(itemContainer.querySelector('#' + item.id), item);
675
763
  }
676
- }
677
- }
678
- }
679
- var groupEle = tabContent.querySelector('#' + group.id);
680
- var itemEle = groupEle.querySelector('.' + constants.RIBBON_ITEM);
681
- if (groupEle.classList.contains('e-ribbon-emptyCollection') && itemEle !== null) {
682
- var itemsLength = groupEle.querySelectorAll('.' + constants.RIBBON_ITEM);
683
- if (itemsLength) {
684
- isEmptyCollection = this.checkEmptyCollection(itemsLength);
685
- if (!isEmptyCollection) {
686
- groupEle.classList.remove('e-ribbon-emptyCollection');
764
+ var groupElement = tabContent.querySelector('#' + group.id);
765
+ var itemEle = groupElement.querySelector('.' + constants.RIBBON_ITEM);
766
+ if (groupElement.classList.contains('e-ribbon-emptyCollection') && itemEle !== null) {
767
+ var itemsLength = groupElement.querySelectorAll('.' + constants.RIBBON_ITEM);
768
+ if (itemsLength) {
769
+ isEmptyCollection = this.checkEmptyCollection(itemsLength);
770
+ if (!isEmptyCollection) {
771
+ groupElement.classList.remove('e-ribbon-emptyCollection');
772
+ }
773
+ }
774
+ }
687
775
  }
688
776
  }
689
777
  }
@@ -705,7 +793,9 @@ var Ribbon = /** @class */ (function (_super) {
705
793
  }
706
794
  }
707
795
  }
708
- this.checkOverflowHiddenItems(group.enableGroupOverflow, tabIndex, group.id);
796
+ }
797
+ for (var i = 0; i < orderedGroups.length; i++) {
798
+ this.checkOverflowHiddenItems(orderedGroups[parseInt(i.toString(), 10)].enableGroupOverflow, tabIndex, orderedGroups[parseInt(i.toString(), 10)].id);
709
799
  }
710
800
  if (this.overflowDDB) {
711
801
  var overflowEle = this.overflowDDB.target;
@@ -2042,22 +2132,22 @@ var Ribbon = /** @class */ (function (_super) {
2042
2132
  var activeContent = this.tabObj.element.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + constants.CONTENT_ID);
2043
2133
  var tabContent = activeContent.closest('.' + constants.TAB_CONTENT);
2044
2134
  if (this.activeLayout === 'Simplified') {
2045
- for (var i_1 = 0; i_1 < groupList.length; i_1++) {
2046
- var group = groupList[parseInt(i_1.toString(), 10)];
2047
- var alignType = groupList[parseInt(i_1.toString(), 10)].orientation;
2135
+ for (var i_3 = 0; i_3 < groupList.length; i_3++) {
2136
+ var group = groupList[parseInt(i_3.toString(), 10)];
2137
+ var alignType = groupList[parseInt(i_3.toString(), 10)].orientation;
2048
2138
  if (group.isCollapsed) {
2049
2139
  group.setProperties({ isCollapsed: false }, true);
2050
2140
  this.removeDropdown(group.id);
2051
2141
  }
2052
2142
  else {
2053
- this.checkSmallToMedium(tabIndex, tab, i_1, tabContent, activeContent, true, false);
2054
- this.checkMediumToLarge(tabIndex, tab, i_1, tabContent, activeContent, true, false);
2143
+ this.checkSmallToMedium(tabIndex, tab, i_3, tabContent, activeContent, true, false);
2144
+ this.checkMediumToLarge(tabIndex, tab, i_3, tabContent, activeContent, true, false);
2055
2145
  }
2056
2146
  var groupEle = tabContent.querySelector('#' + group.id);
2057
2147
  var groupContainer = groupEle.querySelector('#' + group.id + constants.CONTAINER_ID);
2058
2148
  var shrinkColumns = groupContainer.querySelectorAll('.' + 'e-ribbon-shrink');
2059
- for (var i_2 = 0; i_2 < shrinkColumns.length; i_2++) {
2060
- shrinkColumns[parseInt(i_2.toString(), 10)].remove();
2149
+ for (var i_4 = 0; i_4 < shrinkColumns.length; i_4++) {
2150
+ shrinkColumns[parseInt(i_4.toString(), 10)].remove();
2061
2151
  }
2062
2152
  var groupHeader = groupContainer.querySelector('#' + group.id + constants.HEADER_ID);
2063
2153
  groupHeader.remove();
@@ -2125,9 +2215,9 @@ var Ribbon = /** @class */ (function (_super) {
2125
2215
  }
2126
2216
  else {
2127
2217
  this.element.classList.remove(constants.RIBBON_OVERFLOW);
2128
- for (var i_3 = 0; i_3 < groupList.length; i_3++) {
2129
- var group = groupList[parseInt(i_3.toString(), 10)];
2130
- var alignType = groupList[parseInt(i_3.toString(), 10)].orientation;
2218
+ for (var i_5 = 0; i_5 < groupList.length; i_5++) {
2219
+ var group = groupList[parseInt(i_5.toString(), 10)];
2220
+ var alignType = groupList[parseInt(i_5.toString(), 10)].orientation;
2131
2221
  var groupContainer = tabContent.querySelector('#' + group.id + constants.CONTAINER_ID);
2132
2222
  var groupContent = groupContainer.querySelector('#' + group.id + constants.CONTENT_ID);
2133
2223
  var groupHeader = this.createElement('div', {
@@ -2601,15 +2691,15 @@ var Ribbon = /** @class */ (function (_super) {
2601
2691
  var moduleName = this.getItemModuleName(item);
2602
2692
  if (moduleName !== 'template') {
2603
2693
  if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
2604
- for (var i_4 = 0; i_4 < item.groupButtonSettings.items.length; i_4++) {
2605
- var btnEle = ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_4);
2694
+ for (var i_6 = 0; i_6 < item.groupButtonSettings.items.length; i_6++) {
2695
+ var btnEle = ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_6);
2606
2696
  updateCommonProperty(btnEle, 'btn', commonProp);
2607
2697
  }
2608
2698
  }
2609
2699
  else if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
2610
2700
  updateCommonProperty(ele, 'dropdown-btn', commonProp);
2611
- for (var i_5 = 0; i_5 < item.groupButtonSettings.items.length; i_5++) {
2612
- var btnEle = document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_5);
2701
+ for (var i_7 = 0; i_7 < item.groupButtonSettings.items.length; i_7++) {
2702
+ var btnEle = document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_7);
2613
2703
  updateCommonProperty(btnEle, 'btn', commonProp);
2614
2704
  }
2615
2705
  }
@@ -3041,7 +3131,7 @@ var Ribbon = /** @class */ (function (_super) {
3041
3131
  var contentEle = this.tabObj.items[itemProp.tabIndex].content;
3042
3132
  var groupEle = contentEle.querySelector('#' + groupID);
3043
3133
  if (groupEle) {
3044
- isHidden ? groupEle.classList.add('e-hidden') : groupEle.classList.remove('e-hidden');
3134
+ this.updateHiddenElements(itemProp.tabIndex, isHidden ? 'hideGroup' : 'showGroup', groupID, isHidden, groupEle);
3045
3135
  }
3046
3136
  else {
3047
3137
  this.updateInitialProps(itemProp.tabIndex, groupID, 'hiddenGroups', isHidden);
@@ -3066,7 +3156,244 @@ var Ribbon = /** @class */ (function (_super) {
3066
3156
  }
3067
3157
  }
3068
3158
  }
3069
- this.refreshLayout();
3159
+ if (this.selectedTab === itemProp.tabIndex) {
3160
+ this.refreshLayout();
3161
+ }
3162
+ };
3163
+ Ribbon.prototype.updateHiddenElements = function (tabIndex, key, id, isHidden, element, group) {
3164
+ if (isHidden) {
3165
+ if (!(element.classList.contains('e-hidden'))) {
3166
+ this.checkHiddenElements(key, id, tabIndex);
3167
+ element.classList.add('e-hidden');
3168
+ if (key === 'hideItem') {
3169
+ this.checkHiddenItems(group, isHidden, tabIndex);
3170
+ }
3171
+ this.calculateHiddenElementsWidth(tabIndex);
3172
+ }
3173
+ }
3174
+ else {
3175
+ if (element.classList.contains('e-hidden')) {
3176
+ this.checkHiddenElements(key, id, tabIndex);
3177
+ element.classList.remove('e-hidden');
3178
+ this.calculateHiddenElementsWidth(tabIndex);
3179
+ if (key === 'showItem') {
3180
+ this.checkHiddenItems(group, isHidden, tabIndex);
3181
+ }
3182
+ }
3183
+ }
3184
+ };
3185
+ Ribbon.prototype.checkHiddenElements = function (key, id, tabIndex) {
3186
+ if (this.activeLayout === 'Simplified') {
3187
+ var hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
3188
+ if (!hiddenProps) {
3189
+ this.hiddenElements[parseInt(tabIndex.toString(), 10)] = {};
3190
+ hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
3191
+ }
3192
+ if (hiddenProps) {
3193
+ /* eslint-disable */
3194
+ if (!hiddenProps[key]) {
3195
+ hiddenProps[key] = [];
3196
+ }
3197
+ if (hiddenProps[key].length) {
3198
+ var index = hiddenProps[key].indexOf(id);
3199
+ if (index === -1) {
3200
+ hiddenProps[key].push(id);
3201
+ }
3202
+ }
3203
+ else {
3204
+ hiddenProps[key].push(id);
3205
+ }
3206
+ /* eslint-enable */
3207
+ }
3208
+ }
3209
+ };
3210
+ Ribbon.prototype.updateItemsSimplifiedWidth = function (tabIndex, key) {
3211
+ var hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
3212
+ /* eslint-disable */
3213
+ if (hiddenProps && hiddenProps[key] && hiddenProps[key].length) {
3214
+ var _loop_4 = function (i) {
3215
+ var contentEle = this_4.tabObj.items[tabIndex].content;
3216
+ var hiddenEle;
3217
+ var groupEle = void 0;
3218
+ var isGroupHidden = false;
3219
+ var widthDifference = 0;
3220
+ if (key === 'hideGroup' || key === 'showGroup') {
3221
+ hiddenEle = contentEle.querySelector('#' + hiddenProps[key][i]);
3222
+ }
3223
+ else {
3224
+ hiddenEle = contentEle.querySelector('#' + hiddenProps[key][i] + constants.CONTAINER_ID);
3225
+ }
3226
+ if (hiddenEle) {
3227
+ if (key === 'hideGroup' || key === 'hideItem') {
3228
+ var isHidden = false;
3229
+ if (hiddenEle.classList.contains('e-hidden')) {
3230
+ isHidden = true;
3231
+ hiddenEle.classList.remove('e-hidden');
3232
+ }
3233
+ if (key === 'hideItem') {
3234
+ groupEle = hiddenEle.closest('.e-ribbon-group');
3235
+ if (groupEle.classList.contains('e-hide-group')) {
3236
+ isGroupHidden = true;
3237
+ widthDifference = this_4.checkWidthDifference(hiddenEle, groupEle);
3238
+ }
3239
+ }
3240
+ this_4.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, true, tabIndex);
3241
+ this_4.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, true);
3242
+ if (isHidden) {
3243
+ hiddenEle.classList.add('e-hidden');
3244
+ }
3245
+ }
3246
+ else {
3247
+ if (key === 'showItem') {
3248
+ groupEle = hiddenEle.closest('.e-ribbon-group');
3249
+ if (groupEle.classList.contains('e-hide-group')) {
3250
+ isGroupHidden = true;
3251
+ groupEle.classList.remove('e-hide-group');
3252
+ groupEle.classList.remove('e-ribbon-emptyCollection');
3253
+ widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
3254
+ if (this_4.hiddenGroups.indexOf(groupEle.id) !== -1) {
3255
+ this_4.hiddenGroups.splice(this_4.hiddenGroups.indexOf(groupEle.id), 1);
3256
+ }
3257
+ }
3258
+ else {
3259
+ if (this_4.hiddenGroups.indexOf(groupEle.id) !== -1) {
3260
+ var hiddenItems = groupEle.querySelectorAll('.e-ribbon-item:not(.e-hidden)');
3261
+ hiddenItems.forEach(function (item) {
3262
+ if (item.id !== hiddenEle.id) {
3263
+ item.classList.add('e-hidden');
3264
+ }
3265
+ });
3266
+ widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
3267
+ hiddenItems.forEach(function (item) {
3268
+ if (item.id !== hiddenEle.id) {
3269
+ item.classList.remove('e-hidden');
3270
+ }
3271
+ });
3272
+ this_4.hiddenGroups.splice(this_4.hiddenGroups.indexOf(groupEle.id), 1);
3273
+ }
3274
+ }
3275
+ }
3276
+ this_4.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, false, tabIndex);
3277
+ this_4.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, false);
3278
+ }
3279
+ if (isGroupHidden) {
3280
+ groupEle.classList.add('e-hide-group');
3281
+ groupEle.classList.add('e-ribbon-emptyCollection');
3282
+ }
3283
+ }
3284
+ var index = hiddenProps[key].indexOf(hiddenProps[key][i]);
3285
+ if (index !== -1) {
3286
+ hiddenProps[key].splice(index, 1);
3287
+ i--;
3288
+ }
3289
+ out_i_1 = i;
3290
+ };
3291
+ var this_4 = this, out_i_1;
3292
+ for (var i = 0; i < hiddenProps[key].length; i++) {
3293
+ _loop_4(i);
3294
+ i = out_i_1;
3295
+ }
3296
+ }
3297
+ };
3298
+ Ribbon.prototype.checkWidthDifference = function (hiddenEle, groupEle) {
3299
+ var widthDifference = 0;
3300
+ groupEle.classList.remove('e-hide-group');
3301
+ groupEle.classList.remove('e-ribbon-emptyCollection');
3302
+ if (this.hiddenGroups.length) {
3303
+ if (this.hiddenGroups.indexOf(groupEle.id) === -1) {
3304
+ this.hiddenGroups.push(groupEle.id);
3305
+ widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
3306
+ }
3307
+ }
3308
+ else {
3309
+ this.hiddenGroups.push(groupEle.id);
3310
+ widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
3311
+ }
3312
+ return widthDifference;
3313
+ };
3314
+ Ribbon.prototype.calculateHiddenElementsWidth = function (tabIndex) {
3315
+ if (tabIndex === this.selectedTab && this.activeLayout === 'Simplified') {
3316
+ var hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
3317
+ if (hiddenProps) {
3318
+ for (var i = 0; i < Object.keys(hiddenProps).length; i++) {
3319
+ this.updateItemsSimplifiedWidth(tabIndex, Object.keys(hiddenProps)[parseInt(i.toString(), 10)]);
3320
+ }
3321
+ }
3322
+ }
3323
+ };
3324
+ Ribbon.prototype.calculateMediumDataWidth = function (hiddenWidth, tabIndex, isHidden) {
3325
+ if (this.selectedTab === tabIndex && this.activeLayout === 'Simplified') {
3326
+ var activeContent = this.tabObj.element.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + constants.CONTENT_ID);
3327
+ var mediumDataItems = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-item'));
3328
+ if (this.overflowDDB) {
3329
+ var overflowEle = this.overflowDDB.target;
3330
+ var overflowItems = overflowEle.querySelectorAll('.e-ribbon-item');
3331
+ var selectedOFTab = document.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
3332
+ for (var i = 0; i < overflowItems.length; i++) {
3333
+ var ofTab = overflowItems[parseInt(i.toString(), 10)].closest('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
3334
+ if (selectedOFTab && ofTab && selectedOFTab.id === ofTab.id && overflowItems[parseInt(i.toString(), 10)].hasAttribute('data-medium-width')) {
3335
+ mediumDataItems.push(overflowItems[parseInt(i.toString(), 10)]);
3336
+ }
3337
+ }
3338
+ }
3339
+ var groupOFButton = activeContent.querySelectorAll('.e-ribbon-group-of-btn');
3340
+ for (var i = 0; i < groupOFButton.length; i++) {
3341
+ var overflowButton = getInstance(groupOFButton[parseInt(i.toString(), 10)], DropDownButton);
3342
+ var overflowBtnTarget = overflowButton.target;
3343
+ var overflowItems = overflowBtnTarget.querySelectorAll('.e-ribbon-item');
3344
+ for (var i_8 = 0; i_8 < overflowItems.length; i_8++) {
3345
+ if (overflowItems[parseInt(i_8.toString(), 10)].hasAttribute('data-medium-width')) {
3346
+ mediumDataItems.push(overflowItems[parseInt(i_8.toString(), 10)]);
3347
+ }
3348
+ }
3349
+ }
3350
+ for (var i = 0; i < mediumDataItems.length; i++) {
3351
+ if (mediumDataItems[parseInt(i.toString(), 10)].hasAttribute('data-medium-width')) {
3352
+ var previousWidth = parseInt(mediumDataItems[parseInt(i.toString(), 10)].getAttribute('data-medium-width'), 10);
3353
+ mediumDataItems[parseInt(i.toString(), 10)].setAttribute('data-medium-width', isHidden ? (previousWidth - hiddenWidth).toString() : (previousWidth + hiddenWidth).toString());
3354
+ }
3355
+ }
3356
+ }
3357
+ };
3358
+ Ribbon.prototype.calculateOverflowItemsWidth = function (hiddenItem, isHidden, tabIndex) {
3359
+ if (this.selectedTab === tabIndex && this.activeLayout === 'Simplified') {
3360
+ var groupList = this.tabs[parseInt(tabIndex.toString(), 10)].groups;
3361
+ for (var i = 0; i < groupList.length; i++) {
3362
+ var group = groupList[parseInt(i.toString(), 10)];
3363
+ if (group.enableGroupOverflow) {
3364
+ var groupContainer = document.querySelector('#' + group.id);
3365
+ var overflowButton = void 0;
3366
+ var overflowDDB = groupContainer.querySelector('#' + group.id + constants.GROUPOF_BUTTON_ID);
3367
+ if (overflowDDB) {
3368
+ overflowButton = getInstance(overflowDDB, DropDownButton);
3369
+ }
3370
+ if (overflowButton) {
3371
+ var overflowEle = overflowButton.target;
3372
+ var overflowItems = overflowEle.querySelectorAll('.e-ribbon-item');
3373
+ for (var i_9 = 0; i_9 < overflowItems.length; i_9++) {
3374
+ var previousWidth = parseInt(overflowItems[parseInt(i_9.toString(), 10)].getAttribute('data-simplified-width'), 10);
3375
+ if (previousWidth) {
3376
+ overflowItems[parseInt(i_9.toString(), 10)].setAttribute('data-simplified-width', isHidden ? (previousWidth - hiddenItem).toString() : (previousWidth + hiddenItem).toString());
3377
+ }
3378
+ }
3379
+ }
3380
+ }
3381
+ }
3382
+ }
3383
+ if (this.overflowDDB) {
3384
+ var selectedOFTab = document.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
3385
+ var overflowEle = this.overflowDDB.target;
3386
+ var overflowItems = overflowEle.querySelectorAll('.e-ribbon-item');
3387
+ for (var i = 0; i < overflowItems.length; i++) {
3388
+ var ofTab = overflowItems[parseInt(i.toString(), 10)].closest('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + constants.OVERFLOW_ID);
3389
+ if (selectedOFTab && ofTab && selectedOFTab.id === ofTab.id) {
3390
+ var previousWidth = parseInt(overflowItems[parseInt(i.toString(), 10)].getAttribute('data-simplified-width'), 10);
3391
+ if (previousWidth) {
3392
+ overflowItems[parseInt(i.toString(), 10)].setAttribute('data-simplified-width', isHidden ? (previousWidth - hiddenItem).toString() : (previousWidth + hiddenItem).toString());
3393
+ }
3394
+ }
3395
+ }
3396
+ }
3070
3397
  };
3071
3398
  /**
3072
3399
  * Disables a specific group within a ribbon tab.
@@ -3327,9 +3654,10 @@ var Ribbon = /** @class */ (function (_super) {
3327
3654
  }
3328
3655
  if (ele) {
3329
3656
  var itemEle = closest(ele, '.e-ribbon-item');
3330
- isHidden ? itemEle.classList.add('e-hidden') : itemEle.classList.remove('e-hidden');
3331
- this.checkHiddenItems(itemProp.group, isHidden, itemProp.tabIndex);
3332
- this.refreshLayout();
3657
+ this.updateHiddenElements(itemProp.tabIndex, isHidden ? 'hideItem' : 'showItem', itemId, isHidden, itemEle, itemProp.group);
3658
+ if (this.selectedTab === itemProp.tabIndex) {
3659
+ this.refreshLayout();
3660
+ }
3333
3661
  }
3334
3662
  else {
3335
3663
  this.updateInitialProps(itemProp.tabIndex, itemId, 'hiddenItems', isHidden);
@@ -3896,6 +4224,9 @@ var Ribbon = /** @class */ (function (_super) {
3896
4224
  this.keyboardModuleRibbon.destroy();
3897
4225
  this.keyboardModuleRibbon = null;
3898
4226
  destroyTooltip(this.element);
4227
+ if (this.refreshing) {
4228
+ this.clearOverflowDropDown(this.selectedTab);
4229
+ }
3899
4230
  this.destroyTabItems(this.tabs);
3900
4231
  if (!this.hideLayoutSwitcher) {
3901
4232
  this.removeExpandCollapse();
@@ -3903,6 +4234,7 @@ var Ribbon = /** @class */ (function (_super) {
3903
4234
  this.collapseButton = undefined;
3904
4235
  if (this.scrollModule) {
3905
4236
  this.scrollModule.destroy();
4237
+ this.scrollModule = null;
3906
4238
  }
3907
4239
  if (this.ribbonTempEle) {
3908
4240
  remove(this.ribbonTempEle);
@@ -3912,6 +4244,8 @@ var Ribbon = /** @class */ (function (_super) {
3912
4244
  this.tabObj.destroy();
3913
4245
  this.tabObj = undefined;
3914
4246
  this.initialPropsData = {};
4247
+ this.hiddenGroups = [];
4248
+ this.hiddenElements = {};
3915
4249
  remove(this.element.querySelector('#' + this.element.id + constants.TAB_ID));
3916
4250
  this.element.style.removeProperty(constants.RIBBON_FILE_MENU_WIDTH);
3917
4251
  this.element.style.removeProperty(constants.RIBBON_HELP_PANE_TEMPLATE_WIDTH);
@@ -31,6 +31,7 @@ export declare class RibbonGroupButton {
31
31
  * @hidden
32
32
  */
33
33
  switchGroupButton(item: RibbonItemModel, itemElement: HTMLElement): void;
34
+ private handleFocusState;
34
35
  private addGroupButtonHeader;
35
36
  private handleGroupButtonNavigation;
36
37
  /**