@evoke-platform/ui-components 1.0.0-dev.226 → 1.0.0-dev.228

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.
Files changed (202) hide show
  1. package/dist/published/components/core/Accordion/Accordion.js +1 -1
  2. package/dist/published/components/core/Accordion/AccordionActions/AccordionActions.js +1 -1
  3. package/dist/published/components/core/Accordion/AccordionDetails/AccordionDetails.js +1 -1
  4. package/dist/published/components/core/Accordion/AccordionSummary/AccordionSummary.js +1 -1
  5. package/dist/published/components/core/Alert/Alert.js +8 -9
  6. package/dist/published/components/core/AlertTitle/AlertTitle.js +1 -1
  7. package/dist/published/components/core/AppBar/AppBar.js +1 -1
  8. package/dist/published/components/core/Autocomplete/Autocomplete.js +33 -15
  9. package/dist/published/components/core/Autocomplete/Autocomplete.test.js +1 -1
  10. package/dist/published/components/core/Avatar/Avatar.js +7 -4
  11. package/dist/published/components/core/Backdrop/Backdrop.js +1 -1
  12. package/dist/published/components/core/Badge/Badge.js +1 -1
  13. package/dist/published/components/core/Breadcrumbs/Breadcrumbs.js +1 -1
  14. package/dist/published/components/core/Button/Button.js +1 -1
  15. package/dist/published/components/core/ButtonGroup/ButtonGroup.js +1 -1
  16. package/dist/published/components/core/Card/Card.js +1 -1
  17. package/dist/published/components/core/Checkbox/Checkbox.js +1 -1
  18. package/dist/published/components/core/Chip/Chip.js +1 -1
  19. package/dist/published/components/core/CircularProgress/CircularProgress.js +1 -1
  20. package/dist/published/components/core/Collapse/Collapse.js +1 -1
  21. package/dist/published/components/core/DatePicker/DatePicker.js +4 -16
  22. package/dist/published/components/core/DateTimePicker/DateTimePicker.js +3 -15
  23. package/dist/published/components/core/Dialog/Dialog.js +1 -1
  24. package/dist/published/components/core/Dialog/DialogActions/DialogActions.js +2 -13
  25. package/dist/published/components/core/Dialog/DialogContent/DialogContent.js +1 -1
  26. package/dist/published/components/core/Dialog/DialogContentText/DialogContentText.js +1 -1
  27. package/dist/published/components/core/Dialog/DialogTitle/DialogTitle.js +1 -1
  28. package/dist/published/components/core/Divider/Divider.js +1 -1
  29. package/dist/published/components/core/Drawer/Drawer.js +1 -1
  30. package/dist/published/components/core/FieldError/FieldError.js +1 -2
  31. package/dist/published/components/core/FormElements/FormControl/FormControl.js +1 -1
  32. package/dist/published/components/core/FormElements/FormControlLabel/FormControlLabel.js +1 -1
  33. package/dist/published/components/core/FormElements/FormGroup/FormGroup.js +1 -1
  34. package/dist/published/components/core/FormElements/FormHelperText/FormHelperText.js +1 -1
  35. package/dist/published/components/core/FormElements/FormLabel/FormLabel.js +1 -1
  36. package/dist/published/components/core/IconButton/IconButton.js +1 -1
  37. package/dist/published/components/core/LinearProgress/LinearProgress.js +1 -1
  38. package/dist/published/components/core/Link/Link.js +1 -1
  39. package/dist/published/components/core/List/List.js +1 -1
  40. package/dist/published/components/core/List/ListItem.js +1 -1
  41. package/dist/published/components/core/List/ListItemText/ListItemText.js +1 -1
  42. package/dist/published/components/core/LoadingButton/LoadingButton.js +1 -1
  43. package/dist/published/components/core/LocalizationProvider/LocalizationProvider.js +3 -14
  44. package/dist/published/components/core/Menu/Menu.js +1 -1
  45. package/dist/published/components/core/Menu/MenuItem/MenuItem.js +1 -1
  46. package/dist/published/components/core/Paper/Paper.js +1 -1
  47. package/dist/published/components/core/Popover/Popover.js +1 -1
  48. package/dist/published/components/core/Popper/Popper.js +1 -1
  49. package/dist/published/components/core/RadioGroup/Radio.js +1 -1
  50. package/dist/published/components/core/RadioGroup/RadioGroup.js +1 -1
  51. package/dist/published/components/core/Select/Select.js +11 -4
  52. package/dist/published/components/core/Skeleton/Skeleton.js +1 -1
  53. package/dist/published/components/core/Snackbar/Snackbar.js +2 -2
  54. package/dist/published/components/core/StaticDatePicker/StaticDatePicker.js +3 -15
  55. package/dist/published/components/core/Stepper/Step/Step.js +1 -1
  56. package/dist/published/components/core/Stepper/StepButton/StepButton.js +1 -1
  57. package/dist/published/components/core/Stepper/StepConnector/StepConnector.js +1 -1
  58. package/dist/published/components/core/Stepper/StepContent/StepContent.js +1 -1
  59. package/dist/published/components/core/Stepper/StepIcon/StepIcon.js +1 -1
  60. package/dist/published/components/core/Stepper/StepLabel/StepLabel.js +1 -1
  61. package/dist/published/components/core/Stepper/Stepper.js +1 -1
  62. package/dist/published/components/core/Switch/Switch.js +1 -1
  63. package/dist/published/components/core/Table/Table.js +1 -1
  64. package/dist/published/components/core/Tabs/Tab/Tab.js +1 -1
  65. package/dist/published/components/core/Tabs/Tabs.js +1 -1
  66. package/dist/published/components/core/TextField/TextField.js +12 -6
  67. package/dist/published/components/core/ToggleButton/ToggleButton.js +1 -1
  68. package/dist/published/components/core/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
  69. package/dist/published/components/core/Tooltip/Tooltip.js +15 -2
  70. package/dist/published/components/core/Typography/index.js +1 -1
  71. package/dist/published/components/custom/BuilderGrid/BuilderGrid.js +33 -29
  72. package/dist/published/components/custom/BuilderGrid/BuilderGridToolbar.js +1 -2
  73. package/dist/published/components/custom/BuilderGrid/EmptyContent.js +4 -5
  74. package/dist/published/components/custom/BuilderGrid/EmptyContentIllustration.js +6 -1
  75. package/dist/published/components/custom/BuilderGrid/ToolbarActions.js +3 -1
  76. package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.js +46 -27
  77. package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.test.js +12 -21
  78. package/dist/published/components/custom/CriteriaBuilder/ValueEditor.js +27 -34
  79. package/dist/published/components/custom/DataGrid/DataGrid.js +38 -33
  80. package/dist/published/components/custom/DataGrid/DateTimeCustomOperator.js +3 -5
  81. package/dist/published/components/custom/DataGrid/Toolbar.js +3 -4
  82. package/dist/published/components/custom/ErrorComponent/ErrorComponent.js +11 -1
  83. package/dist/published/components/custom/Form/Common/Form.js +106 -80
  84. package/dist/published/components/custom/Form/Common/FormComponentWrapper.js +20 -11
  85. package/dist/published/components/custom/Form/FormComponents/ButtonComponent.js +9 -20
  86. package/dist/published/components/custom/Form/FormComponents/DocumentComponent/Document.js +10 -20
  87. package/dist/published/components/custom/Form/FormComponents/DocumentComponent/DocumentComponent.js +24 -28
  88. package/dist/published/components/custom/Form/FormComponents/DocumentComponent/DocumentList.js +49 -64
  89. package/dist/published/components/custom/Form/FormComponents/FormFieldComponent.d.ts +1 -0
  90. package/dist/published/components/custom/Form/FormComponents/FormFieldComponent.js +109 -34
  91. package/dist/published/components/custom/Form/FormComponents/ImageComponent/Image.d.ts +2 -0
  92. package/dist/published/components/custom/Form/FormComponents/ImageComponent/Image.js +13 -25
  93. package/dist/published/components/custom/Form/FormComponents/ImageComponent/ImageComponent.d.ts +3 -1
  94. package/dist/published/components/custom/Form/FormComponents/ImageComponent/ImageComponent.js +30 -9
  95. package/dist/published/components/custom/Form/FormComponents/ObjectComponent/InstanceLookup.js +26 -31
  96. package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.d.ts +5 -4
  97. package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.js +70 -22
  98. package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectPropertyInput.js +93 -75
  99. package/dist/published/components/custom/Form/FormComponents/ObjectComponent/RelatedObjectInstance.d.ts +2 -2
  100. package/dist/published/components/custom/Form/FormComponents/ObjectComponent/RelatedObjectInstance.js +17 -26
  101. package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ActionDialog.js +20 -24
  102. package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ManyToMany/DropdownRepeatableField.js +22 -33
  103. package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ManyToMany/DropdownRepeatableFieldInput.js +12 -9
  104. package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableField.js +105 -82
  105. package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableFieldComponent.js +8 -6
  106. package/dist/published/components/custom/Form/FormComponents/UserComponent/UserComponent.d.ts +3 -1
  107. package/dist/published/components/custom/Form/FormComponents/UserComponent/UserComponent.js +55 -12
  108. package/dist/published/components/custom/Form/FormComponents/UserComponent/UserProperty.js +32 -30
  109. package/dist/published/components/custom/Form/FormComponents/ViewOnlyComponent.js +12 -9
  110. package/dist/published/components/custom/Form/types.d.ts +5 -5
  111. package/dist/published/components/custom/Form/utils.js +611 -446
  112. package/dist/published/components/custom/FormField/AddressFieldComponent/AddressFieldComponent.test.js +41 -54
  113. package/dist/published/components/custom/FormField/AddressFieldComponent/addressFieldComponent.js +7 -8
  114. package/dist/published/components/custom/FormField/BooleanSelect/BooleanSelect.js +1 -1
  115. package/dist/published/components/custom/FormField/BooleanSelect/BooleanSelect.test.js +5 -14
  116. package/dist/published/components/custom/FormField/DatePickerSelect/DatePickerSelect.js +2 -2
  117. package/dist/published/components/custom/FormField/DatePickerSelect/DatePickerSelect.test.js +12 -21
  118. package/dist/published/components/custom/FormField/DateTimePickerSelect/DateTimePickerSelect.js +2 -2
  119. package/dist/published/components/custom/FormField/DateTimePickerSelect/DateTimePickerSelect.test.js +12 -21
  120. package/dist/published/components/custom/FormField/FileUpload/FileUpload.js +10 -11
  121. package/dist/published/components/custom/FormField/FormField.js +10 -10
  122. package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.js +22 -30
  123. package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.test.js +8 -17
  124. package/dist/published/components/custom/FormField/Select/Select.js +5 -6
  125. package/dist/published/components/custom/FormField/Select/Select.test.js +18 -27
  126. package/dist/published/components/custom/FormField/TimePickerSelect/TimePickerSelect.js +4 -4
  127. package/dist/published/components/custom/HistoryLog/DisplayedProperty.js +12 -13
  128. package/dist/published/components/custom/HistoryLog/HistoryData.js +49 -45
  129. package/dist/published/components/custom/HistoryLog/HistoryLoading.js +5 -5
  130. package/dist/published/components/custom/HistoryLog/index.js +5 -6
  131. package/dist/published/components/custom/Menubar/Menubar.js +2 -2
  132. package/dist/published/components/custom/MultiSelect/MultiSelect.js +38 -50
  133. package/dist/published/components/custom/MultiSelect/SortableItem.js +1 -1
  134. package/dist/published/components/custom/RepeatableField/RepeatableField.js +14 -16
  135. package/dist/published/components/custom/UserAvatar/UserAvatar.js +12 -5
  136. package/dist/published/components/custom/util.js +1 -1
  137. package/dist/published/components/layout/Box/Box.js +1 -1
  138. package/dist/published/components/layout/Container/Container.js +1 -1
  139. package/dist/published/components/layout/Grid/Grid.js +1 -1
  140. package/dist/published/components/layout/Stack/Stack.js +1 -1
  141. package/dist/published/icons/custom/FileWithExtension.js +8 -4
  142. package/dist/published/icons/custom/Inherited.js +8 -6
  143. package/dist/published/icons/custom/Overrides.js +9 -7
  144. package/dist/published/icons/custom/TrashCan.js +10 -8
  145. package/dist/published/icons/custom/UploadCloud.js +9 -7
  146. package/dist/published/stories/Accordion.stories.js +2 -2
  147. package/dist/published/stories/Alert.stories.js +1 -1
  148. package/dist/published/stories/AlertTitle.stories.js +1 -1
  149. package/dist/published/stories/Autocomplete.stories.js +2 -2
  150. package/dist/published/stories/Avatar.stories.js +1 -1
  151. package/dist/published/stories/Backdrop.stories.js +1 -1
  152. package/dist/published/stories/Badge.stories.js +1 -1
  153. package/dist/published/stories/Box.stories.js +2 -2
  154. package/dist/published/stories/Breadcrumbs.stories.js +1 -1
  155. package/dist/published/stories/Button.stories.js +1 -1
  156. package/dist/published/stories/ButtonGroup.stories.js +1 -1
  157. package/dist/published/stories/Card.stories.js +1 -1
  158. package/dist/published/stories/Checkbox.stories.js +1 -1
  159. package/dist/published/stories/Chip.stories.js +1 -1
  160. package/dist/published/stories/CircularProgress.stories.js +1 -1
  161. package/dist/published/stories/Collapse.stories.js +1 -1
  162. package/dist/published/stories/Container.stories.js +1 -1
  163. package/dist/published/stories/CriteriaBuilder.stories.js +7 -3
  164. package/dist/published/stories/DataGrid.stories.js +3 -3
  165. package/dist/published/stories/DatePicker.stories.js +3 -14
  166. package/dist/published/stories/Dialog.stories.js +1 -1
  167. package/dist/published/stories/Divider.stories.js +1 -1
  168. package/dist/published/stories/Drawer.stories.js +2 -2
  169. package/dist/published/stories/FormControl.stories.js +1 -1
  170. package/dist/published/stories/FormControlLabel.stories.js +1 -1
  171. package/dist/published/stories/FormField.stories.js +3 -12
  172. package/dist/published/stories/FormGroup.stories.js +1 -1
  173. package/dist/published/stories/FormHelperText.stories.js +1 -1
  174. package/dist/published/stories/FormLabel.stories.js +1 -1
  175. package/dist/published/stories/Grid.stories.js +1 -1
  176. package/dist/published/stories/HistoryLog.stories.js +1 -1
  177. package/dist/published/stories/IconButton.stories.js +4 -4
  178. package/dist/published/stories/LinearProgress.stories.js +1 -1
  179. package/dist/published/stories/Link.stories.js +1 -1
  180. package/dist/published/stories/List.stories.js +2 -2
  181. package/dist/published/stories/Menu.stories.js +2 -2
  182. package/dist/published/stories/MenuBar.stories.js +1 -1
  183. package/dist/published/stories/MultiSelect.stories.js +3 -3
  184. package/dist/published/stories/Palette.stories.js +11 -11
  185. package/dist/published/stories/Paper.stories.js +1 -1
  186. package/dist/published/stories/RadioGroup.stories.js +1 -1
  187. package/dist/published/stories/RepeatableField.stories.js +6 -7
  188. package/dist/published/stories/RichTextViewer.stories.js +1 -1
  189. package/dist/published/stories/Skeleton.stories.js +1 -1
  190. package/dist/published/stories/Snackbar.stories.js +1 -1
  191. package/dist/published/stories/Stack.stories.js +1 -1
  192. package/dist/published/stories/StaticDatePicker.stories.js +3 -14
  193. package/dist/published/stories/Stepper.stories.js +3 -3
  194. package/dist/published/stories/Switch.stories.js +1 -1
  195. package/dist/published/stories/Table.stories.js +2 -2
  196. package/dist/published/stories/Tabs.stories.js +6 -17
  197. package/dist/published/stories/TextField.stories.js +1 -1
  198. package/dist/published/stories/TimePicker.stories.js +3 -14
  199. package/dist/published/stories/TimePickerSelect.stories.js +3 -14
  200. package/dist/published/stories/ToggleButton.stories.js +4 -4
  201. package/dist/published/theme/UIThemeProvider.js +1 -2
  202. package/package.json +1 -1
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
2
2
  import { Autocomplete, TextField } from '../../../core';
