@rolster/react-components 19.4.0 → 19.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/assets/{index-CvUJnmkm.css → index-ChnUq-Oa.css} +102 -16
  3. package/dist/cjs/index.cjs +271 -208
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/esm/components/atoms/Avatar/Avatar.css +4 -4
  6. package/dist/esm/components/atoms/Avatar/Avatar.css.map +1 -1
  7. package/dist/esm/components/atoms/ButtonOption/ButtonOption.js +1 -1
  8. package/dist/esm/components/atoms/ButtonOption/ButtonOption.js.map +1 -1
  9. package/dist/esm/components/atoms/InputPassword/InputPassword.js +3 -3
  10. package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
  11. package/dist/esm/components/atoms/Poster/Poster.css +1 -1
  12. package/dist/esm/components/atoms/Poster/Poster.css.map +1 -1
  13. package/dist/esm/components/molecules/FieldFile/FieldFile.css +29 -0
  14. package/dist/esm/components/molecules/FieldFile/FieldFile.css.map +1 -0
  15. package/dist/esm/components/molecules/FieldFile/FieldFile.d.ts +15 -0
  16. package/dist/esm/components/molecules/FieldFile/FieldFile.js +43 -0
  17. package/dist/esm/components/molecules/FieldFile/FieldFile.js.map +1 -0
  18. package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.css +49 -0
  19. package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.css.map +1 -0
  20. package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.d.ts +29 -0
  21. package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.js +35 -0
  22. package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.js.map +1 -0
  23. package/dist/esm/components/molecules/FieldReadonly/FieldReadonly.css.map +1 -1
  24. package/dist/esm/components/molecules/Pagination/Pagination.js +18 -17
  25. package/dist/esm/components/molecules/Pagination/Pagination.js.map +1 -1
  26. package/dist/esm/components/molecules/PickerDay/PickerDay.d.ts +1 -1
  27. package/dist/esm/components/molecules/PickerDay/PickerDay.js +9 -9
  28. package/dist/esm/components/molecules/PickerDay/PickerDay.js.map +1 -1
  29. package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.d.ts +1 -1
  30. package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js +16 -16
  31. package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js.map +1 -1
  32. package/dist/esm/components/molecules/PickerMonth/PickerMonth.d.ts +1 -1
  33. package/dist/esm/components/molecules/PickerMonth/PickerMonth.js +9 -9
  34. package/dist/esm/components/molecules/PickerMonth/PickerMonth.js.map +1 -1
  35. package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js +2 -2
  36. package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js.map +1 -1
  37. package/dist/esm/components/molecules/PickerYear/PickerYear.d.ts +1 -1
  38. package/dist/esm/components/molecules/PickerYear/PickerYear.js +8 -8
  39. package/dist/esm/components/molecules/PickerYear/PickerYear.js.map +1 -1
  40. package/dist/esm/components/molecules/Slider/Slider.d.ts +1 -1
  41. package/dist/esm/components/molecules/Slider/Slider.js +26 -26
  42. package/dist/esm/components/molecules/Slider/Slider.js.map +1 -1
  43. package/dist/esm/components/organisms/BottomSheet/BottomSheet.css +6 -3
  44. package/dist/esm/components/organisms/BottomSheet/BottomSheet.css.map +1 -1
  45. package/dist/esm/components/organisms/Confirmation/Confirmation.css +2 -2
  46. package/dist/esm/components/organisms/Confirmation/Confirmation.css.map +1 -1
  47. package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +28 -24
  48. package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
  49. package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js +26 -15
  50. package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteController.js.map +1 -1
  51. package/dist/esm/components/organisms/FieldClock/FieldClock.js +1 -1
  52. package/dist/esm/components/organisms/FieldClock/FieldClock.js.map +1 -1
  53. package/dist/esm/components/organisms/FieldDate/FieldDate.js +1 -1
  54. package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +3 -23
  55. package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
  56. package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js +13 -13
  57. package/dist/esm/components/organisms/FieldSelect/FieldSelectController.js.map +1 -1
  58. package/dist/esm/components/organisms/ImageChooser/ImageChooser.js +1 -1
  59. package/dist/esm/components/organisms/ImageChooser/ImageChooser.js.map +1 -1
  60. package/dist/esm/components/organisms/ImageEditor/ImageEditor.js +1 -1
  61. package/dist/esm/components/organisms/ImageEditor/ImageEditor.js.map +1 -1
  62. package/dist/esm/components/organisms/Modal/Modal.css +3 -3
  63. package/dist/esm/components/organisms/Modal/Modal.css.map +1 -1
  64. package/dist/esm/components/organisms/ModalSheet/ModalSheet.css +6 -3
  65. package/dist/esm/components/organisms/ModalSheet/ModalSheet.css.map +1 -1
  66. package/dist/esm/components/organisms/ModalSheet/ModalSheet.js +1 -1
  67. package/dist/esm/components/organisms/ModalSheet/ModalSheet.js.map +1 -1
  68. package/dist/esm/components/organisms/PickerDate/PickerDate.js +1 -1
  69. package/dist/esm/components/organisms/PickerDate/PickerDate.js.map +1 -1
  70. package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +2 -2
  71. package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js.map +1 -1
  72. package/dist/esm/controllers/FormSingleSelectionController.js +2 -2
  73. package/dist/esm/controllers/FormSingleSelectionController.js.map +1 -1
  74. package/dist/esm/controllers/ListController.d.ts +1 -1
  75. package/dist/esm/controllers/ListController.js +9 -9
  76. package/dist/esm/controllers/ListController.js.map +1 -1
  77. package/dist/esm/controllers/RelocationOnComponentController.js +1 -1
  78. package/dist/esm/controllers/RelocationOnComponentController.js.map +1 -1
  79. package/dist/esm/definitions.d.ts +1 -1
  80. package/dist/esm/index.d.ts +2 -0
  81. package/dist/esm/index.js +2 -0
  82. package/dist/esm/index.js.map +1 -1
  83. package/package.json +5 -5
@@ -527,8 +527,8 @@ function useFormSingleSelectionController({ disabled, formControl, onValue, valu
527
527
  }, [formControl?.value]);
528
528
  const onSelect = require$$0.useCallback(() => {
529
529
  if (!disabled) {
530
- formControl && formControl.setValue(value);
531
- onValue && onValue(value);
530
+ formControl?.setValue(value);
531
+ onValue?.(value);
532
532
  }
533
533
  }, [formControl, value, onValue, disabled]);
534
534
  return { checked, onSelect };
@@ -546,7 +546,7 @@ function RlsButtonOption({ icon, children, disabled, formControl, identifier, on
546
546
  }, [checked]);
547
547
  const onAction = require$$0.useCallback(() => {
548
548
  onSelect();
549
- onClick && onClick();
549
+ onClick?.();
550
550
  }, [onSelect, onClick]);
551
551
  return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onAction, disabled: disabled, children: [jsxRuntimeExports.jsx(RlsIcon, { value: icon }), children] }));
552
552
  }
@@ -676,11 +676,11 @@ function RlsInputPassword({ disabled, formControl, identifier, onEnter, onKeyDow
676
676
  onValue?.(event.target.value);
677
677
  }, [formControl, onValue]);
678
678
  const _onKeyDown = require$$0.useCallback((event) => {
679
- onKeyDown && onKeyDown(event);
680
- event.key === 'Enter' && onEnter && onEnter();
679
+ onKeyDown?.(event);
680
+ event.key === 'Enter' && onEnter?.();
681
681
  }, [onKeyDown, onEnter]);
682
682
  const _onKeyUp = require$$0.useCallback((event) => {
683
- onKeyUp && onKeyUp(event);
683
+ onKeyUp?.(event);
684
684
  }, [onKeyUp]);
685
685
  const _onFocus = require$$0.useCallback(() => {
686
686
  formControl?.focus();
@@ -979,6 +979,97 @@ function RlsFieldDecimal(props) {
979
979
  return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputDecimal, { ...props }) }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
980
980
  }
981
981
 
