@dr.pogodin/react-utils 1.30.2 → 1.31.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.
Files changed (117) hide show
  1. package/bin/build.js +5 -0
  2. package/build/development/client/index.js +1 -1
  3. package/build/development/client/index.js.map +1 -1
  4. package/build/development/index.js +7 -0
  5. package/build/development/index.js.map +1 -1
  6. package/build/development/shared/components/Checkbox/index.js +2 -2
  7. package/build/development/shared/components/Checkbox/index.js.map +1 -1
  8. package/build/development/shared/components/Input/index.js +2 -2
  9. package/build/development/shared/components/Input/index.js.map +1 -1
  10. package/build/development/shared/components/Modal/index.js +25 -5
  11. package/build/development/shared/components/Modal/index.js.map +1 -1
  12. package/build/development/shared/components/TextArea/index.js +5 -0
  13. package/build/development/shared/components/TextArea/index.js.map +1 -1
  14. package/build/development/shared/components/YouTubeVideo/index.js +1 -3
  15. package/build/development/shared/components/YouTubeVideo/index.js.map +1 -1
  16. package/build/development/shared/components/index.js +27 -14
  17. package/build/development/shared/components/index.js.map +1 -1
  18. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js +93 -0
  19. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -0
  20. package/build/development/shared/components/selectors/CustomDropdown/index.js +105 -0
  21. package/build/development/shared/components/selectors/CustomDropdown/index.js.map +1 -0
  22. package/build/development/shared/components/{Dropdown → selectors/NativeDropdown}/index.js +25 -34
  23. package/build/development/shared/components/selectors/NativeDropdown/index.js.map +1 -0
  24. package/build/development/shared/components/selectors/Switch/index.js +76 -0
  25. package/build/development/shared/components/selectors/Switch/index.js.map +1 -0
  26. package/build/development/shared/components/selectors/common.js +24 -0
  27. package/build/development/shared/components/selectors/common.js.map +1 -0
  28. package/build/development/shared/components/selectors/index.js +28 -0
  29. package/build/development/shared/components/selectors/index.js.map +1 -0
  30. package/build/development/style.css +387 -225
  31. package/build/development/web.bundle.js +109 -49
  32. package/build/production/client/index.js +1 -1
  33. package/build/production/client/index.js.map +1 -1
  34. package/build/production/index.js +1 -1
  35. package/build/production/index.js.map +1 -1
  36. package/build/production/shared/components/Checkbox/index.js +2 -2
  37. package/build/production/shared/components/Checkbox/index.js.map +1 -1
  38. package/build/production/shared/components/Input/index.js +1 -1
  39. package/build/production/shared/components/Input/index.js.map +1 -1
  40. package/build/production/shared/components/Modal/index.js +3 -2
  41. package/build/production/shared/components/Modal/index.js.map +1 -1
  42. package/build/production/shared/components/TextArea/index.js +3 -3
  43. package/build/production/shared/components/TextArea/index.js.map +1 -1
  44. package/build/production/shared/components/YouTubeVideo/index.js +2 -2
  45. package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
  46. package/build/production/shared/components/index.js +1 -1
  47. package/build/production/shared/components/index.js.map +1 -1
  48. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js +7 -0
  49. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -0
  50. package/build/production/shared/components/selectors/CustomDropdown/index.js +4 -0
  51. package/build/production/shared/components/selectors/CustomDropdown/index.js.map +1 -0
  52. package/build/production/shared/components/selectors/NativeDropdown/index.js +25 -0
  53. package/build/production/shared/components/selectors/NativeDropdown/index.js.map +1 -0
  54. package/build/production/shared/components/selectors/Switch/index.js +2 -0
  55. package/build/production/shared/components/selectors/Switch/index.js.map +1 -0
  56. package/build/production/shared/components/selectors/common.js +3 -0
  57. package/build/production/shared/components/selectors/common.js.map +1 -0
  58. package/build/production/shared/components/selectors/index.js +2 -0
  59. package/build/production/shared/components/selectors/index.js.map +1 -0
  60. package/build/production/style.css +1 -1
  61. package/build/production/style.css.map +1 -1
  62. package/build/production/web.bundle.js +1 -1
  63. package/build/production/web.bundle.js.map +1 -1
  64. package/build/types-code/client/index.d.ts +1 -0
  65. package/build/types-code/index.d.ts +1 -1
  66. package/build/types-code/shared/components/Checkbox/index.d.ts +1 -1
  67. package/build/types-code/shared/components/Input/index.d.ts +1 -1
  68. package/build/types-code/shared/components/Modal/index.d.ts +2 -1
  69. package/build/types-code/shared/components/TextArea/index.d.ts +1 -0
  70. package/build/types-code/shared/components/index.d.ts +1 -2
  71. package/build/types-code/shared/components/selectors/CustomDropdown/Options/index.d.ts +17 -0
  72. package/build/types-code/shared/components/selectors/CustomDropdown/index.d.ts +4 -0
  73. package/build/types-code/shared/components/selectors/NativeDropdown/index.d.ts +3 -0
  74. package/build/types-code/shared/components/selectors/Switch/index.d.ts +13 -0
  75. package/build/types-code/shared/components/selectors/common.d.ts +27 -0
  76. package/build/types-code/shared/components/selectors/index.d.ts +3 -0
  77. package/build/types-scss/src/shared/components/Modal/styles.scss.d.ts +1 -0
  78. package/build/types-scss/src/shared/components/selectors/CustomDropdown/Options/style.scss.d.ts +1 -0
  79. package/build/types-scss/src/shared/components/selectors/CustomDropdown/theme.scss.d.ts +10 -0
  80. package/build/types-scss/src/shared/components/{Dropdown → selectors/NativeDropdown}/theme.scss.d.ts +1 -0
  81. package/build/types-scss/src/shared/components/selectors/Switch/theme.scss.d.ts +6 -0
  82. package/package.json +6 -6
  83. package/src/client/index.tsx +2 -1
  84. package/src/index.ts +1 -0
  85. package/src/shared/components/Button/style.scss +1 -0
  86. package/src/shared/components/Checkbox/index.tsx +3 -3
  87. package/src/shared/components/Input/index.tsx +3 -3
  88. package/src/shared/components/Modal/base-theme.scss +1 -1
  89. package/src/shared/components/Modal/index.tsx +24 -5
  90. package/src/shared/components/Modal/styles.scss +2 -4
  91. package/src/shared/components/TextArea/index.tsx +5 -0
  92. package/src/shared/components/TextArea/style.scss +8 -0
  93. package/src/shared/components/YouTubeVideo/base.scss +3 -1
  94. package/src/shared/components/YouTubeVideo/index.tsx +2 -3
  95. package/src/shared/components/index.ts +2 -2
  96. package/src/shared/components/selectors/CustomDropdown/Options/index.tsx +117 -0
  97. package/src/shared/components/selectors/CustomDropdown/Options/style.scss +6 -0
  98. package/src/shared/components/selectors/CustomDropdown/index.tsx +115 -0
  99. package/src/shared/components/selectors/CustomDropdown/theme.scss +90 -0
  100. package/src/shared/components/{Dropdown → selectors/NativeDropdown}/index.tsx +21 -50
  101. package/src/shared/components/{Dropdown → selectors/NativeDropdown}/theme.scss +5 -0
  102. package/src/shared/components/selectors/Switch/index.tsx +94 -0
  103. package/src/shared/components/selectors/Switch/theme.scss +39 -0
  104. package/src/shared/components/selectors/common.ts +54 -0
  105. package/src/shared/components/selectors/index.ts +3 -0
  106. package/build/development/shared/components/Dropdown/index.js.map +0 -1
  107. package/build/development/shared/components/ScalableRect/index.js +0 -80
  108. package/build/development/shared/components/ScalableRect/index.js.map +0 -1
  109. package/build/production/shared/components/Dropdown/index.js +0 -24
  110. package/build/production/shared/components/Dropdown/index.js.map +0 -1
  111. package/build/production/shared/components/ScalableRect/index.js +0 -21
  112. package/build/production/shared/components/ScalableRect/index.js.map +0 -1
  113. package/build/types-code/shared/components/Dropdown/index.d.ts +0 -17
  114. package/build/types-code/shared/components/ScalableRect/index.d.ts +0 -19
  115. package/build/types-scss/src/shared/components/ScalableRect/style.scss.d.ts +0 -2
  116. package/src/shared/components/ScalableRect/index.tsx +0 -84
  117. package/src/shared/components/ScalableRect/style.scss +0 -10
