@rolster/react-components 19.6.11 → 19.7.2
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 +548 -563
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/es/index.mjs +547 -565
- 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 +4 -5
- 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 +8 -15
- 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 +8 -5
- 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 +4 -5
- 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 +6 -7
- 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 +4 -5
- 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 +4 -5
- 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 +4 -5
- 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 +4 -5
- 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 +6 -6
- 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 +4 -5
- 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 +4 -5
- 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 +7 -8
- 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 +8 -9
- 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 +7 -8
- 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 +4 -5
- 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 +4 -5
- 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 +4 -5
- 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 +4 -5
- 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 +10 -6
- 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 +4 -5
- 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 +4 -5
- 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 +4 -5
- 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 +4 -5
- 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 +4 -5
- 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 +7 -8
- 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 +9 -10
- 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 +9 -10
- 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 +5 -4
- 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 +8 -9
- 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 +9 -10
- 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 +9 -10
- 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 +9 -10
- 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 +9 -10
- 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 +9 -10
- 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 +8 -9
- 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 +8 -9
- 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 +8 -9
- 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 +4 -5
- 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 +6 -3
- 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 +10 -11
- 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 +10 -11
- 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 +8 -9
- 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 +8 -9
- 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 +8 -9
- 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 +7 -8
- 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 +4 -5
- 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 +4 -5
- 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 +5 -6
- 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 +30 -37
- 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 +6 -7
- 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 +12 -19
- 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 +8 -9
- 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 +8 -9
- 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 +10 -11
- 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 +8 -9
- 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 +11 -17
- 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 +11 -17
- 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 +4 -5
- 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 +4 -5
- 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 +4 -5
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.js.map +1 -1
- package/dist/esm/components/organisms/Notifications/Notifications.js +14 -6
- package/dist/esm/components/organisms/Notifications/Notifications.js.map +1 -1
- package/dist/esm/components/organisms/PickerClock/PickerClock.d.ts +2 -1
- package/dist/esm/components/organisms/PickerClock/PickerClock.js +16 -23
- 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 +4 -3
- 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 +9 -10
- 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 +12 -13
- 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 +4 -5
- 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 +14 -15
- 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/helpers/design-system.js +1 -1
- package/dist/esm/helpers/design-system.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 +3 -2
- 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,20 +448,17 @@ 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]);
|
|
455
|
-
const _className =
|
|
456
|
-
return renderClassStatus('rls-tabular-text', {}, className);
|
|
457
|
-
}, [className]);
|
|
455
|
+
const _className = renderClassStatus('rls-tabular-text', {}, className);
|
|
458
456
|
return jsxRuntimeExports.jsx("div", { className: _className, children: codes });
|
|
459
457
|
}
|
|
458
|
+
const RlsTabularText = memo(RlsTabularTextComponent);
|
|
460
459
|
|
|
461
|
-
function
|
|
462
|
-
const classNameAmount =
|
|
463
|
-
return renderClassStatus('rls-amount', {}, className);
|
|
464
|
-
}, [className]);
|
|
460
|
+
function RlsAmountComponent({ value, className, decimals, rlsTheme, symbol }) {
|
|
461
|
+
const classNameAmount = renderClassStatus('rls-amount', {}, className);
|
|
465
462
|
const { decimal, integer } = useMemo(() => {
|
|
466
463
|
const currency = currencyFormat({ value, decimals });
|
|
467
464
|
if (!currency.includes(',')) {
|
|
@@ -475,8 +472,9 @@ function RlsAmount({ value, className, decimals, rlsTheme, symbol }) {
|
|
|
475
472
|
}, [value, decimals]);
|
|
476
473
|
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
474
|
}
|
|
475
|
+
const RlsAmount = memo(RlsAmountComponent);
|
|
478
476
|
|
|
479
|
-
function
|
|
477
|
+
function RlsAreaTextComponent({ autoComplete, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, resize, rows = 1, value }) {
|
|
480
478
|
const valueInitial = String(formControl?.value ?? value ?? '');
|
|
481
479
|
const [valueArea, setValueArea] = useState(valueInitial);
|
|
482
480
|
const [focused, setFocused] = useState(false);
|
|
@@ -530,82 +528,73 @@ function RlsAreaText({ autoComplete, disabled, formControl, identifier, onBlur,
|
|
|
530
528
|
setFocused(() => false);
|
|
531
529
|
onBlur?.();
|
|
532
530
|
}, [formControl, onBlur]);
|
|
533
|
-
const className =
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
});
|
|
539
|
-
}, [
|
|
540
|
-
formControl?.disabled,
|
|
541
|
-
formControl?.focused,
|
|
542
|
-
disabled,
|
|
543
|
-
focused,
|
|
544
|
-
readOnly
|
|
545
|
-
]);
|
|
531
|
+
const className = renderClassStatus('rls-area-text', {
|
|
532
|
+
disabled: formControl?.disabled || disabled,
|
|
533
|
+
focused: formControl?.focused ?? focused,
|
|
534
|
+
readonly: readOnly
|
|
535
|
+
});
|
|
546
536
|
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
537
|
}
|
|
538
|
+
const RlsAreaText = memo(RlsAreaTextComponent);
|
|
548
539
|
|
|
549
|
-
function
|
|
550
|
-
const className =
|
|
551
|
-
|
|
552
|
-
|
|
540
|
+
function RlsAvatarComponent({ children, contrasted, rounded, skeleton, rlsTheme }) {
|
|
541
|
+
const className = renderClassStatus('rls-avatar', {
|
|
542
|
+
contrasted,
|
|
543
|
+
rounded,
|
|
544
|
+
skeleton
|
|
545
|
+
});
|
|
553
546
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
554
547
|
}
|
|
548
|
+
const RlsAvatar = memo(RlsAvatarComponent);
|
|
555
549
|
|
|
556
|
-
function
|
|
557
|
-
const className =
|
|
558
|
-
return renderClassStatus('rls-badge', { contrasted });
|
|
559
|
-
}, [contrasted]);
|
|
550
|
+
function RlsBadgeComponent({ children, contrasted, rlsTheme }) {
|
|
551
|
+
const className = renderClassStatus('rls-badge', { contrasted });
|
|
560
552
|
return (jsxRuntimeExports.jsx("span", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
561
553
|
}
|
|
554
|
+
const RlsBadge = memo(RlsBadgeComponent);
|
|
562
555
|
|
|
563
556
|
function RlsBreadcrumbLabel({ label }) {
|
|
564
|
-
const className =
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
});
|
|
568
|
-
}, [label.onClick]);
|
|
557
|
+
const className = renderClassStatus('rls-breadcrumb__label__a', {
|
|
558
|
+
actionable: !!label.onClick
|
|
559
|
+
});
|
|
569
560
|
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
561
|
}
|
|
571
|
-
function
|
|
562
|
+
function RlsBreadcrumbComponent({ labels }) {
|
|
572
563
|
const children = useMemo(() => {
|
|
573
564
|
return labels.map((label, index) => (jsxRuntimeExports.jsx(RlsBreadcrumbLabel, { label: label }, index)));
|
|
574
565
|
}, [labels]);
|
|
575
566
|
return jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: children });
|
|
576
567
|
}
|
|
568
|
+
const RlsBreadcrumb = memo(RlsBreadcrumbComponent);
|
|
577
569
|
|
|
578
|
-
function
|
|
579
|
-
const classNameIcon =
|
|
580
|
-
return renderClassStatus('rls-icon', { skeleton }, className);
|
|
581
|
-
}, [className, skeleton]);
|
|
570
|
+
function RlsIconComponent({ value, className, rlsTheme, skeleton }) {
|
|
571
|
+
const classNameIcon = renderClassStatus('rls-icon', { skeleton }, className);
|
|
582
572
|
return (jsxRuntimeExports.jsx("div", { className: classNameIcon, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("i", { className: `rls-icon-${value}` }) }));
|
|
583
573
|
}
|
|
574
|
+
const RlsIcon = memo(RlsIconComponent);
|
|
584
575
|
|
|
585
|
-
function
|
|
576
|
+
function RlsSpinnerComponent() {
|
|
586
577
|
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
578
|
}
|
|
579
|
+
const RlsSpinner = memo(RlsSpinnerComponent);
|
|
588
580
|
|
|
589
|
-
function
|
|
590
|
-
const className =
|
|
591
|
-
return renderClassStatus('rls-button__content', { type });
|
|
592
|
-
}, [type]);
|
|
581
|
+
function RlsButtonComponent({ type, children, disabled, identifier, onClick, prefixIcon, requesting, rlsTheme, suffixIcon }) {
|
|
582
|
+
const className = renderClassStatus('rls-button__content', { type });
|
|
593
583
|
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
584
|
}
|
|
585
|
+
const RlsButton = memo(RlsButtonComponent);
|
|
595
586
|
|
|
596
|
-
function
|
|
597
|
-
const className =
|
|
598
|
-
return renderClassStatus('rls-button-action', { type });
|
|
599
|
-
}, [type]);
|
|
587
|
+
function RlsButtonActionComponent({ icon, disabled, identifier, onClick, rlsTheme, tooltip, type }) {
|
|
588
|
+
const className = renderClassStatus('rls-button-action', { type });
|
|
600
589
|
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
590
|
}
|
|
591
|
+
const RlsButtonAction = memo(RlsButtonActionComponent);
|
|
602
592
|
|
|
603
|
-
function
|
|
604
|
-
const classNameButton =
|
|
605
|
-
return renderClassStatus('rls-button-icon', { skeleton }, className);
|
|
606
|
-
}, [className, skeleton]);
|
|
593
|
+
function RlsButtonIconComponent({ icon, className, disabled, onClick, skeleton }) {
|
|
594
|
+
const classNameButton = renderClassStatus('rls-button-icon', { skeleton }, className);
|
|
607
595
|
return (jsxRuntimeExports.jsx("button", { className: classNameButton, onClick: onClick, disabled: disabled, children: !skeleton && jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }));
|
|
608
596
|
}
|
|
597
|
+
const RlsButtonIcon = memo(RlsButtonIconComponent);
|
|
609
598
|
|
|
610
599
|
function useFormSingleSelectionController({ disabled, formControl, onValue, value }) {
|
|
611
600
|
const [checked, setChecked] = useState(formControl?.value === value);
|
|
@@ -621,46 +610,44 @@ function useFormSingleSelectionController({ disabled, formControl, onValue, valu
|
|
|
621
610
|
return { checked, onSelect };
|
|
622
611
|
}
|
|
623
612
|
|
|
624
|
-
function
|
|
613
|
+
function RlsButtonOptionComponent({ icon, children, disabled, formControl, identifier, onClick, onValue, value }) {
|
|
625
614
|
const { checked, onSelect } = useFormSingleSelectionController({
|
|
626
615
|
disabled,
|
|
627
616
|
formControl,
|
|
628
617
|
onValue,
|
|
629
618
|
value
|
|
630
619
|
});
|
|
631
|
-
const className =
|
|
632
|
-
return renderClassStatus('rls-button-option', { checked });
|
|
633
|
-
}, [checked]);
|
|
620
|
+
const className = renderClassStatus('rls-button-option', { checked });
|
|
634
621
|
const onAction = useCallback(() => {
|
|
635
622
|
onSelect();
|
|
636
623
|
onClick?.();
|
|
637
624
|
}, [onSelect, onClick]);
|
|
638
625
|
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onAction, disabled: disabled, children: [jsxRuntimeExports.jsx(RlsIcon, { value: icon }), children] }));
|
|
639
626
|
}
|
|
627
|
+
const RlsButtonOption = memo(RlsButtonOptionComponent);
|
|
640
628
|
|
|
641
|
-
function
|
|
642
|
-
const className =
|
|
643
|
-
return renderClassStatus('rls-checkbox', { checked, disabled });
|
|
644
|
-
}, [checked, disabled]);
|
|
629
|
+
function RlsCheckBoxComponent({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
630
|
+
const className = renderClassStatus('rls-checkbox', { checked, disabled });
|
|
645
631
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx(RlsIcon, { value: "checkmark" }) }));
|
|
646
632
|
}
|
|
647
|
-
|
|
633
|
+
const RlsCheckBox = memo(RlsCheckBoxComponent);
|
|
634
|
+
function RlsCheckBoxControlComponent({ formControl, disabled, identifier, rlsTheme }) {
|
|
648
635
|
const onClick = useCallback(() => {
|
|
649
636
|
formControl.setValue(!formControl.value);
|
|
650
637
|
}, [formControl.value]);
|
|
651
638
|
return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
652
639
|
}
|
|
640
|
+
const RlsCheckBoxControl = memo(RlsCheckBoxControlComponent);
|
|
653
641
|
|
|
654
|
-
function
|
|
642
|
+
function RlsSkeletonComponent({ rlsTheme }) {
|
|
655
643
|
return jsxRuntimeExports.jsx("div", { className: "rls-skeleton", "rls-theme": rlsTheme });
|
|
656
644
|
}
|
|
645
|
+
const RlsSkeleton = memo(RlsSkeletonComponent);
|
|
657
646
|
|
|
658
|
-
function
|
|
647
|
+
function RlsImageComponent({ src, rlsTheme }) {
|
|
659
648
|
const [srcIsComplet, setSrcIsComplet] = useState(false);
|
|
660
649
|
const refImage = useRef(null);
|
|
661
|
-
const className =
|
|
662
|
-
return renderClassStatus('rls-image', { complet: srcIsComplet });
|
|
663
|
-
}, [srcIsComplet]);
|
|
650
|
+
const className = renderClassStatus('rls-image', { complet: srcIsComplet });
|
|
664
651
|
useEffect(() => {
|
|
665
652
|
setSrcIsComplet(!!(src && refImage.current?.complete));
|
|
666
653
|
}, [src]);
|
|
@@ -669,8 +656,9 @@ function RlsImage({ src, rlsTheme }) {
|
|
|
669
656
|
}, []);
|
|
670
657
|
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
658
|
}
|
|
659
|
+
const RlsImage = memo(RlsImageComponent);
|
|
672
660
|
|
|
673
|
-
function
|
|
661
|
+
function RlsInputComponent({ children, decimals, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
|
|
674
662
|
const valueInitial = (formControl?.value ?? value) ? String(value) : '';
|
|
675
663
|
const [valueInput, setValueInput] = useState(valueInitial);
|
|
676
664
|
const [focused, setFocused] = useState(false);
|
|
@@ -713,27 +701,24 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
713
701
|
setFocused(() => false);
|
|
714
702
|
onBlur?.();
|
|
715
703
|
}, [formControl, onBlur]);
|
|
716
|
-
const className =
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
});
|
|
721
|
-
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
704
|
+
const className = renderClassStatus('rls-input', {
|
|
705
|
+
disabled: formControl?.disabled || disabled,
|
|
706
|
+
focused: formControl?.focused ?? focused
|
|
707
|
+
});
|
|
722
708
|
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
709
|
}
|
|
710
|
+
const RlsInput = memo(RlsInputComponent);
|
|
724
711
|
|
|
725
|
-
function
|
|
712
|
+
function RlsInputCounterComponent({ className, disabled, formControl, identifier, max, min, onBlur, onFocus, onValue, readOnly, rlsTheme, step = 1, value: valueProp }) {
|
|
726
713
|
const changeIsInternal = useRef(false);
|
|
727
714
|
const [value, setValue] = useState(formControl?.value ?? valueProp ?? 0);
|
|
728
715
|
const [focused, setFocused] = useState(false);
|
|
729
716
|
const _disabled = useMemo(() => formControl?.disabled || disabled, [formControl?.disabled, disabled]);
|
|
730
|
-
const classNameCounter =
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
}, className);
|
|
736
|
-
}, [_disabled, formControl?.focused, focused, readOnly, className]);
|
|
717
|
+
const classNameCounter = renderClassStatus('rls-input-counter', {
|
|
718
|
+
disabled: _disabled,
|
|
719
|
+
focused: formControl?.focused ?? focused,
|
|
720
|
+
readonly: readOnly
|
|
721
|
+
}, className);
|
|
737
722
|
useEffect(() => {
|
|
738
723
|
if (!changeIsInternal.current && formControl) {
|
|
739
724
|
const counterValue = formControl.value;
|
|
@@ -776,8 +761,9 @@ function RlsInputCounter({ className, disabled, formControl, identifier, max, mi
|
|
|
776
761
|
}, [formControl, onBlur]);
|
|
777
762
|
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
763
|
}
|
|
764
|
+
const RlsInputCounter = memo(RlsInputCounterComponent);
|
|
779
765
|
|
|
780
|
-
function
|
|
766
|
+
function RlsInputDecimalComponent(props) {
|
|
781
767
|
const { decimals, formControl, identifier, onValue, symbol, value } = props;
|
|
782
768
|
const [valueInput, setValueInput] = useState((formControl?.value ?? value ?? BigDecimal.zero()).rounded);
|
|
783
769
|
const amount = useMemo(() => {
|
|
@@ -796,8 +782,9 @@ function RlsInputDecimal(props) {
|
|
|
796
782
|
const decimalProps = { ...props, formControl: undefined };
|
|
797
783
|
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
784
|
}
|
|
785
|
+
const RlsInputDecimal = memo(RlsInputDecimalComponent);
|
|
799
786
|
|
|
800
|
-
function
|
|
787
|
+
function RlsInputMoneyComponent(props) {
|
|
801
788
|
const { decimals, formControl, identifier, onValue, symbol, value } = props;
|
|
802
789
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
|
|
803
790
|
const onValueInput = useCallback((value) => {
|
|
@@ -808,8 +795,9 @@ function RlsInputMoney(props) {
|
|
|
808
795
|
}, [formControl, onValue]);
|
|
809
796
|
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
797
|
}
|
|
798
|
+
const RlsInputMoney = memo(RlsInputMoneyComponent);
|
|
811
799
|
|
|
812
|
-
function
|
|
800
|
+
function RlsInputNumberComponent(props) {
|
|
813
801
|
const { formControl, identifier, onValue, value } = props;
|
|
814
802
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
|
|
815
803
|
const onValueInput = useCallback((value) => {
|
|
@@ -820,8 +808,9 @@ function RlsInputNumber(props) {
|
|
|
820
808
|
}, [formControl, onValue]);
|
|
821
809
|
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
810
|
}
|
|
811
|
+
const RlsInputNumber = memo(RlsInputNumberComponent);
|
|
823
812
|
|
|
824
|
-
function
|
|
813
|
+
function RlsInputPasswordComponent({ disabled, formControl, identifier, onEnter, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type }) {
|
|
825
814
|
const [focused, setFocused] = useState(false);
|
|
826
815
|
const _onChange = useCallback((event) => {
|
|
827
816
|
formControl?.setValue(event.target.value);
|
|
@@ -844,16 +833,15 @@ function RlsInputPassword({ disabled, formControl, identifier, onEnter, onKeyDow
|
|
|
844
833
|
formControl?.blur();
|
|
845
834
|
setFocused(() => false);
|
|
846
835
|
}, [formControl]);
|
|
847
|
-
const className =
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
});
|
|
852
|
-
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
836
|
+
const className = renderClassStatus('rls-input-password', {
|
|
837
|
+
disabled: formControl?.disabled || disabled,
|
|
838
|
+
focused: formControl?.focused ?? focused
|
|
839
|
+
});
|
|
853
840
|
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
841
|
}
|
|
842
|
+
const RlsInputPassword = memo(RlsInputPasswordComponent);
|
|
855
843
|
|
|
856
|
-
function
|
|
844
|
+
function RlsInputPercentageComponent(props) {
|
|
857
845
|
const { formControl, identifier, onValue, value } = props;
|
|
858
846
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
|
|
859
847
|
const onValueInput = useCallback((value) => {
|
|
@@ -864,12 +852,11 @@ function RlsInputPercentage(props) {
|
|
|
864
852
|
}, [formControl, onValue]);
|
|
865
853
|
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
854
|
}
|
|
855
|
+
const RlsInputPercentage = memo(RlsInputPercentageComponent);
|
|
867
856
|
|
|
868
|
-
function
|
|
857
|
+
function RlsInputSearchComponent({ formControl, disabled, identifier, onEnter, onSearch, placeholder }) {
|
|
869
858
|
const [value, setValue] = useState('');
|
|
870
|
-
const className =
|
|
871
|
-
return renderClassStatus('rls-input-search', { disabled });
|
|
872
|
-
}, [disabled]);
|
|
859
|
+
const className = renderClassStatus('rls-input-search', { disabled });
|
|
873
860
|
const onValue = useCallback((value) => {
|
|
874
861
|
if (!formControl) {
|
|
875
862
|
setValue(() => value);
|
|
@@ -877,8 +864,9 @@ function RlsInputSearch({ formControl, disabled, identifier, onEnter, onSearch,
|
|
|
877
864
|
}, [formControl]);
|
|
878
865
|
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
866
|
}
|
|
867
|
+
const RlsInputSearch = memo(RlsInputSearchComponent);
|
|
880
868
|
|
|
881
|
-
function
|
|
869
|
+
function RlsInputTextComponent(props) {
|
|
882
870
|
const { formControl, identifier, onValue, value } = props;
|
|
883
871
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? '');
|
|
884
872
|
const onValueInput = useCallback((value) => {
|
|
@@ -889,10 +877,12 @@ function RlsInputText(props) {
|
|
|
889
877
|
}, [formControl, onValue]);
|
|
890
878
|
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
879
|
}
|
|
880
|
+
const RlsInputText = memo(RlsInputTextComponent);
|
|
892
881
|
|
|
893
|
-
function
|
|
882
|
+
function RlsLabelComponent({ children, rlsTheme }) {
|
|
894
883
|
return (jsxRuntimeExports.jsx("span", { className: "rls-label", "rls-theme": rlsTheme, children: children }));
|
|
895
884
|
}
|
|
885
|
+
const RlsLabel = memo(RlsLabelComponent);
|
|
896
886
|
|
|
897
887
|
function msgInvalidColor(color) {
|
|
898
888
|
return `Invalid color: "${color}". Use format "#FF6600".`;
|
|
@@ -1214,7 +1204,7 @@ function setThemeColor(baseColor, theme = 'primary') {
|
|
|
1214
1204
|
const DEFAULT_COLOR = '#1780e0';
|
|
1215
1205
|
|
|
1216
1206
|
const CONTENT_BACKGROUND = '--pvt-content-background';
|
|
1217
|
-
function
|
|
1207
|
+
function RlsLedComponent({ color, rlsTheme }) {
|
|
1218
1208
|
const refLed = useRef(null);
|
|
1219
1209
|
const refColor = useRef(undefined);
|
|
1220
1210
|
useEffect(() => {
|
|
@@ -1229,61 +1219,64 @@ function RlsLed({ color, rlsTheme }) {
|
|
|
1229
1219
|
}, [color]);
|
|
1230
1220
|
return jsxRuntimeExports.jsx("div", { ref: refLed, className: "rls-led", "rls-theme": rlsTheme });
|
|
1231
1221
|
}
|
|
1222
|
+
const RlsLed = memo(RlsLedComponent);
|
|
1232
1223
|
|
|
1233
|
-
function
|
|
1224
|
+
function RlsMessageIconComponent({ icon, children, rlsTheme }) {
|
|
1234
1225
|
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
1226
|
}
|
|
1227
|
+
const RlsMessageIcon = memo(RlsMessageIconComponent);
|
|
1236
1228
|
|
|
1237
|
-
function
|
|
1238
|
-
const className =
|
|
1239
|
-
return renderClassStatus('rls-poster', { contrasted });
|
|
1240
|
-
}, [contrasted]);
|
|
1229
|
+
function RlsPosterComponent({ children, contrasted, rlsTheme }) {
|
|
1230
|
+
const className = renderClassStatus('rls-poster', { contrasted });
|
|
1241
1231
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
1242
1232
|
}
|
|
1233
|
+
const RlsPoster = memo(RlsPosterComponent);
|
|
1243
1234
|
|
|
1244
|
-
function
|
|
1245
|
-
const className =
|
|
1246
|
-
return renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1247
|
-
}, [indeterminate]);
|
|
1235
|
+
function RlsProgressBarComponent({ indeterminate, percentage, rlsTheme }) {
|
|
1236
|
+
const className = renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1248
1237
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage ?? 0}%` } }) }));
|
|
1249
1238
|
}
|
|
1239
|
+
const RlsProgressBar = memo(RlsProgressBarComponent);
|
|
1250
1240
|
|
|
1251
|
-
function
|
|
1241
|
+
function RlsProgressCircularComponent({ rlsTheme }) {
|
|
1252
1242
|
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
1243
|
}
|
|
1244
|
+
const RlsProgressCircular = memo(RlsProgressCircularComponent);
|
|
1254
1245
|
|
|
1255
|
-
function
|
|
1256
|
-
const className =
|
|
1257
|
-
return renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1258
|
-
}, [checked, disabled]);
|
|
1246
|
+
function RlsRadioButtonComponent({ checked, disabled, identifier, rlsTheme, onClick }) {
|
|
1247
|
+
const className = renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1259
1248
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
1260
1249
|
}
|
|
1250
|
+
const RlsRadioButton = memo(RlsRadioButtonComponent);
|
|
1261
1251
|
|
|
1262
|
-
function
|
|
1252
|
+
function RlsSkeletonTextComponent({ active, children, rlsTheme }) {
|
|
1263
1253
|
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
1254
|
}
|
|
1255
|
+
const RlsSkeletonText = memo(RlsSkeletonTextComponent);
|
|
1265
1256
|
|
|
1266
|
-
function
|
|
1267
|
-
const className =
|
|
1268
|
-
|
|
1269
|
-
|
|
1257
|
+
function RlsSwitchComponent({ checked, capsule, disabled, identifier, onClick, rlsTheme }) {
|
|
1258
|
+
const className = renderClassStatus('rls-switch', {
|
|
1259
|
+
checked,
|
|
1260
|
+
capsule,
|
|
1261
|
+
disabled
|
|
1262
|
+
});
|
|
1270
1263
|
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
1264
|
}
|
|
1272
|
-
|
|
1265
|
+
const RlsSwitch = memo(RlsSwitchComponent);
|
|
1266
|
+
function RlsSwitchControlComponent({ formControl, disabled, identifier, rlsTheme }) {
|
|
1273
1267
|
const onClick = useCallback(() => {
|
|
1274
1268
|
formControl.setValue(!formControl.value);
|
|
1275
1269
|
}, [formControl.value]);
|
|
1276
1270
|
return (jsxRuntimeExports.jsx(RlsSwitch, { identifier: identifier, checked: formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
1277
1271
|
}
|
|
1272
|
+
const RlsSwitchControl = memo(RlsSwitchControlComponent);
|
|
1278
1273
|
|
|
1279
|
-
function
|
|
1274
|
+
function RlsAccordionComponent({ bordered, children, className, disabled, identifier, onToggle, opened, rlsTheme, title }) {
|
|
1280
1275
|
const [open, setOpen] = useState(opened);
|
|
1281
1276
|
const [animating, setAnimating] = useState(false);
|
|
1282
1277
|
const contentRef = useRef(null);
|
|
1283
1278
|
const initializedRef = useRef(false);
|
|
1284
|
-
const classNameAccordion =
|
|
1285
|
-
return renderClassStatus('rls-accordion', { bordered, disabled, open, animating }, className);
|
|
1286
|
-
}, [animating, bordered, className, disabled, open]);
|
|
1279
|
+
const classNameAccordion = renderClassStatus('rls-accordion', { bordered, disabled, open, animating }, className);
|
|
1287
1280
|
const onClickHeader = useCallback(() => {
|
|
1288
1281
|
if (!disabled) {
|
|
1289
1282
|
setOpen((current) => {
|
|
@@ -1329,33 +1322,32 @@ function RlsAccordion({ bordered, children, className, disabled, identifier, onT
|
|
|
1329
1322
|
}, [open]);
|
|
1330
1323
|
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
1324
|
}
|
|
1325
|
+
const RlsAccordion = memo(RlsAccordionComponent);
|
|
1332
1326
|
|
|
1333
|
-
function
|
|
1334
|
-
const className =
|
|
1335
|
-
return renderClassStatus('rls-alert', { bordered });
|
|
1336
|
-
}, [bordered]);
|
|
1327
|
+
function RlsAlertComponent({ bordered, children, icon, identifier, rlsTheme }) {
|
|
1328
|
+
const className = renderClassStatus('rls-alert', { bordered });
|
|
1337
1329
|
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
1330
|
}
|
|
1331
|
+
const RlsAlert = memo(RlsAlertComponent);
|
|
1339
1332
|
|
|
1340
|
-
function
|
|
1341
|
-
const classNameBallot =
|
|
1342
|
-
return renderClassStatus('rls-ballot', { bordered, skeleton }, className);
|
|
1343
|
-
}, [bordered, skeleton, className]);
|
|
1333
|
+
function RlsBallotComponent({ bordered, className, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
1334
|
+
const classNameBallot = renderClassStatus('rls-ballot', { bordered, skeleton }, className);
|
|
1344
1335
|
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
1336
|
}
|
|
1337
|
+
const RlsBallot = memo(RlsBallotComponent);
|
|
1346
1338
|
|
|
1347
|
-
function
|
|
1339
|
+
function RlsBodyComponent({ children, identifier, rlsTheme }) {
|
|
1348
1340
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-app__page__body", "rls-theme": rlsTheme, children: children }));
|
|
1349
1341
|
}
|
|
1342
|
+
const RlsBody = memo(RlsBodyComponent);
|
|
1350
1343
|
|
|
1351
|
-
function
|
|
1352
|
-
const className =
|
|
1353
|
-
return renderClassStatus('rls-button-progress', { progressing });
|
|
1354
|
-
}, [progressing]);
|
|
1344
|
+
function RlsButtonProgressComponent({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
1345
|
+
const className = renderClassStatus('rls-button-progress', { progressing });
|
|
1355
1346
|
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
1347
|
}
|
|
1348
|
+
const RlsButtonProgress = memo(RlsButtonProgressComponent);
|
|
1357
1349
|
|
|
1358
|
-
function
|
|
1350
|
+
function RlsButtonStepperComponent({ disabled, onAction, rlsTheme }) {
|
|
1359
1351
|
const onDown = useCallback(() => {
|
|
1360
1352
|
onAction?.('down');
|
|
1361
1353
|
}, [onAction]);
|
|
@@ -1364,8 +1356,9 @@ function RlsButtonStepper({ disabled, onAction, rlsTheme }) {
|
|
|
1364
1356
|
}, [onAction]);
|
|
1365
1357
|
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
1358
|
}
|
|
1359
|
+
const RlsButtonStepper = memo(RlsButtonStepperComponent);
|
|
1367
1360
|
|
|
1368
|
-
function
|
|
1361
|
+
function RlsButtonToggleComponent({ onAction, options, type, automatic, disabled, rlsTheme }) {
|
|
1369
1362
|
const componentRef = useRef(null);
|
|
1370
1363
|
const [action, setAction] = useState(options[0]);
|
|
1371
1364
|
const [visible, setVisible] = useState(false);
|
|
@@ -1380,12 +1373,10 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1380
1373
|
document.removeEventListener('click', onCloseMenu);
|
|
1381
1374
|
};
|
|
1382
1375
|
}, []);
|
|
1383
|
-
const classNameList =
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
});
|
|
1388
|
-
}, [visible]);
|
|
1376
|
+
const classNameList = renderClassStatus('rls-button-toggle__list', {
|
|
1377
|
+
hide: !visible,
|
|
1378
|
+
visible
|
|
1379
|
+
});
|
|
1389
1380
|
const onClickMenu = useCallback(() => {
|
|
1390
1381
|
setVisible((visible) => !visible);
|
|
1391
1382
|
}, []);
|
|
@@ -1410,10 +1401,12 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1410
1401
|
}, [options, onSelectAction]);
|
|
1411
1402
|
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
1403
|
}
|
|
1404
|
+
const RlsButtonToggle = memo(RlsButtonToggleComponent);
|
|
1413
1405
|
|
|
1414
|
-
function
|
|
1406
|
+
function RlsContentComponent({ children, identifier, rlsTheme }) {
|
|
1415
1407
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-app__page__content", "rls-theme": rlsTheme, children: children }));
|
|
1416
1408
|
}
|
|
1409
|
+
const RlsContent = memo(RlsContentComponent);
|
|
1417
1410
|
|
|
1418
1411
|
const errors = {
|
|
1419
1412
|
es: {
|
|
@@ -1524,7 +1517,7 @@ function msgErrorsI18n(key, language, interpolators) {
|
|
|
1524
1517
|
return _msgErrorsI18n(key, { language, interpolators });
|
|
1525
1518
|
}
|
|
1526
1519
|
|
|
1527
|
-
function
|
|
1520
|
+
function RlsMessageFormErrorComponent({ className, formControl }) {
|
|
1528
1521
|
const [language, setLanguage] = useState('es');
|
|
1529
1522
|
useEffect(() => {
|
|
1530
1523
|
return i18nSubscribe((language) => {
|
|
@@ -1538,48 +1531,47 @@ function RlsMessageFormError({ className, formControl }) {
|
|
|
1538
1531
|
}, [formControl?.error, language]);
|
|
1539
1532
|
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
1533
|
}
|
|
1534
|
+
const RlsMessageFormError = memo(RlsMessageFormErrorComponent);
|
|
1541
1535
|
|
|
1542
|
-
function
|
|
1536
|
+
function RlsFieldAreaComponent(props) {
|
|
1543
1537
|
const { children, formControl, identifier, rlsTheme } = props;
|
|
1544
1538
|
const disabled = useMemo(() => {
|
|
1545
1539
|
return formControl?.disabled || props.disabled;
|
|
1546
1540
|
}, [formControl?.disabled, props.disabled]);
|
|
1547
|
-
const className =
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
}, 'rls-field-area');
|
|
1554
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1541
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1542
|
+
disabled,
|
|
1543
|
+
error: formControl?.wrong,
|
|
1544
|
+
focused: formControl?.focused && !disabled,
|
|
1545
|
+
readonly: props.readOnly
|
|
1546
|
+
}, 'rls-field-area');
|
|
1555
1547
|
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
1548
|
}
|
|
1549
|
+
const RlsFieldArea = memo(RlsFieldAreaComponent);
|
|
1557
1550
|
|
|
1558
|
-
function
|
|
1551
|
+
function RlsFieldDecimalComponent(props) {
|
|
1559
1552
|
const { children, formControl, identifier, rlsTheme } = props;
|
|
1560
1553
|
const disabled = useMemo(() => {
|
|
1561
1554
|
return formControl?.disabled || props.disabled;
|
|
1562
1555
|
}, [formControl?.disabled, props.disabled]);
|
|
1563
|
-
const className =
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
}, 'rls-field-decimal');
|
|
1570
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1556
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1557
|
+
disabled,
|
|
1558
|
+
error: formControl?.wrong,
|
|
1559
|
+
focused: formControl?.focused && !disabled,
|
|
1560
|
+
readonly: props.readOnly
|
|
1561
|
+
}, 'rls-field-decimal');
|
|
1571
1562
|
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
1563
|
}
|
|
1564
|
+
const RlsFieldDecimal = memo(RlsFieldDecimalComponent);
|
|
1573
1565
|
|
|
1574
|
-
function
|
|
1566
|
+
function RlsFieldFileComponent({ accept, children, disabled: _disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value }) {
|
|
1575
1567
|
const inputRef = useRef(null);
|
|
1576
1568
|
const disabled = useMemo(() => formControl?.disabled || _disabled, [formControl?.disabled, _disabled]);
|
|
1577
|
-
const className =
|
|
1569
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1578
1570
|
disabled,
|
|
1579
1571
|
error: formControl?.wrong,
|
|
1580
1572
|
focused: formControl?.focused && !disabled,
|
|
1581
1573
|
readonly: readOnly
|
|
1582
|
-
}, 'rls-field-file')
|
|
1574
|
+
}, 'rls-field-file');
|
|
1583
1575
|
const currentFile = useMemo(() => formControl?.value ?? value, [formControl?.value, value]);
|
|
1584
1576
|
const displayValue = useMemo(() => {
|
|
1585
1577
|
return currentFile?.name ?? '';
|
|
@@ -1609,6 +1601,7 @@ function RlsFieldFile({ accept, children, disabled: _disabled, formControl, iden
|
|
|
1609
1601
|
}, [readOnly, disabled]);
|
|
1610
1602
|
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
1603
|
}
|
|
1604
|
+
const RlsFieldFile = memo(RlsFieldFileComponent);
|
|
1612
1605
|
|
|
1613
1606
|
const reactI18n = i18n({
|
|
1614
1607
|
es: {
|
|
@@ -1646,7 +1639,7 @@ function RlsFieldListLi({ element, onClickElement, onKeydownElement, render }) {
|
|
|
1646
1639
|
}, [element, onKeydownElement]);
|
|
1647
1640
|
return (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: onClick, onKeyDown: onKeyDown, children: render(element) }));
|
|
1648
1641
|
}
|
|
1649
|
-
function
|
|
1642
|
+
function RlsFieldListSuggestionsComponent({ elements, action, disabled, higher, render, renderEmpty, searchControl, visible, onClickBackdrop, onClickElement, onKeydownElement, refList, rlsTheme }) {
|
|
1650
1643
|
const [labels, setLabels] = useState({
|
|
1651
1644
|
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
1652
1645
|
listEmptyTitle: reactI18n('listEmptyTitle')
|
|
@@ -1659,13 +1652,11 @@ function RlsFieldListSuggestions({ elements, action, disabled, higher, render, r
|
|
|
1659
1652
|
});
|
|
1660
1653
|
});
|
|
1661
1654
|
}, []);
|
|
1662
|
-
const className =
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
});
|
|
1668
|
-
}, [disabled, higher, visible]);
|
|
1655
|
+
const className = renderClassStatus('rls-field-list__suggestions', {
|
|
1656
|
+
disabled,
|
|
1657
|
+
higher,
|
|
1658
|
+
visible
|
|
1659
|
+
});
|
|
1669
1660
|
const onChangePattern = useCallback((event) => {
|
|
1670
1661
|
searchControl?.onChange(event.target.value);
|
|
1671
1662
|
}, [searchControl?.onChange]);
|
|
@@ -1678,94 +1669,91 @@ function RlsFieldListSuggestions({ elements, action, disabled, higher, render, r
|
|
|
1678
1669
|
const searching = searchControl?.searching ?? false;
|
|
1679
1670
|
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
1671
|
}
|
|
1672
|
+
const RlsFieldListSuggestions = memo(RlsFieldListSuggestionsComponent);
|
|
1681
1673
|
|
|
1682
|
-
function
|
|
1674
|
+
function RlsFieldMoneyComponent(props) {
|
|
1683
1675
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1684
1676
|
const disabled = useMemo(() => {
|
|
1685
1677
|
return formControl?.disabled || props.disabled;
|
|
1686
1678
|
}, [formControl?.disabled, props.disabled]);
|
|
1687
|
-
const className =
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
}, 'rls-field-money');
|
|
1694
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1679
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1680
|
+
disabled,
|
|
1681
|
+
error: formControl?.wrong,
|
|
1682
|
+
focused: formControl?.focused && !disabled,
|
|
1683
|
+
readonly: props.readOnly
|
|
1684
|
+
}, 'rls-field-money');
|
|
1695
1685
|
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
1686
|
}
|
|
1687
|
+
const RlsFieldMoney = memo(RlsFieldMoneyComponent);
|
|
1697
1688
|
|
|
1698
|
-
function
|
|
1689
|
+
function RlsFieldNumberComponent(props) {
|
|
1699
1690
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1700
1691
|
const disabled = useMemo(() => {
|
|
1701
1692
|
return formControl?.disabled || props.disabled;
|
|
1702
1693
|
}, [formControl?.disabled, props.disabled]);
|
|
1703
|
-
const className =
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
}, 'rls-field-number');
|
|
1710
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1694
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1695
|
+
disabled,
|
|
1696
|
+
error: formControl?.wrong,
|
|
1697
|
+
focused: formControl?.focused && !disabled,
|
|
1698
|
+
readonly: props.readOnly
|
|
1699
|
+
}, 'rls-field-number');
|
|
1711
1700
|
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
1701
|
}
|
|
1702
|
+
const RlsFieldNumber = memo(RlsFieldNumberComponent);
|
|
1713
1703
|
|
|
1714
|
-
function
|
|
1704
|
+
function RlsFieldPasswordComponent(props) {
|
|
1715
1705
|
const { children, formControl, identifier, rlsTheme } = props;
|
|
1716
1706
|
const [passwordIsActive, setPasswordIsActive] = useState(true);
|
|
1717
1707
|
const disabled = useMemo(() => {
|
|
1718
1708
|
return formControl?.disabled || props.disabled;
|
|
1719
1709
|
}, [formControl?.disabled, props.disabled]);
|
|
1720
|
-
const className =
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
}, 'rls-field-password');
|
|
1727
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1710
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1711
|
+
disabled,
|
|
1712
|
+
error: formControl?.wrong,
|
|
1713
|
+
focused: formControl?.focused && !disabled,
|
|
1714
|
+
readonly: props.readOnly
|
|
1715
|
+
}, 'rls-field-password');
|
|
1728
1716
|
const onTogglePassword = useCallback(() => {
|
|
1729
1717
|
setPasswordIsActive((password) => !password);
|
|
1730
1718
|
}, []);
|
|
1731
1719
|
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
1720
|
}
|
|
1721
|
+
const RlsFieldPassword = memo(RlsFieldPasswordComponent);
|
|
1733
1722
|
|
|
1734
|
-
function
|
|
1723
|
+
function RlsFieldPercentageComponent(props) {
|
|
1735
1724
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1736
1725
|
const disabled = useMemo(() => {
|
|
1737
1726
|
return formControl?.disabled || props.disabled;
|
|
1738
1727
|
}, [formControl?.disabled, props.disabled]);
|
|
1739
|
-
const className =
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
}, 'rls-field-percentage');
|
|
1746
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1728
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1729
|
+
disabled,
|
|
1730
|
+
error: formControl?.wrong,
|
|
1731
|
+
focused: formControl?.focused && !disabled,
|
|
1732
|
+
readonly: props.readOnly
|
|
1733
|
+
}, 'rls-field-percentage');
|
|
1747
1734
|
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
1735
|
}
|
|
1736
|
+
const RlsFieldPercentage = memo(RlsFieldPercentageComponent);
|
|
1749
1737
|
|
|
1750
|
-
function
|
|
1738
|
+
function RlsFieldReadonlyComponent({ children, identifier, rlsTheme, value }) {
|
|
1751
1739
|
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
1740
|
}
|
|
1741
|
+
const RlsFieldReadonly = memo(RlsFieldReadonlyComponent);
|
|
1753
1742
|
|
|
1754
|
-
function
|
|
1743
|
+
function RlsFieldTextComponent(props) {
|
|
1755
1744
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1756
1745
|
const disabled = useMemo(() => {
|
|
1757
1746
|
return formControl?.disabled || props.disabled;
|
|
1758
1747
|
}, [formControl?.disabled, props.disabled]);
|
|
1759
|
-
const className =
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
}, 'rls-field-text');
|
|
1766
|
-
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1748
|
+
const className = renderClassStatus('rls-field-box', {
|
|
1749
|
+
disabled,
|
|
1750
|
+
error: formControl?.wrong,
|
|
1751
|
+
focused: formControl?.focused && !disabled,
|
|
1752
|
+
readonly: props.readOnly
|
|
1753
|
+
}, 'rls-field-text');
|
|
1767
1754
|
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
1755
|
}
|
|
1756
|
+
const RlsFieldText = memo(RlsFieldTextComponent);
|
|
1769
1757
|
|
|
1770
1758
|
function useFormToggleController({ disabled, formControl }) {
|
|
1771
1759
|
const [checked, setChecked] = useState(!!formControl?.value);
|
|
@@ -1787,57 +1775,52 @@ function useFormToggleController({ disabled, formControl }) {
|
|
|
1787
1775
|
return { checked, onToggle };
|
|
1788
1776
|
}
|
|
1789
1777
|
|
|
1790
|
-
function
|
|
1778
|
+
function RlsLabelCheckBoxComponent({ children, disabled, extended, identifier, formControl, reverse, rlsTheme }) {
|
|
1791
1779
|
const { checked, onToggle } = useFormToggleController({
|
|
1792
1780
|
disabled,
|
|
1793
1781
|
formControl
|
|
1794
1782
|
});
|
|
1795
|
-
const className =
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
});
|
|
1801
|
-
}, [disabled, extended, reverse]);
|
|
1783
|
+
const className = renderClassStatus('rls-label-checkbox', {
|
|
1784
|
+
disabled,
|
|
1785
|
+
extended,
|
|
1786
|
+
reverse
|
|
1787
|
+
});
|
|
1802
1788
|
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
1789
|
}
|
|
1790
|
+
const RlsLabelCheckBox = memo(RlsLabelCheckBoxComponent);
|
|
1804
1791
|
|
|
1805
|
-
function
|
|
1792
|
+
function RlsLabelRadioButtonComponent({ children, disabled, extended, identifier, formControl, onValue, reverse, rlsTheme, value }) {
|
|
1806
1793
|
const { checked, onSelect } = useFormSingleSelectionController({
|
|
1807
1794
|
disabled,
|
|
1808
1795
|
formControl,
|
|
1809
1796
|
onValue,
|
|
1810
1797
|
value
|
|
1811
1798
|
});
|
|
1812
|
-
const className =
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
});
|
|
1818
|
-
}, [disabled, extended, reverse]);
|
|
1799
|
+
const className = renderClassStatus('rls-label-radiobutton', {
|
|
1800
|
+
disabled,
|
|
1801
|
+
extended,
|
|
1802
|
+
reverse
|
|
1803
|
+
});
|
|
1819
1804
|
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
1805
|
}
|
|
1806
|
+
const RlsLabelRadioButton = memo(RlsLabelRadioButtonComponent);
|
|
1821
1807
|
|
|
1822
|
-
function
|
|
1808
|
+
function RlsLabelSwitchComponent({ capsule, children, disabled, extended, identifier, formControl, reverse, rlsTheme }) {
|
|
1823
1809
|
const { checked, onToggle } = useFormToggleController({
|
|
1824
1810
|
disabled,
|
|
1825
1811
|
formControl
|
|
1826
1812
|
});
|
|
1827
|
-
const className =
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
});
|
|
1833
|
-
}, [disabled, extended, reverse]);
|
|
1813
|
+
const className = renderClassStatus('rls-label-switch', {
|
|
1814
|
+
disabled,
|
|
1815
|
+
extended,
|
|
1816
|
+
reverse
|
|
1817
|
+
});
|
|
1834
1818
|
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
1819
|
}
|
|
1820
|
+
const RlsLabelSwitch = memo(RlsLabelSwitchComponent);
|
|
1836
1821
|
|
|
1837
|
-
function
|
|
1838
|
-
const classNameMessageEmpty =
|
|
1839
|
-
return renderClassStatus('rls-message-empty', {}, className);
|
|
1840
|
-
}, [className]);
|
|
1822
|
+
function RlsMessageEmptyComponent({ children, className, emoji, icon, identifier, image, rlsTheme, title }) {
|
|
1823
|
+
const classNameMessageEmpty = renderClassStatus('rls-message-empty', {}, className);
|
|
1841
1824
|
const logo = useMemo(() => {
|
|
1842
1825
|
if (icon) {
|
|
1843
1826
|
return (jsxRuntimeExports.jsx("div", { className: "rls-message-empty__logo", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }));
|
|
@@ -1852,10 +1835,12 @@ function RlsMessageEmpty({ children, className, emoji, icon, identifier, image,
|
|
|
1852
1835
|
}, [icon, emoji, image]);
|
|
1853
1836
|
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
1837
|
}
|
|
1838
|
+
const RlsMessageEmpty = memo(RlsMessageEmptyComponent);
|
|
1855
1839
|
|
|
1856
|
-
function
|
|
1840
|
+
function RlsNavbarComponent({ children, identifier, rlsTheme }) {
|
|
1857
1841
|
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
1842
|
}
|
|
1843
|
+
const RlsNavbar = memo(RlsNavbarComponent);
|
|
1859
1844
|
|
|
1860
1845
|
function RlsNavbarMenuOption({ option, onOption }) {
|
|
1861
1846
|
const onClick = useCallback(() => {
|
|
@@ -1863,18 +1848,21 @@ function RlsNavbarMenuOption({ option, onOption }) {
|
|
|
1863
1848
|
}, [onOption]);
|
|
1864
1849
|
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
1850
|
}
|
|
1866
|
-
function
|
|
1851
|
+
function RlsNavbarMenuComponent({ options, onOption }) {
|
|
1867
1852
|
return (jsxRuntimeExports.jsx("ul", { className: "rls-app__page__nav__menu", children: options.map((option) => (jsxRuntimeExports.jsx(RlsNavbarMenuOption, { option: option, onOption: onOption }, option.id))) }));
|
|
1868
1853
|
}
|
|
1854
|
+
const RlsNavbarMenu = memo(RlsNavbarMenuComponent);
|
|
1869
1855
|
|
|
1870
1856
|
function PageButton({ page, onSelect }) {
|
|
1871
|
-
const className =
|
|
1857
|
+
const className = renderClassStatus('rls-pagination__page', {
|
|
1858
|
+
active: page.active
|
|
1859
|
+
});
|
|
1872
1860
|
const onClick = useCallback(() => {
|
|
1873
1861
|
onSelect(page);
|
|
1874
1862
|
}, [page, onSelect]);
|
|
1875
1863
|
return (jsxRuntimeExports.jsx("button", { type: "button", className: className, onClick: onClick, children: page.label }));
|
|
1876
1864
|
}
|
|
1877
|
-
function
|
|
1865
|
+
function RlsPaginationComponent({ suggestions, count, filter, onPagination }) {
|
|
1878
1866
|
const [template, setTemplate] = useState();
|
|
1879
1867
|
const controller = useRef(undefined);
|
|
1880
1868
|
const refreshTemplate = useCallback((template, suggestions) => {
|
|
@@ -1916,20 +1904,19 @@ function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
|
1916
1904
|
}, [refreshPagination]);
|
|
1917
1905
|
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
1906
|
}
|
|
1907
|
+
const RlsPagination = memo(RlsPaginationComponent);
|
|
1919
1908
|
|
|
1920
1909
|
function RlsPickerDayHeaders() {
|
|
1921
1910
|
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))) }));
|
|
1922
1911
|
}
|
|
1923
1912
|
function RlsPickerDayElement({ day, onSelect, disabled }) {
|
|
1924
|
-
const className =
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
});
|
|
1932
|
-
}, [day, disabled]);
|
|
1913
|
+
const className = renderClassStatus('rls-picker-day__element', {
|
|
1914
|
+
disabled: day.disabled || disabled,
|
|
1915
|
+
focused: day.focused,
|
|
1916
|
+
forbidden: day.forbidden,
|
|
1917
|
+
selected: day.selected,
|
|
1918
|
+
today: day.today
|
|
1919
|
+
});
|
|
1933
1920
|
const onClick = useCallback(() => {
|
|
1934
1921
|
if (day.value && !day.disabled && !disabled) {
|
|
1935
1922
|
onSelect(day.value);
|
|
@@ -1937,7 +1924,7 @@ function RlsPickerDayElement({ day, onSelect, disabled }) {
|
|
|
1937
1924
|
}, [day.value, day.disabled, disabled, onSelect]);
|
|
1938
1925
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day__element__span", children: day.value || '??' }) }));
|
|
1939
1926
|
}
|
|
1940
|
-
function
|
|
1927
|
+
function RlsPickerDayComponent({ date, disabled, formControl, maxDate, month, minDate, onValue, rlsTheme, year }) {
|
|
1941
1928
|
const dateDay = useMemo(() => date ?? new Date(), [date]);
|
|
1942
1929
|
const [weeks, setWeeks] = useState([]);
|
|
1943
1930
|
const [value, setValue] = useState(formControl?.value ?? dateDay.getDate());
|
|
@@ -1990,20 +1977,19 @@ function RlsPickerDay({ date, disabled, formControl, maxDate, month, minDate, on
|
|
|
1990
1977
|
}, [dateDay, formControl?.value, value, month, year, minDate, maxDate]);
|
|
1991
1978
|
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
1979
|
}
|
|
1980
|
+
const RlsPickerDay = memo(RlsPickerDayComponent);
|
|
1993
1981
|
|
|
1994
1982
|
function RlsPickerDayRangeHeaders() {
|
|
1995
1983
|
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))) }));
|
|
1996
1984
|
}
|
|
1997
1985
|
function RlsPickerDayRangeElement({ day, onSelect, disabled }) {
|
|
1998
|
-
const className =
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
});
|
|
2006
|
-
}, [day.disabled, day.end, day.forbidden, day.ranged, day.source, disabled]);
|
|
1986
|
+
const className = renderClassStatus('rls-picker-day-range__element', {
|
|
1987
|
+
disabled: day.disabled || disabled,
|
|
1988
|
+
end: day.end,
|
|
1989
|
+
forbidden: day.forbidden,
|
|
1990
|
+
ranged: day.ranged,
|
|
1991
|
+
source: day.source
|
|
1992
|
+
});
|
|
2007
1993
|
const onClick = useCallback(() => {
|
|
2008
1994
|
if (day.value && !day.disabled && !disabled) {
|
|
2009
1995
|
onSelect(day.value);
|
|
@@ -2011,7 +1997,7 @@ function RlsPickerDayRangeElement({ day, onSelect, disabled }) {
|
|
|
2011
1997
|
}, [day.value, day.disabled, disabled, onSelect]);
|
|
2012
1998
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day-range__element__span", children: day.value || '??' }) }));
|
|
2013
1999
|
}
|
|
2014
|
-
function
|
|
2000
|
+
function RlsPickerDayRangeComponent({ date, disabled, formControl, maxDate, minDate, rlsTheme }) {
|
|
2015
2001
|
const rangeDay = useMemo(() => {
|
|
2016
2002
|
return formControl?.value ?? DateRange.now();
|
|
2017
2003
|
}, [formControl?.value]);
|
|
@@ -2047,6 +2033,7 @@ function RlsPickerDayRange({ date, disabled, formControl, maxDate, minDate, rlsT
|
|
|
2047
2033
|
}, [dateDayRange, range, minDate, maxDate]);
|
|
2048
2034
|
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
2035
|
}
|
|
2036
|
+
const RlsPickerDayRange = memo(RlsPickerDayRangeComponent);
|
|
2050
2037
|
|
|
2051
2038
|
function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
2052
2039
|
const [label, setLabel] = useState(MONTH_NAMES(month.value));
|
|
@@ -2055,13 +2042,11 @@ function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
|
2055
2042
|
setLabel(MONTH_NAMES(month.value));
|
|
2056
2043
|
});
|
|
2057
2044
|
}, []);
|
|
2058
|
-
const className =
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
});
|
|
2064
|
-
}, [month.disabled, month.focused, month.selected, disabled]);
|
|
2045
|
+
const className = renderClassStatus('rls-picker-month__component', {
|
|
2046
|
+
disabled: month.disabled || disabled,
|
|
2047
|
+
focused: month.focused,
|
|
2048
|
+
selected: month.selected
|
|
2049
|
+
});
|
|
2065
2050
|
const onClick = useCallback(() => {
|
|
2066
2051
|
if (valueIsDefined(month.value) && !month.disabled && !disabled) {
|
|
2067
2052
|
onSelect(month.value);
|
|
@@ -2069,7 +2054,7 @@ function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
|
2069
2054
|
}, [month.value, month.disabled, disabled, onSelect]);
|
|
2070
2055
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-month__span", children: label }) }));
|
|
2071
2056
|
}
|
|
2072
|
-
function
|
|
2057
|
+
function RlsPickerMonthComponent({ date, disabled, formControl, maxDate, minDate, onValue, rlsTheme, year }) {
|
|
2073
2058
|
const dateMonth = useMemo(() => date ?? new Date(), [date]);
|
|
2074
2059
|
const [months, setMonths] = useState([]);
|
|
2075
2060
|
const [value, setValue] = useState(formControl?.value ?? dateMonth.getMonth());
|
|
@@ -2118,8 +2103,9 @@ function RlsPickerMonth({ date, disabled, formControl, maxDate, minDate, onValue
|
|
|
2118
2103
|
}, [formControl?.value]);
|
|
2119
2104
|
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
2105
|
}
|
|
2106
|
+
const RlsPickerMonth = memo(RlsPickerMonthComponent);
|
|
2121
2107
|
|
|
2122
|
-
function
|
|
2108
|
+
function RlsPickerSelectorTitleComponent({ monthControl, type, yearControl, date, disabled, maxDate, minDate, onClick }) {
|
|
2123
2109
|
const { limitNext, limitPrevious } = useMemo(() => {
|
|
2124
2110
|
return monthLimitTemplate({
|
|
2125
2111
|
date,
|
|
@@ -2195,15 +2181,14 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
|
|
|
2195
2181
|
}, [type, onNextMonth, onNextYear]);
|
|
2196
2182
|
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
2183
|
}
|
|
2184
|
+
const RlsPickerSelectorTitle = memo(RlsPickerSelectorTitleComponent);
|
|
2198
2185
|
|
|
2199
2186
|
function RlsPickerYearElement({ onSelect, year, disabled }) {
|
|
2200
|
-
const className =
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
});
|
|
2206
|
-
}, [year.disabled, year.focused, year.selected, disabled]);
|
|
2187
|
+
const className = renderClassStatus('rls-picker-year__element', {
|
|
2188
|
+
disabled: year.disabled || disabled,
|
|
2189
|
+
focused: year.focused,
|
|
2190
|
+
selected: year.selected
|
|
2191
|
+
});
|
|
2207
2192
|
const onClick = useCallback(() => {
|
|
2208
2193
|
if (year.value && !year.disabled && !disabled) {
|
|
2209
2194
|
onSelect(year.value);
|
|
@@ -2211,7 +2196,7 @@ function RlsPickerYearElement({ onSelect, year, disabled }) {
|
|
|
2211
2196
|
}, [year.value, year.disabled, disabled, onSelect]);
|
|
2212
2197
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-year__span", children: year.value || '????' }) }));
|
|
2213
2198
|
}
|
|
2214
|
-
function
|
|
2199
|
+
function RlsPickerYearComponent({ date, disabled, formControl, maxDate, minDate, onValue, rlsTheme }) {
|
|
2215
2200
|
const dateYear = useMemo(() => date ?? new Date(), [date]);
|
|
2216
2201
|
const [year, setYear] = useState(formControl?.value ?? dateYear.getFullYear());
|
|
2217
2202
|
const createPickerOptions = useCallback(() => {
|
|
@@ -2256,6 +2241,7 @@ function RlsPickerYear({ date, disabled, formControl, maxDate, minDate, onValue,
|
|
|
2256
2241
|
}, []);
|
|
2257
2242
|
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
2243
|
}
|
|
2244
|
+
const RlsPickerYear = memo(RlsPickerYearComponent);
|
|
2259
2245
|
|
|
2260
2246
|
function calculateInitialValue(value, minValue, maxValue) {
|
|
2261
2247
|
return minValue > value ? minValue : maxValue < value ? maxValue : value;
|
|
@@ -2265,7 +2251,7 @@ function calculateInitialRate(value, minValue, maxValue) {
|
|
|
2265
2251
|
const rateValue = value - minValue;
|
|
2266
2252
|
return Math.ceil((rateValue / rateMax) * 100);
|
|
2267
2253
|
}
|
|
2268
|
-
function
|
|
2254
|
+
function RlsSliderComponent({ children, className, disabled, formControl, identifier, maxValue, minValue, onValue, prefixIcon, rlsTheme, value }) {
|
|
2269
2255
|
const minValueSlider = useMemo(() => {
|
|
2270
2256
|
return minValue ?? 0;
|
|
2271
2257
|
}, [minValue]);
|
|
@@ -2278,13 +2264,11 @@ function RlsSlider({ children, className, disabled, formControl, identifier, max
|
|
|
2278
2264
|
const refTrack = useRef(null);
|
|
2279
2265
|
const refTrackOn = useRef(null);
|
|
2280
2266
|
const refThumb = useRef(null);
|
|
2281
|
-
const classNameSlider =
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
}, className);
|
|
2287
|
-
}, [valueSlider, minValueSlider, maxValueSlider, disabled]);
|
|
2267
|
+
const classNameSlider = renderClassStatus('rls-slider', {
|
|
2268
|
+
complet: valueSlider === maxValueSlider,
|
|
2269
|
+
disabled: disabled,
|
|
2270
|
+
empty: valueSlider === minValueSlider
|
|
2271
|
+
}, className);
|
|
2288
2272
|
useEffect(() => {
|
|
2289
2273
|
const valueInitial = formControl?.value ?? value ?? 0;
|
|
2290
2274
|
refThumb.current.style.left = `${rate}%`;
|
|
@@ -2311,14 +2295,13 @@ function RlsSlider({ children, className, disabled, formControl, identifier, max
|
|
|
2311
2295
|
}, [minValueSlider, maxValueSlider]);
|
|
2312
2296
|
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
2297
|
}
|
|
2298
|
+
const RlsSlider = memo(RlsSliderComponent);
|
|
2314
2299
|
|
|
2315
2300
|
function RlsTab({ onSelect, tab, value }) {
|
|
2316
|
-
const className =
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
});
|
|
2321
|
-
}, [tab, value]);
|
|
2301
|
+
const className = renderClassStatus('rls-tabs__children', {
|
|
2302
|
+
active: tab.value === value,
|
|
2303
|
+
disabled: tab.disabled
|
|
2304
|
+
});
|
|
2322
2305
|
const onClick = useCallback(() => {
|
|
2323
2306
|
if (!tab.disabled) {
|
|
2324
2307
|
onSelect(tab.value);
|
|
@@ -2326,7 +2309,7 @@ function RlsTab({ onSelect, tab, value }) {
|
|
|
2326
2309
|
}, [tab.disabled]);
|
|
2327
2310
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { children: tab.label }) }));
|
|
2328
2311
|
}
|
|
2329
|
-
function
|
|
2312
|
+
function RlsTabsComponent({ tabs, onValue, rlsTheme }) {
|
|
2330
2313
|
const [value, setValue] = useState();
|
|
2331
2314
|
const onSelect = useCallback((value) => {
|
|
2332
2315
|
setValue(value);
|
|
@@ -2342,15 +2325,15 @@ function RlsTabs({ tabs, onValue, rlsTheme }) {
|
|
|
2342
2325
|
return (jsxRuntimeExports.jsx(RlsTab, { tab: tab, value: value, onSelect: onSelect }, index));
|
|
2343
2326
|
}) }));
|
|
2344
2327
|
}
|
|
2328
|
+
const RlsTabs = memo(RlsTabsComponent);
|
|
2345
2329
|
|
|
2346
|
-
function
|
|
2330
|
+
function RlsToolbarComponent({ actions, children, subtitle }) {
|
|
2347
2331
|
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
2332
|
}
|
|
2333
|
+
const RlsToolbar = memo(RlsToolbarComponent);
|
|
2349
2334
|
|
|
2350
|
-
function
|
|
2351
|
-
const classNameSheet =
|
|
2352
|
-
return renderClassStatus('rls-bottom-sheet', { visible: controller?.visible ?? visible }, className);
|
|
2353
|
-
}, [className, visible, controller?.visible]);
|
|
2335
|
+
function RlsBottomSheetComponent({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2336
|
+
const classNameSheet = renderClassStatus('rls-bottom-sheet', { visible: controller?.visible ?? visible }, className);
|
|
2354
2337
|
const onClickBackdrop = useCallback(() => {
|
|
2355
2338
|
if (autoclose) {
|
|
2356
2339
|
controller?.close();
|
|
@@ -2359,13 +2342,13 @@ function RlsBottomSheet({ autoclose, children, className, controller, onBackdrop
|
|
|
2359
2342
|
}, [autoclose, controller, onBackdrop]);
|
|
2360
2343
|
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
2344
|
}
|
|
2345
|
+
const RlsBottomSheet = memo(RlsBottomSheetComponent);
|
|
2362
2346
|
|
|
2363
|
-
function
|
|
2364
|
-
const classNameCard =
|
|
2365
|
-
return renderClassStatus('rls-card', { outline }, className);
|
|
2366
|
-
}, [outline, className]);
|
|
2347
|
+
function RlsCardComponent({ children, className, outline, rlsTheme }) {
|
|
2348
|
+
const classNameCard = renderClassStatus('rls-card', { outline }, className);
|
|
2367
2349
|
return (jsxRuntimeExports.jsx("div", { className: classNameCard, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-card__content", children: children }) }));
|
|
2368
2350
|
}
|
|
2351
|
+
const RlsCard = memo(RlsCardComponent);
|
|
2369
2352
|
|
|
2370
2353
|
class ConfirmationResult extends SealedPartial {
|
|
2371
2354
|
static approved() {
|
|
@@ -2375,12 +2358,11 @@ class ConfirmationResult extends SealedPartial {
|
|
|
2375
2358
|
return new ConfirmationResult('reject');
|
|
2376
2359
|
}
|
|
2377
2360
|
}
|
|
2378
|
-
function
|
|
2379
|
-
const classConfirmation =
|
|
2380
|
-
return renderClassStatus('rls-confirmation', { visible }, className);
|
|
2381
|
-
}, [visible, className]);
|
|
2361
|
+
function RlsConfirmationComponent({ approved, className, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
2362
|
+
const classConfirmation = renderClassStatus('rls-confirmation', { visible }, className);
|
|
2382
2363
|
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
2364
|
}
|
|
2365
|
+
const RlsConfirmation = memo(RlsConfirmationComponent);
|
|
2384
2366
|
function useConfirmation() {
|
|
2385
2367
|
const [config, setConfig] = useState({});
|
|
2386
2368
|
const [visible, setVisible] = useState(false);
|
|
@@ -2407,7 +2389,7 @@ function useConfirmation() {
|
|
|
2407
2389
|
setVisible(false);
|
|
2408
2390
|
resolve(ConfirmationResult.reject());
|
|
2409
2391
|
},
|
|
2410
|
-
type: options.reject.type ?? '
|
|
2392
|
+
type: options.reject.type ?? 'flat',
|
|
2411
2393
|
disabled: options.reject.disabled,
|
|
2412
2394
|
identifier: options.reject.identifier,
|
|
2413
2395
|
rlsTheme: options.reject.rlsTheme
|
|
@@ -2446,68 +2428,59 @@ function useDatatable(table) {
|
|
|
2446
2428
|
return { refTable, scrolleable };
|
|
2447
2429
|
}
|
|
2448
2430
|
|
|
2449
|
-
function
|
|
2431
|
+
function RlsDatatableComponent({ children, footer, header, identifier, rlsTheme, resizable, summary, table, toolbar }) {
|
|
2450
2432
|
const datatable = useDatatable(table);
|
|
2451
|
-
const className =
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
});
|
|
2456
|
-
}, [resizable, datatable.scrolleable]);
|
|
2433
|
+
const className = renderClassStatus('rls-datatable', {
|
|
2434
|
+
resizable,
|
|
2435
|
+
scrolleable: resizable && datatable?.scrolleable
|
|
2436
|
+
});
|
|
2457
2437
|
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
2438
|
}
|
|
2459
|
-
|
|
2439
|
+
const RlsDatatable = memo(RlsDatatableComponent);
|
|
2440
|
+
function RlsDatatableHeaderComponent({ children, identifier, rlsTheme }) {
|
|
2460
2441
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: "rls-datatable__header", "rls-theme": rlsTheme, children: children }));
|
|
2461
2442
|
}
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
}, [className, truncated, control]);
|
|
2443
|
+
const RlsDatatableHeader = memo(RlsDatatableHeaderComponent);
|
|
2444
|
+
function RlsDatatableTitleComponent({ actions, children, className, control, identifier, rlsTheme, truncated }) {
|
|
2445
|
+
const classNameTitle = renderClassStatus('rls-datatable__title', { actions, control, truncated }, className);
|
|
2466
2446
|
return (jsxRuntimeExports.jsx("th", { id: identifier, className: classNameTitle, "rls-theme": rlsTheme, children: children }));
|
|
2467
2447
|
}
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
}, [className]);
|
|
2448
|
+
const RlsDatatableTitle = memo(RlsDatatableTitleComponent);
|
|
2449
|
+
function RlsDatatableSubheaderComponent({ children, className, identifier, rlsTheme }) {
|
|
2450
|
+
const classNameSubheader = renderClassStatus('rls-datatable__subheader', {}, className);
|
|
2472
2451
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameSubheader, "rls-theme": rlsTheme, children: children }));
|
|
2473
2452
|
}
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
}, [className, truncated, error, info, success, warning]);
|
|
2453
|
+
const RlsDatatableSubheader = memo(RlsDatatableSubheaderComponent);
|
|
2454
|
+
function RlsDatatableRecordComponent({ children, className, error, identifier, info, rlsTheme, success, truncated, warning }) {
|
|
2455
|
+
const classNameRecord = renderClassStatus('rls-datatable__record', { error, info, truncated, success, warning }, className);
|
|
2478
2456
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameRecord, "rls-theme": rlsTheme, children: children }));
|
|
2479
2457
|
}
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
}, [className, truncated, error, info, success, warning]);
|
|
2458
|
+
const RlsDatatableRecord = memo(RlsDatatableRecordComponent);
|
|
2459
|
+
function RlsDatatableTotalsComponent({ children, className, error, identifier, info, rlsTheme, success, truncated, warning }) {
|
|
2460
|
+
const classNameTotals = renderClassStatus('rls-datatable__totals', { error, info, truncated, success, warning }, className);
|
|
2484
2461
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameTotals, "rls-theme": rlsTheme, children: children }));
|
|
2485
2462
|
}
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
}, [className, truncated, control]);
|
|
2463
|
+
const RlsDatatableTotals = memo(RlsDatatableTotalsComponent);
|
|
2464
|
+
function RlsDatatableCellComponent({ actions, children, className, control, identifier, rlsTheme, truncated }) {
|
|
2465
|
+
const classNameCell = renderClassStatus('rls-datatable__cell', { actions, control, truncated }, className);
|
|
2490
2466
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameCell, "rls-theme": rlsTheme, children: children }));
|
|
2491
2467
|
}
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
}, [className, truncated, control]);
|
|
2468
|
+
const RlsDatatableCell = memo(RlsDatatableCellComponent);
|
|
2469
|
+
function RlsDatatableDataComponent({ actions, children, className, control, identifier, truncated }) {
|
|
2470
|
+
const classNameData = renderClassStatus('rls-datatable__data', { actions, control, truncated }, className);
|
|
2496
2471
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameData, children: children }));
|
|
2497
2472
|
}
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
}, [className, invested]);
|
|
2473
|
+
const RlsDatatableData = memo(RlsDatatableDataComponent);
|
|
2474
|
+
function RlsDatatableFloatingComponent({ children, className, identifier, invested, rlsTheme }) {
|
|
2475
|
+
const classNameFloating = renderClassStatus('rls-datatable__floating', { invested }, className);
|
|
2502
2476
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameFloating, "rls-theme": rlsTheme, children: children }));
|
|
2503
2477
|
}
|
|
2478
|
+
const RlsDatatableFloating = memo(RlsDatatableFloatingComponent);
|
|
2504
2479
|
|
|
2505
|
-
function
|
|
2506
|
-
const className =
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
});
|
|
2510
|
-
}, [controller.visible]);
|
|
2480
|
+
function RlsDropdownComponent({ children, controller, rlsTheme }) {
|
|
2481
|
+
const className = renderClassStatus('rls-dropdown', {
|
|
2482
|
+
visible: controller.visible
|
|
2483
|
+
});
|
|
2511
2484
|
useEffect(() => {
|
|
2512
2485
|
function onCloseDropdown({ target }) {
|
|
2513
2486
|
if (!controller.component.current.contains(target)) {
|
|
@@ -2521,6 +2494,7 @@ function RlsDropdown({ children, controller, rlsTheme }) {
|
|
|
2521
2494
|
}, []);
|
|
2522
2495
|
return (jsxRuntimeExports.jsx("div", { ref: controller.component, className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-dropdown__content", children: children }) }));
|
|
2523
2496
|
}
|
|
2497
|
+
const RlsDropdown = memo(RlsDropdownComponent);
|
|
2524
2498
|
|
|
2525
2499
|
const MAX_LIST_HEIGHT_REM$1 = 90;
|
|
2526
2500
|
const FALLBACK_REM_SIZE$1 = 16;
|
|
@@ -2531,6 +2505,17 @@ function getRemSize$1() {
|
|
|
2531
2505
|
const fontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
2532
2506
|
return fontSize > 0 ? fontSize : FALLBACK_REM_SIZE$1;
|
|
2533
2507
|
}
|
|
2508
|
+
function suggestionsShallowEqual(a, b) {
|
|
2509
|
+
return (a === b ||
|
|
2510
|
+
(a.length === b.length && a.every((element, index) => element === b[index])));
|
|
2511
|
+
}
|
|
2512
|
+
function useStableSuggestions(suggestions) {
|
|
2513
|
+
const suggestionsRef = useRef(suggestions);
|
|
2514
|
+
if (!suggestionsShallowEqual(suggestionsRef.current, suggestions)) {
|
|
2515
|
+
suggestionsRef.current = suggestions;
|
|
2516
|
+
}
|
|
2517
|
+
return suggestionsRef.current;
|
|
2518
|
+
}
|
|
2534
2519
|
function shouldDisplayHigher$1(content, list) {
|
|
2535
2520
|
if (!content) {
|
|
2536
2521
|
return false;
|
|
@@ -2548,13 +2533,13 @@ function shouldDisplayHigher$1(content, list) {
|
|
|
2548
2533
|
}
|
|
2549
2534
|
return spaceAbove > spaceBelow;
|
|
2550
2535
|
}
|
|
2551
|
-
function useListController(
|
|
2552
|
-
const { suggestions, automatic, formControl, reference } = props;
|
|
2536
|
+
function useListController({ suggestions, automatic, formControl, reference }) {
|
|
2553
2537
|
const refContent = useRef(null);
|
|
2554
2538
|
const refList = useRef(null);
|
|
2555
2539
|
const refInput = useRef(null);
|
|
2556
2540
|
const listIsOpen = useRef(false);
|
|
2557
|
-
const
|
|
2541
|
+
const stableSuggestions = useStableSuggestions(suggestions);
|
|
2542
|
+
const collection = useMemo(() => new ListCollection(stableSuggestions, reference), [stableSuggestions]);
|
|
2558
2543
|
const [state, refreshState] = useState({
|
|
2559
2544
|
focused: false,
|
|
2560
2545
|
higher: false,
|
|
@@ -2583,9 +2568,6 @@ function useListController(props) {
|
|
|
2583
2568
|
formControl?.touch();
|
|
2584
2569
|
}
|
|
2585
2570
|
}, [state.listIsVisible]);
|
|
2586
|
-
useEffect(() => {
|
|
2587
|
-
setCollection(new ListCollection(suggestions, reference));
|
|
2588
|
-
}, [suggestions]);
|
|
2589
2571
|
useEffect(() => {
|
|
2590
2572
|
if (!changeValueInternal.current) {
|
|
2591
2573
|
if (formControl?.value) {
|
|
@@ -2609,7 +2591,7 @@ function useListController(props) {
|
|
|
2609
2591
|
setFormValue(element);
|
|
2610
2592
|
}
|
|
2611
2593
|
else {
|
|
2612
|
-
refreshState({ ...state, value: '' });
|
|
2594
|
+
refreshState((state) => ({ ...state, value: '' }));
|
|
2613
2595
|
}
|
|
2614
2596
|
}
|
|
2615
2597
|
else {
|
|
@@ -2617,20 +2599,20 @@ function useListController(props) {
|
|
|
2617
2599
|
setFormValue(collection.value[0], true);
|
|
2618
2600
|
}
|
|
2619
2601
|
else {
|
|
2620
|
-
refreshState({ ...state, value: '' });
|
|
2602
|
+
refreshState((state) => ({ ...state, value: '' }));
|
|
2621
2603
|
}
|
|
2622
2604
|
}
|
|
2623
2605
|
}
|
|
2624
2606
|
changeValueInternal.current = false;
|
|
2625
2607
|
}, [collection, formControl?.value]);
|
|
2626
2608
|
const setState = useCallback((state) => {
|
|
2627
|
-
const
|
|
2609
|
+
const newState = state.listIsVisible
|
|
2628
2610
|
? {
|
|
2629
2611
|
...state,
|
|
2630
2612
|
higher: shouldDisplayHigher$1(refContent.current, refList.current)
|
|
2631
2613
|
}
|
|
2632
2614
|
: state;
|
|
2633
|
-
refreshState((
|
|
2615
|
+
refreshState((currentState) => ({ ...currentState, ...newState }));
|
|
2634
2616
|
}, []);
|
|
2635
2617
|
const setFormValue = useCallback((element, valueIsDefault = false) => {
|
|
2636
2618
|
refreshState((state) => ({
|
|
@@ -2647,23 +2629,25 @@ function useListController(props) {
|
|
|
2647
2629
|
}, [formControl]);
|
|
2648
2630
|
const navigationInput = useCallback((event) => {
|
|
2649
2631
|
if (state.listIsVisible) {
|
|
2650
|
-
const
|
|
2632
|
+
const newPosition = navigationListFromInput({
|
|
2651
2633
|
content: refContent.current,
|
|
2652
2634
|
event: event,
|
|
2635
|
+
higher: state.higher,
|
|
2653
2636
|
list: refList.current
|
|
2654
2637
|
});
|
|
2655
|
-
position.current =
|
|
2638
|
+
position.current = newPosition ?? 0;
|
|
2656
2639
|
}
|
|
2657
|
-
}, [state.listIsVisible]);
|
|
2640
|
+
}, [state.listIsVisible, state.higher]);
|
|
2658
2641
|
const navigationElement = useCallback((event) => {
|
|
2659
2642
|
position.current = navigationListFromElement({
|
|
2660
2643
|
content: refContent.current,
|
|
2661
2644
|
event: event,
|
|
2645
|
+
higher: state.higher,
|
|
2662
2646
|
input: refInput.current,
|
|
2663
2647
|
list: refList.current,
|
|
2664
2648
|
position: position.current
|
|
2665
2649
|
});
|
|
2666
|
-
}, [state.
|
|
2650
|
+
}, [state.higher]);
|
|
2667
2651
|
return {
|
|
2668
2652
|
...state,
|
|
2669
2653
|
navigationElement,
|
|
@@ -2819,7 +2803,7 @@ function useFieldAutocomplete(props) {
|
|
|
2819
2803
|
};
|
|
2820
2804
|
}
|
|
2821
2805
|
|
|
2822
|
-
function
|
|
2806
|
+
function RlsFieldAutocompleteTemplateComponent(props) {
|
|
2823
2807
|
const autocomplete = useFieldAutocomplete(props);
|
|
2824
2808
|
const { render, action, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2825
2809
|
const [listInputPlaceholder, setListInputPlaceholder] = useState(reactI18n('listInputPlaceholder'));
|
|
@@ -2834,22 +2818,13 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2834
2818
|
const disabled = useMemo(() => {
|
|
2835
2819
|
return formControl?.disabled || props.disabled;
|
|
2836
2820
|
}, [formControl?.disabled, props.disabled]);
|
|
2837
|
-
const className =
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
}, `rls-field-list rls-field-autocomplete ${props.className ?? ''}`);
|
|
2845
|
-
}, [
|
|
2846
|
-
formControl?.wrong,
|
|
2847
|
-
autocomplete.value,
|
|
2848
|
-
autocomplete.focused,
|
|
2849
|
-
props.className,
|
|
2850
|
-
props.readOnly,
|
|
2851
|
-
disabled
|
|
2852
|
-
]);
|
|
2821
|
+
const className = renderClassStatus('rls-field-box', {
|
|
2822
|
+
focused: autocomplete.focused && !disabled,
|
|
2823
|
+
error: formControl?.wrong,
|
|
2824
|
+
disabled,
|
|
2825
|
+
readonly: props.readOnly,
|
|
2826
|
+
selected: !!autocomplete.value
|
|
2827
|
+
}, `rls-field-list rls-field-autocomplete ${props.className ?? ''}`);
|
|
2853
2828
|
const onClickPattern = useCallback(() => {
|
|
2854
2829
|
onSearch?.(autocomplete.pattern);
|
|
2855
2830
|
}, [onSearch, autocomplete.pattern]);
|
|
@@ -2883,15 +2858,15 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2883
2858
|
]);
|
|
2884
2859
|
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
2860
|
}
|
|
2886
|
-
|
|
2861
|
+
const RlsFieldAutocompleteTemplate = memo(RlsFieldAutocompleteTemplateComponent);
|
|
2862
|
+
function RlsFieldAutocompleteComponent(props) {
|
|
2887
2863
|
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
2864
|
return jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: render });
|
|
2889
2865
|
}
|
|
2866
|
+
const RlsFieldAutocomplete = memo(RlsFieldAutocompleteComponent);
|
|
2890
2867
|
|
|
2891
|
-
function
|
|
2892
|
-
const classNameModal =
|
|
2893
|
-
return renderClassStatus('rls-modal', { visible: controller?.visible ?? visible }, className);
|
|
2894
|
-
}, [className, visible, controller?.visible]);
|
|
2868
|
+
function RlsModalComponent({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2869
|
+
const classNameModal = renderClassStatus('rls-modal', { visible: controller?.visible ?? visible }, className);
|
|
2895
2870
|
const onClickBackdrop = useCallback(() => {
|
|
2896
2871
|
if (autoclose) {
|
|
2897
2872
|
controller?.close();
|
|
@@ -2900,6 +2875,7 @@ function RlsModal({ autoclose, children, className, controller, onBackdrop, visi
|
|
|
2900
2875
|
}, [autoclose, controller, onBackdrop]);
|
|
2901
2876
|
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
2877
|
}
|
|
2878
|
+
const RlsModal = memo(RlsModalComponent);
|
|
2903
2879
|
|
|
2904
2880
|
function formatTime(value) {
|
|
2905
2881
|
return String(value).padStart(2, '0');
|
|
@@ -2933,7 +2909,7 @@ function RlsPickerClockTick({ onValue, selectionIsHours, value }) {
|
|
|
2933
2909
|
}, [onValue]);
|
|
2934
2910
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__tick", style: styleTick, onClick: onClick, children: label }));
|
|
2935
2911
|
}
|
|
2936
|
-
function
|
|
2912
|
+
function RlsPickerClockComponent({ formControl, onListener, rlsTheme, time }) {
|
|
2937
2913
|
const timeInitial = useMemo(() => {
|
|
2938
2914
|
return formControl?.value ?? time ?? Time.now();
|
|
2939
2915
|
}, [formControl?.value, time]);
|
|
@@ -2961,26 +2937,18 @@ function RlsPickerClock({ formControl, onListener, rlsTheme, time }) {
|
|
|
2961
2937
|
const minuteFormat = useMemo(() => {
|
|
2962
2938
|
return formatTime(minute);
|
|
2963
2939
|
}, [minute]);
|
|
2964
|
-
const classNameHour =
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
active: !zoneIsPM
|
|
2977
|
-
});
|
|
2978
|
-
}, [zoneIsPM]);
|
|
2979
|
-
const classNamePM = useMemo(() => {
|
|
2980
|
-
return renderClassStatus('rls-picker-clock__zone__value', {
|
|
2981
|
-
active: zoneIsPM
|
|
2982
|
-
});
|
|
2983
|
-
}, [zoneIsPM]);
|
|
2940
|
+
const classNameHour = renderClassStatus('rls-picker-clock__title__value', {
|
|
2941
|
+
active: selectionIsHours
|
|
2942
|
+
});
|
|
2943
|
+
const classNameMinute = renderClassStatus('rls-picker-clock__title__value', {
|
|
2944
|
+
active: !selectionIsHours
|
|
2945
|
+
});
|
|
2946
|
+
const classNameAM = renderClassStatus('rls-picker-clock__zone__value', {
|
|
2947
|
+
active: !zoneIsPM
|
|
2948
|
+
});
|
|
2949
|
+
const classNamePM = renderClassStatus('rls-picker-clock__zone__value', {
|
|
2950
|
+
active: zoneIsPM
|
|
2951
|
+
});
|
|
2984
2952
|
const refreshClockHour = useEffectEvent(() => {
|
|
2985
2953
|
refreshClock(hour > 12 ? hour - 12 : hour);
|
|
2986
2954
|
});
|
|
@@ -3118,29 +3086,29 @@ function RlsPickerClock({ formControl, onListener, rlsTheme, time }) {
|
|
|
3118
3086
|
transform: `translate(${DIAL_RADIUS}rem, ${DIAL_RADIUS}rem)`
|
|
3119
3087
|
}, children: [jsxRuntimeExports.jsx("line", { ref: lineElement, className: "rls-picker-clock__canvas__line", x1: "-1", y1: "-1" }), jsxRuntimeExports.jsx("circle", { ref: centerElement, className: "rls-picker-clock__canvas__center", r: "4", cx: "-1", cy: "-1" }), jsxRuntimeExports.jsx("circle", { ref: indicatorElement, className: "rls-picker-clock__canvas__indicator", r: `${TICK_RADIUS}rem` }), jsxRuntimeExports.jsx("circle", { ref: pointElement, className: "rls-picker-clock__canvas__point", r: "3.5" })] }) }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__hours", children: CLOCK_VALUES.map((value) => {
|
|
3120
3088
|
return (jsxRuntimeExports.jsx(RlsPickerClockTick, { value: value, selectionIsHours: selectionIsHours, onValue: onClickValue }, value));
|
|
3121
|
-
}) })] }) }), 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: "
|
|
3089
|
+
}) })] }) }), 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: "raised", onClick: onSelect, children: labels.timeActionSelect }) })] })] }));
|
|
3122
3090
|
}
|
|
3091
|
+
const RlsPickerClock = memo(RlsPickerClockComponent);
|
|
3123
3092
|
|
|
3124
|
-
function
|
|
3093
|
+
function RlsModalClockComponent({ controller, disabled, formControl, onClose, rlsTheme, time, visible }) {
|
|
3125
3094
|
const onListener = useCallback(({ event, value }) => {
|
|
3126
3095
|
onClose?.(event !== PickerListenerEvent.Cancel ? value : undefined);
|
|
3127
3096
|
controller?.close();
|
|
3128
3097
|
}, [onClose, controller]);
|
|
3129
3098
|
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
3099
|
}
|
|
3100
|
+
const RlsModalClock = memo(RlsModalClockComponent);
|
|
3131
3101
|
|
|
3132
|
-
function
|
|
3102
|
+
function RlsFieldClockComponent({ children, disabled: disabledProps, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, time, value: valueInitial }) {
|
|
3133
3103
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3134
3104
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3135
3105
|
const disabled = useMemo(() => {
|
|
3136
3106
|
return formControl?.disabled || disabledProps;
|
|
3137
3107
|
}, [formControl?.disabled, disabledProps]);
|
|
3138
|
-
const className =
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
});
|
|
3143
|
-
}, [disabled, readOnly]);
|
|
3108
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3109
|
+
disabled,
|
|
3110
|
+
readonly: readOnly
|
|
3111
|
+
});
|
|
3144
3112
|
const timeValue = useMemo(() => {
|
|
3145
3113
|
return formControl ? formControl.value : value;
|
|
3146
3114
|
}, [formControl?.value, value]);
|
|
@@ -3176,10 +3144,11 @@ function RlsFieldClock({ children, disabled: disabledProps, formControl, identif
|
|
|
3176
3144
|
formControl?.touch();
|
|
3177
3145
|
setModalIsVisible(false);
|
|
3178
3146
|
}, [formControl, onChange]);
|
|
3179
|
-
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 })] }));
|
|
3147
|
+
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, formControl: formControl, time: time, disabled: disabled, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3180
3148
|
}
|
|
3149
|
+
const RlsFieldClock = memo(RlsFieldClockComponent);
|
|
3181
3150
|
|
|
3182
|
-
function
|
|
3151
|
+
function RlsPickerColorComponent({ color, formControl, onListener, rlsTheme }) {
|
|
3183
3152
|
const initialColor = useMemo(() => formControl?.value ?? color ?? DEFAULT_COLOR, []);
|
|
3184
3153
|
const initialHsv = useMemo(() => hexToHsv(initialColor) ?? { h: 258, s: 100, v: 100 }, []);
|
|
3185
3154
|
const canvasRef = useRef(null);
|
|
@@ -3387,10 +3356,11 @@ function RlsPickerColor({ color, formControl, onListener, rlsTheme }) {
|
|
|
3387
3356
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-color", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__preview", children: jsxRuntimeExports.jsx("div", { ref: canvasRef, className: "rls-picker-color__canvas", style: canvasStyle, "data-slider": "canvas", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__indicator", style: {
|
|
3388
3357
|
left: indicatorPosition.left,
|
|
3389
3358
|
top: indicatorPosition.top
|
|
3390
|
-
}, 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: "
|
|
3359
|
+
}, 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: "raised", onClick: onSelect, children: labels.colorActionSelect }) })] })] }));
|
|
3391
3360
|
}
|
|
3361
|
+
const RlsPickerColor = memo(RlsPickerColorComponent);
|
|
3392
3362
|
|
|
3393
|
-
function
|
|
3363
|
+
function RlsFieldColorComponent({ children, color, disabled: disabledProps, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3394
3364
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3395
3365
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3396
3366
|
const colorValue = useMemo(() => {
|
|
@@ -3399,12 +3369,10 @@ function RlsFieldColor({ children, color, disabled: disabledProps, formControl,
|
|
|
3399
3369
|
const disabled = useMemo(() => {
|
|
3400
3370
|
return formControl?.disabled || disabledProps;
|
|
3401
3371
|
}, [formControl?.disabled, disabledProps]);
|
|
3402
|
-
const className =
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
});
|
|
3407
|
-
}, [disabled, readOnly]);
|
|
3372
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3373
|
+
disabled,
|
|
3374
|
+
readonly: readOnly
|
|
3375
|
+
});
|
|
3408
3376
|
const displayHex = useMemo(() => {
|
|
3409
3377
|
const hex = colorValue && hexIsValid(colorValue) ? colorValue : '';
|
|
3410
3378
|
return normalizeHex(hex);
|
|
@@ -3435,14 +3403,15 @@ function RlsFieldColor({ children, color, disabled: disabledProps, formControl,
|
|
|
3435
3403
|
formControl?.touch();
|
|
3436
3404
|
setModalIsVisible(false);
|
|
3437
3405
|
}, [formControl, onChange]);
|
|
3438
|
-
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-
|
|
3406
|
+
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-modal-color", visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerColor, { formControl: formControl, color: color, disabled: disabled, onListener: onListener }) })] }));
|
|
3439
3407
|
}
|
|
3408
|
+
const RlsFieldColor = memo(RlsFieldColorComponent);
|
|
3440
3409
|
|
|
3441
3410
|
const DATE_FORMAT = '{dd}/{mx}/{yy}';
|
|
3442
3411
|
const DATE_FORMAT_TITLE = '{dw}, {mx} {dd} de {yy}';
|
|
3443
3412
|
const DATE_RANGE_FORMAT = '{dd}/{mx}/{yy}';
|
|
3444
3413
|
|
|
3445
|
-
function
|
|
3414
|
+
function RlsPickerDateComponent({ automatic, date, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
3446
3415
|
const today = useRef(new Date()); // Initial current date in component
|
|
3447
3416
|
const _date = useMemo(() => {
|
|
3448
3417
|
return formControl?.value ?? date ?? today.current;
|
|
@@ -3459,13 +3428,11 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
3459
3428
|
const value = useMemo(() => {
|
|
3460
3429
|
return new Date(yearControl.value, monthControl.value, dayControl.value);
|
|
3461
3430
|
}, [yearControl.value, monthControl.value, dayControl.value]);
|
|
3462
|
-
const classNameComponent =
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
});
|
|
3468
|
-
}, [visibility]);
|
|
3431
|
+
const classNameComponent = renderClassStatus('rls-picker-date__component', {
|
|
3432
|
+
day: visibility === 'DAY',
|
|
3433
|
+
month: visibility === 'MONTH',
|
|
3434
|
+
year: visibility === 'YEAR'
|
|
3435
|
+
});
|
|
3469
3436
|
const title = useMemo(() => {
|
|
3470
3437
|
return dateFormatTemplate(value, DATE_FORMAT_TITLE);
|
|
3471
3438
|
}, [value]);
|
|
@@ -3519,30 +3486,30 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
3519
3486
|
value: value
|
|
3520
3487
|
});
|
|
3521
3488
|
}, [formControl, value, onListener]);
|
|
3522
|
-
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: "
|
|
3489
|
+
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: "raised", onClick: onSelect, children: labels.dateActionSelect }) })] }) }))] }));
|
|
3523
3490
|
}
|
|
3491
|
+
const RlsPickerDate = memo(RlsPickerDateComponent);
|
|
3524
3492
|
|
|
3525
|
-
function
|
|
3493
|
+
function RlsModalDateComponent({ automatic, controller, date, disabled, formControl, maxDate, minDate, onClose, rlsTheme, visible }) {
|
|
3526
3494
|
const onListener = useCallback(({ event, value }) => {
|
|
3527
3495
|
onClose?.(event !== PickerListenerEvent.Cancel ? value : undefined);
|
|
3528
3496
|
controller?.close();
|
|
3529
3497
|
}, [onClose, controller]);
|
|
3530
3498
|
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
3499
|
}
|
|
3500
|
+
const RlsModalDate = memo(RlsModalDateComponent);
|
|
3532
3501
|
|
|
3533
|
-
function
|
|
3534
|
-
const today =
|
|
3502
|
+
function RlsFieldDateComponent({ children, date, disabled: disabledProps, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3503
|
+
const today = useMemo(() => new Date(), []);
|
|
3535
3504
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3536
3505
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3537
3506
|
const disabled = useMemo(() => {
|
|
3538
3507
|
return formControl?.disabled || disabledProps;
|
|
3539
3508
|
}, [formControl?.disabled, disabledProps]);
|
|
3540
|
-
const className =
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
});
|
|
3545
|
-
}, [disabled, readOnly]);
|
|
3509
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3510
|
+
disabled,
|
|
3511
|
+
readonly: readOnly
|
|
3512
|
+
});
|
|
3546
3513
|
const dateValue = useMemo(() => {
|
|
3547
3514
|
return formControl ? formControl.value : value;
|
|
3548
3515
|
}, [formControl?.value, value]);
|
|
@@ -3556,7 +3523,7 @@ function RlsFieldDate({ children, date, disabled: disabledProps, formControl, fo
|
|
|
3556
3523
|
}, [dateValue, format]);
|
|
3557
3524
|
useEffect(() => {
|
|
3558
3525
|
const dateSecure = verifyDateRange({
|
|
3559
|
-
date: formControl?.value ?? date ?? today
|
|
3526
|
+
date: formControl?.value ?? date ?? today,
|
|
3560
3527
|
minDate,
|
|
3561
3528
|
maxDate
|
|
3562
3529
|
});
|
|
@@ -3589,8 +3556,9 @@ function RlsFieldDate({ children, date, disabled: disabledProps, formControl, fo
|
|
|
3589
3556
|
formControl?.touch();
|
|
3590
3557
|
setModalIsVisible(false);
|
|
3591
3558
|
}, [formControl, onChange]);
|
|
3592
|
-
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 })] }));
|
|
3559
|
+
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, formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3593
3560
|
}
|
|
3561
|
+
const RlsFieldDate = memo(RlsFieldDateComponent);
|
|
3594
3562
|
|
|
3595
3563
|
function rangeFormatTemplate({ maxDate, minDate }) {
|
|
3596
3564
|
const minFormat = dateFormatTemplate(minDate, DATE_RANGE_FORMAT);
|
|
@@ -3598,7 +3566,7 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
3598
3566
|
return `${minFormat} - ${maxFormat}`;
|
|
3599
3567
|
}
|
|
3600
3568
|
|
|
3601
|
-
function
|
|
3569
|
+
function RlsPickerDateRangeComponent({ automatic, date: datePicker, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
3602
3570
|
const _date = useMemo(() => normalizeMinTime(datePicker ?? new Date()), [datePicker]);
|
|
3603
3571
|
const _range = useMemo(() => formControl?.value ?? DateRange.now(), [formControl?.value]);
|
|
3604
3572
|
const yearControl = useReactControl(_date.getFullYear());
|
|
@@ -3622,16 +3590,14 @@ function RlsPickerDateRange({ automatic, date: datePicker, disabled, formControl
|
|
|
3622
3590
|
}
|
|
3623
3591
|
return value;
|
|
3624
3592
|
}, [_date, yearControl.value, monthControl.value]);
|
|
3625
|
-
const classNameComponent =
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
return renderClassStatus('rls-picker-date-range__footer', { automatic });
|
|
3634
|
-
}, [automatic]);
|
|
3593
|
+
const classNameComponent = renderClassStatus('rls-picker-date-range__component', {
|
|
3594
|
+
day: visibility === 'DAY',
|
|
3595
|
+
month: visibility === 'MONTH',
|
|
3596
|
+
year: visibility === 'YEAR'
|
|
3597
|
+
});
|
|
3598
|
+
const classNameFooter = renderClassStatus('rls-picker-date-range__footer', {
|
|
3599
|
+
automatic
|
|
3600
|
+
});
|
|
3635
3601
|
const title = useMemo(() => rangeFormatTemplate(value), [value]);
|
|
3636
3602
|
useEffect(() => {
|
|
3637
3603
|
return i18nSubscribe(() => {
|
|
@@ -3662,30 +3628,30 @@ function RlsPickerDateRange({ automatic, date: datePicker, disabled, formControl
|
|
|
3662
3628
|
formControl?.setValue(value);
|
|
3663
3629
|
onListener?.({ event: PickerListenerEvent.Select, value });
|
|
3664
3630
|
}, [formControl, value, onListener]);
|
|
3665
|
-
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: "
|
|
3631
|
+
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: "raised", onClick: onSelect, children: labels.dateActionSelect }) })] }) })] }));
|
|
3666
3632
|
}
|
|
3633
|
+
const RlsPickerDateRange = memo(RlsPickerDateRangeComponent);
|
|
3667
3634
|
|
|
3668
|
-
function
|
|
3635
|
+
function RlsModalDateRangeComponent({ automatic, controller, date, disabled, formControl, maxDate, minDate, onClose, rlsTheme, visible }) {
|
|
3669
3636
|
const onListener = useCallback(({ event, value }) => {
|
|
3670
3637
|
onClose?.(event !== PickerListenerEvent.Cancel ? value : undefined);
|
|
3671
3638
|
controller?.close();
|
|
3672
3639
|
}, [onClose, controller]);
|
|
3673
3640
|
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
3641
|
}
|
|
3642
|
+
const RlsModalDateRange = memo(RlsModalDateRangeComponent);
|
|
3675
3643
|
|
|
3676
|
-
function
|
|
3644
|
+
function RlsFieldDateRangeComponent({ children, date, disabled: disabledProps, formControl, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3677
3645
|
const currentDate = useMemo(() => date ?? new Date(), [date]);
|
|
3678
3646
|
const [value, setValue] = useState(formControl?.value || valueInitial);
|
|
3679
3647
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3680
3648
|
const disabled = useMemo(() => {
|
|
3681
3649
|
return formControl?.disabled || disabledProps;
|
|
3682
3650
|
}, [formControl?.disabled, disabledProps]);
|
|
3683
|
-
const className =
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
});
|
|
3688
|
-
}, [disabled, readOnly]);
|
|
3651
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3652
|
+
disabled,
|
|
3653
|
+
readonly: readOnly
|
|
3654
|
+
});
|
|
3689
3655
|
const dateRangeValue = useMemo(() => {
|
|
3690
3656
|
return formControl ? formControl.value : value;
|
|
3691
3657
|
}, [formControl?.value, value]);
|
|
@@ -3721,8 +3687,9 @@ function RlsFieldDateRange({ children, date, disabled: disabledProps, formContro
|
|
|
3721
3687
|
formControl?.touch();
|
|
3722
3688
|
setModalIsVisible(false);
|
|
3723
3689
|
}, [formControl, onChange]);
|
|
3724
|
-
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 })] }));
|
|
3690
|
+
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, formControl: formControl, date: currentDate, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3725
3691
|
}
|
|
3692
|
+
const RlsFieldDateRange = memo(RlsFieldDateRangeComponent);
|
|
3726
3693
|
|
|
3727
3694
|
const MAX_LIST_HEIGHT_REM = 90;
|
|
3728
3695
|
const FALLBACK_REM_SIZE = 16;
|
|
@@ -3862,32 +3829,26 @@ function RlsFieldListInner({ render, suggestions, action, children, formControl,
|
|
|
3862
3829
|
const disabled = useMemo(() => {
|
|
3863
3830
|
return formControl?.disabled || props.disabled;
|
|
3864
3831
|
}, [formControl?.disabled, props.disabled]);
|
|
3865
|
-
const className =
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
}, `rls-field-list rls-field-list__multi ${props.className ?? ''}`);
|
|
3872
|
-
}, [
|
|
3873
|
-
formControl?.wrong,
|
|
3874
|
-
fieldList.listIsVisible,
|
|
3875
|
-
props.className,
|
|
3876
|
-
props.readOnly,
|
|
3877
|
-
disabled
|
|
3878
|
-
]);
|
|
3832
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3833
|
+
focused: fieldList.listIsVisible && !disabled,
|
|
3834
|
+
error: formControl?.wrong,
|
|
3835
|
+
disabled,
|
|
3836
|
+
readonly: props.readOnly
|
|
3837
|
+
}, `rls-field-list rls-field-list__multi ${props.className ?? ''}`);
|
|
3879
3838
|
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
3839
|
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
3840
|
}
|
|
3882
|
-
function
|
|
3841
|
+
function RlsFieldListTemplateComponent(props) {
|
|
3883
3842
|
const fieldList = useFieldList(props);
|
|
3884
3843
|
return jsxRuntimeExports.jsx(RlsFieldListInner, { ...props, fieldList: fieldList });
|
|
3885
3844
|
}
|
|
3886
|
-
|
|
3845
|
+
const RlsFieldListTemplate = memo(RlsFieldListTemplateComponent);
|
|
3846
|
+
function RlsFieldListComponent(props) {
|
|
3887
3847
|
const fieldList = useFieldList(props);
|
|
3888
3848
|
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
3849
|
return jsxRuntimeExports.jsx(RlsFieldListInner, { ...props, render: render, fieldList: fieldList });
|
|
3890
3850
|
}
|
|
3851
|
+
const RlsFieldList = memo(RlsFieldListComponent);
|
|
3891
3852
|
|
|
3892
3853
|
function useFieldSelect(props) {
|
|
3893
3854
|
const controller = useListController(props);
|
|
@@ -3997,39 +3958,32 @@ function useFieldSelect(props) {
|
|
|
3997
3958
|
};
|
|
3998
3959
|
}
|
|
3999
3960
|
|
|
4000
|
-
function
|
|
3961
|
+
function RlsFieldSelectTemplateComponent(props) {
|
|
4001
3962
|
const select = useFieldSelect(props);
|
|
4002
3963
|
const { render, suggestions, action, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
4003
3964
|
const disabled = useMemo(() => {
|
|
4004
3965
|
return formControl?.disabled || props.disabled;
|
|
4005
3966
|
}, [formControl?.disabled, props.disabled]);
|
|
4006
|
-
const className =
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
}, `rls-field-list rls-field-select ${props.className ?? ''}`);
|
|
4013
|
-
}, [
|
|
4014
|
-
formControl?.wrong,
|
|
4015
|
-
select.focused,
|
|
4016
|
-
props.className,
|
|
4017
|
-
props.readOnly,
|
|
4018
|
-
disabled
|
|
4019
|
-
]);
|
|
3967
|
+
const className = renderClassStatus('rls-field-box', {
|
|
3968
|
+
focused: select.focused && !disabled,
|
|
3969
|
+
error: formControl?.wrong,
|
|
3970
|
+
disabled: disabled,
|
|
3971
|
+
readonly: props.readOnly
|
|
3972
|
+
}, `rls-field-list rls-field-select ${props.className ?? ''}`);
|
|
4020
3973
|
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
3974
|
}
|
|
4022
|
-
|
|
3975
|
+
const RlsFieldSelectTemplate = memo(RlsFieldSelectTemplateComponent);
|
|
3976
|
+
function RlsFieldSelectComponent(props) {
|
|
4023
3977
|
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
3978
|
return jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: render });
|
|
4025
3979
|
}
|
|
3980
|
+
const RlsFieldSelect = memo(RlsFieldSelectComponent);
|
|
4026
3981
|
|
|
4027
|
-
function
|
|
4028
|
-
const classNameForm =
|
|
4029
|
-
return renderClassStatus('rls-form-navigation', { visible: controller?.visible ?? visible }, className);
|
|
4030
|
-
}, [className, visible, controller?.visible]);
|
|
3982
|
+
function RlsFormNavigationComponent({ children, className, controller, visible, rlsTheme }) {
|
|
3983
|
+
const classNameForm = renderClassStatus('rls-form-navigation', { visible: controller?.visible ?? visible }, className);
|
|
4031
3984
|
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
3985
|
}
|
|
3986
|
+
const RlsFormNavigation = memo(RlsFormNavigationComponent);
|
|
4033
3987
|
|
|
4034
3988
|
function useRelocationOnComponent({ container, element, onDrag }) {
|
|
4035
3989
|
const position = useRef({ x: 0, y: 0 });
|
|
@@ -4123,20 +4077,19 @@ function useRelocationOnComponent({ container, element, onDrag }) {
|
|
|
4123
4077
|
}, []);
|
|
4124
4078
|
}
|
|
4125
4079
|
|
|
4126
|
-
function useResize(
|
|
4127
|
-
const { refElement, onResize } = props;
|
|
4080
|
+
function useResize({ refElement, onResize }) {
|
|
4128
4081
|
const dimension = useRef({ height: 0, width: 0 });
|
|
4082
|
+
const onResizeRef = useRef(onResize);
|
|
4083
|
+
onResizeRef.current = onResize;
|
|
4129
4084
|
const observer = useCallback((entries) => {
|
|
4130
4085
|
const { height, width } = entries[0].contentRect;
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
});
|
|
4139
|
-
}
|
|
4086
|
+
onResizeRef.current?.({
|
|
4087
|
+
current: dimension.current,
|
|
4088
|
+
dimension: {
|
|
4089
|
+
height,
|
|
4090
|
+
width
|
|
4091
|
+
}
|
|
4092
|
+
});
|
|
4140
4093
|
dimension.current = { height, width };
|
|
4141
4094
|
}, []);
|
|
4142
4095
|
useEffect(() => {
|
|
@@ -4184,7 +4137,7 @@ function calculateImgDimension(image, dimension) {
|
|
|
4184
4137
|
height = simpleThreeRule(image.width, width, height);
|
|
4185
4138
|
return { height, width };
|
|
4186
4139
|
}
|
|
4187
|
-
function
|
|
4140
|
+
function RlsImageEditorComponent(props) {
|
|
4188
4141
|
const [selection, setSelection] = useState(props.selection ?? 60);
|
|
4189
4142
|
const [labels, setLabels] = useState({
|
|
4190
4143
|
actionRestore: reactI18n('editorImageActionRestore'),
|
|
@@ -4382,10 +4335,12 @@ function RlsImageEditor(props) {
|
|
|
4382
4335
|
}, []);
|
|
4383
4336
|
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
4337
|
}
|
|
4338
|
+
const RlsImageEditor = memo(RlsImageEditorComponent);
|
|
4385
4339
|
|
|
4386
|
-
function
|
|
4340
|
+
function RlsImageEditorModalComponent(props) {
|
|
4387
4341
|
return (jsxRuntimeExports.jsx(RlsModal, { className: "rls-image-editor-modal", visible: props.visible, children: jsxRuntimeExports.jsx(RlsImageEditor, { ...props, children: props.children }) }));
|
|
4388
4342
|
}
|
|
4343
|
+
const RlsImageEditorModal = memo(RlsImageEditorModalComponent);
|
|
4389
4344
|
|
|
4390
4345
|
const MIME_TYPE_SUPPORTS = [
|
|
4391
4346
|
'image/png',
|
|
@@ -4456,7 +4411,7 @@ function useImageEditorController(options) {
|
|
|
4456
4411
|
return { onImageChooser, RlsImageEditorChooser };
|
|
4457
4412
|
}
|
|
4458
4413
|
|
|
4459
|
-
function
|
|
4414
|
+
function RlsImageChooserComponent(props) {
|
|
4460
4415
|
const [src, setSrc] = useState();
|
|
4461
4416
|
const onValue = useCallback((image) => {
|
|
4462
4417
|
setSrc(image.base64);
|
|
@@ -4470,11 +4425,10 @@ function RlsImageChooser(props) {
|
|
|
4470
4425
|
}, [props.src]);
|
|
4471
4426
|
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
4427
|
}
|
|
4428
|
+
const RlsImageChooser = memo(RlsImageChooserComponent);
|
|
4473
4429
|
|
|
4474
|
-
function
|
|
4475
|
-
const classNameModal =
|
|
4476
|
-
return renderClassStatus('rls-modal-sheet', { visible: controller?.visible ?? visible }, className);
|
|
4477
|
-
}, [className, visible, controller?.visible]);
|
|
4430
|
+
function RlsModalSheetComponent({ autoclose, children, className, controller, onAutoClose, visible, rlsTheme }) {
|
|
4431
|
+
const classNameModal = renderClassStatus('rls-modal-sheet', { visible: controller?.visible ?? visible }, className);
|
|
4478
4432
|
const onClickBackdrop = useCallback(() => {
|
|
4479
4433
|
if (autoclose) {
|
|
4480
4434
|
controller?.close();
|
|
@@ -4483,6 +4437,7 @@ function RlsModalSheet({ autoclose, children, className, controller, onAutoClose
|
|
|
4483
4437
|
}, [autoclose, controller, onAutoClose]);
|
|
4484
4438
|
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
4439
|
}
|
|
4440
|
+
const RlsModalSheet = memo(RlsModalSheetComponent);
|
|
4486
4441
|
|
|
4487
4442
|
const DURATION_ANIMATION$1 = 240;
|
|
4488
4443
|
const DURATION_DEFAULT = 4000;
|
|
@@ -4491,9 +4446,7 @@ function generateId() {
|
|
|
4491
4446
|
return `rls-notification-${++_id}`;
|
|
4492
4447
|
}
|
|
4493
4448
|
function RlsNotification({ content, icon, onClose, rlsTheme, title, visible }) {
|
|
4494
|
-
const className =
|
|
4495
|
-
return renderClassStatus('rls-notification', { visible });
|
|
4496
|
-
}, [visible]);
|
|
4449
|
+
const className = renderClassStatus('rls-notification', { visible });
|
|
4497
4450
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-notification__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-notification__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-notification__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-notification__title", children: title }), jsxRuntimeExports.jsx("button", { onClick: onClose, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-notification__content", children: content })] })] }));
|
|
4498
4451
|
}
|
|
4499
4452
|
function useNotifications() {
|
|
@@ -4524,14 +4477,24 @@ function useNotifications() {
|
|
|
4524
4477
|
const duration = config.duration ?? DURATION_DEFAULT;
|
|
4525
4478
|
setNotifications((notifications) => [
|
|
4526
4479
|
...notifications,
|
|
4527
|
-
{ id, config, visible:
|
|
4480
|
+
{ id, config, visible: false }
|
|
4528
4481
|
]);
|
|
4482
|
+
requestAnimationFrame(() => {
|
|
4483
|
+
requestAnimationFrame(() => {
|
|
4484
|
+
setNotifications((notifications) => notifications.map((notification) => notification.id === id
|
|
4485
|
+
? { ...notification, visible: true }
|
|
4486
|
+
: notification));
|
|
4487
|
+
});
|
|
4488
|
+
});
|
|
4529
4489
|
const timer = setTimeout(() => {
|
|
4530
4490
|
remove(id);
|
|
4531
4491
|
}, duration);
|
|
4532
4492
|
timersRef.current.set(id, timer);
|
|
4533
4493
|
}, [remove]);
|
|
4534
|
-
const
|
|
4494
|
+
const className = renderClassStatus('rls-notifications', {
|
|
4495
|
+
visible: notifications.length > 0
|
|
4496
|
+
});
|
|
4497
|
+
const RlsNotifications = ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: className, children: notifications.map((notification) => (jsxRuntimeExports.jsx(RlsNotification, { ...notification.config, visible: notification.visible, onClose: () => remove(notification.id) }, notification.id))) }), document.body);
|
|
4535
4498
|
return {
|
|
4536
4499
|
RlsNotifications,
|
|
4537
4500
|
notify
|
|
@@ -4553,12 +4516,11 @@ function calculateDuration({ length }) {
|
|
|
4553
4516
|
}
|
|
4554
4517
|
return duration + DURATION_RESET;
|
|
4555
4518
|
}
|
|
4556
|
-
function
|
|
4557
|
-
const className =
|
|
4558
|
-
return renderClassStatus('rls-snackbar', { visible });
|
|
4559
|
-
}, [visible]);
|
|
4519
|
+
function RlsSnackbarComponent({ content, onClose, icon, rlsTheme, title, visible }) {
|
|
4520
|
+
const className = renderClassStatus('rls-snackbar', { visible });
|
|
4560
4521
|
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
4522
|
}
|
|
4523
|
+
const RlsSnackbar = memo(RlsSnackbarComponent);
|
|
4562
4524
|
function useSnackbar() {
|
|
4563
4525
|
const timeoutId = useRef(undefined);
|
|
4564
4526
|
const duration = useRef(4000);
|
|
@@ -4618,27 +4580,26 @@ function RlsApplication({ children }) {
|
|
|
4618
4580
|
const [navbarInApp, setNavbarInApp] = useState(false);
|
|
4619
4581
|
const [navbarIsCondense, setNavbarIsCondense] = useState(false);
|
|
4620
4582
|
const [appIsMobile, setIsMobile] = useState(false);
|
|
4621
|
-
const className =
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
}, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsNotifications, RlsConfirmation] }));
|
|
4583
|
+
const className = renderClassStatus('rls-app__body', {
|
|
4584
|
+
mobile: appIsMobile,
|
|
4585
|
+
'navbar-snackbar': navbarInApp,
|
|
4586
|
+
'navbar-condense': navbarIsCondense
|
|
4587
|
+
});
|
|
4588
|
+
const state = useMemo(() => ({
|
|
4589
|
+
confirmation,
|
|
4590
|
+
notify,
|
|
4591
|
+
setIsMobile,
|
|
4592
|
+
setNavbarInApp,
|
|
4593
|
+
setNavbarIsCondense,
|
|
4594
|
+
snackbar
|
|
4595
|
+
}), [confirmation, notify, snackbar]);
|
|
4596
|
+
return (jsxRuntimeExports.jsxs(RlsContext, { value: state, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsNotifications, RlsConfirmation] }));
|
|
4636
4597
|
}
|
|
4637
4598
|
|
|
4638
4599
|
const DEFAULT_DESIGN_SYSTEM = 'bordered';
|
|
4639
4600
|
|
|
4640
4601
|
const DESIGN_SYSTEM_PREFIX = 'rls-design-system';
|
|
4641
|
-
const DESIGN_SYSTEMS = ['bordered', 'filled'];
|
|
4602
|
+
const DESIGN_SYSTEMS = ['bordered', 'filled', 'gradient'];
|
|
4642
4603
|
function designSystemClass(designSystem) {
|
|
4643
4604
|
return `${DESIGN_SYSTEM_PREFIX}-${designSystem}`;
|
|
4644
4605
|
}
|
|
@@ -4758,5 +4719,26 @@ function usePortalController() {
|
|
|
4758
4719
|
return { close, open, visible };
|
|
4759
4720
|
}
|
|
4760
4721
|
|
|
4761
|
-
|
|
4722
|
+
const APP_THEME_ATTRIBUTE = 'app-theme';
|
|
4723
|
+
function getAppTheme() {
|
|
4724
|
+
if (typeof document === 'undefined') {
|
|
4725
|
+
return 'light';
|
|
4726
|
+
}
|
|
4727
|
+
return document.body.getAttribute(APP_THEME_ATTRIBUTE) === 'dark'
|
|
4728
|
+
? 'dark'
|
|
4729
|
+
: 'light';
|
|
4730
|
+
}
|
|
4731
|
+
function setAppTheme(theme) {
|
|
4732
|
+
if (typeof document === 'undefined') {
|
|
4733
|
+
return;
|
|
4734
|
+
}
|
|
4735
|
+
document.body.setAttribute(APP_THEME_ATTRIBUTE, theme);
|
|
4736
|
+
}
|
|
4737
|
+
function toggleAppTheme() {
|
|
4738
|
+
const theme = getAppTheme() === 'dark' ? 'light' : 'dark';
|
|
4739
|
+
setAppTheme(theme);
|
|
4740
|
+
return theme;
|
|
4741
|
+
}
|
|
4742
|
+
|
|
4743
|
+
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
4744
|
//# sourceMappingURL=index.mjs.map
|