3
3
  import InputFieldComponent from '../InputFieldComponent/InputFieldComponent';
4
4
  const Select = (props) => {
5
- var _a, _b;
6
5
  const { id, property, defaultValue, error, errorMessage, onBlur, readOnly, selectOptions, required, size, isOptionEqualToValue, renderOption, getOptionLabel, disableCloseOnSelect, additionalProps, } = props;
7
6
  const [value, setValue] = useState(defaultValue);
8
7
  const [inputValue, setInputValue] = useState('');
@@ -12,8 +11,8 @@ const Select = (props) => {
12
11
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
12
  const handleChange = (event, selected) => {
14
13
  if (Array.isArray(selected)) {
15
- setValue(selected.map((option) => { var _a; return (_a = option.value) !== null && _a !== void 0 ? _a : option; }));
16
- props.onChange(property.id, selected.map((option) => { var _a; return (_a = option.value) !== null && _a !== void 0 ? _a : option; }), property);
14
+ setValue(selected.map((option) => option.value ?? option));
15
+ props.onChange(property.id, selected.map((option) => option.value ?? option), property);
17
16
  }
18
17
  else {
19
18
  setValue(selected);
@@ -23,16 +22,16 @@ const Select = (props) => {
23
22
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
23
  const handleInputValueChange = (event, selectValue) => {
25
24
  if (Array.isArray(selectValue)) {
26
- setValue(selectValue.map((item) => { var _a; return (_a = item.value) !== null && _a !== void 0 ? _a : item; }));
25
+ setValue(selectValue.map((item) => item.value ?? item));
27
26
  }
28
27
  else {
29
28
  setInputValue(selectValue);
30
29
  }
31
30
  };
32
- return readOnly ? (React.createElement(InputFieldComponent, Object.assign({}, props))) : (React.createElement(Autocomplete, Object.assign({ multiple: (property === null || property === void 0 ? void 0 : property.type) === 'array' ? true : false, id: id, renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { value: value, fullWidth: true, onBlur: onBlur }))), value: value !== null && value !== void 0 ? value : ((property === null || property === void 0 ? void 0 : property.type) === 'array' ? [] : undefined), onChange: handleChange, options: (_b = (_a = selectOptions) !== null && _a !== void 0 ? _a : property === null || property === void 0 ? void 0 : property.enum) !== null && _b !== void 0 ? _b : [], disableClearable: true, inputValue: inputValue !== null && inputValue !== void 0 ? inputValue : '', error: error, errorMessage: errorMessage, required: required, onInputChange: handleInputValueChange, size: size, isOptionEqualToValue: isOptionEqualToValue
31
+ return readOnly ? (React.createElement(InputFieldComponent, { ...props })) : (React.createElement(Autocomplete, { multiple: property?.type === 'array' ? true : false, id: id, renderInput: (params) => (React.createElement(TextField, { ...params, value: value, fullWidth: true, onBlur: onBlur })), value: value ?? (property?.type === 'array' ? [] : undefined), onChange: handleChange, options: selectOptions ?? property?.enum ?? [], disableClearable: true, inputValue: inputValue ?? '', error: error, errorMessage: errorMessage, required: required, onInputChange: handleInputValueChange, size: size, isOptionEqualToValue: isOptionEqualToValue
33
32
  ? (option, value) => isOptionEqualToValue(option, value)
34
33
  : undefined, getOptionLabel: getOptionLabel ? (option) => getOptionLabel(option) : undefined, renderOption: renderOption
35
34
  ? (props, option, state) => renderOption(props, option, state)
36
- : undefined, disableCloseOnSelect: disableCloseOnSelect }, (additionalProps !== null && additionalProps !== void 0 ? additionalProps : {}))));
35
+ : undefined, disableCloseOnSelect: disableCloseOnSelect, ...(additionalProps ?? {}) }));
37
36
  };
38
37
  export default Select;
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import '@testing-library/jest-dom/extend-expect';
11
2
  import { render, screen } from '@testing-library/react';
12
3
  import { userEvent } from '@testing-library/user-event';
@@ -20,27 +11,27 @@ describe('Single select', () => {
20
11
  name: 'Select Options',
21
12
  type: 'choices',
22
13
  };
23
- test('returns selected option', () => __awaiter(void 0, void 0, void 0, function* () {
14
+ test('returns selected option', async () => {
24
15
  const user = userEvent.setup();
25
16
  const onChangeMock = jest.fn((name, value, property) => { });
26
17
  const options = ['option 1', 'option 2', 'option 3'];
27
18
  render(React.createElement(Select, { id: "testSelect", property: choiceProperty, selectOptions: options, onChange: onChangeMock }));
28
19
  const input = screen.getByRole('combobox');
29
- yield user.click(input);
30
- const option2 = yield screen.findByRole('option', { name: 'option 2' });
31
- yield user.click(option2);
20
+ await user.click(input);
21
+ const option2 = await screen.findByRole('option', { name: 'option 2' });
22
+ await user.click(option2);
32
23
  expect(onChangeMock).toBeCalledWith('selectOptions', expect.objectContaining({ label: 'option 2', value: 'option 2' }), choiceProperty);
33
- }));
34
- test('displays matching options', () => __awaiter(void 0, void 0, void 0, function* () {
24
+ });
25
+ test('displays matching options', async () => {
35
26
  const user = userEvent.setup();
36
27
  const options = ['option 1', 'option 2', 'something different'];
37
28
  render(React.createElement(Select, { id: "testSelect", property: choiceProperty, selectOptions: options, onChange: () => { } }));
38
29
  const input = screen.getByRole('combobox');
39
- yield user.type(input, 'option');
40
- yield screen.findByRole('option', { name: 'option 1' });
41
- yield screen.findByRole('option', { name: 'option 2' });
30
+ await user.type(input, 'option');
31
+ await screen.findByRole('option', { name: 'option 1' });
32
+ await screen.findByRole('option', { name: 'option 2' });
42
33
  expect(screen.queryByRole('option', { name: 'something different' })).not.toBeInTheDocument();
43
- }));
34
+ });
44
35
  });
