@rolster/react-components 19.6.10 → 19.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/cjs/index.cjs +370 -240
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/es/index.mjs +366 -242
- package/dist/es/index.mjs.map +1 -1
- package/dist/esm/components/atoms/Amount/Amount.d.ts +2 -1
- package/dist/esm/components/atoms/Amount/Amount.js +3 -2
- package/dist/esm/components/atoms/Amount/Amount.js.map +1 -1
- package/dist/esm/components/atoms/AreaText/AreaText.d.ts +3 -1
- package/dist/esm/components/atoms/AreaText/AreaText.js +3 -2
- package/dist/esm/components/atoms/AreaText/AreaText.js.map +1 -1
- package/dist/esm/components/atoms/Avatar/Avatar.d.ts +2 -1
- package/dist/esm/components/atoms/Avatar/Avatar.js +3 -2
- package/dist/esm/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/atoms/Badge/Badge.d.ts +2 -1
- package/dist/esm/components/atoms/Badge/Badge.js +3 -2
- package/dist/esm/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.d.ts +2 -1
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js +3 -2
- package/dist/esm/components/atoms/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.d.ts +2 -1
- package/dist/esm/components/atoms/Button/Button.js +3 -2
- package/dist/esm/components/atoms/Button/Button.js.map +1 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.d.ts +2 -1
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.js +3 -2
- package/dist/esm/components/atoms/ButtonAction/ButtonAction.js.map +1 -1
- package/dist/esm/components/atoms/ButtonIcon/ButtonIcon.d.ts +2 -1
- package/dist/esm/components/atoms/ButtonIcon/ButtonIcon.js +3 -2
- package/dist/esm/components/atoms/ButtonIcon/ButtonIcon.js.map +1 -1
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.d.ts +3 -2
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.js +3 -2
- package/dist/esm/components/atoms/ButtonOption/ButtonOption.js.map +1 -1
- package/dist/esm/components/atoms/CheckBox/CheckBox.d.ts +4 -2
- package/dist/esm/components/atoms/CheckBox/CheckBox.js +5 -3
- package/dist/esm/components/atoms/CheckBox/CheckBox.js.map +1 -1
- package/dist/esm/components/atoms/Icon/Icon.d.ts +2 -1
- package/dist/esm/components/atoms/Icon/Icon.js +3 -2
- package/dist/esm/components/atoms/Icon/Icon.js.map +1 -1
- package/dist/esm/components/atoms/Image/Image.d.ts +2 -1
- package/dist/esm/components/atoms/Image/Image.js +3 -2
- package/dist/esm/components/atoms/Image/Image.js.map +1 -1
- package/dist/esm/components/atoms/Input/Input.d.ts +2 -1
- package/dist/esm/components/atoms/Input/Input.js +3 -2
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputCounter/InputCounter.d.ts +2 -1
- package/dist/esm/components/atoms/InputCounter/InputCounter.js +3 -2
- package/dist/esm/components/atoms/InputCounter/InputCounter.js.map +1 -1
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.d.ts +2 -1
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.js +3 -2
- package/dist/esm/components/atoms/InputDecimal/InputDecimal.js.map +1 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.d.ts +2 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.js +3 -2
- package/dist/esm/components/atoms/InputMoney/InputMoney.js.map +1 -1
- package/dist/esm/components/atoms/InputNumber/InputNumber.d.ts +2 -1
- package/dist/esm/components/atoms/InputNumber/InputNumber.js +3 -2
- package/dist/esm/components/atoms/InputNumber/InputNumber.js.map +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.d.ts +2 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.js +3 -2
- package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/atoms/InputPercentage/InputPercentage.d.ts +2 -1
- package/dist/esm/components/atoms/InputPercentage/InputPercentage.js +3 -2
- package/dist/esm/components/atoms/InputPercentage/InputPercentage.js.map +1 -1
- package/dist/esm/components/atoms/InputSearch/InputSearch.d.ts +2 -1
- package/dist/esm/components/atoms/InputSearch/InputSearch.js +3 -2
- package/dist/esm/components/atoms/InputSearch/InputSearch.js.map +1 -1
- package/dist/esm/components/atoms/InputText/InputText.d.ts +3 -1
- package/dist/esm/components/atoms/InputText/InputText.js +3 -2
- package/dist/esm/components/atoms/InputText/InputText.js.map +1 -1
- package/dist/esm/components/atoms/Label/Label.d.ts +3 -1
- package/dist/esm/components/atoms/Label/Label.js +3 -1
- package/dist/esm/components/atoms/Label/Label.js.map +1 -1
- package/dist/esm/components/atoms/Led/Led.d.ts +2 -1
- package/dist/esm/components/atoms/Led/Led.js +3 -2
- package/dist/esm/components/atoms/Led/Led.js.map +1 -1
- package/dist/esm/components/atoms/MessageIcon/MessageIcon.d.ts +2 -1
- package/dist/esm/components/atoms/MessageIcon/MessageIcon.js +3 -1
- package/dist/esm/components/atoms/MessageIcon/MessageIcon.js.map +1 -1
- package/dist/esm/components/atoms/Poster/Poster.d.ts +2 -1
- package/dist/esm/components/atoms/Poster/Poster.js +3 -2
- package/dist/esm/components/atoms/Poster/Poster.js.map +1 -1
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.d.ts +2 -1
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js +3 -2
- package/dist/esm/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/components/atoms/ProgressCircular/ProgressCircular.d.ts +3 -1
- package/dist/esm/components/atoms/ProgressCircular/ProgressCircular.js +3 -1
- package/dist/esm/components/atoms/ProgressCircular/ProgressCircular.js.map +1 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.d.ts +2 -1
- package/dist/esm/components/atoms/RadioButton/RadioButton.js +3 -2
- package/dist/esm/components/atoms/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/atoms/Skeleton/Skeleton.d.ts +3 -1
- package/dist/esm/components/atoms/Skeleton/Skeleton.js +3 -1
- package/dist/esm/components/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.d.ts +2 -1
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.js +3 -1
- package/dist/esm/components/atoms/SkeletonText/SkeletonText.js.map +1 -1
- package/dist/esm/components/atoms/Spinner/Spinner.d.ts +3 -1
- package/dist/esm/components/atoms/Spinner/Spinner.js +3 -1
- package/dist/esm/components/atoms/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/atoms/Switch/Switch.d.ts +4 -2
- package/dist/esm/components/atoms/Switch/Switch.js +5 -3
- package/dist/esm/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/esm/components/atoms/TabularText/TabularText.d.ts +2 -1
- package/dist/esm/components/atoms/TabularText/TabularText.js +3 -2
- package/dist/esm/components/atoms/TabularText/TabularText.js.map +1 -1
- package/dist/esm/components/molecules/Accordion/Accordion.d.ts +2 -1
- package/dist/esm/components/molecules/Accordion/Accordion.js +3 -2
- package/dist/esm/components/molecules/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/molecules/Alert/Alert.d.ts +2 -1
- package/dist/esm/components/molecules/Alert/Alert.js +3 -2
- package/dist/esm/components/molecules/Alert/Alert.js.map +1 -1
- package/dist/esm/components/molecules/Ballot/Ballot.d.ts +2 -1
- package/dist/esm/components/molecules/Ballot/Ballot.js +3 -2
- package/dist/esm/components/molecules/Ballot/Ballot.js.map +1 -1
- package/dist/esm/components/molecules/Body/Body.d.ts +3 -1
- package/dist/esm/components/molecules/Body/Body.js +3 -1
- package/dist/esm/components/molecules/Body/Body.js.map +1 -1
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.d.ts +2 -1
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js +3 -2
- package/dist/esm/components/molecules/ButtonProgress/ButtonProgress.js.map +1 -1
- package/dist/esm/components/molecules/ButtonStepper/ButtonStepper.d.ts +2 -1
- package/dist/esm/components/molecules/ButtonStepper/ButtonStepper.js +3 -2
- package/dist/esm/components/molecules/ButtonStepper/ButtonStepper.js.map +1 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.d.ts +2 -1
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js +3 -2
- package/dist/esm/components/molecules/ButtonToggle/ButtonToggle.js.map +1 -1
- package/dist/esm/components/molecules/Content/Content.d.ts +3 -1
- package/dist/esm/components/molecules/Content/Content.js +3 -1
- package/dist/esm/components/molecules/Content/Content.js.map +1 -1
- package/dist/esm/components/molecules/FieldArea/FieldArea.d.ts +2 -1
- package/dist/esm/components/molecules/FieldArea/FieldArea.js +3 -2
- package/dist/esm/components/molecules/FieldArea/FieldArea.js.map +1 -1
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.d.ts +2 -1
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.js +3 -2
- package/dist/esm/components/molecules/FieldDecimal/FieldDecimal.js.map +1 -1
- package/dist/esm/components/molecules/FieldFile/FieldFile.d.ts +2 -1
- package/dist/esm/components/molecules/FieldFile/FieldFile.js +3 -2
- package/dist/esm/components/molecules/FieldFile/FieldFile.js.map +1 -1
- package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.d.ts +2 -1
- package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.js +3 -2
- package/dist/esm/components/molecules/FieldListSuggestions/FieldListSuggestions.js.map +1 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.d.ts +2 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js +3 -2
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js.map +1 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.d.ts +2 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js +3 -2
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js.map +1 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.d.ts +3 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js +3 -2
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js.map +1 -1
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.d.ts +2 -1
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.js +3 -2
- package/dist/esm/components/molecules/FieldPercentage/FieldPercentage.js.map +1 -1
- package/dist/esm/components/molecules/FieldReadonly/FieldReadonly.d.ts +2 -1
- package/dist/esm/components/molecules/FieldReadonly/FieldReadonly.js +3 -1
- package/dist/esm/components/molecules/FieldReadonly/FieldReadonly.js.map +1 -1
- package/dist/esm/components/molecules/FieldText/FieldText.d.ts +3 -1
- package/dist/esm/components/molecules/FieldText/FieldText.js +3 -2
- package/dist/esm/components/molecules/FieldText/FieldText.js.map +1 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.d.ts +2 -1
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js +3 -2
- package/dist/esm/components/molecules/LabelCheckBox/LabelCheckBox.js.map +1 -1
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.d.ts +3 -2
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js +3 -2
- package/dist/esm/components/molecules/LabelRadioButton/LabelRadioButton.js.map +1 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.d.ts +2 -1
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js +3 -2
- package/dist/esm/components/molecules/LabelSwitch/LabelSwitch.js.map +1 -1
- package/dist/esm/components/molecules/MessageEmpty/MessageEmpty.d.ts +2 -1
- package/dist/esm/components/molecules/MessageEmpty/MessageEmpty.js +3 -2
- package/dist/esm/components/molecules/MessageEmpty/MessageEmpty.js.map +1 -1
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.d.ts +2 -1
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.js +3 -2
- package/dist/esm/components/molecules/MessageFormError/MessageFormError.js.map +1 -1
- package/dist/esm/components/molecules/Navbar/Navbar.d.ts +3 -1
- package/dist/esm/components/molecules/Navbar/Navbar.js +3 -1
- package/dist/esm/components/molecules/Navbar/Navbar.js.map +1 -1
- package/dist/esm/components/molecules/NavbarMenu/NabvarMenu.d.ts +2 -1
- package/dist/esm/components/molecules/NavbarMenu/NabvarMenu.js +3 -2
- package/dist/esm/components/molecules/NavbarMenu/NabvarMenu.js.map +1 -1
- package/dist/esm/components/molecules/Pagination/Pagination.d.ts +2 -1
- package/dist/esm/components/molecules/Pagination/Pagination.js +3 -2
- package/dist/esm/components/molecules/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/molecules/PickerDay/PickerDay.d.ts +2 -1
- package/dist/esm/components/molecules/PickerDay/PickerDay.js +3 -2
- package/dist/esm/components/molecules/PickerDay/PickerDay.js.map +1 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.d.ts +2 -1
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js +3 -2
- package/dist/esm/components/molecules/PickerDayRange/PickerDayRange.js.map +1 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.d.ts +2 -1
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js +3 -2
- package/dist/esm/components/molecules/PickerMonth/PickerMonth.js.map +1 -1
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.d.ts +2 -1
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js +3 -2
- package/dist/esm/components/molecules/PickerSelectorTitle/PickerSelectorTitle.js.map +1 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.d.ts +2 -1
- package/dist/esm/components/molecules/PickerYear/PickerYear.js +3 -2
- package/dist/esm/components/molecules/PickerYear/PickerYear.js.map +1 -1
- package/dist/esm/components/molecules/Slider/Slider.d.ts +2 -1
- package/dist/esm/components/molecules/Slider/Slider.js +3 -2
- package/dist/esm/components/molecules/Slider/Slider.js.map +1 -1
- package/dist/esm/components/molecules/Tabs/Tabs.d.ts +2 -1
- package/dist/esm/components/molecules/Tabs/Tabs.js +3 -2
- package/dist/esm/components/molecules/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/molecules/Toolbar/Toolbar.d.ts +2 -1
- package/dist/esm/components/molecules/Toolbar/Toolbar.js +3 -1
- package/dist/esm/components/molecules/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.d.ts +2 -1
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.js +3 -2
- package/dist/esm/components/organisms/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/organisms/Card/Card.d.ts +2 -1
- package/dist/esm/components/organisms/Card/Card.js +3 -2
- package/dist/esm/components/organisms/Card/Card.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +2 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +3 -2
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/dist/esm/components/organisms/Datatable/Datatable.d.ts +19 -9
- package/dist/esm/components/organisms/Datatable/Datatable.js +25 -16
- package/dist/esm/components/organisms/Datatable/Datatable.js.map +1 -1
- package/dist/esm/components/organisms/Dropdown/Dropdown.d.ts +2 -1
- package/dist/esm/components/organisms/Dropdown/Dropdown.js +3 -2
- package/dist/esm/components/organisms/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.d.ts +8 -6
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +5 -3
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldClock/FieldClock.d.ts +5 -4
- package/dist/esm/components/organisms/FieldClock/FieldClock.js +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 +3 -2
- package/dist/esm/components/organisms/FieldColor/FieldColor.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.d.ts +5 -4
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +9 -9
- 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 +5 -3
- package/dist/esm/components/organisms/FieldList/FieldList.js.map +1 -1
- package/dist/esm/components/organisms/FieldList/FieldListController.js +7 -8
- package/dist/esm/components/organisms/FieldList/FieldListController.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.d.ts +8 -6
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +5 -3
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.d.ts +3 -1
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js +3 -2
- package/dist/esm/components/organisms/FormNavigation/FormNavigation.js.map +1 -1
- package/dist/esm/components/organisms/ImageChooser/ImageChooser.d.ts +2 -1
- package/dist/esm/components/organisms/ImageChooser/ImageChooser.js +3 -2
- package/dist/esm/components/organisms/ImageChooser/ImageChooser.js.map +1 -1
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.d.ts +2 -1
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.js +3 -2
- package/dist/esm/components/organisms/ImageEditor/ImageEditor.js.map +1 -1
- package/dist/esm/components/organisms/ImageEditorModal/ImageEditorModal.d.ts +2 -1
- package/dist/esm/components/organisms/ImageEditorModal/ImageEditorModal.js +3 -1
- package/dist/esm/components/organisms/ImageEditorModal/ImageEditorModal.js.map +1 -1
- package/dist/esm/components/organisms/Modal/Modal.d.ts +2 -1
- package/dist/esm/components/organisms/Modal/Modal.js +3 -2
- package/dist/esm/components/organisms/Modal/Modal.js.map +1 -1
- package/dist/esm/components/organisms/ModalClock/ModalClock.d.ts +15 -0
- package/dist/esm/components/organisms/ModalClock/ModalClock.js +14 -0
- package/dist/esm/components/organisms/ModalClock/ModalClock.js.map +1 -0
- package/dist/esm/components/organisms/ModalDate/ModalDate.d.ts +17 -0
- package/dist/esm/components/organisms/ModalDate/ModalDate.js +14 -0
- package/dist/esm/components/organisms/ModalDate/ModalDate.js.map +1 -0
- package/dist/esm/components/organisms/ModalDateRange/ModalDateRange.d.ts +18 -0
- package/dist/esm/components/organisms/ModalDateRange/ModalDateRange.js +14 -0
- package/dist/esm/components/organisms/ModalDateRange/ModalDateRange.js.map +1 -0
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.d.ts +2 -1
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.js +3 -2
- package/dist/esm/components/organisms/ModalSheet/ModalSheet.js.map +1 -1
- package/dist/esm/components/organisms/PickerClock/PickerClock.d.ts +2 -1
- package/dist/esm/components/organisms/PickerClock/PickerClock.js +3 -2
- package/dist/esm/components/organisms/PickerClock/PickerClock.js.map +1 -1
- package/dist/esm/components/organisms/PickerColor/PickerColor.d.ts +2 -1
- package/dist/esm/components/organisms/PickerColor/PickerColor.js +3 -2
- package/dist/esm/components/organisms/PickerColor/PickerColor.js.map +1 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.d.ts +2 -1
- package/dist/esm/components/organisms/PickerDate/PickerDate.js +3 -2
- package/dist/esm/components/organisms/PickerDate/PickerDate.js.map +1 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.d.ts +2 -1
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js +3 -2
- package/dist/esm/components/organisms/PickerDateRange/PickerDateRange.js.map +1 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.d.ts +2 -1
- package/dist/esm/components/organisms/Snackbar/Snackbar.js +3 -2
- package/dist/esm/components/organisms/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/components/organisms/VirtualScroll/VirtualScroll.d.ts +2 -1
- package/dist/esm/components/organisms/VirtualScroll/VirtualScroll.js +7 -7
- package/dist/esm/components/organisms/VirtualScroll/VirtualScroll.js.map +1 -1
- package/dist/esm/context.js +9 -8
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/controllers/ListController.d.ts +1 -1
- package/dist/esm/controllers/ListController.js +25 -15
- package/dist/esm/controllers/ListController.js.map +1 -1
- package/dist/esm/controllers/ResizeController.d.ts +3 -3
- package/dist/esm/controllers/ResizeController.js +10 -11
- package/dist/esm/controllers/ResizeController.js.map +1 -1
- package/dist/esm/helpers/app-theme.d.ts +4 -0
- package/dist/esm/helpers/app-theme.js +21 -0
- package/dist/esm/helpers/app-theme.js.map +1 -0
- package/dist/esm/helpers/color.js +38 -74
- package/dist/esm/helpers/color.js.map +1 -1
- package/dist/esm/helpers/css.js +4 -4
- package/dist/esm/helpers/css.js.map +1 -1
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types.d.ts +1 -0
- package/package.json +83 -83
package/dist/es/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import require$$0, { useMemo, useState, useRef, useCallback, useEffect, useEffectEvent, createContext, useContext } from 'react';
|
|
1
|
+
import require$$0, { memo, useMemo, useState, useRef, useCallback, useEffect, useEffectEvent, createContext, useContext } from 'react';
|
|
2
2
|
import { currencyFormat, BigDecimal, valueIsDefined, SealedPartial } from '@rolster/commons';
|
|
3
3
|
import { i18n, i18nSubscribe } from '@rolster/i18n';
|
|
4
4
|
import { PaginationController, verifyDayPicker, createDayPicker, createDayRangePicker, verifyMonthPicker, createMonthPicker, monthLimitTemplate, createYearPicker, verifyYearPicker, ListCollection, navigationListFromInput, navigationListFromElement, createAutocompleteStore, PickerListenerEvent, dateOutRange, verifyDateRange } from '@rolster/components';
|
|
@@ -429,16 +429,16 @@ function requireJsxRuntime () {
|
|
|
429
429
|
var jsxRuntimeExports = requireJsxRuntime();
|
|
430
430
|
|
|
431
431
|
function renderClassStatus(base, status = {}, additionals) {
|
|
432
|
-
const
|
|
432
|
+
const classElement = [base];
|
|
433
433
|
Object.entries(status).forEach(([key, state]) => {
|
|
434
434
|
if (state) {
|
|
435
|
-
|
|
435
|
+
classElement.push(typeof state === 'string' ? `${base}--${state}` : `${base}--${key}`);
|
|
436
436
|
}
|
|
437
437
|
});
|
|
438
438
|
if (additionals) {
|
|
439
|
-
|
|
439
|
+
classElement.push(additionals);
|
|
440
440
|
}
|
|
441
|
-
return
|
|
441
|
+
return classElement.join(' ').trim();
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
const className = 'rls-tabular-text';
|
|
@@ -448,7 +448,7 @@ function getCharClass(char) {
|
|
|
448
448
|
? `${className}__pointer`
|
|
449
449
|
: `${className}__char`;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function RlsTabularTextComponent({ className, value }) {
|
|
452
452
|
const codes = useMemo(() => {
|
|
453
453
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: value?.split('').map((char, index) => (jsxRuntimeExports.jsx("span", { className: getCharClass(char), children: char }, index))) }));
|
|
454
454
|
}, [value]);
|
|
@@ -457,8 +457,9 @@ function RlsTabularText({ className, value }) {
|
|
|
457
457
|
}, [className]);
|
|
458
458
|
return jsxRuntimeExports.jsx("div", { className: _className, children: codes });
|
|
459
459
|
}
|
|
460
|
+
const RlsTabularText = memo(RlsTabularTextComponent);
|
|
460
461
|
|
|
461
|
-
function
|
|
462
|
+
function RlsAmountComponent({ value, className, decimals, rlsTheme, symbol }) {
|
|
462
463
|
const classNameAmount = useMemo(() => {
|
|
463
464
|
return renderClassStatus('rls-amount', {}, className);
|
|
464
465
|
}, [className]);
|
|
@@ -475,8 +476,9 @@ function RlsAmount({ value, className, decimals, rlsTheme, symbol }) {
|
|
|
475
476
|
}, [value, decimals]);
|
|
476
477
|
return (jsxRuntimeExports.jsxs("div", { className: classNameAmount, "rls-theme": rlsTheme, children: [symbol && jsxRuntimeExports.jsx("span", { className: "rls-amount__symbol", children: symbol }), jsxRuntimeExports.jsxs("div", { className: "rls-amount__content", children: [jsxRuntimeExports.jsx(RlsTabularText, { className: "rls-amount__integer", value: integer }), decimal && (jsxRuntimeExports.jsx(RlsTabularText, { className: "rls-amount__decimal", value: decimal }))] })] }));
|
|
477
478
|
}
|
|
479
|
+
const RlsAmount = memo(RlsAmountComponent);
|
|
478
480
|
|
|
479
|
-
function
|
|
481
|
+
function RlsAreaTextComponent({ autoComplete, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, resize, rows = 1, value }) {
|
|
480
482
|
const valueInitial = String(formControl?.value ?? value ?? '');
|
|
481
483
|
const [valueArea, setValueArea] = useState(valueInitial);
|
|
482
484
|
const [focused, setFocused] = useState(false);
|
|
@@ -545,20 +547,23 @@ function RlsAreaText({ autoComplete, disabled, formControl, identifier, onBlur,
|
|
|
545
547
|
]);
|
|
546
548
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx("textarea", { ref: areaRef, className: "rls-area-text__component", autoComplete: autoComplete ?? 'off', placeholder: placeholder, disabled: formControl?.disabled || disabled, readOnly: readOnly, rows: rows, style: { resize }, onFocus: onFocusArea, onBlur: onBlurArea, onChange: onChangeArea, onKeyDown: onKeyDownArea, onKeyUp: onKeyUpArea, value: valueArea }), jsxRuntimeExports.jsx("span", { className: "rls-area-text__value", children: valueArea })] }));
|
|
547
549
|
}
|
|
550
|
+
const RlsAreaText = memo(RlsAreaTextComponent);
|
|
548
551
|
|
|
549
|
-
function
|
|
552
|
+
function RlsAvatarComponent({ children, contrasted, rounded, skeleton, rlsTheme }) {
|
|
550
553
|
const className = useMemo(() => {
|
|
551
554
|
return renderClassStatus('rls-avatar', { contrasted, rounded, skeleton });
|
|
552
555
|
}, [contrasted, rounded, skeleton]);
|
|
553
556
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
554
557
|
}
|
|
558
|
+
const RlsAvatar = memo(RlsAvatarComponent);
|
|
555
559
|
|
|
556
|
-
function
|
|
560
|
+
function RlsBadgeComponent({ children, contrasted, rlsTheme }) {
|
|
557
561
|
const className = useMemo(() => {
|
|
558
562
|
return renderClassStatus('rls-badge', { contrasted });
|
|
559
563
|
}, [contrasted]);
|
|
560
564
|
return (jsxRuntimeExports.jsx("span", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
561
565
|
}
|
|
566
|
+
const RlsBadge = memo(RlsBadgeComponent);
|
|
562
567
|
|
|
563
568
|
function RlsBreadcrumbLabel({ label }) {
|
|
564
569
|
const className = useMemo(() => {
|
|
@@ -568,44 +573,50 @@ function RlsBreadcrumbLabel({ label }) {
|
|
|
568
573
|
}, [label.onClick]);
|
|
569
574
|
return (jsxRuntimeExports.jsx("span", { className: "rls-breadcrumb__label", onClick: label.onClick, children: jsxRuntimeExports.jsx("a", { className: className, "rls-theme": label.rlsTheme, children: label.label }) }));
|
|
570
575
|
}
|
|
571
|
-
function
|
|
576
|
+
function RlsBreadcrumbComponent({ labels }) {
|
|
572
577
|
const children = useMemo(() => {
|
|
573
578
|
return labels.map((label, index) => (jsxRuntimeExports.jsx(RlsBreadcrumbLabel, { label: label }, index)));
|
|
574
579
|
}, [labels]);
|
|
575
580
|
return jsxRuntimeExports.jsx("div", { className: "rls-breadcrumb", children: children });
|
|
576
581
|
}
|
|
582
|
+
const RlsBreadcrumb = memo(RlsBreadcrumbComponent);
|
|
577
583
|
|
|
578
|
-
function
|
|
584
|
+
function RlsIconComponent({ value, className, rlsTheme, skeleton }) {
|
|
579
585
|
const classNameIcon = useMemo(() => {
|
|
580
586
|
return renderClassStatus('rls-icon', { skeleton }, className);
|
|
581
587
|
}, [className, skeleton]);
|
|
582
588
|
return (jsxRuntimeExports.jsx("div", { className: classNameIcon, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("i", { className: `rls-icon-${value}` }) }));
|
|
583
589
|
}
|
|
590
|
+
const RlsIcon = memo(RlsIconComponent);
|
|
584
591
|
|
|
585
|
-
function
|
|
592
|
+
function RlsSpinnerComponent() {
|
|
586
593
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-spinner", children: [jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--1", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--2", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--3", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--4", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--5", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--6", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--7", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--8", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) }), jsxRuntimeExports.jsx("svg", { className: "rls-spinner__svg rls-spinner__svg--9", viewBox: "0 0 64 64", children: jsxRuntimeExports.jsx("circle", {}) })] }));
|
|
587
594
|
}
|
|
595
|
+
const RlsSpinner = memo(RlsSpinnerComponent);
|
|
588
596
|
|
|
589
|
-
function
|
|
597
|
+
function RlsButtonComponent({ type, children, disabled, identifier, onClick, prefixIcon, requesting, rlsTheme, suffixIcon }) {
|
|
590
598
|
const className = useMemo(() => {
|
|
591
599
|
return renderClassStatus('rls-button__content', { type });
|
|
592
600
|
}, [type]);
|
|
593
601
|
return (jsxRuntimeExports.jsx("button", { id: identifier, className: "rls-button", onClick: onClick, "rls-theme": rlsTheme, disabled: disabled, children: jsxRuntimeExports.jsxs("div", { className: className, children: [requesting && jsxRuntimeExports.jsx(RlsSpinner, {}), prefixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: prefixIcon }), children && jsxRuntimeExports.jsx("div", { className: "rls-button__description", children: children }), suffixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: suffixIcon })] }) }));
|
|
594
602
|
}
|
|
603
|
+
const RlsButton = memo(RlsButtonComponent);
|
|
595
604
|
|
|
596
|
-
function
|
|
605
|
+
function RlsButtonActionComponent({ icon, disabled, identifier, onClick, rlsTheme, tooltip, type }) {
|
|
597
606
|
const className = useMemo(() => {
|
|
598
607
|
return renderClassStatus('rls-button-action', { type });
|
|
599
608
|
}, [type]);
|
|
600
609
|
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onClick, disabled: disabled, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-button-action__content", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }), tooltip && (jsxRuntimeExports.jsx("div", { className: "rls-button-action__tooltip rls-overline-font-medium", children: jsxRuntimeExports.jsx("span", { children: tooltip }) }))] }));
|
|
601
610
|
}
|
|
611
|
+
const RlsButtonAction = memo(RlsButtonActionComponent);
|
|
602
612
|
|
|
603
|
-
function
|
|
613
|
+
function RlsButtonIconComponent({ icon, className, disabled, onClick, skeleton }) {
|
|
604
614
|
const classNameButton = useMemo(() => {
|
|
605
615
|
return renderClassStatus('rls-button-icon', { skeleton }, className);
|
|
606
616
|
}, [className, skeleton]);
|
|
607
617
|
return (jsxRuntimeExports.jsx("button", { className: classNameButton, onClick: onClick, disabled: disabled, children: !skeleton && jsxRuntimeExports.jsx(RlsIcon, { value: icon }) }));
|
|
608
618
|
}
|
|
619
|
+
const RlsButtonIcon = memo(RlsButtonIconComponent);
|
|
609
620
|
|
|
610
621
|
function useFormSingleSelectionController({ disabled, formControl, onValue, value }) {
|
|
611
622
|
const [checked, setChecked] = useState(formControl?.value === value);
|
|
@@ -621,7 +632,7 @@ function useFormSingleSelectionController({ disabled, formControl, onValue, valu
|
|
|
621
632
|
return { checked, onSelect };
|
|
622
633
|
}
|
|
623
634
|
|
|
624
|
-
function
|
|
635
|
+
function RlsButtonOptionComponent({ icon, children, disabled, formControl, identifier, onClick, onValue, value }) {
|
|
625
636
|
const { checked, onSelect } = useFormSingleSelectionController({
|
|
626
637
|
disabled,
|
|
627
638
|
formControl,
|
|
@@ -637,25 +648,29 @@ function RlsButtonOption({ icon, children, disabled, formControl, identifier, on
|
|
|
637
648
|
}, [onSelect, onClick]);
|
|
638
649
|
return (jsxRuntimeExports.jsxs("button", { id: identifier, className: className, onClick: onAction, disabled: disabled, children: [jsxRuntimeExports.jsx(RlsIcon, { value: icon }), children] }));
|
|
639
650
|
}
|
|
651
|
+
const RlsButtonOption = memo(RlsButtonOptionComponent);
|
|
640
652
|
|
|
641
|
-
function
|
|
653
|
+
function RlsCheckBoxComponent({ checked, disabled, identifier, onClick, rlsTheme }) {
|
|
642
654
|
const className = useMemo(() => {
|
|
643
655
|
return renderClassStatus('rls-checkbox', { checked, disabled });
|
|
644
656
|
}, [checked, disabled]);
|
|
645
657
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx(RlsIcon, { value: "checkmark" }) }));
|
|
646
658
|
}
|
|
647
|
-
|
|
659
|
+
const RlsCheckBox = memo(RlsCheckBoxComponent);
|
|
660
|
+
function RlsCheckBoxControlComponent({ formControl, disabled, identifier, rlsTheme }) {
|
|
648
661
|
const onClick = useCallback(() => {
|
|
649
662
|
formControl.setValue(!formControl.value);
|
|
650
663
|
}, [formControl.value]);
|
|
651
664
|
return (jsxRuntimeExports.jsx(RlsCheckBox, { identifier: identifier, checked: !!formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
652
665
|
}
|
|
666
|
+
const RlsCheckBoxControl = memo(RlsCheckBoxControlComponent);
|
|
653
667
|
|
|
654
|
-
function
|
|
668
|
+
function RlsSkeletonComponent({ rlsTheme }) {
|
|
655
669
|
return jsxRuntimeExports.jsx("div", { className: "rls-skeleton", "rls-theme": rlsTheme });
|
|
656
670
|
}
|
|
671
|
+
const RlsSkeleton = memo(RlsSkeletonComponent);
|
|
657
672
|
|
|
658
|
-
function
|
|
673
|
+
function RlsImageComponent({ src, rlsTheme }) {
|
|
659
674
|
const [srcIsComplet, setSrcIsComplet] = useState(false);
|
|
660
675
|
const refImage = useRef(null);
|
|
661
676
|
const className = useMemo(() => {
|
|
@@ -669,8 +684,9 @@ function RlsImage({ src, rlsTheme }) {
|
|
|
669
684
|
}, []);
|
|
670
685
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [!srcIsComplet && jsxRuntimeExports.jsx(RlsSkeleton, { rlsTheme: rlsTheme }), jsxRuntimeExports.jsx("img", { ref: refImage, src: src, onLoad: onLoad })] }));
|
|
671
686
|
}
|
|
687
|
+
const RlsImage = memo(RlsImageComponent);
|
|
672
688
|
|
|
673
|
-
function
|
|
689
|
+
function RlsInputComponent({ children, decimals, disabled, formControl, identifier, onBlur, onEnter, onFocus, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type, value }) {
|
|
674
690
|
const valueInitial = (formControl?.value ?? value) ? String(value) : '';
|
|
675
691
|
const [valueInput, setValueInput] = useState(valueInitial);
|
|
676
692
|
const [focused, setFocused] = useState(false);
|
|
@@ -721,8 +737,9 @@ function RlsInput({ children, decimals, disabled, formControl, identifier, onBlu
|
|
|
721
737
|
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
722
738
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx("input", { ref: formControl?.elementRef, className: "rls-input__component", autoComplete: "off", type: type ?? 'text', placeholder: placeholder, disabled: formControl?.disabled || disabled, readOnly: readOnly, onFocus: onFocusInput, onBlur: onBlurInput, onChange: onChangeInput, onKeyDown: onKeyDownInput, onKeyUp: onKeyUpInput, value: valueInput }), jsxRuntimeExports.jsx("span", { className: "rls-input__value", children: children })] }));
|
|
723
739
|
}
|
|
740
|
+
const RlsInput = memo(RlsInputComponent);
|
|
724
741
|
|
|
725
|
-
function
|
|
742
|
+
function RlsInputCounterComponent({ className, disabled, formControl, identifier, max, min, onBlur, onFocus, onValue, readOnly, rlsTheme, step = 1, value: valueProp }) {
|
|
726
743
|
const changeIsInternal = useRef(false);
|
|
727
744
|
const [value, setValue] = useState(formControl?.value ?? valueProp ?? 0);
|
|
728
745
|
const [focused, setFocused] = useState(false);
|
|
@@ -776,8 +793,9 @@ function RlsInputCounter({ className, disabled, formControl, identifier, max, mi
|
|
|
776
793
|
}, [formControl, onBlur]);
|
|
777
794
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: classNameCounter, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx(RlsButtonIcon, { className: "rls-input-counter__down", icon: "minus", onClick: onDecrement, disabled: _disabled || decrementIsAllowed }), jsxRuntimeExports.jsx("div", { className: "rls-input-counter__body", children: jsxRuntimeExports.jsx("input", { ref: formControl?.elementRef, className: "rls-input-counter__control", type: "text", inputMode: "numeric", value: value, disabled: _disabled, readOnly: readOnly, onChange: onChangeInput, onFocus: onFocusInput, onBlur: onBlurInput }) }), jsxRuntimeExports.jsx(RlsButtonIcon, { className: "rls-input-counter__up", icon: "plus", onClick: onIncrement, disabled: _disabled || incrementIsAllowed })] }));
|
|
778
795
|
}
|
|
796
|
+
const RlsInputCounter = memo(RlsInputCounterComponent);
|
|
779
797
|
|
|
780
|
-
function
|
|
798
|
+
function RlsInputDecimalComponent(props) {
|
|
781
799
|
const { decimals, formControl, identifier, onValue, symbol, value } = props;
|
|
782
800
|
const [valueInput, setValueInput] = useState((formControl?.value ?? value ?? BigDecimal.zero()).rounded);
|
|
783
801
|
const amount = useMemo(() => {
|
|
@@ -796,8 +814,9 @@ function RlsInputDecimal(props) {
|
|
|
796
814
|
const decimalProps = { ...props, formControl: undefined };
|
|
797
815
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-decimal", children: jsxRuntimeExports.jsx(RlsInput, { ...decimalProps, type: "number", value: valueInput, onValue: onValueInput, children: jsxRuntimeExports.jsx(RlsAmount, { value: amount, symbol: symbol, decimals: decimals }) }) }));
|
|
798
816
|
}
|
|
817
|
+
const RlsInputDecimal = memo(RlsInputDecimalComponent);
|
|
799
818
|
|
|
800
|
-
function
|
|
819
|
+
function RlsInputMoneyComponent(props) {
|
|
801
820
|
const { decimals, formControl, identifier, onValue, symbol, value } = props;
|
|
802
821
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
|
|
803
822
|
const onValueInput = useCallback((value) => {
|
|
@@ -808,8 +827,9 @@ function RlsInputMoney(props) {
|
|
|
808
827
|
}, [formControl, onValue]);
|
|
809
828
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-money", children: jsxRuntimeExports.jsx(RlsInput, { ...props, type: "number", value: valueInput, onValue: onValueInput, children: jsxRuntimeExports.jsx(RlsAmount, { value: formControl?.value ?? valueInput, symbol: symbol, decimals: decimals }) }) }));
|
|
810
829
|
}
|
|
830
|
+
const RlsInputMoney = memo(RlsInputMoneyComponent);
|
|
811
831
|
|
|
812
|
-
function
|
|
832
|
+
function RlsInputNumberComponent(props) {
|
|
813
833
|
const { formControl, identifier, onValue, value } = props;
|
|
814
834
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
|
|
815
835
|
const onValueInput = useCallback((value) => {
|
|
@@ -820,8 +840,9 @@ function RlsInputNumber(props) {
|
|
|
820
840
|
}, [formControl, onValue]);
|
|
821
841
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-number", children: jsxRuntimeExports.jsx(RlsInput, { ...props, type: "number", value: valueInput, onValue: onValueInput, children: formControl?.value ?? valueInput }) }));
|
|
822
842
|
}
|
|
843
|
+
const RlsInputNumber = memo(RlsInputNumberComponent);
|
|
823
844
|
|
|
824
|
-
function
|
|
845
|
+
function RlsInputPasswordComponent({ disabled, formControl, identifier, onEnter, onKeyDown, onKeyUp, onValue, placeholder, readOnly, type }) {
|
|
825
846
|
const [focused, setFocused] = useState(false);
|
|
826
847
|
const _onChange = useCallback((event) => {
|
|
827
848
|
formControl?.setValue(event.target.value);
|
|
@@ -852,8 +873,9 @@ function RlsInputPassword({ disabled, formControl, identifier, onEnter, onKeyDow
|
|
|
852
873
|
}, [formControl?.focused, formControl?.disabled, focused, disabled]);
|
|
853
874
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, children: jsxRuntimeExports.jsx("input", { className: "rls-input-password__component", autoComplete: "off", type: type ?? 'password', placeholder: placeholder, disabled: disabled, readOnly: readOnly, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange, onKeyDown: _onKeyDown, onKeyUp: _onKeyUp }) }));
|
|
854
875
|
}
|
|
876
|
+
const RlsInputPassword = memo(RlsInputPasswordComponent);
|
|
855
877
|
|
|
856
|
-
function
|
|
878
|
+
function RlsInputPercentageComponent(props) {
|
|
857
879
|
const { formControl, identifier, onValue, value } = props;
|
|
858
880
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? 0);
|
|
859
881
|
const onValueInput = useCallback((value) => {
|
|
@@ -864,8 +886,9 @@ function RlsInputPercentage(props) {
|
|
|
864
886
|
}, [formControl, onValue]);
|
|
865
887
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-percentage", children: jsxRuntimeExports.jsxs(RlsInput, { ...props, type: "number", value: valueInput, onValue: onValueInput, children: [formControl?.value ?? valueInput, "%"] }) }));
|
|
866
888
|
}
|
|
889
|
+
const RlsInputPercentage = memo(RlsInputPercentageComponent);
|
|
867
890
|
|
|
868
|
-
function
|
|
891
|
+
function RlsInputSearchComponent({ formControl, disabled, identifier, onEnter, onSearch, placeholder }) {
|
|
869
892
|
const [value, setValue] = useState('');
|
|
870
893
|
const className = useMemo(() => {
|
|
871
894
|
return renderClassStatus('rls-input-search', { disabled });
|
|
@@ -877,8 +900,9 @@ function RlsInputSearch({ formControl, disabled, identifier, onEnter, onSearch,
|
|
|
877
900
|
}, [formControl]);
|
|
878
901
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, children: [jsxRuntimeExports.jsx(RlsInput, { formControl: formControl, placeholder: placeholder, onEnter: onEnter, onValue: onValue, disabled: disabled, children: formControl?.value ?? value }), onSearch && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: "search", onClick: onSearch, disabled: disabled }))] }));
|
|
879
902
|
}
|
|
903
|
+
const RlsInputSearch = memo(RlsInputSearchComponent);
|
|
880
904
|
|
|
881
|
-
function
|
|
905
|
+
function RlsInputTextComponent(props) {
|
|
882
906
|
const { formControl, identifier, onValue, value } = props;
|
|
883
907
|
const [valueInput, setValueInput] = useState(formControl?.value ?? value ?? '');
|
|
884
908
|
const onValueInput = useCallback((value) => {
|
|
@@ -889,10 +913,12 @@ function RlsInputText(props) {
|
|
|
889
913
|
}, [formControl, onValue]);
|
|
890
914
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-input-text", children: jsxRuntimeExports.jsx(RlsInput, { ...props, type: "text", value: valueInput, onValue: onValueInput, children: formControl?.value ?? valueInput }) }));
|
|
891
915
|
}
|
|
916
|
+
const RlsInputText = memo(RlsInputTextComponent);
|
|
892
917
|
|
|
893
|
-
function
|
|
918
|
+
function RlsLabelComponent({ children, rlsTheme }) {
|
|
894
919
|
return (jsxRuntimeExports.jsx("span", { className: "rls-label", "rls-theme": rlsTheme, children: children }));
|
|
895
920
|
}
|
|
921
|
+
const RlsLabel = memo(RlsLabelComponent);
|
|
896
922
|
|
|
897
923
|
function msgInvalidColor(color) {
|
|
898
924
|
return `Invalid color: "${color}". Use format "#FF6600".`;
|
|
@@ -1139,69 +1165,12 @@ function generateThemeCSS(colors, theme) {
|
|
|
1139
1165
|
...shadowProps
|
|
1140
1166
|
];
|
|
1141
1167
|
}
|
|
1142
|
-
|
|
1143
|
-
const x = channel / 255;
|
|
1144
|
-
return x <= 0.04045 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;
|
|
1145
|
-
};
|
|
1146
|
-
const linearToSrgb = (channel) => {
|
|
1147
|
-
const v = channel <= 0.0031308
|
|
1148
|
-
? 12.92 * channel
|
|
1149
|
-
: 1.055 * channel ** (1 / 2.4) - 0.055;
|
|
1150
|
-
return clamp(Math.round(v * 255), 0, 255);
|
|
1151
|
-
};
|
|
1152
|
-
function rgbToOklch({ r, g, b }) {
|
|
1153
|
-
const lr = srgbToLinear(r);
|
|
1154
|
-
const lg = srgbToLinear(g);
|
|
1155
|
-
const lb = srgbToLinear(b);
|
|
1156
|
-
const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
|
|
1157
|
-
const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
|
|
1158
|
-
const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
|
|
1159
|
-
const okL = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
|
|
1160
|
-
const okA = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
|
|
1161
|
-
const okB = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
|
|
1162
|
-
return { l: okL, c: Math.hypot(okA, okB), h: Math.atan2(okB, okA) };
|
|
1163
|
-
}
|
|
1164
|
-
function oklabToLinearRgb(l, a, b) {
|
|
1165
|
-
const l_ = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
1166
|
-
const m_ = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
1167
|
-
const s_ = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
1168
|
-
return [
|
|
1169
|
-
4.0767416621 * l_ - 3.3077115913 * m_ + 0.2309699292 * s_,
|
|
1170
|
-
-1.2684380046 * l_ + 2.6097574011 * m_ - 0.3413193965 * s_,
|
|
1171
|
-
-0.0041960863 * l_ - 0.7034186147 * m_ + 1.707614701 * s_
|
|
1172
|
-
];
|
|
1173
|
-
}
|
|
1174
|
-
const inGamut = ([r, g, b]) => {
|
|
1175
|
-
const e = 1e-4;
|
|
1176
|
-
return (r >= -e && r <= 1 + e && g >= -e && g <= 1 + e && b >= -e && b <= 1 + e);
|
|
1177
|
-
};
|
|
1178
|
-
function oklchToRgb({ l, c, h }) {
|
|
1179
|
-
const a = Math.cos(h);
|
|
1180
|
-
const b = Math.sin(h);
|
|
1181
|
-
const linearAt = (chroma) => oklabToLinearRgb(l, a * chroma, b * chroma);
|
|
1182
|
-
if (!inGamut(linearAt(c))) {
|
|
1183
|
-
let lo = 0;
|
|
1184
|
-
let hi = c;
|
|
1185
|
-
for (let i = 0; i < 20; i++) {
|
|
1186
|
-
const mid = (lo + hi) / 2;
|
|
1187
|
-
if (inGamut(linearAt(mid))) {
|
|
1188
|
-
lo = mid;
|
|
1189
|
-
}
|
|
1190
|
-
else {
|
|
1191
|
-
hi = mid;
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
c = lo;
|
|
1195
|
-
}
|
|
1196
|
-
const [lr, lg, lb] = linearAt(c);
|
|
1197
|
-
return { r: linearToSrgb(lr), g: linearToSrgb(lg), b: linearToSrgb(lb) };
|
|
1198
|
-
}
|
|
1199
|
-
const chromaFactor = (lightness) => 0.4 + 0.6 * (1 - Math.abs(lightness - 0.5) * 2);
|
|
1200
|
-
function detectShadeLevel(lightness) {
|
|
1168
|
+
function detectShadeLevel(hsl) {
|
|
1201
1169
|
let bestLevel = '500';
|
|
1202
1170
|
let minDiff = Infinity;
|
|
1203
|
-
|
|
1204
|
-
const
|
|
1171
|
+
Object.keys(STANDARD_LUMINANCE).forEach((level) => {
|
|
1172
|
+
const targetL = STANDARD_LUMINANCE[level];
|
|
1173
|
+
const diff = Math.abs(hsl.l - targetL);
|
|
1205
1174
|
if (diff < minDiff) {
|
|
1206
1175
|
minDiff = diff;
|
|
1207
1176
|
bestLevel = level;
|
|
@@ -1210,29 +1179,50 @@ function detectShadeLevel(lightness) {
|
|
|
1210
1179
|
return bestLevel;
|
|
1211
1180
|
}
|
|
1212
1181
|
function generateThemePalette(baseColor, theme = 'primary') {
|
|
1213
|
-
const
|
|
1214
|
-
if (!
|
|
1182
|
+
const hsl = hexToHsl(baseColor);
|
|
1183
|
+
if (!hsl) {
|
|
1215
1184
|
throw new Error(msgInvalidColor(baseColor));
|
|
1216
1185
|
}
|
|
1217
|
-
const
|
|
1218
|
-
const
|
|
1186
|
+
const matchedLevel = detectShadeLevel(hsl);
|
|
1187
|
+
const targetL = STANDARD_LUMINANCE[matchedLevel];
|
|
1188
|
+
const inputL = hsl.l;
|
|
1219
1189
|
const colors = {};
|
|
1190
|
+
const matchedIndex = SHADE_LABELS.indexOf(matchedLevel);
|
|
1220
1191
|
SHADE_LABELS.forEach((label) => {
|
|
1221
1192
|
if (label === matchedLevel) {
|
|
1222
|
-
colors[label] =
|
|
1193
|
+
colors[label] = baseColor.toUpperCase();
|
|
1223
1194
|
return;
|
|
1224
1195
|
}
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1196
|
+
const shadeTargetL = STANDARD_LUMINANCE[label];
|
|
1197
|
+
const labelIndex = SHADE_LABELS.indexOf(label);
|
|
1198
|
+
let lightL;
|
|
1199
|
+
if (labelIndex < matchedIndex) {
|
|
1200
|
+
const ratio = inputL / targetL;
|
|
1201
|
+
lightL = shadeTargetL * ratio;
|
|
1202
|
+
}
|
|
1203
|
+
else {
|
|
1204
|
+
const remainingInput = 100 - inputL;
|
|
1205
|
+
const remainingTarget = 100 - targetL;
|
|
1206
|
+
const progress = (shadeTargetL - targetL) / remainingTarget;
|
|
1207
|
+
lightL = inputL + progress * remainingInput;
|
|
1208
|
+
}
|
|
1209
|
+
lightL = Math.min(100, Math.max(0, lightL));
|
|
1210
|
+
const satFactor = lightL > 60
|
|
1211
|
+
? Math.max(0.2, (100 - lightL) / 40)
|
|
1212
|
+
: lightL < 30
|
|
1213
|
+
? Math.max(0.2, lightL / 30)
|
|
1214
|
+
: 1;
|
|
1215
|
+
colors[label] = hslToHex({
|
|
1216
|
+
h: hsl.h,
|
|
1217
|
+
s: Math.round(Math.min(100, hsl.s * satFactor)),
|
|
1218
|
+
l: Math.round(lightL)
|
|
1219
|
+
});
|
|
1231
1220
|
});
|
|
1232
|
-
const
|
|
1221
|
+
const shades = colors;
|
|
1222
|
+
const properties = generateThemeCSS(shades, theme);
|
|
1233
1223
|
return {
|
|
1234
1224
|
theme,
|
|
1235
|
-
colors,
|
|
1225
|
+
colors: shades,
|
|
1236
1226
|
css: properties.map((p) => `${p.name}: ${p.value};`).join('\n'),
|
|
1237
1227
|
properties
|
|
1238
1228
|
};
|
|
@@ -1250,7 +1240,7 @@ function setThemeColor(baseColor, theme = 'primary') {
|
|
|
1250
1240
|
const DEFAULT_COLOR = '#1780e0';
|
|
1251
1241
|
|
|
1252
1242
|
const CONTENT_BACKGROUND = '--pvt-content-background';
|
|
1253
|
-
function
|
|
1243
|
+
function RlsLedComponent({ color, rlsTheme }) {
|
|
1254
1244
|
const refLed = useRef(null);
|
|
1255
1245
|
const refColor = useRef(undefined);
|
|
1256
1246
|
useEffect(() => {
|
|
@@ -1265,54 +1255,63 @@ function RlsLed({ color, rlsTheme }) {
|
|
|
1265
1255
|
}, [color]);
|
|
1266
1256
|
return jsxRuntimeExports.jsx("div", { ref: refLed, className: "rls-led", "rls-theme": rlsTheme });
|
|
1267
1257
|
}
|
|
1258
|
+
const RlsLed = memo(RlsLedComponent);
|
|
1268
1259
|
|
|
1269
|
-
function
|
|
1260
|
+
function RlsMessageIconComponent({ icon, children, rlsTheme }) {
|
|
1270
1261
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-message-icon", "rls-theme": rlsTheme, children: [icon && jsxRuntimeExports.jsx(RlsIcon, { value: icon }), jsxRuntimeExports.jsx("span", { className: "truncate", children: children })] }));
|
|
1271
1262
|
}
|
|
1263
|
+
const RlsMessageIcon = memo(RlsMessageIconComponent);
|
|
1272
1264
|
|
|
1273
|
-
function
|
|
1265
|
+
function RlsPosterComponent({ children, contrasted, rlsTheme }) {
|
|
1274
1266
|
const className = useMemo(() => {
|
|
1275
1267
|
return renderClassStatus('rls-poster', { contrasted });
|
|
1276
1268
|
}, [contrasted]);
|
|
1277
1269
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: children }));
|
|
1278
1270
|
}
|
|
1271
|
+
const RlsPoster = memo(RlsPosterComponent);
|
|
1279
1272
|
|
|
1280
|
-
function
|
|
1273
|
+
function RlsProgressBarComponent({ indeterminate, percentage, rlsTheme }) {
|
|
1281
1274
|
const className = useMemo(() => {
|
|
1282
1275
|
return renderClassStatus('rls-progress-bar', { indeterminate });
|
|
1283
1276
|
}, [indeterminate]);
|
|
1284
1277
|
return (jsxRuntimeExports.jsx("div", { className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-progress-bar__component", style: { width: `${percentage ?? 0}%` } }) }));
|
|
1285
1278
|
}
|
|
1279
|
+
const RlsProgressBar = memo(RlsProgressBarComponent);
|
|
1286
1280
|
|
|
1287
|
-
function
|
|
1281
|
+
function RlsProgressCircularComponent({ rlsTheme }) {
|
|
1288
1282
|
return (jsxRuntimeExports.jsx("div", { className: "rls-progress-circular", "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("svg", { className: "rls-progress-circular__svg", viewBox: "0 0 36 36", children: jsxRuntimeExports.jsx("circle", { className: "rls-progress-circular__circle", cx: "18", cy: "18", r: "12" }) }) }));
|
|
1289
1283
|
}
|
|
1284
|
+
const RlsProgressCircular = memo(RlsProgressCircularComponent);
|
|
1290
1285
|
|
|
1291
|
-
function
|
|
1286
|
+
function RlsRadioButtonComponent({ checked, disabled, identifier, rlsTheme, onClick }) {
|
|
1292
1287
|
const className = useMemo(() => {
|
|
1293
1288
|
return renderClassStatus('rls-radiobutton', { checked, disabled });
|
|
1294
1289
|
}, [checked, disabled]);
|
|
1295
1290
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-radiobutton__component" }) }));
|
|
1296
1291
|
}
|
|
1292
|
+
const RlsRadioButton = memo(RlsRadioButtonComponent);
|
|
1297
1293
|
|
|
1298
|
-
function
|
|
1294
|
+
function RlsSkeletonTextComponent({ active, children, rlsTheme }) {
|
|
1299
1295
|
return (jsxRuntimeExports.jsx("div", { className: "rls-skeleton-text", "rls-theme": rlsTheme, children: active ? (jsxRuntimeExports.jsx(RlsSkeleton, {})) : (jsxRuntimeExports.jsx("div", { className: "rls-skeleton-text__value", children: children })) }));
|
|
1300
1296
|
}
|
|
1297
|
+
const RlsSkeletonText = memo(RlsSkeletonTextComponent);
|
|
1301
1298
|
|
|
1302
|
-
function
|
|
1299
|
+
function RlsSwitchComponent({ checked, capsule, disabled, identifier, onClick, rlsTheme }) {
|
|
1303
1300
|
const className = useMemo(() => {
|
|
1304
1301
|
return renderClassStatus('rls-switch', { checked, capsule, disabled });
|
|
1305
1302
|
}, [checked, capsule, disabled]);
|
|
1306
1303
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: className, onClick: onClick, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-switch__component", children: jsxRuntimeExports.jsx("div", { className: "rls-switch__component__element" }) }) }));
|
|
1307
1304
|
}
|
|
1308
|
-
|
|
1305
|
+
const RlsSwitch = memo(RlsSwitchComponent);
|
|
1306
|
+
function RlsSwitchControlComponent({ formControl, disabled, identifier, rlsTheme }) {
|
|
1309
1307
|
const onClick = useCallback(() => {
|
|
1310
1308
|
formControl.setValue(!formControl.value);
|
|
1311
1309
|
}, [formControl.value]);
|
|
1312
1310
|
return (jsxRuntimeExports.jsx(RlsSwitch, { identifier: identifier, checked: formControl.value, disabled: disabled, onClick: onClick, rlsTheme: rlsTheme }));
|
|
1313
1311
|
}
|
|
1312
|
+
const RlsSwitchControl = memo(RlsSwitchControlComponent);
|
|
1314
1313
|
|
|
1315
|
-
function
|
|
1314
|
+
function RlsAccordionComponent({ bordered, children, className, disabled, identifier, onToggle, opened, rlsTheme, title }) {
|
|
1316
1315
|
const [open, setOpen] = useState(opened);
|
|
1317
1316
|
const [animating, setAnimating] = useState(false);
|
|
1318
1317
|
const contentRef = useRef(null);
|
|
@@ -1365,33 +1364,38 @@ function RlsAccordion({ bordered, children, className, disabled, identifier, onT
|
|
|
1365
1364
|
}, [open]);
|
|
1366
1365
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: classNameAccordion, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("button", { type: "button", className: "rls-accordion__header", "aria-expanded": open, disabled: disabled, onClick: onClickHeader, children: [jsxRuntimeExports.jsx("span", { className: "rls-accordion__title", children: title }), jsxRuntimeExports.jsx("span", { className: "rls-accordion__indicator", children: jsxRuntimeExports.jsx(RlsIcon, { value: "chevron-down" }) })] }), jsxRuntimeExports.jsx("div", { ref: contentRef, className: "rls-accordion__body", "aria-hidden": !open, onTransitionEnd: onTransitionEnd, children: jsxRuntimeExports.jsx("div", { className: "rls-accordion__content", children: children }) })] }));
|
|
1367
1366
|
}
|
|
1367
|
+
const RlsAccordion = memo(RlsAccordionComponent);
|
|
1368
1368
|
|
|
1369
|
-
function
|
|
1369
|
+
function RlsAlertComponent({ bordered, children, icon, identifier, rlsTheme }) {
|
|
1370
1370
|
const className = useMemo(() => {
|
|
1371
1371
|
return renderClassStatus('rls-alert', { bordered });
|
|
1372
1372
|
}, [bordered]);
|
|
1373
1373
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-alert__icon", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsx("div", { className: "rls-alert__content", children: children })] }));
|
|
1374
1374
|
}
|
|
1375
|
+
const RlsAlert = memo(RlsAlertComponent);
|
|
1375
1376
|
|
|
1376
|
-
function
|
|
1377
|
+
function RlsBallotComponent({ bordered, className, children, img, initials, skeleton, subtitle, rlsTheme }) {
|
|
1377
1378
|
const classNameBallot = useMemo(() => {
|
|
1378
1379
|
return renderClassStatus('rls-ballot', { bordered, skeleton }, className);
|
|
1379
1380
|
}, [bordered, skeleton, className]);
|
|
1380
1381
|
return (jsxRuntimeExports.jsxs("div", { className: classNameBallot, "rls-theme": rlsTheme, children: [(img || initials) && (jsxRuntimeExports.jsxs(RlsAvatar, { skeleton: skeleton, children: [img && jsxRuntimeExports.jsx("img", { src: img }), initials && jsxRuntimeExports.jsx("span", { children: initials })] })), jsxRuntimeExports.jsxs("div", { className: "rls-ballot__component", children: [jsxRuntimeExports.jsx("div", { className: "rls-ballot__title", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: children }) }), subtitle && (jsxRuntimeExports.jsx("div", { className: "rls-ballot__subtitle", children: jsxRuntimeExports.jsx(RlsSkeletonText, { active: skeleton, children: subtitle }) }))] })] }));
|
|
1381
1382
|
}
|
|
1383
|
+
const RlsBallot = memo(RlsBallotComponent);
|
|
1382
1384
|
|
|
1383
|
-
function
|
|
1385
|
+
function RlsBodyComponent({ children, identifier, rlsTheme }) {
|
|
1384
1386
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-app__page__body", "rls-theme": rlsTheme, children: children }));
|
|
1385
1387
|
}
|
|
1388
|
+
const RlsBody = memo(RlsBodyComponent);
|
|
1386
1389
|
|
|
1387
|
-
function
|
|
1390
|
+
function RlsButtonProgressComponent({ icon, disabled, onClick, progressing, rlsTheme }) {
|
|
1388
1391
|
const className = useMemo(() => {
|
|
1389
1392
|
return renderClassStatus('rls-button-progress', { progressing });
|
|
1390
1393
|
}, [progressing]);
|
|
1391
1394
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [!progressing && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: icon, onClick: onClick, disabled: disabled })), progressing && jsxRuntimeExports.jsx(RlsProgressCircular, {})] }));
|
|
1392
1395
|
}
|
|
1396
|
+
const RlsButtonProgress = memo(RlsButtonProgressComponent);
|
|
1393
1397
|
|
|
1394
|
-
function
|
|
1398
|
+
function RlsButtonStepperComponent({ disabled, onAction, rlsTheme }) {
|
|
1395
1399
|
const onDown = useCallback(() => {
|
|
1396
1400
|
onAction?.('down');
|
|
1397
1401
|
}, [onAction]);
|
|
@@ -1400,8 +1404,9 @@ function RlsButtonStepper({ disabled, onAction, rlsTheme }) {
|
|
|
1400
1404
|
}, [onAction]);
|
|
1401
1405
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-button-stepper", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-down", disabled: disabled, onClick: onDown }), jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-up", disabled: disabled, onClick: onUp })] }));
|
|
1402
1406
|
}
|
|
1407
|
+
const RlsButtonStepper = memo(RlsButtonStepperComponent);
|
|
1403
1408
|
|
|
1404
|
-
function
|
|
1409
|
+
function RlsButtonToggleComponent({ onAction, options, type, automatic, disabled, rlsTheme }) {
|
|
1405
1410
|
const componentRef = useRef(null);
|
|
1406
1411
|
const [action, setAction] = useState(options[0]);
|
|
1407
1412
|
const [visible, setVisible] = useState(false);
|
|
@@ -1446,10 +1451,12 @@ function RlsButtonToggle({ onAction, options, type, automatic, disabled, rlsThem
|
|
|
1446
1451
|
}, [options, onSelectAction]);
|
|
1447
1452
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-button-toggle", ref: componentRef, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-button-toggle__content", children: [action && (jsxRuntimeExports.jsx("div", { className: "rls-button-toggle__action", children: jsxRuntimeExports.jsx(RlsButton, { disabled: disabled, type: type, onClick: onClickAction, children: action.label }) })), jsxRuntimeExports.jsx("div", { className: "rls-button-toggle__icon", children: jsxRuntimeExports.jsx(RlsButton, { type: type, prefixIcon: "arrow-ios-down", disabled: disabled, onClick: onClickMenu }) })] }), jsxRuntimeExports.jsx("div", { className: classNameList, children: jsxRuntimeExports.jsx("ul", { children: options.map((action, index) => (jsxRuntimeExports.jsx("li", { className: "rls-truncate", "data-index": index, onClick: onClickOption, children: action.label }, index))) }) })] }));
|
|
1448
1453
|
}
|
|
1454
|
+
const RlsButtonToggle = memo(RlsButtonToggleComponent);
|
|
1449
1455
|
|
|
1450
|
-
function
|
|
1456
|
+
function RlsContentComponent({ children, identifier, rlsTheme }) {
|
|
1451
1457
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: "rls-app__page__content", "rls-theme": rlsTheme, children: children }));
|
|
1452
1458
|
}
|
|
1459
|
+
const RlsContent = memo(RlsContentComponent);
|
|
1453
1460
|
|
|
1454
1461
|
const errors = {
|
|
1455
1462
|
es: {
|
|
@@ -1560,7 +1567,7 @@ function msgErrorsI18n(key, language, interpolators) {
|
|
|
1560
1567
|
return _msgErrorsI18n(key, { language, interpolators });
|
|
1561
1568
|
}
|
|
1562
1569
|
|
|
1563
|
-
function
|
|
1570
|
+
function RlsMessageFormErrorComponent({ className, formControl }) {
|
|
1564
1571
|
const [language, setLanguage] = useState('es');
|
|
1565
1572
|
useEffect(() => {
|
|
1566
1573
|
return i18nSubscribe((language) => {
|
|
@@ -1574,8 +1581,9 @@ function RlsMessageFormError({ className, formControl }) {
|
|
|
1574
1581
|
}, [formControl?.error, language]);
|
|
1575
1582
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: formControl?.wrong && (jsxRuntimeExports.jsx("div", { className: className, children: jsxRuntimeExports.jsx(RlsMessageIcon, { icon: "alert-triangle", rlsTheme: "danger", children: msgError }) })) }));
|
|
1576
1583
|
}
|
|
1584
|
+
const RlsMessageFormError = memo(RlsMessageFormErrorComponent);
|
|
1577
1585
|
|
|
1578
|
-
function
|
|
1586
|
+
function RlsFieldAreaComponent(props) {
|
|
1579
1587
|
const { children, formControl, identifier, rlsTheme } = props;
|
|
1580
1588
|
const disabled = useMemo(() => {
|
|
1581
1589
|
return formControl?.disabled || props.disabled;
|
|
@@ -1590,8 +1598,9 @@ function RlsFieldArea(props) {
|
|
|
1590
1598
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1591
1599
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsAreaText, { ...props }) }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1592
1600
|
}
|
|
1601
|
+
const RlsFieldArea = memo(RlsFieldAreaComponent);
|
|
1593
1602
|
|
|
1594
|
-
function
|
|
1603
|
+
function RlsFieldDecimalComponent(props) {
|
|
1595
1604
|
const { children, formControl, identifier, rlsTheme } = props;
|
|
1596
1605
|
const disabled = useMemo(() => {
|
|
1597
1606
|
return formControl?.disabled || props.disabled;
|
|
@@ -1606,8 +1615,9 @@ function RlsFieldDecimal(props) {
|
|
|
1606
1615
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1607
1616
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx(RlsInputDecimal, { ...props }) }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1608
1617
|
}
|
|
1618
|
+
const RlsFieldDecimal = memo(RlsFieldDecimalComponent);
|
|
1609
1619
|
|
|
1610
|
-
function
|
|
1620
|
+
function RlsFieldFileComponent({ accept, children, disabled: _disabled, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value }) {
|
|
1611
1621
|
const inputRef = useRef(null);
|
|
1612
1622
|
const disabled = useMemo(() => formControl?.disabled || _disabled, [formControl?.disabled, _disabled]);
|
|
1613
1623
|
const className = useMemo(() => renderClassStatus('rls-field-box', {
|
|
@@ -1645,6 +1655,7 @@ function RlsFieldFile({ accept, children, disabled: _disabled, formControl, iden
|
|
|
1645
1655
|
}, [readOnly, disabled]);
|
|
1646
1656
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", onClick: onClickControl, children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-input__component", readOnly: true, type: "text", value: displayValue, placeholder: placeholder }), jsxRuntimeExports.jsx("input", { ref: inputRef, className: "rls-field-file__input", type: "file", accept: accept, disabled: disabled || readOnly, onChange: onChangeInput }), jsxRuntimeExports.jsx(RlsButtonAction, { icon: currentFile ? 'close' : 'attach', disabled: disabled, onClick: onClickAction })] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1647
1657
|
}
|
|
1658
|
+
const RlsFieldFile = memo(RlsFieldFileComponent);
|
|
1648
1659
|
|
|
1649
1660
|
const reactI18n = i18n({
|
|
1650
1661
|
es: {
|
|
@@ -1682,7 +1693,7 @@ function RlsFieldListLi({ element, onClickElement, onKeydownElement, render }) {
|
|
|
1682
1693
|
}, [element, onKeydownElement]);
|
|
1683
1694
|
return (jsxRuntimeExports.jsx("li", { className: "rls-field-list__element", tabIndex: -1, onClick: onClick, onKeyDown: onKeyDown, children: render(element) }));
|
|
1684
1695
|
}
|
|
1685
|
-
function
|
|
1696
|
+
function RlsFieldListSuggestionsComponent({ elements, action, disabled, higher, render, renderEmpty, searchControl, visible, onClickBackdrop, onClickElement, onKeydownElement, refList, rlsTheme }) {
|
|
1686
1697
|
const [labels, setLabels] = useState({
|
|
1687
1698
|
listEmptyDescription: reactI18n('listEmptyDescription'),
|
|
1688
1699
|
listEmptyTitle: reactI18n('listEmptyTitle')
|
|
@@ -1714,8 +1725,9 @@ function RlsFieldListSuggestions({ elements, action, disabled, higher, render, r
|
|
|
1714
1725
|
const searching = searchControl?.searching ?? false;
|
|
1715
1726
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-field-list__suggestions__body", children: [jsxRuntimeExports.jsxs("ul", { ref: refList, className: "rls-field-list__ul", children: [searchControl && (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__ul__search", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__ul__control", ref: searchControl.refInput, type: "text", placeholder: searchControl.placeholder, value: searchControl.pattern, onChange: onChangePattern, onFocus: searchControl.onFocus, onBlur: searchControl.onBlur, onKeyDown: searchControl.onKeyDown, disabled: disabled || searching }), searchControl.onSearch && (jsxRuntimeExports.jsx("button", { disabled: disabled || searching, onClick: searchControl.onSearch, children: jsxRuntimeExports.jsx(RlsIcon, { value: "search" }) }))] })), searching && jsxRuntimeExports.jsx(RlsProgressBar, { indeterminate: true }), elements.map((element, index) => (jsxRuntimeExports.jsx(RlsFieldListLi, { element: element, onClickElement: onClickElement, onKeydownElement: onKeydownElement, render: render }, index))), !elements.length && (jsxRuntimeExports.jsx("li", { className: "rls-field-list__empty", children: renderEmpty ? (renderEmpty()) : (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__empty__description", children: [jsxRuntimeExports.jsx("span", { className: "rls-label-font-bold rls-truncate", children: labels.listEmptyTitle }), jsxRuntimeExports.jsx("p", { className: "rls-caption-font-regular", children: labels.listEmptyDescription })] })) }))] }), action && (jsxRuntimeExports.jsx("div", { className: "rls-field-list__action", children: jsxRuntimeExports.jsxs("button", { type: "button", disabled: disabled || action.disabled, onClick: onClickAction, children: [action.icon && jsxRuntimeExports.jsx(RlsIcon, { value: action.icon }), jsxRuntimeExports.jsx("span", { className: "rls-field-list__action__description", children: action.description })] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-field-list__backdrop", onClick: onClickBackdrop })] }));
|
|
1716
1727
|
}
|
|
1728
|
+
const RlsFieldListSuggestions = memo(RlsFieldListSuggestionsComponent);
|
|
1717
1729
|
|
|
1718
|
-
function
|
|
1730
|
+
function RlsFieldMoneyComponent(props) {
|
|
1719
1731
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1720
1732
|
const disabled = useMemo(() => {
|
|
1721
1733
|
return formControl?.disabled || props.disabled;
|
|
@@ -1730,8 +1742,9 @@ function RlsFieldMoney(props) {
|
|
|
1730
1742
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1731
1743
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputMoney, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1732
1744
|
}
|
|
1745
|
+
const RlsFieldMoney = memo(RlsFieldMoneyComponent);
|
|
1733
1746
|
|
|
1734
|
-
function
|
|
1747
|
+
function RlsFieldNumberComponent(props) {
|
|
1735
1748
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1736
1749
|
const disabled = useMemo(() => {
|
|
1737
1750
|
return formControl?.disabled || props.disabled;
|
|
@@ -1746,8 +1759,9 @@ function RlsFieldNumber(props) {
|
|
|
1746
1759
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1747
1760
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputNumber, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1748
1761
|
}
|
|
1762
|
+
const RlsFieldNumber = memo(RlsFieldNumberComponent);
|
|
1749
1763
|
|
|
1750
|
-
function
|
|
1764
|
+
function RlsFieldPasswordComponent(props) {
|
|
1751
1765
|
const { children, formControl, identifier, rlsTheme } = props;
|
|
1752
1766
|
const [passwordIsActive, setPasswordIsActive] = useState(true);
|
|
1753
1767
|
const disabled = useMemo(() => {
|
|
@@ -1766,8 +1780,9 @@ function RlsFieldPassword(props) {
|
|
|
1766
1780
|
}, []);
|
|
1767
1781
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputPassword, { ...props, type: passwordIsActive ? 'password' : 'text' }), jsxRuntimeExports.jsx(RlsButtonAction, { icon: passwordIsActive ? 'eye' : 'eye-off', onClick: onTogglePassword })] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1768
1782
|
}
|
|
1783
|
+
const RlsFieldPassword = memo(RlsFieldPasswordComponent);
|
|
1769
1784
|
|
|
1770
|
-
function
|
|
1785
|
+
function RlsFieldPercentageComponent(props) {
|
|
1771
1786
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1772
1787
|
const disabled = useMemo(() => {
|
|
1773
1788
|
return formControl?.disabled || props.disabled;
|
|
@@ -1782,12 +1797,14 @@ function RlsFieldPercentage(props) {
|
|
|
1782
1797
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1783
1798
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputPercentage, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1784
1799
|
}
|
|
1800
|
+
const RlsFieldPercentage = memo(RlsFieldPercentageComponent);
|
|
1785
1801
|
|
|
1786
|
-
function
|
|
1802
|
+
function RlsFieldReadonlyComponent({ children, identifier, rlsTheme, value }) {
|
|
1787
1803
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-readonly rls-field-box", "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsx("div", { className: "rls-field-box__body", children: jsxRuntimeExports.jsx("input", { className: "rls-input__component", autoComplete: "off", type: 'text', readOnly: true, value: value }) }) })] }));
|
|
1788
1804
|
}
|
|
1805
|
+
const RlsFieldReadonly = memo(RlsFieldReadonlyComponent);
|
|
1789
1806
|
|
|
1790
|
-
function
|
|
1807
|
+
function RlsFieldTextComponent(props) {
|
|
1791
1808
|
const { action, children, formControl, identifier, rlsTheme } = props;
|
|
1792
1809
|
const disabled = useMemo(() => {
|
|
1793
1810
|
return formControl?.disabled || props.disabled;
|
|
@@ -1802,6 +1819,7 @@ function RlsFieldText(props) {
|
|
|
1802
1819
|
}, [formControl?.focused, formControl?.wrong, props.readOnly, disabled]);
|
|
1803
1820
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx(RlsInputText, { ...props }), action && (jsxRuntimeExports.jsx(RlsButtonAction, { icon: action.icon, disabled: disabled, onClick: action.onClick }))] }) }), !props.msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
1804
1821
|
}
|
|
1822
|
+
const RlsFieldText = memo(RlsFieldTextComponent);
|
|
1805
1823
|
|
|
1806
1824
|
function useFormToggleController({ disabled, formControl }) {
|
|
1807
1825
|
const [checked, setChecked] = useState(!!formControl?.value);
|
|
@@ -1823,7 +1841,7 @@ function useFormToggleController({ disabled, formControl }) {
|
|
|
1823
1841
|
return { checked, onToggle };
|
|
1824
1842
|
}
|
|
1825
1843
|
|
|
1826
|
-
function
|
|
1844
|
+
function RlsLabelCheckBoxComponent({ children, disabled, extended, identifier, formControl, reverse, rlsTheme }) {
|
|
1827
1845
|
const { checked, onToggle } = useFormToggleController({
|
|
1828
1846
|
disabled,
|
|
1829
1847
|
formControl
|
|
@@ -1837,8 +1855,9 @@ function RlsLabelCheckBox({ children, disabled, extended, identifier, formContro
|
|
|
1837
1855
|
}, [disabled, extended, reverse]);
|
|
1838
1856
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsCheckBox, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-checkbox__text", children: children })] }));
|
|
1839
1857
|
}
|
|
1858
|
+
const RlsLabelCheckBox = memo(RlsLabelCheckBoxComponent);
|
|
1840
1859
|
|
|
1841
|
-
function
|
|
1860
|
+
function RlsLabelRadioButtonComponent({ children, disabled, extended, identifier, formControl, onValue, reverse, rlsTheme, value }) {
|
|
1842
1861
|
const { checked, onSelect } = useFormSingleSelectionController({
|
|
1843
1862
|
disabled,
|
|
1844
1863
|
formControl,
|
|
@@ -1854,8 +1873,9 @@ function RlsLabelRadioButton({ children, disabled, extended, identifier, formCon
|
|
|
1854
1873
|
}, [disabled, extended, reverse]);
|
|
1855
1874
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__component", onClick: onSelect, children: jsxRuntimeExports.jsx(RlsRadioButton, { checked: checked, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-radiobutton__text", children: children })] }));
|
|
1856
1875
|
}
|
|
1876
|
+
const RlsLabelRadioButton = memo(RlsLabelRadioButtonComponent);
|
|
1857
1877
|
|
|
1858
|
-
function
|
|
1878
|
+
function RlsLabelSwitchComponent({ capsule, children, disabled, extended, identifier, formControl, reverse, rlsTheme }) {
|
|
1859
1879
|
const { checked, onToggle } = useFormToggleController({
|
|
1860
1880
|
disabled,
|
|
1861
1881
|
formControl
|
|
@@ -1869,8 +1889,9 @@ function RlsLabelSwitch({ capsule, children, disabled, extended, identifier, for
|
|
|
1869
1889
|
}, [disabled, extended, reverse]);
|
|
1870
1890
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: className, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-label-switch__component", onClick: onToggle, children: jsxRuntimeExports.jsx(RlsSwitch, { checked: checked, capsule: capsule, disabled: disabled }) }), jsxRuntimeExports.jsx("div", { className: "rls-label-switch__text", children: children })] }));
|
|
1871
1891
|
}
|
|
1892
|
+
const RlsLabelSwitch = memo(RlsLabelSwitchComponent);
|
|
1872
1893
|
|
|
1873
|
-
function
|
|
1894
|
+
function RlsMessageEmptyComponent({ children, className, emoji, icon, identifier, image, rlsTheme, title }) {
|
|
1874
1895
|
const classNameMessageEmpty = useMemo(() => {
|
|
1875
1896
|
return renderClassStatus('rls-message-empty', {}, className);
|
|
1876
1897
|
}, [className]);
|
|
@@ -1888,10 +1909,12 @@ function RlsMessageEmpty({ children, className, emoji, icon, identifier, image,
|
|
|
1888
1909
|
}, [icon, emoji, image]);
|
|
1889
1910
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: classNameMessageEmpty, "rls-theme": rlsTheme, children: [logo, jsxRuntimeExports.jsxs("div", { className: "rls-message-empty__body", children: [title && jsxRuntimeExports.jsx("div", { className: "rls-message-empty__title", children: title }), children && (jsxRuntimeExports.jsx("div", { className: "rls-message-empty__content", children: children }))] })] }));
|
|
1890
1911
|
}
|
|
1912
|
+
const RlsMessageEmpty = memo(RlsMessageEmptyComponent);
|
|
1891
1913
|
|
|
1892
|
-
function
|
|
1914
|
+
function RlsNavbarComponent({ children, identifier, rlsTheme }) {
|
|
1893
1915
|
return (jsxRuntimeExports.jsxs("nav", { id: identifier, className: "rls-app__page__nav", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-app__page__nav__content", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-app__page__nav__backdrop" })] }));
|
|
1894
1916
|
}
|
|
1917
|
+
const RlsNavbar = memo(RlsNavbarComponent);
|
|
1895
1918
|
|
|
1896
1919
|
function RlsNavbarMenuOption({ option, onOption }) {
|
|
1897
1920
|
const onClick = useCallback(() => {
|
|
@@ -1899,9 +1922,10 @@ function RlsNavbarMenuOption({ option, onOption }) {
|
|
|
1899
1922
|
}, [onOption]);
|
|
1900
1923
|
return (jsxRuntimeExports.jsxs("li", { className: "rls-app__page__nav__option", onClick: onClick, children: [jsxRuntimeExports.jsx(RlsIcon, { value: option.icon }), jsxRuntimeExports.jsx("span", { className: "rls-label-font", children: option.label })] }));
|
|
1901
1924
|
}
|
|
1902
|
-
function
|
|
1925
|
+
function RlsNavbarMenuComponent({ options, onOption }) {
|
|
1903
1926
|
return (jsxRuntimeExports.jsx("ul", { className: "rls-app__page__nav__menu", children: options.map((option) => (jsxRuntimeExports.jsx(RlsNavbarMenuOption, { option: option, onOption: onOption }, option.id))) }));
|
|
1904
1927
|
}
|
|
1928
|
+
const RlsNavbarMenu = memo(RlsNavbarMenuComponent);
|
|
1905
1929
|
|
|
1906
1930
|
function PageButton({ page, onSelect }) {
|
|
1907
1931
|
const className = useMemo(() => renderClassStatus('rls-pagination__page', { active: page.active }), [page.active]);
|
|
@@ -1910,7 +1934,7 @@ function PageButton({ page, onSelect }) {
|
|
|
1910
1934
|
}, [page, onSelect]);
|
|
1911
1935
|
return (jsxRuntimeExports.jsx("button", { type: "button", className: className, onClick: onClick, children: page.label }));
|
|
1912
1936
|
}
|
|
1913
|
-
function
|
|
1937
|
+
function RlsPaginationComponent({ suggestions, count, filter, onPagination }) {
|
|
1914
1938
|
const [template, setTemplate] = useState();
|
|
1915
1939
|
const controller = useRef(undefined);
|
|
1916
1940
|
const refreshTemplate = useCallback((template, suggestions) => {
|
|
@@ -1952,6 +1976,7 @@ function RlsPagination({ suggestions, count, filter, onPagination }) {
|
|
|
1952
1976
|
}, [refreshPagination]);
|
|
1953
1977
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-pagination", children: [jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goFirstPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-left" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goPreviousPagination, disabled: template?.firstPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-left" }) })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__body", children: [jsxRuntimeExports.jsx("div", { className: "rls-pagination__pages", children: template?.pages.map((page) => (jsxRuntimeExports.jsx(PageButton, { page: page, onSelect: goToPagination }, page.value))) }), jsxRuntimeExports.jsx("div", { className: "rls-pagination__description", children: template?.description }), jsxRuntimeExports.jsx("span", { className: "rls-pagination__count", children: suggestions.length })] }), jsxRuntimeExports.jsxs("div", { className: "rls-pagination__actions", children: [jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goNextPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrow-ios-right" }) }), jsxRuntimeExports.jsx("button", { className: "rls-pagination__action", onClick: goLastPagination, disabled: template?.lastPage, children: jsxRuntimeExports.jsx(RlsIcon, { value: "arrowhead-right" }) })] })] }));
|
|
1954
1978
|
}
|
|
1979
|
+
const RlsPagination = memo(RlsPaginationComponent);
|
|
1955
1980
|
|
|
1956
1981
|
function RlsPickerDayHeaders() {
|
|
1957
1982
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("span", { className: "rls-picker-day__label", children: title }, index))) }));
|
|
@@ -1973,7 +1998,7 @@ function RlsPickerDayElement({ day, onSelect, disabled }) {
|
|
|
1973
1998
|
}, [day.value, day.disabled, disabled, onSelect]);
|
|
1974
1999
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day__element__span", children: day.value || '??' }) }));
|
|
1975
2000
|
}
|
|
1976
|
-
function
|
|
2001
|
+
function RlsPickerDayComponent({ date, disabled, formControl, maxDate, month, minDate, onValue, rlsTheme, year }) {
|
|
1977
2002
|
const dateDay = useMemo(() => date ?? new Date(), [date]);
|
|
1978
2003
|
const [weeks, setWeeks] = useState([]);
|
|
1979
2004
|
const [value, setValue] = useState(formControl?.value ?? dateDay.getDate());
|
|
@@ -2026,6 +2051,7 @@ function RlsPickerDay({ date, disabled, formControl, maxDate, month, minDate, on
|
|
|
2026
2051
|
}, [dateDay, formControl?.value, value, month, year, minDate, maxDate]);
|
|
2027
2052
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx(RlsPickerDayHeaders, {}), jsxRuntimeExports.jsx("div", { className: "rls-picker-day__component", children: weeks.map(({ days }, index) => (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__week", children: days.map((day, index) => (jsxRuntimeExports.jsx(RlsPickerDayElement, { day: day, onSelect: onSelect, disabled: disabled }, index))) }, index))) })] }));
|
|
2028
2053
|
}
|
|
2054
|
+
const RlsPickerDay = memo(RlsPickerDayComponent);
|
|
2029
2055
|
|
|
2030
2056
|
function RlsPickerDayRangeHeaders() {
|
|
2031
2057
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-day__header", children: DAY_LABELS().map((title, index) => (jsxRuntimeExports.jsx("span", { className: "rls-picker-day__label", children: title }, index))) }));
|
|
@@ -2047,7 +2073,7 @@ function RlsPickerDayRangeElement({ day, onSelect, disabled }) {
|
|
|
2047
2073
|
}, [day.value, day.disabled, disabled, onSelect]);
|
|
2048
2074
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-day-range__element__span", children: day.value || '??' }) }));
|
|
2049
2075
|
}
|
|
2050
|
-
function
|
|
2076
|
+
function RlsPickerDayRangeComponent({ date, disabled, formControl, maxDate, minDate, rlsTheme }) {
|
|
2051
2077
|
const rangeDay = useMemo(() => {
|
|
2052
2078
|
return formControl?.value ?? DateRange.now();
|
|
2053
2079
|
}, [formControl?.value]);
|
|
@@ -2083,6 +2109,7 @@ function RlsPickerDayRange({ date, disabled, formControl, maxDate, minDate, rlsT
|
|
|
2083
2109
|
}, [dateDayRange, range, minDate, maxDate]);
|
|
2084
2110
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-day-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx(RlsPickerDayRangeHeaders, {}), jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__component", children: weeks.map(({ days }, index) => (jsxRuntimeExports.jsx("div", { className: "rls-picker-day-range__week", children: days.map((day, index) => (jsxRuntimeExports.jsx(RlsPickerDayRangeElement, { day: day, onSelect: onSelect, disabled: disabled }, index))) }, index))) })] }));
|
|
2085
2111
|
}
|
|
2112
|
+
const RlsPickerDayRange = memo(RlsPickerDayRangeComponent);
|
|
2086
2113
|
|
|
2087
2114
|
function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
2088
2115
|
const [label, setLabel] = useState(MONTH_NAMES(month.value));
|
|
@@ -2105,7 +2132,7 @@ function RlsPickerMonthElement({ month, onSelect, disabled }) {
|
|
|
2105
2132
|
}, [month.value, month.disabled, disabled, onSelect]);
|
|
2106
2133
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-month__span", children: label }) }));
|
|
2107
2134
|
}
|
|
2108
|
-
function
|
|
2135
|
+
function RlsPickerMonthComponent({ date, disabled, formControl, maxDate, minDate, onValue, rlsTheme, year }) {
|
|
2109
2136
|
const dateMonth = useMemo(() => date ?? new Date(), [date]);
|
|
2110
2137
|
const [months, setMonths] = useState([]);
|
|
2111
2138
|
const [value, setValue] = useState(formControl?.value ?? dateMonth.getMonth());
|
|
@@ -2154,8 +2181,9 @@ function RlsPickerMonth({ date, disabled, formControl, maxDate, minDate, onValue
|
|
|
2154
2181
|
}, [formControl?.value]);
|
|
2155
2182
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-month", "rls-theme": rlsTheme, children: months.map((month, index) => (jsxRuntimeExports.jsx(RlsPickerMonthElement, { month: month, onSelect: onSelect, disabled: disabled }, index))) }));
|
|
2156
2183
|
}
|
|
2184
|
+
const RlsPickerMonth = memo(RlsPickerMonthComponent);
|
|
2157
2185
|
|
|
2158
|
-
function
|
|
2186
|
+
function RlsPickerSelectorTitleComponent({ monthControl, type, yearControl, date, disabled, maxDate, minDate, onClick }) {
|
|
2159
2187
|
const { limitNext, limitPrevious } = useMemo(() => {
|
|
2160
2188
|
return monthLimitTemplate({
|
|
2161
2189
|
date,
|
|
@@ -2231,6 +2259,7 @@ function RlsPickerSelectorTitle({ monthControl, type, yearControl, date, disable
|
|
|
2231
2259
|
}, [type, onNextMonth, onNextYear]);
|
|
2232
2260
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-selector-title", children: [jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-left", onClick: onPrevious, disabled: limitPrevious || disabled }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-selector-title__label", children: [jsxRuntimeExports.jsxs("span", { onClick: onMonth, children: [label, ","] }), jsxRuntimeExports.jsx("span", { onClick: onYear, children: yearControl.value })] }), jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-right", onClick: onNext, disabled: limitNext || disabled })] }));
|
|
2233
2261
|
}
|
|
2262
|
+
const RlsPickerSelectorTitle = memo(RlsPickerSelectorTitleComponent);
|
|
2234
2263
|
|
|
2235
2264
|
function RlsPickerYearElement({ onSelect, year, disabled }) {
|
|
2236
2265
|
const className = useMemo(() => {
|
|
@@ -2247,7 +2276,7 @@ function RlsPickerYearElement({ onSelect, year, disabled }) {
|
|
|
2247
2276
|
}, [year.value, year.disabled, disabled, onSelect]);
|
|
2248
2277
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { className: "rls-picker-year__span", children: year.value || '????' }) }));
|
|
2249
2278
|
}
|
|
2250
|
-
function
|
|
2279
|
+
function RlsPickerYearComponent({ date, disabled, formControl, maxDate, minDate, onValue, rlsTheme }) {
|
|
2251
2280
|
const dateYear = useMemo(() => date ?? new Date(), [date]);
|
|
2252
2281
|
const [year, setYear] = useState(formControl?.value ?? dateYear.getFullYear());
|
|
2253
2282
|
const createPickerOptions = useCallback(() => {
|
|
@@ -2292,6 +2321,7 @@ function RlsPickerYear({ date, disabled, formControl, maxDate, minDate, onValue,
|
|
|
2292
2321
|
}, []);
|
|
2293
2322
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-year", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-year__header", children: [jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-left", onClick: onClickPrev, disabled: !template.canPrevious || disabled }), jsxRuntimeExports.jsxs("span", { children: [template.minRange, " - ", template.maxRange] }), jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-right", onClick: onClickNext, disabled: !template.canNext || disabled })] }), jsxRuntimeExports.jsx("div", { className: "rls-picker-year__component", children: template.years.map((year, index) => (jsxRuntimeExports.jsx(RlsPickerYearElement, { year: year, onSelect: onSelect, disabled: disabled }, index))) })] }));
|
|
2294
2323
|
}
|
|
2324
|
+
const RlsPickerYear = memo(RlsPickerYearComponent);
|
|
2295
2325
|
|
|
2296
2326
|
function calculateInitialValue(value, minValue, maxValue) {
|
|
2297
2327
|
return minValue > value ? minValue : maxValue < value ? maxValue : value;
|
|
@@ -2301,7 +2331,7 @@ function calculateInitialRate(value, minValue, maxValue) {
|
|
|
2301
2331
|
const rateValue = value - minValue;
|
|
2302
2332
|
return Math.ceil((rateValue / rateMax) * 100);
|
|
2303
2333
|
}
|
|
2304
|
-
function
|
|
2334
|
+
function RlsSliderComponent({ children, className, disabled, formControl, identifier, maxValue, minValue, onValue, prefixIcon, rlsTheme, value }) {
|
|
2305
2335
|
const minValueSlider = useMemo(() => {
|
|
2306
2336
|
return minValue ?? 0;
|
|
2307
2337
|
}, [minValue]);
|
|
@@ -2347,6 +2377,7 @@ function RlsSlider({ children, className, disabled, formControl, identifier, max
|
|
|
2347
2377
|
}, [minValueSlider, maxValueSlider]);
|
|
2348
2378
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: classNameSlider, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-slider__label", children: children }), jsxRuntimeExports.jsxs("div", { className: "rls-slider__body", children: [prefixIcon && jsxRuntimeExports.jsx(RlsIcon, { value: prefixIcon }), jsxRuntimeExports.jsxs("div", { ref: refComponent, className: "rls-slider__component", children: [jsxRuntimeExports.jsx("div", { ref: refTrack, className: "rls-slider__track", onClick: onClickTrack, children: jsxRuntimeExports.jsx("div", { ref: refTrackOn, className: "rls-slider__track__on" }) }), jsxRuntimeExports.jsxs("div", { ref: refThumb, className: "rls-slider__thumb", children: [rate, "%"] })] })] })] }));
|
|
2349
2379
|
}
|
|
2380
|
+
const RlsSlider = memo(RlsSliderComponent);
|
|
2350
2381
|
|
|
2351
2382
|
function RlsTab({ onSelect, tab, value }) {
|
|
2352
2383
|
const className = useMemo(() => {
|
|
@@ -2362,7 +2393,7 @@ function RlsTab({ onSelect, tab, value }) {
|
|
|
2362
2393
|
}, [tab.disabled]);
|
|
2363
2394
|
return (jsxRuntimeExports.jsx("div", { className: className, onClick: onClick, children: jsxRuntimeExports.jsx("span", { children: tab.label }) }));
|
|
2364
2395
|
}
|
|
2365
|
-
function
|
|
2396
|
+
function RlsTabsComponent({ tabs, onValue, rlsTheme }) {
|
|
2366
2397
|
const [value, setValue] = useState();
|
|
2367
2398
|
const onSelect = useCallback((value) => {
|
|
2368
2399
|
setValue(value);
|
|
@@ -2378,12 +2409,14 @@ function RlsTabs({ tabs, onValue, rlsTheme }) {
|
|
|
2378
2409
|
return (jsxRuntimeExports.jsx(RlsTab, { tab: tab, value: value, onSelect: onSelect }, index));
|
|
2379
2410
|
}) }));
|
|
2380
2411
|
}
|
|
2412
|
+
const RlsTabs = memo(RlsTabsComponent);
|
|
2381
2413
|
|
|
2382
|
-
function
|
|
2414
|
+
function RlsToolbarComponent({ actions, children, subtitle }) {
|
|
2383
2415
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-toolbar", children: [jsxRuntimeExports.jsxs("div", { className: "rls-toolbar__description", children: [children && jsxRuntimeExports.jsx("label", { className: "rls-toolbar__title", children: children }), subtitle && (jsxRuntimeExports.jsx("label", { className: "rls-toolbar__subtitle smalltext-semibold", children: subtitle }))] }), actions && (jsxRuntimeExports.jsx("div", { className: "rls-toolbar__actions", children: actions.map((action, index) => (jsxRuntimeExports.jsx("div", { children: action }, index))) }))] }));
|
|
2384
2416
|
}
|
|
2417
|
+
const RlsToolbar = memo(RlsToolbarComponent);
|
|
2385
2418
|
|
|
2386
|
-
function
|
|
2419
|
+
function RlsBottomSheetComponent({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2387
2420
|
const classNameSheet = useMemo(() => {
|
|
2388
2421
|
return renderClassStatus('rls-bottom-sheet', { visible: controller?.visible ?? visible }, className);
|
|
2389
2422
|
}, [className, visible, controller?.visible]);
|
|
@@ -2395,13 +2428,15 @@ function RlsBottomSheet({ autoclose, children, className, controller, onBackdrop
|
|
|
2395
2428
|
}, [autoclose, controller, onBackdrop]);
|
|
2396
2429
|
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameSheet, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-bottom-sheet__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-bottom-sheet__backdrop", onClick: onClickBackdrop })] }), document.body);
|
|
2397
2430
|
}
|
|
2431
|
+
const RlsBottomSheet = memo(RlsBottomSheetComponent);
|
|
2398
2432
|
|
|
2399
|
-
function
|
|
2433
|
+
function RlsCardComponent({ children, className, outline, rlsTheme }) {
|
|
2400
2434
|
const classNameCard = useMemo(() => {
|
|
2401
2435
|
return renderClassStatus('rls-card', { outline }, className);
|
|
2402
2436
|
}, [outline, className]);
|
|
2403
2437
|
return (jsxRuntimeExports.jsx("div", { className: classNameCard, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-card__content", children: children }) }));
|
|
2404
2438
|
}
|
|
2439
|
+
const RlsCard = memo(RlsCardComponent);
|
|
2405
2440
|
|
|
2406
2441
|
class ConfirmationResult extends SealedPartial {
|
|
2407
2442
|
static approved() {
|
|
@@ -2411,12 +2446,13 @@ class ConfirmationResult extends SealedPartial {
|
|
|
2411
2446
|
return new ConfirmationResult('reject');
|
|
2412
2447
|
}
|
|
2413
2448
|
}
|
|
2414
|
-
function
|
|
2449
|
+
function RlsConfirmationComponent({ approved, className, content, reject, rlsTheme, subtitle, title, visible }) {
|
|
2415
2450
|
const classConfirmation = useMemo(() => {
|
|
2416
2451
|
return renderClassStatus('rls-confirmation', { visible }, className);
|
|
2417
2452
|
}, [visible, className]);
|
|
2418
2453
|
return (jsxRuntimeExports.jsxs("div", { className: classConfirmation, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__header", children: [title && jsxRuntimeExports.jsx("div", { className: "rls-confirmation__title", children: title }), subtitle && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__subtitle", children: subtitle }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__body", children: content && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__content", children: content })) }), (approved || reject) && (jsxRuntimeExports.jsx("div", { className: "rls-confirmation__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-confirmation__actions", children: [approved && (jsxRuntimeExports.jsx(RlsButton, { identifier: approved.identifier, type: approved.type, onClick: approved.onClick, disabled: approved.disabled, rlsTheme: approved.rlsTheme, children: approved.label })), reject && (jsxRuntimeExports.jsx(RlsButton, { identifier: reject.identifier, type: reject.type, onClick: reject.onClick, disabled: reject.disabled, rlsTheme: reject.rlsTheme, children: reject.label }))] }) }))] }), jsxRuntimeExports.jsx("div", { className: "rls-confirmation__backdrop" })] }));
|
|
2419
2454
|
}
|
|
2455
|
+
const RlsConfirmation = memo(RlsConfirmationComponent);
|
|
2420
2456
|
function useConfirmation() {
|
|
2421
2457
|
const [config, setConfig] = useState({});
|
|
2422
2458
|
const [visible, setVisible] = useState(false);
|
|
@@ -2482,7 +2518,7 @@ function useDatatable(table) {
|
|
|
2482
2518
|
return { refTable, scrolleable };
|
|
2483
2519
|
}
|
|
2484
2520
|
|
|
2485
|
-
function
|
|
2521
|
+
function RlsDatatableComponent({ children, footer, header, identifier, rlsTheme, resizable, summary, table, toolbar }) {
|
|
2486
2522
|
const datatable = useDatatable(table);
|
|
2487
2523
|
const className = useMemo(() => {
|
|
2488
2524
|
return renderClassStatus('rls-datatable', {
|
|
@@ -2492,53 +2528,62 @@ function RlsDatatable({ children, footer, header, identifier, rlsTheme, resizabl
|
|
|
2492
2528
|
}, [resizable, datatable.scrolleable]);
|
|
2493
2529
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [toolbar && jsxRuntimeExports.jsx("div", { className: "rls-datatable__toolbar", children: toolbar }), jsxRuntimeExports.jsx("div", { className: "rls-datatable__table", children: jsxRuntimeExports.jsxs("table", { id: identifier, children: [header && jsxRuntimeExports.jsx("thead", { className: "rls-datatable__head", children: header }), jsxRuntimeExports.jsx("tbody", { ref: datatable?.refTable, className: "rls-datatable__body", children: children })] }) }), summary && jsxRuntimeExports.jsx("div", { className: "rls-datatable__summary", children: summary }), footer && jsxRuntimeExports.jsx("div", { className: "rls-datatable__footer", children: footer })] }));
|
|
2494
2530
|
}
|
|
2495
|
-
|
|
2531
|
+
const RlsDatatable = memo(RlsDatatableComponent);
|
|
2532
|
+
function RlsDatatableHeaderComponent({ children, identifier, rlsTheme }) {
|
|
2496
2533
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: "rls-datatable__header", "rls-theme": rlsTheme, children: children }));
|
|
2497
2534
|
}
|
|
2498
|
-
|
|
2535
|
+
const RlsDatatableHeader = memo(RlsDatatableHeaderComponent);
|
|
2536
|
+
function RlsDatatableTitleComponent({ actions, children, className, control, identifier, rlsTheme, truncated }) {
|
|
2499
2537
|
const classNameTitle = useMemo(() => {
|
|
2500
|
-
return renderClassStatus('rls-datatable__title', {
|
|
2501
|
-
}, [className, truncated, control]);
|
|
2538
|
+
return renderClassStatus('rls-datatable__title', { actions, control, truncated }, className);
|
|
2539
|
+
}, [className, truncated, control, actions]);
|
|
2502
2540
|
return (jsxRuntimeExports.jsx("th", { id: identifier, className: classNameTitle, "rls-theme": rlsTheme, children: children }));
|
|
2503
2541
|
}
|
|
2504
|
-
|
|
2542
|
+
const RlsDatatableTitle = memo(RlsDatatableTitleComponent);
|
|
2543
|
+
function RlsDatatableSubheaderComponent({ children, className, identifier, rlsTheme }) {
|
|
2505
2544
|
const classNameSubheader = useMemo(() => {
|
|
2506
2545
|
return renderClassStatus('rls-datatable__subheader', {}, className);
|
|
2507
2546
|
}, [className]);
|
|
2508
2547
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameSubheader, "rls-theme": rlsTheme, children: children }));
|
|
2509
2548
|
}
|
|
2510
|
-
|
|
2549
|
+
const RlsDatatableSubheader = memo(RlsDatatableSubheaderComponent);
|
|
2550
|
+
function RlsDatatableRecordComponent({ children, className, error, identifier, info, rlsTheme, success, truncated, warning }) {
|
|
2511
2551
|
const classNameRecord = useMemo(() => {
|
|
2512
2552
|
return renderClassStatus('rls-datatable__record', { error, info, truncated, success, warning }, className);
|
|
2513
2553
|
}, [className, truncated, error, info, success, warning]);
|
|
2514
2554
|
return (jsxRuntimeExports.jsx("tr", { id: identifier, className: classNameRecord, "rls-theme": rlsTheme, children: children }));
|
|
2515
2555
|
}
|
|
2516
|
-
|
|
2556
|
+
const RlsDatatableRecord = memo(RlsDatatableRecordComponent);
|
|
2557
|
+
function RlsDatatableTotalsComponent({ children, className, error, identifier, info, rlsTheme, success, truncated, warning }) {
|
|
2517
2558
|
const classNameTotals = useMemo(() => {
|
|
2518
2559
|
return renderClassStatus('rls-datatable__totals', { error, info, truncated, success, warning }, className);
|
|
2519
2560
|
}, [className, truncated, error, info, success, warning]);
|
|
2520
2561
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameTotals, "rls-theme": rlsTheme, children: children }));
|
|
2521
2562
|
}
|
|
2522
|
-
|
|
2563
|
+
const RlsDatatableTotals = memo(RlsDatatableTotalsComponent);
|
|
2564
|
+
function RlsDatatableCellComponent({ actions, children, className, control, identifier, rlsTheme, truncated }) {
|
|
2523
2565
|
const classNameCell = useMemo(() => {
|
|
2524
|
-
return renderClassStatus('rls-datatable__cell', { control, truncated }, className);
|
|
2525
|
-
}, [className, truncated, control]);
|
|
2566
|
+
return renderClassStatus('rls-datatable__cell', { actions, control, truncated }, className);
|
|
2567
|
+
}, [className, truncated, control, actions]);
|
|
2526
2568
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameCell, "rls-theme": rlsTheme, children: children }));
|
|
2527
2569
|
}
|
|
2528
|
-
|
|
2570
|
+
const RlsDatatableCell = memo(RlsDatatableCellComponent);
|
|
2571
|
+
function RlsDatatableDataComponent({ actions, children, className, control, identifier, truncated }) {
|
|
2529
2572
|
const classNameData = useMemo(() => {
|
|
2530
|
-
return renderClassStatus('rls-datatable__data', { control, truncated }, className);
|
|
2531
|
-
}, [className, truncated, control]);
|
|
2573
|
+
return renderClassStatus('rls-datatable__data', { actions, control, truncated }, className);
|
|
2574
|
+
}, [className, truncated, control, actions]);
|
|
2532
2575
|
return (jsxRuntimeExports.jsx("div", { id: identifier, className: classNameData, children: children }));
|
|
2533
2576
|
}
|
|
2534
|
-
|
|
2577
|
+
const RlsDatatableData = memo(RlsDatatableDataComponent);
|
|
2578
|
+
function RlsDatatableFloatingComponent({ children, className, identifier, invested, rlsTheme }) {
|
|
2535
2579
|
const classNameFloating = useMemo(() => {
|
|
2536
2580
|
return renderClassStatus('rls-datatable__floating', { invested }, className);
|
|
2537
2581
|
}, [className, invested]);
|
|
2538
2582
|
return (jsxRuntimeExports.jsx("td", { id: identifier, className: classNameFloating, "rls-theme": rlsTheme, children: children }));
|
|
2539
2583
|
}
|
|
2584
|
+
const RlsDatatableFloating = memo(RlsDatatableFloatingComponent);
|
|
2540
2585
|
|
|
2541
|
-
function
|
|
2586
|
+
function RlsDropdownComponent({ children, controller, rlsTheme }) {
|
|
2542
2587
|
const className = useMemo(() => {
|
|
2543
2588
|
return renderClassStatus('rls-dropdown', {
|
|
2544
2589
|
visible: controller.visible
|
|
@@ -2557,6 +2602,7 @@ function RlsDropdown({ children, controller, rlsTheme }) {
|
|
|
2557
2602
|
}, []);
|
|
2558
2603
|
return (jsxRuntimeExports.jsx("div", { ref: controller.component, className: className, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-dropdown__content", children: children }) }));
|
|
2559
2604
|
}
|
|
2605
|
+
const RlsDropdown = memo(RlsDropdownComponent);
|
|
2560
2606
|
|
|
2561
2607
|
const MAX_LIST_HEIGHT_REM$1 = 90;
|
|
2562
2608
|
const FALLBACK_REM_SIZE$1 = 16;
|
|
@@ -2567,6 +2613,17 @@ function getRemSize$1() {
|
|
|
2567
2613
|
const fontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
2568
2614
|
return fontSize > 0 ? fontSize : FALLBACK_REM_SIZE$1;
|
|
2569
2615
|
}
|
|
2616
|
+
function suggestionsShallowEqual(a, b) {
|
|
2617
|
+
return (a === b ||
|
|
2618
|
+
(a.length === b.length && a.every((element, index) => element === b[index])));
|
|
2619
|
+
}
|
|
2620
|
+
function useStableSuggestions(suggestions) {
|
|
2621
|
+
const suggestionsRef = useRef(suggestions);
|
|
2622
|
+
if (!suggestionsShallowEqual(suggestionsRef.current, suggestions)) {
|
|
2623
|
+
suggestionsRef.current = suggestions;
|
|
2624
|
+
}
|
|
2625
|
+
return suggestionsRef.current;
|
|
2626
|
+
}
|
|
2570
2627
|
function shouldDisplayHigher$1(content, list) {
|
|
2571
2628
|
if (!content) {
|
|
2572
2629
|
return false;
|
|
@@ -2584,13 +2641,13 @@ function shouldDisplayHigher$1(content, list) {
|
|
|
2584
2641
|
}
|
|
2585
2642
|
return spaceAbove > spaceBelow;
|
|
2586
2643
|
}
|
|
2587
|
-
function useListController(
|
|
2588
|
-
const { suggestions, automatic, formControl, reference } = props;
|
|
2644
|
+
function useListController({ suggestions, automatic, formControl, reference }) {
|
|
2589
2645
|
const refContent = useRef(null);
|
|
2590
2646
|
const refList = useRef(null);
|
|
2591
2647
|
const refInput = useRef(null);
|
|
2592
2648
|
const listIsOpen = useRef(false);
|
|
2593
|
-
const
|
|
2649
|
+
const stableSuggestions = useStableSuggestions(suggestions);
|
|
2650
|
+
const collection = useMemo(() => new ListCollection(stableSuggestions, reference), [stableSuggestions]);
|
|
2594
2651
|
const [state, refreshState] = useState({
|
|
2595
2652
|
focused: false,
|
|
2596
2653
|
higher: false,
|
|
@@ -2619,9 +2676,6 @@ function useListController(props) {
|
|
|
2619
2676
|
formControl?.touch();
|
|
2620
2677
|
}
|
|
2621
2678
|
}, [state.listIsVisible]);
|
|
2622
|
-
useEffect(() => {
|
|
2623
|
-
setCollection(new ListCollection(suggestions, reference));
|
|
2624
|
-
}, [suggestions]);
|
|
2625
2679
|
useEffect(() => {
|
|
2626
2680
|
if (!changeValueInternal.current) {
|
|
2627
2681
|
if (formControl?.value) {
|
|
@@ -2645,7 +2699,7 @@ function useListController(props) {
|
|
|
2645
2699
|
setFormValue(element);
|
|
2646
2700
|
}
|
|
2647
2701
|
else {
|
|
2648
|
-
refreshState({ ...state, value: '' });
|
|
2702
|
+
refreshState((state) => ({ ...state, value: '' }));
|
|
2649
2703
|
}
|
|
2650
2704
|
}
|
|
2651
2705
|
else {
|
|
@@ -2653,20 +2707,20 @@ function useListController(props) {
|
|
|
2653
2707
|
setFormValue(collection.value[0], true);
|
|
2654
2708
|
}
|
|
2655
2709
|
else {
|
|
2656
|
-
refreshState({ ...state, value: '' });
|
|
2710
|
+
refreshState((state) => ({ ...state, value: '' }));
|
|
2657
2711
|
}
|
|
2658
2712
|
}
|
|
2659
2713
|
}
|
|
2660
2714
|
changeValueInternal.current = false;
|
|
2661
2715
|
}, [collection, formControl?.value]);
|
|
2662
2716
|
const setState = useCallback((state) => {
|
|
2663
|
-
const
|
|
2717
|
+
const newState = state.listIsVisible
|
|
2664
2718
|
? {
|
|
2665
2719
|
...state,
|
|
2666
2720
|
higher: shouldDisplayHigher$1(refContent.current, refList.current)
|
|
2667
2721
|
}
|
|
2668
2722
|
: state;
|
|
2669
|
-
refreshState((
|
|
2723
|
+
refreshState((currentState) => ({ ...currentState, ...newState }));
|
|
2670
2724
|
}, []);
|
|
2671
2725
|
const setFormValue = useCallback((element, valueIsDefault = false) => {
|
|
2672
2726
|
refreshState((state) => ({
|
|
@@ -2683,23 +2737,25 @@ function useListController(props) {
|
|
|
2683
2737
|
}, [formControl]);
|
|
2684
2738
|
const navigationInput = useCallback((event) => {
|
|
2685
2739
|
if (state.listIsVisible) {
|
|
2686
|
-
const
|
|
2740
|
+
const newPosition = navigationListFromInput({
|
|
2687
2741
|
content: refContent.current,
|
|
2688
2742
|
event: event,
|
|
2743
|
+
higher: state.higher,
|
|
2689
2744
|
list: refList.current
|
|
2690
2745
|
});
|
|
2691
|
-
position.current =
|
|
2746
|
+
position.current = newPosition ?? 0;
|
|
2692
2747
|
}
|
|
2693
|
-
}, [state.listIsVisible]);
|
|
2748
|
+
}, [state.listIsVisible, state.higher]);
|
|
2694
2749
|
const navigationElement = useCallback((event) => {
|
|
2695
2750
|
position.current = navigationListFromElement({
|
|
2696
2751
|
content: refContent.current,
|
|
2697
2752
|
event: event,
|
|
2753
|
+
higher: state.higher,
|
|
2698
2754
|
input: refInput.current,
|
|
2699
2755
|
list: refList.current,
|
|
2700
2756
|
position: position.current
|
|
2701
2757
|
});
|
|
2702
|
-
}, [state.
|
|
2758
|
+
}, [state.higher]);
|
|
2703
2759
|
return {
|
|
2704
2760
|
...state,
|
|
2705
2761
|
navigationElement,
|
|
@@ -2855,7 +2911,7 @@ function useFieldAutocomplete(props) {
|
|
|
2855
2911
|
};
|
|
2856
2912
|
}
|
|
2857
2913
|
|
|
2858
|
-
function
|
|
2914
|
+
function RlsFieldAutocompleteTemplateComponent(props) {
|
|
2859
2915
|
const autocomplete = useFieldAutocomplete(props);
|
|
2860
2916
|
const { render, action, children, formControl, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
2861
2917
|
const [listInputPlaceholder, setListInputPlaceholder] = useState(reactI18n('listInputPlaceholder'));
|
|
@@ -2919,12 +2975,14 @@ function RlsFieldAutocompleteTemplate(props) {
|
|
|
2919
2975
|
]);
|
|
2920
2976
|
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: autocomplete.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: autocomplete.value, onClick: autocomplete.onClickControl }), !props.readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: autocomplete.value ? 'trash-2' : 'arrow-ios-down', onClick: autocomplete.onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: autocomplete.coincidences, visible: autocomplete.listIsVisible, action: action, disabled: disabled, higher: autocomplete.higher, render: render, refList: autocomplete.refList, searchControl: searchControl, onClickElement: autocomplete.onClickElement, onKeydownElement: autocomplete.onKeydownElement, onClickBackdrop: autocomplete.onClickBackdrop })] }));
|
|
2921
2977
|
}
|
|
2922
|
-
|
|
2978
|
+
const RlsFieldAutocompleteTemplate = memo(RlsFieldAutocompleteTemplateComponent);
|
|
2979
|
+
function RlsFieldAutocompleteComponent(props) {
|
|
2923
2980
|
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { className: "rls-field-list__ballot", subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
2924
2981
|
return jsxRuntimeExports.jsx(RlsFieldAutocompleteTemplate, { ...props, render: render });
|
|
2925
2982
|
}
|
|
2983
|
+
const RlsFieldAutocomplete = memo(RlsFieldAutocompleteComponent);
|
|
2926
2984
|
|
|
2927
|
-
function
|
|
2985
|
+
function RlsModalComponent({ autoclose, children, className, controller, onBackdrop, visible, rlsTheme }) {
|
|
2928
2986
|
const classNameModal = useMemo(() => {
|
|
2929
2987
|
return renderClassStatus('rls-modal', { visible: controller?.visible ?? visible }, className);
|
|
2930
2988
|
}, [className, visible, controller?.visible]);
|
|
@@ -2936,6 +2994,7 @@ function RlsModal({ autoclose, children, className, controller, onBackdrop, visi
|
|
|
2936
2994
|
}, [autoclose, controller, onBackdrop]);
|
|
2937
2995
|
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameModal, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-modal__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-modal__backdrop", onClick: onClickBackdrop })] }), document.body);
|
|
2938
2996
|
}
|
|
2997
|
+
const RlsModal = memo(RlsModalComponent);
|
|
2939
2998
|
|
|
2940
2999
|
function formatTime(value) {
|
|
2941
3000
|
return String(value).padStart(2, '0');
|
|
@@ -2969,7 +3028,7 @@ function RlsPickerClockTick({ onValue, selectionIsHours, value }) {
|
|
|
2969
3028
|
}, [onValue]);
|
|
2970
3029
|
return (jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__tick", style: styleTick, onClick: onClick, children: label }));
|
|
2971
3030
|
}
|
|
2972
|
-
function
|
|
3031
|
+
function RlsPickerClockComponent({ formControl, onListener, rlsTheme, time }) {
|
|
2973
3032
|
const timeInitial = useMemo(() => {
|
|
2974
3033
|
return formControl?.value ?? time ?? Time.now();
|
|
2975
3034
|
}, [formControl?.value, time]);
|
|
@@ -3156,8 +3215,18 @@ function RlsPickerClock({ formControl, onListener, rlsTheme, time }) {
|
|
|
3156
3215
|
return (jsxRuntimeExports.jsx(RlsPickerClockTick, { value: value, selectionIsHours: selectionIsHours, onValue: onClickValue }, value));
|
|
3157
3216
|
}) })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-clock__footer", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.timeActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "timer", onClick: onCurrentTime }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-clock__footer--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.timeActionSelect }) })] })] }));
|
|
3158
3217
|
}
|
|
3218
|
+
const RlsPickerClock = memo(RlsPickerClockComponent);
|
|
3159
3219
|
|
|
3160
|
-
function
|
|
3220
|
+
function RlsModalClockComponent({ controller, disabled, formControl, onClose, rlsTheme, time, visible }) {
|
|
3221
|
+
const onListener = useCallback(({ event, value }) => {
|
|
3222
|
+
onClose?.(event !== PickerListenerEvent.Cancel ? value : undefined);
|
|
3223
|
+
controller?.close();
|
|
3224
|
+
}, [onClose, controller]);
|
|
3225
|
+
return (jsxRuntimeExports.jsx(RlsModal, { className: "rls-modal-clock", controller: controller, visible: visible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerClock, { formControl: formControl, time: time, disabled: disabled, onListener: onListener }) }));
|
|
3226
|
+
}
|
|
3227
|
+
const RlsModalClock = memo(RlsModalClockComponent);
|
|
3228
|
+
|
|
3229
|
+
function RlsFieldClockComponent({ children, disabled: disabledProps, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, time, value: valueInitial }) {
|
|
3161
3230
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3162
3231
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3163
3232
|
const disabled = useMemo(() => {
|
|
@@ -3197,17 +3266,18 @@ function RlsFieldClock({ children, disabled: disabledProps, formControl, identif
|
|
|
3197
3266
|
setModalIsVisible(true);
|
|
3198
3267
|
}
|
|
3199
3268
|
}, [timeValue, formControl, valueInitial, onChange]);
|
|
3200
|
-
const
|
|
3201
|
-
if (
|
|
3202
|
-
onChange(
|
|
3269
|
+
const onCloseModal = useCallback((time) => {
|
|
3270
|
+
if (time) {
|
|
3271
|
+
onChange(time);
|
|
3203
3272
|
}
|
|
3204
3273
|
formControl?.touch();
|
|
3205
3274
|
setModalIsVisible(false);
|
|
3206
3275
|
}, [formControl, onChange]);
|
|
3207
|
-
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(
|
|
3276
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-clock", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-clock__control", type: "text", value: status.valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalClock, { visible: modalIsVisible, time: time, disabled: disabled, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3208
3277
|
}
|
|
3278
|
+
const RlsFieldClock = memo(RlsFieldClockComponent);
|
|
3209
3279
|
|
|
3210
|
-
function
|
|
3280
|
+
function RlsPickerColorComponent({ color, formControl, onListener, rlsTheme }) {
|
|
3211
3281
|
const initialColor = useMemo(() => formControl?.value ?? color ?? DEFAULT_COLOR, []);
|
|
3212
3282
|
const initialHsv = useMemo(() => hexToHsv(initialColor) ?? { h: 258, s: 100, v: 100 }, []);
|
|
3213
3283
|
const canvasRef = useRef(null);
|
|
@@ -3417,8 +3487,9 @@ function RlsPickerColor({ color, formControl, onListener, rlsTheme }) {
|
|
|
3417
3487
|
top: indicatorPosition.top
|
|
3418
3488
|
}, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__indicator__circle", style: { backgroundColor: hexColor } }) }) }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__controls", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider", children: jsxRuntimeExports.jsx("div", { ref: hueRef, className: "rls-picker-color__slider__track", style: hueSliderStyle, "data-slider": "hue", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider__thumb", style: hueIndicatorStyle }) }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider", children: jsxRuntimeExports.jsx("div", { ref: alphaRef, className: "rls-picker-color__slider__track rls-picker-color__slider__track--alpha", style: alphaSliderStyle, "data-slider": "alpha", onMouseDown: onMouseDown, onMouseMove: onMouseMove, onMouseUp: onInactiveSelection, onMouseLeave: onInactiveSelection, onTouchStart: onTouchStart, onTouchMove: onTouchMove, onTouchEnd: onInactiveSelection, children: jsxRuntimeExports.jsx("div", { className: "rls-picker-color__slider__thumb", style: alphaIndicatorStyle }) }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__hex", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__hex__swatch", style: { backgroundColor: hexColor } }), jsxRuntimeExports.jsx("span", { className: "rls-picker-color__hex__prefix", children: "#" }), jsxRuntimeExports.jsx("input", { className: "rls-picker-color__hex__input", type: "text", maxLength: 6, value: hexValue, onChange: onHexInputChange, onFocus: onHexFocus, onBlur: onHexBlur, onKeyDown: onHexKeyDown })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-picker-color__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-color__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.colorActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-color__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.colorActionSelect }) })] })] }));
|
|
3419
3489
|
}
|
|
3490
|
+
const RlsPickerColor = memo(RlsPickerColorComponent);
|
|
3420
3491
|
|
|
3421
|
-
function
|
|
3492
|
+
function RlsFieldColorComponent({ children, color, disabled: disabledProps, formControl, identifier, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3422
3493
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3423
3494
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
3424
3495
|
const colorValue = useMemo(() => {
|
|
@@ -3465,12 +3536,13 @@ function RlsFieldColor({ children, color, disabled: disabledProps, formControl,
|
|
|
3465
3536
|
}, [formControl, onChange]);
|
|
3466
3537
|
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-color", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [displayHex && (jsxRuntimeExports.jsx("div", { className: "rls-field-color__swatch", style: { backgroundColor: displayHex } })), jsxRuntimeExports.jsx("input", { className: "rls-field-color__control", type: "text", value: displayHex, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: colorValue ? 'trash-2' : 'color-palette', onClick: onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModal, { className: "rls-field-color-modal", visible: modalIsVisible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerColor, { formControl: formControl, color: color, disabled: disabled, onListener: onListener }) })] }));
|
|
3467
3538
|
}
|
|
3539
|
+
const RlsFieldColor = memo(RlsFieldColorComponent);
|
|
3468
3540
|
|
|
3469
3541
|
const DATE_FORMAT = '{dd}/{mx}/{yy}';
|
|
3470
3542
|
const DATE_FORMAT_TITLE = '{dw}, {mx} {dd} de {yy}';
|
|
3471
3543
|
const DATE_RANGE_FORMAT = '{dd}/{mx}/{yy}';
|
|
3472
3544
|
|
|
3473
|
-
function
|
|
3545
|
+
function RlsPickerDateComponent({ automatic, date, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
3474
3546
|
const today = useRef(new Date()); // Initial current date in component
|
|
3475
3547
|
const _date = useMemo(() => {
|
|
3476
3548
|
return formControl?.value ?? date ?? today.current;
|
|
@@ -3549,8 +3621,18 @@ function RlsPickerDate({ automatic, date, disabled, formControl, maxDate, minDat
|
|
|
3549
3621
|
}, [formControl, value, onListener]);
|
|
3550
3622
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__header", children: [jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: 'month', onClick: onVisibilityTitle }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__title", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDay, { formControl: dayControl, date: value, month: monthControl.value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, date: value, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, date: value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), !automatic && (jsxRuntimeExports.jsx("div", { className: "rls-picker-date__footer", children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--today", children: jsxRuntimeExports.jsx(RlsButtonAction, { icon: "calendar", onClick: onToday, disabled: itIsDisabledToday }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.dateActionSelect }) })] }) }))] }));
|
|
3551
3623
|
}
|
|
3624
|
+
const RlsPickerDate = memo(RlsPickerDateComponent);
|
|
3625
|
+
|
|
3626
|
+
function RlsModalDateComponent({ automatic, controller, date, disabled, formControl, maxDate, minDate, onClose, rlsTheme, visible }) {
|
|
3627
|
+
const onListener = useCallback(({ event, value }) => {
|
|
3628
|
+
onClose?.(event !== PickerListenerEvent.Cancel ? value : undefined);
|
|
3629
|
+
controller?.close();
|
|
3630
|
+
}, [onClose, controller]);
|
|
3631
|
+
return (jsxRuntimeExports.jsx(RlsModal, { className: "rls-modal-date", controller: controller, visible: visible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerDate, { automatic: automatic, formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: onListener }) }));
|
|
3632
|
+
}
|
|
3633
|
+
const RlsModalDate = memo(RlsModalDateComponent);
|
|
3552
3634
|
|
|
3553
|
-
function
|
|
3635
|
+
function RlsFieldDateComponent({ children, date, disabled: disabledProps, formControl, format, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3554
3636
|
const today = useRef(new Date()); // Initial current date in component
|
|
3555
3637
|
const [value, setValue] = useState(formControl?.value ?? valueInitial);
|
|
3556
3638
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
@@ -3602,15 +3684,16 @@ function RlsFieldDate({ children, date, disabled: disabledProps, formControl, fo
|
|
|
3602
3684
|
setModalIsVisible(true);
|
|
3603
3685
|
}
|
|
3604
3686
|
}, [dateValue, formControl, valueInitial, onChange]);
|
|
3605
|
-
const
|
|
3606
|
-
if (
|
|
3607
|
-
onChange(
|
|
3687
|
+
const onCloseModal = useCallback((date) => {
|
|
3688
|
+
if (date) {
|
|
3689
|
+
onChange(date);
|
|
3608
3690
|
}
|
|
3609
3691
|
formControl?.touch();
|
|
3610
3692
|
setModalIsVisible(false);
|
|
3611
3693
|
}, [formControl, onChange]);
|
|
3612
|
-
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(
|
|
3694
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date__control", type: "text", value: status.label, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalDate, { visible: modalIsVisible, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3613
3695
|
}
|
|
3696
|
+
const RlsFieldDate = memo(RlsFieldDateComponent);
|
|
3614
3697
|
|
|
3615
3698
|
function rangeFormatTemplate({ maxDate, minDate }) {
|
|
3616
3699
|
const minFormat = dateFormatTemplate(minDate, DATE_RANGE_FORMAT);
|
|
@@ -3618,7 +3701,7 @@ function rangeFormatTemplate({ maxDate, minDate }) {
|
|
|
3618
3701
|
return `${minFormat} - ${maxFormat}`;
|
|
3619
3702
|
}
|
|
3620
3703
|
|
|
3621
|
-
function
|
|
3704
|
+
function RlsPickerDateRangeComponent({ automatic, date: datePicker, disabled, formControl, maxDate, minDate, onListener, rlsTheme }) {
|
|
3622
3705
|
const _date = useMemo(() => normalizeMinTime(datePicker ?? new Date()), [datePicker]);
|
|
3623
3706
|
const _range = useMemo(() => formControl?.value ?? DateRange.now(), [formControl?.value]);
|
|
3624
3707
|
const yearControl = useReactControl(_date.getFullYear());
|
|
@@ -3684,8 +3767,18 @@ function RlsPickerDateRange({ automatic, date: datePicker, disabled, formControl
|
|
|
3684
3767
|
}, [formControl, value, onListener]);
|
|
3685
3768
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__header", children: [jsxRuntimeExports.jsx(RlsPickerSelectorTitle, { monthControl: monthControl, yearControl: yearControl, date: date, maxDate: maxDate, minDate: minDate, disabled: visibility === 'YEAR', type: visibility === 'MONTH' ? 'year' : 'month', onClick: onVisibilityTitle }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__title", children: jsxRuntimeExports.jsx("span", { onClick: onVisibilityDay, children: title }) })] }), jsxRuntimeExports.jsxs("div", { className: classNameComponent, children: [jsxRuntimeExports.jsx(RlsPickerDayRange, { formControl: rangeControl, date: date, maxDate: maxDate, minDate: minDate, disabled: disabled }), jsxRuntimeExports.jsx(RlsPickerMonth, { formControl: monthControl, year: yearControl.value, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay }), jsxRuntimeExports.jsx(RlsPickerYear, { formControl: yearControl, maxDate: maxDate, minDate: minDate, disabled: disabled, onValue: onVisibilityDay })] }), jsxRuntimeExports.jsx("div", { className: classNameFooter, children: jsxRuntimeExports.jsxs("div", { className: "rls-picker-date-range__actions", children: [jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--cancel", children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", onClick: onCancel, children: labels.dateActionCancel }) }), jsxRuntimeExports.jsx("div", { className: "rls-picker-date-range__actions--ok", children: jsxRuntimeExports.jsx(RlsButton, { type: "gradient", onClick: onSelect, children: labels.dateActionSelect }) })] }) })] }));
|
|
3686
3769
|
}
|
|
3770
|
+
const RlsPickerDateRange = memo(RlsPickerDateRangeComponent);
|
|
3687
3771
|
|
|
3688
|
-
function
|
|
3772
|
+
function RlsModalDateRangeComponent({ automatic, controller, date, disabled, formControl, maxDate, minDate, onClose, rlsTheme, visible }) {
|
|
3773
|
+
const onListener = useCallback(({ event, value }) => {
|
|
3774
|
+
onClose?.(event !== PickerListenerEvent.Cancel ? value : undefined);
|
|
3775
|
+
controller?.close();
|
|
3776
|
+
}, [onClose, controller]);
|
|
3777
|
+
return (jsxRuntimeExports.jsx(RlsModal, { className: "rls-modal-date-range", controller: controller, visible: visible, rlsTheme: rlsTheme, children: jsxRuntimeExports.jsx(RlsPickerDateRange, { automatic: automatic, formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: onListener }) }));
|
|
3778
|
+
}
|
|
3779
|
+
const RlsModalDateRange = memo(RlsModalDateRangeComponent);
|
|
3780
|
+
|
|
3781
|
+
function RlsFieldDateRangeComponent({ children, date, disabled: disabledProps, formControl, identifier, maxDate, minDate, msgErrorDisabled, onValue, placeholder, readOnly, rlsTheme, value: valueInitial }) {
|
|
3689
3782
|
const currentDate = useMemo(() => date ?? new Date(), [date]);
|
|
3690
3783
|
const [value, setValue] = useState(formControl?.value || valueInitial);
|
|
3691
3784
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
@@ -3726,15 +3819,16 @@ function RlsFieldDateRange({ children, date, disabled: disabledProps, formContro
|
|
|
3726
3819
|
setModalIsVisible(true);
|
|
3727
3820
|
}
|
|
3728
3821
|
}, [dateRangeValue, formControl, valueInitial, onChange]);
|
|
3729
|
-
const
|
|
3730
|
-
if (
|
|
3731
|
-
onChange(
|
|
3822
|
+
const onCloseModal = useCallback((dateRange) => {
|
|
3823
|
+
if (dateRange) {
|
|
3824
|
+
onChange(dateRange);
|
|
3732
3825
|
}
|
|
3733
3826
|
formControl?.touch();
|
|
3734
3827
|
setModalIsVisible(false);
|
|
3735
3828
|
}, [formControl, onChange]);
|
|
3736
|
-
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(
|
|
3829
|
+
return (jsxRuntimeExports.jsxs("div", { id: identifier, className: "rls-field-date-range", "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { className: "rls-field-date-range__control", type: "text", value: status.valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), !readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: status.icon, onClick: onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), jsxRuntimeExports.jsx(RlsModalDateRange, { visible: modalIsVisible, date: currentDate, disabled: disabled, maxDate: maxDate, minDate: minDate, onClose: onCloseModal, rlsTheme: rlsTheme })] }));
|
|
3737
3830
|
}
|
|
3831
|
+
const RlsFieldDateRange = memo(RlsFieldDateRangeComponent);
|
|
3738
3832
|
|
|
3739
3833
|
const MAX_LIST_HEIGHT_REM = 90;
|
|
3740
3834
|
const FALLBACK_REM_SIZE = 16;
|
|
@@ -3786,26 +3880,25 @@ function useFieldList(props) {
|
|
|
3786
3880
|
useEffect(() => {
|
|
3787
3881
|
const formValue = formControl?.value;
|
|
3788
3882
|
if (formValue !== undefined && formValue !== null && formValue.length) {
|
|
3789
|
-
|
|
3790
|
-
setSelected(selectedElements);
|
|
3883
|
+
setSelected(suggestions.filter((state) => formValue.some((value) => state.compareTo(value))));
|
|
3791
3884
|
}
|
|
3792
3885
|
else {
|
|
3793
3886
|
setSelected([]);
|
|
3794
3887
|
}
|
|
3795
3888
|
}, [formControl?.value, suggestions]);
|
|
3796
|
-
const setListState = useCallback((
|
|
3889
|
+
const setListState = useCallback((controllerState) => {
|
|
3797
3890
|
setState((state) => {
|
|
3798
|
-
const
|
|
3891
|
+
const newState = controllerState.listIsVisible !== undefined
|
|
3799
3892
|
? {
|
|
3800
|
-
...
|
|
3801
|
-
...(
|
|
3893
|
+
...controllerState,
|
|
3894
|
+
...(controllerState.listIsVisible
|
|
3802
3895
|
? {
|
|
3803
3896
|
higher: shouldDisplayHigher(refContent.current, refList.current)
|
|
3804
3897
|
}
|
|
3805
3898
|
: {})
|
|
3806
3899
|
}
|
|
3807
|
-
:
|
|
3808
|
-
return { ...state, ...
|
|
3900
|
+
: controllerState;
|
|
3901
|
+
return { ...state, ...newState };
|
|
3809
3902
|
});
|
|
3810
3903
|
}, []);
|
|
3811
3904
|
const toggleElement = useCallback((element) => {
|
|
@@ -3892,15 +3985,17 @@ function RlsFieldListInner({ render, suggestions, action, children, formControl,
|
|
|
3892
3985
|
const renderWithCheckbox = useCallback((element) => (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__multi__element", children: [jsxRuntimeExports.jsx(RlsCheckBox, { checked: fieldList.isSelected(element) }), render(element)] })), [fieldList.isSelected, render]);
|
|
3893
3986
|
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: fieldList.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("div", { className: "rls-field-list__multi__chips", onClick: disabled ? undefined : fieldList.onClickInput, children: !fieldList.selected.length && placeholder ? (jsxRuntimeExports.jsx("span", { className: "rls-field-list__multi__placeholder", children: placeholder })) : (fieldList.selected.map((item, index) => (jsxRuntimeExports.jsxs("div", { className: "rls-field-list__multi__chip", children: [jsxRuntimeExports.jsx("span", { className: "rls-field-list__multi__chip__description", children: item.description }), !props.readOnly && (jsxRuntimeExports.jsx("button", { className: "rls-field-list__multi__chip__remove", onClick: fieldList.onRemoveElement(item), disabled: disabled, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) }))] }, index)))) }), !props.readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: "arrow-ios-down", onClick: fieldList.onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: suggestions, visible: fieldList.listIsVisible, action: action, disabled: disabled, higher: fieldList.higher, render: renderWithCheckbox, refList: fieldList.refList, onClickElement: fieldList.onClickElement, onKeydownElement: fieldList.onKeydownElement, onClickBackdrop: fieldList.onClickBackdrop })] }));
|
|
3894
3987
|
}
|
|
3895
|
-
function
|
|
3988
|
+
function RlsFieldListTemplateComponent(props) {
|
|
3896
3989
|
const fieldList = useFieldList(props);
|
|
3897
3990
|
return jsxRuntimeExports.jsx(RlsFieldListInner, { ...props, fieldList: fieldList });
|
|
3898
3991
|
}
|
|
3899
|
-
|
|
3992
|
+
const RlsFieldListTemplate = memo(RlsFieldListTemplateComponent);
|
|
3993
|
+
function RlsFieldListComponent(props) {
|
|
3900
3994
|
const fieldList = useFieldList(props);
|
|
3901
3995
|
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { className: "rls-field-list__ballot", subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
3902
3996
|
return jsxRuntimeExports.jsx(RlsFieldListInner, { ...props, render: render, fieldList: fieldList });
|
|
3903
3997
|
}
|
|
3998
|
+
const RlsFieldList = memo(RlsFieldListComponent);
|
|
3904
3999
|
|
|
3905
4000
|
function useFieldSelect(props) {
|
|
3906
4001
|
const controller = useListController(props);
|
|
@@ -4010,7 +4105,7 @@ function useFieldSelect(props) {
|
|
|
4010
4105
|
};
|
|
4011
4106
|
}
|
|
4012
4107
|
|
|
4013
|
-
function
|
|
4108
|
+
function RlsFieldSelectTemplateComponent(props) {
|
|
4014
4109
|
const select = useFieldSelect(props);
|
|
4015
4110
|
const { render, suggestions, action, children, formControl, msgErrorDisabled, placeholder, rlsTheme, unremovable } = props;
|
|
4016
4111
|
const disabled = useMemo(() => {
|
|
@@ -4032,17 +4127,20 @@ function RlsFieldSelectTemplate(props) {
|
|
|
4032
4127
|
]);
|
|
4033
4128
|
return (jsxRuntimeExports.jsxs("div", { id: props.identifier, ref: select.refContent, className: className, "rls-theme": rlsTheme, children: [children && jsxRuntimeExports.jsx("span", { className: "rls-field-box__label", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-field-box__component", children: jsxRuntimeExports.jsxs("div", { className: "rls-field-box__body", children: [jsxRuntimeExports.jsx("input", { ref: select.refInput, className: "rls-field-list__control", readOnly: true, placeholder: placeholder, value: select.value, onFocus: select.onFocusInput, onBlur: select.onBlurInput, onClick: select.onClickInput, onKeyDown: select.onKeydownInput, disabled: disabled }), !props.readOnly && (jsxRuntimeExports.jsx(RlsButtonIcon, { icon: !unremovable && !!select.value ? 'close' : 'arrow-ios-down', onClick: select.onClickAction, disabled: disabled }))] }) }), !msgErrorDisabled && (jsxRuntimeExports.jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), jsxRuntimeExports.jsx(RlsFieldListSuggestions, { elements: suggestions, visible: select.listIsVisible, action: action, disabled: disabled, higher: select.higher, render: render, refList: select.refList, onClickElement: select.onClickElement, onKeydownElement: select.onKeydownElement, onClickBackdrop: select.onClickBackdrop })] }));
|
|
4034
4129
|
}
|
|
4035
|
-
|
|
4130
|
+
const RlsFieldSelectTemplate = memo(RlsFieldSelectTemplateComponent);
|
|
4131
|
+
function RlsFieldSelectComponent(props) {
|
|
4036
4132
|
const render = useCallback((element) => (jsxRuntimeExports.jsx(RlsBallot, { className: "rls-field-list__ballot", subtitle: element.subtitle, img: element.img, initials: element.initials, children: jsxRuntimeExports.jsx("span", { children: element.title }) })), []);
|
|
4037
4133
|
return jsxRuntimeExports.jsx(RlsFieldSelectTemplate, { ...props, render: render });
|
|
4038
4134
|
}
|
|
4135
|
+
const RlsFieldSelect = memo(RlsFieldSelectComponent);
|
|
4039
4136
|
|
|
4040
|
-
function
|
|
4137
|
+
function RlsFormNavigationComponent({ children, className, controller, visible, rlsTheme }) {
|
|
4041
4138
|
const classNameForm = useMemo(() => {
|
|
4042
4139
|
return renderClassStatus('rls-form-navigation', { visible: controller?.visible ?? visible }, className);
|
|
4043
4140
|
}, [className, visible, controller?.visible]);
|
|
4044
4141
|
return ReactDOM.createPortal(jsxRuntimeExports.jsx("div", { className: classNameForm, "rls-theme": rlsTheme, children: jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__component", children: children }) }), document.body);
|
|
4045
4142
|
}
|
|
4143
|
+
const RlsFormNavigation = memo(RlsFormNavigationComponent);
|
|
4046
4144
|
|
|
4047
4145
|
function useRelocationOnComponent({ container, element, onDrag }) {
|
|
4048
4146
|
const position = useRef({ x: 0, y: 0 });
|
|
@@ -4136,20 +4234,19 @@ function useRelocationOnComponent({ container, element, onDrag }) {
|
|
|
4136
4234
|
}, []);
|
|
4137
4235
|
}
|
|
4138
4236
|
|
|
4139
|
-
function useResize(
|
|
4140
|
-
const { refElement, onResize } = props;
|
|
4237
|
+
function useResize({ refElement, onResize }) {
|
|
4141
4238
|
const dimension = useRef({ height: 0, width: 0 });
|
|
4239
|
+
const onResizeRef = useRef(onResize);
|
|
4240
|
+
onResizeRef.current = onResize;
|
|
4142
4241
|
const observer = useCallback((entries) => {
|
|
4143
4242
|
const { height, width } = entries[0].contentRect;
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
});
|
|
4152
|
-
}
|
|
4243
|
+
onResizeRef.current?.({
|
|
4244
|
+
current: dimension.current,
|
|
4245
|
+
dimension: {
|
|
4246
|
+
height,
|
|
4247
|
+
width
|
|
4248
|
+
}
|
|
4249
|
+
});
|
|
4153
4250
|
dimension.current = { height, width };
|
|
4154
4251
|
}, []);
|
|
4155
4252
|
useEffect(() => {
|
|
@@ -4197,7 +4294,7 @@ function calculateImgDimension(image, dimension) {
|
|
|
4197
4294
|
height = simpleThreeRule(image.width, width, height);
|
|
4198
4295
|
return { height, width };
|
|
4199
4296
|
}
|
|
4200
|
-
function
|
|
4297
|
+
function RlsImageEditorComponent(props) {
|
|
4201
4298
|
const [selection, setSelection] = useState(props.selection ?? 60);
|
|
4202
4299
|
const [labels, setLabels] = useState({
|
|
4203
4300
|
actionRestore: reactI18n('editorImageActionRestore'),
|
|
@@ -4395,10 +4492,12 @@ function RlsImageEditor(props) {
|
|
|
4395
4492
|
}, []);
|
|
4396
4493
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-image-editor", children: [jsxRuntimeExports.jsx("div", { ref: refBody, className: "rls-image-editor__body", children: jsxRuntimeExports.jsxs("div", { ref: refImage, className: "rls-image-editor__body__image", children: [jsxRuntimeExports.jsx("div", { ref: refSelection, className: "rls-image-editor__body__selection" }), jsxRuntimeExports.jsx("div", { ref: refOverlayTop, className: "rls-image-editor__body__overlay--top" }), jsxRuntimeExports.jsx("div", { ref: refOverlayRight, className: "rls-image-editor__body__overlay--right" }), jsxRuntimeExports.jsx("div", { ref: refOverlayBottom, className: "rls-image-editor__body__overlay--bottom" }), jsxRuntimeExports.jsx("div", { ref: refOverlayLeft, className: "rls-image-editor__body__overlay--left" }), jsxRuntimeExports.jsx("canvas", { ref: refCanvas })] }) }), jsxRuntimeExports.jsxs("div", { className: "rls-image-editor__footer", children: [jsxRuntimeExports.jsx("div", { className: "rls-image-editor__sliders", children: jsxRuntimeExports.jsx(RlsSlider, { prefixIcon: "external-link", value: selection, minValue: MIN_SLIDER_VALUE, maxValue: MAX_SLIDER_VALUE, onValue: setSelection, disabled: props.disabled }) }), jsxRuntimeExports.jsxs("div", { className: "rls-image-editor__actions", children: [props.children, jsxRuntimeExports.jsx(RlsButton, { type: "flat", rlsTheme: "standard", prefixIcon: "refresh", onClick: onRestore, disabled: props.disabled, children: labels.actionRestore }), jsxRuntimeExports.jsx(RlsButton, { type: "raised", rlsTheme: "primary", prefixIcon: "crop", onClick: onCropImage, disabled: props.disabled, children: labels.actionSelect })] })] }), jsxRuntimeExports.jsx("canvas", { ref: refPicture })] }));
|
|
4397
4494
|
}
|
|
4495
|
+
const RlsImageEditor = memo(RlsImageEditorComponent);
|
|
4398
4496
|
|
|
4399
|
-
function
|
|
4497
|
+
function RlsImageEditorModalComponent(props) {
|
|
4400
4498
|
return (jsxRuntimeExports.jsx(RlsModal, { className: "rls-image-editor-modal", visible: props.visible, children: jsxRuntimeExports.jsx(RlsImageEditor, { ...props, children: props.children }) }));
|
|
4401
4499
|
}
|
|
4500
|
+
const RlsImageEditorModal = memo(RlsImageEditorModalComponent);
|
|
4402
4501
|
|
|
4403
4502
|
const MIME_TYPE_SUPPORTS = [
|
|
4404
4503
|
'image/png',
|
|
@@ -4469,7 +4568,7 @@ function useImageEditorController(options) {
|
|
|
4469
4568
|
return { onImageChooser, RlsImageEditorChooser };
|
|
4470
4569
|
}
|
|
4471
4570
|
|
|
4472
|
-
function
|
|
4571
|
+
function RlsImageChooserComponent(props) {
|
|
4473
4572
|
const [src, setSrc] = useState();
|
|
4474
4573
|
const onValue = useCallback((image) => {
|
|
4475
4574
|
setSrc(image.base64);
|
|
@@ -4483,8 +4582,9 @@ function RlsImageChooser(props) {
|
|
|
4483
4582
|
}, [props.src]);
|
|
4484
4583
|
return (jsxRuntimeExports.jsxs("div", { className: "rls-image-chooser", children: [jsxRuntimeExports.jsx("div", { className: "rls-image-chooser__avatar", onClick: controller.onImageChooser, children: src && jsxRuntimeExports.jsx("img", { src: src }) }), controller.RlsImageEditorChooser] }));
|
|
4485
4584
|
}
|
|
4585
|
+
const RlsImageChooser = memo(RlsImageChooserComponent);
|
|
4486
4586
|
|
|
4487
|
-
function
|
|
4587
|
+
function RlsModalSheetComponent({ autoclose, children, className, controller, onAutoClose, visible, rlsTheme }) {
|
|
4488
4588
|
const classNameModal = useMemo(() => {
|
|
4489
4589
|
return renderClassStatus('rls-modal-sheet', { visible: controller?.visible ?? visible }, className);
|
|
4490
4590
|
}, [className, visible, controller?.visible]);
|
|
@@ -4496,6 +4596,7 @@ function RlsModalSheet({ autoclose, children, className, controller, onAutoClose
|
|
|
4496
4596
|
}, [autoclose, controller, onAutoClose]);
|
|
4497
4597
|
return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameModal, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-modal-sheet__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-modal-sheet__backdrop", onClick: onClickBackdrop })] }), document.body);
|
|
4498
4598
|
}
|
|
4599
|
+
const RlsModalSheet = memo(RlsModalSheetComponent);
|
|
4499
4600
|
|
|
4500
4601
|
const DURATION_ANIMATION$1 = 240;
|
|
4501
4602
|
const DURATION_DEFAULT = 4000;
|
|
@@ -4566,12 +4667,13 @@ function calculateDuration({ length }) {
|
|
|
4566
4667
|
}
|
|
4567
4668
|
return duration + DURATION_RESET;
|
|
4568
4669
|
}
|
|
4569
|
-
function
|
|
4670
|
+
function RlsSnackbarComponent({ content, onClose, icon, rlsTheme, title, visible }) {
|
|
4570
4671
|
const className = useMemo(() => {
|
|
4571
4672
|
return renderClassStatus('rls-snackbar', { visible });
|
|
4572
4673
|
}, [visible]);
|
|
4573
4674
|
return (jsxRuntimeExports.jsxs("div", { className: className, "rls-theme": rlsTheme, children: [icon && (jsxRuntimeExports.jsx("div", { className: "rls-snackbar__avatar", children: jsxRuntimeExports.jsx(RlsIcon, { value: icon }) })), jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__component", children: [jsxRuntimeExports.jsxs("div", { className: "rls-snackbar__header", children: [jsxRuntimeExports.jsx("div", { className: "rls-snackbar__title", children: title }), jsxRuntimeExports.jsx("button", { onClick: onClose, children: jsxRuntimeExports.jsx(RlsIcon, { value: "close" }) })] }), jsxRuntimeExports.jsx("div", { className: "rls-snackbar__content", children: content })] })] }));
|
|
4574
4675
|
}
|
|
4676
|
+
const RlsSnackbar = memo(RlsSnackbarComponent);
|
|
4575
4677
|
function useSnackbar() {
|
|
4576
4678
|
const timeoutId = useRef(undefined);
|
|
4577
4679
|
const duration = useRef(4000);
|
|
@@ -4638,14 +4740,15 @@ function RlsApplication({ children }) {
|
|
|
4638
4740
|
'navbar-condense': navbarIsCondense
|
|
4639
4741
|
});
|
|
4640
4742
|
}, [appIsMobile, navbarInApp, navbarIsCondense]);
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4743
|
+
const state = useMemo(() => ({
|
|
4744
|
+
confirmation,
|
|
4745
|
+
notify,
|
|
4746
|
+
setIsMobile,
|
|
4747
|
+
setNavbarInApp,
|
|
4748
|
+
setNavbarIsCondense,
|
|
4749
|
+
snackbar
|
|
4750
|
+
}), [confirmation, notify, snackbar]);
|
|
4751
|
+
return (jsxRuntimeExports.jsxs(RlsContext, { value: state, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsNotifications, RlsConfirmation] }));
|
|
4649
4752
|
}
|
|
4650
4753
|
|
|
4651
4754
|
const DEFAULT_DESIGN_SYSTEM = 'bordered';
|
|
@@ -4771,5 +4874,26 @@ function usePortalController() {
|
|
|
4771
4874
|
return { close, open, visible };
|
|
4772
4875
|
}
|
|
4773
4876
|
|
|
4774
|
-
|
|
4877
|
+
const APP_THEME_ATTRIBUTE = 'app-theme';
|
|
4878
|
+
function getAppTheme() {
|
|
4879
|
+
if (typeof document === 'undefined') {
|
|
4880
|
+
return 'light';
|
|
4881
|
+
}
|
|
4882
|
+
return document.body.getAttribute(APP_THEME_ATTRIBUTE) === 'dark'
|
|
4883
|
+
? 'dark'
|
|
4884
|
+
: 'light';
|
|
4885
|
+
}
|
|
4886
|
+
function setAppTheme(theme) {
|
|
4887
|
+
if (typeof document === 'undefined') {
|
|
4888
|
+
return;
|
|
4889
|
+
}
|
|
4890
|
+
document.body.setAttribute(APP_THEME_ATTRIBUTE, theme);
|
|
4891
|
+
}
|
|
4892
|
+
function toggleAppTheme() {
|
|
4893
|
+
const theme = getAppTheme() === 'dark' ? 'light' : 'dark';
|
|
4894
|
+
setAppTheme(theme);
|
|
4895
|
+
return theme;
|
|
4896
|
+
}
|
|
4897
|
+
|
|
4898
|
+
export { ConfirmationResult, DEFAULT_COLOR, RlsAccordion, RlsAlert, RlsAmount, RlsApplication, RlsAreaText, RlsAvatar, RlsBadge, RlsBallot, RlsBody, RlsBottomSheet, RlsBreadcrumb, RlsButton, RlsButtonAction, RlsButtonIcon, RlsButtonOption, RlsButtonProgress, RlsButtonStepper, RlsButtonToggle, RlsCard, RlsCheckBox, RlsCheckBoxControl, RlsConfirmation, RlsContent, RlsContext, RlsDatatable, RlsDatatableCell, RlsDatatableData, RlsDatatableFloating, RlsDatatableHeader, RlsDatatableRecord, RlsDatatableSubheader, RlsDatatableTitle, RlsDatatableTotals, RlsDropdown, RlsFieldArea, RlsFieldAutocomplete, RlsFieldAutocompleteTemplate, RlsFieldClock, RlsFieldColor, RlsFieldDate, RlsFieldDateRange, RlsFieldDecimal, RlsFieldFile, RlsFieldList, RlsFieldListSuggestions, RlsFieldListTemplate, RlsFieldMoney, RlsFieldNumber, RlsFieldPassword, RlsFieldPercentage, RlsFieldReadonly, RlsFieldSelect, RlsFieldSelectTemplate, RlsFieldText, RlsFormNavigation, RlsIcon, RlsImage, RlsImageChooser, RlsImageEditor, RlsInput, RlsInputCounter, RlsInputDecimal, RlsInputMoney, RlsInputNumber, RlsInputPassword, RlsInputPercentage, RlsInputSearch, RlsInputText, RlsLabel, RlsLabelCheckBox, RlsLabelRadioButton, RlsLabelSwitch, RlsLed, RlsMessageEmpty, RlsMessageFormError, RlsMessageIcon, RlsModal, RlsModalClock, RlsModalDate, RlsModalDateRange, RlsModalSheet, RlsNavbar, RlsNavbarMenu, RlsPagination, RlsPickerClock, RlsPickerColor, RlsPickerDate, RlsPickerDateRange, RlsPickerDay, RlsPickerDayRange, RlsPickerMonth, RlsPickerSelectorTitle, RlsPickerYear, RlsPoster, RlsProgressBar, RlsProgressCircular, RlsRadioButton, RlsSkeleton, RlsSkeletonText, RlsSlider, RlsSnackbar, RlsSpinner, RlsSwitch, RlsSwitchControl, RlsTabs, RlsTabularText, RlsToolbar, calculateImgDimension, generateThemePalette, getAppTheme, hexIsValid, hexToHsl, hexToHsv, hexToRgb, hslToHex, hsvToHex, hsvToRgb, normalizeHex, rangeFormatTemplate, renderClassStatus, rgbToHex, rgbToHsl, rgbToHsv, setAppTheme, setDesignSystem, setErrorsI18n, setThemeColor, toggleAppTheme, useConfirmation, useDatatable, useDesingSystemController, useDropdownController, useFieldAutocomplete, useFieldList, useFieldSelect, useFormSingleSelectionController, useFormToggleController, useImageEditorController, useListController, useNotifications, usePortalController, useRelocationOnComponent, useResize, useRlsContext, useSnackbar };
|
|
4775
4899
|
//# sourceMappingURL=index.mjs.map
|