@patternfly/react-core 4.217.2 → 4.218.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts +5 -0
- package/dist/esm/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/esm/components/ContextSelector/ContextSelector.js +4 -3
- package/dist/esm/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.d.ts +5 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/Dropdown.js +2 -2
- package/dist/esm/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/Dropdown/DropdownWithContext.d.ts.map +1 -1
- package/dist/esm/components/Dropdown/DropdownWithContext.js +7 -3
- package/dist/esm/components/Dropdown/DropdownWithContext.js.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.d.ts +4 -0
- package/dist/esm/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/esm/components/FileUpload/FileUploadField.js +2 -2
- package/dist/esm/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts +5 -0
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +7 -3
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Switch/Switch.d.ts +9 -3
- package/dist/esm/components/Switch/Switch.d.ts.map +1 -1
- package/dist/esm/components/Switch/Switch.js +2 -2
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.d.ts +5 -0
- package/dist/js/components/ContextSelector/ContextSelector.d.ts.map +1 -1
- package/dist/js/components/ContextSelector/ContextSelector.js +4 -3
- package/dist/js/components/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.d.ts +5 -0
- package/dist/js/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/js/components/Dropdown/Dropdown.js +2 -2
- package/dist/js/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/js/components/Dropdown/DropdownWithContext.d.ts.map +1 -1
- package/dist/js/components/Dropdown/DropdownWithContext.js +7 -3
- package/dist/js/components/Dropdown/DropdownWithContext.js.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.d.ts +4 -0
- package/dist/js/components/FileUpload/FileUploadField.d.ts.map +1 -1
- package/dist/js/components/FileUpload/FileUploadField.js +2 -2
- package/dist/js/components/FileUpload/FileUploadField.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts +5 -0
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +7 -3
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Switch/Switch.d.ts +9 -3
- package/dist/js/components/Switch/Switch.d.ts.map +1 -1
- package/dist/js/components/Switch/Switch.js +2 -2
- package/dist/js/components/Switch/Switch.js.map +1 -1
- package/dist/umd/react-core.js +24 -15
- package/dist/umd/react-core.min.js +2 -2
- package/package.json +5 -5
- package/src/components/ContextSelector/ContextSelector.tsx +14 -2
- package/src/components/Dropdown/Dropdown.tsx +7 -1
- package/src/components/Dropdown/DropdownWithContext.tsx +6 -1
- package/src/components/FileUpload/FileUploadField.tsx +8 -0
- package/src/components/FileUpload/__tests__/__snapshots__/FileUpload.test.tsx.snap +1 -0
- package/src/components/FileUpload/__tests__/__snapshots__/FileUploadField.test.tsx.snap +1 -0
- package/src/components/FileUpload/examples/FileUpload.md +6 -3
- package/src/components/Select/Select.tsx +11 -1
- package/src/components/Switch/Switch.tsx +12 -4
- package/src/components/Switch/examples/Switch.md +2 -18
|
@@ -23,10 +23,10 @@ class Switch extends React.Component {
|
|
|
23
23
|
render() {
|
|
24
24
|
const _a = this.props, {
|
|
25
25
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26
|
-
id, className, label, labelOff, isChecked, hasCheckIcon, isDisabled, onChange, isReversed, ouiaId, ouiaSafe } = _a, props = tslib_1.__rest(_a, ["id", "className", "label", "labelOff", "isChecked", "hasCheckIcon", "isDisabled", "onChange", "isReversed", "ouiaId", "ouiaSafe"]);
|
|
26
|
+
id, className, label, labelOff, isChecked, defaultChecked, hasCheckIcon, isDisabled, onChange, isReversed, ouiaId, ouiaSafe } = _a, props = tslib_1.__rest(_a, ["id", "className", "label", "labelOff", "isChecked", "defaultChecked", "hasCheckIcon", "isDisabled", "onChange", "isReversed", "ouiaId", "ouiaSafe"]);
|
|
27
27
|
const isAriaLabelledBy = props['aria-label'] === '';
|
|
28
28
|
return (React.createElement("label", Object.assign({ className: react_styles_1.css(switch_1.default.switch, isReversed && switch_1.default.modifiers.reverse, className), htmlFor: this.id }, helpers_1.getOUIAProps(Switch.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)),
|
|
29
|
-
React.createElement("input", Object.assign({ id: this.id, className: react_styles_1.css(switch_1.default.switchInput), type: "checkbox", onChange: event => onChange(event.target.checked, event), checked: isChecked, disabled: isDisabled, "aria-labelledby": isAriaLabelledBy ? `${this.id}-on` : null }, props)),
|
|
29
|
+
React.createElement("input", Object.assign({ id: this.id, className: react_styles_1.css(switch_1.default.switchInput), type: "checkbox", onChange: event => onChange(event.target.checked, event) }, ([true, false].includes(defaultChecked) && { defaultChecked }), (![true, false].includes(defaultChecked) && { checked: isChecked }), { disabled: isDisabled, "aria-labelledby": isAriaLabelledBy ? `${this.id}-on` : null }, props)),
|
|
30
30
|
label !== undefined ? (React.createElement(React.Fragment, null,
|
|
31
31
|
React.createElement("span", { className: react_styles_1.css(switch_1.default.switchToggle) }, hasCheckIcon && (React.createElement("span", { className: react_styles_1.css(switch_1.default.switchToggleIcon), "aria-hidden": "true" },
|
|
32
32
|
React.createElement(check_icon_1.default, { noVerticalAlign: true })))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2GAA2E;AAC3E,2DAA+C;AAC/C,0GAA0E;AAC1E,6CAAiD;AACjD,2CAA0E;
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"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"}
|
package/dist/umd/react-core.js
CHANGED
|
@@ -4827,7 +4827,7 @@
|
|
|
4827
4827
|
render() {
|
|
4828
4828
|
const _a = this.props, { children, className, direction, dropdownItems, isOpen, isPlain, isText, isGrouped, isFullHeight,
|
|
4829
4829
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4830
|
-
onSelect, position, toggle, autoFocus, menuAppendTo } = _a, props = __rest$1(_a, ["children", "className", "direction", "dropdownItems", "isOpen", "isPlain", "isText", "isGrouped", "isFullHeight", "onSelect", "position", "toggle", "autoFocus", "menuAppendTo"]);
|
|
4830
|
+
onSelect, position, toggle, autoFocus, menuAppendTo, isFlipEnabled } = _a, props = __rest$1(_a, ["children", "className", "direction", "dropdownItems", "isOpen", "isPlain", "isText", "isGrouped", "isFullHeight", "onSelect", "position", "toggle", "autoFocus", "menuAppendTo", "isFlipEnabled"]);
|
|
4831
4831
|
const id = toggle.props.id || `pf-dropdown-toggle-id-${DropdownWithContext.currentId++}`;
|
|
4832
4832
|
let component;
|
|
4833
4833
|
let renderedContent;
|
|
@@ -4844,7 +4844,10 @@
|
|
|
4844
4844
|
const openedOnEnter = this.openedOnEnter;
|
|
4845
4845
|
return (React__namespace.createElement(DropdownContext.Consumer, null, ({ baseClass, baseComponent, id: contextId, ouiaId, ouiaComponentType, ouiaSafe, alignments }) => {
|
|
4846
4846
|
const BaseComponent = baseComponent;
|
|
4847
|
-
const menuContainer = (React__namespace.createElement(DropdownMenu
|
|
4847
|
+
const menuContainer = (React__namespace.createElement(DropdownMenu
|
|
4848
|
+
// This removes the `position: absolute` styling from the `.pf-c-dropdown__menu`
|
|
4849
|
+
// allowing the menu to flip correctly
|
|
4850
|
+
, Object.assign({}, (isFlipEnabled && { style: { position: 'revert', minWidth: 'min-content' } }), { setMenuComponentRef: this.setMenuComponentRef, component: component, isOpen: isOpen, position: position, "aria-labelledby": contextId ? `${contextId}-toggle` : id, isGrouped: isGrouped, autoFocus: openedOnEnter && autoFocus, alignments: alignments }), renderedContent));
|
|
4848
4851
|
const popperContainer = (React__namespace.createElement("div", { className: css(baseClass, direction === exports.DropdownDirection.up && styles$16.modifiers.top, position === exports.DropdownPosition.right && styles$16.modifiers.alignRight, isOpen && styles$16.modifiers.expanded, className) }, isOpen && menuContainer));
|
|
4849
4852
|
const mainContainer = (React__namespace.createElement(BaseComponent, Object.assign({}, props, { className: css(baseClass, direction === exports.DropdownDirection.up && styles$16.modifiers.top, position === exports.DropdownPosition.right && styles$16.modifiers.alignRight, isOpen && styles$16.modifiers.expanded, isFullHeight && styles$16.modifiers.fullHeight, className), ref: this.baseComponentRef }, getOUIAProps(ouiaComponentType, ouiaId, ouiaSafe)),
|
|
4850
4853
|
React__namespace.Children.map(toggle, oneToggle => React__namespace.cloneElement(oneToggle, {
|
|
@@ -4885,16 +4888,17 @@
|
|
|
4885
4888
|
direction: exports.DropdownDirection.down,
|
|
4886
4889
|
onSelect: () => undefined,
|
|
4887
4890
|
autoFocus: true,
|
|
4888
|
-
menuAppendTo: 'inline'
|
|
4891
|
+
menuAppendTo: 'inline',
|
|
4892
|
+
isFlipEnabled: false
|
|
4889
4893
|
};
|
|
4890
4894
|
|
|
4891
4895
|
const Dropdown = (_a) => {
|
|
4892
4896
|
var { onSelect,
|
|
4893
4897
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4894
4898
|
ref, // Types of Ref are different for React.FunctionComponent vs React.Component
|
|
4895
|
-
ouiaId, ouiaSafe, alignments, contextProps, menuAppendTo = 'inline' } = _a, props = __rest$1(_a, ["onSelect", "ref", "ouiaId", "ouiaSafe", "alignments", "contextProps", "menuAppendTo"]);
|
|
4899
|
+
ouiaId, ouiaSafe, alignments, contextProps, menuAppendTo = 'inline', isFlipEnabled = false } = _a, props = __rest$1(_a, ["onSelect", "ref", "ouiaId", "ouiaSafe", "alignments", "contextProps", "menuAppendTo", "isFlipEnabled"]);
|
|
4896
4900
|
return (React__namespace.createElement(DropdownContext.Provider, { value: Object.assign({ onSelect: event => onSelect && onSelect(event), toggleTextClass: styles$16.dropdownToggleText, toggleIconClass: styles$16.dropdownToggleImage, toggleIndicatorClass: styles$16.dropdownToggleIcon, menuClass: styles$16.dropdownMenu, itemClass: styles$16.dropdownMenuItem, toggleClass: styles$16.dropdownToggle, baseClass: styles$16.dropdown, baseComponent: 'div', sectionClass: styles$16.dropdownGroup, sectionTitleClass: styles$16.dropdownGroupTitle, sectionComponent: 'section', disabledClass: styles$16.modifiers.disabled, plainTextClass: styles$16.modifiers.text, ouiaId: useOUIAId(Dropdown.displayName, ouiaId), ouiaSafe, ouiaComponentType: Dropdown.displayName, alignments }, contextProps) },
|
|
4897
|
-
React__namespace.createElement(DropdownWithContext, Object.assign({ menuAppendTo: menuAppendTo }, props))));
|
|
4901
|
+
React__namespace.createElement(DropdownWithContext, Object.assign({ menuAppendTo: menuAppendTo, isFlipEnabled: isFlipEnabled }, props))));
|
|
4898
4902
|
};
|
|
4899
4903
|
Dropdown.displayName = 'Dropdown';
|
|
4900
4904
|
|
|
@@ -7489,7 +7493,7 @@
|
|
|
7489
7493
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
7490
7494
|
menuAppendTo, favorites, onFavorite,
|
|
7491
7495
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7492
|
-
favoritesLabel, footer, loadingVariant, isCreateSelectOptionObject, shouldResetOnSelect } = _a, props = __rest$1(_a, ["children", "chipGroupProps", "chipGroupComponent", "className", "customContent", "variant", "direction", "onSelect", "onClear", "onBlur", "toggleId", "isOpen", "isGrouped", "isPlain", "isDisabled", "hasPlaceholderStyle", "validated", "selections", "typeAheadAriaLabel", "clearSelectionsAriaLabel", "toggleAriaLabel", "removeSelectionAriaLabel", 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-invalid', "placeholderText", "width", "maxHeight", "toggleIcon", "ouiaId", "ouiaSafe", "hasInlineFilter", "isCheckboxSelectionBadgeHidden", "inlineFilterPlaceholderText", "onFilter", "onTypeaheadInputChanged", "onCreateOption", "isCreatable", "onToggle", "createText", "noResultsFoundText", "customBadgeText", "inputIdPrefix", "inputAutoComplete", "isInputValuePersisted", "isInputFilterPersisted", "menuAppendTo", "favorites", "onFavorite", "favoritesLabel", "footer", "loadingVariant", "isCreateSelectOptionObject", "shouldResetOnSelect"]);
|
|
7496
|
+
favoritesLabel, footer, loadingVariant, isCreateSelectOptionObject, shouldResetOnSelect, isFlipEnabled } = _a, props = __rest$1(_a, ["children", "chipGroupProps", "chipGroupComponent", "className", "customContent", "variant", "direction", "onSelect", "onClear", "onBlur", "toggleId", "isOpen", "isGrouped", "isPlain", "isDisabled", "hasPlaceholderStyle", "validated", "selections", "typeAheadAriaLabel", "clearSelectionsAriaLabel", "toggleAriaLabel", "removeSelectionAriaLabel", 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-invalid', "placeholderText", "width", "maxHeight", "toggleIcon", "ouiaId", "ouiaSafe", "hasInlineFilter", "isCheckboxSelectionBadgeHidden", "inlineFilterPlaceholderText", "onFilter", "onTypeaheadInputChanged", "onCreateOption", "isCreatable", "onToggle", "createText", "noResultsFoundText", "customBadgeText", "inputIdPrefix", "inputAutoComplete", "isInputValuePersisted", "isInputFilterPersisted", "menuAppendTo", "favorites", "onFavorite", "favoritesLabel", "footer", "loadingVariant", "isCreateSelectOptionObject", "shouldResetOnSelect", "isFlipEnabled"]);
|
|
7493
7497
|
const { focusFirstOption: openedOnEnter, typeaheadCurrIndex, typeaheadInputValue, typeaheadFilteredChildren, favoritesGroup } = this.state;
|
|
7494
7498
|
const selectToggleId = toggleId || `pf-select-toggle-id-${currentId$1++}`;
|
|
7495
7499
|
const selections = Array.isArray(selectionsProp) ? selectionsProp : [selectionsProp];
|
|
@@ -7655,7 +7659,10 @@
|
|
|
7655
7659
|
break;
|
|
7656
7660
|
}
|
|
7657
7661
|
}
|
|
7658
|
-
const innerMenu = (React__namespace.createElement(SelectMenu
|
|
7662
|
+
const innerMenu = (React__namespace.createElement(SelectMenu
|
|
7663
|
+
// This removes the `position: absolute` styling from the `.pf-c-select__menu`
|
|
7664
|
+
// allowing the menu to flip correctly
|
|
7665
|
+
, Object.assign({}, (isFlipEnabled && { style: { position: 'revert' } }), props, { isGrouped: isGrouped, selected: selections }, variantProps, { openedOnEnter: openedOnEnter, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, sendRef: this.sendRef, keyHandler: this.handleMenuKeys, maxHeight: maxHeight, ref: this.menuComponentRef, footer: footer, footerRef: this.footerRef, isLastOptionBeforeFooter: this.isLastOptionBeforeFooter }), variantChildren));
|
|
7659
7666
|
const menuContainer = footer ? React__namespace.createElement("div", { className: css(styles$_.selectMenu) },
|
|
7660
7667
|
" ",
|
|
7661
7668
|
innerMenu,
|
|
@@ -7761,7 +7768,8 @@
|
|
|
7761
7768
|
isInputValuePersisted: false,
|
|
7762
7769
|
isInputFilterPersisted: false,
|
|
7763
7770
|
isCreateSelectOptionObject: false,
|
|
7764
|
-
shouldResetOnSelect: true
|
|
7771
|
+
shouldResetOnSelect: true,
|
|
7772
|
+
isFlipEnabled: false
|
|
7765
7773
|
};
|
|
7766
7774
|
|
|
7767
7775
|
const ArrowLeftIconConfig = {
|
|
@@ -9053,8 +9061,8 @@
|
|
|
9053
9061
|
const toggleId = `pf-context-selector-toggle-id-${newId}`;
|
|
9054
9062
|
const screenReaderLabelId = `pf-context-selector-label-id-${newId}`;
|
|
9055
9063
|
const searchButtonId = `pf-context-selector-search-button-id-${newId}`;
|
|
9056
|
-
const _a = this.props, { children, className, isOpen, isFullHeight, onToggle, onSelect, screenReaderLabel, toggleText, searchButtonAriaLabel, searchInputValue, onSearchInputChange, searchInputPlaceholder, onSearchButtonClick, menuAppendTo, ouiaId, ouiaSafe, isPlain, isText, footer, disableFocusTrap } = _a, props = __rest$1(_a, ["children", "className", "isOpen", "isFullHeight", "onToggle", "onSelect", "screenReaderLabel", "toggleText", "searchButtonAriaLabel", "searchInputValue", "onSearchInputChange", "searchInputPlaceholder", "onSearchButtonClick", "menuAppendTo", "ouiaId", "ouiaSafe", "isPlain", "isText", "footer", "disableFocusTrap"]);
|
|
9057
|
-
const menuContainer = (React__namespace.createElement("div", { className: css(styles$Q.contextSelectorMenu) }, isOpen && (React__namespace.createElement(FocusTrap, { active: !disableFocusTrap, focusTrapOptions: { clickOutsideDeactivates: true } },
|
|
9064
|
+
const _a = this.props, { children, className, isOpen, isFullHeight, onToggle, onSelect, screenReaderLabel, toggleText, searchButtonAriaLabel, searchInputValue, onSearchInputChange, searchInputPlaceholder, onSearchButtonClick, menuAppendTo, ouiaId, ouiaSafe, isPlain, isText, footer, disableFocusTrap, isFlipEnabled } = _a, props = __rest$1(_a, ["children", "className", "isOpen", "isFullHeight", "onToggle", "onSelect", "screenReaderLabel", "toggleText", "searchButtonAriaLabel", "searchInputValue", "onSearchInputChange", "searchInputPlaceholder", "onSearchButtonClick", "menuAppendTo", "ouiaId", "ouiaSafe", "isPlain", "isText", "footer", "disableFocusTrap", "isFlipEnabled"]);
|
|
9065
|
+
const menuContainer = (React__namespace.createElement("div", Object.assign({ className: css(styles$Q.contextSelectorMenu) }, (isFlipEnabled && { style: { position: 'revert' } })), isOpen && (React__namespace.createElement(FocusTrap, { active: !disableFocusTrap, focusTrapOptions: { clickOutsideDeactivates: true } },
|
|
9058
9066
|
React__namespace.createElement("div", { className: css(styles$Q.contextSelectorMenuSearch) },
|
|
9059
9067
|
React__namespace.createElement(InputGroup, null,
|
|
9060
9068
|
React__namespace.createElement(TextInput, { value: searchInputValue, type: "search", placeholder: searchInputPlaceholder, onChange: onSearchInputChange, onKeyPress: this.onEnterPressed, "aria-labelledby": searchButtonId }),
|
|
@@ -9096,7 +9104,8 @@
|
|
|
9096
9104
|
disableFocusTrap: false,
|
|
9097
9105
|
footer: null,
|
|
9098
9106
|
isPlain: false,
|
|
9099
|
-
isText: false
|
|
9107
|
+
isText: false,
|
|
9108
|
+
isFlipEnabled: false
|
|
9100
9109
|
};
|
|
9101
9110
|
|
|
9102
9111
|
class ContextSelectorItem extends React__namespace.Component {
|
|
@@ -11264,7 +11273,7 @@
|
|
|
11264
11273
|
}
|
|
11265
11274
|
|
|
11266
11275
|
const FileUploadField = (_a) => {
|
|
11267
|
-
var { id, type, value = '', filename = '', onChange = () => { }, onBrowseButtonClick = () => { }, onClearButtonClick = () => { }, onTextAreaClick, onTextChange, className = '', isDisabled = false, isReadOnly = false, isLoading = false, spinnerAriaValueText, isRequired = false, isDragActive = false, validated = 'default', 'aria-label': ariaLabel = 'File upload', filenamePlaceholder = 'Drag a file here or browse to upload', filenameAriaLabel = filename ? 'Read only filename' : filenamePlaceholder, browseButtonText = 'Browse...', clearButtonText = 'Clear', isClearButtonDisabled = !filename && !value, containerRef = null, allowEditingUploadedText = false, hideDefaultPreview = false, children = null } = _a, props = __rest$1(_a, ["id", "type", "value", "filename", "onChange", "onBrowseButtonClick", "onClearButtonClick", "onTextAreaClick", "onTextChange", "className", "isDisabled", "isReadOnly", "isLoading", "spinnerAriaValueText", "isRequired", "isDragActive", "validated", 'aria-label', "filenamePlaceholder", "filenameAriaLabel", "browseButtonText", "clearButtonText", "isClearButtonDisabled", "containerRef", "allowEditingUploadedText", "hideDefaultPreview", "children"]);
|
|
11276
|
+
var { id, type, value = '', filename = '', onChange = () => { }, onBrowseButtonClick = () => { }, onClearButtonClick = () => { }, onTextAreaClick, onTextChange, onTextAreaBlur, textAreaPlaceholder = '', className = '', isDisabled = false, isReadOnly = false, isLoading = false, spinnerAriaValueText, isRequired = false, isDragActive = false, validated = 'default', 'aria-label': ariaLabel = 'File upload', filenamePlaceholder = 'Drag a file here or browse to upload', filenameAriaLabel = filename ? 'Read only filename' : filenamePlaceholder, browseButtonText = 'Browse...', clearButtonText = 'Clear', isClearButtonDisabled = !filename && !value, containerRef = null, allowEditingUploadedText = false, hideDefaultPreview = false, children = null } = _a, props = __rest$1(_a, ["id", "type", "value", "filename", "onChange", "onBrowseButtonClick", "onClearButtonClick", "onTextAreaClick", "onTextChange", "onTextAreaBlur", "textAreaPlaceholder", "className", "isDisabled", "isReadOnly", "isLoading", "spinnerAriaValueText", "isRequired", "isDragActive", "validated", 'aria-label', "filenamePlaceholder", "filenameAriaLabel", "browseButtonText", "clearButtonText", "isClearButtonDisabled", "containerRef", "allowEditingUploadedText", "hideDefaultPreview", "children"]);
|
|
11268
11277
|
const onTextAreaChange = (newValue, event) => {
|
|
11269
11278
|
onChange(newValue, filename, event);
|
|
11270
11279
|
onTextChange === null || onTextChange === void 0 ? void 0 : onTextChange(newValue);
|
|
@@ -11277,7 +11286,7 @@
|
|
|
11277
11286
|
React__namespace.createElement(Button, { id: `${id}-browse-button`, variant: exports.ButtonVariant.control, onClick: onBrowseButtonClick, isDisabled: isDisabled }, browseButtonText),
|
|
11278
11287
|
React__namespace.createElement(Button, { variant: exports.ButtonVariant.control, isDisabled: isDisabled || isClearButtonDisabled, onClick: onClearButtonClick }, clearButtonText))),
|
|
11279
11288
|
React__namespace.createElement("div", { className: styles$I.fileUploadFileDetails },
|
|
11280
|
-
!hideDefaultPreview && type === fileReaderType.text && (React__namespace.createElement(TextArea, { readOnly: isReadOnly || (!!filename && !allowEditingUploadedText), disabled: isDisabled, isRequired: isRequired, resizeOrientation: exports.TextAreResizeOrientation.vertical, validated: validated, id: id, name: id, "aria-label": ariaLabel, value: value, onChange: onTextAreaChange, onClick: onTextAreaClick })),
|
|
11289
|
+
!hideDefaultPreview && type === fileReaderType.text && (React__namespace.createElement(TextArea, { readOnly: isReadOnly || (!!filename && !allowEditingUploadedText), disabled: isDisabled, isRequired: isRequired, resizeOrientation: exports.TextAreResizeOrientation.vertical, validated: validated, id: id, name: id, "aria-label": ariaLabel, value: value, onChange: onTextAreaChange, onClick: onTextAreaClick, onBlur: onTextAreaBlur, placeholder: textAreaPlaceholder })),
|
|
11281
11290
|
isLoading && (React__namespace.createElement("div", { className: styles$I.fileUploadFileDetailsSpinner },
|
|
11282
11291
|
React__namespace.createElement(Spinner, { size: exports.spinnerSize.lg, "aria-valuetext": spinnerAriaValueText })))),
|
|
11283
11292
|
children));
|
|
@@ -18199,10 +18208,10 @@
|
|
|
18199
18208
|
render() {
|
|
18200
18209
|
const _a = this.props, {
|
|
18201
18210
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18202
|
-
id, className, label, labelOff, isChecked, hasCheckIcon, isDisabled, onChange, isReversed, ouiaId, ouiaSafe } = _a, props = __rest$1(_a, ["id", "className", "label", "labelOff", "isChecked", "hasCheckIcon", "isDisabled", "onChange", "isReversed", "ouiaId", "ouiaSafe"]);
|
|
18211
|
+
id, className, label, labelOff, isChecked, defaultChecked, hasCheckIcon, isDisabled, onChange, isReversed, ouiaId, ouiaSafe } = _a, props = __rest$1(_a, ["id", "className", "label", "labelOff", "isChecked", "defaultChecked", "hasCheckIcon", "isDisabled", "onChange", "isReversed", "ouiaId", "ouiaSafe"]);
|
|
18203
18212
|
const isAriaLabelledBy = props['aria-label'] === '';
|
|
18204
18213
|
return (React__namespace.createElement("label", Object.assign({ className: css(styles$i.switch, isReversed && styles$i.modifiers.reverse, className), htmlFor: this.id }, getOUIAProps(Switch.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)),
|
|
18205
|
-
React__namespace.createElement("input", Object.assign({ id: this.id, className: css(styles$i.switchInput), type: "checkbox", onChange: event => onChange(event.target.checked, event), checked: isChecked, disabled: isDisabled, "aria-labelledby": isAriaLabelledBy ? `${this.id}-on` : null }, props)),
|
|
18214
|
+
React__namespace.createElement("input", Object.assign({ id: this.id, className: css(styles$i.switchInput), type: "checkbox", onChange: event => onChange(event.target.checked, event) }, ([true, false].includes(defaultChecked) && { defaultChecked }), (![true, false].includes(defaultChecked) && { checked: isChecked }), { disabled: isDisabled, "aria-labelledby": isAriaLabelledBy ? `${this.id}-on` : null }, props)),
|
|
18206
18215
|
label !== undefined ? (React__namespace.createElement(React__namespace.Fragment, null,
|
|
18207
18216
|
React__namespace.createElement("span", { className: css(styles$i.switchToggle) }, hasCheckIcon && (React__namespace.createElement("span", { className: css(styles$i.switchToggleIcon), "aria-hidden": "true" },
|
|
18208
18217
|
React__namespace.createElement(CheckIcon$1, { noVerticalAlign: true })))),
|