@apexcura/ui-components 0.0.16-Beta44 → 0.0.16-Beta45
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 +14 -19
- package/dist/index.mjs +14 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -779,7 +779,6 @@ 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);
|
|
783
782
|
if (props.onChange) {
|
|
784
783
|
props.onChange(item);
|
|
785
784
|
}
|
|
@@ -793,24 +792,20 @@ var Sidebar = (props) => {
|
|
|
793
792
|
onClick: () => handleChange(item)
|
|
794
793
|
};
|
|
795
794
|
}
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
childItems,
|
|
811
|
-
eachItem
|
|
812
|
-
);
|
|
813
|
-
});
|
|
795
|
+
function mapItems(items2, parentKey = "") {
|
|
796
|
+
return items2.map((eachItem, index) => {
|
|
797
|
+
const key = parentKey ? `${parentKey}-${index}` : index.toString();
|
|
798
|
+
const childItems = eachItem.items ? mapItems(eachItem.items, key) : void 0;
|
|
799
|
+
return getItem(
|
|
800
|
+
eachItem.label,
|
|
801
|
+
key,
|
|
802
|
+
eachItem.icon ? icons[eachItem.icon] || /* @__PURE__ */ import_react16.default.createElement("img", { src: eachItem.icon, alt: "" }) : null,
|
|
803
|
+
childItems,
|
|
804
|
+
eachItem
|
|
805
|
+
);
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
const items = props.items ? mapItems(props.items) : [];
|
|
814
809
|
return /* @__PURE__ */ import_react16.default.createElement(import_antd11.Layout, { style: { minHeight: "100vh" } }, /* @__PURE__ */ import_react16.default.createElement(
|
|
815
810
|
Sider,
|
|
816
811
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -708,7 +708,6 @@ var { Sider } = Layout;
|
|
|
708
708
|
var Sidebar = (props) => {
|
|
709
709
|
const [collapsed, setCollapsed] = useState5(false);
|
|
710
710
|
const handleChange = (item) => {
|
|
711
|
-
console.log(item);
|
|
712
711
|
if (props.onChange) {
|
|
713
712
|
props.onChange(item);
|
|
714
713
|
}
|
|
@@ -722,24 +721,20 @@ var Sidebar = (props) => {
|
|
|
722
721
|
onClick: () => handleChange(item)
|
|
723
722
|
};
|
|
724
723
|
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
childItems,
|
|
740
|
-
eachItem
|
|
741
|
-
);
|
|
742
|
-
});
|
|
724
|
+
function mapItems(items2, parentKey = "") {
|
|
725
|
+
return items2.map((eachItem, index) => {
|
|
726
|
+
const key = parentKey ? `${parentKey}-${index}` : index.toString();
|
|
727
|
+
const childItems = eachItem.items ? mapItems(eachItem.items, key) : void 0;
|
|
728
|
+
return getItem(
|
|
729
|
+
eachItem.label,
|
|
730
|
+
key,
|
|
731
|
+
eachItem.icon ? icons[eachItem.icon] || /* @__PURE__ */ React15.createElement("img", { src: eachItem.icon, alt: "" }) : null,
|
|
732
|
+
childItems,
|
|
733
|
+
eachItem
|
|
734
|
+
);
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
const items = props.items ? mapItems(props.items) : [];
|
|
743
738
|
return /* @__PURE__ */ React15.createElement(Layout, { style: { minHeight: "100vh" } }, /* @__PURE__ */ React15.createElement(
|
|
744
739
|
Sider,
|
|
745
740
|
{
|