@@ -0,0 +1,6 @@
1
+ .overlay {
2
+ inset: 0;
3
+ opacity: 0.2;
4
+ position: fixed;
5
+ z-index: 1000;
6
+ }
@@ -0,0 +1,115 @@
1
+ import PT from 'prop-types';
2
+ import { useRef, useState } from 'react';
3
+
4
+ import themed from '@dr.pogodin/react-themes';
5
+
6
+ import Options from './Options';
7
+
8
+ import defaultTheme from './theme.scss';
9
+
10
+ import {
11
+ type PropsT,
12
+ optionValidator,
13
+ optionValueName,
14
+ validThemeKeys,
15
+ } from '../common';
16
+
17
+ const BaseCustomDropdown: React.FunctionComponent<
18
+ PropsT<React.ReactNode, (value: string) => void>
19
+ > = ({
20
+ filter,
21
+ label,
22
+ onChange,
23
+ options,
24
+ theme,
25
+ value,
26
+ }) => {
27
+ if (!options) throw Error('Internal error');
28
+
29
+ const dropdownRef = useRef<HTMLDivElement>(null);
30
+
31
+ // If "null" the dropdown is closed, otherwise it is displayed
32
+ // at the specified coordinates.
33
+ const [anchor, setAnchor] = useState<DOMRect | null>(null);
34
+
35
+ const openList = () => {
36
+ setAnchor(dropdownRef.current!.getBoundingClientRect());
37
+ };
38
+
39
+ let selected: React.ReactNode = <>&zwnj;</>;
40
+ for (let i = 0; i < options.length; ++i) {
41
+ const option = options[i];
42
+ if (!filter || filter(option)) {
43
+ const [iValue, iName] = optionValueName(option);
44
+ if (iValue === value) {
45
+ selected = iName;
46
+ break;
47
+ }
48
+ }
49
+ }
50
+
51
+ let containerClassName = theme.container;
52
+ if (anchor) containerClassName += ` ${theme.active}`;
53
+
54
+ return (
55
+ <div className={containerClassName}>
56
+ {label === undefined ? null : (
57
+ <div className={theme.label}>{label}</div>
58
+ )}
59
+ <div
60
+ className={theme.dropdown}
61
+ onClick={openList}
62
+ onKeyDown={(e) => {
63
+ if (e.key === 'Enter') openList();
64
+ }}
65
+ ref={dropdownRef}
66
+ role="listbox"
67
+ tabIndex={0}
68
+ >
69
+ {selected}
70
+ <div className={theme.arrow} />
71
+ </div>
72
+ {
73
+ anchor ? (
74
+ <Options
75
+ anchorRect={anchor}
76
+ containerClass={theme.select || ''}
77
+ onCancel={() => setAnchor(null)}
78
+ onChange={(newValue) => {
79
+ setAnchor(null);
80
+ if (onChange) onChange(newValue);
81
+ }}
82
+ optionClass={theme.option || ''}
83
+ options={options}
84
+ />
85
+ ) : null
86
+ }
87
+ </div>
88
+ );
89
+ };
90
+
91
+ const ThemedCustomDropdown = themed(
92
+ BaseCustomDropdown,
93
+ 'CustomDropdown',
94
+ validThemeKeys,
95
+ defaultTheme,
96
+ );
97
+
98
+ BaseCustomDropdown.propTypes = {
99
+ filter: PT.func,
100
+ label: PT.node,
101
+ onChange: PT.func,
102
+ options: PT.arrayOf(optionValidator.isRequired),
103
+ theme: ThemedCustomDropdown.themeType.isRequired,
104
+ value: PT.string,
105
+ };
106
+
107
+ BaseCustomDropdown.defaultProps = {
108
+ filter: undefined,
109
+ label: undefined,
110
+ onChange: undefined,
111
+ options: [],
112
+ value: undefined,
113
+ };
114
+
115
+ export default ThemedCustomDropdown;
@@ -0,0 +1,90 @@
1
+ *,
2
+ .context,
3
+ .ad.hoc {
4
+ // The outermost dropdown container, holding together the label (if any),
5
+ // and the select element with arrow. Note, that the dropdown option list,
6
+ // when opened, exists completely outside the dropdown DOM hierarchy, and
7
+ // is aligned into the correct position by JS.
8
+ &.container {
9
+ align-items: center;
10
+ display: inline-flex;
11
+ margin: 0.1em;
12
+ position: relative;
13
+ }
14
+
15
+ // Styling of default label next to the dropdown (has no effect on custom
16
+ // non-string label node, if provided).
17
+ &.label {
18
+ margin: 0 0.6em 0 1.2em;
19
+ }
20
+
21
+ &.dropdown {
22
+ border: 1px solid gray;
23
+ border-radius: 0.3em;
24
+ cursor: pointer;
25
+ min-width: 200px;
26
+ outline: none;
27
+ padding: 0.3em 3.0em 0.3em 0.6em;
28
+ position: relative;
29
+ user-select: none;
30
+
31
+ &:focus {
32
+ border-color: blue;
33
+ box-shadow: 0 0 3px 1px lightblue;
34
+ }
35
+ }
36
+
37
+ &.option {
38
+ cursor: pointer;
39
+ outline: none ;
40
+ padding: 0 0.6em;
41
+
42
+ &:focus {
43
+ background: royalblue;
44
+ color: white;
45
+ }
46
+
47
+ &:hover {
48
+ background: royalblue;
49
+ color: white;
50
+ }
51
+ }
52
+
53
+ &.select {
54
+ background: white;
55
+ border: 1px solid gray;
56
+ border-radius: 0 0 0.3em 0.3em;
57
+ border-top: none;
58
+ box-shadow: 0 6px 12px 3px lightgray;
59
+ position: fixed;
60
+ top: 20px;
61
+ left: 10px;
62
+ z-index: 1001;
63
+ }
64
+
65
+ &.arrow {
66
+ background-image: linear-gradient(to top, lightgray, white 50%, white);
67
+ border-left: 1px solid gray;
68
+ border-radius: 0 0.3em 0.3em 0;
69
+ bottom: 0;
70
+ padding: 0.3em 0.6em;
71
+ position: absolute;
72
+ right: 0;
73
+ top: 0;
74
+
75
+ &::after {
76
+ content: '▼';
77
+ }
78
+ }
79
+
80
+ &.active {
81
+ .arrow {
82
+ border-radius: 0 0.3em 0 0;
83
+ }
84
+
85
+ .dropdown {
86
+ border-color: blue;
87
+ border-radius: 0.3em 0.3em 0 0;
88
+ }
89
+ }
90
+ }
@@ -1,32 +1,17 @@
1
+ // Implements dropdown based on the native HTML <select> element.
2
+
1
3
  import PT from 'prop-types';
