@transferwise/components 46.45.0 → 46.46.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 +40 -0
- package/build/accordion/Accordion.js.map +1 -0
- package/build/accordion/Accordion.mjs +38 -0
- package/build/accordion/Accordion.mjs.map +1 -0
- package/build/accordion/AccordionItem/AccordionItem.js +70 -0
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -0
- package/build/accordion/AccordionItem/AccordionItem.mjs +64 -0
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -0
- package/build/actionButton/ActionButton.js +31 -0
- package/build/actionButton/ActionButton.js.map +1 -0
- package/build/actionButton/ActionButton.mjs +25 -0
- package/build/actionButton/ActionButton.mjs.map +1 -0
- package/build/actionOption/ActionOption.js +61 -0
- package/build/actionOption/ActionOption.js.map +1 -0
- package/build/actionOption/ActionOption.mjs +55 -0
- package/build/actionOption/ActionOption.mjs.map +1 -0
- package/build/alert/Alert.js +159 -0
- package/build/alert/Alert.js.map +1 -0
- package/build/alert/Alert.mjs +151 -0
- package/build/alert/Alert.mjs.map +1 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.js +18 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs +16 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -0
- package/build/avatar/Avatar.js +54 -0
- package/build/avatar/Avatar.js.map +1 -0
- package/build/avatar/Avatar.mjs +48 -0
- package/build/avatar/Avatar.mjs.map +1 -0
- package/build/avatar/avatarTypes.js +11 -0
- package/build/avatar/avatarTypes.js.map +1 -0
- package/build/avatar/avatarTypes.mjs +11 -0
- package/build/avatar/avatarTypes.mjs.map +1 -0
- package/build/avatar/colors/colors.js +31 -0
- package/build/avatar/colors/colors.js.map +1 -0
- package/build/avatar/colors/colors.mjs +29 -0
- package/build/avatar/colors/colors.mjs.map +1 -0
- package/build/avatarWrapper/AvatarWrapper.js +120 -0
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -0
- package/build/avatarWrapper/AvatarWrapper.mjs +118 -0
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -0
- package/build/avatarWrapper/index.js +8 -0
- package/build/avatarWrapper/index.js.map +1 -0
- package/build/avatarWrapper/index.mjs +6 -0
- package/build/avatarWrapper/index.mjs.map +1 -0
- package/build/badge/Badge.js +36 -0
- package/build/badge/Badge.js.map +1 -0
- package/build/badge/Badge.mjs +30 -0
- package/build/badge/Badge.mjs.map +1 -0
- package/build/body/Body.js +31 -0
- package/build/body/Body.js.map +1 -0
- package/build/body/Body.mjs +25 -0
- package/build/body/Body.mjs.map +1 -0
- package/build/button/Button.js +86 -0
- package/build/button/Button.js.map +1 -0
- package/build/button/Button.messages.js +12 -0
- package/build/button/Button.messages.js.map +1 -0
- package/build/button/Button.messages.mjs +10 -0
- package/build/button/Button.messages.mjs.map +1 -0
- package/build/button/Button.mjs +80 -0
- package/build/button/Button.mjs.map +1 -0
- package/build/button/classMap.js +18 -0
- package/build/button/classMap.js.map +1 -0
- package/build/button/classMap.mjs +15 -0
- package/build/button/classMap.mjs.map +1 -0
- package/build/button/legacyUtils/legacyUtils.js +54 -0
- package/build/button/legacyUtils/legacyUtils.js.map +1 -0
- package/build/button/legacyUtils/legacyUtils.mjs +50 -0
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -0
- package/build/card/Card.js +65 -0
- package/build/card/Card.js.map +1 -0
- package/build/card/Card.mjs +59 -0
- package/build/card/Card.mjs.map +1 -0
- package/build/carousel/Carousel.js +283 -0
- package/build/carousel/Carousel.js.map +1 -0
- package/build/carousel/Carousel.mjs +277 -0
- package/build/carousel/Carousel.mjs.map +1 -0
- package/build/checkbox/Checkbox.js +64 -0
- package/build/checkbox/Checkbox.js.map +1 -0
- package/build/checkbox/Checkbox.mjs +58 -0
- package/build/checkbox/Checkbox.mjs.map +1 -0
- package/build/checkboxButton/CheckboxButton.js +40 -0
- package/build/checkboxButton/CheckboxButton.js.map +1 -0
- package/build/checkboxButton/CheckboxButton.mjs +34 -0
- package/build/checkboxButton/CheckboxButton.mjs.map +1 -0
- package/build/checkboxOption/CheckboxOption.js +27 -0
- package/build/checkboxOption/CheckboxOption.js.map +1 -0
- package/build/checkboxOption/CheckboxOption.mjs +25 -0
- package/build/checkboxOption/CheckboxOption.mjs.map +1 -0
- package/build/chevron/Chevron.js +60 -0
- package/build/chevron/Chevron.js.map +1 -0
- package/build/chevron/Chevron.mjs +54 -0
- package/build/chevron/Chevron.mjs.map +1 -0
- package/build/chips/Chip.js +71 -0
- package/build/chips/Chip.js.map +1 -0
- package/build/chips/Chip.mjs +65 -0
- package/build/chips/Chip.mjs.map +1 -0
- package/build/chips/Chips.js +62 -0
- package/build/chips/Chips.js.map +1 -0
- package/build/chips/Chips.messages.js +12 -0
- package/build/chips/Chips.messages.js.map +1 -0
- package/build/chips/Chips.messages.mjs +10 -0
- package/build/chips/Chips.messages.mjs.map +1 -0
- package/build/chips/Chips.mjs +56 -0
- package/build/chips/Chips.mjs.map +1 -0
- package/build/circularButton/CircularButton.js +46 -0
- package/build/circularButton/CircularButton.js.map +1 -0
- package/build/circularButton/CircularButton.mjs +40 -0
- package/build/circularButton/CircularButton.mjs.map +1 -0
- package/build/common/DOMOperations/DOMOperations.js +24 -0
- package/build/common/DOMOperations/DOMOperations.js.map +1 -0
- package/build/common/DOMOperations/DOMOperations.mjs +21 -0
- package/build/common/DOMOperations/DOMOperations.mjs.map +1 -0
- package/build/common/Option/Option.js +71 -0
- package/build/common/Option/Option.js.map +1 -0
- package/build/common/Option/Option.mjs +65 -0
- package/build/common/Option/Option.mjs.map +1 -0
- package/build/common/RadioButton/RadioButton.js +46 -0
- package/build/common/RadioButton/RadioButton.js.map +1 -0
- package/build/common/RadioButton/RadioButton.mjs +40 -0
- package/build/common/RadioButton/RadioButton.mjs.map +1 -0
- package/build/common/action/Action.js +37 -0
- package/build/common/action/Action.js.map +1 -0
- package/build/common/action/Action.mjs +31 -0
- package/build/common/action/Action.mjs.map +1 -0
- package/build/common/bottomSheet/BottomSheet.js +194 -0
- package/build/common/bottomSheet/BottomSheet.js.map +1 -0
- package/build/common/bottomSheet/BottomSheet.mjs +188 -0
- package/build/common/bottomSheet/BottomSheet.mjs.map +1 -0
- package/build/common/card/Card.js +49 -0
- package/build/common/card/Card.js.map +1 -0
- package/build/common/card/Card.mjs +43 -0
- package/build/common/card/Card.mjs.map +1 -0
- package/build/common/closeButton/CloseButton.js +46 -0
- package/build/common/closeButton/CloseButton.js.map +1 -0
- package/build/common/closeButton/CloseButton.messages.js +12 -0
- package/build/common/closeButton/CloseButton.messages.js.map +1 -0
- package/build/common/closeButton/CloseButton.messages.mjs +10 -0
- package/build/common/closeButton/CloseButton.messages.mjs.map +1 -0
- package/build/common/closeButton/CloseButton.mjs +40 -0
- package/build/common/closeButton/CloseButton.mjs.map +1 -0
- package/build/common/dateUtils/getDayNames/getDayNames.js +18 -0
- package/build/common/dateUtils/getDayNames/getDayNames.js.map +1 -0
- package/build/common/dateUtils/getDayNames/getDayNames.mjs +16 -0
- package/build/common/dateUtils/getDayNames/getDayNames.mjs.map +1 -0
- package/build/common/dateUtils/getFormatForLocale/getFormatForLocale.js +8 -0
- package/build/common/dateUtils/getFormatForLocale/getFormatForLocale.js.map +1 -0
- package/build/common/dateUtils/getFormatForLocale/getFormatForLocale.mjs +5 -0
- package/build/common/dateUtils/getFormatForLocale/getFormatForLocale.mjs.map +1 -0
- package/build/common/dateUtils/getMonthNames/getMonthNames.js +19 -0
- package/build/common/dateUtils/getMonthNames/getMonthNames.js.map +1 -0
- package/build/common/dateUtils/getMonthNames/getMonthNames.mjs +17 -0
- package/build/common/dateUtils/getMonthNames/getMonthNames.mjs.map +1 -0
- package/build/common/dateUtils/isDateValid/isDateValid.js +17 -0
- package/build/common/dateUtils/isDateValid/isDateValid.js.map +1 -0
- package/build/common/dateUtils/isDateValid/isDateValid.mjs +14 -0
- package/build/common/dateUtils/isDateValid/isDateValid.mjs.map +1 -0
- package/build/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +8 -0
- package/build/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js.map +1 -0
- package/build/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.mjs +6 -0
- package/build/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.mjs.map +1 -0
- package/build/common/dateUtils/isWithinRange/isWithinRange.js +8 -0
- package/build/common/dateUtils/isWithinRange/isWithinRange.js.map +1 -0
- package/build/common/dateUtils/isWithinRange/isWithinRange.mjs +6 -0
- package/build/common/dateUtils/isWithinRange/isWithinRange.mjs.map +1 -0
- package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.js +15 -0
- package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.js.map +1 -0
- package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.mjs +13 -0
- package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.mjs.map +1 -0
- package/build/common/deviceDetection/deviceDetection.js +11 -0
- package/build/common/deviceDetection/deviceDetection.js.map +1 -0
- package/build/common/deviceDetection/deviceDetection.mjs +9 -0
- package/build/common/deviceDetection/deviceDetection.mjs.map +1 -0
- package/build/common/direction.js +9 -0
- package/build/common/direction.js.map +1 -0
- package/build/common/direction.mjs +9 -0
- package/build/common/direction.mjs.map +1 -0
- package/build/common/domHelpers/documentIosClick.js +39 -0
- package/build/common/domHelpers/documentIosClick.js.map +1 -0
- package/build/common/domHelpers/documentIosClick.mjs +33 -0
- package/build/common/domHelpers/documentIosClick.mjs.map +1 -0
- package/build/common/fileType.js +10 -0
- package/build/common/fileType.js.map +1 -0
- package/build/common/fileType.mjs +10 -0
- package/build/common/fileType.mjs.map +1 -0
- package/build/common/flowHeader/FlowHeader.js +53 -0
- package/build/common/flowHeader/FlowHeader.js.map +1 -0
- package/build/common/flowHeader/FlowHeader.mjs +28 -0
- package/build/common/flowHeader/FlowHeader.mjs.map +1 -0
- package/build/common/focusBoundary/FocusBoundary.js +28 -0
- package/build/common/focusBoundary/FocusBoundary.js.map +1 -0
- package/build/common/focusBoundary/FocusBoundary.mjs +26 -0
- package/build/common/focusBoundary/FocusBoundary.mjs.map +1 -0
- package/build/common/historyNavigator/historyNavigator.js +39 -0
- package/build/common/historyNavigator/historyNavigator.js.map +1 -0
- package/build/common/historyNavigator/historyNavigator.mjs +37 -0
- package/build/common/historyNavigator/historyNavigator.mjs.map +1 -0
- package/build/common/hooks/useConditionalListener/useConditionalListener.js +25 -0
- package/build/common/hooks/useConditionalListener/useConditionalListener.js.map +1 -0
- package/build/common/hooks/useConditionalListener/useConditionalListener.mjs +23 -0
- package/build/common/hooks/useConditionalListener/useConditionalListener.mjs.map +1 -0
- package/build/common/hooks/useDirection/useDirection.js +15 -0
- package/build/common/hooks/useDirection/useDirection.js.map +1 -0
- package/build/common/hooks/useDirection/useDirection.mjs +13 -0
- package/build/common/hooks/useDirection/useDirection.mjs.map +1 -0
- package/build/common/hooks/useEffectEvent.js +22 -0
- package/build/common/hooks/useEffectEvent.js.map +1 -0
- package/build/common/hooks/useEffectEvent.mjs +20 -0
- package/build/common/hooks/useEffectEvent.mjs.map +1 -0
- package/build/common/hooks/useHasIntersected/useHasIntersected.js +64 -0
- package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -0
- package/build/common/hooks/useHasIntersected/useHasIntersected.mjs +62 -0
- package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -0
- package/build/common/hooks/useLayout/useLayout.js +26 -0
- package/build/common/hooks/useLayout/useLayout.js.map +1 -0
- package/build/common/hooks/useLayout/useLayout.mjs +24 -0
- package/build/common/hooks/useLayout/useLayout.mjs.map +1 -0
- package/build/common/hooks/useMedia.js +16 -0
- package/build/common/hooks/useMedia.js.map +1 -0
- package/build/common/hooks/useMedia.mjs +14 -0
- package/build/common/hooks/useMedia.mjs.map +1 -0
- package/build/common/hooks/useResizeObserver.js +25 -0
- package/build/common/hooks/useResizeObserver.js.map +1 -0
- package/build/common/hooks/useResizeObserver.mjs +23 -0
- package/build/common/hooks/useResizeObserver.mjs.map +1 -0
- package/build/common/hooks/useScreenSize.js +10 -0
- package/build/common/hooks/useScreenSize.js.map +1 -0
- package/build/common/hooks/useScreenSize.mjs +8 -0
- package/build/common/hooks/useScreenSize.mjs.map +1 -0
- package/build/common/hooks/useVirtualKeyboard.js +26 -0
- package/build/common/hooks/useVirtualKeyboard.js.map +1 -0
- package/build/common/hooks/useVirtualKeyboard.mjs +24 -0
- package/build/common/hooks/useVirtualKeyboard.mjs.map +1 -0
- package/build/common/locale/index.js +85 -0
- package/build/common/locale/index.js.map +1 -0
- package/build/common/locale/index.mjs +76 -0
- package/build/common/locale/index.mjs.map +1 -0
- package/build/common/panel/Panel.js +133 -0
- package/build/common/panel/Panel.js.map +1 -0
- package/build/common/panel/Panel.mjs +127 -0
- package/build/common/panel/Panel.mjs.map +1 -0
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.js +21 -0
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.js.map +1 -0
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.mjs +19 -0
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.mjs.map +1 -0
- package/build/common/preventScroll/PreventScroll.js +11 -0
- package/build/common/preventScroll/PreventScroll.js.map +1 -0
- package/build/common/preventScroll/PreventScroll.mjs +9 -0
- package/build/common/preventScroll/PreventScroll.mjs.map +1 -0
- package/build/common/propsValues/breakpoint.js +12 -0
- package/build/common/propsValues/breakpoint.js.map +1 -0
- package/build/common/propsValues/breakpoint.mjs +12 -0
- package/build/common/propsValues/breakpoint.mjs.map +1 -0
- package/build/common/propsValues/control.js +15 -0
- package/build/common/propsValues/control.js.map +1 -0
- package/build/common/propsValues/control.mjs +15 -0
- package/build/common/propsValues/control.mjs.map +1 -0
- package/build/common/propsValues/dateMode.js +8 -0
- package/build/common/propsValues/dateMode.js.map +1 -0
- package/build/common/propsValues/dateMode.mjs +8 -0
- package/build/common/propsValues/dateMode.mjs.map +1 -0
- package/build/common/propsValues/layouts.js +13 -0
- package/build/common/propsValues/layouts.js.map +1 -0
- package/build/common/propsValues/layouts.mjs +13 -0
- package/build/common/propsValues/layouts.mjs.map +1 -0
- package/build/common/propsValues/markdownNodeType.js +22 -0
- package/build/common/propsValues/markdownNodeType.js.map +1 -0
- package/build/common/propsValues/markdownNodeType.mjs +22 -0
- package/build/common/propsValues/markdownNodeType.mjs.map +1 -0
- package/build/common/propsValues/monthFormat.js +8 -0
- package/build/common/propsValues/monthFormat.js.map +1 -0
- package/build/common/propsValues/monthFormat.mjs +8 -0
- package/build/common/propsValues/monthFormat.mjs.map +1 -0
- package/build/common/propsValues/position.js +15 -0
- package/build/common/propsValues/position.js.map +1 -0
- package/build/common/propsValues/position.mjs +15 -0
- package/build/common/propsValues/position.mjs.map +1 -0
- package/build/common/propsValues/profileType.js +8 -0
- package/build/common/propsValues/profileType.js.map +1 -0
- package/build/common/propsValues/profileType.mjs +8 -0
- package/build/common/propsValues/profileType.mjs.map +1 -0
- package/build/common/propsValues/scroll.js +8 -0
- package/build/common/propsValues/scroll.js.map +1 -0
- package/build/common/propsValues/scroll.mjs +8 -0
- package/build/common/propsValues/scroll.mjs.map +1 -0
- package/build/common/propsValues/sentiment.js +23 -0
- package/build/common/propsValues/sentiment.js.map +1 -0
- package/build/common/propsValues/sentiment.mjs +23 -0
- package/build/common/propsValues/sentiment.mjs.map +1 -0
- package/build/common/propsValues/size.js +11 -0
- package/build/common/propsValues/size.js.map +1 -0
- package/build/common/propsValues/size.mjs +11 -0
- package/build/common/propsValues/size.mjs.map +1 -0
- package/build/common/propsValues/status.js +13 -0
- package/build/common/propsValues/status.js.map +1 -0
- package/build/common/propsValues/status.mjs +13 -0
- package/build/common/propsValues/status.mjs.map +1 -0
- package/build/common/propsValues/type.js +17 -0
- package/build/common/propsValues/type.js.map +1 -0
- package/build/common/propsValues/type.mjs +17 -0
- package/build/common/propsValues/type.mjs.map +1 -0
- package/build/common/propsValues/typography.js +25 -0
- package/build/common/propsValues/typography.js.map +1 -0
- package/build/common/propsValues/typography.mjs +25 -0
- package/build/common/propsValues/typography.mjs.map +1 -0
- package/build/common/propsValues/variant.js +8 -0
- package/build/common/propsValues/variant.js.map +1 -0
- package/build/common/propsValues/variant.mjs +8 -0
- package/build/common/propsValues/variant.mjs.map +1 -0
- package/build/common/propsValues/width.js +8 -0
- package/build/common/propsValues/width.js.map +1 -0
- package/build/common/propsValues/width.mjs +8 -0
- package/build/common/propsValues/width.mjs.map +1 -0
- package/build/common/responsivePanel/ResponsivePanel.js +45 -0
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -0
- package/build/common/responsivePanel/ResponsivePanel.mjs +43 -0
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -0
- package/build/common/textFormat/formatWithPattern/formatWithPattern.js +27 -0
- package/build/common/textFormat/formatWithPattern/formatWithPattern.js.map +1 -0
- package/build/common/textFormat/formatWithPattern/formatWithPattern.mjs +25 -0
- package/build/common/textFormat/formatWithPattern/formatWithPattern.mjs.map +1 -0
- package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +8 -0
- package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js.map +1 -0
- package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.mjs +6 -0
- package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.mjs.map +1 -0
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +30 -0
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js.map +1 -0
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.mjs +28 -0
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.mjs.map +1 -0
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +32 -0
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js.map +1 -0
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.mjs +29 -0
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.mjs.map +1 -0
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +18 -0
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js.map +1 -0
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.mjs +16 -0
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.mjs.map +1 -0
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js +14 -0
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js.map +1 -0
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.mjs +12 -0
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.mjs.map +1 -0
- package/build/common/theme.js +13 -0
- package/build/common/theme.js.map +1 -0
- package/build/common/theme.mjs +13 -0
- package/build/common/theme.mjs.map +1 -0
- package/build/criticalBanner/CriticalCommsBanner.js +77 -0
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -0
- package/build/criticalBanner/CriticalCommsBanner.mjs +71 -0
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -0
- package/build/dateInput/DateInput.js +329 -0
- package/build/dateInput/DateInput.js.map +1 -0
- package/build/dateInput/DateInput.messages.js +24 -0
- package/build/dateInput/DateInput.messages.js.map +1 -0
- package/build/dateInput/DateInput.messages.mjs +22 -0
- package/build/dateInput/DateInput.messages.mjs.map +1 -0
- package/build/dateInput/DateInput.mjs +323 -0
- package/build/dateInput/DateInput.mjs.map +1 -0
- package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +9 -0
- package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js.map +1 -0
- package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.mjs +7 -0
- package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.mjs.map +1 -0
- package/build/dateLookup/DateLookup.js +339 -0
- package/build/dateLookup/DateLookup.js.map +1 -0
- package/build/dateLookup/DateLookup.messages.js +33 -0
- package/build/dateLookup/DateLookup.messages.js.map +1 -0
- package/build/dateLookup/DateLookup.messages.mjs +31 -0
- package/build/dateLookup/DateLookup.messages.mjs.map +1 -0
- package/build/dateLookup/DateLookup.mjs +333 -0
- package/build/dateLookup/DateLookup.mjs.map +1 -0
- package/build/dateLookup/dateHeader/DateHeader.js +73 -0
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -0
- package/build/dateLookup/dateHeader/DateHeader.mjs +67 -0
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -0
- package/build/dateLookup/dateTrigger/DateTrigger.js +70 -0
- package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -0
- package/build/dateLookup/dateTrigger/DateTrigger.messages.js +12 -0
- package/build/dateLookup/dateTrigger/DateTrigger.messages.js.map +1 -0
- package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs +10 -0
- package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs.map +1 -0
- package/build/dateLookup/dateTrigger/DateTrigger.mjs +68 -0
- package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -0
- package/build/dateLookup/dayCalendar/DayCalendar.js +71 -0
- package/build/dateLookup/dayCalendar/DayCalendar.js.map +1 -0
- package/build/dateLookup/dayCalendar/DayCalendar.mjs +69 -0
- package/build/dateLookup/dayCalendar/DayCalendar.mjs.map +1 -0
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +150 -0
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -0
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs +148 -0
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -0
- package/build/dateLookup/getFocusableTime/getFocusableTime.js +8 -0
- package/build/dateLookup/getFocusableTime/getFocusableTime.js.map +1 -0
- package/build/dateLookup/getFocusableTime/getFocusableTime.mjs +6 -0
- package/build/dateLookup/getFocusableTime/getFocusableTime.mjs.map +1 -0
- package/build/dateLookup/getStartOfDay/getStartOfDay.js +15 -0
- package/build/dateLookup/getStartOfDay/getStartOfDay.js.map +1 -0
- package/build/dateLookup/getStartOfDay/getStartOfDay.mjs +13 -0
- package/build/dateLookup/getStartOfDay/getStartOfDay.mjs.map +1 -0
- package/build/dateLookup/monthCalendar/MonthCalendar.js +64 -0
- package/build/dateLookup/monthCalendar/MonthCalendar.js.map +1 -0
- package/build/dateLookup/monthCalendar/MonthCalendar.mjs +62 -0
- package/build/dateLookup/monthCalendar/MonthCalendar.mjs.map +1 -0
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js +83 -0
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -0
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs +81 -0
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +1 -0
- package/build/dateLookup/tableLink/TableLink.js +65 -0
- package/build/dateLookup/tableLink/TableLink.js.map +1 -0
- package/build/dateLookup/tableLink/TableLink.mjs +59 -0
- package/build/dateLookup/tableLink/TableLink.mjs.map +1 -0
- package/build/dateLookup/yearCalendar/YearCalendar.js +57 -0
- package/build/dateLookup/yearCalendar/YearCalendar.js.map +1 -0
- package/build/dateLookup/yearCalendar/YearCalendar.mjs +55 -0
- package/build/dateLookup/yearCalendar/YearCalendar.mjs.map +1 -0
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js +83 -0
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -0
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs +81 -0
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +1 -0
- package/build/decision/Decision.js +108 -0
- package/build/decision/Decision.js.map +1 -0
- package/build/decision/Decision.mjs +100 -0
- package/build/decision/Decision.mjs.map +1 -0
- package/build/definitionList/DefinitionList.js +72 -0
- package/build/definitionList/DefinitionList.js.map +1 -0
- package/build/definitionList/DefinitionList.mjs +66 -0
- package/build/definitionList/DefinitionList.mjs.map +1 -0
- package/build/dimmer/Dimmer.js +184 -0
- package/build/dimmer/Dimmer.js.map +1 -0
- package/build/dimmer/Dimmer.mjs +172 -0
- package/build/dimmer/Dimmer.mjs.map +1 -0
- package/build/dimmer/dimmerManager/DimmerManager.js +36 -0
- package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -0
- package/build/dimmer/dimmerManager/DimmerManager.mjs +34 -0
- package/build/dimmer/dimmerManager/DimmerManager.mjs.map +1 -0
- package/build/display/Display.js +26 -0
- package/build/display/Display.js.map +1 -0
- package/build/display/Display.mjs +20 -0
- package/build/display/Display.mjs.map +1 -0
- package/build/drawer/Drawer.js +68 -0
- package/build/drawer/Drawer.js.map +1 -0
- package/build/drawer/Drawer.mjs +62 -0
- package/build/drawer/Drawer.mjs.map +1 -0
- package/build/dropFade/DropFade.js +48 -0
- package/build/dropFade/DropFade.js.map +1 -0
- package/build/dropFade/DropFade.mjs +42 -0
- package/build/dropFade/DropFade.mjs.map +1 -0
- package/build/emphasis/Emphasis.js +24 -0
- package/build/emphasis/Emphasis.js.map +1 -0
- package/build/emphasis/Emphasis.mjs +22 -0
- package/build/emphasis/Emphasis.mjs.map +1 -0
- package/build/emphasis/EmphasisHtmlTransformer.js +39 -0
- package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -0
- package/build/emphasis/EmphasisHtmlTransformer.mjs +37 -0
- package/build/emphasis/EmphasisHtmlTransformer.mjs.map +1 -0
- package/build/field/Field.js +63 -0
- package/build/field/Field.js.map +1 -0
- package/build/field/Field.mjs +57 -0
- package/build/field/Field.mjs.map +1 -0
- package/build/flowNavigation/FlowNavigation.js +80 -0
- package/build/flowNavigation/FlowNavigation.js.map +1 -0
- package/build/flowNavigation/FlowNavigation.messages.js +12 -0
- package/build/flowNavigation/FlowNavigation.messages.js.map +1 -0
- package/build/flowNavigation/FlowNavigation.messages.mjs +10 -0
- package/build/flowNavigation/FlowNavigation.messages.mjs.map +1 -0
- package/build/flowNavigation/FlowNavigation.mjs +74 -0
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -0
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js +34 -0
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -0
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +28 -0
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -0
- package/build/flowNavigation/backButton/BackButton.js +34 -0
- package/build/flowNavigation/backButton/BackButton.js.map +1 -0
- package/build/flowNavigation/backButton/BackButton.mjs +28 -0
- package/build/flowNavigation/backButton/BackButton.mjs.map +1 -0
- package/build/header/Header.js +87 -0
- package/build/header/Header.js.map +1 -0
- package/build/header/Header.mjs +78 -0
- package/build/header/Header.mjs.map +1 -0
- package/build/i18n/cs.json.js +61 -0
- package/build/i18n/cs.json.js.map +1 -0
- package/build/i18n/cs.json.mjs +59 -0
- package/build/i18n/cs.json.mjs.map +1 -0
- package/build/i18n/de.json.js +62 -0
- package/build/i18n/de.json.js.map +1 -0
- package/build/i18n/de.json.mjs +60 -0
- package/build/i18n/de.json.mjs.map +1 -0
- package/build/i18n/en.json.js +62 -0
- package/build/i18n/en.json.js.map +1 -0
- package/build/i18n/en.json.mjs +60 -0
- package/build/i18n/en.json.mjs.map +1 -0
- package/build/i18n/es.json.js +62 -0
- package/build/i18n/es.json.js.map +1 -0
- package/build/i18n/es.json.mjs +60 -0
- package/build/i18n/es.json.mjs.map +1 -0
- package/build/i18n/fr.json.js +62 -0
- package/build/i18n/fr.json.js.map +1 -0
- package/build/i18n/fr.json.mjs +60 -0
- package/build/i18n/fr.json.mjs.map +1 -0
- package/build/i18n/hu.json.js +62 -0
- package/build/i18n/hu.json.js.map +1 -0
- package/build/i18n/hu.json.mjs +60 -0
- package/build/i18n/hu.json.mjs.map +1 -0
- package/build/i18n/id.json.js +62 -0
- package/build/i18n/id.json.js.map +1 -0
- package/build/i18n/id.json.mjs +60 -0
- package/build/i18n/id.json.mjs.map +1 -0
- package/build/i18n/index.js +45 -0
- package/build/i18n/index.js.map +1 -0
- package/build/i18n/index.mjs +43 -0
- package/build/i18n/index.mjs.map +1 -0
- package/build/i18n/it.json.js +62 -0
- package/build/i18n/it.json.js.map +1 -0
- package/build/i18n/it.json.mjs +60 -0
- package/build/i18n/it.json.mjs.map +1 -0
- package/build/i18n/ja.json.js +62 -0
- package/build/i18n/ja.json.js.map +1 -0
- package/build/i18n/ja.json.mjs +60 -0
- package/build/i18n/ja.json.mjs.map +1 -0
- package/build/i18n/pl.json.js +62 -0
- package/build/i18n/pl.json.js.map +1 -0
- package/build/i18n/pl.json.mjs +60 -0
- package/build/i18n/pl.json.mjs.map +1 -0
- package/build/i18n/pt.json.js +62 -0
- package/build/i18n/pt.json.js.map +1 -0
- package/build/i18n/pt.json.mjs +60 -0
- package/build/i18n/pt.json.mjs.map +1 -0
- package/build/i18n/ro.json.js +62 -0
- package/build/i18n/ro.json.js.map +1 -0
- package/build/i18n/ro.json.mjs +60 -0
- package/build/i18n/ro.json.mjs.map +1 -0
- package/build/i18n/ru.json.js +62 -0
- package/build/i18n/ru.json.js.map +1 -0
- package/build/i18n/ru.json.mjs +60 -0
- package/build/i18n/ru.json.mjs.map +1 -0
- package/build/i18n/th.json.js +62 -0
- package/build/i18n/th.json.js.map +1 -0
- package/build/i18n/th.json.mjs +60 -0
- package/build/i18n/th.json.mjs.map +1 -0
- package/build/i18n/tr.json.js +62 -0
- package/build/i18n/tr.json.js.map +1 -0
- package/build/i18n/tr.json.mjs +60 -0
- package/build/i18n/tr.json.mjs.map +1 -0
- package/build/i18n/uk.json.js +61 -0
- package/build/i18n/uk.json.js.map +1 -0
- package/build/i18n/uk.json.mjs +59 -0
- package/build/i18n/uk.json.mjs.map +1 -0
- package/build/i18n/zh-CN.json.js +62 -0
- package/build/i18n/zh-CN.json.js.map +1 -0
- package/build/i18n/zh-CN.json.mjs +60 -0
- package/build/i18n/zh-CN.json.mjs.map +1 -0
- package/build/i18n/zh-HK.json.js +62 -0
- package/build/i18n/zh-HK.json.js.map +1 -0
- package/build/i18n/zh-HK.json.mjs +60 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -0
- package/build/image/Image.js +55 -0
- package/build/image/Image.js.map +1 -0
- package/build/image/Image.mjs +46 -0
- package/build/image/Image.mjs.map +1 -0
- package/build/index.js +278 -14434
- package/build/index.js.map +1 -1
- package/build/index.mjs +118 -14359
- package/build/index.mjs.map +1 -1
- package/build/info/Info.js +80 -0
- package/build/info/Info.js.map +1 -0
- package/build/info/Info.messages.js +12 -0
- package/build/info/Info.messages.js.map +1 -0
- package/build/info/Info.messages.mjs +10 -0
- package/build/info/Info.messages.mjs.map +1 -0
- package/build/info/Info.mjs +74 -0
- package/build/info/Info.mjs.map +1 -0
- package/build/info/infoPresentations.js +9 -0
- package/build/info/infoPresentations.js.map +1 -0
- package/build/info/infoPresentations.mjs +9 -0
- package/build/info/infoPresentations.mjs.map +1 -0
- package/build/inlineAlert/InlineAlert.js +35 -0
- package/build/inlineAlert/InlineAlert.js.map +1 -0
- package/build/inlineAlert/InlineAlert.mjs +29 -0
- package/build/inlineAlert/InlineAlert.mjs.map +1 -0
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.js +15 -0
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.js.map +1 -0
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.mjs +13 -0
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.mjs.map +1 -0
- package/build/inputs/Input.js +39 -0
- package/build/inputs/Input.js.map +1 -0
- package/build/inputs/Input.mjs +33 -0
- package/build/inputs/Input.mjs.map +1 -0
- package/build/inputs/InputGroup.js +116 -0
- package/build/inputs/InputGroup.js.map +1 -0
- package/build/inputs/InputGroup.mjs +109 -0
- package/build/inputs/InputGroup.mjs.map +1 -0
- package/build/inputs/SearchInput.js +38 -0
- package/build/inputs/SearchInput.js.map +1 -0
- package/build/inputs/SearchInput.mjs +36 -0
- package/build/inputs/SearchInput.mjs.map +1 -0
- package/build/inputs/SelectInput.js +585 -0
- package/build/inputs/SelectInput.js.map +1 -0
- package/build/inputs/SelectInput.messages.js +12 -0
- package/build/inputs/SelectInput.messages.js.map +1 -0
- package/build/inputs/SelectInput.messages.mjs +10 -0
- package/build/inputs/SelectInput.messages.mjs.map +1 -0
- package/build/inputs/SelectInput.mjs +576 -0
- package/build/inputs/SelectInput.mjs.map +1 -0
- package/build/inputs/TextArea.js +27 -0
- package/build/inputs/TextArea.js.map +1 -0
- package/build/inputs/TextArea.mjs +21 -0
- package/build/inputs/TextArea.mjs.map +1 -0
- package/build/inputs/_BottomSheet.js +115 -0
- package/build/inputs/_BottomSheet.js.map +1 -0
- package/build/inputs/_BottomSheet.mjs +109 -0
- package/build/inputs/_BottomSheet.mjs.map +1 -0
- package/build/inputs/_ButtonInput.js +37 -0
- package/build/inputs/_ButtonInput.js.map +1 -0
- package/build/inputs/_ButtonInput.mjs +31 -0
- package/build/inputs/_ButtonInput.mjs.map +1 -0
- package/build/inputs/_Popover.js +120 -0
- package/build/inputs/_Popover.js.map +1 -0
- package/build/inputs/_Popover.mjs +114 -0
- package/build/inputs/_Popover.mjs.map +1 -0
- package/build/inputs/_common.js +23 -0
- package/build/inputs/_common.js.map +1 -0
- package/build/inputs/_common.mjs +17 -0
- package/build/inputs/_common.mjs.map +1 -0
- package/build/inputs/contexts.js +42 -0
- package/build/inputs/contexts.js.map +1 -0
- package/build/inputs/contexts.mjs +35 -0
- package/build/inputs/contexts.mjs.map +1 -0
- package/build/instructionsList/InstructionsList.js +66 -0
- package/build/instructionsList/InstructionsList.js.map +1 -0
- package/build/instructionsList/InstructionsList.mjs +60 -0
- package/build/instructionsList/InstructionsList.mjs.map +1 -0
- package/build/label/Label.js +25 -0
- package/build/label/Label.js.map +1 -0
- package/build/label/Label.mjs +19 -0
- package/build/label/Label.mjs.map +1 -0
- package/build/link/Link.js +42 -0
- package/build/link/Link.js.map +1 -0
- package/build/link/Link.messages.js +12 -0
- package/build/link/Link.messages.js.map +1 -0
- package/build/link/Link.messages.mjs +10 -0
- package/build/link/Link.messages.mjs.map +1 -0
- package/build/link/Link.mjs +36 -0
- package/build/link/Link.mjs.map +1 -0
- package/build/listItem/ListItem.js +50 -0
- package/build/listItem/ListItem.js.map +1 -0
- package/build/listItem/ListItem.mjs +44 -0
- package/build/listItem/ListItem.mjs.map +1 -0
- package/build/loader/Loader.js +68 -0
- package/build/loader/Loader.js.map +1 -0
- package/build/loader/Loader.mjs +62 -0
- package/build/loader/Loader.mjs.map +1 -0
- package/build/logo/Logo.js +176 -0
- package/build/logo/Logo.js.map +1 -0
- package/build/logo/Logo.mjs +168 -0
- package/build/logo/Logo.mjs.map +1 -0
- package/build/markdown/Markdown.js +75 -0
- package/build/markdown/Markdown.js.map +1 -0
- package/build/markdown/Markdown.mjs +69 -0
- package/build/markdown/Markdown.mjs.map +1 -0
- package/build/modal/Modal.js +113 -0
- package/build/modal/Modal.js.map +1 -0
- package/build/modal/Modal.mjs +107 -0
- package/build/modal/Modal.mjs.map +1 -0
- package/build/money/Money.js +20 -0
- package/build/money/Money.js.map +1 -0
- package/build/money/Money.mjs +18 -0
- package/build/money/Money.mjs.map +1 -0
- package/build/moneyInput/MoneyInput.js +369 -0
- package/build/moneyInput/MoneyInput.js.map +1 -0
- package/build/moneyInput/MoneyInput.messages.js +12 -0
- package/build/moneyInput/MoneyInput.messages.js.map +1 -0
- package/build/moneyInput/MoneyInput.messages.mjs +10 -0
- package/build/moneyInput/MoneyInput.messages.mjs.map +1 -0
- package/build/moneyInput/MoneyInput.mjs +363 -0
- package/build/moneyInput/MoneyInput.mjs.map +1 -0
- package/build/moneyInput/currencyFormatting.js +70 -0
- package/build/moneyInput/currencyFormatting.js.map +1 -0
- package/build/moneyInput/currencyFormatting.mjs +64 -0
- package/build/moneyInput/currencyFormatting.mjs.map +1 -0
- package/build/navigationOption/NavigationOption.js +48 -0
- package/build/navigationOption/NavigationOption.js.map +1 -0
- package/build/navigationOption/NavigationOption.mjs +42 -0
- package/build/navigationOption/NavigationOption.mjs.map +1 -0
- package/build/navigationOptionsList/NavigationOptionsList.js +19 -0
- package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -0
- package/build/navigationOptionsList/NavigationOptionsList.mjs +17 -0
- package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -0
- package/build/nudge/Nudge.js +121 -0
- package/build/nudge/Nudge.js.map +1 -0
- package/build/nudge/Nudge.mjs +112 -0
- package/build/nudge/Nudge.mjs.map +1 -0
- package/build/overlayHeader/OverlayHeader.js +40 -0
- package/build/overlayHeader/OverlayHeader.js.map +1 -0
- package/build/overlayHeader/OverlayHeader.mjs +34 -0
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.js +161 -0
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.js +12 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.js.map +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs +10 -0
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs.map +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.mjs +159 -0
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -0
- package/build/phoneNumberInput/data/countries.js +1278 -0
- package/build/phoneNumberInput/data/countries.js.map +1 -0
- package/build/phoneNumberInput/data/countries.mjs +1276 -0
- package/build/phoneNumberInput/data/countries.mjs.map +1 -0
- package/build/phoneNumberInput/utils/cleanNumber/cleanNumber.js +7 -0
- package/build/phoneNumberInput/utils/cleanNumber/cleanNumber.js.map +1 -0
- package/build/phoneNumberInput/utils/cleanNumber/cleanNumber.mjs +5 -0
- package/build/phoneNumberInput/utils/cleanNumber/cleanNumber.mjs.map +1 -0
- package/build/phoneNumberInput/utils/excludeCountries/excludeCountries.js +19 -0
- package/build/phoneNumberInput/utils/excludeCountries/excludeCountries.js.map +1 -0
- package/build/phoneNumberInput/utils/excludeCountries/excludeCountries.mjs +17 -0
- package/build/phoneNumberInput/utils/excludeCountries/excludeCountries.mjs.map +1 -0
- package/build/phoneNumberInput/utils/explodeNumberModel/index.js +21 -0
- package/build/phoneNumberInput/utils/explodeNumberModel/index.js.map +1 -0
- package/build/phoneNumberInput/utils/explodeNumberModel/index.mjs +19 -0
- package/build/phoneNumberInput/utils/explodeNumberModel/index.mjs.map +1 -0
- package/build/phoneNumberInput/utils/findCountryByCode/index.js +17 -0
- package/build/phoneNumberInput/utils/findCountryByCode/index.js.map +1 -0
- package/build/phoneNumberInput/utils/findCountryByCode/index.mjs +15 -0
- package/build/phoneNumberInput/utils/findCountryByCode/index.mjs.map +1 -0
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.js +17 -0
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.js.map +1 -0
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.mjs +15 -0
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.mjs.map +1 -0
- package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +12 -0
- package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js.map +1 -0
- package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.mjs +10 -0
- package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.mjs.map +1 -0
- package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +11 -0
- package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js.map +1 -0
- package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs +9 -0
- package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs.map +1 -0
- package/build/phoneNumberInput/utils/longestMatchingPrefix/index.js +6 -0
- package/build/phoneNumberInput/utils/longestMatchingPrefix/index.js.map +1 -0
- package/build/phoneNumberInput/utils/longestMatchingPrefix/index.mjs +4 -0
- package/build/phoneNumberInput/utils/longestMatchingPrefix/index.mjs.map +1 -0
- package/build/phoneNumberInput/utils/setDefaultPrefix/index.js +22 -0
- package/build/phoneNumberInput/utils/setDefaultPrefix/index.js.map +1 -0
- package/build/phoneNumberInput/utils/setDefaultPrefix/index.mjs +20 -0
- package/build/phoneNumberInput/utils/setDefaultPrefix/index.mjs.map +1 -0
- package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +8 -0
- package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js.map +1 -0
- package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.mjs +6 -0
- package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.mjs.map +1 -0
- package/build/popover/Popover.js +79 -0
- package/build/popover/Popover.js.map +1 -0
- package/build/popover/Popover.mjs +73 -0
- package/build/popover/Popover.mjs.map +1 -0
- package/build/processIndicator/ProcessIndicator.js +120 -0
- package/build/processIndicator/ProcessIndicator.js.map +1 -0
- package/build/processIndicator/ProcessIndicator.mjs +114 -0
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -0
- package/build/progress/Progress.js +24 -0
- package/build/progress/Progress.js.map +1 -0
- package/build/progress/Progress.mjs +18 -0
- package/build/progress/Progress.mjs.map +1 -0
- package/build/progressBar/ProgressBar.js +51 -0
- package/build/progressBar/ProgressBar.js.map +1 -0
- package/build/progressBar/ProgressBar.mjs +45 -0
- package/build/progressBar/ProgressBar.mjs.map +1 -0
- package/build/promoCard/PromoCard.js +189 -0
- package/build/promoCard/PromoCard.js.map +1 -0
- package/build/promoCard/PromoCard.mjs +182 -0
- package/build/promoCard/PromoCard.mjs.map +1 -0
- package/build/promoCard/PromoCardContext.js +33 -0
- package/build/promoCard/PromoCardContext.js.map +1 -0
- package/build/promoCard/PromoCardContext.mjs +27 -0
- package/build/promoCard/PromoCardContext.mjs.map +1 -0
- package/build/promoCard/PromoCardGroup.js +80 -0
- package/build/promoCard/PromoCardGroup.js.map +1 -0
- package/build/promoCard/PromoCardGroup.mjs +73 -0
- package/build/promoCard/PromoCardGroup.mjs.map +1 -0
- package/build/promoCard/PromoCardIndicator.js +53 -0
- package/build/promoCard/PromoCardIndicator.js.map +1 -0
- package/build/promoCard/PromoCardIndicator.mjs +47 -0
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -0
- package/build/provider/Provider.js +53 -0
- package/build/provider/Provider.js.map +1 -0
- package/build/provider/Provider.mjs +51 -0
- package/build/provider/Provider.mjs.map +1 -0
- package/build/provider/direction/DirectionProvider.js +20 -0
- package/build/provider/direction/DirectionProvider.js.map +1 -0
- package/build/provider/direction/DirectionProvider.mjs +17 -0
- package/build/provider/direction/DirectionProvider.mjs.map +1 -0
- package/build/provider/language/LanguageProvider.js +20 -0
- package/build/provider/language/LanguageProvider.js.map +1 -0
- package/build/provider/language/LanguageProvider.mjs +17 -0
- package/build/provider/language/LanguageProvider.mjs.map +1 -0
- package/build/radio/Radio.js +63 -0
- package/build/radio/Radio.js.map +1 -0
- package/build/radio/Radio.mjs +57 -0
- package/build/radio/Radio.mjs.map +1 -0
- package/build/radioGroup/RadioGroup.js +40 -0
- package/build/radioGroup/RadioGroup.js.map +1 -0
- package/build/radioGroup/RadioGroup.mjs +38 -0
- package/build/radioGroup/RadioGroup.mjs.map +1 -0
- package/build/radioOption/RadioOption.js +46 -0
- package/build/radioOption/RadioOption.js.map +1 -0
- package/build/radioOption/RadioOption.mjs +44 -0
- package/build/radioOption/RadioOption.mjs.map +1 -0
- package/build/section/Section.js +24 -0
- package/build/section/Section.js.map +1 -0
- package/build/section/Section.mjs +18 -0
- package/build/section/Section.mjs.map +1 -0
- package/build/segmentedControl/SegmentedControl.js +115 -0
- package/build/segmentedControl/SegmentedControl.js.map +1 -0
- package/build/segmentedControl/SegmentedControl.mjs +109 -0
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -0
- package/build/select/Select.js +579 -0
- package/build/select/Select.js.map +1 -0
- package/build/select/Select.messages.js +12 -0
- package/build/select/Select.messages.js.map +1 -0
- package/build/select/Select.messages.mjs +10 -0
- package/build/select/Select.messages.mjs.map +1 -0
- package/build/select/Select.mjs +572 -0
- package/build/select/Select.mjs.map +1 -0
- package/build/select/index.js +8 -0
- package/build/select/index.js.map +1 -0
- package/build/select/index.mjs +6 -0
- package/build/select/index.mjs.map +1 -0
- package/build/select/option/Option.js +58 -0
- package/build/select/option/Option.js.map +1 -0
- package/build/select/option/Option.mjs +52 -0
- package/build/select/option/Option.mjs.map +1 -0
- package/build/select/option/index.js +8 -0
- package/build/select/option/index.js.map +1 -0
- package/build/select/option/index.mjs +6 -0
- package/build/select/option/index.mjs.map +1 -0
- package/build/select/searchBox/SearchBox.js +54 -0
- package/build/select/searchBox/SearchBox.js.map +1 -0
- package/build/select/searchBox/SearchBox.mjs +48 -0
- package/build/select/searchBox/SearchBox.mjs.map +1 -0
- package/build/slidingPanel/SlidingPanel.js +51 -0
- package/build/slidingPanel/SlidingPanel.js.map +1 -0
- package/build/slidingPanel/SlidingPanel.mjs +42 -0
- package/build/slidingPanel/SlidingPanel.mjs.map +1 -0
- package/build/snackbar/Snackbar.js +128 -0
- package/build/snackbar/Snackbar.js.map +1 -0
- package/build/snackbar/Snackbar.mjs +123 -0
- package/build/snackbar/Snackbar.mjs.map +1 -0
- package/build/snackbar/SnackbarContext.js +12 -0
- package/build/snackbar/SnackbarContext.js.map +1 -0
- package/build/snackbar/SnackbarContext.mjs +9 -0
- package/build/snackbar/SnackbarContext.mjs.map +1 -0
- package/build/snackbar/SnackbarProvider.js +48 -0
- package/build/snackbar/SnackbarProvider.js.map +1 -0
- package/build/snackbar/SnackbarProvider.mjs +46 -0
- package/build/snackbar/SnackbarProvider.mjs.map +1 -0
- package/build/snackbar/useSnackbar.js +14 -0
- package/build/snackbar/useSnackbar.js.map +1 -0
- package/build/snackbar/useSnackbar.mjs +12 -0
- package/build/snackbar/useSnackbar.mjs.map +1 -0
- package/build/statusIcon/StatusIcon.js +37 -0
- package/build/statusIcon/StatusIcon.js.map +1 -0
- package/build/statusIcon/StatusIcon.mjs +31 -0
- package/build/statusIcon/StatusIcon.mjs.map +1 -0
- package/build/stepper/Stepper.js +80 -0
- package/build/stepper/Stepper.js.map +1 -0
- package/build/stepper/Stepper.mjs +74 -0
- package/build/stepper/Stepper.mjs.map +1 -0
- package/build/stepper/deviceDetection.js +22 -0
- package/build/stepper/deviceDetection.js.map +1 -0
- package/build/stepper/deviceDetection.mjs +20 -0
- package/build/stepper/deviceDetection.mjs.map +1 -0
- package/build/sticky/Sticky.js +24 -0
- package/build/sticky/Sticky.js.map +1 -0
- package/build/sticky/Sticky.mjs +22 -0
- package/build/sticky/Sticky.mjs.map +1 -0
- package/build/summary/Summary.js +119 -0
- package/build/summary/Summary.js.map +1 -0
- package/build/summary/Summary.messages.js +18 -0
- package/build/summary/Summary.messages.js.map +1 -0
- package/build/summary/Summary.messages.mjs +16 -0
- package/build/summary/Summary.messages.mjs.map +1 -0
- package/build/summary/Summary.mjs +113 -0
- package/build/summary/Summary.mjs.map +1 -0
- package/build/switch/Switch.js +82 -0
- package/build/switch/Switch.js.map +1 -0
- package/build/switch/Switch.mjs +76 -0
- package/build/switch/Switch.mjs.map +1 -0
- package/build/switchOption/SwitchOption.js +59 -0
- package/build/switchOption/SwitchOption.js.map +1 -0
- package/build/switchOption/SwitchOption.mjs +57 -0
- package/build/switchOption/SwitchOption.mjs.map +1 -0
- package/build/tabs/Tab.js +81 -0
- package/build/tabs/Tab.js.map +1 -0
- package/build/tabs/Tab.mjs +74 -0
- package/build/tabs/Tab.mjs.map +1 -0
- package/build/tabs/TabList.js +24 -0
- package/build/tabs/TabList.js.map +1 -0
- package/build/tabs/TabList.mjs +18 -0
- package/build/tabs/TabList.mjs.map +1 -0
- package/build/tabs/TabPanel.js +35 -0
- package/build/tabs/TabPanel.js.map +1 -0
- package/build/tabs/TabPanel.mjs +29 -0
- package/build/tabs/TabPanel.mjs.map +1 -0
- package/build/tabs/Tabs.js +541 -0
- package/build/tabs/Tabs.js.map +1 -0
- package/build/tabs/Tabs.mjs +533 -0
- package/build/tabs/Tabs.mjs.map +1 -0
- package/build/tabs/utils.js +50 -0
- package/build/tabs/utils.js.map +1 -0
- package/build/tabs/utils.mjs +42 -0
- package/build/tabs/utils.mjs.map +1 -0
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +15 -0
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js.map +1 -0
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.mjs +13 -0
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.mjs.map +1 -0
- package/build/tile/Tile.js +58 -0
- package/build/tile/Tile.js.map +1 -0
- package/build/tile/Tile.mjs +52 -0
- package/build/tile/Tile.mjs.map +1 -0
- package/build/title/Title.js +42 -0
- package/build/title/Title.js.map +1 -0
- package/build/title/Title.mjs +36 -0
- package/build/title/Title.mjs.map +1 -0
- package/build/tooltip/Tooltip.js +103 -0
- package/build/tooltip/Tooltip.js.map +1 -0
- package/build/tooltip/Tooltip.mjs +97 -0
- package/build/tooltip/Tooltip.mjs.map +1 -0
- package/build/typeahead/Typeahead.js +468 -0
- package/build/typeahead/Typeahead.js.map +1 -0
- package/build/typeahead/Typeahead.mjs +460 -0
- package/build/typeahead/Typeahead.mjs.map +1 -0
- package/build/typeahead/typeaheadInput/TypeaheadInput.js +120 -0
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -0
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs +114 -0
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -0
- package/build/typeahead/typeaheadOption/TypeaheadOption.js +49 -0
- package/build/typeahead/typeaheadOption/TypeaheadOption.js.map +1 -0
- package/build/typeahead/typeaheadOption/TypeaheadOption.mjs +43 -0
- package/build/typeahead/typeaheadOption/TypeaheadOption.mjs.map +1 -0
- package/build/typeahead/util/highlight.js +21 -0
- package/build/typeahead/util/highlight.js.map +1 -0
- package/build/typeahead/util/highlight.mjs +19 -0
- package/build/typeahead/util/highlight.mjs.map +1 -0
- package/build/upload/Upload.js +366 -0
- package/build/upload/Upload.js.map +1 -0
- package/build/upload/Upload.messages.js +39 -0
- package/build/upload/Upload.messages.js.map +1 -0
- package/build/upload/Upload.messages.mjs +37 -0
- package/build/upload/Upload.messages.mjs.map +1 -0
- package/build/upload/Upload.mjs +356 -0
- package/build/upload/Upload.mjs.map +1 -0
- package/build/upload/steps/completeStep/completeStep.js +65 -0
- package/build/upload/steps/completeStep/completeStep.js.map +1 -0
- package/build/upload/steps/completeStep/completeStep.mjs +63 -0
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -0
- package/build/upload/steps/processingStep/processingStep.js +50 -0
- package/build/upload/steps/processingStep/processingStep.js.map +1 -0
- package/build/upload/steps/processingStep/processingStep.mjs +48 -0
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +88 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +86 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -0
- package/build/upload/utils/asyncFileRead/asyncFileRead.js +17 -0
- package/build/upload/utils/asyncFileRead/asyncFileRead.js.map +1 -0
- package/build/upload/utils/asyncFileRead/asyncFileRead.mjs +15 -0
- package/build/upload/utils/asyncFileRead/asyncFileRead.mjs.map +1 -0
- package/build/upload/utils/getFileType/getFileType.js +18 -0
- package/build/upload/utils/getFileType/getFileType.js.map +1 -0
- package/build/upload/utils/getFileType/getFileType.mjs +16 -0
- package/build/upload/utils/getFileType/getFileType.mjs.map +1 -0
- package/build/upload/utils/isSizeValid/isSizeValid.js +8 -0
- package/build/upload/utils/isSizeValid/isSizeValid.js.map +1 -0
- package/build/upload/utils/isSizeValid/isSizeValid.mjs +6 -0
- package/build/upload/utils/isSizeValid/isSizeValid.mjs.map +1 -0
- package/build/upload/utils/isTypeValid/isTypeValid.js +21 -0
- package/build/upload/utils/isTypeValid/isTypeValid.js.map +1 -0
- package/build/upload/utils/isTypeValid/isTypeValid.mjs +19 -0
- package/build/upload/utils/isTypeValid/isTypeValid.mjs.map +1 -0
- package/build/upload/utils/postData/postData.js +31 -0
- package/build/upload/utils/postData/postData.js.map +1 -0
- package/build/upload/utils/postData/postData.mjs +28 -0
- package/build/upload/utils/postData/postData.mjs.map +1 -0
- package/build/uploadInput/UploadInput.js +259 -0
- package/build/uploadInput/UploadInput.js.map +1 -0
- package/build/uploadInput/UploadInput.messages.js +30 -0
- package/build/uploadInput/UploadInput.messages.js.map +1 -0
- package/build/uploadInput/UploadInput.messages.mjs +28 -0
- package/build/uploadInput/UploadInput.messages.mjs.map +1 -0
- package/build/uploadInput/UploadInput.mjs +253 -0
- package/build/uploadInput/UploadInput.mjs.map +1 -0
- package/build/uploadInput/uploadButton/UploadButton.js +186 -0
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -0
- package/build/uploadInput/uploadButton/UploadButton.messages.js +24 -0
- package/build/uploadInput/uploadButton/UploadButton.messages.js.map +1 -0
- package/build/uploadInput/uploadButton/UploadButton.messages.mjs +22 -0
- package/build/uploadInput/uploadButton/UploadButton.messages.mjs.map +1 -0
- package/build/uploadInput/uploadButton/UploadButton.mjs +178 -0
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -0
- package/build/uploadInput/uploadButton/defaults.js +10 -0
- package/build/uploadInput/uploadButton/defaults.js.map +1 -0
- package/build/uploadInput/uploadButton/defaults.mjs +7 -0
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -0
- package/build/uploadInput/uploadButton/getAllowedFileTypes.js +8 -0
- package/build/uploadInput/uploadButton/getAllowedFileTypes.js.map +1 -0
- package/build/uploadInput/uploadButton/getAllowedFileTypes.mjs +6 -0
- package/build/uploadInput/uploadButton/getAllowedFileTypes.mjs.map +1 -0
- package/build/uploadInput/uploadItem/UploadItem.js +174 -0
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -0
- package/build/uploadInput/uploadItem/UploadItem.messages.js +27 -0
- package/build/uploadInput/uploadItem/UploadItem.messages.js.map +1 -0
- package/build/uploadInput/uploadItem/UploadItem.messages.mjs +25 -0
- package/build/uploadInput/uploadItem/UploadItem.messages.mjs.map +1 -0
- package/build/uploadInput/uploadItem/UploadItem.mjs +166 -0
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -0
- package/build/uploadInput/uploadItem/UploadItemBody.js +27 -0
- package/build/uploadInput/uploadItem/UploadItemBody.js.map +1 -0
- package/build/uploadInput/uploadItem/UploadItemBody.mjs +25 -0
- package/build/uploadInput/uploadItem/UploadItemBody.mjs.map +1 -0
- package/build/utilities/cssValueWithUnit.js +8 -0
- package/build/utilities/cssValueWithUnit.js.map +1 -0
- package/build/utilities/cssValueWithUnit.mjs +6 -0
- package/build/utilities/cssValueWithUnit.mjs.map +1 -0
- package/build/utilities/logActionRequired.js +17 -0
- package/build/utilities/logActionRequired.js.map +1 -0
- package/build/utilities/logActionRequired.mjs +14 -0
- package/build/utilities/logActionRequired.mjs.map +1 -0
- package/build/withDisplayFormat/WithDisplayFormat.js +304 -0
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -0
- package/build/withDisplayFormat/WithDisplayFormat.mjs +282 -0
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -0
- package/build/withNextPortal/withNextPortal.js +20 -0
- package/build/withNextPortal/withNextPortal.js.map +1 -0
- package/build/withNextPortal/withNextPortal.mjs +18 -0
- package/build/withNextPortal/withNextPortal.mjs.map +1 -0
- package/package.json +3 -2
- package/src/common/hooks/useVirtualKeyboard.ts +1 -1
|
@@ -0,0 +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,CAAA;EACRC,MAAM,CAAA;AAENC,EAAAA,WAAYA,CAAAF,QAAkB,EAAEG,OAAgB,EAAA;IAC9C,KAAK,CAACA,OAAO,CAAC,CAAA;IACd,IAAI,CAACC,IAAI,GAAG,eAAe,CAAA;IAC3B,IAAI,CAACJ,QAAQ,GAAGA,QAAQ,CAAA;AACxB,IAAA,IAAI,CAACC,MAAM,GAAGD,QAAQ,CAACC,MAAM,CAAA;AAC/B,GAAA;AACD,CAAA;AASM,eAAeI,QAAQA,CAC5B;EAAEC,GAAG;AAAEC,EAAAA,MAAM,GAAG,MAAM;EAAE,GAAGC,WAAAA;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,WAAAA;AACJ,GAAA,CAAC,CAAA;AAEF,EAAA,IAAI,CAACR,QAAQ,CAACa,EAAE,EAAE;IAChB,MAAM,IAAIf,aAAa,CAACE,QAAQ,EAAEA,QAAQ,CAACc,UAAU,CAAC,CAAA;AACxD,GAAA;AAEA,EAAA,OAAOd,QAAQ,CAAA;AACjB;;;;"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var classNames = require('classnames');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactIntl = require('react-intl');
|
|
6
|
+
var Button = require('../button/Button.js');
|
|
7
|
+
var Modal = require('../modal/Modal.js');
|
|
8
|
+
var isSizeValid = require('../upload/utils/isSizeValid/isSizeValid.js');
|
|
9
|
+
var isTypeValid = require('../upload/utils/isTypeValid/isTypeValid.js');
|
|
10
|
+
var UploadInput_messages = require('./UploadInput.messages.js');
|
|
11
|
+
var UploadButton = require('./uploadButton/UploadButton.js');
|
|
12
|
+
var defaults = require('./uploadButton/defaults.js');
|
|
13
|
+
var UploadItem = require('./uploadItem/UploadItem.js');
|
|
14
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
15
|
+
var status = require('../common/propsValues/status.js');
|
|
16
|
+
var control = require('../common/propsValues/control.js');
|
|
17
|
+
|
|
18
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
|
|
20
|
+
var classNames__default = /*#__PURE__*/_interopDefault(classNames);
|
|
21
|
+
|
|
22
|
+
function generateFileId(file) {
|
|
23
|
+
const {
|
|
24
|
+
name,
|
|
25
|
+
size
|
|
26
|
+
} = file;
|
|
27
|
+
const uploadTimeStamp = new Date().getTime();
|
|
28
|
+
return `${name}_${size}_${uploadTimeStamp}`;
|
|
29
|
+
}
|
|
30
|
+
const UploadInput = ({
|
|
31
|
+
files = [],
|
|
32
|
+
fileInputName = 'file',
|
|
33
|
+
className,
|
|
34
|
+
deleteConfirm,
|
|
35
|
+
disabled,
|
|
36
|
+
multiple = false,
|
|
37
|
+
fileTypes = defaults.imageFileTypes,
|
|
38
|
+
sizeLimit = defaults.DEFAULT_SIZE_LIMIT,
|
|
39
|
+
description,
|
|
40
|
+
onUploadFile,
|
|
41
|
+
onDeleteFile,
|
|
42
|
+
onValidationError,
|
|
43
|
+
onFilesChange,
|
|
44
|
+
onDownload,
|
|
45
|
+
maxFiles,
|
|
46
|
+
maxFilesErrorMessage,
|
|
47
|
+
id,
|
|
48
|
+
sizeLimitErrorMessage,
|
|
49
|
+
uploadButtonTitle
|
|
50
|
+
}) => {
|
|
51
|
+
const [markedFileForDelete, setMarkedFileForDelete] = React.useState(null);
|
|
52
|
+
const [mounted, setMounted] = React.useState(false);
|
|
53
|
+
const {
|
|
54
|
+
formatMessage
|
|
55
|
+
} = reactIntl.useIntl();
|
|
56
|
+
const PROGRESS_STATUSES = new Set([status.Status.PENDING, status.Status.PROCESSING]);
|
|
57
|
+
const [uploadedFiles, setUploadedFiles] = React.useState(multiple || files.length === 0 ? files : [files[0]]);
|
|
58
|
+
const uploadedFilesListReference = React.useRef(multiple || files.length === 0 ? files : [files[0]]);
|
|
59
|
+
function addFileToList(recentUploadedFile) {
|
|
60
|
+
function addToList(listToAddTo) {
|
|
61
|
+
return [...listToAddTo, recentUploadedFile];
|
|
62
|
+
}
|
|
63
|
+
setUploadedFiles(addToList);
|
|
64
|
+
uploadedFilesListReference.current = addToList(uploadedFilesListReference.current);
|
|
65
|
+
}
|
|
66
|
+
const removeFileFromList = file => {
|
|
67
|
+
function filterOutFrom(listToFilterFrom) {
|
|
68
|
+
return listToFilterFrom.filter(fileInList => file !== fileInList && file.id !== fileInList.id);
|
|
69
|
+
}
|
|
70
|
+
setUploadedFiles(filterOutFrom);
|
|
71
|
+
uploadedFilesListReference.current = filterOutFrom(uploadedFilesListReference.current);
|
|
72
|
+
};
|
|
73
|
+
const modifyFileInList = (file, updates) => {
|
|
74
|
+
const updateListItem = listToUpdate => listToUpdate.map(fileInList => {
|
|
75
|
+
return fileInList === file || fileInList.id === file.id ? {
|
|
76
|
+
...file,
|
|
77
|
+
...updates
|
|
78
|
+
} : fileInList;
|
|
79
|
+
});
|
|
80
|
+
setUploadedFiles(updateListItem);
|
|
81
|
+
uploadedFilesListReference.current = updateListItem(uploadedFilesListReference.current);
|
|
82
|
+
};
|
|
83
|
+
const removeFile = file => {
|
|
84
|
+
const {
|
|
85
|
+
id,
|
|
86
|
+
status: status$1
|
|
87
|
+
} = file;
|
|
88
|
+
if (status$1 === status.Status.FAILED) {
|
|
89
|
+
// If removing a failed upload, we're just updating the view
|
|
90
|
+
removeFileFromList(file);
|
|
91
|
+
} else if (onDeleteFile && id) {
|
|
92
|
+
// Set status to PROCESSING
|
|
93
|
+
modifyFileInList(file, {
|
|
94
|
+
status: status.Status.PROCESSING,
|
|
95
|
+
error: undefined
|
|
96
|
+
});
|
|
97
|
+
// Notify host app about deletion
|
|
98
|
+
onDeleteFile(id).then(() => removeFileFromList(file)).catch(error => {
|
|
99
|
+
modifyFileInList(file, {
|
|
100
|
+
error: error
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
function handleFileUploadFailure(file, failureMessage) {
|
|
106
|
+
const {
|
|
107
|
+
name
|
|
108
|
+
} = file;
|
|
109
|
+
const id = generateFileId(file);
|
|
110
|
+
const failedUpload = {
|
|
111
|
+
id,
|
|
112
|
+
filename: name,
|
|
113
|
+
status: status.Status.FAILED,
|
|
114
|
+
error: failureMessage
|
|
115
|
+
};
|
|
116
|
+
addFileToList(failedUpload);
|
|
117
|
+
if (onValidationError) {
|
|
118
|
+
onValidationError(failedUpload);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function getNumberOfFilesUploaded() {
|
|
122
|
+
const uploadInitiatedStatus = new Set([status.Status.SUCCEEDED, status.Status.PENDING]);
|
|
123
|
+
const validFiles = uploadedFilesListReference.current.filter(file => file.status && uploadInitiatedStatus.has(file.status));
|
|
124
|
+
return validFiles.length;
|
|
125
|
+
}
|
|
126
|
+
function areMaximumFilesUploadedAlready() {
|
|
127
|
+
if (!maxFiles) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
const numberOfValidFiles = getNumberOfFilesUploaded();
|
|
131
|
+
return numberOfValidFiles >= maxFiles;
|
|
132
|
+
}
|
|
133
|
+
// One or more files selected, create entries for them
|
|
134
|
+
const addFiles = selectedFiles => {
|
|
135
|
+
for (let i = 0; i < selectedFiles.length; i += 1) {
|
|
136
|
+
const file = selectedFiles.item(i);
|
|
137
|
+
// Returning a FormData[] array instead of FileList so we can filter out incorrect files
|
|
138
|
+
const formData = new FormData();
|
|
139
|
+
if (file) {
|
|
140
|
+
const {
|
|
141
|
+
name
|
|
142
|
+
} = file;
|
|
143
|
+
const id = generateFileId(file);
|
|
144
|
+
const allowedFileTypes = typeof fileTypes === 'string' ? fileTypes : fileTypes.join(',');
|
|
145
|
+
// Check if file type is valid
|
|
146
|
+
if (!isTypeValid.isTypeValid(file, allowedFileTypes)) {
|
|
147
|
+
handleFileUploadFailure(file, formatMessage(UploadInput_messages.fileTypeNotSupported));
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
// Check if the filesize is valid
|
|
151
|
+
// Convert to rough bytes
|
|
152
|
+
if (!isSizeValid.isSizeValid(file, sizeLimit * 1000)) {
|
|
153
|
+
const failureMessage = sizeLimitErrorMessage || formatMessage(UploadInput_messages.fileIsTooLarge);
|
|
154
|
+
handleFileUploadFailure(file, failureMessage);
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (areMaximumFilesUploadedAlready()) {
|
|
158
|
+
const failureMessage = maxFilesErrorMessage || formatMessage(UploadInput_messages.maximumFilesAlreadyUploaded, {
|
|
159
|
+
maxFilesAllowed: maxFiles
|
|
160
|
+
});
|
|
161
|
+
handleFileUploadFailure(file, failureMessage);
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
formData.append(fileInputName, file);
|
|
165
|
+
const pendingFile = {
|
|
166
|
+
id,
|
|
167
|
+
filename: name,
|
|
168
|
+
status: status.Status.PENDING
|
|
169
|
+
};
|
|
170
|
+
addFileToList(pendingFile);
|
|
171
|
+
// Start uploading the file
|
|
172
|
+
onUploadFile(formData).then(({
|
|
173
|
+
id,
|
|
174
|
+
url,
|
|
175
|
+
error
|
|
176
|
+
}) => {
|
|
177
|
+
// Replace the temporary id with the final one received from the API, and also set any errors
|
|
178
|
+
modifyFileInList(pendingFile, {
|
|
179
|
+
id,
|
|
180
|
+
url,
|
|
181
|
+
error,
|
|
182
|
+
status: status.Status.SUCCEEDED
|
|
183
|
+
});
|
|
184
|
+
}).catch(error => {
|
|
185
|
+
modifyFileInList(pendingFile, {
|
|
186
|
+
error: error,
|
|
187
|
+
status: status.Status.FAILED
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
if (!multiple) {
|
|
191
|
+
// Only upload a single file
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
React.useEffect(() => {
|
|
198
|
+
setMounted(true);
|
|
199
|
+
}, []);
|
|
200
|
+
React.useEffect(() => {
|
|
201
|
+
if (onFilesChange && mounted) {
|
|
202
|
+
onFilesChange([...uploadedFiles]);
|
|
203
|
+
}
|
|
204
|
+
}, [onFilesChange, uploadedFiles]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
205
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
206
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
207
|
+
className: classNames__default.default('np-upload-input', className, {
|
|
208
|
+
disabled
|
|
209
|
+
}),
|
|
210
|
+
children: [uploadedFiles.map(file => /*#__PURE__*/jsxRuntime.jsx(UploadItem.default, {
|
|
211
|
+
file: file,
|
|
212
|
+
singleFileUpload: !multiple,
|
|
213
|
+
canDelete: (!!onDeleteFile || file.status === status.Status.FAILED) && (!file.status || !PROGRESS_STATUSES.has(file.status)),
|
|
214
|
+
onDelete: file.status === status.Status.FAILED ? () => removeFile(file) : () => setMarkedFileForDelete(file),
|
|
215
|
+
onDownload: onDownload
|
|
216
|
+
}, file.id)), (multiple || !multiple && !uploadedFiles.length) && /*#__PURE__*/jsxRuntime.jsx(UploadButton.default, {
|
|
217
|
+
id: id,
|
|
218
|
+
uploadButtonTitle: uploadButtonTitle,
|
|
219
|
+
disabled: areMaximumFilesUploadedAlready() || disabled,
|
|
220
|
+
multiple: multiple,
|
|
221
|
+
fileTypes: fileTypes,
|
|
222
|
+
sizeLimit: sizeLimit,
|
|
223
|
+
description: description,
|
|
224
|
+
maxFiles: maxFiles,
|
|
225
|
+
onChange: addFiles
|
|
226
|
+
})]
|
|
227
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Modal, {
|
|
228
|
+
title: deleteConfirm?.title !== undefined ? deleteConfirm.title : formatMessage(UploadInput_messages.deleteModalTitle),
|
|
229
|
+
body: deleteConfirm?.body !== undefined ? deleteConfirm.body : formatMessage(UploadInput_messages.deleteModalBody),
|
|
230
|
+
open: !!markedFileForDelete,
|
|
231
|
+
footer: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
232
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
233
|
+
block: true,
|
|
234
|
+
onClick: () => {
|
|
235
|
+
setMarkedFileForDelete(null);
|
|
236
|
+
},
|
|
237
|
+
children: deleteConfirm?.cancelText || formatMessage(UploadInput_messages.deleteModalCancelButtonText)
|
|
238
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
239
|
+
block: true,
|
|
240
|
+
priority: control.Priority.SECONDARY,
|
|
241
|
+
type: control.ControlType.NEGATIVE,
|
|
242
|
+
onClick: () => {
|
|
243
|
+
if (markedFileForDelete) {
|
|
244
|
+
removeFile(markedFileForDelete);
|
|
245
|
+
}
|
|
246
|
+
setMarkedFileForDelete(null);
|
|
247
|
+
},
|
|
248
|
+
children: deleteConfirm?.confirmText || formatMessage(UploadInput_messages.deleteModalConfirmButtonText)
|
|
249
|
+
})]
|
|
250
|
+
}),
|
|
251
|
+
onClose: () => {
|
|
252
|
+
setMarkedFileForDelete(null);
|
|
253
|
+
}
|
|
254
|
+
})]
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
module.exports = UploadInput;
|
|
259
|
+
//# sourceMappingURL=UploadInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UploadInput.js","sources":["../../src/uploadInput/UploadInput.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { useEffect, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Button from '../button';\nimport { CommonProps, ControlType, Priority, Status } from '../common';\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> &\n Pick<UploadItemProps, 'onDownload'> &\n CommonProps;\n\nfunction generateFileId(file: File) {\n const { name, size } = file;\n const uploadTimeStamp = new Date().getTime();\n return `${name}_${size}_${uploadTimeStamp}`;\n}\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 [markedFileForDelete, setMarkedFileForDelete] = useState<UploadedFile | null>(null);\n const [mounted, setMounted] = useState(false);\n const { formatMessage } = useIntl();\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 addFileToList(recentUploadedFile: UploadedFile) {\n function addToList(listToAddTo: readonly UploadedFile[]) {\n return [...listToAddTo, recentUploadedFile];\n }\n\n setUploadedFiles(addToList);\n uploadedFilesListReference.current = addToList(uploadedFilesListReference.current);\n }\n\n const removeFileFromList = (file: UploadedFile) => {\n function filterOutFrom(listToFilterFrom: readonly UploadedFile[]) {\n return listToFilterFrom.filter(\n (fileInList) => file !== fileInList && file.id !== fileInList.id,\n );\n }\n\n setUploadedFiles(filterOutFrom);\n uploadedFilesListReference.current = filterOutFrom(uploadedFilesListReference.current);\n };\n\n const modifyFileInList = (file: UploadedFile, updates: Partial<UploadedFile>) => {\n const updateListItem = (listToUpdate: readonly UploadedFile[]) =>\n listToUpdate.map((fileInList) => {\n return fileInList === file || fileInList.id === file.id\n ? { ...file, ...updates }\n : fileInList;\n });\n\n setUploadedFiles(updateListItem);\n uploadedFilesListReference.current = updateListItem(uploadedFilesListReference.current);\n };\n\n const removeFile = (file: UploadedFile) => {\n const { id, status } = file;\n\n if (status === Status.FAILED) {\n // If removing a failed upload, we're just updating the view\n removeFileFromList(file);\n } else if (onDeleteFile && id) {\n // Set status to PROCESSING\n modifyFileInList(file, { status: Status.PROCESSING, error: undefined });\n\n // Notify host app about deletion\n onDeleteFile(id)\n .then(() => removeFileFromList(file))\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 const id = generateFileId(file);\n const failedUpload = {\n id,\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 // One or more files selected, create entries for them\n const addFiles = (selectedFiles: FileList) => {\n for (let i = 0; i < selectedFiles.length; i += 1) {\n const file = selectedFiles.item(i);\n\n // Returning a FormData[] array instead of FileList so we can filter out incorrect files\n const formData = new FormData();\n\n if (file) {\n const { name } = file;\n const id = generateFileId(file);\n\n const allowedFileTypes = typeof fileTypes === 'string' ? fileTypes : fileTypes.join(',');\n\n // Check if file type is valid\n if (!isTypeValid(file, allowedFileTypes)) {\n handleFileUploadFailure(file, formatMessage(MESSAGES.fileTypeNotSupported));\n continue;\n }\n\n // Check if the filesize is valid\n // Convert to rough bytes\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 formData.append(fileInputName, file);\n const pendingFile = {\n id,\n filename: name,\n status: Status.PENDING,\n };\n\n addFileToList(pendingFile);\n\n // Start uploading the file\n onUploadFile(formData)\n .then(({ id, url, error }: UploadResponse) => {\n // Replace the temporary id with the final one received from the API, and also set any errors\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 // Only upload a single file\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 return (\n <>\n <div className={classNames('np-upload-input', className, { disabled })}>\n {uploadedFiles.map((file) => (\n <UploadItem\n key={file.id}\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 ? () => removeFile(file)\n : () => setMarkedFileForDelete(file)\n }\n onDownload={onDownload}\n />\n ))}\n {(multiple || (!multiple && !uploadedFiles.length)) && (\n <UploadButton\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 onChange={addFiles}\n />\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 onClick={() => {\n if (markedFileForDelete) {\n removeFile(markedFileForDelete);\n }\n setMarkedFileForDelete(null);\n }}\n >\n {deleteConfirm?.confirmText || formatMessage(MESSAGES.deleteModalConfirmButtonText)}\n </Button>\n </>\n }\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","markedFileForDelete","setMarkedFileForDelete","useState","mounted","setMounted","formatMessage","useIntl","PROGRESS_STATUSES","Set","Status","PENDING","PROCESSING","uploadedFiles","setUploadedFiles","length","uploadedFilesListReference","useRef","addFileToList","recentUploadedFile","addToList","listToAddTo","current","removeFileFromList","filterOutFrom","listToFilterFrom","filter","fileInList","modifyFileInList","updates","updateListItem","listToUpdate","map","removeFile","status","FAILED","error","undefined","then","catch","handleFileUploadFailure","failureMessage","failedUpload","filename","getNumberOfFilesUploaded","uploadInitiatedStatus","SUCCEEDED","validFiles","has","areMaximumFilesUploadedAlready","numberOfValidFiles","addFiles","selectedFiles","i","item","formData","FormData","allowedFileTypes","join","isTypeValid","MESSAGES","fileTypeNotSupported","isSizeValid","fileIsTooLarge","maximumFilesAlreadyUploaded","maxFilesAllowed","append","pendingFile","url","useEffect","_jsxs","_Fragment","children","classNames","_jsx","UploadItem","singleFileUpload","canDelete","onDelete","UploadButton","onChange","Modal","title","deleteModalTitle","body","deleteModalBody","open","footer","Button","block","onClick","cancelText","deleteModalCancelButtonText","priority","Priority","SECONDARY","type","ControlType","NEGATIVE","confirmText","deleteModalConfirmButtonText","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsGA,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,UAAUJ,IAAI,CAAA,CAAA,EAAIC,IAAQ,CAAA,CAAA,EAAAC,gBAAiB,CAAA,CAAA;AAC7C,CAAA;AAEMG,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,i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,sBAAsB,CAAC,IAAI,CAAC,CAAA;AAC9B,OAAA;AAAE,KAEN,CAAA,CAAA;AAAA,GAAA,CAAG,CAAA;AAEP;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactIntl = require('react-intl');
|
|
4
|
+
|
|
5
|
+
var MESSAGES = reactIntl.defineMessages({
|
|
6
|
+
fileIsTooLarge: {
|
|
7
|
+
id: "neptune.UploadInput.fileIsTooLarge"
|
|
8
|
+
},
|
|
9
|
+
fileTypeNotSupported: {
|
|
10
|
+
id: "neptune.UploadInput.fileTypeNotSupported"
|
|
11
|
+
},
|
|
12
|
+
deleteModalTitle: {
|
|
13
|
+
id: "neptune.UploadInput.deleteModalTitle"
|
|
14
|
+
},
|
|
15
|
+
deleteModalBody: {
|
|
16
|
+
id: "neptune.UploadInput.deleteModalBody"
|
|
17
|
+
},
|
|
18
|
+
deleteModalCancelButtonText: {
|
|
19
|
+
id: "neptune.UploadInput.deleteModalCancelButtonText"
|
|
20
|
+
},
|
|
21
|
+
deleteModalConfirmButtonText: {
|
|
22
|
+
id: "neptune.UploadInput.deleteModalConfirmButtonText"
|
|
23
|
+
},
|
|
24
|
+
maximumFilesAlreadyUploaded: {
|
|
25
|
+
id: "neptune.UploadInput.maximumFilesAlreadyUploaded"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
module.exports = MESSAGES;
|
|
30
|
+
//# sourceMappingURL=UploadInput.messages.js.map
|
|
@@ -0,0 +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,oCAAA;GAGH;AACDC,EAAAA,oBAAoB,EAAE;IACpBD,EAAE,EAAA,0CAAA;GAGH;AACDE,EAAAA,gBAAgB,EAAE;IAChBF,EAAE,EAAA,sCAAA;GAGH;AACDG,EAAAA,eAAe,EAAE;IACfH,EAAE,EAAA,qCAAA;GAGH;AACDI,EAAAA,2BAA2B,EAAE;IAC3BJ,EAAE,EAAA,iDAAA;GAGH;AACDK,EAAAA,4BAA4B,EAAE;IAC5BL,EAAE,EAAA,kDAAA;GAGH;AACDM,EAAAA,2BAA2B,EAAE;IAC3BN,EAAE,EAAA,iDAAA;AAKH,GAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
var MESSAGES = defineMessages({
|
|
4
|
+
fileIsTooLarge: {
|
|
5
|
+
id: "neptune.UploadInput.fileIsTooLarge"
|
|
6
|
+
},
|
|
7
|
+
fileTypeNotSupported: {
|
|
8
|
+
id: "neptune.UploadInput.fileTypeNotSupported"
|
|
9
|
+
},
|
|
10
|
+
deleteModalTitle: {
|
|
11
|
+
id: "neptune.UploadInput.deleteModalTitle"
|
|
12
|
+
},
|
|
13
|
+
deleteModalBody: {
|
|
14
|
+
id: "neptune.UploadInput.deleteModalBody"
|
|
15
|
+
},
|
|
16
|
+
deleteModalCancelButtonText: {
|
|
17
|
+
id: "neptune.UploadInput.deleteModalCancelButtonText"
|
|
18
|
+
},
|
|
19
|
+
deleteModalConfirmButtonText: {
|
|
20
|
+
id: "neptune.UploadInput.deleteModalConfirmButtonText"
|
|
21
|
+
},
|
|
22
|
+
maximumFilesAlreadyUploaded: {
|
|
23
|
+
id: "neptune.UploadInput.maximumFilesAlreadyUploaded"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export { MESSAGES as default };
|
|
28
|
+
//# sourceMappingURL=UploadInput.messages.mjs.map
|
|
@@ -0,0 +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,oCAAA;GAGH;AACDC,EAAAA,oBAAoB,EAAE;IACpBD,EAAE,EAAA,0CAAA;GAGH;AACDE,EAAAA,gBAAgB,EAAE;IAChBF,EAAE,EAAA,sCAAA;GAGH;AACDG,EAAAA,eAAe,EAAE;IACfH,EAAE,EAAA,qCAAA;GAGH;AACDI,EAAAA,2BAA2B,EAAE;IAC3BJ,EAAE,EAAA,iDAAA;GAGH;AACDK,EAAAA,4BAA4B,EAAE;IAC5BL,EAAE,EAAA,kDAAA;GAGH;AACDM,EAAAA,2BAA2B,EAAE;IAC3BN,EAAE,EAAA,iDAAA;AAKH,GAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import Button from '../button/Button.mjs';
|
|
5
|
+
import Modal from '../modal/Modal.mjs';
|
|
6
|
+
import { isSizeValid } from '../upload/utils/isSizeValid/isSizeValid.mjs';
|
|
7
|
+
import { isTypeValid } from '../upload/utils/isTypeValid/isTypeValid.mjs';
|
|
8
|
+
import MESSAGES from './UploadInput.messages.mjs';
|
|
9
|
+
import UploadButton from './uploadButton/UploadButton.mjs';
|
|
10
|
+
import { imageFileTypes, DEFAULT_SIZE_LIMIT } from './uploadButton/defaults.mjs';
|
|
11
|
+
import UploadItem from './uploadItem/UploadItem.mjs';
|
|
12
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
13
|
+
import { Status } from '../common/propsValues/status.mjs';
|
|
14
|
+
import { Priority, ControlType } from '../common/propsValues/control.mjs';
|
|
15
|
+
|
|
16
|
+
function generateFileId(file) {
|
|
17
|
+
const {
|
|
18
|
+
name,
|
|
19
|
+
size
|
|
20
|
+
} = file;
|
|
21
|
+
const uploadTimeStamp = new Date().getTime();
|
|
22
|
+
return `${name}_${size}_${uploadTimeStamp}`;
|
|
23
|
+
}
|
|
24
|
+
const UploadInput = ({
|
|
25
|
+
files = [],
|
|
26
|
+
fileInputName = 'file',
|
|
27
|
+
className,
|
|
28
|
+
deleteConfirm,
|
|
29
|
+
disabled,
|
|
30
|
+
multiple = false,
|
|
31
|
+
fileTypes = imageFileTypes,
|
|
32
|
+
sizeLimit = DEFAULT_SIZE_LIMIT,
|
|
33
|
+
description,
|
|
34
|
+
onUploadFile,
|
|
35
|
+
onDeleteFile,
|
|
36
|
+
onValidationError,
|
|
37
|
+
onFilesChange,
|
|
38
|
+
onDownload,
|
|
39
|
+
maxFiles,
|
|
40
|
+
maxFilesErrorMessage,
|
|
41
|
+
id,
|
|
42
|
+
sizeLimitErrorMessage,
|
|
43
|
+
uploadButtonTitle
|
|
44
|
+
}) => {
|
|
45
|
+
const [markedFileForDelete, setMarkedFileForDelete] = useState(null);
|
|
46
|
+
const [mounted, setMounted] = useState(false);
|
|
47
|
+
const {
|
|
48
|
+
formatMessage
|
|
49
|
+
} = useIntl();
|
|
50
|
+
const PROGRESS_STATUSES = new Set([Status.PENDING, Status.PROCESSING]);
|
|
51
|
+
const [uploadedFiles, setUploadedFiles] = useState(multiple || files.length === 0 ? files : [files[0]]);
|
|
52
|
+
const uploadedFilesListReference = useRef(multiple || files.length === 0 ? files : [files[0]]);
|
|
53
|
+
function addFileToList(recentUploadedFile) {
|
|
54
|
+
function addToList(listToAddTo) {
|
|
55
|
+
return [...listToAddTo, recentUploadedFile];
|
|
56
|
+
}
|
|
57
|
+
setUploadedFiles(addToList);
|
|
58
|
+
uploadedFilesListReference.current = addToList(uploadedFilesListReference.current);
|
|
59
|
+
}
|
|
60
|
+
const removeFileFromList = file => {
|
|
61
|
+
function filterOutFrom(listToFilterFrom) {
|
|
62
|
+
return listToFilterFrom.filter(fileInList => file !== fileInList && file.id !== fileInList.id);
|
|
63
|
+
}
|
|
64
|
+
setUploadedFiles(filterOutFrom);
|
|
65
|
+
uploadedFilesListReference.current = filterOutFrom(uploadedFilesListReference.current);
|
|
66
|
+
};
|
|
67
|
+
const modifyFileInList = (file, updates) => {
|
|
68
|
+
const updateListItem = listToUpdate => listToUpdate.map(fileInList => {
|
|
69
|
+
return fileInList === file || fileInList.id === file.id ? {
|
|
70
|
+
...file,
|
|
71
|
+
...updates
|
|
72
|
+
} : fileInList;
|
|
73
|
+
});
|
|
74
|
+
setUploadedFiles(updateListItem);
|
|
75
|
+
uploadedFilesListReference.current = updateListItem(uploadedFilesListReference.current);
|
|
76
|
+
};
|
|
77
|
+
const removeFile = file => {
|
|
78
|
+
const {
|
|
79
|
+
id,
|
|
80
|
+
status
|
|
81
|
+
} = file;
|
|
82
|
+
if (status === Status.FAILED) {
|
|
83
|
+
// If removing a failed upload, we're just updating the view
|
|
84
|
+
removeFileFromList(file);
|
|
85
|
+
} else if (onDeleteFile && id) {
|
|
86
|
+
// Set status to PROCESSING
|
|
87
|
+
modifyFileInList(file, {
|
|
88
|
+
status: Status.PROCESSING,
|
|
89
|
+
error: undefined
|
|
90
|
+
});
|
|
91
|
+
// Notify host app about deletion
|
|
92
|
+
onDeleteFile(id).then(() => removeFileFromList(file)).catch(error => {
|
|
93
|
+
modifyFileInList(file, {
|
|
94
|
+
error: error
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
function handleFileUploadFailure(file, failureMessage) {
|
|
100
|
+
const {
|
|
101
|
+
name
|
|
102
|
+
} = file;
|
|
103
|
+
const id = generateFileId(file);
|
|
104
|
+
const failedUpload = {
|
|
105
|
+
id,
|
|
106
|
+
filename: name,
|
|
107
|
+
status: Status.FAILED,
|
|
108
|
+
error: failureMessage
|
|
109
|
+
};
|
|
110
|
+
addFileToList(failedUpload);
|
|
111
|
+
if (onValidationError) {
|
|
112
|
+
onValidationError(failedUpload);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function getNumberOfFilesUploaded() {
|
|
116
|
+
const uploadInitiatedStatus = new Set([Status.SUCCEEDED, Status.PENDING]);
|
|
117
|
+
const validFiles = uploadedFilesListReference.current.filter(file => file.status && uploadInitiatedStatus.has(file.status));
|
|
118
|
+
return validFiles.length;
|
|
119
|
+
}
|
|
120
|
+
function areMaximumFilesUploadedAlready() {
|
|
121
|
+
if (!maxFiles) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
const numberOfValidFiles = getNumberOfFilesUploaded();
|
|
125
|
+
return numberOfValidFiles >= maxFiles;
|
|
126
|
+
}
|
|
127
|
+
// One or more files selected, create entries for them
|
|
128
|
+
const addFiles = selectedFiles => {
|
|
129
|
+
for (let i = 0; i < selectedFiles.length; i += 1) {
|
|
130
|
+
const file = selectedFiles.item(i);
|
|
131
|
+
// Returning a FormData[] array instead of FileList so we can filter out incorrect files
|
|
132
|
+
const formData = new FormData();
|
|
133
|
+
if (file) {
|
|
134
|
+
const {
|
|
135
|
+
name
|
|
136
|
+
} = file;
|
|
137
|
+
const id = generateFileId(file);
|
|
138
|
+
const allowedFileTypes = typeof fileTypes === 'string' ? fileTypes : fileTypes.join(',');
|
|
139
|
+
// Check if file type is valid
|
|
140
|
+
if (!isTypeValid(file, allowedFileTypes)) {
|
|
141
|
+
handleFileUploadFailure(file, formatMessage(MESSAGES.fileTypeNotSupported));
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
// Check if the filesize is valid
|
|
145
|
+
// Convert to rough bytes
|
|
146
|
+
if (!isSizeValid(file, sizeLimit * 1000)) {
|
|
147
|
+
const failureMessage = sizeLimitErrorMessage || formatMessage(MESSAGES.fileIsTooLarge);
|
|
148
|
+
handleFileUploadFailure(file, failureMessage);
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (areMaximumFilesUploadedAlready()) {
|
|
152
|
+
const failureMessage = maxFilesErrorMessage || formatMessage(MESSAGES.maximumFilesAlreadyUploaded, {
|
|
153
|
+
maxFilesAllowed: maxFiles
|
|
154
|
+
});
|
|
155
|
+
handleFileUploadFailure(file, failureMessage);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
formData.append(fileInputName, file);
|
|
159
|
+
const pendingFile = {
|
|
160
|
+
id,
|
|
161
|
+
filename: name,
|
|
162
|
+
status: Status.PENDING
|
|
163
|
+
};
|
|
164
|
+
addFileToList(pendingFile);
|
|
165
|
+
// Start uploading the file
|
|
166
|
+
onUploadFile(formData).then(({
|
|
167
|
+
id,
|
|
168
|
+
url,
|
|
169
|
+
error
|
|
170
|
+
}) => {
|
|
171
|
+
// Replace the temporary id with the final one received from the API, and also set any errors
|
|
172
|
+
modifyFileInList(pendingFile, {
|
|
173
|
+
id,
|
|
174
|
+
url,
|
|
175
|
+
error,
|
|
176
|
+
status: Status.SUCCEEDED
|
|
177
|
+
});
|
|
178
|
+
}).catch(error => {
|
|
179
|
+
modifyFileInList(pendingFile, {
|
|
180
|
+
error: error,
|
|
181
|
+
status: Status.FAILED
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
if (!multiple) {
|
|
185
|
+
// Only upload a single file
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
useEffect(() => {
|
|
192
|
+
setMounted(true);
|
|
193
|
+
}, []);
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
if (onFilesChange && mounted) {
|
|
196
|
+
onFilesChange([...uploadedFiles]);
|
|
197
|
+
}
|
|
198
|
+
}, [onFilesChange, uploadedFiles]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
199
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
200
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
201
|
+
className: classNames('np-upload-input', className, {
|
|
202
|
+
disabled
|
|
203
|
+
}),
|
|
204
|
+
children: [uploadedFiles.map(file => /*#__PURE__*/jsx(UploadItem, {
|
|
205
|
+
file: file,
|
|
206
|
+
singleFileUpload: !multiple,
|
|
207
|
+
canDelete: (!!onDeleteFile || file.status === Status.FAILED) && (!file.status || !PROGRESS_STATUSES.has(file.status)),
|
|
208
|
+
onDelete: file.status === Status.FAILED ? () => removeFile(file) : () => setMarkedFileForDelete(file),
|
|
209
|
+
onDownload: onDownload
|
|
210
|
+
}, file.id)), (multiple || !multiple && !uploadedFiles.length) && /*#__PURE__*/jsx(UploadButton, {
|
|
211
|
+
id: id,
|
|
212
|
+
uploadButtonTitle: uploadButtonTitle,
|
|
213
|
+
disabled: areMaximumFilesUploadedAlready() || disabled,
|
|
214
|
+
multiple: multiple,
|
|
215
|
+
fileTypes: fileTypes,
|
|
216
|
+
sizeLimit: sizeLimit,
|
|
217
|
+
description: description,
|
|
218
|
+
maxFiles: maxFiles,
|
|
219
|
+
onChange: addFiles
|
|
220
|
+
})]
|
|
221
|
+
}), /*#__PURE__*/jsx(Modal, {
|
|
222
|
+
title: deleteConfirm?.title !== undefined ? deleteConfirm.title : formatMessage(MESSAGES.deleteModalTitle),
|
|
223
|
+
body: deleteConfirm?.body !== undefined ? deleteConfirm.body : formatMessage(MESSAGES.deleteModalBody),
|
|
224
|
+
open: !!markedFileForDelete,
|
|
225
|
+
footer: /*#__PURE__*/jsxs(Fragment, {
|
|
226
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
227
|
+
block: true,
|
|
228
|
+
onClick: () => {
|
|
229
|
+
setMarkedFileForDelete(null);
|
|
230
|
+
},
|
|
231
|
+
children: deleteConfirm?.cancelText || formatMessage(MESSAGES.deleteModalCancelButtonText)
|
|
232
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
233
|
+
block: true,
|
|
234
|
+
priority: Priority.SECONDARY,
|
|
235
|
+
type: ControlType.NEGATIVE,
|
|
236
|
+
onClick: () => {
|
|
237
|
+
if (markedFileForDelete) {
|
|
238
|
+
removeFile(markedFileForDelete);
|
|
239
|
+
}
|
|
240
|
+
setMarkedFileForDelete(null);
|
|
241
|
+
},
|
|
242
|
+
children: deleteConfirm?.confirmText || formatMessage(MESSAGES.deleteModalConfirmButtonText)
|
|
243
|
+
})]
|
|
244
|
+
}),
|
|
245
|
+
onClose: () => {
|
|
246
|
+
setMarkedFileForDelete(null);
|
|
247
|
+
}
|
|
248
|
+
})]
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
export { UploadInput as default };
|
|
253
|
+
//# sourceMappingURL=UploadInput.mjs.map
|