@singularsystems/neo-react 1.0.0-alpha.2 → 1.0.0-beta.0
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/CHANGELOG.md +98 -0
- package/README.md +4 -0
- package/dist/Modules/NeoReactModule.d.ts +4 -4
- package/dist/Modules/NeoReactModule.js +28 -26
- package/dist/Modules/ReactSetup.d.ts +2 -2
- package/dist/Modules/ReactSetup.js +17 -17
- package/dist/Modules/Types.d.ts +63 -61
- package/dist/Modules/Types.js +13 -12
- package/dist/React/AutoRunner.d.ts +5 -5
- package/dist/React/AutoRunner.js +94 -92
- package/dist/React/DataView.d.ts +6 -6
- package/dist/React/DataView.js +11 -11
- package/dist/React/ReactModelCreator.d.ts +11 -11
- package/dist/React/ReactModelCreator.js +165 -162
- package/dist/ReactComponents/Button.d.ts +24 -23
- package/dist/ReactComponents/Button.js +131 -123
- package/dist/ReactComponents/Card.d.ts +24 -23
- package/dist/ReactComponents/Card.js +56 -54
- package/dist/ReactComponents/Collapsable.d.ts +23 -23
- package/dist/ReactComponents/Collapsable.js +38 -38
- package/dist/ReactComponents/CollapsableBase.d.ts +13 -13
- package/dist/ReactComponents/CollapsableBase.js +42 -42
- package/dist/ReactComponents/ColorPicker.d.ts +26 -26
- package/dist/ReactComponents/ColorPicker.js +67 -67
- package/dist/ReactComponents/ComponentBase.d.ts +17 -17
- package/dist/ReactComponents/ComponentBase.js +33 -33
- package/dist/ReactComponents/ContextMenu/ContextMenu.d.ts +25 -24
- package/dist/ReactComponents/ContextMenu/ContextMenu.js +91 -88
- package/dist/ReactComponents/ContextMenu/ContextMenuContainer.d.ts +14 -14
- package/dist/ReactComponents/ContextMenu/ContextMenuContainer.js +48 -48
- package/dist/ReactComponents/ContextMenu/ContextMenuState.d.ts +8 -7
- package/dist/ReactComponents/ContextMenu/ContextMenuState.js +23 -23
- package/dist/ReactComponents/DatePicker.d.ts +19 -19
- package/dist/ReactComponents/DatePicker.js +53 -53
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.d.ts +93 -83
- package/dist/ReactComponents/DropDown/AutoCompleteDropDown.js +222 -188
- package/dist/ReactComponents/DropDown/DropDown.d.ts +44 -44
- package/dist/ReactComponents/DropDown/DropDown.js +138 -134
- package/dist/ReactComponents/DropDown/DropDownBase.d.ts +16 -15
- package/dist/ReactComponents/DropDown/DropDownBase.js +86 -108
- package/dist/ReactComponents/DropDown/LookupHelper.d.ts +13 -0
- package/dist/ReactComponents/DropDown/LookupHelper.js +45 -0
- package/dist/ReactComponents/ErrorHandler.d.ts +9 -8
- package/dist/ReactComponents/ErrorHandler.js +92 -91
- package/dist/ReactComponents/FileManager/FileBasicInput.d.ts +20 -20
- package/dist/ReactComponents/FileManager/FileBasicInput.js +70 -70
- package/dist/ReactComponents/FileManager/FileContext.d.ts +16 -16
- package/dist/ReactComponents/FileManager/FileContext.js +24 -24
- package/dist/ReactComponents/FileManager/FileDropArea.d.ts +19 -18
- package/dist/ReactComponents/FileManager/FileDropArea.js +66 -64
- package/dist/ReactComponents/FileManager/FileInput.d.ts +44 -42
- package/dist/ReactComponents/FileManager/FileInput.js +191 -189
- package/dist/ReactComponents/FileManager/FileUploadButton.d.ts +17 -17
- package/dist/ReactComponents/FileManager/FileUploadButton.js +49 -49
- package/dist/ReactComponents/FileManager/FileUploadProgress.d.ts +14 -14
- package/dist/ReactComponents/FileManager/FileUploadProgress.js +35 -35
- package/dist/ReactComponents/Form.d.ts +19 -18
- package/dist/ReactComponents/Form.js +90 -90
- package/dist/ReactComponents/FormContext.d.ts +33 -31
- package/dist/ReactComponents/FormContext.js +39 -40
- package/dist/ReactComponents/FormGroup/FormGroup.d.ts +37 -37
- package/dist/ReactComponents/FormGroup/FormGroup.js +83 -84
- package/dist/ReactComponents/FormGroup/FormGroupFloating.d.ts +19 -19
- package/dist/ReactComponents/FormGroup/FormGroupFloating.js +97 -97
- package/dist/ReactComponents/FormGroup/FormGroupInline.d.ts +11 -11
- package/dist/ReactComponents/FormGroup/FormGroupInline.js +43 -43
- package/dist/ReactComponents/Grid/ButtonColumn.d.ts +47 -47
- package/dist/ReactComponents/Grid/ButtonColumn.js +81 -82
- package/dist/ReactComponents/Grid/Column.d.ts +47 -47
- package/dist/ReactComponents/Grid/Column.js +205 -205
- package/dist/ReactComponents/Grid/ColumnHelper.d.ts +12 -12
- package/dist/ReactComponents/Grid/ColumnHelper.js +19 -19
- package/dist/ReactComponents/Grid/Grid.d.ts +87 -90
- package/dist/ReactComponents/Grid/Grid.js +203 -203
- package/dist/ReactComponents/Grid/Row.d.ts +81 -81
- package/dist/ReactComponents/Grid/Row.js +200 -201
- package/dist/ReactComponents/Grid/_Exports.d.ts +5 -5
- package/dist/ReactComponents/Grid/_Exports.js +5 -5
- package/dist/ReactComponents/GridLayout.d.ts +20 -20
- package/dist/ReactComponents/GridLayout.js +38 -38
- package/dist/ReactComponents/Icons/FontAwesomeIconFactory.d.ts +23 -0
- package/dist/ReactComponents/Icons/FontAwesomeIconFactory.js +43 -0
- package/dist/ReactComponents/Icons/IIconFactory.d.ts +21 -0
- package/dist/ReactComponents/Icons/IIconFactory.js +1 -0
- package/dist/ReactComponents/Icons/IconFactory.d.ts +9 -0
- package/dist/ReactComponents/Icons/IconFactory.js +45 -0
- package/dist/ReactComponents/Icons/index.d.ts +3 -0
- package/dist/ReactComponents/Icons/index.js +2 -0
- package/dist/ReactComponents/Input.d.ts +45 -45
- package/dist/ReactComponents/Input.js +153 -152
- package/dist/ReactComponents/InputHelpers.d.ts +6 -5
- package/dist/ReactComponents/InputHelpers.js +29 -33
- package/dist/ReactComponents/Link.d.ts +13 -13
- package/dist/ReactComponents/Link.js +28 -28
- package/dist/ReactComponents/Loader.d.ts +18 -18
- package/dist/ReactComponents/Loader.js +57 -57
- package/dist/ReactComponents/Misc.d.ts +15 -15
- package/dist/ReactComponents/Misc.js +28 -28
- package/dist/ReactComponents/Modal/Modal.d.ts +11 -11
- package/dist/ReactComponents/Modal/Modal.js +129 -129
- package/dist/ReactComponents/Modal/ModalContainer.d.ts +17 -17
- package/dist/ReactComponents/Modal/ModalContainer.js +37 -37
- package/dist/ReactComponents/Modal/ModalPortal.d.ts +16 -15
- package/dist/ReactComponents/Modal/ModalPortal.js +27 -27
- package/dist/ReactComponents/Notifications/Alert.d.ts +7 -6
- package/dist/ReactComponents/Notifications/Alert.js +38 -35
- package/dist/ReactComponents/Notifications/Toast.d.ts +9 -8
- package/dist/ReactComponents/Notifications/Toast.js +47 -45
- package/dist/ReactComponents/Notifications/ToastContainer.d.ts +8 -8
- package/dist/ReactComponents/Notifications/ToastContainer.js +18 -18
- package/dist/ReactComponents/NumberInput.d.ts +57 -50
- package/dist/ReactComponents/NumberInput.js +260 -246
- package/dist/ReactComponents/Paging/BasicPagerControls.d.ts +26 -25
- package/dist/ReactComponents/Paging/BasicPagerControls.js +57 -55
- package/dist/ReactComponents/Paging/PageSizeControl.d.ts +11 -11
- package/dist/ReactComponents/Paging/PageSizeControl.js +21 -21
- package/dist/ReactComponents/Paging/Pager.d.ts +24 -24
- package/dist/ReactComponents/Paging/Pager.js +41 -41
- package/dist/ReactComponents/ProgressBar.d.ts +19 -19
- package/dist/ReactComponents/ProgressBar.js +52 -52
- package/dist/ReactComponents/PropTypes.d.ts +161 -161
- package/dist/ReactComponents/PropTypes.js +253 -236
- package/dist/ReactComponents/RadioList.d.ts +29 -29
- package/dist/ReactComponents/RadioList.js +59 -77
- package/dist/ReactComponents/Slider.d.ts +28 -28
- package/dist/ReactComponents/Slider.js +76 -76
- package/dist/ReactComponents/StateObserver.d.ts +15 -15
- package/dist/ReactComponents/StateObserver.js +35 -35
- package/dist/ReactComponents/Tabs/Tab.d.ts +42 -41
- package/dist/ReactComponents/Tabs/Tab.js +71 -72
- package/dist/ReactComponents/Tabs/TabContainer.d.ts +44 -44
- package/dist/ReactComponents/Tabs/TabContainer.js +98 -98
- package/dist/ReactComponents/Tabs/TabManager.d.ts +62 -62
- package/dist/ReactComponents/Tabs/TabManager.js +154 -154
- package/dist/ReactComponents/Tooltip.d.ts +20 -19
- package/dist/ReactComponents/Tooltip.js +51 -51
- package/dist/ReactComponents/TooltipHelper.d.ts +8 -8
- package/dist/ReactComponents/TooltipHelper.js +84 -84
- package/dist/ReactComponents/TooltipProvider.d.ts +30 -30
- package/dist/ReactComponents/TooltipProvider.js +111 -111
- package/dist/ReactComponents/ValidationSummary.d.ts +23 -22
- package/dist/ReactComponents/ValidationSummary.js +46 -43
- package/dist/ReactComponents/_Exports.d.ts +41 -41
- package/dist/ReactComponents/_Exports.js +41 -41
- package/dist/ReactComponents/_Managers.d.ts +4 -4
- package/dist/ReactComponents/_Managers.js +4 -4
- package/dist/Routing/BreadCrumbItem.d.ts +14 -14
- package/dist/Routing/BreadCrumbItem.js +12 -12
- package/dist/Routing/IRouteChangedProps.d.ts +31 -31
- package/dist/Routing/IRouteChangedProps.js +1 -1
- package/dist/Routing/IRouteParameter.d.ts +22 -22
- package/dist/Routing/IRouteParameter.js +9 -9
- package/dist/Routing/MenuRoute.d.ts +25 -24
- package/dist/Routing/MenuRoute.js +24 -24
- package/dist/Routing/NavigationHelper.d.ts +41 -40
- package/dist/Routing/NavigationHelper.js +61 -61
- package/dist/Routing/PageLeaveHandler.d.ts +13 -13
- package/dist/Routing/PageLeaveHandler.js +74 -74
- package/dist/Routing/RouteProvider.d.ts +31 -31
- package/dist/Routing/RouteProvider.js +92 -92
- package/dist/Routing/RouteView.d.ts +50 -50
- package/dist/Routing/RouteView.js +143 -144
- package/dist/Routing/RoutingState.d.ts +18 -15
- package/dist/Routing/RoutingState.js +45 -40
- package/dist/Routing/ViewParameter.d.ts +80 -58
- package/dist/Routing/ViewParameter.js +116 -95
- package/dist/Routing/ViewParameterList.d.ts +53 -53
- package/dist/Routing/ViewParameterList.js +163 -145
- package/dist/Routing/index.d.ts +9 -9
- package/dist/Routing/index.js +6 -6
- package/dist/Services/DisposeHelper.d.ts +15 -15
- package/dist/Services/DisposeHelper.js +40 -41
- package/dist/Services/IDisposeHelper.d.ts +12 -12
- package/dist/Services/IDisposeHelper.js +1 -1
- package/dist/Views/EmptyViewModel.d.ts +5 -5
- package/dist/Views/EmptyViewModel.js +14 -14
- package/dist/Views/IViewModel.d.ts +16 -16
- package/dist/Views/IViewModel.js +1 -1
- package/dist/Views/PersistentViewBase.d.ts +10 -10
- package/dist/Views/PersistentViewBase.js +21 -21
- package/dist/Views/ViewBase.d.ts +70 -71
- package/dist/Views/ViewBase.js +166 -153
- package/dist/Views/ViewComponentBase.d.ts +19 -13
- package/dist/Views/ViewComponentBase.js +24 -21
- package/dist/Views/ViewModelBase.d.ts +57 -56
- package/dist/Views/ViewModelBase.js +122 -118
- package/dist/Views/ViewState.d.ts +13 -13
- package/dist/Views/ViewState.js +9 -9
- package/dist/Views/index.d.ts +5 -5
- package/dist/Views/index.js +5 -5
- package/dist/index.d.ts +11 -10
- package/dist/index.js +10 -9
- package/package.json +26 -26
- package/styles/DatePicker.scss +2 -2
- package/styles/Forms.scss +5 -0
- package/styles/Validation.scss +0 -9
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { __decorate, __extends, __metadata } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { Misc, AppServices } from '@singularsystems/neo-core';
|
|
5
|
-
import ContextMenu from './ContextMenu';
|
|
6
|
-
/**
|
|
7
|
-
* Shows the global context menu ui.
|
|
8
|
-
* To show a context menu, call MenuUtils.showContextMenu
|
|
9
|
-
*/
|
|
10
|
-
var ContextMenuContainer = /** @class */ (function (_super) {
|
|
11
|
-
__extends(ContextMenuContainer, _super);
|
|
12
|
-
function ContextMenuContainer(props) {
|
|
13
|
-
var _this = _super.call(this, props) || this;
|
|
14
|
-
_this.globalState = Misc.Globals.appService.get(AppServices.NeoTypes.UI.GlobalContextMenuState);
|
|
15
|
-
_this.onDocumentClick = _this.onDocumentClick.bind(_this);
|
|
16
|
-
_this.onMenuItemClick = _this.onMenuItemClick.bind(_this);
|
|
17
|
-
return _this;
|
|
18
|
-
}
|
|
19
|
-
ContextMenuContainer.prototype.componentDidMount = function () {
|
|
20
|
-
window.document.addEventListener("mousedown", this.onDocumentClick);
|
|
21
|
-
};
|
|
22
|
-
ContextMenuContainer.prototype.componentWillUnmount = function () {
|
|
23
|
-
window.document.removeEventListener("mousedown", this.onDocumentClick);
|
|
24
|
-
};
|
|
25
|
-
ContextMenuContainer.prototype.onDocumentClick = function (e) {
|
|
26
|
-
var element = e.target;
|
|
27
|
-
while (element) {
|
|
28
|
-
if (element.classList.contains("neo-context-menu")) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
element = element.parentElement;
|
|
32
|
-
}
|
|
33
|
-
this.globalState.position = null;
|
|
34
|
-
};
|
|
35
|
-
ContextMenuContainer.prototype.onMenuItemClick = function () {
|
|
36
|
-
this.globalState.position = null;
|
|
37
|
-
};
|
|
38
|
-
ContextMenuContainer.prototype.render = function () {
|
|
39
|
-
var globalState = this.globalState;
|
|
40
|
-
return globalState.position && React.createElement(ContextMenu, { menuItems: globalState.items, position: globalState.position, onClick: this.onMenuItemClick });
|
|
41
|
-
};
|
|
42
|
-
ContextMenuContainer = __decorate([
|
|
43
|
-
observer,
|
|
44
|
-
__metadata("design:paramtypes", [Object])
|
|
45
|
-
], ContextMenuContainer);
|
|
46
|
-
return ContextMenuContainer;
|
|
47
|
-
}(React.Component));
|
|
48
|
-
export default ContextMenuContainer;
|
|
1
|
+
import { __decorate, __extends, __metadata } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import { Misc, AppServices } from '@singularsystems/neo-core';
|
|
5
|
+
import ContextMenu from './ContextMenu';
|
|
6
|
+
/**
|
|
7
|
+
* Shows the global context menu ui.
|
|
8
|
+
* To show a context menu, call MenuUtils.showContextMenu
|
|
9
|
+
*/
|
|
10
|
+
var ContextMenuContainer = /** @class */ (function (_super) {
|
|
11
|
+
__extends(ContextMenuContainer, _super);
|
|
12
|
+
function ContextMenuContainer(props) {
|
|
13
|
+
var _this = _super.call(this, props) || this;
|
|
14
|
+
_this.globalState = Misc.Globals.appService.get(AppServices.NeoTypes.UI.GlobalContextMenuState);
|
|
15
|
+
_this.onDocumentClick = _this.onDocumentClick.bind(_this);
|
|
16
|
+
_this.onMenuItemClick = _this.onMenuItemClick.bind(_this);
|
|
17
|
+
return _this;
|
|
18
|
+
}
|
|
19
|
+
ContextMenuContainer.prototype.componentDidMount = function () {
|
|
20
|
+
window.document.addEventListener("mousedown", this.onDocumentClick);
|
|
21
|
+
};
|
|
22
|
+
ContextMenuContainer.prototype.componentWillUnmount = function () {
|
|
23
|
+
window.document.removeEventListener("mousedown", this.onDocumentClick);
|
|
24
|
+
};
|
|
25
|
+
ContextMenuContainer.prototype.onDocumentClick = function (e) {
|
|
26
|
+
var element = e.target;
|
|
27
|
+
while (element) {
|
|
28
|
+
if (element.classList.contains("neo-context-menu")) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
element = element.parentElement;
|
|
32
|
+
}
|
|
33
|
+
this.globalState.position = null;
|
|
34
|
+
};
|
|
35
|
+
ContextMenuContainer.prototype.onMenuItemClick = function () {
|
|
36
|
+
this.globalState.position = null;
|
|
37
|
+
};
|
|
38
|
+
ContextMenuContainer.prototype.render = function () {
|
|
39
|
+
var globalState = this.globalState;
|
|
40
|
+
return globalState.position && React.createElement(ContextMenu, { menuItems: globalState.items, position: globalState.position, onClick: this.onMenuItemClick });
|
|
41
|
+
};
|
|
42
|
+
ContextMenuContainer = __decorate([
|
|
43
|
+
observer,
|
|
44
|
+
__metadata("design:paramtypes", [Object])
|
|
45
|
+
], ContextMenuContainer);
|
|
46
|
+
return ContextMenuContainer;
|
|
47
|
+
}(React.Component));
|
|
48
|
+
export default ContextMenuContainer;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Components } from "@singularsystems/neo-core";
|
|
2
|
-
import { IPosition } from "@singularsystems/neo-core/dist/Components/ContextMenu/ContextMenu";
|
|
3
|
-
export declare class ContextMenuState {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Components } from "@singularsystems/neo-core";
|
|
2
|
+
import { IPosition } from "@singularsystems/neo-core/dist/Components/ContextMenu/ContextMenu";
|
|
3
|
+
export declare class ContextMenuState {
|
|
4
|
+
constructor();
|
|
5
|
+
show: boolean;
|
|
6
|
+
items: Components.IMenuItem[];
|
|
7
|
+
position: IPosition | null;
|
|
8
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { observable } from "mobx";
|
|
3
|
-
var ContextMenuState = /** @class */ (function () {
|
|
4
|
-
function ContextMenuState() {
|
|
5
|
-
this.show = false;
|
|
6
|
-
this.items = [];
|
|
7
|
-
this.position = null;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { makeObservable, observable } from "mobx";
|
|
3
|
+
export var ContextMenuState = /** @class */ (function () {
|
|
4
|
+
function ContextMenuState() {
|
|
5
|
+
this.show = false;
|
|
6
|
+
this.items = [];
|
|
7
|
+
this.position = null;
|
|
8
|
+
makeObservable(this);
|
|
9
|
+
}
|
|
10
|
+
__decorate([
|
|
11
|
+
observable.ref,
|
|
12
|
+
__metadata("design:type", Boolean)
|
|
13
|
+
], ContextMenuState.prototype, "show", void 0);
|
|
14
|
+
__decorate([
|
|
15
|
+
observable.ref,
|
|
16
|
+
__metadata("design:type", Array)
|
|
17
|
+
], ContextMenuState.prototype, "items", void 0);
|
|
18
|
+
__decorate([
|
|
19
|
+
observable.ref,
|
|
20
|
+
__metadata("design:type", Object)
|
|
21
|
+
], ContextMenuState.prototype, "position", void 0);
|
|
22
|
+
return ContextMenuState;
|
|
23
|
+
}());
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IBindableEditorProps } from './PropTypes';
|
|
3
|
-
import { Components } from '@singularsystems/neo-core';
|
|
4
|
-
import ComponentBase from './ComponentBase';
|
|
5
|
-
import { FormContext } from './FormContext';
|
|
6
|
-
export interface INeoDatePickerProps extends IBindableEditorProps<HTMLInputElement> {
|
|
7
|
-
dateProps?: Components.IPartialDateProps;
|
|
8
|
-
}
|
|
9
|
-
export default class DatePicker extends ComponentBase<INeoDatePickerProps> {
|
|
10
|
-
static contextType: React.Context<import("./FormContext").FormContextParams>;
|
|
11
|
-
context: React.ContextType<typeof FormContext>;
|
|
12
|
-
private container;
|
|
13
|
-
private datePicker?;
|
|
14
|
-
private isReadOnly;
|
|
15
|
-
constructor(props: INeoDatePickerProps);
|
|
16
|
-
componentDidMount(): void;
|
|
17
|
-
componentWillUnmount(): void;
|
|
18
|
-
render(): JSX.Element;
|
|
19
|
-
}
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IBindableEditorProps } from './PropTypes';
|
|
3
|
+
import { Components } from '@singularsystems/neo-core';
|
|
4
|
+
import ComponentBase from './ComponentBase';
|
|
5
|
+
import { FormContext } from './FormContext';
|
|
6
|
+
export interface INeoDatePickerProps extends IBindableEditorProps<HTMLInputElement> {
|
|
7
|
+
dateProps?: Components.IPartialDateProps;
|
|
8
|
+
}
|
|
9
|
+
export default class DatePicker extends ComponentBase<INeoDatePickerProps> {
|
|
10
|
+
static contextType: React.Context<import("./FormContext").FormContextParams>;
|
|
11
|
+
context: React.ContextType<typeof FormContext>;
|
|
12
|
+
private container;
|
|
13
|
+
private datePicker?;
|
|
14
|
+
private isReadOnly;
|
|
15
|
+
constructor(props: INeoDatePickerProps);
|
|
16
|
+
componentDidMount(): void;
|
|
17
|
+
componentWillUnmount(): void;
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { __assign, __decorate, __extends, __metadata } from "tslib";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { BindPropsHelper } from './PropTypes';
|
|
4
|
-
import { Components, Utils } from '@singularsystems/neo-core';
|
|
5
|
-
import { InputHelpers } from './InputHelpers';
|
|
6
|
-
import { observer } from 'mobx-react';
|
|
7
|
-
import ComponentBase from './ComponentBase';
|
|
8
|
-
import { FormContext } from './FormContext';
|
|
9
|
-
var DatePicker = /** @class */ (function (_super) {
|
|
10
|
-
__extends(DatePicker, _super);
|
|
11
|
-
function DatePicker(props) {
|
|
12
|
-
var _this = _super.call(this, props) || this;
|
|
13
|
-
_this.isReadOnly = false;
|
|
14
|
-
_this.container = React.createRef();
|
|
15
|
-
return _this;
|
|
16
|
-
}
|
|
17
|
-
DatePicker.prototype.componentDidMount = function () {
|
|
18
|
-
if (this.container.current) {
|
|
19
|
-
this.datePicker = new Components.DatePicker(this.container.current, this.props.dateProps);
|
|
20
|
-
this.datePicker.update(this.props.dateProps, this.props.bind, this.isReadOnly);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
DatePicker.prototype.componentWillUnmount = function () {
|
|
24
|
-
if (this.datePicker) {
|
|
25
|
-
this.datePicker.destroy();
|
|
26
|
-
this.datePicker = undefined;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
DatePicker.prototype.render = function () {
|
|
30
|
-
var splitProps = BindPropsHelper.normaliseEditorProps(this, this.props);
|
|
31
|
-
var domProps = BindPropsHelper.autoSetDomProperties(splitProps, this.context);
|
|
32
|
-
domProps.className = Utils.joinWithSpaces(domProps.className, splitProps.isBootstrap ? "form-control" : "neo-forms-editor");
|
|
33
|
-
this.isReadOnly = !!domProps.readOnly;
|
|
34
|
-
var displayInfo = this.props.bind.validator.getDisplayState(this.context.validationDisplayMode);
|
|
35
|
-
displayInfo.applyToDom(domProps, !splitProps.inGroup);
|
|
36
|
-
if (this.datePicker) {
|
|
37
|
-
this.datePicker.update(splitProps.dateProps, this.props.bind, this.isReadOnly);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
// Create dependency on bound value on initial render.
|
|
41
|
-
void this.props.bind.value;
|
|
42
|
-
}
|
|
43
|
-
return (React.createElement("div", { className: "neo-datepicker-container", ref: this.container }, !(splitProps.dateProps && splitProps.dateProps.alwaysShow) &&
|
|
44
|
-
InputHelpers.surroundWithInputGroup(React.createElement("input", __assign({ type: "text" }, domProps, { ref: splitProps.editor.inputElement })), splitProps.editor)));
|
|
45
|
-
};
|
|
46
|
-
DatePicker.contextType = FormContext;
|
|
47
|
-
DatePicker = __decorate([
|
|
48
|
-
observer,
|
|
49
|
-
__metadata("design:paramtypes", [Object])
|
|
50
|
-
], DatePicker);
|
|
51
|
-
return DatePicker;
|
|
52
|
-
}(ComponentBase));
|
|
53
|
-
export default DatePicker;
|
|
1
|
+
import { __assign, __decorate, __extends, __metadata } from "tslib";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { BindPropsHelper } from './PropTypes';
|
|
4
|
+
import { Components, Utils } from '@singularsystems/neo-core';
|
|
5
|
+
import { InputHelpers } from './InputHelpers';
|
|
6
|
+
import { observer } from 'mobx-react';
|
|
7
|
+
import ComponentBase from './ComponentBase';
|
|
8
|
+
import { FormContext } from './FormContext';
|
|
9
|
+
var DatePicker = /** @class */ (function (_super) {
|
|
10
|
+
__extends(DatePicker, _super);
|
|
11
|
+
function DatePicker(props) {
|
|
12
|
+
var _this = _super.call(this, props) || this;
|
|
13
|
+
_this.isReadOnly = false;
|
|
14
|
+
_this.container = React.createRef();
|
|
15
|
+
return _this;
|
|
16
|
+
}
|
|
17
|
+
DatePicker.prototype.componentDidMount = function () {
|
|
18
|
+
if (this.container.current) {
|
|
19
|
+
this.datePicker = new Components.DatePicker(this.container.current, this.props.dateProps);
|
|
20
|
+
this.datePicker.update(this.props.dateProps, this.props.bind, this.isReadOnly);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
DatePicker.prototype.componentWillUnmount = function () {
|
|
24
|
+
if (this.datePicker) {
|
|
25
|
+
this.datePicker.destroy();
|
|
26
|
+
this.datePicker = undefined;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
DatePicker.prototype.render = function () {
|
|
30
|
+
var splitProps = BindPropsHelper.normaliseEditorProps(this, this.props);
|
|
31
|
+
var domProps = BindPropsHelper.autoSetDomProperties(splitProps, this.context);
|
|
32
|
+
domProps.className = Utils.joinWithSpaces(domProps.className, splitProps.isBootstrap ? "form-control" : "neo-forms-editor");
|
|
33
|
+
this.isReadOnly = !!domProps.readOnly;
|
|
34
|
+
var displayInfo = this.props.bind.validator.getDisplayState(this.context.validationDisplayMode);
|
|
35
|
+
displayInfo.applyToDom(domProps, !splitProps.inGroup);
|
|
36
|
+
if (this.datePicker) {
|
|
37
|
+
this.datePicker.update(splitProps.dateProps, this.props.bind, this.isReadOnly);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Create dependency on bound value on initial render.
|
|
41
|
+
void this.props.bind.value;
|
|
42
|
+
}
|
|
43
|
+
return (React.createElement("div", { className: "neo-datepicker-container", ref: this.container }, !(splitProps.dateProps && splitProps.dateProps.alwaysShow) &&
|
|
44
|
+
InputHelpers.surroundWithInputGroup(React.createElement("input", __assign({ type: "text" }, domProps, { ref: splitProps.editor.inputElement })), splitProps.editor)));
|
|
45
|
+
};
|
|
46
|
+
DatePicker.contextType = FormContext;
|
|
47
|
+
DatePicker = __decorate([
|
|
48
|
+
observer,
|
|
49
|
+
__metadata("design:paramtypes", [Object])
|
|
50
|
+
], DatePicker);
|
|
51
|
+
return DatePicker;
|
|
52
|
+
}(ComponentBase));
|
|
53
|
+
export default DatePicker;
|
|
@@ -1,83 +1,93 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Model } from '@singularsystems/neo-core';
|
|
3
|
-
import { AxiosPromise } from 'axios';
|
|
4
|
-
import { DropDownBase, ItemSource } from './DropDownBase';
|
|
5
|
-
import { Props } from 'react-select';
|
|
6
|
-
import { ICommonEditorProps } from '../PropTypes';
|
|
7
|
-
import { FormContext } from '../FormContext';
|
|
8
|
-
interface IOption {
|
|
9
|
-
value: string | number;
|
|
10
|
-
label: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
*
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
private
|
|
82
|
-
|
|
83
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Model } from '@singularsystems/neo-core';
|
|
3
|
+
import { AxiosPromise } from 'axios';
|
|
4
|
+
import { DropDownBase, ItemSource } from './DropDownBase';
|
|
5
|
+
import { Props } from 'react-select';
|
|
6
|
+
import { ICommonEditorProps } from '../PropTypes';
|
|
7
|
+
import { FormContext } from '../FormContext';
|
|
8
|
+
interface IOption {
|
|
9
|
+
value: string | number;
|
|
10
|
+
label: string;
|
|
11
|
+
item?: any;
|
|
12
|
+
}
|
|
13
|
+
interface IAutoCompleteCommonProps<T> extends ICommonEditorProps, Props<IOption, true> {
|
|
14
|
+
/**
|
|
15
|
+
* Callback for loading data.
|
|
16
|
+
*/
|
|
17
|
+
itemSource?: (searchValue: string) => (Promise<T[]> | AxiosPromise<T[]>);
|
|
18
|
+
/**
|
|
19
|
+
* Items to display for non async drop down, or default items to display in async drop down before typing.
|
|
20
|
+
*/
|
|
21
|
+
items?: ItemSource<T>;
|
|
22
|
+
valueMember?: keyof T;
|
|
23
|
+
displayMember?: keyof T;
|
|
24
|
+
/**
|
|
25
|
+
* Property of an item to use as the description.
|
|
26
|
+
*
|
|
27
|
+
* Description will be shown in muted text below the item name.
|
|
28
|
+
*/
|
|
29
|
+
descriptionMember?: keyof T | false;
|
|
30
|
+
/**
|
|
31
|
+
* Callback used to provide a custom option component instead of displaying the display member value.
|
|
32
|
+
*/
|
|
33
|
+
option?: (item: T) => JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Text to display when the user has typed something, but no records were returned.
|
|
36
|
+
*/
|
|
37
|
+
noRecordsPrompt?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Text to display when the user clicks in the text area, and no search value has been entered.
|
|
40
|
+
*/
|
|
41
|
+
typeToSearchPrompt?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Callback which fires when an item is selected.
|
|
44
|
+
* The removedItem parameter will be provided when removing an item from a multi select drop down.
|
|
45
|
+
*/
|
|
46
|
+
onItemSelected?: (item?: T, removedItem?: Model.ISelectedItem) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Millisecond delay from the last typed character, to when the itemSource function is called.
|
|
49
|
+
* Default is 500ms.
|
|
50
|
+
*/
|
|
51
|
+
delayMs?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Minimum no of characters a user must type before a search is performed.
|
|
54
|
+
* Default is 1.
|
|
55
|
+
*/
|
|
56
|
+
minCharacters?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface IAutoCompleteProps {
|
|
59
|
+
bind: Model.IPropertyInstance;
|
|
60
|
+
bindDisplay?: Model.IPropertyInstance;
|
|
61
|
+
}
|
|
62
|
+
export interface IAutoCompleteMultiSelectProps {
|
|
63
|
+
/**
|
|
64
|
+
* A list of ids and labels to use as the selected list.
|
|
65
|
+
*/
|
|
66
|
+
bindItems: Model.IPropertyInstance<Model.ISelectedItem[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Optional list of ids. This will be kept in sync with the bindItems prop.
|
|
69
|
+
*/
|
|
70
|
+
bindIds?: (string | number)[] | Model.IPropertyInstance<number[]>;
|
|
71
|
+
/**
|
|
72
|
+
* The max no of items to record in the field info if bound to a field info class. (Defaults to 5)
|
|
73
|
+
* If the selected items exceeds this limit, the field info will be recorded as "x items selected".
|
|
74
|
+
*/
|
|
75
|
+
fieldInfoLimit?: number;
|
|
76
|
+
}
|
|
77
|
+
export default class AutoCompleteDropDown<T> extends DropDownBase<T, IAutoCompleteCommonProps<T> & (IAutoCompleteProps | IAutoCompleteMultiSelectProps)> {
|
|
78
|
+
static contextType: React.Context<import("../FormContext").FormContextParams>;
|
|
79
|
+
context: React.ContextType<typeof FormContext>;
|
|
80
|
+
private asyncSelectImplementation;
|
|
81
|
+
private selectImplementation;
|
|
82
|
+
constructor(props: IAutoCompleteCommonProps<T> & (IAutoCompleteProps | IAutoCompleteMultiSelectProps));
|
|
83
|
+
private bindProperty;
|
|
84
|
+
private bindIdsList?;
|
|
85
|
+
private bindIdsProperty?;
|
|
86
|
+
static getBindProp<T>(props: IAutoCompleteProps | IAutoCompleteMultiSelectProps): Model.IPropertyInstance<any>;
|
|
87
|
+
private onKeyPress;
|
|
88
|
+
private mapTArrayToOptions;
|
|
89
|
+
private onItemSelected;
|
|
90
|
+
render(): JSX.Element;
|
|
91
|
+
private getOption;
|
|
92
|
+
}
|
|
93
|
+
export {};
|