@singularsystems/neo-react 1.0.20 → 1.0.21
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
|
|
13
|
-
var
|
|
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
|
};
|
|
@@ -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("
|
|
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,
|
|
@@ -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
|
|
12
|
+
var isDisabled = domProps.disabled || domProps.readOnly;
|
|
14
13
|
return (React.createElement("div", { className: "input-group" + (isDisabled ? " input-group-disabled" : "") },
|
|
15
|
-
this.getElement(
|
|
14
|
+
this.getElement("input-group-prepend", inputRef, props.prependText, props.prependIcon, props.prepend),
|
|
16
15
|
element,
|
|
17
|
-
this.getElement(
|
|
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 (
|
|
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
|
|
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
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
|
|
8
|
-
margin-right:
|
|
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
|
}
|