@refinitiv-ui/efx-grid 6.0.91 → 6.0.93
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/column-dragging/es6/ColumnDragging.d.ts +1 -1
- package/lib/column-dragging/es6/ColumnDragging.js +144 -34
- package/lib/core/dist/core.js +2410 -2621
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/ColumnStats.js +14 -14
- package/lib/core/es6/data/DataCache.js +118 -118
- package/lib/core/es6/data/DataTable.d.ts +3 -1
- package/lib/core/es6/data/DataTable.js +208 -190
- package/lib/core/es6/data/DataView.d.ts +1 -1
- package/lib/core/es6/data/DataView.js +291 -291
- package/lib/core/es6/data/Segment.js +79 -79
- package/lib/core/es6/data/SegmentCollection.js +81 -81
- package/lib/core/es6/data/WrappedView.js +41 -41
- package/lib/core/es6/grid/Core.js +635 -635
- package/lib/core/es6/grid/ILayoutGrid.js +1 -1
- package/lib/core/es6/grid/LayoutGrid.js +183 -183
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +91 -91
- package/lib/core/es6/grid/components/Cell.js +29 -29
- package/lib/core/es6/grid/components/CellFloatingPanel.js +11 -11
- package/lib/core/es6/grid/components/CellSpan.js +7 -7
- package/lib/core/es6/grid/components/CellSpans.js +36 -34
- package/lib/core/es6/grid/components/Column.js +40 -40
- package/lib/core/es6/grid/components/ElementWrapper.js +17 -17
- package/lib/core/es6/grid/components/HScrollbar.js +31 -31
- package/lib/core/es6/grid/components/Scrollbar.js +77 -77
- package/lib/core/es6/grid/components/StretchedCells.js +49 -49
- package/lib/core/es6/grid/components/VScrollbar.js +11 -11
- package/lib/core/es6/grid/components/VirtualItems.js +3 -3
- package/lib/core/es6/grid/event/EventDispatcher.js +9 -9
- package/lib/core/es6/grid/event/EventListeners.js +4 -4
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +186 -186
- package/lib/core/es6/grid/util/Conflator.js +4 -4
- package/lib/core/es6/grid/util/Reverter.js +1 -1
- package/lib/core/es6/grid/util/SectionSettings.js +20 -20
- package/lib/core/es6/grid/util/SelectionList.js +23 -23
- package/lib/core/es6/grid/util/TrackLayout.js +74 -74
- package/lib/core/es6/grid/util/Virtualizer.js +15 -15
- package/lib/core/es6/grid/util/util.js +20 -20
- package/lib/core/es6/index.d.ts +0 -2
- package/lib/core/es6/index.js +0 -3
- package/lib/filter-dialog/lib/filter-dialog.js +1 -0
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +193 -70
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +46 -30
- package/lib/rt-grid/es6/RowDefinition.d.ts +2 -1
- package/lib/rt-grid/es6/RowDefinition.js +74 -16
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +56 -1
- package/lib/tr-grid-checkbox/es6/Checkbox.js +268 -268
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +3 -2
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +60 -32
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +279 -279
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +227 -207
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +11 -11
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +1 -2
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +120 -121
- package/lib/tr-grid-util/es6/CellPainter.js +94 -104
- package/lib/tr-grid-util/es6/Conflator.js +4 -4
- package/lib/tr-grid-util/es6/CoralItems.js +6 -6
- package/lib/tr-grid-util/es6/DateTime.js +41 -41
- package/lib/tr-grid-util/es6/Deferred.js +5 -5
- package/lib/tr-grid-util/es6/Delay.d.ts +3 -3
- package/lib/tr-grid-util/es6/Delay.js +14 -3
- package/lib/tr-grid-util/es6/Dom.js +26 -26
- package/lib/tr-grid-util/es6/DragUI.js +17 -17
- package/lib/tr-grid-util/es6/ElementObserver.js +12 -12
- package/lib/tr-grid-util/es6/ElementWrapper.js +2 -2
- package/lib/tr-grid-util/es6/ElfDate.js +4 -4
- package/lib/tr-grid-util/es6/ElfUtil.js +37 -37
- package/lib/tr-grid-util/es6/EventDispatcher.js +12 -12
- package/lib/tr-grid-util/es6/ExpanderIcon.js +6 -6
- package/lib/tr-grid-util/es6/ExpressionParser.js +43 -43
- package/lib/tr-grid-util/es6/Ext.js +6 -6
- package/lib/tr-grid-util/es6/FieldFormatter.js +17 -17
- package/lib/tr-grid-util/es6/FilterBuilder.js +57 -58
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +12 -1
- package/lib/tr-grid-util/es6/FilterOperators.js +13 -2
- package/lib/tr-grid-util/es6/GridPlugin.js +86 -87
- package/lib/tr-grid-util/es6/GroupDefinitions.js +90 -90
- package/lib/tr-grid-util/es6/Icon.js +4 -4
- package/lib/tr-grid-util/es6/MouseDownTrait.js +6 -6
- package/lib/tr-grid-util/es6/MultiTableManager.js +71 -80
- package/lib/tr-grid-util/es6/NumberFormatter.js +23 -23
- package/lib/tr-grid-util/es6/PercentBar.js +17 -17
- package/lib/tr-grid-util/es6/Perf.js +5 -5
- package/lib/tr-grid-util/es6/Popup.js +42 -42
- package/lib/tr-grid-util/es6/RangeBar.js +5 -5
- package/lib/tr-grid-util/es6/RequestQueue.js +5 -5
- package/lib/tr-grid-util/es6/RowPainter.js +23 -23
- package/lib/tr-grid-util/es6/SubTable.js +94 -94
- package/lib/tr-grid-util/es6/Table.js +51 -51
- package/lib/tr-grid-util/es6/TextHighlighter.js +52 -52
- package/lib/tr-grid-util/es6/TickCodes.js +2 -2
- package/lib/tr-grid-util/es6/Timer.js +2 -2
- package/lib/tr-grid-util/es6/TouchProxy.js +7 -7
- package/lib/tr-grid-util/es6/Util.js +50 -50
- package/lib/tr-grid-util/es6/formula/ADCService.js +2 -2
- package/lib/tr-grid-util/es6/formula/ADCSubscription.js +19 -19
- package/lib/tr-grid-util/es6/formula/AdFinService.js +2 -2
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +19 -19
- package/lib/tr-grid-util/es6/formula/Engine.js +56 -56
- package/lib/tr-grid-util/es6/formula/Formula.js +62 -62
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +3 -3
- package/lib/tr-grid-util/es6/formula/Realtime.js +15 -15
- package/lib/tr-grid-util/es6/formula/RealtimeService.js +15 -15
- package/lib/tr-grid-util/es6/formula/TSIService.js +2 -2
- package/lib/tr-grid-util/es6/formula/TSISubscription.js +104 -104
- package/lib/tr-grid-util/es6/formula/VariableToken.js +20 -20
- package/lib/tr-grid-util/es6/formula/functions/AdFin.js +10 -10
- package/lib/tr-grid-util/es6/formula/functions/Excel.js +1 -1
- package/lib/tr-grid-util/es6/formula/functions/Info.js +2 -2
- package/lib/tr-grid-util/es6/formula/functions/Internal.js +5 -5
- package/lib/tr-grid-util/es6/formula/functions/Logic.js +5 -5
- package/lib/tr-grid-util/es6/formula/functions/Math.js +46 -46
- package/lib/tr-grid-util/es6/formula/functions/Statistics.js +27 -27
- package/lib/tr-grid-util/es6/formula/functions/Text.js +19 -19
- package/lib/tr-grid-util/es6/index.js +1 -1
- package/lib/tr-grid-util/es6/jet/Adc.js +36 -36
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +11 -11
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +95 -95
- package/lib/tr-grid-util/es6/jet/DataSet.js +1 -1
- package/lib/tr-grid-util/es6/jet/MockArchive.js +5 -5
- package/lib/tr-grid-util/es6/jet/MockJET.js +1 -1
- package/lib/tr-grid-util/es6/jet/MockQuotes.js +13 -13
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +100 -100
- package/lib/tr-grid-util/es6/jet/MockRTK.js +4 -4
- package/lib/tr-grid-util/es6/jet/MockUtil.js +2 -2
- package/lib/tr-grid-util/es6/jet/index.js +1 -1
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +15 -15
- package/lib/tr-grid-util/es6/locale/translation-de.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-en.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-ja.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-zh.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation.js +1 -1
- package/lib/types/es6/ColumnDragging.d.ts +1 -1
- package/lib/types/es6/ColumnGrouping.d.ts +3 -1
- package/lib/types/es6/Core/data/DataTable.d.ts +4 -0
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
- package/lib/types/es6/Core/index.d.ts +0 -2
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -1
- package/lib/types/es6/RowDragging.d.ts +1 -2
- package/lib/versions.json +12 -12
- package/package.json +1 -1
- package/lib/core/es6/grid/util/ElementFrameWork.d.ts +0 -18
- package/lib/core/es6/grid/util/ElementFrameWork.js +0 -227
- package/lib/core/es6/grid/util/HttpRequest.d.ts +0 -53
- package/lib/core/es6/grid/util/HttpRequest.js +0 -371
- package/lib/core/es6/grid/util/PercentBar.d.ts +0 -43
- package/lib/core/es6/grid/util/PercentBar.js +0 -390
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +0 -41
- package/lib/core/es6/grid/util/PercentBarRenderer.js +0 -316
- package/lib/core/es6/grid/util/RangeBar.d.ts +0 -25
- package/lib/core/es6/grid/util/RangeBar.js +0 -255
- package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +0 -18
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +0 -53
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +0 -43
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +0 -41
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +0 -25
@@ -1,371 +0,0 @@
|
|
1
|
-
import EventDispatcher from "../event/EventDispatcher.js";
|
2
|
-
import Ext from "../../../../tr-grid-util/es6/Ext.js";
|
3
|
-
|
4
|
-
/**
|
5
|
-
* @event HttpRequest#loadstart
|
6
|
-
*/
|
7
|
-
/** Triggered when the request is responded with a success
|
8
|
-
* @event HttpRequest#load
|
9
|
-
*/
|
10
|
-
/** Triggered when the request is responded with an error
|
11
|
-
* @event HttpRequest#error
|
12
|
-
*/
|
13
|
-
/** Triggered when the request is aborted
|
14
|
-
* @event HttpRequest#abort
|
15
|
-
*/
|
16
|
-
/** Triggered when the request is timeout
|
17
|
-
* @event HttpRequest#timeout
|
18
|
-
*/
|
19
|
-
/** Triggered when the request is completed (after HttpRequest#load, HttpRequest#error, HttpRequest#abort, or HttpRequest#timeout)
|
20
|
-
* @event HttpRequest#loadend
|
21
|
-
*/
|
22
|
-
|
23
|
-
/** @constructor
|
24
|
-
* @extends {EventDispatcher}
|
25
|
-
* @mixes Promise
|
26
|
-
* @param {string} url
|
27
|
-
* @param {Object|string=} payload
|
28
|
-
* @param {string=} opt_serviceName
|
29
|
-
*/
|
30
|
-
var HttpRequest = function(url, payload, opt_serviceName) {
|
31
|
-
this._onDone = this._onDone.bind(this);
|
32
|
-
|
33
|
-
if(url) {
|
34
|
-
this._url = url;
|
35
|
-
}
|
36
|
-
if(payload) {
|
37
|
-
if(typeof payload === "string") {
|
38
|
-
this._payloadText = payload;
|
39
|
-
try {
|
40
|
-
this._payload = /** @type{Object} */(JSON.parse(this._payloadText));
|
41
|
-
} catch(err) { }
|
42
|
-
} else if (typeof payload === "object") {
|
43
|
-
this._payload = payload;
|
44
|
-
this._payloadText = JSON.stringify(payload);
|
45
|
-
} else {
|
46
|
-
this._payloadText = payload + "";
|
47
|
-
try {
|
48
|
-
this._payload = /** @type{Object} */(JSON.parse(this._payloadText));
|
49
|
-
} catch(err) { }
|
50
|
-
}
|
51
|
-
}
|
52
|
-
if(opt_serviceName) {
|
53
|
-
this._serviceName = opt_serviceName;
|
54
|
-
}
|
55
|
-
|
56
|
-
this._promise = new Promise(function(resolve, reject) {
|
57
|
-
this._resolve = resolve;
|
58
|
-
this._reject = reject;
|
59
|
-
}.bind(this));
|
60
|
-
|
61
|
-
this._state = "pending";
|
62
|
-
this._timeout = HttpRequest["defaultTimeout"];
|
63
|
-
|
64
|
-
this._addEvents(
|
65
|
-
"loadstart",
|
66
|
-
"load",
|
67
|
-
"error",
|
68
|
-
"abort",
|
69
|
-
"timeout",
|
70
|
-
"loadend"
|
71
|
-
);
|
72
|
-
};
|
73
|
-
Ext.inherits(HttpRequest, EventDispatcher);
|
74
|
-
|
75
|
-
/**@type {number}
|
76
|
-
* @public
|
77
|
-
*/
|
78
|
-
HttpRequest["defaultTimeout"] = 30000;
|
79
|
-
|
80
|
-
/**@type {XMLHttpRequest}
|
81
|
-
* @private
|
82
|
-
*/
|
83
|
-
HttpRequest.prototype._xhr = null;
|
84
|
-
/**@type {string}
|
85
|
-
* @private
|
86
|
-
*/
|
87
|
-
HttpRequest.prototype._url = "";
|
88
|
-
/**@type {string}
|
89
|
-
* @private
|
90
|
-
*/
|
91
|
-
HttpRequest.prototype._type = "POST";
|
92
|
-
/**@type {Object}
|
93
|
-
* @private
|
94
|
-
*/
|
95
|
-
HttpRequest.prototype._payload = null;
|
96
|
-
/**@type {string}
|
97
|
-
* @private
|
98
|
-
*/
|
99
|
-
HttpRequest.prototype._payloadText = "";
|
100
|
-
/**@type {string}
|
101
|
-
* @private
|
102
|
-
*/
|
103
|
-
HttpRequest.prototype._serviceName = "";
|
104
|
-
/**@type {string}
|
105
|
-
* @private
|
106
|
-
*/
|
107
|
-
HttpRequest.prototype._state = "";
|
108
|
-
|
109
|
-
/**@type {boolean}
|
110
|
-
* @private
|
111
|
-
*/
|
112
|
-
HttpRequest.prototype._sent = false;
|
113
|
-
/**@type {boolean}
|
114
|
-
* @private
|
115
|
-
*/
|
116
|
-
HttpRequest.prototype._done = false;
|
117
|
-
|
118
|
-
/**@type {Object|string}
|
119
|
-
* @private
|
120
|
-
*/
|
121
|
-
HttpRequest.prototype._response = null;
|
122
|
-
/**@type {string}
|
123
|
-
* @private
|
124
|
-
*/
|
125
|
-
HttpRequest.prototype._responseText = "";
|
126
|
-
/**@type {string}
|
127
|
-
* @private
|
128
|
-
*/
|
129
|
-
HttpRequest.prototype._responseType = "json";
|
130
|
-
/**@type {number}
|
131
|
-
* @private
|
132
|
-
*/
|
133
|
-
HttpRequest.prototype._timeout = 0;
|
134
|
-
|
135
|
-
/**@type {number}
|
136
|
-
* @private
|
137
|
-
*/
|
138
|
-
HttpRequest.prototype._responseStatus = NaN;
|
139
|
-
|
140
|
-
/**@type {!Promise}
|
141
|
-
* @private
|
142
|
-
*/
|
143
|
-
HttpRequest.prototype._promise;
|
144
|
-
/**@type {Function}
|
145
|
-
* @private
|
146
|
-
*/
|
147
|
-
HttpRequest.prototype._resolve = null; // Nullable
|
148
|
-
/**@type {Function}
|
149
|
-
* @private
|
150
|
-
*/
|
151
|
-
HttpRequest.prototype._reject = null; // Nullable
|
152
|
-
|
153
|
-
/** @public
|
154
|
-
* @return {string}
|
155
|
-
*/
|
156
|
-
HttpRequest.prototype.getUrl = function() { return this._url; };
|
157
|
-
/** @public
|
158
|
-
* @return {string}
|
159
|
-
*/
|
160
|
-
HttpRequest.prototype.getType = function() { return this._type; };
|
161
|
-
/** @public
|
162
|
-
* @return {Object}
|
163
|
-
*/
|
164
|
-
HttpRequest.prototype.getPayload = function() { return this._payload; };
|
165
|
-
/** @public
|
166
|
-
* @return {string}
|
167
|
-
*/
|
168
|
-
HttpRequest.prototype.getPayloadText = function() { return this._payloadText; };
|
169
|
-
/** @public
|
170
|
-
* @return {string}
|
171
|
-
*/
|
172
|
-
HttpRequest.prototype.getState = function() { return this._state; };
|
173
|
-
/** @public
|
174
|
-
* @return {Object|string}
|
175
|
-
*/
|
176
|
-
HttpRequest.prototype.getResponse = function() { return this._response; };
|
177
|
-
/** @public
|
178
|
-
* @return {string}
|
179
|
-
*/
|
180
|
-
HttpRequest.prototype.getResponseText = function() { return this._responseText; };
|
181
|
-
/** @public
|
182
|
-
* @return {number}
|
183
|
-
*/
|
184
|
-
HttpRequest.prototype.getResponseStatus = function() { return this._responseStatus; };
|
185
|
-
/** Set data type of the response for automatic type conversion
|
186
|
-
* @public
|
187
|
-
* @param {string} dataType Use "text" to turn off automatic type conversion
|
188
|
-
*/
|
189
|
-
HttpRequest.prototype.setResponseType = function(dataType) { this._responseType = dataType; };
|
190
|
-
/**
|
191
|
-
* @public
|
192
|
-
* @param {number} timeout
|
193
|
-
*/
|
194
|
-
HttpRequest.prototype.setRequestTimeout = function(timeout) { this._timeout = timeout; };
|
195
|
-
|
196
|
-
/** @public
|
197
|
-
* @function
|
198
|
-
* @return {Object|string}
|
199
|
-
*/
|
200
|
-
HttpRequest.prototype.valueOf = HttpRequest.prototype.getResponse;
|
201
|
-
/** @public
|
202
|
-
* @function
|
203
|
-
* @return {string}
|
204
|
-
*/
|
205
|
-
HttpRequest.prototype.toString = HttpRequest.prototype.getResponseText;
|
206
|
-
/** @public
|
207
|
-
*/
|
208
|
-
HttpRequest.prototype.log = function() {
|
209
|
-
console.log({
|
210
|
-
"state": this._state,
|
211
|
-
"payload": this._payload,
|
212
|
-
"response": this._response
|
213
|
-
});
|
214
|
-
};
|
215
|
-
|
216
|
-
/** @public
|
217
|
-
* @param {Object.<string, string>=} opt_requestedHeaders
|
218
|
-
* @return {!HttpRequest}
|
219
|
-
*/
|
220
|
-
HttpRequest.prototype.send = function(opt_requestedHeaders) {
|
221
|
-
if(this._sent) {
|
222
|
-
return this;
|
223
|
-
}
|
224
|
-
|
225
|
-
this._state = "loading";
|
226
|
-
try {
|
227
|
-
if(!this._payloadText) { // No payload to post message (e.g. ping)
|
228
|
-
this._type = "GET";
|
229
|
-
}
|
230
|
-
|
231
|
-
this._xhr = new XMLHttpRequest();
|
232
|
-
this._xhr.onloadstart = this._dispatch.bind(this, "loadstart");
|
233
|
-
this._xhr.onload = this._onDone;
|
234
|
-
this._xhr.onerror = this._onDone;
|
235
|
-
this._xhr.onabort = this._onDone;
|
236
|
-
this._xhr.ontimeout = this._onDone;
|
237
|
-
|
238
|
-
this._xhr.open(this._type, this._url, true);
|
239
|
-
var defaultContentType = true;
|
240
|
-
if(opt_requestedHeaders) {
|
241
|
-
for(var requestedHeader in opt_requestedHeaders) {
|
242
|
-
this._xhr.setRequestHeader(requestedHeader, opt_requestedHeaders[requestedHeader]);
|
243
|
-
if(requestedHeader === "Content-Type") {
|
244
|
-
defaultContentType = false;
|
245
|
-
}
|
246
|
-
}
|
247
|
-
}
|
248
|
-
if(defaultContentType) {
|
249
|
-
this._xhr.setRequestHeader("Content-Type", "application/json");
|
250
|
-
}
|
251
|
-
// Specifically in IE, the timeout property may be set only in the time interval between a call to the open method and the first call to the send method.
|
252
|
-
// https://msdn.microsoft.com/en-us/library/cc304105(v=vs.85).aspx
|
253
|
-
this._xhr.timeout = this._timeout;
|
254
|
-
|
255
|
-
this._xhr.send(this._payloadText);
|
256
|
-
this._sent = true;
|
257
|
-
} catch(err) {
|
258
|
-
this.reject(err.message);
|
259
|
-
}
|
260
|
-
return this;
|
261
|
-
};
|
262
|
-
/** @public
|
263
|
-
*/
|
264
|
-
HttpRequest.prototype.abort = function() {
|
265
|
-
if(this._sent && !this._done) {
|
266
|
-
this._xhr.abort();
|
267
|
-
}
|
268
|
-
};
|
269
|
-
|
270
|
-
/** @public
|
271
|
-
* @param {Function} onFulfilled
|
272
|
-
* @param {Function=} onRejected
|
273
|
-
* @return {!HttpRequest}
|
274
|
-
*/
|
275
|
-
HttpRequest.prototype.then = function(onFulfilled, onRejected) {
|
276
|
-
this._promise = this._promise.then(onFulfilled, onRejected);
|
277
|
-
return this;
|
278
|
-
};
|
279
|
-
/** @public
|
280
|
-
* @param {function (*): ?} onRejected
|
281
|
-
* @return {!HttpRequest}
|
282
|
-
*/
|
283
|
-
HttpRequest.prototype.catch = function(onRejected) {
|
284
|
-
this._promise = this._promise.catch(onRejected);
|
285
|
-
return this;
|
286
|
-
};
|
287
|
-
/** @public
|
288
|
-
* @param {*=} reason
|
289
|
-
* @return {!HttpRequest}
|
290
|
-
*/
|
291
|
-
HttpRequest.prototype.reject = function(reason) {
|
292
|
-
if(this._sent) {
|
293
|
-
this.abort(); // The request is already sent and hence abort the request
|
294
|
-
} else if(this._reject) {
|
295
|
-
this._reject(reason);
|
296
|
-
this._cleanUp();
|
297
|
-
}
|
298
|
-
return this;
|
299
|
-
};
|
300
|
-
|
301
|
-
/** Load a file as text from the given url
|
302
|
-
* @public
|
303
|
-
* @return {!HttpRequest}
|
304
|
-
*/
|
305
|
-
HttpRequest.prototype.loadFile = function() {
|
306
|
-
this.setResponseType("text");
|
307
|
-
return this.send();
|
308
|
-
};
|
309
|
-
/** @public
|
310
|
-
* @function
|
311
|
-
* @return {!HttpRequest}
|
312
|
-
*/
|
313
|
-
HttpRequest.prototype.loadText = HttpRequest.prototype.loadFile;
|
314
|
-
|
315
|
-
/** @private
|
316
|
-
* @param {Object} e
|
317
|
-
*/
|
318
|
-
HttpRequest.prototype._onDone = function(e) {
|
319
|
-
this._done = true;
|
320
|
-
this._state = e.type;
|
321
|
-
var xhr = e.target;
|
322
|
-
|
323
|
-
if(xhr.status >= 200 && xhr.status < 300) {
|
324
|
-
this._responseText = xhr.responseText || xhr.response;
|
325
|
-
if(this._responseText) {
|
326
|
-
if(this._responseType === "json") { // Automatically perform JSON string conversion
|
327
|
-
try {
|
328
|
-
this._response = /** @type{Object} */(JSON.parse(this._responseText));
|
329
|
-
} catch (err) {
|
330
|
-
this._responseText = err.message;
|
331
|
-
}
|
332
|
-
} else {
|
333
|
-
this._response = this._responseText;
|
334
|
-
}
|
335
|
-
}
|
336
|
-
} else {
|
337
|
-
this._responseText = xhr.responseText || xhr.statusText || "net::ERR_CONNECTION_REFUSED";
|
338
|
-
}
|
339
|
-
this._responseStatus = xhr.status;
|
340
|
-
|
341
|
-
if (this._state) {
|
342
|
-
this._dispatch(this._state, e);
|
343
|
-
}
|
344
|
-
this._dispatch("loadend", e);
|
345
|
-
|
346
|
-
if(this._response) {
|
347
|
-
this._resolve(this._response);
|
348
|
-
} else {
|
349
|
-
this._reject(this._responseText);
|
350
|
-
}
|
351
|
-
|
352
|
-
this._cleanUp();
|
353
|
-
};
|
354
|
-
/** @private
|
355
|
-
*/
|
356
|
-
HttpRequest.prototype._cleanUp = function() {
|
357
|
-
this._sent = true; // Prevent sending further request
|
358
|
-
this._done = true;
|
359
|
-
this._resolve = null;
|
360
|
-
this._reject = null;
|
361
|
-
|
362
|
-
// Promise.then and Promise.catch will be executed in asynchronous fashion and thus we cannot clean up payload and xhr right after receiving response
|
363
|
-
// this._payload = null; // User input
|
364
|
-
// this._xhr = null;
|
365
|
-
this.unlistenAll();
|
366
|
-
};
|
367
|
-
|
368
|
-
HttpRequest._proto = HttpRequest.prototype;
|
369
|
-
|
370
|
-
export default HttpRequest;
|
371
|
-
export { HttpRequest };
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import Ext from "../../../../tr-grid-util/es6/Ext.js";
|
2
|
-
import ElementWrapper from "../components/ElementWrapper.js";
|
3
|
-
|
4
|
-
declare class PercentBar extends ElementWrapper {
|
5
|
-
|
6
|
-
constructor(opt_element?: Element|null);
|
7
|
-
|
8
|
-
public getValue(): number;
|
9
|
-
|
10
|
-
public getPercent(): number;
|
11
|
-
|
12
|
-
public setValue(value: number|string|null, opt_max?: number|null, opt_displayText?: string|null): void;
|
13
|
-
|
14
|
-
public setMax(absVal: number): void;
|
15
|
-
|
16
|
-
public setText(txt: string): void;
|
17
|
-
|
18
|
-
public hideText(opt_hiden?: boolean|null): void;
|
19
|
-
|
20
|
-
public isTextHidden(): boolean;
|
21
|
-
|
22
|
-
public setTextWidth(width: number|string|null): void;
|
23
|
-
|
24
|
-
public setMaxTextLength(width: number|string|null): void;
|
25
|
-
|
26
|
-
public getTextScrollWidth(): number;
|
27
|
-
|
28
|
-
public getAlignment(): string;
|
29
|
-
|
30
|
-
public setAlignment(alignment: string): void;
|
31
|
-
|
32
|
-
public setMovementColor(colorObject?: any): void;
|
33
|
-
|
34
|
-
public useMovementColor(opt_enabled?: boolean|null): void;
|
35
|
-
|
36
|
-
public setTrackColor(color?: string|null): void;
|
37
|
-
|
38
|
-
public enableTooltip(opt_enabled?: boolean|null): void;
|
39
|
-
|
40
|
-
}
|
41
|
-
|
42
|
-
export default PercentBar;
|
43
|
-
export { PercentBar };
|