@rhc-shared-components/form-multi-select-component 0.0.8 → 0.1.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.
- package/CHANGELOG.md +65 -0
- package/dist/FormMultiSelectInput.d.ts +2 -0
- package/dist/index.js +22 -3
- package/dist/index.modern.js +23 -4
- package/package.json +5 -7
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [0.0.8](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-multi-select-component@0.0.7...@rhc-shared-components/form-multi-select-component@0.0.8) (2022-12-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rhc-shared-components/form-multi-select-component
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.0.7](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-multi-select-component@0.0.6...@rhc-shared-components/form-multi-select-component@0.0.7) (2022-12-06)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @rhc-shared-components/form-multi-select-component
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.0.6](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-multi-select-component@0.0.4...@rhc-shared-components/form-multi-select-component@0.0.6) (2022-12-06)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* added additional options ([a4e49e7](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/a4e49e7a049b40583200f96cc2f7f9456e4ea99c))
|
|
28
|
+
* fixed bugs removed max filter, updated eg ([3fedea1](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/3fedea120e3d93de365f2c9b19202ffe7f601612))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## [0.0.4](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-multi-select-component@0.0.2...@rhc-shared-components/form-multi-select-component@0.0.4) (2022-10-27)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* added setTouched prop in multiselect component. ([3b0b6ff](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/3b0b6ff0445995129bc2b2908861768a513339d8))
|
|
40
|
+
* added touched handler ([82e397e](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/82e397e3c8ae90944d3110dd5d7b3d5ff98b0589))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## 0.0.3 (2022-10-27)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* added meta.touched prop to the form multi select component. ([590886f](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/commit/590886fd8eb49a2153f6d5b512c6bd61cbae205c))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## [0.0.2](https://gitlab.cee.redhat.com/customer-platform/rhc-shared-components/compare/@rhc-shared-components/form-multi-select-component@0.0.1...@rhc-shared-components/form-multi-select-component@0.0.2) (2022-01-05)
|
|
56
|
+
|
|
57
|
+
**Note:** Version bump only for package @rhc-shared-components/form-multi-select-component
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## 0.0.1 (2021-12-06)
|
|
64
|
+
|
|
65
|
+
**Note:** Version bump only for package @rhc-shared-components/form-multi-select-component
|
|
@@ -3,6 +3,7 @@ import './styles.scss';
|
|
|
3
3
|
export interface IMultiSelectItem {
|
|
4
4
|
value: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
extraProps?: any;
|
|
6
7
|
}
|
|
7
8
|
export interface FormMultiSelectInputProps {
|
|
8
9
|
name: string;
|
|
@@ -16,6 +17,7 @@ export interface FormMultiSelectInputProps {
|
|
|
16
17
|
isDisabled?: boolean;
|
|
17
18
|
classNames?: string;
|
|
18
19
|
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent';
|
|
20
|
+
extraProps?: any;
|
|
19
21
|
}
|
|
20
22
|
declare const FormMultiSelectInput: React.FC<FormMultiSelectInputProps>;
|
|
21
23
|
export default FormMultiSelectInput;
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,24 @@ function _interopNamespace(e) {
|
|
|
24
24
|
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
26
|
|
|
27
|
+
function _extends() {
|
|
28
|
+
_extends = Object.assign || function (target) {
|
|
29
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
30
|
+
var source = arguments[i];
|
|
31
|
+
|
|
32
|
+
for (var key in source) {
|
|
33
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
34
|
+
target[key] = source[key];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return target;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return _extends.apply(this, arguments);
|
|
43
|
+
}
|
|
44
|
+
|
|
27
45
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
28
46
|
if (source == null) return {};
|
|
29
47
|
var target = {};
|
|
@@ -39,7 +57,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
39
57
|
return target;
|
|
40
58
|
}
|
|
41
59
|
|
|
42
|
-
var _excluded = ["label", "isRequired", "children", "selectOptions", "ariaLabel", "placeholder", "helperText", "maxHeight", "isDisabled", "classNames", "menuAppendTo"];
|
|
60
|
+
var _excluded = ["label", "isRequired", "children", "selectOptions", "ariaLabel", "placeholder", "helperText", "maxHeight", "isDisabled", "classNames", "menuAppendTo", "extraProps"];
|
|
43
61
|
|
|
44
62
|
var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
45
63
|
var label = _ref.label,
|
|
@@ -53,6 +71,7 @@ var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
|
53
71
|
isDisabled = _ref.isDisabled,
|
|
54
72
|
classNames = _ref.classNames,
|
|
55
73
|
menuAppendTo = _ref.menuAppendTo,
|
|
74
|
+
extraProps = _ref.extraProps,
|
|
56
75
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
57
76
|
|
|
58
77
|
var _useField = formik.useField(rest),
|
|
@@ -112,14 +131,14 @@ var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
|
112
131
|
className: classNames
|
|
113
132
|
}, menuAppendTo && {
|
|
114
133
|
menuAppendTo: menuAppendTo
|
|
115
|
-
}, rest), lodash.map(selectOptions, function (option, index) {
|
|
134
|
+
}, extraProps && _extends({}, extraProps), rest), lodash.map(selectOptions, function (option, index) {
|
|
116
135
|
return React__namespace.createElement(reactCore.SelectOption, Object.assign({
|
|
117
136
|
key: index,
|
|
118
137
|
value: option.value,
|
|
119
138
|
label: option.value
|
|
120
139
|
}, option.description && {
|
|
121
140
|
description: option.description
|
|
122
|
-
}));
|
|
141
|
+
}, option.extraProps && _extends({}, option.extraProps)));
|
|
123
142
|
}))));
|
|
124
143
|
};
|
|
125
144
|
|
package/dist/index.modern.js
CHANGED
|
@@ -4,6 +4,24 @@ import { ValidatedOptions, Select, SelectVariant, SelectOption } from '@patternf
|
|
|
4
4
|
import { FormGroupContainer } from '@rhc-shared-components/form-group-container';
|
|
5
5
|
import { map } from 'lodash';
|
|
6
6
|
|
|
7
|
+
function _extends() {
|
|
8
|
+
_extends = Object.assign || function (target) {
|
|
9
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
10
|
+
var source = arguments[i];
|
|
11
|
+
|
|
12
|
+
for (var key in source) {
|
|
13
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
14
|
+
target[key] = source[key];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return target;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return _extends.apply(this, arguments);
|
|
23
|
+
}
|
|
24
|
+
|
|
7
25
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
8
26
|
if (source == null) return {};
|
|
9
27
|
var target = {};
|
|
@@ -19,7 +37,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
19
37
|
return target;
|
|
20
38
|
}
|
|
21
39
|
|
|
22
|
-
const _excluded = ["label", "isRequired", "children", "selectOptions", "ariaLabel", "placeholder", "helperText", "maxHeight", "isDisabled", "classNames", "menuAppendTo"];
|
|
40
|
+
const _excluded = ["label", "isRequired", "children", "selectOptions", "ariaLabel", "placeholder", "helperText", "maxHeight", "isDisabled", "classNames", "menuAppendTo", "extraProps"];
|
|
23
41
|
|
|
24
42
|
const FormMultiSelectInput = _ref => {
|
|
25
43
|
let {
|
|
@@ -32,7 +50,8 @@ const FormMultiSelectInput = _ref => {
|
|
|
32
50
|
maxHeight,
|
|
33
51
|
isDisabled,
|
|
34
52
|
classNames,
|
|
35
|
-
menuAppendTo
|
|
53
|
+
menuAppendTo,
|
|
54
|
+
extraProps
|
|
36
55
|
} = _ref,
|
|
37
56
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
38
57
|
|
|
@@ -88,13 +107,13 @@ const FormMultiSelectInput = _ref => {
|
|
|
88
107
|
className: classNames
|
|
89
108
|
}, menuAppendTo && {
|
|
90
109
|
menuAppendTo
|
|
91
|
-
}, rest), map(selectOptions, (option, index) => React.createElement(SelectOption, Object.assign({
|
|
110
|
+
}, extraProps && _extends({}, extraProps), rest), map(selectOptions, (option, index) => React.createElement(SelectOption, Object.assign({
|
|
92
111
|
key: index,
|
|
93
112
|
value: option.value,
|
|
94
113
|
label: option.value
|
|
95
114
|
}, option.description && {
|
|
96
115
|
description: option.description
|
|
97
|
-
}))))));
|
|
116
|
+
}, option.extraProps && _extends({}, option.extraProps)))))));
|
|
98
117
|
};
|
|
99
118
|
|
|
100
119
|
export { FormMultiSelectInput };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhc-shared-components/form-multi-select-component",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "project description",
|
|
5
5
|
"author": "shkale",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"react-dom": ">=16.13.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@rhc-shared-components/form-group-container": "^0.2.9",
|
|
34
33
|
"@testing-library/jest-dom": "^4.2.4",
|
|
35
34
|
"@testing-library/react": "^9.5.0",
|
|
36
35
|
"@testing-library/user-event": "^7.2.1",
|
|
@@ -53,18 +52,18 @@
|
|
|
53
52
|
"eslint-plugin-react": "^7.17.0",
|
|
54
53
|
"eslint-plugin-standard": "^4.0.1",
|
|
55
54
|
"microbundle": "^0.13.3",
|
|
56
|
-
"node-sass": "^4.0.0",
|
|
57
55
|
"npm-run-all": "^4.1.5",
|
|
58
56
|
"prettier": "^2.0.4",
|
|
59
57
|
"react": "^16.13.1",
|
|
60
58
|
"react-dom": "^16.13.1",
|
|
61
59
|
"react-scripts": "^3.4.1",
|
|
62
60
|
"rimraf": "^3.0.2",
|
|
61
|
+
"sass": "^1.57.1",
|
|
63
62
|
"typescript": "^3.7.5"
|
|
64
63
|
},
|
|
65
64
|
"dependencies": {
|
|
66
|
-
"@patternfly/react-core": "^4.
|
|
67
|
-
"@rhc-shared-components/form-group-container": "^0.2
|
|
65
|
+
"@patternfly/react-core": "^4.276.6",
|
|
66
|
+
"@rhc-shared-components/form-group-container": "^0.3.2",
|
|
68
67
|
"@types/lodash": "^4.14.177",
|
|
69
68
|
"formik": "^2.1.4",
|
|
70
69
|
"lodash": "^4.17.21",
|
|
@@ -76,6 +75,5 @@
|
|
|
76
75
|
],
|
|
77
76
|
"publishConfig": {
|
|
78
77
|
"access": "public"
|
|
79
|
-
}
|
|
80
|
-
"gitHead": "7d6f877710b011c16c52b143698bec2a7595afd5"
|
|
78
|
+
}
|
|
81
79
|
}
|