@syncfusion/ej2-ribbon 23.1.41 → 23.1.44

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 (43) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/ej2-ribbon.umd.min.js +2 -2
  3. package/dist/ej2-ribbon.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-ribbon.es2015.js +225 -71
  5. package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
  6. package/dist/es6/ej2-ribbon.es5.js +225 -71
  7. package/dist/es6/ej2-ribbon.es5.js.map +1 -1
  8. package/dist/global/ej2-ribbon.min.js +2 -2
  9. package/dist/global/ej2-ribbon.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +11 -11
  12. package/src/ribbon/base/ribbon.d.ts +3 -0
  13. package/src/ribbon/base/ribbon.js +160 -70
  14. package/src/ribbon/base/utils.d.ts +11 -0
  15. package/src/ribbon/base/utils.js +27 -1
  16. package/src/ribbon/items/ribbon-button.js +4 -1
  17. package/src/ribbon/items/ribbon-checkbox.js +1 -0
  18. package/src/ribbon/items/ribbon-colorpicker.js +4 -1
  19. package/src/ribbon/items/ribbon-combobox.js +1 -0
  20. package/src/ribbon/items/ribbon-dropdown.js +4 -1
  21. package/src/ribbon/items/ribbon-groupbutton.js +4 -1
  22. package/src/ribbon/items/ribbon-splitbutton.js +4 -1
  23. package/src/ribbon/models/ribbon-button-settings-model.d.ts +7 -0
  24. package/src/ribbon/models/ribbon-button-settings.d.ts +8 -0
  25. package/src/ribbon/models/ribbon-button-settings.js +3 -0
  26. package/src/ribbon/models/ribbon-checkbox-settings-model.d.ts +7 -0
  27. package/src/ribbon/models/ribbon-checkbox-settings.d.ts +8 -0
  28. package/src/ribbon/models/ribbon-checkbox-settings.js +3 -0
  29. package/src/ribbon/models/ribbon-colorpicker-settings-model.d.ts +7 -0
  30. package/src/ribbon/models/ribbon-colorpicker-settings.d.ts +8 -0
  31. package/src/ribbon/models/ribbon-colorpicker-settings.js +3 -0
  32. package/src/ribbon/models/ribbon-combobox-settings-model.d.ts +7 -0
  33. package/src/ribbon/models/ribbon-combobox-settings.d.ts +8 -0
  34. package/src/ribbon/models/ribbon-combobox-settings.js +3 -0
  35. package/src/ribbon/models/ribbon-dropdown-settings-model.d.ts +7 -0
  36. package/src/ribbon/models/ribbon-dropdown-settings.d.ts +8 -0
  37. package/src/ribbon/models/ribbon-dropdown-settings.js +3 -0
  38. package/src/ribbon/models/ribbon-group-button-item-model.d.ts +7 -0
  39. package/src/ribbon/models/ribbon-group-button-item.d.ts +8 -0
  40. package/src/ribbon/models/ribbon-group-button-item.js +3 -0
  41. package/src/ribbon/models/ribbon-splitbutton-settings-model.d.ts +7 -0
  42. package/src/ribbon/models/ribbon-splitbutton-settings.d.ts +8 -0
  43. package/src/ribbon/models/ribbon-splitbutton-settings.js +3 -0
