jqwidgets-ng 19.0.2 → 19.0.3
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/esm2020/jqxcombobox/angular_jqxcombobox.mjs +3 -0
- package/esm2020/jqxdatatable/angular_jqxdatatable.mjs +6 -0
- package/esm2020/jqxdropdownlist/angular_jqxdropdownlist.mjs +3 -0
- package/esm2020/jqxgrid/angular_jqxgrid.mjs +6 -0
- package/esm2020/jqxlistbox/angular_jqxlistbox.mjs +3 -0
- package/esm2020/jqxtreegrid/angular_jqxtreegrid.mjs +6 -0
- package/fesm2015/jqwidgets-ng-jqxcombobox.mjs +3 -0
- package/fesm2015/jqwidgets-ng-jqxdatatable.mjs +6 -0
- package/fesm2015/jqwidgets-ng-jqxdropdownlist.mjs +3 -0
- package/fesm2015/jqwidgets-ng-jqxgrid.mjs +6 -0
- package/fesm2015/jqwidgets-ng-jqxlistbox.mjs +3 -0
- package/fesm2015/jqwidgets-ng-jqxtreegrid.mjs +6 -0
- package/fesm2020/jqwidgets-ng-jqxcombobox.mjs +3 -0
- package/fesm2020/jqwidgets-ng-jqxdatatable.mjs +6 -0
- package/fesm2020/jqwidgets-ng-jqxdropdownlist.mjs +3 -0
- package/fesm2020/jqwidgets-ng-jqxgrid.mjs +6 -0
- package/fesm2020/jqwidgets-ng-jqxlistbox.mjs +3 -0
- package/fesm2020/jqwidgets-ng-jqxtreegrid.mjs +6 -0
- package/jqwidgets/globalization/globalize.js +5 -1
- package/jqwidgets/jqx-all.js +2573 -104
- package/jqwidgets/jqxangular.js +1 -1
- package/jqwidgets/jqxbarcode.js +6 -1
- package/jqwidgets/jqxbargauge.js +1 -1
- package/jqwidgets/jqxbulletchart.js +1 -1
- package/jqwidgets/jqxbuttongroup.js +1 -1
- package/jqwidgets/jqxbuttons.js +1 -1
- package/jqwidgets/jqxcalendar.js +1 -1
- package/jqwidgets/jqxchart.annotations.js +1 -1
- package/jqwidgets/jqxchart.api.js +1 -1
- package/jqwidgets/jqxchart.core.js +1 -1
- package/jqwidgets/jqxchart.js +6 -6
- package/jqwidgets/jqxchart.rangeselector.js +1 -1
- package/jqwidgets/jqxchart.waterfall.js +1 -1
- package/jqwidgets/jqxcheckbox.js +1 -1
- package/jqwidgets/jqxcheckboxgroup.js +5 -1
- package/jqwidgets/jqxcolorpicker.js +1 -1
- package/jqwidgets/jqxcombobox.js +1 -1
- package/jqwidgets/jqxcomplexinput.js +1 -1
- package/jqwidgets/jqxcore.elements.js +1 -1
- package/jqwidgets/jqxcore.js +7 -7
- package/jqwidgets/jqxdata.export.js +1 -1
- package/jqwidgets/jqxdata.js +1 -1
- package/jqwidgets/jqxdatatable.js +1 -1
- package/jqwidgets/jqxdate.js +1 -1
- package/jqwidgets/jqxdatetimeinput.js +1 -1
- package/jqwidgets/jqxdocking.js +1 -1
- package/jqwidgets/jqxdockinglayout.js +1 -1
- package/jqwidgets/jqxdockpanel.js +1 -1
- package/jqwidgets/jqxdragdrop.js +1 -1
- package/jqwidgets/jqxdraw.js +1 -1
- package/jqwidgets/jqxdropdownbutton.js +1 -1
- package/jqwidgets/jqxdropdownlist.js +1 -1
- package/jqwidgets/jqxeditor.js +1 -1
- package/jqwidgets/jqxexpander.js +1 -1
- package/jqwidgets/jqxexport.js +6 -0
- package/jqwidgets/jqxfileupload.js +1 -1
- package/jqwidgets/jqxform.js +1 -1
- package/jqwidgets/jqxformattedinput.js +1 -1
- package/jqwidgets/jqxgantt.js +1 -1
- package/jqwidgets/jqxgauge.js +1 -1
- package/jqwidgets/jqxgrid.aggregates.js +1 -1
- package/jqwidgets/jqxgrid.chart.js +6 -1
- package/jqwidgets/jqxgrid.columnsreorder.js +1 -1
- package/jqwidgets/jqxgrid.columnsresize.js +1 -1
- package/jqwidgets/jqxgrid.edit.js +1 -1
- package/jqwidgets/jqxgrid.export.js +1 -1
- package/jqwidgets/jqxgrid.filter.js +1 -1
- package/jqwidgets/jqxgrid.grouping.js +1 -1
- package/jqwidgets/jqxgrid.js +1 -1
- package/jqwidgets/jqxgrid.pager.js +1 -1
- package/jqwidgets/jqxgrid.selection.js +1 -1
- package/jqwidgets/jqxgrid.sort.js +1 -1
- package/jqwidgets/jqxgrid.storage.js +1 -1
- package/jqwidgets/jqxheatmap.js +1 -1
- package/jqwidgets/jqximport.js +6 -0
- package/jqwidgets/jqxinput.js +1 -1
- package/jqwidgets/jqxkanban.js +1 -1
- package/jqwidgets/jqxknob.js +1 -1
- package/jqwidgets/jqxlayout.js +1 -1
- package/jqwidgets/jqxlistbox.js +1 -1
- package/jqwidgets/jqxlistmenu.js +1 -1
- package/jqwidgets/jqxloader.js +1 -1
- package/jqwidgets/jqxmaskedinput.js +1 -1
- package/jqwidgets/jqxmaterialcolorpicker.js +6 -0
- package/jqwidgets/jqxmenu.js +1 -1
- package/jqwidgets/jqxnavbar.js +1 -1
- package/jqwidgets/jqxnavigationbar.js +1 -1
- package/jqwidgets/jqxnotification.js +1 -1
- package/jqwidgets/jqxnumberinput.js +1 -1
- package/jqwidgets/jqxpanel.js +1 -1
- package/jqwidgets/jqxpasswordinput.js +1 -1
- package/jqwidgets/jqxpivot.js +1 -1
- package/jqwidgets/jqxpivotdesigner.js +1 -1
- package/jqwidgets/jqxpivotgrid.js +1 -1
- package/jqwidgets/jqxpopover.js +1 -1
- package/jqwidgets/jqxprogressbar.js +1 -1
- package/jqwidgets/jqxqrcode.js +6 -1
- package/jqwidgets/jqxradiobutton.js +1 -1
- package/jqwidgets/jqxradiobuttongroup.js +6 -1
- package/jqwidgets/jqxrangeselector.js +1 -1
- package/jqwidgets/jqxrating.js +1 -1
- package/jqwidgets/jqxresponse.js +1 -1
- package/jqwidgets/jqxresponsivepanel.js +1 -1
- package/jqwidgets/jqxribbon.js +1 -1
- package/jqwidgets/jqxrichtextarea.js +6 -1
- package/jqwidgets/jqxscheduler.api.js +1 -1
- package/jqwidgets/jqxscheduler.js +1 -1
- package/jqwidgets/jqxscrollbar.js +1 -1
- package/jqwidgets/jqxscrollview.js +1 -1
- package/jqwidgets/jqxslider.js +1 -1
- package/jqwidgets/jqxsortable.js +1 -1
- package/jqwidgets/jqxsplitlayout.js +2107 -2170
- package/jqwidgets/jqxsplitter.js +1 -1
- package/jqwidgets/jqxswitchbutton.js +1 -1
- package/jqwidgets/jqxtabs.js +1 -1
- package/jqwidgets/jqxtagcloud.js +1 -1
- package/jqwidgets/jqxtextarea.js +1 -1
- package/jqwidgets/jqxtimepicker.js +1 -1
- package/jqwidgets/jqxtoolbar.js +1 -1
- package/jqwidgets/jqxtooltip.js +1 -1
- package/jqwidgets/jqxtouch.js +1 -1
- package/jqwidgets/jqxtree.js +1 -1
- package/jqwidgets/jqxtreegrid.js +1 -1
- package/jqwidgets/jqxtreemap.js +1 -1
- package/jqwidgets/jqxvalidator.js +1 -1
- package/jqwidgets/jqxwindow.js +1 -1
- package/package.json +1 -1
|
@@ -1,2513 +1,2450 @@
|
|
|
1
|
-
/*
|
|
2
|
-
jQWidgets v19.0.0 (2024-Feb)
|
|
3
|
-
Copyright (c) 2011-2024 jQWidgets.
|
|
4
|
-
License: https://jqwidgets.com/license/
|
|
5
|
-
*/
|
|
1
|
+
/* tslint:disable */
|
|
6
2
|
/* eslint-disable */
|
|
3
|
+
(function(){if(typeof document==="undefined"){return}
|
|
4
|
+
if (!window.JQX) {
|
|
5
|
+
window.JQX = {
|
|
6
|
+
Utilities: {
|
|
7
|
+
Core: {
|
|
8
|
+
isMobile() {
|
|
9
|
+
var isMobile = /(iphone|ipod|ipad|android|iemobile|blackberry|bada)/.test(window.navigator.userAgent.toLowerCase());
|
|
10
|
+
var iOS = function () {
|
|
11
|
+
return [
|
|
12
|
+
'iPad Simulator',
|
|
13
|
+
'iPhone Simulator',
|
|
14
|
+
'iPod Simulator',
|
|
15
|
+
'iPad',
|
|
16
|
+
'iPhone',
|
|
17
|
+
'iPod'
|
|
18
|
+
].includes(navigator.platform)
|
|
19
|
+
// iPad on iOS 13 detection
|
|
20
|
+
|| (navigator.userAgent.includes('Mac') && 'ontouchend' in document)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!isMobile) {
|
|
24
|
+
return iOS();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return isMobile;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
7
33
|
|
|
8
|
-
/* eslint-disable */
|
|
9
34
|
|
|
10
|
-
|
|
35
|
+
class LayoutItem extends HTMLElement {
|
|
36
|
+
constructor() {
|
|
37
|
+
super();
|
|
11
38
|
|
|
12
|
-
|
|
39
|
+
this._properties = {
|
|
40
|
+
'min': 50,
|
|
41
|
+
'label': 'Item',
|
|
42
|
+
'modifiers': ['resize', 'drag', 'close'],
|
|
43
|
+
'size': null
|
|
44
|
+
}
|
|
45
|
+
}
|
|
13
46
|
|
|
14
|
-
|
|
47
|
+
_setProperty(property, value) {
|
|
48
|
+
var that = this;
|
|
15
49
|
|
|
16
|
-
|
|
50
|
+
if (that._properties[property] === value) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
17
53
|
|
|
18
|
-
|
|
54
|
+
that._properties[property] = value;
|
|
55
|
+
that._updating = true;
|
|
19
56
|
|
|
20
|
-
|
|
57
|
+
if (property === 'disabled' || property === 'modifiers') {
|
|
58
|
+
if (value) {
|
|
59
|
+
that.setAttribute(property, value);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
that.removeAttribute(property);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
if (value === null) {
|
|
67
|
+
that.removeAttribute(property);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
that.setAttribute(property, value);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
21
73
|
|
|
22
|
-
|
|
74
|
+
if (!that.isCompleted) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
23
77
|
|
|
24
|
-
|
|
78
|
+
var layout = that.closest('jqx-layout');
|
|
25
79
|
|
|
26
|
-
|
|
80
|
+
if (layout) {
|
|
81
|
+
if (!layout._resizeDetails && !layout._updating && layout.isRendered) {
|
|
82
|
+
layout.refresh();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
that._updating = false;
|
|
86
|
+
}
|
|
27
87
|
|
|
28
|
-
|
|
88
|
+
get label() {
|
|
89
|
+
return this._properties['label'];
|
|
90
|
+
}
|
|
29
91
|
|
|
30
|
-
|
|
92
|
+
set label(value) {
|
|
93
|
+
this._setProperty('label', value);
|
|
94
|
+
}
|
|
31
95
|
|
|
32
|
-
|
|
96
|
+
get modifiers() {
|
|
97
|
+
return this._properties['modifiers'];
|
|
98
|
+
}
|
|
33
99
|
|
|
34
|
-
|
|
100
|
+
set modifiers(value) {
|
|
101
|
+
this._setProperty('modifiers', value);
|
|
102
|
+
}
|
|
35
103
|
|
|
36
|
-
|
|
104
|
+
get min() {
|
|
105
|
+
return this._properties['min'];
|
|
106
|
+
}
|
|
37
107
|
|
|
38
|
-
|
|
108
|
+
set min(value) {
|
|
109
|
+
this._setProperty('min', value);
|
|
110
|
+
}
|
|
39
111
|
|
|
40
|
-
|
|
112
|
+
get size() {
|
|
113
|
+
return this._properties['size'];
|
|
114
|
+
}
|
|
41
115
|
|
|
42
|
-
|
|
116
|
+
set size(value) {
|
|
117
|
+
if (value !== null) {
|
|
118
|
+
if (typeof value === 'string') {
|
|
119
|
+
this._setProperty('size', value);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
this._setProperty('size', Math.max(this.min, value));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this._setProperty('size', value);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
43
129
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Utilities: {
|
|
48
|
-
Core: {
|
|
49
|
-
isMobile: function isMobile() {
|
|
50
|
-
var isMobile = /(iphone|ipod|ipad|android|iemobile|blackberry|bada)/.test(window.navigator.userAgent.toLowerCase());
|
|
130
|
+
static get observedAttributes() {
|
|
131
|
+
return ['min', 'size', 'label', 'modifiers'];
|
|
132
|
+
}
|
|
51
133
|
|
|
52
|
-
var iOS = function iOS() {
|
|
53
|
-
return ['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(navigator.platform) // iPad on iOS 13 detection
|
|
54
|
-
|| navigator.userAgent.includes('Mac') && 'ontouchend' in document;
|
|
55
|
-
};
|
|
56
134
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
135
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
136
|
+
var that = this;
|
|
60
137
|
|
|
61
|
-
|
|
138
|
+
if (oldValue === newValue) {
|
|
139
|
+
return;
|
|
62
140
|
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
141
|
|
|
68
|
-
|
|
69
|
-
"use strict";
|
|
70
|
-
|
|
71
|
-
_inherits(LayoutItem, _HTMLElement);
|
|
72
|
-
|
|
73
|
-
var _super = _createSuper(LayoutItem);
|
|
74
|
-
|
|
75
|
-
function LayoutItem() {
|
|
76
|
-
var _this;
|
|
77
|
-
|
|
78
|
-
_classCallCheck(this, LayoutItem);
|
|
79
|
-
|
|
80
|
-
_this = _super.call(this);
|
|
81
|
-
_this._properties = {
|
|
82
|
-
'min': 50,
|
|
83
|
-
'label': 'Item',
|
|
84
|
-
'modifiers': ['resize', 'drag', 'close'],
|
|
85
|
-
'size': null
|
|
86
|
-
};
|
|
87
|
-
return _this;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
_createClass(LayoutItem, [{
|
|
91
|
-
key: "_setProperty",
|
|
92
|
-
value: function _setProperty(property, value) {
|
|
93
|
-
var that = this;
|
|
94
|
-
|
|
95
|
-
if (that._properties[property] === value) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
that._properties[property] = value;
|
|
100
|
-
that._updating = true;
|
|
101
|
-
|
|
102
|
-
if (property === 'disabled' || property === 'modifiers') {
|
|
103
|
-
if (value) {
|
|
104
|
-
that.setAttribute(property, value);
|
|
105
|
-
} else {
|
|
106
|
-
that.removeAttribute(property);
|
|
107
|
-
}
|
|
108
|
-
} else {
|
|
109
|
-
if (value === null) {
|
|
110
|
-
that.removeAttribute(property);
|
|
111
|
-
} else {
|
|
112
|
-
that.setAttribute(property, value);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (!that.isCompleted) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
var layout = that.closest('jqx-layout');
|
|
121
|
-
|
|
122
|
-
if (layout) {
|
|
123
|
-
if (!layout._resizeDetails && !layout._updating && layout.isRendered) {
|
|
124
|
-
layout.refresh();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
that._updating = false;
|
|
129
|
-
}
|
|
130
|
-
}, {
|
|
131
|
-
key: "label",
|
|
132
|
-
get: function get() {
|
|
133
|
-
return this._properties['label'];
|
|
134
|
-
},
|
|
135
|
-
set: function set(value) {
|
|
136
|
-
this._setProperty('label', value);
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
key: "modifiers",
|
|
140
|
-
get: function get() {
|
|
141
|
-
return this._properties['modifiers'];
|
|
142
|
-
},
|
|
143
|
-
set: function set(value) {
|
|
144
|
-
this._setProperty('modifiers', value);
|
|
145
|
-
}
|
|
146
|
-
}, {
|
|
147
|
-
key: "min",
|
|
148
|
-
get: function get() {
|
|
149
|
-
return this._properties['min'];
|
|
150
|
-
},
|
|
151
|
-
set: function set(value) {
|
|
152
|
-
this._setProperty('min', value);
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "size",
|
|
156
|
-
get: function get() {
|
|
157
|
-
return this._properties['size'];
|
|
158
|
-
},
|
|
159
|
-
set: function set(value) {
|
|
160
|
-
if (value !== null) {
|
|
161
|
-
if (typeof value === 'string') {
|
|
162
|
-
this._setProperty('size', value);
|
|
163
|
-
} else {
|
|
164
|
-
this._setProperty('size', Math.max(this.min, value));
|
|
165
|
-
}
|
|
166
|
-
} else {
|
|
167
|
-
this._setProperty('size', value);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}, {
|
|
171
|
-
key: "attributeChangedCallback",
|
|
172
|
-
value: function attributeChangedCallback(name, oldValue, newValue) {
|
|
173
|
-
var that = this;
|
|
174
|
-
|
|
175
|
-
if (oldValue === newValue) {
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (!that.isCompleted) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (name === 'size') {
|
|
184
|
-
if (!that._updating) {
|
|
185
|
-
if (newValue === null) {
|
|
186
|
-
this[name] = null;
|
|
142
|
+
if (!that.isCompleted) {
|
|
187
143
|
return;
|
|
188
|
-
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (name === 'size') {
|
|
147
|
+
if (!that._updating) {
|
|
148
|
+
if (newValue === null) {
|
|
149
|
+
this[name] = null;
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
189
152
|
|
|
190
|
-
|
|
153
|
+
that[name] = Math.max(that.min, parseInt(newValue));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
that[name] = newValue;
|
|
191
158
|
}
|
|
192
|
-
} else {
|
|
193
|
-
that[name] = newValue;
|
|
194
|
-
}
|
|
195
159
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
160
|
+
|
|
161
|
+
connectedCallback() {
|
|
162
|
+
if (!this.isCompleted) {
|
|
163
|
+
this.render();
|
|
164
|
+
}
|
|
202
165
|
}
|
|
203
|
-
}, {
|
|
204
|
-
key: "whenRendered",
|
|
205
|
-
value: function whenRendered(callback) {
|
|
206
|
-
var that = this;
|
|
207
166
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
167
|
+
whenRendered(callback) {
|
|
168
|
+
var that = this;
|
|
169
|
+
|
|
170
|
+
if (that.isRendered) {
|
|
171
|
+
callback();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
212
174
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
175
|
+
if (!that.whenRenderedCallbacks) {
|
|
176
|
+
that.whenRenderedCallbacks = [];
|
|
177
|
+
}
|
|
216
178
|
|
|
217
|
-
|
|
179
|
+
that.whenRenderedCallbacks.push(callback);
|
|
218
180
|
}
|
|
219
|
-
}, {
|
|
220
|
-
key: "render",
|
|
221
|
-
value: function render() {
|
|
222
|
-
var that = this;
|
|
223
181
|
|
|
224
|
-
|
|
225
|
-
that
|
|
226
|
-
|
|
182
|
+
render() {
|
|
183
|
+
var that = this;
|
|
184
|
+
|
|
185
|
+
if (!that.hasAttribute('data-id')) {
|
|
186
|
+
that.setAttribute('data-id', 'id' + Math.random().toString(16).slice(2));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (!that.hasAttribute('label')) {
|
|
190
|
+
that.setAttribute('label', that.label);
|
|
191
|
+
}
|
|
227
192
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
193
|
+
if (!that.hasAttribute('min')) {
|
|
194
|
+
that.setAttribute('min', that.min);
|
|
195
|
+
}
|
|
231
196
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
197
|
+
if (!that.hasAttribute('label')) {
|
|
198
|
+
that.setAttribute('label', that.label);
|
|
199
|
+
}
|
|
235
200
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
201
|
+
if (!that.hasAttribute('modifiers')) {
|
|
202
|
+
that.setAttribute('modifiers', that.modifiers);
|
|
203
|
+
}
|
|
239
204
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
205
|
+
for (var i = 0; i < that.attributes.length; i++) {
|
|
206
|
+
var attribute = that.attributes[i];
|
|
207
|
+
var attributeName = attribute.name;
|
|
208
|
+
var attributeValue = attribute.value;
|
|
243
209
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
210
|
+
if (!isNaN(attributeValue) && (attributeName === 'min' || attributeName === 'size')) {
|
|
211
|
+
that._properties[attributeName] = parseInt(attributeValue);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
248
214
|
|
|
249
|
-
|
|
250
|
-
that._properties[attributeName] = parseInt(attributeValue);
|
|
251
|
-
continue;
|
|
215
|
+
that._properties[attributeName] = attributeValue;
|
|
252
216
|
}
|
|
253
217
|
|
|
254
|
-
that.
|
|
255
|
-
|
|
218
|
+
that.classList.add('jqx-layout-item');
|
|
219
|
+
|
|
220
|
+
that.isCompleted = true;
|
|
256
221
|
|
|
257
|
-
|
|
258
|
-
|
|
222
|
+
if (that.whenRenderedCallbacks) {
|
|
223
|
+
for (var i = 0; i < that.whenRenderedCallbacks.length; i++) {
|
|
224
|
+
that.whenRenderedCallbacks[i]();
|
|
225
|
+
}
|
|
259
226
|
|
|
260
|
-
|
|
261
|
-
for (var i = 0; i < that.whenRenderedCallbacks.length; i++) {
|
|
262
|
-
that.whenRenderedCallbacks[i]();
|
|
227
|
+
that.whenRenderedCallbacks = [];
|
|
263
228
|
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
class LayoutGroup extends LayoutItem {
|
|
233
|
+
constructor() {
|
|
234
|
+
super();
|
|
264
235
|
|
|
265
|
-
|
|
266
|
-
|
|
236
|
+
this._properties['label'] = 'Group';
|
|
237
|
+
this._properties['orientation'] = 'vertical'
|
|
267
238
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
239
|
+
|
|
240
|
+
get orientation() {
|
|
241
|
+
return this._properties.orientation;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
set orientation(value) {
|
|
245
|
+
this._setProperty('orientation', value);
|
|
272
246
|
}
|
|
273
|
-
}]);
|
|
274
247
|
|
|
275
|
-
|
|
276
|
-
|
|
248
|
+
static get observedAttributes() {
|
|
249
|
+
return ['min', 'size', 'modifiers', 'orientation', 'position'];
|
|
250
|
+
}
|
|
277
251
|
|
|
278
|
-
|
|
279
|
-
|
|
252
|
+
render() {
|
|
253
|
+
var that = this;
|
|
280
254
|
|
|
281
|
-
|
|
255
|
+
super.render();
|
|
282
256
|
|
|
283
|
-
|
|
257
|
+
that.className = 'jqx-layout-group';
|
|
284
258
|
|
|
285
|
-
|
|
286
|
-
|
|
259
|
+
if (!that.hasAttribute('orientation')) {
|
|
260
|
+
that.setAttribute('orientation', that._properties['orientation']);
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
that._properties['orientation'] = that.getAttribute('orientation');
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
287
267
|
|
|
288
|
-
|
|
268
|
+
class TabLayoutGroup extends LayoutGroup {
|
|
269
|
+
constructor() {
|
|
270
|
+
super();
|
|
271
|
+
this._properties['position'] = 'top'
|
|
272
|
+
this._properties['label'] = 'TabGroup';
|
|
273
|
+
}
|
|
289
274
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
return _this2;
|
|
294
|
-
}
|
|
275
|
+
get position() {
|
|
276
|
+
return this._properties.position;
|
|
277
|
+
}
|
|
295
278
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
get: function get() {
|
|
299
|
-
return this._properties.orientation;
|
|
300
|
-
},
|
|
301
|
-
set: function set(value) {
|
|
302
|
-
this._setProperty('orientation', value);
|
|
279
|
+
set position(value) {
|
|
280
|
+
this._setProperty('position', value);
|
|
303
281
|
}
|
|
304
|
-
}, {
|
|
305
|
-
key: "render",
|
|
306
|
-
value: function render() {
|
|
307
|
-
var that = this;
|
|
308
282
|
|
|
309
|
-
|
|
283
|
+
render() {
|
|
284
|
+
var that = this;
|
|
310
285
|
|
|
311
|
-
|
|
286
|
+
super.render();
|
|
287
|
+
|
|
288
|
+
if (!that.hasAttribute('position') && that.position) {
|
|
289
|
+
that.setAttribute('position', 'top');
|
|
290
|
+
}
|
|
291
|
+
}
|
|
312
292
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
} else {
|
|
316
|
-
that._properties['orientation'] = that.getAttribute('orientation');
|
|
317
|
-
}
|
|
293
|
+
static get observedAttributes() {
|
|
294
|
+
return ['min', 'size', 'modifiers', 'orientation', 'position'];
|
|
318
295
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
class TabLayoutItem extends LayoutGroup {
|
|
299
|
+
constructor() {
|
|
300
|
+
super();
|
|
301
|
+
this._properties['label'] = 'TabItem';
|
|
323
302
|
}
|
|
324
|
-
|
|
303
|
+
}
|
|
325
304
|
|
|
326
|
-
return LayoutGroup;
|
|
327
|
-
}(LayoutItem);
|
|
328
305
|
|
|
329
|
-
|
|
330
|
-
|
|
306
|
+
(function ($) {
|
|
307
|
+
"use strict";
|
|
308
|
+
$.jqx.jqxWidget("jqxSplitLayout", "", {});
|
|
309
|
+
|
|
310
|
+
$.extend($.jqx._jqxSplitLayout.prototype, {
|
|
311
|
+
defineInstance: function () {
|
|
312
|
+
var settings = {
|
|
313
|
+
'dataSource': null,
|
|
314
|
+
'ready': null,
|
|
315
|
+
'orientation': 'vertical'
|
|
316
|
+
};
|
|
331
317
|
|
|
332
|
-
|
|
318
|
+
if (this === $.jqx._jqxSplitLayout.prototype) {
|
|
319
|
+
return settings;
|
|
320
|
+
}
|
|
333
321
|
|
|
334
|
-
|
|
322
|
+
$.extend(true, this, settings);
|
|
323
|
+
return settings;
|
|
324
|
+
},
|
|
335
325
|
|
|
336
|
-
|
|
337
|
-
|
|
326
|
+
createInstance: function () {
|
|
327
|
+
var that = this;
|
|
328
|
+
this._properties = {
|
|
329
|
+
'dataSource': null,
|
|
330
|
+
'ready': null,
|
|
331
|
+
'orientation': 'vertical'
|
|
332
|
+
}
|
|
338
333
|
|
|
339
|
-
|
|
334
|
+
var that = this;
|
|
340
335
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
336
|
+
that.layout = document.createElement('jqx-split-layout');
|
|
337
|
+
that.layout.style.width = '100%';
|
|
338
|
+
that.layout.style.height = '100%';
|
|
339
|
+
that.element.className += that.toThemeProperty("jqx-split-layout-component jqx-rc-all jqx-widget");
|
|
340
|
+
that.layout.dataSource = that.dataSource;
|
|
341
|
+
that.layout.orientation = that.orientation;
|
|
342
|
+
that.layout.ready = that.ready;
|
|
343
|
+
that.element.appendChild(that.layout);
|
|
344
|
+
},
|
|
346
345
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
get: function get() {
|
|
350
|
-
return this._properties.position;
|
|
351
|
-
},
|
|
352
|
-
set: function set(value) {
|
|
353
|
-
this._setProperty('position', value);
|
|
354
|
-
}
|
|
355
|
-
}, {
|
|
356
|
-
key: "render",
|
|
357
|
-
value: function render() {
|
|
358
|
-
var that = this;
|
|
346
|
+
propertyChangedHandler: function (object, key, oldValue, value) {
|
|
347
|
+
var that = object;
|
|
359
348
|
|
|
360
|
-
|
|
349
|
+
if (oldValue != value || value instanceof Object) {
|
|
350
|
+
if (!that.layout) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
361
353
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
}], [{
|
|
367
|
-
key: "observedAttributes",
|
|
368
|
-
get: function get() {
|
|
369
|
-
return ['min', 'size', 'modifiers', 'orientation', 'position'];
|
|
370
|
-
}
|
|
371
|
-
}]);
|
|
354
|
+
that.layout[key] = value;
|
|
355
|
+
}
|
|
356
|
+
},
|
|
372
357
|
|
|
373
|
-
|
|
374
|
-
|
|
358
|
+
render: function () {
|
|
359
|
+
var that = this;
|
|
375
360
|
|
|
376
|
-
|
|
377
|
-
|
|
361
|
+
if (!that.layout) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
378
364
|
|
|
379
|
-
|
|
365
|
+
that.layout.render();
|
|
366
|
+
},
|
|
380
367
|
|
|
381
|
-
|
|
368
|
+
refresh() {
|
|
369
|
+
var that = this;
|
|
382
370
|
|
|
383
|
-
|
|
384
|
-
|
|
371
|
+
if (!that.layout) {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
385
374
|
|
|
386
|
-
|
|
375
|
+
if (!that.layout.isRendered) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
387
378
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
return _this4;
|
|
391
|
-
}
|
|
379
|
+
that.layout.refresh();
|
|
380
|
+
},
|
|
392
381
|
|
|
393
|
-
|
|
394
|
-
|
|
382
|
+
dataBind() {
|
|
383
|
+
var that = this;
|
|
395
384
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
$.jqx.jqxWidget("jqxSplitLayout", "", {});
|
|
400
|
-
$.extend($.jqx._jqxSplitLayout.prototype, {
|
|
401
|
-
defineInstance: function defineInstance() {
|
|
402
|
-
var settings = {
|
|
403
|
-
'dataSource': null,
|
|
404
|
-
'ready': null,
|
|
405
|
-
'orientation': 'vertical'
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
if (this === $.jqx._jqxSplitLayout.prototype) {
|
|
409
|
-
return settings;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
$.extend(true, this, settings);
|
|
413
|
-
return settings;
|
|
414
|
-
},
|
|
415
|
-
createInstance: function createInstance() {
|
|
416
|
-
var that = this;
|
|
417
|
-
this._properties = {
|
|
418
|
-
'dataSource': null,
|
|
419
|
-
'ready': null,
|
|
420
|
-
'orientation': 'vertical'
|
|
421
|
-
};
|
|
422
|
-
var that = this;
|
|
423
|
-
that.layout = document.createElement('jqx-split-layout');
|
|
424
|
-
that.layout.style.width = '100%';
|
|
425
|
-
that.layout.style.height = '100%';
|
|
426
|
-
that.element.className += that.toThemeProperty("jqx-split-layout-component jqx-rc-all jqx-widget");
|
|
427
|
-
that.layout.dataSource = that.dataSource;
|
|
428
|
-
that.layout.orientation = that.orientation;
|
|
429
|
-
that.layout.ready = that.ready;
|
|
430
|
-
that.element.appendChild(that.layout);
|
|
431
|
-
},
|
|
432
|
-
propertyChangedHandler: function propertyChangedHandler(object, key, oldValue, value) {
|
|
433
|
-
var that = object;
|
|
434
|
-
|
|
435
|
-
if (oldValue != value || value instanceof Object) {
|
|
436
|
-
if (!that.layout) {
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
that.layout[key] = value;
|
|
441
|
-
}
|
|
442
|
-
},
|
|
443
|
-
render: function render() {
|
|
444
|
-
var that = this;
|
|
445
|
-
|
|
446
|
-
if (!that.layout) {
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
that.layout.render();
|
|
451
|
-
},
|
|
452
|
-
refresh: function refresh() {
|
|
453
|
-
var that = this;
|
|
454
|
-
|
|
455
|
-
if (!that.layout) {
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
if (!that.layout.isRendered) {
|
|
460
|
-
return;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
that.layout.refresh();
|
|
464
|
-
},
|
|
465
|
-
dataBind: function dataBind() {
|
|
466
|
-
var that = this;
|
|
467
|
-
|
|
468
|
-
if (!that.layout) {
|
|
469
|
-
return;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
that.layout.dataBind();
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
})(jqxBaseFramework);
|
|
385
|
+
if (!that.layout) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
476
388
|
|
|
477
|
-
|
|
478
|
-
|
|
389
|
+
that.layout.dataBind();
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
})(jqxBaseFramework);
|
|
479
393
|
|
|
480
|
-
|
|
394
|
+
class SplitLayout extends HTMLElement {
|
|
395
|
+
constructor() {
|
|
396
|
+
super();
|
|
481
397
|
|
|
482
|
-
|
|
398
|
+
this._properties = {
|
|
399
|
+
'dataSource': null,
|
|
400
|
+
'orientation': 'vertical'
|
|
401
|
+
}
|
|
402
|
+
}
|
|
483
403
|
|
|
484
|
-
function SplitLayout() {
|
|
485
|
-
var _this5;
|
|
486
404
|
|
|
487
|
-
|
|
405
|
+
get orientation() {
|
|
406
|
+
return this._properties['orientation'];
|
|
407
|
+
}
|
|
488
408
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
'orientation': 'vertical'
|
|
493
|
-
};
|
|
494
|
-
return _this5;
|
|
495
|
-
}
|
|
409
|
+
set orientation(value) {
|
|
410
|
+
this._properties['orientation'] = value;
|
|
411
|
+
}
|
|
496
412
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
get: function get() {
|
|
500
|
-
return this._properties['orientation'];
|
|
501
|
-
},
|
|
502
|
-
set: function set(value) {
|
|
503
|
-
this._properties['orientation'] = value;
|
|
413
|
+
get dataSource() {
|
|
414
|
+
return this._properties['dataSource'];
|
|
504
415
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
return this._properties['dataSource'];
|
|
509
|
-
},
|
|
510
|
-
set: function set(value) {
|
|
511
|
-
this._properties['dataSource'] = value;
|
|
416
|
+
|
|
417
|
+
set dataSource(value) {
|
|
418
|
+
this._properties['dataSource'] = value;
|
|
512
419
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
_dragStart(event) {
|
|
423
|
+
event.stopPropagation();
|
|
424
|
+
event.preventDefault();
|
|
518
425
|
}
|
|
519
|
-
}, {
|
|
520
|
-
key: "_leaveHandler",
|
|
521
|
-
value: function _leaveHandler() {
|
|
522
|
-
var that = this;
|
|
523
426
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}
|
|
427
|
+
_leaveHandler() {
|
|
428
|
+
var that = this;
|
|
527
429
|
|
|
528
|
-
|
|
430
|
+
if (that._resizeDetails) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
529
433
|
|
|
530
|
-
|
|
434
|
+
that._handleButtonsVisibility(null);
|
|
435
|
+
that._hideSplitter();
|
|
531
436
|
|
|
532
|
-
|
|
533
|
-
|
|
437
|
+
requestAnimationFrame(function () {
|
|
438
|
+
// that.classList.remove('outline');
|
|
439
|
+
})
|
|
534
440
|
}
|
|
535
|
-
}, {
|
|
536
|
-
key: "_enterHandler",
|
|
537
|
-
value: function _enterHandler() {
|
|
538
|
-
var that = this;
|
|
539
441
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
442
|
+
_enterHandler() {
|
|
443
|
+
var that = this;
|
|
444
|
+
|
|
445
|
+
if (that._resizeDetails) {
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
543
448
|
|
|
544
|
-
|
|
449
|
+
that._handleButtonsVisibility(that._selectedItem);
|
|
545
450
|
|
|
546
|
-
|
|
451
|
+
that._updateSplitter();
|
|
547
452
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
453
|
+
requestAnimationFrame(function () {
|
|
454
|
+
that.classList.add('outline');
|
|
455
|
+
})
|
|
551
456
|
}
|
|
457
|
+
|
|
552
458
|
/**
|
|
553
459
|
* Element's HTML template.
|
|
554
460
|
*/
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
key: "template",
|
|
558
|
-
value: function template() {
|
|
559
|
-
return '<div class="jqx-container" id="container" role="presentation"><jqx-layout-group data-id="root" id="itemsContainer"></jqx-layout-group><div root-splitter id="splitter" class="jqx-layout-splitter"></div>';
|
|
461
|
+
template() {
|
|
462
|
+
return '<div class="jqx-container" id="container" role="presentation"><jqx-layout-group data-id="root" id="itemsContainer"></jqx-layout-group><div root-splitter id="splitter" class="jqx-layout-splitter"></div>';
|
|
560
463
|
}
|
|
464
|
+
|
|
561
465
|
/**
|
|
562
466
|
* Updates the element when a property is changed.
|
|
563
467
|
* @param {string} propertyName The name of the property.
|
|
564
468
|
* @param {number/string} oldValue The previously entered value. Max, min and value are of type Number. The rest are of type String.
|
|
565
469
|
* @param {number/string} newValue The new entered value. Max, min and value are of type Number. The rest are of type String.
|
|
566
470
|
*/
|
|
471
|
+
propertyChangedHandler(propertyName, oldValue, newValue) {
|
|
472
|
+
var that = this;
|
|
473
|
+
|
|
474
|
+
switch (propertyName) {
|
|
475
|
+
case 'orientation':
|
|
476
|
+
if (that.$.itemsContainer) {
|
|
477
|
+
that.$.itemsContainer.orientation = that.orientation;
|
|
478
|
+
}
|
|
479
|
+
break;
|
|
480
|
+
case 'dataSource':
|
|
481
|
+
that.dataBind();
|
|
482
|
+
break;
|
|
483
|
+
case 'selectedIndex':
|
|
484
|
+
that._handleItemClick(that.getItem(newValue + ''), true);
|
|
485
|
+
break;
|
|
486
|
+
default:
|
|
487
|
+
super.propertyChangedHandler(propertyName, oldValue, newValue);
|
|
488
|
+
break;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
567
491
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
value: function propertyChangedHandler(propertyName, oldValue, newValue) {
|
|
571
|
-
var that = this;
|
|
492
|
+
dataBind() {
|
|
493
|
+
var that = this;
|
|
572
494
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
} else {
|
|
653
|
-
var content = item.content || '';
|
|
654
|
-
|
|
655
|
-
if (isTabLayoutGroup) {
|
|
656
|
-
template += "<jqx-tab-layout-item ".concat(props, ">") + content + '</jqx-tab-layout-item>';
|
|
657
|
-
} else {
|
|
658
|
-
if (type === 'tabs') {
|
|
659
|
-
template += "<jqx-tab-layout-group>";
|
|
660
|
-
template += "<jqx-tab-layout-item ".concat(props, ">") + content + '</jqx-tab-layout-item>';
|
|
661
|
-
template += '</jqx-tab-layout-group>';
|
|
662
|
-
} else {
|
|
663
|
-
template += "<jqx-layout-item ".concat(props, ">") + content + '</jqx-layout-item>';
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
};
|
|
669
|
-
|
|
670
|
-
processDataSource(that.dataSource);
|
|
671
|
-
that.$.itemsContainer.innerHTML = template;
|
|
672
|
-
that.refresh();
|
|
495
|
+
that.$.itemsContainer.innerHTML = '';
|
|
496
|
+
|
|
497
|
+
var template = '';
|
|
498
|
+
var processDataSource = function (dataSource, isTabLayoutGroup) {
|
|
499
|
+
for (var i = 0; i < dataSource.length; i++) {
|
|
500
|
+
var item = dataSource[i];
|
|
501
|
+
|
|
502
|
+
var size = item.size;
|
|
503
|
+
var min = item.min;
|
|
504
|
+
var modifiers = item.modifiers;
|
|
505
|
+
var type = item.type;
|
|
506
|
+
var position = item.position;
|
|
507
|
+
var orientation = item.orientation ? item.orientation : 'vertical';
|
|
508
|
+
var id = item.id;
|
|
509
|
+
var label = item.label;
|
|
510
|
+
|
|
511
|
+
var props = '';
|
|
512
|
+
|
|
513
|
+
if (id !== undefined) {
|
|
514
|
+
props += `id="${id}" `
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (size !== undefined) {
|
|
518
|
+
props += `size="${size}" `
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
if (label !== undefined) {
|
|
522
|
+
props += `label="${label}" `
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
if (min !== undefined) {
|
|
527
|
+
props += `min="${min}" `
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
if (modifiers !== undefined) {
|
|
531
|
+
props += `modifiers="${modifiers}" `
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
if (position !== undefined) {
|
|
535
|
+
props += `position="${position}" `
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
if (item.items) {
|
|
539
|
+
props += `orientation=${orientation} `
|
|
540
|
+
|
|
541
|
+
if (type === 'tabs') {
|
|
542
|
+
template += `<jqx-tab-layout-group ${props}>`;
|
|
543
|
+
processDataSource(item.items, true);
|
|
544
|
+
template += '</jqx-tab-layout-group>'
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
template += `<jqx-layout-group ${props}>`;
|
|
548
|
+
processDataSource(item.items);
|
|
549
|
+
template += '</jqx-layout-group>'
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
var content = item.content || '';
|
|
554
|
+
if (isTabLayoutGroup) {
|
|
555
|
+
template += `<jqx-tab-layout-item ${props}>` + content + '</jqx-tab-layout-item>';
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
if (type === 'tabs') {
|
|
559
|
+
template += `<jqx-tab-layout-group>`;
|
|
560
|
+
template += `<jqx-tab-layout-item ${props}>` + content + '</jqx-tab-layout-item>';
|
|
561
|
+
template += '</jqx-tab-layout-group>'
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
template += `<jqx-layout-item ${props}>` + content + '</jqx-layout-item>';
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
processDataSource(that.dataSource);
|
|
572
|
+
that.$.itemsContainer.innerHTML = template;
|
|
573
|
+
that.refresh();
|
|
673
574
|
}
|
|
575
|
+
|
|
576
|
+
|
|
674
577
|
/**
|
|
675
578
|
* Element's render funciton
|
|
676
579
|
*/
|
|
580
|
+
render() {
|
|
581
|
+
var that = this;
|
|
582
|
+
|
|
583
|
+
that.setAttribute('role', 'group');
|
|
584
|
+
|
|
585
|
+
if (that.selectedIndex) {
|
|
586
|
+
that._handleItemClick(that.getItem(that.selectedIndex + ''), true);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
var render = (function () {
|
|
591
|
+
if (!that.dataSource) {
|
|
592
|
+
that.dataSource = that._getDataSource(that._getLayout());
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
that.dataBind();
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
that.$.itemsContainer.orientation = that.orientation;
|
|
677
599
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
that.setAttribute('role', 'group');
|
|
600
|
+
that.refresh();
|
|
601
|
+
that._updateSplitter();
|
|
602
|
+
that.isRendered = true;
|
|
603
|
+
that.classList.add('outline');
|
|
683
604
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
605
|
+
if (that.ready) {
|
|
606
|
+
that.ready();
|
|
607
|
+
}
|
|
608
|
+
})
|
|
687
609
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
610
|
+
if (document.readyState === 'complete') {
|
|
611
|
+
render();
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
window.addEventListener('load', (function () {
|
|
615
|
+
render();
|
|
616
|
+
}));
|
|
693
617
|
}
|
|
618
|
+
}
|
|
694
619
|
|
|
695
|
-
|
|
696
|
-
that
|
|
620
|
+
connectedCallback() {
|
|
621
|
+
var that = this;
|
|
697
622
|
|
|
698
|
-
|
|
623
|
+
var setup = function () {
|
|
624
|
+
var fragment = document.createDocumentFragment();
|
|
699
625
|
|
|
700
|
-
|
|
701
|
-
|
|
626
|
+
while (that.childNodes.length) {
|
|
627
|
+
fragment.appendChild(that.firstChild);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
that.innerHTML = that.template();
|
|
631
|
+
that.classList.add('jqx-widget');
|
|
632
|
+
that.$ = {
|
|
633
|
+
container: that.querySelector("#container"),
|
|
634
|
+
itemsContainer: that.querySelector("#itemsContainer"),
|
|
635
|
+
splitter: that.querySelector("#splitter")
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
delete that.$.container.id;
|
|
639
|
+
delete that.$.itemsContainer.id;
|
|
640
|
+
delete that.$.splitter.id;
|
|
641
|
+
|
|
642
|
+
that.$.itemsContainer.appendChild(fragment);
|
|
643
|
+
that.classList.add('jqx-split-layout');
|
|
644
|
+
|
|
645
|
+
document.addEventListener('pointerdown', function (event) {
|
|
646
|
+
that._documentDownHandler(event);
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
document.addEventListener('pointermove', function (event) {
|
|
650
|
+
that._documentMoveHandler(event);
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
document.addEventListener('pointerup', function (event) {
|
|
654
|
+
that._documentUpHandler(event);
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
document.addEventListener('selectstart', function (event) {
|
|
658
|
+
that._documentSelectStartHandler(event);
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
document.addEventListener('keyup', function (event) {
|
|
662
|
+
that._keyUpHandler(event);
|
|
663
|
+
});
|
|
702
664
|
|
|
703
|
-
|
|
704
|
-
|
|
665
|
+
that.addEventListener('mouseleave', function (event) {
|
|
666
|
+
that._leaveHandler(event);
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
that.addEventListener('mouseenter', function (event) {
|
|
670
|
+
that._enterHandler(event);
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
that.addEventListener('dragStart', function (event) {
|
|
674
|
+
that._dragStart(event);
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
that.render();
|
|
705
678
|
}
|
|
706
|
-
};
|
|
707
679
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
}, {
|
|
717
|
-
key: "connectedCallback",
|
|
718
|
-
value: function connectedCallback() {
|
|
719
|
-
var that = this;
|
|
720
|
-
|
|
721
|
-
var setup = function setup() {
|
|
722
|
-
var fragment = document.createDocumentFragment();
|
|
723
|
-
|
|
724
|
-
while (that.childNodes.length) {
|
|
725
|
-
fragment.appendChild(that.firstChild);
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
that.innerHTML = that.template();
|
|
729
|
-
that.classList.add('jqx-widget');
|
|
730
|
-
that.$ = {
|
|
731
|
-
container: that.querySelector("#container"),
|
|
732
|
-
itemsContainer: that.querySelector("#itemsContainer"),
|
|
733
|
-
splitter: that.querySelector("#splitter")
|
|
734
|
-
};
|
|
735
|
-
delete that.$.container.id;
|
|
736
|
-
delete that.$.itemsContainer.id;
|
|
737
|
-
delete that.$.splitter.id;
|
|
738
|
-
that.$.itemsContainer.appendChild(fragment);
|
|
739
|
-
that.classList.add('jqx-split-layout');
|
|
740
|
-
document.addEventListener('pointerdown', function (event) {
|
|
741
|
-
that._documentDownHandler(event);
|
|
742
|
-
});
|
|
743
|
-
document.addEventListener('pointermove', function (event) {
|
|
744
|
-
that._documentMoveHandler(event);
|
|
745
|
-
});
|
|
746
|
-
document.addEventListener('pointerup', function (event) {
|
|
747
|
-
that._documentUpHandler(event);
|
|
748
|
-
});
|
|
749
|
-
document.addEventListener('selectstart', function (event) {
|
|
750
|
-
that._documentSelectStartHandler(event);
|
|
751
|
-
});
|
|
752
|
-
document.addEventListener('keyup', function (event) {
|
|
753
|
-
that._keyUpHandler(event);
|
|
754
|
-
});
|
|
755
|
-
that.addEventListener('mouseleave', function (event) {
|
|
756
|
-
that._leaveHandler(event);
|
|
757
|
-
});
|
|
758
|
-
that.addEventListener('mouseenter', function (event) {
|
|
759
|
-
that._enterHandler(event);
|
|
760
|
-
});
|
|
761
|
-
that.addEventListener('dragStart', function (event) {
|
|
762
|
-
that._dragStart(event);
|
|
763
|
-
});
|
|
764
|
-
that.render();
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
if (document.readyState === 'complete') {
|
|
768
|
-
setup();
|
|
769
|
-
} else {
|
|
770
|
-
window.addEventListener('load', function () {
|
|
771
|
-
setup();
|
|
772
|
-
});
|
|
773
|
-
}
|
|
680
|
+
if (document.readyState === 'complete') {
|
|
681
|
+
setup();
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
window.addEventListener('load', function () {
|
|
685
|
+
setup();
|
|
686
|
+
});
|
|
687
|
+
}
|
|
774
688
|
}
|
|
689
|
+
|
|
775
690
|
/**
|
|
776
691
|
* Returns the Splitter item according to the index
|
|
777
692
|
* @param {any} index - string, e.g. '0.1'
|
|
778
693
|
*/
|
|
694
|
+
getItem(index) {
|
|
695
|
+
var that = this;
|
|
779
696
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
var that = this;
|
|
697
|
+
if (index === undefined || index === null) {
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
784
700
|
|
|
785
|
-
|
|
786
|
-
return;
|
|
787
|
-
}
|
|
701
|
+
index = (index + '').split('.');
|
|
788
702
|
|
|
789
|
-
|
|
703
|
+
var items = that._getDataSource(that._getLayout()),
|
|
704
|
+
item;
|
|
790
705
|
|
|
791
|
-
|
|
792
|
-
|
|
706
|
+
for (var i = 0; i < index.length; i++) {
|
|
707
|
+
item = items[index[i]];
|
|
793
708
|
|
|
794
|
-
|
|
795
|
-
|
|
709
|
+
if (!item) {
|
|
710
|
+
break;
|
|
711
|
+
}
|
|
796
712
|
|
|
797
|
-
|
|
798
|
-
break;
|
|
713
|
+
items = item.items;
|
|
799
714
|
}
|
|
800
715
|
|
|
801
|
-
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
return item;
|
|
716
|
+
return item;
|
|
805
717
|
}
|
|
718
|
+
|
|
719
|
+
|
|
806
720
|
/**
|
|
807
721
|
* Document down handler
|
|
808
722
|
* @param {any} event
|
|
809
723
|
*/
|
|
724
|
+
_documentDownHandler(event) {
|
|
725
|
+
var that = this,
|
|
726
|
+
target = event.target;
|
|
810
727
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
target = event.target;
|
|
816
|
-
|
|
817
|
-
if (that.contains(target) && target.closest) {
|
|
818
|
-
that._target = target;
|
|
819
|
-
|
|
820
|
-
that._updateSplitter();
|
|
821
|
-
}
|
|
728
|
+
if (that.contains(target) && target.closest) {
|
|
729
|
+
that._target = target;
|
|
730
|
+
that._updateSplitter();
|
|
731
|
+
}
|
|
822
732
|
}
|
|
733
|
+
|
|
823
734
|
/**
|
|
824
735
|
* Document move handler
|
|
825
736
|
* @param {any} event
|
|
826
737
|
*/
|
|
738
|
+
_documentMoveHandler(event) {
|
|
739
|
+
var that = this,
|
|
740
|
+
target = event.target,
|
|
741
|
+
menu = that._contextMenu;
|
|
742
|
+
|
|
743
|
+
if (menu && !JQX.Utilities.Core.isMobile) {
|
|
744
|
+
if (menu.querySelector('.jqx-layout-context-menu-item[hover]')) {
|
|
745
|
+
var items = menu.children;
|
|
746
|
+
|
|
747
|
+
for (var i = 0; i < items.length; i++) {
|
|
748
|
+
items[i].removeAttribute('hover');
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
if (menu.contains(target) && target.closest && target.closest('.jqx-layout-context-menu-item')) {
|
|
753
|
+
target.setAttribute('hover', '');
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
if (that._dragDetails) {
|
|
758
|
+
var offsetX = Math.abs(that._dragDetails.pageX - event.pageX);
|
|
759
|
+
var offsetY = Math.abs(that._dragDetails.pageY - event.pageY);
|
|
760
|
+
|
|
761
|
+
if (offsetY <= 5 && offsetX <= 5) {
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
if (!that._dragDetails.feedback.parentElement) {
|
|
766
|
+
document.body.appendChild(that._dragDetails.feedback);
|
|
767
|
+
document.body.appendChild(that._dragDetails.overlay)
|
|
768
|
+
setTimeout(function () {
|
|
769
|
+
that._dragDetails.feedback.classList.add('dragging');
|
|
770
|
+
}, 100);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
that._dragDetails.dragging = true;
|
|
774
|
+
|
|
775
|
+
that._dragDetails.feedback.style.left = event.pageX - that._dragDetails.feedback.offsetWidth / 2 - 5 + 'px';
|
|
776
|
+
that._dragDetails.feedback.style.top = event.pageY - that._dragDetails.feedback.offsetHeight / 2 - 5 + 'px';
|
|
777
|
+
|
|
778
|
+
var elements = document.elementsFromPoint(event.pageX, event.pageY);
|
|
779
|
+
var group = null;
|
|
780
|
+
var isTabStrip = false;
|
|
781
|
+
|
|
782
|
+
for (var i = 0; i < elements.length; i++) {
|
|
783
|
+
var element = elements[i];
|
|
784
|
+
|
|
785
|
+
if (that._dragDetails.feedback.contains(element)) {
|
|
786
|
+
continue;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
if (element.classList.contains('jqx-layout-tab-strip')) {
|
|
790
|
+
if (that._dragDetails.element.contains(element)) {
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
group = element.parentElement;
|
|
795
|
+
isTabStrip = true;
|
|
796
|
+
break;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
if ((element.parentElement === that._dragDetails.parent || element === that._dragDetails.parent) && that._dragDetails.layoutGroup.items.length === 1) {
|
|
800
|
+
continue;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
if (that._dragDetails.element.contains(element)) {
|
|
804
|
+
continue;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
if (element instanceof TabLayoutItem) {
|
|
808
|
+
group = element.parentElement;
|
|
809
|
+
break;
|
|
810
|
+
}
|
|
811
|
+
else if (element instanceof TabLayoutGroup) {
|
|
812
|
+
group = element;
|
|
813
|
+
break;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
var getPosition = function (group, size) {
|
|
818
|
+
var offset = that.offset(group);
|
|
819
|
+
var position = null;
|
|
820
|
+
var edgeSize = 50;
|
|
821
|
+
|
|
822
|
+
var height = size;
|
|
823
|
+
var width = size;
|
|
824
|
+
|
|
825
|
+
if (!size) {
|
|
826
|
+
width = group.offsetWidth / 3;
|
|
827
|
+
height = group.offsetHeight / 3;
|
|
828
|
+
}
|
|
829
|
+
else {
|
|
830
|
+
edgeSize = 0;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
var positionRects = [
|
|
834
|
+
{
|
|
835
|
+
left: offset.left,
|
|
836
|
+
top: offset.top,
|
|
837
|
+
right: offset.left + edgeSize,
|
|
838
|
+
bottom: offset.top + edgeSize,
|
|
839
|
+
position: 'top'
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
left: offset.left + edgeSize,
|
|
843
|
+
top: offset.top,
|
|
844
|
+
right: offset.left + group.offsetWidth - edgeSize,
|
|
845
|
+
bottom: offset.top + height - edgeSize,
|
|
846
|
+
position: 'top'
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
left: offset.left + group.offsetWidth - edgeSize,
|
|
850
|
+
top: offset.top,
|
|
851
|
+
right: offset.left + group.offsetWidth,
|
|
852
|
+
bottom: offset.top + edgeSize,
|
|
853
|
+
position: 'top'
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
left: offset.left,
|
|
857
|
+
top: offset.top + edgeSize,
|
|
858
|
+
right: offset.left + width,
|
|
859
|
+
bottom: offset.top + group.offsetHeight - edgeSize,
|
|
860
|
+
position: 'left'
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
left: offset.left + group.offsetWidth - width,
|
|
864
|
+
top: offset.top + edgeSize,
|
|
865
|
+
right: offset.left + group.offsetWidth,
|
|
866
|
+
bottom: offset.top + group.offsetHeight - edgeSize,
|
|
867
|
+
position: 'right'
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
left: offset.left,
|
|
871
|
+
top: offset.top + group.offsetHeight - edgeSize,
|
|
872
|
+
right: offset.left + edgeSize,
|
|
873
|
+
bottom: offset.top + group.offsetHeight,
|
|
874
|
+
position: 'bottom'
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
left: offset.left + edgeSize,
|
|
878
|
+
top: offset.top + group.offsetHeight - height + edgeSize,
|
|
879
|
+
right: offset.left + group.offsetWidth - edgeSize,
|
|
880
|
+
bottom: offset.top + group.offsetHeight,
|
|
881
|
+
position: 'bottom'
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
left: offset.left + group.offsetWidth - edgeSize,
|
|
885
|
+
top: offset.top + group.offsetHeight - edgeSize,
|
|
886
|
+
right: offset.left + group.offsetWidth,
|
|
887
|
+
bottom: offset.top + group.offsetHeight,
|
|
888
|
+
position: 'bottom'
|
|
889
|
+
},
|
|
890
|
+
]
|
|
891
|
+
|
|
892
|
+
for (var i = 0; i < positionRects.length; i++) {
|
|
893
|
+
var rect = positionRects[i];
|
|
894
|
+
|
|
895
|
+
if (rect.left <= event.pageX && event.pageX <= rect.right) {
|
|
896
|
+
if (rect.top <= event.pageY && event.pageY <= rect.bottom) {
|
|
897
|
+
position = rect.position;
|
|
898
|
+
break;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
return position;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
var rootGroup = that.querySelector('jqx-layout-group');
|
|
907
|
+
|
|
908
|
+
var position = getPosition(rootGroup, 10);
|
|
909
|
+
var currentGroup = null;
|
|
910
|
+
|
|
911
|
+
if (!position) {
|
|
912
|
+
if (!group) {
|
|
913
|
+
that._handleDropArea(null);
|
|
914
|
+
}
|
|
915
|
+
else {
|
|
916
|
+
if (isTabStrip) {
|
|
917
|
+
if (group !== that._dragDetails.parent) {
|
|
918
|
+
position = 'center';
|
|
919
|
+
currentGroup = group;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
position = getPosition(group) || 'center';
|
|
924
|
+
currentGroup = group
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
else {
|
|
929
|
+
currentGroup = rootGroup;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
if (currentGroup) {
|
|
933
|
+
that._dragDetails.current = currentGroup;
|
|
934
|
+
that._dragDetails.position = position;
|
|
935
|
+
that._handleDropArea(currentGroup, position);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
if (that._resizeDetails) {
|
|
940
|
+
var offsetX = Math.abs(that._resizeDetails.clientX - event.clientX);
|
|
941
|
+
var offsetY = Math.abs(that._resizeDetails.clientY - event.clientY);
|
|
942
|
+
|
|
943
|
+
var splitter = that._resizeDetails.splitter;
|
|
944
|
+
var item = that._resizeDetails.item;
|
|
945
|
+
var itemRect = that._resizeDetails.itemRect;
|
|
946
|
+
var previousItemRect = that._resizeDetails.previousItemRect;
|
|
947
|
+
var previousItem = that._resizeDetails.previousItem;
|
|
948
|
+
var nextItemRect = that._resizeDetails.nextItemRect;
|
|
949
|
+
var nextItem = that._resizeDetails.nextItem;
|
|
950
|
+
var minSize = parseInt(item.getAttribute('min'));
|
|
951
|
+
|
|
952
|
+
var resetSplitter = function (splitter) {
|
|
953
|
+
if (splitter.classList.contains('jqx-visibility-hidden')) {
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
splitter.style.right = '';
|
|
958
|
+
splitter.style.top = '';
|
|
959
|
+
splitter.style.left = '';
|
|
960
|
+
splitter.style.bottom = '';
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
resetSplitter(splitter);
|
|
964
|
+
resetSplitter(that.$.splitter);
|
|
965
|
+
|
|
966
|
+
splitter.classList.remove('error');
|
|
967
|
+
splitter.classList.add('active');
|
|
968
|
+
|
|
969
|
+
if (!that._resizeDetails.dragging) {
|
|
970
|
+
if (splitter.classList.contains('horizontal') && offsetY <= 5) {
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
else if (splitter.classList.contains('vertical') && offsetX <= 5) {
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
that._resizeDetails.dragging = true;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
var normalized = {
|
|
981
|
+
'clientPos': 'clientX',
|
|
982
|
+
'pos': 'x',
|
|
983
|
+
'size': 'width',
|
|
984
|
+
'near': 'left',
|
|
985
|
+
'far': 'right',
|
|
986
|
+
'offsetSize': 'offsetWidth'
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
if (splitter.classList.contains('horizontal')) {
|
|
990
|
+
normalized = {
|
|
991
|
+
'clientPos': 'clientY',
|
|
992
|
+
'pos': 'y',
|
|
993
|
+
'size': 'height',
|
|
994
|
+
'near': 'top',
|
|
995
|
+
'far': 'bottom',
|
|
996
|
+
'offsetSize': 'offsetHeight'
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
var updateSplitter = function (splitter) {
|
|
1001
|
+
var offset = that.offset(splitter);
|
|
1002
|
+
var elementOffset = that.offset(that);
|
|
1003
|
+
|
|
1004
|
+
elementOffset.left++;
|
|
1005
|
+
elementOffset.top++;
|
|
1006
|
+
|
|
1007
|
+
that.$.splitter.style.width = splitter.offsetWidth + 'px';
|
|
1008
|
+
that.$.splitter.style.height = splitter.offsetHeight + 'px';
|
|
1009
|
+
|
|
1010
|
+
that.$.splitter.className = splitter.className;
|
|
1011
|
+
|
|
1012
|
+
that.$.splitter.style.left = offset.left - elementOffset.left + 'px';
|
|
1013
|
+
that.$.splitter.style.top = offset.top - elementOffset.top + 'px';
|
|
1014
|
+
|
|
1015
|
+
splitter.setAttribute('drag', '');
|
|
1016
|
+
that.$.splitter.setAttribute('drag', '');
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
if (splitter.classList.contains('last')) {
|
|
1020
|
+
var newPosition = event[normalized.clientPos] - that._resizeDetails.splitterRect[normalized.pos];
|
|
1021
|
+
var maxPosition = itemRect[normalized.size] - minSize;
|
|
1022
|
+
|
|
1023
|
+
if (newPosition > maxPosition) {
|
|
1024
|
+
newPosition = maxPosition;
|
|
1025
|
+
splitter.classList.add('error');
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
if (previousItemRect) {
|
|
1029
|
+
var minSize = parseInt(previousItem.getAttribute('min'));
|
|
1030
|
+
|
|
1031
|
+
var minPosition = previousItemRect[normalized.size] - minSize;
|
|
1032
|
+
if (newPosition < -minPosition) {
|
|
1033
|
+
newPosition = -minPosition;
|
|
1034
|
+
splitter.classList.add('error');
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
splitter.style[normalized.near] = newPosition + 'px';
|
|
1039
|
+
|
|
1040
|
+
var newSize = item[normalized.offsetSize] - newPosition;
|
|
1041
|
+
|
|
1042
|
+
item.setAttribute('size', newSize);
|
|
1043
|
+
|
|
1044
|
+
if (previousItem) {
|
|
1045
|
+
var previousItemSize = item[normalized.offsetSize] + previousItem[normalized.offsetSize] - newSize;
|
|
1046
|
+
|
|
1047
|
+
previousItem.setAttribute('size', previousItemSize);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
else {
|
|
1051
|
+
var newPosition = -event[normalized.clientPos] + that._resizeDetails.splitterRect[normalized.pos];
|
|
1052
|
+
var minPosition = itemRect[normalized.size] - minSize;
|
|
1053
|
+
|
|
1054
|
+
if (newPosition > minPosition) {
|
|
1055
|
+
newPosition = minPosition;
|
|
1056
|
+
splitter.classList.add('error');
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
if (nextItemRect) {
|
|
1060
|
+
var minSize = parseInt(nextItem.getAttribute('min'));
|
|
1061
|
+
|
|
1062
|
+
var maxPosition = -nextItemRect[normalized.size] + minSize;
|
|
1063
|
+
if (newPosition < maxPosition) {
|
|
1064
|
+
newPosition = maxPosition;
|
|
1065
|
+
splitter.classList.add('error');
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
splitter.style[normalized.far] = newPosition + 'px';
|
|
1071
|
+
|
|
1072
|
+
var newSize = item[normalized.offsetSize] - newPosition;
|
|
1073
|
+
|
|
1074
|
+
item.setAttribute('size', newSize);
|
|
1075
|
+
|
|
1076
|
+
if (nextItem) {
|
|
1077
|
+
var nextItemSize = nextItem[normalized.offsetSize] + item[normalized.offsetSize] - newSize;
|
|
1078
|
+
|
|
1079
|
+
nextItem.setAttribute('size', nextItemSize);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
updateSplitter(splitter);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
_offsetTop(element) {
|
|
1088
|
+
var that = this;
|
|
1089
|
+
|
|
1090
|
+
if (!element) {
|
|
1091
|
+
return 0;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
return element.offsetTop + that._offsetTop(element.offsetParent);
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
_offsetLeft(element) {
|
|
1098
|
+
var that = this;
|
|
1099
|
+
|
|
1100
|
+
if (!element) {
|
|
1101
|
+
return 0;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
return element.offsetLeft + that._offsetLeft(element.offsetParent);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
offset(element) {
|
|
1108
|
+
return { left: this._offsetLeft(element), top: this._offsetTop(element) }
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
_keyUpHandler(event) {
|
|
1112
|
+
var that = this;
|
|
1113
|
+
if (event.key === 'Escape') {
|
|
1114
|
+
if (that._dragDetails) {
|
|
1115
|
+
that._dragDetails.feedback.remove();
|
|
1116
|
+
that._dragDetails.overlay.remove();
|
|
1117
|
+
that._dragDetails = null;
|
|
1118
|
+
that._handleDropArea(null);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
if (that._resizeDetails) {
|
|
1122
|
+
var drag = that._resizeDetails;
|
|
1123
|
+
|
|
1124
|
+
drag.splitter.classList.contains('last') ? drag.previousItem.size = drag.previousItemSize : drag.nextItem.size = drag.nextItem.previousItemSize;
|
|
1125
|
+
drag.item.size = drag.itemSize;
|
|
1126
|
+
|
|
1127
|
+
that.refresh();
|
|
1128
|
+
that._handleItemClick(drag.item);
|
|
1129
|
+
that._resizeDetails = null;
|
|
1130
|
+
return;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
else if (event.key === 'Delete') {
|
|
1134
|
+
if (that._selectedItem) {
|
|
1135
|
+
that._removeLayoutItem(that._selectedItem);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
_endDrag() {
|
|
1141
|
+
var that = this;
|
|
1142
|
+
|
|
1143
|
+
that._handleDropArea(null);
|
|
1144
|
+
|
|
1145
|
+
if (!that._dragDetails.dragging) {
|
|
1146
|
+
that._dragDetails = null;
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
var group = that._dragDetails.current;
|
|
1151
|
+
var item = that._dragDetails.element;
|
|
1152
|
+
var position = that._dragDetails.position;
|
|
1153
|
+
|
|
1154
|
+
that._handleDropArea(null);
|
|
1155
|
+
|
|
1156
|
+
if (group) {
|
|
1157
|
+
that._addTabLayoutItem(group, position, item);
|
|
1158
|
+
that._removeLayoutItem(item);
|
|
1159
|
+
|
|
1160
|
+
if (group.parentElement && Array.from(group.parentElement.parentElement.children).filter(function (value) {
|
|
1161
|
+
if (value.classList.contains('jqx-layout-group')) {
|
|
1162
|
+
return true;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
return false;
|
|
1166
|
+
}).length === 1) {
|
|
1167
|
+
var parent = group.parentElement;
|
|
1168
|
+
var parentGroup = parent.parentElement;
|
|
1169
|
+
var ownerGroup = parentGroup.parentElement;
|
|
1170
|
+
|
|
1171
|
+
if (!(parentGroup.getAttribute('data-id') === 'root' || ownerGroup.getAttribute('data-id') === 'root') && ownerGroup !== that) {
|
|
1172
|
+
var index = Array.from(ownerGroup.children).indexOf(parent.parentElement);
|
|
1173
|
+
|
|
1174
|
+
if (index >= 0) {
|
|
1175
|
+
ownerGroup.insertBefore(parent, ownerGroup.children[index])
|
|
1176
|
+
}
|
|
1177
|
+
else {
|
|
1178
|
+
ownerGroup.appendChild(parent);
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
parentGroup.remove();
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
that.refresh();
|
|
1186
|
+
that._updateSplitter();
|
|
1187
|
+
|
|
1188
|
+
requestAnimationFrame(function () {
|
|
1189
|
+
that.classList.add('outline');
|
|
1190
|
+
that.querySelectorAll('.jqx-element').forEach(function (control) {
|
|
1191
|
+
that.dispatchEvent(new CustomEvent('resize'));
|
|
1192
|
+
|
|
1193
|
+
});
|
|
1194
|
+
})
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
that.dispatchEvent(new CustomEvent('stateChange', { type: 'insert', item: item }));
|
|
1198
|
+
|
|
1199
|
+
that._dragDetails.feedback.remove();
|
|
1200
|
+
that._dragDetails.overlay.remove();
|
|
1201
|
+
that._dragDetails = null;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Document up handler
|
|
1205
|
+
* @param {any} event
|
|
1206
|
+
*/
|
|
1207
|
+
_documentUpHandler(event) {
|
|
1208
|
+
var that = this,
|
|
1209
|
+
isMobile = JQX.Utilities.Core.isMobile,
|
|
1210
|
+
target = isMobile ? document.elementFromPoint(event.pageX - window.pageXOffset, event.pageY - window.pageYOffset) : event.target;
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
if (event.button === 2) {
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
if (that._dragDetails) {
|
|
1218
|
+
that._endDrag(event);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
if (that._resizeDetails) {
|
|
1222
|
+
var drag = that._resizeDetails;
|
|
1223
|
+
|
|
1224
|
+
if (drag.item) {
|
|
1225
|
+
drag.item.style.overflow = '';
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
if (drag.previousItem) {
|
|
1229
|
+
drag.previousItem.style.overflow = '';
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
if (drag.nextItem) {
|
|
1233
|
+
drag.nextItem.style.overflow = '';
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
that.refresh();
|
|
1237
|
+
that._handleItemClick(drag.item);
|
|
1238
|
+
that._resizeDetails = null;
|
|
1239
|
+
window.dispatchEvent(new Event('resize'));
|
|
1240
|
+
|
|
1241
|
+
that.querySelectorAll('.jqx-element').forEach(function (control) {
|
|
1242
|
+
control.dispatchEvent(new CustomEvent('resize'));
|
|
1243
|
+
});
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
if (!that.contains(target)) {
|
|
1248
|
+
return;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
that.classList.add('outline');
|
|
1252
|
+
|
|
1253
|
+
if (that._target && !target.item) {
|
|
1254
|
+
if (target instanceof TabLayoutItem) {
|
|
1255
|
+
that._handleItemClick(target);
|
|
1256
|
+
}
|
|
1257
|
+
else {
|
|
1258
|
+
that._handleItemClick(target.closest('.jqx-layout-item'));
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
if (that._target) {
|
|
1263
|
+
if (that._target !== target) {
|
|
1264
|
+
delete that._target;
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
if (!event.button && target.closest('.jqx-layout-buttons-container')) {
|
|
1269
|
+
var button = event.target;
|
|
1270
|
+
|
|
1271
|
+
that._handleButtonClick(button.item, button.position);
|
|
1272
|
+
}
|
|
1273
|
+
else if (target.closest('.jqx-layout-context-menu') && (!isMobile && !event.button || isMobile)) {
|
|
1274
|
+
that._handleMenuItemClick(target.closest('.jqx-layout-context-menu-item'));
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
delete that._target;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* Document Select Start event handler
|
|
1283
|
+
*/
|
|
1284
|
+
_documentSelectStartHandler(event) {
|
|
1285
|
+
var that = this;
|
|
1286
|
+
|
|
1287
|
+
if (that._target) {
|
|
1288
|
+
event.preventDefault();
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
/**
|
|
1293
|
+
* Adds labels to the items that do not have set
|
|
1294
|
+
* @param {any} data
|
|
1295
|
+
*/
|
|
1296
|
+
_getDataSource(layout, path, index) {
|
|
1297
|
+
var that = this;
|
|
1298
|
+
|
|
1299
|
+
var data = [];
|
|
1300
|
+
|
|
1301
|
+
if (!index) {
|
|
1302
|
+
index = 0;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
if (!path) {
|
|
1306
|
+
path = '';
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
for (var i = 0; i < layout.length; i++) {
|
|
1310
|
+
var layoutItem = layout[i];
|
|
1311
|
+
|
|
1312
|
+
var item = {
|
|
1313
|
+
label: layoutItem.label,
|
|
1314
|
+
id: layoutItem.getAttribute('data-id'),
|
|
1315
|
+
orientation: layoutItem.orientation,
|
|
1316
|
+
size: layoutItem.size,
|
|
1317
|
+
min: layoutItem.min,
|
|
1318
|
+
type: layoutItem.type,
|
|
1319
|
+
modifiers: layoutItem.modifiers,
|
|
1320
|
+
position: layoutItem.position
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
layoutItem.removeAttribute('index');
|
|
1324
|
+
|
|
1325
|
+
if (layoutItem instanceof LayoutGroup) {
|
|
1326
|
+
data.push(item);
|
|
1327
|
+
|
|
1328
|
+
item.index = path !== '' ? path + '.' + index : index.toString();
|
|
1329
|
+
layoutItem.setAttribute('index', item.index);
|
|
1330
|
+
|
|
1331
|
+
if (layoutItem.items) {
|
|
1332
|
+
var items = that._getDataSource(layoutItem.items, item.index, 0);
|
|
1333
|
+
item.items = items;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
else if (layoutItem instanceof LayoutItem) {
|
|
1337
|
+
if (layoutItem.items) {
|
|
1338
|
+
var items = that._getDataSource(layoutItem.items, path, index);
|
|
1339
|
+
|
|
1340
|
+
data = data.concat(items);
|
|
1341
|
+
}
|
|
1342
|
+
else {
|
|
1343
|
+
item.index = path !== '' ? path + '.' + index : index.toString();
|
|
1344
|
+
layoutItem.setAttribute('index', item.index);
|
|
1345
|
+
|
|
1346
|
+
data.push(item);
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
index++;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
return data;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* Generates the JSON array of the current structure of the element
|
|
1358
|
+
*/
|
|
1359
|
+
_getLayout() {
|
|
1360
|
+
var that = this;
|
|
1361
|
+
var group = !arguments.length ? that.$.itemsContainer : arguments[0];
|
|
1362
|
+
|
|
1363
|
+
if (that._buttons) {
|
|
1364
|
+
that._buttons.remove();
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
if (that._dropArea) {
|
|
1368
|
+
that._dropArea.remove();
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
var splitters = that.querySelectorAll('.jqx-layout-splitter');
|
|
1372
|
+
|
|
1373
|
+
for (var i = 0; i < splitters.length; i++) {
|
|
1374
|
+
var splitter = splitters[i];
|
|
1375
|
+
|
|
1376
|
+
if (splitter !== that.$.splitter) {
|
|
1377
|
+
splitter.remove();
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
group.items = Array.from(group.children);
|
|
1382
|
+
group.items = group.items.filter(function (value) {
|
|
1383
|
+
return value !== group.tabs && value.hasAttribute('data-id');
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1386
|
+
var items = group.items.map(function (value) {
|
|
1387
|
+
if (value.classList.contains('jqx-layout-tab-strip')) {
|
|
1388
|
+
return null;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
var item = value;
|
|
1392
|
+
var itemGroup = value instanceof LayoutGroup ? value : null;
|
|
1393
|
+
|
|
1394
|
+
if (itemGroup) {
|
|
1395
|
+
item.items = that._getLayout(itemGroup)
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
return item;
|
|
1399
|
+
});
|
|
1400
|
+
|
|
1401
|
+
if (group !== that.$.itemsContainer) {
|
|
1402
|
+
return items.filter(function (value) {
|
|
1403
|
+
return value !== null && value !== group.tabs
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
var data = [];
|
|
1408
|
+
var item = group;
|
|
1409
|
+
|
|
1410
|
+
item.items = items.filter(function (value) {
|
|
1411
|
+
return value !== null && value !== group.tabs
|
|
1412
|
+
});
|
|
1413
|
+
|
|
1414
|
+
data.push(item);
|
|
1415
|
+
|
|
1416
|
+
return data;
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
_updateSplitter() {
|
|
1421
|
+
var that = this;
|
|
1422
|
+
|
|
1423
|
+
if (that._buttons && that._dragDetails) {
|
|
1424
|
+
that._buttons.remove();
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
that._removeSplitter();
|
|
1428
|
+
var items = that.querySelectorAll('[data-id]');
|
|
1429
|
+
|
|
1430
|
+
for (var i = 0; i < items.length; i++) {
|
|
1431
|
+
var item = items[i];
|
|
1432
|
+
|
|
1433
|
+
if (item.getAttribute('data-id') === 'root') {
|
|
1434
|
+
continue;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
if (item.hasAttribute('role')) {
|
|
1438
|
+
var role = item.getAttribute('role');
|
|
1439
|
+
|
|
1440
|
+
if (role === 'gridcell' || role === 'row' || role === 'columnheader' || role === 'rowheader') {
|
|
1441
|
+
continue;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
item.setAttribute('hover', '');
|
|
1446
|
+
that._handleSplitter(item);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
_hideSplitter() {
|
|
1451
|
+
var that = this;
|
|
1452
|
+
|
|
1453
|
+
var items = that.querySelectorAll('[data-id]');
|
|
1454
|
+
|
|
1455
|
+
for (var i = 0; i < items.length; i++) {
|
|
1456
|
+
var item = items[i];
|
|
1457
|
+
|
|
1458
|
+
item.removeAttribute('hover');
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
_removeSplitter() {
|
|
1463
|
+
var that = this;
|
|
1464
|
+
var splitters = that.querySelectorAll('.jqx-layout-splitter');
|
|
1465
|
+
|
|
1466
|
+
for (var i = 0; i < splitters.length; i++) {
|
|
1467
|
+
var splitter = splitters[i];
|
|
1468
|
+
|
|
1469
|
+
if (splitter !== that.$.splitter) {
|
|
1470
|
+
splitter.remove();
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
that._hideSplitter();
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
/**
|
|
1478
|
+
* Handles item selection
|
|
1479
|
+
* @param {any} target - target element that was clicked
|
|
1480
|
+
* @param {any} isOnDemand - selection on demand
|
|
1481
|
+
*/
|
|
1482
|
+
_handleItemClick(target) {
|
|
1483
|
+
var that = this,
|
|
1484
|
+
previouslySelectedIndex = that.selectedIndex;
|
|
1485
|
+
|
|
1486
|
+
var item = null;
|
|
1487
|
+
|
|
1488
|
+
if (!target) {
|
|
1489
|
+
that.selectedIndex = null;
|
|
1490
|
+
that.querySelectorAll('[data-id]').forEach(function (i) { i.removeAttribute('selected') });
|
|
1491
|
+
that._selectedItem = null;
|
|
1492
|
+
return;
|
|
1493
|
+
}
|
|
1494
|
+
else {
|
|
1495
|
+
item = target instanceof HTMLElement ? target : that.querySelector('[data-id=' + target.id + ']');
|
|
1496
|
+
|
|
1497
|
+
if (item && item.readonly) {
|
|
1498
|
+
that.selectedIndex = null;
|
|
1499
|
+
return;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
that.querySelectorAll('[data-id]').forEach(function (i) { i.removeAttribute('selected') });
|
|
1503
|
+
|
|
1504
|
+
if (!item) {
|
|
1505
|
+
that.refresh();
|
|
1506
|
+
return;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
that.selectedIndex = item.getAttribute('index');
|
|
1510
|
+
|
|
1511
|
+
item.setAttribute('selected', '');
|
|
1512
|
+
item.setAttribute('hover', '');
|
|
1513
|
+
that._selectedItem = item;
|
|
1514
|
+
if (item.classList.contains('jqx-hidden')) {
|
|
1515
|
+
that.refresh();
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
that._handleButtonsVisibility(item);
|
|
1519
|
+
|
|
1520
|
+
if (previouslySelectedIndex !== that.selectedIndex) {
|
|
1521
|
+
that.dispatchEvent(new CustomEvent('change'));
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
that._updateSplitter();
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
/**
|
|
1529
|
+
* Handles Layout Button click
|
|
1530
|
+
* @param {any} target
|
|
1531
|
+
*/
|
|
1532
|
+
_handleButtonClick(target, position) {
|
|
1533
|
+
var that = this,
|
|
1534
|
+
newItem = that._addLayoutItem(target, position);
|
|
827
1535
|
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
value: function _documentMoveHandler(event) {
|
|
831
|
-
var that = this,
|
|
832
|
-
target = event.target,
|
|
833
|
-
menu = that._contextMenu;
|
|
834
|
-
|
|
835
|
-
if (menu && !JQX.Utilities.Core.isMobile) {
|
|
836
|
-
if (menu.querySelector('.jqx-layout-context-menu-item[hover]')) {
|
|
837
|
-
var items = menu.children;
|
|
838
|
-
|
|
839
|
-
for (var i = 0; i < items.length; i++) {
|
|
840
|
-
items[i].removeAttribute('hover');
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
if (menu.contains(target) && target.closest && target.closest('.jqx-layout-context-menu-item')) {
|
|
845
|
-
target.setAttribute('hover', '');
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
if (that._dragDetails) {
|
|
850
|
-
var offsetX = Math.abs(that._dragDetails.pageX - event.pageX);
|
|
851
|
-
var offsetY = Math.abs(that._dragDetails.pageY - event.pageY);
|
|
852
|
-
|
|
853
|
-
if (offsetY <= 5 && offsetX <= 5) {
|
|
854
|
-
return;
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
if (!that._dragDetails.feedback.parentElement) {
|
|
858
|
-
document.body.appendChild(that._dragDetails.feedback);
|
|
859
|
-
document.body.appendChild(that._dragDetails.overlay);
|
|
860
|
-
setTimeout(function () {
|
|
861
|
-
that._dragDetails.feedback.classList.add('dragging');
|
|
862
|
-
}, 100);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
that._dragDetails.dragging = true;
|
|
866
|
-
that._dragDetails.feedback.style.left = event.pageX - that._dragDetails.feedback.offsetWidth / 2 - 5 + 'px';
|
|
867
|
-
that._dragDetails.feedback.style.top = event.pageY - that._dragDetails.feedback.offsetHeight / 2 - 5 + 'px';
|
|
868
|
-
var elements = document.elementsFromPoint(event.pageX, event.pageY);
|
|
869
|
-
var group = null;
|
|
870
|
-
var isTabStrip = false;
|
|
871
|
-
|
|
872
|
-
for (var i = 0; i < elements.length; i++) {
|
|
873
|
-
var element = elements[i];
|
|
874
|
-
|
|
875
|
-
if (that._dragDetails.feedback.contains(element)) {
|
|
876
|
-
continue;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
if (element.classList.contains('jqx-layout-tab-strip')) {
|
|
880
|
-
if (that._dragDetails.element.contains(element)) {
|
|
881
|
-
continue;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
group = element.parentElement;
|
|
885
|
-
isTabStrip = true;
|
|
886
|
-
break;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
if ((element.parentElement === that._dragDetails.parent || element === that._dragDetails.parent) && that._dragDetails.layoutGroup.items.length === 1) {
|
|
890
|
-
continue;
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
if (that._dragDetails.element.contains(element)) {
|
|
894
|
-
continue;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
if (element instanceof TabLayoutItem) {
|
|
898
|
-
group = element.parentElement;
|
|
899
|
-
break;
|
|
900
|
-
} else if (element instanceof TabLayoutGroup) {
|
|
901
|
-
group = element;
|
|
902
|
-
break;
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
var getPosition = function getPosition(group, size) {
|
|
907
|
-
var offset = that.offset(group);
|
|
908
|
-
var position = null;
|
|
909
|
-
var edgeSize = 50;
|
|
910
|
-
var height = size;
|
|
911
|
-
var width = size;
|
|
912
|
-
|
|
913
|
-
if (!size) {
|
|
914
|
-
width = group.offsetWidth / 3;
|
|
915
|
-
height = group.offsetHeight / 3;
|
|
916
|
-
} else {
|
|
917
|
-
edgeSize = 0;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
var positionRects = [{
|
|
921
|
-
left: offset.left,
|
|
922
|
-
top: offset.top,
|
|
923
|
-
right: offset.left + edgeSize,
|
|
924
|
-
bottom: offset.top + edgeSize,
|
|
925
|
-
position: 'top'
|
|
926
|
-
}, {
|
|
927
|
-
left: offset.left + edgeSize,
|
|
928
|
-
top: offset.top,
|
|
929
|
-
right: offset.left + group.offsetWidth - edgeSize,
|
|
930
|
-
bottom: offset.top + height - edgeSize,
|
|
931
|
-
position: 'top'
|
|
932
|
-
}, {
|
|
933
|
-
left: offset.left + group.offsetWidth - edgeSize,
|
|
934
|
-
top: offset.top,
|
|
935
|
-
right: offset.left + group.offsetWidth,
|
|
936
|
-
bottom: offset.top + edgeSize,
|
|
937
|
-
position: 'top'
|
|
938
|
-
}, {
|
|
939
|
-
left: offset.left,
|
|
940
|
-
top: offset.top + edgeSize,
|
|
941
|
-
right: offset.left + width,
|
|
942
|
-
bottom: offset.top + group.offsetHeight - edgeSize,
|
|
943
|
-
position: 'left'
|
|
944
|
-
}, {
|
|
945
|
-
left: offset.left + group.offsetWidth - width,
|
|
946
|
-
top: offset.top + edgeSize,
|
|
947
|
-
right: offset.left + group.offsetWidth,
|
|
948
|
-
bottom: offset.top + group.offsetHeight - edgeSize,
|
|
949
|
-
position: 'right'
|
|
950
|
-
}, {
|
|
951
|
-
left: offset.left,
|
|
952
|
-
top: offset.top + group.offsetHeight - edgeSize,
|
|
953
|
-
right: offset.left + edgeSize,
|
|
954
|
-
bottom: offset.top + group.offsetHeight,
|
|
955
|
-
position: 'bottom'
|
|
956
|
-
}, {
|
|
957
|
-
left: offset.left + edgeSize,
|
|
958
|
-
top: offset.top + group.offsetHeight - height + edgeSize,
|
|
959
|
-
right: offset.left + group.offsetWidth - edgeSize,
|
|
960
|
-
bottom: offset.top + group.offsetHeight,
|
|
961
|
-
position: 'bottom'
|
|
962
|
-
}, {
|
|
963
|
-
left: offset.left + group.offsetWidth - edgeSize,
|
|
964
|
-
top: offset.top + group.offsetHeight - edgeSize,
|
|
965
|
-
right: offset.left + group.offsetWidth,
|
|
966
|
-
bottom: offset.top + group.offsetHeight,
|
|
967
|
-
position: 'bottom'
|
|
968
|
-
}];
|
|
969
|
-
|
|
970
|
-
for (var i = 0; i < positionRects.length; i++) {
|
|
971
|
-
var rect = positionRects[i];
|
|
972
|
-
|
|
973
|
-
if (rect.left <= event.pageX && event.pageX <= rect.right) {
|
|
974
|
-
if (rect.top <= event.pageY && event.pageY <= rect.bottom) {
|
|
975
|
-
position = rect.position;
|
|
976
|
-
break;
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
return position;
|
|
982
|
-
};
|
|
983
|
-
|
|
984
|
-
var rootGroup = that.querySelector('jqx-layout-group');
|
|
985
|
-
var position = getPosition(rootGroup, 10);
|
|
986
|
-
var currentGroup = null;
|
|
987
|
-
|
|
988
|
-
if (!position) {
|
|
989
|
-
if (!group) {
|
|
990
|
-
that._handleDropArea(null);
|
|
991
|
-
} else {
|
|
992
|
-
if (isTabStrip) {
|
|
993
|
-
if (group !== that._dragDetails.parent) {
|
|
994
|
-
position = 'center';
|
|
995
|
-
currentGroup = group;
|
|
996
|
-
}
|
|
997
|
-
} else {
|
|
998
|
-
position = getPosition(group) || 'center';
|
|
999
|
-
currentGroup = group;
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
} else {
|
|
1003
|
-
currentGroup = rootGroup;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
if (currentGroup) {
|
|
1007
|
-
that._dragDetails.current = currentGroup;
|
|
1008
|
-
that._dragDetails.position = position;
|
|
1009
|
-
|
|
1010
|
-
that._handleDropArea(currentGroup, position);
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
if (that._resizeDetails) {
|
|
1015
|
-
var offsetX = Math.abs(that._resizeDetails.clientX - event.clientX);
|
|
1016
|
-
var offsetY = Math.abs(that._resizeDetails.clientY - event.clientY);
|
|
1017
|
-
var splitter = that._resizeDetails.splitter;
|
|
1018
|
-
var item = that._resizeDetails.item;
|
|
1019
|
-
var itemRect = that._resizeDetails.itemRect;
|
|
1020
|
-
var previousItemRect = that._resizeDetails.previousItemRect;
|
|
1021
|
-
var previousItem = that._resizeDetails.previousItem;
|
|
1022
|
-
var nextItemRect = that._resizeDetails.nextItemRect;
|
|
1023
|
-
var nextItem = that._resizeDetails.nextItem;
|
|
1024
|
-
var minSize = parseInt(item.getAttribute('min'));
|
|
1025
|
-
|
|
1026
|
-
var resetSplitter = function resetSplitter(splitter) {
|
|
1027
|
-
if (splitter.classList.contains('jqx-visibility-hidden')) {
|
|
1028
|
-
return;
|
|
1029
|
-
}
|
|
1536
|
+
//Select the new empty item
|
|
1537
|
+
that.dispatchEvent(new CustomEvent('stateChange', { type: 'insert', item: newItem }));
|
|
1030
1538
|
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
splitter.style.left = '';
|
|
1034
|
-
splitter.style.bottom = '';
|
|
1035
|
-
};
|
|
1036
|
-
|
|
1037
|
-
resetSplitter(splitter);
|
|
1038
|
-
resetSplitter(that.$.splitter);
|
|
1039
|
-
splitter.classList.remove('error');
|
|
1040
|
-
splitter.classList.add('active');
|
|
1539
|
+
that._handleItemClick(newItem, true);
|
|
1540
|
+
}
|
|
1041
1541
|
|
|
1042
|
-
if (!that._resizeDetails.dragging) {
|
|
1043
|
-
if (splitter.classList.contains('horizontal') && offsetY <= 5) {
|
|
1044
|
-
return;
|
|
1045
|
-
} else if (splitter.classList.contains('vertical') && offsetX <= 5) {
|
|
1046
|
-
return;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
that._resizeDetails.dragging = true;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
var normalized = {
|
|
1053
|
-
'clientPos': 'clientX',
|
|
1054
|
-
'pos': 'x',
|
|
1055
|
-
'size': 'width',
|
|
1056
|
-
'near': 'left',
|
|
1057
|
-
'far': 'right',
|
|
1058
|
-
'offsetSize': 'offsetWidth'
|
|
1059
|
-
};
|
|
1060
|
-
|
|
1061
|
-
if (splitter.classList.contains('horizontal')) {
|
|
1062
|
-
normalized = {
|
|
1063
|
-
'clientPos': 'clientY',
|
|
1064
|
-
'pos': 'y',
|
|
1065
|
-
'size': 'height',
|
|
1066
|
-
'near': 'top',
|
|
1067
|
-
'far': 'bottom',
|
|
1068
|
-
'offsetSize': 'offsetHeight'
|
|
1069
|
-
};
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
var updateSplitter = function updateSplitter(splitter) {
|
|
1073
|
-
var offset = that.offset(splitter);
|
|
1074
|
-
var elementOffset = that.offset(that);
|
|
1075
|
-
elementOffset.left++;
|
|
1076
|
-
elementOffset.top++;
|
|
1077
|
-
that.$.splitter.style.width = splitter.offsetWidth + 'px';
|
|
1078
|
-
that.$.splitter.style.height = splitter.offsetHeight + 'px';
|
|
1079
|
-
that.$.splitter.className = splitter.className;
|
|
1080
|
-
that.$.splitter.style.left = offset.left - elementOffset.left + 'px';
|
|
1081
|
-
that.$.splitter.style.top = offset.top - elementOffset.top + 'px';
|
|
1082
|
-
splitter.setAttribute('drag', '');
|
|
1083
|
-
that.$.splitter.setAttribute('drag', '');
|
|
1084
|
-
};
|
|
1085
|
-
|
|
1086
|
-
if (splitter.classList.contains('last')) {
|
|
1087
|
-
var newPosition = event[normalized.clientPos] - that._resizeDetails.splitterRect[normalized.pos];
|
|
1088
|
-
var maxPosition = itemRect[normalized.size] - minSize;
|
|
1089
|
-
|
|
1090
|
-
if (newPosition > maxPosition) {
|
|
1091
|
-
newPosition = maxPosition;
|
|
1092
|
-
splitter.classList.add('error');
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
if (previousItemRect) {
|
|
1096
|
-
var minSize = parseInt(previousItem.getAttribute('min'));
|
|
1097
|
-
var minPosition = previousItemRect[normalized.size] - minSize;
|
|
1098
|
-
|
|
1099
|
-
if (newPosition < -minPosition) {
|
|
1100
|
-
newPosition = -minPosition;
|
|
1101
|
-
splitter.classList.add('error');
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
splitter.style[normalized.near] = newPosition + 'px';
|
|
1106
|
-
var newSize = item[normalized.offsetSize] - newPosition;
|
|
1107
|
-
item.setAttribute('size', newSize);
|
|
1108
|
-
|
|
1109
|
-
if (previousItem) {
|
|
1110
|
-
var previousItemSize = item[normalized.offsetSize] + previousItem[normalized.offsetSize] - newSize;
|
|
1111
|
-
previousItem.setAttribute('size', previousItemSize);
|
|
1112
|
-
}
|
|
1113
|
-
} else {
|
|
1114
|
-
var newPosition = -event[normalized.clientPos] + that._resizeDetails.splitterRect[normalized.pos];
|
|
1115
|
-
var minPosition = itemRect[normalized.size] - minSize;
|
|
1116
|
-
|
|
1117
|
-
if (newPosition > minPosition) {
|
|
1118
|
-
newPosition = minPosition;
|
|
1119
|
-
splitter.classList.add('error');
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
if (nextItemRect) {
|
|
1123
|
-
var minSize = parseInt(nextItem.getAttribute('min'));
|
|
1124
|
-
var maxPosition = -nextItemRect[normalized.size] + minSize;
|
|
1125
|
-
|
|
1126
|
-
if (newPosition < maxPosition) {
|
|
1127
|
-
newPosition = maxPosition;
|
|
1128
|
-
splitter.classList.add('error');
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
splitter.style[normalized.far] = newPosition + 'px';
|
|
1133
|
-
var newSize = item[normalized.offsetSize] - newPosition;
|
|
1134
|
-
item.setAttribute('size', newSize);
|
|
1135
|
-
|
|
1136
|
-
if (nextItem) {
|
|
1137
|
-
var nextItemSize = nextItem[normalized.offsetSize] + item[normalized.offsetSize] - newSize;
|
|
1138
|
-
nextItem.setAttribute('size', nextItemSize);
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
updateSplitter(splitter);
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
}, {
|
|
1146
|
-
key: "_offsetTop",
|
|
1147
|
-
value: function _offsetTop(element) {
|
|
1148
|
-
var that = this;
|
|
1149
|
-
|
|
1150
|
-
if (!element) {
|
|
1151
|
-
return 0;
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
return element.offsetTop + that._offsetTop(element.offsetParent);
|
|
1155
|
-
}
|
|
1156
|
-
}, {
|
|
1157
|
-
key: "_offsetLeft",
|
|
1158
|
-
value: function _offsetLeft(element) {
|
|
1159
|
-
var that = this;
|
|
1160
|
-
|
|
1161
|
-
if (!element) {
|
|
1162
|
-
return 0;
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
return element.offsetLeft + that._offsetLeft(element.offsetParent);
|
|
1166
|
-
}
|
|
1167
|
-
}, {
|
|
1168
|
-
key: "offset",
|
|
1169
|
-
value: function offset(element) {
|
|
1170
|
-
return {
|
|
1171
|
-
left: this._offsetLeft(element),
|
|
1172
|
-
top: this._offsetTop(element)
|
|
1173
|
-
};
|
|
1174
|
-
}
|
|
1175
|
-
}, {
|
|
1176
|
-
key: "_keyUpHandler",
|
|
1177
|
-
value: function _keyUpHandler(event) {
|
|
1178
|
-
var that = this;
|
|
1179
|
-
|
|
1180
|
-
if (event.key === 'Escape') {
|
|
1181
|
-
if (that._dragDetails) {
|
|
1182
|
-
that._dragDetails.feedback.remove();
|
|
1183
1542
|
|
|
1184
|
-
that._dragDetails.overlay.remove();
|
|
1185
1543
|
|
|
1186
|
-
|
|
1544
|
+
_removeLayoutItem(item) {
|
|
1545
|
+
var that = this;
|
|
1187
1546
|
|
|
1188
|
-
|
|
1547
|
+
if (item.getAttribute('data-id') === 'root') {
|
|
1548
|
+
return;
|
|
1189
1549
|
}
|
|
1190
1550
|
|
|
1191
|
-
if (
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1551
|
+
if (item instanceof LayoutItem && item.parentElement.items.length === 1) {
|
|
1552
|
+
var parent = item.parentElement;
|
|
1553
|
+
var currentParent = parent;
|
|
1554
|
+
|
|
1555
|
+
while (parent && parent.items && parent.items.length === 1) {
|
|
1556
|
+
if (parent.getAttribute('data-id') === 'root') {
|
|
1557
|
+
break;
|
|
1558
|
+
}
|
|
1196
1559
|
|
|
1197
|
-
|
|
1560
|
+
currentParent = parent;
|
|
1561
|
+
parent = parent.parentElement;
|
|
1562
|
+
}
|
|
1198
1563
|
|
|
1199
|
-
|
|
1200
|
-
|
|
1564
|
+
if (currentParent.getAttribute('data-id') !== 'root') {
|
|
1565
|
+
currentParent.remove();
|
|
1566
|
+
}
|
|
1567
|
+
else if (that.allowLiveSplit) {
|
|
1568
|
+
currentParent.appendChild(document.createElement('jqx-layout-item'));
|
|
1569
|
+
}
|
|
1201
1570
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
that._removeLayoutItem(that._selectedItem);
|
|
1571
|
+
else {
|
|
1572
|
+
item.remove();
|
|
1205
1573
|
}
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
}, {
|
|
1209
|
-
key: "_endDrag",
|
|
1210
|
-
value: function _endDrag() {
|
|
1211
|
-
var that = this;
|
|
1212
1574
|
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
if (!that._dragDetails.dragging) {
|
|
1216
|
-
that._dragDetails = null;
|
|
1217
|
-
return;
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
var group = that._dragDetails.current;
|
|
1221
|
-
var item = that._dragDetails.element;
|
|
1222
|
-
var position = that._dragDetails.position;
|
|
1575
|
+
that.refresh();
|
|
1223
1576
|
|
|
1224
|
-
|
|
1577
|
+
that.dispatchEvent(new CustomEvent('stateChange', { type: 'delete', item: item }));
|
|
1578
|
+
}
|
|
1225
1579
|
|
|
1226
|
-
|
|
1227
|
-
|
|
1580
|
+
/**
|
|
1581
|
+
* Refreshes the UI Component.
|
|
1582
|
+
*/
|
|
1583
|
+
refresh() {
|
|
1584
|
+
var that = this;
|
|
1228
1585
|
|
|
1229
|
-
that.
|
|
1586
|
+
if (that._isUpdating) {
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1230
1589
|
|
|
1231
|
-
|
|
1232
|
-
if (value.classList.contains('jqx-layout-group')) {
|
|
1233
|
-
return true;
|
|
1234
|
-
}
|
|
1590
|
+
that.dataSource = that._getDataSource(that._getLayout());
|
|
1235
1591
|
|
|
1236
|
-
|
|
1237
|
-
}).length === 1) {
|
|
1238
|
-
var parent = group.parentElement;
|
|
1239
|
-
var parentGroup = parent.parentElement;
|
|
1240
|
-
var ownerGroup = parentGroup.parentElement;
|
|
1592
|
+
that.$.splitter.className = 'jqx-visibility-hidden jqx-layout-splitter';
|
|
1241
1593
|
|
|
1242
|
-
|
|
1243
|
-
var
|
|
1594
|
+
var refreshLayoutGroup = function (group) {
|
|
1595
|
+
var item = that.getItem(group.getAttribute('index'));
|
|
1244
1596
|
|
|
1245
|
-
if (
|
|
1246
|
-
|
|
1247
|
-
} else {
|
|
1248
|
-
ownerGroup.appendChild(parent);
|
|
1597
|
+
if (!item) {
|
|
1598
|
+
return;
|
|
1249
1599
|
}
|
|
1600
|
+
group.style.gridTemplateColumns = '';
|
|
1601
|
+
group.style.gridTemplateRows = '';
|
|
1250
1602
|
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1603
|
+
var template = '';
|
|
1604
|
+
var percentages = 0;
|
|
1605
|
+
var withSizeCount = 0;
|
|
1254
1606
|
|
|
1255
|
-
|
|
1607
|
+
if (group instanceof TabLayoutGroup) {
|
|
1608
|
+
if (group.tabs) {
|
|
1609
|
+
group.tabs.remove();
|
|
1610
|
+
}
|
|
1256
1611
|
|
|
1257
|
-
|
|
1612
|
+
var header = document.createElement('div');
|
|
1613
|
+
header.classList.add('jqx-layout-tab-strip');
|
|
1258
1614
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
that.dispatchEvent(new CustomEvent('resize'));
|
|
1263
|
-
});
|
|
1264
|
-
});
|
|
1265
|
-
}
|
|
1615
|
+
if (that._selectedItem && group.contains(that._selectedItem) && that._selectedItem instanceof TabLayoutItem) {
|
|
1616
|
+
group.selectedIndex = Math.max(0, group.items.indexOf(that._selectedItem));
|
|
1617
|
+
}
|
|
1266
1618
|
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
}));
|
|
1619
|
+
if (group.selectedIndex >= group.children.length) {
|
|
1620
|
+
group.selectedIndex = 0;
|
|
1621
|
+
}
|
|
1271
1622
|
|
|
1272
|
-
|
|
1623
|
+
for (var i = 0; i < group.children.length; i++) {
|
|
1624
|
+
var child = group.children[i];
|
|
1625
|
+
var childItem = that.getItem(child.getAttribute('index'));
|
|
1626
|
+
|
|
1627
|
+
if (!childItem) {
|
|
1628
|
+
continue;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
var tab = document.createElement('div');
|
|
1632
|
+
tab.classList.add('jqx-layout-tab');
|
|
1633
|
+
tab.innerHTML = '<label>' + childItem.label + '</label><span class="jqx-close-button"></span>';
|
|
1634
|
+
header.appendChild(tab);
|
|
1635
|
+
child.setAttribute('tab', '');
|
|
1636
|
+
child.classList.add('jqx-hidden');
|
|
1637
|
+
tab.content = child;
|
|
1638
|
+
tab.item = childItem;
|
|
1639
|
+
tab.group = item;
|
|
1640
|
+
|
|
1641
|
+
if (child.modifiers) {
|
|
1642
|
+
if (child.modifiers.indexOf('close') === -1) {
|
|
1643
|
+
tab.querySelector('.jqx-close-button').classList.add('jqx-hidden');
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
else {
|
|
1647
|
+
tab.querySelector('.jqx-close-button').classList.add('jqx-hidden');
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
if (undefined === group.selectedIndex || i === group.selectedIndex) {
|
|
1651
|
+
tab.classList.add('selected');
|
|
1652
|
+
child.classList.remove('jqx-hidden');
|
|
1653
|
+
group.selectedIndex = i;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
|
|
1657
|
+
tab.onpointerup = function (event) {
|
|
1658
|
+
if (event.target.classList.contains('jqx-close-button') && tab.close) {
|
|
1659
|
+
group.selectedIndex = 0;
|
|
1660
|
+
that._removeLayoutItem(that._selectedItem);
|
|
1661
|
+
that._handleItemClick(parent);
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
tab.onpointerdown = function (event) {
|
|
1665
|
+
var parent = this.closest('.jqx-layout-group');
|
|
1666
|
+
that._handleItemClick(this.content);
|
|
1667
|
+
tab.close = false;
|
|
1668
|
+
if (!event.target.classList.contains('jqx-close-button')) {
|
|
1669
|
+
if (childItem.modifiers && childItem.modifiers.indexOf('drag') >= 0 && parent.modifiers.indexOf('drag') >= 0) {
|
|
1670
|
+
that._beginDrag(parent, this, event);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
else {
|
|
1674
|
+
tab.close = true;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1273
1677
|
|
|
1274
|
-
|
|
1678
|
+
}
|
|
1275
1679
|
|
|
1276
|
-
that._dragDetails = null;
|
|
1277
|
-
}
|
|
1278
|
-
/**
|
|
1279
|
-
* Document up handler
|
|
1280
|
-
* @param {any} event
|
|
1281
|
-
*/
|
|
1282
1680
|
|
|
1283
|
-
|
|
1284
|
-
key: "_documentUpHandler",
|
|
1285
|
-
value: function _documentUpHandler(event) {
|
|
1286
|
-
var that = this,
|
|
1287
|
-
isMobile = JQX.Utilities.Core.isMobile,
|
|
1288
|
-
target = isMobile ? document.elementFromPoint(event.pageX - window.pageXOffset, event.pageY - window.pageYOffset) : event.target;
|
|
1681
|
+
group.tabs = header;
|
|
1289
1682
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1683
|
+
if (item.position === 'top' || item.position === 'left') {
|
|
1684
|
+
group.insertBefore(header, group.firstChild);
|
|
1685
|
+
}
|
|
1686
|
+
else {
|
|
1687
|
+
group.appendChild(header);
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
else {
|
|
1691
|
+
for (var i = 0; i < group.children.length; i++) {
|
|
1692
|
+
var child = group.children[i];
|
|
1693
|
+
|
|
1694
|
+
if (child.hasAttribute('size')) {
|
|
1695
|
+
var size = child.getAttribute('size');
|
|
1696
|
+
|
|
1697
|
+
var pixels = parseFloat(size);
|
|
1698
|
+
var groupSize = group.orientation === 'vertical' ? group.offsetWidth : group.offsetHeight;
|
|
1699
|
+
var percentage = size.indexOf('%') >= 0 ? parseFloat(size) : parseFloat((pixels / groupSize) * 100);
|
|
1700
|
+
|
|
1701
|
+
percentages += percentage;
|
|
1702
|
+
withSizeCount++;
|
|
1703
|
+
|
|
1704
|
+
if (withSizeCount === group.children.length) {
|
|
1705
|
+
if (percentages < 100) {
|
|
1706
|
+
template += '1fr ';
|
|
1707
|
+
percentages = 100;
|
|
1708
|
+
continue;
|
|
1709
|
+
}
|
|
1710
|
+
else if (percentages > 100) {
|
|
1711
|
+
percentages -= percentage;
|
|
1712
|
+
percentage = 100 - percentages;
|
|
1713
|
+
percentages = 100;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
else if (percentages > 100 || percentage === 0) {
|
|
1717
|
+
withSizeCount = group.children.length;
|
|
1718
|
+
percentages = 0;
|
|
1719
|
+
break;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
template += percentage + '% ';
|
|
1723
|
+
continue;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
template += '1fr ';
|
|
1727
|
+
}
|
|
1293
1728
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1729
|
+
if (withSizeCount === group.children.length) {
|
|
1730
|
+
if (percentages < 99 || percentages > 100) {
|
|
1731
|
+
template = '';
|
|
1297
1732
|
|
|
1298
|
-
|
|
1299
|
-
|
|
1733
|
+
for (var i = 0; i < group.children.length; i++) {
|
|
1734
|
+
var child = group.children[i];
|
|
1300
1735
|
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1736
|
+
child.removeAttribute('size');
|
|
1737
|
+
template += '1fr ';
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1304
1741
|
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1742
|
+
if (group.orientation === 'vertical') {
|
|
1743
|
+
group.style.gridTemplateColumns = template;
|
|
1744
|
+
}
|
|
1745
|
+
else {
|
|
1746
|
+
group.style.gridTemplateRows = template;
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1308
1749
|
|
|
1309
|
-
|
|
1310
|
-
|
|
1750
|
+
group.items = Array.from(group.children);
|
|
1751
|
+
group.items = group.items.filter(function (value) {
|
|
1752
|
+
return value !== group.tabs;
|
|
1753
|
+
});
|
|
1311
1754
|
}
|
|
1312
1755
|
|
|
1313
|
-
that.
|
|
1756
|
+
var layoutGroups = that.querySelectorAll('.jqx-layout-group');
|
|
1314
1757
|
|
|
1315
|
-
|
|
1758
|
+
for (var i = 0; i < layoutGroups.length; i++) {
|
|
1759
|
+
refreshLayoutGroup(layoutGroups[i]);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1316
1762
|
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
that.querySelectorAll('.jqx-element').forEach(function (control) {
|
|
1320
|
-
control.dispatchEvent(new CustomEvent('resize'));
|
|
1321
|
-
});
|
|
1322
|
-
return;
|
|
1323
|
-
}
|
|
1763
|
+
_beginDrag(parent, element, event) {
|
|
1764
|
+
var that = this;
|
|
1324
1765
|
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1766
|
+
if (that._dragDetails) {
|
|
1767
|
+
that._dragDetails.feedback.remove();
|
|
1768
|
+
}
|
|
1328
1769
|
|
|
1329
|
-
|
|
1770
|
+
var feedback = document.createElement('div');
|
|
1771
|
+
var overlay = document.createElement('div');
|
|
1772
|
+
var tabs = parent.querySelector('.jqx-layout-tab-strip');
|
|
1773
|
+
var label = '';
|
|
1330
1774
|
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1775
|
+
if (tabs) {
|
|
1776
|
+
for (var i = 0; i < Array.from(tabs.children).length; i++) {
|
|
1777
|
+
if (i === parent.selectedIndex) {
|
|
1778
|
+
label = tabs.children[i].innerText;
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1336
1781
|
}
|
|
1337
|
-
}
|
|
1338
1782
|
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
return;
|
|
1343
|
-
}
|
|
1783
|
+
feedback.innerHTML = `<jqx-split-layout><jqx-tab-layout-group><jqx-tab-layout-item label="${label}"></jqx-tab-layout-item></jqx-tab-layout-group></jqx-split-layout>`
|
|
1784
|
+
that._feedback = feedback;
|
|
1785
|
+
that._feedback.classList.add('jqx-split-layout-feedback', 'jqx-split-layout', 'jqx-widget');
|
|
1344
1786
|
|
|
1345
|
-
|
|
1346
|
-
var button = event.target;
|
|
1787
|
+
overlay.classList.add('jqx-split-layout-overlay');
|
|
1347
1788
|
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1789
|
+
that._dragDetails = {
|
|
1790
|
+
element: element.content,
|
|
1791
|
+
item: element.item,
|
|
1792
|
+
layoutGroup: element.group,
|
|
1793
|
+
parent: parent,
|
|
1794
|
+
overlay: overlay,
|
|
1795
|
+
feedback: feedback,
|
|
1796
|
+
pageX: event.pageX,
|
|
1797
|
+
pageY: event.pageY
|
|
1351
1798
|
}
|
|
1352
|
-
|
|
1353
|
-
delete that._target;
|
|
1354
|
-
}
|
|
1355
1799
|
}
|
|
1356
|
-
/**
|
|
1357
|
-
* Document Select Start event handler
|
|
1358
|
-
*/
|
|
1359
|
-
|
|
1360
|
-
}, {
|
|
1361
|
-
key: "_documentSelectStartHandler",
|
|
1362
|
-
value: function _documentSelectStartHandler(event) {
|
|
1363
|
-
var that = this;
|
|
1364
1800
|
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
}
|
|
1369
|
-
/**
|
|
1370
|
-
* Adds labels to the items that do not have set
|
|
1371
|
-
* @param {any} data
|
|
1372
|
-
*/
|
|
1801
|
+
moveChildren(oldItem, newItem) {
|
|
1802
|
+
newItem.innerHTML = '';
|
|
1803
|
+
var content = oldItem;
|
|
1373
1804
|
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
var data = [];
|
|
1379
|
-
|
|
1380
|
-
if (!index) {
|
|
1381
|
-
index = 0;
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
if (!path) {
|
|
1385
|
-
path = '';
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
for (var i = 0; i < layout.length; i++) {
|
|
1389
|
-
var layoutItem = layout[i];
|
|
1390
|
-
var item = {
|
|
1391
|
-
label: layoutItem.label,
|
|
1392
|
-
id: layoutItem.getAttribute('data-id'),
|
|
1393
|
-
orientation: layoutItem.orientation,
|
|
1394
|
-
size: layoutItem.size,
|
|
1395
|
-
min: layoutItem.min,
|
|
1396
|
-
type: layoutItem.type,
|
|
1397
|
-
modifiers: layoutItem.modifiers,
|
|
1398
|
-
position: layoutItem.position
|
|
1399
|
-
};
|
|
1400
|
-
layoutItem.removeAttribute('index');
|
|
1401
|
-
|
|
1402
|
-
if (layoutItem instanceof LayoutGroup) {
|
|
1403
|
-
data.push(item);
|
|
1404
|
-
item.index = path !== '' ? path + '.' + index : index.toString();
|
|
1405
|
-
layoutItem.setAttribute('index', item.index);
|
|
1406
|
-
|
|
1407
|
-
if (layoutItem.items) {
|
|
1408
|
-
var items = that._getDataSource(layoutItem.items, item.index, 0);
|
|
1409
|
-
|
|
1410
|
-
item.items = items;
|
|
1411
|
-
}
|
|
1412
|
-
} else if (layoutItem instanceof LayoutItem) {
|
|
1413
|
-
if (layoutItem.items) {
|
|
1414
|
-
var items = that._getDataSource(layoutItem.items, path, index);
|
|
1415
|
-
|
|
1416
|
-
data = data.concat(items);
|
|
1417
|
-
} else {
|
|
1418
|
-
item.index = path !== '' ? path + '.' + index : index.toString();
|
|
1419
|
-
layoutItem.setAttribute('index', item.index);
|
|
1420
|
-
data.push(item);
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
index++;
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
return data;
|
|
1805
|
+
while (content.firstChild) {
|
|
1806
|
+
var child = content.firstChild;
|
|
1807
|
+
newItem.appendChild(child);
|
|
1808
|
+
}
|
|
1428
1809
|
}
|
|
1429
|
-
/**
|
|
1430
|
-
* Generates the JSON array of the current structure of the element
|
|
1431
|
-
*/
|
|
1432
1810
|
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
value: function _getLayout() {
|
|
1436
|
-
var that = this;
|
|
1437
|
-
var group = !arguments.length ? that.$.itemsContainer : arguments[0];
|
|
1811
|
+
createLayoutItem(type, position) {
|
|
1812
|
+
var that = this;
|
|
1438
1813
|
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
}
|
|
1814
|
+
var getLayoutItem = function () {
|
|
1815
|
+
var item = document.createElement('jqx-layout-item');
|
|
1442
1816
|
|
|
1443
|
-
|
|
1444
|
-
that._dropArea.remove();
|
|
1445
|
-
}
|
|
1817
|
+
item.innerHTML = '';
|
|
1446
1818
|
|
|
1447
|
-
|
|
1819
|
+
that.dispatchEvent(new CustomEvent('createItem', { type: 'layoutItem', item: item }));
|
|
1448
1820
|
|
|
1449
|
-
|
|
1450
|
-
var splitter = splitters[i];
|
|
1451
|
-
|
|
1452
|
-
if (splitter !== that.$.splitter) {
|
|
1453
|
-
splitter.remove();
|
|
1821
|
+
return item;
|
|
1454
1822
|
}
|
|
1455
|
-
}
|
|
1456
1823
|
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
return value !== group.tabs && value.hasAttribute('data-id');
|
|
1460
|
-
});
|
|
1461
|
-
var items = group.items.map(function (value) {
|
|
1462
|
-
if (value.classList.contains('jqx-layout-tab-strip')) {
|
|
1463
|
-
return null;
|
|
1464
|
-
}
|
|
1824
|
+
var getTabLayoutItem = function () {
|
|
1825
|
+
var item = document.createElement('jqx-tab-layout-item');
|
|
1465
1826
|
|
|
1466
|
-
|
|
1467
|
-
var itemGroup = value instanceof LayoutGroup ? value : null;
|
|
1827
|
+
item.innerHTML = '';
|
|
1468
1828
|
|
|
1469
|
-
|
|
1470
|
-
|
|
1829
|
+
that.dispatchEvent(new CustomEvent('createItem', { type: 'tabLayoutItem', item: item }));
|
|
1830
|
+
|
|
1831
|
+
return item;
|
|
1471
1832
|
}
|
|
1472
1833
|
|
|
1473
|
-
|
|
1474
|
-
|
|
1834
|
+
var getLayoutGroup = function (position) {
|
|
1835
|
+
var item = document.createElement('jqx-layout-group');
|
|
1836
|
+
var orientation = position === 'top' || position === 'bottom' ? 'horizontal' : 'vertical';
|
|
1475
1837
|
|
|
1476
|
-
|
|
1477
|
-
return items.filter(function (value) {
|
|
1478
|
-
return value !== null && value !== group.tabs;
|
|
1479
|
-
});
|
|
1480
|
-
}
|
|
1838
|
+
that.dispatchEvent(new CustomEvent('createGroup', { type: 'layoutGroup', item: item }));
|
|
1481
1839
|
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
item.items = items.filter(function (value) {
|
|
1485
|
-
return value !== null && value !== group.tabs;
|
|
1486
|
-
});
|
|
1487
|
-
data.push(item);
|
|
1488
|
-
return data;
|
|
1489
|
-
}
|
|
1490
|
-
}, {
|
|
1491
|
-
key: "_updateSplitter",
|
|
1492
|
-
value: function _updateSplitter() {
|
|
1493
|
-
var that = this;
|
|
1840
|
+
item.setAttribute('orientation', orientation);
|
|
1841
|
+
item.orientation = orientation;
|
|
1494
1842
|
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
}
|
|
1843
|
+
return item;
|
|
1844
|
+
}
|
|
1498
1845
|
|
|
1499
|
-
|
|
1846
|
+
var getTabLayoutGroup = function (position) {
|
|
1847
|
+
var item = document.createElement('jqx-tab-layout-group');
|
|
1848
|
+
var orientation = position === 'top' || position === 'bottom' ? 'horizontal' : 'vertical';
|
|
1500
1849
|
|
|
1501
|
-
|
|
1850
|
+
item.setAttribute('orientation', orientation);
|
|
1851
|
+
item.orientation = orientation;
|
|
1502
1852
|
|
|
1503
|
-
|
|
1504
|
-
var item = items[i];
|
|
1853
|
+
that.dispatchEvent(new CustomEvent('tabLayoutGroup', { type: 'layoutGroup', item: item }));
|
|
1505
1854
|
|
|
1506
|
-
|
|
1507
|
-
continue;
|
|
1855
|
+
return item;
|
|
1508
1856
|
}
|
|
1509
1857
|
|
|
1510
|
-
if (
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1858
|
+
if (type === 'layoutItem' || !type) {
|
|
1859
|
+
return getLayoutItem();
|
|
1860
|
+
}
|
|
1861
|
+
else if (type === 'tabLayoutItem' || !type) {
|
|
1862
|
+
return getTabLayoutItem();
|
|
1863
|
+
}
|
|
1864
|
+
else if (type === 'tabLayoutGroup') {
|
|
1865
|
+
return getTabLayoutGroup(position);
|
|
1866
|
+
}
|
|
1867
|
+
else {
|
|
1868
|
+
return getLayoutGroup(position);
|
|
1516
1869
|
}
|
|
1517
|
-
|
|
1518
|
-
item.setAttribute('hover', '');
|
|
1519
|
-
|
|
1520
|
-
that._handleSplitter(item);
|
|
1521
|
-
}
|
|
1522
1870
|
}
|
|
1523
|
-
}, {
|
|
1524
|
-
key: "_hideSplitter",
|
|
1525
|
-
value: function _hideSplitter() {
|
|
1526
|
-
var that = this;
|
|
1527
|
-
var items = that.querySelectorAll('[data-id]');
|
|
1528
1871
|
|
|
1529
|
-
|
|
1530
|
-
var
|
|
1531
|
-
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1534
|
-
}, {
|
|
1535
|
-
key: "_removeSplitter",
|
|
1536
|
-
value: function _removeSplitter() {
|
|
1537
|
-
var that = this;
|
|
1538
|
-
var splitters = that.querySelectorAll('.jqx-layout-splitter');
|
|
1872
|
+
_addTabLayoutItem(targetItem, position, myItem) {
|
|
1873
|
+
var that = this;
|
|
1874
|
+
var newItem = that.createLayoutItem('tabLayoutItem');
|
|
1539
1875
|
|
|
1540
|
-
|
|
1541
|
-
var
|
|
1876
|
+
var parentLayoutGroup = targetItem.closest('jqx-tab-layout-group');
|
|
1877
|
+
var layoutGroup;
|
|
1542
1878
|
|
|
1543
|
-
if (
|
|
1544
|
-
|
|
1879
|
+
if (myItem) {
|
|
1880
|
+
newItem.label = myItem.label;
|
|
1881
|
+
newItem.modifiers = myItem.modifiers;
|
|
1882
|
+
that.moveChildren(myItem, newItem);
|
|
1545
1883
|
}
|
|
1546
|
-
}
|
|
1547
1884
|
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
* Handles item selection
|
|
1552
|
-
* @param {any} target - target element that was clicked
|
|
1553
|
-
* @param {any} isOnDemand - selection on demand
|
|
1554
|
-
*/
|
|
1885
|
+
var resetGroup = function (group) {
|
|
1886
|
+
for (var i = 0; i < group.children.length; i++) {
|
|
1887
|
+
var child = group.children[i];
|
|
1555
1888
|
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
value: function _handleItemClick(target) {
|
|
1559
|
-
var that = this,
|
|
1560
|
-
previouslySelectedIndex = that.selectedIndex;
|
|
1561
|
-
var item = null;
|
|
1562
|
-
|
|
1563
|
-
if (!target) {
|
|
1564
|
-
that.selectedIndex = null;
|
|
1565
|
-
that.querySelectorAll('[data-id]').forEach(function (i) {
|
|
1566
|
-
i.removeAttribute('selected');
|
|
1567
|
-
});
|
|
1568
|
-
that._selectedItem = null;
|
|
1569
|
-
return;
|
|
1570
|
-
} else {
|
|
1571
|
-
item = target instanceof HTMLElement ? target : that.querySelector('[data-id=' + target.id + ']');
|
|
1889
|
+
child.removeAttribute('size');
|
|
1890
|
+
}
|
|
1572
1891
|
|
|
1573
|
-
|
|
1574
|
-
that.selectedIndex = null;
|
|
1575
|
-
return;
|
|
1892
|
+
group.removeAttribute('size');
|
|
1576
1893
|
}
|
|
1577
1894
|
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
});
|
|
1895
|
+
var addTabItemChild = function (position) {
|
|
1896
|
+
targetItem.removeAttribute('size');
|
|
1581
1897
|
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1898
|
+
if (targetItem.querySelector('jqx-layout-group')) {
|
|
1899
|
+
that._addLayoutItem(targetItem.querySelector('jqx-layout-group'), position);
|
|
1900
|
+
}
|
|
1901
|
+
else {
|
|
1902
|
+
layoutGroup = that.createLayoutItem('layoutGroup', position);
|
|
1586
1903
|
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
item.setAttribute('hover', '');
|
|
1590
|
-
that._selectedItem = item;
|
|
1904
|
+
var newLayoutItem = that.createLayoutItem();
|
|
1905
|
+
that.moveChildren(targetItem, newLayoutItem)
|
|
1591
1906
|
|
|
1592
|
-
|
|
1593
|
-
|
|
1907
|
+
if (position === 'top' || position === 'left') {
|
|
1908
|
+
layoutGroup.appendChild(that.createLayoutItem());
|
|
1909
|
+
layoutGroup.appendChild(newLayoutItem);
|
|
1910
|
+
}
|
|
1911
|
+
else {
|
|
1912
|
+
layoutGroup.appendChild(newLayoutItem);
|
|
1913
|
+
layoutGroup.appendChild(that.createLayoutItem());
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
targetItem.appendChild(layoutGroup);
|
|
1917
|
+
}
|
|
1594
1918
|
}
|
|
1595
1919
|
|
|
1596
|
-
|
|
1920
|
+
var addRootTab = function (tabLayoutGroup, position) {
|
|
1597
1921
|
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
}
|
|
1922
|
+
var parentLayoutGroup = targetItem.parentElement;
|
|
1923
|
+
var layoutGroup = targetItem;
|
|
1924
|
+
var newLayoutGroup = that.createLayoutItem('layoutGroup', position);
|
|
1602
1925
|
|
|
1603
|
-
|
|
1604
|
-
}
|
|
1605
|
-
/**
|
|
1606
|
-
* Handles Layout Button click
|
|
1607
|
-
* @param {any} target
|
|
1608
|
-
*/
|
|
1926
|
+
parentLayoutGroup.insertBefore(newLayoutGroup, layoutGroup);
|
|
1609
1927
|
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1928
|
+
if (position === 'top' || position === 'left') {
|
|
1929
|
+
newLayoutGroup.append(tabLayoutGroup);
|
|
1930
|
+
newLayoutGroup.appendChild(layoutGroup);
|
|
1931
|
+
}
|
|
1932
|
+
else {
|
|
1933
|
+
newLayoutGroup.appendChild(layoutGroup);
|
|
1934
|
+
newLayoutGroup.append(tabLayoutGroup);
|
|
1935
|
+
}
|
|
1615
1936
|
|
|
1937
|
+
if (layoutGroup.getAttribute('data-id') === 'root') {
|
|
1938
|
+
layoutGroup.setAttribute('data-id', newLayoutGroup.getAttribute('data-id'));
|
|
1939
|
+
newLayoutGroup.setAttribute('data-id', 'root');
|
|
1940
|
+
that.$.itemsContainer = newLayoutGroup;
|
|
1941
|
+
}
|
|
1616
1942
|
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1943
|
+
resetGroup(layoutGroup);
|
|
1944
|
+
resetGroup(parentLayoutGroup);
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
if (myItem) {
|
|
1948
|
+
switch (position) {
|
|
1949
|
+
case 'center': {
|
|
1950
|
+
if (targetItem instanceof TabLayoutGroup || targetItem instanceof TabLayoutItem) {
|
|
1951
|
+
parentLayoutGroup.appendChild(newItem);
|
|
1952
|
+
}
|
|
1953
|
+
else {
|
|
1954
|
+
var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
|
|
1955
|
+
tabLayoutGroup.appendChild(newItem);
|
|
1956
|
+
|
|
1957
|
+
if (targetItem instanceof LayoutGroup && !(targetItem instanceof TabLayoutItem)) {
|
|
1958
|
+
targetItem.appendChild(tabLayoutGroup);
|
|
1959
|
+
resetGroup(targetItem);
|
|
1960
|
+
}
|
|
1961
|
+
else if (targetItem instanceof LayoutItem) {
|
|
1962
|
+
layoutGroup = that.createLayoutItem('layoutGroup');
|
|
1963
|
+
|
|
1964
|
+
targetItem.parentElement.insertBefore(layoutGroup, targetItem);
|
|
1965
|
+
layoutGroup.appendChild(targetItem);
|
|
1966
|
+
layoutGroup.appendChild(tabLayoutGroup);
|
|
1967
|
+
resetGroup(layoutGroup);
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
break;
|
|
1972
|
+
case 'left':
|
|
1973
|
+
case 'right': {
|
|
1974
|
+
var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
|
|
1975
|
+
tabLayoutGroup.appendChild(newItem);
|
|
1976
|
+
if (targetItem.getAttribute('data-id') === 'root') {
|
|
1977
|
+
tabLayoutGroup.position = position;
|
|
1978
|
+
addRootTab(tabLayoutGroup, position);
|
|
1979
|
+
}
|
|
1980
|
+
else {
|
|
1981
|
+
addRootTab(tabLayoutGroup, position);
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
break;
|
|
1985
|
+
case 'top':
|
|
1986
|
+
case 'bottom': {
|
|
1987
|
+
var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
|
|
1988
|
+
tabLayoutGroup.appendChild(newItem);
|
|
1989
|
+
|
|
1990
|
+
if (targetItem.getAttribute('data-id') === 'root') {
|
|
1991
|
+
tabLayoutGroup.position = position;
|
|
1992
|
+
addRootTab(tabLayoutGroup, position);
|
|
1993
|
+
}
|
|
1994
|
+
else {
|
|
1995
|
+
addRootTab(tabLayoutGroup, position);
|
|
1996
|
+
}
|
|
1997
|
+
break;
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
1621
2000
|
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
}, {
|
|
1625
|
-
key: "_removeLayoutItem",
|
|
1626
|
-
value: function _removeLayoutItem(item) {
|
|
1627
|
-
var that = this;
|
|
2001
|
+
return;
|
|
2002
|
+
}
|
|
1628
2003
|
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
2004
|
+
switch (position) {
|
|
2005
|
+
case 'center':
|
|
2006
|
+
if (targetItem instanceof TabLayoutGroup || targetItem instanceof TabLayoutItem) {
|
|
2007
|
+
parentLayoutGroup.appendChild(newItem);
|
|
2008
|
+
}
|
|
2009
|
+
else {
|
|
2010
|
+
addTabItemChild();
|
|
2011
|
+
}
|
|
2012
|
+
break;
|
|
2013
|
+
case 'left':
|
|
2014
|
+
case 'right':
|
|
2015
|
+
if (targetItem instanceof TabLayoutGroup) {
|
|
2016
|
+
var firstItem = targetItem.querySelector('jqx-tab-layout-item');
|
|
2017
|
+
|
|
2018
|
+
if (firstItem && position === 'left') {
|
|
2019
|
+
targetItem.insertBefore(newItem, firstItem);
|
|
2020
|
+
}
|
|
2021
|
+
else {
|
|
2022
|
+
targetItem.appendChild(newItem);
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
else if (targetItem instanceof TabLayoutItem) {
|
|
2026
|
+
var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
|
|
2027
|
+
var parentLayoutGroup = targetItem.parentElement;
|
|
1632
2028
|
|
|
1633
|
-
|
|
1634
|
-
var parent = item.parentElement;
|
|
1635
|
-
var currentParent = parent;
|
|
2029
|
+
tabLayoutGroup.appendChild(newItem);
|
|
1636
2030
|
|
|
1637
|
-
|
|
1638
|
-
if (parent.getAttribute('data-id') === 'root') {
|
|
1639
|
-
break;
|
|
1640
|
-
}
|
|
2031
|
+
layoutGroup = that.createLayoutItem('layoutGroup');
|
|
1641
2032
|
|
|
1642
|
-
|
|
1643
|
-
parent = parent.parentElement;
|
|
1644
|
-
}
|
|
2033
|
+
parentLayoutGroup.parentElement.insertBefore(layoutGroup, parentLayoutGroup);
|
|
1645
2034
|
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
2035
|
+
if (position === 'right') {
|
|
2036
|
+
layoutGroup.appendChild(parentLayoutGroup);
|
|
2037
|
+
layoutGroup.appendChild(tabLayoutGroup);
|
|
2038
|
+
}
|
|
2039
|
+
else if (position === 'left') {
|
|
2040
|
+
layoutGroup.appendChild(tabLayoutGroup);
|
|
2041
|
+
layoutGroup.appendChild(parentLayoutGroup);
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
else if (myItem) {
|
|
2045
|
+
var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
|
|
2046
|
+
tabLayoutGroup.appendChild(newItem);
|
|
2047
|
+
|
|
2048
|
+
if (targetItem instanceof LayoutGroup) {
|
|
2049
|
+
targetItem.insertBefore(targetItem.firstChild, tabLayoutGroup);
|
|
2050
|
+
}
|
|
2051
|
+
else if (targetItem instanceof LayoutItem) {
|
|
2052
|
+
layoutGroup = that.createLayoutItem('layoutGroup');
|
|
2053
|
+
layoutGroup.orientation = parentLayoutGroup.orientation;
|
|
2054
|
+
layoutGroup.setAttribute('orientation', parentLayoutGroup.orientation);
|
|
2055
|
+
|
|
2056
|
+
targetItem.removeAttribute('size');
|
|
2057
|
+
targetItem.parentElement.insertBefore(layoutGroup, targetItem);
|
|
2058
|
+
layoutGroup.appendChild(targetItem);
|
|
2059
|
+
layoutGroup.appendChild(tabLayoutGroup);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
else {
|
|
2063
|
+
addTabItemChild(position);
|
|
2064
|
+
}
|
|
2065
|
+
break;
|
|
2066
|
+
case 'top':
|
|
2067
|
+
case 'bottom':
|
|
2068
|
+
if (targetItem instanceof TabLayoutGroup) {
|
|
2069
|
+
layoutGroup = that.createLayoutItem('layoutGroup', 'top');
|
|
2070
|
+
targetItem.removeAttribute('size');
|
|
2071
|
+
|
|
2072
|
+
targetItem.parentElement.insertBefore(layoutGroup, targetItem);
|
|
2073
|
+
|
|
2074
|
+
if (position === 'top') {
|
|
2075
|
+
layoutGroup.appendChild(that.createLayoutItem());
|
|
2076
|
+
layoutGroup.appendChild(targetItem);
|
|
2077
|
+
}
|
|
2078
|
+
else {
|
|
2079
|
+
layoutGroup.appendChild(targetItem);
|
|
2080
|
+
layoutGroup.appendChild(that.createLayoutItem());
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
else {
|
|
2084
|
+
addTabItemChild(position);
|
|
2085
|
+
}
|
|
2086
|
+
break;
|
|
1650
2087
|
}
|
|
1651
|
-
} else {
|
|
1652
|
-
item.remove();
|
|
1653
|
-
}
|
|
1654
2088
|
|
|
1655
|
-
|
|
1656
|
-
that.dispatchEvent(new CustomEvent('stateChange', {
|
|
1657
|
-
type: 'delete',
|
|
1658
|
-
item: item
|
|
1659
|
-
}));
|
|
2089
|
+
that.refresh();
|
|
1660
2090
|
}
|
|
1661
|
-
/**
|
|
1662
|
-
* Refreshes the UI Component.
|
|
1663
|
-
*/
|
|
1664
2091
|
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
2092
|
+
/**
|
|
2093
|
+
* Creates a new item by splitting the target Splitter
|
|
2094
|
+
*/
|
|
2095
|
+
_addLayoutItem(targetItem, position, myItem) {
|
|
2096
|
+
var that = this;
|
|
1669
2097
|
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
2098
|
+
if (!targetItem) {
|
|
2099
|
+
return;
|
|
2100
|
+
}
|
|
1673
2101
|
|
|
1674
|
-
|
|
1675
|
-
|
|
2102
|
+
var resetGroup = function (group) {
|
|
2103
|
+
for (var i = 0; i < group.children.length; i++) {
|
|
2104
|
+
var child = group.children[i];
|
|
1676
2105
|
|
|
1677
|
-
|
|
1678
|
-
|
|
2106
|
+
child.removeAttribute('size');
|
|
2107
|
+
}
|
|
1679
2108
|
|
|
1680
|
-
|
|
1681
|
-
return;
|
|
2109
|
+
group.removeAttribute('size');
|
|
1682
2110
|
}
|
|
1683
2111
|
|
|
1684
|
-
|
|
1685
|
-
group.style.gridTemplateRows = '';
|
|
1686
|
-
var template = '';
|
|
1687
|
-
var percentages = 0;
|
|
1688
|
-
var withSizeCount = 0;
|
|
1689
|
-
|
|
1690
|
-
if (group instanceof TabLayoutGroup) {
|
|
1691
|
-
if (group.tabs) {
|
|
1692
|
-
group.tabs.remove();
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
var header = document.createElement('div');
|
|
1696
|
-
header.classList.add('jqx-layout-tab-strip');
|
|
2112
|
+
var isTabItem = targetItem instanceof TabLayoutItem || targetItem instanceof TabLayoutGroup || (myItem && myItem instanceof TabLayoutItem);
|
|
1697
2113
|
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
2114
|
+
if (isTabItem) {
|
|
2115
|
+
return that._addTabLayoutItem(targetItem, position, myItem);
|
|
2116
|
+
}
|
|
1701
2117
|
|
|
1702
|
-
|
|
1703
|
-
group.selectedIndex = 0;
|
|
1704
|
-
}
|
|
2118
|
+
var newItem = that.createLayoutItem();
|
|
1705
2119
|
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
var childItem = that.getItem(child.getAttribute('index'));
|
|
2120
|
+
var parentLayoutGroup = targetItem.closest('.jqx-layout-group');
|
|
2121
|
+
var layoutGroup;
|
|
1709
2122
|
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
2123
|
+
if (myItem) {
|
|
2124
|
+
that.moveChildren(myItem, newItem);
|
|
2125
|
+
}
|
|
1713
2126
|
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
child.setAttribute('tab', '');
|
|
1719
|
-
child.classList.add('jqx-hidden');
|
|
1720
|
-
tab.content = child;
|
|
1721
|
-
tab.item = childItem;
|
|
1722
|
-
tab.group = item;
|
|
2127
|
+
if (position === 'center') {
|
|
2128
|
+
if (targetItem instanceof LayoutGroup) {
|
|
2129
|
+
layoutGroup = parentLayoutGroup;
|
|
2130
|
+
layoutGroup.appendChild(newItem);
|
|
1723
2131
|
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
tab.querySelector('.jqx-close-button').classList.add('jqx-hidden');
|
|
1727
|
-
}
|
|
1728
|
-
} else {
|
|
1729
|
-
tab.querySelector('.jqx-close-button').classList.add('jqx-hidden');
|
|
1730
|
-
}
|
|
2132
|
+
resetGroup(layoutGroup);
|
|
2133
|
+
that.refresh();
|
|
1731
2134
|
|
|
1732
|
-
|
|
1733
|
-
tab.classList.add('selected');
|
|
1734
|
-
child.classList.remove('jqx-hidden');
|
|
1735
|
-
group.selectedIndex = i;
|
|
2135
|
+
return newItem;
|
|
1736
2136
|
}
|
|
2137
|
+
else if (targetItem instanceof LayoutItem) {
|
|
2138
|
+
layoutGroup = that.createLayoutItem('layoutGroup');
|
|
2139
|
+
layoutGroup.orientation = parentLayoutGroup.orientation;
|
|
2140
|
+
layoutGroup.setAttribute('orientation', parentLayoutGroup.orientation);
|
|
1737
2141
|
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
that._removeLayoutItem(that._selectedItem);
|
|
1743
|
-
|
|
1744
|
-
that._handleItemClick(parent);
|
|
1745
|
-
}
|
|
1746
|
-
};
|
|
2142
|
+
targetItem.removeAttribute('size');
|
|
2143
|
+
targetItem.parentElement.insertBefore(layoutGroup, targetItem);
|
|
2144
|
+
layoutGroup.appendChild(targetItem);
|
|
2145
|
+
layoutGroup.appendChild(newItem);
|
|
1747
2146
|
|
|
1748
|
-
|
|
1749
|
-
var parent = this.closest('.jqx-layout-group');
|
|
2147
|
+
that.refresh();
|
|
1750
2148
|
|
|
1751
|
-
|
|
2149
|
+
return layoutGroup;
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
1752
2152
|
|
|
1753
|
-
|
|
2153
|
+
if (parentLayoutGroup.orientation === 'vertical' && (position === 'left' || position === 'right') ||
|
|
2154
|
+
parentLayoutGroup.orientation === 'horizontal' && (position === 'top' || position === 'bottom')) {
|
|
2155
|
+
layoutGroup = parentLayoutGroup;
|
|
1754
2156
|
|
|
1755
|
-
|
|
1756
|
-
if (
|
|
1757
|
-
|
|
2157
|
+
if (targetItem instanceof LayoutGroup) {
|
|
2158
|
+
if (position === 'left' || position === 'top') {
|
|
2159
|
+
layoutGroup.insertBefore(newItem, layoutGroup.children[0]);
|
|
2160
|
+
}
|
|
2161
|
+
else {
|
|
2162
|
+
layoutGroup.appendChild(newItem);
|
|
1758
2163
|
}
|
|
1759
|
-
} else {
|
|
1760
|
-
tab.close = true;
|
|
1761
|
-
}
|
|
1762
|
-
};
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
group.tabs = header;
|
|
1766
|
-
|
|
1767
|
-
if (item.position === 'top' || item.position === 'left') {
|
|
1768
|
-
group.insertBefore(header, group.firstChild);
|
|
1769
|
-
} else {
|
|
1770
|
-
group.appendChild(header);
|
|
1771
|
-
}
|
|
1772
|
-
} else {
|
|
1773
|
-
for (var i = 0; i < group.children.length; i++) {
|
|
1774
|
-
var child = group.children[i];
|
|
1775
|
-
|
|
1776
|
-
if (child.hasAttribute('size')) {
|
|
1777
|
-
var size = child.getAttribute('size');
|
|
1778
|
-
var pixels = parseFloat(size);
|
|
1779
|
-
var groupSize = group.orientation === 'vertical' ? group.offsetWidth : group.offsetHeight;
|
|
1780
|
-
var percentage = size.indexOf('%') >= 0 ? parseFloat(size) : parseFloat(pixels / groupSize * 100);
|
|
1781
|
-
percentages += percentage;
|
|
1782
|
-
withSizeCount++;
|
|
1783
|
-
|
|
1784
|
-
if (withSizeCount === group.children.length) {
|
|
1785
|
-
if (percentages < 100) {
|
|
1786
|
-
template += '1fr ';
|
|
1787
|
-
percentages = 100;
|
|
1788
|
-
continue;
|
|
1789
|
-
} else if (percentages > 100) {
|
|
1790
|
-
percentages -= percentage;
|
|
1791
|
-
percentage = 100 - percentages;
|
|
1792
|
-
percentages = 100;
|
|
1793
|
-
}
|
|
1794
|
-
} else if (percentages > 100 || percentage === 0) {
|
|
1795
|
-
withSizeCount = group.children.length;
|
|
1796
|
-
percentages = 0;
|
|
1797
|
-
break;
|
|
1798
|
-
}
|
|
1799
2164
|
|
|
1800
|
-
|
|
1801
|
-
continue;
|
|
2165
|
+
resetGroup(targetItem);
|
|
1802
2166
|
}
|
|
2167
|
+
else {
|
|
2168
|
+
var layoutGroupItems = layoutGroup.items,
|
|
2169
|
+
newItemIndex = Math.max(0, layoutGroupItems.indexOf(targetItem) + (position === 'top' || position === 'left' ? 0 : 1));
|
|
1803
2170
|
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
if (withSizeCount === group.children.length) {
|
|
1808
|
-
if (percentages < 99 || percentages > 100) {
|
|
1809
|
-
template = '';
|
|
1810
|
-
|
|
1811
|
-
for (var i = 0; i < group.children.length; i++) {
|
|
1812
|
-
var child = group.children[i];
|
|
1813
|
-
child.removeAttribute('size');
|
|
1814
|
-
template += '1fr ';
|
|
1815
|
-
}
|
|
2171
|
+
layoutGroup.insertBefore(newItem, layoutGroupItems[newItemIndex]);
|
|
2172
|
+
resetGroup(layoutGroup);
|
|
1816
2173
|
}
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
if (group.orientation === 'vertical') {
|
|
1820
|
-
group.style.gridTemplateColumns = template;
|
|
1821
|
-
} else {
|
|
1822
|
-
group.style.gridTemplateRows = template;
|
|
1823
|
-
}
|
|
1824
2174
|
}
|
|
2175
|
+
else {
|
|
2176
|
+
if (targetItem instanceof LayoutGroup) {
|
|
2177
|
+
var parentLayoutGroup = targetItem.parentElement;
|
|
2178
|
+
layoutGroup = targetItem;
|
|
2179
|
+
var newLayoutGroup = that.createLayoutItem('layoutGroup', position);
|
|
1825
2180
|
|
|
1826
|
-
|
|
1827
|
-
group.items = group.items.filter(function (value) {
|
|
1828
|
-
return value !== group.tabs;
|
|
1829
|
-
});
|
|
1830
|
-
};
|
|
1831
|
-
|
|
1832
|
-
var layoutGroups = that.querySelectorAll('.jqx-layout-group');
|
|
2181
|
+
parentLayoutGroup.insertBefore(newLayoutGroup, layoutGroup);
|
|
1833
2182
|
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
2183
|
+
if (position === 'top' || position === 'left') {
|
|
2184
|
+
newLayoutGroup.append(newItem);
|
|
2185
|
+
newLayoutGroup.appendChild(layoutGroup);
|
|
2186
|
+
}
|
|
2187
|
+
else {
|
|
2188
|
+
newLayoutGroup.appendChild(layoutGroup);
|
|
2189
|
+
newLayoutGroup.append(newItem);
|
|
2190
|
+
}
|
|
1842
2191
|
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
var overlay = document.createElement('div');
|
|
1849
|
-
var tabs = parent.querySelector('.jqx-layout-tab-strip');
|
|
1850
|
-
var label = '';
|
|
1851
|
-
|
|
1852
|
-
if (tabs) {
|
|
1853
|
-
for (var i = 0; i < Array.from(tabs.children).length; i++) {
|
|
1854
|
-
if (i === parent.selectedIndex) {
|
|
1855
|
-
label = tabs.children[i].innerText;
|
|
1856
|
-
}
|
|
1857
|
-
}
|
|
1858
|
-
}
|
|
1859
|
-
|
|
1860
|
-
feedback.innerHTML = "<jqx-split-layout><jqx-tab-layout-group><jqx-tab-layout-item label=\"".concat(label, "\"></jqx-tab-layout-item></jqx-tab-layout-group></jqx-split-layout>");
|
|
1861
|
-
that._feedback = feedback;
|
|
1862
|
-
|
|
1863
|
-
that._feedback.classList.add('jqx-split-layout-feedback', 'jqx-split-layout', 'jqx-widget');
|
|
1864
|
-
|
|
1865
|
-
overlay.classList.add('jqx-split-layout-overlay');
|
|
1866
|
-
that._dragDetails = {
|
|
1867
|
-
element: element.content,
|
|
1868
|
-
item: element.item,
|
|
1869
|
-
layoutGroup: element.group,
|
|
1870
|
-
parent: parent,
|
|
1871
|
-
overlay: overlay,
|
|
1872
|
-
feedback: feedback,
|
|
1873
|
-
pageX: event.pageX,
|
|
1874
|
-
pageY: event.pageY
|
|
1875
|
-
};
|
|
1876
|
-
}
|
|
1877
|
-
}, {
|
|
1878
|
-
key: "moveChildren",
|
|
1879
|
-
value: function moveChildren(oldItem, newItem) {
|
|
1880
|
-
newItem.innerHTML = '';
|
|
1881
|
-
var content = oldItem;
|
|
1882
|
-
|
|
1883
|
-
while (content.firstChild) {
|
|
1884
|
-
var child = content.firstChild;
|
|
1885
|
-
newItem.appendChild(child);
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
}, {
|
|
1889
|
-
key: "createLayoutItem",
|
|
1890
|
-
value: function createLayoutItem(type, position) {
|
|
1891
|
-
var that = this;
|
|
1892
|
-
|
|
1893
|
-
var getLayoutItem = function getLayoutItem() {
|
|
1894
|
-
var item = document.createElement('jqx-layout-item');
|
|
1895
|
-
item.innerHTML = '';
|
|
1896
|
-
that.dispatchEvent(new CustomEvent('createItem', {
|
|
1897
|
-
type: 'layoutItem',
|
|
1898
|
-
item: item
|
|
1899
|
-
}));
|
|
1900
|
-
return item;
|
|
1901
|
-
};
|
|
1902
|
-
|
|
1903
|
-
var getTabLayoutItem = function getTabLayoutItem() {
|
|
1904
|
-
var item = document.createElement('jqx-tab-layout-item');
|
|
1905
|
-
item.innerHTML = '';
|
|
1906
|
-
that.dispatchEvent(new CustomEvent('createItem', {
|
|
1907
|
-
type: 'tabLayoutItem',
|
|
1908
|
-
item: item
|
|
1909
|
-
}));
|
|
1910
|
-
return item;
|
|
1911
|
-
};
|
|
1912
|
-
|
|
1913
|
-
var getLayoutGroup = function getLayoutGroup(position) {
|
|
1914
|
-
var item = document.createElement('jqx-layout-group');
|
|
1915
|
-
var orientation = position === 'top' || position === 'bottom' ? 'horizontal' : 'vertical';
|
|
1916
|
-
that.dispatchEvent(new CustomEvent('createGroup', {
|
|
1917
|
-
type: 'layoutGroup',
|
|
1918
|
-
item: item
|
|
1919
|
-
}));
|
|
1920
|
-
item.setAttribute('orientation', orientation);
|
|
1921
|
-
item.orientation = orientation;
|
|
1922
|
-
return item;
|
|
1923
|
-
};
|
|
1924
|
-
|
|
1925
|
-
var getTabLayoutGroup = function getTabLayoutGroup(position) {
|
|
1926
|
-
var item = document.createElement('jqx-tab-layout-group');
|
|
1927
|
-
var orientation = position === 'top' || position === 'bottom' ? 'horizontal' : 'vertical';
|
|
1928
|
-
item.setAttribute('orientation', orientation);
|
|
1929
|
-
item.orientation = orientation;
|
|
1930
|
-
that.dispatchEvent(new CustomEvent('tabLayoutGroup', {
|
|
1931
|
-
type: 'layoutGroup',
|
|
1932
|
-
item: item
|
|
1933
|
-
}));
|
|
1934
|
-
return item;
|
|
1935
|
-
};
|
|
1936
|
-
|
|
1937
|
-
if (type === 'layoutItem' || !type) {
|
|
1938
|
-
return getLayoutItem();
|
|
1939
|
-
} else if (type === 'tabLayoutItem' || !type) {
|
|
1940
|
-
return getTabLayoutItem();
|
|
1941
|
-
} else if (type === 'tabLayoutGroup') {
|
|
1942
|
-
return getTabLayoutGroup(position);
|
|
1943
|
-
} else {
|
|
1944
|
-
return getLayoutGroup(position);
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
}, {
|
|
1948
|
-
key: "_addTabLayoutItem",
|
|
1949
|
-
value: function _addTabLayoutItem(targetItem, position, myItem) {
|
|
1950
|
-
var that = this;
|
|
1951
|
-
var newItem = that.createLayoutItem('tabLayoutItem');
|
|
1952
|
-
var parentLayoutGroup = targetItem.closest('jqx-tab-layout-group');
|
|
1953
|
-
var layoutGroup;
|
|
1954
|
-
|
|
1955
|
-
if (myItem) {
|
|
1956
|
-
newItem.label = myItem.label;
|
|
1957
|
-
newItem.modifiers = myItem.modifiers;
|
|
1958
|
-
that.moveChildren(myItem, newItem);
|
|
1959
|
-
}
|
|
1960
|
-
|
|
1961
|
-
var resetGroup = function resetGroup(group) {
|
|
1962
|
-
for (var i = 0; i < group.children.length; i++) {
|
|
1963
|
-
var child = group.children[i];
|
|
1964
|
-
child.removeAttribute('size');
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
group.removeAttribute('size');
|
|
1968
|
-
};
|
|
1969
|
-
|
|
1970
|
-
var addTabItemChild = function addTabItemChild(position) {
|
|
1971
|
-
targetItem.removeAttribute('size');
|
|
1972
|
-
|
|
1973
|
-
if (targetItem.querySelector('jqx-layout-group')) {
|
|
1974
|
-
that._addLayoutItem(targetItem.querySelector('jqx-layout-group'), position);
|
|
1975
|
-
} else {
|
|
1976
|
-
layoutGroup = that.createLayoutItem('layoutGroup', position);
|
|
1977
|
-
var newLayoutItem = that.createLayoutItem();
|
|
1978
|
-
that.moveChildren(targetItem, newLayoutItem);
|
|
1979
|
-
|
|
1980
|
-
if (position === 'top' || position === 'left') {
|
|
1981
|
-
layoutGroup.appendChild(that.createLayoutItem());
|
|
1982
|
-
layoutGroup.appendChild(newLayoutItem);
|
|
1983
|
-
} else {
|
|
1984
|
-
layoutGroup.appendChild(newLayoutItem);
|
|
1985
|
-
layoutGroup.appendChild(that.createLayoutItem());
|
|
1986
|
-
}
|
|
1987
|
-
|
|
1988
|
-
targetItem.appendChild(layoutGroup);
|
|
1989
|
-
}
|
|
1990
|
-
};
|
|
1991
|
-
|
|
1992
|
-
var addRootTab = function addRootTab(tabLayoutGroup, position) {
|
|
1993
|
-
var parentLayoutGroup = targetItem.parentElement;
|
|
1994
|
-
var layoutGroup = targetItem;
|
|
1995
|
-
var newLayoutGroup = that.createLayoutItem('layoutGroup', position);
|
|
1996
|
-
parentLayoutGroup.insertBefore(newLayoutGroup, layoutGroup);
|
|
1997
|
-
|
|
1998
|
-
if (position === 'top' || position === 'left') {
|
|
1999
|
-
newLayoutGroup.append(tabLayoutGroup);
|
|
2000
|
-
newLayoutGroup.appendChild(layoutGroup);
|
|
2001
|
-
} else {
|
|
2002
|
-
newLayoutGroup.appendChild(layoutGroup);
|
|
2003
|
-
newLayoutGroup.append(tabLayoutGroup);
|
|
2004
|
-
}
|
|
2005
|
-
|
|
2006
|
-
if (layoutGroup.getAttribute('data-id') === 'root') {
|
|
2007
|
-
layoutGroup.setAttribute('data-id', newLayoutGroup.getAttribute('data-id'));
|
|
2008
|
-
newLayoutGroup.setAttribute('data-id', 'root');
|
|
2009
|
-
that.$.itemsContainer = newLayoutGroup;
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
resetGroup(layoutGroup);
|
|
2013
|
-
resetGroup(parentLayoutGroup);
|
|
2014
|
-
};
|
|
2015
|
-
|
|
2016
|
-
if (myItem) {
|
|
2017
|
-
switch (position) {
|
|
2018
|
-
case 'center':
|
|
2019
|
-
{
|
|
2020
|
-
if (targetItem instanceof TabLayoutGroup || targetItem instanceof TabLayoutItem) {
|
|
2021
|
-
parentLayoutGroup.appendChild(newItem);
|
|
2022
|
-
} else {
|
|
2023
|
-
var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
|
|
2024
|
-
tabLayoutGroup.appendChild(newItem);
|
|
2025
|
-
|
|
2026
|
-
if (targetItem instanceof LayoutGroup && !(targetItem instanceof TabLayoutItem)) {
|
|
2027
|
-
targetItem.appendChild(tabLayoutGroup);
|
|
2028
|
-
resetGroup(targetItem);
|
|
2029
|
-
} else if (targetItem instanceof LayoutItem) {
|
|
2030
|
-
layoutGroup = that.createLayoutItem('layoutGroup');
|
|
2031
|
-
targetItem.parentElement.insertBefore(layoutGroup, targetItem);
|
|
2032
|
-
layoutGroup.appendChild(targetItem);
|
|
2033
|
-
layoutGroup.appendChild(tabLayoutGroup);
|
|
2034
|
-
resetGroup(layoutGroup);
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
break;
|
|
2039
|
-
|
|
2040
|
-
case 'left':
|
|
2041
|
-
case 'right':
|
|
2042
|
-
{
|
|
2043
|
-
var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
|
|
2044
|
-
tabLayoutGroup.appendChild(newItem);
|
|
2045
|
-
|
|
2046
|
-
if (targetItem.getAttribute('data-id') === 'root') {
|
|
2047
|
-
tabLayoutGroup.position = position;
|
|
2048
|
-
addRootTab(tabLayoutGroup, position);
|
|
2049
|
-
} else {
|
|
2050
|
-
addRootTab(tabLayoutGroup, position);
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
break;
|
|
2054
|
-
|
|
2055
|
-
case 'top':
|
|
2056
|
-
case 'bottom':
|
|
2057
|
-
{
|
|
2058
|
-
var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
|
|
2059
|
-
tabLayoutGroup.appendChild(newItem);
|
|
2060
|
-
|
|
2061
|
-
if (targetItem.getAttribute('data-id') === 'root') {
|
|
2062
|
-
tabLayoutGroup.position = position;
|
|
2063
|
-
addRootTab(tabLayoutGroup, position);
|
|
2064
|
-
} else {
|
|
2065
|
-
addRootTab(tabLayoutGroup, position);
|
|
2066
|
-
}
|
|
2067
|
-
|
|
2068
|
-
break;
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
2071
|
-
|
|
2072
|
-
return;
|
|
2073
|
-
}
|
|
2074
|
-
|
|
2075
|
-
switch (position) {
|
|
2076
|
-
case 'center':
|
|
2077
|
-
if (targetItem instanceof TabLayoutGroup || targetItem instanceof TabLayoutItem) {
|
|
2078
|
-
parentLayoutGroup.appendChild(newItem);
|
|
2079
|
-
} else {
|
|
2080
|
-
addTabItemChild();
|
|
2081
|
-
}
|
|
2082
|
-
|
|
2083
|
-
break;
|
|
2084
|
-
|
|
2085
|
-
case 'left':
|
|
2086
|
-
case 'right':
|
|
2087
|
-
if (targetItem instanceof TabLayoutGroup) {
|
|
2088
|
-
var firstItem = targetItem.querySelector('jqx-tab-layout-item');
|
|
2089
|
-
|
|
2090
|
-
if (firstItem && position === 'left') {
|
|
2091
|
-
targetItem.insertBefore(newItem, firstItem);
|
|
2092
|
-
} else {
|
|
2093
|
-
targetItem.appendChild(newItem);
|
|
2094
|
-
}
|
|
2095
|
-
} else if (targetItem instanceof TabLayoutItem) {
|
|
2096
|
-
var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
|
|
2097
|
-
var parentLayoutGroup = targetItem.parentElement;
|
|
2098
|
-
tabLayoutGroup.appendChild(newItem);
|
|
2099
|
-
layoutGroup = that.createLayoutItem('layoutGroup');
|
|
2100
|
-
parentLayoutGroup.parentElement.insertBefore(layoutGroup, parentLayoutGroup);
|
|
2192
|
+
if (layoutGroup.getAttribute('data-id') === 'root') {
|
|
2193
|
+
layoutGroup.setAttribute('data-id', newLayoutGroup.getAttribute('data-id'));
|
|
2194
|
+
newLayoutGroup.setAttribute('data-id', 'root');
|
|
2195
|
+
that.$.itemsContainer = newLayoutGroup;
|
|
2196
|
+
}
|
|
2101
2197
|
|
|
2102
|
-
|
|
2103
|
-
layoutGroup.appendChild(parentLayoutGroup);
|
|
2104
|
-
layoutGroup.appendChild(tabLayoutGroup);
|
|
2105
|
-
} else if (position === 'left') {
|
|
2106
|
-
layoutGroup.appendChild(tabLayoutGroup);
|
|
2107
|
-
layoutGroup.appendChild(parentLayoutGroup);
|
|
2198
|
+
resetGroup(parentLayoutGroup);
|
|
2108
2199
|
}
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
tabLayoutGroup.appendChild(newItem);
|
|
2200
|
+
else {
|
|
2201
|
+
layoutGroup = that.createLayoutItem('layoutGroup', position);
|
|
2112
2202
|
|
|
2113
|
-
|
|
2114
|
-
targetItem.insertBefore(targetItem.firstChild, tabLayoutGroup);
|
|
2115
|
-
} else if (targetItem instanceof LayoutItem) {
|
|
2116
|
-
layoutGroup = that.createLayoutItem('layoutGroup');
|
|
2117
|
-
layoutGroup.orientation = parentLayoutGroup.orientation;
|
|
2118
|
-
layoutGroup.setAttribute('orientation', parentLayoutGroup.orientation);
|
|
2119
|
-
targetItem.removeAttribute('size');
|
|
2120
|
-
targetItem.parentElement.insertBefore(layoutGroup, targetItem);
|
|
2121
|
-
layoutGroup.appendChild(targetItem);
|
|
2122
|
-
layoutGroup.appendChild(tabLayoutGroup);
|
|
2123
|
-
}
|
|
2124
|
-
} else {
|
|
2125
|
-
addTabItemChild(position);
|
|
2126
|
-
}
|
|
2127
|
-
|
|
2128
|
-
break;
|
|
2129
|
-
|
|
2130
|
-
case 'top':
|
|
2131
|
-
case 'bottom':
|
|
2132
|
-
if (targetItem instanceof TabLayoutGroup) {
|
|
2133
|
-
layoutGroup = that.createLayoutItem('layoutGroup', 'top');
|
|
2134
|
-
targetItem.removeAttribute('size');
|
|
2135
|
-
targetItem.parentElement.insertBefore(layoutGroup, targetItem);
|
|
2203
|
+
parentLayoutGroup.insertBefore(layoutGroup, targetItem);
|
|
2136
2204
|
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2205
|
+
if (position === 'top' || position === 'left') {
|
|
2206
|
+
layoutGroup.appendChild(newItem);
|
|
2207
|
+
layoutGroup.appendChild(targetItem);
|
|
2208
|
+
}
|
|
2209
|
+
else {
|
|
2210
|
+
layoutGroup.appendChild(targetItem);
|
|
2211
|
+
layoutGroup.appendChild(newItem);
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
resetGroup(layoutGroup);
|
|
2143
2215
|
}
|
|
2144
|
-
|
|
2145
|
-
addTabItemChild(position);
|
|
2146
|
-
}
|
|
2216
|
+
}
|
|
2147
2217
|
|
|
2148
|
-
|
|
2149
|
-
}
|
|
2218
|
+
that.refresh();
|
|
2150
2219
|
|
|
2151
|
-
|
|
2220
|
+
return newItem;
|
|
2152
2221
|
}
|
|
2153
|
-
/**
|
|
2154
|
-
* Creates a new item by splitting the target Splitter
|
|
2155
|
-
*/
|
|
2156
2222
|
|
|
2157
|
-
}, {
|
|
2158
|
-
key: "_addLayoutItem",
|
|
2159
|
-
value: function _addLayoutItem(targetItem, position, myItem) {
|
|
2160
|
-
var that = this;
|
|
2161
|
-
|
|
2162
|
-
if (!targetItem) {
|
|
2163
|
-
return;
|
|
2164
|
-
}
|
|
2165
|
-
|
|
2166
|
-
var resetGroup = function resetGroup(group) {
|
|
2167
|
-
for (var i = 0; i < group.children.length; i++) {
|
|
2168
|
-
var child = group.children[i];
|
|
2169
|
-
child.removeAttribute('size');
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
group.removeAttribute('size');
|
|
2173
|
-
};
|
|
2174
|
-
|
|
2175
|
-
var isTabItem = targetItem instanceof TabLayoutItem || targetItem instanceof TabLayoutGroup || myItem && myItem instanceof TabLayoutItem;
|
|
2176
|
-
|
|
2177
|
-
if (isTabItem) {
|
|
2178
|
-
return that._addTabLayoutItem(targetItem, position, myItem);
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
|
-
var newItem = that.createLayoutItem();
|
|
2182
|
-
var parentLayoutGroup = targetItem.closest('.jqx-layout-group');
|
|
2183
|
-
var layoutGroup;
|
|
2184
|
-
|
|
2185
|
-
if (myItem) {
|
|
2186
|
-
that.moveChildren(myItem, newItem);
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2189
|
-
if (position === 'center') {
|
|
2190
|
-
if (targetItem instanceof LayoutGroup) {
|
|
2191
|
-
layoutGroup = parentLayoutGroup;
|
|
2192
|
-
layoutGroup.appendChild(newItem);
|
|
2193
|
-
resetGroup(layoutGroup);
|
|
2194
|
-
that.refresh();
|
|
2195
|
-
return newItem;
|
|
2196
|
-
} else if (targetItem instanceof LayoutItem) {
|
|
2197
|
-
layoutGroup = that.createLayoutItem('layoutGroup');
|
|
2198
|
-
layoutGroup.orientation = parentLayoutGroup.orientation;
|
|
2199
|
-
layoutGroup.setAttribute('orientation', parentLayoutGroup.orientation);
|
|
2200
|
-
targetItem.removeAttribute('size');
|
|
2201
|
-
targetItem.parentElement.insertBefore(layoutGroup, targetItem);
|
|
2202
|
-
layoutGroup.appendChild(targetItem);
|
|
2203
|
-
layoutGroup.appendChild(newItem);
|
|
2204
|
-
that.refresh();
|
|
2205
|
-
return layoutGroup;
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
if (parentLayoutGroup.orientation === 'vertical' && (position === 'left' || position === 'right') || parentLayoutGroup.orientation === 'horizontal' && (position === 'top' || position === 'bottom')) {
|
|
2210
|
-
layoutGroup = parentLayoutGroup;
|
|
2211
|
-
|
|
2212
|
-
if (targetItem instanceof LayoutGroup) {
|
|
2213
|
-
if (position === 'left' || position === 'top') {
|
|
2214
|
-
layoutGroup.insertBefore(newItem, layoutGroup.children[0]);
|
|
2215
|
-
} else {
|
|
2216
|
-
layoutGroup.appendChild(newItem);
|
|
2217
|
-
}
|
|
2218
|
-
|
|
2219
|
-
resetGroup(targetItem);
|
|
2220
|
-
} else {
|
|
2221
|
-
var layoutGroupItems = layoutGroup.items,
|
|
2222
|
-
newItemIndex = Math.max(0, layoutGroupItems.indexOf(targetItem) + (position === 'top' || position === 'left' ? 0 : 1));
|
|
2223
|
-
layoutGroup.insertBefore(newItem, layoutGroupItems[newItemIndex]);
|
|
2224
|
-
resetGroup(layoutGroup);
|
|
2225
|
-
}
|
|
2226
|
-
} else {
|
|
2227
|
-
if (targetItem instanceof LayoutGroup) {
|
|
2228
|
-
var parentLayoutGroup = targetItem.parentElement;
|
|
2229
|
-
layoutGroup = targetItem;
|
|
2230
|
-
var newLayoutGroup = that.createLayoutItem('layoutGroup', position);
|
|
2231
|
-
parentLayoutGroup.insertBefore(newLayoutGroup, layoutGroup);
|
|
2232
|
-
|
|
2233
|
-
if (position === 'top' || position === 'left') {
|
|
2234
|
-
newLayoutGroup.append(newItem);
|
|
2235
|
-
newLayoutGroup.appendChild(layoutGroup);
|
|
2236
|
-
} else {
|
|
2237
|
-
newLayoutGroup.appendChild(layoutGroup);
|
|
2238
|
-
newLayoutGroup.append(newItem);
|
|
2239
|
-
}
|
|
2240
|
-
|
|
2241
|
-
if (layoutGroup.getAttribute('data-id') === 'root') {
|
|
2242
|
-
layoutGroup.setAttribute('data-id', newLayoutGroup.getAttribute('data-id'));
|
|
2243
|
-
newLayoutGroup.setAttribute('data-id', 'root');
|
|
2244
|
-
that.$.itemsContainer = newLayoutGroup;
|
|
2245
|
-
}
|
|
2246
|
-
|
|
2247
|
-
resetGroup(parentLayoutGroup);
|
|
2248
|
-
} else {
|
|
2249
|
-
layoutGroup = that.createLayoutItem('layoutGroup', position);
|
|
2250
|
-
parentLayoutGroup.insertBefore(layoutGroup, targetItem);
|
|
2251
|
-
|
|
2252
|
-
if (position === 'top' || position === 'left') {
|
|
2253
|
-
layoutGroup.appendChild(newItem);
|
|
2254
|
-
layoutGroup.appendChild(targetItem);
|
|
2255
|
-
} else {
|
|
2256
|
-
layoutGroup.appendChild(targetItem);
|
|
2257
|
-
layoutGroup.appendChild(newItem);
|
|
2258
|
-
}
|
|
2259
|
-
|
|
2260
|
-
resetGroup(layoutGroup);
|
|
2261
|
-
}
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
|
-
that.refresh();
|
|
2265
|
-
return newItem;
|
|
2266
|
-
}
|
|
2267
2223
|
/**
|
|
2268
2224
|
* Shows/Hides the Add buttons
|
|
2269
2225
|
* @param {any} item
|
|
2270
2226
|
*/
|
|
2227
|
+
_handleButtonsVisibility(item) {
|
|
2228
|
+
var that = this;
|
|
2271
2229
|
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2230
|
+
if (!that._buttons) {
|
|
2231
|
+
that._buttons = document.createElement('div');
|
|
2232
|
+
that._buttons.classList.add('jqx-layout-buttons-container');
|
|
2233
|
+
that._buttons.innerHTML = `<div role="button" position="top"></div>
|
|
2234
|
+
<div role="button" position="bottom"></div>
|
|
2235
|
+
<div role="button" position="center"></div>
|
|
2236
|
+
<div role="button" position="left"></div>
|
|
2237
|
+
<div role="button" position="right"></div>`;
|
|
2279
2238
|
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
that._buttons.innerHTML = "<div role=\"button\" position=\"top\"></div>\n <div role=\"button\" position=\"bottom\"></div>\n <div role=\"button\" position=\"center\"></div>\n <div role=\"button\" position=\"left\"></div>\n <div role=\"button\" position=\"right\"></div>";
|
|
2283
|
-
}
|
|
2239
|
+
}
|
|
2284
2240
|
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2241
|
+
if (!item) {
|
|
2242
|
+
if (that._buttons.parentElement) {
|
|
2243
|
+
that._buttons.parentElement.removeChild(that._buttons);
|
|
2288
2244
|
|
|
2289
|
-
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2290
2247
|
}
|
|
2291
|
-
}
|
|
2292
2248
|
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2249
|
+
if (item) {
|
|
2250
|
+
var buttonPosition = item._buttonPosition || [],
|
|
2251
|
+
buttons = that._buttons.children;
|
|
2296
2252
|
|
|
2297
|
-
for (var b = 0; b < buttons.length; b++) {
|
|
2298
|
-
var button = buttons[b];
|
|
2299
|
-
button.position = button.getAttribute('position');
|
|
2300
|
-
button.item = item;
|
|
2301
|
-
buttonPosition.length && buttonPosition.indexOf(button.getAttribute('position')) < 0 ? button.classList.add('jqx-hidden') : button.classList.remove('jqx-hidden');
|
|
2302
2253
|
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
};
|
|
2254
|
+
for (var b = 0; b < buttons.length; b++) {
|
|
2255
|
+
var button = buttons[b];
|
|
2306
2256
|
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2257
|
+
button.position = button.getAttribute('position');
|
|
2258
|
+
button.item = item;
|
|
2259
|
+
buttonPosition.length && buttonPosition.indexOf(button.getAttribute('position')) < 0 ? button.classList.add('jqx-hidden') : button.classList.remove('jqx-hidden');
|
|
2260
|
+
|
|
2261
|
+
button.onmouseenter = function () {
|
|
2262
|
+
button.setAttribute('hover', '');
|
|
2263
|
+
}
|
|
2264
|
+
button.onmouseleave = function () {
|
|
2265
|
+
button.removeAttribute('hover')
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2311
2268
|
|
|
2312
|
-
|
|
2313
|
-
|
|
2269
|
+
if (that.allowLiveSplit && that._buttons.parentElement !== item) {
|
|
2270
|
+
item.appendChild(that._buttons);
|
|
2271
|
+
}
|
|
2314
2272
|
}
|
|
2315
|
-
}
|
|
2316
2273
|
}
|
|
2317
|
-
}, {
|
|
2318
|
-
key: "_handleDropArea",
|
|
2319
|
-
value: function _handleDropArea(item) {
|
|
2320
|
-
var position = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'center';
|
|
2321
|
-
var that = this;
|
|
2322
2274
|
|
|
2323
|
-
|
|
2324
|
-
var
|
|
2275
|
+
_handleDropArea(item, position = 'center') {
|
|
2276
|
+
var that = this;
|
|
2277
|
+
|
|
2278
|
+
var positionDropArea = function (position) {
|
|
2279
|
+
var areaSize = 50;
|
|
2280
|
+
|
|
2281
|
+
switch (position) {
|
|
2282
|
+
case 'left':
|
|
2283
|
+
that._dropArea.style.top = '0px';
|
|
2284
|
+
that._dropArea.style.left = '0px';
|
|
2285
|
+
that._dropArea.style.width = areaSize + '%';
|
|
2286
|
+
that._dropArea.style.height = '100%';
|
|
2287
|
+
break;
|
|
2288
|
+
case 'right':
|
|
2289
|
+
that._dropArea.style.top = '0px';
|
|
2290
|
+
that._dropArea.style.left = `calc(100% - ${areaSize}%)`;
|
|
2291
|
+
that._dropArea.style.width = areaSize + '%';
|
|
2292
|
+
that._dropArea.style.height = '100%';
|
|
2293
|
+
break;
|
|
2294
|
+
case 'top':
|
|
2295
|
+
that._dropArea.style.top = '0px';
|
|
2296
|
+
that._dropArea.style.left = '0px';
|
|
2297
|
+
that._dropArea.style.width = '100%';
|
|
2298
|
+
that._dropArea.style.height = areaSize + '%';
|
|
2299
|
+
break;
|
|
2300
|
+
case 'bottom':
|
|
2301
|
+
that._dropArea.style.top = `calc(100% - ${areaSize}%)`;
|
|
2302
|
+
that._dropArea.style.left = '0px';
|
|
2303
|
+
that._dropArea.style.width = '100%';
|
|
2304
|
+
that._dropArea.style.height = areaSize + '%';
|
|
2305
|
+
break;
|
|
2306
|
+
case 'center':
|
|
2307
|
+
that._dropArea.style.top = '0px';
|
|
2308
|
+
that._dropArea.style.left = '0px';
|
|
2309
|
+
that._dropArea.style.width = '100%';
|
|
2310
|
+
that._dropArea.style.height = '100%';
|
|
2311
|
+
break;
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2325
2314
|
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
that._dropArea.style.width = areaSize + '%';
|
|
2331
|
-
that._dropArea.style.height = '100%';
|
|
2332
|
-
break;
|
|
2333
|
-
|
|
2334
|
-
case 'right':
|
|
2335
|
-
that._dropArea.style.top = '0px';
|
|
2336
|
-
that._dropArea.style.left = "calc(100% - ".concat(areaSize, "%)");
|
|
2337
|
-
that._dropArea.style.width = areaSize + '%';
|
|
2338
|
-
that._dropArea.style.height = '100%';
|
|
2339
|
-
break;
|
|
2340
|
-
|
|
2341
|
-
case 'top':
|
|
2342
|
-
that._dropArea.style.top = '0px';
|
|
2343
|
-
that._dropArea.style.left = '0px';
|
|
2344
|
-
that._dropArea.style.width = '100%';
|
|
2345
|
-
that._dropArea.style.height = areaSize + '%';
|
|
2346
|
-
break;
|
|
2347
|
-
|
|
2348
|
-
case 'bottom':
|
|
2349
|
-
that._dropArea.style.top = "calc(100% - ".concat(areaSize, "%)");
|
|
2350
|
-
that._dropArea.style.left = '0px';
|
|
2351
|
-
that._dropArea.style.width = '100%';
|
|
2352
|
-
that._dropArea.style.height = areaSize + '%';
|
|
2353
|
-
break;
|
|
2354
|
-
|
|
2355
|
-
case 'center':
|
|
2356
|
-
that._dropArea.style.top = '0px';
|
|
2357
|
-
that._dropArea.style.left = '0px';
|
|
2358
|
-
that._dropArea.style.width = '100%';
|
|
2359
|
-
that._dropArea.style.height = '100%';
|
|
2360
|
-
break;
|
|
2361
|
-
}
|
|
2362
|
-
};
|
|
2363
|
-
|
|
2364
|
-
if (that._dropArea && that._dropArea.parentElement === item) {
|
|
2365
|
-
positionDropArea(position);
|
|
2366
|
-
return;
|
|
2367
|
-
}
|
|
2315
|
+
if (that._dropArea && that._dropArea.parentElement === item) {
|
|
2316
|
+
positionDropArea(position);
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2368
2319
|
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2320
|
+
if (that._dropArea) {
|
|
2321
|
+
that._dropArea.remove();
|
|
2322
|
+
}
|
|
2372
2323
|
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2324
|
+
if (!that._dragDetails || !item) {
|
|
2325
|
+
return;
|
|
2326
|
+
}
|
|
2376
2327
|
|
|
2377
|
-
|
|
2328
|
+
that._dropArea = document.createElement('div');
|
|
2329
|
+
that._dropArea.classList.add('jqx-layout-drop-area');
|
|
2378
2330
|
|
|
2379
|
-
|
|
2331
|
+
item.appendChild(that._dropArea);
|
|
2380
2332
|
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
positionDropArea(position);
|
|
2333
|
+
that._dropArea.style.opacity = 1;
|
|
2334
|
+
positionDropArea(position);
|
|
2384
2335
|
}
|
|
2385
|
-
}, {
|
|
2386
|
-
key: "_handleSplitter",
|
|
2387
|
-
value: function _handleSplitter(item) {
|
|
2388
|
-
var that = this;
|
|
2389
|
-
|
|
2390
|
-
if (!item) {
|
|
2391
|
-
return;
|
|
2392
|
-
}
|
|
2393
|
-
|
|
2394
|
-
if (item.hasAttribute('tab')) {
|
|
2395
|
-
item = item.parentElement;
|
|
2396
|
-
}
|
|
2397
2336
|
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
}
|
|
2337
|
+
_handleSplitter(item) {
|
|
2338
|
+
var that = this;
|
|
2401
2339
|
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
if (that._dragDetails && that._dragDetails.dragging) {
|
|
2407
|
-
item._splitter.remove();
|
|
2340
|
+
if (!item) {
|
|
2341
|
+
return;
|
|
2342
|
+
}
|
|
2408
2343
|
|
|
2409
|
-
|
|
2410
|
-
|
|
2344
|
+
if (item.hasAttribute('tab')) {
|
|
2345
|
+
item = item.parentElement;
|
|
2346
|
+
}
|
|
2411
2347
|
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2348
|
+
if (item._splitter) {
|
|
2349
|
+
item._splitter.remove();
|
|
2350
|
+
}
|
|
2415
2351
|
|
|
2416
|
-
|
|
2417
|
-
|
|
2352
|
+
if (!item._splitter) {
|
|
2353
|
+
item._splitter = document.createElement('div');
|
|
2354
|
+
}
|
|
2418
2355
|
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2356
|
+
if (that._dragDetails && that._dragDetails.dragging) {
|
|
2357
|
+
item._splitter.remove();
|
|
2358
|
+
return;
|
|
2359
|
+
}
|
|
2422
2360
|
|
|
2423
|
-
item.
|
|
2361
|
+
if (item.modifiers.indexOf('resize') === -1) {
|
|
2362
|
+
return;
|
|
2363
|
+
}
|
|
2424
2364
|
|
|
2425
|
-
|
|
2365
|
+
item.appendChild(item._splitter);
|
|
2426
2366
|
|
|
2427
|
-
|
|
2428
|
-
item._splitter.classList.add(orientation);
|
|
2429
|
-
} else if (item.previousElementSibling && item.previousElementSibling.hasAttribute('data-id')) {
|
|
2430
|
-
item._splitter.classList.add(orientation);
|
|
2367
|
+
var layoutGroup = item.parentElement;
|
|
2431
2368
|
|
|
2432
|
-
|
|
2433
|
-
|
|
2369
|
+
if (layoutGroup) {
|
|
2370
|
+
item._splitter.className = 'jqx-layout-splitter';
|
|
2434
2371
|
|
|
2435
|
-
|
|
2436
|
-
splitter.style.top = '';
|
|
2437
|
-
splitter.style.left = '';
|
|
2438
|
-
splitter.style.bottom = '';
|
|
2439
|
-
splitter.style.right = '';
|
|
2372
|
+
item._splitter.item = item;
|
|
2440
2373
|
|
|
2441
|
-
|
|
2442
|
-
var item = event.target.item;
|
|
2443
|
-
item.style.overflow = 'hidden';
|
|
2444
|
-
that._resizeDetails = {
|
|
2445
|
-
splitter: event.target,
|
|
2446
|
-
splitterRect: event.target.getBoundingClientRect(),
|
|
2447
|
-
itemRect: item.getBoundingClientRect(),
|
|
2448
|
-
item: item,
|
|
2449
|
-
itemSize: item.size,
|
|
2450
|
-
group: item.parentElement,
|
|
2451
|
-
clientX: event.clientX,
|
|
2452
|
-
clientY: event.clientY
|
|
2453
|
-
};
|
|
2374
|
+
item._splitter.removeAttribute('drag');
|
|
2454
2375
|
|
|
2455
|
-
|
|
2456
|
-
that.querySelectorAll('[data-id]').forEach(function (i) {
|
|
2457
|
-
i.removeAttribute('selected');
|
|
2458
|
-
});
|
|
2459
|
-
that.selectedIndex = item.getAttribute('index');
|
|
2460
|
-
item.setAttribute('selected', '');
|
|
2461
|
-
that._selectedItem = item;
|
|
2376
|
+
var orientation = layoutGroup.orientation;
|
|
2462
2377
|
|
|
2463
|
-
|
|
2378
|
+
if (item.nextElementSibling && item.nextElementSibling.hasAttribute('data-id')) {
|
|
2379
|
+
item._splitter.classList.add(orientation);
|
|
2464
2380
|
}
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
that._resizeDetails.previousItem = item.previousElementSibling;
|
|
2469
|
-
that._resizeDetails.previousItemSize = item.previousElementSibling.size;
|
|
2470
|
-
that._resizeDetails.previousItem.style.overflow = 'hidden';
|
|
2471
|
-
} else {
|
|
2472
|
-
that._resizeDetails.previousItemRect = null;
|
|
2473
|
-
that._resizeDetails.previousItem = null;
|
|
2381
|
+
else if (item.previousElementSibling && item.previousElementSibling.hasAttribute('data-id')) {
|
|
2382
|
+
item._splitter.classList.add(orientation);
|
|
2383
|
+
item._splitter.classList.add('last');
|
|
2474
2384
|
}
|
|
2475
2385
|
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2386
|
+
var handleResize = function (splitter) {
|
|
2387
|
+
splitter.style.top = '';
|
|
2388
|
+
splitter.style.left = '';
|
|
2389
|
+
splitter.style.bottom = '';
|
|
2390
|
+
splitter.style.right = '';
|
|
2391
|
+
|
|
2392
|
+
splitter.onpointerdown = function (event) {
|
|
2393
|
+
var item = event.target.item;
|
|
2394
|
+
item.style.overflow = 'hidden';
|
|
2395
|
+
|
|
2396
|
+
that._resizeDetails = {
|
|
2397
|
+
splitter: event.target,
|
|
2398
|
+
splitterRect: event.target.getBoundingClientRect(),
|
|
2399
|
+
itemRect: item.getBoundingClientRect(),
|
|
2400
|
+
item: item,
|
|
2401
|
+
itemSize: item.size,
|
|
2402
|
+
group: item.parentElement,
|
|
2403
|
+
clientX: event.clientX,
|
|
2404
|
+
clientY: event.clientY
|
|
2405
|
+
}
|
|
2406
|
+
|
|
2407
|
+
if (that._selectedItem !== item) {
|
|
2408
|
+
that.querySelectorAll('[data-id]').forEach(function (i) { i.removeAttribute('selected') });
|
|
2409
|
+
that.selectedIndex = item.getAttribute('index');
|
|
2410
|
+
item.setAttribute('selected', '');
|
|
2411
|
+
that._selectedItem = item;
|
|
2412
|
+
that._handleButtonsVisibility(item);
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
if (item.previousElementSibling && item.previousElementSibling.hasAttribute('data-id')) {
|
|
2416
|
+
that._resizeDetails.previousItemRect = item.previousElementSibling.getBoundingClientRect();
|
|
2417
|
+
that._resizeDetails.previousItem = item.previousElementSibling;
|
|
2418
|
+
that._resizeDetails.previousItemSize = item.previousElementSibling.size;
|
|
2419
|
+
that._resizeDetails.previousItem.style.overflow = 'hidden';
|
|
2420
|
+
}
|
|
2421
|
+
else {
|
|
2422
|
+
that._resizeDetails.previousItemRect = null;
|
|
2423
|
+
that._resizeDetails.previousItem = null;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
if (item.nextElementSibling && item.nextElementSibling.hasAttribute('data-id')) {
|
|
2427
|
+
that._resizeDetails.nextItemRect = item.nextElementSibling.getBoundingClientRect();
|
|
2428
|
+
that._resizeDetails.nextItem = item.nextElementSibling;
|
|
2429
|
+
that._resizeDetails.nextItemSize = item.nextElementSibling.size;
|
|
2430
|
+
that._resizeDetails.nextItem.style.overflow = 'hidden';
|
|
2431
|
+
}
|
|
2432
|
+
else {
|
|
2433
|
+
that._resizeDetails.nextItemRect = null;
|
|
2434
|
+
that._resizeDetails.nextItem = null;
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2484
2437
|
}
|
|
2485
|
-
};
|
|
2486
|
-
};
|
|
2487
2438
|
|
|
2488
|
-
|
|
2489
|
-
|
|
2439
|
+
handleResize(item._splitter);
|
|
2440
|
+
}
|
|
2490
2441
|
}
|
|
2491
|
-
|
|
2442
|
+
}
|
|
2492
2443
|
|
|
2493
|
-
return SplitLayout;
|
|
2494
|
-
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
2495
2444
|
|
|
2496
2445
|
customElements.define('jqx-layout-group', LayoutGroup);
|
|
2497
2446
|
customElements.define('jqx-layout-item', LayoutItem);
|
|
2498
2447
|
customElements.define('jqx-tab-layout-group', TabLayoutGroup);
|
|
2499
2448
|
customElements.define('jqx-tab-layout-item', TabLayoutItem);
|
|
2500
2449
|
customElements.define('jqx-split-layout', SplitLayout);
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2450
|
+
})();
|