@singularsystems/neo-react 0.10.34 → 0.10.37
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/ReactComponents/Grid/Column.d.ts +2 -0
- package/dist/ReactComponents/Grid/Column.js +4 -4
- package/dist/ReactComponents/Grid/Grid.js +2 -2
- package/dist/ReactComponents/Link.d.ts +13 -0
- package/dist/ReactComponents/Link.js +28 -0
- package/dist/ReactComponents/_Exports.d.ts +2 -1
- package/dist/ReactComponents/_Exports.js +2 -1
- package/package.json +2 -2
|
@@ -9,6 +9,8 @@ export interface INeoColumnProps<TData> extends INeoCommonColumnProps, IEditorCo
|
|
|
9
9
|
width?: number | string;
|
|
10
10
|
/** Tooltip to show in header. If you want the tooltip to show on the cells as well, use 'data-tip'. */
|
|
11
11
|
headerTooltip?: string;
|
|
12
|
+
/** Tooltip to show in cells. If you want the tooltip to show on the cells as well, use 'data-tip'. */
|
|
13
|
+
cellTooltip?: string;
|
|
12
14
|
/** Allows you to disable sorting on a column, or make clicking a column heading sort a specific property. */
|
|
13
15
|
sort?: Model.IPropertyInstance | false;
|
|
14
16
|
/** True if this column must have a total cell. */
|
|
@@ -91,7 +91,7 @@ var Column = /** @class */ (function (_super) {
|
|
|
91
91
|
var _a;
|
|
92
92
|
this.onRender();
|
|
93
93
|
var allProps = BindPropsHelper.normaliseContainerProps(this, this.props, false);
|
|
94
|
-
var _b = allProps.containerDom, width = _b.width, hideBelow = _b.hideBelow, hideAbove = _b.hideAbove, headerTooltip = _b.headerTooltip, alignment = _b.alignment, sort = _b.sort, sum = _b.sum, footerContent = _b.footerContent, headerClassName = _b.headerClassName, cellClassName = _b.cellClassName, onHeaderClick = _b.onHeaderClick, domProps = __rest(_b, ["width", "hideBelow", "hideAbove", "headerTooltip", "alignment", "sort", "sum", "footerContent", "headerClassName", "cellClassName", "onHeaderClick"]);
|
|
94
|
+
var _b = allProps.containerDom, width = _b.width, hideBelow = _b.hideBelow, hideAbove = _b.hideAbove, headerTooltip = _b.headerTooltip, cellTooltip = _b.cellTooltip, alignment = _b.alignment, sort = _b.sort, sum = _b.sum, footerContent = _b.footerContent, headerClassName = _b.headerClassName, cellClassName = _b.cellClassName, onHeaderClick = _b.onHeaderClick, domProps = __rest(_b, ["width", "hideBelow", "hideAbove", "headerTooltip", "cellTooltip", "alignment", "sort", "sum", "footerContent", "headerClassName", "cellClassName", "onHeaderClick"]);
|
|
95
95
|
if (allProps.bind !== undefined) {
|
|
96
96
|
if (!this.controlType || this.isHeader) {
|
|
97
97
|
this.controlType = BindPropsHelper.getControlType(allProps);
|
|
@@ -133,7 +133,7 @@ var Column = /** @class */ (function (_super) {
|
|
|
133
133
|
this.refreshStateObserver(allProps.editor);
|
|
134
134
|
return this.isHeader ? this.renderHeader(allProps, domProps, headerTooltip, headerClassName) :
|
|
135
135
|
this.isFooter ? this.renderFooter(allProps, domProps) :
|
|
136
|
-
this.renderBody(allProps, domProps, cellClassName);
|
|
136
|
+
this.renderBody(allProps, domProps, cellTooltip, cellClassName);
|
|
137
137
|
};
|
|
138
138
|
Column.prototype.renderHeader = function (props, domProps, tooltip, headerClassName) {
|
|
139
139
|
var _this = this;
|
|
@@ -153,7 +153,7 @@ var Column = /** @class */ (function (_super) {
|
|
|
153
153
|
sortIcon &&
|
|
154
154
|
React.createElement("i", { className: "column-sort-icon fa fa-" + sortIcon })));
|
|
155
155
|
};
|
|
156
|
-
Column.prototype.renderBody = function (props, domProps, cellClassName) {
|
|
156
|
+
Column.prototype.renderBody = function (props, domProps, cellTooltip, cellClassName) {
|
|
157
157
|
var _this = this;
|
|
158
158
|
var editorProps = props.editor;
|
|
159
159
|
var containerProps = props.container;
|
|
@@ -183,7 +183,7 @@ var Column = /** @class */ (function (_super) {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
domProps.className = Utils.joinWithSpaces(domProps.className, cellClassName);
|
|
186
|
-
return (React.createElement("td", __assign({}, domProps),
|
|
186
|
+
return (React.createElement("td", __assign({ "data-tip": cellTooltip }, domProps),
|
|
187
187
|
!containerProps.suppressDefaultContent && (editor !== undefined ?
|
|
188
188
|
editor :
|
|
189
189
|
editorProps.bind ? displayValue : undefined),
|
|
@@ -90,10 +90,10 @@ var Grid = /** @class */ (function (_super) {
|
|
|
90
90
|
React.createElement(GridContext.Provider, { value: this.gridContext },
|
|
91
91
|
React.createElement(TableSection, { type: "header" }, this.headerItem && this.props.children(this.headerItem, this.headerItem.meta)),
|
|
92
92
|
React.createElement(TableSection, { type: "body" }, this.gridContext.dataView.getItems().map(function (item) { return (React.createElement(ItemGroup, { item: item, key: keyProperty ? item[keyProperty] : item.entityIdentifier, template: _this.props.children })); })),
|
|
93
|
-
React.createElement(Observer, null, function () { return (showAddButton || addButton || _this.gridContext.hasSummaries || footerContent) &&
|
|
93
|
+
React.createElement(Observer, null, function () { return (showAddButton || addButton || _this.gridContext.hasSummaries || footerContent !== undefined) &&
|
|
94
94
|
React.createElement(TableSection, { type: "footer" },
|
|
95
95
|
_this.gridContext.hasSummaries && _this.headerItem && _this.props.children(_this.headerItem, _this.headerItem.meta),
|
|
96
|
-
footerContent && footerContent(_this.gridContext.dataView.getItems()),
|
|
96
|
+
footerContent !== undefined && footerContent(_this.gridContext.dataView.getItems()),
|
|
97
97
|
(showAddButton || addButton) && React.createElement(AddButtonRow, { addButton: addButton })); }))));
|
|
98
98
|
};
|
|
99
99
|
Grid.prototype.setInitialSort = function (initialSort, initialSortAscending) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ILinkProps extends React.HTMLProps<HTMLAnchorElement> {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Renders an anchor tag with an href of '/' unless otherwise specified.
|
|
6
|
+
* The onClick event will call preventDefault() so that the anchor acts like a button instead of a link to a url.
|
|
7
|
+
*/
|
|
8
|
+
export default class Link extends React.Component<ILinkProps> {
|
|
9
|
+
constructor(props: ILinkProps);
|
|
10
|
+
private onClick;
|
|
11
|
+
render(): JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __assign, __extends } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Renders an anchor tag with an href of '/' unless otherwise specified.
|
|
5
|
+
* The onClick event will call preventDefault() so that the anchor acts like a button instead of a link to a url.
|
|
6
|
+
*/
|
|
7
|
+
var Link = /** @class */ (function (_super) {
|
|
8
|
+
__extends(Link, _super);
|
|
9
|
+
function Link(props) {
|
|
10
|
+
var _this = _super.call(this, props) || this;
|
|
11
|
+
_this.onClick = _this.onClick.bind(_this);
|
|
12
|
+
return _this;
|
|
13
|
+
}
|
|
14
|
+
Link.prototype.onClick = function (e) {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
if (this.props.onClick) {
|
|
17
|
+
this.props.onClick(e);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
Link.prototype.render = function () {
|
|
21
|
+
var _a;
|
|
22
|
+
var props = this.props;
|
|
23
|
+
var href = (_a = props.href, (_a !== null && _a !== void 0 ? _a : "/"));
|
|
24
|
+
return React.createElement("a", __assign({}, props, { href: href, onClick: this.onClick }), this.props.children);
|
|
25
|
+
};
|
|
26
|
+
return Link;
|
|
27
|
+
}(React.Component));
|
|
28
|
+
export default Link;
|
|
@@ -20,6 +20,7 @@ import FormGroupInline from './FormGroup/FormGroupInline';
|
|
|
20
20
|
import Form from './Form';
|
|
21
21
|
import { FormContextProvider as FormContext } from './FormContext';
|
|
22
22
|
import GridLayout from './GridLayout';
|
|
23
|
+
import Link from './Link';
|
|
23
24
|
import Loader from './Loader';
|
|
24
25
|
import Modal from './Modal/Modal';
|
|
25
26
|
import ModalContainer from './Modal/ModalContainer';
|
|
@@ -37,4 +38,4 @@ import ToastContainer from './Notifications/ToastContainer';
|
|
|
37
38
|
import Tooltip from './Tooltip';
|
|
38
39
|
import TooltipProvider from './TooltipProvider';
|
|
39
40
|
import ValidationSummary from './ValidationSummary';
|
|
40
|
-
export { Alert, AutoCompleteDropDown, Button, Card, Checkbox, Collapsable, ColorPicker, ContextMenuContainer, DatePicker, DropDown, FileBasicInput, FileContext, FileDropArea, FileInput, FileUploadButton, FileUploadProgress, Form, FormContext, FormGroup, FormGroupFloating, FormGroupInline, GridLayout, Input, Loader, Modal, ModalContainer, NumberInput, Pager, PagerControlsBasic, PageSizeControl, Passwordbox, ProgressBar, RadioList, Slider, TabContainer, Tab, Textbox, Toast, ToastContainer, Tooltip, TooltipProvider, ValidationSummary };
|
|
41
|
+
export { Alert, AutoCompleteDropDown, Button, Card, Checkbox, Collapsable, ColorPicker, ContextMenuContainer, DatePicker, DropDown, FileBasicInput, FileContext, FileDropArea, FileInput, FileUploadButton, FileUploadProgress, Form, FormContext, FormGroup, FormGroupFloating, FormGroupInline, GridLayout, Input, Link, Loader, Modal, ModalContainer, NumberInput, Pager, PagerControlsBasic, PageSizeControl, Passwordbox, ProgressBar, RadioList, Slider, TabContainer, Tab, Textbox, Toast, ToastContainer, Tooltip, TooltipProvider, ValidationSummary };
|
|
@@ -20,6 +20,7 @@ import FormGroupInline from './FormGroup/FormGroupInline';
|
|
|
20
20
|
import Form from './Form';
|
|
21
21
|
import { FormContextProvider as FormContext } from './FormContext';
|
|
22
22
|
import GridLayout from './GridLayout';
|
|
23
|
+
import Link from './Link';
|
|
23
24
|
import Loader from './Loader';
|
|
24
25
|
import Modal from './Modal/Modal';
|
|
25
26
|
import ModalContainer from './Modal/ModalContainer';
|
|
@@ -37,4 +38,4 @@ import ToastContainer from './Notifications/ToastContainer';
|
|
|
37
38
|
import Tooltip from './Tooltip';
|
|
38
39
|
import TooltipProvider from './TooltipProvider';
|
|
39
40
|
import ValidationSummary from './ValidationSummary';
|
|
40
|
-
export { Alert, AutoCompleteDropDown, Button, Card, Checkbox, Collapsable, ColorPicker, ContextMenuContainer, DatePicker, DropDown, FileBasicInput, FileContext, FileDropArea, FileInput, FileUploadButton, FileUploadProgress, Form, FormContext, FormGroup, FormGroupFloating, FormGroupInline, GridLayout, Input, Loader, Modal, ModalContainer, NumberInput, Pager, PagerControlsBasic, PageSizeControl, Passwordbox, ProgressBar, RadioList, Slider, TabContainer, Tab, Textbox, Toast, ToastContainer, Tooltip, TooltipProvider, ValidationSummary };
|
|
41
|
+
export { Alert, AutoCompleteDropDown, Button, Card, Checkbox, Collapsable, ColorPicker, ContextMenuContainer, DatePicker, DropDown, FileBasicInput, FileContext, FileDropArea, FileInput, FileUploadButton, FileUploadProgress, Form, FormContext, FormGroup, FormGroupFloating, FormGroupInline, GridLayout, Input, Link, Loader, Modal, ModalContainer, NumberInput, Pager, PagerControlsBasic, PageSizeControl, Passwordbox, ProgressBar, RadioList, Slider, TabContainer, Tab, Textbox, Toast, ToastContainer, Tooltip, TooltipProvider, ValidationSummary };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@singularsystems/neo-react",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.37",
|
|
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",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/rc-slider": "^8.6.5",
|
|
34
34
|
"@types/react-color": "^3.0.1",
|
|
35
35
|
"@types/react-select": "3.1.0",
|
|
36
|
-
"@singularsystems/neo-core": "^0.10.
|
|
36
|
+
"@singularsystems/neo-core": "^0.10.44",
|
|
37
37
|
"axios": "^0.21.1",
|
|
38
38
|
"decimal.js-light": "2.5.1",
|
|
39
39
|
"history": "4.10.1",
|