@balena/ui-shared-components 15.2.3-build-material-7-4dc34ee41185e13821a04786ce23979ed0e848da-1 → 15.2.3-build-material-7-9f7114655f479161b14164960ede36fbdc909805-1

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.
@@ -10,7 +10,7 @@ export const ObjectFieldTemplate = (props) => {
10
10
  const { ButtonTemplates: { AddButton }, } = registry.templates;
11
11
  return (_jsxs(_Fragment, { children: [title && (_jsx(TitleFieldTemplate, { id: titleId(fieldPathId), title: title, required: required, schema: schema, uiSchema: uiSchema, registry: registry })), description && (_jsx(DescriptionFieldTemplate, { id: descriptionId(fieldPathId), description: description, schema: schema, uiSchema: uiSchema, registry: registry })), _jsxs(Grid, Object.assign({ container: true, spacing: 2, style: { marginTop: '10px' } }, ((_b = (_a = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['ui:grid']) === null || _a === void 0 ? void 0 : _a.container) !== null && _b !== void 0 ? _b : {}), { children: [properties.map((element, index) => {
12
12
  var _a, _b, _c, _d, _e, _f, _g;
13
- return element.hidden ? (element.content) : (_jsx(Grid, Object.assign({ item: true, xs: 12, sx: { marginBottom: '10px' } }, ((_g = (_e = (_c = (_b = (_a = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema[element.name]) === null || _a === void 0 ? void 0 : _a['ui:grid']) === null || _b === void 0 ? void 0 : _b.item) !== null && _c !== void 0 ? _c : (_d = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['ui:grid']) === null || _d === void 0 ? void 0 : _d[element.name]) !== null && _e !== void 0 ? _e : (_f = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['ui:grid']) === null || _f === void 0 ? void 0 : _f.item) !== null && _g !== void 0 ? _g : {}), { children: element.content }), index));
13
+ return element.hidden ? (element.content) : (_jsx(Grid, Object.assign({ item: true, size: 12, sx: { marginBottom: '10px' } }, ((_g = (_e = (_c = (_b = (_a = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema[element.name]) === null || _a === void 0 ? void 0 : _a['ui:grid']) === null || _b === void 0 ? void 0 : _b.item) !== null && _c !== void 0 ? _c : (_d = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['ui:grid']) === null || _d === void 0 ? void 0 : _d[element.name]) !== null && _e !== void 0 ? _e : (_f = uiSchema === null || uiSchema === void 0 ? void 0 : uiSchema['ui:grid']) === null || _f === void 0 ? void 0 : _f.item) !== null && _g !== void 0 ? _g : {}), { children: element.content }), index));
14
14
  }), canExpand(schema, uiSchema, formData) && (_jsx(Grid, { container: true, justifyContent: "flex-end", children: _jsx(Grid, { children: _jsx(AddButton, { className: "object-property-expand", onClick: onAddProperty,
15
15
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- If `disabled` is false, we still want to disable the button if `readonly` is true
16
16
  disabled: disabled || readonly, uiSchema: uiSchema, registry: registry }) }) }))] }))] }));
@@ -13,15 +13,19 @@ import { findInObject } from '../../utils';
13
13
  import { getRefSchema } from '../../schemaOps';
14
14
  import { DialogWithCloseButton } from '../../../DialogWithCloseButton';
15
15
  import { RJSForm } from '../../../Form';
16
- const ArrayFieldItemTemplate = ({ children, buttonsProps, itemKey, index, totalItems, }) => {
16
+ const ArrayFieldTemplate = ({ items, canAdd, onAddClick, }) => {
17
17
  const { t } = useTranslation();
18
- return (_jsxs(Box, { children: [index > 0 && (_jsx(Typography, { sx: {
18
+ return (_jsxs(Box, { className: "array", children: [items, canAdd && (_jsx(Box, { className: "rjsf-array-item-add", children: _jsx(Button, { "aria-label": t('aria_labels.add_filter_in_or'), variant: "text", color: "primary", onClick: onAddClick, startIcon: _jsx(FontAwesomeIcon, { icon: faPlus }), children: t('actions.add_alternative') }) }))] }));
19
+ };
20
+ const ArrayFieldItemTemplate = ({ children, buttonsProps, itemKey, index, }) => {
21
+ const { t } = useTranslation();
22
+ return (_jsxs(Box, { className: "rjsf-array-item", children: [index > 0 && (_jsx(Typography, { sx: {
19
23
  width: 'calc(100% - 50px)',
20
24
  textAlign: 'center',
21
25
  fontWeight: 'bold',
22
26
  }, children: t('commons.or').toUpperCase() })), _jsxs(Box, { sx: {
23
27
  display: 'flex',
24
- '& .form-group.field.rjsf-field-object': {
28
+ '& .rjsf-field.rjsf-field-object': {
25
29
  display: 'flex',
26
30
  flex: 1,
27
31
  },
@@ -29,10 +33,10 @@ const ArrayFieldItemTemplate = ({ children, buttonsProps, itemKey, index, totalI
29
33
  display: 'none',
30
34
  },
31
35
  // This is necessary to remove the gap of Tags label. RJSF render nested objects with multi label levels.
32
- '.MuiGrid-root > .form-group.field.rjsf-field-object > .MuiFormControl-root > .MuiGrid-root.MuiGrid-container.MuiGrid-spacing-xs-2': {
36
+ '.MuiGrid-root > .rjsf-field.rjsf-field-object > .MuiFormControl-root > .MuiGrid-root.MuiGrid-container.MuiGrid-spacing-xs-2': {
33
37
  marginTop: '-8px!important',
34
38
  },
35
- }, children: [children, _jsx(Box, { display: "flex", width: "50px", alignItems: "center", justifyContent: "center", children: index !== 0 && (_jsx(IconButton, { "aria-label": t('actions.remove_filter'), onClick: buttonsProps.onRemoveItem, sx: { mt: 2 }, children: _jsx(FontAwesomeIcon, { icon: faTimes }) })) })] }), _jsx(Box, { display: "flex", my: 2, children: buttonsProps.canAdd && index === totalItems - 1 && (_jsx(Button, { "aria-label": t('aria_labels.add_filter_in_or'), variant: "text", color: "primary", onClick: buttonsProps.onAddItem, startIcon: _jsx(FontAwesomeIcon, { icon: faPlus }), children: t('actions.add_alternative') })) })] }, itemKey));
39
+ }, children: [children, _jsx(Box, { display: "flex", width: "50px", alignItems: "center", justifyContent: "center", children: index !== 0 && (_jsx(IconButton, { "aria-label": t('actions.remove_filter'), onClick: buttonsProps.onRemoveItem, sx: { mt: 2 }, className: "rjsf-array-item-remove", children: _jsx(FontAwesomeIcon, { icon: faTimes }) })) })] })] }, itemKey));
36
40
  };
37
41
  const widgets = {
38
42
  CheckboxWidget: SelectWidget,
@@ -149,9 +153,9 @@ export const FiltersDialog = ({ schema, data = initialFormData, onClose, }) => {
149
153
  },
150
154
  uiSchema: {
151
155
  'ui:grid': {
152
- field: { xs: 4, sm: 4 },
153
- operator: { xs: 4, sm: 4 },
154
- value: { xs: 4, sm: 4 },
156
+ field: { size: { xs: 4, sm: 4 } },
157
+ operator: { size: { xs: 4, sm: 4 } },
158
+ value: { size: { xs: 4, sm: 4 } },
155
159
  },
156
160
  field: {
157
161
  'ui:readonly': true,
@@ -172,12 +176,13 @@ export const FiltersDialog = ({ schema, data = initialFormData, onClose, }) => {
172
176
  const: key,
173
177
  }));
174
178
  const uiSchema = {
179
+ 'ui:ArrayFieldTemplate': ArrayFieldTemplate,
175
180
  'ui:ArrayFieldItemTemplate': ArrayFieldItemTemplate,
176
181
  items: {
177
182
  'ui:grid': {
178
- field: { xs: 4, sm: 4 },
179
- operator: { xs: 4, sm: 4 },
180
- value: { xs: 4, sm: 4 },
183
+ field: { size: { xs: 4, sm: 4 } },
184
+ operator: { size: { xs: 4, sm: 4 } },
185
+ value: { size: { xs: 4, sm: 4 } },
181
186
  },
182
187
  value: {},
183
188
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/ui-shared-components",
3
- "version": "15.2.3-build-material-7-4dc34ee41185e13821a04786ce23979ed0e848da-1",
3
+ "version": "15.2.3-build-material-7-9f7114655f479161b14164960ede36fbdc909805-1",
4
4
  "main": "./dist/index.js",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -19,8 +19,8 @@
19
19
  "@fortawesome/free-solid-svg-icons": "^7.1.0",
20
20
  "@fortawesome/react-fontawesome": "^3.1.0",
21
21
  "@mui/lab": "7.0.0-beta.14",
22
- "@mui/material": "^7.0.0",
23
- "@mui/styled-engine-sc": "^7.0.0",
22
+ "@mui/material": "^7.3.5",
23
+ "@mui/styled-engine-sc": "^7.3.5",
24
24
  "@mui/x-data-grid": "^7.29.8",
25
25
  "@react-google-maps/api": "^2.18.1",
26
26
  "@rjsf/core": "^6.0.1",
@@ -135,7 +135,7 @@
135
135
  },
136
136
  "homepage": "https://github.com/balena-io/ui-shared-components#readme",
137
137
  "versionist": {
138
- "publishedAt": "2025-11-06T12:57:28.147Z"
138
+ "publishedAt": "2025-11-06T18:04:10.350Z"
139
139
  },
140
140
  "overrides": {
141
141
  "storybook": "$storybook",