@syncfusion/ej2-ribbon 21.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +259 -0
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +60 -0
- package/.github/PULL_REQUEST_TEMPLATE/feature.md +37 -0
- package/CHANGELOG.md +19 -0
- package/README.md +3 -0
- package/dist/ej2-ribbon.umd.min.js +11 -0
- package/dist/ej2-ribbon.umd.min.js.map +1 -0
- package/dist/es6/ej2-ribbon.es2015.js +4946 -0
- package/dist/es6/ej2-ribbon.es2015.js.map +1 -0
- package/dist/es6/ej2-ribbon.es5.js +5253 -0
- package/dist/es6/ej2-ribbon.es5.js.map +1 -0
- package/dist/global/ej2-ribbon.min.js +11 -0
- package/dist/global/ej2-ribbon.min.js.map +1 -0
- package/dist/global/index.d.ts +14 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/license +10 -0
- package/package.json +67 -0
- package/ribbon.d.ts +4 -0
- package/ribbon.js +4 -0
- package/src/global.js +3 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +3 -0
- package/src/ribbon/base/constant.d.ts +151 -0
- package/src/ribbon/base/constant.js +151 -0
- package/src/ribbon/base/index.d.ts +8 -0
- package/src/ribbon/base/index.js +7 -0
- package/src/ribbon/base/interface.d.ts +194 -0
- package/src/ribbon/base/interface.js +106 -0
- package/src/ribbon/base/ribbon-model.d.ts +129 -0
- package/src/ribbon/base/ribbon.d.ts +357 -0
- package/src/ribbon/base/ribbon.js +2413 -0
- package/src/ribbon/base/utils.d.ts +113 -0
- package/src/ribbon/base/utils.js +288 -0
- package/src/ribbon/index.d.ts +7 -0
- package/src/ribbon/index.js +7 -0
- package/src/ribbon/items/index.d.ts +6 -0
- package/src/ribbon/items/index.js +6 -0
- package/src/ribbon/items/ribbon-button.d.ts +65 -0
- package/src/ribbon/items/ribbon-button.js +153 -0
- package/src/ribbon/items/ribbon-checkbox.d.ts +56 -0
- package/src/ribbon/items/ribbon-checkbox.js +134 -0
- package/src/ribbon/items/ribbon-colorpicker.d.ts +66 -0
- package/src/ribbon/items/ribbon-colorpicker.js +163 -0
- package/src/ribbon/items/ribbon-combobox.d.ts +78 -0
- package/src/ribbon/items/ribbon-combobox.js +185 -0
- package/src/ribbon/items/ribbon-dropdown.d.ts +123 -0
- package/src/ribbon/items/ribbon-dropdown.js +268 -0
- package/src/ribbon/items/ribbon-splitbutton.d.ts +86 -0
- package/src/ribbon/items/ribbon-splitbutton.js +227 -0
- package/src/ribbon/models/index.d.ts +24 -0
- package/src/ribbon/models/index.js +13 -0
- package/src/ribbon/models/ribbon-button-settings-model.d.ts +57 -0
- package/src/ribbon/models/ribbon-button-settings.d.ts +55 -0
- package/src/ribbon/models/ribbon-button-settings.js +61 -0
- package/src/ribbon/models/ribbon-checkbox-settings-model.d.ts +50 -0
- package/src/ribbon/models/ribbon-checkbox-settings.d.ts +50 -0
- package/src/ribbon/models/ribbon-checkbox-settings.js +58 -0
- package/src/ribbon/models/ribbon-collection-model.d.ts +30 -0
- package/src/ribbon/models/ribbon-collection.d.ts +33 -0
- package/src/ribbon/models/ribbon-collection.js +50 -0
- package/src/ribbon/models/ribbon-colorpicker-settings-model.d.ts +123 -0
- package/src/ribbon/models/ribbon-colorpicker-settings.d.ts +115 -0
- package/src/ribbon/models/ribbon-colorpicker-settings.js +88 -0
- package/src/ribbon/models/ribbon-combobox-settings-model.d.ts +241 -0
- package/src/ribbon/models/ribbon-combobox-settings.d.ts +223 -0
- package/src/ribbon/models/ribbon-combobox-settings.js +122 -0
- package/src/ribbon/models/ribbon-dropdown-settings-model.d.ts +100 -0
- package/src/ribbon/models/ribbon-dropdown-settings.d.ts +93 -0
- package/src/ribbon/models/ribbon-dropdown-settings.js +80 -0
- package/src/ribbon/models/ribbon-file-menu-settings-model.d.ts +108 -0
- package/src/ribbon/models/ribbon-file-menu-settings.d.ts +159 -0
- package/src/ribbon/models/ribbon-file-menu-settings.js +84 -0
- package/src/ribbon/models/ribbon-group-model.d.ts +91 -0
- package/src/ribbon/models/ribbon-group.d.ts +87 -0
- package/src/ribbon/models/ribbon-group.js +74 -0
- package/src/ribbon/models/ribbon-item-model.d.ts +120 -0
- package/src/ribbon/models/ribbon-item.d.ts +118 -0
- package/src/ribbon/models/ribbon-item.js +93 -0
- package/src/ribbon/models/ribbon-splitbutton-settings-model.d.ts +107 -0
- package/src/ribbon/models/ribbon-splitbutton-settings.d.ts +99 -0
- package/src/ribbon/models/ribbon-splitbutton-settings.js +83 -0
- package/src/ribbon/models/ribbon-tab-model.d.ts +37 -0
- package/src/ribbon/models/ribbon-tab.d.ts +39 -0
- package/src/ribbon/models/ribbon-tab.js +53 -0
- package/src/ribbon/models/ribbon-tooltip-model.d.ts +43 -0
- package/src/ribbon/models/ribbon-tooltip.d.ts +36 -0
- package/src/ribbon/models/ribbon-tooltip.js +46 -0
- package/src/ribbon/modules/index.d.ts +1 -0
- package/src/ribbon/modules/index.js +1 -0
- package/src/ribbon/modules/ribbon-filemenu.d.ts +94 -0
- package/src/ribbon/modules/ribbon-filemenu.js +318 -0
- package/styles/bootstrap-dark.css +1502 -0
- package/styles/bootstrap-dark.scss +1 -0
- package/styles/bootstrap.css +1507 -0
- package/styles/bootstrap.scss +1 -0
- package/styles/bootstrap4.css +1557 -0
- package/styles/bootstrap4.scss +1 -0
- package/styles/bootstrap5-dark.css +1586 -0
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +1586 -0
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark.css +1478 -0
- package/styles/fabric-dark.scss +1 -0
- package/styles/fabric.css +1476 -0
- package/styles/fabric.scss +1 -0
- package/styles/fluent-dark.css +1562 -0
- package/styles/fluent-dark.scss +1 -0
- package/styles/fluent.css +1562 -0
- package/styles/fluent.scss +1 -0
- package/styles/highcontrast-light.css +1485 -0
- package/styles/highcontrast-light.scss +1 -0
- package/styles/highcontrast.css +1494 -0
- package/styles/highcontrast.scss +1 -0
- package/styles/material-dark.css +1548 -0
- package/styles/material-dark.scss +1 -0
- package/styles/material.css +1581 -0
- package/styles/material.scss +1 -0
- package/styles/ribbon/_all.scss +2 -0
- package/styles/ribbon/_bootstrap-dark-definition.scss +206 -0
- package/styles/ribbon/_bootstrap-definition.scss +206 -0
- package/styles/ribbon/_bootstrap4-definition.scss +206 -0
- package/styles/ribbon/_bootstrap5-dark-definition.scss +1 -0
- package/styles/ribbon/_bootstrap5-definition.scss +206 -0
- package/styles/ribbon/_fabric-dark-definition.scss +206 -0
- package/styles/ribbon/_fabric-definition.scss +206 -0
- package/styles/ribbon/_fluent-dark-definition.scss +1 -0
- package/styles/ribbon/_fluent-definition.scss +206 -0
- package/styles/ribbon/_fusionnew-definition.scss +206 -0
- package/styles/ribbon/_highcontrast-definition.scss +206 -0
- package/styles/ribbon/_highcontrast-light-definition.scss +206 -0
- package/styles/ribbon/_layout.scss +1040 -0
- package/styles/ribbon/_material-dark-definition.scss +206 -0
- package/styles/ribbon/_material-definition.scss +206 -0
- package/styles/ribbon/_tailwind-dark-definition.scss +1 -0
- package/styles/ribbon/_tailwind-definition.scss +206 -0
- package/styles/ribbon/_theme.scss +343 -0
- package/styles/ribbon/bootstrap-dark.css +1502 -0
- package/styles/ribbon/bootstrap-dark.scss +17 -0
- package/styles/ribbon/bootstrap.css +1507 -0
- package/styles/ribbon/bootstrap.scss +17 -0
- package/styles/ribbon/bootstrap4.css +1557 -0
- package/styles/ribbon/bootstrap4.scss +17 -0
- package/styles/ribbon/bootstrap5-dark.css +1586 -0
- package/styles/ribbon/bootstrap5-dark.scss +17 -0
- package/styles/ribbon/bootstrap5.css +1586 -0
- package/styles/ribbon/bootstrap5.scss +17 -0
- package/styles/ribbon/fabric-dark.css +1478 -0
- package/styles/ribbon/fabric-dark.scss +17 -0
- package/styles/ribbon/fabric.css +1476 -0
- package/styles/ribbon/fabric.scss +17 -0
- package/styles/ribbon/fluent-dark.css +1562 -0
- package/styles/ribbon/fluent-dark.scss +17 -0
- package/styles/ribbon/fluent.css +1562 -0
- package/styles/ribbon/fluent.scss +17 -0
- package/styles/ribbon/highcontrast-light.css +1485 -0
- package/styles/ribbon/highcontrast-light.scss +16 -0
- package/styles/ribbon/highcontrast.css +1494 -0
- package/styles/ribbon/highcontrast.scss +17 -0
- package/styles/ribbon/icons/_bootstrap-dark.scss +9 -0
- package/styles/ribbon/icons/_bootstrap.scss +9 -0
- package/styles/ribbon/icons/_bootstrap4.scss +9 -0
- package/styles/ribbon/icons/_bootstrap5-dark.scss +1 -0
- package/styles/ribbon/icons/_bootstrap5.scss +9 -0
- package/styles/ribbon/icons/_fabric-dark.scss +9 -0
- package/styles/ribbon/icons/_fabric.scss +9 -0
- package/styles/ribbon/icons/_fluent-dark.scss +1 -0
- package/styles/ribbon/icons/_fluent.scss +9 -0
- package/styles/ribbon/icons/_fusionnew.scss +9 -0
- package/styles/ribbon/icons/_highcontrast.scss +9 -0
- package/styles/ribbon/icons/_material-dark.scss +9 -0
- package/styles/ribbon/icons/_material.scss +9 -0
- package/styles/ribbon/icons/_material3.scss +9 -0
- package/styles/ribbon/icons/_tailwind-dark.scss +9 -0
- package/styles/ribbon/icons/_tailwind.scss +9 -0
- package/styles/ribbon/material-dark.css +1548 -0
- package/styles/ribbon/material-dark.scss +17 -0
- package/styles/ribbon/material.css +1581 -0
- package/styles/ribbon/material.scss +17 -0
- package/styles/ribbon/tailwind-dark.css +1560 -0
- package/styles/ribbon/tailwind-dark.scss +17 -0
- package/styles/ribbon/tailwind.css +1560 -0
- package/styles/ribbon/tailwind.scss +17 -0
- package/styles/tailwind-dark.css +1560 -0
- package/styles/tailwind-dark.scss +1 -0
- package/styles/tailwind.css +1560 -0
- package/styles/tailwind.scss +1 -0
- package/tslint.json +111 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { DropDownButton, ItemModel } from '@syncfusion/ej2-splitbuttons';
|
|
2
|
+
import { Ribbon, itemProps } from '../base/index';
|
|
3
|
+
import { RibbonDropDownSettingsModel, RibbonItemModel } from '../models/index';
|
|
4
|
+
/**
|
|
5
|
+
* Defines the items of Ribbon.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RibbonDropDown {
|
|
8
|
+
private parent;
|
|
9
|
+
constructor(parent: Ribbon);
|
|
10
|
+
protected getModuleName(): string;
|
|
11
|
+
protected destroy(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Creates DropDown.
|
|
14
|
+
*
|
|
15
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
16
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
17
|
+
* @returns {void}
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
createDropDown(item: RibbonItemModel, itemEle: HTMLElement): void;
|
|
21
|
+
/**
|
|
22
|
+
* Adds the additional event handlers as the item moved into overflow popup.
|
|
23
|
+
*
|
|
24
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
25
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
26
|
+
* @param {DropDownButton} overflowButton - Gets the overflow button.
|
|
27
|
+
* @returns {void}
|
|
28
|
+
* @hidden
|
|
29
|
+
*/
|
|
30
|
+
addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement, overflowButton: DropDownButton): void;
|
|
31
|
+
/**
|
|
32
|
+
* Removes the additional event handlers as the item moved from overflow popup.
|
|
33
|
+
*
|
|
34
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
35
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
36
|
+
* @param {DropDownButton} overflowButton - Gets the overflow button.
|
|
37
|
+
* @returns {void}
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
removeOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement): void;
|
|
41
|
+
/**
|
|
42
|
+
* Creates Overflow DropDown.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} id - Gets the ID of the dropdown item.
|
|
45
|
+
* @param {string} name - Gets the name of the dropdown item.
|
|
46
|
+
* @param {string} iconCss - Gets the icon of the dropdown item.
|
|
47
|
+
* @param {HTMLElement} groupEle - Gets the overflow group element.
|
|
48
|
+
* @param {HTMLElement} overflowEle - Gets the overflow element.
|
|
49
|
+
* @returns {void}
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
createOverFlowDropDown(id: string, name: string, iconCss: string, groupEle: HTMLElement, overflowEle: HTMLElement): DropDownButton;
|
|
53
|
+
/**
|
|
54
|
+
* Removes Overflow DropDown.
|
|
55
|
+
*
|
|
56
|
+
* @param {HTMLElement} dropdownElement - Gets the ribbon DropDown element.
|
|
57
|
+
* @returns {void}
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
|
+
removeOverFlowDropDown(dropdownElement: HTMLElement): void;
|
|
61
|
+
/**
|
|
62
|
+
* Gets DropDown item element.
|
|
63
|
+
*
|
|
64
|
+
* @param {HTMLElement} dropdownElement - Gets the ribbon DropDown element.
|
|
65
|
+
* @param {string} id - Gets the ID of ribbon DropDown element.
|
|
66
|
+
* @returns {HTMLElement} - Returns the DropDown item element.
|
|
67
|
+
* @hidden
|
|
68
|
+
*/
|
|
69
|
+
getDDBItemElement(dropdownElement: HTMLElement, id: string): HTMLElement;
|
|
70
|
+
/**
|
|
71
|
+
* Gets Overflow DropDown Popup.
|
|
72
|
+
*
|
|
73
|
+
* @param {itemProps} itemProp - Gets the property of ribbon item.
|
|
74
|
+
* @param {HTMLElement} contentEle - Gets the content element.
|
|
75
|
+
* @returns {HTMLElement} - Returns the Overflow DropDown Popup.
|
|
76
|
+
* @hidden
|
|
77
|
+
*/
|
|
78
|
+
getOverflowDropDownPopup(itemProp: itemProps, contentEle: HTMLElement): HTMLElement;
|
|
79
|
+
private getDropDownObj;
|
|
80
|
+
/**
|
|
81
|
+
* Adds a new item to the menu. By default, new item appends to
|
|
82
|
+
* the list as the last item, but you can insert based on the text parameter.
|
|
83
|
+
*
|
|
84
|
+
* @param {string} controlId - Gets the control ID.
|
|
85
|
+
* @param {ItemModel[]} Items - Gets the DropDown items.
|
|
86
|
+
* @param {string} text - Gets the text of the dropdown item where the new item needs to be inserted.
|
|
87
|
+
* @returns {void}
|
|
88
|
+
*/
|
|
89
|
+
addItems(controlId: string, Items: ItemModel[], text?: string): void;
|
|
90
|
+
/**
|
|
91
|
+
* Removes the items from the menu.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} controlId - Gets the control ID.
|
|
94
|
+
* @param {string[]} Items -
|
|
95
|
+
* @param {string} isUniqueId -
|
|
96
|
+
* @returns {void}
|
|
97
|
+
*/
|
|
98
|
+
removeItems(controlId: string, Items: string[], isUniqueId?: boolean): void;
|
|
99
|
+
/**
|
|
100
|
+
* To open/close DropDownButton popup based on current state of the DropDownButton.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} controlId - Gets the control ID.
|
|
103
|
+
* @returns {void}
|
|
104
|
+
*/
|
|
105
|
+
toggle(controlId: string): void;
|
|
106
|
+
/**
|
|
107
|
+
* Updates the dropdown.
|
|
108
|
+
*
|
|
109
|
+
* @param {RibbonDropDownSettingsModel} prop - Gets the dropdown property.
|
|
110
|
+
* @param {string} id - Gets the ID of dropdown.
|
|
111
|
+
* @returns {void}
|
|
112
|
+
*/
|
|
113
|
+
updateDropDown(prop: RibbonDropDownSettingsModel, id: string): void;
|
|
114
|
+
/**
|
|
115
|
+
* Updated DropDown size
|
|
116
|
+
*
|
|
117
|
+
* @param {HTMLElement} element - Gets the dropdown element.
|
|
118
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
119
|
+
* @returns {void}
|
|
120
|
+
* @hidden
|
|
121
|
+
*/
|
|
122
|
+
updateDropDownSize(element: HTMLElement, item: RibbonItemModel): void;
|
|
123
|
+
}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { closest, getComponent, isNullOrUndefined, merge, remove } from '@syncfusion/ej2-base';
|
|
2
|
+
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
3
|
+
import { Tooltip } from '@syncfusion/ej2-popups';
|
|
4
|
+
import { getItem, getItemElement, RibbonItemSize, createTooltip } from '../base/index';
|
|
5
|
+
import { DROPDOWN_ID, ITEM_VERTICAL_CENTER, OVERFLOW_ID, RIBBON_CONTROL, RIBBON_GROUP_OVERFLOW_DDB, RIBBON_POPUP_CONTROL, SPACE, VERTICAL_DDB } from '../base/constant';
|
|
6
|
+
/**
|
|
7
|
+
* Defines the items of Ribbon.
|
|
8
|
+
*/
|
|
9
|
+
var RibbonDropDown = /** @class */ (function () {
|
|
10
|
+
function RibbonDropDown(parent) {
|
|
11
|
+
this.parent = parent;
|
|
12
|
+
}
|
|
13
|
+
RibbonDropDown.prototype.getModuleName = function () {
|
|
14
|
+
return 'ribbonDropDown';
|
|
15
|
+
};
|
|
16
|
+
RibbonDropDown.prototype.destroy = function () {
|
|
17
|
+
this.parent = null;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Creates DropDown.
|
|
21
|
+
*
|
|
22
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
23
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
24
|
+
* @returns {void}
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
RibbonDropDown.prototype.createDropDown = function (item, itemEle) {
|
|
28
|
+
var _this = this;
|
|
29
|
+
var buttonEle = this.parent.createElement('button', {
|
|
30
|
+
id: item.id
|
|
31
|
+
});
|
|
32
|
+
itemEle.appendChild(buttonEle);
|
|
33
|
+
var dropDownSettings = item.dropDownSettings;
|
|
34
|
+
var cssClass = (ITEM_VERTICAL_CENTER + SPACE + RIBBON_CONTROL + SPACE + (dropDownSettings.cssClass ?
|
|
35
|
+
dropDownSettings.cssClass : '')).trim();
|
|
36
|
+
new DropDownButton({
|
|
37
|
+
locale: this.parent.locale,
|
|
38
|
+
enableRtl: this.parent.enableRtl,
|
|
39
|
+
enablePersistence: this.parent.enablePersistence,
|
|
40
|
+
iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left',
|
|
41
|
+
closeActionEvents: dropDownSettings.closeActionEvents,
|
|
42
|
+
content: item.activeSize === RibbonItemSize.Small ? '' : dropDownSettings.content,
|
|
43
|
+
cssClass: cssClass + ((item.activeSize === RibbonItemSize.Large) ? (SPACE + VERTICAL_DDB) : ''),
|
|
44
|
+
disabled: item.disabled,
|
|
45
|
+
iconCss: dropDownSettings.iconCss,
|
|
46
|
+
items: dropDownSettings.items,
|
|
47
|
+
target: dropDownSettings.target,
|
|
48
|
+
beforeClose: dropDownSettings.beforeClose,
|
|
49
|
+
beforeItemRender: dropDownSettings.beforeItemRender,
|
|
50
|
+
beforeOpen: dropDownSettings.beforeOpen,
|
|
51
|
+
close: function (e) {
|
|
52
|
+
if (dropDownSettings.close) {
|
|
53
|
+
dropDownSettings.close.call(_this, e);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
created: dropDownSettings.created,
|
|
57
|
+
open: dropDownSettings.open,
|
|
58
|
+
select: dropDownSettings.select
|
|
59
|
+
}, buttonEle);
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Adds the additional event handlers as the item moved into overflow popup.
|
|
63
|
+
*
|
|
64
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
65
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
66
|
+
* @param {DropDownButton} overflowButton - Gets the overflow button.
|
|
67
|
+
* @returns {void}
|
|
68
|
+
* @hidden
|
|
69
|
+
*/
|
|
70
|
+
RibbonDropDown.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
|
|
71
|
+
var _this = this;
|
|
72
|
+
var dropdownElement = itemEle.querySelector('#' + item.id);
|
|
73
|
+
var dropdown = getComponent(dropdownElement, DropDownButton);
|
|
74
|
+
dropdown.cssClass = dropdown.cssClass + SPACE + RIBBON_POPUP_CONTROL;
|
|
75
|
+
dropdown.dataBind();
|
|
76
|
+
dropdown.close = function (e) {
|
|
77
|
+
if (item.dropDownSettings.close) {
|
|
78
|
+
item.dropDownSettings.close.call(_this, e);
|
|
79
|
+
}
|
|
80
|
+
overflowButton.toggle();
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Removes the additional event handlers as the item moved from overflow popup.
|
|
85
|
+
*
|
|
86
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
87
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
88
|
+
* @param {DropDownButton} overflowButton - Gets the overflow button.
|
|
89
|
+
* @returns {void}
|
|
90
|
+
* @hidden
|
|
91
|
+
*/
|
|
92
|
+
RibbonDropDown.prototype.removeOverFlowEvents = function (item, itemEle) {
|
|
93
|
+
var _this = this;
|
|
94
|
+
var dropdownElement = itemEle.querySelector('#' + item.id);
|
|
95
|
+
var dropdown = getComponent(dropdownElement, DropDownButton);
|
|
96
|
+
var cssClass = dropdown.cssClass.split(SPACE);
|
|
97
|
+
cssClass = cssClass.filter(function (value) { return value !== RIBBON_POPUP_CONTROL; });
|
|
98
|
+
dropdown.cssClass = cssClass.join(SPACE);
|
|
99
|
+
dropdown.dataBind();
|
|
100
|
+
dropdown.close = function (e) {
|
|
101
|
+
if (item.dropDownSettings.close) {
|
|
102
|
+
item.dropDownSettings.close.call(_this, e);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Creates Overflow DropDown.
|
|
108
|
+
*
|
|
109
|
+
* @param {string} id - Gets the ID of the dropdown item.
|
|
110
|
+
* @param {string} name - Gets the name of the dropdown item.
|
|
111
|
+
* @param {string} iconCss - Gets the icon of the dropdown item.
|
|
112
|
+
* @param {HTMLElement} groupEle - Gets the overflow group element.
|
|
113
|
+
* @param {HTMLElement} overflowEle - Gets the overflow element.
|
|
114
|
+
* @returns {void}
|
|
115
|
+
* @hidden
|
|
116
|
+
*/
|
|
117
|
+
RibbonDropDown.prototype.createOverFlowDropDown = function (id, name, iconCss, groupEle, overflowEle) {
|
|
118
|
+
var buttonEle = this.parent.createElement('button', {
|
|
119
|
+
id: id + OVERFLOW_ID + DROPDOWN_ID
|
|
120
|
+
});
|
|
121
|
+
overflowEle.appendChild(buttonEle);
|
|
122
|
+
var dropdown = new DropDownButton({
|
|
123
|
+
iconCss: iconCss,
|
|
124
|
+
target: groupEle,
|
|
125
|
+
locale: this.parent.locale,
|
|
126
|
+
enableRtl: this.parent.enableRtl,
|
|
127
|
+
enablePersistence: this.parent.enablePersistence,
|
|
128
|
+
cssClass: VERTICAL_DDB + SPACE + RIBBON_GROUP_OVERFLOW_DDB,
|
|
129
|
+
iconPosition: 'Top',
|
|
130
|
+
content: name,
|
|
131
|
+
beforeClose: function (args) {
|
|
132
|
+
args.cancel = !isNullOrUndefined(args.event && closest(args.event.target, '.' + RIBBON_POPUP_CONTROL));
|
|
133
|
+
}
|
|
134
|
+
}, buttonEle);
|
|
135
|
+
createTooltip(groupEle, this.parent);
|
|
136
|
+
return dropdown;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Removes Overflow DropDown.
|
|
140
|
+
*
|
|
141
|
+
* @param {HTMLElement} dropdownElement - Gets the ribbon DropDown element.
|
|
142
|
+
* @returns {void}
|
|
143
|
+
* @hidden
|
|
144
|
+
*/
|
|
145
|
+
RibbonDropDown.prototype.removeOverFlowDropDown = function (dropdownElement) {
|
|
146
|
+
var dropdown = getComponent(dropdownElement, DropDownButton);
|
|
147
|
+
var tooltip = getComponent(dropdown.target, Tooltip);
|
|
148
|
+
tooltip.destroy();
|
|
149
|
+
dropdownElement.parentElement.parentElement.insertBefore(dropdown.target, dropdownElement.parentElement);
|
|
150
|
+
dropdown.destroy();
|
|
151
|
+
remove(dropdownElement);
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Gets DropDown item element.
|
|
155
|
+
*
|
|
156
|
+
* @param {HTMLElement} dropdownElement - Gets the ribbon DropDown element.
|
|
157
|
+
* @param {string} id - Gets the ID of ribbon DropDown element.
|
|
158
|
+
* @returns {HTMLElement} - Returns the DropDown item element.
|
|
159
|
+
* @hidden
|
|
160
|
+
*/
|
|
161
|
+
RibbonDropDown.prototype.getDDBItemElement = function (dropdownElement, id) {
|
|
162
|
+
var dropdown = getComponent(dropdownElement, DropDownButton);
|
|
163
|
+
var dropDownPopup = dropdown.dropDown.element;
|
|
164
|
+
return dropDownPopup.querySelector('#' + id);
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Gets Overflow DropDown Popup.
|
|
168
|
+
*
|
|
169
|
+
* @param {itemProps} itemProp - Gets the property of ribbon item.
|
|
170
|
+
* @param {HTMLElement} contentEle - Gets the content element.
|
|
171
|
+
* @returns {HTMLElement} - Returns the Overflow DropDown Popup.
|
|
172
|
+
* @hidden
|
|
173
|
+
*/
|
|
174
|
+
RibbonDropDown.prototype.getOverflowDropDownPopup = function (itemProp, contentEle) {
|
|
175
|
+
var dropdownElement = contentEle.querySelector('#' + this.parent.tabs[itemProp.tabIndex].groups[itemProp.groupIndex].id + OVERFLOW_ID + DROPDOWN_ID);
|
|
176
|
+
var dropdown = getComponent(dropdownElement, DropDownButton);
|
|
177
|
+
return dropdown.dropDown.element;
|
|
178
|
+
};
|
|
179
|
+
RibbonDropDown.prototype.getDropDownObj = function (controlId) {
|
|
180
|
+
var dropDownEle = getItemElement(this.parent, controlId);
|
|
181
|
+
return dropDownEle ? getComponent(dropDownEle, DropDownButton) : null;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Adds a new item to the menu. By default, new item appends to
|
|
185
|
+
* the list as the last item, but you can insert based on the text parameter.
|
|
186
|
+
*
|
|
187
|
+
* @param {string} controlId - Gets the control ID.
|
|
188
|
+
* @param {ItemModel[]} Items - Gets the DropDown items.
|
|
189
|
+
* @param {string} text - Gets the text of the dropdown item where the new item needs to be inserted.
|
|
190
|
+
* @returns {void}
|
|
191
|
+
*/
|
|
192
|
+
RibbonDropDown.prototype.addItems = function (controlId, Items, text) {
|
|
193
|
+
this.getDropDownObj(controlId).addItems(Items, text);
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Removes the items from the menu.
|
|
197
|
+
*
|
|
198
|
+
* @param {string} controlId - Gets the control ID.
|
|
199
|
+
* @param {string[]} Items -
|
|
200
|
+
* @param {string} isUniqueId -
|
|
201
|
+
* @returns {void}
|
|
202
|
+
*/
|
|
203
|
+
RibbonDropDown.prototype.removeItems = function (controlId, Items, isUniqueId) {
|
|
204
|
+
this.getDropDownObj(controlId).removeItems(Items, isUniqueId);
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* To open/close DropDownButton popup based on current state of the DropDownButton.
|
|
208
|
+
*
|
|
209
|
+
* @param {string} controlId - Gets the control ID.
|
|
210
|
+
* @returns {void}
|
|
211
|
+
*/
|
|
212
|
+
RibbonDropDown.prototype.toggle = function (controlId) {
|
|
213
|
+
this.getDropDownObj(controlId).toggle();
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Updates the dropdown.
|
|
217
|
+
*
|
|
218
|
+
* @param {RibbonDropDownSettingsModel} prop - Gets the dropdown property.
|
|
219
|
+
* @param {string} id - Gets the ID of dropdown.
|
|
220
|
+
* @returns {void}
|
|
221
|
+
*/
|
|
222
|
+
RibbonDropDown.prototype.updateDropDown = function (prop, id) {
|
|
223
|
+
var itemProp = getItem(this.parent.tabs, id);
|
|
224
|
+
if (!itemProp) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
merge(itemProp.item.dropDownSettings, prop);
|
|
228
|
+
var btnEle = getItemElement(this.parent, id, itemProp);
|
|
229
|
+
if (!btnEle) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
var control = getComponent(btnEle, DropDownButton);
|
|
233
|
+
if (prop.cssClass) {
|
|
234
|
+
prop.cssClass = (RIBBON_CONTROL + SPACE + ITEM_VERTICAL_CENTER + SPACE + prop.cssClass).trim();
|
|
235
|
+
prop.cssClass = itemProp.item.activeSize === RibbonItemSize.Large ?
|
|
236
|
+
(VERTICAL_DDB + SPACE + prop.cssClass).trim() : prop.cssClass;
|
|
237
|
+
control.cssClass = prop.cssClass;
|
|
238
|
+
}
|
|
239
|
+
delete prop.close;
|
|
240
|
+
if (prop.content) {
|
|
241
|
+
prop.content = itemProp.item.activeSize === RibbonItemSize.Small ? '' : prop.content;
|
|
242
|
+
}
|
|
243
|
+
control.setProperties(prop);
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* Updated DropDown size
|
|
247
|
+
*
|
|
248
|
+
* @param {HTMLElement} element - Gets the dropdown element.
|
|
249
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
250
|
+
* @returns {void}
|
|
251
|
+
* @hidden
|
|
252
|
+
*/
|
|
253
|
+
RibbonDropDown.prototype.updateDropDownSize = function (element, item) {
|
|
254
|
+
var control = getComponent(element, DropDownButton);
|
|
255
|
+
var cssClass = control.cssClass.split(SPACE);
|
|
256
|
+
if (item.activeSize === RibbonItemSize.Large) {
|
|
257
|
+
cssClass.push(VERTICAL_DDB);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
cssClass = cssClass.filter(function (value) { return value !== VERTICAL_DDB; });
|
|
261
|
+
}
|
|
262
|
+
control.cssClass = cssClass.join(SPACE);
|
|
263
|
+
control.setProperties({ iconPosition: item.activeSize === RibbonItemSize.Large ? 'Top' : 'Left' });
|
|
264
|
+
control.setProperties({ content: item.activeSize === RibbonItemSize.Small ? '' : item.dropDownSettings.content });
|
|
265
|
+
};
|
|
266
|
+
return RibbonDropDown;
|
|
267
|
+
}());
|
|
268
|
+
export { RibbonDropDown };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { DropDownButton, ItemModel } from '@syncfusion/ej2-splitbuttons';
|
|
2
|
+
import { Ribbon } from '../base/index';
|
|
3
|
+
import { RibbonSplitButtonSettingsModel, RibbonItemModel } from '../models/index';
|
|
4
|
+
/**
|
|
5
|
+
* Defines the items of Ribbon.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RibbonSplitButton {
|
|
8
|
+
private parent;
|
|
9
|
+
constructor(parent: Ribbon);
|
|
10
|
+
protected getModuleName(): string;
|
|
11
|
+
protected destroy(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Creates SplitButton.
|
|
14
|
+
*
|
|
15
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
16
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
17
|
+
* @returns {void}
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
createSplitButton(item: RibbonItemModel, itemEle: HTMLElement): void;
|
|
21
|
+
/**
|
|
22
|
+
* Adds the additional event handlers as the item moved into overflow popup.
|
|
23
|
+
*
|
|
24
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
25
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
26
|
+
* @param {DropDownButton} overflowButton - Gets the overflow button.
|
|
27
|
+
* @returns {void}
|
|
28
|
+
* @hidden
|
|
29
|
+
*/
|
|
30
|
+
addOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement, overflowButton: DropDownButton): void;
|
|
31
|
+
/**
|
|
32
|
+
* Removes the additional event handlers as the item moved from overflow popup.
|
|
33
|
+
*
|
|
34
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
35
|
+
* @param {HTMLElement} itemEle - Gets the ribbon item element.
|
|
36
|
+
* @param {DropDownButton} overflowButton - Gets the overflow button.
|
|
37
|
+
* @returns {void}
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
removeOverFlowEvents(item: RibbonItemModel, itemEle: HTMLElement): void;
|
|
41
|
+
private setContent;
|
|
42
|
+
private getSplitButtonObj;
|
|
43
|
+
/**
|
|
44
|
+
* Adds a new item to the menu. By default, new item appends to
|
|
45
|
+
* the list as the last item, but you can insert based on the text parameter.
|
|
46
|
+
*
|
|
47
|
+
* @param {string} controlId - Gets the control ID.
|
|
48
|
+
* @param {ItemModel[]} Items - Gets the SplitButton items.
|
|
49
|
+
* @param {string} text - Gets the text of the splitbutton item where the new item needs to be inserted.
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
addItems(controlId: string, Items: ItemModel[], text?: string): void;
|
|
53
|
+
/**
|
|
54
|
+
* Removes the items from the menu.
|
|
55
|
+
*
|
|
56
|
+
* @param {string} controlId - Gets the control ID.
|
|
57
|
+
* @param {string[]} Items -
|
|
58
|
+
* @param {string} isUniqueId -
|
|
59
|
+
* @returns {void}
|
|
60
|
+
*/
|
|
61
|
+
removeItems(controlId: string, Items: string[], isUniqueId?: boolean): void;
|
|
62
|
+
/**
|
|
63
|
+
* To open/close SplitButton popup based on current state of the SplitButton.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} controlId - Gets the control ID.
|
|
66
|
+
* @returns {void}
|
|
67
|
+
*/
|
|
68
|
+
toggle(controlId: string): void;
|
|
69
|
+
/**
|
|
70
|
+
* Updates the splitbutton.
|
|
71
|
+
*
|
|
72
|
+
* @param {RibbonSplitButtonSettingsModel} prop - Gets the splitbutton property.
|
|
73
|
+
* @param {string} id - Gets the ID of dropdown.
|
|
74
|
+
* @returns {void}
|
|
75
|
+
*/
|
|
76
|
+
updateSplitButton(prop: RibbonSplitButtonSettingsModel, id: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Updated SplitButton size
|
|
79
|
+
*
|
|
80
|
+
* @param {HTMLElement} element - Gets the splibutton element.
|
|
81
|
+
* @param {RibbonItemModel} item - Gets the ribbon item model.
|
|
82
|
+
* @returns {void}
|
|
83
|
+
* @hidden
|
|
84
|
+
*/
|
|
85
|
+
updateSplitButtonSize(element: HTMLElement, item: RibbonItemModel): void;
|
|
86
|
+
}
|