@soyfri/shared-library 2.0.0-beta.3 → 2.0.0-beta.31
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/Alert-B3SMPD1s.cjs +31 -0
- package/Alert-B3SMPD1s.cjs.map +1 -0
- package/Alert-YsPScpSE.js +32 -0
- package/Alert-YsPScpSE.js.map +1 -0
- package/Autocomplete-C_lW1VER.js +337 -0
- package/Autocomplete-C_lW1VER.js.map +1 -0
- package/Autocomplete-CejWztBY.cjs +336 -0
- package/Autocomplete-CejWztBY.cjs.map +1 -0
- package/Avatar-Dw5rzayR.cjs +166 -0
- package/Avatar-Dw5rzayR.cjs.map +1 -0
- package/Avatar-H8akSege.js +167 -0
- package/Avatar-H8akSege.js.map +1 -0
- package/Button-C17mExpd.cjs.map +1 -1
- package/Button-UkkP-bNw.js.map +1 -1
- package/Card-DYKGY-NG.js +116 -0
- package/Card-DYKGY-NG.js.map +1 -0
- package/Card-Dr1-ATRY.cjs +115 -0
- package/Card-Dr1-ATRY.cjs.map +1 -0
- package/Checkbox-BCqMFWt4.cjs +187 -0
- package/Checkbox-BCqMFWt4.cjs.map +1 -0
- package/Checkbox-gB5YKkVo.js +188 -0
- package/Checkbox-gB5YKkVo.js.map +1 -0
- package/{components/DateRangePicker/DateRangePicker.js → Chip-OPYQ1uQ_.js} +33 -35
- package/Chip-OPYQ1uQ_.js.map +1 -0
- package/{components/DateRangePicker/DateRangePicker.cjs → Chip-qoJLDiva.cjs} +33 -36
- package/Chip-qoJLDiva.cjs.map +1 -0
- package/DatePicker-_IGWc3I5.js +178 -0
- package/DatePicker-_IGWc3I5.js.map +1 -0
- package/DatePicker-t7uDTZMl.cjs +177 -0
- package/DatePicker-t7uDTZMl.cjs.map +1 -0
- package/DateTimePicker-BxQyjTCY.cjs +229 -0
- package/DateTimePicker-BxQyjTCY.cjs.map +1 -0
- package/DateTimePicker-CrmWav_j.js +230 -0
- package/DateTimePicker-CrmWav_j.js.map +1 -0
- package/Input-CScC87J5.cjs +185 -0
- package/Input-CScC87J5.cjs.map +1 -0
- package/Input-DP_fKl38.js +186 -0
- package/Input-DP_fKl38.js.map +1 -0
- package/Modal-BFpX5AFV.js +347 -0
- package/Modal-BFpX5AFV.js.map +1 -0
- package/Modal-CkpuI8ns.cjs +346 -0
- package/Modal-CkpuI8ns.cjs.map +1 -0
- package/RadioGroup-Dd0rHXSX.cjs +202 -0
- package/RadioGroup-Dd0rHXSX.cjs.map +1 -0
- package/RadioGroup-bO-ahP9T.js +203 -0
- package/RadioGroup-bO-ahP9T.js.map +1 -0
- package/Select-BY5Y0qZ1.js +376 -0
- package/Select-BY5Y0qZ1.js.map +1 -0
- package/Select-CURrHSyl.cjs +375 -0
- package/Select-CURrHSyl.cjs.map +1 -0
- package/Spinner-B6sThC1p.js +74 -0
- package/Spinner-B6sThC1p.js.map +1 -0
- package/Spinner-D7qRmNS9.cjs +73 -0
- package/Spinner-D7qRmNS9.cjs.map +1 -0
- package/Stat-BUcFCGrz.cjs +83 -0
- package/Stat-BUcFCGrz.cjs.map +1 -0
- package/Stat-C06A_izS.js +84 -0
- package/Stat-C06A_izS.js.map +1 -0
- package/StatusMessage-B3nXpuRl.cjs +88 -0
- package/StatusMessage-B3nXpuRl.cjs.map +1 -0
- package/StatusMessage-D0WgSBx7.js +89 -0
- package/StatusMessage-D0WgSBx7.js.map +1 -0
- package/Step-BArsou1V.js +301 -0
- package/Step-BArsou1V.js.map +1 -0
- package/Step-Nd7SJbRZ.cjs +300 -0
- package/Step-Nd7SJbRZ.cjs.map +1 -0
- package/Switch-CQFOopYy.cjs +182 -0
- package/Switch-CQFOopYy.cjs.map +1 -0
- package/Switch-D72dpkH2.js +183 -0
- package/Switch-D72dpkH2.js.map +1 -0
- package/Tab-BbP8jBcK.cjs +110 -0
- package/Tab-BbP8jBcK.cjs.map +1 -0
- package/Tab-BxSxKJsP.js +111 -0
- package/Tab-BxSxKJsP.js.map +1 -0
- package/Table-C2LbW0B1.js +531 -0
- package/Table-C2LbW0B1.js.map +1 -0
- package/Table-C4OM6rrC.cjs +530 -0
- package/Table-C4OM6rrC.cjs.map +1 -0
- package/components/ActionMenu/ActionMenu.cjs +52 -52
- package/components/ActionMenu/ActionMenu.cjs.map +1 -1
- package/components/ActionMenu/ActionMenu.d.ts +20 -36
- package/components/ActionMenu/ActionMenu.js +55 -55
- package/components/ActionMenu/ActionMenu.js.map +1 -1
- package/components/ActionMenu/index.d.ts +2 -2
- package/components/Alert/Alert.cjs +6 -0
- package/components/Alert/Alert.cjs.map +1 -0
- package/components/Alert/Alert.d.ts +31 -0
- package/components/Alert/Alert.js +6 -0
- package/components/Alert/Alert.js.map +1 -0
- package/components/Alert/index.d.ts +2 -0
- package/components/Alert.d.ts +6 -0
- package/components/AppBar/AppBar.cjs +3 -220
- package/components/AppBar/AppBar.cjs.map +1 -1
- package/components/AppBar/AppBar.d.ts +6 -6
- package/components/AppBar/AppBar.js +6 -223
- package/components/AppBar/AppBar.js.map +1 -1
- package/components/AppBar/index.d.ts +0 -6
- package/components/Autocomplete/Autocomplete.cjs +4 -311
- package/components/Autocomplete/Autocomplete.cjs.map +1 -1
- package/components/Autocomplete/Autocomplete.d.ts +8 -6
- package/components/Autocomplete/Autocomplete.helpers.d.ts +8 -4
- package/components/Autocomplete/Autocomplete.js +4 -311
- package/components/Autocomplete/Autocomplete.js.map +1 -1
- package/components/Autocomplete/_parts/AutocompleteOption.d.ts +5 -8
- package/components/Autocomplete/index.d.ts +1 -1
- package/components/Avatar/Avatar.cjs +2 -160
- package/components/Avatar/Avatar.cjs.map +1 -1
- package/components/Avatar/Avatar.d.ts +16 -1
- package/components/Avatar/Avatar.js +2 -160
- package/components/Avatar/Avatar.js.map +1 -1
- package/components/Avatar/index.d.ts +1 -0
- package/components/Button/Button.d.ts +5 -5
- package/components/Button/index.d.ts +1 -0
- package/components/Card/Card.cjs +4 -184
- package/components/Card/Card.cjs.map +1 -1
- package/components/Card/Card.d.ts +21 -50
- package/components/Card/Card.js +4 -184
- package/components/Card/Card.js.map +1 -1
- package/components/Card/Card.sx.d.ts +3 -6
- package/components/Card/index.d.ts +1 -1
- package/components/Checkbox/Checkbox.cjs +6 -0
- package/components/Checkbox/Checkbox.cjs.map +1 -0
- package/components/Checkbox/Checkbox.d.ts +55 -0
- package/components/Checkbox/Checkbox.js +6 -0
- package/components/Checkbox/Checkbox.js.map +1 -0
- package/components/Checkbox/Checkbox.sx.d.ts +13 -0
- package/components/Checkbox/index.d.ts +2 -0
- package/components/Checkbox.d.ts +6 -0
- package/components/Chip/Chip.cjs +4 -72
- package/components/Chip/Chip.cjs.map +1 -1
- package/components/Chip/Chip.js +3 -71
- package/components/Chip/Chip.js.map +1 -1
- package/components/Chip/index.d.ts +2 -1
- package/components/Chip.d.ts +4 -0
- package/components/Column/Column.cjs +1 -1
- package/components/Column/Column.cjs.map +1 -1
- package/components/Column/Column.d.ts +1 -1
- package/components/Column/Column.js +1 -1
- package/components/Column/Column.js.map +1 -1
- package/components/Column/index.d.ts +1 -0
- package/components/DatePicker/DatePicker.cjs +3 -200
- package/components/DatePicker/DatePicker.cjs.map +1 -1
- package/components/DatePicker/DatePicker.d.ts +1 -13
- package/components/DatePicker/DatePicker.js +3 -200
- package/components/DatePicker/DatePicker.js.map +1 -1
- package/components/DatePicker/index.d.ts +1 -1
- package/components/DateTimePicker/DateTimePicker.cjs +3 -219
- package/components/DateTimePicker/DateTimePicker.cjs.map +1 -1
- package/components/DateTimePicker/DateTimePicker.d.ts +10 -6
- package/components/DateTimePicker/DateTimePicker.definitions.d.ts +2 -0
- package/components/DateTimePicker/DateTimePicker.helpers.d.ts +4 -2
- package/components/DateTimePicker/DateTimePicker.js +3 -219
- package/components/DateTimePicker/DateTimePicker.js.map +1 -1
- package/components/DateTimePicker/index.d.ts +1 -1
- package/components/Drawer/Drawer.cjs +25 -24
- package/components/Drawer/Drawer.cjs.map +1 -1
- package/components/Drawer/Drawer.d.ts +8 -1
- package/components/Drawer/Drawer.js +26 -25
- package/components/Drawer/Drawer.js.map +1 -1
- package/components/Drawer/DrawerItem.d.ts +6 -1
- package/components/Gallery/Gallery.cjs +154 -79
- package/components/Gallery/Gallery.cjs.map +1 -1
- package/components/Gallery/Gallery.d.ts +25 -9
- package/components/Gallery/Gallery.js +154 -79
- package/components/Gallery/Gallery.js.map +1 -1
- package/components/Gallery/GalleryLightbox.d.ts +6 -10
- package/components/Gallery/GalleryMain.d.ts +3 -7
- package/components/Gallery/GalleryThumbnails.d.ts +7 -11
- package/components/Gallery/index.d.ts +2 -1
- package/components/Gallery.d.ts +4 -0
- package/components/Icon/Icon.cjs +6 -8
- package/components/Icon/Icon.cjs.map +1 -1
- package/components/Icon/Icon.d.ts +11 -17
- package/components/Icon/Icon.js +6 -8
- package/components/Icon/Icon.js.map +1 -1
- package/components/Icon/index.d.ts +2 -1
- package/components/Icon.d.ts +4 -0
- package/components/Input/Input.cjs +3 -172
- package/components/Input/Input.cjs.map +1 -1
- package/components/Input/Input.d.ts +9 -2
- package/components/Input/Input.definitions.d.ts +1 -0
- package/components/Input/Input.helpers.d.ts +3 -3
- package/components/Input/Input.js +3 -172
- package/components/Input/Input.js.map +1 -1
- package/components/Input/index.d.ts +1 -1
- package/components/InputGroup/InputGroup.cjs +23 -22
- package/components/InputGroup/InputGroup.cjs.map +1 -1
- package/components/InputGroup/InputGroup.d.ts +4 -4
- package/components/InputGroup/InputGroup.js +22 -21
- package/components/InputGroup/InputGroup.js.map +1 -1
- package/components/InputGroup/index.d.ts +2 -1
- package/components/InputGroup.d.ts +4 -0
- package/components/Modal/Modal.cjs +7 -317
- package/components/Modal/Modal.cjs.map +1 -1
- package/components/Modal/Modal.d.ts +20 -5
- package/components/Modal/Modal.js +6 -316
- package/components/Modal/Modal.js.map +1 -1
- package/components/Modal/ModalBody.d.ts +6 -1
- package/components/Modal/ModalFooter.d.ts +4 -4
- package/components/Modal/ModalHeader.d.ts +6 -1
- package/components/Modal/index.d.ts +3 -1
- package/components/Modal.d.ts +4 -0
- package/components/RadioGroup/RadioGroup.cjs +6 -0
- package/components/RadioGroup/RadioGroup.cjs.map +1 -0
- package/components/RadioGroup/RadioGroup.d.ts +59 -0
- package/components/RadioGroup/RadioGroup.definitions.d.ts +6 -0
- package/components/RadioGroup/RadioGroup.js +6 -0
- package/components/RadioGroup/RadioGroup.js.map +1 -0
- package/components/RadioGroup/RadioGroup.sx.d.ts +20 -0
- package/components/RadioGroup/index.d.ts +2 -0
- package/components/RadioGroup.d.ts +6 -0
- package/components/Select/Select.cjs +4 -445
- package/components/Select/Select.cjs.map +1 -1
- package/components/Select/Select.d.ts +37 -18
- package/components/Select/Select.helpers.d.ts +5 -19
- package/components/Select/Select.js +4 -445
- package/components/Select/Select.js.map +1 -1
- package/components/Select/index.d.ts +1 -1
- package/components/Spinner/Spinner.cjs +6 -0
- package/components/Spinner/Spinner.cjs.map +1 -0
- package/components/Spinner/Spinner.d.ts +26 -0
- package/components/Spinner/Spinner.js +6 -0
- package/components/Spinner/Spinner.js.map +1 -0
- package/components/Spinner/index.d.ts +2 -0
- package/components/Spinner.d.ts +6 -0
- package/components/Stat/Stat.cjs +4 -83
- package/components/Stat/Stat.cjs.map +1 -1
- package/components/Stat/Stat.js +3 -82
- package/components/Stat/Stat.js.map +1 -1
- package/components/Stat/index.d.ts +2 -1
- package/components/Stat.d.ts +4 -0
- package/components/StatusMessage/StatusMessage.cjs +4 -77
- package/components/StatusMessage/StatusMessage.cjs.map +1 -1
- package/components/StatusMessage/StatusMessage.d.ts +20 -36
- package/components/StatusMessage/StatusMessage.js +3 -76
- package/components/StatusMessage/StatusMessage.js.map +1 -1
- package/components/StatusMessage/index.d.ts +2 -1
- package/components/StatusMessage.d.ts +4 -0
- package/components/Stepper/Stepper.cjs +8 -47
- package/components/Stepper/Stepper.cjs.map +1 -1
- package/components/Stepper/Stepper.d.ts +9 -8
- package/components/Stepper/Stepper.js +7 -46
- package/components/Stepper/Stepper.js.map +1 -1
- package/{hooks/Wizard/WizardContext.d.ts → components/Stepper/StepperContext.d.ts} +29 -23
- package/components/Stepper/_hooks/useHorizontalScroll.d.ts +19 -0
- package/components/Stepper/_parts/StepperScrollArrow.d.ts +19 -0
- package/components/Stepper/index.d.ts +6 -2
- package/components/Stepper.d.ts +4 -0
- package/components/Switch/Switch.cjs +6 -0
- package/components/Switch/Switch.cjs.map +1 -0
- package/components/Switch/Switch.d.ts +48 -0
- package/components/Switch/Switch.definitions.d.ts +7 -0
- package/components/Switch/Switch.js +6 -0
- package/components/Switch/Switch.js.map +1 -0
- package/components/Switch/Switch.sx.d.ts +22 -0
- package/components/Switch/Switch.types.d.ts +1 -0
- package/components/Switch/index.d.ts +2 -0
- package/components/Switch.d.ts +6 -0
- package/components/Table/Table.cjs +2 -528
- package/components/Table/Table.cjs.map +1 -1
- package/components/Table/Table.d.ts +1 -1
- package/components/Table/Table.js +2 -528
- package/components/Table/Table.js.map +1 -1
- package/components/Tabs/Tabs.cjs +5 -94
- package/components/Tabs/Tabs.cjs.map +1 -1
- package/components/Tabs/Tabs.d.ts +21 -16
- package/components/Tabs/Tabs.js +4 -93
- package/components/Tabs/Tabs.js.map +1 -1
- package/components/Tabs/index.d.ts +4 -2
- package/components/Tabs.d.ts +4 -0
- package/components/Timeline/Timeline.cjs +3 -2
- package/components/Timeline/Timeline.cjs.map +1 -1
- package/components/Timeline/Timeline.d.ts +4 -8
- package/components/Timeline/Timeline.js +3 -2
- package/components/Timeline/Timeline.js.map +1 -1
- package/components/Timeline/index.d.ts +4 -2
- package/components/Timeline.d.ts +4 -0
- package/components/_shared/mergeSx.d.ts +7 -0
- package/{formField.sx-DfVbMe0V.js → formField.sx-8_QRnKxv.js} +2 -11
- package/formField.sx-8_QRnKxv.js.map +1 -0
- package/{formField.sx-CQ1mbk9M.cjs → formField.sx-BAX7KwMR.cjs} +10 -19
- package/formField.sx-BAX7KwMR.cjs.map +1 -0
- package/index.cjs +96 -6
- package/index.cjs.map +1 -1
- package/index.d.ts +36 -0
- package/index.js +70 -4
- package/index.js.map +1 -1
- package/local/affiliations/affiliations.dev.soyfri.com-key.pem +28 -0
- package/local/affiliations/affiliations.dev.soyfri.com.pem +27 -0
- package/local/aficiliaciones/afiliaciones.dev.soyfri.com-key.pem +28 -0
- package/local/aficiliaciones/afiliaciones.dev.soyfri.com.pem +27 -0
- package/local/afiliaciones/afiliaciones.dev.soyfri.com-key.pem +28 -0
- package/local/afiliaciones/afiliaciones.dev.soyfri.com.pem +27 -0
- package/local/root/rootCA-key.pem +40 -0
- package/local/root/rootCA.pem +30 -0
- package/local/soporte/supportweb.dev.soyfri.com-key.pem +28 -0
- package/local/soporte/supportweb.dev.soyfri.com.pem +27 -0
- package/local/support/supportweb.dev.soyfri.com-key.pem +28 -0
- package/local/support/supportweb.dev.soyfri.com.pem +27 -0
- package/mergeSx-BXoNZjB_.js +10 -0
- package/mergeSx-BXoNZjB_.js.map +1 -0
- package/mergeSx-Dbccoo_H.cjs +9 -0
- package/mergeSx-Dbccoo_H.cjs.map +1 -0
- package/mui.d.ts +3 -1
- package/package.json +78 -73
- package/{resolvePreset-CT3kU-K2.cjs → resolvePreset-CxTI6_Ln.cjs} +3 -3
- package/{resolvePreset-CT3kU-K2.cjs.map → resolvePreset-CxTI6_Ln.cjs.map} +1 -1
- package/{resolvePreset-B-IB0ehH.js → resolvePreset-K6_BfWHD.js} +3 -3
- package/{resolvePreset-B-IB0ehH.js.map → resolvePreset-K6_BfWHD.js.map} +1 -1
- package/theme/componentStyles.d.ts +1 -1
- package/tokens-BRrcP_p_.js +21 -0
- package/tokens-BRrcP_p_.js.map +1 -0
- package/tokens-jaWWNk39.cjs +20 -0
- package/tokens-jaWWNk39.cjs.map +1 -0
- package/utils/index.d.ts +2 -0
- package/{components/ScrollTopButton → utils}/scrollToTop.d.ts +6 -7
- package/components/AppBar/AppBarBrand.d.ts +0 -31
- package/components/AppBar/AppBarUserMenu.d.ts +0 -65
- package/components/Autocomplete/Autocomplete.types.d.ts +0 -1
- package/components/DatePicker/DatePicker.types.d.ts +0 -1
- package/components/DateRangePicker/DateRangePicker.cjs.map +0 -1
- package/components/DateRangePicker/DateRangePicker.d.ts +0 -15
- package/components/DateRangePicker/DateRangePicker.definitions.d.ts +0 -6
- package/components/DateRangePicker/DateRangePicker.js.map +0 -1
- package/components/DateRangePicker/index.d.ts +0 -1
- package/components/DateRangePicker.d.ts +0 -2
- package/components/DateTimePicker/DateTimePicker.types.d.ts +0 -1
- package/components/Input/Input.types.d.ts +0 -1
- package/components/PageLoader/PageLoader.cjs +0 -61
- package/components/PageLoader/PageLoader.cjs.map +0 -1
- package/components/PageLoader/PageLoader.d.ts +0 -38
- package/components/PageLoader/PageLoader.js +0 -61
- package/components/PageLoader/PageLoader.js.map +0 -1
- package/components/PageLoader/index.d.ts +0 -2
- package/components/PageLoader.d.ts +0 -6
- package/components/ScrollTopButton/ScrollTopButton.cjs +0 -79
- package/components/ScrollTopButton/ScrollTopButton.cjs.map +0 -1
- package/components/ScrollTopButton/ScrollTopButton.d.ts +0 -48
- package/components/ScrollTopButton/ScrollTopButton.js +0 -79
- package/components/ScrollTopButton/ScrollTopButton.js.map +0 -1
- package/components/ScrollTopButton/index.d.ts +0 -4
- package/components/ScrollTopButton.d.ts +0 -6
- package/components/Select/Select.definitions.d.ts +0 -17
- package/components/Select/Select.types.d.ts +0 -1
- package/components/Select/_parts/SelectSearchHeader.d.ts +0 -15
- package/formField.sx-CQ1mbk9M.cjs.map +0 -1
- package/formField.sx-DfVbMe0V.js.map +0 -1
- package/hooks/Wizard/Wizard.cjs +0 -7
- package/hooks/Wizard/Wizard.cjs.map +0 -1
- package/hooks/Wizard/Wizard.js +0 -7
- package/hooks/Wizard/Wizard.js.map +0 -1
- package/hooks/Wizard/index.d.ts +0 -3
- package/hooks/Wizard/useWizard.d.ts +0 -9
- package/hooks/Wizard.d.ts +0 -2
- package/useWizard-CWdIxZzX.cjs +0 -94
- package/useWizard-CWdIxZzX.cjs.map +0 -1
- package/useWizard-CWq--C3o.js +0 -95
- package/useWizard-CWq--C3o.js.map +0 -1
- /package/{styles.css → index.css} +0 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
+
import { useTheme } from "@mui/material/styles";
|
|
34
|
+
import { FormControl, FormLabel, RadioGroup as RadioGroup$1, FormHelperText, FormControlLabel, Radio } from "@mui/material";
|
|
35
|
+
import { Controller } from "react-hook-form";
|
|
36
|
+
import { r as resolvePreset } from "./resolvePreset-K6_BfWHD.js";
|
|
37
|
+
const toRadius = (borderRadius) => typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
|
|
38
|
+
const FOCUS_TRANSITION = "border-color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, box-shadow 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms";
|
|
39
|
+
const buildRadioGroupSx = ({
|
|
40
|
+
bordered,
|
|
41
|
+
borderRadius,
|
|
42
|
+
error
|
|
43
|
+
}) => {
|
|
44
|
+
const radius = toRadius(borderRadius);
|
|
45
|
+
if (!bordered) {
|
|
46
|
+
return {
|
|
47
|
+
"& .MuiFormHelperText-root": { marginLeft: 0 }
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return (theme) => ({
|
|
51
|
+
"& .MuiRadioGroup-root": __spreadProps(__spreadValues({
|
|
52
|
+
paddingTop: 1.25,
|
|
53
|
+
paddingBottom: 1.25,
|
|
54
|
+
paddingX: 1.5,
|
|
55
|
+
border: `1px solid ${error ? theme.palette.error.main : theme.palette.divider}`,
|
|
56
|
+
borderRadius: radius,
|
|
57
|
+
transition: FOCUS_TRANSITION
|
|
58
|
+
}, error && {
|
|
59
|
+
boxShadow: `0 0 0 1px ${theme.palette.error.main}`
|
|
60
|
+
}), {
|
|
61
|
+
// Focus del usuario sobre cualquier radio interno.
|
|
62
|
+
"&:focus-within": {
|
|
63
|
+
borderColor: error ? theme.palette.error.main : theme.palette.primary.main,
|
|
64
|
+
boxShadow: `0 0 0 1px ${error ? theme.palette.error.main : theme.palette.primary.main}`
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
"& .MuiFormHelperText-root": {
|
|
68
|
+
marginLeft: 0
|
|
69
|
+
},
|
|
70
|
+
"& .MuiFormLabel-root": {
|
|
71
|
+
marginBottom: 0.5
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
const RadioGroup = (props) => {
|
|
76
|
+
const _a = props, {
|
|
77
|
+
options,
|
|
78
|
+
label,
|
|
79
|
+
row = true,
|
|
80
|
+
size = "small",
|
|
81
|
+
disabled = false,
|
|
82
|
+
error = false,
|
|
83
|
+
helperText,
|
|
84
|
+
bordered = true,
|
|
85
|
+
borderRadius = 10,
|
|
86
|
+
defaultValue,
|
|
87
|
+
preset,
|
|
88
|
+
sx
|
|
89
|
+
} = _a, rest = __objRest(_a, [
|
|
90
|
+
"options",
|
|
91
|
+
"label",
|
|
92
|
+
"row",
|
|
93
|
+
"size",
|
|
94
|
+
"disabled",
|
|
95
|
+
"error",
|
|
96
|
+
"helperText",
|
|
97
|
+
"bordered",
|
|
98
|
+
"borderRadius",
|
|
99
|
+
"defaultValue",
|
|
100
|
+
"preset",
|
|
101
|
+
"sx"
|
|
102
|
+
]);
|
|
103
|
+
const theme = useTheme();
|
|
104
|
+
const presetSx = resolvePreset("RadioGroup", preset, theme);
|
|
105
|
+
const buildSx = (effectiveError) => [
|
|
106
|
+
buildRadioGroupSx({ bordered, borderRadius, error: effectiveError }),
|
|
107
|
+
...presetSx ? [presetSx] : [],
|
|
108
|
+
...Array.isArray(sx) ? sx : sx ? [sx] : []
|
|
109
|
+
];
|
|
110
|
+
const renderOptions = (fieldName) => options.map((opt) => {
|
|
111
|
+
var _a2;
|
|
112
|
+
const inputId = (_a2 = opt.id) != null ? _a2 : `${fieldName != null ? fieldName : "radio"}-${opt.value}`;
|
|
113
|
+
return /* @__PURE__ */ jsx(
|
|
114
|
+
FormControlLabel,
|
|
115
|
+
{
|
|
116
|
+
value: opt.value,
|
|
117
|
+
control: /* @__PURE__ */ jsx(
|
|
118
|
+
Radio,
|
|
119
|
+
{
|
|
120
|
+
id: inputId,
|
|
121
|
+
size,
|
|
122
|
+
disabled: disabled || opt.disabled
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
label: opt.label,
|
|
126
|
+
disabled: disabled || opt.disabled
|
|
127
|
+
},
|
|
128
|
+
inputId
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
if ("control" in props && props.control) {
|
|
132
|
+
const { name: name2, control, validation, onValueChange } = props;
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
Controller,
|
|
135
|
+
{
|
|
136
|
+
name: name2,
|
|
137
|
+
control,
|
|
138
|
+
rules: validation,
|
|
139
|
+
defaultValue,
|
|
140
|
+
render: ({ field, fieldState: { error: fieldError } }) => {
|
|
141
|
+
var _a2, _b;
|
|
142
|
+
const finalError = !!fieldError || error;
|
|
143
|
+
const finalHelperText = (_a2 = fieldError == null ? void 0 : fieldError.message) != null ? _a2 : helperText;
|
|
144
|
+
return /* @__PURE__ */ jsxs(
|
|
145
|
+
FormControl,
|
|
146
|
+
{
|
|
147
|
+
error: finalError,
|
|
148
|
+
disabled,
|
|
149
|
+
sx: buildSx(finalError),
|
|
150
|
+
fullWidth: true,
|
|
151
|
+
children: [
|
|
152
|
+
label && /* @__PURE__ */ jsx(FormLabel, { children: label }),
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
RadioGroup$1,
|
|
155
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
156
|
+
row,
|
|
157
|
+
name: field.name,
|
|
158
|
+
value: (_b = field.value) != null ? _b : "",
|
|
159
|
+
onBlur: field.onBlur,
|
|
160
|
+
onChange: (_e, value2) => {
|
|
161
|
+
field.onChange(value2);
|
|
162
|
+
onValueChange == null ? void 0 : onValueChange(value2);
|
|
163
|
+
},
|
|
164
|
+
children: renderOptions(field.name)
|
|
165
|
+
})
|
|
166
|
+
),
|
|
167
|
+
finalHelperText && /* @__PURE__ */ jsx(FormHelperText, { children: finalHelperText })
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
const { value, onChange, name } = props;
|
|
176
|
+
return /* @__PURE__ */ jsxs(
|
|
177
|
+
FormControl,
|
|
178
|
+
{
|
|
179
|
+
error,
|
|
180
|
+
disabled,
|
|
181
|
+
sx: buildSx(error),
|
|
182
|
+
fullWidth: true,
|
|
183
|
+
children: [
|
|
184
|
+
label && /* @__PURE__ */ jsx(FormLabel, { children: label }),
|
|
185
|
+
/* @__PURE__ */ jsx(
|
|
186
|
+
RadioGroup$1,
|
|
187
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
188
|
+
row,
|
|
189
|
+
name,
|
|
190
|
+
value: value != null ? value : "",
|
|
191
|
+
onChange: (_e, next) => onChange(next),
|
|
192
|
+
children: renderOptions(name)
|
|
193
|
+
})
|
|
194
|
+
),
|
|
195
|
+
helperText && /* @__PURE__ */ jsx(FormHelperText, { children: helperText })
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
export {
|
|
201
|
+
RadioGroup as R
|
|
202
|
+
};
|
|
203
|
+
//# sourceMappingURL=RadioGroup-bO-ahP9T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup-bO-ahP9T.js","sources":["../src/components/RadioGroup/RadioGroup.sx.ts","../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles';\n\nexport interface BuildRadioGroupSxOptions {\n bordered: boolean;\n borderRadius: number | string;\n error: boolean;\n}\n\nconst toRadius = (borderRadius: number | string) =>\n typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius;\n\n/**\n * Transición compartida (matchea el InputGroup).\n */\nconst FOCUS_TRANSITION =\n 'border-color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, ' +\n 'box-shadow 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms';\n\n/**\n * Builder de sx para RadioGroup. Reproduce el estilo del antiguo\n * `FormRadioGroup` legacy: contenedor con borde + padding vertical.\n *\n * Cuando `bordered=true`, el contenedor gana:\n * - `:focus-within` → borde + shadow primario (mismo patrón que `InputGroup`).\n * - `error=true` → borde + shadow de error (palette.error.main).\n *\n * El shadow es de 1px, así que no hay shift de layout — sólo se intensifica\n * visualmente el borde sin empujar nada alrededor.\n *\n * Si `bordered=false`, devuelve un sx mínimo (sólo helper text reset).\n */\nexport const buildRadioGroupSx = ({\n bordered,\n borderRadius,\n error,\n}: BuildRadioGroupSxOptions): SxProps<Theme> => {\n const radius = toRadius(borderRadius);\n\n if (!bordered) {\n return {\n '& .MuiFormHelperText-root': { marginLeft: 0 },\n };\n }\n\n return (theme) => ({\n '& .MuiRadioGroup-root': {\n paddingTop: 1.25,\n paddingBottom: 1.25,\n paddingX: 1.5,\n border: `1px solid ${\n error ? theme.palette.error.main : theme.palette.divider\n }`,\n borderRadius: radius,\n transition: FOCUS_TRANSITION,\n ...(error && {\n boxShadow: `0 0 0 1px ${theme.palette.error.main}`,\n }),\n // Focus del usuario sobre cualquier radio interno.\n '&:focus-within': {\n borderColor: error\n ? theme.palette.error.main\n : theme.palette.primary.main,\n boxShadow: `0 0 0 1px ${\n error ? theme.palette.error.main : theme.palette.primary.main\n }`,\n },\n },\n '& .MuiFormHelperText-root': {\n marginLeft: 0,\n },\n '& .MuiFormLabel-root': {\n marginBottom: 0.5,\n },\n });\n};\n","import type { FC } from 'react';\nimport { useTheme } from '@mui/material/styles';\nimport {\n FormControl,\n FormControlLabel,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup as MuiRadioGroup,\n type RadioGroupProps as MuiRadioGroupProps,\n type SxProps,\n type Theme,\n} from '@mui/material';\nimport { Controller, type Control, type RegisterOptions } from 'react-hook-form';\n\nimport { buildRadioGroupSx } from './RadioGroup.sx';\nimport { resolvePreset } from '../_shared/resolvePreset';\n\n// ── Tipos de dominio ─────────────────────────────────────────────────────\nexport interface RadioOption {\n /** Valor que se emite cuando se selecciona la opción. */\n value: string;\n /** Texto mostrado al lado del radio. */\n label: string;\n /** Deshabilitar opción individualmente. */\n disabled?: boolean;\n /** ID custom del input (default: prefijo + value). */\n id?: string;\n}\n\nexport type RadioGroupSize = 'small' | 'medium';\n\n// ── Props base (todo lo común entre RHF y controlado) ────────────────────\nexport interface BaseRadioGroupProps\n extends Omit<MuiRadioGroupProps, 'value' | 'onChange' | 'defaultValue'> {\n options: RadioOption[];\n /** Label superior del grupo. */\n label?: string;\n /** Distribución horizontal (default: true — replica el comportamiento legacy). */\n row?: boolean;\n size?: RadioGroupSize;\n disabled?: boolean;\n error?: boolean;\n helperText?: string;\n /** Renderiza un contenedor con borde estilo \"form field\". Default: true. */\n bordered?: boolean;\n /** Border radius del contenedor (cuando bordered). Default: 10. */\n borderRadius?: number | string;\n defaultValue?: string;\n /**\n * Nombre del preset de estilo registrado en `theme.styles.RadioGroup`.\n * - `\"default\"` (o ausente) = estilo built-in del paquete.\n * - Cualquier otro string = mergea el preset encima del estilo built-in.\n */\n preset?: string;\n sx?: SxProps<Theme>;\n}\n\n// ── Variantes discriminadas (RHF vs controlado) ──────────────────────────\nexport interface RHFRadioGroupProps extends BaseRadioGroupProps {\n name: string;\n // `any` plano (no `Control<any>`): RHF tipa `Control<T>` con generics en\n // posiciones tanto contravariantes como covariantes (ej. `_subjects.state`).\n // Cuando el componente o su uso involucra generics adicionales, TS se\n // confunde narroweando el discriminated union y `Control<any>` no logra\n // absorber `Control<MyForm>` en la comparación estructural profunda. El\n // `any` plano elimina ese ruido. RHF adentro sigue teniendo sus tipos\n // fuertes — solo degradamos la superficie del prop del componente.\n control: any;\n validation?: RegisterOptions;\n /**\n * Side-effect que corre después de que RHF actualiza el form state.\n * Útil para cascadas entre campos. NO reemplaza al handler de RHF.\n */\n onValueChange?: (value: string) => void;\n value?: never;\n onChange?: never;\n}\n\nexport interface ControlledRadioGroupProps extends BaseRadioGroupProps {\n name?: string;\n control?: never;\n validation?: never;\n value: string;\n onChange: (value: string) => void;\n}\n\n// ── API pública final ────────────────────────────────────────────────────\nexport type RadioGroupProps = RHFRadioGroupProps | ControlledRadioGroupProps;\n\nexport const RadioGroup: FC<RadioGroupProps> = (props) => {\n const {\n options,\n label,\n row = true,\n size = 'small',\n disabled = false,\n error = false,\n helperText,\n bordered = true,\n borderRadius = 10,\n defaultValue,\n preset,\n sx,\n ...rest\n } = props as ControlledRadioGroupProps & {\n control?: Control<any>;\n validation?: RegisterOptions;\n };\n\n const theme = useTheme();\n const presetSx = resolvePreset('RadioGroup', preset, theme);\n\n // Construye el sx con el estado de error efectivo; se llama por rama\n // (RHF usa el error del Controller, controlado usa el prop `error`).\n const buildSx = (effectiveError: boolean) => [\n buildRadioGroupSx({ bordered, borderRadius, error: effectiveError }),\n ...(presetSx ? [presetSx] : []),\n ...(Array.isArray(sx) ? sx : sx ? [sx] : []),\n ];\n\n const renderOptions = (fieldName?: string) =>\n options.map((opt) => {\n const inputId = opt.id ?? `${fieldName ?? 'radio'}-${opt.value}`;\n return (\n <FormControlLabel\n key={inputId}\n value={opt.value}\n control={\n <Radio\n id={inputId}\n size={size}\n disabled={disabled || opt.disabled}\n />\n }\n label={opt.label}\n disabled={disabled || opt.disabled}\n />\n );\n });\n\n // ── RHF mode ──────────────────────────────────────────────────────────\n if ('control' in props && props.control) {\n const { name, control, validation, onValueChange } = props as RHFRadioGroupProps;\n return (\n <Controller\n name={name}\n control={control}\n rules={validation}\n defaultValue={defaultValue}\n render={({ field, fieldState: { error: fieldError } }) => {\n const finalError = !!fieldError || error;\n const finalHelperText = fieldError?.message ?? helperText;\n return (\n <FormControl\n error={finalError}\n disabled={disabled}\n sx={buildSx(finalError)}\n fullWidth\n >\n {label && <FormLabel>{label}</FormLabel>}\n <MuiRadioGroup\n {...rest}\n row={row}\n name={field.name}\n value={field.value ?? ''}\n onBlur={field.onBlur}\n onChange={(_e, value) => {\n field.onChange(value);\n onValueChange?.(value);\n }}\n >\n {renderOptions(field.name)}\n </MuiRadioGroup>\n {finalHelperText && <FormHelperText>{finalHelperText}</FormHelperText>}\n </FormControl>\n );\n }}\n />\n );\n }\n\n // ── Controlled mode ───────────────────────────────────────────────────\n const { value, onChange, name } = props as ControlledRadioGroupProps;\n return (\n <FormControl\n error={error}\n disabled={disabled}\n sx={buildSx(error)}\n fullWidth\n >\n {label && <FormLabel>{label}</FormLabel>}\n <MuiRadioGroup\n {...rest}\n row={row}\n name={name}\n value={value ?? ''}\n onChange={(_e, next) => onChange(next)}\n >\n {renderOptions(name)}\n </MuiRadioGroup>\n {helperText && <FormHelperText>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n\nexport default RadioGroup;\n"],"names":["_a","name","MuiRadioGroup","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,WAAW,CAAC,iBAChB,OAAO,iBAAiB,WAAW,GAAG,YAAY,OAAO;AAK3D,MAAM,mBACJ;AAgBK,MAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACF,MAAgD;AAC9C,QAAM,SAAS,SAAS,YAAY;AAEpC,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,MACL,6BAA6B,EAAE,YAAY,EAAA;AAAA,IAAE;AAAA,EAEjD;AAEA,SAAO,CAAC,WAAW;AAAA,IACjB,yBAAyB;AAAA,MACvB,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,UAAU;AAAA,MACV,QAAQ,aACN,QAAQ,MAAM,QAAQ,MAAM,OAAO,MAAM,QAAQ,OACnD;AAAA,MACA,cAAc;AAAA,MACd,YAAY;AAAA,OACR,SAAS;AAAA,MACX,WAAW,aAAa,MAAM,QAAQ,MAAM,IAAI;AAAA,IAAA,IAV3B;AAAA;AAAA,MAavB,kBAAkB;AAAA,QAChB,aAAa,QACT,MAAM,QAAQ,MAAM,OACpB,MAAM,QAAQ,QAAQ;AAAA,QAC1B,WAAW,aACT,QAAQ,MAAM,QAAQ,MAAM,OAAO,MAAM,QAAQ,QAAQ,IAC3D;AAAA,MAAA;AAAA,IACF;AA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A,UAAA,iCACK,OADL;AAAA,YAEC;AAAA,YACA;AAAA,YACA,OAAO,wBAAS;AAAA,YAChB,UAAU,CAAC,IAAI,SAAS,SAAS,IAAI;AAAA,YAEpC,wBAAc,IAAI;AAAA,UAAA;AAAA,QAAA;AAAA,QAEpB,cAAc,oBAAC,gBAAA,EAAgB,UAAA,WAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGjD;"}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
33
|
+
import { useMemo, Children, isValidElement, useState } from "react";
|
|
34
|
+
import { MenuItem, ListItemIcon, Typography, Box, Chip, Avatar, FormControl, InputLabel, Select as Select$1, TextField, InputAdornment, FormHelperText, ListSubheader, FilledInput, OutlinedInput } from "@mui/material";
|
|
35
|
+
import SearchIcon from "@mui/icons-material/Search";
|
|
36
|
+
import { useTheme } from "@mui/material/styles";
|
|
37
|
+
import { Controller } from "react-hook-form";
|
|
38
|
+
import { b as buildFormFieldSx } from "./formField.sx-8_QRnKxv.js";
|
|
39
|
+
import { r as resolvePreset } from "./resolvePreset-K6_BfWHD.js";
|
|
40
|
+
import CheckIcon from "@mui/icons-material/Check";
|
|
41
|
+
import ClearIcon from "@mui/icons-material/Clear";
|
|
42
|
+
const buildSelectSx = (borderRadius, labelPosition) => buildFormFieldSx({ borderRadius, labelPosition });
|
|
43
|
+
const groupOptions = (options) => {
|
|
44
|
+
const groups = {};
|
|
45
|
+
options.forEach((opt) => {
|
|
46
|
+
const group = opt.group || "__default";
|
|
47
|
+
if (!groups[group]) groups[group] = [];
|
|
48
|
+
groups[group].push(opt);
|
|
49
|
+
});
|
|
50
|
+
return groups;
|
|
51
|
+
};
|
|
52
|
+
const normalizeSelectValue = (value) => value != null ? value : "";
|
|
53
|
+
const isSelectValueEmpty = (normalizedValue) => normalizedValue === "" || normalizedValue === null || normalizedValue === void 0;
|
|
54
|
+
const renderSelectMenuItem = ({
|
|
55
|
+
option,
|
|
56
|
+
selected,
|
|
57
|
+
customRender
|
|
58
|
+
}) => /* @__PURE__ */ jsxs(
|
|
59
|
+
MenuItem,
|
|
60
|
+
{
|
|
61
|
+
value: option.value,
|
|
62
|
+
disabled: option.disabled,
|
|
63
|
+
selected,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx(ListItemIcon, { sx: { minWidth: 32 }, children: selected && /* @__PURE__ */ jsx(CheckIcon, { color: "success", fontSize: "small" }) }),
|
|
66
|
+
customRender ? customRender(option) : option.label
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
String(option.value)
|
|
70
|
+
);
|
|
71
|
+
function SelectValue(props) {
|
|
72
|
+
var _a;
|
|
73
|
+
const {
|
|
74
|
+
selected,
|
|
75
|
+
options,
|
|
76
|
+
multiple,
|
|
77
|
+
placeholder,
|
|
78
|
+
maxChipsToShow,
|
|
79
|
+
chipVariant,
|
|
80
|
+
renderChipLabel,
|
|
81
|
+
onDeleteChip,
|
|
82
|
+
currentValues
|
|
83
|
+
} = props;
|
|
84
|
+
const isEmpty = !selected || Array.isArray(selected) && selected.length === 0;
|
|
85
|
+
if (isEmpty) {
|
|
86
|
+
return /* @__PURE__ */ jsx(Typography, { sx: { color: "text.disabled" }, children: placeholder || "" });
|
|
87
|
+
}
|
|
88
|
+
if (!multiple) {
|
|
89
|
+
const item = options.find((opt) => opt.value === selected);
|
|
90
|
+
if (renderChipLabel && item) return /* @__PURE__ */ jsx(Fragment, { children: renderChipLabel(item) });
|
|
91
|
+
return /* @__PURE__ */ jsx(Fragment, { children: (_a = item == null ? void 0 : item.label) != null ? _a : String(selected) });
|
|
92
|
+
}
|
|
93
|
+
const selectedValuesArray = selected;
|
|
94
|
+
const displayedChips = selectedValuesArray.slice(0, maxChipsToShow);
|
|
95
|
+
const hiddenChipsCount = selectedValuesArray.length - maxChipsToShow;
|
|
96
|
+
const handleDelete = (chipValue) => {
|
|
97
|
+
if (!onDeleteChip || !currentValues) return;
|
|
98
|
+
onDeleteChip(currentValues.filter((v) => v !== chipValue));
|
|
99
|
+
};
|
|
100
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexWrap: "wrap", gap: 0.5 }, children: [
|
|
101
|
+
displayedChips.map((val) => {
|
|
102
|
+
const item = options.find((o) => o.value === val);
|
|
103
|
+
if (!item) return null;
|
|
104
|
+
return /* @__PURE__ */ jsx(
|
|
105
|
+
Chip,
|
|
106
|
+
{
|
|
107
|
+
variant: chipVariant,
|
|
108
|
+
color: "primary",
|
|
109
|
+
size: "small",
|
|
110
|
+
label: renderChipLabel ? renderChipLabel(item) : item.label,
|
|
111
|
+
avatar: item.img ? /* @__PURE__ */ jsx(Avatar, { src: item.img }) : void 0,
|
|
112
|
+
onDelete: () => handleDelete(val),
|
|
113
|
+
deleteIcon: /* @__PURE__ */ jsx(ClearIcon, { fontSize: "small" })
|
|
114
|
+
},
|
|
115
|
+
String(val)
|
|
116
|
+
);
|
|
117
|
+
}),
|
|
118
|
+
hiddenChipsCount > 0 && /* @__PURE__ */ jsx(Chip, { size: "small", variant: chipVariant, label: `+${hiddenChipsCount} más` })
|
|
119
|
+
] });
|
|
120
|
+
}
|
|
121
|
+
function Option(_props) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
Option.displayName = "Option";
|
|
125
|
+
function Select(props) {
|
|
126
|
+
const _a = props, {
|
|
127
|
+
label,
|
|
128
|
+
options = [],
|
|
129
|
+
defaultValue,
|
|
130
|
+
size = "small",
|
|
131
|
+
placeholder,
|
|
132
|
+
children,
|
|
133
|
+
maxHeight = 300,
|
|
134
|
+
maxWidth,
|
|
135
|
+
disabled = false,
|
|
136
|
+
error = false,
|
|
137
|
+
helperText,
|
|
138
|
+
borderRadius = 10,
|
|
139
|
+
labelPosition = "outside",
|
|
140
|
+
preset,
|
|
141
|
+
variant = "outlined",
|
|
142
|
+
sx,
|
|
143
|
+
className,
|
|
144
|
+
multiple = false,
|
|
145
|
+
maxChipsToShow = 3,
|
|
146
|
+
chipVariant = "filled",
|
|
147
|
+
renderChipLabel,
|
|
148
|
+
filterable = false,
|
|
149
|
+
name: _nameIgnored,
|
|
150
|
+
control: _controlIgnored,
|
|
151
|
+
validation: _validationIgnored,
|
|
152
|
+
value: _valueIgnored,
|
|
153
|
+
onChange: _onChangeIgnored
|
|
154
|
+
} = _a, rest = __objRest(_a, [
|
|
155
|
+
"label",
|
|
156
|
+
"options",
|
|
157
|
+
"defaultValue",
|
|
158
|
+
"size",
|
|
159
|
+
"placeholder",
|
|
160
|
+
"children",
|
|
161
|
+
"maxHeight",
|
|
162
|
+
"maxWidth",
|
|
163
|
+
"disabled",
|
|
164
|
+
"error",
|
|
165
|
+
"helperText",
|
|
166
|
+
"borderRadius",
|
|
167
|
+
"labelPosition",
|
|
168
|
+
"preset",
|
|
169
|
+
"variant",
|
|
170
|
+
"sx",
|
|
171
|
+
"className",
|
|
172
|
+
"multiple",
|
|
173
|
+
"maxChipsToShow",
|
|
174
|
+
"chipVariant",
|
|
175
|
+
"renderChipLabel",
|
|
176
|
+
"filterable",
|
|
177
|
+
// Separamos estos aunque no se usen directamente acá — evita que lleguen
|
|
178
|
+
// al DOM del MuiSelect via `{...rest}` y generen warnings de React.
|
|
179
|
+
"name",
|
|
180
|
+
"control",
|
|
181
|
+
"validation",
|
|
182
|
+
"value",
|
|
183
|
+
"onChange"
|
|
184
|
+
]);
|
|
185
|
+
const theme = useTheme();
|
|
186
|
+
const presetSx = resolvePreset("Select", preset, theme);
|
|
187
|
+
const isRHFMode = "control" in props && props.control !== void 0;
|
|
188
|
+
const customRender = useMemo(() => {
|
|
189
|
+
var _a2;
|
|
190
|
+
if (Children.count(children) === 1) {
|
|
191
|
+
const child = Children.only(children);
|
|
192
|
+
if (isValidElement(child) && ((_a2 = child.type) == null ? void 0 : _a2.displayName) === "Option") {
|
|
193
|
+
return child.props.children;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return null;
|
|
197
|
+
}, [children]);
|
|
198
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
199
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
200
|
+
const [searchText, setSearchText] = useState("");
|
|
201
|
+
const filteredOptions = useMemo(() => {
|
|
202
|
+
if (!filterable || !searchText.trim()) return options;
|
|
203
|
+
const q = searchText.trim().toLowerCase();
|
|
204
|
+
return options.filter((opt) => opt.label.toLowerCase().includes(q));
|
|
205
|
+
}, [options, filterable, searchText]);
|
|
206
|
+
const groupedOptions = useMemo(
|
|
207
|
+
() => groupOptions(filteredOptions),
|
|
208
|
+
[filteredOptions]
|
|
209
|
+
);
|
|
210
|
+
const buildMenuItems = (currentValue) => {
|
|
211
|
+
const items = [];
|
|
212
|
+
Object.entries(groupedOptions).forEach(([group, opts]) => {
|
|
213
|
+
if (group !== "__default") {
|
|
214
|
+
items.push(
|
|
215
|
+
/* @__PURE__ */ jsx(ListSubheader, { disableSticky: true, children: group }, group)
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
opts.forEach((opt) => {
|
|
219
|
+
const selected = Array.isArray(currentValue) ? currentValue.includes(opt.value) : currentValue === opt.value;
|
|
220
|
+
items.push(
|
|
221
|
+
renderSelectMenuItem({
|
|
222
|
+
option: opt,
|
|
223
|
+
selected,
|
|
224
|
+
customRender
|
|
225
|
+
})
|
|
226
|
+
);
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
return items;
|
|
230
|
+
};
|
|
231
|
+
const mergedSx = [
|
|
232
|
+
...presetSx ? [presetSx] : [buildSelectSx(borderRadius, labelPosition)],
|
|
233
|
+
...Array.isArray(sx) ? sx : sx ? [sx] : []
|
|
234
|
+
];
|
|
235
|
+
const renderSelect = (selectValue, selectOnChange, onBlur, inputRef, rhfError, rhfHelperText, onValuesChange) => {
|
|
236
|
+
const finalError = !!rhfError || !!error;
|
|
237
|
+
const finalHelperText = rhfHelperText != null ? rhfHelperText : helperText;
|
|
238
|
+
const inputElement = variant === "filled" ? /* @__PURE__ */ jsx(FilledInput, {}) : labelPosition === "floating" ? /* @__PURE__ */ jsx(OutlinedInput, { label }) : /* @__PURE__ */ jsx(OutlinedInput, {});
|
|
239
|
+
const normalizedValue = multiple ? selectValue != null ? selectValue : [] : normalizeSelectValue(selectValue);
|
|
240
|
+
const isEmpty = multiple ? normalizedValue.length === 0 : isSelectValueEmpty(normalizedValue);
|
|
241
|
+
const shouldShrink = !isEmpty || isFocused || isOpen;
|
|
242
|
+
const shouldDisplayPlaceholder = isEmpty && (isFocused || isOpen) && !!placeholder;
|
|
243
|
+
return /* @__PURE__ */ jsxs(
|
|
244
|
+
FormControl,
|
|
245
|
+
{
|
|
246
|
+
fullWidth: true,
|
|
247
|
+
size,
|
|
248
|
+
variant,
|
|
249
|
+
error: finalError,
|
|
250
|
+
disabled,
|
|
251
|
+
className,
|
|
252
|
+
sx: mergedSx,
|
|
253
|
+
children: [
|
|
254
|
+
label && /* @__PURE__ */ jsx(InputLabel, { shrink: shouldShrink, children: label }),
|
|
255
|
+
/* @__PURE__ */ jsxs(
|
|
256
|
+
Select$1,
|
|
257
|
+
__spreadProps(__spreadValues({
|
|
258
|
+
multiple,
|
|
259
|
+
value: normalizedValue,
|
|
260
|
+
onChange: selectOnChange,
|
|
261
|
+
onBlur: (e) => {
|
|
262
|
+
setIsFocused(false);
|
|
263
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
264
|
+
},
|
|
265
|
+
onFocus: () => setIsFocused(true),
|
|
266
|
+
onOpen: () => setIsOpen(true),
|
|
267
|
+
onClose: () => {
|
|
268
|
+
setIsOpen(false);
|
|
269
|
+
if (filterable) setSearchText("");
|
|
270
|
+
},
|
|
271
|
+
renderValue: (selected) => /* @__PURE__ */ jsx(
|
|
272
|
+
SelectValue,
|
|
273
|
+
{
|
|
274
|
+
selected,
|
|
275
|
+
options,
|
|
276
|
+
multiple,
|
|
277
|
+
placeholder,
|
|
278
|
+
maxChipsToShow,
|
|
279
|
+
chipVariant,
|
|
280
|
+
renderChipLabel,
|
|
281
|
+
currentValues: multiple ? selected : void 0,
|
|
282
|
+
onDeleteChip: onValuesChange
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
displayEmpty: shouldDisplayPlaceholder,
|
|
286
|
+
input: inputElement,
|
|
287
|
+
disabled,
|
|
288
|
+
MenuProps: {
|
|
289
|
+
PaperProps: {
|
|
290
|
+
style: { maxHeight, maxWidth }
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
inputRef
|
|
294
|
+
}, rest), {
|
|
295
|
+
children: [
|
|
296
|
+
filterable && /* @__PURE__ */ jsx(
|
|
297
|
+
Box,
|
|
298
|
+
{
|
|
299
|
+
sx: { px: 1.5, py: 1, position: "sticky", top: 0, zIndex: 1, bgcolor: "background.paper" },
|
|
300
|
+
onClick: (e) => e.stopPropagation(),
|
|
301
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
302
|
+
children: /* @__PURE__ */ jsx(
|
|
303
|
+
TextField,
|
|
304
|
+
{
|
|
305
|
+
size: "small",
|
|
306
|
+
fullWidth: true,
|
|
307
|
+
autoFocus: true,
|
|
308
|
+
placeholder: "Buscar...",
|
|
309
|
+
value: searchText,
|
|
310
|
+
onChange: (e) => setSearchText(e.target.value),
|
|
311
|
+
slotProps: {
|
|
312
|
+
input: {
|
|
313
|
+
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx(SearchIcon, { fontSize: "small" }) })
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
)
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
buildMenuItems(normalizedValue)
|
|
321
|
+
]
|
|
322
|
+
})
|
|
323
|
+
),
|
|
324
|
+
finalHelperText && /* @__PURE__ */ jsx(FormHelperText, { children: finalHelperText })
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
};
|
|
329
|
+
if (isRHFMode) {
|
|
330
|
+
const { name, control, validation, onValueChange } = props;
|
|
331
|
+
return /* @__PURE__ */ jsx(
|
|
332
|
+
Controller,
|
|
333
|
+
{
|
|
334
|
+
name,
|
|
335
|
+
control,
|
|
336
|
+
rules: validation,
|
|
337
|
+
defaultValue,
|
|
338
|
+
render: ({ field, fieldState: { error: fieldError } }) => {
|
|
339
|
+
var _a2;
|
|
340
|
+
return renderSelect(
|
|
341
|
+
(_a2 = field.value) != null ? _a2 : null,
|
|
342
|
+
(e) => {
|
|
343
|
+
const next = e.target.value;
|
|
344
|
+
field.onChange(next);
|
|
345
|
+
onValueChange == null ? void 0 : onValueChange(next);
|
|
346
|
+
},
|
|
347
|
+
field.onBlur,
|
|
348
|
+
field.ref,
|
|
349
|
+
!!fieldError,
|
|
350
|
+
fieldError == null ? void 0 : fieldError.message,
|
|
351
|
+
(nextVals) => {
|
|
352
|
+
field.onChange(nextVals);
|
|
353
|
+
onValueChange == null ? void 0 : onValueChange(nextVals);
|
|
354
|
+
}
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
const { value, onChange } = props;
|
|
361
|
+
const handleChange = onChange;
|
|
362
|
+
return renderSelect(
|
|
363
|
+
value,
|
|
364
|
+
(e) => handleChange(e.target.value),
|
|
365
|
+
void 0,
|
|
366
|
+
void 0,
|
|
367
|
+
void 0,
|
|
368
|
+
void 0,
|
|
369
|
+
(next) => onChange(next)
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
export {
|
|
373
|
+
Option as O,
|
|
374
|
+
Select as S
|
|
375
|
+
};
|
|
376
|
+
//# sourceMappingURL=Select-BY5Y0qZ1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select-BY5Y0qZ1.js","sources":["../src/components/Select/Select.sx.ts","../src/components/Select/Select.helpers.ts","../src/components/Select/_parts/SelectMenuItem.tsx","../src/components/Select/_parts/SelectValue.tsx","../src/components/Select/Select.tsx"],"sourcesContent":["import type { SelectProps as MuiSelectProps } from '@mui/material';\n\nimport { buildFormFieldSx } from '../_shared/formField.sx';\nimport type { LabelPosition } from './Select';\n\n/**\n * Builder de sx para el Select. Usa el builder compartido\n * `buildFormFieldSx`. El Select no necesita overrides específicos.\n */\nexport const buildSelectSx = (\n borderRadius: number | string,\n labelPosition: LabelPosition,\n): MuiSelectProps['sx'] =>\n buildFormFieldSx({ borderRadius, labelPosition }) as MuiSelectProps['sx'];\n","import type { SelectOption } from './Select';\n\n/**\n * Agrupa opciones por la propiedad `group`. Las opciones sin group caen\n * bajo la key especial `__default`. Devuelve un Record para iterar en orden\n * de inserción con Object.entries.\n */\nexport const groupOptions = (\n options: SelectOption[],\n): Record<string, SelectOption[]> => {\n const groups: Record<string, SelectOption[]> = {};\n options.forEach((opt) => {\n const group = opt.group || '__default';\n if (!groups[group]) groups[group] = [];\n groups[group].push(opt);\n });\n return groups;\n};\n\n/**\n * Normaliza el valor single al shape que espera MUI Select: string vacío si\n * el valor es `null`/`undefined`.\n */\nexport const normalizeSelectValue = <T>(value: T | null | undefined): T | '' =>\n (value ?? '') as T | '';\n\n/** `true` si el valor está vacío (para shrink del label + placeholder). */\nexport const isSelectValueEmpty = (normalizedValue: unknown): boolean =>\n normalizedValue === '' ||\n normalizedValue === null ||\n normalizedValue === undefined;\n","import React from 'react';\nimport { ListItemIcon, MenuItem } from '@mui/material';\nimport CheckIcon from '@mui/icons-material/Check';\n\nimport type { SelectOption, RenderOptionItem } from '../Select';\n\ninterface RenderSelectMenuItemArgs {\n option: SelectOption;\n selected: boolean;\n customRender?: RenderOptionItem | null;\n}\n\n/**\n * Render helper (no componente) que devuelve un <MenuItem> listo para\n * colocarse como hijo directo del <MuiSelect>. Se implementa como función\n * y no como componente porque MUI Select inspecciona `props.value` de sus\n * children para resolver la selección, y envolverlo en un componente extra\n * rompe esa detección.\n *\n * Incluye el icono de check a la izquierda cuando `selected` es true. Si el\n * consumer pasó un `<Option>{(opt) => ...}</Option>`, usa ese render para el\n * contenido principal; de lo contrario muestra `option.label`.\n */\nexport const renderSelectMenuItem = ({\n option,\n selected,\n customRender,\n}: RenderSelectMenuItemArgs): React.ReactElement => (\n <MenuItem\n key={String(option.value)}\n value={option.value}\n disabled={option.disabled}\n selected={selected}\n >\n <ListItemIcon sx={{ minWidth: 32 }}>\n {selected && <CheckIcon color=\"success\" fontSize=\"small\" />}\n </ListItemIcon>\n {customRender ? customRender(option) : option.label}\n </MenuItem>\n);\n","import { Avatar, Box, Chip, Typography } from '@mui/material';\nimport ClearIcon from '@mui/icons-material/Clear';\n\nimport type {\n SelectOption,\n RenderChipLabel,\n ChipVariant,\n} from '../Select';\n\ninterface SelectValueProps<TValue extends SelectOption['value']> {\n selected: TValue | TValue[] | null | undefined;\n options: SelectOption[];\n multiple: boolean;\n placeholder?: string;\n maxChipsToShow: number;\n chipVariant: ChipVariant;\n renderChipLabel?: RenderChipLabel;\n /** Solo relevante en modo multiple. Recibe el nuevo array de valores. */\n onDeleteChip?: (nextValues: TValue[]) => void;\n /** Array de valores actuales (para componer el nuevo array al borrar chips). */\n currentValues?: TValue[];\n}\n\n/**\n * Render del valor seleccionado del Select.\n * - single: texto (label) o lo que devuelva `renderChipLabel`.\n * - multiple: chips con delete. Trunca después de `maxChipsToShow` mostrando \"+N más\".\n * - empty: placeholder en color disabled.\n */\nexport function SelectValue<TValue extends SelectOption['value']>(\n props: SelectValueProps<TValue>,\n) {\n const {\n selected,\n options,\n multiple,\n placeholder,\n maxChipsToShow,\n chipVariant,\n renderChipLabel,\n onDeleteChip,\n currentValues,\n } = props;\n\n const isEmpty =\n !selected || (Array.isArray(selected) && selected.length === 0);\n\n if (isEmpty) {\n return (\n <Typography sx={{ color: 'text.disabled' }}>{placeholder || ''}</Typography>\n );\n }\n\n if (!multiple) {\n const item = options.find((opt) => opt.value === selected);\n if (renderChipLabel && item) return <>{renderChipLabel(item)}</>;\n return <>{item?.label ?? String(selected)}</>;\n }\n\n const selectedValuesArray = selected as TValue[];\n const displayedChips = selectedValuesArray.slice(0, maxChipsToShow);\n const hiddenChipsCount = selectedValuesArray.length - maxChipsToShow;\n\n const handleDelete = (chipValue: TValue) => {\n if (!onDeleteChip || !currentValues) return;\n onDeleteChip(currentValues.filter((v) => v !== chipValue));\n };\n\n return (\n <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>\n {displayedChips.map((val) => {\n const item = options.find((o) => o.value === val);\n if (!item) return null;\n\n return (\n <Chip\n variant={chipVariant}\n color=\"primary\"\n size=\"small\"\n key={String(val)}\n label={renderChipLabel ? renderChipLabel(item) : item.label}\n avatar={item.img ? <Avatar src={item.img} /> : undefined}\n onDelete={() => handleDelete(val)}\n deleteIcon={<ClearIcon fontSize=\"small\" />}\n />\n );\n })}\n {hiddenChipsCount > 0 && (\n <Chip size=\"small\" variant={chipVariant} label={`+${hiddenChipsCount} más`} />\n )}\n </Box>\n );\n}\n\nexport default SelectValue;\n","import {\n Children,\n isValidElement,\n useMemo,\n useState,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport {\n FilledInput,\n FormControl,\n FormHelperText,\n InputLabel,\n ListSubheader,\n OutlinedInput,\n Select as MuiSelect,\n TextField,\n InputAdornment,\n Box,\n type SelectChangeEvent,\n type SelectProps as MuiSelectProps,\n} from '@mui/material';\nimport SearchIcon from '@mui/icons-material/Search';\nimport { useTheme } from '@mui/material/styles';\nimport { Controller, type Control, type RegisterOptions } from 'react-hook-form';\n\nimport { buildSelectSx } from './Select.sx';\nimport { resolvePreset } from '../_shared/resolvePreset';\nimport {\n groupOptions,\n isSelectValueEmpty,\n normalizeSelectValue,\n} from './Select.helpers';\nimport { renderSelectMenuItem } from './_parts/SelectMenuItem';\nimport { SelectValue } from './_parts/SelectValue';\n\n// ── Tipos de dominio ─────────────────────────────────────────────────────\nexport interface SelectOption {\n value: string | number;\n label: string;\n img?: string;\n disabled?: boolean;\n group?: string;\n [key: string]: any;\n}\n\nexport type LabelPosition = 'outside' | 'floating';\nexport type SelectSize = 'small' | 'medium';\n\n// ── Render slots ─────────────────────────────────────────────────────────\nexport type RenderOptionItem = (item: SelectOption) => ReactNode;\n\n/** Variante visual de los chips en modo `multiple`. */\nexport type ChipVariant = 'filled' | 'outlined';\n/** Render custom del label de cada chip/valor seleccionado. */\nexport type RenderChipLabel = (item: SelectOption) => ReactNode;\n\n// ── Sub-componente declarativo <Option> ──────────────────────────────────\nexport interface OptionProps {\n children: RenderOptionItem;\n}\n\n// ── Props base ───────────────────────────────────────────────────────────\nexport interface BaseSelectProps<\n TValue extends SelectOption['value'] = SelectOption['value'],\n> {\n label?: string;\n options?: SelectOption[];\n defaultValue?: TValue;\n size?: SelectSize;\n placeholder?: string;\n children?: ReactElement<{ children: RenderOptionItem }>;\n maxHeight?: number | string;\n maxWidth?: number | string;\n /** Si `true`, muestra un buscador arriba del menú para filtrar opciones. */\n filterable?: boolean;\n disabled?: boolean;\n error?: boolean;\n helperText?: string;\n /** Border radius del input (px o string CSS). Default: 10 */\n borderRadius?: number | string;\n /**\n * Posición del label.\n * - \"outside\" (default): label arriba del input, sin animación.\n * - \"floating\": label clásico de MUI (flota dentro del notched outline).\n */\n labelPosition?: LabelPosition;\n /**\n * Nombre del preset de estilo registrado en `theme.styles.Select`.\n * - `\"default\"` (o ausente) = estilo built-in del paquete.\n * - Cualquier otro string = mergea el preset encima del estilo built-in.\n */\n preset?: string;\n /** MUI input variant. Default: 'outlined'. */\n variant?: 'outlined' | 'filled';\n sx?: MuiSelectProps['sx'];\n className?: string;\n}\n\n// ── Variantes discriminadas (RHF vs controlado) ──────────────────────────\nexport interface RHFSelectProps<\n TValue extends SelectOption['value'] = SelectOption['value'],\n> extends BaseSelectProps<TValue> {\n name: string;\n // `any` plano (no `Control<any>`): RHF tipa `Control<T>` con generics en\n // posiciones tanto contravariantes como covariantes (ej. `_subjects.state`).\n // Cuando el componente tiene generics propios (como `TValue` acá), TS se\n // confunde narroweando el discriminated union y `Control<any>` no logra\n // absorber `Control<MyForm>` en la comparación estructural profunda.\n // El `any` plano elimina ese ruido. RHF adentro sigue teniendo sus tipos\n // fuertes — solo degradamos la superficie del prop del Select.\n control: any;\n validation?: RegisterOptions;\n /**\n * Side-effect que corre después de que RHF actualiza el form state.\n * Útil para cascadas entre campos (ej. reset de municipio al cambiar\n * departamento). NO reemplaza al handler de RHF.\n */\n onValueChange?: (value: TValue) => void;\n multiple?: false;\n value?: never;\n onChange?: never;\n}\n\nexport interface StandardSelectProps<\n TValue extends SelectOption['value'] = SelectOption['value'],\n> extends BaseSelectProps<TValue> {\n name?: string;\n control?: never;\n validation?: never;\n multiple?: false;\n value: TValue;\n onChange: (val: TValue) => void;\n}\n\nexport interface MultipleSelectProps<\n TValue extends SelectOption['value'] = SelectOption['value'],\n> extends BaseSelectProps<TValue> {\n name?: string;\n control?: never;\n validation?: never;\n multiple: true;\n value: TValue[];\n onChange: (val: TValue[]) => void;\n /** Máximo de chips visibles antes de truncar con \"+N más\". Default: 3. */\n maxChipsToShow?: number;\n /** Variante visual de los chips. Default: 'filled'. */\n chipVariant?: ChipVariant;\n /** Render custom del label de cada chip. */\n renderChipLabel?: RenderChipLabel;\n}\n\n// ── API pública final ────────────────────────────────────────────────────\nexport type SelectProps<\n TValue extends SelectOption['value'] = SelectOption['value'],\n> =\n | RHFSelectProps<TValue>\n | StandardSelectProps<TValue>\n | MultipleSelectProps<TValue>;\n\n// ── Sub-componente declarativo <Option> ──────────────────────────────────\nexport function Option(_props: OptionProps) {\n return null;\n}\nOption.displayName = 'Option';\n\n// ── Componente ───────────────────────────────────────────────────────────\nexport function Select<\n TValue extends SelectOption['value'] = SelectOption['value'],\n>(props: SelectProps<TValue>) {\n const {\n label,\n options = [],\n defaultValue,\n size = 'small',\n placeholder,\n children,\n maxHeight = 300,\n maxWidth,\n disabled = false,\n error = false,\n helperText,\n borderRadius = 10,\n labelPosition = 'outside',\n preset,\n variant = 'outlined',\n sx,\n className,\n multiple = false,\n maxChipsToShow = 3,\n chipVariant = 'filled',\n renderChipLabel,\n filterable = false,\n // Separamos estos aunque no se usen directamente acá — evita que lleguen\n // al DOM del MuiSelect via `{...rest}` y generen warnings de React.\n name: _nameIgnored,\n control: _controlIgnored,\n validation: _validationIgnored,\n value: _valueIgnored,\n onChange: _onChangeIgnored,\n ...rest\n } = props as StandardSelectProps<TValue> & {\n name?: string;\n control?: Control<any>;\n validation?: RegisterOptions;\n multiple?: boolean;\n maxChipsToShow?: number;\n chipVariant?: ChipVariant;\n renderChipLabel?: RenderChipLabel;\n filterable?: boolean;\n };\n\n const theme = useTheme();\n const presetSx = resolvePreset('Select', preset, theme);\n\n const isRHFMode = 'control' in props && (props as RHFSelectProps<TValue>).control !== undefined;\n\n // Custom render opcional vía <Option>{item => ...}</Option>\n const customRender: RenderOptionItem | null = useMemo(() => {\n if (Children.count(children) === 1) {\n const child = Children.only(children);\n if (isValidElement(child) && (child.type as any)?.displayName === 'Option') {\n return (child.props as OptionProps).children;\n }\n }\n return null;\n }, [children]);\n\n // Focus/open tracking para el comportamiento del label \"outside\".\n const [isOpen, setIsOpen] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n // Texto del buscador (modo `filterable`).\n const [searchText, setSearchText] = useState('');\n\n const filteredOptions = useMemo(() => {\n if (!filterable || !searchText.trim()) return options;\n const q = searchText.trim().toLowerCase();\n return options.filter((opt) => opt.label.toLowerCase().includes(q));\n }, [options, filterable, searchText]);\n\n const groupedOptions = useMemo(\n () => groupOptions(filteredOptions),\n [filteredOptions],\n );\n\n // Items del menú (grupos + opciones). El buscador se inyecta aparte.\n const buildMenuItems = (currentValue: TValue | TValue[] | '') => {\n const items: ReactNode[] = [];\n Object.entries(groupedOptions).forEach(([group, opts]) => {\n if (group !== '__default') {\n items.push(\n <ListSubheader key={group} disableSticky>\n {group}\n </ListSubheader>,\n );\n }\n opts.forEach((opt) => {\n const selected = Array.isArray(currentValue)\n ? currentValue.includes(opt.value as TValue)\n : currentValue === opt.value;\n items.push(\n renderSelectMenuItem({\n option: opt,\n selected,\n customRender,\n }),\n );\n });\n });\n return items;\n };\n\n const mergedSx = [\n ...(presetSx ? [presetSx] : [buildSelectSx(borderRadius, labelPosition)]),\n ...(Array.isArray(sx) ? sx : sx ? [sx] : []),\n ];\n\n // Render base (común a RHF y controlled)\n const renderSelect = (\n selectValue: TValue | TValue[] | null | undefined,\n selectOnChange: (event: SelectChangeEvent<TValue | TValue[]>) => void,\n onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void,\n inputRef?: React.Ref<HTMLInputElement>,\n rhfError?: boolean,\n rhfHelperText?: string,\n onValuesChange?: (next: TValue[]) => void,\n ) => {\n const finalError = !!rhfError || !!error;\n const finalHelperText = rhfHelperText ?? helperText;\n\n const inputElement =\n variant === 'filled'\n ? <FilledInput />\n : labelPosition === 'floating'\n ? <OutlinedInput label={label} />\n : <OutlinedInput />;\n\n const normalizedValue = multiple\n ? ((selectValue as TValue[] | null | undefined) ?? [])\n : normalizeSelectValue(selectValue as TValue | null | undefined);\n const isEmpty = multiple\n ? (normalizedValue as TValue[]).length === 0\n : isSelectValueEmpty(normalizedValue);\n\n // Shrink cuando hay valor, foco, o dropdown abierto.\n const shouldShrink = !isEmpty || isFocused || isOpen;\n // Placeholder solo cuando el label ya subió.\n const shouldDisplayPlaceholder =\n isEmpty && (isFocused || isOpen) && !!placeholder;\n\n return (\n <FormControl\n fullWidth\n size={size}\n variant={variant}\n error={finalError}\n disabled={disabled}\n className={className}\n sx={mergedSx}\n >\n {label && <InputLabel shrink={shouldShrink}>{label}</InputLabel>}\n <MuiSelect<TValue | TValue[]>\n multiple={multiple}\n value={normalizedValue as TValue | TValue[]}\n onChange={selectOnChange}\n onBlur={(e) => {\n setIsFocused(false);\n onBlur?.(e);\n }}\n onFocus={() => setIsFocused(true)}\n onOpen={() => setIsOpen(true)}\n onClose={() => {\n setIsOpen(false);\n if (filterable) setSearchText('');\n }}\n renderValue={(selected) => (\n <SelectValue<TValue>\n selected={selected as TValue | TValue[]}\n options={options}\n multiple={multiple}\n placeholder={placeholder}\n maxChipsToShow={maxChipsToShow}\n chipVariant={chipVariant}\n renderChipLabel={renderChipLabel}\n currentValues={multiple ? (selected as TValue[]) : undefined}\n onDeleteChip={onValuesChange}\n />\n )}\n displayEmpty={shouldDisplayPlaceholder}\n input={inputElement}\n disabled={disabled}\n MenuProps={{\n PaperProps: {\n style: { maxHeight, maxWidth },\n },\n }}\n inputRef={inputRef}\n {...(rest as any)}\n >\n {filterable && (\n <Box\n sx={{ px: 1.5, py: 1, position: 'sticky', top: 0, zIndex: 1, bgcolor: 'background.paper' }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n <TextField\n size=\"small\"\n fullWidth\n autoFocus\n placeholder=\"Buscar...\"\n value={searchText}\n onChange={(e) => setSearchText(e.target.value)}\n slotProps={{\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <SearchIcon fontSize=\"small\" />\n </InputAdornment>\n ),\n },\n }}\n />\n </Box>\n )}\n {buildMenuItems(normalizedValue as TValue | TValue[] | '')}\n </MuiSelect>\n {finalHelperText && <FormHelperText>{finalHelperText}</FormHelperText>}\n </FormControl>\n );\n };\n\n // ── RHF mode ──────────────────────────────────────────────────────────\n if (isRHFMode) {\n const { name, control, validation, onValueChange } = props as RHFSelectProps<TValue>;\n return (\n <Controller\n name={name}\n control={control}\n rules={validation}\n defaultValue={defaultValue}\n render={({ field, fieldState: { error: fieldError } }) =>\n renderSelect(\n field.value ?? null,\n (e) => {\n const next = e.target.value as TValue;\n field.onChange(next);\n onValueChange?.(next);\n },\n field.onBlur,\n field.ref,\n !!fieldError,\n fieldError?.message,\n (nextVals) => {\n field.onChange(nextVals);\n onValueChange?.(nextVals as unknown as TValue);\n },\n )\n }\n />\n );\n }\n\n // ── Controlled mode (single o multiple) ───────────────────────────────\n const { value, onChange } = props as\n | StandardSelectProps<TValue>\n | MultipleSelectProps<TValue>;\n const handleChange = onChange as (val: TValue | TValue[]) => void;\n return renderSelect(\n value as TValue | TValue[],\n (e) => handleChange(e.target.value as TValue | TValue[]),\n undefined,\n undefined,\n undefined,\n undefined,\n (next) => (onChange as (val: TValue[]) => void)(next),\n );\n}\n\nexport default Select;\n"],"names":["_a","MuiSelect"],"mappings":";;;;;;;;;;;;;;;;;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