@transferwise/components 46.97.4 → 46.98.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/accordion/Accordion.js.map +1 -1
- package/build/accordion/Accordion.mjs.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +8 -0
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +8 -0
- package/build/alert/Alert.mjs.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatar/avatarTypes.js.map +1 -1
- package/build/avatar/avatarTypes.mjs.map +1 -1
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/avatarView/NotificationDot.js.map +1 -1
- package/build/avatarView/NotificationDot.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/badge/BadgeAssets.js.map +1 -1
- package/build/badge/BadgeAssets.mjs.map +1 -1
- package/build/body/Body.js.map +1 -1
- package/build/body/Body.mjs.map +1 -1
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs.map +1 -1
- package/build/button/Button.resolver.js.map +1 -1
- package/build/button/Button.resolver.mjs.map +1 -1
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs +1 -1
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/button/classMap.js.map +1 -1
- package/build/button/classMap.mjs.map +1 -1
- package/build/button/legacyUtils/legacyUtils.js.map +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs.map +1 -1
- package/build/carousel/Carousel.js.map +1 -1
- package/build/carousel/Carousel.mjs.map +1 -1
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/checkboxButton/CheckboxButton.js.map +1 -1
- package/build/checkboxButton/CheckboxButton.mjs.map +1 -1
- package/build/checkboxOption/CheckboxOption.js.map +1 -1
- package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chevron/Chevron.mjs.map +1 -1
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chip.mjs.map +1 -1
- package/build/chips/Chips.js.map +1 -1
- package/build/chips/Chips.messages.js.map +1 -1
- package/build/chips/Chips.messages.mjs.map +1 -1
- package/build/chips/Chips.mjs.map +1 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/DOMOperations/DOMOperations.js.map +1 -1
- package/build/common/DOMOperations/DOMOperations.mjs.map +1 -1
- package/build/common/Option/Option.js.map +1 -1
- package/build/common/Option/Option.mjs.map +1 -1
- package/build/common/RadioButton/RadioButton.js.map +1 -1
- package/build/common/RadioButton/RadioButton.mjs.map +1 -1
- package/build/common/bottomSheet/BottomSheet.js.map +1 -1
- package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
- package/build/common/card/Card.js.map +1 -1
- package/build/common/card/Card.mjs.map +1 -1
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.js +3 -1
- package/build/common/closeButton/CloseButton.js.map +1 -1
- package/build/common/closeButton/CloseButton.messages.js.map +1 -1
- package/build/common/closeButton/CloseButton.messages.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.mjs +3 -1
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/common/colors.js.map +1 -1
- package/build/common/colors.mjs.map +1 -1
- package/build/common/dateUtils/getDateView/getDateView.js.map +1 -1
- package/build/common/dateUtils/getDateView/getDateView.mjs.map +1 -1
- package/build/common/dateUtils/getDayNames/getDayNames.js.map +1 -1
- package/build/common/dateUtils/getDayNames/getDayNames.mjs.map +1 -1
- package/build/common/dateUtils/getFormatForLocale/getFormatForLocale.js.map +1 -1
- package/build/common/dateUtils/getFormatForLocale/getFormatForLocale.mjs.map +1 -1
- package/build/common/dateUtils/getMonthNames/getMonthNames.js.map +1 -1
- package/build/common/dateUtils/getMonthNames/getMonthNames.mjs.map +1 -1
- package/build/common/dateUtils/isDateValid/isDateValid.js.map +1 -1
- package/build/common/dateUtils/isDateValid/isDateValid.mjs.map +1 -1
- package/build/common/dateUtils/isWithinRange/isWithinRange.js.map +1 -1
- package/build/common/dateUtils/isWithinRange/isWithinRange.mjs.map +1 -1
- package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.js.map +1 -1
- package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.mjs.map +1 -1
- package/build/common/deviceDetection/deviceDetection.js.map +1 -1
- package/build/common/deviceDetection/deviceDetection.mjs.map +1 -1
- package/build/common/direction.js.map +1 -1
- package/build/common/direction.mjs.map +1 -1
- package/build/common/domHelpers/documentIosClick.js.map +1 -1
- package/build/common/domHelpers/documentIosClick.mjs.map +1 -1
- package/build/common/fileType.js.map +1 -1
- package/build/common/fileType.mjs.map +1 -1
- package/build/common/flowHeader/FlowHeader.js.map +1 -1
- package/build/common/flowHeader/FlowHeader.mjs.map +1 -1
- package/build/common/focusBoundary/FocusBoundary.js.map +1 -1
- package/build/common/focusBoundary/FocusBoundary.mjs.map +1 -1
- package/build/common/historyNavigator/historyNavigator.js.map +1 -1
- package/build/common/historyNavigator/historyNavigator.mjs.map +1 -1
- package/build/common/hooks/useConditionalListener/useConditionalListener.js.map +1 -1
- package/build/common/hooks/useConditionalListener/useConditionalListener.mjs.map +1 -1
- package/build/common/hooks/useDirection/useDirection.js.map +1 -1
- package/build/common/hooks/useDirection/useDirection.mjs.map +1 -1
- package/build/common/hooks/useEffectEvent.js.map +1 -1
- package/build/common/hooks/useEffectEvent.mjs.map +1 -1
- package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -1
- package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -1
- package/build/common/hooks/useLayout/useLayout.js.map +1 -1
- package/build/common/hooks/useLayout/useLayout.mjs.map +1 -1
- package/build/common/hooks/useMedia.js.map +1 -1
- package/build/common/hooks/useMedia.mjs.map +1 -1
- package/build/common/hooks/useResizeObserver.js.map +1 -1
- package/build/common/hooks/useResizeObserver.mjs.map +1 -1
- package/build/common/hooks/useScreenSize.js.map +1 -1
- package/build/common/hooks/useScreenSize.mjs.map +1 -1
- package/build/common/hooks/useVirtualKeyboard.js.map +1 -1
- package/build/common/hooks/useVirtualKeyboard.mjs.map +1 -1
- package/build/common/initials.js +3 -0
- package/build/common/initials.js.map +1 -1
- package/build/common/initials.mjs +3 -0
- package/build/common/initials.mjs.map +1 -1
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs.map +1 -1
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.js.map +1 -1
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.mjs.map +1 -1
- package/build/common/preventScroll/PreventScroll.js.map +1 -1
- package/build/common/preventScroll/PreventScroll.mjs.map +1 -1
- package/build/common/propsValues/breakpoint.js.map +1 -1
- package/build/common/propsValues/breakpoint.mjs.map +1 -1
- package/build/common/propsValues/control.js.map +1 -1
- package/build/common/propsValues/control.mjs.map +1 -1
- package/build/common/propsValues/dateMode.js.map +1 -1
- package/build/common/propsValues/dateMode.mjs.map +1 -1
- package/build/common/propsValues/layouts.js.map +1 -1
- package/build/common/propsValues/layouts.mjs.map +1 -1
- package/build/common/propsValues/markdownNodeType.js.map +1 -1
- package/build/common/propsValues/markdownNodeType.mjs.map +1 -1
- package/build/common/propsValues/monthFormat.js.map +1 -1
- package/build/common/propsValues/monthFormat.mjs.map +1 -1
- package/build/common/propsValues/position.js.map +1 -1
- package/build/common/propsValues/position.mjs.map +1 -1
- package/build/common/propsValues/profileType.js.map +1 -1
- package/build/common/propsValues/profileType.mjs.map +1 -1
- package/build/common/propsValues/scroll.js.map +1 -1
- package/build/common/propsValues/scroll.mjs.map +1 -1
- package/build/common/propsValues/sentiment.js.map +1 -1
- package/build/common/propsValues/sentiment.mjs.map +1 -1
- package/build/common/propsValues/size.js.map +1 -1
- package/build/common/propsValues/size.mjs.map +1 -1
- package/build/common/propsValues/status.js.map +1 -1
- package/build/common/propsValues/status.mjs.map +1 -1
- package/build/common/propsValues/type.js.map +1 -1
- package/build/common/propsValues/type.mjs.map +1 -1
- package/build/common/propsValues/typography.js.map +1 -1
- package/build/common/propsValues/typography.mjs.map +1 -1
- package/build/common/propsValues/variant.js.map +1 -1
- package/build/common/propsValues/variant.mjs.map +1 -1
- package/build/common/propsValues/width.js.map +1 -1
- package/build/common/propsValues/width.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/common/textFormat/formatWithPattern/formatWithPattern.js.map +1 -1
- package/build/common/textFormat/formatWithPattern/formatWithPattern.mjs.map +1 -1
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js.map +1 -1
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.mjs.map +1 -1
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js.map +1 -1
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.mjs.map +1 -1
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js.map +1 -1
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.mjs.map +1 -1
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js.map +1 -1
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.mjs.map +1 -1
- package/build/common/theme.js.map +1 -1
- package/build/common/theme.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.messages.js.map +1 -1
- package/build/dateInput/DateInput.messages.mjs.map +1 -1
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js.map +1 -1
- package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +4 -4
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.messages.js.map +1 -1
- package/build/dateLookup/DateLookup.messages.mjs.map +1 -1
- package/build/dateLookup/DateLookup.mjs +4 -4
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.messages.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
- package/build/dateLookup/dayCalendar/DayCalendar.js.map +1 -1
- package/build/dateLookup/dayCalendar/DayCalendar.mjs.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
- package/build/dateLookup/getFocusableTime/getFocusableTime.js.map +1 -1
- package/build/dateLookup/getFocusableTime/getFocusableTime.mjs.map +1 -1
- package/build/dateLookup/getStartOfDay/getStartOfDay.js.map +1 -1
- package/build/dateLookup/getStartOfDay/getStartOfDay.mjs.map +1 -1
- package/build/dateLookup/monthCalendar/MonthCalendar.js.map +1 -1
- package/build/dateLookup/monthCalendar/MonthCalendar.mjs.map +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +1 -1
- package/build/dateLookup/tableLink/TableLink.js.map +1 -1
- package/build/dateLookup/tableLink/TableLink.mjs.map +1 -1
- package/build/dateLookup/yearCalendar/YearCalendar.js.map +1 -1
- package/build/dateLookup/yearCalendar/YearCalendar.mjs.map +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +1 -1
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -1
- package/build/dimmer/dimmerManager/DimmerManager.mjs.map +1 -1
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs.map +1 -1
- package/build/divider/Divider.js.map +1 -1
- package/build/divider/Divider.mjs.map +1 -1
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/dropFade/DropFade.js.map +1 -1
- package/build/dropFade/DropFade.mjs.map +1 -1
- package/build/emphasis/Emphasis.js.map +1 -1
- package/build/emphasis/Emphasis.mjs.map +1 -1
- package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -1
- package/build/emphasis/EmphasisHtmlTransformer.mjs.map +1 -1
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.messages.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.messages.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs.map +1 -1
- package/build/i18n/commonMessages/Button.messages.js.map +1 -1
- package/build/i18n/commonMessages/Button.messages.mjs.map +1 -1
- package/build/i18n/cs.json +12 -9
- package/build/i18n/cs.json.js +12 -9
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +12 -9
- package/build/i18n/cs.json.mjs.map +1 -1
- package/build/i18n/de.json +3 -0
- package/build/i18n/de.json.js +3 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +3 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/en.json +3 -0
- package/build/i18n/en.json.js +3 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +3 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/i18n/es.json +3 -0
- package/build/i18n/es.json.js +3 -0
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +3 -0
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/fr.json +3 -0
- package/build/i18n/fr.json.js +3 -0
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +3 -0
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +3 -0
- package/build/i18n/hu.json.js +3 -0
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +3 -0
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/id.json +3 -0
- package/build/i18n/id.json.js +3 -0
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +3 -0
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/index.js.map +1 -1
- package/build/i18n/index.mjs.map +1 -1
- package/build/i18n/it.json +3 -0
- package/build/i18n/it.json.js +3 -0
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +3 -0
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +3 -0
- package/build/i18n/ja.json.js +3 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +3 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/nl.json +6 -3
- package/build/i18n/pl.json +3 -0
- package/build/i18n/pl.json.js +3 -0
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +3 -0
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +3 -0
- package/build/i18n/pt.json.js +3 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +3 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +3 -0
- package/build/i18n/ro.json.js +3 -0
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +3 -0
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +3 -0
- package/build/i18n/ru.json.js +3 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +3 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/th.json +3 -0
- package/build/i18n/th.json.js +3 -0
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +3 -0
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/i18n/tr.json +3 -0
- package/build/i18n/tr.json.js +3 -0
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +3 -0
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +3 -0
- package/build/i18n/zh-CN.json.js +3 -0
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +3 -0
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +3 -0
- package/build/i18n/zh-HK.json.js +3 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +3 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/iconButton/IconButton.js.map +1 -1
- package/build/iconButton/IconButton.mjs.map +1 -1
- package/build/image/Image.js +9 -10
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs +11 -11
- package/build/image/Image.mjs.map +1 -1
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.messages.js.map +1 -1
- package/build/info/Info.messages.mjs.map +1 -1
- package/build/info/Info.mjs.map +1 -1
- package/build/info/infoPresentations.js.map +1 -1
- package/build/info/infoPresentations.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.js.map +1 -1
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.mjs.map +1 -1
- package/build/inputs/Input.js.map +1 -1
- package/build/inputs/Input.mjs.map +1 -1
- package/build/inputs/InputGroup.js +16 -20
- package/build/inputs/InputGroup.js.map +1 -1
- package/build/inputs/InputGroup.mjs +17 -21
- package/build/inputs/InputGroup.mjs.map +1 -1
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/inputs/SelectInput.js +6 -1
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.messages.js.map +1 -1
- package/build/inputs/SelectInput.messages.mjs.map +1 -1
- package/build/inputs/SelectInput.mjs +6 -1
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/inputs/TextArea.js.map +1 -1
- package/build/inputs/TextArea.mjs.map +1 -1
- package/build/inputs/_BottomSheet.js.map +1 -1
- package/build/inputs/_BottomSheet.mjs.map +1 -1
- package/build/inputs/_ButtonInput.js.map +1 -1
- package/build/inputs/_ButtonInput.mjs.map +1 -1
- package/build/inputs/_Popover.js.map +1 -1
- package/build/inputs/_Popover.mjs +1 -1
- package/build/inputs/_Popover.mjs.map +1 -1
- package/build/inputs/_common.js.map +1 -1
- package/build/inputs/_common.mjs.map +1 -1
- package/build/inputs/contexts.js.map +1 -1
- package/build/inputs/contexts.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/label/Label.js.map +1 -1
- package/build/label/Label.messages.js.map +1 -1
- package/build/label/Label.messages.mjs.map +1 -1
- package/build/label/Label.mjs.map +1 -1
- package/build/legacylistItem/LegacyListItem.js.map +1 -1
- package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
- package/build/legacylistItem/List.js.map +1 -1
- package/build/legacylistItem/List.mjs.map +1 -1
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.messages.js.map +1 -1
- package/build/link/Link.messages.mjs.map +1 -1
- package/build/link/Link.mjs.map +1 -1
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs.map +1 -1
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +1 -1
- package/build/logo/Logo.mjs.map +1 -1
- package/build/logo/logo-assets.js.map +1 -1
- package/build/logo/logo-assets.mjs.map +1 -1
- package/build/main.css +20 -2
- package/build/markdown/Markdown.js +20 -4
- package/build/markdown/Markdown.js.map +1 -1
- package/build/markdown/Markdown.mjs +1 -1
- package/build/markdown/Markdown.mjs.map +1 -1
- package/build/mocks.js.map +1 -1
- package/build/mocks.mjs.map +1 -1
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs.map +1 -1
- package/build/money/Money.js.map +1 -1
- package/build/money/Money.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.js +4 -8
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.js +3 -0
- package/build/moneyInput/MoneyInput.messages.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.mjs +3 -0
- package/build/moneyInput/MoneyInput.messages.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +4 -8
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/moneyInput/currencyFormatting.js.map +1 -1
- package/build/moneyInput/currencyFormatting.mjs.map +1 -1
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +38 -4
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.js +6 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs +6 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +38 -4
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/phoneNumberInput/data/countries.js.map +1 -1
- package/build/phoneNumberInput/data/countries.mjs.map +1 -1
- package/build/phoneNumberInput/utils/cleanNumber/cleanNumber.js.map +1 -1
- package/build/phoneNumberInput/utils/cleanNumber/cleanNumber.mjs.map +1 -1
- package/build/phoneNumberInput/utils/excludeCountries/excludeCountries.js.map +1 -1
- package/build/phoneNumberInput/utils/excludeCountries/excludeCountries.mjs.map +1 -1
- package/build/phoneNumberInput/utils/explodeNumberModel/index.js.map +1 -1
- package/build/phoneNumberInput/utils/explodeNumberModel/index.mjs.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByCode/index.js.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByCode/index.mjs.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.js.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.mjs.map +1 -1
- package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js.map +1 -1
- package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.mjs.map +1 -1
- package/build/phoneNumberInput/utils/setDefaultPrefix/index.js.map +1 -1
- package/build/phoneNumberInput/utils/setDefaultPrefix/index.mjs.map +1 -1
- package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js.map +1 -1
- package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.mjs.map +1 -1
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +1 -1
- package/build/popover/Popover.mjs.map +1 -1
- package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -1
- package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.mjs.map +1 -1
- package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -1
- package/build/primitives/PrimitiveButton/PrimitiveButton.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/progress/Progress.js.map +1 -1
- package/build/progress/Progress.mjs.map +1 -1
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/progressBar/ProgressBar.mjs.map +1 -1
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/promoCard/PromoCardContext.js.map +1 -1
- package/build/promoCard/PromoCardContext.mjs.map +1 -1
- package/build/promoCard/PromoCardGroup.js +1 -1
- package/build/promoCard/PromoCardGroup.js.map +1 -1
- package/build/promoCard/PromoCardGroup.mjs +1 -1
- package/build/promoCard/PromoCardGroup.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +1 -1
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
- package/build/provider/Provider.js.map +1 -1
- package/build/provider/Provider.mjs.map +1 -1
- package/build/provider/direction/DirectionProvider.js.map +1 -1
- package/build/provider/direction/DirectionProvider.mjs.map +1 -1
- package/build/provider/language/LanguageProvider.js.map +1 -1
- package/build/provider/language/LanguageProvider.mjs.map +1 -1
- package/build/provider/overlay/OverlayIdProvider.js.map +1 -1
- package/build/provider/overlay/OverlayIdProvider.mjs +1 -1
- package/build/provider/overlay/OverlayIdProvider.mjs.map +1 -1
- package/build/radio/Radio.js.map +1 -1
- package/build/radio/Radio.mjs.map +1 -1
- package/build/radioGroup/RadioGroup.js.map +1 -1
- package/build/radioGroup/RadioGroup.mjs.map +1 -1
- package/build/radioOption/RadioOption.js.map +1 -1
- package/build/radioOption/RadioOption.mjs.map +1 -1
- package/build/section/Section.js.map +1 -1
- package/build/section/Section.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/select/Select.js +14 -22
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.messages.js.map +1 -1
- package/build/select/Select.messages.mjs.map +1 -1
- package/build/select/Select.mjs +14 -22
- package/build/select/Select.mjs.map +1 -1
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/Option.mjs.map +1 -1
- package/build/select/searchBox/SearchBox.js.map +1 -1
- package/build/select/searchBox/SearchBox.mjs.map +1 -1
- package/build/selectOption/SelectOption.js.map +1 -1
- package/build/selectOption/SelectOption.messages.js.map +1 -1
- package/build/selectOption/SelectOption.messages.mjs.map +1 -1
- package/build/selectOption/SelectOption.mjs +1 -1
- package/build/selectOption/SelectOption.mjs.map +1 -1
- package/build/slidingPanel/SlidingPanel.js.map +1 -1
- package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
- package/build/snackbar/Snackbar.js +1 -1
- package/build/snackbar/Snackbar.js.map +1 -1
- package/build/snackbar/Snackbar.mjs +1 -1
- package/build/snackbar/Snackbar.mjs.map +1 -1
- package/build/snackbar/SnackbarContext.js.map +1 -1
- package/build/snackbar/SnackbarContext.mjs.map +1 -1
- package/build/snackbar/SnackbarProvider.js.map +1 -1
- package/build/snackbar/SnackbarProvider.mjs.map +1 -1
- package/build/snackbar/useSnackbar.js.map +1 -1
- package/build/snackbar/useSnackbar.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +1 -1
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/stepper/deviceDetection.js.map +1 -1
- package/build/stepper/deviceDetection.mjs.map +1 -1
- package/build/sticky/Sticky.js.map +1 -1
- package/build/sticky/Sticky.mjs.map +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -0
- package/build/styles/dateInput/DateInput.css +2 -1
- package/build/styles/inputs/Input.css +10 -0
- package/build/styles/inputs/TextArea.css +10 -0
- package/build/styles/main.css +20 -2
- package/build/styles/upload/Upload.css +3 -0
- package/build/styles/uploadInput/uploadItem/UploadItem.css +2 -1
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.messages.js.map +1 -1
- package/build/summary/Summary.messages.mjs.map +1 -1
- package/build/summary/Summary.mjs +1 -1
- package/build/summary/Summary.mjs.map +1 -1
- package/build/switch/Switch.js.map +1 -1
- package/build/switch/Switch.mjs.map +1 -1
- package/build/switchOption/SwitchOption.js.map +1 -1
- package/build/switchOption/SwitchOption.mjs.map +1 -1
- package/build/table/Table.js.map +1 -1
- package/build/table/Table.messages.js.map +1 -1
- package/build/table/Table.messages.mjs.map +1 -1
- package/build/table/Table.mjs.map +1 -1
- package/build/table/TableCell.js.map +1 -1
- package/build/table/TableCell.mjs.map +1 -1
- package/build/table/TableHeader.js.map +1 -1
- package/build/table/TableHeader.mjs.map +1 -1
- package/build/table/TableRow.js.map +1 -1
- package/build/table/TableRow.mjs.map +1 -1
- package/build/table/TableStatusText.js.map +1 -1
- package/build/table/TableStatusText.mjs.map +1 -1
- package/build/tabs/Tab.js.map +1 -1
- package/build/tabs/Tab.mjs.map +1 -1
- package/build/tabs/TabList.js.map +1 -1
- package/build/tabs/TabList.mjs.map +1 -1
- package/build/tabs/TabPanel.js.map +1 -1
- package/build/tabs/TabPanel.mjs.map +1 -1
- package/build/tabs/Tabs.js +3 -3
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +4 -4
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tabs/utils.js +1 -1
- package/build/tabs/utils.js.map +1 -1
- package/build/tabs/utils.mjs +1 -1
- package/build/tabs/utils.mjs.map +1 -1
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js.map +1 -1
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.mjs.map +1 -1
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs.map +1 -1
- package/build/title/Title.js.map +1 -1
- package/build/title/Title.mjs.map +1 -1
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +57 -61
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.messages.js.map +1 -1
- package/build/typeahead/Typeahead.messages.mjs.map +1 -1
- package/build/typeahead/Typeahead.mjs +57 -61
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -1
- package/build/typeahead/typeaheadOption/TypeaheadOption.js.map +1 -1
- package/build/typeahead/typeaheadOption/TypeaheadOption.mjs.map +1 -1
- package/build/typeahead/util/highlight.js.map +1 -1
- package/build/typeahead/util/highlight.mjs.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts.map +1 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/chevron/Chevron.d.ts.map +1 -1
- package/build/types/chips/Chip.d.ts.map +1 -1
- package/build/types/chips/Chips.d.ts.map +1 -1
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts +2 -0
- package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
- package/build/types/common/colors.d.ts.map +1 -1
- package/build/types/common/dateUtils/getDateView/getDateView.d.ts.map +1 -1
- package/build/types/common/dateUtils/getMonthNames/getMonthNames.d.ts.map +1 -1
- package/build/types/common/dateUtils/isDateValid/isDateValid.d.ts.map +1 -1
- package/build/types/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.d.ts.map +1 -1
- package/build/types/common/fakeEvents.d.ts.map +1 -1
- package/build/types/common/focusBoundary/FocusBoundary.d.ts.map +1 -1
- package/build/types/common/historyNavigator/historyNavigator.d.ts.map +1 -1
- package/build/types/common/hooks/useConditionalListener/useConditionalListener.d.ts.map +1 -1
- package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts.map +1 -1
- package/build/types/common/initials.d.ts.map +1 -1
- package/build/types/common/textFormat/formatWithPattern/formatWithPattern.d.ts.map +1 -1
- package/build/types/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.d.ts.map +1 -1
- package/build/types/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.d.ts.map +1 -1
- package/build/types/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.d.ts.map +1 -1
- package/build/types/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.d.ts.map +1 -1
- package/build/types/common/textFormat/unformatWithPattern/unformatWithPattern.d.ts.map +1 -1
- package/build/types/common/theme.d.ts.map +1 -1
- package/build/types/dateInput/DateInput.d.ts.map +1 -1
- package/build/types/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.d.ts.map +1 -1
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -1
- package/build/types/dateLookup/tableLink/TableLink.d.ts.map +1 -1
- package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +1 -1
- package/build/types/decision/Decision.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/dropFade/DropFade.d.ts.map +1 -1
- package/build/types/emphasis/Emphasis.d.ts.map +1 -1
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts.map +1 -1
- package/build/types/header/Header.d.ts.map +1 -1
- package/build/types/image/Image.d.ts +0 -1
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/info/Info.d.ts.map +1 -1
- package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/instructionsList/InstructionsList.d.ts.map +1 -1
- package/build/types/link/Link.d.ts.map +1 -1
- package/build/types/loader/Loader.d.ts.map +1 -1
- package/build/types/markdown/Markdown.d.ts.map +1 -1
- package/build/types/modal/Modal.d.ts.map +1 -1
- package/build/types/money/Money.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.messages.d.ts +5 -0
- package/build/types/moneyInput/MoneyInput.messages.d.ts.map +1 -1
- package/build/types/navigationOptionsList/NavigationOptionsList.d.ts.map +1 -1
- package/build/types/nudge/Nudge.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts +8 -0
- package/build/types/phoneNumberInput/PhoneNumberInput.messages.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/cleanNumber/cleanNumber.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/excludeCountries/excludeCountries.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/explodeNumberModel/index.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/findCountryByCode/index.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/findCountryByPrefix/index.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/isStringNumeric/isStringNumeric.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/longestMatchingPrefix/index.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/setDefaultPrefix/index.d.ts.map +1 -1
- package/build/types/progress/Progress.d.ts.map +1 -1
- package/build/types/progressBar/ProgressBar.d.ts.map +1 -1
- package/build/types/provider/direction/DirectionProvider.d.ts.map +1 -1
- package/build/types/provider/language/LanguageProvider.d.ts.map +1 -1
- package/build/types/provider/overlay/OverlayIdProvider.d.ts.map +1 -1
- package/build/types/section/Section.d.ts.map +1 -1
- package/build/types/segmentedControl/SegmentedControl.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/stepper/Stepper.d.ts.map +1 -1
- package/build/types/summary/Summary.d.ts.map +1 -1
- package/build/types/switch/Switch.d.ts.map +1 -1
- package/build/types/switchOption/SwitchOption.d.ts.map +1 -1
- package/build/types/table/Table.d.ts.map +1 -1
- package/build/types/table/TableCell.d.ts.map +1 -1
- package/build/types/table/TableHeader.d.ts.map +1 -1
- package/build/types/table/TableRow.d.ts.map +1 -1
- package/build/types/table/TableStatusText.d.ts.map +1 -1
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/tabs/utils.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +6 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts.map +1 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts +1 -2
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/upload/steps/processingStep/processingStep.d.ts +1 -3
- package/build/types/upload/steps/processingStep/processingStep.d.ts.map +1 -1
- package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts +1 -0
- package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadButton/getAllowedFileTypes.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/types/withNextPortal/withNextPortal.d.ts.map +1 -1
- package/build/upload/Upload.js +29 -45
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.messages.js.map +1 -1
- package/build/upload/Upload.messages.mjs.map +1 -1
- package/build/upload/Upload.mjs +29 -45
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -3
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -3
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +8 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +8 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/upload/utils/asyncFileRead/asyncFileRead.js.map +1 -1
- package/build/upload/utils/asyncFileRead/asyncFileRead.mjs.map +1 -1
- package/build/upload/utils/getFileType/getFileType.js.map +1 -1
- package/build/upload/utils/getFileType/getFileType.mjs.map +1 -1
- package/build/upload/utils/isSizeValid/isSizeValid.js.map +1 -1
- package/build/upload/utils/isSizeValid/isSizeValid.mjs.map +1 -1
- package/build/upload/utils/isTypeValid/isTypeValid.js.map +1 -1
- package/build/upload/utils/isTypeValid/isTypeValid.mjs.map +1 -1
- package/build/upload/utils/postData/postData.js.map +1 -1
- package/build/upload/utils/postData/postData.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +55 -6
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.messages.js.map +1 -1
- package/build/uploadInput/UploadInput.messages.mjs.map +1 -1
- package/build/uploadInput/UploadInput.mjs +57 -8
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.messages.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.messages.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadButton/defaults.js.map +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
- package/build/uploadInput/uploadButton/getAllowedFileTypes.js.map +1 -1
- package/build/uploadInput/uploadButton/getAllowedFileTypes.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +12 -6
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.messages.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.messages.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +12 -6
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
- package/build/utilities/cssValueWithUnit.js.map +1 -1
- package/build/utilities/cssValueWithUnit.mjs.map +1 -1
- package/build/utilities/logActionRequired.js.map +1 -1
- package/build/utilities/logActionRequired.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +6 -7
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +6 -7
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/build/withId/withId.js.map +1 -1
- package/build/withId/withId.mjs.map +1 -1
- package/build/withNextPortal/withNextPortal.js +1 -1
- package/build/withNextPortal/withNextPortal.js.map +1 -1
- package/build/withNextPortal/withNextPortal.mjs +1 -1
- package/build/withNextPortal/withNextPortal.mjs.map +1 -1
- package/package.json +56 -59
- package/src/alert/Alert.spec.tsx +13 -4
- package/src/alert/Alert.story.tsx +23 -9
- package/src/alert/Alert.tsx +14 -1
- package/src/card/Card.story.tsx +4 -2
- package/src/checkbox/Checkbox.story.tsx +3 -2
- package/src/circularButton/CircularButton.css +1 -0
- package/src/circularButton/CircularButton.less +1 -0
- package/src/circularButton/CircularButton.tests.story.tsx +23 -0
- package/src/common/closeButton/CloseButton.spec.tsx +13 -1
- package/src/common/closeButton/CloseButton.tsx +3 -0
- package/src/common/initials.spec.tsx +42 -0
- package/src/common/initials.ts +4 -0
- package/src/dateInput/DateInput.css +2 -1
- package/src/dateInput/DateInput.less +7 -4
- package/src/dateInput/DateInput.story.tsx +2 -2
- package/src/dateInput/DateInput.tests.story.tsx +11 -10
- package/src/i18n/cs.json +12 -9
- package/src/i18n/de.json +3 -0
- package/src/i18n/en.json +3 -0
- package/src/i18n/es.json +3 -0
- package/src/i18n/fr.json +3 -0
- package/src/i18n/hu.json +3 -0
- package/src/i18n/id.json +3 -0
- package/src/i18n/it.json +3 -0
- package/src/i18n/ja.json +3 -0
- package/src/i18n/nl.json +6 -3
- package/src/i18n/pl.json +3 -0
- package/src/i18n/pt.json +3 -0
- package/src/i18n/ro.json +3 -0
- package/src/i18n/ru.json +3 -0
- package/src/i18n/th.json +3 -0
- package/src/i18n/tr.json +3 -0
- package/src/i18n/zh-CN.json +3 -0
- package/src/i18n/zh-HK.json +3 -0
- package/src/image/Image.spec.tsx +3 -3
- package/src/image/Image.tsx +10 -12
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +1 -1
- package/src/inputs/Input.css +10 -0
- package/src/inputs/SelectInput.tsx +11 -2
- package/src/inputs/TextArea.css +10 -0
- package/src/inputs/_common.less +6 -0
- package/src/main.css +20 -2
- package/src/markdown/Markdown.tsx +2 -1
- package/src/moneyInput/MoneyInput.messages.ts +5 -0
- package/src/moneyInput/MoneyInput.spec.tsx +42 -5
- package/src/moneyInput/MoneyInput.story.tsx +11 -2
- package/src/moneyInput/MoneyInput.tsx +5 -7
- package/src/phoneNumberInput/PhoneNumberInput.messages.ts +8 -0
- package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +77 -43
- package/src/phoneNumberInput/PhoneNumberInput.tsx +36 -4
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +3 -2
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +3 -2
- package/src/promoCard/__snapshots__/PromoCard.spec.tsx.snap +1 -0
- package/src/promoCard/__snapshots__/PromoCardGroup.spec.tsx.snap +2 -0
- package/src/radioGroup/RadioGroup.story.tsx +2 -2
- package/src/tabs/Tabs.spec.tsx +137 -0
- package/src/tabs/Tabs.story.tsx +1 -0
- package/src/tabs/Tabs.tsx +0 -1
- package/src/test-utils/jest.setup.ts +0 -4
- package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.spec.js +9 -8
- package/src/typeahead/Typeahead.spec.tsx +182 -0
- package/src/typeahead/Typeahead.story.tsx +3 -2
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.tsx +103 -0
- package/src/typeahead/util/highlight.spec.tsx +43 -0
- package/src/upload/Upload.css +3 -0
- package/src/upload/Upload.less +7 -1
- package/src/upload/Upload.spec.tsx +63 -0
- package/src/upload/Upload.story.tsx +1 -52
- package/src/upload/Upload.tests.story.tsx +93 -0
- package/src/upload/Upload.tsx +28 -49
- package/src/upload/steps/processingStep/processingStep.tsx +2 -7
- package/src/upload/steps/uploadImageStep/uploadImageStep.spec.tsx +15 -0
- package/src/upload/steps/uploadImageStep/uploadImageStep.tsx +8 -0
- package/src/uploadInput/UploadInput.tsx +81 -8
- package/src/uploadInput/uploadItem/UploadItem.css +2 -1
- package/src/uploadInput/uploadItem/UploadItem.less +1 -1
- package/src/uploadInput/uploadItem/UploadItem.tsx +11 -6
- package/src/withDisplayFormat/WithDisplayFormat.spec.js +123 -216
- package/src/withDisplayFormat/WithDisplayFormat.tsx +7 -8
- package/src/tabs/Tabs.spec.js +0 -423
- package/src/typeahead/Typeahead.rtl.spec.tsx +0 -54
- package/src/typeahead/Typeahead.spec.js +0 -404
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.js +0 -74
- package/src/typeahead/typeaheadOption/TypeaheadOption.spec.js +0 -75
- package/src/typeahead/util/highlight.spec.js +0 -34
- package/src/withDisplayFormat/WithDisplayFormat.state.spec.js +0 -42
|
@@ -27,7 +27,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
27
27
|
import InlineAlert from '../../../inlineAlert/InlineAlert.mjs';
|
|
28
28
|
|
|
29
29
|
class UploadImageStep extends PureComponent {
|
|
30
|
-
uploadInputRef = /*#__PURE__*/createRef();
|
|
30
|
+
uploadInputRef = (() => /*#__PURE__*/createRef())();
|
|
31
31
|
onManualUpload = () => {
|
|
32
32
|
const {
|
|
33
33
|
fileDropped
|
|
@@ -37,6 +37,12 @@ class UploadImageStep extends PureComponent {
|
|
|
37
37
|
fileDropped(file);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
+
onKeyDown = event => {
|
|
41
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
this.uploadInputRef.current?.click();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
40
46
|
getImage = () => {
|
|
41
47
|
const {
|
|
42
48
|
usHelpImage,
|
|
@@ -102,6 +108,7 @@ class UploadImageStep extends PureComponent {
|
|
|
102
108
|
role: "button",
|
|
103
109
|
"aria-disabled": usDisabled,
|
|
104
110
|
tabIndex: 0,
|
|
111
|
+
onKeyDown: this.onKeyDown,
|
|
105
112
|
children: [usButtonText ? /*#__PURE__*/jsx("span", {
|
|
106
113
|
children: usButtonText
|
|
107
114
|
}) : /*#__PURE__*/jsx(Upload, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadImageStep.mjs","sources":["../../../../src/upload/steps/uploadImageStep/uploadImageStep.tsx"],"sourcesContent":["import { Upload as UploadIcon } from '@transferwise/icons';\nimport { createRef, PureComponent } from 'react';\nimport StatusIcon from '../../../statusIcon';\nimport { Sentiment, Size } from '../../../common';\nimport InlineAlert from '../../../inlineAlert';\n\nexport interface UploadImageStepProps {\n fileDropped: (file: File) => void;\n isComplete: boolean;\n usAccept: string;\n usButtonText: string;\n usDisabled: boolean;\n usHelpImage: React.ReactNode;\n usLabel: string;\n usPlaceholder: string;\n errorMessage?: string | string[];\n errorIconLabel?: string;\n}\n\nexport default class UploadImageStep extends PureComponent<UploadImageStepProps> {\n uploadInputRef = createRef<HTMLInputElement>();\n\n onManualUpload = () => {\n const { fileDropped } = this.props;\n const file = this.uploadInputRef.current?.files?.[0];\n if (file != null) {\n fileDropped(file);\n }\n };\n\n getImage = () => {\n const { usHelpImage, usLabel } = this.props;\n const { errorMessage } = this.props;\n\n if (errorMessage) {\n return (\n <div className=\"d-flex flex-column align-items-center\">\n <StatusIcon size={Size.LARGE} sentiment={Sentiment.NEGATIVE} iconLabel={null} />\n </div>\n );\n }\n\n if (!usHelpImage) {\n return (\n <div className=\"circle circle-sm circle-inverse p-t-1\">\n <UploadIcon size={24} />\n </div>\n );\n }\n\n if (typeof usHelpImage === 'string') {\n return <img src={usHelpImage} alt={usLabel} className=\"thumbnail text-xs-center\" />;\n }\n\n return usHelpImage;\n };\n\n render() {\n const {\n errorMessage,\n isComplete,\n errorIconLabel,\n usAccept,\n usButtonText,\n usDisabled,\n usLabel,\n usPlaceholder,\n } = this.props;\n\n return (\n <div className=\"droppable-default-card\" aria-hidden={isComplete}>\n <div className=\"droppable-card-content\">\n <div className=\"m-b-3\">{this.getImage()}</div>\n {usLabel && <h4 className=\"np-text-title-body m-b-1\">{usLabel}</h4>}\n {usPlaceholder && <p className=\"np-text-body-large m-b-3\">{String(usPlaceholder)}</p>}\n <label\n className={`btn btn-primary btn-md ${usDisabled ? 'disabled' : ''}`}\n role=\"button\"\n aria-disabled={usDisabled}\n tabIndex={0}\n >\n {usButtonText ? (\n <span>{usButtonText}</span>\n ) : (\n <UploadIcon size={24} className=\"m-r-0\" />\n )}\n <input\n ref={this.uploadInputRef}\n type=\"file\"\n accept={usAccept === '*' ? undefined : usAccept}\n className=\"tw-droppable-input hidden\"\n disabled={usDisabled}\n name=\"file-upload\"\n onChange={() => this.onManualUpload()}\n />\n </label>\n {errorMessage && (\n <div className=\"upload-error-message\">\n <div className=\"m-t-3 has-error\">\n <InlineAlert type={Sentiment.NEGATIVE} iconLabel={errorIconLabel}>\n {errorMessage}\n </InlineAlert>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n }\n}\n"],"names":["UploadImageStep","PureComponent","uploadInputRef","createRef","onManualUpload","fileDropped","props","file","current","files","getImage","usHelpImage","usLabel","errorMessage","_jsx","className","children","StatusIcon","size","Size","LARGE","sentiment","Sentiment","NEGATIVE","iconLabel","UploadIcon","src","alt","render","isComplete","errorIconLabel","usAccept","usButtonText","usDisabled","usPlaceholder","_jsxs","String","role","tabIndex","ref","type","accept","undefined","disabled","name","onChange","InlineAlert"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBqB,MAAAA,eAAgB,SAAQC,aAAmC,CAAA;EAC9EC,cAAc,
|
|
1
|
+
{"version":3,"file":"uploadImageStep.mjs","sources":["../../../../src/upload/steps/uploadImageStep/uploadImageStep.tsx"],"sourcesContent":["import { Upload as UploadIcon } from '@transferwise/icons';\nimport { createRef, PureComponent } from 'react';\nimport StatusIcon from '../../../statusIcon';\nimport { Sentiment, Size } from '../../../common';\nimport InlineAlert from '../../../inlineAlert';\n\nexport interface UploadImageStepProps {\n fileDropped: (file: File) => void;\n isComplete: boolean;\n usAccept: string;\n usButtonText: string;\n usDisabled: boolean;\n usHelpImage: React.ReactNode;\n usLabel: string;\n usPlaceholder: string;\n errorMessage?: string | string[];\n errorIconLabel?: string;\n}\n\nexport default class UploadImageStep extends PureComponent<UploadImageStepProps> {\n uploadInputRef = createRef<HTMLInputElement>();\n\n onManualUpload = () => {\n const { fileDropped } = this.props;\n const file = this.uploadInputRef.current?.files?.[0];\n if (file != null) {\n fileDropped(file);\n }\n };\n\n onKeyDown = (event: React.KeyboardEvent<HTMLLabelElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.uploadInputRef.current?.click();\n }\n };\n\n getImage = () => {\n const { usHelpImage, usLabel } = this.props;\n const { errorMessage } = this.props;\n\n if (errorMessage) {\n return (\n <div className=\"d-flex flex-column align-items-center\">\n <StatusIcon size={Size.LARGE} sentiment={Sentiment.NEGATIVE} iconLabel={null} />\n </div>\n );\n }\n\n if (!usHelpImage) {\n return (\n <div className=\"circle circle-sm circle-inverse p-t-1\">\n <UploadIcon size={24} />\n </div>\n );\n }\n\n if (typeof usHelpImage === 'string') {\n return <img src={usHelpImage} alt={usLabel} className=\"thumbnail text-xs-center\" />;\n }\n\n return usHelpImage;\n };\n\n render() {\n const {\n errorMessage,\n isComplete,\n errorIconLabel,\n usAccept,\n usButtonText,\n usDisabled,\n usLabel,\n usPlaceholder,\n } = this.props;\n\n return (\n <div className=\"droppable-default-card\" aria-hidden={isComplete}>\n <div className=\"droppable-card-content\">\n <div className=\"m-b-3\">{this.getImage()}</div>\n {usLabel && <h4 className=\"np-text-title-body m-b-1\">{usLabel}</h4>}\n {usPlaceholder && <p className=\"np-text-body-large m-b-3\">{String(usPlaceholder)}</p>}\n <label\n className={`btn btn-primary btn-md ${usDisabled ? 'disabled' : ''}`}\n role=\"button\"\n aria-disabled={usDisabled}\n tabIndex={0}\n onKeyDown={this.onKeyDown}\n >\n {usButtonText ? (\n <span>{usButtonText}</span>\n ) : (\n <UploadIcon size={24} className=\"m-r-0\" />\n )}\n <input\n ref={this.uploadInputRef}\n type=\"file\"\n accept={usAccept === '*' ? undefined : usAccept}\n className=\"tw-droppable-input hidden\"\n disabled={usDisabled}\n name=\"file-upload\"\n onChange={() => this.onManualUpload()}\n />\n </label>\n {errorMessage && (\n <div className=\"upload-error-message\">\n <div className=\"m-t-3 has-error\">\n <InlineAlert type={Sentiment.NEGATIVE} iconLabel={errorIconLabel}>\n {errorMessage}\n </InlineAlert>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n }\n}\n"],"names":["UploadImageStep","PureComponent","uploadInputRef","createRef","onManualUpload","fileDropped","props","file","current","files","onKeyDown","event","key","preventDefault","click","getImage","usHelpImage","usLabel","errorMessage","_jsx","className","children","StatusIcon","size","Size","LARGE","sentiment","Sentiment","NEGATIVE","iconLabel","UploadIcon","src","alt","render","isComplete","errorIconLabel","usAccept","usButtonText","usDisabled","usPlaceholder","_jsxs","String","role","tabIndex","ref","type","accept","undefined","disabled","name","onChange","InlineAlert"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBqB,MAAAA,eAAgB,SAAQC,aAAmC,CAAA;EAC9EC,cAAc,GAAA,CAAA,mBAAGC,SAAS,EAAoB,GAAA;EAE9CC,cAAc,GAAGA,MAAK;IACpB,MAAM;AAAEC,MAAAA;KAAa,GAAG,IAAI,CAACC,KAAK;IAClC,MAAMC,IAAI,GAAG,IAAI,CAACL,cAAc,CAACM,OAAO,EAAEC,KAAK,GAAG,CAAC,CAAC;IACpD,IAAIF,IAAI,IAAI,IAAI,EAAE;MAChBF,WAAW,CAACE,IAAI,CAAC;AACnB;GACD;EAEDG,SAAS,GAAIC,KAA4C,IAAI;IAC3D,IAAIA,KAAK,CAACC,GAAG,KAAK,OAAO,IAAID,KAAK,CAACC,GAAG,KAAK,GAAG,EAAE;MAC9CD,KAAK,CAACE,cAAc,EAAE;AACtB,MAAA,IAAI,CAACX,cAAc,CAACM,OAAO,EAAEM,KAAK,EAAE;AACtC;GACD;EAEDC,QAAQ,GAAGA,MAAK;IACd,MAAM;MAAEC,WAAW;AAAEC,MAAAA;KAAS,GAAG,IAAI,CAACX,KAAK;IAC3C,MAAM;AAAEY,MAAAA;KAAc,GAAG,IAAI,CAACZ,KAAK;AAEnC,IAAA,IAAIY,YAAY,EAAE;AAChB,MAAA,oBACEC,GAAA,CAAA,KAAA,EAAA;AAAKC,QAAAA,SAAS,EAAC,uCAAuC;QAAAC,QAAA,eACpDF,GAAA,CAACG,UAAU,EAAA;UAACC,IAAI,EAAEC,IAAI,CAACC,KAAM;UAACC,SAAS,EAAEC,SAAS,CAACC,QAAS;AAACC,UAAAA,SAAS,EAAE;SAC1E;AAAA,OAAK,CAAC;AAEV;IAEA,IAAI,CAACb,WAAW,EAAE;AAChB,MAAA,oBACEG,GAAA,CAAA,KAAA,EAAA;AAAKC,QAAAA,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Read.ts"],"sourcesContent":["export async function asyncFileRead(file: Blob) {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n resolve(reader.result as string);\n });\n reader.addEventListener('error', () => {\n reject(reader.error ?? new Error('Cannot read file'));\n });\n reader.readAsDataURL(file);\n });\n}\n"],"names":["asyncFileRead","file","Promise","resolve","reject","reader","FileReader","addEventListener","result","error","Error","readAsDataURL"],"mappings":";;AAAO,eAAeA,aAAaA,CAACC,IAAU,EAAA;AAC5C,EAAA,OAAO,IAAIC,OAAO,CAAS,CAACC,OAAO,EAAEC,MAAM,KAAI;AAC7C,IAAA,MAAMC,MAAM,GAAG,IAAIC,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"asyncFileRead.js","sources":["../../../../src/upload/utils/asyncFileRead/asyncFileRead.ts"],"sourcesContent":["export async function asyncFileRead(file: Blob) {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n resolve(reader.result as string);\n });\n reader.addEventListener('error', () => {\n reject(reader.error ?? new Error('Cannot read file'));\n });\n reader.readAsDataURL(file);\n });\n}\n"],"names":["asyncFileRead","file","Promise","resolve","reject","reader","FileReader","addEventListener","result","error","Error","readAsDataURL"],"mappings":";;AAAO,eAAeA,aAAaA,CAACC,IAAU,EAAA;AAC5C,EAAA,OAAO,IAAIC,OAAO,CAAS,CAACC,OAAO,EAAEC,MAAM,KAAI;AAC7C,IAAA,MAAMC,MAAM,GAAG,IAAIC,UAAU,EAAE;AAC/BD,IAAAA,MAAM,CAACE,gBAAgB,CAAC,MAAM,EAAE,MAAK;AACnCJ,MAAAA,OAAO,CAACE,MAAM,CAACG,MAAgB,CAAC;AAClC,KAAC,CAAC;AACFH,IAAAA,MAAM,CAACE,gBAAgB,CAAC,OAAO,EAAE,MAAK;MACpCH,MAAM,CAACC,MAAM,CAACI,KAAK,IAAI,IAAIC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACvD,KAAC,CAAC;AACFL,IAAAA,MAAM,CAACM,aAAa,CAACV,IAAI,CAAC;AAC5B,GAAC,CAAC;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncFileRead.mjs","sources":["../../../../src/upload/utils/asyncFileRead/asyncFileRead.ts"],"sourcesContent":["export async function asyncFileRead(file: Blob) {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n resolve(reader.result as string);\n });\n reader.addEventListener('error', () => {\n reject(reader.error ?? new Error('Cannot read file'));\n });\n reader.readAsDataURL(file);\n });\n}\n"],"names":["asyncFileRead","file","Promise","resolve","reject","reader","FileReader","addEventListener","result","error","Error","readAsDataURL"],"mappings":"AAAO,eAAeA,aAAaA,CAACC,IAAU,EAAA;AAC5C,EAAA,OAAO,IAAIC,OAAO,CAAS,CAACC,OAAO,EAAEC,MAAM,KAAI;AAC7C,IAAA,MAAMC,MAAM,GAAG,IAAIC,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"asyncFileRead.mjs","sources":["../../../../src/upload/utils/asyncFileRead/asyncFileRead.ts"],"sourcesContent":["export async function asyncFileRead(file: Blob) {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.addEventListener('load', () => {\n resolve(reader.result as string);\n });\n reader.addEventListener('error', () => {\n reject(reader.error ?? new Error('Cannot read file'));\n });\n reader.readAsDataURL(file);\n });\n}\n"],"names":["asyncFileRead","file","Promise","resolve","reject","reader","FileReader","addEventListener","result","error","Error","readAsDataURL"],"mappings":"AAAO,eAAeA,aAAaA,CAACC,IAAU,EAAA;AAC5C,EAAA,OAAO,IAAIC,OAAO,CAAS,CAACC,OAAO,EAAEC,MAAM,KAAI;AAC7C,IAAA,MAAMC,MAAM,GAAG,IAAIC,UAAU,EAAE;AAC/BD,IAAAA,MAAM,CAACE,gBAAgB,CAAC,MAAM,EAAE,MAAK;AACnCJ,MAAAA,OAAO,CAACE,MAAM,CAACG,MAAgB,CAAC;AAClC,KAAC,CAAC;AACFH,IAAAA,MAAM,CAACE,gBAAgB,CAAC,OAAO,EAAE,MAAK;MACpCH,MAAM,CAACC,MAAM,CAACI,KAAK,IAAI,IAAIC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACvD,KAAC,CAAC;AACFL,IAAAA,MAAM,CAACM,aAAa,CAACV,IAAI,CAAC;AAC5B,GAAC,CAAC;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFileType.js","sources":["../../../../src/upload/utils/getFileType/getFileType.ts"],"sourcesContent":["export function getFileType(file: Blob, file64?: string) {\n if (file.type) {\n return file.type;\n }\n\n if (file64) {\n const regex = /^data:([a-z]+\\/[a-z]+);/;\n const typeFromEncoded = regex.exec(file64);\n\n if (typeFromEncoded?.[1]) {\n return typeFromEncoded[1];\n }\n }\n\n return '';\n}\n"],"names":["getFileType","file","file64","type","regex","typeFromEncoded","exec"],"mappings":";;AAAgB,SAAAA,WAAWA,CAACC,IAAU,EAAEC,MAAe,EAAA;EACrD,IAAID,IAAI,CAACE,IAAI,EAAE;IACb,OAAOF,IAAI,CAACE,IAAI
|
|
1
|
+
{"version":3,"file":"getFileType.js","sources":["../../../../src/upload/utils/getFileType/getFileType.ts"],"sourcesContent":["export function getFileType(file: Blob, file64?: string) {\n if (file.type) {\n return file.type;\n }\n\n if (file64) {\n const regex = /^data:([a-z]+\\/[a-z]+);/;\n const typeFromEncoded = regex.exec(file64);\n\n if (typeFromEncoded?.[1]) {\n return typeFromEncoded[1];\n }\n }\n\n return '';\n}\n"],"names":["getFileType","file","file64","type","regex","typeFromEncoded","exec"],"mappings":";;AAAgB,SAAAA,WAAWA,CAACC,IAAU,EAAEC,MAAe,EAAA;EACrD,IAAID,IAAI,CAACE,IAAI,EAAE;IACb,OAAOF,IAAI,CAACE,IAAI;AAClB;AAEA,EAAA,IAAID,MAAM,EAAE;IACV,MAAME,KAAK,GAAG,yBAAyB;AACvC,IAAA,MAAMC,eAAe,GAAGD,KAAK,CAACE,IAAI,CAACJ,MAAM,CAAC;AAE1C,IAAA,IAAIG,eAAe,GAAG,CAAC,CAAC,EAAE;MACxB,OAAOA,eAAe,CAAC,CAAC,CAAC;AAC3B;AACF;AAEA,EAAA,OAAO,EAAE;AACX;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFileType.mjs","sources":["../../../../src/upload/utils/getFileType/getFileType.ts"],"sourcesContent":["export function getFileType(file: Blob, file64?: string) {\n if (file.type) {\n return file.type;\n }\n\n if (file64) {\n const regex = /^data:([a-z]+\\/[a-z]+);/;\n const typeFromEncoded = regex.exec(file64);\n\n if (typeFromEncoded?.[1]) {\n return typeFromEncoded[1];\n }\n }\n\n return '';\n}\n"],"names":["getFileType","file","file64","type","regex","typeFromEncoded","exec"],"mappings":"AAAgB,SAAAA,WAAWA,CAACC,IAAU,EAAEC,MAAe,EAAA;EACrD,IAAID,IAAI,CAACE,IAAI,EAAE;IACb,OAAOF,IAAI,CAACE,IAAI
|
|
1
|
+
{"version":3,"file":"getFileType.mjs","sources":["../../../../src/upload/utils/getFileType/getFileType.ts"],"sourcesContent":["export function getFileType(file: Blob, file64?: string) {\n if (file.type) {\n return file.type;\n }\n\n if (file64) {\n const regex = /^data:([a-z]+\\/[a-z]+);/;\n const typeFromEncoded = regex.exec(file64);\n\n if (typeFromEncoded?.[1]) {\n return typeFromEncoded[1];\n }\n }\n\n return '';\n}\n"],"names":["getFileType","file","file64","type","regex","typeFromEncoded","exec"],"mappings":"AAAgB,SAAAA,WAAWA,CAACC,IAAU,EAAEC,MAAe,EAAA;EACrD,IAAID,IAAI,CAACE,IAAI,EAAE;IACb,OAAOF,IAAI,CAACE,IAAI;AAClB;AAEA,EAAA,IAAID,MAAM,EAAE;IACV,MAAME,KAAK,GAAG,yBAAyB;AACvC,IAAA,MAAMC,eAAe,GAAGD,KAAK,CAACE,IAAI,CAACJ,MAAM,CAAC;AAE1C,IAAA,IAAIG,eAAe,GAAG,CAAC,CAAC,EAAE;MACxB,OAAOA,eAAe,CAAC,CAAC,CAAC;AAC3B;AACF;AAEA,EAAA,OAAO,EAAE;AACX;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isSizeValid.js","sources":["../../../../src/upload/utils/isSizeValid/isSizeValid.ts"],"sourcesContent":["export function isSizeValid(file: Blob, maxSize: number) {\n return Number.isInteger(maxSize) && file.size <= maxSize;\n}\n"],"names":["isSizeValid","file","maxSize","Number","isInteger","size"],"mappings":";;AAAgB,SAAAA,WAAWA,CAACC,IAAU,EAAEC,OAAe,EAAA;EACrD,OAAOC,MAAM,CAACC,SAAS,CAACF,OAAO,CAAC,IAAID,IAAI,CAACI,IAAI,IAAIH,OAAO
|
|
1
|
+
{"version":3,"file":"isSizeValid.js","sources":["../../../../src/upload/utils/isSizeValid/isSizeValid.ts"],"sourcesContent":["export function isSizeValid(file: Blob, maxSize: number) {\n return Number.isInteger(maxSize) && file.size <= maxSize;\n}\n"],"names":["isSizeValid","file","maxSize","Number","isInteger","size"],"mappings":";;AAAgB,SAAAA,WAAWA,CAACC,IAAU,EAAEC,OAAe,EAAA;EACrD,OAAOC,MAAM,CAACC,SAAS,CAACF,OAAO,CAAC,IAAID,IAAI,CAACI,IAAI,IAAIH,OAAO;AAC1D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isSizeValid.mjs","sources":["../../../../src/upload/utils/isSizeValid/isSizeValid.ts"],"sourcesContent":["export function isSizeValid(file: Blob, maxSize: number) {\n return Number.isInteger(maxSize) && file.size <= maxSize;\n}\n"],"names":["isSizeValid","file","maxSize","Number","isInteger","size"],"mappings":"AAAgB,SAAAA,WAAWA,CAACC,IAAU,EAAEC,OAAe,EAAA;EACrD,OAAOC,MAAM,CAACC,SAAS,CAACF,OAAO,CAAC,IAAID,IAAI,CAACI,IAAI,IAAIH,OAAO
|
|
1
|
+
{"version":3,"file":"isSizeValid.mjs","sources":["../../../../src/upload/utils/isSizeValid/isSizeValid.ts"],"sourcesContent":["export function isSizeValid(file: Blob, maxSize: number) {\n return Number.isInteger(maxSize) && file.size <= maxSize;\n}\n"],"names":["isSizeValid","file","maxSize","Number","isInteger","size"],"mappings":"AAAgB,SAAAA,WAAWA,CAACC,IAAU,EAAEC,OAAe,EAAA;EACrD,OAAOC,MAAM,CAACC,SAAS,CAACF,OAAO,CAAC,IAAID,IAAI,CAACI,IAAI,IAAIH,OAAO;AAC1D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTypeValid.js","sources":["../../../../src/upload/utils/isTypeValid/isTypeValid.ts"],"sourcesContent":["import { getFileType } from '../getFileType';\n\nexport function isTypeValid(file: Blob, rule: string, file64?: string) {\n if (!rule) {\n return false;\n }\n\n const allowedTypes = rule.replace(/\\s/g, '').split(',');\n const fileType = getFileType(file, file64);\n\n if (rule === '*' || allowedTypes.includes(fileType)) {\n return true;\n }\n\n return allowedTypes.some((type) => {\n const [typeAllowed, extensionAllowed] = type.split('/');\n return extensionAllowed === '*' && fileType.includes(typeAllowed);\n });\n}\n"],"names":["isTypeValid","file","rule","file64","allowedTypes","replace","split","fileType","getFileType","includes","some","type","typeAllowed","extensionAllowed"],"mappings":";;;;SAEgBA,WAAWA,CAACC,IAAU,EAAEC,IAAY,EAAEC,MAAe,EAAA;EACnE,IAAI,CAACD,IAAI,EAAE;AACT,IAAA,OAAO,KAAK
|
|
1
|
+
{"version":3,"file":"isTypeValid.js","sources":["../../../../src/upload/utils/isTypeValid/isTypeValid.ts"],"sourcesContent":["import { getFileType } from '../getFileType';\n\nexport function isTypeValid(file: Blob, rule: string, file64?: string) {\n if (!rule) {\n return false;\n }\n\n const allowedTypes = rule.replace(/\\s/g, '').split(',');\n const fileType = getFileType(file, file64);\n\n if (rule === '*' || allowedTypes.includes(fileType)) {\n return true;\n }\n\n return allowedTypes.some((type) => {\n const [typeAllowed, extensionAllowed] = type.split('/');\n return extensionAllowed === '*' && fileType.includes(typeAllowed);\n });\n}\n"],"names":["isTypeValid","file","rule","file64","allowedTypes","replace","split","fileType","getFileType","includes","some","type","typeAllowed","extensionAllowed"],"mappings":";;;;SAEgBA,WAAWA,CAACC,IAAU,EAAEC,IAAY,EAAEC,MAAe,EAAA;EACnE,IAAI,CAACD,IAAI,EAAE;AACT,IAAA,OAAO,KAAK;AACd;AAEA,EAAA,MAAME,YAAY,GAAGF,IAAI,CAACG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC;AACvD,EAAA,MAAMC,QAAQ,GAAGC,uBAAW,CAACP,IAAI,EAAEE,MAAM,CAAC;EAE1C,IAAID,IAAI,KAAK,GAAG,IAAIE,YAAY,CAACK,QAAQ,CAACF,QAAQ,CAAC,EAAE;AACnD,IAAA,OAAO,IAAI;AACb;AAEA,EAAA,OAAOH,YAAY,CAACM,IAAI,CAAEC,IAAI,IAAI;IAChC,MAAM,CAACC,WAAW,EAAEC,gBAAgB,CAAC,GAAGF,IAAI,CAACL,KAAK,CAAC,GAAG,CAAC;IACvD,OAAOO,gBAAgB,KAAK,GAAG,IAAIN,QAAQ,CAACE,QAAQ,CAACG,WAAW,CAAC;AACnE,GAAC,CAAC;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTypeValid.mjs","sources":["../../../../src/upload/utils/isTypeValid/isTypeValid.ts"],"sourcesContent":["import { getFileType } from '../getFileType';\n\nexport function isTypeValid(file: Blob, rule: string, file64?: string) {\n if (!rule) {\n return false;\n }\n\n const allowedTypes = rule.replace(/\\s/g, '').split(',');\n const fileType = getFileType(file, file64);\n\n if (rule === '*' || allowedTypes.includes(fileType)) {\n return true;\n }\n\n return allowedTypes.some((type) => {\n const [typeAllowed, extensionAllowed] = type.split('/');\n return extensionAllowed === '*' && fileType.includes(typeAllowed);\n });\n}\n"],"names":["isTypeValid","file","rule","file64","allowedTypes","replace","split","fileType","getFileType","includes","some","type","typeAllowed","extensionAllowed"],"mappings":";;SAEgBA,WAAWA,CAACC,IAAU,EAAEC,IAAY,EAAEC,MAAe,EAAA;EACnE,IAAI,CAACD,IAAI,EAAE;AACT,IAAA,OAAO,KAAK
|
|
1
|
+
{"version":3,"file":"isTypeValid.mjs","sources":["../../../../src/upload/utils/isTypeValid/isTypeValid.ts"],"sourcesContent":["import { getFileType } from '../getFileType';\n\nexport function isTypeValid(file: Blob, rule: string, file64?: string) {\n if (!rule) {\n return false;\n }\n\n const allowedTypes = rule.replace(/\\s/g, '').split(',');\n const fileType = getFileType(file, file64);\n\n if (rule === '*' || allowedTypes.includes(fileType)) {\n return true;\n }\n\n return allowedTypes.some((type) => {\n const [typeAllowed, extensionAllowed] = type.split('/');\n return extensionAllowed === '*' && fileType.includes(typeAllowed);\n });\n}\n"],"names":["isTypeValid","file","rule","file64","allowedTypes","replace","split","fileType","getFileType","includes","some","type","typeAllowed","extensionAllowed"],"mappings":";;SAEgBA,WAAWA,CAACC,IAAU,EAAEC,IAAY,EAAEC,MAAe,EAAA;EACnE,IAAI,CAACD,IAAI,EAAE;AACT,IAAA,OAAO,KAAK;AACd;AAEA,EAAA,MAAME,YAAY,GAAGF,IAAI,CAACG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC;AACvD,EAAA,MAAMC,QAAQ,GAAGC,WAAW,CAACP,IAAI,EAAEE,MAAM,CAAC;EAE1C,IAAID,IAAI,KAAK,GAAG,IAAIE,YAAY,CAACK,QAAQ,CAACF,QAAQ,CAAC,EAAE;AACnD,IAAA,OAAO,IAAI;AACb;AAEA,EAAA,OAAOH,YAAY,CAACM,IAAI,CAAEC,IAAI,IAAI;IAChC,MAAM,CAACC,WAAW,EAAEC,gBAAgB,CAAC,GAAGF,IAAI,CAACL,KAAK,CAAC,GAAG,CAAC;IACvD,OAAOO,gBAAgB,KAAK,GAAG,IAAIN,QAAQ,CAACE,QAAQ,CAACG,WAAW,CAAC;AACnE,GAAC,CAAC;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postData.js","sources":["../../../../src/upload/utils/postData/postData.ts"],"sourcesContent":["export class ResponseError extends Error {\n response: Response;\n status: number;\n\n constructor(response: Response, message?: string) {\n super(message);\n this.name = 'ResponseError';\n this.response = response;\n this.status = response.status;\n }\n}\n\nexport interface PostDataHTTPOptions extends Omit<RequestInit, 'body'> {\n url: string;\n method?: 'POST' | 'PUT' | 'PATCH';\n}\n\nexport type PostDataFetcher = (input: string, init: RequestInit) => Promise<Response>;\n\nexport async function postData(\n { url, method = 'POST', ...httpOptions }: PostDataHTTPOptions,\n data: RequestInit['body'],\n fetcher: PostDataFetcher = fetch,\n) {\n const response = await fetcher(url, {\n method,\n body: data,\n ...httpOptions,\n });\n\n if (!response.ok) {\n throw new ResponseError(response, response.statusText);\n }\n\n return response;\n}\n"],"names":["ResponseError","Error","response","status","constructor","message","name","postData","url","method","httpOptions","data","fetcher","fetch","body","ok","statusText"],"mappings":";;AAAM,MAAOA,aAAc,SAAQC,KAAK,CAAA;EACtCC,QAAQ
|
|
1
|
+
{"version":3,"file":"postData.js","sources":["../../../../src/upload/utils/postData/postData.ts"],"sourcesContent":["export class ResponseError extends Error {\n response: Response;\n status: number;\n\n constructor(response: Response, message?: string) {\n super(message);\n this.name = 'ResponseError';\n this.response = response;\n this.status = response.status;\n }\n}\n\nexport interface PostDataHTTPOptions extends Omit<RequestInit, 'body'> {\n url: string;\n method?: 'POST' | 'PUT' | 'PATCH';\n}\n\nexport type PostDataFetcher = (input: string, init: RequestInit) => Promise<Response>;\n\nexport async function postData(\n { url, method = 'POST', ...httpOptions }: PostDataHTTPOptions,\n data: RequestInit['body'],\n fetcher: PostDataFetcher = fetch,\n) {\n const response = await fetcher(url, {\n method,\n body: data,\n ...httpOptions,\n });\n\n if (!response.ok) {\n throw new ResponseError(response, response.statusText);\n }\n\n return response;\n}\n"],"names":["ResponseError","Error","response","status","constructor","message","name","postData","url","method","httpOptions","data","fetcher","fetch","body","ok","statusText"],"mappings":";;AAAM,MAAOA,aAAc,SAAQC,KAAK,CAAA;EACtCC,QAAQ;EACRC,MAAM;AAENC,EAAAA,WAAYA,CAAAF,QAAkB,EAAEG,OAAgB,EAAA;IAC9C,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,eAAe;IAC3B,IAAI,CAACJ,QAAQ,GAAGA,QAAQ;AACxB,IAAA,IAAI,CAACC,MAAM,GAAGD,QAAQ,CAACC,MAAM;AAC/B;AACD;AASM,eAAeI,QAAQA,CAC5B;EAAEC,GAAG;AAAEC,EAAAA,MAAM,GAAG,MAAM;EAAE,GAAGC;AAAW,CAAuB,EAC7DC,IAAyB,EACzBC,UAA2BC,KAAK,EAAA;AAEhC,EAAA,MAAMX,QAAQ,GAAG,MAAMU,OAAO,CAACJ,GAAG,EAAE;IAClCC,MAAM;AACNK,IAAAA,IAAI,EAAEH,IAAI;IACV,GAAGD;AACJ,GAAA,CAAC;AAEF,EAAA,IAAI,CAACR,QAAQ,CAACa,EAAE,EAAE;IAChB,MAAM,IAAIf,aAAa,CAACE,QAAQ,EAAEA,QAAQ,CAACc,UAAU,CAAC;AACxD;AAEA,EAAA,OAAOd,QAAQ;AACjB;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postData.mjs","sources":["../../../../src/upload/utils/postData/postData.ts"],"sourcesContent":["export class ResponseError extends Error {\n response: Response;\n status: number;\n\n constructor(response: Response, message?: string) {\n super(message);\n this.name = 'ResponseError';\n this.response = response;\n this.status = response.status;\n }\n}\n\nexport interface PostDataHTTPOptions extends Omit<RequestInit, 'body'> {\n url: string;\n method?: 'POST' | 'PUT' | 'PATCH';\n}\n\nexport type PostDataFetcher = (input: string, init: RequestInit) => Promise<Response>;\n\nexport async function postData(\n { url, method = 'POST', ...httpOptions }: PostDataHTTPOptions,\n data: RequestInit['body'],\n fetcher: PostDataFetcher = fetch,\n) {\n const response = await fetcher(url, {\n method,\n body: data,\n ...httpOptions,\n });\n\n if (!response.ok) {\n throw new ResponseError(response, response.statusText);\n }\n\n return response;\n}\n"],"names":["ResponseError","Error","response","status","constructor","message","name","postData","url","method","httpOptions","data","fetcher","fetch","body","ok","statusText"],"mappings":"AAAM,MAAOA,aAAc,SAAQC,KAAK,CAAA;EACtCC,QAAQ
|
|
1
|
+
{"version":3,"file":"postData.mjs","sources":["../../../../src/upload/utils/postData/postData.ts"],"sourcesContent":["export class ResponseError extends Error {\n response: Response;\n status: number;\n\n constructor(response: Response, message?: string) {\n super(message);\n this.name = 'ResponseError';\n this.response = response;\n this.status = response.status;\n }\n}\n\nexport interface PostDataHTTPOptions extends Omit<RequestInit, 'body'> {\n url: string;\n method?: 'POST' | 'PUT' | 'PATCH';\n}\n\nexport type PostDataFetcher = (input: string, init: RequestInit) => Promise<Response>;\n\nexport async function postData(\n { url, method = 'POST', ...httpOptions }: PostDataHTTPOptions,\n data: RequestInit['body'],\n fetcher: PostDataFetcher = fetch,\n) {\n const response = await fetcher(url, {\n method,\n body: data,\n ...httpOptions,\n });\n\n if (!response.ok) {\n throw new ResponseError(response, response.statusText);\n }\n\n return response;\n}\n"],"names":["ResponseError","Error","response","status","constructor","message","name","postData","url","method","httpOptions","data","fetcher","fetch","body","ok","statusText"],"mappings":"AAAM,MAAOA,aAAc,SAAQC,KAAK,CAAA;EACtCC,QAAQ;EACRC,MAAM;AAENC,EAAAA,WAAYA,CAAAF,QAAkB,EAAEG,OAAgB,EAAA;IAC9C,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,eAAe;IAC3B,IAAI,CAACJ,QAAQ,GAAGA,QAAQ;AACxB,IAAA,IAAI,CAACC,MAAM,GAAGD,QAAQ,CAACC,MAAM;AAC/B;AACD;AASM,eAAeI,QAAQA,CAC5B;EAAEC,GAAG;AAAEC,EAAAA,MAAM,GAAG,MAAM;EAAE,GAAGC;AAAW,CAAuB,EAC7DC,IAAyB,EACzBC,UAA2BC,KAAK,EAAA;AAEhC,EAAA,MAAMX,QAAQ,GAAG,MAAMU,OAAO,CAACJ,GAAG,EAAE;IAClCC,MAAM;AACNK,IAAAA,IAAI,EAAEH,IAAI;IACV,GAAGD;AACJ,GAAA,CAAC;AAEF,EAAA,IAAI,CAACR,QAAQ,CAACa,EAAE,EAAE;IAChB,MAAM,IAAIf,aAAa,CAACE,QAAQ,EAAEA,QAAQ,CAACc,UAAU,CAAC;AACxD;AAEA,EAAA,OAAOd,QAAQ;AACjB;;;;"}
|
|
@@ -79,6 +79,7 @@ const UploadInput = ({
|
|
|
79
79
|
nonLabelable: true
|
|
80
80
|
});
|
|
81
81
|
const [markedFileForDelete, setMarkedFileForDelete] = React.useState(null);
|
|
82
|
+
const [lastAttemptedDeleteId, setLastAttemptedDeleteId] = React.useState(null);
|
|
82
83
|
const [mounted, setMounted] = React.useState(false);
|
|
83
84
|
const {
|
|
84
85
|
formatMessage
|
|
@@ -227,6 +228,13 @@ const UploadInput = ({
|
|
|
227
228
|
});
|
|
228
229
|
const filesCount = fileRefs.length;
|
|
229
230
|
let next = uploadInputRef.current;
|
|
231
|
+
let focusTarget = 'button';
|
|
232
|
+
// If there will be no files left after deletion, focus the upload button
|
|
233
|
+
if (filesCount === 1) {
|
|
234
|
+
next = uploadInputRef.current;
|
|
235
|
+
setNextFocusable(next);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
230
238
|
if (filesCount > 1) {
|
|
231
239
|
const currentFileIndex = fileRefs.findIndex(file => file?.id === fileId);
|
|
232
240
|
const currentFileId = fileRefs?.[currentFileIndex]?.id;
|
|
@@ -237,14 +245,50 @@ const UploadInput = ({
|
|
|
237
245
|
} else {
|
|
238
246
|
next = fileRefs[currentFileIndex + 1];
|
|
239
247
|
}
|
|
248
|
+
// If next is an UploadItemRef, check if it has a URL (succeeded)
|
|
249
|
+
if (next && 'status' in next) {
|
|
250
|
+
// Find the file object for this ref
|
|
251
|
+
const fileObj = uploadedFiles.find(f => f.id === next?.id);
|
|
252
|
+
if (fileObj && (fileObj.status === status.Status.SUCCEEDED || fileObj.status === status.Status.DONE) && fileObj.url) {
|
|
253
|
+
focusTarget = 'link';
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
setNextFocusable(() => {
|
|
257
|
+
if (next && typeof next.focus === 'function') {
|
|
258
|
+
return {
|
|
259
|
+
ref: next,
|
|
260
|
+
target: focusTarget
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
return next;
|
|
264
|
+
});
|
|
240
265
|
}
|
|
241
|
-
setNextFocusable(next);
|
|
242
266
|
};
|
|
243
267
|
const handleRefocus = () => {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
268
|
+
const focusTarget = nextFocusable;
|
|
269
|
+
if (lastAttemptedDeleteId) {
|
|
270
|
+
setLastAttemptedDeleteId(null);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (focusTarget) {
|
|
274
|
+
// If there are no files left, focus the upload button
|
|
275
|
+
if (uploadedFiles.length === 0 && uploadInputRef.current && typeof uploadInputRef.current.focus === 'function') {
|
|
276
|
+
setTimeout(() => {
|
|
277
|
+
uploadInputRef.current.focus();
|
|
278
|
+
}, 0);
|
|
279
|
+
} else if (typeof focusTarget === 'object' && 'ref' in focusTarget && focusTarget.ref && typeof focusTarget.ref.focus === 'function') {
|
|
280
|
+
setTimeout(() => {
|
|
281
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
282
|
+
if (focusTarget.ref && typeof focusTarget.ref.focus === 'function') {
|
|
283
|
+
// @ts-expect-error: focus may not exist on all possible ref types, but is safe here
|
|
284
|
+
focusTarget.ref.focus(focusTarget.target);
|
|
285
|
+
}
|
|
286
|
+
}, 0);
|
|
287
|
+
} else if (focusTarget && typeof focusTarget.focus === 'function') {
|
|
288
|
+
setTimeout(() => {
|
|
289
|
+
focusTarget.focus();
|
|
290
|
+
}, 0);
|
|
291
|
+
}
|
|
248
292
|
}
|
|
249
293
|
};
|
|
250
294
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -269,9 +313,13 @@ const UploadInput = ({
|
|
|
269
313
|
singleFileUpload: !multiple,
|
|
270
314
|
canDelete: (!!onDeleteFile || file.status === status.Status.FAILED) && (!file.status || !PROGRESS_STATUSES.has(file.status)),
|
|
271
315
|
onDelete: file.status === status.Status.FAILED ? async () => {
|
|
316
|
+
setLastAttemptedDeleteId(file.id);
|
|
272
317
|
await removeFile(file);
|
|
273
318
|
handleRefocus();
|
|
274
|
-
} : () =>
|
|
319
|
+
} : () => {
|
|
320
|
+
setLastAttemptedDeleteId(file.id);
|
|
321
|
+
setMarkedFileForDelete(file);
|
|
322
|
+
},
|
|
275
323
|
onDownload: onDownload,
|
|
276
324
|
onFocus: () => handleFocus(file.id)
|
|
277
325
|
}, file.id))
|
|
@@ -312,6 +360,7 @@ const UploadInput = ({
|
|
|
312
360
|
void removeFile(markedFileForDelete);
|
|
313
361
|
}
|
|
314
362
|
setMarkedFileForDelete(null);
|
|
363
|
+
setLastAttemptedDeleteId(null);
|
|
315
364
|
},
|
|
316
365
|
children: deleteConfirm?.confirmText || formatMessage(UploadInput_messages.default.deleteModalConfirmButtonText)
|
|
317
366
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadInput.js","sources":["../../src/uploadInput/UploadInput.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Button from '../button';\nimport { CommonProps, ControlType, Priority, Status } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\nimport Modal from '../modal';\nimport { isSizeValid } from '../upload/utils/isSizeValid';\nimport { isTypeValid } from '../upload/utils/isTypeValid';\n\nimport MESSAGES from './UploadInput.messages';\nimport { UploadedFile, UploadError, UploadResponse } from './types';\nimport UploadButton, { UploadButtonProps } from './uploadButton/UploadButton';\nimport { DEFAULT_SIZE_LIMIT, imageFileTypes } from './uploadButton/defaults';\nimport UploadItem, { UploadItemProps } from './uploadItem/UploadItem';\n\nexport type UploadInputProps = {\n /**\n * List of already existing, failed or in progress files\n */\n files?: readonly UploadedFile[];\n\n /**\n * The key of the file in the returned FormData object (default: file)\n */\n fileInputName?: string;\n\n /**\n * Callback that handles form submission\n *\n * @param formData\n */\n onUploadFile: (formData: FormData) => Promise<UploadResponse>;\n\n /**\n * Provide a callback if the file can be removed/deleted from the server\n * Your app is responsible for reloading the uploaded files list and updating the component to ensure that the file has in fact been deleted successfully\n *\n * @param id\n */\n onDeleteFile?: (id: string | number) => Promise<any>;\n\n /**\n * Provide a callback to trigger on validation error\n *\n * @param file\n */\n onValidationError?: (file: UploadedFile) => void;\n\n /**\n * Provide a callback to trigger on change whenever the files are updated\n *\n * @param files\n */\n onFilesChange?: (files: UploadedFile[]) => void;\n\n /**\n * Confirmation modal displayed on delete\n */\n deleteConfirm?: {\n /**\n * The title of the confirmation modal on delete\n */\n title?: string;\n\n /**\n * The body of the confirmation modal on delete\n */\n body?: React.ReactNode;\n\n /**\n * The confirm button text of the confirmation modal on delete\n */\n confirmText?: string;\n\n /**\n * The cancel button text of the confirmation modal on delete\n */\n cancelText?: string;\n };\n\n /**\n * Maximum number of files allowed, if provided, shows error below file item\n */\n maxFiles?: number;\n\n /**\n * Error message to show when the maximum number of files are uploaded already\n */\n maxFilesErrorMessage?: string;\n\n /**\n * Error message to show when files over a allowed size limit are uploaded\n */\n sizeLimitErrorMessage?: string;\n} & Pick<\n UploadButtonProps,\n 'disabled' | 'multiple' | 'fileTypes' | 'sizeLimit' | 'description' | 'id' | 'uploadButtonTitle'\n> & { onDownload?: UploadItemProps['onDownload'] } & CommonProps;\n\n/**\n * Interface representing a reference to an UploadItem component.\n * Provides a method to focus the UploadItem.\n */\ninterface UploadItemRef {\n /**\n * Focuses the UploadItem component.\n */\n focus: () => void;\n\n /**\n * Required id of the UploadItem component.\n */\n id: string | number;\n\n /**\n * Optional status of the UploadItem component.\n */\n status?: string;\n}\n\n/**\n * Generates a unique ID for a file based on its name, size, and the current timestamp\n */\nfunction generateFileId(file: File) {\n const { name, size } = file;\n const uploadTimeStamp = new Date().getTime();\n return `${name}_${size}_${uploadTimeStamp}`;\n}\n\n/**\n * The component allows users to upload files, manage the list of uploaded files,\n * and handle file validation and deletion.\n *\n * @param {UploadInputProps} props - The properties for the UploadInput component.\n *\n * @see {@link UploadInput} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/forms-uploadinput--docs|Storybook Wise Design}\n */\nconst UploadInput = ({\n files = [],\n fileInputName = 'file',\n className,\n deleteConfirm,\n disabled,\n multiple = false,\n fileTypes = imageFileTypes,\n sizeLimit = DEFAULT_SIZE_LIMIT,\n description,\n onUploadFile,\n onDeleteFile,\n onValidationError,\n onFilesChange,\n onDownload,\n maxFiles,\n maxFilesErrorMessage,\n id,\n sizeLimitErrorMessage,\n uploadButtonTitle,\n}: UploadInputProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n const [markedFileForDelete, setMarkedFileForDelete] = useState<UploadedFile | null>(null);\n const [mounted, setMounted] = useState(false);\n const { formatMessage } = useIntl();\n const uploadInputRef = useRef<HTMLInputElement | null>(null);\n let fileRefs: (HTMLDivElement | UploadItemRef | null)[] = [];\n\n const PROGRESS_STATUSES = new Set([Status.PENDING, Status.PROCESSING]);\n\n const [uploadedFiles, setUploadedFiles] = useState<readonly UploadedFile[]>(\n multiple || files.length === 0 ? files : [files[0]],\n );\n\n const uploadedFilesListReference = useRef(multiple || files.length === 0 ? files : [files[0]]);\n\n function updateFileList(updateFn: (list: readonly UploadedFile[]) => readonly UploadedFile[]) {\n setUploadedFiles(updateFn);\n uploadedFilesListReference.current = updateFn(uploadedFilesListReference.current);\n }\n\n function addFileToList(recentUploadedFile: UploadedFile) {\n updateFileList((list) => [...list, recentUploadedFile]);\n }\n\n function removeFileFromList(file: UploadedFile) {\n updateFileList((list) =>\n list.filter((fileInList) => file !== fileInList && file.id !== fileInList.id),\n );\n fileRefs = fileRefs.filter((ref) => ref && ref.id !== file.id);\n }\n\n function modifyFileInList(file: UploadedFile, updates: Partial<UploadedFile>) {\n updateFileList((list) =>\n list.map((fileInList) =>\n fileInList === file || fileInList.id === file.id ? { ...file, ...updates } : fileInList,\n ),\n );\n }\n\n const removeFile = async (file: UploadedFile) => {\n const { id, status } = file;\n fileRefs = fileRefs.filter((item) => item && item.id !== file.id);\n\n if (status === Status.FAILED) {\n removeFileFromList(file);\n return Promise.resolve();\n }\n\n if (onDeleteFile && id) {\n modifyFileInList(file, { status: Status.PROCESSING, error: undefined });\n\n return onDeleteFile(id)\n .then(() => {\n removeFileFromList(file);\n })\n .catch((error) => {\n modifyFileInList(file, { error: error as UploadError });\n });\n }\n };\n\n function handleFileUploadFailure(file: File, failureMessage: string) {\n const { name } = file;\n\n const failedUpload = {\n id: generateFileId(file),\n filename: name,\n status: Status.FAILED,\n error: failureMessage,\n };\n\n addFileToList(failedUpload);\n\n if (onValidationError) {\n onValidationError(failedUpload);\n }\n }\n\n function getNumberOfFilesUploaded() {\n const uploadInitiatedStatus = new Set([Status.SUCCEEDED, Status.PENDING]);\n const validFiles = uploadedFilesListReference.current.filter(\n (file) => file.status && uploadInitiatedStatus.has(file.status),\n );\n return validFiles.length;\n }\n\n function areMaximumFilesUploadedAlready() {\n if (!maxFiles) {\n return false;\n }\n\n const numberOfValidFiles = getNumberOfFilesUploaded();\n return numberOfValidFiles >= maxFiles;\n }\n\n const addFiles = (selectedFiles: FileList) => {\n for (let i = 0; i < selectedFiles.length; i += 1) {\n const file = selectedFiles.item(i);\n\n const formData = new FormData();\n\n if (file) {\n const allowedFileTypes = typeof fileTypes === 'string' ? fileTypes : fileTypes.join(',');\n\n if (!isTypeValid(file, allowedFileTypes)) {\n handleFileUploadFailure(file, formatMessage(MESSAGES.fileTypeNotSupported));\n continue;\n }\n\n if (!isSizeValid(file, sizeLimit * 1000)) {\n const failureMessage = sizeLimitErrorMessage || formatMessage(MESSAGES.fileIsTooLarge);\n handleFileUploadFailure(file, failureMessage);\n continue;\n }\n\n if (areMaximumFilesUploadedAlready()) {\n const failureMessage =\n maxFilesErrorMessage ||\n formatMessage(MESSAGES.maximumFilesAlreadyUploaded, { maxFilesAllowed: maxFiles });\n handleFileUploadFailure(file, failureMessage);\n continue;\n }\n\n const existingFile = uploadedFiles.find((f) => f.filename === file.name);\n if (existingFile) {\n removeFileFromList(existingFile);\n }\n\n formData.append(fileInputName, file);\n const pendingFile = {\n id: generateFileId(file),\n filename: file.name,\n status: Status.PENDING,\n };\n\n addFileToList(pendingFile);\n\n onUploadFile(formData)\n .then(({ id, url, error }: UploadResponse) => {\n modifyFileInList(pendingFile, { id, url, error, status: Status.SUCCEEDED });\n })\n .catch((error) => {\n modifyFileInList(pendingFile, { error: error as UploadError, status: Status.FAILED });\n });\n\n if (!multiple) {\n break;\n }\n }\n }\n };\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n useEffect(() => {\n if (onFilesChange && mounted) {\n onFilesChange([...uploadedFiles]);\n }\n }, [onFilesChange, uploadedFiles]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const [nextFocusable, setNextFocusable] = useState<HTMLDivElement | UploadItemRef | null>(\n uploadInputRef.current,\n );\n\n const handleFocus = (fileId: string | number) => {\n fileRefs = fileRefs.filter((ref) => {\n return ref && ref.id !== markedFileForDelete?.id;\n });\n\n const filesCount = fileRefs.length;\n let next: HTMLDivElement | UploadItemRef | null = uploadInputRef.current;\n\n if (filesCount > 1) {\n const currentFileIndex = fileRefs.findIndex((file) => file?.id === fileId);\n const currentFileId = fileRefs?.[currentFileIndex]?.id;\n const lastFileId = fileRefs?.[filesCount - 1]?.id;\n\n // if last file, select a previous one\n if (currentFileId === lastFileId) {\n next = fileRefs[filesCount - 2];\n } else {\n next = fileRefs[currentFileIndex + 1];\n }\n }\n setNextFocusable(next);\n };\n\n const handleRefocus = () => {\n if (nextFocusable && 'focus' in nextFocusable && typeof nextFocusable.focus === 'function') {\n setTimeout(() => {\n nextFocusable.focus();\n }, 0);\n }\n };\n\n return (\n <>\n <div\n role=\"group\"\n className={clsx('np-upload-input', className, { disabled })}\n {...inputAttributes}\n >\n <div\n className=\"np-upload-input__section\"\n aria-live=\"polite\"\n aria-relevant=\"all\"\n role=\"region\"\n >\n {uploadedFiles.map((file, index) => (\n <UploadItem\n key={file.id}\n ref={(el: UploadItemRef | null) => {\n if (\n el &&\n el.id !== markedFileForDelete?.id &&\n !fileRefs.some((ref) => ref && ref.id === el.id) &&\n el.status !== 'processing'\n ) {\n fileRefs.push(el);\n }\n }}\n file={file}\n singleFileUpload={!multiple}\n canDelete={\n (!!onDeleteFile || file.status === Status.FAILED) &&\n (!file.status || !PROGRESS_STATUSES.has(file.status))\n }\n onDelete={\n file.status === Status.FAILED\n ? async () => {\n await removeFile(file);\n handleRefocus();\n }\n : () => setMarkedFileForDelete(file)\n }\n onDownload={onDownload}\n onFocus={() => handleFocus(file.id)}\n />\n ))}\n </div>\n {(multiple || (!multiple && !uploadedFiles.length)) && (\n <div className=\"np-upload-input__section np-upload-input__section--uploader\">\n <UploadButton\n ref={uploadInputRef}\n id={id}\n uploadButtonTitle={uploadButtonTitle}\n disabled={areMaximumFilesUploadedAlready() || disabled}\n multiple={multiple}\n fileTypes={fileTypes}\n sizeLimit={sizeLimit}\n description={description}\n maxFiles={maxFiles}\n withEntries={Boolean(uploadedFiles.length)}\n onChange={addFiles}\n />\n </div>\n )}\n </div>\n <Modal\n title={\n deleteConfirm?.title !== undefined\n ? deleteConfirm.title\n : formatMessage(MESSAGES.deleteModalTitle)\n }\n body={\n deleteConfirm?.body !== undefined\n ? deleteConfirm.body\n : formatMessage(MESSAGES.deleteModalBody)\n }\n open={!!markedFileForDelete}\n footer={\n <>\n <Button\n block\n onClick={() => {\n setMarkedFileForDelete(null);\n }}\n >\n {deleteConfirm?.cancelText || formatMessage(MESSAGES.deleteModalCancelButtonText)}\n </Button>\n <Button\n block\n priority={Priority.SECONDARY}\n type={ControlType.NEGATIVE}\n tabIndex={markedFileForDelete ? 0 : -1}\n onClick={() => {\n if (markedFileForDelete) {\n void removeFile(markedFileForDelete);\n }\n setMarkedFileForDelete(null);\n }}\n >\n {deleteConfirm?.confirmText || formatMessage(MESSAGES.deleteModalConfirmButtonText)}\n </Button>\n </>\n }\n onUnmount={handleRefocus}\n onClose={() => {\n setMarkedFileForDelete(null);\n }}\n />\n </>\n );\n};\n\nexport default UploadInput;\n"],"names":["generateFileId","file","name","size","uploadTimeStamp","Date","getTime","UploadInput","files","fileInputName","className","deleteConfirm","disabled","multiple","fileTypes","imageFileTypes","sizeLimit","DEFAULT_SIZE_LIMIT","description","onUploadFile","onDeleteFile","onValidationError","onFilesChange","onDownload","maxFiles","maxFilesErrorMessage","id","sizeLimitErrorMessage","uploadButtonTitle","inputAttributes","useInputAttributes","nonLabelable","markedFileForDelete","setMarkedFileForDelete","useState","mounted","setMounted","formatMessage","useIntl","uploadInputRef","useRef","fileRefs","PROGRESS_STATUSES","Set","Status","PENDING","PROCESSING","uploadedFiles","setUploadedFiles","length","uploadedFilesListReference","updateFileList","updateFn","current","addFileToList","recentUploadedFile","list","removeFileFromList","filter","fileInList","ref","modifyFileInList","updates","map","removeFile","status","item","FAILED","Promise","resolve","error","undefined","then","catch","handleFileUploadFailure","failureMessage","failedUpload","filename","getNumberOfFilesUploaded","uploadInitiatedStatus","SUCCEEDED","validFiles","has","areMaximumFilesUploadedAlready","numberOfValidFiles","addFiles","selectedFiles","i","formData","FormData","allowedFileTypes","join","isTypeValid","MESSAGES","fileTypeNotSupported","isSizeValid","fileIsTooLarge","maximumFilesAlreadyUploaded","maxFilesAllowed","existingFile","find","f","append","pendingFile","url","useEffect","nextFocusable","setNextFocusable","handleFocus","fileId","filesCount","next","currentFileIndex","findIndex","currentFileId","lastFileId","handleRefocus","focus","setTimeout","_jsxs","_Fragment","children","role","clsx","_jsx","index","UploadItem","el","some","push","singleFileUpload","canDelete","onDelete","onFocus","UploadButton","withEntries","Boolean","onChange","Modal","title","deleteModalTitle","body","deleteModalBody","open","footer","Button","block","onClick","cancelText","deleteModalCancelButtonText","priority","Priority","SECONDARY","type","ControlType","NEGATIVE","tabIndex","confirmText","deleteModalConfirmButtonText","onUnmount","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,SAASA,cAAcA,CAACC,IAAU,EAAA;EAChC,MAAM;IAAEC,IAAI;AAAEC,IAAAA,IAAAA;AAAM,GAAA,GAAGF,IAAI,CAAA;EAC3B,MAAMG,eAAe,GAAG,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE,CAAA;AAC5C,EAAA,OAAO,GAAGJ,IAAI,CAAA,CAAA,EAAIC,IAAI,CAAA,CAAA,EAAIC,eAAe,CAAE,CAAA,CAAA;AAC7C,CAAA;AAEA;;;;;;;;AAQG;AACGG,MAAAA,WAAW,GAAGA,CAAC;AACnBC,EAAAA,KAAK,GAAG,EAAE;AACVC,EAAAA,aAAa,GAAG,MAAM;EACtBC,SAAS;EACTC,aAAa;EACbC,QAAQ;AACRC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,SAAS,GAAGC,uBAAc;AAC1BC,EAAAA,SAAS,GAAGC,2BAAkB;EAC9BC,WAAW;EACXC,YAAY;EACZC,YAAY;EACZC,iBAAiB;EACjBC,aAAa;EACbC,UAAU;EACVC,QAAQ;EACRC,oBAAoB;EACpBC,EAAE;EACFC,qBAAqB;AACrBC,EAAAA,iBAAAA;AACiB,CAAA,KAAI;EACrB,MAAMC,eAAe,GAAGC,2BAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE,IAAA;AAAM,GAAA,CAAC,CAAA;EAClE,MAAM,CAACC,mBAAmB,EAAEC,sBAAsB,CAAC,GAAGC,cAAQ,CAAsB,IAAI,CAAC,CAAA;EACzF,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGF,cAAQ,CAAC,KAAK,CAAC,CAAA;EAC7C,MAAM;AAAEG,IAA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A;AAAE,KAEN,CAAA,CAAA;AAAA,GAAA,CAAG,CAAA;AAEP;;;;"}
|
|
1
|
+
{"version":3,"file":"UploadInput.js","sources":["../../src/uploadInput/UploadInput.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Button from '../button';\nimport { CommonProps, ControlType, Priority, Status } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\nimport Modal from '../modal';\nimport { isSizeValid } from '../upload/utils/isSizeValid';\nimport { isTypeValid } from '../upload/utils/isTypeValid';\n\nimport MESSAGES from './UploadInput.messages';\nimport { UploadedFile, UploadError, UploadResponse } from './types';\nimport UploadButton, { UploadButtonProps } from './uploadButton/UploadButton';\nimport { DEFAULT_SIZE_LIMIT, imageFileTypes } from './uploadButton/defaults';\nimport UploadItem, { UploadItemProps } from './uploadItem/UploadItem';\n\nexport type UploadInputProps = {\n /**\n * List of already existing, failed or in progress files\n */\n files?: readonly UploadedFile[];\n\n /**\n * The key of the file in the returned FormData object (default: file)\n */\n fileInputName?: string;\n\n /**\n * Callback that handles form submission\n *\n * @param formData\n */\n onUploadFile: (formData: FormData) => Promise<UploadResponse>;\n\n /**\n * Provide a callback if the file can be removed/deleted from the server\n * Your app is responsible for reloading the uploaded files list and updating the component to ensure that the file has in fact been deleted successfully\n *\n * @param id\n */\n onDeleteFile?: (id: string | number) => Promise<any>;\n\n /**\n * Provide a callback to trigger on validation error\n *\n * @param file\n */\n onValidationError?: (file: UploadedFile) => void;\n\n /**\n * Provide a callback to trigger on change whenever the files are updated\n *\n * @param files\n */\n onFilesChange?: (files: UploadedFile[]) => void;\n\n /**\n * Confirmation modal displayed on delete\n */\n deleteConfirm?: {\n /**\n * The title of the confirmation modal on delete\n */\n title?: string;\n\n /**\n * The body of the confirmation modal on delete\n */\n body?: React.ReactNode;\n\n /**\n * The confirm button text of the confirmation modal on delete\n */\n confirmText?: string;\n\n /**\n * The cancel button text of the confirmation modal on delete\n */\n cancelText?: string;\n };\n\n /**\n * Maximum number of files allowed, if provided, shows error below file item\n */\n maxFiles?: number;\n\n /**\n * Error message to show when the maximum number of files are uploaded already\n */\n maxFilesErrorMessage?: string;\n\n /**\n * Error message to show when files over a allowed size limit are uploaded\n */\n sizeLimitErrorMessage?: string;\n} & Pick<\n UploadButtonProps,\n 'disabled' | 'multiple' | 'fileTypes' | 'sizeLimit' | 'description' | 'id' | 'uploadButtonTitle'\n> & { onDownload?: UploadItemProps['onDownload'] } & CommonProps;\n\n/**\n * Interface representing a reference to an UploadItem component.\n * Provides a method to focus the UploadItem.\n */\ninterface UploadItemRef {\n /**\n * Focuses the UploadItem component.\n */\n focus: () => void;\n\n /**\n * Required id of the UploadItem component.\n */\n id: string | number;\n\n /**\n * Optional status of the UploadItem component.\n */\n status?: string;\n}\n\n/**\n * Generates a unique ID for a file based on its name, size, and the current timestamp\n */\nfunction generateFileId(file: File) {\n const { name, size } = file;\n const uploadTimeStamp = new Date().getTime();\n return `${name}_${size}_${uploadTimeStamp}`;\n}\n\n/**\n * The component allows users to upload files, manage the list of uploaded files,\n * and handle file validation and deletion.\n *\n * @param {UploadInputProps} props - The properties for the UploadInput component.\n *\n * @see {@link UploadInput} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/forms-uploadinput--docs|Storybook Wise Design}\n */\nconst UploadInput = ({\n files = [],\n fileInputName = 'file',\n className,\n deleteConfirm,\n disabled,\n multiple = false,\n fileTypes = imageFileTypes,\n sizeLimit = DEFAULT_SIZE_LIMIT,\n description,\n onUploadFile,\n onDeleteFile,\n onValidationError,\n onFilesChange,\n onDownload,\n maxFiles,\n maxFilesErrorMessage,\n id,\n sizeLimitErrorMessage,\n uploadButtonTitle,\n}: UploadInputProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n const [markedFileForDelete, setMarkedFileForDelete] = useState<UploadedFile | null>(null);\n const [lastAttemptedDeleteId, setLastAttemptedDeleteId] = useState<string | number | null>(null);\n const [mounted, setMounted] = useState(false);\n const { formatMessage } = useIntl();\n const uploadInputRef = useRef<HTMLInputElement | null>(null);\n let fileRefs: (HTMLDivElement | UploadItemRef | null)[] = [];\n\n const PROGRESS_STATUSES = new Set([Status.PENDING, Status.PROCESSING]);\n\n const [uploadedFiles, setUploadedFiles] = useState<readonly UploadedFile[]>(\n multiple || files.length === 0 ? files : [files[0]],\n );\n\n const uploadedFilesListReference = useRef(multiple || files.length === 0 ? files : [files[0]]);\n\n function updateFileList(updateFn: (list: readonly UploadedFile[]) => readonly UploadedFile[]) {\n setUploadedFiles(updateFn);\n uploadedFilesListReference.current = updateFn(uploadedFilesListReference.current);\n }\n\n function addFileToList(recentUploadedFile: UploadedFile) {\n updateFileList((list) => [...list, recentUploadedFile]);\n }\n\n function removeFileFromList(file: UploadedFile) {\n updateFileList((list) =>\n list.filter((fileInList) => file !== fileInList && file.id !== fileInList.id),\n );\n fileRefs = fileRefs.filter((ref) => ref && ref.id !== file.id);\n }\n\n function modifyFileInList(file: UploadedFile, updates: Partial<UploadedFile>) {\n updateFileList((list) =>\n list.map((fileInList) =>\n fileInList === file || fileInList.id === file.id ? { ...file, ...updates } : fileInList,\n ),\n );\n }\n\n const removeFile = async (file: UploadedFile) => {\n const { id, status } = file;\n fileRefs = fileRefs.filter((item) => item && item.id !== file.id);\n\n if (status === Status.FAILED) {\n removeFileFromList(file);\n return Promise.resolve();\n }\n\n if (onDeleteFile && id) {\n modifyFileInList(file, { status: Status.PROCESSING, error: undefined });\n\n return onDeleteFile(id)\n .then(() => {\n removeFileFromList(file);\n })\n .catch((error) => {\n modifyFileInList(file, { error: error as UploadError });\n });\n }\n };\n\n function handleFileUploadFailure(file: File, failureMessage: string) {\n const { name } = file;\n\n const failedUpload = {\n id: generateFileId(file),\n filename: name,\n status: Status.FAILED,\n error: failureMessage,\n };\n\n addFileToList(failedUpload);\n\n if (onValidationError) {\n onValidationError(failedUpload);\n }\n }\n\n function getNumberOfFilesUploaded() {\n const uploadInitiatedStatus = new Set([Status.SUCCEEDED, Status.PENDING]);\n const validFiles = uploadedFilesListReference.current.filter(\n (file) => file.status && uploadInitiatedStatus.has(file.status),\n );\n return validFiles.length;\n }\n\n function areMaximumFilesUploadedAlready() {\n if (!maxFiles) {\n return false;\n }\n\n const numberOfValidFiles = getNumberOfFilesUploaded();\n return numberOfValidFiles >= maxFiles;\n }\n\n const addFiles = (selectedFiles: FileList) => {\n for (let i = 0; i < selectedFiles.length; i += 1) {\n const file = selectedFiles.item(i);\n\n const formData = new FormData();\n\n if (file) {\n const allowedFileTypes = typeof fileTypes === 'string' ? fileTypes : fileTypes.join(',');\n\n if (!isTypeValid(file, allowedFileTypes)) {\n handleFileUploadFailure(file, formatMessage(MESSAGES.fileTypeNotSupported));\n continue;\n }\n\n if (!isSizeValid(file, sizeLimit * 1000)) {\n const failureMessage = sizeLimitErrorMessage || formatMessage(MESSAGES.fileIsTooLarge);\n handleFileUploadFailure(file, failureMessage);\n continue;\n }\n\n if (areMaximumFilesUploadedAlready()) {\n const failureMessage =\n maxFilesErrorMessage ||\n formatMessage(MESSAGES.maximumFilesAlreadyUploaded, { maxFilesAllowed: maxFiles });\n handleFileUploadFailure(file, failureMessage);\n continue;\n }\n\n const existingFile = uploadedFiles.find((f) => f.filename === file.name);\n if (existingFile) {\n removeFileFromList(existingFile);\n }\n\n formData.append(fileInputName, file);\n const pendingFile = {\n id: generateFileId(file),\n filename: file.name,\n status: Status.PENDING,\n };\n\n addFileToList(pendingFile);\n\n onUploadFile(formData)\n .then(({ id, url, error }: UploadResponse) => {\n modifyFileInList(pendingFile, { id, url, error, status: Status.SUCCEEDED });\n })\n .catch((error) => {\n modifyFileInList(pendingFile, { error: error as UploadError, status: Status.FAILED });\n });\n\n if (!multiple) {\n break;\n }\n }\n }\n };\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n useEffect(() => {\n if (onFilesChange && mounted) {\n onFilesChange([...uploadedFiles]);\n }\n }, [onFilesChange, uploadedFiles]); // eslint-disable-line react-hooks/exhaustive-deps\n\n type NextFocusable =\n | HTMLDivElement\n | UploadItemRef\n | { ref: HTMLDivElement | UploadItemRef; target: 'button' | 'link' }\n | null;\n\n const [nextFocusable, setNextFocusable] = useState<NextFocusable>(\n uploadInputRef.current,\n );\n\n const handleFocus = (fileId: string | number) => {\n fileRefs = fileRefs.filter((ref) => {\n return ref && ref.id !== markedFileForDelete?.id;\n });\n\n const filesCount = fileRefs.length;\n let next: UploadItemRef | HTMLDivElement | null = uploadInputRef.current;\n let focusTarget: 'button' | 'link' = 'button';\n\n // If there will be no files left after deletion, focus the upload button\n if (filesCount === 1) {\n next = uploadInputRef.current;\n setNextFocusable(next);\n return;\n }\n\n if (filesCount > 1) {\n const currentFileIndex = fileRefs.findIndex((file) => file?.id === fileId);\n const currentFileId = fileRefs?.[currentFileIndex]?.id;\n const lastFileId = fileRefs?.[filesCount - 1]?.id;\n\n // if last file, select a previous one\n if (currentFileId === lastFileId) {\n next = fileRefs[filesCount - 2];\n } else {\n next = fileRefs[currentFileIndex + 1];\n }\n\n // If next is an UploadItemRef, check if it has a URL (succeeded)\n if (next && 'status' in next) {\n // Find the file object for this ref\n const fileObj = uploadedFiles.find(f => f.id === next?.id);\n if (\n fileObj &&\n (fileObj.status === Status.SUCCEEDED || fileObj.status === Status.DONE) &&\n fileObj.url\n ) {\n focusTarget = 'link';\n }\n }\n setNextFocusable(() => {\n if (next && typeof (next as UploadItemRef).focus === 'function') {\n return { ref: next, target: focusTarget };\n }\n return next;\n });\n }\n };\n\n const handleRefocus = () => {\n const focusTarget = nextFocusable;\n if (lastAttemptedDeleteId) {\n setLastAttemptedDeleteId(null);\n return;\n }\n if (focusTarget) {\n // If there are no files left, focus the upload button\n if (\n uploadedFiles.length === 0 &&\n uploadInputRef.current &&\n typeof uploadInputRef.current.focus === 'function'\n ) {\n setTimeout(() => {\n uploadInputRef.current!.focus();\n }, 0);\n } else if (\n typeof focusTarget === 'object' &&\n 'ref' in focusTarget &&\n focusTarget.ref &&\n typeof focusTarget.ref.focus === 'function'\n ) {\n setTimeout(() => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n if (\n focusTarget.ref &&\n typeof (focusTarget.ref as UploadItemRef).focus === 'function'\n ) {\n // @ts-expect-error: focus may not exist on all possible ref types, but is safe here\n (focusTarget.ref as UploadItemRef).focus(focusTarget.target);\n }\n }, 0);\n } else if (\n focusTarget &&\n typeof (focusTarget as UploadItemRef).focus === 'function'\n ) {\n setTimeout(() => {\n (focusTarget as UploadItemRef).focus();\n }, 0);\n }\n }\n };\n\n return (\n <>\n <div\n role=\"group\"\n className={clsx('np-upload-input', className, { disabled })}\n {...inputAttributes}\n >\n <div\n className=\"np-upload-input__section\"\n aria-live=\"polite\"\n aria-relevant=\"all\"\n role=\"region\"\n >\n {uploadedFiles.map((file, index) => (\n <UploadItem\n key={file.id}\n ref={(el: UploadItemRef | null) => {\n if (\n el &&\n el.id !== markedFileForDelete?.id &&\n !fileRefs.some((ref) => ref && ref.id === el.id) &&\n el.status !== 'processing'\n ) {\n fileRefs.push(el);\n }\n }}\n file={file}\n singleFileUpload={!multiple}\n canDelete={\n (!!onDeleteFile || file.status === Status.FAILED) &&\n (!file.status || !PROGRESS_STATUSES.has(file.status))\n }\n onDelete={\n file.status === Status.FAILED\n ? async () => {\n setLastAttemptedDeleteId(file.id);\n await removeFile(file);\n handleRefocus();\n }\n : () => {\n setLastAttemptedDeleteId(file.id);\n setMarkedFileForDelete(file);\n }\n }\n onDownload={onDownload}\n onFocus={() => handleFocus(file.id)}\n />\n ))}\n </div>\n {(multiple || (!multiple && !uploadedFiles.length)) && (\n <div className=\"np-upload-input__section np-upload-input__section--uploader\">\n <UploadButton\n ref={uploadInputRef}\n id={id}\n uploadButtonTitle={uploadButtonTitle}\n disabled={areMaximumFilesUploadedAlready() || disabled}\n multiple={multiple}\n fileTypes={fileTypes}\n sizeLimit={sizeLimit}\n description={description}\n maxFiles={maxFiles}\n withEntries={Boolean(uploadedFiles.length)}\n onChange={addFiles}\n />\n </div>\n )}\n </div>\n <Modal\n title={\n deleteConfirm?.title !== undefined\n ? deleteConfirm.title\n : formatMessage(MESSAGES.deleteModalTitle)\n }\n body={\n deleteConfirm?.body !== undefined\n ? deleteConfirm.body\n : formatMessage(MESSAGES.deleteModalBody)\n }\n open={!!markedFileForDelete}\n footer={\n <>\n <Button\n block\n onClick={() => {\n setMarkedFileForDelete(null);\n }}\n >\n {deleteConfirm?.cancelText || formatMessage(MESSAGES.deleteModalCancelButtonText)}\n </Button>\n <Button\n block\n priority={Priority.SECONDARY}\n type={ControlType.NEGATIVE}\n tabIndex={markedFileForDelete ? 0 : -1}\n onClick={() => {\n if (markedFileForDelete) {\n void removeFile(markedFileForDelete);\n }\n setMarkedFileForDelete(null);\n setLastAttemptedDeleteId(null);\n }}\n >\n {deleteConfirm?.confirmText || formatMessage(MESSAGES.deleteModalConfirmButtonText)}\n </Button>\n </>\n }\n onUnmount={handleRefocus}\n onClose={() => {\n setMarkedFileForDelete(null);\n }}\n />\n </>\n );\n};\n\nexport default UploadInput;\n"],"names":["generateFileId","file","name","size","uploadTimeStamp","Date","getTime","UploadInput","files","fileInputName","className","deleteConfirm","disabled","multiple","fileTypes","imageFileTypes","sizeLimit","DEFAULT_SIZE_LIMIT","description","onUploadFile","onDeleteFile","onValidationError","onFilesChange","onDownload","maxFiles","maxFilesErrorMessage","id","sizeLimitErrorMessage","uploadButtonTitle","inputAttributes","useInputAttributes","nonLabelable","markedFileForDelete","setMarkedFileForDelete","useState","lastAttemptedDeleteId","setLastAttemptedDeleteId","mounted","setMounted","formatMessage","useIntl","uploadInputRef","useRef","fileRefs","PROGRESS_STATUSES","Set","Status","PENDING","PROCESSING","uploadedFiles","setUploadedFiles","length","uploadedFilesListReference","updateFileList","updateFn","current","addFileToList","recentUploadedFile","list","removeFileFromList","filter","fileInList","ref","modifyFileInList","updates","map","removeFile","status","item","FAILED","Promise","resolve","error","undefined","then","catch","handleFileUploadFailure","failureMessage","failedUpload","filename","getNumberOfFilesUploaded","uploadInitiatedStatus","SUCCEEDED","validFiles","has","areMaximumFilesUploadedAlready","numberOfValidFiles","addFiles","selectedFiles","i","formData","FormData","allowedFileTypes","join","isTypeValid","MESSAGES","fileTypeNotSupported","isSizeValid","fileIsTooLarge","maximumFilesAlreadyUploaded","maxFilesAllowed","existingFile","find","f","append","pendingFile","url","useEffect","nextFocusable","setNextFocusable","handleFocus","fileId","filesCount","next","focusTarget","currentFileIndex","findIndex","currentFileId","lastFileId","fileObj","DONE","focus","target","handleRefocus","setTimeout","_jsxs","_Fragment","children","role","clsx","_jsx","index","UploadItem","el","some","push","singleFileUpload","canDelete","onDelete","onFocus","UploadButton","withEntries","Boolean","onChange","Modal","title","deleteModalTitle","body","deleteModalBody","open","footer","Button","block","onClick","cancelText","deleteModalCancelButtonText","priority","Priority","SECONDARY","type","ControlType","NEGATIVE","tabIndex","confirmText","deleteModalConfirmButtonText","onUnmount","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,SAASA,cAAcA,CAACC,IAAU,EAAA;EAChC,MAAM;IAAEC,IAAI;AAAEC,IAAAA;AAAM,GAAA,GAAGF,IAAI;EAC3B,MAAMG,eAAe,GAAG,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE;AAC5C,EAAA,OAAO,GAAGJ,IAAI,CAAA,CAAA,EAAIC,IAAI,CAAA,CAAA,EAAIC,eAAe,CAAE,CAAA;AAC7C;AAEA;;;;;;;;AAQG;AACGG,MAAAA,WAAW,GAAGA,CAAC;AACnBC,EAAAA,KAAK,GAAG,EAAE;AACVC,EAAAA,aAAa,GAAG,MAAM;EACtBC,SAAS;EACTC,aAAa;EACbC,QAAQ;AACRC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,SAAS,GAAGC,uBAAc;AAC1BC,EAAAA,SAAS,GAAGC,2BAAkB;EAC9BC,WAAW;EACXC,YAAY;EACZC,YAAY;EACZC,iBAAiB;EACjBC,aAAa;EACbC,UAA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AAI5H,aAAa,CAACwD,4BAAQ,CAACqE,4BAA4B;AAAC,SAC7E,CACV;AAAA,OAAA,CACD;AACDC,MAAAA,SAAS,EAAE1C,aAAc;MACzB2C,OAAO,EAAEA,MAAK;QACZrI,sBAAsB,CAAC,IAAI,CAAC;AAC9B;AAAE,KAEN,CAAA;AAAA,GAAA,CAAG;AAEP;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadInput.messages.js","sources":["../../src/uploadInput/UploadInput.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n fileIsTooLarge: {\n id: 'neptune.UploadInput.fileIsTooLarge',\n defaultMessage: 'File is too large',\n description: 'Error message when the selected file size exceeds the limit',\n },\n fileTypeNotSupported: {\n id: 'neptune.UploadInput.fileTypeNotSupported',\n defaultMessage: 'File type not supported',\n description: 'Error message when the selected file is not one of the supported types',\n },\n deleteModalTitle: {\n id: 'neptune.UploadInput.deleteModalTitle',\n defaultMessage: 'Sure you want to remove this file?',\n description: 'Title to display on delete confirmation modal',\n },\n deleteModalBody: {\n id: 'neptune.UploadInput.deleteModalBody',\n defaultMessage: 'Removing this file will delete it from our system.',\n description: 'Body copy to display on delete confirmation modal',\n },\n deleteModalCancelButtonText: {\n id: 'neptune.UploadInput.deleteModalCancelButtonText',\n defaultMessage: 'Cancel',\n description: 'Cancel button text to display on delete confirmation modal',\n },\n deleteModalConfirmButtonText: {\n id: 'neptune.UploadInput.deleteModalConfirmButtonText',\n defaultMessage: 'Remove',\n description: 'Confirm button text to display on delete confirmation modal',\n },\n maximumFilesAlreadyUploaded: {\n id: 'neptune.UploadInput.maximumFilesAlreadyUploaded',\n defaultMessage:\n 'Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.',\n description:\n 'When number of files to be uploaded is restricted, this message is displayed below the files that are extra',\n },\n});\n"],"names":["defineMessages","fileIsTooLarge","id","fileTypeNotSupported","deleteModalTitle","deleteModalBody","deleteModalCancelButtonText","deleteModalConfirmButtonText","maximumFilesAlreadyUploaded"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,cAAc,EAAE;IACdC,EAAE,EAAA
|
|
1
|
+
{"version":3,"file":"UploadInput.messages.js","sources":["../../src/uploadInput/UploadInput.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n fileIsTooLarge: {\n id: 'neptune.UploadInput.fileIsTooLarge',\n defaultMessage: 'File is too large',\n description: 'Error message when the selected file size exceeds the limit',\n },\n fileTypeNotSupported: {\n id: 'neptune.UploadInput.fileTypeNotSupported',\n defaultMessage: 'File type not supported',\n description: 'Error message when the selected file is not one of the supported types',\n },\n deleteModalTitle: {\n id: 'neptune.UploadInput.deleteModalTitle',\n defaultMessage: 'Sure you want to remove this file?',\n description: 'Title to display on delete confirmation modal',\n },\n deleteModalBody: {\n id: 'neptune.UploadInput.deleteModalBody',\n defaultMessage: 'Removing this file will delete it from our system.',\n description: 'Body copy to display on delete confirmation modal',\n },\n deleteModalCancelButtonText: {\n id: 'neptune.UploadInput.deleteModalCancelButtonText',\n defaultMessage: 'Cancel',\n description: 'Cancel button text to display on delete confirmation modal',\n },\n deleteModalConfirmButtonText: {\n id: 'neptune.UploadInput.deleteModalConfirmButtonText',\n defaultMessage: 'Remove',\n description: 'Confirm button text to display on delete confirmation modal',\n },\n maximumFilesAlreadyUploaded: {\n id: 'neptune.UploadInput.maximumFilesAlreadyUploaded',\n defaultMessage:\n 'Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.',\n description:\n 'When number of files to be uploaded is restricted, this message is displayed below the files that are extra',\n },\n});\n"],"names":["defineMessages","fileIsTooLarge","id","fileTypeNotSupported","deleteModalTitle","deleteModalBody","deleteModalCancelButtonText","deleteModalConfirmButtonText","maximumFilesAlreadyUploaded"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,cAAc,EAAE;IACdC,EAAE,EAAA;GAGH;AACDC,EAAAA,oBAAoB,EAAE;IACpBD,EAAE,EAAA;GAGH;AACDE,EAAAA,gBAAgB,EAAE;IAChBF,EAAE,EAAA;GAGH;AACDG,EAAAA,eAAe,EAAE;IACfH,EAAE,EAAA;GAGH;AACDI,EAAAA,2BAA2B,EAAE;IAC3BJ,EAAE,EAAA;GAGH;AACDK,EAAAA,4BAA4B,EAAE;IAC5BL,EAAE,EAAA;GAGH;AACDM,EAAAA,2BAA2B,EAAE;IAC3BN,EAAE,EAAA;AAKH;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadInput.messages.mjs","sources":["../../src/uploadInput/UploadInput.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n fileIsTooLarge: {\n id: 'neptune.UploadInput.fileIsTooLarge',\n defaultMessage: 'File is too large',\n description: 'Error message when the selected file size exceeds the limit',\n },\n fileTypeNotSupported: {\n id: 'neptune.UploadInput.fileTypeNotSupported',\n defaultMessage: 'File type not supported',\n description: 'Error message when the selected file is not one of the supported types',\n },\n deleteModalTitle: {\n id: 'neptune.UploadInput.deleteModalTitle',\n defaultMessage: 'Sure you want to remove this file?',\n description: 'Title to display on delete confirmation modal',\n },\n deleteModalBody: {\n id: 'neptune.UploadInput.deleteModalBody',\n defaultMessage: 'Removing this file will delete it from our system.',\n description: 'Body copy to display on delete confirmation modal',\n },\n deleteModalCancelButtonText: {\n id: 'neptune.UploadInput.deleteModalCancelButtonText',\n defaultMessage: 'Cancel',\n description: 'Cancel button text to display on delete confirmation modal',\n },\n deleteModalConfirmButtonText: {\n id: 'neptune.UploadInput.deleteModalConfirmButtonText',\n defaultMessage: 'Remove',\n description: 'Confirm button text to display on delete confirmation modal',\n },\n maximumFilesAlreadyUploaded: {\n id: 'neptune.UploadInput.maximumFilesAlreadyUploaded',\n defaultMessage:\n 'Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.',\n description:\n 'When number of files to be uploaded is restricted, this message is displayed below the files that are extra',\n },\n});\n"],"names":["defineMessages","fileIsTooLarge","id","fileTypeNotSupported","deleteModalTitle","deleteModalBody","deleteModalCancelButtonText","deleteModalConfirmButtonText","maximumFilesAlreadyUploaded"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,cAAc,EAAE;IACdC,EAAE,EAAA
|
|
1
|
+
{"version":3,"file":"UploadInput.messages.mjs","sources":["../../src/uploadInput/UploadInput.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n fileIsTooLarge: {\n id: 'neptune.UploadInput.fileIsTooLarge',\n defaultMessage: 'File is too large',\n description: 'Error message when the selected file size exceeds the limit',\n },\n fileTypeNotSupported: {\n id: 'neptune.UploadInput.fileTypeNotSupported',\n defaultMessage: 'File type not supported',\n description: 'Error message when the selected file is not one of the supported types',\n },\n deleteModalTitle: {\n id: 'neptune.UploadInput.deleteModalTitle',\n defaultMessage: 'Sure you want to remove this file?',\n description: 'Title to display on delete confirmation modal',\n },\n deleteModalBody: {\n id: 'neptune.UploadInput.deleteModalBody',\n defaultMessage: 'Removing this file will delete it from our system.',\n description: 'Body copy to display on delete confirmation modal',\n },\n deleteModalCancelButtonText: {\n id: 'neptune.UploadInput.deleteModalCancelButtonText',\n defaultMessage: 'Cancel',\n description: 'Cancel button text to display on delete confirmation modal',\n },\n deleteModalConfirmButtonText: {\n id: 'neptune.UploadInput.deleteModalConfirmButtonText',\n defaultMessage: 'Remove',\n description: 'Confirm button text to display on delete confirmation modal',\n },\n maximumFilesAlreadyUploaded: {\n id: 'neptune.UploadInput.maximumFilesAlreadyUploaded',\n defaultMessage:\n 'Sorry, this upload failed because we can only accept {maxFilesAllowed} files at once.',\n description:\n 'When number of files to be uploaded is restricted, this message is displayed below the files that are extra',\n },\n});\n"],"names":["defineMessages","fileIsTooLarge","id","fileTypeNotSupported","deleteModalTitle","deleteModalBody","deleteModalCancelButtonText","deleteModalConfirmButtonText","maximumFilesAlreadyUploaded"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,cAAc,EAAE;IACdC,EAAE,EAAA;GAGH;AACDC,EAAAA,oBAAoB,EAAE;IACpBD,EAAE,EAAA;GAGH;AACDE,EAAAA,gBAAgB,EAAE;IAChBF,EAAE,EAAA;GAGH;AACDG,EAAAA,eAAe,EAAE;IACfH,EAAE,EAAA;GAGH;AACDI,EAAAA,2BAA2B,EAAE;IAC3BJ,EAAE,EAAA;GAGH;AACDK,EAAAA,4BAA4B,EAAE;IAC5BL,EAAE,EAAA;GAGH;AACDM,EAAAA,2BAA2B,EAAE;IAC3BN,EAAE,EAAA;AAKH;AACF,CAAA,CAAC;;;;"}
|
|
@@ -4,7 +4,7 @@ import { useIntl } from 'react-intl';
|
|
|
4
4
|
import Button from '../button/Button.resolver.mjs';
|
|
5
5
|
import '../common/theme.mjs';
|
|
6
6
|
import '../common/direction.mjs';
|
|
7
|
-
import {
|
|
7
|
+
import { ControlType, Priority } from '../common/propsValues/control.mjs';
|
|
8
8
|
import '../common/propsValues/breakpoint.mjs';
|
|
9
9
|
import '../common/propsValues/size.mjs';
|
|
10
10
|
import '../common/propsValues/typography.mjs';
|
|
@@ -30,7 +30,7 @@ import { isSizeValid } from '../upload/utils/isSizeValid/isSizeValid.mjs';
|
|
|
30
30
|
import { isTypeValid } from '../upload/utils/isTypeValid/isTypeValid.mjs';
|
|
31
31
|
import MESSAGES from './UploadInput.messages.mjs';
|
|
32
32
|
import UploadButton from './uploadButton/UploadButton.mjs';
|
|
33
|
-
import {
|
|
33
|
+
import { DEFAULT_SIZE_LIMIT, imageFileTypes } from './uploadButton/defaults.mjs';
|
|
34
34
|
import UploadItem from './uploadItem/UploadItem.mjs';
|
|
35
35
|
|
|
36
36
|
function generateFileId(file) {
|
|
@@ -75,6 +75,7 @@ const UploadInput = ({
|
|
|
75
75
|
nonLabelable: true
|
|
76
76
|
});
|
|
77
77
|
const [markedFileForDelete, setMarkedFileForDelete] = useState(null);
|
|
78
|
+
const [lastAttemptedDeleteId, setLastAttemptedDeleteId] = useState(null);
|
|
78
79
|
const [mounted, setMounted] = useState(false);
|
|
79
80
|
const {
|
|
80
81
|
formatMessage
|
|
@@ -223,6 +224,13 @@ const UploadInput = ({
|
|
|
223
224
|
});
|
|
224
225
|
const filesCount = fileRefs.length;
|
|
225
226
|
let next = uploadInputRef.current;
|
|
227
|
+
let focusTarget = 'button';
|
|
228
|
+
// If there will be no files left after deletion, focus the upload button
|
|
229
|
+
if (filesCount === 1) {
|
|
230
|
+
next = uploadInputRef.current;
|
|
231
|
+
setNextFocusable(next);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
226
234
|
if (filesCount > 1) {
|
|
227
235
|
const currentFileIndex = fileRefs.findIndex(file => file?.id === fileId);
|
|
228
236
|
const currentFileId = fileRefs?.[currentFileIndex]?.id;
|
|
@@ -233,14 +241,50 @@ const UploadInput = ({
|
|
|
233
241
|
} else {
|
|
234
242
|
next = fileRefs[currentFileIndex + 1];
|
|
235
243
|
}
|
|
244
|
+
// If next is an UploadItemRef, check if it has a URL (succeeded)
|
|
245
|
+
if (next && 'status' in next) {
|
|
246
|
+
// Find the file object for this ref
|
|
247
|
+
const fileObj = uploadedFiles.find(f => f.id === next?.id);
|
|
248
|
+
if (fileObj && (fileObj.status === Status.SUCCEEDED || fileObj.status === Status.DONE) && fileObj.url) {
|
|
249
|
+
focusTarget = 'link';
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
setNextFocusable(() => {
|
|
253
|
+
if (next && typeof next.focus === 'function') {
|
|
254
|
+
return {
|
|
255
|
+
ref: next,
|
|
256
|
+
target: focusTarget
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
return next;
|
|
260
|
+
});
|
|
236
261
|
}
|
|
237
|
-
setNextFocusable(next);
|
|
238
262
|
};
|
|
239
263
|
const handleRefocus = () => {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
264
|
+
const focusTarget = nextFocusable;
|
|
265
|
+
if (lastAttemptedDeleteId) {
|
|
266
|
+
setLastAttemptedDeleteId(null);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (focusTarget) {
|
|
270
|
+
// If there are no files left, focus the upload button
|
|
271
|
+
if (uploadedFiles.length === 0 && uploadInputRef.current && typeof uploadInputRef.current.focus === 'function') {
|
|
272
|
+
setTimeout(() => {
|
|
273
|
+
uploadInputRef.current.focus();
|
|
274
|
+
}, 0);
|
|
275
|
+
} else if (typeof focusTarget === 'object' && 'ref' in focusTarget && focusTarget.ref && typeof focusTarget.ref.focus === 'function') {
|
|
276
|
+
setTimeout(() => {
|
|
277
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
278
|
+
if (focusTarget.ref && typeof focusTarget.ref.focus === 'function') {
|
|
279
|
+
// @ts-expect-error: focus may not exist on all possible ref types, but is safe here
|
|
280
|
+
focusTarget.ref.focus(focusTarget.target);
|
|
281
|
+
}
|
|
282
|
+
}, 0);
|
|
283
|
+
} else if (focusTarget && typeof focusTarget.focus === 'function') {
|
|
284
|
+
setTimeout(() => {
|
|
285
|
+
focusTarget.focus();
|
|
286
|
+
}, 0);
|
|
287
|
+
}
|
|
244
288
|
}
|
|
245
289
|
};
|
|
246
290
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
@@ -265,9 +309,13 @@ const UploadInput = ({
|
|
|
265
309
|
singleFileUpload: !multiple,
|
|
266
310
|
canDelete: (!!onDeleteFile || file.status === Status.FAILED) && (!file.status || !PROGRESS_STATUSES.has(file.status)),
|
|
267
311
|
onDelete: file.status === Status.FAILED ? async () => {
|
|
312
|
+
setLastAttemptedDeleteId(file.id);
|
|
268
313
|
await removeFile(file);
|
|
269
314
|
handleRefocus();
|
|
270
|
-
} : () =>
|
|
315
|
+
} : () => {
|
|
316
|
+
setLastAttemptedDeleteId(file.id);
|
|
317
|
+
setMarkedFileForDelete(file);
|
|
318
|
+
},
|
|
271
319
|
onDownload: onDownload,
|
|
272
320
|
onFocus: () => handleFocus(file.id)
|
|
273
321
|
}, file.id))
|
|
@@ -308,6 +356,7 @@ const UploadInput = ({
|
|
|
308
356
|
void removeFile(markedFileForDelete);
|
|
309
357
|
}
|
|
310
358
|
setMarkedFileForDelete(null);
|
|
359
|
+
setLastAttemptedDeleteId(null);
|
|
311
360
|
},
|
|
312
361
|
children: deleteConfirm?.confirmText || formatMessage(MESSAGES.deleteModalConfirmButtonText)
|
|
313
362
|
})]
|