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