@ainias42/react-bootstrap-mobile 0.1.11 → 0.1.13
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/bin/updateCopies.js +1 -1
- package/dist/bootstrapReactMobile.js +1005 -914
- package/dist/bootstrapReactMobile.js.map +1 -1
- package/dist/src/Components/Card/Card.d.ts +2 -1
- package/dist/src/Components/Dialog/AlertDialog.d.ts +2 -2
- package/dist/src/Components/Dialog/ButtonDialog.d.ts +2 -2
- package/dist/src/Components/Dialog/ConfirmDialog.d.ts +2 -2
- package/dist/src/Components/Dialog/Dialog.d.ts +2 -1
- package/dist/src/Components/Dialog/DialogBackground.d.ts +2 -2
- package/dist/src/Components/Dialog/DialogContainer.d.ts +2 -1
- package/dist/src/Components/DragAndDrop/DragItem.d.ts +2 -2
- package/dist/src/Components/DragAndDrop/DropArea.d.ts +2 -2
- package/dist/src/Components/FormElements/Button/Button.d.ts +2 -1
- package/dist/src/Components/FormElements/CheckBox/Checkbox.d.ts +2 -1
- package/dist/src/Components/FormElements/ColorInput/ColorInput.d.ts +2 -2
- package/dist/src/Components/FormElements/ImageInput/ImageInput.d.ts +2 -1
- package/dist/src/Components/FormElements/ImageInput/MultipleFileInput.d.ts +2 -1
- package/dist/src/Components/FormElements/Input/HiddenInput.d.ts +2 -2
- package/dist/src/Components/FormElements/SearchSelectInput/SearchSelectInput.d.ts +2 -1
- package/dist/src/Components/FormElements/Select/Select.d.ts +2 -1
- package/dist/src/Components/FormElements/Slider/Slider.d.ts +2 -1
- package/dist/src/Components/FormElements/Switch/Switch.d.ts +2 -1
- package/dist/src/Components/FormElements/Textarea/Textarea.d.ts +2 -1
- package/dist/src/Components/Hooks/useOnMount.d.ts +1 -1
- package/dist/src/Components/Icon/Icon.d.ts +4 -3
- package/dist/src/Components/Image/Image.d.ts +1 -1
- package/dist/src/Components/InViewport/InViewport.d.ts +2 -2
- package/dist/src/Components/Layout/Container.d.ts +2 -1
- package/dist/src/Components/Layout/Grid/Grid.d.ts +2 -2
- package/dist/src/Components/Layout/Grid/GridItem.d.ts +2 -2
- package/dist/src/Components/Layout/Grow.d.ts +2 -2
- package/dist/src/Components/List/BulletList/BulletList.d.ts +2 -2
- package/dist/src/Components/List/BulletList/ListItem.d.ts +2 -2
- package/dist/src/Components/List/List.d.ts +2 -1
- package/dist/src/Components/LoadingArea/LoadingArea.d.ts +2 -2
- package/dist/src/Components/LoadingCircle/LoadingCircle.d.ts +2 -2
- package/dist/src/Components/Menu/Menu.d.ts +2 -1
- package/dist/src/Components/SizeCalculator/SizeCalculator.d.ts +2 -2
- package/dist/src/Components/SpoilerList/Spoiler/Spoiler.d.ts +5 -4
- package/dist/src/Components/SpoilerList/SpoilerList.d.ts +2 -1
- package/dist/src/Components/TabBar/TabBar.d.ts +2 -1
- package/dist/src/Components/TabBar/TabBarButton.d.ts +2 -2
- package/dist/src/Components/Table/Table.d.ts +1 -1
- package/dist/src/Components/Text/Heading.d.ts +2 -2
- package/dist/src/Components/Text/Text.d.ts +2 -2
- package/dist/src/Components/Toast/Toast.d.ts +2 -2
- package/dist/src/Components/Toast/ToastContainer.d.ts +2 -2
- package/dist/src/Components/TopBar/MoreButton.d.ts +2 -2
- package/dist/src/Components/TopBar/TopBar.d.ts +2 -1
- package/dist/src/Components/TopBar/TopBarButton.d.ts +2 -2
- package/package.json +2 -2
- package/src/Components/FormElements/Input/PasswordInput/passwordInput.scss +1 -0
- package/src/Components/FormElements/Input/input.scss +5 -0
- package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.tsx +13 -7
- package/src/Components/Hooks/useOnMount.ts +20 -2
- package/src/Components/Icon/Icon.tsx +2 -1
- package/src/Components/List/List.tsx +1 -1
- package/src/Components/SpoilerList/Spoiler/Spoiler.tsx +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { RbmComponentProps } from '../RbmComponentProps';
|
|
3
3
|
export type TopBarButtonProps = RbmComponentProps<{
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
onClick?: () => void;
|
|
6
6
|
}>;
|
|
7
|
-
declare function TopBarButton({ disabled, onClick, className, children, ...rbmProps }: TopBarButtonProps): JSX.Element;
|
|
7
|
+
declare function TopBarButton({ disabled, onClick, className, children, ...rbmProps }: TopBarButtonProps): React.JSX.Element;
|
|
8
8
|
declare const TopBarButtonMemo: typeof TopBarButton;
|
|
9
9
|
export { TopBarButtonMemo as TopBarButton };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainias42/react-bootstrap-mobile",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Mobile React Components using Bootstrap",
|
|
5
5
|
"main": "dist/bootstrapReactMobile",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/Ainias/Bootstrap-React-Mobile#readme",
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@fortawesome/fontawesome-svg-core": "^1.
|
|
31
|
+
"@fortawesome/fontawesome-svg-core": "^1.3.0",
|
|
32
32
|
"@fortawesome/free-regular-svg-icons": "^5.15.4",
|
|
33
33
|
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
|
34
34
|
"@fortawesome/react-fontawesome": "^0.1.16",
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
background-position: center bottom;
|
|
26
26
|
padding-bottom: 2px;
|
|
27
27
|
|
|
28
|
+
&:read-only, &:read-only:focus {
|
|
29
|
+
background-image: none;
|
|
30
|
+
border-bottom: 1px solid transparent;
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
&:focus {
|
|
29
34
|
background-image: linear-gradient(var(--flavor-focus), var(--flavor-focus)),
|
|
30
35
|
linear-gradient(to top, transparent 1px, #afafaf 1px);
|
|
@@ -122,13 +122,19 @@ export const SearchSelectInput = withMemo(function SearchSelectInput<OnChangeDat
|
|
|
122
122
|
// Other
|
|
123
123
|
|
|
124
124
|
// Render Functions
|
|
125
|
-
const renderOption = (value: string) =>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
const renderOption = (value: string) => {
|
|
126
|
+
if (!indexedOptions[value]) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<Clickable onClick={toggleOption} onClickData={value} key={indexedOptions[value].key}>
|
|
132
|
+
<InlineBlock className={styles.tag}>
|
|
133
|
+
<Text size={TEXT_SIZE.xSmall}>{indexedOptions[value].label}</Text>
|
|
134
|
+
</InlineBlock>
|
|
135
|
+
</Clickable>
|
|
136
|
+
);
|
|
137
|
+
};
|
|
132
138
|
const renderSelectableOption = (opt: SelectOption, index: number) => (
|
|
133
139
|
<Clickable onClick={toggleOption} onClickData={opt.value} key={opt.key}>
|
|
134
140
|
<Block className={classNames(styles.selectableOption, { [styles.active]: index === selectedIndex })}>
|
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
export function useOnMount(cb: () => void | Promise<void>) {
|
|
3
|
+
export function useOnMount(cb: () => void | Promise<void> | (() => any)) {
|
|
4
4
|
const called = useRef(false);
|
|
5
|
+
const unmountTimeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
|
|
6
|
+
const unmountFunc = useRef<() => any | undefined>();
|
|
5
7
|
useEffect(() => {
|
|
8
|
+
clearTimeout(unmountTimeout.current);
|
|
9
|
+
unmountTimeout.current = undefined;
|
|
10
|
+
|
|
6
11
|
if (!called.current) {
|
|
7
12
|
called.current = true;
|
|
8
|
-
cb();
|
|
13
|
+
const returnVal = cb();
|
|
14
|
+
if (typeof returnVal === 'function') {
|
|
15
|
+
unmountFunc.current = returnVal;
|
|
16
|
+
}
|
|
9
17
|
}
|
|
18
|
+
|
|
19
|
+
return () => {
|
|
20
|
+
if (unmountTimeout.current) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
unmountTimeout.current = setTimeout(() => {
|
|
24
|
+
unmountTimeout.current = undefined;
|
|
25
|
+
unmountFunc.current?.();
|
|
26
|
+
}, 60);
|
|
27
|
+
};
|
|
10
28
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11
29
|
}, []);
|
|
12
30
|
}
|
|
@@ -4,8 +4,9 @@ import { RbmComponentProps } from '../RbmComponentProps';
|
|
|
4
4
|
import { Override } from '../../TypeHelpers';
|
|
5
5
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
6
6
|
import { withMemo } from '../../helper/withMemo';
|
|
7
|
+
import { IconDefinition } from '@fortawesome/free-regular-svg-icons';
|
|
7
8
|
|
|
8
|
-
export type IconSource = IconProp | string;
|
|
9
|
+
export type IconSource = IconProp | string | IconDefinition;
|
|
9
10
|
|
|
10
11
|
export type IconProps = RbmComponentProps<
|
|
11
12
|
Override<
|
|
@@ -11,7 +11,7 @@ import { Clickable } from '../../Clickable/Clickable';
|
|
|
11
11
|
import styles from './spoiler.scss';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
13
|
import { OptionalListener, useListener } from '../../Hooks/useListener';
|
|
14
|
-
import { Icon } from '../../Icon/Icon';
|
|
14
|
+
import { Icon, IconSource } from '../../Icon/Icon';
|
|
15
15
|
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
16
16
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
17
17
|
|
|
@@ -21,8 +21,8 @@ export type SpoilerProps<OnClickData> = RbmComponentProps<
|
|
|
21
21
|
initialOpen?: boolean;
|
|
22
22
|
open?: boolean;
|
|
23
23
|
noClosingAnimation?: boolean;
|
|
24
|
-
openIcon?:
|
|
25
|
-
closeIcon?:
|
|
24
|
+
openIcon?: IconSource | null;
|
|
25
|
+
closeIcon?: IconSource | null;
|
|
26
26
|
} & OptionalListener<'onClick', OnClickData>
|
|
27
27
|
>;
|
|
28
28
|
|