982
+ function RlsFieldFile({ accept, children, disabled: disabledProp, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value }) {
983
+ const inputRef = require$$0.useRef(null);
984
+ const disabled = require$$0.useMemo(() => formControl?.disabled || disabledProp, [formControl?.disabled, disabledProp]);
985
+ const className = require$$0.useMemo(() => renderClassStatus('rls-field-box', {
986
+ disabled,
987
+ error: formControl?.wrong,
988
+ focused: formControl?.focused && !disabled,
989
+ readonly: readOnly
990
+ }, 'rls-field-file'), [formControl?.focused, formControl?.wrong, readOnly, disabled]);
991
+ const currentFile = require$$0.useMemo(() => formControl?.value ?? value, [formControl?.value, value]);
992
+ const displayValue = require$$0.useMemo(() => {
993
+ return currentFile?.name ?? '';
994
+ }, [currentFile]);
995
+ const onClickAction = require$$0.useCallback((event) => {
996
+ if (currentFile) {
997
+ formControl?.setValue(undefined);
998
+ onValue?.(undefined);
999
+ }
1000
+ else {
1001
+ inputRef.current?.click();
1002
+ }
1003
+ event.stopPropagation();
1004
+ }, [currentFile, formControl, onValue]);
1005
+ const onChangeInput = require$$0.useCallback((event) => {
1006
+ const file = event.target.files?.[0];
1007
+ if (file) {
1008
+ formControl?.setValue(file);
1009
+ onValue?.(file);
1010
+ }
1011
+ event.target.value = '';
1012
+ }, [formControl, onValue]);
1013
+ const onClickControl = require$$0.useCallback(() => {
1014
+ !readOnly && !disabled && inputRef.current?.click();
1015
+ }, [readOnly, disabled]);
1016
+ return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", onClick: onClickControl, children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-input__component", readOnly: true, type: "text", value: displayValue, placeholder: placeholder }), jsxRuntimeExports.jsx("input", { ref: inputRef, className: "rls-field-file__input", type: "file", accept: accept, disabled: disabled || readOnly, onChange: onChangeInput }), jsxRuntimeExports.jsx(RlsButtonAction, { icon: currentFile ? 'close' : 'attach-2', disabled: disabled, onClick: onClickAction })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
1017
+ }
1018
+
1019
+ const reactI18n = i18n.i18n({
1020
+ es: {
1021
+ confirmationActionApproved: 'Aceptar',
1022
+ dateActionCancel: 'Cancelar',
1023
+ dateActionSelect: 'Establecer',
1024
+ dateActionToday: 'Hoy',
1025
+ chooserImageActionCancel: 'Cancelar',
1026
+ editorImageActionRestore: 'Restaurar',
1027
+ editorImageActionSelect: 'Seleccionar',
1028
+ listEmptyDescription: 'Lo sentimos, en el momento no hay elementos en el listado',
1029
+ listEmptyTitle: 'Selección no disponible',
1030
+ listInputPlaceholder: 'Escriba palabre clave para filtrar...'
1031
+ },
1032
+ en: {
1033
+ confirmationActionApproved: 'Approved',
1034
+ dateActionCancel: 'Cancel',
1035
+ dateActionSelect: 'Select',
1036
+ dateActionToday: 'Today',
1037
+ chooserImageActionCancel: 'Cancel',
1038
+ editorImageActionRestore: 'Restore',
1039
+ editorImageActionSelect: 'Select',
1040
+ listEmptyDescription: 'Sorry, there are currently no items in the list',
1041
+ listEmptyTitle: 'Selection not available',
1042
+ listInputPlaceholder: 'Enter keyword to filter...'
1043
+ }
1044
+ });
1045
+
1046
+ function RlsFieldListSuggestions({ elements, disabled, higher, render, renderEmpty, searchControl, visible, onClickBackdrop, onClickElement, onKeydownElement, refList, rlsTheme }) {
1047
+ const [labels, setLabels] = require$$0.useState({
1048
+ listEmptyDescription: reactI18n('listEmptyDescription'),
1049
+ listEmptyTitle: reactI18n('listEmptyTitle')
1050
+ });
1051
+ require$$0.useEffect(() => {
1052
+ return i18n.i18nSubscribe(() => {
1053
+ setLabels({
1054
+ listEmptyDescription: reactI18n('listEmptyDescription'),
1055
+ listEmptyTitle: reactI18n('listEmptyTitle')
1056
+ });
1057
+ });
1058
+ }, []);
1059
+ const className = require$$0.useMemo(() => {
1060
+ return renderClassStatus('rls-field-list__suggestions', {
1061
+ disabled,
1062
+ higher,
1063
+ visible
1064
+ });
1065
+ }, [disabled, higher, visible]);
1066
+ const onChangePattern = require$$0.useCallback((event) => {
1067
+ searchControl?.onChange(event.target.value);
1068
+ }, [searchControl?.onChange]);
1069
+ const searching = searchControl?.searching ?? false;
1070
+ return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: refList, className: "rls-field-list__ul", children: [searchControl && (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__ul__search", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__ul__control", ref: searchControl.refInput, type: "text", placeholder: searchControl.placeholder, value: searchControl.pattern, onChange: onChangePattern, onFocus: searchControl.onFocus, onBlur: searchControl.onBlur, onKeyDown: searchControl.onKeyDown, disabled: disabled || searching }), searchControl.onSearch && (jsxRuntimeExports.jsx("button", { disabled: disabled || searching, onClick: searchControl.onSearch, children: jsxRuntimeExports.jsx(RlsIcon, { value: "search" }) }))] })), searching && jsxRuntimeExports.jsx(RlsProgressBar, { indeterminate: true }), elements.map((element, index) => (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: onClickElement(element), onKeyDown: onKeydownElement(element), children: render(element) }, index))), !elements.length && (jsxRuntimeExports.jsx("li", { className: "rls-field-list__empty", children: renderEmpty ? (renderEmpty()) : (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__empty__description", children: [jsxRuntimeExports.jsx("label", { className: "rls-label-bold rls-truncate", children: labels.listEmptyTitle }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: labels.listEmptyDescription })] })) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: onClickBackdrop })] }));
1071
+ }
1072
+
982
1073
  function RlsFieldMoney(props) {
983
1074
  const { children, formControl, identifier, rlsTheme } = props;
984
1075
  const disabled = require$$0.useMemo(() => {
@@ -1133,18 +1224,25 @@ function RlsNavbar({ children, identifier, rlsTheme }) {
1133
1224
  return (jsxRuntimeExports.jsxs("nav", { id: identifier, className: "rls-app__page__nav", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-app__page__nav__content", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-app__page__nav__backdrop" })] }));
1134
1225
  }
1135
1226
 
1227
+ function PageButton({ page, onSelect }) {
1228
+ const className = require$$0.useMemo(() => renderClassStatus('rls-pagination__page', { active: page.active }), [page.active]);
1229
+ const onClick = require$$0.useCallback(() => {
1230
+ onSelect(page);
1231
+ }, [page, onSelect]);
1232
+ return (jsxRuntimeExports.jsx("button", { type: "button", className: className, onClick: onClick, children: page.label }));
1233
+ }
1136
1234
  function RlsPagination({ suggestions, count, filter, onPagination }) {
1137
1235
  const [template, setTemplate] = require$$0.useState();
1138
1236
  const controller = require$$0.useRef(undefined);
1139
1237
  const refreshTemplate = require$$0.useCallback((template, suggestions) => {
1140
1238
  const { firstPage, lastPage } = template;
1141
- onPagination && onPagination({ firstPage, lastPage, suggestions });
1239
+ onPagination?.({ firstPage, lastPage, suggestions });
1142
1240
  setTemplate(template);
1143
1241
  }, [onPagination]);
1144
1242
  const refreshPagination = require$$0.useCallback((pagination) => {
1145
1243
  pagination &&
1146
1244
  refreshTemplate(pagination.template, pagination.page.collection);
1147
- }, []);
1245
+ }, [refreshTemplate]);
1148
1246
  require$$0.useEffect(() => {
1149
1247
  const pagination = new components.PaginationController({
1150
1248
  suggestions,
@@ -1153,32 +1251,26 @@ function RlsPagination({ suggestions, count, filter, onPagination }) {
1153
1251
  });
1154
1252
  controller.current = pagination;
1155
1253
  refreshTemplate(pagination.template, pagination.page.collection);
1156
- }, [suggestions, count]);
1254
+ }, [suggestions, count, refreshTemplate]);
1157
1255
  require$$0.useEffect(() => {
1158
1256
  refreshPagination(controller.current?.filtrable(filter));
1159
- }, [filter]);
1257
+ }, [filter, refreshPagination]);
1160
1258
  const goToPagination = require$$0.useCallback((page) => {
1161
1259
  refreshPagination(controller.current?.goToPage(page));
1162
- }, []);
1260
+ }, [refreshPagination]);
1163
1261
  const goFirstPagination = require$$0.useCallback(() => {
1164
1262
  refreshPagination(controller.current?.goFirstPage());
1165
- }, []);
1263
+ }, [refreshPagination]);
1166
1264
  const goPreviousPagination = require$$0.useCallback(() => {
1167
1265
  refreshPagination(controller.current?.goPreviousPage());
1168
- }, []);
1266
+ }, [refreshPagination]);
1169
1267
  const goNextPagination = require$$0.useCallback(() => {
1170
1268
  refreshPagination(controller.current?.goNextPage());
1171
- }, []);
1269
+ }, [refreshPagination]);
1172
1270
  const goLastPagination = require$$0.useCallback(() => {
1173
1271
  refreshPagination(controller.current?.goLastPage());
1174
- }, []);
1175
- return (jsxRuntimeExports.jsxs("div", { className: "rls-pagination", children: [jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-left" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__body", children: [jsxRuntimeExports.jsx("div", { className: "rls-pagination__pages", children: template?.pages.map((page, index) => {
1176
- return (jsxRuntimeExports.jsx("div", { className: renderClassStatus('rls-pagination__page', {
1177
- active: page.active
1178
- }), onClick: () => {
1179
- goToPagination(page);
1180
- }, children: page.label }, index));
1181
- }) }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__description", children: template?.description }), jsxRuntimeExports.jsx("span", { className: "rls-pagination__count", children: suggestions.length })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
1272
+ }, [refreshPagination]);
1273
+ return (jsxRuntimeExports.jsxs("div", { className: "rls-pagination", children: [jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-left" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__body", children: [jsxRuntimeExports.jsx("div", { className: "rls-pagination__pages", children: template?.pages.map((page) => (jsxRuntimeExports.jsx(PageButton, { page: page, onSelect: goToPagination }, page.value))) }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__description", children: template?.description }), jsxRuntimeExports.jsx("span", { className: "rls-pagination__count", children: suggestions.length })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
1182
1274
  }
1183
1275
 
1184
1276
  function RlsPickerDayHeaders() {
@@ -1199,10 +1291,10 @@ function RlsPickerDayElement({ day, onSelect, disabled }) {
1199
1291
  }, [day.value, day.disabled, disabled, onSelect]);
1200
1292
  return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day__element__span", children: day.value || '??' }) }));
1201
1293
  }
1202
- function RlsPickerDay({ date: _date, disabled, formControl, maxDate, month, minDate, onValue, rlsTheme, year }) {
1203
- const date = require$$0.useMemo(() => _date ?? new Date(), [_date]);
1294
+ function RlsPickerDay({ date, disabled, formControl, maxDate, month, minDate, onValue, rlsTheme, year }) {
1295
+ const dateDay = require$$0.useMemo(() => date ?? new Date(), [date]);
1204
1296
  const [weeks, setWeeks] = require$$0.useState([]);
1205
- const [value, setValue] = require$$0.useState(formControl?.value || date.getDate());
1297
+ const [value, setValue] = require$$0.useState(formControl?.value ?? dateDay.getDate());
1206
1298
  const [headers, setHeaders] = require$$0.useState(jsxRuntimeExports.jsx(RlsPickerDayHeaders, {}));
1207
1299
  const [component, setComponent] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
1208
1300
  const setDayValue = require$$0.useCallback((value) => {
@@ -1224,28 +1316,28 @@ function RlsPickerDay({ date: _date, disabled, formControl, maxDate, month, minD
1224
1316
  const options = createPickerOptions();
1225
1317
  const day = components.verifyDayPicker(options);
1226
1318
  day ? setDayValue(day) : setWeeks(components.createDayPicker(options));
1227
- }, [date, month, year, value, minDate, maxDate]);
1319
+ }, [dateDay, month, year, value, minDate, maxDate]);
1228
1320
  require$$0.useEffect(() => {
1229
1321
  const day = components.verifyDayPicker(createPickerOptions());
1230
1322
  day
1231
1323
  ? formControl?.setValue(day)
1232
- : setValue(formControl?.value || date.getDate());
1324
+ : setValue(formControl?.value || dateDay.getDate());
1233
1325
  }, [formControl?.value]);
1234
1326
  const createPickerOptions = require$$0.useCallback(() => {
1235
1327
  return {
1236
- date,
1328
+ date: dateDay,
1237
1329
  day: formControl?.value ?? value,
1238
- month: month ?? date.getMonth(),
1239
- year: year ?? date.getFullYear(),
1330
+ month: month ?? dateDay.getMonth(),
1331
+ year: year ?? dateDay.getFullYear(),
1240
1332
  minDate,
1241
1333
  maxDate
1242
1334
  };
1243
- }, [date, formControl?.value, value, month, year, minDate, maxDate]);
1335
+ }, [dateDay, formControl?.value, value, month, year, minDate, maxDate]);
1244
1336
  return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day", "rls-theme": rlsTheme, children: [headers, component] }));
1245
1337
  }
1246
1338
 
1247
1339
  function RlsPickerDayRangeHeaders() {
1248
- return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: dates.DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("label", { className: "rls-picker-day__label", children: title }, index))) }));
1340
+ return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: dates.DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("span", { className: "rls-picker-day__label", children: title }, index))) }));
1249
1341
  }
