@singularsystems/neo-core 1.0.0-beta.0 → 1.0.0-beta.2
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/ApiClient/ReadApiClient.d.ts +1 -1
- package/dist/ApiClient/ReadApiClient.js +1 -1
- package/dist/Components/ButtonOptions.d.ts +4 -0
- package/dist/Components/DatePicker/DatePicker.d.ts +2 -1
- package/dist/Components/DatePicker/DatePicker.js +18 -17
- package/dist/Components/DatePicker/DatePickerOptions.d.ts +2 -0
- package/dist/Components/Modal/ModalOptions.d.ts +2 -0
- package/dist/Data/Paging/PageManager.d.ts +8 -0
- package/dist/Data/Paging/PageManager.js +31 -1
- package/dist/Dates/DateUtils.js +8 -0
- package/dist/JsonSchema/ClassMetadata.d.ts +2 -1
- package/dist/JsonSchema/ClassMetadata.js +14 -9
- package/dist/JsonSchema/MetadataBase.d.ts +8 -0
- package/dist/JsonSchema/MetadataBase.js +12 -0
- package/dist/JsonSchema/PropertyMetadata.d.ts +7 -3
- package/dist/JsonSchema/PropertyMetadata.js +15 -4
- package/dist/JsonSchema/TypeCache.js +1 -0
- package/dist/Model/Decorators.js +1 -1
- package/dist/Model/IModelBase.d.ts +1 -1
- package/dist/Model/ModelBase.js +1 -8
- package/dist/NumberUtils.d.ts +7 -3
- package/dist/NumberUtils.js +22 -11
- package/dist/Settings.d.ts +7 -0
- package/dist/Settings.js +8 -1
- package/dist/SignalR/HubBase.d.ts +4 -1
- package/dist/SignalR/HubBase.js +4 -0
- package/dist/Utils.js +2 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosPromise } from 'axios';
|
|
2
|
-
import { PlainObject } from '../Model/IModelBase';
|
|
3
2
|
import { ApiClientBase } from './ApiClientBase';
|
|
3
|
+
import { PlainObject } from '../Model/IModelBase';
|
|
4
4
|
export interface IReadApiClient<TModel, TKey extends string | number> {
|
|
5
5
|
/** Gets a list of entities. */
|
|
6
6
|
get(): AxiosPromise<PlainObject<TModel>[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
|
+
import { ApiClientBase } from './ApiClientBase';
|
|
2
3
|
import { Globals } from '../Misc';
|
|
3
4
|
import { NeoTypes } from '../AppServices';
|
|
4
|
-
import { ApiClientBase } from './ApiClientBase';
|
|
5
5
|
var ReadApiClient = /** @class */ (function (_super) {
|
|
6
6
|
__extends(ReadApiClient, _super);
|
|
7
7
|
function ReadApiClient(apiPath, axios) {
|
|
@@ -46,6 +46,10 @@ export interface IButtonOptions {
|
|
|
46
46
|
* Adds a pulse animation to the button.
|
|
47
47
|
*/
|
|
48
48
|
pulse?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Set a custom variant for when a standard variant is not provided.
|
|
51
|
+
*/
|
|
52
|
+
customVariant?: string;
|
|
49
53
|
}
|
|
50
54
|
export interface IButtonDropDownItem {
|
|
51
55
|
/** Menu item text or component */
|
|
@@ -24,6 +24,7 @@ export default class DatePicker {
|
|
|
24
24
|
private today;
|
|
25
25
|
private currentViewDate;
|
|
26
26
|
constructor(container: HTMLDivElement, options?: IPartialDateProps);
|
|
27
|
+
static mustShowInput(options?: IPartialDateProps): boolean | undefined;
|
|
27
28
|
inputFocused(e: FocusEvent): void;
|
|
28
29
|
inputBlurred(): void;
|
|
29
30
|
onInputBlurred(closePopup: boolean): void;
|
|
@@ -64,7 +65,7 @@ export default class DatePicker {
|
|
|
64
65
|
private previousClick;
|
|
65
66
|
private nextClick;
|
|
66
67
|
private moveCurrent;
|
|
67
|
-
private
|
|
68
|
+
private autoSetDay;
|
|
68
69
|
private createAndAppend;
|
|
69
70
|
destroy(): void;
|
|
70
71
|
}
|
|
@@ -23,7 +23,7 @@ var DatePicker = /** @class */ (function () {
|
|
|
23
23
|
this.inputBlurred = this.inputBlurred.bind(this);
|
|
24
24
|
this.inputChanged = this.inputChanged.bind(this);
|
|
25
25
|
this.inputKeyDown = this.inputKeyDown.bind(this);
|
|
26
|
-
if (
|
|
26
|
+
if (DatePicker.mustShowInput(options)) {
|
|
27
27
|
this.input = this.container.getElementsByTagName('input')[0];
|
|
28
28
|
this.input.addEventListener("focus", this.inputFocused);
|
|
29
29
|
this.input.addEventListener("mousedown", this.inputFocused);
|
|
@@ -34,7 +34,13 @@ var DatePicker = /** @class */ (function () {
|
|
|
34
34
|
this.input.placeholder = "hh:mm" + (this.options.formatString.indexOf("s") > 0 ? ":ss" : "");
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
if (this.options.alwaysShow) {
|
|
38
|
+
container.classList.add("neo-datepicker-always-show");
|
|
39
|
+
}
|
|
37
40
|
}
|
|
41
|
+
DatePicker.mustShowInput = function (options) {
|
|
42
|
+
return !options || !options.alwaysShow || options.showInput;
|
|
43
|
+
};
|
|
38
44
|
DatePicker.prototype.inputFocused = function (e) {
|
|
39
45
|
if (!this.popup && !this.isReadOnly) {
|
|
40
46
|
this.show();
|
|
@@ -109,7 +115,7 @@ var DatePicker = /** @class */ (function () {
|
|
|
109
115
|
}
|
|
110
116
|
};
|
|
111
117
|
DatePicker.prototype.removePopup = function (animate) {
|
|
112
|
-
if (this.popup) {
|
|
118
|
+
if (this.popup && !this.options.alwaysShow) {
|
|
113
119
|
if (animate) {
|
|
114
120
|
AnimationHelper.scale(this.popup, DatePicker.AnimationClassName, 1, 0);
|
|
115
121
|
AnimationHelper.beginRemove(this.container, this.popup);
|
|
@@ -132,9 +138,13 @@ var DatePicker = /** @class */ (function () {
|
|
|
132
138
|
// Note: this may have the side effect of calling update().
|
|
133
139
|
this.setBindProperty(dateValue, false);
|
|
134
140
|
this.setInputValue();
|
|
135
|
-
if (
|
|
141
|
+
if (options.close) {
|
|
136
142
|
this.removePopup(true);
|
|
137
143
|
}
|
|
144
|
+
if (!options.close || this.options.alwaysShow) {
|
|
145
|
+
this.resetCurrentViewDate();
|
|
146
|
+
this.populateContentContainer(true);
|
|
147
|
+
}
|
|
138
148
|
};
|
|
139
149
|
DatePicker.prototype.setBindProperty = function (dateValue, suspend) {
|
|
140
150
|
if (dateValue) {
|
|
@@ -147,7 +157,7 @@ var DatePicker = /** @class */ (function () {
|
|
|
147
157
|
}
|
|
148
158
|
};
|
|
149
159
|
DatePicker.prototype.setInputValue = function () {
|
|
150
|
-
if (
|
|
160
|
+
if (this.input) {
|
|
151
161
|
var displayValue = "";
|
|
152
162
|
if (this.bindProperty.value) {
|
|
153
163
|
displayValue = DateUtils.format(this.bindProperty.value, this.options.formatString);
|
|
@@ -187,8 +197,8 @@ var DatePicker = /** @class */ (function () {
|
|
|
187
197
|
if (this.options.alwaysShow) {
|
|
188
198
|
this.createComponents();
|
|
189
199
|
}
|
|
200
|
+
this.setInputValue();
|
|
190
201
|
}
|
|
191
|
-
this.setInputValue();
|
|
192
202
|
};
|
|
193
203
|
DatePicker.prototype.resetCurrentViewDate = function () {
|
|
194
204
|
this.setCurrentViewDate(this.bindProperty.value);
|
|
@@ -302,15 +312,7 @@ var DatePicker = /** @class */ (function () {
|
|
|
302
312
|
var currentDate = new Date(this.currentViewDate);
|
|
303
313
|
var lastDayOfMonth = DateUtils.monthEnd(currentDate);
|
|
304
314
|
this.prevButton.disabled = this.options.minDateNoTime.getTime() >= currentDate.getTime();
|
|
305
|
-
if (this.canAutoSetDate && this.options.autoChangeDate == "start") {
|
|
306
|
-
//this.setCurrentViewDate(currentDate)
|
|
307
|
-
//this.setBindProperty(currentDate, true);
|
|
308
|
-
}
|
|
309
315
|
this.nextButton.disabled = this.options.maxDateNoTime.getTime() <= lastDayOfMonth.getTime();
|
|
310
|
-
if (this.canAutoSetDate && this.options.autoChangeDate == "end") {
|
|
311
|
-
//this.setCurrentViewDate(lastDayOfMonth)
|
|
312
|
-
//this.setBindProperty(lastDayOfMonth, true);
|
|
313
|
-
}
|
|
314
316
|
// Start with the first Sunday before the first of the month.
|
|
315
317
|
currentDate.setDate(currentDate.getDate() - currentDate.getDay());
|
|
316
318
|
var first = true;
|
|
@@ -463,7 +465,7 @@ var DatePicker = /** @class */ (function () {
|
|
|
463
465
|
if (this.currentViewType == ViewType.Days) {
|
|
464
466
|
this.canAutoSetDate = true;
|
|
465
467
|
this.currentViewDate.setMonth(this.currentViewDate.getMonth() + delta, 1);
|
|
466
|
-
this.
|
|
468
|
+
this.autoSetDay();
|
|
467
469
|
}
|
|
468
470
|
else {
|
|
469
471
|
this.currentViewDate.setFullYear(this.currentViewDate.getFullYear() + delta * (this.currentViewType == ViewType.Months ? 1 : YearsInYearView));
|
|
@@ -471,7 +473,7 @@ var DatePicker = /** @class */ (function () {
|
|
|
471
473
|
this.populateContentContainer(false, true);
|
|
472
474
|
this.contentAnimationHelper.slide(delta, true);
|
|
473
475
|
};
|
|
474
|
-
DatePicker.prototype.
|
|
476
|
+
DatePicker.prototype.autoSetDay = function () {
|
|
475
477
|
var autoDate = null;
|
|
476
478
|
if (this.options.autoChangeDate === "end") {
|
|
477
479
|
// Forward
|
|
@@ -482,8 +484,7 @@ var DatePicker = /** @class */ (function () {
|
|
|
482
484
|
autoDate = this.currentViewDate;
|
|
483
485
|
}
|
|
484
486
|
if (autoDate) {
|
|
485
|
-
this.
|
|
486
|
-
this.setCurrentViewDate(this.bindProperty.value);
|
|
487
|
+
this.setBindValue(autoDate, { preserveTime: true, close: false });
|
|
487
488
|
}
|
|
488
489
|
};
|
|
489
490
|
DatePicker.prototype.createAndAppend = function (parent, elementType, className) {
|
|
@@ -13,6 +13,8 @@ export default class DatePickerOptions {
|
|
|
13
13
|
timeOnly: boolean;
|
|
14
14
|
/** Displays the picker inline and without an input control */
|
|
15
15
|
alwaysShow: boolean;
|
|
16
|
+
/** Shows the input when using `alwaysShow`. */
|
|
17
|
+
showInput: boolean;
|
|
16
18
|
minDate: Date;
|
|
17
19
|
maxDate: Date;
|
|
18
20
|
/** Automatically sets the date to the start or end of the displayed month when scrolling through months. */
|
|
@@ -27,6 +27,8 @@ export interface IModalOptionsBase {
|
|
|
27
27
|
footerContent?: any;
|
|
28
28
|
/** Callback to handle when the modal is closed / cancelled by the user. Not called on accept. */
|
|
29
29
|
onClose?: (event: any) => void;
|
|
30
|
+
/** Called after the modal animation completes. */
|
|
31
|
+
afterClose?: () => void;
|
|
30
32
|
}
|
|
31
33
|
export default interface IModalOptions extends IModalOptionsBase {
|
|
32
34
|
/** Controls the visibility of the modal. */
|
|
@@ -79,6 +79,10 @@ export interface IPageManager {
|
|
|
79
79
|
* @param taskRunner Optional alternate task runner to use.
|
|
80
80
|
*/
|
|
81
81
|
refreshData(getCount?: boolean, taskRunner?: ITaskRunner): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Refresh the data only if the page manager has initialised.
|
|
84
|
+
*/
|
|
85
|
+
invalidateData(taskRunner?: ITaskRunner): Promise<void>;
|
|
82
86
|
/**
|
|
83
87
|
* Refresh the data by calling the api endpoint with the current criteria.
|
|
84
88
|
* This will not reset the page index, and will not update the total record count, therefore should only be called if your criteria has not changed since the last full fetch using refreshData().
|
|
@@ -128,6 +132,10 @@ export declare class PageManager<TCriteria extends ValueObject, TModel extends I
|
|
|
128
132
|
* @param taskRunner Optional alternate task runner to use.
|
|
129
133
|
*/
|
|
130
134
|
refreshData(getCount?: boolean, taskRunner?: ITaskRunner): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Refresh the data only if the page manager has initialised.
|
|
137
|
+
*/
|
|
138
|
+
invalidateData(taskRunner?: ITaskRunner): Promise<void>;
|
|
131
139
|
/**
|
|
132
140
|
* Refresh the data by calling the api endpoint with the current criteria.
|
|
133
141
|
* This will not reset the page index, and will not update the total record count, therefore should only be called if your criteria has not changed since the last full fetch using refreshData().
|
|
@@ -166,13 +166,43 @@ export var PageManager = /** @class */ (function (_super) {
|
|
|
166
166
|
});
|
|
167
167
|
});
|
|
168
168
|
};
|
|
169
|
+
/**
|
|
170
|
+
* Refresh the data only if the page manager has initialised.
|
|
171
|
+
*/
|
|
172
|
+
PageManager.prototype.invalidateData = function (taskRunner) {
|
|
173
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
174
|
+
return __generator(this, function (_a) {
|
|
175
|
+
switch (_a.label) {
|
|
176
|
+
case 0:
|
|
177
|
+
if (!this.hasInitialised) return [3 /*break*/, 2];
|
|
178
|
+
return [4 /*yield*/, this.refreshData(true, taskRunner)];
|
|
179
|
+
case 1:
|
|
180
|
+
_a.sent();
|
|
181
|
+
_a.label = 2;
|
|
182
|
+
case 2: return [2 /*return*/];
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
};
|
|
169
187
|
/**
|
|
170
188
|
* Refresh the data by calling the api endpoint with the current criteria.
|
|
171
189
|
* This will not reset the page index, and will not update the total record count, therefore should only be called if your criteria has not changed since the last full fetch using refreshData().
|
|
172
190
|
* @param taskRunner Optional alternate task runner to use.
|
|
173
191
|
*/
|
|
174
192
|
PageManager.prototype.refreshPage = function (taskRunner) {
|
|
175
|
-
return this
|
|
193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
194
|
+
return __generator(this, function (_a) {
|
|
195
|
+
switch (_a.label) {
|
|
196
|
+
case 0:
|
|
197
|
+
if (!this.hasInitialised) return [3 /*break*/, 2];
|
|
198
|
+
return [4 /*yield*/, this.refreshData(false, taskRunner)];
|
|
199
|
+
case 1:
|
|
200
|
+
_a.sent();
|
|
201
|
+
_a.label = 2;
|
|
202
|
+
case 2: return [2 /*return*/];
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
});
|
|
176
206
|
};
|
|
177
207
|
PageManager.prototype.fetchAndSetData = function (request) {
|
|
178
208
|
var _a;
|
package/dist/Dates/DateUtils.js
CHANGED
|
@@ -187,6 +187,14 @@ var DateUtils = /** @class */ (function () {
|
|
|
187
187
|
var newDate = new Date();
|
|
188
188
|
newDate.setFullYear(date.getFullYear() + ((_a = timeSpan.years) !== null && _a !== void 0 ? _a : 0), date.getMonth() + ((_b = timeSpan.months) !== null && _b !== void 0 ? _b : 0), date.getDate() + ((_c = timeSpan.days) !== null && _c !== void 0 ? _c : 0));
|
|
189
189
|
newDate.setHours(date.getHours() + ((_d = timeSpan.hours) !== null && _d !== void 0 ? _d : 0), date.getMinutes() + ((_e = timeSpan.minutes) !== null && _e !== void 0 ? _e : 0), date.getSeconds() + ((_f = timeSpan.seconds) !== null && _f !== void 0 ? _f : 0), date.getMilliseconds() + ((_g = timeSpan.milliseconds) !== null && _g !== void 0 ? _g : 0));
|
|
190
|
+
if (timeSpan.months && !timeSpan.days) {
|
|
191
|
+
// 31 May - 1 month == 31 April == 1 May, this will fix that:
|
|
192
|
+
var newMonth = newDate.getMonth();
|
|
193
|
+
var oldMonth = date.getMonth();
|
|
194
|
+
if (newMonth !== oldMonth + (timeSpan.months % 12)) {
|
|
195
|
+
newDate.setDate(0);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
190
198
|
return newDate;
|
|
191
199
|
};
|
|
192
200
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PropertyMetadata } from './PropertyMetadata';
|
|
2
2
|
import { IJsonObjectType } from './JsonSchemaTypes';
|
|
3
3
|
import { ITypeCacheInternal } from './TypeCache';
|
|
4
|
-
|
|
4
|
+
import { MetadataBase } from './MetadataBase';
|
|
5
|
+
export declare class ClassMetadata extends MetadataBase {
|
|
5
6
|
name: string;
|
|
6
7
|
constructor(name: string);
|
|
7
8
|
/**
|
|
@@ -1,31 +1,36 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
1
2
|
import { TypeMetadata } from './TypeMetadata';
|
|
2
3
|
import { PropertyMetadata } from './PropertyMetadata';
|
|
3
|
-
|
|
4
|
+
import { MetadataBase } from './MetadataBase';
|
|
5
|
+
var ClassMetadata = /** @class */ (function (_super) {
|
|
6
|
+
__extends(ClassMetadata, _super);
|
|
4
7
|
function ClassMetadata(name) {
|
|
5
|
-
|
|
8
|
+
var _this = _super.call(this) || this;
|
|
9
|
+
_this.name = name;
|
|
6
10
|
/**
|
|
7
11
|
* All properties.
|
|
8
12
|
*/
|
|
9
|
-
|
|
13
|
+
_this.properties = [];
|
|
10
14
|
/**
|
|
11
15
|
* Properties excluding child objects and lists.
|
|
12
16
|
*/
|
|
13
|
-
|
|
17
|
+
_this.simpleProperties = [];
|
|
14
18
|
/**
|
|
15
19
|
* Properties containing child object types.
|
|
16
20
|
*/
|
|
17
|
-
|
|
21
|
+
_this.childObjectProperties = [];
|
|
18
22
|
/**
|
|
19
23
|
* Properties containing child list types.
|
|
20
24
|
*/
|
|
21
|
-
|
|
25
|
+
_this.childListProperties = [];
|
|
26
|
+
return _this;
|
|
22
27
|
}
|
|
23
28
|
ClassMetadata.prototype.loadMetaData = function (schema, cache) {
|
|
29
|
+
_super.prototype.loadFromSchema.call(this, schema);
|
|
24
30
|
for (var propertyKey in schema.properties) {
|
|
25
31
|
var propertySchema = schema.properties[propertyKey];
|
|
26
32
|
var propertyMetaData = new PropertyMetadata(propertyKey, TypeMetadata.create(propertySchema, cache));
|
|
27
|
-
propertyMetaData.
|
|
28
|
-
propertyMetaData.description = propertySchema.description;
|
|
33
|
+
propertyMetaData.loadFromSchema(propertySchema);
|
|
29
34
|
if (propertyMetaData.type.basicType !== "unknown") {
|
|
30
35
|
this.properties.push(propertyMetaData);
|
|
31
36
|
if (propertyMetaData.type.basicType === "array") {
|
|
@@ -49,5 +54,5 @@ var ClassMetadata = /** @class */ (function () {
|
|
|
49
54
|
return clone;
|
|
50
55
|
};
|
|
51
56
|
return ClassMetadata;
|
|
52
|
-
}());
|
|
57
|
+
}(MetadataBase));
|
|
53
58
|
export { ClassMetadata };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var MetadataBase = /** @class */ (function () {
|
|
2
|
+
function MetadataBase() {
|
|
3
|
+
}
|
|
4
|
+
MetadataBase.prototype.loadFromSchema = function (schema) {
|
|
5
|
+
this.title = schema.title;
|
|
6
|
+
this.description = schema.description;
|
|
7
|
+
this.ordinal = schema["x-ordinal"];
|
|
8
|
+
this.hidden = schema["x-hidden"];
|
|
9
|
+
};
|
|
10
|
+
return MetadataBase;
|
|
11
|
+
}());
|
|
12
|
+
export { MetadataBase };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { IJsonSchemaDescriptorType } from './JsonSchemaTypes';
|
|
2
|
+
import { MetadataBase } from './MetadataBase';
|
|
1
3
|
import { TypeMetadata } from './TypeMetadata';
|
|
2
|
-
export declare class PropertyMetadata {
|
|
4
|
+
export declare class PropertyMetadata extends MetadataBase {
|
|
3
5
|
propertyName: string;
|
|
4
6
|
type: TypeMetadata;
|
|
5
7
|
constructor(propertyName: string, type: TypeMetadata);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
formatString?: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
hAlign?: "left" | "center" | "right";
|
|
11
|
+
loadFromSchema(schema: IJsonSchemaDescriptorType): void;
|
|
8
12
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { MetadataBase } from './MetadataBase';
|
|
3
|
+
var PropertyMetadata = /** @class */ (function (_super) {
|
|
4
|
+
__extends(PropertyMetadata, _super);
|
|
2
5
|
function PropertyMetadata(propertyName, type) {
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
var _this = _super.call(this) || this;
|
|
7
|
+
_this.propertyName = propertyName;
|
|
8
|
+
_this.type = type;
|
|
9
|
+
return _this;
|
|
5
10
|
}
|
|
11
|
+
PropertyMetadata.prototype.loadFromSchema = function (schema) {
|
|
12
|
+
_super.prototype.loadFromSchema.call(this, schema);
|
|
13
|
+
this.formatString = schema["x-formatString"];
|
|
14
|
+
this.width = schema["x-width"];
|
|
15
|
+
this.hAlign = schema["x-hAlign"];
|
|
16
|
+
};
|
|
6
17
|
return PropertyMetadata;
|
|
7
|
-
}());
|
|
18
|
+
}(MetadataBase));
|
|
8
19
|
export { PropertyMetadata };
|
|
@@ -20,6 +20,7 @@ var TypeCache = /** @class */ (function () {
|
|
|
20
20
|
enumerable: false,
|
|
21
21
|
configurable: true
|
|
22
22
|
});
|
|
23
|
+
// This is an internal method used by TypeMetadata
|
|
23
24
|
TypeCache.prototype.getOrAddType = function (name) {
|
|
24
25
|
if (name.startsWith("#/definitions/")) {
|
|
25
26
|
name = name.replace("#/definitions/", "");
|
package/dist/Model/Decorators.js
CHANGED
|
@@ -184,6 +184,6 @@ export function Action(isAction) {
|
|
|
184
184
|
export function DisplayMember() {
|
|
185
185
|
return function (type, propertyKey) {
|
|
186
186
|
var pi = getOrAddPropertyInfo(type, propertyKey);
|
|
187
|
-
type.constructor.neo.displayMember = pi;
|
|
187
|
+
ensureTypeInfo(type.constructor).neo.displayMember = pi;
|
|
188
188
|
};
|
|
189
189
|
}
|
|
@@ -56,7 +56,7 @@ export interface IMakeBindableOptions {
|
|
|
56
56
|
makeObservable?: boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Specifies whether methods should be converted to mobx actions. This is `true` by default.
|
|
59
|
-
* Use `Attributes.Action()` to override this per
|
|
59
|
+
* Use `Attributes.Action()` to override this per method. */
|
|
60
60
|
autoActions?: boolean;
|
|
61
61
|
/**
|
|
62
62
|
* If `true`, this instance will not be converted. In inheritence heirarchies, use this to ensure only the last derived type converts the instance.
|
package/dist/Model/ModelBase.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __decorate, __extends, __metadata } from "tslib";
|
|
2
2
|
import * as ModelTraverser from './ModelGraphTraverser';
|
|
3
|
-
import {
|
|
3
|
+
import { Computed, NoTracking, Observable } from './Decorators';
|
|
4
4
|
import { JSFormatter } from '../Data/Serialiser';
|
|
5
|
-
import { ValidationRules } from '../Validation/ValidationRules';
|
|
6
5
|
import { BindableBase } from './BindableBase';
|
|
7
6
|
import { Misc } from '../';
|
|
8
7
|
import { SerialiseType } from './Misc';
|
|
@@ -178,12 +177,6 @@ var ModelBase = /** @class */ (function (_super) {
|
|
|
178
177
|
__metadata("design:type", Object),
|
|
179
178
|
__metadata("design:paramtypes", [])
|
|
180
179
|
], ModelBase.prototype, "readyToSave", null);
|
|
181
|
-
__decorate([
|
|
182
|
-
Action(false),
|
|
183
|
-
__metadata("design:type", Function),
|
|
184
|
-
__metadata("design:paramtypes", [ValidationRules]),
|
|
185
|
-
__metadata("design:returntype", void 0)
|
|
186
|
-
], ModelBase.prototype, "addBusinessRules", null);
|
|
187
180
|
return ModelBase;
|
|
188
181
|
}(BindableBase));
|
|
189
182
|
export default ModelBase;
|
package/dist/NumberUtils.d.ts
CHANGED
|
@@ -11,12 +11,16 @@ export declare enum NumberFormat {
|
|
|
11
11
|
}
|
|
12
12
|
export default class NumberUtils {
|
|
13
13
|
static thousandsSeparator: string;
|
|
14
|
+
static decimalSeparator?: string;
|
|
15
|
+
/** Set this to `","` if you want to allow a comma as a decimal separator when parsing string input. */
|
|
16
|
+
static allowAsDecimalSeparator?: string;
|
|
14
17
|
static defaultCurrencySymbol: string;
|
|
15
|
-
static numberFormats: {
|
|
16
|
-
[key in NumberFormat]: string;
|
|
17
|
-
};
|
|
18
|
+
static numberFormats: {};
|
|
18
19
|
/** If values typed into numeric editors should be divided by 100 when stored. */
|
|
19
20
|
static transformPercent: boolean;
|
|
21
|
+
static initialise(): void;
|
|
22
|
+
/** Uses the users local decimal separator when formatting and parsing numbers. */
|
|
23
|
+
static useLocaleDecimalSeparator(): void;
|
|
20
24
|
/** Gets a format string for the pre-defined number format.
|
|
21
25
|
* @param displayDecimals No of decimals to display if using a decimals format.
|
|
22
26
|
*/
|
package/dist/NumberUtils.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
var _a;
|
|
2
1
|
import Decimal from "decimal.js-light";
|
|
3
2
|
import { DataType } from "./Model/Misc";
|
|
4
3
|
import Globals from './Globals';
|
|
5
4
|
export var NumberFormat;
|
|
6
5
|
(function (NumberFormat) {
|
|
7
|
-
// Mask is [Thousands
|
|
6
|
+
// Mask is [Thousands Separator, Decimals (2 places), Percent, Currency Symbol]
|
|
8
7
|
NumberFormat[NumberFormat["None"] = 0] = "None";
|
|
9
8
|
NumberFormat[NumberFormat["NoDecimals"] = 4096] = "NoDecimals";
|
|
10
9
|
NumberFormat[NumberFormat["Decimals"] = 4352] = "Decimals";
|
|
@@ -16,6 +15,22 @@ export var NumberFormat;
|
|
|
16
15
|
var NumberUtils = /** @class */ (function () {
|
|
17
16
|
function NumberUtils() {
|
|
18
17
|
}
|
|
18
|
+
NumberUtils.initialise = function () {
|
|
19
|
+
NumberUtils.numberFormats[NumberFormat.None] = "#";
|
|
20
|
+
NumberUtils.numberFormats[NumberFormat.NoDecimals] = "#,##0;(#,##0)";
|
|
21
|
+
NumberUtils.numberFormats[NumberFormat.Decimals] = "#,##0.00;(#,##0.00)";
|
|
22
|
+
NumberUtils.numberFormats[NumberFormat.PercentNoDecimals] = "#,##0%;(#,##0)%";
|
|
23
|
+
NumberUtils.numberFormats[NumberFormat.PercentDecimals] = "#,##0.00%;(#,##0.00%)";
|
|
24
|
+
NumberUtils.numberFormats[NumberFormat.CurrencyNoDecimals] = "_#,##0;(_#,##0)";
|
|
25
|
+
NumberUtils.numberFormats[NumberFormat.CurrencyDecimals] = "_#,##0.00;(_#,##0.00)";
|
|
26
|
+
};
|
|
27
|
+
/** Uses the users local decimal separator when formatting and parsing numbers. */
|
|
28
|
+
NumberUtils.useLocaleDecimalSeparator = function () {
|
|
29
|
+
this.decimalSeparator = 1.1.toLocaleString().substring(1, 2);
|
|
30
|
+
if (this.decimalSeparator !== ".") {
|
|
31
|
+
this.allowAsDecimalSeparator = this.decimalSeparator;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
19
34
|
/** Gets a format string for the pre-defined number format.
|
|
20
35
|
* @param displayDecimals No of decimals to display if using a decimals format.
|
|
21
36
|
*/
|
|
@@ -224,6 +239,9 @@ var NumberUtils = /** @class */ (function () {
|
|
|
224
239
|
}
|
|
225
240
|
numberStrings[0] = str;
|
|
226
241
|
}
|
|
242
|
+
if (this.decimalSeparator) {
|
|
243
|
+
decimal = this.decimalSeparator;
|
|
244
|
+
}
|
|
227
245
|
numberStrings[1] = (numberParts[1] && numberStrings[1]) ? decimal + numberStrings[1] : "";
|
|
228
246
|
numberStrings[0] = numberStrings[0].replace(/,/g, NumberUtils.thousandsSeparator);
|
|
229
247
|
return beforeText + numberStrings[0] + numberStrings[1] + afterText; //put back any negation and combine integer and fraction.
|
|
@@ -231,17 +249,10 @@ var NumberUtils = /** @class */ (function () {
|
|
|
231
249
|
;
|
|
232
250
|
NumberUtils.thousandsSeparator = "\xA0"; // non breaking space.
|
|
233
251
|
NumberUtils.defaultCurrencySymbol = "R";
|
|
234
|
-
NumberUtils.numberFormats =
|
|
235
|
-
_a[NumberFormat.None] = "#",
|
|
236
|
-
_a[NumberFormat.NoDecimals] = "#,##0;(#,##0)",
|
|
237
|
-
_a[NumberFormat.Decimals] = "#,##0.00;(#,##0.00)",
|
|
238
|
-
_a[NumberFormat.PercentNoDecimals] = "#,##0%;(#,##0)%",
|
|
239
|
-
_a[NumberFormat.PercentDecimals] = "#,##0.00%;(#,##0.00%)",
|
|
240
|
-
_a[NumberFormat.CurrencyNoDecimals] = "_#,##0;(_#,##0)",
|
|
241
|
-
_a[NumberFormat.CurrencyDecimals] = "_#,##0.00;(_#,##0.00)",
|
|
242
|
-
_a);
|
|
252
|
+
NumberUtils.numberFormats = {};
|
|
243
253
|
/** If values typed into numeric editors should be divided by 100 when stored. */
|
|
244
254
|
NumberUtils.transformPercent = true;
|
|
245
255
|
return NumberUtils;
|
|
246
256
|
}());
|
|
247
257
|
export default NumberUtils;
|
|
258
|
+
NumberUtils.initialise();
|
package/dist/Settings.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { ValidationDisplayMode } from './Validation/Misc';
|
|
|
2
2
|
import { IButtonOptions } from './Components/ButtonOptions';
|
|
3
3
|
import { DataType } from './Model/Misc';
|
|
4
4
|
export declare const Settings: {
|
|
5
|
+
/** Specify this if your app has a header that is fixed to the top of the screen. */
|
|
6
|
+
fixedAppHeaderElement: (() => HTMLElement | null) | null;
|
|
5
7
|
/**
|
|
6
8
|
* Time the css animation takes to show / hide a modal. Note: This must match the css animation time.
|
|
7
9
|
*/
|
|
@@ -38,6 +40,11 @@ export declare const Settings: {
|
|
|
38
40
|
expandButton: IButtonOptions;
|
|
39
41
|
boolTrueClass: string;
|
|
40
42
|
boolFalseClass: string;
|
|
43
|
+
/**
|
|
44
|
+
* Will cause headers to stick to the top of the screen / scroll element when scrolling.
|
|
45
|
+
* This will apply to all NeoGrids, but can be overridden per grid.
|
|
46
|
+
*/
|
|
47
|
+
useStickyHeaders: boolean;
|
|
41
48
|
};
|
|
42
49
|
modal: {
|
|
43
50
|
acceptButton: IButtonOptions;
|
package/dist/Settings.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ValidationDisplayMode } from './Validation/Misc';
|
|
2
2
|
import { DataType } from './Model/Misc';
|
|
3
3
|
export var Settings = {
|
|
4
|
+
/** Specify this if your app has a header that is fixed to the top of the screen. */
|
|
5
|
+
fixedAppHeaderElement: null,
|
|
4
6
|
/**
|
|
5
7
|
* Time the css animation takes to show / hide a modal. Note: This must match the css animation time.
|
|
6
8
|
*/
|
|
@@ -60,7 +62,12 @@ export var Settings = {
|
|
|
60
62
|
tabIndex: -1
|
|
61
63
|
},
|
|
62
64
|
boolTrueClass: "far fa-lg fa-check-square",
|
|
63
|
-
boolFalseClass: "far fa-lg fa-square text-light"
|
|
65
|
+
boolFalseClass: "far fa-lg fa-square text-light",
|
|
66
|
+
/**
|
|
67
|
+
* Will cause headers to stick to the top of the screen / scroll element when scrolling.
|
|
68
|
+
* This will apply to all NeoGrids, but can be overridden per grid.
|
|
69
|
+
*/
|
|
70
|
+
useStickyHeaders: false,
|
|
64
71
|
},
|
|
65
72
|
modal: {
|
|
66
73
|
acceptButton: {
|
|
@@ -2,6 +2,7 @@ import * as signalR from '@microsoft/signalr';
|
|
|
2
2
|
import { IHubReceiver } from "./HubReceiver";
|
|
3
3
|
import { AppServices } from '../';
|
|
4
4
|
import { IConnection, ConnectionState } from '../ConnectionManager';
|
|
5
|
+
import { IDisposable } from '../Misc';
|
|
5
6
|
export interface IHubBase extends IConnection {
|
|
6
7
|
/**
|
|
7
8
|
* Connects to the server hub if the connection state is disconnected.
|
|
@@ -31,7 +32,7 @@ export interface IHubOptions {
|
|
|
31
32
|
/** Log level in production. Defaults to Error. */
|
|
32
33
|
releaseLogLevel: signalR.LogLevel;
|
|
33
34
|
}
|
|
34
|
-
export declare class HubBase implements IHubBase {
|
|
35
|
+
export declare class HubBase implements IHubBase, IDisposable {
|
|
35
36
|
private url;
|
|
36
37
|
private authenticationService;
|
|
37
38
|
private connection;
|
|
@@ -53,6 +54,8 @@ export declare class HubBase implements IHubBase {
|
|
|
53
54
|
connect(): Promise<boolean>;
|
|
54
55
|
connectIfAuthenticated(): Promise<boolean>;
|
|
55
56
|
disconnect(): Promise<void>;
|
|
57
|
+
/** Disconnects the hub client from the hub. Subscriptions are not disposed. */
|
|
58
|
+
dispose(): void;
|
|
56
59
|
/**
|
|
57
60
|
* Invokes a method on the server hub, returning a promise.
|
|
58
61
|
* The Promise is resolved with the return value (if any) when the method on the server returns.
|
package/dist/SignalR/HubBase.js
CHANGED
|
@@ -119,6 +119,10 @@ var HubBase = /** @class */ (function () {
|
|
|
119
119
|
HubBase.prototype.disconnect = function () {
|
|
120
120
|
return this.connection.stop();
|
|
121
121
|
};
|
|
122
|
+
/** Disconnects the hub client from the hub. Subscriptions are not disposed. */
|
|
123
|
+
HubBase.prototype.dispose = function () {
|
|
124
|
+
this.disconnect();
|
|
125
|
+
};
|
|
122
126
|
/**
|
|
123
127
|
* Invokes a method on the server hub, returning a promise.
|
|
124
128
|
* The Promise is resolved with the return value (if any) when the method on the server returns.
|
package/dist/Utils.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __spreadArray } from "tslib";
|
|
2
2
|
import { DebounceHelper } from './DebounceHelper';
|
|
3
|
+
import { ensureTypeInfo } from './Model/NeoTypeInfo';
|
|
3
4
|
var lut = [];
|
|
4
5
|
for (var i = 0; i < 256; i++) {
|
|
5
6
|
lut[i] = (i < 16 ? '0' : '') + (i).toString(16);
|
|
@@ -76,7 +77,7 @@ var Utils = /** @class */ (function () {
|
|
|
76
77
|
args[_i - 1] = arguments[_i];
|
|
77
78
|
}
|
|
78
79
|
if (type.prototype.constructor.neo) {
|
|
79
|
-
return type.
|
|
80
|
+
return ensureTypeInfo(type).neo.createInstance(args);
|
|
80
81
|
}
|
|
81
82
|
else {
|
|
82
83
|
throw "Cannot instantiate '".concat(type.name, "' because it does not have an @NeoModel attribute.");
|