@ainias42/react-bootstrap-mobile 0.2.12 → 0.2.14
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/release.sh +0 -1
- package/bin/updateCopies.js +1 -0
- package/bootstrapReactMobile.ts +1 -0
- package/dist/bootstrapReactMobile.d.ts +1 -0
- package/dist/bootstrapReactMobile.js +3295 -18691
- package/dist/bootstrapReactMobile.js.map +1 -1
- package/dist/src/Components/FormElements/Button/Button.d.ts +2 -1
- package/dist/src/Components/FormElements/ColorInput/ColorInput.d.ts +3 -3
- package/dist/src/Components/FormElements/ColorInput/sharedSelectedColor.d.ts +1 -1
- package/dist/src/Components/FormElements/Controller/useYupResolver.d.ts +11 -0
- package/dist/src/Components/FormElements/SearchSelectInput/SearchSelectInput.d.ts +8 -1
- package/dist/src/Components/FormElements/Slider/Slider.d.ts +2 -1
- package/dist/src/Components/FormElements/Switch/Switch.d.ts +4 -1
- package/dist/src/Components/SpoilerList/Spoiler/Spoiler.d.ts +2 -1
- package/package.json +4 -3
- package/src/Components/Clickable/Clickable.tsx +1 -1
- package/src/Components/Dialog/ButtonDialog.tsx +0 -2
- package/src/Components/Dialog/DialogBackground.tsx +1 -1
- package/src/Components/Dialog/DialogContext.ts +1 -1
- package/src/Components/Dialog/dialogBackground.scss +1 -0
- package/src/Components/FormElements/Button/Button.tsx +11 -3
- package/src/Components/FormElements/ColorInput/ColorInput.tsx +22 -37
- package/src/Components/FormElements/ColorInput/colorInput.scss +39 -0
- package/src/Components/FormElements/ColorInput/sharedSelectedColor.ts +33 -4
- package/src/Components/FormElements/Controller/FileInputController.tsx +2 -2
- package/src/Components/FormElements/Controller/HookForm.tsx +1 -1
- package/src/Components/FormElements/Controller/useYupResolver.ts +53 -0
- package/src/Components/FormElements/FormError.tsx +1 -1
- package/src/Components/FormElements/Input/FileInput/MultipleFileInput.tsx +0 -1
- package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.tsx +161 -129
- package/src/Components/FormElements/SearchSelectInput/seachSelectInput.scss +6 -1
- package/src/Components/FormElements/Select/Select.tsx +1 -1
- package/src/Components/FormElements/Slider/Slider.tsx +9 -1
- package/src/Components/FormElements/Switch/Switch.tsx +26 -14
- package/src/Components/FormElements/Switch/switch.scss +18 -16
- package/src/Components/FullScreen/FullScreen.tsx +5 -7
- package/src/Components/Hooks/useComposedRef.ts +1 -1
- package/src/Components/Hooks/useDelayedEffect.ts +4 -3
- package/src/Components/Hooks/useRerender.ts +1 -1
- package/src/Components/Icon/Icon.tsx +0 -1
- package/src/Components/List/InfiniteList.tsx +3 -4
- package/src/Components/List/List.tsx +0 -2
- package/src/Components/SpoilerList/Spoiler/Spoiler.tsx +24 -18
- package/src/scss/_default.scss +14 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { withMemo } from '../../../helper/withMemo';
|
|
3
3
|
import { RbmComponentProps } from '../../RbmComponentProps';
|
|
4
|
-
import { ReactChild, useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { MouseEvent, ReactChild, useCallback, useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { Flex } from '../../Layout/Flex';
|
|
6
6
|
import { Grow } from '../../Layout/Grow';
|
|
7
7
|
import { Text, TEXT_SIZE } from '../../Text/Text';
|
|
@@ -18,6 +18,7 @@ export type SpoilerProps<OnClickData> = RbmComponentProps<
|
|
|
18
18
|
title: ReactChild;
|
|
19
19
|
initialOpen?: boolean;
|
|
20
20
|
open?: boolean;
|
|
21
|
+
onlyTitleToggles?: boolean;
|
|
21
22
|
noClosingAnimation?: boolean;
|
|
22
23
|
openIcon?: IconSource | null;
|
|
23
24
|
closeIcon?: IconSource | null;
|
|
@@ -25,17 +26,18 @@ export type SpoilerProps<OnClickData> = RbmComponentProps<
|
|
|
25
26
|
>;
|
|
26
27
|
|
|
27
28
|
function Spoiler<OnClickData>({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
title,
|
|
30
|
+
children,
|
|
31
|
+
initialOpen = false,
|
|
32
|
+
noClosingAnimation = false,
|
|
33
|
+
openIcon = faChevronDown,
|
|
34
|
+
closeIcon = faChevronUp,
|
|
35
|
+
className,
|
|
36
|
+
onlyTitleToggles = false,
|
|
37
|
+
style,
|
|
38
|
+
open,
|
|
39
|
+
...listenerProps
|
|
40
|
+
}: SpoilerProps<OnClickData>) {
|
|
39
41
|
// Variables
|
|
40
42
|
|
|
41
43
|
// Refs
|
|
@@ -50,12 +52,14 @@ function Spoiler<OnClickData>({
|
|
|
50
52
|
// Callbacks
|
|
51
53
|
const onClickListener = useListener<'onClick', OnClickData, boolean>('onClick', listenerProps);
|
|
52
54
|
|
|
53
|
-
const toggleOpen = useCallback(() => {
|
|
55
|
+
const toggleOpen = useCallback((ev: MouseEvent) => {
|
|
56
|
+
console.log("LOG-d target", ev.target);
|
|
54
57
|
if (open !== undefined) {
|
|
55
58
|
onClickListener?.(!open);
|
|
56
59
|
} else {
|
|
57
60
|
setIsInitialValue(false);
|
|
58
61
|
setIsOpen((old) => {
|
|
62
|
+
console.log("LOG-d toggleOpen", !old);
|
|
59
63
|
onClickListener?.(!old);
|
|
60
64
|
return !old;
|
|
61
65
|
});
|
|
@@ -78,7 +82,7 @@ function Spoiler<OnClickData>({
|
|
|
78
82
|
|
|
79
83
|
return (
|
|
80
84
|
<Clickable
|
|
81
|
-
onClick={toggleOpen}
|
|
85
|
+
onClick={onlyTitleToggles ? undefined: toggleOpen}
|
|
82
86
|
className={classNames(className, styles.spoiler, {
|
|
83
87
|
[styles.open]: open ?? isOpen,
|
|
84
88
|
[styles.noAnimation]: isInitialValue,
|
|
@@ -86,10 +90,12 @@ function Spoiler<OnClickData>({
|
|
|
86
90
|
})}
|
|
87
91
|
style={style}
|
|
88
92
|
>
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
<Clickable onClick={toggleOpen}>
|
|
94
|
+
<Flex horizontal={true}>
|
|
95
|
+
<Grow __allowChildren="all">{titleComponent}</Grow>
|
|
96
|
+
{icon ? <Icon icon={icon} className={styles.icon}/> : null}
|
|
97
|
+
</Flex>
|
|
98
|
+
</Clickable>
|
|
93
99
|
<Block className={styles.bodyContainer}>
|
|
94
100
|
<Block __allowChildren="all" className={styles.body}>
|
|
95
101
|
{children}
|
package/src/scss/_default.scss
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
@import "designMixin";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
-webkit-font-smoothing: antialiased;
|
|
6
|
-
font-weight: 400;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.#{$material} {
|
|
3
|
+
@layer rbm {
|
|
10
4
|
* {
|
|
11
|
-
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
-webkit-font-smoothing: antialiased;
|
|
7
|
+
font-weight: 400;
|
|
12
8
|
}
|
|
13
|
-
}
|
|
14
9
|
|
|
15
|
-
.#{$
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
.#{$material} {
|
|
11
|
+
* {
|
|
12
|
+
font-family: "Roboto", "Noto", sans-serif;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.#{$flat} {
|
|
17
|
+
* {
|
|
18
|
+
font-family: -apple-system, "Helvetica Neue", "Helvetica", "Arial", "Lucida Grande", sans-serif;
|
|
19
|
+
}
|
|
18
20
|
}
|
|
19
21
|
}
|