45
36
  describe('Multi select', () => {
46
37
  // Right now an object property is required for this to function, but eventually this should go
@@ -50,19 +41,19 @@ describe('Multi select', () => {
50
41
  name: 'Select Multiple',
51
42
  type: 'array',
52
43
  };
53
- test('returns selected options', () => __awaiter(void 0, void 0, void 0, function* () {
44
+ test('returns selected options', async () => {
54
45
  const user = userEvent.setup();
55
46
  const onChangeMock = jest.fn((name, value, property) => { });
56
47
  const options = ['option 1', 'option 2', 'option 3'];
57
48
  render(React.createElement(Select, { id: "testSelect", property: multiChoiceProperty, selectOptions: options, onChange: onChangeMock }));
58
49
  const input = screen.getByRole('combobox');
59
- yield user.click(input);
60
- const option2 = yield screen.findByRole('option', { name: 'option 2' });
61
- yield user.click(option2);
62
- yield user.click(input); // selecting option closes the dropdown, re-open the options
63
- const option3 = yield screen.findByRole('option', { name: 'option 3' });
64
- yield user.click(option3);
50
+ await user.click(input);
51
+ const option2 = await screen.findByRole('option', { name: 'option 2' });
52
+ await user.click(option2);
53
+ await user.click(input); // selecting option closes the dropdown, re-open the options
54
+ const option3 = await screen.findByRole('option', { name: 'option 3' });
55
+ await user.click(option3);
65
56
  expect(onChangeMock).toBeCalledTimes(2);
66
57
  expect(onChangeMock).lastCalledWith('multiSelect', ['option 2', 'option 3'], multiChoiceProperty);
67
- }));
58
+ });
68
59
  });
@@ -29,9 +29,9 @@ const TimePickerSelect = (props) => {
29
29
  }
30
30
  else if (date instanceof LocalDateTime) {
31
31
  setValue(date);
32
- const hour = padStart(date === null || date === void 0 ? void 0 : date.hour().toString(), 2, '0');
33
- const minute = padStart(date === null || date === void 0 ? void 0 : date.minute().toString(), 2, '0');
34
- const second = padStart(date === null || date === void 0 ? void 0 : date.second().toString(), 2, '0');
32
+ const hour = padStart(date?.hour().toString(), 2, '0');
33
+ const minute = padStart(date?.minute().toString(), 2, '0');
34
+ const second = padStart(date?.second().toString(), 2, '0');
35
35
  props.onChange(property.id, `${hour}:${minute}:${second}`, property);
36
36
  }
37
37
  else {
@@ -40,6 +40,6 @@ const TimePickerSelect = (props) => {
40
40
  }
41
41
  };
42
42
  return (React.createElement(LocalizationProvider, null,
43
- React.createElement(TimePicker, { value: value, onChange: handleChange, renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { id: id, error: error, errorMessage: errorMessage, onBlur: onBlur, fullWidth: true, required: required, sx: { background: 'white', borderRadius: '8px' }, size: size !== null && size !== void 0 ? size : 'medium', placeholder: placeholder, readOnly: readOnly }, (additionalProps !== null && additionalProps !== void 0 ? additionalProps : {})))), readOnly: readOnly })));
43
+ React.createElement(TimePicker, { value: value, onChange: handleChange, renderInput: (params) => (React.createElement(TextField, { ...params, id: id, error: error, errorMessage: errorMessage, onBlur: onBlur, fullWidth: true, required: required, sx: { background: 'white', borderRadius: '8px' }, size: size ?? 'medium', placeholder: placeholder, readOnly: readOnly, ...(additionalProps ?? {}) })), readOnly: readOnly })));
44
44
  };
