@jsonforms/material-renderers 3.0.0-beta.3 → 3.0.0-beta.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.
@@ -168,7 +168,7 @@ const TableRows = ({ data, path, schema, openDeleteDialog, moveUp, moveDown, uis
168
168
  const appliedUiSchemaOptions = merge({}, config, uischema.options);
169
169
  return (React.createElement(React.Fragment, null, range(data).map((index) => {
170
170
  const childPath = Paths.compose(path, `${index}`);
171
- return (React.createElement(NonEmptyRow, { key: childPath, childPath: childPath, rowIndex: index, schema: schema, openDeleteDialog: openDeleteDialog, moveUpCreator: moveUp, moveDownCreator: moveDown, enableUp: index !== 0, enableDown: index !== data - 1, showSortButtons: appliedUiSchemaOptions.showSortButtons, enabled: enabled, cells: cells, path: path }));
171
+ return (React.createElement(NonEmptyRow, { key: childPath, childPath: childPath, rowIndex: index, schema: schema, openDeleteDialog: openDeleteDialog, moveUpCreator: moveUp, moveDownCreator: moveDown, enableUp: index !== 0, enableDown: index !== data - 1, showSortButtons: appliedUiSchemaOptions.showSortButtons || appliedUiSchemaOptions.showArrayTableSortButtons, enabled: enabled, cells: cells, path: path }));
172
172
  })));
173
173
  };
174
174
  class MaterialTableControl extends React.Component {
@@ -942,6 +942,7 @@ const ExpandPanelRendererComponent = (props) => {
942
942
  const { childLabel, childPath, index, expanded, moveDown, moveUp, enableMoveDown, enableMoveUp, handleExpansion, removeItems, path, rootSchema, schema, uischema, uischemas, renderers, cells, config } = props;
943
943
  const foundUISchema = useMemo(() => findUISchema(uischemas, schema, uischema.scope, path, undefined, uischema, rootSchema), [uischemas, schema, uischema.scope, path, uischema, rootSchema]);
944
944
  const appliedUiSchemaOptions = merge({}, config, uischema.options);
945
+ const showSortButtons = appliedUiSchemaOptions.showSortButtons || appliedUiSchemaOptions.showArrayLayoutSortButtons;
945
946
  return (React.createElement(Accordion, { "aria-labelledby": labelHtmlId, expanded: expanded, onChange: handleExpansion(childPath) },
946
947
  React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMoreIcon, null) },
947
948
  React.createElement(Grid, { container: true, alignItems: 'center' },
@@ -955,7 +956,7 @@ const ExpandPanelRendererComponent = (props) => {
955
956
  React.createElement(Grid, { container: true, justifyContent: 'flex-end' },
956
957
  React.createElement(Grid, { item: true },
957
958
  React.createElement(Grid, { container: true, direction: 'row', justifyContent: 'center', alignItems: 'center' },
958
- appliedUiSchemaOptions.showSortButtons ? (React.createElement(Fragment, null,
959
+ showSortButtons ? (React.createElement(Fragment, null,
959
960
  React.createElement(Grid, { item: true },
960
961
  React.createElement(IconButton, { onClick: moveUp(path, index), style: iconStyle, disabled: !enableMoveUp, "aria-label": `Move up`, size: 'large' },
961
962
  React.createElement(ArrowUpward, null))),
@@ -1025,12 +1026,12 @@ const MaterialArrayLayoutComponent = (props) => {
1025
1026
  };
1026
1027
  const MaterialArrayLayout$1 = React.memo(MaterialArrayLayoutComponent);
1027
1028
 
1028
- const MaterialArrayLayoutRenderer = ({ visible, enabled, id, uischema, schema, label, rootSchema, renderers, cells, data, path, errors, uischemas, addItem }) => {
1029
+ const MaterialArrayLayoutRenderer = ({ visible, addItem, ...props }) => {
1029
1030
  const addItemCb = useCallback((p, value) => addItem(p, value), [
1030
1031
  addItem
1031
1032
  ]);
1032
1033
  return (React.createElement(Hidden, { xsUp: !visible },
1033
- React.createElement(MaterialArrayLayout$1, { label: label, uischema: uischema, schema: schema, id: id, rootSchema: rootSchema, errors: errors, enabled: enabled, visible: visible, data: data, path: path, addItem: addItemCb, renderers: renderers, cells: cells, uischemas: uischemas })));
1034
+ React.createElement(MaterialArrayLayout$1, Object.assign({ visible: visible, addItem: addItemCb }, props))));
1034
1035
  };
1035
1036
  const materialArrayLayoutTester = rankWith(4, isObjectArrayWithNesting);
1036
1037
  var MaterialArrayLayout = withJsonFormsArrayLayoutProps(MaterialArrayLayoutRenderer);