@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.
Files changed (44) hide show
  1. package/bin/release.sh +0 -1
  2. package/bin/updateCopies.js +1 -0
  3. package/bootstrapReactMobile.ts +1 -0
  4. package/dist/bootstrapReactMobile.d.ts +1 -0
  5. package/dist/bootstrapReactMobile.js +3295 -18691
  6. package/dist/bootstrapReactMobile.js.map +1 -1
  7. package/dist/src/Components/FormElements/Button/Button.d.ts +2 -1
  8. package/dist/src/Components/FormElements/ColorInput/ColorInput.d.ts +3 -3
  9. package/dist/src/Components/FormElements/ColorInput/sharedSelectedColor.d.ts +1 -1
  10. package/dist/src/Components/FormElements/Controller/useYupResolver.d.ts +11 -0
  11. package/dist/src/Components/FormElements/SearchSelectInput/SearchSelectInput.d.ts +8 -1
  12. package/dist/src/Components/FormElements/Slider/Slider.d.ts +2 -1
  13. package/dist/src/Components/FormElements/Switch/Switch.d.ts +4 -1
  14. package/dist/src/Components/SpoilerList/Spoiler/Spoiler.d.ts +2 -1
  15. package/package.json +4 -3
  16. package/src/Components/Clickable/Clickable.tsx +1 -1
  17. package/src/Components/Dialog/ButtonDialog.tsx +0 -2
  18. package/src/Components/Dialog/DialogBackground.tsx +1 -1
  19. package/src/Components/Dialog/DialogContext.ts +1 -1
  20. package/src/Components/Dialog/dialogBackground.scss +1 -0
  21. package/src/Components/FormElements/Button/Button.tsx +11 -3
  22. package/src/Components/FormElements/ColorInput/ColorInput.tsx +22 -37
  23. package/src/Components/FormElements/ColorInput/colorInput.scss +39 -0
  24. package/src/Components/FormElements/ColorInput/sharedSelectedColor.ts +33 -4
  25. package/src/Components/FormElements/Controller/FileInputController.tsx +2 -2
  26. package/src/Components/FormElements/Controller/HookForm.tsx +1 -1
  27. package/src/Components/FormElements/Controller/useYupResolver.ts +53 -0
  28. package/src/Components/FormElements/FormError.tsx +1 -1
  29. package/src/Components/FormElements/Input/FileInput/MultipleFileInput.tsx +0 -1
  30. package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.tsx +161 -129
  31. package/src/Components/FormElements/SearchSelectInput/seachSelectInput.scss +6 -1
  32. package/src/Components/FormElements/Select/Select.tsx +1 -1
  33. package/src/Components/FormElements/Slider/Slider.tsx +9 -1
  34. package/src/Components/FormElements/Switch/Switch.tsx +26 -14
  35. package/src/Components/FormElements/Switch/switch.scss +18 -16
  36. package/src/Components/FullScreen/FullScreen.tsx +5 -7
  37. package/src/Components/Hooks/useComposedRef.ts +1 -1
  38. package/src/Components/Hooks/useDelayedEffect.ts +4 -3
  39. package/src/Components/Hooks/useRerender.ts +1 -1
  40. package/src/Components/Icon/Icon.tsx +0 -1
  41. package/src/Components/List/InfiniteList.tsx +3 -4
  42. package/src/Components/List/List.tsx +0 -2
  43. package/src/Components/SpoilerList/Spoiler/Spoiler.tsx +24 -18
  44. 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
- title,
29
- children,
30
- initialOpen = false,
31
- noClosingAnimation = false,
32
- openIcon = faChevronDown,
33
- closeIcon = faChevronUp,
34
- className,
35
- style,
36
- open,
37
- ...listenerProps
38
- }: SpoilerProps<OnClickData>) {
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
- <Flex horizontal={true}>
90
- <Grow __allowChildren="all">{titleComponent}</Grow>
91
- {icon ? <Icon icon={icon} className={styles.icon} /> : null}
92
- </Flex>
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}
@@ -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
- font-family: "Roboto", "Noto", sans-serif;
5
+ box-sizing: border-box;
6
+ -webkit-font-smoothing: antialiased;
7
+ font-weight: 400;
12
8
  }
13
- }
14
9
 
15
- .#{$flat} {
16
- * {
17
- font-family: -apple-system, "Helvetica Neue", "Helvetica", "Arial", "Lucida Grande", sans-serif;
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
  }