@abgov/jsonforms-components 2.6.7 → 2.6.8

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/index.esm.js CHANGED
@@ -9974,14 +9974,15 @@ const ObjectArrayList = ({
9974
9974
  config,
9975
9975
  enabled,
9976
9976
  cells,
9977
- translations
9977
+ translations,
9978
+ currentTab,
9979
+ setCurrentTab
9978
9980
  }) => {
9979
9981
  const isEmptyList = data === 0;
9980
9982
  const rightRef = useRef(null);
9981
9983
  const current = rightRef.current;
9982
9984
  const minHeight = 300;
9983
9985
  const [rightHeight, setRightHeight] = useState(minHeight);
9984
- const [currentTab, setCurrentTab] = useState(0);
9985
9986
  useEffect(() => {
9986
9987
  const resizeObserver = new ResizeObserver(() => {
9987
9988
  if (rightHeight !== (current === null || current === void 0 ? void 0 : current.offsetHeight) && (current === null || current === void 0 ? void 0 : current.offsetHeight)) setRightHeight((current === null || current === void 0 ? void 0 : current.offsetHeight) > minHeight ? current === null || current === void 0 ? void 0 : current.offsetHeight : minHeight);
@@ -10054,8 +10055,14 @@ class ListWithDetailControl extends React.Component {
10054
10055
  const pathIdValue = (path === null || path === void 0 ? void 0 : path.split('.')) || '';
10055
10056
  if (pathIdValue.length > 1 && +this.props.data >= 0 || pathIdValue.length === 1) {
10056
10057
  this.props.addItem(path, value)();
10058
+ this.setState({
10059
+ currentTab: this.props.data + 1
10060
+ });
10057
10061
  }
10058
10062
  };
10063
+ this.state = {
10064
+ currentTab: 0
10065
+ };
10059
10066
  }
10060
10067
  render() {
10061
10068
  var _a;
@@ -10111,7 +10118,11 @@ class ListWithDetailControl extends React.Component {
10111
10118
  translations: translations,
10112
10119
  data: data,
10113
10120
  cells: cells,
10114
- config: config
10121
+ config: config,
10122
+ currentTab: this.state.currentTab,
10123
+ setCurrentTab: i => this.setState({
10124
+ currentTab: i
10125
+ })
10115
10126
  }, additionalProps))
10116
10127
  })]
10117
10128
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.6.7",
3
+ "version": "2.6.8",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",
@@ -34,6 +34,9 @@ interface NonEmptyRowProps {
34
34
  export declare const NonEmptyList: React.MemoExoticComponent<({ childPath, schema, enabled, cells, uischema, }: NonEmptyRowProps & WithDeleteDialogSupport) => import("react/jsx-runtime").JSX.Element>;
35
35
  export declare class ListWithDetailControl extends React.Component<ObjectArrayControlProps, any> {
36
36
  addItem: (path: string, value: any) => void;
37
+ state: {
38
+ currentTab: number;
39
+ };
37
40
  render(): import("react/jsx-runtime").JSX.Element;
38
41
  }
39
42
  export {};