@apexcura/ui-components 0.0.16-Beta40 → 0.0.16-Beta42

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/dist/index.js CHANGED
@@ -779,6 +779,7 @@ var { Sider } = import_antd11.Layout;
779
779
  var Sidebar = (props) => {
780
780
  const [collapsed, setCollapsed] = (0, import_react16.useState)(false);
781
781
  const handleChange = (item) => {
782
+ console.log(item);
782
783
  if (props.onChange) {
783
784
  props.onChange(item);
784
785
  }
@@ -786,26 +787,27 @@ var Sidebar = (props) => {
786
787
  function getItem(label, key, icon, children, item) {
787
788
  return {
788
789
  key,
789
- icon: icon ? /* @__PURE__ */ import_react16.default.createElement("span", { className: props.iconsClassName }, icon) : null,
790
+ icon: icon ? /* @__PURE__ */ import_react16.default.createElement("span", { className: props.iconsClassName, style: { filter: "brightness(0) invert(1)" } }, icon) : null,
790
791
  children,
791
792
  label,
792
- onClick: () => handleChange(item || { label, key })
793
+ onClick: () => handleChange(item)
793
794
  };
794
795
  }
795
- const items = (props.items || []).map((eachItem, index) => {
796
+ const items = props.items?.map((eachItem, index) => {
796
797
  return getItem(
797
798
  eachItem.label,
798
799
  index.toString(),
799
- eachItem.icon ? icons[eachItem.icon] || /* @__PURE__ */ import_react16.default.createElement("img", { src: eachItem.icon }) : "",
800
- eachItem.items ? eachItem.items.map(
800
+ eachItem.icon ? icons[eachItem.icon] || /* @__PURE__ */ import_react16.default.createElement("img", { src: eachItem.icon, alt: "" }) : null,
801
+ eachItem.items?.map(
801
802
  (child, childIndex) => getItem(
802
803
  child.label,
803
804
  `${index}-${childIndex}`,
804
- child.icon ? icons[child.icon] || /* @__PURE__ */ import_react16.default.createElement("img", { src: child.icon }) : "",
805
+ child.icon ? icons[child.icon] || /* @__PURE__ */ import_react16.default.createElement("img", { src: child.icon, alt: "" }) : null,
805
806
  void 0,
806
807
  child
807
808
  )
808
- ) : void 0
809
+ ),
810
+ eachItem
809
811
  );
810
812
  });
811
813
  return /* @__PURE__ */ import_react16.default.createElement(import_antd11.Layout, { style: { minHeight: "100vh" } }, /* @__PURE__ */ import_react16.default.createElement(
@@ -820,7 +822,7 @@ var Sidebar = (props) => {
820
822
  import_antd11.Menu,
821
823
  {
822
824
  theme: "dark",
823
- defaultSelectedKeys: ["1"],
825
+ defaultSelectedKeys: ["0"],
824
826
  mode: "inline",
825
827
  items
826
828
  }
package/dist/index.mjs CHANGED
@@ -708,6 +708,7 @@ var { Sider } = Layout;
708
708
  var Sidebar = (props) => {
709
709
  const [collapsed, setCollapsed] = useState5(false);
710
710
  const handleChange = (item) => {
711
+ console.log(item);
711
712
  if (props.onChange) {
712
713
  props.onChange(item);
713
714
  }
@@ -715,26 +716,27 @@ var Sidebar = (props) => {
715
716
  function getItem(label, key, icon, children, item) {
716
717
  return {
717
718
  key,
718
- icon: icon ? /* @__PURE__ */ React15.createElement("span", { className: props.iconsClassName }, icon) : null,
719
+ icon: icon ? /* @__PURE__ */ React15.createElement("span", { className: props.iconsClassName, style: { filter: "brightness(0) invert(1)" } }, icon) : null,
719
720
  children,
720
721
  label,
721
- onClick: () => handleChange(item || { label, key })
722
+ onClick: () => handleChange(item)
722
723
  };
723
724
  }
724
- const items = (props.items || []).map((eachItem, index) => {
725
+ const items = props.items?.map((eachItem, index) => {
725
726
  return getItem(
726
727
  eachItem.label,
727
728
  index.toString(),
728
- eachItem.icon ? icons[eachItem.icon] || /* @__PURE__ */ React15.createElement("img", { src: eachItem.icon }) : "",
729
- eachItem.items ? eachItem.items.map(
729
+ eachItem.icon ? icons[eachItem.icon] || /* @__PURE__ */ React15.createElement("img", { src: eachItem.icon, alt: "" }) : null,
730
+ eachItem.items?.map(
730
731
  (child, childIndex) => getItem(
731
732
  child.label,
732
733
  `${index}-${childIndex}`,
733
- child.icon ? icons[child.icon] || /* @__PURE__ */ React15.createElement("img", { src: child.icon }) : "",
734
+ child.icon ? icons[child.icon] || /* @__PURE__ */ React15.createElement("img", { src: child.icon, alt: "" }) : null,
734
735
  void 0,
735
736
  child
736
737
  )
737
- ) : void 0
738
+ ),
739
+ eachItem
738
740
  );
739
741
  });
740
742
  return /* @__PURE__ */ React15.createElement(Layout, { style: { minHeight: "100vh" } }, /* @__PURE__ */ React15.createElement(
@@ -749,7 +751,7 @@ var Sidebar = (props) => {
749
751
  Menu,
750
752
  {
751
753
  theme: "dark",
752
- defaultSelectedKeys: ["1"],
754
+ defaultSelectedKeys: ["0"],
753
755
  mode: "inline",
754
756
  items
755
757
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.16-Beta40",
3
+ "version": "0.0.16-Beta42",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",