1250
1342
  function RlsPickerDayRangeElement({ day, onSelect, disabled }) {
1251
1343
  const className = require$$0.useMemo(() => {
@@ -1262,27 +1354,27 @@ function RlsPickerDayRangeElement({ day, onSelect, disabled }) {
1262
1354
  }, [day.value, day.disabled, disabled, onSelect]);
1263
1355
  return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day-range__element__span", children: day.value || '??' }) }));
1264
1356
  }
1265
- function RlsPickerDayRange({ date: _date, disabled, formControl, maxDate, minDate, rlsTheme }) {
1266
- const _range = require$$0.useMemo(() => {
1357
+ function RlsPickerDayRange({ date, disabled, formControl, maxDate, minDate, rlsTheme }) {
1358
+ const rangeDay = require$$0.useMemo(() => {
1267
1359
  return formControl?.value ?? dates.DateRange.now();
1268
1360
  }, [formControl?.value]);
1269
- const date = require$$0.useMemo(() => {
1270
- return dates.normalizeMinTime(_date ?? _range.minDate);
1271
- }, [_date]);
1272
- const sourceDate = require$$0.useRef(_range.minDate);
1361
+ const dateDayRange = require$$0.useMemo(() => {
1362
+ return dates.normalizeMinTime(date ?? rangeDay.minDate);
1363
+ }, [date, rangeDay]);
1364
+ const sourceDate = require$$0.useRef(rangeDay.minDate);
1273
1365
  const [weeks, setWeeks] = require$$0.useState([]);
1274
- const [range, setRange] = require$$0.useState(_range);
1366
+ const [range, setRange] = require$$0.useState(rangeDay);
1275
1367
  const [headers, setHeaders] = require$$0.useState(jsxRuntimeExports.jsx(RlsPickerDayRangeHeaders, {}));
1276
1368
  const [component, setComponent] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
1277
1369
  const onSelect = require$$0.useCallback((value) => {
1278
- const _date = dates.assignDayInDate(date, value);
1279
- const range = dates.dateIsBefore(_date, sourceDate.current)
1280
- ? new dates.DateRange(sourceDate.current, _date)
1281
- : new dates.DateRange(_date, sourceDate.current);
1282
- sourceDate.current = _date;
1370
+ const date = dates.assignDayInDate(dateDayRange, value);
1371
+ const range = dates.dateIsBefore(date, sourceDate.current)
1372
+ ? new dates.DateRange(sourceDate.current, date)
1373
+ : new dates.DateRange(date, sourceDate.current);
1374
+ sourceDate.current = date;
1283
1375
  setRange(range);
1284
1376
  formControl?.setValue(range);
1285
- }, [date, sourceDate.current, formControl]);
1377
+ }, [dateDayRange, formControl]);
1286
1378
  require$$0.useEffect(() => {
1287
1379
  return i18n.i18nSubscribe(() => {
1288
1380
  setHeaders(jsxRuntimeExports.jsx(RlsPickerDayRangeHeaders, {}));
@@ -1293,13 +1385,13 @@ function RlsPickerDayRange({ date: _date, disabled, formControl, maxDate, minDat
1293
1385
  }, [weeks, onSelect, disabled]);
1294
1386
  require$$0.useEffect(() => {
1295
1387
  setWeeks(components.createDayRangePicker({
1296
- date,
1388
+ date: dateDayRange,
1297
1389
  range,
1298
1390
  sourceDate: sourceDate.current,
1299
1391
  minDate,
1300
1392
  maxDate
1301
1393
  }));
1302
- }, [date, range, minDate, maxDate]);
1394
+ }, [dateDayRange, range, minDate, maxDate]);
1303
1395
  return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day-range", "rls-theme": rlsTheme, children: [headers, component] }));
1304
1396
  }
1305
1397
 
@@ -1325,10 +1417,10 @@ function RlsPickerMonthElement({ month, onSelect, disabled }) {
1325
1417
  }, [month.value, month.disabled, disabled, onSelect]);
1326
1418
  return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-month__span", children: label }) }));
1327
1419
  }
1328
- function RlsPickerMonth({ date: _date, disabled, formControl, maxDate, minDate, onValue, rlsTheme, year }) {
1329
- const date = require$$0.useMemo(() => _date || new Date(), [_date]);
1420
+ function RlsPickerMonth({ date, disabled, formControl, maxDate, minDate, onValue, rlsTheme, year }) {
1421
+ const dateMonth = require$$0.useMemo(() => date ?? new Date(), [date]);
1330
1422
  const [months, setMonths] = require$$0.useState([]);
1331
- const [value, setValue] = require$$0.useState(formControl?.value ?? date.getMonth());
1423
+ const [value, setValue] = require$$0.useState(formControl?.value ?? dateMonth.getMonth());
1332
1424
  const [component, setComponent] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
1333
1425
  const setMonthValue = require$$0.useCallback((value) => {
1334
1426
  formControl ? formControl.setValue(value) : setValue(value);
@@ -1342,9 +1434,9 @@ function RlsPickerMonth({ date: _date, disabled, formControl, maxDate, minDate,
1342
1434
  }, [months, onSelect, disabled]);
1343
1435
  require$$0.useEffect(() => {
1344
1436
  const options = {
1345
- date,
1437
+ date: dateMonth,
1346
1438
  month: formControl?.value ?? value,
1347
- year: year ?? date.getFullYear(),
1439
+ year: year ?? dateMonth.getFullYear(),
1348
1440
  minDate,
1349
1441
  maxDate
1350
1442
  };
@@ -1352,18 +1444,18 @@ function RlsPickerMonth({ date: _date, disabled, formControl, maxDate, minDate,
1352
1444
  commons.valueIsDefined(month)
1353
1445
  ? setMonthValue(month)
1354
1446
  : setMonths(components.createMonthPicker(options));
1355
- }, [date, year, value, minDate, maxDate]);
1447
+ }, [dateMonth, year, value, minDate, maxDate]);
1356
1448
  require$$0.useEffect(() => {
1357
1449
  const month = components.verifyMonthPicker({
1358
- date,
1450
+ date: dateMonth,
1359
1451
  month: formControl?.value ?? value,
1360
- year: year ?? date.getFullYear(),
1452
+ year: year ?? dateMonth.getFullYear(),
1361
1453
  minDate,
1362
1454
  maxDate
1363
1455
  });
1364
1456
  commons.valueIsDefined(month)
1365
1457
  ? formControl?.setValue(month)
1366
- : setValue(formControl?.value ?? date.getMonth());
1458
+ : setValue(formControl?.value ?? dateMonth.getMonth());
1367
1459
  }, [formControl?.value]);
1368
1460
  return (jsxRuntimeExports.jsx("div", { className: "rls-picker-month", "rls-theme": rlsTheme, children: component }));
1369
1461
  }
@@ -1399,10 +1491,10 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
1399
1491
  }
1400
1492
  }, [monthControl.value, yearControl.value]);
1401
1493
  const onMonth = require$$0.useCallback(() => {
1402
- onClick && onClick('month');
1494
+ onClick?.('month');
1403
1495
  }, [onClick]);
1404
1496
  const onYear = require$$0.useCallback(() => {
1405
- onClick && onClick('year');
1497
+ onClick?.('year');
1406
1498
  }, [onClick]);
1407
1499
  const onPreviousYear = require$$0.useCallback(() => {
1408
1500
  commons.valueIsDefined(yearControl.value) &&
@@ -1446,19 +1538,19 @@ function RlsPickerYearElement({ onSelect, year, disabled }) {
1446
1538
  }, [year.value, year.disabled, disabled, onSelect]);
1447
1539
  return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-year__span", children: year.value || '????' }) }));
1448
1540
  }
1449
- function RlsPickerYear({ date: _date, disabled, formControl, maxDate, minDate, onValue, rlsTheme }) {
1450
- const date = require$$0.useMemo(() => _date || new Date(), [_date]);
1451
- const [value, setValue] = require$$0.useState(formControl?.value ?? date.getFullYear());
1452
- const [year, setYear] = require$$0.useState(formControl?.value ?? date.getFullYear());
1541
+ function RlsPickerYear({ date, disabled, formControl, maxDate, minDate, onValue, rlsTheme }) {
1542
+ const dateYear = require$$0.useMemo(() => date ?? new Date(), [date]);
1543
+ const [value, setValue] = require$$0.useState(formControl?.value ?? dateYear.getFullYear());
1544
+ const [year, setYear] = require$$0.useState(formControl?.value ?? dateYear.getFullYear());
1453
1545
  const [component, setComponent] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
1454
1546
  const createPickerOptions = require$$0.useCallback(() => {
1455
1547
  return {
1456
- date,
1548
+ date: dateYear,
1457
1549
  year,
1458
1550
  minDate,
1459
1551
  maxDate
1460
1552
  };
1461
- }, [date, year, minDate, maxDate]);
1553
+ }, [dateYear, year, minDate, maxDate]);
1462
1554
  const [template, setTemplate] = require$$0.useState(components.createYearPicker(createPickerOptions()));
1463
1555
  const setYearValue = require$$0.useCallback((value) => {
1464
1556
  formControl ? formControl.setValue(value) : setValue(value);
@@ -1472,7 +1564,7 @@ function RlsPickerYear({ date: _date, disabled, formControl, maxDate, minDate, o
1472
1564
  const options = createPickerOptions(); // YearPickerProps
1473
1565
  const year = components.verifyYearPicker(options);
1474
1566
  year ? setYearValue(year) : setTemplate(components.createYearPicker(options));
1475
- }, [date, year, value, minDate, maxDate]);
1567
+ }, [dateYear, year, value, minDate, maxDate]);
1476
1568
  require$$0.useEffect(() => {
1477
1569
  setComponent(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: template.years.map((year, index) => (jsxRuntimeExports.jsx(RlsPickerYearElement, { year: year, onSelect: onSelect, disabled: disabled }, index))) }));
1478
1570
  }, [template.years, onSelect, disabled]);
