@syncfusion/ej2-ribbon 24.2.8 → 25.1.35

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 (125) hide show
  1. package/CHANGELOG.md +5 -9
  2. package/README.md +3 -0
  3. package/dist/ej2-ribbon.umd.min.js +2 -2
  4. package/dist/ej2-ribbon.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-ribbon.es2015.js +2051 -137
  6. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  7. package/dist/es6/ej2-ribbon.es5.js +2180 -146
  8. package/dist/es6/ej2-ribbon.es5.js.map +1 -1
  9. package/dist/global/ej2-ribbon.min.js +2 -2
  10. package/dist/global/ej2-ribbon.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/global.js +1 -1
  14. package/src/ribbon/base/constant.d.ts +8 -0
  15. package/src/ribbon/base/constant.js +8 -0
  16. package/src/ribbon/base/interface.d.ts +114 -1
  17. package/src/ribbon/base/interface.js +4 -0
  18. package/src/ribbon/base/ribbon-model.d.ts +22 -1
  19. package/src/ribbon/base/ribbon.d.ts +67 -5
  20. package/src/ribbon/base/ribbon.js +457 -76
  21. package/src/ribbon/base/utils.d.ts +3 -2
  22. package/src/ribbon/base/utils.js +3 -2
  23. package/src/ribbon/items/index.d.ts +1 -0
  24. package/src/ribbon/items/index.js +1 -0
  25. package/src/ribbon/items/ribbon-colorpicker.js +6 -1
  26. package/src/ribbon/items/ribbon-gallery.d.ts +87 -0
  27. package/src/ribbon/items/ribbon-gallery.js +712 -0
  28. package/src/ribbon/items/ribbon-groupbutton.js +3 -0
  29. package/src/ribbon/models/index.d.ts +8 -0
  30. package/src/ribbon/models/index.js +4 -0
  31. package/src/ribbon/models/ribbon-back-stage-settings-model.d.ts +7 -0
  32. package/src/ribbon/models/ribbon-back-stage-settings.d.ts +6 -0
  33. package/src/ribbon/models/ribbon-back-stage-settings.js +3 -0
  34. package/src/ribbon/models/ribbon-backstage-item-model.d.ts +7 -0
  35. package/src/ribbon/models/ribbon-backstage-item.d.ts +6 -0
  36. package/src/ribbon/models/ribbon-backstage-item.js +3 -0
  37. package/src/ribbon/models/ribbon-contextual-tab-settings-model.d.ts +30 -0
  38. package/src/ribbon/models/ribbon-contextual-tab-settings.d.ts +33 -0
  39. package/src/ribbon/models/ribbon-contextual-tab-settings.js +50 -0
  40. package/src/ribbon/models/ribbon-file-menu-settings-model.d.ts +7 -0
  41. package/src/ribbon/models/ribbon-file-menu-settings.d.ts +6 -0
  42. package/src/ribbon/models/ribbon-file-menu-settings.js +3 -0
  43. package/src/ribbon/models/ribbon-gallery-group-model.d.ts +44 -0
  44. package/src/ribbon/models/ribbon-gallery-group.d.ts +38 -0
  45. package/src/ribbon/models/ribbon-gallery-group.js +47 -0
  46. package/src/ribbon/models/ribbon-gallery-item-model.d.ts +43 -0
  47. package/src/ribbon/models/ribbon-gallery-item.d.ts +38 -0
  48. package/src/ribbon/models/ribbon-gallery-item.js +46 -0
  49. package/src/ribbon/models/ribbon-gallery-settings-model.d.ts +108 -0
  50. package/src/ribbon/models/ribbon-gallery-settings.d.ts +95 -0
  51. package/src/ribbon/models/ribbon-gallery-settings.js +71 -0
  52. package/src/ribbon/models/ribbon-group-button-item-model.d.ts +7 -0
  53. package/src/ribbon/models/ribbon-group-button-item.d.ts +6 -0
  54. package/src/ribbon/models/ribbon-group-button-item.js +3 -0
  55. package/src/ribbon/models/ribbon-group-model.d.ts +14 -0
  56. package/src/ribbon/models/ribbon-group.d.ts +12 -0
  57. package/src/ribbon/models/ribbon-group.js +6 -0
  58. package/src/ribbon/models/ribbon-item-model.d.ts +15 -1
  59. package/src/ribbon/models/ribbon-item.d.ts +13 -0
  60. package/src/ribbon/models/ribbon-item.js +7 -0
  61. package/src/ribbon/models/ribbon-tab-model.d.ts +7 -0
  62. package/src/ribbon/models/ribbon-tab.d.ts +6 -0
  63. package/src/ribbon/models/ribbon-tab.js +3 -0
  64. package/src/ribbon/modules/index.d.ts +2 -0
  65. package/src/ribbon/modules/index.js +2 -0
  66. package/src/ribbon/modules/ribbon-backstage.d.ts +2 -0
  67. package/src/ribbon/modules/ribbon-backstage.js +37 -0
  68. package/src/ribbon/modules/ribbon-contextualtab.d.ts +27 -0
  69. package/src/ribbon/modules/ribbon-contextualtab.js +90 -0
  70. package/src/ribbon/modules/ribbon-filemenu.d.ts +2 -0
  71. package/src/ribbon/modules/ribbon-filemenu.js +19 -0
  72. package/src/ribbon/modules/ribbon-keytip.d.ts +54 -0
  73. package/src/ribbon/modules/ribbon-keytip.js +554 -0
  74. package/styles/bootstrap-dark.css +398 -24
  75. package/styles/bootstrap.css +389 -15
  76. package/styles/bootstrap4.css +398 -24
  77. package/styles/bootstrap5-dark.css +391 -17
  78. package/styles/bootstrap5.css +391 -17
  79. package/styles/fabric-dark.css +390 -16
  80. package/styles/fabric.css +387 -13
  81. package/styles/fluent-dark.css +389 -15
  82. package/styles/fluent.css +389 -15
  83. package/styles/highcontrast-light.css +381 -7
  84. package/styles/highcontrast.css +390 -16
  85. package/styles/material-dark.css +391 -17
  86. package/styles/material.css +391 -17
  87. package/styles/material3-dark.css +389 -15
  88. package/styles/material3.css +389 -15
  89. package/styles/ribbon/_bds-definition.scss +360 -0
  90. package/styles/ribbon/_bootstrap-dark-definition.scss +81 -6
  91. package/styles/ribbon/_bootstrap-definition.scss +81 -6
  92. package/styles/ribbon/_bootstrap4-definition.scss +82 -7
  93. package/styles/ribbon/_bootstrap5-definition.scss +81 -6
  94. package/styles/ribbon/_fabric-dark-definition.scss +79 -4
  95. package/styles/ribbon/_fabric-definition.scss +78 -3
  96. package/styles/ribbon/_fluent-definition.scss +80 -5
  97. package/styles/ribbon/_fusionnew-definition.scss +76 -1
  98. package/styles/ribbon/_highcontrast-definition.scss +80 -5
  99. package/styles/ribbon/_highcontrast-light-definition.scss +76 -1
  100. package/styles/ribbon/_layout.scss +344 -38
  101. package/styles/ribbon/_material-dark-definition.scss +80 -5
  102. package/styles/ribbon/_material-definition.scss +81 -6
  103. package/styles/ribbon/_material3-definition.scss +80 -5
  104. package/styles/ribbon/_tailwind-definition.scss +80 -5
  105. package/styles/ribbon/_theme.scss +71 -0
  106. package/styles/ribbon/bootstrap-dark.css +398 -24
  107. package/styles/ribbon/bootstrap.css +389 -15
  108. package/styles/ribbon/bootstrap4.css +398 -24
  109. package/styles/ribbon/bootstrap5-dark.css +391 -17
  110. package/styles/ribbon/bootstrap5.css +391 -17
  111. package/styles/ribbon/fabric-dark.css +390 -16
  112. package/styles/ribbon/fabric.css +387 -13
  113. package/styles/ribbon/fluent-dark.css +389 -15
  114. package/styles/ribbon/fluent.css +389 -15
  115. package/styles/ribbon/highcontrast-light.css +381 -7
  116. package/styles/ribbon/highcontrast.css +390 -16
  117. package/styles/ribbon/icons/_bds.scss +9 -0
  118. package/styles/ribbon/material-dark.css +391 -17
  119. package/styles/ribbon/material.css +391 -17
  120. package/styles/ribbon/material3-dark.css +389 -15
  121. package/styles/ribbon/material3.css +389 -15
  122. package/styles/ribbon/tailwind-dark.css +390 -16
  123. package/styles/ribbon/tailwind.css +390 -16
  124. package/styles/tailwind-dark.css +390 -16
  125. package/styles/tailwind.css +390 -16
@@ -20,12 +20,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
20
20
  import { addClass, append, Event, Collection, Complex, Component, EventHandler, formatUnit, getInstance, getComponent, getUniqueID, closest, KeyboardEvents } from '@syncfusion/ej2-base';
21
21
  import { isNullOrUndefined, isUndefined, NotifyPropertyChanges, Property, remove, removeClass } from '@syncfusion/ej2-base';
22
22
  import { Tab, TabAnimationSettings, HScroll, Toolbar } from '@syncfusion/ej2-navigations';