45
45
  export default TimePickerSelect;
@@ -7,37 +7,36 @@ const DisplayedProperty = (props) => {
7
7
  const { property, value } = props;
8
8
  const getAddressAsString = (address) => {
9
9
  let stringAddress = '';
10
- if (address === null || address === void 0 ? void 0 : address.line1)
10
+ if (address?.line1)
11
11
  stringAddress = stringAddress.concat(address.line1);
12
- if (address === null || address === void 0 ? void 0 : address.line2)
12
+ if (address?.line2)
13
13
  stringAddress = stringAddress ? stringAddress.concat(' ' + address.line2) : address.line2;
14
- if (address === null || address === void 0 ? void 0 : address.city)
14
+ if (address?.city)
15
15
  stringAddress = stringAddress ? stringAddress.concat(', ' + address.city) : address.city;
16
- if (address === null || address === void 0 ? void 0 : address.county)
16
+ if (address?.county)
17
17
  stringAddress = stringAddress ? stringAddress.concat(', ' + address.county) : address.county;
18
- if (address === null || address === void 0 ? void 0 : address.state)
18
+ if (address?.state)
19
19
  stringAddress = stringAddress ? stringAddress.concat(', ' + address.state) : address.state;
20
- if (address === null || address === void 0 ? void 0 : address.zipCode)
20
+ if (address?.zipCode)
21
21
  stringAddress = stringAddress ? stringAddress.concat(' ' + address.zipCode) : address.zipCode;
22
22
  return stringAddress;
23
23
  };
24
24
  const formatData = (property, value) => {
25
- var _a, _b;
26
- if (property === null || property === void 0 ? void 0 : property.objectId) {
27
- return (_a = value === null || value === void 0 ? void 0 : value.name) !== null && _a !== void 0 ? _a : value === null || value === void 0 ? void 0 : value.id;
25
+ if (property?.objectId) {
26
+ return value?.name ?? value?.id;
28
27
  }
29
- switch (property === null || property === void 0 ? void 0 : property.type) {
28
+ switch (property?.type) {
30
29
  case 'string':
31
30
  case 'boolean':
32
31
  case 'number':
33
32
  case 'integer':
34
- return value === null || value === void 0 ? void 0 : value.toString();
33
+ return value?.toString();
35
34
  case 'array':
36
- return value === null || value === void 0 ? void 0 : value.toString().replaceAll(',', ', ');
35
+ return value?.toString().replaceAll(',', ', ');
37
36
  case 'address':
38
37
  return getAddressAsString(value);
39
38
  case 'user':
40
- return (_b = value === null || value === void 0 ? void 0 : value.name) !== null && _b !== void 0 ? _b : value === null || value === void 0 ? void 0 : value.id;
39
+ return value?.name ?? value?.id;
41
40
  case 'time':
42
41
  return value
43
42
  ? DateTime.fromISO(DateTime.now().toISODate() + 'T' + value).toFormat('hh:mm a')
@@ -32,52 +32,56 @@ const styles = {
32
32
  const HistoricalData = (props) => {
33
33
  const { records, documentHistory, object } = props;
34
34
  const getPastDocumentVersion = (history) => {
35
- var _a, _b, _c;
36
- const documentVersions = (_c = documentHistory === null || documentHistory === void 0 ? void 0 : documentHistory[(_b = (_a = history.subject) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 'unknown']) !== null && _c !== void 0 ? _c : [];
37
- const currentVersion = documentVersions === null || documentVersions === void 0 ? void 0 : documentVersions.map((v) => v.timestamp).indexOf(history.timestamp);
35
+ const documentVersions = documentHistory?.[history.subject?.id ?? 'unknown'] ?? [];
36
+ const currentVersion = documentVersions?.map((v) => v.timestamp).indexOf(history.timestamp);
38
37
  return currentVersion ? documentVersions[currentVersion - 1] : undefined;
39
38
  };
40
- return (React.createElement(Box, { sx: styles.timelineConnector }, records.map((r) => {
41
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
42
- return (React.createElement(Box, { margin: '16px 0px', key: `${r.timestamp}-${nanoid()}` },
43
- React.createElement(Box, { sx: { display: 'flex', justifyContent: 'space-between' } },
44
- React.createElement(Box, { sx: { display: 'flex', maxWidth: '60%', alignContent: 'flex-start' } },
45
- React.createElement(Typography, { sx: { fontSize: '12px', color: '#637381' } },
46
- React.createElement(Typography, { component: 'span', sx: { fontWeight: 600, fontSize: '12px' } }, (_a = r.user.name) !== null && _a !== void 0 ? _a : 'Unknown User'),
47
- "\u00A0",
48
- ['document', 'correspondence'].includes(r.type) ? lowerCase(r.event) : `- ${r.event}`)),
49
- React.createElement(Box, null,
50
- React.createElement(Typography, { sx: { fontSize: '12px', color: '#637381' } }, new Date(r.timestamp).getHours() === 12
51
- ? format(new Date(r.timestamp), 'MMM dd, yyyy H:mm a')
52
- : format(new Date(r.timestamp), 'MMM dd, yyyy h:mm a')))),
53
- ((r.data && r.eventType !== 'create' && r.type === 'instance') ||
54
- ['document', 'correspondence'].includes(r.type)) && (React.createElement(Box, { sx: {
55
- backgroundColor: '#F4F6F8',
56
- borderRadius: '4px',
57
- paddingTop: ((_b = r.data) === null || _b === void 0 ? void 0 : _b.length) ? '4px' : '0px',
58
- paddingBottom: ((_c = r.data) === null || _c === void 0 ? void 0 : _c.length) ? '4px' : '0px',
59
- } },
60
- r.type === 'instance' && r.data && (React.createElement(Box, null, r.data.map((d) => {
61
- var _a;
62
- const property = (_a = object.properties) === null || _a === void 0 ? void 0 : _a.find((p) => p.id === d.property);
63
- return (property && (React.createElement(Grid, { container: true, key: property.id, display: "flex", gridTemplateColumns: 'fit-content(25%) fit-content(80%) fit-content(2%) fit-content(80%)', alignItems: "flex-start", justifyContent: "center", sx: {
64
- overflowWrap: 'break-word',
65
- } },
66
- React.createElement(Grid, { item: true, xs: 2 },
67
- React.createElement(Typography, { sx: Object.assign(Object.assign({}, styles.historyData), { fontWeight: 600, minWidth: 'fit-content', alignSelf: 'flex-start' }) }, property.name)),
68
- React.createElement(DisplayedProperty, { property: property, value: d.historicalValue }),
69
- React.createElement(Grid, { item: true, xs: 0.5 },
70
- React.createElement(ArrowForward, { sx: { fontSize: '12px' } })),
71
- React.createElement(DisplayedProperty, { property: property, value: d.updatedValue }))));
72
- }))),
73
- ['document', 'correspondence'].includes(r.type) && (React.createElement(Box, null,
74
- React.createElement(Box, { display: "grid", gridTemplateColumns: 'fit-content(100%) fit-content(2%) fit-content(100%)', alignItems: "center", sx: { overflowWrap: 'break-word' } },
75
- r.type === 'document' &&
76
- r.event === 'Uploaded Document Version' &&
77
- ((_d = r.subject) === null || _d === void 0 ? void 0 : _d.name) !== ((_f = (_e = getPastDocumentVersion(r)) === null || _e === void 0 ? void 0 : _e.subject) === null || _f === void 0 ? void 0 : _f.name) && (React.createElement(React.Fragment, null,
78
- React.createElement(Typography, { sx: styles.historyData }, (_h = (_g = getPastDocumentVersion(r)) === null || _g === void 0 ? void 0 : _g.subject) === null || _h === void 0 ? void 0 : _h.name),
79
- React.createElement(ArrowForward, { sx: { fontSize: '8px' } }))),
80
- React.createElement(Typography, { sx: Object.assign(Object.assign({}, styles.historyData), { fontWeight: 600, minWidth: 'fit-content' }) }, (_j = r.subject) === null || _j === void 0 ? void 0 : _j.name))))))));
81
- })));
39
+ return (React.createElement(Box, { sx: styles.timelineConnector }, records.map((r) => (React.createElement(Box, { margin: '16px 0px', key: `${r.timestamp}-${nanoid()}` },
40
+ React.createElement(Box, { sx: { display: 'flex', justifyContent: 'space-between' } },
41
+ React.createElement(Box, { sx: { display: 'flex', maxWidth: '60%', alignContent: 'flex-start' } },
42
+ React.createElement(Typography, { sx: { fontSize: '12px', color: '#637381' } },
43
+ React.createElement(Typography, { component: 'span', sx: { fontWeight: 600, fontSize: '12px' } }, r.user.name ?? 'Unknown User'),
44
+ "\u00A0",
45
+ ['document', 'correspondence'].includes(r.type) ? lowerCase(r.event) : `- ${r.event}`)),
46
+ React.createElement(Box, null,
47
+ React.createElement(Typography, { sx: { fontSize: '12px', color: '#637381' } }, new Date(r.timestamp).getHours() === 12
48
+ ? format(new Date(r.timestamp), 'MMM dd, yyyy H:mm a')
49
+ : format(new Date(r.timestamp), 'MMM dd, yyyy h:mm a')))),
50
+ ((r.data && r.eventType !== 'create' && r.type === 'instance') ||
51
+ ['document', 'correspondence'].includes(r.type)) && (React.createElement(Box, { sx: {
52
+ backgroundColor: '#F4F6F8',
53
+ borderRadius: '4px',
54
+ paddingTop: r.data?.length ? '4px' : '0px',
55
+ paddingBottom: r.data?.length ? '4px' : '0px',
56
+ } },
57
+ r.type === 'instance' && r.data && (React.createElement(Box, null, r.data.map((d) => {
58
+ const property = object.properties?.find((p) => p.id === d.property);
59
+ return (property && (React.createElement(Grid, { container: true, key: property.id, display: "flex", gridTemplateColumns: 'fit-content(25%) fit-content(80%) fit-content(2%) fit-content(80%)', alignItems: "flex-start", justifyContent: "center", sx: {
60
+ overflowWrap: 'break-word',
61
+ } },
62
+ React.createElement(Grid, { item: true, xs: 2 },
63
+ React.createElement(Typography, { sx: {
64
+ ...styles.historyData,
65
+ fontWeight: 600,
66
+ minWidth: 'fit-content',
67
+ alignSelf: 'flex-start',
68
+ } }, property.name)),
69
+ React.createElement(DisplayedProperty, { property: property, value: d.historicalValue }),
70
+ React.createElement(Grid, { item: true, xs: 0.5 },
71
+ React.createElement(ArrowForward, { sx: { fontSize: '12px' } })),
72
+ React.createElement(DisplayedProperty, { property: property, value: d.updatedValue }))));
73
+ }))),
74
+ ['document', 'correspondence'].includes(r.type) && (React.createElement(Box, null,
75
+ React.createElement(Box, { display: "grid", gridTemplateColumns: 'fit-content(100%) fit-content(2%) fit-content(100%)', alignItems: "center", sx: { overflowWrap: 'break-word' } },
76
+ r.type === 'document' &&
77
+ r.event === 'Uploaded Document Version' &&
78
+ r.subject?.name !== getPastDocumentVersion(r)?.subject?.name && (React.createElement(React.Fragment, null,
79
+ React.createElement(Typography, { sx: styles.historyData }, getPastDocumentVersion(r)?.subject?.name),
80
+ React.createElement(ArrowForward, { sx: { fontSize: '8px' } }))),
81
+ React.createElement(Typography, { sx: {
82
+ ...styles.historyData,
83
+ fontWeight: 600,
84
+ minWidth: 'fit-content',
85
+ } }, r.subject?.name)))))))))));
82
86
  };
83
87
  export default HistoricalData;
@@ -25,15 +25,15 @@ const HistoryLoading = () => {
25
25
  React.createElement(Skeleton, { variant: "text", sx: styles.headerSkeleton })),
26
26
  React.createElement(Box, { sx: styles.timelineConnector },
27
27
  React.createElement(Box, { margin: '4px 0px 24px 0px' },
28
- React.createElement(Skeleton, { variant: "text", sx: Object.assign(Object.assign({}, styles.dataSkeleton), { width: '120px' }) }),
29
- React.createElement(Skeleton, { variant: "text", sx: Object.assign(Object.assign({}, styles.dataSkeleton), { width: '65%' }) }),
30
- React.createElement(Skeleton, { variant: "text", sx: Object.assign(Object.assign({}, styles.dataSkeleton), { width: '75%' }) }))),
28
+ React.createElement(Skeleton, { variant: "text", sx: { ...styles.dataSkeleton, width: '120px' } }),
29
+ React.createElement(Skeleton, { variant: "text", sx: { ...styles.dataSkeleton, width: '65%' } }),
30
+ React.createElement(Skeleton, { variant: "text", sx: { ...styles.dataSkeleton, width: '75%' } }))),
31
31
  React.createElement(Box, { sx: { display: 'flex', alignItems: 'center' } },
32
32
  React.createElement(Circle, { color: "primary", sx: { fontSize: '12px', marginRight: '12px' } }),
33
33
  React.createElement(Skeleton, { variant: "text", sx: styles.headerSkeleton })),
34
34
  React.createElement(Box, { sx: styles.timelineConnector },
35
35
  React.createElement(Box, { margin: '4px 0px 20px 0px' },
36
- React.createElement(Skeleton, { variant: "text", sx: Object.assign(Object.assign({}, styles.dataSkeleton), { width: '120px' }) }),
37
- React.createElement(Skeleton, { variant: "text", sx: Object.assign(Object.assign({}, styles.dataSkeleton), { width: '55%' }) })))));
36
+ React.createElement(Skeleton, { variant: "text", sx: { ...styles.dataSkeleton, width: '120px' } }),
37
+ React.createElement(Skeleton, { variant: "text", sx: { ...styles.dataSkeleton, width: '55%' } })))));
38
38
  };