2
4
 
3
- import themed, { type Theme } from '@dr.pogodin/react-themes';
5
+ import themed from '@dr.pogodin/react-themes';
4
6
 
5
7
  import defaultTheme from './theme.scss';
6
8
 
7
- const validThemeKeys = [
8
- 'arrow',
9
- 'container',
10
- 'dropdown',
11
- 'hiddenOption',
12
- 'label',
13
- 'option',
14
- 'select',
15
- ] as const;
16
-
17
- type DropdownOptionT = {
18
- name?: string | null;
19
- value: string;
20
- };
21
-
22
- type PropsT = {
23
- filter?: (item: DropdownOptionT | string) => boolean;
24
- label?: string;
25
- onChange?: React.ChangeEventHandler<HTMLSelectElement>;
26
- options?: Array<DropdownOptionT | string>;
27
- theme: Theme<typeof validThemeKeys>;
28
- value?: string;
29
- };
9
+ import {
10
+ type PropsT,
11
+ optionsValidator,
12
+ optionValueName,
13
+ validThemeKeys,
14
+ } from '../common';
30
15
 
31
16
  /**
32
17
  * Implements a themeable dropdown list. Internally it is rendered with help of
@@ -47,33 +32,27 @@ type PropsT = {
47
32
  * @param [props....]
48
33
  * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)
49
34
  */