23
- import { RibbonTab, FileMenuSettings, BackStageMenu } from '../models/index';
23
+ import { RibbonTab, FileMenuSettings, BackStageMenu, RibbonContextualTabSettings } from '../models/index';
24
24
  import { DisplayMode, RibbonLayout } from './interface';
25
25
  import { ItemOrientation, RibbonItemSize, RibbonItemType } from './interface';
26
26
  import { RibbonButton, RibbonComboBox, RibbonCheckBox, RibbonDropDown, RibbonSplitButton, RibbonGroupButton } from '../items/index';
27
27
  import { destroyControl, getCollection, getGroup, getIndex, getItem, getItemElement, updateCommonProperty, updateControlDisabled, isTooltipPresent, getTemplateFunction, createTooltip, destroyTooltip, updateTooltipProp } from './utils';
28
28
  import * as constants from './constant';
29
+ import { Popup } from '@syncfusion/ej2-popups';
29
30
  import { DropDownButton, SplitButton } from '@syncfusion/ej2-splitbuttons';
30
31
  import { CheckBox } from '@syncfusion/ej2-buttons';
31
32
  /**
@@ -56,10 +57,12 @@ var Ribbon = /** @class */ (function (_super) {
56
57
  this.initialize();
57
58
  };
58
59
  Ribbon.prototype.preRender = function () {
60
+ this.keysPress = '';
59
61
  this.idIndex = 0;
60
62
  this.tooltipData = [];
61
63
  this.initialPropsData = {};
62
64
  this.hiddenElements = {};
65
+ this.keyTipElements = {};
63
66
  this.hiddenGroups = [];
64
67
  this.isAddRemove = false;
65
68
  this.keyConfigs = {
@@ -94,7 +97,27 @@ var Ribbon = /** @class */ (function (_super) {
94
97
  */
95
98
  Ribbon.prototype.requiredModules = function () {
96
99
  var modules = [];
97
- modules.push({ member: 'ribbonButton', args: [this] }, { member: 'ribbonDropDown', args: [this] }, { member: 'ribbonSplitButton', args: [this] }, { member: 'ribbonCheckBox', args: [this] }, { member: 'ribbonColorPicker', args: [this] }, { member: 'ribbonComboBox', args: [this] }, { member: 'ribbonGroupButton', args: [this] }, { member: 'ribbonFileMenu', args: [this] }, { member: 'ribbonBackstage', args: [this] });
100
+ modules.push({ member: 'ribbonButton', args: [this], name: 'RibbonButton' }, { member: 'ribbonDropDown', args: [this], name: 'RibbonDropDown' }, { member: 'ribbonSplitButton', args: [this], name: 'RibbonSplitButton' }, { member: 'ribbonCheckBox', args: [this], name: 'RibbonCheckBox' }, { member: 'ribbonComboBox', args: [this], name: 'RibbonComboBox' }, { member: 'ribbonGroupButton', args: [this], name: 'RibbonGroupButton' });
101
+ var canInjectColorPickerModule = getItem(this.tabs, null, RibbonItemType.ColorPicker);
102
+ var canInjectGalleryModule = getItem(this.tabs, null, RibbonItemType.Gallery);
103
+ if (canInjectColorPickerModule) {
104
+ modules.push({ member: 'ribbonColorPicker', args: [this], name: 'RibbonColorPicker' });
105
+ }
106
+ if (canInjectGalleryModule) {
107
+ modules.push({ member: 'ribbonGallery', args: [this], name: 'RibbonGallery' });
108
+ }
109
+ if (this.backStageMenu.visible || this.backStageMenu.items.length) {
110
+ modules.push({ member: 'ribbonBackstage', args: [this], name: 'RibbonBackstage' });
111
+ }
112
+ if (this.fileMenu.visible || this.fileMenu.menuItems.length) {
113
+ modules.push({ member: 'ribbonFileMenu', args: [this], name: 'RibbonFileMenu' });
114
+ }
115
+ if (this.contextualTabs.length) {
116
+ modules.push({ member: 'ribbonContextualTab', args: [this], name: 'RibbonContextualTab' });
117
+ }
118
+ if (this.enableKeyTips) {
119
+ modules.push({ member: 'ribbonKeyTip', args: [this], name: 'RibbonKeyTip' });
120
+ }
98
121
  return modules;
99
122
  };
100
123
  Ribbon.prototype.initialize = function () {
@@ -105,6 +128,9 @@ var Ribbon = /** @class */ (function (_super) {
105
128
  }
106
129
  this.element.style.width = formatUnit(this.width);
107
130
  this.renderTabs();
131
+ if (this.ribbonContextualTabModule) {
132
+ this.ribbonContextualTabModule.addContextualTabs();
133
+ }
108
134
  if (this.ribbonFileMenuModule) {
109
135
  this.ribbonFileMenuModule.createFileMenu(this.fileMenu);
110
136
  }
@@ -114,13 +140,18 @@ var Ribbon = /** @class */ (function (_super) {
114
140
  this.createHelpPaneTemplate();
115
141
  var toolbar = this.tabObj['tbObj'];
116
142
  toolbar.refreshOverflow();
143
+ this.addTabOverflowKeyTip();
117
144
  createTooltip(this.element, this);
145
+ this.isKeytipOpen = false;
118
146
  this.wireEvents();
119
147
  this.wireKeyboardEvent();
120
148
  this.currentControlIndex = 0;
121
149
  };
122
150
  Ribbon.prototype.wireEvents = function () {
123
151
  EventHandler.add(window, 'resize', this.resizeHandler, this);
152
+ EventHandler.add(document.body, 'keydown', this.keytipActionHandler, this);
153
+ EventHandler.add(document, 'mousedown', this.mouseEventHandler, this);
154
+ EventHandler.add(document, 'scroll', this.mouseEventHandler, this);
124
155
  };
125
156
  Ribbon.prototype.wireKeyboardEvent = function () {
126
157
  this.keyboardModuleRibbon = new KeyboardEvents(this.element, {
@@ -136,7 +167,8 @@ var Ribbon = /** @class */ (function (_super) {
136
167
  var activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + constants.CONTENT_ID);
137
168
  var controlElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-control'));
138
169
  var templateElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-template'));
139
- var ribbonControls = controlElements.concat(templateElements);
170
+ var galleryElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-gallery-item'));
171
+ var ribbonControls = controlElements.concat(templateElements, galleryElements);
140
172
  var comboBoxElements = activeContent.querySelectorAll('.e-combobox');
141
173
  var comboBoxEle;
142
174
  if (comboBoxElements) {
@@ -165,7 +197,7 @@ var Ribbon = /** @class */ (function (_super) {
165
197
  if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
166
198
  e.target.classList.contains('e-ribbon-collapse-btn') || e.target.classList.contains('e-ribbon-last-item') ||
167
199
  e.target.classList.contains('e-ribbon-first-item') || e.target.classList.contains('e-ribbon-group-of-btn') ||
168
- e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template')) {
200
+ e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-gallery-item')) {
169
201
  switch (e.action) {
170
202
  case 'rightarrow':
171
203
  this.handleNavigation(e, !this.enableRtl, ribbonControls);
@@ -207,7 +239,7 @@ var Ribbon = /** @class */ (function (_super) {
207
239
  }
208
240
  }
209
241
  if ((!enableRtl && (this.currentControlIndex > 0)) || (enableRtl && (this.currentControlIndex < ribbonControls.length - 1))) {
210
- if (!e.target.classList.contains('e-combobox') && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template')) && !e.target.classList.contains('e-ribbon-last-item')) {
242
+ if (!e.target.classList.contains('e-combobox') && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-gallery-item')) && !e.target.classList.contains('e-ribbon-last-item')) {
211
243
  if (enableRtl) {
212
244
  this.currentControlIndex++;
213
245
  }
@@ -366,6 +398,111 @@ var Ribbon = /** @class */ (function (_super) {
366
398
  }
367
399
  }
368
400
  }
401
+ var galleryPopupEle = document.querySelector('.e-ribbon-gallery-popup.e-popup-open');
402
+ if (galleryPopupEle) {
403
+ var popup = getComponent(galleryPopupEle, Popup);
404
+ popup.hide();
405
+ }
406
+ if (this.ribbonKeyTipModule && this.enableKeyTips) {
407
+ this.ribbonKeyTipModule.removeKeytip();
408
+ }
409
+ };
410
+ Ribbon.prototype.mouseEventHandler = function (e) {
411
+ if (this.ribbonKeyTipModule && this.enableKeyTips) {
412
+ this.ribbonKeyTipModule.removeKeytip();
413
+ }
414
+ };
415
+ Ribbon.prototype.keytipActionHandler = function (e) {
416
+ if (this.enableKeyTips) {
417
+ var isKeyTipPresent = false;
418
+ var keyPress = e.key;
419
+ if (e.altKey && e.key === 'Meta') {
420
+ var activePopup = document.querySelectorAll('.e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active');
421
+ if (activePopup.length) {
422
+ for (var i = 0; i < activePopup.length; i++) {
423
+ var dropDownBtn = getInstance(activePopup[parseInt(i.toString(), 10)], DropDownButton);
424
+ dropDownBtn.toggle();
425
+ }
426
+ this.ribbonKeyTipModule.removeKeytip();
427
+ }
428
+ else {
429
+ if (!this.isKeytipOpen) {
430
+ var backstagePopup = document.querySelector('.e-ribbon-backstage-popup');
431
+ if (backstagePopup && backstagePopup.classList.contains('e-popup-open')) {
432
+ this.ribbonBackstageModule.hideBackstage();
433
+ }
434
+ this.ribbonKeyTipModule.createKeytip('tab');
435
+ }
436
+ else {
437
+ this.ribbonKeyTipModule.removeKeytip();
438
+ }
439
+ }
440
+ }
441
+ else if (e.key === 'Escape' || e.key === 'Tab' || e.key === 'ArrowLeft' || e.key === 'ArrowUp' || e.key === 'ArrowRight' || e.key === 'ArrowDown') {
442
+ this.ribbonKeyTipModule.removeKeytip(e.key);
443
+ }
444
+ else {
445
+ var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
446
+ if (keyTipItems) {
447
+ for (var i = 0; i < keyTipItems.length; i++) {
448
+ var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
449
+ if (keyTipItem.innerHTML.toLowerCase() === keyPress) {
450
+ isKeyTipPresent = true;
451
+ this.ribbonKeyTipModule.keytipPress(keyPress);
452
+ break;
453
+ }
454
+ }
455
+ if (!isKeyTipPresent) {
456
+ this.checkKeyTipPresent(keyPress, this.keysPress.length);
457
+ }
458
+ }
459
+ }
460
+ }
461
+ };
462
+ Ribbon.prototype.checkKeyTipPresent = function (keyTip, length) {
463
+ var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
464
+ for (var i = 0; i < keyTipItems.length; i++) {
465
+ var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
466
+ if (keyTipItem.innerHTML.length > 1 && keyTipItem.innerHTML[parseInt(length.toString(), 10)].toLowerCase() === keyTip) {
467
+ this.keysPress += keyTip;
468
+ this.ribbonKeyTipModule.keytipPress(this.keysPress);
469
+ this.removeKeytip(this.keysPress);
470
+ break;
471
+ }
472
+ }
473
+ };
474
+ Ribbon.prototype.removeKeytip = function (keyTip) {
475
+ var keyTipItems = document.querySelectorAll('.e-ribbon-keytip');
476
+ for (var i = 0; i < keyTipItems.length; i++) {
477
+ var keyTipItem = keyTipItems[parseInt(i.toString(), 10)];
478
+ if (keyTipItem.innerHTML[0].toLowerCase() !== keyTip && keyTip !== '') {
479
+ remove(keyTipItem);
480
+ }
481
+ }
482
+ };
483
+ Ribbon.prototype.addKeyTip = function (tabIndex, keyTip, id, type) {
484
+ if (this.keyTipElements && this.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
485
+ var isKeyTipExist = false;
486
+ /* eslint-disable */
487
+ if (!(this.keyTipElements[parseInt(tabIndex.toString(), 10)][type])) {
488
+ this.keyTipElements[parseInt(tabIndex.toString(), 10)][type] = [];
489
+ }
490
+ if (Object.keys(this.keyTipElements[tabIndex][type]).length) {
491
+ var keytipData = this.keyTipElements[tabIndex][type];
492
+ for (var i = 0; i < Object.keys(this.keyTipElements[tabIndex][type]).length; i++) {
493
+ if (keytipData[parseInt(i.toString(), 10)].id === id) {
494
+ isKeyTipExist = true;
495
+ }
496
+ }
497
+ if (!isKeyTipExist) {
498
+ this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
499
+ }
500
+ }
501
+ else {
502
+ this.keyTipElements[tabIndex][type].push({ id: id, type: type, keyTip: keyTip });
503
+ }
504
+ /* eslint-enable */
505
+ }
369
506
  };
370
507
  Ribbon.prototype.renderTabs = function () {
371
508
  this.tabsInternal = this.tabs.slice();
@@ -428,14 +565,20 @@ var Ribbon = /** @class */ (function (_super) {
428
565
  this.renderInitialTab(this.selectedTab);
429
566
  };
430
567
  Ribbon.prototype.ribbonTabSelected = function (e) {
568
+ e.preventFocus = true;
431
569
  this.isAddRemove = false;
432
570
  var selectedTabId = e.selectedItem.getAttribute('data-id');
433
571
  var selectedIndex = getIndex(this.tabs, (function (tab) { return (tab.id === selectedTabId); }));
434
572
  selectedIndex = selectedIndex === -1 ? this.selectedTab : selectedIndex;
435
- var eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex };
573
+ var isContextual = this.isContextualTab(selectedTabId);
574
+ this.updateSelectedState(selectedTabId);
575
+ var eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex, isContextual: isContextual };
436
576
  this.setProperties({ selectedTab: selectedIndex }, true);
437
577
  this.calculateHiddenElementsWidth(selectedIndex);
438
578
  this.checkOverflow(selectedIndex, e.selectedContent.firstChild);
579
+ if (this.activeLayout === 'Classic' && this.ribbonGalleryModule) {
580
+ this.ribbonGalleryModule.checkAvailableHeight(selectedIndex, e.selectedContent.firstChild);
581
+ }
439
582
  if (this.activeLayout === 'Simplified' && this.overflowDDB) {
440
583
  var overflowTarget = this.overflowDDB.target;
441
584
  var ofTabContainer = overflowTarget.querySelector('.' + constants.RIBBON_TAB_ACTIVE);
@@ -454,6 +597,20 @@ var Ribbon = /** @class */ (function (_super) {
454
597
  }
455
598
  this.trigger('tabSelected', eventArgs);
456
599
  };
600
+ Ribbon.prototype.updateSelectedState = function (tabID) {
601
+ if (this.contextualTabs.length) {
602
+ for (var i = 0; i < this.contextualTabs.length; i++) {
603
+ var isSelected = false;
604
+ for (var j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
605
+ if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
606
+ isSelected = true;
607
+ break;
608
+ }
609
+ }
610
+ this.contextualTabs[parseInt(i.toString(), 10)].setProperties({ isSelected: isSelected }, true);
611
+ }
612
+ }
613
+ };
457
614
  Ribbon.prototype.checkOverflow = function (tabIndex, activeContent) {
458
615
  var tabContent = activeContent.closest('.' + constants.TAB_CONTENT);
459
616
  var isOverFlow = tabContent.offsetWidth < activeContent.offsetWidth;
@@ -503,6 +660,17 @@ var Ribbon = /** @class */ (function (_super) {
503
660
  }
504
661
  }
505
662
  }
663
+ this.addTabOverflowKeyTip();
664
+ };
665
+ Ribbon.prototype.addTabOverflowKeyTip = function () {
666
+ var tabOverflow = this.tabObj.element.querySelector('#_nav');
667
+ if (tabOverflow) {
668
+ this.keyTipElements['taboverflow'] = [];
669
+ this.keyTipElements['taboverflow'].push({ id: tabOverflow.id, type: 'taboverflow', keyTip: '00' });
670
+ }
671
+ else {
672
+ delete (this.keyTipElements['taboverflow']);
673
+ }
506
674
  };
507
675
  Ribbon.prototype.checkSimplifiedItemShrinking = function (tabIndex, tabContent, activeContent) {
508
676
  var tab = this.tabs[parseInt(tabIndex.toString(), 10)];
@@ -637,7 +805,7 @@ var Ribbon = /** @class */ (function (_super) {
637
805
  item.setProperties({ activeSize: RibbonItemSize.Medium }, true);
638
806
  this.setItemSize(itemEle, item);
639
807
  }
640
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
808
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
641
809
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, true);
642
810
  }
643
811
  }
@@ -667,7 +835,7 @@ var Ribbon = /** @class */ (function (_super) {
667
835
  return isEmptyCollection;
668
836
  };
669
837
  Ribbon.prototype.updatePopupItems = function (item, itemEle, isGroupOF, isMenu) {
670
- var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
838
+ var dropdown = getComponent(itemEle.querySelector('#' + item.id), (item.type === RibbonItemType.DropDown || item.type === RibbonItemType.Gallery || item.type === RibbonItemType.GroupButton) ? DropDownButton : SplitButton);
671
839
  var dropDownPopup = dropdown.dropDown;
672
840
  // popup is on right if (isGroupOF && isMenu)
673
841
  // The position is reversed if RTL is enabled.
@@ -733,7 +901,7 @@ var Ribbon = /** @class */ (function (_super) {
733
901
  break;
734
902
  }
735
903
  var groupEle = tabContent.querySelector('#' + collection.id);
736
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
904
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
737
905
  this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
738
906
  }
739
907
  groupEle.append(itemContainer);
@@ -852,19 +1020,22 @@ var Ribbon = /** @class */ (function (_super) {
852
1020
  };
853
1021
  Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
854
1022
  var overflowButton;
1023
+ var overflowtarget;
855
1024
  var itemProp = getGroup(this.tabs, groupId);
856
1025
  var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
857
1026
  var groupEle = contentEle.querySelector('#' + groupId);
858
1027
  if (isGroupOF) {
859
1028
  var overflowDDB = groupContainer.querySelector('#' + groupId + constants.GROUPOF_BUTTON_ID);
860
1029
  if (!overflowDDB) {
861
- overflowButton = this.addOverflowButton(groupId + constants.GROUPOF_BUTTON_ID);
1030
+ overflowButton = this.addOverflowButton(groupId + constants.GROUPOF_BUTTON_ID, isGroupOF);
862
1031
  overflowButton.element.classList.add(constants.RIBBON_GROUP_OF_BUTTON);
863
1032
  groupContainer.appendChild(overflowButton.element);
864
1033
  }
865
1034
  else {
866
1035
  overflowButton = getInstance(overflowDDB, DropDownButton);
867
1036
  }
1037
+ this.addKeyTip(tabIndex, '0' + (itemProp.groupIndex + 1), overflowButton.element.id, 'grpofbtn');
1038
+ overflowtarget = overflowButton.target;
868
1039
  var overflowBtnTarget = overflowButton.target;
869
1040
  var headerEle = overflowBtnTarget.querySelector('#' + groupId + constants.GROUPOF_BUTTON_ID + constants.HEADER_ID);
870
1041
  if (!headerEle) {
@@ -893,7 +1064,7 @@ var Ribbon = /** @class */ (function (_super) {
893
1064
  }
894
1065
  else {
895
1066
  if (!this.overflowDDB) {
896
- this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + constants.OVRLOF_BUTTON_ID);
1067
+ this.overflowDDB = this.addOverflowButton(this.tabObj.element.id + constants.OVRLOF_BUTTON_ID, isGroupOF);
897
1068
  this.tabObj.element.insertBefore(this.overflowDDB.element, this.collapseButton);
898
1069
  this.overflowDDB.element.classList.add(constants.RIBBON_OVERALL_OF_BUTTON);
899
1070
  this.createOfTabContainer(groupId, groupHeader, itemEle, tabIndex);
@@ -926,10 +1097,16 @@ var Ribbon = /** @class */ (function (_super) {
926
1097
  }
927
1098
  }
928
1099
  overflowButton = this.overflowDDB;
1100
+ overflowtarget = this.overflowDDB ? this.overflowDDB.target : null;
929
1101
  }
930
1102
  if (itemEle !== null) {
931
1103
  this.addOverflowEvents(item, itemEle, overflowButton);
932
1104
  }
1105
+ if (overflowtarget) {
1106
+ if (item.keyTip) {
1107
+ this.addKeyTip(tabIndex, item.keyTip, item.id, 'popupitem');
1108
+ }
1109
+ }
933
1110
  };
934
1111
  Ribbon.prototype.addOverflowEvents = function (item, itemEle, overflowButton) {
935
1112
  switch (item.type) {
@@ -951,6 +1128,11 @@ var Ribbon = /** @class */ (function (_super) {
951
1128
  case 'ComboBox':
952
1129
  this.ribbonComboBoxModule.addOverFlowEvents(item, itemEle, overflowButton);
953
1130
  break;
1131
+ case 'Gallery':
1132
+ if (this.activeLayout === 'Simplified') {
1133
+ this.ribbonGalleryModule.addOverFlowEvents(item, itemEle, overflowButton);
1134
+ }
1135
+ break;
954
1136
  case 'GroupButton':
955
1137
  if (this.activeLayout === 'Simplified') {
956
1138
  this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle, overflowButton);
@@ -1629,6 +1811,10 @@ var Ribbon = /** @class */ (function (_super) {
1629
1811
  this_1.checkSmallToMedium(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
1630
1812
  this_1.checkMediumToLarge(tabIndex, tab, groupIndex, tabContent, activeContent, true, false);
1631
1813
  var dropdown = this_1.ribbonDropDownModule.createOverFlowDropDown(group.id, group.header, group.groupIconCss, groupContainer, groupOverFlow, this_1.enableRtl);
1814
+ if (group.keyTip) {
1815
+ var overflowDDB = group.id + constants.OVERFLOW_ID + constants.DROPDOWN_ID;
1816
+ this_1.addKeyTip(tabIndex, group.keyTip, overflowDDB, 'grpoverflow');
1817
+ }
1632
1818
  this_1.tabs[parseInt(tabIndex.toString(), 10)].
1633
1819
  groups[parseInt(groupIndex.toString(), 10)].setProperties({ isCollapsed: true }, true);
1634
1820
  for (var j = 0; j < group.collections.length; j++) {
@@ -1641,6 +1827,25 @@ var Ribbon = /** @class */ (function (_super) {
1641
1827
  this_1.handleContentSize(itemEle);
1642
1828
  this_1.addOverflowEvents(item, itemEle, dropdown);
1643
1829
  }
1830
+ var overflowDDB = document.querySelector('#' + group.id + constants.OVERFLOW_ID + constants.DROPDOWN_ID);
1831
+ var overflowButton = getInstance(overflowDDB, DropDownButton);
1832
+ if (overflowButton) {
1833
+ var overflowtarget = overflowButton.target;
1834
+ if (overflowtarget) {
1835
+ if (this_1.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
1836
+ if (item.type === RibbonItemType.GroupButton) {
1837
+ for (var i_3 = 0; i_3 < item.groupButtonSettings.items.length; i_3++) {
1838
+ if (item.groupButtonSettings.items[parseInt(i_3.toString(), 10)].keyTip) {
1839
+ this_1.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i_3.toString(), 10)].keyTip, item.id + (constants.RIBBON_GROUP_BUTTON_ID + i_3), 'grpoverflowpopup');
1840
+ }
1841
+ }
1842
+ }
1843
+ if (item.keyTip) {
1844
+ this_1.addKeyTip(tabIndex, item.keyTip, item.id, 'grpoverflowpopup');
1845
+ }
1846
+ }
1847
+ }
1848
+ }
1644
1849
  }
1645
1850
  }
1646
1851
  };
@@ -1739,16 +1944,31 @@ var Ribbon = /** @class */ (function (_super) {
1739
1944
  this.removeOverflowDropdown(activeContent, tabContent, true, index);
1740
1945
  }
1741
1946
  };
1947
+ Ribbon.prototype.isContextualTab = function (tabID) {
1948
+ var isContextual = false;
1949
+ if (this.contextualTabs.length) {
1950
+ for (var i = 0; i < this.contextualTabs.length; i++) {
1951
+ for (var j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
1952
+ if (this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id === tabID) {
1953
+ isContextual = true;
1954
+ break;
1955
+ }
1956
+ }
1957
+ }
1958
+ }
1959
+ return isContextual;
1960
+ };
1742
1961
  Ribbon.prototype.ribbonTabSelecting = function (e) {
1743
1962
  var _this = this;
1744
1963
  this.currentControlIndex = 0;
1745
1964
  var nextTabId = e.selectingItem.getAttribute('data-id');
1746
1965
  var previousTabId = e.previousItem.getAttribute('data-id');
1747
1966
  var nextIndex = getIndex(this.tabs, (function (tab) { return (tab.id === nextTabId); }));
1967
+ var isContextual = this.isContextualTab(nextTabId);
1748
1968
  var previousIndex = getIndex(this.tabs, (function (tab) { return (tab.id === previousTabId); }));
1749
1969
  nextIndex = nextIndex === -1 ? this.selectedTab : nextIndex;
1750
1970
  var eventArgs = {
1751
- cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex
1971
+ cancel: e.cancel, isInteracted: e.isInteracted, previousIndex: previousIndex, selectedIndex: nextIndex, isContextual: isContextual
1752
1972
  };
1753
1973
  this.trigger('tabSelecting', eventArgs, function (args) {
1754
1974
  if (args.cancel) {
@@ -1768,22 +1988,33 @@ var Ribbon = /** @class */ (function (_super) {
1768
1988
  Ribbon.prototype.createTabItems = function (tabs) {
1769
1989
  var _this = this;
1770
1990
  var tabItems = [];
1771
- for (var i = 0; i < tabs.length; i++) {
1991
+ var _loop_3 = function (i) {
1772
1992
  var ribbonTab = tabs[parseInt(i.toString(), 10)];
1773
- var header = this.createElement('span', {
1993
+ var header = this_3.createElement('span', {
1774
1994
  innerHTML: ribbonTab.header,
1775
1995
  id: ribbonTab.id + constants.HEADER_ID
1776
1996
  });
1997
+ var tabIndex = getIndex(this_3.tabs, (function (tab) { return (tab.id === ribbonTab.id); }));
1998
+ if (ribbonTab.keyTip) {
1999
+ if (!this_3.keyTipElements[parseInt(tabIndex.toString(), 10)]) {
2000
+ this_3.keyTipElements[parseInt(tabIndex.toString(), 10)] = {};
2001
+ }
2002
+ this_3.addKeyTip(tabIndex, ribbonTab.keyTip, ribbonTab.id, 'tab');
2003
+ }
1777
2004
  header.onclick = function () { _this.minimize(false); };
1778
2005
  header.ondblclick = function () { _this.minimize(true); };
1779
2006
  var tab = { header: { text: header }, id: ribbonTab.id, cssClass: ribbonTab.cssClass };
1780
- var content = this.createElement('div', {
2007
+ var content = this_3.createElement('div', {
1781
2008
  className: tab.cssClass,
1782
2009
  id: ribbonTab.id + constants.CONTENT_ID
1783
2010
  });
1784
2011
  content.classList.add(constants.RIBBON_TAB_ITEM);
1785
2012
  tab.content = content;
1786
2013
  tabItems.push(tab);
2014
+ };
2015
+ var this_3 = this;
2016
+ for (var i = 0; i < tabs.length; i++) {
2017
+ _loop_3(i);
1787
2018
  }
1788
2019
  return tabItems;
1789
2020
  };
@@ -1796,8 +2027,10 @@ var Ribbon = /** @class */ (function (_super) {
1796
2027
  }
1797
2028
  var activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + constants.CONTENT_ID);
1798
2029
  this.checkOverflow(this.selectedTab, activeContent);
2030
+ if (this.activeLayout === 'Classic' && this.ribbonGalleryModule)
2031
+ this.ribbonGalleryModule.checkAvailableHeight(this.selectedTab, activeContent);
1799
2032
  };
1800
- Ribbon.prototype.addOverflowButton = function (btnId) {
2033
+ Ribbon.prototype.addOverflowButton = function (btnId, isGroupOF) {
1801
2034
  var _this = this;
1802
2035
  var overflowButton = this.createElement('button', {
1803
2036
  id: btnId
@@ -1834,6 +2067,10 @@ var Ribbon = /** @class */ (function (_super) {
1834
2067
  }, overflowButton);
1835
2068
  this.element.classList.add(constants.RIBBON_OVERFLOW);
1836
2069
  createTooltip(overflowTarget, this);
2070
+ if (!isGroupOF) {
2071
+ this.keyTipElements['overflowbtn'] = [];
2072
+ this.keyTipElements['overflowbtn'].push({ id: btnId, type: 'overflowbtn', keyTip: '00' });
2073
+ }
1837
2074
  var isGroupOf;
1838
2075
  overflowButton.onkeydown = overflowButton.onclick = function () { _this.itemIndex = -1; isGroupOf = overflowButton.classList.contains('e-ribbon-overall-of-btn') ? false : true; };
1839
2076
  overflowTarget.onkeydown = function (e) { return (_this.upDownKeyHandler(e, overflowTarget, isGroupOf), _this); };
@@ -1994,6 +2231,9 @@ var Ribbon = /** @class */ (function (_super) {
1994
2231
  case 'ComboBox':
1995
2232
  this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
1996
2233
  break;
2234
+ case 'Gallery':
2235
+ this.ribbonGalleryModule.removeOverFlowEvents(item, itemEle);
2236
+ break;
1997
2237
  case 'GroupButton':
1998
2238
  this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
1999
2239
  break;
@@ -2031,6 +2271,10 @@ var Ribbon = /** @class */ (function (_super) {
2031
2271
  this.collapseButton.classList.add(constants.RIBBON_EXPAND_BUTTON);
2032
2272
  }
2033
2273
  this.tabObj.element.appendChild(this.collapseButton);
2274
+ if (this.layoutSwitcherKeyTip) {
2275
+ this.keyTipElements['collapse'] = [];
2276
+ this.keyTipElements['collapse'].push({ id: this.collapseButton.id, type: 'collapse', keyTip: this.layoutSwitcherKeyTip });
2277
+ }
2034
2278
  };
2035
2279
  Ribbon.prototype.removeExpandCollapse = function () {
2036
2280
  var _this = this;
@@ -2133,22 +2377,22 @@ var Ribbon = /** @class */ (function (_super) {
2133
2377
  var activeContent = this.tabObj.element.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + constants.CONTENT_ID);
2134
2378
  var tabContent = activeContent.closest('.' + constants.TAB_CONTENT);
2135
2379
  if (this.activeLayout === 'Simplified') {
2136
- for (var i_3 = 0; i_3 < groupList.length; i_3++) {
2137
- var group = groupList[parseInt(i_3.toString(), 10)];
2138
- var alignType = groupList[parseInt(i_3.toString(), 10)].orientation;
2380
+ for (var i_4 = 0; i_4 < groupList.length; i_4++) {
2381
+ var group = groupList[parseInt(i_4.toString(), 10)];
2382
+ var alignType = groupList[parseInt(i_4.toString(), 10)].orientation;
2139
2383
  if (group.isCollapsed) {
2140
2384
  group.setProperties({ isCollapsed: false }, true);
2141
2385
  this.removeDropdown(group.id);
2142
2386
  }
2143
2387
  else {
2144
- this.checkSmallToMedium(tabIndex, tab, i_3, tabContent, activeContent, true, false);
2145
- this.checkMediumToLarge(tabIndex, tab, i_3, tabContent, activeContent, true, false);
2388
+ this.checkSmallToMedium(tabIndex, tab, i_4, tabContent, activeContent, true, false);
2389
+ this.checkMediumToLarge(tabIndex, tab, i_4, tabContent, activeContent, true, false);
2146
2390
  }
2147
2391
  var groupEle = tabContent.querySelector('#' + group.id);
2148
2392
  var groupContainer = groupEle.querySelector('#' + group.id + constants.CONTAINER_ID);
2149
2393
  var shrinkColumns = groupContainer.querySelectorAll('.' + 'e-ribbon-shrink');
2150
- for (var i_4 = 0; i_4 < shrinkColumns.length; i_4++) {
2151
- shrinkColumns[parseInt(i_4.toString(), 10)].remove();
2394
+ for (var i_5 = 0; i_5 < shrinkColumns.length; i_5++) {
2395
+ shrinkColumns[parseInt(i_5.toString(), 10)].remove();
2152
2396
  }
2153
2397
  var groupHeader = groupContainer.querySelector('#' + group.id + constants.HEADER_ID);
2154
2398
  groupHeader.remove();
@@ -2194,7 +2438,7 @@ var Ribbon = /** @class */ (function (_super) {
2194
2438
  itemEle = groupContainer.querySelector('#' + item.id + constants.CONTAINER_ID);
2195
2439
  if (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)) {
2196
2440
  this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemEle, groupContainer);
2197
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
2441
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
2198
2442
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, true);
2199
2443
  }
2200
2444
  }
@@ -2207,6 +2451,9 @@ var Ribbon = /** @class */ (function (_super) {
2207
2451
  this.setItemSize(ele, item);
2208
2452
  }
2209
2453
  }
2454
+ if (item.type === RibbonItemType.Gallery) {
2455
+ this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
2456
+ }
2210
2457
  }
2211
2458
  }
2212
2459
  if (!(group.enableGroupOverflow || groupEle.querySelector('.' + constants.RIBBON_ITEM))) {
@@ -2216,9 +2463,9 @@ var Ribbon = /** @class */ (function (_super) {
2216
2463
  }
2217
2464
  else {
2218
2465
  this.element.classList.remove(constants.RIBBON_OVERFLOW);
2219
- for (var i_5 = 0; i_5 < groupList.length; i_5++) {
2220
- var group = groupList[parseInt(i_5.toString(), 10)];
2221
- var alignType = groupList[parseInt(i_5.toString(), 10)].orientation;
2466
+ for (var i_6 = 0; i_6 < groupList.length; i_6++) {
2467
+ var group = groupList[parseInt(i_6.toString(), 10)];
2468
+ var alignType = groupList[parseInt(i_6.toString(), 10)].orientation;
2222
2469
  var groupContainer = tabContent.querySelector('#' + group.id + constants.CONTAINER_ID);
2223
2470
  var groupContent = groupContainer.querySelector('#' + group.id + constants.CONTENT_ID);
2224
2471
  var groupHeader = this.createElement('div', {
@@ -2290,7 +2537,7 @@ var Ribbon = /** @class */ (function (_super) {
2290
2537
  var itemEle = groupContainer.querySelector('#' + item.id + constants.CONTAINER_ID);
2291
2538
  if (!itemEle && overflowtarget) {
2292
2539
  itemEle = overflowtarget.querySelector('#' + item.id + constants.CONTAINER_ID);
2293
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
2540
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
2294
2541
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
2295
2542
  }
2296
2543
  this.removeOverflowEvent(item, itemEle);
@@ -2310,6 +2557,9 @@ var Ribbon = /** @class */ (function (_super) {
2310
2557
  (item.allowedSizes & RibbonItemSize.Medium) ? RibbonItemSize.Medium : RibbonItemSize.Small;
2311
2558
  item.setProperties({ activeSize: itemsize }, true);
2312
2559
  this.setItemSize(ele, item);
2560
+ if (item.type === RibbonItemType.Gallery) {
2561
+ this.ribbonGalleryModule.switchGalleryItems(this.activeLayout, item.id);
2562
+ }
2313
2563
  }
2314
2564
  if (group.enableGroupOverflow && overflowDDB) {
2315
2565
  if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
@@ -2329,7 +2579,7 @@ var Ribbon = /** @class */ (function (_super) {
2329
2579
  this.overflowDDB = null;
2330
2580
  }
2331
2581
  };
2332
- Ribbon.prototype.createLauncherIcon = function (groupId, groupContainer) {
2582
+ Ribbon.prototype.createLauncherIcon = function (groupId, groupContainer, tabIndex) {
2333
2583
  var _this = this;
2334
2584
  var launcherIcon = this.createElement('div', {
2335
2585
  className: constants.RIBBON_LAUNCHER_ICON_ELE + ' ' + (this.launcherIconCss ? this.launcherIconCss : constants.RIBBON_LAUNCHER_ICON),
@@ -2344,6 +2594,10 @@ var Ribbon = /** @class */ (function (_super) {
2344
2594
  _this.launcherIconClicked(groupId);
2345
2595
  }
2346
2596
  }, this);
2597
+ var itemProp = getGroup(this.tabs, groupId);
2598
+ if (itemProp.group.launcherIconKeyTip) {
2599
+ this.addKeyTip(tabIndex, itemProp.group.launcherIconKeyTip, launcherIcon.id, 'launcher');
2600
+ }
2347
2601
  };
2348
2602
  Ribbon.prototype.launcherIconClicked = function (id) {
2349
2603
  var eventArgs = { groupId: id };
@@ -2381,7 +2635,7 @@ var Ribbon = /** @class */ (function (_super) {
2381
2635
  groupContainer.appendChild(groupHeader);
2382
2636
  }
2383
2637
  if (group.showLauncherIcon) {
2384
- this.createLauncherIcon(group.id, groupContainer);
2638
+ this.createLauncherIcon(group.id, groupContainer, tabIndex);
2385
2639
  }
2386
2640
  var elements = this.createCollection(group.collections, group.orientation, group.id, group.header, group.enableGroupOverflow, tabIndex, groupContainer);
2387
2641
  append(elements, groupContent);
@@ -2508,6 +2762,9 @@ var Ribbon = /** @class */ (function (_super) {
2508
2762
  case 'GroupButton':
2509
2763
  this.ribbonGroupButtonModule.createGroupButton(item, itemEle);
2510
2764
  break;
2765
+ case 'Gallery':
2766
+ this.ribbonGalleryModule.createGallery(item, itemEle);
2767
+ break;
2511
2768
  }
2512
2769
  };
2513
2770
  Ribbon.prototype.createItems = function (itemList, alignType, groupId, groupHeader, isGroupOF, tabIndex, groupContainer) {
@@ -2541,17 +2798,34 @@ var Ribbon = /** @class */ (function (_super) {
2541
2798
  itemEle.classList.add(constants.RIBBON_TOOLTIP_TARGET);
2542
2799
  this.tooltipData.push({ id: itemEle.id, data: item.ribbonTooltipSettings });
2543
2800
  }
2544
- var size = item.activeSize;
2545
- if (this.activeLayout === 'Simplified') {
2546
- size = ((item.allowedSizes === RibbonItemSize.Large) || (item.allowedSizes & RibbonItemSize.Medium) ||
2547
- (item.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
2548
- item.setProperties({ activeSize: size }, true);
2801
+ if (item.type === RibbonItemType.GroupButton) {
2802
+ for (var i_7 = 0; i_7 < item.groupButtonSettings.items.length; i_7++) {
2803
+ if (this.keyTipElements[parseInt(tabIndex.toString(), 10)] && item.groupButtonSettings.items[parseInt(i_7.toString(), 10)].keyTip) {
2804
+ this.addKeyTip(tabIndex, item.groupButtonSettings.items[parseInt(i_7.toString(), 10)].keyTip, item.id + (constants.RIBBON_GROUP_BUTTON_ID + i_7), 'item');
2805
+ }
2806
+ }
2549
2807
  }
2550
- if (size & RibbonItemSize.Large) {
2551
- itemEle.classList.add(constants.RIBBON_LARGE_ITEM, constants.RIBBON_CONTENT_HEIGHT);
2808
+ if (item.keyTip) {
2809
+ if (item.type === RibbonItemType.Gallery) {
2810
+ this.addKeyTip(tabIndex, item.keyTip, (item.id + '_popupButton'), 'item');
2811
+ }
2812
+ else {
2813
+ this.addKeyTip(tabIndex, item.keyTip, item.id, 'item');
2814
+ }
2552
2815
  }
2553
- else {
2554
- itemEle.classList.add((size & RibbonItemSize.Medium) ? constants.RIBBON_MEDIUM_ITEM : constants.RIBBON_SMALL_ITEM);
2816
+ var size = item.activeSize;
2817
+ if (!(item.type === RibbonItemType.Gallery)) {
2818
+ if (this.activeLayout === 'Simplified') {
2819
+ size = ((item.allowedSizes === RibbonItemSize.Large) || (item.allowedSizes & RibbonItemSize.Medium) ||
2820
+ (item.displayOptions === DisplayMode.Overflow)) ? RibbonItemSize.Medium : RibbonItemSize.Small;
2821
+ item.setProperties({ activeSize: size }, true);
2822
+ }
2823
+ if (size & RibbonItemSize.Large) {
2824
+ itemEle.classList.add(constants.RIBBON_LARGE_ITEM, constants.RIBBON_CONTENT_HEIGHT);
2825
+ }
2826
+ else {
2827
+ itemEle.classList.add((size & RibbonItemSize.Medium) ? constants.RIBBON_MEDIUM_ITEM : constants.RIBBON_SMALL_ITEM);
2828
+ }
2555
2829
  }
2556
2830
  var initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
2557
2831
  if (initialProps && initialProps.hiddenItems && initialProps.hiddenItems.length) {
@@ -2563,7 +2837,7 @@ var Ribbon = /** @class */ (function (_super) {
2563
2837
  this.createRibbonItem(item, itemEle);
2564
2838
  if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
2565
2839
  this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
2566
- if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
2840
+ if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
2567
2841
  this.updatePopupItems(item, itemEle, isGroupOF, true);
2568
2842
  }
2569
2843
  }
@@ -2692,15 +2966,15 @@ var Ribbon = /** @class */ (function (_super) {
2692
2966
  var moduleName = this.getItemModuleName(item);
2693
2967
  if (moduleName !== 'template') {
2694
2968
  if (moduleName === 'group-btn' && this.activeLayout === 'Classic') {
2695
- for (var i_6 = 0; i_6 < item.groupButtonSettings.items.length; i_6++) {
2696
- var btnEle = ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_6);
2969
+ for (var i_8 = 0; i_8 < item.groupButtonSettings.items.length; i_8++) {
2970
+ var btnEle = ele.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_8);
2697
2971
  updateCommonProperty(btnEle, 'btn', commonProp);
2698
2972
  }
2699
2973
  }
2700
2974
  else if (moduleName === 'group-btn' && this.activeLayout === 'Simplified') {
2701
2975
  updateCommonProperty(ele, 'dropdown-btn', commonProp);
2702
- for (var i_7 = 0; i_7 < item.groupButtonSettings.items.length; i_7++) {
2703
- var btnEle = document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_7);
2976
+ for (var i_9 = 0; i_9 < item.groupButtonSettings.items.length; i_9++) {
2977
+ var btnEle = document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + i_9);
2704
2978
  updateCommonProperty(btnEle, 'btn', commonProp);
2705
2979
  }
2706
2980
  }
@@ -2760,12 +3034,18 @@ var Ribbon = /** @class */ (function (_super) {
2760
3034
  ele = dropdownElement ? this.ribbonDropDownModule.getDDBItemElement(dropdownElement, item.id + constants.RIBBON_GROUP_BUTTON_ID) :
2761
3035
  contentEle.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID);
2762
3036
  }
3037
+ if (item.type === RibbonItemType.Gallery) {
3038
+ ele = contentEle.querySelector('#' + item.id + constants.CONTAINER_ID);
3039
+ }
2763
3040
  }
2764
3041
  }
2765
3042
  else {
2766
3043
  //Checks for Simplified and Auto options (Auto = classic + simplified + popup)
2767
3044
  ele = (item.displayOptions & DisplayMode.Simplified) ?
2768
3045
  contentEle.querySelector('#' + item.id) : null;
3046
+ if (item.type === RibbonItemType.Gallery) {
3047
+ ele = (item.displayOptions & DisplayMode.Simplified) ? contentEle.querySelector('#' + item.id + constants.CONTAINER_ID) : null;
3048
+ }
2769
3049
  // element will be null for "Popup" and if the item is moved to overflow in "Auto" mode
2770
3050
  if (!ele) {
2771
3051
  ele = dropdown ? dropdown.target.querySelector('#' + item.id) : null;
@@ -2806,18 +3086,42 @@ var Ribbon = /** @class */ (function (_super) {
2806
3086
  else {
2807
3087
  this.ribbonGroupButtonModule.destroyDropDown(item);
2808
3088
  }
2809
- var _loop_3 = function (i) {
3089
+ var _loop_4 = function (i) {
2810
3090
  if (item.groupButtonSettings.items[parseInt(i.toString(), 10)].ribbonTooltipSettings) {
2811
3091
  var groupButtonID_1 = item.id + constants.RIBBON_GROUP_BUTTON_ID + i;
2812
- var index = getIndex(this_3.tooltipData, function (e) { return e.id === groupButtonID_1; });
3092
+ var index = getIndex(this_4.tooltipData, function (e) { return e.id === groupButtonID_1; });
2813
3093
  if (index !== -1) {
2814
- this_3.tooltipData.splice(index, 1);
3094
+ this_4.tooltipData.splice(index, 1);
2815
3095
  }
2816
3096
  }
2817
3097
  };
2818
- var this_3 = this;
3098
+ var this_4 = this;
2819
3099
  for (var i = 0; i < item.groupButtonSettings.items.length; i++) {
2820
- _loop_3(i);
3100
+ _loop_4(i);
3101
+ }
3102
+ }
3103
+ else if (moduleName === 'gallery') {
3104
+ if (ele.closest('.e-ribbon-overflow-target')) {
3105
+ destroyControl(ele, 'dropdown-btn');
3106
+ var galleryPopupEle = Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '_galleryPopup'));
3107
+ galleryPopupEle.concat(Array.prototype.slice.call(document.querySelectorAll('#' + item.id + '-popup')));
3108
+ for (var i = 0; i < galleryPopupEle.length; i++) {
3109
+ galleryPopupEle[parseInt(i.toString(), 10)].remove();
3110
+ }
3111
+ }
3112
+ else {
3113
+ var galleryEle = ele.querySelectorAll('.e-ribbon-gallery-item');
3114
+ var galleryPopupBtn = ele.querySelector('#' + item.id + '_popupButton');
3115
+ if (galleryPopupBtn) {
3116
+ galleryPopupBtn.remove();
3117
+ }
3118
+ for (var i = 0; i < galleryEle.length; i++) {
3119
+ galleryEle[parseInt(i.toString(), 10)].remove();
3120
+ }
3121
+ var galleryPopupEle = document.querySelectorAll('#' + item.id + '_galleryPopup');
3122
+ for (var i = 0; i < galleryPopupEle.length; i++) {
3123
+ galleryPopupEle[parseInt(i.toString(), 10)].remove();
3124
+ }
2821
3125
  }
2822
3126
  }
2823
3127
  else if (moduleName !== 'template') {
@@ -2833,6 +3137,13 @@ var Ribbon = /** @class */ (function (_super) {
2833
3137
  this.ribbonGroupButtonModule.destroyDropDown(item);
2834
3138
  }
2835
3139
  };
3140
+ /**
3141
+ * Gets the item module name.
3142
+ *
3143
+ * @param {RibbonItemModel} item - Gets the ribbon item model.
3144
+ * @returns {void}
3145
+ * @hidden
3146
+ */
2836
3147
  Ribbon.prototype.getItemModuleName = function (item) {
2837
3148
  switch (item.type) {
2838
3149
  case 'Button':
@@ -2849,6 +3160,8 @@ var Ribbon = /** @class */ (function (_super) {
2849
3160
  return 'combobox';
2850
3161
  case 'GroupButton':
2851
3162
  return 'group-btn';
3163
+ case 'Gallery':
3164
+ return 'gallery';
2852
3165
  default:
2853
3166
  return 'template';
2854
3167
  }
@@ -2888,8 +3201,9 @@ var Ribbon = /** @class */ (function (_super) {
2888
3201
  * @param {string} tabId - The ID of the tab to be shown.
2889
3202
  * @returns {void}
2890
3203
  */
2891
- Ribbon.prototype.showTab = function (tabId) {
2892
- this.showHideTab(tabId, false);
3204
+ Ribbon.prototype.showTab = function (tabId, isContextual) {
3205
+ if (isContextual === void 0) { isContextual = false; }
3206
+ this.showHideTab(tabId, false, isContextual);
2893
3207
  };
2894
3208
  /**
2895
3209
  * Hides a specific tab in the ribbon.
@@ -2897,15 +3211,49 @@ var Ribbon = /** @class */ (function (_super) {
2897
3211
  * @param {string} tabId - The ID of the tab to be hidden.
2898
3212
  * @returns {void}
2899
3213
  */
2900
- Ribbon.prototype.hideTab = function (tabId) {
2901
- this.showHideTab(tabId, true);
3214
+ Ribbon.prototype.hideTab = function (tabId, isContextual) {
3215
+ if (isContextual === void 0) { isContextual = false; }
3216
+ this.showHideTab(tabId, true, isContextual);
2902
3217
  };
2903
- Ribbon.prototype.showHideTab = function (tabId, value) {
3218
+ Ribbon.prototype.showHideTab = function (tabId, value, isContextual) {
2904
3219
  var index = getIndex(this.tabs, function (e) { return e.id === tabId; });
2905
3220
  if (index === -1) {
2906
3221
  return;
2907
3222
  }
2908
3223
  this.tabObj.hideTab(index, value);
3224
+ if (isContextual) {
3225
+ var contextualTab_1;
3226
+ var tabEle = this.tabObj.element;
3227
+ for (var i = 0; i < this.contextualTabs.length; i++) {
3228
+ for (var j = 0; j < this.contextualTabs[parseInt(i.toString(), 10)].tabs.length; j++) {
3229
+ if (tabId === this.contextualTabs[parseInt(i.toString(), 10)].tabs[parseInt(j.toString(), 10)].id) {
3230
+ contextualTab_1 = this.contextualTabs[parseInt(i.toString(), 10)];
3231
+ }
3232
+ }
3233
+ }
3234
+ if (contextualTab_1) {
3235
+ var isTabHidden = true;
3236
+ var _loop_5 = function (i) {
3237
+ var index_1 = getIndex(this_5.tabs, function (e) { return e.id === contextualTab_1.tabs[parseInt(i.toString(), 10)].id; });
3238
+ if (index_1 !== -1) {
3239
+ var toolbarEle = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(index_1.toString(), 10)];
3240
+ if (!(toolbarEle.classList.contains('e-hidden'))) {
3241
+ isTabHidden = false;
3242
+ }
3243
+ }
3244
+ };
3245
+ var this_5 = this;
3246
+ for (var i = 0; i < contextualTab_1.tabs.length; i++) {
3247
+ _loop_5(i);
3248
+ }
3249
+ if (isTabHidden) {
3250
+ contextualTab_1.setProperties({ visible: false }, true);
3251
+ }
3252
+ else {
3253
+ contextualTab_1.setProperties({ visible: true }, true);
3254
+ }
3255
+ }
3256
+ }
2909
3257
  };
2910
3258
  /**
2911
3259
  * Enables a specific tab in the ribbon.
@@ -3212,8 +3560,8 @@ var Ribbon = /** @class */ (function (_super) {
3212
3560
  var hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
3213
3561
  /* eslint-disable */
3214
3562
  if (hiddenProps && hiddenProps[key] && hiddenProps[key].length) {
3215
- var _loop_4 = function (i) {
3216
- var contentEle = this_4.tabObj.items[tabIndex].content;
3563
+ var _loop_6 = function (i) {
3564
+ var contentEle = this_6.tabObj.items[tabIndex].content;
3217
3565
  var hiddenEle;
3218
3566
  var groupEle = void 0;
3219
3567
  var isGroupHidden = false;
@@ -3235,11 +3583,11 @@ var Ribbon = /** @class */ (function (_super) {
3235
3583
  groupEle = hiddenEle.closest('.e-ribbon-group');
3236
3584
  if (groupEle.classList.contains('e-hide-group')) {
3237
3585
  isGroupHidden = true;
3238
- widthDifference = this_4.checkWidthDifference(hiddenEle, groupEle);
3586
+ widthDifference = this_6.checkWidthDifference(hiddenEle, groupEle);
3239
3587
  }
3240
3588
  }
3241
- this_4.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, true, tabIndex);
3242
- this_4.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, true);
3589
+ this_6.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, true, tabIndex);
3590
+ this_6.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, true);
3243
3591
  if (isHidden) {
3244
3592
  hiddenEle.classList.add('e-hidden');
3245
3593
  }
@@ -3252,12 +3600,12 @@ var Ribbon = /** @class */ (function (_super) {
3252
3600
  groupEle.classList.remove('e-hide-group');
3253
3601
  groupEle.classList.remove('e-ribbon-emptyCollection');
3254
3602
  widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
3255
- if (this_4.hiddenGroups.indexOf(groupEle.id) !== -1) {
3256
- this_4.hiddenGroups.splice(this_4.hiddenGroups.indexOf(groupEle.id), 1);
3603
+ if (this_6.hiddenGroups.indexOf(groupEle.id) !== -1) {
3604
+ this_6.hiddenGroups.splice(this_6.hiddenGroups.indexOf(groupEle.id), 1);
3257
3605
  }
3258
3606
  }
3259
3607
  else {
3260
- if (this_4.hiddenGroups.indexOf(groupEle.id) !== -1) {
3608
+ if (this_6.hiddenGroups.indexOf(groupEle.id) !== -1) {
3261
3609
  var hiddenItems = groupEle.querySelectorAll('.e-ribbon-item:not(.e-hidden)');
3262
3610
  hiddenItems.forEach(function (item) {
3263
3611
  if (item.id !== hiddenEle.id) {
@@ -3270,12 +3618,12 @@ var Ribbon = /** @class */ (function (_super) {
3270
3618
  item.classList.remove('e-hidden');
3271
3619
  }
3272
3620
  });
3273
- this_4.hiddenGroups.splice(this_4.hiddenGroups.indexOf(groupEle.id), 1);
3621
+ this_6.hiddenGroups.splice(this_6.hiddenGroups.indexOf(groupEle.id), 1);
3274
3622
  }
3275
3623
  }
3276
3624
  }
3277
- this_4.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, false, tabIndex);
3278
- this_4.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, false);
3625
+ this_6.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, false, tabIndex);
3626
+ this_6.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, false);
3279
3627
  }
3280
3628
  if (isGroupHidden) {
3281
3629
  groupEle.classList.add('e-hide-group');
@@ -3289,9 +3637,9 @@ var Ribbon = /** @class */ (function (_super) {
3289
3637
  }
3290
3638
  out_i_1 = i;
3291
3639
  };
3292
- var this_4 = this, out_i_1;
3640
+ var this_6 = this, out_i_1;
3293
3641
  for (var i = 0; i < hiddenProps[key].length; i++) {
3294
- _loop_4(i);
3642
+ _loop_6(i);
3295
3643
  i = out_i_1;
3296
3644
  }
3297
3645
  }
@@ -3342,9 +3690,9 @@ var Ribbon = /** @class */ (function (_super) {
3342
3690
  var overflowButton = getInstance(groupOFButton[parseInt(i.toString(), 10)], DropDownButton);
3343
3691
  var overflowBtnTarget = overflowButton.target;
3344
3692
  var overflowItems = overflowBtnTarget.querySelectorAll('.e-ribbon-item');
3345
- for (var i_8 = 0; i_8 < overflowItems.length; i_8++) {
3346
- if (overflowItems[parseInt(i_8.toString(), 10)].hasAttribute('data-medium-width')) {
3347
- mediumDataItems.push(overflowItems[parseInt(i_8.toString(), 10)]);
3693
+ for (var i_10 = 0; i_10 < overflowItems.length; i_10++) {
3694
+ if (overflowItems[parseInt(i_10.toString(), 10)].hasAttribute('data-medium-width')) {
3695
+ mediumDataItems.push(overflowItems[parseInt(i_10.toString(), 10)]);
3348
3696
  }
3349
3697
  }
3350
3698
  }
@@ -3371,10 +3719,10 @@ var Ribbon = /** @class */ (function (_super) {
3371
3719
  if (overflowButton) {
3372
3720
  var overflowEle = overflowButton.target;
3373
3721
  var overflowItems = overflowEle.querySelectorAll('.e-ribbon-item');
3374
- for (var i_9 = 0; i_9 < overflowItems.length; i_9++) {
3375
- var previousWidth = parseInt(overflowItems[parseInt(i_9.toString(), 10)].getAttribute('data-simplified-width'), 10);
3722
+ for (var i_11 = 0; i_11 < overflowItems.length; i_11++) {
3723
+ var previousWidth = parseInt(overflowItems[parseInt(i_11.toString(), 10)].getAttribute('data-simplified-width'), 10);
3376
3724
  if (previousWidth) {
3377
- overflowItems[parseInt(i_9.toString(), 10)].setAttribute('data-simplified-width', isHidden ? (previousWidth - hiddenItem).toString() : (previousWidth + hiddenItem).toString());
3725
+ overflowItems[parseInt(i_11.toString(), 10)].setAttribute('data-simplified-width', isHidden ? (previousWidth - hiddenItem).toString() : (previousWidth + hiddenItem).toString());
3378
3726
  }
3379
3727
  }
3380
3728
  }
@@ -3924,7 +4272,7 @@ var Ribbon = /** @class */ (function (_super) {
3924
4272
  if (contentEle.innerHTML !== '') {
3925
4273
  // Check whether showLauncherIcon or orientation is passed by the user and sets the updated values.
3926
4274
  if (group.showLauncherIcon) {
3927
- this.createLauncherIcon(ribbongroup.id, groupContainer);
4275
+ this.createLauncherIcon(ribbongroup.id, groupContainer, itemProp.tabIndex);
3928
4276
  }
3929
4277
  // Check whether collections or orientation is passed by the user and sets the updated values.
3930
4278
  if (group.collections || group.orientation) {
@@ -4073,7 +4421,7 @@ var Ribbon = /** @class */ (function (_super) {
4073
4421
  }
4074
4422
  if (this.activeLayout === RibbonLayout.Simplified && item.displayOptions === DisplayMode.Overflow) {
4075
4423
  this.createOverflowPopup(itemProp.item, itemProp.tabIndex, itemProp.group.enableGroupOverflow, itemProp.group.id, itemProp.group.header, itemContainer, groupContainer);
4076
- if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
4424
+ if ((itemProp.item.type === RibbonItemType.DropDown) || (itemProp.item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton) || (item.type === RibbonItemType.Gallery)) {
4077
4425
  this.updatePopupItems(itemProp.item, itemContainer, itemProp.group.enableGroupOverflow, true);
4078
4426
  }
4079
4427
  }
@@ -4180,6 +4528,15 @@ var Ribbon = /** @class */ (function (_super) {
4180
4528
  Ribbon.prototype.disableItem = function (itemId) {
4181
4529
  this.enableDisableItem(itemId, true);
4182
4530
  };
4531
+ /**
4532
+ * Gets the Ribbon item model associated with the specified item ID.
4533
+ *
4534
+ * @param {string} itemId - The unique ID of the Ribbon item.
4535
+ * @returns {RibbonItemModel}
4536
+ */
4537
+ Ribbon.prototype.getItem = function (itemId) {
4538
+ return getItem(this.tabs, itemId).item;
4539
+ };
4183
4540
  Ribbon.prototype.enableDisableItem = function (itemId, isDisabled) {
4184
4541
  var isUpdated = false;
4185
4542
  var itemProp = getItem(this.tabs, itemId);
@@ -4227,6 +4584,9 @@ var Ribbon = /** @class */ (function (_super) {
4227
4584
  };
4228
4585
  Ribbon.prototype.unwireEvents = function () {
4229
4586
  EventHandler.remove(window, 'resize', this.resizeHandler);
4587
+ EventHandler.remove(document.body, 'keydown', this.keytipActionHandler);
4588
+ EventHandler.remove(document, 'mousedown', this.mouseEventHandler);
4589
+ EventHandler.remove(document, 'scroll', this.mouseEventHandler);
4230
4590
  };
4231
4591
  Ribbon.prototype.destroy = function () {
4232
4592
  this.keyboardModuleRibbon.destroy();
@@ -4254,6 +4614,7 @@ var Ribbon = /** @class */ (function (_super) {
4254
4614
  this.initialPropsData = {};
4255
4615
  this.hiddenGroups = [];
4256
4616
  this.hiddenElements = {};
4617
+ this.keyTipElements = {};
4257
4618
  remove(this.element.querySelector('#' + this.element.id + constants.TAB_ID));
4258
4619
  this.element.style.removeProperty(constants.RIBBON_FILE_MENU_WIDTH);
4259
4620
  this.element.style.removeProperty(constants.RIBBON_HELP_PANE_TEMPLATE_WIDTH);
@@ -4333,7 +4694,11 @@ var Ribbon = /** @class */ (function (_super) {
4333
4694
  }
4334
4695
  break;
4335
4696
  case 'selectedTab':
4336
- this.tabObj.setProperties({ selectedItem: newProp.selectedTab });
4697
+ var tabEle = this.tabObj.element;
4698
+ var toolbarItem = tabEle.querySelectorAll('.e-toolbar-item')[parseInt(newProp.selectedTab.toString(), 10)];
4699
+ if (!(toolbarItem.classList.contains('e-hidden') || toolbarItem.classList.contains('e-disable'))) {
4700
+ this.tabObj.setProperties({ selectedItem: newProp.selectedTab });
4701
+ }
4337
4702
  break;
4338
4703
  case 'tabAnimation':
4339
4704
  this.tabObj.setProperties({ animation: newProp.tabAnimation });
@@ -4341,6 +4706,13 @@ var Ribbon = /** @class */ (function (_super) {
4341
4706
  case 'tabs':
4342
4707
  this.reRenderTabs(newProp.tabs);
4343
4708
  break;
4709
+ case 'contextualTabs':
4710
+ for (var i = 0; i < this.contextualTabs.length; i++) {
4711
+ if (newProp.contextualTabs[parseInt(i.toString(), 10)]) {
4712
+ this.ribbonContextualTabModule.updateContextualTabs(newProp.contextualTabs[parseInt(i.toString(), 10)], this.contextualTabs[parseInt(i.toString(), 10)]);
4713
+ }
4714
+ }
4715
+ break;
4344
4716
  case 'width':
4345
4717
  this.element.style.width = formatUnit(newProp.width);
4346
4718
  this.refreshLayout();
@@ -4384,6 +4756,12 @@ var Ribbon = /** @class */ (function (_super) {
4384
4756
  __decorate([
4385
4757
  Property('')
4386
4758
  ], Ribbon.prototype, "cssClass", void 0);
4759
+ __decorate([
4760
+ Property(false)
4761
+ ], Ribbon.prototype, "enableKeyTips", void 0);
4762
+ __decorate([
4763
+ Property('')
4764
+ ], Ribbon.prototype, "layoutSwitcherKeyTip", void 0);
4387
4765
  __decorate([
4388
4766
  Complex({}, FileMenuSettings)
4389
4767
  ], Ribbon.prototype, "fileMenu", void 0);
@@ -4408,6 +4786,9 @@ var Ribbon = /** @class */ (function (_super) {
4408
4786
  __decorate([
4409
4787
  Collection([], RibbonTab)
4410
4788
  ], Ribbon.prototype, "tabs", void 0);
4789
+ __decorate([
4790
+ Collection([], RibbonContextualTabSettings)
4791
+ ], Ribbon.prototype, "contextualTabs", void 0);
4411
4792
  __decorate([
4412
4793
  Property('100%')
4413
4794
  ], Ribbon.prototype, "width", void 0);