39
39
  export default HistoryLoading;
@@ -35,11 +35,10 @@ export const HistoryLog = (props) => {
35
35
  const groupedHistory = {};
36
36
  const documentHistory = {};
37
37
  history.forEach((h) => {
38
- var _a, _b, _c, _d, _e, _f;
39
38
  const timestamp = DateTime.fromISO(h.timestamp).toFormat('yyyy-MM-dd');
40
- groupedHistory[timestamp] = ((_a = groupedHistory[timestamp]) !== null && _a !== void 0 ? _a : []).concat(h);
39
+ groupedHistory[timestamp] = (groupedHistory[timestamp] ?? []).concat(h);
41
40
  if (h.type === 'document') {
42
- documentHistory[(_c = (_b = h.subject) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : 'unknown'] = ((_f = documentHistory[(_e = (_d = h.subject) === null || _d === void 0 ? void 0 : _d.id) !== null && _e !== void 0 ? _e : 'unknown']) !== null && _f !== void 0 ? _f : []).concat(h);
41
+ documentHistory[h.subject?.id ?? 'unknown'] = (documentHistory[h.subject?.id ?? 'unknown'] ?? []).concat(h);
43
42
  }
44
43
  });
45
44
  setHistoryMap(sortGroupedHistoryByDate(groupedHistory, 'desc'));
@@ -48,10 +47,10 @@ export const HistoryLog = (props) => {
48
47
  }, [history]);
49
48
  useEffect(() => {
50
49
  if (!filter.length) {
51
- setFilteredHistory(sortGroupedHistoryByDate(historyMap !== null && historyMap !== void 0 ? historyMap : {}, order));
50
+ setFilteredHistory(sortGroupedHistoryByDate(historyMap ?? {}, order));
52
51
  }
53
52
  else {
54
- const filtered = Object.fromEntries(Object.entries(historyMap !== null && historyMap !== void 0 ? historyMap : {}).map(([date, historicalData]) => [
53
+ const filtered = Object.fromEntries(Object.entries(historyMap ?? {}).map(([date, historicalData]) => [
55
54
  date,
56
55
  historicalData.filter((r) => filter.includes(r.type)),
57
56
  ]));
@@ -59,7 +58,7 @@ export const HistoryLog = (props) => {
59
58
  }
60
59
  }, [filter, historyMap, order]);
61
60
  useEffect(() => {
62
- setFilteredHistory(sortGroupedHistoryByDate(filteredHistory !== null && filteredHistory !== void 0 ? filteredHistory : {}, order));
61
+ setFilteredHistory(sortGroupedHistoryByDate(filteredHistory ?? {}, order));
63
62
  }, [order]);
64
63
  return (React.createElement(Box, { sx: { margin: '15px 24px 24px 24px' } },
65
64
  !!title && (React.createElement(Box, { sx: { backgroundColor: '#fff', position: 'sticky', top: 0, padding: '15px 0', zIndex: 1400 } },
@@ -17,8 +17,8 @@ export default function MenuBar(props) {
17
17
  React.createElement(AppBar, { color: "inherit", position: "fixed", elevation: 0, sx: { zIndex: (theme) => theme.zIndex.drawer + 1, borderBottom: '1px solid #919EAB3D' } },
18
18
  React.createElement(Toolbar, { sx: { justifyContent: 'space-between' } },
19
19
  React.createElement(Box, { sx: classes.title }, !props.envName ? (React.createElement(CardMedia, { component: 'img', src: props.logo, alt: props.logoAltText, sx: classes.logo })) : (React.createElement(Box, { mt: 2 },
20
- React.createElement(Typography, { variant: "h5" }, props === null || props === void 0 ? void 0 :
21
- props.envName,
20
+ React.createElement(Typography, { variant: "h5" },
21
+ props?.envName,
22
22
  " ")))),
23
23
  props.navItems))));
24
24
  }
@@ -51,7 +51,7 @@ export default function MultiSelect(props) {
51
51
  const [optionsArray, setOptions] = useState(options);
52
52
  const [selectAll, setSelectAll] = useState(false);
53
53
  const [searchText, setSearchText] = useState('');
54
- const [deletedOptions] = useState(options.filter((opt) => opt.deleted).map((opt) => { var _a; return (_a = opt.id) !== null && _a !== void 0 ? _a : ''; }));
54
+ const [deletedOptions] = useState(options.filter((opt) => opt.deleted).map((opt) => opt.id ?? ''));
55
55
  const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
56
56
  coordinateGetter: sortableKeyboardCoordinates,
57
57
  }), useSensor(PointerSensor, {
@@ -60,7 +60,7 @@ export default function MultiSelect(props) {
60
60
  },
61
61
  }));
62
62
  useEffect(() => {
63
- if (optionsArray === null || optionsArray === void 0 ? void 0 : optionsArray.every((option) => option.value === true)) {
63
+ if (optionsArray?.every((option) => option.value === true)) {
64
64
  setSelectAll(true);
65
65
  }
66
66
  else {
@@ -69,13 +69,12 @@ export default function MultiSelect(props) {
69
69
  }, [optionsArray]);
70
70
  const handleFlagChange = (event, idOrLabel) => {
71
71
  const newOptions = optionsArray.map((option) => {
72
- var _a;
73
- if ((_a = idOrLabel === option.id) !== null && _a !== void 0 ? _a : option.label) {
72
+ if (idOrLabel === option.id ?? option.label) {
74
73
  option.value = event.target.checked;
75
74
  }
76
75
  return option;
77
76
  });
78
- const allOptions = options === null || options === void 0 ? void 0 : options.map((option) => optionsArray.find((o) => o.id === option.id) || option);
77
+ const allOptions = options?.map((option) => optionsArray.find((o) => o.id === option.id) || option);
79
78
  onChange(allOptions);
80
79
  setOptions(newOptions);
81
80
  };
@@ -123,17 +122,16 @@ export default function MultiSelect(props) {
123
122
  const { active, over } = event;
124
123
  const items = [...optionsArray];
125
124
  let reOrderedItems = [];
126
- if (active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
125
+ if (active.id !== over?.id) {
127
126
  const oldIndex = items.findIndex((item) => item.id === active.id);
128
- const newIndex = items.findIndex((item) => item.id === (over === null || over === void 0 ? void 0 : over.id));
127
+ const newIndex = items.findIndex((item) => item.id === over?.id);
129
128
  reOrderedItems = arrayMove(items, oldIndex, newIndex);
130
129
  setOptions(reOrderedItems);
131
130
  onChange(reOrderedItems);
132
131
  }
133
132
  };
134
133
  const getToolTip = (option) => {
135
- var _a;
136
- return ((_a = options.find((o) => o.id === option.id)) === null || _a === void 0 ? void 0 : _a.disabled) ? option.tooltip : undefined;
134
+ return options.find((o) => o.id === option.id)?.disabled ? option.tooltip : undefined;
137
135
  };
138
136
  const arrayMove = (items, fromIndex, toIndex) => {
139
137
  const element = items[fromIndex];
@@ -165,49 +163,39 @@ export default function MultiSelect(props) {
165
163
  startAdornment: (React.createElement(InputAdornment, { position: "start" },
166
164
  React.createElement(Search, null))),
167
165
  }, fullWidth: true, sx: styles.textField, value: searchText, onChange: filterItems }))),
168
- (optionsArray === null || optionsArray === void 0 ? void 0 : optionsArray.length) > 1 && (React.createElement(Grid, { container: true },
166
+ optionsArray?.length > 1 && (React.createElement(Grid, { container: true },
169
167
  React.createElement(Grid, { item: true, xs: 4, md: 3 },
170
- React.createElement(Button, { sx: Object.assign(Object.assign({}, styles.button), { fontWeight: 'bold' }), variant: "text", onClick: (e) => handleSelectAllChange(e), disabled: optionsArray.every((option) => option.disabled === true || selectAll) }, "Select All")),
168
+ React.createElement(Button, { sx: { ...styles.button, fontWeight: 'bold' }, variant: "text", onClick: (e) => handleSelectAllChange(e), disabled: optionsArray.every((option) => option.disabled === true || selectAll) }, "Select All")),
171
169
  React.createElement(Grid, { item: true, xs: 8, md: 9 },
172
- React.createElement(Button, { sx: Object.assign(Object.assign({}, styles.button), { fontWeight: 'bold' }), variant: "text", onClick: (e) => handleClearAll(e), disabled: optionsArray.every((option) => option.disabled === true) ||
170
+ React.createElement(Button, { sx: { ...styles.button, fontWeight: 'bold' }, variant: "text", onClick: (e) => handleClearAll(e), disabled: optionsArray.every((option) => option.disabled === true) ||
173
171
  optionsArray.every((option) => option.value === false) }, "Clear All")))),
174
- React.createElement(Box, { sx: Object.assign(Object.assign({}, styles.list), { maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : 'auto' }) }, isSortable ? (React.createElement(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, modifiers: [restrictToVerticalAxis, restrictToWindowEdges] },
175
- React.createElement(SortableContext, { items: optionsArray, strategy: verticalListSortingStrategy }, optionsArray.map((option) => {
176
- var _a, _b;
177
- return (React.createElement(SortableItem
172
+ React.createElement(Box, { sx: { ...styles.list, maxHeight: maxHeight ?? 'auto' } }, isSortable ? (React.createElement(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, modifiers: [restrictToVerticalAxis, restrictToWindowEdges] },
173
+ React.createElement(SortableContext, { items: optionsArray, strategy: verticalListSortingStrategy }, optionsArray.map((option) => (React.createElement(SortableItem
174
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
175
+ , {
178
176
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
179
- , {
180
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
181
- Item: (props) => {
182
- var _a, _b;
183
- return (React.createElement(Grid, { item: true, m: 1, sx: styles.listItem, key: (_a = option === null || option === void 0 ? void 0 : option.id) !== null && _a !== void 0 ? _a : option === null || option === void 0 ? void 0 : option.label },
184
- React.createElement(Grid, { container: true, justifyContent: "space-between", wrap: "nowrap" },
185
- React.createElement(Grid, { alignSelf: "center", pl: 1, display: "flex", item: true },
186
- React.createElement(Box, Object.assign({ sx: styles.dragHandleBox, ref: props.activatorRef }, props.listeners),
187
- React.createElement(IconButton, { size: "medium", sx: styles.dragHandle },
188
- React.createElement(DragHandleOutlined, null))),
189
- React.createElement(Typography, { sx: { lineHeight: '36px' } },
190
- ' ', option === null || option === void 0 ? void 0 :
191
- option.label,
192
- ' ')),
193
- React.createElement(Grid, { item: true },
194
- React.createElement(Tooltip, { title: getToolTip(option) },
195
- React.createElement(Switch, { sx: styles.disabledSwitch, id: (_b = option === null || option === void 0 ? void 0 : option.id) !== null && _b !== void 0 ? _b : option === null || option === void 0 ? void 0 : option.label, checked: option.value, onChange: (event) => {
196
- var _a;
197
- handleFlagChange(event, (_a = option === null || option === void 0 ? void 0 : option.id) !== null && _a !== void 0 ? _a : option === null || option === void 0 ? void 0 : option.label);
198
- }, disabled: option.disabled }))))));
199
- }, key: (_a = option === null || option === void 0 ? void 0 : option.id) !== null && _a !== void 0 ? _a : option === null || option === void 0 ? void 0 : option.label, id: (_b = option === null || option === void 0 ? void 0 : option.id) !== null && _b !== void 0 ? _b : option === null || option === void 0 ? void 0 : option.label }));
200
- })))) : (React.createElement(React.Fragment, null, sortBy(optionsArray, 'label').map((option) => {
201
- var _a, _b;
202
- return (React.createElement(Grid, { item: true, m: 1, sx: styles.listItem, key: (_a = option === null || option === void 0 ? void 0 : option.id) !== null && _a !== void 0 ? _a : option === null || option === void 0 ? void 0 : option.label },
203
- React.createElement(Grid, { container: true, justifyContent: "space-between" },
204
- React.createElement(Grid, { alignSelf: "center", pl: 1 },
205
- React.createElement(Typography, null,
206
- " ", option === null || option === void 0 ? void 0 :
207
- option.label,
208
- " ")),
209
- React.createElement(Grid, null,
210
- React.createElement(Tooltip, { title: getToolTip(option) },
211
- React.createElement(Switch, { sx: styles.disabledSwitch, id: (_b = option === null || option === void 0 ? void 0 : option.id) !== null && _b !== void 0 ? _b : option === null || option === void 0 ? void 0 : option.label, checked: option.value, onChange: (event) => { var _a; return handleFlagChange(event, (_a = option === null || option === void 0 ? void 0 : option.id) !== null && _a !== void 0 ? _a : option === null || option === void 0 ? void 0 : option.label); }, disabled: option.disabled }))))));
212
- })))))));
177
+ Item: (props) => (React.createElement(Grid, { item: true, m: 1, sx: styles.listItem, key: option?.id ?? option?.label },
178
+ React.createElement(Grid, { container: true, justifyContent: "space-between", wrap: "nowrap" },
179
+ React.createElement(Grid, { alignSelf: "center", pl: 1, display: "flex", item: true },
180
+ React.createElement(Box, { sx: styles.dragHandleBox, ref: props.activatorRef, ...props.listeners },
181
+ React.createElement(IconButton, { size: "medium", sx: styles.dragHandle },
182
+ React.createElement(DragHandleOutlined, null))),
183
+ React.createElement(Typography, { sx: { lineHeight: '36px' } },
184
+ ' ',
185
+ option?.label,
186
+ ' ')),
187
+ React.createElement(Grid, { item: true },
188
+ React.createElement(Tooltip, { title: getToolTip(option) },
189
+ React.createElement(Switch, { sx: styles.disabledSwitch, id: option?.id ?? option?.label, checked: option.value, onChange: (event) => {
190
+ handleFlagChange(event, option?.id ?? option?.label);
191
+ }, disabled: option.disabled })))))), key: option?.id ?? option?.label, id: option?.id ?? option?.label })))))) : (React.createElement(React.Fragment, null, sortBy(optionsArray, 'label').map((option) => (React.createElement(Grid, { item: true, m: 1, sx: styles.listItem, key: option?.id ?? option?.label },
192
+ React.createElement(Grid, { container: true, justifyContent: "space-between" },
193
+ React.createElement(Grid, { alignSelf: "center", pl: 1 },
194
+ React.createElement(Typography, null,
195
+ " ",
196
+ option?.label,
197
+ " ")),
198
+ React.createElement(Grid, null,
199
+ React.createElement(Tooltip, { title: getToolTip(option) },
200
+ React.createElement(Switch, { sx: styles.disabledSwitch, id: option?.id ?? option?.label, checked: option.value, onChange: (event) => handleFlagChange(event, option?.id ?? option?.label), disabled: option.disabled })))))))))))));
213
201
  }
@@ -12,7 +12,7 @@ export const SortableItem = (props) => {
12
12
  transform: CSS.Transform.toString(transform),
13
13
  transition,
14
14
  };
15
- return (React.createElement("div", Object.assign({ ref: setNodeRef }, attributes),
15
+ return (React.createElement("div", { ref: setNodeRef, ...attributes },
16
16
  React.createElement(Box, { sx: styles },
17
17
  React.createElement(Item, { activatorRef: setActivatorNodeRef, listeners: listeners }))));
18
18
  };