carbon-react 110.2.0 → 110.2.3
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/esm/__internal__/character-count/character-count.component.d.ts +8 -25
- package/esm/__internal__/character-count/character-count.component.js +12 -18
- package/esm/__internal__/character-count/character-count.style.d.ts +3 -1
- package/esm/__internal__/character-count/character-count.style.js +4 -0
- package/esm/__internal__/checkable-input/checkable-input-svg-wrapper.style.d.ts +1 -1
- package/esm/__internal__/checkable-input/checkable-input.component.d.ts +50 -0
- package/esm/__internal__/checkable-input/checkable-input.component.js +360 -98
- package/esm/__internal__/checkable-input/checkable-input.style.d.ts +11 -2
- package/esm/__internal__/checkable-input/checkable-input.style.js +0 -7
- package/esm/__internal__/checkable-input/hidden-checkable-input.component.d.ts +31 -0
- package/esm/__internal__/checkable-input/hidden-checkable-input.component.js +301 -45
- package/esm/__internal__/checkable-input/hidden-checkable-input.style.d.ts +1 -1
- package/esm/__internal__/checkable-input/index.d.ts +2 -5
- package/esm/__internal__/input/index.d.ts +1 -1
- package/esm/__internal__/input/input-presentation.style.d.ts +1 -1
- package/esm/__internal__/input/input.style.d.ts +1 -1
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +1 -0
- package/esm/components/numeral-date/numeral-date-context.d.ts +6 -0
- package/esm/components/popover-container/popover-container.component.d.ts +2 -0
- package/esm/components/popover-container/popover-container.component.js +9 -4
- package/esm/components/select/multi-select/multi-select.component.js +1 -1
- package/esm/components/select/select-list/select-list.component.js +20 -11
- package/esm/components/textarea/textarea.component.js +6 -27
- package/esm/components/textarea/textarea.d.ts +2 -1
- package/esm/components/textbox/__internal__/prefix.style.d.ts +2 -0
- package/esm/components/textbox/index.d.ts +2 -1
- package/esm/components/textbox/index.js +1 -1
- package/esm/components/textbox/textbox.component.d.ts +92 -0
- package/esm/components/textbox/textbox.component.js +533 -197
- package/esm/components/textbox/textbox.style.d.ts +5 -0
- package/esm/components/textbox/textbox.style.js +0 -12
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -1
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.js +7 -6
- package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +6 -5
- package/lib/__internal__/character-count/character-count.component.d.ts +8 -25
- package/lib/__internal__/character-count/character-count.component.js +13 -23
- package/lib/__internal__/character-count/character-count.style.d.ts +3 -1
- package/lib/__internal__/character-count/character-count.style.js +7 -0
- package/lib/__internal__/checkable-input/checkable-input-svg-wrapper.style.d.ts +1 -1
- package/lib/__internal__/checkable-input/checkable-input.component.d.ts +50 -0
- package/lib/__internal__/checkable-input/checkable-input.component.js +360 -98
- package/lib/__internal__/checkable-input/checkable-input.style.d.ts +11 -2
- package/lib/__internal__/checkable-input/checkable-input.style.js +1 -9
- package/lib/__internal__/checkable-input/hidden-checkable-input.component.d.ts +31 -0
- package/lib/__internal__/checkable-input/hidden-checkable-input.component.js +301 -45
- package/lib/__internal__/checkable-input/hidden-checkable-input.style.d.ts +1 -1
- package/lib/__internal__/checkable-input/index.d.ts +2 -5
- package/lib/__internal__/input/index.d.ts +1 -1
- package/lib/__internal__/input/input-presentation.style.d.ts +1 -1
- package/lib/__internal__/input/input.style.d.ts +1 -1
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +1 -0
- package/lib/components/numeral-date/numeral-date-context.d.ts +6 -0
- package/lib/components/popover-container/popover-container.component.d.ts +2 -0
- package/lib/components/popover-container/popover-container.component.js +9 -4
- package/lib/components/select/multi-select/multi-select.component.js +1 -1
- package/lib/components/select/select-list/select-list.component.js +20 -11
- package/lib/components/textarea/textarea.component.js +6 -27
- package/lib/components/textarea/textarea.d.ts +2 -1
- package/lib/components/textbox/__internal__/prefix.style.d.ts +2 -0
- package/lib/components/textbox/index.d.ts +2 -1
- package/lib/components/textbox/index.js +2 -10
- package/lib/components/textbox/textbox.component.d.ts +92 -0
- package/lib/components/textbox/textbox.component.js +534 -201
- package/lib/components/textbox/textbox.style.d.ts +5 -0
- package/lib/components/textbox/textbox.style.js +1 -16
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -1
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.js +7 -6
- package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +6 -5
- package/package.json +1 -1
- package/esm/__internal__/checkable-input/checkable-input.d.ts +0 -55
- package/esm/__internal__/checkable-input/hidden-checkable-input.d.ts +0 -42
- package/esm/components/textbox/textbox.d.ts +0 -125
- package/lib/__internal__/checkable-input/checkable-input.d.ts +0 -55
- package/lib/__internal__/checkable-input/hidden-checkable-input.d.ts +0 -42
- package/lib/components/textbox/textbox.d.ts +0 -125
|
@@ -48,26 +48,26 @@ const HiddenCheckableInput = ({
|
|
|
48
48
|
|
|
49
49
|
const handleFocus = ev => {
|
|
50
50
|
if (props.onFocus) props.onFocus(ev);
|
|
51
|
-
if (onFocus) onFocus(
|
|
52
|
-
if (onFocusGroup) onFocusGroup(
|
|
51
|
+
if (onFocus) onFocus();
|
|
52
|
+
if (onFocusGroup) onFocusGroup();
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
const handleBlur = ev => {
|
|
56
56
|
if (props.onBlur) props.onBlur(ev);
|
|
57
|
-
if (onBlur) onBlur(
|
|
58
|
-
if (onBlurGroup) onBlurGroup(
|
|
57
|
+
if (onBlur) onBlur();
|
|
58
|
+
if (onBlurGroup) onBlurGroup();
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
const handleMouseEnter = ev => {
|
|
62
62
|
if (props.onMouseEnter) props.onMouseEnter(ev);
|
|
63
|
-
if (onMouseEnter) onMouseEnter(
|
|
64
|
-
if (onMouseEnterGroup) onMouseEnterGroup(
|
|
63
|
+
if (onMouseEnter) onMouseEnter();
|
|
64
|
+
if (onMouseEnterGroup) onMouseEnterGroup();
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
const handleMouseLeave = ev => {
|
|
68
68
|
if (props.onMouseLeave) props.onMouseLeave(ev);
|
|
69
|
-
if (onMouseLeave) onMouseLeave(
|
|
70
|
-
if (onMouseLeaveGroup) onMouseLeaveGroup(
|
|
69
|
+
if (onMouseLeave) onMouseLeave();
|
|
70
|
+
if (onMouseLeaveGroup) onMouseLeaveGroup();
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
return /*#__PURE__*/_react.default.createElement(_hiddenCheckableInput.default, _extends({
|
|
@@ -91,43 +91,299 @@ const HiddenCheckableInput = ({
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
HiddenCheckableInput.propTypes = {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
94
|
+
"about": _propTypes.default.string,
|
|
95
|
+
"accept": _propTypes.default.string,
|
|
96
|
+
"accessKey": _propTypes.default.string,
|
|
97
|
+
"alt": _propTypes.default.string,
|
|
98
|
+
"aria-activedescendant": _propTypes.default.string,
|
|
99
|
+
"aria-atomic": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
100
|
+
"aria-autocomplete": _propTypes.default.oneOf(["both", "inline", "list", "none"]),
|
|
101
|
+
"aria-busy": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
102
|
+
"aria-checked": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "mixed", "true"]), _propTypes.default.bool]),
|
|
103
|
+
"aria-colcount": _propTypes.default.number,
|
|
104
|
+
"aria-colindex": _propTypes.default.number,
|
|
105
|
+
"aria-colspan": _propTypes.default.number,
|
|
106
|
+
"aria-controls": _propTypes.default.string,
|
|
107
|
+
"aria-current": _propTypes.default.oneOfType([_propTypes.default.oneOf(["date", "false", "location", "page", "step", "time", "true"]), _propTypes.default.bool]),
|
|
108
|
+
"aria-describedby": _propTypes.default.string,
|
|
109
|
+
"aria-details": _propTypes.default.string,
|
|
110
|
+
"aria-disabled": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
111
|
+
"aria-dropeffect": _propTypes.default.oneOf(["copy", "execute", "link", "move", "none", "popup"]),
|
|
112
|
+
"aria-errormessage": _propTypes.default.string,
|
|
113
|
+
"aria-expanded": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
114
|
+
"aria-flowto": _propTypes.default.string,
|
|
115
|
+
"aria-grabbed": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
116
|
+
"aria-haspopup": _propTypes.default.oneOfType([_propTypes.default.oneOf(["dialog", "false", "grid", "listbox", "menu", "tree", "true"]), _propTypes.default.bool]),
|
|
117
|
+
"aria-hidden": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
118
|
+
"aria-invalid": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "grammar", "spelling", "true"]), _propTypes.default.bool]),
|
|
119
|
+
"aria-keyshortcuts": _propTypes.default.string,
|
|
120
|
+
"aria-label": _propTypes.default.string,
|
|
121
|
+
"aria-labelledby": _propTypes.default.string,
|
|
122
|
+
"aria-level": _propTypes.default.number,
|
|
123
|
+
"aria-live": _propTypes.default.oneOf(["assertive", "off", "polite"]),
|
|
124
|
+
"aria-modal": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
125
|
+
"aria-multiline": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
126
|
+
"aria-multiselectable": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
127
|
+
"aria-orientation": _propTypes.default.oneOf(["horizontal", "vertical"]),
|
|
128
|
+
"aria-owns": _propTypes.default.string,
|
|
129
|
+
"aria-placeholder": _propTypes.default.string,
|
|
130
|
+
"aria-posinset": _propTypes.default.number,
|
|
131
|
+
"aria-pressed": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "mixed", "true"]), _propTypes.default.bool]),
|
|
132
|
+
"aria-readonly": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
133
|
+
"aria-relevant": _propTypes.default.oneOf(["additions removals", "additions text", "additions", "all", "removals additions", "removals text", "removals", "text additions", "text removals", "text"]),
|
|
134
|
+
"aria-required": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
135
|
+
"aria-roledescription": _propTypes.default.string,
|
|
136
|
+
"aria-rowcount": _propTypes.default.number,
|
|
137
|
+
"aria-rowindex": _propTypes.default.number,
|
|
138
|
+
"aria-rowspan": _propTypes.default.number,
|
|
139
|
+
"aria-selected": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
140
|
+
"aria-setsize": _propTypes.default.number,
|
|
141
|
+
"aria-sort": _propTypes.default.oneOf(["ascending", "descending", "none", "other"]),
|
|
142
|
+
"aria-valuemax": _propTypes.default.number,
|
|
143
|
+
"aria-valuemin": _propTypes.default.number,
|
|
144
|
+
"aria-valuenow": _propTypes.default.number,
|
|
145
|
+
"aria-valuetext": _propTypes.default.string,
|
|
146
|
+
"autoCapitalize": _propTypes.default.string,
|
|
147
|
+
"autoComplete": _propTypes.default.string,
|
|
148
|
+
"autoCorrect": _propTypes.default.string,
|
|
149
|
+
"autoFocus": _propTypes.default.bool,
|
|
150
|
+
"autoSave": _propTypes.default.string,
|
|
151
|
+
"capture": _propTypes.default.oneOfType([_propTypes.default.oneOf(["environment", "user"]), _propTypes.default.bool]),
|
|
152
|
+
"checked": _propTypes.default.bool,
|
|
153
|
+
"children": _propTypes.default.node,
|
|
154
|
+
"className": _propTypes.default.string,
|
|
155
|
+
"color": _propTypes.default.string,
|
|
156
|
+
"contentEditable": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "inherit", "true"]), _propTypes.default.bool]),
|
|
157
|
+
"contextMenu": _propTypes.default.string,
|
|
158
|
+
"crossOrigin": _propTypes.default.string,
|
|
159
|
+
"css": _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
160
|
+
"__emotion_styles": _propTypes.default.any.isRequired
|
|
161
|
+
}), _propTypes.default.string, _propTypes.default.bool]),
|
|
162
|
+
"dangerouslySetInnerHTML": _propTypes.default.shape({
|
|
163
|
+
"__html": _propTypes.default.string.isRequired
|
|
164
|
+
}),
|
|
165
|
+
"datatype": _propTypes.default.string,
|
|
166
|
+
"defaultChecked": _propTypes.default.bool,
|
|
167
|
+
"defaultValue": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.number, _propTypes.default.string]),
|
|
168
|
+
"dir": _propTypes.default.string,
|
|
169
|
+
"disabled": _propTypes.default.bool,
|
|
170
|
+
"draggable": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
171
|
+
"enterKeyHint": _propTypes.default.oneOf(["done", "enter", "go", "next", "previous", "search", "send"]),
|
|
172
|
+
"form": _propTypes.default.string,
|
|
173
|
+
"formAction": _propTypes.default.string,
|
|
174
|
+
"formEncType": _propTypes.default.string,
|
|
175
|
+
"formMethod": _propTypes.default.string,
|
|
176
|
+
"formNoValidate": _propTypes.default.bool,
|
|
177
|
+
"formTarget": _propTypes.default.string,
|
|
178
|
+
"height": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
179
|
+
"hidden": _propTypes.default.bool,
|
|
180
|
+
"id": _propTypes.default.string,
|
|
181
|
+
"inlist": _propTypes.default.any,
|
|
182
|
+
"inputMode": _propTypes.default.oneOf(["decimal", "email", "none", "numeric", "search", "tel", "text", "url"]),
|
|
183
|
+
"inputRef": _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
184
|
+
"current": _propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.object]).isRequired
|
|
185
|
+
})]),
|
|
186
|
+
"is": _propTypes.default.string,
|
|
187
|
+
"itemID": _propTypes.default.string,
|
|
188
|
+
"itemProp": _propTypes.default.string,
|
|
189
|
+
"itemRef": _propTypes.default.string,
|
|
190
|
+
"itemScope": _propTypes.default.bool,
|
|
191
|
+
"itemType": _propTypes.default.string,
|
|
192
|
+
"lang": _propTypes.default.string,
|
|
193
|
+
"list": _propTypes.default.string,
|
|
194
|
+
"max": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
195
|
+
"maxLength": _propTypes.default.number,
|
|
196
|
+
"min": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
197
|
+
"minLength": _propTypes.default.number,
|
|
198
|
+
"multiple": _propTypes.default.bool,
|
|
199
|
+
"name": _propTypes.default.string,
|
|
200
|
+
"onAbort": _propTypes.default.func,
|
|
201
|
+
"onAbortCapture": _propTypes.default.func,
|
|
202
|
+
"onAnimationEnd": _propTypes.default.func,
|
|
203
|
+
"onAnimationEndCapture": _propTypes.default.func,
|
|
204
|
+
"onAnimationIteration": _propTypes.default.func,
|
|
205
|
+
"onAnimationIterationCapture": _propTypes.default.func,
|
|
206
|
+
"onAnimationStart": _propTypes.default.func,
|
|
207
|
+
"onAnimationStartCapture": _propTypes.default.func,
|
|
208
|
+
"onAuxClick": _propTypes.default.func,
|
|
209
|
+
"onAuxClickCapture": _propTypes.default.func,
|
|
210
|
+
"onBeforeInput": _propTypes.default.func,
|
|
211
|
+
"onBeforeInputCapture": _propTypes.default.func,
|
|
212
|
+
"onBlur": _propTypes.default.func,
|
|
213
|
+
"onBlurCapture": _propTypes.default.func,
|
|
214
|
+
"onCanPlay": _propTypes.default.func,
|
|
215
|
+
"onCanPlayCapture": _propTypes.default.func,
|
|
216
|
+
"onCanPlayThrough": _propTypes.default.func,
|
|
217
|
+
"onCanPlayThroughCapture": _propTypes.default.func,
|
|
218
|
+
"onChange": _propTypes.default.func,
|
|
219
|
+
"onChangeCapture": _propTypes.default.func,
|
|
220
|
+
"onClick": _propTypes.default.func,
|
|
221
|
+
"onClickCapture": _propTypes.default.func,
|
|
222
|
+
"onCompositionEnd": _propTypes.default.func,
|
|
223
|
+
"onCompositionEndCapture": _propTypes.default.func,
|
|
224
|
+
"onCompositionStart": _propTypes.default.func,
|
|
225
|
+
"onCompositionStartCapture": _propTypes.default.func,
|
|
226
|
+
"onCompositionUpdate": _propTypes.default.func,
|
|
227
|
+
"onCompositionUpdateCapture": _propTypes.default.func,
|
|
228
|
+
"onContextMenu": _propTypes.default.func,
|
|
229
|
+
"onContextMenuCapture": _propTypes.default.func,
|
|
230
|
+
"onCopy": _propTypes.default.func,
|
|
231
|
+
"onCopyCapture": _propTypes.default.func,
|
|
232
|
+
"onCut": _propTypes.default.func,
|
|
233
|
+
"onCutCapture": _propTypes.default.func,
|
|
234
|
+
"onDoubleClick": _propTypes.default.func,
|
|
235
|
+
"onDoubleClickCapture": _propTypes.default.func,
|
|
236
|
+
"onDrag": _propTypes.default.func,
|
|
237
|
+
"onDragCapture": _propTypes.default.func,
|
|
238
|
+
"onDragEnd": _propTypes.default.func,
|
|
239
|
+
"onDragEndCapture": _propTypes.default.func,
|
|
240
|
+
"onDragEnter": _propTypes.default.func,
|
|
241
|
+
"onDragEnterCapture": _propTypes.default.func,
|
|
242
|
+
"onDragExit": _propTypes.default.func,
|
|
243
|
+
"onDragExitCapture": _propTypes.default.func,
|
|
244
|
+
"onDragLeave": _propTypes.default.func,
|
|
245
|
+
"onDragLeaveCapture": _propTypes.default.func,
|
|
246
|
+
"onDragOver": _propTypes.default.func,
|
|
247
|
+
"onDragOverCapture": _propTypes.default.func,
|
|
248
|
+
"onDragStart": _propTypes.default.func,
|
|
249
|
+
"onDragStartCapture": _propTypes.default.func,
|
|
250
|
+
"onDrop": _propTypes.default.func,
|
|
251
|
+
"onDropCapture": _propTypes.default.func,
|
|
252
|
+
"onDurationChange": _propTypes.default.func,
|
|
253
|
+
"onDurationChangeCapture": _propTypes.default.func,
|
|
254
|
+
"onEmptied": _propTypes.default.func,
|
|
255
|
+
"onEmptiedCapture": _propTypes.default.func,
|
|
256
|
+
"onEncrypted": _propTypes.default.func,
|
|
257
|
+
"onEncryptedCapture": _propTypes.default.func,
|
|
258
|
+
"onEnded": _propTypes.default.func,
|
|
259
|
+
"onEndedCapture": _propTypes.default.func,
|
|
260
|
+
"onError": _propTypes.default.func,
|
|
261
|
+
"onErrorCapture": _propTypes.default.func,
|
|
262
|
+
"onFocus": _propTypes.default.func,
|
|
263
|
+
"onFocusCapture": _propTypes.default.func,
|
|
264
|
+
"onGotPointerCapture": _propTypes.default.func,
|
|
265
|
+
"onGotPointerCaptureCapture": _propTypes.default.func,
|
|
266
|
+
"onInput": _propTypes.default.func,
|
|
267
|
+
"onInputCapture": _propTypes.default.func,
|
|
268
|
+
"onInvalid": _propTypes.default.func,
|
|
269
|
+
"onInvalidCapture": _propTypes.default.func,
|
|
270
|
+
"onKeyDown": _propTypes.default.func,
|
|
271
|
+
"onKeyDownCapture": _propTypes.default.func,
|
|
272
|
+
"onKeyPress": _propTypes.default.func,
|
|
273
|
+
"onKeyPressCapture": _propTypes.default.func,
|
|
274
|
+
"onKeyUp": _propTypes.default.func,
|
|
275
|
+
"onKeyUpCapture": _propTypes.default.func,
|
|
276
|
+
"onLoad": _propTypes.default.func,
|
|
277
|
+
"onLoadCapture": _propTypes.default.func,
|
|
278
|
+
"onLoadedData": _propTypes.default.func,
|
|
279
|
+
"onLoadedDataCapture": _propTypes.default.func,
|
|
280
|
+
"onLoadedMetadata": _propTypes.default.func,
|
|
281
|
+
"onLoadedMetadataCapture": _propTypes.default.func,
|
|
282
|
+
"onLoadStart": _propTypes.default.func,
|
|
283
|
+
"onLoadStartCapture": _propTypes.default.func,
|
|
284
|
+
"onLostPointerCapture": _propTypes.default.func,
|
|
285
|
+
"onLostPointerCaptureCapture": _propTypes.default.func,
|
|
286
|
+
"onMouseDown": _propTypes.default.func,
|
|
287
|
+
"onMouseDownCapture": _propTypes.default.func,
|
|
288
|
+
"onMouseEnter": _propTypes.default.func,
|
|
289
|
+
"onMouseLeave": _propTypes.default.func,
|
|
290
|
+
"onMouseMove": _propTypes.default.func,
|
|
291
|
+
"onMouseMoveCapture": _propTypes.default.func,
|
|
292
|
+
"onMouseOut": _propTypes.default.func,
|
|
293
|
+
"onMouseOutCapture": _propTypes.default.func,
|
|
294
|
+
"onMouseOver": _propTypes.default.func,
|
|
295
|
+
"onMouseOverCapture": _propTypes.default.func,
|
|
296
|
+
"onMouseUp": _propTypes.default.func,
|
|
297
|
+
"onMouseUpCapture": _propTypes.default.func,
|
|
298
|
+
"onPaste": _propTypes.default.func,
|
|
299
|
+
"onPasteCapture": _propTypes.default.func,
|
|
300
|
+
"onPause": _propTypes.default.func,
|
|
301
|
+
"onPauseCapture": _propTypes.default.func,
|
|
302
|
+
"onPlay": _propTypes.default.func,
|
|
303
|
+
"onPlayCapture": _propTypes.default.func,
|
|
304
|
+
"onPlaying": _propTypes.default.func,
|
|
305
|
+
"onPlayingCapture": _propTypes.default.func,
|
|
306
|
+
"onPointerCancel": _propTypes.default.func,
|
|
307
|
+
"onPointerCancelCapture": _propTypes.default.func,
|
|
308
|
+
"onPointerDown": _propTypes.default.func,
|
|
309
|
+
"onPointerDownCapture": _propTypes.default.func,
|
|
310
|
+
"onPointerEnter": _propTypes.default.func,
|
|
311
|
+
"onPointerEnterCapture": _propTypes.default.func,
|
|
312
|
+
"onPointerLeave": _propTypes.default.func,
|
|
313
|
+
"onPointerLeaveCapture": _propTypes.default.func,
|
|
314
|
+
"onPointerMove": _propTypes.default.func,
|
|
315
|
+
"onPointerMoveCapture": _propTypes.default.func,
|
|
316
|
+
"onPointerOut": _propTypes.default.func,
|
|
317
|
+
"onPointerOutCapture": _propTypes.default.func,
|
|
318
|
+
"onPointerOver": _propTypes.default.func,
|
|
319
|
+
"onPointerOverCapture": _propTypes.default.func,
|
|
320
|
+
"onPointerUp": _propTypes.default.func,
|
|
321
|
+
"onPointerUpCapture": _propTypes.default.func,
|
|
322
|
+
"onProgress": _propTypes.default.func,
|
|
323
|
+
"onProgressCapture": _propTypes.default.func,
|
|
324
|
+
"onRateChange": _propTypes.default.func,
|
|
325
|
+
"onRateChangeCapture": _propTypes.default.func,
|
|
326
|
+
"onReset": _propTypes.default.func,
|
|
327
|
+
"onResetCapture": _propTypes.default.func,
|
|
328
|
+
"onScroll": _propTypes.default.func,
|
|
329
|
+
"onScrollCapture": _propTypes.default.func,
|
|
330
|
+
"onSeeked": _propTypes.default.func,
|
|
331
|
+
"onSeekedCapture": _propTypes.default.func,
|
|
332
|
+
"onSeeking": _propTypes.default.func,
|
|
333
|
+
"onSeekingCapture": _propTypes.default.func,
|
|
334
|
+
"onSelect": _propTypes.default.func,
|
|
335
|
+
"onSelectCapture": _propTypes.default.func,
|
|
336
|
+
"onStalled": _propTypes.default.func,
|
|
337
|
+
"onStalledCapture": _propTypes.default.func,
|
|
338
|
+
"onSubmit": _propTypes.default.func,
|
|
339
|
+
"onSubmitCapture": _propTypes.default.func,
|
|
340
|
+
"onSuspend": _propTypes.default.func,
|
|
341
|
+
"onSuspendCapture": _propTypes.default.func,
|
|
342
|
+
"onTimeUpdate": _propTypes.default.func,
|
|
343
|
+
"onTimeUpdateCapture": _propTypes.default.func,
|
|
344
|
+
"onTouchCancel": _propTypes.default.func,
|
|
345
|
+
"onTouchCancelCapture": _propTypes.default.func,
|
|
346
|
+
"onTouchEnd": _propTypes.default.func,
|
|
347
|
+
"onTouchEndCapture": _propTypes.default.func,
|
|
348
|
+
"onTouchMove": _propTypes.default.func,
|
|
349
|
+
"onTouchMoveCapture": _propTypes.default.func,
|
|
350
|
+
"onTouchStart": _propTypes.default.func,
|
|
351
|
+
"onTouchStartCapture": _propTypes.default.func,
|
|
352
|
+
"onTransitionEnd": _propTypes.default.func,
|
|
353
|
+
"onTransitionEndCapture": _propTypes.default.func,
|
|
354
|
+
"onVolumeChange": _propTypes.default.func,
|
|
355
|
+
"onVolumeChangeCapture": _propTypes.default.func,
|
|
356
|
+
"onWaiting": _propTypes.default.func,
|
|
357
|
+
"onWaitingCapture": _propTypes.default.func,
|
|
358
|
+
"onWheel": _propTypes.default.func,
|
|
359
|
+
"onWheelCapture": _propTypes.default.func,
|
|
360
|
+
"pattern": _propTypes.default.string,
|
|
361
|
+
"placeholder": _propTypes.default.string,
|
|
362
|
+
"prefix": _propTypes.default.string,
|
|
363
|
+
"property": _propTypes.default.string,
|
|
364
|
+
"radioGroup": _propTypes.default.string,
|
|
365
|
+
"readOnly": _propTypes.default.bool,
|
|
366
|
+
"required": _propTypes.default.bool,
|
|
367
|
+
"resource": _propTypes.default.string,
|
|
368
|
+
"results": _propTypes.default.number,
|
|
369
|
+
"role": _propTypes.default.string,
|
|
370
|
+
"security": _propTypes.default.string,
|
|
371
|
+
"slot": _propTypes.default.string,
|
|
372
|
+
"spellCheck": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
|
|
373
|
+
"src": _propTypes.default.string,
|
|
374
|
+
"step": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
375
|
+
"style": _propTypes.default.object,
|
|
376
|
+
"suppressContentEditableWarning": _propTypes.default.bool,
|
|
377
|
+
"suppressHydrationWarning": _propTypes.default.bool,
|
|
378
|
+
"tabIndex": _propTypes.default.number,
|
|
379
|
+
"title": _propTypes.default.string,
|
|
380
|
+
"translate": _propTypes.default.oneOf(["no", "yes"]),
|
|
381
|
+
"type": _propTypes.default.string.isRequired,
|
|
382
|
+
"typeof": _propTypes.default.string,
|
|
383
|
+
"unselectable": _propTypes.default.oneOf(["off", "on"]),
|
|
384
|
+
"value": _propTypes.default.string,
|
|
385
|
+
"vocab": _propTypes.default.string,
|
|
386
|
+
"width": _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
131
387
|
};
|
|
132
388
|
|
|
133
389
|
var _default = /*#__PURE__*/_react.default.memo(HiddenCheckableInput);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Input from "./input.component";
|
|
2
2
|
import InputPresentation from "./input-presentation.component";
|
|
3
|
-
export type { InputProps } from "./input.component";
|
|
3
|
+
export type { InputProps, CommonInputProps } from "./input.component";
|
|
4
4
|
export { Input, InputPresentation };
|
|
5
5
|
export default Input;
|
|
@@ -2,5 +2,5 @@ import { CommonInputPresentationProps } from "./input-presentation.component";
|
|
|
2
2
|
import { InputContextProps } from "../input-behaviour";
|
|
3
3
|
import { CarbonProviderProps } from "../../components/carbon-provider";
|
|
4
4
|
export declare const StyledInputPresentationContainer: import("styled-components").StyledComponent<"div", any, Pick<CommonInputPresentationProps, "inputWidth">, never>;
|
|
5
|
-
declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "error" | "info" | "warning" | "
|
|
5
|
+
declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "error" | "info" | "warning" | "align" | "readOnly" | "size"> & Pick<CarbonProviderProps, "validationRedesignOptIn">, never>;
|
|
6
6
|
export default InputPresentationStyle;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CommonInputProps } from "./input.component";
|
|
2
|
-
declare const StyledInput: import("styled-components").StyledComponent<"input", any, Pick<CommonInputProps, "disabled" | "
|
|
2
|
+
declare const StyledInput: import("styled-components").StyledComponent<"input", any, Pick<CommonInputProps, "disabled" | "align" | "readOnly">, never>;
|
|
3
3
|
export default StyledInput;
|
|
@@ -37,20 +37,25 @@ const renderOpen = ({
|
|
|
37
37
|
"data-element": dataElement,
|
|
38
38
|
ref,
|
|
39
39
|
"aria-label": ariaLabel,
|
|
40
|
-
id
|
|
40
|
+
id,
|
|
41
|
+
"aria-expanded": ariaExpanded,
|
|
42
|
+
"aria-haspopup": ariaHasPopup
|
|
41
43
|
}) => /*#__PURE__*/_react.default.createElement(_popoverContainer.PopoverContainerOpenIcon, {
|
|
42
44
|
tabIndex: tabIndex,
|
|
43
45
|
onAction: onClick,
|
|
44
46
|
"data-element": dataElement,
|
|
45
47
|
ref: ref,
|
|
46
48
|
"aria-label": ariaLabel,
|
|
47
|
-
"aria-haspopup":
|
|
49
|
+
"aria-haspopup": ariaHasPopup,
|
|
50
|
+
"aria-expanded": ariaExpanded,
|
|
48
51
|
id: id
|
|
49
52
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
50
53
|
type: "settings"
|
|
51
54
|
}));
|
|
52
55
|
|
|
53
56
|
renderOpen.propTypes = {
|
|
57
|
+
"aria-expanded": _propTypes.default.bool.isRequired,
|
|
58
|
+
"aria-haspopup": _propTypes.default.oneOf(["dialog"]).isRequired,
|
|
54
59
|
"aria-label": _propTypes.default.string,
|
|
55
60
|
"data-element": _propTypes.default.string.isRequired,
|
|
56
61
|
"id": _propTypes.default.string,
|
|
@@ -143,6 +148,8 @@ const PopoverContainer = ({
|
|
|
143
148
|
|
|
144
149
|
const renderOpenComponentProps = {
|
|
145
150
|
tabIndex: isOpen ? -1 : 0,
|
|
151
|
+
"aria-expanded": isOpen,
|
|
152
|
+
"aria-haspopup": "dialog",
|
|
146
153
|
isOpen,
|
|
147
154
|
"data-element": "popover-container-open-component",
|
|
148
155
|
onClick: handleOpenButtonClick,
|
|
@@ -166,8 +173,6 @@ const PopoverContainer = ({
|
|
|
166
173
|
const handleClick = (0, _useClickAwayListener.default)(handleClickAway, "mousedown");
|
|
167
174
|
return /*#__PURE__*/_react.default.createElement(_popoverContainer.PopoverContainerWrapperStyle, {
|
|
168
175
|
"data-component": "popover-container",
|
|
169
|
-
role: "region",
|
|
170
|
-
"aria-labelledby": popoverContainerId,
|
|
171
176
|
onMouseDown: handleClick
|
|
172
177
|
}, renderOpenComponent(renderOpenComponentProps), /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.Transition, {
|
|
173
178
|
in: isOpen,
|
|
@@ -236,7 +236,7 @@ const MultiSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
236
236
|
wrapText: wrapPillText
|
|
237
237
|
}, pillProps), title));
|
|
238
238
|
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
239
|
-
}, [children, disabled, readOnly,
|
|
239
|
+
}, [children, disabled, readOnly, actualValue]);
|
|
240
240
|
(0, _react.useEffect)(() => {
|
|
241
241
|
const modeSwitchedMessage = "Input elements should not switch from uncontrolled to controlled (or vice versa). " + "Decide between using a controlled or uncontrolled input element for the lifetime of the component";
|
|
242
242
|
const onChangeMissingMessage = "onChange prop required when using a controlled input element";
|
|
@@ -91,6 +91,24 @@ const SelectList = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
91
91
|
blockScroll,
|
|
92
92
|
allowScroll
|
|
93
93
|
} = (0, _useScrollBlock.default)();
|
|
94
|
+
|
|
95
|
+
const updateListHeight = () => {
|
|
96
|
+
let newHeight = listRef.current.clientHeight;
|
|
97
|
+
|
|
98
|
+
if (listActionButtonRef.current) {
|
|
99
|
+
newHeight += listActionButtonRef.current.parentElement.clientHeight;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
setListHeight(`${newHeight}px`);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const listCallbackRef = (0, _react.useCallback)(element => {
|
|
106
|
+
listRef.current = element;
|
|
107
|
+
|
|
108
|
+
if (element) {
|
|
109
|
+
setTimeout(updateListHeight, 0);
|
|
110
|
+
}
|
|
111
|
+
}, []);
|
|
94
112
|
(0, _react.useEffect)(() => {
|
|
95
113
|
blockScroll();
|
|
96
114
|
return () => {
|
|
@@ -255,16 +273,7 @@ const SelectList = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
255
273
|
window.removeEventListener("resize", assignListWidth);
|
|
256
274
|
};
|
|
257
275
|
}, [assignListWidth]);
|
|
258
|
-
(0, _react.useLayoutEffect)(
|
|
259
|
-
let newHeight;
|
|
260
|
-
newHeight = listRef.current.clientHeight;
|
|
261
|
-
|
|
262
|
-
if (listActionButtonRef.current) {
|
|
263
|
-
newHeight += listActionButtonRef.current.parentElement.clientHeight;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
setListHeight(`${newHeight}px`);
|
|
267
|
-
}, [children]);
|
|
276
|
+
(0, _react.useLayoutEffect)(updateListHeight, [children]);
|
|
268
277
|
(0, _react.useEffect)(() => {
|
|
269
278
|
const keyboardEvent = "keydown";
|
|
270
279
|
const listElement = listRef.current;
|
|
@@ -355,7 +364,7 @@ const SelectList = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
355
364
|
"aria-labelledby": labelId,
|
|
356
365
|
"data-element": "select-list",
|
|
357
366
|
role: "listbox",
|
|
358
|
-
ref:
|
|
367
|
+
ref: listCallbackRef,
|
|
359
368
|
tabIndex: "-1",
|
|
360
369
|
isLoading: isLoading,
|
|
361
370
|
multiColumn: multiColumn
|
|
@@ -15,7 +15,7 @@ var _input = require("../../__internal__/input");
|
|
|
15
15
|
|
|
16
16
|
var _formField = _interopRequireDefault(require("../../__internal__/form-field"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _useCharacterCount = _interopRequireDefault(require("../../hooks/__internal__/useCharacterCount"));
|
|
19
19
|
|
|
20
20
|
var _input2 = _interopRequireDefault(require("../../__internal__/input/input.component"));
|
|
21
21
|
|
|
@@ -29,8 +29,6 @@ var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/gui
|
|
|
29
29
|
|
|
30
30
|
var _textarea = _interopRequireWildcard(require("./textarea.style"));
|
|
31
31
|
|
|
32
|
-
var _i18nContext = _interopRequireDefault(require("../../__internal__/i18n-context"));
|
|
33
|
-
|
|
34
32
|
var _tooltipProvider = require("../../__internal__/tooltip-provider");
|
|
35
33
|
|
|
36
34
|
var _useInputAccessibility = _interopRequireDefault(require("../../hooks/__internal__/useInputAccessibility"));
|
|
@@ -49,8 +47,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
49
47
|
|
|
50
48
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
51
49
|
|
|
52
|
-
const getFormatNumber = (value, locale) => new Intl.NumberFormat(locale).format(value);
|
|
53
|
-
|
|
54
50
|
const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
|
|
55
51
|
|
|
56
52
|
const Textarea = ({
|
|
@@ -91,7 +87,6 @@ const Textarea = ({
|
|
|
91
87
|
helpAriaLabel,
|
|
92
88
|
...props
|
|
93
89
|
}) => {
|
|
94
|
-
const locale = (0, _react.useContext)(_i18nContext.default);
|
|
95
90
|
const {
|
|
96
91
|
validationRedesignOptIn
|
|
97
92
|
} = (0, _react.useContext)(_carbonProvider.NewValidationContext);
|
|
@@ -128,6 +123,8 @@ const Textarea = ({
|
|
|
128
123
|
label,
|
|
129
124
|
fieldHelp
|
|
130
125
|
});
|
|
126
|
+
const [maxLength, characterCount] = (0, _useCharacterCount.default)(value, // TODO: Can be removed after the characterLimit type is changed to number
|
|
127
|
+
typeof characterLimit === "string" ? parseInt(characterLimit, 10) : characterLimit, warnOverLimit, enforceCharacterLimit);
|
|
131
128
|
(0, _react.useEffect)(() => {
|
|
132
129
|
if (rows) {
|
|
133
130
|
minHeight.current = inputRef.current.scrollHeight;
|
|
@@ -150,24 +147,6 @@ const Textarea = ({
|
|
|
150
147
|
}
|
|
151
148
|
};
|
|
152
149
|
}, [expandable]);
|
|
153
|
-
|
|
154
|
-
const isOverLimit = () => {
|
|
155
|
-
return (value || "").length > parseInt(characterLimit, 10);
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
const characterCount = () => {
|
|
159
|
-
if (!characterLimit) {
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return /*#__PURE__*/_react.default.createElement(_characterCount.default, {
|
|
164
|
-
isOverLimit: isOverLimit() && warnOverLimit,
|
|
165
|
-
value: getFormatNumber((value || "").length, locale.locale()),
|
|
166
|
-
limit: getFormatNumber(characterLimit, locale.locale()),
|
|
167
|
-
"data-element": "character-limit"
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
|
-
|
|
171
150
|
return /*#__PURE__*/_react.default.createElement(_tooltipProvider.TooltipProvider, {
|
|
172
151
|
tooltipPosition: tooltipPosition,
|
|
173
152
|
helpAriaLabel: helpAriaLabel
|
|
@@ -216,7 +195,7 @@ const Textarea = ({
|
|
|
216
195
|
name: name,
|
|
217
196
|
value: value,
|
|
218
197
|
ref: inputRef,
|
|
219
|
-
maxLength:
|
|
198
|
+
maxLength: maxLength,
|
|
220
199
|
onChange: onChange,
|
|
221
200
|
disabled: disabled,
|
|
222
201
|
readOnly: readOnly,
|
|
@@ -236,7 +215,7 @@ const Textarea = ({
|
|
|
236
215
|
info: info,
|
|
237
216
|
validationIconId: validationRedesignOptIn ? undefined : validationIconId,
|
|
238
217
|
useValidationIcon: !(validationRedesignOptIn || validationOnLabel)
|
|
239
|
-
}))), characterCount
|
|
218
|
+
}))), characterCount)));
|
|
240
219
|
};
|
|
241
220
|
|
|
242
221
|
exports.OriginalTextarea = Textarea;
|
|
@@ -258,7 +237,7 @@ Textarea.propTypes = { ...marginPropTypes,
|
|
|
258
237
|
id: _propTypes.default.string,
|
|
259
238
|
|
|
260
239
|
/** Character limit of the textarea */
|
|
261
|
-
characterLimit: _propTypes.default.string,
|
|
240
|
+
characterLimit: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
262
241
|
|
|
263
242
|
/** Type of the icon that will be rendered next to the input */
|
|
264
243
|
children: _propTypes.default.node,
|