@syncfusion/ej2-ribbon 23.2.7 → 24.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.
- package/CHANGELOG.md +20 -2
- package/README.md +1 -1
- package/dist/ej2-ribbon.umd.min.js +2 -2
- package/dist/ej2-ribbon.umd.min.js.map +1 -1
- package/dist/es6/ej2-ribbon.es2015.js +541 -57
- package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
- package/dist/es6/ej2-ribbon.es5.js +561 -72
- package/dist/es6/ej2-ribbon.es5.js.map +1 -1
- package/dist/global/ej2-ribbon.min.js +2 -2
- package/dist/global/ej2-ribbon.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +13 -13
- package/src/ribbon/base/ribbon.d.ts +10 -0
- package/src/ribbon/base/ribbon.js +444 -53
- package/src/ribbon/items/ribbon-colorpicker.js +16 -0
- package/src/ribbon/items/ribbon-combobox.js +16 -0
- package/src/ribbon/items/ribbon-dropdown.js +5 -3
- package/src/ribbon/items/ribbon-groupbutton.d.ts +4 -1
- package/src/ribbon/items/ribbon-groupbutton.js +64 -15
- package/src/ribbon/models/ribbon-colorpicker-settings-model.d.ts +8 -1
- package/src/ribbon/models/ribbon-colorpicker-settings.d.ts +7 -1
- package/src/ribbon/models/ribbon-colorpicker-settings.js +4 -1
- package/src/ribbon/models/ribbon-combobox-settings-model.d.ts +7 -0
- package/src/ribbon/models/ribbon-combobox-settings.d.ts +6 -0
- package/src/ribbon/models/ribbon-combobox-settings.js +3 -0
- package/src/ribbon/models/ribbon-group-button-settings-model.d.ts +7 -0
- package/src/ribbon/models/ribbon-group-button-settings.d.ts +6 -0
- package/src/ribbon/models/ribbon-group-button-settings.js +3 -0
- package/src/ribbon/models/ribbon-group-model.d.ts +7 -0
- package/src/ribbon/models/ribbon-group.d.ts +6 -0
- package/src/ribbon/models/ribbon-group.js +3 -0
- package/src/ribbon/modules/ribbon-backstage.js +3 -0
- package/styles/bootstrap-dark.css +105 -26
- package/styles/bootstrap.css +104 -25
- package/styles/bootstrap4.css +104 -25
- package/styles/bootstrap5-dark.css +105 -26
- package/styles/bootstrap5.css +104 -25
- package/styles/fabric-dark.css +103 -24
- package/styles/fabric.css +104 -25
- package/styles/fluent-dark.css +104 -25
- package/styles/fluent.css +104 -25
- package/styles/highcontrast-light.css +103 -24
- package/styles/highcontrast.css +103 -24
- package/styles/material-dark.css +105 -26
- package/styles/material.css +105 -26
- package/styles/material3-dark.css +105 -26
- package/styles/material3.css +105 -26
- package/styles/ribbon/_bootstrap-dark-definition.scss +8 -0
- package/styles/ribbon/_bootstrap-definition.scss +8 -0
- package/styles/ribbon/_bootstrap4-definition.scss +8 -0
- package/styles/ribbon/_bootstrap5-definition.scss +8 -0
- package/styles/ribbon/_fabric-dark-definition.scss +8 -0
- package/styles/ribbon/_fabric-definition.scss +8 -0
- package/styles/ribbon/_fluent-definition.scss +8 -0
- package/styles/ribbon/_fusionnew-definition.scss +8 -0
- package/styles/ribbon/_highcontrast-definition.scss +8 -0
- package/styles/ribbon/_highcontrast-light-definition.scss +8 -0
- package/styles/ribbon/_layout.scss +69 -5
- package/styles/ribbon/_material-dark-definition.scss +9 -1
- package/styles/ribbon/_material-definition.scss +9 -1
- package/styles/ribbon/_material3-definition.scss +8 -2
- package/styles/ribbon/_tailwind-definition.scss +8 -0
- package/styles/ribbon/_theme.scss +34 -13
- package/styles/ribbon/bootstrap-dark.css +105 -26
- package/styles/ribbon/bootstrap.css +104 -25
- package/styles/ribbon/bootstrap4.css +104 -25
- package/styles/ribbon/bootstrap5-dark.css +105 -26
- package/styles/ribbon/bootstrap5.css +104 -25
- package/styles/ribbon/fabric-dark.css +103 -24
- package/styles/ribbon/fabric.css +104 -25
- package/styles/ribbon/fluent-dark.css +104 -25
- package/styles/ribbon/fluent.css +104 -25
- package/styles/ribbon/highcontrast-light.css +103 -24
- package/styles/ribbon/highcontrast.css +103 -24
- package/styles/ribbon/material-dark.css +105 -26
- package/styles/ribbon/material.css +105 -26
- package/styles/ribbon/material3-dark.css +105 -26
- package/styles/ribbon/material3.css +105 -26
- package/styles/ribbon/tailwind-dark.css +104 -25
- package/styles/ribbon/tailwind.css +104 -25
- package/styles/tailwind-dark.css +104 -25
- package/styles/tailwind.css +104 -25
|
@@ -244,11 +244,14 @@ __decorate$7([
|
|
|
244
244
|
__decorate$7([
|
|
245
245
|
Property('')
|
|
246
246
|
], RibbonColorPickerSettings.prototype, "cssClass", void 0);
|
|
247
|
+
__decorate$7([
|
|
248
|
+
Property('')
|
|
249
|
+
], RibbonColorPickerSettings.prototype, "label", void 0);
|
|
247
250
|
__decorate$7([
|
|
248
251
|
Property(true)
|
|
249
252
|
], RibbonColorPickerSettings.prototype, "enableOpacity", void 0);
|
|
250
253
|
__decorate$7([
|
|
251
|
-
Property('
|
|
254
|
+
Property('Palette')
|
|
252
255
|
], RibbonColorPickerSettings.prototype, "mode", void 0);
|
|
253
256
|
__decorate$7([
|
|
254
257
|
Property(true)
|
|
@@ -319,6 +322,9 @@ __decorate$8([
|
|
|
319
322
|
__decorate$8([
|
|
320
323
|
Property('')
|
|
321
324
|
], RibbonComboBoxSettings.prototype, "cssClass", void 0);
|
|
325
|
+
__decorate$8([
|
|
326
|
+
Property('')
|
|
327
|
+
], RibbonComboBoxSettings.prototype, "label", void 0);
|
|
322
328
|
__decorate$8([
|
|
323
329
|
Property([])
|
|
324
330
|
], RibbonComboBoxSettings.prototype, "dataSource", void 0);
|
|
@@ -598,6 +604,9 @@ var __decorate$12 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
598
604
|
*/
|
|
599
605
|
class RibbonGroupButtonSettings extends ChildProperty {
|
|
600
606
|
}
|
|
607
|
+
__decorate$12([
|
|
608
|
+
Property('')
|
|
609
|
+
], RibbonGroupButtonSettings.prototype, "header", void 0);
|
|
601
610
|
__decorate$12([
|
|
602
611
|
Property('Single')
|
|
603
612
|
], RibbonGroupButtonSettings.prototype, "selection", void 0);
|
|
@@ -751,6 +760,9 @@ __decorate$2([
|
|
|
751
760
|
__decorate$2([
|
|
752
761
|
Property('Column')
|
|
753
762
|
], RibbonGroup.prototype, "orientation", void 0);
|
|
763
|
+
__decorate$2([
|
|
764
|
+
Property('')
|
|
765
|
+
], RibbonGroup.prototype, "overflowHeader", void 0);
|
|
754
766
|
__decorate$2([
|
|
755
767
|
Property(0)
|
|
756
768
|
], RibbonGroup.prototype, "priority", void 0);
|
|
@@ -1517,6 +1529,15 @@ class RibbonColorPicker {
|
|
|
1517
1529
|
* @hidden
|
|
1518
1530
|
*/
|
|
1519
1531
|
addOverFlowEvents(item, itemEle, overflowButton) {
|
|
1532
|
+
let colorPickerSettings = item.colorPickerSettings;
|
|
1533
|
+
if (colorPickerSettings.label && this.parent.activeLayout === 'Simplified') {
|
|
1534
|
+
const label = this.parent.createElement('div', {
|
|
1535
|
+
className: 'e-ribbon-colorpicker-label',
|
|
1536
|
+
id: item.id + '_label',
|
|
1537
|
+
innerHTML: colorPickerSettings.label
|
|
1538
|
+
});
|
|
1539
|
+
itemEle.insertBefore(label, itemEle.firstChild);
|
|
1540
|
+
}
|
|
1520
1541
|
const colorPickerEle = itemEle.querySelector('#' + item.id);
|
|
1521
1542
|
colorPickerEle.setAttribute('data-control', item.type.toString());
|
|
1522
1543
|
const colorPickerObj = getComponent(colorPickerEle, ColorPicker);
|
|
@@ -1546,6 +1567,13 @@ class RibbonColorPicker {
|
|
|
1546
1567
|
* @hidden
|
|
1547
1568
|
*/
|
|
1548
1569
|
removeOverFlowEvents(item, itemEle) {
|
|
1570
|
+
let colorPickerSettings = item.colorPickerSettings;
|
|
1571
|
+
if (colorPickerSettings.label) {
|
|
1572
|
+
const label = itemEle.querySelector('#' + item.id + '_label');
|
|
1573
|
+
if (label) {
|
|
1574
|
+
label.remove();
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1549
1577
|
const colorPickerEle = itemEle.querySelector('#' + item.id);
|
|
1550
1578
|
const colorPickerObj = getComponent(colorPickerEle, ColorPicker);
|
|
1551
1579
|
let cssClass = colorPickerObj.cssClass.split(SPACE);
|
|
@@ -1708,6 +1736,15 @@ class RibbonComboBox {
|
|
|
1708
1736
|
* @hidden
|
|
1709
1737
|
*/
|
|
1710
1738
|
addOverFlowEvents(item, itemEle, overflowButton) {
|
|
1739
|
+
const comboBoxSettings = item.comboBoxSettings;
|
|
1740
|
+
if (comboBoxSettings.label && this.parent.activeLayout === 'Simplified') {
|
|
1741
|
+
const label = this.parent.createElement('div', {
|
|
1742
|
+
className: 'e-ribbon-combobox-label',
|
|
1743
|
+
id: item.id + '_label',
|
|
1744
|
+
innerHTML: comboBoxSettings.label
|
|
1745
|
+
});
|
|
1746
|
+
itemEle.insertBefore(label, itemEle.firstChild);
|
|
1747
|
+
}
|
|
1711
1748
|
const inputEle = itemEle.querySelector('#' + item.id);
|
|
1712
1749
|
inputEle.setAttribute('data-control', item.type.toString());
|
|
1713
1750
|
const comboBoxObj = getComponent(inputEle, ComboBox);
|
|
@@ -1731,6 +1768,13 @@ class RibbonComboBox {
|
|
|
1731
1768
|
* @hidden
|
|
1732
1769
|
*/
|
|
1733
1770
|
removeOverFlowEvents(item, itemEle) {
|
|
1771
|
+
const comboBoxSettings = item.comboBoxSettings;
|
|
1772
|
+
if (comboBoxSettings.label) {
|
|
1773
|
+
const label = itemEle.querySelector('#' + item.id + '_label');
|
|
1774
|
+
if (label) {
|
|
1775
|
+
label.remove();
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1734
1778
|
const inputEle = itemEle.querySelector('#' + item.id);
|
|
1735
1779
|
const comboBoxObj = getComponent(inputEle, ComboBox);
|
|
1736
1780
|
let cssClass = comboBoxObj.cssClass.split(SPACE);
|
|
@@ -1967,7 +2011,9 @@ class RibbonDropDown {
|
|
|
1967
2011
|
return dropdown;
|
|
1968
2012
|
}
|
|
1969
2013
|
keyActionHandler(e, target) {
|
|
1970
|
-
const
|
|
2014
|
+
const controlElements = Array.prototype.slice.call(target.querySelectorAll('.e-control'));
|
|
2015
|
+
const templateElements = Array.prototype.slice.call(target.querySelectorAll('.e-ribbon-template'));
|
|
2016
|
+
const items = controlElements.concat(templateElements);
|
|
1971
2017
|
const comboBoxElements = target.querySelectorAll('.e-combobox');
|
|
1972
2018
|
let comboBoxEle;
|
|
1973
2019
|
if (comboBoxElements) {
|
|
@@ -1986,7 +2032,7 @@ class RibbonDropDown {
|
|
|
1986
2032
|
}
|
|
1987
2033
|
}
|
|
1988
2034
|
}
|
|
1989
|
-
if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
|
|
2035
|
+
if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-launcher-icon') ||
|
|
1990
2036
|
e.target.classList.contains('e-ribbon-last-item') || e.target.classList.contains('e-ribbon-first-item')) {
|
|
1991
2037
|
if (e.key === 'ArrowRight' || (!e.shiftKey && e.key === 'Tab')) {
|
|
1992
2038
|
this.handleNavigation(e, !this.enableRtl, items);
|
|
@@ -2009,7 +2055,7 @@ class RibbonDropDown {
|
|
|
2009
2055
|
}
|
|
2010
2056
|
if (!e.target.classList.contains('e-combobox') && !e.target.classList.contains('e-ribbon-last-item') &&
|
|
2011
2057
|
!e.target.classList.contains('e-ribbon-group-container') && (e.target.classList.contains('e-ribbon-first-item')
|
|
2012
|
-
|| this.itemIndex !== 0) && e.target.classList.contains('e-control')) {
|
|
2058
|
+
|| this.itemIndex !== 0) && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template'))) {
|
|
2013
2059
|
this.itemIndex++;
|
|
2014
2060
|
this.updateItemIndex(e, items, true);
|
|
2015
2061
|
}
|
|
@@ -2943,18 +2989,19 @@ class RibbonGroupButton {
|
|
|
2943
2989
|
}
|
|
2944
2990
|
count++;
|
|
2945
2991
|
}
|
|
2946
|
-
new DropDownButton({
|
|
2992
|
+
const dropdown = new DropDownButton({
|
|
2947
2993
|
iconCss: dropdownIcon,
|
|
2948
2994
|
target: btnContainerEle,
|
|
2949
2995
|
enableRtl: this.parent.enableRtl,
|
|
2950
2996
|
cssClass: 'e-ribbon-dropdown-group-button',
|
|
2951
2997
|
disabled: item.disabled
|
|
2952
2998
|
}, buttonEle);
|
|
2999
|
+
if (groupBtnSettings.header) {
|
|
3000
|
+
const dropDownPopup = dropdown.dropDown;
|
|
3001
|
+
this.addGroupButtonHeader(item.id, groupBtnSettings, dropDownPopup.element);
|
|
3002
|
+
}
|
|
2953
3003
|
buttonEle.onclick = buttonEle.onkeydown = () => {
|
|
2954
|
-
|
|
2955
|
-
document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + 0).focus();
|
|
2956
|
-
this.grpBtnIndex = 0;
|
|
2957
|
-
}
|
|
3004
|
+
this.handleFocusState(item, itemElement);
|
|
2958
3005
|
};
|
|
2959
3006
|
btnContainerEle.onkeydown = (e) => {
|
|
2960
3007
|
if (this.parent.activeLayout === 'Simplified') {
|
|
@@ -2966,7 +3013,9 @@ class RibbonGroupButton {
|
|
|
2966
3013
|
}
|
|
2967
3014
|
}
|
|
2968
3015
|
groupButtonClicked(itemIndex, item, grpBtnSettings) {
|
|
2969
|
-
const previousItems = []
|
|
3016
|
+
const previousItems = [];
|
|
3017
|
+
const selectingItems = [];
|
|
3018
|
+
const selectedItems = [];
|
|
2970
3019
|
let groupButtonEle;
|
|
2971
3020
|
let dropdown;
|
|
2972
3021
|
for (let j = 0; j < grpBtnSettings.items.length; j++) {
|
|
@@ -2997,9 +3046,11 @@ class RibbonGroupButton {
|
|
|
2997
3046
|
for (let j = 0; j < grpBtnSettings.items.length; j++) {
|
|
2998
3047
|
if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j) && document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.contains('e-active')) {
|
|
2999
3048
|
document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + j).classList.remove('e-active');
|
|
3049
|
+
grpBtnSettings.items[parseInt(j.toString(), 10)].selected = false;
|
|
3000
3050
|
}
|
|
3001
3051
|
}
|
|
3002
3052
|
document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
|
|
3053
|
+
grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].selected = true;
|
|
3003
3054
|
if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active') && this.parent.activeLayout === 'Simplified') {
|
|
3004
3055
|
this.grpBtnIndex = itemIndex;
|
|
3005
3056
|
groupButtonEle = document.querySelector('#' + item.id);
|
|
@@ -3015,6 +3066,12 @@ class RibbonGroupButton {
|
|
|
3015
3066
|
document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID).classList.add(RIBBON_MULTIPLE_BUTTON_SELECTION);
|
|
3016
3067
|
}
|
|
3017
3068
|
document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.toggle('e-active');
|
|
3069
|
+
if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + itemIndex).classList.contains('e-active')) {
|
|
3070
|
+
grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].selected = true;
|
|
3071
|
+
}
|
|
3072
|
+
else {
|
|
3073
|
+
grpBtnSettings.items[parseInt(itemIndex.toString(), 10)].selected = false;
|
|
3074
|
+
}
|
|
3018
3075
|
let activeEleCount = 0;
|
|
3019
3076
|
for (let n = 0; n < grpBtnSettings.items.length; n++) {
|
|
3020
3077
|
if (document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n) && document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + n).classList.contains('e-active') && this.parent.activeLayout === 'Simplified' && n !== itemIndex) {
|
|
@@ -3102,18 +3159,19 @@ class RibbonGroupButton {
|
|
|
3102
3159
|
}
|
|
3103
3160
|
itemsCount++;
|
|
3104
3161
|
}
|
|
3105
|
-
new DropDownButton({
|
|
3162
|
+
const dropdown = new DropDownButton({
|
|
3106
3163
|
iconCss: dropdownIcon,
|
|
3107
3164
|
target: containerEle,
|
|
3108
3165
|
enableRtl: this.parent.enableRtl,
|
|
3109
3166
|
cssClass: 'e-ribbon-dropdown-group-button',
|
|
3110
3167
|
disabled: item.disabled
|
|
3111
3168
|
}, buttonEle);
|
|
3169
|
+
if (groupBtnSettings.header) {
|
|
3170
|
+
const dropDownPopup = dropdown.dropDown;
|
|
3171
|
+
this.addGroupButtonHeader(item.id, groupBtnSettings, dropDownPopup.element);
|
|
3172
|
+
}
|
|
3112
3173
|
buttonEle.onclick = buttonEle.onkeydown = () => {
|
|
3113
|
-
|
|
3114
|
-
document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + 0).focus();
|
|
3115
|
-
this.grpBtnIndex = 0;
|
|
3116
|
-
}
|
|
3174
|
+
this.handleFocusState(item, itemElement);
|
|
3117
3175
|
};
|
|
3118
3176
|
containerEle.onkeydown = (e) => {
|
|
3119
3177
|
if (this.parent.activeLayout === 'Simplified') {
|
|
@@ -3132,6 +3190,26 @@ class RibbonGroupButton {
|
|
|
3132
3190
|
}
|
|
3133
3191
|
}
|
|
3134
3192
|
}
|
|
3193
|
+
handleFocusState(item, itemElement) {
|
|
3194
|
+
if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
|
|
3195
|
+
const defaultSelectedBtn = document.querySelector('#' + item.id + '_grpbtn').querySelector('.' + RIBBON_GROUP_BUTTON + '.e-active');
|
|
3196
|
+
if (defaultSelectedBtn) {
|
|
3197
|
+
defaultSelectedBtn.focus();
|
|
3198
|
+
}
|
|
3199
|
+
else {
|
|
3200
|
+
document.querySelector('#' + item.id + RIBBON_GROUP_BUTTON_ID + 0).focus();
|
|
3201
|
+
}
|
|
3202
|
+
this.grpBtnIndex = 0;
|
|
3203
|
+
}
|
|
3204
|
+
}
|
|
3205
|
+
addGroupButtonHeader(itemID, groupBtnSettings, popupEle) {
|
|
3206
|
+
const groupButtonHeader = this.parent.createElement('div', {
|
|
3207
|
+
className: 'e-ribbon-groupbutton-header',
|
|
3208
|
+
id: itemID + HEADER_ID,
|
|
3209
|
+
innerHTML: groupBtnSettings.header
|
|
3210
|
+
});
|
|
3211
|
+
popupEle.insertBefore(groupButtonHeader, popupEle.firstChild);
|
|
3212
|
+
}
|
|
3135
3213
|
handleGroupButtonNavigation(e, item) {
|
|
3136
3214
|
const groupButtonEle = document.querySelector('#' + item.id);
|
|
3137
3215
|
const dropdown = getComponent(groupButtonEle, DropDownButton);
|
|
@@ -3197,15 +3275,28 @@ class RibbonGroupButton {
|
|
|
3197
3275
|
* @returns {void}
|
|
3198
3276
|
* @hidden
|
|
3199
3277
|
*/
|
|
3200
|
-
addOverFlowEvents(item, itemEle) {
|
|
3278
|
+
addOverFlowEvents(item, itemEle, overflowButton) {
|
|
3279
|
+
const groupBtnSettings = item.groupButtonSettings;
|
|
3280
|
+
let isIconOnly = true;
|
|
3201
3281
|
const groupButtonEle = itemEle.querySelector('#' + item.id);
|
|
3202
3282
|
const dropdown = getComponent(groupButtonEle, DropDownButton);
|
|
3203
|
-
dropdown.setProperties({ cssClass: dropdown.cssClass + SPACE + RIBBON_GROUP_BUTTON_OVERFLOW_POPUP });
|
|
3283
|
+
dropdown.setProperties({ cssClass: dropdown.cssClass + SPACE + RIBBON_GROUP_BUTTON_OVERFLOW_POPUP, content: groupBtnSettings.header ? groupBtnSettings.header : '' });
|
|
3204
3284
|
const targetEle = dropdown.target;
|
|
3285
|
+
if (targetEle.children.length) {
|
|
3286
|
+
for (let i = 0; i < targetEle.children.length; i++) {
|
|
3287
|
+
if (groupBtnSettings.items[parseInt(i.toString(), 10)].content) {
|
|
3288
|
+
isIconOnly = false;
|
|
3289
|
+
break;
|
|
3290
|
+
}
|
|
3291
|
+
}
|
|
3292
|
+
if (isIconOnly) {
|
|
3293
|
+
targetEle.classList.add('e-icon-btn');
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3205
3296
|
targetEle.onclick = () => {
|
|
3206
3297
|
if (this.parent.activeLayout === 'Simplified' && targetEle.closest('.e-ribbon-dropdown-group-button').classList.contains(RIBBON_GROUP_BUTTON_OVERFLOW_POPUP)) {
|
|
3207
|
-
dropdown.element.focus();
|
|
3208
3298
|
dropdown.toggle();
|
|
3299
|
+
overflowButton.toggle();
|
|
3209
3300
|
}
|
|
3210
3301
|
};
|
|
3211
3302
|
}
|
|
@@ -3221,9 +3312,13 @@ class RibbonGroupButton {
|
|
|
3221
3312
|
const groupButtonEle = itemEle.querySelector('#' + item.id);
|
|
3222
3313
|
if (groupButtonEle) {
|
|
3223
3314
|
const dropdown = getComponent(groupButtonEle, DropDownButton);
|
|
3315
|
+
const targetEle = dropdown.target;
|
|
3316
|
+
if (targetEle.classList.contains('e-icon-btn')) {
|
|
3317
|
+
targetEle.classList.remove('e-icon-btn');
|
|
3318
|
+
}
|
|
3224
3319
|
let cssClass = dropdown.cssClass.split(SPACE);
|
|
3225
3320
|
cssClass = cssClass.filter((value) => value !== RIBBON_GROUP_BUTTON_OVERFLOW_POPUP);
|
|
3226
|
-
dropdown.setProperties({ cssClass: cssClass.join(SPACE) });
|
|
3321
|
+
dropdown.setProperties({ cssClass: cssClass.join(SPACE), content: '' });
|
|
3227
3322
|
}
|
|
3228
3323
|
}
|
|
3229
3324
|
/**
|
|
@@ -3306,6 +3401,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3306
3401
|
this.idIndex = 0;
|
|
3307
3402
|
this.tooltipData = [];
|
|
3308
3403
|
this.initialPropsData = {};
|
|
3404
|
+
this.hiddenElements = {};
|
|
3405
|
+
this.hiddenGroups = [];
|
|
3309
3406
|
this.isAddRemove = false;
|
|
3310
3407
|
this.keyConfigs = {
|
|
3311
3408
|
leftarrow: 'leftarrow',
|
|
@@ -3379,7 +3476,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3379
3476
|
e.preventDefault();
|
|
3380
3477
|
}
|
|
3381
3478
|
const activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + CONTENT_ID);
|
|
3382
|
-
const
|
|
3479
|
+
const controlElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-control'));
|
|
3480
|
+
const templateElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-template'));
|
|
3481
|
+
const ribbonControls = controlElements.concat(templateElements);
|
|
3383
3482
|
const comboBoxElements = activeContent.querySelectorAll('.e-combobox');
|
|
3384
3483
|
let comboBoxEle;
|
|
3385
3484
|
if (comboBoxElements) {
|
|
@@ -3408,7 +3507,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3408
3507
|
if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
|
|
3409
3508
|
e.target.classList.contains('e-ribbon-collapse-btn') || e.target.classList.contains('e-ribbon-last-item') ||
|
|
3410
3509
|
e.target.classList.contains('e-ribbon-first-item') || e.target.classList.contains('e-ribbon-group-of-btn') ||
|
|
3411
|
-
e.target.classList.contains('e-ribbon-overall-of-btn')) {
|
|
3510
|
+
e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template')) {
|
|
3412
3511
|
switch (e.action) {
|
|
3413
3512
|
case 'rightarrow':
|
|
3414
3513
|
this.handleNavigation(e, !this.enableRtl, ribbonControls);
|
|
@@ -3450,7 +3549,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3450
3549
|
}
|
|
3451
3550
|
}
|
|
3452
3551
|
if ((!enableRtl && (this.currentControlIndex > 0)) || (enableRtl && (this.currentControlIndex < ribbonControls.length - 1))) {
|
|
3453
|
-
if (!e.target.classList.contains('e-combobox') && e.target.classList.contains('e-control') && !e.target.classList.contains('e-ribbon-last-item')) {
|
|
3552
|
+
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')) {
|
|
3454
3553
|
if (enableRtl) {
|
|
3455
3554
|
this.currentControlIndex++;
|
|
3456
3555
|
}
|
|
@@ -3484,7 +3583,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3484
3583
|
}
|
|
3485
3584
|
if (launcherIconEle) {
|
|
3486
3585
|
const items = groupContainer.querySelectorAll('.e-ribbon-item');
|
|
3487
|
-
items[items.length - 1].querySelector('.e-control')
|
|
3586
|
+
const elem = items[items.length - 1].querySelector('.e-control');
|
|
3587
|
+
if (elem) {
|
|
3588
|
+
elem.classList.add('e-ribbon-last-item');
|
|
3589
|
+
}
|
|
3488
3590
|
}
|
|
3489
3591
|
}
|
|
3490
3592
|
else {
|
|
@@ -3597,6 +3699,15 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3597
3699
|
const scrollEle = this.tabObj.element.querySelector('.' + HORIZONTAL_SCROLLBAR);
|
|
3598
3700
|
this.scrollModule.scrollStep = scrollEle.offsetWidth;
|
|
3599
3701
|
}
|
|
3702
|
+
if (this.activeLayout === 'Simplified') {
|
|
3703
|
+
const activePopup = document.querySelectorAll('.e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active');
|
|
3704
|
+
if (activePopup.length) {
|
|
3705
|
+
for (let i = 0; i < activePopup.length; i++) {
|
|
3706
|
+
const dropDownBtn = getInstance(activePopup[parseInt(i.toString(), 10)], DropDownButton);
|
|
3707
|
+
dropDownBtn.toggle();
|
|
3708
|
+
}
|
|
3709
|
+
}
|
|
3710
|
+
}
|
|
3600
3711
|
}
|
|
3601
3712
|
renderTabs() {
|
|
3602
3713
|
this.tabsInternal = this.tabs.slice();
|
|
@@ -3663,6 +3774,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3663
3774
|
selectedIndex = selectedIndex === -1 ? this.selectedTab : selectedIndex;
|
|
3664
3775
|
const eventArgs = { previousIndex: this.selectedTab, selectedIndex: selectedIndex };
|
|
3665
3776
|
this.setProperties({ selectedTab: selectedIndex }, true);
|
|
3777
|
+
this.calculateHiddenElementsWidth(selectedIndex);
|
|
3666
3778
|
this.checkOverflow(selectedIndex, e.selectedContent.firstChild);
|
|
3667
3779
|
if (this.activeLayout === 'Simplified' && this.overflowDDB) {
|
|
3668
3780
|
const overflowTarget = this.overflowDDB.target;
|
|
@@ -3786,6 +3898,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3786
3898
|
const orderedGroups = this.getGroupResizeOrder(true, tabIndex);
|
|
3787
3899
|
let isEmptyCollection;
|
|
3788
3900
|
for (let i = 0; ((i < orderedGroups.length) && (tabContent.offsetWidth < activeContent.offsetWidth)); i++) {
|
|
3901
|
+
let isGroupUpdated = false;
|
|
3789
3902
|
const group = orderedGroups[parseInt(i.toString(), 10)];
|
|
3790
3903
|
const groupEle = tabContent.querySelector('#' + group.id);
|
|
3791
3904
|
const groupContainer = groupEle.querySelector('#' + group.id + CONTAINER_ID);
|
|
@@ -3797,7 +3910,67 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3797
3910
|
const itemContainer = collectionEle.querySelector('#' + item.id + CONTAINER_ID);
|
|
3798
3911
|
if (((item.displayOptions === DisplayMode.Auto) ||
|
|
3799
3912
|
(item.displayOptions === (DisplayMode.Simplified | DisplayMode.Overflow))) && !isNullOrUndefined(itemContainer)) {
|
|
3800
|
-
|
|
3913
|
+
let groupHidden = false;
|
|
3914
|
+
let itemHidden = false;
|
|
3915
|
+
let isAllItemHidden = false;
|
|
3916
|
+
let isEmptyCollection = false;
|
|
3917
|
+
let groupItems;
|
|
3918
|
+
if (groupEle.classList.contains('e-hidden') || groupEle.classList.contains('e-hide-group')) {
|
|
3919
|
+
groupItems = groupEle.querySelectorAll('.e-ribbon-item.e-hidden');
|
|
3920
|
+
if (groupItems.length) {
|
|
3921
|
+
for (let i = 0; i < groupItems.length; i++) {
|
|
3922
|
+
groupItems[parseInt(i.toString(), 10)].classList.remove('e-hidden');
|
|
3923
|
+
}
|
|
3924
|
+
}
|
|
3925
|
+
if (groupEle.classList.contains('e-hide-group')) {
|
|
3926
|
+
isAllItemHidden = true;
|
|
3927
|
+
groupEle.classList.remove('e-hide-group');
|
|
3928
|
+
groupEle.classList.remove('e-ribbon-emptyCollection');
|
|
3929
|
+
if (this.hiddenGroups.indexOf(groupEle.id) !== -1) {
|
|
3930
|
+
this.hiddenGroups.splice(this.hiddenGroups.indexOf(groupEle.id), 1);
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
else {
|
|
3934
|
+
groupHidden = true;
|
|
3935
|
+
groupEle.classList.remove('e-hidden');
|
|
3936
|
+
}
|
|
3937
|
+
if (!isGroupUpdated) {
|
|
3938
|
+
this.calculateOverflowItemsWidth(groupEle.offsetWidth, false, tabIndex);
|
|
3939
|
+
this.calculateMediumDataWidth(groupEle.offsetWidth, tabIndex, false);
|
|
3940
|
+
isGroupUpdated = true;
|
|
3941
|
+
}
|
|
3942
|
+
}
|
|
3943
|
+
else {
|
|
3944
|
+
if (itemContainer.classList.contains('e-hidden')) {
|
|
3945
|
+
itemHidden = true;
|
|
3946
|
+
itemContainer.classList.remove('e-hidden');
|
|
3947
|
+
if (groupEle.classList.contains('e-ribbon-emptyCollection')) {
|
|
3948
|
+
isEmptyCollection = true;
|
|
3949
|
+
groupEle.classList.remove('e-ribbon-emptyCollection');
|
|
3950
|
+
}
|
|
3951
|
+
this.calculateOverflowItemsWidth(itemContainer.offsetWidth, false, tabIndex);
|
|
3952
|
+
this.calculateMediumDataWidth(itemContainer.offsetWidth, tabIndex, false);
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
itemContainer.setAttribute('data-simplified-width', (activeContent.offsetWidth).toString());
|
|
3956
|
+
if (itemHidden) {
|
|
3957
|
+
itemContainer.classList.add('e-hidden');
|
|
3958
|
+
}
|
|
3959
|
+
if (groupItems && groupItems.length) {
|
|
3960
|
+
for (let i = 0; i < groupItems.length; i++) {
|
|
3961
|
+
groupItems[parseInt(i.toString(), 10)].classList.add('e-hidden');
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
if (groupHidden) {
|
|
3965
|
+
groupEle.classList.add('e-hidden');
|
|
3966
|
+
}
|
|
3967
|
+
if (isAllItemHidden) {
|
|
3968
|
+
groupEle.classList.add('e-hide-group');
|
|
3969
|
+
groupEle.classList.add('e-ribbon-emptyCollection');
|
|
3970
|
+
}
|
|
3971
|
+
if (isEmptyCollection) {
|
|
3972
|
+
groupEle.classList.add('e-ribbon-emptyCollection');
|
|
3973
|
+
}
|
|
3801
3974
|
this.createOverflowPopup(item, tabIndex, group.enableGroupOverflow, group.id, group.header, itemContainer, groupContainer, true);
|
|
3802
3975
|
if (item.activeSize === RibbonItemSize.Small) {
|
|
3803
3976
|
const itemEle = itemContainer.querySelector('#' + item.id);
|
|
@@ -3889,7 +4062,11 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3889
4062
|
}
|
|
3890
4063
|
if (((item.displayOptions === DisplayMode.Auto) ||
|
|
3891
4064
|
(item.displayOptions === (DisplayMode.Simplified | DisplayMode.Overflow))) && !isNullOrUndefined(itemContainer)) {
|
|
3892
|
-
|
|
4065
|
+
let width = parseInt(itemContainer.getAttribute('data-simplified-width'), 10);
|
|
4066
|
+
const groupItemEle = tabContent.querySelector('#' + group.id);
|
|
4067
|
+
if (itemContainer.classList.contains('e-hidden') || groupItemEle.classList.contains('e-hidden')) {
|
|
4068
|
+
width = Math.abs(width - activeContent.offsetWidth);
|
|
4069
|
+
}
|
|
3893
4070
|
if (!isClear && (tabContent.offsetWidth < width)) {
|
|
3894
4071
|
flag = false;
|
|
3895
4072
|
break;
|
|
@@ -3899,28 +4076,48 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3899
4076
|
this.updatePopupItems(item, itemContainer, group.enableGroupOverflow, false);
|
|
3900
4077
|
}
|
|
3901
4078
|
groupEle.append(itemContainer);
|
|
4079
|
+
if (itemContainer.classList.contains('e-hidden') || groupItemEle.classList.contains('e-hidden')) {
|
|
4080
|
+
itemContainer.setAttribute('data-simplified-width', width.toString());
|
|
4081
|
+
let isGroupHidden = false;
|
|
4082
|
+
let widthDifference = 0;
|
|
4083
|
+
if (itemContainer.classList.contains('e-hidden')) {
|
|
4084
|
+
itemContainer.classList.remove('e-hidden');
|
|
4085
|
+
if (groupItemEle.classList.contains('e-hide-group')) {
|
|
4086
|
+
isGroupHidden = true;
|
|
4087
|
+
widthDifference = this.checkWidthDifference(itemContainer, groupItemEle);
|
|
4088
|
+
}
|
|
4089
|
+
width = itemContainer.offsetWidth + widthDifference;
|
|
4090
|
+
itemContainer.classList.add('e-hidden');
|
|
4091
|
+
}
|
|
4092
|
+
this.calculateOverflowItemsWidth(width, true, tabIndex);
|
|
4093
|
+
this.calculateMediumDataWidth(width, tabIndex, true);
|
|
4094
|
+
if (isGroupHidden) {
|
|
4095
|
+
groupItemEle.classList.add('e-hide-group');
|
|
4096
|
+
groupItemEle.classList.add('e-ribbon-emptyCollection');
|
|
4097
|
+
}
|
|
4098
|
+
}
|
|
3902
4099
|
this.removeOverflowEvent(item, itemContainer);
|
|
3903
4100
|
if (item.allowedSizes & RibbonItemSize.Small) {
|
|
3904
4101
|
item.setProperties({ activeSize: RibbonItemSize.Small }, true);
|
|
3905
4102
|
this.setItemSize(itemContainer.querySelector('#' + item.id), item);
|
|
3906
4103
|
}
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
4104
|
+
const groupElement = tabContent.querySelector('#' + group.id);
|
|
4105
|
+
const itemEle = groupElement.querySelector('.' + RIBBON_ITEM);
|
|
4106
|
+
if (groupElement.classList.contains('e-ribbon-emptyCollection') && itemEle !== null) {
|
|
4107
|
+
let itemsLength = groupElement.querySelectorAll('.' + RIBBON_ITEM);
|
|
4108
|
+
if (itemsLength) {
|
|
4109
|
+
isEmptyCollection = this.checkEmptyCollection(itemsLength);
|
|
4110
|
+
if (!isEmptyCollection) {
|
|
4111
|
+
groupElement.classList.remove('e-ribbon-emptyCollection');
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4114
|
+
}
|
|
3918
4115
|
}
|
|
3919
4116
|
}
|
|
3920
4117
|
}
|
|
3921
4118
|
if (overflowDDB) {
|
|
3922
4119
|
if (group.enableGroupOverflow) {
|
|
3923
|
-
if (overflowtarget.childElementCount === 0) {
|
|
4120
|
+
if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
|
|
3924
4121
|
this.removeOverflowButton(overflowDDB);
|
|
3925
4122
|
}
|
|
3926
4123
|
}
|
|
@@ -3936,7 +4133,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3936
4133
|
}
|
|
3937
4134
|
}
|
|
3938
4135
|
}
|
|
3939
|
-
|
|
4136
|
+
}
|
|
4137
|
+
for (let i = 0; i < orderedGroups.length; i++) {
|
|
4138
|
+
this.checkOverflowHiddenItems(orderedGroups[parseInt(i.toString(), 10)].enableGroupOverflow, tabIndex, orderedGroups[parseInt(i.toString(), 10)].id);
|
|
3940
4139
|
}
|
|
3941
4140
|
if (this.overflowDDB) {
|
|
3942
4141
|
const overflowEle = this.overflowDDB.target;
|
|
@@ -3992,6 +4191,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
3992
4191
|
}
|
|
3993
4192
|
createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
|
|
3994
4193
|
let overflowButton;
|
|
4194
|
+
const itemProp = getGroup(this.tabs, groupId);
|
|
3995
4195
|
const contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
|
|
3996
4196
|
const groupEle = contentEle.querySelector('#' + groupId);
|
|
3997
4197
|
if (isGroupOF) {
|
|
@@ -4005,6 +4205,17 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4005
4205
|
overflowButton = getInstance(overflowDDB, DropDownButton);
|
|
4006
4206
|
}
|
|
4007
4207
|
const overflowBtnTarget = overflowButton.target;
|
|
4208
|
+
let headerEle = overflowBtnTarget.querySelector('#' + groupId + GROUPOF_BUTTON_ID + HEADER_ID);
|
|
4209
|
+
if (!headerEle) {
|
|
4210
|
+
if (itemProp.group.overflowHeader) {
|
|
4211
|
+
const groupHeader = this.createElement('div', {
|
|
4212
|
+
className: RIBBON_OVERFLOW_HEADER,
|
|
4213
|
+
id: groupId + GROUPOF_BUTTON_ID + HEADER_ID,
|
|
4214
|
+
innerHTML: itemProp.group.overflowHeader
|
|
4215
|
+
});
|
|
4216
|
+
overflowBtnTarget.append(groupHeader);
|
|
4217
|
+
}
|
|
4218
|
+
}
|
|
4008
4219
|
if (groupEle) {
|
|
4009
4220
|
if (groupEle.classList.contains('e-disabled')) {
|
|
4010
4221
|
overflowBtnTarget.classList.add('e-disabled');
|
|
@@ -4033,7 +4244,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4033
4244
|
if (ofTabContainer) {
|
|
4034
4245
|
let ofGroupContainer = overflowEle.querySelector('#' + groupId + CONTAINER_ID);
|
|
4035
4246
|
if (!ofGroupContainer) {
|
|
4036
|
-
ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
|
|
4247
|
+
ofGroupContainer = itemProp.group.overflowHeader ? this.createGroupContainer(groupId, itemProp.group.overflowHeader) : this.createGroupContainer(groupId, groupHeader);
|
|
4037
4248
|
if (groupEle) {
|
|
4038
4249
|
if (groupEle.classList.contains('e-disabled')) {
|
|
4039
4250
|
ofGroupContainer.classList.add('e-disabled');
|
|
@@ -4081,7 +4292,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4081
4292
|
break;
|
|
4082
4293
|
case 'GroupButton':
|
|
4083
4294
|
if (this.activeLayout === 'Simplified') {
|
|
4084
|
-
this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle);
|
|
4295
|
+
this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle, overflowButton);
|
|
4085
4296
|
break;
|
|
4086
4297
|
}
|
|
4087
4298
|
}
|
|
@@ -4093,7 +4304,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4093
4304
|
});
|
|
4094
4305
|
const overflowtarget = this.overflowDDB.target;
|
|
4095
4306
|
overflowtarget.append(ofTabContainer);
|
|
4096
|
-
const
|
|
4307
|
+
const itemProp = getGroup(this.tabs, groupId);
|
|
4308
|
+
let ofGroupContainer = itemProp.group.overflowHeader ? this.createGroupContainer(groupId, itemProp.group.overflowHeader) : this.createGroupContainer(groupId, groupHeader);
|
|
4097
4309
|
ofGroupContainer.append(itemEle);
|
|
4098
4310
|
ofTabContainer.append(ofGroupContainer);
|
|
4099
4311
|
if (tabIndex === this.selectedTab) {
|
|
@@ -4925,9 +5137,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4925
5137
|
},
|
|
4926
5138
|
beforeClose: (args) => {
|
|
4927
5139
|
const ele = args.event ? closest(args.event.target, '.' + RIBBON_POPUP_CONTROL) : null;
|
|
5140
|
+
const groupButtonEle = args.event ? closest(args.event.target, '.e-ribbon-group-button-overflow-popup') : null;
|
|
4928
5141
|
const eventArgs = { element: args.element, event: args.event, cancel: args.cancel };
|
|
4929
5142
|
this.trigger('overflowPopupClose', eventArgs, (ribbonArgs) => {
|
|
4930
|
-
if (ele || ribbonArgs.cancel) {
|
|
5143
|
+
if (ele || ribbonArgs.cancel || groupButtonEle) {
|
|
4931
5144
|
args.cancel = true;
|
|
4932
5145
|
}
|
|
4933
5146
|
});
|
|
@@ -4949,8 +5162,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4949
5162
|
const currentList = target.querySelector('.e-ribbon-of-tab.e-ribbon-active');
|
|
4950
5163
|
items = currentList.getElementsByClassName('e-ribbon-item');
|
|
4951
5164
|
}
|
|
4952
|
-
const
|
|
5165
|
+
const control = items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-control');
|
|
5166
|
+
const comboBoxEle = control && control.classList.contains('e-combobox') ? items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-combobox') : null;
|
|
4953
5167
|
let ribbonItem;
|
|
5168
|
+
let templateEle;
|
|
4954
5169
|
if (comboBoxEle === null || (e.key === 'Tab') || this.itemIndex < 0) {
|
|
4955
5170
|
if (e.key === 'ArrowDown' || (!e.shiftKey && e.key === 'Tab')) {
|
|
4956
5171
|
if ((!this.itemIndex && this.itemIndex !== 0) || this.itemIndex < 0 || this.itemIndex === items.length - 1) {
|
|
@@ -4959,13 +5174,21 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4959
5174
|
this.findDisabledItem(ribbonItem, items, true);
|
|
4960
5175
|
if (comboBoxEle && e.key === 'Tab') {
|
|
4961
5176
|
e.preventDefault();
|
|
4962
|
-
items[this.itemIndex].querySelector('.e-control')
|
|
5177
|
+
const item = items[this.itemIndex].querySelector('.e-control');
|
|
5178
|
+
if (item) {
|
|
5179
|
+
item.focus();
|
|
5180
|
+
}
|
|
4963
5181
|
}
|
|
5182
|
+
templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
|
|
4964
5183
|
}
|
|
4965
5184
|
else if (this.itemIndex < items.length - 1 && this.itemIndex >= 0) {
|
|
4966
5185
|
this.itemIndex++;
|
|
4967
5186
|
ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
|
|
4968
5187
|
this.findDisabledItem(ribbonItem, items, true);
|
|
5188
|
+
templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
|
|
5189
|
+
}
|
|
5190
|
+
if (templateEle) {
|
|
5191
|
+
templateEle.focus();
|
|
4969
5192
|
}
|
|
4970
5193
|
}
|
|
4971
5194
|
else if (e.key === 'ArrowUp' || (e.shiftKey && e.key === 'Tab')) {
|
|
@@ -4976,20 +5199,32 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
4976
5199
|
this.findDisabledItem(ribbonItem, items, false);
|
|
4977
5200
|
if (comboBoxEle && (e.shiftKey && e.key === 'Tab')) {
|
|
4978
5201
|
e.preventDefault();
|
|
4979
|
-
items[this.itemIndex].querySelector('.e-control')
|
|
5202
|
+
const item = items[this.itemIndex].querySelector('.e-control');
|
|
5203
|
+
if (item) {
|
|
5204
|
+
item.focus();
|
|
5205
|
+
}
|
|
4980
5206
|
}
|
|
5207
|
+
templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
|
|
4981
5208
|
}
|
|
4982
5209
|
else if (this.itemIndex <= items.length - 1 && this.itemIndex > 0) {
|
|
4983
5210
|
this.itemIndex--;
|
|
4984
5211
|
ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
|
|
4985
5212
|
this.findDisabledItem(ribbonItem, items, false);
|
|
5213
|
+
templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
|
|
5214
|
+
}
|
|
5215
|
+
if (templateEle) {
|
|
5216
|
+
templateEle.focus();
|
|
4986
5217
|
}
|
|
4987
5218
|
}
|
|
4988
5219
|
}
|
|
4989
5220
|
target.setAttribute('index', this.itemIndex.toString());
|
|
4990
5221
|
}
|
|
4991
5222
|
const currentItemIndex = parseInt(target.getAttribute('index'), 10);
|
|
4992
|
-
|
|
5223
|
+
let itemType = "";
|
|
5224
|
+
const controlItem = items[parseInt(currentItemIndex.toString(), 10)] ? items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control') : null;
|
|
5225
|
+
if (controlItem) {
|
|
5226
|
+
itemType = controlItem.getAttribute('data-control');
|
|
5227
|
+
}
|
|
4993
5228
|
if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === ' ' || e.key === 'Tab') {
|
|
4994
5229
|
if (itemType === 'ColorPicker') {
|
|
4995
5230
|
if (e.key === 'Tab') {
|
|
@@ -5001,7 +5236,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5001
5236
|
if (e.key === 'Tab') {
|
|
5002
5237
|
e.preventDefault();
|
|
5003
5238
|
}
|
|
5004
|
-
items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control')
|
|
5239
|
+
const elem = items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control');
|
|
5240
|
+
if (elem) {
|
|
5241
|
+
elem.focus();
|
|
5242
|
+
}
|
|
5005
5243
|
}
|
|
5006
5244
|
if (e.key === ' ' && (itemType === 'CheckBox')) {
|
|
5007
5245
|
const checkBoxEle = items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control');
|
|
@@ -5383,7 +5621,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5383
5621
|
this.setItemSize(ele, item);
|
|
5384
5622
|
}
|
|
5385
5623
|
if (group.enableGroupOverflow && overflowDDB) {
|
|
5386
|
-
if (overflowtarget.childElementCount === 0) {
|
|
5624
|
+
if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
|
|
5387
5625
|
this.removeOverflowButton(overflowDDB);
|
|
5388
5626
|
}
|
|
5389
5627
|
}
|
|
@@ -5666,7 +5904,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
5666
5904
|
createTemplateContent(item, itemElement) {
|
|
5667
5905
|
const itemEle = this.createElement('div', {
|
|
5668
5906
|
className: item.cssClass ? (RIBBON_TEMPLATE + SPACE + item.cssClass) : RIBBON_TEMPLATE,
|
|
5669
|
-
id: item.id
|
|
5907
|
+
id: item.id,
|
|
5908
|
+
attrs: { 'tabindex': '-1' }
|
|
5670
5909
|
});
|
|
5671
5910
|
if (item.disabled) {
|
|
5672
5911
|
itemEle.classList.add(DISABLED_CSS);
|
|
@@ -6127,7 +6366,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6127
6366
|
}
|
|
6128
6367
|
if (this.activeLayout === RibbonLayout.Simplified) {
|
|
6129
6368
|
if (itemProp.group.enableGroupOverflow) {
|
|
6130
|
-
if (dropdown.target.childElementCount === 0) {
|
|
6369
|
+
if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
6131
6370
|
this.removeOverflowButton(dropdown);
|
|
6132
6371
|
}
|
|
6133
6372
|
}
|
|
@@ -6154,6 +6393,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6154
6393
|
this.refreshLayout();
|
|
6155
6394
|
}
|
|
6156
6395
|
}
|
|
6396
|
+
isHeaderVisible(headerEle, groupID) {
|
|
6397
|
+
return headerEle.querySelector('#' + groupID + GROUPOF_BUTTON_ID + HEADER_ID) ? true : false;
|
|
6398
|
+
}
|
|
6157
6399
|
/**
|
|
6158
6400
|
* Hides a specific group within a ribbon tab.
|
|
6159
6401
|
*
|
|
@@ -6182,7 +6424,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6182
6424
|
const contentEle = this.tabObj.items[itemProp.tabIndex].content;
|
|
6183
6425
|
const groupEle = contentEle.querySelector('#' + groupID);
|
|
6184
6426
|
if (groupEle) {
|
|
6185
|
-
isHidden ?
|
|
6427
|
+
this.updateHiddenElements(itemProp.tabIndex, isHidden ? 'hideGroup' : 'showGroup', groupID, isHidden, groupEle);
|
|
6186
6428
|
}
|
|
6187
6429
|
else {
|
|
6188
6430
|
this.updateInitialProps(itemProp.tabIndex, groupID, 'hiddenGroups', isHidden);
|
|
@@ -6207,7 +6449,239 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6207
6449
|
}
|
|
6208
6450
|
}
|
|
6209
6451
|
}
|
|
6210
|
-
this.
|
|
6452
|
+
if (this.selectedTab === itemProp.tabIndex) {
|
|
6453
|
+
this.refreshLayout();
|
|
6454
|
+
}
|
|
6455
|
+
}
|
|
6456
|
+
updateHiddenElements(tabIndex, key, id, isHidden, element, group) {
|
|
6457
|
+
if (isHidden) {
|
|
6458
|
+
if (!(element.classList.contains('e-hidden'))) {
|
|
6459
|
+
this.checkHiddenElements(key, id, tabIndex);
|
|
6460
|
+
element.classList.add('e-hidden');
|
|
6461
|
+
if (key === 'hideItem') {
|
|
6462
|
+
this.checkHiddenItems(group, isHidden, tabIndex);
|
|
6463
|
+
}
|
|
6464
|
+
this.calculateHiddenElementsWidth(tabIndex);
|
|
6465
|
+
}
|
|
6466
|
+
}
|
|
6467
|
+
else {
|
|
6468
|
+
if (element.classList.contains('e-hidden')) {
|
|
6469
|
+
this.checkHiddenElements(key, id, tabIndex);
|
|
6470
|
+
element.classList.remove('e-hidden');
|
|
6471
|
+
this.calculateHiddenElementsWidth(tabIndex);
|
|
6472
|
+
if (key === 'showItem') {
|
|
6473
|
+
this.checkHiddenItems(group, isHidden, tabIndex);
|
|
6474
|
+
}
|
|
6475
|
+
}
|
|
6476
|
+
}
|
|
6477
|
+
}
|
|
6478
|
+
checkHiddenElements(key, id, tabIndex) {
|
|
6479
|
+
if (this.activeLayout === 'Simplified') {
|
|
6480
|
+
let hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
|
|
6481
|
+
if (!hiddenProps) {
|
|
6482
|
+
this.hiddenElements[parseInt(tabIndex.toString(), 10)] = {};
|
|
6483
|
+
hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
|
|
6484
|
+
}
|
|
6485
|
+
if (hiddenProps) {
|
|
6486
|
+
/* eslint-disable */
|
|
6487
|
+
if (!hiddenProps[key]) {
|
|
6488
|
+
hiddenProps[key] = [];
|
|
6489
|
+
}
|
|
6490
|
+
if (hiddenProps[key].length) {
|
|
6491
|
+
let index = hiddenProps[key].indexOf(id);
|
|
6492
|
+
if (index === -1) {
|
|
6493
|
+
hiddenProps[key].push(id);
|
|
6494
|
+
}
|
|
6495
|
+
}
|
|
6496
|
+
else {
|
|
6497
|
+
hiddenProps[key].push(id);
|
|
6498
|
+
}
|
|
6499
|
+
/* eslint-enable */
|
|
6500
|
+
}
|
|
6501
|
+
}
|
|
6502
|
+
}
|
|
6503
|
+
updateItemsSimplifiedWidth(tabIndex, key) {
|
|
6504
|
+
let hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
|
|
6505
|
+
/* eslint-disable */
|
|
6506
|
+
if (hiddenProps && hiddenProps[key] && hiddenProps[key].length) {
|
|
6507
|
+
for (let i = 0; i < hiddenProps[key].length; i++) {
|
|
6508
|
+
const contentEle = this.tabObj.items[tabIndex].content;
|
|
6509
|
+
let hiddenEle;
|
|
6510
|
+
let groupEle;
|
|
6511
|
+
let isGroupHidden = false;
|
|
6512
|
+
let widthDifference = 0;
|
|
6513
|
+
if (key === 'hideGroup' || key === 'showGroup') {
|
|
6514
|
+
hiddenEle = contentEle.querySelector('#' + hiddenProps[key][i]);
|
|
6515
|
+
}
|
|
6516
|
+
else {
|
|
6517
|
+
hiddenEle = contentEle.querySelector('#' + hiddenProps[key][i] + CONTAINER_ID);
|
|
6518
|
+
}
|
|
6519
|
+
if (hiddenEle) {
|
|
6520
|
+
if (key === 'hideGroup' || key === 'hideItem') {
|
|
6521
|
+
let isHidden = false;
|
|
6522
|
+
if (hiddenEle.classList.contains('e-hidden')) {
|
|
6523
|
+
isHidden = true;
|
|
6524
|
+
hiddenEle.classList.remove('e-hidden');
|
|
6525
|
+
}
|
|
6526
|
+
if (key === 'hideItem') {
|
|
6527
|
+
groupEle = hiddenEle.closest('.e-ribbon-group');
|
|
6528
|
+
if (groupEle.classList.contains('e-hide-group')) {
|
|
6529
|
+
isGroupHidden = true;
|
|
6530
|
+
widthDifference = this.checkWidthDifference(hiddenEle, groupEle);
|
|
6531
|
+
}
|
|
6532
|
+
}
|
|
6533
|
+
this.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, true, tabIndex);
|
|
6534
|
+
this.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, true);
|
|
6535
|
+
if (isHidden) {
|
|
6536
|
+
hiddenEle.classList.add('e-hidden');
|
|
6537
|
+
}
|
|
6538
|
+
}
|
|
6539
|
+
else {
|
|
6540
|
+
if (key === 'showItem') {
|
|
6541
|
+
groupEle = hiddenEle.closest('.e-ribbon-group');
|
|
6542
|
+
if (groupEle.classList.contains('e-hide-group')) {
|
|
6543
|
+
isGroupHidden = true;
|
|
6544
|
+
groupEle.classList.remove('e-hide-group');
|
|
6545
|
+
groupEle.classList.remove('e-ribbon-emptyCollection');
|
|
6546
|
+
widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
|
|
6547
|
+
if (this.hiddenGroups.indexOf(groupEle.id) !== -1) {
|
|
6548
|
+
this.hiddenGroups.splice(this.hiddenGroups.indexOf(groupEle.id), 1);
|
|
6549
|
+
}
|
|
6550
|
+
}
|
|
6551
|
+
else {
|
|
6552
|
+
if (this.hiddenGroups.indexOf(groupEle.id) !== -1) {
|
|
6553
|
+
let hiddenItems = groupEle.querySelectorAll('.e-ribbon-item:not(.e-hidden)');
|
|
6554
|
+
hiddenItems.forEach((item) => {
|
|
6555
|
+
if (item.id !== hiddenEle.id) {
|
|
6556
|
+
item.classList.add('e-hidden');
|
|
6557
|
+
}
|
|
6558
|
+
});
|
|
6559
|
+
widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
|
|
6560
|
+
hiddenItems.forEach((item) => {
|
|
6561
|
+
if (item.id !== hiddenEle.id) {
|
|
6562
|
+
item.classList.remove('e-hidden');
|
|
6563
|
+
}
|
|
6564
|
+
});
|
|
6565
|
+
this.hiddenGroups.splice(this.hiddenGroups.indexOf(groupEle.id), 1);
|
|
6566
|
+
}
|
|
6567
|
+
}
|
|
6568
|
+
}
|
|
6569
|
+
this.calculateOverflowItemsWidth(hiddenEle.offsetWidth + widthDifference, false, tabIndex);
|
|
6570
|
+
this.calculateMediumDataWidth(hiddenEle.offsetWidth + widthDifference, tabIndex, false);
|
|
6571
|
+
}
|
|
6572
|
+
if (isGroupHidden) {
|
|
6573
|
+
groupEle.classList.add('e-hide-group');
|
|
6574
|
+
groupEle.classList.add('e-ribbon-emptyCollection');
|
|
6575
|
+
}
|
|
6576
|
+
}
|
|
6577
|
+
let index = hiddenProps[key].indexOf(hiddenProps[key][i]);
|
|
6578
|
+
if (index !== -1) {
|
|
6579
|
+
hiddenProps[key].splice(index, 1);
|
|
6580
|
+
i--;
|
|
6581
|
+
}
|
|
6582
|
+
/* eslint-enable */
|
|
6583
|
+
}
|
|
6584
|
+
}
|
|
6585
|
+
}
|
|
6586
|
+
checkWidthDifference(hiddenEle, groupEle) {
|
|
6587
|
+
let widthDifference = 0;
|
|
6588
|
+
groupEle.classList.remove('e-hide-group');
|
|
6589
|
+
groupEle.classList.remove('e-ribbon-emptyCollection');
|
|
6590
|
+
if (this.hiddenGroups.length) {
|
|
6591
|
+
if (this.hiddenGroups.indexOf(groupEle.id) === -1) {
|
|
6592
|
+
this.hiddenGroups.push(groupEle.id);
|
|
6593
|
+
widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
|
|
6594
|
+
}
|
|
6595
|
+
}
|
|
6596
|
+
else {
|
|
6597
|
+
this.hiddenGroups.push(groupEle.id);
|
|
6598
|
+
widthDifference = Math.abs(hiddenEle.offsetWidth - groupEle.offsetWidth);
|
|
6599
|
+
}
|
|
6600
|
+
return widthDifference;
|
|
6601
|
+
}
|
|
6602
|
+
calculateHiddenElementsWidth(tabIndex) {
|
|
6603
|
+
if (tabIndex === this.selectedTab && this.activeLayout === 'Simplified') {
|
|
6604
|
+
let hiddenProps = this.hiddenElements[parseInt(tabIndex.toString(), 10)];
|
|
6605
|
+
if (hiddenProps) {
|
|
6606
|
+
for (let i = 0; i < Object.keys(hiddenProps).length; i++) {
|
|
6607
|
+
this.updateItemsSimplifiedWidth(tabIndex, Object.keys(hiddenProps)[parseInt(i.toString(), 10)]);
|
|
6608
|
+
}
|
|
6609
|
+
}
|
|
6610
|
+
}
|
|
6611
|
+
}
|
|
6612
|
+
calculateMediumDataWidth(hiddenWidth, tabIndex, isHidden) {
|
|
6613
|
+
if (this.selectedTab === tabIndex && this.activeLayout === 'Simplified') {
|
|
6614
|
+
const activeContent = this.tabObj.element.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + CONTENT_ID);
|
|
6615
|
+
let mediumDataItems = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-item'));
|
|
6616
|
+
if (this.overflowDDB) {
|
|
6617
|
+
const overflowEle = this.overflowDDB.target;
|
|
6618
|
+
let overflowItems = overflowEle.querySelectorAll('.e-ribbon-item');
|
|
6619
|
+
let selectedOFTab = document.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + OVERFLOW_ID);
|
|
6620
|
+
for (let i = 0; i < overflowItems.length; i++) {
|
|
6621
|
+
let ofTab = overflowItems[parseInt(i.toString(), 10)].closest('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + OVERFLOW_ID);
|
|
6622
|
+
if (selectedOFTab && ofTab && selectedOFTab.id === ofTab.id && overflowItems[parseInt(i.toString(), 10)].hasAttribute('data-medium-width')) {
|
|
6623
|
+
mediumDataItems.push(overflowItems[parseInt(i.toString(), 10)]);
|
|
6624
|
+
}
|
|
6625
|
+
}
|
|
6626
|
+
}
|
|
6627
|
+
let groupOFButton = activeContent.querySelectorAll('.e-ribbon-group-of-btn');
|
|
6628
|
+
for (let i = 0; i < groupOFButton.length; i++) {
|
|
6629
|
+
let overflowButton = getInstance(groupOFButton[parseInt(i.toString(), 10)], DropDownButton);
|
|
6630
|
+
const overflowBtnTarget = overflowButton.target;
|
|
6631
|
+
let overflowItems = overflowBtnTarget.querySelectorAll('.e-ribbon-item');
|
|
6632
|
+
for (let i = 0; i < overflowItems.length; i++) {
|
|
6633
|
+
if (overflowItems[parseInt(i.toString(), 10)].hasAttribute('data-medium-width')) {
|
|
6634
|
+
mediumDataItems.push(overflowItems[parseInt(i.toString(), 10)]);
|
|
6635
|
+
}
|
|
6636
|
+
}
|
|
6637
|
+
}
|
|
6638
|
+
for (let i = 0; i < mediumDataItems.length; i++) {
|
|
6639
|
+
if (mediumDataItems[parseInt(i.toString(), 10)].hasAttribute('data-medium-width')) {
|
|
6640
|
+
let previousWidth = parseInt(mediumDataItems[parseInt(i.toString(), 10)].getAttribute('data-medium-width'), 10);
|
|
6641
|
+
mediumDataItems[parseInt(i.toString(), 10)].setAttribute('data-medium-width', isHidden ? (previousWidth - hiddenWidth).toString() : (previousWidth + hiddenWidth).toString());
|
|
6642
|
+
}
|
|
6643
|
+
}
|
|
6644
|
+
}
|
|
6645
|
+
}
|
|
6646
|
+
calculateOverflowItemsWidth(hiddenItem, isHidden, tabIndex) {
|
|
6647
|
+
if (this.selectedTab === tabIndex && this.activeLayout === 'Simplified') {
|
|
6648
|
+
const groupList = this.tabs[parseInt(tabIndex.toString(), 10)].groups;
|
|
6649
|
+
for (let i = 0; i < groupList.length; i++) {
|
|
6650
|
+
const group = groupList[parseInt(i.toString(), 10)];
|
|
6651
|
+
if (group.enableGroupOverflow) {
|
|
6652
|
+
let groupContainer = document.querySelector('#' + group.id);
|
|
6653
|
+
let overflowButton;
|
|
6654
|
+
const overflowDDB = groupContainer.querySelector('#' + group.id + GROUPOF_BUTTON_ID);
|
|
6655
|
+
if (overflowDDB) {
|
|
6656
|
+
overflowButton = getInstance(overflowDDB, DropDownButton);
|
|
6657
|
+
}
|
|
6658
|
+
if (overflowButton) {
|
|
6659
|
+
const overflowEle = overflowButton.target;
|
|
6660
|
+
let overflowItems = overflowEle.querySelectorAll('.e-ribbon-item');
|
|
6661
|
+
for (let i = 0; i < overflowItems.length; i++) {
|
|
6662
|
+
let previousWidth = parseInt(overflowItems[parseInt(i.toString(), 10)].getAttribute('data-simplified-width'), 10);
|
|
6663
|
+
if (previousWidth) {
|
|
6664
|
+
overflowItems[parseInt(i.toString(), 10)].setAttribute('data-simplified-width', isHidden ? (previousWidth - hiddenItem).toString() : (previousWidth + hiddenItem).toString());
|
|
6665
|
+
}
|
|
6666
|
+
}
|
|
6667
|
+
}
|
|
6668
|
+
}
|
|
6669
|
+
}
|
|
6670
|
+
}
|
|
6671
|
+
if (this.overflowDDB) {
|
|
6672
|
+
let selectedOFTab = document.querySelector('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + OVERFLOW_ID);
|
|
6673
|
+
const overflowEle = this.overflowDDB.target;
|
|
6674
|
+
let overflowItems = overflowEle.querySelectorAll('.e-ribbon-item');
|
|
6675
|
+
for (let i = 0; i < overflowItems.length; i++) {
|
|
6676
|
+
let ofTab = overflowItems[parseInt(i.toString(), 10)].closest('#' + this.tabs[parseInt(tabIndex.toString(), 10)].id + OVERFLOW_ID);
|
|
6677
|
+
if (selectedOFTab && ofTab && selectedOFTab.id === ofTab.id) {
|
|
6678
|
+
let previousWidth = parseInt(overflowItems[parseInt(i.toString(), 10)].getAttribute('data-simplified-width'), 10);
|
|
6679
|
+
if (previousWidth) {
|
|
6680
|
+
overflowItems[parseInt(i.toString(), 10)].setAttribute('data-simplified-width', isHidden ? (previousWidth - hiddenItem).toString() : (previousWidth + hiddenItem).toString());
|
|
6681
|
+
}
|
|
6682
|
+
}
|
|
6683
|
+
}
|
|
6684
|
+
}
|
|
6211
6685
|
}
|
|
6212
6686
|
/**
|
|
6213
6687
|
* Disables a specific group within a ribbon tab.
|
|
@@ -6467,9 +6941,10 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6467
6941
|
}
|
|
6468
6942
|
if (ele) {
|
|
6469
6943
|
const itemEle = closest(ele, '.e-ribbon-item');
|
|
6470
|
-
isHidden ?
|
|
6471
|
-
this.
|
|
6472
|
-
|
|
6944
|
+
this.updateHiddenElements(itemProp.tabIndex, isHidden ? 'hideItem' : 'showItem', itemId, isHidden, itemEle, itemProp.group);
|
|
6945
|
+
if (this.selectedTab === itemProp.tabIndex) {
|
|
6946
|
+
this.refreshLayout();
|
|
6947
|
+
}
|
|
6473
6948
|
}
|
|
6474
6949
|
else {
|
|
6475
6950
|
this.updateInitialProps(itemProp.tabIndex, itemId, 'hiddenItems', isHidden);
|
|
@@ -6707,7 +7182,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6707
7182
|
}
|
|
6708
7183
|
if (this.activeLayout === RibbonLayout.Simplified) {
|
|
6709
7184
|
if (itemProp.group.enableGroupOverflow) {
|
|
6710
|
-
if (dropdown.target.childElementCount === 0) {
|
|
7185
|
+
if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
6711
7186
|
this.removeOverflowButton(dropdown);
|
|
6712
7187
|
}
|
|
6713
7188
|
}
|
|
@@ -6925,7 +7400,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
6925
7400
|
}
|
|
6926
7401
|
this.createRibbonItem(ribbonItem, itemContainer);
|
|
6927
7402
|
if (this.activeLayout === 'Simplified' && itemProp.group.enableGroupOverflow) {
|
|
6928
|
-
if (dropdown.target.childElementCount === 0) {
|
|
7403
|
+
if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
6929
7404
|
this.removeOverflowButton(dropdown);
|
|
6930
7405
|
}
|
|
6931
7406
|
}
|
|
@@ -7030,6 +7505,9 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7030
7505
|
this.keyboardModuleRibbon.destroy();
|
|
7031
7506
|
this.keyboardModuleRibbon = null;
|
|
7032
7507
|
destroyTooltip(this.element);
|
|
7508
|
+
if (this.refreshing) {
|
|
7509
|
+
this.clearOverflowDropDown(this.selectedTab);
|
|
7510
|
+
}
|
|
7033
7511
|
this.destroyTabItems(this.tabs);
|
|
7034
7512
|
if (!this.hideLayoutSwitcher) {
|
|
7035
7513
|
this.removeExpandCollapse();
|
|
@@ -7037,6 +7515,7 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7037
7515
|
this.collapseButton = undefined;
|
|
7038
7516
|
if (this.scrollModule) {
|
|
7039
7517
|
this.scrollModule.destroy();
|
|
7518
|
+
this.scrollModule = null;
|
|
7040
7519
|
}
|
|
7041
7520
|
if (this.ribbonTempEle) {
|
|
7042
7521
|
remove(this.ribbonTempEle);
|
|
@@ -7046,6 +7525,8 @@ let Ribbon = Ribbon_1 = class Ribbon extends Component {
|
|
|
7046
7525
|
this.tabObj.destroy();
|
|
7047
7526
|
this.tabObj = undefined;
|
|
7048
7527
|
this.initialPropsData = {};
|
|
7528
|
+
this.hiddenGroups = [];
|
|
7529
|
+
this.hiddenElements = {};
|
|
7049
7530
|
remove(this.element.querySelector('#' + this.element.id + TAB_ID));
|
|
7050
7531
|
this.element.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
|
|
7051
7532
|
this.element.style.removeProperty(RIBBON_HELP_PANE_TEMPLATE_WIDTH);
|
|
@@ -7909,6 +8390,9 @@ class RibbonBackstage extends Component {
|
|
|
7909
8390
|
this.closeBtn.setProperties(commonProp);
|
|
7910
8391
|
}
|
|
7911
8392
|
}
|
|
8393
|
+
if (this.footerMenuCtrl) {
|
|
8394
|
+
this.footerMenuCtrl.setProperties(commonProp);
|
|
8395
|
+
}
|
|
7912
8396
|
}
|
|
7913
8397
|
}
|
|
7914
8398
|
}
|