@cloudscape-design/components 3.0.113 → 3.0.114
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/input/index.d.ts.map +1 -1
- package/input/index.js +2 -2
- package/input/index.js.map +1 -1
- package/input/interfaces.d.ts +14 -1
- package/input/interfaces.d.ts.map +1 -1
- package/input/interfaces.js.map +1 -1
- package/input/internal.d.ts.map +1 -1
- package/input/internal.js +3 -3
- package/input/internal.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/s3-resource-selector/index.d.ts.map +1 -1
- package/s3-resource-selector/index.js +4 -2
- package/s3-resource-selector/index.js.map +1 -1
- package/s3-resource-selector/interfaces.d.ts +25 -0
- package/s3-resource-selector/interfaces.d.ts.map +1 -1
- package/s3-resource-selector/interfaces.js.map +1 -1
- package/select/parts/filter.d.ts +1 -1
- package/select/parts/filter.d.ts.map +1 -1
- package/textarea/index.d.ts.map +1 -1
- package/textarea/index.js +3 -2
- package/textarea/index.js.map +1 -1
- package/textarea/interfaces.d.ts +5 -2
- package/textarea/interfaces.d.ts.map +1 -1
- package/textarea/interfaces.js.map +1 -1
package/input/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/input/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,QAAA,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/input/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,QAAA,MAAM,KAAK,mFAmFV,CAAC;AAGF,eAAe,KAAK,CAAC"}
|
package/input/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import styles from './styles.css.js';
|
|
|
9
9
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
10
10
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
11
11
|
var Input = React.forwardRef(function (_a, ref) {
|
|
12
|
-
var value = _a.value, _b = _a.type, type = _b === void 0 ? 'text' : _b, step = _a.step, inputMode = _a.inputMode, _c = _a.autoComplete, autoComplete = _c === void 0 ? true : _c, disabled = _a.disabled, readOnly = _a.readOnly, disableBrowserAutocorrect = _a.disableBrowserAutocorrect, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, ariaRequired = _a.ariaRequired, name = _a.name, placeholder = _a.placeholder, autoFocus = _a.autoFocus, ariaLabel = _a.ariaLabel, ariaLabelledby = _a.ariaLabelledby, ariaDescribedby = _a.ariaDescribedby, invalid = _a.invalid, controlId = _a.controlId, rest = __rest(_a, ["value", "type", "step", "inputMode", "autoComplete", "disabled", "readOnly", "disableBrowserAutocorrect", "onKeyDown", "onKeyUp", "onChange", "onBlur", "onFocus", "ariaRequired", "name", "placeholder", "autoFocus", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "invalid", "controlId"]);
|
|
12
|
+
var value = _a.value, _b = _a.type, type = _b === void 0 ? 'text' : _b, step = _a.step, inputMode = _a.inputMode, _c = _a.autoComplete, autoComplete = _c === void 0 ? true : _c, spellcheck = _a.spellcheck, disabled = _a.disabled, readOnly = _a.readOnly, disableBrowserAutocorrect = _a.disableBrowserAutocorrect, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, ariaRequired = _a.ariaRequired, name = _a.name, placeholder = _a.placeholder, autoFocus = _a.autoFocus, ariaLabel = _a.ariaLabel, ariaLabelledby = _a.ariaLabelledby, ariaDescribedby = _a.ariaDescribedby, invalid = _a.invalid, controlId = _a.controlId, rest = __rest(_a, ["value", "type", "step", "inputMode", "autoComplete", "spellcheck", "disabled", "readOnly", "disableBrowserAutocorrect", "onKeyDown", "onKeyUp", "onChange", "onBlur", "onFocus", "ariaRequired", "name", "placeholder", "autoFocus", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "invalid", "controlId"]);
|
|
13
13
|
var baseComponentProps = useBaseComponent('Input');
|
|
14
14
|
var baseProps = getBaseProps(rest);
|
|
15
15
|
var inputRef = useRef(null);
|
|
@@ -27,7 +27,7 @@ var Input = React.forwardRef(function (_a, ref) {
|
|
|
27
27
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
28
28
|
}
|
|
29
29
|
}); }, [inputRef]);
|
|
30
|
-
return (React.createElement(InternalInput, __assign({ ref: inputRef }, __assign(__assign(__assign({}, baseProps), baseComponentProps), { autoComplete: autoComplete, ariaLabel: ariaLabel, ariaRequired: ariaRequired, autoFocus: autoFocus, disabled: disabled, disableBrowserAutocorrect: disableBrowserAutocorrect, name: name, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onChange: onChange, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, readOnly: readOnly, type: type, step: step, inputMode: inputMode, value: value, ariaDescribedby: ariaDescribedby, ariaLabelledby: ariaLabelledby, invalid: invalid, controlId: controlId }), { className: clsx(styles.root, baseProps.className), __inheritFormFieldProps: true })));
|
|
30
|
+
return (React.createElement(InternalInput, __assign({ ref: inputRef }, __assign(__assign(__assign({}, baseProps), baseComponentProps), { autoComplete: autoComplete, ariaLabel: ariaLabel, ariaRequired: ariaRequired, autoFocus: autoFocus, disabled: disabled, disableBrowserAutocorrect: disableBrowserAutocorrect, name: name, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onChange: onChange, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, readOnly: readOnly, type: type, step: step, inputMode: inputMode, spellcheck: spellcheck, value: value, ariaDescribedby: ariaDescribedby, ariaLabelledby: ariaLabelledby, invalid: invalid, controlId: controlId }), { className: clsx(styles.root, baseProps.className), __inheritFormFieldProps: true })));
|
|
31
31
|
});
|
|
32
32
|
applyDisplayName(Input, 'Input');
|
|
33
33
|
export default Input;
|
package/input/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/input/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,aAAa,MAAM,YAAY,CAAC;AAEvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,IAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,UACE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/input/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,aAAa,MAAM,YAAY,CAAC;AAEvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAIpE,IAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,UACE,EAyBa,EACb,GAAwB;IAzBtB,IAAA,K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,EACJ,SAAS,WAAA,EACT,OAAO,SAAA,EACP,QAAQ,UAAA,EACR,MAAM,QAAA,EACN,OAAO,SAAA,EACP,WAAW,aAAA,EACX,QAAQ,UAAA,EACR,IAAI,MAAA,EACJ,IAAI,MAAA,EACJ,SAAS,WAAA,EACT,UAAU,YAAA,EACV,KAAK,OAAA,EACL,eAAe,iBAAA,EACf,cAAc,gBAAA,EACd,OAAO,SAAA,EACP,SAAS,WAAA,OAEX,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EACjD,uBAAuB,EAAE,IAAI,IAC7B,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACjC,eAAe,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalInput from './internal';\nimport { InputProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { InputProps };\n\nconst Input = React.forwardRef(\n (\n {\n value,\n type = 'text',\n step,\n inputMode,\n autoComplete = true,\n spellcheck,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n onKeyDown,\n onKeyUp,\n onChange,\n onBlur,\n onFocus,\n ariaRequired,\n name,\n placeholder,\n autoFocus,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n invalid,\n controlId,\n ...rest\n }: InputProps,\n ref: Ref<InputProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Input');\n const baseProps = getBaseProps(rest);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n focus(...args: Parameters<HTMLElement['focus']>) {\n inputRef.current?.focus(...args);\n },\n select() {\n inputRef.current?.select();\n },\n }),\n [inputRef]\n );\n\n return (\n <InternalInput\n ref={inputRef}\n {...{\n ...baseProps,\n ...baseComponentProps,\n autoComplete,\n ariaLabel,\n ariaRequired,\n autoFocus,\n disabled,\n disableBrowserAutocorrect,\n name,\n onKeyDown,\n onKeyUp,\n onChange,\n onBlur,\n onFocus,\n placeholder,\n readOnly,\n type,\n step,\n inputMode,\n spellcheck,\n value,\n ariaDescribedby,\n ariaLabelledby,\n invalid,\n controlId,\n }}\n className={clsx(styles.root, baseProps.className)}\n __inheritFormFieldProps={true}\n />\n );\n }\n);\n\napplyDisplayName(Input, 'Input');\nexport default Input;\n"]}
|
package/input/interfaces.d.ts
CHANGED
|
@@ -82,6 +82,19 @@ export interface InputAutoComplete {
|
|
|
82
82
|
*/
|
|
83
83
|
autoComplete?: boolean | string;
|
|
84
84
|
}
|
|
85
|
+
export interface InputSpellcheck {
|
|
86
|
+
/**
|
|
87
|
+
* Specifies the value of the `spellcheck` attribute on the native control.
|
|
88
|
+
* This value controls the native browser capability to check for spelling/grammar errors.
|
|
89
|
+
* If not set, the browser default behavior is to perform spellchecking.
|
|
90
|
+
* For more details, check the [spellcheck MDN article](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck).
|
|
91
|
+
*
|
|
92
|
+
* Enhanced spellchecking features of your browser and/or operating system may send input values to external parties.
|
|
93
|
+
* Make sure it’s deactivated for fields with sensitive information to prevent
|
|
94
|
+
* inadvertently sending data (such as user passwords) to third parties.
|
|
95
|
+
*/
|
|
96
|
+
spellcheck?: boolean;
|
|
97
|
+
}
|
|
85
98
|
export interface InputKeyEvents {
|
|
86
99
|
/**
|
|
87
100
|
* Called when the underlying native textarea emits a `keydown` event.
|
|
@@ -96,7 +109,7 @@ export interface InputKeyEvents {
|
|
|
96
109
|
*/
|
|
97
110
|
onKeyUp?: CancelableEventHandler<InputProps.KeyDetail>;
|
|
98
111
|
}
|
|
99
|
-
export interface InputProps extends BaseComponentProps, BaseInputProps, InputKeyEvents, InputAutoCorrect, InputAutoComplete, FormFieldValidationControlProps {
|
|
112
|
+
export interface InputProps extends BaseComponentProps, BaseInputProps, InputKeyEvents, InputAutoCorrect, InputAutoComplete, InputSpellcheck, FormFieldValidationControlProps {
|
|
100
113
|
/**
|
|
101
114
|
* Specifies the type of control to render.
|
|
102
115
|
* Inputs with a `number` type use the native element behavior, which might
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/input/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AAEzF,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAEzC;;OAEG;IACH,OAAO,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAE1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,gBAAgB;I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|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/input/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseKeyDetail, CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\n\nexport interface BaseInputProps {\n /**\n * Specifies the text entered into the form element.\n */\n value: string;\n\n /**\n * Specifies the name of the control used in HTML forms.\n */\n name?: string;\n\n /**\n * Specifies the placeholder text rendered when the value is an empty string.\n */\n placeholder?: string;\n\n /**\n * Specifies if the control is disabled, which prevents the\n * user from modifying the value and prevents the value from\n * being included in a form submission. A disabled control can't\n * receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies if the control is read only, which prevents the\n * user from modifying the value but includes it in a form\n * submission. A read-only control can receive focus.\n *\n * Don't use read-only inputs outside a form.\n */\n readOnly?: boolean;\n\n /**\n * Indicates whether the control should be focused as\n * soon as the page loads, which enables the user to\n * start typing without having to manually focus the control. Don't\n * use this option on pages where the control may be\n * scrolled out of the viewport.\n */\n autoFocus?: boolean;\n\n /**\n * Adds an `aria-label` to the native control.\n *\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n\n /**\n * Specifies whether to add `aria-required` to the native control.\n */\n ariaRequired?: boolean;\n\n /**\n * Called when input focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * Called when input focus is moved to the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Called whenever a user changes the input value (by typing or pasting).\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<InputProps.ChangeDetail>;\n}\n\nexport interface InputAutoCorrect {\n /**\n * Specifies whether to disable browser autocorrect and related features.\n * If you set this to `true`, it disables any native browser capabilities\n * that automatically correct user input, such as `autocorrect` and\n * `autocapitalize`. If you don't set it, the behavior follows the default behavior\n * of the user's browser.\n */\n disableBrowserAutocorrect?: boolean;\n}\n\nexport interface InputAutoComplete {\n /**\n * Specifies whether to enable a browser's autocomplete functionality for this input.\n * In some cases it might be appropriate to disable autocomplete (for example, for security-sensitive fields).\n * To use it correctly, set the `name` property.\n *\n * You can either provide a boolean value to set the property to \"on\" or \"off\", or specify a string value\n * for the [autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) attribute.\n */\n autoComplete?: boolean | string;\n}\nexport interface InputKeyEvents {\n /**\n * Called when the underlying native textarea emits a `keydown` event.\n * The event `detail` contains the `keyCode` and information\n * about modifiers (that is, CTRL, ALT, SHIFT, META, etc.).\n */\n onKeyDown?: CancelableEventHandler<InputProps.KeyDetail>;\n\n /**\n * Called when the underlying native textarea emits a `keyup` event.\n * The event `detail` contains the `keyCode` and information\n * about modifiers (that is, CTRL, ALT, SHIFT, META, etc.).\n */\n onKeyUp?: CancelableEventHandler<InputProps.KeyDetail>;\n}\n\nexport interface InputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n FormFieldValidationControlProps {\n /**\n * Specifies the type of control to render.\n * Inputs with a `number` type use the native element behavior, which might\n * be slightly different across browsers.\n */\n type?: InputProps.Type;\n\n /**\n * Adds a hint to the browser about the type of data a user may enter into this field.\n * Some devices may render a different virtual keyboard depending on this value.\n * This value may not be supported by all browsers or devices.\n */\n inputMode?: InputProps.InputMode;\n\n /**\n * The step attribute is a number that specifies the granularity that the value\n * must adhere to or the keyword \"any\". It is valid for the numeric input types,\n * including the date, month, week, time, datetime-local, number and range types.\n */\n step?: InputProps.Step;\n}\n\nexport namespace InputProps {\n export type Type = 'text' | 'password' | 'search' | 'number' | 'email' | 'url';\n export type InputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n export type Step = number | 'any';\n\n export type ChangeDetail = BaseChangeDetail;\n export type KeyDetail = BaseKeyDetail;\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n}\nexport interface BaseChangeDetail {\n value: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/input/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseKeyDetail, CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\n\nexport interface BaseInputProps {\n /**\n * Specifies the text entered into the form element.\n */\n value: string;\n\n /**\n * Specifies the name of the control used in HTML forms.\n */\n name?: string;\n\n /**\n * Specifies the placeholder text rendered when the value is an empty string.\n */\n placeholder?: string;\n\n /**\n * Specifies if the control is disabled, which prevents the\n * user from modifying the value and prevents the value from\n * being included in a form submission. A disabled control can't\n * receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies if the control is read only, which prevents the\n * user from modifying the value but includes it in a form\n * submission. A read-only control can receive focus.\n *\n * Don't use read-only inputs outside a form.\n */\n readOnly?: boolean;\n\n /**\n * Indicates whether the control should be focused as\n * soon as the page loads, which enables the user to\n * start typing without having to manually focus the control. Don't\n * use this option on pages where the control may be\n * scrolled out of the viewport.\n */\n autoFocus?: boolean;\n\n /**\n * Adds an `aria-label` to the native control.\n *\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n\n /**\n * Specifies whether to add `aria-required` to the native control.\n */\n ariaRequired?: boolean;\n\n /**\n * Called when input focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * Called when input focus is moved to the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Called whenever a user changes the input value (by typing or pasting).\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<InputProps.ChangeDetail>;\n}\n\nexport interface InputAutoCorrect {\n /**\n * Specifies whether to disable browser autocorrect and related features.\n * If you set this to `true`, it disables any native browser capabilities\n * that automatically correct user input, such as `autocorrect` and\n * `autocapitalize`. If you don't set it, the behavior follows the default behavior\n * of the user's browser.\n */\n disableBrowserAutocorrect?: boolean;\n}\n\nexport interface InputAutoComplete {\n /**\n * Specifies whether to enable a browser's autocomplete functionality for this input.\n * In some cases it might be appropriate to disable autocomplete (for example, for security-sensitive fields).\n * To use it correctly, set the `name` property.\n *\n * You can either provide a boolean value to set the property to \"on\" or \"off\", or specify a string value\n * for the [autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) attribute.\n */\n autoComplete?: boolean | string;\n}\n\nexport interface InputSpellcheck {\n /**\n * Specifies the value of the `spellcheck` attribute on the native control.\n * This value controls the native browser capability to check for spelling/grammar errors.\n * If not set, the browser default behavior is to perform spellchecking.\n * For more details, check the [spellcheck MDN article](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck).\n *\n * Enhanced spellchecking features of your browser and/or operating system may send input values to external parties.\n * Make sure it’s deactivated for fields with sensitive information to prevent\n * inadvertently sending data (such as user passwords) to third parties.\n */\n spellcheck?: boolean;\n}\n\nexport interface InputKeyEvents {\n /**\n * Called when the underlying native textarea emits a `keydown` event.\n * The event `detail` contains the `keyCode` and information\n * about modifiers (that is, CTRL, ALT, SHIFT, META, etc.).\n */\n onKeyDown?: CancelableEventHandler<InputProps.KeyDetail>;\n\n /**\n * Called when the underlying native textarea emits a `keyup` event.\n * The event `detail` contains the `keyCode` and information\n * about modifiers (that is, CTRL, ALT, SHIFT, META, etc.).\n */\n onKeyUp?: CancelableEventHandler<InputProps.KeyDetail>;\n}\n\nexport interface InputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n InputSpellcheck,\n FormFieldValidationControlProps {\n /**\n * Specifies the type of control to render.\n * Inputs with a `number` type use the native element behavior, which might\n * be slightly different across browsers.\n */\n type?: InputProps.Type;\n\n /**\n * Adds a hint to the browser about the type of data a user may enter into this field.\n * Some devices may render a different virtual keyboard depending on this value.\n * This value may not be supported by all browsers or devices.\n */\n inputMode?: InputProps.InputMode;\n\n /**\n * The step attribute is a number that specifies the granularity that the value\n * must adhere to or the keyword \"any\". It is valid for the numeric input types,\n * including the date, month, week, time, datetime-local, number and range types.\n */\n step?: InputProps.Step;\n}\n\nexport namespace InputProps {\n export type Type = 'text' | 'password' | 'search' | 'number' | 'email' | 'url';\n export type InputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n export type Step = number | 'any';\n\n export type ChangeDetail = BaseChangeDetail;\n export type KeyDetail = BaseKeyDetail;\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n}\nexport interface BaseChangeDetail {\n value: string;\n}\n"]}
|
package/input/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/input/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAA6C,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC1G,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAgB,MAAM,4BAA4B,CAAC;AAG9E,OAAO,EAAE,+BAA+B,EAAuB,MAAM,wCAAwC,CAAC;AAC9G,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,MAAM,WAAW,kBACf,SAAQ,kBAAkB,EACxB,cAAc,EACd,IAAI,CAAC,UAAU,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sCAAsC,CAAC;AAElF,MAAM,WAAW,kBACf,SAAQ,kBAAkB,EACxB,cAAc,EACd,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EACxB,gBAAgB,EAChB,+BAA+B,EAC/B,0BAA0B;IAC5B,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC;IAC3C,UAAU,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/B,iBAAiB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE/B,WAAW,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1C,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAEhC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,gBAAgB,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;IAC/D,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;QAAE,aAAa,EAAE,IAAI,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAE/E,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;;AAwJD,wBAA+C"}
|
package/input/internal.js
CHANGED
|
@@ -18,7 +18,7 @@ var iconClassName = function (position, hasHandler) {
|
|
|
18
18
|
var preventMouseDown = function (e) { return e.preventDefault(); };
|
|
19
19
|
function InternalInput(_a, ref) {
|
|
20
20
|
var _b;
|
|
21
|
-
var _c = _a.type, type = _c === void 0 ? 'text' : _c, step = _a.step, inputMode = _a.inputMode, _d = _a.autoComplete, autoComplete = _d === void 0 ? true : _d, ariaLabel = _a.ariaLabel, name = _a.name, value = _a.value, placeholder = _a.placeholder, autoFocus = _a.autoFocus, disabled = _a.disabled, readOnly = _a.readOnly, disableBrowserAutocorrect = _a.disableBrowserAutocorrect, __noBorderRadius = _a.__noBorderRadius, __leftIcon = _a.__leftIcon, _e = _a.__leftIconVariant, __leftIconVariant = _e === void 0 ? 'subtle' : _e, __onLeftIconClick = _a.__onLeftIconClick, ariaRequired = _a.ariaRequired, __rightIcon = _a.__rightIcon, _f = _a.__rightIconVariant, __rightIconVariant = _f === void 0 ? 'normal' : _f, __onRightIconClick = _a.__onRightIconClick, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, onChange = _a.onChange, __onDelayedInput = _a.__onDelayedInput, __onBlurWithDetail = _a.__onBlurWithDetail, onBlur = _a.onBlur, onFocus = _a.onFocus, __nativeAttributes = _a.__nativeAttributes, __internalRootRef = _a.__internalRootRef, __inheritFormFieldProps = _a.__inheritFormFieldProps, rest = __rest(_a, ["type", "step", "inputMode", "autoComplete", "ariaLabel", "name", "value", "placeholder", "autoFocus", "disabled", "readOnly", "disableBrowserAutocorrect", "__noBorderRadius", "__leftIcon", "__leftIconVariant", "__onLeftIconClick", "ariaRequired", "__rightIcon", "__rightIconVariant", "__onRightIconClick", "onKeyDown", "onKeyUp", "onChange", "__onDelayedInput", "__onBlurWithDetail", "onBlur", "onFocus", "__nativeAttributes", "__internalRootRef", "__inheritFormFieldProps"]);
|
|
21
|
+
var _c = _a.type, type = _c === void 0 ? 'text' : _c, step = _a.step, inputMode = _a.inputMode, _d = _a.autoComplete, autoComplete = _d === void 0 ? true : _d, ariaLabel = _a.ariaLabel, name = _a.name, value = _a.value, placeholder = _a.placeholder, autoFocus = _a.autoFocus, disabled = _a.disabled, readOnly = _a.readOnly, disableBrowserAutocorrect = _a.disableBrowserAutocorrect, spellcheck = _a.spellcheck, __noBorderRadius = _a.__noBorderRadius, __leftIcon = _a.__leftIcon, _e = _a.__leftIconVariant, __leftIconVariant = _e === void 0 ? 'subtle' : _e, __onLeftIconClick = _a.__onLeftIconClick, ariaRequired = _a.ariaRequired, __rightIcon = _a.__rightIcon, _f = _a.__rightIconVariant, __rightIconVariant = _f === void 0 ? 'normal' : _f, __onRightIconClick = _a.__onRightIconClick, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, onChange = _a.onChange, __onDelayedInput = _a.__onDelayedInput, __onBlurWithDetail = _a.__onBlurWithDetail, onBlur = _a.onBlur, onFocus = _a.onFocus, __nativeAttributes = _a.__nativeAttributes, __internalRootRef = _a.__internalRootRef, __inheritFormFieldProps = _a.__inheritFormFieldProps, rest = __rest(_a, ["type", "step", "inputMode", "autoComplete", "ariaLabel", "name", "value", "placeholder", "autoFocus", "disabled", "readOnly", "disableBrowserAutocorrect", "spellcheck", "__noBorderRadius", "__leftIcon", "__leftIconVariant", "__onLeftIconClick", "ariaRequired", "__rightIcon", "__rightIconVariant", "__onRightIconClick", "onKeyDown", "onKeyUp", "onChange", "__onDelayedInput", "__onBlurWithDetail", "onBlur", "onFocus", "__nativeAttributes", "__internalRootRef", "__inheritFormFieldProps"]);
|
|
22
22
|
var baseProps = getBaseProps(rest);
|
|
23
23
|
var fireDelayedInput = useDebounceCallback(function (value) { return fireNonCancelableEvent(__onDelayedInput, { value: value }); });
|
|
24
24
|
var handleChange = function (value) {
|
|
@@ -35,7 +35,7 @@ function InternalInput(_a, ref) {
|
|
|
35
35
|
var attributes = __assign({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, name: name, placeholder: placeholder, autoFocus: autoFocus, id: controlId, className: clsx(styles.input, type && styles["input-type-".concat(type)], __rightIcon && styles['input-has-icon-right'], __leftIcon && styles['input-has-icon-left'], __noBorderRadius && styles['input-has-no-border-radius'], (_b = {},
|
|
36
36
|
_b[styles['input-readonly']] = readOnly,
|
|
37
37
|
_b[styles['input-invalid']] = invalid,
|
|
38
|
-
_b)), autoComplete: convertAutoComplete(autoComplete), disabled: disabled, readOnly: readOnly, type: type, step: step, inputMode: inputMode, onKeyDown: onKeyDown && (function (event) { return fireKeyboardEvent(onKeyDown, event); }), onKeyUp: onKeyUp && (function (event) { return fireKeyboardEvent(onKeyUp, event); }),
|
|
38
|
+
_b)), autoComplete: convertAutoComplete(autoComplete), disabled: disabled, readOnly: readOnly, type: type, step: step, inputMode: inputMode, spellCheck: spellcheck, onKeyDown: onKeyDown && (function (event) { return fireKeyboardEvent(onKeyDown, event); }), onKeyUp: onKeyUp && (function (event) { return fireKeyboardEvent(onKeyUp, event); }),
|
|
39
39
|
// We set a default value on the component in order to force it into the controlled mode.
|
|
40
40
|
value: value !== null && value !== void 0 ? value : '', onChange: onChange && (function (event) { return handleChange(event.target.value); }), onBlur: function (e) {
|
|
41
41
|
onBlur && fireNonCancelableEvent(onBlur);
|
|
@@ -67,7 +67,7 @@ function InternalInput(_a, ref) {
|
|
|
67
67
|
return (React.createElement("div", __assign({}, baseProps, { className: clsx(baseProps.className, styles['input-container']), ref: __internalRootRef }),
|
|
68
68
|
__leftIcon && (React.createElement("span", { onClick: __onLeftIconClick, className: iconClassName('left', !!__onLeftIconClick) },
|
|
69
69
|
React.createElement(InternalIcon, { name: __leftIcon, variant: disabled ? 'disabled' : __leftIconVariant }))),
|
|
70
|
-
React.createElement("input", __assign({ ref: mergedRef }, attributes
|
|
70
|
+
React.createElement("input", __assign({ ref: mergedRef }, attributes)),
|
|
71
71
|
__rightIcon && (React.createElement("span", { onClick: __onRightIconClick, onMouseDown: preventMouseDown, className: iconClassName('right', !!__onRightIconClick) },
|
|
72
72
|
React.createElement(InternalIcon, { name: __rightIcon, variant: disabled ? 'disabled' : __rightIconVariant })))));
|
|
73
73
|
}
|
package/input/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAA0B,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YA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E,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,GAAI,CACjF,CACR;QACD,wCAAO,GAAG,EAAE,SAAS,IAAM,UAAU,IAAE,UAAU,EAAE,KAAK,IAAI;QAC3D,WAAW,IAAI,CACd,8BACE,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,gBAAgB,EAC7B,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,kBAAkB,CAAC;YAEvD,oBAAC,YAAY,IAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,GAAI,CACnF,CACR,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MouseEventHandler, Ref, useRef } from 'react';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport styles from './styles.css.js';\nimport { fireNonCancelableEvent, fireKeyboardEvent, NonCancelableEventHandler } from '../internal/events';\nimport { InputProps, BaseInputProps, InputAutoCorrect, BaseChangeDetail } from './interfaces';\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport { useSearchProps, convertAutoComplete } from './utils';\nimport { useDebounceCallback } from '../internal/hooks/use-debounce-callback';\nimport { FormFieldValidationControlProps, useFormFieldContext } from '../internal/context/form-field-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface InternalInputProps\n extends BaseComponentProps,\n BaseInputProps,\n Omit<InputProps, 'type'>,\n InputAutoCorrect,\n FormFieldValidationControlProps,\n InternalBaseComponentProps {\n type?: InputProps['type'] | 'visualSearch';\n __leftIcon?: IconProps['name'];\n __leftIconVariant?: IconProps['variant'];\n __onLeftIconClick?: () => void;\n\n __rightIcon?: IconProps['name'];\n __rightIconVariant?: IconProps['variant'];\n __onRightIconClick?: () => void;\n\n __nativeAttributes?: Record<string, any>;\n __noBorderRadius?: boolean;\n\n __onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n __onBlurWithDetail?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n\n __inheritFormFieldProps?: boolean;\n}\n\nconst iconClassName = (position: string, hasHandler: boolean) =>\n clsx(styles['input-icon'], styles[`input-icon-${position}`], { [styles['input-icon-hoverable']]: hasHandler });\nconst preventMouseDown: MouseEventHandler = e => e.preventDefault();\n\nfunction InternalInput(\n {\n type = 'text',\n step,\n inputMode,\n autoComplete = true,\n ariaLabel,\n name,\n value,\n placeholder,\n autoFocus,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n __noBorderRadius,\n\n __leftIcon,\n __leftIconVariant = 'subtle',\n __onLeftIconClick,\n\n ariaRequired,\n\n __rightIcon,\n __rightIconVariant = 'normal',\n __onRightIconClick,\n\n onKeyDown,\n onKeyUp,\n onChange,\n __onDelayedInput,\n __onBlurWithDetail,\n onBlur,\n onFocus,\n __nativeAttributes,\n __internalRootRef,\n __inheritFormFieldProps,\n ...rest\n }: InternalInputProps,\n ref: Ref<HTMLInputElement>\n) {\n const baseProps = getBaseProps(rest);\n const fireDelayedInput = useDebounceCallback((value: string) => fireNonCancelableEvent(__onDelayedInput, { value }));\n\n const handleChange = (value: string) => {\n fireDelayedInput(value);\n fireNonCancelableEvent(onChange, { value });\n };\n\n const inputRef = useRef<HTMLInputElement>(null);\n const searchProps = useSearchProps(type, disabled, readOnly, value, inputRef, handleChange);\n __leftIcon = __leftIcon ?? searchProps.__leftIcon;\n __rightIcon = __rightIcon ?? searchProps.__rightIcon;\n __onRightIconClick = __onRightIconClick ?? searchProps.__onRightIconClick;\n\n const formFieldContext = useFormFieldContext(rest);\n const { ariaLabelledby, ariaDescribedby, controlId, invalid } = __inheritFormFieldProps ? formFieldContext : rest;\n\n const attributes: React.InputHTMLAttributes<HTMLInputElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n name,\n placeholder,\n autoFocus,\n id: controlId,\n className: clsx(\n styles.input,\n type && styles[`input-type-${type}`],\n __rightIcon && styles['input-has-icon-right'],\n __leftIcon && styles['input-has-icon-left'],\n __noBorderRadius && styles['input-has-no-border-radius'],\n {\n [styles['input-readonly']]: readOnly,\n [styles['input-invalid']]: invalid,\n }\n ),\n autoComplete: convertAutoComplete(autoComplete),\n disabled,\n readOnly,\n type,\n step,\n inputMode,\n onKeyDown: onKeyDown && (event => fireKeyboardEvent(onKeyDown, event)),\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value ?? '',\n onChange: onChange && (event => handleChange(event.target.value)),\n onBlur: e => {\n onBlur && fireNonCancelableEvent(onBlur);\n __onBlurWithDetail && fireNonCancelableEvent(__onBlurWithDetail, { relatedTarget: e.relatedTarget });\n },\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n ...__nativeAttributes,\n };\n\n if (type === 'number') {\n // Chrome and Safari have a weird built-in behavior of letting focused\n // number inputs be controlled by scrolling on them. However, they don't\n // lock the browser's scroll, so it's very easy to accidentally increment\n // the input while scrolling down the page.\n attributes.onWheel = event => event.currentTarget.blur();\n }\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n // ensure aria properties are string literal \"true\"\n if (ariaRequired) {\n attributes['aria-required'] = 'true';\n }\n if (invalid) {\n attributes['aria-invalid'] = 'true';\n }\n\n const mergedRef = useMergeRefs(ref, inputRef);\n\n // type = \"visualSearch\" renders a type=\"text' input\n if (attributes.type === 'visualSearch') {\n attributes.type = 'text';\n }\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles['input-container'])} ref={__internalRootRef}>\n {__leftIcon && (\n <span onClick={__onLeftIconClick} className={iconClassName('left', !!__onLeftIconClick)}>\n <InternalIcon name={__leftIcon} variant={disabled ? 'disabled' : __leftIconVariant} />\n </span>\n )}\n <input ref={mergedRef} {...attributes} spellCheck={false} />\n {__rightIcon && (\n <span\n onClick={__onRightIconClick}\n onMouseDown={preventMouseDown}\n className={iconClassName('right', !!__onRightIconClick)}\n >\n <InternalIcon name={__rightIcon} variant={disabled ? 'disabled' : __rightIconVariant} />\n </span>\n )}\n </div>\n );\n}\n\nexport default React.forwardRef(InternalInput);\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAA0B,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAA6B,MAAM,oBAAoB,CAAC;AAE1G,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAmC,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AA4B9G,IAAM,aAAa,GAAG,UAAC,QAAgB,EAAE,UAAmB;;IAC1D,OAAA,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,qBAAc,QAAQ,CAAE,CAAC,YAAI,GAAC,MAAM,CAAC,sBAAsB,CAAC,IAAG,UAAU,MAAG;AAA9G,CAA8G,CAAC;AACjH,IAAM,gBAAgB,GA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AU,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC;KACtC;IACD,IAAI,OAAO,EAAE;QACX,UAAU,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;KACrC;IAED,IAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAE9C,oDAAoD;IACpD,IAAI,UAAU,CAAC,IAAI,KAAK,cAAc,EAAE;QACtC,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC;KAC1B;IAED,OAAO,CACL,wCAAS,SAAS,IAAE,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,GAAG,EAAE,iBAAiB;QACxG,UAAU,IAAI,CACb,8BAAM,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,iBAAiB,CAAC;YACrF,oBAAC,YAAY,IAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,GAAI,CACjF,CACR;QACD,wCAAO,GAAG,EAAE,SAAS,IAAM,UAAU,EAAI;QACxC,WAAW,IAAI,CACd,8BACE,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,gBAAgB,EAC7B,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,kBAAkB,CAAC;YAEvD,oBAAC,YAAY,IAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,GAAI,CACnF,CACR,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MouseEventHandler, Ref, useRef } from 'react';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport styles from './styles.css.js';\nimport { fireNonCancelableEvent, fireKeyboardEvent, NonCancelableEventHandler } from '../internal/events';\nimport { InputProps, BaseInputProps, InputAutoCorrect, BaseChangeDetail } from './interfaces';\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport { useSearchProps, convertAutoComplete } from './utils';\nimport { useDebounceCallback } from '../internal/hooks/use-debounce-callback';\nimport { FormFieldValidationControlProps, useFormFieldContext } from '../internal/context/form-field-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nexport interface InternalInputProps\n extends BaseComponentProps,\n BaseInputProps,\n Omit<InputProps, 'type'>,\n InputAutoCorrect,\n FormFieldValidationControlProps,\n InternalBaseComponentProps {\n type?: InputProps['type'] | 'visualSearch';\n __leftIcon?: IconProps['name'];\n __leftIconVariant?: IconProps['variant'];\n __onLeftIconClick?: () => void;\n\n __rightIcon?: IconProps['name'];\n __rightIconVariant?: IconProps['variant'];\n __onRightIconClick?: () => void;\n\n __nativeAttributes?: Record<string, any>;\n __noBorderRadius?: boolean;\n\n __onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n __onBlurWithDetail?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n\n __inheritFormFieldProps?: boolean;\n}\n\nconst iconClassName = (position: string, hasHandler: boolean) =>\n clsx(styles['input-icon'], styles[`input-icon-${position}`], { [styles['input-icon-hoverable']]: hasHandler });\nconst preventMouseDown: MouseEventHandler = e => e.preventDefault();\n\nfunction InternalInput(\n {\n type = 'text',\n step,\n inputMode,\n autoComplete = true,\n ariaLabel,\n name,\n value,\n placeholder,\n autoFocus,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n spellcheck,\n __noBorderRadius,\n\n __leftIcon,\n __leftIconVariant = 'subtle',\n __onLeftIconClick,\n\n ariaRequired,\n\n __rightIcon,\n __rightIconVariant = 'normal',\n __onRightIconClick,\n\n onKeyDown,\n onKeyUp,\n onChange,\n __onDelayedInput,\n __onBlurWithDetail,\n onBlur,\n onFocus,\n __nativeAttributes,\n __internalRootRef,\n __inheritFormFieldProps,\n ...rest\n }: InternalInputProps,\n ref: Ref<HTMLInputElement>\n) {\n const baseProps = getBaseProps(rest);\n const fireDelayedInput = useDebounceCallback((value: string) => fireNonCancelableEvent(__onDelayedInput, { value }));\n\n const handleChange = (value: string) => {\n fireDelayedInput(value);\n fireNonCancelableEvent(onChange, { value });\n };\n\n const inputRef = useRef<HTMLInputElement>(null);\n const searchProps = useSearchProps(type, disabled, readOnly, value, inputRef, handleChange);\n __leftIcon = __leftIcon ?? searchProps.__leftIcon;\n __rightIcon = __rightIcon ?? searchProps.__rightIcon;\n __onRightIconClick = __onRightIconClick ?? searchProps.__onRightIconClick;\n\n const formFieldContext = useFormFieldContext(rest);\n const { ariaLabelledby, ariaDescribedby, controlId, invalid } = __inheritFormFieldProps ? formFieldContext : rest;\n\n const attributes: React.InputHTMLAttributes<HTMLInputElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n name,\n placeholder,\n autoFocus,\n id: controlId,\n className: clsx(\n styles.input,\n type && styles[`input-type-${type}`],\n __rightIcon && styles['input-has-icon-right'],\n __leftIcon && styles['input-has-icon-left'],\n __noBorderRadius && styles['input-has-no-border-radius'],\n {\n [styles['input-readonly']]: readOnly,\n [styles['input-invalid']]: invalid,\n }\n ),\n autoComplete: convertAutoComplete(autoComplete),\n disabled,\n readOnly,\n type,\n step,\n inputMode,\n spellCheck: spellcheck,\n onKeyDown: onKeyDown && (event => fireKeyboardEvent(onKeyDown, event)),\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value ?? '',\n onChange: onChange && (event => handleChange(event.target.value)),\n onBlur: e => {\n onBlur && fireNonCancelableEvent(onBlur);\n __onBlurWithDetail && fireNonCancelableEvent(__onBlurWithDetail, { relatedTarget: e.relatedTarget });\n },\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n ...__nativeAttributes,\n };\n\n if (type === 'number') {\n // Chrome and Safari have a weird built-in behavior of letting focused\n // number inputs be controlled by scrolling on them. However, they don't\n // lock the browser's scroll, so it's very easy to accidentally increment\n // the input while scrolling down the page.\n attributes.onWheel = event => event.currentTarget.blur();\n }\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n // ensure aria properties are string literal \"true\"\n if (ariaRequired) {\n attributes['aria-required'] = 'true';\n }\n if (invalid) {\n attributes['aria-invalid'] = 'true';\n }\n\n const mergedRef = useMergeRefs(ref, inputRef);\n\n // type = \"visualSearch\" renders a type=\"text' input\n if (attributes.type === 'visualSearch') {\n attributes.type = 'text';\n }\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles['input-container'])} ref={__internalRootRef}>\n {__leftIcon && (\n <span onClick={__onLeftIconClick} className={iconClassName('left', !!__onLeftIconClick)}>\n <InternalIcon name={__leftIcon} variant={disabled ? 'disabled' : __leftIconVariant} />\n </span>\n )}\n <input ref={mergedRef} {...attributes} />\n {__rightIcon && (\n <span\n onClick={__onRightIconClick}\n onMouseDown={preventMouseDown}\n className={iconClassName('right', !!__onRightIconClick)}\n >\n <InternalIcon name={__rightIcon} variant={disabled ? 'disabled' : __rightIconVariant} />\n </span>\n )}\n </div>\n );\n}\n\nexport default React.forwardRef(InternalInput);\n"]}
|
package/internal/environment.js
CHANGED
package/internal/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/s3-resource-selector/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAO3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/s3-resource-selector/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAO3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAOvD,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,QAAA,MAAM,kBAAkB,6GA8FvB,CAAC;AAGF,eAAe,kBAAkB,CAAC"}
|
|
@@ -13,14 +13,16 @@ import { S3Modal } from './s3-modal';
|
|
|
13
13
|
import styles from './styles.css.js';
|
|
14
14
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
15
15
|
import { checkSafeUrl } from '../internal/utils/check-safe-url';
|
|
16
|
+
import { useFormFieldContext } from '../contexts/form-field';
|
|
16
17
|
var S3ResourceSelector = React.forwardRef(function (_a, ref) {
|
|
17
|
-
var i18nStrings = _a.i18nStrings, alert = _a.alert, resource = _a.resource, viewHref = _a.viewHref, invalid = _a.invalid, _b = _a.selectableItemsTypes, selectableItemsTypes = _b === void 0 ? [] : _b, inputAriaDescribedby = _a.inputAriaDescribedby, _c = _a.bucketsVisibleColumns, bucketsVisibleColumns = _c === void 0 ? ['Name', 'CreationDate'] : _c, bucketsIsItemDisabled = _a.bucketsIsItemDisabled, fetchBuckets = _a.fetchBuckets, fetchObjects = _a.fetchObjects, _d = _a.objectsVisibleColumns, objectsVisibleColumns = _d === void 0 ? ['Key', 'LastModified', 'Size'] : _d, objectsIsItemDisabled = _a.objectsIsItemDisabled, fetchVersions = _a.fetchVersions, _e = _a.versionsVisibleColumns, versionsVisibleColumns = _e === void 0 ? ['ID', 'LastModified', 'Size'] : _e, versionsIsItemDisabled = _a.versionsIsItemDisabled, onChange = _a.onChange, rest = __rest(_a, ["i18nStrings", "alert", "resource", "viewHref", "invalid", "selectableItemsTypes", "inputAriaDescribedby", "bucketsVisibleColumns", "bucketsIsItemDisabled", "fetchBuckets", "fetchObjects", "objectsVisibleColumns", "objectsIsItemDisabled", "fetchVersions", "versionsVisibleColumns", "versionsIsItemDisabled", "onChange"]);
|
|
18
|
+
var i18nStrings = _a.i18nStrings, alert = _a.alert, resource = _a.resource, viewHref = _a.viewHref, invalid = _a.invalid, _b = _a.selectableItemsTypes, selectableItemsTypes = _b === void 0 ? [] : _b, inputAriaDescribedby = _a.inputAriaDescribedby, _c = _a.bucketsVisibleColumns, bucketsVisibleColumns = _c === void 0 ? ['Name', 'CreationDate'] : _c, bucketsIsItemDisabled = _a.bucketsIsItemDisabled, fetchBuckets = _a.fetchBuckets, fetchObjects = _a.fetchObjects, _d = _a.objectsVisibleColumns, objectsVisibleColumns = _d === void 0 ? ['Key', 'LastModified', 'Size'] : _d, objectsIsItemDisabled = _a.objectsIsItemDisabled, fetchVersions = _a.fetchVersions, _e = _a.versionsVisibleColumns, versionsVisibleColumns = _e === void 0 ? ['ID', 'LastModified', 'Size'] : _e, versionsIsItemDisabled = _a.versionsIsItemDisabled, onChange = _a.onChange, ariaLabel = _a.ariaLabel, rest = __rest(_a, ["i18nStrings", "alert", "resource", "viewHref", "invalid", "selectableItemsTypes", "inputAriaDescribedby", "bucketsVisibleColumns", "bucketsIsItemDisabled", "fetchBuckets", "fetchObjects", "objectsVisibleColumns", "objectsIsItemDisabled", "fetchVersions", "versionsVisibleColumns", "versionsIsItemDisabled", "onChange", "ariaLabel"]);
|
|
18
19
|
checkSafeUrl('S3ResourceSelector', viewHref);
|
|
19
20
|
var __internalRootRef = useBaseComponent('S3ResourceSelector').__internalRootRef;
|
|
20
21
|
var _f = useState(false), modalOpen = _f[0], setModalOpen = _f[1];
|
|
21
22
|
var inContextRef = useRef(null);
|
|
22
23
|
var modalWasSubmitted = useRef(false);
|
|
23
24
|
useForwardFocus(ref, inContextRef);
|
|
25
|
+
var _g = useFormFieldContext(rest), ariaLabelledby = _g.ariaLabelledby, ariaDescribedby = _g.ariaDescribedby;
|
|
24
26
|
useEffect(function () {
|
|
25
27
|
var _a;
|
|
26
28
|
// Focus uriInput only when modal was submitted.
|
|
@@ -51,7 +53,7 @@ var S3ResourceSelector = React.forwardRef(function (_a, ref) {
|
|
|
51
53
|
},
|
|
52
54
|
onDismiss: function () { return setModalOpen(false); }
|
|
53
55
|
};
|
|
54
|
-
return (React.createElement("div", __assign({}, baseProps, { className: clsx(styles.root, baseProps.className), ref: __internalRootRef }),
|
|
56
|
+
return (React.createElement("div", __assign({}, baseProps, { className: clsx(styles.root, baseProps.className), ref: __internalRootRef, role: "group", "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-label": ariaLabel }),
|
|
55
57
|
React.createElement(S3InContext, { ref: inContextRef, selectableItemsTypes: selectableItemsTypes, i18nStrings: i18nStrings, resource: resource, viewHref: viewHref, invalid: invalid, inputAriaDescribedby: inputAriaDescribedby, fetchVersions: fetchVersions, onBrowse: function () { return setModalOpen(true); }, onChange: function (resource, errorText) { return fireNonCancelableEvent(onChange, { resource: resource, errorText: errorText }); } }),
|
|
56
58
|
!modalOpen && alert && (React.createElement(InternalBox, { className: styles.alert, margin: { top: 's' } }, alert)),
|
|
57
59
|
modalOpen && React.createElement(S3Modal, __assign({}, modalProps))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAk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KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IACvD,KAAK,CACM,CACf;QACA,SAAS,IAAI,oBAAC,OAAO,eAAK,UAAU,EAAI,CACrC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;AAC3D,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useState, useRef, useEffect } from 'react';\nimport InternalBox from '../box/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { S3InContext, S3InContextRef } from './s3-in-context';\nimport { S3ResourceSelectorProps } from './interfaces';\nimport { S3Modal, S3ModalProps } from './s3-modal';\nimport styles from './styles.css.js';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useFormFieldContext } from '../contexts/form-field';\n\nexport { S3ResourceSelectorProps };\n\nconst S3ResourceSelector = React.forwardRef(\n (\n {\n i18nStrings,\n alert,\n resource,\n viewHref,\n invalid,\n selectableItemsTypes = [],\n inputAriaDescribedby,\n bucketsVisibleColumns = ['Name', 'CreationDate'],\n bucketsIsItemDisabled,\n fetchBuckets,\n fetchObjects,\n objectsVisibleColumns = ['Key', 'LastModified', 'Size'],\n objectsIsItemDisabled,\n fetchVersions,\n versionsVisibleColumns = ['ID', 'LastModified', 'Size'],\n versionsIsItemDisabled,\n onChange,\n ariaLabel,\n ...rest\n }: S3ResourceSelectorProps,\n ref: React.Ref<S3ResourceSelectorProps.Ref>\n ) => {\n checkSafeUrl('S3ResourceSelector', viewHref);\n const { __internalRootRef } = useBaseComponent('S3ResourceSelector');\n const [modalOpen, setModalOpen] = useState(false);\n const inContextRef = useRef<S3InContextRef>(null);\n const modalWasSubmitted = useRef<boolean>(false);\n useForwardFocus(ref, inContextRef);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(rest);\n\n useEffect(() => {\n // Focus uriInput only when modal was submitted.\n // When it was dismissed, the focus naturally goes to previously focused element (browse button)\n if (!modalOpen && modalWasSubmitted.current) {\n modalWasSubmitted.current = false;\n inContextRef.current?.focus();\n }\n }, [modalOpen]);\n\n const baseProps = getBaseProps(rest);\n const modalProps: S3ModalProps = {\n alert,\n i18nStrings,\n fetchBuckets,\n selectableItemsTypes,\n bucketsVisibleColumns,\n bucketsIsItemDisabled,\n fetchObjects,\n objectsVisibleColumns,\n objectsIsItemDisabled,\n fetchVersions,\n versionsVisibleColumns,\n versionsIsItemDisabled,\n onSubmit: resource => {\n fireNonCancelableEvent(onChange, { resource });\n setModalOpen(false);\n modalWasSubmitted.current = true;\n },\n onDismiss: () => setModalOpen(false),\n };\n return (\n <div\n {...baseProps}\n className={clsx(styles.root, baseProps.className)}\n ref={__internalRootRef}\n role=\"group\"\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-label={ariaLabel}\n >\n <S3InContext\n ref={inContextRef}\n selectableItemsTypes={selectableItemsTypes}\n i18nStrings={i18nStrings}\n resource={resource}\n viewHref={viewHref}\n invalid={invalid}\n inputAriaDescribedby={inputAriaDescribedby}\n fetchVersions={fetchVersions}\n onBrowse={() => setModalOpen(true)}\n onChange={(resource, errorText) => fireNonCancelableEvent(onChange, { resource, errorText })}\n />\n {!modalOpen && alert && (\n <InternalBox className={styles.alert} margin={{ top: 's' }}>\n {alert}\n </InternalBox>\n )}\n {modalOpen && <S3Modal {...modalProps} />}\n </div>\n );\n }\n);\n\napplyDisplayName(S3ResourceSelector, 'S3ResourceSelector');\nexport default S3ResourceSelector;\n"]}
|
|
@@ -8,6 +8,31 @@ export interface S3ResourceSelectorProps extends BaseComponentProps {
|
|
|
8
8
|
* Specifies additional information about component status.
|
|
9
9
|
*/
|
|
10
10
|
alert?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Adds `aria-labelledby` to the component. If you're using this component within a form field,
|
|
13
|
+
* don't set this property because the form field component automatically sets it.
|
|
14
|
+
*
|
|
15
|
+
* Use this property if the component isn't surrounded by a form field, or you want to override the value
|
|
16
|
+
* automatically set by the form field (for example, if you have two components within a single form field).
|
|
17
|
+
*
|
|
18
|
+
* To use it correctly, define an ID for the element you want to use as label and set the property to that ID.
|
|
19
|
+
*/
|
|
20
|
+
ariaLabelledby?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Adds `aria-describedby` to the component. If you're using this component within a form field,
|
|
23
|
+
* don't set this property because the form field component automatically sets it.
|
|
24
|
+
*
|
|
25
|
+
* Use this property if the component isn't surrounded by a form field, or you want to override the value
|
|
26
|
+
* automatically set by the form field (for example, if you have two components within a single form field).
|
|
27
|
+
*
|
|
28
|
+
* To use it correctly, define an ID for each element that you want to use as a description
|
|
29
|
+
* and set the property to a string of each ID separated by spaces (for example, `"id1 id2 id3"`).
|
|
30
|
+
*/
|
|
31
|
+
ariaDescribedby?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Adds `aria-label` to the component.
|
|
34
|
+
*/
|
|
35
|
+
ariaLabel?: string;
|
|
11
36
|
/**
|
|
12
37
|
* Adds `aria-labelledby` to the S3 URI input. If you're using this component within a form field,
|
|
13
38
|
* you do not need to set this property, as the form field component will set it automatically.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EA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iB,CAAC,EAAE,MAAM,CAAC;QAE3B,uBAAuB,EAAE,MAAM,CAAC;QAChC,yBAAyB,EAAE,MAAM,CAAC;QAClC,8BAA8B,EAAE,MAAM,CAAC;QACvC,sBAAsB,EAAE,MAAM,CAAC;QAC/B,6BAA6B,EAAE,MAAM,CAAC;QAEtC,qBAAqB,EAAE,6BAA6B,CAAC;QACrD,oBAAoB,EAAE,6BAA6B,CAAC;QACpD,cAAc,EAAE,6BAA6B,CAAC;QAC9C,gBAAgB,EAAE,eAAe,CAAC,MAAM,CAAC;QACzC,sBAAsB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAChD,sBAAsB,EAAE,eAAe,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;QACxE,uBAAuB,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;QAClD,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;QAC9C,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,gBAAgB,EAAE,MAAM,CAAC;KAC1B;IAED,UAAiB,YAAY;QAC3B,QAAQ,EAAE,QAAQ,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { TableProps } from '../table/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\n\n /**\n * Adds `aria-labelledby` to the S3 URI input. If you're using this component within a form field,\n * you do not need to set this property, as the form field component will set it automatically.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n inputAriaDescribedby?: string;\n\n /**\n * An array of the item types that are selectable in the table view. The array may contain the following items:\n * 'buckets', 'objects', or 'versions'. Example: ['buckets', 'objects']. By default, no items are selectable.\n * This property determines whether the component operates in Read mode or Write mode:\n * * Read mode - When 'objects' and 'versions' values are provided (folder selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n * * Write mode - When 'buckets' and 'objects' values are provided (file selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n */\n selectableItemsTypes?: ReadonlyArray<S3ResourceSelectorProps.SelectableItems>;\n\n /**\n * Href of the selected object that is applied to the View button.\n */\n viewHref?: string;\n\n /**\n * Whether the S3 URI input field is in invalid state.\n */\n invalid?: boolean;\n\n /**\n * Optionally overrides the set of visible columns in the Buckets view. Available columns: 'Name', 'CreationDate',\n * and 'Region'.\n */\n bucketsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Objects view. Available columns: 'Key', 'LastModified',\n * and 'Size'.\n */\n objectsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Versions view. Available columns: 'ID', 'CreationDate',\n * and 'Size'.\n */\n versionsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides whether a bucket should be disabled for selection in the Buckets view or not.\n * It has higher priority than `selectableItemsTypes`. Example: if `selectableItemsTypes` has `['buckets']` value and\n * `bucketsIsItemDisabled` returns false for a bucket, then the bucket is disabled for selection.\n */\n bucketsIsItemDisabled?: (item: S3ResourceSelectorProps.Bucket) => boolean;\n\n /**\n * Optionally overrides whether an object should be disabled for selection in the Objects view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n objectsIsItemDisabled?: (item: S3ResourceSelectorProps.Object) => boolean;\n\n /**\n * Optionally overrides whether a version should be disabled for selection in the Versions view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n versionsIsItemDisabled?: (item: S3ResourceSelectorProps.Version) => boolean;\n\n /**\n * The current selected resource. Resource has the following properties:\n * - `uri` (string) - URI of the resource.\n * - `versionId` (string) - (Optional) Version ID of the selected resource.\n */\n resource: S3ResourceSelectorProps.Resource;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: S3ResourceSelectorProps.I18nStrings;\n\n /**\n * Specifies a function that returns all available buckets. The return type of the function should be a promise\n * that resolves to a list of objects with the following properties:\n * - `Name` (string) - Name of the bucket.\n * - `CreationDate` (string) - (Optional) Creation date of the bucket.\n * - `Region` (string) - (Optional) Region of the bucket.\n */\n fetchBuckets: () => Promise<ReadonlyArray<S3ResourceSelectorProps.Bucket>>;\n\n /**\n * Specifies a function that returns available objects and object prefixes for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of objects with the following properties:\n * - `Key` (string) - Name of the object or object prefix.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object.\n * - `IsFolder` (boolean) - (Optional) Determines whether the entry is an object prefix (folder).\n */\n fetchObjects: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Object>>;\n\n /**\n * Specifies a function that returns available versions for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of versions with the following properties:\n * - `VersionId` (string) - Version ID of an object.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object version.\n */\n fetchVersions: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Version>>;\n\n /**\n * Fired when the resource selection is changed. The event detail object contains resource that represents the full\n * path of the selected resource and `errorText` that may contain a validation error.\n */\n onChange?: NonCancelableEventHandler<S3ResourceSelectorProps.ChangeDetail>;\n}\n\n// Does not use TableProps.AriaLabels, because here we do not need \"allItemsSelectionLabel\"\n// it is not applicable to single selection mode\ninterface SelectionLabels<T> {\n itemSelectionLabel: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel: string;\n}\n\ntype SortingColumnContainingString = (columnName: string) => string;\n\nexport namespace S3ResourceSelectorProps {\n export interface Bucket {\n Name?: string;\n CreationDate?: string;\n // artificial field, does not exist on the real s3 response\n Region?: string;\n }\n export interface Object {\n Key?: string;\n LastModified?: string;\n Size?: number;\n // artificial field, does not exist on the real s3 response\n IsFolder?: boolean;\n }\n export interface Version {\n VersionId?: string;\n LastModified?: string;\n Size?: number;\n }\n\n export interface Resource {\n uri: string;\n versionId?: string;\n }\n\n export type SelectableItems = 'buckets' | 'objects' | 'versions';\n\n export interface I18nStrings {\n inContextInputPlaceholder: string;\n inContextSelectPlaceholder: string;\n inContextBrowseButton: string;\n inContextViewButton: string;\n inContextViewButtonAriaLabel?: string;\n inContextLoadingText: string;\n inContextUriLabel: string;\n inContextVersionSelectLabel: string;\n\n modalTitle: string;\n modalCancelButton: string;\n modalSubmitButton: string;\n modalBreadcrumbRootItem: string;\n\n selectionBuckets: string;\n selectionObjects: string;\n selectionVersions: string;\n selectionBucketsSearchPlaceholder: string;\n selectionObjectsSearchPlaceholder: string;\n selectionVersionsSearchPlaceholder: string;\n selectionBucketsLoading: string;\n selectionBucketsNoItems: string;\n selectionObjectsLoading: string;\n selectionObjectsNoItems: string;\n selectionVersionsLoading: string;\n selectionVersionsNoItems: string;\n\n filteringCounterText: (count: number) => string;\n filteringNoMatches: string;\n filteringCantFindMatch: string;\n clearFilterButtonText: string;\n\n columnBucketName: string;\n columnBucketCreationDate?: string;\n columnBucketRegion?: string;\n columnObjectKey: string;\n columnObjectLastModified?: string;\n columnObjectSize?: string;\n columnVersionID: string;\n columnVersionLastModified: string;\n columnVersionSize?: string;\n\n validationPathMustBegin: string;\n validationBucketLowerCase: string;\n validationBucketMustNotContain: string;\n validationBucketLength: string;\n validationBucketMustComplyDns: string;\n\n labelSortedDescending: SortingColumnContainingString;\n labelSortedAscending: SortingColumnContainingString;\n labelNotSorted: SortingColumnContainingString;\n labelsPagination: PaginationProps.Labels;\n labelsBucketsSelection: SelectionLabels<Bucket>;\n labelsObjectsSelection: SelectionLabels<S3ResourceSelectorProps.Object>;\n labelsVersionsSelection: SelectionLabels<Version>;\n labelFiltering: (itemsType: string) => string;\n labelRefresh: string;\n labelModalDismiss: string;\n labelBreadcrumbs: string;\n }\n\n export interface ChangeDetail {\n resource: Resource;\n errorText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the S3 URI input field\n */\n focus(): void;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { TableProps } from '../table/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n\n /**\n * Adds `aria-label` to the component.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the S3 URI input. If you're using this component within a form field,\n * you do not need to set this property, as the form field component will set it automatically.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n inputAriaDescribedby?: string;\n\n /**\n * An array of the item types that are selectable in the table view. The array may contain the following items:\n * 'buckets', 'objects', or 'versions'. Example: ['buckets', 'objects']. By default, no items are selectable.\n * This property determines whether the component operates in Read mode or Write mode:\n * * Read mode - When 'objects' and 'versions' values are provided (folder selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n * * Write mode - When 'buckets' and 'objects' values are provided (file selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n */\n selectableItemsTypes?: ReadonlyArray<S3ResourceSelectorProps.SelectableItems>;\n\n /**\n * Href of the selected object that is applied to the View button.\n */\n viewHref?: string;\n\n /**\n * Whether the S3 URI input field is in invalid state.\n */\n invalid?: boolean;\n\n /**\n * Optionally overrides the set of visible columns in the Buckets view. Available columns: 'Name', 'CreationDate',\n * and 'Region'.\n */\n bucketsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Objects view. Available columns: 'Key', 'LastModified',\n * and 'Size'.\n */\n objectsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Versions view. Available columns: 'ID', 'CreationDate',\n * and 'Size'.\n */\n versionsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides whether a bucket should be disabled for selection in the Buckets view or not.\n * It has higher priority than `selectableItemsTypes`. Example: if `selectableItemsTypes` has `['buckets']` value and\n * `bucketsIsItemDisabled` returns false for a bucket, then the bucket is disabled for selection.\n */\n bucketsIsItemDisabled?: (item: S3ResourceSelectorProps.Bucket) => boolean;\n\n /**\n * Optionally overrides whether an object should be disabled for selection in the Objects view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n objectsIsItemDisabled?: (item: S3ResourceSelectorProps.Object) => boolean;\n\n /**\n * Optionally overrides whether a version should be disabled for selection in the Versions view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n versionsIsItemDisabled?: (item: S3ResourceSelectorProps.Version) => boolean;\n\n /**\n * The current selected resource. Resource has the following properties:\n * - `uri` (string) - URI of the resource.\n * - `versionId` (string) - (Optional) Version ID of the selected resource.\n */\n resource: S3ResourceSelectorProps.Resource;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: S3ResourceSelectorProps.I18nStrings;\n\n /**\n * Specifies a function that returns all available buckets. The return type of the function should be a promise\n * that resolves to a list of objects with the following properties:\n * - `Name` (string) - Name of the bucket.\n * - `CreationDate` (string) - (Optional) Creation date of the bucket.\n * - `Region` (string) - (Optional) Region of the bucket.\n */\n fetchBuckets: () => Promise<ReadonlyArray<S3ResourceSelectorProps.Bucket>>;\n\n /**\n * Specifies a function that returns available objects and object prefixes for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of objects with the following properties:\n * - `Key` (string) - Name of the object or object prefix.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object.\n * - `IsFolder` (boolean) - (Optional) Determines whether the entry is an object prefix (folder).\n */\n fetchObjects: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Object>>;\n\n /**\n * Specifies a function that returns available versions for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of versions with the following properties:\n * - `VersionId` (string) - Version ID of an object.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object version.\n */\n fetchVersions: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Version>>;\n\n /**\n * Fired when the resource selection is changed. The event detail object contains resource that represents the full\n * path of the selected resource and `errorText` that may contain a validation error.\n */\n onChange?: NonCancelableEventHandler<S3ResourceSelectorProps.ChangeDetail>;\n}\n\n// Does not use TableProps.AriaLabels, because here we do not need \"allItemsSelectionLabel\"\n// it is not applicable to single selection mode\ninterface SelectionLabels<T> {\n itemSelectionLabel: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel: string;\n}\n\ntype SortingColumnContainingString = (columnName: string) => string;\n\nexport namespace S3ResourceSelectorProps {\n export interface Bucket {\n Name?: string;\n CreationDate?: string;\n // artificial field, does not exist on the real s3 response\n Region?: string;\n }\n export interface Object {\n Key?: string;\n LastModified?: string;\n Size?: number;\n // artificial field, does not exist on the real s3 response\n IsFolder?: boolean;\n }\n export interface Version {\n VersionId?: string;\n LastModified?: string;\n Size?: number;\n }\n\n export interface Resource {\n uri: string;\n versionId?: string;\n }\n\n export type SelectableItems = 'buckets' | 'objects' | 'versions';\n\n export interface I18nStrings {\n inContextInputPlaceholder: string;\n inContextSelectPlaceholder: string;\n inContextBrowseButton: string;\n inContextViewButton: string;\n inContextViewButtonAriaLabel?: string;\n inContextLoadingText: string;\n inContextUriLabel: string;\n inContextVersionSelectLabel: string;\n\n modalTitle: string;\n modalCancelButton: string;\n modalSubmitButton: string;\n modalBreadcrumbRootItem: string;\n\n selectionBuckets: string;\n selectionObjects: string;\n selectionVersions: string;\n selectionBucketsSearchPlaceholder: string;\n selectionObjectsSearchPlaceholder: string;\n selectionVersionsSearchPlaceholder: string;\n selectionBucketsLoading: string;\n selectionBucketsNoItems: string;\n selectionObjectsLoading: string;\n selectionObjectsNoItems: string;\n selectionVersionsLoading: string;\n selectionVersionsNoItems: string;\n\n filteringCounterText: (count: number) => string;\n filteringNoMatches: string;\n filteringCantFindMatch: string;\n clearFilterButtonText: string;\n\n columnBucketName: string;\n columnBucketCreationDate?: string;\n columnBucketRegion?: string;\n columnObjectKey: string;\n columnObjectLastModified?: string;\n columnObjectSize?: string;\n columnVersionID: string;\n columnVersionLastModified: string;\n columnVersionSize?: string;\n\n validationPathMustBegin: string;\n validationBucketLowerCase: string;\n validationBucketMustNotContain: string;\n validationBucketLength: string;\n validationBucketMustComplyDns: string;\n\n labelSortedDescending: SortingColumnContainingString;\n labelSortedAscending: SortingColumnContainingString;\n labelNotSorted: SortingColumnContainingString;\n labelsPagination: PaginationProps.Labels;\n labelsBucketsSelection: SelectionLabels<Bucket>;\n labelsObjectsSelection: SelectionLabels<S3ResourceSelectorProps.Object>;\n labelsVersionsSelection: SelectionLabels<Version>;\n labelFiltering: (itemsType: string) => string;\n labelRefresh: string;\n labelModalDismiss: string;\n labelBreadcrumbs: string;\n }\n\n export interface ChangeDetail {\n resource: Resource;\n errorText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the S3 URI input field\n */\n focus(): void;\n }\n}\n"]}
|
package/select/parts/filter.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export interface FilterProps extends InternalInputProps {
|
|
|
5
5
|
ref?: React.Ref<HTMLInputElement>;
|
|
6
6
|
filteringType: SelectProps.FilteringType;
|
|
7
7
|
}
|
|
8
|
-
declare const Filter: React.ForwardRefExoticComponent<Pick<FilterProps, "disabled" | "autoComplete" | "autoFocus" | "name" | "className" | "id" | "placeholder" | "inputMode" | "type" | "readOnly" | "step" | "value" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "invalid" | "__internalRootRef" | "ariaLabel" | "__nativeAttributes" | "ariaLabelledby" | "ariaDescribedby" | "controlId" | "ariaRequired" | "disableBrowserAutocorrect" | "__leftIcon" | "__leftIconVariant" | "__onLeftIconClick" | "__rightIcon" | "__rightIconVariant" | "__onRightIconClick" | "__noBorderRadius" | "__onDelayedInput" | "__onBlurWithDetail" | "__inheritFormFieldProps" | "filteringType"> & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
+
declare const Filter: React.ForwardRefExoticComponent<Pick<FilterProps, "disabled" | "autoComplete" | "autoFocus" | "name" | "className" | "id" | "placeholder" | "inputMode" | "type" | "readOnly" | "step" | "value" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "invalid" | "__internalRootRef" | "ariaLabel" | "__nativeAttributes" | "ariaLabelledby" | "ariaDescribedby" | "controlId" | "ariaRequired" | "disableBrowserAutocorrect" | "spellcheck" | "__leftIcon" | "__leftIconVariant" | "__onLeftIconClick" | "__rightIcon" | "__rightIconVariant" | "__onRightIconClick" | "__noBorderRadius" | "__onDelayedInput" | "__onBlurWithDetail" | "__inheritFormFieldProps" | "filteringType"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
9
|
export default Filter;
|
|
10
10
|
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/filter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAsB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC,aAAa,EAAE,WAAW,CAAC,aAAa,CAAC;CAC1C;AAED,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/filter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAsB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC,aAAa,EAAE,WAAW,CAAC,aAAa,CAAC;CAC1C;AAED,QAAA,MAAM,MAAM,4sBAyBV,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/textarea/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/textarea/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAS7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/textarea/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAS7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,QAAA,MAAM,QAAQ,yFA0Eb,CAAC;AAGF,eAAe,QAAQ,CAAC"}
|
package/textarea/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import useBaseComponent from '../internal/hooks/use-base-component';
|
|
|
13
13
|
import { convertAutoComplete } from '../input/utils';
|
|
14
14
|
var Textarea = React.forwardRef(function (_a, ref) {
|
|
15
15
|
var _b;
|
|
16
|
-
var value = _a.value, _c = _a.autoComplete, autoComplete = _c === void 0 ? true : _c, disabled = _a.disabled, readOnly = _a.readOnly, disableBrowserAutocorrect = _a.disableBrowserAutocorrect, disableBrowserSpellcheck = _a.disableBrowserSpellcheck, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, ariaRequired = _a.ariaRequired, name = _a.name, rows = _a.rows, placeholder = _a.placeholder, autoFocus = _a.autoFocus, ariaLabel = _a.ariaLabel, rest = __rest(_a, ["value", "autoComplete", "disabled", "readOnly", "disableBrowserAutocorrect", "disableBrowserSpellcheck", "onKeyDown", "onKeyUp", "onChange", "onBlur", "onFocus", "ariaRequired", "name", "rows", "placeholder", "autoFocus", "ariaLabel"]);
|
|
16
|
+
var value = _a.value, _c = _a.autoComplete, autoComplete = _c === void 0 ? true : _c, disabled = _a.disabled, readOnly = _a.readOnly, disableBrowserAutocorrect = _a.disableBrowserAutocorrect, disableBrowserSpellcheck = _a.disableBrowserSpellcheck, spellcheck = _a.spellcheck, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, ariaRequired = _a.ariaRequired, name = _a.name, rows = _a.rows, placeholder = _a.placeholder, autoFocus = _a.autoFocus, ariaLabel = _a.ariaLabel, rest = __rest(_a, ["value", "autoComplete", "disabled", "readOnly", "disableBrowserAutocorrect", "disableBrowserSpellcheck", "spellcheck", "onKeyDown", "onKeyUp", "onChange", "onBlur", "onFocus", "ariaRequired", "name", "rows", "placeholder", "autoFocus", "ariaLabel"]);
|
|
17
17
|
var __internalRootRef = useBaseComponent('Textarea').__internalRootRef;
|
|
18
18
|
var _d = useFormFieldContext(rest), ariaLabelledby = _d.ariaLabelledby, ariaDescribedby = _d.ariaDescribedby, controlId = _d.controlId, invalid = _d.invalid;
|
|
19
19
|
var baseProps = getBaseProps(rest);
|
|
@@ -33,6 +33,7 @@ var Textarea = React.forwardRef(function (_a, ref) {
|
|
|
33
33
|
_b[styles['textarea-invalid']] = invalid,
|
|
34
34
|
_b)),
|
|
35
35
|
autoComplete: convertAutoComplete(autoComplete),
|
|
36
|
+
spellCheck: spellcheck,
|
|
36
37
|
disabled: disabled,
|
|
37
38
|
readOnly: readOnly ? true : undefined,
|
|
38
39
|
rows: rows || 3,
|
|
@@ -52,7 +53,7 @@ var Textarea = React.forwardRef(function (_a, ref) {
|
|
|
52
53
|
attributes.spellCheck = 'false';
|
|
53
54
|
}
|
|
54
55
|
return (React.createElement("span", __assign({}, baseProps, { className: clsx(styles.root, baseProps.className), ref: __internalRootRef }),
|
|
55
|
-
React.createElement("textarea", __assign({ ref: textareaRef, id: controlId }, attributes
|
|
56
|
+
React.createElement("textarea", __assign({ ref: textareaRef, id: controlId }, attributes))));
|
|
56
57
|
});
|
|
57
58
|
applyDisplayName(Textarea, 'Textarea');
|
|
58
59
|
export default Textarea;
|
package/textarea/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/textarea/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIrD,IAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,UACE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/textarea/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE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,UAAU,CAAC,WAAW,GAAG,KAAK,CAAC;QAC/B,UAAU,CAAC,cAAc,GAAG,KAAK,CAAC;KACnC;IAED,IAAI,wBAAwB,EAAE;QAC5B,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC;KACjC;IAED,OAAO,CACL,yCAAU,SAAS,IAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,iBAAiB;QAC5F,2CAAU,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,IAAM,UAAU,EAAI,CACxD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACvC,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useRef } from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireKeyboardEvent, fireNonCancelableEvent } from '../internal/events';\nimport { TextareaProps } from './interfaces';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { convertAutoComplete } from '../input/utils';\n\nexport { TextareaProps };\n\nconst Textarea = React.forwardRef(\n (\n {\n value,\n autoComplete = true,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n disableBrowserSpellcheck,\n spellcheck,\n onKeyDown,\n onKeyUp,\n onChange,\n onBlur,\n onFocus,\n ariaRequired,\n name,\n rows,\n placeholder,\n autoFocus,\n ariaLabel,\n ...rest\n }: TextareaProps,\n ref: Ref<TextareaProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('Textarea');\n const { ariaLabelledby, ariaDescribedby, controlId, invalid } = useFormFieldContext(rest);\n const baseProps = getBaseProps(rest);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n useForwardFocus(ref, textareaRef);\n\n const attributes: React.TextareaHTMLAttributes<HTMLTextAreaElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-required': ariaRequired ? 'true' : undefined,\n 'aria-invalid': invalid ? 'true' : undefined,\n name,\n placeholder,\n autoFocus,\n className: clsx(styles.textarea, {\n [styles['textarea-readonly']]: readOnly,\n [styles['textarea-invalid']]: invalid,\n }),\n autoComplete: convertAutoComplete(autoComplete),\n spellCheck: spellcheck,\n disabled,\n readOnly: readOnly ? true : undefined,\n rows: rows || 3,\n onKeyDown: onKeyDown && (event => fireKeyboardEvent(onKeyDown, event)),\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value || '',\n onChange: onChange && (event => fireNonCancelableEvent(onChange, { value: event.target.value })),\n onBlur: onBlur && (() => fireNonCancelableEvent(onBlur)),\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n };\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n if (disableBrowserSpellcheck) {\n attributes.spellCheck = 'false';\n }\n\n return (\n <span {...baseProps} className={clsx(styles.root, baseProps.className)} ref={__internalRootRef}>\n <textarea ref={textareaRef} id={controlId} {...attributes} />\n </span>\n );\n }\n);\n\napplyDisplayName(Textarea, 'Textarea');\nexport default Textarea;\n"]}
|
package/textarea/interfaces.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseComponentProps } from '../internal/base-component';
|
|
2
2
|
import { BaseKeyDetail } from '../internal/events';
|
|
3
3
|
import { FormFieldValidationControlProps } from '../internal/context/form-field-context';
|
|
4
|
-
import { BaseInputProps, InputAutoCorrect, InputAutoComplete, InputKeyEvents } from '../input/interfaces';
|
|
5
|
-
export interface TextareaProps extends BaseInputProps, InputKeyEvents, InputAutoCorrect, InputAutoComplete, BaseComponentProps, FormFieldValidationControlProps {
|
|
4
|
+
import { BaseInputProps, InputAutoCorrect, InputAutoComplete, InputKeyEvents, InputSpellcheck } from '../input/interfaces';
|
|
5
|
+
export interface TextareaProps extends BaseInputProps, InputKeyEvents, InputAutoCorrect, InputAutoComplete, InputSpellcheck, BaseComponentProps, FormFieldValidationControlProps {
|
|
6
6
|
/**
|
|
7
7
|
* Specifies the number of lines of text to set the height to.
|
|
8
8
|
*/
|
|
@@ -13,6 +13,9 @@ export interface TextareaProps extends BaseInputProps, InputKeyEvents, InputAuto
|
|
|
13
13
|
* that checks for spelling/grammar errors.
|
|
14
14
|
* If you don't set it, the behavior follows the default behavior
|
|
15
15
|
* of the user's browser.
|
|
16
|
+
*
|
|
17
|
+
* This property is deprecated. Use the `spellcheck` property instead.
|
|
18
|
+
* @deprecated
|
|
16
19
|
*/
|
|
17
20
|
disableBrowserSpellcheck?: boolean;
|
|
18
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,aACf,SAAQ,cAAc,EACpB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,+BAA+B;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;;OASG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,yBAAiB,aAAa,CAAC;IAC7B,KAAY,SAAS,GAAG,aAAa,CAAC;IAEtC,UAAiB,YAAY;QAC3B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;IACD,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseKeyDetail } from '../internal/events';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport {
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/textarea/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseKeyDetail } from '../internal/events';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport {\n BaseInputProps,\n InputAutoCorrect,\n InputAutoComplete,\n InputKeyEvents,\n InputSpellcheck,\n} from '../input/interfaces';\n\nexport interface TextareaProps\n extends BaseInputProps,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n InputSpellcheck,\n BaseComponentProps,\n FormFieldValidationControlProps {\n /**\n * Specifies the number of lines of text to set the height to.\n */\n rows?: number;\n\n /**\n * Specifies whether to disable browser spellcheck feature.\n * If you set this to `true`, it disables native browser capability\n * that checks for spelling/grammar errors.\n * If you don't set it, the behavior follows the default behavior\n * of the user's browser.\n *\n * This property is deprecated. Use the `spellcheck` property instead.\n * @deprecated\n */\n disableBrowserSpellcheck?: boolean;\n}\n\nexport namespace TextareaProps {\n export type KeyDetail = BaseKeyDetail;\n\n export interface ChangeDetail {\n /**\n * The new value of this textarea.\n */\n value: string;\n }\n export interface Ref {\n /**\n * Sets input focus on the textarea control.\n */\n focus(): void;\n }\n}\n"]}
|