@singularsystems/neo-react 0.10.20 → 0.10.24
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/React/ReactModelCreator.js +4 -1
- package/dist/React/ReactModelCreator.js.map +1 -1
- package/dist/ReactComponents/FileManager/FileInput.d.ts +12 -3
- package/dist/ReactComponents/FileManager/FileInput.js +69 -17
- package/dist/ReactComponents/FileManager/FileInput.js.map +1 -1
- package/dist/ReactComponents/ValidationSummary.d.ts +1 -1
- package/dist/Routing/RoutingState.d.ts +1 -0
- package/dist/Routing/RoutingState.js +10 -3
- package/dist/Routing/RoutingState.js.map +1 -1
- package/package.json +2 -2
|
@@ -78,7 +78,7 @@ var ReactModelCreator = /** @class */ (function (_super) {
|
|
|
78
78
|
};
|
|
79
79
|
ReactModelCreator.prototype.addChangeTracking = function (object, propertyName, propertyInfo, observable, propertyInstance) {
|
|
80
80
|
var _this = this;
|
|
81
|
-
var trackProperty = this.typeInfo.inheritsModelBase && !propertyInfo.noTrack;
|
|
81
|
+
var trackProperty = this.typeInfo.inheritsModelBase && !propertyInfo.noTrack && propertyInfo.relationType !== Misc.RelationType.ChildList;
|
|
82
82
|
var onChangedOptions = propertyInfo && propertyInfo.onChangedOptions;
|
|
83
83
|
if (trackProperty || propertyInfo.propertyType === Misc.DataType.Date || (onChangedOptions && onChangedOptions.requiresOldValue)) {
|
|
84
84
|
intercept(object, propertyName, function (onChange) {
|
|
@@ -86,6 +86,9 @@ var ReactModelCreator = /** @class */ (function (_super) {
|
|
|
86
86
|
if (trackProperty && onChange.newValue !== observable.value)
|
|
87
87
|
object.isSelfDirty = true;
|
|
88
88
|
if (propertyInfo.propertyType === Misc.DataType.Date) {
|
|
89
|
+
if (typeof onChange.newValue === "string") {
|
|
90
|
+
throw "Error: tried to assign a string to a date property.";
|
|
91
|
+
}
|
|
89
92
|
propertyInstance.sortValue = onChange.newValue ? onChange.newValue.getTime() : 0;
|
|
90
93
|
}
|
|
91
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactModelCreator.js","sourceRoot":"","sources":["../../src/React/ReactModelCreator.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAe,MAAM,MAAM,CAAA;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAS,UAAU,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AACzF,OAAO,gBAAgB,MAAM,uDAAuD,CAAC;AASrF,IAAM,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEvD;IAAuC,qCAAgB;IAAvD;;
|
|
1
|
+
{"version":3,"file":"ReactModelCreator.js","sourceRoot":"","sources":["../../src/React/ReactModelCreator.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAe,MAAM,MAAM,CAAA;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAS,UAAU,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AACzF,OAAO,gBAAgB,MAAM,uDAAuD,CAAC;AASrF,IAAM,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEvD;IAAuC,qCAAgB;IAAvD;;IA8IA,CAAC;IA5IU,2CAAe,GAAtB,UAAuB,QAAY;QAE/B,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;YAC/B,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE;gBAEpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,QAA4B,CAA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gBAC5C,OAAO,QAAQ,CAAC;YACpB,CAAC,CAAC,CAAC;SACN;QAED,IAAI,SAA+D,CAAC;QAEpE,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,WAAW,EAAE;YAElD,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,OAAO,EAAE;gBAC9C,SAAS,GAAG,UAAC,QAAa,EAAE,QAAa;oBACrC,KAAK,CAAC,QAAQ,CAAC,gBAAgB,EAAE,UAAC,KAAK,IAAK,OAAA,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAA7D,CAA6D,EAAE,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;gBACnJ,CAAC,CAAA;aACJ;iBAAM;gBACH,SAAS,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACzD;SACJ;QAED,IAAI,SAAS,EAAE;YACX,IAAI,UAAa,CAAC;YAClB,QAAQ,CAAC;gBACL,UAAQ,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;gBAChC,OAAO,UAAQ,CAAA;YACnB,CAAC,EAAE;gBACC,IAAI,CAAC,KAAI,CAAC,QAAQ,CAAC,oBAAoB,IAAI,CAAE,MAA2B,CAAC,WAAW,EAAE;oBAClF,SAAU,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,aAAa,EAAE,UAAQ,CAAC,CAAC;iBAC/D;YACL,CAAC,CAAC,CAAA;SACL;IACL,CAAC;IACL,wBAAC;AAAD,CAAC,AA9ID,CAAuC,gBAAgB,GA8ItD"}
|
|
@@ -2,15 +2,22 @@ import * as React from 'react';
|
|
|
2
2
|
import { FileContext, IFileComponentProps } from './FileContext';
|
|
3
3
|
import { IButtonOptions } from '@singularsystems/neo-core/dist/Components/ButtonOptions';
|
|
4
4
|
import ComponentBase from '../ComponentBase';
|
|
5
|
+
import { AxiosPromise } from 'axios';
|
|
5
6
|
export interface IFileEditorProps extends IFileComponentProps {
|
|
6
7
|
/** Browse button options */
|
|
7
8
|
browseButton?: IButtonOptions;
|
|
8
9
|
/** Set this if you want to allow the user to choose a new file. */
|
|
9
10
|
changeFileText?: string;
|
|
10
|
-
/** Text to show in the download link. Use {0} as a
|
|
11
|
+
/** Text to show in the download link. Use {0} as a placeholder for fileName */
|
|
11
12
|
downloadLinkText?: string;
|
|
12
|
-
/**
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Path of API endpoint which will handle downloading a file. Only required if downloadLinkText is specified.
|
|
15
|
+
*/
|
|
16
|
+
downloadEndpoint?: string | ((fileID: any) => string);
|
|
17
|
+
/**
|
|
18
|
+
* Path of API endpoint which will handle downloading a file. Only required if downloadLinkText is specified.
|
|
19
|
+
*/
|
|
20
|
+
downloadEndpointAsync?: ((fileId: any) => Promise<string>) | ((fileId: any) => AxiosPromise<string>);
|
|
14
21
|
isReadOnly?: boolean;
|
|
15
22
|
/** Placeholder text for drag here... */
|
|
16
23
|
placeholder?: string;
|
|
@@ -22,6 +29,7 @@ export default class FileInput extends ComponentBase<IFileEditorProps> {
|
|
|
22
29
|
static contextType: React.Context<import("./FileContext").IFileContextProps>;
|
|
23
30
|
context: React.ContextType<typeof FileContext>;
|
|
24
31
|
private fileManager;
|
|
32
|
+
private gettingDownloadUrl;
|
|
25
33
|
render(): JSX.Element;
|
|
26
34
|
private getFileDisplayComponent;
|
|
27
35
|
/** Renders when the file is busy uploading. */
|
|
@@ -30,4 +38,5 @@ export default class FileInput extends ComponentBase<IFileEditorProps> {
|
|
|
30
38
|
private renderEmpty;
|
|
31
39
|
/** Renders where a file has been selected. */
|
|
32
40
|
private renderSelected;
|
|
41
|
+
private onDownloadLinkClicked;
|
|
33
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __assign, __decorate, __extends, __spreadArrays } from "tslib";
|
|
1
|
+
import { __assign, __awaiter, __decorate, __extends, __generator, __metadata, __spreadArrays } from "tslib";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Components, Utils, Misc, Validation } from '@singularsystems/neo-core';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
@@ -7,13 +7,16 @@ import { FileContext } from './FileContext';
|
|
|
7
7
|
import { ProgressBar, Button, FileDropArea } from '../_Exports';
|
|
8
8
|
import ComponentBase from '../ComponentBase';
|
|
9
9
|
import { BindPropsHelper } from '../PropTypes';
|
|
10
|
+
import { observable } from 'mobx';
|
|
10
11
|
/**
|
|
11
12
|
* The file manager component manages uploading, and binding of files to a model.
|
|
12
13
|
*/
|
|
13
14
|
var FileInput = /** @class */ (function (_super) {
|
|
14
15
|
__extends(FileInput, _super);
|
|
15
16
|
function FileInput() {
|
|
16
|
-
|
|
17
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
18
|
+
_this.gettingDownloadUrl = false;
|
|
19
|
+
return _this;
|
|
17
20
|
}
|
|
18
21
|
FileInput.prototype.render = function () {
|
|
19
22
|
var splitProps = BindPropsHelper.normaliseEditorProps(this, this.props);
|
|
@@ -29,11 +32,16 @@ var FileInput = /** @class */ (function (_super) {
|
|
|
29
32
|
else {
|
|
30
33
|
fileProps = this.props;
|
|
31
34
|
}
|
|
32
|
-
if (this.
|
|
33
|
-
|
|
35
|
+
if (!this.fileManager) {
|
|
36
|
+
if (this.context.fileManager) {
|
|
37
|
+
this.fileManager = this.context.fileManager;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.fileManager = new Components.BoundFileManager(fileProps.uploadEndpoint, fileProps);
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
43
|
else {
|
|
36
|
-
this.fileManager =
|
|
44
|
+
this.fileManager.options = fileProps;
|
|
37
45
|
}
|
|
38
46
|
if (!this.fileManager.uploadEndpoint) {
|
|
39
47
|
throw Error("File input requires an uploadEndpoint.");
|
|
@@ -44,7 +52,7 @@ var FileInput = /** @class */ (function (_super) {
|
|
|
44
52
|
var displayInfo = this.fileManager.options.bind.validator.getDisplayState(Validation.DisplayMode.Always);
|
|
45
53
|
var domProps = { className: "form-control" };
|
|
46
54
|
displayInfo.applyToDom(domProps, !splitProps.inGroup);
|
|
47
|
-
if (this.fileManager.isUploading) {
|
|
55
|
+
if (this.fileManager.isUploading || this.gettingDownloadUrl) {
|
|
48
56
|
return this.renderBusy(fileProps);
|
|
49
57
|
}
|
|
50
58
|
else {
|
|
@@ -57,16 +65,10 @@ var FileInput = /** @class */ (function (_super) {
|
|
|
57
65
|
}
|
|
58
66
|
};
|
|
59
67
|
FileInput.prototype.getFileDisplayComponent = function (props, domProps) {
|
|
68
|
+
var _this = this;
|
|
60
69
|
var options = this.fileManager.options;
|
|
61
|
-
if (props.downloadEndpoint) {
|
|
62
|
-
var downloadPath = void 0;
|
|
70
|
+
if (props.downloadEndpoint || props.downloadEndpointAsync) {
|
|
63
71
|
var downloadLinkText = void 0;
|
|
64
|
-
if (typeof props.downloadEndpoint === "string") {
|
|
65
|
-
downloadPath = props.downloadEndpoint;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
downloadPath = props.downloadEndpoint(options.bind.value);
|
|
69
|
-
}
|
|
70
72
|
var fileName = "file";
|
|
71
73
|
if (options.fileDescriptorProperty) {
|
|
72
74
|
var fileDesciptor = options.fileDescriptorProperty.value;
|
|
@@ -83,9 +85,21 @@ var FileInput = /** @class */ (function (_super) {
|
|
|
83
85
|
downloadLinkText = props.downloadLinkText.format(fileName);
|
|
84
86
|
}
|
|
85
87
|
else {
|
|
86
|
-
downloadLinkText =
|
|
88
|
+
downloadLinkText = fileName;
|
|
89
|
+
}
|
|
90
|
+
if (props.downloadEndpointAsync) {
|
|
91
|
+
return React.createElement("a", __assign({}, domProps, { href: "/", onClick: function (e) { return _this.onDownloadLinkClicked(e, props); } }), downloadLinkText);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
var downloadPath = void 0;
|
|
95
|
+
if (typeof props.downloadEndpoint === "string") {
|
|
96
|
+
downloadPath = props.downloadEndpoint;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
downloadPath = props.downloadEndpoint(options.bind.value);
|
|
100
|
+
}
|
|
101
|
+
return React.createElement("a", __assign({}, domProps, { href: downloadPath }), downloadLinkText);
|
|
87
102
|
}
|
|
88
|
-
return React.createElement("a", __assign({}, domProps, { href: downloadPath }), downloadLinkText);
|
|
89
103
|
}
|
|
90
104
|
else {
|
|
91
105
|
return React.createElement("span", __assign({}, domProps), "File selected");
|
|
@@ -93,7 +107,10 @@ var FileInput = /** @class */ (function (_super) {
|
|
|
93
107
|
};
|
|
94
108
|
/** Renders when the file is busy uploading. */
|
|
95
109
|
FileInput.prototype.renderBusy = function (props) {
|
|
96
|
-
return
|
|
110
|
+
return this.gettingDownloadUrl ?
|
|
111
|
+
React.createElement("div", { className: "form-control form-control-loading" },
|
|
112
|
+
React.createElement("div", { className: "spinner-border" })) :
|
|
113
|
+
React.createElement(ProgressBar, { variant: "dark", type: "animated", progress: this.fileManager.uploadPercent });
|
|
97
114
|
};
|
|
98
115
|
/** Renders where a file has not yet been selected. */
|
|
99
116
|
FileInput.prototype.renderEmpty = function (props, editorProps, domProps) {
|
|
@@ -128,7 +145,42 @@ var FileInput = /** @class */ (function (_super) {
|
|
|
128
145
|
this.getFileDisplayComponent(props, domProps),
|
|
129
146
|
append));
|
|
130
147
|
};
|
|
148
|
+
FileInput.prototype.onDownloadLinkClicked = function (e, props) {
|
|
149
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
150
|
+
var result, downloadPath;
|
|
151
|
+
return __generator(this, function (_a) {
|
|
152
|
+
switch (_a.label) {
|
|
153
|
+
case 0:
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
_a.label = 1;
|
|
156
|
+
case 1:
|
|
157
|
+
_a.trys.push([1, , 3, 4]);
|
|
158
|
+
this.gettingDownloadUrl = true;
|
|
159
|
+
return [4 /*yield*/, props.downloadEndpointAsync(this.fileManager.options.bind.value)];
|
|
160
|
+
case 2:
|
|
161
|
+
result = _a.sent();
|
|
162
|
+
downloadPath = void 0;
|
|
163
|
+
if (typeof result === "string") {
|
|
164
|
+
downloadPath = result;
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
downloadPath = result.data;
|
|
168
|
+
}
|
|
169
|
+
window.location.href = downloadPath;
|
|
170
|
+
return [3 /*break*/, 4];
|
|
171
|
+
case 3:
|
|
172
|
+
this.gettingDownloadUrl = false;
|
|
173
|
+
return [7 /*endfinally*/];
|
|
174
|
+
case 4: return [2 /*return*/];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
};
|
|
131
179
|
FileInput.contextType = FileContext;
|
|
180
|
+
__decorate([
|
|
181
|
+
observable,
|
|
182
|
+
__metadata("design:type", Boolean)
|
|
183
|
+
], FileInput.prototype, "gettingDownloadUrl", void 0);
|
|
132
184
|
FileInput = __decorate([
|
|
133
185
|
observer
|
|
134
186
|
], FileInput);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../../src/ReactComponents/FileManager/FileInput.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAuB,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAwB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../../src/ReactComponents/FileManager/FileInput.tsx"],"names":[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,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;wBAChB,qBAAM,KAAK,CAAC,qBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAA;;wBAAhF,MAAM,GAAG,SAAuE;wBAClF,YAAY,SAAQ,CAAC;wBACzB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;4BAC5B,YAAY,GAAG,MAAM,CAAC;yBACzB;6BAAM;4BACH,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC;yBAC9B;wBAED,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC;;;wBAGpC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;;;;;;KAGvC;IA3LM,qBAAW,GAAG,WAAW,CAAC;IAMjC;QADC,UAAU;;yDACiC;IAP3B,SAAS;QAD7B,QAAQ;OACY,SAAS,CA6L7B;IAAD,gBAAC;CAAA,AA7LD,CAAuC,aAAa,GA6LnD;eA7LoB,SAAS"}
|
|
@@ -5,7 +5,7 @@ export interface IValidationSummaryProps {
|
|
|
5
5
|
* Invalid object graph from Validation.getValidationSummary().
|
|
6
6
|
* If this is null, 'model' must be specified.
|
|
7
7
|
*/
|
|
8
|
-
graph?: Validation.IInvalidObjectGraph | Validation.IInvalidObjectGraph[];
|
|
8
|
+
graph?: Validation.IInvalidObjectGraph | Validation.IInvalidObjectGraph[] | null;
|
|
9
9
|
/**
|
|
10
10
|
* Model or list of models.
|
|
11
11
|
* If this is null, 'graph' must be specified.
|
|
@@ -8,6 +8,7 @@ export declare class RoutingState {
|
|
|
8
8
|
currentRoute?: IProcessedRoute;
|
|
9
9
|
currentRouteView?: RouteView;
|
|
10
10
|
leavePromise?: Promise<boolean> | Promise<Misc.ModalResult> | Promise<void>;
|
|
11
|
+
observableRoute: IProcessedRoute | null;
|
|
11
12
|
setCurrentRoute(routeProps: RouteComponentProps, route: IProcessedRoute): void;
|
|
12
13
|
private previousRoute?;
|
|
13
14
|
onRouteChanged(): void;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { injectable } from 'inversify';
|
|
3
|
+
import { observable } from 'mobx';
|
|
3
4
|
import { ViewBase } from '../Views';
|
|
4
5
|
var RoutingState = /** @class */ (function () {
|
|
5
6
|
function RoutingState() {
|
|
7
|
+
this.observableRoute = null;
|
|
6
8
|
}
|
|
7
9
|
RoutingState.prototype.setCurrentRoute = function (routeProps, route) {
|
|
8
10
|
this.currentRouteProps = routeProps;
|
|
9
11
|
this.currentRoute = route;
|
|
10
12
|
};
|
|
11
13
|
RoutingState.prototype.onRouteChanged = function () {
|
|
12
|
-
var _a;
|
|
14
|
+
var _a, _b;
|
|
13
15
|
if (this.previousRoute !== this.currentRoute) {
|
|
14
16
|
this.previousRoute = this.currentRoute;
|
|
15
|
-
|
|
17
|
+
this.observableRoute = (_a = this.currentRoute, (_a !== null && _a !== void 0 ? _a : null));
|
|
18
|
+
if (((_b = ViewBase.currentView) === null || _b === void 0 ? void 0 : _b.constructor) !== this.currentRoute.component) {
|
|
16
19
|
ViewBase.currentView = null;
|
|
17
20
|
}
|
|
18
21
|
// Scroll back to top as if the browser had actually loaded a new page.
|
|
@@ -25,6 +28,10 @@ var RoutingState = /** @class */ (function () {
|
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
};
|
|
31
|
+
__decorate([
|
|
32
|
+
observable.ref,
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], RoutingState.prototype, "observableRoute", void 0);
|
|
28
35
|
RoutingState = __decorate([
|
|
29
36
|
injectable()
|
|
30
37
|
], RoutingState);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoutingState.js","sourceRoot":"","sources":["../../src/Routing/RoutingState.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":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
"name": "@singularsystems/neo-react",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.24",
|
|
4
4
|
"description": "React application logic and components for the Neo client library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@types/rc-slider": "^8.6.5",
|
|
33
33
|
"@types/react-color": "^3.0.1",
|
|
34
34
|
"@types/react-select": "3.1.0",
|
|
35
|
-
"@singularsystems/neo-core": "^0.10.
|
|
35
|
+
"@singularsystems/neo-core": "^0.10.32",
|
|
36
36
|
"axios": "^0.21.1",
|
|
37
37
|
"history": "4.10.1",
|
|
38
38
|
"inversify": "5.0.1",
|