@skbkontur/react-ui 0.0.0-0dca6f33be → 0.0.0-0ffbe8b468
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +188 -0
- package/cjs/components/Autocomplete/Autocomplete.d.ts +9 -3
- package/cjs/components/Autocomplete/Autocomplete.js +24 -7
- package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/Autocomplete/Autocomplete.md +17 -0
- package/cjs/components/Button/Button.d.ts +9 -3
- package/cjs/components/Button/Button.js +27 -4
- package/cjs/components/Button/Button.js.map +1 -1
- package/cjs/components/Button/Button.mixins.js +1 -1
- package/cjs/components/Button/Button.mixins.js.map +1 -1
- package/cjs/components/Button/Button.styles.d.ts +1 -0
- package/cjs/components/Button/Button.styles.js +68 -62
- package/cjs/components/Button/Button.styles.js.map +1 -1
- package/cjs/components/Button/ButtonIcon.d.ts +3 -2
- package/cjs/components/Button/ButtonIcon.js +1 -0
- package/cjs/components/Button/ButtonIcon.js.map +1 -1
- package/cjs/components/Button/getInnerLinkTheme.js +9 -4
- package/cjs/components/Button/getInnerLinkTheme.js.map +1 -1
- package/cjs/components/Calendar/Calendar.d.ts +1 -0
- package/cjs/components/Calendar/Calendar.js +1 -0
- package/cjs/components/Calendar/Calendar.js.map +1 -1
- package/cjs/components/Calendar/Calendar.md +14 -3
- package/cjs/components/Calendar/Calendar.styles.js +1 -2
- package/cjs/components/Calendar/Calendar.styles.js.map +1 -1
- package/cjs/components/Calendar/DayCellView.js +9 -2
- package/cjs/components/Calendar/DayCellView.js.map +1 -1
- package/cjs/components/Calendar/DayCellView.styles.d.ts +1 -1
- package/cjs/components/Calendar/DayCellView.styles.js +4 -4
- package/cjs/components/Calendar/DayCellView.styles.js.map +1 -1
- package/cjs/components/Calendar/locale/locales/en.js +3 -1
- package/cjs/components/Calendar/locale/locales/en.js.map +1 -1
- package/cjs/components/Calendar/locale/locales/ru.js +3 -1
- package/cjs/components/Calendar/locale/locales/ru.js.map +1 -1
- package/cjs/components/Calendar/locale/types.d.ts +4 -0
- package/cjs/components/Checkbox/Checkbox.d.ts +15 -5
- package/cjs/components/Checkbox/Checkbox.js +73 -16
- package/cjs/components/Checkbox/Checkbox.js.map +1 -1
- package/cjs/components/Checkbox/Checkbox.md +18 -0
- package/cjs/components/Checkbox/Checkbox.mixins.d.ts +2 -0
- package/cjs/components/Checkbox/Checkbox.mixins.js +37 -0
- package/cjs/components/Checkbox/Checkbox.mixins.js.map +1 -0
- package/cjs/components/Checkbox/Checkbox.styles.d.ts +6 -0
- package/cjs/components/Checkbox/Checkbox.styles.js +95 -34
- package/cjs/components/Checkbox/Checkbox.styles.js.map +1 -1
- package/cjs/components/ComboBox/ComboBox.d.ts +6 -8
- package/cjs/components/ComboBox/ComboBox.js +2 -1
- package/cjs/components/ComboBox/ComboBox.js.map +1 -1
- package/cjs/components/ComboBox/ComboBox.md +51 -5
- package/cjs/components/CurrencyInput/CurrencyHelper.d.ts +2 -0
- package/cjs/components/CurrencyInput/CurrencyHelper.js +21 -6
- package/cjs/components/CurrencyInput/CurrencyHelper.js.map +1 -1
- package/cjs/components/CurrencyInput/CurrencyInput.d.ts +2 -2
- package/cjs/components/CurrencyInput/CurrencyInput.js +2 -0
- package/cjs/components/CurrencyInput/CurrencyInput.js.map +1 -1
- package/cjs/components/DateInput/DateInput.d.ts +5 -1
- package/cjs/components/DateInput/DateInput.js +24 -8
- package/cjs/components/DateInput/DateInput.js.map +1 -1
- package/cjs/components/DatePicker/DatePicker.d.ts +2 -1
- package/cjs/components/DatePicker/DatePicker.js +13 -2
- package/cjs/components/DatePicker/DatePicker.js.map +1 -1
- package/cjs/components/DatePicker/DatePicker.md +15 -0
- package/cjs/components/DatePicker/locale/locales/en.js +4 -1
- package/cjs/components/DatePicker/locale/locales/en.js.map +1 -1
- package/cjs/components/DatePicker/locale/locales/ru.js +4 -1
- package/cjs/components/DatePicker/locale/locales/ru.js.map +1 -1
- package/cjs/components/DatePicker/locale/types.d.ts +3 -1
- package/cjs/components/Dropdown/Dropdown.d.ts +4 -7
- package/cjs/components/Dropdown/Dropdown.js +4 -3
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/Dropdown.md +33 -0
- package/cjs/components/Dropdown/getDropdownTheme.js +32 -1
- package/cjs/components/Dropdown/getDropdownTheme.js.map +1 -1
- package/cjs/components/DropdownMenu/DropdownMenu.d.ts +2 -2
- package/cjs/components/DropdownMenu/DropdownMenu.js +6 -1
- package/cjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/cjs/components/DropdownMenu/DropdownMenu.md +28 -0
- package/cjs/components/DropdownMenu/getDropdownMenuTheme.js +5 -1
- package/cjs/components/DropdownMenu/getDropdownMenuTheme.js.map +1 -1
- package/cjs/components/FileUploader/FileUploader.d.ts +6 -2
- package/cjs/components/FileUploader/FileUploader.js +4 -0
- package/cjs/components/FileUploader/FileUploader.js.map +1 -1
- package/cjs/components/FileUploader/FileUploader.styles.js +3 -2
- package/cjs/components/FileUploader/FileUploader.styles.js.map +1 -1
- package/cjs/components/FxInput/FxInput.d.ts +4 -2
- package/cjs/components/FxInput/FxInput.js +6 -1
- package/cjs/components/FxInput/FxInput.js.map +1 -1
- package/cjs/components/FxInput/FxInputRestoreBtn.d.ts +3 -2
- package/cjs/components/FxInput/FxInputRestoreBtn.js +7 -2
- package/cjs/components/FxInput/FxInputRestoreBtn.js.map +1 -1
- package/cjs/components/GlobalLoader/GlobalLoader.js +6 -2
- package/cjs/components/GlobalLoader/GlobalLoader.js.map +1 -1
- package/cjs/components/GlobalLoader/GlobalLoaderView.d.ts +2 -1
- package/cjs/components/GlobalLoader/GlobalLoaderView.js +6 -4
- package/cjs/components/GlobalLoader/GlobalLoaderView.js.map +1 -1
- package/cjs/components/Hint/Hint.js +2 -1
- package/cjs/components/Hint/Hint.js.map +1 -1
- package/cjs/components/Input/Input.d.ts +7 -7
- package/cjs/components/Input/Input.js +12 -7
- package/cjs/components/Input/Input.js.map +1 -1
- package/cjs/components/Input/Input.styles.js +3 -2
- package/cjs/components/Input/Input.styles.js.map +1 -1
- package/cjs/components/Input/InputLayout/InputLayout.d.ts +3 -2
- package/cjs/components/Input/InputLayout/InputLayout.js +4 -3
- package/cjs/components/Input/InputLayout/InputLayout.js.map +1 -1
- package/cjs/components/Input/InputLayout/InputLayoutAside.js +1 -1
- package/cjs/components/Input/InputLayout/InputLayoutAside.js.map +1 -1
- package/cjs/components/Input/InputLayout/InputLayoutAsideIcon.js +5 -4
- package/cjs/components/Input/InputLayout/InputLayoutAsideIcon.js.map +1 -1
- package/cjs/components/Input/InputLayout/InputLayoutContext.d.ts +2 -2
- package/cjs/components/Input/InputLayout/InputLayoutContext.js.map +1 -1
- package/cjs/components/Kebab/Kebab.d.ts +3 -2
- package/cjs/components/Kebab/Kebab.js +8 -1
- package/cjs/components/Kebab/Kebab.js.map +1 -1
- package/cjs/components/Kebab/Kebab.md +28 -0
- package/cjs/components/Link/Link.d.ts +2 -2
- package/cjs/components/Link/Link.js +20 -4
- package/cjs/components/Link/Link.js.map +1 -1
- package/cjs/components/Link/Link.mixins.d.ts +1 -2
- package/cjs/components/Link/Link.mixins.js +5 -16
- package/cjs/components/Link/Link.mixins.js.map +1 -1
- package/cjs/components/Link/Link.styles.d.ts +4 -0
- package/cjs/components/Link/Link.styles.js +96 -37
- package/cjs/components/Link/Link.styles.js.map +1 -1
- package/cjs/components/MenuFooter/MenuFooter.d.ts +30 -0
- package/cjs/components/MenuFooter/MenuFooter.js +83 -0
- package/cjs/components/MenuFooter/MenuFooter.js.map +1 -0
- package/cjs/components/MenuFooter/MenuFooter.md +27 -0
- package/cjs/components/MenuFooter/MenuFooter.mixins.d.ts +2 -0
- package/cjs/components/MenuFooter/MenuFooter.mixins.js +26 -0
- package/cjs/components/MenuFooter/MenuFooter.mixins.js.map +1 -0
- package/cjs/components/MenuFooter/MenuFooter.styles.d.ts +10 -0
- package/cjs/components/MenuFooter/MenuFooter.styles.js +65 -0
- package/cjs/components/MenuFooter/MenuFooter.styles.js.map +1 -0
- package/cjs/components/MenuFooter/index.d.ts +1 -0
- package/cjs/components/MenuFooter/index.js +1 -0
- package/cjs/components/MenuFooter/index.js.map +1 -0
- package/cjs/components/MenuHeader/MenuHeader.d.ts +8 -1
- package/cjs/components/MenuHeader/MenuHeader.js +35 -4
- package/cjs/components/MenuHeader/MenuHeader.js.map +1 -1
- package/cjs/components/MenuHeader/MenuHeader.md +12 -0
- package/cjs/components/MenuHeader/MenuHeader.mixins.d.ts +2 -0
- package/cjs/components/MenuHeader/MenuHeader.mixins.js +26 -0
- package/cjs/components/MenuHeader/MenuHeader.mixins.js.map +1 -0
- package/cjs/components/MenuHeader/MenuHeader.styles.d.ts +6 -1
- package/cjs/components/MenuHeader/MenuHeader.styles.js +54 -12
- package/cjs/components/MenuHeader/MenuHeader.styles.js.map +1 -1
- package/cjs/components/MenuItem/MenuItem.d.ts +14 -5
- package/cjs/components/MenuItem/MenuItem.js +61 -9
- package/cjs/components/MenuItem/MenuItem.js.map +1 -1
- package/cjs/components/MenuItem/MenuItem.md +12 -0
- package/cjs/components/MenuItem/MenuItem.mixins.d.ts +3 -0
- package/cjs/components/MenuItem/MenuItem.mixins.js +42 -0
- package/cjs/components/MenuItem/MenuItem.mixins.js.map +1 -0
- package/cjs/components/MenuItem/MenuItem.styles.d.ts +9 -1
- package/cjs/components/MenuItem/MenuItem.styles.js +80 -27
- package/cjs/components/MenuItem/MenuItem.styles.js.map +1 -1
- package/cjs/components/Modal/Modal.md +16 -0
- package/cjs/components/Modal/ModalClose.js +5 -1
- package/cjs/components/Modal/ModalClose.js.map +1 -1
- package/cjs/components/Modal/locale/index.d.ts +4 -0
- package/cjs/components/Modal/locale/index.js +11 -0
- package/cjs/components/Modal/locale/index.js.map +1 -0
- package/cjs/components/Modal/locale/locales/en.d.ts +2 -0
- package/cjs/components/Modal/locale/locales/en.js +4 -0
- package/cjs/components/Modal/locale/locales/en.js.map +1 -0
- package/cjs/components/Modal/locale/locales/ru.d.ts +2 -0
- package/cjs/components/Modal/locale/locales/ru.js +4 -0
- package/cjs/components/Modal/locale/locales/ru.js.map +1 -0
- package/cjs/components/Modal/locale/types.d.ts +3 -0
- package/cjs/components/Modal/locale/types.js +1 -0
- package/cjs/components/Modal/locale/types.js.map +1 -0
- package/cjs/components/Paging/Paging.js +1 -1
- package/cjs/components/Paging/Paging.js.map +1 -1
- package/cjs/components/Paging/Paging.styles.js +2 -1
- package/cjs/components/Paging/Paging.styles.js.map +1 -1
- package/cjs/components/PasswordInput/PasswordInput.d.ts +3 -2
- package/cjs/components/PasswordInput/PasswordInput.js +13 -4
- package/cjs/components/PasswordInput/PasswordInput.js.map +1 -1
- package/cjs/components/PasswordInput/PasswordInput.md +19 -0
- package/cjs/components/PasswordInput/PasswordInput.styles.d.ts +1 -0
- package/cjs/components/PasswordInput/PasswordInput.styles.js +11 -1
- package/cjs/components/PasswordInput/PasswordInput.styles.js.map +1 -1
- package/cjs/components/PasswordInput/locale/index.d.ts +4 -0
- package/cjs/components/PasswordInput/locale/index.js +11 -0
- package/cjs/components/PasswordInput/locale/index.js.map +1 -0
- package/cjs/components/PasswordInput/locale/locales/en.d.ts +2 -0
- package/cjs/components/PasswordInput/locale/locales/en.js +5 -0
- package/cjs/components/PasswordInput/locale/locales/en.js.map +1 -0
- package/cjs/components/PasswordInput/locale/locales/ru.d.ts +2 -0
- package/cjs/components/PasswordInput/locale/locales/ru.js +5 -0
- package/cjs/components/PasswordInput/locale/locales/ru.js.map +1 -0
- package/cjs/components/PasswordInput/locale/types.d.ts +4 -0
- package/cjs/components/PasswordInput/locale/types.js +1 -0
- package/cjs/components/PasswordInput/locale/types.js.map +1 -0
- package/cjs/components/Radio/Radio.d.ts +15 -3
- package/cjs/components/Radio/Radio.js +58 -6
- package/cjs/components/Radio/Radio.js.map +1 -1
- package/cjs/components/Radio/Radio.md +18 -0
- package/cjs/components/Radio/Radio.mixins.d.ts +5 -0
- package/cjs/components/Radio/Radio.mixins.js +71 -0
- package/cjs/components/Radio/Radio.mixins.js.map +1 -0
- package/cjs/components/Radio/Radio.styles.d.ts +9 -0
- package/cjs/components/Radio/Radio.styles.js +93 -57
- package/cjs/components/Radio/Radio.styles.js.map +1 -1
- package/cjs/components/ScrollContainer/ScrollContainer.d.ts +3 -2
- package/cjs/components/ScrollContainer/ScrollContainer.js +2 -1
- package/cjs/components/ScrollContainer/ScrollContainer.js.map +1 -1
- package/cjs/components/Select/Select.d.ts +12 -10
- package/cjs/components/Select/Select.js +30 -9
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/Select.md +17 -0
- package/cjs/components/Select/Select.styles.js +3 -2
- package/cjs/components/Select/Select.styles.js.map +1 -1
- package/cjs/components/Select/selectTheme.js +4 -1
- package/cjs/components/Select/selectTheme.js.map +1 -1
- package/cjs/components/SidePage/SidePage.js +5 -1
- package/cjs/components/SidePage/SidePage.js.map +1 -1
- package/cjs/components/SidePage/SidePage.md +16 -0
- package/cjs/components/SidePage/SidePageCloseButton.d.ts +1 -0
- package/cjs/components/SidePage/SidePageCloseButton.js +47 -0
- package/cjs/components/SidePage/SidePageCloseButton.js.map +1 -0
- package/cjs/components/SidePage/SidePageHeader.d.ts +0 -4
- package/cjs/components/SidePage/SidePageHeader.js +7 -41
- package/cjs/components/SidePage/SidePageHeader.js.map +1 -1
- package/cjs/components/SidePage/locale/index.d.ts +4 -0
- package/cjs/components/SidePage/locale/index.js +11 -0
- package/cjs/components/SidePage/locale/index.js.map +1 -0
- package/cjs/components/SidePage/locale/locales/en.d.ts +2 -0
- package/cjs/components/SidePage/locale/locales/en.js +4 -0
- package/cjs/components/SidePage/locale/locales/en.js.map +1 -0
- package/cjs/components/SidePage/locale/locales/ru.d.ts +2 -0
- package/cjs/components/SidePage/locale/locales/ru.js +4 -0
- package/cjs/components/SidePage/locale/locales/ru.js.map +1 -0
- package/cjs/components/SidePage/locale/types.d.ts +3 -0
- package/cjs/components/SidePage/locale/types.js +1 -0
- package/cjs/components/SidePage/locale/types.js.map +1 -0
- package/cjs/components/Sticky/Sticky.js +10 -3
- package/cjs/components/Sticky/Sticky.js.map +1 -1
- package/cjs/components/Switcher/Switcher.d.ts +12 -7
- package/cjs/components/Switcher/Switcher.js +16 -5
- package/cjs/components/Switcher/Switcher.js.map +1 -1
- package/cjs/components/Tabs/Tab.d.ts +17 -36
- package/cjs/components/Tabs/Tab.js +24 -21
- package/cjs/components/Tabs/Tab.js.map +1 -1
- package/cjs/components/Tabs/Tab.md +71 -0
- package/cjs/components/Tabs/Tab.styles.d.ts +9 -3
- package/cjs/components/Tabs/Tab.styles.js +106 -68
- package/cjs/components/Tabs/Tab.styles.js.map +1 -1
- package/cjs/components/Tabs/Tabs.d.ts +16 -15
- package/cjs/components/Tabs/Tabs.js +12 -4
- package/cjs/components/Tabs/Tabs.js.map +1 -1
- package/cjs/components/Tabs/Tabs.md +39 -22
- package/cjs/components/Tabs/Tabs.styles.d.ts +3 -1
- package/cjs/components/Tabs/Tabs.styles.js +23 -7
- package/cjs/components/Tabs/Tabs.styles.js.map +1 -1
- package/cjs/components/Tabs/TabsContext.d.ts +2 -0
- package/cjs/components/Tabs/TabsContext.js +3 -0
- package/cjs/components/Tabs/TabsContext.js.map +1 -1
- package/cjs/components/Tabs/helpers.d.ts +6 -0
- package/cjs/components/Tabs/helpers.js +31 -0
- package/cjs/components/Tabs/helpers.js.map +1 -0
- package/cjs/components/Textarea/Textarea.d.ts +12 -3
- package/cjs/components/Textarea/Textarea.js +48 -7
- package/cjs/components/Textarea/Textarea.js.map +1 -1
- package/cjs/components/Textarea/Textarea.md +12 -0
- package/cjs/components/Textarea/Textarea.mixins.d.ts +3 -0
- package/cjs/components/Textarea/Textarea.mixins.js +22 -0
- package/cjs/components/Textarea/Textarea.mixins.js.map +1 -0
- package/cjs/components/Textarea/Textarea.styles.d.ts +10 -1
- package/cjs/components/Textarea/Textarea.styles.js +64 -23
- package/cjs/components/Textarea/Textarea.styles.js.map +1 -1
- package/cjs/components/Textarea/TextareaCounter.d.ts +2 -0
- package/cjs/components/Textarea/TextareaCounter.js +17 -3
- package/cjs/components/Textarea/TextareaCounter.js.map +1 -1
- package/cjs/components/Toast/Toast.d.ts +3 -2
- package/cjs/components/Toast/Toast.js +3 -1
- package/cjs/components/Toast/Toast.js.map +1 -1
- package/cjs/components/Toast/ToastView.d.ts +6 -6
- package/cjs/components/Toast/ToastView.js +19 -6
- package/cjs/components/Toast/ToastView.js.map +1 -1
- package/cjs/components/Toast/ToastView.styles.js +5 -2
- package/cjs/components/Toast/ToastView.styles.js.map +1 -1
- package/cjs/components/Toast/locale/index.d.ts +4 -0
- package/cjs/components/Toast/locale/index.js +11 -0
- package/cjs/components/Toast/locale/index.js.map +1 -0
- package/cjs/components/Toast/locale/locales/en.d.ts +2 -0
- package/cjs/components/Toast/locale/locales/en.js +4 -0
- package/cjs/components/Toast/locale/locales/en.js.map +1 -0
- package/cjs/components/Toast/locale/locales/ru.d.ts +2 -0
- package/cjs/components/Toast/locale/locales/ru.js +4 -0
- package/cjs/components/Toast/locale/locales/ru.js.map +1 -0
- package/cjs/components/Toast/locale/types.d.ts +3 -0
- package/cjs/components/Toast/locale/types.js +1 -0
- package/cjs/components/Toast/locale/types.js.map +1 -0
- package/cjs/components/Toggle/Toggle.d.ts +16 -6
- package/cjs/components/Toggle/Toggle.js +112 -3
- package/cjs/components/Toggle/Toggle.js.map +1 -1
- package/cjs/components/Toggle/Toggle.md +18 -2
- package/cjs/components/Toggle/Toggle.mixins.d.ts +7 -0
- package/cjs/components/Toggle/Toggle.mixins.js +90 -0
- package/cjs/components/Toggle/Toggle.mixins.js.map +1 -0
- package/cjs/components/Toggle/Toggle.styles.d.ts +21 -1
- package/cjs/components/Toggle/Toggle.styles.js +172 -56
- package/cjs/components/Toggle/Toggle.styles.js.map +1 -1
- package/cjs/components/Token/Token.d.ts +2 -5
- package/cjs/components/Token/Token.js +15 -8
- package/cjs/components/Token/Token.js.map +1 -1
- package/cjs/components/Token/locale/index.d.ts +4 -0
- package/cjs/components/Token/locale/index.js +11 -0
- package/cjs/components/Token/locale/index.js.map +1 -0
- package/cjs/components/Token/locale/locales/en.d.ts +2 -0
- package/cjs/components/Token/locale/locales/en.js +4 -0
- package/cjs/components/Token/locale/locales/en.js.map +1 -0
- package/cjs/components/Token/locale/locales/ru.d.ts +2 -0
- package/cjs/components/Token/locale/locales/ru.js +4 -0
- package/cjs/components/Token/locale/locales/ru.js.map +1 -0
- package/cjs/components/Token/locale/types.d.ts +3 -0
- package/cjs/components/Token/locale/types.js +1 -0
- package/cjs/components/Token/locale/types.js.map +1 -0
- package/cjs/components/TokenInput/TokenInput.d.ts +3 -5
- package/cjs/components/TokenInput/TokenInput.js +11 -8
- package/cjs/components/TokenInput/TokenInput.js.map +1 -1
- package/cjs/components/TokenInput/TokenInput.md +26 -35
- package/cjs/components/TokenInput/TokenInput.styles.js +2 -1
- package/cjs/components/TokenInput/TokenInput.styles.js.map +1 -1
- package/cjs/components/TokenInput/TokenInputMenu.d.ts +7 -0
- package/cjs/components/TokenInput/TokenInputMenu.js +9 -1
- package/cjs/components/TokenInput/TokenInputMenu.js.map +1 -1
- package/cjs/components/TooltipMenu/TooltipMenu.d.ts +2 -2
- package/cjs/components/TooltipMenu/TooltipMenu.js +10 -2
- package/cjs/components/TooltipMenu/TooltipMenu.js.map +1 -1
- package/cjs/components/TooltipMenu/TooltipMenu.md +28 -0
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +1 -0
- package/cjs/index.js.map +1 -1
- package/cjs/internal/CloseButtonIcon/CloseButtonIcon.d.ts +2 -2
- package/cjs/internal/CloseButtonIcon/CloseButtonIcon.js +3 -0
- package/cjs/internal/CloseButtonIcon/CloseButtonIcon.js.map +1 -1
- package/cjs/internal/CloseButtonIcon/CloseButtonIcon.styles.js +2 -1
- package/cjs/internal/CloseButtonIcon/CloseButtonIcon.styles.js.map +1 -1
- package/cjs/internal/CustomComboBox/ComboBoxMenu.d.ts +9 -3
- package/cjs/internal/CustomComboBox/ComboBoxMenu.js +37 -2
- package/cjs/internal/CustomComboBox/ComboBoxMenu.js.map +1 -1
- package/cjs/internal/CustomComboBox/ComboBoxView.d.ts +14 -13
- package/cjs/internal/CustomComboBox/ComboBoxView.js +32 -34
- package/cjs/internal/CustomComboBox/ComboBoxView.js.map +1 -1
- package/cjs/internal/CustomComboBox/CustomComboBox.d.ts +10 -7
- package/cjs/internal/CustomComboBox/CustomComboBox.js +21 -12
- package/cjs/internal/CustomComboBox/CustomComboBox.js.map +1 -1
- package/cjs/internal/CustomComboBox/CustomComboBoxReducer.d.ts +2 -1
- package/cjs/internal/CustomComboBox/CustomComboBoxReducer.js +4 -0
- package/cjs/internal/CustomComboBox/CustomComboBoxReducer.js.map +1 -1
- package/cjs/internal/DateSelect/DateSelect.d.ts +2 -0
- package/cjs/internal/DateSelect/DateSelect.js +31 -2
- package/cjs/internal/DateSelect/DateSelect.js.map +1 -1
- package/cjs/internal/DateSelect/DateSelect.styles.d.ts +3 -0
- package/cjs/internal/DateSelect/DateSelect.styles.js +26 -4
- package/cjs/internal/DateSelect/DateSelect.styles.js.map +1 -1
- package/cjs/internal/DateSelect/locale/index.d.ts +4 -0
- package/cjs/internal/DateSelect/locale/index.js +11 -0
- package/cjs/internal/DateSelect/locale/index.js.map +1 -0
- package/cjs/internal/DateSelect/locale/locales/en.d.ts +2 -0
- package/cjs/internal/DateSelect/locale/locales/en.js +6 -0
- package/cjs/internal/DateSelect/locale/locales/en.js.map +1 -0
- package/cjs/internal/DateSelect/locale/locales/ru.d.ts +2 -0
- package/cjs/internal/DateSelect/locale/locales/ru.js +6 -0
- package/cjs/internal/DateSelect/locale/locales/ru.js.map +1 -0
- package/cjs/internal/DateSelect/locale/types.d.ts +5 -0
- package/cjs/internal/DateSelect/locale/types.js +1 -0
- package/cjs/internal/DateSelect/locale/types.js.map +1 -0
- package/cjs/internal/DropdownContainer/DropdownContainer.d.ts +3 -2
- package/cjs/internal/DropdownContainer/DropdownContainer.js +6 -1
- package/cjs/internal/DropdownContainer/DropdownContainer.js.map +1 -1
- package/cjs/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile.d.ts +3 -6
- package/cjs/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile.js +9 -7
- package/cjs/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile.js.map +1 -1
- package/cjs/internal/FileUploaderControl/FileUploaderFile/FileUploaderFileStatusIcon.d.ts +2 -2
- package/cjs/internal/FileUploaderControl/FileUploaderFile/FileUploaderFileStatusIcon.js +1 -1
- package/cjs/internal/FileUploaderControl/FileUploaderFile/FileUploaderFileStatusIcon.js.map +1 -1
- package/cjs/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList.d.ts +2 -2
- package/cjs/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList.js +1 -1
- package/cjs/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList.js.map +1 -1
- package/cjs/internal/FileUploaderControl/hooks/useFileUploaderSize.d.ts +2 -2
- package/cjs/internal/FileUploaderControl/hooks/useFileUploaderSize.js.map +1 -1
- package/cjs/internal/InputLikeText/InputLikeText.d.ts +1 -0
- package/cjs/internal/InputLikeText/InputLikeText.js +16 -4
- package/cjs/internal/InputLikeText/InputLikeText.js.map +1 -1
- package/cjs/internal/InternalMenu/InternalMenu.d.ts +13 -4
- package/cjs/internal/InternalMenu/InternalMenu.js +15 -5
- package/cjs/internal/InternalMenu/InternalMenu.js.map +1 -1
- package/cjs/internal/InternalMenu/InternalMenu.styles.d.ts +1 -0
- package/cjs/internal/InternalMenu/InternalMenu.styles.js +13 -7
- package/cjs/internal/InternalMenu/InternalMenu.styles.js.map +1 -1
- package/cjs/internal/InternalMenu/isIconPaddingEnabled.d.ts +2 -0
- package/cjs/internal/InternalMenu/isIconPaddingEnabled.js +9 -0
- package/cjs/internal/InternalMenu/isIconPaddingEnabled.js.map +1 -0
- package/cjs/internal/Menu/Menu.d.ts +42 -8
- package/cjs/internal/Menu/Menu.js +272 -78
- package/cjs/internal/Menu/Menu.js.map +1 -1
- package/cjs/internal/Menu/Menu.styles.d.ts +6 -1
- package/cjs/internal/Menu/Menu.styles.js +42 -8
- package/cjs/internal/Menu/Menu.styles.js.map +1 -1
- package/cjs/internal/MenuMessage/MenuMessage.d.ts +2 -0
- package/cjs/internal/MenuMessage/MenuMessage.js +18 -3
- package/cjs/internal/MenuMessage/MenuMessage.js.map +1 -1
- package/cjs/internal/MenuMessage/MenuMessage.styles.d.ts +3 -0
- package/cjs/internal/MenuMessage/MenuMessage.styles.js +21 -6
- package/cjs/internal/MenuMessage/MenuMessage.styles.js.map +1 -1
- package/cjs/internal/MobilePopup/MobilePopup.d.ts +2 -2
- package/cjs/internal/MobilePopup/MobilePopup.js +1 -1
- package/cjs/internal/MobilePopup/MobilePopup.js.map +1 -1
- package/cjs/internal/Popup/Popup.d.ts +7 -2
- package/cjs/internal/Popup/Popup.js +13 -3
- package/cjs/internal/Popup/Popup.js.map +1 -1
- package/cjs/internal/PopupMenu/PopupMenu.d.ts +5 -2
- package/cjs/internal/PopupMenu/PopupMenu.js +33 -4
- package/cjs/internal/PopupMenu/PopupMenu.js.map +1 -1
- package/cjs/internal/ThemePlayground/SizesGroup.d.ts +2 -1
- package/cjs/internal/ThemePlayground/SizesGroup.js +1 -0
- package/cjs/internal/ThemePlayground/SizesGroup.js.map +1 -1
- package/cjs/internal/ThemePlayground/darkTheme.d.ts +1 -1
- package/cjs/internal/ThemePlayground/darkTheme.js +1 -1
- package/cjs/internal/ThemePlayground/darkTheme.js.map +1 -1
- package/cjs/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
- package/cjs/internal/themes/DarkTheme.d.ts +2 -0
- package/cjs/internal/themes/DarkTheme.js +11 -3
- package/cjs/internal/themes/DarkTheme.js.map +1 -1
- package/cjs/internal/themes/DefaultTheme.d.ts +280 -19
- package/cjs/internal/themes/DefaultTheme.js +604 -94
- package/cjs/internal/themes/DefaultTheme.js.map +1 -1
- package/cjs/internal/themes/Theme2022.d.ts +28 -4
- package/cjs/internal/themes/Theme2022.js +53 -19
- package/cjs/internal/themes/Theme2022.js.map +1 -1
- package/cjs/internal/themes/Theme2022Dark.d.ts +5 -7
- package/cjs/internal/themes/Theme2022Dark.js +8 -18
- package/cjs/internal/themes/Theme2022Dark.js.map +1 -1
- package/cjs/lib/locale/types.d.ts +6 -0
- package/cjs/lib/locale/types.js +6 -0
- package/cjs/lib/locale/types.js.map +1 -1
- package/cjs/lib/rootNode/rootNodeDecorator.d.ts +5 -1
- package/cjs/lib/rootNode/rootNodeDecorator.js +7 -3
- package/cjs/lib/rootNode/rootNodeDecorator.js.map +1 -1
- package/cjs/lib/styles/getLabGrotesqueBaselineCompensation.d.ts +1 -1
- package/cjs/lib/styles/getLabGrotesqueBaselineCompensation.js +7 -2
- package/cjs/lib/styles/getLabGrotesqueBaselineCompensation.js.map +1 -1
- package/cjs/lib/types/props.d.ts +1 -0
- package/cjs/lib/types/props.js +1 -0
- package/cjs/lib/types/props.js.map +1 -0
- package/components/Autocomplete/Autocomplete/Autocomplete.js +18 -5
- package/components/Autocomplete/Autocomplete/Autocomplete.js.map +1 -1
- package/components/Autocomplete/Autocomplete.d.ts +9 -3
- package/components/Autocomplete/Autocomplete.md +17 -0
- package/components/Button/Button/Button.js +17 -2
- package/components/Button/Button/Button.js.map +1 -1
- package/components/Button/Button.d.ts +9 -3
- package/components/Button/Button.mixins/Button.mixins.js +1 -1
- package/components/Button/Button.mixins/Button.mixins.js.map +1 -1
- package/components/Button/Button.styles/Button.styles.js +61 -58
- package/components/Button/Button.styles/Button.styles.js.map +1 -1
- package/components/Button/Button.styles.d.ts +1 -0
- package/components/Button/ButtonIcon/ButtonIcon.js.map +1 -1
- package/components/Button/ButtonIcon.d.ts +3 -2
- package/components/Button/getInnerLinkTheme/getInnerLinkTheme.js +9 -4
- package/components/Button/getInnerLinkTheme/getInnerLinkTheme.js.map +1 -1
- package/components/Calendar/Calendar/Calendar.js +1 -0
- package/components/Calendar/Calendar/Calendar.js.map +1 -1
- package/components/Calendar/Calendar.d.ts +1 -0
- package/components/Calendar/Calendar.md +14 -3
- package/components/Calendar/Calendar.styles/Calendar.styles.js +1 -1
- package/components/Calendar/Calendar.styles/Calendar.styles.js.map +1 -1
- package/components/Calendar/DayCellView/DayCellView.js +7 -1
- package/components/Calendar/DayCellView/DayCellView.js.map +1 -1
- package/components/Calendar/DayCellView.styles/DayCellView.styles.js +2 -2
- package/components/Calendar/DayCellView.styles/DayCellView.styles.js.map +1 -1
- package/components/Calendar/DayCellView.styles.d.ts +1 -1
- package/components/Calendar/locale/locales/en/en.js +2 -1
- package/components/Calendar/locale/locales/en/en.js.map +1 -1
- package/components/Calendar/locale/locales/ru/ru.js +2 -1
- package/components/Calendar/locale/locales/ru/ru.js.map +1 -1
- package/components/Calendar/locale/types.d.ts +4 -0
- package/components/Checkbox/Checkbox/Checkbox.js +62 -8
- package/components/Checkbox/Checkbox/Checkbox.js.map +1 -1
- package/components/Checkbox/Checkbox.d.ts +15 -5
- package/components/Checkbox/Checkbox.md +18 -0
- package/components/Checkbox/Checkbox.mixins/Checkbox.mixins.js +16 -0
- package/components/Checkbox/Checkbox.mixins/Checkbox.mixins.js.map +1 -0
- package/components/Checkbox/Checkbox.mixins/package.json +6 -0
- package/components/Checkbox/Checkbox.mixins.d.ts +2 -0
- package/components/Checkbox/Checkbox.styles/Checkbox.styles.js +39 -25
- package/components/Checkbox/Checkbox.styles/Checkbox.styles.js.map +1 -1
- package/components/Checkbox/Checkbox.styles.d.ts +6 -0
- package/components/ComboBox/ComboBox/ComboBox.js +1 -0
- package/components/ComboBox/ComboBox/ComboBox.js.map +1 -1
- package/components/ComboBox/ComboBox.d.ts +6 -8
- package/components/ComboBox/ComboBox.md +51 -5
- package/components/CurrencyInput/CurrencyHelper/CurrencyHelper.js +32 -4
- package/components/CurrencyInput/CurrencyHelper/CurrencyHelper.js.map +1 -1
- package/components/CurrencyInput/CurrencyHelper.d.ts +2 -0
- package/components/CurrencyInput/CurrencyInput/CurrencyInput.js +1 -0
- package/components/CurrencyInput/CurrencyInput/CurrencyInput.js.map +1 -1
- package/components/CurrencyInput/CurrencyInput.d.ts +2 -2
- package/components/DateInput/DateInput/DateInput.js +26 -9
- package/components/DateInput/DateInput/DateInput.js.map +1 -1
- package/components/DateInput/DateInput.d.ts +5 -1
- package/components/DatePicker/DatePicker/DatePicker.js +7 -1
- package/components/DatePicker/DatePicker/DatePicker.js.map +1 -1
- package/components/DatePicker/DatePicker.d.ts +2 -1
- package/components/DatePicker/DatePicker.md +15 -0
- package/components/DatePicker/locale/locales/en/en.js +4 -2
- package/components/DatePicker/locale/locales/en/en.js.map +1 -1
- package/components/DatePicker/locale/locales/ru/ru.js +4 -2
- package/components/DatePicker/locale/locales/ru/ru.js.map +1 -1
- package/components/DatePicker/locale/types.d.ts +3 -1
- package/components/Dropdown/Dropdown/Dropdown.js +3 -1
- package/components/Dropdown/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/Dropdown.d.ts +4 -7
- package/components/Dropdown/Dropdown.md +33 -0
- package/components/Dropdown/getDropdownTheme/getDropdownTheme.js +27 -1
- package/components/Dropdown/getDropdownTheme/getDropdownTheme.js.map +1 -1
- package/components/DropdownMenu/DropdownMenu/DropdownMenu.js +2 -0
- package/components/DropdownMenu/DropdownMenu/DropdownMenu.js.map +1 -1
- package/components/DropdownMenu/DropdownMenu.d.ts +2 -2
- package/components/DropdownMenu/DropdownMenu.md +28 -0
- package/components/DropdownMenu/getDropdownMenuTheme/getDropdownMenuTheme.js +5 -1
- package/components/DropdownMenu/getDropdownMenuTheme/getDropdownMenuTheme.js.map +1 -1
- package/components/FileUploader/FileUploader/FileUploader.js +4 -0
- package/components/FileUploader/FileUploader/FileUploader.js.map +1 -1
- package/components/FileUploader/FileUploader.d.ts +6 -2
- package/components/FileUploader/FileUploader.styles/FileUploader.styles.js +1 -1
- package/components/FileUploader/FileUploader.styles/FileUploader.styles.js.map +1 -1
- package/components/FxInput/FxInput/FxInput.js +2 -1
- package/components/FxInput/FxInput/FxInput.js.map +1 -1
- package/components/FxInput/FxInput.d.ts +4 -2
- package/components/FxInput/FxInputRestoreBtn/FxInputRestoreBtn.js +4 -2
- package/components/FxInput/FxInputRestoreBtn/FxInputRestoreBtn.js.map +1 -1
- package/components/FxInput/FxInputRestoreBtn.d.ts +3 -2
- package/components/GlobalLoader/GlobalLoader/GlobalLoader.js +5 -1
- package/components/GlobalLoader/GlobalLoader/GlobalLoader.js.map +1 -1
- package/components/GlobalLoader/GlobalLoaderView/GlobalLoaderView.js +6 -2
- package/components/GlobalLoader/GlobalLoaderView/GlobalLoaderView.js.map +1 -1
- package/components/GlobalLoader/GlobalLoaderView.d.ts +2 -1
- package/components/Hint/Hint/Hint.js +2 -1
- package/components/Hint/Hint/Hint.js.map +1 -1
- package/components/Input/Input/Input.js +10 -2
- package/components/Input/Input/Input.js.map +1 -1
- package/components/Input/Input.d.ts +7 -7
- package/components/Input/Input.styles/Input.styles.js +2 -2
- package/components/Input/Input.styles/Input.styles.js.map +1 -1
- package/components/Input/InputLayout/InputLayout/InputLayout.js +4 -2
- package/components/Input/InputLayout/InputLayout/InputLayout.js.map +1 -1
- package/components/Input/InputLayout/InputLayout.d.ts +3 -2
- package/components/Input/InputLayout/InputLayoutAside/InputLayoutAside.js +1 -2
- package/components/Input/InputLayout/InputLayoutAside/InputLayoutAside.js.map +1 -1
- package/components/Input/InputLayout/InputLayoutAsideIcon/InputLayoutAsideIcon.js +7 -5
- package/components/Input/InputLayout/InputLayoutAsideIcon/InputLayoutAsideIcon.js.map +1 -1
- package/components/Input/InputLayout/InputLayoutContext/InputLayoutContext.js.map +1 -1
- package/components/Input/InputLayout/InputLayoutContext.d.ts +2 -2
- package/components/Kebab/Kebab/Kebab.js +7 -3
- package/components/Kebab/Kebab/Kebab.js.map +1 -1
- package/components/Kebab/Kebab.d.ts +3 -2
- package/components/Kebab/Kebab.md +28 -0
- package/components/Link/Link/Link.js +12 -6
- package/components/Link/Link/Link.js.map +1 -1
- package/components/Link/Link.d.ts +2 -2
- package/components/Link/Link.mixins/Link.mixins.js +2 -5
- package/components/Link/Link.mixins/Link.mixins.js.map +1 -1
- package/components/Link/Link.mixins.d.ts +1 -2
- package/components/Link/Link.styles/Link.styles.js +45 -21
- package/components/Link/Link.styles/Link.styles.js.map +1 -1
- package/components/Link/Link.styles.d.ts +4 -0
- package/components/MenuFooter/MenuFooter/MenuFooter.js +74 -0
- package/components/MenuFooter/MenuFooter/MenuFooter.js.map +1 -0
- package/components/MenuFooter/MenuFooter/package.json +6 -0
- package/components/MenuFooter/MenuFooter.d.ts +30 -0
- package/components/MenuFooter/MenuFooter.md +27 -0
- package/components/MenuFooter/MenuFooter.mixins/MenuFooter.mixins.js +13 -0
- package/components/MenuFooter/MenuFooter.mixins/MenuFooter.mixins.js.map +1 -0
- package/components/MenuFooter/MenuFooter.mixins/package.json +6 -0
- package/components/MenuFooter/MenuFooter.mixins.d.ts +2 -0
- package/components/MenuFooter/MenuFooter.styles/MenuFooter.styles.js +29 -0
- package/components/MenuFooter/MenuFooter.styles/MenuFooter.styles.js.map +1 -0
- package/components/MenuFooter/MenuFooter.styles/package.json +6 -0
- package/components/MenuFooter/MenuFooter.styles.d.ts +10 -0
- package/components/MenuFooter/index/index.js +1 -0
- package/components/MenuFooter/index/index.js.map +1 -0
- package/components/MenuFooter/index/package.json +6 -0
- package/components/MenuFooter/index.d.ts +1 -0
- package/components/MenuFooter/package.json +6 -0
- package/components/MenuHeader/MenuHeader/MenuHeader.js +37 -2
- package/components/MenuHeader/MenuHeader/MenuHeader.js.map +1 -1
- package/components/MenuHeader/MenuHeader.d.ts +8 -1
- package/components/MenuHeader/MenuHeader.md +12 -0
- package/components/MenuHeader/MenuHeader.mixins/MenuHeader.mixins.js +13 -0
- package/components/MenuHeader/MenuHeader.mixins/MenuHeader.mixins.js.map +1 -0
- package/components/MenuHeader/MenuHeader.mixins/package.json +6 -0
- package/components/MenuHeader/MenuHeader.mixins.d.ts +2 -0
- package/components/MenuHeader/MenuHeader.styles/MenuHeader.styles.js +20 -6
- package/components/MenuHeader/MenuHeader.styles/MenuHeader.styles.js.map +1 -1
- package/components/MenuHeader/MenuHeader.styles.d.ts +6 -1
- package/components/MenuItem/MenuItem/MenuItem.js +54 -8
- package/components/MenuItem/MenuItem/MenuItem.js.map +1 -1
- package/components/MenuItem/MenuItem.d.ts +14 -5
- package/components/MenuItem/MenuItem.md +12 -0
- package/components/MenuItem/MenuItem.mixins/MenuItem.mixins.js +24 -0
- package/components/MenuItem/MenuItem.mixins/MenuItem.mixins.js.map +1 -0
- package/components/MenuItem/MenuItem.mixins/package.json +6 -0
- package/components/MenuItem/MenuItem.mixins.d.ts +3 -0
- package/components/MenuItem/MenuItem.styles/MenuItem.styles.js +39 -23
- package/components/MenuItem/MenuItem.styles/MenuItem.styles.js.map +1 -1
- package/components/MenuItem/MenuItem.styles.d.ts +9 -1
- package/components/Modal/Modal.md +16 -0
- package/components/Modal/ModalClose/ModalClose.js +4 -0
- package/components/Modal/ModalClose/ModalClose.js.map +1 -1
- package/components/Modal/locale/index/index.js +8 -0
- package/components/Modal/locale/index/index.js.map +1 -0
- package/components/Modal/locale/index/package.json +6 -0
- package/components/Modal/locale/index.d.ts +4 -0
- package/components/Modal/locale/locales/en/en.js +3 -0
- package/components/Modal/locale/locales/en/en.js.map +1 -0
- package/components/Modal/locale/locales/en/package.json +6 -0
- package/components/Modal/locale/locales/en.d.ts +2 -0
- package/components/Modal/locale/locales/ru/package.json +6 -0
- package/components/Modal/locale/locales/ru/ru.js +3 -0
- package/components/Modal/locale/locales/ru/ru.js.map +1 -0
- package/components/Modal/locale/locales/ru.d.ts +2 -0
- package/components/Modal/locale/package.json +6 -0
- package/components/Modal/locale/types/package.json +6 -0
- package/components/Modal/locale/types/types.js +1 -0
- package/components/Modal/locale/types/types.js.map +1 -0
- package/components/Modal/locale/types.d.ts +3 -0
- package/components/Paging/Paging/Paging.js +1 -1
- package/components/Paging/Paging/Paging.js.map +1 -1
- package/components/Paging/Paging.styles/Paging.styles.js +1 -1
- package/components/Paging/Paging.styles/Paging.styles.js.map +1 -1
- package/components/PasswordInput/PasswordInput/PasswordInput.js +8 -4
- package/components/PasswordInput/PasswordInput/PasswordInput.js.map +1 -1
- package/components/PasswordInput/PasswordInput.d.ts +3 -2
- package/components/PasswordInput/PasswordInput.md +19 -0
- package/components/PasswordInput/PasswordInput.styles/PasswordInput.styles.js +4 -1
- package/components/PasswordInput/PasswordInput.styles/PasswordInput.styles.js.map +1 -1
- package/components/PasswordInput/PasswordInput.styles.d.ts +1 -0
- package/components/PasswordInput/locale/index/index.js +8 -0
- package/components/PasswordInput/locale/index/index.js.map +1 -0
- package/components/PasswordInput/locale/index/package.json +6 -0
- package/components/PasswordInput/locale/index.d.ts +4 -0
- package/components/PasswordInput/locale/locales/en/en.js +4 -0
- package/components/PasswordInput/locale/locales/en/en.js.map +1 -0
- package/components/PasswordInput/locale/locales/en/package.json +6 -0
- package/components/PasswordInput/locale/locales/en.d.ts +2 -0
- package/components/PasswordInput/locale/locales/ru/package.json +6 -0
- package/components/PasswordInput/locale/locales/ru/ru.js +4 -0
- package/components/PasswordInput/locale/locales/ru/ru.js.map +1 -0
- package/components/PasswordInput/locale/locales/ru.d.ts +2 -0
- package/components/PasswordInput/locale/package.json +6 -0
- package/components/PasswordInput/locale/types/package.json +6 -0
- package/components/PasswordInput/locale/types/types.js +1 -0
- package/components/PasswordInput/locale/types/types.js.map +1 -0
- package/components/PasswordInput/locale/types.d.ts +4 -0
- package/components/Radio/Radio/Radio.js +54 -6
- package/components/Radio/Radio/Radio.js.map +1 -1
- package/components/Radio/Radio.d.ts +15 -3
- package/components/Radio/Radio.md +18 -0
- package/components/Radio/Radio.mixins/Radio.mixins.js +28 -0
- package/components/Radio/Radio.mixins/Radio.mixins.js.map +1 -0
- package/components/Radio/Radio.mixins/package.json +6 -0
- package/components/Radio/Radio.mixins.d.ts +5 -0
- package/components/Radio/Radio.styles/Radio.styles.js +44 -29
- package/components/Radio/Radio.styles/Radio.styles.js.map +1 -1
- package/components/Radio/Radio.styles.d.ts +9 -0
- package/components/ScrollContainer/ScrollContainer/ScrollContainer.js.map +1 -1
- package/components/ScrollContainer/ScrollContainer.d.ts +3 -2
- package/components/Select/Select/Select.js +34 -9
- package/components/Select/Select/Select.js.map +1 -1
- package/components/Select/Select.d.ts +12 -10
- package/components/Select/Select.md +17 -0
- package/components/Select/Select.styles/Select.styles.js +1 -1
- package/components/Select/Select.styles/Select.styles.js.map +1 -1
- package/components/Select/selectTheme/selectTheme.js +3 -1
- package/components/Select/selectTheme/selectTheme.js.map +1 -1
- package/components/SidePage/SidePage/SidePage.js +4 -4
- package/components/SidePage/SidePage/SidePage.js.map +1 -1
- package/components/SidePage/SidePage.md +16 -0
- package/components/SidePage/SidePageCloseButton/SidePageCloseButton.js +42 -0
- package/components/SidePage/SidePageCloseButton/SidePageCloseButton.js.map +1 -0
- package/components/SidePage/SidePageCloseButton/package.json +6 -0
- package/components/SidePage/SidePageCloseButton.d.ts +1 -0
- package/components/SidePage/SidePageHeader/SidePageHeader.js +4 -38
- package/components/SidePage/SidePageHeader/SidePageHeader.js.map +1 -1
- package/components/SidePage/SidePageHeader.d.ts +0 -4
- package/components/SidePage/locale/index/index.js +8 -0
- package/components/SidePage/locale/index/index.js.map +1 -0
- package/components/SidePage/locale/index/package.json +6 -0
- package/components/SidePage/locale/index.d.ts +4 -0
- package/components/SidePage/locale/locales/en/en.js +3 -0
- package/components/SidePage/locale/locales/en/en.js.map +1 -0
- package/components/SidePage/locale/locales/en/package.json +6 -0
- package/components/SidePage/locale/locales/en.d.ts +2 -0
- package/components/SidePage/locale/locales/ru/package.json +6 -0
- package/components/SidePage/locale/locales/ru/ru.js +3 -0
- package/components/SidePage/locale/locales/ru/ru.js.map +1 -0
- package/components/SidePage/locale/locales/ru.d.ts +2 -0
- package/components/SidePage/locale/package.json +6 -0
- package/components/SidePage/locale/types/package.json +6 -0
- package/components/SidePage/locale/types/types.js +1 -0
- package/components/SidePage/locale/types/types.js.map +1 -0
- package/components/SidePage/locale/types.d.ts +3 -0
- package/components/Sticky/Sticky/Sticky.js +12 -3
- package/components/Sticky/Sticky/Sticky.js.map +1 -1
- package/components/Switcher/Switcher/Switcher.js +9 -3
- package/components/Switcher/Switcher/Switcher.js.map +1 -1
- package/components/Switcher/Switcher.d.ts +12 -7
- package/components/Tabs/Tab/Tab.js +12 -18
- package/components/Tabs/Tab/Tab.js.map +1 -1
- package/components/Tabs/Tab.d.ts +17 -36
- package/components/Tabs/Tab.md +71 -0
- package/components/Tabs/Tab.styles/Tab.styles.js +52 -23
- package/components/Tabs/Tab.styles/Tab.styles.js.map +1 -1
- package/components/Tabs/Tab.styles.d.ts +9 -3
- package/components/Tabs/Tabs/Tabs.js +12 -6
- package/components/Tabs/Tabs/Tabs.js.map +1 -1
- package/components/Tabs/Tabs.d.ts +16 -15
- package/components/Tabs/Tabs.md +39 -22
- package/components/Tabs/Tabs.styles/Tabs.styles.js +15 -4
- package/components/Tabs/Tabs.styles/Tabs.styles.js.map +1 -1
- package/components/Tabs/Tabs.styles.d.ts +3 -1
- package/components/Tabs/TabsContext/TabsContext.js +1 -0
- package/components/Tabs/TabsContext/TabsContext.js.map +1 -1
- package/components/Tabs/TabsContext.d.ts +2 -0
- package/components/Tabs/helpers/helpers.js +28 -0
- package/components/Tabs/helpers/helpers.js.map +1 -0
- package/components/Tabs/helpers/package.json +6 -0
- package/components/Tabs/helpers.d.ts +6 -0
- package/components/Textarea/Textarea/Textarea.js +39 -4
- package/components/Textarea/Textarea/Textarea.js.map +1 -1
- package/components/Textarea/Textarea.d.ts +12 -3
- package/components/Textarea/Textarea.md +12 -0
- package/components/Textarea/Textarea.mixins/Textarea.mixins.js +14 -0
- package/components/Textarea/Textarea.mixins/Textarea.mixins.js.map +1 -0
- package/components/Textarea/Textarea.mixins/package.json +6 -0
- package/components/Textarea/Textarea.mixins.d.ts +3 -0
- package/components/Textarea/Textarea.styles/Textarea.styles.js +43 -15
- package/components/Textarea/Textarea.styles/Textarea.styles.js.map +1 -1
- package/components/Textarea/Textarea.styles.d.ts +10 -1
- package/components/Textarea/TextareaCounter/TextareaCounter.js +19 -3
- package/components/Textarea/TextareaCounter/TextareaCounter.js.map +1 -1
- package/components/Textarea/TextareaCounter.d.ts +2 -0
- package/components/Toast/Toast/Toast.js +1 -0
- package/components/Toast/Toast/Toast.js.map +1 -1
- package/components/Toast/Toast.d.ts +3 -2
- package/components/Toast/ToastView/ToastView.js +9 -4
- package/components/Toast/ToastView/ToastView.js.map +1 -1
- package/components/Toast/ToastView.d.ts +6 -6
- package/components/Toast/ToastView.styles/ToastView.styles.js +1 -1
- package/components/Toast/ToastView.styles/ToastView.styles.js.map +1 -1
- package/components/Toast/locale/index/index.js +8 -0
- package/components/Toast/locale/index/index.js.map +1 -0
- package/components/Toast/locale/index/package.json +6 -0
- package/components/Toast/locale/index.d.ts +4 -0
- package/components/Toast/locale/locales/en/en.js +3 -0
- package/components/Toast/locale/locales/en/en.js.map +1 -0
- package/components/Toast/locale/locales/en/package.json +6 -0
- package/components/Toast/locale/locales/en.d.ts +2 -0
- package/components/Toast/locale/locales/ru/package.json +6 -0
- package/components/Toast/locale/locales/ru/ru.js +3 -0
- package/components/Toast/locale/locales/ru/ru.js.map +1 -0
- package/components/Toast/locale/locales/ru.d.ts +2 -0
- package/components/Toast/locale/package.json +6 -0
- package/components/Toast/locale/types/package.json +6 -0
- package/components/Toast/locale/types/types.js +1 -0
- package/components/Toast/locale/types/types.js.map +1 -0
- package/components/Toast/locale/types.d.ts +3 -0
- package/components/Toggle/Toggle/Toggle.js +119 -10
- package/components/Toggle/Toggle/Toggle.js.map +1 -1
- package/components/Toggle/Toggle.d.ts +16 -6
- package/components/Toggle/Toggle.md +18 -2
- package/components/Toggle/Toggle.mixins/Toggle.mixins.js +35 -0
- package/components/Toggle/Toggle.mixins/Toggle.mixins.js.map +1 -0
- package/components/Toggle/Toggle.mixins/package.json +6 -0
- package/components/Toggle/Toggle.mixins.d.ts +7 -0
- package/components/Toggle/Toggle.styles/Toggle.styles.js +85 -31
- package/components/Toggle/Toggle.styles/Toggle.styles.js.map +1 -1
- package/components/Toggle/Toggle.styles.d.ts +21 -1
- package/components/Token/Token/Token.js +8 -3
- package/components/Token/Token/Token.js.map +1 -1
- package/components/Token/Token.d.ts +2 -5
- package/components/Token/locale/index/index.js +8 -0
- package/components/Token/locale/index/index.js.map +1 -0
- package/components/Token/locale/index/package.json +6 -0
- package/components/Token/locale/index.d.ts +4 -0
- package/components/Token/locale/locales/en/en.js +3 -0
- package/components/Token/locale/locales/en/en.js.map +1 -0
- package/components/Token/locale/locales/en/package.json +6 -0
- package/components/Token/locale/locales/en.d.ts +2 -0
- package/components/Token/locale/locales/ru/package.json +6 -0
- package/components/Token/locale/locales/ru/ru.js +3 -0
- package/components/Token/locale/locales/ru/ru.js.map +1 -0
- package/components/Token/locale/locales/ru.d.ts +2 -0
- package/components/Token/locale/package.json +6 -0
- package/components/Token/locale/types/package.json +6 -0
- package/components/Token/locale/types/types.js +1 -0
- package/components/Token/locale/types/types.js.map +1 -0
- package/components/Token/locale/types.d.ts +3 -0
- package/components/TokenInput/TokenInput/TokenInput.js +12 -4
- package/components/TokenInput/TokenInput/TokenInput.js.map +1 -1
- package/components/TokenInput/TokenInput.d.ts +3 -5
- package/components/TokenInput/TokenInput.md +26 -35
- package/components/TokenInput/TokenInput.styles/TokenInput.styles.js +1 -1
- package/components/TokenInput/TokenInput.styles/TokenInput.styles.js.map +1 -1
- package/components/TokenInput/TokenInputMenu/TokenInputMenu.js +1 -0
- package/components/TokenInput/TokenInputMenu/TokenInputMenu.js.map +1 -1
- package/components/TokenInput/TokenInputMenu.d.ts +7 -0
- package/components/TooltipMenu/TooltipMenu/TooltipMenu.js +8 -2
- package/components/TooltipMenu/TooltipMenu/TooltipMenu.js.map +1 -1
- package/components/TooltipMenu/TooltipMenu.d.ts +2 -2
- package/components/TooltipMenu/TooltipMenu.md +28 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/internal/CloseButtonIcon/CloseButtonIcon/CloseButtonIcon.js.map +1 -1
- package/internal/CloseButtonIcon/CloseButtonIcon.d.ts +2 -2
- package/internal/CloseButtonIcon/CloseButtonIcon.styles/CloseButtonIcon.styles.js +1 -1
- package/internal/CloseButtonIcon/CloseButtonIcon.styles/CloseButtonIcon.styles.js.map +1 -1
- package/internal/CustomComboBox/ComboBoxMenu/ComboBoxMenu.js +33 -10
- package/internal/CustomComboBox/ComboBoxMenu/ComboBoxMenu.js.map +1 -1
- package/internal/CustomComboBox/ComboBoxMenu.d.ts +9 -3
- package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js +40 -40
- package/internal/CustomComboBox/ComboBoxView/ComboBoxView.js.map +1 -1
- package/internal/CustomComboBox/ComboBoxView.d.ts +14 -13
- package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js +19 -10
- package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js.map +1 -1
- package/internal/CustomComboBox/CustomComboBox.d.ts +10 -7
- package/internal/CustomComboBox/CustomComboBoxReducer/CustomComboBoxReducer.js +4 -0
- package/internal/CustomComboBox/CustomComboBoxReducer/CustomComboBoxReducer.js.map +1 -1
- package/internal/CustomComboBox/CustomComboBoxReducer.d.ts +2 -1
- package/internal/DateSelect/DateSelect/DateSelect.js +32 -16
- package/internal/DateSelect/DateSelect/DateSelect.js.map +1 -1
- package/internal/DateSelect/DateSelect.d.ts +2 -0
- package/internal/DateSelect/DateSelect.styles/DateSelect.styles.js +6 -3
- package/internal/DateSelect/DateSelect.styles/DateSelect.styles.js.map +1 -1
- package/internal/DateSelect/DateSelect.styles.d.ts +3 -0
- package/internal/DateSelect/locale/index/index.js +8 -0
- package/internal/DateSelect/locale/index/index.js.map +1 -0
- package/internal/DateSelect/locale/index/package.json +6 -0
- package/internal/DateSelect/locale/index.d.ts +4 -0
- package/internal/DateSelect/locale/locales/en/en.js +5 -0
- package/internal/DateSelect/locale/locales/en/en.js.map +1 -0
- package/internal/DateSelect/locale/locales/en/package.json +6 -0
- package/internal/DateSelect/locale/locales/en.d.ts +2 -0
- package/internal/DateSelect/locale/locales/ru/package.json +6 -0
- package/internal/DateSelect/locale/locales/ru/ru.js +5 -0
- package/internal/DateSelect/locale/locales/ru/ru.js.map +1 -0
- package/internal/DateSelect/locale/locales/ru.d.ts +2 -0
- package/internal/DateSelect/locale/package.json +6 -0
- package/internal/DateSelect/locale/types/package.json +6 -0
- package/internal/DateSelect/locale/types/types.js +1 -0
- package/internal/DateSelect/locale/types/types.js.map +1 -0
- package/internal/DateSelect/locale/types.d.ts +5 -0
- package/internal/DropdownContainer/DropdownContainer/DropdownContainer.js +2 -0
- package/internal/DropdownContainer/DropdownContainer/DropdownContainer.js.map +1 -1
- package/internal/DropdownContainer/DropdownContainer.d.ts +3 -2
- package/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile/FileUploaderFile.js +6 -5
- package/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile/FileUploaderFile.js.map +1 -1
- package/internal/FileUploaderControl/FileUploaderFile/FileUploaderFile.d.ts +3 -6
- package/internal/FileUploaderControl/FileUploaderFile/FileUploaderFileStatusIcon/FileUploaderFileStatusIcon.js.map +1 -1
- package/internal/FileUploaderControl/FileUploaderFile/FileUploaderFileStatusIcon.d.ts +2 -2
- package/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList/FileUploaderFileList.js.map +1 -1
- package/internal/FileUploaderControl/FileUploaderFileList/FileUploaderFileList.d.ts +2 -2
- package/internal/FileUploaderControl/hooks/useFileUploaderSize/useFileUploaderSize.js.map +1 -1
- package/internal/FileUploaderControl/hooks/useFileUploaderSize.d.ts +2 -2
- package/internal/InputLikeText/InputLikeText/InputLikeText.js +20 -8
- package/internal/InputLikeText/InputLikeText/InputLikeText.js.map +1 -1
- package/internal/InputLikeText/InputLikeText.d.ts +1 -0
- package/internal/InternalMenu/InternalMenu/InternalMenu.js +11 -6
- package/internal/InternalMenu/InternalMenu/InternalMenu.js.map +1 -1
- package/internal/InternalMenu/InternalMenu.d.ts +13 -4
- package/internal/InternalMenu/InternalMenu.styles/InternalMenu.styles.js +10 -7
- package/internal/InternalMenu/InternalMenu.styles/InternalMenu.styles.js.map +1 -1
- package/internal/InternalMenu/InternalMenu.styles.d.ts +1 -0
- package/internal/InternalMenu/isIconPaddingEnabled/isIconPaddingEnabled.js +6 -0
- package/internal/InternalMenu/isIconPaddingEnabled/isIconPaddingEnabled.js.map +1 -0
- package/internal/InternalMenu/isIconPaddingEnabled/package.json +6 -0
- package/internal/InternalMenu/isIconPaddingEnabled.d.ts +2 -0
- package/internal/Menu/Menu/Menu.js +197 -42
- package/internal/Menu/Menu/Menu.js.map +1 -1
- package/internal/Menu/Menu.d.ts +42 -8
- package/internal/Menu/Menu.styles/Menu.styles.js +20 -5
- package/internal/Menu/Menu.styles/Menu.styles.js.map +1 -1
- package/internal/Menu/Menu.styles.d.ts +6 -1
- package/internal/MenuMessage/MenuMessage/MenuMessage.js +19 -2
- package/internal/MenuMessage/MenuMessage/MenuMessage.js.map +1 -1
- package/internal/MenuMessage/MenuMessage.d.ts +2 -0
- package/internal/MenuMessage/MenuMessage.styles/MenuMessage.styles.js +11 -2
- package/internal/MenuMessage/MenuMessage.styles/MenuMessage.styles.js.map +1 -1
- package/internal/MenuMessage/MenuMessage.styles.d.ts +3 -0
- package/internal/MobilePopup/MobilePopup/MobilePopup.js +1 -0
- package/internal/MobilePopup/MobilePopup/MobilePopup.js.map +1 -1
- package/internal/MobilePopup/MobilePopup.d.ts +2 -2
- package/internal/Popup/Popup/Popup.js +9 -3
- package/internal/Popup/Popup/Popup.js.map +1 -1
- package/internal/Popup/Popup.d.ts +7 -2
- package/internal/PopupMenu/PopupMenu/PopupMenu.js +28 -5
- package/internal/PopupMenu/PopupMenu/PopupMenu.js.map +1 -1
- package/internal/PopupMenu/PopupMenu.d.ts +5 -2
- package/internal/ThemePlayground/SizesGroup/SizesGroup.js.map +1 -1
- package/internal/ThemePlayground/SizesGroup.d.ts +2 -1
- package/internal/ThemePlayground/darkTheme/darkTheme.js +1 -1
- package/internal/ThemePlayground/darkTheme/darkTheme.js.map +1 -1
- package/internal/ThemePlayground/darkTheme.d.ts +1 -1
- package/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
- package/internal/themes/DarkTheme/DarkTheme.js +13 -0
- package/internal/themes/DarkTheme/DarkTheme.js.map +1 -1
- package/internal/themes/DarkTheme.d.ts +2 -0
- package/internal/themes/DefaultTheme/DefaultTheme.js +750 -106
- package/internal/themes/DefaultTheme/DefaultTheme.js.map +1 -1
- package/internal/themes/DefaultTheme.d.ts +280 -19
- package/internal/themes/Theme2022/Theme2022.js +79 -56
- package/internal/themes/Theme2022/Theme2022.js.map +1 -1
- package/internal/themes/Theme2022.d.ts +28 -4
- package/internal/themes/Theme2022Dark/Theme2022Dark.js +11 -26
- package/internal/themes/Theme2022Dark/Theme2022Dark.js.map +1 -1
- package/internal/themes/Theme2022Dark.d.ts +5 -7
- package/lib/locale/types/types.js.map +1 -1
- package/lib/locale/types.d.ts +6 -0
- package/lib/rootNode/rootNodeDecorator/rootNodeDecorator.js +4 -3
- package/lib/rootNode/rootNodeDecorator/rootNodeDecorator.js.map +1 -1
- package/lib/rootNode/rootNodeDecorator.d.ts +5 -1
- package/lib/styles/getLabGrotesqueBaselineCompensation/getLabGrotesqueBaselineCompensation.js +2 -2
- package/lib/styles/getLabGrotesqueBaselineCompensation/getLabGrotesqueBaselineCompensation.js.map +1 -1
- package/lib/styles/getLabGrotesqueBaselineCompensation.d.ts +1 -1
- package/lib/types/props/package.json +6 -0
- package/lib/types/props/props.js +1 -0
- package/lib/types/props/props.js.map +1 -0
- package/lib/types/props.d.ts +1 -0
- package/package.json +4 -3
|
@@ -9,6 +9,7 @@ var _Emotion = require("../../lib/theming/Emotion");
|
|
|
9
9
|
var _client = require("../../lib/client");
|
|
10
10
|
var _getDOMRect = require("../../lib/dom/getDOMRect");
|
|
11
11
|
|
|
12
|
+
|
|
12
13
|
var _DropdownContainer = require("./DropdownContainer.styles");
|
|
13
14
|
var _getManualPosition = require("./getManualPosition");function _getRequireWildcardCache(nodeInterop) {if (typeof WeakMap !== "function") return null;var cacheBabelInterop = new WeakMap();var cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}var
|
|
14
15
|
|
|
@@ -38,6 +39,8 @@ var _getManualPosition = require("./getManualPosition");function _getRequireWild
|
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
|
|
42
|
+
|
|
43
|
+
|
|
41
44
|
|
|
42
45
|
|
|
43
46
|
|
|
@@ -104,6 +107,8 @@ DropdownContainer = /*#__PURE__*/function (_React$PureComponent) {(0, _inheritsL
|
|
|
104
107
|
|
|
105
108
|
|
|
106
109
|
|
|
110
|
+
|
|
111
|
+
|
|
107
112
|
|
|
108
113
|
|
|
109
114
|
|
|
@@ -201,7 +206,7 @@ DropdownContainer = /*#__PURE__*/function (_React$PureComponent) {(0, _inheritsL
|
|
|
201
206
|
left: offsetX,
|
|
202
207
|
right: null };
|
|
203
208
|
|
|
204
|
-
};_this.state = { position: null, minWidth: 0, isDocumentElementRoot: getIsDocumentElementRoot() };return _this;}var _proto = DropdownContainer.prototype;_proto.componentDidMount = function componentDidMount() {this.position();this.layoutSub = LayoutEvents.addListener(this.position);};_proto.componentWillUnmount = function componentWillUnmount() {if (this.layoutSub) {this.layoutSub.remove();}};_proto.render = function render() {var _cx;var style = { position: 'absolute', top: '0' };if (this.state.position) {var _this$state$position = this.state.position,top = _this$state$position.top,bottom = _this$state$position.bottom,left = _this$state$position.left,right = _this$state$position.right;style = (0, _extends2.default)({}, style, { top: top !== null ? top : undefined, bottom: bottom !== null ? bottom : undefined, left: left !== null ? left : undefined, right: right !== null ? right : undefined, minWidth: this.state.minWidth, maxWidth: this.props.hasFixedWidth ? this.state.minWidth : undefined });}var content = /*#__PURE__*/_react.default.createElement(_ZIndex.ZIndex, { priority: 'DropdownContainer', wrapperRef: this.ZIndexRef, style: style, className: (0, _Emotion.cx)((_cx = {}, _cx[_DropdownContainer.styles.alignRight()] = this.getProps().align === 'right' && !_client.isIE11, _cx)) }, this.props.children);return this.props.disablePortal ? content : /*#__PURE__*/_react.default.createElement(_RenderContainer.RenderContainer, null, content);};return DropdownContainer;}(_react.default.PureComponent);exports.DropdownContainer = DropdownContainer;DropdownContainer.__KONTUR_REACT_UI__ = 'DropdownContainer';DropdownContainer.defaultProps = { align: 'left', disablePortal: false, offsetX: 0, offsetY: -1 };
|
|
209
|
+
};_this.state = { position: null, minWidth: 0, isDocumentElementRoot: getIsDocumentElementRoot() };return _this;}var _proto = DropdownContainer.prototype;_proto.componentDidMount = function componentDidMount() {this.position();this.layoutSub = LayoutEvents.addListener(this.position);};_proto.componentWillUnmount = function componentWillUnmount() {if (this.layoutSub) {this.layoutSub.remove();}};_proto.render = function render() {var _cx;var style = { position: 'absolute', top: '0' };if (this.state.position) {var _this$state$position = this.state.position,top = _this$state$position.top,bottom = _this$state$position.bottom,left = _this$state$position.left,right = _this$state$position.right;style = (0, _extends2.default)({}, style, { top: top !== null ? top : undefined, bottom: bottom !== null ? bottom : undefined, left: left !== null ? left : undefined, right: right !== null ? right : undefined, minWidth: this.state.minWidth, maxWidth: this.props.hasFixedWidth ? this.state.minWidth : undefined });}var content = /*#__PURE__*/_react.default.createElement(_ZIndex.ZIndex, { "data-tid": this.props['data-tid'], id: this.props.id, priority: 'DropdownContainer', wrapperRef: this.ZIndexRef, style: style, className: (0, _Emotion.cx)((_cx = {}, _cx[_DropdownContainer.styles.alignRight()] = this.getProps().align === 'right' && !_client.isIE11, _cx)) }, this.props.children);return this.props.disablePortal ? content : /*#__PURE__*/_react.default.createElement(_RenderContainer.RenderContainer, null, content);};return DropdownContainer;}(_react.default.PureComponent);exports.DropdownContainer = DropdownContainer;DropdownContainer.__KONTUR_REACT_UI__ = 'DropdownContainer';DropdownContainer.defaultProps = { align: 'left', disablePortal: false, offsetX: 0, offsetY: -1 };
|
|
205
210
|
|
|
206
211
|
|
|
207
212
|
var getIsDocumentElementRoot = function getIsDocumentElementRoot() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["DropdownContainer.tsx"],"names":["DropdownContainer","props","getProps","defaultProps","ZIndexRef","element","dom","isElement","node","Element","position","target","getParent","targetRect","document","body","docEl","documentElement","Error","scrollX","window","pageXOffset","scrollLeft","scrollY","pageYOffset","scrollTop","left","right","align","docWidth","offsetWidth","offsetX","offsetY","bottom","top","distanceToBottom","clientHeight","dropdownHeight","getHeight","state","isDocumentElementRoot","scrollHeight","menuPos","setState","minWidth","getMinWidth","disablePortal","convertToRelativePosition","child","children","item","height","width","targetHeight","getIsDocumentElementRoot","componentDidMount","layoutSub","LayoutEvents","addListener","componentWillUnmount","remove","render","style","undefined","maxWidth","hasFixedWidth","content","styles","alignRight","isIE11","React","PureComponent","__KONTUR_REACT_UI__","htmlPosition","getComputedStyle","bodyPosition","hasLimitedHeightRoot","hasStaticRoot"],"mappings":"+UAAA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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zD,eAAD,CAAhB,CAAkCP,QAAvD;AACA,MAAMiE,YAAY,GAAGD,gBAAgB,CAAC3D,IAAD,CAAhB,CAAuBL,QAA5C;;AAEA,MAAMkE,oBAAoB,GAAG7D,IAAI,CAAC0B,YAAL,GAAoB1B,IAAI,CAACqB,YAAtD;AACA,MAAMyC,aAAa,GAAGJ,YAAY,KAAK,QAAjB,IAA6BE,YAAY,KAAK,QAApE;AACA,SAAOC,oBAAoB,IAAIC,aAA/B;AACD,CARD","sourcesContent":["import React from 'react';\n\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport { RenderContainer } from '../RenderContainer';\nimport { ZIndex } from '../ZIndex';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { Nullable } from '../../typings/utility-types';\nimport { cx } from '../../lib/theming/Emotion';\nimport { isIE11 } from '../../lib/client';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\n\nimport { styles } from './DropdownContainer.styles';\nimport { getManualPosition, getTopAlignment } from './getManualPosition';\n\nexport interface DropdownContainerPosition {\n top: Nullable<number>;\n bottom: Nullable<number>;\n left: Nullable<number>;\n right: Nullable<number>;\n}\n\nexport interface DropdownContainerProps {\n align?: 'left' | 'right';\n getParent: () => Nullable<Element>;\n children?: React.ReactNode;\n disablePortal?: boolean;\n offsetY?: number;\n offsetX?: number;\n hasFixedWidth?: boolean;\n /**\n * Позволяет вручную задать текущую позицию выпадающего окна\n */\n menuPos?: 'top' | 'bottom';\n}\n\nexport interface DropdownContainerState {\n position: Nullable<DropdownContainerPosition>;\n minWidth: number;\n isDocumentElementRoot?: boolean;\n}\n\ntype DefaultProps = Required<Pick<DropdownContainerProps, 'align' | 'disablePortal' | 'offsetY' | 'offsetX'>>;\n\nexport class DropdownContainer extends React.PureComponent<DropdownContainerProps, DropdownContainerState> {\n public static __KONTUR_REACT_UI__ = 'DropdownContainer';\n\n public static defaultProps: DefaultProps = {\n align: 'left',\n disablePortal: false,\n offsetX: 0,\n offsetY: -1,\n };\n\n private getProps = createPropsGetter(DropdownContainer.defaultProps);\n\n private dom: Nullable<HTMLDivElement>;\n private layoutSub: Nullable<ReturnType<typeof LayoutEvents.addListener>>;\n\n constructor(props: DropdownContainerProps) {\n super(props);\n\n this.state = { position: null, minWidth: 0, isDocumentElementRoot: getIsDocumentElementRoot() };\n }\n\n public componentDidMount() {\n this.position();\n this.layoutSub = LayoutEvents.addListener(this.position);\n }\n\n public componentWillUnmount() {\n if (this.layoutSub) {\n this.layoutSub.remove();\n }\n }\n\n public render() {\n let style: React.CSSProperties = {\n position: 'absolute',\n top: '0',\n };\n if (this.state.position) {\n const { top, bottom, left, right } = this.state.position;\n style = {\n ...style,\n top: top !== null ? top : undefined,\n bottom: bottom !== null ? bottom : undefined,\n left: left !== null ? left : undefined,\n right: right !== null ? right : undefined,\n minWidth: this.state.minWidth,\n maxWidth: this.props.hasFixedWidth ? this.state.minWidth : undefined,\n };\n }\n\n const content = (\n <ZIndex\n priority={'DropdownContainer'}\n wrapperRef={this.ZIndexRef}\n style={style}\n className={cx({\n [styles.alignRight()]: this.getProps().align === 'right' && !isIE11,\n })}\n >\n {this.props.children}\n </ZIndex>\n );\n\n return this.props.disablePortal ? content : <RenderContainer>{content}</RenderContainer>;\n }\n\n private ZIndexRef = (element: Nullable<HTMLDivElement>) => {\n this.dom = element;\n };\n\n private isElement = (node: Nullable<Element>): node is Element => {\n return node instanceof Element;\n };\n\n public position = () => {\n const target = this.props.getParent();\n const dom = this.dom;\n\n if (target && this.isElement(target) && dom) {\n const targetRect = getDOMRect(target);\n const { body, documentElement: docEl } = document;\n\n if (!docEl) {\n throw Error('There is no \"documentElement\" in \"document\"');\n }\n\n const scrollX = window.pageXOffset || docEl.scrollLeft || 0;\n const scrollY = window.pageYOffset || docEl.scrollTop || 0;\n\n let left = null;\n let right = null;\n\n if (this.getProps().align === 'right') {\n const docWidth = docEl.offsetWidth || 0;\n right = docWidth - (targetRect.right + scrollX) + this.getProps().offsetX;\n } else {\n left = targetRect.left + scrollX + this.getProps().offsetX;\n }\n\n const offsetY = this.getProps().offsetY || 0;\n let bottom = null;\n let top: number | null = targetRect.bottom + scrollY + offsetY;\n\n const distanceToBottom = docEl.clientHeight - targetRect.bottom;\n const dropdownHeight = this.getHeight();\n\n const clientHeight = this.state.isDocumentElementRoot ? docEl.clientHeight : body.scrollHeight;\n if (distanceToBottom < dropdownHeight && targetRect.top > dropdownHeight) {\n top = null;\n bottom = getTopAlignment({ clientHeight, offsetY, scrollY, target });\n }\n\n const position = {\n top,\n left,\n right,\n bottom,\n ...getManualPosition({ menuPos: this.props.menuPos, target, offsetY, clientHeight, scrollY }),\n };\n\n this.setState({\n minWidth: this.getMinWidth(),\n position: this.getProps().disablePortal ? this.convertToRelativePosition(position) : position,\n });\n }\n };\n\n private getHeight = () => {\n if (!this.isElement(this.dom)) {\n return 0;\n }\n const child = this.dom.children.item(0);\n return getDOMRect(child).height;\n };\n\n private getMinWidth = () => {\n const target = this.props.getParent();\n return getDOMRect(target).width;\n };\n\n private convertToRelativePosition = (position: DropdownContainerPosition): DropdownContainerPosition => {\n const target = this.props.getParent();\n const offsetX = this.getProps().offsetX || 0;\n const offsetY = this.getProps().offsetY || 0;\n const { top, bottom, left, right } = position;\n if (target && this.isElement(target)) {\n const targetHeight = getDOMRect(target).height;\n return {\n top: top !== null ? targetHeight + offsetY : null,\n bottom: bottom !== null ? targetHeight + offsetY : null,\n left: left !== null ? offsetX : null,\n right: right !== null ? offsetX : null,\n };\n }\n return {\n top: offsetY,\n bottom: null,\n left: offsetX,\n right: null,\n };\n };\n}\n\nconst getIsDocumentElementRoot = () => {\n const { body, documentElement } = document;\n const htmlPosition = getComputedStyle(documentElement).position;\n const bodyPosition = getComputedStyle(body).position;\n\n const hasLimitedHeightRoot = body.scrollHeight > body.clientHeight;\n const hasStaticRoot = htmlPosition === 'static' && bodyPosition === 'static';\n return hasLimitedHeightRoot || hasStaticRoot;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["DropdownContainer.tsx"],"names":["DropdownContainer","props","getProps","defaultProps","ZIndexRef","element","dom","isElement","node","Element","position","target","getParent","targetRect","document","body","docEl","documentElement","Error","scrollX","window","pageXOffset","scrollLeft","scrollY","pageYOffset","scrollTop","left","right","align","docWidth","offsetWidth","offsetX","offsetY","bottom","top","distanceToBottom","clientHeight","dropdownHeight","getHeight","state","isDocumentElementRoot","scrollHeight","menuPos","setState","minWidth","getMinWidth","disablePortal","convertToRelativePosition","child","children","item","height","width","targetHeight","getIsDocumentElementRoot","componentDidMount","layoutSub","LayoutEvents","addListener","componentWillUnmount","remove","render","style","undefined","maxWidth","hasFixedWidth","content","id","styles","alignRight","isIE11","React","PureComponent","__KONTUR_REACT_UI__","htmlPosition","getComputedStyle","bodyPosition","hasLimitedHeightRoot","hasStaticRoot"],"mappings":"+UAAA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA,wD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCaA,iB;;;;;;;;;;;;;;;AAeX,6BAAYC,KAAZ,EAA2C;AACzC,4CAAMA,KAAN,UADyC,MALnCC,QAKmC,GALxB,0CAAkBF,iBAAiB,CAACG,YAApC,CAKwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDnCC,IAAAA,SArDmC,GAqDvB,UAACC,OAAD,EAAuC;AACzD,YAAKC,GAAL,GAAWD,OAAX;AACD,KAvD0C;;AAyDnCE,IAAAA,SAzDmC,GAyDvB,UAACC,IAAD,EAA8C;AAChE,aAAOA,IAAI,YAAYC,OAAvB;AACD,KA3D0C;;AA6DpCC,IAAAA,QA7DoC,GA6DzB,YAAM;AACtB,UAAMC,MAAM,GAAG,MAAKV,KAAL,CAAWW,SAAX,EAAf;AACA,UAAMN,GAAG,GAAG,MAAKA,GAAjB;;AAEA,UAAIK,MAAM,IAAI,MAAKJ,SAAL,CAAeI,MAAf,CAAV,IAAoCL,GAAxC,EAA6C;AAC3C,YAAMO,UAA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D,SAJnB,EAKE,KAAK,EAAE0D,KALT,EAME,SAAS,EAAE,gCACRM,0BAAOC,UAAP,EADQ,IACc,KAAKnE,QAAL,GAAgB0B,KAAhB,KAA0B,OAA1B,IAAqC,CAAC0C,cADpD,OANb,IAUG,KAAKrE,KAAL,CAAWgD,QAVd,CADF,CAeA,OAAO,KAAKhD,KAAL,CAAW6C,aAAX,GAA2BoB,OAA3B,gBAAqC,6BAAC,gCAAD,QAAkBA,OAAlB,CAA5C,CACD,C,4BAlEoCK,eAAMC,a,gDAAhCxE,iB,CACGyE,mB,GAAsB,mB,CADzBzE,iB,CAGGG,Y,GAA6B,EACzCyB,KAAK,EAAE,MADkC,EAEzCkB,aAAa,EAAE,KAF0B,EAGzCf,OAAO,EAAE,CAHgC,EAIzCC,OAAO,EAAE,CAAC,CAJ+B,E;;;AAkK7C,IAAMsB,wBAAwB,GAAG,SAA3BA,wBAA2B,GAAM;AACrC,mBAAkCxC,QAAlC,CAAQC,IAAR,cAAQA,IAAR,CAAcE,eAAd,cAAcA,eAAd;AACA,MAAMyD,YAAY,GAAGC,gBAAgB,CAAC1D,eAAD,CAAhB,CAAkCP,QAAvD;AACA,MAAMkE,YAAY,GAAGD,gBAAgB,CAAC5D,IAAD,CAAhB,CAAuBL,QAA5C;;AAEA,MAAMmE,oBAAoB,GAAG9D,IAAI,CAAC0B,YAAL,GAAoB1B,IAAI,CAACqB,YAAtD;AACA,MAAM0C,aAAa,GAAGJ,YAAY,KAAK,QAAjB,IAA6BE,YAAY,KAAK,QAApE;AACA,SAAOC,oBAAoB,IAAIC,aAA/B;AACD,CARD","sourcesContent":["import React, { HTMLAttributes } from 'react';\n\nimport * as LayoutEvents from '../../lib/LayoutEvents';\nimport { RenderContainer } from '../RenderContainer';\nimport { ZIndex } from '../ZIndex';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { Nullable } from '../../typings/utility-types';\nimport { cx } from '../../lib/theming/Emotion';\nimport { isIE11 } from '../../lib/client';\nimport { getDOMRect } from '../../lib/dom/getDOMRect';\nimport { CommonProps } from '../CommonWrapper';\n\nimport { styles } from './DropdownContainer.styles';\nimport { getManualPosition, getTopAlignment } from './getManualPosition';\n\nexport interface DropdownContainerPosition {\n top: Nullable<number>;\n bottom: Nullable<number>;\n left: Nullable<number>;\n right: Nullable<number>;\n}\n\nexport interface DropdownContainerProps\n extends Pick<CommonProps, 'data-tid'>,\n Pick<HTMLAttributes<HTMLDivElement>, 'id'> {\n align?: 'left' | 'right';\n getParent: () => Nullable<Element>;\n children?: React.ReactNode;\n disablePortal?: boolean;\n offsetY?: number;\n offsetX?: number;\n hasFixedWidth?: boolean;\n /**\n * Позволяет вручную задать текущую позицию выпадающего окна\n */\n menuPos?: 'top' | 'bottom';\n}\n\nexport interface DropdownContainerState {\n position: Nullable<DropdownContainerPosition>;\n minWidth: number;\n isDocumentElementRoot?: boolean;\n}\n\ntype DefaultProps = Required<Pick<DropdownContainerProps, 'align' | 'disablePortal' | 'offsetY' | 'offsetX'>>;\n\nexport class DropdownContainer extends React.PureComponent<DropdownContainerProps, DropdownContainerState> {\n public static __KONTUR_REACT_UI__ = 'DropdownContainer';\n\n public static defaultProps: DefaultProps = {\n align: 'left',\n disablePortal: false,\n offsetX: 0,\n offsetY: -1,\n };\n\n private getProps = createPropsGetter(DropdownContainer.defaultProps);\n\n private dom: Nullable<HTMLDivElement>;\n private layoutSub: Nullable<ReturnType<typeof LayoutEvents.addListener>>;\n\n constructor(props: DropdownContainerProps) {\n super(props);\n\n this.state = { position: null, minWidth: 0, isDocumentElementRoot: getIsDocumentElementRoot() };\n }\n\n public componentDidMount() {\n this.position();\n this.layoutSub = LayoutEvents.addListener(this.position);\n }\n\n public componentWillUnmount() {\n if (this.layoutSub) {\n this.layoutSub.remove();\n }\n }\n\n public render() {\n let style: React.CSSProperties = {\n position: 'absolute',\n top: '0',\n };\n if (this.state.position) {\n const { top, bottom, left, right } = this.state.position;\n style = {\n ...style,\n top: top !== null ? top : undefined,\n bottom: bottom !== null ? bottom : undefined,\n left: left !== null ? left : undefined,\n right: right !== null ? right : undefined,\n minWidth: this.state.minWidth,\n maxWidth: this.props.hasFixedWidth ? this.state.minWidth : undefined,\n };\n }\n\n const content = (\n <ZIndex\n data-tid={this.props['data-tid']}\n id={this.props.id}\n priority={'DropdownContainer'}\n wrapperRef={this.ZIndexRef}\n style={style}\n className={cx({\n [styles.alignRight()]: this.getProps().align === 'right' && !isIE11,\n })}\n >\n {this.props.children}\n </ZIndex>\n );\n\n return this.props.disablePortal ? content : <RenderContainer>{content}</RenderContainer>;\n }\n\n private ZIndexRef = (element: Nullable<HTMLDivElement>) => {\n this.dom = element;\n };\n\n private isElement = (node: Nullable<Element>): node is Element => {\n return node instanceof Element;\n };\n\n public position = () => {\n const target = this.props.getParent();\n const dom = this.dom;\n\n if (target && this.isElement(target) && dom) {\n const targetRect = getDOMRect(target);\n const { body, documentElement: docEl } = document;\n\n if (!docEl) {\n throw Error('There is no \"documentElement\" in \"document\"');\n }\n\n const scrollX = window.pageXOffset || docEl.scrollLeft || 0;\n const scrollY = window.pageYOffset || docEl.scrollTop || 0;\n\n let left = null;\n let right = null;\n\n if (this.getProps().align === 'right') {\n const docWidth = docEl.offsetWidth || 0;\n right = docWidth - (targetRect.right + scrollX) + this.getProps().offsetX;\n } else {\n left = targetRect.left + scrollX + this.getProps().offsetX;\n }\n\n const offsetY = this.getProps().offsetY || 0;\n let bottom = null;\n let top: number | null = targetRect.bottom + scrollY + offsetY;\n\n const distanceToBottom = docEl.clientHeight - targetRect.bottom;\n const dropdownHeight = this.getHeight();\n\n const clientHeight = this.state.isDocumentElementRoot ? docEl.clientHeight : body.scrollHeight;\n if (distanceToBottom < dropdownHeight && targetRect.top > dropdownHeight) {\n top = null;\n bottom = getTopAlignment({ clientHeight, offsetY, scrollY, target });\n }\n\n const position = {\n top,\n left,\n right,\n bottom,\n ...getManualPosition({ menuPos: this.props.menuPos, target, offsetY, clientHeight, scrollY }),\n };\n\n this.setState({\n minWidth: this.getMinWidth(),\n position: this.getProps().disablePortal ? this.convertToRelativePosition(position) : position,\n });\n }\n };\n\n private getHeight = () => {\n if (!this.isElement(this.dom)) {\n return 0;\n }\n const child = this.dom.children.item(0);\n return getDOMRect(child).height;\n };\n\n private getMinWidth = () => {\n const target = this.props.getParent();\n return getDOMRect(target).width;\n };\n\n private convertToRelativePosition = (position: DropdownContainerPosition): DropdownContainerPosition => {\n const target = this.props.getParent();\n const offsetX = this.getProps().offsetX || 0;\n const offsetY = this.getProps().offsetY || 0;\n const { top, bottom, left, right } = position;\n if (target && this.isElement(target)) {\n const targetHeight = getDOMRect(target).height;\n return {\n top: top !== null ? targetHeight + offsetY : null,\n bottom: bottom !== null ? targetHeight + offsetY : null,\n left: left !== null ? offsetX : null,\n right: right !== null ? offsetX : null,\n };\n }\n return {\n top: offsetY,\n bottom: null,\n left: offsetX,\n right: null,\n };\n };\n}\n\nconst getIsDocumentElementRoot = () => {\n const { body, documentElement } = document;\n const htmlPosition = getComputedStyle(documentElement).position;\n const bodyPosition = getComputedStyle(body).position;\n\n const hasLimitedHeightRoot = body.scrollHeight > body.clientHeight;\n const hasStaticRoot = htmlPosition === 'static' && bodyPosition === 'static';\n return hasLimitedHeightRoot || hasStaticRoot;\n};\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FileUploaderAttachedFile } from '../fileUtils';
|
|
2
|
-
import {
|
|
2
|
+
import { SizeProp } from '../../../lib/types/props';
|
|
3
3
|
interface FileUploaderFileProps {
|
|
4
4
|
file: FileUploaderAttachedFile;
|
|
5
5
|
showSize?: boolean;
|
|
6
6
|
multiple?: boolean;
|
|
7
|
-
size:
|
|
7
|
+
size: SizeProp;
|
|
8
8
|
/** Состояние ошибки контрола файла */
|
|
9
9
|
error?: boolean;
|
|
10
10
|
}
|
|
@@ -15,8 +15,5 @@ export declare const FileUploaderFileDataTids: {
|
|
|
15
15
|
readonly fileSize: "FileUploader__fileSize";
|
|
16
16
|
readonly fileIcon: "FileUploader__fileIcon";
|
|
17
17
|
};
|
|
18
|
-
export declare const FileUploaderFile:
|
|
19
|
-
(props: FileUploaderFileProps): JSX.Element;
|
|
20
|
-
displayName: string;
|
|
21
|
-
};
|
|
18
|
+
export declare const FileUploaderFile: import("../../../lib/forwardRefAndName").ReactUIComponentWithRef<HTMLDivElement, FileUploaderFileProps>;
|
|
22
19
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";exports.__esModule = true;exports.FileUploaderFileDataTids = exports.FileUploaderFile = void 0;var _react = _interopRequireWildcard(require("react"));
|
|
2
2
|
|
|
3
|
+
var _forwardRefAndName = require("../../../lib/forwardRefAndName");
|
|
3
4
|
|
|
4
5
|
var _utils = require("../../../lib/utils");
|
|
5
|
-
var _TextWidthHelper = require("
|
|
6
|
+
var _TextWidthHelper = require("../../TextWidthHelper/TextWidthHelper");
|
|
6
7
|
var _stringUtils = require("../../../lib/stringUtils");
|
|
7
8
|
var _FileUploaderControlContext = require("../FileUploaderControlContext");
|
|
8
9
|
var _Emotion = require("../../../lib/theming/Emotion");
|
|
@@ -13,9 +14,9 @@ var _identifiers = require("../../../lib/events/keyboard/identifiers");
|
|
|
13
14
|
var _Hint = require("../../../components/Hint");
|
|
14
15
|
var _Tooltip = require("../../../components/Tooltip");
|
|
15
16
|
var _getDOMRect = require("../../../lib/dom/getDOMRect");
|
|
16
|
-
|
|
17
17
|
var _useFileUploaderSize = require("../hooks/useFileUploaderSize");
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
var _FileUploaderFile = require("./FileUploaderFile.styles");
|
|
20
21
|
var _FileUploaderFileStatusIcon = require("./FileUploaderFileStatusIcon");function _getRequireWildcardCache(nodeInterop) {if (typeof WeakMap !== "function") return null;var cacheBabelInterop = new WeakMap();var cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
|
|
21
22
|
|
|
@@ -64,7 +65,9 @@ var FileUploaderFileDataTids = {
|
|
|
64
65
|
fileIcon: 'FileUploader__fileIcon' };exports.FileUploaderFileDataTids = FileUploaderFileDataTids;
|
|
65
66
|
|
|
66
67
|
|
|
67
|
-
var FileUploaderFile =
|
|
68
|
+
var FileUploaderFile = (0, _forwardRefAndName.forwardRefAndName)(
|
|
69
|
+
'FileUploaderFile',
|
|
70
|
+
function (props, ref) {var _cx, _cx2;
|
|
68
71
|
var file = props.file,showSize = props.showSize,error = props.error,multiple = props.multiple,size = props.size;
|
|
69
72
|
var id = file.id,originalFile = file.originalFile,status = file.status,validationResult = file.validationResult;
|
|
70
73
|
var name = originalFile.name,fileSize = originalFile.size;
|
|
@@ -177,7 +180,8 @@ var FileUploaderFile = function FileUploaderFile(props) {var _cx, _cx2;
|
|
|
177
180
|
"data-tid": FileUploaderFileDataTids.file,
|
|
178
181
|
className: _FileUploaderFile.jsStyles.root(),
|
|
179
182
|
onMouseEnter: handleMouseEnter,
|
|
180
|
-
onMouseLeave: handleMouseLeave
|
|
183
|
+
onMouseLeave: handleMouseLeave,
|
|
184
|
+
ref: ref }, /*#__PURE__*/
|
|
181
185
|
|
|
182
186
|
_react.default.createElement(_Tooltip.Tooltip, { "data-tid": FileUploaderFileDataTids.fileTooltip, pos: "right middle", render: renderTooltipContent }, /*#__PURE__*/
|
|
183
187
|
_react.default.createElement("div", { className: contentClassNames }, /*#__PURE__*/
|
|
@@ -213,6 +217,4 @@ var FileUploaderFile = function FileUploaderFile(props) {var _cx, _cx2;
|
|
|
213
217
|
|
|
214
218
|
|
|
215
219
|
|
|
216
|
-
};exports.FileUploaderFile = FileUploaderFile;
|
|
217
|
-
|
|
218
|
-
FileUploaderFile.displayName = 'FileUploaderFile';
|
|
220
|
+
});exports.FileUploaderFile = FileUploaderFile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FileUploaderFile.tsx"],"names":["getTruncatedName","fileNameWidth","fileNameElementWidth","name","charWidth","Math","ceil","length","maxCharsCountInSpan","calcTruncatedName","textHelperRef","fileNameElementRef","current","getTextWidth","width","MIN_CHARS_LENGTH","FileUploaderFileDataTids","file","fileTooltip","fileName","fileSize","fileIcon","FileUploaderFile","props","showSize","error","multiple","size","id","originalFile","status","validationResult","hovered","setHovered","focusedByTab","setFocusedByTab","truncatedFileName","setTruncatedFileName","FileUploaderControlContext","removeFile","setIsMinLengthReached","isMinLengthReached","theme","ThemeContext","formattedSize","truncatedName","removeUploadFile","handleRemove","event","preventDefault","stopPropagation","isValid","message","isInvalid","sizeIconClass","small","jsStyles","iconSmall","medium","iconMedium","large","iconLarge","renderTooltipContent","sizeContentClass","contentSmall","contentMedium","contentLarge","contentClassNames","content","handleMouseEnter","handleMouseLeave","handleFocus","requestAnimationFrame","keyListener","isTabPressed","handleBlur","handleIconKeyDown","e","iconClassNames","icon","focusedIcon","iconMultiple","isTruncated","root","displayName"],"mappings":"4GAAA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,0E;;;;;;;;;;;AAWA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,aAAD,EAAwBC,oBAAxB,EAAsDC,IAAtD,EAAuE;AAC9F,MAAI,CAACF,aAAD,IAAkB,CAACC,oBAAv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AuJPL,gBAAgB,CAAC8D,WAAjB,GAA+B,kBAA/B","sourcesContent":["import React, { ReactNode, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { FileUploaderAttachedFile } from '../fileUtils';\nimport { formatBytes } from '../../../lib/utils';\nimport { TextWidthHelper } from '../../../internal/TextWidthHelper/TextWidthHelper';\nimport { truncate } from '../../../lib/stringUtils';\nimport { FileUploaderControlContext } from '../FileUploaderControlContext';\nimport { cx } from '../../../lib/theming/Emotion';\nimport { ThemeContext } from '../../../lib/theming/ThemeContext';\nimport { keyListener } from '../../../lib/events/keyListener';\nimport { isKeyEnter } from '../../../lib/events/keyboard/identifiers';\nimport { Nullable } from '../../../typings/utility-types';\nimport { Hint } from '../../../components/Hint';\nimport { Tooltip } from '../../../components/Tooltip';\nimport { getDOMRect } from '../../../lib/dom/getDOMRect';\nimport { FileUploaderSize } from '../../../components/FileUploader';\nimport { useFileUploaderSize } from '../hooks/useFileUploaderSize';\n\nimport { jsStyles } from './FileUploaderFile.styles';\nimport { FileUploaderFileStatusIcon } from './FileUploaderFileStatusIcon';\n\ninterface FileUploaderFileProps {\n file: FileUploaderAttachedFile;\n showSize?: boolean;\n multiple?: boolean;\n size: FileUploaderSize;\n /** Состояние ошибки контрола файла */\n error?: boolean;\n}\n\nconst getTruncatedName = (fileNameWidth: number, fileNameElementWidth: number, name: string) => {\n if (!fileNameWidth && !fileNameElementWidth) {\n return null;\n }\n\n if (fileNameWidth <= fileNameElementWidth) {\n return name;\n }\n\n const charWidth = Math.ceil(fileNameWidth / name.length);\n const maxCharsCountInSpan = Math.ceil(fileNameElementWidth / charWidth);\n\n return truncate(name, maxCharsCountInSpan);\n};\n\nconst calcTruncatedName = (\n textHelperRef: React.RefObject<TextWidthHelper>,\n fileNameElementRef: React.RefObject<HTMLSpanElement>,\n name: string,\n) => {\n const fileNameWidth = textHelperRef.current?.getTextWidth() || 0;\n const fileNameElementWidth = getDOMRect(fileNameElementRef.current).width;\n\n return getTruncatedName(fileNameWidth, fileNameElementWidth, name);\n};\n\nconst MIN_CHARS_LENGTH = 3;\n\nexport const FileUploaderFileDataTids = {\n file: 'FileUploader__file',\n fileTooltip: 'FileUploader__fileTooltip',\n fileName: 'FileUploader__fileName',\n fileSize: 'FileUploader__fileSize',\n fileIcon: 'FileUploader__fileIcon',\n} as const;\n\nexport const FileUploaderFile = (props: FileUploaderFileProps) => {\n const { file, showSize, error, multiple, size } = props;\n const { id, originalFile, status, validationResult } = file;\n const { name, size: fileSize } = originalFile;\n\n const [hovered, setHovered] = useState<boolean>(false);\n const [focusedByTab, setFocusedByTab] = useState(false);\n const [truncatedFileName, setTruncatedFileName] = useState<Nullable<string>>(null);\n\n const textHelperRef = useRef<TextWidthHelper>(null);\n const fileNameElementRef = useRef<HTMLSpanElement>(null);\n\n const { removeFile, setIsMinLengthReached, isMinLengthReached } = useContext(FileUploaderControlContext);\n const theme = useContext(ThemeContext);\n\n const formattedSize = useMemo(() => formatBytes(fileSize, 1), [fileSize]);\n\n useEffect(() => {\n if (setIsMinLengthReached) {\n const truncatedName = calcTruncatedName(textHelperRef, fileNameElementRef, name);\n\n setIsMinLengthReached((truncatedName?.length ?? 0) <= MIN_CHARS_LENGTH);\n }\n }, [name, isMinLengthReached]);\n\n useEffect(() => {\n const truncatedName = calcTruncatedName(textHelperRef, fileNameElementRef, name);\n\n setTruncatedFileName(truncatedName);\n });\n\n const removeUploadFile = useCallback(() => {\n removeFile(id);\n }, [removeFile, id]);\n\n const handleRemove = useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n event.preventDefault();\n event.stopPropagation();\n removeUploadFile();\n },\n [removeUploadFile],\n );\n\n const { isValid, message } = validationResult;\n\n const isInvalid = error || !isValid;\n\n const sizeIconClass = useFileUploaderSize(size, {\n small: jsStyles.iconSmall(),\n medium: jsStyles.iconMedium(),\n large: jsStyles.iconLarge(),\n });\n\n const renderTooltipContent = useCallback((): ReactNode => {\n return !isValid && !error && message ? message : null;\n }, [isValid, error, message]);\n\n const sizeContentClass = useFileUploaderSize(size, {\n small: jsStyles.contentSmall(theme),\n medium: jsStyles.contentMedium(theme),\n large: jsStyles.contentLarge(theme),\n });\n\n const contentClassNames = cx(jsStyles.content(), {\n [sizeContentClass]: true,\n [jsStyles.error(theme)]: isInvalid,\n });\n\n const handleMouseEnter = useCallback(() => {\n setHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n }, []);\n\n const handleFocus = useCallback(() => {\n // focus event fires before keyDown eventlistener\n // so we should check tabPressed in async way\n requestAnimationFrame(() => {\n if (keyListener.isTabPressed) {\n setFocusedByTab(true);\n }\n });\n }, []);\n\n const handleBlur = useCallback(() => {\n setFocusedByTab(false);\n }, []);\n\n const handleIconKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (isKeyEnter(e)) {\n removeUploadFile();\n }\n },\n [removeUploadFile],\n );\n\n const iconClassNames = cx(jsStyles.icon(theme), {\n [jsStyles.focusedIcon(theme)]: focusedByTab,\n [sizeIconClass]: true,\n [jsStyles.iconMultiple()]: multiple,\n });\n\n const isTruncated = truncatedFileName !== name;\n\n return (\n <div\n data-tid={FileUploaderFileDataTids.file}\n className={jsStyles.root()}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <Tooltip data-tid={FileUploaderFileDataTids.fileTooltip} pos=\"right middle\" render={renderTooltipContent}>\n <div className={contentClassNames}>\n <TextWidthHelper ref={textHelperRef} text={name} />\n <Hint maxWidth={'100%'} text={isTruncated ? name : null}>\n <span data-tid={FileUploaderFileDataTids.fileName} ref={fileNameElementRef} className={jsStyles.name()}>\n {truncatedFileName}\n </span>\n </Hint>\n {!!showSize && formattedSize && (\n <span data-tid={FileUploaderFileDataTids.fileSize} className={jsStyles.size()}>\n {formattedSize}\n </span>\n )}\n <div\n className={iconClassNames}\n data-tid={FileUploaderFileDataTids.fileIcon}\n tabIndex={0}\n onClick={handleRemove}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleIconKeyDown}\n >\n <FileUploaderFileStatusIcon\n status={status}\n hovered={hovered}\n focusedByTab={focusedByTab}\n isInvalid={isInvalid}\n size={size}\n />\n </div>\n </div>\n </Tooltip>\n </div>\n );\n};\n\nFileUploaderFile.displayName = 'FileUploaderFile';\n"]}
|
|
1
|
+
{"version":3,"sources":["FileUploaderFile.tsx"],"names":["getTruncatedName","fileNameWidth","fileNameElementWidth","name","charWidth","Math","ceil","length","maxCharsCountInSpan","calcTruncatedName","textHelperRef","fileNameElementRef","current","getTextWidth","width","MIN_CHARS_LENGTH","FileUploaderFileDataTids","file","fileTooltip","fileName","fileSize","fileIcon","FileUploaderFile","props","ref","showSize","error","multiple","size","id","originalFile","status","validationResult","hovered","setHovered","focusedByTab","setFocusedByTab","truncatedFileName","setTruncatedFileName","FileUploaderControlContext","removeFile","setIsMinLengthReached","isMinLengthReached","theme","ThemeContext","formattedSize","truncatedName","removeUploadFile","handleRemove","event","preventDefault","stopPropagation","isValid","message","isInvalid","sizeIconClass","small","jsStyles","iconSmall","medium","iconMedium","large","iconLarge","renderTooltipContent","sizeContentClass","contentSmall","contentMedium","contentLarge","contentClassNames","content","handleMouseEnter","handleMouseLeave","handleFocus","requestAnimationFrame","keyListener","isTabPressed","handleBlur","handleIconKeyDown","e","iconClassNames","icon","focusedIcon","iconMultiple","isTruncated","root"],"mappings":"4GAAA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA,0E;;;;;;;;;;;AAWA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,aAAD,EAAwBC,oBAAxB,EAAsDC,IAAtD,EAAuE;AAC9F,MAAI,CAACF,aAAD,IAAkB,CAACC,oBAAvB,EAA6C;AAC3C,WAAO,IAAP;AACD;;AAED,MAAID,aAAa,IAAIC,oBAArB,EAA2C;AACzC,WAAOC,IAAP;AACD;;AAED,MAAMC,SAAS,GAAGC,IAAI,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;AAIE,MAAA,YAAY,EAAEC,gBAJhB;AAKE,MAAA,GAAG,EAAE/C,GALP;;AAOE,iCAAC,gBAAD,IAAS,YAAUR,wBAAwB,CAACE,WAA5C,EAAyD,GAAG,EAAC,cAA7D,EAA4E,MAAM,EAAE6C,oBAApF;AACE,0CAAK,SAAS,EAAEK,iBAAhB;AACE,iCAAC,gCAAD,IAAiB,GAAG,EAAE1D,aAAtB,EAAqC,IAAI,EAAEP,IAA3C,GADF;AAEE,iCAAC,UAAD,IAAM,QAAQ,EAAE,MAAhB,EAAwB,IAAI,EAAEgF,WAAW,GAAGhF,IAAH,GAAU,IAAnD;AACE,2CAAM,YAAUa,wBAAwB,CAACG,QAAzC,EAAmD,GAAG,EAAER,kBAAxD,EAA4E,SAAS,EAAE8C,2BAAStD,IAAT,EAAvF;AACGkC,IAAAA,iBADH,CADF,CAFF;;;AAOG,KAAC,CAACZ,QAAF,IAAcoB,aAAd;AACC,2CAAM,YAAU7B,wBAAwB,CAACI,QAAzC,EAAmD,SAAS,EAAEqC,2BAAS7B,IAAT,EAA9D;AACGiB,IAAAA,aADH,CARJ;;;AAYE;AACE,MAAA,SAAS,EAAEkC,cADb;AAEE,kBAAU/D,wBAAwB,CAACK,QAFrC;AAGE,MAAA,QAAQ,EAAE,CAHZ;AAIE,MAAA,OAAO,EAAE2B,YAJX;AAKE,MAAA,OAAO,EAAEwB,WALX;AAME,MAAA,MAAM,EAAEI,UANV;AAOE,MAAA,SAAS,EAAEC,iBAPb;;AASE,iCAAC,sDAAD;AACE,MAAA,MAAM,EAAE9C,MADV;AAEE,MAAA,OAAO,EAAEE,OAFX;AAGE,MAAA,YAAY,EAAEE,YAHhB;AAIE,MAAA,SAAS,EAAEmB,SAJb;AAKE,MAAA,IAAI,EAAE1B,IALR,GATF,CAZF,CADF,CAPF,CADF;;;;;;;AA0CD,CAxJ6B,CAAzB,C","sourcesContent":["import React, { ReactNode, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { forwardRefAndName } from '../../../lib/forwardRefAndName';\nimport { FileUploaderAttachedFile } from '../fileUtils';\nimport { formatBytes } from '../../../lib/utils';\nimport { TextWidthHelper } from '../../TextWidthHelper/TextWidthHelper';\nimport { truncate } from '../../../lib/stringUtils';\nimport { FileUploaderControlContext } from '../FileUploaderControlContext';\nimport { cx } from '../../../lib/theming/Emotion';\nimport { ThemeContext } from '../../../lib/theming/ThemeContext';\nimport { keyListener } from '../../../lib/events/keyListener';\nimport { isKeyEnter } from '../../../lib/events/keyboard/identifiers';\nimport { Nullable } from '../../../typings/utility-types';\nimport { Hint } from '../../../components/Hint';\nimport { Tooltip } from '../../../components/Tooltip';\nimport { getDOMRect } from '../../../lib/dom/getDOMRect';\nimport { useFileUploaderSize } from '../hooks/useFileUploaderSize';\nimport { SizeProp } from '../../../lib/types/props';\n\nimport { jsStyles } from './FileUploaderFile.styles';\nimport { FileUploaderFileStatusIcon } from './FileUploaderFileStatusIcon';\n\ninterface FileUploaderFileProps {\n file: FileUploaderAttachedFile;\n showSize?: boolean;\n multiple?: boolean;\n size: SizeProp;\n /** Состояние ошибки контрола файла */\n error?: boolean;\n}\n\nconst getTruncatedName = (fileNameWidth: number, fileNameElementWidth: number, name: string) => {\n if (!fileNameWidth && !fileNameElementWidth) {\n return null;\n }\n\n if (fileNameWidth <= fileNameElementWidth) {\n return name;\n }\n\n const charWidth = Math.ceil(fileNameWidth / name.length);\n const maxCharsCountInSpan = Math.ceil(fileNameElementWidth / charWidth);\n\n return truncate(name, maxCharsCountInSpan);\n};\n\nconst calcTruncatedName = (\n textHelperRef: React.RefObject<TextWidthHelper>,\n fileNameElementRef: React.RefObject<HTMLSpanElement>,\n name: string,\n) => {\n const fileNameWidth = textHelperRef.current?.getTextWidth() || 0;\n const fileNameElementWidth = getDOMRect(fileNameElementRef.current).width;\n\n return getTruncatedName(fileNameWidth, fileNameElementWidth, name);\n};\n\nconst MIN_CHARS_LENGTH = 3;\n\nexport const FileUploaderFileDataTids = {\n file: 'FileUploader__file',\n fileTooltip: 'FileUploader__fileTooltip',\n fileName: 'FileUploader__fileName',\n fileSize: 'FileUploader__fileSize',\n fileIcon: 'FileUploader__fileIcon',\n} as const;\n\nexport const FileUploaderFile = forwardRefAndName<HTMLDivElement, FileUploaderFileProps>(\n 'FileUploaderFile',\n (props, ref) => {\n const { file, showSize, error, multiple, size } = props;\n const { id, originalFile, status, validationResult } = file;\n const { name, size: fileSize } = originalFile;\n\n const [hovered, setHovered] = useState<boolean>(false);\n const [focusedByTab, setFocusedByTab] = useState(false);\n const [truncatedFileName, setTruncatedFileName] = useState<Nullable<string>>(null);\n\n const textHelperRef = useRef<TextWidthHelper>(null);\n const fileNameElementRef = useRef<HTMLSpanElement>(null);\n\n const { removeFile, setIsMinLengthReached, isMinLengthReached } = useContext(FileUploaderControlContext);\n const theme = useContext(ThemeContext);\n\n const formattedSize = useMemo(() => formatBytes(fileSize, 1), [fileSize]);\n\n useEffect(() => {\n if (setIsMinLengthReached) {\n const truncatedName = calcTruncatedName(textHelperRef, fileNameElementRef, name);\n\n setIsMinLengthReached((truncatedName?.length ?? 0) <= MIN_CHARS_LENGTH);\n }\n }, [name, isMinLengthReached]);\n\n useEffect(() => {\n const truncatedName = calcTruncatedName(textHelperRef, fileNameElementRef, name);\n\n setTruncatedFileName(truncatedName);\n });\n\n const removeUploadFile = useCallback(() => {\n removeFile(id);\n }, [removeFile, id]);\n\n const handleRemove = useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n event.preventDefault();\n event.stopPropagation();\n removeUploadFile();\n },\n [removeUploadFile],\n );\n\n const { isValid, message } = validationResult;\n\n const isInvalid = error || !isValid;\n\n const sizeIconClass = useFileUploaderSize(size, {\n small: jsStyles.iconSmall(),\n medium: jsStyles.iconMedium(),\n large: jsStyles.iconLarge(),\n });\n\n const renderTooltipContent = useCallback((): ReactNode => {\n return !isValid && !error && message ? message : null;\n }, [isValid, error, message]);\n\n const sizeContentClass = useFileUploaderSize(size, {\n small: jsStyles.contentSmall(theme),\n medium: jsStyles.contentMedium(theme),\n large: jsStyles.contentLarge(theme),\n });\n\n const contentClassNames = cx(jsStyles.content(), {\n [sizeContentClass]: true,\n [jsStyles.error(theme)]: isInvalid,\n });\n\n const handleMouseEnter = useCallback(() => {\n setHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setHovered(false);\n }, []);\n\n const handleFocus = useCallback(() => {\n // focus event fires before keyDown eventlistener\n // so we should check tabPressed in async way\n requestAnimationFrame(() => {\n if (keyListener.isTabPressed) {\n setFocusedByTab(true);\n }\n });\n }, []);\n\n const handleBlur = useCallback(() => {\n setFocusedByTab(false);\n }, []);\n\n const handleIconKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (isKeyEnter(e)) {\n removeUploadFile();\n }\n },\n [removeUploadFile],\n );\n\n const iconClassNames = cx(jsStyles.icon(theme), {\n [jsStyles.focusedIcon(theme)]: focusedByTab,\n [sizeIconClass]: true,\n [jsStyles.iconMultiple()]: multiple,\n });\n\n const isTruncated = truncatedFileName !== name;\n\n return (\n <div\n data-tid={FileUploaderFileDataTids.file}\n className={jsStyles.root()}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n ref={ref}\n >\n <Tooltip data-tid={FileUploaderFileDataTids.fileTooltip} pos=\"right middle\" render={renderTooltipContent}>\n <div className={contentClassNames}>\n <TextWidthHelper ref={textHelperRef} text={name} />\n <Hint maxWidth={'100%'} text={isTruncated ? name : null}>\n <span data-tid={FileUploaderFileDataTids.fileName} ref={fileNameElementRef} className={jsStyles.name()}>\n {truncatedFileName}\n </span>\n </Hint>\n {!!showSize && formattedSize && (\n <span data-tid={FileUploaderFileDataTids.fileSize} className={jsStyles.size()}>\n {formattedSize}\n </span>\n )}\n <div\n className={iconClassNames}\n data-tid={FileUploaderFileDataTids.fileIcon}\n tabIndex={0}\n onClick={handleRemove}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleIconKeyDown}\n >\n <FileUploaderFileStatusIcon\n status={status}\n hovered={hovered}\n focusedByTab={focusedByTab}\n isInvalid={isInvalid}\n size={size}\n />\n </div>\n </div>\n </Tooltip>\n </div>\n );\n },\n);\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FileUploaderFileStatus } from '../fileUtils';
|
|
3
|
-
import {
|
|
3
|
+
import { SizeProp } from '../../../lib/types/props';
|
|
4
4
|
interface FileUploaderFileStatusIconProps {
|
|
5
5
|
hovered: boolean;
|
|
6
6
|
focusedByTab: boolean;
|
|
7
7
|
isInvalid: boolean;
|
|
8
8
|
status: FileUploaderFileStatus;
|
|
9
|
-
size:
|
|
9
|
+
size: SizeProp;
|
|
10
10
|
}
|
|
11
11
|
export declare const FileUploaderFileStatusIcon: React.FunctionComponent<FileUploaderFileStatusIconProps>;
|
|
12
12
|
export {};
|
|
@@ -4,9 +4,9 @@ var _ThemeContext = require("../../../lib/theming/ThemeContext");
|
|
|
4
4
|
var _ThemeHelpers = require("../../../lib/theming/ThemeHelpers");
|
|
5
5
|
var _px = require("../../icons/16px");
|
|
6
6
|
var _fileUtils = require("../fileUtils");
|
|
7
|
-
|
|
8
7
|
var _LoadingIcon = require("../../icons2022/LoadingIcon");
|
|
9
8
|
|
|
9
|
+
|
|
10
10
|
var _DeleteIcon = require("./DeleteIcon");
|
|
11
11
|
var _ErrorIcon = require("./ErrorIcon");
|
|
12
12
|
var _OkIcon = require("./OkIcon");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FileUploaderFileStatusIcon.tsx"],"names":["FileUploaderFileStatusIcon","hovered","focusedByTab","isInvalid","status","size","theme","ThemeContext","IconDelete","jsStyles","deleteIcon","IconError","IconOk","fileUploaderIconColor","FileUploaderFileStatus","Loading","Uploaded"],"mappings":"mFAAA;;AAEA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"sources":["FileUploaderFileStatusIcon.tsx"],"names":["FileUploaderFileStatusIcon","hovered","focusedByTab","isInvalid","status","size","theme","ThemeContext","IconDelete","jsStyles","deleteIcon","IconError","IconOk","fileUploaderIconColor","FileUploaderFileStatus","Loading","Uploaded"],"mappings":"mFAAA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,6D;;;;;;;;;;AAUO,IAAMA,0BAAoF,GAAG,SAAvFA,0BAAuF;;;;;;AAM9F,KALJC,OAKI,QALJA,OAKI,CAJJC,YAII,QAJJA,YAII,CAHJC,SAGI,QAHJA,SAGI,CAFJC,MAEI,QAFJA,MAEI,CADJC,IACI,QADJA,IACI;AACJ,MAAMC,KAAK,GAAG,uBAAWC,0BAAX,CAAd;;AAEA,MAAIC,UAAU,gBAAG,6BAAC,cAAD,IAAY,SAAS,EAAEC,2BAASC,UAAT,CAAoBJ,KAApB,CAAvB,GAAjB;AACA,MAAIK,SAAS,gBAAG,6BAAC,aAAD,OAAhB;AACA,MAAIC,MAAM,gBAAG,6BAAC,UAAD,IAAQ,KAAK,EAAEN,KAAK,CAACO,qBAArB,GAAb;;AAEA,MAAI,+BAAYP,KAAZ,CAAJ,EAAwB;AACtBE,IAAAA,UAAU,gBAAG,6BAAC,sBAAD,IAAgB,IAAI,EAAEH,IAAtB,EAA4B,SAAS,EAAEI,2BAASC,UAAT,CAAoBJ,KAApB,CAAvC,GAAb;AACAK,IAAAA,SAAS,gBAAG,6BAAC,oBAAD,IAAe,IAAI,EAAEN,IAArB,GAAZ;AACAO,IAAAA,MAAM,gBAAG,6BAAC,cAAD,IAAY,IAAI,EAAEP,IAAlB,EAAwB,KAAK,EAAEC,KAAK,CAACO,qBAArC,GAAT;AACD;;AAED,MAAIZ,OAAO,IAAIC,YAAf,EAA6B;AAC3B,WAAOM,UAAP;AACD;;AAED,MAAIL,SAAJ,EAAe;AACb,WAAOQ,SAAP;AACD;;AAED,UAAQP,MAAR;AACE,SAAKU,kCAAuBC,OAA5B;AACE,0BAAO,6BAAC,wBAAD,IAAa,IAAI,EAAEV,IAAnB,GAAP;AACF,SAAKS,kCAAuBE,QAA5B;AACE,aAAOJ,MAAP;AACF;AACE,aAAOJ,UAAP,CANJ;;AAQD,CAnCM,C","sourcesContent":["import React, { useContext } from 'react';\n\nimport { ThemeContext } from '../../../lib/theming/ThemeContext';\nimport { isTheme2022 } from '../../../lib/theming/ThemeHelpers';\nimport { DeleteIcon, ErrorIcon, OkIcon } from '../../icons/16px';\nimport { FileUploaderFileStatus } from '../fileUtils';\nimport { LoadingIcon } from '../../icons2022/LoadingIcon';\nimport { SizeProp } from '../../../lib/types/props';\n\nimport { DeleteIcon as DeleteIcon2022 } from './DeleteIcon';\nimport { ErrorIcon as ErrorIcon2022 } from './ErrorIcon';\nimport { OkIcon as OkIcon2022 } from './OkIcon';\nimport { jsStyles } from './FileUploaderFile.styles';\n\ninterface FileUploaderFileStatusIconProps {\n hovered: boolean;\n focusedByTab: boolean;\n isInvalid: boolean;\n status: FileUploaderFileStatus;\n size: SizeProp;\n}\n\nexport const FileUploaderFileStatusIcon: React.FunctionComponent<FileUploaderFileStatusIconProps> = ({\n hovered,\n focusedByTab,\n isInvalid,\n status,\n size,\n}) => {\n const theme = useContext(ThemeContext);\n\n let IconDelete = <DeleteIcon className={jsStyles.deleteIcon(theme)} />;\n let IconError = <ErrorIcon />;\n let IconOk = <OkIcon color={theme.fileUploaderIconColor} />;\n\n if (isTheme2022(theme)) {\n IconDelete = <DeleteIcon2022 size={size} className={jsStyles.deleteIcon(theme)} />;\n IconError = <ErrorIcon2022 size={size} />;\n IconOk = <OkIcon2022 size={size} color={theme.fileUploaderIconColor} />;\n }\n\n if (hovered || focusedByTab) {\n return IconDelete;\n }\n\n if (isInvalid) {\n return IconError;\n }\n\n switch (status) {\n case FileUploaderFileStatus.Loading:\n return <LoadingIcon size={size} />;\n case FileUploaderFileStatus.Uploaded:\n return IconOk;\n default:\n return IconDelete;\n }\n};\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FileUploaderAttachedFile } from '../fileUtils';
|
|
3
|
-
import {
|
|
3
|
+
import { SizeProp } from '../../../lib/types/props';
|
|
4
4
|
interface FileUploaderFileListProps {
|
|
5
5
|
renderFile: (file: FileUploaderAttachedFile, fileNode: React.ReactElement) => React.ReactNode;
|
|
6
|
-
size:
|
|
6
|
+
size: SizeProp;
|
|
7
7
|
}
|
|
8
8
|
export declare const FileUploaderFileDataTids: {
|
|
9
9
|
readonly fileList: "FileUploader__fileList";
|
|
@@ -4,10 +4,10 @@ var _FileUploaderControlContext = require("../FileUploaderControlContext");
|
|
|
4
4
|
var _ThemeContext = require("../../../lib/theming/ThemeContext");
|
|
5
5
|
var _FileUploaderFile = require("../FileUploaderFile/FileUploaderFile");
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
var _Emotion = require("../../../lib/theming/Emotion");
|
|
9
8
|
var _useFileUploaderSize = require("../hooks/useFileUploaderSize");
|
|
10
9
|
|
|
10
|
+
|
|
11
11
|
var _FileUploaderFileList = require("./FileUploaderFileList.styles");function _getRequireWildcardCache(nodeInterop) {if (typeof WeakMap !== "function") return null;var cacheBabelInterop = new WeakMap();var cacheNodeInterop = new WeakMap();return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {return nodeInterop ? cacheNodeInterop : cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj, nodeInterop) {if (!nodeInterop && obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache(nodeInterop);if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
|
|
12
12
|
|
|
13
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FileUploaderFileList.tsx"],"names":["FileUploaderFileDataTids","fileList","FileUploaderFileList","props","renderFile","size","FileUploaderControlContext","files","theme","ThemeContext","fileWrapperClass","small","jsStyles","fileWrapperSmall","medium","fileWrapperMedium","large","fileWrapperLarge","map","file","id","fileWrapper","displayName"],"mappings":"gHAAA;;AAEA;AACA;AACA;;;AAGA
|
|
1
|
+
{"version":3,"sources":["FileUploaderFileList.tsx"],"names":["FileUploaderFileDataTids","fileList","FileUploaderFileList","props","renderFile","size","FileUploaderControlContext","files","theme","ThemeContext","fileWrapperClass","small","jsStyles","fileWrapperSmall","medium","fileWrapperMedium","large","fileWrapperLarge","map","file","id","fileWrapper","displayName"],"mappings":"gHAAA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA,qE;;;;;;;AAOO,IAAMA,wBAAwB,GAAG;AACtCC,EAAAA,QAAQ,EAAE,wBAD4B,EAAjC,C;;;AAIA,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,KAAD,EAAsC;AACxE,MAAQC,UAAR,GAA6BD,KAA7B,CAAQC,UAAR,CAAoBC,IAApB,GAA6BF,KAA7B,CAAoBE,IAApB;AACA,oBAAkB,uBAAWC,sDAAX,CAAlB,CAAQC,KAAR,eAAQA,KAAR;AACA,MAAMC,KAAK,GAAG,uBAAWC,0BAAX,CAAd;;AAEA,MAAMC,gBAAgB,GAAG,8CAAoBL,IAApB,EAA0B;AACjDM,IAAAA,KAAK,EAAEC,+BAASC,gBAAT,CAA0BL,KAA1B,CAD0C;AAEjDM,IAAAA,MAAM,EAAEF,+BAASG,iBAAT,CAA2BP,KAA3B,CAFyC;AAGjDQ,IAAAA,KAAK,EAAEJ,+BAASK,gBAAT,CAA0BT,KAA1B,CAH0C,EAA1B,CAAzB;;;AAMA;AACE,0CAAK,YAAUR,wBAAwB,CAACC,QAAxC;AACGM,IAAAA,KAAK,CAACW,GAAN,CAAU,UAACC,IAAD;AACT,8CAAK,GAAG,EAAEA,IAAI,CAACC,EAAf,EAAmB,SAAS,EAAE,iBAAGR,+BAASS,WAAT,CAAqBb,KAArB,CAAH,EAAgCE,gBAAhC,CAA9B;AACE,8CAAK,SAAS,EAAEE,+BAASO,IAAT,EAAhB;AACGf,QAAAA,UAAU,CAACe,IAAD,eAAO,6BAAC,kCAAD,IAAkB,IAAI,EAAEA,IAAxB,EAA8B,QAAQ,MAAtC,EAAuC,QAAQ,MAA/C,EAAgD,IAAI,EAAEd,IAAtD,GAAP,CADb,CADF,CADS,GAAV,CADH,CADF;;;;;;AAWD,CAtBM,C;;AAwBPH,oBAAoB,CAACoB,WAArB,GAAmC,sBAAnC","sourcesContent":["import React, { useContext } from 'react';\n\nimport { FileUploaderControlContext } from '../FileUploaderControlContext';\nimport { ThemeContext } from '../../../lib/theming/ThemeContext';\nimport { FileUploaderFile } from '../FileUploaderFile/FileUploaderFile';\nimport { FileUploaderAttachedFile } from '../fileUtils';\nimport { cx } from '../../../lib/theming/Emotion';\nimport { useFileUploaderSize } from '../hooks/useFileUploaderSize';\nimport { SizeProp } from '../../../lib/types/props';\n\nimport { jsStyles } from './FileUploaderFileList.styles';\n\ninterface FileUploaderFileListProps {\n renderFile: (file: FileUploaderAttachedFile, fileNode: React.ReactElement) => React.ReactNode;\n size: SizeProp;\n}\n\nexport const FileUploaderFileDataTids = {\n fileList: 'FileUploader__fileList',\n} as const;\n\nexport const FileUploaderFileList = (props: FileUploaderFileListProps) => {\n const { renderFile, size } = props;\n const { files } = useContext(FileUploaderControlContext);\n const theme = useContext(ThemeContext);\n\n const fileWrapperClass = useFileUploaderSize(size, {\n small: jsStyles.fileWrapperSmall(theme),\n medium: jsStyles.fileWrapperMedium(theme),\n large: jsStyles.fileWrapperLarge(theme),\n });\n\n return (\n <div data-tid={FileUploaderFileDataTids.fileList}>\n {files.map((file) => (\n <div key={file.id} className={cx(jsStyles.fileWrapper(theme), fileWrapperClass)}>\n <div className={jsStyles.file()}>\n {renderFile(file, <FileUploaderFile file={file} showSize multiple size={size} />)}\n </div>\n </div>\n ))}\n </div>\n );\n};\n\nFileUploaderFileList.displayName = 'FileUploaderFileList';\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function useFileUploaderSize<T>(size:
|
|
1
|
+
import { SizeProp } from '../../../lib/types/props';
|
|
2
|
+
export declare function useFileUploaderSize<T>(size: SizeProp, { small, medium, large }: Record<SizeProp, T>): T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useFileUploaderSize.ts"],"names":["useFileUploaderSize","size","small","medium","large"],"mappings":"yFAAA;;;;AAIO,SAASA,mBAAT,CAAgCC,IAAhC,QAA+
|
|
1
|
+
{"version":3,"sources":["useFileUploaderSize.ts"],"names":["useFileUploaderSize","size","small","medium","large"],"mappings":"yFAAA;;;;AAIO,SAASA,mBAAT,CAAgCC,IAAhC,QAA+F,KAA7CC,KAA6C,QAA7CA,KAA6C,CAAtCC,MAAsC,QAAtCA,MAAsC,CAA9BC,KAA8B,QAA9BA,KAA8B;AACpG,SAAO,oBAAQ,YAAM;AACnB,YAAQH,IAAR;AACE,WAAK,OAAL;AACE,eAAOG,KAAP;AACF,WAAK,QAAL;AACE,eAAOD,MAAP;AACF,WAAK,OAAL;AACE,eAAOD,KAAP;AACF;AACE,eAAOA,KAAP,CARJ;;AAUD,GAXM,EAWJ,CAACD,IAAD,CAXI,CAAP;AAYD","sourcesContent":["import { useMemo } from 'react';\n\nimport { SizeProp } from '../../../lib/types/props';\n\nexport function useFileUploaderSize<T>(size: SizeProp, { small, medium, large }: Record<SizeProp, T>) {\n return useMemo(() => {\n switch (size) {\n case 'large':\n return large;\n case 'medium':\n return medium;\n case 'small':\n return small;\n default:\n return small;\n }\n }, [size]);\n}\n"]}
|
|
@@ -49,6 +49,7 @@ export declare class InputLikeText extends React.Component<InputLikeTextProps, I
|
|
|
49
49
|
*/
|
|
50
50
|
blink(): void;
|
|
51
51
|
getNode(): HTMLElement | null;
|
|
52
|
+
private selectNodeContentsDebounced;
|
|
52
53
|
selectInnerNode: (node: HTMLElement | null, start?: number, end?: number) => void;
|
|
53
54
|
componentDidMount(): void;
|
|
54
55
|
componentWillUnmount(): void;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _react = _interopRequireDefault(require("react"));
|
|
4
4
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
5
|
+
var _lodash = _interopRequireDefault(require("lodash.debounce"));
|
|
5
6
|
|
|
6
7
|
var _utils = require("../../lib/utils");
|
|
7
8
|
var _identifiers = require("../../lib/events/keyboard/identifiers");
|
|
@@ -99,6 +100,9 @@ InputLikeText = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
|
|
|
99
100
|
|
|
100
101
|
|
|
101
102
|
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
selectNodeContentsDebounced = (0, _lodash.default)(_SelectionHelpers.selectNodeContents, 0);_this.
|
|
102
106
|
|
|
103
107
|
selectInnerNode = function (node, start, end) {if (start === void 0) {start = 0;}if (end === void 0) {end = 1;}
|
|
104
108
|
if (_this.dragging || !node) {
|
|
@@ -112,7 +116,8 @@ InputLikeText = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
|
|
|
112
116
|
_this.frozenBlur = true;
|
|
113
117
|
|
|
114
118
|
_this.lastSelectedInnerNode = [node, start, end];
|
|
115
|
-
|
|
119
|
+
_this.selectNodeContentsDebounced(node, start, end);
|
|
120
|
+
|
|
116
121
|
if (_this.focusTimeout) {
|
|
117
122
|
clearInterval(_this.focusTimeout);
|
|
118
123
|
}
|
|
@@ -193,6 +198,7 @@ InputLikeText = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
|
|
|
193
198
|
_Input.styles.disabled(_this.theme)] = !!disabled, _cx[
|
|
194
199
|
_Input.styles.borderless()] = !!borderless, _cx[
|
|
195
200
|
_Input.styles.focus(_this.theme)] = focused, _cx[
|
|
201
|
+
_Input.styles.hovering(_this.theme)] = !focused && !disabled && !warning && !error && !borderless, _cx[
|
|
196
202
|
_Input.styles.blink(_this.theme)] = blinking, _cx[
|
|
197
203
|
_Input.styles.warning(_this.theme)] = !!warning, _cx[
|
|
198
204
|
_Input.styles.error(_this.theme)] = !!error, _cx[
|
|
@@ -451,9 +457,13 @@ InputLikeText = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
|
|
|
451
457
|
}
|
|
452
458
|
}
|
|
453
459
|
|
|
454
|
-
|
|
460
|
+
// Auto-batching React@18 creates problems that are fixed with flushSync
|
|
461
|
+
// https://github.com/skbkontur/retail-ui/pull/3144#issuecomment-1535235366
|
|
462
|
+
if (_react.default.version.search('18') === 0) {
|
|
463
|
+
_reactDom.default.flushSync(function () {return _this.setState({ focused: true });});
|
|
464
|
+
} else {
|
|
455
465
|
_this.setState({ focused: true });
|
|
456
|
-
}
|
|
466
|
+
}
|
|
457
467
|
|
|
458
468
|
if (_this.props.onFocus) {
|
|
459
469
|
_this.props.onFocus(e);
|
|
@@ -461,6 +471,7 @@ InputLikeText = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
|
|
|
461
471
|
};_this.
|
|
462
472
|
|
|
463
473
|
handleBlur = function (e) {
|
|
474
|
+
_this.selectNodeContentsDebounced.cancel();
|
|
464
475
|
if (_client.isMobile) {
|
|
465
476
|
e.target.removeAttribute('contenteditable');
|
|
466
477
|
}
|
|
@@ -528,4 +539,5 @@ InputLikeText = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*
|
|
|
528
539
|
* @public
|
|
529
540
|
*/;_proto.blur = function blur() {if (this.node) {this.node.blur();}} /**
|
|
530
541
|
* @public
|
|
531
|
-
*/;_proto.blink = function blink() {var _this3 = this;if (this.props.disabled) {return;}this.setState({ blinking: true }, function () {_this3.blinkTimeout = window.setTimeout(function () {return _this3.setState({ blinking: false });}, 150);});};_proto.getNode = function getNode() {return this.node;}
|
|
542
|
+
*/;_proto.blink = function blink() {var _this3 = this;if (this.props.disabled) {return;}this.setState({ blinking: true }, function () {_this3.blinkTimeout = window.setTimeout(function () {return _this3.setState({ blinking: false });}, 150);});};_proto.getNode = function getNode() {return this.node;} // Async call required for Firefox
|
|
543
|
+
;_proto.componentDidMount = function componentDidMount() {if (this.node) {_MouseDrag.MouseDrag.listen(this.node).onMouseDragStart(this.handleMouseDragStart).onMouseDragEnd(this.handleMouseDragEnd);}document.addEventListener('mousedown', this.handleDocumentMouseDown);document.addEventListener('keydown', this.handleDocumentKeyDown);};_proto.componentWillUnmount = function componentWillUnmount() {if (this.blinkTimeout) {clearTimeout(this.blinkTimeout);}_MouseDrag.MouseDrag.stop(this.node);document.removeEventListener('mousedown', this.handleDocumentMouseDown);document.removeEventListener('keydown', this.handleDocumentKeyDown);};_proto.render = function render() {var _this4 = this;return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeContext.Consumer, null, function (theme) {_this4.theme = theme;return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: _this4.setRootNode }, _this4.props), _this4.renderMain);});};_proto.getIconClassname = function getIconClassname(right) {if (right === void 0) {right = false;}switch (this.getProps().size) {case 'large':return right ? _Input.styles.rightIconLarge(this.theme) : _Input.styles.leftIconLarge(this.theme);case 'medium':return right ? _Input.styles.rightIconMedium(this.theme) : _Input.styles.leftIconMedium(this.theme);case 'small':default:return right ? _Input.styles.rightIconSmall(this.theme) : _Input.styles.leftIconSmall(this.theme);}};return InputLikeText;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'InputLikeText', _class2.defaultProps = { size: 'small' }, _temp)) || _class;exports.InputLikeText = InputLikeText;
|