@syncfusion/ej2-ribbon 23.2.5 → 24.1.41
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 +0 -34
- 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 +198 -32
- package/dist/es6/ej2-ribbon.es2015.js.map +1 -1
- package/dist/es6/ej2-ribbon.es5.js +198 -32
- 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/interface.d.ts +17 -0
- package/src/ribbon/base/ribbon-model.d.ts +15 -1
- package/src/ribbon/base/ribbon.d.ts +14 -1
- package/src/ribbon/base/ribbon.js +95 -21
- 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 +3 -1
- package/src/ribbon/items/ribbon-groupbutton.js +50 -7
- 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
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 24.1.41
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-ribbon@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-ribbon@
|
|
3
|
+
"_id": "@syncfusion/ej2-ribbon@21.27.0",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-Yp291W26tAmLS4Vev1bAKc12r3ExMoy1eV3QNuoxM4mysAxjyUBRN0MjP4w8xpLrGgBZqosG3G7Ewc/IphDVww==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-ribbon",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-ribbon",
|
|
24
24
|
"/@syncfusion/ej2-vue-ribbon"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-ribbon/-/ej2-ribbon-21.27.0.tgz",
|
|
27
|
+
"_shasum": "93461696848f6b7ca64be65ee903922584f6b52c",
|
|
28
28
|
"_spec": "@syncfusion/ej2-ribbon@*",
|
|
29
|
-
"_where": "/jenkins/workspace/elease-
|
|
29
|
+
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
31
31
|
"name": "Syncfusion Inc."
|
|
32
32
|
},
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@syncfusion/ej2-base": "~
|
|
39
|
-
"@syncfusion/ej2-buttons": "~
|
|
40
|
-
"@syncfusion/ej2-dropdowns": "~
|
|
41
|
-
"@syncfusion/ej2-lists": "~
|
|
42
|
-
"@syncfusion/ej2-navigations": "~
|
|
43
|
-
"@syncfusion/ej2-popups": "~
|
|
44
|
-
"@syncfusion/ej2-splitbuttons": "~
|
|
38
|
+
"@syncfusion/ej2-base": "~24.1.41",
|
|
39
|
+
"@syncfusion/ej2-buttons": "~24.1.41",
|
|
40
|
+
"@syncfusion/ej2-dropdowns": "~24.1.41",
|
|
41
|
+
"@syncfusion/ej2-lists": "~24.1.41",
|
|
42
|
+
"@syncfusion/ej2-navigations": "~24.1.41",
|
|
43
|
+
"@syncfusion/ej2-popups": "~24.1.41",
|
|
44
|
+
"@syncfusion/ej2-splitbuttons": "~24.1.41"
|
|
45
45
|
},
|
|
46
46
|
"deprecated": false,
|
|
47
47
|
"description": "Essential JS 2 Component",
|
|
@@ -62,6 +62,6 @@
|
|
|
62
62
|
"url": "git+https://github.com/syncfusion/ej2-ribbon-component.git"
|
|
63
63
|
},
|
|
64
64
|
"typings": "index.d.ts",
|
|
65
|
-
"version": "
|
|
65
|
+
"version": "24.1.41",
|
|
66
66
|
"sideEffects": false
|
|
67
67
|
}
|
|
@@ -200,6 +200,23 @@ export interface ClickGroupButtonEventArgs extends BaseEventArgs {
|
|
|
200
200
|
*/
|
|
201
201
|
selectedItems: RibbonGroupButtonItemModel[];
|
|
202
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Triggers before open / close of overflow popup menu.
|
|
205
|
+
*/
|
|
206
|
+
export interface OverflowPopupEventArgs extends BaseEventArgs {
|
|
207
|
+
/**
|
|
208
|
+
* Provides the HTML element of the overflow popup.
|
|
209
|
+
*/
|
|
210
|
+
element: HTMLElement;
|
|
211
|
+
/**
|
|
212
|
+
* Defines the original event arguments.
|
|
213
|
+
*/
|
|
214
|
+
event: Event;
|
|
215
|
+
/**
|
|
216
|
+
* Defines whether to cancel the overflow popup open or close.
|
|
217
|
+
*/
|
|
218
|
+
cancel?: boolean;
|
|
219
|
+
}
|
|
203
220
|
/** @hidden */
|
|
204
221
|
export interface itemProps {
|
|
205
222
|
item?: RibbonItemModel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addClass, append, Event, Collection, Complex, Component, EmitType, EventHandler, formatUnit, getInstance, getComponent, getUniqueID, closest, KeyboardEventArgs, KeyboardEvents } from '@syncfusion/ej2-base';import { INotifyPropertyChanged, isNullOrUndefined, isUndefined, ModuleDeclaration, NotifyPropertyChanges, Property, remove, removeClass } from '@syncfusion/ej2-base';import { Tab, TabAnimationSettings, TabAnimationSettingsModel, TabItemModel, SelectEventArgs, SelectingEventArgs, HScroll, Toolbar } from '@syncfusion/ej2-navigations';import { RibbonTab, RibbonTabModel, RibbonGroupModel, RibbonCollectionModel, RibbonItemModel, FileMenuSettings, FileMenuSettingsModel, BackStageMenu, BackStageMenuModel, RibbonItem, RibbonCollection, RibbonGroup } from '../models/index';import { commonProperties, DisplayMode, ExpandCollapseEventArgs, itemProps, LauncherClickEventArgs, ribbonItemPropsList, RibbonLayout, ribbonTooltipData, TabSelectedEventArgs, TabSelectingEventArgs } from './interface';import { ItemOrientation, RibbonItemSize, RibbonItemType } from './interface';import { RibbonButton, RibbonComboBox, RibbonCheckBox, RibbonDropDown, RibbonColorPicker, RibbonSplitButton, RibbonGroupButton } from '../items/index';import { destroyControl, getCollection, getGroup, getIndex, getItem, getItemElement, updateCommonProperty, updateControlDisabled, isTooltipPresent, getTemplateFunction, createTooltip, destroyTooltip, updateTooltipProp } from './utils';import * as constants from './constant';import { RibbonFileMenu, RibbonBackstage } from '../modules/index';import { RibbonTooltipModel } from '../models/ribbon-tooltip-model';import { Popup } from '@syncfusion/ej2-popups';import { BeforeOpenCloseMenuEventArgs, DropDownButton, SplitButton } from '@syncfusion/ej2-splitbuttons';import { CheckBox } from '@syncfusion/ej2-buttons';
|
|
1
|
+
import { addClass, append, Event, Collection, Complex, Component, EmitType, EventHandler, formatUnit, getInstance, getComponent, getUniqueID, closest, KeyboardEventArgs, KeyboardEvents } from '@syncfusion/ej2-base';import { INotifyPropertyChanged, isNullOrUndefined, isUndefined, ModuleDeclaration, NotifyPropertyChanges, Property, remove, removeClass } from '@syncfusion/ej2-base';import { Tab, TabAnimationSettings, TabAnimationSettingsModel, TabItemModel, SelectEventArgs, SelectingEventArgs, HScroll, Toolbar } from '@syncfusion/ej2-navigations';import { RibbonTab, RibbonTabModel, RibbonGroupModel, RibbonCollectionModel, RibbonItemModel, FileMenuSettings, FileMenuSettingsModel, BackStageMenu, BackStageMenuModel, RibbonItem, RibbonCollection, RibbonGroup } from '../models/index';import { commonProperties, DisplayMode, ExpandCollapseEventArgs, itemProps, LauncherClickEventArgs, OverflowPopupEventArgs, ribbonItemPropsList, RibbonLayout, ribbonTooltipData, TabSelectedEventArgs, TabSelectingEventArgs } from './interface';import { ItemOrientation, RibbonItemSize, RibbonItemType } from './interface';import { RibbonButton, RibbonComboBox, RibbonCheckBox, RibbonDropDown, RibbonColorPicker, RibbonSplitButton, RibbonGroupButton } from '../items/index';import { destroyControl, getCollection, getGroup, getIndex, getItem, getItemElement, updateCommonProperty, updateControlDisabled, isTooltipPresent, getTemplateFunction, createTooltip, destroyTooltip, updateTooltipProp } from './utils';import * as constants from './constant';import { RibbonFileMenu, RibbonBackstage } from '../modules/index';import { RibbonTooltipModel } from '../models/ribbon-tooltip-model';import { Popup } from '@syncfusion/ej2-popups';import { BeforeOpenCloseMenuEventArgs, DropDownButton, SplitButton } from '@syncfusion/ej2-splitbuttons';import { CheckBox } from '@syncfusion/ej2-buttons';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -150,4 +150,18 @@ export interface RibbonModel extends ComponentModel{
|
|
|
150
150
|
*/
|
|
151
151
|
created?: EmitType<Event>;
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Event triggers when the overflow popup opens.
|
|
155
|
+
*
|
|
156
|
+
* @event overflowPopupOpen
|
|
157
|
+
*/
|
|
158
|
+
overflowPopupOpen?: EmitType<OverflowPopupEventArgs>;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Event triggers when the overflow popup closes.
|
|
162
|
+
*
|
|
163
|
+
* @event overflowPopupClose
|
|
164
|
+
*/
|
|
165
|
+
overflowPopupClose?: EmitType<OverflowPopupEventArgs>;
|
|
166
|
+
|
|
153
167
|
}
|
|
@@ -3,7 +3,7 @@ import { INotifyPropertyChanged, ModuleDeclaration } from '@syncfusion/ej2-base'
|
|
|
3
3
|
import { Tab, TabAnimationSettingsModel } from '@syncfusion/ej2-navigations';
|
|
4
4
|
import { RibbonTabModel, RibbonGroupModel, RibbonCollectionModel, RibbonItemModel, FileMenuSettingsModel, BackStageMenuModel } from '../models/index';
|
|
5
5
|
import { RibbonModel } from './ribbon-model';
|
|
6
|
-
import { ExpandCollapseEventArgs, LauncherClickEventArgs, RibbonLayout, ribbonTooltipData, TabSelectedEventArgs, TabSelectingEventArgs } from './interface';
|
|
6
|
+
import { ExpandCollapseEventArgs, LauncherClickEventArgs, OverflowPopupEventArgs, RibbonLayout, ribbonTooltipData, TabSelectedEventArgs, TabSelectingEventArgs } from './interface';
|
|
7
7
|
import { RibbonButton, RibbonComboBox, RibbonCheckBox, RibbonDropDown, RibbonColorPicker, RibbonSplitButton, RibbonGroupButton } from '../items/index';
|
|
8
8
|
import { RibbonFileMenu, RibbonBackstage } from '../modules/index';
|
|
9
9
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
@@ -136,6 +136,18 @@ export declare class Ribbon extends Component<HTMLElement> implements INotifyPro
|
|
|
136
136
|
* @event created
|
|
137
137
|
*/
|
|
138
138
|
created: EmitType<Event>;
|
|
139
|
+
/**
|
|
140
|
+
* Event triggers when the overflow popup opens.
|
|
141
|
+
*
|
|
142
|
+
* @event overflowPopupOpen
|
|
143
|
+
*/
|
|
144
|
+
overflowPopupOpen: EmitType<OverflowPopupEventArgs>;
|
|
145
|
+
/**
|
|
146
|
+
* Event triggers when the overflow popup closes.
|
|
147
|
+
*
|
|
148
|
+
* @event overflowPopupClose
|
|
149
|
+
*/
|
|
150
|
+
overflowPopupClose: EmitType<OverflowPopupEventArgs>;
|
|
139
151
|
/**
|
|
140
152
|
* The `ribbonButtonModule` is used to create and manipulate buttons in ribbon item.
|
|
141
153
|
*/
|
|
@@ -371,6 +383,7 @@ export declare class Ribbon extends Component<HTMLElement> implements INotifyPro
|
|
|
371
383
|
* @returns {void}
|
|
372
384
|
*/
|
|
373
385
|
removeGroup(groupId: string): void;
|
|
386
|
+
private isHeaderVisible;
|
|
374
387
|
/**
|
|
375
388
|
* Hides a specific group within a ribbon tab.
|
|
376
389
|
*
|
|
@@ -132,7 +132,9 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
132
132
|
e.preventDefault();
|
|
133
133
|
}
|
|
134
134
|
var activeContent = this.tabObj.element.querySelector('#' + this.tabs[this.selectedTab].id + constants.CONTENT_ID);
|
|
135
|
-
var
|
|
135
|
+
var controlElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-control'));
|
|
136
|
+
var templateElements = Array.prototype.slice.call(activeContent.querySelectorAll('.e-ribbon-template'));
|
|
137
|
+
var ribbonControls = controlElements.concat(templateElements);
|
|
136
138
|
var comboBoxElements = activeContent.querySelectorAll('.e-combobox');
|
|
137
139
|
var comboBoxEle;
|
|
138
140
|
if (comboBoxElements) {
|
|
@@ -161,7 +163,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
161
163
|
if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
|
|
162
164
|
e.target.classList.contains('e-ribbon-collapse-btn') || e.target.classList.contains('e-ribbon-last-item') ||
|
|
163
165
|
e.target.classList.contains('e-ribbon-first-item') || e.target.classList.contains('e-ribbon-group-of-btn') ||
|
|
164
|
-
e.target.classList.contains('e-ribbon-overall-of-btn')) {
|
|
166
|
+
e.target.classList.contains('e-ribbon-overall-of-btn') || e.target.classList.contains('e-ribbon-template')) {
|
|
165
167
|
switch (e.action) {
|
|
166
168
|
case 'rightarrow':
|
|
167
169
|
this.handleNavigation(e, !this.enableRtl, ribbonControls);
|
|
@@ -203,7 +205,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
if ((!enableRtl && (this.currentControlIndex > 0)) || (enableRtl && (this.currentControlIndex < ribbonControls.length - 1))) {
|
|
206
|
-
if (!e.target.classList.contains('e-combobox') && e.target.classList.contains('e-control') && !e.target.classList.contains('e-ribbon-last-item')) {
|
|
208
|
+
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')) {
|
|
207
209
|
if (enableRtl) {
|
|
208
210
|
this.currentControlIndex++;
|
|
209
211
|
}
|
|
@@ -237,7 +239,10 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
237
239
|
}
|
|
238
240
|
if (launcherIconEle) {
|
|
239
241
|
var items = groupContainer.querySelectorAll('.e-ribbon-item');
|
|
240
|
-
items[items.length - 1].querySelector('.e-control')
|
|
242
|
+
var elem = items[items.length - 1].querySelector('.e-control');
|
|
243
|
+
if (elem) {
|
|
244
|
+
elem.classList.add('e-ribbon-last-item');
|
|
245
|
+
}
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
248
|
else {
|
|
@@ -350,6 +355,15 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
350
355
|
var scrollEle = this.tabObj.element.querySelector('.' + constants.HORIZONTAL_SCROLLBAR);
|
|
351
356
|
this.scrollModule.scrollStep = scrollEle.offsetWidth;
|
|
352
357
|
}
|
|
358
|
+
if (this.activeLayout === 'Simplified') {
|
|
359
|
+
var activePopup = document.querySelectorAll('.e-ribbon .e-dropdown-btn.e-active, .e-ribbon-group-overflow-ddb .e-dropdown-btn.e-active');
|
|
360
|
+
if (activePopup.length) {
|
|
361
|
+
for (var i = 0; i < activePopup.length; i++) {
|
|
362
|
+
var dropDownBtn = getInstance(activePopup[parseInt(i.toString(), 10)], DropDownButton);
|
|
363
|
+
dropDownBtn.toggle();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
353
367
|
};
|
|
354
368
|
Ribbon.prototype.renderTabs = function () {
|
|
355
369
|
this.tabsInternal = this.tabs.slice();
|
|
@@ -675,7 +689,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
675
689
|
}
|
|
676
690
|
if (overflowDDB) {
|
|
677
691
|
if (group.enableGroupOverflow) {
|
|
678
|
-
if (overflowtarget.childElementCount === 0) {
|
|
692
|
+
if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
|
|
679
693
|
this.removeOverflowButton(overflowDDB);
|
|
680
694
|
}
|
|
681
695
|
}
|
|
@@ -747,6 +761,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
747
761
|
};
|
|
748
762
|
Ribbon.prototype.createOverflowPopup = function (item, tabIndex, isGroupOF, groupId, groupHeader, itemEle, groupContainer, isResize) {
|
|
749
763
|
var overflowButton;
|
|
764
|
+
var itemProp = getGroup(this.tabs, groupId);
|
|
750
765
|
var contentEle = this.tabObj.items[parseInt(tabIndex.toString(), 10)].content;
|
|
751
766
|
var groupEle = contentEle.querySelector('#' + groupId);
|
|
752
767
|
if (isGroupOF) {
|
|
@@ -760,6 +775,17 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
760
775
|
overflowButton = getInstance(overflowDDB, DropDownButton);
|
|
761
776
|
}
|
|
762
777
|
var overflowBtnTarget = overflowButton.target;
|
|
778
|
+
var headerEle = overflowBtnTarget.querySelector('#' + groupId + constants.GROUPOF_BUTTON_ID + constants.HEADER_ID);
|
|
779
|
+
if (!headerEle) {
|
|
780
|
+
if (itemProp.group.overflowHeader) {
|
|
781
|
+
var groupHeader_1 = this.createElement('div', {
|
|
782
|
+
className: constants.RIBBON_OVERFLOW_HEADER,
|
|
783
|
+
id: groupId + constants.GROUPOF_BUTTON_ID + constants.HEADER_ID,
|
|
784
|
+
innerHTML: itemProp.group.overflowHeader
|
|
785
|
+
});
|
|
786
|
+
overflowBtnTarget.append(groupHeader_1);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
763
789
|
if (groupEle) {
|
|
764
790
|
if (groupEle.classList.contains('e-disabled')) {
|
|
765
791
|
overflowBtnTarget.classList.add('e-disabled');
|
|
@@ -788,7 +814,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
788
814
|
if (ofTabContainer) {
|
|
789
815
|
var ofGroupContainer = overflowEle.querySelector('#' + groupId + constants.CONTAINER_ID);
|
|
790
816
|
if (!ofGroupContainer) {
|
|
791
|
-
ofGroupContainer = this.createGroupContainer(groupId, groupHeader);
|
|
817
|
+
ofGroupContainer = itemProp.group.overflowHeader ? this.createGroupContainer(groupId, itemProp.group.overflowHeader) : this.createGroupContainer(groupId, groupHeader);
|
|
792
818
|
if (groupEle) {
|
|
793
819
|
if (groupEle.classList.contains('e-disabled')) {
|
|
794
820
|
ofGroupContainer.classList.add('e-disabled');
|
|
@@ -836,7 +862,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
836
862
|
break;
|
|
837
863
|
case 'GroupButton':
|
|
838
864
|
if (this.activeLayout === 'Simplified') {
|
|
839
|
-
this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle);
|
|
865
|
+
this.ribbonGroupButtonModule.addOverFlowEvents(item, itemEle, overflowButton);
|
|
840
866
|
break;
|
|
841
867
|
}
|
|
842
868
|
}
|
|
@@ -848,7 +874,8 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
848
874
|
});
|
|
849
875
|
var overflowtarget = this.overflowDDB.target;
|
|
850
876
|
overflowtarget.append(ofTabContainer);
|
|
851
|
-
var
|
|
877
|
+
var itemProp = getGroup(this.tabs, groupId);
|
|
878
|
+
var ofGroupContainer = itemProp.group.overflowHeader ? this.createGroupContainer(groupId, itemProp.group.overflowHeader) : this.createGroupContainer(groupId, groupHeader);
|
|
852
879
|
ofGroupContainer.append(itemEle);
|
|
853
880
|
ofTabContainer.append(ofGroupContainer);
|
|
854
881
|
if (tabIndex === this.selectedTab) {
|
|
@@ -1695,11 +1722,23 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
1695
1722
|
locale: this.locale,
|
|
1696
1723
|
enableRtl: this.enableRtl,
|
|
1697
1724
|
enablePersistence: this.enablePersistence,
|
|
1725
|
+
beforeOpen: function (args) {
|
|
1726
|
+
var eventArgs = { element: args.element, event: args.event, cancel: args.cancel };
|
|
1727
|
+
_this.trigger('overflowPopupOpen', eventArgs, function (ribbonArgs) {
|
|
1728
|
+
if (ribbonArgs.cancel) {
|
|
1729
|
+
args.cancel = true;
|
|
1730
|
+
}
|
|
1731
|
+
});
|
|
1732
|
+
},
|
|
1698
1733
|
beforeClose: function (args) {
|
|
1699
1734
|
var ele = args.event ? closest(args.event.target, '.' + constants.RIBBON_POPUP_CONTROL) : null;
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1735
|
+
var groupButtonEle = args.event ? closest(args.event.target, '.e-ribbon-group-button-overflow-popup') : null;
|
|
1736
|
+
var eventArgs = { element: args.element, event: args.event, cancel: args.cancel };
|
|
1737
|
+
_this.trigger('overflowPopupClose', eventArgs, function (ribbonArgs) {
|
|
1738
|
+
if (ele || ribbonArgs.cancel || groupButtonEle) {
|
|
1739
|
+
args.cancel = true;
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1703
1742
|
}
|
|
1704
1743
|
}, overflowButton);
|
|
1705
1744
|
this.element.classList.add(constants.RIBBON_OVERFLOW);
|
|
@@ -1718,8 +1757,10 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
1718
1757
|
var currentList = target.querySelector('.e-ribbon-of-tab.e-ribbon-active');
|
|
1719
1758
|
items = currentList.getElementsByClassName('e-ribbon-item');
|
|
1720
1759
|
}
|
|
1721
|
-
var
|
|
1760
|
+
var control = items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-control');
|
|
1761
|
+
var comboBoxEle = control && control.classList.contains('e-combobox') ? items[(!this.itemIndex || this.itemIndex < 0) ? 0 : this.itemIndex].querySelector('.e-combobox') : null;
|
|
1722
1762
|
var ribbonItem;
|
|
1763
|
+
var templateEle;
|
|
1723
1764
|
if (comboBoxEle === null || (e.key === 'Tab') || this.itemIndex < 0) {
|
|
1724
1765
|
if (e.key === 'ArrowDown' || (!e.shiftKey && e.key === 'Tab')) {
|
|
1725
1766
|
if ((!this.itemIndex && this.itemIndex !== 0) || this.itemIndex < 0 || this.itemIndex === items.length - 1) {
|
|
@@ -1728,13 +1769,21 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
1728
1769
|
this.findDisabledItem(ribbonItem, items, true);
|
|
1729
1770
|
if (comboBoxEle && e.key === 'Tab') {
|
|
1730
1771
|
e.preventDefault();
|
|
1731
|
-
items[this.itemIndex].querySelector('.e-control')
|
|
1772
|
+
var item = items[this.itemIndex].querySelector('.e-control');
|
|
1773
|
+
if (item) {
|
|
1774
|
+
item.focus();
|
|
1775
|
+
}
|
|
1732
1776
|
}
|
|
1777
|
+
templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
|
|
1733
1778
|
}
|
|
1734
1779
|
else if (this.itemIndex < items.length - 1 && this.itemIndex >= 0) {
|
|
1735
1780
|
this.itemIndex++;
|
|
1736
1781
|
ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
|
|
1737
1782
|
this.findDisabledItem(ribbonItem, items, true);
|
|
1783
|
+
templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
|
|
1784
|
+
}
|
|
1785
|
+
if (templateEle) {
|
|
1786
|
+
templateEle.focus();
|
|
1738
1787
|
}
|
|
1739
1788
|
}
|
|
1740
1789
|
else if (e.key === 'ArrowUp' || (e.shiftKey && e.key === 'Tab')) {
|
|
@@ -1745,20 +1794,32 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
1745
1794
|
this.findDisabledItem(ribbonItem, items, false);
|
|
1746
1795
|
if (comboBoxEle && (e.shiftKey && e.key === 'Tab')) {
|
|
1747
1796
|
e.preventDefault();
|
|
1748
|
-
items[this.itemIndex].querySelector('.e-control')
|
|
1797
|
+
var item = items[this.itemIndex].querySelector('.e-control');
|
|
1798
|
+
if (item) {
|
|
1799
|
+
item.focus();
|
|
1800
|
+
}
|
|
1749
1801
|
}
|
|
1802
|
+
templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
|
|
1750
1803
|
}
|
|
1751
1804
|
else if (this.itemIndex <= items.length - 1 && this.itemIndex > 0) {
|
|
1752
1805
|
this.itemIndex--;
|
|
1753
1806
|
ribbonItem = items[this.itemIndex].closest('.e-ribbon-item');
|
|
1754
1807
|
this.findDisabledItem(ribbonItem, items, false);
|
|
1808
|
+
templateEle = items[this.itemIndex].querySelector('.e-ribbon-template');
|
|
1809
|
+
}
|
|
1810
|
+
if (templateEle) {
|
|
1811
|
+
templateEle.focus();
|
|
1755
1812
|
}
|
|
1756
1813
|
}
|
|
1757
1814
|
}
|
|
1758
1815
|
target.setAttribute('index', this.itemIndex.toString());
|
|
1759
1816
|
}
|
|
1760
1817
|
var currentItemIndex = parseInt(target.getAttribute('index'), 10);
|
|
1761
|
-
var itemType =
|
|
1818
|
+
var itemType = "";
|
|
1819
|
+
var controlItem = items[parseInt(currentItemIndex.toString(), 10)] ? items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control') : null;
|
|
1820
|
+
if (controlItem) {
|
|
1821
|
+
itemType = controlItem.getAttribute('data-control');
|
|
1822
|
+
}
|
|
1762
1823
|
if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === ' ' || e.key === 'Tab') {
|
|
1763
1824
|
if (itemType === 'ColorPicker') {
|
|
1764
1825
|
if (e.key === 'Tab') {
|
|
@@ -1770,7 +1831,10 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
1770
1831
|
if (e.key === 'Tab') {
|
|
1771
1832
|
e.preventDefault();
|
|
1772
1833
|
}
|
|
1773
|
-
items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control')
|
|
1834
|
+
var elem = items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control');
|
|
1835
|
+
if (elem) {
|
|
1836
|
+
elem.focus();
|
|
1837
|
+
}
|
|
1774
1838
|
}
|
|
1775
1839
|
if (e.key === ' ' && (itemType === 'CheckBox')) {
|
|
1776
1840
|
var checkBoxEle = items[parseInt(currentItemIndex.toString(), 10)].querySelector('.e-control');
|
|
@@ -2157,7 +2221,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
2157
2221
|
this.setItemSize(ele, item);
|
|
2158
2222
|
}
|
|
2159
2223
|
if (group.enableGroupOverflow && overflowDDB) {
|
|
2160
|
-
if (overflowtarget.childElementCount === 0) {
|
|
2224
|
+
if (overflowtarget.childElementCount === 0 || (overflowtarget.childElementCount === 1 && this.isHeaderVisible(overflowtarget, group.id))) {
|
|
2161
2225
|
this.removeOverflowButton(overflowDDB);
|
|
2162
2226
|
}
|
|
2163
2227
|
}
|
|
@@ -2442,7 +2506,8 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
2442
2506
|
Ribbon.prototype.createTemplateContent = function (item, itemElement) {
|
|
2443
2507
|
var itemEle = this.createElement('div', {
|
|
2444
2508
|
className: item.cssClass ? (constants.RIBBON_TEMPLATE + constants.SPACE + item.cssClass) : constants.RIBBON_TEMPLATE,
|
|
2445
|
-
id: item.id
|
|
2509
|
+
id: item.id,
|
|
2510
|
+
attrs: { 'tabindex': '-1' }
|
|
2446
2511
|
});
|
|
2447
2512
|
if (item.disabled) {
|
|
2448
2513
|
itemEle.classList.add(constants.DISABLED_CSS);
|
|
@@ -2918,7 +2983,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
2918
2983
|
}
|
|
2919
2984
|
if (this.activeLayout === RibbonLayout.Simplified) {
|
|
2920
2985
|
if (itemProp.group.enableGroupOverflow) {
|
|
2921
|
-
if (dropdown.target.childElementCount === 0) {
|
|
2986
|
+
if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
2922
2987
|
this.removeOverflowButton(dropdown);
|
|
2923
2988
|
}
|
|
2924
2989
|
}
|
|
@@ -2945,6 +3010,9 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
2945
3010
|
this.refreshLayout();
|
|
2946
3011
|
}
|
|
2947
3012
|
};
|
|
3013
|
+
Ribbon.prototype.isHeaderVisible = function (headerEle, groupID) {
|
|
3014
|
+
return headerEle.querySelector('#' + groupID + constants.GROUPOF_BUTTON_ID + constants.HEADER_ID) ? true : false;
|
|
3015
|
+
};
|
|
2948
3016
|
/**
|
|
2949
3017
|
* Hides a specific group within a ribbon tab.
|
|
2950
3018
|
*
|
|
@@ -3504,7 +3572,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
3504
3572
|
}
|
|
3505
3573
|
if (this.activeLayout === RibbonLayout.Simplified) {
|
|
3506
3574
|
if (itemProp.group.enableGroupOverflow) {
|
|
3507
|
-
if (dropdown.target.childElementCount === 0) {
|
|
3575
|
+
if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
3508
3576
|
this.removeOverflowButton(dropdown);
|
|
3509
3577
|
}
|
|
3510
3578
|
}
|
|
@@ -3723,7 +3791,7 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
3723
3791
|
}
|
|
3724
3792
|
this.createRibbonItem(ribbonItem, itemContainer);
|
|
3725
3793
|
if (this.activeLayout === 'Simplified' && itemProp.group.enableGroupOverflow) {
|
|
3726
|
-
if (dropdown.target.childElementCount === 0) {
|
|
3794
|
+
if (dropdown.target.childElementCount === 0 || (dropdown.target.childElementCount === 1 && this.isHeaderVisible(dropdown.target, itemProp.group.id))) {
|
|
3727
3795
|
this.removeOverflowButton(dropdown);
|
|
3728
3796
|
}
|
|
3729
3797
|
}
|
|
@@ -4025,6 +4093,12 @@ var Ribbon = /** @class */ (function (_super) {
|
|
|
4025
4093
|
__decorate([
|
|
4026
4094
|
Event()
|
|
4027
4095
|
], Ribbon.prototype, "created", void 0);
|
|
4096
|
+
__decorate([
|
|
4097
|
+
Event()
|
|
4098
|
+
], Ribbon.prototype, "overflowPopupOpen", void 0);
|
|
4099
|
+
__decorate([
|
|
4100
|
+
Event()
|
|
4101
|
+
], Ribbon.prototype, "overflowPopupClose", void 0);
|
|
4028
4102
|
Ribbon = Ribbon_1 = __decorate([
|
|
4029
4103
|
NotifyPropertyChanges
|
|
4030
4104
|
], Ribbon);
|
|
@@ -88,6 +88,15 @@ var RibbonColorPicker = /** @class */ (function () {
|
|
|
88
88
|
*/
|
|
89
89
|
RibbonColorPicker.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
|
|
90
90
|
var _this = this;
|
|
91
|
+
var colorPickerSettings = item.colorPickerSettings;
|
|
92
|
+
if (colorPickerSettings.label && this.parent.activeLayout === 'Simplified') {
|
|
93
|
+
var label = this.parent.createElement('div', {
|
|
94
|
+
className: 'e-ribbon-colorpicker-label',
|
|
95
|
+
id: item.id + '_label',
|
|
96
|
+
innerHTML: colorPickerSettings.label
|
|
97
|
+
});
|
|
98
|
+
itemEle.insertBefore(label, itemEle.firstChild);
|
|
99
|
+
}
|
|
91
100
|
var colorPickerEle = itemEle.querySelector('#' + item.id);
|
|
92
101
|
colorPickerEle.setAttribute('data-control', item.type.toString());
|
|
93
102
|
var colorPickerObj = getComponent(colorPickerEle, ColorPicker);
|
|
@@ -118,6 +127,13 @@ var RibbonColorPicker = /** @class */ (function () {
|
|
|
118
127
|
*/
|
|
119
128
|
RibbonColorPicker.prototype.removeOverFlowEvents = function (item, itemEle) {
|
|
120
129
|
var _this = this;
|
|
130
|
+
var colorPickerSettings = item.colorPickerSettings;
|
|
131
|
+
if (colorPickerSettings.label) {
|
|
132
|
+
var label = itemEle.querySelector('#' + item.id + '_label');
|
|
133
|
+
if (label) {
|
|
134
|
+
label.remove();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
121
137
|
var colorPickerEle = itemEle.querySelector('#' + item.id);
|
|
122
138
|
var colorPickerObj = getComponent(colorPickerEle, ColorPicker);
|
|
123
139
|
var cssClass = colorPickerObj.cssClass.split(SPACE);
|
|
@@ -83,6 +83,15 @@ var RibbonComboBox = /** @class */ (function () {
|
|
|
83
83
|
*/
|
|
84
84
|
RibbonComboBox.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
|
|
85
85
|
var _this = this;
|
|
86
|
+
var comboBoxSettings = item.comboBoxSettings;
|
|
87
|
+
if (comboBoxSettings.label && this.parent.activeLayout === 'Simplified') {
|
|
88
|
+
var label = this.parent.createElement('div', {
|
|
89
|
+
className: 'e-ribbon-combobox-label',
|
|
90
|
+
id: item.id + '_label',
|
|
91
|
+
innerHTML: comboBoxSettings.label
|
|
92
|
+
});
|
|
93
|
+
itemEle.insertBefore(label, itemEle.firstChild);
|
|
94
|
+
}
|
|
86
95
|
var inputEle = itemEle.querySelector('#' + item.id);
|
|
87
96
|
inputEle.setAttribute('data-control', item.type.toString());
|
|
88
97
|
var comboBoxObj = getComponent(inputEle, ComboBox);
|
|
@@ -107,6 +116,13 @@ var RibbonComboBox = /** @class */ (function () {
|
|
|
107
116
|
*/
|
|
108
117
|
RibbonComboBox.prototype.removeOverFlowEvents = function (item, itemEle) {
|
|
109
118
|
var _this = this;
|
|
119
|
+
var comboBoxSettings = item.comboBoxSettings;
|
|
120
|
+
if (comboBoxSettings.label) {
|
|
121
|
+
var label = itemEle.querySelector('#' + item.id + '_label');
|
|
122
|
+
if (label) {
|
|
123
|
+
label.remove();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
110
126
|
var inputEle = itemEle.querySelector('#' + item.id);
|
|
111
127
|
var comboBoxObj = getComponent(inputEle, ComboBox);
|
|
112
128
|
var cssClass = comboBoxObj.cssClass.split(SPACE);
|
|
@@ -164,7 +164,9 @@ var RibbonDropDown = /** @class */ (function () {
|
|
|
164
164
|
return dropdown;
|
|
165
165
|
};
|
|
166
166
|
RibbonDropDown.prototype.keyActionHandler = function (e, target) {
|
|
167
|
-
var
|
|
167
|
+
var controlElements = Array.prototype.slice.call(target.querySelectorAll('.e-control'));
|
|
168
|
+
var templateElements = Array.prototype.slice.call(target.querySelectorAll('.e-ribbon-template'));
|
|
169
|
+
var items = controlElements.concat(templateElements);
|
|
168
170
|
var comboBoxElements = target.querySelectorAll('.e-combobox');
|
|
169
171
|
var comboBoxEle;
|
|
170
172
|
if (comboBoxElements) {
|
|
@@ -183,7 +185,7 @@ var RibbonDropDown = /** @class */ (function () {
|
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
|
-
if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-launcher-icon') ||
|
|
188
|
+
if (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template') || e.target.classList.contains('e-ribbon-launcher-icon') ||
|
|
187
189
|
e.target.classList.contains('e-ribbon-last-item') || e.target.classList.contains('e-ribbon-first-item')) {
|
|
188
190
|
if (e.key === 'ArrowRight' || (!e.shiftKey && e.key === 'Tab')) {
|
|
189
191
|
this.handleNavigation(e, !this.enableRtl, items);
|
|
@@ -206,7 +208,7 @@ var RibbonDropDown = /** @class */ (function () {
|
|
|
206
208
|
}
|
|
207
209
|
if (!e.target.classList.contains('e-combobox') && !e.target.classList.contains('e-ribbon-last-item') &&
|
|
208
210
|
!e.target.classList.contains('e-ribbon-group-container') && (e.target.classList.contains('e-ribbon-first-item')
|
|
209
|
-
|| this.itemIndex !== 0) && e.target.classList.contains('e-control')) {
|
|
211
|
+
|| this.itemIndex !== 0) && (e.target.classList.contains('e-control') || e.target.classList.contains('e-ribbon-template'))) {
|
|
210
212
|
this.itemIndex++;
|
|
211
213
|
this.updateItemIndex(e, items, true);
|
|
212
214
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ribbon } from '../base/ribbon';
|
|
2
2
|
import { RibbonItemModel } from '../models';
|
|
3
|
+
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
3
4
|
/**
|
|
4
5
|
* Defines the items of Ribbon.
|
|
5
6
|
*/
|
|
@@ -30,6 +31,7 @@ export declare class RibbonGroupButton {
|
|
|
30
31
|
* @hidden
|
|
31
32
|
*/
|
|
32
33
|
switchGroupButton(item: RibbonItemModel, itemElement: HTMLElement): void;
|
|
34
|
+
private addGroupButtonHeader;
|
|
33
35
|
private handleGroupButtonNavigation;
|
|
34
36
|
/**
|
|
35
37
|
* Adds the additional event handlers as the item moved into overflow popup.
|
|
@@ -39,7 +41,7 @@ export declare class RibbonGroupButton {
|
|
|
39
41
|
* @returns {void}
|
|
40
42
|
* @hidden
|
|
41
43
|
*/
|
|
42
|
-
addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement): void;
|
|
44
|
+
addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement, overflowButton: DropDownButton): void;
|
|
43
45
|
/**
|
|
44
46
|
* Removes the additional event handlers as the item moved into overflow popup.
|
|
45
47
|
*
|