@itcase/ui 1.1.8 → 1.1.10
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/dist/{Accordion-CqPVnTKh.js → Accordion-CXvqu97t.js} +5 -7
- package/dist/{Avatar-diLCwtnd.js → Avatar-JAaLGdYj.js} +6 -24
- package/dist/Badge-DPM6qrjA.js +62 -0
- package/dist/Breadcrumbs-BZpYBM5A.js +88 -0
- package/dist/Button-CyO_Wl49.js +96 -0
- package/dist/Caption-DDh0VFPJ.js +25 -0
- package/dist/Card-DKmhFMCS.js +28 -0
- package/dist/Cell-D3aJx_C0.js +65 -0
- package/dist/Checkbox-BqTMHeES.js +86 -0
- package/dist/Chips-DhyDHpu7.js +69 -0
- package/dist/Choice-cgCRlPk0.js +98 -0
- package/dist/Code-DkWVSDOy.js +273 -0
- package/dist/ContextMenuItem-DjDhhmjF.js +46 -0
- package/dist/DadataHintField-QzDwYdF1.js +1103 -0
- package/dist/DatePicker-BFLpftbJ.js +14104 -0
- package/dist/{Divider-BlBwMHgl.js → Divider-D0TEKxHr.js} +1 -1
- package/dist/{Dot-C3R1y59u.js → Dot-Bc0Ly45H.js} +1 -1
- package/dist/Drawer-CgJX3Utw.js +139 -0
- package/dist/DropdownItem-DOBsvnrL.js +155 -0
- package/dist/{FlexItem-DzNgFIa0.js → FlexItem-DHmKl6e7.js} +3 -3
- package/dist/{GridRow-Cc-rz56R.js → GridRow-DUnumam2.js} +1 -1
- package/dist/{Group-fbVPmr8W.js → Group-C2kJKhWJ.js} +3 -2
- package/dist/{Icon-Dn2eEZvb.js → Icon-C1j6rkeI.js} +5 -20
- package/dist/Image-Bz4Fo3eB.js +65 -0
- package/dist/Input-CYMKQ0qF.js +133 -0
- package/dist/InputPassword-Aff74Atr.js +110 -0
- package/dist/Label-CD6o__-D.js +85 -0
- package/dist/{Link-ByBzBRDH.js → Link-CbCqej5B.js} +8 -58
- package/dist/ListItem-Dgx1_Igi.js +46 -0
- package/dist/Loader-BUgSIcId.js +53 -0
- package/dist/Logo-DsOEX4uk.js +30 -0
- package/dist/Menu-89epjC8r.js +34 -0
- package/dist/MenuItem-DvpftOnP.js +81 -0
- package/dist/{ModalLoader-DJVKhIZR.js → ModalLoader-CushfGnC.js} +2 -2
- package/dist/{NotificationList-CJyEnxWw.js → NotificationList-D_NNtwS1.js} +9 -4
- package/dist/Overlay-C4gCb0sL.js +25 -0
- package/dist/Pagination-0sADvbwj.js +86 -0
- package/dist/Radio-DFeWsO4E.js +87 -0
- package/dist/RangeSlider-BPFVikab.js +50 -0
- package/dist/Response-C5_yetym.js +74 -0
- package/dist/Scrollbar-DrRNpn12.js +27 -0
- package/dist/SearchResult-C0kjGm-o.js +120 -0
- package/dist/Segmented-C56XBzTH.js +91 -0
- package/dist/SiteMenuButton-Do8ZNCkl.js +58 -0
- package/dist/Swiper-BYPes9JY.js +5115 -0
- package/dist/Switch-0BHqovLA.js +12 -0
- package/dist/SwitchField-W4_o97BR.js +98 -0
- package/dist/TabGroup-DRiFyK3Z.js +144 -0
- package/dist/{Text-BcGbRc14.js → Text-edtauAM6.js} +3 -2
- package/dist/Textarea-Cie6SPyp.js +96 -0
- package/dist/Tile-CQ5L7pja.js +52 -0
- package/dist/Title-BUN57fWw.js +84 -0
- package/dist/Tooltip-jT5A43he.js +108 -0
- package/dist/Video-0z4mNz4P.js +18 -0
- package/dist/Wrapper-CJTkVfsd.js +45 -0
- package/dist/_tslib-S-VPg1Cw.js +56 -0
- package/dist/cjs/{Accordion-DcZ9P5kP.js → Accordion-Dx0BRqhi.js} +6 -8
- package/dist/cjs/{Avatar-DQ5fNpnO.js → Avatar-C2xK87qB.js} +6 -24
- package/dist/cjs/Badge-BvJTwXqB.js +69 -0
- package/dist/cjs/Breadcrumbs-PHMiEJZH.js +96 -0
- package/dist/cjs/{Button-3GkRq8Pv.js → Button-D7ctQMni.js} +10 -14
- package/dist/cjs/Caption-f-OM1D-G.js +31 -0
- package/dist/cjs/Card-C5uctOQL.js +34 -0
- package/dist/cjs/Cell-B2BMVPlV.js +71 -0
- package/dist/cjs/Checkbox-C1HH9ut8.js +93 -0
- package/dist/cjs/Chips-DkUdk6Zs.js +76 -0
- package/dist/cjs/Choice-CJqMvK5I.js +106 -0
- package/dist/cjs/Code-ByEr4h2R.js +280 -0
- package/dist/cjs/ContextMenuItem-DocbJZKp.js +53 -0
- package/dist/cjs/DadataHintField-DQHPRLs0.js +1111 -0
- package/dist/cjs/DatePicker-7Ugf6hQ1.js +14128 -0
- package/dist/cjs/{Divider-CIYsHYud.js → Divider-doetVRw0.js} +1 -1
- package/dist/cjs/{Dot-vDSigHDs.js → Dot-CKWexdtn.js} +1 -1
- package/dist/cjs/Drawer-BGZBaR2Q.js +146 -0
- package/dist/cjs/DropdownItem-BVxf7bPs.js +163 -0
- package/dist/cjs/{FlexItem-BnORv6q3.js → FlexItem-2KlvlTJY.js} +3 -3
- package/dist/cjs/{GridRow-mzs0CkNG.js → GridRow-OxLsh_2P.js} +1 -1
- package/dist/cjs/{Group-4zWTDvKx.js → Group-C9BxTKs-.js} +3 -2
- package/dist/cjs/{Icon-UBahY607.js → Icon-D1v73UhR.js} +6 -21
- package/dist/cjs/Image-CCx6QWZj.js +71 -0
- package/dist/cjs/Input-BqKlyvEt.js +141 -0
- package/dist/cjs/InputPassword-saMz6m0X.js +117 -0
- package/dist/cjs/Label-C2Whza8M.js +92 -0
- package/dist/cjs/{Link-BoShjCEw.js → Link-3qPujNn9.js} +10 -61
- package/dist/cjs/ListItem-CvMoKXM-.js +53 -0
- package/dist/cjs/Loader-CK9zQAPl.js +60 -0
- package/dist/cjs/Logo-YADZn1N4.js +36 -0
- package/dist/cjs/Menu-BNe1i3Z7.js +40 -0
- package/dist/cjs/MenuItem-BRQoOa-K.js +89 -0
- package/dist/cjs/{ModalLoader-4mmV5G4E.js → ModalLoader-1f8MYsLV.js} +4 -4
- package/dist/cjs/{NotificationList-DnI8DqyE.js → NotificationList-ydXfdUwy.js} +10 -5
- package/dist/cjs/Overlay-18bnPZPd.js +31 -0
- package/dist/cjs/Pagination-D8EHefOz.js +94 -0
- package/dist/cjs/Radio-DRXdBBWU.js +94 -0
- package/dist/cjs/RangeSlider-Dy53bTyY.js +57 -0
- package/dist/cjs/Response-De79pGs5.js +82 -0
- package/dist/cjs/Scrollbar-DOujlQOb.js +33 -0
- package/dist/cjs/SearchResult-DFG3pyeM.js +129 -0
- package/dist/cjs/Segmented-D0ISlz9H.js +99 -0
- package/dist/cjs/SiteMenuButton-Ca46xAzk.js +65 -0
- package/dist/cjs/Swiper-oPcqfskQ.js +5122 -0
- package/dist/cjs/Switch-K1p9h3aF.js +19 -0
- package/dist/cjs/SwitchField-xk1JORBl.js +108 -0
- package/dist/cjs/TabGroup-DEEcVLO0.js +153 -0
- package/dist/cjs/{Text-D7Aq1i5R.js → Text-CgYNdSwY.js} +3 -2
- package/dist/cjs/Textarea-WIGhhrgu.js +103 -0
- package/dist/cjs/Tile-gAqZGMv7.js +58 -0
- package/dist/cjs/Title-C3lN-EvU.js +91 -0
- package/dist/cjs/Tooltip-DasmzIDY.js +116 -0
- package/dist/cjs/Video-B_xqvgag.js +24 -0
- package/dist/cjs/Wrapper-DravIzND.js +51 -0
- package/dist/cjs/_tslib-CKiUdo7p.js +59 -0
- package/dist/cjs/components/Accordion/Accordion.interface.d.ts +26 -24
- package/dist/cjs/components/Accordion.js +9 -20
- package/dist/cjs/components/Avatar/Avatar.d.ts +0 -10
- package/dist/cjs/components/Avatar/Avatar.interface.d.ts +14 -29
- package/dist/cjs/components/Avatar.js +10 -24
- package/dist/cjs/components/Badge/Badge.d.ts +10 -0
- package/dist/cjs/components/Badge/Badge.interface.d.ts +32 -0
- package/dist/cjs/components/Badge/index.d.ts +1 -0
- package/dist/cjs/components/Badge.js +10 -193
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.d.ts +8 -0
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.interface.d.ts +71 -0
- package/dist/cjs/components/Breadcrumbs/BreadcrumbsItem.d.ts +8 -0
- package/dist/cjs/components/Breadcrumbs/index.d.ts +3 -0
- package/dist/cjs/components/Breadcrumbs.js +9 -23
- package/dist/cjs/components/Button/Button.interface.d.ts +15 -17
- package/dist/cjs/components/Button.js +9 -20
- package/dist/cjs/components/Caption/Caption.d.ts +3 -0
- package/dist/cjs/components/Caption/Caption.interface.d.ts +21 -0
- package/dist/cjs/components/Caption/index.d.ts +1 -0
- package/dist/cjs/components/Caption.js +8 -184
- package/dist/cjs/components/Card/Card.d.ts +13 -0
- package/dist/cjs/components/Card/Card.interface.d.ts +29 -0
- package/dist/cjs/components/Card/index.d.ts +1 -0
- package/dist/cjs/components/Card.js +14 -270
- package/dist/cjs/components/Cell/Cell.d.ts +9 -0
- package/dist/cjs/components/Cell/Cell.interface.d.ts +61 -0
- package/dist/cjs/components/Cell/index.d.ts +1 -0
- package/dist/cjs/components/Cell.js +19 -412
- package/dist/cjs/components/Checkbox/Checkbox.d.ts +9 -0
- package/dist/cjs/components/Checkbox/Checkbox.interface.d.ts +57 -0
- package/dist/cjs/components/Checkbox/index.d.ts +1 -0
- package/dist/cjs/components/Checkbox.js +14 -157
- package/dist/cjs/components/Chips/Chips.d.ts +9 -0
- package/dist/cjs/components/Chips/Chips.interface.d.ts +42 -0
- package/dist/cjs/components/Chips/index.d.ts +1 -0
- package/dist/cjs/components/Chips.js +10 -380
- package/dist/cjs/components/Choice/Choice.d.ts +5 -0
- package/dist/cjs/components/Choice/Choice.interface.d.ts +55 -0
- package/dist/cjs/components/Choice/index.d.ts +1 -0
- package/dist/cjs/components/Choice.js +19 -336
- package/dist/cjs/components/Code/Code.d.ts +22 -0
- package/dist/cjs/components/Code/Code.interface.d.ts +33 -0
- package/dist/cjs/components/Code/index.d.ts +1 -0
- package/dist/cjs/components/Code.js +8 -427
- package/dist/cjs/components/ContextMenu/ContextMenu.d.ts +8 -0
- package/dist/cjs/components/ContextMenu/ContextMenu.interface.d.ts +36 -0
- package/dist/cjs/components/ContextMenu/ContextMenuItem.d.ts +3 -0
- package/dist/cjs/components/ContextMenu/index.d.ts +3 -0
- package/dist/cjs/components/ContextMenu.js +10 -21
- package/dist/cjs/components/CookiesWarning.js +10 -21
- package/dist/cjs/components/DadataHintField/DadataHintField.d.ts +3 -0
- package/dist/cjs/components/DadataHintField/DadataHintField.interface.d.ts +14 -0
- package/dist/cjs/components/DadataHintField/index.d.ts +1 -0
- package/dist/cjs/components/DadataHintField.js +9 -1182
- package/dist/cjs/components/DatePicker/DatePicker.d.ts +3 -0
- package/dist/cjs/components/DatePicker/DatePicker.interface.d.ts +48 -0
- package/dist/cjs/components/DatePicker/index.d.ts +1 -0
- package/dist/cjs/components/DatePicker.js +19 -14082
- package/dist/cjs/components/Divider/Divider.interface.d.ts +2 -0
- package/dist/cjs/components/Divider.js +2 -2
- package/dist/cjs/components/Dot/Dot.interface.d.ts +4 -3
- package/dist/cjs/components/Dot.js +2 -2
- package/dist/cjs/components/Drawer/Drawer.d.ts +3 -0
- package/dist/cjs/components/Drawer/Drawer.interface.d.ts +16 -0
- package/dist/cjs/components/Drawer/index.d.ts +1 -0
- package/dist/cjs/components/Drawer.js +5 -279
- package/dist/cjs/components/Dropdown/Dropdown.d.ts +10 -0
- package/dist/cjs/components/Dropdown/Dropdown.interface.d.ts +73 -0
- package/dist/cjs/components/Dropdown/DropdownItem.d.ts +10 -0
- package/dist/cjs/components/Dropdown/index.d.ts +3 -0
- package/dist/cjs/components/Dropdown.js +7 -11
- package/dist/cjs/components/Flex/Flex.interface.d.ts +28 -26
- package/dist/cjs/components/Flex.js +2 -2
- package/dist/cjs/components/FormField/ChoiceField.d.ts +8 -0
- package/dist/cjs/components/FormField/FormField.d.ts +9 -0
- package/dist/cjs/components/FormField/FormFiled.interface.d.ts +77 -0
- package/dist/cjs/components/FormField/PasswordField.d.ts +9 -0
- package/dist/cjs/components/FormField/SelectField.d.ts +9 -0
- package/dist/cjs/components/FormField/SwitchField.d.ts +8 -0
- package/dist/cjs/components/FormField/index.d.ts +6 -0
- package/dist/cjs/components/FormField.js +21 -33
- package/dist/cjs/components/Grid/Grid.interface.d.ts +11 -8
- package/dist/cjs/components/Grid.js +2 -2
- package/dist/cjs/components/Group/Group.interface.d.ts +19 -19
- package/dist/cjs/components/Group.js +2 -2
- package/dist/cjs/components/Icon/Icon.interface.d.ts +25 -32
- package/dist/cjs/components/Icon.js +8 -19
- package/dist/cjs/components/Image/Image.d.ts +3 -0
- package/dist/cjs/components/Image/Image.interface.d.ts +34 -0
- package/dist/cjs/components/Image/index.d.ts +1 -0
- package/dist/cjs/components/Image.js +8 -467
- package/dist/cjs/components/Input/Input.d.ts +5 -0
- package/dist/cjs/components/Input/Input.interface.d.ts +53 -0
- package/dist/cjs/components/Input/index.d.ts +1 -0
- package/dist/cjs/components/Input.js +8 -223
- package/dist/cjs/components/InputMask/Input.d.ts +5 -0
- package/dist/cjs/components/InputMask/Input.interface.d.ts +53 -0
- package/dist/cjs/components/InputMask/index.d.ts +1 -0
- package/dist/cjs/components/InputMask.js +124 -210
- package/dist/cjs/components/InputPassword/InputPassword.d.ts +10 -0
- package/dist/cjs/components/InputPassword/InputPassword.interface.d.ts +52 -0
- package/dist/cjs/components/InputPassword/index.d.ts +1 -0
- package/dist/cjs/components/InputPassword.js +19 -245
- package/dist/cjs/components/Label/Label.d.ts +9 -0
- package/dist/cjs/components/Label/Label.interface.d.ts +58 -0
- package/dist/cjs/components/Label/index.d.ts +1 -0
- package/dist/cjs/components/Label.js +12 -630
- package/dist/cjs/components/LanguageSelector.js +8 -19
- package/dist/cjs/components/Link/Link.interface.d.ts +4 -3
- package/dist/cjs/components/Link.js +3 -2
- package/dist/cjs/components/List/List.d.ts +3 -0
- package/dist/cjs/components/List/List.interface.d.ts +28 -0
- package/dist/cjs/components/List/ListItem.d.ts +3 -0
- package/dist/cjs/components/List/index.d.ts +3 -0
- package/dist/cjs/components/List.js +5 -11
- package/dist/cjs/components/Loader/Loader.d.ts +4 -0
- package/dist/cjs/components/Loader/Loader.interface.d.ts +30 -0
- package/dist/cjs/components/Loader/index.d.ts +1 -0
- package/dist/cjs/components/Loader.js +10 -143
- package/dist/cjs/components/Logo/Logo.d.ts +3 -0
- package/dist/cjs/components/Logo/Logo.interface.d.ts +17 -0
- package/dist/cjs/components/Logo/index.d.ts +1 -0
- package/dist/cjs/components/Logo.js +10 -162
- package/dist/cjs/components/Menu/Menu.d.ts +8 -0
- package/dist/cjs/components/Menu/Menu.interface.d.ts +20 -0
- package/dist/cjs/components/Menu/index.d.ts +1 -0
- package/dist/cjs/components/Menu.js +12 -183
- package/dist/cjs/components/MenuItem/MenuItem.d.ts +11 -0
- package/dist/cjs/components/MenuItem/MenuItem.interface.d.ts +65 -0
- package/dist/cjs/components/MenuItem/index.d.ts +1 -0
- package/dist/cjs/components/MenuItem.js +16 -671
- package/dist/cjs/components/Modal.js +5 -7
- package/dist/cjs/components/Notification/Notification.interface.d.ts +13 -13
- package/dist/cjs/components/Notification.js +4 -13
- package/dist/cjs/components/Overlay/Overlay.d.ts +3 -0
- package/dist/cjs/components/Overlay/Overlay.interface.d.ts +10 -0
- package/dist/cjs/components/Overlay/index.d.ts +1 -0
- package/dist/cjs/components/Overlay.js +8 -184
- package/dist/cjs/components/Pagination/Pagination.d.ts +13 -0
- package/dist/cjs/components/Pagination/Pagination.interface.d.ts +46 -0
- package/dist/cjs/components/Pagination/index.d.ts +1 -0
- package/dist/cjs/components/Pagination.js +17 -356
- package/dist/cjs/components/Panel/Panel.d.ts +7 -0
- package/dist/cjs/components/Panel/Panel.interface.d.ts +56 -0
- package/dist/cjs/components/Panel/index.d.ts +1 -0
- package/dist/cjs/components/Panel.js +112 -0
- package/dist/cjs/components/Radio/Radio.d.ts +10 -0
- package/dist/cjs/components/Radio/Radio.interface.d.ts +53 -0
- package/dist/cjs/components/Radio/index.d.ts +1 -0
- package/dist/cjs/components/Radio.js +14 -258
- package/dist/cjs/components/RangeSlider/RangeSlider.d.ts +3 -0
- package/dist/cjs/components/RangeSlider/RangeSlider.interface.d.ts +28 -0
- package/dist/cjs/components/RangeSlider/index.d.ts +1 -0
- package/dist/cjs/components/RangeSlider.js +13 -287
- package/dist/cjs/components/Response/Response.d.ts +4 -0
- package/dist/cjs/components/Response/Response.interface.d.ts +64 -0
- package/dist/cjs/components/Response/index.d.ts +1 -0
- package/dist/cjs/components/Response.js +21 -234
- package/dist/cjs/components/ScrollOnDrag/ScrollOnDrag.d.ts +8 -0
- package/dist/cjs/components/ScrollOnDrag/ScrollOnDrag.interface.d.ts +18 -0
- package/dist/cjs/components/ScrollOnDrag/index.d.ts +1 -0
- package/dist/cjs/components/ScrollOnDrag.js +41 -186
- package/dist/cjs/components/Scrollbar/Scrollbar.d.ts +8 -0
- package/dist/cjs/components/Scrollbar/Scrollbar.interface.d.ts +10 -0
- package/dist/cjs/components/Scrollbar/index.d.ts +1 -0
- package/dist/cjs/components/Scrollbar.js +6 -66
- package/dist/cjs/components/Search/Search.interface.d.ts +69 -0
- package/dist/cjs/components/Search/SearchInput.d.ts +5 -0
- package/dist/cjs/components/Search/SearchResult.d.ts +4 -0
- package/dist/cjs/components/Search/index.d.ts +3 -0
- package/dist/cjs/components/Search.js +10 -21
- package/dist/cjs/components/Segmented/Segmented.d.ts +5 -0
- package/dist/cjs/components/Segmented/Segmented.interface.d.ts +42 -0
- package/dist/cjs/components/Segmented/index.d.ts +1 -0
- package/dist/cjs/components/Segmented.js +14 -226
- package/dist/cjs/components/Select.js +156 -209
- package/dist/cjs/components/SiteMenu/SiteMenu.d.ts +3 -0
- package/dist/cjs/components/SiteMenu/SiteMenu.interface.d.ts +23 -0
- package/dist/cjs/components/SiteMenu/SiteMenuButton.d.ts +3 -0
- package/dist/cjs/components/SiteMenu/index.d.ts +3 -0
- package/dist/cjs/components/SiteMenu.js +10 -21
- package/dist/cjs/components/Swiper/Swiper.d.ts +9 -0
- package/dist/cjs/components/Swiper/Swiper.interface.d.ts +58 -0
- package/dist/cjs/components/Swiper/index.d.ts +1 -0
- package/dist/cjs/components/Swiper.js +11 -5644
- package/dist/cjs/components/Switch/Switch.d.ts +4 -0
- package/dist/cjs/components/Switch/Switch.interface.d.ts +10 -0
- package/dist/cjs/components/Switch/index.d.ts +1 -0
- package/dist/cjs/components/Switch.js +5 -100
- package/dist/cjs/components/Tab/Tab.d.ts +11 -0
- package/dist/cjs/components/Tab/Tab.interface.d.ts +79 -0
- package/dist/cjs/components/Tab/TabGroup.d.ts +3 -0
- package/dist/cjs/components/Tab/index.d.ts +3 -0
- package/dist/cjs/components/Tab.js +8 -22
- package/dist/cjs/components/Text/Text.interface.d.ts +5 -4
- package/dist/cjs/components/Text.js +2 -2
- package/dist/cjs/components/Textarea/Textarea.d.ts +9 -0
- package/dist/cjs/components/Textarea/Textarea.interface.d.ts +44 -0
- package/dist/cjs/components/Textarea/index.d.ts +1 -0
- package/dist/cjs/components/Textarea.js +8 -202
- package/dist/cjs/components/Tile/Tile.d.ts +9 -0
- package/dist/cjs/components/Tile/Tile.interface.d.ts +37 -0
- package/dist/cjs/components/Tile/index.d.ts +1 -0
- package/dist/cjs/components/Tile.js +11 -555
- package/dist/cjs/components/Title/Title.d.ts +9 -0
- package/dist/cjs/components/Title/Title.interface.d.ts +42 -0
- package/dist/cjs/components/Title/index.d.ts +1 -0
- package/dist/cjs/components/Title.js +12 -390
- package/dist/cjs/components/Tooltip/Tooltip.d.ts +5 -0
- package/dist/cjs/components/Tooltip/Tooltip.interface.d.ts +44 -0
- package/dist/cjs/components/Tooltip/index.d.ts +1 -0
- package/dist/cjs/components/Tooltip.js +13 -440
- package/dist/cjs/components/Video/Video.d.ts +3 -0
- package/dist/cjs/components/Video/Video.interface.d.ts +15 -0
- package/dist/cjs/components/Video/index.d.ts +1 -0
- package/dist/cjs/components/Video.js +7 -163
- package/dist/cjs/components/Wrapper/Wrapper.d.ts +9 -0
- package/dist/cjs/components/Wrapper/Wrapper.interface.d.ts +20 -0
- package/dist/cjs/components/Wrapper/index.d.ts +1 -0
- package/dist/cjs/components/Wrapper.js +8 -425
- package/dist/cjs/components/index.d.ts +2 -2
- package/dist/cjs/components.js +138 -163
- package/dist/cjs/constants.js +0 -2
- package/dist/cjs/{floating-ui.dom-C34fOuI9.js → floating-ui.dom-CW7i9VDu.js} +60 -22
- package/dist/cjs/hooks/styleAttributes.interface.d.ts +36 -18
- package/dist/cjs/{jsx-runtime-BCmQOGxJ.js → jsx-runtime-BBxmckJR.js} +20 -6
- package/dist/cjs/types/componentProps/alignment.d.ts +1 -1
- package/dist/cjs/types/componentProps/appearanceKeys.d.ts +1 -1
- package/dist/cjs/types/componentProps/fill.d.ts +1 -1
- package/dist/cjs/types/componentProps/itemColor.d.ts +1 -1
- package/dist/cjs/types/componentProps/overflow.d.ts +1 -0
- package/dist/cjs/types/componentProps/sizeInterface.d.ts +1 -1
- package/dist/cjs/types/componentProps/stateKeys.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +3 -3
- package/dist/components/Accordion/Accordion.interface.d.ts +26 -24
- package/dist/components/Accordion.js +9 -20
- package/dist/components/Avatar/Avatar.d.ts +0 -10
- package/dist/components/Avatar/Avatar.interface.d.ts +14 -29
- package/dist/components/Avatar.js +10 -24
- package/dist/components/Badge/Badge.d.ts +10 -0
- package/dist/components/Badge/Badge.interface.d.ts +32 -0
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge.js +8 -189
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +8 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.interface.d.ts +71 -0
- package/dist/components/Breadcrumbs/BreadcrumbsItem.d.ts +8 -0
- package/dist/components/Breadcrumbs/index.d.ts +3 -0
- package/dist/components/Breadcrumbs.js +9 -23
- package/dist/components/Button/Button.interface.d.ts +15 -17
- package/dist/components/Button.js +9 -20
- package/dist/components/Caption/Caption.d.ts +3 -0
- package/dist/components/Caption/Caption.interface.d.ts +21 -0
- package/dist/components/Caption/index.d.ts +1 -0
- package/dist/components/Caption.js +7 -181
- package/dist/components/Card/Card.d.ts +13 -0
- package/dist/components/Card/Card.interface.d.ts +29 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card.js +13 -267
- package/dist/components/Cell/Cell.d.ts +9 -0
- package/dist/components/Cell/Cell.interface.d.ts +61 -0
- package/dist/components/Cell/index.d.ts +1 -0
- package/dist/components/Cell.js +18 -409
- package/dist/components/Checkbox/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox/Checkbox.interface.d.ts +57 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox.js +12 -153
- package/dist/components/Chips/Chips.d.ts +9 -0
- package/dist/components/Chips/Chips.interface.d.ts +42 -0
- package/dist/components/Chips/index.d.ts +1 -0
- package/dist/components/Chips.js +8 -376
- package/dist/components/Choice/Choice.d.ts +5 -0
- package/dist/components/Choice/Choice.interface.d.ts +55 -0
- package/dist/components/Choice/index.d.ts +1 -0
- package/dist/components/Choice.js +17 -332
- package/dist/components/Code/Code.d.ts +22 -0
- package/dist/components/Code/Code.interface.d.ts +33 -0
- package/dist/components/Code/index.d.ts +1 -0
- package/dist/components/Code.js +7 -424
- package/dist/components/ContextMenu/ContextMenu.d.ts +8 -0
- package/dist/components/ContextMenu/ContextMenu.interface.d.ts +36 -0
- package/dist/components/ContextMenu/ContextMenuItem.d.ts +3 -0
- package/dist/components/ContextMenu/index.d.ts +3 -0
- package/dist/components/ContextMenu.js +10 -21
- package/dist/components/CookiesWarning.js +10 -21
- package/dist/components/DadataHintField/DadataHintField.d.ts +3 -0
- package/dist/components/DadataHintField/DadataHintField.interface.d.ts +14 -0
- package/dist/components/DadataHintField/index.d.ts +1 -0
- package/dist/components/DadataHintField.js +8 -1178
- package/dist/components/DatePicker/DatePicker.d.ts +3 -0
- package/dist/components/DatePicker/DatePicker.interface.d.ts +48 -0
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker.js +18 -14062
- package/dist/components/Divider/Divider.interface.d.ts +2 -0
- package/dist/components/Divider.js +2 -2
- package/dist/components/Dot/Dot.interface.d.ts +4 -3
- package/dist/components/Dot.js +2 -2
- package/dist/components/Drawer/Drawer.d.ts +3 -0
- package/dist/components/Drawer/Drawer.interface.d.ts +16 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Drawer.js +4 -276
- package/dist/components/Dropdown/Dropdown.d.ts +10 -0
- package/dist/components/Dropdown/Dropdown.interface.d.ts +73 -0
- package/dist/components/Dropdown/DropdownItem.d.ts +10 -0
- package/dist/components/Dropdown/index.d.ts +3 -0
- package/dist/components/Dropdown.js +7 -11
- package/dist/components/Flex/Flex.interface.d.ts +28 -26
- package/dist/components/Flex.js +2 -2
- package/dist/components/FormField/ChoiceField.d.ts +8 -0
- package/dist/components/FormField/FormField.d.ts +9 -0
- package/dist/components/FormField/FormFiled.interface.d.ts +77 -0
- package/dist/components/FormField/PasswordField.d.ts +9 -0
- package/dist/components/FormField/SelectField.d.ts +9 -0
- package/dist/components/FormField/SwitchField.d.ts +8 -0
- package/dist/components/FormField/index.d.ts +6 -0
- package/dist/components/FormField.js +16 -28
- package/dist/components/Grid/Grid.interface.d.ts +11 -8
- package/dist/components/Grid.js +2 -2
- package/dist/components/Group/Group.interface.d.ts +19 -19
- package/dist/components/Group.js +2 -2
- package/dist/components/Icon/Icon.interface.d.ts +25 -32
- package/dist/components/Icon.js +8 -19
- package/dist/components/Image/Image.d.ts +3 -0
- package/dist/components/Image/Image.interface.d.ts +34 -0
- package/dist/components/Image/index.d.ts +1 -0
- package/dist/components/Image.js +7 -464
- package/dist/components/Input/Input.d.ts +5 -0
- package/dist/components/Input/Input.interface.d.ts +53 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input.js +6 -219
- package/dist/components/InputMask/Input.d.ts +5 -0
- package/dist/components/InputMask/Input.interface.d.ts +53 -0
- package/dist/components/InputMask/index.d.ts +1 -0
- package/dist/components/InputMask.js +125 -210
- package/dist/components/InputPassword/InputPassword.d.ts +10 -0
- package/dist/components/InputPassword/InputPassword.interface.d.ts +52 -0
- package/dist/components/InputPassword/index.d.ts +1 -0
- package/dist/components/InputPassword.js +17 -241
- package/dist/components/Label/Label.d.ts +9 -0
- package/dist/components/Label/Label.interface.d.ts +58 -0
- package/dist/components/Label/index.d.ts +1 -0
- package/dist/components/Label.js +10 -626
- package/dist/components/LanguageSelector.js +8 -19
- package/dist/components/Link/Link.interface.d.ts +4 -3
- package/dist/components/Link.js +3 -2
- package/dist/components/List/List.d.ts +3 -0
- package/dist/components/List/List.interface.d.ts +28 -0
- package/dist/components/List/ListItem.d.ts +3 -0
- package/dist/components/List/index.d.ts +3 -0
- package/dist/components/List.js +5 -11
- package/dist/components/Loader/Loader.d.ts +4 -0
- package/dist/components/Loader/Loader.interface.d.ts +30 -0
- package/dist/components/Loader/index.d.ts +1 -0
- package/dist/components/Loader.js +8 -139
- package/dist/components/Logo/Logo.d.ts +3 -0
- package/dist/components/Logo/Logo.interface.d.ts +17 -0
- package/dist/components/Logo/index.d.ts +1 -0
- package/dist/components/Logo.js +9 -159
- package/dist/components/Menu/Menu.d.ts +8 -0
- package/dist/components/Menu/Menu.interface.d.ts +20 -0
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu.js +11 -180
- package/dist/components/MenuItem/MenuItem.d.ts +11 -0
- package/dist/components/MenuItem/MenuItem.interface.d.ts +65 -0
- package/dist/components/MenuItem/index.d.ts +1 -0
- package/dist/components/MenuItem.js +14 -667
- package/dist/components/Modal.js +5 -7
- package/dist/components/Notification/Notification.interface.d.ts +13 -13
- package/dist/components/Notification.js +4 -13
- package/dist/components/Overlay/Overlay.d.ts +3 -0
- package/dist/components/Overlay/Overlay.interface.d.ts +10 -0
- package/dist/components/Overlay/index.d.ts +1 -0
- package/dist/components/Overlay.js +7 -181
- package/dist/components/Pagination/Pagination.d.ts +13 -0
- package/dist/components/Pagination/Pagination.interface.d.ts +46 -0
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/Pagination.js +16 -351
- package/dist/components/Panel/Panel.d.ts +7 -0
- package/dist/components/Panel/Panel.interface.d.ts +56 -0
- package/dist/components/Panel/index.d.ts +1 -0
- package/dist/components/Panel.js +105 -0
- package/dist/components/Radio/Radio.d.ts +10 -0
- package/dist/components/Radio/Radio.interface.d.ts +53 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Radio.js +12 -254
- package/dist/components/RangeSlider/RangeSlider.d.ts +3 -0
- package/dist/components/RangeSlider/RangeSlider.interface.d.ts +28 -0
- package/dist/components/RangeSlider/index.d.ts +1 -0
- package/dist/components/RangeSlider.js +12 -283
- package/dist/components/Response/Response.d.ts +4 -0
- package/dist/components/Response/Response.interface.d.ts +64 -0
- package/dist/components/Response/index.d.ts +1 -0
- package/dist/components/Response.js +19 -229
- package/dist/components/ScrollOnDrag/ScrollOnDrag.d.ts +8 -0
- package/dist/components/ScrollOnDrag/ScrollOnDrag.interface.d.ts +18 -0
- package/dist/components/ScrollOnDrag/index.d.ts +1 -0
- package/dist/components/ScrollOnDrag.js +41 -185
- package/dist/components/Scrollbar/Scrollbar.d.ts +8 -0
- package/dist/components/Scrollbar/Scrollbar.interface.d.ts +10 -0
- package/dist/components/Scrollbar/index.d.ts +1 -0
- package/dist/components/Scrollbar.js +5 -64
- package/dist/components/Search/Search.interface.d.ts +69 -0
- package/dist/components/Search/SearchInput.d.ts +5 -0
- package/dist/components/Search/SearchResult.d.ts +4 -0
- package/dist/components/Search/index.d.ts +3 -0
- package/dist/components/Search.js +10 -21
- package/dist/components/Segmented/Segmented.d.ts +5 -0
- package/dist/components/Segmented/Segmented.interface.d.ts +42 -0
- package/dist/components/Segmented/index.d.ts +1 -0
- package/dist/components/Segmented.js +12 -222
- package/dist/components/Select.js +156 -209
- package/dist/components/SiteMenu/SiteMenu.d.ts +3 -0
- package/dist/components/SiteMenu/SiteMenu.interface.d.ts +23 -0
- package/dist/components/SiteMenu/SiteMenuButton.d.ts +3 -0
- package/dist/components/SiteMenu/index.d.ts +3 -0
- package/dist/components/SiteMenu.js +10 -21
- package/dist/components/Swiper/Swiper.d.ts +9 -0
- package/dist/components/Swiper/Swiper.interface.d.ts +58 -0
- package/dist/components/Swiper/index.d.ts +1 -0
- package/dist/components/Swiper.js +10 -5641
- package/dist/components/Switch/Switch.d.ts +4 -0
- package/dist/components/Switch/Switch.interface.d.ts +10 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch.js +4 -97
- package/dist/components/Tab/Tab.d.ts +11 -0
- package/dist/components/Tab/Tab.interface.d.ts +79 -0
- package/dist/components/Tab/TabGroup.d.ts +3 -0
- package/dist/components/Tab/index.d.ts +3 -0
- package/dist/components/Tab.js +8 -22
- package/dist/components/Text/Text.interface.d.ts +5 -4
- package/dist/components/Text.js +2 -2
- package/dist/components/Textarea/Textarea.d.ts +9 -0
- package/dist/components/Textarea/Textarea.interface.d.ts +44 -0
- package/dist/components/Textarea/index.d.ts +1 -0
- package/dist/components/Textarea.js +6 -198
- package/dist/components/Tile/Tile.d.ts +9 -0
- package/dist/components/Tile/Tile.interface.d.ts +37 -0
- package/dist/components/Tile/index.d.ts +1 -0
- package/dist/components/Tile.js +10 -552
- package/dist/components/Title/Title.d.ts +9 -0
- package/dist/components/Title/Title.interface.d.ts +42 -0
- package/dist/components/Title/index.d.ts +1 -0
- package/dist/components/Title.js +10 -386
- package/dist/components/Tooltip/Tooltip.d.ts +5 -0
- package/dist/components/Tooltip/Tooltip.interface.d.ts +44 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip.js +11 -436
- package/dist/components/Video/Video.d.ts +3 -0
- package/dist/components/Video/Video.interface.d.ts +15 -0
- package/dist/components/Video/index.d.ts +1 -0
- package/dist/components/Video.js +6 -160
- package/dist/components/Wrapper/Wrapper.d.ts +9 -0
- package/dist/components/Wrapper/Wrapper.interface.d.ts +20 -0
- package/dist/components/Wrapper/index.d.ts +1 -0
- package/dist/components/Wrapper.js +7 -422
- package/dist/components/index.d.ts +2 -2
- package/dist/components.js +63 -88
- package/dist/constants.js +0 -1
- package/dist/css/components/Button/Button.css +50 -55
- package/dist/css/components/Drawer/Drawer.css +24 -19
- package/dist/css/components/Dropdown/Dropdown.css +52 -45
- package/dist/css/components/Icon/Icon.css +9 -39
- package/dist/css/components/Link/Link.css +22 -0
- package/dist/css/components/Pagination/Pagination.css +2 -0
- package/dist/css/components/Panel/Panel.css +107 -0
- package/dist/css/components/Swiper/Swiper.css +2 -2
- package/dist/{floating-ui.dom-BQ7wiYTi.js → floating-ui.dom-B080ZrCv.js} +60 -22
- package/dist/hooks/styleAttributes.interface.d.ts +36 -18
- package/dist/{jsx-runtime-ClDdVO4Q.js → jsx-runtime-C2uP7l8s.js} +20 -6
- package/dist/stories/Button.stories.js +0 -16
- package/dist/stories/Cell.stories.js +0 -11
- package/dist/stories/DatePicker.stories.js +0 -6
- package/dist/stories/Icon.stories.js +2 -17
- package/dist/stories/Search-input.stories.js +0 -10
- package/dist/stories/Select.stories.js +0 -10
- package/dist/types/componentProps/alignment.d.ts +1 -1
- package/dist/types/componentProps/appearanceKeys.d.ts +1 -1
- package/dist/types/componentProps/fill.d.ts +1 -1
- package/dist/types/componentProps/itemColor.d.ts +1 -1
- package/dist/types/componentProps/overflow.d.ts +1 -0
- package/dist/types/componentProps/sizeInterface.d.ts +1 -1
- package/dist/types/componentProps/stateKeys.d.ts +1 -0
- package/dist/types/index.d.ts +3 -3
- package/package.json +39 -36
- package/dist/Breadcrumbs-B79kOtMG.js +0 -619
- package/dist/Button-B7vbiqrJ.js +0 -100
- package/dist/ContextMenuItem-BPqsjmSA.js +0 -204
- package/dist/DropdownItem-Dgf0LRhx.js +0 -644
- package/dist/ListItem-Cf8r3w8t.js +0 -479
- package/dist/SearchResult-erxB06IL.js +0 -530
- package/dist/SelectField-CpQMWXaC.js +0 -571
- package/dist/SiteMenuButton-BFmti8pF.js +0 -181
- package/dist/TabGroup-CjmtgOMw.js +0 -1071
- package/dist/cjs/Breadcrumbs-HubY1qZQ.js +0 -629
- package/dist/cjs/ContextMenuItem-DmbSoGn1.js +0 -213
- package/dist/cjs/DropdownItem-Bl-Ghc_6.js +0 -653
- package/dist/cjs/ListItem-MrHApmF3.js +0 -488
- package/dist/cjs/SearchResult-bTwR5A-g.js +0 -540
- package/dist/cjs/SelectField-BJTu7BXO.js +0 -583
- package/dist/cjs/SiteMenuButton-BGi0gR1z.js +0 -190
- package/dist/cjs/TabGroup-DIWmGIp2.js +0 -1081
- package/dist/cjs/constants/componentProps/strokeColor.js +0 -7
- package/dist/cjs/types/componentProps/strokeColor.d.ts +0 -1
- package/dist/constants/componentProps/strokeColor.js +0 -3
- package/dist/types/componentProps/strokeColor.d.ts +0 -1
|
@@ -1,1184 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
export { D as DadataHintField } from '../DadataHintField-QzDwYdF1.js';
|
|
2
|
+
import '../_tslib-S-VPg1Cw.js';
|
|
3
|
+
import '../jsx-runtime-C2uP7l8s.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'clsx';
|
|
6
|
+
import 'crypto';
|
|
7
|
+
import '../Input-CYMKQ0qF.js';
|
|
6
8
|
import '../hooks/useDeviceTargetClass.js';
|
|
7
9
|
import 'lodash/castArray';
|
|
8
10
|
import 'lodash/camelCase';
|
|
9
11
|
import '../context/UIContext.js';
|
|
12
|
+
import 'prop-types';
|
|
10
13
|
import '../hooks/useMediaQueries.js';
|
|
11
14
|
import 'react-responsive';
|
|
12
|
-
|
|
13
|
-
function getDefaultExportFromCjs (x) {
|
|
14
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
|
20
|
-
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
|
21
|
-
|
|
22
|
-
if (ret !== void 0) {
|
|
23
|
-
return !!ret;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (objA === objB) {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
var keysA = Object.keys(objA);
|
|
35
|
-
var keysB = Object.keys(objB);
|
|
36
|
-
|
|
37
|
-
if (keysA.length !== keysB.length) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
|
42
|
-
|
|
43
|
-
// Test for A's keys different from B.
|
|
44
|
-
for (var idx = 0; idx < keysA.length; idx++) {
|
|
45
|
-
var key = keysA[idx];
|
|
46
|
-
|
|
47
|
-
if (!bHasOwnProperty(key)) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
var valueA = objA[key];
|
|
52
|
-
var valueB = objB[key];
|
|
53
|
-
|
|
54
|
-
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
|
|
55
|
-
|
|
56
|
-
if (ret === false || (ret === void 0 && valueA !== valueB)) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return true;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var shallowEqual = /*@__PURE__*/getDefaultExportFromCjs(shallowequal);
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Returns a function, that, as long as it continues to be invoked, will not
|
|
68
|
-
* be triggered. The function will be called after it stops being called for
|
|
69
|
-
* N milliseconds. If `immediate` is passed, trigger the function on the
|
|
70
|
-
* leading edge, instead of the trailing. The function also has a property 'clear'
|
|
71
|
-
* that is a function which will clear the timer to prevent previously scheduled executions.
|
|
72
|
-
*
|
|
73
|
-
* @source underscore.js
|
|
74
|
-
* @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
|
|
75
|
-
* @param {Function} function to wrap
|
|
76
|
-
* @param {Number} timeout in ms (`100`)
|
|
77
|
-
* @param {Boolean} whether to execute at the beginning (`false`)
|
|
78
|
-
* @api public
|
|
79
|
-
*/
|
|
80
|
-
|
|
81
|
-
function debounce(func, wait, immediate){
|
|
82
|
-
var timeout, args, context, timestamp, result;
|
|
83
|
-
if (null == wait) wait = 100;
|
|
84
|
-
|
|
85
|
-
function later() {
|
|
86
|
-
var last = Date.now() - timestamp;
|
|
87
|
-
|
|
88
|
-
if (last < wait && last >= 0) {
|
|
89
|
-
timeout = setTimeout(later, wait - last);
|
|
90
|
-
} else {
|
|
91
|
-
timeout = null;
|
|
92
|
-
if (!immediate) {
|
|
93
|
-
result = func.apply(context, args);
|
|
94
|
-
context = args = null;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
var debounced = function(){
|
|
99
|
-
context = this;
|
|
100
|
-
args = arguments;
|
|
101
|
-
timestamp = Date.now();
|
|
102
|
-
var callNow = immediate && !timeout;
|
|
103
|
-
if (!timeout) timeout = setTimeout(later, wait);
|
|
104
|
-
if (callNow) {
|
|
105
|
-
result = func.apply(context, args);
|
|
106
|
-
context = args = null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return result;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
debounced.clear = function() {
|
|
113
|
-
if (timeout) {
|
|
114
|
-
clearTimeout(timeout);
|
|
115
|
-
timeout = null;
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
debounced.flush = function() {
|
|
120
|
-
if (timeout) {
|
|
121
|
-
result = func.apply(context, args);
|
|
122
|
-
context = args = null;
|
|
123
|
-
|
|
124
|
-
clearTimeout(timeout);
|
|
125
|
-
timeout = null;
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return debounced;
|
|
130
|
-
}
|
|
131
|
-
// Adds compatibility for ES modules
|
|
132
|
-
debounce.debounce = debounce;
|
|
133
|
-
|
|
134
|
-
var debounce_1 = debounce;
|
|
135
|
-
|
|
136
|
-
let urlAlphabet =
|
|
137
|
-
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
138
|
-
|
|
139
|
-
const POOL_SIZE_MULTIPLIER = 128;
|
|
140
|
-
let pool, poolOffset;
|
|
141
|
-
let fillPool = bytes => {
|
|
142
|
-
if (!pool || pool.length < bytes) {
|
|
143
|
-
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
144
|
-
crypto.randomFillSync(pool);
|
|
145
|
-
poolOffset = 0;
|
|
146
|
-
} else if (poolOffset + bytes > pool.length) {
|
|
147
|
-
crypto.randomFillSync(pool);
|
|
148
|
-
poolOffset = 0;
|
|
149
|
-
}
|
|
150
|
-
poolOffset += bytes;
|
|
151
|
-
};
|
|
152
|
-
let nanoid = (size = 21) => {
|
|
153
|
-
fillPool((size -= 0));
|
|
154
|
-
let id = '';
|
|
155
|
-
for (let i = poolOffset - size; i < poolOffset; i++) {
|
|
156
|
-
id += urlAlphabet[pool[i] & 63];
|
|
157
|
-
}
|
|
158
|
-
return id
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
var xhr;
|
|
162
|
-
var makeRequest = function (method, endpoint, data, cache, onReceiveData) {
|
|
163
|
-
if (xhr) {
|
|
164
|
-
xhr.abort();
|
|
165
|
-
}
|
|
166
|
-
var cacheKey;
|
|
167
|
-
if (cache) {
|
|
168
|
-
cacheKey = cache.serializeCacheKey({
|
|
169
|
-
headers: data.headers,
|
|
170
|
-
body: data.json,
|
|
171
|
-
url: endpoint,
|
|
172
|
-
method: method,
|
|
173
|
-
});
|
|
174
|
-
var cachedData = cache.get(cacheKey);
|
|
175
|
-
if (cachedData) {
|
|
176
|
-
onReceiveData(cachedData);
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
xhr = new XMLHttpRequest();
|
|
181
|
-
xhr.open(method, endpoint);
|
|
182
|
-
if (data.headers) {
|
|
183
|
-
Object.entries(data.headers).forEach(function (_a) {
|
|
184
|
-
var header = _a[0], headerValue = _a[1];
|
|
185
|
-
xhr.setRequestHeader(header, headerValue);
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
xhr.send(JSON.stringify(data.json));
|
|
189
|
-
xhr.onreadystatechange = function () {
|
|
190
|
-
var _a;
|
|
191
|
-
if (!xhr || xhr.readyState !== 4) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
if (xhr.status === 200) {
|
|
195
|
-
var payload = (_a = JSON.parse(xhr.response)) === null || _a === void 0 ? void 0 : _a.suggestions;
|
|
196
|
-
if (payload) {
|
|
197
|
-
cache === null || cache === void 0 ? void 0 : cache.set(cacheKey, payload);
|
|
198
|
-
onReceiveData(payload);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
var HttpCache = /** @class */ (function () {
|
|
205
|
-
function HttpCache() {
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Сгенерировать уникальный ключ кеша из параметров http-запроса
|
|
209
|
-
* @example
|
|
210
|
-
* ```ts
|
|
211
|
-
* cache.serializeCacheKey({
|
|
212
|
-
* url: 'https://example.com',
|
|
213
|
-
* body: { key: "value" },
|
|
214
|
-
* method: "POST"
|
|
215
|
-
* })
|
|
216
|
-
* ```
|
|
217
|
-
*/
|
|
218
|
-
HttpCache.prototype.serializeCacheKey = function (payload) {
|
|
219
|
-
try {
|
|
220
|
-
return JSON.stringify(payload);
|
|
221
|
-
}
|
|
222
|
-
catch (_e) {
|
|
223
|
-
// на случай попытки сериализации объекта с циклическими зависимостями внутри
|
|
224
|
-
return payload.url + String(Math.random());
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
return HttpCache;
|
|
228
|
-
}());
|
|
229
|
-
|
|
230
|
-
var __extends$7 = (undefined && undefined.__extends) || (function () {
|
|
231
|
-
var extendStatics = function (d, b) {
|
|
232
|
-
extendStatics = Object.setPrototypeOf ||
|
|
233
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
234
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
235
|
-
return extendStatics(d, b);
|
|
236
|
-
};
|
|
237
|
-
return function (d, b) {
|
|
238
|
-
if (typeof b !== "function" && b !== null)
|
|
239
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
240
|
-
extendStatics(d, b);
|
|
241
|
-
function __() { this.constructor = d; }
|
|
242
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
243
|
-
};
|
|
244
|
-
})();
|
|
245
|
-
var minute = 60000;
|
|
246
|
-
var DefaultHttpCache = /** @class */ (function (_super) {
|
|
247
|
-
__extends$7(DefaultHttpCache, _super);
|
|
248
|
-
function DefaultHttpCache() {
|
|
249
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
250
|
-
_this._map = new Map();
|
|
251
|
-
_this._ttl = 10 * minute;
|
|
252
|
-
return _this;
|
|
253
|
-
}
|
|
254
|
-
Object.defineProperty(DefaultHttpCache, "shared", {
|
|
255
|
-
/**
|
|
256
|
-
* Синглтон
|
|
257
|
-
* @example
|
|
258
|
-
* ```ts
|
|
259
|
-
* cache.shared.get('key');
|
|
260
|
-
* ```
|
|
261
|
-
*/
|
|
262
|
-
get: function () {
|
|
263
|
-
if (!DefaultHttpCache.sharedInstance) {
|
|
264
|
-
DefaultHttpCache.sharedInstance = new DefaultHttpCache();
|
|
265
|
-
}
|
|
266
|
-
return DefaultHttpCache.sharedInstance;
|
|
267
|
-
},
|
|
268
|
-
enumerable: false,
|
|
269
|
-
configurable: true
|
|
270
|
-
});
|
|
271
|
-
Object.defineProperty(DefaultHttpCache.prototype, "ttl", {
|
|
272
|
-
/**
|
|
273
|
-
* Время жизни кеша в миллисекундах
|
|
274
|
-
* @example
|
|
275
|
-
* ```ts
|
|
276
|
-
* cache.ttl = 60000;
|
|
277
|
-
* cache.ttl = Infinity;
|
|
278
|
-
* cache.tll = 0;
|
|
279
|
-
*
|
|
280
|
-
* // негативные значения игнорируются
|
|
281
|
-
* cache.ttl = -1;
|
|
282
|
-
* cache.ttl = Number.NEGATIVE_INFINITY;
|
|
283
|
-
* ```
|
|
284
|
-
*/
|
|
285
|
-
get: function () {
|
|
286
|
-
return this._ttl;
|
|
287
|
-
},
|
|
288
|
-
set: function (ttl) {
|
|
289
|
-
if (typeof ttl === 'number' && ttl >= 0) {
|
|
290
|
-
this._ttl = ttl;
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
enumerable: false,
|
|
294
|
-
configurable: true
|
|
295
|
-
});
|
|
296
|
-
Object.defineProperty(DefaultHttpCache.prototype, "size", {
|
|
297
|
-
/**
|
|
298
|
-
* Количество элементов в кеше
|
|
299
|
-
*/
|
|
300
|
-
get: function () {
|
|
301
|
-
return this._map.size;
|
|
302
|
-
},
|
|
303
|
-
enumerable: false,
|
|
304
|
-
configurable: true
|
|
305
|
-
});
|
|
306
|
-
DefaultHttpCache.prototype.get = function (key) {
|
|
307
|
-
var data = this._map.get(key);
|
|
308
|
-
if (!data)
|
|
309
|
-
return null;
|
|
310
|
-
if (data.expires <= Date.now()) {
|
|
311
|
-
this.delete(key);
|
|
312
|
-
return null;
|
|
313
|
-
}
|
|
314
|
-
return data.data;
|
|
315
|
-
};
|
|
316
|
-
DefaultHttpCache.prototype.set = function (key, data) {
|
|
317
|
-
this._map.set(key, {
|
|
318
|
-
data: data,
|
|
319
|
-
expires: Date.now() + this.ttl,
|
|
320
|
-
});
|
|
321
|
-
return this;
|
|
322
|
-
};
|
|
323
|
-
DefaultHttpCache.prototype.delete = function (key) {
|
|
324
|
-
this._map.delete(key);
|
|
325
|
-
return this;
|
|
326
|
-
};
|
|
327
|
-
DefaultHttpCache.prototype.reset = function () {
|
|
328
|
-
this._map.clear();
|
|
329
|
-
return this;
|
|
330
|
-
};
|
|
331
|
-
return DefaultHttpCache;
|
|
332
|
-
}(HttpCache));
|
|
333
|
-
|
|
334
|
-
var __extends$6 = (undefined && undefined.__extends) || (function () {
|
|
335
|
-
var extendStatics = function (d, b) {
|
|
336
|
-
extendStatics = Object.setPrototypeOf ||
|
|
337
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
338
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
339
|
-
return extendStatics(d, b);
|
|
340
|
-
};
|
|
341
|
-
return function (d, b) {
|
|
342
|
-
if (typeof b !== "function" && b !== null)
|
|
343
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
344
|
-
extendStatics(d, b);
|
|
345
|
-
function __() { this.constructor = d; }
|
|
346
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
347
|
-
};
|
|
348
|
-
})();
|
|
349
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
350
|
-
__assign = Object.assign || function(t) {
|
|
351
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
352
|
-
s = arguments[i];
|
|
353
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
354
|
-
t[p] = s[p];
|
|
355
|
-
}
|
|
356
|
-
return t;
|
|
357
|
-
};
|
|
358
|
-
return __assign.apply(this, arguments);
|
|
359
|
-
};
|
|
360
|
-
var BaseSuggestions = /** @class */ (function (_super) {
|
|
361
|
-
__extends$6(BaseSuggestions, _super);
|
|
362
|
-
function BaseSuggestions(props) {
|
|
363
|
-
var _this = _super.call(this, props) || this;
|
|
364
|
-
/**
|
|
365
|
-
* URL для загрузки подсказок, переопределяется в конкретном компоненте
|
|
366
|
-
*/
|
|
367
|
-
_this.loadSuggestionsUrl = '';
|
|
368
|
-
_this.dontPerformBlurHandler = false;
|
|
369
|
-
_this.getSuggestionsUrl = function () {
|
|
370
|
-
var url = _this.props.url;
|
|
371
|
-
return url || _this.loadSuggestionsUrl;
|
|
372
|
-
};
|
|
373
|
-
_this.setupDebounce = function (delay) {
|
|
374
|
-
if (typeof delay === 'number' && delay > 0) {
|
|
375
|
-
_this.fetchSuggestions = debounce_1.debounce(_this.performFetchSuggestions, delay);
|
|
376
|
-
}
|
|
377
|
-
else {
|
|
378
|
-
_this.fetchSuggestions = _this.performFetchSuggestions;
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
_this.fetchSuggestions = function () {
|
|
382
|
-
//
|
|
383
|
-
};
|
|
384
|
-
_this.handleInputFocus = function (event) {
|
|
385
|
-
_this.setState({ isFocused: true });
|
|
386
|
-
var suggestions = _this.state.suggestions;
|
|
387
|
-
if (suggestions.length === 0) {
|
|
388
|
-
_this.fetchSuggestions();
|
|
389
|
-
}
|
|
390
|
-
var inputProps = _this.props.inputProps;
|
|
391
|
-
if (inputProps && inputProps.onFocus) {
|
|
392
|
-
inputProps.onFocus(event);
|
|
393
|
-
}
|
|
394
|
-
};
|
|
395
|
-
_this.handleInputBlur = function (event) {
|
|
396
|
-
var _a = _this.state, suggestions = _a.suggestions, suggestionIndex = _a.suggestionIndex;
|
|
397
|
-
var _b = _this.props, selectOnBlur = _b.selectOnBlur, inputProps = _b.inputProps;
|
|
398
|
-
_this.setState({ isFocused: false });
|
|
399
|
-
if (suggestions.length === 0) {
|
|
400
|
-
_this.fetchSuggestions();
|
|
401
|
-
}
|
|
402
|
-
if (selectOnBlur && !_this.dontPerformBlurHandler) {
|
|
403
|
-
if (suggestions.length > 0) {
|
|
404
|
-
var suggestionIndexToSelect = suggestionIndex >= 0 && suggestionIndex < suggestions.length ? suggestionIndex : 0;
|
|
405
|
-
_this.selectSuggestion(suggestionIndexToSelect, true);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
_this.dontPerformBlurHandler = false;
|
|
409
|
-
if (inputProps && inputProps.onBlur) {
|
|
410
|
-
inputProps.onBlur(event);
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
_this.handleInputChange = function (event) {
|
|
414
|
-
var value = event.target.value;
|
|
415
|
-
var inputProps = _this.props.inputProps;
|
|
416
|
-
if (_this.didMount) {
|
|
417
|
-
_this.setState({ query: value, inputQuery: value, displaySuggestions: !!value }, function () {
|
|
418
|
-
_this.fetchSuggestions();
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
if (inputProps && inputProps.onChange) {
|
|
422
|
-
inputProps.onChange(event);
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
_this.handleInputKeyDown = function (event) {
|
|
426
|
-
_this.handleKeyboard(event);
|
|
427
|
-
var inputProps = _this.props.inputProps;
|
|
428
|
-
if (inputProps && inputProps.onKeyDown) {
|
|
429
|
-
inputProps.onKeyDown(event);
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
_this.handleInputKeyPress = function (event) {
|
|
433
|
-
_this.handleKeyboard(event);
|
|
434
|
-
var inputProps = _this.props.inputProps;
|
|
435
|
-
if (inputProps && inputProps.onKeyPress) {
|
|
436
|
-
inputProps.onKeyPress(event);
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
_this.handleKeyboard = function (event) {
|
|
440
|
-
var _a = _this.state, suggestions = _a.suggestions, suggestionIndex = _a.suggestionIndex, inputQuery = _a.inputQuery;
|
|
441
|
-
if (event.which === 40) {
|
|
442
|
-
// Arrow down
|
|
443
|
-
event.preventDefault();
|
|
444
|
-
if (suggestionIndex < suggestions.length - 1) {
|
|
445
|
-
var newSuggestionIndex = suggestionIndex + 1;
|
|
446
|
-
var newInputQuery = suggestions[newSuggestionIndex].value;
|
|
447
|
-
if (_this.didMount) {
|
|
448
|
-
_this.setState({ suggestionIndex: newSuggestionIndex, query: newInputQuery });
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
else if (event.which === 38) {
|
|
453
|
-
// Arrow up
|
|
454
|
-
event.preventDefault();
|
|
455
|
-
if (suggestionIndex >= 0) {
|
|
456
|
-
var newSuggestionIndex = suggestionIndex - 1;
|
|
457
|
-
var newInputQuery = newSuggestionIndex === -1 ? inputQuery : suggestions[newSuggestionIndex].value;
|
|
458
|
-
if (_this.didMount) {
|
|
459
|
-
_this.setState({ suggestionIndex: newSuggestionIndex, query: newInputQuery });
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
else if (event.which === 13) {
|
|
464
|
-
// Enter
|
|
465
|
-
event.preventDefault();
|
|
466
|
-
if (suggestionIndex >= 0) {
|
|
467
|
-
_this.selectSuggestion(suggestionIndex);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
};
|
|
471
|
-
_this.performFetchSuggestions = function () {
|
|
472
|
-
var _a = _this.props, minChars = _a.minChars, token = _a.token;
|
|
473
|
-
var query = _this.state.query;
|
|
474
|
-
// Проверяем на минимальное количество символов для отправки
|
|
475
|
-
if (typeof minChars === 'number' && minChars > 0 && query.length < minChars) {
|
|
476
|
-
_this.setState({ suggestions: [], suggestionIndex: -1 });
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
makeRequest('POST', _this.getSuggestionsUrl(), {
|
|
480
|
-
headers: {
|
|
481
|
-
Accept: 'application/json',
|
|
482
|
-
Authorization: "Token ".concat(token),
|
|
483
|
-
'Content-Type': 'application/json',
|
|
484
|
-
},
|
|
485
|
-
json: _this.getLoadSuggestionsData(),
|
|
486
|
-
}, _this.httpCache, function (suggestions) {
|
|
487
|
-
if (_this.didMount) {
|
|
488
|
-
_this.setState({ suggestions: suggestions, suggestionIndex: -1 });
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
};
|
|
492
|
-
_this.onSuggestionClick = function (index, event) {
|
|
493
|
-
event.stopPropagation();
|
|
494
|
-
_this.selectSuggestion(index);
|
|
495
|
-
};
|
|
496
|
-
_this.selectSuggestion = function (index, isSilent) {
|
|
497
|
-
if (isSilent === void 0) { isSilent = false; }
|
|
498
|
-
var suggestions = _this.state.suggestions;
|
|
499
|
-
var _a = _this.props, selectOnBlur = _a.selectOnBlur, onChange = _a.onChange;
|
|
500
|
-
if (suggestions.length >= index - 1) {
|
|
501
|
-
var suggestion = suggestions[index];
|
|
502
|
-
if (selectOnBlur) {
|
|
503
|
-
_this.dontPerformBlurHandler = true;
|
|
504
|
-
}
|
|
505
|
-
_this.setState({ query: suggestion.value, inputQuery: suggestion.value, displaySuggestions: false }, function () {
|
|
506
|
-
if (!isSilent) {
|
|
507
|
-
_this.fetchSuggestions();
|
|
508
|
-
setTimeout(function () { return _this.setCursorToEnd(_this.textInput); });
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
if (onChange) {
|
|
512
|
-
onChange(suggestion);
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
};
|
|
516
|
-
_this.setCursorToEnd = function (element) {
|
|
517
|
-
if (element) {
|
|
518
|
-
var valueLength = element.value.length;
|
|
519
|
-
if (element.selectionStart || element.selectionStart === 0) {
|
|
520
|
-
// eslint-disable-next-line no-param-reassign
|
|
521
|
-
element.selectionStart = valueLength;
|
|
522
|
-
// eslint-disable-next-line no-param-reassign
|
|
523
|
-
element.selectionEnd = valueLength;
|
|
524
|
-
element.focus();
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
_this.getHighlightWords = function () {
|
|
529
|
-
var inputQuery = _this.state.inputQuery;
|
|
530
|
-
var wordsToPass = ['г', 'респ', 'ул', 'р-н', 'село', 'деревня', 'поселок', 'пр-д', 'пл', 'к', 'кв', 'обл', 'д'];
|
|
531
|
-
var words = inputQuery.replace(',', '').split(' ');
|
|
532
|
-
words = words.filter(function (word) {
|
|
533
|
-
return wordsToPass.indexOf(word) < 0;
|
|
534
|
-
});
|
|
535
|
-
return words;
|
|
536
|
-
};
|
|
537
|
-
/**
|
|
538
|
-
* Функция, которая вернет уникальный key для списка React
|
|
539
|
-
* @param suggestion
|
|
540
|
-
*/
|
|
541
|
-
_this.getSuggestionKey = function (suggestion) { return suggestion.value; };
|
|
542
|
-
_this.focus = function () {
|
|
543
|
-
if (_this.textInput) {
|
|
544
|
-
_this.textInput.focus();
|
|
545
|
-
}
|
|
546
|
-
};
|
|
547
|
-
_this.setInputValue = function (value) {
|
|
548
|
-
_this.setState({ query: value || '', inputQuery: value || '' });
|
|
549
|
-
};
|
|
550
|
-
_this.didMount = false;
|
|
551
|
-
var _a = _this.props, defaultQuery = _a.defaultQuery, value = _a.value, delay = _a.delay;
|
|
552
|
-
var valueQuery = value ? value.value : undefined;
|
|
553
|
-
_this.setupDebounce(delay);
|
|
554
|
-
_this.state = {
|
|
555
|
-
query: defaultQuery || valueQuery || '',
|
|
556
|
-
inputQuery: defaultQuery || valueQuery || '',
|
|
557
|
-
isFocused: false,
|
|
558
|
-
displaySuggestions: true,
|
|
559
|
-
suggestions: [],
|
|
560
|
-
suggestionIndex: -1,
|
|
561
|
-
};
|
|
562
|
-
return _this;
|
|
563
|
-
}
|
|
564
|
-
BaseSuggestions.prototype.componentDidMount = function () {
|
|
565
|
-
this.didMount = true;
|
|
566
|
-
};
|
|
567
|
-
BaseSuggestions.prototype.componentDidUpdate = function (prevProps) {
|
|
568
|
-
var _a = this.props, value = _a.value, delay = _a.delay;
|
|
569
|
-
var _b = this.state, query = _b.query, inputQuery = _b.inputQuery;
|
|
570
|
-
if (!shallowEqual(prevProps.value, value)) {
|
|
571
|
-
var newQuery = value ? value.value : '';
|
|
572
|
-
if (query !== newQuery || inputQuery !== newQuery) {
|
|
573
|
-
this.setState({ query: newQuery, inputQuery: newQuery });
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
if (delay !== prevProps.delay) {
|
|
577
|
-
this.setupDebounce(delay);
|
|
578
|
-
}
|
|
579
|
-
};
|
|
580
|
-
BaseSuggestions.prototype.componentWillUnmount = function () {
|
|
581
|
-
this.didMount = false;
|
|
582
|
-
};
|
|
583
|
-
Object.defineProperty(BaseSuggestions.prototype, "uid", {
|
|
584
|
-
get: function () {
|
|
585
|
-
if (this.props.uid) {
|
|
586
|
-
return this.props.uid;
|
|
587
|
-
}
|
|
588
|
-
if (!this._uid) {
|
|
589
|
-
this._uid = nanoid();
|
|
590
|
-
}
|
|
591
|
-
return this._uid;
|
|
592
|
-
},
|
|
593
|
-
enumerable: false,
|
|
594
|
-
configurable: true
|
|
595
|
-
});
|
|
596
|
-
Object.defineProperty(BaseSuggestions.prototype, "httpCache", {
|
|
597
|
-
get: function () {
|
|
598
|
-
var _a = this.props, cacheProp = _a.httpCache, ttl = _a.httpCacheTtl;
|
|
599
|
-
if (!cacheProp) {
|
|
600
|
-
return null;
|
|
601
|
-
}
|
|
602
|
-
if (cacheProp instanceof HttpCache) {
|
|
603
|
-
return cacheProp;
|
|
604
|
-
}
|
|
605
|
-
var cache = DefaultHttpCache.shared;
|
|
606
|
-
if (typeof ttl === 'number') {
|
|
607
|
-
cache.ttl = ttl;
|
|
608
|
-
}
|
|
609
|
-
return cache;
|
|
610
|
-
},
|
|
611
|
-
enumerable: false,
|
|
612
|
-
configurable: true
|
|
613
|
-
});
|
|
614
|
-
BaseSuggestions.prototype.render = function () {
|
|
615
|
-
var _this = this;
|
|
616
|
-
var _a = this.props, inputProps = _a.inputProps, hintText = _a.hintText, containerClassName = _a.containerClassName, hintClassName = _a.hintClassName, suggestionsClassName = _a.suggestionsClassName, suggestionClassName = _a.suggestionClassName, currentSuggestionClassName = _a.currentSuggestionClassName, customInput = _a.customInput, children = _a.children;
|
|
617
|
-
var _b = this.state, query = _b.query, isFocused = _b.isFocused, suggestions = _b.suggestions, suggestionIndex = _b.suggestionIndex, displaySuggestions = _b.displaySuggestions;
|
|
618
|
-
var Component = typeof customInput !== 'undefined' ? customInput : 'input';
|
|
619
|
-
var optionsExpanded = isFocused && suggestions && displaySuggestions && suggestions.length > 0;
|
|
620
|
-
return (React__default.createElement("div", { role: "combobox", "aria-expanded": optionsExpanded ? 'true' : 'false', "aria-owns": this.uid, "aria-controls": this.uid, "aria-haspopup": "listbox", className: containerClassName || 'react-dadata react-dadata__container' },
|
|
621
|
-
React__default.createElement("div", null,
|
|
622
|
-
React__default.createElement(Component, __assign({ autoComplete: "off", className: "react-dadata__input" }, inputProps, { value: query, ref: function (input) {
|
|
623
|
-
_this.textInput = input;
|
|
624
|
-
}, onChange: this.handleInputChange, onKeyPress: this.handleInputKeyPress, onKeyDown: this.handleInputKeyDown, onFocus: this.handleInputFocus, onBlur: this.handleInputBlur }))),
|
|
625
|
-
optionsExpanded && (React__default.createElement("ul", { id: this.uid, "aria-expanded": true, role: "listbox", className: suggestionsClassName || 'react-dadata__suggestions' },
|
|
626
|
-
typeof hintText !== 'undefined' && (React__default.createElement("div", { className: hintClassName || 'react-dadata__suggestion-note' }, hintText)),
|
|
627
|
-
suggestions.map(function (suggestion, index) {
|
|
628
|
-
var suggestionClass = suggestionClassName || 'react-dadata__suggestion';
|
|
629
|
-
if (index === suggestionIndex) {
|
|
630
|
-
suggestionClass += " ".concat(currentSuggestionClassName || 'react-dadata__suggestion--current');
|
|
631
|
-
}
|
|
632
|
-
return (React__default.createElement("button", { role: "option", "aria-selected": index === suggestionIndex ? 'true' : 'false', key: _this.getSuggestionKey(suggestion), onMouseDown: _this.onSuggestionClick.bind(_this, index), className: suggestionClass }, _this.renderOption(suggestion)));
|
|
633
|
-
}))),
|
|
634
|
-
children));
|
|
635
|
-
};
|
|
636
|
-
return BaseSuggestions;
|
|
637
|
-
}(React__default.PureComponent));
|
|
638
|
-
|
|
639
|
-
let IDX = 36;
|
|
640
|
-
let HEX = "";
|
|
641
|
-
while (IDX--) {
|
|
642
|
-
HEX += IDX.toString(36);
|
|
643
|
-
}
|
|
644
|
-
function uid(len = 11) {
|
|
645
|
-
let str = "";
|
|
646
|
-
let num = len;
|
|
647
|
-
while (num--) {
|
|
648
|
-
str += HEX[Math.random() * 36 | 0];
|
|
649
|
-
}
|
|
650
|
-
return str;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
const escapeRegexp = (term) => term.replace(/[|\\{}()[\]^$+*?.-]/g, (char) => `\\${char}`);
|
|
654
|
-
const termsToRegExpString = (terms) => terms.replace(/\s{2,}/g, " ").split(" ").join("|");
|
|
655
|
-
const regexpQuery = ({
|
|
656
|
-
terms,
|
|
657
|
-
matchExactly = false
|
|
658
|
-
}) => {
|
|
659
|
-
if (typeof terms !== "string") {
|
|
660
|
-
throw new TypeError("Expected a string");
|
|
661
|
-
}
|
|
662
|
-
const escapedTerms = escapeRegexp(terms.trim());
|
|
663
|
-
return `(${matchExactly ? escapedTerms : termsToRegExpString(escapedTerms)})`;
|
|
664
|
-
};
|
|
665
|
-
const buildRegexp = ({
|
|
666
|
-
terms,
|
|
667
|
-
matchExactly = false
|
|
668
|
-
}) => {
|
|
669
|
-
try {
|
|
670
|
-
const fromString = /^([/~@;%#'])(.*?)\1([gimsuy]*)$/.exec(terms);
|
|
671
|
-
if (fromString) {
|
|
672
|
-
return new RegExp(fromString[2], fromString[3]);
|
|
673
|
-
}
|
|
674
|
-
return new RegExp(regexpQuery({ terms, matchExactly }), "ig");
|
|
675
|
-
} catch (e) {
|
|
676
|
-
throw new TypeError("Expected terms to be either a string or a RegExp!");
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
const hasProp = (prop) => (obj) => obj !== null && typeof obj === "object" && prop in obj;
|
|
681
|
-
const hasMatch = hasProp("match");
|
|
682
|
-
const chunkExists = (chunk) => typeof chunk !== "undefined";
|
|
683
|
-
function clip({
|
|
684
|
-
curr,
|
|
685
|
-
next,
|
|
686
|
-
prev,
|
|
687
|
-
clipBy = 3
|
|
688
|
-
}) {
|
|
689
|
-
const words = curr.text.split(" ");
|
|
690
|
-
const len = words.length;
|
|
691
|
-
if (curr.match || clipBy >= len) {
|
|
692
|
-
return curr.text;
|
|
693
|
-
}
|
|
694
|
-
const ellipsis = "...";
|
|
695
|
-
if (chunkExists(next) && chunkExists(prev) && hasMatch(prev) && hasMatch(next)) {
|
|
696
|
-
if (len > clipBy * 2) {
|
|
697
|
-
return [
|
|
698
|
-
...words.slice(0, clipBy),
|
|
699
|
-
ellipsis,
|
|
700
|
-
...words.slice(-clipBy)
|
|
701
|
-
].join(" ");
|
|
702
|
-
}
|
|
703
|
-
return curr.text;
|
|
704
|
-
}
|
|
705
|
-
if (chunkExists(next) && hasMatch(next)) {
|
|
706
|
-
return [ellipsis, ...words.slice(-clipBy)].join(" ");
|
|
707
|
-
}
|
|
708
|
-
if (chunkExists(prev) && hasMatch(prev)) {
|
|
709
|
-
return [...words.slice(0, clipBy), ellipsis].join(" ");
|
|
710
|
-
}
|
|
711
|
-
return curr.text;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
var __defProp = Object.defineProperty;
|
|
715
|
-
var __defProps = Object.defineProperties;
|
|
716
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
717
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
718
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
719
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
720
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
721
|
-
var __spreadValues = (a, b) => {
|
|
722
|
-
for (var prop in b || (b = {}))
|
|
723
|
-
if (__hasOwnProp.call(b, prop))
|
|
724
|
-
__defNormalProp(a, prop, b[prop]);
|
|
725
|
-
if (__getOwnPropSymbols)
|
|
726
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
727
|
-
if (__propIsEnum.call(b, prop))
|
|
728
|
-
__defNormalProp(a, prop, b[prop]);
|
|
729
|
-
}
|
|
730
|
-
return a;
|
|
731
|
-
};
|
|
732
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
733
|
-
const hasLength = (str) => str.length > 0;
|
|
734
|
-
const highlightWords = ({
|
|
735
|
-
text,
|
|
736
|
-
query,
|
|
737
|
-
clipBy,
|
|
738
|
-
matchExactly = false
|
|
739
|
-
}) => {
|
|
740
|
-
const safeQuery = typeof query === "string" ? query.trim() : query;
|
|
741
|
-
if (safeQuery === "") {
|
|
742
|
-
return [
|
|
743
|
-
{
|
|
744
|
-
key: uid(),
|
|
745
|
-
text,
|
|
746
|
-
match: false
|
|
747
|
-
}
|
|
748
|
-
];
|
|
749
|
-
}
|
|
750
|
-
const searchRegexp = buildRegexp({ terms: query, matchExactly });
|
|
751
|
-
return text.split(searchRegexp).filter(hasLength).map((str) => ({
|
|
752
|
-
// Compose the object for a match
|
|
753
|
-
key: uid(),
|
|
754
|
-
text: str,
|
|
755
|
-
match: matchExactly ? str.toLowerCase() === safeQuery.toLowerCase() : searchRegexp.test(str)
|
|
756
|
-
})).map((chunk, index, chunks) => __spreadValues(__spreadValues({}, chunk), typeof clipBy === "number" && {
|
|
757
|
-
// We only overwrite the text if there is a clip
|
|
758
|
-
text: clip(__spreadProps(__spreadValues(__spreadValues({
|
|
759
|
-
curr: chunk
|
|
760
|
-
}, index < chunks.length - 1 && { next: chunks[index + 1] }), index > 0 && { prev: chunks[index - 1] }), {
|
|
761
|
-
// If this wasn't the first chunk, set the previous chunk
|
|
762
|
-
clipBy
|
|
763
|
-
}))
|
|
764
|
-
}));
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
var __extends$5 = (undefined && undefined.__extends) || (function () {
|
|
768
|
-
var extendStatics = function (d, b) {
|
|
769
|
-
extendStatics = Object.setPrototypeOf ||
|
|
770
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
771
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
772
|
-
return extendStatics(d, b);
|
|
773
|
-
};
|
|
774
|
-
return function (d, b) {
|
|
775
|
-
if (typeof b !== "function" && b !== null)
|
|
776
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
777
|
-
extendStatics(d, b);
|
|
778
|
-
function __() { this.constructor = d; }
|
|
779
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
780
|
-
};
|
|
781
|
-
})();
|
|
782
|
-
var HighlightWords = /** @class */ (function (_super) {
|
|
783
|
-
__extends$5(HighlightWords, _super);
|
|
784
|
-
function HighlightWords() {
|
|
785
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
786
|
-
}
|
|
787
|
-
HighlightWords.prototype.render = function () {
|
|
788
|
-
var _a = this.props, text = _a.text, words = _a.words, highlightClassName = _a.highlightClassName, _b = _a.tagName, tagName = _b === void 0 ? 'span' : _b;
|
|
789
|
-
var query = typeof words === 'string' ? words : words.join(' ');
|
|
790
|
-
var chunks = highlightWords({ text: text, query: query });
|
|
791
|
-
return (React__default.createElement("span", { "aria-label": text }, chunks.map(function (chunk) {
|
|
792
|
-
if (!chunk.match) {
|
|
793
|
-
return React__default.createElement("span", { key: chunk.key, "aria-hidden": true }, chunk.text);
|
|
794
|
-
}
|
|
795
|
-
var Component = tagName;
|
|
796
|
-
return (React__default.createElement(Component, { key: chunk.key, className: highlightClassName, "aria-hidden": true }, chunk.text));
|
|
797
|
-
})));
|
|
798
|
-
};
|
|
799
|
-
return HighlightWords;
|
|
800
|
-
}(PureComponent));
|
|
801
|
-
|
|
802
|
-
var __extends$4 = (undefined && undefined.__extends) || (function () {
|
|
803
|
-
var extendStatics = function (d, b) {
|
|
804
|
-
extendStatics = Object.setPrototypeOf ||
|
|
805
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
806
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
807
|
-
return extendStatics(d, b);
|
|
808
|
-
};
|
|
809
|
-
return function (d, b) {
|
|
810
|
-
if (typeof b !== "function" && b !== null)
|
|
811
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
812
|
-
extendStatics(d, b);
|
|
813
|
-
function __() { this.constructor = d; }
|
|
814
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
815
|
-
};
|
|
816
|
-
})();
|
|
817
|
-
/** @class */ ((function (_super) {
|
|
818
|
-
__extends$4(AddressSuggestions, _super);
|
|
819
|
-
function AddressSuggestions() {
|
|
820
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
821
|
-
_this.loadSuggestionsUrl = 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address';
|
|
822
|
-
_this.getLoadSuggestionsData = function () {
|
|
823
|
-
var _a = _this.props, count = _a.count, filterFromBound = _a.filterFromBound, filterToBound = _a.filterToBound, filterLocations = _a.filterLocations, filterLocationsBoost = _a.filterLocationsBoost, filterLanguage = _a.filterLanguage, filterRestrictValue = _a.filterRestrictValue;
|
|
824
|
-
var query = _this.state.query;
|
|
825
|
-
// TODO: Type this params
|
|
826
|
-
var requestPayload = {
|
|
827
|
-
query: query,
|
|
828
|
-
count: count || 10,
|
|
829
|
-
};
|
|
830
|
-
// Ограничение поиска по типу
|
|
831
|
-
if (filterFromBound && filterToBound) {
|
|
832
|
-
requestPayload.from_bound = { value: filterFromBound };
|
|
833
|
-
requestPayload.to_bound = { value: filterToBound };
|
|
834
|
-
}
|
|
835
|
-
// Язык подсказок
|
|
836
|
-
if (filterLanguage) {
|
|
837
|
-
requestPayload.language = filterLanguage;
|
|
838
|
-
}
|
|
839
|
-
// Сужение области поиска
|
|
840
|
-
if (filterLocations) {
|
|
841
|
-
requestPayload.locations = filterLocations;
|
|
842
|
-
}
|
|
843
|
-
// Приоритет города при ранжировании
|
|
844
|
-
if (filterLocationsBoost) {
|
|
845
|
-
requestPayload.locations_boost = filterLocationsBoost;
|
|
846
|
-
}
|
|
847
|
-
// @see https://confluence.hflabs.ru/pages/viewpage.action?pageId=1023737934
|
|
848
|
-
if (filterRestrictValue) {
|
|
849
|
-
requestPayload.restrict_value = true;
|
|
850
|
-
}
|
|
851
|
-
return requestPayload;
|
|
852
|
-
};
|
|
853
|
-
_this.renderOption = function (suggestion) {
|
|
854
|
-
var _a = _this.props, renderOption = _a.renderOption, highlightClassName = _a.highlightClassName;
|
|
855
|
-
var query = _this.state.query;
|
|
856
|
-
return renderOption ? (renderOption(suggestion, query)) : (React__default.createElement(HighlightWords, { highlightClassName: highlightClassName || 'react-dadata--highlighted', words: _this.getHighlightWords(), tagName: "mark", text: suggestion.value }));
|
|
857
|
-
};
|
|
858
|
-
return _this;
|
|
859
|
-
}
|
|
860
|
-
return AddressSuggestions;
|
|
861
|
-
})(BaseSuggestions));
|
|
862
|
-
|
|
863
|
-
var __extends$3 = (undefined && undefined.__extends) || (function () {
|
|
864
|
-
var extendStatics = function (d, b) {
|
|
865
|
-
extendStatics = Object.setPrototypeOf ||
|
|
866
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
867
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
868
|
-
return extendStatics(d, b);
|
|
869
|
-
};
|
|
870
|
-
return function (d, b) {
|
|
871
|
-
if (typeof b !== "function" && b !== null)
|
|
872
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
873
|
-
extendStatics(d, b);
|
|
874
|
-
function __() { this.constructor = d; }
|
|
875
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
876
|
-
};
|
|
877
|
-
})();
|
|
878
|
-
var PartySuggestions = /** @class */ (function (_super) {
|
|
879
|
-
__extends$3(PartySuggestions, _super);
|
|
880
|
-
function PartySuggestions() {
|
|
881
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
882
|
-
_this.loadSuggestionsUrl = 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/party';
|
|
883
|
-
_this.getLoadSuggestionsData = function () {
|
|
884
|
-
var _a = _this.props, count = _a.count, filterStatus = _a.filterStatus, filterType = _a.filterType, filterOkved = _a.filterOkved, filterLocations = _a.filterLocations, filterLocationsBoost = _a.filterLocationsBoost;
|
|
885
|
-
var query = _this.state.query;
|
|
886
|
-
var requestPayload = {
|
|
887
|
-
query: query,
|
|
888
|
-
count: count || 10,
|
|
889
|
-
};
|
|
890
|
-
// Ограничение по статусу организации
|
|
891
|
-
if (filterStatus) {
|
|
892
|
-
requestPayload.status = filterStatus;
|
|
893
|
-
}
|
|
894
|
-
// Ограничение по ОКВЭД
|
|
895
|
-
// @see https://confluence.hflabs.ru/pages/viewpage.action?pageId=1093075333
|
|
896
|
-
if (filterOkved) {
|
|
897
|
-
requestPayload.okved = filterOkved;
|
|
898
|
-
}
|
|
899
|
-
// Ограничение по типу организации
|
|
900
|
-
if (filterType) {
|
|
901
|
-
requestPayload.type = filterType;
|
|
902
|
-
}
|
|
903
|
-
// Сужение области поиска
|
|
904
|
-
if (filterLocations) {
|
|
905
|
-
requestPayload.locations = filterLocations;
|
|
906
|
-
}
|
|
907
|
-
// Приоритет города при ранжировании
|
|
908
|
-
if (filterLocationsBoost) {
|
|
909
|
-
requestPayload.locations_boost = filterLocationsBoost;
|
|
910
|
-
}
|
|
911
|
-
return requestPayload;
|
|
912
|
-
};
|
|
913
|
-
_this.getSuggestionKey = function (suggestion) { return suggestion.data.hid; };
|
|
914
|
-
_this.renderOption = function (suggestion) {
|
|
915
|
-
var _a = _this.props, renderOption = _a.renderOption, highlightClassName = _a.highlightClassName;
|
|
916
|
-
var query = _this.state.query;
|
|
917
|
-
return renderOption ? (renderOption(suggestion, query)) : (React__default.createElement("div", null,
|
|
918
|
-
React__default.createElement("div", { className: suggestion.data.state.status === 'LIQUIDATED' ? 'react-dadata__suggestion--line-through' : undefined },
|
|
919
|
-
React__default.createElement(HighlightWords, { highlightClassName: highlightClassName || 'react-dadata--highlighted', words: _this.getHighlightWords(), text: suggestion.value })),
|
|
920
|
-
React__default.createElement("div", { className: "react-dadata__suggestion-subtitle" },
|
|
921
|
-
suggestion.data.inn && React__default.createElement("div", { className: "react-dadata__suggestion-subtitle-item" }, suggestion.data.inn),
|
|
922
|
-
suggestion.data.address && suggestion.data.address.value && (React__default.createElement("div", { className: "react-dadata__suggestion-subtitle-item" },
|
|
923
|
-
React__default.createElement(HighlightWords, { highlightClassName: highlightClassName || 'react-dadata--highlighted', words: _this.getHighlightWords(), text: suggestion.data.address.value }))))));
|
|
924
|
-
};
|
|
925
|
-
return _this;
|
|
926
|
-
}
|
|
927
|
-
return PartySuggestions;
|
|
928
|
-
}(BaseSuggestions));
|
|
929
|
-
|
|
930
|
-
var __extends$2 = (undefined && undefined.__extends) || (function () {
|
|
931
|
-
var extendStatics = function (d, b) {
|
|
932
|
-
extendStatics = Object.setPrototypeOf ||
|
|
933
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
934
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
935
|
-
return extendStatics(d, b);
|
|
936
|
-
};
|
|
937
|
-
return function (d, b) {
|
|
938
|
-
if (typeof b !== "function" && b !== null)
|
|
939
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
940
|
-
extendStatics(d, b);
|
|
941
|
-
function __() { this.constructor = d; }
|
|
942
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
943
|
-
};
|
|
944
|
-
})();
|
|
945
|
-
/** @class */ ((function (_super) {
|
|
946
|
-
__extends$2(BankSuggestions, _super);
|
|
947
|
-
function BankSuggestions() {
|
|
948
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
949
|
-
_this.loadSuggestionsUrl = 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/bank';
|
|
950
|
-
_this.getLoadSuggestionsData = function () {
|
|
951
|
-
var _a = _this.props, count = _a.count, filterStatus = _a.filterStatus, filterType = _a.filterType, filterLocations = _a.filterLocations, filterLocationsBoost = _a.filterLocationsBoost;
|
|
952
|
-
var query = _this.state.query;
|
|
953
|
-
var requestPayload = {
|
|
954
|
-
query: query,
|
|
955
|
-
count: count || 10,
|
|
956
|
-
};
|
|
957
|
-
// Ограничение по статусу организации
|
|
958
|
-
if (filterStatus) {
|
|
959
|
-
requestPayload.status = filterStatus;
|
|
960
|
-
}
|
|
961
|
-
// Ограничение по типу организации
|
|
962
|
-
if (filterType) {
|
|
963
|
-
requestPayload.type = filterType;
|
|
964
|
-
}
|
|
965
|
-
// Сужение области поиска
|
|
966
|
-
if (filterLocations) {
|
|
967
|
-
requestPayload.locations = filterLocations;
|
|
968
|
-
}
|
|
969
|
-
// Приоритет города при ранжировании
|
|
970
|
-
if (filterLocationsBoost) {
|
|
971
|
-
requestPayload.locations_boost = filterLocationsBoost;
|
|
972
|
-
}
|
|
973
|
-
return requestPayload;
|
|
974
|
-
};
|
|
975
|
-
_this.getSuggestionKey = function (suggestion) { return "".concat(suggestion.data.bic); };
|
|
976
|
-
_this.renderOption = function (suggestion) {
|
|
977
|
-
var _a = _this.props, renderOption = _a.renderOption, highlightClassName = _a.highlightClassName;
|
|
978
|
-
var query = _this.state.query;
|
|
979
|
-
return renderOption ? (renderOption(suggestion, query)) : (React__default.createElement("div", null,
|
|
980
|
-
React__default.createElement("div", { className: suggestion.data.state.status === 'LIQUIDATED' ? 'react-dadata__suggestion--line-through' : undefined },
|
|
981
|
-
React__default.createElement(HighlightWords, { highlightClassName: highlightClassName || 'react-dadata--highlighted', words: _this.getHighlightWords(), text: suggestion.value })),
|
|
982
|
-
React__default.createElement("div", { className: "react-dadata__suggestion-subtitle" },
|
|
983
|
-
suggestion.data.bic && React__default.createElement("div", { className: "react-dadata__suggestion-subtitle-item" }, suggestion.data.bic),
|
|
984
|
-
suggestion.data.address && suggestion.data.address.value && (React__default.createElement("div", { className: "react-dadata__suggestion-subtitle-item" },
|
|
985
|
-
React__default.createElement(HighlightWords, { highlightClassName: highlightClassName || 'react-dadata--highlighted', words: _this.getHighlightWords(), text: suggestion.data.address.value }))))));
|
|
986
|
-
};
|
|
987
|
-
return _this;
|
|
988
|
-
}
|
|
989
|
-
return BankSuggestions;
|
|
990
|
-
})(BaseSuggestions));
|
|
991
|
-
|
|
992
|
-
var __extends$1 = (undefined && undefined.__extends) || (function () {
|
|
993
|
-
var extendStatics = function (d, b) {
|
|
994
|
-
extendStatics = Object.setPrototypeOf ||
|
|
995
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
996
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
997
|
-
return extendStatics(d, b);
|
|
998
|
-
};
|
|
999
|
-
return function (d, b) {
|
|
1000
|
-
if (typeof b !== "function" && b !== null)
|
|
1001
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1002
|
-
extendStatics(d, b);
|
|
1003
|
-
function __() { this.constructor = d; }
|
|
1004
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1005
|
-
};
|
|
1006
|
-
})();
|
|
1007
|
-
/** @class */ ((function (_super) {
|
|
1008
|
-
__extends$1(FioSuggestions, _super);
|
|
1009
|
-
function FioSuggestions() {
|
|
1010
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
1011
|
-
_this.loadSuggestionsUrl = 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/fio';
|
|
1012
|
-
_this.getLoadSuggestionsData = function () {
|
|
1013
|
-
var _a = _this.props, count = _a.count, filterGender = _a.filterGender, filterParts = _a.filterParts;
|
|
1014
|
-
var query = _this.state.query;
|
|
1015
|
-
var requestPayload = {
|
|
1016
|
-
query: query,
|
|
1017
|
-
count: count || 10,
|
|
1018
|
-
};
|
|
1019
|
-
// Ограничение по полу
|
|
1020
|
-
if (filterGender) {
|
|
1021
|
-
requestPayload.gender = filterGender;
|
|
1022
|
-
}
|
|
1023
|
-
// Ограничение по части ФИО
|
|
1024
|
-
if (filterParts) {
|
|
1025
|
-
requestPayload.parts = filterParts;
|
|
1026
|
-
}
|
|
1027
|
-
return requestPayload;
|
|
1028
|
-
};
|
|
1029
|
-
_this.getSuggestionKey = function (suggestion) {
|
|
1030
|
-
return "name:".concat(suggestion.data.name || '', "surname:").concat(suggestion.data.surname || '', "patronymic:").concat(suggestion.data.patronymic || '');
|
|
1031
|
-
};
|
|
1032
|
-
_this.renderOption = function (suggestion) {
|
|
1033
|
-
var _a = _this.props, renderOption = _a.renderOption, highlightClassName = _a.highlightClassName;
|
|
1034
|
-
var query = _this.state.query;
|
|
1035
|
-
return renderOption ? (renderOption(suggestion, query)) : (React__default.createElement("div", null,
|
|
1036
|
-
React__default.createElement(HighlightWords, { highlightClassName: highlightClassName || 'react-dadata--highlighted', words: _this.getHighlightWords(), text: suggestion.value })));
|
|
1037
|
-
};
|
|
1038
|
-
return _this;
|
|
1039
|
-
}
|
|
1040
|
-
return FioSuggestions;
|
|
1041
|
-
})(BaseSuggestions));
|
|
1042
|
-
|
|
1043
|
-
var __extends = (undefined && undefined.__extends) || (function () {
|
|
1044
|
-
var extendStatics = function (d, b) {
|
|
1045
|
-
extendStatics = Object.setPrototypeOf ||
|
|
1046
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1047
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1048
|
-
return extendStatics(d, b);
|
|
1049
|
-
};
|
|
1050
|
-
return function (d, b) {
|
|
1051
|
-
if (typeof b !== "function" && b !== null)
|
|
1052
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1053
|
-
extendStatics(d, b);
|
|
1054
|
-
function __() { this.constructor = d; }
|
|
1055
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1056
|
-
};
|
|
1057
|
-
})();
|
|
1058
|
-
/** @class */ ((function (_super) {
|
|
1059
|
-
__extends(EmailSuggestions, _super);
|
|
1060
|
-
function EmailSuggestions() {
|
|
1061
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
1062
|
-
_this.loadSuggestionsUrl = 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/email';
|
|
1063
|
-
_this.getLoadSuggestionsData = function () {
|
|
1064
|
-
var count = _this.props.count;
|
|
1065
|
-
var query = _this.state.query;
|
|
1066
|
-
return {
|
|
1067
|
-
query: query,
|
|
1068
|
-
count: count || 10,
|
|
1069
|
-
};
|
|
1070
|
-
};
|
|
1071
|
-
_this.getSuggestionKey = function (suggestion) { return suggestion.value; };
|
|
1072
|
-
_this.renderOption = function (suggestion) {
|
|
1073
|
-
var _a = _this.props, renderOption = _a.renderOption, highlightClassName = _a.highlightClassName;
|
|
1074
|
-
var query = _this.state.query;
|
|
1075
|
-
return renderOption ? (renderOption(suggestion, query)) : (React__default.createElement("div", null,
|
|
1076
|
-
React__default.createElement(HighlightWords, { highlightClassName: highlightClassName || 'react-dadata--highlighted', words: _this.getHighlightWords(), text: suggestion.value })));
|
|
1077
|
-
};
|
|
1078
|
-
return _this;
|
|
1079
|
-
}
|
|
1080
|
-
return EmailSuggestions;
|
|
1081
|
-
})(BaseSuggestions));
|
|
1082
|
-
|
|
1083
|
-
function DadataHintField(props) {
|
|
1084
|
-
const {
|
|
1085
|
-
delay,
|
|
1086
|
-
inputProps,
|
|
1087
|
-
setValue,
|
|
1088
|
-
input,
|
|
1089
|
-
meta,
|
|
1090
|
-
token
|
|
1091
|
-
} = props;
|
|
1092
|
-
const dadataInputProps = useMemo(() => {
|
|
1093
|
-
return {
|
|
1094
|
-
...inputProps,
|
|
1095
|
-
className: clsx('react-dadata__input', meta.active && 'input_state_focus', meta.error && meta.touched && `input_state_${meta.error.key || 'error'}`),
|
|
1096
|
-
// https://www.npmjs.com/package/react-dadata
|
|
1097
|
-
// "Свойство value игнорируется."
|
|
1098
|
-
// value: input.value,
|
|
1099
|
-
inputValue: input.value,
|
|
1100
|
-
onFocus: input.onFocus,
|
|
1101
|
-
onBlur: input.onBlur,
|
|
1102
|
-
onChange: input.onChange
|
|
1103
|
-
};
|
|
1104
|
-
}, [inputProps, meta.active, meta.error, meta.touched, input.value, input.onFocus, input.onBlur, input.onChange]);
|
|
1105
|
-
return /*#__PURE__*/React__default.createElement(PartySuggestions, {
|
|
1106
|
-
customInput: DadataСustomInput,
|
|
1107
|
-
delay: delay || 750,
|
|
1108
|
-
inputProps: dadataInputProps,
|
|
1109
|
-
minChars: 3,
|
|
1110
|
-
token: token,
|
|
1111
|
-
onChange: setValue
|
|
1112
|
-
});
|
|
1113
|
-
}
|
|
1114
|
-
DadataHintField.propTypes = {
|
|
1115
|
-
delay: PropTypes.number,
|
|
1116
|
-
input: PropTypes.object,
|
|
1117
|
-
inputProps: PropTypes.object,
|
|
1118
|
-
meta: PropTypes.object,
|
|
1119
|
-
setValue: PropTypes.func,
|
|
1120
|
-
token: PropTypes.string
|
|
1121
|
-
};
|
|
1122
|
-
function DadataСustomInput(props) {
|
|
1123
|
-
const {
|
|
1124
|
-
inputValue,
|
|
1125
|
-
...otherProps
|
|
1126
|
-
} = props;
|
|
1127
|
-
return /*#__PURE__*/React__default.createElement(Input, Object.assign({}, otherProps, {
|
|
1128
|
-
value: inputValue
|
|
1129
|
-
}));
|
|
1130
|
-
}
|
|
1131
|
-
DadataСustomInput.propTypes = {
|
|
1132
|
-
inputValue: PropTypes.object
|
|
1133
|
-
};
|
|
1134
|
-
DadataHintField.__docgenInfo = {
|
|
1135
|
-
"description": "",
|
|
1136
|
-
"methods": [],
|
|
1137
|
-
"displayName": "DadataHintField",
|
|
1138
|
-
"props": {
|
|
1139
|
-
"delay": {
|
|
1140
|
-
"description": "",
|
|
1141
|
-
"type": {
|
|
1142
|
-
"name": "number"
|
|
1143
|
-
},
|
|
1144
|
-
"required": false
|
|
1145
|
-
},
|
|
1146
|
-
"input": {
|
|
1147
|
-
"description": "",
|
|
1148
|
-
"type": {
|
|
1149
|
-
"name": "object"
|
|
1150
|
-
},
|
|
1151
|
-
"required": false
|
|
1152
|
-
},
|
|
1153
|
-
"inputProps": {
|
|
1154
|
-
"description": "",
|
|
1155
|
-
"type": {
|
|
1156
|
-
"name": "object"
|
|
1157
|
-
},
|
|
1158
|
-
"required": false
|
|
1159
|
-
},
|
|
1160
|
-
"meta": {
|
|
1161
|
-
"description": "",
|
|
1162
|
-
"type": {
|
|
1163
|
-
"name": "object"
|
|
1164
|
-
},
|
|
1165
|
-
"required": false
|
|
1166
|
-
},
|
|
1167
|
-
"setValue": {
|
|
1168
|
-
"description": "",
|
|
1169
|
-
"type": {
|
|
1170
|
-
"name": "func"
|
|
1171
|
-
},
|
|
1172
|
-
"required": false
|
|
1173
|
-
},
|
|
1174
|
-
"token": {
|
|
1175
|
-
"description": "",
|
|
1176
|
-
"type": {
|
|
1177
|
-
"name": "string"
|
|
1178
|
-
},
|
|
1179
|
-
"required": false
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
};
|
|
1183
|
-
|
|
1184
|
-
export { DadataHintField };
|