@singularsystems/neo-react 1.3.1 → 1.3.3

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 CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  This file details all new features and changes to functionality. If you only need to see changes that require updates to your project, see the [breaking changes](./Breaking.md) readme.
4
4
 
5
+ ## Version 1.3.3
6
+
7
+ - Minor type fixes.
8
+
9
+ ## Version 1.3.2
10
+
11
+ - List - Added `activeItems` property which will return items that are not being deleted.
12
+ - DateUtils - Added `DateUtils.formatApi` for formatting dates to be used in a query string.
13
+ - Utils.getQueryString() - will now format dates passed in as the root object. Although using `DateUtils.formatApi` is preferred.
14
+ - TooltipHelper - Added overload for passing in a rectangle instead of an element.
15
+ - Deprecated `RowGroup.hideExpandButton`. This was broken, and is difficult to implement properly. Rather return null from the expand property.
16
+ - Added `FormContext.labelSizes` to set the label width on all inline form groups contained within the form context.
17
+
5
18
  ## Version 1.3.1
6
19
 
7
20
  - Routing - Fixed an issue where the base route would take precedence over other routes if it had parameters, and was declared before other routes.
@@ -112,9 +112,9 @@ var Form = /** @class */ (function (_super) {
112
112
  };
113
113
  Form.prototype.render = function () {
114
114
  var _this = this;
115
- var _a = this.props, validationDisplayMode = _a.validationDisplayMode, allReadOnly = _a.allReadOnly, allDisabled = _a.allDisabled, model = _a.model, showSummaryModal = _a.showSummaryModal, invalidSummaryTitle = _a.invalidSummaryTitle, invalidSummaryText = _a.invalidSummaryText, native = __rest(_a, ["validationDisplayMode", "allReadOnly", "allDisabled", "model", "showSummaryModal", "invalidSummaryTitle", "invalidSummaryText"]);
115
+ var _a = this.props, validationDisplayMode = _a.validationDisplayMode, allReadOnly = _a.allReadOnly, allDisabled = _a.allDisabled, model = _a.model, showSummaryModal = _a.showSummaryModal, invalidSummaryTitle = _a.invalidSummaryTitle, invalidSummaryText = _a.invalidSummaryText, labelSizes = _a.labelSizes, suppressLabels = _a.suppressLabels, native = __rest(_a, ["validationDisplayMode", "allReadOnly", "allDisabled", "model", "showSummaryModal", "invalidSummaryTitle", "invalidSummaryText", "labelSizes", "suppressLabels"]);
116
116
  return (React.createElement("form", __assign({}, native, { onSubmit: function (e) { return _this.onSubmit(e); } }),
117
- React.createElement(FormContextProvider, { validationDisplayMode: validationDisplayMode !== null && validationDisplayMode !== void 0 ? validationDisplayMode : Misc.Settings.form.validationDisplayMode, allReadOnly: allReadOnly, allDisabled: allDisabled }, (this.props.children instanceof Function) ? this.props.children(model, model.meta) : this.props.children)));
117
+ React.createElement(FormContextProvider, { validationDisplayMode: validationDisplayMode !== null && validationDisplayMode !== void 0 ? validationDisplayMode : Misc.Settings.form.validationDisplayMode, allReadOnly: allReadOnly, allDisabled: allDisabled, labelSizes: labelSizes, suppressLabels: suppressLabels }, (this.props.children instanceof Function) ? this.props.children(model, model.meta) : this.props.children)));
118
118
  };
119
119
  Form = __decorate([
120
120
  observer
@@ -13,6 +13,7 @@ export declare class FormContextParams implements Components.IFormContextOptions
13
13
  allDisabled: boolean;
14
14
  /** True if all labels should be hidden. */
15
15
  suppressLabels?: boolean;
16
+ labelSizes?: Components.IColumnWidthBreakpoints;
16
17
  /**
17
18
  * The property the form group is bound to.
18
19
  */
@@ -13,14 +13,16 @@ var FormGroupInline = /** @class */ (function (_super) {
13
13
  return false;
14
14
  };
15
15
  FormGroupInline.prototype.getFormGroupClasses = function (domProps, isCheckBox) {
16
+ var _a;
16
17
  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
+ var _b = classes.containerDom, xs = _b.xs, sm = _b.sm, md = _b.md, lg = _b.lg, xl = _b.xl, xxl = _b.xxl, containerDom = __rest(_b, ["xs", "sm", "md", "lg", "xl", "xxl"]);
18
19
  classes.container += " row";
20
+ classes.label = "";
19
21
  var colClasses = Components.BootstrapHelpers.getInverseBreakpointClasses(classes.containerDom);
20
22
  if (!colClasses.cols) {
21
23
  // No sizes were specified, check if there is a layout context
22
- if (this.contextProps) {
23
- colClasses = Components.BootstrapHelpers.getInverseBreakpointClasses(this.contextProps);
24
+ if (this.contextProps || this.context.labelSizes) {
25
+ colClasses = Components.BootstrapHelpers.getInverseBreakpointClasses((_a = this.contextProps) !== null && _a !== void 0 ? _a : this.context.labelSizes);
24
26
  }
25
27
  if (!colClasses.cols) {
26
28
  // If there are still no sizes, default to below.
@@ -74,9 +74,7 @@ interface INeoRowGroupProps {
74
74
  * To hide the expand button, return null.
75
75
  */
76
76
  expandProperty?: Model.IPropertyInstance<boolean | null>;
77
- /**
78
- * Hides the expansion button on this row.
79
- */
77
+ /** @deprecated change your expand property to return `null` to hide the expand button. */
80
78
  hideExpandButton?: boolean;
81
79
  children: React.ReactNode;
82
80
  }
@@ -1,9 +1,11 @@
1
1
  import { Components } from '@singularsystems/neo-core';
2
2
  export declare class TooltipHelper {
3
3
  private static toolTipContainer;
4
- static showTooltip(on: HTMLElement, content: string, isHtml: boolean, aligmnent?: Components.Tooltip.Alignment, position?: Components.Tooltip.Position, className?: string): void;
4
+ static showTooltip(on: HTMLElement, content: string, isHtml: boolean, alignment?: Components.Tooltip.Alignment, position?: Components.Tooltip.Position, className?: string): void;
5
+ static showTooltip(rect: DOMRect, content: string, isHtml: boolean, alignment?: Components.Tooltip.Alignment, position?: Components.Tooltip.Position, className?: string): void;
5
6
  static hideTooltip(): void;
6
- private static positionTooltip;
7
+ private static positionTooltipElement;
8
+ private static positionTooltipRect;
7
9
  private static getPrefixedWindowKey;
8
10
  private static getPrefixedStyleName;
9
11
  }
@@ -4,7 +4,7 @@ var arrowHeight = 6;
4
4
  var TooltipHelper = /** @class */ (function () {
5
5
  function TooltipHelper() {
6
6
  }
7
- TooltipHelper.showTooltip = function (on, content, isHtml, aligmnent, position, className) {
7
+ TooltipHelper.showTooltip = function (on, content, isHtml, alignment, position, className) {
8
8
  this.toolTipContainer = Misc.Globals.root.getElementById(containerId);
9
9
  if (this.toolTipContainer) {
10
10
  var ttText = this.toolTipContainer.firstChild;
@@ -14,7 +14,12 @@ var TooltipHelper = /** @class */ (function () {
14
14
  else {
15
15
  ttText.innerText = content;
16
16
  }
17
- TooltipHelper.positionTooltip(this.toolTipContainer, on, aligmnent, position, className);
17
+ if (on instanceof HTMLElement) {
18
+ TooltipHelper.positionTooltipElement(this.toolTipContainer, on, alignment, position, className);
19
+ }
20
+ else {
21
+ TooltipHelper.positionTooltipRect(this.toolTipContainer, on, alignment, position, className);
22
+ }
18
23
  this.toolTipContainer.classList.add("show");
19
24
  }
20
25
  else {
@@ -26,7 +31,10 @@ var TooltipHelper = /** @class */ (function () {
26
31
  this.toolTipContainer.classList.remove("show");
27
32
  }
28
33
  };
29
- TooltipHelper.positionTooltip = function (toolTipContainer, anchor, alignment, position, className) {
34
+ TooltipHelper.positionTooltipElement = function (toolTipContainer, anchor, alignment, position, className) {
35
+ this.positionTooltipRect(toolTipContainer, anchor.getBoundingClientRect(), alignment, position, className);
36
+ };
37
+ TooltipHelper.positionTooltipRect = function (toolTipContainer, anchorRect, alignment, position, className) {
30
38
  var isHorizontal = position === "left" || position === "right";
31
39
  toolTipContainer.className = "neo-tooltip" + (isHorizontal ? " horizontal" : "");
32
40
  if (className) {
@@ -38,7 +46,6 @@ var TooltipHelper = /** @class */ (function () {
38
46
  toolTipContainer.style.top = "0";
39
47
  toolTipContainer.style.left = "0";
40
48
  var ttRect = toolTipContainer.getBoundingClientRect();
41
- var anchorRect = anchor.getBoundingClientRect();
42
49
  if (alignment === "start-edge") {
43
50
  alignment = (anchorRect[startName] + ttRect[dimensionName] + 20 > window[this.getPrefixedWindowKey("inner", dimensionName)]) ? "end" : "start";
44
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
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",