@nestio/pam 2.0.8 → 2.0.9-beta.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/.buildkite/docker-compose-ci.yml +1 -1
- package/.buildkite/test.sh +1 -1
- package/.nvmrc +1 -0
- package/README.md +1 -1
- package/examples/components/Async.jsx +6 -0
- package/examples/components/CalendarSelect.jsx +5 -0
- package/examples/components/Select.jsx +17 -0
- package/examples/components/TabbedSelect.jsx +1 -0
- package/lib/components/AsyncSelect.js +4 -2
- package/lib/components/BadgeMultiSelect.js +4 -2
- package/lib/components/CalendarInput.js +5 -2
- package/lib/components/CalendarRangeSelect.js +2 -1
- package/lib/components/CalendarSelect.js +5 -2
- package/lib/components/MultiSelect.js +4 -2
- package/lib/components/SelectCore.js +5 -2
- package/lib/components/SingleSelect.js +4 -2
- package/lib/components/TabbedSelect.js +4 -2
- package/lib/components/TagBoxMenuSelect.js +4 -2
- package/lib/components/TagBoxValueSelect.js +4 -2
- package/package.json +1 -1
- package/src/components/AsyncSelect.jsx +3 -1
- package/src/components/BadgeMultiSelect.jsx +3 -1
- package/src/components/CalendarInput.jsx +3 -1
- package/src/components/CalendarRangeSelect.jsx +2 -1
- package/src/components/CalendarSelect.jsx +3 -1
- package/src/components/MultiSelect.jsx +3 -1
- package/src/components/SelectCore.jsx +5 -2
- package/src/components/SingleSelect.jsx +3 -1
- package/src/components/TabbedSelect.jsx +3 -1
- package/src/components/TagBoxMenuSelect.jsx +3 -1
- package/src/components/TagBoxValueSelect.jsx +2 -0
package/.buildkite/test.sh
CHANGED
|
@@ -7,7 +7,7 @@ set -eo pipefail
|
|
|
7
7
|
DOCKER_RUN_APP_CMD="docker-compose -f ./.buildkite/docker-compose-ci.yml run --rm pam"
|
|
8
8
|
|
|
9
9
|
echo -e "--- Setting Up Environment"
|
|
10
|
-
$DOCKER_RUN_APP_CMD /bin/bash -c "rm -rf node_modules && rm -rf lib && npm
|
|
10
|
+
$DOCKER_RUN_APP_CMD /bin/bash -c "rm -rf node_modules && rm -rf lib && npm ci"
|
|
11
11
|
|
|
12
12
|
echo -e "--- Running JS Tests"
|
|
13
13
|
$DOCKER_RUN_APP_CMD npm run test
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
12
|
package/README.md
CHANGED
|
@@ -77,6 +77,7 @@ export default function AsyncPage () {
|
|
|
77
77
|
loadOptions={APISpoofer}
|
|
78
78
|
processLoadOptions={processLoadOptions}
|
|
79
79
|
minLength={2}
|
|
80
|
+
id="async-single-select"
|
|
80
81
|
/>
|
|
81
82
|
</ExamplePanel>
|
|
82
83
|
<ExamplePanel title="Disabled Async Single Select">
|
|
@@ -85,6 +86,7 @@ export default function AsyncPage () {
|
|
|
85
86
|
processLoadOptions={processLoadOptions}
|
|
86
87
|
minLength={2}
|
|
87
88
|
disabled
|
|
89
|
+
id="disabled-async-single-select"
|
|
88
90
|
/>
|
|
89
91
|
</ExamplePanel>
|
|
90
92
|
<ExamplePanel title="Async Multi Select">
|
|
@@ -92,6 +94,7 @@ export default function AsyncPage () {
|
|
|
92
94
|
loadOptions={APISpoofer}
|
|
93
95
|
processLoadOptions={processLoadOptions}
|
|
94
96
|
multiple={true}
|
|
97
|
+
id="async-multi-select"
|
|
95
98
|
/>
|
|
96
99
|
</ExamplePanel>
|
|
97
100
|
<ExamplePanel title="Async Single Select, Search Form Styling">
|
|
@@ -100,6 +103,7 @@ export default function AsyncPage () {
|
|
|
100
103
|
processLoadOptions={processLoadOptions}
|
|
101
104
|
useSearchFormStyle={true}
|
|
102
105
|
label={'Things'}
|
|
106
|
+
id="search-form-style-async-single-select"
|
|
103
107
|
/>
|
|
104
108
|
</ExamplePanel>
|
|
105
109
|
<ExamplePanel title="Async Multi Select, Search Form Styling">
|
|
@@ -108,12 +112,14 @@ export default function AsyncPage () {
|
|
|
108
112
|
processLoadOptions={processLoadOptions}
|
|
109
113
|
multiple={true}
|
|
110
114
|
useSearchFormStyle={true}
|
|
115
|
+
id="search-form-style-async-multi-select"
|
|
111
116
|
/>
|
|
112
117
|
</ExamplePanel>
|
|
113
118
|
<ExamplePanel title="Multiple Data Sets">
|
|
114
119
|
<AsyncSelect
|
|
115
120
|
loadOptions={loadMultipleDatasets}
|
|
116
121
|
optionSets={['Window', 'Console']}
|
|
122
|
+
id="async-multiple-datasets-select"
|
|
117
123
|
/>
|
|
118
124
|
</ExamplePanel>
|
|
119
125
|
<ExamplePanel title="Loading initial options asynchronously">
|
|
@@ -13,6 +13,7 @@ export default function CalendarSelectPage () {
|
|
|
13
13
|
format="MM-DD-YYYY"
|
|
14
14
|
valueLabel="Select Date OK?"
|
|
15
15
|
minDate={moment()}
|
|
16
|
+
id="calendar-select"
|
|
16
17
|
/>
|
|
17
18
|
</ExamplePanel>
|
|
18
19
|
<ExamplePanel title="Calendar Input">
|
|
@@ -23,6 +24,7 @@ export default function CalendarSelectPage () {
|
|
|
23
24
|
defaultValue="01/01/2019"
|
|
24
25
|
mask="99/99/9999"
|
|
25
26
|
maskChar=" "
|
|
27
|
+
id="calendar-input"
|
|
26
28
|
ariaHidden={true}
|
|
27
29
|
ariaLabelledBy="calendar-input-label"
|
|
28
30
|
ariaDescription="Format: MM/DD/YYYY"
|
|
@@ -36,6 +38,7 @@ export default function CalendarSelectPage () {
|
|
|
36
38
|
mask="99/99/9999"
|
|
37
39
|
maskChar=" "
|
|
38
40
|
disabled
|
|
41
|
+
id="calendar-input-disabled"
|
|
39
42
|
/>
|
|
40
43
|
</ExamplePanel>
|
|
41
44
|
<ExamplePanel title="Defaultable Calendar Select">
|
|
@@ -44,12 +47,14 @@ export default function CalendarSelectPage () {
|
|
|
44
47
|
valueLabel="Select Date OK?"
|
|
45
48
|
minDate={moment()}
|
|
46
49
|
defaultValue={moment().add(364, 'day')}
|
|
50
|
+
id="defaultable-calendar-select"
|
|
47
51
|
/>
|
|
48
52
|
</ExamplePanel>
|
|
49
53
|
<ExamplePanel title="Calendar Range Select">
|
|
50
54
|
<CalendarRangeSelect
|
|
51
55
|
format="MM-DD-YYYY"
|
|
52
56
|
valueLabel="Select Date Range"
|
|
57
|
+
id="calendar-range-select"
|
|
53
58
|
/>
|
|
54
59
|
</ExamplePanel>
|
|
55
60
|
</Page>
|
|
@@ -124,6 +124,7 @@ export default function SelectPage () {
|
|
|
124
124
|
options={basicOptions}
|
|
125
125
|
value={13}
|
|
126
126
|
ariaLabel="Basic select label"
|
|
127
|
+
id="basic-select"
|
|
127
128
|
/>
|
|
128
129
|
</ExamplePanel>
|
|
129
130
|
<ExamplePanel title="Selects with multiple sets">
|
|
@@ -134,6 +135,7 @@ export default function SelectPage () {
|
|
|
134
135
|
options={multipleSetOptions}
|
|
135
136
|
optionSets={['Set 1', 'Set 2']}
|
|
136
137
|
value={0}
|
|
138
|
+
id="multiple-sets-select"
|
|
137
139
|
/>
|
|
138
140
|
</div>
|
|
139
141
|
</label>
|
|
@@ -146,6 +148,7 @@ export default function SelectPage () {
|
|
|
146
148
|
options={multipleSetOptions}
|
|
147
149
|
optionSets={['Set 1', 'Set 2']}
|
|
148
150
|
value={[0]}
|
|
151
|
+
id="multi-select-multiple-sets"
|
|
149
152
|
/>
|
|
150
153
|
</div>
|
|
151
154
|
</label>
|
|
@@ -156,6 +159,7 @@ export default function SelectPage () {
|
|
|
156
159
|
value="1"
|
|
157
160
|
filterable={true}
|
|
158
161
|
onChangeText={(t) => console.log(t)}
|
|
162
|
+
id="filterable-select"
|
|
159
163
|
/>
|
|
160
164
|
</ExamplePanel>
|
|
161
165
|
<ExamplePanel title="Custom Option Select">
|
|
@@ -163,6 +167,7 @@ export default function SelectPage () {
|
|
|
163
167
|
options={customOptions}
|
|
164
168
|
renderOptionLabel={renderCustomOption}
|
|
165
169
|
renderValueLabel={renderCustomValue}
|
|
170
|
+
id="custom-option-select"
|
|
166
171
|
/>
|
|
167
172
|
</ExamplePanel>
|
|
168
173
|
<ExamplePanel title="Disabled Select">
|
|
@@ -170,6 +175,7 @@ export default function SelectPage () {
|
|
|
170
175
|
options={basicOptions}
|
|
171
176
|
value="1"
|
|
172
177
|
disabled={true}
|
|
178
|
+
id="disabled-select"
|
|
173
179
|
/>
|
|
174
180
|
</ExamplePanel>
|
|
175
181
|
<ExamplePanel title="Multiple Select">
|
|
@@ -178,6 +184,7 @@ export default function SelectPage () {
|
|
|
178
184
|
placeholder="Choices"
|
|
179
185
|
value={[1]}
|
|
180
186
|
ariaLabel="Multi select label"
|
|
187
|
+
id="multiple-select"
|
|
181
188
|
/>
|
|
182
189
|
</ExamplePanel>
|
|
183
190
|
<ExamplePanel title="Tagbox Value Select">
|
|
@@ -185,6 +192,7 @@ export default function SelectPage () {
|
|
|
185
192
|
options={basicOptions}
|
|
186
193
|
placeholder="Choices"
|
|
187
194
|
value={[1]}
|
|
195
|
+
id="tagbox-value-select"
|
|
188
196
|
/>
|
|
189
197
|
</ExamplePanel>
|
|
190
198
|
<ExamplePanel title="Tagbox Value Disabled Select">
|
|
@@ -193,6 +201,7 @@ export default function SelectPage () {
|
|
|
193
201
|
placeholder="Choices"
|
|
194
202
|
value={[1, 2]}
|
|
195
203
|
disabled={true}
|
|
204
|
+
id="disabled-tagbox-value-select"
|
|
196
205
|
/>
|
|
197
206
|
</ExamplePanel>
|
|
198
207
|
<ExamplePanel title="Tagbox Value Not Filterable">
|
|
@@ -200,6 +209,8 @@ export default function SelectPage () {
|
|
|
200
209
|
options={basicOptions}
|
|
201
210
|
placeholder="Choices"
|
|
202
211
|
filterable={false}
|
|
212
|
+
id="not-filterable-tagbox-value-select"
|
|
213
|
+
|
|
203
214
|
/>
|
|
204
215
|
</ExamplePanel>
|
|
205
216
|
<ExamplePanel title="Tagbox Menu Select">
|
|
@@ -207,6 +218,7 @@ export default function SelectPage () {
|
|
|
207
218
|
options={hugeOptions}
|
|
208
219
|
valueLabel="Choices"
|
|
209
220
|
value={[1]}
|
|
221
|
+
id="tagbox-menu-select"
|
|
210
222
|
/>
|
|
211
223
|
</ExamplePanel>
|
|
212
224
|
<ExamplePanel title="Disabled Tagbox Menu Select">
|
|
@@ -215,6 +227,7 @@ export default function SelectPage () {
|
|
|
215
227
|
disabled={true}
|
|
216
228
|
valueLabel="Choices"
|
|
217
229
|
value={[1]}
|
|
230
|
+
id="disabled-tagbox-menu-select"
|
|
218
231
|
/>
|
|
219
232
|
</ExamplePanel>
|
|
220
233
|
<ExamplePanel title="Badge Menu Select">
|
|
@@ -222,6 +235,7 @@ export default function SelectPage () {
|
|
|
222
235
|
options={customOptions}
|
|
223
236
|
renderOptionLabel={renderCustomOption}
|
|
224
237
|
valueLabel="Choices"
|
|
238
|
+
id="badge-menu-select"
|
|
225
239
|
/>
|
|
226
240
|
</ExamplePanel>
|
|
227
241
|
<ExamplePanel title="Disabled Badge Menu Select">
|
|
@@ -230,6 +244,7 @@ export default function SelectPage () {
|
|
|
230
244
|
disabled={true}
|
|
231
245
|
renderOptionLabel={renderCustomOption}
|
|
232
246
|
valueLabel="Choices"
|
|
247
|
+
id="disabled-badge-menu-select"
|
|
233
248
|
/>
|
|
234
249
|
</ExamplePanel>
|
|
235
250
|
<ExamplePanel title="Programmatic Manipulation">
|
|
@@ -238,12 +253,14 @@ export default function SelectPage () {
|
|
|
238
253
|
<ExamplePanel title="Custom Option Classname">
|
|
239
254
|
<MultiSelect
|
|
240
255
|
options={customClassNameOptions}
|
|
256
|
+
id="custom-option-classname-select"
|
|
241
257
|
/>
|
|
242
258
|
</ExamplePanel>
|
|
243
259
|
<ExamplePanel title="Collapsible Multiselect">
|
|
244
260
|
<TagBoxMenuSelect
|
|
245
261
|
options={collapsibleOptions}
|
|
246
262
|
collapsibleOptions={[1, 3]}
|
|
263
|
+
id="collapsible-multiselect"
|
|
247
264
|
/>
|
|
248
265
|
</ExamplePanel>
|
|
249
266
|
</Page>
|
|
@@ -144,7 +144,8 @@ function AsyncSelect(props) {
|
|
|
144
144
|
processLoadOptions: props.processLoadOptions,
|
|
145
145
|
renderValueLabel: props.renderValueLabel,
|
|
146
146
|
renderOptionLabel: props.renderOptionLabel,
|
|
147
|
-
value: props.value
|
|
147
|
+
value: props.value,
|
|
148
|
+
id: props.id
|
|
148
149
|
}));
|
|
149
150
|
}
|
|
150
151
|
|
|
@@ -182,5 +183,6 @@ AsyncSelect.propTypes = {
|
|
|
182
183
|
renderOptionLabel: _propTypes2.default.func,
|
|
183
184
|
renderValueLabel: _propTypes2.default.func,
|
|
184
185
|
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array, _propTypes2.default.object]),
|
|
185
|
-
ValueComponent: _propTypes2.default.func
|
|
186
|
+
ValueComponent: _propTypes2.default.func,
|
|
187
|
+
id: _propTypes2.default.string
|
|
186
188
|
};
|
|
@@ -59,7 +59,8 @@ function BadgeMultiSelect(props) {
|
|
|
59
59
|
onClose: props.onClose,
|
|
60
60
|
options: props.options,
|
|
61
61
|
renderOptionLabel: props.renderOptionLabel,
|
|
62
|
-
valueLabel: props.valueLabel
|
|
62
|
+
valueLabel: props.valueLabel,
|
|
63
|
+
id: props.id
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
|
|
@@ -74,5 +75,6 @@ BadgeMultiSelect.propTypes = {
|
|
|
74
75
|
options: _propTypes2.default.array.isRequired,
|
|
75
76
|
renderOptionLabel: _propTypes2.default.func,
|
|
76
77
|
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array]),
|
|
77
|
-
valueLabel: _propTypes2.default.string.isRequired
|
|
78
|
+
valueLabel: _propTypes2.default.string.isRequired,
|
|
79
|
+
id: _propTypes2.default.string
|
|
78
80
|
};
|
|
@@ -63,7 +63,9 @@ var CalendarInput = exports.CalendarInput = function CalendarInput(props) {
|
|
|
63
63
|
MenuComponent: CalendarSelectMenuWrap,
|
|
64
64
|
ValueComponent: InputWrap,
|
|
65
65
|
valueAdapter: valueAdapter
|
|
66
|
-
}, restProps
|
|
66
|
+
}, restProps, {
|
|
67
|
+
id: props.id
|
|
68
|
+
}));
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
var CalendarSelectMenuWrap = exports.CalendarSelectMenuWrap = function (_PureComponent) {
|
|
@@ -204,7 +206,8 @@ CalendarInput.propTypes = {
|
|
|
204
206
|
/**
|
|
205
207
|
onChange function to get value
|
|
206
208
|
*/
|
|
207
|
-
onChange: _propTypes2.default.func
|
|
209
|
+
onChange: _propTypes2.default.func,
|
|
210
|
+
id: _propTypes2.default.string
|
|
208
211
|
};
|
|
209
212
|
|
|
210
213
|
CalendarInput.defaultProps = {
|
|
@@ -133,7 +133,8 @@ CalendarRangeSelect.propTypes = {
|
|
|
133
133
|
/**
|
|
134
134
|
Component to display the Value
|
|
135
135
|
*/
|
|
136
|
-
ValueComponent: _propTypes2.default.func
|
|
136
|
+
ValueComponent: _propTypes2.default.func,
|
|
137
|
+
id: _propTypes2.default.string
|
|
137
138
|
};
|
|
138
139
|
|
|
139
140
|
CalendarRangeSelect.defaultProps = {
|
|
@@ -67,7 +67,9 @@ function CalendarSelect(props) {
|
|
|
67
67
|
renderValueLabel: renderValueLabel(format, valueLabel),
|
|
68
68
|
value: value || null,
|
|
69
69
|
valueAdapter: valueAdapter
|
|
70
|
-
}, restProps
|
|
70
|
+
}, restProps, {
|
|
71
|
+
id: props.id
|
|
72
|
+
}));
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
CalendarSelect.propTypes = {
|
|
@@ -83,7 +85,8 @@ CalendarSelect.propTypes = {
|
|
|
83
85
|
Label displayed if no value is selected
|
|
84
86
|
*/
|
|
85
87
|
valueLabel: _propTypes2.default.string,
|
|
86
|
-
ValueComponent: _propTypes2.default.func.isRequired
|
|
88
|
+
ValueComponent: _propTypes2.default.func.isRequired,
|
|
89
|
+
id: _propTypes2.default.string
|
|
87
90
|
};
|
|
88
91
|
|
|
89
92
|
CalendarSelect.defaultProps = {
|
|
@@ -63,7 +63,8 @@ function MultiSelect(props) {
|
|
|
63
63
|
value: props.value,
|
|
64
64
|
valueAdapter: valueAdapter,
|
|
65
65
|
ValueComponent: props.ValueComponent,
|
|
66
|
-
collapsibleOptions: props.collapsibleOptions
|
|
66
|
+
collapsibleOptions: props.collapsibleOptions,
|
|
67
|
+
id: props.id
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -83,7 +84,8 @@ MultiSelect.propTypes = {
|
|
|
83
84
|
renderOptionLabel: _propTypes2.default.func,
|
|
84
85
|
renderValueLabel: _propTypes2.default.func,
|
|
85
86
|
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array]),
|
|
86
|
-
ValueComponent: _propTypes2.default.func.isRequired
|
|
87
|
+
ValueComponent: _propTypes2.default.func.isRequired,
|
|
88
|
+
id: _propTypes2.default.string
|
|
87
89
|
};
|
|
88
90
|
|
|
89
91
|
MultiSelect.defaultProps = {
|
|
@@ -815,7 +815,7 @@ var SelectCore = function (_Component) {
|
|
|
815
815
|
value: function render() {
|
|
816
816
|
return _react2.default.createElement(
|
|
817
817
|
'div',
|
|
818
|
-
{ className: _SelectCore2.default.select },
|
|
818
|
+
{ className: _SelectCore2.default.select, id: this.props.id },
|
|
819
819
|
this.renderValue(),
|
|
820
820
|
(this.state.isOpen || this.props.alwaysOpen) && this.renderMenu()
|
|
821
821
|
);
|
|
@@ -958,7 +958,10 @@ SelectCore.propTypes = {
|
|
|
958
958
|
filterable: _propTypes2.default.bool,
|
|
959
959
|
onOptionsFiltered: _propTypes2.default.func,
|
|
960
960
|
onChangeText: _propTypes2.default.func,
|
|
961
|
-
collapsibleOptions: _propTypes2.default.array
|
|
961
|
+
collapsibleOptions: _propTypes2.default.array,
|
|
962
|
+
|
|
963
|
+
// add a unique id for testing purposes and accessibility
|
|
964
|
+
id: _propTypes2.default.string
|
|
962
965
|
|
|
963
966
|
};
|
|
964
967
|
|
|
@@ -75,7 +75,8 @@ function SingleSelect(props) {
|
|
|
75
75
|
renderValueLabel: props.renderValueLabel,
|
|
76
76
|
renderOptionLabel: props.renderOptionLabel,
|
|
77
77
|
unselectOnClick: props.unselectOnClick,
|
|
78
|
-
value: props.value
|
|
78
|
+
value: props.value,
|
|
79
|
+
id: props.id
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -100,7 +101,8 @@ SingleSelect.propTypes = {
|
|
|
100
101
|
unselectOnClick: _propTypes2.default.bool,
|
|
101
102
|
optionSets: _propTypes2.default.array,
|
|
102
103
|
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),
|
|
103
|
-
ValueComponent: _propTypes2.default.func
|
|
104
|
+
ValueComponent: _propTypes2.default.func,
|
|
105
|
+
id: _propTypes2.default.string
|
|
104
106
|
};
|
|
105
107
|
|
|
106
108
|
SingleSelect.defaultProps = {
|
|
@@ -54,7 +54,8 @@ function TabbedSelect(props) {
|
|
|
54
54
|
onOpen: props.onOpen,
|
|
55
55
|
onClose: props.onClose,
|
|
56
56
|
valueLabel: props.valueLabel,
|
|
57
|
-
value: props.value
|
|
57
|
+
value: props.value,
|
|
58
|
+
id: props.id
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -68,7 +69,8 @@ TabbedSelect.propTypes = {
|
|
|
68
69
|
onOpen: _propTypes2.default.func,
|
|
69
70
|
options: _propTypes2.default.array.isRequired,
|
|
70
71
|
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array]),
|
|
71
|
-
valueLabel: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array])
|
|
72
|
+
valueLabel: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array]),
|
|
73
|
+
id: _propTypes2.default.string
|
|
72
74
|
};
|
|
73
75
|
|
|
74
76
|
// Tabs -> {name: '', choices: [{label, value}]}
|
|
@@ -60,7 +60,8 @@ function TagBoxMenuSelect(props) {
|
|
|
60
60
|
renderOptionLabel: props.renderOptionLabel,
|
|
61
61
|
value: props.value,
|
|
62
62
|
ValueComponent: props.ValueComponent,
|
|
63
|
-
valueLabel: props.valueLabel || 'Choices'
|
|
63
|
+
valueLabel: props.valueLabel || 'Choices',
|
|
64
|
+
id: props.id
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
|
|
@@ -77,7 +78,8 @@ TagBoxMenuSelect.propTypes = {
|
|
|
77
78
|
renderValueLabel: _propTypes2.default.func,
|
|
78
79
|
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array]),
|
|
79
80
|
valueLabel: _propTypes2.default.string,
|
|
80
|
-
ValueComponent: _propTypes2.default.func.isRequired
|
|
81
|
+
ValueComponent: _propTypes2.default.func.isRequired,
|
|
82
|
+
id: _propTypes2.default.string
|
|
81
83
|
};
|
|
82
84
|
|
|
83
85
|
TagBoxMenuSelect.defaultProps = {
|
|
@@ -63,7 +63,8 @@ function TagBoxValueSelect(props) {
|
|
|
63
63
|
options: props.options,
|
|
64
64
|
renderValueLabel: props.renderValueLabel,
|
|
65
65
|
renderOptionLabel: props.renderOptionLabel,
|
|
66
|
-
disabled: props.disabled
|
|
66
|
+
disabled: props.disabled,
|
|
67
|
+
id: props.id
|
|
67
68
|
|
|
68
69
|
});
|
|
69
70
|
}
|
|
@@ -83,7 +84,8 @@ TagBoxValueSelect.propTypes = {
|
|
|
83
84
|
menuContainerClassName: _propTypes2.default.string,
|
|
84
85
|
menuContainerText: _propTypes2.default.string,
|
|
85
86
|
menuContainerTextClassName: _propTypes2.default.string,
|
|
86
|
-
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array])
|
|
87
|
+
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string, _propTypes2.default.array]),
|
|
88
|
+
id: _propTypes2.default.string
|
|
87
89
|
};
|
|
88
90
|
|
|
89
91
|
TagBoxValueSelect.defaultProps = {
|
package/package.json
CHANGED
|
@@ -93,6 +93,7 @@ export default function AsyncSelect (props) {
|
|
|
93
93
|
renderValueLabel={props.renderValueLabel}
|
|
94
94
|
renderOptionLabel={props.renderOptionLabel}
|
|
95
95
|
value={props.value}
|
|
96
|
+
id={props.id}
|
|
96
97
|
/>
|
|
97
98
|
);
|
|
98
99
|
}
|
|
@@ -129,5 +130,6 @@ AsyncSelect.propTypes = {
|
|
|
129
130
|
renderOptionLabel: PropTypes.func,
|
|
130
131
|
renderValueLabel: PropTypes.func,
|
|
131
132
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array, PropTypes.object]),
|
|
132
|
-
ValueComponent: PropTypes.func
|
|
133
|
+
ValueComponent: PropTypes.func,
|
|
134
|
+
id: PropTypes.string,
|
|
133
135
|
};
|
|
@@ -33,6 +33,7 @@ export default function BadgeMultiSelect (props){
|
|
|
33
33
|
options={props.options}
|
|
34
34
|
renderOptionLabel={props.renderOptionLabel}
|
|
35
35
|
valueLabel={props.valueLabel}
|
|
36
|
+
id={props.id}
|
|
36
37
|
/>
|
|
37
38
|
);
|
|
38
39
|
}
|
|
@@ -48,5 +49,6 @@ BadgeMultiSelect.propTypes = {
|
|
|
48
49
|
options: PropTypes.array.isRequired,
|
|
49
50
|
renderOptionLabel: PropTypes.func,
|
|
50
51
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array]),
|
|
51
|
-
valueLabel: PropTypes.string.isRequired
|
|
52
|
+
valueLabel: PropTypes.string.isRequired,
|
|
53
|
+
id: PropTypes.string,
|
|
52
54
|
};
|
|
@@ -24,6 +24,7 @@ export const CalendarInput = (props) => {
|
|
|
24
24
|
ValueComponent={InputWrap}
|
|
25
25
|
valueAdapter={valueAdapter}
|
|
26
26
|
{...restProps}
|
|
27
|
+
id={props.id}
|
|
27
28
|
/>
|
|
28
29
|
);
|
|
29
30
|
};
|
|
@@ -147,7 +148,8 @@ CalendarInput.propTypes = {
|
|
|
147
148
|
/**
|
|
148
149
|
onChange function to get value
|
|
149
150
|
*/
|
|
150
|
-
onChange: PropTypes.func
|
|
151
|
+
onChange: PropTypes.func,
|
|
152
|
+
id: PropTypes.string,
|
|
151
153
|
};
|
|
152
154
|
|
|
153
155
|
CalendarInput.defaultProps = {
|
|
@@ -30,6 +30,7 @@ export default function CalendarSelect (props) {
|
|
|
30
30
|
value={value || null}
|
|
31
31
|
valueAdapter={valueAdapter}
|
|
32
32
|
{...restProps}
|
|
33
|
+
id={props.id}
|
|
33
34
|
/>
|
|
34
35
|
);
|
|
35
36
|
}
|
|
@@ -47,7 +48,8 @@ CalendarSelect.propTypes = {
|
|
|
47
48
|
Label displayed if no value is selected
|
|
48
49
|
*/
|
|
49
50
|
valueLabel: PropTypes.string,
|
|
50
|
-
ValueComponent: PropTypes.func.isRequired
|
|
51
|
+
ValueComponent: PropTypes.func.isRequired,
|
|
52
|
+
id: PropTypes.string
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
CalendarSelect.defaultProps = {
|
|
@@ -37,6 +37,7 @@ export default function MultiSelect (props){
|
|
|
37
37
|
valueAdapter={valueAdapter}
|
|
38
38
|
ValueComponent={props.ValueComponent}
|
|
39
39
|
collapsibleOptions={props.collapsibleOptions}
|
|
40
|
+
id={props.id}
|
|
40
41
|
/>
|
|
41
42
|
);
|
|
42
43
|
}
|
|
@@ -57,7 +58,8 @@ MultiSelect.propTypes = {
|
|
|
57
58
|
renderOptionLabel: PropTypes.func,
|
|
58
59
|
renderValueLabel: PropTypes.func,
|
|
59
60
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array]),
|
|
60
|
-
ValueComponent: PropTypes.func.isRequired
|
|
61
|
+
ValueComponent: PropTypes.func.isRequired,
|
|
62
|
+
id: PropTypes.string,
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
MultiSelect.defaultProps = {
|
|
@@ -641,7 +641,7 @@ class SelectCore extends Component {
|
|
|
641
641
|
|
|
642
642
|
render(){
|
|
643
643
|
return (
|
|
644
|
-
<div className={styles.select}>
|
|
644
|
+
<div className={styles.select} id={this.props.id}>
|
|
645
645
|
{ this.renderValue() }
|
|
646
646
|
{ (this.state.isOpen || this.props.alwaysOpen) && this.renderMenu() }
|
|
647
647
|
</div>
|
|
@@ -782,7 +782,10 @@ SelectCore.propTypes = {
|
|
|
782
782
|
filterable: PropTypes.bool,
|
|
783
783
|
onOptionsFiltered: PropTypes.func,
|
|
784
784
|
onChangeText: PropTypes.func,
|
|
785
|
-
collapsibleOptions: PropTypes.array
|
|
785
|
+
collapsibleOptions: PropTypes.array,
|
|
786
|
+
|
|
787
|
+
// add a unique id for testing purposes and accessibility
|
|
788
|
+
id: PropTypes.string,
|
|
786
789
|
|
|
787
790
|
};
|
|
788
791
|
|
|
@@ -46,6 +46,7 @@ export default function SingleSelect (props){
|
|
|
46
46
|
renderOptionLabel={props.renderOptionLabel}
|
|
47
47
|
unselectOnClick={props.unselectOnClick}
|
|
48
48
|
value={props.value}
|
|
49
|
+
id={props.id}
|
|
49
50
|
/>
|
|
50
51
|
);
|
|
51
52
|
}
|
|
@@ -71,7 +72,8 @@ SingleSelect.propTypes = {
|
|
|
71
72
|
unselectOnClick: PropTypes.bool,
|
|
72
73
|
optionSets: PropTypes.array,
|
|
73
74
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
74
|
-
ValueComponent: PropTypes.func
|
|
75
|
+
ValueComponent: PropTypes.func,
|
|
76
|
+
id: PropTypes.string,
|
|
75
77
|
};
|
|
76
78
|
|
|
77
79
|
SingleSelect.defaultProps = {
|
|
@@ -31,6 +31,7 @@ export default function TabbedSelect (props){
|
|
|
31
31
|
onClose={props.onClose}
|
|
32
32
|
valueLabel={props.valueLabel}
|
|
33
33
|
value={props.value}
|
|
34
|
+
id={props.id}
|
|
34
35
|
/>
|
|
35
36
|
);
|
|
36
37
|
}
|
|
@@ -45,7 +46,8 @@ TabbedSelect.propTypes = {
|
|
|
45
46
|
onOpen: PropTypes.func,
|
|
46
47
|
options: PropTypes.array.isRequired,
|
|
47
48
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array]),
|
|
48
|
-
valueLabel: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array])
|
|
49
|
+
valueLabel: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array]),
|
|
50
|
+
id: PropTypes.string,
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
// Tabs -> {name: '', choices: [{label, value}]}
|
|
@@ -34,6 +34,7 @@ export default function TagBoxMenuSelect (props) {
|
|
|
34
34
|
value={props.value}
|
|
35
35
|
ValueComponent={props.ValueComponent}
|
|
36
36
|
valueLabel={props.valueLabel || 'Choices'}
|
|
37
|
+
id={props.id}
|
|
37
38
|
/>
|
|
38
39
|
);
|
|
39
40
|
}
|
|
@@ -51,7 +52,8 @@ TagBoxMenuSelect.propTypes = {
|
|
|
51
52
|
renderValueLabel: PropTypes.func,
|
|
52
53
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array]),
|
|
53
54
|
valueLabel: PropTypes.string,
|
|
54
|
-
ValueComponent: PropTypes.func.isRequired
|
|
55
|
+
ValueComponent: PropTypes.func.isRequired,
|
|
56
|
+
id: PropTypes.string,
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
TagBoxMenuSelect.defaultProps = {
|
|
@@ -37,6 +37,7 @@ export default function TagBoxValueSelect (props) {
|
|
|
37
37
|
renderValueLabel={props.renderValueLabel}
|
|
38
38
|
renderOptionLabel={props.renderOptionLabel}
|
|
39
39
|
disabled={props.disabled}
|
|
40
|
+
id={props.id}
|
|
40
41
|
|
|
41
42
|
/>
|
|
42
43
|
);
|
|
@@ -58,6 +59,7 @@ TagBoxValueSelect.propTypes = {
|
|
|
58
59
|
menuContainerText: PropTypes.string,
|
|
59
60
|
menuContainerTextClassName: PropTypes.string,
|
|
60
61
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array]),
|
|
62
|
+
id: PropTypes.string,
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
TagBoxValueSelect.defaultProps = {
|