@transferwise/components 0.0.0-experimental-5e2f01a → 0.0.0-experimental-d8ad171
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/build/es/no-polyfill/accordion/Accordion.js +1 -1
- package/build/es/no-polyfill/accordion/Accordion.story.js +1 -1
- package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.spec.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/no-polyfill/actionOption/ActionOption.js +1 -1
- package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
- package/build/es/no-polyfill/alert/Alert.js +1 -1
- package/build/es/no-polyfill/alert/Alert.story.js +1 -1
- package/build/es/no-polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
- package/build/es/no-polyfill/alert/withArrow/alertArrowPositions.js +1 -1
- package/build/es/no-polyfill/alert/withArrow/withArrow.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.story.js +1 -1
- package/build/es/no-polyfill/avatar/avatarTypes.js +1 -1
- package/build/es/no-polyfill/avatar/colors/colors.js +2 -2
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
- package/build/es/no-polyfill/badge/Badge.js +1 -1
- package/build/es/no-polyfill/body/Body.js +2 -2
- package/build/es/no-polyfill/body/Body.spec.js +1 -1
- package/build/es/no-polyfill/body/Body.story.js +1 -1
- package/build/es/no-polyfill/button/Button.js +5 -5
- package/build/es/no-polyfill/button/Button.story.js +1 -1
- package/build/es/no-polyfill/button/classMap.js +1 -1
- package/build/es/no-polyfill/button/legacyUtils/legacyUtils.js +2 -2
- package/build/es/no-polyfill/card/Card.js +1 -1
- package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/no-polyfill/checkbox/Checkbox.story.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.story.js +1 -1
- package/build/es/no-polyfill/chevron/Chevron.js +1 -1
- package/build/es/no-polyfill/chevron/Chevron.story.js +1 -1
- package/build/es/no-polyfill/chips/Chip.js +1 -1
- package/build/es/no-polyfill/chips/Chips.js +1 -1
- package/build/es/no-polyfill/chips/Chips.spec.js +1 -1
- package/build/es/no-polyfill/chips/Chips.story.js +1 -1
- package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/no-polyfill/common/DOMOperations/DOMOperations.js +3 -3
- package/build/es/no-polyfill/common/Option/Option.js +1 -1
- package/build/es/no-polyfill/common/RadioButton/RadioButton.js +1 -1
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +4 -4
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
- package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/no-polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
- package/build/es/no-polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
- package/build/es/no-polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
- package/build/es/no-polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
- package/build/es/no-polyfill/common/deviceDetection/deviceDetection.js +1 -1
- package/build/es/no-polyfill/common/direction.js +1 -1
- package/build/es/no-polyfill/common/domHelpers/index.js +1 -1
- package/build/es/no-polyfill/common/fakeEvents.js +1 -1
- package/build/es/no-polyfill/common/fileType.js +1 -1
- package/build/es/no-polyfill/common/flowHeader/FlowHeader.js +1 -1
- package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.js +1 -1
- package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
- package/build/es/no-polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
- package/build/es/no-polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
- package/build/es/no-polyfill/common/historyNavigator/historyNavigator.js +1 -1
- package/build/es/no-polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
- package/build/es/no-polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
- package/build/es/no-polyfill/common/hooks/useDirection/useDirection.js +1 -1
- package/build/es/no-polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
- package/build/es/no-polyfill/common/hooks/useLayout/useLayout.js +1 -1
- package/build/es/no-polyfill/common/key.js +1 -1
- package/build/es/no-polyfill/common/locale/index.js +7 -7
- package/build/es/no-polyfill/common/panel/Panel.js +6 -6
- package/build/es/no-polyfill/common/propsValues/breakpoint.js +1 -1
- package/build/es/no-polyfill/common/propsValues/control.js +1 -1
- package/build/es/no-polyfill/common/propsValues/dateMode.js +1 -1
- package/build/es/no-polyfill/common/propsValues/layouts.js +1 -1
- package/build/es/no-polyfill/common/propsValues/markdownNodeType.js +1 -1
- package/build/es/no-polyfill/common/propsValues/monthFormat.js +1 -1
- package/build/es/no-polyfill/common/propsValues/position.js +1 -1
- package/build/es/no-polyfill/common/propsValues/profileType.js +1 -1
- package/build/es/no-polyfill/common/propsValues/scroll.js +1 -1
- package/build/es/no-polyfill/common/propsValues/sentiment.js +1 -1
- package/build/es/no-polyfill/common/propsValues/size.js +1 -1
- package/build/es/no-polyfill/common/propsValues/status.js +1 -1
- package/build/es/no-polyfill/common/propsValues/type.js +1 -1
- package/build/es/no-polyfill/common/propsValues/typography.js +1 -1
- package/build/es/no-polyfill/common/propsValues/variant.js +1 -1
- package/build/es/no-polyfill/common/propsValues/width.js +1 -1
- package/build/es/no-polyfill/common/requirements.js +2 -2
- package/build/es/no-polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
- package/build/es/no-polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
- package/build/es/no-polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
- package/build/es/no-polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
- package/build/es/no-polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
- package/build/es/no-polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
- package/build/es/no-polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
- package/build/es/no-polyfill/common/theme.js +1 -1
- package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
- package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
- package/build/es/no-polyfill/dateInput/DateInput.js +4 -10
- package/build/es/no-polyfill/dateInput/DateInput.story.js +1 -1
- package/build/es/no-polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
- package/build/es/no-polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
- package/build/es/no-polyfill/dateLookup/DateLookup.js +3 -4
- package/build/es/no-polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/no-polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
- package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
- package/build/es/no-polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
- package/build/es/no-polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/es/no-polyfill/dateLookup/tableLink/TableLink.js +1 -1
- package/build/es/no-polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
- package/build/es/no-polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
- package/build/es/no-polyfill/decision/Decision.js +5 -5
- package/build/es/no-polyfill/decision/decisionEnums.js +2 -2
- package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/no-polyfill/dimmer/Dimmer.js +3 -3
- package/build/es/no-polyfill/dimmer/Dimmer.story.js +2 -2
- package/build/es/no-polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
- package/build/es/no-polyfill/display/Display.js +1 -1
- package/build/es/no-polyfill/display/Display.story.js +2 -2
- package/build/es/no-polyfill/drawer/Drawer.js +1 -1
- package/build/es/no-polyfill/dropFade/DropFade.js +3 -3
- package/build/es/no-polyfill/dropFade/DropFade.story.js +1 -1
- package/build/es/no-polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/no-polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
- package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
- package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
- package/build/es/no-polyfill/emphasis/Emphasis.js +2 -2
- package/build/es/no-polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
- package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
- package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
- package/build/es/no-polyfill/header/Header.js +2 -2
- package/build/es/no-polyfill/header/Header.spec.js +1 -1
- package/build/es/no-polyfill/header/Header.story.js +2 -1
- package/build/es/no-polyfill/i18n/index.js +1 -1
- package/build/es/no-polyfill/image/Image.js +2 -2
- package/build/es/no-polyfill/info/Info.js +1 -1
- package/build/es/no-polyfill/info/Info.story.js +1 -1
- package/build/es/no-polyfill/info/infoPresentations.js +1 -1
- package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
- package/build/es/no-polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
- package/build/es/no-polyfill/inputs/Input.js +1 -1
- package/build/es/no-polyfill/inputs/TextArea.js +1 -1
- package/build/es/no-polyfill/inputs/_common.js +2 -2
- package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/no-polyfill/link/Link.js +2 -2
- package/build/es/no-polyfill/link/Link.spec.js +1 -1
- package/build/es/no-polyfill/link/Link.story.js +1 -1
- package/build/es/no-polyfill/listItem/ListItem.js +1 -1
- package/build/es/no-polyfill/listItem/ListItem.spec.js +1 -1
- package/build/es/no-polyfill/listItem/ListItem.story.js +1 -1
- package/build/es/no-polyfill/loader/Loader.js +2 -2
- package/build/es/no-polyfill/loader/Loader.story.js +1 -1
- package/build/es/no-polyfill/logo/Logo.js +1 -1
- package/build/es/no-polyfill/logo/Logo.story.js +1 -1
- package/build/es/no-polyfill/logo/logoTypes.js +1 -1
- package/build/es/no-polyfill/markdown/Markdown.js +1 -1
- package/build/es/no-polyfill/modal/Modal.js +1 -1
- package/build/es/no-polyfill/modal/Modal.story.js +2 -2
- package/build/es/no-polyfill/money/Money.js +1 -1
- package/build/es/no-polyfill/money/Money.story.js +1 -1
- package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/no-polyfill/moneyInput/MoneyInput.story.js +1 -1
- package/build/es/no-polyfill/moneyInput/currencyFormatting.js +2 -2
- package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
- package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
- package/build/es/no-polyfill/nudge/Nudge.js +1 -1
- package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +2 -2
- package/build/es/no-polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
- package/build/es/no-polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
- package/build/es/no-polyfill/popover/Popover.js +2 -2
- package/build/es/no-polyfill/processIndicator/ProcessIndicator.js +4 -4
- package/build/es/no-polyfill/progress/Progress.js +1 -1
- package/build/es/no-polyfill/progress/Progress.story.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
- package/build/es/no-polyfill/provider/Provider.js +1 -1
- package/build/es/no-polyfill/provider/Provider.spec.js +1 -1
- package/build/es/no-polyfill/provider/Provider.story.js +1 -1
- package/build/es/no-polyfill/provider/direction/DirectionProvider.js +1 -1
- package/build/es/no-polyfill/provider/direction/DirectionProvider.spec.js +1 -1
- package/build/es/no-polyfill/provider/language/LanguageProvider.js +1 -1
- package/build/es/no-polyfill/provider/language/LanguageProvider.spec.js +1 -1
- package/build/es/no-polyfill/radio/Radio.js +1 -1
- package/build/es/no-polyfill/radioGroup/RadioGroup.js +2 -2
- package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/no-polyfill/section/Section.js +1 -1
- package/build/es/no-polyfill/section/Section.spec.js +1 -1
- package/build/es/no-polyfill/section/Section.story.js +1 -1
- package/build/es/no-polyfill/select/Select.js +8 -9
- package/build/es/no-polyfill/select/option/Option.js +1 -1
- package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
- package/build/es/no-polyfill/sizeSwapper/SizeSwapper.js +3 -3
- package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +2 -2
- package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/no-polyfill/snackbar/SnackbarContext.js +1 -1
- package/build/es/no-polyfill/snackbar/SnackbarProvider.js +1 -1
- package/build/es/no-polyfill/snackbar/useSnackbar.js +1 -1
- package/build/es/no-polyfill/statusIcon/StatusIcon.js +1 -1
- package/build/es/no-polyfill/statusIcon/StatusIcon.story.js +1 -1
- package/build/es/no-polyfill/stepper/Stepper.js +1 -1
- package/build/es/no-polyfill/stepper/deviceDetection.js +2 -2
- package/build/es/no-polyfill/sticky/Sticky.js +1 -1
- package/build/es/no-polyfill/summary/Summary.js +1 -1
- package/build/es/no-polyfill/switch/Switch.js +1 -1
- package/build/es/no-polyfill/switch/Switch.story.js +1 -1
- package/build/es/no-polyfill/switchOption/SwitchOption.js +1 -1
- package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
- package/build/es/no-polyfill/tabs/Tab.js +1 -1
- package/build/es/no-polyfill/tabs/TabList.js +1 -1
- package/build/es/no-polyfill/tabs/TabPanel.js +1 -1
- package/build/es/no-polyfill/tabs/Tabs.js +1 -5
- package/build/es/no-polyfill/tabs/utils.js +2 -2
- package/build/es/no-polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
- package/build/es/no-polyfill/tile/Tile.js +1 -1
- package/build/es/no-polyfill/title/Title.js +1 -1
- package/build/es/no-polyfill/title/Title.spec.js +1 -1
- package/build/es/no-polyfill/title/Title.story.js +1 -1
- package/build/es/no-polyfill/tooltip/Tooltip.js +7 -7
- package/build/es/no-polyfill/tooltip/Tooltip.spec.js +1 -1
- package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/es/no-polyfill/typeahead/Typeahead.js +1 -1
- package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
- package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/no-polyfill/typeahead/util/highlight.js +1 -1
- package/build/es/no-polyfill/upload/Upload.js +2 -6
- package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/es/no-polyfill/upload/uploadSteps.js +1 -1
- package/build/es/no-polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
- package/build/es/no-polyfill/upload/utils/getFileType/getFileType.js +1 -1
- package/build/es/no-polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
- package/build/es/no-polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
- package/build/es/no-polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
- package/build/es/no-polyfill/upload/utils/postData/postData.js +1 -1
- package/build/es/no-polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
- package/build/es/no-polyfill/uploadInput/UploadInput.js +7 -7
- package/build/es/no-polyfill/uploadInput/UploadInput.spec.js +1 -1
- package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
- package/build/es/no-polyfill/uploadInput/uploadButton/defaults.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
- package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
- package/build/es/no-polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
- package/build/es/no-polyfill/utilities/logActionRequired.js +1 -1
- package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
- package/build/es/no-polyfill/withNextPortal/withNextPortal.js +1 -1
- package/build/es/polyfill/accordion/Accordion.js +1 -1
- package/build/es/polyfill/accordion/Accordion.story.js +1 -1
- package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/polyfill/actionOption/ActionOption.js +1 -1
- package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
- package/build/es/polyfill/alert/Alert.js +1 -1
- package/build/es/polyfill/alert/Alert.story.js +1 -1
- package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
- package/build/es/polyfill/alert/withArrow/alertArrowPositions.js +1 -1
- package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
- package/build/es/polyfill/avatar/Avatar.js +1 -1
- package/build/es/polyfill/avatar/Avatar.story.js +1 -1
- package/build/es/polyfill/avatar/avatarTypes.js +1 -1
- package/build/es/polyfill/avatar/colors/colors.js +2 -2
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
- package/build/es/polyfill/badge/Badge.js +1 -1
- package/build/es/polyfill/body/Body.js +2 -2
- package/build/es/polyfill/body/Body.spec.js +1 -1
- package/build/es/polyfill/body/Body.story.js +1 -1
- package/build/es/polyfill/button/Button.js +5 -5
- package/build/es/polyfill/button/Button.story.js +1 -1
- package/build/es/polyfill/button/classMap.js +1 -1
- package/build/es/polyfill/button/legacyUtils/legacyUtils.js +2 -2
- package/build/es/polyfill/card/Card.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.story.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
- package/build/es/polyfill/chevron/Chevron.js +1 -1
- package/build/es/polyfill/chevron/Chevron.story.js +1 -1
- package/build/es/polyfill/chips/Chip.js +1 -1
- package/build/es/polyfill/chips/Chips.js +1 -1
- package/build/es/polyfill/chips/Chips.spec.js +1 -1
- package/build/es/polyfill/chips/Chips.story.js +1 -1
- package/build/es/polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/polyfill/common/DOMOperations/DOMOperations.js +3 -3
- package/build/es/polyfill/common/Option/Option.js +1 -1
- package/build/es/polyfill/common/RadioButton/RadioButton.js +1 -1
- package/build/es/polyfill/common/bottomSheet/BottomSheet.js +4 -4
- package/build/es/polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
- package/build/es/polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
- package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
- package/build/es/polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
- package/build/es/polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
- package/build/es/polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
- package/build/es/polyfill/common/deviceDetection/deviceDetection.js +1 -1
- package/build/es/polyfill/common/direction.js +1 -1
- package/build/es/polyfill/common/domHelpers/index.js +1 -1
- package/build/es/polyfill/common/fakeEvents.js +1 -1
- package/build/es/polyfill/common/fileType.js +1 -1
- package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
- package/build/es/polyfill/common/focusBoundary/FocusBoundary.js +1 -1
- package/build/es/polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
- package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
- package/build/es/polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
- package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
- package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
- package/build/es/polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
- package/build/es/polyfill/common/hooks/useDirection/useDirection.js +1 -1
- package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
- package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
- package/build/es/polyfill/common/key.js +1 -1
- package/build/es/polyfill/common/locale/index.js +8 -8
- package/build/es/polyfill/common/panel/Panel.js +6 -6
- package/build/es/polyfill/common/propsValues/breakpoint.js +1 -1
- package/build/es/polyfill/common/propsValues/control.js +1 -1
- package/build/es/polyfill/common/propsValues/dateMode.js +1 -1
- package/build/es/polyfill/common/propsValues/layouts.js +1 -1
- package/build/es/polyfill/common/propsValues/markdownNodeType.js +1 -1
- package/build/es/polyfill/common/propsValues/monthFormat.js +1 -1
- package/build/es/polyfill/common/propsValues/position.js +1 -1
- package/build/es/polyfill/common/propsValues/profileType.js +1 -1
- package/build/es/polyfill/common/propsValues/scroll.js +1 -1
- package/build/es/polyfill/common/propsValues/sentiment.js +1 -1
- package/build/es/polyfill/common/propsValues/size.js +1 -1
- package/build/es/polyfill/common/propsValues/status.js +1 -1
- package/build/es/polyfill/common/propsValues/type.js +1 -1
- package/build/es/polyfill/common/propsValues/typography.js +1 -1
- package/build/es/polyfill/common/propsValues/variant.js +1 -1
- package/build/es/polyfill/common/propsValues/width.js +1 -1
- package/build/es/polyfill/common/requirements.js +2 -2
- package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
- package/build/es/polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
- package/build/es/polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
- package/build/es/polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
- package/build/es/polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
- package/build/es/polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
- package/build/es/polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
- package/build/es/polyfill/common/theme.js +1 -1
- package/build/es/polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
- package/build/es/polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
- package/build/es/polyfill/dateInput/DateInput.js +4 -10
- package/build/es/polyfill/dateInput/DateInput.story.js +1 -1
- package/build/es/polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
- package/build/es/polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
- package/build/es/polyfill/dateLookup/DateLookup.js +3 -4
- package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
- package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
- package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
- package/build/es/polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
- package/build/es/polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
- package/build/es/polyfill/decision/Decision.js +5 -5
- package/build/es/polyfill/decision/decisionEnums.js +2 -2
- package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/polyfill/dimmer/Dimmer.js +3 -3
- package/build/es/polyfill/dimmer/Dimmer.story.js +2 -2
- package/build/es/polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
- package/build/es/polyfill/display/Display.js +1 -1
- package/build/es/polyfill/display/Display.story.js +2 -2
- package/build/es/polyfill/drawer/Drawer.js +1 -1
- package/build/es/polyfill/dropFade/DropFade.js +3 -3
- package/build/es/polyfill/dropFade/DropFade.story.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -2
- package/build/es/polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
- package/build/es/polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
- package/build/es/polyfill/emphasis/Emphasis.js +2 -2
- package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
- package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
- package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
- package/build/es/polyfill/header/Header.js +2 -2
- package/build/es/polyfill/header/Header.spec.js +1 -1
- package/build/es/polyfill/header/Header.story.js +2 -1
- package/build/es/polyfill/i18n/index.js +1 -1
- package/build/es/polyfill/image/Image.js +2 -2
- package/build/es/polyfill/info/Info.js +1 -1
- package/build/es/polyfill/info/Info.story.js +1 -1
- package/build/es/polyfill/info/infoPresentations.js +1 -1
- package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
- package/build/es/polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
- package/build/es/polyfill/inputs/Input.js +1 -1
- package/build/es/polyfill/inputs/TextArea.js +1 -1
- package/build/es/polyfill/inputs/_common.js +2 -2
- package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/polyfill/link/Link.js +2 -2
- package/build/es/polyfill/link/Link.spec.js +1 -1
- package/build/es/polyfill/link/Link.story.js +1 -1
- package/build/es/polyfill/listItem/ListItem.js +1 -1
- package/build/es/polyfill/listItem/ListItem.spec.js +1 -1
- package/build/es/polyfill/listItem/ListItem.story.js +1 -1
- package/build/es/polyfill/loader/Loader.js +2 -2
- package/build/es/polyfill/loader/Loader.story.js +1 -1
- package/build/es/polyfill/logo/Logo.js +1 -1
- package/build/es/polyfill/logo/Logo.story.js +1 -1
- package/build/es/polyfill/logo/logoTypes.js +1 -1
- package/build/es/polyfill/markdown/Markdown.js +1 -1
- package/build/es/polyfill/modal/Modal.js +1 -1
- package/build/es/polyfill/modal/Modal.story.js +2 -2
- package/build/es/polyfill/money/Money.js +1 -1
- package/build/es/polyfill/money/Money.story.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.story.js +1 -1
- package/build/es/polyfill/moneyInput/currencyFormatting.js +3 -3
- package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
- package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
- package/build/es/polyfill/nudge/Nudge.js +1 -1
- package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
- package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +3 -3
- package/build/es/polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
- package/build/es/polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
- package/build/es/polyfill/popover/Popover.js +2 -2
- package/build/es/polyfill/processIndicator/ProcessIndicator.js +4 -4
- package/build/es/polyfill/progress/Progress.js +1 -1
- package/build/es/polyfill/progress/Progress.story.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
- package/build/es/polyfill/provider/Provider.js +1 -1
- package/build/es/polyfill/provider/Provider.spec.js +1 -1
- package/build/es/polyfill/provider/Provider.story.js +1 -1
- package/build/es/polyfill/provider/direction/DirectionProvider.js +1 -1
- package/build/es/polyfill/provider/direction/DirectionProvider.spec.js +1 -1
- package/build/es/polyfill/provider/language/LanguageProvider.js +1 -1
- package/build/es/polyfill/provider/language/LanguageProvider.spec.js +1 -1
- package/build/es/polyfill/radio/Radio.js +1 -1
- package/build/es/polyfill/radioGroup/RadioGroup.js +2 -2
- package/build/es/polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/polyfill/section/Section.js +1 -1
- package/build/es/polyfill/section/Section.spec.js +1 -1
- package/build/es/polyfill/section/Section.story.js +1 -1
- package/build/es/polyfill/select/Select.js +8 -9
- package/build/es/polyfill/select/option/Option.js +2 -2
- package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
- package/build/es/polyfill/sizeSwapper/SizeSwapper.js +3 -3
- package/build/es/polyfill/slidingPanel/SlidingPanel.js +2 -2
- package/build/es/polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/polyfill/snackbar/SnackbarContext.js +1 -1
- package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
- package/build/es/polyfill/snackbar/useSnackbar.js +1 -1
- package/build/es/polyfill/statusIcon/StatusIcon.js +1 -1
- package/build/es/polyfill/statusIcon/StatusIcon.story.js +1 -1
- package/build/es/polyfill/stepper/Stepper.js +1 -1
- package/build/es/polyfill/stepper/deviceDetection.js +2 -2
- package/build/es/polyfill/sticky/Sticky.js +1 -1
- package/build/es/polyfill/summary/Summary.js +1 -1
- package/build/es/polyfill/switch/Switch.js +1 -1
- package/build/es/polyfill/switch/Switch.story.js +1 -1
- package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
- package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
- package/build/es/polyfill/tabs/Tab.js +1 -1
- package/build/es/polyfill/tabs/TabList.js +1 -1
- package/build/es/polyfill/tabs/TabPanel.js +1 -1
- package/build/es/polyfill/tabs/Tabs.js +1 -5
- package/build/es/polyfill/tabs/utils.js +2 -2
- package/build/es/polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
- package/build/es/polyfill/tile/Tile.js +1 -1
- package/build/es/polyfill/title/Title.js +1 -1
- package/build/es/polyfill/title/Title.spec.js +1 -1
- package/build/es/polyfill/title/Title.story.js +1 -1
- package/build/es/polyfill/tooltip/Tooltip.js +7 -7
- package/build/es/polyfill/tooltip/Tooltip.spec.js +1 -1
- package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/es/polyfill/typeahead/Typeahead.js +1 -1
- package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
- package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/polyfill/typeahead/util/highlight.js +1 -1
- package/build/es/polyfill/upload/Upload.js +2 -6
- package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
- package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
- package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/es/polyfill/upload/uploadSteps.js +1 -1
- package/build/es/polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
- package/build/es/polyfill/upload/utils/getFileType/getFileType.js +1 -1
- package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +2 -2
- package/build/es/polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
- package/build/es/polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
- package/build/es/polyfill/upload/utils/postData/postData.js +1 -1
- package/build/es/polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
- package/build/es/polyfill/uploadInput/UploadInput.js +7 -7
- package/build/es/polyfill/uploadInput/UploadInput.spec.js +1 -1
- package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
- package/build/es/polyfill/uploadInput/uploadButton/defaults.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
- package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
- package/build/es/polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
- package/build/es/polyfill/utilities/logActionRequired.js +1 -1
- package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
- package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
- package/build/main.css +1 -4236
- package/build/styles/accordion/Accordion.css +1 -59
- package/build/styles/actionButton/ActionButton.css +1 -41
- package/build/styles/avatar/Avatar.css +1 -240
- package/build/styles/badge/Badge.css +1 -66
- package/build/styles/button/Button.css +1 -17
- package/build/styles/card/Card.css +1 -88
- package/build/styles/checkboxButton/CheckboxButton.css +1 -21
- package/build/styles/chips/Chip.css +1 -169
- package/build/styles/circularButton/CircularButton.css +1 -175
- package/build/styles/common/Option/Option.css +1 -74
- package/build/styles/common/RadioButton/RadioButton.css +1 -3
- package/build/styles/common/bottomSheet/BottomSheet.css +1 -44
- package/build/styles/common/closeButton/CloseButton.css +1 -44
- package/build/styles/common/panel/Panel.css +1 -67
- package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -73
- package/build/styles/dateInput/DateInput.css +1 -3
- package/build/styles/dateLookup/DateLookup.css +1 -80
- package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -53
- package/build/styles/decision/Decision.css +1 -69
- package/build/styles/definitionList/DefinitionList.css +1 -48
- package/build/styles/dimmer/Dimmer.css +1 -68
- package/build/styles/drawer/Drawer.css +1 -77
- package/build/styles/dropFade/DropFade.css +1 -19
- package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +1 -4
- package/build/styles/emphasis/Emphasis.css +1 -25
- package/build/styles/flowNavigation/FlowNavigation.css +1 -85
- package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -26
- package/build/styles/flowNavigation/backButton/BackButton.css +1 -28
- package/build/styles/header/Header.css +1 -20
- package/build/styles/image/Image.css +1 -12
- package/build/styles/info/Info.css +1 -37
- package/build/styles/inputs/Input.css +1 -53
- package/build/styles/inputs/TextArea.css +1 -59
- package/build/styles/instructionsList/InstructionsList.css +1 -30
- package/build/styles/link/Link.css +1 -12
- package/build/styles/listItem/ListItem.css +1 -6
- package/build/styles/loader/Loader.css +1 -294
- package/build/styles/logo/Logo.css +1 -10
- package/build/styles/main.css +1 -4236
- package/build/styles/modal/Modal.css +1 -133
- package/build/styles/moneyInput/MoneyInput.css +1 -128
- package/build/styles/navigationOption/NavigationOption.css +1 -61
- package/build/styles/navigationOptionsList/NavigationOptionsList.css +1 -12
- package/build/styles/nudge/Nudge.css +1 -138
- package/build/styles/overlayHeader/OverlayHeader.css +1 -31
- package/build/styles/phoneNumberInput/PhoneNumberInput.css +1 -17
- package/build/styles/popover/Popover.css +1 -40
- package/build/styles/progress/Progress.css +1 -35
- package/build/styles/progressBar/ProgressBar.css +1 -9
- package/build/styles/section/Section.css +1 -8
- package/build/styles/select/Select.css +1 -322
- package/build/styles/slidingPanel/SlidingPanel.css +1 -96
- package/build/styles/snackbar/Snackbar.css +1 -85
- package/build/styles/statusIcon/StatusIcon.css +1 -50
- package/build/styles/stepper/Stepper.css +1 -139
- package/build/styles/summary/Summary.css +1 -86
- package/build/styles/switch/Switch.css +1 -64
- package/build/styles/tabs/Tabs.css +1 -104
- package/build/styles/tile/Tile.css +1 -58
- package/build/styles/tooltip/Tooltip.css +1 -37
- package/build/styles/typeahead/Typeahead.css +1 -167
- package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -6
- package/build/styles/upload/Upload.css +1 -15
- package/build/styles/uploadInput/UploadInput.css +1 -53
- package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -44
- package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -60
- package/build/types/actionButton/ActionButton.d.ts +3 -0
- package/build/types/actionButton/ActionButton.story.d.ts +1 -0
- package/build/types/button/Button.story.d.ts +24 -24
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{within}from"@testing-library/react";import userEvent from"@testing-library/user-event";import{Status}from"../common";import{render,screen,waitFor,waitForElementToBeRemoved}from"../test-utils";import UploadInput from"./UploadInput";import{TEST_IDS as UPLOAD_BUTTON_TEST_IDS}from"./uploadButton/UploadButton";import{TEST_IDS as UPLOAD_ITEM_TEST_IDS}from"./uploadItem/UploadItem";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.array.slice.js";import"core-js/modules/es.promise.js";import _regeneratorRuntime from"@babel/runtime/regenerator";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{within}from"@testing-library/react";import userEvent from"@testing-library/user-event";import{Status}from"../common";import{render,screen,waitFor,waitForElementToBeRemoved}from"../test-utils";import UploadInput from"./UploadInput";import{TEST_IDS as UPLOAD_BUTTON_TEST_IDS}from"./uploadButton/UploadButton";import{TEST_IDS as UPLOAD_ITEM_TEST_IDS}from"./uploadItem/UploadItem";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var spiedDateObject=jest.spyOn(global,"Date");describe("UploadInput",function(){var a=new File(["foo"],"foo.png",{type:"image/png"}),b=new File(["foo"],"foo.jpg",{type:"image/jpeg"}),c=[{id:1,filename:"purchase-receipt.pdf",status:Status.SUCCEEDED},{id:2,filename:"CoWork-0317-invoice.pdf",status:Status.PROCESSING}],d={onUploadFile:jest.fn().mockResolvedValue({id:1}).mockResolvedValueOnce({id:2}).mockResolvedValueOnce({id:3}),onDeleteFile:jest.fn().mockResolvedValue({})},e=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:d;return render(/*#__PURE__*/_jsx(UploadInput,_objectSpread({},a)))};beforeEach(function(){spiedDateObject.mockImplementation(function(){return{getTime:jest.fn().mockReturnValue(Math.random())}})}),afterAll(function(){spiedDateObject.mockRestore()}),describe("single file upload",function(){it("should trigger onUploadFiles & onFilesChange with a single FormData entry containing `file` field",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function c(){var f,g,h,i;return _regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return f="11111111",g="22222222",spiedDateObject.mockImplementation(function(){return{getTime:jest.fn().mockReturnValueOnce(f).mockReturnValueOnce(g)}}),h=jest.fn(),e(_objectSpread(_objectSpread({},d),{},{onFilesChange:h})),i=screen.getByTestId(UPLOAD_BUTTON_TEST_IDS.uploadInput),userEvent.upload(i,[a,b]),c.next=9,waitFor(function(){expect(d.onUploadFile).toHaveBeenCalledTimes(1)});case 9:expect(h).toHaveBeenCalledTimes(2),expect(h).toHaveBeenNthCalledWith(1,[{filename:"foo.png",id:"foo.png_3_".concat(f),status:"pending",url:void 0}]),expect(h).toHaveBeenNthCalledWith(2,[{filename:"foo.png",id:2,status:"succeeded",url:void 0}]);case 12:case"end":return c.stop();}},c)}))),it("should render only one file even if multiple ones were supplied",function(){e(_objectSpread(_objectSpread({},d),{},{files:c})),expect(screen.getByText(c[0].filename)).toBeInTheDocument(),c.slice(1,c.length).forEach(function(a){expect(screen.queryByText(a.filename)).not.toBeInTheDocument()})})}),describe("multiple file upload",function(){it("should render all files",function(){e(_objectSpread(_objectSpread({},d),{},{files:c,multiple:!0})),c.forEach(function(a){expect(screen.getByText(a.filename)).toBeInTheDocument()})}),it("should render the UploadButton also",function(){e(_objectSpread(_objectSpread({},d),{},{files:c,multiple:!0})),expect(screen.getByText("Upload files")).toBeInTheDocument()}),it("should trigger onUploadFile with multiple FormData entries containing `file` fields",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function c(){var f;return _regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return e(_objectSpread(_objectSpread({},d),{},{multiple:!0})),d.onUploadFile.mockClear(),expect(screen.getByTestId(UPLOAD_BUTTON_TEST_IDS.uploadInput)).toHaveAttribute("multiple"),f=screen.getByTestId(UPLOAD_BUTTON_TEST_IDS.uploadInput),userEvent.upload(f,[a,b]),c.next=7,waitFor(function(){expect(d.onUploadFile).toHaveBeenCalledTimes(2)});case 7:case"end":return c.stop();}},c)})))}),describe("file deletion",function(){var a=jest.fn();beforeEach(function(){a.mockClear()}),it("should delete file with modal confirmation",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function b(){var f;return _regeneratorRuntime.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return e(_objectSpread(_objectSpread({},d),{},{files:c,multiple:!0,onFilesChange:a})),f=screen.getAllByTestId(UPLOAD_ITEM_TEST_IDS.uploadItem)[0],within(f).getByLabelText("Remove file",{exact:!1}).click(),screen.getByText("Remove").click(),b.next=6,waitForElementToBeRemoved(f);case 6:expect(d.onDeleteFile).toHaveBeenCalledWith(c[0].id),expect(a).toHaveBeenCalledTimes(2),expect(a).toHaveBeenNthCalledWith(1,[{error:void 0,filename:"purchase-receipt.pdf",id:1,status:"processing"},{filename:"CoWork-0317-invoice.pdf",id:2,status:"processing"}]),expect(a).toHaveBeenLastCalledWith([{filename:"CoWork-0317-invoice.pdf",id:2,status:"processing"}]);case 10:case"end":return b.stop();}},b)}))),it("should delete file with failed state without modal confirmation",function(){var b=[{id:1,filename:"purchase-receipt.pdf",status:Status.FAILED}];e(_objectSpread(_objectSpread({},d),{},{files:b,multiple:!0,onFilesChange:a}));var c=screen.getAllByTestId(UPLOAD_ITEM_TEST_IDS.uploadItem)[0];within(c).getByLabelText("Remove file",{exact:!1}).click(),expect(c).not.toBeInTheDocument(),expect(a).toHaveBeenCalledTimes(1),expect(a).toHaveBeenCalledWith([])}),it("should not render delete button when no delete callback is provided",function(){e(_objectSpread(_objectSpread({},d),{},{files:c,multiple:!0,onDeleteFile:void 0})),expect(screen.queryByLabelText("Remove file ",{exact:!1})).not.toBeInTheDocument()})}),describe("Max File Upload limit",function(){it("should show max file number in the description next to the upload button",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function a(){return _regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e(_objectSpread(_objectSpread({},d),{},{multiple:!0,maxFiles:2})),a.next=3,waitFor(function(){expect(screen.getByText(/Maximum 2 files\./)).toBeInTheDocument()});case 3:case"end":return a.stop();}},a)}))),it("should show given error when maxFiles limit is applied and more files are uploaded",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function c(){var f,g,h,i,j;return _regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return f="Maximum files message from prop",g=jest.fn(),e(_objectSpread(_objectSpread({},d),{},{multiple:!0,maxFiles:3,maxFilesErrorMessage:f,onUploadFile:g})),g.mockImplementation(function(a){var b=a.get("file");return Promise.resolve({file:b,id:Math.random()})}),h=screen.getByTestId(UPLOAD_BUTTON_TEST_IDS.uploadInput),userEvent.upload(h,[a,b]),i=new File(["foo2"],"foo2.png",{type:"image/png"}),j=new File(["foo2"],"foo2.jpg",{type:"image/jpeg"}),userEvent.upload(h,[i,j]),c.next=11,waitFor(function(){expect(screen.getByText(f)).toBeInTheDocument()});case 11:case"end":return c.stop();}},c)}))),it("should show default error when maxFiles limit exceeds and no error message provided",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function c(){var f,g,h,i;return _regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return f="Sorry, this upload failed because we can only accept 2 files at once.",g=jest.fn(),e(_objectSpread(_objectSpread({},d),{},{multiple:!0,maxFiles:2,onUploadFile:g})),g.mockImplementation(function(a){var b=a.get("file");return Promise.resolve({file:b,id:Math.random()})}),h=screen.getByTestId(UPLOAD_BUTTON_TEST_IDS.uploadInput),i=new File(["foo2"],"foo2.png",{type:"image/png"}),userEvent.upload(h,[a,b,i]),c.next=9,waitFor(function(){expect(screen.getByText(f)).toBeInTheDocument()});case 9:case"end":return c.stop();}},c)})))}),describe("Misc",function(){it("should attach the input id accepted from props to the input components",function(){var a="LabelText";render(/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("label",{htmlFor:"testInputId",children:a}),/*#__PURE__*/_jsx(UploadInput,_objectSpread(_objectSpread({},d),{},{id:"testInputId"}))]})),expect(screen.getByLabelText(a)).toHaveAttribute("id","testInputId")}),it("should show the file size error when provided in props",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function a(){var b,c,f,g,h;return _regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b=1024,c=2*b,f="file oversized",e(_objectSpread(_objectSpread({},d),{},{sizeLimit:1,sizeLimitErrorMessage:f})),g=screen.getByTestId(UPLOAD_BUTTON_TEST_IDS.uploadInput),h=new File([""],"testFile.png",{type:"image/png"}),Object.defineProperty(h,"size",{value:c}),userEvent.upload(g,[h]),a.next=10,waitFor(function(){expect(screen.getByText(f)).toBeInTheDocument()});case 10:case"end":return a.stop();}},a)})))})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{action}from"@storybook/addon-actions";import{Status}from"../common";import UploadInput from"./UploadInput";import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.promise.js";import"core-js/modules/es.array.slice.js";import{action}from"@storybook/addon-actions";import{Status}from"../common";import UploadInput from"./UploadInput";import{jsx as _jsx}from"react/jsx-runtime";var meta={title:"Forms/UploadInput",component:UploadInput,tags:["autodocs"]};export default meta;var files=[{id:1,filename:"purchase-receipt.pdf",url:"https://wise.com/public-resources/assets/logos/wise/brand_logo_inverse.svg"},{id:2,filename:"receipt failed.png",status:Status.FAILED},{id:3,filename:"receipt failed with error string.png",status:Status.SUCCEEDED},{id:4,filename:"receipt failed with error object.png",status:Status.SUCCEEDED}],createDelayedPromise=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.successful,c=a.delaySeconds,d=void 0===c?3:c,e=a.response,f=void 0===e?{id:Math.round(1e4*Math.random()),url:"#"}:e;return new Promise(function(a,c){setTimeout(function(){return!(void 0!==b)||b?a(f):c(new Error("Unexpected error"))},1e3*d)})},props={onUploadFile:function onUploadFile(){return createDelayedPromise()},onDeleteFile:function onDeleteFile(){return createDelayedPromise()}},Template=function(a){return/*#__PURE__*/_jsx(UploadInput,_objectSpread({},a))};export var SingleFile=Template.bind({});SingleFile.args=_objectSpread({},props);export var MultipleFiles=Template.bind({});MultipleFiles.args=_objectSpread(_objectSpread({},props),{},{multiple:!0});export var UploadInputWithDescriptionFromProps=Template.bind({});UploadInputWithDescriptionFromProps.args=_objectSpread(_objectSpread({},props),{},{multiple:!0,description:"Custom file description from prop"});export var Disabled=Template.bind({});Disabled.args=_objectSpread(_objectSpread({},props),{},{disabled:!0});export var WithAnyFileType=Template.bind({});WithAnyFileType.args=_objectSpread(_objectSpread({},props),{},{fileTypes:"*"});export var WithSingleFileType=Template.bind({});WithSingleFileType.args=_objectSpread(_objectSpread({},props),{},{fileTypes:".zip,application/zip"});export var WithMultipleExistingFiles=Template.bind({});WithMultipleExistingFiles.args=_objectSpread(_objectSpread({},props),{},{files:files,multiple:!0});export var WithoutDelete=Template.bind({});WithoutDelete.args=_objectSpread(_objectSpread({},props),{},{files:files,onDeleteFile:void 0,multiple:!0});export var WithUploadFailed=Template.bind({});WithUploadFailed.args=_objectSpread(_objectSpread({},props),{},{files:files.slice(0),onUploadFile:function onUploadFile(){return createDelayedPromise({successful:!1})},multiple:!0});export var WithDeleteFailed=Template.bind({});WithDeleteFailed.args=_objectSpread(_objectSpread({},props),{},{files:files.slice(0),onDeleteFile:function onDeleteFile(){return createDelayedPromise({successful:!1})},multiple:!0});export var CustomConfirmMessage=Template.bind({});CustomConfirmMessage.args=_objectSpread(_objectSpread({},props),{},{files:files.slice(0),deleteConfirm:{title:"Sure you want to remove this invoice?",body:/*#__PURE__*/_jsx("img",{alt:"brand logo",src:"https://wise.com/public-resources/assets/logos/wise/brand_logo.svg"})}});export var withManualDownloadHandler=Template.bind({});withManualDownloadHandler.args=_objectSpread(_objectSpread({},props),{},{files:files,onDownload:action("Manual download handler")});export var withFilesChangeHandler=Template.bind({});withFilesChangeHandler.args=_objectSpread(_objectSpread({},props),{},{files:files,onFilesChange:action("Files change handler")});export var withMaxFilesToUploadLimit=Template.bind({});withMaxFilesToUploadLimit.args=_objectSpread(_objectSpread({},props),{},{multiple:!0,maxFiles:5,maxFilesErrorMessage:"Can't upload as maximum number of files allowed are already uploaded"});export var withFileSizeErrorMessage=Template.bind({});withFileSizeErrorMessage.args=_objectSpread(_objectSpread({},props),{},{sizeLimit:1,sizeLimitErrorMessage:"The file is oversized"});export var withCustomUploadButtonTitle=Template.bind({});withCustomUploadButtonTitle.args=_objectSpread(_objectSpread({},props),{},{uploadButtonTitle:"Upload the VAT receipts for FY 2022-23"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PlusCircle as PlusIcon,Upload as UploadIcon}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useRef,useState}from"react";import{useIntl}from"react-intl";import Body from"../../body";import{Typography}from"../../common";import{useDirection}from"../../common/hooks";import MESSAGES from"./UploadButton.messages";import{DEFAULT_SIZE_LIMIT,imageFileTypes}from"./defaults";import getAllowedFileTypes from"./getAllowedFileTypes";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import{PlusCircle as PlusIcon,Upload as UploadIcon}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useRef,useState}from"react";import{useIntl}from"react-intl";import Body from"../../body";import{Typography}from"../../common";import{useDirection}from"../../common/hooks";import MESSAGES from"./UploadButton.messages";import{DEFAULT_SIZE_LIMIT,imageFileTypes}from"./defaults";import getAllowedFileTypes from"./getAllowedFileTypes";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var TEST_IDS=/*#__PURE__*/function(a){return a.uploadInput="uploadInput",a.mediaBody="mediaBody",a}({});var onDragOver=function(a){a.preventDefault()},DEFAULT_FILE_INPUT_ID="np-upload-button",UploadButton=function(a){function b(){if(e)return e;var a=C(),b="*"===a?u(MESSAGES.allFileTypes):a;return u(MESSAGES.instructions,{fileTypes:b,size:Math.round(i/1e3)})}var c=a.disabled,d=a.multiple,e=a.description,f=a.fileTypes,g=void 0===f?imageFileTypes:f,h=a.sizeLimit,i=void 0===h?DEFAULT_SIZE_LIMIT:h,j=a.maxFiles,k=a.onChange,l=a.id,m=void 0===l?DEFAULT_FILE_INPUT_ID:l,n=a.uploadButtonTitle,o=a.multipleFileInputWithFilesAdded,p=useTheme(),q=p.isModern,r=useDirection(),s=r.isRTL,t=useIntl(),u=t.formatMessage,v=useRef(null),w=useState(!1),x=_slicedToArray(w,2),y=x[0],z=x[1],A=useRef(0),B=function(){A.current=0,z(!1)},C=function(){return"*"===g?g:Array.isArray(g)?getAllowedFileTypes(g).join(", "):getAllowedFileTypes([g]).join(", ")};return/*#__PURE__*/_jsxs("div",_objectSpread(_objectSpread({className:classNames("np-upload-button-container","droppable",{"droppable-dropping":y})},!c&&{onDragEnter:function onDragEnter(a){a.preventDefault(),A.current+=1,1===A.current&&z(!0)},onDragLeave:function onDragLeave(a){a.preventDefault(),A.current-=1,0===A.current&&z(!1)},onDrop:function onDrop(a){a.preventDefault(),B(),a.dataTransfer&&a.dataTransfer.files&&a.dataTransfer.files[0]&&k(a.dataTransfer.files)},onDragOver:onDragOver}),{},{children:[/*#__PURE__*/_jsx("input",_objectSpread(_objectSpread(_objectSpread({ref:v,id:m,type:"file"},function(){var a="*"===C();return a?null:Array.isArray(g)?{accept:g.join(",")}:{accept:g}}()),d&&{multiple:!0}),{},{className:"tw-droppable-input",disabled:c,name:"file-upload","data-testid":TEST_IDS.uploadInput,onChange:function filesSelected(a){var b=a.target.files;b&&(k(b),v.current&&(v.current.value=""))}})),/*#__PURE__*/_jsx("label",{htmlFor:m,className:classNames("btn","np-upload-accent","np-upload-button",{disabled:c,"np-upload-input--square-top":o}),children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"np-upload-icon media-left",children:/*#__PURE__*/_jsx(UploadIcon,{size:24,className:"text-link"})}),/*#__PURE__*/_jsxs("div",{className:"media-body text-xs-left","data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx(Body,{type:Typography.BODY_LARGE_BOLD,className:"d-block",children:function(){return n?n:u(d?MESSAGES.uploadFiles:MESSAGES.uploadFile)}()}),function(){return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsxs(Body,{className:classNames({"text-primary":!c,small:!q,"font-weight-normal":!q}),children:[b(),j&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("br",{}),"Maximum ".concat(j," files.")]})]})})}()]})]})}),y&&/*#__PURE__*/_jsxs("div",{className:classNames("droppable-card","droppable-dropping-card","droppable-card-content",{"np-upload-input--square-top":o}),children:[/*#__PURE__*/_jsx(PlusIcon,{className:"m-x-1",size:24}),/*#__PURE__*/_jsx("div",{children:u(MESSAGES.dropFile)})]})]}))};export default UploadButton;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{render,screen,userEvent}from"../../test-utils";import UploadButton,{TEST_IDS}from"./UploadButton";import{imageFileTypes}from"./defaults";import{jsx as _jsx}from"react/jsx-runtime";describe("UploadButton",()
|
|
2
|
-
userEvent.upload(d,[a,b]),expect(c.onChange).toHaveBeenCalledTimes(1),expect(c.onChange.mock.calls[0][0]).toHaveLength(1)})}),describe("multiple file upload",()
|
|
3
|
-
userEvent.upload(d,[a,b]),expect(c.onChange).toHaveBeenCalledTimes(1),expect(c.onChange.mock.calls[0][0]).toHaveLength(2)})}),describe("disabled state",()
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import"core-js/modules/es.array.join.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{render,screen,userEvent}from"../../test-utils";import UploadButton,{TEST_IDS}from"./UploadButton";import{imageFileTypes}from"./defaults";import{jsx as _jsx}from"react/jsx-runtime";describe("UploadButton",function(){var a=new File(["foo"],"foo.png",{type:"image/png"}),b=new File(["foo"],"foo.jpg",{type:"image/jpg"}),c={onChange:jest.fn(),multipleFileInputWithFilesAdded:!0},d=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:c;return render(/*#__PURE__*/_jsx(UploadButton,_objectSpread({},a)))};describe("single file upload",function(){beforeEach(function(){d()}),it("should render the file input form",function(){expect(screen.getByText("Upload file")).toBeInTheDocument()}),it("should render the file input button with title, if provided",function(){d(_objectSpread(_objectSpread({},c),{},{uploadButtonTitle:"Upload your id"})),expect(screen.getByText("Upload your id")).toBeInTheDocument()}),it("should set accept to imageTypes",function(){expect(screen.getByTestId(TEST_IDS.uploadInput)).toHaveAttribute("accept",imageFileTypes.join(","))}),it("trigger onChange callback with a FileList",function(){var d=screen.getByTestId(TEST_IDS.uploadInput);// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2
|
+
userEvent.upload(d,[a,b]),expect(c.onChange).toHaveBeenCalledTimes(1),expect(c.onChange.mock.calls[0][0]).toHaveLength(1)})}),describe("multiple file upload",function(){beforeEach(function(){c.onChange.mockClear(),d(_objectSpread(_objectSpread({},c),{},{multiple:!0}))}),it("should disable the file input",function(){expect(screen.getByTestId(TEST_IDS.uploadInput)).toHaveAttribute("multiple")}),it("trigger onChange callback with a FileList",function(){var d=screen.getByTestId(TEST_IDS.uploadInput);// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3
|
+
userEvent.upload(d,[a,b]),expect(c.onChange).toHaveBeenCalledTimes(1),expect(c.onChange.mock.calls[0][0]).toHaveLength(2)})}),describe("disabled state",function(){beforeEach(function(){d(_objectSpread(_objectSpread({},c),{},{disabled:!0}))}),it("should disable the file input",function(){expect(screen.getByTestId(TEST_IDS.uploadInput)).toBeDisabled()})}),describe("accept all file types",function(){beforeEach(function(){d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"]}))}),it("should not add accept attribute to file input",function(){expect(screen.getByTestId(TEST_IDS.uploadInput)).not.toHaveAttribute("accept")})}),describe("description for the button",function(){it("should show default description based on the default file types provided",function(){d(_objectSpread({},c)),expect(screen.getByText("PDF, JPG, JPEG, PNG, less than 5MB")).toBeInTheDocument()}),it("should show default all files allowed description if all files are accepted",function(){d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"]})),expect(screen.getByText("All file types, less than 5MB")).toBeInTheDocument()}),it("should show custom description if provided",function(){d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"],description:"Test description"})),expect(screen.getByText("Test description")).toBeInTheDocument()}),it("should show maxFiles next to the description, if provided",function(){d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"],maxFiles:5})),expect(screen.getByText(/Maximum 5 files\./)).toBeInTheDocument()})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FileType}from"../../common";export
|
|
1
|
+
import{FileType}from"../../common";export var DEFAULT_SIZE_LIMIT=5e3;export var imageFileTypes=[FileType.PDF,FileType.JPG,FileType.PNG];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
.map(a
|
|
3
|
-
.join(", "));export default getAllowedFileTypes;
|
|
1
|
+
import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";var getAllowedFileTypes=function(a){return a.map(function(a){return a.split(",").filter(function(a){return!a.includes("/")})// Filter out mime types
|
|
2
|
+
.map(function(a){return a.replace(".","").toUpperCase()})// Remove dot and convert extensions to uppercase to be displayed in the instructions
|
|
3
|
+
.join(", ")})};export default getAllowedFileTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FileType}from"../../common";import getAllowedFileTypes from"./getAllowedFileTypes";describe("getAllowedFileTypes",()
|
|
1
|
+
import{FileType}from"../../common";import getAllowedFileTypes from"./getAllowedFileTypes";describe("getAllowedFileTypes",function(){var a;describe("using predefined FileTypes",function(){beforeAll(function(){a=getAllowedFileTypes([FileType.PNG,FileType.JPG])}),it("parses allowed file extensions from FileType[] array",function(){expect(a).toStrictEqual(["PNG","JPG, JPEG"])})}),describe("using custom file extensions and mime types",function(){beforeAll(function(){a=getAllowedFileTypes([".xls,.xlm,application/vnd.ms-excel",".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",".doc,application/msword"])}),it("parses allowed file extensions from FileType[] array",function(){expect(a).toStrictEqual(["XLS, XLM","DOCX","DOC"])})}),describe("when all file types are allowed",function(){beforeAll(function(){a=getAllowedFileTypes(["*"])}),it("should return the wildcard character",function(){expect(a).toStrictEqual(["*"])})})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{AlertCircle,CrossCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useIntl}from"react-intl";import Body from"../../body";import{Size,Status,Typography,Sentiment}from"../../common";import ProcessIndicator from"../../processIndicator/ProcessIndicator";import StatusIcon from"../../statusIcon/StatusIcon";import MESSAGES from"./UploadItem.messages";import{UploadItemBody}from"./UploadItemBody";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export
|
|
2
|
-
}
|
|
1
|
+
import _typeof from"@babel/runtime/helpers/typeof";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{AlertCircle,CrossCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useIntl}from"react-intl";import Body from"../../body";import{Size,Status,Typography,Sentiment}from"../../common";import ProcessIndicator from"../../processIndicator/ProcessIndicator";import StatusIcon from"../../statusIcon/StatusIcon";import MESSAGES from"./UploadItem.messages";import{UploadItemBody}from"./UploadItemBody";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var TEST_IDS=/*#__PURE__*/function(a){return a.uploadItem="uploadItem",a.mediaBody="mediaBody",a}({});var UploadItem=function(a){var b=a.file,c=a.canDelete,d=a.onDelete,e=a.onDownload,f=a.singleFileUpload,g=useIntl(),h=g.formatMessage,i=b.status,j=b.filename,k=b.error,l=b.url,m=useTheme(),n=m.isModern,o=[Status.SUCCEEDED,void 0].includes(i)&&!!l,p=function(){return"object"===_typeof(k)&&k.message||k||h(MESSAGES.uploadingFailed)};return/*#__PURE__*/_jsx("div",{className:classNames("np-upload-item",{"np-upload-item__link":o}),"data-testid":TEST_IDS.uploadItem,children:/*#__PURE__*/_jsxs("div",{className:"np-upload-item__body",children:[/*#__PURE__*/_jsx(UploadItemBody,{url:o?l:void 0,singleFileUpload:f,onDownload:function onDownloadFile(a){e&&(a.preventDefault(),e(b))},children:/*#__PURE__*/_jsx("div",{className:"np-upload-button",children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"np-upload-icon media-left",children:function getIcon(){if(k||i===Status.FAILED)return n?/*#__PURE__*/_jsx(StatusIcon,{size:Size.SMALL,sentiment:Sentiment.NEGATIVE}):/*#__PURE__*/_jsx(AlertCircle,{size:24,className:"text-negative"});var a;switch(i){case Status.PROCESSING:case Status.PENDING:a=/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.PROCESSING});break;case Status.SUCCEEDED:case Status.DONE:default:a=n?/*#__PURE__*/_jsx(StatusIcon,{size:Size.SMALL,sentiment:Sentiment.POSITIVE}):/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.SUCCEEDED});}return n?a:/*#__PURE__*/_jsx("span",{style:{transform:"scale(0.8335)"},children:a});// Scale down ProcessIndicator to be 20px*20px to match `icons`
|
|
2
|
+
}()}),/*#__PURE__*/_jsxs("div",{className:"media-body text-xs-left","data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx(Body,{className:"text-word-break d-block text-primary",children:function getTitle(){return j||h(MESSAGES.uploadedFile)}()}),function getDescription(){if(k||i===Status.FAILED)return/*#__PURE__*/_jsx(Body,{type:Typography.BODY_DEFAULT_BOLD,className:"text-negative",children:p()});switch(i){case Status.PENDING:return/*#__PURE__*/_jsx(Body,{type:Typography.BODY_DEFAULT_BOLD,children:h(MESSAGES.uploading)});case Status.PROCESSING:return/*#__PURE__*/_jsx(Body,{children:h(MESSAGES.deleting)});case Status.SUCCEEDED:case Status.DONE:default:return/*#__PURE__*/_jsx(Body,{type:Typography.BODY_DEFAULT_BOLD,className:"text-positive",children:h(MESSAGES.uploaded)});}}()]})]})})}),c&&/*#__PURE__*/_jsx("button",{"aria-label":h(MESSAGES.removeFile,{filename:j}),className:classNames("btn","np-upload-item__remove-button","media-left",{"np-upload-item--single-file":f}),type:"button",onClick:function onClick(){return d()},children:/*#__PURE__*/_jsx(CrossCircleFill,{size:16})})]})})};export default UploadItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import userEvent from"@testing-library/user-event";import{Status}from"../../common";import{render,screen}from"../../test-utils";import UploadItem from"./UploadItem";import{jsx as _jsx}from"react/jsx-runtime";describe("UploadItem",()
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import userEvent from"@testing-library/user-event";import{Status}from"../../common";import{render,screen}from"../../test-utils";import UploadItem from"./UploadItem";import{jsx as _jsx}from"react/jsx-runtime";describe("UploadItem",function(){var a={file:{id:1,filename:"purchase-receipt.pdf",status:Status.SUCCEEDED,url:"https://wise.com"},canDelete:!0,onDelete:jest.fn(),singleFileUpload:!0},b=function(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:a;return render(/*#__PURE__*/_jsx(UploadItem,_objectSpread({},b)))};describe("filename",function(){it("should display the filename",function(){b(),expect(screen.getByText(a.file.filename)).toBeInTheDocument()}),it("should display the default filename when it is missing",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{filename:void 0})})),expect(screen.getByText("Uploaded file")).toBeInTheDocument()})}),describe("description",function(){it("should display the default uploading copy while file upload is in progress",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.PENDING})})),expect(screen.getByText("Uploading...")).toBeInTheDocument()}),it("should display the default deleting copy while file deletion is in progress",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.PROCESSING})})),expect(screen.getByText("Deleting...")).toBeInTheDocument()}),it("should display the default success copy when file upload is complete",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.SUCCEEDED})})),expect(screen.getByText("Uploaded")).toBeInTheDocument()})}),describe("failed uploads",function(){it("should display the error.message from an API response",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.FAILED,error:{message:"An API error object with message field"}})})),expect(screen.getByText("An API error object with message field")).toBeInTheDocument()}),it("should display the error if it is supplied as a string",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.FAILED,error:"An API error string"})})),expect(screen.getByText("An API error string")).toBeInTheDocument()}),it("should display default error message when error is missing but status is FAILED",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.FAILED})})),expect(screen.getByText("Uploading failed")).toBeInTheDocument()}),it("should display the error even if status is missing",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{error:"An API error string without status"})})),expect(screen.getByText("An API error string without status")).toBeInTheDocument()})}),describe("file deletion",function(){it("should render the remove file button when deleteFile prop is supplied",function(){b(),expect(screen.getByLabelText("Remove file ",{exact:!1})).toBeInTheDocument()}),it("should not render the remove file button when canDelete prop is false",function(){b(_objectSpread(_objectSpread({},a),{},{canDelete:!1})),expect(screen.queryByLabelText("Remove file ",{exact:!1})).not.toBeInTheDocument()})}),describe("manual file download handler",function(){it("calls onDownload handler provided through props",function(){var c=jest.fn();b(_objectSpread(_objectSpread({},a),{},{onDownload:c})),userEvent.click(screen.getAllByRole("link")[0]),expect(c).toHaveBeenCalledTimes(1),expect(c).toHaveBeenCalledWith(a.file)})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";export
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";export var UploadItemBody=function(a){var b=a.children,c=a.url,d=a.onDownload,e=a.singleFileUpload;return c?/*#__PURE__*/_jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:e?"np-upload-item--single-file":"",onClick:d,children:b}):/*#__PURE__*/_jsx("div",{children:b})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{logActionRequired}from"../logActionRequired";
|
|
1
|
+
import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.join.js";import{logActionRequired}from"../logActionRequired";var deprecatedMessage=function(a){var b=a.component,c=a.propName,d=a.message,e=a.expiryDate,f=["".concat(b," has deprecated the use of ").concat(c,".")];return d&&f.push(d),e&&f.push("".concat(c," will be removed on or after ").concat(e.toLocaleString("en-GB",{year:"numeric",month:"numeric",day:"numeric"}))),f.join(" ")},deprecated=function(a,b){var c=b.component,d=b.message,e=void 0===d?"":d,f=b.newProp,g=void 0===f?null:f,h=b.expiryDate,i=void 0===h?null:h;return function(b,d){var f=g?"Please use ".concat(g," instead."):e;null!=b[d]&&"undefined"!=typeof b[d]&&logActionRequired(deprecatedMessage({component:c,propName:d,message:f,expiryDate:i}));for(var h=arguments.length,j=Array(2<h?h-2:0),k=2;k<h;k++)j[k-2]=arguments[k];return a.apply(void 0,[b,d].concat(j))}};export default deprecated;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function logActionRequired(a){["development","test"].includes(process
|
|
1
|
+
import"core-js/modules/es.array.includes.js";export function logActionRequired(a){var b,c;["development","test"].includes(null===(b=process)||void 0===b||null===(c=b.env)||void 0===c?void 0:c.NODE_ENV)&&console.warn(a)}export function logActionRequiredIf(a,b){b&&logActionRequired(a)}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import PropTypes from"prop-types";import{Component}from"react";import{HistoryNavigator}from"../common";import{formatWithPattern,getCountOfSymbolsInSelection,getCursorPositionAfterKeystroke,unformatWithPattern,getDistanceToPreviousSymbol,getDistanceToNextSymbol}from"../common/textFormat";
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.splice.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.function.name.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{Component}from"react";import{HistoryNavigator}from"../common";import{formatWithPattern,getCountOfSymbolsInSelection,getCursorPositionAfterKeystroke,unformatWithPattern,getDistanceToPreviousSymbol,getDistanceToNextSymbol}from"../common/textFormat";var WithDisplayFormat=/*#__PURE__*/function(a){function b(a){var d;_classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"getUserAction",function(a){var b=d.state,c=b.triggerEvent,e=b.triggerType,f=b.value,g=d.props.displayPattern,h=String.fromCharCode(c.which).toLowerCase();return"Paste"===e||"Cut"===e?e:(c.ctrlKey||c.metaKey)&&"z"===h?c.shiftKey?"Redo":"Undo":c.ctrlKey&&"d"===h?"Delete":"undefined"==typeof c.key&&a.length<=unformatWithPattern(f,g).length?"Backspace":c.key;// Detect mouse event redo
|
|
2
2
|
// Android Fix.
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
"Paste":this.getUserAction(h);if(this.isKeyAllowed(i)&&"Undo"!==d&&"Redo"!==d){("Backspace"===i||"Delete"===i)&&(h=this.handleDelete(h,i));const a=formatWithPattern(h,e);b.add(h),this.handleCursorPositioning(i);const c=unformatWithPattern(a,e);this.setState({value:a},this.resetEvent(),f(c))}};handleOnBlur=a=>{const{displayPattern:b,onBlur:c}=this.props;c&&c(unformatWithPattern(a.target.value,b))};handleOnFocus=a=>{const{displayPattern:b,onFocus:c}=this.props;c&&(this.handleOnChange(a),c(unformatWithPattern(a.target.value,b)))};handleDelete=(a,b)=>{const{displayPattern:c}=this.props,{selectionStart:d,selectionEnd:e}=this.state,f=[...a];if(d===e){let a=d-getCountOfSymbolsInSelection(0,d,c),e=0,g=getDistanceToNextSymbol(d,c);"Backspace"===b&&(a-=1,g=getDistanceToPreviousSymbol(d,c)),0<=a&&g&&(e=1),f.splice(a,e)}return f.join("")};handleCursorPositioning=a=>{const{displayPattern:b}=this.props,{triggerEvent:c,selectionStart:d,selectionEnd:e,pastedLength:f}=this.state,g=getCursorPositionAfterKeystroke(a,d,e,b,f);setTimeout(()=>{c&&c.target.setSelectionRange(g,g),this.setState({selectionStart:g,selectionEnd:g})},0)};render(){const{type:a,inputMode:b,className:c,id:d,name:e,placeholder:f,readOnly:g,required:h,minLength:i,maxLength:j,disabled:k,autoComplete:l}=this.props,{value:m}=this.state,n={type:a,inputMode:b,className:c,id:d,name:e,placeholder:f,readOnly:g,required:h,minLength:i,maxLength:j,disabled:k,autoComplete:l,value:m,onFocus:this.handleOnFocus,onBlur:this.handleOnBlur,onPaste:this.handleOnPaste,onKeyDown:this.handleOnKeyDown,onChange:this.handleOnChange,onCut:this.handleOnCut};return this.props.render(n)}}WithDisplayFormat.propTypes={/**
|
|
3
|
+
}),_defineProperty(_assertThisInitialized(d),"resetEvent",function(){d.setState({triggerType:null,triggerEvent:null,pastedLength:0})}),_defineProperty(_assertThisInitialized(d),"detectUndoRedo",function(a){var b=String.fromCharCode(a.which).toLowerCase();return(a.ctrlKey||a.metaKey)&&"z"===b?a.shiftKey?"Redo":"Undo":null}),_defineProperty(_assertThisInitialized(d),"handleOnKeyDown",function(a){a.persist();var b=a.target,c=b.selectionStart,e=b.selectionEnd,f=d.state.historyNavigator,g=d.props.displayPattern,h="";"Undo"===d.detectUndoRedo(a)?(h=formatWithPattern(f.undo(),g),d.setState({value:h,triggerType:"Undo"})):"Redo"===d.detectUndoRedo(a)?(h=formatWithPattern(f.redo(),g),d.setState({value:h,triggerType:"Redo"})):d.setState({triggerEvent:a,triggerType:"KeyDown",selectionStart:c,selectionEnd:e})}),_defineProperty(_assertThisInitialized(d),"handleOnPaste",function(a){var b=d.props.displayPattern,c=unformatWithPattern(a.clipboardData.getData("Text"),b).length;d.setState({triggerType:"Paste",pastedLength:c})}),_defineProperty(_assertThisInitialized(d),"handleOnCut",function(){d.setState({triggerType:"Cut"})}),_defineProperty(_assertThisInitialized(d),"isKeyAllowed",function(a){var b=d.props.displayPattern,c=b.split("").filter(function(a){return"*"!==a});return!c.includes(a)}),_defineProperty(_assertThisInitialized(d),"handleOnChange",function(a){var b=d.state,c=b.historyNavigator,e=b.triggerEvent,f=b.triggerType,g=d.props,h=g.displayPattern,i=g.onChange,j=a.target.value,k=unformatWithPattern(j,h),l=null===e?// triggerEvent can be null only in case of "autofilling" (via password manager extension or browser build-in one) events
|
|
4
|
+
"Paste":d.getUserAction(k);if(d.isKeyAllowed(l)&&"Undo"!==f&&"Redo"!==f){("Backspace"===l||"Delete"===l)&&(k=d.handleDelete(k,l));var m=formatWithPattern(k,h);c.add(k),d.handleCursorPositioning(l);var n=unformatWithPattern(m,h);d.setState({value:m},d.resetEvent(),i(n))}}),_defineProperty(_assertThisInitialized(d),"handleOnBlur",function(a){var b=d.props,c=b.displayPattern,e=b.onBlur;e&&e(unformatWithPattern(a.target.value,c))}),_defineProperty(_assertThisInitialized(d),"handleOnFocus",function(a){var b=d.props,c=b.displayPattern,e=b.onFocus;e&&(d.handleOnChange(a),e(unformatWithPattern(a.target.value,c)))}),_defineProperty(_assertThisInitialized(d),"handleDelete",function(a,b){var c=d.props.displayPattern,e=d.state,f=e.selectionStart,g=e.selectionEnd,h=_toConsumableArray(a);if(f===g){var i=f-getCountOfSymbolsInSelection(0,f,c),j=0,k=getDistanceToNextSymbol(f,c);"Backspace"===b&&(i-=1,k=getDistanceToPreviousSymbol(f,c)),0<=i&&k&&(j=1),h.splice(i,j)}return h.join("")}),_defineProperty(_assertThisInitialized(d),"handleCursorPositioning",function(a){var b=d.props.displayPattern,c=d.state,e=c.triggerEvent,f=c.selectionStart,g=c.selectionEnd,h=c.pastedLength,i=getCursorPositionAfterKeystroke(a,f,g,b,h);setTimeout(function(){e&&e.target.setSelectionRange(i,i),d.setState({selectionStart:i,selectionEnd:i})},0)});var e=a.value,f=a.displayPattern,g=unformatWithPattern(e,f);return d.state={value:formatWithPattern(g,f),historyNavigator:new HistoryNavigator,prevDisplayPattern:a.displayPattern,triggerType:null,triggerEvent:null},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.type,c=a.inputMode,d=a.className,e=a.id,f=a.name,g=a.placeholder,h=a.readOnly,i=a.required,j=a.minLength,k=a.maxLength,l=a.disabled,m=a.autoComplete,n=this.state.value,o={type:b,inputMode:c,className:d,id:e,name:f,placeholder:g,readOnly:h,required:i,minLength:j,maxLength:k,disabled:l,autoComplete:m,value:n,onFocus:this.handleOnFocus,onBlur:this.handleOnBlur,onPaste:this.handleOnPaste,onKeyDown:this.handleOnKeyDown,onChange:this.handleOnChange,onCut:this.handleOnCut};return this.props.render(o)}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(a,b){var c=a.displayPattern,d=b.prevDisplayPattern;if(b.prevDisplayPattern!==c){var e=b.value,f=b.historyNavigator,g=unformatWithPattern(e,d);return f.reset(),{prevDisplayPattern:c,value:formatWithPattern(g,c),triggerType:null,triggerEvent:null,pastedLength:0}}return null}}]),b}(Component);WithDisplayFormat.propTypes={/**
|
|
6
5
|
* autocomplete hides our form help so we need to disable it when help text
|
|
7
6
|
* is present. Chrome ignores autocomplete=off, the only way to disable it is
|
|
8
7
|
* to provide an 'invalid' value, for which 'disabled' serves.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState,useEffect}from"react";import{createPortal}from"react-dom";import{jsx as _jsx}from"react/jsx-runtime";export default function withNextPortalWrapper(a){return function(b){
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{useState,useEffect}from"react";import{createPortal}from"react-dom";import{jsx as _jsx}from"react/jsx-runtime";export default function withNextPortalWrapper(a){return function(b){var c=useState(!1),d=_slicedToArray(c,2),e=d[0],f=d[1];return useEffect(function(){f(!0)},[f]),e?/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(a,_objectSpread({},b)),document.body):null}}
|