@conduction/components 2.0.29 → 2.0.30
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/README.md +4 -0
- package/lib/components/formFields/checkbox.js +1 -1
- package/lib/components/formFields/select/select.js +3 -3
- package/lib/components/tag/Tag.js +1 -1
- package/package.json +1 -1
- package/src/components/formFields/checkbox.tsx +8 -1
- package/src/components/formFields/select/select.tsx +6 -0
- package/src/components/tag/Tag.tsx +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
- **Version 2**
|
|
6
6
|
|
|
7
|
+
- 2.0.30:
|
|
8
|
+
- Selects now have an z-index.
|
|
9
|
+
- Checkboxes now automatically have an id wich is a camelCase of "checkbox" plus the label, "checkboxLabel".
|
|
10
|
+
- Removed styles warning on tag.
|
|
7
11
|
- 2.0.29:
|
|
8
12
|
- Added remove option to tags.
|
|
9
13
|
- SelectSingle now removes selected option if filter deselect it.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { FormControlLabel } from "@gemeente-denhaag/components-react";
|
|
3
|
-
export const InputCheckbox = ({ name, validation, register, label, defaultChecked, disabled, }) => (_jsx(FormControlLabel, { input: _jsx("input", { type: "checkbox", ...{ defaultChecked, disabled }, ...register(name, { ...validation }) }), ...{ label } }));
|
|
3
|
+
export const InputCheckbox = ({ name, validation, register, label, defaultChecked, disabled, }) => (_jsx(FormControlLabel, { input: _jsx("input", { type: "checkbox", id: `checkbox${name}`, ...{ defaultChecked, disabled }, ...register(name, { ...validation }) }), ...{ label } }));
|
|
@@ -6,16 +6,16 @@ import CreatableSelect from "react-select/creatable";
|
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
export const SelectMultiple = ({ name, options, errors, control, validation, defaultValue, disabled, }) => {
|
|
8
8
|
return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
9
|
-
return (_jsx(ReactSelect, { className: clsx(styles.select, errors[name] && styles.error), isMulti: true, isDisabled: disabled, ...{ options, value, onChange, errors, defaultValue } }));
|
|
9
|
+
return (_jsx(ReactSelect, { className: clsx(styles.select, errors[name] && styles.error), isMulti: true, isDisabled: disabled, ...{ options, value, onChange, errors, defaultValue }, menuPortalTarget: document.body, styles: { menuPortal: (base) => ({ ...base, zIndex: 100 }) } }));
|
|
10
10
|
} }));
|
|
11
11
|
};
|
|
12
12
|
export const SelectCreate = ({ name, options, errors, control, validation, defaultValue, disabled, }) => {
|
|
13
13
|
return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
14
|
-
return (_jsx(CreatableSelect, { placeholder: "Select existing or create new entries", className: clsx(styles.select, errors[name] && styles.error), isMulti: true, isDisabled: disabled, ...{ options, value, onChange, errors, defaultValue } }));
|
|
14
|
+
return (_jsx(CreatableSelect, { placeholder: "Select existing or create new entries", className: clsx(styles.select, errors[name] && styles.error), isMulti: true, isDisabled: disabled, ...{ options, value, onChange, errors, defaultValue }, menuPortalTarget: document.body, styles: { menuPortal: (base) => ({ ...base, zIndex: 100 }) } }));
|
|
15
15
|
} }));
|
|
16
16
|
};
|
|
17
17
|
export const SelectSingle = ({ name, options, errors, control, validation, isClearable, defaultValue, disabled, }) => {
|
|
18
18
|
return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
19
|
-
return (_jsx(ReactSelect, { value: value || "", className: clsx(styles.select, errors[name] && styles.error), isDisabled: disabled, ...{ options, onChange, errors, isClearable, defaultValue } }));
|
|
19
|
+
return (_jsx(ReactSelect, { value: value || "", className: clsx(styles.select, errors[name] && styles.error), isDisabled: disabled, ...{ options, onChange, errors, isClearable, defaultValue }, menuPortalTarget: document.body, styles: { menuPortal: (base) => ({ ...base, zIndex: 100 }) } }));
|
|
20
20
|
} }));
|
|
21
21
|
};
|
|
@@ -3,4 +3,4 @@ import * as styles from "./Tag.module.css";
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
5
5
|
import { faXmark } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
-
export const Tag = ({ label, icon, onClick, remove, layoutClassName }) => (_jsxs("div", { className: remove && styles.tagContainer, children: [_jsxs("div", { className: clsx(styles.tag, [layoutClassName && layoutClassName], onClick && styles.clickable, remove && styles.remove), ...{ onClick }, children: [icon && _jsx("span", { children: icon }), _jsx("span", { children: label })] }), remove && (_jsx("div", { className: clsx(styles.tag, styles.removeTag), onClick: remove, children: _jsx("span", {
|
|
6
|
+
export const Tag = ({ label, icon, onClick, remove, layoutClassName }) => (_jsxs("div", { className: remove && styles.tagContainer, children: [_jsxs("div", { className: clsx(styles.tag, [layoutClassName && layoutClassName], onClick && styles.clickable, remove && styles.remove), ...{ onClick }, children: [icon && _jsx("span", { children: icon }), _jsx("span", { children: label })] }), remove && (_jsx("div", { className: clsx(styles.tag, styles.removeTag), onClick: remove, children: _jsx("span", { children: _jsx(FontAwesomeIcon, { icon: faXmark }) }) }))] }));
|
package/package.json
CHANGED
|
@@ -17,7 +17,14 @@ export const InputCheckbox: React.FC<ICheckboxProps & IReactHookFormProps> = ({
|
|
|
17
17
|
disabled,
|
|
18
18
|
}) => (
|
|
19
19
|
<FormControlLabel
|
|
20
|
-
input={
|
|
20
|
+
input={
|
|
21
|
+
<input
|
|
22
|
+
type="checkbox"
|
|
23
|
+
id={`checkbox${name}`}
|
|
24
|
+
{...{ defaultChecked, disabled }}
|
|
25
|
+
{...register(name, { ...validation })}
|
|
26
|
+
/>
|
|
27
|
+
}
|
|
21
28
|
{...{ label }}
|
|
22
29
|
/>
|
|
23
30
|
);
|
|
@@ -35,6 +35,8 @@ export const SelectMultiple: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
|
35
35
|
isMulti
|
|
36
36
|
isDisabled={disabled}
|
|
37
37
|
{...{ options, value, onChange, errors, defaultValue }}
|
|
38
|
+
menuPortalTarget={document.body}
|
|
39
|
+
styles={{ menuPortal: (base) => ({ ...base, zIndex: 100 }) }}
|
|
38
40
|
/>
|
|
39
41
|
);
|
|
40
42
|
}}
|
|
@@ -63,6 +65,8 @@ export const SelectCreate: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
|
63
65
|
isMulti
|
|
64
66
|
isDisabled={disabled}
|
|
65
67
|
{...{ options, value, onChange, errors, defaultValue }}
|
|
68
|
+
menuPortalTarget={document.body}
|
|
69
|
+
styles={{ menuPortal: (base) => ({ ...base, zIndex: 100 }) }}
|
|
66
70
|
/>
|
|
67
71
|
);
|
|
68
72
|
}}
|
|
@@ -91,6 +95,8 @@ export const SelectSingle: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
|
91
95
|
className={clsx(styles.select, errors[name] && styles.error)}
|
|
92
96
|
isDisabled={disabled}
|
|
93
97
|
{...{ options, onChange, errors, isClearable, defaultValue }}
|
|
98
|
+
menuPortalTarget={document.body}
|
|
99
|
+
styles={{ menuPortal: (base) => ({ ...base, zIndex: 100 }) }}
|
|
94
100
|
/>
|
|
95
101
|
);
|
|
96
102
|
}}
|
|
@@ -28,7 +28,7 @@ export const Tag: React.FC<TagProps> = ({ label, icon, onClick, remove, layoutCl
|
|
|
28
28
|
</div>
|
|
29
29
|
{remove && (
|
|
30
30
|
<div className={clsx(styles.tag, styles.removeTag)} onClick={remove}>
|
|
31
|
-
<span
|
|
31
|
+
<span>
|
|
32
32
|
<FontAwesomeIcon icon={faXmark} />
|
|
33
33
|
</span>
|
|
34
34
|
</div>
|