@@ -1480,7 +1572,7 @@ function RlsPickerYear({ date: _date, disabled, formControl, maxDate, minDate, o
1480
1572
  const year = components.verifyYearPicker(createPickerOptions());
1481
1573
  commons.valueIsDefined(year)
1482
1574
  ? formControl?.setValue(year)
1483
- : setValue(formControl?.value ?? date.getFullYear());
1575
+ : setValue(formControl?.value ?? dateYear.getFullYear());
1484
1576
  }, [formControl?.value]);
1485
1577
  const onClickPrev = require$$0.useCallback(() => {
1486
1578
  setYear((year) => year - 8);
@@ -1499,51 +1591,51 @@ function calculateInitialRate(value, minValue, maxValue) {
1499
1591
  const rateValue = value - minValue;
1500
1592
  return Math.ceil((rateValue / rateMax) * 100);
1501
1593
  }
1502
- function RlsSlider(props) {
1503
- const minValue = require$$0.useMemo(() => {
1504
- return props.minValue ?? 0;
1505
- }, [props.minValue]);
1506
- const maxValue = require$$0.useMemo(() => {
1507
- return props.maxValue ?? 100;
1508
- }, [props.maxValue]);
1509
- const [value, setValue] = require$$0.useState(calculateInitialValue(props.formControl?.value ?? props.value ?? 0, minValue, maxValue));
1510
- const [rate, setRate] = require$$0.useState(calculateInitialRate(value, minValue, maxValue));
1594
+ function RlsSlider({ children, className, disabled, formControl, identifier, maxValue, minValue, onValue, prefixIcon, rlsTheme, value }) {
1595
+ const minValueSlider = require$$0.useMemo(() => {
1596
+ return minValue ?? 0;
1597
+ }, [minValue]);
1598
+ const maxValueSlider = require$$0.useMemo(() => {
1599
+ return maxValue ?? 100;
1600
+ }, [maxValue]);
1601
+ const [valueSlider, setValue] = require$$0.useState(calculateInitialValue(formControl?.value ?? value ?? 0, minValueSlider, maxValueSlider));
1602
+ const [rate, setRate] = require$$0.useState(calculateInitialRate(valueSlider, minValueSlider, maxValueSlider));
1511
1603
  const refComponent = require$$0.useRef(null);
1512
1604
  const refTrack = require$$0.useRef(null);
1513
1605
  const refTrackOn = require$$0.useRef(null);
1514
1606
  const refThumb = require$$0.useRef(null);
1515
- const className = require$$0.useMemo(() => {
1607
+ const classNameSlider = require$$0.useMemo(() => {
1516
1608
  return renderClassStatus('rls-slider', {
1517
- complet: value === maxValue,
1518
- disabled: props.disabled,
1519
- empty: value === minValue
1520
- });
1521
- }, [value, minValue, maxValue, props.disabled]);
1609
+ complet: valueSlider === maxValueSlider,
1610
+ disabled: disabled,
1611
+ empty: valueSlider === minValueSlider
1612
+ }, className);
1613
+ }, [valueSlider, minValueSlider, maxValueSlider, disabled]);
1522
1614
  require$$0.useEffect(() => {
1523
- const valueInitial = props.formControl?.value ?? props.value ?? 0;
1615
+ const valueInitial = formControl?.value ?? value ?? 0;
1524
1616
  refThumb.current.style.left = `${rate}%`;
1525
1617
  refTrackOn.current.style.width = `${rate}%`;
1526
- if (valueInitial !== value) {
1527
- props.formControl?.setValue(value);
1528
- props.onValue && props.onValue(value);
1618
+ if (valueInitial !== valueSlider) {
1619
+ formControl?.setValue(valueSlider);
1620
+ onValue?.(valueSlider);
1529
1621
  }
1530
1622
  }, []);
1531
1623
  const calculateValueWithRate = require$$0.useCallback((rate) => {
1532
- const value = Math.ceil(((maxValue - minValue) * rate) / 100);
1624
+ const value = Math.ceil(((maxValueSlider - minValueSlider) * rate) / 100);
1533
1625
  refThumb.current.style.left = `${rate}%`;
1534
1626
  refTrackOn.current.style.width = `${rate}%`;
1535
- const sliderValue = value + minValue;
1627
+ const sliderValue = value + minValueSlider;
1536
1628
  setRate(rate);
1537
1629
  setValue(sliderValue);
1538
- props.formControl?.setValue(sliderValue);
1539
- props.onValue && props.onValue(sliderValue);
1540
- }, [minValue, maxValue, props.formControl, props.onValue]);
1630
+ formControl?.setValue(sliderValue);
1631
+ onValue?.(sliderValue);
1632
+ }, [minValueSlider, maxValueSlider, formControl, onValue]);
1541
1633
  const onClickTrack = require$$0.useCallback((event) => {
1542
1634
  const { left, width } = refTrack.current.getBoundingClientRect();
1543
1635
  const rate = Math.ceil(((event.clientX - left) / width) * 100);
1544
1636
  calculateValueWithRate(rate);
1545
- }, [minValue, maxValue]);
1546
- return (jsxRuntimeExports.jsxs("div", { className: className, children: [props.children && (jsxRuntimeExports.jsx("span", { className: "rls-slider__label", children: props.children })), jsxRuntimeExports.jsxs("div", { className: "rls-slider__body", children: [props.prefixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: props.prefixIcon }), jsxRuntimeExports.jsxs("div", { ref: refComponent, className: "rls-slider__component", children: [jsxRuntimeExports.jsx("div", { ref: refTrack, className: "rls-slider__track", onClick: onClickTrack, children: jsxRuntimeExports.jsx("div", { ref: refTrackOn, className: "rls-slider__track__on" }) }), jsxRuntimeExports.jsxs("div", { ref: refThumb, className: "rls-slider__thumb", children: [rate, "%"] })] })] })] }));
1637
+ }, [minValueSlider, maxValueSlider]);
1638
+ return (jsxRuntimeExports.jsxs("div", { id: identifier, className: classNameSlider, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-slider__label", children: children }), jsxRuntimeExports.jsxs("div", { className: "rls-slider__body", children: [prefixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: prefixIcon }), jsxRuntimeExports.jsxs("div", { ref: refComponent, className: "rls-slider__component", children: [jsxRuntimeExports.jsx("div", { ref: refTrack, className: "rls-slider__track", onClick: onClickTrack, children: jsxRuntimeExports.jsx("div", { ref: refTrackOn, className: "rls-slider__track__on" }) }), jsxRuntimeExports.jsxs("div", { ref: refThumb, className: "rls-slider__thumb", children: [rate, "%"] })] })] })] }));
1547
1639
  }
1548
1640
 
1549
1641
  function RlsTab({ onSelect, tab, value }) {
@@ -1595,33 +1687,6 @@ function RlsCard({ children, className, outline, rlsTheme }) {
1595
1687
  return (jsxRuntimeExports.jsx("div", { className: classNameCard, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-card__content", children: children }) }));
1596
1688
  }
1597
1689
 
1598
- const reactI18n = i18n.i18n({
1599
- es: {
1600
- confirmationActionApproved: 'Aceptar',
1601
- dateActionCancel: 'Cancelar',
1602
- dateActionSelect: 'Establecer',
1603
- dateActionToday: 'Hoy',
1604
- chooserImageActionCancel: 'Cancelar',
1605
- editorImageActionRestore: 'Restaurar',
1606
- editorImageActionSelect: 'Seleccionar',
1607
- listEmptyDescription: 'Lo sentimos, en el momento no hay elementos en el listado',
1608
- listEmptyTitle: 'Selección no disponible',
1609
- listInputPlaceholder: 'Escriba palabre clave para filtrar...'
1610
- },
1611
- en: {
1612
- confirmationActionApproved: 'Approved',
1613
- dateActionCancel: 'Cancel',
1614
- dateActionSelect: 'Select',
1615
- dateActionToday: 'Today',
1616
- chooserImageActionCancel: 'Cancel',
1617
- editorImageActionRestore: 'Restore',
1618
- editorImageActionSelect: 'Select',
1619
- listEmptyDescription: 'Sorry, there are currently no items in the list',
1620
- listEmptyTitle: 'Selection not available',
1621
- listInputPlaceholder: 'Enter keyword to filter...'
1622
- }
1623
- });
1624
-
1625
1690
  class ConfirmationResult extends commons.SealedPartial {
1626
1691
  static approved() {
1627
1692
  return new ConfirmationResult('approved');
@@ -1789,7 +1854,7 @@ function useListController(props) {
1789
1854
  const [state, refreshState] = require$$0.useState({
1790
1855
  focused: false,
1791
1856
  higher: false,
1792
- modalIsVisible: false,
1857
+ listIsVisible: false,
1793
1858
  value: ''
1794
1859
  });
1795
1860
  const changeValueInternal = require$$0.useRef(false);
@@ -1798,7 +1863,7 @@ function useListController(props) {
1798
1863
  require$$0.useEffect(() => {
1799
1864
  function onCloseSuggestions({ target }) {
1800
1865
  !refContent?.current?.contains(target) &&
1801
- refreshState((state) => ({ ...state, modalIsVisible: false }));
1866
+ refreshState((state) => ({ ...state, listIsVisible: false }));
1802
1867
  }
1803
1868
  document.addEventListener('click', onCloseSuggestions);
1804
1869
  return () => {
@@ -1806,13 +1871,13 @@ function useListController(props) {
1806
1871
  };
1807
1872
  }, []);
1808
1873
  require$$0.useEffect(() => {
1809
- if (!listIsOpen.current && state.modalIsVisible) {
1874
+ if (!listIsOpen.current && state.listIsVisible) {
1810
1875
  listIsOpen.current = true;
1811
1876
  }
1812
- if (listIsOpen.current && !state.modalIsVisible) {
1877
+ if (listIsOpen.current && !state.listIsVisible) {
1813
1878
  formControl?.touch();
1814
1879
  }
1815
- }, [state.modalIsVisible]);
1880
+ }, [state.listIsVisible]);
1816
1881
  require$$0.useEffect(() => {
1817
1882
  setCollection(new components.ListCollection(suggestions, reference));
1818
1883
  }, [suggestions]);
@@ -1844,7 +1909,7 @@ function useListController(props) {
1844
1909
  }, [collection, formControl?.value]);
1845
1910
  const setState = require$$0.useCallback((state) => {
1846
1911
  const minHeightList = calculateMinHeightList(count, lineHeight ?? 48);
1847
- const _state = state.modalIsVisible
1912
+ const _state = state.listIsVisible
1848
1913
  ? {
1849
1914
  ...state,
1850
1915
  higher: components.locationListCanTop(refContent.current, refList.current, minHeightList)
@@ -1863,7 +1928,7 @@ function useListController(props) {
1863
1928
  : formControl?.setValue(element?.value);
1864
1929
  }, [formControl]);
1865
1930
  const navigationInput = require$$0.useCallback((event) => {
1866
- if (state.modalIsVisible) {
1931
+ if (state.listIsVisible) {
1867
1932
  const _position = components.navigationListFromInput({
1868
1933
  content: refContent.current,
1869
1934
  event: event,
@@ -1871,7 +1936,7 @@ function useListController(props) {
1871
1936
  });
1872
1937
  position.current = _position ?? 0;
1873
1938
  }
1874
- }, [state.modalIsVisible]);
1939
+ }, [state.listIsVisible]);
1875
1940
  const navigationElement = require$$0.useCallback((event) => {
1876
1941
  position.current = components.navigationListFromElement({
1877
1942
  content: refContent.current,
@@ -1880,7 +1945,7 @@ function useListController(props) {
1880
1945
  list: refList.current,
1881
1946
  position: position.current
1882
1947
  });
1883
- }, [state.modalIsVisible]);
1948
+ }, [state.listIsVisible]);
1884
1949
  return {
1885
1950
  ...state,
1886
1951
  navigationElement,
@@ -1908,6 +1973,9 @@ function useFieldAutocomplete(props) {
1908
1973
  pattern: '',
1909
1974
  previous: null
1910
1975
  });
1976
+ const focusTimeoutId = require$$0.useRef(undefined);
1977
+ const rebootIsRequired = require$$0.useRef(true);
1978
+ const prevSuggestions = require$$0.useRef(props.suggestions);
1911
1979
  const refreshCoincidences = require$$0.useCallback((suggestions, pattern, reboot = false) => {
1912
1980
  const { collection, store } = components.createAutocompleteStore({
1913
1981
  pattern,
@@ -1921,14 +1989,14 @@ function useFieldAutocomplete(props) {
1921
1989
  count.current = coincidences.length;
1922
1990
  }, []);
1923
1991
  require$$0.useEffect(() => {
1924
- refreshCoincidences(props.suggestions, pattern, true);
1925
- }, [props.suggestions]);
1926
- require$$0.useEffect(() => {
1927
- refreshCoincidences(props.suggestions, pattern);
1928
- }, [pattern]);
1992
+ const reboot = rebootIsRequired.current || prevSuggestions.current !== props.suggestions;
1993
+ rebootIsRequired.current = false;
1994
+ prevSuggestions.current = props.suggestions;
1995
+ refreshCoincidences(props.suggestions, pattern, reboot);
1996
+ }, [props.suggestions, pattern]);
1929
1997
  require$$0.useEffect(() => {
1930
1998
  props.disabled && controller.setState({ focused: false });
1931
- }, [props.disabled]);
1999
+ }, [props.disabled, controller.setState]);
1932
2000
  const onFocusInput = require$$0.useCallback(() => {
1933
2001
  controller.setState({ focused: true });
1934
2002
  }, [controller.setState]);
@@ -1939,7 +2007,7 @@ function useFieldAutocomplete(props) {
1939
2007
  switch (event.code) {
1940
2008
  case 'Escape':
1941
2009
  case 'Tab':
1942
- controller.setState({ modalIsVisible: false });
2010
+ controller.setState({ listIsVisible: false });
1943
2011
  break;
1944
2012
  default:
1945
2013
  controller.navigationInput(event);
@@ -1948,17 +2016,23 @@ function useFieldAutocomplete(props) {
1948
2016
  }, [controller.setState, controller.navigationInput]);
1949
2017
  const onClickControl = require$$0.useCallback(() => {
1950
2018
  if (!props.readOnly) {
1951
- controller.setState({ modalIsVisible: true });
1952
- setTimeout(() => {
2019
+ controller.setState({ listIsVisible: true });
2020
+ clearTimeout(focusTimeoutId.current);
2021
+ focusTimeoutId.current = setTimeout(() => {
1953
2022
  controller.refInput?.current?.focus();
1954
2023
  }, DURATION_ANIMATION$1);
1955
2024
  }
1956
2025
  }, [controller.setState, props.readOnly]);
2026
+ require$$0.useEffect(() => {
2027
+ return () => {
2028
+ clearTimeout(focusTimeoutId.current);
2029
+ };
2030
+ }, []);
1957
2031
  const onClickAction = require$$0.useCallback(() => {
1958
2032
  if (controller.value) {
1959
- controller.setState({ modalIsVisible: false });
2033
+ controller.setState({ listIsVisible: false });
1960
2034
  controller.setFormValue(undefined);
1961
- props.onValue && props.onValue(props.value);
2035
+ props.onValue?.(props.value);
1962
2036
  }
1963
2037
  else {
1964
2038
  onClickControl();
@@ -1967,10 +2041,12 @@ function useFieldAutocomplete(props) {
1967
2041
  controller.value,
1968
2042
  controller.setState,
1969
2043
  controller.setFormValue,
1970
- props.onValue
2044
+ props.onValue,
2045
+ props.value,
2046
+ onClickControl
1971
2047
  ]);
1972
2048
  const onClickBackdrop = require$$0.useCallback(() => {
1973
- controller.setState({ modalIsVisible: false });
2049
+ controller.setState({ listIsVisible: false });
1974
2050
  }, [controller.setState]);
1975
2051
  const onChange = require$$0.useCallback((element) => {
1976
2052
  if (props.onSelect) {
@@ -1984,9 +2060,9 @@ function useFieldAutocomplete(props) {
1984
2060
  controller.refInput?.current?.focus();
1985
2061
  }
1986
2062
  else {
1987
- controller.setState({ modalIsVisible: false });
2063
+ controller.setState({ listIsVisible: false });
1988
2064
  }
1989
- props.onValue && props.onValue(element.value);
2065
+ props.onValue?.(element.value);
1990
2066
  }, [
1991
2067
  controller.setState,
1992
2068
  controller.setFormValue,
@@ -2026,18 +2102,10 @@ function useFieldAutocomplete(props) {
2026
2102
  function RlsFieldAutocompleteTemplate(props) {
2027
2103
  const autocomplete = useFieldAutocomplete(props);
2028
2104
  const { render, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
2029
- const [labels, setLabels] = require$$0.useState({
2030
- listEmptyDescription: reactI18n('listEmptyDescription'),
2031
- listEmptyTitle: reactI18n('listEmptyTitle'),
2032
- listInputPlaceholder: reactI18n('listInputPlaceholder')
2033
- });
2105
+ const [listInputPlaceholder, setListInputPlaceholder] = require$$0.useState(reactI18n('listInputPlaceholder'));
2034
2106
  require$$0.useEffect(() => {
2035
2107
  return i18n.i18nSubscribe(() => {
2036
- setLabels({
2037
- listEmptyDescription: reactI18n('listEmptyDescription'),
2038
- listEmptyTitle: reactI18n('listEmptyTitle'),
2039
- listInputPlaceholder: reactI18n('listInputPlaceholder')
2040
- });
2108
+ setListInputPlaceholder(reactI18n('listInputPlaceholder'));
2041
2109
  });
2042
2110
  }, []);
2043
2111
  const disabled = require$$0.useMemo(() => {
@@ -2059,24 +2127,36 @@ function RlsFieldAutocompleteTemplate(props) {
2059
2127
  props.readOnly,
2060
2128
  disabled
2061
2129
  ]);
2062
- const classNameSuggestions = require$$0.useMemo(() => {
2063
- return renderClassStatus('rls-field-list__suggestions', {
2064
- disabled,
2065
- higher: autocomplete.higher,
2066
- visible: autocomplete.modalIsVisible
2067
- });
2068
- }, [autocomplete.higher, autocomplete.modalIsVisible, disabled]);
2069
- const onChangePattern = require$$0.useCallback((event) => {
2070
- autocomplete.setPattern(event.target.value);
2071
- }, [autocomplete.setPattern]);
2072
2130
  const onClickPattern = require$$0.useCallback(() => {
2073
- onSearch && onSearch(autocomplete.pattern);
2131
+ onSearch?.(autocomplete.pattern);
2074
2132
  }, [onSearch, autocomplete.pattern]);
2075
2133
  const onKeyDownPattern = require$$0.useCallback((event) => {
2076
- event.key === 'Enter' && onSearch && onSearch(autocomplete.pattern);
2134
+ event.key === 'Enter' && onSearch?.(autocomplete.pattern);
2077
2135
  autocomplete.onKeydownInput(event);
2078
2136
  }, [autocomplete.onKeydownInput, onSearch, autocomplete.pattern]);
2079
- return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: autocomplete.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: autocomplete.value, onClick: autocomplete.onClickControl }), !props.readOnly && (jsxRuntimeExports.jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: autocomplete.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: autocomplete.value ? 'trash-2' : 'arrow-ios-down' }) }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsxs("div", { className: classNameSuggestions, children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: autocomplete.refList, className: "rls-field-list__ul", children: [jsxRuntimeExports.jsxs("div", { className: "rls-field-list__ul__search", children: [jsxRuntimeExports.jsx("input", { ref: autocomplete.refInput, className: "rls-field-list__ul__control", type: "text", placeholder: labels.listInputPlaceholder, value: autocomplete.pattern, onChange: onChangePattern, onFocus: autocomplete.onFocusInput, onBlur: autocomplete.onBlurInput, onKeyDown: onKeyDownPattern, disabled: disabled || searching }), onSearch && (jsxRuntimeExports.jsx("button", { disabled: disabled || searching, onClick: onClickPattern, children: jsxRuntimeExports.jsx(RlsIcon, { value: "search" }) }))] }), searching && jsxRuntimeExports.jsx(RlsProgressBar, { indeterminate: true }), autocomplete.coincidences.map((element, index) => (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: autocomplete.onClickElement(element), onKeyDown: autocomplete.onKeydownElement(element), children: render(element) }, index))), !autocomplete.coincidences.length && (jsxRuntimeExports.jsx("li", { className: "rls-field-list__empty", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-list__empty__description", children: [jsxRuntimeExports.jsx("label", { className: "rls-label-bold rls-truncate", children: labels.listEmptyTitle }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: labels.listEmptyDescription })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: autocomplete.onClickBackdrop })] })] }));
2137
+ const searchControl = require$$0.useMemo(() => ({
2138
+ pattern: autocomplete.pattern,
2139
+ placeholder: listInputPlaceholder,
2140
+ searching,
2141
+ refInput: autocomplete.refInput,
2142
+ onChange: autocomplete.setPattern,
2143
+ onFocus: autocomplete.onFocusInput,
2144
+ onBlur: autocomplete.onBlurInput,
2145
+ onKeyDown: onKeyDownPattern,
2146
+ onSearch: onSearch ? onClickPattern : undefined
2147
+ }), [
2148
+ autocomplete.pattern,
2149
+ autocomplete.refInput,
2150
+ autocomplete.setPattern,
2151
+ autocomplete.onFocusInput,
2152
+ autocomplete.onBlurInput,
2153
+ listInputPlaceholder,
2154
+ searching,
2155
+ onKeyDownPattern,
2156
+ onClickPattern,
2157
+ onSearch
2158
+ ]);
2159
+ return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: autocomplete.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: autocomplete.value, onClick: autocomplete.onClickControl }), !props.readOnly && (jsxRuntimeExports.jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: autocomplete.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: autocomplete.value ? 'trash-2' : 'arrow-ios-down' }) }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: autocomplete.coincidences, visible: autocomplete.listIsVisible, disabled: disabled, higher: autocomplete.higher, render: render, refList: autocomplete.refList, searchControl: searchControl, onClickElement: autocomplete.onClickElement, onKeydownElement: autocomplete.onKeydownElement, onClickBackdrop: autocomplete.onClickBackdrop })] }));
2080
2160
  }
2081
2161
  function RlsFieldAutocomplete(props) {
2082
2162
  const render = require$$0.useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { className: "rls-field-list__ballot", subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
@@ -2347,7 +2427,7 @@ function RlsFieldClock({ children, disabled: disabledProps, formControl, identif
2347
2427
  formControl?.touch();
2348
2428
  setModalIsVisible(false);
2349
2429
  }, [formControl, onChange]);
2350
- return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date__control", type: "text", value: status.valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx("button", { className: "rls-field-date__action", onClick: onClickAction, disabled: disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: status.icon }) }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { className: "rls-field-clock-modal", visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerClock, { formControl: formControl, time: time, disabled: disabled, onListener: onListener }) })] }));
2430
+ return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-clock", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-clock__control", type: "text", value: status.valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx("button", { className: "rls-field-clock__action", onClick: onClickAction, disabled: disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: status.icon }) }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { className: "rls-field-clock-modal", visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerClock, { formControl: formControl, time: time, disabled: disabled, onListener: onListener }) })] }));
2351
2431
  }
2352
2432
 
2353
2433
  const DATE_FORMAT = '{dd}/{mx}/{yy}';
@@ -2383,7 +2463,7 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
2383
2463
  date: today.current,
2384
2464
  maxDate,
2385
2465
  minDate
2386
- }), [today.current, maxDate, minDate]);
2466
+ }), [maxDate, minDate]);
2387
2467
  require$$0.useEffect(() => {
2388
2468
  const date = components.verifyDateRange({ date: _date, minDate, maxDate });
2389
2469
  setValue(date);
@@ -2448,7 +2528,7 @@ function RlsFieldDate({ children, date, disabled: disabledProps, formControl, fo
2448
2528
  return {
2449
2529
  icon: dateValue ? 'trash-2' : 'calendar',
2450
2530
  label: dateValue
2451
- ? dates.dateFormatTemplate(dateValue, format || DATE_FORMAT)
2531
+ ? dates.dateFormatTemplate(dateValue, format ?? DATE_FORMAT)
2452
2532
  : ''
2453
2533
  };
2454
2534
  }, [dateValue, format]);
@@ -2549,11 +2629,11 @@ function RlsPickerDateRange({ automatic, date: datePicker, disabled, formControl
2549
2629
  type === 'month' ? setVisibility('MONTH') : setVisibility('YEAR');
2550
2630
  }, []);
2551
2631
  const onCancel = require$$0.useCallback(() => {
2552
- onListener && onListener({ event: components.PickerListenerEvent.Cancel });
2632
+ onListener?.({ event: components.PickerListenerEvent.Cancel });
2553
2633
  }, [onListener]);
2554
2634
  const onSelect = require$$0.useCallback(() => {
2555
2635
  formControl?.setValue(value);
2556
- onListener && onListener({ event: components.PickerListenerEvent.Select, value });
2636
+ onListener?.({ event: components.PickerListenerEvent.Select, value });
2557
2637
  }, [formControl, value, onListener]);
2558
2638
  return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__header", children: [jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: date, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: visibility === 'MONTH' ? 'year' : 'month', onClick: onVisibilityTitle }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__title", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDayRange, { formControl: rangeControl, date: date, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), jsxRuntimeExports.jsx("div", { className: classNameFooter, children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.dateActionSelect }) })] }) })] }));