50
- const Dropdown: React.FunctionComponent<PropsT> = ({
35
+ const Dropdown: React.FunctionComponent<PropsT<string>> = ({
51
36
  filter,
52
37
  label,
53
38
  onChange,
54
- options = [],
39
+ options,
55
40
  theme,
56
41
  value,
57
42
  }) => {
43
+ if (!options) throw Error('Internal error');
44
+
58
45
  let isValidValue = false;
59
46
  const optionElements = [];
60
47
 
61
48
  for (let i = 0; i < options.length; ++i) {
62
49
  const option = options[i];
63
50
  if (!filter || filter(option)) {
64
- let optionValue: string;
65
- let optionName: string;
66
- if (typeof option === 'string') {
67
- optionName = option;
68
- optionValue = option;
69
- } else {
70
- optionName = option.name || option.value;
71
- optionValue = option.value;
72
- }
73
- isValidValue ||= optionValue === value;
51
+ const [iValue, iName] = optionValueName(option);
52
+ isValidValue ||= iValue === value;
74
53
  optionElements.push(
75
- <option className={theme.option} key={optionValue} value={optionValue}>
76
- {optionName}
54
+ <option className={theme.option} key={iValue} value={iValue}>
55
+ {iName}
77
56
  </option>,
78
57
  );
79
58
  }
@@ -96,7 +75,7 @@ const Dropdown: React.FunctionComponent<PropsT> = ({
96
75
 
97
76
  return (
98
77
  <div className={theme.container}>
99
- { label === undefined ? null : <p className={theme.label}>{label}</p> }
78
+ { label === undefined ? null : <div className={theme.label}>{label}</div> }
100
79
  <div className={theme.dropdown}>
101
80
  <select
102
81
  className={theme.select}
@@ -106,7 +85,7 @@ const Dropdown: React.FunctionComponent<PropsT> = ({
106
85
  {hiddenOption}
107
86
  {optionElements}
108
87
  </select>
109
- <div className={theme.arrow}>▼</div>
88
+ <div className={theme.arrow} />
110
89
  </div>
111
90
  </div>
112
91
  );
@@ -121,17 +100,9 @@ const ThemedDropdown = themed(
121
100
 
122
101
  Dropdown.propTypes = {
123
102
  filter: PT.func,
124
- label: PT.string,
103
+ label: PT.node,
125
104
  onChange: PT.func,
126
- options: PT.arrayOf(
127
- PT.oneOfType([
128
- PT.shape({
129
- name: PT.string,
130
- value: PT.string.isRequired,
131
- }),
132
- PT.string,
133
- ]).isRequired,
134
- ),
105
+ options: optionsValidator,
135
106
  theme: ThemedDropdown.themeType.isRequired,
136
107
  value: PT.string,
137
108
  };
@@ -17,6 +17,10 @@
17
17
  position: absolute;
18
18
  right: 0;
19
19
  top: 0;
20
+
21
+ &::after {
22
+ content: '▼';
23
+ }
20
24
  }
21
25
 
22
26
  &.container {
@@ -26,6 +30,7 @@
26
30
  position: relative;
27
31
  }
28
32
 
33
+ .active + &.arrow,
29
34
  :active + &.arrow {
30
35
  background-image: linear-gradient(to bottom, lightgray, white 50%, white);
31
36
  border-bottom-right-radius: 0;
@@ -0,0 +1,94 @@
1
+ import PT from 'prop-types';
2
+ import themed, { type Theme } from '@dr.pogodin/react-themes';
3
+
4
+ import { type OptionsT, optionsValidator, optionValueName } from '../common';
5
+
6
+ import defaultTheme from './theme.scss';
7
+
8
+ const validThemeKeys = [
9
+ 'container',
10
+ 'label',
11
+ 'option',
12
+ 'selected',
13
+ 'switch',
14
+ ] as const;
15
+
16
+ type PropsT = {
17
+ label?: React.ReactNode;
18
+ onChange?: (value: string) => void;
19
+ options?: Readonly<OptionsT<React.ReactNode>>;
20
+ theme: Theme<typeof validThemeKeys>;
21
+ value?: string;
22
+ };
23
+
24
+ const BaseSwitch: React.FunctionComponent<PropsT> = ({
25
+ label,
26
+ onChange,
27
+ options,
28
+ theme,
29
+ value,
30
+ }) => {
31
+ if (!options || !theme.option) throw Error('Internal error');
32
+
33
+ const optionNodes: React.ReactNode[] = [];
34
+ for (let i = 0; i < options?.length; ++i) {
35
+ const [iValue, iName] = optionValueName(options[i]);
36
+
37
+ let className: string = theme.option;
38
+ let onPress: (() => void) | undefined;
39
+ if (iValue === value) className += ` ${theme.selected}`;
40
+ else if (onChange) onPress = () => onChange(iValue);
41
+
42
+ optionNodes.push(
43
+ onPress ? (
44
+ <div
45
+ className={className}
46
+ onClick={onPress}
47
+ onKeyDown={(e) => {
48
+ if (onPress && e.key === 'Enter') onPress();
49
+ }}
50
+ key={iValue}
51
+ role="button"
52
+ tabIndex={0}
53
+ >
54
+ {iName}
55
+ </div>
56
+ ) : (
57
+ <div className={className} key={iValue}>{iName}</div>
58
+ ),
59
+ );
60
+ }
61
+
62
+ return (
63
+ <div className={theme.container}>
64
+ {label ? <div className={theme.label}>{label}</div> : null}
65
+ <div className={theme.switch}>
66
+ {optionNodes}
67
+ </div>
68
+ </div>
69
+ );
70
+ };
71
+
72
+ const ThemedSwitch = themed(
73
+ BaseSwitch,
74
+ 'Switch',
75
+ validThemeKeys,
76
+ defaultTheme,
77
+ );
78
+
79
+ BaseSwitch.propTypes = {
80
+ label: PT.node,
81
+ onChange: PT.func,
82
+ options: optionsValidator,
83
+ theme: ThemedSwitch.themeType.isRequired,
84
+ value: PT.string,
85
+ };
86
+
87
+ BaseSwitch.defaultProps = {
88
+ label: undefined,
89
+ onChange: undefined,
90
+ options: [],
91
+ value: undefined,
92
+ };
93
+
94
+ export default ThemedSwitch;
@@ -0,0 +1,39 @@
1
+ *,
2
+ .context,
3
+ .ad.hoc {
4
+ &.container {
5
+ align-items: center;
6
+ display: flex;
7
+ gap: 0.6em;
8
+ }
9
+
10
+ &.option {
11
+ border: 1px solid transparent;
12
+ border-radius: 0.3em;
13
+ cursor: pointer;
14
+ outline: none;
15
+ padding: 0 0.9em;
16
+
17
+ &:focus {
18
+ border-color: blue;
19
+ box-shadow: 0 0 3px 1px lightblue;
20
+ }
21
+ }
22
+
23
+ &.selected {
24
+ border: 1px solid gray;
25
+ background: white;
26
+ cursor: default;
27
+ }
28
+
29
+ &.switch {
30
+ align-items: center;
31
+ background: whitesmoke;
32
+ border: 1px solid gray;
33
+ border-radius: 0.3em;
34
+ display: flex;
35
+ gap: 0.3em;
36
+ padding: 0.3em;
37
+ user-select: none;
38
+ }
39
+ }
@@ -0,0 +1,54 @@
1
+ // The stuff common between different dropdown implementations.
2
+
3
+ import PT from 'prop-types';
4
+
5
+ import type { Theme } from '@dr.pogodin/react-themes';
6
+
7
+ export const validThemeKeys = [
8
+ 'active',
9
+ 'arrow',
10
+ 'container',
11
+ 'dropdown',
12
+ 'hiddenOption',
13
+ 'label',
14
+ 'option',
15
+ 'select',
16
+ ] as const;
17
+
18
+ export type OptionT<NameT> = {
19
+ name?: NameT | null;
20
+ value: string;
21
+ };
22
+
23
+ export type OptionsT<NameT> = Array<OptionT<NameT> | string>;
24
+
25
+ export type PropsT<
26
+ NameT,
27
+ OnChangeT = React.ChangeEventHandler<HTMLSelectElement>,
28
+ > = {
29
+ filter?: (item: OptionT<NameT> | string) => boolean;
30
+ label?: React.ReactNode;
31
+ onChange?: OnChangeT;
32
+ options?: OptionsT<NameT>;
33
+ theme: Theme<typeof validThemeKeys>;
34
+ value?: string;
35
+ };
36
+
37
+ export const optionValidator = PT.oneOfType([
38
+ PT.shape({
39
+ name: PT.string,
40
+ value: PT.string.isRequired,
41
+ }).isRequired,
42
+ PT.string.isRequired,
43
+ ]);
44
+
45
+ export const optionsValidator = PT.arrayOf(optionValidator.isRequired);
46
+
47
+ /** Returns option value and name as a tuple. */
48
+ export function optionValueName<NameT>(
49
+ option: OptionT<NameT> | string,
50
+ ): [string, NameT | string] {
51
+ return typeof option === 'string'
52
+ ? [option, option]
53
+ : [option.value, option.name ?? option.value];
54
+ }
@@ -0,0 +1,3 @@
1
+ export { default as CustomDropdown } from './CustomDropdown';
2
+ export { default as Dropdown } from './NativeDropdown';
3
+ export { default as Switch } from './Switch';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_reactThemes","_jsxRuntime","defaultTheme","validThemeKeys","Dropdown","filter","label","onChange","options","theme","value","isValidValue","optionElements","i","length","option","optionValue","optionName","name","push","jsx","className","children","hiddenOption","disabled","jsxs","container","undefined","dropdown","select","arrow","ThemedDropdown","themed","propTypes","PT","func","string","arrayOf","oneOfType","shape","isRequired","themeType","defaultProps","_default","exports","default"],"sources":["../../../../../src/shared/components/Dropdown/index.tsx"],"sourcesContent":["import PT from 'prop-types';\n\nimport themed, { type Theme } from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './theme.scss';\n\nconst validThemeKeys = [\n 'arrow',\n 'container',\n 'dropdown',\n 'hiddenOption',\n 'label',\n 'option',\n 'select',\n] as const;\n\ntype DropdownOptionT = {\n name?: string | null;\n value: string;\n};\n\ntype PropsT = {\n filter?: (item: DropdownOptionT | string) => boolean;\n label?: string;\n onChange?: React.ChangeEventHandler<HTMLSelectElement>;\n options?: Array<DropdownOptionT | string>;\n theme: Theme<typeof validThemeKeys>;\n value?: string;\n};\n\n/**\n * Implements a themeable dropdown list. Internally it is rendered with help of\n * the standard HTML `<select>` element, thus the styling support is somewhat\n * limited.\n * @param [props] Component properties.\n * @param [props.filter] Options filter function. If provided, only\n * those elements of `options` list will be used by the dropdown, for which this\n * filter returns `true`.\n * @param [props.label] Dropdown label.\n * @param [props.onChange] Selection event handler.\n * @param [props.options=[]] Array of dropdown\n * options. For string elements the option value and name will be the same.\n * It is allowed to mix DropdownOption and string elements in the same option\n * list.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props.value] Currently selected value.\n * @param [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nconst Dropdown: React.FunctionComponent<PropsT> = ({\n filter,\n label,\n onChange,\n options = [],\n theme,\n value,\n}) => {\n let isValidValue = false;\n const optionElements = [];\n\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (!filter || filter(option)) {\n let optionValue: string;\n let optionName: string;\n if (typeof option === 'string') {\n optionName = option;\n optionValue = option;\n } else {\n optionName = option.name || option.value;\n optionValue = option.value;\n }\n isValidValue ||= optionValue === value;\n optionElements.push(\n <option className={theme.option} key={optionValue} value={optionValue}>\n {optionName}\n </option>,\n );\n }\n }\n\n // NOTE: This element represents the current `value` when it does not match\n // any valid option. In Chrome, and some other browsers, we are able to hide\n // it from the opened dropdown; in others, e.g. Safari, the best we can do is\n // to show it as disabled.\n const hiddenOption = isValidValue ? null : (\n <option\n disabled\n className={theme.hiddenOption}\n key=\"__reactUtilsHiddenOption\"\n value={value}\n >\n {value}\n </option>\n );\n\n return (\n <div className={theme.container}>\n { label === undefined ? null : <p className={theme.label}>{label}</p> }\n <div className={theme.dropdown}>\n <select\n className={theme.select}\n onChange={onChange}\n value={value}\n >\n {hiddenOption}\n {optionElements}\n </select>\n <div className={theme.arrow}>▼</div>\n </div>\n </div>\n );\n};\n\nconst ThemedDropdown = themed(\n Dropdown,\n 'Dropdown',\n validThemeKeys,\n defaultTheme,\n);\n\nDropdown.propTypes = {\n filter: PT.func,\n label: PT.string,\n onChange: PT.func,\n options: PT.arrayOf(\n PT.oneOfType([\n PT.shape({\n name: PT.string,\n value: PT.string.isRequired,\n }),\n PT.string,\n ]).isRequired,\n ),\n theme: ThemedDropdown.themeType.isRequired,\n value: PT.string,\n};\n\nDropdown.defaultProps = {\n filter: undefined,\n label: undefined,\n onChange: undefined,\n options: [],\n value: '',\n};\n\nexport default ThemedDropdown;\n"],"mappings":"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","ignoreList":[]}
@@ -1,80 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- require("react");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * The `<ScalableRect>` component implements container keeping given aspect
13
- * ratio, while its width is altered.
14
- *
15
- * **Children:** Component children are rendered as the component's content.
16
- * @param {object} props
17
- * @param {string} [props.className] CSS class for component container.
18
- * @param {string} [props.ratio=1:1] Ratio of the rendered rectangle sides,
19
- * in `W:H` form.
20
- */
21
- const ScalableRect = ({
22
- children,
23
- className,
24
- ratio
25
- }) => {
26
- const aux = ratio.split(':');
27
- const paddingBottom = `${100 * parseFloat(aux[1]) / parseFloat(aux[0])}%`;
28
-
29
- /* NOTE: In case the following code looks strange to you, mind that we want to
30
- * allow the user to set custom styles on this component. If user passes in a
31
- * "className" prop (possibly "styleName", but that one is converted to
32
- * "className" by Babel just before being passed into this component), it
33
- * should not interfere with the sizing behavior, thus we need an extra <div>
34
- * level in this component; however, if user does not need a custom styling,
35
- * we can save one level of HTML code, so we do it. */
36
- const rect = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
37
- style: {
38
- paddingBottom
39
- },
40
- className: "-dr-pogodin-react-utils___src-shared-components-ScalableRect-style___container___EznFz3",
41
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
42
- className: "-dr-pogodin-react-utils___src-shared-components-ScalableRect-style___wrapper___0vb7tq",
43
- children: children
44
- })
45
- });
46
- return className ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
47
- className: className,
48
- children: rect
49
- }) : rect;
50
- };
51
- ScalableRect.defaultProps = {
52
- children: null,
53
- className: undefined,
54
- ratio: '1:1'
55
- };
56
- ScalableRect.propTypes = {
57
- children: _propTypes.default.node,
58
- className: _propTypes.default.string,
59
- ratio: (props, name) => {
60
- const ratio = props[name];
61
-
62
- // "ratio" prop is not required (defaults "1:1").
63
- if (ratio === undefined) return null;
64
-
65
- // If given, "ratio" must be a string.
66
- if (typeof ratio !== 'string') {
67
- return Error('"ratio" prop must be a string');
68
- }
69
-
70
- // If given, "ratio" must have "H:W" format.
71
- if (!ratio.match(/\d+:\d+/)) {
72
- return Error('"ratio" prop must have "H:W" format');
73
- }
74
-
75
- // Everything looks right.
76
- return null;
77
- }
78
- };
79
- var _default = exports.default = ScalableRect;
80
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_propTypes","_interopRequireDefault","require","_jsxRuntime","ScalableRect","children","className","ratio","aux","split","paddingBottom","parseFloat","rect","jsx","style","defaultProps","undefined","propTypes","PT","node","string","props","name","Error","match","_default","exports","default"],"sources":["../../../../../src/shared/components/ScalableRect/index.tsx"],"sourcesContent":["import PT from 'prop-types';\nimport { type ReactNode } from 'react';\n\nimport './style.scss';\n\ntype PropsT = {\n children?: ReactNode;\n className?: string;\n ratio?: `${number}:${number}`,\n};\n\n/**\n * The `<ScalableRect>` component implements container keeping given aspect\n * ratio, while its width is altered.\n *\n * **Children:** Component children are rendered as the component's content.\n * @param {object} props\n * @param {string} [props.className] CSS class for component container.\n * @param {string} [props.ratio=1:1] Ratio of the rendered rectangle sides,\n * in `W:H` form.\n */\nconst ScalableRect: React.FunctionComponent<PropsT> = ({\n children,\n className,\n ratio,\n}) => {\n const aux = ratio!.split(':');\n const paddingBottom = `${(100 * parseFloat(aux[1])) / parseFloat(aux[0])}%`;\n\n /* NOTE: In case the following code looks strange to you, mind that we want to\n * allow the user to set custom styles on this component. If user passes in a\n * \"className\" prop (possibly \"styleName\", but that one is converted to\n * \"className\" by Babel just before being passed into this component), it\n * should not interfere with the sizing behavior, thus we need an extra <div>\n * level in this component; however, if user does not need a custom styling,\n * we can save one level of HTML code, so we do it. */\n const rect = (\n <div\n style={{ paddingBottom }}\n styleName=\"container\"\n >\n <div styleName=\"wrapper\">\n {children}\n </div>\n </div>\n );\n return className ? (\n <div className={className}>\n {rect}\n </div>\n ) : rect;\n};\n\nScalableRect.defaultProps = {\n children: null,\n className: undefined,\n ratio: '1:1',\n};\n\nScalableRect.propTypes = {\n children: PT.node,\n className: PT.string,\n ratio: (props, name) => {\n const ratio = props[name];\n\n // \"ratio\" prop is not required (defaults \"1:1\").\n if (ratio === undefined) return null;\n\n // If given, \"ratio\" must be a string.\n if (typeof ratio !== 'string') {\n return Error('\"ratio\" prop must be a string');\n }\n\n // If given, \"ratio\" must have \"H:W\" format.\n if (!ratio.match(/\\d+:\\d+/)) {\n return Error('\"ratio\" prop must have \"H:W\" format');\n }\n\n // Everything looks right.\n return null;\n },\n};\n\nexport default ScalableRect;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACAA,OAAA;AAAuC,IAAAC,WAAA,GAAAD,OAAA;AAUvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,YAA6C,GAAGA,CAAC;EACrDC,QAAQ;EACRC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,MAAMC,GAAG,GAAGD,KAAK,CAAEE,KAAK,CAAC,GAAG,CAAC;EAC7B,MAAMC,aAAa,GAAI,GAAG,GAAG,GAAGC,UAAU,CAACH,GAAG,CAAC,CAAC,CAAC,CAAC,GAAIG,UAAU,CAACH,GAAG,CAAC,CAAC,CAAC,CAAE,GAAE;;EAE3E;AACF;AACA;AACA;AACA;AACA;AACA;EACE,MAAMI,IAAI,gBACR,IAAAT,WAAA,CAAAU,GAAA;IACEC,KAAK,EAAE;MAAEJ;IAAc,CAAE;IACzBJ,SAAS,EAAC,yFAAW;IAAAD,QAAA,eAErB,IAAAF,WAAA,CAAAU,GAAA;MAAKP,SAAS,EAAC,uFAAS;MAAAD,QAAA,EACrBA;IAAQ,CACN;EAAC,CACH,CACN;EACD,OAAOC,SAAS,gBACd,IAAAH,WAAA,CAAAU,GAAA;IAAKP,SAAS,EAAEA,SAAU;IAAAD,QAAA,EACvBO;EAAI,CACF,CAAC,GACJA,IAAI;AACV,CAAC;AAEDR,YAAY,CAACW,YAAY,GAAG;EAC1BV,QAAQ,EAAE,IAAI;EACdC,SAAS,EAAEU,SAAS;EACpBT,KAAK,EAAE;AACT,CAAC;AAEDH,YAAY,CAACa,SAAS,GAAG;EACvBZ,QAAQ,EAAEa,kBAAE,CAACC,IAAI;EACjBb,SAAS,EAAEY,kBAAE,CAACE,MAAM;EACpBb,KAAK,EAAEA,CAACc,KAAK,EAAEC,IAAI,KAAK;IACtB,MAAMf,KAAK,GAAGc,KAAK,CAACC,IAAI,CAAC;;IAEzB;IACA,IAAIf,KAAK,KAAKS,SAAS,EAAE,OAAO,IAAI;;IAEpC;IACA,IAAI,OAAOT,KAAK,KAAK,QAAQ,EAAE;MAC7B,OAAOgB,KAAK,CAAC,+BAA+B,CAAC;IAC/C;;IAEA;IACA,IAAI,CAAChB,KAAK,CAACiB,KAAK,CAAC,SAAS,CAAC,EAAE;MAC3B,OAAOD,KAAK,CAAC,qCAAqC,CAAC;IACrD;;IAEA;IACA,OAAO,IAAI;EACb;AACF,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEavB,YAAY","ignoreList":[]}
@@ -1,24 +0,0 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _jsxRuntime=require("react/jsx-runtime");const defaultTheme={"context":"haRIry","ad":"D4XHG2","hoc":"N3nd34","dropdown":"-LiQj8","arrow":"-zPK7Y","container":"_9CQpeA","label":"Gv0kyu","option":"xmsujA","hiddenOption":"RdW3yR","select":"JXK1uw"};const validThemeKeys=["arrow","container","dropdown","hiddenOption","label","option","select"];/**
2
- * Implements a themeable dropdown list. Internally it is rendered with help of
3
- * the standard HTML `<select>` element, thus the styling support is somewhat
4
- * limited.
5
- * @param [props] Component properties.
6
- * @param [props.filter] Options filter function. If provided, only
7
- * those elements of `options` list will be used by the dropdown, for which this
8
- * filter returns `true`.
9
- * @param [props.label] Dropdown label.
10
- * @param [props.onChange] Selection event handler.
11
- * @param [props.options=[]] Array of dropdown
12
- * options. For string elements the option value and name will be the same.
13
- * It is allowed to mix DropdownOption and string elements in the same option
14
- * list.
15
- * @param [props.theme] _Ad hoc_ theme.
16
- * @param [props.value] Currently selected value.
17
- * @param [props....]
18
- * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)
19
- */const Dropdown=({filter,label,onChange,options=[],theme,value})=>{let isValidValue=false;const optionElements=[];for(let i=0;i<options.length;++i){const option=options[i];if(!filter||filter(option)){let optionValue;let optionName;if(typeof option==="string"){optionName=option;optionValue=option}else{optionName=option.name||option.value;optionValue=option.value}isValidValue||=optionValue===value;optionElements.push(/*#__PURE__*/(0,_jsxRuntime.jsx)("option",{className:theme.option,value:optionValue,children:optionName},optionValue))}}// NOTE: This element represents the current `value` when it does not match
20
- // any valid option. In Chrome, and some other browsers, we are able to hide
21
- // it from the opened dropdown; in others, e.g. Safari, the best we can do is
22
- // to show it as disabled.
23
- const hiddenOption=isValidValue?null:/*#__PURE__*/(0,_jsxRuntime.jsx)("option",{disabled:true,className:theme.hiddenOption,value:value,children:value},"__reactUtilsHiddenOption");return/*#__PURE__*/(0,_jsxRuntime.jsxs)("div",{className:theme.container,children:[label===undefined?null:/*#__PURE__*/(0,_jsxRuntime.jsx)("p",{className:theme.label,children:label}),/*#__PURE__*/(0,_jsxRuntime.jsxs)("div",{className:theme.dropdown,children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)("select",{className:theme.select,onChange:onChange,value:value,children:[hiddenOption,optionElements]}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:theme.arrow,children:"\u25BC"})]})]})};const ThemedDropdown=(0,_reactThemes.default)(Dropdown,"Dropdown",validThemeKeys,defaultTheme);Dropdown.propTypes={filter:_propTypes.default.func,label:_propTypes.default.string,onChange:_propTypes.default.func,options:_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape({name:_propTypes.default.string,value:_propTypes.default.string.isRequired}),_propTypes.default.string]).isRequired),theme:ThemedDropdown.themeType.isRequired,value:_propTypes.default.string};Dropdown.defaultProps={filter:undefined,label:undefined,onChange:undefined,options:[],value:""};var _default=exports.default=ThemedDropdown;
24
- //# sourceMappingURL=index.js.map