@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,84 +1,83 @@
|
|
|
1
|
-
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { BindPropsHelper, CheckboxType } from '../PropTypes';
|
|
5
|
-
import { Validation, Utils } from '@singularsystems/neo-core';
|
|
6
|
-
import ComponentBase from '../ComponentBase';
|
|
7
|
-
import { EditorParentType, FormContext } from '../FormContext';
|
|
8
|
-
var FormGroupBase = /** @class */ (function (_super) {
|
|
9
|
-
__extends(FormGroupBase, _super);
|
|
10
|
-
function FormGroupBase() {
|
|
11
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
12
|
-
}
|
|
13
|
-
FormGroupBase.prototype.getFormGroupClasses = function (domProps, isCheckBox) {
|
|
14
|
-
return { containerDom: domProps, container: "form-group", label: "", editor: "" };
|
|
15
|
-
};
|
|
16
|
-
FormGroupBase.prototype.hideLabelForCheckboxes = function () {
|
|
17
|
-
return true;
|
|
18
|
-
};
|
|
19
|
-
FormGroupBase.prototype.render = function () {
|
|
20
|
-
var _a;
|
|
21
|
-
var allProps = BindPropsHelper.normaliseContainerProps(this, this.props, true);
|
|
22
|
-
var containerProps = allProps.container;
|
|
23
|
-
var _b = allProps.containerDom, labelProps = _b.labelProps, suppressLabel = _b.suppressLabel, footerText = _b.footerText, rightLabel = _b.rightLabel, domProps = __rest(_b, ["labelProps", "suppressLabel", "footerText", "rightLabel"]);
|
|
24
|
-
var checkBoxType = BindPropsHelper.getCheckBoxType(allProps);
|
|
25
|
-
// Get the classes for the container, label and editor. InlineForm overrides this.
|
|
26
|
-
var classes = this.getFormGroupClasses(domProps, checkBoxType !== CheckboxType.None);
|
|
27
|
-
var labelText = containerProps.label ? containerProps.label : allProps.bind.propertyInfo.readableName;
|
|
28
|
-
var displayInfo = allProps.bind.validator.getDisplayState(allProps.fileProps ? Validation.DisplayMode.Always : this.context.validationDisplayMode);
|
|
29
|
-
var showValidation = displayInfo.severity != Validation.RuleSeverity.None;
|
|
30
|
-
var className = Utils.joinWithSpaces(classes.containerDom.className, classes.container);
|
|
31
|
-
var labelClassName = Utils.joinWithSpaces(labelProps && labelProps.className, classes.label);
|
|
32
|
-
if (checkBoxType !== CheckboxType.None) {
|
|
33
|
-
if (!allProps.input) {
|
|
34
|
-
allProps.input = {};
|
|
35
|
-
}
|
|
36
|
-
if (this.hideLabelForCheckboxes()) {
|
|
37
|
-
// Hide this label here, and pass label text to child input component.
|
|
38
|
-
if (!suppressLabel && allProps.input.label === undefined) {
|
|
39
|
-
allProps.input.label = labelText;
|
|
40
|
-
}
|
|
41
|
-
suppressLabel = true;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
var label;
|
|
45
|
-
if (!((_a = this.context.suppressLabels) !== null && _a !== void 0 ? _a : suppressLabel)) {
|
|
46
|
-
label = React.createElement("label", __assign({}, labelProps, { htmlFor: allProps.uniqueID, className: labelClassName }),
|
|
47
|
-
labelText,
|
|
48
|
-
" ");
|
|
49
|
-
if (rightLabel) {
|
|
50
|
-
label = React.createElement("div", { className: "form-group-label" },
|
|
51
|
-
label,
|
|
52
|
-
rightLabel);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
var editor = containerProps.suppressDefaultContent ? undefined : BindPropsHelper.getFormControl(allProps);
|
|
56
|
-
return (React.createElement("div", __assign({}, classes.containerDom, { className: className }),
|
|
57
|
-
label,
|
|
58
|
-
React.createElement("div", { className: classes.editor },
|
|
59
|
-
!containerProps.suppressDefaultContent && editor,
|
|
60
|
-
!containerProps.bindContext && this.props.children,
|
|
61
|
-
containerProps.bindContext &&
|
|
62
|
-
React.createElement(FormContext.Provider, { value: __assign(__assign({}, this.context), { parentType: EditorParentType.FormGroup, bindProperty: containerProps.bindContext, uniqueId: allProps.uniqueID }) }, this.props.children),
|
|
63
|
-
showValidation &&
|
|
64
|
-
React.createElement("div", { className: "invalid-feedback " + displayInfo.additionalClassName, style: { display: "block" } },
|
|
65
|
-
displayInfo.severity == Validation.RuleSeverity.AsyncBusy && React.createElement("span", { className: "spinner-grow" }),
|
|
66
|
-
React.createElement("span", null, displayInfo.displayText)),
|
|
67
|
-
!showValidation && footerText &&
|
|
68
|
-
React.createElement("small", { className: "form-text text-muted" }, footerText))));
|
|
69
|
-
};
|
|
70
|
-
FormGroupBase.contextType = FormContext;
|
|
71
|
-
return FormGroupBase;
|
|
72
|
-
}(ComponentBase));
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export default FormGroup;
|
|
1
|
+
import { __assign, __decorate, __extends, __rest } from "tslib";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import { BindPropsHelper, CheckboxType } from '../PropTypes';
|
|
5
|
+
import { Validation, Utils } from '@singularsystems/neo-core';
|
|
6
|
+
import ComponentBase from '../ComponentBase';
|
|
7
|
+
import { EditorParentType, FormContext } from '../FormContext';
|
|
8
|
+
export var FormGroupBase = /** @class */ (function (_super) {
|
|
9
|
+
__extends(FormGroupBase, _super);
|
|
10
|
+
function FormGroupBase() {
|
|
11
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
12
|
+
}
|
|
13
|
+
FormGroupBase.prototype.getFormGroupClasses = function (domProps, isCheckBox) {
|
|
14
|
+
return { containerDom: domProps, container: "form-group", label: "", editor: "" };
|
|
15
|
+
};
|
|
16
|
+
FormGroupBase.prototype.hideLabelForCheckboxes = function () {
|
|
17
|
+
return true;
|
|
18
|
+
};
|
|
19
|
+
FormGroupBase.prototype.render = function () {
|
|
20
|
+
var _a;
|
|
21
|
+
var allProps = BindPropsHelper.normaliseContainerProps(this, this.props, true);
|
|
22
|
+
var containerProps = allProps.container;
|
|
23
|
+
var _b = allProps.containerDom, labelProps = _b.labelProps, suppressLabel = _b.suppressLabel, footerText = _b.footerText, rightLabel = _b.rightLabel, domProps = __rest(_b, ["labelProps", "suppressLabel", "footerText", "rightLabel"]);
|
|
24
|
+
var checkBoxType = BindPropsHelper.getCheckBoxType(allProps);
|
|
25
|
+
// Get the classes for the container, label and editor. InlineForm overrides this.
|
|
26
|
+
var classes = this.getFormGroupClasses(domProps, checkBoxType !== CheckboxType.None);
|
|
27
|
+
var labelText = containerProps.label ? containerProps.label : allProps.bind.propertyInfo.readableName;
|
|
28
|
+
var displayInfo = allProps.bind.validator.getDisplayState(allProps.fileProps ? Validation.DisplayMode.Always : this.context.validationDisplayMode);
|
|
29
|
+
var showValidation = displayInfo.severity != Validation.RuleSeverity.None;
|
|
30
|
+
var className = Utils.joinWithSpaces(classes.containerDom.className, classes.container);
|
|
31
|
+
var labelClassName = Utils.joinWithSpaces(labelProps && labelProps.className, classes.label);
|
|
32
|
+
if (checkBoxType !== CheckboxType.None) {
|
|
33
|
+
if (!allProps.input) {
|
|
34
|
+
allProps.input = {};
|
|
35
|
+
}
|
|
36
|
+
if (this.hideLabelForCheckboxes()) {
|
|
37
|
+
// Hide this label here, and pass label text to child input component.
|
|
38
|
+
if (!suppressLabel && allProps.input.label === undefined) {
|
|
39
|
+
allProps.input.label = labelText;
|
|
40
|
+
}
|
|
41
|
+
suppressLabel = true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
var label;
|
|
45
|
+
if (!((_a = this.context.suppressLabels) !== null && _a !== void 0 ? _a : suppressLabel)) {
|
|
46
|
+
label = React.createElement("label", __assign({}, labelProps, { htmlFor: allProps.uniqueID, className: labelClassName }),
|
|
47
|
+
labelText,
|
|
48
|
+
" ");
|
|
49
|
+
if (rightLabel) {
|
|
50
|
+
label = React.createElement("div", { className: "form-group-label" },
|
|
51
|
+
label,
|
|
52
|
+
rightLabel);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
var editor = containerProps.suppressDefaultContent ? undefined : BindPropsHelper.getFormControl(allProps);
|
|
56
|
+
return (React.createElement("div", __assign({}, classes.containerDom, { className: className }),
|
|
57
|
+
label,
|
|
58
|
+
React.createElement("div", { className: classes.editor },
|
|
59
|
+
!containerProps.suppressDefaultContent && editor,
|
|
60
|
+
!containerProps.bindContext && this.props.children,
|
|
61
|
+
containerProps.bindContext &&
|
|
62
|
+
React.createElement(FormContext.Provider, { value: __assign(__assign({}, this.context), { parentType: EditorParentType.FormGroup, bindProperty: containerProps.bindContext, uniqueId: allProps.uniqueID }) }, this.props.children),
|
|
63
|
+
showValidation &&
|
|
64
|
+
React.createElement("div", { className: "invalid-feedback " + displayInfo.additionalClassName, style: { display: "block" } },
|
|
65
|
+
displayInfo.severity == Validation.RuleSeverity.AsyncBusy && React.createElement("span", { className: "spinner-grow" }),
|
|
66
|
+
React.createElement("span", null, displayInfo.displayText)),
|
|
67
|
+
!showValidation && footerText &&
|
|
68
|
+
React.createElement("small", { className: "form-text text-muted" }, footerText))));
|
|
69
|
+
};
|
|
70
|
+
FormGroupBase.contextType = FormContext;
|
|
71
|
+
return FormGroupBase;
|
|
72
|
+
}(ComponentBase));
|
|
73
|
+
var FormGroup = /** @class */ (function (_super) {
|
|
74
|
+
__extends(FormGroup, _super);
|
|
75
|
+
function FormGroup() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
FormGroup = __decorate([
|
|
79
|
+
observer
|
|
80
|
+
], FormGroup);
|
|
81
|
+
return FormGroup;
|
|
82
|
+
}(FormGroupBase));
|
|
83
|
+
export default FormGroup;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormContext } from '../FormContext';
|
|
3
|
-
import { IEditorContainerProps } from '../PropTypes';
|
|
4
|
-
import ComponentBase from '../ComponentBase';
|
|
5
|
-
export default class FloatingFormGroup<TData> extends ComponentBase<IEditorContainerProps<HTMLDivElement, TData>> {
|
|
6
|
-
static contextType: React.Context<import("../FormContext").FormContextParams>;
|
|
7
|
-
context: React.ContextType<typeof FormContext>;
|
|
8
|
-
private originalOnFocus?;
|
|
9
|
-
private originalOnBlur?;
|
|
10
|
-
private isFocused;
|
|
11
|
-
private placeholder?;
|
|
12
|
-
constructor(props: IEditorContainerProps<HTMLDivElement, TData>);
|
|
13
|
-
private containerRef;
|
|
14
|
-
private editorRef;
|
|
15
|
-
private onFocus;
|
|
16
|
-
private onBlur;
|
|
17
|
-
private labelClick;
|
|
18
|
-
render(): JSX.Element;
|
|
19
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormContext } from '../FormContext';
|
|
3
|
+
import { IEditorContainerProps } from '../PropTypes';
|
|
4
|
+
import ComponentBase from '../ComponentBase';
|
|
5
|
+
export default class FloatingFormGroup<TData> extends ComponentBase<IEditorContainerProps<HTMLDivElement, TData>> {
|
|
6
|
+
static contextType: React.Context<import("../FormContext").FormContextParams>;
|
|
7
|
+
context: React.ContextType<typeof FormContext>;
|
|
8
|
+
private originalOnFocus?;
|
|
9
|
+
private originalOnBlur?;
|
|
10
|
+
private isFocused;
|
|
11
|
+
private placeholder?;
|
|
12
|
+
constructor(props: IEditorContainerProps<HTMLDivElement, TData>);
|
|
13
|
+
private containerRef;
|
|
14
|
+
private editorRef;
|
|
15
|
+
private onFocus;
|
|
16
|
+
private onBlur;
|
|
17
|
+
private labelClick;
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { __assign, __decorate, __extends, __metadata } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { FormContext } from '../FormContext';
|
|
5
|
-
import { BindPropsHelper, CheckboxType } from '../PropTypes';
|
|
6
|
-
import { Validation, Utils } from '@singularsystems/neo-core';
|
|
7
|
-
import ComponentBase from '../ComponentBase';
|
|
8
|
-
var FloatingFormGroup = /** @class */ (function (_super) {
|
|
9
|
-
__extends(FloatingFormGroup, _super);
|
|
10
|
-
function FloatingFormGroup(props) {
|
|
11
|
-
var _this = _super.call(this, props) || this;
|
|
12
|
-
_this.isFocused = false;
|
|
13
|
-
_this.containerRef = React.createRef();
|
|
14
|
-
_this.editorRef = React.createRef();
|
|
15
|
-
_this.onFocus = _this.onFocus.bind(_this);
|
|
16
|
-
_this.onBlur = _this.onBlur.bind(_this);
|
|
17
|
-
_this.labelClick = _this.labelClick.bind(_this);
|
|
18
|
-
return _this;
|
|
19
|
-
}
|
|
20
|
-
FloatingFormGroup.prototype.onFocus = function (e) {
|
|
21
|
-
if (this.containerRef.current) {
|
|
22
|
-
this.containerRef.current.classList.add("focused");
|
|
23
|
-
}
|
|
24
|
-
if (this.originalOnFocus) {
|
|
25
|
-
this.originalOnFocus(e);
|
|
26
|
-
}
|
|
27
|
-
if (this.placeholder && this.editorRef.current) {
|
|
28
|
-
this.editorRef.current.placeholder = this.placeholder;
|
|
29
|
-
}
|
|
30
|
-
this.isFocused = true;
|
|
31
|
-
};
|
|
32
|
-
FloatingFormGroup.prototype.onBlur = function (e) {
|
|
33
|
-
if (this.containerRef.current) {
|
|
34
|
-
this.containerRef.current.classList.remove("focused");
|
|
35
|
-
}
|
|
36
|
-
if (this.originalOnBlur) {
|
|
37
|
-
this.originalOnBlur(e);
|
|
38
|
-
}
|
|
39
|
-
if (this.editorRef.current) {
|
|
40
|
-
this.editorRef.current.placeholder = "";
|
|
41
|
-
}
|
|
42
|
-
this.isFocused = false;
|
|
43
|
-
};
|
|
44
|
-
FloatingFormGroup.prototype.labelClick = function (e) {
|
|
45
|
-
e.preventDefault();
|
|
46
|
-
if (this.editorRef.current) {
|
|
47
|
-
this.editorRef.current.focus();
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
FloatingFormGroup.prototype.render = function () {
|
|
51
|
-
var allProps = BindPropsHelper.normaliseContainerProps(this, this.props, true, false);
|
|
52
|
-
var containerProps = allProps.container;
|
|
53
|
-
var labelText = containerProps.label ? containerProps.label : allProps.bind.propertyInfo.readableName;
|
|
54
|
-
var displayInfo = allProps.bind.validator.getDisplayState(this.context.validationDisplayMode);
|
|
55
|
-
var showValidation = displayInfo.severity != Validation.RuleSeverity.None;
|
|
56
|
-
if (!allProps.editorDom) {
|
|
57
|
-
allProps.editorDom = {};
|
|
58
|
-
}
|
|
59
|
-
;
|
|
60
|
-
this.originalOnFocus = allProps.editorDom.onFocus;
|
|
61
|
-
this.originalOnBlur = allProps.editorDom.onBlur;
|
|
62
|
-
allProps.editorDom.onFocus = this.onFocus;
|
|
63
|
-
allProps.editorDom.onBlur = this.onBlur;
|
|
64
|
-
allProps.editor.inputElement = this.editorRef;
|
|
65
|
-
this.placeholder = BindPropsHelper.getPlaceholderText(allProps.editor.placeholder, allProps.bind.propertyInfo);
|
|
66
|
-
allProps.editor.placeholder = "";
|
|
67
|
-
if (BindPropsHelper.getCheckBoxType(allProps) !== CheckboxType.None) {
|
|
68
|
-
throw Error("FormGroupFloating does not support checkboxes, use FormGroup.");
|
|
69
|
-
}
|
|
70
|
-
var editor = BindPropsHelper.getFormControl(allProps);
|
|
71
|
-
allProps.containerDom.className = Utils.joinWithSpaces(allProps.containerDom.className, "neo-form-group-floating");
|
|
72
|
-
if (allProps.bind.value) {
|
|
73
|
-
allProps.containerDom.className += " has-value";
|
|
74
|
-
}
|
|
75
|
-
if (showValidation) {
|
|
76
|
-
allProps.containerDom.className += " " + displayInfo.additionalClassName;
|
|
77
|
-
}
|
|
78
|
-
if (this.isFocused) {
|
|
79
|
-
allProps.containerDom.className += " focused";
|
|
80
|
-
}
|
|
81
|
-
return (React.createElement("div", __assign({}, allProps.containerDom, { ref: this.containerRef }),
|
|
82
|
-
React.createElement("div", null,
|
|
83
|
-
React.createElement("label", { htmlFor: allProps.uniqueID, className: "neo-floating-label", onMouseDown: this.labelClick }, labelText),
|
|
84
|
-
editor),
|
|
85
|
-
showValidation &&
|
|
86
|
-
React.createElement("div", { className: "invalid-feedback " + displayInfo.additionalClassName, style: { display: "block" } },
|
|
87
|
-
displayInfo.severity == Validation.RuleSeverity.AsyncBusy && React.createElement("span", { className: "spinner-grow" }),
|
|
88
|
-
React.createElement("span", null, displayInfo.displayText))));
|
|
89
|
-
};
|
|
90
|
-
FloatingFormGroup.contextType = FormContext;
|
|
91
|
-
FloatingFormGroup = __decorate([
|
|
92
|
-
observer,
|
|
93
|
-
__metadata("design:paramtypes", [Object])
|
|
94
|
-
], FloatingFormGroup);
|
|
95
|
-
return FloatingFormGroup;
|
|
96
|
-
}(ComponentBase));
|
|
97
|
-
export default FloatingFormGroup;
|
|
1
|
+
import { __assign, __decorate, __extends, __metadata } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import { FormContext } from '../FormContext';
|
|
5
|
+
import { BindPropsHelper, CheckboxType } from '../PropTypes';
|
|
6
|
+
import { Validation, Utils } from '@singularsystems/neo-core';
|
|
7
|
+
import ComponentBase from '../ComponentBase';
|
|
8
|
+
var FloatingFormGroup = /** @class */ (function (_super) {
|
|
9
|
+
__extends(FloatingFormGroup, _super);
|
|
10
|
+
function FloatingFormGroup(props) {
|
|
11
|
+
var _this = _super.call(this, props) || this;
|
|
12
|
+
_this.isFocused = false;
|
|
13
|
+
_this.containerRef = React.createRef();
|
|
14
|
+
_this.editorRef = React.createRef();
|
|
15
|
+
_this.onFocus = _this.onFocus.bind(_this);
|
|
16
|
+
_this.onBlur = _this.onBlur.bind(_this);
|
|
17
|
+
_this.labelClick = _this.labelClick.bind(_this);
|
|
18
|
+
return _this;
|
|
19
|
+
}
|
|
20
|
+
FloatingFormGroup.prototype.onFocus = function (e) {
|
|
21
|
+
if (this.containerRef.current) {
|
|
22
|
+
this.containerRef.current.classList.add("focused");
|
|
23
|
+
}
|
|
24
|
+
if (this.originalOnFocus) {
|
|
25
|
+
this.originalOnFocus(e);
|
|
26
|
+
}
|
|
27
|
+
if (this.placeholder && this.editorRef.current) {
|
|
28
|
+
this.editorRef.current.placeholder = this.placeholder;
|
|
29
|
+
}
|
|
30
|
+
this.isFocused = true;
|
|
31
|
+
};
|
|
32
|
+
FloatingFormGroup.prototype.onBlur = function (e) {
|
|
33
|
+
if (this.containerRef.current) {
|
|
34
|
+
this.containerRef.current.classList.remove("focused");
|
|
35
|
+
}
|
|
36
|
+
if (this.originalOnBlur) {
|
|
37
|
+
this.originalOnBlur(e);
|
|
38
|
+
}
|
|
39
|
+
if (this.editorRef.current) {
|
|
40
|
+
this.editorRef.current.placeholder = "";
|
|
41
|
+
}
|
|
42
|
+
this.isFocused = false;
|
|
43
|
+
};
|
|
44
|
+
FloatingFormGroup.prototype.labelClick = function (e) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
if (this.editorRef.current) {
|
|
47
|
+
this.editorRef.current.focus();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
FloatingFormGroup.prototype.render = function () {
|
|
51
|
+
var allProps = BindPropsHelper.normaliseContainerProps(this, this.props, true, false);
|
|
52
|
+
var containerProps = allProps.container;
|
|
53
|
+
var labelText = containerProps.label ? containerProps.label : allProps.bind.propertyInfo.readableName;
|
|
54
|
+
var displayInfo = allProps.bind.validator.getDisplayState(this.context.validationDisplayMode);
|
|
55
|
+
var showValidation = displayInfo.severity != Validation.RuleSeverity.None;
|
|
56
|
+
if (!allProps.editorDom) {
|
|
57
|
+
allProps.editorDom = {};
|
|
58
|
+
}
|
|
59
|
+
;
|
|
60
|
+
this.originalOnFocus = allProps.editorDom.onFocus;
|
|
61
|
+
this.originalOnBlur = allProps.editorDom.onBlur;
|
|
62
|
+
allProps.editorDom.onFocus = this.onFocus;
|
|
63
|
+
allProps.editorDom.onBlur = this.onBlur;
|
|
64
|
+
allProps.editor.inputElement = this.editorRef;
|
|
65
|
+
this.placeholder = BindPropsHelper.getPlaceholderText(allProps.editor.placeholder, allProps.bind.propertyInfo);
|
|
66
|
+
allProps.editor.placeholder = "";
|
|
67
|
+
if (BindPropsHelper.getCheckBoxType(allProps) !== CheckboxType.None) {
|
|
68
|
+
throw Error("FormGroupFloating does not support checkboxes, use FormGroup.");
|
|
69
|
+
}
|
|
70
|
+
var editor = BindPropsHelper.getFormControl(allProps);
|
|
71
|
+
allProps.containerDom.className = Utils.joinWithSpaces(allProps.containerDom.className, "neo-form-group-floating");
|
|
72
|
+
if (allProps.bind.value) {
|
|
73
|
+
allProps.containerDom.className += " has-value";
|
|
74
|
+
}
|
|
75
|
+
if (showValidation) {
|
|
76
|
+
allProps.containerDom.className += " " + displayInfo.additionalClassName;
|
|
77
|
+
}
|
|
78
|
+
if (this.isFocused) {
|
|
79
|
+
allProps.containerDom.className += " focused";
|
|
80
|
+
}
|
|
81
|
+
return (React.createElement("div", __assign({}, allProps.containerDom, { ref: this.containerRef }),
|
|
82
|
+
React.createElement("div", null,
|
|
83
|
+
React.createElement("label", { htmlFor: allProps.uniqueID, className: "neo-floating-label", onMouseDown: this.labelClick }, labelText),
|
|
84
|
+
editor),
|
|
85
|
+
showValidation &&
|
|
86
|
+
React.createElement("div", { className: "invalid-feedback " + displayInfo.additionalClassName, style: { display: "block" } },
|
|
87
|
+
displayInfo.severity == Validation.RuleSeverity.AsyncBusy && React.createElement("span", { className: "spinner-grow" }),
|
|
88
|
+
React.createElement("span", null, displayInfo.displayText))));
|
|
89
|
+
};
|
|
90
|
+
FloatingFormGroup.contextType = FormContext;
|
|
91
|
+
FloatingFormGroup = __decorate([
|
|
92
|
+
observer,
|
|
93
|
+
__metadata("design:paramtypes", [Object])
|
|
94
|
+
], FloatingFormGroup);
|
|
95
|
+
return FloatingFormGroup;
|
|
96
|
+
}(ComponentBase));
|
|
97
|
+
export default FloatingFormGroup;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormGroupBase, IFormGroupProps, IFormGroupClasses } from './FormGroup';
|
|
3
|
-
import { Components } from '@singularsystems/neo-core';
|
|
4
|
-
|
|
5
|
-
export default class FormGroupInline<TData> extends FormGroupBase<IInlineFormGroupProps<TData>, TData> {
|
|
6
|
-
private contextProps?;
|
|
7
|
-
protected hideLabelForCheckboxes(): boolean;
|
|
8
|
-
protected getFormGroupClasses(domProps: React.HTMLProps<HTMLDivElement>, isCheckBox: boolean): IFormGroupClasses;
|
|
9
|
-
render(): JSX.Element;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormGroupBase, IFormGroupProps, IFormGroupClasses } from './FormGroup';
|
|
3
|
+
import { Components } from '@singularsystems/neo-core';
|
|
4
|
+
type IInlineFormGroupProps<TData> = IFormGroupProps<TData> & Components.IColumnWidthBreakpoints;
|
|
5
|
+
export default class FormGroupInline<TData> extends FormGroupBase<IInlineFormGroupProps<TData>, TData> {
|
|
6
|
+
private contextProps?;
|
|
7
|
+
protected hideLabelForCheckboxes(): boolean;
|
|
8
|
+
protected getFormGroupClasses(domProps: React.HTMLProps<HTMLDivElement>, isCheckBox: boolean): IFormGroupClasses;
|
|
9
|
+
render(): JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { __extends, __rest } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { FormGroupBase } from './FormGroup';
|
|
4
|
-
import { Observer } from 'mobx-react';
|
|
5
|
-
import { FormGroupLayoutContext } from '../GridLayout';
|
|
6
|
-
import { Components, Utils } from '@singularsystems/neo-core';
|
|
7
|
-
var FormGroupInline = /** @class */ (function (_super) {
|
|
8
|
-
__extends(FormGroupInline, _super);
|
|
9
|
-
function FormGroupInline() {
|
|
10
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
11
|
-
}
|
|
12
|
-
FormGroupInline.prototype.hideLabelForCheckboxes = function () {
|
|
13
|
-
return false;
|
|
14
|
-
};
|
|
15
|
-
FormGroupInline.prototype.getFormGroupClasses = function (domProps, isCheckBox) {
|
|
16
|
-
var classes = _super.prototype.getFormGroupClasses.call(this, domProps, isCheckBox);
|
|
17
|
-
var _a = classes.containerDom, xs = _a.xs, sm = _a.sm, md = _a.md, lg = _a.lg, xl = _a.xl, xxl = _a.xxl, containerDom = __rest(_a, ["xs", "sm", "md", "lg", "xl", "xxl"]);
|
|
18
|
-
classes.container += " row";
|
|
19
|
-
var colClasses = Components.BootstrapHelpers.getInverseBreakpointClasses(classes.containerDom);
|
|
20
|
-
if (!colClasses.cols) {
|
|
21
|
-
// No sizes were specified, check if there is a layout context
|
|
22
|
-
if (this.contextProps) {
|
|
23
|
-
colClasses = Components.BootstrapHelpers.getInverseBreakpointClasses(this.contextProps);
|
|
24
|
-
}
|
|
25
|
-
if (!colClasses.cols) {
|
|
26
|
-
// If there are still no sizes, default to below.
|
|
27
|
-
classes.label = "col-4";
|
|
28
|
-
classes.editor = "col-8";
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
classes.label = Utils.joinWithSpaces(classes.label, "col-form-label", colClasses.cols);
|
|
32
|
-
classes.editor = Utils.joinWithSpaces(classes.editor, colClasses.inverseCols, isCheckBox ? "col-form-label" : undefined);
|
|
33
|
-
classes.containerDom = containerDom;
|
|
34
|
-
return classes;
|
|
35
|
-
};
|
|
36
|
-
FormGroupInline.prototype.render = function () {
|
|
37
|
-
var _this = this;
|
|
38
|
-
return (React.createElement(FormGroupLayoutContext.Consumer, null, function (value) { return (React.createElement(Observer, null, function () { return (_this.contextProps = value.formGroupProps,
|
|
39
|
-
_super.prototype.render.call(_this)); })); }));
|
|
40
|
-
};
|
|
41
|
-
return FormGroupInline;
|
|
42
|
-
}(FormGroupBase));
|
|
43
|
-
export default FormGroupInline;
|
|
1
|
+
import { __extends, __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormGroupBase } from './FormGroup';
|
|
4
|
+
import { Observer } from 'mobx-react';
|
|
5
|
+
import { FormGroupLayoutContext } from '../GridLayout';
|
|
6
|
+
import { Components, Utils } from '@singularsystems/neo-core';
|
|
7
|
+
var FormGroupInline = /** @class */ (function (_super) {
|
|
8
|
+
__extends(FormGroupInline, _super);
|
|
9
|
+
function FormGroupInline() {
|
|
10
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
11
|
+
}
|
|
12
|
+
FormGroupInline.prototype.hideLabelForCheckboxes = function () {
|
|
13
|
+
return false;
|
|
14
|
+
};
|
|
15
|
+
FormGroupInline.prototype.getFormGroupClasses = function (domProps, isCheckBox) {
|
|
16
|
+
var classes = _super.prototype.getFormGroupClasses.call(this, domProps, isCheckBox);
|
|
17
|
+
var _a = classes.containerDom, xs = _a.xs, sm = _a.sm, md = _a.md, lg = _a.lg, xl = _a.xl, xxl = _a.xxl, containerDom = __rest(_a, ["xs", "sm", "md", "lg", "xl", "xxl"]);
|
|
18
|
+
classes.container += " row";
|
|
19
|
+
var colClasses = Components.BootstrapHelpers.getInverseBreakpointClasses(classes.containerDom);
|
|
20
|
+
if (!colClasses.cols) {
|
|
21
|
+
// No sizes were specified, check if there is a layout context
|
|
22
|
+
if (this.contextProps) {
|
|
23
|
+
colClasses = Components.BootstrapHelpers.getInverseBreakpointClasses(this.contextProps);
|
|
24
|
+
}
|
|
25
|
+
if (!colClasses.cols) {
|
|
26
|
+
// If there are still no sizes, default to below.
|
|
27
|
+
classes.label = "col-4";
|
|
28
|
+
classes.editor = "col-8";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
classes.label = Utils.joinWithSpaces(classes.label, "col-form-label", colClasses.cols);
|
|
32
|
+
classes.editor = Utils.joinWithSpaces(classes.editor, colClasses.inverseCols, isCheckBox ? "col-form-label" : undefined);
|
|
33
|
+
classes.containerDom = containerDom;
|
|
34
|
+
return classes;
|
|
35
|
+
};
|
|
36
|
+
FormGroupInline.prototype.render = function () {
|
|
37
|
+
var _this = this;
|
|
38
|
+
return (React.createElement(FormGroupLayoutContext.Consumer, null, function (value) { return (React.createElement(Observer, null, function () { return (_this.contextProps = value.formGroupProps,
|
|
39
|
+
_super.prototype.render.call(_this)); })); }));
|
|
40
|
+
};
|
|
41
|
+
return FormGroupInline;
|
|
42
|
+
}(FormGroupBase));
|
|
43
|
+
export default FormGroupInline;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { GridContext } from './Grid';
|
|
3
|
-
import { IButtonOptions } from '@singularsystems/neo-core/dist/Components/ButtonOptions';
|
|
4
|
-
import ComponentBase from '../ComponentBase';
|
|
5
|
-
import { INeoCommonColumnProps } from './ColumnHelper';
|
|
6
|
-
interface IDeleteButtonOptions extends IButtonOptions {
|
|
7
|
-
/**
|
|
8
|
-
* Callback to run when a non new item is deleted.
|
|
9
|
-
* * Use this to call an api to delete the item in the database.
|
|
10
|
-
* * Return true if the item was deleted, and must be removed from the list.
|
|
11
|
-
* * The list will not be marked dirty.
|
|
12
|
-
* * If the item is new, it will be removed without invoking this callback.
|
|
13
|
-
*/
|
|
14
|
-
onDeleteExisting?: (item: any) => Promise<boolean>;
|
|
15
|
-
}
|
|
16
|
-
interface IButtonColumnProps extends INeoCommonColumnProps, React.HTMLProps<HTMLTableCellElement> {
|
|
17
|
-
/** Item to pass to edit and delete callbacks. Defaults to the current rows item */
|
|
18
|
-
item?: any;
|
|
19
|
-
/** Text to show in the header. */
|
|
20
|
-
label?: string;
|
|
21
|
-
/** Show text on buttons? */
|
|
22
|
-
showDefaultButtonText?: boolean;
|
|
23
|
-
/** Size of edit and delete button */
|
|
24
|
-
buttonSize?: ("sm" | "lg");
|
|
25
|
-
/** Show delete button? Not required if deleteButton options are set. */
|
|
26
|
-
showDelete?: boolean;
|
|
27
|
-
/** Delete button options. Will cause delete button to be shown. */
|
|
28
|
-
deleteButton?: IDeleteButtonOptions;
|
|
29
|
-
/** Edit button options. Will cause edit button to be shown. */
|
|
30
|
-
editButton?: IButtonOptions;
|
|
31
|
-
/** View button options. Will cause view button to be shown. */
|
|
32
|
-
viewButton?: IButtonOptions;
|
|
33
|
-
/** Where should extra content be placed relative to the pre-defined buttons? */
|
|
34
|
-
childAlignment?: "left" | "right";
|
|
35
|
-
}
|
|
36
|
-
export declare class ButtonColumn extends ComponentBase<IButtonColumnProps> {
|
|
37
|
-
static isColumnComponent: boolean;
|
|
38
|
-
static contextType: React.Context<import("./Grid").GridContextParams<unknown>>;
|
|
39
|
-
context: React.ContextType<typeof GridContext>;
|
|
40
|
-
constructor(props: IButtonColumnProps);
|
|
41
|
-
private item;
|
|
42
|
-
private section;
|
|
43
|
-
protected onFirstRender(): void;
|
|
44
|
-
onDelete(): Promise<void>;
|
|
45
|
-
render(): JSX.Element;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridContext } from './Grid';
|
|
3
|
+
import { IButtonOptions } from '@singularsystems/neo-core/dist/Components/ButtonOptions';
|
|
4
|
+
import ComponentBase from '../ComponentBase';
|
|
5
|
+
import { INeoCommonColumnProps } from './ColumnHelper';
|
|
6
|
+
interface IDeleteButtonOptions extends IButtonOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Callback to run when a non new item is deleted.
|
|
9
|
+
* * Use this to call an api to delete the item in the database.
|
|
10
|
+
* * Return true if the item was deleted, and must be removed from the list.
|
|
11
|
+
* * The list will not be marked dirty.
|
|
12
|
+
* * If the item is new, it will be removed without invoking this callback.
|
|
13
|
+
*/
|
|
14
|
+
onDeleteExisting?: (item: any) => Promise<boolean>;
|
|
15
|
+
}
|
|
16
|
+
export interface IButtonColumnProps extends INeoCommonColumnProps, React.HTMLProps<HTMLTableCellElement> {
|
|
17
|
+
/** Item to pass to edit and delete callbacks. Defaults to the current rows item */
|
|
18
|
+
item?: any;
|
|
19
|
+
/** Text to show in the header. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Show text on buttons? */
|
|
22
|
+
showDefaultButtonText?: boolean;
|
|
23
|
+
/** Size of edit and delete button */
|
|
24
|
+
buttonSize?: ("sm" | "lg");
|
|
25
|
+
/** Show delete button? Not required if deleteButton options are set. */
|
|
26
|
+
showDelete?: boolean;
|
|
27
|
+
/** Delete button options. Will cause delete button to be shown. */
|
|
28
|
+
deleteButton?: IDeleteButtonOptions;
|
|
29
|
+
/** Edit button options. Will cause edit button to be shown. */
|
|
30
|
+
editButton?: IButtonOptions;
|
|
31
|
+
/** View button options. Will cause view button to be shown. */
|
|
32
|
+
viewButton?: IButtonOptions;
|
|
33
|
+
/** Where should extra content be placed relative to the pre-defined buttons? */
|
|
34
|
+
childAlignment?: "left" | "right";
|
|
35
|
+
}
|
|
36
|
+
export declare class ButtonColumn extends ComponentBase<IButtonColumnProps> {
|
|
37
|
+
static isColumnComponent: boolean;
|
|
38
|
+
static contextType: React.Context<import("./Grid").GridContextParams<unknown>>;
|
|
39
|
+
context: React.ContextType<typeof GridContext>;
|
|
40
|
+
constructor(props: IButtonColumnProps);
|
|
41
|
+
private item;
|
|
42
|
+
private section;
|
|
43
|
+
protected onFirstRender(): void;
|
|
44
|
+
onDelete(): Promise<void>;
|
|
45
|
+
render(): JSX.Element;
|
|
46
|
+
}
|
|
47
|
+
export {};
|