@singularsystems/neo-react 1.0.20 → 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.
@@ -2,17 +2,19 @@ import { __assign, __decorate, __extends, __metadata, __rest } from "tslib";
2
2
  import React from 'react';
3
3
  import { observer } from 'mobx-react';
4
4
  import { Utils } from '@singularsystems/neo-core';
5
+ import BootstrapUtils from "./BootstrapUtils";
5
6
  var Badge = /** @class */ (function (_super) {
6
7
  __extends(Badge, _super);
7
8
  function Badge(props) {
8
9
  return _super.call(this, props) || this;
9
10
  }
10
11
  Badge.prototype.render = function () {
11
- var _a;
12
- var _b = this.props, text = _b.text, variant = _b.variant, customVariant = _b.customVariant, isLarge = _b.isLarge, isPill = _b.isPill, children = _b.children, domProps = __rest(_b, ["text", "variant", "customVariant", "isLarge", "isPill", "children"]);
13
- var variantClassName = "badge badge-".concat(((_a = customVariant !== null && customVariant !== void 0 ? customVariant : variant) !== null && _a !== void 0 ? _a : "primary"));
12
+ var _a, _b;
13
+ var _c = this.props, text = _c.text, variant = _c.variant, customVariant = _c.customVariant, isLarge = _c.isLarge, isPill = _c.isPill, children = _c.children, domProps = __rest(_c, ["text", "variant", "customVariant", "isLarge", "isPill", "children"]);
14
+ var isBsPre5 = BootstrapUtils.isPre5;
15
+ var variantClassName = isBsPre5 ? "badge badge-".concat(((_a = customVariant !== null && customVariant !== void 0 ? customVariant : variant) !== null && _a !== void 0 ? _a : "primary")) : "badge bg-".concat(((_b = customVariant !== null && customVariant !== void 0 ? customVariant : variant) !== null && _b !== void 0 ? _b : "primary"));
14
16
  var largeBadgeClassName = isLarge ? "badge-lg" : "";
15
- var pillClassName = isPill ? "badge-pill" : "";
17
+ var pillClassName = isPill ? (isBsPre5 ? "badge-pill" : "rounded-pill") : "";
16
18
  domProps.className = Utils.joinWithSpaces(domProps.className, variantClassName, pillClassName, largeBadgeClassName);
17
19
  return (React.createElement("div", __assign({}, domProps), children !== null && children !== void 0 ? children : text));
18
20
  };
@@ -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,
@@ -5,6 +5,7 @@ import { observer } from 'mobx-react';
5
5
  import Scrollbar from 'react-custom-scrollbars';
6
6
  import Collapsable from './Collapsable';
7
7
  import { NeoReactTypes } from '../Modules/Types';
8
+ import { Icon } from "./_Exports";
8
9
  var Card = /** @class */ (function (_super) {
9
10
  __extends(Card, _super);
10
11
  function Card() {
@@ -21,7 +22,8 @@ var Card = /** @class */ (function (_super) {
21
22
  var expandState = isExpanded !== null && isExpanded !== void 0 ? isExpanded : this.expandState;
22
23
  var expandIndicator = undefined;
23
24
  if (isCollapsible) {
24
- expandIndicator = React.createElement("i", { onClick: function (e) { return expandState.value = !expandState.value; }, className: "card-expand-indicator fa fa-fw fa-angle-".concat(expandState.value ? "up" : "down") });
25
+ expandIndicator = React.createElement("span", { className: "card-expand-indicator", onClick: function (e) { expandState.value = !expandState.value; e.stopPropagation(); } },
26
+ React.createElement(Icon, { fixedWidth: true, name: "fa-angle-".concat(expandState.value ? "up" : "down") }));
25
27
  if (expandIconPosition === "right") {
26
28
  if (headerElements) {
27
29
  headerElements = React.createElement(React.Fragment, null,
@@ -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 disable sorting on a column, or make clicking a column heading sort a specific property. */
15
- sort?: Model.IPropertyInstance | false;
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
- if (this.props.sort !== false && this.context.dataView.allowSort) {
39
- if (this.props.sort) {
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 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);
21
- if (!(xs || sm || md || lg || xl || xxl)) {
22
- columnClassName = Utils.joinWithSpaces(columnClassName, "col-md-6");
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
- var rowClassName = Utils.joinWithSpaces(domProps.className, "row", gutterSize && (isBsPre5 ? "mx-n" : "gx-") + this.props.gutterSize, alignItems && "align-items-" + this.props.alignItems);
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 = undefined;
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
- return (React.createElement(FormGroupLayoutContext.Provider, { value: { formGroupProps: this.props.formGroupProps } },
36
- React.createElement("div", __assign({}, domProps, { className: rowClassName, style: containerStyle }), React.Children.map(this.props.children, function (child) { return (child && React.createElement("div", { className: columnClassName, style: columnStyle }, child)); }))));
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));
@@ -81,6 +81,8 @@ var neoFontAwesomeMappings = [
81
81
  ["minus-square", "indeterminate_check_box"],
82
82
  ["arrow-left", "arrow_back"],
83
83
  ["angle-left", "chevron_left"],
84
+ ["angle-up", "keyboard_arrow_up"],
85
+ ["angle-down", "keyboard_arrow_down"],
84
86
  ["caret-left", "arrow_left"],
85
87
  ["trash", "delete"],
86
88
  ["user", "person"],
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Misc } from '@singularsystems/neo-core';
3
3
  import { NeoReactTypes } from '../Modules/Types';
4
- import BootstrapUtils from "./BootstrapUtils";
5
4
  var InputHelpers = /** @class */ (function () {
6
5
  function InputHelpers() {
7
6
  }
@@ -10,26 +9,24 @@ var InputHelpers = /** @class */ (function () {
10
9
  this.iconFactory = Misc.Globals.appService.get(NeoReactTypes.Components.IconFactory);
11
10
  }
12
11
  if (props.requiresGroup) {
13
- var isBsPre5 = BootstrapUtils.isPre5, isDisabled = domProps.disabled || domProps.readOnly;
12
+ var isDisabled = domProps.disabled || domProps.readOnly;
14
13
  return (React.createElement("div", { className: "input-group" + (isDisabled ? " input-group-disabled" : "") },
15
- this.getElement(isBsPre5, "input-group-prepend", inputRef, props.prependText, props.prependIcon, props.prepend),
14
+ this.getElement("input-group-prepend", inputRef, props.prependText, props.prependIcon, props.prepend),
16
15
  element,
17
- this.getElement(isBsPre5, "input-group-append", inputRef, props.appendText, props.appendIcon, props.append)));
16
+ this.getElement("input-group-append", inputRef, props.appendText, props.appendIcon, props.append)));
18
17
  }
19
18
  else {
20
19
  return element;
21
20
  }
22
21
  };
23
- InputHelpers.getElement = function (isBsPre5, className, inputRef, text, icon, element) {
22
+ InputHelpers.getElement = function (className, inputRef, text, icon, element) {
24
23
  if (!text && !icon && !element) {
25
24
  return undefined;
26
25
  }
27
26
  var innerElement = element ?
28
27
  (element instanceof Function ? element() : element) :
29
28
  React.createElement("span", { className: "input-group-text", onClick: function () { var _a; return (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } }, text ? this.iconFactory.textOrIcon(text) : this.iconFactory.getIconComponent(icon));
30
- return isBsPre5 ?
31
- React.createElement("div", { className: className }, innerElement) :
32
- innerElement;
29
+ return React.createElement("div", { className: className }, innerElement);
33
30
  };
34
31
  return InputHelpers;
35
32
  }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "1.0.20",
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.14",
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.5",
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.7.3",
48
+ "react-select": "5.8.1",
49
49
  "tslib": "2.5.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@singularsystems/neo-core": ">=1.0.14",
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",
@@ -23,5 +23,12 @@ div.dropdown-menu {
23
23
 
24
24
  div.dropdown-item {
25
25
  cursor: pointer;
26
+
27
+ .dropdown-subtext {
28
+ font-size: 13px;
29
+ color: #888;
30
+ max-width: 250px;
31
+ white-space: wrap;
32
+ }
26
33
  }
27
34
  }
package/styles/Card.scss CHANGED
@@ -4,8 +4,8 @@
4
4
  justify-content: space-between;
5
5
  align-items: center;
6
6
 
7
- .card-header-title i {
8
- margin-right: 10px;
7
+ .card-header-title .neo-icon {
8
+ margin-right: 0.5rem;
9
9
  }
10
10
 
11
11
  .card-header-right-section {
@@ -15,8 +15,6 @@
15
15
 
16
16
  .card-expand-indicator {
17
17
  margin-left: 0.5rem;
18
- padding-top: 0.5rem;
19
- padding-bottom: 0.5rem;
20
18
  }
21
19
  }
22
20
  }
package/styles/Misc.scss CHANGED
@@ -112,7 +112,6 @@ div.tabs-header {
112
112
  select.form-control {
113
113
  display: inline;
114
114
  width: auto;
115
- padding: 0;
116
115
  border-radius: 3px;
117
116
  }
118
117
  }