@singularsystems/neo-core 1.0.0-beta.4 → 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppServices/NeoTypes.d.ts +2 -4
- package/dist/AppServices/NeoTypes.js +1 -3
- package/dist/Components/ErrorHandler.js +6 -5
- package/dist/Components/FileManager/FileManager.js +2 -1
- package/dist/Components/Modal/ModalUtils.js +21 -9
- package/dist/Data/DataView.js +1 -1
- package/dist/Data/Deserialiser.js +2 -2
- package/dist/Data/Serialiser.js +3 -3
- package/dist/DebounceHelper.d.ts +3 -0
- package/dist/DebounceHelper.js +17 -0
- package/dist/Decimal/DecimalService.d.ts +23 -0
- package/dist/Decimal/DecimalService.js +38 -0
- package/dist/Decimal/IDecimal.d.ts +25 -0
- package/dist/Decimal/IDecimal.js +1 -0
- package/dist/Extensions.d.ts +3 -3
- package/dist/Extensions.js +20 -29
- package/dist/Globals.d.ts +0 -3
- package/dist/Globals.js +0 -11
- package/dist/Localisation/NeoStrings.d.ts +40 -0
- package/dist/Localisation/NeoStrings.js +40 -0
- package/dist/Model/LookupBase.d.ts +1 -8
- package/dist/Model/LookupBase.js +0 -9
- package/dist/Model/Misc.d.ts +4 -2
- package/dist/Model/ObservableProperty.js +1 -1
- package/dist/Model/PropertyInfo.js +2 -2
- package/dist/NumberUtils.d.ts +8 -5
- package/dist/NumberUtils.js +24 -13
- package/dist/Numeric/DecimalService.d.ts +35 -0
- package/dist/Numeric/DecimalService.js +53 -0
- package/dist/Numeric/IDecimal.d.ts +25 -0
- package/dist/Numeric/IDecimal.js +1 -0
- package/dist/Numeric/IDecimalService.d.ts +25 -0
- package/dist/Numeric/IDecimalService.js +1 -0
- package/dist/Numeric/index.d.ts +2 -0
- package/dist/Numeric/index.js +1 -0
- package/dist/Security/IAuthenticationService.d.ts +0 -4
- package/dist/Security/IUser.d.ts +0 -2
- package/dist/Settings.d.ts +5 -0
- package/dist/Settings.js +8 -0
- package/dist/Utils.d.ts +7 -1
- package/dist/Utils.js +11 -2
- package/dist/Validation/Decorators.js +4 -5
- package/dist/Validation/Rules.js +3 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -1
- package/package.json +1 -2
- package/CHANGELOG.md +0 -15
|
@@ -18,7 +18,7 @@ import { IRouteSecurityService } from '../Routing/IRouteSecurityService';
|
|
|
18
18
|
import { IContextMenuState } from '../Components/ContextMenu/ContextMenu';
|
|
19
19
|
import { INavigationHelper } from '../Routing/INavigationHelper';
|
|
20
20
|
import { ILoginErrorHandler } from '../Security/ILoginErrorHandler';
|
|
21
|
-
import
|
|
21
|
+
import { IDecimalService } from "../Numeric";
|
|
22
22
|
declare const NeoTypes: {
|
|
23
23
|
Axios: ServiceIdentifier<import("axios").AxiosStatic>;
|
|
24
24
|
Config: {
|
|
@@ -28,14 +28,12 @@ declare const NeoTypes: {
|
|
|
28
28
|
Core: {
|
|
29
29
|
AutoRunnerFactory: ServiceIdentifier<IAutoRunnerFactory>;
|
|
30
30
|
ConnectionManager: ServiceIdentifier<IConnectionManager>;
|
|
31
|
+
DecimalService: ServiceIdentifier<IDecimalService<import("../Numeric").IDecimal>>;
|
|
31
32
|
ModelCreator: ServiceIdentifier<IModelCreatorBase>;
|
|
32
33
|
};
|
|
33
34
|
Localisation: {
|
|
34
35
|
LocalisationService: ServiceIdentifier<ILocalisationService>;
|
|
35
36
|
};
|
|
36
|
-
Misc: {
|
|
37
|
-
DecimalType: ServiceIdentifier<typeof Decimal>;
|
|
38
|
-
};
|
|
39
37
|
Routing: {
|
|
40
38
|
MenuItemProvider: ServiceIdentifier<IMenuItemProvider<import("../Routing").IMenuRoute>>;
|
|
41
39
|
NavigationHelper: ServiceIdentifier<INavigationHelper>;
|
|
@@ -9,14 +9,12 @@ var NeoTypes = {
|
|
|
9
9
|
Core: {
|
|
10
10
|
AutoRunnerFactory: new ServiceIdentifier("Neo.AutoRunnerFactory"),
|
|
11
11
|
ConnectionManager: new ServiceIdentifier("Neo.ConnectionManager"),
|
|
12
|
+
DecimalService: new ServiceIdentifier("Neo.DecimalService"),
|
|
12
13
|
ModelCreator: new ServiceIdentifier("Neo.ModelCreator")
|
|
13
14
|
},
|
|
14
15
|
Localisation: {
|
|
15
16
|
LocalisationService: new ServiceIdentifier("Neo.Localisation")
|
|
16
17
|
},
|
|
17
|
-
Misc: {
|
|
18
|
-
DecimalType: new ServiceIdentifier("Neo.Decimal")
|
|
19
|
-
},
|
|
20
18
|
Routing: {
|
|
21
19
|
MenuItemProvider: new ServiceIdentifier("Neo.MenuItemProvider"),
|
|
22
20
|
NavigationHelper: new ServiceIdentifier("Neo.NavigationHelper"),
|
|
@@ -2,6 +2,7 @@ import { __awaiter, __decorate, __generator, __metadata, __param } from "tslib";
|
|
|
2
2
|
import { injectable, inject } from 'inversify';
|
|
3
3
|
import { ModalUtils } from './Modal/ModalUtils';
|
|
4
4
|
import NeoTypes from '../AppServices/NeoTypes';
|
|
5
|
+
import NeoStrings from '../Localisation/NeoStrings';
|
|
5
6
|
export var ErrorDisplayType;
|
|
6
7
|
(function (ErrorDisplayType) {
|
|
7
8
|
/** Show the error text in a modal. */
|
|
@@ -96,16 +97,16 @@ export var ErrorHandler = /** @class */ (function () {
|
|
|
96
97
|
});
|
|
97
98
|
};
|
|
98
99
|
ErrorHandler.prototype.get400Error = function (error) {
|
|
99
|
-
return this.parseAxiosError(
|
|
100
|
+
return this.parseAxiosError(NeoStrings.errors.invalidDataTitle, NeoStrings.errors.invalidDataBody, error);
|
|
100
101
|
};
|
|
101
102
|
ErrorHandler.prototype.get401Error = function (error) {
|
|
102
|
-
return this.parseAxiosError(
|
|
103
|
+
return this.parseAxiosError(NeoStrings.errors.notAuthenticatedTitle, NeoStrings.errors.notAuthenticatedBody, error);
|
|
103
104
|
};
|
|
104
105
|
ErrorHandler.prototype.get403Error = function (error) {
|
|
105
|
-
return this.parseAxiosError(
|
|
106
|
+
return this.parseAxiosError(NeoStrings.errors.unAuthorisedTitle, NeoStrings.errors.unAuthorisedBody, error);
|
|
106
107
|
};
|
|
107
108
|
ErrorHandler.prototype.get409Error = function (error) {
|
|
108
|
-
return this.parseAxiosError(
|
|
109
|
+
return this.parseAxiosError(NeoStrings.errors.concurrencyTitle, NeoStrings.errors.concurrencyBody, error);
|
|
109
110
|
};
|
|
110
111
|
/**
|
|
111
112
|
* Parses an axios response into an IErrorDisplay object.
|
|
@@ -182,7 +183,7 @@ export var ErrorHandler = /** @class */ (function () {
|
|
|
182
183
|
};
|
|
183
184
|
ErrorHandler.prototype.getGeneralError = function (error) {
|
|
184
185
|
var errorDescription = error.message ? error.message : error;
|
|
185
|
-
return { header:
|
|
186
|
+
return { header: NeoStrings.errors.generalTitle, body: errorDescription };
|
|
186
187
|
};
|
|
187
188
|
ErrorHandler.prototype.displayError = function (displayType, error, errorDisplay) {
|
|
188
189
|
if (error instanceof Error) {
|
|
@@ -7,6 +7,7 @@ import { NeoTypes } from '../../AppServices';
|
|
|
7
7
|
import { ErrorDisplayType } from '../ErrorHandler';
|
|
8
8
|
import { Settings } from '../../Settings';
|
|
9
9
|
import { FileUploadBatch } from './FileUploadBatch';
|
|
10
|
+
import NeoStrings from '../../Localisation/NeoStrings';
|
|
10
11
|
var fileInputSymbol = Symbol("FileInput");
|
|
11
12
|
export var FileManagerBase = /** @class */ (function () {
|
|
12
13
|
function FileManagerBase(uploadEndpointOrOptions, options) {
|
|
@@ -89,7 +90,7 @@ export var FileManagerBase = /** @class */ (function () {
|
|
|
89
90
|
return true;
|
|
90
91
|
}
|
|
91
92
|
else {
|
|
92
|
-
ModalUtils.showMessage(
|
|
93
|
+
ModalUtils.showMessage(NeoStrings.fileManager.uploadErrorTitle, NeoStrings.fileManager.uploadErrorBody.format(checkResult.extension));
|
|
93
94
|
return false;
|
|
94
95
|
}
|
|
95
96
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
1
2
|
import Globals from '../../Globals';
|
|
2
3
|
import { NeoTypes } from '../../AppServices';
|
|
4
|
+
import { Settings } from '../../Settings';
|
|
5
|
+
import NeoStrings from '../../Localisation/NeoStrings';
|
|
3
6
|
export var ModalResult;
|
|
4
7
|
(function (ModalResult) {
|
|
5
8
|
ModalResult[ModalResult["Yes"] = 1] = "Yes";
|
|
@@ -12,7 +15,16 @@ var ModalHelpers = /** @class */ (function () {
|
|
|
12
15
|
ModalHelpers.prototype.showMessage = function (title, message, resultValue) {
|
|
13
16
|
var _this = this;
|
|
14
17
|
return new Promise(function (resolve, reject) {
|
|
15
|
-
|
|
18
|
+
var button = { text: NeoStrings.modals.ok, onClick: function () { return resultValue ? resolve(resultValue) : resolve(); } };
|
|
19
|
+
var options = { onClose: resolve };
|
|
20
|
+
if (Settings.modal.okIsAccept) {
|
|
21
|
+
options.acceptButton = button;
|
|
22
|
+
options.closeButton = false;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
options.closeButton = button;
|
|
26
|
+
}
|
|
27
|
+
_this.showModal(title, message, options);
|
|
16
28
|
});
|
|
17
29
|
};
|
|
18
30
|
/**
|
|
@@ -47,8 +59,8 @@ var ModalHelpers = /** @class */ (function () {
|
|
|
47
59
|
_this.showModal(title, message, {
|
|
48
60
|
onClose: function () { return resolve(ModalResult.No); },
|
|
49
61
|
showCancelButton: allowCancel,
|
|
50
|
-
acceptButton: { text:
|
|
51
|
-
closeButton: { text:
|
|
62
|
+
acceptButton: { text: NeoStrings.modals.yes, onClick: onAccept },
|
|
63
|
+
closeButton: { text: NeoStrings.modals.no, onClick: function () { return resolve(ModalResult.No); } }
|
|
52
64
|
});
|
|
53
65
|
});
|
|
54
66
|
};
|
|
@@ -64,9 +76,9 @@ var ModalHelpers = /** @class */ (function () {
|
|
|
64
76
|
return new Promise(function (resolve, reject) {
|
|
65
77
|
_this.showModal(title, message, {
|
|
66
78
|
onClose: function () { return resolve(ModalResult.Cancel); },
|
|
67
|
-
acceptButton: { text:
|
|
68
|
-
closeButton: {
|
|
69
|
-
formProps: { model: model }
|
|
79
|
+
acceptButton: { text: NeoStrings.modals.ok, onClick: function () { return resolve(ModalResult.Yes); } },
|
|
80
|
+
closeButton: __assign(__assign({}, Settings.modal.cancelButton), { text: NeoStrings.modals.cancel, onClick: function () { return resolve(ModalResult.Cancel); } }),
|
|
81
|
+
formProps: { model: model },
|
|
70
82
|
});
|
|
71
83
|
});
|
|
72
84
|
};
|
|
@@ -88,9 +100,9 @@ var ModalHelpers = /** @class */ (function () {
|
|
|
88
100
|
_this.showModal(title, message, {
|
|
89
101
|
onClose: function () { return resolve(ModalResult.Cancel); },
|
|
90
102
|
buttons: [
|
|
91
|
-
{
|
|
92
|
-
{
|
|
93
|
-
{
|
|
103
|
+
__assign(__assign({}, Settings.modal.acceptButton), { text: NeoStrings.modals.yes, onClick: onAccept }),
|
|
104
|
+
__assign(__assign({}, Settings.modal.closeButton), { text: NeoStrings.modals.no, onClick: function () { return resolve(ModalResult.No); } }),
|
|
105
|
+
__assign(__assign({}, Settings.modal.cancelButton), { text: NeoStrings.modals.cancel, onClick: function () { return resolve(ModalResult.Cancel); } })
|
|
94
106
|
]
|
|
95
107
|
});
|
|
96
108
|
});
|
package/dist/Data/DataView.js
CHANGED
|
@@ -115,7 +115,7 @@ export var DataViewBase = /** @class */ (function () {
|
|
|
115
115
|
}
|
|
116
116
|
DataViewBase.unTrackedSort(function () {
|
|
117
117
|
for (var i = sortFns_1.length - 1; i >= 0; i--) {
|
|
118
|
-
itemsToSort_1.sortBy(sortFns_1[i].valueFn, sortFns_1[i].direction, sortFns_1[i].property.propertyType);
|
|
118
|
+
itemsToSort_1 = itemsToSort_1.sortBy(sortFns_1[i].valueFn, sortFns_1[i].direction, sortFns_1[i].property.propertyType);
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
return __spreadArray(__spreadArray([], itemsToSort_1, true), endItems, true);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TrackingState, SerialiseType, DataType, RelationType } from '../Model/Misc';
|
|
2
2
|
import { Utils } from '../Utils';
|
|
3
|
-
import
|
|
3
|
+
import NumberUtils from "../NumberUtils";
|
|
4
4
|
var Deserialiser = /** @class */ (function () {
|
|
5
5
|
function Deserialiser() {
|
|
6
6
|
this.objectRefs = {};
|
|
@@ -169,7 +169,7 @@ var Deserialiser = /** @class */ (function () {
|
|
|
169
169
|
to[key] = new Date(fromValue);
|
|
170
170
|
}
|
|
171
171
|
else if (fromValue !== null && propertyInfo.propertyType === DataType.Decimal) {
|
|
172
|
-
to[key] =
|
|
172
|
+
to[key] = NumberUtils.decimalService.createDecimal(fromValue);
|
|
173
173
|
}
|
|
174
174
|
else {
|
|
175
175
|
if (fromValue instanceof Array && !propertyInfo.assignOnDeserialise) {
|
package/dist/Data/Serialiser.js
CHANGED
|
@@ -2,7 +2,7 @@ import { TrackingState, SerialiseType, RelationType, TimeZoneFormat, DataType }
|
|
|
2
2
|
import { Deserialiser } from './Deserialiser';
|
|
3
3
|
import ValueObject from '../Model/ValueObject';
|
|
4
4
|
import DateUtils from '../Dates/DateUtils';
|
|
5
|
-
import
|
|
5
|
+
import NumberUtils from "../NumberUtils";
|
|
6
6
|
var referenceIdKey = Symbol("referenceId");
|
|
7
7
|
var JSFormatter = /** @class */ (function () {
|
|
8
8
|
function JSFormatter() {
|
|
@@ -116,7 +116,7 @@ var Serialiser = /** @class */ (function () {
|
|
|
116
116
|
propertyInfo.serialise !== SerialiseType.MappingOnly &&
|
|
117
117
|
(propertyInfo.serialise !== SerialiseType.FullOnly || this.options.includeClean)) {
|
|
118
118
|
var fromValue = from[key];
|
|
119
|
-
var isChildObject = (fromValue && fromValue instanceof Object && !(fromValue instanceof Date) && !(fromValue
|
|
119
|
+
var isChildObject = (fromValue && fromValue instanceof Object && !(fromValue instanceof Date) && !(NumberUtils.decimalService.isDecimal(fromValue))) || propertyInfo.relationType === RelationType.ChildObject;
|
|
120
120
|
if (fromValue instanceof Array) {
|
|
121
121
|
// Arrays of simple types are always included.
|
|
122
122
|
if (!this.options.suppressChildren || (fromValue.length > 0 && !(fromValue[0] instanceof Object))) {
|
|
@@ -144,7 +144,7 @@ var Serialiser = /** @class */ (function () {
|
|
|
144
144
|
// Simple values and dates
|
|
145
145
|
if (fromValue !== null || propertyInfo.serialise !== SerialiseType.NotNull) {
|
|
146
146
|
if (fromValue !== null && propertyInfo.propertyType === DataType.Decimal) {
|
|
147
|
-
to[key] =
|
|
147
|
+
to[key] = NumberUtils.decimalService.toNumber(fromValue);
|
|
148
148
|
}
|
|
149
149
|
else if (propertyInfo.timeZoneSerialisation === TimeZoneFormat.None && fromValue instanceof Date) {
|
|
150
150
|
to[key] = DateUtils.format(fromValue, "yyyy-MM-dd") + "T00:00:00";
|
package/dist/DebounceHelper.d.ts
CHANGED
|
@@ -26,10 +26,13 @@ export declare class DebounceHelper<T = void, TState = any> {
|
|
|
26
26
|
* @param state State to pass to debounced method as an array of values for each time debounce was called.
|
|
27
27
|
*/
|
|
28
28
|
static debounce<T = any, TState = any>(syncInstance: any, callback: (state: TState[]) => T | Promise<T>, delayMs: number, state?: TState): Promise<IDebounceResult<T>>;
|
|
29
|
+
static hasPending(syncInstance: any): boolean;
|
|
29
30
|
/** Cancels pending execution of the callback. Pending promise will be resolved with cancelled: true. */
|
|
30
31
|
static cancelPending<TState = any>(syncInstance: any): TState[];
|
|
31
32
|
/** Fires the latest callback immediately. Pending promise from execute() will also be resolved with the return value of the callback. */
|
|
32
33
|
static executeImmediate(syncInstance: any): Promise<void>;
|
|
34
|
+
/** Indicates that there is a pending execution. */
|
|
35
|
+
get hasPending(): boolean;
|
|
33
36
|
/**
|
|
34
37
|
* Waits the interval defined in the constructor, then executes the callback.
|
|
35
38
|
* The callback will not execute if execute is called again within the interval.
|
package/dist/DebounceHelper.js
CHANGED
|
@@ -32,6 +32,15 @@ var DebounceHelper = /** @class */ (function () {
|
|
|
32
32
|
helper.delayMs = delayMs;
|
|
33
33
|
return helper.execute(state);
|
|
34
34
|
};
|
|
35
|
+
DebounceHelper.hasPending = function (syncInstance) {
|
|
36
|
+
var helper = syncInstance[stateSymbol];
|
|
37
|
+
if (helper) {
|
|
38
|
+
return helper.hasPending;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
35
44
|
/** Cancels pending execution of the callback. Pending promise will be resolved with cancelled: true. */
|
|
36
45
|
DebounceHelper.cancelPending = function (syncInstance) {
|
|
37
46
|
var helper = syncInstance[stateSymbol];
|
|
@@ -52,6 +61,14 @@ var DebounceHelper = /** @class */ (function () {
|
|
|
52
61
|
return Promise.resolve();
|
|
53
62
|
}
|
|
54
63
|
};
|
|
64
|
+
Object.defineProperty(DebounceHelper.prototype, "hasPending", {
|
|
65
|
+
/** Indicates that there is a pending execution. */
|
|
66
|
+
get: function () {
|
|
67
|
+
return this.currentResolver !== undefined;
|
|
68
|
+
},
|
|
69
|
+
enumerable: false,
|
|
70
|
+
configurable: true
|
|
71
|
+
});
|
|
55
72
|
/**
|
|
56
73
|
* Waits the interval defined in the constructor, then executes the callback.
|
|
57
74
|
* The callback will not execute if execute is called again within the interval.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IDecimal, IDecimalService } from "./IDecimal";
|
|
2
|
+
interface IMikeMCLDecimal extends IDecimal {
|
|
3
|
+
toNumber(): number;
|
|
4
|
+
round(precision: number, roundingType: number): IMikeMCLDecimal;
|
|
5
|
+
cmp(to: IMikeMCLDecimal): 0 | 1 | -1;
|
|
6
|
+
plus(number: IMikeMCLDecimal): IMikeMCLDecimal;
|
|
7
|
+
div(number: IMikeMCLDecimal | number): IMikeMCLDecimal;
|
|
8
|
+
}
|
|
9
|
+
export declare class DecimalService<T extends IMikeMCLDecimal> implements IDecimalService<T> {
|
|
10
|
+
private decimalType;
|
|
11
|
+
private roundHalfUpValue;
|
|
12
|
+
private roundDownValue;
|
|
13
|
+
constructor(decimalType: T, roundHalfUpValue: number, roundDownValue: number);
|
|
14
|
+
isDecimal(value: any): value is IMikeMCLDecimal;
|
|
15
|
+
createDecimal(value: number | string): T;
|
|
16
|
+
toNumber(value: number | T): number;
|
|
17
|
+
round(value: T, precision: number): T;
|
|
18
|
+
truncate(value: T): T;
|
|
19
|
+
compare(value1: T, value2: T): 0 | 1 | -1;
|
|
20
|
+
sum(values: T[]): T;
|
|
21
|
+
divideBy(value: T, divisor: number | T): T;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var DecimalService = /** @class */ (function () {
|
|
2
|
+
function DecimalService(decimalType, roundHalfUpValue, roundDownValue) {
|
|
3
|
+
this.decimalType = decimalType;
|
|
4
|
+
this.roundHalfUpValue = roundHalfUpValue;
|
|
5
|
+
this.roundDownValue = roundDownValue;
|
|
6
|
+
}
|
|
7
|
+
DecimalService.prototype.isDecimal = function (value) {
|
|
8
|
+
return value instanceof this.decimalType;
|
|
9
|
+
};
|
|
10
|
+
DecimalService.prototype.createDecimal = function (value) {
|
|
11
|
+
return new this.decimalType(value);
|
|
12
|
+
};
|
|
13
|
+
DecimalService.prototype.toNumber = function (value) {
|
|
14
|
+
if (this.isDecimal(value)) {
|
|
15
|
+
return value.toNumber();
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
DecimalService.prototype.round = function (value, precision) {
|
|
22
|
+
return value.round(precision, this.roundHalfUpValue);
|
|
23
|
+
};
|
|
24
|
+
DecimalService.prototype.truncate = function (value) {
|
|
25
|
+
return value.round(0, this.roundDownValue);
|
|
26
|
+
};
|
|
27
|
+
DecimalService.prototype.compare = function (value1, value2) {
|
|
28
|
+
return value1.cmp(value2);
|
|
29
|
+
};
|
|
30
|
+
DecimalService.prototype.sum = function (values) {
|
|
31
|
+
return values.reduce(function (total, item) { return total.plus(item); }, this.createDecimal(0));
|
|
32
|
+
};
|
|
33
|
+
DecimalService.prototype.divideBy = function (value, divisor) {
|
|
34
|
+
return value.div(divisor);
|
|
35
|
+
};
|
|
36
|
+
return DecimalService;
|
|
37
|
+
}());
|
|
38
|
+
export { DecimalService };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface IDecimal {
|
|
2
|
+
new (value: number | string): IDecimal;
|
|
3
|
+
}
|
|
4
|
+
export interface IDecimalService<T extends IDecimal = IDecimal> {
|
|
5
|
+
/** Returns true if the provided value is a decimal instance. */
|
|
6
|
+
isDecimal(value: any): value is IDecimal;
|
|
7
|
+
/** Creates a decimal instance from a javascript number. */
|
|
8
|
+
createDecimal(value: number | string): T;
|
|
9
|
+
/** If the provided value is a decimal, converts it to a number, otherwise returns the number passed in. */
|
|
10
|
+
toNumber(value: number | T): number;
|
|
11
|
+
/** Rounds a number. */
|
|
12
|
+
round(value: T, precision: number): T;
|
|
13
|
+
/** Removes decimal places from the value. Equivalent to round down with zero decimal places. */
|
|
14
|
+
truncate(value: T): T;
|
|
15
|
+
/** Compares 2 decimals.
|
|
16
|
+
* Returns 1 if value1 > value2
|
|
17
|
+
* Returns -1 if value1 < value2
|
|
18
|
+
* Returns 0 if equal
|
|
19
|
+
*/
|
|
20
|
+
compare(value1: T, value2: T): 0 | 1 | -1;
|
|
21
|
+
/** Sums a list of decimals and returns the total as a decimal. */
|
|
22
|
+
sum(values: T[]): T;
|
|
23
|
+
/** Divides value by divisor and returns the result. */
|
|
24
|
+
divideBy(value: T, divisor: number | T): T;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/Extensions.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IPropertyInstance } from './Model/PropertyInstance';
|
|
2
2
|
import PropertyInfo from './Model/PropertyInfo';
|
|
3
3
|
import { DataType } from './Misc';
|
|
4
|
-
import
|
|
4
|
+
import { IDecimal } from "./Numeric/IDecimalService";
|
|
5
5
|
type Group<T> = {
|
|
6
6
|
item: T;
|
|
7
7
|
details: T[];
|
|
@@ -34,11 +34,11 @@ declare global {
|
|
|
34
34
|
/**
|
|
35
35
|
* Returns the sum for a given property.
|
|
36
36
|
*/
|
|
37
|
-
sum<V extends number |
|
|
37
|
+
sum<V extends number | IDecimal = number>(propertyName: keyof T | IPropertyInstance<V> | PropertyInfo | ((item: T) => V)): V;
|
|
38
38
|
/**
|
|
39
39
|
* Returns the sum for a given property.
|
|
40
40
|
*/
|
|
41
|
-
sumDecimal(propertyName: keyof T | IPropertyInstance<
|
|
41
|
+
sumDecimal(propertyName: keyof T | IPropertyInstance<IDecimal> | PropertyInfo | ((item: T) => IDecimal)): IDecimal;
|
|
42
42
|
/**
|
|
43
43
|
* Returns the average for a given property.
|
|
44
44
|
*/
|
package/dist/Extensions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __spreadArray } from "tslib";
|
|
2
2
|
import { DataType } from './Misc';
|
|
3
|
-
import
|
|
3
|
+
import { NumberUtils, Utils } from ".";
|
|
4
4
|
//#region Strings
|
|
5
5
|
String.prototype.format = function () {
|
|
6
6
|
var args = [];
|
|
@@ -84,16 +84,12 @@ Array.prototype.sortBy = function (valueFnOrKey, direction, dataType) {
|
|
|
84
84
|
return delta;
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
87
|
-
return bValue
|
|
87
|
+
return NumberUtils.decimalService.compare(aValue, bValue) * delta; // TODO: check this! bValue!.comparedTo(aValue!) * delta;
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
var array = this;
|
|
92
|
-
|
|
93
|
-
// Mobx6 doesn't allow the array to be sorted in place, must create a new one.
|
|
94
|
-
array = this.slice();
|
|
95
|
-
}
|
|
96
|
-
return array.sort(comparer);
|
|
92
|
+
return Utils.sortableArray(array).sort(comparer);
|
|
97
93
|
};
|
|
98
94
|
Array.prototype.remove = function (item) {
|
|
99
95
|
var index = this.indexOf(item);
|
|
@@ -102,43 +98,38 @@ Array.prototype.remove = function (item) {
|
|
|
102
98
|
}
|
|
103
99
|
};
|
|
104
100
|
function getPropertyName(property) {
|
|
105
|
-
if (property
|
|
106
|
-
return
|
|
101
|
+
if (typeof property === "string") {
|
|
102
|
+
return property;
|
|
107
103
|
}
|
|
108
104
|
else {
|
|
109
105
|
var propertyInfo = property;
|
|
110
106
|
if (property.propertyInfo) {
|
|
111
107
|
propertyInfo = property.propertyInfo;
|
|
112
108
|
}
|
|
113
|
-
return
|
|
109
|
+
return propertyInfo.propertyName;
|
|
114
110
|
}
|
|
115
111
|
}
|
|
116
|
-
|
|
117
|
-
if (property
|
|
118
|
-
return
|
|
112
|
+
function map(list, property) {
|
|
113
|
+
if (typeof property === "function") {
|
|
114
|
+
return list.map(property);
|
|
119
115
|
}
|
|
120
116
|
else {
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
return sumDecimal(this, propertyInfo_1.key);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
return this.reduce(function (total, item) { return total + item[propertyInfo_1.key]; }, 0);
|
|
127
|
-
}
|
|
117
|
+
var propertyName_1 = getPropertyName(property);
|
|
118
|
+
return list.map(function (item) { return item[propertyName_1]; });
|
|
128
119
|
}
|
|
129
|
-
}
|
|
130
|
-
Array.prototype.
|
|
131
|
-
if (
|
|
132
|
-
return
|
|
120
|
+
}
|
|
121
|
+
Array.prototype.sum = function (property) {
|
|
122
|
+
if (this.length === 0) {
|
|
123
|
+
return 0;
|
|
124
|
+
}
|
|
125
|
+
var values = map(this, property);
|
|
126
|
+
if (NumberUtils.decimalService.isDecimal(values[0])) {
|
|
127
|
+
return NumberUtils.decimalService.sum(values);
|
|
133
128
|
}
|
|
134
129
|
else {
|
|
135
|
-
|
|
136
|
-
return sumDecimal(this, propertyInfo.key);
|
|
130
|
+
return values.reduce(function (total, number) { return total + number; }, 0);
|
|
137
131
|
}
|
|
138
132
|
};
|
|
139
|
-
function sumDecimal(items, propertyName) {
|
|
140
|
-
return items.reduce(function (total, item) { return total.add(item[propertyName]); }, new Decimal(0));
|
|
141
|
-
}
|
|
142
133
|
Array.prototype.average = function (property) {
|
|
143
134
|
return this.length === 0 ? 0 : this.sum(property) / this.length;
|
|
144
135
|
};
|
package/dist/Globals.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IAppService } from './AppServices/AppService';
|
|
2
|
-
import Decimal from 'decimal.js-light';
|
|
3
2
|
export default class Globals {
|
|
4
3
|
/** Global app service which hosts the DI container. */
|
|
5
4
|
static appService: IAppService;
|
|
@@ -14,6 +13,4 @@ export default class Globals {
|
|
|
14
13
|
* Use this for adding elements to the root level.
|
|
15
14
|
*/
|
|
16
15
|
static get rootElement(): HTMLElement | ShadowRoot;
|
|
17
|
-
private static _decimalType;
|
|
18
|
-
static get decimalType(): typeof Decimal;
|
|
19
16
|
}
|
package/dist/Globals.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { NeoTypes } from './AppServices';
|
|
2
1
|
var Globals = /** @class */ (function () {
|
|
3
2
|
function Globals() {
|
|
4
3
|
}
|
|
@@ -26,16 +25,6 @@ var Globals = /** @class */ (function () {
|
|
|
26
25
|
enumerable: false,
|
|
27
26
|
configurable: true
|
|
28
27
|
});
|
|
29
|
-
Object.defineProperty(Globals, "decimalType", {
|
|
30
|
-
get: function () {
|
|
31
|
-
if (this._decimalType === undefined) {
|
|
32
|
-
this._decimalType = this.appService.get(NeoTypes.Misc.DecimalType);
|
|
33
|
-
}
|
|
34
|
-
return this._decimalType;
|
|
35
|
-
},
|
|
36
|
-
enumerable: false,
|
|
37
|
-
configurable: true
|
|
38
|
-
});
|
|
39
28
|
return Globals;
|
|
40
29
|
}());
|
|
41
30
|
export default Globals;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const NeoStrings: {
|
|
2
|
+
errors: {
|
|
3
|
+
concurrencyTitle: string;
|
|
4
|
+
concurrencyBody: string;
|
|
5
|
+
generalTitle: string;
|
|
6
|
+
invalidDataTitle: string;
|
|
7
|
+
invalidDataBody: string;
|
|
8
|
+
notAuthenticatedTitle: string;
|
|
9
|
+
notAuthenticatedBody: string;
|
|
10
|
+
unAuthorisedTitle: string;
|
|
11
|
+
unAuthorisedBody: string;
|
|
12
|
+
};
|
|
13
|
+
fileManager: {
|
|
14
|
+
uploadErrorTitle: string;
|
|
15
|
+
/** {0} is the extension of the file */
|
|
16
|
+
uploadErrorBody: string;
|
|
17
|
+
};
|
|
18
|
+
modals: {
|
|
19
|
+
cancel: string;
|
|
20
|
+
no: string;
|
|
21
|
+
ok: string;
|
|
22
|
+
yes: string;
|
|
23
|
+
};
|
|
24
|
+
validation: {
|
|
25
|
+
/** Default text to display for built in rules. */
|
|
26
|
+
rules: {
|
|
27
|
+
/** {0} is the field name */
|
|
28
|
+
required: string;
|
|
29
|
+
/** {0} is the current value */
|
|
30
|
+
emailAddress: string;
|
|
31
|
+
/** {0} is the field name */
|
|
32
|
+
regExp: string;
|
|
33
|
+
/** Displayed when the string is too short */
|
|
34
|
+
stringLengthLessThan: string;
|
|
35
|
+
/** Displayed when the string is too long */
|
|
36
|
+
stringLengthMoreThan: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export default NeoStrings;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var NeoStrings = {
|
|
2
|
+
errors: {
|
|
3
|
+
concurrencyTitle: "Concurrency error",
|
|
4
|
+
concurrencyBody: "Someone else modified the record before you saved it. Please reload it and try again.",
|
|
5
|
+
generalTitle: "Error",
|
|
6
|
+
invalidDataTitle: "Invalid data",
|
|
7
|
+
invalidDataBody: "Cannot continue due to the following validation errors:",
|
|
8
|
+
notAuthenticatedTitle: "Not authenticated",
|
|
9
|
+
notAuthenticatedBody: "You are not logged in. Please reload the page to login again.",
|
|
10
|
+
unAuthorisedTitle: "Unauthorised",
|
|
11
|
+
unAuthorisedBody: "You do not have access to perform this operation."
|
|
12
|
+
},
|
|
13
|
+
fileManager: {
|
|
14
|
+
uploadErrorTitle: "File upload error",
|
|
15
|
+
/** {0} is the extension of the file */
|
|
16
|
+
uploadErrorBody: "File extension: {0} is not allowed."
|
|
17
|
+
},
|
|
18
|
+
modals: {
|
|
19
|
+
cancel: "Cancel",
|
|
20
|
+
no: "No",
|
|
21
|
+
ok: "Ok",
|
|
22
|
+
yes: "Yes",
|
|
23
|
+
},
|
|
24
|
+
validation: {
|
|
25
|
+
/** Default text to display for built in rules. */
|
|
26
|
+
rules: {
|
|
27
|
+
/** {0} is the field name */
|
|
28
|
+
required: "{0} is required",
|
|
29
|
+
/** {0} is the current value */
|
|
30
|
+
emailAddress: "{0} is not a valid email address",
|
|
31
|
+
/** {0} is the field name */
|
|
32
|
+
regExp: "{0} is in an invalid format",
|
|
33
|
+
/** Displayed when the string is too short */
|
|
34
|
+
stringLengthLessThan: "{0} cannot be less than {1} characters in length",
|
|
35
|
+
/** Displayed when the string is too long */
|
|
36
|
+
stringLengthMoreThan: "{0} cannot be more than {1} characters in length"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export default NeoStrings;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { IDeserialiseOptions } from '../Data/Deserialiser';
|
|
2
1
|
import { BindableBase } from './BindableBase';
|
|
3
|
-
import { IBindableBase
|
|
2
|
+
import { IBindableBase } from './IModelBase';
|
|
4
3
|
export interface ILookupBase extends IBindableBase {
|
|
5
4
|
}
|
|
6
5
|
export declare abstract class LookupBase extends BindableBase implements ILookupBase {
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Models that extend LookupBase are designed to be immutable.
|
|
9
|
-
* Calling set() on an instance that is already being observed will not cause the ui to update.
|
|
10
|
-
* Rather deserialise on create using `MyLookup.fromJSObject<MyLookup>(data)`.
|
|
11
|
-
* */
|
|
12
|
-
set(jsObject: PartialPlainObject<this>, options?: IDeserialiseOptions): void;
|
|
13
6
|
}
|
package/dist/Model/LookupBase.js
CHANGED
|
@@ -5,15 +5,6 @@ var LookupBase = /** @class */ (function (_super) {
|
|
|
5
5
|
function LookupBase() {
|
|
6
6
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Models that extend LookupBase are designed to be immutable.
|
|
10
|
-
* Calling set() on an instance that is already being observed will not cause the ui to update.
|
|
11
|
-
* Rather deserialise on create using `MyLookup.fromJSObject<MyLookup>(data)`.
|
|
12
|
-
* */
|
|
13
|
-
LookupBase.prototype.set = function (jsObject, options) {
|
|
14
|
-
console.warn("Do not use the set() method on lookup models. Rather use the static fromJSObject().");
|
|
15
|
-
_super.prototype.set.call(this, jsObject, options);
|
|
16
|
-
};
|
|
17
8
|
return LookupBase;
|
|
18
9
|
}(BindableBase));
|
|
19
10
|
export { LookupBase };
|
package/dist/Model/Misc.d.ts
CHANGED
|
@@ -54,10 +54,12 @@ export interface IDisposable {
|
|
|
54
54
|
dispose(): void;
|
|
55
55
|
}
|
|
56
56
|
export interface IAutoRunner extends IDisposable {
|
|
57
|
+
/** Indicates whether there are any pending callbacks. */
|
|
58
|
+
readonly hasPending: boolean;
|
|
57
59
|
/** Dispose the auto runner. */
|
|
58
60
|
dispose(): void;
|
|
59
|
-
/** Cancels any pending callbacks. */
|
|
60
|
-
cancelPending():
|
|
61
|
+
/** Cancels any pending callbacks. Returns true if there were any pending callbacks. */
|
|
62
|
+
cancelPending(): boolean;
|
|
61
63
|
/** Cancels any pending callbacks, and fires the callback immediately. */
|
|
62
64
|
fireImmediate(): void;
|
|
63
65
|
}
|
|
@@ -25,7 +25,7 @@ var ObservableProperty = /** @class */ (function () {
|
|
|
25
25
|
var model = new ObservableModel();
|
|
26
26
|
model.value = defaultValue;
|
|
27
27
|
var propertyInfo = new PropertyInfo("value");
|
|
28
|
-
Utils.populatePartialWithDefaults(propertyInfo, options);
|
|
28
|
+
Utils.populatePartialWithDefaults(propertyInfo, options, true);
|
|
29
29
|
propertyInfo.displayName = displayName;
|
|
30
30
|
if (isRequired) {
|
|
31
31
|
propertyInfo.rules.push(new RequiredRule("{0} is required."));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __spreadArray } from "tslib";
|
|
2
2
|
import { SerialiseType, RelationType, DataType } from './Misc';
|
|
3
|
-
import
|
|
3
|
+
import NumberUtils from "../NumberUtils";
|
|
4
4
|
var PropertyInfo = /** @class */ (function () {
|
|
5
5
|
function PropertyInfo(propertyName) {
|
|
6
6
|
this.propertyName = propertyName;
|
|
@@ -127,7 +127,7 @@ var PropertyInfo = /** @class */ (function () {
|
|
|
127
127
|
PropertyInfo.prototype.setupFromInstance = function (instance) {
|
|
128
128
|
var value = instance[this.propertyName];
|
|
129
129
|
if (value) {
|
|
130
|
-
if (value
|
|
130
|
+
if (NumberUtils.decimalService.isDecimal(value)) {
|
|
131
131
|
this.propertyType = DataType.Decimal;
|
|
132
132
|
}
|
|
133
133
|
}
|
package/dist/NumberUtils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Decimal from "decimal.js-light";
|
|
2
1
|
import { IPropertyInstance } from "./Model";
|
|
2
|
+
import { IDecimal, IDecimalService } from "./Numeric/IDecimalService";
|
|
3
3
|
export declare enum NumberFormat {
|
|
4
4
|
None = 0,
|
|
5
5
|
NoDecimals = 4096,
|
|
@@ -10,6 +10,9 @@ export declare enum NumberFormat {
|
|
|
10
10
|
CurrencyDecimals = 4353
|
|
11
11
|
}
|
|
12
12
|
export default class NumberUtils {
|
|
13
|
+
private static _decimalService?;
|
|
14
|
+
/** Decimal service used internally by neo. Project code should use the chosen decimal package directly. */
|
|
15
|
+
static get decimalService(): IDecimalService;
|
|
13
16
|
static thousandsSeparator: string;
|
|
14
17
|
static decimalSeparator?: string;
|
|
15
18
|
/** Set this to `","` if you want to allow a comma as a decimal separator when parsing string input. */
|
|
@@ -41,7 +44,7 @@ export default class NumberUtils {
|
|
|
41
44
|
/**
|
|
42
45
|
* Rounds a number to the nearest no of decimals.
|
|
43
46
|
*/
|
|
44
|
-
static round<T extends number |
|
|
47
|
+
static round<T extends number | IDecimal>(number: T, decimals: number): T;
|
|
45
48
|
/**
|
|
46
49
|
* Returns the number of decimal places in a format string.
|
|
47
50
|
* @param formatString Format string.
|
|
@@ -53,15 +56,15 @@ export default class NumberUtils {
|
|
|
53
56
|
* Converts a number to a string using the specified format.
|
|
54
57
|
* E.g. #,##0.00;(#,##0.00)
|
|
55
58
|
*/
|
|
56
|
-
static format(number: number |
|
|
59
|
+
static format(number: number | IDecimal, formatString: string): string;
|
|
57
60
|
/**
|
|
58
61
|
* Converts a number to a string using the specified format.
|
|
59
62
|
*/
|
|
60
|
-
static format(number: number |
|
|
63
|
+
static format(number: number | IDecimal, format: NumberFormat, currencySymbol?: string): string;
|
|
61
64
|
/**
|
|
62
65
|
* Converts the properties value to a string based on the float / integer decorator.
|
|
63
66
|
*/
|
|
64
|
-
static format(property: IPropertyInstance<number |
|
|
67
|
+
static format(property: IPropertyInstance<number | IDecimal>): string;
|
|
65
68
|
private static formatUsingEnum;
|
|
66
69
|
private static formatInternal;
|
|
67
70
|
}
|
package/dist/NumberUtils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Misc } from ".";
|
|
2
|
+
import { NeoTypes } from "./AppServices";
|
|
2
3
|
import { DataType } from "./Model/Misc";
|
|
3
|
-
import Globals from './Globals';
|
|
4
4
|
export var NumberFormat;
|
|
5
5
|
(function (NumberFormat) {
|
|
6
6
|
// Mask is [Thousands Separator, Decimals (2 places), Percent, Currency Symbol]
|
|
@@ -15,6 +15,17 @@ export var NumberFormat;
|
|
|
15
15
|
var NumberUtils = /** @class */ (function () {
|
|
16
16
|
function NumberUtils() {
|
|
17
17
|
}
|
|
18
|
+
Object.defineProperty(NumberUtils, "decimalService", {
|
|
19
|
+
/** Decimal service used internally by neo. Project code should use the chosen decimal package directly. */
|
|
20
|
+
get: function () {
|
|
21
|
+
if (!this._decimalService) {
|
|
22
|
+
this._decimalService = Misc.Globals.appService.get(NeoTypes.Core.DecimalService);
|
|
23
|
+
}
|
|
24
|
+
return this._decimalService;
|
|
25
|
+
},
|
|
26
|
+
enumerable: false,
|
|
27
|
+
configurable: true
|
|
28
|
+
});
|
|
18
29
|
NumberUtils.initialise = function () {
|
|
19
30
|
NumberUtils.numberFormats[NumberFormat.None] = "#";
|
|
20
31
|
NumberUtils.numberFormats[NumberFormat.NoDecimals] = "#,##0;(#,##0)";
|
|
@@ -85,13 +96,13 @@ var NumberUtils = /** @class */ (function () {
|
|
|
85
96
|
* Rounds a number to the nearest no of decimals.
|
|
86
97
|
*/
|
|
87
98
|
NumberUtils.round = function (number, decimals) {
|
|
88
|
-
if (number
|
|
99
|
+
if (this.decimalService.isDecimal(number)) {
|
|
89
100
|
// Round away from zero.
|
|
90
|
-
return
|
|
101
|
+
return this.decimalService.round(number, decimals);
|
|
91
102
|
}
|
|
92
103
|
else {
|
|
93
104
|
if (decimals > 0) {
|
|
94
|
-
return parseFloat(
|
|
105
|
+
return parseFloat(number.toFixed(decimals));
|
|
95
106
|
}
|
|
96
107
|
else {
|
|
97
108
|
return parseInt(number.toFixed(0));
|
|
@@ -135,19 +146,19 @@ var NumberUtils = /** @class */ (function () {
|
|
|
135
146
|
}
|
|
136
147
|
return decimalsPart;
|
|
137
148
|
};
|
|
138
|
-
NumberUtils.format = function (
|
|
139
|
-
if (
|
|
140
|
-
|
|
149
|
+
NumberUtils.format = function (value, format, currencySymbol) {
|
|
150
|
+
if (this.decimalService.isDecimal(value)) {
|
|
151
|
+
value = this.decimalService.toNumber(value);
|
|
141
152
|
}
|
|
142
|
-
if (
|
|
143
|
-
var numberValue =
|
|
144
|
-
return NumberUtils.formatUsingEnum(numberValue,
|
|
153
|
+
if (value !== null && typeof value === "object") {
|
|
154
|
+
var numberValue = this.decimalService.toNumber(value.value);
|
|
155
|
+
return NumberUtils.formatUsingEnum(numberValue, value.propertyInfo.propertyType === DataType.Float || value.propertyInfo.propertyType === DataType.Decimal ? NumberFormat.Decimals : NumberFormat.NoDecimals);
|
|
145
156
|
}
|
|
146
157
|
else if (typeof format === "string") {
|
|
147
|
-
return NumberUtils.formatInternal(
|
|
158
|
+
return NumberUtils.formatInternal(value, format);
|
|
148
159
|
}
|
|
149
160
|
else {
|
|
150
|
-
return NumberUtils.formatUsingEnum(
|
|
161
|
+
return NumberUtils.formatUsingEnum(value, format, currencySymbol);
|
|
151
162
|
}
|
|
152
163
|
};
|
|
153
164
|
NumberUtils.formatUsingEnum = function (number, format, currencySymbol) {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IDecimal, IDecimalService } from "./IDecimalService";
|
|
2
|
+
/** Constructor representing Big, or Decimal from the big.js or decimal.js packages. */
|
|
3
|
+
interface IBigDecimalConstructor {
|
|
4
|
+
new (value: number | string): IBigDecimal;
|
|
5
|
+
}
|
|
6
|
+
/** Instance representing Big, or Decimal from the big.js or decimal.js packages. */
|
|
7
|
+
interface IBigDecimal extends IDecimal {
|
|
8
|
+
toNumber(): number;
|
|
9
|
+
toDecimalPlaces?(precision: number, roundingType: number): IBigDecimal;
|
|
10
|
+
round?(precision?: number, roundingType?: number): IBigDecimal;
|
|
11
|
+
cmp(to: IBigDecimal | number | string): 0 | 1 | -1;
|
|
12
|
+
plus(number: IBigDecimal | number | string): IBigDecimal;
|
|
13
|
+
div(number: IBigDecimal | number | string): IBigDecimal;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Service used by neo to perform decimal operations.
|
|
17
|
+
* This class can be used by any of the decimal packages in the repos under https://github.com/MikeMcl.
|
|
18
|
+
* `big.js` is the smallest package, `decimal.js-light` is slightly larger, but newer with a slightly easier api.
|
|
19
|
+
*/
|
|
20
|
+
export declare class DecimalService<T extends IBigDecimal> implements IDecimalService<T> {
|
|
21
|
+
private decimalType;
|
|
22
|
+
private roundHalfUpValue;
|
|
23
|
+
private roundDownValue;
|
|
24
|
+
private roundFn;
|
|
25
|
+
constructor(decimalType: IBigDecimalConstructor, roundHalfUpValue: number, roundDownValue: number);
|
|
26
|
+
isDecimal(value: any): value is IBigDecimal;
|
|
27
|
+
createDecimal(value: number | string): T;
|
|
28
|
+
toNumber(value: number | T): number;
|
|
29
|
+
round(value: T, precision: number): T;
|
|
30
|
+
truncate(value: T): T;
|
|
31
|
+
compare(value1: T, value2: T): 0 | 1 | -1;
|
|
32
|
+
sum(values: T[]): T;
|
|
33
|
+
divideBy(value: T, divisor: number | T): T;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service used by neo to perform decimal operations.
|
|
3
|
+
* This class can be used by any of the decimal packages in the repos under https://github.com/MikeMcl.
|
|
4
|
+
* `big.js` is the smallest package, `decimal.js-light` is slightly larger, but newer with a slightly easier api.
|
|
5
|
+
*/
|
|
6
|
+
var DecimalService = /** @class */ (function () {
|
|
7
|
+
function DecimalService(decimalType, roundHalfUpValue, roundDownValue) {
|
|
8
|
+
this.decimalType = decimalType;
|
|
9
|
+
this.roundHalfUpValue = roundHalfUpValue;
|
|
10
|
+
this.roundDownValue = roundDownValue;
|
|
11
|
+
var prototype = decimalType.prototype;
|
|
12
|
+
if (prototype.round) {
|
|
13
|
+
this.roundFn = prototype.round;
|
|
14
|
+
}
|
|
15
|
+
else if (prototype.toDecimalPlaces) {
|
|
16
|
+
this.roundFn = prototype.toDecimalPlaces;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
throw "Decimal type doesn't provide rounding function";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
DecimalService.prototype.isDecimal = function (value) {
|
|
23
|
+
return value instanceof this.decimalType;
|
|
24
|
+
};
|
|
25
|
+
DecimalService.prototype.createDecimal = function (value) {
|
|
26
|
+
return new this.decimalType(value);
|
|
27
|
+
};
|
|
28
|
+
DecimalService.prototype.toNumber = function (value) {
|
|
29
|
+
if (this.isDecimal(value)) {
|
|
30
|
+
return value.toNumber();
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
DecimalService.prototype.round = function (value, precision) {
|
|
37
|
+
return this.roundFn.call(value, precision, this.roundHalfUpValue);
|
|
38
|
+
};
|
|
39
|
+
DecimalService.prototype.truncate = function (value) {
|
|
40
|
+
return this.roundFn.call(value, 0, this.roundDownValue);
|
|
41
|
+
};
|
|
42
|
+
DecimalService.prototype.compare = function (value1, value2) {
|
|
43
|
+
return value1.cmp(value2);
|
|
44
|
+
};
|
|
45
|
+
DecimalService.prototype.sum = function (values) {
|
|
46
|
+
return values.reduce(function (total, item) { return total.plus(item); }, this.createDecimal(0));
|
|
47
|
+
};
|
|
48
|
+
DecimalService.prototype.divideBy = function (value, divisor) {
|
|
49
|
+
return value.div(divisor);
|
|
50
|
+
};
|
|
51
|
+
return DecimalService;
|
|
52
|
+
}());
|
|
53
|
+
export { DecimalService };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface IDecimal {
|
|
2
|
+
toNumber(): number;
|
|
3
|
+
}
|
|
4
|
+
export interface IDecimalService<T = IDecimal> {
|
|
5
|
+
/** Returns true if the provided value is a decimal instance. */
|
|
6
|
+
isDecimal(value: any): value is IDecimal;
|
|
7
|
+
/** Creates a decimal instance from a javascript number. */
|
|
8
|
+
createDecimal(value: number | string): T;
|
|
9
|
+
/** If the provided value is a decimal, converts it to a number, otherwise returns the number passed in. */
|
|
10
|
+
toNumber(value: number | T): number;
|
|
11
|
+
/** Rounds a number using .net like midpoint away from zero rounding. */
|
|
12
|
+
round(value: T, precision: number): T;
|
|
13
|
+
/** Removes decimal places from the value. Equivalent to round down with zero decimal places. */
|
|
14
|
+
truncate(value: T): T;
|
|
15
|
+
/** Compares 2 decimals.
|
|
16
|
+
* Returns 1 if value1 > value2
|
|
17
|
+
* Returns -1 if value1 < value2
|
|
18
|
+
* Returns 0 if equal
|
|
19
|
+
*/
|
|
20
|
+
compare(value1: T, value2: T): 0 | 1 | -1;
|
|
21
|
+
/** Sums a list of decimals and returns the total as a decimal. */
|
|
22
|
+
sum(values: T[]): T;
|
|
23
|
+
/** Divides value by divisor and returns the result. */
|
|
24
|
+
divideBy(value: T, divisor: number | T): T;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface IDecimal {
|
|
2
|
+
toNumber(): number;
|
|
3
|
+
}
|
|
4
|
+
export interface IDecimalService<T = IDecimal> {
|
|
5
|
+
/** Returns true if the provided value is a decimal instance. */
|
|
6
|
+
isDecimal(value: any): value is IDecimal;
|
|
7
|
+
/** Creates a decimal instance from a javascript number. */
|
|
8
|
+
createDecimal(value: number | string): T;
|
|
9
|
+
/** If the provided value is a decimal, converts it to a number, otherwise returns the number passed in. */
|
|
10
|
+
toNumber(value: number | T): number;
|
|
11
|
+
/** Rounds a number using .net like midpoint away from zero rounding. */
|
|
12
|
+
round(value: T, precision: number): T;
|
|
13
|
+
/** Removes decimal places from the value. Equivalent to round down with zero decimal places. */
|
|
14
|
+
truncate(value: T): T;
|
|
15
|
+
/** Compares 2 decimals.
|
|
16
|
+
* Returns 1 if value1 > value2
|
|
17
|
+
* Returns -1 if value1 < value2
|
|
18
|
+
* Returns 0 if equal
|
|
19
|
+
*/
|
|
20
|
+
compare(value1: T, value2: T): 0 | 1 | -1;
|
|
21
|
+
/** Sums a list of decimals and returns the total as a decimal. */
|
|
22
|
+
sum(values: T[]): T;
|
|
23
|
+
/** Divides value by divisor and returns the result. */
|
|
24
|
+
divideBy(value: T, divisor: number | T): T;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DecimalService } from './DecimalService';
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { IUser } from './IUser';
|
|
2
2
|
import { ISignInResult } from './SignInResult';
|
|
3
3
|
export default interface IAuthenticationService {
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Use loadUserFromSession() instead.
|
|
6
|
-
*/
|
|
7
|
-
loadUserFromToken(): Promise<IUser | null>;
|
|
8
4
|
/**
|
|
9
5
|
* Load a user from session storage if there is a stored token.
|
|
10
6
|
*/
|
package/dist/Security/IUser.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ export interface IUser {
|
|
|
3
3
|
readonly userName: string;
|
|
4
4
|
/** Name to display in UI components. */
|
|
5
5
|
readonly displayName: string;
|
|
6
|
-
/** True if the access token has expired. */
|
|
7
|
-
readonly hasExpired: boolean;
|
|
8
6
|
/** Access token for requesting protected resources. */
|
|
9
7
|
readonly accessToken: string;
|
|
10
8
|
}
|
package/dist/Settings.d.ts
CHANGED
|
@@ -49,8 +49,13 @@ export declare const Settings: {
|
|
|
49
49
|
useStickyHeaders: boolean;
|
|
50
50
|
};
|
|
51
51
|
modal: {
|
|
52
|
+
/** Set to true if ModalUtils.showMessage() should show an accept button instead of close button. */
|
|
53
|
+
okIsAccept: boolean;
|
|
52
54
|
acceptButton: IButtonOptions;
|
|
55
|
+
/** Settings for close button shown in footer. */
|
|
53
56
|
closeButton: IButtonOptions;
|
|
57
|
+
/** Settings for cancel button shown in footer. */
|
|
58
|
+
cancelButton: IButtonOptions;
|
|
54
59
|
};
|
|
55
60
|
pager: {
|
|
56
61
|
firstText: string;
|
package/dist/Settings.js
CHANGED
|
@@ -72,14 +72,22 @@ export var Settings = {
|
|
|
72
72
|
useStickyHeaders: false,
|
|
73
73
|
},
|
|
74
74
|
modal: {
|
|
75
|
+
/** Set to true if ModalUtils.showMessage() should show an accept button instead of close button. */
|
|
76
|
+
okIsAccept: false,
|
|
75
77
|
acceptButton: {
|
|
76
78
|
text: "Ok",
|
|
77
79
|
variant: "primary"
|
|
78
80
|
},
|
|
81
|
+
/** Settings for close button shown in footer. */
|
|
79
82
|
closeButton: {
|
|
80
83
|
text: "Close",
|
|
81
84
|
variant: "secondary"
|
|
82
85
|
},
|
|
86
|
+
/** Settings for cancel button shown in footer. */
|
|
87
|
+
cancelButton: {
|
|
88
|
+
variant: "light",
|
|
89
|
+
isOutline: false,
|
|
90
|
+
},
|
|
83
91
|
},
|
|
84
92
|
pager: {
|
|
85
93
|
firstText: "«",
|
package/dist/Utils.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ export declare class Utils {
|
|
|
31
31
|
* Runs the callback in the context of a batch transaction. E.g. a mobx action in react.
|
|
32
32
|
*/
|
|
33
33
|
static batchUpdate<T>(unitOfWork: () => T): T;
|
|
34
|
+
/**
|
|
35
|
+
* Returns an array that can be sorted using the built in Array.sort method.
|
|
36
|
+
* Mobx dissallows in place sorting on observable arrays.
|
|
37
|
+
*/
|
|
38
|
+
static sortableArray<T>(array: T[]): T[];
|
|
34
39
|
/**
|
|
35
40
|
* Instructs the ui not to encode the provided html text.
|
|
36
41
|
* Returns a new element containing the html.
|
|
@@ -55,8 +60,9 @@ export declare class Utils {
|
|
|
55
60
|
* Completes a partially populated object using defaults specified in the defaults parameter.
|
|
56
61
|
* @param partial Partially populated object
|
|
57
62
|
* @param defaults Defaults object.
|
|
63
|
+
* @param force True if the properties in `partial` must be set even if they have a value.
|
|
58
64
|
*/
|
|
59
|
-
static populatePartialWithDefaults<T>(partial: Partial<T> | undefined, defaults: T): T;
|
|
65
|
+
static populatePartialWithDefaults<T>(partial: Partial<T> | undefined, defaults: T, force?: boolean): T;
|
|
60
66
|
/**
|
|
61
67
|
* Converts a string like 'user' to 'fa fa-user' or 'fa-user' to 'fa fa-user' or 'far-user' to 'far fa-user'
|
|
62
68
|
*/
|
package/dist/Utils.js
CHANGED
|
@@ -46,6 +46,13 @@ var Utils = /** @class */ (function () {
|
|
|
46
46
|
Utils.batchUpdate = function (unitOfWork) {
|
|
47
47
|
return unitOfWork();
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Returns an array that can be sorted using the built in Array.sort method.
|
|
51
|
+
* Mobx dissallows in place sorting on observable arrays.
|
|
52
|
+
*/
|
|
53
|
+
Utils.sortableArray = function (array) {
|
|
54
|
+
return array;
|
|
55
|
+
};
|
|
49
56
|
/**
|
|
50
57
|
* Instructs the ui not to encode the provided html text.
|
|
51
58
|
* Returns a new element containing the html.
|
|
@@ -102,12 +109,14 @@ var Utils = /** @class */ (function () {
|
|
|
102
109
|
* Completes a partially populated object using defaults specified in the defaults parameter.
|
|
103
110
|
* @param partial Partially populated object
|
|
104
111
|
* @param defaults Defaults object.
|
|
112
|
+
* @param force True if the properties in `partial` must be set even if they have a value.
|
|
105
113
|
*/
|
|
106
|
-
Utils.populatePartialWithDefaults = function (partial, defaults) {
|
|
114
|
+
Utils.populatePartialWithDefaults = function (partial, defaults, force) {
|
|
115
|
+
if (force === void 0) { force = false; }
|
|
107
116
|
if (!partial)
|
|
108
117
|
partial = {};
|
|
109
118
|
for (var key in defaults) {
|
|
110
|
-
if (!partial[key])
|
|
119
|
+
if (force || !partial[key])
|
|
111
120
|
partial[key] = defaults[key];
|
|
112
121
|
}
|
|
113
122
|
return partial;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import * as Rules from './Rules';
|
|
3
3
|
import { ensureTypeInfo } from '../Model/NeoTypeInfo';
|
|
4
|
+
import NeoStrings from '../Localisation/NeoStrings';
|
|
4
5
|
function addRuleToType(type, propertyName, rule) {
|
|
5
6
|
ensureTypeInfo(type.constructor).neo.addAttributeRule(propertyName, rule);
|
|
6
7
|
}
|
|
7
8
|
export function Required(errorTextOrOptions) {
|
|
8
9
|
return function (type, propertyKey) {
|
|
9
|
-
var options = { errorText:
|
|
10
|
+
var options = { errorText: NeoStrings.validation.rules.required, allowZero: false };
|
|
10
11
|
if (errorTextOrOptions !== undefined) {
|
|
11
12
|
if (typeof errorTextOrOptions === "string") {
|
|
12
13
|
options.errorText = errorTextOrOptions;
|
|
@@ -20,16 +21,14 @@ export function Required(errorTextOrOptions) {
|
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
export function EmailAddress(errorText) {
|
|
23
|
-
if (errorText === void 0) { errorText = "{0} is not a valid email address"; }
|
|
24
24
|
return function (type, propertyKey) {
|
|
25
|
-
var emailAddressRule = new Rules.EmailAddressRule(errorText);
|
|
25
|
+
var emailAddressRule = new Rules.EmailAddressRule(errorText !== null && errorText !== void 0 ? errorText : NeoStrings.validation.rules.emailAddress);
|
|
26
26
|
addRuleToType(type, propertyKey, emailAddressRule);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
export function RegExp(expression, errorText) {
|
|
30
|
-
if (errorText === void 0) { errorText = "{0} is in an invalid format"; }
|
|
31
30
|
return function (type, propertyKey) {
|
|
32
|
-
var regExpRule = new Rules.RegExpRule(expression, errorText);
|
|
31
|
+
var regExpRule = new Rules.RegExpRule(expression, errorText !== null && errorText !== void 0 ? errorText : NeoStrings.validation.rules.regExp);
|
|
33
32
|
addRuleToType(type, propertyKey, regExpRule);
|
|
34
33
|
};
|
|
35
34
|
}
|
package/dist/Validation/Rules.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
2
|
import { RuleSeverity } from './ValidationState';
|
|
3
3
|
import { Utils } from '../Utils';
|
|
4
|
+
import NeoStrings from '../Localisation/NeoStrings';
|
|
4
5
|
var Rule = /** @class */ (function () {
|
|
5
6
|
function Rule() {
|
|
6
7
|
this.ruleId = Utils.uuidv4();
|
|
@@ -40,12 +41,12 @@ var StringLengthRule = /** @class */ (function (_super) {
|
|
|
40
41
|
var errorTextValue = this.errorText;
|
|
41
42
|
if (this.minLength && (!value || value.length < this.minLength)) {
|
|
42
43
|
if (!errorTextValue)
|
|
43
|
-
errorTextValue =
|
|
44
|
+
errorTextValue = NeoStrings.validation.rules.stringLengthLessThan;
|
|
44
45
|
context.addError(errorTextValue.format(propertyInstance.propertyInfo.readableName, this.minLength.toString(), this.maxLength.toString()));
|
|
45
46
|
}
|
|
46
47
|
else if (value && value.length > this.maxLength) {
|
|
47
48
|
if (!errorTextValue)
|
|
48
|
-
errorTextValue =
|
|
49
|
+
errorTextValue = NeoStrings.validation.rules.stringLengthMoreThan;
|
|
49
50
|
context.addError(errorTextValue.format(propertyInstance.propertyInfo.readableName, this.maxLength.toString()));
|
|
50
51
|
}
|
|
51
52
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { MenuUtils } from './Components/ContextMenu/MenuUtils';
|
|
|
12
12
|
import FileUtils from "./FileUtils";
|
|
13
13
|
import { runInTask } from './Components/TaskRunner/Decorators';
|
|
14
14
|
import { createProperty } from "./Model/PropertyInstance";
|
|
15
|
+
import NeoStrings from "./Localisation/NeoStrings";
|
|
15
16
|
import * as Attributes from './Model/Decorators';
|
|
16
17
|
import * as Rules from './Validation/Decorators';
|
|
17
18
|
import * as AppServices from './AppServices';
|
|
@@ -22,16 +23,18 @@ import * as Localisation from './Localisation';
|
|
|
22
23
|
import * as Misc from './Misc';
|
|
23
24
|
import * as Model from './Model';
|
|
24
25
|
import * as Network from './ConnectionManager';
|
|
26
|
+
import * as Numeric from './Numeric';
|
|
25
27
|
import * as Routing from './Routing';
|
|
26
28
|
import * as Security from './Security';
|
|
27
29
|
import * as SignalR from './SignalR';
|
|
28
30
|
import * as Validation from './Validation';
|
|
29
31
|
import * as Views from './Views/IViewBase';
|
|
30
32
|
declare const NotifyUtils: Components.INotificationHelper;
|
|
31
|
-
export { AppServices, Attributes, Components, Data, DateUtils, DebounceHelper, EnumHelper, FileUtils, JsonSchema, Localisation, List, MenuUtils, Misc, ModalUtils, Model, NeoModel, Network, NotifyUtils, NumberUtils, Routing, Rules, Security, SignalR, StringUtils, Validation, Views, };
|
|
33
|
+
export { AppServices, Attributes, Components, Data, DateUtils, DebounceHelper, EnumHelper, FileUtils, JsonSchema, Localisation, List, MenuUtils, Misc, ModalUtils, Model, NeoModel, NeoStrings, Network, NotifyUtils, Numeric, NumberUtils, Routing, Rules, Security, SignalR, StringUtils, Validation, Views, };
|
|
32
34
|
export { runInTask, createProperty };
|
|
33
35
|
export { default as ModelBase } from './Model/ModelBase';
|
|
34
36
|
export { default as ValueObject } from './Model/ValueObject';
|
|
35
37
|
export { LookupBase } from './Model/LookupBase';
|
|
36
|
-
export { default as TaskRunner
|
|
38
|
+
export { default as TaskRunner } from './Components/TaskRunner/TaskRunner';
|
|
39
|
+
export type { ITaskRunner } from './Components/TaskRunner/TaskRunner';
|
|
37
40
|
export { Utils } from './Utils';
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import { MenuUtils } from './Components/ContextMenu/MenuUtils';
|
|
|
13
13
|
import FileUtils from "./FileUtils";
|
|
14
14
|
import { runInTask } from './Components/TaskRunner/Decorators';
|
|
15
15
|
import { createProperty } from "./Model/PropertyInstance";
|
|
16
|
+
import NeoStrings from "./Localisation/NeoStrings";
|
|
16
17
|
// Namespaced exports from 1 file
|
|
17
18
|
import * as Attributes from './Model/Decorators';
|
|
18
19
|
import * as Rules from './Validation/Decorators';
|
|
@@ -25,6 +26,7 @@ import * as Localisation from './Localisation';
|
|
|
25
26
|
import * as Misc from './Misc';
|
|
26
27
|
import * as Model from './Model';
|
|
27
28
|
import * as Network from './ConnectionManager';
|
|
29
|
+
import * as Numeric from './Numeric';
|
|
28
30
|
import * as Routing from './Routing';
|
|
29
31
|
import * as Security from './Security';
|
|
30
32
|
import * as SignalR from './SignalR';
|
|
@@ -33,7 +35,7 @@ import * as Views from './Views/IViewBase';
|
|
|
33
35
|
import { NotificationHelper } from './Components/Notifications/NotificationHelper';
|
|
34
36
|
var NotifyUtils = new NotificationHelper();
|
|
35
37
|
// Types
|
|
36
|
-
export { AppServices, Attributes, Components, Data, DateUtils, DebounceHelper, EnumHelper, FileUtils, JsonSchema, Localisation, List, MenuUtils, Misc, ModalUtils, Model, NeoModel, Network, NotifyUtils, NumberUtils, Routing, Rules, Security, SignalR, StringUtils, Validation, Views, };
|
|
38
|
+
export { AppServices, Attributes, Components, Data, DateUtils, DebounceHelper, EnumHelper, FileUtils, JsonSchema, Localisation, List, MenuUtils, Misc, ModalUtils, Model, NeoModel, NeoStrings, Network, NotifyUtils, Numeric, NumberUtils, Routing, Rules, Security, SignalR, StringUtils, Validation, Views, };
|
|
37
39
|
// Functions
|
|
38
40
|
export { runInTask, createProperty };
|
|
39
41
|
export { default as ModelBase } from './Model/ModelBase';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@singularsystems/neo-core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.6",
|
|
4
4
|
"description": "Core functionality for the Neo client library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@microsoft/signalr": "^6.0.1",
|
|
26
26
|
"axios": "1.4.0",
|
|
27
|
-
"decimal.js-light": "^2.5.1",
|
|
28
27
|
"inversify": "^6.0.1",
|
|
29
28
|
"reflect-metadata": "0.1.13",
|
|
30
29
|
"tslib": "2.5.0"
|
package/CHANGELOG.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Breaking changes
|
|
4
|
-
|
|
5
|
-
## 0.10.65 (6 March 2023)
|
|
6
|
-
|
|
7
|
-
* `IErrorHandler` now requires the return type to be `Promise<IErrorDisplay>` instead of `IErrorDisplay`.
|
|
8
|
-
* Most of the protected methods in `ErrorHandler` have been changed to `async`.
|
|
9
|
-
* These changes were required in order to be able to read errors from axios blob responses.
|
|
10
|
-
|
|
11
|
-
# Change Log
|
|
12
|
-
|
|
13
|
-
## 0.10.65 (6 March 2023)
|
|
14
|
-
|
|
15
|
-
* Fixed error handler not parsing axios responses when response type is `blob`.
|