@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
|
@@ -1 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/DayPicker.js";var _excluded = ["value", "onChange", "min", "max", "onCheckDisabled"];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
|
+
import dayjs from 'dayjs';
|
|
3
|
+
|
|
4
|
+
import { CalendarNav } from "../../calendar/CalendarNav";
|
|
5
|
+
import { Col } from "../../structure/Col";
|
|
6
|
+
import { Grid } from "../../structure/Row";
|
|
7
|
+
import { Link } from "../../actions/Link";
|
|
8
|
+
import { Text } from "../../text/Text";
|
|
9
|
+
import { View } from "../../structure/View";
|
|
10
|
+
import { WeekDaysBar } from "../../calendar/WeekDaysBar";
|
|
11
|
+
import { isDateDisabled } from "../../calendar/_helpers/dateDisabled";
|
|
12
|
+
import { useCalendarDays } from "../../calendar/_helpers/calendarDays";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
export function DayPicker(_ref) {var _value2,_value3,_value4,_this = this;var value = _ref.value,onChange = _ref.onChange,min = _ref.min,max = _ref.max,onCheckDisabled = _ref.onCheckDisabled,props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
if (!!value) value = dayjs(value);
|
|
16
|
+
var _React$useState = React.useState(value),_React$useState2 = _slicedToArray(_React$useState, 2),localValue = _React$useState2[0],setLocalValue = _React$useState2[1];
|
|
17
|
+
var _React$useState3 = React.useState(function () {return dayjs(value || undefined).startOf('month');}),_React$useState4 = _slicedToArray(_React$useState3, 2),currentMonth = _React$useState4[0],setCurrentMonth = _React$useState4[1];
|
|
18
|
+
value = value === undefined ? localValue : value;
|
|
19
|
+
|
|
20
|
+
React.useEffect(function () {var _value;
|
|
21
|
+
setLocalValue(value);
|
|
22
|
+
if ((_value = value) != null && _value.isValid != null && _value.isValid()) setCurrentMonth(value.startOf('month'));
|
|
23
|
+
}, [(_value2 = value) == null ? void 0 : _value2.day == null ? void 0 : _value2.day(), (_value3 = value) == null ? void 0 : _value3.month == null ? void 0 : _value3.month(), (_value4 = value) == null ? void 0 : _value4.year == null ? void 0 : _value4.year()]);
|
|
24
|
+
|
|
25
|
+
var handleChange = function handleChange(v) {
|
|
26
|
+
setLocalValue(v);
|
|
27
|
+
onChange == null ? void 0 : onChange(v);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var _useCalendarDays = useCalendarDays(currentMonth),cells = _useCalendarDays.cells;
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
_jsxs(View, Object.assign({ className: "neko-day-picker", width: 275 }, props, { children: [
|
|
34
|
+
_jsx(CalendarNav, { value: currentMonth, onChange: setCurrentMonth }),
|
|
35
|
+
_jsx(WeekDaysBar, {}),
|
|
36
|
+
|
|
37
|
+
_jsx(Grid, { className: "neko-day-picker-days", colSpan: 24 / 7, gap: "sm", children:
|
|
38
|
+
cells.map(function (day, i) {
|
|
39
|
+
var dateVal = currentMonth.date(day);
|
|
40
|
+
var isActive = !!value && !!day && dateVal.isSame(value, 'day');
|
|
41
|
+
var disabled = isDateDisabled(dateVal, { min: min, max: max, onCheckDisabled: onCheckDisabled });
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
_jsx(Col, { className: "day-cell", center: true, children:
|
|
45
|
+
_jsx(Link, {
|
|
46
|
+
ratio: 1,
|
|
47
|
+
fullW: true,
|
|
48
|
+
center: true,
|
|
49
|
+
br: "md",
|
|
50
|
+
onPress: function onPress() {return !!day && handleChange(dateVal);},
|
|
51
|
+
bg: isActive && 'primary',
|
|
52
|
+
disabled: disabled, children:
|
|
53
|
+
|
|
54
|
+
_jsx(Text, { sm: true, text2: true, center: true, strong: isActive, children:
|
|
55
|
+
day || '' }
|
|
56
|
+
) }
|
|
57
|
+
) }, day ? dateVal.format('YYYYMMDD') : i
|
|
58
|
+
));
|
|
59
|
+
|
|
60
|
+
}) }
|
|
61
|
+
)] })
|
|
62
|
+
));
|
|
63
|
+
|
|
64
|
+
}
|
|
@@ -1 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/MonthPicker.js";var _excluded = ["value", "onChange", "min", "max", "onCheckDisabled"];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
|
+
import dayjs from 'dayjs';
|
|
3
|
+
|
|
4
|
+
import { CalendarNav } from "../../calendar/CalendarNav";
|
|
5
|
+
import { Col } from "../../structure/Col";
|
|
6
|
+
import { Divider } from "../../helpers";
|
|
7
|
+
import { Grid } from "../../structure/Row";
|
|
8
|
+
import { Link } from "../../actions/Link";
|
|
9
|
+
import { Text } from "../../text/Text";
|
|
10
|
+
import { View } from "../../structure/View";
|
|
11
|
+
import { isDateDisabled } from "../../calendar/_helpers/dateDisabled";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
|
|
13
|
+
var months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
14
|
+
|
|
15
|
+
export function MonthPicker(_ref) {var _value2,_value3,_this = this;var value = _ref.value,onChange = _ref.onChange,min = _ref.min,max = _ref.max,onCheckDisabled = _ref.onCheckDisabled,props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
var _React$useState = React.useState(value),_React$useState2 = _slicedToArray(_React$useState, 2),localValue = _React$useState2[0],setLocalValue = _React$useState2[1];
|
|
17
|
+
var _React$useState3 = React.useState(function () {return dayjs(value || undefined).startOf('year');}),_React$useState4 = _slicedToArray(_React$useState3, 2),currentYear = _React$useState4[0],setCurrentYear = _React$useState4[1];
|
|
18
|
+
value = value === undefined ? localValue : value;
|
|
19
|
+
|
|
20
|
+
React.useEffect(function () {var _value;
|
|
21
|
+
setLocalValue(value);
|
|
22
|
+
if ((_value = value) != null && _value.isValid != null && _value.isValid()) setCurrentYear(value.startOf('year'));
|
|
23
|
+
}, [(_value2 = value) == null ? void 0 : _value2.month == null ? void 0 : _value2.month(), (_value3 = value) == null ? void 0 : _value3.year == null ? void 0 : _value3.year()]);
|
|
24
|
+
|
|
25
|
+
var handleChange = function handleChange(v) {
|
|
26
|
+
var newValue = v.startOf('month');
|
|
27
|
+
setLocalValue(newValue);
|
|
28
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
_jsxs(View, Object.assign({ className: "neko-day-picker", width: 275 }, props, { children: [
|
|
33
|
+
_jsx(CalendarNav, { value: currentYear, onChange: setCurrentYear, level: "year" }),
|
|
34
|
+
_jsx(Divider, {}),
|
|
35
|
+
|
|
36
|
+
_jsx(Grid, { colSpan: 8, gap: "xs", children:
|
|
37
|
+
months.map(function (month) {
|
|
38
|
+
var dateVal = currentYear.month(month);
|
|
39
|
+
var isActive = !!value && dateVal.isSame(value, 'week');
|
|
40
|
+
var disabled = isDateDisabled(dateVal, { min: min, max: max, onCheckDisabled: onCheckDisabled });
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
_jsx(Col, { children:
|
|
44
|
+
_jsx(Link, {
|
|
45
|
+
fullW: true,
|
|
46
|
+
br: "md",
|
|
47
|
+
padding: "sm",
|
|
48
|
+
onPress: function onPress() {return handleChange(dateVal);},
|
|
49
|
+
bg: isActive && 'primary',
|
|
50
|
+
disabled: disabled, children:
|
|
51
|
+
|
|
52
|
+
_jsx(Text, { text2: !isActive, strong: isActive, center: true, children:
|
|
53
|
+
dateVal.format('MMM') }
|
|
54
|
+
) }
|
|
55
|
+
) }, month
|
|
56
|
+
));
|
|
57
|
+
|
|
58
|
+
}) }
|
|
59
|
+
)] })
|
|
60
|
+
));
|
|
61
|
+
|
|
62
|
+
}
|
|
@@ -1 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/QuarterPicker.js";var _excluded = ["value", "onChange", "min", "max", "onCheckDisabled"];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
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import quarterOfYear from 'dayjs/esm/plugin/quarterOfYear';
|
|
4
|
+
|
|
5
|
+
import { CalendarNav } from "../../calendar/CalendarNav";
|
|
6
|
+
import { Col } from "../../structure/Col";
|
|
7
|
+
import { Divider } from "../../helpers";
|
|
8
|
+
import { Grid } from "../../structure/Row";
|
|
9
|
+
import { Link } from "../../actions/Link";
|
|
10
|
+
import { Text } from "../../text/Text";
|
|
11
|
+
import { View } from "../../structure/View";
|
|
12
|
+
import { isDateDisabled } from "../../calendar/_helpers/dateDisabled";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
dayjs.extend(quarterOfYear);
|
|
15
|
+
|
|
16
|
+
var quarters = [1, 2, 3, 4];
|
|
17
|
+
|
|
18
|
+
export function QuarterPicker(_ref) {var _value2,_value3,_this = this;var value = _ref.value,onChange = _ref.onChange,min = _ref.min,max = _ref.max,onCheckDisabled = _ref.onCheckDisabled,props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var _React$useState = React.useState(value),_React$useState2 = _slicedToArray(_React$useState, 2),localValue = _React$useState2[0],setLocalValue = _React$useState2[1];
|
|
20
|
+
var _React$useState3 = React.useState(function () {return dayjs(value || undefined).startOf('year');}),_React$useState4 = _slicedToArray(_React$useState3, 2),currentYear = _React$useState4[0],setCurrentYear = _React$useState4[1];
|
|
21
|
+
value = value === undefined ? localValue : value;
|
|
22
|
+
|
|
23
|
+
React.useEffect(function () {var _value;
|
|
24
|
+
setLocalValue(value);
|
|
25
|
+
if ((_value = value) != null && _value.isValid != null && _value.isValid()) setCurrentYear(value.startOf('year'));
|
|
26
|
+
}, [(_value2 = value) == null ? void 0 : _value2.quarter == null ? void 0 : _value2.quarter(), (_value3 = value) == null ? void 0 : _value3.year == null ? void 0 : _value3.year()]);
|
|
27
|
+
|
|
28
|
+
var handleChange = function handleChange(v) {
|
|
29
|
+
var newValue = v.startOf('quarter');
|
|
30
|
+
setLocalValue(newValue);
|
|
31
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
_jsxs(View, Object.assign({ className: "neko-day-picker", width: 275 }, props, { children: [
|
|
36
|
+
_jsx(CalendarNav, { value: currentYear, onChange: setCurrentYear, level: "year" }),
|
|
37
|
+
_jsx(Divider, {}),
|
|
38
|
+
|
|
39
|
+
_jsx(Grid, { colSpan: 6, gap: "xs", children:
|
|
40
|
+
quarters.map(function (quarter) {
|
|
41
|
+
var dateVal = currentYear.quarter(quarter);
|
|
42
|
+
var isActive = !!value && dateVal.isSame(value, 'week');
|
|
43
|
+
var disabled = isDateDisabled(dateVal, { min: min, max: max, onCheckDisabled: onCheckDisabled });
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
_jsx(Col, { children:
|
|
47
|
+
_jsx(Link, {
|
|
48
|
+
fullW: true,
|
|
49
|
+
br: "md",
|
|
50
|
+
padding: "sm",
|
|
51
|
+
onPress: function onPress() {return handleChange(dateVal);},
|
|
52
|
+
bg: isActive && 'primary',
|
|
53
|
+
disabled: disabled, children:
|
|
54
|
+
|
|
55
|
+
_jsxs(Text, { text2: !isActive, strong: isActive, center: true, children: ["Q",
|
|
56
|
+
dateVal.quarter()] }
|
|
57
|
+
) }
|
|
58
|
+
) }, quarter
|
|
59
|
+
));
|
|
60
|
+
|
|
61
|
+
}) }
|
|
62
|
+
)] })
|
|
63
|
+
));
|
|
64
|
+
|
|
65
|
+
}
|
|
@@ -1 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/WeekPicker.js";var _excluded = ["value", "onChange", "min", "max", "onCheckDisabled"];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 { splitEvery, identity } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
|
|
5
|
+
import { CalendarNav } from "../../calendar/CalendarNav";
|
|
6
|
+
import { Col } from "../../structure/Col";
|
|
7
|
+
import { Link } from "../../actions/Link";
|
|
8
|
+
import { Row } from "../../structure/Row";
|
|
9
|
+
import { Text } from "../../text/Text";
|
|
10
|
+
import { View } from "../../structure/View";
|
|
11
|
+
import { WeekDaysBar } from "../../calendar/WeekDaysBar";
|
|
12
|
+
import { isDateDisabled } from "../../calendar/_helpers/dateDisabled";
|
|
13
|
+
import { useCalendarDays } from "../../calendar/_helpers/calendarDays";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
|
|
15
|
+
export function WeekPicker(_ref) {var _value2,_value3,_value4,_this = this;var value = _ref.value,onChange = _ref.onChange,min = _ref.min,max = _ref.max,onCheckDisabled = _ref.onCheckDisabled,props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
var _React$useState = React.useState(value),_React$useState2 = _slicedToArray(_React$useState, 2),localValue = _React$useState2[0],setLocalValue = _React$useState2[1];
|
|
17
|
+
var _React$useState3 = React.useState(function () {return dayjs(value || undefined).startOf('month');}),_React$useState4 = _slicedToArray(_React$useState3, 2),currentMonth = _React$useState4[0],setCurrentMonth = _React$useState4[1];
|
|
18
|
+
value = value === undefined ? localValue : value;
|
|
19
|
+
|
|
20
|
+
React.useEffect(function () {var _value;
|
|
21
|
+
setLocalValue(value);
|
|
22
|
+
if ((_value = value) != null && _value.isValid != null && _value.isValid()) setCurrentMonth(value.startOf('month'));
|
|
23
|
+
}, [(_value2 = value) == null ? void 0 : _value2.day == null ? void 0 : _value2.day(), (_value3 = value) == null ? void 0 : _value3.month == null ? void 0 : _value3.month(), (_value4 = value) == null ? void 0 : _value4.year == null ? void 0 : _value4.year()]);
|
|
24
|
+
|
|
25
|
+
var handleChange = function handleChange(v) {
|
|
26
|
+
var newValue = v.startOf('week');
|
|
27
|
+
setLocalValue(newValue);
|
|
28
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var _useCalendarDays = useCalendarDays(currentMonth),cells = _useCalendarDays.cells;
|
|
32
|
+
var weeks = splitEvery(7, cells);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
_jsxs(View, Object.assign({ className: "neko-day-picker", width: 275 }, props, { children: [
|
|
36
|
+
_jsx(CalendarNav, { value: currentMonth, onChange: setCurrentMonth }),
|
|
37
|
+
_jsx(WeekDaysBar, {}),
|
|
38
|
+
|
|
39
|
+
_jsx(View, { colSpan: 24 / 7, gap: "sm", children:
|
|
40
|
+
weeks.map(function (week, wi) {
|
|
41
|
+
var firstDay = week.find(identity);
|
|
42
|
+
var dateVal = currentMonth.date(firstDay);
|
|
43
|
+
var isActive = !!value && !!firstDay && dateVal.isSame(value, 'week');
|
|
44
|
+
var disabled = isDateDisabled(dateVal, { min: min, max: max, onCheckDisabled: onCheckDisabled });
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
_jsx(Link, {
|
|
48
|
+
|
|
49
|
+
fullW: true,
|
|
50
|
+
br: "md",
|
|
51
|
+
onPress: function onPress() {return !!firstDay && handleChange(dateVal);},
|
|
52
|
+
bg: isActive && 'primary',
|
|
53
|
+
disabled: disabled, children:
|
|
54
|
+
|
|
55
|
+
_jsx(Row, { colSpan: 24 / 7, gap: "sm", children:
|
|
56
|
+
week.map(function (day, i) {
|
|
57
|
+
var dateVal = currentMonth.date(day);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
_jsx(Col, { className: "day-cell", center: true, ratio: 1, children:
|
|
61
|
+
_jsx(Text, { sm: true, text2: true, center: true, strong: isActive, children:
|
|
62
|
+
day || '' }
|
|
63
|
+
) }, day ? dateVal.format('YYYYMMDD') : i
|
|
64
|
+
));
|
|
65
|
+
|
|
66
|
+
}) }
|
|
67
|
+
) }, firstDay ? dateVal.format('YYYYMMDD') : wi
|
|
68
|
+
));
|
|
69
|
+
|
|
70
|
+
}) }
|
|
71
|
+
)] })
|
|
72
|
+
));
|
|
73
|
+
|
|
74
|
+
}
|
|
@@ -1 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/YearPicker.js";var _excluded = ["value", "onChange", "min", "max", "onCheckDisabled"];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 { range } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
|
|
5
|
+
import { CalendarNav } from "../../calendar/CalendarNav";
|
|
6
|
+
import { Col } from "../../structure/Col";
|
|
7
|
+
import { Divider } from "../../helpers";
|
|
8
|
+
import { Grid } from "../../structure/Row";
|
|
9
|
+
import { Link } from "../../actions/Link";
|
|
10
|
+
import { Text } from "../../text/Text";
|
|
11
|
+
import { View } from "../../structure/View";
|
|
12
|
+
import { isDateDisabled } from "../../calendar/_helpers/dateDisabled";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
function getDecade(value) {
|
|
15
|
+
var year = dayjs(value || undefined).year();
|
|
16
|
+
var decadeStartYear = Math.floor(year / 10) * 10;
|
|
17
|
+
return dayjs().year(decadeStartYear).startOf('year');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function YearPicker(_ref) {var _value2,_this = this;var value = _ref.value,onChange = _ref.onChange,min = _ref.min,max = _ref.max,onCheckDisabled = _ref.onCheckDisabled,props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var _React$useState = React.useState(value),_React$useState2 = _slicedToArray(_React$useState, 2),localValue = _React$useState2[0],setLocalValue = _React$useState2[1];
|
|
22
|
+
var _React$useState3 = React.useState(function () {return getDecade(value);}),_React$useState4 = _slicedToArray(_React$useState3, 2),currentDecade = _React$useState4[0],setCurrentDecade = _React$useState4[1];
|
|
23
|
+
|
|
24
|
+
value = value === undefined ? localValue : value;
|
|
25
|
+
|
|
26
|
+
React.useEffect(function () {var _value;
|
|
27
|
+
setLocalValue(value);
|
|
28
|
+
if ((_value = value) != null && _value.isValid != null && _value.isValid()) setCurrentDecade(getDecade(value));
|
|
29
|
+
}, [(_value2 = value) == null ? void 0 : _value2.year == null ? void 0 : _value2.year()]);
|
|
30
|
+
|
|
31
|
+
var handleChange = function handleChange(v) {
|
|
32
|
+
var newValue = v.startOf('year');
|
|
33
|
+
setLocalValue(newValue);
|
|
34
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var years = range(currentDecade.year(), currentDecade.year() + 10);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
_jsxs(View, Object.assign({ className: "neko-day-picker", width: 275 }, props, { children: [
|
|
41
|
+
_jsx(CalendarNav, { value: currentDecade, onChange: setCurrentDecade, level: "decade" }),
|
|
42
|
+
_jsx(Divider, {}),
|
|
43
|
+
|
|
44
|
+
_jsx(Grid, { colSpan: 12, gap: "xs", children:
|
|
45
|
+
years.map(function (year) {
|
|
46
|
+
var dateVal = currentDecade.year(year);
|
|
47
|
+
var isActive = !!value && dateVal.isSame(value, 'week');
|
|
48
|
+
var disabled = isDateDisabled(dateVal, { min: min, max: max, onCheckDisabled: onCheckDisabled });
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
_jsx(Col, { children:
|
|
52
|
+
_jsx(Link, {
|
|
53
|
+
fullW: true,
|
|
54
|
+
br: "md",
|
|
55
|
+
padding: "sm",
|
|
56
|
+
onPress: function onPress() {return handleChange(dateVal);},
|
|
57
|
+
bg: isActive && 'primary',
|
|
58
|
+
disabled: disabled, children:
|
|
59
|
+
|
|
60
|
+
_jsx(Text, { text2: !isActive, strong: isActive, center: true, children:
|
|
61
|
+
dateVal.year() }
|
|
62
|
+
) }
|
|
63
|
+
) }, year
|
|
64
|
+
));
|
|
65
|
+
|
|
66
|
+
}) }
|
|
67
|
+
)] })
|
|
68
|
+
));
|
|
69
|
+
|
|
70
|
+
}
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
export*from"./Checkbox";
|
|
1
|
+
export * from "./Checkbox";
|
|
2
|
+
export * from "./Radio";
|
|
3
|
+
export * from "./Switch";
|
|
4
|
+
export * from "./InputWrapper";
|
|
5
|
+
export * from "./TextInput";
|
|
6
|
+
export * from "./PasswordInput";
|
|
7
|
+
export * from "./TextArea";
|
|
8
|
+
export * from "./NumberInput";
|
|
9
|
+
export * from "./NumberRangeInput";
|
|
10
|
+
export * from "./LinkInput";
|
|
11
|
+
export * from "./MaskInput";
|
|
12
|
+
export * from "./DateInput";
|
|
13
|
+
export * from "./DateRangeInput";
|
|
14
|
+
export * from "./datePicker/DatePicker";
|
|
15
|
+
export * from "./Picker";
|
|
16
|
+
export * from "./Select";
|
|
17
|
+
export * from "./BooleanSelect";
|
|
18
|
+
export * from "./EnabledSelect";
|
|
19
|
+
export * from "./RateInput";
|
|
20
|
+
export * from "./SegmentedPicker";
|
|
21
|
+
export * from "./Editable";
|
|
22
|
+
export * from "./upload/Upload";
|
|
23
|
+
export * from "./UploadInput";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/upload/Upload.js";var _excluded = ["children", "onChange", "onUpload", "value", "accept", "multiple", "maxCount", "disabled", "dnd"];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, { useRef, useState, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
import { View } from "../../structure/View";
|
|
4
|
+
import { useUploadState } from "./useUploadState";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
function normalizeFile(file) {
|
|
7
|
+
return {
|
|
8
|
+
uri: URL.createObjectURL(file),
|
|
9
|
+
name: file.name,
|
|
10
|
+
type: file.type,
|
|
11
|
+
size: file.size,
|
|
12
|
+
file: file
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function Upload(_ref) {var children = _ref.children,onChange = _ref.onChange,onUpload = _ref.onUpload,valueProp = _ref.value,accept = _ref.accept,_ref$multiple = _ref.multiple,multiple = _ref$multiple === void 0 ? false : _ref$multiple,maxCount = _ref.maxCount,_ref$disabled = _ref.disabled,disabled = _ref$disabled === void 0 ? false : _ref$disabled,_ref$dnd = _ref.dnd,dnd = _ref$dnd === void 0 ? true : _ref$dnd,props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
var _useUploadState = useUploadState({ onUpload: onUpload, onChange: onChange, multiple: multiple, maxCount: maxCount, value: valueProp }),value = _useUploadState.value,addFiles = _useUploadState.addFiles,remove = _useUploadState.remove;
|
|
18
|
+
var inputRef = useRef();
|
|
19
|
+
var _useState = useState(false),_useState2 = _slicedToArray(_useState, 2),isDragging = _useState2[0],setIsDragging = _useState2[1];
|
|
20
|
+
var dragCounter = useRef(0);
|
|
21
|
+
|
|
22
|
+
var handleClick = useCallback(function () {var _inputRef$current;
|
|
23
|
+
if (disabled) return;
|
|
24
|
+
(_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.click();
|
|
25
|
+
}, [disabled]);
|
|
26
|
+
|
|
27
|
+
var handleInputChange = useCallback(
|
|
28
|
+
function (e) {
|
|
29
|
+
var files = e.target.files;
|
|
30
|
+
if (!(files != null && files.length)) return;
|
|
31
|
+
addFiles(Array.from(files).map(normalizeFile));
|
|
32
|
+
e.target.value = '';
|
|
33
|
+
},
|
|
34
|
+
[addFiles]
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
var handleDragEnter = useCallback(
|
|
38
|
+
function (e) {
|
|
39
|
+
if (!dnd || disabled) return;
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
dragCounter.current++;
|
|
43
|
+
if (dragCounter.current === 1) setIsDragging(true);
|
|
44
|
+
},
|
|
45
|
+
[dnd, disabled]
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
var handleDragOver = useCallback(
|
|
49
|
+
function (e) {
|
|
50
|
+
if (!dnd || disabled) return;
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
e.stopPropagation();
|
|
53
|
+
},
|
|
54
|
+
[dnd, disabled]
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
var handleDragLeave = useCallback(
|
|
58
|
+
function (e) {
|
|
59
|
+
if (!dnd || disabled) return;
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
dragCounter.current--;
|
|
63
|
+
if (dragCounter.current === 0) setIsDragging(false);
|
|
64
|
+
},
|
|
65
|
+
[dnd, disabled]
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
var handleDrop = useCallback(
|
|
69
|
+
function (e) {var _e$dataTransfer;
|
|
70
|
+
if (!dnd || disabled) return;
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
e.stopPropagation();
|
|
73
|
+
dragCounter.current = 0;
|
|
74
|
+
setIsDragging(false);
|
|
75
|
+
var files = (_e$dataTransfer = e.dataTransfer) == null ? void 0 : _e$dataTransfer.files;
|
|
76
|
+
if (!(files != null && files.length)) return;
|
|
77
|
+
addFiles(Array.from(files).map(normalizeFile));
|
|
78
|
+
},
|
|
79
|
+
[dnd, disabled, addFiles]
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
var dndHandlers = dnd ?
|
|
83
|
+
{
|
|
84
|
+
onDragEnter: handleDragEnter,
|
|
85
|
+
onDragOver: handleDragOver,
|
|
86
|
+
onDragLeave: handleDragLeave,
|
|
87
|
+
onDrop: handleDrop
|
|
88
|
+
} :
|
|
89
|
+
{};
|
|
90
|
+
|
|
91
|
+
var isRenderFn = typeof children === 'function';
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
_jsxs(View, Object.assign({ onPress: !isRenderFn && !disabled ? handleClick : undefined, pointer: !isRenderFn && !disabled }, dndHandlers, props, { children: [
|
|
95
|
+
isRenderFn ? children({ value: value, remove: remove, isDragging: isDragging, open: handleClick }) : children,
|
|
96
|
+
_jsx("input", { ref: inputRef, type: "file", style: { display: 'none' }, accept: accept, multiple: multiple, onChange: handleInputChange })] })
|
|
97
|
+
));
|
|
98
|
+
|
|
99
|
+
}
|