@neko-os/ui 0.2.3 → 0.4.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/dist/DynamicStyleTag.js +18 -2
- package/dist/DynamicStyleTag.native.js +3 -1
- package/dist/NekoUI.js +39 -1
- package/dist/abstractions/ActivityIndicator.js +19 -1
- package/dist/abstractions/ActivityIndicator.native.js +43 -1
- package/dist/abstractions/ActivityIndicator.web.js +43 -1
- package/dist/abstractions/AnimatedView.js +3 -1
- package/dist/abstractions/AnimatedView.native.js +5 -1
- package/dist/abstractions/AnimatedView.web.js +3 -1
- package/dist/abstractions/BlurView.js +43 -1
- package/dist/abstractions/BlurView.native.js +39 -1
- package/dist/abstractions/BlurView.web.js +39 -1
- package/dist/abstractions/DraggableSlideView.js +3 -1
- package/dist/abstractions/DraggableSlideView.native.js +62 -1
- package/dist/abstractions/FlatList.js +3 -1
- package/dist/abstractions/FlatList.native.js +37 -1
- package/dist/abstractions/FlatList.web.js +3 -1
- package/dist/abstractions/GradientView.js +5 -1
- package/dist/abstractions/GradientView.native.js +32 -1
- package/dist/abstractions/HiddenInput.js +3 -1
- package/dist/abstractions/HiddenInput.native.js +3 -1
- package/dist/abstractions/Icon.js +10 -1
- package/dist/abstractions/Icon.native.js +13 -1
- package/dist/abstractions/Icon.web.js +11 -1
- package/dist/abstractions/Image.js +12 -1
- package/dist/abstractions/Image.native.js +7 -1
- package/dist/abstractions/Image.web.js +7 -1
- package/dist/abstractions/ImageBackground.js +17 -1
- package/dist/abstractions/ImageBackground.native.js +27 -1
- package/dist/abstractions/ImageBackground.web.js +7 -1
- package/dist/abstractions/KeyboardAvoidingView.js +3 -1
- package/dist/abstractions/KeyboardAvoidingView.native.js +3 -1
- package/dist/abstractions/Platform.js +1 -1
- package/dist/abstractions/Platform.native.js +3 -1
- package/dist/abstractions/Platform.web.js +3 -1
- package/dist/abstractions/Pressable.js +4 -1
- package/dist/abstractions/Pressable.native.js +3 -1
- package/dist/abstractions/Pressable.web.js +3 -1
- package/dist/abstractions/SafeAreaView.js +3 -1
- package/dist/abstractions/SafeAreaView.native.js +3 -1
- package/dist/abstractions/ScrollView.js +3 -1
- package/dist/abstractions/ScrollView.native.js +5 -1
- package/dist/abstractions/ScrollView.web.js +3 -1
- package/dist/abstractions/StaticList.js +51 -1
- package/dist/abstractions/Switch.js +97 -1
- package/dist/abstractions/Switch.native.js +12 -1
- package/dist/abstractions/Table.js +29 -1
- package/dist/abstractions/Table.native.js +19 -1
- package/dist/abstractions/Text.js +14 -1
- package/dist/abstractions/Text.native.js +3 -1
- package/dist/abstractions/Text.web.js +18 -1
- package/dist/abstractions/TextInput.js +12 -1
- package/dist/abstractions/TextInput.native.js +5 -1
- package/dist/abstractions/TextInput.web.js +5 -1
- package/dist/abstractions/TouchableOpacity.js +4 -1
- package/dist/abstractions/TouchableOpacity.native.js +9 -1
- package/dist/abstractions/View.js +3 -1
- package/dist/abstractions/View.native.js +3 -1
- package/dist/abstractions/View.web.js +3 -1
- package/dist/abstractions/helpers/componentSize.js +13 -1
- package/dist/abstractions/helpers/componentSize.native.js +12 -1
- package/dist/abstractions/helpers/storage.js +32 -1
- package/dist/abstractions/helpers/storage.native.js +34 -1
- package/dist/abstractions/helpers/transformStyle.js +8 -1
- package/dist/abstractions/helpers/transformStyle.native.js +3 -1
- package/dist/abstractions/helpers/useSafeAreaInsets.js +3 -1
- package/dist/abstractions/helpers/useSafeAreaInsets.native.js +3 -1
- package/dist/abstractions/helpers/windowWidth.js +13 -1
- package/dist/abstractions/helpers/windowWidth.native.js +6 -1
- package/dist/abstractions/helpers/windowWidth.web.js +6 -1
- package/dist/components/actions/ActionsDrawer.js +81 -1
- package/dist/components/actions/Breadcrumb.js +47 -1
- package/dist/components/actions/Button.js +82 -1
- package/dist/components/actions/Dropdown.js +91 -1
- package/dist/components/actions/FloatingButton.js +87 -1
- package/dist/components/actions/FloatingMenu.js +39 -1
- package/dist/components/actions/Link.js +66 -1
- package/dist/components/actions/Pressable.js +38 -1
- package/dist/components/actions/index.js +9 -1
- package/dist/components/actions/menu/HorizontalMenu.js +98 -1
- package/dist/components/actions/menu/Menu.js +7 -1
- package/dist/components/actions/menu/SubmenuWrapper.js +16 -1
- package/dist/components/actions/menu/VerticalMenu.js +133 -1
- package/dist/components/animations/AnimatedTopBar.js +10 -1
- package/dist/components/animations/AnimatedTopBar.native.js +34 -1
- package/dist/components/animations/AnimatedTopBar.web.js +1 -1
- package/dist/components/animations/AnimatedView.js +45 -1
- package/dist/components/animations/DraggableSlideView.js +42 -1
- package/dist/components/animations/ParallaxHeader.js +9 -1
- package/dist/components/animations/ParallaxHeader.native.js +32 -1
- package/dist/components/animations/ParallaxHeader.web.js +32 -1
- package/dist/components/animations/ReanimatedScrollHandler.js +8 -1
- package/dist/components/animations/ReanimatedScrollHandler.native.js +24 -1
- package/dist/components/animations/ReanimatedScrollHandler.web.js +1 -1
- package/dist/components/animations/ReanimatedView.js +40 -1
- package/dist/components/animations/index.js +5 -1
- package/dist/components/calendar/CalendarNav.js +67 -1
- package/dist/components/calendar/WeekDaysBar.js +18 -1
- package/dist/components/calendar/_helpers/calendarDays.js +16 -1
- package/dist/components/calendar/_helpers/dateDisabled.js +24 -1
- package/dist/components/feedback/alerter.js +31 -1
- package/dist/components/feedback/confirmer.js +70 -1
- package/dist/components/feedback/index.js +3 -1
- package/dist/components/feedback/notifications/Notification.js +37 -1
- package/dist/components/feedback/notifications/NotificationsHandler.js +65 -1
- package/dist/components/filter/DateFilter.js +72 -0
- package/dist/components/filter/FilterGroup.js +17 -0
- package/dist/components/filter/FilterHandler.js +54 -0
- package/dist/components/filter/FilterItem.js +30 -0
- package/dist/components/filter/PopoverFilterItem.js +84 -0
- package/dist/components/filter/SearchInput.js +49 -0
- package/dist/components/filter/index.js +6 -0
- package/dist/components/form/Form.js +31 -1
- package/dist/components/form/FormGroup.js +21 -1
- package/dist/components/form/FormItem.js +118 -1
- package/dist/components/form/FormList.js +143 -1
- package/dist/components/form/FormWrapperComponent.js +52 -1
- package/dist/components/form/FormWrapperComponent.native.js +5 -1
- package/dist/components/form/SubmitButton.js +22 -1
- package/dist/components/form/index.js +9 -1
- package/dist/components/form/useNewForm.js +211 -1
- package/dist/components/form/useWatch.js +70 -1
- package/dist/components/form/validation/defaultMessages.js +20 -1
- package/dist/components/form/validation/index.js +5 -1
- package/dist/components/form/validation/normalizeRules.js +22 -1
- package/dist/components/form/validation/shouldValidateOn.js +21 -1
- package/dist/components/form/validation/validateRules.js +83 -1
- package/dist/components/form/validation/validators.js +82 -1
- package/dist/components/helpers/ConditionalLazyRender.js +6 -1
- package/dist/components/helpers/LazyAction.js +22 -1
- package/dist/components/helpers/LazyRender.js +55 -1
- package/dist/components/helpers/LazyRender.native.js +58 -1
- package/dist/components/helpers/Portal.js +21 -1
- package/dist/components/helpers/PortalHandler.js +32 -1
- package/dist/components/helpers/Responsive.js +18 -1
- package/dist/components/helpers/Separator.js +49 -1
- package/dist/components/helpers/VerticalView.js +34 -1
- package/dist/components/helpers/index.js +8 -1
- package/dist/components/index.js +20 -1
- package/dist/components/inputs/BooleanSelect.js +14 -0
- package/dist/components/inputs/Checkbox.js +56 -1
- package/dist/components/inputs/DateInput.js +123 -1
- package/dist/components/inputs/DateRangeInput.js +41 -0
- package/dist/components/inputs/Editable.js +129 -0
- package/dist/components/inputs/EnabledSelect.js +14 -0
- package/dist/components/inputs/InputWrapper.js +93 -1
- package/dist/components/inputs/LinkInput.js +17 -1
- package/dist/components/inputs/MaskInput.js +67 -1
- package/dist/components/inputs/NumberInput.js +111 -1
- package/dist/components/inputs/NumberRangeInput.js +41 -0
- package/dist/components/inputs/PasswordInput.js +24 -0
- package/dist/components/inputs/Picker.js +169 -1
- package/dist/components/inputs/Radio.js +55 -1
- package/dist/components/inputs/RateInput.js +62 -1
- package/dist/components/inputs/SegmentedPicker.js +62 -1
- package/dist/components/inputs/Select.js +219 -1
- package/dist/components/inputs/Switch.js +60 -1
- package/dist/components/inputs/TextArea.js +5 -0
- package/dist/components/inputs/TextInput.js +32 -1
- package/dist/components/inputs/UploadInput.js +140 -0
- package/dist/components/inputs/_DateInput.native.js +89 -1
- package/dist/components/inputs/datePicker/DatePicker.js +24 -1
- package/dist/components/inputs/datePicker/DayPicker.js +64 -1
- package/dist/components/inputs/datePicker/MonthPicker.js +62 -1
- package/dist/components/inputs/datePicker/QuarterPicker.js +65 -1
- package/dist/components/inputs/datePicker/WeekPicker.js +74 -1
- package/dist/components/inputs/datePicker/YearPicker.js +70 -1
- package/dist/components/inputs/index.js +23 -1
- package/dist/components/inputs/upload/Upload.js +99 -0
- package/dist/components/inputs/upload/Upload.native.js +154 -0
- package/dist/components/inputs/upload/useUploadState.js +143 -0
- package/dist/components/layout/Layout.js +40 -1
- package/dist/components/layout/LayoutContent.js +42 -1
- package/dist/components/layout/LayoutHeader.js +70 -1
- package/dist/components/layout/LayoutSider.js +64 -1
- package/dist/components/layout/index.js +4 -1
- package/dist/components/list/FlatList.js +91 -1
- package/dist/components/list/ScrollView.js +58 -1
- package/dist/components/list/index.js +2 -1
- package/dist/components/modals/bottomDrawer/index.js +3 -1
- package/dist/components/modals/bottomDrawer/index.native.js +5 -1
- package/dist/components/modals/bottomDrawer/index.web.js +5 -1
- package/dist/components/modals/bottomDrawer/native/BottomDrawer.js +239 -1
- package/dist/components/modals/bottomDrawer/native/DrawerContext.js +17 -1
- package/dist/components/modals/bottomDrawer/native/DrawerHandle.js +12 -1
- package/dist/components/modals/bottomDrawer/native/DrawerScrollView.js +5 -1
- package/dist/components/modals/bottomDrawer/native/createDrawerScrollComponent.js +139 -1
- package/dist/components/modals/bottomDrawer/native/utils.js +65 -1
- package/dist/components/modals/bottomDrawer/web/BottomDrawer.js +5 -1
- package/dist/components/modals/drawer/Drawer.js +5 -1
- package/dist/components/modals/drawer/Drawer.native.js +3 -1
- package/dist/components/modals/drawer/Drawer.web.js +3 -1
- package/dist/components/modals/drawer/index.js +1 -1
- package/dist/components/modals/index.js +4 -1
- package/dist/components/modals/modal/Modal.js +84 -1
- package/dist/components/modals/modal/Modal.native.js +83 -1
- package/dist/components/modals/modal/ModalBackdrop.js +58 -1
- package/dist/components/modals/modal/ModalContent.js +28 -1
- package/dist/components/modals/modal/ModalFooter.js +31 -1
- package/dist/components/modals/modal/ModalHeader.js +50 -1
- package/dist/components/modals/modal/handler/ModalsHandler.js +61 -1
- package/dist/components/modals/modal/index.js +6 -1
- package/dist/components/modals/router/ModalRoute.js +15 -1
- package/dist/components/modals/router/ModalsRouter.js +120 -1
- package/dist/components/modals/router/ModalsRouterContext.js +16 -1
- package/dist/components/modals/router/index.js +6 -1
- package/dist/components/modals/router/useAllModalsParams.js +6 -1
- package/dist/components/modals/router/useModalParams.js +6 -1
- package/dist/components/modals/router/useModalsNavigation.js +6 -1
- package/dist/components/modals/router/useUpdateModalContainer.js +6 -1
- package/dist/components/presentation/Avatar.js +79 -1
- package/dist/components/presentation/AvatarLabel.js +60 -1
- package/dist/components/presentation/AvatarsGroup.js +30 -0
- package/dist/components/presentation/Badge.js +91 -1
- package/dist/components/presentation/ContentLabel.js +43 -1
- package/dist/components/presentation/Icon.js +20 -1
- package/dist/components/presentation/IconLabel.js +40 -1
- package/dist/components/presentation/Image.js +33 -1
- package/dist/components/presentation/ImageBackground.js +38 -1
- package/dist/components/presentation/LabelValue.js +51 -1
- package/dist/components/presentation/Progress.js +20 -0
- package/dist/components/presentation/Rate.js +58 -1
- package/dist/components/presentation/RateTag.js +35 -1
- package/dist/components/presentation/Result.js +60 -1
- package/dist/components/presentation/ResultBar.js +56 -1
- package/dist/components/presentation/Tag.js +69 -1
- package/dist/components/presentation/Tooltip.js +44 -1
- package/dist/components/presentation/index.js +16 -1
- package/dist/components/sections/Section.js +50 -1
- package/dist/components/sections/SectionItem.js +24 -1
- package/dist/components/sections/SectionItemDropdown.js +68 -1
- package/dist/components/sections/SectionItemLink.js +35 -1
- package/dist/components/sections/index.js +4 -1
- package/dist/components/state/Loading.js +20 -1
- package/dist/components/state/LoadingView.js +37 -1
- package/dist/components/state/StatePresenter.js +41 -1
- package/dist/components/state/index.js +3 -1
- package/dist/components/steps/ActiveStepContent.js +16 -0
- package/dist/components/steps/StepsHandler.js +53 -0
- package/dist/components/steps/StepsMenu.js +14 -0
- package/dist/components/steps/StepsNavigation.js +37 -0
- package/dist/components/steps/index.js +4 -0
- package/dist/components/structure/Accordion.js +69 -1
- package/dist/components/structure/AccordionGroup.js +35 -1
- package/dist/components/structure/Affix.js +34 -0
- package/dist/components/structure/Affix.native.js +3 -0
- package/dist/components/structure/BlurView.js +59 -1
- package/dist/components/structure/Card.js +46 -1
- package/dist/components/structure/Col.js +22 -1
- package/dist/components/structure/GradientView.js +42 -1
- package/dist/components/structure/KeyboardAvoidingView.js +52 -1
- package/dist/components/structure/Row.js +50 -1
- package/dist/components/structure/SafeAreaView.js +42 -1
- package/dist/components/structure/Segment.js +51 -1
- package/dist/components/structure/TopBar.js +57 -1
- package/dist/components/structure/View.js +44 -1
- package/dist/components/structure/index.js +14 -1
- package/dist/components/structure/overlay/OverlayHandler.js +83 -1
- package/dist/components/structure/overlay/OverlayHandler.native.js +6 -1
- package/dist/components/structure/overlay/OverlayWrapper.js +52 -1
- package/dist/components/structure/overlay/calculatePosition.js +29 -1
- package/dist/components/structure/overlay/smartPlacement.js +32 -1
- package/dist/components/structure/popover/Popover.js +135 -1
- package/dist/components/structure/popover/Popover.native.js +105 -1
- package/dist/components/structure/popover/PopoverContent.js +18 -1
- package/dist/components/structure/popover/Popover_BU.js +157 -1
- package/dist/components/table/DataTable.js +62 -1
- package/dist/components/table/Pagination.js +128 -1
- package/dist/components/table/Table.js +66 -1
- package/dist/components/table/TableCol.js +67 -1
- package/dist/components/table/TableHeader.js +69 -1
- package/dist/components/table/TableHeaderRow.js +31 -1
- package/dist/components/table/TableRow.js +30 -1
- package/dist/components/table/index.js +7 -1
- package/dist/components/tabs/ActiveTabContent.js +38 -1
- package/dist/components/tabs/TabsHandler.js +16 -1
- package/dist/components/tabs/TabsMenu.js +15 -1
- package/dist/components/tabs/index.js +3 -1
- package/dist/components/text/DateText.js +24 -1
- package/dist/components/text/Text.js +32 -1
- package/dist/components/text/VerticalText.js +29 -1
- package/dist/components/text/index.js +3 -1
- package/dist/components/theme/ThemePicker.js +48 -1
- package/dist/components/theme/ThemePickerDrawer.js +12 -1
- package/dist/components/theme/ThemeStatusBar.js +3 -1
- package/dist/components/theme/ThemeStatusBar.native.js +9 -1
- package/dist/components/theme/ThemeThumb.js +98 -1
- package/dist/components/theme/index.js +3 -1
- package/dist/helpers/debounce.js +9 -1
- package/dist/helpers/index.js +5 -1
- package/dist/helpers/options.js +65 -1
- package/dist/helpers/random.js +5 -1
- package/dist/helpers/storage.js +76 -1
- package/dist/helpers/string.js +74 -1
- package/dist/i18n/I18n.js +96 -1
- package/dist/i18n/I18nProvider.js +40 -1
- package/dist/i18n/index.js +2 -1
- package/dist/index.js +8 -1
- package/dist/modifiers/_helpers.js +6 -1
- package/dist/modifiers/alignConverter.js +11 -1
- package/dist/modifiers/animation.js +18 -1
- package/dist/modifiers/animations/animatedEffects.js +64 -1
- package/dist/modifiers/animations/animatedEffects.native.js +55 -1
- package/dist/modifiers/animations/animatedEffects.web.js +55 -1
- package/dist/modifiers/animations/fadeEffect.js +46 -1
- package/dist/modifiers/animations/fadeEffect.native.js +33 -1
- package/dist/modifiers/animations/fadeEffect.web.js +3 -1
- package/dist/modifiers/animations/scaleEffect.js +46 -1
- package/dist/modifiers/animations/scaleEffect.native.js +33 -1
- package/dist/modifiers/animations/scrollEffect.web.js +3 -1
- package/dist/modifiers/animations/slideEffect.js +64 -1
- package/dist/modifiers/animations/slideEffect.native.js +53 -1
- package/dist/modifiers/animations/slideEffect.web.js +3 -1
- package/dist/modifiers/applyStyles.js +7 -1
- package/dist/modifiers/background.js +34 -1
- package/dist/modifiers/border.js +86 -1
- package/dist/modifiers/colorConverter.js +13 -1
- package/dist/modifiers/cursor.js +21 -1
- package/dist/modifiers/default.js +9 -1
- package/dist/modifiers/display.js +22 -1
- package/dist/modifiers/flex.js +20 -1
- package/dist/modifiers/flexWrapper.js +87 -1
- package/dist/modifiers/fullColor.js +32 -1
- package/dist/modifiers/grid.js +27 -1
- package/dist/modifiers/hover.js +28 -1
- package/dist/modifiers/logger.js +6 -1
- package/dist/modifiers/margin.js +25 -1
- package/dist/modifiers/overflow.js +28 -1
- package/dist/modifiers/padding.js +25 -1
- package/dist/modifiers/position.js +57 -1
- package/dist/modifiers/responsiveConverter.js +19 -1
- package/dist/modifiers/shadow.js +35 -1
- package/dist/modifiers/size.js +59 -1
- package/dist/modifiers/sizeConverter.js +12 -1
- package/dist/modifiers/state.js +33 -1
- package/dist/modifiers/text.js +62 -1
- package/dist/modifiers/textConverter.js +12 -1
- package/dist/modifiers/themeComponent.js +11 -1
- package/dist/responsive/ResponsiveHandler.js +28 -1
- package/dist/responsive/index.js +2 -1
- package/dist/responsive/responsiveHooks.js +67 -1
- package/dist/theme/ThemeHandler.js +81 -1
- package/dist/theme/default/base.js +95 -1
- package/dist/theme/default/blackTheme.js +47 -1
- package/dist/theme/default/cyberpunkTheme.js +36 -1
- package/dist/theme/default/darkTheme.js +35 -1
- package/dist/theme/default/hackerTheme.js +55 -1
- package/dist/theme/default/lightTheme.js +35 -1
- package/dist/theme/default/paperTheme.js +36 -1
- package/dist/theme/default/themes.js +15 -1
- package/dist/theme/format/colorsVariations.js +31 -1
- package/dist/theme/format/formatTheme.js +28 -1
- package/dist/theme/helpers/colorScale.js +12 -1
- package/dist/theme/helpers/contrastColor.js +18 -1
- package/dist/theme/helpers/dynamicColor.js +32 -1
- package/dist/theme/helpers/mergePreset.js +7 -1
- package/dist/theme/helpers/relatedScales.js +34 -1
- package/dist/theme/helpers/sizeScale.js +20 -1
- package/dist/theme/helpers/textScale.js +15 -1
- package/dist/theme/index.js +2 -1
- package/package.json +1 -3
- package/src/abstractions/Icon.js +1 -1
- package/src/abstractions/TextInput.js +10 -1
- package/src/abstractions/TouchableOpacity.native.js +8 -2
- package/src/components/actions/ActionsDrawer.js +1 -1
- package/src/components/actions/Button.js +3 -1
- package/src/components/actions/FloatingMenu.js +1 -1
- package/src/components/actions/menu/HorizontalMenu.js +2 -1
- package/src/components/actions/menu/VerticalMenu.js +2 -1
- package/src/components/filter/DateFilter.js +72 -0
- package/src/components/filter/FilterGroup.js +17 -0
- package/src/components/filter/FilterHandler.js +54 -0
- package/src/components/filter/FilterItem.js +30 -0
- package/src/components/filter/PopoverFilterItem.js +84 -0
- package/src/components/filter/SearchInput.js +49 -0
- package/src/components/filter/index.js +6 -0
- package/src/components/form/Form.js +9 -3
- package/src/components/form/FormItem.js +26 -1
- package/src/components/form/FormWrapperComponent.js +12 -3
- package/src/components/form/useNewForm.js +55 -4
- package/src/components/helpers/Separator.js +15 -11
- package/src/components/helpers/index.js +1 -0
- package/src/components/index.js +2 -0
- package/src/components/inputs/BooleanSelect.js +14 -0
- package/src/components/inputs/DateInput.js +3 -1
- package/src/components/inputs/DateRangeInput.js +41 -0
- package/src/components/inputs/Editable.js +129 -0
- package/src/components/inputs/EnabledSelect.js +14 -0
- package/src/components/inputs/InputWrapper.js +7 -4
- package/src/components/inputs/LinkInput.js +1 -1
- package/src/components/inputs/NumberInput.js +10 -5
- package/src/components/inputs/NumberRangeInput.js +41 -0
- package/src/components/inputs/PasswordInput.js +24 -0
- package/src/components/inputs/Picker.js +3 -3
- package/src/components/inputs/Select.js +61 -47
- package/src/components/inputs/TextArea.js +5 -0
- package/src/components/inputs/TextInput.js +14 -4
- package/src/components/inputs/UploadInput.js +140 -0
- package/src/components/inputs/index.js +9 -0
- package/src/components/inputs/upload/Upload.js +99 -0
- package/src/components/inputs/upload/Upload.native.js +154 -0
- package/src/components/inputs/upload/useUploadState.js +143 -0
- package/src/components/layout/LayoutHeader.js +1 -0
- package/src/components/presentation/AvatarLabel.js +1 -1
- package/src/components/presentation/AvatarsGroup.js +30 -0
- package/src/components/presentation/Badge.js +3 -2
- package/src/components/presentation/ContentLabel.js +1 -1
- package/src/components/presentation/IconLabel.js +1 -0
- package/src/components/presentation/Progress.js +20 -0
- package/src/components/presentation/index.js +2 -0
- package/src/components/sections/Section.js +1 -1
- package/src/components/sections/SectionItemLink.js +4 -2
- package/src/components/steps/ActiveStepContent.js +16 -0
- package/src/components/steps/StepsHandler.js +53 -0
- package/src/components/steps/StepsMenu.js +14 -0
- package/src/components/steps/StepsNavigation.js +37 -0
- package/src/components/steps/index.js +4 -0
- package/src/components/structure/Affix.js +34 -0
- package/src/components/structure/Affix.native.js +3 -0
- package/src/components/structure/Card.js +1 -0
- package/src/components/structure/TopBar.js +13 -1
- package/src/components/structure/index.js +1 -0
- package/src/components/structure/overlay/OverlayHandler.js +9 -1
- package/src/components/structure/popover/Popover.js +22 -5
- package/src/components/table/DataTable.js +7 -2
- package/src/components/table/Table.js +2 -1
- package/src/components/tabs/ActiveTabContent.js +4 -1
- package/src/components/text/DateText.js +15 -2
- package/src/modifiers/border.js +15 -9
- package/src/modifiers/size.js +8 -5
- package/src/theme/default/base.js +2 -0
- package/src/theme/default/hackerTheme.js +1 -10
- package/src/theme/default/paperTheme.js +1 -14
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/DateRangeInput.js";var _excluded = ["value", "onChange", "startProps", "endProps", "placeholderStart", "placeholderEnd", "separator"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { DateInput } from "./DateInput";
|
|
2
|
+
import { Text } from "../text/Text";
|
|
3
|
+
import { View } from "../structure/View";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
export function DateRangeInput(_ref)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
{var value = _ref.value,onChange = _ref.onChange,startProps = _ref.startProps,endProps = _ref.endProps,_ref$placeholderStart = _ref.placeholderStart,placeholderStart = _ref$placeholderStart === void 0 ? 'Start' : _ref$placeholderStart,_ref$placeholderEnd = _ref.placeholderEnd,placeholderEnd = _ref$placeholderEnd === void 0 ? 'End' : _ref$placeholderEnd,_ref$separator = _ref.separator,separator = _ref$separator === void 0 ? '–' : _ref$separator,props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
var handleChangeStart = function handleChangeStart(start) {return onChange == null ? void 0 : onChange(Object.assign({}, value, { start: start }));};
|
|
16
|
+
var handleChangeEnd = function handleChangeEnd(end) {return onChange == null ? void 0 : onChange(Object.assign({}, value, { end: end }));};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
_jsxs(View, { row: true, centerV: true, gap: "sm", children: [
|
|
20
|
+
_jsx(DateInput, Object.assign({
|
|
21
|
+
placeholder: placeholderStart,
|
|
22
|
+
value: value == null ? void 0 : value.start,
|
|
23
|
+
onChange: handleChangeStart,
|
|
24
|
+
max: value == null ? void 0 : value.end,
|
|
25
|
+
flex: true },
|
|
26
|
+
props,
|
|
27
|
+
startProps)
|
|
28
|
+
),
|
|
29
|
+
_jsx(Text, { text4: true, children: separator }),
|
|
30
|
+
_jsx(DateInput, Object.assign({
|
|
31
|
+
placeholder: placeholderEnd,
|
|
32
|
+
value: value == null ? void 0 : value.end,
|
|
33
|
+
onChange: handleChangeEnd,
|
|
34
|
+
min: value == null ? void 0 : value.start,
|
|
35
|
+
flex: true },
|
|
36
|
+
props,
|
|
37
|
+
endProps)
|
|
38
|
+
)] }
|
|
39
|
+
));
|
|
40
|
+
|
|
41
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/Editable.js";var _excluded = ["Input", "renderInput", "onChange", "onClose", "onSubmit", "submitOnChange", "submitWhenHasNoValue", "disableCloseOnBlur", "alwaysEditing"],_excluded2 = ["value", "defaultValue"],_excluded3 = ["children", "hidden", "disabled", "visibleIcon", "emptyLabel", "emptyIcon", "loading"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { isEmpty } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { Icon } from "../presentation/Icon";
|
|
5
|
+
import { IconLabel } from "../presentation/IconLabel";
|
|
6
|
+
import { Loading } from "../state/Loading";
|
|
7
|
+
import { Text } from "../text/Text";
|
|
8
|
+
import { TextInput } from "./TextInput";
|
|
9
|
+
import { View } from "../structure/View";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
function getInputValue(e) {var _e$target;
|
|
12
|
+
return (e == null ? void 0 : (_e$target = e.target) == null ? void 0 : _e$target.value) !== undefined ? e.target.value : e;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function hasValue(v) {
|
|
16
|
+
return v !== undefined && v !== null && !isEmpty(v);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function EditableInput(_ref)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
{var Input = _ref.Input,renderInput = _ref.renderInput,onChange = _ref.onChange,onClose = _ref.onClose,onSubmit = _ref.onSubmit,submitOnChange = _ref.submitOnChange,submitWhenHasNoValue = _ref.submitWhenHasNoValue,disableCloseOnBlur = _ref.disableCloseOnBlur,alwaysEditing = _ref.alwaysEditing,props = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
var initialValue = props.value || props.defaultValue;
|
|
32
|
+
var _React$useState = React.useState(initialValue),_React$useState2 = _slicedToArray(_React$useState, 2),value = _React$useState2[0],setValue = _React$useState2[1];
|
|
33
|
+
Input = Input || TextInput;
|
|
34
|
+
|
|
35
|
+
var submit = function submit(val) {
|
|
36
|
+
var inputHasValue = hasValue(val);
|
|
37
|
+
var shouldSubmit = submitWhenHasNoValue || inputHasValue;
|
|
38
|
+
var hasChangedTheValue = val !== initialValue;
|
|
39
|
+
if (shouldSubmit && hasChangedTheValue) {
|
|
40
|
+
onSubmit && onSubmit(val);
|
|
41
|
+
}
|
|
42
|
+
onClose();
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var handleSubmit = function handleSubmit(e) {return submit(getInputValue(e));};
|
|
46
|
+
|
|
47
|
+
var handleChange = function handleChange(e) {
|
|
48
|
+
var inputValue = getInputValue(e);
|
|
49
|
+
setValue(inputValue);
|
|
50
|
+
onChange && onChange(inputValue);
|
|
51
|
+
if (submitOnChange) submit(inputValue);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var _ = props.value,__ = props.defaultValue,inputProps = _objectWithoutProperties(props, _excluded2);
|
|
55
|
+
|
|
56
|
+
if (!!renderInput) {
|
|
57
|
+
return renderInput(Object.assign({ handleSubmit: handleSubmit, handleChange: handleChange, value: value }, inputProps));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
_jsx(Input, Object.assign({
|
|
62
|
+
startsOpen: true,
|
|
63
|
+
sm: true,
|
|
64
|
+
value: value,
|
|
65
|
+
onChange: handleChange,
|
|
66
|
+
onKeyDown: function onKeyDown(e) {
|
|
67
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
handleSubmit(e);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
onBlur: !disableCloseOnBlur && !alwaysEditing ? function () {return submit(value);} : undefined,
|
|
73
|
+
onOpenChange: function onOpenChange(open) {return !open && !alwaysEditing && submit(value);},
|
|
74
|
+
onOk: function onOk() {return submit(value);} },
|
|
75
|
+
inputProps)
|
|
76
|
+
));
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function Editable(_ref2) {var children = _ref2.children,hidden = _ref2.hidden,disabled = _ref2.disabled,visibleIcon = _ref2.visibleIcon,emptyLabel = _ref2.emptyLabel,emptyIcon = _ref2.emptyIcon,loading = _ref2.loading,props = _objectWithoutProperties(_ref2, _excluded3);
|
|
81
|
+
var _React$useState3 = React.useState(false),_React$useState4 = _slicedToArray(_React$useState3, 2),isEditing = _React$useState4[0],setIsEditing = _React$useState4[1];
|
|
82
|
+
var _React$useState5 = React.useState(false),_React$useState6 = _slicedToArray(_React$useState5, 2),hovered = _React$useState6[0],setHovered = _React$useState6[1];
|
|
83
|
+
|
|
84
|
+
if (!!props.alwaysEditing || isEditing) {
|
|
85
|
+
return (
|
|
86
|
+
_jsx(EditableInput, Object.assign({
|
|
87
|
+
disabled: disabled,
|
|
88
|
+
autoFocus: !props.alwaysEditing,
|
|
89
|
+
onClose: function onClose() {return setIsEditing(false);} },
|
|
90
|
+
props)
|
|
91
|
+
));
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (disabled) return children;
|
|
96
|
+
if (loading) return _jsx(Loading, {});
|
|
97
|
+
|
|
98
|
+
var hasAnyValue = hasValue(props.value || props.defaultValue);
|
|
99
|
+
var showEmptyLabel = emptyLabel && !hasAnyValue;
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
_jsxs(View, {
|
|
103
|
+
row: true,
|
|
104
|
+
centerV: true,
|
|
105
|
+
gap: !hidden ? 1 : 0,
|
|
106
|
+
pointer: true,
|
|
107
|
+
border: !hidden ? 1 : 0,
|
|
108
|
+
borderStyle: "dashed",
|
|
109
|
+
borderColor: hovered && !hidden ? 'divider' : 'transparent',
|
|
110
|
+
br: !hidden ? 'xxs' : undefined,
|
|
111
|
+
onClick: function onClick() {
|
|
112
|
+
setIsEditing(true);
|
|
113
|
+
setHovered(false);
|
|
114
|
+
},
|
|
115
|
+
onMouseEnter: function onMouseEnter() {return setHovered(true);},
|
|
116
|
+
onMouseLeave: function onMouseLeave() {return setHovered(false);}, children: [
|
|
117
|
+
|
|
118
|
+
_jsxs(View, { flex: true, minHeight: 17, maxWidth: "100%", children: [
|
|
119
|
+
hovered && !hasAnyValue && props.placeholder && _jsx(Text, { color: "text4", children: props.placeholder }),
|
|
120
|
+
showEmptyLabel ? _jsx(IconLabel, { icon: emptyIcon, label: emptyLabel, color: "text4" }) : children] }
|
|
121
|
+
),
|
|
122
|
+
!hidden && (visibleIcon || hovered) &&
|
|
123
|
+
_jsx(View, { children:
|
|
124
|
+
_jsx(Icon, { name: "RiEditLine", text4: true }) }
|
|
125
|
+
)] }
|
|
126
|
+
|
|
127
|
+
));
|
|
128
|
+
|
|
129
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/EnabledSelect.js";var _excluded = ["enabledLabel", "disabledLabel", "placeholder"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { Select } from "./Select";import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
export function EnabledSelect(_ref) {var _ref$enabledLabel = _ref.enabledLabel,enabledLabel = _ref$enabledLabel === void 0 ? 'Enabled' : _ref$enabledLabel,_ref$disabledLabel = _ref.disabledLabel,disabledLabel = _ref$disabledLabel === void 0 ? 'Disabled' : _ref$disabledLabel,placeholder = _ref.placeholder,props = _objectWithoutProperties(_ref, _excluded);
|
|
4
|
+
return (
|
|
5
|
+
_jsx(Select, Object.assign({
|
|
6
|
+
placeholder: placeholder,
|
|
7
|
+
options: [
|
|
8
|
+
{ label: enabledLabel, value: false },
|
|
9
|
+
{ label: disabledLabel, value: true }] },
|
|
10
|
+
|
|
11
|
+
props)
|
|
12
|
+
));
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -1 +1,93 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/InputWrapper.js";var _excluded = ["prefix", "suffix", "prefixIcon", "prefixIconColor", "suffixIcon", "suffixIconColor", "loading", "error", "multiline", "children", "ref"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { pipe, is } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { Icon } from "../presentation/Icon";
|
|
5
|
+
import { Loading } from "../state/Loading";
|
|
6
|
+
import { Text } from "../text/Text";
|
|
7
|
+
import { View } from "../structure/View";
|
|
8
|
+
import { useDefaultModifier } from "../../modifiers/default";
|
|
9
|
+
import { useSizeConverter } from "../../modifiers/sizeConverter";
|
|
10
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
|
|
12
|
+
var DEFAULT_PROPS = {
|
|
13
|
+
paddingH: 'sm',
|
|
14
|
+
bg: 'overlayBG',
|
|
15
|
+
border: true,
|
|
16
|
+
br: 'md',
|
|
17
|
+
row: true,
|
|
18
|
+
gap: 'sm'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function InputWrapper(_ref)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
{var prefix = _ref.prefix,suffix = _ref.suffix,prefixIcon = _ref.prefixIcon,prefixIconColor = _ref.prefixIconColor,suffixIcon = _ref.suffixIcon,suffixIconColor = _ref.suffixIconColor,loading = _ref.loading,error = _ref.error,multiline = _ref.multiline,children = _ref.children,ref = _ref.ref,rootProps = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
var _React$useState = React.useState(false),_React$useState2 = _slicedToArray(_React$useState, 2),hover = _React$useState2[0],setHover = _React$useState2[1];
|
|
36
|
+
var fallbackInputRef = React.useRef();
|
|
37
|
+
var inputRef = ref || fallbackInputRef;
|
|
38
|
+
var _pipe = pipe(
|
|
39
|
+
useSizeConverter('elementHeights', 'md'),
|
|
40
|
+
useThemeComponentModifier('InputWrapper'),
|
|
41
|
+
useDefaultModifier(DEFAULT_PROPS)
|
|
42
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_pipe2$ = _pipe2[0],size = _pipe2$.size,sizeCode = _pipe2$.sizeCode,props = _pipe2[1];
|
|
43
|
+
|
|
44
|
+
var handlePress = function handlePress() {var _inputRef$current;
|
|
45
|
+
inputRef == null ? void 0 : (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus == null ? void 0 : _inputRef$current.focus();
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
if (!!prefix && is(String, prefix)) prefix = _jsx(Text, { children: prefix });
|
|
49
|
+
if (!!suffix && is(String, suffix)) suffix = _jsx(Text, { children: suffix });
|
|
50
|
+
if (!prefix && !!prefixIcon) prefix = _jsx(Icon, { name: prefixIcon, size: sizeCode, color: prefixIconColor });
|
|
51
|
+
if (!suffix && !!suffixIcon) suffix = _jsx(Icon, { name: suffixIcon, size: sizeCode, color: suffixIconColor });
|
|
52
|
+
if (!prefix && !!error) suffix = _jsx(Icon, { name: "alert-fill", size: sizeCode, red: true });
|
|
53
|
+
if (!!loading) suffix = _jsx(Loading, { size: sizeCode });
|
|
54
|
+
|
|
55
|
+
var borderColor = !!hover ? 'primary_op40' : 'divider';
|
|
56
|
+
if (!!error) borderColor = 'red_op40';
|
|
57
|
+
|
|
58
|
+
var child = React.Children.only(children);
|
|
59
|
+
var childWithProps = React.cloneElement(child, Object.assign({},
|
|
60
|
+
child.props, {
|
|
61
|
+
ref: inputRef })
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
_jsxs(View, Object.assign({
|
|
66
|
+
className: "neko-input-wrapper",
|
|
67
|
+
height: multiline ? undefined : size,
|
|
68
|
+
minHeight: multiline ? size : undefined,
|
|
69
|
+
paddingV: multiline ? 'sm' : undefined,
|
|
70
|
+
onPress: handlePress,
|
|
71
|
+
borderColor: borderColor,
|
|
72
|
+
onMouseEnter: function onMouseEnter() {return setHover(true);},
|
|
73
|
+
onMouseLeave: function onMouseLeave() {return setHover(false);} },
|
|
74
|
+
props, { children: [
|
|
75
|
+
|
|
76
|
+
!!prefix &&
|
|
77
|
+
_jsx(View, { paddingV: 5, fullHeight: !multiline, center: !multiline, children:
|
|
78
|
+
prefix }
|
|
79
|
+
),
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
_jsx(View, { flex: true, fullH: !multiline, children:
|
|
83
|
+
childWithProps }
|
|
84
|
+
),
|
|
85
|
+
|
|
86
|
+
!!suffix &&
|
|
87
|
+
_jsx(View, { paddingV: 5, fullHeight: !multiline, center: !multiline, children:
|
|
88
|
+
suffix }
|
|
89
|
+
)] })
|
|
90
|
+
|
|
91
|
+
));
|
|
92
|
+
|
|
93
|
+
}
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/LinkInput.js";var _excluded = ["ref", "onPress", "onClick", "placeholder", "value", "disabled"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { InputWrapper } from "./InputWrapper";
|
|
2
|
+
import { Link } from "../actions/Link";
|
|
3
|
+
import { Text } from "../text/Text";
|
|
4
|
+
import { View } from "../structure/View";
|
|
5
|
+
import { useColors } from "../../theme/ThemeHandler";import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
export function LinkInput(_ref) {var ref = _ref.ref,onPress = _ref.onPress,onClick = _ref.onClick,placeholder = _ref.placeholder,value = _ref.value,disabled = _ref.disabled,props = _objectWithoutProperties(_ref, _excluded);
|
|
8
|
+
return (
|
|
9
|
+
_jsx(Link, { ref: ref, onPress: !props.loading ? onPress || onClick : undefined, fullW: true, centerV: true, disabled: disabled, children:
|
|
10
|
+
_jsx(InputWrapper, Object.assign({}, props, { children:
|
|
11
|
+
_jsx(View, { centerV: true, flex: true, fullW: true, children:
|
|
12
|
+
_jsx(Text, { color: !!value ? 'text' : 'text_op30', label: value || placeholder, numberOfLines: 1 }) }
|
|
13
|
+
) })
|
|
14
|
+
) }
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
}
|
|
@@ -1 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/MaskInput.js";var _excluded = ["value", "onChange", "mask", "useRawValue"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { TextInput } from "./TextInput";import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
function removeMask(value) {var mask = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
6
|
+
var result = '';
|
|
7
|
+
|
|
8
|
+
for (var i = 0; i < mask.length; i++) {
|
|
9
|
+
var maskChar = mask[i];
|
|
10
|
+
var valueChar = value[i];
|
|
11
|
+
|
|
12
|
+
if (!valueChar) break;
|
|
13
|
+
|
|
14
|
+
if (maskChar === 'A' && /[A-Za-z]/.test(valueChar)) {
|
|
15
|
+
result += valueChar;
|
|
16
|
+
} else if (maskChar === '9' && /\d/.test(valueChar)) {
|
|
17
|
+
result += valueChar;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function applyMask(value, mask) {
|
|
25
|
+
var clean = value.replace(/[^0-9A-Za-z]/g, '');
|
|
26
|
+
var result = '';
|
|
27
|
+
var index = 0;
|
|
28
|
+
|
|
29
|
+
for (var i = 0; i < mask.length; i++) {
|
|
30
|
+
if (index >= clean.length) break;
|
|
31
|
+
var char = mask[i];
|
|
32
|
+
|
|
33
|
+
if (char === '9' && /[0-9]/.test(clean[index])) {
|
|
34
|
+
result += clean[index];
|
|
35
|
+
index++;
|
|
36
|
+
} else if (char === 'A' && /[A-Za-z]/.test(clean[index])) {
|
|
37
|
+
result += clean[index].toUpperCase();
|
|
38
|
+
index++;
|
|
39
|
+
} else if (char === '9' || char === 'A') {
|
|
40
|
+
index++;
|
|
41
|
+
i--;
|
|
42
|
+
} else {
|
|
43
|
+
result += char;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function MaskInput(_ref) {var _ref$value = _ref.value,value = _ref$value === void 0 ? '' : _ref$value,onChange = _ref.onChange,_ref$mask = _ref.mask,mask = _ref$mask === void 0 ? '' : _ref$mask,useRawValue = _ref.useRawValue,props = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
var _React$useState = React.useState(applyMask(value, mask)),_React$useState2 = _slicedToArray(_React$useState, 2),localValue = _React$useState2[0],setLocalValue = _React$useState2[1];
|
|
52
|
+
|
|
53
|
+
var handleChange = React.useCallback(
|
|
54
|
+
function (text) {
|
|
55
|
+
var masked = applyMask(text, mask);
|
|
56
|
+
onChange == null ? void 0 : onChange(useRawValue ? removeMask(masked, mask) : masked);
|
|
57
|
+
setLocalValue(masked);
|
|
58
|
+
},
|
|
59
|
+
[mask, onChange]
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
React.useEffect(function () {
|
|
63
|
+
setLocalValue(applyMask(value, mask));
|
|
64
|
+
}, [value]);
|
|
65
|
+
|
|
66
|
+
return _jsx(TextInput, Object.assign({ value: localValue, onChange: handleChange }, props));
|
|
67
|
+
}
|
|
@@ -1 +1,111 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/NumberInput.js";var _excluded = ["onChange", "onBlur", "value", "defaultValue", "useInt", "precision", "min", "max", "error"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { endsWith, is } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { TextInput } from "./TextInput";import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
function isValidNumber(stringValue) {var _stringValue$toString;var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7
|
+
var _options$min = options.min,min = _options$min === void 0 ? Number.MIN_SAFE_INTEGER : _options$min,_options$max = options.max,max = _options$max === void 0 ? Number.MAX_SAFE_INTEGER : _options$max,useInt = options.useInt,precision = options.precision;
|
|
8
|
+
|
|
9
|
+
if (stringValue === null || stringValue === undefined || stringValue === '') return true;
|
|
10
|
+
|
|
11
|
+
if (isNaN(stringValue)) return false;
|
|
12
|
+
var numericValue = parseFloat(stringValue);
|
|
13
|
+
|
|
14
|
+
if (numericValue < min) return false;
|
|
15
|
+
if (numericValue > max) return false;
|
|
16
|
+
|
|
17
|
+
var decimalPart = stringValue == null ? void 0 : (_stringValue$toString = stringValue.toString()) == null ? void 0 : _stringValue$toString.split == null ? void 0 : _stringValue$toString.split('.')[1];
|
|
18
|
+
|
|
19
|
+
if (decimalPart && is(Number, precision)) {
|
|
20
|
+
if (decimalPart.length > precision) return false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function formatNumericValue(newValue, prevValue) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
27
|
+
var _options$min2 = options.min,min = _options$min2 === void 0 ? Number.MIN_SAFE_INTEGER : _options$min2,_options$max2 = options.max,max = _options$max2 === void 0 ? Number.MAX_SAFE_INTEGER : _options$max2,useInt = options.useInt,precision = options.precision;
|
|
28
|
+
var numericValue = newValue;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if (is(Number, newValue)) newValue = newValue.toString();
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
if (newValue === null || newValue === undefined || newValue === '') return null;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if (is(String, newValue)) newValue = newValue.replace(',', '.');
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
if (newValue === '-') return newValue;
|
|
41
|
+
|
|
42
|
+
if (useInt) {
|
|
43
|
+
|
|
44
|
+
if (newValue.includes('.')) return prevValue;
|
|
45
|
+
numericValue = parseInt(newValue, 10);
|
|
46
|
+
} else {
|
|
47
|
+
|
|
48
|
+
var dotsCount = newValue.split('.').length;
|
|
49
|
+
if (dotsCount > 2) return prevValue;
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
if (endsWith('.', newValue)) return newValue;
|
|
53
|
+
|
|
54
|
+
numericValue = parseFloat(newValue);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (isNaN(numericValue)) return prevValue;
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if (numericValue < min) return min;
|
|
61
|
+
if (numericValue > max) return max;
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
var decimalPart = newValue.split('.')[1];
|
|
65
|
+
if (decimalPart && !!precision) {
|
|
66
|
+
|
|
67
|
+
if (decimalPart.length > precision) return prevValue;
|
|
68
|
+
|
|
69
|
+
return newValue;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
return numericValue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function NumberInput(_ref) {var _onChange = _ref.onChange,_onBlur = _ref.onBlur,value = _ref.value,defaultValue = _ref.defaultValue,useInt = _ref.useInt,precision = _ref.precision,min = _ref.min,max = _ref.max,error = _ref.error,props = _objectWithoutProperties(_ref, _excluded);
|
|
77
|
+
if (value === undefined || value === null) value = defaultValue != null ? defaultValue : null;
|
|
78
|
+
var _React$useState = React.useState(false),_React$useState2 = _slicedToArray(_React$useState, 2),hasError = _React$useState2[0],setHasError = _React$useState2[1];
|
|
79
|
+
var _React$useState3 = React.useState(value),_React$useState4 = _slicedToArray(_React$useState3, 2),inputValue = _React$useState4[0],setInputValue = _React$useState4[1];
|
|
80
|
+
var _React$useState5 = React.useState(value),_React$useState6 = _slicedToArray(_React$useState5, 2),localValue = _React$useState6[0],setLocalValue = _React$useState6[1];
|
|
81
|
+
React.useEffect(function () {var _value;return setInputValue(((_value = value) == null ? void 0 : _value.toString()) || '');}, [value]);
|
|
82
|
+
|
|
83
|
+
if (useInt) precision = 0;
|
|
84
|
+
if (!useInt && precision === 0) useInt = true;
|
|
85
|
+
var opts = { useInt: useInt, precision: precision };
|
|
86
|
+
var optsWithMinMax = Object.assign({}, opts, { min: min, max: max });
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
_jsx(TextInput, Object.assign({},
|
|
90
|
+
props, {
|
|
91
|
+
onChange: function onChange(newValue) {
|
|
92
|
+
var numericValue = formatNumericValue(newValue, localValue, opts);
|
|
93
|
+
setInputValue((newValue == null ? void 0 : newValue.toString()) || '');
|
|
94
|
+
setLocalValue(numericValue);
|
|
95
|
+
_onChange == null ? void 0 : _onChange(numericValue);
|
|
96
|
+
setHasError(!isValidNumber(newValue, optsWithMinMax));
|
|
97
|
+
},
|
|
98
|
+
onBlur: function onBlur(e) {
|
|
99
|
+
var clamped = formatNumericValue(localValue, localValue, optsWithMinMax);
|
|
100
|
+
setLocalValue(clamped);
|
|
101
|
+
setInputValue((clamped == null ? void 0 : clamped.toString()) || '');
|
|
102
|
+
setHasError(!isValidNumber(clamped, optsWithMinMax));
|
|
103
|
+
_onChange == null ? void 0 : _onChange(clamped);
|
|
104
|
+
_onBlur == null ? void 0 : _onBlur(e);
|
|
105
|
+
},
|
|
106
|
+
value: inputValue,
|
|
107
|
+
keyboardType: useInt ? 'number-pad' : 'decimal-pad',
|
|
108
|
+
error: error || hasError })
|
|
109
|
+
));
|
|
110
|
+
|
|
111
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/NumberRangeInput.js";var _excluded = ["value", "onChange", "minProps", "maxProps", "placeholderMin", "placeholderMax", "separator"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { NumberInput } from "./NumberInput";
|
|
2
|
+
import { Text } from "../text/Text";
|
|
3
|
+
import { View } from "../structure/View";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
export function NumberRangeInput(_ref)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
{var value = _ref.value,onChange = _ref.onChange,minProps = _ref.minProps,maxProps = _ref.maxProps,_ref$placeholderMin = _ref.placeholderMin,placeholderMin = _ref$placeholderMin === void 0 ? 'Min' : _ref$placeholderMin,_ref$placeholderMax = _ref.placeholderMax,placeholderMax = _ref$placeholderMax === void 0 ? 'Max' : _ref$placeholderMax,_ref$separator = _ref.separator,separator = _ref$separator === void 0 ? '–' : _ref$separator,props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
var handleChangeMin = function handleChangeMin(min) {return onChange == null ? void 0 : onChange(Object.assign({}, value, { min: min }));};
|
|
16
|
+
var handleChangeMax = function handleChangeMax(max) {return onChange == null ? void 0 : onChange(Object.assign({}, value, { max: max }));};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
_jsxs(View, { row: true, centerV: true, gap: "sm", children: [
|
|
20
|
+
_jsx(NumberInput, Object.assign({
|
|
21
|
+
placeholder: placeholderMin,
|
|
22
|
+
value: value == null ? void 0 : value.min,
|
|
23
|
+
onChange: handleChangeMin,
|
|
24
|
+
max: value == null ? void 0 : value.max,
|
|
25
|
+
flex: true },
|
|
26
|
+
props,
|
|
27
|
+
minProps)
|
|
28
|
+
),
|
|
29
|
+
_jsx(Text, { text4: true, children: separator }),
|
|
30
|
+
_jsx(NumberInput, Object.assign({
|
|
31
|
+
placeholder: placeholderMax,
|
|
32
|
+
value: value == null ? void 0 : value.max,
|
|
33
|
+
onChange: handleChangeMax,
|
|
34
|
+
min: value == null ? void 0 : value.min,
|
|
35
|
+
flex: true },
|
|
36
|
+
props,
|
|
37
|
+
maxProps)
|
|
38
|
+
)] }
|
|
39
|
+
));
|
|
40
|
+
|
|
41
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/PasswordInput.js";var _excluded = ["hideToggle", "suffix"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Icon } from "../presentation/Icon";
|
|
4
|
+
import { Link } from "../actions/Link";
|
|
5
|
+
import { TextInput } from "./TextInput";import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
export function PasswordInput(_ref) {var hideToggle = _ref.hideToggle,suffix = _ref.suffix,props = _objectWithoutProperties(_ref, _excluded);
|
|
8
|
+
var _React$useState = React.useState(false),_React$useState2 = _slicedToArray(_React$useState, 2),visible = _React$useState2[0],setVisible = _React$useState2[1];
|
|
9
|
+
|
|
10
|
+
var toggle = !hideToggle ?
|
|
11
|
+
_jsx(Link, { onPress: function onPress() {return setVisible(function (v) {return !v;});}, children:
|
|
12
|
+
_jsx(Icon, { name: visible ? 'RiEyeOffLine' : 'RiEyeLine', color: "text3" }) }
|
|
13
|
+
) :
|
|
14
|
+
null;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
_jsx(TextInput, Object.assign({
|
|
18
|
+
type: visible ? 'text' : 'password',
|
|
19
|
+
secureTextEntry: !visible,
|
|
20
|
+
suffix: suffix || toggle },
|
|
21
|
+
props)
|
|
22
|
+
));
|
|
23
|
+
|
|
24
|
+
}
|