@zealicsolutions/web-ui 1.0.30 → 1.0.31-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/containers/types/moleculeTypes.d.ts +44 -23
- package/dist/cjs/index.js +491 -491
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/molecules/BasicTextField/BasicTextField.d.ts +3 -0
- package/dist/cjs/molecules/BasicTextField/BasicTextField.stories.d.ts +6 -1
- package/dist/cjs/molecules/CurrencyInputtField/CurrencyInputField.d.ts +3 -10
- package/dist/cjs/molecules/CurrencyInputtField/CurrencyInputField.stories.d.ts +6 -1
- package/dist/cjs/molecules/DatePicker/DatePicker.d.ts +16 -5
- package/dist/cjs/molecules/DatePicker/DatePicker.stories.d.ts +2 -0
- package/dist/cjs/molecules/EmailInputField/EmailInputField.d.ts +22 -8
- package/dist/cjs/molecules/EmailInputField/EmailInputField.stories.d.ts +6 -1
- package/dist/cjs/molecules/NumericInputField/NumericInputField.d.ts +23 -13
- package/dist/cjs/molecules/NumericInputField/NumericInputField.stories.d.ts +7 -1
- package/dist/cjs/molecules/PhoneNumberInputField/PhoneNumberInputField.d.ts +30 -9
- package/dist/cjs/molecules/PhoneNumberInputField/PhoneNumberInputField.stories.d.ts +7 -1
- package/dist/cjs/molecules/Rating/Rating.d.ts +25 -7
- package/dist/cjs/molecules/Rating/Rating.stories.d.ts +8 -2
- package/dist/cjs/molecules/Select/Select.d.ts +21 -6
- package/dist/cjs/molecules/Select/Select.stories.d.ts +3 -2
- package/dist/cjs/molecules/Slider/Slider.d.ts +17 -8
- package/dist/cjs/molecules/Slider/Slider.stories.d.ts +8 -2
- package/dist/cjs/molecules/Switch/Switch.d.ts +15 -18
- package/dist/cjs/molecules/Switch/Switch.stories.d.ts +7 -1
- package/dist/esm/_virtual/index6.js +1 -1
- package/dist/esm/_virtual/index7.js +1 -1
- package/dist/esm/containers/types/moleculeTypes.d.ts +44 -23
- package/dist/esm/molecules/BaseMolecule.js +1 -1
- package/dist/esm/molecules/BaseMolecule.js.map +1 -1
- package/dist/esm/molecules/BasicTextField/BasicTextField.d.ts +3 -0
- package/dist/esm/molecules/BasicTextField/BasicTextField.js +1 -1
- package/dist/esm/molecules/BasicTextField/BasicTextField.js.map +1 -1
- package/dist/esm/molecules/BasicTextField/BasicTextField.stories.d.ts +6 -1
- package/dist/esm/molecules/CurrencyInputtField/CurrencyInputField.d.ts +3 -10
- package/dist/esm/molecules/CurrencyInputtField/CurrencyInputField.js +1 -1
- package/dist/esm/molecules/CurrencyInputtField/CurrencyInputField.js.map +1 -1
- package/dist/esm/molecules/CurrencyInputtField/CurrencyInputField.stories.d.ts +6 -1
- package/dist/esm/molecules/DatePicker/DatePicker.d.ts +16 -5
- package/dist/esm/molecules/DatePicker/DatePicker.js +1 -1
- package/dist/esm/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/molecules/DatePicker/DatePicker.stories.d.ts +2 -0
- package/dist/esm/molecules/EmailInputField/EmailInputField.d.ts +22 -8
- package/dist/esm/molecules/EmailInputField/EmailInputField.js +1 -1
- package/dist/esm/molecules/EmailInputField/EmailInputField.js.map +1 -1
- package/dist/esm/molecules/EmailInputField/EmailInputField.stories.d.ts +6 -1
- package/dist/esm/molecules/NumericInputField/NumericInputField.d.ts +23 -13
- package/dist/esm/molecules/NumericInputField/NumericInputField.js +1 -1
- package/dist/esm/molecules/NumericInputField/NumericInputField.js.map +1 -1
- package/dist/esm/molecules/NumericInputField/NumericInputField.stories.d.ts +7 -1
- package/dist/esm/molecules/PasswordSetup/PasswordSetup.js +1 -1
- package/dist/esm/molecules/PasswordSetup/PasswordSetup.js.map +1 -1
- package/dist/esm/molecules/PhoneNumberInputField/PhoneNumberInputField.d.ts +30 -9
- package/dist/esm/molecules/PhoneNumberInputField/PhoneNumberInputField.js +1 -1
- package/dist/esm/molecules/PhoneNumberInputField/PhoneNumberInputField.js.map +1 -1
- package/dist/esm/molecules/PhoneNumberInputField/PhoneNumberInputField.stories.d.ts +7 -1
- package/dist/esm/molecules/Rating/Rating.d.ts +25 -7
- package/dist/esm/molecules/Rating/Rating.js +1 -1
- package/dist/esm/molecules/Rating/Rating.js.map +1 -1
- package/dist/esm/molecules/Rating/Rating.stories.d.ts +8 -2
- package/dist/esm/molecules/Select/Select.d.ts +21 -6
- package/dist/esm/molecules/Select/Select.js +1 -1
- package/dist/esm/molecules/Select/Select.js.map +1 -1
- package/dist/esm/molecules/Select/Select.stories.d.ts +3 -2
- package/dist/esm/molecules/Slider/Slider.d.ts +17 -8
- package/dist/esm/molecules/Slider/Slider.js +1 -1
- package/dist/esm/molecules/Slider/Slider.js.map +1 -1
- package/dist/esm/molecules/Slider/Slider.stories.d.ts +8 -2
- package/dist/esm/molecules/Switch/Switch.d.ts +15 -18
- package/dist/esm/molecules/Switch/Switch.js +1 -1
- package/dist/esm/molecules/Switch/Switch.js.map +1 -1
- package/dist/esm/molecules/Switch/Switch.stories.d.ts +7 -1
- package/dist/esm/node_modules/@mui/material/Accordion/Accordion.js +1 -1
- package/dist/esm/node_modules/@mui/material/AccordionDetails/AccordionDetails.js +1 -1
- package/dist/esm/node_modules/@mui/material/AccordionSummary/AccordionSummary.js +1 -1
- package/dist/esm/node_modules/@mui/material/Alert/Alert.js +1 -1
- package/dist/esm/node_modules/@mui/material/AlertTitle/AlertTitle.js +1 -1
- package/dist/esm/node_modules/@mui/material/Backdrop/Backdrop.js +1 -1
- package/dist/esm/node_modules/@mui/material/Badge/Badge.js +1 -1
- package/dist/esm/node_modules/@mui/material/Box/Box.js +1 -1
- package/dist/esm/node_modules/@mui/material/Button/Button.js +1 -1
- package/dist/esm/node_modules/@mui/material/ButtonBase/ButtonBase.js +1 -1
- package/dist/esm/node_modules/@mui/material/ButtonBase/Ripple.js +1 -1
- package/dist/esm/node_modules/@mui/material/ButtonBase/TouchRipple.js +1 -1
- package/dist/esm/node_modules/@mui/material/Card/Card.js +1 -1
- package/dist/esm/node_modules/@mui/material/CardMedia/CardMedia.js +1 -1
- package/dist/esm/node_modules/@mui/material/Checkbox/Checkbox.js +1 -1
- package/dist/esm/node_modules/@mui/material/Chip/Chip.js +1 -1
- package/dist/esm/node_modules/@mui/material/CircularProgress/CircularProgress.js +1 -1
- package/dist/esm/node_modules/@mui/material/Collapse/Collapse.js +1 -1
- package/dist/esm/node_modules/@mui/material/CssBaseline/CssBaseline.js +1 -1
- package/dist/esm/node_modules/@mui/material/DefaultPropsProvider/DefaultPropsProvider.js +1 -1
- package/dist/esm/node_modules/@mui/material/Dialog/Dialog.js +1 -1
- package/dist/esm/node_modules/@mui/material/DialogActions/DialogActions.js +1 -1
- package/dist/esm/node_modules/@mui/material/DialogContent/DialogContent.js +1 -1
- package/dist/esm/node_modules/@mui/material/Divider/Divider.js +1 -1
- package/dist/esm/node_modules/@mui/material/Divider/dividerClasses.js +1 -1
- package/dist/esm/node_modules/@mui/material/Divider/dividerClasses.js.map +1 -1
- package/dist/esm/node_modules/@mui/material/Drawer/Drawer.js +1 -1
- package/dist/esm/node_modules/@mui/material/Fade/Fade.js +1 -1
- package/dist/esm/node_modules/@mui/material/FilledInput/FilledInput.js +1 -1
- package/dist/esm/node_modules/@mui/material/FormControl/FormControl.js +1 -1
- package/dist/esm/node_modules/@mui/material/FormControlLabel/FormControlLabel.js +1 -1
- package/dist/esm/node_modules/@mui/material/FormGroup/FormGroup.js +1 -1
- package/dist/esm/node_modules/@mui/material/FormHelperText/FormHelperText.js +1 -1
- package/dist/esm/node_modules/@mui/material/FormLabel/FormLabel.js +1 -1
- package/dist/esm/node_modules/@mui/material/GlobalStyles/GlobalStyles.js +1 -1
- package/dist/esm/node_modules/@mui/material/Grow/Grow.js +1 -1
- package/dist/esm/node_modules/@mui/material/IconButton/IconButton.js +1 -1
- package/dist/esm/node_modules/@mui/material/Input/Input.js +1 -1
- package/dist/esm/node_modules/@mui/material/InputAdornment/InputAdornment.js +1 -1
- package/dist/esm/node_modules/@mui/material/InputBase/InputBase.js +1 -1
- package/dist/esm/node_modules/@mui/material/InputLabel/InputLabel.js +1 -1
- package/dist/esm/node_modules/@mui/material/Link/Link.js +1 -1
- package/dist/esm/node_modules/@mui/material/List/List.js +1 -1
- package/dist/esm/node_modules/@mui/material/ListItem/ListItem.js +1 -1
- package/dist/esm/node_modules/@mui/material/ListItemButton/ListItemButton.js +1 -1
- package/dist/esm/node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction.js +1 -1
- package/dist/esm/node_modules/@mui/material/ListItemText/ListItemText.js +1 -1
- package/dist/esm/node_modules/@mui/material/Menu/Menu.js +1 -1
- package/dist/esm/node_modules/@mui/material/MenuItem/MenuItem.js +1 -1
- package/dist/esm/node_modules/@mui/material/MenuList/MenuList.js +1 -1
- package/dist/esm/node_modules/@mui/material/Modal/Modal.js +1 -1
- package/dist/esm/node_modules/@mui/material/NativeSelect/NativeSelectInput.js +1 -1
- package/dist/esm/node_modules/@mui/material/OutlinedInput/NotchedOutline.js +1 -1
- package/dist/esm/node_modules/@mui/material/OutlinedInput/OutlinedInput.js +1 -1
- package/dist/esm/node_modules/@mui/material/Paper/Paper.js +1 -1
- package/dist/esm/node_modules/@mui/material/Popover/Popover.js +1 -1
- package/dist/esm/node_modules/@mui/material/Popper/BasePopper.js +1 -1
- package/dist/esm/node_modules/@mui/material/Popper/Popper.js +1 -1
- package/dist/esm/node_modules/@mui/material/Portal/Portal.js +1 -1
- package/dist/esm/node_modules/@mui/material/Radio/Radio.js +1 -1
- package/dist/esm/node_modules/@mui/material/Radio/RadioButtonIcon.js +1 -1
- package/dist/esm/node_modules/@mui/material/RadioGroup/RadioGroup.js +1 -1
- package/dist/esm/node_modules/@mui/material/Rating/Rating.js +1 -1
- package/dist/esm/node_modules/@mui/material/Select/Select.js +1 -1
- package/dist/esm/node_modules/@mui/material/Select/SelectInput.js +1 -1
- package/dist/esm/node_modules/@mui/material/Slide/Slide.js +1 -1
- package/dist/esm/node_modules/@mui/material/Slider/Slider.js +1 -1
- package/dist/esm/node_modules/@mui/material/Slider/SliderValueLabel.js +1 -1
- package/dist/esm/node_modules/@mui/material/Stack/Stack.js +1 -1
- package/dist/esm/node_modules/@mui/material/Step/Step.js +1 -1
- package/dist/esm/node_modules/@mui/material/StepConnector/StepConnector.js +1 -1
- package/dist/esm/node_modules/@mui/material/StepContent/StepContent.js +1 -1
- package/dist/esm/node_modules/@mui/material/StepIcon/StepIcon.js +1 -1
- package/dist/esm/node_modules/@mui/material/StepLabel/StepLabel.js +1 -1
- package/dist/esm/node_modules/@mui/material/Stepper/Stepper.js +1 -1
- package/dist/esm/node_modules/@mui/material/SvgIcon/SvgIcon.js +1 -1
- package/dist/esm/node_modules/@mui/material/Switch/Switch.js +1 -1
- package/dist/esm/node_modules/@mui/material/Tab/Tab.js +1 -1
- package/dist/esm/node_modules/@mui/material/TabScrollButton/TabScrollButton.js +1 -1
- package/dist/esm/node_modules/@mui/material/Tabs/ScrollbarSize.js +1 -1
- package/dist/esm/node_modules/@mui/material/Tabs/Tabs.js +1 -1
- package/dist/esm/node_modules/@mui/material/TextField/TextField.js +1 -1
- package/dist/esm/node_modules/@mui/material/TextareaAutosize/TextareaAutosize.js +1 -1
- package/dist/esm/node_modules/@mui/material/Typography/Typography.js +1 -1
- package/dist/esm/node_modules/@mui/material/Unstable_TrapFocus/FocusTrap.js +1 -1
- package/dist/esm/node_modules/@mui/material/internal/SwitchBase.js +1 -1
- package/dist/esm/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/esm/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js +1 -1
- package/dist/esm/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/Box/Box.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/Container/Container.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/Container/createContainer.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/Grid/Grid.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/Grid/createGrid.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/RtlProvider/index.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/Stack/Stack.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/Stack/createStack.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/cssVars/createCssVarsProvider.js +1 -1
- package/dist/esm/node_modules/@mui/system/esm/responsivePropType/responsivePropType.js +1 -1
- package/dist/esm/node_modules/@mui/utils/esm/deepmerge/deepmerge.js +1 -1
- package/dist/esm/node_modules/@mui/utils/esm/elementAcceptingRef/elementAcceptingRef.js +1 -1
- package/dist/esm/node_modules/@mui/utils/esm/elementTypeAcceptingRef/elementTypeAcceptingRef.js +1 -1
- package/dist/esm/node_modules/@mui/utils/esm/getDisplayName/getDisplayName.js +1 -1
- package/dist/esm/node_modules/@mui/utils/esm/refType/refType.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/DateField/DateField.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/DatePicker/DatePicker.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/MobileDatePicker/MobileDatePicker.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersDay/PickersDay.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersSectionList/PickersSectionList.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersTextField/PickersFilledInput/PickersFilledInput.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersTextField/PickersInput/PickersInput.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersTextField/PickersInputBase/PickersInputBase.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersTextField/PickersOutlinedInput/PickersOutlinedInput.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/PickersTextField/PickersTextField.js +1 -1
- package/dist/esm/node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar.js +1 -1
- package/dist/esm/node_modules/prop-types/index.js +1 -1
- package/dist/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/dist/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +1 -1
- package/dist/esm/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/esm/node_modules/rc-util/es/ref.js +1 -1
- package/dist/esm/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/dist/esm/node_modules/react-is/cjs/react-is.production.min.js +1 -1
- package/dist/esm/node_modules/react-is/index.js +1 -1
- package/dist/esm/node_modules/react-transition-group/esm/CSSTransition.js +1 -1
- package/dist/esm/node_modules/react-transition-group/esm/ReplaceTransition.js +1 -1
- package/dist/esm/node_modules/react-transition-group/esm/SwitchTransition.js +1 -1
- package/dist/esm/node_modules/react-transition-group/esm/Transition.js +1 -1
- package/dist/esm/node_modules/react-transition-group/esm/TransitionGroup.js +1 -1
- package/dist/esm/node_modules/react-transition-group/esm/utils/PropTypes.js +1 -1
- package/dist/index.d.ts +190 -124
- package/package.json +1 -1
- package/dist/cjs/molecules/DisplayDataFieldMolecule/DisplayDataFieldMolecule.d.ts +0 -30
- package/dist/cjs/molecules/DisplayDataFieldMolecule/DisplayDataFieldMolecule.stories.d.ts +0 -7
- package/dist/esm/molecules/DisplayDataFieldMolecule/DisplayDataFieldMolecule.d.ts +0 -30
- package/dist/esm/molecules/DisplayDataFieldMolecule/DisplayDataFieldMolecule.js +0 -2
- package/dist/esm/molecules/DisplayDataFieldMolecule/DisplayDataFieldMolecule.js.map +0 -1
- package/dist/esm/molecules/DisplayDataFieldMolecule/DisplayDataFieldMolecule.stories.d.ts +0 -7
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PasswordSetup.js","sources":["../../../../../src/molecules/PasswordSetup/PasswordSetup.tsx"],"sourcesContent":[null],"names":["PasswordSetup","_a","_b","gap","inputProps","validations","htmlElementId","validationState","overridesProperties","configurationItemInfo","_c","useFormContext","watch","formState","setError","text","subText","placeholderText","subPlaceholderText","validationText","rules","map","passwordValidationMapper","passwordFieldName","reEnterPasswordFieldName","concat","password","reEnterPassword","useEffect","type","message","_jsxs","Wrapper","__assign","id","style","children","_jsx","BasicTextField","
|
1
|
+
{"version":3,"file":"PasswordSetup.js","sources":["../../../../../src/molecules/PasswordSetup/PasswordSetup.tsx"],"sourcesContent":[null],"names":["PasswordSetup","_a","_b","gap","inputProps","validations","htmlElementId","validationState","overridesProperties","configurationItemInfo","_c","useFormContext","watch","formState","setError","text","subText","placeholderText","subPlaceholderText","validationText","rules","map","passwordValidationMapper","passwordFieldName","reEnterPasswordFieldName","concat","password","reEnterPassword","useEffect","type","message","_jsxs","Wrapper","__assign","id","style","children","_jsx","BasicTextField","inputType","name","CustomValidation","value","label","isSubmitted","isDirty","styled","div","templateObject_1","__makeTemplateObject"],"mappings":"q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AAGC,IAAAA,EAAAC,EAAA,CAAA,mEAAA,CAAA"}
|
@@ -1,16 +1,34 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ConfigurationItemInfo } from 'containers';
|
3
|
+
/**
|
4
|
+
* formatPhoneDisplay(value):
|
5
|
+
* Takes a raw string (possibly containing digits and non-digits)
|
6
|
+
* and returns a string shaped like + (XXX) XXX-XXXX,
|
7
|
+
* filling placeholders sequentially from `phoneNumberMask`.
|
8
|
+
*
|
9
|
+
* If there are fewer than 10 digits, it will show partial underscores
|
10
|
+
* for missing digits by default.
|
11
|
+
* You can tweak the code if you prefer to truncate or show partial input.
|
12
|
+
*/
|
13
|
+
export declare function formatPhoneDisplay(value: string): string;
|
3
14
|
export interface PhoneNumberInputFieldProps {
|
15
|
+
/** If true, we skip rendering the textfield and just show a text display. */
|
16
|
+
isDisplayOnly?: boolean;
|
17
|
+
/** If true, we do required validation in react-hook-form + show asterisk in MUI FormControl. */
|
4
18
|
required?: boolean;
|
19
|
+
requiredErrorText?: string;
|
20
|
+
validationErrorText?: string;
|
21
|
+
text?: string;
|
22
|
+
placeholderText?: string;
|
23
|
+
masked?: boolean;
|
24
|
+
/** Basic style props */
|
5
25
|
backgroundColor?: string;
|
6
|
-
|
7
|
-
|
26
|
+
borderColor?: string;
|
27
|
+
textColor?: string;
|
8
28
|
fontSize?: number | string;
|
9
29
|
fontFamily?: string;
|
10
|
-
fontWeight?: 'normal' | 'bold';
|
11
|
-
|
12
|
-
multiLine?: boolean;
|
13
|
-
borderColor?: string;
|
30
|
+
fontWeight?: 'normal' | 'bold' | number;
|
31
|
+
/** Spacing */
|
14
32
|
marginLeft?: string;
|
15
33
|
marginTop?: string;
|
16
34
|
marginRight?: string;
|
@@ -19,10 +37,13 @@ export interface PhoneNumberInputFieldProps {
|
|
19
37
|
paddingTop?: string;
|
20
38
|
paddingRight?: string;
|
21
39
|
paddingBottom?: string;
|
22
|
-
text?: string;
|
23
|
-
placeholderText?: string;
|
24
|
-
configurationItemInfo?: ConfigurationItemInfo;
|
25
40
|
name: string;
|
26
41
|
sourceDataModelField?: string;
|
42
|
+
configurationItemInfo?: ConfigurationItemInfo;
|
27
43
|
}
|
44
|
+
/**
|
45
|
+
* Main PhoneNumberInputField:
|
46
|
+
* - display-only -> <Typography>
|
47
|
+
* - editable -> <TextField> with optional mask
|
48
|
+
*/
|
28
49
|
export declare const PhoneNumberInputField: React.FC<PhoneNumberInputFieldProps>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{
|
1
|
+
import{__assign as o,__rest as e}from"../../node_modules/tslib/tslib.es6.js";import{jsxs as t,jsx as r}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useEffect as i,useState as n}from"react";import{useFormContext as l,Controller as d}from"../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../contexts/FormStepContext/FormStepContext.js";import"../../contexts/ButtonActionsContext/ButtonActionsContext.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../contexts/OrganismContext/OrganismContext.js";import{useStateContext as a}from"../../contexts/hooks/useStateContext.js";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import{PhoneTextMask as u}from"./PhoneTextMask.js";import{phoneNumberMask as m}from"../../helpers/validations.js";import s from"../../node_modules/@mui/material/FormHelperText/FormHelperText.js";import p from"../../node_modules/@mui/material/Typography/Typography.js";import c from"../../node_modules/@mui/material/FormControl/FormControl.js";import g from"../../node_modules/@mui/material/TextField/TextField.js";function x(o){var e=o.replace(/\D+/g,"");if(!e)return"";for(var t="",r=0,i=0,n=m;i<n.length;i++){var l=n[i];"string"==typeof l?t+=l:l instanceof RegExp&&(r<e.length?(t+=e[r],r++):t+="_")}return t}var f=function(t){var i=t.masked,n=t.errorMsg,l=t.inputSx,d=t.labelSx,a=e(t,["masked","errorMsg","inputSx","labelSx"]),m=i?{inputComponent:u}:{};return r(g,o({},a,{variant:"outlined",error:!!n,helperText:n||null,slotProps:{input:o({sx:o(o({},l),{width:"auto"})},m),inputLabel:{sx:d}}}))},h=function(e){var u=e.isDisplayOnly,m=void 0!==u&&u,g=e.required,h=void 0!==g&&g,v=e.requiredErrorText,C=void 0===v?"Phone is required":v,b=e.validationErrorText,M=void 0===b?"Invalid phone number":b,j=e.text,T=e.placeholderText,S=e.masked,O=void 0===S||S,y=e.backgroundColor,F=e.borderColor,k=e.textColor,B=void 0===k?"#000":k,I=e.fontSize,R=e.fontFamily,_=e.fontWeight,L=e.marginLeft,D=void 0===L?"0":L,q=e.marginTop,w=void 0===q?"0":q,W=e.marginRight,z=void 0===W?"0":W,A=e.marginBottom,V=void 0===A?"0":A,E=e.paddingLeft,P=void 0===E?"0":E,H=e.paddingTop,$=void 0===H?"0":H,G=e.paddingRight,J=void 0===G?"0":G,K=e.paddingBottom,N=void 0===K?"0":K,Q=e.name,U=e.sourceDataModelField,X=e.configurationItemInfo,Y=l(),Z=null==Y?void 0:Y.control,oo=!(!Z||!Q),eo=a().stateConfig,to=U?null==eo?void 0:eo[U]:void 0;i((function(){void 0!==to&&oo&&Y.setValue(Q,to)}),[to]);var ro=n(""),io=ro[0],no=ro[1],lo={required:!!h&&C,pattern:{value:/^\d{10}$/,message:M}};if(m){var ao="";ao=oo?Y.watch(Q)||"":io;var uo=(O?x(ao):ao)||T||"-";return t("div",o({style:{display:"inline-flex",flexDirection:"column",marginLeft:D,marginTop:w,marginRight:z,marginBottom:V}},X,{children:[j&&r(s,o({sx:{fontSize:I,fontFamily:R,fontWeight:_,color:B,marginLeft:0,marginBottom:"4px"}},{children:j})),r(p,o({sx:{fontSize:I,fontFamily:R,fontWeight:_,color:B,paddingLeft:P,paddingTop:$,paddingRight:J,paddingBottom:N,backgroundColor:y,border:"1px solid ".concat(F||"#ccc"),borderRadius:"4px",minWidth:"120px"}},{children:uo}))]}))}var mo={backgroundColor:y,color:B,fontSize:I,fontFamily:R,fontWeight:_,"& .MuiOutlinedInput-notchedOutline":{borderColor:F||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:F||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:F||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:F||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:F||"inherit"}},so={color:B,"&.Mui-focused":{color:B}},po={marginLeft:D,marginTop:w,marginRight:z,marginBottom:V,width:"fit-content"};return r(c,o({required:h,sx:po},X,oo?{children:r(d,{name:Q,rules:lo,control:Z,defaultValue:"",render:function(o){var e,t=o.field,i=o.fieldState;return r(f,{masked:O,errorMsg:null===(e=i.error)||void 0===e?void 0:e.message,inputSx:mo,labelSx:so,label:j,placeholder:T,value:t.value||"",onChange:function(o){var e=o.target.value.replace(/\D+/g,"");t.onChange(e)}})}})}:{children:r(f,{masked:O,errorMsg:void 0,inputSx:mo,labelSx:so,label:j,placeholder:T,value:io,onChange:function(o){no(o.target.value.replace(/\D+/g,""))}})}))};export{h as PhoneNumberInputField,x as formatPhoneDisplay};
|
2
2
|
//# sourceMappingURL=PhoneNumberInputField.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PhoneNumberInputField.js","sources":["../../../../../src/molecules/PhoneNumberInputField/PhoneNumberInputField.tsx"],"sourcesContent":[null],"names":["
|
1
|
+
{"version":3,"file":"PhoneNumberInputField.js","sources":["../../../../../src/molecules/PhoneNumberInputField/PhoneNumberInputField.tsx"],"sourcesContent":[null],"names":["formatPhoneDisplay","value","digits","replace","result","digitIndex","phoneNumberMask_1","phoneNumberMask","_i","length","token","RegExp","PhoneNumberTextField","_a","masked","errorMsg","inputSx","labelSx","props","__rest","maskProps","inputComponent","PhoneTextMask","_jsx","MuiTextField","__assign","variant","error","helperText","slotProps","input","sx","width","inputLabel","PhoneNumberInputField","_b","isDisplayOnly","_c","required","_d","requiredErrorText","_e","validationErrorText","text","placeholderText","_f","backgroundColor","borderColor","_g","textColor","fontSize","fontFamily","fontWeight","_h","marginLeft","_j","marginTop","_k","marginRight","_l","marginBottom","_m","paddingLeft","_o","paddingTop","_p","paddingRight","_q","paddingBottom","name","sourceDataModelField","configurationItemInfo","methods","useFormContext","control","isInFormContext","stateConfig","useStateContext","dataModelFieldValue","undefined","useEffect","setValue","_r","useState","localValue","setLocalValue","rules","pattern","message","rawVal","watch","finalText","_jsxs","style","display","flexDirection","FormHelperText","color","children","Typography","border","concat","borderRadius","minWidth","mainSx","FormControl","Controller","defaultValue","render","field","fieldState","label","placeholder","onChange","e","target"],"mappings":"2oCA0BM,SAAUA,EAAmBC,GAEjC,IAAMC,EAASD,EAAME,QAAQ,OAAQ,IACrC,IAAKD,EAAQ,MAAO,GAMpB,IAHA,IAAIE,EAAS,GACTC,EAAa,MAEGC,EAAAC,EAAAC,EAAeF,EAAAG,OAAfD,IAAiB,CAAhC,IAAME,EAAKJ,EAAAE,GACO,iBAAVE,EAETN,GAAUM,EACDA,aAAiBC,SAEtBN,EAAaH,EAAOO,QACtBL,GAAUF,EAAOG,GACjBA,KAGAD,GAAU,IAGf,CAED,OAAOA,CACT,CAYA,IAAMQ,EAA4D,SAACC,GACjE,IAAAC,EAAMD,EAAAC,OACNC,aACAC,EAAOH,EAAAG,QACPC,EAAOJ,EAAAI,QACJC,EAAKC,EAAAN,EALyD,2CAO3DO,EAAYN,EAAS,CAAEO,eAAgBC,GAAyB,CAAA,EACtE,OACEC,EAACC,EAAYC,EAAA,CAAA,EACPP,EACJ,CAAAQ,QAAQ,WACRC,QAASZ,EACTa,WAAYb,GAAY,KACxBc,UAAW,CACTC,MAAKL,EAAA,CACHM,GAAEN,EAAAA,EAAA,CAAA,EAAOT,GAAO,CAAEgB,MAAO,UACtBZ,GAELa,WAAY,CACVF,GAAId,MAKd,EA4CaiB,EAA8D,SAACrB,GAC1E,IAAAsB,EAAAtB,EAAAuB,cAAAA,OAAgB,IAAAD,GAAKA,EACrBE,EAAgBxB,EAAAyB,SAAhBA,OAAQ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kF,EAAYhF,EAAA,CAAAa,SAAUA,EAAUP,GAAIyE,IAAajC,EAFlDI,GAGE,CAAAuB,SAAA3E,EAACmF,EACC,CAAArC,KAAMA,EACNiB,MAAOA,GACPZ,QAASA,EACTiC,aAAa,GACbC,OAAQ,SAAC/F,SAAEgG,EAAKhG,EAAAgG,MAAEC,EAAUjG,EAAAiG,WAAO,OACjCvF,EAACX,EAAoB,CACnBE,OAAQA,EACRC,SAA4B,UAAlB+F,EAAWnF,aAAO,IAAAQ,OAAA,EAAAA,EAAAqD,QAC5BxE,QAASA,GACTC,QAASA,GACT8F,MAAOpE,EACPqE,YAAapE,EACb3C,MAAO4G,EAAM5G,OAAS,GACtBgH,SAAU,SAACC,GAET,IAAMhH,EAASgH,EAAEC,OAAOlH,MAAME,QAAQ,OAAQ,IAC9C0G,EAAMI,SAAS/G,EAChB,QAU2D,CAAAgG,SACpE3E,EAACX,EAAoB,CACnBE,OAAQA,EACRC,cAAUgE,EACV/D,QAASA,GACTC,QAASA,GACT8F,MAAOpE,EACPqE,YAAapE,EACb3C,MAAOmF,GACP6B,SAAU,SAACC,GACT7B,GAAc6B,EAAEC,OAAOlH,MAAME,QAAQ,OAAQ,UAKvD"}
|
@@ -1,4 +1,10 @@
|
|
1
1
|
import { PhoneNumberInputFieldProps } from './PhoneNumberInputField';
|
2
2
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
3
3
|
export default _default;
|
4
|
-
|
4
|
+
declare type StoryProps = PhoneNumberInputFieldProps & {
|
5
|
+
sourceDataModelFieldValue?: string;
|
6
|
+
};
|
7
|
+
/** Editable scenario with required validation */
|
8
|
+
export declare const EditableRequired: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryProps>;
|
9
|
+
/** Display-only variant reading from stateConfig */
|
10
|
+
export declare const DisplayOnly: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryProps>;
|
@@ -1,19 +1,30 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
|
2
|
+
import { RatingProps } from '@mui/material';
|
3
|
+
export interface RatingMoleculeProps extends Omit<RatingProps, 'onChange'> {
|
4
|
+
/** Label text displayed above or beside the rating */
|
3
5
|
text: string;
|
6
|
+
/** Name used for react-hook-form registration */
|
4
7
|
name: string;
|
8
|
+
/** If true, the user can’t change the rating (renders read-only) */
|
9
|
+
isDisplayOnly?: boolean;
|
10
|
+
/** If true, we show an asterisk and require a non-null rating */
|
11
|
+
required?: boolean;
|
12
|
+
/** Custom error text if `required` is not satisfied */
|
13
|
+
requiredErrorText?: string;
|
14
|
+
/** If some other validation fails, show this text */
|
15
|
+
validationErrorText?: string;
|
16
|
+
/** If true, rating icons will show real-time integer value on hover or selection */
|
17
|
+
hoverFeedback?: boolean;
|
18
|
+
/** For hooking up with state config if you store an initial rating there */
|
19
|
+
sourceDataModelField?: string;
|
20
|
+
/** Some style props for customizing layout/appearance */
|
5
21
|
textAlign?: 'inherit' | 'left' | 'center' | 'right' | 'justify';
|
6
22
|
color?: string;
|
7
23
|
textColor?: string;
|
8
|
-
selectSize?: string;
|
9
24
|
selectColor?: string;
|
10
25
|
fontSize?: number | string;
|
11
26
|
fontFamily?: string;
|
12
|
-
fontWeight?: 'normal' | 'bold';
|
13
|
-
placement?: 'right' | 'left';
|
14
|
-
ratingPrecision?: number;
|
15
|
-
maxValue?: number;
|
16
|
-
hoverFeedback?: boolean;
|
27
|
+
fontWeight?: 'normal' | 'bold' | number;
|
17
28
|
marginLeft?: string;
|
18
29
|
marginTop?: string;
|
19
30
|
marginRight?: string;
|
@@ -22,7 +33,14 @@ export interface RatingMoleculeProps {
|
|
22
33
|
paddingTop?: string;
|
23
34
|
paddingRight?: string;
|
24
35
|
paddingBottom?: string;
|
36
|
+
/** For left or right placement of the hover feedback text */
|
37
|
+
placement?: 'right' | 'left';
|
38
|
+
/** The config item for design-time or telemetry */
|
25
39
|
configurationItemInfo?: Record<string, unknown>;
|
40
|
+
/** Disables rating input in editable mode (MUI prop) */
|
26
41
|
disabled?: boolean;
|
42
|
+
/** If using react-hook-form, we can track field errors. */
|
43
|
+
maxValue?: number;
|
44
|
+
ratingPrecision?: number;
|
27
45
|
}
|
28
46
|
export declare const RatingMolecule: React.FC<RatingMoleculeProps>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__assign as
|
1
|
+
import{__rest as i,__assign as o}from"../../node_modules/tslib/tslib.es6.js";import{jsxs as e,jsx as r,Fragment as t}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useEffect as n,useState as a}from"react";import{useFormContext as d,Controller as l}from"../../node_modules/react-hook-form/dist/index.esm.mjs.js";import m from"../../node_modules/@mui/material/Typography/Typography.js";import g from"../../node_modules/@mui/material/Rating/Rating.js";import s from"../../node_modules/@mui/material/FormControl/FormControl.js";import u from"../../node_modules/@mui/material/Box/Box.js";import c from"../../node_modules/@mui/material/FormHelperText/FormHelperText.js";var f=function(f){var p,v=f.text,h=f.name,x=f.isDisplayOnly,y=void 0!==x&&x,T=f.required,F=void 0!==T&&T,R=f.requiredErrorText,b=void 0===R?"This field is required":R,B=f.validationErrorText,j=void 0===B?"Invalid rating":B,C=f.hoverFeedback,q=void 0!==C&&C,L=f.sourceDataModelField;f.textAlign;var M=f.color,S=void 0===M?"black":M,_=f.textColor,E=f.selectColor,A=f.fontSize,I=void 0===A?14:A,W=f.fontFamily,z=void 0===W?"Arial, sans-serif":W,k=f.fontWeight,D=void 0===k?"normal":k,V=f.marginLeft,O=void 0===V?"0":V,H=f.marginTop,P=void 0===H?"0":H,X=f.marginRight,w=void 0===X?"0":X,G=f.marginBottom,J=void 0===G?"0":G,K=f.paddingLeft,N=void 0===K?"0":K,Q=f.paddingTop,U=void 0===Q?"0":Q,Y=f.paddingRight,Z=void 0===Y?"0":Y,$=f.paddingBottom,ii=void 0===$?"0":$,oi=f.placement,ei=void 0===oi?"right":oi,ri=f.configurationItemInfo,ti=void 0===ri?{}:ri,ni=f.disabled,ai=void 0!==ni&&ni,di=f.maxValue,li=void 0===di?5:di,mi=f.ratingPrecision,gi=void 0===mi?.5:mi,si=i(f,["text","name","isDisplayOnly","required","requiredErrorText","validationErrorText","hoverFeedback","sourceDataModelField","textAlign","color","textColor","selectColor","fontSize","fontFamily","fontWeight","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom","placement","configurationItemInfo","disabled","maxValue","ratingPrecision"]),ui=d(),ci=null==ui?void 0:ui.control,fi=!!ui&&!!ci&&!!h;!fi||ui.formState.errors;var pi=L?null===(p=null==ui?void 0:ui.getFieldState(L))||void 0===p?void 0:p.isTouched:void 0;n((function(){fi&&void 0!==pi&&ui.setValue(h,pi)}),[pi]);var vi=a(null),hi=vi[0],xi=vi[1],yi=a(-1),Ti=yi[0],Fi=yi[1],Ri=_||S,bi=q&&-1!==Ti,Bi="left"===ei,ji="right"===ei,Ci={fontSize:I,fontFamily:z,fontWeight:D,color:Ri,minWidth:"2em",textAlign:"center",visibility:q?"visible":"hidden"},qi={required:!!F&&b,validate:function(i){return null!==i&&0!==i||(!F||b)}};if(y){var Li=null;if(fi){var Mi=ui.watch(h);Li="number"==typeof Mi?Mi:null}else Li=hi;return e(s,o({required:F,sx:{marginLeft:O,marginTop:P,marginRight:w,marginBottom:J,paddingLeft:N,paddingTop:U,paddingRight:Z,paddingBottom:ii,display:"inline-flex"}},ti,{children:[v&&r(m,o({variant:"subtitle1",sx:{fontSize:I,fontFamily:z,fontWeight:D,color:Ri,marginBottom:"4px"}},{children:v})),r(g,o({value:Li||0,max:li,readOnly:!0,sx:{"& .MuiRating-iconEmpty":{color:S},"& .MuiRating-iconFilled":{color:E||S}}},si))]}))}return e(s,o({required:F,sx:{marginLeft:O,marginTop:P,marginRight:w,marginBottom:J,paddingLeft:N,paddingTop:U,paddingRight:Z,paddingBottom:ii,display:"inline-flex"}},ti,{children:[v&&r(m,o({variant:"subtitle1",sx:{fontSize:I,fontFamily:z,fontWeight:D,color:Ri,marginBottom:"4px"}},{children:v})),e(u,o({sx:{display:"flex",alignItems:"center"}},{children:[Bi&&r(m,o({sx:o(o({},Ci),{marginRight:1})},{children:bi?Ti:hi||""})),fi?r(l,{name:h,rules:qi,control:ci,defaultValue:null,render:function(i){var n=i.field,a=i.fieldState.error;return e(t,{children:[r(g,o({value:n.value||0,max:li,precision:gi,disabled:ai,onChange:function(i,o){n.onChange(o)},onChangeActive:q?function(i,o){return Fi(o||-1)}:void 0,sx:{"& .MuiRating-iconEmpty":{color:S},"& .MuiRating-iconFilled":{color:E||S},marginX:q?1:0}},si)),a&&r(c,o({error:!0,sx:{marginTop:"4px"}},{children:"required"===a.type?b:j}))]})}}):r(t,{children:r(g,o({value:hi||0,max:li,precision:gi,disabled:ai,onChange:function(i,o){return xi(o)},onChangeActive:q?function(i,o){return Fi(o||-1)}:void 0,sx:{"& .MuiRating-iconEmpty":{color:S},"& .MuiRating-iconFilled":{color:E||S},marginX:q?1:0}},si))}),ji&&r(m,o({sx:o(o({},Ci),{marginLeft:1})},{children:bi?Ti:hi||""}))]}))]}))};export{f as RatingMolecule};
|
2
2
|
//# sourceMappingURL=Rating.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Rating.js","sources":["../../../../../src/molecules/Rating/Rating.tsx"],"sourcesContent":[null],"names":["RatingMolecule","_a","text","name","
|
1
|
+
{"version":3,"file":"Rating.js","sources":["../../../../../src/molecules/Rating/Rating.tsx"],"sourcesContent":[null],"names":["RatingMolecule","_a","text","name","_c","isDisplayOnly","_d","required","_f","requiredErrorText","_g","validationErrorText","_h","hoverFeedback","sourceDataModelField","_k","color","textColor","selectColor","_l","fontSize","_m","fontFamily","_o","fontWeight","_p","marginLeft","_q","marginTop","_r","marginRight","_s","marginBottom","_t","paddingLeft","_u","paddingTop","_v","paddingRight","_w","paddingBottom","_x","placement","_y","configurationItemInfo","_z","disabled","_0","maxValue","_1","ratingPrecision","muiRatingProps","__rest","formContext","useFormContext","control","isInFormContext","formState","errors","dataModelFieldValue","_b","getFieldState","isTouched","undefined","useEffect","setValue","_2","useState","internalValue","setInternalValue","_3","hoverValue","setHoverValue","labelColor","showHoverText","hoverOnLeft","hoverOnRight","hoverTextSx","minWidth","textAlign","visibility","validationRules","validate","value","displayValue","formValue","watch","_jsxs","FormControl","__assign","sx","display","children","_jsx","Typography","variant","Rating","max","readOnly","Box","alignItems","Controller","rules","defaultValue","render","field","error","fieldState","_Fragment","precision","onChange","_e","newValue","onChangeActive","newHover","marginX","FormHelperText","type"],"mappings":"0sBAkEO,IAAMA,EAAgD,SAACC,SAC5DC,EAAID,EAAAC,KACJC,EAAIF,EAAAE,KACJC,kBAAAC,OAAgB,IAAAD,KAChBE,EAAAL,EAAAM,SAAAA,OAAQ,IAAAD,GAAQA,EAChBE,EAA4CP,EAAAQ,kBAA5CA,OAAoB,IAAAD,EAAA,2BACpBE,EAAAT,EAAAU,oBAAAA,OAAmB,IAAAD,EAAG,iBAAgBA,EACtCE,EAAqBX,EAAAY,cAArBA,OAAgB,IAAAD,KAEhBE,EAAoBb,EAAAa,iCAEpB,IAAAC,EAAed,EAAAe,MAAfA,OAAK,IAAAD,EAAG,QAAOA,EACfE,EAAShB,EAAAgB,UACTC,EAAWjB,EAAAiB,YACXC,EAAalB,EAAAmB,SAAbA,OAAW,IAAAD,EAAA,KACXE,EAAApB,EAAAqB,WAAAA,OAAU,IAAAD,EAAG,oBAAmBA,EAChCE,eAAAC,aAAa,SAAQD,EACrBE,EAAgBxB,EAAAyB,WAAhBA,OAAU,IAAAD,EAAG,IAAGA,EAChBE,cAAAC,aAAY,IAAGD,EACfE,EAAA5B,EAAA6B,YAAAA,OAAW,IAAAD,EAAG,IAAGA,EACjBE,iBAAAC,OAAe,IAAAD,EAAA,MACfE,EAAAhC,EAAAiC,YAAAA,OAAW,IAAAD,EAAG,IAAGA,EACjBE,EAAgBlC,EAAAmC,WAAhBA,OAAa,IAA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iB,aAM3D"}
|
@@ -1,4 +1,10 @@
|
|
1
1
|
import { RatingMoleculeProps } from './Rating';
|
2
|
-
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R,
|
2
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
3
3
|
export default _default;
|
4
|
-
|
4
|
+
/** 1) Editable rating with validation */
|
5
|
+
export declare const Editable: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, RatingMoleculeProps>;
|
6
|
+
/** 2) Display-only rating (read only) */
|
7
|
+
export declare const DisplayOnly: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, RatingMoleculeProps>;
|
8
|
+
/** 3) Disabled rating input */
|
9
|
+
export declare const Disabled: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, RatingMoleculeProps>;
|
10
|
+
export declare const Standalone: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, RatingMoleculeProps>;
|
@@ -1,17 +1,29 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { TypographyProps } from '@mui/material';
|
3
3
|
import { ConfigurationItemInfo } from 'containers';
|
4
|
+
export interface SelectMoleculeOption {
|
5
|
+
id: string;
|
6
|
+
value: string;
|
7
|
+
}
|
4
8
|
export interface SelectMoleculeProps {
|
9
|
+
/** Label text (visible above or inside the select) */
|
5
10
|
text: string;
|
6
|
-
options
|
7
|
-
|
8
|
-
|
9
|
-
}[];
|
11
|
+
/** Dropdown options. Each has { id, value } or you can supply string[] */
|
12
|
+
options: SelectMoleculeOption[] | string[];
|
13
|
+
/** For a placeholder, you might use the first item or do a custom approach */
|
10
14
|
placeholderText?: string;
|
11
|
-
|
15
|
+
/** If true, the field is required in form validation */
|
12
16
|
required?: boolean;
|
17
|
+
/** Use this text if required == true and no value selected */
|
18
|
+
requiredErrorText?: string;
|
19
|
+
/** Use this text if user fails some extra validation pattern */
|
20
|
+
validationErrorText?: string;
|
21
|
+
/** If true, show a text label instead of an interactive dropdown */
|
22
|
+
isDisplayOnly?: boolean;
|
23
|
+
/** CSS style props */
|
24
|
+
fontSize?: number | string;
|
13
25
|
fontFamily?: TypographyProps['fontFamily'];
|
14
|
-
fontWeight?: 'normal' | 'bold';
|
26
|
+
fontWeight?: 'normal' | 'bold' | number;
|
15
27
|
textColor?: string;
|
16
28
|
textAlign?: TypographyProps['textAlign'];
|
17
29
|
borderColor?: string;
|
@@ -25,8 +37,11 @@ export interface SelectMoleculeProps {
|
|
25
37
|
paddingTop?: string;
|
26
38
|
paddingRight?: string;
|
27
39
|
paddingBottom?: string;
|
40
|
+
/** Additional config from system (e.g. for selection in config mode) */
|
28
41
|
configurationItemInfo?: ConfigurationItemInfo;
|
42
|
+
/** The name of the field in react-hook-form */
|
29
43
|
name: string;
|
44
|
+
/** The data field in global stateConfig to populate/initialize value */
|
30
45
|
sourceDataModelField?: string;
|
31
46
|
}
|
32
47
|
export declare const SelectMolecule: React.FC<SelectMoleculeProps>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__rest as
|
1
|
+
import{__rest as e,__assign as t}from"../../node_modules/tslib/tslib.es6.js";import{jsxs as o,jsx as r,Fragment as i}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import n,{useEffect as l,useMemo as a,useState as d}from"react";import{useFormContext as u,Controller as m}from"../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../contexts/FormStepContext/FormStepContext.js";import"../../contexts/ButtonActionsContext/ButtonActionsContext.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../contexts/OrganismContext/OrganismContext.js";import{useStateContext as c}from"../../contexts/hooks/useStateContext.js";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import s from"../../node_modules/@mui/material/FormHelperText/FormHelperText.js";import f from"../../node_modules/@mui/material/Typography/Typography.js";import g from"../../node_modules/@mui/material/InputLabel/InputLabel.js";import p from"../../node_modules/@mui/material/FormControl/FormControl.js";import x from"../../node_modules/@mui/material/MenuItem/MenuItem.js";import h from"../../node_modules/@mui/material/Select/Select.js";var v=function(v){var C=v.text,b=v.options,y=v.placeholderText,T=v.required,j=void 0!==T&&T,S=v.requiredErrorText,F=void 0===S?"This field is required":S,I=v.validationErrorText,B=void 0===I?"Invalid format":I,M=v.isDisplayOnly,L=void 0!==M&&M,R=v.fontSize,O=v.fontFamily,q=v.fontWeight,_=v.textColor,A=v.textAlign,W=v.borderColor,z=v.color,k=v.backgroundColor,w=v.marginLeft,D=void 0===w?"0":w,V=v.marginTop,E=void 0===V?"0":V,H=v.marginRight,G=void 0===H?"0":H,J=v.marginBottom,K=void 0===J?"0":J,N=v.paddingLeft,P=void 0===N?"0":N,Q=v.paddingTop,U=void 0===Q?"0":Q,X=v.paddingRight,Y=void 0===X?"0":X,Z=v.paddingBottom,$=void 0===Z?"0":Z,ee=v.configurationItemInfo,te=void 0===ee?{}:ee,oe=v.name,re=v.sourceDataModelField,ie=e(v,["text","options","placeholderText","required","requiredErrorText","validationErrorText","isDisplayOnly","fontSize","fontFamily","fontWeight","textColor","textAlign","borderColor","color","backgroundColor","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom","configurationItemInfo","name","sourceDataModelField"]),ne=u(),le=null==ne?void 0:ne.control,ae=!!ne&&!!le&&!!oe,de=ae?ne.formState.errors:{},ue=c().stateConfig,me=re?null==ue?void 0:ue[re]:void 0;l((function(){void 0!==me&&ae&&(null==ne||ne.setValue(oe,me))}),[me]);var ce=a((function(){return{required:!!j&&F,validate:function(e){return!0}}}),[j,F,B]),se=d(""),fe=se[0],ge=se[1],pe=a((function(){return b?b.map((function(e){return"string"==typeof e?{id:e,value:e}:e})):[]}),[b]);if(L){var xe="";if(ae){var he=ne.watch(oe);xe=he||""}else xe=fe;var ve=pe.find((function(e){return e.value===xe})),Ce=ve?ve.value:xe||y||"-";return o("div",t({style:{display:"inline-flex",flexDirection:"column",marginTop:E,marginRight:G,marginBottom:K,marginLeft:D}},te,{children:[C&&r("div",t({style:{marginBottom:4}},{children:r(s,t({sx:{fontSize:R,fontFamily:O,fontWeight:q,color:_||"#000",marginLeft:0}},{children:C}))})),r(f,t({sx:{fontSize:R,fontFamily:O,fontWeight:q,color:_,paddingLeft:P,paddingTop:U,paddingRight:Y,paddingBottom:$,backgroundColor:k,border:"1px solid ".concat(W||"#ccc"),borderRadius:"4px",minWidth:"120px"}},{children:Ce}))]}))}var be={fontSize:R,fontFamily:O,fontWeight:q,color:z,"& .MuiOutlinedInput-notchedOutline":{borderColor:W||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:W||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:W||"inherit"},"& .MuiSelect-select":{display:"flex",alignItems:"center",justifyContent:n.useMemo((function(){switch(A){case"center":return"center";case"right":return"flex-end";case"justify":return"space-between";default:return"flex-start"}}),[A]),backgroundColor:k,textAlign:A,boxSizing:"border-box",paddingLeft:P,paddingTop:U,paddingRight:Y,paddingBottom:$}},ye={color:_||"rgba(0, 0, 0, 0.6)",fontSize:R,fontFamily:O,fontWeight:q,textAlign:A,"&.Mui-focused":{color:_||"rgba(0, 0, 0, 0.6)"}},Te={marginLeft:D,marginTop:E,marginRight:G,marginBottom:K,minWidth:"200px"},je=function(e){return o(h,t({},e||{},{labelId:"select-label-".concat(oe),id:"select-".concat(oe),label:C,renderValue:function(e){if(!e)return y||"";var t=pe.find((function(t){return t.value===e}));return t?t.value:e},sx:be,onChange:function(t){var o=t.target.value;(null==e?void 0:e.onChange)?e.onChange(o):ge(o)}},ie,{children:[y&&r(x,t({disabled:!0,value:""},{children:y})),pe.map((function(e,o){return r(x,t({value:e.value},{children:e.value}),o)}))]}))};if(ae){var Se=de[oe];return o(p,t({variant:"outlined",sx:Te,error:!!Se,required:j},te,{children:[r(g,t({id:"select-label-".concat(oe),sx:ye},{children:C})),r(m,{name:oe,rules:ce,control:le,defaultValue:"",render:function(e){var t=e.field,n=e.fieldState;return o(i,{children:[je(t),!!n.error&&r(s,{children:"required"===n.error.type?F:B})]})}})]}))}return o(p,t({variant:"outlined",sx:Te,required:j},te,{children:[r(g,t({id:"select-label-".concat(oe),sx:ye},{children:C})),je()]}))};export{v as SelectMolecule};
|
2
2
|
//# sourceMappingURL=Select.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../../../src/molecules/Select/Select.tsx"],"sourcesContent":[null],"names":["SelectMolecule","_a","text","options","
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../../src/molecules/Select/Select.tsx"],"sourcesContent":[null],"names":["SelectMolecule","_a","text","options","placeholderText","_b","required","_c","requiredErrorText","_d","validationErrorText","_e","isDisplayOnly","fontSize","fontFamily","fontWeight","textColor","textAlign","borderColor","color","backgroundColor","_f","marginLeft","_g","marginTop","_h","marginRight","_j","marginBottom","_k","paddingLeft","_l","paddingTop","_m","paddingRight","_o","paddingBottom","_p","configurationItemInfo","name","sourceDataModelField","props","__rest","formContext","useFormContext","control","isInFormContext","errors","formState","stateConfig","useStateContext","dataModelFieldValue","undefined","useEffect","setValue","rules","useMemo","validate","value","_q","useState","internalValue","setInternalValue","normalizedOptions","map","item","id","displayValue_1","formValue","watch","matchedOption","find","o","visibleText","_jsxs","__assign","style","display","flexDirection","children","_jsx","FormHelperText","sx","Typography","border","concat","borderRadius","minWidth","inputSx","alignItems","justifyContent","React","boxSizing","labelSx","formControlSx","renderSelect","field","MuiSelect","labelId","label","renderValue","selectedValue","selectedOption","onChange","event","target","MenuItem","disabled","option","index","fieldError","FormControl","variant","error","InputLabel","Controller","defaultValue","render","fieldState","_Fragment","type"],"mappings":"+rCA0EO,IAAMA,EAAgD,SAACC,GAC5D,IAAAC,EAAID,EAAAC,KACJC,EAAOF,EAAAE,QACPC,EAAeH,EAAAG,gBACfC,EAAAJ,E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AS/B,EAAA,CAAAgC,UAAS,EAAAjD,MAAM,IAAE,CAAAqB,SACxB3E,KAGJ2D,GAAkBC,KAAI,SAAC4C,EAAQC,GAAU,OACxC7B,EAAC0B,EAAQ/B,EAAA,CAAajB,MAAOkD,EAAOlD,OACjC,CAAAqB,SAAA6B,EAAOlD,QADKmD,EAGhB,SAKL,GAAI/D,GAAiB,CACnB,IAAMgE,GAAa/D,GAAOR,IAE1B,OACEmC,EAACqC,EAAWpC,EAAA,CACVqC,QAAQ,WACR9B,GAAIY,GACJmB,QAASH,GACTxG,SAAUA,GACNgC,GAAqB,CAAAyC,SAAA,CACzBC,EAACkC,EAAWvC,EAAA,CAAAT,GAAI,gBAAgBmB,OAAA9C,IAAQ2C,GAAIW,IAAO,CAAAd,SAChD7E,KAEH8E,EAACmC,EAAU,CACT5E,KAAMA,GACNgB,MAAOA,GACPV,QAASA,GACTuE,aAAc,GACdC,OAAQ,SAACpH,OAAE+F,EAAK/F,EAAA+F,MAAEsB,EAAUrH,EAAAqH,WAAO,OACjC5C,EAAA6C,EAAA,CAAAxC,SAAA,CACGgB,GAAaC,KACXsB,EAAWL,OACZjC,EAACC,EAAc,CAAAF,SACc,aAA1BuC,EAAWL,MAAMO,KAAsBhH,EAAoBE,aAQ3E,CAGD,OACEgE,EAACqC,EACCpC,EAAA,CAAAqC,QAAQ,WACR9B,GAAIY,GACJxF,SAAUA,GACNgC,GACJ,CAAAyC,SAAA,CAAAC,EAACkC,EAAUvC,EAAA,CAACT,GAAI,gBAAAmB,OAAgB9C,IAAQ2C,GAAIW,IAAO,CAAAd,SAChD7E,KAEF6F,QAGP"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { SelectMoleculeProps } from './Select';
|
2
2
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
3
3
|
export default _default;
|
4
|
-
export declare const
|
5
|
-
export declare const
|
4
|
+
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, SelectMoleculeProps>;
|
5
|
+
export declare const DisplayOnly: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, SelectMoleculeProps>;
|
6
|
+
export declare const WithCustomValidation: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, SelectMoleculeProps>;
|
@@ -1,9 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { SliderProps } from '@mui/material';
|
3
3
|
import { ConfigurationItemInfo } from 'containers';
|
4
|
-
export
|
4
|
+
export interface SliderMoleculeProps extends Omit<SliderProps, 'onChange'> {
|
5
|
+
/** If true, the slider is displayed disabled + text showing the value. */
|
6
|
+
isDisplayOnly?: boolean;
|
7
|
+
/** If true, rely on FormControl to show a required asterisk. */
|
5
8
|
required?: boolean;
|
6
|
-
|
9
|
+
requiredErrorText?: string;
|
10
|
+
validationErrorText?: string;
|
11
|
+
text?: string;
|
7
12
|
startIcon?: string;
|
8
13
|
endIcon?: string;
|
9
14
|
borderColor?: string;
|
@@ -13,17 +18,17 @@ export declare type SliderMoleculeProps = SliderProps & {
|
|
13
18
|
textColor?: string;
|
14
19
|
fontSize?: number | string;
|
15
20
|
fontFamily?: string;
|
16
|
-
fontWeight?: 'normal' | 'bold';
|
17
|
-
|
18
|
-
|
21
|
+
fontWeight?: 'normal' | 'bold' | number;
|
22
|
+
valueFormat?: string;
|
23
|
+
valueDisplay?: 'on' | 'off' | 'auto';
|
19
24
|
iconSize?: string;
|
20
25
|
selectColor?: string;
|
21
26
|
iconColor?: string;
|
22
27
|
minValue?: number;
|
23
28
|
maxValue?: number;
|
24
|
-
valueFormat?: string;
|
25
|
-
valueDisplay?: 'on' | 'off' | 'auto';
|
26
29
|
step?: number;
|
30
|
+
/** label's placement relative to the slider+icons */
|
31
|
+
labelPlacement?: 'top' | 'bottom';
|
27
32
|
marginLeft?: string;
|
28
33
|
marginTop?: string;
|
29
34
|
marginRight?: string;
|
@@ -33,7 +38,11 @@ export declare type SliderMoleculeProps = SliderProps & {
|
|
33
38
|
paddingRight?: string;
|
34
39
|
paddingBottom?: string;
|
35
40
|
configurationItemInfo?: ConfigurationItemInfo;
|
41
|
+
/** For hooking up with react-hook-form */
|
36
42
|
name?: string;
|
37
43
|
sourceDataModelField?: string;
|
38
|
-
}
|
44
|
+
}
|
45
|
+
/**
|
46
|
+
* SliderMolecule
|
47
|
+
*/
|
39
48
|
export declare const SliderMolecule: React.FC<SliderMoleculeProps>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__rest as
|
1
|
+
import{__rest as o,__assign as e}from"../../node_modules/tslib/tslib.es6.js";import{jsxs as t,jsx as i,Fragment as r}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useEffect as n,useState as a}from"react";import{IconRenderer as l}from"../Icon/IconRenderer.js";import{useFormContext as d,Controller as m}from"../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../contexts/FormStepContext/FormStepContext.js";import"../../contexts/ButtonActionsContext/ButtonActionsContext.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../contexts/OrganismContext/OrganismContext.js";import{useStateContext as c}from"../../contexts/hooks/useStateContext.js";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import s from"../../node_modules/@mui/material/FormLabel/FormLabel.js";import u from"../../node_modules/@mui/material/Box/Box.js";import p from"../../node_modules/@mui/material/Slider/Slider.js";import g from"../../node_modules/@mui/material/Typography/Typography.js";import x from"../../node_modules/@mui/material/FormControl/FormControl.js";import f from"../../node_modules/@mui/material/FormHelperText/FormHelperText.js";var h=function(h){var C=h.isDisplayOnly,b=void 0!==C&&C,y=h.required,F=void 0!==y&&y,L=h.requiredErrorText,S=void 0===L?"This field is required":L,T=h.validationErrorText,j=void 0===T?"Invalid value":T,z=h.text,B=h.startIcon,I=h.endIcon,w=h.borderColor,D=h.selectLineColor,R=h.lineWeight,M=void 0===R?1:R,q=h.orientation,V=void 0===q?"horizontal":q,_=h.textColor,W=h.fontSize,k=h.fontFamily,A=h.fontWeight,E=h.valueFormat,N=h.valueDisplay,O=void 0===N?"auto":N,$=h.iconSize,H=h.selectColor,P=h.iconColor,G=h.minValue,J=void 0===G?0:G,K=h.maxValue,Q=void 0===K?100:K,U=h.step,X=h.labelPlacement,Y=void 0===X?"top":X,Z=h.marginLeft,oo=void 0===Z?"0":Z,eo=h.marginTop,to=void 0===eo?"0":eo,io=h.marginRight,ro=void 0===io?"0":io,no=h.marginBottom,ao=void 0===no?"0":no,lo=h.paddingLeft,mo=void 0===lo?"0":lo,co=h.paddingTop,so=void 0===co?"0":co,uo=h.paddingRight,po=void 0===uo?"0":uo,go=h.paddingBottom,xo=void 0===go?"0":go,fo=h.configurationItemInfo,ho=h.name,vo=h.sourceDataModelField,Co=h.disabled,bo=void 0!==Co&&Co,yo=o(h,["isDisplayOnly","required","requiredErrorText","validationErrorText","text","startIcon","endIcon","borderColor","selectLineColor","lineWeight","orientation","textColor","fontSize","fontFamily","fontWeight","valueFormat","valueDisplay","iconSize","selectColor","iconColor","minValue","maxValue","step","labelPlacement","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom","configurationItemInfo","name","sourceDataModelField","disabled"]),Fo=d(),Lo=null==Fo?void 0:Fo.control,So=!!Lo&&!!ho,To={required:!!F&&S,validate:function(o){return!F||null!=o||S}},jo=c().stateConfig,zo=vo?null==jo?void 0:jo[vo]:void 0;n((function(){void 0!==zo&&So&&ho&&Fo.setValue(ho,zo)}),[zo]);var Bo=a(J),Io=Bo[0],wo=Bo[1],Do=function(o){return function(o,e){switch(e){case"$0.00":return"$".concat(o.toFixed(2));case"$123":return"$".concat(o);case"%0.00":return"".concat(o.toFixed(2),"%");case"%123":return"".concat(o,"%");case"0.0":return o.toFixed(1);case"0.00":return o.toFixed(2);default:return o.toString()}}(o,E)};if(b){var Ro=J;if(So){var Mo=Fo.watch(ho);Ro="number"==typeof Mo?Mo:J}else Ro=Io;return t(x,e({required:F,sx:{marginLeft:oo,marginTop:to,marginRight:ro,marginBottom:ao,paddingLeft:mo,paddingTop:so,paddingRight:po,paddingBottom:xo,display:"inline-flex"}},fo,{children:[z&&i(s,{children:z}),t(u,e({display:"flex",flexDirection:"top"===Y?"column":"row",alignItems:"center",mt:"top"===Y?1:0},{children:[B&&i(u,e({mr:"horizontal"===V?1:0,mb:"vertical"===V?1:0},{children:i(l,{iconName:B,color:P})})),i(p,e({disabled:!0,value:Ro,min:J,max:Q,step:U,orientation:V,valueLabelDisplay:O,valueLabelFormat:Do,sx:v({borderColor:w,selectLineColor:D,lineWeight:M,orientation:V,selectColor:H,iconSize:$})},yo)),I&&i(u,e({ml:"horizontal"===V?1:0,mt:"vertical"===V?1:0},{children:i(l,{iconName:I,color:P})})),i(g,e({sx:{ml:1,fontSize:W,fontFamily:k,fontWeight:A,color:_}},{children:Do(Ro)}))]}))]}))}var qo=v({borderColor:w,selectLineColor:D,lineWeight:M,orientation:V,selectColor:H,iconSize:$}),Vo=So?i(m,{name:ho,rules:To,control:Lo,defaultValue:J,render:function(o){var n,a=o.field,l=o.fieldState;return t(r,{children:[i(p,e({},yo,{disabled:bo,value:null!==(n=a.value)&&void 0!==n?n:J,min:J,max:Q,step:U,orientation:V,valueLabelDisplay:O,valueLabelFormat:Do,sx:qo,onChange:function(o,e){return a.onChange(e)}})),l.error&&i(f,e({error:!0,sx:{marginTop:"4px"}},{children:"required"===l.error.type?S:j}))]})}}):i(p,e({},yo,{disabled:bo,value:Io,min:J,max:Q,step:U,orientation:V,valueLabelDisplay:O,valueLabelFormat:Do,sx:qo,onChange:function(o,e){"number"==typeof e&&wo(e)}}));return t(x,e({required:F,sx:{marginLeft:oo,marginTop:to,marginRight:ro,marginBottom:ao,paddingLeft:mo,paddingTop:so,paddingRight:po,paddingBottom:xo,display:"inline-flex"}},fo,{children:[z&&i(s,{children:z}),t(u,e({display:"flex",flexDirection:"top"===Y?"column":"row",alignItems:"center",mt:"top"===Y?1:0},{children:[B&&i(u,e({mr:"horizontal"===V?1:0,mb:"vertical"===V?1:0},{children:i(l,{iconName:B,color:P})})),Vo,I&&i(u,e({ml:"horizontal"===V?1:0,mt:"vertical"===V?1:0},{children:i(l,{iconName:I,color:P})}))]}))]}))};function v(o){var t=o.borderColor,i=o.selectLineColor,r=o.lineWeight,n=void 0===r?1:r,a=o.orientation,l=void 0===a?"horizontal":a,d=o.selectColor,m=o.iconSize,c="vertical"===l;return e(e({},c?{height:"250px",margin:"0 8px"}:{width:"250px"}),{"& .MuiSlider-rail":e({backgroundColor:t||"#ccc"},c?{width:"".concat(n,"px")}:{height:"".concat(n,"px")}),"& .MuiSlider-track":e({backgroundColor:i||"#2196f3",border:"1px solid ".concat(i||"#2196f3")},c?{width:"".concat(n,"px")}:{height:"".concat(n,"px")}),"& .MuiSlider-thumb":{backgroundColor:d||"#2196f3",width:m||"16px",height:m||"16px",boxShadow:"none","&:focus, &:hover, &.Mui-active, &.Mui-focusVisible":{boxShadow:"none"}},"& .MuiSlider-thumb:before":{content:"none"}})}export{h as SliderMolecule};
|
2
2
|
//# sourceMappingURL=Slider.js.map
|