@@ -182,6 +182,9 @@ var RibbonButtonSettings = /** @__PURE__ @class */ (function (_super) {
182
182
  __decorate$5([
183
183
  Property(false)
184
184
  ], RibbonButtonSettings.prototype, "isPrimary", void 0);
185
+ __decorate$5([
186
+ Property({})
187
+ ], RibbonButtonSettings.prototype, "htmlAttributes", void 0);
185
188
  __decorate$5([
186
189
  Event()
187
190
  ], RibbonButtonSettings.prototype, "created", void 0);
@@ -239,6 +242,9 @@ var RibbonCheckBoxSettings = /** @__PURE__ @class */ (function (_super) {
239
242
  __decorate$6([
240
243
  Property('After')
241
244
  ], RibbonCheckBoxSettings.prototype, "labelPosition", void 0);
245
+ __decorate$6([
246
+ Property({})
247
+ ], RibbonCheckBoxSettings.prototype, "htmlAttributes", void 0);
242
248
  __decorate$6([
243
249
  Event()
244
250
  ], RibbonCheckBoxSettings.prototype, "created", void 0);
@@ -311,6 +317,9 @@ var RibbonColorPickerSettings = /** @__PURE__ @class */ (function (_super) {
311
317
  __decorate$7([
312
318
  Property('#008000ff')
313
319
  ], RibbonColorPickerSettings.prototype, "value", void 0);
320
+ __decorate$7([
321
+ Property({})
322
+ ], RibbonColorPickerSettings.prototype, "htmlAttributes", void 0);
314
323
  __decorate$7([
315
324
  Event()
316
325
  ], RibbonColorPickerSettings.prototype, "beforeClose", void 0);
@@ -431,6 +440,9 @@ var RibbonComboBoxSettings = /** @__PURE__ @class */ (function (_super) {
431
440
  __decorate$8([
432
441
  Property('150px')
433
442
  ], RibbonComboBoxSettings.prototype, "width", void 0);
443
+ __decorate$8([
444
+ Property({})
445
+ ], RibbonComboBoxSettings.prototype, "htmlAttributes", void 0);
434
446
  __decorate$8([
435
447
  Event()
436
448
  ], RibbonComboBoxSettings.prototype, "beforeOpen", void 0);
@@ -512,6 +524,9 @@ var RibbonDropDownSettings = /** @__PURE__ @class */ (function (_super) {
512
524
  __decorate$9([
513
525
  Property(false)
514
526
  ], RibbonDropDownSettings.prototype, "createPopupOnClick", void 0);
527
+ __decorate$9([
528
+ Property({})
529
+ ], RibbonDropDownSettings.prototype, "htmlAttributes", void 0);
515
530
  __decorate$9([
516
531
  Event()
517
532
  ], RibbonDropDownSettings.prototype, "beforeClose", void 0);
@@ -590,6 +605,9 @@ var RibbonSplitButtonSettings = /** @__PURE__ @class */ (function (_super) {
590
605
  __decorate$10([
591
606
  Property('')
592
607
  ], RibbonSplitButtonSettings.prototype, "target", void 0);
608
+ __decorate$10([
609
+ Property({})
610
+ ], RibbonSplitButtonSettings.prototype, "htmlAttributes", void 0);
593
611
  __decorate$10([
594
612
  Event()
595
613
  ], RibbonSplitButtonSettings.prototype, "beforeClose", void 0);
@@ -701,6 +719,9 @@ var RibbonGroupButtonItem = /** @__PURE__ @class */ (function (_super) {
701
719
  __decorate$13([
702
720
  Property(false)
703
721
  ], RibbonGroupButtonItem.prototype, "selected", void 0);
722
+ __decorate$13([
723
+ Property({})
724
+ ], RibbonGroupButtonItem.prototype, "htmlAttributes", void 0);
704
725
  __decorate$13([
705
726
  Event()
706
727
  ], RibbonGroupButtonItem.prototype, "beforeClick", void 0);
@@ -1478,6 +1499,9 @@ var RibbonButton = /** @__PURE__ @class */ (function () {
1478
1499
  isToggle: btnSettings.isToggle,
1479
1500
  created: btnSettings.created
1480
1501
  }, buttonEle);
1502
+ if (btnSettings.htmlAttributes) {
1503
+ setCustomAttributes(buttonEle, btnSettings.htmlAttributes);
1504
+ }
1481
1505
  buttonEle.onclick = function (e) {
1482
1506
  if (btnSettings.clicked) {
1483
1507
  btnSettings.clicked.call(_this, e);
@@ -1629,6 +1653,7 @@ var RibbonCheckBox = /** @__PURE__ @class */ (function () {
1629
1653
  labelPosition: checkBoxSettings.labelPosition,
1630
1654
  disabled: item.disabled,
1631
1655
  created: checkBoxSettings.created,
1656
+ htmlAttributes: checkBoxSettings.htmlAttributes,
1632
1657
  change: function (e) {
1633
1658
  if (checkBoxSettings.change) {
1634
1659
  checkBoxSettings.change.call(_this, e);
@@ -1782,6 +1807,9 @@ var RibbonColorPicker = /** @__PURE__ @class */ (function () {
1782
1807
  },
1783
1808
  select: colorPickerSettings.select
1784
1809
  }, inputEle);
1810
+ if (colorPickerSettings.htmlAttributes) {
1811
+ setCustomAttributes(inputEle, colorPickerSettings.htmlAttributes);
1812
+ }
1785
1813
  var wrapper = colorPicker.element.parentElement;
1786
1814
  EventHandler.add(wrapper, 'mouseenter', this.toggleWrapperHover.bind(this, wrapper, true), this);
1787
1815
  EventHandler.add(wrapper, 'mouseleave', this.toggleWrapperHover.bind(this, wrapper, false), this);
@@ -1977,6 +2005,7 @@ var RibbonComboBox = /** @__PURE__ @class */ (function () {
1977
2005
  width: comboBoxSettings.width,
1978
2006
  beforeOpen: comboBoxSettings.beforeOpen,
1979
2007
  open: comboBoxSettings.open,
2008
+ htmlAttributes: comboBoxSettings.htmlAttributes,
1980
2009
  close: function (e) {
1981
2010
  if (comboBoxSettings.close) {
1982
2011
  comboBoxSettings.close.call(_this, e);
@@ -2162,6 +2191,9 @@ var RibbonDropDown = /** @__PURE__ @class */ (function () {
2162
2191
  open: dropDownSettings.open,
2163
2192
  select: dropDownSettings.select
2164
2193
  }).appendTo(buttonEle);
2194
+ if (dropDownSettings.htmlAttributes) {
2195
+ setCustomAttributes(buttonEle, dropDownSettings.htmlAttributes);
2196
+ }
2165
2197
  };
2166
2198
  /**
2167
2199
  * Adds the additional event handlers as the item moved into overflow popup.
@@ -2604,6 +2636,9 @@ var RibbonSplitButton = /** @__PURE__ @class */ (function () {
2604
2636
  }
2605
2637
  }
2606
2638
  }, buttonEle);
2639
+ if (splitButtonSettings.htmlAttributes) {
2640
+ setCustomAttributes(buttonEle, splitButtonSettings.htmlAttributes);
2641
+ }
2607
2642
  var dropdownEle = buttonEle.parentElement.querySelector('.e-dropdown-btn');
2608
2643
  dropdownEle.onkeydown = function (e) {
2609
2644
  if (e.key === 'Enter') {
@@ -3105,6 +3140,32 @@ function updateTooltipProp(element, prop) {
3105
3140
  var control = getComponent(element, Tooltip);
3106
3141
  control.setProperties(prop);
3107
3142
  }
3143
+ /**
3144
+ * Sets the HTML attributes of an element
3145
+ *
3146
+ * @param {HTMLElement} element - The HTML element for which attributes are to be updated.
3147
+ * @param {commonProperties} attributes - An object containing key-value pairs of attributes to be updated.
3148
+ * @returns {void}
3149
+ * @hidden
3150
+ */
3151
+ function setCustomAttributes(element, attributes) {
3152
+ for (var key in attributes) {
3153
+ if (key === 'class') {
3154
+ var elementClass = attributes['class'].replace(/\s+/g, ' ').trim();
3155
+ if (elementClass) {
3156
+ addClass([element], elementClass.split(' '));
3157
+ }
3158
+ }
3159
+ else if (key === 'style') {
3160
+ var prevStyles = element.getAttribute('style') || '';
3161
+ var value = "" + prevStyles + attributes["" + key];
3162
+ element.setAttribute("" + key, value);
3163
+ }
3164
+ else {
3165
+ element.setAttribute(key, attributes["" + key]);
3166
+ }
3167
+ }
3168
+ }
3108
3169
 
3109
3170
  /**
3110
3171
  * Defines the items of Ribbon.
@@ -3151,6 +3212,9 @@ var RibbonGroupButton = /** @__PURE__ @class */ (function () {
3151
3212
  content: item.activeSize === RibbonItemSize.Small ? '' : groupBtnSettings.items[parseInt(i.toString(), 10)].content,
3152
3213
  iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left'
3153
3214
  }, groupButtonEle);
3215
+ if (groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes) {
3216
+ setCustomAttributes(groupButtonEle, groupBtnSettings.items[parseInt(i.toString(), 10)].htmlAttributes);
3217
+ }
3154
3218
  var buttonEle = itemElement.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + i);
3155
3219
  if (groupBtnSettings.selection === RibbonGroupButtonSelection.Single) {
3156
3220
  btnContainerEle.classList.add(RIBBON_SINGLE_BUTTON_SELECTION);
@@ -3592,6 +3656,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
3592
3656
  Ribbon.prototype.preRender = function () {
3593
3657
  this.idIndex = 0;
3594
3658
  this.tooltipData = [];
3659
+ this.initialPropsData = {};
3595
3660
  this.isAddRemove = false;
3596
3661
  this.keyConfigs = {
3597
3662
  leftarrow: 'leftarrow',
@@ -4107,21 +4172,23 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4107
4172
  // The position is reversed if RTL is enabled.
4108
4173
  // isRight = ((isGroupOF && isMenu) && !this.enableRtl ) || (!(isGroupOF && isMenu) && this.enableRtl) ==> (isGroupOF && isMenu) !== this.enableRtl
4109
4174
  var isLeft = (isGroupOF && isMenu) === this.enableRtl;
4110
- dropDownPopup.setProperties({ position: { X: isLeft ? 'left' : 'right', Y: isMenu ? 'top' : 'bottom' } }, true);
4111
- if (isMenu) {
4112
- dropdown.beforeOpen = function () {
4113
- if (isLeft) {
4114
- dropDownPopup.element.style.setProperty('visibility', 'hidden');
4115
- dropDownPopup.element.style.setProperty('display', 'block');
4116
- dropDownPopup.setProperties({ offsetX: -1 * dropDownPopup.element.offsetWidth });
4117
- dropDownPopup.element.style.removeProperty('display');
4118
- dropDownPopup.element.style.removeProperty('visibility');
4119
- }
4120
- };
4121
- }
4122
- else {
4123
- dropDownPopup.setProperties({ offsetX: 0 }, true);
4124
- dropdown.beforeOpen = null;
4175
+ if (dropDownPopup) {
4176
+ dropDownPopup.setProperties({ position: { X: isLeft ? 'left' : 'right', Y: isMenu ? 'top' : 'bottom' } }, true);
4177
+ if (isMenu) {
4178
+ dropdown.beforeOpen = function () {
4179
+ if (isLeft) {
4180
+ dropDownPopup.element.style.setProperty('visibility', 'hidden');
4181
+ dropDownPopup.element.style.setProperty('display', 'block');
4182
+ dropDownPopup.setProperties({ offsetX: -1 * dropDownPopup.element.offsetWidth });
4183
+ dropDownPopup.element.style.removeProperty('display');
4184
+ dropDownPopup.element.style.removeProperty('visibility');
4185
+ }
4186
+ };
4187
+ }
4188
+ else {
4189
+ dropDownPopup.setProperties({ offsetX: 0 }, true);
4190
+ dropdown.beforeOpen = null;
4191
+ }
4125
4192
  }
4126
4193
  };
4127
4194
  Ribbon.prototype.removeSimplfiedOverflow = function (tabContent, activeContent, tabIndex, isClear) {
@@ -4207,7 +4274,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4207
4274
  Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
4208
4275
  var overflowButton;
4209
4276
  var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
4210
- var isDisabledGroup = contentEle.querySelector('#' + groupId);
4277
+ var groupEle = contentEle.querySelector('#' + groupId);
4211
4278
  if (isGroupOF) {
4212
4279
  var overflowDDB = groupContainer.querySelector('#' + groupId + GROUPOF_BUTTON_ID);
4213
4280
  if (!overflowDDB) {
@@ -4219,9 +4286,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4219
4286
  overflowButton = getInstance(overflowDDB, DropDownButton);
4220
4287
  }
4221
4288
  var overflowBtnTarget = overflowButton.target;
4222
- if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
4289
+ if (groupEle && groupEle.classList.contains('e-disabled')) {
4223
4290
  overflowBtnTarget.classList.add('e-disabled');
4224
4291
  }
4292
+ if (groupEle && groupEle.classList.contains('e-hidden')) {
4293
+ overflowBtnTarget.classList.add('e-hidden');
4294
+ }
4225
4295
  isResize ? overflowBtnTarget.insertBefore(itemEle, overflowBtnTarget.querySelector('.' + RIBBON_ITEM))
4226
4296
  : overflowBtnTarget.append(itemEle);
4227
4297
  }
@@ -4240,7 +4310,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4240
4310
  var ofGroupContainer = overflowEle.querySelector('#' + groupId + CONTAINER_ID);
4241
4311
  if (!ofGroupContainer) {
4242
4312
  ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
4243
- if (isDisabledGroup && isDisabledGroup.classList.contains('e-disabled')) {
4313
+ if (groupEle && groupEle.classList.contains('e-disabled')) {
4244
4314
  ofGroupContainer.classList.add('e-disabled');
4245
4315
  }
4246
4316
  ofTabContainer.append(ofGroupContainer);
@@ -4297,6 +4367,15 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4297
4367
  if (tabIndex === this.selectedTab) {
4298
4368
  ofTabContainer.classList.add(RIBBON_TAB_ACTIVE);
4299
4369
  }
4370
+ var groupEle = document.querySelector('#' + groupId);
4371
+ if (groupEle) {
4372
+ if (groupEle.classList.contains('e-disabled')) {
4373
+ ofGroupContainer.classList.add('e-disabled');
4374
+ }
4375
+ if (groupEle.classList.contains('e-hidden')) {
4376
+ ofGroupContainer.classList.add('e-hidden');
4377
+ }
4378
+ }
4300
4379
  };
4301
4380
  Ribbon.prototype.checkGroupShrinking = function (tabIndex, tabContent, activeContent, isLarge) {
4302
4381
  var isOverFlow = true;
@@ -4893,30 +4972,32 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
4893
4972
  (isRemoveOverflow ? (itemContainer.classList.add(RIBBON_CONTENT_HEIGHT)) : (itemContainer.classList.remove(RIBBON_CONTENT_HEIGHT)));
4894
4973
  };
4895
4974
  Ribbon.prototype.setItemSize = function (itemEle, item) {
4896
- var itemContainer = itemEle.closest('.' + RIBBON_ITEM);
4897
- if (item.type === RibbonItemType.Button) {
4898
- this.ribbonButtonModule.updateButtonSize(itemEle, item);
4899
- }
4900
- else if (item.type === RibbonItemType.DropDown) {
4901
- this.ribbonDropDownModule.updateDropDownSize(itemEle, item);
4902
- }
4903
- else if (item.type === RibbonItemType.SplitButton) {
4904
- this.ribbonSplitButtonModule.updateSplitButtonSize(itemEle, item);
4905
- }
4906
- else if (item.type === RibbonItemType.Template) {
4907
- remove(itemEle);
4908
- this.createTemplateContent(item, itemContainer);
4909
- }
4910
- else if (item.type === RibbonItemType.GroupButton) {
4911
- this.ribbonGroupButtonModule.updateGroupButtonSize(itemEle, item);
4912
- }
4913
- itemContainer.classList.remove(RIBBON_CONTENT_HEIGHT, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM);
4914
- if (item.activeSize === RibbonItemSize.Large) {
4915
- itemContainer.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
4916
- }
4917
- else {
4918
- itemContainer.classList.add((item.activeSize === RibbonItemSize.Medium) ?
4919
- RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
4975
+ if (itemEle) {
4976
+ var itemContainer = itemEle.closest('.' + RIBBON_ITEM);
4977
+ if (item.type === RibbonItemType.Button) {
4978
+ this.ribbonButtonModule.updateButtonSize(itemEle, item);
4979
+ }
4980
+ else if (item.type === RibbonItemType.DropDown) {
4981
+ this.ribbonDropDownModule.updateDropDownSize(itemEle, item);
4982
+ }
4983
+ else if (item.type === RibbonItemType.SplitButton) {
4984
+ this.ribbonSplitButtonModule.updateSplitButtonSize(itemEle, item);
4985
+ }
4986
+ else if (item.type === RibbonItemType.Template) {
4987
+ remove(itemEle);
4988
+ this.createTemplateContent(item, itemContainer);
4989
+ }
4990
+ else if (item.type === RibbonItemType.GroupButton) {
4991
+ this.ribbonGroupButtonModule.updateGroupButtonSize(itemEle, item);
4992
+ }
4993
+ itemContainer.classList.remove(RIBBON_CONTENT_HEIGHT, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM);
4994
+ if (item.activeSize === RibbonItemSize.Large) {
4995
+ itemContainer.classList.add(RIBBON_LARGE_ITEM, RIBBON_CONTENT_HEIGHT);
4996
+ }
4997
+ else {
4998
+ itemContainer.classList.add((item.activeSize === RibbonItemSize.Medium) ?
4999
+ RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
5000
+ }
4920
5001
  }
4921
5002
  };
4922
5003
  Ribbon.prototype.createOverflowDropdown = function (tabIndex, tabContent, activeContent) {
@@ -5248,28 +5329,30 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5248
5329
  }
5249
5330
  };
5250
5331
  Ribbon.prototype.removeOverflowEvent = function (item, itemEle) {
5251
- switch (item.type) {
5252
- case 'Button':
5253
- this.ribbonButtonModule.removeOverFlowEvents(item, itemEle);
5254
- break;
5255
- case 'DropDown':
5256
- this.ribbonDropDownModule.removeOverFlowEvents(item, itemEle);
5257
- break;
5258
- case 'SplitButton':
5259
- this.ribbonSplitButtonModule.removeOverFlowEvents(item, itemEle);
5260
- break;
5261
- case 'CheckBox':
5262
- this.ribbonCheckBoxModule.removeOverFlowEvents(item, itemEle);
5263
- break;
5264
- case 'ColorPicker':
5265
- this.ribbonColorPickerModule.removeOverFlowEvents(item, itemEle);
5266
- break;
5267
- case 'ComboBox':
5268
- this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
5269
- break;
5270
- case 'GroupButton':
5271
- this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
5272
- break;
5332
+ if (itemEle) {
5333
+ switch (item.type) {
5334
+ case 'Button':
5335
+ this.ribbonButtonModule.removeOverFlowEvents(item, itemEle);
5336
+ break;
5337
+ case 'DropDown':
5338
+ this.ribbonDropDownModule.removeOverFlowEvents(item, itemEle);
5339
+ break;
5340
+ case 'SplitButton':
5341
+ this.ribbonSplitButtonModule.removeOverFlowEvents(item, itemEle);
5342
+ break;
5343
+ case 'CheckBox':
5344
+ this.ribbonCheckBoxModule.removeOverFlowEvents(item, itemEle);
5345
+ break;
5346
+ case 'ColorPicker':
5347
+ this.ribbonColorPickerModule.removeOverFlowEvents(item, itemEle);
5348
+ break;
5349
+ case 'ComboBox':
5350
+ this.ribbonComboBoxModule.removeOverFlowEvents(item, itemEle);
5351
+ break;
5352
+ case 'GroupButton':
5353
+ this.ribbonGroupButtonModule.removeOverFlowEvents(item, itemEle);
5354
+ break;
5355
+ }
5273
5356
  }
5274
5357
  };
5275
5358
  Ribbon.prototype.createGroupContainer = function (groupId, groupHeader) {
@@ -5474,8 +5557,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5474
5557
  this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
5475
5558
  }
5476
5559
  item.setProperties({ activeSize: size }, true);
5477
- var ele = itemEle.querySelector('#' + item.id);
5478
- this.setItemSize(ele, item);
5560
+ if (itemEle) {
5561
+ var ele = itemEle.querySelector('#' + item.id);
5562
+ this.setItemSize(ele, item);
5563
+ }
5479
5564
  }
5480
5565
  }
5481
5566
  }
@@ -5558,7 +5643,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5558
5643
  }
5559
5644
  else {
5560
5645
  var itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
5561
- if (!itemEle) {
5646
+ if (!itemEle && overflowtarget) {
5562
5647
  itemEle = overflowtarget.querySelector('#' + item.id + CONTAINER_ID);
5563
5648
  if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
5564
5649
  this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
@@ -5568,7 +5653,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5568
5653
  if (item.type === RibbonItemType.GroupButton) {
5569
5654
  this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
5570
5655
  }
5571
- groupCollection.append(itemEle);
5656
+ if (itemEle) {
5657
+ groupCollection.append(itemEle);
5658
+ }
5572
5659
  }
5573
5660
  var ele = groupContainer.querySelector('#' + item.id);
5574
5661
  if (item.type === RibbonItemType.GroupButton) {
@@ -5656,9 +5743,28 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5656
5743
  if ((this.activeLayout === 'Simplified') && !(group.enableGroupOverflow || groupEle.querySelector('.' + RIBBON_ITEM))) {
5657
5744
  groupEle.classList.add('e-ribbon-emptyCollection');
5658
5745
  }
5746
+ var initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
5747
+ if (initialProps) {
5748
+ if (initialProps.hiddenGroups && initialProps.hiddenGroups.length) {
5749
+ this.updateGroupProps('hiddenGroups', initialProps, groupEle);
5750
+ }
5751
+ if (initialProps.disabledGroups && initialProps.disabledGroups.length) {
5752
+ this.updateGroupProps('disabledGroups', initialProps, groupEle);
5753
+ }
5754
+ }
5755
+ }
5756
+ if (this.initialPropsData[parseInt(tabIndex.toString(), 10)]) {
5757
+ delete this.initialPropsData[parseInt(tabIndex.toString(), 10)];
5659
5758
  }
5660
5759
  return groupElements;
5661
5760
  };
5761
+ Ribbon.prototype.updateGroupProps = function (key, initialProps, groupEle) {
5762
+ // eslint-disable-next-line
5763
+ var groupIndex = initialProps[key].indexOf(groupEle.id);
5764
+ if (groupIndex !== -1) {
5765
+ key === 'hiddenGroups' ? groupEle.classList.add('e-hidden') : groupEle.classList.add('e-disabled');
5766
+ }
5767
+ };
5662
5768
  Ribbon.prototype.validateItemSize = function () {
5663
5769
  for (var k = 0; k < this.tabs.length; k++) {
5664
5770
  var groupList = this.tabs[parseInt(k.toString(), 10)].groups;
@@ -5788,6 +5894,13 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
5788
5894
  else {
5789
5895
  itemEle.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
5790
5896
  }
5897
+ var initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
5898
+ if (initialProps && initialProps.hiddenItems && initialProps.hiddenItems.length) {
5899
+ var itemIndex = initialProps.hiddenItems.indexOf(item.id);
5900
+ if (itemIndex !== -1) {
5901
+ itemEle.classList.add('e-hidden');
5902
+ }
5903
+ }
5791
5904
  this.createRibbonItem(item, itemEle);
5792
5905
  if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
5793
5906
  this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
@@ -6355,7 +6468,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6355
6468
  }
6356
6469
  var contentEle = this.tabObj.items[itemProp.tabIndex].content;
6357
6470
  var groupEle = contentEle.querySelector('#' + groupID);
6358
- isHidden ? groupEle.classList.add('e-hidden') : groupEle.classList.remove('e-hidden');
6471
+ if (groupEle) {
6472
+ isHidden ? groupEle.classList.add('e-hidden') : groupEle.classList.remove('e-hidden');
6473
+ }
6474
+ else {
6475
+ this.updateInitialProps(itemProp.tabIndex, groupID, 'hiddenGroups', isHidden);
6476
+ }
6359
6477
  if (this.overflowDDB) {
6360
6478
  var overflowEle = this.overflowDDB.target;
6361
6479
  var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + OVERFLOW_ID);
@@ -6405,7 +6523,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6405
6523
  }
6406
6524
  var contentEle = this.tabObj.items[itemProp.tabIndex].content;
6407
6525
  var groupEle = contentEle.querySelector('#' + groupID);
6408
- isDisabled ? groupEle.classList.add('e-disabled') : groupEle.classList.remove('e-disabled');
6526
+ if (groupEle) {
6527
+ isDisabled ? groupEle.classList.add('e-disabled') : groupEle.classList.remove('e-disabled');
6528
+ }
6529
+ else {
6530
+ this.updateInitialProps(itemProp.tabIndex, groupID, 'disabledGroups', isDisabled);
6531
+ }
6409
6532
  if (this.overflowDDB) {
6410
6533
  var overflowEle = this.overflowDDB.target;
6411
6534
  var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + OVERFLOW_ID);
@@ -6633,6 +6756,36 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
6633
6756
  if (ele) {
6634
6757
  var itemEle = closest(ele, '.e-ribbon-item');
6635
6758
  isHidden ? itemEle.classList.add('e-hidden') : itemEle.classList.remove('e-hidden');
6759
+ this.refreshLayout();
6760
+ }
6761
+ else {
6762
+ this.updateInitialProps(itemProp.tabIndex, itemId, 'hiddenItems', isHidden);
6763
+ }
6764
+ };
6765
+ Ribbon.prototype.updateInitialProps = function (tabIndex, id, key, isInsert) {
6766
+ var initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
6767
+ if (!initialProps) {
6768
+ this.initialPropsData[parseInt(tabIndex.toString(), 10)] = {};
6769
+ initialProps = this.initialPropsData[parseInt(tabIndex.toString(), 10)];
6770
+ }
6771
+ if (initialProps) {
6772
+ /* eslint-disable */
6773
+ if (!initialProps[key])
6774
+ initialProps[key] = [];
6775
+ var itemIndex = initialProps[key].indexOf(id);
6776
+ if (isInsert) {
6777
+ if (itemIndex === -1)
6778
+ initialProps[key].push(id);
6779
+ }
6780
+ else {
6781
+ if (itemIndex !== -1)
6782
+ initialProps[key].splice(itemIndex, 1);
6783
+ initialProps[key].length === 0 && delete initialProps[key];
6784
+ /* eslint-enable */
6785
+ if (Object.keys(initialProps).length === 0) {
6786
+ delete this.initialPropsData[parseInt(tabIndex.toString(), 10)];
6787
+ }
6788
+ }
6636
6789
  }
6637
6790
  };
6638
6791
  /**
@@ -7115,6 +7268,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
7115
7268
  _super.prototype.destroy.call(this);
7116
7269
  this.tabObj.destroy();
7117
7270
  this.tabObj = undefined;
7271
+ this.initialPropsData = {};
7118
7272
  remove(this.element.querySelector('#' + this.element.id + TAB_ID));
7119
7273
  this.element.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
7120
7274
  this.element.style.removeProperty(RIBBON_HELP_PANE_TEMPLATE_WIDTH);
@@ -8175,5 +8329,5 @@ var RibbonBackstage = /** @__PURE__ @class */ (function (_super) {
8175
8329
  // export all modules from current location
8176
8330
  // example: export * from './module'
8177
8331
 
8178
- export { Ribbon, RibbonLayout, ItemOrientation, RibbonItemSize, DisplayMode, RibbonItemType, RibbonGroupButtonSelection, ITEM_VERTICAL_CENTER, EXPAND_COLLAPSE_ICON, BACKSTAGE_CLOSE_ICON, OVERFLOW_ICON, VERTICAL_DDB, DISABLED_CSS, RTL_CSS, RIBBON_HOVER, RIBBON_CONTROL, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE, HORIZONTAL_SCROLLBAR, HIDE_CSS, RIBBON_TAB, RIBBON_TAB_ACTIVE, RIBBON_TAB_ITEM, RIBBON_COLLAPSE_BUTTON, RIBBON_EXPAND_BUTTON, RIBBON_COLLAPSIBLE, RIBBON_OVERALL_OF_BUTTON, RIBBON_GROUP_OF_BUTTON, RIBBON_OVERFLOW_TARGET, RIBBON_OVERFLOW, TAB_CONTENT, RIBBON_MINIMIZE, RIBBON_GROUP, RIBBON_SINGLE_BUTTON_SELECTION, RIBBON_MULTIPLE_BUTTON_SELECTION, RIBBON_GROUP_BUTTON, RIBBON_GROUP_BUTTON_OVERFLOW_POPUP, RIBBON_GROUP_CONTAINER, RIBBON_OF_TAB_CONTAINER, RIBBON_OF_GROUP_CONTAINER, RIBBON_GROUP_CONTENT, RIBBON_GROUP_HEADER, RIBBON_OVERFLOW_HEADER, RIBBON_GROUP_OVERFLOW, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_LAUNCHER, RIBBON_LAUNCHER_ICON_ELE, RIBBON_LAUNCHER_ICON, RIBBON_COLLECTION, RIBBON_ITEM, RIBBON_ROW, RIBBON_COLUMN, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM, RIBBON_CONTENT_HEIGHT, DROPDOWNBUTTON, DROPDOWNBUTTON_HIDE, RIBBON_TEMPLATE, RIBBON_HELP_TEMPLATE, RIBBON_TOOLTIP, RIBBON_TOOLTIP_TARGET, RIBBON_TOOLTIP_TITLE, RIBBON_TOOLTIP_CONTENT, RIBBON_TOOLTIP_ICON, RIBBON_TOOLTIP_CONTAINER, RIBBON_TEXT_CONTAINER, RIBBON_SIMPLIFIED_MODE, RIBBON_BACKSTAGE_POPUP, RIBBON_BACKSTAGE_OPEN, RIBBON_BACKSTAGE_CONTENT, RIBBON_SELECTED_CONTENT, RIBBON_BACKSTAGE, RIBBON_BACKSTAGE_MENU, RIBBON_BACKSTAGE_TEMPLATE, RIBBON_BACKSTAGE_MENU_WRAPPER, RIBBON_BACKSTAGE_ITEMS_WRAPPER, RIBBON_BACKSTAGE_TEXT_MENU, TAB_ID, GROUP_ID, COLLECTION_ID, ITEM_ID, COLLAPSE_BUTTON_ID, OVRLOF_BUTTON_ID, GROUPOF_BUTTON_ID, HEADER_ID, LAUNCHER_ID, CONTENT_ID, CONTAINER_ID, OVERFLOW_ID, DROPDOWN_ID, RIBBON_FILE_MENU_ID, RIBBON_BACKSTAGE_MENU_ID, RIBBON_BACKSTAGE_POPUP_ID, RIBBON_FILE_MENU_LIST, RIBBON_MENU_LIST, RIBBON_FOOTER_MENU_LIST, RIBBON_HELP_PANE_TEMPLATE_ID, RIBBON_GROUP_BUTTON_ID, RIBBON_FILE_MENU_WIDTH, RIBBON_HELP_PANE_TEMPLATE_WIDTH, getIndex, getTemplateFunction, getItem, getCollection, getGroup, destroyControl, updateCommonProperty, updateControlDisabled, getItemElement, isTooltipPresent, setToolTipContent, createTooltip, destroyTooltip, updateTooltipProp, RibbonTab, RibbonGroup, RibbonCollection, RibbonItem, RibbonButtonSettings, RibbonCheckBoxSettings, RibbonColorPickerSettings, RibbonComboBoxSettings, RibbonDropDownSettings, RibbonSplitButtonSettings, FileMenuSettings, BackStageMenu, BackstageBackButton, BackstageItem, RibbonTooltip, RibbonGroupButtonSettings, RibbonGroupButtonItem, RibbonButton, RibbonCheckBox, RibbonColorPicker, RibbonComboBox, RibbonDropDown, RibbonSplitButton, RibbonGroupButton, RibbonFileMenu, RibbonBackstage };
8332
+ export { Ribbon, RibbonLayout, ItemOrientation, RibbonItemSize, DisplayMode, RibbonItemType, RibbonGroupButtonSelection, ITEM_VERTICAL_CENTER, EXPAND_COLLAPSE_ICON, BACKSTAGE_CLOSE_ICON, OVERFLOW_ICON, VERTICAL_DDB, DISABLED_CSS, RTL_CSS, RIBBON_HOVER, RIBBON_CONTROL, RIBBON_POPUP_CONTROL, RIBBON_POPUP_OPEN, SPACE, HORIZONTAL_SCROLLBAR, HIDE_CSS, RIBBON_TAB, RIBBON_TAB_ACTIVE, RIBBON_TAB_ITEM, RIBBON_COLLAPSE_BUTTON, RIBBON_EXPAND_BUTTON, RIBBON_COLLAPSIBLE, RIBBON_OVERALL_OF_BUTTON, RIBBON_GROUP_OF_BUTTON, RIBBON_OVERFLOW_TARGET, RIBBON_OVERFLOW, TAB_CONTENT, RIBBON_MINIMIZE, RIBBON_GROUP, RIBBON_SINGLE_BUTTON_SELECTION, RIBBON_MULTIPLE_BUTTON_SELECTION, RIBBON_GROUP_BUTTON, RIBBON_GROUP_BUTTON_OVERFLOW_POPUP, RIBBON_GROUP_CONTAINER, RIBBON_OF_TAB_CONTAINER, RIBBON_OF_GROUP_CONTAINER, RIBBON_GROUP_CONTENT, RIBBON_GROUP_HEADER, RIBBON_OVERFLOW_HEADER, RIBBON_GROUP_OVERFLOW, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_LAUNCHER, RIBBON_LAUNCHER_ICON_ELE, RIBBON_LAUNCHER_ICON, RIBBON_COLLECTION, RIBBON_ITEM, RIBBON_ROW, RIBBON_COLUMN, RIBBON_LARGE_ITEM, RIBBON_MEDIUM_ITEM, RIBBON_SMALL_ITEM, RIBBON_CONTENT_HEIGHT, DROPDOWNBUTTON, DROPDOWNBUTTON_HIDE, RIBBON_TEMPLATE, RIBBON_HELP_TEMPLATE, RIBBON_TOOLTIP, RIBBON_TOOLTIP_TARGET, RIBBON_TOOLTIP_TITLE, RIBBON_TOOLTIP_CONTENT, RIBBON_TOOLTIP_ICON, RIBBON_TOOLTIP_CONTAINER, RIBBON_TEXT_CONTAINER, RIBBON_SIMPLIFIED_MODE, RIBBON_BACKSTAGE_POPUP, RIBBON_BACKSTAGE_OPEN, RIBBON_BACKSTAGE_CONTENT, RIBBON_SELECTED_CONTENT, RIBBON_BACKSTAGE, RIBBON_BACKSTAGE_MENU, RIBBON_BACKSTAGE_TEMPLATE, RIBBON_BACKSTAGE_MENU_WRAPPER, RIBBON_BACKSTAGE_ITEMS_WRAPPER, RIBBON_BACKSTAGE_TEXT_MENU, TAB_ID, GROUP_ID, COLLECTION_ID, ITEM_ID, COLLAPSE_BUTTON_ID, OVRLOF_BUTTON_ID, GROUPOF_BUTTON_ID, HEADER_ID, LAUNCHER_ID, CONTENT_ID, CONTAINER_ID, OVERFLOW_ID, DROPDOWN_ID, RIBBON_FILE_MENU_ID, RIBBON_BACKSTAGE_MENU_ID, RIBBON_BACKSTAGE_POPUP_ID, RIBBON_FILE_MENU_LIST, RIBBON_MENU_LIST, RIBBON_FOOTER_MENU_LIST, RIBBON_HELP_PANE_TEMPLATE_ID, RIBBON_GROUP_BUTTON_ID, RIBBON_FILE_MENU_WIDTH, RIBBON_HELP_PANE_TEMPLATE_WIDTH, getIndex, getTemplateFunction, getItem, getCollection, getGroup, destroyControl, updateCommonProperty, updateControlDisabled, getItemElement, isTooltipPresent, setToolTipContent, createTooltip, destroyTooltip, updateTooltipProp, setCustomAttributes, RibbonTab, RibbonGroup, RibbonCollection, RibbonItem, RibbonButtonSettings, RibbonCheckBoxSettings, RibbonColorPickerSettings, RibbonComboBoxSettings, RibbonDropDownSettings, RibbonSplitButtonSettings, FileMenuSettings, BackStageMenu, BackstageBackButton, BackstageItem, RibbonTooltip, RibbonGroupButtonSettings, RibbonGroupButtonItem, RibbonButton, RibbonCheckBox, RibbonColorPicker, RibbonComboBox, RibbonDropDown, RibbonSplitButton, RibbonGroupButton, RibbonFileMenu, RibbonBackstage };
8179
8333
  //# sourceMappingURL=ej2-ribbon.es5.js.map