| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105 | 1×
1×
1×
1×
687×
1×
8338×
1×
353×
1×
156×
156×
156×
156×
156×
156×
156×
7×
5×
1×
96×
96×
96×
96×
96×
96×
96×
6×
2×
6×
5×
1×
24×
24×
24×
24×
53×
24×
24×
24×
1×
1×
4×
4×
1×
3×
3×
2×
1×
7×
7×
1×
6×
6×
6×
1×
5×
2×
5×
5×
5×
1×
1×
| define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-buttons", "../base/index"], function (require, exports, ej2_base_1, ej2_buttons_1, index_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var RibbonCheckBox = (function () {
function RibbonCheckBox(parent) {
this.parent = parent;
}
RibbonCheckBox.prototype.getModuleName = function () {
return 'ribbonCheckBox';
};
RibbonCheckBox.prototype.destroy = function () {
this.parent = null;
};
RibbonCheckBox.prototype.createCheckBox = function (item, itemEle) {
var _this = this;
var inputEle = this.parent.createElement('input', {
id: item.id
});
itemEle.appendChild(inputEle);
var checkBoxSettings = item.checkBoxSettings;
Eif (checkBoxSettings.htmlAttributes) {
Iif (checkBoxSettings.htmlAttributes.id) {
delete checkBoxSettings.htmlAttributes.id;
}
}
new ej2_buttons_1.CheckBox({
locale: this.parent.locale,
enableRtl: this.parent.enableRtl,
enablePersistence: this.parent.enablePersistence,
checked: checkBoxSettings.checked,
cssClass: (index_1.RIBBON_CONTROL + index_1.SPACE + (checkBoxSettings.cssClass ? checkBoxSettings.cssClass : '')).trim(),
label: checkBoxSettings.label,
labelPosition: checkBoxSettings.labelPosition,
disabled: item.disabled,
created: checkBoxSettings.created,
htmlAttributes: checkBoxSettings.htmlAttributes,
change: function (e) {
if (checkBoxSettings.change) {
checkBoxSettings.change.call(_this, e);
}
}
}, inputEle);
};
RibbonCheckBox.prototype.addOverFlowEvents = function (item, itemEle, overflowButton) {
var _this = this;
var inputEle = itemEle.querySelector('#' + item.id);
inputEle.setAttribute('data-control', item.type.toString());
var checkBoxObj = ej2_base_1.getComponent(inputEle, ej2_buttons_1.CheckBox);
checkBoxObj.cssClass = checkBoxObj.cssClass + index_1.SPACE + index_1.RIBBON_POPUP_CONTROL;
checkBoxObj.dataBind();
checkBoxObj.change = function (e) {
if (item.checkBoxSettings.change) {
item.checkBoxSettings.change.call(_this, e);
}
if (overflowButton.element.classList.contains('e-active')) {
overflowButton.toggle();
}
};
};
RibbonCheckBox.prototype.removeOverFlowEvents = function (item, itemEle) {
var _this = this;
var inputEle = itemEle.querySelector('#' + item.id);
var checkBoxObj = ej2_base_1.getComponent(inputEle, ej2_buttons_1.CheckBox);
var cssClass = checkBoxObj.cssClass.split(index_1.SPACE);
cssClass = cssClass.filter(function (value) { return value !== index_1.RIBBON_POPUP_CONTROL; });
checkBoxObj.cssClass = cssClass.join(index_1.SPACE);
checkBoxObj.dataBind();
checkBoxObj.change = function (e) {
Iif (item.checkBoxSettings.change) {
item.checkBoxSettings.change.call(_this, e);
}
};
};
RibbonCheckBox.prototype.click = function (controlId) {
var inputEle = index_1.getItemElement(this.parent, controlId);
if (!inputEle) {
return;
}
var checkBoxObj = ej2_base_1.getComponent(inputEle, ej2_buttons_1.CheckBox);
if (!checkBoxObj.disabled) {
checkBoxObj.click();
}
};
RibbonCheckBox.prototype.updateCheckBox = function (prop, id) {
var itemProp = index_1.getItem(this.parent.tabs, id);
if (!itemProp) {
return;
}
ej2_base_1.merge(itemProp.item.checkBoxSettings, prop);
var inputEle = index_1.getItemElement(this.parent, id, itemProp);
if (!inputEle) {
return;
}
if (prop.cssClass) {
prop.cssClass = (index_1.RIBBON_CONTROL + index_1.SPACE + prop.cssClass).trim();
}
delete prop.change;
var checkBoxObj = ej2_base_1.getComponent(inputEle, ej2_buttons_1.CheckBox);
checkBoxObj.setProperties(prop);
};
return RibbonCheckBox;
}());
exports.RibbonCheckBox = RibbonCheckBox;
});
|