@qualtrics/ui-react 2.21.0 → 2.22.1
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 +18 -0
- package/dist/__shared/cjs/{index-0ae99de2.js → index-75d9309a.js} +4 -4
- package/dist/__shared/cjs/{index-201e8786.js → index-a8c1a789.js} +678 -568
- package/dist/components/Accordion/Accordion.js +2 -3
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionHeader.js +5 -4
- package/dist/components/Accordion/AccordionPanel.js +3 -3
- package/dist/components/Accordion/AccordionSection.js +1 -2
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +2 -2
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +11 -11
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/Alpha.js +12 -9
- package/dist/components/ColorPicker/ColorPicker.js +10 -8
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +8 -6
- package/dist/components/ColorPicker/Hue.js +3 -2
- package/dist/components/ColorPicker/Palette.js +7 -5
- package/dist/components/ColorPicker/Saturation.js +9 -8
- package/dist/components/ColorPicker/utils/hexToRgbaString.js +3 -2
- package/dist/components/ColorPicker/utils/rgbToHex.js +1 -1
- package/dist/components/ColorPicker/utils/validateHex.js +10 -9
- package/dist/components/Combobox/Combobox.js +48 -29
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxHeader.js +1 -1
- package/dist/components/Combobox/ComboboxIcon.js +3 -2
- package/dist/components/Combobox/ComboboxInput.js +4 -4
- package/dist/components/Combobox/ComboboxList.js +2 -2
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +5 -2
- package/dist/components/Dropdown/Dropdown.js +14 -9
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +23 -19
- package/dist/components/Dropdown/DropdownList.js +4 -4
- package/dist/components/Dropdown/DropdownOption.js +6 -9
- package/dist/components/Dropdown/DropdownSearch.js +12 -6
- package/dist/components/FilePicker/FilePicker.js +13 -6
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField.js +2 -2
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +5 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +12 -9
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +2 -2
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/ConditionSet.js +5 -5
- package/dist/components/LogicEditor/LogicEditor.js +1 -1
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/utils.js +2 -1
- package/dist/components/Modal/Modal.js +14 -13
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +44 -36
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +2 -2
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +10 -7
- package/dist/components/NewMenu/parts/MenuItem.js +1 -1
- package/dist/components/NumberStepper/NumberStepper.js +7 -6
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperDecrement.js +1 -1
- package/dist/components/NumberStepper/NumberStepperIncrement.js +1 -1
- package/dist/components/NumberStepper/NumberStepperInput.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationNextButton.js +5 -5
- package/dist/components/Pagination/PaginationPageInput.js +11 -9
- package/dist/components/Pagination/PaginationPreviousButton.js +5 -5
- package/dist/components/Popover/Popover.js +9 -7
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +4 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +4 -4
- package/dist/components/Radio/Radio.js +12 -11
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +4 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav.js +2 -1
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavLink.js +1 -1
- package/dist/components/Slider/RangeSlider.js +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +1 -1
- package/dist/components/Switch/Switch.js +11 -11
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tab.js +3 -3
- package/dist/components/Tabs/TabList.js +6 -5
- package/dist/components/Tabs/TabPanel.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +10 -4
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/UIProvider.js +2 -2
- package/dist/components/deprecated_ColorPicker/Alpha.js +4 -4
- package/dist/components/deprecated_ColorPicker/Color.js +6 -6
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +2 -2
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +1 -1
- package/dist/components/deprecated_ColorPicker/Hue.js +3 -3
- package/dist/components/deprecated_ColorPicker/Saturation.js +5 -5
- package/dist/components/deprecated_ColorPicker/Swatch.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +8 -8
- package/dist/components/deprecated_Tabs/Tabs.js +11 -7
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanel.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +4 -2
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +8 -8
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +6 -3
- package/dist/hooks/useBreakpoints/useBreakpoints.js +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -1
- package/dist/hooks/useControllableState/useControllableState.js +2 -1
- package/dist/hooks/useEventListener/useEventListener.js +1 -1
- package/dist/hooks/useId/useId.js +1 -1
- package/dist/hooks/useOverlay/useOverlay.js +7 -6
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +2 -1
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +4 -2
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/createIconComponent.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +14 -7
- package/dist/index.es.js +1 -1
- package/dist/index.js +3 -4
- package/dist/next/AdvancedTable/AdvancedTable.js +62 -52
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +6 -4
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +18 -10
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +7 -6
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +5 -4
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -1
- package/dist/next/AdvancedTable/AdvancedTableTypes.js +6 -6
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +3 -2
- package/dist/next/AdvancedTable/useComputedWidth.js +1 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +5 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +1 -1
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxFlyout.js +2 -2
- package/dist/next/Combobox/ComboboxGroup.js +1 -1
- package/dist/next/Combobox/ComboboxInput.js +2 -2
- package/dist/next/Combobox/ComboboxOption.js +1 -1
- package/dist/next/Combobox/hooks/useComboboxFilteredGroup/useComboboxFilteredGroup.js +1 -1
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +12 -8
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +1 -1
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +3 -2
- package/dist/next/Combobox/hooks/useSelectedOptionScroll/useSelectedOptionScroll.js +2 -1
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +2 -1
- package/dist/next/Combobox/utils/nodeRegistration/nodeRegistration.js +1 -1
- package/dist/next/Drawer/Drawer.js +7 -4
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input.js +2 -2
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +5 -3
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuItem.js +8 -9
- package/dist/next/Menu/MenuPane.js +20 -8
- package/dist/next/Menu/SubMenu.js +16 -18
- package/dist/next/Menu/useMutationObserver.js +1 -1
- package/dist/next/Menu/usePaneSearch.js +31 -21
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +7 -6
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +8 -2
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimeDropdown.js +4 -4
- package/dist/next/TimePicker/TimeInput.js +2 -2
- package/dist/next/TimePicker/TimePicker.js +4 -4
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +2 -1
- package/dist/next/TimePicker/utils.js +14 -27
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +317 -260
- package/dist/utils/Flyout/Flyout.js +1 -1
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +9 -5
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +2 -1
- package/dist/utils/Translation/containsComponentOrElement.js +1 -3
- package/dist/utils/Translation/useTranslation.js +4 -5
- package/dist/utils/filterChildren/filterChildren.js +2 -1
- package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -1
- package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -1
- package/dist/utils/mergeRefs/mergeRefs.js +1 -1
- package/dist/utils/wrapEvent/wrapEvent.js +2 -2
- package/next/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"container":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._enUAC{max-width:100%;position:relative;display:inline-block}._i0NGQ{display:inline-flex;justify-content:space-between;align-items:center;background-color:#fafafa;border:1px solid #898989;border-radius:4px;height:36px;color:#515559;outline:none;cursor:pointer}._i0NGQ:hover:not([aria-disabled=true]){cursor:pointer;background-color:#f5f5f5}._i0NGQ:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fafafa}._i0NGQ:disabled,._i0NGQ[aria-disabled=true]{color:#74777a;border-color:#e5e5e5;cursor:not-allowed}._i0NGQ._6-osc{border-color:#b00}._i0NGQ._6-osc:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._i0NGQ._Nkl50{min-width:120px;padding:0 4px 0 12px}._i0NGQ._tj3dL{margin-top:4px}._i0NGQ._MREOr:not([aria-disabled=true]):not(:disabled){color:#32363a}._i0NGQ ._YwHex{display:inline-flex;align-items:center;min-height:10px}._i0NGQ ._YwHex._66Era{line-height:20px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._i0NGQ ._VM9BK{height:24px;width:24px;border-radius:4px;fill:#515559;flex-shrink:0;cursor:pointer}._i0NGQ ._VM9BK._fbJku{border-color:#e5e5e5;fill:#9d9fa1;opacity:.4;cursor:not-allowed}._i0NGQ ._VM9BK._HbvjK{transform:rotate(-180deg)}._Xn-u8[aria-disabled=true]{cursor:not-allowed;color:rgba(81,85,89,.65);fill:#9d9fa1}._H1kr8{position:-webkit-sticky;position:sticky;top:0;z-index:20;padding:4px 8px 8px!important;border-bottom:1px solid #e8e8e8;border-radius:4px 4px 0 0;background-color:#fff!important}._rJiup{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;background-color:#fff;font-size:14px;color:#32363a;word-break:break-word}._Bhf0k{fill:#515559}._Xr-Gq{margin:2px 12px 2px 0}._Xr-Gq._Ua0gy>svg{border-color:#0b6ed0}._-5nVZ{width:100%}";
|
|
4
|
+
var styles = {"container":"_enUAC","button":"_i0NGQ","invalid":"_6-osc","hasText":"_Nkl50","labelled":"_tj3dL","selected":"_MREOr","buttonLabel":"_YwHex","isString":"_66Era","icon":"_VM9BK","disabled":"_fbJku","open":"_HbvjK","option":"_Xn-u8","search":"_H1kr8","emptyOption":"_rJiup","searchIcon":"_Bhf0k","checkbox":"_Xr-Gq","highlighted":"_Ua0gy","searchInput":"_-5nVZ"};
|
|
5
|
+
var stylesheet="._enUAC{max-width:100%;position:relative;display:inline-block}._i0NGQ{display:inline-flex;justify-content:space-between;align-items:center;background-color:#fafafa;border:1px solid #898989;border-radius:4px;height:36px;color:#515559;outline:none;cursor:pointer}._i0NGQ:hover:not([aria-disabled=true]){cursor:pointer;background-color:#f5f5f5}._i0NGQ:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fafafa}._i0NGQ:disabled,._i0NGQ[aria-disabled=true]{color:#74777a;border-color:#e5e5e5;cursor:not-allowed}._i0NGQ._6-osc{border-color:#b00}._i0NGQ._6-osc:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._i0NGQ._Nkl50{min-width:120px;padding:0 4px 0 12px}._i0NGQ._tj3dL{margin-top:4px}._i0NGQ._MREOr:not([aria-disabled=true]):not(:disabled){color:#32363a}._i0NGQ ._YwHex{display:inline-flex;align-items:center;min-height:10px}._i0NGQ ._YwHex._66Era{line-height:20px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._i0NGQ ._VM9BK{height:24px;width:24px;border-radius:4px;fill:#515559;flex-shrink:0;cursor:pointer}._i0NGQ ._VM9BK._fbJku{border-color:#e5e5e5;fill:#9d9fa1;opacity:.4;cursor:not-allowed}._i0NGQ ._VM9BK._HbvjK{transform:rotate(-180deg)}._Xn-u8[aria-disabled=true]{cursor:not-allowed;color:rgba(81,85,89,.65);fill:#9d9fa1}._H1kr8{position:-webkit-sticky;position:sticky;top:0;z-index:20;padding:4px 8px 8px!important;border-bottom:1px solid #e8e8e8;border-radius:4px 4px 0 0;background-color:#fff!important}._rJiup{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;background-color:#fff;font-size:14px;color:#32363a;word-break:break-word}._Bhf0k{fill:#515559}._Xr-Gq{margin:2px 12px 2px 0}._Xr-Gq._Ua0gy>svg{border-color:#0b6ed0}._-5nVZ{width:100%}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -15,6 +15,7 @@ import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
|
15
15
|
import ChevronDownIcon from '../../icons/components/ChevronDownIcon.js';
|
|
16
16
|
|
|
17
17
|
const DropdownButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
18
|
+
var _ref2, _children$props$aria, _children$props, _ref3, _children$props$aria2, _children$props2, _ref4, _children$props$aria3, _children$props3, _children$props$tabIn, _children$props4, _children$props7, _children$props8;
|
|
18
19
|
let {
|
|
19
20
|
children,
|
|
20
21
|
className,
|
|
@@ -61,9 +62,9 @@ const DropdownButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
61
62
|
helperTextId: formFieldHelperTextId,
|
|
62
63
|
errorTextId: formFieldErrorTextId
|
|
63
64
|
} = useFormFieldControl();
|
|
64
|
-
const ariaLabelledBy = children
|
|
65
|
-
const ariaLabel = children
|
|
66
|
-
const ariaDescribedby = concatIds(children
|
|
65
|
+
const ariaLabelledBy = (_ref2 = (_children$props$aria = children === null || children === void 0 || (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props['aria-labelledby']) !== null && _children$props$aria !== void 0 ? _children$props$aria : externalAriaLabelledBy) !== null && _ref2 !== void 0 ? _ref2 : dropdownAriaLabelledBy ? "".concat(dropdownAriaLabelledBy, " ").concat(buttonId) : undefined;
|
|
66
|
+
const ariaLabel = (_ref3 = (_children$props$aria2 = children === null || children === void 0 || (_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2['aria-label']) !== null && _children$props$aria2 !== void 0 ? _children$props$aria2 : externalAriaLabel) !== null && _ref3 !== void 0 ? _ref3 : dropdownAriaLabel && typeof label === 'string' ? "".concat(dropdownAriaLabel, " ").concat(label) : dropdownAriaLabel;
|
|
67
|
+
const ariaDescribedby = concatIds((_ref4 = (_children$props$aria3 = children === null || children === void 0 || (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3['aria-describedby']) !== null && _children$props$aria3 !== void 0 ? _children$props$aria3 : externalAriaDescribedBy) !== null && _ref4 !== void 0 ? _ref4 : dropdownAriaDescribedby, formFieldHelperTextId, formFieldErrorTextId);
|
|
67
68
|
useEffect(() => {
|
|
68
69
|
const selectedLabels = [];
|
|
69
70
|
options.forEach(option => {
|
|
@@ -75,12 +76,13 @@ const DropdownButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
75
76
|
setLabel(selectedLabels.length > 0 ? selectedLabels.join(', ') : defaultLabel);
|
|
76
77
|
}, [setLabel, options, defaultLabel]);
|
|
77
78
|
useEffect(() => {
|
|
78
|
-
|
|
79
|
+
var _buttonRef$current;
|
|
80
|
+
setMinWidth(buttonRef === null || buttonRef === void 0 || (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.offsetWidth);
|
|
79
81
|
});
|
|
80
82
|
const isInvalid = isInvalidProp !== undefined ? isInvalidProp : dropdownIsInvalid;
|
|
81
83
|
const handleClick = e => {
|
|
82
|
-
if (disabled
|
|
83
|
-
onClick
|
|
84
|
+
if (disabled !== null && disabled !== void 0 ? disabled : dropdownAriaDisabled) return;
|
|
85
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
84
86
|
// Needed because some browsers don't focus on click
|
|
85
87
|
e.currentTarget.focus();
|
|
86
88
|
setIsOpen(currentIsOpen => {
|
|
@@ -89,15 +91,15 @@ const DropdownButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
89
91
|
});
|
|
90
92
|
};
|
|
91
93
|
const handleKeyDown = e => {
|
|
92
|
-
if (disabled
|
|
93
|
-
onKeyDown
|
|
94
|
+
if (disabled !== null && disabled !== void 0 ? disabled : dropdownAriaDisabled) return;
|
|
95
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
94
96
|
onKeyDownButton(e);
|
|
95
97
|
};
|
|
96
98
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children ? /*#__PURE__*/React__default.cloneElement(children, {
|
|
97
|
-
ref: mergeRefs(ref, children
|
|
99
|
+
ref: mergeRefs(ref, children === null || children === void 0 ? void 0 : children.ref, buttonRef, dropdownButtonRef),
|
|
98
100
|
disabled: disabled || dropdownAriaDisabled,
|
|
99
101
|
'aria-disabled': dropdownAriaDisabled,
|
|
100
|
-
tabIndex: children.props
|
|
102
|
+
tabIndex: (_children$props$tabIn = (_children$props4 = children.props) === null || _children$props4 === void 0 ? void 0 : _children$props4.tabIndex) !== null && _children$props$tabIn !== void 0 ? _children$props$tabIn : 0,
|
|
101
103
|
role: 'button',
|
|
102
104
|
'aria-expanded': isOpen,
|
|
103
105
|
'aria-haspopup': 'listbox',
|
|
@@ -107,15 +109,17 @@ const DropdownButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
107
109
|
'aria-describedby': ariaDescribedby,
|
|
108
110
|
id: buttonId,
|
|
109
111
|
onFocus: e => {
|
|
110
|
-
|
|
111
|
-
onFocus
|
|
112
|
+
var _children$props5, _children$props5$onFo;
|
|
113
|
+
(_children$props5 = children.props) === null || _children$props5 === void 0 || (_children$props5$onFo = _children$props5.onFocus) === null || _children$props5$onFo === void 0 ? void 0 : _children$props5$onFo.call(_children$props5, e);
|
|
114
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
112
115
|
},
|
|
113
116
|
onBlur: e => {
|
|
114
|
-
|
|
115
|
-
onBlur
|
|
117
|
+
var _children$props6, _children$props6$onBl;
|
|
118
|
+
(_children$props6 = children.props) === null || _children$props6 === void 0 || (_children$props6$onBl = _children$props6.onBlur) === null || _children$props6$onBl === void 0 ? void 0 : _children$props6$onBl.call(_children$props6, e);
|
|
119
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
116
120
|
},
|
|
117
|
-
onKeyDown: wrapEvent(children.props
|
|
118
|
-
onClick: wrapEvent(children.props
|
|
121
|
+
onKeyDown: wrapEvent((_children$props7 = children.props) === null || _children$props7 === void 0 ? void 0 : _children$props7.onKeyDown, handleKeyDown),
|
|
122
|
+
onClick: wrapEvent((_children$props8 = children.props) === null || _children$props8 === void 0 ? void 0 : _children$props8.onClick, handleClick)
|
|
119
123
|
}) : /*#__PURE__*/React__default.createElement("button", _extends({}, rest, {
|
|
120
124
|
ref: mergeRefs(ref, buttonRef, dropdownButtonRef),
|
|
121
125
|
type: "button",
|
|
@@ -132,14 +136,14 @@ const DropdownButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
132
136
|
[styles.hasText]: !!label,
|
|
133
137
|
[styles.invalid]: isInvalid,
|
|
134
138
|
[styles.labelled]: hasFormLabel,
|
|
135
|
-
[styles.selected]: externalLabel
|
|
139
|
+
[styles.selected]: externalLabel !== null && externalLabel !== void 0 ? externalLabel : isOptionSelected // defaultLabel has lighter text color
|
|
136
140
|
}),
|
|
137
141
|
|
|
138
142
|
onFocus: onFocus,
|
|
139
143
|
onBlur: onBlur,
|
|
140
144
|
onKeyDown: handleKeyDown,
|
|
141
145
|
onClick: handleClick,
|
|
142
|
-
"data-testid": dataTestId
|
|
146
|
+
"data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : getSubDataTestId(contextDataTestId, 'button')
|
|
143
147
|
}), /*#__PURE__*/React__default.createElement("span", {
|
|
144
148
|
className: classNames(styles.buttonLabel, {
|
|
145
149
|
[styles.isString]: typeof label === 'string'
|
|
@@ -148,7 +152,7 @@ const DropdownButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
148
152
|
size: "medium",
|
|
149
153
|
className: classNames(styles.icon, {
|
|
150
154
|
[styles.open]: isOpen,
|
|
151
|
-
[styles.disabled]: disabled
|
|
155
|
+
[styles.disabled]: disabled !== null && disabled !== void 0 ? disabled : dropdownAriaDisabled
|
|
152
156
|
}),
|
|
153
157
|
"aria-hidden": "true"
|
|
154
158
|
})));
|
|
@@ -47,8 +47,8 @@ const DropdownList = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
47
47
|
translate
|
|
48
48
|
} = useTranslation();
|
|
49
49
|
const noMatchesText = useMemo(() => isSearchable && translate('noMatchesFound'), [isSearchable, translate]);
|
|
50
|
-
const ariaLabelledby = externalAriaLabelledBy
|
|
51
|
-
const ariaLabel = externalAriaLabel
|
|
50
|
+
const ariaLabelledby = externalAriaLabelledBy !== null && externalAriaLabelledBy !== void 0 ? externalAriaLabelledBy : ariaLabelledByFromContext;
|
|
51
|
+
const ariaLabel = externalAriaLabel !== null && externalAriaLabel !== void 0 ? externalAriaLabel : ariaLabelFromContext;
|
|
52
52
|
const announceToScreenReader = useScreenReaderAnnouncement('assertive');
|
|
53
53
|
const showNoResults = useMemo(() => options.filter(option => option.isVisible).length === 1,
|
|
54
54
|
// 1 to include the search box entry
|
|
@@ -79,14 +79,14 @@ const DropdownList = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
79
79
|
"aria-labelledby": ariaLabelledby,
|
|
80
80
|
hidden: !isOpen,
|
|
81
81
|
onKeyDown: e => {
|
|
82
|
-
onKeyDown
|
|
82
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
83
83
|
onKeyDownList(e);
|
|
84
84
|
},
|
|
85
85
|
style: {
|
|
86
86
|
minWidth,
|
|
87
87
|
...style
|
|
88
88
|
},
|
|
89
|
-
"data-testid": dataTestId
|
|
89
|
+
"data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : getSubDataTestId(contextDataTestId, 'flyout')
|
|
90
90
|
}), isSearchable && /*#__PURE__*/React__default.createElement(DropdownSearch, null), /*#__PURE__*/React__default.createElement("div", {
|
|
91
91
|
id: listboxId,
|
|
92
92
|
role: "listbox",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
-
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
3
2
|
import React__default, { useRef, useMemo, useEffect, useCallback } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import styles from './Dropdown2.js';
|
|
@@ -42,12 +41,9 @@ const DropdownOption = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
42
41
|
const {
|
|
43
42
|
setVisibleChildIds
|
|
44
43
|
} = useDropdownHeaderContext();
|
|
45
|
-
const isVisible = useMemo(() =>
|
|
46
|
-
var _context;
|
|
47
|
-
return isSearchFilteringDisabled || !label || !searchValue || typeof label === 'string' && _includesInstanceProperty(_context = label.toLowerCase()).call(_context, searchValue.toLowerCase());
|
|
48
|
-
}, [isSearchFilteringDisabled, label, searchValue]);
|
|
44
|
+
const isVisible = useMemo(() => isSearchFilteringDisabled || !label || !searchValue || typeof label === 'string' && label.toLowerCase().includes(searchValue.toLowerCase()), [isSearchFilteringDisabled, label, searchValue]);
|
|
49
45
|
useEffect(() => {
|
|
50
|
-
setVisibleChildIds
|
|
46
|
+
setVisibleChildIds === null || setVisibleChildIds === void 0 ? void 0 : setVisibleChildIds(visibleChildIds => {
|
|
51
47
|
const duplicateSet = new Set(visibleChildIds);
|
|
52
48
|
if (isVisible) {
|
|
53
49
|
return duplicateSet.add(value);
|
|
@@ -56,7 +52,7 @@ const DropdownOption = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
56
52
|
return duplicateSet;
|
|
57
53
|
});
|
|
58
54
|
}, [setVisibleChildIds, isVisible, value]);
|
|
59
|
-
const isSelected = Array.isArray(selectedValue) ?
|
|
55
|
+
const isSelected = Array.isArray(selectedValue) ? selectedValue.includes(value) : value === selectedValue;
|
|
60
56
|
const handleSelect = useCallback(e => {
|
|
61
57
|
if (!disabled) {
|
|
62
58
|
const handler = wrapEvent(onSelect, () => onOptionSelected(value));
|
|
@@ -74,7 +70,8 @@ const DropdownOption = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
74
70
|
const isHighlighted = highlightedIndex === myIndex && myIndex !== -1;
|
|
75
71
|
useEffect(() => {
|
|
76
72
|
if (isHighlighted) {
|
|
77
|
-
|
|
73
|
+
var _listRef$current, _listRef$current2, _internalRef$current;
|
|
74
|
+
if (isOpen && internalRef !== null && internalRef !== void 0 && internalRef.current && listRef !== null && listRef !== void 0 && listRef.current && ((_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollHeight) > ((_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 ? void 0 : _listRef$current2.clientHeight)) {
|
|
78
75
|
const scrollBottom = listRef.current.clientHeight + listRef.current.scrollTop;
|
|
79
76
|
const elementBottom = internalRef.current.offsetTop + internalRef.current.offsetHeight;
|
|
80
77
|
if (elementBottom > scrollBottom) {
|
|
@@ -83,7 +80,7 @@ const DropdownOption = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
83
80
|
listRef.current.scrollTop = internalRef.current.offsetTop - (isSearchable ? searchHeight : 0);
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
|
-
internalRef.current
|
|
83
|
+
(_internalRef$current = internalRef.current) === null || _internalRef$current === void 0 ? void 0 : _internalRef$current.focus({
|
|
87
84
|
preventScroll: true
|
|
88
85
|
});
|
|
89
86
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
2
1
|
import React__default, { useRef, useMemo, useEffect } from 'react';
|
|
3
2
|
import styles from './Dropdown2.js';
|
|
4
3
|
import '../../utils/index.js';
|
|
@@ -12,6 +11,7 @@ import Input from '../../next/Input/Input.js';
|
|
|
12
11
|
import SearchIcon from '../../icons/components/SearchIcon.js';
|
|
13
12
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
14
13
|
|
|
14
|
+
/* eslint-disable no-nested-ternary */
|
|
15
15
|
const DropdownSearch = /*#__PURE__*/React__default.forwardRef((_, ref) => {
|
|
16
16
|
const {
|
|
17
17
|
translate
|
|
@@ -29,7 +29,10 @@ const DropdownSearch = /*#__PURE__*/React__default.forwardRef((_, ref) => {
|
|
|
29
29
|
dataTestId,
|
|
30
30
|
listboxId
|
|
31
31
|
} = useDropdownContext();
|
|
32
|
-
const handleSelect = () =>
|
|
32
|
+
const handleSelect = () => {
|
|
33
|
+
var _inputRef$current;
|
|
34
|
+
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
35
|
+
};
|
|
33
36
|
const myIndex = useChildIndex({
|
|
34
37
|
element: internalRef.current,
|
|
35
38
|
isVisible: true
|
|
@@ -38,25 +41,28 @@ const DropdownSearch = /*#__PURE__*/React__default.forwardRef((_, ref) => {
|
|
|
38
41
|
useEffect(() => {
|
|
39
42
|
// for keyboard navigation
|
|
40
43
|
if (isHighlighted) {
|
|
41
|
-
|
|
44
|
+
var _inputRef$current2;
|
|
45
|
+
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
|
|
42
46
|
}
|
|
43
47
|
}, [isHighlighted]);
|
|
44
48
|
useEffect(() => {
|
|
45
49
|
// for initial open with mouse
|
|
46
50
|
if (isHighlighted && isOpen) {
|
|
47
|
-
|
|
51
|
+
var _inputRef$current3;
|
|
52
|
+
(_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.focus();
|
|
48
53
|
}
|
|
49
54
|
// Omitted `isHighlighted` because we don't want to focus the input on mouse enter.
|
|
50
55
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
56
|
}, [isOpen]);
|
|
52
57
|
useEffect(() => {
|
|
53
58
|
if (isOpen) {
|
|
54
|
-
|
|
59
|
+
var _internalRef$current;
|
|
60
|
+
setSearchHeight((_internalRef$current = internalRef.current) === null || _internalRef$current === void 0 ? void 0 : _internalRef$current.offsetHeight);
|
|
55
61
|
}
|
|
56
62
|
}, [isOpen, setSearchHeight]);
|
|
57
63
|
const handleKeyDown = e => {
|
|
58
64
|
const keysToAllow = ['ArrowDown', 'Escape', 'Tab', 'PageUp', 'Home', 'PageDown', 'End'];
|
|
59
|
-
if (!
|
|
65
|
+
if (!keysToAllow.includes(e.key)) {
|
|
60
66
|
// `Dropdown` component listens for keystrokes to highlight options with matching labels. We want the focus to remain in the search bar.
|
|
61
67
|
e.stopPropagation();
|
|
62
68
|
}
|
|
@@ -49,8 +49,8 @@ const FilePicker = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
|
|
|
49
49
|
const [filesChanged, setFilesChanged] = useState(false);
|
|
50
50
|
const [files, setFiles] = useControllableState(undefined, undefined, externalFiles);
|
|
51
51
|
const fileInputId = useId(externalId);
|
|
52
|
-
const fileDetailsId =
|
|
53
|
-
const buttonId =
|
|
52
|
+
const fileDetailsId = "".concat(fileInputId, "-fileDetails");
|
|
53
|
+
const buttonId = "".concat(fileInputId, "-button");
|
|
54
54
|
const fileInputRef = useRef(null);
|
|
55
55
|
const buttonRef = useRef(null);
|
|
56
56
|
|
|
@@ -62,12 +62,13 @@ const FilePicker = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
|
|
|
62
62
|
|
|
63
63
|
// returns focus to input after closing system dialog
|
|
64
64
|
useDidUpdate(() => {
|
|
65
|
-
|
|
65
|
+
var _fileInputRef$current;
|
|
66
|
+
(_fileInputRef$current = fileInputRef.current) === null || _fileInputRef$current === void 0 ? void 0 : _fileInputRef$current.focus();
|
|
66
67
|
}, [filesChanged]);
|
|
67
68
|
const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId);
|
|
68
69
|
const handleChange = e => {
|
|
69
70
|
setFiles(e.target.files, e);
|
|
70
|
-
onChange
|
|
71
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
71
72
|
// This is needed due to CFE-508
|
|
72
73
|
setFilesChanged(val => !val);
|
|
73
74
|
};
|
|
@@ -85,10 +86,16 @@ const FilePicker = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
|
|
|
85
86
|
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
86
87
|
disabled: disabled,
|
|
87
88
|
kind: "secondary",
|
|
88
|
-
onClick: () =>
|
|
89
|
+
onClick: () => {
|
|
90
|
+
var _fileInputRef$current2;
|
|
91
|
+
return (_fileInputRef$current2 = fileInputRef.current) === null || _fileInputRef$current2 === void 0 ? void 0 : _fileInputRef$current2.click();
|
|
92
|
+
},
|
|
89
93
|
tabIndex: -1,
|
|
90
94
|
ref: buttonRef,
|
|
91
|
-
onFocus: () =>
|
|
95
|
+
onFocus: () => {
|
|
96
|
+
var _fileInputRef$current3;
|
|
97
|
+
return (_fileInputRef$current3 = fileInputRef.current) === null || _fileInputRef$current3 === void 0 ? void 0 : _fileInputRef$current3.focus();
|
|
98
|
+
},
|
|
92
99
|
id: buttonId,
|
|
93
100
|
"aria-hidden": true
|
|
94
101
|
}, buttonLabel), /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var filePickerStyles = {"container":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._xfGJ4{position:relative}._xfGJ4[focus-within] button{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._xfGJ4:focus-within button{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._W0iEY{opacity:0;position:absolute;height:36px;width:100%;left:0;z-index:-1}._Gx29b{margin-left:16px;font-size:14px;color:#32363a}._Gx29b ._rB3uq{margin-right:16px}";
|
|
4
|
+
var filePickerStyles = {"container":"_xfGJ4","fileInput":"_W0iEY","fileDetails":"_Gx29b","fileName":"_rB3uq"};
|
|
5
|
+
var stylesheet="._xfGJ4{position:relative}._xfGJ4[focus-within] button{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._xfGJ4:focus-within button{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._W0iEY{opacity:0;position:absolute;height:36px;width:100%;left:0;z-index:-1}._Gx29b{margin-left:16px;font-size:14px;color:#32363a}._Gx29b ._rB3uq{margin-right:16px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { filePickerStyles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"caption":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._DWn8p{display:flex;align-items:center;font-size:12px;line-height:16px;min-height:16px}._-L-ZS{color:#74777a;fill:#74777a}._EHEpy{color:#b00;fill:#b00}._2nEI3,._M7aMP{margin-left:-2px;margin-right:3px}";
|
|
4
|
+
var styles = {"caption":"_DWn8p","helperText":"_-L-ZS","errorText":"_EHEpy","errorIcon":"_M7aMP","readOnlyIcon":"_2nEI3"};
|
|
5
|
+
var stylesheet="._DWn8p{display:flex;align-items:center;font-size:12px;line-height:16px;min-height:16px}._-L-ZS{color:#74777a;fill:#74777a}._EHEpy{color:#b00;fill:#b00}._2nEI3,._M7aMP{margin-left:-2px;margin-right:3px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -29,8 +29,8 @@ const FormField = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
29
29
|
const [hasLabel, setHasLabel] = useState(false);
|
|
30
30
|
const [formFieldType, setFormFieldType] = useState('');
|
|
31
31
|
const containerId = useId(externalId);
|
|
32
|
-
const helperTextId = helperText ?
|
|
33
|
-
const errorTextId = errorText ?
|
|
32
|
+
const helperTextId = helperText ? "".concat(containerId, "-helper-text") : undefined;
|
|
33
|
+
const errorTextId = errorText ? "".concat(containerId, "-error-text") : undefined;
|
|
34
34
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
35
35
|
ref: mergeRefs(ref, focusRef),
|
|
36
36
|
className: classNames(className, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"formField":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._PyakO{display:flex;flex-direction:column;align-items:flex-start}._cIThr{margin-top:6px;max-width:100%}._cIThr *+*{margin-top:4px}";
|
|
4
|
+
var styles = {"formField":"_PyakO","captionContainer":"_cIThr"};
|
|
5
|
+
var stylesheet="._PyakO{display:flex;flex-direction:column;align-items:flex-start}._cIThr{margin-top:6px;max-width:100%}._cIThr *+*{margin-top:4px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -12,7 +12,7 @@ const useFormFieldControl = () => {
|
|
|
12
12
|
setHasControl
|
|
13
13
|
} = context;
|
|
14
14
|
useEffect(() => {
|
|
15
|
-
setHasControl
|
|
15
|
+
setHasControl === null || setHasControl === void 0 ? void 0 : setHasControl(true);
|
|
16
16
|
}, [setHasControl]);
|
|
17
17
|
return context;
|
|
18
18
|
};
|
|
@@ -22,7 +22,7 @@ const useFormFieldLabel = () => {
|
|
|
22
22
|
setHasLabel
|
|
23
23
|
} = context;
|
|
24
24
|
useEffect(() => {
|
|
25
|
-
setHasLabel
|
|
25
|
+
setHasLabel === null || setHasLabel === void 0 ? void 0 : setHasLabel(true);
|
|
26
26
|
}, [setHasLabel]);
|
|
27
27
|
return context;
|
|
28
28
|
};
|
|
@@ -32,7 +32,7 @@ const useFormFieldType = type => {
|
|
|
32
32
|
setFormFieldType
|
|
33
33
|
} = context;
|
|
34
34
|
useEffect(() => {
|
|
35
|
-
setFormFieldType
|
|
35
|
+
setFormFieldType === null || setFormFieldType === void 0 ? void 0 : setFormFieldType(type);
|
|
36
36
|
}, [setFormFieldType, type]);
|
|
37
37
|
return context;
|
|
38
38
|
};
|
|
@@ -38,14 +38,16 @@ const FullScreenTakeover = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
// If `focusedElementWhenDialogOpened` has been set, then we know that the element has been opened at least once. Without this check, the component will focus `elementRefToFocusOnClose` on page load.
|
|
40
40
|
if (!isInDOM && focusedElementWhenDialogOpened) {
|
|
41
|
-
|
|
42
|
-
elementToFocus
|
|
41
|
+
var _elementRefToFocusOnC;
|
|
42
|
+
const elementToFocus = (_elementRefToFocusOnC = elementRefToFocusOnClose === null || elementRefToFocusOnClose === void 0 ? void 0 : elementRefToFocusOnClose.current) !== null && _elementRefToFocusOnC !== void 0 ? _elementRefToFocusOnC : focusedElementWhenDialogOpened;
|
|
43
|
+
elementToFocus === null || elementToFocus === void 0 ? void 0 : elementToFocus.focus();
|
|
43
44
|
}
|
|
44
45
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
46
|
}, [isInDOM, focusedElementWhenDialogOpened]);
|
|
46
47
|
const handleAnimationEnd = () => {
|
|
47
48
|
if (isOpen) {
|
|
48
|
-
|
|
49
|
+
var _ref2, _elementRefToFocusOnO;
|
|
50
|
+
(_ref2 = (_elementRefToFocusOnO = elementRefToFocusOnOpen === null || elementRefToFocusOnOpen === void 0 ? void 0 : elementRefToFocusOnOpen.current) !== null && _elementRefToFocusOnO !== void 0 ? _elementRefToFocusOnO : dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.current) === null || _ref2 === void 0 ? void 0 : _ref2.focus();
|
|
49
51
|
} else {
|
|
50
52
|
setIsInDOM(false);
|
|
51
53
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"dialog":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._ox5vY{position:fixed;left:0;top:0;width:100vw;height:100vh;background-color:#fff;overflow:auto}@keyframes _QBFda{0%{transform:scale3d(.7,.7,.7);opacity:0}}._irDJp{animation:_QBFda both;animation-duration:.2s}@keyframes _LAwbO{to{transform:scale3d(.7,.7,.7);opacity:0}}._bkCOe{animation:_LAwbO both;animation-duration:.2s}";
|
|
4
|
+
var styles = {"dialog":"_ox5vY","transitionIn":"_irDJp","showAnimation":"_QBFda","transitionOut":"_bkCOe","hideAnimation":"_LAwbO"};
|
|
5
|
+
var stylesheet="._ox5vY{position:fixed;left:0;top:0;width:100vw;height:100vh;background-color:#fff;overflow:auto}@keyframes _QBFda{0%{transform:scale3d(.7,.7,.7);opacity:0}}._irDJp{animation:_QBFda both;animation-duration:.2s}@keyframes _LAwbO{to{transform:scale3d(.7,.7,.7);opacity:0}}._bkCOe{animation:_LAwbO both;animation-duration:.2s}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -21,7 +21,7 @@ const deprecated = {
|
|
|
21
21
|
function deprecationWarning(type) {
|
|
22
22
|
if (deprecated[type]) {
|
|
23
23
|
// eslint-disable-next-line no-console
|
|
24
|
-
console.warn(
|
|
24
|
+
console.warn("\"IconTypes.".concat(type, "\" has been deprecated! Use \"IconTypes.").concat(deprecated[type], "\" instead."));
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
const Icon = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
@@ -31,7 +31,7 @@ const Icon = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
31
31
|
...rest
|
|
32
32
|
} = _ref;
|
|
33
33
|
// eslint-disable-next-line no-console
|
|
34
|
-
console.warn(
|
|
34
|
+
console.warn("<Icon> component is deprecated! Use individual icon components from the @qualtrics/ui-react/icons import path instead", type);
|
|
35
35
|
deprecationWarning(type);
|
|
36
36
|
const svgContent = IconData[deprecated[type] || type];
|
|
37
37
|
const pixels = IconSizes[size];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"button":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._oL-6j{border-radius:4px;border:none;height:36px;width:36px;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;cursor:pointer;fill:#515559;background-color:transparent;transition:background .2s,color .2s}._oL-6j:focus{outline:none}._oL-6j:hover:not(._jhdYU){background-color:rgba(50,54,58,.08)}._oL-6j:active:not(._jhdYU){background-color:rgba(50,54,58,.11);stroke-width:2}._oL-6j._jhdYU{cursor:not-allowed;fill:rgba(81,85,89,.6)}._oL-6j.focus-visible,._oL-6j:focus-visible{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"button":"_oL-6j","disabled":"_jhdYU"};
|
|
5
|
+
var stylesheet="._oL-6j{border-radius:4px;border:none;height:36px;width:36px;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:0;cursor:pointer;fill:#515559;background-color:transparent;transition:background .2s,color .2s}._oL-6j:focus{outline:none}._oL-6j:hover:not(._jhdYU){background-color:rgba(50,54,58,.08)}._oL-6j:active:not(._jhdYU){background-color:rgba(50,54,58,.11);stroke-width:2}._oL-6j._jhdYU{cursor:not-allowed;fill:rgba(81,85,89,.6)}._oL-6j.focus-visible,._oL-6j:focus-visible{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -32,19 +32,19 @@ const InlineInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
33
33
|
// @ts-ignore: Property 'value' does not exist on type 'HTMLSpanElement'
|
|
34
34
|
e.target.value = newVal;
|
|
35
|
-
onChange
|
|
35
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
36
36
|
setLastVal(newVal);
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
const handleBlur = e => {
|
|
40
40
|
setIsEditing(false);
|
|
41
41
|
e.target.value = e.target.innerText;
|
|
42
|
-
onBlur
|
|
42
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
43
43
|
};
|
|
44
44
|
const handleFocus = e => {
|
|
45
45
|
setIsEditing(true);
|
|
46
46
|
e.target.value = e.target.innerText;
|
|
47
|
-
onFocus
|
|
47
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
48
48
|
};
|
|
49
49
|
const handleKeyDown = e => {
|
|
50
50
|
if (e.key === 'Enter') {
|
|
@@ -55,13 +55,13 @@ const InlineInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
55
55
|
e.stopPropagation(); // prevent event from closing modals or popovers
|
|
56
56
|
setIsEditing(false);
|
|
57
57
|
}
|
|
58
|
-
onKeyDown
|
|
58
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
59
59
|
};
|
|
60
60
|
const handleMouseDown = e => {
|
|
61
61
|
if (isFocused) {
|
|
62
62
|
setIsEditing(true);
|
|
63
63
|
}
|
|
64
|
-
onMouseDown
|
|
64
|
+
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(e);
|
|
65
65
|
};
|
|
66
66
|
const handlePaste = e => {
|
|
67
67
|
// Strip formatting and newlines from pasted data
|
|
@@ -69,7 +69,7 @@ const InlineInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
69
69
|
e.preventDefault(); // prevent paste and manually insert text after stripping formatting
|
|
70
70
|
const text = e.clipboardData.getData('text').replace(/[\n\r]/g, ' ');
|
|
71
71
|
const selection = window.getSelection();
|
|
72
|
-
const range = selection
|
|
72
|
+
const range = selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0);
|
|
73
73
|
if (range && selection) {
|
|
74
74
|
range.deleteContents();
|
|
75
75
|
const textNode = document.createTextNode(text);
|
|
@@ -84,13 +84,16 @@ const InlineInput = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
84
84
|
};
|
|
85
85
|
useDidUpdate(() => {
|
|
86
86
|
if (typeof window !== 'undefined') {
|
|
87
|
+
var _window$getSelection2;
|
|
87
88
|
if (isEditing && isFocused && internalRef.current) {
|
|
88
|
-
|
|
89
|
+
var _window$getSelection;
|
|
90
|
+
(_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.selectAllChildren(internalRef.current);
|
|
89
91
|
}
|
|
90
92
|
// Clear window selection only if it is on the InlineInput. Without this check, we would mistakenly clear the
|
|
91
93
|
// selection after focus moves from this component to an Input or another component that sets the window selection.
|
|
92
|
-
else if (internalRef.current && window.getSelection()
|
|
93
|
-
|
|
94
|
+
else if (internalRef.current && (_window$getSelection2 = window.getSelection()) !== null && _window$getSelection2 !== void 0 && _window$getSelection2.containsNode(internalRef.current, true)) {
|
|
95
|
+
var _window$getSelection3;
|
|
96
|
+
(_window$getSelection3 = window.getSelection()) === null || _window$getSelection3 === void 0 ? void 0 : _window$getSelection3.removeAllRanges();
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
}, [isEditing, isFocused]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"container":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._vJ1Cu{display:inline-block}._pfxbp{color:#085caf;cursor:pointer;font-size:14px;box-sizing:border-box;padding:4px;margin:-5px;outline:0;border:1px solid transparent;border-radius:4px;background-clip:padding-box;display:block}._pfxbp::-moz-selection{background-color:rgba(11,110,208,.11)}._pfxbp::selection{background-color:rgba(11,110,208,.11)}._pfxbp:focus,._pfxbp:hover{background-color:#f5f5f5}._pfxbp:focus{border:2px solid #0a3f88;padding:3px}._pfxbp:focus._uVKuJ{background-color:#fafafa;cursor:text;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 1px 8px hsla(0,0%,66.7%,.5)}";
|
|
4
|
+
var styles = {"container":"_vJ1Cu","inlineInput":"_pfxbp","isEditing":"_uVKuJ"};
|
|
5
|
+
var stylesheet="._vJ1Cu{display:inline-block}._pfxbp{color:#085caf;cursor:pointer;font-size:14px;box-sizing:border-box;padding:4px;margin:-5px;outline:0;border:1px solid transparent;border-radius:4px;background-clip:padding-box;display:block}._pfxbp::-moz-selection{background-color:rgba(11,110,208,.11)}._pfxbp::selection{background-color:rgba(11,110,208,.11)}._pfxbp:focus,._pfxbp:hover{background-color:#f5f5f5}._pfxbp:focus{border:2px solid #0a3f88;padding:3px}._pfxbp:focus._uVKuJ{background-color:#fafafa;cursor:text;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 1px 8px hsla(0,0%,66.7%,.5)}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -47,7 +47,7 @@ const Input = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
47
47
|
onChange: disabled ? null : onChange,
|
|
48
48
|
value,
|
|
49
49
|
'aria-describedby': internalAriaDescribedby,
|
|
50
|
-
readOnly: readOnly
|
|
50
|
+
readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : formFieldIsReadOnly
|
|
51
51
|
};
|
|
52
52
|
return multiline ? /*#__PURE__*/React__default.createElement("textarea", _extends({}, commonProps, {
|
|
53
53
|
rows: rows
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"input":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._UI-Q6{display:inline-block;height:36px;min-height:36px;padding:8px 12px;line-height:20px;font-size:14px;color:#32363a;caret-color:#32363a;background-color:#fafafa;border:1px solid #898989;border-radius:4px;outline:none}._UI-Q6::-moz-placeholder{color:#515559;opacity:1}._UI-Q6::placeholder{color:#515559;opacity:1}._UI-Q6:hover{cursor:pointer;background-color:#f5f5f5}._UI-Q6:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fafafa;cursor:text;outline:none;border-color:transparent}._UI-Q6._jTMbC{border-color:#b00}._UI-Q6._jTMbC:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000;border-color:transparent}._UI-Q6:disabled{background-color:#fafafa;border-color:#e5e5e5;color:#9d9fa1;-webkit-text-fill-color:#9d9fa1;cursor:not-allowed}._UI-Q6:disabled::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._UI-Q6:disabled::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._UI-Q6._quq1x{height:auto}._UI-Q6._quq1x::-webkit-resizer{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03IDF2M2EzIDMgMCAwMS0zIDNIMSIgc3Ryb2tlPSIjOTI5MjkyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==);background-size:8px 8px;background-repeat:no-repeat;background-position:50%}._UI-Q6._8ew-r{display:block;width:100%}._UI-Q6._rkpMg{padding:4px 8px}input._UI-Q6._rkpMg{height:26px;min-height:26px}[type=number]._UI-Q6{-moz-appearance:textfield}[type=number]._UI-Q6::-webkit-inner-spin-button,[type=number]._UI-Q6::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._9qSWw{line-height:20px;color:#6a6d70;display:flex;flex-direction:column;align-items:flex-start}._9qSWw:hover{cursor:pointer}._9qSWw._TbI3j{color:#0b6ed0}._INB7-{margin-top:4px}";
|
|
4
|
+
var styles = {"input":"_UI-Q6","invalid":"_jTMbC","multiline":"_quq1x","full":"_8ew-r","small":"_rkpMg","label":"_9qSWw","focused":"_TbI3j","wrappedInput":"_INB7-"};
|
|
5
|
+
var stylesheet="._UI-Q6{display:inline-block;height:36px;min-height:36px;padding:8px 12px;line-height:20px;font-size:14px;color:#32363a;caret-color:#32363a;background-color:#fafafa;border:1px solid #898989;border-radius:4px;outline:none}._UI-Q6::-moz-placeholder{color:#515559;opacity:1}._UI-Q6::placeholder{color:#515559;opacity:1}._UI-Q6:hover{cursor:pointer;background-color:#f5f5f5}._UI-Q6:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fafafa;cursor:text;outline:none;border-color:transparent}._UI-Q6._jTMbC{border-color:#b00}._UI-Q6._jTMbC:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000;border-color:transparent}._UI-Q6:disabled{background-color:#fafafa;border-color:#e5e5e5;color:#9d9fa1;-webkit-text-fill-color:#9d9fa1;cursor:not-allowed}._UI-Q6:disabled::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._UI-Q6:disabled::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._UI-Q6._quq1x{height:auto}._UI-Q6._quq1x::-webkit-resizer{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03IDF2M2EzIDMgMCAwMS0zIDNIMSIgc3Ryb2tlPSIjOTI5MjkyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==);background-size:8px 8px;background-repeat:no-repeat;background-position:50%}._UI-Q6._8ew-r{display:block;width:100%}._UI-Q6._rkpMg{padding:4px 8px}input._UI-Q6._rkpMg{height:26px;min-height:26px}[type=number]._UI-Q6{-moz-appearance:textfield}[type=number]._UI-Q6::-webkit-inner-spin-button,[type=number]._UI-Q6::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._9qSWw{line-height:20px;color:#6a6d70;display:flex;flex-direction:column;align-items:flex-start}._9qSWw:hover{cursor:pointer}._9qSWw._TbI3j{color:#0b6ed0}._INB7-{margin-top:4px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|