2559
2639
  }
@@ -2624,17 +2704,17 @@ function useFieldSelect(props) {
2624
2704
  controller.setState({ focused: false });
2625
2705
  }, [controller.setState]);
2626
2706
  const onClickInput = require$$0.useCallback(() => {
2627
- !props.readOnly && controller.setState({ modalIsVisible: true });
2707
+ !props.readOnly && controller.setState({ listIsVisible: true });
2628
2708
  }, [controller.setState, props.readOnly]);
2629
2709
  const onKeydownInput = require$$0.useCallback((event) => {
2630
2710
  switch (event.code) {
2631
2711
  case 'Space':
2632
2712
  case 'Enter':
2633
- controller.setState({ modalIsVisible: true });
2713
+ controller.setState({ listIsVisible: true });
2634
2714
  break;
2635
2715
  case 'Escape':
2636
2716
  case 'Tab':
2637
- controller.setState({ modalIsVisible: false });
2717
+ controller.setState({ listIsVisible: false });
2638
2718
  break;
2639
2719
  default:
2640
2720
  controller.navigationInput(event);
@@ -2644,17 +2724,17 @@ function useFieldSelect(props) {
2644
2724
  const onClickAction = require$$0.useCallback(() => {
2645
2725
  const removable = !props.unremovable && !!controller.value;
2646
2726
  if (removable) {
2647
- controller.setState({ modalIsVisible: false });
2727
+ controller.setState({ listIsVisible: false });
2648
2728
  controller.setFormValue(undefined);
2649
- props.onValue && props.onValue(props.value);
2729
+ props.onValue?.(props.value);
2650
2730
  }
2651
2731
  else {
2652
- const modalIsVisible = !controller.modalIsVisible;
2653
- controller.setState({ modalIsVisible });
2654
- modalIsVisible && controller.refInput?.current?.focus();
2732
+ const listIsVisible = !controller.listIsVisible;
2733
+ controller.setState({ listIsVisible });
2734
+ listIsVisible && controller.refInput?.current?.focus();
2655
2735
  }
2656
2736
  }, [
2657
- controller.modalIsVisible,
2737
+ controller.listIsVisible,
2658
2738
  controller.value,
2659
2739
  controller.setState,
2660
2740
  controller.setFormValue,
@@ -2662,19 +2742,19 @@ function useFieldSelect(props) {
2662
2742
  props.onValue
2663
2743
  ]);
2664
2744
  const onClickBackdrop = require$$0.useCallback(() => {
2665
- controller.setState({ modalIsVisible: false });
2745
+ controller.setState({ listIsVisible: false });
2666
2746
  }, [controller.setState]);
2667
2747
  const onChange = require$$0.useCallback((element) => {
2668
2748
  !props.disabled && controller.refInput?.current?.focus();
2669
2749
  if (props.onSelect) {
2670
- controller.setState({ modalIsVisible: false });
2750
+ controller.setState({ listIsVisible: false });
2671
2751
  element.value && props.onSelect(element.value);
2672
2752
  }
2673
2753
  else {
2674
2754
  controller.setFormValue(element);
2675
- controller.setState({ modalIsVisible: false });
2755
+ controller.setState({ listIsVisible: false });
2676
2756
  }
2677
- props.onValue && props.onValue(element.value);
2757
+ props.onValue?.(element.value);
2678
2758
  }, [
2679
2759
  controller.setState,
2680
2760
  controller.setFormValue,
@@ -2710,18 +2790,6 @@ function useFieldSelect(props) {
2710
2790
  function RlsFieldSelectTemplate(props) {
2711
2791
  const select = useFieldSelect(props);
2712
2792
  const { render, suggestions, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
2713
- const [labels, setLabels] = require$$0.useState({
2714
- listEmptyDescription: reactI18n('listEmptyDescription'),
2715
- listEmptyTitle: reactI18n('listEmptyTitle')
2716
- });
2717
- require$$0.useEffect(() => {
2718
- return i18n.i18nSubscribe(() => {
2719
- setLabels({
2720
- listEmptyDescription: reactI18n('listEmptyDescription'),
2721
- listEmptyTitle: reactI18n('listEmptyTitle')
2722
- });
2723
- });
2724
- }, []);
2725
2793
  const disabled = require$$0.useMemo(() => {
2726
2794
  return formControl?.disabled || props.disabled;
2727
2795
  }, [formControl?.disabled, props.disabled]);
@@ -2739,14 +2807,7 @@ function RlsFieldSelectTemplate(props) {
2739
2807
  props.readOnly,
2740
2808
  disabled
2741
2809
  ]);
2742
- const classNameSuggestions = require$$0.useMemo(() => {
2743
- return renderClassStatus('rls-field-list__suggestions', {
2744
- disabled,
2745
- higher: select.higher,
2746
- visible: select.modalIsVisible
2747
- });
2748
- }, [select.modalIsVisible, select.higher, disabled]);
2749
- return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: select.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { ref: select.refInput, className: "rls-field-list__control", readOnly: true, placeholder: placeholder, value: select.value, onFocus: select.onFocusInput, onBlur: select.onBlurInput, onClick: select.onClickInput, onKeyDown: select.onKeydownInput, disabled: disabled }), !props.readOnly && (jsxRuntimeExports.jsx("button", { className: 'rls-field-list__action', disabled: disabled, onClick: select.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: !unremovable && !!select.value ? 'close' : 'arrow-ios-down' }) }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsxs("div", { className: classNameSuggestions, children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__suggestions__body", children: jsxRuntimeExports.jsxs("ul", { ref: select.refList, className: "rls-field-list__ul", children: [suggestions.map((element, index) => (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: select.onClickElement(element), onKeyDown: select.onKeydownElement(element), children: render(element) }, index))), !suggestions.length && (jsxRuntimeExports.jsx("li", { className: "rls-field-list__empty", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-list__empty__description", children: [jsxRuntimeExports.jsx("label", { className: "rls-label-bold rls-truncate", children: labels.listEmptyTitle }), jsxRuntimeExports.jsx("p", { className: "rls-caption-regular", children: labels.listEmptyDescription })] }) }))] }) }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: select.onClickBackdrop })] })] }));
2810
+ return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: select.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { ref: select.refInput, className: "rls-field-list__control", readOnly: true, placeholder: placeholder, value: select.value, onFocus: select.onFocusInput, onBlur: select.onBlurInput, onClick: select.onClickInput, onKeyDown: select.onKeydownInput, disabled: disabled }), !props.readOnly && (jsxRuntimeExports.jsx("button", { className: 'rls-field-list__action', disabled: disabled, onClick: select.onClickAction, children: jsxRuntimeExports.jsx(RlsIcon, { value: !unremovable && !!select.value ? 'close' : 'arrow-ios-down' }) }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: suggestions, visible: select.listIsVisible, disabled: disabled, higher: select.higher, render: render, refList: select.refList, onClickElement: select.onClickElement, onKeydownElement: select.onKeydownElement, onClickBackdrop: select.onClickBackdrop })] }));
2750
2811
  }
