@rolster/react-components 19.6.11 → 19.7.0
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/LICENSE +21 -21
- package/dist/cjs/index.cjs +289 -149
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/es/index.mjs +288 -151
- package/dist/es/index.mjs.map +1 -1
- package/dist/esm/components/atoms/Amount/Amount.d.ts +2 -1
- package/dist/esm/components/atoms/Amount/Amount.js +3 -2
- package/dist/esm/components/atoms/Amount/Amount.js.map +1 -1
- package/dist/esm/components/atoms/AreaText/AreaText.d.ts +3 -1
- package/dist/esm/components/atoms/AreaText/AreaText.js +3 -2
- package/dist/esm/components/atoms/AreaText/AreaText.js.map +1 -1
- package/dist/esm/components/atoms/Avatar/Avatar.d.ts +2 -1
- package/dist/esm/components/atoms/Avatar/Avatar.js +3 -2
- package/dist/esm/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/atoms/Badge/Badge.d.ts +2 -1
- package/dist/esm/components/atoms/Badge/Badge.js +3 -2
- package/dist/esm/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.d.ts +2 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js +3 -2
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.d.ts +2 -1
- package/dist/esm/components/atoms/Button/Button.js +3 -2
- package/dist/esm/components/atoms/Button/Button.js.map +1 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.d.ts +2 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.js +3 -2
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.js.map +1 -1
- package/dist/esm/components/atoms/ButtonIcon/ButtonIcon.d.ts +2 -1
- package/dist/esm/components/atoms/ButtonIcon/ButtonIcon.js +3 -2
- package/dist/esm/components/atoms/ButtonIcon/ButtonIcon.js.map +1 -1
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.d.ts +3 -2
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.js +3 -2
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.js.map +1 -1
- package/dist/esm/components/atoms/CheckBox/CheckBox.d.ts +4 -2
- package/dist/esm/components/atoms/CheckBox/CheckBox.js +5 -3
- package/dist/esm/components/atoms/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/components/atoms/Icon/Icon.d.ts +2 -1
- package/dist/esm/components/atoms/Icon/Icon.js +3 -2
- package/dist/esm/components/atoms/Icon/Icon.js.map +1 -1
- package/dist/esm/components/atoms/Image/Image.d.ts +2 -1
- package/dist/esm/components/atoms/Image/Image.js +3 -2
- package/dist/esm/components/atoms/Image/Image.js.map +1 -1
- package/dist/esm/components/atoms/Input/Input.d.ts +2 -1
- package/dist/esm/components/atoms/Input/Input.js +3 -2
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputCounter/InputCounter.d.ts +2 -1
- package/dist/esm/components/atoms/InputCounter/InputCounter.js +3 -2
- package/dist/esm/components/atoms/InputCounter/InputCounter.js.map +1 -1
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.d.ts +2 -1
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.js +3 -2
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.js.map +1 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.d.ts +2 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.js +3 -2
- package/dist/esm/components/atoms/InputMoney/InputMoney.js.map +1 -1
- package/dist/esm/components/atoms/InputNumber/InputNumber.d.ts +2 -1
- package/dist/esm/components/atoms/InputNumber/InputNumber.js +3 -2
- package/dist/esm/components/atoms/InputNumber/InputNumber.js.map +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.d.ts +2 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.js +3 -2
- package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/atoms/InputPercentage/InputPercentage.d.ts +2 -1
- package/dist/esm/components/atoms/InputPercentage/InputPercentage.js +3 -2
- package/dist/esm/components/atoms/InputPercentage/InputPercentage.js.map +1 -1
- package/dist/esm/components/atoms/InputSearch/InputSearch.d.ts +2 -1
- package/dist/esm/components/atoms/InputSearch/InputSearch.js +3 -2
- package/dist/esm/components/atoms/InputSearch/InputSearch.js.map +1 -1
- package/dist/esm/components/atoms/InputText/InputText.d.ts +3 -1
- package/dist/esm/components/atoms/InputText/InputText.js +3 -2
- package/dist/esm/components/atoms/InputText/InputText.js.map +1 -1
- package/dist/esm/components/atoms/Label/Label.d.ts +3 -1
- package/dist/esm/components/atoms/Label/Label.js +3 -1
- package/dist/esm/components/atoms/Label/Label.js.map +1 -1
- package/dist/esm/components/atoms/Led/Led.d.ts +2 -1
- package/dist/esm/components/atoms/Led/Led.js +3 -2
- package/dist/esm/components/atoms/Led/Led.js.map +1 -1
- package/dist/esm/components/atoms/MessageIcon/MessageIcon.d.ts +2 -1
- package/dist/esm/components/atoms/MessageIcon/MessageIcon.js +3 -1
- package/dist/esm/components/atoms/MessageIcon/MessageIcon.js.map +1 -1
- package/dist/esm/components/atoms/Poster/Poster.d.ts +2 -1
- package/dist/esm/components/atoms/Poster/Poster.js +3 -2
- package/dist/esm/components/atoms/Poster/Poster.js.map +1 -1
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.d.ts +2 -1
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js +3 -2
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/atoms/ProgressCircular/ProgressCircular.d.ts +3 -1
- package/dist/esm/components/atoms/ProgressCircular/ProgressCircular.js +3 -1
- package/dist/esm/components/atoms/ProgressCircular/ProgressCircular.js.map +1 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.d.ts +2 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.js +3 -2
- package/dist/esm/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/atoms/Skeleton/Skeleton.d.ts +3 -1
- package/dist/esm/components/atoms/Skeleton/Skeleton.js +3 -1
- package/dist/esm/components/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.d.ts +2 -1
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.js +3 -1
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.js.map +1 -1
- package/dist/esm/components/atoms/Spinner/Spinner.d.ts +3 -1
- package/dist/esm/components/atoms/Spinner/Spinner.js +3 -1
- package/dist/esm/components/atoms/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/atoms/Switch/Switch.d.ts +4 -2
- package/dist/esm/components/atoms/Switch/Switch.js +5 -3
- package/dist/esm/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/esm/components/atoms/TabularText/TabularText.d.ts +2 -1
- package/dist/esm/components/atoms/TabularText/TabularText.js +3 -2
- package/dist/esm/components/atoms/TabularText/TabularText.js.map +1 -1
- package/dist/esm/components/molecules/Accordion/Accordion.d.ts +2 -1
- package/dist/esm/components/molecules/Accordion/Accordion.js +3 -2
- package/dist/esm/components/molecules/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/molecules/Alert/Alert.d.ts +2 -1
- package/dist/esm/components/molecules/Alert/Alert.js +3 -2
- package/dist/esm/components/molecules/Alert/Alert.js.map +1 -1
- package/dist/esm/components/molecules/Ballot/Ballot.d.ts +2 -1
- package/dist/esm/components/molecules/Ballot/Ballot.js +3 -2
- package/dist/esm/components/molecules/Ballot/Ballot.js.map +1 -1
- package/dist/esm/components/molecules/Body/Body.d.ts +3 -1
- package/dist/esm/components/molecules/Body/Body.js +3 -1
- package/dist/esm/components/molecules/Body/Body.js.map +1 -1
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.d.ts +2 -1
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js +3 -2
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js.map +1 -1
- package/dist/esm/components/molecules/ButtonStepper/ButtonStepper.d.ts +2 -1
- package/dist/esm/components/molecules/ButtonStepper/ButtonStepper.js +3 -2
- package/dist/esm/components/molecules/ButtonStepper/ButtonStepper.js.map +1 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.d.ts +2 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js +3 -2
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js.map +1 -1
- package/dist/esm/components/molecules/Content/Content.d.ts +3 -1
- package/dist/esm/components/molecules/Content/Content.js +3 -1
- package/dist/esm/components/molecules/Content/Content.js.map +1 -1
- package/dist/esm/components/molecules/FieldArea/FieldArea.d.ts +2 -1
- package/dist/esm/components/molecules/FieldArea/FieldArea.js +3 -2
- package/dist/esm/components/molecules/FieldArea/FieldArea.js.map +1 -1
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.d.ts +2 -1
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.js +3 -2
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.js.map +1 -1
- package/dist/esm/components/molecules/FieldFile/FieldFile.d.ts +2 -1
- package/dist/esm/components/molecules/FieldFile/FieldFile.js +3 -2
- package/dist/esm/components/molecules/FieldFile/FieldFile.js.map +1 -1
- package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.d.ts +2 -1
- package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.js +3 -2
- package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.js.map +1 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.d.ts +2 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js +3 -2
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js.map +1 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.d.ts +2 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js +3 -2
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js.map +1 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.d.ts +3 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js +3 -2
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js.map +1 -1
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.d.ts +2 -1
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.js +3 -2
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.js.map +1 -1
- package/dist/esm/components/molecules/FieldReadonly/FieldReadonly.d.ts +2 -1
- package/dist/esm/components/molecules/FieldReadonly/FieldReadonly.js +3 -1
- package/dist/esm/components/molecules/FieldReadonly/FieldReadonly.js.map +1 -1
- package/dist/esm/components/molecules/FieldText/FieldText.d.ts +3 -1
- package/dist/esm/components/molecules/FieldText/FieldText.js +3 -2
- package/dist/esm/components/molecules/FieldText/FieldText.js.map +1 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.d.ts +2 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js +3 -2
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js.map +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.d.ts +3 -2
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js +3 -2
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js.map +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.d.ts +2 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js +3 -2
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js.map +1 -1
- package/dist/esm/components/molecules/MessageEmpty/MessageEmpty.d.ts +2 -1
- package/dist/esm/components/molecules/MessageEmpty/MessageEmpty.js +3 -2
- package/dist/esm/components/molecules/MessageEmpty/MessageEmpty.js.map +1 -1
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.d.ts +2 -1
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.js +3 -2
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.js.map +1 -1
- package/dist/esm/components/molecules/Navbar/Navbar.d.ts +3 -1
- package/dist/esm/components/molecules/Navbar/Navbar.js +3 -1
- package/dist/esm/components/molecules/Navbar/Navbar.js.map +1 -1
- package/dist/esm/components/molecules/NavbarMenu/NabvarMenu.d.ts +2 -1
- package/dist/esm/components/molecules/NavbarMenu/NabvarMenu.js +3 -2
- package/dist/esm/components/molecules/NavbarMenu/NabvarMenu.js.map +1 -1
- package/dist/esm/components/molecules/Pagination/Pagination.d.ts +2 -1
- package/dist/esm/components/molecules/Pagination/Pagination.js +3 -2
- package/dist/esm/components/molecules/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/molecules/PickerDay/PickerDay.d.ts +2 -1
- package/dist/esm/components/molecules/PickerDay/PickerDay.js +3 -2
- package/dist/esm/components/molecules/PickerDay/PickerDay.js.map +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.d.ts +2 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js +3 -2
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js.map +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.d.ts +2 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js +3 -2
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js.map +1 -1
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.d.ts +2 -1
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js +3 -2
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js.map +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.d.ts +2 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.js +3 -2
- package/dist/esm/components/molecules/PickerYear/PickerYear.js.map +1 -1
- package/dist/esm/components/molecules/Slider/Slider.d.ts +2 -1
- package/dist/esm/components/molecules/Slider/Slider.js +3 -2
- package/dist/esm/components/molecules/Slider/Slider.js.map +1 -1
- package/dist/esm/components/molecules/Tabs/Tabs.d.ts +2 -1
- package/dist/esm/components/molecules/Tabs/Tabs.js +3 -2
- package/dist/esm/components/molecules/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/molecules/Toolbar/Toolbar.d.ts +2 -1
- package/dist/esm/components/molecules/Toolbar/Toolbar.js +3 -1
- package/dist/esm/components/molecules/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.d.ts +2 -1
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.js +3 -2
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/organisms/Card/Card.d.ts +2 -1
- package/dist/esm/components/organisms/Card/Card.js +3 -2
- package/dist/esm/components/organisms/Card/Card.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +2 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +3 -2
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/Datatable/Datatable.d.ts +19 -9
- package/dist/esm/components/organisms/Datatable/Datatable.js +25 -16
- package/dist/esm/components/organisms/Datatable/Datatable.js.map +1 -1
- package/dist/esm/components/organisms/Dropdown/Dropdown.d.ts +2 -1
- package/dist/esm/components/organisms/Dropdown/Dropdown.js +3 -2
- package/dist/esm/components/organisms/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.d.ts +8 -6
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +5 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldClock/FieldClock.d.ts +5 -4
- package/dist/esm/components/organisms/FieldClock/FieldClock.js +3 -2
- package/dist/esm/components/organisms/FieldClock/FieldClock.js.map +1 -1
- package/dist/esm/components/organisms/FieldColor/FieldColor.d.ts +5 -4
- package/dist/esm/components/organisms/FieldColor/FieldColor.js +3 -2
- package/dist/esm/components/organisms/FieldColor/FieldColor.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.d.ts +5 -4
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +3 -2
- package/dist/esm/components/organisms/FieldDate/FieldDate.js.map +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.d.ts +5 -4
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js +3 -2
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldList/FieldList.d.ts +8 -6
- package/dist/esm/components/organisms/FieldList/FieldList.js +5 -3
- package/dist/esm/components/organisms/FieldList/FieldList.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.d.ts +8 -6
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +5 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.d.ts +3 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js +3 -2
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js.map +1 -1
- package/dist/esm/components/organisms/ImageChooser/ImageChooser.d.ts +2 -1
- package/dist/esm/components/organisms/ImageChooser/ImageChooser.js +3 -2
- package/dist/esm/components/organisms/ImageChooser/ImageChooser.js.map +1 -1
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.d.ts +2 -1
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.js +3 -2
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.js.map +1 -1
- package/dist/esm/components/organisms/ImageEditorModal/ImageEditorModal.d.ts +2 -1
- package/dist/esm/components/organisms/ImageEditorModal/ImageEditorModal.js +3 -1
- package/dist/esm/components/organisms/ImageEditorModal/ImageEditorModal.js.map +1 -1
- package/dist/esm/components/organisms/Modal/Modal.d.ts +2 -1
- package/dist/esm/components/organisms/Modal/Modal.js +3 -2
- package/dist/esm/components/organisms/Modal/Modal.js.map +1 -1
- package/dist/esm/components/organisms/ModalClock/ModalClock.d.ts +2 -1
- package/dist/esm/components/organisms/ModalClock/ModalClock.js +3 -2
- package/dist/esm/components/organisms/ModalClock/ModalClock.js.map +1 -1
- package/dist/esm/components/organisms/ModalDate/ModalDate.d.ts +2 -1
- package/dist/esm/components/organisms/ModalDate/ModalDate.js +3 -2
- package/dist/esm/components/organisms/ModalDate/ModalDate.js.map +1 -1
- package/dist/esm/components/organisms/ModalDateRange/ModalDateRange.d.ts +2 -1
- package/dist/esm/components/organisms/ModalDateRange/ModalDateRange.js +3 -2
- package/dist/esm/components/organisms/ModalDateRange/ModalDateRange.js.map +1 -1
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.d.ts +2 -1
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.js +3 -2
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.js.map +1 -1
- package/dist/esm/components/organisms/PickerClock/PickerClock.d.ts +2 -1
- package/dist/esm/components/organisms/PickerClock/PickerClock.js +3 -2
- package/dist/esm/components/organisms/PickerClock/PickerClock.js.map +1 -1
- package/dist/esm/components/organisms/PickerColor/PickerColor.d.ts +2 -1
- package/dist/esm/components/organisms/PickerColor/PickerColor.js +3 -2
- package/dist/esm/components/organisms/PickerColor/PickerColor.js.map +1 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.d.ts +2 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.js +3 -2
- package/dist/esm/components/organisms/PickerDate/PickerDate.js.map +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.d.ts +2 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +3 -2
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js.map +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.d.ts +2 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js +3 -2
- package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/components/organisms/VirtualScroll/VirtualScroll.d.ts +2 -1
- package/dist/esm/components/organisms/VirtualScroll/VirtualScroll.js +7 -7
- package/dist/esm/components/organisms/VirtualScroll/VirtualScroll.js.map +1 -1
- package/dist/esm/context.js +9 -8
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/controllers/ListController.d.ts +1 -1
- package/dist/esm/controllers/ListController.js +25 -15
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/dist/esm/controllers/ResizeController.d.ts +3 -3
- package/dist/esm/controllers/ResizeController.js +10 -11
- package/dist/esm/controllers/ResizeController.js.map +1 -1
- package/dist/esm/helpers/app-theme.d.ts +4 -0
- package/dist/esm/helpers/app-theme.js +21 -0
- package/dist/esm/helpers/app-theme.js.map +1 -0
- package/dist/esm/helpers/css.js +4 -4
- package/dist/esm/helpers/css.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types.d.ts +1 -0
- package/package.json +83 -83
package/dist/es/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import require$$0, { useMemo, useState, useRef, useCallback, useEffect, useEffectEvent, createContext, useContext } from 'react';
|
|
1
|
+
import require$$0, { memo, useMemo, useState, useRef, useCallback, useEffect, useEffectEvent, createContext, useContext } from 'react';
|
|
2
2
|
import { currencyFormat, BigDecimal, valueIsDefined, SealedPartial } from '@rolster/commons';
|
|
3
3
|
import { i18n, i18nSubscribe } from '@rolster/i18n';
|
|
4
4
|
import { PaginationController, verifyDayPicker, createDayPicker, createDayRangePicker, verifyMonthPicker, createMonthPicker, monthLimitTemplate, createYearPicker, verifyYearPicker, ListCollection, navigationListFromInput, navigationListFromElement, createAutocompleteStore, PickerListenerEvent, dateOutRange, verifyDateRange } from '@rolster/components';
|
|
@@ -429,16 +429,16 @@ function requireJsxRuntime () {
|
|
|
429
429
|
var jsxRuntimeExports = requireJsxRuntime();
|
|
430
430
|
|
|
431
431
|
function renderClassStatus(base, status = {}, additionals) {
|
|
432
|
-
const
|
|
432
|
+
const classElement = [base];
|
|
433
433
|
Object.entries(status).forEach(([key, state]) => {
|
|
434
434
|
if (state) {
|
|
435
|
-
|
|
435
|
+
classElement.push(typeof state === 'string' ? `${base}--${state}` : `${base}--${key}`);
|
|
436
436
|
}
|
|
437
437
|
});
|
|
438
438
|
if (additionals) {
|
|
439
|
-
|
|
439
|
+
classElement.push(additionals);
|
|
440
440
|
}
|
|
441
|
-
return
|
|
441
|
+
return classElement.join(' ').trim();
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
const className = 'rls-tabular-text';
|
|
@@ -448,7 +448,7 @@ function getCharClass(char) {
|
|
|
448
448
|
? `${className}__pointer`
|
|
449
449
|
: `${className}__char`;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function RlsTabularTextComponent({ className, value }) {
|
|
452
452
|
const codes = useMemo(() => {
|
|
453
453
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: value?.split('').map((char, index) => (jsxRuntimeExports.jsx("span", { className: getCharClass(char), children: char }, index))) }));
|
|
454
454
|
}, [value]);
|
|
@@ -457,8 +457,9 @@ function RlsTabularText({ className, value }) {
|
|
|
457
457
|
}, [className]);
|
|
458
458
|
return jsxRuntimeExports.jsx("div", { className: _className, children: codes });
|
|
459
459
|
}
|
|
460
|
+
const RlsTabularText = memo(RlsTabularTextComponent);
|
|
460
461
|
|
|
461
|
-
function
|
|
462
|
+
function RlsAmountComponent({ value, className, decimals, rlsTheme, symbol }) {
|
|
462
463
|
const classNameAmount = useMemo(() => {
|
|
463
464
|
return renderClassStatus('rls-amount', {}, className);
|
|
464
465
|
}, [className]);
|
|
@@ -475,8 +476,9 @@ function RlsAmount({ value, className, decimals, rlsTheme, symbol }) {
|
|
|
475
476
|
}, [value, decimals]);
|
|
476
477
|
return (jsxRuntimeExports.jsxs("div", { className: classNameAmount, "rls-theme": rlsTheme, children: [symbol && jsxRuntimeExports.jsx("span", { className: "rls-amount__symbol", children: symbol }), jsxRuntimeExports.jsxs("div", { className: "rls-amount__content", children: [jsxRuntimeExports.jsx(RlsTabularText, { className: "rls-amount__integer", value: integer }), decimal && (jsxRuntimeExports.jsx(RlsTabularText, { className: "rls-amount__decimal", value: decimal }))] })] }));
|
|
477
478
|
}
|
|
479
|
+
const RlsAmount = memo(RlsAmountComponent);
|
|
478
480
|
|
|
479
|
-
function
|
|
481
|
+
function RlsAreaTextComponent({ autoComplete, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, resize, rows = 1, value }) {
|
|
480
482
|
const valueInitial = String(formControl?.value ?? value ?? '');
|
|
481
483
|
const [valueArea, setValueArea] = useState(valueInitial);
|
|
482
484
|
const [focused, setFocused] = useState(false);
|
|
@@ -545,20 +547,23 @@ function RlsAreaText({ autoComplete, disabled, formControl, identifier, onBlur,
|
|
|
545
547
|
]);
|
|
546
548
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx("textarea", { ref: areaRef, className: "rls-area-text__component", autoComplete: autoComplete ?? 'off', placeholder: placeholder, disabled: formControl?.disabled || disabled, readOnly: readOnly, rows: rows, style: { resize }, onFocus: onFocusArea, onBlur: onBlurArea, onChange: onChangeArea, onKeyDown: onKeyDownArea, onKeyUp: onKeyUpArea, value: valueArea }), jsxRuntimeExports.jsx("span", { className: "rls-area-text__value", children: valueArea })] }));
|
|
547
549
|
}
|
|
550
|
+
const RlsAreaText = memo(RlsAreaTextComponent);
|
|
548
551
|
|
|
549
|
-
function
|
|
552
|
+
function RlsAvatarComponent({ children, contrasted, rounded, skeleton, rlsTheme }) {
|
|
550
553
|
const className = useMemo(() => {
|
|
551
554
|
return renderClassStatus('rls-avatar', { contrasted, rounded, skeleton });
|
|
552
555
|
}, [contrasted, rounded, skeleton]);
|
|
553
556
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
554
557
|
}
|
|
558
|
+
const RlsAvatar = memo(RlsAvatarComponent);
|
|
555
559
|
|
|
556
|
-
function
|
|
560
|
+
function RlsBadgeComponent({ children, contrasted, rlsTheme }) {
|
|
557
561
|
const className = useMemo(() => {
|
|
558
562
|
return renderClassStatus('rls-badge', { contrasted });
|
|
559
563
|
}, [contrasted]);
|
|
560
564
|
return (jsxRuntimeExports.jsx("span", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
561
565
|
}
|
|
566
|
+
const RlsBadge = memo(RlsBadgeComponent);
|
|
562
567
|
|
|
563
568
|
function RlsBreadcrumbLabel({ label }) {
|
|
564
569
|
const className = useMemo(() => {
|
|
@@ -568,44 +573,50 @@ function RlsBreadcrumbLabel({ label }) {
|
|
|
568
573
|
}, [label.onClick]);
|
|
569
574
|
return (jsxRuntimeExports.jsx("span", { className: "rls-breadcrumb__label", onClick: label.onClick, children: jsxRuntimeExports.jsx("a", { className: className, "rls-theme": label.rlsTheme, children: label.label }) }));
|
|
570
575
|
}
|
|
571
|
-
function
|
|
576
|
+
function RlsBreadcrumbComponent({ labels }) {
|
|
572
577
|
const children = useMemo(() => {
|
|
573
578
|
return labels.map((label, index) => (jsxRuntimeExports.jsx(RlsBreadcrumbLabel, { label: label }, index)));
|
|
574
579
|
}, [labels]);
|
|
575
580
|
return jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: children });
|
|
576
581
|
}
|
|
582
|
+
const RlsBreadcrumb = memo(RlsBreadcrumbComponent);
|
|
577
583
|
|
|
578
|
-
function
|
|
584
|
+
function RlsIconComponent({ value, className, rlsTheme, skeleton }) {
|
|
579
585
|
const classNameIcon = useMemo(() => {
|
|
580
586
|
return renderClassStatus('rls-icon', { skeleton }, className);
|
|
581
587
|
}, [className, skeleton]);
|
|
582
588
|
return (jsxRuntimeExports.jsx("div", { className: classNameIcon, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("i", { className: `rls-icon-${value}` }) }));
|
|
583
589
|
}
|
|
590
|
+
const RlsIcon = memo(RlsIconComponent);
|
|
584
591
|
|
|
585
|
-
function
|
|
592
|
+
function RlsSpinnerComponent() {
|
|
586
593
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-spinner", children: [jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--1", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--2", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--3", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--4", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--5", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--6", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--7", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--8", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--9", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) })] }));
|
|
587
594
|
}
|
|
595
|
+
const RlsSpinner = memo(RlsSpinnerComponent);
|
|
588
596
|
|
|
589
|
-
function
|
|
597
|
+
function RlsButtonComponent({ type, children, disabled, identifier, onClick, prefixIcon, requesting, rlsTheme, suffixIcon }) {
|
|
590
598
|
const className = useMemo(() => {
|
|
591
599
|
return renderClassStatus('rls-button__content', { type });
|
|
592
600
|
}, [type]);
|
|
593
601
|
return (jsxRuntimeExports.jsx("button", { id: identifier, className: "rls-button", onClick: onClick, "rls-theme": rlsTheme, disabled: disabled, children: jsxRuntimeExports.jsxs("div", { className: className, children: [requesting && jsxRuntimeExports.jsx(RlsSpinner, {}), prefixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: prefixIcon }), children && jsxRuntimeExports.jsx("div", { className: "rls-button__description", children: children }), suffixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: suffixIcon })] }) }));
|
|
594
602
|
}
|
|
603
|
+
const RlsButton = memo(RlsButtonComponent);
|
|
595
604
|
|
|
596
|
-
function
|
|
605
|
+
function RlsButtonActionComponent({ icon, disabled, identifier, onClick, rlsTheme, tooltip, type }) {
|
|
597
606
|
const className = useMemo(() => {
|
|
598
607
|
return renderClassStatus('rls-button-action', { type });
|
|
599
608
|
}, [type]);
|
|
600
609
|
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onClick, disabled: disabled, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-button-action__content", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }), tooltip && (jsxRuntimeExports.jsx("div", { className: "rls-button-action__tooltip rls-overline-font-medium", children: jsxRuntimeExports.jsx("span", { children: tooltip }) }))] }));
|
|
601
610
|
}
|
|
611
|
+
const RlsButtonAction = memo(RlsButtonActionComponent);
|
|
602
612
|
|
|
603
|
-
function
|
|
613
|
+
function RlsButtonIconComponent({ icon, className, disabled, onClick, skeleton }) {
|
|
604
614
|
const classNameButton = useMemo(() => {
|
|
605
615
|
return renderClassStatus('rls-button-icon', { skeleton }, className);
|
|
606
616
|
}, [className, skeleton]);
|
|
607
617
|
return (jsxRuntimeExports.jsx("button", { className: classNameButton, onClick: onClick, disabled: disabled, children: !skeleton && jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }));
|
|
608
618
|
}
|
|
619
|
+
const RlsButtonIcon = memo(RlsButtonIconComponent);
|
|
609
620
|
|
|
610
621
|
function useFormSingleSelectionController({ disabled, formControl, onValue, value }) {
|
|
611
622
|
const [checked, setChecked] = useState(formControl?.value === value);
|
|
@@ -621,7 +632,7 @@ function useFormSingleSelectionController({ disabled, formControl, onValue, valu
|
|
|
621
632
|
return { checked, onSelect };
|
|
622
633
|
}
|
|
623
634
|
|
|
624
|
-
function
|
|
635
|
+
function RlsButtonOptionComponent({ icon, children, disabled, formControl, identifier, onClick, onValue, value }) {
|
|
625
636
|
const { checked, onSelect } = useFormSingleSelectionController({
|
|
626
637
|
disabled,
|
|
627
638
|
formControl,
|
|
@@ -637,25 +648,29 @@ function RlsButtonOption({ icon, children, disabled, formControl, identifier, on
|
|
|
637
648
|
}, [onSelect, onClick]);
|
|
638
649
|
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onAction, disabled: disabled, children: [jsxRuntimeExports.jsx(RlsIcon, { value: icon }), children] }));
|
|
639
650
|
}
|
|
651
|
+
const RlsButtonOption = memo(RlsButtonOptionComponent);
|
|
640
652
|
|
|
641
|
-
function
|
|
653
|
+
function RlsCheckBoxComponent({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
642
654
|
const className = useMemo(() => {
|
|
643
655
|
return renderClassStatus('rls-checkbox', { checked, disabled });
|
|
644
656
|
}, [checked, disabled]);
|
|
645
657
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx(RlsIcon, { value: "checkmark" }) }));
|
|
646
658
|
}
|
|
647
|
-
|
|
659
|
+
const RlsCheckBox = memo(RlsCheckBoxComponent);
|
|
660
|
+
function RlsCheckBoxControlComponent({ formControl, disabled, identifier, rlsTheme }) {
|
|
648
661
|
const onClick = useCallback(() => {
|
|
649
662
|
formControl.setValue(!formControl.value);
|
|
650
663
|
}, [formControl.value]);
|
|
651
664
|
return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
652
665
|
}
|
|
666
|
+
const RlsCheckBoxControl = memo(RlsCheckBoxControlComponent);
|
|
653
667
|
|
|
654
|
-
function
|
|
668
|
+
function RlsSkeletonComponent({ rlsTheme }) {
|
|
655
669
|
return jsxRuntimeExports.jsx("div", { className: "rls-skeleton", "rls-theme": rlsTheme });
|
|
656
670
|
}
|
|
671
|
+
const RlsSkeleton = memo(RlsSkeletonComponent);
|
|
657
672
|
|
|
658
|
-
function
|
|
673
|
+
function RlsImageComponent({ src, rlsTheme }) {
|
|
659
674
|
const [srcIsComplet, setSrcIsComplet] = useState(false);
|
|
660
675
|
const refImage = useRef(null);
|
|
661
676
|
const className = useMemo(() => {
|
|
@@ -669,8 +684,9 @@ function RlsImage({ src, rlsTheme }) {
|
|
|
669
684
|
}, []);
|
|
670
685
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [!srcIsComplet && jsxRuntimeExports.jsx(RlsSkeleton, { rlsTheme: rlsTheme }), jsxRuntimeExports.jsx("img", { ref: refImage, src: src, onLoad: onLoad })] }));
|
|
671
686
|
}
|
|
687
|
+
const RlsImage = memo(RlsImageComponent);
|
|
672
688
|
|
|
673
|
-
function
|
|
689
|
+
function RlsInputComponent({ children, decimals, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
|
|
674
690
|
const valueInitial = (formControl?.value ?? value) ? String(value) : '';
|
|
675
691
|
const [valueInput, setValueInput] = useState(valueInitial);
|
|
676
692
|
const [focused, setFocused] = useState(false);
|
|
@@ -721,8 +737,9 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
721
737
|
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
722
738
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx("input", { ref: formControl?.elementRef, className: "rls-input__component", autoComplete: "off", type: type ?? 'text', placeholder: placeholder, disabled: formControl?.disabled || disabled, readOnly: readOnly, onFocus: onFocusInput, onBlur: onBlurInput, onChange: onChangeInput, onKeyDown: onKeyDownInput, onKeyUp: onKeyUpInput, value: valueInput }), jsxRuntimeExports.jsx("span", { className: "rls-input__value", children: children })] }));
|
|
723
739
|
}
|
|
740
|
+
const RlsInput = memo(RlsInputComponent);
|
|
724
741
|
|
|
725
|
-
function
|
|
742
|
+
function RlsInputCounterComponent({ className, disabled, formControl, identifier, max, min, onBlur, onFocus, onValue, readOnly, rlsTheme, step = 1, value: valueProp }) {
|
|
726
743
|
const changeIsInternal = useRef(false);
|
|
727
744
|
const [value, setValue] = useState(formControl?.value ?? valueProp ?? 0);
|
|
728
745
|
const [focused, setFocused] = useState(false);
|
|
@@ -776,8 +793,9 @@ function RlsInputCounter({ className, disabled, formControl, identifier, max, mi
|
|
|
776
793
|
}, [formControl, onBlur]);
|
|
777
794
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: classNameCounter, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx(RlsButtonIcon, { className: "rls-input-counter__down", icon: "minus", onClick: onDecrement, disabled: _disabled || decrementIsAllowed }), jsxRuntimeExports.jsx("div", { className: "rls-input-counter__body", children: jsxRuntimeExports.jsx("input", { ref: formControl?.elementRef, className: "rls-input-counter__control", type: "text", inputMode: "numeric", value: value, disabled: _disabled, readOnly: readOnly, onChange: onChangeInput, onFocus: onFocusInput, onBlur: onBlurInput }) }), jsxRuntimeExports.jsx(RlsButtonIcon, { className: "rls-input-counter__up", icon: "plus", onClick: onIncrement, disabled: _disabled || incrementIsAllowed })] }));
|
|
778
795
|
}
|
|
796
|
+
const RlsInputCounter = memo(RlsInputCounterComponent);
|
|
779
797
|
|
|
780
|
-
function
|
|
798
|
+
function RlsInputDecimalComponent(props) {
|
|
781
799
|
const { decimals, formControl, identifier, onValue, symbol, value } = props;
|
|
782
800
|
const [valueInput, setValueInput] = useState((formControl?.value ?? value ?? BigDecimal.zero()).rounded);
|
|
783
801
|
const amount = useMemo(() => {
|
|
@@ -796,8 +814,9 @@ function RlsInputDecimal(props) {
|
|
|
796
814
|
const decimalProps = { ...props, formControl: undefined };
|
|
797
815
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-decimal", children: jsxRuntimeExports.jsx(RlsInput, { ...decimalProps, type: "number", value: valueInput, onValue: onValueInput, children: jsxRuntimeExports.jsx(RlsAmount, { value: amount, symbol: symbol, decimals: decimals }) }) }));
|
|
798
816
|
}
|
|
817
|
+
const RlsInputDecimal = memo(RlsInputDecimalComponent);
|
|
799
818
|
|
|
800
|
-
function
|
|
819
|
+
function RlsInputMoneyComponent(props) {
|
|
801
820
|
const { decimals, formControl, identifier, onValue, symbol, value } = props;
|
|
802
821
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
|
|
803
822
|
const onValueInput = useCallback((value) => {
|
|
@@ -808,8 +827,9 @@ function RlsInputMoney(props) {
|
|
|
808
827
|
}, [formControl, onValue]);
|
|
809
828
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-money", children: jsxRuntimeExports.jsx(RlsInput, { ...props, type: "number", value: valueInput, onValue: onValueInput, children: jsxRuntimeExports.jsx(RlsAmount, { value: formControl?.value ?? valueInput, symbol: symbol, decimals: decimals }) }) }));
|
|
810
829
|
}
|
|
830
|
+
const RlsInputMoney = memo(RlsInputMoneyComponent);
|
|
811
831
|
|
|
812
|
-
function
|
|
832
|
+
function RlsInputNumberComponent(props) {
|
|
813
833
|
const { formControl, identifier, onValue, value } = props;
|
|
814
834
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
|
|
815
835
|
const onValueInput = useCallback((value) => {
|
|
@@ -820,8 +840,9 @@ function RlsInputNumber(props) {
|
|
|
820
840
|
}, [formControl, onValue]);
|
|
821
841
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-number", children: jsxRuntimeExports.jsx(RlsInput, { ...props, type: "number", value: valueInput, onValue: onValueInput, children: formControl?.value ?? valueInput }) }));
|
|
822
842
|
}
|
|
843
|
+
const RlsInputNumber = memo(RlsInputNumberComponent);
|
|
823
844
|
|
|
824
|
-
function
|
|
845
|
+
function RlsInputPasswordComponent({ disabled, formControl, identifier, onEnter, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type }) {
|
|
825
846
|
const [focused, setFocused] = useState(false);
|
|
826
847
|
const _onChange = useCallback((event) => {
|
|
827
848
|
formControl?.setValue(event.target.value);
|
|
@@ -852,8 +873,9 @@ function RlsInputPassword({ disabled, formControl, identifier, onEnter, onKeyDow
|
|
|
852
873
|
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
853
874
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, children: jsxRuntimeExports.jsx("input", { className: "rls-input-password__component", autoComplete: "off", type: type ?? 'password', placeholder: placeholder, disabled: disabled, readOnly: readOnly, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange, onKeyDown: _onKeyDown, onKeyUp: _onKeyUp }) }));
|
|
854
875
|
}
|
|
876
|
+
const RlsInputPassword = memo(RlsInputPasswordComponent);
|
|
855
877
|
|
|
856
|
-
function
|
|
878
|
+
function RlsInputPercentageComponent(props) {
|
|
857
879
|
const { formControl, identifier, onValue, value } = props;
|
|
858
880
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
|
|
859
881
|
const onValueInput = useCallback((value) => {
|
|
@@ -864,8 +886,9 @@ function RlsInputPercentage(props) {
|
|
|
864
886
|
}, [formControl, onValue]);
|
|
865
887
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-percentage", children: jsxRuntimeExports.jsxs(RlsInput, { ...props, type: "number", value: valueInput, onValue: onValueInput, children: [formControl?.value ?? valueInput, "%"] }) }));
|
|
866
888
|
}
|
|
889
|
+
const RlsInputPercentage = memo(RlsInputPercentageComponent);
|
|
867
890
|
|
|
868
|
-
function
|
|
891
|
+
function RlsInputSearchComponent({ formControl, disabled, identifier, onEnter, onSearch, placeholder }) {
|
|
869
892
|
const [value, setValue] = useState('');
|
|
870
893
|
const className = useMemo(() => {
|
|
871
894
|
return renderClassStatus('rls-input-search', { disabled });
|
|
@@ -877,8 +900,9 @@ function RlsInputSearch({ formControl, disabled, identifier, onEnter, onSearch,
|
|
|
877
900
|
}, [formControl]);
|
|
878
901
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx(RlsInput, { formControl: formControl, placeholder: placeholder, onEnter: onEnter, onValue: onValue, disabled: disabled, children: formControl?.value ?? value }), onSearch && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: "search", onClick: onSearch, disabled: disabled }))] }));
|
|
879
902
|
}
|
|
903
|
+
const RlsInputSearch = memo(RlsInputSearchComponent);
|
|
880
904
|
|
|
881
|
-
function
|
|
905
|
+
function RlsInputTextComponent(props) {
|
|
882
906
|
const { formControl, identifier, onValue, value } = props;
|
|
883
907
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? '');
|
|
884
908
|
const onValueInput = useCallback((value) => {
|
|
@@ -889,10 +913,12 @@ function RlsInputText(props) {
|
|
|
889
913
|
}, [formControl, onValue]);
|
|
890
914
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-text", children: jsxRuntimeExports.jsx(RlsInput, { ...props, type: "text", value: valueInput, onValue: onValueInput, children: formControl?.value ?? valueInput }) }));
|
|
891
915
|
}
|
|
916
|
+
const RlsInputText = memo(RlsInputTextComponent);
|
|
892
917
|
|
|
893
|
-
function
|
|
918
|
+
function RlsLabelComponent({ children, rlsTheme }) {
|
|
894
919
|
return (jsxRuntimeExports.jsx("span", { className: "rls-label", "rls-theme": rlsTheme, children: children }));
|
|
895
920
|
}
|
|
921
|
+
const RlsLabel = memo(RlsLabelComponent);
|
|
896
922
|
|
|
897
923
|
function msgInvalidColor(color) {
|
|
898
924
|
return `Invalid color: "${color}". Use format "#FF6600".`;
|
|
@@ -1214,7 +1240,7 @@ function setThemeColor(baseColor, theme = 'primary') {
|
|
|
1214
1240
|
const DEFAULT_COLOR = '#1780e0';
|
|
1215
1241
|
|
|
1216
1242
|
const CONTENT_BACKGROUND = '--pvt-content-background';
|
|
1217
|
-
function
|
|
1243
|
+
function RlsLedComponent({ color, rlsTheme }) {
|
|
1218
1244
|
const refLed = useRef(null);
|
|
1219
1245
|
const refColor = useRef(undefined);
|
|
1220
1246
|
useEffect(() => {
|
|
@@ -1229,54 +1255,63 @@ function RlsLed({ color, rlsTheme }) {
|
|
|
1229
1255
|
}, [color]);
|
|
1230
1256
|
return jsxRuntimeExports.jsx("div", { ref: refLed, className: "rls-led", "rls-theme": rlsTheme });
|
|
1231
1257
|
}
|
|
1258
|
+
const RlsLed = memo(RlsLedComponent);
|
|
1232
1259
|
|
|
1233
|
-
function
|
|
1260
|
+
function RlsMessageIconComponent({ icon, children, rlsTheme }) {
|
|
1234
1261
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-message-icon", "rls-theme": rlsTheme, children: [icon && jsxRuntimeExports.jsx(RlsIcon, { value: icon }), jsxRuntimeExports.jsx("span", { className: "truncate", children: children })] }));
|
|
1235
1262
|
}
|
|
1263
|
+
const RlsMessageIcon = memo(RlsMessageIconComponent);
|
|
1236
1264
|
|
|
1237
|
-
function
|
|
1265
|
+
function RlsPosterComponent({ children, contrasted, rlsTheme }) {
|
|
1238
1266
|
const className = useMemo(() => {
|
|
1239
1267
|
return renderClassStatus('rls-poster', { contrasted });
|
|
1240
1268
|
}, [contrasted]);
|
|
1241
1269
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
1242
1270
|
}
|
|
1271
|
+
const RlsPoster = memo(RlsPosterComponent);
|
|
1243
1272
|
|
|
1244
|
-
function
|
|
1273
|
+
function RlsProgressBarComponent({ indeterminate, percentage, rlsTheme }) {
|
|
1245
1274
|
const className = useMemo(() => {
|
|
1246
1275
|
return renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1247
1276
|
}, [indeterminate]);
|
|
1248
1277
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage ?? 0}%` } }) }));
|
|
1249
1278
|
}
|
|
1279
|
+
const RlsProgressBar = memo(RlsProgressBarComponent);
|
|
1250
1280
|
|
|
1251
|
-
function
|
|
1281
|
+
function RlsProgressCircularComponent({ rlsTheme }) {
|
|
1252
1282
|
return (jsxRuntimeExports.jsx("div", { className: "rls-progress-circular", "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("svg", { className: "rls-progress-circular__svg", viewBox: "0 0 36 36", children: jsxRuntimeExports.jsx("circle", { className: "rls-progress-circular__circle", cx: "18", cy: "18", r: "12" }) }) }));
|
|
1253
1283
|
}
|
|
1284
|
+
const RlsProgressCircular = memo(RlsProgressCircularComponent);
|
|
1254
1285
|
|
|
1255
|
-
function
|
|
1286
|
+
function RlsRadioButtonComponent({ checked, disabled, identifier, rlsTheme, onClick }) {
|
|
1256
1287
|
const className = useMemo(() => {
|
|
1257
1288
|
return renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1258
1289
|
}, [checked, disabled]);
|
|
1259
1290
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
1260
1291
|
}
|
|
1292
|
+
const RlsRadioButton = memo(RlsRadioButtonComponent);
|
|
1261
1293
|
|
|
1262
|
-
function
|
|
1294
|
+
function RlsSkeletonTextComponent({ active, children, rlsTheme }) {
|
|
1263
1295
|
return (jsxRuntimeExports.jsx("div", { className: "rls-skeleton-text", "rls-theme": rlsTheme, children: active ? (jsxRuntimeExports.jsx(RlsSkeleton, {})) : (jsxRuntimeExports.jsx("div", { className: "rls-skeleton-text__value", children: children })) }));
|
|
1264
1296
|
}
|
|
1297
|
+
const RlsSkeletonText = memo(RlsSkeletonTextComponent);
|
|
1265
1298
|
|
|
1266
|
-
function
|
|
1299
|
+
function RlsSwitchComponent({ checked, capsule, disabled, identifier, onClick, rlsTheme }) {
|
|
1267
1300
|
const className = useMemo(() => {
|
|
1268
1301
|
return renderClassStatus('rls-switch', { checked, capsule, disabled });
|
|
1269
1302
|
}, [checked, capsule, disabled]);
|
|
1270
1303
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-switch__component", children: jsxRuntimeExports.jsx("div", { className: "rls-switch__component__element" }) }) }));
|
|
1271
1304
|
}
|
|
1272
|
-
|
|
1305
|
+
const RlsSwitch = memo(RlsSwitchComponent);
|
|
1306
|
+
function RlsSwitchControlComponent({ formControl, disabled, identifier, rlsTheme }) {
|
|
1273
1307
|
const onClick = useCallback(() => {
|
|
1274
1308
|
formControl.setValue(!formControl.value);
|
|
1275
1309
|
}, [formControl.value]);
|
|
1276
1310
|
return (jsxRuntimeExports.jsx(RlsSwitch, { identifier: identifier, checked: formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
1277
1311
|
}
|
|
1312
|
+
const RlsSwitchControl = memo(RlsSwitchControlComponent);
|
|
1278
1313
|
|
|
1279
|
-
function
|
|
1314
|
+
function RlsAccordionComponent({ bordered, children, className, disabled, identifier, onToggle, opened, rlsTheme, title }) {
|
|
1280
1315
|
const [open, setOpen] = useState(opened);
|
|
1281
1316
|
const [animating, setAnimating] = useState(false);
|
|
1282
1317
|
const contentRef = useRef(null);
|
|
@@ -1329,33 +1364,38 @@ function RlsAccordion({ bordered, children, className, disabled, identifier, onT
|
|
|
1329
1364
|
}, [open]);
|
|
1330
1365
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: classNameAccordion, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("button", { type: "button", className: "rls-accordion__header", "aria-expanded": open, disabled: disabled, onClick: onClickHeader, children: [jsxRuntimeExports.jsx("span", { className: "rls-accordion__title", children: title }), jsxRuntimeExports.jsx("span", { className: "rls-accordion__indicator", children: jsxRuntimeExports.jsx(RlsIcon, { value: "chevron-down" }) })] }), jsxRuntimeExports.jsx("div", { ref: contentRef, className: "rls-accordion__body", "aria-hidden": !open, onTransitionEnd: onTransitionEnd, children: jsxRuntimeExports.jsx("div", { className: "rls-accordion__content", children: children }) })] }));
|
|
1331
1366
|
}
|
|
1367
|
+
const RlsAccordion = memo(RlsAccordionComponent);
|
|
1332
1368
|
|
|
1333
|
-
function
|
|
1369
|
+
function RlsAlertComponent({ bordered, children, icon, identifier, rlsTheme }) {
|
|
1334
1370
|
const className = useMemo(() => {
|
|
1335
1371
|
return renderClassStatus('rls-alert', { bordered });
|
|
1336
1372
|
}, [bordered]);
|
|
1337
1373
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-alert__icon", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsx("div", { className: "rls-alert__content", children: children })] }));
|
|
1338
1374
|
}
|
|
1375
|
+
const RlsAlert = memo(RlsAlertComponent);
|
|
1339
1376
|
|
|
1340
|
-
function
|
|
1377
|
+
function RlsBallotComponent({ bordered, className, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
1341
1378
|
const classNameBallot = useMemo(() => {
|
|
1342
1379
|
return renderClassStatus('rls-ballot', { bordered, skeleton }, className);
|
|
1343
1380
|
}, [bordered, skeleton, className]);
|
|
1344
1381
|
return (jsxRuntimeExports.jsxs("div", { className: classNameBallot, "rls-theme": rlsTheme, children: [(img || initials) && (jsxRuntimeExports.jsxs(RlsAvatar, { skeleton: skeleton, children: [img && jsxRuntimeExports.jsx("img", { src: img }), initials && jsxRuntimeExports.jsx("span", { children: initials })] })), jsxRuntimeExports.jsxs("div", { className: "rls-ballot__component", children: [jsxRuntimeExports.jsx("div", { className: "rls-ballot__title", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: children }) }), subtitle && (jsxRuntimeExports.jsx("div", { className: "rls-ballot__subtitle", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: subtitle }) }))] })] }));
|
|
1345
1382
|
}
|
|
1383
|
+
const RlsBallot = memo(RlsBallotComponent);
|
|
1346
1384
|
|
|
1347
|
-
function
|
|
1385
|
+
function RlsBodyComponent({ children, identifier, rlsTheme }) {
|
|
1348
1386
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-app__page__body", "rls-theme": rlsTheme, children: children }));
|
|
1349
1387
|
}
|
|
1388
|
+
const RlsBody = memo(RlsBodyComponent);
|
|
1350
1389
|
|
|
1351
|
-
function
|
|
1390
|
+
function RlsButtonProgressComponent({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
1352
1391
|
const className = useMemo(() => {
|
|
1353
1392
|
return renderClassStatus('rls-button-progress', { progressing });
|
|
1354
1393
|
}, [progressing]);
|
|
1355
1394
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [!progressing && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: icon, onClick: onClick, disabled: disabled })), progressing && jsxRuntimeExports.jsx(RlsProgressCircular, {})] }));
|
|
1356
1395
|
}
|
|
1396
|
+
const RlsButtonProgress = memo(RlsButtonProgressComponent);
|
|
1357
1397
|
|
|
1358
|
-
function
|
|
1398
|
+
function RlsButtonStepperComponent({ disabled, onAction, rlsTheme }) {
|
|
1359
1399
|
const onDown = useCallback(() => {
|
|
1360
1400
|
onAction?.('down');
|
|
1361
1401
|
}, [onAction]);
|
|
@@ -1364,8 +1404,9 @@ function RlsButtonStepper({ disabled, onAction, rlsTheme }) {
|
|
|
1364
1404
|
}, [onAction]);
|
|
1365
1405
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-button-stepper", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-down", disabled: disabled, onClick: onDown }), jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-up", disabled: disabled, onClick: onUp })] }));
|
|
1366
1406
|
}
|
|
1407
|
+
const RlsButtonStepper = memo(RlsButtonStepperComponent);
|
|
1367
1408
|
|
|
1368
|
-
function
|
|
1409
|
+
function RlsButtonToggleComponent({ onAction, options, type, automatic, disabled, rlsTheme }) {
|
|
1369
1410
|
const componentRef = useRef(null);
|
|
1370
1411
|
const [action, setAction] = useState(options[0]);
|
|
1371
1412
|
const [visible, setVisible] = useState(false);
|
|
@@ -1410,10 +1451,12 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1410
1451
|
}, [options, onSelectAction]);
|
|
1411
1452
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-button-toggle", ref: componentRef, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-button-toggle__content", children: [action && (jsxRuntimeExports.jsx("div", { className: "rls-button-toggle__action", children: jsxRuntimeExports.jsx(RlsButton, { disabled: disabled, type: type, onClick: onClickAction, children: action.label }) })), jsxRuntimeExports.jsx("div", { className: "rls-button-toggle__icon", children: jsxRuntimeExports.jsx(RlsButton, { type: type, prefixIcon: "arrow-ios-down", disabled: disabled, onClick: onClickMenu }) })] }), jsxRuntimeExports.jsx("div", { className: classNameList, children: jsxRuntimeExports.jsx("ul", { children: options.map((action, index) => (jsxRuntimeExports.jsx("li", { className: "rls-truncate", "data-index": index, onClick: onClickOption, children: action.label }, index))) }) })] }));
|
|
1412
1453
|
}
|
|
1454
|
+
const RlsButtonToggle = memo(RlsButtonToggleComponent);
|
|
1413
1455
|
|
|
1414
|
-
function
|
|
1456
|
+
function RlsContentComponent({ children, identifier, rlsTheme }) {
|
|
1415
1457
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-app__page__content", "rls-theme": rlsTheme, children: children }));
|
|
1416
1458
|
}
|
|
1459
|
+
const RlsContent = memo(RlsContentComponent);
|
|
1417
1460
|
|
|
1418
1461
|
const errors = {
|
|
1419
1462
|
es: {
|
|
@@ -1524,7 +1567,7 @@ function msgErrorsI18n(key, language, interpolators) {
|
|
|
1524
1567
|
return _msgErrorsI18n(key, { language, interpolators });
|
|
1525
1568
|
}
|
|
1526
1569
|
|
|
1527
|
-
function
|
|
1570
|
+
function RlsMessageFormErrorComponent({ className, formControl }) {
|
|
1528
1571
|
const [language, setLanguage] = useState('es');
|
|
1529
1572
|
useEffect(() => {
|
|
1530
1573
|
return i18nSubscribe((language) => {
|
|
@@ -1538,8 +1581,9 @@ function RlsMessageFormError({ className, formControl }) {
|
|
|
1538
1581
|
}, [formControl?.error, language]);
|
|
1539
1582
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: formControl?.wrong && (jsxRuntimeExports.jsx("div", { className: className, children: jsxRuntimeExports.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: msgError }) })) }));
|
|
1540
1583
|
}
|
|
1584
|
+
const RlsMessageFormError = memo(RlsMessageFormErrorComponent);
|
|
1541
1585
|
|
|
1542
|
-
function
|
|
1586
|
+
function RlsFieldAreaComponent(props) {
|
|
1543
1587
|
const { children, formControl, identifier, rlsTheme } = props;
|
|
1544
1588
|
const disabled = useMemo(() => {
|
|
1545
1589
|
return formControl?.disabled || props.disabled;
|
|
@@ -1554,8 +1598,9 @@ function RlsFieldArea(props) {
|
|
|
1554
1598
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1555
1599
|
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(RlsAreaText, { ...props }) }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1556
1600
|
}
|
|
1601
|
+
const RlsFieldArea = memo(RlsFieldAreaComponent);
|
|
1557
1602
|
|
|
1558
|
-
function
|
|
1603
|
+
function RlsFieldDecimalComponent(props) {
|
|
1559
1604
|
const { children, formControl, identifier, rlsTheme } = props;
|
|
1560
1605
|
const disabled = useMemo(() => {
|
|
1561
1606
|
return formControl?.disabled || props.disabled;
|
|
@@ -1570,8 +1615,9 @@ function RlsFieldDecimal(props) {
|
|
|
1570
1615
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1571
1616
|
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 }))] }));
|
|
1572
1617
|
}
|
|
1618
|
+
const RlsFieldDecimal = memo(RlsFieldDecimalComponent);
|
|
1573
1619
|
|
|
1574
|
-
function
|
|
1620
|
+
function RlsFieldFileComponent({ accept, children, disabled: _disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value }) {
|
|
1575
1621
|
const inputRef = useRef(null);
|
|
1576
1622
|
const disabled = useMemo(() => formControl?.disabled || _disabled, [formControl?.disabled, _disabled]);
|
|
1577
1623
|
const className = useMemo(() => renderClassStatus('rls-field-box', {
|
|
@@ -1609,6 +1655,7 @@ function RlsFieldFile({ accept, children, disabled: _disabled, formControl, iden
|
|
|
1609
1655
|
}, [readOnly, disabled]);
|
|
1610
1656
|
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', disabled: disabled, onClick: onClickAction })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1611
1657
|
}
|
|
1658
|
+
const RlsFieldFile = memo(RlsFieldFileComponent);
|
|
1612
1659
|
|
|
1613
1660
|
const reactI18n = i18n({
|
|
1614
1661
|
es: {
|
|
@@ -1646,7 +1693,7 @@ function RlsFieldListLi({ element, onClickElement, onKeydownElement, render }) {
|
|
|
1646
1693
|
}, [element, onKeydownElement]);
|
|
1647
1694
|
return (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: onClick, onKeyDown: onKeyDown, children: render(element) }));
|
|
1648
1695
|
}
|
|
1649
|
-
function
|
|
1696
|
+
function RlsFieldListSuggestionsComponent({ elements, action, disabled, higher, render, renderEmpty, searchControl, visible, onClickBackdrop, onClickElement, onKeydownElement, refList, rlsTheme }) {
|
|
1650
1697
|
const [labels, setLabels] = useState({
|
|
1651
1698
|
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
1652
1699
|
listEmptyTitle: reactI18n('listEmptyTitle')
|
|
@@ -1678,8 +1725,9 @@ function RlsFieldListSuggestions({ elements, action, disabled, higher, render, r
|
|
|
1678
1725
|
const searching = searchControl?.searching ?? false;
|
|
1679
1726
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("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(RlsFieldListLi, { element: element, onClickElement: onClickElement, onKeydownElement: onKeydownElement, render: render }, 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("span", { className: "rls-label-font-bold rls-truncate", children: labels.listEmptyTitle }), jsxRuntimeExports.jsx("p", { className: "rls-caption-font-regular", children: labels.listEmptyDescription })] })) }))] }), action && (jsxRuntimeExports.jsx("div", { className: "rls-field-list__action", children: jsxRuntimeExports.jsxs("button", { type: "button", disabled: disabled || action.disabled, onClick: onClickAction, children: [action.icon && jsxRuntimeExports.jsx(RlsIcon, { value: action.icon }), jsxRuntimeExports.jsx("span", { className: "rls-field-list__action__description", children: action.description })] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: onClickBackdrop })] }));
|
|
1680
1727
|
}
|
|
1728
|
+
const RlsFieldListSuggestions = memo(RlsFieldListSuggestionsComponent);
|
|
1681
1729
|
|
|
1682
|
-
function
|
|
1730
|
+
function RlsFieldMoneyComponent(props) {
|
|
1683
1731
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1684
1732
|
const disabled = useMemo(() => {
|
|
1685
1733
|
return formControl?.disabled || props.disabled;
|
|
@@ -1694,8 +1742,9 @@ function RlsFieldMoney(props) {
|
|
|
1694
1742
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1695
1743
|
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.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputMoney, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1696
1744
|
}
|
|
1745
|
+
const RlsFieldMoney = memo(RlsFieldMoneyComponent);
|
|
1697
1746
|
|
|
1698
|
-
function
|
|
1747
|
+
function RlsFieldNumberComponent(props) {
|
|
1699
1748
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1700
1749
|
const disabled = useMemo(() => {
|
|
1701
1750
|
return formControl?.disabled || props.disabled;
|
|
@@ -1710,8 +1759,9 @@ function RlsFieldNumber(props) {
|
|
|
1710
1759
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1711
1760
|
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.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputNumber, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1712
1761
|
}
|
|
1762
|
+
const RlsFieldNumber = memo(RlsFieldNumberComponent);
|
|
1713
1763
|
|
|
1714
|
-
function
|
|
1764
|
+
function RlsFieldPasswordComponent(props) {
|
|
1715
1765
|
const { children, formControl, identifier, rlsTheme } = props;
|
|
1716
1766
|
const [passwordIsActive, setPasswordIsActive] = useState(true);
|
|
1717
1767
|
const disabled = useMemo(() => {
|
|
@@ -1730,8 +1780,9 @@ function RlsFieldPassword(props) {
|
|
|
1730
1780
|
}, []);
|
|
1731
1781
|
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.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputPassword, { ...props, type: passwordIsActive ? 'password' : 'text' }), jsxRuntimeExports.jsx(RlsButtonAction, { icon: passwordIsActive ? 'eye' : 'eye-off', onClick: onTogglePassword })] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1732
1782
|
}
|
|
1783
|
+
const RlsFieldPassword = memo(RlsFieldPasswordComponent);
|
|
1733
1784
|
|
|
1734
|
-
function
|
|
1785
|
+
function RlsFieldPercentageComponent(props) {
|
|
1735
1786
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1736
1787
|
const disabled = useMemo(() => {
|
|
1737
1788
|
return formControl?.disabled || props.disabled;
|
|
@@ -1746,12 +1797,14 @@ function RlsFieldPercentage(props) {
|
|
|
1746
1797
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1747
1798
|
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.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputPercentage, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1748
1799
|
}
|
|
1800
|
+
const RlsFieldPercentage = memo(RlsFieldPercentageComponent);
|
|
1749
1801
|
|
|
1750
|
-
function
|
|
1802
|
+
function RlsFieldReadonlyComponent({ children, identifier, rlsTheme, value }) {
|
|
1751
1803
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-readonly rls-field-box", "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("input", { className: "rls-input__component", autoComplete: "off", type: 'text', readOnly: true, value: value }) }) })] }));
|
|
1752
1804
|
}
|
|
1805
|
+
const RlsFieldReadonly = memo(RlsFieldReadonlyComponent);
|
|
1753
1806
|
|
|
1754
|
-
function
|
|
1807
|
+
function RlsFieldTextComponent(props) {
|
|
1755
1808
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1756
1809
|
const disabled = useMemo(() => {
|
|
1757
1810
|
return formControl?.disabled || props.disabled;
|
|
@@ -1766,6 +1819,7 @@ function RlsFieldText(props) {
|
|
|
1766
1819
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1767
1820
|
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.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputText, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1768
1821
|
}
|
|
1822
|
+
const RlsFieldText = memo(RlsFieldTextComponent);
|
|
1769
1823
|
|
|
1770
1824
|
function useFormToggleController({ disabled, formControl }) {
|
|
1771
1825
|
const [checked, setChecked] = useState(!!formControl?.value);
|
|
@@ -1787,7 +1841,7 @@ function useFormToggleController({ disabled, formControl }) {
|
|
|
1787
1841
|
return { checked, onToggle };
|
|
1788
1842
|
}
|
|
1789
1843
|
|
|
1790
|
-
function
|
|
1844
|
+
function RlsLabelCheckBoxComponent({ children, disabled, extended, identifier, formControl, reverse, rlsTheme }) {
|
|
1791
1845
|
const { checked, onToggle } = useFormToggleController({
|
|
1792
1846
|
disabled,
|
|
1793
1847
|
formControl
|
|
@@ -1801,8 +1855,9 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
|
|
|
1801
1855
|
}, [disabled, extended, reverse]);
|
|
1802
1856
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__text", children: children })] }));
|
|
1803
1857
|
}
|
|
1858
|
+
const RlsLabelCheckBox = memo(RlsLabelCheckBoxComponent);
|
|
1804
1859
|
|
|
1805
|
-
function
|
|
1860
|
+
function RlsLabelRadioButtonComponent({ children, disabled, extended, identifier, formControl, onValue, reverse, rlsTheme, value }) {
|
|
1806
1861
|
const { checked, onSelect } = useFormSingleSelectionController({
|
|
1807
1862
|
disabled,
|
|
1808
1863
|
formControl,
|
|
@@ -1818,8 +1873,9 @@ function RlsLabelRadioButton({ children, disabled, extended, identifier, formCon
|
|
|
1818
1873
|
}, [disabled, extended, reverse]);
|
|
1819
1874
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__component", onClick: onSelect, children: jsxRuntimeExports.jsx(RlsRadioButton, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__text", children: children })] }));
|
|
1820
1875
|
}
|
|
1876
|
+
const RlsLabelRadioButton = memo(RlsLabelRadioButtonComponent);
|
|
1821
1877
|
|
|
1822
|
-
function
|
|
1878
|
+
function RlsLabelSwitchComponent({ capsule, children, disabled, extended, identifier, formControl, reverse, rlsTheme }) {
|
|
1823
1879
|
const { checked, onToggle } = useFormToggleController({
|
|
1824
1880
|
disabled,
|
|
1825
1881
|
formControl
|
|
@@ -1833,8 +1889,9 @@ function RlsLabelSwitch({ capsule, children, disabled, extended, identifier, for
|
|
|
1833
1889
|
}, [disabled, extended, reverse]);
|
|
1834
1890
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-switch__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsSwitch, { checked: checked, capsule: capsule, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-switch__text", children: children })] }));
|
|
1835
1891
|
}
|
|
1892
|
+
const RlsLabelSwitch = memo(RlsLabelSwitchComponent);
|
|
1836
1893
|
|
|
1837
|
-
function
|
|
1894
|
+
function RlsMessageEmptyComponent({ children, className, emoji, icon, identifier, image, rlsTheme, title }) {
|
|
1838
1895
|
const classNameMessageEmpty = useMemo(() => {
|
|
1839
1896
|
return renderClassStatus('rls-message-empty', {}, className);
|
|
1840
1897
|
}, [className]);
|
|
@@ -1852,10 +1909,12 @@ function RlsMessageEmpty({ children, className, emoji, icon, identifier, image,
|
|
|
1852
1909
|
}, [icon, emoji, image]);
|
|
1853
1910
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: classNameMessageEmpty, "rls-theme": rlsTheme, children: [logo, jsxRuntimeExports.jsxs("div", { className: "rls-message-empty__body", children: [title && jsxRuntimeExports.jsx("div", { className: "rls-message-empty__title", children: title }), children && (jsxRuntimeExports.jsx("div", { className: "rls-message-empty__content", children: children }))] })] }));
|
|
1854
1911
|
}
|
|
1912
|
+
const RlsMessageEmpty = memo(RlsMessageEmptyComponent);
|
|
1855
1913
|
|
|
1856
|
-
function
|
|
1914
|
+
function RlsNavbarComponent({ children, identifier, rlsTheme }) {
|
|
1857
1915
|
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" })] }));
|
|
1858
1916
|
}
|
|
1917
|
+
const RlsNavbar = memo(RlsNavbarComponent);
|
|
1859
1918
|
|
|
1860
1919
|
function RlsNavbarMenuOption({ option, onOption }) {
|
|
1861
1920
|
const onClick = useCallback(() => {
|
|
@@ -1863,9 +1922,10 @@ function RlsNavbarMenuOption({ option, onOption }) {
|
|
|
1863
1922
|
}, [onOption]);
|
|
1864
1923
|
return (jsxRuntimeExports.jsxs("li", { className: "rls-app__page__nav__option", onClick: onClick, children: [jsxRuntimeExports.jsx(RlsIcon, { value: option.icon }), jsxRuntimeExports.jsx("span", { className: "rls-label-font", children: option.label })] }));
|
|
1865
1924
|
}
|
|
1866
|
-
function
|
|
1925
|
+
function RlsNavbarMenuComponent({ options, onOption }) {
|
|
1867
1926
|
return (jsxRuntimeExports.jsx("ul", { className: "rls-app__page__nav__menu", children: options.map((option) => (jsxRuntimeExports.jsx(RlsNavbarMenuOption, { option: option, onOption: onOption }, option.id))) }));
|
|
1868
1927
|
}
|
|
1928
|
+
const RlsNavbarMenu = memo(RlsNavbarMenuComponent);
|
|
1869
1929
|
|
|
1870
1930
|
function PageButton({ page, onSelect }) {
|
|
1871
1931
|
const className = useMemo(() => renderClassStatus('rls-pagination__page', { active: page.active }), [page.active]);
|
|
@@ -1874,7 +1934,7 @@ function PageButton({ page, onSelect }) {
|
|
|
1874
1934
|
}, [page, onSelect]);
|
|
1875
1935
|
return (jsxRuntimeExports.jsx("button", { type: "button", className: className, onClick: onClick, children: page.label }));
|
|
1876
1936
|
}
|
|
1877
|
-
function
|
|
1937
|
+
function RlsPaginationComponent({ suggestions, count, filter, onPagination }) {
|
|
1878
1938
|
const [template, setTemplate] = useState();
|
|
1879
1939
|
const controller = useRef(undefined);
|
|
1880
1940
|
const refreshTemplate = useCallback((template, suggestions) => {
|
|
@@ -1916,6 +1976,7 @@ function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
|
1916
1976
|
}, [refreshPagination]);
|
|
1917
1977
|
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" }) })] })] }));
|
|
1918
1978
|
}
|
|
1979
|
+
const RlsPagination = memo(RlsPaginationComponent);
|
|
1919
1980
|
|
|
1920
1981
|
function RlsPickerDayHeaders() {
|
|
1921
1982
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("span", { className: "rls-picker-day__label", children: title }, index))) }));
|
|
@@ -1937,7 +1998,7 @@ function RlsPickerDayElement({ day, onSelect, disabled }) {
|
|
|
1937
1998
|
}, [day.value, day.disabled, disabled, onSelect]);
|
|
1938
1999
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day__element__span", children: day.value || '??' }) }));
|
|
1939
2000
|
}
|
|
1940
|
-
function
|
|
2001
|
+
function RlsPickerDayComponent({ date, disabled, formControl, maxDate, month, minDate, onValue, rlsTheme, year }) {
|
|
1941
2002
|
const dateDay = useMemo(() => date ?? new Date(), [date]);
|
|
1942
2003
|
const [weeks, setWeeks] = useState([]);
|
|
1943
2004
|
const [value, setValue] = useState(formControl?.value ?? dateDay.getDate());
|
|
@@ -1990,6 +2051,7 @@ function RlsPickerDay({ date, disabled, formControl, maxDate, month, minDate, on
|
|
|
1990
2051
|
}, [dateDay, formControl?.value, value, month, year, minDate, maxDate]);
|
|
1991
2052
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx(RlsPickerDayHeaders, {}), jsxRuntimeExports.jsx("div", { className: "rls-picker-day__component", children: weeks.map(({ days }, index) => (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__week", children: days.map((day, index) => (jsxRuntimeExports.jsx(RlsPickerDayElement, { day: day, onSelect: onSelect, disabled: disabled }, index))) }, index))) })] }));
|
|
1992
2053
|
}
|
|
2054
|
+
const RlsPickerDay = memo(RlsPickerDayComponent);
|
|
1993
2055
|
|
|
1994
2056
|
function RlsPickerDayRangeHeaders() {
|
|
1995
2057
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("span", { className: "rls-picker-day__label", children: title }, index))) }));
|
|
@@ -2011,7 +2073,7 @@ function RlsPickerDayRangeElement({ day, onSelect, disabled }) {
|
|
|
2011
2073
|
}, [day.value, day.disabled, disabled, onSelect]);
|
|
2012
2074
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day-range__element__span", children: day.value || '??' }) }));
|
|
2013
2075
|
}
|
|
2014
|
-
function
|
|
2076
|
+
function RlsPickerDayRangeComponent({ date, disabled, formControl, maxDate, minDate, rlsTheme }) {
|
|
2015
2077
|
const rangeDay = useMemo(() => {
|
|
2016
2078
|
return formControl?.value ?? DateRange.now();
|
|
2017
2079
|
}, [formControl?.value]);
|
|
@@ -2047,6 +2109,7 @@ function RlsPickerDayRange({ date, disabled, formControl, maxDate, minDate, rlsT
|
|
|
2047
2109
|
}, [dateDayRange, range, minDate, maxDate]);
|
|
2048
2110
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx(RlsPickerDayRangeHeaders, {}), jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__component", children: weeks.map(({ days }, index) => (jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__week", children: days.map((day, index) => (jsxRuntimeExports.jsx(RlsPickerDayRangeElement, { day: day, onSelect: onSelect, disabled: disabled }, index))) }, index))) })] }));
|
|
2049
2111
|
}
|
|
2112
|
+
const RlsPickerDayRange = memo(RlsPickerDayRangeComponent);
|
|
2050
2113
|
|
|
2051
2114
|
function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
2052
2115
|
const [label, setLabel] = useState(MONTH_NAMES(month.value));
|
|
@@ -2069,7 +2132,7 @@ function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
|
2069
2132
|
}, [month.value, month.disabled, disabled, onSelect]);
|
|
2070
2133
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-month__span", children: label }) }));
|
|
2071
2134
|
}
|
|
2072
|
-
function
|
|
2135
|
+
function RlsPickerMonthComponent({ date, disabled, formControl, maxDate, minDate, onValue, rlsTheme, year }) {
|
|
2073
2136
|
const dateMonth = useMemo(() => date ?? new Date(), [date]);
|
|
2074
2137
|
const [months, setMonths] = useState([]);
|
|
2075
2138
|
const [value, setValue] = useState(formControl?.value ?? dateMonth.getMonth());
|
|
@@ -2118,8 +2181,9 @@ function RlsPickerMonth({ date, disabled, formControl, maxDate, minDate, onValue
|
|
|
2118
2181
|
}, [formControl?.value]);
|
|
2119
2182
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-month", "rls-theme": rlsTheme, children: months.map((month, index) => (jsxRuntimeExports.jsx(RlsPickerMonthElement, { month: month, onSelect: onSelect, disabled: disabled }, index))) }));
|
|
2120
2183
|
}
|
|
2184
|
+
const RlsPickerMonth = memo(RlsPickerMonthComponent);
|
|
2121
2185
|
|
|
2122
|
-
function
|
|
2186
|
+
function RlsPickerSelectorTitleComponent({ monthControl, type, yearControl, date, disabled, maxDate, minDate, onClick }) {
|
|
2123
2187
|
const { limitNext, limitPrevious } = useMemo(() => {
|
|
2124
2188
|
return monthLimitTemplate({
|
|
2125
2189
|
date,
|
|
@@ -2195,6 +2259,7 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
|
|
|
2195
2259
|
}, [type, onNextMonth, onNextYear]);
|
|
2196
2260
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-selector-title", children: [jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-left", onClick: onPrevious, disabled: limitPrevious || disabled }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-selector-title__label", children: [jsxRuntimeExports.jsxs("span", { onClick: onMonth, children: [label, ","] }), jsxRuntimeExports.jsx("span", { onClick: onYear, children: yearControl.value })] }), jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-right", onClick: onNext, disabled: limitNext || disabled })] }));
|
|
2197
2261
|
}
|
|
2262
|
+
const RlsPickerSelectorTitle = memo(RlsPickerSelectorTitleComponent);
|
|
2198
2263
|
|
|
2199
2264
|
function RlsPickerYearElement({ onSelect, year, disabled }) {
|
|
2200
2265
|
const className = useMemo(() => {
|
|
@@ -2211,7 +2276,7 @@ function RlsPickerYearElement({ onSelect, year, disabled }) {
|
|
|
2211
2276
|
}, [year.value, year.disabled, disabled, onSelect]);
|
|
2212
2277
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-year__span", children: year.value || '????' }) }));
|
|
2213
2278
|
}
|
|
2214
|
-
function
|
|
2279
|
+
function RlsPickerYearComponent({ date, disabled, formControl, maxDate, minDate, onValue, rlsTheme }) {
|
|
2215
2280
|
const dateYear = useMemo(() => date ?? new Date(), [date]);
|
|
2216
2281
|
const [year, setYear] = useState(formControl?.value ?? dateYear.getFullYear());
|
|
2217
2282
|
const createPickerOptions = useCallback(() => {
|
|
@@ -2256,6 +2321,7 @@ function RlsPickerYear({ date, disabled, formControl, maxDate, minDate, onValue,
|
|
|
2256
2321
|
}, []);
|
|
2257
2322
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-year", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-year__header", children: [jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-left", onClick: onClickPrev, disabled: !template.canPrevious || disabled }), jsxRuntimeExports.jsxs("span", { children: [template.minRange, " - ", template.maxRange] }), jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-right", onClick: onClickNext, disabled: !template.canNext || disabled })] }), jsxRuntimeExports.jsx("div", { className: "rls-picker-year__component", children: template.years.map((year, index) => (jsxRuntimeExports.jsx(RlsPickerYearElement, { year: year, onSelect: onSelect, disabled: disabled }, index))) })] }));
|
|
2258
2323
|
}
|
|
2324
|
+
const RlsPickerYear = memo(RlsPickerYearComponent);
|
|
2259
2325
|
|
|
2260
2326
|
function calculateInitialValue(value, minValue, maxValue) {
|
|
2261
2327
|
return minValue > value ? minValue : maxValue < value ? maxValue : value;
|
|
@@ -2265,7 +2331,7 @@ function calculateInitialRate(value, minValue, maxValue) {
|
|
|
2265
2331
|
const rateValue = value - minValue;
|
|
2266
2332
|
return Math.ceil((rateValue / rateMax) * 100);
|
|
2267
2333
|
}
|
|
2268
|
-
function
|
|
2334
|
+
function RlsSliderComponent({ children, className, disabled, formControl, identifier, maxValue, minValue, onValue, prefixIcon, rlsTheme, value }) {
|
|
2269
2335
|
const minValueSlider = useMemo(() => {
|
|
2270
2336
|
return minValue ?? 0;
|
|
2271
2337
|
}, [minValue]);
|
|
@@ -2311,6 +2377,7 @@ function RlsSlider({ children, className, disabled, formControl, identifier, max
|
|
|
2311
2377
|
}, [minValueSlider, maxValueSlider]);
|
|
2312
2378
|
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, "%"] })] })] })] }));
|
|
2313
2379
|
}
|
|
2380
|
+
const RlsSlider = memo(RlsSliderComponent);
|
|
2314
2381
|
|
|
2315
2382
|
function RlsTab({ onSelect, tab, value }) {
|
|
2316
2383
|
const className = useMemo(() => {
|
|
@@ -2326,7 +2393,7 @@ function RlsTab({ onSelect, tab, value }) {
|
|
|
2326
2393
|
}, [tab.disabled]);
|
|
2327
2394
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { children: tab.label }) }));
|
|
2328
2395
|
}
|
|
2329
|
-
function
|
|
2396
|
+
function RlsTabsComponent({ tabs, onValue, rlsTheme }) {
|
|
2330
2397
|
const [value, setValue] = useState();
|
|
2331
2398
|
const onSelect = useCallback((value) => {
|
|
2332
2399
|
setValue(value);
|
|
@@ -2342,12 +2409,14 @@ function RlsTabs({ tabs, onValue, rlsTheme }) {
|
|
|
2342
2409
|
return (jsxRuntimeExports.jsx(RlsTab, { tab: tab, value: value, onSelect: onSelect }, index));
|
|
2343
2410
|
}) }));
|
|
2344
2411
|
}
|
|
2412
|
+
const RlsTabs = memo(RlsTabsComponent);
|
|
2345
2413
|
|
|
2346
|
-
function
|
|
2414
|
+
function RlsToolbarComponent({ actions, children, subtitle }) {
|
|
2347
2415
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-toolbar", children: [jsxRuntimeExports.jsxs("div", { className: "rls-toolbar__description", children: [children && jsxRuntimeExports.jsx("label", { className: "rls-toolbar__title", children: children }), subtitle && (jsxRuntimeExports.jsx("label", { className: "rls-toolbar__subtitle smalltext-semibold", children: subtitle }))] }), actions && (jsxRuntimeExports.jsx("div", { className: "rls-toolbar__actions", children: actions.map((action, index) => (jsxRuntimeExports.jsx("div", { children: action }, index))) }))] }));
|
|
2348
2416
|
}
|
|
2417
|
+
const RlsToolbar = memo(RlsToolbarComponent);
|
|
2349
2418
|
|
|
2350
|
-
function
|
|
2419
|
+
function RlsBottomSheetComponent({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2351
2420
|
const classNameSheet = useMemo(() => {
|
|
2352
2421
|
return renderClassStatus('rls-bottom-sheet', { visible: controller?.visible ?? visible }, className);
|
|
2353
2422
|
}, [className, visible, controller?.visible]);
|
|
@@ -2359,13 +2428,15 @@ function RlsBottomSheet({ autoclose, children, className, controller, onBackdrop
|
|
|
2359
2428
|
}, [autoclose, controller, onBackdrop]);
|
|
2360
2429
|
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameSheet, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-bottom-sheet__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-bottom-sheet__backdrop", onClick: onClickBackdrop })] }), document.body);
|
|
2361
2430
|
}
|
|
2431
|
+
const RlsBottomSheet = memo(RlsBottomSheetComponent);
|
|
2362
2432
|
|
|
2363
|
-
function
|
|
2433
|
+
function RlsCardComponent({ children, className, outline, rlsTheme }) {
|
|
2364
2434
|
const classNameCard = useMemo(() => {
|
|
2365
2435
|
return renderClassStatus('rls-card', { outline }, className);
|
|
2366
2436
|
}, [outline, className]);
|
|
2367
2437
|
return (jsxRuntimeExports.jsx("div", { className: classNameCard, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-card__content", children: children }) }));
|
|
2368
2438
|
}
|
|
2439
|
+
const RlsCard = memo(RlsCardComponent);
|
|
2369
2440
|
|
|
2370
2441
|
class ConfirmationResult extends SealedPartial {
|
|
2371
2442
|
static approved() {
|
|
@@ -2375,12 +2446,13 @@ class ConfirmationResult extends SealedPartial {
|
|
|
2375
2446
|
return new ConfirmationResult('reject');
|
|
2376
2447
|
}
|
|
2377
2448
|
}
|
|
2378
|
-
function
|
|
2449
|
+
function RlsConfirmationComponent({ approved, className, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
2379
2450
|
const classConfirmation = useMemo(() => {
|
|
2380
2451
|
return renderClassStatus('rls-confirmation', { visible }, className);
|
|
2381
2452
|
}, [visible, className]);
|
|
2382
2453
|
return (jsxRuntimeExports.jsxs("div", { className: classConfirmation, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__header", children: [title && jsxRuntimeExports.jsx("div", { className: "rls-confirmation__title", children: title }), subtitle && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__subtitle", children: subtitle }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__body", children: content && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__content", children: content })) }), (approved || reject) && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__actions", children: [approved && (jsxRuntimeExports.jsx(RlsButton, { identifier: approved.identifier, type: approved.type, onClick: approved.onClick, disabled: approved.disabled, rlsTheme: approved.rlsTheme, children: approved.label })), reject && (jsxRuntimeExports.jsx(RlsButton, { identifier: reject.identifier, type: reject.type, onClick: reject.onClick, disabled: reject.disabled, rlsTheme: reject.rlsTheme, children: reject.label }))] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__backdrop" })] }));
|
|
2383
2454
|
}
|
|
2455
|
+
const RlsConfirmation = memo(RlsConfirmationComponent);
|
|
2384
2456
|
function useConfirmation() {
|
|
2385
2457
|
const [config, setConfig] = useState({});
|
|
2386
2458
|
const [visible, setVisible] = useState(false);
|
|
@@ -2446,7 +2518,7 @@ function useDatatable(table) {
|
|
|
2446
2518
|
return { refTable, scrolleable };
|
|
2447
2519
|
}
|
|
2448
2520
|
|
|
2449
|
-
function
|
|
2521
|
+
function RlsDatatableComponent({ children, footer, header, identifier, rlsTheme, resizable, summary, table, toolbar }) {
|
|
2450
2522
|
const datatable = useDatatable(table);
|
|
2451
2523
|
const className = useMemo(() => {
|
|
2452
2524
|
return renderClassStatus('rls-datatable', {
|
|
@@ -2456,53 +2528,62 @@ function RlsDatatable({ children, footer, header, identifier, rlsTheme, resizabl
|
|
|
2456
2528
|
}, [resizable, datatable.scrolleable]);
|
|
2457
2529
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [toolbar && jsxRuntimeExports.jsx("div", { className: "rls-datatable__toolbar", children: toolbar }), jsxRuntimeExports.jsx("div", { className: "rls-datatable__table", children: jsxRuntimeExports.jsxs("table", { id: identifier, children: [header && jsxRuntimeExports.jsx("thead", { className: "rls-datatable__head", children: header }), jsxRuntimeExports.jsx("tbody", { ref: datatable?.refTable, className: "rls-datatable__body", children: children })] }) }), summary && jsxRuntimeExports.jsx("div", { className: "rls-datatable__summary", children: summary }), footer && jsxRuntimeExports.jsx("div", { className: "rls-datatable__footer", children: footer })] }));
|
|
2458
2530
|
}
|
|
2459
|
-
|
|
2531
|
+
const RlsDatatable = memo(RlsDatatableComponent);
|
|
2532
|
+
function RlsDatatableHeaderComponent({ children, identifier, rlsTheme }) {
|
|
2460
2533
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: "rls-datatable__header", "rls-theme": rlsTheme, children: children }));
|
|
2461
2534
|
}
|
|
2462
|
-
|
|
2535
|
+
const RlsDatatableHeader = memo(RlsDatatableHeaderComponent);
|
|
2536
|
+
function RlsDatatableTitleComponent({ actions, children, className, control, identifier, rlsTheme, truncated }) {
|
|
2463
2537
|
const classNameTitle = useMemo(() => {
|
|
2464
|
-
return renderClassStatus('rls-datatable__title', {
|
|
2465
|
-
}, [className, truncated, control]);
|
|
2538
|
+
return renderClassStatus('rls-datatable__title', { actions, control, truncated }, className);
|
|
2539
|
+
}, [className, truncated, control, actions]);
|
|
2466
2540
|
return (jsxRuntimeExports.jsx("th", { id: identifier, className: classNameTitle, "rls-theme": rlsTheme, children: children }));
|
|
2467
2541
|
}
|
|
2468
|
-
|
|
2542
|
+
const RlsDatatableTitle = memo(RlsDatatableTitleComponent);
|
|
2543
|
+
function RlsDatatableSubheaderComponent({ children, className, identifier, rlsTheme }) {
|
|
2469
2544
|
const classNameSubheader = useMemo(() => {
|
|
2470
2545
|
return renderClassStatus('rls-datatable__subheader', {}, className);
|
|
2471
2546
|
}, [className]);
|
|
2472
2547
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameSubheader, "rls-theme": rlsTheme, children: children }));
|
|
2473
2548
|
}
|
|
2474
|
-
|
|
2549
|
+
const RlsDatatableSubheader = memo(RlsDatatableSubheaderComponent);
|
|
2550
|
+
function RlsDatatableRecordComponent({ children, className, error, identifier, info, rlsTheme, success, truncated, warning }) {
|
|
2475
2551
|
const classNameRecord = useMemo(() => {
|
|
2476
2552
|
return renderClassStatus('rls-datatable__record', { error, info, truncated, success, warning }, className);
|
|
2477
2553
|
}, [className, truncated, error, info, success, warning]);
|
|
2478
2554
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameRecord, "rls-theme": rlsTheme, children: children }));
|
|
2479
2555
|
}
|
|
2480
|
-
|
|
2556
|
+
const RlsDatatableRecord = memo(RlsDatatableRecordComponent);
|
|
2557
|
+
function RlsDatatableTotalsComponent({ children, className, error, identifier, info, rlsTheme, success, truncated, warning }) {
|
|
2481
2558
|
const classNameTotals = useMemo(() => {
|
|
2482
2559
|
return renderClassStatus('rls-datatable__totals', { error, info, truncated, success, warning }, className);
|
|
2483
2560
|
}, [className, truncated, error, info, success, warning]);
|
|
2484
2561
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameTotals, "rls-theme": rlsTheme, children: children }));
|
|
2485
2562
|
}
|
|
2486
|
-
|
|
2563
|
+
const RlsDatatableTotals = memo(RlsDatatableTotalsComponent);
|
|
2564
|
+
function RlsDatatableCellComponent({ actions, children, className, control, identifier, rlsTheme, truncated }) {
|
|
2487
2565
|
const classNameCell = useMemo(() => {
|
|
2488
|
-
return renderClassStatus('rls-datatable__cell', { control, truncated }, className);
|
|
2489
|
-
}, [className, truncated, control]);
|
|
2566
|
+
return renderClassStatus('rls-datatable__cell', { actions, control, truncated }, className);
|
|
2567
|
+
}, [className, truncated, control, actions]);
|
|
2490
2568
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameCell, "rls-theme": rlsTheme, children: children }));
|
|
2491
2569
|
}
|
|
2492
|
-
|
|
2570
|
+
const RlsDatatableCell = memo(RlsDatatableCellComponent);
|
|
2571
|
+
function RlsDatatableDataComponent({ actions, children, className, control, identifier, truncated }) {
|
|
2493
2572
|
const classNameData = useMemo(() => {
|
|
2494
|
-
return renderClassStatus('rls-datatable__data', { control, truncated }, className);
|
|
2495
|
-
}, [className, truncated, control]);
|
|
2573
|
+
return renderClassStatus('rls-datatable__data', { actions, control, truncated }, className);
|
|
2574
|
+
}, [className, truncated, control, actions]);
|
|
2496
2575
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameData, children: children }));
|
|
2497
2576
|
}
|
|
2498
|
-
|
|
2577
|
+
const RlsDatatableData = memo(RlsDatatableDataComponent);
|
|
2578
|
+
function RlsDatatableFloatingComponent({ children, className, identifier, invested, rlsTheme }) {
|
|
2499
2579
|
const classNameFloating = useMemo(() => {
|
|
2500
2580
|
return renderClassStatus('rls-datatable__floating', { invested }, className);
|
|
2501
2581
|
}, [className, invested]);
|
|
2502
2582
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameFloating, "rls-theme": rlsTheme, children: children }));
|
|
2503
2583
|
}
|
|
2584
|
+
const RlsDatatableFloating = memo(RlsDatatableFloatingComponent);
|
|
2504
2585
|
|
|
2505
|
-
function
|
|
2586
|
+
function RlsDropdownComponent({ children, controller, rlsTheme }) {
|
|
2506
2587
|
const className = useMemo(() => {
|
|
2507
2588
|
return renderClassStatus('rls-dropdown', {
|
|
2508
2589
|
visible: controller.visible
|
|
@@ -2521,6 +2602,7 @@ function RlsDropdown({ children, controller, rlsTheme }) {
|
|
|
2521
2602
|
}, []);
|
|
2522
2603
|
return (jsxRuntimeExports.jsx("div", { ref: controller.component, className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-dropdown__content", children: children }) }));
|
|
2523
2604
|
}
|
|
2605
|
+
const RlsDropdown = memo(RlsDropdownComponent);
|
|
2524
2606
|
|
|
2525
2607
|
const MAX_LIST_HEIGHT_REM$1 = 90;
|
|
2526
2608
|
const FALLBACK_REM_SIZE$1 = 16;
|
|
@@ -2531,6 +2613,17 @@ function getRemSize$1() {
|
|
|
2531
2613
|
const fontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
2532
2614
|
return fontSize > 0 ? fontSize : FALLBACK_REM_SIZE$1;
|
|
2533
2615
|
}
|
|
2616
|
+
function suggestionsShallowEqual(a, b) {
|
|
2617
|
+
return (a === b ||
|
|
2618
|
+
(a.length === b.length && a.every((element, index) => element === b[index])));
|
|
2619
|
+
}
|
|
2620
|
+
function useStableSuggestions(suggestions) {
|
|
2621
|
+
const suggestionsRef = useRef(suggestions);
|
|
2622
|
+
if (!suggestionsShallowEqual(suggestionsRef.current, suggestions)) {
|
|
2623
|
+
suggestionsRef.current = suggestions;
|
|
2624
|
+
}
|
|
2625
|
+
return suggestionsRef.current;
|
|
2626
|
+
}
|
|
2534
2627
|
function shouldDisplayHigher$1(content, list) {
|
|
2535
2628
|
if (!content) {
|
|
2536
2629
|
return false;
|
|
@@ -2548,13 +2641,13 @@ function shouldDisplayHigher$1(content, list) {
|
|
|
2548
2641
|
}
|
|
2549
2642
|
return spaceAbove > spaceBelow;
|
|
2550
2643
|
}
|
|
2551
|
-
function useListController(
|
|
2552
|
-
const { suggestions, automatic, formControl, reference } = props;
|
|
2644
|
+
function useListController({ suggestions, automatic, formControl, reference }) {
|
|
2553
2645
|
const refContent = useRef(null);
|
|
2554
2646
|
const refList = useRef(null);
|
|
2555
2647
|
const refInput = useRef(null);
|
|
2556
2648
|
const listIsOpen = useRef(false);
|
|
2557
|
-
const
|
|
2649
|
+
const stableSuggestions = useStableSuggestions(suggestions);
|
|
2650
|
+
const collection = useMemo(() => new ListCollection(stableSuggestions, reference), [stableSuggestions]);
|
|
2558
2651
|
const [state, refreshState] = useState({
|
|
2559
2652
|
focused: false,
|
|
2560
2653
|
higher: false,
|
|
@@ -2583,9 +2676,6 @@ function useListController(props) {
|
|
|
2583
2676
|
formControl?.touch();
|
|
2584
2677
|
}
|
|
2585
2678
|
}, [state.listIsVisible]);
|
|
2586
|
-
useEffect(() => {
|
|
2587
|
-
setCollection(new ListCollection(suggestions, reference));
|
|
2588
|
-
}, [suggestions]);
|
|
2589
2679
|
useEffect(() => {
|
|
2590
2680
|
if (!changeValueInternal.current) {
|
|
2591
2681
|
if (formControl?.value) {
|
|
@@ -2609,7 +2699,7 @@ function useListController(props) {
|
|
|
2609
2699
|
setFormValue(element);
|
|
2610
2700
|
}
|
|
2611
2701
|
else {
|
|
2612
|
-
refreshState({ ...state, value: '' });
|
|
2702
|
+
refreshState((state) => ({ ...state, value: '' }));
|
|
2613
2703
|
}
|
|
2614
2704
|
}
|
|
2615
2705
|
else {
|
|
@@ -2617,20 +2707,20 @@ function useListController(props) {
|
|
|
2617
2707
|
setFormValue(collection.value[0], true);
|
|
2618
2708
|
}
|
|
2619
2709
|
else {
|
|
2620
|
-
refreshState({ ...state, value: '' });
|
|
2710
|
+
refreshState((state) => ({ ...state, value: '' }));
|
|
2621
2711
|
}
|
|
2622
2712
|
}
|
|
2623
2713
|
}
|
|
2624
2714
|
changeValueInternal.current = false;
|
|
2625
2715
|
}, [collection, formControl?.value]);
|
|
2626
2716
|
const setState = useCallback((state) => {
|
|
2627
|
-
const
|
|
2717
|
+
const newState = state.listIsVisible
|
|
2628
2718
|
? {
|
|
2629
2719
|
...state,
|
|
2630
2720
|
higher: shouldDisplayHigher$1(refContent.current, refList.current)
|
|
2631
2721
|
}
|
|
2632
2722
|
: state;
|
|
2633
|
-
refreshState((
|
|
2723
|
+
refreshState((currentState) => ({ ...currentState, ...newState }));
|
|
2634
2724
|
}, []);
|
|
2635
2725
|
const setFormValue = useCallback((element, valueIsDefault = false) => {
|
|
2636
2726
|
refreshState((state) => ({
|
|
@@ -2647,23 +2737,25 @@ function useListController(props) {
|
|
|
2647
2737
|
}, [formControl]);
|
|
2648
2738
|
const navigationInput = useCallback((event) => {
|
|
2649
2739
|
if (state.listIsVisible) {
|
|
2650
|
-
const
|
|
2740
|
+
const newPosition = navigationListFromInput({
|
|
2651
2741
|
content: refContent.current,
|
|
2652
2742
|
event: event,
|
|
2743
|
+
higher: state.higher,
|
|
2653
2744
|
list: refList.current
|
|
2654
2745
|
});
|
|
2655
|
-
position.current =
|
|
2746
|
+
position.current = newPosition ?? 0;
|
|
2656
2747
|
}
|
|
2657
|
-
}, [state.listIsVisible]);
|
|
2748
|
+
}, [state.listIsVisible, state.higher]);
|
|
2658
2749
|
const navigationElement = useCallback((event) => {
|
|
2659
2750
|
position.current = navigationListFromElement({
|
|
2660
2751
|
content: refContent.current,
|
|
2661
2752
|
event: event,
|
|
2753
|
+
higher: state.higher,
|
|
2662
2754
|
input: refInput.current,
|
|
2663
2755
|
list: refList.current,
|
|
2664
2756
|
position: position.current
|
|
2665
2757
|
});
|
|
2666
|
-
}, [state.
|
|
2758
|
+
}, [state.higher]);
|
|
2667
2759
|
return {
|
|
2668
2760
|
...state,
|
|
2669
2761
|
navigationElement,
|
|
@@ -2819,7 +2911,7 @@ function useFieldAutocomplete(props) {
|
|
|
2819
2911
|
};
|
|
2820
2912
|
}
|
|
2821
2913
|
|
|
2822
|
-
function
|
|
2914
|
+
function RlsFieldAutocompleteTemplateComponent(props) {
|
|
2823
2915
|
const autocomplete = useFieldAutocomplete(props);
|
|
2824
2916
|
const { render, action, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2825
2917
|
const [listInputPlaceholder, setListInputPlaceholder] = useState(reactI18n('listInputPlaceholder'));
|
|
@@ -2883,12 +2975,14 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2883
2975
|
]);
|
|
2884
2976
|
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(RlsButtonIcon, { icon: autocomplete.value ? 'trash-2' : 'arrow-ios-down', onClick: autocomplete.onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: autocomplete.coincidences, visible: autocomplete.listIsVisible, action: action, disabled: disabled, higher: autocomplete.higher, render: render, refList: autocomplete.refList, searchControl: searchControl, onClickElement: autocomplete.onClickElement, onKeydownElement: autocomplete.onKeydownElement, onClickBackdrop: autocomplete.onClickBackdrop })] }));
|
|
2885
2977
|
}
|
|
2886
|
-
|
|
2978
|
+
const RlsFieldAutocompleteTemplate = memo(RlsFieldAutocompleteTemplateComponent);
|
|
2979
|
+
function RlsFieldAutocompleteComponent(props) {
|
|
2887
2980
|
const render = 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 }) })), []);
|
|
2888
2981
|
return jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: render });
|
|
2889
2982
|
}
|
|
2983
|
+
const RlsFieldAutocomplete = memo(RlsFieldAutocompleteComponent);
|
|
2890
2984
|
|
|
2891
|
-
function
|
|
2985
|
+
function RlsModalComponent({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2892
2986
|
const classNameModal = useMemo(() => {
|
|
2893
2987
|
return renderClassStatus('rls-modal', { visible: controller?.visible ?? visible }, className);
|
|
2894
2988
|
}, [className, visible, controller?.visible]);
|
|
@@ -2900,6 +2994,7 @@ function RlsModal({ autoclose, children, className, controller, onBackdrop, visi
|
|
|
2900
2994
|
}, [autoclose, controller, onBackdrop]);
|
|
2901
2995
|
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameModal, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-modal__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-modal__backdrop", onClick: onClickBackdrop })] }), document.body);
|
|
2902
2996
|
}
|
|
2997
|
+
const RlsModal = memo(RlsModalComponent);
|
|
2903
2998
|
|
|
2904
2999
|
function formatTime(value) {
|
|
2905
3000
|
return String(value).padStart(2, '0');
|
|
@@ -2933,7 +3028,7 @@ function RlsPickerClockTick({ onValue, selectionIsHours, value }) {
|
|
|
2933
3028
|
}, [onValue]);
|
|
2934
3029
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__tick", style: styleTick, onClick: onClick, children: label }));
|
|
2935
3030
|
}
|
|
2936
|
-
function
|
|
3031
|
+
function RlsPickerClockComponent({ formControl, onListener, rlsTheme, time }) {
|
|
2937
3032
|
const timeInitial = useMemo(() => {
|
|
2938
3033
|
return formControl?.value ?? time ?? Time.now();
|
|
2939
3034
|
}, [formControl?.value, time]);
|
|
@@ -3120,16 +3215,18 @@ function RlsPickerClock({ formControl, onListener, rlsTheme, time }) {
|
|
|
3120
3215
|
return (jsxRuntimeExports.jsx(RlsPickerClockTick, { value: value, selectionIsHours: selectionIsHours, onValue: onClickValue }, value));
|
|
3121
3216
|
}) })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock__footer", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.timeActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "timer", onClick: onCurrentTime }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.timeActionSelect }) })] })] }));
|
|
3122
3217
|
}
|
|
3218
|
+
const RlsPickerClock = memo(RlsPickerClockComponent);
|
|
3123
3219
|
|
|
3124
|
-
function
|
|
3220
|
+
function RlsModalClockComponent({ controller, disabled, formControl, onClose, rlsTheme, time, visible }) {
|
|
3125
3221
|
const onListener = useCallback(({ event, value }) => {
|
|
3126
3222
|
onClose?.(event !== PickerListenerEvent.Cancel ? value : undefined);
|
|
3127
3223
|
controller?.close();
|
|
3128
3224
|
}, [onClose, controller]);
|
|
3129
3225
|
return (jsxRuntimeExports.jsx(RlsModal, { className: "rls-modal-clock", controller: controller, visible: visible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerClock, { formControl: formControl, time: time, disabled: disabled, onListener: onListener }) }));
|
|
3130
3226
|
}
|
|
3227
|
+
const RlsModalClock = memo(RlsModalClockComponent);
|
|
3131
3228
|
|
|
3132
|
-
function
|
|
3229
|
+
function RlsFieldClockComponent({ children, disabled: disabledProps, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, time, value: valueInitial }) {
|
|
3133
3230
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3134
3231
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3135
3232
|
const disabled = useMemo(() => {
|
|
@@ -3178,8 +3275,9 @@ function RlsFieldClock({ children, disabled: disabledProps, formControl, identif
|
|
|
3178
3275
|
}, [formControl, onChange]);
|
|
3179
3276
|
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(RlsButtonIcon, { icon: status.icon, onClick: onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalClock, { visible: modalIsVisible, time: time, disabled: disabled, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3180
3277
|
}
|
|
3278
|
+
const RlsFieldClock = memo(RlsFieldClockComponent);
|
|
3181
3279
|
|
|
3182
|
-
function
|
|
3280
|
+
function RlsPickerColorComponent({ color, formControl, onListener, rlsTheme }) {
|
|
3183
3281
|
const initialColor = useMemo(() => formControl?.value ?? color ?? DEFAULT_COLOR, []);
|
|
3184
3282
|
const initialHsv = useMemo(() => hexToHsv(initialColor) ?? { h: 258, s: 100, v: 100 }, []);
|
|
3185
3283
|
const canvasRef = useRef(null);
|
|
@@ -3389,8 +3487,9 @@ function RlsPickerColor({ color, formControl, onListener, rlsTheme }) {
|
|
|
3389
3487
|
top: indicatorPosition.top
|
|
3390
3488
|
}, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__indicator__circle", style: { backgroundColor: hexColor } }) }) }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__controls", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider", children: jsxRuntimeExports.jsx("div", { ref: hueRef, className: "rls-picker-color__slider__track", style: hueSliderStyle, "data-slider": "hue", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider__thumb", style: hueIndicatorStyle }) }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider", children: jsxRuntimeExports.jsx("div", { ref: alphaRef, className: "rls-picker-color__slider__track rls-picker-color__slider__track--alpha", style: alphaSliderStyle, "data-slider": "alpha", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider__thumb", style: alphaIndicatorStyle }) }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__hex", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__hex__swatch", style: { backgroundColor: hexColor } }), jsxRuntimeExports.jsx("span", { className: "rls-picker-color__hex__prefix", children: "#" }), jsxRuntimeExports.jsx("input", { className: "rls-picker-color__hex__input", type: "text", maxLength: 6, value: hexValue, onChange: onHexInputChange, onFocus: onHexFocus, onBlur: onHexBlur, onKeyDown: onHexKeyDown })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.colorActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.colorActionSelect }) })] })] }));
|
|
3391
3489
|
}
|
|
3490
|
+
const RlsPickerColor = memo(RlsPickerColorComponent);
|
|
3392
3491
|
|
|
3393
|
-
function
|
|
3492
|
+
function RlsFieldColorComponent({ children, color, disabled: disabledProps, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3394
3493
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3395
3494
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3396
3495
|
const colorValue = useMemo(() => {
|
|
@@ -3437,12 +3536,13 @@ function RlsFieldColor({ children, color, disabled: disabledProps, formControl,
|
|
|
3437
3536
|
}, [formControl, onChange]);
|
|
3438
3537
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-color", "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: [displayHex && (jsxRuntimeExports.jsx("div", { className: "rls-field-color__swatch", style: { backgroundColor: displayHex } })), jsxRuntimeExports.jsx("input", { className: "rls-field-color__control", type: "text", value: displayHex, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: colorValue ? 'trash-2' : 'color-palette', onClick: onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { className: "rls-field-color-modal", visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerColor, { formControl: formControl, color: color, disabled: disabled, onListener: onListener }) })] }));
|
|
3439
3538
|
}
|
|
3539
|
+
const RlsFieldColor = memo(RlsFieldColorComponent);
|
|
3440
3540
|
|
|
3441
3541
|
const DATE_FORMAT = '{dd}/{mx}/{yy}';
|
|
3442
3542
|
const DATE_FORMAT_TITLE = '{dw}, {mx} {dd} de {yy}';
|
|
3443
3543
|
const DATE_RANGE_FORMAT = '{dd}/{mx}/{yy}';
|
|
3444
3544
|
|
|
3445
|
-
function
|
|
3545
|
+
function RlsPickerDateComponent({ automatic, date, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
3446
3546
|
const today = useRef(new Date()); // Initial current date in component
|
|
3447
3547
|
const _date = useMemo(() => {
|
|
3448
3548
|
return formControl?.value ?? date ?? today.current;
|
|
@@ -3521,16 +3621,18 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
3521
3621
|
}, [formControl, value, onListener]);
|
|
3522
3622
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__header", children: [jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: 'month', onClick: onVisibilityTitle }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__title", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDay, { formControl: dayControl, date: value, month: monthControl.value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, date: value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), !automatic && (jsxRuntimeExports.jsx("div", { className: "rls-picker-date__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "calendar", onClick: onToday, disabled: itIsDisabledToday }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.dateActionSelect }) })] }) }))] }));
|
|
3523
3623
|
}
|
|
3624
|
+
const RlsPickerDate = memo(RlsPickerDateComponent);
|
|
3524
3625
|
|
|
3525
|
-
function
|
|
3626
|
+
function RlsModalDateComponent({ automatic, controller, date, disabled, formControl, maxDate, minDate, onClose, rlsTheme, visible }) {
|
|
3526
3627
|
const onListener = useCallback(({ event, value }) => {
|
|
3527
3628
|
onClose?.(event !== PickerListenerEvent.Cancel ? value : undefined);
|
|
3528
3629
|
controller?.close();
|
|
3529
3630
|
}, [onClose, controller]);
|
|
3530
3631
|
return (jsxRuntimeExports.jsx(RlsModal, { className: "rls-modal-date", controller: controller, visible: visible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerDate, { automatic: automatic, formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: onListener }) }));
|
|
3531
3632
|
}
|
|
3633
|
+
const RlsModalDate = memo(RlsModalDateComponent);
|
|
3532
3634
|
|
|
3533
|
-
function
|
|
3635
|
+
function RlsFieldDateComponent({ children, date, disabled: disabledProps, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3534
3636
|
const today = useRef(new Date()); // Initial current date in component
|
|
3535
3637
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3536
3638
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
@@ -3591,6 +3693,7 @@ function RlsFieldDate({ children, date, disabled: disabledProps, formControl, fo
|
|
|
3591
3693
|
}, [formControl, onChange]);
|
|
3592
3694
|
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.label, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalDate, { visible: modalIsVisible, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3593
3695
|
}
|
|
3696
|
+
const RlsFieldDate = memo(RlsFieldDateComponent);
|
|
3594
3697
|
|
|
3595
3698
|
function rangeFormatTemplate({ maxDate, minDate }) {
|
|
3596
3699
|
const minFormat = dateFormatTemplate(minDate, DATE_RANGE_FORMAT);
|
|
@@ -3598,7 +3701,7 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
3598
3701
|
return `${minFormat} - ${maxFormat}`;
|
|
3599
3702
|
}
|
|
3600
3703
|
|
|
3601
|
-
function
|
|
3704
|
+
function RlsPickerDateRangeComponent({ automatic, date: datePicker, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
3602
3705
|
const _date = useMemo(() => normalizeMinTime(datePicker ?? new Date()), [datePicker]);
|
|
3603
3706
|
const _range = useMemo(() => formControl?.value ?? DateRange.now(), [formControl?.value]);
|
|
3604
3707
|
const yearControl = useReactControl(_date.getFullYear());
|
|
@@ -3664,16 +3767,18 @@ function RlsPickerDateRange({ automatic, date: datePicker, disabled, formControl
|
|
|
3664
3767
|
}, [formControl, value, onListener]);
|
|
3665
3768
|
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 }) })] }) })] }));
|
|
3666
3769
|
}
|
|
3770
|
+
const RlsPickerDateRange = memo(RlsPickerDateRangeComponent);
|
|
3667
3771
|
|
|
3668
|
-
function
|
|
3772
|
+
function RlsModalDateRangeComponent({ automatic, controller, date, disabled, formControl, maxDate, minDate, onClose, rlsTheme, visible }) {
|
|
3669
3773
|
const onListener = useCallback(({ event, value }) => {
|
|
3670
3774
|
onClose?.(event !== PickerListenerEvent.Cancel ? value : undefined);
|
|
3671
3775
|
controller?.close();
|
|
3672
3776
|
}, [onClose, controller]);
|
|
3673
3777
|
return (jsxRuntimeExports.jsx(RlsModal, { className: "rls-modal-date-range", controller: controller, visible: visible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerDateRange, { automatic: automatic, formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: onListener }) }));
|
|
3674
3778
|
}
|
|
3779
|
+
const RlsModalDateRange = memo(RlsModalDateRangeComponent);
|
|
3675
3780
|
|
|
3676
|
-
function
|
|
3781
|
+
function RlsFieldDateRangeComponent({ children, date, disabled: disabledProps, formControl, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3677
3782
|
const currentDate = useMemo(() => date ?? new Date(), [date]);
|
|
3678
3783
|
const [value, setValue] = useState(formControl?.value || valueInitial);
|
|
3679
3784
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
@@ -3723,6 +3828,7 @@ function RlsFieldDateRange({ children, date, disabled: disabledProps, formContro
|
|
|
3723
3828
|
}, [formControl, onChange]);
|
|
3724
3829
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "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-range__control", type: "text", value: status.valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalDateRange, { visible: modalIsVisible, date: currentDate, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3725
3830
|
}
|
|
3831
|
+
const RlsFieldDateRange = memo(RlsFieldDateRangeComponent);
|
|
3726
3832
|
|
|
3727
3833
|
const MAX_LIST_HEIGHT_REM = 90;
|
|
3728
3834
|
const FALLBACK_REM_SIZE = 16;
|
|
@@ -3879,15 +3985,17 @@ function RlsFieldListInner({ render, suggestions, action, children, formControl,
|
|
|
3879
3985
|
const renderWithCheckbox = useCallback((element) => (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__multi__element", children: [jsxRuntimeExports.jsx(RlsCheckBox, { checked: fieldList.isSelected(element) }), render(element)] })), [fieldList.isSelected, render]);
|
|
3880
3986
|
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: fieldList.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("div", { className: "rls-field-list__multi__chips", onClick: disabled ? undefined : fieldList.onClickInput, children: !fieldList.selected.length && placeholder ? (jsxRuntimeExports.jsx("span", { className: "rls-field-list__multi__placeholder", children: placeholder })) : (fieldList.selected.map((item, index) => (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__multi__chip", children: [jsxRuntimeExports.jsx("span", { className: "rls-field-list__multi__chip__description", children: item.description }), !props.readOnly && (jsxRuntimeExports.jsx("button", { className: "rls-field-list__multi__chip__remove", onClick: fieldList.onRemoveElement(item), disabled: disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) }))] }, index)))) }), !props.readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-down", onClick: fieldList.onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: suggestions, visible: fieldList.listIsVisible, action: action, disabled: disabled, higher: fieldList.higher, render: renderWithCheckbox, refList: fieldList.refList, onClickElement: fieldList.onClickElement, onKeydownElement: fieldList.onKeydownElement, onClickBackdrop: fieldList.onClickBackdrop })] }));
|
|
3881
3987
|
}
|
|
3882
|
-
function
|
|
3988
|
+
function RlsFieldListTemplateComponent(props) {
|
|
3883
3989
|
const fieldList = useFieldList(props);
|
|
3884
3990
|
return jsxRuntimeExports.jsx(RlsFieldListInner, { ...props, fieldList: fieldList });
|
|
3885
3991
|
}
|
|
3886
|
-
|
|
3992
|
+
const RlsFieldListTemplate = memo(RlsFieldListTemplateComponent);
|
|
3993
|
+
function RlsFieldListComponent(props) {
|
|
3887
3994
|
const fieldList = useFieldList(props);
|
|
3888
3995
|
const render = 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 }) })), []);
|
|
3889
3996
|
return jsxRuntimeExports.jsx(RlsFieldListInner, { ...props, render: render, fieldList: fieldList });
|
|
3890
3997
|
}
|
|
3998
|
+
const RlsFieldList = memo(RlsFieldListComponent);
|
|
3891
3999
|
|
|
3892
4000
|
function useFieldSelect(props) {
|
|
3893
4001
|
const controller = useListController(props);
|
|
@@ -3997,7 +4105,7 @@ function useFieldSelect(props) {
|
|
|
3997
4105
|
};
|
|
3998
4106
|
}
|
|
3999
4107
|
|
|
4000
|
-
function
|
|
4108
|
+
function RlsFieldSelectTemplateComponent(props) {
|
|
4001
4109
|
const select = useFieldSelect(props);
|
|
4002
4110
|
const { render, suggestions, action, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
4003
4111
|
const disabled = useMemo(() => {
|
|
@@ -4019,17 +4127,20 @@ function RlsFieldSelectTemplate(props) {
|
|
|
4019
4127
|
]);
|
|
4020
4128
|
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(RlsButtonIcon, { icon: !unremovable && !!select.value ? 'close' : 'arrow-ios-down', onClick: select.onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: suggestions, visible: select.listIsVisible, action: action, disabled: disabled, higher: select.higher, render: render, refList: select.refList, onClickElement: select.onClickElement, onKeydownElement: select.onKeydownElement, onClickBackdrop: select.onClickBackdrop })] }));
|
|
4021
4129
|
}
|
|
4022
|
-
|
|
4130
|
+
const RlsFieldSelectTemplate = memo(RlsFieldSelectTemplateComponent);
|
|
4131
|
+
function RlsFieldSelectComponent(props) {
|
|
4023
4132
|
const render = 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 }) })), []);
|
|
4024
4133
|
return jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: render });
|
|
4025
4134
|
}
|
|
4135
|
+
const RlsFieldSelect = memo(RlsFieldSelectComponent);
|
|
4026
4136
|
|
|
4027
|
-
function
|
|
4137
|
+
function RlsFormNavigationComponent({ children, className, controller, visible, rlsTheme }) {
|
|
4028
4138
|
const classNameForm = useMemo(() => {
|
|
4029
4139
|
return renderClassStatus('rls-form-navigation', { visible: controller?.visible ?? visible }, className);
|
|
4030
4140
|
}, [className, visible, controller?.visible]);
|
|
4031
4141
|
return ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: classNameForm, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__component", children: children }) }), document.body);
|
|
4032
4142
|
}
|
|
4143
|
+
const RlsFormNavigation = memo(RlsFormNavigationComponent);
|
|
4033
4144
|
|
|
4034
4145
|
function useRelocationOnComponent({ container, element, onDrag }) {
|
|
4035
4146
|
const position = useRef({ x: 0, y: 0 });
|
|
@@ -4123,20 +4234,19 @@ function useRelocationOnComponent({ container, element, onDrag }) {
|
|
|
4123
4234
|
}, []);
|
|
4124
4235
|
}
|
|
4125
4236
|
|
|
4126
|
-
function useResize(
|
|
4127
|
-
const { refElement, onResize } = props;
|
|
4237
|
+
function useResize({ refElement, onResize }) {
|
|
4128
4238
|
const dimension = useRef({ height: 0, width: 0 });
|
|
4239
|
+
const onResizeRef = useRef(onResize);
|
|
4240
|
+
onResizeRef.current = onResize;
|
|
4129
4241
|
const observer = useCallback((entries) => {
|
|
4130
4242
|
const { height, width } = entries[0].contentRect;
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
});
|
|
4139
|
-
}
|
|
4243
|
+
onResizeRef.current?.({
|
|
4244
|
+
current: dimension.current,
|
|
4245
|
+
dimension: {
|
|
4246
|
+
height,
|
|
4247
|
+
width
|
|
4248
|
+
}
|
|
4249
|
+
});
|
|
4140
4250
|
dimension.current = { height, width };
|
|
4141
4251
|
}, []);
|
|
4142
4252
|
useEffect(() => {
|
|
@@ -4184,7 +4294,7 @@ function calculateImgDimension(image, dimension) {
|
|
|
4184
4294
|
height = simpleThreeRule(image.width, width, height);
|
|
4185
4295
|
return { height, width };
|
|
4186
4296
|
}
|
|
4187
|
-
function
|
|
4297
|
+
function RlsImageEditorComponent(props) {
|
|
4188
4298
|
const [selection, setSelection] = useState(props.selection ?? 60);
|
|
4189
4299
|
const [labels, setLabels] = useState({
|
|
4190
4300
|
actionRestore: reactI18n('editorImageActionRestore'),
|
|
@@ -4382,10 +4492,12 @@ function RlsImageEditor(props) {
|
|
|
4382
4492
|
}, []);
|
|
4383
4493
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-image-editor", children: [jsxRuntimeExports.jsx("div", { ref: refBody, className: "rls-image-editor__body", children: jsxRuntimeExports.jsxs("div", { ref: refImage, className: "rls-image-editor__body__image", children: [jsxRuntimeExports.jsx("div", { ref: refSelection, className: "rls-image-editor__body__selection" }), jsxRuntimeExports.jsx("div", { ref: refOverlayTop, className: "rls-image-editor__body__overlay--top" }), jsxRuntimeExports.jsx("div", { ref: refOverlayRight, className: "rls-image-editor__body__overlay--right" }), jsxRuntimeExports.jsx("div", { ref: refOverlayBottom, className: "rls-image-editor__body__overlay--bottom" }), jsxRuntimeExports.jsx("div", { ref: refOverlayLeft, className: "rls-image-editor__body__overlay--left" }), jsxRuntimeExports.jsx("canvas", { ref: refCanvas })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-image-editor__footer", children: [jsxRuntimeExports.jsx("div", { className: "rls-image-editor__sliders", children: jsxRuntimeExports.jsx(RlsSlider, { prefixIcon: "external-link", value: selection, minValue: MIN_SLIDER_VALUE, maxValue: MAX_SLIDER_VALUE, onValue: setSelection, disabled: props.disabled }) }), jsxRuntimeExports.jsxs("div", { className: "rls-image-editor__actions", children: [props.children, jsxRuntimeExports.jsx(RlsButton, { type: "flat", rlsTheme: "standard", prefixIcon: "refresh", onClick: onRestore, disabled: props.disabled, children: labels.actionRestore }), jsxRuntimeExports.jsx(RlsButton, { type: "raised", rlsTheme: "primary", prefixIcon: "crop", onClick: onCropImage, disabled: props.disabled, children: labels.actionSelect })] })] }), jsxRuntimeExports.jsx("canvas", { ref: refPicture })] }));
|
|
4384
4494
|
}
|
|
4495
|
+
const RlsImageEditor = memo(RlsImageEditorComponent);
|
|
4385
4496
|
|
|
4386
|
-
function
|
|
4497
|
+
function RlsImageEditorModalComponent(props) {
|
|
4387
4498
|
return (jsxRuntimeExports.jsx(RlsModal, { className: "rls-image-editor-modal", visible: props.visible, children: jsxRuntimeExports.jsx(RlsImageEditor, { ...props, children: props.children }) }));
|
|
4388
4499
|
}
|
|
4500
|
+
const RlsImageEditorModal = memo(RlsImageEditorModalComponent);
|
|
4389
4501
|
|
|
4390
4502
|
const MIME_TYPE_SUPPORTS = [
|
|
4391
4503
|
'image/png',
|
|
@@ -4456,7 +4568,7 @@ function useImageEditorController(options) {
|
|
|
4456
4568
|
return { onImageChooser, RlsImageEditorChooser };
|
|
4457
4569
|
}
|
|
4458
4570
|
|
|
4459
|
-
function
|
|
4571
|
+
function RlsImageChooserComponent(props) {
|
|
4460
4572
|
const [src, setSrc] = useState();
|
|
4461
4573
|
const onValue = useCallback((image) => {
|
|
4462
4574
|
setSrc(image.base64);
|
|
@@ -4470,8 +4582,9 @@ function RlsImageChooser(props) {
|
|
|
4470
4582
|
}, [props.src]);
|
|
4471
4583
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-image-chooser", children: [jsxRuntimeExports.jsx("div", { className: "rls-image-chooser__avatar", onClick: controller.onImageChooser, children: src && jsxRuntimeExports.jsx("img", { src: src }) }), controller.RlsImageEditorChooser] }));
|
|
4472
4584
|
}
|
|
4585
|
+
const RlsImageChooser = memo(RlsImageChooserComponent);
|
|
4473
4586
|
|
|
4474
|
-
function
|
|
4587
|
+
function RlsModalSheetComponent({ autoclose, children, className, controller, onAutoClose, visible, rlsTheme }) {
|
|
4475
4588
|
const classNameModal = useMemo(() => {
|
|
4476
4589
|
return renderClassStatus('rls-modal-sheet', { visible: controller?.visible ?? visible }, className);
|
|
4477
4590
|
}, [className, visible, controller?.visible]);
|
|
@@ -4483,6 +4596,7 @@ function RlsModalSheet({ autoclose, children, className, controller, onAutoClose
|
|
|
4483
4596
|
}, [autoclose, controller, onAutoClose]);
|
|
4484
4597
|
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);
|
|
4485
4598
|
}
|
|
4599
|
+
const RlsModalSheet = memo(RlsModalSheetComponent);
|
|
4486
4600
|
|
|
4487
4601
|
const DURATION_ANIMATION$1 = 240;
|
|
4488
4602
|
const DURATION_DEFAULT = 4000;
|
|
@@ -4553,12 +4667,13 @@ function calculateDuration({ length }) {
|
|
|
4553
4667
|
}
|
|
4554
4668
|
return duration + DURATION_RESET;
|
|
4555
4669
|
}
|
|
4556
|
-
function
|
|
4670
|
+
function RlsSnackbarComponent({ content, onClose, icon, rlsTheme, title, visible }) {
|
|
4557
4671
|
const className = useMemo(() => {
|
|
4558
4672
|
return renderClassStatus('rls-snackbar', { visible });
|
|
4559
4673
|
}, [visible]);
|
|
4560
4674
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-snackbar__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-snackbar__title", children: title }), jsxRuntimeExports.jsx("button", { onClick: onClose, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-snackbar__content", children: content })] })] }));
|
|
4561
4675
|
}
|
|
4676
|
+
const RlsSnackbar = memo(RlsSnackbarComponent);
|
|
4562
4677
|
function useSnackbar() {
|
|
4563
4678
|
const timeoutId = useRef(undefined);
|
|
4564
4679
|
const duration = useRef(4000);
|
|
@@ -4625,14 +4740,15 @@ function RlsApplication({ children }) {
|
|
|
4625
4740
|
'navbar-condense': navbarIsCondense
|
|
4626
4741
|
});
|
|
4627
4742
|
}, [appIsMobile, navbarInApp, navbarIsCondense]);
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4743
|
+
const state = useMemo(() => ({
|
|
4744
|
+
confirmation,
|
|
4745
|
+
notify,
|
|
4746
|
+
setIsMobile,
|
|
4747
|
+
setNavbarInApp,
|
|
4748
|
+
setNavbarIsCondense,
|
|
4749
|
+
snackbar
|
|
4750
|
+
}), [confirmation, notify, snackbar]);
|
|
4751
|
+
return (jsxRuntimeExports.jsxs(RlsContext, { value: state, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsNotifications, RlsConfirmation] }));
|
|
4636
4752
|
}
|
|
4637
4753
|
|
|
4638
4754
|
const DEFAULT_DESIGN_SYSTEM = 'bordered';
|
|
@@ -4758,5 +4874,26 @@ function usePortalController() {
|
|
|
4758
4874
|
return { close, open, visible };
|
|
4759
4875
|
}
|
|
4760
4876
|
|
|
4761
|
-
|
|
4877
|
+
const APP_THEME_ATTRIBUTE = 'app-theme';
|
|
4878
|
+
function getAppTheme() {
|
|
4879
|
+
if (typeof document === 'undefined') {
|
|
4880
|
+
return 'light';
|
|
4881
|
+
}
|
|
4882
|
+
return document.body.getAttribute(APP_THEME_ATTRIBUTE) === 'dark'
|
|
4883
|
+
? 'dark'
|
|
4884
|
+
: 'light';
|
|
4885
|
+
}
|
|
4886
|
+
function setAppTheme(theme) {
|
|
4887
|
+
if (typeof document === 'undefined') {
|
|
4888
|
+
return;
|
|
4889
|
+
}
|
|
4890
|
+
document.body.setAttribute(APP_THEME_ATTRIBUTE, theme);
|
|
4891
|
+
}
|
|
4892
|
+
function toggleAppTheme() {
|
|
4893
|
+
const theme = getAppTheme() === 'dark' ? 'light' : 'dark';
|
|
4894
|
+
setAppTheme(theme);
|
|
4895
|
+
return theme;
|
|
4896
|
+
}
|
|
4897
|
+
|
|
4898
|
+
export { ConfirmationResult, DEFAULT_COLOR, RlsAccordion, RlsAlert, RlsAmount, RlsApplication, RlsAreaText, RlsAvatar, RlsBadge, RlsBallot, RlsBody, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonIcon, RlsButtonOption, RlsButtonProgress, RlsButtonStepper, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsDropdown, RlsFieldArea, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldClock, RlsFieldColor, RlsFieldDate, RlsFieldDateRange, RlsFieldDecimal, RlsFieldFile, RlsFieldList, RlsFieldListSuggestions, RlsFieldListTemplate, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputCounter, RlsInputDecimal, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsLed, RlsMessageEmpty, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsModalClock, RlsModalDate, RlsModalDateRange, RlsModalSheet, RlsNavbar, RlsNavbarMenu, RlsPagination, RlsPickerClock, RlsPickerColor, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSpinner, RlsSwitch, RlsSwitchControl, RlsTabs, RlsTabularText, RlsToolbar, calculateImgDimension, generateThemePalette, getAppTheme, hexIsValid, hexToHsl, hexToHsv, hexToRgb, hslToHex, hsvToHex, hsvToRgb, normalizeHex, rangeFormatTemplate, renderClassStatus, rgbToHex, rgbToHsl, rgbToHsv, setAppTheme, setDesignSystem, setErrorsI18n, setThemeColor, toggleAppTheme, useConfirmation, useDatatable, useDesingSystemController, useDropdownController, useFieldAutocomplete, useFieldList, useFieldSelect, useFormSingleSelectionController, useFormToggleController, useImageEditorController, useListController, useNotifications, usePortalController, useRelocationOnComponent, useResize, useRlsContext, useSnackbar };
|
|
4762
4899
|
//# sourceMappingURL=index.mjs.map
|