cloudmr-ux 3.0.8 → 4.0.0

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.
@@ -57,7 +57,7 @@ var CmrCollapse = function (props) {
57
57
  if (Array.isArray(children)) {
58
58
  return children.map(function (child, index) {
59
59
  var panelKey = index;
60
- var expanded = activeKeys.includes(panelKey).toString();
60
+ var expanded = activeKeys.includes(panelKey);
61
61
  // Make header clickable
62
62
  var header = (_jsx("div", __assign({ onClick: function () { return onToggle(panelKey); }, style: { cursor: "pointer" } }, { children: child.props.header })));
63
63
  return (_jsx(React.Fragment, { children: cloneElement(child, {
@@ -7,6 +7,7 @@ interface CmrPanelProps extends React.HTMLAttributes<HTMLDivElement> {
7
7
  onToggle?: (key: number | undefined) => void;
8
8
  expanded?: boolean;
9
9
  cardProps?: React.HTMLAttributes<HTMLDivElement>;
10
+ headerFontWeight?: "normal" | "bold";
10
11
  }
11
12
  declare const CmrPanel: (props: CmrPanelProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export default CmrPanel;
@@ -13,7 +13,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import ArrowDropUpIcon from "@mui/icons-material/ArrowDropUp";
14
14
  import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
15
15
  var CmrPanel = function (props) {
16
- var _a, _b;
16
+ var _a, _b, _c;
17
+ var headerFontWeight = (_a = props.headerFontWeight) !== null && _a !== void 0 ? _a : "normal";
17
18
  var expanded = props.expanded, onToggle = props.onToggle;
18
19
  var toggle = function () {
19
20
  if (onToggle)
@@ -22,16 +23,16 @@ var CmrPanel = function (props) {
22
23
  return (_jsxs("div", __assign({ className: "card ".concat(props.className) }, { children: [_jsx("div", __assign({ className: "card-header", style: {
23
24
  background: "white",
24
25
  display: props.header == undefined ? "none" : undefined
25
- } }, { children: _jsxs("div", __assign({ className: "row align-items-center" }, { children: [_jsx("div", __assign({ className: "col" }, { children: props.header })), onToggle && (_jsx("div", __assign({ className: "col text-end" }, { children: _jsx("span", __assign({ className: "react-collapse float-end btn", onClick: function (e) {
26
+ } }, { children: _jsxs("div", __assign({ className: "row align-items-center" }, { children: [_jsx("div", __assign({ className: "col", style: { fontWeight: headerFontWeight } }, { children: props.header })), onToggle && (_jsx("div", __assign({ className: "col text-end" }, { children: _jsx("span", __assign({ className: "react-collapse float-end btn", onClick: function (e) {
26
27
  toggle();
27
- } }, { children: !expanded ? (_jsx(ArrowDropDownIcon, {})) : (_jsx(ArrowDropUpIcon, {})) })) })))] })) })), !expanded ? (_jsx("div", __assign({ className: "card-body m-0 ".concat(((_a = props.cardProps) === null || _a === void 0 ? void 0 : _a.className) || ""), style: {
28
+ } }, { children: !expanded ? (_jsx(ArrowDropDownIcon, {})) : (_jsx(ArrowDropUpIcon, {})) })) })))] })) })), !expanded ? (_jsx("div", __assign({ className: "card-body m-0 ".concat(((_b = props.cardProps) === null || _b === void 0 ? void 0 : _b.className) || ""), style: {
28
29
  maxHeight: "0",
29
30
  padding: 0,
30
31
  opacity: "0",
31
32
  overflow: "hidden",
32
33
  visibility: "collapse",
33
34
  transition: "all 0.5s"
34
- } }, { children: props.children }))) : (_jsx("div", __assign({ className: "card-body m-4 ".concat(((_b = props.cardProps) === null || _b === void 0 ? void 0 : _b.className) || ""), style: {
35
+ } }, { children: props.children }))) : (_jsx("div", __assign({ className: "card-body m-4 ".concat(((_c = props.cardProps) === null || _c === void 0 ? void 0 : _c.className) || ""), style: {
35
36
  maxHeight: undefined,
36
37
  padding: 0,
37
38
  opacity: "1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudmr-ux",
3
- "version": "3.0.8",
3
+ "version": "4.0.0",
4
4
  "author": "erosmontin@gmail.com",
5
5
  "license": "MIT",
6
6
  "repository": "erosmontin/cloudmr-ux",