@neko-os/ui 0.2.2 → 0.3.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/README.md +0 -76
- 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 +3 -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/components/actions/ActionsDrawer.js +17 -4
- package/src/components/actions/Button.js +5 -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/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 +2 -2
- 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 +14 -2
- 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/fullColor.js +2 -2
- 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
- package/src/theme/format/colorsVariations.js +1 -1
- package/src/theme/helpers/colorScale.js +2 -1
|
@@ -1 +1,128 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/table/Pagination.js";var _excluded = ["active"],_excluded2 = ["total", "itemsPerPage", "pages", "maxVisible", "value", "initialValue", "onChange"];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 _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;}function _toConsumableArray(r) {return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread 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 _iterableToArray(r) {if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);}function _arrayWithoutHoles(r) {if (Array.isArray(r)) return _arrayLikeToArray(r);}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;}import { range, is, pipe } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { Button } from "../actions/Button";
|
|
5
|
+
import { View } from "../structure/View";
|
|
6
|
+
import { moveScale } from "../../theme/helpers/sizeScale";
|
|
7
|
+
import { useSizeConverter } from "../../modifiers/sizeConverter";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
function getPageIndexes(pages, value) {var maxVisible = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
|
|
10
|
+
if (pages <= maxVisible) {
|
|
11
|
+
return Array.from({ length: pages }, function (_, i) {return {
|
|
12
|
+
label: i + 1,
|
|
13
|
+
value: i + 1
|
|
14
|
+
};});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var middle = Math.floor(maxVisible / 2);
|
|
18
|
+
var start = value - middle;
|
|
19
|
+
var end = value + middle;
|
|
20
|
+
|
|
21
|
+
if (start < 1) {
|
|
22
|
+
start = 1;
|
|
23
|
+
end = maxVisible;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (end > pages) {
|
|
27
|
+
end = pages;
|
|
28
|
+
start = pages - maxVisible + 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var range = Array.from({ length: end - start + 1 }, function (_, i) {return start + i;});
|
|
32
|
+
|
|
33
|
+
var result = [];
|
|
34
|
+
|
|
35
|
+
if (start > 1) {
|
|
36
|
+
if (start === 2) {
|
|
37
|
+
result.push({ label: 1, value: 1 });
|
|
38
|
+
} else {
|
|
39
|
+
result.push({ label: '...', value: start - 1 });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
result.push.apply(result, _toConsumableArray(range.map(function (p) {return { label: p, value: p };})));
|
|
44
|
+
|
|
45
|
+
if (end < pages) {
|
|
46
|
+
if (end === pages - 1) {
|
|
47
|
+
result.push({ label: pages, value: pages });
|
|
48
|
+
} else {
|
|
49
|
+
result.push({ label: '...', value: end + 1 });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function Item(_ref) {var active = _ref.active,props = _objectWithoutProperties(_ref, _excluded);
|
|
57
|
+
return (
|
|
58
|
+
_jsx(Button, Object.assign({
|
|
59
|
+
size: "sm",
|
|
60
|
+
ratio: 1,
|
|
61
|
+
color: active ? 'primary' : 'transparent',
|
|
62
|
+
textProps: { color: !active && 'text3' },
|
|
63
|
+
iconProps: { color: !active && 'text3' } },
|
|
64
|
+
props)
|
|
65
|
+
));
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function Pagination(_ref2)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
{var _this = this;var _ref2$total = _ref2.total,total = _ref2$total === void 0 ? 0 : _ref2$total,_ref2$itemsPerPage = _ref2.itemsPerPage,itemsPerPage = _ref2$itemsPerPage === void 0 ? 10 : _ref2$itemsPerPage,pages = _ref2.pages,_ref2$maxVisible = _ref2.maxVisible,maxVisible = _ref2$maxVisible === void 0 ? 5 : _ref2$maxVisible,value = _ref2.value,_ref2$initialValue = _ref2.initialValue,initialValue = _ref2$initialValue === void 0 ? 1 : _ref2$initialValue,onChange = _ref2.onChange,rootProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
79
|
+
var _pipe = pipe(
|
|
80
|
+
useSizeConverter('padding', 'md')
|
|
81
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),sizeCode = _pipe2[0].sizeCode,props = _pipe2[1];
|
|
82
|
+
var size = moveScale(sizeCode, -1);
|
|
83
|
+
|
|
84
|
+
pages = pages || Math.ceil(total / itemsPerPage);
|
|
85
|
+
|
|
86
|
+
var _React$useState = React.useState(initialValue),_React$useState2 = _slicedToArray(_React$useState, 2),localValue = _React$useState2[0],setLocalValue = _React$useState2[1];
|
|
87
|
+
value = value || localValue || initialValue;
|
|
88
|
+
var handleChange = function handleChange(v) {
|
|
89
|
+
setLocalValue(v);
|
|
90
|
+
onChange == null ? void 0 : onChange(v);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var pageIndexes = getPageIndexes(pages, value, maxVisible);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
_jsxs(View, Object.assign({ className: "neko-pagination", row: true, gap: "xxs" }, props, { children: [
|
|
97
|
+
_jsx(Item, Object.assign({
|
|
98
|
+
icon: "arrow-left-s-line",
|
|
99
|
+
disabled: value === 1,
|
|
100
|
+
onPress: function onPress() {return handleChange(value - 1);},
|
|
101
|
+
size: size },
|
|
102
|
+
props)
|
|
103
|
+
),
|
|
104
|
+
|
|
105
|
+
pageIndexes.map(function (item) {
|
|
106
|
+
return (
|
|
107
|
+
_jsx(Item, Object.assign({
|
|
108
|
+
|
|
109
|
+
active: value === item.value,
|
|
110
|
+
onPress: function onPress() {return handleChange(item.value);},
|
|
111
|
+
label: item.label,
|
|
112
|
+
disabled: is(String, item.value),
|
|
113
|
+
size: size },
|
|
114
|
+
props), item.value
|
|
115
|
+
));
|
|
116
|
+
|
|
117
|
+
}),
|
|
118
|
+
|
|
119
|
+
_jsx(Item, Object.assign({
|
|
120
|
+
icon: "arrow-right-s-line",
|
|
121
|
+
disabled: value === pages,
|
|
122
|
+
onPress: function onPress() {return handleChange(value + 1);},
|
|
123
|
+
size: size },
|
|
124
|
+
props)
|
|
125
|
+
)] })
|
|
126
|
+
));
|
|
127
|
+
|
|
128
|
+
}
|
|
@@ -1 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/table/Table.js";var _excluded = ["children"];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 } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { AbsTable } from "../../abstractions/Table";
|
|
5
|
+
import { AbsView } from "../../abstractions/View";
|
|
6
|
+
import { useBackgroundModifier } from "../../modifiers/background";
|
|
7
|
+
import { useBorderModifier } from "../../modifiers/border";
|
|
8
|
+
import { useDefaultModifier } from "../../modifiers/default";
|
|
9
|
+
import { useDisplayModifier } from "../../modifiers/display";
|
|
10
|
+
import { useMarginModifier } from "../../modifiers/margin";
|
|
11
|
+
import { useOverflowModifier } from "../../modifiers/overflow";
|
|
12
|
+
import { usePaddingModifier } from "../../modifiers/padding";
|
|
13
|
+
import { useShadowModifier } from "../../modifiers/shadow";
|
|
14
|
+
import { useSizeModifier } from "../../modifiers/size";
|
|
15
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
|
|
17
|
+
var TableContext = React.createContext(null);
|
|
18
|
+
export var useTable = function useTable() {return React.useContext(TableContext) || {};};
|
|
19
|
+
|
|
20
|
+
var DEFAULT_PROPS = {
|
|
21
|
+
br: 'xxl',
|
|
22
|
+
overflow: 'scroll',
|
|
23
|
+
width: '100%',
|
|
24
|
+
relative: true,
|
|
25
|
+
border: 'overlayDivider'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export function Table(_ref) {var children = _ref.children,rootProps = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var _pipe = pipe(
|
|
30
|
+
useThemeComponentModifier('Table'),
|
|
31
|
+
useDefaultModifier(DEFAULT_PROPS),
|
|
32
|
+
useDisplayModifier,
|
|
33
|
+
useSizeModifier,
|
|
34
|
+
useOverflowModifier,
|
|
35
|
+
usePaddingModifier,
|
|
36
|
+
useMarginModifier,
|
|
37
|
+
useBackgroundModifier,
|
|
38
|
+
useBorderModifier,
|
|
39
|
+
useShadowModifier
|
|
40
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_ = _pipe2[0],props = _pipe2[1];
|
|
41
|
+
|
|
42
|
+
var scrollRef = React.useRef();
|
|
43
|
+
var _React$useState = React.useState(true),_React$useState2 = _slicedToArray(_React$useState, 2),scrolledToMaxLeft = _React$useState2[0],setScrolledToMaxLeft = _React$useState2[1];
|
|
44
|
+
var _React$useState3 = React.useState(false),_React$useState4 = _slicedToArray(_React$useState3, 2),scrolledToMaxRight = _React$useState4[0],setScrolledToMaxRight = _React$useState4[1];
|
|
45
|
+
|
|
46
|
+
React.useEffect(function () {
|
|
47
|
+
var el = scrollRef.current;
|
|
48
|
+
if (!el || !el.addEventListener) return;
|
|
49
|
+
|
|
50
|
+
var onScroll = function onScroll() {
|
|
51
|
+
setScrolledToMaxLeft(el.scrollLeft === 0);
|
|
52
|
+
setScrolledToMaxRight(el.scrollLeft + el.clientWidth >= el.scrollWidth - 1);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
el.addEventListener('scroll', onScroll);
|
|
56
|
+
return function () {return el.removeEventListener('scroll', onScroll);};
|
|
57
|
+
}, []);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
_jsx(TableContext.Provider, { value: { scrolledToMaxLeft: scrolledToMaxLeft, scrolledToMaxRight: scrolledToMaxRight }, children:
|
|
61
|
+
_jsx(AbsView, Object.assign({}, props, { className: "neko-table-wrapper", ref: scrollRef, children:
|
|
62
|
+
_jsx(AbsTable, { className: "neko-table", children: children }) })
|
|
63
|
+
) }
|
|
64
|
+
));
|
|
65
|
+
|
|
66
|
+
}
|
|
@@ -1 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/table/TableCol.js";var _excluded = ["label", "children", "strong", "color", "colSpan", "rowSpan"],_excluded2 = ["style"];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;}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;}import { pipe, is } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import { AbsTableCol } from "../../abstractions/Table";
|
|
4
|
+
import { Text } from "../text/Text";
|
|
5
|
+
import { View } from "../structure/View";
|
|
6
|
+
import { useAlignConverter } from "../../modifiers/alignConverter";
|
|
7
|
+
import { useBackgroundModifier } from "../../modifiers/background";
|
|
8
|
+
import { useBorderModifier } from "../../modifiers/border";
|
|
9
|
+
import { useDefaultModifier } from "../../modifiers/default";
|
|
10
|
+
import { useDisplayModifier } from "../../modifiers/display";
|
|
11
|
+
import { useMarginModifier } from "../../modifiers/margin";
|
|
12
|
+
import { useOverflowModifier } from "../../modifiers/overflow";
|
|
13
|
+
import { usePaddingModifier } from "../../modifiers/padding";
|
|
14
|
+
import { usePositionModifier } from "../../modifiers/position";
|
|
15
|
+
import { useShadowModifier } from "../../modifiers/shadow";
|
|
16
|
+
import { useSizeConverter } from "../../modifiers/sizeConverter";
|
|
17
|
+
import { useSizeModifier } from "../../modifiers/size";
|
|
18
|
+
import { useTable } from "./Table";
|
|
19
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
|
|
21
|
+
var DEFAULT_PROPS =
|
|
22
|
+
function DEFAULT_PROPS(_ref) {var scrolledToMaxLeft = _ref.scrolledToMaxLeft,scrolledToMaxRight = _ref.scrolledToMaxRight;return (
|
|
23
|
+
function (_ref2) {var _ref3 = _slicedToArray(_ref2, 2),sizeCode = _ref3[0].sizeCode,_ref3$ = _ref3[1],sticky = _ref3$.sticky,left = _ref3$.left,right = _ref3$.right;return {
|
|
24
|
+
bg: 'overlayBG',
|
|
25
|
+
paddingH: ['xxxs', 'xxs', 'xs'].includes(sizeCode) ? 'sm' : sizeCode,
|
|
26
|
+
paddingV: sizeCode,
|
|
27
|
+
borderB: true,
|
|
28
|
+
margin: 0,
|
|
29
|
+
borderR: left !== undefined && !!sticky && !scrolledToMaxLeft,
|
|
30
|
+
borderL: right !== undefined && !!sticky && !scrolledToMaxRight
|
|
31
|
+
};});};
|
|
32
|
+
|
|
33
|
+
export function TableCol(_ref4) {var label = _ref4.label,children = _ref4.children,strong = _ref4.strong,color = _ref4.color,colSpan = _ref4.colSpan,rowSpan = _ref4.rowSpan,rootProps = _objectWithoutProperties(_ref4, _excluded);
|
|
34
|
+
var _useTable = useTable(),scrolledToMaxLeft = _useTable.scrolledToMaxLeft,scrolledToMaxRight = _useTable.scrolledToMaxRight;
|
|
35
|
+
|
|
36
|
+
var _pipe = pipe(
|
|
37
|
+
useAlignConverter('left'),
|
|
38
|
+
useSizeConverter('padding', 'md'),
|
|
39
|
+
useThemeComponentModifier('TableCol'),
|
|
40
|
+
useDefaultModifier(DEFAULT_PROPS({ scrolledToMaxLeft: scrolledToMaxLeft, scrolledToMaxRight: scrolledToMaxRight })),
|
|
41
|
+
useDisplayModifier,
|
|
42
|
+
usePositionModifier,
|
|
43
|
+
useSizeModifier,
|
|
44
|
+
useOverflowModifier,
|
|
45
|
+
usePaddingModifier,
|
|
46
|
+
useMarginModifier,
|
|
47
|
+
useBackgroundModifier,
|
|
48
|
+
useBorderModifier,
|
|
49
|
+
useShadowModifier
|
|
50
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_pipe2$ = _pipe2[0],sizeCode = _pipe2$.sizeCode,align = _pipe2$.align,_pipe2$2 = _pipe2[1],style = _pipe2$2.style,props = _objectWithoutProperties(_pipe2$2, _excluded2);
|
|
51
|
+
|
|
52
|
+
if (!!label || is(String, children) || is(Number, children)) {
|
|
53
|
+
children =
|
|
54
|
+
_jsx(Text, { strong: !!strong, color: color, size: sizeCode, align: align, children:
|
|
55
|
+
label || children }
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
_jsx(AbsTableCol, { className: "neko-table-col", style: style, colSpan: colSpan, rowSpan: rowSpan, children:
|
|
62
|
+
_jsx(View, Object.assign({ className: "neko-table-col-content", fullW: true, fullH: true, align: align, centerV: true }, props, { children:
|
|
63
|
+
children })
|
|
64
|
+
) }
|
|
65
|
+
));
|
|
66
|
+
|
|
67
|
+
}
|
|
@@ -1 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/table/TableHeader.js";var _excluded = ["children", "label", "colSpan", "rowSpan"],_excluded2 = ["style"];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;}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;}import { pipe, is } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import { AbsTableHeader } from "../../abstractions/Table";
|
|
4
|
+
import { Text } from "../text/Text";
|
|
5
|
+
import { View } from "../structure/View";
|
|
6
|
+
import { moveScale } from "../../theme/helpers/sizeScale";
|
|
7
|
+
import { useAlignConverter } from "../../modifiers/alignConverter";
|
|
8
|
+
import { useBackgroundModifier } from "../../modifiers/background";
|
|
9
|
+
import { useBorderModifier } from "../../modifiers/border";
|
|
10
|
+
import { useDefaultModifier } from "../../modifiers/default";
|
|
11
|
+
import { useDisplayModifier } from "../../modifiers/display";
|
|
12
|
+
import { useMarginModifier } from "../../modifiers/margin";
|
|
13
|
+
import { useOverflowModifier } from "../../modifiers/overflow";
|
|
14
|
+
import { usePaddingModifier } from "../../modifiers/padding";
|
|
15
|
+
import { usePositionModifier } from "../../modifiers/position";
|
|
16
|
+
import { useShadowModifier } from "../../modifiers/shadow";
|
|
17
|
+
import { useSizeConverter } from "../../modifiers/sizeConverter";
|
|
18
|
+
import { useSizeModifier } from "../../modifiers/size";
|
|
19
|
+
import { useTable } from "./Table";
|
|
20
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
|
|
22
|
+
var DEFAULT_PROPS =
|
|
23
|
+
function DEFAULT_PROPS(_ref) {var scrolledToMaxLeft = _ref.scrolledToMaxLeft,scrolledToMaxRight = _ref.scrolledToMaxRight;return (
|
|
24
|
+
function (_ref2) {var _ref3 = _slicedToArray(_ref2, 2),sizeCode = _ref3[0].sizeCode,_ref3$ = _ref3[1],sticky = _ref3$.sticky,left = _ref3$.left,right = _ref3$.right;return {
|
|
25
|
+
bg: 'overlayBG',
|
|
26
|
+
paddingH: ['xxxs', 'xxs', 'xs'].includes(sizeCode) ? 'sm' : sizeCode,
|
|
27
|
+
paddingV: moveScale(sizeCode, -1),
|
|
28
|
+
borderB: true,
|
|
29
|
+
margin: 0,
|
|
30
|
+
borderR: left !== undefined && !!sticky && !scrolledToMaxLeft,
|
|
31
|
+
borderL: right !== undefined && !!sticky && !scrolledToMaxRight
|
|
32
|
+
};});};
|
|
33
|
+
|
|
34
|
+
export function TableHeader(_ref4) {var children = _ref4.children,label = _ref4.label,colSpan = _ref4.colSpan,rowSpan = _ref4.rowSpan,rootProps = _objectWithoutProperties(_ref4, _excluded);
|
|
35
|
+
var _useTable = useTable(),scrolledToMaxLeft = _useTable.scrolledToMaxLeft,scrolledToMaxRight = _useTable.scrolledToMaxRight;
|
|
36
|
+
|
|
37
|
+
var _pipe = pipe(
|
|
38
|
+
useAlignConverter('left'),
|
|
39
|
+
useSizeConverter('padding', 'md'),
|
|
40
|
+
useThemeComponentModifier('TableHeader'),
|
|
41
|
+
useDefaultModifier(DEFAULT_PROPS({ scrolledToMaxLeft: scrolledToMaxLeft, scrolledToMaxRight: scrolledToMaxRight })),
|
|
42
|
+
useDisplayModifier,
|
|
43
|
+
usePositionModifier,
|
|
44
|
+
useSizeModifier,
|
|
45
|
+
useOverflowModifier,
|
|
46
|
+
usePaddingModifier,
|
|
47
|
+
useMarginModifier,
|
|
48
|
+
useBackgroundModifier,
|
|
49
|
+
useBorderModifier,
|
|
50
|
+
useShadowModifier
|
|
51
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_pipe2$ = _pipe2[0],sizeCode = _pipe2$.sizeCode,align = _pipe2$.align,_pipe2$2 = _pipe2[1],style = _pipe2$2.style,props = _objectWithoutProperties(_pipe2$2, _excluded2);
|
|
52
|
+
|
|
53
|
+
if (!!label || is(String, children)) {
|
|
54
|
+
console.log(sizeCode, moveScale(sizeCode, -1));
|
|
55
|
+
children =
|
|
56
|
+
_jsx(Text, { strong: true, text3: true, fullW: true, block: true, align: align, size: moveScale(sizeCode, -1), children:
|
|
57
|
+
label || children }
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
_jsx(AbsTableHeader, { className: "neko-table-header", style: style, colSpan: colSpan, rowSpan: rowSpan, children:
|
|
64
|
+
_jsx(View, Object.assign({ className: "neko-table-header-content", fullW: true, fullH: true, align: align, centerV: true }, props, { children:
|
|
65
|
+
children })
|
|
66
|
+
) }
|
|
67
|
+
));
|
|
68
|
+
|
|
69
|
+
}
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/table/TableHeaderRow.js";var _excluded = ["children"];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 } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import { AbsTableRow } from "../../abstractions/Table";
|
|
4
|
+
import { useBackgroundModifier } from "../../modifiers/background";
|
|
5
|
+
import { useDefaultModifier } from "../../modifiers/default";
|
|
6
|
+
import { useDisplayModifier } from "../../modifiers/display";
|
|
7
|
+
import { useOverflowModifier } from "../../modifiers/overflow";
|
|
8
|
+
import { usePositionModifier } from "../../modifiers/position";
|
|
9
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
var DEFAULT_PROPS = {
|
|
12
|
+
top: 0,
|
|
13
|
+
zIndex: 40
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function TableHeaderRow(_ref) {var children = _ref.children,rootProps = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
var _pipe = pipe(
|
|
18
|
+
useThemeComponentModifier('TableHeaderRow'),
|
|
19
|
+
useDefaultModifier(DEFAULT_PROPS),
|
|
20
|
+
useDisplayModifier,
|
|
21
|
+
usePositionModifier,
|
|
22
|
+
useOverflowModifier,
|
|
23
|
+
useBackgroundModifier
|
|
24
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_ = _pipe2[0],props = _pipe2[1];
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
_jsx(AbsTableRow, Object.assign({ className: "neko-table-header-row" }, props, { children:
|
|
28
|
+
children })
|
|
29
|
+
));
|
|
30
|
+
|
|
31
|
+
}
|
|
@@ -1 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/table/TableRow.js";var _excluded = ["children"];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 } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import { AbsTableRow } from "../../abstractions/Table";
|
|
4
|
+
import { useBackgroundModifier } from "../../modifiers/background";
|
|
5
|
+
import { useDefaultModifier } from "../../modifiers/default";
|
|
6
|
+
import { useDisplayModifier } from "../../modifiers/display";
|
|
7
|
+
import { useOverflowModifier } from "../../modifiers/overflow";
|
|
8
|
+
import { usePositionModifier } from "../../modifiers/position";
|
|
9
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
var DEFAULT_PROPS = {
|
|
12
|
+
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function TableRow(_ref) {var children = _ref.children,rootProps = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
var _pipe = pipe(
|
|
17
|
+
useThemeComponentModifier('TableRow'),
|
|
18
|
+
useDefaultModifier(DEFAULT_PROPS),
|
|
19
|
+
useDisplayModifier,
|
|
20
|
+
usePositionModifier,
|
|
21
|
+
useOverflowModifier,
|
|
22
|
+
useBackgroundModifier
|
|
23
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_ = _pipe2[0],props = _pipe2[1];
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
_jsx(AbsTableRow, Object.assign({ className: "neko-table-row" }, props, { children:
|
|
27
|
+
children })
|
|
28
|
+
));
|
|
29
|
+
|
|
30
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export*from"./Table";
|
|
1
|
+
export * from "./Table";
|
|
2
|
+
export * from "./TableRow";
|
|
3
|
+
export * from "./TableHeaderRow";
|
|
4
|
+
export * from "./TableHeader";
|
|
5
|
+
export * from "./TableCol";
|
|
6
|
+
export * from "./DataTable";
|
|
7
|
+
export * from "./Pagination";
|
|
@@ -1 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/tabs/ActiveTabContent.js";var _excluded = ["item", "active"];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 { AnimatedView } from "../animations";
|
|
4
|
+
import { View } from "../structure";
|
|
5
|
+
import { useTabs } from "./TabsHandler";import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
var duration = 100;
|
|
8
|
+
|
|
9
|
+
function Item(_ref) {var item = _ref.item,active = _ref.active,props = _objectWithoutProperties(_ref, _excluded);
|
|
10
|
+
var Content = React.useMemo(
|
|
11
|
+
function () {return item.render || item.renderContent || item.Content;},
|
|
12
|
+
[item.renderContent, item.Content]
|
|
13
|
+
);
|
|
14
|
+
var _React$useState = React.useState(active),_React$useState2 = _slicedToArray(_React$useState, 2),open = _React$useState2[0],setOpen = _React$useState2[1];
|
|
15
|
+
|
|
16
|
+
React.useEffect(function () {
|
|
17
|
+
if (!!active) {
|
|
18
|
+
setTimeout(function () {return setOpen(true);}, duration);
|
|
19
|
+
} else {
|
|
20
|
+
setOpen(active);
|
|
21
|
+
}
|
|
22
|
+
}, [active]);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
_jsx(AnimatedView, Object.assign({ open: open, fade: { duration: duration }, flex: true, display: !open && 'none' }, props, { children:
|
|
26
|
+
_jsx(Content, {}) })
|
|
27
|
+
));
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function ActiveTabContent(_ref2) {var _this = this;var lazy = _ref2.lazy,unmountOnClose = _ref2.unmountOnClose;
|
|
32
|
+
var _useTabs = useTabs(),activeKey = _useTabs.activeKey,items = _useTabs.items;
|
|
33
|
+
if (!(items != null && items.length)) return false;
|
|
34
|
+
|
|
35
|
+
return items.map(function (item) {return (
|
|
36
|
+
_jsx(Item, { item: item, active: item.key === activeKey, lazy: lazy, unmountOnClose: unmountOnClose }, item.key));}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/tabs/TabsHandler.js";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;}import React from 'react';import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
var TabsContext = React.createContext(null);
|
|
4
|
+
export var useTabs = function useTabs() {return React.useContext(TabsContext) || {};};
|
|
5
|
+
|
|
6
|
+
export function TabsHandler(_ref) {var _items$;var children = _ref.children,items = _ref.items,initialKey = _ref.initialKey;
|
|
7
|
+
var _React$useState = React.useState(initialKey || (items == null ? void 0 : (_items$ = items[0]) == null ? void 0 : _items$.key)),_React$useState2 = _slicedToArray(_React$useState, 2),activeKey = _React$useState2[0],setActiveKey = _React$useState2[1];
|
|
8
|
+
|
|
9
|
+
var activeTab = React.useMemo(function () {
|
|
10
|
+
return items == null ? void 0 : items.find(function (item) {return item.key === activeKey;});
|
|
11
|
+
}, [activeKey]);
|
|
12
|
+
|
|
13
|
+
var value = { items: items, onChange: setActiveKey, activeKey: activeKey, activeTab: activeTab };
|
|
14
|
+
|
|
15
|
+
return _jsx(TabsContext.Provider, { value: value, children: children });
|
|
16
|
+
}
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/tabs/TabsMenu.js";import
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/tabs/TabsMenu.js";import { Menu } from "../actions";
|
|
2
|
+
import { SegmentedPicker } from "../inputs";
|
|
3
|
+
import { useTabs } from "./TabsHandler";import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
export function TabsMenu(props) {
|
|
6
|
+
var _useTabs = useTabs(),activeKey = _useTabs.activeKey,items = _useTabs.items,_onChange = _useTabs.onChange;
|
|
7
|
+
|
|
8
|
+
return _jsx(Menu, Object.assign({ items: items, activeKey: activeKey, onChange: function onChange(_ref) {var key = _ref.key;return _onChange(key);} }, props));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function TabsSegmentedMenu(props) {
|
|
12
|
+
var _useTabs2 = useTabs(),activeKey = _useTabs2.activeKey,items = _useTabs2.items,onChange = _useTabs2.onChange;
|
|
13
|
+
|
|
14
|
+
return _jsx(SegmentedPicker, Object.assign({ options: items, valueKey: "key", value: activeKey, onChange: onChange }, props));
|
|
15
|
+
}
|