formik-form-components 0.2.25 → 0.2.26
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/index.d.ts +95 -71
- package/dist/index.js +476 -100
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +478 -102
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useFormikContext, Formik, Form as Form$1, ErrorMessage } from 'formik';
|
|
2
|
-
import { forwardRef,
|
|
3
|
-
import { Box, useTheme, FormControl, Typography, FormHelperText, TextField, InputLabel, FormLabel, RadioGroup, FormControlLabel, Radio, Stack, Rating, Autocomplete,
|
|
2
|
+
import { forwardRef, useCallback, createElement, memo, useState, useMemo, useEffect } from 'react';
|
|
3
|
+
import { Box, useTheme, FormControl, Typography, FormHelperText, TextField, InputLabel, FormLabel, RadioGroup, FormControlLabel, Radio, Stack, Rating, Autocomplete, Checkbox, Chip, MenuItem, Switch, InputAdornment, IconButton, Tooltip, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Paper, Menu } from '@mui/material';
|
|
4
4
|
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
|
5
5
|
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
6
6
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
@@ -64,14 +64,16 @@ var AppDatePicker = forwardRef(
|
|
|
64
64
|
onChange: handleChange,
|
|
65
65
|
format,
|
|
66
66
|
disabled,
|
|
67
|
+
slots: {
|
|
68
|
+
openPickerIcon: CalendarMonthIcon
|
|
69
|
+
},
|
|
67
70
|
slotProps: {
|
|
68
71
|
textField: {
|
|
69
72
|
variant: "outlined",
|
|
70
73
|
fullWidth: true,
|
|
71
74
|
error: isTouched && Boolean(fieldError),
|
|
72
75
|
helperText: isTouched && fieldError ? fieldError : void 0,
|
|
73
|
-
sx: textFieldSx
|
|
74
|
-
openPickerIcon: CalendarMonthIcon
|
|
76
|
+
sx: textFieldSx
|
|
75
77
|
}
|
|
76
78
|
},
|
|
77
79
|
...otherProps
|
|
@@ -11838,106 +11840,447 @@ var AppSearchableMultiSelector = forwardRef(
|
|
|
11838
11840
|
);
|
|
11839
11841
|
AppSearchableMultiSelector.displayName = "AppSearchableMultiSelector";
|
|
11840
11842
|
var AppSearchableMultiSelector_default = AppSearchableMultiSelector;
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11843
|
+
var AppSearchableMultiSelector2 = forwardRef((props, ref) => {
|
|
11844
|
+
const {
|
|
11845
|
+
name,
|
|
11846
|
+
label,
|
|
11847
|
+
multiple = true,
|
|
11848
|
+
options = [],
|
|
11849
|
+
setSearchQuery,
|
|
11850
|
+
required = false,
|
|
11851
|
+
variant = "outlined",
|
|
11852
|
+
disabled = false,
|
|
11853
|
+
readOnly = false,
|
|
11854
|
+
showHelperText = false,
|
|
11855
|
+
helperText,
|
|
11856
|
+
maxSelections,
|
|
11857
|
+
showSelectedCount = false,
|
|
11858
|
+
sx,
|
|
11859
|
+
formControlSx,
|
|
11860
|
+
labelSx,
|
|
11861
|
+
inputSx,
|
|
11862
|
+
textFieldSx,
|
|
11863
|
+
autocompleteSx,
|
|
11864
|
+
listboxSx,
|
|
11865
|
+
optionSx,
|
|
11866
|
+
chipSx,
|
|
11867
|
+
errorSx,
|
|
11868
|
+
helperTextSx,
|
|
11869
|
+
selectedCountSx,
|
|
11870
|
+
renderInput: externalRenderInput,
|
|
11871
|
+
renderOption: externalRenderOption,
|
|
11872
|
+
renderTags: externalRenderTags,
|
|
11873
|
+
renderGroup: externalRenderGroup,
|
|
11874
|
+
labelComponent: LabelComponent = InputLabel,
|
|
11875
|
+
inputComponent: InputComponent = "input",
|
|
11876
|
+
errorComponent: ErrorComponent = Typography,
|
|
11877
|
+
helperTextComponent: HelperTextComponent = FormHelperText,
|
|
11878
|
+
labelProps = {},
|
|
11879
|
+
inputProps = {},
|
|
11880
|
+
textFieldProps = {},
|
|
11881
|
+
autocompleteProps = {},
|
|
11882
|
+
checkboxProps = {},
|
|
11883
|
+
chipProps = {},
|
|
11884
|
+
errorProps = {},
|
|
11885
|
+
helperTextProps = {},
|
|
11886
|
+
className = "",
|
|
11887
|
+
formControlClassName = "",
|
|
11888
|
+
labelClassName = "",
|
|
11889
|
+
inputClassName = "",
|
|
11890
|
+
textFieldClassName = "",
|
|
11891
|
+
autocompleteClassName = "",
|
|
11892
|
+
listboxClassName = "",
|
|
11893
|
+
optionClassName = "",
|
|
11894
|
+
chipClassName = "",
|
|
11895
|
+
errorClassName = "",
|
|
11896
|
+
helperTextClassName = "",
|
|
11897
|
+
onInputChange: externalOnInputChange,
|
|
11898
|
+
onChange: externalOnChange,
|
|
11899
|
+
onOpen,
|
|
11900
|
+
onClose,
|
|
11901
|
+
onBlur: externalOnBlur,
|
|
11902
|
+
onFocus: externalOnFocus,
|
|
11903
|
+
onClear,
|
|
11904
|
+
onMaxSelectionsReached,
|
|
11905
|
+
onRemove,
|
|
11906
|
+
onAdd,
|
|
11907
|
+
...otherProps
|
|
11908
|
+
} = props;
|
|
11909
|
+
useTheme();
|
|
11910
|
+
const { values, setFieldValue, errors, touched, setFieldTouched } = useFormikContext();
|
|
11853
11911
|
const fieldError = _19.get(errors, name);
|
|
11854
|
-
const isTouched = _19.get(touched, name);
|
|
11912
|
+
const isTouched = Boolean(_19.get(touched, name));
|
|
11913
|
+
const hasError = Boolean(fieldError) && isTouched;
|
|
11855
11914
|
const val = _19.get(values, name);
|
|
11856
|
-
const
|
|
11857
|
-
const
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11915
|
+
const selectedValues = Array.isArray(val) ? val : [];
|
|
11916
|
+
const selectedCount = selectedValues.length;
|
|
11917
|
+
const handleChange = useCallback(
|
|
11918
|
+
(event, value, reason, details) => {
|
|
11919
|
+
const normalizedValue = (() => {
|
|
11920
|
+
if (value === null)
|
|
11921
|
+
return [];
|
|
11922
|
+
const arr = Array.isArray(value) ? value : [value];
|
|
11923
|
+
return arr.map(
|
|
11924
|
+
(item) => typeof item === "string" ? { value: item, label: item } : item
|
|
11925
|
+
);
|
|
11926
|
+
})();
|
|
11927
|
+
if (maxSelections && normalizedValue.length > maxSelections) {
|
|
11928
|
+
onMaxSelectionsReached == null ? void 0 : onMaxSelectionsReached(maxSelections);
|
|
11929
|
+
return;
|
|
11930
|
+
}
|
|
11931
|
+
if (reason === "selectOption" || reason === "removeOption") {
|
|
11932
|
+
const added = normalizedValue.filter(
|
|
11933
|
+
(item) => !selectedValues.some((v) => v.value === item.value)
|
|
11934
|
+
);
|
|
11935
|
+
const removed = selectedValues.filter(
|
|
11936
|
+
(item) => !normalizedValue.some((v) => v.value === item.value)
|
|
11937
|
+
);
|
|
11938
|
+
added.forEach((item) => onAdd == null ? void 0 : onAdd(item));
|
|
11939
|
+
removed.forEach((item) => onRemove == null ? void 0 : onRemove(item));
|
|
11940
|
+
}
|
|
11941
|
+
setFieldValue(name, normalizedValue, true);
|
|
11942
|
+
externalOnChange == null ? void 0 : externalOnChange(event, normalizedValue, reason);
|
|
11943
|
+
},
|
|
11944
|
+
[
|
|
11945
|
+
maxSelections,
|
|
11946
|
+
selectedValues,
|
|
11947
|
+
setFieldValue,
|
|
11948
|
+
name,
|
|
11949
|
+
onMaxSelectionsReached,
|
|
11950
|
+
onAdd,
|
|
11951
|
+
onRemove,
|
|
11952
|
+
externalOnChange
|
|
11953
|
+
]
|
|
11954
|
+
);
|
|
11955
|
+
const handleInputChange = useCallback(
|
|
11956
|
+
(event, value, reason) => {
|
|
11957
|
+
setSearchQuery == null ? void 0 : setSearchQuery(value);
|
|
11958
|
+
externalOnInputChange == null ? void 0 : externalOnInputChange(event, value, reason);
|
|
11959
|
+
},
|
|
11960
|
+
[setSearchQuery, externalOnInputChange]
|
|
11961
|
+
);
|
|
11962
|
+
const handleBlur = useCallback(
|
|
11963
|
+
(event) => {
|
|
11964
|
+
setFieldTouched(name, true, true);
|
|
11965
|
+
externalOnBlur == null ? void 0 : externalOnBlur(event);
|
|
11966
|
+
},
|
|
11967
|
+
[name, setFieldTouched, externalOnBlur]
|
|
11968
|
+
);
|
|
11969
|
+
const handleFocus = useCallback(
|
|
11970
|
+
(event) => {
|
|
11971
|
+
externalOnFocus == null ? void 0 : externalOnFocus(event);
|
|
11972
|
+
},
|
|
11973
|
+
[externalOnFocus]
|
|
11974
|
+
);
|
|
11975
|
+
const filterOptions = useCallback(
|
|
11976
|
+
(options2, { inputValue }) => {
|
|
11977
|
+
if (!inputValue)
|
|
11978
|
+
return options2;
|
|
11979
|
+
const inputValueLower = inputValue.toLowerCase();
|
|
11980
|
+
return options2.filter(
|
|
11981
|
+
(option) => {
|
|
11982
|
+
var _a, _b, _c, _d;
|
|
11983
|
+
return ((_a = option == null ? void 0 : option.label) == null ? void 0 : _a.toLowerCase().includes(inputValueLower)) || String(option.value).toLowerCase().includes(inputValueLower) || ((_b = option == null ? void 0 : option.searchAbleValue1) == null ? void 0 : _b.toLowerCase().includes(inputValueLower)) || ((_c = option == null ? void 0 : option.searchAbleValue2) == null ? void 0 : _c.toLowerCase().includes(inputValueLower)) || ((_d = option == null ? void 0 : option.searchAbleValue3) == null ? void 0 : _d.toLowerCase().includes(inputValueLower));
|
|
11984
|
+
}
|
|
11985
|
+
);
|
|
11986
|
+
},
|
|
11987
|
+
[]
|
|
11988
|
+
);
|
|
11989
|
+
const defaultRenderInput = useCallback(
|
|
11990
|
+
(params) => /* @__PURE__ */ jsx(
|
|
11991
|
+
TextField,
|
|
11992
|
+
{
|
|
11993
|
+
...params,
|
|
11994
|
+
variant,
|
|
11995
|
+
error: hasError,
|
|
11996
|
+
helperText: "",
|
|
11997
|
+
placeholder: "",
|
|
11998
|
+
inputRef: inputProps.ref,
|
|
11999
|
+
inputProps: {
|
|
12000
|
+
...params.inputProps,
|
|
12001
|
+
...inputProps,
|
|
12002
|
+
className: `${params.inputProps.className || ""} ${inputClassName}`.trim()
|
|
11879
12003
|
},
|
|
11880
|
-
|
|
11881
|
-
|
|
12004
|
+
InputProps: {
|
|
12005
|
+
...params.InputProps,
|
|
12006
|
+
...textFieldProps.InputProps,
|
|
12007
|
+
className: `${params.InputProps.className || ""} ${textFieldClassName}`.trim()
|
|
12008
|
+
},
|
|
12009
|
+
sx: [
|
|
12010
|
+
{
|
|
12011
|
+
"& .MuiOutlinedInput-root": {
|
|
12012
|
+
borderRadius: "8px",
|
|
12013
|
+
"& fieldset": {
|
|
12014
|
+
borderColor: hasError ? "error.main" : "divider"
|
|
12015
|
+
},
|
|
12016
|
+
"&:hover fieldset": {
|
|
12017
|
+
borderColor: hasError ? "error.main" : "text.primary"
|
|
12018
|
+
},
|
|
12019
|
+
"&.Mui-focused fieldset": {
|
|
12020
|
+
borderColor: hasError ? "error.main" : "primary.main"
|
|
12021
|
+
}
|
|
12022
|
+
}
|
|
12023
|
+
},
|
|
12024
|
+
...Array.isArray(textFieldSx) ? textFieldSx : textFieldSx ? [textFieldSx] : []
|
|
12025
|
+
],
|
|
12026
|
+
...textFieldProps
|
|
12027
|
+
}
|
|
12028
|
+
),
|
|
12029
|
+
[
|
|
12030
|
+
variant,
|
|
12031
|
+
hasError,
|
|
12032
|
+
inputProps,
|
|
12033
|
+
inputClassName,
|
|
12034
|
+
textFieldProps,
|
|
12035
|
+
textFieldClassName,
|
|
12036
|
+
textFieldSx
|
|
12037
|
+
]
|
|
12038
|
+
);
|
|
12039
|
+
const defaultRenderOption = useCallback(
|
|
12040
|
+
(props2, option, { selected }) => /* @__PURE__ */ createElement(
|
|
12041
|
+
"li",
|
|
12042
|
+
{
|
|
12043
|
+
...props2,
|
|
12044
|
+
key: option.value,
|
|
12045
|
+
className: `${props2.className || ""} ${optionClassName}`.trim(),
|
|
12046
|
+
style: {
|
|
12047
|
+
...props2.style,
|
|
12048
|
+
opacity: option.disabled ? 0.5 : 1,
|
|
12049
|
+
pointerEvents: option.disabled ? "none" : "auto"
|
|
11882
12050
|
}
|
|
11883
12051
|
},
|
|
11884
|
-
|
|
11885
|
-
|
|
12052
|
+
/* @__PURE__ */ jsx(
|
|
12053
|
+
Checkbox,
|
|
11886
12054
|
{
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
12055
|
+
checked: selected,
|
|
12056
|
+
disabled: option.disabled,
|
|
12057
|
+
sx: {
|
|
12058
|
+
color: "text.secondary",
|
|
12059
|
+
"&.Mui-checked": {
|
|
12060
|
+
color: "primary.main"
|
|
12061
|
+
},
|
|
12062
|
+
"&.Mui-disabled": {
|
|
12063
|
+
color: "text.disabled"
|
|
12064
|
+
},
|
|
12065
|
+
mr: 1,
|
|
12066
|
+
...checkboxProps.sx
|
|
11899
12067
|
},
|
|
11900
|
-
|
|
11901
|
-
|
|
12068
|
+
...checkboxProps
|
|
12069
|
+
}
|
|
12070
|
+
),
|
|
12071
|
+
option.icon && /* @__PURE__ */ jsx(Box, { component: "span", sx: { mr: 1 }, children: option.icon }),
|
|
12072
|
+
/* @__PURE__ */ jsx(
|
|
12073
|
+
Typography,
|
|
12074
|
+
{
|
|
12075
|
+
variant: "body2",
|
|
12076
|
+
sx: [
|
|
11902
12077
|
{
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
12078
|
+
color: option.disabled ? "text.disabled" : "text.primary",
|
|
12079
|
+
...option.textSx
|
|
12080
|
+
},
|
|
12081
|
+
...Array.isArray(optionSx) ? optionSx : [optionSx]
|
|
12082
|
+
],
|
|
12083
|
+
children: option.label
|
|
12084
|
+
}
|
|
12085
|
+
)
|
|
12086
|
+
),
|
|
12087
|
+
[optionClassName, checkboxProps, optionSx]
|
|
12088
|
+
);
|
|
12089
|
+
const defaultRenderTags = useCallback(
|
|
12090
|
+
(value, getTagProps) => /* @__PURE__ */ jsx(Box, { sx: { display: "flex", flexWrap: "wrap", gap: 0.5, mt: 0.5 }, children: value.map((option, index) => {
|
|
12091
|
+
const { key, ...tagProps } = getTagProps({ index });
|
|
12092
|
+
return /* @__PURE__ */ createElement(
|
|
12093
|
+
Chip,
|
|
12094
|
+
{
|
|
12095
|
+
...tagProps,
|
|
12096
|
+
key: option.value,
|
|
12097
|
+
label: option.label,
|
|
12098
|
+
disabled: disabled || option.disabled,
|
|
12099
|
+
sx: [
|
|
12100
|
+
{
|
|
12101
|
+
height: "24px",
|
|
12102
|
+
borderRadius: "4px",
|
|
12103
|
+
"& .MuiChip-deleteIcon": {
|
|
12104
|
+
color: "text.secondary",
|
|
12105
|
+
"&:hover": {
|
|
11921
12106
|
color: "text.primary"
|
|
12107
|
+
}
|
|
12108
|
+
}
|
|
12109
|
+
},
|
|
12110
|
+
...Array.isArray(chipSx) ? chipSx : [chipSx]
|
|
12111
|
+
],
|
|
12112
|
+
className: `${chipClassName} ${option.disabled ? "Mui-disabled" : ""}`.trim(),
|
|
12113
|
+
...chipProps
|
|
12114
|
+
}
|
|
12115
|
+
);
|
|
12116
|
+
}) }),
|
|
12117
|
+
[disabled, chipSx, chipClassName, chipProps]
|
|
12118
|
+
);
|
|
12119
|
+
const renderSelectedCount = useCallback(() => {
|
|
12120
|
+
if (!showSelectedCount || !multiple)
|
|
12121
|
+
return null;
|
|
12122
|
+
return /* @__PURE__ */ jsxs(
|
|
12123
|
+
Typography,
|
|
12124
|
+
{
|
|
12125
|
+
variant: "caption",
|
|
12126
|
+
sx: [
|
|
12127
|
+
{
|
|
12128
|
+
mt: 0.5,
|
|
12129
|
+
color: "text.secondary"
|
|
12130
|
+
},
|
|
12131
|
+
...Array.isArray(selectedCountSx) ? selectedCountSx : [selectedCountSx]
|
|
12132
|
+
],
|
|
12133
|
+
children: [
|
|
12134
|
+
`${selectedCount} selected`,
|
|
12135
|
+
maxSelections ? ` (max ${maxSelections})` : ""
|
|
12136
|
+
]
|
|
12137
|
+
}
|
|
12138
|
+
);
|
|
12139
|
+
}, [
|
|
12140
|
+
showSelectedCount,
|
|
12141
|
+
multiple,
|
|
12142
|
+
selectedCount,
|
|
12143
|
+
maxSelections,
|
|
12144
|
+
selectedCountSx
|
|
12145
|
+
]);
|
|
12146
|
+
return /* @__PURE__ */ jsx(
|
|
12147
|
+
Box,
|
|
12148
|
+
{
|
|
12149
|
+
ref,
|
|
12150
|
+
className: `app-searchable-multi-selector ${className}`.trim(),
|
|
12151
|
+
sx: [{ width: "100%" }, ...Array.isArray(sx) ? sx : sx ? [sx] : []],
|
|
12152
|
+
children: /* @__PURE__ */ jsxs(
|
|
12153
|
+
FormControl,
|
|
12154
|
+
{
|
|
12155
|
+
fullWidth: true,
|
|
12156
|
+
error: hasError,
|
|
12157
|
+
disabled,
|
|
12158
|
+
className: `app-searchable-multi-selector-form-control ${formControlClassName}`.trim(),
|
|
12159
|
+
sx: [
|
|
12160
|
+
{
|
|
12161
|
+
"& .MuiAutocomplete-root": {
|
|
12162
|
+
"& .MuiOutlinedInput-root": {
|
|
12163
|
+
padding: "4px"
|
|
11922
12164
|
},
|
|
11923
|
-
"& .
|
|
11924
|
-
|
|
11925
|
-
},
|
|
11926
|
-
"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
|
11927
|
-
borderColor: "common.white"
|
|
11928
|
-
},
|
|
11929
|
-
"& .MuiSvgIcon-root": {
|
|
11930
|
-
color: "common.black"
|
|
12165
|
+
"& .MuiAutocomplete-input": {
|
|
12166
|
+
padding: "8.5px 4px"
|
|
11931
12167
|
}
|
|
11932
12168
|
}
|
|
11933
|
-
}
|
|
11934
|
-
|
|
11935
|
-
|
|
12169
|
+
},
|
|
12170
|
+
...Array.isArray(formControlSx) ? formControlSx : formControlSx ? [formControlSx] : []
|
|
12171
|
+
],
|
|
12172
|
+
children: [
|
|
12173
|
+
label && /* @__PURE__ */ jsxs(
|
|
12174
|
+
LabelComponent,
|
|
12175
|
+
{
|
|
12176
|
+
shrink: true,
|
|
12177
|
+
htmlFor: `autocomplete-${name}`,
|
|
12178
|
+
className: `app-searchable-multi-selector-label ${labelClassName}`.trim(),
|
|
12179
|
+
sx: [
|
|
12180
|
+
{
|
|
12181
|
+
mb: 1,
|
|
12182
|
+
color: hasError ? "error.main" : "text.primary",
|
|
12183
|
+
"&.Mui-focused": {
|
|
12184
|
+
color: hasError ? "error.main" : "primary.main"
|
|
12185
|
+
}
|
|
12186
|
+
},
|
|
12187
|
+
...Array.isArray(labelSx) ? labelSx : [labelSx]
|
|
12188
|
+
],
|
|
12189
|
+
...labelProps,
|
|
12190
|
+
children: [
|
|
12191
|
+
label,
|
|
12192
|
+
required && /* @__PURE__ */ jsx(Box, { component: "span", sx: { color: "error.main", ml: 0.5 }, children: "*" })
|
|
12193
|
+
]
|
|
12194
|
+
}
|
|
12195
|
+
),
|
|
12196
|
+
/* @__PURE__ */ jsx(
|
|
12197
|
+
Autocomplete,
|
|
12198
|
+
{
|
|
12199
|
+
multiple,
|
|
12200
|
+
id: `autocomplete-${name}`,
|
|
12201
|
+
options,
|
|
12202
|
+
value: selectedValues,
|
|
12203
|
+
filterOptions,
|
|
12204
|
+
onInputChange: handleInputChange,
|
|
12205
|
+
onChange: handleChange,
|
|
12206
|
+
onOpen,
|
|
12207
|
+
onClose,
|
|
12208
|
+
onBlur: handleBlur,
|
|
12209
|
+
onFocus: handleFocus,
|
|
12210
|
+
disableCloseOnSelect: multiple,
|
|
12211
|
+
readOnly,
|
|
12212
|
+
disabled,
|
|
12213
|
+
isOptionEqualToValue: (option, value) => option.value === value.value,
|
|
12214
|
+
getOptionLabel: (option) => typeof option === "string" ? option : option.label,
|
|
12215
|
+
getOptionDisabled: (option) => !!option.disabled,
|
|
12216
|
+
renderInput: externalRenderInput || defaultRenderInput,
|
|
12217
|
+
renderOption: externalRenderOption || defaultRenderOption,
|
|
12218
|
+
renderTags: externalRenderTags || defaultRenderTags,
|
|
12219
|
+
renderGroup: externalRenderGroup,
|
|
12220
|
+
ListboxProps: {
|
|
12221
|
+
className: `app-searchable-multi-selector-listbox ${listboxClassName}`.trim(),
|
|
12222
|
+
sx: [
|
|
12223
|
+
{
|
|
12224
|
+
"& .MuiAutocomplete-option": {
|
|
12225
|
+
px: 2,
|
|
12226
|
+
py: 1,
|
|
12227
|
+
'&[aria-selected="true"]': {
|
|
12228
|
+
backgroundColor: "action.selected",
|
|
12229
|
+
"&.Mui-focused": {
|
|
12230
|
+
backgroundColor: "action.hover"
|
|
12231
|
+
}
|
|
12232
|
+
},
|
|
12233
|
+
"&.Mui-focused": {
|
|
12234
|
+
backgroundColor: "action.hover"
|
|
12235
|
+
}
|
|
12236
|
+
}
|
|
12237
|
+
},
|
|
12238
|
+
...Array.isArray(optionSx) ? optionSx : optionSx ? [optionSx] : [],
|
|
12239
|
+
...Array.isArray(listboxSx) ? listboxSx : listboxSx ? [listboxSx] : []
|
|
12240
|
+
]
|
|
12241
|
+
},
|
|
12242
|
+
className: `app-searchable-multi-selector-autocomplete ${autocompleteClassName}`.trim(),
|
|
12243
|
+
sx: [
|
|
12244
|
+
{
|
|
12245
|
+
"& .MuiAutocomplete-tag": {
|
|
12246
|
+
margin: 0,
|
|
12247
|
+
height: "auto"
|
|
12248
|
+
},
|
|
12249
|
+
"& .MuiAutocomplete-endAdornment": {
|
|
12250
|
+
right: 8
|
|
12251
|
+
}
|
|
12252
|
+
},
|
|
12253
|
+
...Array.isArray(autocompleteSx) ? autocompleteSx : autocompleteSx ? [autocompleteSx] : []
|
|
12254
|
+
],
|
|
12255
|
+
...autocompleteProps,
|
|
12256
|
+
...otherProps
|
|
12257
|
+
}
|
|
12258
|
+
),
|
|
12259
|
+
(showHelperText || hasError) && /* @__PURE__ */ jsx(
|
|
12260
|
+
HelperTextComponent,
|
|
12261
|
+
{
|
|
12262
|
+
error: hasError,
|
|
12263
|
+
sx: [
|
|
12264
|
+
{
|
|
12265
|
+
mx: 0,
|
|
12266
|
+
mt: 0.5,
|
|
12267
|
+
...hasError ? { color: "error.main", ...errorSx } : { color: "text.secondary", ...helperTextSx }
|
|
12268
|
+
}
|
|
12269
|
+
],
|
|
12270
|
+
className: `app-searchable-multi-selector-helper-text ${helperTextClassName} ${hasError ? "Mui-error" : ""}`.trim(),
|
|
12271
|
+
...helperTextProps,
|
|
12272
|
+
children: hasError ? fieldError : helperText
|
|
12273
|
+
}
|
|
12274
|
+
),
|
|
12275
|
+
renderSelectedCount()
|
|
12276
|
+
]
|
|
11936
12277
|
}
|
|
11937
12278
|
)
|
|
11938
12279
|
}
|
|
11939
12280
|
);
|
|
11940
|
-
}
|
|
12281
|
+
});
|
|
12282
|
+
AppSearchableMultiSelector2.displayName = "AppSearchableMultiSelector";
|
|
12283
|
+
var AppSearchableSelect_default = AppSearchableMultiSelector2;
|
|
11941
12284
|
var AppSelectInput = forwardRef(
|
|
11942
12285
|
({
|
|
11943
12286
|
name,
|
|
@@ -12048,16 +12391,9 @@ var AppSelectInput = forwardRef(
|
|
|
12048
12391
|
className: "app-select-input",
|
|
12049
12392
|
sx: [
|
|
12050
12393
|
{
|
|
12051
|
-
"
|
|
12052
|
-
"&.Mui-focused": {
|
|
12053
|
-
color: hasError ? "error.main" : "primary.main"
|
|
12054
|
-
},
|
|
12055
|
-
"&.Mui-disabled": {
|
|
12056
|
-
color: "text.disabled"
|
|
12057
|
-
}
|
|
12058
|
-
}
|
|
12394
|
+
width: fullWidth ? "100%" : "auto"
|
|
12059
12395
|
},
|
|
12060
|
-
...Array.isArray(
|
|
12396
|
+
...Array.isArray(sx) ? sx : [sx].filter(Boolean)
|
|
12061
12397
|
],
|
|
12062
12398
|
children: /* @__PURE__ */ jsxs(
|
|
12063
12399
|
FormControl,
|
|
@@ -12069,13 +12405,24 @@ var AppSelectInput = forwardRef(
|
|
|
12069
12405
|
className: "app-select-form-control",
|
|
12070
12406
|
sx: [
|
|
12071
12407
|
{
|
|
12408
|
+
position: "relative",
|
|
12409
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
12410
|
+
borderWidth: "1px"
|
|
12411
|
+
},
|
|
12072
12412
|
"& .MuiInputLabel-root": {
|
|
12413
|
+
position: "relative",
|
|
12414
|
+
transform: "none",
|
|
12415
|
+
fontSize: "0.875rem",
|
|
12416
|
+
mb: 1,
|
|
12073
12417
|
"&.Mui-focused": {
|
|
12074
12418
|
color: hasError ? "error.main" : "primary.main"
|
|
12075
12419
|
},
|
|
12076
12420
|
"&.Mui-disabled": {
|
|
12077
12421
|
color: "text.disabled"
|
|
12078
12422
|
}
|
|
12423
|
+
},
|
|
12424
|
+
"& .MuiInputLabel-shrink": {
|
|
12425
|
+
transform: "none"
|
|
12079
12426
|
}
|
|
12080
12427
|
},
|
|
12081
12428
|
...Array.isArray(formControlSx) ? formControlSx : formControlSx ? [formControlSx] : []
|
|
@@ -12087,15 +12434,23 @@ var AppSelectInput = forwardRef(
|
|
|
12087
12434
|
id: `select-${name}-label`,
|
|
12088
12435
|
htmlFor: `select-${name}`,
|
|
12089
12436
|
className: "app-select-label",
|
|
12437
|
+
shrink: false,
|
|
12090
12438
|
sx: [
|
|
12091
12439
|
{
|
|
12440
|
+
position: "relative",
|
|
12441
|
+
transform: "none",
|
|
12442
|
+
fontSize: "0.875rem",
|
|
12443
|
+
fontWeight: 500,
|
|
12092
12444
|
color: hasError ? "error.main" : "text.secondary",
|
|
12445
|
+
mb: 1,
|
|
12093
12446
|
"&.Mui-focused": {
|
|
12094
12447
|
color: hasError ? "error.main" : "primary.main"
|
|
12095
12448
|
},
|
|
12096
|
-
|
|
12097
|
-
|
|
12098
|
-
|
|
12449
|
+
"&.Mui-disabled": {
|
|
12450
|
+
color: "text.disabled"
|
|
12451
|
+
}
|
|
12452
|
+
},
|
|
12453
|
+
...Array.isArray(labelSx) ? labelSx : [labelSx].filter(Boolean)
|
|
12099
12454
|
],
|
|
12100
12455
|
children: [
|
|
12101
12456
|
label,
|
|
@@ -12126,6 +12481,8 @@ var AppSelectInput = forwardRef(
|
|
|
12126
12481
|
onOpen,
|
|
12127
12482
|
onClose,
|
|
12128
12483
|
renderValue,
|
|
12484
|
+
label: void 0,
|
|
12485
|
+
displayEmpty: true,
|
|
12129
12486
|
inputProps: {
|
|
12130
12487
|
readOnly,
|
|
12131
12488
|
...inputProps
|
|
@@ -12136,6 +12493,7 @@ var AppSelectInput = forwardRef(
|
|
|
12136
12493
|
{
|
|
12137
12494
|
mt: 1,
|
|
12138
12495
|
boxShadow: theme.shadows[3],
|
|
12496
|
+
maxHeight: 300,
|
|
12139
12497
|
"& .MuiMenuItem-root": {
|
|
12140
12498
|
px: 2,
|
|
12141
12499
|
py: 1,
|
|
@@ -12154,7 +12512,24 @@ var AppSelectInput = forwardRef(
|
|
|
12154
12512
|
},
|
|
12155
12513
|
sx: [
|
|
12156
12514
|
{
|
|
12157
|
-
|
|
12515
|
+
"& .MuiSelect-select": {
|
|
12516
|
+
minHeight: "1.4375em",
|
|
12517
|
+
padding: "16.5px 14px",
|
|
12518
|
+
"&.MuiInputBase-input": {
|
|
12519
|
+
padding: "16.5px 14px"
|
|
12520
|
+
}
|
|
12521
|
+
},
|
|
12522
|
+
"&.MuiOutlinedInput-root": {
|
|
12523
|
+
"& fieldset": {
|
|
12524
|
+
borderWidth: "1px"
|
|
12525
|
+
},
|
|
12526
|
+
"&:hover fieldset": {
|
|
12527
|
+
borderWidth: "1px"
|
|
12528
|
+
},
|
|
12529
|
+
"&.Mui-focused fieldset": {
|
|
12530
|
+
borderWidth: "2px"
|
|
12531
|
+
}
|
|
12532
|
+
},
|
|
12158
12533
|
"&.Mui-disabled": {
|
|
12159
12534
|
backgroundColor: "action.disabledBackground",
|
|
12160
12535
|
"& .MuiOutlinedInput-notchedOutline": {
|
|
@@ -12184,6 +12559,7 @@ var AppSelectInput = forwardRef(
|
|
|
12184
12559
|
{
|
|
12185
12560
|
mx: 0,
|
|
12186
12561
|
mt: 0.5,
|
|
12562
|
+
fontSize: "0.75rem",
|
|
12187
12563
|
...hasError ? {
|
|
12188
12564
|
color: "error.main",
|
|
12189
12565
|
...errorSx
|
|
@@ -13965,6 +14341,6 @@ var SubmitButton = ({
|
|
|
13965
14341
|
};
|
|
13966
14342
|
var SubmitButton_default = SubmitButton;
|
|
13967
14343
|
|
|
13968
|
-
export { AppAutoComplete, AppAutoCompleter, AppCheckBox_default as AppCheckBox, AppDateAndTimePicker_default as AppDateAndTimePicker, AppDatePicker_default as AppDatePicker, AppFormErrorMessage_default as AppFormErrorMessage, AppInputField, AppMultiSelector_default as AppMultiSelector, AppPhoneNoInput_default as AppPhoneNoInput, AppRadioGroup_default as AppRadioGroup, AppRating_default as AppRating, AppRichTextEditor_default as AppRichTextEditor, AppSearchableMultiSelector_default as AppSearchableMultiSelector, AppSearchableSelectInput, AppSelectInput_default as AppSelectInput, AppSimpleUploadFile_default as AppSimpleUploadFile, AppSwitch, AppSwitchInput, AppTagsCreator, AppTextArea_default as AppTextArea, AppUploadFile_default as AppUploadFile, Form_default as Form, Iconify_default as Iconify, SubmitButton_default as SubmitButton };
|
|
14344
|
+
export { AppAutoComplete, AppAutoCompleter, AppCheckBox_default as AppCheckBox, AppDateAndTimePicker_default as AppDateAndTimePicker, AppDatePicker_default as AppDatePicker, AppFormErrorMessage_default as AppFormErrorMessage, AppInputField, AppMultiSelector_default as AppMultiSelector, AppPhoneNoInput_default as AppPhoneNoInput, AppRadioGroup_default as AppRadioGroup, AppRating_default as AppRating, AppRichTextEditor_default as AppRichTextEditor, AppSearchableMultiSelector_default as AppSearchableMultiSelector, AppSearchableSelect_default as AppSearchableSelectInput, AppSelectInput_default as AppSelectInput, AppSimpleUploadFile_default as AppSimpleUploadFile, AppSwitch, AppSwitchInput, AppTagsCreator, AppTextArea_default as AppTextArea, AppUploadFile_default as AppUploadFile, Form_default as Form, Iconify_default as Iconify, SubmitButton_default as SubmitButton };
|
|
13969
14345
|
//# sourceMappingURL=out.js.map
|
|
13970
14346
|
//# sourceMappingURL=index.mjs.map
|