forked from lthn/blockchain
implemented transaction details
This commit is contained in:
parent
02ad0dd61e
commit
a18a5b41ab
24 changed files with 773 additions and 633 deletions
|
|
@ -134,7 +134,16 @@
|
|||
"DATE": "Date",
|
||||
"AMOUNT": "Amount",
|
||||
"FEE": "Fee",
|
||||
"ADDRESS": "Address"
|
||||
"ADDRESS": "Address",
|
||||
"DETAILS": {
|
||||
"ID": "Transaction ID",
|
||||
"SIZE": "Transaction size",
|
||||
"SIZE_VALUE": "{{value}} bytes",
|
||||
"HEIGHT": "Height",
|
||||
"CONFIRMATION": "Confirmation",
|
||||
"INPUTS": "Inputs",
|
||||
"OUTPUTS": "Outputs"
|
||||
}
|
||||
},
|
||||
"CONTRACTS": {
|
||||
"EMPTY": "No active contracts.",
|
||||
|
|
|
|||
|
|
@ -438,56 +438,6 @@ input[type='checkbox'].style-checkbox {
|
|||
}
|
||||
}
|
||||
|
||||
.modal {
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(modalBackground);
|
||||
color: themed(mainTextColor);
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
.icon.error {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(redTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon.success {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(greenTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon.info {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-button {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
color: themed(alternativeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.close-button {
|
||||
|
||||
.icon {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(closeButtonColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ngx-contextmenu {
|
||||
|
||||
.dropdown-menu {
|
||||
|
|
@ -525,3 +475,93 @@ input[type='checkbox'].style-checkbox {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
app-modal-container {
|
||||
|
||||
.modal {
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(modalBackground);
|
||||
color: themed(mainTextColor);
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
.icon.error {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(redTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon.success {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(greenTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon.info {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-button {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
color: themed(alternativeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.close-button {
|
||||
|
||||
.icon {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(closeButtonColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
app-transaction-details {
|
||||
|
||||
.table {
|
||||
|
||||
@include themify($themes) {
|
||||
border-top: 0.2rem solid themed(transparentButtonBorderColor);
|
||||
}
|
||||
|
||||
.row {
|
||||
|
||||
.cell {
|
||||
|
||||
&.label {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(optionalTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.value {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(mainTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.key-value {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,6 +123,34 @@ app-history {
|
|||
|
||||
tr {
|
||||
|
||||
&:nth-child(4n+1) {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(tableBackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(4n+2) {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(tableBackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(4n+3) {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(4n+4) {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
|
||||
.confirmation {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -649,7 +649,7 @@ module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
var core = module.exports = { version: '2.6.2' };
|
||||
var core = module.exports = { version: '2.6.1' };
|
||||
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
|
||||
|
||||
|
||||
|
|
@ -1807,7 +1807,7 @@ var store = global[SHARED] || (global[SHARED] = {});
|
|||
})('versions', []).push({
|
||||
version: core.version,
|
||||
mode: __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") ? 'pure' : 'global',
|
||||
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
||||
copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -2364,6 +2364,7 @@ $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
|
|||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
var Zone$1 = (function (global) {
|
||||
var FUNCTION = 'function';
|
||||
var performance = global['performance'];
|
||||
function mark(name) {
|
||||
performance && performance['mark'] && performance['mark'](name);
|
||||
|
|
@ -2372,26 +2373,12 @@ var Zone$1 = (function (global) {
|
|||
performance && performance['measure'] && performance['measure'](name, label);
|
||||
}
|
||||
mark('Zone');
|
||||
var checkDuplicate = global[('__zone_symbol__forceDuplicateZoneCheck')] === true;
|
||||
if (global['Zone']) {
|
||||
// if global['Zone'] already exists (maybe zone.js was already loaded or
|
||||
// some other lib also registered a global object named Zone), we may need
|
||||
// to throw an error, but sometimes user may not want this error.
|
||||
// For example,
|
||||
// we have two web pages, page1 includes zone.js, page2 doesn't.
|
||||
// and the 1st time user load page1 and page2, everything work fine,
|
||||
// but when user load page2 again, error occurs because global['Zone'] already exists.
|
||||
// so we add a flag to let user choose whether to throw this error or not.
|
||||
// By default, if existing Zone is from zone.js, we will not throw the error.
|
||||
if (checkDuplicate || typeof global['Zone'].__symbol__ !== 'function') {
|
||||
throw new Error('Zone already loaded.');
|
||||
}
|
||||
else {
|
||||
return global['Zone'];
|
||||
}
|
||||
throw new Error('Zone already loaded.');
|
||||
}
|
||||
var Zone = /** @class */ (function () {
|
||||
function Zone(parent, zoneSpec) {
|
||||
this._properties = null;
|
||||
this._parent = parent;
|
||||
this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '<root>';
|
||||
this._properties = zoneSpec && zoneSpec.properties || {};
|
||||
|
|
@ -2434,9 +2421,7 @@ var Zone$1 = (function (global) {
|
|||
});
|
||||
Zone.__load_patch = function (name, fn) {
|
||||
if (patches.hasOwnProperty(name)) {
|
||||
if (checkDuplicate) {
|
||||
throw Error('Already loaded patch: ' + name);
|
||||
}
|
||||
throw Error('Already loaded patch: ' + name);
|
||||
}
|
||||
else if (!global['__Zone_disable_' + name]) {
|
||||
var perfName = 'Zone:' + name;
|
||||
|
|
@ -2480,7 +2465,7 @@ var Zone$1 = (function (global) {
|
|||
return this._zoneDelegate.fork(this, zoneSpec);
|
||||
};
|
||||
Zone.prototype.wrap = function (callback, source) {
|
||||
if (typeof callback !== 'function') {
|
||||
if (typeof callback !== FUNCTION) {
|
||||
throw new Error('Expecting function got: ' + callback);
|
||||
}
|
||||
var _callback = this._zoneDelegate.intercept(this, callback, source);
|
||||
|
|
@ -2490,6 +2475,9 @@ var Zone$1 = (function (global) {
|
|||
};
|
||||
};
|
||||
Zone.prototype.run = function (callback, applyThis, applyArgs, source) {
|
||||
if (applyThis === void 0) { applyThis = undefined; }
|
||||
if (applyArgs === void 0) { applyArgs = null; }
|
||||
if (source === void 0) { source = null; }
|
||||
_currentZoneFrame = { parent: _currentZoneFrame, zone: this };
|
||||
try {
|
||||
return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);
|
||||
|
|
@ -2500,6 +2488,8 @@ var Zone$1 = (function (global) {
|
|||
};
|
||||
Zone.prototype.runGuarded = function (callback, applyThis, applyArgs, source) {
|
||||
if (applyThis === void 0) { applyThis = null; }
|
||||
if (applyArgs === void 0) { applyArgs = null; }
|
||||
if (source === void 0) { source = null; }
|
||||
_currentZoneFrame = { parent: _currentZoneFrame, zone: this };
|
||||
try {
|
||||
try {
|
||||
|
|
@ -2523,7 +2513,10 @@ var Zone$1 = (function (global) {
|
|||
// https://github.com/angular/zone.js/issues/778, sometimes eventTask
|
||||
// will run in notScheduled(canceled) state, we should not try to
|
||||
// run such kind of task but just return
|
||||
if (task.state === notScheduled && (task.type === eventTask || task.type === macroTask)) {
|
||||
// we have to define an variable here, if not
|
||||
// typescript compiler will complain below
|
||||
var isNotScheduled = task.state === notScheduled;
|
||||
if (isNotScheduled && task.type === eventTask) {
|
||||
return;
|
||||
}
|
||||
var reEntryGuard = task.state != running;
|
||||
|
|
@ -2534,7 +2527,7 @@ var Zone$1 = (function (global) {
|
|||
_currentZoneFrame = { parent: _currentZoneFrame, zone: this };
|
||||
try {
|
||||
if (task.type == macroTask && task.data && !task.data.isPeriodic) {
|
||||
task.cancelFn = undefined;
|
||||
task.cancelFn = null;
|
||||
}
|
||||
try {
|
||||
return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);
|
||||
|
|
@ -2570,7 +2563,8 @@ var Zone$1 = (function (global) {
|
|||
var newZone = this;
|
||||
while (newZone) {
|
||||
if (newZone === task.zone) {
|
||||
throw Error("can not reschedule task to " + this.name + " which is descendants of the original zone " + task.zone.name);
|
||||
throw Error("can not reschedule task to " + this
|
||||
.name + " which is descendants of the original zone " + task.zone.name);
|
||||
}
|
||||
newZone = newZone.parent;
|
||||
}
|
||||
|
|
@ -2600,7 +2594,7 @@ var Zone$1 = (function (global) {
|
|||
return task;
|
||||
};
|
||||
Zone.prototype.scheduleMicroTask = function (source, callback, data, customSchedule) {
|
||||
return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, undefined));
|
||||
return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, null));
|
||||
};
|
||||
Zone.prototype.scheduleMacroTask = function (source, callback, data, customSchedule, customCancel) {
|
||||
return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));
|
||||
|
|
@ -2641,14 +2635,16 @@ var Zone$1 = (function (global) {
|
|||
}());
|
||||
var DELEGATE_ZS = {
|
||||
name: '',
|
||||
onHasTask: function (delegate, _, target, hasTaskState) { return delegate.hasTask(target, hasTaskState); },
|
||||
onHasTask: function (delegate, _, target, hasTaskState) {
|
||||
return delegate.hasTask(target, hasTaskState);
|
||||
},
|
||||
onScheduleTask: function (delegate, _, target, task) {
|
||||
return delegate.scheduleTask(target, task);
|
||||
},
|
||||
onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) {
|
||||
return delegate.invokeTask(target, task, applyThis, applyArgs);
|
||||
},
|
||||
onCancelTask: function (delegate, _, target, task) { return delegate.cancelTask(target, task); }
|
||||
onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) { return delegate.invokeTask(target, task, applyThis, applyArgs); },
|
||||
onCancelTask: function (delegate, _, target, task) {
|
||||
return delegate.cancelTask(target, task);
|
||||
}
|
||||
};
|
||||
var ZoneDelegate = /** @class */ (function () {
|
||||
function ZoneDelegate(zone, parentDelegate, zoneSpec) {
|
||||
|
|
@ -2676,8 +2672,8 @@ var Zone$1 = (function (global) {
|
|||
zoneSpec && (zoneSpec.onHandleError ? this.zone : parentDelegate.zone);
|
||||
this._scheduleTaskZS =
|
||||
zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);
|
||||
this._scheduleTaskDlgt = zoneSpec &&
|
||||
(zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);
|
||||
this._scheduleTaskDlgt =
|
||||
zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);
|
||||
this._scheduleTaskCurrZone =
|
||||
zoneSpec && (zoneSpec.onScheduleTask ? this.zone : parentDelegate.zone);
|
||||
this._invokeTaskZS =
|
||||
|
|
@ -2732,7 +2728,8 @@ var Zone$1 = (function (global) {
|
|||
callback;
|
||||
};
|
||||
ZoneDelegate.prototype.invoke = function (targetZone, callback, applyThis, applyArgs, source) {
|
||||
return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :
|
||||
return this._invokeZS ?
|
||||
this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :
|
||||
callback.apply(applyThis, applyArgs);
|
||||
};
|
||||
ZoneDelegate.prototype.handleError = function (targetZone, error) {
|
||||
|
|
@ -2764,7 +2761,8 @@ var Zone$1 = (function (global) {
|
|||
return returnTask;
|
||||
};
|
||||
ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) {
|
||||
return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :
|
||||
return this._invokeTaskZS ?
|
||||
this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :
|
||||
task.callback.apply(applyThis, applyArgs);
|
||||
};
|
||||
ZoneDelegate.prototype.cancelTask = function (targetZone, task) {
|
||||
|
|
@ -2784,7 +2782,7 @@ var Zone$1 = (function (global) {
|
|||
// hasTask should not throw error so other ZoneDelegate
|
||||
// can still trigger hasTask callback
|
||||
try {
|
||||
this._hasTaskZS &&
|
||||
return this._hasTaskZS &&
|
||||
this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);
|
||||
}
|
||||
catch (err) {
|
||||
|
|
@ -2874,12 +2872,14 @@ var Zone$1 = (function (global) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
throw new Error(this.type + " '" + this.source + "': can not transition to '" + toState + "', expecting state '" + fromState1 + "'" + (fromState2 ? ' or \'' + fromState2 + '\'' : '') + ", was '" + this._state + "'.");
|
||||
throw new Error(this.type + " '" + this.source + "': can not transition to '" + toState + "', expecting state '" + fromState1 + "'" + (fromState2 ?
|
||||
' or \'' + fromState2 + '\'' :
|
||||
'') + ", was '" + this._state + "'.");
|
||||
}
|
||||
};
|
||||
ZoneTask.prototype.toString = function () {
|
||||
if (this.data && typeof this.data.handleId !== 'undefined') {
|
||||
return this.data.handleId.toString();
|
||||
return this.data.handleId;
|
||||
}
|
||||
else {
|
||||
return Object.prototype.toString.call(this);
|
||||
|
|
@ -2920,13 +2920,7 @@ var Zone$1 = (function (global) {
|
|||
}
|
||||
}
|
||||
if (nativeMicroTaskQueuePromise) {
|
||||
var nativeThen = nativeMicroTaskQueuePromise[symbolThen];
|
||||
if (!nativeThen) {
|
||||
// native Promise is not patchable, we need to use `then` directly
|
||||
// issue 1078
|
||||
nativeThen = nativeMicroTaskQueuePromise['then'];
|
||||
}
|
||||
nativeThen.call(nativeMicroTaskQueuePromise, drainMicroTaskQueue);
|
||||
nativeMicroTaskQueuePromise[symbolThen](drainMicroTaskQueue);
|
||||
}
|
||||
else {
|
||||
global[symbolSetTimeout](drainMicroTaskQueue, 0);
|
||||
|
|
@ -2973,13 +2967,12 @@ var Zone$1 = (function (global) {
|
|||
patchEventTarget: function () { return []; },
|
||||
patchOnProperties: noop,
|
||||
patchMethod: function () { return noop; },
|
||||
bindArguments: function () { return []; },
|
||||
patchThen: function () { return noop; },
|
||||
bindArguments: function () { return null; },
|
||||
setNativePromise: function (NativePromise) {
|
||||
// sometimes NativePromise.resolve static function
|
||||
// is not ready yet, (such as core-js/es6.promise)
|
||||
// so we need to check here.
|
||||
if (NativePromise && typeof NativePromise.resolve === 'function') {
|
||||
if (NativePromise && typeof NativePromise.resolve === FUNCTION) {
|
||||
nativeMicroTaskQueuePromise = NativePromise.resolve(0);
|
||||
}
|
||||
},
|
||||
|
|
@ -2995,16 +2988,6 @@ var Zone$1 = (function (global) {
|
|||
return global['Zone'] = Zone;
|
||||
})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);
|
||||
|
||||
var __values = (undefined && undefined.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
};
|
||||
Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
||||
var ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
||||
var ObjectDefineProperty = Object.defineProperty;
|
||||
|
|
@ -3147,7 +3130,7 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
var queue = promise[symbolValue];
|
||||
promise[symbolValue] = value;
|
||||
if (promise[symbolFinally] === symbolFinally) {
|
||||
// the promise is generated by Promise.prototype.finally
|
||||
// the promise is generated by Promise.prototype.finally
|
||||
if (state === RESOLVED) {
|
||||
// the state is resolved, should ignore the value
|
||||
// and use parent promise value
|
||||
|
|
@ -3231,9 +3214,7 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
chainPromise[symbolParentPromiseState] = promiseState;
|
||||
}
|
||||
// should not pass value to finally callback
|
||||
var value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ?
|
||||
[] :
|
||||
[parentPromiseValue]);
|
||||
var value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ? [] : [parentPromiseValue]);
|
||||
resolvePromise(chainPromise, true, value);
|
||||
}
|
||||
catch (error) {
|
||||
|
|
@ -3268,7 +3249,6 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
return resolvePromise(new this(null), REJECTED, error);
|
||||
};
|
||||
ZoneAwarePromise.race = function (values) {
|
||||
var e_1, _a;
|
||||
var resolve;
|
||||
var reject;
|
||||
var promise = new this(function (res, rej) {
|
||||
|
|
@ -3281,70 +3261,40 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
function onReject(error) {
|
||||
promise && (promise = false || reject(error));
|
||||
}
|
||||
try {
|
||||
for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
|
||||
var value = values_1_1.value;
|
||||
if (!isThenable(value)) {
|
||||
value = this.resolve(value);
|
||||
}
|
||||
value.then(onResolve, onReject);
|
||||
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
|
||||
var value = values_1[_i];
|
||||
if (!isThenable(value)) {
|
||||
value = this.resolve(value);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
value.then(onResolve, onReject);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
ZoneAwarePromise.all = function (values) {
|
||||
var e_2, _a;
|
||||
var resolve;
|
||||
var reject;
|
||||
var promise = new this(function (res, rej) {
|
||||
resolve = res;
|
||||
reject = rej;
|
||||
});
|
||||
// Start at 2 to prevent prematurely resolving if .then is called immediately.
|
||||
var unresolvedCount = 2;
|
||||
var valueIndex = 0;
|
||||
var count = 0;
|
||||
var resolvedValues = [];
|
||||
var _loop_2 = function (value) {
|
||||
for (var _i = 0, values_2 = values; _i < values_2.length; _i++) {
|
||||
var value = values_2[_i];
|
||||
if (!isThenable(value)) {
|
||||
value = this_1.resolve(value);
|
||||
value = this.resolve(value);
|
||||
}
|
||||
var curValueIndex = valueIndex;
|
||||
value.then(function (value) {
|
||||
resolvedValues[curValueIndex] = value;
|
||||
unresolvedCount--;
|
||||
if (unresolvedCount === 0) {
|
||||
value.then((function (index) { return function (value) {
|
||||
resolvedValues[index] = value;
|
||||
count--;
|
||||
if (!count) {
|
||||
resolve(resolvedValues);
|
||||
}
|
||||
}, reject);
|
||||
unresolvedCount++;
|
||||
valueIndex++;
|
||||
};
|
||||
var this_1 = this;
|
||||
try {
|
||||
for (var values_2 = __values(values), values_2_1 = values_2.next(); !values_2_1.done; values_2_1 = values_2.next()) {
|
||||
var value = values_2_1.value;
|
||||
_loop_2(value);
|
||||
}
|
||||
}; })(count), reject);
|
||||
count++;
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (values_2_1 && !values_2_1.done && (_a = values_2.return)) _a.call(values_2);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
// Make the unresolvedCount zero-based again.
|
||||
unresolvedCount -= 2;
|
||||
if (unresolvedCount === 0) {
|
||||
if (!count)
|
||||
resolve(resolvedValues);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) {
|
||||
|
|
@ -3440,112 +3390,31 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
};
|
||||
Ctor[symbolThenPatched] = true;
|
||||
}
|
||||
api.patchThen = patchThen;
|
||||
function zoneify(fn) {
|
||||
return function () {
|
||||
var resultPromise = fn.apply(this, arguments);
|
||||
if (resultPromise instanceof ZoneAwarePromise) {
|
||||
return resultPromise;
|
||||
}
|
||||
var ctor = resultPromise.constructor;
|
||||
if (!ctor[symbolThenPatched]) {
|
||||
patchThen(ctor);
|
||||
}
|
||||
return resultPromise;
|
||||
};
|
||||
}
|
||||
if (NativePromise) {
|
||||
patchThen(NativePromise);
|
||||
var fetch_1 = global['fetch'];
|
||||
if (typeof fetch_1 == 'function') {
|
||||
global['fetch'] = zoneify(fetch_1);
|
||||
}
|
||||
}
|
||||
// This is not part of public API, but it is useful for tests, so we expose it.
|
||||
Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;
|
||||
return ZoneAwarePromise;
|
||||
});
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
Zone.__load_patch('fetch', function (global, Zone, api) {
|
||||
var fetch = global['fetch'];
|
||||
var ZoneAwarePromise = global.Promise;
|
||||
var symbolThenPatched = api.symbol('thenPatched');
|
||||
var fetchTaskScheduling = api.symbol('fetchTaskScheduling');
|
||||
var fetchTaskAborting = api.symbol('fetchTaskAborting');
|
||||
if (typeof fetch !== 'function') {
|
||||
return;
|
||||
}
|
||||
var OriginalAbortController = global['AbortController'];
|
||||
var supportAbort = typeof OriginalAbortController === 'function';
|
||||
var abortNative = null;
|
||||
if (supportAbort) {
|
||||
global['AbortController'] = function () {
|
||||
var abortController = new OriginalAbortController();
|
||||
var signal = abortController.signal;
|
||||
signal.abortController = abortController;
|
||||
return abortController;
|
||||
};
|
||||
abortNative = api.patchMethod(OriginalAbortController.prototype, 'abort', function (delegate) { return function (self, args) {
|
||||
if (self.task) {
|
||||
return self.task.zone.cancelTask(self.task);
|
||||
}
|
||||
return delegate.apply(self, args);
|
||||
}; });
|
||||
}
|
||||
var placeholder = function () { };
|
||||
global['fetch'] = function () {
|
||||
var _this = this;
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var options = args.length > 1 ? args[1] : null;
|
||||
var signal = options && options.signal;
|
||||
return new Promise(function (res, rej) {
|
||||
var task = Zone.current.scheduleMacroTask('fetch', placeholder, args, function () {
|
||||
var fetchPromise;
|
||||
var zone = Zone.current;
|
||||
try {
|
||||
zone[fetchTaskScheduling] = true;
|
||||
fetchPromise = fetch.apply(_this, args);
|
||||
}
|
||||
catch (error) {
|
||||
rej(error);
|
||||
return;
|
||||
}
|
||||
finally {
|
||||
zone[fetchTaskScheduling] = false;
|
||||
}
|
||||
if (!(fetchPromise instanceof ZoneAwarePromise)) {
|
||||
var ctor = fetchPromise.constructor;
|
||||
if (!ctor[symbolThenPatched]) {
|
||||
api.patchThen(ctor);
|
||||
}
|
||||
}
|
||||
fetchPromise.then(function (resource) {
|
||||
if (task.state !== 'notScheduled') {
|
||||
task.invoke();
|
||||
}
|
||||
res(resource);
|
||||
}, function (error) {
|
||||
if (task.state !== 'notScheduled') {
|
||||
task.invoke();
|
||||
}
|
||||
rej(error);
|
||||
});
|
||||
}, function () {
|
||||
if (!supportAbort) {
|
||||
rej('No AbortController supported, can not cancel fetch');
|
||||
return;
|
||||
}
|
||||
if (signal && signal.abortController && !signal.aborted &&
|
||||
typeof signal.abortController.abort === 'function' && abortNative) {
|
||||
try {
|
||||
Zone.current[fetchTaskAborting] = true;
|
||||
abortNative.call(signal.abortController);
|
||||
}
|
||||
finally {
|
||||
Zone.current[fetchTaskAborting] = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
rej('cancel fetch need a AbortController.signal');
|
||||
}
|
||||
});
|
||||
if (signal && signal.abortController) {
|
||||
signal.abortController.task = task;
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
|
|
@ -3661,23 +3530,9 @@ var wrapFn = function (event) {
|
|||
}
|
||||
var target = this || event.target || _global;
|
||||
var listener = target[eventNameSymbol];
|
||||
var result;
|
||||
if (isBrowser && target === internalWindow && event.type === 'error') {
|
||||
// window.onerror have different signiture
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror
|
||||
// and onerror callback will prevent default when callback return true
|
||||
var errorEvent = event;
|
||||
result = listener &&
|
||||
listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);
|
||||
if (result === true) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = listener && listener.apply(this, arguments);
|
||||
if (result != undefined && !result) {
|
||||
event.preventDefault();
|
||||
}
|
||||
var result = listener && listener.apply(this, arguments);
|
||||
if (result != undefined && !result) {
|
||||
event.preventDefault();
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
@ -3695,10 +3550,6 @@ function patchProperty(obj, prop, prototype) {
|
|||
if (!desc || !desc.configurable) {
|
||||
return;
|
||||
}
|
||||
var onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched');
|
||||
if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {
|
||||
return;
|
||||
}
|
||||
// A property descriptor cannot have getter/setter and be writable
|
||||
// deleting the writable and value properties avoids this error:
|
||||
//
|
||||
|
|
@ -3776,7 +3627,6 @@ function patchProperty(obj, prop, prototype) {
|
|||
return null;
|
||||
};
|
||||
ObjectDefineProperty(obj, prop, desc);
|
||||
obj[onPropPatchedSymbol] = true;
|
||||
}
|
||||
function patchOnProperties(obj, properties, prototype) {
|
||||
if (properties) {
|
||||
|
|
@ -3867,31 +3717,6 @@ function patchClass(className) {
|
|||
}
|
||||
}
|
||||
}
|
||||
function copySymbolProperties(src, dest) {
|
||||
if (typeof Object.getOwnPropertySymbols !== 'function') {
|
||||
return;
|
||||
}
|
||||
var symbols = Object.getOwnPropertySymbols(src);
|
||||
symbols.forEach(function (symbol) {
|
||||
var desc = Object.getOwnPropertyDescriptor(src, symbol);
|
||||
Object.defineProperty(dest, symbol, {
|
||||
get: function () {
|
||||
return src[symbol];
|
||||
},
|
||||
set: function (value) {
|
||||
if (desc && (!desc.writable || typeof desc.set !== 'function')) {
|
||||
// if src[symbol] is not writable or not have a setter, just return
|
||||
return;
|
||||
}
|
||||
src[symbol] = value;
|
||||
},
|
||||
enumerable: desc ? desc.enumerable : true,
|
||||
configurable: desc ? desc.configurable : true
|
||||
});
|
||||
});
|
||||
}
|
||||
var shouldCopySymbolProperties = false;
|
||||
|
||||
function patchMethod(target, name, patchFn) {
|
||||
var proto = target;
|
||||
while (proto && !proto.hasOwnProperty(name)) {
|
||||
|
|
@ -3902,7 +3727,7 @@ function patchMethod(target, name, patchFn) {
|
|||
proto = target;
|
||||
}
|
||||
var delegateName = zoneSymbol(name);
|
||||
var delegate = null;
|
||||
var delegate;
|
||||
if (proto && !(delegate = proto[delegateName])) {
|
||||
delegate = proto[delegateName] = proto[name];
|
||||
// check whether proto[name] is writable
|
||||
|
|
@ -3914,9 +3739,6 @@ function patchMethod(target, name, patchFn) {
|
|||
return patchDelegate_1(this, arguments);
|
||||
};
|
||||
attachOriginToPatched(proto[name], delegate);
|
||||
if (shouldCopySymbolProperties) {
|
||||
copySymbolProperties(delegate, proto[name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return delegate;
|
||||
|
|
@ -3935,7 +3757,7 @@ function patchMacroTask(obj, funcName, metaCreator) {
|
|||
setNative = patchMethod(obj, funcName, function (delegate) { return function (self, args) {
|
||||
var meta = metaCreator(self, args);
|
||||
if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {
|
||||
return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);
|
||||
return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask, null);
|
||||
}
|
||||
else {
|
||||
// cause an error by calling it directly.
|
||||
|
|
@ -3949,17 +3771,6 @@ function attachOriginToPatched(patched, original) {
|
|||
}
|
||||
var isDetectedIEOrEdge = false;
|
||||
var ieOrEdge = false;
|
||||
function isIE() {
|
||||
try {
|
||||
var ua = internalWindow.navigator.userAgent;
|
||||
if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isIEOrEdge() {
|
||||
if (isDetectedIEOrEdge) {
|
||||
return ieOrEdge;
|
||||
|
|
@ -4041,21 +3852,6 @@ Zone.__load_patch('toString', function (global) {
|
|||
* @fileoverview
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
var passiveSupported = false;
|
||||
if (typeof window !== 'undefined') {
|
||||
try {
|
||||
var options = Object.defineProperty({}, 'passive', {
|
||||
get: function () {
|
||||
passiveSupported = true;
|
||||
}
|
||||
});
|
||||
window.addEventListener('test', options, options);
|
||||
window.removeEventListener('test', options, options);
|
||||
}
|
||||
catch (err) {
|
||||
passiveSupported = false;
|
||||
}
|
||||
}
|
||||
// an identifier to tell ZoneTask do not create a new invoke closure
|
||||
var OPTIMIZED_ZONE_EVENT_TASK_DATA = {
|
||||
useG: true
|
||||
|
|
@ -4191,7 +3987,6 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
if (proto[zoneSymbolAddEventListener]) {
|
||||
return false;
|
||||
}
|
||||
var eventNameToString = patchOptions && patchOptions.eventNameToString;
|
||||
// a shared global taskData to pass data for scheduleEventTask
|
||||
// so we do not need to create a new object just for pass some data
|
||||
var taskData = {};
|
||||
|
|
@ -4207,24 +4002,12 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] =
|
||||
proto[patchOptions.prepend];
|
||||
}
|
||||
function checkIsPassive(task) {
|
||||
if (!passiveSupported && typeof taskData.options !== 'boolean' &&
|
||||
typeof taskData.options !== 'undefined' && taskData.options !== null) {
|
||||
// options is a non-null non-undefined object
|
||||
// passive is not supported
|
||||
// don't pass options as object
|
||||
// just pass capture as a boolean
|
||||
task.options = !!taskData.options.capture;
|
||||
taskData.options = task.options;
|
||||
}
|
||||
}
|
||||
var customScheduleGlobal = function (task) {
|
||||
var customScheduleGlobal = function () {
|
||||
// if there is already a task for the eventName + capture,
|
||||
// just return, because we use the shared globalZoneAwareCallback here.
|
||||
if (taskData.isExisting) {
|
||||
return;
|
||||
}
|
||||
checkIsPassive(task);
|
||||
return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);
|
||||
};
|
||||
var customCancelGlobal = function (task) {
|
||||
|
|
@ -4265,7 +4048,6 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);
|
||||
};
|
||||
var customScheduleNonGlobal = function (task) {
|
||||
checkIsPassive(task);
|
||||
return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);
|
||||
};
|
||||
var customSchedulePrepend = function (task) {
|
||||
|
|
@ -4288,15 +4070,10 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
if (prepend === void 0) { prepend = false; }
|
||||
return function () {
|
||||
var target = this || _global;
|
||||
var eventName = arguments[0];
|
||||
var delegate = arguments[1];
|
||||
if (!delegate) {
|
||||
return nativeListener.apply(this, arguments);
|
||||
}
|
||||
if (isNode && eventName === 'uncaughtException') {
|
||||
// don't patch uncaughtException of nodejs to prevent endless loop
|
||||
return nativeListener.apply(this, arguments);
|
||||
}
|
||||
// don't create the bind delegate function for handleEvent
|
||||
// case here to improve addEventListener performance
|
||||
// we will create the bind delegate when invoke
|
||||
|
|
@ -4310,6 +4087,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {
|
||||
return;
|
||||
}
|
||||
var eventName = arguments[0];
|
||||
var options = arguments[2];
|
||||
if (blackListedEvents) {
|
||||
// check black list
|
||||
|
|
@ -4339,8 +4117,8 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
var symbolEventName;
|
||||
if (!symbolEventNames) {
|
||||
// the code is duplicate, but I just want to get some better performance
|
||||
var falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;
|
||||
var trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;
|
||||
var falseEventName = eventName + FALSE_STR;
|
||||
var trueEventName = eventName + TRUE_STR;
|
||||
var symbol = ZONE_SYMBOL_PREFIX + falseEventName;
|
||||
var symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;
|
||||
zoneSymbolEventNames$1[eventName] = {};
|
||||
|
|
@ -4375,8 +4153,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
source = targetSource[eventName];
|
||||
}
|
||||
if (!source) {
|
||||
source = constructorName + addSource +
|
||||
(eventNameToString ? eventNameToString(eventName) : eventName);
|
||||
source = constructorName + addSource + eventName;
|
||||
}
|
||||
// do not create a new object as task.data to pass those things
|
||||
// just use the global shared one
|
||||
|
|
@ -4391,7 +4168,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
taskData.capture = capture;
|
||||
taskData.eventName = eventName;
|
||||
taskData.isExisting = isExisting;
|
||||
var data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined;
|
||||
var data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : null;
|
||||
// keep taskData into data to allow onScheduleEventTask to access the task information
|
||||
if (data) {
|
||||
data.taskData = taskData;
|
||||
|
|
@ -4409,11 +4186,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
if (once) {
|
||||
options.once = true;
|
||||
}
|
||||
if (!(!passiveSupported && typeof task.options === 'boolean')) {
|
||||
// if not support passive, and we pass an option object
|
||||
// to addEventListener, we should save the options to task
|
||||
task.options = options;
|
||||
}
|
||||
task.options = options;
|
||||
task.target = target;
|
||||
task.capture = capture;
|
||||
task.eventName = eventName;
|
||||
|
|
@ -4498,7 +4271,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
var target = this || _global;
|
||||
var eventName = arguments[0];
|
||||
var listeners = [];
|
||||
var tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);
|
||||
var tasks = findEventTasks(target, eventName);
|
||||
for (var i = 0; i < tasks.length; i++) {
|
||||
var task = tasks[i];
|
||||
var delegate = task.originalDelegate ? task.originalDelegate : task.callback;
|
||||
|
|
@ -4654,9 +4427,9 @@ function patchTimer(window, setName, cancelName, nameSuffix) {
|
|||
patchMethod(window, setName, function (delegate) { return function (self, args) {
|
||||
if (typeof args[0] === 'function') {
|
||||
var options = {
|
||||
handleId: null,
|
||||
isPeriodic: nameSuffix === 'Interval',
|
||||
delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 :
|
||||
undefined,
|
||||
delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 : null,
|
||||
args: args
|
||||
};
|
||||
var task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);
|
||||
|
|
@ -4771,7 +4544,7 @@ function propertyPatch() {
|
|||
};
|
||||
Object.getOwnPropertyDescriptor = function (obj, prop) {
|
||||
var desc = _getOwnPropertyDescriptor(obj, prop);
|
||||
if (desc && isUnconfigurable(obj, prop)) {
|
||||
if (isUnconfigurable(obj, prop)) {
|
||||
desc.configurable = false;
|
||||
}
|
||||
return desc;
|
||||
|
|
@ -4999,10 +4772,10 @@ var globalEventHandlersEventNames = [
|
|||
'wheel'
|
||||
];
|
||||
var documentEventNames = [
|
||||
'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'freeze', 'fullscreenchange',
|
||||
'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'fullscreenchange',
|
||||
'mozfullscreenchange', 'webkitfullscreenchange', 'msfullscreenchange', 'fullscreenerror',
|
||||
'mozfullscreenerror', 'webkitfullscreenerror', 'msfullscreenerror', 'readystatechange',
|
||||
'visibilitychange', 'resume'
|
||||
'visibilitychange'
|
||||
];
|
||||
var windowEventNames = [
|
||||
'absolutedeviceorientation',
|
||||
|
|
@ -5114,7 +4887,7 @@ var websocketEventNames = ['close', 'error', 'open', 'message'];
|
|||
var workerEventNames = ['error', 'message'];
|
||||
var eventNames = globalEventHandlersEventNames.concat(webglEventNames, formEventNames, detailEventNames, documentEventNames, windowEventNames, htmlElementEventNames, ieElementEventNames);
|
||||
function filterProperties(target, onProperties, ignoreProperties) {
|
||||
if (!ignoreProperties || ignoreProperties.length === 0) {
|
||||
if (!ignoreProperties) {
|
||||
return onProperties;
|
||||
}
|
||||
var tip = ignoreProperties.filter(function (ip) { return ip.target === target; });
|
||||
|
|
@ -5139,14 +4912,13 @@ function propertyDescriptorPatch(api, _global) {
|
|||
}
|
||||
var supportsWebSocket = typeof WebSocket !== 'undefined';
|
||||
if (canPatchViaPropertyDescriptor()) {
|
||||
var ignoreProperties = _global['__Zone_ignore_on_properties'];
|
||||
var ignoreProperties = _global.__Zone_ignore_on_properties;
|
||||
// for browsers that we can patch the descriptor: Chrome & Firefox
|
||||
if (isBrowser) {
|
||||
var internalWindow = window;
|
||||
var ignoreErrorProperties = isIE ? [{ target: internalWindow, ignoreProperties: ['error'] }] : [];
|
||||
// in IE/Edge, onProp not exist in window object, but in WindowPrototype
|
||||
// so we need to pass WindowPrototype to check onProp exist or not
|
||||
patchFilteredProperties(internalWindow, eventNames.concat(['messageerror']), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow));
|
||||
patchFilteredProperties(internalWindow, eventNames.concat(['messageerror']), ignoreProperties, ObjectGetPrototypeOf(internalWindow));
|
||||
patchFilteredProperties(Document.prototype, eventNames, ignoreProperties);
|
||||
if (typeof internalWindow['SVGElement'] !== 'undefined') {
|
||||
patchFilteredProperties(internalWindow['SVGElement'].prototype, eventNames, ignoreProperties);
|
||||
|
|
@ -5168,9 +4940,9 @@ function propertyDescriptorPatch(api, _global) {
|
|||
}
|
||||
}
|
||||
patchFilteredProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames, ignoreProperties);
|
||||
var XMLHttpRequestEventTarget_1 = _global['XMLHttpRequestEventTarget'];
|
||||
if (XMLHttpRequestEventTarget_1) {
|
||||
patchFilteredProperties(XMLHttpRequestEventTarget_1 && XMLHttpRequestEventTarget_1.prototype, XMLHttpRequestEventNames, ignoreProperties);
|
||||
var XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget'];
|
||||
if (XMLHttpRequestEventTarget) {
|
||||
patchFilteredProperties(XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype, XMLHttpRequestEventNames, ignoreProperties);
|
||||
}
|
||||
if (typeof IDBIndex !== 'undefined') {
|
||||
patchFilteredProperties(IDBIndex.prototype, IDBIndexEventNames, ignoreProperties);
|
||||
|
|
@ -5385,16 +5157,16 @@ function patchEvent(global, api) {
|
|||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
function patchCallbacks(target, targetName, method, callbacks) {
|
||||
var symbol = Zone.__symbol__(method);
|
||||
if (target[symbol]) {
|
||||
function registerElementPatch(_global) {
|
||||
if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) {
|
||||
return;
|
||||
}
|
||||
var nativeDelegate = target[symbol] = target[method];
|
||||
target[method] = function (name, opts, options) {
|
||||
var _registerElement = document.registerElement;
|
||||
var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
|
||||
document.registerElement = function (name, opts) {
|
||||
if (opts && opts.prototype) {
|
||||
callbacks.forEach(function (callback) {
|
||||
var source = targetName + "." + method + "::" + callback;
|
||||
var source = 'Document.registerElement::' + callback;
|
||||
var prototype = opts.prototype;
|
||||
if (prototype.hasOwnProperty(callback)) {
|
||||
var descriptor = ObjectGetOwnPropertyDescriptor(prototype, callback);
|
||||
|
|
@ -5411,23 +5183,9 @@ function patchCallbacks(target, targetName, method, callbacks) {
|
|||
}
|
||||
});
|
||||
}
|
||||
return nativeDelegate.call(target, name, opts, options);
|
||||
return _registerElement.call(document, name, opts);
|
||||
};
|
||||
attachOriginToPatched(target[method], nativeDelegate);
|
||||
}
|
||||
function registerElementPatch(_global) {
|
||||
if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) {
|
||||
return;
|
||||
}
|
||||
var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
|
||||
patchCallbacks(document, 'Document', 'registerElement', callbacks);
|
||||
}
|
||||
function patchCustomElements(_global) {
|
||||
if ((!isBrowser && !isMix) || !('customElements' in _global)) {
|
||||
return;
|
||||
}
|
||||
var callbacks = ['connectedCallback', 'disconnectedCallback', 'adoptedCallback', 'attributeChangedCallback'];
|
||||
patchCallbacks(_global.customElements, 'customElements', 'define', callbacks);
|
||||
attachOriginToPatched(document.registerElement, _registerElement);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -5490,10 +5248,7 @@ Zone.__load_patch('EventTarget', function (global, Zone, api) {
|
|||
Zone.__load_patch('on_property', function (global, Zone, api) {
|
||||
propertyDescriptorPatch(api, global);
|
||||
propertyPatch();
|
||||
});
|
||||
Zone.__load_patch('customElements', function (global, Zone, api) {
|
||||
registerElementPatch(global);
|
||||
patchCustomElements(global);
|
||||
});
|
||||
Zone.__load_patch('canvas', function (global) {
|
||||
var HTMLCanvasElement = global['HTMLCanvasElement'];
|
||||
|
|
@ -5512,7 +5267,6 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
var XHR_LISTENER = zoneSymbol('xhrListener');
|
||||
var XHR_SCHEDULED = zoneSymbol('xhrScheduled');
|
||||
var XHR_URL = zoneSymbol('xhrURL');
|
||||
var XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol('xhrErrorBeforeScheduled');
|
||||
function patchXHR(window) {
|
||||
var XMLHttpRequestPrototype = XMLHttpRequest.prototype;
|
||||
function findPendingTask(target) {
|
||||
|
|
@ -5521,9 +5275,9 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
var oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];
|
||||
var oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];
|
||||
if (!oriAddListener) {
|
||||
var XMLHttpRequestEventTarget_1 = window['XMLHttpRequestEventTarget'];
|
||||
if (XMLHttpRequestEventTarget_1) {
|
||||
var XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget_1.prototype;
|
||||
var XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget'];
|
||||
if (XMLHttpRequestEventTarget) {
|
||||
var XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;
|
||||
oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];
|
||||
oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];
|
||||
}
|
||||
|
|
@ -5531,10 +5285,9 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
var READY_STATE_CHANGE = 'readystatechange';
|
||||
var SCHEDULED = 'scheduled';
|
||||
function scheduleTask(task) {
|
||||
XMLHttpRequest[XHR_SCHEDULED] = false;
|
||||
var data = task.data;
|
||||
var target = data.target;
|
||||
target[XHR_SCHEDULED] = false;
|
||||
target[XHR_ERROR_BEFORE_SCHEDULED] = false;
|
||||
// remove existing event listener
|
||||
var listener = target[XHR_LISTENER];
|
||||
if (!oriAddListener) {
|
||||
|
|
@ -5548,35 +5301,8 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
if (target.readyState === target.DONE) {
|
||||
// sometimes on some browsers XMLHttpRequest will fire onreadystatechange with
|
||||
// readyState=4 multiple times, so we need to check task state here
|
||||
if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {
|
||||
// check whether the xhr has registered onload listener
|
||||
// if that is the case, the task should invoke after all
|
||||
// onload listeners finish.
|
||||
var loadTasks = target['__zone_symbol__loadfalse'];
|
||||
if (loadTasks && loadTasks.length > 0) {
|
||||
var oriInvoke_1 = task.invoke;
|
||||
task.invoke = function () {
|
||||
// need to load the tasks again, because in other
|
||||
// load listener, they may remove themselves
|
||||
var loadTasks = target['__zone_symbol__loadfalse'];
|
||||
for (var i = 0; i < loadTasks.length; i++) {
|
||||
if (loadTasks[i] === task) {
|
||||
loadTasks.splice(i, 1);
|
||||
}
|
||||
}
|
||||
if (!data.aborted && task.state === SCHEDULED) {
|
||||
oriInvoke_1.call(task);
|
||||
}
|
||||
};
|
||||
loadTasks.push(task);
|
||||
}
|
||||
else {
|
||||
task.invoke();
|
||||
}
|
||||
}
|
||||
else if (!data.aborted && target[XHR_SCHEDULED] === false) {
|
||||
// error occurs when xhr.send()
|
||||
target[XHR_ERROR_BEFORE_SCHEDULED] = true;
|
||||
if (!data.aborted && XMLHttpRequest[XHR_SCHEDULED] && task.state === SCHEDULED) {
|
||||
task.invoke();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -5586,7 +5312,7 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
target[XHR_TASK] = task;
|
||||
}
|
||||
sendNative.apply(target, data.args);
|
||||
target[XHR_SCHEDULED] = true;
|
||||
XMLHttpRequest[XHR_SCHEDULED] = true;
|
||||
return task;
|
||||
}
|
||||
function placeholderCallback() { }
|
||||
|
|
@ -5603,32 +5329,24 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
return openNative.apply(self, args);
|
||||
}; });
|
||||
var XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';
|
||||
var fetchTaskAborting = zoneSymbol('fetchTaskAborting');
|
||||
var fetchTaskScheduling = zoneSymbol('fetchTaskScheduling');
|
||||
var sendNative = patchMethod(XMLHttpRequestPrototype, 'send', function () { return function (self, args) {
|
||||
if (Zone.current[fetchTaskScheduling] === true) {
|
||||
// a fetch is scheduling, so we are using xhr to polyfill fetch
|
||||
// and because we already schedule macroTask for fetch, we should
|
||||
// not schedule a macroTask for xhr again
|
||||
return sendNative.apply(self, args);
|
||||
}
|
||||
if (self[XHR_SYNC]) {
|
||||
// if the XHR is sync there is no task to schedule, just execute the code.
|
||||
return sendNative.apply(self, args);
|
||||
}
|
||||
else {
|
||||
var options = { target: self, url: self[XHR_URL], isPeriodic: false, args: args, aborted: false };
|
||||
var task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);
|
||||
if (self && self[XHR_ERROR_BEFORE_SCHEDULED] === true && !options.aborted &&
|
||||
task.state === SCHEDULED) {
|
||||
// xhr request throw error when send
|
||||
// we should invoke task instead of leaving a scheduled
|
||||
// pending macroTask
|
||||
task.invoke();
|
||||
}
|
||||
var options = {
|
||||
target: self,
|
||||
url: self[XHR_URL],
|
||||
isPeriodic: false,
|
||||
delay: null,
|
||||
args: args,
|
||||
aborted: false
|
||||
};
|
||||
return scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);
|
||||
}
|
||||
}; });
|
||||
var abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', function () { return function (self, args) {
|
||||
var abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', function () { return function (self) {
|
||||
var task = findPendingTask(self);
|
||||
if (task && typeof task.type == 'string') {
|
||||
// If the XHR has already completed, do nothing.
|
||||
|
|
@ -5640,10 +5358,6 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
}
|
||||
task.zone.cancelTask(task);
|
||||
}
|
||||
else if (Zone.current[fetchTaskAborting] === true) {
|
||||
// the abort is called from fetch polyfill, we need to call native abort of XHR.
|
||||
return abortNative.apply(self, args);
|
||||
}
|
||||
// Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no
|
||||
// task
|
||||
// to cancel. Do nothing.
|
||||
|
|
@ -5783,8 +5497,8 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
__webpack_require__(/*! D:\zano_zano\src\gui\qt-daemon\html_source\src\polyfills.ts */"./src/polyfills.ts");
|
||||
module.exports = __webpack_require__(/*! D:\zano_zano\src\gui\qt-daemon\html_source\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
|
||||
__webpack_require__(/*! D:\Projects\Zano\src\gui\qt-daemon\html_source\src\polyfills.ts */"./src/polyfills.ts");
|
||||
module.exports = __webpack_require__(/*! D:\Projects\Zano\src\gui\qt-daemon\html_source\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -93646,22 +93646,6 @@ __webpack_require__(/*! ./dist/inputmask/inputmask.numeric.extensions */ "./node
|
|||
module.exports = __webpack_require__(/*! ./dist/inputmask/inputmask.js */ "./node_modules/inputmask/dist/inputmask/inputmask.js");
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/isarray/index.js":
|
||||
/*!***************************************!*\
|
||||
!*** ./node_modules/isarray/index.js ***!
|
||||
\***************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
var toString = {}.toString;
|
||||
|
||||
module.exports = Array.isArray || function (arr) {
|
||||
return toString.call(arr) == '[object Array]';
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/json-bignumber/node_modules/bignumber.js/bignumber.js":
|
||||
|
|
@ -98834,13 +98818,9 @@ exports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {
|
|||
|
||||
var Buffer = __webpack_require__(/*! ../utils/buffer */ "./node_modules/qrcode/lib/utils/typedarray-buffer.js")
|
||||
|
||||
if(Buffer.alloc) {
|
||||
var EXP_TABLE = Buffer.alloc(512)
|
||||
var LOG_TABLE = Buffer.alloc(256)
|
||||
} else {
|
||||
var EXP_TABLE = new Buffer(512)
|
||||
var LOG_TABLE = new Buffer(256)
|
||||
}
|
||||
var EXP_TABLE = new Buffer(512)
|
||||
var LOG_TABLE = new Buffer(256)
|
||||
|
||||
/**
|
||||
* Precompute the log and anti-log tables for faster computation later
|
||||
*
|
||||
|
|
@ -99550,7 +99530,7 @@ var Version = __webpack_require__(/*! ./version */ "./node_modules/qrcode/lib/co
|
|||
var FormatInfo = __webpack_require__(/*! ./format-info */ "./node_modules/qrcode/lib/core/format-info.js")
|
||||
var Mode = __webpack_require__(/*! ./mode */ "./node_modules/qrcode/lib/core/mode.js")
|
||||
var Segments = __webpack_require__(/*! ./segments */ "./node_modules/qrcode/lib/core/segments.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/qrcode/node_modules/isarray/index.js")
|
||||
|
||||
/**
|
||||
* QRCode for JavaScript
|
||||
|
|
@ -100598,7 +100578,7 @@ var ECCode = __webpack_require__(/*! ./error-correction-code */ "./node_modules/
|
|||
var ECLevel = __webpack_require__(/*! ./error-correction-level */ "./node_modules/qrcode/lib/core/error-correction-level.js")
|
||||
var Mode = __webpack_require__(/*! ./mode */ "./node_modules/qrcode/lib/core/mode.js")
|
||||
var VersionCheck = __webpack_require__(/*! ./version-check */ "./node_modules/qrcode/lib/core/version-check.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/qrcode/node_modules/isarray/index.js")
|
||||
|
||||
// Generator polynomial used to encode version information
|
||||
var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)
|
||||
|
|
@ -101048,7 +101028,7 @@ exports.qrToImageData = function qrToImageData (imgData, qr, opts) {
|
|||
|
||||
|
||||
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/qrcode/node_modules/isarray/index.js")
|
||||
|
||||
function typedArraySupport () {
|
||||
// Can typed array instances be augmented?
|
||||
|
|
@ -101553,6 +101533,22 @@ Buffer.isBuffer = function isBuffer (b) {
|
|||
module.exports = Buffer
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/qrcode/node_modules/isarray/index.js":
|
||||
/*!***********************************************************!*\
|
||||
!*** ./node_modules/qrcode/node_modules/isarray/index.js ***!
|
||||
\***********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
var toString = {}.toString;
|
||||
|
||||
module.exports = Array.isArray || function (arr) {
|
||||
return toString.call(arr) == '[object Array]';
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/rxjs/_esm5/index.js":
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,20 @@
|
|||
<div class="table">
|
||||
<div class="row">
|
||||
<span class="cell label" [style.flex-basis]="cellSizes['1']">{{ 'HISTORY.DETAILS.ID' | translate }}</span>
|
||||
<span class="cell key-value" [style.flex-basis]="cellSizes['2']">{{transaction.tx_hash}}</span>
|
||||
<span class="cell label" [style.flex-basis]="cellSizes['3']">{{ 'HISTORY.DETAILS.SIZE' | translate }}</span>
|
||||
<span class="cell value" [style.flex-basis]="cellSizes['4']">{{ 'HISTORY.DETAILS.SIZE_VALUE' | translate : {value: transaction.tx_blob_size} }}</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="cell label" [style.flex-basis]="cellSizes['1']">{{ 'HISTORY.DETAILS.HEIGHT' | translate }}</span>
|
||||
<span class="cell value" [style.flex-basis]="cellSizes['2']">{{transaction.height}}</span>
|
||||
<span class="cell label" [style.flex-basis]="cellSizes['3']">{{ 'HISTORY.DETAILS.CONFIRMATION' | translate }}</span>
|
||||
<span class="cell value" [style.flex-basis]="cellSizes['4']">{{variablesService.height_app - transaction.height}}</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span class="cell label" [style.flex-basis]="cellSizes['1']">{{ 'HISTORY.DETAILS.INPUTS' | translate }}</span>
|
||||
<span class="cell value" [style.flex-basis]="cellSizes['2']">{{transaction.td['rcv']?.length || 0}}</span>
|
||||
<span class="cell label" [style.flex-basis]="cellSizes['3']">{{ 'HISTORY.DETAILS.OUTPUTS' | translate }}</span>
|
||||
<span class="cell value" [style.flex-basis]="cellSizes['4']">{{transaction.td['spn']?.length || 0}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
:host {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table {
|
||||
border-top: 0.2rem solid #ebebeb;
|
||||
margin: 0 3rem;
|
||||
padding: 0.5rem 0;
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
border-top: none;
|
||||
line-height: 3rem;
|
||||
margin: 0 -0.5rem;
|
||||
width: 100%;
|
||||
height: 3rem;
|
||||
|
||||
.cell {
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
padding: 0 0.5rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TransactionDetailsComponent } from './transaction-details.component';
|
||||
|
||||
describe('TransactionDetailsComponent', () => {
|
||||
let component: TransactionDetailsComponent;
|
||||
let fixture: ComponentFixture<TransactionDetailsComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ TransactionDetailsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TransactionDetailsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import {Component, OnInit, Input} from '@angular/core';
|
||||
import {Transaction} from '../../models/transaction.model';
|
||||
import {VariablesService} from "../../services/variables.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-transaction-details',
|
||||
templateUrl: './transaction-details.component.html',
|
||||
styleUrls: ['./transaction-details.component.scss']
|
||||
})
|
||||
export class TransactionDetailsComponent implements OnInit {
|
||||
|
||||
@Input() transaction: Transaction;
|
||||
cellSizes = {
|
||||
1: '25%',
|
||||
2: '25%',
|
||||
3: '25%',
|
||||
4: '25%'
|
||||
};
|
||||
|
||||
constructor(private variablesService: VariablesService) {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import {BigNumber} from "bignumber.js";
|
||||
|
||||
export class Transaction {
|
||||
amount: BigNumber;
|
||||
comment: string;
|
||||
contract: any[];
|
||||
fee: BigNumber;
|
||||
height: number;
|
||||
is_income: boolean;
|
||||
is_mining: boolean;
|
||||
is_mixing: boolean;
|
||||
is_service: boolean;
|
||||
payment_id: string;
|
||||
show_sender: boolean;
|
||||
td: object;
|
||||
timestamp: number;
|
||||
tx_blob_size: number;
|
||||
tx_hash: string;
|
||||
tx_type: number;
|
||||
unlock_time: number;
|
||||
|
||||
sortAmount?: BigNumber;
|
||||
sortFee?: BigNumber;
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import {Contract} from './contract.model';
|
||||
import {Transaction} from './transaction.model';
|
||||
import {BigNumber} from 'bignumber.js';
|
||||
|
||||
export class Wallet {
|
||||
|
|
@ -17,8 +18,8 @@ export class Wallet {
|
|||
new_messages?: number;
|
||||
new_contracts?: number;
|
||||
|
||||
history: any[];
|
||||
excluded_history: any[];
|
||||
history: Array<Transaction> = [];
|
||||
excluded_history: Array<Transaction> = [];
|
||||
|
||||
contracts: Array<Contract> = [];
|
||||
|
||||
|
|
@ -60,12 +61,12 @@ export class Wallet {
|
|||
return this.wallet_id === id;
|
||||
}
|
||||
|
||||
prepareHistoryItem(item: any): any {
|
||||
prepareHistoryItem(item: Transaction): any {
|
||||
if (item.tx_type === 4) {
|
||||
item.sortFee = item.amount.plus(item.fee).negated();
|
||||
item.sortAmount = 0;
|
||||
item.sortAmount = new BigNumber(0);
|
||||
} else if (item.tx_type === 3) {
|
||||
item.sortFee = 0;
|
||||
item.sortFee = new BigNumber(0);
|
||||
} else if ((item.hasOwnProperty('contract') && (item.contract[0].state === 3 || item.contract[0].state === 6 || item.contract[0].state === 601) && !item.contract[0].is_a)) {
|
||||
item.sortFee = item.fee.negated();
|
||||
item.sortAmount = item.amount.negated();
|
||||
|
|
@ -80,9 +81,9 @@ export class Wallet {
|
|||
return item;
|
||||
}
|
||||
|
||||
prepareHistory(items: any[]): void {
|
||||
prepareHistory(items: Transaction[]): void {
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
if ((items[i].tx_type === 7 && items[i].is_income) || (items[i].tx_type === 11 && items[i].is_income) || (items[i].amount === 0 && items[i].fee === 0)) {
|
||||
if ((items[i].tx_type === 7 && items[i].is_income) || (items[i].tx_type === 11 && items[i].is_income) || (items[i].amount.eq(0) && items[i].fee.eq(0))) {
|
||||
let exists = false;
|
||||
for (let j = 0; j < this.excluded_history.length; j++) {
|
||||
if (this.excluded_history[j].tx_hash === items[i].tx_hash) {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ export function HttpLoaderFactory(httpClient: HttpClient) {
|
|||
import { ChartModule, HIGHCHARTS_MODULES, Highcharts} from 'angular-highcharts';
|
||||
import { InputValidateDirective } from './_helpers/directives/input-validate/input-validate.directive';
|
||||
import { ModalContainerComponent } from './_helpers/directives/modal-container/modal-container.component';
|
||||
import { TransactionDetailsComponent } from './_helpers/directives/transaction-details/transaction-details.component';
|
||||
// import * as more from 'highcharts/highcharts-more.src';
|
||||
// import * as exporting from 'highcharts/modules/exporting.src';
|
||||
// import * as highstock from 'highcharts/modules/stock.src';
|
||||
|
|
@ -86,7 +87,8 @@ Highcharts.setOptions({
|
|||
ContractTimeLeftPipe,
|
||||
TooltipDirective,
|
||||
InputValidateDirective,
|
||||
ModalContainerComponent
|
||||
ModalContainerComponent,
|
||||
TransactionDetailsComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
|
|
|
|||
|
|
@ -10,29 +10,36 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of variablesService.currentWallet.history">
|
||||
<td>
|
||||
<div class="status" [class.send]="!item.is_income" [class.received]="item.is_income">
|
||||
<ng-container *ngIf="variablesService.height_app - item.height < 10 || item.height === 0 && item.timestamp > 0">
|
||||
<div class="confirmation" tooltip="{{ 'HISTORY.STATUS_TOOLTIP' | translate : {'current': getHeight(item)/10, 'total': 10} }}" placement="bottom" tooltipClass="history-tooltip" [delay]="500">
|
||||
<div class="fill" [style.height]="getHeight(item) + '%'"></div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<i class="icon"></i>
|
||||
<span>{{ (item.is_income ? 'HISTORY.RECEIVED' : 'HISTORY.SEND') | translate }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{item.timestamp * 1000 | date : 'dd-MM-yyyy HH:mm'}}</td>
|
||||
<td>
|
||||
<span *ngIf="item.sortAmount && item.sortAmount.toString() !== '0'">{{item.sortAmount | intToMoney}} {{variablesService.defaultCurrency}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span *ngIf="item.sortFee && item.sortFee.toString() !== '0'">{{item.sortFee | intToMoney}} {{variablesService.defaultCurrency}}</span>
|
||||
</td>
|
||||
<td class="remote-address">
|
||||
<span>{{item | historyTypeMessages}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<ng-container *ngFor="let item of variablesService.currentWallet.history; let index = index">
|
||||
<tr (click)="openDetails(index)">
|
||||
<td>
|
||||
<div class="status" [class.send]="!item.is_income" [class.received]="item.is_income">
|
||||
<ng-container *ngIf="variablesService.height_app - item.height < 10 || item.height === 0 && item.timestamp > 0">
|
||||
<div class="confirmation" tooltip="{{ 'HISTORY.STATUS_TOOLTIP' | translate : {'current': getHeight(item)/10, 'total': 10} }}" placement="bottom" tooltipClass="history-tooltip" [delay]="500">
|
||||
<div class="fill" [style.height]="getHeight(item) + '%'"></div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<i class="icon"></i>
|
||||
<span>{{ (item.is_income ? 'HISTORY.RECEIVED' : 'HISTORY.SEND') | translate }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{item.timestamp * 1000 | date : 'dd-MM-yyyy HH:mm'}}</td>
|
||||
<td>
|
||||
<span *ngIf="item.sortAmount && item.sortAmount.toString() !== '0'">{{item.sortAmount | intToMoney}} {{variablesService.defaultCurrency}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span *ngIf="item.sortFee && item.sortFee.toString() !== '0'">{{item.sortFee | intToMoney}} {{variablesService.defaultCurrency}}</span>
|
||||
</td>
|
||||
<td class="remote-address">
|
||||
<span>{{item | historyTypeMessages}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="transaction-details" [class.open]="index === openedDetails">
|
||||
<td colspan="5">
|
||||
<app-transaction-details *ngIf="index === openedDetails" [transaction]="item"></app-transaction-details>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-container>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -57,6 +57,29 @@
|
|||
text-overflow: ellipsis;
|
||||
max-width: 25vw;
|
||||
}
|
||||
|
||||
&:not(.transaction-details) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&.transaction-details {
|
||||
-webkit-transition: 0.5s height linear, 0s font-size;
|
||||
transition: 0.5s height linear, 0s font-size;
|
||||
transition-delay: 0s, 0.5s;
|
||||
height: 0;
|
||||
|
||||
&.open {
|
||||
height: 10.2rem;
|
||||
}
|
||||
|
||||
td {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
line-height: inherit;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ import {VariablesService} from '../_helpers/services/variables.service';
|
|||
})
|
||||
export class HistoryComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(private variablesService: VariablesService) {
|
||||
}
|
||||
openedDetails = false;
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
constructor(private variablesService: VariablesService) {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
getHeight(item) {
|
||||
if ((this.variablesService.height_app - item.height >= 10 && item.height !== 0) || (item.is_mining === true && item.height === 0)) {
|
||||
|
|
@ -26,7 +26,14 @@ export class HistoryComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
openDetails(index) {
|
||||
if (index === this.openedDetails) {
|
||||
this.openedDetails = false;
|
||||
} else {
|
||||
this.openedDetails = index;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
"OLD_PURCHASE": "Purchase"
|
||||
},
|
||||
"SIDEBAR": {
|
||||
"TITLE": "Accounts",
|
||||
"TITLE": "Wallets",
|
||||
"ADD_NEW": "+ Add new",
|
||||
"ACCOUNT": {
|
||||
"STAKING": "Staking",
|
||||
|
|
@ -54,16 +54,16 @@
|
|||
"BUTTON_SELECT": "Select wallet location",
|
||||
"BUTTON_CREATE": "Create wallet",
|
||||
"TITLE_SAVE": "Save the wallet file.",
|
||||
"ERROR_CANNOT_SAVE_TOP": "You cannot record a file on top of another file",
|
||||
"ERROR_CANNOT_SAVE_SYSTEM": "You cannot save a safe file to the system partition"
|
||||
"ERROR_CANNOT_SAVE_TOP": "Existing wallet files cannot be replaced or overwritten",
|
||||
"ERROR_CANNOT_SAVE_SYSTEM": "Wallet files cannot be saved to the OS partition"
|
||||
},
|
||||
"OPEN_WALLET": {
|
||||
"NAME": "Wallet name",
|
||||
"PASS": "Wallet password",
|
||||
"BUTTON": "Open wallet",
|
||||
"WITH_ADDRESS_ALREADY_OPEN": "A wallet with this account is already open",
|
||||
"SAFE_FILE_NOT_FOUND1": "Safe file not found",
|
||||
"SAFE_FILE_NOT_FOUND2": "<br/><br/> It might have been renamed or moved. <br/> To open it, use the \"Open safe\" button."
|
||||
"WITH_ADDRESS_ALREADY_OPEN": "A wallet with this address is already open",
|
||||
"SAFE_FILE_NOT_FOUND1": "Wallet file not found",
|
||||
"SAFE_FILE_NOT_FOUND2": "<br/><br/> It might have been renamed or moved. <br/> To open it, use the \"Open wallet\" button."
|
||||
},
|
||||
"RESTORE_WALLET": {
|
||||
"LABEL_NAME": "Wallet name",
|
||||
|
|
@ -72,18 +72,18 @@
|
|||
"CONFIRM": "Confirm wallet password",
|
||||
"BUTTON_SELECT": "Select wallet location",
|
||||
"BUTTON_CREATE": "Create wallet",
|
||||
"NOT_CORRECT_FILE_OR_PASSWORD": "Invalid safe file or password does not match",
|
||||
"NOT_CORRECT_FILE_OR_PASSWORD": "Invalid wallet file or password does not match",
|
||||
"CHOOSE_PATH": "Please choose a path"
|
||||
},
|
||||
"SEED_PHRASE": {
|
||||
"TITLE": "Make sure to keep your seed phrase in a safe place. If you forget your seed phrase you will not be able to recover your account.",
|
||||
"BUTTON_CREATE_ACCOUNT" : "Create account"
|
||||
"TITLE": "Make sure to keep your seed phrase in a safe place. If you forget your seed phrase you will not be able to recover your wallet.",
|
||||
"BUTTON_CREATE_ACCOUNT" : "Create wallet"
|
||||
},
|
||||
"SETTINGS": {
|
||||
"TITLE": "Settings",
|
||||
"DARK_THEME": "Dark theme",
|
||||
"WHITE_THEME": "White theme",
|
||||
"GRAY_THEME": "Gray theme",
|
||||
"GRAY_THEME": "Grey theme",
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
"MIXIN": "Mixin",
|
||||
"FEE": "Fee",
|
||||
"BUTTON": "Send",
|
||||
"SUCCESS_SENT": "The payment will be received within 20 minutes"
|
||||
"SUCCESS_SENT": "Transaction sent"
|
||||
},
|
||||
"HISTORY": {
|
||||
"STATUS": "Status",
|
||||
|
|
@ -134,7 +134,16 @@
|
|||
"DATE": "Date",
|
||||
"AMOUNT": "Amount",
|
||||
"FEE": "Fee",
|
||||
"ADDRESS": "Address"
|
||||
"ADDRESS": "Address",
|
||||
"DETAILS": {
|
||||
"ID": "Transaction ID",
|
||||
"SIZE": "Transaction size",
|
||||
"SIZE_VALUE": "{{value}} bytes",
|
||||
"HEIGHT": "Height",
|
||||
"CONFIRMATION": "Confirmation",
|
||||
"INPUTS": "Inputs",
|
||||
"OUTPUTS": "Outputs"
|
||||
}
|
||||
},
|
||||
"CONTRACTS": {
|
||||
"EMPTY": "No active contracts.",
|
||||
|
|
@ -178,13 +187,13 @@
|
|||
"PROGRESS_COMPLETE": "Completed",
|
||||
"FEE": "Fee",
|
||||
"PAYMENT": "Payment ID",
|
||||
"ACCEPT_STATE_WAIT_BIG": "You have accepted the contract proposal. Please wait for the pledges to be made",
|
||||
"ACCEPT_STATE_WAIT_BIG": "You have accepted the contract proposal. Please wait for the deposits to be made",
|
||||
"IGNORED_ACCEPT": "You have ignored the contract proposal",
|
||||
"BURN_PROPOSAL": "The pledges have been nullified.",
|
||||
"BURN_PROPOSAL": "The deposits have been voided.",
|
||||
"SUCCESS_FINISH_PROPOSAL": "The contract is complete. The payment has been sent.",
|
||||
"SEND_CANCEL_PROPOSAL": "Proposal to cancel contract sent to seller",
|
||||
"IGNORED_CANCEL": "You have ignored the proposal to cancel the contract",
|
||||
"DEALS_CANCELED_WAIT": "The contract is being cancelled. Please wait for the pledge to be returned",
|
||||
"DEALS_CANCELED_WAIT": "The contract is being cancelled. Please wait for the deposit to be returned",
|
||||
"WAITING_TIME": "Time until response"
|
||||
},
|
||||
"MESSAGES": {
|
||||
|
|
@ -197,18 +206,18 @@
|
|||
"NOT_ENOUGH_MONEY": "Insufficient funds in account",
|
||||
"CORE_BUSY": "Internal error (core is busy)",
|
||||
"DAEMON_BUSY": "Internal error: deamon is busy",
|
||||
"NO_MONEY_REMOVE_OFFER": "There is no fee for deleting an offer, but in order to protect the network against flood transactions you need to have at least {{fee}} {{currency}} in your safe",
|
||||
"NO_MONEY_REMOVE_OFFER": "There is no fee for deleting an offer, but in order to protect the network against flood transactions you need to have at least {{fee}} {{currency}} in your wallet",
|
||||
"NOT_ENOUGH_OUTPUTS_TO_MIX": "For the sake of security, mixed transaction will take several days",
|
||||
"TRANSACTION_IS_TO_BIG": "This transaction is large and was therefore denied by the network. Try sending the required amount in parts.",
|
||||
"TRANSFER_ATTEMPT": "There is no connection to the Zano network",
|
||||
"TRANSACTION_IS_TO_BIG": "Transaction exceeds network limit, send required amount with multiple transactions",
|
||||
"TRANSFER_ATTEMPT": "There is no connection to Zano network",
|
||||
"ACCESS_DENIED": "Access denied",
|
||||
"TRANSACTION_ERROR": "Error. Payment not completed.",
|
||||
"TRANSACTION_ERROR": "Error. Transaction not completed.",
|
||||
"BAD_ARG": "Invalid argument",
|
||||
"WALLET_WRONG_ID": "Invalid wallet ID",
|
||||
"WRONG_PASSWORD": "Invalid password",
|
||||
"FILE_RESTORED": "The safe file was corrupted somehow. We have recovered the keys and safe from the blockchain.",
|
||||
"FILE_RESTORED": "The wallet file was corrupted. We have recovered the keys and the wallet from the blockchain",
|
||||
"FILE_NOT_FOUND": "File not found",
|
||||
"FILE_EXIST": "A file with that name already exists. Enter another name to save the file under",
|
||||
"FILE_NOT_SAVED": "You cannot save a safe file in this folder. Please choose another folder."
|
||||
"FILE_NOT_SAVED": "You cannot save a wallet file in this folder. Please choose another folder."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,56 +438,6 @@ input[type='checkbox'].style-checkbox {
|
|||
}
|
||||
}
|
||||
|
||||
.modal {
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(modalBackground);
|
||||
color: themed(mainTextColor);
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
.icon.error {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(redTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon.success {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(greenTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon.info {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-button {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
color: themed(alternativeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.close-button {
|
||||
|
||||
.icon {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(closeButtonColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ngx-contextmenu {
|
||||
|
||||
.dropdown-menu {
|
||||
|
|
@ -525,3 +475,93 @@ input[type='checkbox'].style-checkbox {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
app-modal-container {
|
||||
|
||||
.modal {
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(modalBackground);
|
||||
color: themed(mainTextColor);
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
.icon.error {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(redTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon.success {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(greenTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon.info {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-button {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
color: themed(alternativeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.close-button {
|
||||
|
||||
.icon {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(closeButtonColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
app-transaction-details {
|
||||
|
||||
.table {
|
||||
|
||||
@include themify($themes) {
|
||||
border-top: 0.2rem solid themed(transparentButtonBorderColor);
|
||||
}
|
||||
|
||||
.row {
|
||||
|
||||
.cell {
|
||||
|
||||
&.label {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(optionalTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.value {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(mainTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.key-value {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,6 +123,34 @@ app-history {
|
|||
|
||||
tr {
|
||||
|
||||
&:nth-child(4n+1) {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(tableBackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(4n+2) {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(tableBackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(4n+3) {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(4n+4) {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
|
||||
.confirmation {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue