@singularsystems/neo-react 1.3.0 → 1.3.2
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 +13 -0
- package/dist/ReactComponents/FormContext.d.ts +2 -0
- package/dist/ReactComponents/FormGroup/FormGroupInline.js +5 -3
- package/dist/ReactComponents/Grid/Row.d.ts +1 -3
- package/dist/ReactComponents/Icons/MaterialSymbolsFontFactory.js +2 -1
- package/dist/ReactComponents/TooltipHelper.d.ts +4 -2
- package/dist/ReactComponents/TooltipHelper.js +11 -4
- package/dist/Routing/RouteProvider.d.ts +1 -0
- package/dist/Routing/RouteProvider.js +5 -4
- package/package.json +1 -1
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.2
|
|
6
|
+
|
|
7
|
+
- List - Added `activeItems` property which will return items that are not being deleted.
|
|
8
|
+
- DateUtils - Added `DateUtils.formatApi` for formatting dates to be used in a query string.
|
|
9
|
+
- Utils.getQueryString() - will now format dates passed in as the root object. Although using `DateUtils.formatApi` is preferred.
|
|
10
|
+
- TooltipHelper - Added overload for passing in a rectangle instead of an element.
|
|
11
|
+
- Deprecated `RowGroup.hideExpandButton`. This was broken, and is difficult to implement properly. Rather return null from the expand property.
|
|
12
|
+
- Added `FormContext.labelSizes` to set the label width on all inline form groups contained within the form context.
|
|
13
|
+
|
|
14
|
+
## Version 1.3.1
|
|
15
|
+
|
|
16
|
+
- Routing - Fixed an issue where the base route would take precedence over other routes if it had parameters, and was declared before other routes.
|
|
17
|
+
|
|
5
18
|
## Version 1.3.0
|
|
6
19
|
|
|
7
20
|
- ViewBase and ViewComponentBase now require that the linked view model has a `TaskRunner` as the first argument. See breaking changes for more info.
|
|
@@ -19,6 +19,8 @@ export declare class FormContextParams implements Components.IFormContextOptions
|
|
|
19
19
|
bindProperty: Model.IPropertyInstance;
|
|
20
20
|
parentType: EditorParentType;
|
|
21
21
|
uniqueId?: string;
|
|
22
|
+
/** Number of columns labels of InlineFormGroups should use. */
|
|
23
|
+
labelSizes?: Components.IColumnWidthBreakpoints;
|
|
22
24
|
}
|
|
23
25
|
export declare const FormContext: React.Context<FormContextParams>;
|
|
24
26
|
/**
|
|
@@ -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
|
|
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,
|
|
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
|
|
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,
|
|
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
|
-
|
|
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.
|
|
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
|
}
|
|
@@ -22,9 +22,7 @@ var RouteProvider = /** @class */ (function () {
|
|
|
22
22
|
this.staticRoutes = this.allRoutes.filter(function (c) { return c.params.length === 0; });
|
|
23
23
|
this.parameterisedRoutes = this.allRoutes
|
|
24
24
|
.filter(function (c) { return c.params.length > 0; })
|
|
25
|
-
.
|
|
26
|
-
.sortBy(function (c) { return c.order; }, "desc")
|
|
27
|
-
.map(function (c) { return c.route; });
|
|
25
|
+
.sortBy(function (c) { return c.order; }, "desc");
|
|
28
26
|
}
|
|
29
27
|
/** Gets the path the component is bound to. If the component is bound to multiple paths, the first path is returned. */
|
|
30
28
|
RouteProvider.prototype.getPathForComponent = function (component) {
|
|
@@ -108,7 +106,7 @@ var RouteProvider = /** @class */ (function () {
|
|
|
108
106
|
* Adds a unique key, and adds route parameters extracted from the component static params object.
|
|
109
107
|
*/
|
|
110
108
|
RouteProvider.prototype.processRoute = function (into, route) {
|
|
111
|
-
var processed = __assign(__assign({}, route), { path: route.path, params: [], key: this.key
|
|
109
|
+
var processed = __assign(__assign({}, route), { path: route.path, params: [], key: this.key++, order: 0 });
|
|
112
110
|
if (route instanceof MenuRoute) {
|
|
113
111
|
processed.path = route.basePath;
|
|
114
112
|
}
|
|
@@ -116,6 +114,9 @@ var RouteProvider = /** @class */ (function () {
|
|
|
116
114
|
if (processed.path.length > 1 && processed.path.endsWith("/")) {
|
|
117
115
|
processed.path = processed.path.substring(0, processed.path.length - 1);
|
|
118
116
|
}
|
|
117
|
+
if (processed.path.length > 1) {
|
|
118
|
+
processed.order = processed.path.split("/").length;
|
|
119
|
+
}
|
|
119
120
|
var viewBaseComponent = route.component;
|
|
120
121
|
if (viewBaseComponent.params) {
|
|
121
122
|
for (var param in viewBaseComponent.params) {
|