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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import FieldHelpStyle from "../field-help/field-help.style";
|
|
4
3
|
import { FieldLineStyle } from "../form-field/form-field.style";
|
|
5
4
|
import HiddenCheckableInputStyle from "./hidden-checkable-input.style";
|
|
@@ -97,10 +96,4 @@ const StyledCheckableInputWrapper = styled.div`
|
|
|
97
96
|
`}
|
|
98
97
|
`}
|
|
99
98
|
`;
|
|
100
|
-
StyledCheckableInputWrapper.propTypes = {
|
|
101
|
-
disabled: PropTypes.bool,
|
|
102
|
-
fieldHelpInline: PropTypes.bool,
|
|
103
|
-
inputWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
104
|
-
labelWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
105
|
-
};
|
|
106
99
|
export { StyledCheckableInput, StyledCheckableInputWrapper };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface CommonHiddenCheckableInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "size" | "type"> {
|
|
3
|
+
/** If true the Component will be focused when page load */
|
|
4
|
+
autoFocus?: boolean;
|
|
5
|
+
/** Checked state of the input */
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
/** Input name */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** OnChange event handler */
|
|
10
|
+
onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
/** OnFocus event handler */
|
|
12
|
+
onFocus?: (ev: React.FocusEvent<HTMLInputElement>) => void;
|
|
13
|
+
/** Blur event handler */
|
|
14
|
+
onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
|
|
15
|
+
/** OnMouseLeave event handler */
|
|
16
|
+
onMouseLeave?: (ev: React.MouseEvent<HTMLInputElement>) => void;
|
|
17
|
+
/** OnMouseEnter event handler */
|
|
18
|
+
onMouseEnter?: (ev: React.MouseEvent<HTMLInputElement>) => void;
|
|
19
|
+
/** Value of the input */
|
|
20
|
+
value?: string;
|
|
21
|
+
/** A callback to retrieve the input reference */
|
|
22
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
23
|
+
}
|
|
24
|
+
export interface HiddenCheckableInputProps extends CommonHiddenCheckableInputProps {
|
|
25
|
+
/** HTML type attribute of the input */
|
|
26
|
+
type: string;
|
|
27
|
+
/** Role attribute of the input */
|
|
28
|
+
role?: string;
|
|
29
|
+
}
|
|
30
|
+
declare const _default: React.MemoExoticComponent<({ name, checked, type, value, inputRef, onChange, autoFocus, role, ...props }: HiddenCheckableInputProps) => JSX.Element>;
|
|
31
|
+
export default _default;
|
|
@@ -32,26 +32,26 @@ const HiddenCheckableInput = ({
|
|
|
32
32
|
|
|
33
33
|
const handleFocus = ev => {
|
|
34
34
|
if (props.onFocus) props.onFocus(ev);
|
|
35
|
-
if (onFocus) onFocus(
|
|
36
|
-
if (onFocusGroup) onFocusGroup(
|
|
35
|
+
if (onFocus) onFocus();
|
|
36
|
+
if (onFocusGroup) onFocusGroup();
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const handleBlur = ev => {
|
|
40
40
|
if (props.onBlur) props.onBlur(ev);
|
|
41
|
-
if (onBlur) onBlur(
|
|
42
|
-
if (onBlurGroup) onBlurGroup(
|
|
41
|
+
if (onBlur) onBlur();
|
|
42
|
+
if (onBlurGroup) onBlurGroup();
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
const handleMouseEnter = ev => {
|
|
46
46
|
if (props.onMouseEnter) props.onMouseEnter(ev);
|
|
47
|
-
if (onMouseEnter) onMouseEnter(
|
|
48
|
-
if (onMouseEnterGroup) onMouseEnterGroup(
|
|
47
|
+
if (onMouseEnter) onMouseEnter();
|
|
48
|
+
if (onMouseEnterGroup) onMouseEnterGroup();
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
const handleMouseLeave = ev => {
|
|
52
52
|
if (props.onMouseLeave) props.onMouseLeave(ev);
|
|
53
|
-
if (onMouseLeave) onMouseLeave(
|
|
54
|
-
if (onMouseLeaveGroup) onMouseLeaveGroup(
|
|
53
|
+
if (onMouseLeave) onMouseLeave();
|
|
54
|
+
if (onMouseLeaveGroup) onMouseLeaveGroup();
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
return /*#__PURE__*/React.createElement(HiddenCheckableInputStyle, _extends({
|
|
@@ -75,42 +75,298 @@ const HiddenCheckableInput = ({
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
HiddenCheckableInput.propTypes = {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
78
|
+
"about": PropTypes.string,
|
|
79
|
+
"accept": PropTypes.string,
|
|
80
|
+
"accessKey": PropTypes.string,
|
|
81
|
+
"alt": PropTypes.string,
|
|
82
|
+
"aria-activedescendant": PropTypes.string,
|
|
83
|
+
"aria-atomic": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
84
|
+
"aria-autocomplete": PropTypes.oneOf(["both", "inline", "list", "none"]),
|
|
85
|
+
"aria-busy": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
86
|
+
"aria-checked": PropTypes.oneOfType([PropTypes.oneOf(["false", "mixed", "true"]), PropTypes.bool]),
|
|
87
|
+
"aria-colcount": PropTypes.number,
|
|
88
|
+
"aria-colindex": PropTypes.number,
|
|
89
|
+
"aria-colspan": PropTypes.number,
|
|
90
|
+
"aria-controls": PropTypes.string,
|
|
91
|
+
"aria-current": PropTypes.oneOfType([PropTypes.oneOf(["date", "false", "location", "page", "step", "time", "true"]), PropTypes.bool]),
|
|
92
|
+
"aria-describedby": PropTypes.string,
|
|
93
|
+
"aria-details": PropTypes.string,
|
|
94
|
+
"aria-disabled": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
95
|
+
"aria-dropeffect": PropTypes.oneOf(["copy", "execute", "link", "move", "none", "popup"]),
|
|
96
|
+
"aria-errormessage": PropTypes.string,
|
|
97
|
+
"aria-expanded": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
98
|
+
"aria-flowto": PropTypes.string,
|
|
99
|
+
"aria-grabbed": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
100
|
+
"aria-haspopup": PropTypes.oneOfType([PropTypes.oneOf(["dialog", "false", "grid", "listbox", "menu", "tree", "true"]), PropTypes.bool]),
|
|
101
|
+
"aria-hidden": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
102
|
+
"aria-invalid": PropTypes.oneOfType([PropTypes.oneOf(["false", "grammar", "spelling", "true"]), PropTypes.bool]),
|
|
103
|
+
"aria-keyshortcuts": PropTypes.string,
|
|
104
|
+
"aria-label": PropTypes.string,
|
|
105
|
+
"aria-labelledby": PropTypes.string,
|
|
106
|
+
"aria-level": PropTypes.number,
|
|
107
|
+
"aria-live": PropTypes.oneOf(["assertive", "off", "polite"]),
|
|
108
|
+
"aria-modal": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
109
|
+
"aria-multiline": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
110
|
+
"aria-multiselectable": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
111
|
+
"aria-orientation": PropTypes.oneOf(["horizontal", "vertical"]),
|
|
112
|
+
"aria-owns": PropTypes.string,
|
|
113
|
+
"aria-placeholder": PropTypes.string,
|
|
114
|
+
"aria-posinset": PropTypes.number,
|
|
115
|
+
"aria-pressed": PropTypes.oneOfType([PropTypes.oneOf(["false", "mixed", "true"]), PropTypes.bool]),
|
|
116
|
+
"aria-readonly": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
117
|
+
"aria-relevant": PropTypes.oneOf(["additions removals", "additions text", "additions", "all", "removals additions", "removals text", "removals", "text additions", "text removals", "text"]),
|
|
118
|
+
"aria-required": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
119
|
+
"aria-roledescription": PropTypes.string,
|
|
120
|
+
"aria-rowcount": PropTypes.number,
|
|
121
|
+
"aria-rowindex": PropTypes.number,
|
|
122
|
+
"aria-rowspan": PropTypes.number,
|
|
123
|
+
"aria-selected": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
124
|
+
"aria-setsize": PropTypes.number,
|
|
125
|
+
"aria-sort": PropTypes.oneOf(["ascending", "descending", "none", "other"]),
|
|
126
|
+
"aria-valuemax": PropTypes.number,
|
|
127
|
+
"aria-valuemin": PropTypes.number,
|
|
128
|
+
"aria-valuenow": PropTypes.number,
|
|
129
|
+
"aria-valuetext": PropTypes.string,
|
|
130
|
+
"autoCapitalize": PropTypes.string,
|
|
131
|
+
"autoComplete": PropTypes.string,
|
|
132
|
+
"autoCorrect": PropTypes.string,
|
|
133
|
+
"autoFocus": PropTypes.bool,
|
|
134
|
+
"autoSave": PropTypes.string,
|
|
135
|
+
"capture": PropTypes.oneOfType([PropTypes.oneOf(["environment", "user"]), PropTypes.bool]),
|
|
136
|
+
"checked": PropTypes.bool,
|
|
137
|
+
"children": PropTypes.node,
|
|
138
|
+
"className": PropTypes.string,
|
|
139
|
+
"color": PropTypes.string,
|
|
140
|
+
"contentEditable": PropTypes.oneOfType([PropTypes.oneOf(["false", "inherit", "true"]), PropTypes.bool]),
|
|
141
|
+
"contextMenu": PropTypes.string,
|
|
142
|
+
"crossOrigin": PropTypes.string,
|
|
143
|
+
"css": PropTypes.oneOfType([PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
144
|
+
"__emotion_styles": PropTypes.any.isRequired
|
|
145
|
+
}), PropTypes.string, PropTypes.bool]),
|
|
146
|
+
"dangerouslySetInnerHTML": PropTypes.shape({
|
|
147
|
+
"__html": PropTypes.string.isRequired
|
|
148
|
+
}),
|
|
149
|
+
"datatype": PropTypes.string,
|
|
150
|
+
"defaultChecked": PropTypes.bool,
|
|
151
|
+
"defaultValue": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.number, PropTypes.string]),
|
|
152
|
+
"dir": PropTypes.string,
|
|
153
|
+
"disabled": PropTypes.bool,
|
|
154
|
+
"draggable": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
155
|
+
"enterKeyHint": PropTypes.oneOf(["done", "enter", "go", "next", "previous", "search", "send"]),
|
|
156
|
+
"form": PropTypes.string,
|
|
157
|
+
"formAction": PropTypes.string,
|
|
158
|
+
"formEncType": PropTypes.string,
|
|
159
|
+
"formMethod": PropTypes.string,
|
|
160
|
+
"formNoValidate": PropTypes.bool,
|
|
161
|
+
"formTarget": PropTypes.string,
|
|
162
|
+
"height": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
163
|
+
"hidden": PropTypes.bool,
|
|
164
|
+
"id": PropTypes.string,
|
|
165
|
+
"inlist": PropTypes.any,
|
|
166
|
+
"inputMode": PropTypes.oneOf(["decimal", "email", "none", "numeric", "search", "tel", "text", "url"]),
|
|
167
|
+
"inputRef": PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
168
|
+
"current": PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.object]).isRequired
|
|
169
|
+
})]),
|
|
170
|
+
"is": PropTypes.string,
|
|
171
|
+
"itemID": PropTypes.string,
|
|
172
|
+
"itemProp": PropTypes.string,
|
|
173
|
+
"itemRef": PropTypes.string,
|
|
174
|
+
"itemScope": PropTypes.bool,
|
|
175
|
+
"itemType": PropTypes.string,
|
|
176
|
+
"lang": PropTypes.string,
|
|
177
|
+
"list": PropTypes.string,
|
|
178
|
+
"max": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
179
|
+
"maxLength": PropTypes.number,
|
|
180
|
+
"min": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
181
|
+
"minLength": PropTypes.number,
|
|
182
|
+
"multiple": PropTypes.bool,
|
|
183
|
+
"name": PropTypes.string,
|
|
184
|
+
"onAbort": PropTypes.func,
|
|
185
|
+
"onAbortCapture": PropTypes.func,
|
|
186
|
+
"onAnimationEnd": PropTypes.func,
|
|
187
|
+
"onAnimationEndCapture": PropTypes.func,
|
|
188
|
+
"onAnimationIteration": PropTypes.func,
|
|
189
|
+
"onAnimationIterationCapture": PropTypes.func,
|
|
190
|
+
"onAnimationStart": PropTypes.func,
|
|
191
|
+
"onAnimationStartCapture": PropTypes.func,
|
|
192
|
+
"onAuxClick": PropTypes.func,
|
|
193
|
+
"onAuxClickCapture": PropTypes.func,
|
|
194
|
+
"onBeforeInput": PropTypes.func,
|
|
195
|
+
"onBeforeInputCapture": PropTypes.func,
|
|
196
|
+
"onBlur": PropTypes.func,
|
|
197
|
+
"onBlurCapture": PropTypes.func,
|
|
198
|
+
"onCanPlay": PropTypes.func,
|
|
199
|
+
"onCanPlayCapture": PropTypes.func,
|
|
200
|
+
"onCanPlayThrough": PropTypes.func,
|
|
201
|
+
"onCanPlayThroughCapture": PropTypes.func,
|
|
202
|
+
"onChange": PropTypes.func,
|
|
203
|
+
"onChangeCapture": PropTypes.func,
|
|
204
|
+
"onClick": PropTypes.func,
|
|
205
|
+
"onClickCapture": PropTypes.func,
|
|
206
|
+
"onCompositionEnd": PropTypes.func,
|
|
207
|
+
"onCompositionEndCapture": PropTypes.func,
|
|
208
|
+
"onCompositionStart": PropTypes.func,
|
|
209
|
+
"onCompositionStartCapture": PropTypes.func,
|
|
210
|
+
"onCompositionUpdate": PropTypes.func,
|
|
211
|
+
"onCompositionUpdateCapture": PropTypes.func,
|
|
212
|
+
"onContextMenu": PropTypes.func,
|
|
213
|
+
"onContextMenuCapture": PropTypes.func,
|
|
214
|
+
"onCopy": PropTypes.func,
|
|
215
|
+
"onCopyCapture": PropTypes.func,
|
|
216
|
+
"onCut": PropTypes.func,
|
|
217
|
+
"onCutCapture": PropTypes.func,
|
|
218
|
+
"onDoubleClick": PropTypes.func,
|
|
219
|
+
"onDoubleClickCapture": PropTypes.func,
|
|
220
|
+
"onDrag": PropTypes.func,
|
|
221
|
+
"onDragCapture": PropTypes.func,
|
|
222
|
+
"onDragEnd": PropTypes.func,
|
|
223
|
+
"onDragEndCapture": PropTypes.func,
|
|
224
|
+
"onDragEnter": PropTypes.func,
|
|
225
|
+
"onDragEnterCapture": PropTypes.func,
|
|
226
|
+
"onDragExit": PropTypes.func,
|
|
227
|
+
"onDragExitCapture": PropTypes.func,
|
|
228
|
+
"onDragLeave": PropTypes.func,
|
|
229
|
+
"onDragLeaveCapture": PropTypes.func,
|
|
230
|
+
"onDragOver": PropTypes.func,
|
|
231
|
+
"onDragOverCapture": PropTypes.func,
|
|
232
|
+
"onDragStart": PropTypes.func,
|
|
233
|
+
"onDragStartCapture": PropTypes.func,
|
|
234
|
+
"onDrop": PropTypes.func,
|
|
235
|
+
"onDropCapture": PropTypes.func,
|
|
236
|
+
"onDurationChange": PropTypes.func,
|
|
237
|
+
"onDurationChangeCapture": PropTypes.func,
|
|
238
|
+
"onEmptied": PropTypes.func,
|
|
239
|
+
"onEmptiedCapture": PropTypes.func,
|
|
240
|
+
"onEncrypted": PropTypes.func,
|
|
241
|
+
"onEncryptedCapture": PropTypes.func,
|
|
242
|
+
"onEnded": PropTypes.func,
|
|
243
|
+
"onEndedCapture": PropTypes.func,
|
|
244
|
+
"onError": PropTypes.func,
|
|
245
|
+
"onErrorCapture": PropTypes.func,
|
|
246
|
+
"onFocus": PropTypes.func,
|
|
247
|
+
"onFocusCapture": PropTypes.func,
|
|
248
|
+
"onGotPointerCapture": PropTypes.func,
|
|
249
|
+
"onGotPointerCaptureCapture": PropTypes.func,
|
|
250
|
+
"onInput": PropTypes.func,
|
|
251
|
+
"onInputCapture": PropTypes.func,
|
|
252
|
+
"onInvalid": PropTypes.func,
|
|
253
|
+
"onInvalidCapture": PropTypes.func,
|
|
254
|
+
"onKeyDown": PropTypes.func,
|
|
255
|
+
"onKeyDownCapture": PropTypes.func,
|
|
256
|
+
"onKeyPress": PropTypes.func,
|
|
257
|
+
"onKeyPressCapture": PropTypes.func,
|
|
258
|
+
"onKeyUp": PropTypes.func,
|
|
259
|
+
"onKeyUpCapture": PropTypes.func,
|
|
260
|
+
"onLoad": PropTypes.func,
|
|
261
|
+
"onLoadCapture": PropTypes.func,
|
|
262
|
+
"onLoadedData": PropTypes.func,
|
|
263
|
+
"onLoadedDataCapture": PropTypes.func,
|
|
264
|
+
"onLoadedMetadata": PropTypes.func,
|
|
265
|
+
"onLoadedMetadataCapture": PropTypes.func,
|
|
266
|
+
"onLoadStart": PropTypes.func,
|
|
267
|
+
"onLoadStartCapture": PropTypes.func,
|
|
268
|
+
"onLostPointerCapture": PropTypes.func,
|
|
269
|
+
"onLostPointerCaptureCapture": PropTypes.func,
|
|
270
|
+
"onMouseDown": PropTypes.func,
|
|
271
|
+
"onMouseDownCapture": PropTypes.func,
|
|
272
|
+
"onMouseEnter": PropTypes.func,
|
|
273
|
+
"onMouseLeave": PropTypes.func,
|
|
274
|
+
"onMouseMove": PropTypes.func,
|
|
275
|
+
"onMouseMoveCapture": PropTypes.func,
|
|
276
|
+
"onMouseOut": PropTypes.func,
|
|
277
|
+
"onMouseOutCapture": PropTypes.func,
|
|
278
|
+
"onMouseOver": PropTypes.func,
|
|
279
|
+
"onMouseOverCapture": PropTypes.func,
|
|
280
|
+
"onMouseUp": PropTypes.func,
|
|
281
|
+
"onMouseUpCapture": PropTypes.func,
|
|
282
|
+
"onPaste": PropTypes.func,
|
|
283
|
+
"onPasteCapture": PropTypes.func,
|
|
284
|
+
"onPause": PropTypes.func,
|
|
285
|
+
"onPauseCapture": PropTypes.func,
|
|
286
|
+
"onPlay": PropTypes.func,
|
|
287
|
+
"onPlayCapture": PropTypes.func,
|
|
288
|
+
"onPlaying": PropTypes.func,
|
|
289
|
+
"onPlayingCapture": PropTypes.func,
|
|
290
|
+
"onPointerCancel": PropTypes.func,
|
|
291
|
+
"onPointerCancelCapture": PropTypes.func,
|
|
292
|
+
"onPointerDown": PropTypes.func,
|
|
293
|
+
"onPointerDownCapture": PropTypes.func,
|
|
294
|
+
"onPointerEnter": PropTypes.func,
|
|
295
|
+
"onPointerEnterCapture": PropTypes.func,
|
|
296
|
+
"onPointerLeave": PropTypes.func,
|
|
297
|
+
"onPointerLeaveCapture": PropTypes.func,
|
|
298
|
+
"onPointerMove": PropTypes.func,
|
|
299
|
+
"onPointerMoveCapture": PropTypes.func,
|
|
300
|
+
"onPointerOut": PropTypes.func,
|
|
301
|
+
"onPointerOutCapture": PropTypes.func,
|
|
302
|
+
"onPointerOver": PropTypes.func,
|
|
303
|
+
"onPointerOverCapture": PropTypes.func,
|
|
304
|
+
"onPointerUp": PropTypes.func,
|
|
305
|
+
"onPointerUpCapture": PropTypes.func,
|
|
306
|
+
"onProgress": PropTypes.func,
|
|
307
|
+
"onProgressCapture": PropTypes.func,
|
|
308
|
+
"onRateChange": PropTypes.func,
|
|
309
|
+
"onRateChangeCapture": PropTypes.func,
|
|
310
|
+
"onReset": PropTypes.func,
|
|
311
|
+
"onResetCapture": PropTypes.func,
|
|
312
|
+
"onScroll": PropTypes.func,
|
|
313
|
+
"onScrollCapture": PropTypes.func,
|
|
314
|
+
"onSeeked": PropTypes.func,
|
|
315
|
+
"onSeekedCapture": PropTypes.func,
|
|
316
|
+
"onSeeking": PropTypes.func,
|
|
317
|
+
"onSeekingCapture": PropTypes.func,
|
|
318
|
+
"onSelect": PropTypes.func,
|
|
319
|
+
"onSelectCapture": PropTypes.func,
|
|
320
|
+
"onStalled": PropTypes.func,
|
|
321
|
+
"onStalledCapture": PropTypes.func,
|
|
322
|
+
"onSubmit": PropTypes.func,
|
|
323
|
+
"onSubmitCapture": PropTypes.func,
|
|
324
|
+
"onSuspend": PropTypes.func,
|
|
325
|
+
"onSuspendCapture": PropTypes.func,
|
|
326
|
+
"onTimeUpdate": PropTypes.func,
|
|
327
|
+
"onTimeUpdateCapture": PropTypes.func,
|
|
328
|
+
"onTouchCancel": PropTypes.func,
|
|
329
|
+
"onTouchCancelCapture": PropTypes.func,
|
|
330
|
+
"onTouchEnd": PropTypes.func,
|
|
331
|
+
"onTouchEndCapture": PropTypes.func,
|
|
332
|
+
"onTouchMove": PropTypes.func,
|
|
333
|
+
"onTouchMoveCapture": PropTypes.func,
|
|
334
|
+
"onTouchStart": PropTypes.func,
|
|
335
|
+
"onTouchStartCapture": PropTypes.func,
|
|
336
|
+
"onTransitionEnd": PropTypes.func,
|
|
337
|
+
"onTransitionEndCapture": PropTypes.func,
|
|
338
|
+
"onVolumeChange": PropTypes.func,
|
|
339
|
+
"onVolumeChangeCapture": PropTypes.func,
|
|
340
|
+
"onWaiting": PropTypes.func,
|
|
341
|
+
"onWaitingCapture": PropTypes.func,
|
|
342
|
+
"onWheel": PropTypes.func,
|
|
343
|
+
"onWheelCapture": PropTypes.func,
|
|
344
|
+
"pattern": PropTypes.string,
|
|
345
|
+
"placeholder": PropTypes.string,
|
|
346
|
+
"prefix": PropTypes.string,
|
|
347
|
+
"property": PropTypes.string,
|
|
348
|
+
"radioGroup": PropTypes.string,
|
|
349
|
+
"readOnly": PropTypes.bool,
|
|
350
|
+
"required": PropTypes.bool,
|
|
351
|
+
"resource": PropTypes.string,
|
|
352
|
+
"results": PropTypes.number,
|
|
353
|
+
"role": PropTypes.string,
|
|
354
|
+
"security": PropTypes.string,
|
|
355
|
+
"slot": PropTypes.string,
|
|
356
|
+
"spellCheck": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
|
|
357
|
+
"src": PropTypes.string,
|
|
358
|
+
"step": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
359
|
+
"style": PropTypes.object,
|
|
360
|
+
"suppressContentEditableWarning": PropTypes.bool,
|
|
361
|
+
"suppressHydrationWarning": PropTypes.bool,
|
|
362
|
+
"tabIndex": PropTypes.number,
|
|
363
|
+
"title": PropTypes.string,
|
|
364
|
+
"translate": PropTypes.oneOf(["no", "yes"]),
|
|
365
|
+
"type": PropTypes.string.isRequired,
|
|
366
|
+
"typeof": PropTypes.string,
|
|
367
|
+
"unselectable": PropTypes.oneOf(["off", "on"]),
|
|
368
|
+
"value": PropTypes.string,
|
|
369
|
+
"vocab": PropTypes.string,
|
|
370
|
+
"width": PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
115
371
|
};
|
|
116
372
|
export default /*#__PURE__*/React.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;
|
|
@@ -16,20 +16,25 @@ const renderOpen = ({
|
|
|
16
16
|
"data-element": dataElement,
|
|
17
17
|
ref,
|
|
18
18
|
"aria-label": ariaLabel,
|
|
19
|
-
id
|
|
19
|
+
id,
|
|
20
|
+
"aria-expanded": ariaExpanded,
|
|
21
|
+
"aria-haspopup": ariaHasPopup
|
|
20
22
|
}) => /*#__PURE__*/React.createElement(PopoverContainerOpenIcon, {
|
|
21
23
|
tabIndex: tabIndex,
|
|
22
24
|
onAction: onClick,
|
|
23
25
|
"data-element": dataElement,
|
|
24
26
|
ref: ref,
|
|
25
27
|
"aria-label": ariaLabel,
|
|
26
|
-
"aria-haspopup":
|
|
28
|
+
"aria-haspopup": ariaHasPopup,
|
|
29
|
+
"aria-expanded": ariaExpanded,
|
|
27
30
|
id: id
|
|
28
31
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
29
32
|
type: "settings"
|
|
30
33
|
}));
|
|
31
34
|
|
|
32
35
|
renderOpen.propTypes = {
|
|
36
|
+
"aria-expanded": PropTypes.bool.isRequired,
|
|
37
|
+
"aria-haspopup": PropTypes.oneOf(["dialog"]).isRequired,
|
|
33
38
|
"aria-label": PropTypes.string,
|
|
34
39
|
"data-element": PropTypes.string.isRequired,
|
|
35
40
|
"id": PropTypes.string,
|
|
@@ -122,6 +127,8 @@ const PopoverContainer = ({
|
|
|
122
127
|
|
|
123
128
|
const renderOpenComponentProps = {
|
|
124
129
|
tabIndex: isOpen ? -1 : 0,
|
|
130
|
+
"aria-expanded": isOpen,
|
|
131
|
+
"aria-haspopup": "dialog",
|
|
125
132
|
isOpen,
|
|
126
133
|
"data-element": "popover-container-open-component",
|
|
127
134
|
onClick: handleOpenButtonClick,
|
|
@@ -145,8 +152,6 @@ const PopoverContainer = ({
|
|
|
145
152
|
const handleClick = useClickAwayListener(handleClickAway, "mousedown");
|
|
146
153
|
return /*#__PURE__*/React.createElement(PopoverContainerWrapperStyle, {
|
|
147
154
|
"data-component": "popover-container",
|
|
148
|
-
role: "region",
|
|
149
|
-
"aria-labelledby": popoverContainerId,
|
|
150
155
|
onMouseDown: handleClick
|
|
151
156
|
}, renderOpenComponent(renderOpenComponentProps), /*#__PURE__*/React.createElement(Transition, {
|
|
152
157
|
in: isOpen,
|
|
@@ -208,7 +208,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
208
208
|
wrapText: wrapPillText
|
|
209
209
|
}, pillProps), title));
|
|
210
210
|
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
211
|
-
}, [children, disabled, readOnly,
|
|
211
|
+
}, [children, disabled, readOnly, actualValue]);
|
|
212
212
|
useEffect(() => {
|
|
213
213
|
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";
|
|
214
214
|
const onChangeMissingMessage = "onChange prop required when using a controlled input element";
|
|
@@ -61,6 +61,24 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
61
61
|
blockScroll,
|
|
62
62
|
allowScroll
|
|
63
63
|
} = useScrollBlock();
|
|
64
|
+
|
|
65
|
+
const updateListHeight = () => {
|
|
66
|
+
let newHeight = listRef.current.clientHeight;
|
|
67
|
+
|
|
68
|
+
if (listActionButtonRef.current) {
|
|
69
|
+
newHeight += listActionButtonRef.current.parentElement.clientHeight;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
setListHeight(`${newHeight}px`);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const listCallbackRef = useCallback(element => {
|
|
76
|
+
listRef.current = element;
|
|
77
|
+
|
|
78
|
+
if (element) {
|
|
79
|
+
setTimeout(updateListHeight, 0);
|
|
80
|
+
}
|
|
81
|
+
}, []);
|
|
64
82
|
useEffect(() => {
|
|
65
83
|
blockScroll();
|
|
66
84
|
return () => {
|
|
@@ -225,16 +243,7 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
225
243
|
window.removeEventListener("resize", assignListWidth);
|
|
226
244
|
};
|
|
227
245
|
}, [assignListWidth]);
|
|
228
|
-
useLayoutEffect(
|
|
229
|
-
let newHeight;
|
|
230
|
-
newHeight = listRef.current.clientHeight;
|
|
231
|
-
|
|
232
|
-
if (listActionButtonRef.current) {
|
|
233
|
-
newHeight += listActionButtonRef.current.parentElement.clientHeight;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
setListHeight(`${newHeight}px`);
|
|
237
|
-
}, [children]);
|
|
246
|
+
useLayoutEffect(updateListHeight, [children]);
|
|
238
247
|
useEffect(() => {
|
|
239
248
|
const keyboardEvent = "keydown";
|
|
240
249
|
const listElement = listRef.current;
|
|
@@ -325,7 +334,7 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
|
|
|
325
334
|
"aria-labelledby": labelId,
|
|
326
335
|
"data-element": "select-list",
|
|
327
336
|
role: "listbox",
|
|
328
|
-
ref:
|
|
337
|
+
ref: listCallbackRef,
|
|
329
338
|
tabIndex: "-1",
|
|
330
339
|
isLoading: isLoading,
|
|
331
340
|
multiColumn: multiColumn
|