@syncfusion/ej2-ribbon 23.1.43 → 23.2.4
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 +12 -0
- 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 +160 -70
- package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
- package/dist/es6/ej2-ribbon.es5.js +160 -70
- 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 +12 -12
- package/src/ribbon/base/ribbon.d.ts +3 -0
- package/src/ribbon/base/ribbon.js +160 -70
|
@@ -3656,6 +3656,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
3656
3656
|
Ribbon.prototype.preRender = function () {
|
|
3657
3657
|
this.idIndex = 0;
|
|
3658
3658
|
this.tooltipData = [];
|
|
3659
|
+
this.initialPropsData = {};
|
|
3659
3660
|
this.isAddRemove = false;
|
|
3660
3661
|
this.keyConfigs = {
|
|
3661
3662
|
leftarrow: 'leftarrow',
|
|
@@ -4171,21 +4172,23 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4171
4172
|
// The position is reversed if RTL is enabled.
|
|
4172
4173
|
// isRight = ((isGroupOF && isMenu) && !this.enableRtl ) || (!(isGroupOF && isMenu) && this.enableRtl) ==> (isGroupOF && isMenu) !== this.enableRtl
|
|
4173
4174
|
var isLeft = (isGroupOF && isMenu) === this.enableRtl;
|
|
4174
|
-
dropDownPopup
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
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
|
+
}
|
|
4189
4192
|
}
|
|
4190
4193
|
};
|
|
4191
4194
|
Ribbon.prototype.removeSimplfiedOverflow = function (tabContent, activeContent, tabIndex, isClear) {
|
|
@@ -4271,7 +4274,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4271
4274
|
Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
|
|
4272
4275
|
var overflowButton;
|
|
4273
4276
|
var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
|
|
4274
|
-
var
|
|
4277
|
+
var groupEle = contentEle.querySelector('#' + groupId);
|
|
4275
4278
|
if (isGroupOF) {
|
|
4276
4279
|
var overflowDDB = groupContainer.querySelector('#' + groupId + GROUPOF_BUTTON_ID);
|
|
4277
4280
|
if (!overflowDDB) {
|
|
@@ -4283,9 +4286,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4283
4286
|
overflowButton = getInstance(overflowDDB, DropDownButton);
|
|
4284
4287
|
}
|
|
4285
4288
|
var overflowBtnTarget = overflowButton.target;
|
|
4286
|
-
if (
|
|
4289
|
+
if (groupEle && groupEle.classList.contains('e-disabled')) {
|
|
4287
4290
|
overflowBtnTarget.classList.add('e-disabled');
|
|
4288
4291
|
}
|
|
4292
|
+
if (groupEle && groupEle.classList.contains('e-hidden')) {
|
|
4293
|
+
overflowBtnTarget.classList.add('e-hidden');
|
|
4294
|
+
}
|
|
4289
4295
|
isResize ? overflowBtnTarget.insertBefore(itemEle, overflowBtnTarget.querySelector('.' + RIBBON_ITEM))
|
|
4290
4296
|
: overflowBtnTarget.append(itemEle);
|
|
4291
4297
|
}
|
|
@@ -4304,7 +4310,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4304
4310
|
var ofGroupContainer = overflowEle.querySelector('#' + groupId + CONTAINER_ID);
|
|
4305
4311
|
if (!ofGroupContainer) {
|
|
4306
4312
|
ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
|
|
4307
|
-
if (
|
|
4313
|
+
if (groupEle && groupEle.classList.contains('e-disabled')) {
|
|
4308
4314
|
ofGroupContainer.classList.add('e-disabled');
|
|
4309
4315
|
}
|
|
4310
4316
|
ofTabContainer.append(ofGroupContainer);
|
|
@@ -4361,6 +4367,15 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4361
4367
|
if (tabIndex === this.selectedTab) {
|
|
4362
4368
|
ofTabContainer.classList.add(RIBBON_TAB_ACTIVE);
|
|
4363
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
|
+
}
|
|
4364
4379
|
};
|
|
4365
4380
|
Ribbon.prototype.checkGroupShrinking = function (tabIndex, tabContent, activeContent, isLarge) {
|
|
4366
4381
|
var isOverFlow = true;
|
|
@@ -4957,30 +4972,32 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
4957
4972
|
(isRemoveOverflow ? (itemContainer.classList.add(RIBBON_CONTENT_HEIGHT)) : (itemContainer.classList.remove(RIBBON_CONTENT_HEIGHT)));
|
|
4958
4973
|
};
|
|
4959
4974
|
Ribbon.prototype.setItemSize = function (itemEle, item) {
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
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
|
+
}
|
|
4984
5001
|
}
|
|
4985
5002
|
};
|
|
4986
5003
|
Ribbon.prototype.createOverflowDropdown = function (tabIndex, tabContent, activeContent) {
|
|
@@ -5312,28 +5329,30 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5312
5329
|
}
|
|
5313
5330
|
};
|
|
5314
5331
|
Ribbon.prototype.removeOverflowEvent = function (item, itemEle) {
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
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
|
+
}
|
|
5337
5356
|
}
|
|
5338
5357
|
};
|
|
5339
5358
|
Ribbon.prototype.createGroupContainer = function (groupId, groupHeader) {
|
|
@@ -5538,8 +5557,10 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5538
5557
|
this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
|
|
5539
5558
|
}
|
|
5540
5559
|
item.setProperties({ activeSize: size }, true);
|
|
5541
|
-
|
|
5542
|
-
|
|
5560
|
+
if (itemEle) {
|
|
5561
|
+
var ele = itemEle.querySelector('#' + item.id);
|
|
5562
|
+
this.setItemSize(ele, item);
|
|
5563
|
+
}
|
|
5543
5564
|
}
|
|
5544
5565
|
}
|
|
5545
5566
|
}
|
|
@@ -5622,7 +5643,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5622
5643
|
}
|
|
5623
5644
|
else {
|
|
5624
5645
|
var itemEle = groupContainer.querySelector('#' + item.id + CONTAINER_ID);
|
|
5625
|
-
if (!itemEle) {
|
|
5646
|
+
if (!itemEle && overflowtarget) {
|
|
5626
5647
|
itemEle = overflowtarget.querySelector('#' + item.id + CONTAINER_ID);
|
|
5627
5648
|
if ((item.type === RibbonItemType.DropDown) || (item.type === RibbonItemType.SplitButton) || (item.type === RibbonItemType.GroupButton)) {
|
|
5628
5649
|
this.updatePopupItems(item, itemEle, group.enableGroupOverflow, false);
|
|
@@ -5632,7 +5653,9 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5632
5653
|
if (item.type === RibbonItemType.GroupButton) {
|
|
5633
5654
|
this.ribbonGroupButtonModule.switchGroupButton(item, itemEle);
|
|
5634
5655
|
}
|
|
5635
|
-
|
|
5656
|
+
if (itemEle) {
|
|
5657
|
+
groupCollection.append(itemEle);
|
|
5658
|
+
}
|
|
5636
5659
|
}
|
|
5637
5660
|
var ele = groupContainer.querySelector('#' + item.id);
|
|
5638
5661
|
if (item.type === RibbonItemType.GroupButton) {
|
|
@@ -5720,9 +5743,28 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5720
5743
|
if ((this.activeLayout === 'Simplified') && !(group.enableGroupOverflow || groupEle.querySelector('.' + RIBBON_ITEM))) {
|
|
5721
5744
|
groupEle.classList.add('e-ribbon-emptyCollection');
|
|
5722
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)];
|
|
5723
5758
|
}
|
|
5724
5759
|
return groupElements;
|
|
5725
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
|
+
};
|
|
5726
5768
|
Ribbon.prototype.validateItemSize = function () {
|
|
5727
5769
|
for (var k = 0; k < this.tabs.length; k++) {
|
|
5728
5770
|
var groupList = this.tabs[parseInt(k.toString(), 10)].groups;
|
|
@@ -5852,6 +5894,13 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
5852
5894
|
else {
|
|
5853
5895
|
itemEle.classList.add((size & RibbonItemSize.Medium) ? RIBBON_MEDIUM_ITEM : RIBBON_SMALL_ITEM);
|
|
5854
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
|
+
}
|
|
5855
5904
|
this.createRibbonItem(item, itemEle);
|
|
5856
5905
|
if ((this.activeLayout === 'Simplified') && ((item.displayOptions === DisplayMode.Overflow) || (item.displayOptions === (DisplayMode.Classic | DisplayMode.Overflow)))) {
|
|
5857
5906
|
this.createOverflowPopup(item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer);
|
|
@@ -6419,7 +6468,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6419
6468
|
}
|
|
6420
6469
|
var contentEle = this.tabObj.items[itemProp.tabIndex].content;
|
|
6421
6470
|
var groupEle = contentEle.querySelector('#' + groupID);
|
|
6422
|
-
|
|
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
|
+
}
|
|
6423
6477
|
if (this.overflowDDB) {
|
|
6424
6478
|
var overflowEle = this.overflowDDB.target;
|
|
6425
6479
|
var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + OVERFLOW_ID);
|
|
@@ -6469,7 +6523,12 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6469
6523
|
}
|
|
6470
6524
|
var contentEle = this.tabObj.items[itemProp.tabIndex].content;
|
|
6471
6525
|
var groupEle = contentEle.querySelector('#' + groupID);
|
|
6472
|
-
|
|
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
|
+
}
|
|
6473
6532
|
if (this.overflowDDB) {
|
|
6474
6533
|
var overflowEle = this.overflowDDB.target;
|
|
6475
6534
|
var ofTabContainer = overflowEle.querySelector('#' + this.tabs[parseInt(itemProp.tabIndex.toString(), 10)].id + OVERFLOW_ID);
|
|
@@ -6697,6 +6756,36 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
6697
6756
|
if (ele) {
|
|
6698
6757
|
var itemEle = closest(ele, '.e-ribbon-item');
|
|
6699
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
|
+
}
|
|
6700
6789
|
}
|
|
6701
6790
|
};
|
|
6702
6791
|
/**
|
|
@@ -7179,6 +7268,7 @@ var Ribbon = /** @__PURE__ @class */ (function (_super) {
|
|
|
7179
7268
|
_super.prototype.destroy.call(this);
|
|
7180
7269
|
this.tabObj.destroy();
|
|
7181
7270
|
this.tabObj = undefined;
|
|
7271
|
+
this.initialPropsData = {};
|
|
7182
7272
|
remove(this.element.querySelector('#' + this.element.id + TAB_ID));
|
|
7183
7273
|
this.element.style.removeProperty(RIBBON_FILE_MENU_WIDTH);
|
|
7184
7274
|
this.element.style.removeProperty(RIBBON_HELP_PANE_TEMPLATE_WIDTH);
|