@rhc-shared-components/form-multi-select-component 0.1.0 → 0.1.1
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/dist/FormMultiSelectInput.d.ts +2 -0
- package/dist/index.js +6 -1
- package/dist/index.modern.js +6 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import './styles.scss';
|
|
|
3
3
|
export interface IMultiSelectItem {
|
|
4
4
|
value: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
isDisabled?: boolean;
|
|
6
7
|
extraProps?: any;
|
|
7
8
|
}
|
|
8
9
|
export interface FormMultiSelectInputProps {
|
|
@@ -17,6 +18,7 @@ export interface FormMultiSelectInputProps {
|
|
|
17
18
|
isDisabled?: boolean;
|
|
18
19
|
classNames?: string;
|
|
19
20
|
menuAppendTo?: HTMLElement | (() => HTMLElement) | 'inline' | 'parent';
|
|
21
|
+
chipGroupComponent?: React.ReactNode;
|
|
20
22
|
extraProps?: any;
|
|
21
23
|
}
|
|
22
24
|
declare const FormMultiSelectInput: React.FC<FormMultiSelectInputProps>;
|
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
57
57
|
return target;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
var _excluded = ["label", "isRequired", "children", "selectOptions", "ariaLabel", "placeholder", "helperText", "maxHeight", "isDisabled", "classNames", "menuAppendTo", "extraProps"];
|
|
60
|
+
var _excluded = ["label", "isRequired", "children", "selectOptions", "ariaLabel", "placeholder", "helperText", "maxHeight", "isDisabled", "classNames", "menuAppendTo", "chipGroupComponent", "extraProps"];
|
|
61
61
|
|
|
62
62
|
var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
63
63
|
var label = _ref.label,
|
|
@@ -71,6 +71,7 @@ var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
|
71
71
|
isDisabled = _ref.isDisabled,
|
|
72
72
|
classNames = _ref.classNames,
|
|
73
73
|
menuAppendTo = _ref.menuAppendTo,
|
|
74
|
+
chipGroupComponent = _ref.chipGroupComponent,
|
|
74
75
|
extraProps = _ref.extraProps,
|
|
75
76
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
76
77
|
|
|
@@ -127,6 +128,8 @@ var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
|
127
128
|
}, {
|
|
128
129
|
isDisabled: isSubmitting || isDisabled,
|
|
129
130
|
"aria-label": ariaLabel
|
|
131
|
+
}, chipGroupComponent && {
|
|
132
|
+
chipGroupComponent: chipGroupComponent
|
|
130
133
|
}, classNames && {
|
|
131
134
|
className: classNames
|
|
132
135
|
}, menuAppendTo && {
|
|
@@ -138,6 +141,8 @@ var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
|
138
141
|
label: option.value
|
|
139
142
|
}, option.description && {
|
|
140
143
|
description: option.description
|
|
144
|
+
}, option.isDisabled && {
|
|
145
|
+
isDisabled: option.isDisabled
|
|
141
146
|
}, option.extraProps && _extends({}, option.extraProps)));
|
|
142
147
|
}))));
|
|
143
148
|
};
|
package/dist/index.modern.js
CHANGED
|
@@ -37,7 +37,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
37
37
|
return target;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const _excluded = ["label", "isRequired", "children", "selectOptions", "ariaLabel", "placeholder", "helperText", "maxHeight", "isDisabled", "classNames", "menuAppendTo", "extraProps"];
|
|
40
|
+
const _excluded = ["label", "isRequired", "children", "selectOptions", "ariaLabel", "placeholder", "helperText", "maxHeight", "isDisabled", "classNames", "menuAppendTo", "chipGroupComponent", "extraProps"];
|
|
41
41
|
|
|
42
42
|
const FormMultiSelectInput = _ref => {
|
|
43
43
|
let {
|
|
@@ -51,6 +51,7 @@ const FormMultiSelectInput = _ref => {
|
|
|
51
51
|
isDisabled,
|
|
52
52
|
classNames,
|
|
53
53
|
menuAppendTo,
|
|
54
|
+
chipGroupComponent,
|
|
54
55
|
extraProps
|
|
55
56
|
} = _ref,
|
|
56
57
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
@@ -103,6 +104,8 @@ const FormMultiSelectInput = _ref => {
|
|
|
103
104
|
}, {
|
|
104
105
|
isDisabled: isSubmitting || isDisabled,
|
|
105
106
|
"aria-label": ariaLabel
|
|
107
|
+
}, chipGroupComponent && {
|
|
108
|
+
chipGroupComponent
|
|
106
109
|
}, classNames && {
|
|
107
110
|
className: classNames
|
|
108
111
|
}, menuAppendTo && {
|
|
@@ -113,6 +116,8 @@ const FormMultiSelectInput = _ref => {
|
|
|
113
116
|
label: option.value
|
|
114
117
|
}, option.description && {
|
|
115
118
|
description: option.description
|
|
119
|
+
}, option.isDisabled && {
|
|
120
|
+
isDisabled: option.isDisabled
|
|
116
121
|
}, option.extraProps && _extends({}, option.extraProps)))))));
|
|
117
122
|
};
|
|
118
123
|
|