@singularsystems/neo-react 1.0.21 → 1.0.22
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/Button.js +3 -1
- package/dist/ReactComponents/Grid/Column.d.ts +2 -2
- package/dist/ReactComponents/Grid/Column.js +3 -2
- package/dist/ReactComponents/Grid/StickyTableHeader.js +4 -0
- package/dist/ReactComponents/GridLayout.d.ts +3 -0
- package/dist/ReactComponents/GridLayout.js +22 -9
- package/package.json +5 -5
- package/styles/Button.scss +7 -0
- package/styles/Misc.scss +0 -1
|
@@ -121,7 +121,9 @@ var Button = /** @class */ (function (_super) {
|
|
|
121
121
|
: React.createElement("div", { key: index, className: Utils.joinWithSpaces("dropdown-item", item.disabled ? " disabled" : "", item.className), onClick: function (e) { return !item.disabled ? _this.menuItemClicked(e, item.data, item.onClick) : undefined; } },
|
|
122
122
|
_this.iconFactory.getIconComponent(item.icon, { fixedWidth: true }),
|
|
123
123
|
" ",
|
|
124
|
-
item.text
|
|
124
|
+
item.text,
|
|
125
|
+
" ",
|
|
126
|
+
item.subText && React.createElement("div", { className: "dropdown-subtext" }, item.subText))); }));
|
|
125
127
|
root =
|
|
126
128
|
React.createElement("div", { className: buttonGroupClasses, ref: this.btnGroupDom },
|
|
127
129
|
mainButton,
|
|
@@ -11,8 +11,8 @@ export interface INeoColumnProps<TData> extends INeoCommonColumnProps, IEditorCo
|
|
|
11
11
|
headerTooltip?: string;
|
|
12
12
|
/** Tooltip to show in cells. If you want the tooltip to show on the cells as well, use 'data-tip'. */
|
|
13
13
|
cellTooltip?: string;
|
|
14
|
-
/** Allows you to
|
|
15
|
-
sort?: Model.IPropertyInstance |
|
|
14
|
+
/** Allows you to override the default allow sorting setting of the datasource, or make clicking a column heading sort a specific property. */
|
|
15
|
+
sort?: Model.IPropertyInstance | boolean;
|
|
16
16
|
/** True if this column must have a total cell. */
|
|
17
17
|
sum?: boolean;
|
|
18
18
|
/** Content callback to show in the footer. The filtered list of the grid is passed into the callback. */
|
|
@@ -35,8 +35,9 @@ var Column = /** @class */ (function (_super) {
|
|
|
35
35
|
this.isFooter = this.context.section === "footer";
|
|
36
36
|
};
|
|
37
37
|
Column.prototype.getSortProperty = function () {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
var _a, _b;
|
|
39
|
+
if ((_b = (_a = this.props.sort) !== null && _a !== void 0 ? _a : this.context.dataView.allowSort) !== null && _b !== void 0 ? _b : true) {
|
|
40
|
+
if (typeof this.props.sort === "object") {
|
|
40
41
|
return this.props.sort;
|
|
41
42
|
}
|
|
42
43
|
else {
|
|
@@ -79,6 +79,8 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
79
79
|
this.restoreColumnWidths();
|
|
80
80
|
this.header.classList.remove("neo-grid-fixed-header");
|
|
81
81
|
this.header.style.clipPath = "";
|
|
82
|
+
this.header.style.left = "";
|
|
83
|
+
this.header.style.top = "";
|
|
82
84
|
this.table.removeChild(this.headerCopy);
|
|
83
85
|
this.headerCopy = undefined;
|
|
84
86
|
}
|
|
@@ -99,6 +101,8 @@ var StickyTableHeader = /** @class */ (function () {
|
|
|
99
101
|
for (var j = 0; j < originalRow.cells.length; j++) {
|
|
100
102
|
var originalCell = originalRow.cells[j], copyCell = copyRow.cells[j];
|
|
101
103
|
originalCell.style.width = window.getComputedStyle(copyCell).width;
|
|
104
|
+
originalCell.style.minWidth = originalCell.style.width;
|
|
105
|
+
originalCell.style.maxWidth = originalCell.style.width;
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
108
|
}
|
|
@@ -7,7 +7,10 @@ interface ILayoutGridProps extends Components.IColumnCountBreakpoints {
|
|
|
7
7
|
verticalSpace?: string;
|
|
8
8
|
/** Sets verticalSpace to "1rem" for convenience. */
|
|
9
9
|
withGaps?: boolean;
|
|
10
|
+
/** Alignment of items vertically */
|
|
10
11
|
alignItems?: Components.flexItemAlign;
|
|
12
|
+
/** Sets dynamic horizontal spacing. If this is set, normal column spacing is ignored. */
|
|
13
|
+
justifyContent?: Components.flexJustifyContent;
|
|
11
14
|
formGroupProps?: Components.IColumnWidthBreakpoints;
|
|
12
15
|
}
|
|
13
16
|
export declare class FormGroupLayoutContextParams {
|
|
@@ -15,25 +15,38 @@ var GridLayout = /** @class */ (function (_super) {
|
|
|
15
15
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
16
16
|
}
|
|
17
17
|
GridLayout.prototype.render = function () {
|
|
18
|
-
var _a = this.props, gutterSize = _a.gutterSize, verticalSpace = _a.verticalSpace, withGaps = _a.withGaps, alignItems = _a.alignItems, formGroupProps = _a.formGroupProps, xs = _a.xs, sm = _a.sm, md = _a.md, lg = _a.lg, xl = _a.xl, xxl = _a.xxl, domProps = __rest(_a, ["gutterSize", "verticalSpace", "withGaps", "alignItems", "formGroupProps", "xs", "sm", "md", "lg", "xl", "xxl"]);
|
|
18
|
+
var _a = this.props, gutterSize = _a.gutterSize, verticalSpace = _a.verticalSpace, withGaps = _a.withGaps, alignItems = _a.alignItems, justifyContent = _a.justifyContent, formGroupProps = _a.formGroupProps, xs = _a.xs, sm = _a.sm, md = _a.md, lg = _a.lg, xl = _a.xl, xxl = _a.xxl, domProps = __rest(_a, ["gutterSize", "verticalSpace", "withGaps", "alignItems", "justifyContent", "formGroupProps", "xs", "sm", "md", "lg", "xl", "xxl"]);
|
|
19
19
|
var isBsPre5 = BootstrapUtils.isPre5;
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
var hasColumns = (xs || sm || md || lg || xl || xxl);
|
|
21
|
+
var columnClassName = undefined;
|
|
22
|
+
var isJustifyBetween = justifyContent === "between";
|
|
23
|
+
var baseRowClassName = "row";
|
|
24
|
+
if (!justifyContent) {
|
|
25
|
+
columnClassName = Utils.joinWithSpaces((gutterSize !== undefined && isBsPre5) ? "px-" + gutterSize : undefined, xs && "col-" + 12 / xs, sm && "col-sm-" + 12 / sm, md && "col-md-" + 12 / md, lg && "col-lg-" + 12 / lg, xl && "col-xl-" + 12 / xl, xxl && "col-xxl-" + 12 / xxl);
|
|
26
|
+
if (!hasColumns) {
|
|
27
|
+
columnClassName = Utils.joinWithSpaces(columnClassName, "col-md-6");
|
|
28
|
+
}
|
|
23
29
|
}
|
|
24
|
-
|
|
30
|
+
else {
|
|
31
|
+
if (hasColumns) {
|
|
32
|
+
console.error("GridLayout: Columns should not be specified if justifyContent is specified.");
|
|
33
|
+
}
|
|
34
|
+
baseRowClassName = "d-flex justify-content-" + justifyContent;
|
|
35
|
+
}
|
|
36
|
+
var rowClassName = Utils.joinWithSpaces(domProps.className, baseRowClassName, gutterSize && (isBsPre5 ? "mx-n" : "gx-") + gutterSize, alignItems && "align-items-" + alignItems);
|
|
25
37
|
var containerStyle = domProps.style;
|
|
26
|
-
var columnStyle =
|
|
38
|
+
var columnStyle = { marginLeft: "auto" };
|
|
27
39
|
if (withGaps && !verticalSpace) {
|
|
28
40
|
verticalSpace = "1rem";
|
|
29
41
|
}
|
|
30
42
|
if (verticalSpace) {
|
|
31
43
|
containerStyle = containerStyle || {};
|
|
32
44
|
containerStyle.marginTop = "-" + verticalSpace;
|
|
33
|
-
columnStyle = { marginTop: verticalSpace };
|
|
45
|
+
columnStyle = { marginTop: verticalSpace, marginLeft: "auto" };
|
|
34
46
|
}
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
var childCount = React.Children.count(this.props.children);
|
|
48
|
+
return (React.createElement(FormGroupLayoutContext.Provider, { value: { formGroupProps: formGroupProps } },
|
|
49
|
+
React.createElement("div", __assign({}, domProps, { className: rowClassName, style: containerStyle }), React.Children.map(this.props.children, function (child, index) { return (child && React.createElement("div", { className: columnClassName, style: __assign(__assign({}, columnStyle), { marginLeft: childCount === 2 && index === 1 && isJustifyBetween ? "auto" : undefined }) }, child)); }))));
|
|
37
50
|
};
|
|
38
51
|
return GridLayout;
|
|
39
52
|
}(React.Component));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@singularsystems/neo-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
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",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"typescript": "5.4.2"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@singularsystems/neo-core": "1.0.
|
|
34
|
+
"@singularsystems/neo-core": "1.0.18",
|
|
35
35
|
"@types/rc-slider": "^8.6.5",
|
|
36
36
|
"@types/react-color": "^3.0.1",
|
|
37
|
-
"axios": "1.7.
|
|
37
|
+
"axios": "1.7.7",
|
|
38
38
|
"history": "4.10.1",
|
|
39
39
|
"inversify": "^6.0.2",
|
|
40
40
|
"memoize-one": "6.0.0",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"react-dom": "18.2.0",
|
|
46
46
|
"react-router": "5.3.3",
|
|
47
47
|
"react-router-dom": "5.3.3",
|
|
48
|
-
"react-select": "5.
|
|
48
|
+
"react-select": "5.8.1",
|
|
49
49
|
"tslib": "2.5.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@singularsystems/neo-core": ">=1.0.
|
|
52
|
+
"@singularsystems/neo-core": ">=1.0.18",
|
|
53
53
|
"axios": ">=1.6.2",
|
|
54
54
|
"inversify": ">=5.0.1",
|
|
55
55
|
"mobx": ">=6.9.0",
|
package/styles/Button.scss
CHANGED