2751
2812
  function RlsFieldSelect(props) {
2752
2813
  const render = require$$0.useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { className: "rls-field-list__ballot", subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
@@ -2806,7 +2867,7 @@ function useRelocationOnComponent({ container, element, onDrag }) {
2806
2867
  const clientY = getClientY(positionY);
2807
2868
  element.current.style.top = `${clientY}px`;
2808
2869
  element.current.style.left = `${clientX}px`;
2809
- onDrag && onDrag();
2870
+ onDrag?.();
2810
2871
  }, []);
2811
2872
  require$$0.useEffect(() => {
2812
2873
  const mousedown = (event) => {
@@ -3081,7 +3142,7 @@ function RlsImageEditor(props) {
3081
3142
  base64: reader.result,
3082
3143
  blob
3083
3144
  };
3084
- props.onValue && props.onValue(value);
3145
+ props.onValue?.(value);
3085
3146
  props.formControl?.setValue(value);
3086
3147
  };
3087
3148
  }
@@ -3176,7 +3237,7 @@ function RlsImageChooser(props) {
3176
3237
  const [src, setSrc] = require$$0.useState();
3177
3238
  const onValue = require$$0.useCallback((image) => {
3178
3239
  setSrc(image.base64);
3179
- props.onValue && props.onValue(image);
3240
+ props.onValue?.(image);
3180
3241
  }, [props.onValue]);
3181
3242
  const controller = useImageEditorController({ ...props, onValue });
3182
3243
  require$$0.useEffect(() => {
@@ -3190,7 +3251,7 @@ function RlsModalSheet({ children, className, onAutoClose, visible, rlsTheme })
3190
3251
  return renderClassStatus('rls-modal-sheet', { visible }, className);
3191
3252
  }, [className, visible]);
3192
3253
  const onClickBackdrop = require$$0.useCallback(() => {
3193
- onAutoClose && onAutoClose();
3254
+ onAutoClose?.();
3194
3255
  }, [onAutoClose]);
3195
3256
  return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameModal, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-modal-sheet__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-modal-sheet__backdrop", onClick: onClickBackdrop })] }), document.body);
3196
3257
  }
@@ -3410,6 +3471,8 @@ exports.RlsFieldClock = RlsFieldClock;
3410
3471
  exports.RlsFieldDate = RlsFieldDate;
3411
3472
  exports.RlsFieldDateRange = RlsFieldDateRange;
3412
3473
  exports.RlsFieldDecimal = RlsFieldDecimal;
3474
+ exports.RlsFieldFile = RlsFieldFile;
3475
+ exports.RlsFieldListSuggestions = RlsFieldListSuggestions;
3413
3476
  exports.RlsFieldMoney = RlsFieldMoney;
3414
3477
  exports.RlsFieldNumber = RlsFieldNumber;
3415
3478
  exports.RlsFieldPassword = RlsFieldPassword;