@geoinsight/react-components 0.4.3 → 0.4.4

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/cjs/index.js CHANGED
@@ -16,8 +16,8 @@ function recursiveChildren(children, i = 0) {
16
16
  return react.cloneElement(child, {
17
17
  ...child.props,
18
18
  children: recursiveChildren(child.props.children, i++),
19
- ...(child?.type?.displayName === "AccordionItem" && {
20
- label: `${child?.type?.displayName}-${index}-${i}`,
19
+ ...(child?.type?.name === "AccordionItem" && {
20
+ label: `${child?.type?.name}-${index}-${i}`,
21
21
  }),
22
22
  });
23
23
  }
@@ -30,7 +30,7 @@ function recursiveToggle(children, toggleArray = {}, i = 0, props) {
30
30
  }
31
31
  for (const child of children) {
32
32
  if (react.isValidElement(child)) {
33
- if (child?.type?.displayName === "AccordionItem" && child.props.label) {
33
+ if (child?.type?.name === "AccordionItem" && child.props.label) {
34
34
  toggleArray[child.props.label] = {
35
35
  isToggle: props.expanded === "all"
36
36
  ? true
@@ -44,7 +44,7 @@ function recursiveToggle(children, toggleArray = {}, i = 0, props) {
44
44
  };
45
45
  }
46
46
  if (typeof child.props.children !== "string" &&
47
- child.props.children.find((v) => v?.type?.displayName === "AccordionItem")) {
47
+ child.props.children.find((v) => v?.type?.name === "AccordionItem")) {
48
48
  recursiveToggle(Array.isArray(child.props.children)
49
49
  ? child.props.children
50
50
  : [child.props.children], toggleArray, i + 1, props);
@@ -85,8 +85,8 @@ function AccordionItem({ children, label, isExpanded = false, }) {
85
85
  paddingLeft: toggle && label && toggle[label].paddingLeft,
86
86
  }, children: react.Children.map(children, (child) => react.cloneElement(child, {
87
87
  toggle: toggle,
88
- setToggle: setToggle,
89
- ...(child?.type?.displayName !== "AccordionItem" && {
88
+ // setToggle: setToggle,
89
+ ...(child?.type?.name !== "AccordionItem" && {
90
90
  label: label,
91
91
  }),
92
92
  isExpanded: isExpanded,
package/dist/esm/index.js CHANGED
@@ -14,8 +14,8 @@ function recursiveChildren(children, i = 0) {
14
14
  return cloneElement(child, {
15
15
  ...child.props,
16
16
  children: recursiveChildren(child.props.children, i++),
17
- ...(child?.type?.displayName === "AccordionItem" && {
18
- label: `${child?.type?.displayName}-${index}-${i}`,
17
+ ...(child?.type?.name === "AccordionItem" && {
18
+ label: `${child?.type?.name}-${index}-${i}`,
19
19
  }),
20
20
  });
21
21
  }
@@ -28,7 +28,7 @@ function recursiveToggle(children, toggleArray = {}, i = 0, props) {
28
28
  }
29
29
  for (const child of children) {
30
30
  if (isValidElement(child)) {
31
- if (child?.type?.displayName === "AccordionItem" && child.props.label) {
31
+ if (child?.type?.name === "AccordionItem" && child.props.label) {
32
32
  toggleArray[child.props.label] = {
33
33
  isToggle: props.expanded === "all"
34
34
  ? true
@@ -42,7 +42,7 @@ function recursiveToggle(children, toggleArray = {}, i = 0, props) {
42
42
  };
43
43
  }
44
44
  if (typeof child.props.children !== "string" &&
45
- child.props.children.find((v) => v?.type?.displayName === "AccordionItem")) {
45
+ child.props.children.find((v) => v?.type?.name === "AccordionItem")) {
46
46
  recursiveToggle(Array.isArray(child.props.children)
47
47
  ? child.props.children
48
48
  : [child.props.children], toggleArray, i + 1, props);
@@ -83,8 +83,8 @@ function AccordionItem({ children, label, isExpanded = false, }) {
83
83
  paddingLeft: toggle && label && toggle[label].paddingLeft,
84
84
  }, children: Children.map(children, (child) => cloneElement(child, {
85
85
  toggle: toggle,
86
- setToggle: setToggle,
87
- ...(child?.type?.displayName !== "AccordionItem" && {
86
+ // setToggle: setToggle,
87
+ ...(child?.type?.name !== "AccordionItem" && {
88
88
  label: label,
89
89
  }),
90
90
  isExpanded: isExpanded,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoinsight/react-components",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "This library is the main UI component library for geoinsight",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",