@carbon/react 1.3.0 → 1.4.0-rc.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/es/components/ComposedModal/next/ComposedModal.js +11 -11
- package/es/components/DatePicker/DatePicker.js +264 -334
- package/es/components/DatePickerInput/DatePickerInput.js +141 -168
- package/es/components/FileUploader/FileUploader.js +3 -3
- package/es/components/FileUploader/FileUploaderButton.js +4 -4
- package/es/components/FileUploader/FileUploaderDropContainer.js +3 -3
- package/es/components/IconButton/index.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +10 -0
- package/es/components/MultiSelect/next/FilterableMultiSelect.js +11 -0
- package/es/components/Slider/Slider.js +11 -0
- package/es/components/StructuredList/next/StructuredList.js +19 -3
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/index.js +3 -3
- package/lib/components/ComposedModal/next/ComposedModal.js +11 -11
- package/lib/components/DatePicker/DatePicker.js +261 -331
- package/lib/components/DatePickerInput/DatePickerInput.js +138 -165
- package/lib/components/FileUploader/FileUploader.js +3 -3
- package/lib/components/FileUploader/FileUploaderButton.js +4 -4
- package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -3
- package/lib/components/IconButton/index.js +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +10 -0
- package/lib/components/MultiSelect/next/FilterableMultiSelect.js +11 -0
- package/lib/components/Slider/Slider.js +11 -0
- package/lib/components/StructuredList/next/StructuredList.js +19 -3
- package/lib/components/UIShell/SideNav.js +1 -1
- package/lib/index.js +100 -100
- package/package.json +3 -3
- package/es/components/DatePicker/index.js +0 -15
- package/es/components/DatePicker/next/DatePicker.js +0 -562
- package/es/components/DatePickerInput/index.js +0 -15
- package/es/components/DatePickerInput/next/DatePickerInput.js +0 -244
- package/lib/components/DatePicker/index.js +0 -39
- package/lib/components/DatePicker/next/DatePicker.js +0 -573
- package/lib/components/DatePickerInput/index.js +0 -39
- package/lib/components/DatePickerInput/next/DatePickerInput.js +0 -254
|
@@ -5,152 +5,94 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
|
-
import React__default, { Component } from 'react';
|
|
11
|
-
import deprecate from '../../prop-types/deprecate.js';
|
|
12
|
-
import cx from 'classnames';
|
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
13
9
|
import { WarningFilled, WarningAltFilled, Calendar } from '@carbon/icons-react';
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
onClick: openCalendar,
|
|
101
|
-
role: "img",
|
|
102
|
-
"aria-hidden": "true"
|
|
103
|
-
}, iconDescription && (_title || (_title = /*#__PURE__*/React__default.createElement("title", null, iconDescription))));
|
|
104
|
-
}();
|
|
105
|
-
|
|
106
|
-
var label = labelText ? /*#__PURE__*/React__default.createElement("label", {
|
|
107
|
-
htmlFor: id,
|
|
108
|
-
className: labelClasses
|
|
109
|
-
}, labelText) : null;
|
|
110
|
-
var helper = helperText ? /*#__PURE__*/React__default.createElement("div", {
|
|
111
|
-
className: helperTextClasses
|
|
112
|
-
}, helperText) : null;
|
|
113
|
-
var error = null;
|
|
114
|
-
|
|
115
|
-
if (invalid) {
|
|
116
|
-
error = /*#__PURE__*/React__default.createElement("div", {
|
|
117
|
-
className: "".concat(prefix, "--form-requirement")
|
|
118
|
-
}, invalidText);
|
|
119
|
-
} else if (warn) {
|
|
120
|
-
error = /*#__PURE__*/React__default.createElement("div", {
|
|
121
|
-
className: "".concat(prefix, "--form-requirement")
|
|
122
|
-
}, warnText);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
var containerClasses = cx("".concat(prefix, "--date-picker-container"), _defineProperty({}, "".concat(prefix, "--date-picker--nolabel"), !label));
|
|
126
|
-
var input = invalid ? /*#__PURE__*/React__default.createElement("input", _extends({}, other, datePickerInputProps, {
|
|
127
|
-
disabled: disabled,
|
|
128
|
-
ref: function ref(input) {
|
|
129
|
-
_this.input = input;
|
|
130
|
-
},
|
|
131
|
-
"data-invalid": true,
|
|
132
|
-
className: inputClasses
|
|
133
|
-
})) : /*#__PURE__*/React__default.createElement("input", _extends({
|
|
134
|
-
ref: function ref(input) {
|
|
135
|
-
_this.input = input;
|
|
136
|
-
}
|
|
137
|
-
}, other, datePickerInputProps, {
|
|
138
|
-
disabled: disabled,
|
|
139
|
-
className: inputClasses
|
|
140
|
-
}));
|
|
141
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
142
|
-
className: containerClasses
|
|
143
|
-
}, label, /*#__PURE__*/React__default.createElement("div", {
|
|
144
|
-
className: wrapperClasses
|
|
145
|
-
}, input, datePickerIcon), error, helper);
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
}]);
|
|
149
|
-
|
|
150
|
-
return DatePickerInput;
|
|
151
|
-
}(Component);
|
|
152
|
-
|
|
153
|
-
_defineProperty(DatePickerInput, "propTypes", {
|
|
10
|
+
import cx from 'classnames';
|
|
11
|
+
import PropTypes from 'prop-types';
|
|
12
|
+
import React__default from 'react';
|
|
13
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
|
+
|
|
15
|
+
var _excluded = ["datePickerType", "disabled", "helperText", "hideLabel", "id", "invalid", "invalidText", "labelText", "onClick", "onChange", "pattern", "placeholder", "size", "type", "warn", "warnText"];
|
|
16
|
+
var DatePickerInput = /*#__PURE__*/React__default.forwardRef(function DatePickerInput(props, ref) {
|
|
17
|
+
var _cx, _cx2, _cx4;
|
|
18
|
+
|
|
19
|
+
var datePickerType = props.datePickerType,
|
|
20
|
+
_props$disabled = props.disabled,
|
|
21
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
22
|
+
helperText = props.helperText,
|
|
23
|
+
hideLabel = props.hideLabel,
|
|
24
|
+
id = props.id,
|
|
25
|
+
_props$invalid = props.invalid,
|
|
26
|
+
invalid = _props$invalid === void 0 ? false : _props$invalid,
|
|
27
|
+
invalidText = props.invalidText,
|
|
28
|
+
labelText = props.labelText,
|
|
29
|
+
_props$onClick = props.onClick,
|
|
30
|
+
_onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
|
|
31
|
+
_props$onChange = props.onChange,
|
|
32
|
+
_onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
33
|
+
_props$pattern = props.pattern,
|
|
34
|
+
pattern = _props$pattern === void 0 ? '\\d{1,2}\\/\\d{1,2}\\/\\d{4}' : _props$pattern,
|
|
35
|
+
placeholder = props.placeholder,
|
|
36
|
+
_props$size = props.size,
|
|
37
|
+
size = _props$size === void 0 ? 'md' : _props$size,
|
|
38
|
+
_props$type = props.type,
|
|
39
|
+
type = _props$type === void 0 ? 'text' : _props$type,
|
|
40
|
+
warn = props.warn,
|
|
41
|
+
warnText = props.warnText,
|
|
42
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
43
|
+
|
|
44
|
+
var prefix = usePrefix();
|
|
45
|
+
var datePickerInputProps = {
|
|
46
|
+
id: id,
|
|
47
|
+
onChange: function onChange(event) {
|
|
48
|
+
if (!disabled) {
|
|
49
|
+
_onChange(event);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
onClick: function onClick(event) {
|
|
53
|
+
if (!disabled) {
|
|
54
|
+
_onClick(event);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
pattern: pattern,
|
|
58
|
+
placeholder: placeholder,
|
|
59
|
+
type: type
|
|
60
|
+
};
|
|
61
|
+
var wrapperClasses = cx("".concat(prefix, "--date-picker-input__wrapper"), (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--date-picker-input__wrapper--invalid"), invalid), _defineProperty(_cx, "".concat(prefix, "--date-picker-input__wrapper--warn"), warn), _cx));
|
|
62
|
+
var labelClasses = cx("".concat(prefix, "--label"), (_cx2 = {}, _defineProperty(_cx2, "".concat(prefix, "--visually-hidden"), hideLabel), _defineProperty(_cx2, "".concat(prefix, "--label--disabled"), disabled), _cx2));
|
|
63
|
+
var helperTextClasses = cx("".concat(prefix, "--form__helper-text"), _defineProperty({}, "".concat(prefix, "--form__helper-text--disabled"), disabled));
|
|
64
|
+
var inputClasses = cx("".concat(prefix, "--date-picker__input"), (_cx4 = {}, _defineProperty(_cx4, "".concat(prefix, "--date-picker__input--").concat(size), size), _defineProperty(_cx4, "".concat(prefix, "--date-picker__input--invalid"), invalid), _cx4));
|
|
65
|
+
var containerClasses = cx("".concat(prefix, "--date-picker-container"), _defineProperty({}, "".concat(prefix, "--date-picker--nolabel"), !labelText));
|
|
66
|
+
var input = invalid ? /*#__PURE__*/React__default.createElement("input", _extends({}, rest, datePickerInputProps, {
|
|
67
|
+
disabled: disabled,
|
|
68
|
+
ref: ref,
|
|
69
|
+
"data-invalid": true,
|
|
70
|
+
className: inputClasses
|
|
71
|
+
})) : /*#__PURE__*/React__default.createElement("input", _extends({}, rest, datePickerInputProps, {
|
|
72
|
+
disabled: disabled,
|
|
73
|
+
className: inputClasses,
|
|
74
|
+
ref: ref
|
|
75
|
+
}));
|
|
76
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
77
|
+
className: containerClasses
|
|
78
|
+
}, labelText && /*#__PURE__*/React__default.createElement("label", {
|
|
79
|
+
htmlFor: id,
|
|
80
|
+
className: labelClasses
|
|
81
|
+
}, labelText), /*#__PURE__*/React__default.createElement("div", {
|
|
82
|
+
className: wrapperClasses
|
|
83
|
+
}, input, /*#__PURE__*/React__default.createElement(DatePickerIcon, {
|
|
84
|
+
datePickerType: datePickerType,
|
|
85
|
+
invalid: invalid,
|
|
86
|
+
warn: warn
|
|
87
|
+
})), invalid && /*#__PURE__*/React__default.createElement("div", {
|
|
88
|
+
className: "".concat(prefix, "--form-requirement")
|
|
89
|
+
}, invalidText), warn && /*#__PURE__*/React__default.createElement("div", {
|
|
90
|
+
className: "".concat(prefix, "--form-requirement")
|
|
91
|
+
}, warnText), helperText && /*#__PURE__*/React__default.createElement("div", {
|
|
92
|
+
className: helperTextClasses
|
|
93
|
+
}, helperText));
|
|
94
|
+
});
|
|
95
|
+
DatePickerInput.propTypes = {
|
|
154
96
|
/**
|
|
155
97
|
* The type of the date picker:
|
|
156
98
|
*
|
|
@@ -175,11 +117,6 @@ _defineProperty(DatePickerInput, "propTypes", {
|
|
|
175
117
|
*/
|
|
176
118
|
hideLabel: PropTypes.bool,
|
|
177
119
|
|
|
178
|
-
/**
|
|
179
|
-
* The description of the calendar icon.
|
|
180
|
-
*/
|
|
181
|
-
iconDescription: deprecate(PropTypes.string, "\nThe prop `iconDescriptionInput` for DatePickerInput has been deprecated and is no longer used"),
|
|
182
|
-
|
|
183
120
|
/**
|
|
184
121
|
* Specify an id that uniquely identifies the `<input>`
|
|
185
122
|
*/
|
|
@@ -212,11 +149,6 @@ _defineProperty(DatePickerInput, "propTypes", {
|
|
|
212
149
|
*/
|
|
213
150
|
onClick: PropTypes.func,
|
|
214
151
|
|
|
215
|
-
/**
|
|
216
|
-
* Provide a function to be called when the input field is clicked
|
|
217
|
-
*/
|
|
218
|
-
openCalendar: deprecate(PropTypes.func, "\nThe prop `openCalendar` for DatePickerInput has been deprecated and is no longer used"),
|
|
219
|
-
|
|
220
152
|
/**
|
|
221
153
|
* Provide a regular expression that the input value must match
|
|
222
154
|
*/
|
|
@@ -238,10 +170,9 @@ _defineProperty(DatePickerInput, "propTypes", {
|
|
|
238
170
|
placeholder: PropTypes.string,
|
|
239
171
|
|
|
240
172
|
/**
|
|
241
|
-
* Specify the size of the Date Picker Input. Currently supports either `sm`,
|
|
242
|
-
* TODO V11: remove `xl` (replaced with lg)
|
|
173
|
+
* Specify the size of the Date Picker Input. Currently supports either `sm`, `md`, or `lg` as an option.
|
|
243
174
|
*/
|
|
244
|
-
size: PropTypes.oneOf(['sm', 'md', 'lg'
|
|
175
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
245
176
|
|
|
246
177
|
/**
|
|
247
178
|
* Specify the type of the `<input>`
|
|
@@ -257,15 +188,57 @@ _defineProperty(DatePickerInput, "propTypes", {
|
|
|
257
188
|
* Provide the text that is displayed when the control is in warning state
|
|
258
189
|
*/
|
|
259
190
|
warnText: PropTypes.node
|
|
260
|
-
}
|
|
191
|
+
};
|
|
261
192
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
193
|
+
function DatePickerIcon(_ref) {
|
|
194
|
+
var datePickerType = _ref.datePickerType,
|
|
195
|
+
invalid = _ref.invalid,
|
|
196
|
+
warn = _ref.warn;
|
|
197
|
+
var prefix = usePrefix();
|
|
198
|
+
|
|
199
|
+
if (datePickerType === 'simple' && !invalid && !warn) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (invalid) {
|
|
204
|
+
return /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
205
|
+
className: "".concat(prefix, "--date-picker__icon ").concat(prefix, "--date-picker__icon--invalid")
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (!invalid && warn) {
|
|
210
|
+
return /*#__PURE__*/React__default.createElement(WarningAltFilled, {
|
|
211
|
+
className: "".concat(prefix, "--date-picker__icon ").concat(prefix, "--date-picker__icon--warn")
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return /*#__PURE__*/React__default.createElement(Calendar, {
|
|
216
|
+
className: "".concat(prefix, "--date-picker__icon"),
|
|
217
|
+
role: "img",
|
|
218
|
+
"aria-hidden": "true"
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
DatePickerIcon.propTypes = {
|
|
223
|
+
/**
|
|
224
|
+
* The type of the date picker:
|
|
225
|
+
*
|
|
226
|
+
* * `simple` - Without calendar dropdown.
|
|
227
|
+
* * `single` - With calendar dropdown and single date.
|
|
228
|
+
* * `range` - With calendar dropdown and a date range.
|
|
229
|
+
*/
|
|
230
|
+
datePickerType: PropTypes.oneOf(['simple', 'single', 'range']),
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Specify whether or not the input should be invalid
|
|
234
|
+
*/
|
|
235
|
+
invalid: PropTypes.bool,
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Specify whether the control is currently in warning state
|
|
239
|
+
*/
|
|
240
|
+
warn: PropTypes.bool
|
|
241
|
+
};
|
|
242
|
+
var DatePickerInput$1 = DatePickerInput;
|
|
270
243
|
|
|
271
|
-
export { DatePickerInput as default };
|
|
244
|
+
export { DatePickerInput$1 as default };
|
|
@@ -193,13 +193,13 @@ _defineProperty(FileUploader, "propTypes", {
|
|
|
193
193
|
accept: PropTypes.arrayOf(PropTypes.string),
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
|
-
* Specify the type of the
|
|
196
|
+
* Specify the type of the `<FileUploaderButton>`
|
|
197
197
|
*/
|
|
198
198
|
buttonKind: PropTypes.oneOf(ButtonKinds),
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* Provide the label text to be read by screen readers when interacting with
|
|
202
|
-
* the
|
|
202
|
+
* the `<FileUploaderButton>`
|
|
203
203
|
*/
|
|
204
204
|
buttonLabel: PropTypes.string,
|
|
205
205
|
|
|
@@ -229,7 +229,7 @@ _defineProperty(FileUploader, "propTypes", {
|
|
|
229
229
|
labelDescription: PropTypes.string,
|
|
230
230
|
|
|
231
231
|
/**
|
|
232
|
-
* Specify the title text of this
|
|
232
|
+
* Specify the title text of this `<FileUploader>`
|
|
233
233
|
*/
|
|
234
234
|
labelTitle: PropTypes.string,
|
|
235
235
|
|
|
@@ -162,12 +162,12 @@ FileUploaderButton.propTypes = {
|
|
|
162
162
|
multiple: PropTypes.bool,
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
|
-
* Provide a name for the underlying
|
|
165
|
+
* Provide a name for the underlying `<input>` node
|
|
166
166
|
*/
|
|
167
167
|
name: PropTypes.string,
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
|
-
* Provide an optional `onChange` hook that is called each time the
|
|
170
|
+
* Provide an optional `onChange` hook that is called each time the `<input>`
|
|
171
171
|
* value changes
|
|
172
172
|
*/
|
|
173
173
|
onChange: PropTypes.func,
|
|
@@ -179,7 +179,7 @@ FileUploaderButton.propTypes = {
|
|
|
179
179
|
onClick: PropTypes.func,
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
* Provide an accessibility role for the
|
|
182
|
+
* Provide an accessibility role for the `<FileUploaderButton>`
|
|
183
183
|
*/
|
|
184
184
|
role: PropTypes.string,
|
|
185
185
|
|
|
@@ -190,7 +190,7 @@ FileUploaderButton.propTypes = {
|
|
|
190
190
|
size: FeatureFlags.enabled('enable-v11-release') ? PropTypes.oneOf(['sm', 'md', 'lg']) : PropTypes.oneOf(['default', 'field', 'small', 'sm', 'md', 'lg']),
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
* Provide a custom tabIndex value for the
|
|
193
|
+
* Provide a custom tabIndex value for the `<FileUploaderButton>`
|
|
194
194
|
*/
|
|
195
195
|
tabIndex: PropTypes.number
|
|
196
196
|
};
|
|
@@ -73,7 +73,7 @@ function FileUploaderDropContainer(_ref) {
|
|
|
73
73
|
_name$match2 = _slicedToArray(_name$match, 1),
|
|
74
74
|
fileExtension = _name$match2[0];
|
|
75
75
|
|
|
76
|
-
if (acceptedTypes.has(mimeType) || acceptedTypes.has(fileExtension)) {
|
|
76
|
+
if (acceptedTypes.has(mimeType) || acceptedTypes.has(fileExtension.toLowerCase())) {
|
|
77
77
|
return acc.concat([curr]);
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -202,12 +202,12 @@ FileUploaderDropContainer.propTypes = {
|
|
|
202
202
|
pattern: PropTypes.string,
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
|
-
* Provide an accessibility role for the
|
|
205
|
+
* Provide an accessibility role for the `<FileUploaderButton>`
|
|
206
206
|
*/
|
|
207
207
|
role: PropTypes.string,
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
|
-
* Provide a custom tabIndex value for the
|
|
210
|
+
* Provide a custom tabIndex value for the `<FileUploaderButton>`
|
|
211
211
|
*/
|
|
212
212
|
tabIndex: PropTypes.number
|
|
213
213
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends
|
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import Button from '../Button/Button.js';
|
|
@@ -40,7 +40,7 @@ var IconButton = /*#__PURE__*/React__default.forwardRef(function IconButton(prop
|
|
|
40
40
|
kind: kind,
|
|
41
41
|
ref: ref,
|
|
42
42
|
size: size,
|
|
43
|
-
className: cx("".concat(prefix, "--btn--icon-only"),
|
|
43
|
+
className: cx("".concat(prefix, "--btn--icon-only"), className)
|
|
44
44
|
}), children));
|
|
45
45
|
});
|
|
46
46
|
IconButton.propTypes = {
|
|
@@ -104,6 +104,10 @@ var FilterableMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
104
104
|
_defineProperty(_assertThisInitialized(_this), "handleOnInputValueChange", function (inputValue, _ref) {
|
|
105
105
|
var type = _ref.type;
|
|
106
106
|
|
|
107
|
+
if (_this.props.onInputValueChange) {
|
|
108
|
+
_this.props.onInputValueChange(inputValue);
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
if (type !== Downshift.stateChangeTypes.changeInput) {
|
|
108
112
|
return;
|
|
109
113
|
}
|
|
@@ -504,6 +508,12 @@ _defineProperty(FilterableMultiSelect, "propTypes", _objectSpread2(_objectSpread
|
|
|
504
508
|
*/
|
|
505
509
|
onChange: PropTypes.func,
|
|
506
510
|
|
|
511
|
+
/**
|
|
512
|
+
* `onInputValueChange` is a utility for this controlled component to communicate to
|
|
513
|
+
* the currently typed input.
|
|
514
|
+
*/
|
|
515
|
+
onInputValueChange: PropTypes.func,
|
|
516
|
+
|
|
507
517
|
/**
|
|
508
518
|
* `onMenuChange` is a utility for this controlled component to communicate to a
|
|
509
519
|
* consuming component that the menu was opened(`true`)/closed(`false`).
|
|
@@ -50,6 +50,7 @@ var FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function Filt
|
|
|
50
50
|
itemToString = _ref.itemToString,
|
|
51
51
|
light = _ref.light,
|
|
52
52
|
locale = _ref.locale,
|
|
53
|
+
onInputValueChange = _ref.onInputValueChange,
|
|
53
54
|
open = _ref.open,
|
|
54
55
|
onChange = _ref.onChange,
|
|
55
56
|
onMenuChange = _ref.onMenuChange,
|
|
@@ -168,6 +169,10 @@ var FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function Filt
|
|
|
168
169
|
function handleOnInputValueChange(inputValue, _ref2) {
|
|
169
170
|
var type = _ref2.type;
|
|
170
171
|
|
|
172
|
+
if (onInputValueChange) {
|
|
173
|
+
onInputValueChange(inputValue);
|
|
174
|
+
}
|
|
175
|
+
|
|
171
176
|
if (type !== Downshift.stateChangeTypes.changeInput) {
|
|
172
177
|
return;
|
|
173
178
|
}
|
|
@@ -462,6 +467,12 @@ FilterableMultiSelect.propTypes = _objectSpread2(_objectSpread2({
|
|
|
462
467
|
*/
|
|
463
468
|
onChange: PropTypes.func,
|
|
464
469
|
|
|
470
|
+
/**
|
|
471
|
+
* `onInputValueChange` is a utility for this controlled component to communicate to
|
|
472
|
+
* the currently typed input.
|
|
473
|
+
*/
|
|
474
|
+
onInputValueChange: PropTypes.func,
|
|
475
|
+
|
|
465
476
|
/**
|
|
466
477
|
* `onMenuChange` is a utility for this controlled component to communicate to a
|
|
467
478
|
* consuming component that the menu was opened(`true`)/closed(`false`).
|
|
@@ -220,10 +220,15 @@ var Slider = /*#__PURE__*/function (_PureComponent) {
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
var validity = evt.target.checkValidity();
|
|
223
|
+
var value = evt.target.value;
|
|
223
224
|
|
|
224
225
|
_this.setState({
|
|
225
226
|
isValid: validity
|
|
226
227
|
});
|
|
228
|
+
|
|
229
|
+
_this.props.onBlur({
|
|
230
|
+
value: value
|
|
231
|
+
});
|
|
227
232
|
});
|
|
228
233
|
|
|
229
234
|
_defineProperty(_assertThisInitialized(_this), "calcValue", function (_ref) {
|
|
@@ -592,6 +597,12 @@ _defineProperty(Slider, "propTypes", {
|
|
|
592
597
|
*/
|
|
593
598
|
name: PropTypes.string,
|
|
594
599
|
|
|
600
|
+
/**
|
|
601
|
+
* Provide an optional function to be called when the input element
|
|
602
|
+
* loses focus
|
|
603
|
+
*/
|
|
604
|
+
onBlur: PropTypes.func,
|
|
605
|
+
|
|
595
606
|
/**
|
|
596
607
|
* The callback to get notified of change in value.
|
|
597
608
|
*/
|
|
@@ -13,7 +13,7 @@ import { useId } from '../../../internal/useId.js';
|
|
|
13
13
|
import deprecate from '../../../prop-types/deprecate.js';
|
|
14
14
|
import { usePrefix } from '../../../internal/usePrefix.js';
|
|
15
15
|
|
|
16
|
-
var _excluded = ["children", "selection", "className", "ariaLabel"],
|
|
16
|
+
var _excluded = ["children", "selection", "className", "ariaLabel", "isCondensed", "isFlush"],
|
|
17
17
|
_excluded2 = ["children", "className"],
|
|
18
18
|
_excluded3 = ["children", "className"],
|
|
19
19
|
_excluded4 = ["onKeyDown", "children", "className", "head"],
|
|
@@ -22,14 +22,18 @@ var _excluded = ["children", "selection", "className", "ariaLabel"],
|
|
|
22
22
|
var GridSelectedRowStateContext = /*#__PURE__*/React__default.createContext(null);
|
|
23
23
|
var GridSelectedRowDispatchContext = /*#__PURE__*/React__default.createContext(null);
|
|
24
24
|
function StructuredListWrapper(props) {
|
|
25
|
+
var _classNames;
|
|
26
|
+
|
|
25
27
|
var children = props.children,
|
|
26
28
|
selection = props.selection,
|
|
27
29
|
className = props.className,
|
|
28
30
|
ariaLabel = props.ariaLabel,
|
|
31
|
+
isCondensed = props.isCondensed,
|
|
32
|
+
isFlush = props.isFlush,
|
|
29
33
|
other = _objectWithoutProperties(props, _excluded);
|
|
30
34
|
|
|
31
35
|
var prefix = usePrefix();
|
|
32
|
-
var classes = cx("".concat(prefix, "--structured-list"), className,
|
|
36
|
+
var classes = cx("".concat(prefix, "--structured-list"), className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--structured-list--selection"), selection), _defineProperty(_classNames, "".concat(prefix, "--structured-list--condensed"), isCondensed), _defineProperty(_classNames, "".concat(prefix, "--structured-list--flush"), isFlush), _classNames));
|
|
33
37
|
|
|
34
38
|
var _React$useState = React__default.useState(null),
|
|
35
39
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -41,7 +45,7 @@ function StructuredListWrapper(props) {
|
|
|
41
45
|
}, /*#__PURE__*/React__default.createElement(GridSelectedRowDispatchContext.Provider, {
|
|
42
46
|
value: setSelectedRow
|
|
43
47
|
}, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
44
|
-
role: "
|
|
48
|
+
role: "table",
|
|
45
49
|
className: classes
|
|
46
50
|
}, other, {
|
|
47
51
|
"aria-label": ariaLabel
|
|
@@ -63,6 +67,16 @@ StructuredListWrapper.propTypes = {
|
|
|
63
67
|
*/
|
|
64
68
|
className: PropTypes.string,
|
|
65
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Specify if structured list is condensed, default is false
|
|
72
|
+
*/
|
|
73
|
+
isCondensed: PropTypes.bool,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Specify if structured list is flush, default is false
|
|
77
|
+
*/
|
|
78
|
+
isFlush: PropTypes.bool,
|
|
79
|
+
|
|
66
80
|
/**
|
|
67
81
|
* Specify whether your StructuredListWrapper should have selections
|
|
68
82
|
*/
|
|
@@ -70,6 +84,8 @@ StructuredListWrapper.propTypes = {
|
|
|
70
84
|
};
|
|
71
85
|
StructuredListWrapper.defaultProps = {
|
|
72
86
|
selection: false,
|
|
87
|
+
isCondensed: false,
|
|
88
|
+
isFlush: false,
|
|
73
89
|
ariaLabel: 'Structured list section'
|
|
74
90
|
};
|
|
75
91
|
function StructuredListHead(props) {
|
|
@@ -121,7 +121,7 @@ var SideNav = /*#__PURE__*/React__default.forwardRef(function SideNav(props, ref
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
var isSideNavCollapsed = useMatchMedia("(max-width: 1055px)");
|
|
124
|
-
var ariaHidden = expanded === false && isSideNavCollapsed;
|
|
124
|
+
var ariaHidden = isRail ? false : expanded === false && isSideNavCollapsed;
|
|
125
125
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, isFixedNav ? null :
|
|
126
126
|
/*#__PURE__*/
|
|
127
127
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
package/es/index.js
CHANGED
|
@@ -24,8 +24,9 @@ export { default as Copy } from './components/Copy/Copy.js';
|
|
|
24
24
|
export { default as CopyButton } from './components/CopyButton/CopyButton.js';
|
|
25
25
|
export { default as DangerButton } from './components/DangerButton/DangerButton.js';
|
|
26
26
|
export { default as DataTable } from './components/DataTable/index.js';
|
|
27
|
-
export { default as
|
|
28
|
-
export { default as
|
|
27
|
+
export { default as DatePickerSkeleton } from './components/DatePicker/DatePicker.Skeleton.js';
|
|
28
|
+
export { default as DatePicker } from './components/DatePicker/DatePicker.js';
|
|
29
|
+
export { default as DatePickerInput } from './components/DatePickerInput/DatePickerInput.js';
|
|
29
30
|
export { default as DropdownSkeleton } from './components/Dropdown/Dropdown.Skeleton.js';
|
|
30
31
|
export { default as Dropdown } from './components/Dropdown/Dropdown.js';
|
|
31
32
|
export { default as FileUploader } from './components/FileUploader/index.js';
|
|
@@ -97,7 +98,6 @@ export { default as TextInputSkeleton } from './components/TextInput/TextInput.S
|
|
|
97
98
|
export { default as ToggleSkeleton } from './components/Toggle/Toggle.Skeleton.js';
|
|
98
99
|
export { default as ToggleSmallSkeleton } from './components/ToggleSmall/ToggleSmall.Skeleton.js';
|
|
99
100
|
export { default as IconSkeleton } from './components/Icon/Icon.Skeleton.js';
|
|
100
|
-
export { default as DatePickerSkeleton } from './components/DatePicker/DatePicker.Skeleton.js';
|
|
101
101
|
export { HeaderNavigation, SideNavMenu } from './components/UIShell/index.js';
|
|
102
102
|
export { FeatureFlags as unstable_FeatureFlags, useFeatureFlag as unstable_useFeatureFlag, useFeatureFlags as unstable_useFeatureFlags } from './components/FeatureFlags/index.js';
|
|
103
103
|
export { Heading, Section } from './components/Heading/index.js';
|