@ainias42/react-bootstrap-mobile 0.2.16 → 1.0.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/bootstrapReactMobile.ts +0 -1
- package/dist/bootstrapReactMobile.d.ts +0 -1
- package/dist/bootstrapReactMobile.js +190 -194
- package/dist/bootstrapReactMobile.js.map +1 -1
- package/dist/src/Components/ActionSheet/ActionSheet.d.ts +8 -6
- package/dist/src/Components/Clickable/Clickable.d.ts +5 -3
- package/dist/src/Components/Dialog/DialogContainer.d.ts +4 -2
- package/dist/src/Components/FormElements/Controller/ColorInputController.d.ts +5 -3
- package/dist/src/Components/FormElements/Controller/InputController.d.ts +5 -4
- package/dist/src/Components/FormElements/Controller/MultipleFileInputController.d.ts +5 -3
- package/dist/src/Components/FormElements/Controller/PasswordInputController.d.ts +5 -4
- package/dist/src/Components/FormElements/Controller/SelectController.d.ts +5 -3
- package/dist/src/Components/FormElements/Controller/SendFormContext.d.ts +0 -1
- package/dist/src/Components/FormElements/Controller/SwitchController.d.ts +5 -3
- package/dist/src/Components/FormElements/Controller/TextareaController.d.ts +5 -4
- package/dist/src/Components/FormElements/Controller/withHookController.d.ts +7 -4
- package/dist/src/Components/FormElements/Input/Input.d.ts +4 -2
- package/dist/src/Components/FormElements/Input/PasswordInput/PasswordInput.d.ts +3 -1
- package/dist/src/Components/FormElements/Textarea/Textarea.d.ts +5 -3
- package/dist/src/Components/FormElements/hooks/useOnChangeDone.d.ts +1 -1
- package/dist/src/Components/FullScreen/FullScreen.d.ts +3 -1
- package/dist/src/Components/Hooks/useMousePosition.d.ts +1 -2
- package/dist/src/Components/Layout/Block.d.ts +8 -5
- package/dist/src/Components/Layout/Flex.d.ts +5 -5
- package/dist/src/Components/Layout/Grid/Grid.d.ts +4 -2
- package/dist/src/Components/Layout/Grow.d.ts +4 -1
- package/dist/src/Components/Layout/Inline.d.ts +5 -5
- package/dist/src/Components/Layout/InlineBlock.d.ts +5 -5
- package/dist/src/Components/Layout/View.d.ts +8 -3
- package/dist/src/Components/Layout/ViewWithoutListeners.d.ts +4 -2
- package/dist/src/Components/List/List.d.ts +4 -2
- package/dist/src/Components/RbmComponentProps.d.ts +1 -0
- package/dist/src/Components/SpoilerList/Spoiler/Spoiler.d.ts +2 -2
- package/dist/src/Components/Text/Text.d.ts +3 -1
- package/dist/src/Components/Toast/ToastContext.d.ts +3 -4
- package/dist/src/helper/withRestrictedChildren.d.ts +2 -2
- package/package.json +7 -7
- package/src/Components/ActionSheet/ActionSheet.tsx +12 -15
- package/src/Components/Clickable/Clickable.tsx +5 -8
- package/src/Components/Dialog/DialogContainer.tsx +7 -5
- package/src/Components/FormElements/Controller/withHookController.tsx +12 -8
- package/src/Components/FormElements/Input/Input.tsx +5 -5
- package/src/Components/FormElements/Input/PasswordInput/PasswordInput.tsx +4 -5
- package/src/Components/FormElements/Textarea/Textarea.tsx +18 -17
- package/src/Components/FullScreen/FullScreen.tsx +7 -7
- package/src/Components/Hooks/useDelayed.ts +2 -1
- package/src/Components/Hooks/useOnMount.ts +1 -1
- package/src/Components/Hooks/useRerender.ts +1 -1
- package/src/Components/Layout/Block.tsx +10 -12
- package/src/Components/Layout/Flex.tsx +7 -11
- package/src/Components/Layout/Grid/Grid.tsx +4 -7
- package/src/Components/Layout/Grow.tsx +3 -2
- package/src/Components/Layout/Inline.tsx +6 -12
- package/src/Components/Layout/InlineBlock.tsx +6 -12
- package/src/Components/Layout/View.tsx +7 -6
- package/src/Components/Layout/ViewWithoutListeners.tsx +8 -7
- package/src/Components/List/List.tsx +5 -3
- package/src/Components/RbmComponentProps.ts +1 -0
- package/src/Components/SpoilerList/Spoiler/Spoiler.tsx +2 -2
- package/src/Components/Text/Text.tsx +3 -1
- package/dist/src/helper/withForwardRef.d.ts +0 -7
- package/src/helper/withForwardRef.ts +0 -28
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
3
|
+
import { ForwardedRef } from 'react';
|
|
2
4
|
import { IconSource } from '../Icon/Icon';
|
|
3
5
|
export type ActionSheetAction<ActionData> = {
|
|
4
6
|
name: string;
|
|
@@ -7,15 +9,15 @@ export type ActionSheetAction<ActionData> = {
|
|
|
7
9
|
actionData?: ActionData;
|
|
8
10
|
isDeleteAction?: boolean;
|
|
9
11
|
};
|
|
12
|
+
export type ActionSheetHandle = {
|
|
13
|
+
show: () => void;
|
|
14
|
+
hide: () => void;
|
|
15
|
+
};
|
|
10
16
|
export type ActionSheetProps = RbmComponentProps<{
|
|
11
17
|
title?: string;
|
|
12
18
|
actions: ActionSheetAction<any>[];
|
|
13
19
|
cancelText?: string;
|
|
14
20
|
onClose?: () => void;
|
|
21
|
+
ref?: ForwardedRef<ActionSheetHandle>;
|
|
15
22
|
}>;
|
|
16
|
-
export
|
|
17
|
-
show: () => void;
|
|
18
|
-
hide: () => void;
|
|
19
|
-
};
|
|
20
|
-
declare const ActionSheetMemo: import("../../helper/withForwardRef").RefComponent<ActionSheetProps, ActionSheetHandle>;
|
|
21
|
-
export { ActionSheetMemo as ActionSheet };
|
|
23
|
+
export declare const ActionSheet: ({ title, actions, cancelText, className, onClose, style, ref }: ActionSheetProps) => React.JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
2
3
|
import { OptionalListener } from '../Hooks/useListener';
|
|
3
|
-
import { MouseEvent as ReactMouseEvent, MouseEvent, PointerEvent } from 'react';
|
|
4
|
+
import { MouseEvent as ReactMouseEvent, ForwardedRef, MouseEvent, PointerEvent } from 'react';
|
|
4
5
|
type OnClickListener<Data> = OptionalListener<'onClick', Data>;
|
|
5
6
|
type OnPointerDownListener<Data> = OptionalListener<'onPointerDown', Data, PointerEvent>;
|
|
6
7
|
type OnPointerUpListener<Data> = OptionalListener<'onPointerUp', Data, PointerEvent>;
|
|
@@ -19,6 +20,7 @@ export type ClickableProps<OnClickData, OnMouseDownData, OnMouseMoveData, OnMous
|
|
|
19
20
|
tabIndex?: number;
|
|
20
21
|
draggable?: boolean;
|
|
21
22
|
title?: string;
|
|
23
|
+
ref?: ForwardedRef<HrefType extends string ? HTMLAnchorElement : HTMLSpanElement>;
|
|
22
24
|
} & OnClickListener<OnClickData> & OnPointerDownListener<OnMouseDownData> & OnPointerMoveListener<OnMouseMoveData> & OnPointerUpListener<OnMouseUpData> & OnDropListener<OnDropData> & OnDragStartListener<OnDragStartData> & OnDragOverListener<OnDragOverData> & OptionalListener<'onClickCapture', OnClickCaptureData> & OptionalListener<'onMouseEnter', OnMouseEnterData> & OptionalListener<'onMouseLeave', OnMouseLeaveData, MouseEvent | ReactMouseEvent> & OptionalListener<'onDoubleClick', OnDoubleClickData>>;
|
|
23
|
-
declare const
|
|
24
|
-
export {
|
|
25
|
+
export declare const Clickable: <OnClickData, OnPointerDownData, OnPointerMoveData, OnPointerUpData, OnClickCaptureData, OnDropData, OnDragStartData, OnDragOverData, OnMouseEnterData, OnMouseLeaveData, OnDoubleClickData, HrefType extends string | undefined>({ className, children, style, href, target, id, interactable, preventDefault, stopPropagation, useReactOnMouseLeave, tabIndex, draggable, title, ref, ...clickData }: ClickableProps<OnClickData, OnPointerDownData, OnPointerMoveData, OnPointerUpData, OnClickCaptureData, OnDropData, OnDragStartData, OnDragOverData, OnMouseEnterData, OnMouseLeaveData, OnDoubleClickData, HrefType>) => React.JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ForwardedRef, PropsWithChildren } from 'react';
|
|
2
3
|
import { ShowDialog } from './DialogContext';
|
|
3
4
|
export type DialogContainerProps = PropsWithChildren<{
|
|
4
5
|
dialogClassName?: string;
|
|
6
|
+
ref?: ForwardedRef<DialogContainerRef>;
|
|
5
7
|
}>;
|
|
6
8
|
export type DialogContainerRef = {
|
|
7
9
|
showDialog: ShowDialog;
|
|
8
10
|
};
|
|
9
|
-
export declare const DialogContainer:
|
|
11
|
+
export declare const DialogContainer: ({ children, dialogClassName, ref }: DialogContainerProps) => React.JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare const ColorInputController: import("
|
|
2
|
-
name:
|
|
3
|
-
}
|
|
1
|
+
export declare const ColorInputController: <Values extends import("react-hook-form").FieldValues, Name extends import("react-hook-form").Path<Values> = import("react-hook-form").Path<Values>>({ name, ref, ...otherProps }: Omit<import("../ColorInput/ColorInput").ColorInputProps<unknown>, "onBlur" | "name" | "value" | "onChangeColor"> & {
|
|
2
|
+
name: Name;
|
|
3
|
+
} & {
|
|
4
|
+
ref?: import("react").ForwardedRef<never> | undefined;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const InputController: <Values extends import("react-hook-form").FieldValues, Name extends import("react-hook-form").Path<Values> = import("react-hook-form").Path<Values>>({ name, ref, ...otherProps }: Omit<import("../Input/Input").InputProps<unknown, unknown, unknown>, "onBlur" | "name" | "value" | "onChangeText"> & {
|
|
2
|
+
name: Name;
|
|
3
|
+
} & {
|
|
4
|
+
ref?: import("react").ForwardedRef<HTMLInputElement> | undefined;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare const MultipleFileInputController: import("
|
|
2
|
-
name:
|
|
3
|
-
}
|
|
1
|
+
export declare const MultipleFileInputController: <Values extends import("react-hook-form").FieldValues, Name extends import("react-hook-form").Path<Values> = import("react-hook-form").Path<Values>>({ name, ref, ...otherProps }: Omit<import("../Input/FileInput/MultipleFileInput").MultipleFileInputProps<unknown>, "onBlur" | "name" | "value" | "onChangeFiles"> & {
|
|
2
|
+
name: Name;
|
|
3
|
+
} & {
|
|
4
|
+
ref?: import("react").ForwardedRef<never> | undefined;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const PasswordInputController: <Values extends import("react-hook-form").FieldValues, Name extends import("react-hook-form").Path<Values> = import("react-hook-form").Path<Values>>({ name, ref, ...otherProps }: Omit<import("../Input/PasswordInput/PasswordInput").PasswordInputProps<unknown, unknown, unknown>, "onBlur" | "name" | "value" | "onChangeText"> & {
|
|
2
|
+
name: Name;
|
|
3
|
+
} & {
|
|
4
|
+
ref?: import("react").ForwardedRef<HTMLInputElement> | undefined;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare const SelectController: import("
|
|
2
|
-
name:
|
|
3
|
-
}
|
|
1
|
+
export declare const SelectController: <Values extends import("react-hook-form").FieldValues, Name extends import("react-hook-form").Path<Values> = import("react-hook-form").Path<Values>>({ name, ref, ...otherProps }: Omit<import("../Select/Select").SelectProps<unknown>, "onBlur" | "name" | "value" | "onChangeValue"> & {
|
|
2
|
+
name: Name;
|
|
3
|
+
} & {
|
|
4
|
+
ref?: import("react").ForwardedRef<never> | undefined;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export declare const SwitchController: import("
|
|
2
|
-
name:
|
|
3
|
-
}
|
|
1
|
+
export declare const SwitchController: <Values extends import("react-hook-form").FieldValues, Name extends import("react-hook-form").Path<Values> = import("react-hook-form").Path<Values>>({ name, ref, ...otherProps }: Omit<import("../Switch/Switch").SwitchProps<unknown>, "onBlur" | "name" | "value" | "onChangeChecked"> & {
|
|
2
|
+
name: Name;
|
|
3
|
+
} & {
|
|
4
|
+
ref?: import("react").ForwardedRef<never> | undefined;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const TextareaController: <Values extends import("react-hook-form").FieldValues, Name extends import("react-hook-form").Path<Values> = import("react-hook-form").Path<Values>>({ name, ref, ...otherProps }: Omit<import("../Textarea/Textarea").TextareaProps<unknown, unknown>, "onBlur" | "name" | "value" | "onChangeText"> & {
|
|
2
|
+
name: Name;
|
|
3
|
+
} & {
|
|
4
|
+
ref?: import("react").ForwardedRef<HTMLTextAreaElement> | undefined;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import React, { ComponentProps, ComponentType } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React, { ComponentProps, ComponentType, ForwardedRef } from "react";
|
|
2
|
+
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
|
+
export declare function withHookController<C extends ComponentType<any>, OnChangeProp extends keyof ComponentProps<C>>(Comp: C, onChangeProp: OnChangeProp, emptyValue?: any): <Values extends FieldValues, Name extends FieldPath<Values> = FieldPath<Values>>({ name, ref, ...otherProps }: (Omit<React.ComponentProps<C>, "onBlur" | "name" | "value" | OnChangeProp> & {
|
|
4
|
+
name: Name;
|
|
5
|
+
}) & {
|
|
6
|
+
ref?: ForwardedRef<React.ComponentRef<C>>;
|
|
7
|
+
}) => React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ForwardedRef, InputHTMLAttributes } from 'react';
|
|
2
3
|
import { RbmComponentProps } from '../../RbmComponentProps';
|
|
3
4
|
import { Override } from '../../../TypeHelpers';
|
|
4
5
|
import { OptionalListener } from '../../Hooks/useListener';
|
|
@@ -8,5 +9,6 @@ export type InputProps<OnChangeData, OnBlurData, OnChangeDoneData> = RbmComponen
|
|
|
8
9
|
onChangeText?: (newText: string) => void;
|
|
9
10
|
onEnter?: (newText: string) => void;
|
|
10
11
|
error?: string;
|
|
12
|
+
ref?: ForwardedRef<HTMLInputElement>;
|
|
11
13
|
} & OptionalListener<'onChange', OnChangeData> & OptionalListener<'onBlur', OnBlurData> & OptionalListener<'onChangeDone', OnChangeDoneData>>>;
|
|
12
|
-
export declare const Input:
|
|
14
|
+
export declare const Input: <OnChangeData, OnBlurData, OnChangeDoneData>({ label, className, style, onKeyDown, inline, value, error, onChangeText, onEnter, ref, ...otherProps }: InputProps<OnChangeData, OnBlurData, OnChangeDoneData>) => React.JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import React, { ForwardedRef } from 'react';
|
|
1
2
|
import { InputProps } from '../Input';
|
|
2
3
|
import { DistributiveOmit } from '../../../../helper/DistributiveOmit';
|
|
3
4
|
export type PasswordInputProps<OnChangeData, OnBlurData, OnChangeEndData> = DistributiveOmit<InputProps<OnChangeData, OnBlurData, OnChangeEndData>, 'type' | "onChangeText" | "onEnter"> & {
|
|
4
5
|
onChangeText?: (newText: string) => void;
|
|
5
6
|
onEnter?: (newText: string) => void;
|
|
7
|
+
ref?: ForwardedRef<HTMLInputElement>;
|
|
6
8
|
};
|
|
7
|
-
export declare const PasswordInput:
|
|
9
|
+
export declare const PasswordInput: <OnChangeData, OnBlurData, OnChangeEndData>({ className, style, ref, ...props }: PasswordInputProps<OnChangeData, OnBlurData, OnChangeEndData>) => React.JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { RbmComponentProps } from '../../RbmComponentProps';
|
|
2
3
|
import { Override } from '../../../TypeHelpers';
|
|
3
|
-
import { TextareaHTMLAttributes,
|
|
4
|
+
import { TextareaHTMLAttributes, CSSProperties, ForwardedRef } from 'react';
|
|
4
5
|
import { OptionalListener } from '../../Hooks/useListener';
|
|
5
6
|
export type TextareaProps<OnChangeData, OnChangeDoneData> = RbmComponentProps<Override<TextareaHTMLAttributes<HTMLTextAreaElement>, {
|
|
6
7
|
label?: string;
|
|
@@ -8,7 +9,8 @@ export type TextareaProps<OnChangeData, OnChangeDoneData> = RbmComponentProps<Ov
|
|
|
8
9
|
onEnter?: (newText: string) => void;
|
|
9
10
|
onEscape?: (newText: string) => void;
|
|
10
11
|
textareaStyles?: CSSProperties & Record<`--${string}`, string | number | undefined>;
|
|
11
|
-
containerRef?:
|
|
12
|
+
containerRef?: ForwardedRef<HTMLLabelElement>;
|
|
13
|
+
ref?: ForwardedRef<HTMLTextAreaElement>;
|
|
12
14
|
error?: string;
|
|
13
15
|
} & OptionalListener<'onChange', OnChangeData> & OptionalListener<'onChangeDone', OnChangeDoneData>>>;
|
|
14
|
-
export declare const Textarea:
|
|
16
|
+
export declare const Textarea: <OnChangeData, OnChangeDoneData>({ label, className, style, onKeyUp, onChangeText, onEnter, onEscape, textareaStyles, containerRef, ref, error, ...otherProps }: TextareaProps<OnChangeData, OnChangeDoneData>) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
|
-
export declare function useOnChangeDone(onChangeDone: (ev: any) => void, ref?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null>):
|
|
2
|
+
export declare function useOnChangeDone(onChangeDone: (ev: any) => void, ref?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null>): MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
@@ -2,7 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import { Override } from '../../TypeHelpers';
|
|
4
4
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
5
|
-
|
|
5
|
+
import { JSX } from "react/jsx-runtime";
|
|
6
|
+
import IntrinsicElements = JSX.IntrinsicElements;
|
|
7
|
+
export type FullScreenProps<AsType extends keyof IntrinsicElements> = RbmComponentProps<Override<ComponentPropsWithoutRef<AsType>, {
|
|
6
8
|
as?: AsType;
|
|
7
9
|
fullscreenKey?: string;
|
|
8
10
|
onEnterFullscreen?: () => void;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="react" />
|
|
1
|
+
import * as React from 'react';
|
|
3
2
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
3
|
+
import { ComponentRef, ForwardedRef } from 'react';
|
|
4
4
|
import { ViewWithoutListenersProps } from './ViewWithoutListeners';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
5
|
+
import { JSX } from "react/jsx-runtime";
|
|
6
|
+
import IntrinsicElements = JSX.IntrinsicElements;
|
|
7
|
+
export type BlockProps<AsType extends keyof IntrinsicElements> = RbmComponentProps<ViewWithoutListenersProps<AsType> & {
|
|
8
|
+
ref?: ForwardedRef<ComponentRef<AsType>>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const Block: <AsType extends keyof JSX.IntrinsicElements = "div">({ children, as, className, ref, ...props }: BlockProps<AsType>) => React.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="react" />
|
|
1
|
+
import * as React from 'react';
|
|
3
2
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
4
3
|
import { ViewWithoutListenersProps } from './ViewWithoutListeners';
|
|
5
|
-
|
|
4
|
+
import { JSX } from "react/jsx-runtime";
|
|
5
|
+
import IntrinsicElements = JSX.IntrinsicElements;
|
|
6
|
+
export type FlexProps<AsType extends keyof IntrinsicElements> = RbmComponentProps<ViewWithoutListenersProps<AsType> & {
|
|
6
7
|
horizontal?: boolean;
|
|
7
8
|
grow?: boolean;
|
|
8
9
|
}>;
|
|
9
|
-
declare const
|
|
10
|
-
export { tmp as Flex };
|
|
10
|
+
export declare const Flex: <AsType extends keyof JSX.IntrinsicElements = "div">({ children, as, className, horizontal, ref, grow, ...props }: FlexProps<AsType>) => React.JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { RbmComponentProps } from '../../RbmComponentProps';
|
|
3
|
+
import { ForwardedRef } from 'react';
|
|
2
4
|
export type GridProps = RbmComponentProps<{
|
|
3
5
|
columns?: number;
|
|
4
6
|
rows?: number;
|
|
5
7
|
useContainerWidth?: boolean;
|
|
8
|
+
ref?: ForwardedRef<HTMLDivElement>;
|
|
6
9
|
}>;
|
|
7
|
-
declare const
|
|
8
|
-
export { GridMemo as Grid };
|
|
10
|
+
export declare const Grid: ({ style, children, columns, rows, useContainerWidth, ref, className, __allowChildren }: GridProps) => React.JSX.Element;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
3
|
+
import { ForwardedRef } from "react";
|
|
2
4
|
export type GrowProps = RbmComponentProps<{
|
|
3
5
|
center?: boolean;
|
|
4
6
|
weight?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
|
+
ref?: ForwardedRef<HTMLDivElement>;
|
|
5
8
|
}>;
|
|
6
|
-
export declare const Grow:
|
|
9
|
+
export declare const Grow: ({ className, children, center, style, weight, ref }: GrowProps) => React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="react" />
|
|
1
|
+
import * as React from 'react';
|
|
3
2
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
4
3
|
import { ViewWithoutListenersProps } from './ViewWithoutListeners';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
4
|
+
import { JSX } from "react/jsx-runtime";
|
|
5
|
+
import IntrinsicElements = JSX.IntrinsicElements;
|
|
6
|
+
export type InlineProps<AsType extends keyof IntrinsicElements> = RbmComponentProps<ViewWithoutListenersProps<AsType>>;
|
|
7
|
+
export declare const Inline: <AsType extends keyof JSX.IntrinsicElements = "span">({ children, as, className, ...props }: InlineProps<AsType>) => React.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="react" />
|
|
1
|
+
import * as React from 'react';
|
|
3
2
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
4
3
|
import { ViewWithoutListenersProps } from './ViewWithoutListeners';
|
|
5
|
-
|
|
4
|
+
import { JSX } from "react/jsx-runtime";
|
|
5
|
+
import IntrinsicElements = JSX.IntrinsicElements;
|
|
6
|
+
export type InlineBlockProps<AsType extends keyof IntrinsicElements> = RbmComponentProps<ViewWithoutListenersProps<AsType> & {
|
|
6
7
|
id?: string;
|
|
7
8
|
title?: string;
|
|
8
9
|
}>;
|
|
9
|
-
declare const
|
|
10
|
-
export { InlineBlockMemo as InlineBlock };
|
|
10
|
+
export declare const InlineBlock: <AsType extends keyof JSX.IntrinsicElements = "span">({ children, as, className, ...props }: InlineBlockProps<AsType>) => React.JSX.Element;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ComponentRef, ForwardedRef, PropsWithChildren } from 'react';
|
|
3
3
|
import { Override } from '../../TypeHelpers';
|
|
4
|
-
|
|
4
|
+
import { JSX } from "react/jsx-runtime";
|
|
5
|
+
import IntrinsicElements = JSX.IntrinsicElements;
|
|
6
|
+
export type ViewProps<AsType extends keyof IntrinsicElements> = PropsWithChildren<Override<React.ComponentPropsWithoutRef<AsType>, {
|
|
5
7
|
as?: AsType;
|
|
6
8
|
children?: React.ReactNode;
|
|
9
|
+
ref?: ForwardedRef<ComponentRef<AsType>>;
|
|
7
10
|
}>>;
|
|
8
|
-
export declare const View:
|
|
11
|
+
export declare const View: <AsType extends keyof JSX.IntrinsicElements>({ children, as, ref, ...otherProps }: ViewProps<AsType>) => React.ReactElement<Omit<ViewProps<AsType>, "ref" | "as" | "children"> & {
|
|
12
|
+
ref: React.ForwardedRef<React.ComponentRef<AsType>> | undefined;
|
|
13
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DOMAttributes } from 'react';
|
|
3
3
|
import { ViewProps } from './View';
|
|
4
|
-
|
|
4
|
+
import { JSX } from "react/jsx-runtime";
|
|
5
|
+
import IntrinsicElements = JSX.IntrinsicElements;
|
|
6
|
+
export type ViewWithoutListenersProps<AsType extends keyof IntrinsicElements> = Omit<ViewProps<AsType>, keyof DOMAttributes<AsType>> & {
|
|
5
7
|
children?: React.ReactNode;
|
|
6
8
|
dangerouslySetInnerHTML?: {
|
|
7
9
|
__html: string | TrustedHTML;
|
|
8
10
|
} | undefined;
|
|
9
11
|
};
|
|
10
|
-
export declare const ViewWithoutListeners:
|
|
12
|
+
export declare const ViewWithoutListeners: <AsType extends keyof JSX.IntrinsicElements>({ children, ref, ...props }: ViewWithoutListenersProps<AsType>) => React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CSSProperties, ForwardedRef, ReactElement, ReactNode } from 'react';
|
|
2
3
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
3
4
|
import { FixedSizeList, FixedSizeListProps } from 'react-window';
|
|
4
5
|
export type ListProps<ItemType> = RbmComponentProps<{
|
|
@@ -9,5 +10,6 @@ export type ListProps<ItemType> = RbmComponentProps<{
|
|
|
9
10
|
keyExtractor?: (item: ItemType, index: number) => string;
|
|
10
11
|
onItemsRendered?: FixedSizeListProps<ItemType>['onItemsRendered'];
|
|
11
12
|
autoSizeClassName?: string;
|
|
13
|
+
ref?: ForwardedRef<FixedSizeList<ItemType>>;
|
|
12
14
|
}>;
|
|
13
|
-
export declare const List:
|
|
15
|
+
export declare const List: <ItemType>({ items, renderItem, itemHeight: initialItemHeight, className, style, onItemsRendered, autoSizeClassName, ref, }: ListProps<ItemType>) => React.JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { Recursive } from '../TypeHelpers';
|
|
3
|
+
import { JSX } from "react/jsx-runtime";
|
|
3
4
|
export type RbmChildWithoutString = Recursive<JSX.Element | undefined | null | RbmChildWithoutString[]> | false;
|
|
4
5
|
export type WithNoStringProps = {
|
|
5
6
|
children?: RbmChildWithoutString;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RbmComponentProps } from '../../RbmComponentProps';
|
|
3
|
-
import {
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
4
|
import { OptionalListener } from '../../Hooks/useListener';
|
|
5
5
|
import { IconSource } from '../../Icon/Icon';
|
|
6
6
|
export type SpoilerProps<OnClickData> = RbmComponentProps<{
|
|
7
|
-
title:
|
|
7
|
+
title: ReactNode;
|
|
8
8
|
initialOpen?: boolean;
|
|
9
9
|
open?: boolean;
|
|
10
10
|
onlyTitleToggles?: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Recursive, ValueOf } from '../../TypeHelpers';
|
|
3
3
|
import { ViewProps } from '../Layout/View';
|
|
4
|
+
import { JSX } from "react/jsx-runtime";
|
|
5
|
+
import IntrinsicElements = JSX.IntrinsicElements;
|
|
4
6
|
export declare const TEXT_PRIO: {
|
|
5
7
|
primary: string;
|
|
6
8
|
secondary: string;
|
|
@@ -15,7 +17,7 @@ export declare const TEXT_SIZE: {
|
|
|
15
17
|
xLarge: string;
|
|
16
18
|
xxLarge: string;
|
|
17
19
|
};
|
|
18
|
-
export type TextProps<AsType extends keyof
|
|
20
|
+
export type TextProps<AsType extends keyof IntrinsicElements> = {
|
|
19
21
|
block?: boolean;
|
|
20
22
|
prio?: ValueOf<typeof TEXT_PRIO>;
|
|
21
23
|
size?: ValueOf<typeof TEXT_SIZE>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const ToastContext: import("react").Context<(<Data>(text: string, action?: {
|
|
3
2
|
name: string;
|
|
4
3
|
onClick: (data?: Data) => void;
|
|
@@ -6,6 +5,6 @@ export declare const ToastContext: import("react").Context<(<Data>(text: string,
|
|
|
6
5
|
}, duration?: number) => void)>;
|
|
7
6
|
export declare function useToast(): <Data>(text: string, action?: {
|
|
8
7
|
name: string;
|
|
9
|
-
onClick: (data?: Data
|
|
10
|
-
onClickData?: Data
|
|
11
|
-
}
|
|
8
|
+
onClick: (data?: Data) => void;
|
|
9
|
+
onClickData?: Data;
|
|
10
|
+
}, duration?: number) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ComponentType, ForwardedRef, ReactElement } from 'react';
|
|
2
2
|
import { RbmComponentProps } from '../Components/RbmComponentProps';
|
|
3
3
|
export declare const RESTRICT_CHILDREN: {
|
|
4
|
-
allowChildren:
|
|
4
|
+
allowChildren: undefined | "all" | "html" | "text";
|
|
5
5
|
};
|
|
6
|
-
export declare function withRestrictedChildren<C extends ComponentType<RbmComponentProps<Record<string, any>>>>(Component: C, defaultAllowChildren?: typeof RESTRICT_CHILDREN['allowChildren']): (props: React.ComponentProps<C>, ref:
|
|
6
|
+
export declare function withRestrictedChildren<C extends ComponentType<RbmComponentProps<Record<string, any>>>>(Component: C, defaultAllowChildren?: typeof RESTRICT_CHILDREN['allowChildren']): (props: React.ComponentProps<C>, ref: ForwardedRef<React.ComponentRef<C>>) => ReactElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainias42/react-bootstrap-mobile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Mobile React Components using Bootstrap",
|
|
5
5
|
"main": "dist/bootstrapReactMobile",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
38
38
|
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
39
39
|
"bootstrap": "^5.3.3",
|
|
40
|
-
"react": "
|
|
40
|
+
"react": "^19.1.1",
|
|
41
41
|
"react-beautiful-dnd": "^13.1.1",
|
|
42
42
|
"react-hook-form": "^7.53.0"
|
|
43
43
|
},
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"@fortawesome/free-regular-svg-icons": "^6.5.2",
|
|
53
53
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
54
54
|
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
55
|
-
"@types/react": "
|
|
55
|
+
"@types/react": "^19.1.11",
|
|
56
56
|
"@types/react-beautiful-dnd": "^13.1.8",
|
|
57
|
-
"@types/react-dom": "
|
|
57
|
+
"@types/react-dom": "^19.1.7",
|
|
58
58
|
"@types/react-table": "^7.7.20",
|
|
59
59
|
"@types/react-window": "^1.8.8",
|
|
60
60
|
"@types/react-window-infinite-loader": "^1.0.9",
|
|
@@ -78,15 +78,15 @@
|
|
|
78
78
|
"loader-utils": "3.2.1",
|
|
79
79
|
"mini-css-extract-plugin": "^2.9.0",
|
|
80
80
|
"prettier": "^3.2.5",
|
|
81
|
-
"react": "
|
|
81
|
+
"react": "^19.1.1",
|
|
82
82
|
"react-beautiful-dnd": "^13.1.1",
|
|
83
|
-
"react-dom": "
|
|
83
|
+
"react-dom": "^19.1.1",
|
|
84
84
|
"react-hook-form": "^7.53.0",
|
|
85
85
|
"sass": "^1.77.2",
|
|
86
86
|
"sass-loader": "^14.2.1",
|
|
87
87
|
"terser-webpack-plugin": "^5.3.10",
|
|
88
88
|
"ts-loader": "^9.5.1",
|
|
89
|
-
"typescript": "^5.
|
|
89
|
+
"typescript": "^5.9.2",
|
|
90
90
|
"webpack": "^5.91.0",
|
|
91
91
|
"webpack-cli": "^5.1.4",
|
|
92
92
|
"webpack-dev-server": "^5.0.4"
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
3
|
-
import {
|
|
3
|
+
import { ForwardedRef, useCallback, useImperativeHandle, useState } from 'react';
|
|
4
4
|
import { Clickable } from '../Clickable/Clickable';
|
|
5
5
|
import { Container } from '../Layout/Container';
|
|
6
6
|
import { faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
7
7
|
import { Icon, IconSource } from '../Icon/Icon';
|
|
8
|
-
|
|
9
8
|
import styles from './actionSheet.scss';
|
|
10
|
-
import { withForwardRef } from '../../helper/withForwardRef';
|
|
11
9
|
import classNames from 'classnames';
|
|
12
10
|
import { InlineBlock } from '../Layout/InlineBlock';
|
|
13
11
|
import { Text } from '../Text/Text';
|
|
14
12
|
import { Flex } from '../Layout/Flex';
|
|
15
13
|
import { Block } from '../Layout/Block';
|
|
14
|
+
import { withMemo } from "../../helper/withMemo";
|
|
16
15
|
|
|
17
16
|
export type ActionSheetAction<ActionData> = {
|
|
18
17
|
name: string;
|
|
@@ -22,21 +21,22 @@ export type ActionSheetAction<ActionData> = {
|
|
|
22
21
|
isDeleteAction?: boolean;
|
|
23
22
|
};
|
|
24
23
|
|
|
24
|
+
export type ActionSheetHandle = {
|
|
25
|
+
show: () => void;
|
|
26
|
+
hide: () => void;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
|
|
25
30
|
export type ActionSheetProps = RbmComponentProps<{
|
|
26
31
|
title?: string;
|
|
27
32
|
actions: ActionSheetAction<any>[];
|
|
28
33
|
cancelText?: string;
|
|
29
34
|
onClose?: () => void;
|
|
35
|
+
ref?: ForwardedRef<ActionSheetHandle>
|
|
30
36
|
}>;
|
|
31
37
|
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
hide: () => void;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
function ActionSheet(
|
|
38
|
-
{ title, actions, cancelText = 'Cancel', className, onClose, style }: ActionSheetProps,
|
|
39
|
-
ref: Ref<ActionSheetHandle>
|
|
38
|
+
export const ActionSheet = withMemo(function ActionSheet(
|
|
39
|
+
{ title, actions, cancelText = 'Cancel', className, onClose, style, ref }: ActionSheetProps,
|
|
40
40
|
) {
|
|
41
41
|
const [isOpen, setIsOpen] = useState(false);
|
|
42
42
|
|
|
@@ -109,7 +109,4 @@ function ActionSheet(
|
|
|
109
109
|
</Container>
|
|
110
110
|
</Clickable>
|
|
111
111
|
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const ActionSheetMemo = withForwardRef<ActionSheetProps, ActionSheetHandle>(ActionSheet, styles);
|
|
115
|
-
export { ActionSheetMemo as ActionSheet };
|
|
112
|
+
}, styles);
|