@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.
- package/dist/published/components/core/Accordion/Accordion.js +1 -1
- package/dist/published/components/core/Accordion/AccordionActions/AccordionActions.js +1 -1
- package/dist/published/components/core/Accordion/AccordionDetails/AccordionDetails.js +1 -1
- package/dist/published/components/core/Accordion/AccordionSummary/AccordionSummary.js +1 -1
- package/dist/published/components/core/Alert/Alert.js +8 -9
- package/dist/published/components/core/AlertTitle/AlertTitle.js +1 -1
- package/dist/published/components/core/AppBar/AppBar.js +1 -1
- package/dist/published/components/core/Autocomplete/Autocomplete.js +33 -15
- package/dist/published/components/core/Autocomplete/Autocomplete.test.js +1 -1
- package/dist/published/components/core/Avatar/Avatar.js +7 -4
- package/dist/published/components/core/Backdrop/Backdrop.js +1 -1
- package/dist/published/components/core/Badge/Badge.js +1 -1
- package/dist/published/components/core/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/published/components/core/Button/Button.js +1 -1
- package/dist/published/components/core/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/published/components/core/Card/Card.js +1 -1
- package/dist/published/components/core/Checkbox/Checkbox.js +1 -1
- package/dist/published/components/core/Chip/Chip.js +1 -1
- package/dist/published/components/core/CircularProgress/CircularProgress.js +1 -1
- package/dist/published/components/core/Collapse/Collapse.js +1 -1
- package/dist/published/components/core/DatePicker/DatePicker.js +4 -16
- package/dist/published/components/core/DateTimePicker/DateTimePicker.js +3 -15
- package/dist/published/components/core/Dialog/Dialog.js +1 -1
- package/dist/published/components/core/Dialog/DialogActions/DialogActions.js +2 -13
- package/dist/published/components/core/Dialog/DialogContent/DialogContent.js +1 -1
- package/dist/published/components/core/Dialog/DialogContentText/DialogContentText.js +1 -1
- package/dist/published/components/core/Dialog/DialogTitle/DialogTitle.js +1 -1
- package/dist/published/components/core/Divider/Divider.js +1 -1
- package/dist/published/components/core/Drawer/Drawer.js +1 -1
- package/dist/published/components/core/FieldError/FieldError.js +1 -2
- package/dist/published/components/core/FormElements/FormControl/FormControl.js +1 -1
- package/dist/published/components/core/FormElements/FormControlLabel/FormControlLabel.js +1 -1
- package/dist/published/components/core/FormElements/FormGroup/FormGroup.js +1 -1
- package/dist/published/components/core/FormElements/FormHelperText/FormHelperText.js +1 -1
- package/dist/published/components/core/FormElements/FormLabel/FormLabel.js +1 -1
- package/dist/published/components/core/IconButton/IconButton.js +1 -1
- package/dist/published/components/core/LinearProgress/LinearProgress.js +1 -1
- package/dist/published/components/core/Link/Link.js +1 -1
- package/dist/published/components/core/List/List.js +1 -1
- package/dist/published/components/core/List/ListItem.js +1 -1
- package/dist/published/components/core/List/ListItemText/ListItemText.js +1 -1
- package/dist/published/components/core/LoadingButton/LoadingButton.js +1 -1
- package/dist/published/components/core/LocalizationProvider/LocalizationProvider.js +3 -14
- package/dist/published/components/core/Menu/Menu.js +1 -1
- package/dist/published/components/core/Menu/MenuItem/MenuItem.js +1 -1
- package/dist/published/components/core/Paper/Paper.js +1 -1
- package/dist/published/components/core/Popover/Popover.js +1 -1
- package/dist/published/components/core/Popper/Popper.js +1 -1
- package/dist/published/components/core/RadioGroup/Radio.js +1 -1
- package/dist/published/components/core/RadioGroup/RadioGroup.js +1 -1
- package/dist/published/components/core/Select/Select.js +11 -4
- package/dist/published/components/core/Skeleton/Skeleton.js +1 -1
- package/dist/published/components/core/Snackbar/Snackbar.js +2 -2
- package/dist/published/components/core/StaticDatePicker/StaticDatePicker.js +3 -15
- package/dist/published/components/core/Stepper/Step/Step.js +1 -1
- package/dist/published/components/core/Stepper/StepButton/StepButton.js +1 -1
- package/dist/published/components/core/Stepper/StepConnector/StepConnector.js +1 -1
- package/dist/published/components/core/Stepper/StepContent/StepContent.js +1 -1
- package/dist/published/components/core/Stepper/StepIcon/StepIcon.js +1 -1
- package/dist/published/components/core/Stepper/StepLabel/StepLabel.js +1 -1
- package/dist/published/components/core/Stepper/Stepper.js +1 -1
- package/dist/published/components/core/Switch/Switch.js +1 -1
- package/dist/published/components/core/Table/Table.js +1 -1
- package/dist/published/components/core/Tabs/Tab/Tab.js +1 -1
- package/dist/published/components/core/Tabs/Tabs.js +1 -1
- package/dist/published/components/core/TextField/TextField.js +12 -6
- package/dist/published/components/core/ToggleButton/ToggleButton.js +1 -1
- package/dist/published/components/core/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
- package/dist/published/components/core/Tooltip/Tooltip.js +15 -2
- package/dist/published/components/core/Typography/index.js +1 -1
- package/dist/published/components/custom/BuilderGrid/BuilderGrid.js +33 -29
- package/dist/published/components/custom/BuilderGrid/BuilderGridToolbar.js +1 -2
- package/dist/published/components/custom/BuilderGrid/EmptyContent.js +4 -5
- package/dist/published/components/custom/BuilderGrid/EmptyContentIllustration.js +6 -1
- package/dist/published/components/custom/BuilderGrid/ToolbarActions.js +3 -1
- package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.js +46 -27
- package/dist/published/components/custom/CriteriaBuilder/CriteriaBuilder.test.js +12 -21
- package/dist/published/components/custom/CriteriaBuilder/ValueEditor.js +27 -34
- package/dist/published/components/custom/DataGrid/DataGrid.js +38 -33
- package/dist/published/components/custom/DataGrid/DateTimeCustomOperator.js +3 -5
- package/dist/published/components/custom/DataGrid/Toolbar.js +3 -4
- package/dist/published/components/custom/ErrorComponent/ErrorComponent.js +11 -1
- package/dist/published/components/custom/Form/Common/Form.js +106 -80
- package/dist/published/components/custom/Form/Common/FormComponentWrapper.js +20 -11
- package/dist/published/components/custom/Form/FormComponents/ButtonComponent.js +9 -20
- package/dist/published/components/custom/Form/FormComponents/DocumentComponent/Document.js +10 -20
- package/dist/published/components/custom/Form/FormComponents/DocumentComponent/DocumentComponent.js +24 -28
- package/dist/published/components/custom/Form/FormComponents/DocumentComponent/DocumentList.js +49 -64
- package/dist/published/components/custom/Form/FormComponents/FormFieldComponent.d.ts +1 -0
- package/dist/published/components/custom/Form/FormComponents/FormFieldComponent.js +109 -34
- package/dist/published/components/custom/Form/FormComponents/ImageComponent/Image.d.ts +2 -0
- package/dist/published/components/custom/Form/FormComponents/ImageComponent/Image.js +13 -25
- package/dist/published/components/custom/Form/FormComponents/ImageComponent/ImageComponent.d.ts +3 -1
- package/dist/published/components/custom/Form/FormComponents/ImageComponent/ImageComponent.js +30 -9
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/InstanceLookup.js +26 -31
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.d.ts +5 -4
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectComponent.js +70 -22
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/ObjectPropertyInput.js +93 -75
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/RelatedObjectInstance.d.ts +2 -2
- package/dist/published/components/custom/Form/FormComponents/ObjectComponent/RelatedObjectInstance.js +17 -26
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ActionDialog.js +20 -24
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ManyToMany/DropdownRepeatableField.js +22 -33
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/ManyToMany/DropdownRepeatableFieldInput.js +12 -9
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableField.js +105 -82
- package/dist/published/components/custom/Form/FormComponents/RepeatableFieldComponent/RepeatableFieldComponent.js +8 -6
- package/dist/published/components/custom/Form/FormComponents/UserComponent/UserComponent.d.ts +3 -1
- package/dist/published/components/custom/Form/FormComponents/UserComponent/UserComponent.js +55 -12
- package/dist/published/components/custom/Form/FormComponents/UserComponent/UserProperty.js +32 -30
- package/dist/published/components/custom/Form/FormComponents/ViewOnlyComponent.js +12 -9
- package/dist/published/components/custom/Form/types.d.ts +5 -5
- package/dist/published/components/custom/Form/utils.js +611 -446
- package/dist/published/components/custom/FormField/AddressFieldComponent/AddressFieldComponent.test.js +41 -54
- package/dist/published/components/custom/FormField/AddressFieldComponent/addressFieldComponent.js +7 -8
- package/dist/published/components/custom/FormField/BooleanSelect/BooleanSelect.js +1 -1
- package/dist/published/components/custom/FormField/BooleanSelect/BooleanSelect.test.js +5 -14
- package/dist/published/components/custom/FormField/DatePickerSelect/DatePickerSelect.js +2 -2
- package/dist/published/components/custom/FormField/DatePickerSelect/DatePickerSelect.test.js +12 -21
- package/dist/published/components/custom/FormField/DateTimePickerSelect/DateTimePickerSelect.js +2 -2
- package/dist/published/components/custom/FormField/DateTimePickerSelect/DateTimePickerSelect.test.js +12 -21
- package/dist/published/components/custom/FormField/FileUpload/FileUpload.js +10 -11
- package/dist/published/components/custom/FormField/FormField.js +10 -10
- package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.js +22 -30
- package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.test.js +8 -17
- package/dist/published/components/custom/FormField/Select/Select.js +5 -6
- package/dist/published/components/custom/FormField/Select/Select.test.js +18 -27
- package/dist/published/components/custom/FormField/TimePickerSelect/TimePickerSelect.js +4 -4
- package/dist/published/components/custom/HistoryLog/DisplayedProperty.js +12 -13
- package/dist/published/components/custom/HistoryLog/HistoryData.js +49 -45
- package/dist/published/components/custom/HistoryLog/HistoryLoading.js +5 -5
- package/dist/published/components/custom/HistoryLog/index.js +5 -6
- package/dist/published/components/custom/Menubar/Menubar.js +2 -2
- package/dist/published/components/custom/MultiSelect/MultiSelect.js +38 -50
- package/dist/published/components/custom/MultiSelect/SortableItem.js +1 -1
- package/dist/published/components/custom/RepeatableField/RepeatableField.js +14 -16
- package/dist/published/components/custom/UserAvatar/UserAvatar.js +12 -5
- package/dist/published/components/custom/util.js +1 -1
- package/dist/published/components/layout/Box/Box.js +1 -1
- package/dist/published/components/layout/Container/Container.js +1 -1
- package/dist/published/components/layout/Grid/Grid.js +1 -1
- package/dist/published/components/layout/Stack/Stack.js +1 -1
- package/dist/published/icons/custom/FileWithExtension.js +8 -4
- package/dist/published/icons/custom/Inherited.js +8 -6
- package/dist/published/icons/custom/Overrides.js +9 -7
- package/dist/published/icons/custom/TrashCan.js +10 -8
- package/dist/published/icons/custom/UploadCloud.js +9 -7
- package/dist/published/stories/Accordion.stories.js +2 -2
- package/dist/published/stories/Alert.stories.js +1 -1
- package/dist/published/stories/AlertTitle.stories.js +1 -1
- package/dist/published/stories/Autocomplete.stories.js +2 -2
- package/dist/published/stories/Avatar.stories.js +1 -1
- package/dist/published/stories/Backdrop.stories.js +1 -1
- package/dist/published/stories/Badge.stories.js +1 -1
- package/dist/published/stories/Box.stories.js +2 -2
- package/dist/published/stories/Breadcrumbs.stories.js +1 -1
- package/dist/published/stories/Button.stories.js +1 -1
- package/dist/published/stories/ButtonGroup.stories.js +1 -1
- package/dist/published/stories/Card.stories.js +1 -1
- package/dist/published/stories/Checkbox.stories.js +1 -1
- package/dist/published/stories/Chip.stories.js +1 -1
- package/dist/published/stories/CircularProgress.stories.js +1 -1
- package/dist/published/stories/Collapse.stories.js +1 -1
- package/dist/published/stories/Container.stories.js +1 -1
- package/dist/published/stories/CriteriaBuilder.stories.js +7 -3
- package/dist/published/stories/DataGrid.stories.js +3 -3
- package/dist/published/stories/DatePicker.stories.js +3 -14
- package/dist/published/stories/Dialog.stories.js +1 -1
- package/dist/published/stories/Divider.stories.js +1 -1
- package/dist/published/stories/Drawer.stories.js +2 -2
- package/dist/published/stories/FormControl.stories.js +1 -1
- package/dist/published/stories/FormControlLabel.stories.js +1 -1
- package/dist/published/stories/FormField.stories.js +3 -12
- package/dist/published/stories/FormGroup.stories.js +1 -1
- package/dist/published/stories/FormHelperText.stories.js +1 -1
- package/dist/published/stories/FormLabel.stories.js +1 -1
- package/dist/published/stories/Grid.stories.js +1 -1
- package/dist/published/stories/HistoryLog.stories.js +1 -1
- package/dist/published/stories/IconButton.stories.js +4 -4
- package/dist/published/stories/LinearProgress.stories.js +1 -1
- package/dist/published/stories/Link.stories.js +1 -1
- package/dist/published/stories/List.stories.js +2 -2
- package/dist/published/stories/Menu.stories.js +2 -2
- package/dist/published/stories/MenuBar.stories.js +1 -1
- package/dist/published/stories/MultiSelect.stories.js +3 -3
- package/dist/published/stories/Palette.stories.js +11 -11
- package/dist/published/stories/Paper.stories.js +1 -1
- package/dist/published/stories/RadioGroup.stories.js +1 -1
- package/dist/published/stories/RepeatableField.stories.js +6 -7
- package/dist/published/stories/RichTextViewer.stories.js +1 -1
- package/dist/published/stories/Skeleton.stories.js +1 -1
- package/dist/published/stories/Snackbar.stories.js +1 -1
- package/dist/published/stories/Stack.stories.js +1 -1
- package/dist/published/stories/StaticDatePicker.stories.js +3 -14
- package/dist/published/stories/Stepper.stories.js +3 -3
- package/dist/published/stories/Switch.stories.js +1 -1
- package/dist/published/stories/Table.stories.js +2 -2
- package/dist/published/stories/Tabs.stories.js +6 -17
- package/dist/published/stories/TextField.stories.js +1 -1
- package/dist/published/stories/TimePicker.stories.js +3 -14
- package/dist/published/stories/TimePickerSelect.stories.js +3 -14
- package/dist/published/stories/ToggleButton.stories.js +4 -4
- package/dist/published/theme/UIThemeProvider.js +1 -2
- package/package.json +1 -1
@@ -17,11 +17,11 @@ const DrawerTemplate = (args) => {
|
|
17
17
|
(event.key === 'Tab' || event.key === 'Shift')) {
|
18
18
|
return;
|
19
19
|
}
|
20
|
-
setState(
|
20
|
+
setState({ ...state, [anchor]: open });
|
21
21
|
};
|
22
22
|
return (React.createElement("div", null, ['left', 'right', 'top', 'bottom'].map((anchor) => (React.createElement(Fragment, { key: anchor },
|
23
23
|
React.createElement(Button, { onClick: toggleDrawer(anchor, true) }, anchor),
|
24
|
-
React.createElement(CustomDrawer,
|
24
|
+
React.createElement(CustomDrawer, { anchor: anchor, open: state[anchor], onClose: toggleDrawer(anchor, false), ...args },
|
25
25
|
React.createElement(Typography, { variant: "h6" }, "Testing Drawer")))))));
|
26
26
|
};
|
27
27
|
export const Drawer = DrawerTemplate.bind({});
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
title: 'Form Elements/FormControl',
|
6
6
|
component: CustomFormControl,
|
7
7
|
};
|
8
|
-
const FormControlTemplate = (args) => (React.createElement(CustomFormControl,
|
8
|
+
const FormControlTemplate = (args) => (React.createElement(CustomFormControl, { ...args },
|
9
9
|
React.createElement(FormLabel, { id: "demo-radio-buttons-group-label" }, "Gender"),
|
10
10
|
React.createElement(RadioGroup, { "aria-labelledby": "demo-radio-buttons-group-label", defaultValue: "female", name: "radio-buttons-group" },
|
11
11
|
React.createElement(FormControlLabel, { value: "female", control: React.createElement(Radio, null), label: "Female" }),
|
@@ -4,5 +4,5 @@ export default {
|
|
4
4
|
title: 'Form Elements/FormControlLabel',
|
5
5
|
component: CustomFormControlLabel,
|
6
6
|
};
|
7
|
-
const FormControlLabelTemplate = (args) => (React.createElement(CustomFormControlLabel,
|
7
|
+
const FormControlLabelTemplate = (args) => (React.createElement(CustomFormControlLabel, { ...args, control: React.createElement(Switch, { defaultChecked: true }), label: "Label" }));
|
8
8
|
export const FormControlLabel = FormControlLabelTemplate.bind({});
|
@@ -1,19 +1,10 @@
|
|
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 React from 'react';
|
11
2
|
import { FormField } from '../index';
|
12
3
|
export default {
|
13
4
|
title: 'Input/FormField',
|
14
5
|
component: FormField,
|
15
6
|
};
|
16
|
-
const FormFieldTemplate = (args) => React.createElement(FormField,
|
7
|
+
const FormFieldTemplate = (args) => React.createElement(FormField, { ...args });
|
17
8
|
export const InputField = FormFieldTemplate.bind({});
|
18
9
|
InputField.args = {
|
19
10
|
property: {
|
@@ -197,7 +188,7 @@ AddressField.args = {
|
|
197
188
|
placeholder: 'string',
|
198
189
|
isMultiLineText: true,
|
199
190
|
rows: 5,
|
200
|
-
queryAddresses: (value) =>
|
191
|
+
queryAddresses: async (value) => {
|
201
192
|
return [
|
202
193
|
{
|
203
194
|
address: {
|
@@ -290,5 +281,5 @@ AddressField.args = {
|
|
290
281
|
},
|
291
282
|
},
|
292
283
|
];
|
293
|
-
}
|
284
|
+
},
|
294
285
|
};
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
title: 'Form Elements/FormGroup',
|
5
5
|
component: CustomFormGroup,
|
6
6
|
};
|
7
|
-
const FormGroupTemplate = (args) => (React.createElement(CustomFormGroup,
|
7
|
+
const FormGroupTemplate = (args) => (React.createElement(CustomFormGroup, { ...args },
|
8
8
|
React.createElement(FormControlLabel, { control: React.createElement(Switch, { defaultChecked: true }), label: "Label" }),
|
9
9
|
React.createElement(FormControlLabel, { disabled: true, control: React.createElement(Switch, null), label: "Disabled" })));
|
10
10
|
export const FormGroup = FormGroupTemplate.bind({});
|
@@ -6,5 +6,5 @@ export default {
|
|
6
6
|
};
|
7
7
|
const FormHelperTextTemplate = (args) => (React.createElement(FormControl, null,
|
8
8
|
React.createElement(TextField, null),
|
9
|
-
React.createElement(CustomFormHelperText,
|
9
|
+
React.createElement(CustomFormHelperText, { id: "my-helper-text", ...args }, "Form Helper text.")));
|
10
10
|
export const FormHelperText = FormHelperTextTemplate.bind({});
|
@@ -6,7 +6,7 @@ export default {
|
|
6
6
|
component: CustomFormLabel,
|
7
7
|
};
|
8
8
|
const FormLabelTemplate = (args) => (React.createElement(FormControl, null,
|
9
|
-
React.createElement(CustomFormLabel,
|
9
|
+
React.createElement(CustomFormLabel, { id: "demo-row-radio-buttons-group-label", ...args }, "Gender"),
|
10
10
|
React.createElement(RadioGroup, { row: true, "aria-labelledby": "demo-row-radio-buttons-group-label", name: "row-radio-buttons-group" },
|
11
11
|
React.createElement(FormControlLabel, { value: "female", control: React.createElement(Radio, null), label: "Female" }),
|
12
12
|
React.createElement(FormControlLabel, { value: "male", control: React.createElement(Radio, null), label: "Male" }))));
|
@@ -4,5 +4,5 @@ export default {
|
|
4
4
|
title: 'Layout/Grid',
|
5
5
|
component: CustomGrid,
|
6
6
|
};
|
7
|
-
const GridTemplate = (args) => React.createElement(CustomGrid,
|
7
|
+
const GridTemplate = (args) => React.createElement(CustomGrid, { ...args });
|
8
8
|
export const Grid = GridTemplate.bind({});
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
title: 'Custom/HistoryLog',
|
5
5
|
component: CustomHistoryLog,
|
6
6
|
};
|
7
|
-
const HistoryLogTemplate = (args) => (React.createElement(CustomHistoryLog,
|
7
|
+
const HistoryLogTemplate = (args) => (React.createElement(CustomHistoryLog, { ...args }));
|
8
8
|
export const HistoryLog = HistoryLogTemplate.bind({});
|
9
9
|
HistoryLog.args = {
|
10
10
|
title: 'History Log',
|
@@ -6,12 +6,12 @@ export default {
|
|
6
6
|
component: CustomIconButton,
|
7
7
|
};
|
8
8
|
const IconButtonTemplate = (args) => (React.createElement(Stack, { direction: "row", spacing: 1 },
|
9
|
-
React.createElement(CustomIconButton,
|
9
|
+
React.createElement(CustomIconButton, { "aria-label": "delete", ...args },
|
10
10
|
React.createElement(Delete, null)),
|
11
|
-
React.createElement(CustomIconButton,
|
11
|
+
React.createElement(CustomIconButton, { "aria-label": "delete", disabled: true, color: "primary", ...args },
|
12
12
|
React.createElement(Delete, null)),
|
13
|
-
React.createElement(CustomIconButton,
|
13
|
+
React.createElement(CustomIconButton, { color: "secondary", "aria-label": "add an alarm", ...args },
|
14
14
|
React.createElement(Alarm, null)),
|
15
|
-
React.createElement(CustomIconButton,
|
15
|
+
React.createElement(CustomIconButton, { color: "primary", "aria-label": "add to shopping cart", ...args },
|
16
16
|
React.createElement(ShoppingCart, null))));
|
17
17
|
export const IconButton = IconButtonTemplate.bind({});
|
@@ -4,5 +4,5 @@ export default {
|
|
4
4
|
title: 'Data Display/LinearProgress',
|
5
5
|
component: CustomLinearProgress,
|
6
6
|
};
|
7
|
-
const LinearProgressTemplate = (args) => (React.createElement(CustomLinearProgress,
|
7
|
+
const LinearProgressTemplate = (args) => (React.createElement(CustomLinearProgress, { ...args }));
|
8
8
|
export const LinearProgress = LinearProgressTemplate.bind({});
|
@@ -12,5 +12,5 @@ export default {
|
|
12
12
|
},
|
13
13
|
},
|
14
14
|
};
|
15
|
-
const LinkTemplate = (args) => React.createElement(CustomLink,
|
15
|
+
const LinkTemplate = (args) => React.createElement(CustomLink, { ...args }, "Link");
|
16
16
|
export const Link = LinkTemplate.bind({});
|
@@ -8,7 +8,7 @@ export default {
|
|
8
8
|
};
|
9
9
|
const ListTemplate = (args) => (React.createElement(Box, { sx: { width: '100%', maxWidth: 360, bgcolor: 'background.paper' } },
|
10
10
|
React.createElement("nav", { "aria-label": "main mailbox folders" },
|
11
|
-
React.createElement(CustomList,
|
11
|
+
React.createElement(CustomList, { ...args },
|
12
12
|
React.createElement(ListItem, { disablePadding: true },
|
13
13
|
React.createElement(ListItemButton, null,
|
14
14
|
React.createElement(ListItemIcon, null,
|
@@ -21,7 +21,7 @@ const ListTemplate = (args) => (React.createElement(Box, { sx: { width: '100%',
|
|
21
21
|
React.createElement(ListItemText, { primary: "Drafts" }))))),
|
22
22
|
React.createElement(Divider, null),
|
23
23
|
React.createElement("nav", { "aria-label": "secondary mailbox folders" },
|
24
|
-
React.createElement(CustomList,
|
24
|
+
React.createElement(CustomList, { ...args },
|
25
25
|
React.createElement(ListItem, { disablePadding: true },
|
26
26
|
React.createElement(ListItemButton, null,
|
27
27
|
React.createElement(ListItemText, { primary: "Trash" }))),
|
@@ -15,9 +15,9 @@ const MenuTemplate = (args) => {
|
|
15
15
|
};
|
16
16
|
return (React.createElement("div", null,
|
17
17
|
React.createElement(Button, { id: "basic-button", "aria-controls": open ? 'basic-menu' : undefined, "aria-haspopup": "true", "aria-expanded": open ? 'true' : undefined, onClick: handleClick }, "Dashboard"),
|
18
|
-
React.createElement(CustomMenu,
|
18
|
+
React.createElement(CustomMenu, { id: "basic-menu", anchorEl: anchorEl, onClose: handleClose, MenuListProps: {
|
19
19
|
'aria-labelledby': 'basic-button',
|
20
|
-
}
|
20
|
+
}, ...args, open: open },
|
21
21
|
React.createElement(MenuItem, { onClick: handleClose }, "Profile"),
|
22
22
|
React.createElement(MenuItem, { onClick: handleClose }, "My account"),
|
23
23
|
React.createElement(MenuItem, { onClick: handleClose }, "Logout"))));
|
@@ -21,5 +21,5 @@ export default {
|
|
21
21
|
envName: { defaultValue: 'System Automation' },
|
22
22
|
},
|
23
23
|
};
|
24
|
-
const Template = (props) => React.createElement(CustomMenuBar,
|
24
|
+
const Template = (props) => React.createElement(CustomMenuBar, { ...props });
|
25
25
|
export const MenuBar = Template.bind({});
|
@@ -16,11 +16,11 @@ export default {
|
|
16
16
|
const MultiSelectTemplate = (args) => (React.createElement(Grid, { container: true, gap: 10 },
|
17
17
|
React.createElement(Grid, { item: true, sm: 4 },
|
18
18
|
React.createElement(Typography, { variant: "h4" }, "More than 4 options:"),
|
19
|
-
React.createElement(CustomMultiSelect,
|
19
|
+
React.createElement(CustomMultiSelect, { ...args, isSortable: true })),
|
20
20
|
React.createElement(Grid, { item: true, sm: 4 },
|
21
21
|
React.createElement(Typography, { variant: "h4" }, "Less than 4 options:"),
|
22
|
-
React.createElement(CustomMultiSelect,
|
22
|
+
React.createElement(CustomMultiSelect, { ...args, options: [
|
23
23
|
{ id: 'name', label: 'Name', value: false },
|
24
24
|
{ id: 'type', label: 'Type', value: false },
|
25
|
-
] }))))
|
25
|
+
] }))));
|
26
26
|
export const MultiSelect = MultiSelectTemplate.bind({});
|
@@ -42,48 +42,48 @@ const PaletteTemplate = () => {
|
|
42
42
|
classes.contentCenter,
|
43
43
|
classes.mainColorSection,
|
44
44
|
{
|
45
|
-
backgroundColor: `${item
|
45
|
+
backgroundColor: `${item?.colorName}.main`,
|
46
46
|
},
|
47
47
|
] },
|
48
|
-
React.createElement(Typography, { color: classes.textColor }, item
|
49
|
-
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item
|
48
|
+
React.createElement(Typography, { color: classes.textColor }, item?.colorName.toUpperCase()),
|
49
|
+
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item?.main))),
|
50
50
|
React.createElement(Grid, { item: true, xs: 6, sm: 6 },
|
51
51
|
React.createElement(Grid, { container: true, gap: 1 },
|
52
52
|
React.createElement(Box, { sx: [
|
53
53
|
classes.contentCenter,
|
54
54
|
classes.otherColorSection,
|
55
55
|
{
|
56
|
-
backgroundColor: `${item
|
56
|
+
backgroundColor: `${item?.colorName}.main`,
|
57
57
|
},
|
58
58
|
] },
|
59
59
|
React.createElement(Typography, { variant: "body2", color: classes.textColor }, "Main"),
|
60
|
-
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item
|
60
|
+
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item?.main)),
|
61
61
|
React.createElement(Box, { sx: [
|
62
62
|
classes.contentCenter,
|
63
63
|
classes.otherColorSection,
|
64
64
|
{
|
65
|
-
backgroundColor: `${item
|
65
|
+
backgroundColor: `${item?.colorName}.light`,
|
66
66
|
},
|
67
67
|
] },
|
68
68
|
React.createElement(Typography, { variant: "body2", color: classes.textColor }, "Light"),
|
69
|
-
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item
|
69
|
+
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item?.light)),
|
70
70
|
React.createElement(Box, { sx: [
|
71
71
|
classes.contentCenter,
|
72
72
|
classes.otherColorSection,
|
73
73
|
{
|
74
|
-
backgroundColor: `${item
|
74
|
+
backgroundColor: `${item?.colorName}.dark`,
|
75
75
|
},
|
76
76
|
] },
|
77
77
|
React.createElement(Typography, { variant: "body2", color: classes.textColor }, "Dark"),
|
78
|
-
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item
|
78
|
+
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item?.dark)),
|
79
79
|
React.createElement(Box, { sx: [
|
80
80
|
classes.contentCenter,
|
81
81
|
classes.otherColorSection,
|
82
82
|
{
|
83
|
-
backgroundColor: item
|
83
|
+
backgroundColor: item?.darker,
|
84
84
|
},
|
85
85
|
] },
|
86
86
|
React.createElement(Typography, { variant: "body2", color: classes.textColor }, "Darker"),
|
87
|
-
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item
|
87
|
+
React.createElement(Typography, { variant: "caption", color: classes.textColor }, item?.darker))))))))));
|
88
88
|
};
|
89
89
|
export const Palette = PaletteTemplate.bind({});
|
@@ -11,5 +11,5 @@ const PaperTemplate = (args) => (React.createElement(Box, { sx: {
|
|
11
11
|
height: 128,
|
12
12
|
},
|
13
13
|
} },
|
14
|
-
React.createElement(CustomPaper,
|
14
|
+
React.createElement(CustomPaper, { elevation: 3, ...args })));
|
15
15
|
export const Paper = PaperTemplate.bind({});
|
@@ -6,7 +6,7 @@ export default {
|
|
6
6
|
};
|
7
7
|
const RadioGroupTemplate = (args) => (React.createElement(FormControl, null,
|
8
8
|
React.createElement(FormLabel, { id: "demo-radio-buttons-group-label" }, "Gender"),
|
9
|
-
React.createElement(CustomRadioGroup,
|
9
|
+
React.createElement(CustomRadioGroup, { "aria-labelledby": "demo-radio-buttons-group-label", defaultValue: "female", name: "radio-buttons-group", ...args },
|
10
10
|
React.createElement(FormControlLabel, { value: "female", control: React.createElement(Radio, null), label: "Female" }),
|
11
11
|
React.createElement(FormControlLabel, { value: "male", control: React.createElement(Radio, null), label: "Male" }),
|
12
12
|
React.createElement(FormControlLabel, { value: "other", control: React.createElement(Radio, null), label: "Other" }))));
|
@@ -23,14 +23,13 @@ const Template = (props) => {
|
|
23
23
|
textField: 'Default text',
|
24
24
|
checkbox: false,
|
25
25
|
};
|
26
|
-
return (React.createElement(CustomRepeatableField,
|
27
|
-
var _a, _b, _c;
|
26
|
+
return (React.createElement(CustomRepeatableField, { ...props, dynamicHeaders: dynamicHeaders }, (handler, index, selectedField) => {
|
28
27
|
return (React.createElement(React.Fragment, null,
|
29
|
-
React.createElement(TextField, { variant: "outlined", label: "Button Label", labelPlacement: "outside-top", placeholder: "Label", name: "textField", value:
|
30
|
-
React.createElement(Checkbox, { name: "checkbox", onChange: (event) => handler(event, index), checked:
|
31
|
-
React.createElement(Autocomplete, { label: "Movies", disablePortal: true, id: "combo-box-demo", options: top100Films, value:
|
32
|
-
handler(
|
33
|
-
}, renderInput: (params) => React.createElement(TextField,
|
28
|
+
React.createElement(TextField, { variant: "outlined", label: "Button Label", labelPlacement: "outside-top", placeholder: "Label", name: "textField", value: selectedField[index]?.textField || defaultValues.textField, onChange: (event) => handler(event, index) }),
|
29
|
+
React.createElement(Checkbox, { name: "checkbox", onChange: (event) => handler(event, index), checked: selectedField[index]?.checkbox || false, sx: { width: 0 } }),
|
30
|
+
React.createElement(Autocomplete, { label: "Movies", disablePortal: true, id: "combo-box-demo", options: top100Films, value: selectedField[index]?.movies, onChange: (event, value) => {
|
31
|
+
handler({ ...event, target: { ...event.target, ...{ value: value, name: 'movies' } } }, index);
|
32
|
+
}, renderInput: (params) => React.createElement(TextField, { ...params, label: "Movie" }) })));
|
34
33
|
}));
|
35
34
|
};
|
36
35
|
export const RepeatableField = Template.bind({});
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
title: 'Custom/RichTextViewer',
|
5
5
|
component: CustomRichTextViewer,
|
6
6
|
};
|
7
|
-
const RichTextViewerTemplate = (args) => (React.createElement(CustomRichTextViewer,
|
7
|
+
const RichTextViewerTemplate = (args) => (React.createElement(CustomRichTextViewer, { ...args }));
|
8
8
|
export const RichTextViewer = RichTextViewerTemplate.bind({});
|
9
9
|
RichTextViewer.args = {
|
10
10
|
// This is a sample RTF content generated from the evoke rich text editor.
|
@@ -4,5 +4,5 @@ export default {
|
|
4
4
|
title: 'Data Display/Skeleton',
|
5
5
|
component: CustomSkeleton,
|
6
6
|
};
|
7
|
-
const SkeletonTemplate = (args) => React.createElement(CustomSkeleton,
|
7
|
+
const SkeletonTemplate = (args) => React.createElement(CustomSkeleton, { ...args });
|
8
8
|
export const Skeleton = SkeletonTemplate.bind({});
|
@@ -17,6 +17,6 @@ const SnackbarTemplate = (args) => {
|
|
17
17
|
};
|
18
18
|
return (React.createElement("div", null,
|
19
19
|
React.createElement(Button, { onClick: handleClick }, "Open simple snackbar"),
|
20
|
-
React.createElement(CustomSnackbar,
|
20
|
+
React.createElement(CustomSnackbar, { open: open, autoHideDuration: 6000, handleClose: handleClose, message: "Note archived. You are good to go.", error: false, ...args })));
|
21
21
|
};
|
22
22
|
export const Snackbar = SnackbarTemplate.bind({});
|
@@ -32,7 +32,7 @@ export default {
|
|
32
32
|
},
|
33
33
|
};
|
34
34
|
const StackTemplate = (args) => {
|
35
|
-
return (React.createElement(CustomStack,
|
35
|
+
return (React.createElement(CustomStack, { ...args },
|
36
36
|
React.createElement("div", null, "Item1 "),
|
37
37
|
React.createElement("div", null, "Item2 "),
|
38
38
|
React.createElement("div", null, "Item3 ")));
|
@@ -1,14 +1,3 @@
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
-
var t = {};
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
-
t[p] = s[p];
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
-
t[p[i]] = s[p[i]];
|
9
|
-
}
|
10
|
-
return t;
|
11
|
-
};
|
12
1
|
import React, { useState } from 'react';
|
13
2
|
import { StaticDatePicker as CustomStaticDatePicker, LocalizationProvider, } from '../index';
|
14
3
|
export default {
|
@@ -23,14 +12,14 @@ export default {
|
|
23
12
|
},
|
24
13
|
};
|
25
14
|
const StaticDatePickerTemplate = (args) => {
|
26
|
-
const { value: initialValue, onChange
|
27
|
-
const [value, setValue] = useState(initialValue
|
15
|
+
const { value: initialValue, onChange, ...rest } = args;
|
16
|
+
const [value, setValue] = useState(initialValue ?? null);
|
28
17
|
const handleChange = (newValue, input) => {
|
29
18
|
onChange(newValue, input);
|
30
19
|
setValue(newValue);
|
31
20
|
};
|
32
21
|
return (React.createElement(LocalizationProvider, null,
|
33
|
-
React.createElement(CustomStaticDatePicker,
|
22
|
+
React.createElement(CustomStaticDatePicker, { ...rest, value: value, onChange: handleChange })));
|
34
23
|
};
|
35
24
|
export const Desktop = StaticDatePickerTemplate.bind({});
|
36
25
|
Desktop.args = {
|
@@ -43,7 +43,7 @@ const StepperTemplate = (args) => {
|
|
43
43
|
setActiveStep(0);
|
44
44
|
};
|
45
45
|
return (React.createElement(Box, { sx: { width: '100%' } },
|
46
|
-
React.createElement(CustomStepper,
|
46
|
+
React.createElement(CustomStepper, { activeStep: activeStep, ...args }, steps.map((label, index) => {
|
47
47
|
const stepProps = {};
|
48
48
|
const labelProps = {};
|
49
49
|
if (isStepOptional(index)) {
|
@@ -52,8 +52,8 @@ const StepperTemplate = (args) => {
|
|
52
52
|
if (isStepSkipped(index)) {
|
53
53
|
stepProps.completed = false;
|
54
54
|
}
|
55
|
-
return (React.createElement(Step,
|
56
|
-
React.createElement(StepLabel,
|
55
|
+
return (React.createElement(Step, { key: label, ...stepProps },
|
56
|
+
React.createElement(StepLabel, { ...labelProps }, label)));
|
57
57
|
})),
|
58
58
|
activeStep === steps.length ? (React.createElement(Fragment, null,
|
59
59
|
React.createElement(Typography, { sx: { mt: 2, mb: 1 } }, "All steps completed - you're finished"),
|
@@ -4,5 +4,5 @@ export default {
|
|
4
4
|
title: 'Input/Switch',
|
5
5
|
component: CustomSwitch,
|
6
6
|
};
|
7
|
-
const SwitchTemplate = (args) => React.createElement(CustomSwitch,
|
7
|
+
const SwitchTemplate = (args) => React.createElement(CustomSwitch, { ...args });
|
8
8
|
export const Switch = SwitchTemplate.bind({});
|
@@ -32,7 +32,7 @@ const TableTemplate = (args) => {
|
|
32
32
|
setPage(0);
|
33
33
|
};
|
34
34
|
return (React.createElement(TableContainer, { component: Paper },
|
35
|
-
React.createElement(CustomTable,
|
35
|
+
React.createElement(CustomTable, { sx: { minWidth: 650 }, "aria-label": "simple table", ...args },
|
36
36
|
React.createElement(TableHead, null,
|
37
37
|
React.createElement(TableRow, null,
|
38
38
|
React.createElement(TableCell, null, "Dessert (100g serving)"),
|
@@ -40,7 +40,7 @@ const TableTemplate = (args) => {
|
|
40
40
|
React.createElement(TableCell, { align: "right" }, "Fat\u00A0(g)"),
|
41
41
|
React.createElement(TableCell, { align: "right" }, "Carbs\u00A0(g)"),
|
42
42
|
React.createElement(TableCell, { align: "right" }, "Protein\u00A0(g)"))),
|
43
|
-
React.createElement(TableBody, null, rows
|
43
|
+
React.createElement(TableBody, null, rows?.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((row) => (React.createElement(TableRow, { key: row.name, sx: { '&:last-child td, &:last-child th': { border: 0 } } },
|
44
44
|
React.createElement(TableCell, { component: "th", scope: "row" }, row.name),
|
45
45
|
React.createElement(TableCell, { align: "right" }, row.calories),
|
46
46
|
React.createElement(TableCell, { align: "right" }, row.fat),
|
@@ -1,14 +1,3 @@
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
-
var t = {};
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
-
t[p] = s[p];
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
-
t[p[i]] = s[p[i]];
|
9
|
-
}
|
10
|
-
return t;
|
11
|
-
};
|
12
1
|
import React, { useState } from 'react';
|
13
2
|
import { Box, Tabs as CustomTabs, Tab, Typography } from '../index';
|
14
3
|
export default {
|
@@ -16,8 +5,8 @@ export default {
|
|
16
5
|
component: CustomTabs,
|
17
6
|
};
|
18
7
|
function TabPanel(props) {
|
19
|
-
const { children, value, index
|
20
|
-
return (React.createElement("div",
|
8
|
+
const { children, value, index, ...other } = props;
|
9
|
+
return (React.createElement("div", { role: "tabpanel", hidden: value !== index, id: `simple-tabpanel-${index}`, "aria-labelledby": `simple-tab-${index}`, ...other }, value === index && (React.createElement(Box, { sx: { p: 3 } },
|
21
10
|
React.createElement(Typography, null, children)))));
|
22
11
|
}
|
23
12
|
function a11yProps(index) {
|
@@ -34,10 +23,10 @@ const TabsTemplate = (args) => {
|
|
34
23
|
};
|
35
24
|
return (React.createElement(Box, { sx: { width: '100%' } },
|
36
25
|
React.createElement(Box, { sx: { borderBottom: 1, borderColor: 'divider' } },
|
37
|
-
React.createElement(CustomTabs,
|
38
|
-
React.createElement(Tab,
|
39
|
-
React.createElement(Tab,
|
40
|
-
React.createElement(Tab,
|
26
|
+
React.createElement(CustomTabs, { ...args, value: value, onChange: handleChange, "aria-label": "basic tabs example" },
|
27
|
+
React.createElement(Tab, { label: "Item One", ...a11yProps(0) }),
|
28
|
+
React.createElement(Tab, { label: "Item Two", ...a11yProps(1) }),
|
29
|
+
React.createElement(Tab, { label: "Item Three", ...a11yProps(2) }))),
|
41
30
|
React.createElement(TabPanel, { value: value, index: 0 }, "Item One"),
|
42
31
|
React.createElement(TabPanel, { value: value, index: 1 }, "Item Two"),
|
43
32
|
React.createElement(TabPanel, { value: value, index: 2 }, "Item Three")));
|
@@ -4,7 +4,7 @@ export default {
|
|
4
4
|
title: 'Input/TextField',
|
5
5
|
component: CustomTextField,
|
6
6
|
};
|
7
|
-
const TextFieldTemplate = (args) => (React.createElement(CustomTextField,
|
7
|
+
const TextFieldTemplate = (args) => (React.createElement(CustomTextField, { ...args }));
|
8
8
|
export const TextField = TextFieldTemplate.bind({});
|
9
9
|
TextField.argTypes = {
|
10
10
|
variant: {
|
@@ -1,14 +1,3 @@
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
-
var t = {};
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
-
t[p] = s[p];
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
-
t[p[i]] = s[p[i]];
|
9
|
-
}
|
10
|
-
return t;
|
11
|
-
};
|
12
1
|
import React, { useState } from 'react';
|
13
2
|
import { LocalizationProvider, TextField, TimePicker } from '../index';
|
14
3
|
export default {
|
@@ -23,12 +12,12 @@ export default {
|
|
23
12
|
},
|
24
13
|
};
|
25
14
|
const TimePickerTemplate = (args) => {
|
26
|
-
const { value: initialValue, onChange
|
27
|
-
const [value, setValue] = useState(initialValue
|
15
|
+
const { value: initialValue, onChange, ...rest } = args;
|
16
|
+
const [value, setValue] = useState(initialValue ?? null);
|
28
17
|
const handleChange = (newValue, input) => {
|
29
18
|
setValue(newValue);
|
30
19
|
};
|
31
20
|
return (React.createElement(LocalizationProvider, null,
|
32
|
-
React.createElement(TimePicker,
|
21
|
+
React.createElement(TimePicker, { ...rest, value: value, onChange: handleChange, renderInput: (params) => React.createElement(TextField, { ...params, fullWidth: true, size: 'small' }) })));
|
33
22
|
};
|
34
23
|
export const DatePicker = TimePickerTemplate.bind({});
|
@@ -1,14 +1,3 @@
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
-
var t = {};
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
-
t[p] = s[p];
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
-
t[p[i]] = s[p[i]];
|
9
|
-
}
|
10
|
-
return t;
|
11
|
-
};
|
12
1
|
import React, { useState } from 'react';
|
13
2
|
import TimePickerSelect from '../components/custom/FormField/TimePickerSelect/TimePickerSelect';
|
14
3
|
export default {
|
@@ -22,11 +11,11 @@ export default {
|
|
22
11
|
};
|
23
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
24
13
|
const TimePickerSelectTemplate = (args) => {
|
25
|
-
const { defaultValue
|
26
|
-
const [value, setValue] = useState(defaultValue
|
14
|
+
const { defaultValue, ...rest } = args;
|
15
|
+
const [value, setValue] = useState(defaultValue ?? null);
|
27
16
|
const handleChange = (id, newValue, property) => {
|
28
17
|
setValue(newValue);
|
29
18
|
};
|
30
|
-
return React.createElement(TimePickerSelect,
|
19
|
+
return React.createElement(TimePickerSelect, { ...rest, value: value, onChange: handleChange, property: { id: '1' } });
|
31
20
|
};
|
32
21
|
export const TimePicker = TimePickerSelectTemplate.bind({});
|
@@ -11,13 +11,13 @@ const ToggleButtonTemplate = (args) => {
|
|
11
11
|
setAlignment(newAlignment);
|
12
12
|
};
|
13
13
|
return (React.createElement(ToggleButtonGroup, { value: alignment, exclusive: true, onChange: handleAlignment, "aria-label": "text alignment" },
|
14
|
-
React.createElement(CustomToggleButton,
|
14
|
+
React.createElement(CustomToggleButton, { "aria-label": "left aligned", ...args, value: "left" },
|
15
15
|
React.createElement(FormatAlignLeft, null)),
|
16
|
-
React.createElement(CustomToggleButton,
|
16
|
+
React.createElement(CustomToggleButton, { "aria-label": "centered", ...args, value: "center" },
|
17
17
|
React.createElement(FormatAlignCenter, null)),
|
18
|
-
React.createElement(CustomToggleButton,
|
18
|
+
React.createElement(CustomToggleButton, { "aria-label": "right aligned", ...args, value: "right" },
|
19
19
|
React.createElement(FormatAlignRight, null)),
|
20
|
-
React.createElement(CustomToggleButton,
|
20
|
+
React.createElement(CustomToggleButton, { "aria-label": "justified", disabled: true, ...args, value: "justify" },
|
21
21
|
React.createElement(FormatAlignJustify, null))));
|
22
22
|
};
|
23
23
|
export const ToggleButton = ToggleButtonTemplate.bind({});
|
@@ -2,9 +2,8 @@ import { createTheme, ThemeProvider } from '@mui/material';
|
|
2
2
|
import React from 'react';
|
3
3
|
import { defaultTheme } from './defaultTheme';
|
4
4
|
function UIThemeProvider(props) {
|
5
|
-
var _a, _b, _c;
|
6
5
|
const { args, children } = props;
|
7
|
-
const theme =
|
6
|
+
const theme = args?.theme?.palette?.primary?.main ? createTheme(args?.theme) : defaultTheme;
|
8
7
|
return React.createElement(ThemeProvider, { theme: theme }, children);
|
9
8
|
}
|
10
9
|
export default UIThemeProvider;
|