@arco-design/mobile-react 2.19.1 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.en-US.md +6 -6
- package/README.md +6 -6
- package/cjs/_helpers/type.d.ts +1 -1
- package/cjs/avatar/group.js +1 -1
- package/cjs/avatar/index.d.ts +1 -1
- package/cjs/avatar/index.js +11 -14
- package/cjs/avatar/style/css/index.css +96 -126
- package/cjs/avatar/style/index.less +54 -72
- package/cjs/badge/index.d.ts +1 -1
- package/cjs/badge/index.js +7 -9
- package/cjs/badge/style/css/index.css +5 -5
- package/cjs/badge/style/index.less +5 -5
- package/cjs/button/hooks.d.ts +1 -2
- package/cjs/button/hooks.js +5 -3
- package/cjs/button/index.d.ts +6 -0
- package/cjs/button/index.js +38 -33
- package/cjs/button/style/css/index.css +75 -310
- package/cjs/button/style/index.less +32 -38
- package/cjs/carousel/index.d.ts +1 -1
- package/cjs/carousel/index.js +1 -1
- package/cjs/cell/index.d.ts +1 -1
- package/cjs/cell/index.js +1 -1
- package/cjs/checkbox/index.d.ts +1 -1
- package/cjs/checkbox/index.js +1 -1
- package/cjs/collapse/index.d.ts +1 -1
- package/cjs/collapse/index.js +1 -1
- package/cjs/count-down/demo/style/mobile.less +1 -1
- package/cjs/count-down/index.d.ts +1 -1
- package/cjs/count-down/index.js +1 -1
- package/cjs/date-picker/index.d.ts +1 -1
- package/cjs/date-picker/index.js +1 -1
- package/cjs/dropdown/dropdown.d.ts +3 -0
- package/cjs/dropdown/dropdown.js +322 -0
- package/cjs/dropdown/index.d.ts +3 -4
- package/cjs/dropdown/index.js +3 -303
- package/cjs/dropdown/options.js +2 -1
- package/cjs/dropdown/style/css/index.css +3 -0
- package/cjs/dropdown/style/index.less +2 -0
- package/cjs/dropdown/type.d.ts +20 -9
- package/cjs/dropdown-menu/dropdown-menu.d.ts +4 -0
- package/cjs/dropdown-menu/dropdown-menu.js +273 -0
- package/cjs/dropdown-menu/helper.d.ts +1 -1
- package/cjs/dropdown-menu/index.d.ts +2 -3
- package/cjs/dropdown-menu/index.js +2 -245
- package/cjs/dropdown-menu/type.d.ts +21 -20
- package/cjs/ellipsis/index.d.ts +1 -1
- package/cjs/ellipsis/index.js +1 -1
- package/cjs/grid/index.js +13 -12
- package/cjs/image/index.d.ts +1 -2
- package/cjs/image/index.js +14 -9
- package/cjs/image/style/css/index.css +2 -1
- package/cjs/image/style/index.less +2 -1
- package/cjs/image-picker/add-icon.d.ts +2 -0
- package/cjs/image-picker/add-icon.js +22 -0
- package/cjs/image-picker/demo/style/css/mobile.css +40 -0
- package/cjs/image-picker/demo/style/mobile.less +42 -0
- package/cjs/image-picker/index.d.ts +13 -0
- package/cjs/image-picker/index.js +331 -0
- package/cjs/image-picker/style/css/index.css +147 -0
- package/cjs/image-picker/style/css/index.d.ts +2 -0
- package/cjs/image-picker/style/css/index.js +5 -0
- package/cjs/image-picker/style/index.d.ts +2 -0
- package/cjs/image-picker/style/index.js +5 -0
- package/cjs/image-picker/style/index.less +116 -0
- package/cjs/image-picker/type.d.ts +174 -0
- package/cjs/image-picker/type.js +3 -0
- package/cjs/image-preview/index.d.ts +3 -3
- package/cjs/image-preview/index.js +1 -1
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +13 -1
- package/cjs/input/hooks.js +49 -8
- package/cjs/input/index.d.ts +1 -1
- package/cjs/input/index.js +1 -1
- package/cjs/input/props.d.ts +8 -2
- package/cjs/nav-bar/index.js +7 -2
- package/cjs/notice-bar/index.d.ts +1 -1
- package/cjs/notice-bar/index.js +1 -1
- package/cjs/picker/index.d.ts +1 -1
- package/cjs/picker/index.js +1 -1
- package/cjs/picker-view/index.d.ts +1 -1
- package/cjs/picker-view/index.js +1 -1
- package/cjs/popover/index.d.ts +1 -1
- package/cjs/popover/index.js +1 -1
- package/cjs/popup-swiper/index.js +3 -2
- package/cjs/radio/index.d.ts +1 -1
- package/cjs/radio/index.js +1 -1
- package/cjs/rate/index.d.ts +1 -1
- package/cjs/rate/index.js +1 -1
- package/cjs/search-bar/association.d.ts +3 -0
- package/cjs/search-bar/association.js +92 -0
- package/cjs/search-bar/cancel-button.d.ts +10 -0
- package/cjs/search-bar/cancel-button.js +41 -0
- package/cjs/search-bar/demo/style/css/mobile.css +5 -0
- package/cjs/search-bar/demo/style/mobile.less +9 -0
- package/cjs/search-bar/highlight.d.ts +12 -0
- package/cjs/search-bar/highlight.js +77 -0
- package/cjs/search-bar/index.d.ts +13 -0
- package/cjs/search-bar/index.js +239 -0
- package/cjs/search-bar/style/css/index.css +148 -0
- package/cjs/search-bar/style/css/index.d.ts +2 -0
- package/cjs/search-bar/style/css/index.js +5 -0
- package/cjs/search-bar/style/index.d.ts +2 -0
- package/cjs/search-bar/style/index.js +5 -0
- package/cjs/search-bar/style/index.less +111 -0
- package/cjs/search-bar/type.d.ts +163 -0
- package/cjs/search-bar/type.js +3 -0
- package/cjs/show-monitor/index.js +31 -3
- package/cjs/slider/index.d.ts +1 -1
- package/cjs/slider/index.js +1 -1
- package/cjs/steps/demo/style/css/mobile.css +1 -1
- package/cjs/steps/demo/style/mobile.less +1 -1
- package/cjs/steps/index.d.ts +1 -1
- package/cjs/steps/index.js +1 -1
- package/cjs/steps/style/css/index.css +5 -15
- package/cjs/steps/style/index.less +6 -10
- package/cjs/sticky/index.d.ts +1 -1
- package/cjs/style.d.ts +3 -0
- package/cjs/style.js +6 -0
- package/cjs/swipe-action/demo/style/css/mobile.css +5 -0
- package/cjs/swipe-action/demo/style/mobile.less +9 -0
- package/cjs/swipe-action/index.d.ts +12 -0
- package/cjs/swipe-action/index.js +339 -0
- package/cjs/swipe-action/item.d.ts +11 -0
- package/cjs/swipe-action/item.js +52 -0
- package/cjs/swipe-action/style/css/index.css +88 -0
- package/cjs/swipe-action/style/css/index.d.ts +2 -0
- package/cjs/swipe-action/style/css/index.js +5 -0
- package/cjs/swipe-action/style/index.d.ts +2 -0
- package/cjs/swipe-action/style/index.js +5 -0
- package/cjs/swipe-action/style/index.less +89 -0
- package/cjs/swipe-action/type.d.ts +123 -0
- package/cjs/swipe-action/type.js +3 -0
- package/cjs/switch/index.d.ts +1 -1
- package/cjs/switch/index.js +1 -1
- package/cjs/tabs/tab-pane.js +5 -1
- package/cjs/tag/index.d.ts +1 -1
- package/cjs/tag/index.js +1 -1
- package/cjs/textarea/index.d.ts +1 -1
- package/cjs/textarea/index.js +1 -1
- package/dist/index.js +8040 -6845
- package/dist/index.min.js +6 -7
- package/dist/style.css +497 -447
- package/dist/style.min.css +1 -1
- package/esm/_helpers/type.d.ts +1 -1
- package/esm/avatar/group.js +1 -1
- package/esm/avatar/index.d.ts +1 -1
- package/esm/avatar/index.js +11 -14
- package/esm/avatar/style/css/index.css +96 -126
- package/esm/avatar/style/index.less +54 -72
- package/esm/badge/index.d.ts +1 -1
- package/esm/badge/index.js +7 -9
- package/esm/badge/style/css/index.css +5 -5
- package/esm/badge/style/index.less +5 -5
- package/esm/button/hooks.d.ts +1 -2
- package/esm/button/hooks.js +5 -3
- package/esm/button/index.d.ts +6 -0
- package/esm/button/index.js +40 -35
- package/esm/button/style/css/index.css +75 -310
- package/esm/button/style/index.less +32 -38
- package/esm/carousel/index.d.ts +1 -1
- package/esm/carousel/index.js +1 -1
- package/esm/cell/index.d.ts +1 -1
- package/esm/cell/index.js +1 -1
- package/esm/checkbox/index.d.ts +1 -1
- package/esm/checkbox/index.js +1 -1
- package/esm/collapse/index.d.ts +1 -1
- package/esm/collapse/index.js +1 -1
- package/esm/count-down/demo/style/mobile.less +1 -1
- package/esm/count-down/index.d.ts +1 -1
- package/esm/count-down/index.js +1 -1
- package/esm/date-picker/index.d.ts +1 -1
- package/esm/date-picker/index.js +1 -1
- package/esm/dropdown/dropdown.d.ts +3 -0
- package/esm/dropdown/dropdown.js +304 -0
- package/esm/dropdown/index.d.ts +3 -4
- package/esm/dropdown/index.js +3 -293
- package/esm/dropdown/options.js +2 -1
- package/esm/dropdown/style/css/index.css +3 -0
- package/esm/dropdown/style/index.less +2 -0
- package/esm/dropdown/type.d.ts +20 -9
- package/esm/dropdown-menu/dropdown-menu.d.ts +4 -0
- package/esm/dropdown-menu/dropdown-menu.js +256 -0
- package/esm/dropdown-menu/helper.d.ts +1 -1
- package/esm/dropdown-menu/index.d.ts +2 -3
- package/esm/dropdown-menu/index.js +2 -237
- package/esm/dropdown-menu/type.d.ts +21 -20
- package/esm/ellipsis/index.d.ts +1 -1
- package/esm/ellipsis/index.js +1 -1
- package/esm/grid/index.js +13 -12
- package/esm/image/index.d.ts +1 -2
- package/esm/image/index.js +15 -10
- package/esm/image/style/css/index.css +2 -1
- package/esm/image/style/index.less +2 -1
- package/esm/image-picker/add-icon.d.ts +2 -0
- package/esm/image-picker/add-icon.js +14 -0
- package/esm/image-picker/demo/style/css/mobile.css +40 -0
- package/esm/image-picker/demo/style/mobile.less +42 -0
- package/esm/image-picker/index.d.ts +13 -0
- package/esm/image-picker/index.js +302 -0
- package/esm/image-picker/style/css/index.css +147 -0
- package/esm/image-picker/style/css/index.d.ts +2 -0
- package/esm/image-picker/style/css/index.js +2 -0
- package/esm/image-picker/style/index.d.ts +2 -0
- package/esm/image-picker/style/index.js +2 -0
- package/esm/image-picker/style/index.less +116 -0
- package/esm/image-picker/type.d.ts +174 -0
- package/esm/image-picker/type.js +1 -0
- package/esm/image-preview/index.d.ts +3 -3
- package/esm/image-preview/index.js +1 -1
- package/esm/index.d.ts +3 -0
- package/esm/index.js +3 -0
- package/esm/input/hooks.js +49 -8
- package/esm/input/index.d.ts +1 -1
- package/esm/input/index.js +1 -1
- package/esm/input/props.d.ts +8 -2
- package/esm/nav-bar/index.js +6 -2
- package/esm/notice-bar/index.d.ts +1 -1
- package/esm/notice-bar/index.js +1 -1
- package/esm/picker/index.d.ts +1 -1
- package/esm/picker/index.js +1 -1
- package/esm/picker-view/index.d.ts +1 -1
- package/esm/picker-view/index.js +1 -1
- package/esm/popover/index.d.ts +1 -1
- package/esm/popover/index.js +1 -1
- package/esm/popup-swiper/index.js +3 -2
- package/esm/radio/index.d.ts +1 -1
- package/esm/radio/index.js +1 -1
- package/esm/rate/index.d.ts +1 -1
- package/esm/rate/index.js +1 -1
- package/esm/search-bar/association.d.ts +3 -0
- package/esm/search-bar/association.js +82 -0
- package/esm/search-bar/cancel-button.d.ts +10 -0
- package/esm/search-bar/cancel-button.js +30 -0
- package/esm/search-bar/demo/style/css/mobile.css +5 -0
- package/esm/search-bar/demo/style/mobile.less +9 -0
- package/esm/search-bar/highlight.d.ts +12 -0
- package/esm/search-bar/highlight.js +66 -0
- package/esm/search-bar/index.d.ts +13 -0
- package/esm/search-bar/index.js +213 -0
- package/esm/search-bar/style/css/index.css +148 -0
- package/esm/search-bar/style/css/index.d.ts +2 -0
- package/esm/search-bar/style/css/index.js +2 -0
- package/esm/search-bar/style/index.d.ts +2 -0
- package/esm/search-bar/style/index.js +2 -0
- package/esm/search-bar/style/index.less +111 -0
- package/esm/search-bar/type.d.ts +163 -0
- package/esm/search-bar/type.js +1 -0
- package/esm/show-monitor/index.js +31 -3
- package/esm/slider/index.d.ts +1 -1
- package/esm/slider/index.js +1 -1
- package/esm/steps/demo/style/css/mobile.css +1 -1
- package/esm/steps/demo/style/mobile.less +1 -1
- package/esm/steps/index.d.ts +1 -1
- package/esm/steps/index.js +1 -1
- package/esm/steps/style/css/index.css +5 -15
- package/esm/steps/style/index.less +6 -10
- package/esm/sticky/index.d.ts +1 -1
- package/esm/style.d.ts +3 -0
- package/esm/style.js +3 -0
- package/esm/swipe-action/demo/style/css/mobile.css +5 -0
- package/esm/swipe-action/demo/style/mobile.less +9 -0
- package/esm/swipe-action/index.d.ts +12 -0
- package/esm/swipe-action/index.js +321 -0
- package/esm/swipe-action/item.d.ts +11 -0
- package/esm/swipe-action/item.js +42 -0
- package/esm/swipe-action/style/css/index.css +88 -0
- package/esm/swipe-action/style/css/index.d.ts +2 -0
- package/esm/swipe-action/style/css/index.js +2 -0
- package/esm/swipe-action/style/index.d.ts +2 -0
- package/esm/swipe-action/style/index.js +2 -0
- package/esm/swipe-action/style/index.less +89 -0
- package/esm/swipe-action/type.d.ts +123 -0
- package/esm/swipe-action/type.js +1 -0
- package/esm/switch/index.d.ts +1 -1
- package/esm/switch/index.js +1 -1
- package/esm/tabs/tab-pane.js +5 -1
- package/esm/tag/index.d.ts +1 -1
- package/esm/tag/index.js +1 -1
- package/esm/textarea/index.d.ts +1 -1
- package/esm/textarea/index.js +1 -1
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +53 -3
- package/tokens/app/arcodesign/default/index.d.ts +53 -3
- package/tokens/app/arcodesign/default/index.js +54 -4
- package/tokens/app/arcodesign/default/index.json +629 -39
- package/tokens/app/arcodesign/default/index.less +53 -3
- package/umd/_helpers/type.d.ts +1 -1
- package/umd/avatar/group.js +1 -1
- package/umd/avatar/index.d.ts +1 -1
- package/umd/avatar/index.js +11 -14
- package/umd/avatar/style/css/index.css +96 -126
- package/umd/avatar/style/index.less +54 -72
- package/umd/badge/index.d.ts +1 -1
- package/umd/badge/index.js +7 -9
- package/umd/badge/style/css/index.css +5 -5
- package/umd/badge/style/index.less +5 -5
- package/umd/button/hooks.d.ts +1 -2
- package/umd/button/hooks.js +5 -3
- package/umd/button/index.d.ts +6 -0
- package/umd/button/index.js +38 -33
- package/umd/button/style/css/index.css +75 -310
- package/umd/button/style/index.less +32 -38
- package/umd/carousel/index.d.ts +1 -1
- package/umd/carousel/index.js +1 -1
- package/umd/cell/index.d.ts +1 -1
- package/umd/cell/index.js +1 -1
- package/umd/checkbox/index.d.ts +1 -1
- package/umd/checkbox/index.js +1 -1
- package/umd/collapse/index.d.ts +1 -1
- package/umd/collapse/index.js +1 -1
- package/umd/count-down/demo/style/mobile.less +1 -1
- package/umd/count-down/index.d.ts +1 -1
- package/umd/count-down/index.js +1 -1
- package/umd/date-picker/index.d.ts +1 -1
- package/umd/date-picker/index.js +1 -1
- package/umd/dropdown/dropdown.d.ts +3 -0
- package/umd/dropdown/dropdown.js +325 -0
- package/umd/dropdown/index.d.ts +3 -4
- package/umd/dropdown/index.js +5 -298
- package/umd/dropdown/options.js +2 -1
- package/umd/dropdown/style/css/index.css +3 -0
- package/umd/dropdown/style/index.less +2 -0
- package/umd/dropdown/type.d.ts +20 -9
- package/umd/dropdown-menu/dropdown-menu.d.ts +4 -0
- package/umd/dropdown-menu/dropdown-menu.js +278 -0
- package/umd/dropdown-menu/helper.d.ts +1 -1
- package/umd/dropdown-menu/index.d.ts +2 -3
- package/umd/dropdown-menu/index.js +5 -241
- package/umd/dropdown-menu/type.d.ts +21 -20
- package/umd/ellipsis/index.d.ts +1 -1
- package/umd/ellipsis/index.js +1 -1
- package/umd/grid/index.js +13 -12
- package/umd/image/index.d.ts +1 -2
- package/umd/image/index.js +14 -9
- package/umd/image/style/css/index.css +2 -1
- package/umd/image/style/index.less +2 -1
- package/umd/image-picker/add-icon.d.ts +2 -0
- package/umd/image-picker/add-icon.js +35 -0
- package/umd/image-picker/demo/style/css/mobile.css +40 -0
- package/umd/image-picker/demo/style/mobile.less +42 -0
- package/umd/image-picker/index.d.ts +13 -0
- package/umd/image-picker/index.js +329 -0
- package/umd/image-picker/style/css/index.css +147 -0
- package/umd/image-picker/style/css/index.d.ts +2 -0
- package/umd/image-picker/style/css/index.js +15 -0
- package/umd/image-picker/style/index.d.ts +2 -0
- package/umd/image-picker/style/index.js +15 -0
- package/umd/image-picker/style/index.less +116 -0
- package/umd/image-picker/type.d.ts +174 -0
- package/umd/image-picker/type.js +17 -0
- package/umd/image-preview/index.d.ts +3 -3
- package/umd/image-preview/index.js +1 -1
- package/umd/index.d.ts +3 -0
- package/umd/index.js +11 -5
- package/umd/input/hooks.js +48 -7
- package/umd/input/index.d.ts +1 -1
- package/umd/input/index.js +1 -1
- package/umd/input/props.d.ts +8 -2
- package/umd/nav-bar/index.js +9 -6
- package/umd/notice-bar/index.d.ts +1 -1
- package/umd/notice-bar/index.js +1 -1
- package/umd/picker/index.d.ts +1 -1
- package/umd/picker/index.js +1 -1
- package/umd/picker-view/index.d.ts +1 -1
- package/umd/picker-view/index.js +1 -1
- package/umd/popover/index.d.ts +1 -1
- package/umd/popover/index.js +1 -1
- package/umd/popup-swiper/index.js +3 -2
- package/umd/radio/index.d.ts +1 -1
- package/umd/radio/index.js +1 -1
- package/umd/rate/index.d.ts +1 -1
- package/umd/rate/index.js +1 -1
- package/umd/search-bar/association.d.ts +3 -0
- package/umd/search-bar/association.js +101 -0
- package/umd/search-bar/cancel-button.d.ts +10 -0
- package/umd/search-bar/cancel-button.js +52 -0
- package/umd/search-bar/demo/style/css/mobile.css +5 -0
- package/umd/search-bar/demo/style/mobile.less +9 -0
- package/umd/search-bar/highlight.d.ts +12 -0
- package/umd/search-bar/highlight.js +87 -0
- package/umd/search-bar/index.d.ts +13 -0
- package/umd/search-bar/index.js +235 -0
- package/umd/search-bar/style/css/index.css +148 -0
- package/umd/search-bar/style/css/index.d.ts +2 -0
- package/umd/search-bar/style/css/index.js +15 -0
- package/umd/search-bar/style/index.d.ts +2 -0
- package/umd/search-bar/style/index.js +15 -0
- package/umd/search-bar/style/index.less +111 -0
- package/umd/search-bar/type.d.ts +163 -0
- package/umd/search-bar/type.js +17 -0
- package/umd/show-monitor/index.js +31 -3
- package/umd/slider/index.d.ts +1 -1
- package/umd/slider/index.js +1 -1
- package/umd/steps/demo/style/css/mobile.css +1 -1
- package/umd/steps/demo/style/mobile.less +1 -1
- package/umd/steps/index.d.ts +1 -1
- package/umd/steps/index.js +1 -1
- package/umd/steps/style/css/index.css +5 -15
- package/umd/steps/style/index.less +6 -10
- package/umd/sticky/index.d.ts +1 -1
- package/umd/style.d.ts +3 -0
- package/umd/style.js +4 -4
- package/umd/swipe-action/demo/style/css/mobile.css +5 -0
- package/umd/swipe-action/demo/style/mobile.less +9 -0
- package/umd/swipe-action/index.d.ts +12 -0
- package/umd/swipe-action/index.js +342 -0
- package/umd/swipe-action/item.d.ts +11 -0
- package/umd/swipe-action/item.js +62 -0
- package/umd/swipe-action/style/css/index.css +88 -0
- package/umd/swipe-action/style/css/index.d.ts +2 -0
- package/umd/swipe-action/style/css/index.js +15 -0
- package/umd/swipe-action/style/index.d.ts +2 -0
- package/umd/swipe-action/style/index.js +15 -0
- package/umd/swipe-action/style/index.less +89 -0
- package/umd/swipe-action/type.d.ts +123 -0
- package/umd/swipe-action/type.js +17 -0
- package/umd/switch/index.d.ts +1 -1
- package/umd/switch/index.js +1 -1
- package/umd/tabs/tab-pane.js +5 -1
- package/umd/tag/index.d.ts +1 -1
- package/umd/tag/index.js +1 -1
- package/umd/textarea/index.d.ts +1 -1
- package/umd/textarea/index.js +1 -1
@@ -0,0 +1,82 @@
|
|
1
|
+
import { cls } from '@arco-design/mobile-utils';
|
2
|
+
import React from 'react';
|
3
|
+
import { highlightWithContainMode, highlightWithPrefixMode } from './highlight';
|
4
|
+
export function SearchBarAssociation(props) {
|
5
|
+
var _cls;
|
6
|
+
|
7
|
+
var prefixCls = props.prefixCls,
|
8
|
+
_props$associationIte = props.associationItems,
|
9
|
+
associationItems = _props$associationIte === void 0 ? [] : _props$associationIte,
|
10
|
+
highlightClassName = props.highlightClassName,
|
11
|
+
_props$highlightMode = props.highlightMode,
|
12
|
+
highlightMode = _props$highlightMode === void 0 ? 'none' : _props$highlightMode,
|
13
|
+
highlightStyle = props.highlightStyle,
|
14
|
+
onAssociationClick = props.onAssociationClick,
|
15
|
+
onAssociationItemClick = props.onAssociationItemClick,
|
16
|
+
renderAssociation = props.renderAssociation,
|
17
|
+
renderAssociationItem = props.renderAssociationItem,
|
18
|
+
keyword = props.keyword,
|
19
|
+
visible = props.visible;
|
20
|
+
var searchBarAssociationPrefixCls = prefixCls + "-association";
|
21
|
+
var defaultHighlightClassName = searchBarAssociationPrefixCls + "-item-highlight";
|
22
|
+
|
23
|
+
var renderHighlightNode = function renderHighlightNode(content) {
|
24
|
+
if (!content || !keyword || highlightMode === 'none') {
|
25
|
+
return content;
|
26
|
+
}
|
27
|
+
|
28
|
+
var config = {
|
29
|
+
keyword: keyword,
|
30
|
+
content: content,
|
31
|
+
highlightClassName: highlightClassName || defaultHighlightClassName,
|
32
|
+
highlightStyle: highlightStyle
|
33
|
+
};
|
34
|
+
|
35
|
+
if (highlightMode === 'contain') {
|
36
|
+
return highlightWithContainMode(config);
|
37
|
+
}
|
38
|
+
|
39
|
+
if (highlightMode === 'prefix') {
|
40
|
+
return highlightWithPrefixMode(config);
|
41
|
+
}
|
42
|
+
|
43
|
+
return typeof highlightMode === 'function' ? highlightMode(content, keyword, defaultHighlightClassName) : content;
|
44
|
+
};
|
45
|
+
|
46
|
+
var renderItem = function renderItem(item, index) {
|
47
|
+
var itemContent = item.content;
|
48
|
+
var node = itemContent; // itemContent为string类型,并且开启高亮模式才去走渲染高亮内容的逻辑
|
49
|
+
// @en When `itemContent` is a string, and the highlight mode is turned on, the logic of rendering the highlighted content is performed
|
50
|
+
|
51
|
+
if (typeof itemContent === 'string' && highlightMode !== 'none') {
|
52
|
+
node = renderHighlightNode(itemContent);
|
53
|
+
}
|
54
|
+
|
55
|
+
if (renderAssociationItem) {
|
56
|
+
node = renderAssociationItem(item, index, node);
|
57
|
+
}
|
58
|
+
|
59
|
+
return /*#__PURE__*/React.createElement("div", {
|
60
|
+
key: index,
|
61
|
+
className: searchBarAssociationPrefixCls + "-item",
|
62
|
+
onClick: function onClick() {
|
63
|
+
return onAssociationItemClick == null ? void 0 : onAssociationItemClick(item, index);
|
64
|
+
}
|
65
|
+
}, node);
|
66
|
+
};
|
67
|
+
|
68
|
+
var renderContent = function renderContent() {
|
69
|
+
var associationContent = associationItems.map(renderItem);
|
70
|
+
|
71
|
+
if (renderAssociation) {
|
72
|
+
return renderAssociation(associationContent);
|
73
|
+
}
|
74
|
+
|
75
|
+
return associationContent;
|
76
|
+
};
|
77
|
+
|
78
|
+
return /*#__PURE__*/React.createElement("div", {
|
79
|
+
className: cls(searchBarAssociationPrefixCls, (_cls = {}, _cls[searchBarAssociationPrefixCls + "-visible"] = visible, _cls)),
|
80
|
+
onClick: onAssociationClick
|
81
|
+
}, renderContent());
|
82
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface CancelButtonProps {
|
3
|
+
className: string;
|
4
|
+
onCancel?: () => void;
|
5
|
+
focusing: boolean;
|
6
|
+
currentInputValue: string;
|
7
|
+
text?: string;
|
8
|
+
}
|
9
|
+
export declare function CancelButton(props: CancelButtonProps): JSX.Element | null;
|
10
|
+
export {};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { nextTick } from '@arco-design/mobile-utils';
|
2
|
+
import React, { useEffect, useState } from 'react';
|
3
|
+
export function CancelButton(props) {
|
4
|
+
var className = props.className,
|
5
|
+
onCancel = props.onCancel,
|
6
|
+
focusing = props.focusing,
|
7
|
+
currentInputValue = props.currentInputValue,
|
8
|
+
text = props.text;
|
9
|
+
|
10
|
+
var _useState = useState(focusing || Boolean(currentInputValue)),
|
11
|
+
visible = _useState[0],
|
12
|
+
setVisible = _useState[1];
|
13
|
+
|
14
|
+
var handleClick = function handleClick() {
|
15
|
+
onCancel == null ? void 0 : onCancel(); // 如果不延迟,在聚焦切输入框有值的情况下,点击取消按钮会造成闪烁
|
16
|
+
// @en If there is no delay, when the focus cut input box has a value, clicking the cancel button will cause flickering
|
17
|
+
|
18
|
+
nextTick(function () {
|
19
|
+
setVisible(false);
|
20
|
+
});
|
21
|
+
};
|
22
|
+
|
23
|
+
useEffect(function () {
|
24
|
+
setVisible(focusing || Boolean(currentInputValue));
|
25
|
+
}, [focusing, currentInputValue]);
|
26
|
+
return visible ? /*#__PURE__*/React.createElement("span", {
|
27
|
+
className: className,
|
28
|
+
onClick: handleClick
|
29
|
+
}, text) : null;
|
30
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { SearchBarAssociationHighlightConfig } from './type';
|
3
|
+
/**
|
4
|
+
* 高亮搜索候选项中,包含的关键字
|
5
|
+
*
|
6
|
+
*/
|
7
|
+
export declare function highlightWithContainMode(config: SearchBarAssociationHighlightConfig): React.ReactNode[];
|
8
|
+
/**
|
9
|
+
* 高亮搜索候选项和关键字的最长前缀公共字符串
|
10
|
+
*
|
11
|
+
*/
|
12
|
+
export declare function highlightWithPrefixMode(config: SearchBarAssociationHighlightConfig): string | (string | JSX.Element)[];
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
+
var _excluded = ["content", "keyword"];
|
4
|
+
import React from 'react';
|
5
|
+
|
6
|
+
function createHighlightNode(config, index) {
|
7
|
+
var keyword = config.keyword,
|
8
|
+
highlightClassName = config.highlightClassName,
|
9
|
+
highlightStyle = config.highlightStyle;
|
10
|
+
return /*#__PURE__*/React.createElement("span", {
|
11
|
+
className: highlightClassName,
|
12
|
+
style: highlightStyle,
|
13
|
+
key: index
|
14
|
+
}, keyword);
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* 高亮搜索候选项中,包含的关键字
|
18
|
+
*
|
19
|
+
*/
|
20
|
+
|
21
|
+
|
22
|
+
export function highlightWithContainMode(config) {
|
23
|
+
var _config$content = config.content,
|
24
|
+
content = _config$content === void 0 ? '' : _config$content,
|
25
|
+
_config$keyword = config.keyword,
|
26
|
+
keyword = _config$keyword === void 0 ? '' : _config$keyword; // 具体实现思路就是将keyword作为split的分隔符,切割content得到数组
|
27
|
+
|
28
|
+
var splitContent = content.split(keyword); // 再将高亮后的keyword节点,插空填入数组
|
29
|
+
|
30
|
+
var highlightResult = splitContent.reduce(function (prev, word, index) {
|
31
|
+
prev.push(word);
|
32
|
+
|
33
|
+
if (index !== splitContent.length - 1) {
|
34
|
+
prev.push(createHighlightNode(config, index));
|
35
|
+
}
|
36
|
+
|
37
|
+
return prev;
|
38
|
+
}, []);
|
39
|
+
return highlightResult;
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* 高亮搜索候选项和关键字的最长前缀公共字符串
|
43
|
+
*
|
44
|
+
*/
|
45
|
+
|
46
|
+
export function highlightWithPrefixMode(config) {
|
47
|
+
var _config$content2 = config.content,
|
48
|
+
content = _config$content2 === void 0 ? '' : _config$content2,
|
49
|
+
_config$keyword2 = config.keyword,
|
50
|
+
keyword = _config$keyword2 === void 0 ? '' : _config$keyword2,
|
51
|
+
otherConfig = _objectWithoutPropertiesLoose(config, _excluded);
|
52
|
+
|
53
|
+
var splitIndex = -1;
|
54
|
+
|
55
|
+
for (var i = 0; i < keyword.length; i++) {
|
56
|
+
if (i >= content.length || content[i] !== keyword[i]) {
|
57
|
+
break;
|
58
|
+
}
|
59
|
+
|
60
|
+
splitIndex = i;
|
61
|
+
}
|
62
|
+
|
63
|
+
return splitIndex > -1 ? [createHighlightNode(_extends({}, otherConfig, {
|
64
|
+
keyword: content.substring(0, splitIndex + 1)
|
65
|
+
}), 0), content.substring(splitIndex + 1)] : content;
|
66
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { SearchAssociationBaseItem, SearchBarProps, SearchBarRef } from './type';
|
3
|
+
export { SearchBarProps, SearchBarRef, SearchAssociationHighlightMode, SearchAssociationItem, SearchAssociationShowType, SearchBarShape, } from './type';
|
4
|
+
/**
|
5
|
+
* 搜索栏组件
|
6
|
+
* @en SearchBar component
|
7
|
+
* @type 数据录入
|
8
|
+
* @type_en Data Entry
|
9
|
+
* @name 搜索栏
|
10
|
+
* @name_en SearchBar
|
11
|
+
*/
|
12
|
+
declare const SearchBar: React.ForwardRefExoticComponent<SearchBarProps<SearchAssociationBaseItem> & React.RefAttributes<SearchBarRef>>;
|
13
|
+
export default SearchBar;
|
@@ -0,0 +1,213 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
+
var _excluded = ["inputClass", "inputStyle", "type", "nativeProps", "id", "name", "maxLength", "placeholder", "readOnly", "onKeyUp", "onKeyPress", "disabled", "pattern", "prefix", "append", "textAlign", "actionButton", "clearable", "clearShowType", "shape", "className", "enableAssociation", "associationVisible", "associationShowType", "associationItems", "highlightClassName", "highlightMode", "highlightStyle", "onCancel", "onAssociationClick", "onAssociationItemClick", "renderAssociation", "renderAssociationItem"];
|
4
|
+
import { cls } from '@arco-design/mobile-utils';
|
5
|
+
import React, { useRef, forwardRef, useImperativeHandle, useContext, useState } from 'react';
|
6
|
+
import { ContextLayout, GlobalContext } from '../context-provider';
|
7
|
+
import { IconSearch } from '../icon';
|
8
|
+
import { useInputLogic } from '../input/hooks';
|
9
|
+
import { SearchBarAssociation } from './association';
|
10
|
+
import { CancelButton } from './cancel-button';
|
11
|
+
export { SearchBarProps, SearchBarRef, SearchAssociationHighlightMode, SearchAssociationItem, SearchAssociationShowType, SearchBarShape } from './type';
|
12
|
+
/**
|
13
|
+
* 搜索栏组件
|
14
|
+
* @en SearchBar component
|
15
|
+
* @type 数据录入
|
16
|
+
* @type_en Data Entry
|
17
|
+
* @name 搜索栏
|
18
|
+
* @name_en SearchBar
|
19
|
+
*/
|
20
|
+
|
21
|
+
var SearchBar = /*#__PURE__*/forwardRef(function (props, ref) {
|
22
|
+
var _useContext = useContext(GlobalContext),
|
23
|
+
prefixCls = _useContext.prefixCls,
|
24
|
+
locale = _useContext.locale;
|
25
|
+
|
26
|
+
var searchBarPrefixCls = prefixCls + "-search-bar";
|
27
|
+
|
28
|
+
var inputClass = props.inputClass,
|
29
|
+
inputStyle = props.inputStyle,
|
30
|
+
_props$type = props.type,
|
31
|
+
type = _props$type === void 0 ? 'search' : _props$type,
|
32
|
+
nativeProps = props.nativeProps,
|
33
|
+
id = props.id,
|
34
|
+
name = props.name,
|
35
|
+
maxLength = props.maxLength,
|
36
|
+
_props$placeholder = props.placeholder,
|
37
|
+
placeholder = _props$placeholder === void 0 ? locale == null ? void 0 : locale.SearchBar.placeholder : _props$placeholder,
|
38
|
+
readOnly = props.readOnly,
|
39
|
+
onKeyUp = props.onKeyUp,
|
40
|
+
onKeyPress = props.onKeyPress,
|
41
|
+
disabled = props.disabled,
|
42
|
+
pattern = props.pattern,
|
43
|
+
_props$prefix = props.prefix,
|
44
|
+
prefix = _props$prefix === void 0 ? /*#__PURE__*/React.createElement(IconSearch, {
|
45
|
+
className: searchBarPrefixCls + "-search-icon"
|
46
|
+
}) : _props$prefix,
|
47
|
+
append = props.append,
|
48
|
+
_props$textAlign = props.textAlign,
|
49
|
+
textAlign = _props$textAlign === void 0 ? 'left' : _props$textAlign,
|
50
|
+
actionButton = props.actionButton,
|
51
|
+
_props$clearable = props.clearable,
|
52
|
+
clearable = _props$clearable === void 0 ? true : _props$clearable,
|
53
|
+
_props$clearShowType = props.clearShowType,
|
54
|
+
clearShowType = _props$clearShowType === void 0 ? 'value' : _props$clearShowType,
|
55
|
+
_props$shape = props.shape,
|
56
|
+
shape = _props$shape === void 0 ? 'square' : _props$shape,
|
57
|
+
className = props.className,
|
58
|
+
_props$enableAssociat = props.enableAssociation,
|
59
|
+
enableAssociation = _props$enableAssociat === void 0 ? false : _props$enableAssociat,
|
60
|
+
associationVisible = props.associationVisible,
|
61
|
+
_props$associationSho = props.associationShowType,
|
62
|
+
associationShowType = _props$associationSho === void 0 ? 'default' : _props$associationSho,
|
63
|
+
associationItems = props.associationItems,
|
64
|
+
highlightClassName = props.highlightClassName,
|
65
|
+
highlightMode = props.highlightMode,
|
66
|
+
highlightStyle = props.highlightStyle,
|
67
|
+
onCancel = props.onCancel,
|
68
|
+
onAssociationClick = props.onAssociationClick,
|
69
|
+
onAssociationItemClick = props.onAssociationItemClick,
|
70
|
+
renderAssociation = props.renderAssociation,
|
71
|
+
renderAssociationItem = props.renderAssociationItem,
|
72
|
+
inputProps = _objectWithoutPropertiesLoose(props, _excluded);
|
73
|
+
|
74
|
+
var inputRef = useRef(null);
|
75
|
+
/**
|
76
|
+
* 格式化搜索输入框尾部要插入的内容
|
77
|
+
* @en Format the content to be inserted at the end of the search input box
|
78
|
+
*/
|
79
|
+
|
80
|
+
var formatAppendProp = function formatAppendProp(focusing, currentInputValue) {
|
81
|
+
var appendNode = null;
|
82
|
+
|
83
|
+
if (typeof append === 'function') {
|
84
|
+
appendNode = append(focusing, currentInputValue);
|
85
|
+
} else {
|
86
|
+
appendNode = append;
|
87
|
+
} // 默认情况下,在激活时或有内容时插入一个cancelBtn
|
88
|
+
// @en By default inserts a cancelBtn on activation or when there is content
|
89
|
+
|
90
|
+
|
91
|
+
var formatActionButton = typeof actionButton === 'undefined' ? /*#__PURE__*/React.createElement(CancelButton, {
|
92
|
+
focusing: focusing,
|
93
|
+
currentInputValue: currentInputValue,
|
94
|
+
className: searchBarPrefixCls + "-cancel-btn",
|
95
|
+
onCancel: onCancel,
|
96
|
+
text: locale == null ? void 0 : locale.SearchBar.cancelBtn
|
97
|
+
}) : actionButton;
|
98
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, appendNode, formatActionButton, enableAssociation ? /*#__PURE__*/React.createElement(SearchBarAssociation, {
|
99
|
+
prefixCls: searchBarPrefixCls,
|
100
|
+
keyword: currentInputValue // eslint-disable-next-line @typescript-eslint/no-use-before-define
|
101
|
+
,
|
102
|
+
visible: actualVisible,
|
103
|
+
associationItems: associationItems,
|
104
|
+
highlightClassName: highlightClassName,
|
105
|
+
highlightMode: highlightMode,
|
106
|
+
highlightStyle: highlightStyle,
|
107
|
+
onAssociationClick: onAssociationClick,
|
108
|
+
onAssociationItemClick: onAssociationItemClick,
|
109
|
+
renderAssociation: renderAssociation,
|
110
|
+
renderAssociationItem: renderAssociationItem
|
111
|
+
}) : null);
|
112
|
+
};
|
113
|
+
|
114
|
+
var _useInputLogic = useInputLogic(_extends({
|
115
|
+
className: cls(className, searchBarPrefixCls + "-" + shape),
|
116
|
+
prefix: prefix,
|
117
|
+
clearable: clearable,
|
118
|
+
append: formatAppendProp,
|
119
|
+
clearShowType: clearShowType
|
120
|
+
}, inputProps), inputRef),
|
121
|
+
inputValue = _useInputLogic.inputValue,
|
122
|
+
handleChange = _useInputLogic.handleChange,
|
123
|
+
handleInput = _useInputLogic.handleInput,
|
124
|
+
handleKeyDown = _useInputLogic.handleKeyDown,
|
125
|
+
handleFocus = _useInputLogic.handleFocus,
|
126
|
+
handleBlur = _useInputLogic.handleBlur,
|
127
|
+
handleClick = _useInputLogic.handleClick,
|
128
|
+
renderWrapper = _useInputLogic.renderWrapper,
|
129
|
+
wrapRef = _useInputLogic.wrapRef;
|
130
|
+
|
131
|
+
var _useState = useState(associationShowType === 'always' || (associationShowType === 'value' || associationShowType === 'default') && Boolean(inputValue)),
|
132
|
+
visible = _useState[0],
|
133
|
+
setVisible = _useState[1]; // 真实的控制搜索联想框显隐,受控模式优先生效
|
134
|
+
// @en Control the display and hide of the search association box, and the controlled mode takes effect first
|
135
|
+
|
136
|
+
|
137
|
+
var actualVisible = associationVisible != null ? associationVisible : visible;
|
138
|
+
useImperativeHandle(ref, function () {
|
139
|
+
return {
|
140
|
+
dom: wrapRef.current,
|
141
|
+
input: inputRef.current,
|
142
|
+
toggleAssociation: function toggleAssociation(newVisible) {
|
143
|
+
setVisible(newVisible != null ? newVisible : !visible);
|
144
|
+
}
|
145
|
+
};
|
146
|
+
});
|
147
|
+
/**
|
148
|
+
* 处理非受控逻辑下,搜索联想框的显隐状态
|
149
|
+
* @en Handle the display state of the search association box under uncontrolled logic
|
150
|
+
*
|
151
|
+
* @param {boolean} newVisible 新的visible
|
152
|
+
* @param {string} newValue 新的输入框值
|
153
|
+
*/
|
154
|
+
|
155
|
+
var formatSetAssociationVisible = function formatSetAssociationVisible(newVisible, newValue) {
|
156
|
+
if (associationShowType === 'always') {
|
157
|
+
setVisible(true); // 聚焦模式下,直接把visible和newVisible对齐即可
|
158
|
+
// @en In focus mode, just align visible and newVisible directly
|
159
|
+
} else if (associationShowType === 'focus') {
|
160
|
+
setVisible(newVisible); // 聚焦 + 有值模式下,需要newVisible为true和newValue.length > 0同时满足
|
161
|
+
// @en In focus + valued mode, newVisible is required to be true and newValue.length > 0 to be satisfied at the same time
|
162
|
+
} else if (associationShowType === 'default') {
|
163
|
+
setVisible(newVisible && Boolean(newValue)); // 仅有值模式下,visible需要newValue.length > 0
|
164
|
+
// @en In value-only mode, visible requires newValue.length > 0
|
165
|
+
} else if (associationShowType === 'value') {
|
166
|
+
setVisible(Boolean(newValue));
|
167
|
+
}
|
168
|
+
};
|
169
|
+
|
170
|
+
var handleInputFocus = function handleInputFocus(e) {
|
171
|
+
formatSetAssociationVisible(true, e.target.value);
|
172
|
+
handleFocus(e);
|
173
|
+
};
|
174
|
+
|
175
|
+
var handleInputBlur = function handleInputBlur(e) {
|
176
|
+
formatSetAssociationVisible(false, e.target.value);
|
177
|
+
handleBlur(e);
|
178
|
+
};
|
179
|
+
|
180
|
+
var handleInputChange = function handleInputChange(e) {
|
181
|
+
var newValue = e.target.value;
|
182
|
+
formatSetAssociationVisible(Boolean(newValue), newValue);
|
183
|
+
handleChange(e);
|
184
|
+
};
|
185
|
+
|
186
|
+
var renderSearchBar = function renderSearchBar() {
|
187
|
+
return renderWrapper(searchBarPrefixCls, type, /*#__PURE__*/React.createElement("input", _extends({}, nativeProps, {
|
188
|
+
id: id,
|
189
|
+
name: name,
|
190
|
+
maxLength: maxLength,
|
191
|
+
placeholder: placeholder,
|
192
|
+
readOnly: readOnly,
|
193
|
+
onFocus: handleInputFocus,
|
194
|
+
onBlur: handleInputBlur,
|
195
|
+
onKeyUp: onKeyUp,
|
196
|
+
onKeyPress: onKeyPress,
|
197
|
+
ref: inputRef,
|
198
|
+
className: cls(searchBarPrefixCls + "-input", inputClass, searchBarPrefixCls + "-input-" + textAlign),
|
199
|
+
style: inputStyle,
|
200
|
+
value: inputValue,
|
201
|
+
type: type,
|
202
|
+
disabled: disabled,
|
203
|
+
pattern: pattern,
|
204
|
+
onChange: handleInputChange,
|
205
|
+
onInput: handleInput,
|
206
|
+
onKeyDown: handleKeyDown,
|
207
|
+
onClick: handleClick
|
208
|
+
})));
|
209
|
+
};
|
210
|
+
|
211
|
+
return /*#__PURE__*/React.createElement(ContextLayout, null, renderSearchBar);
|
212
|
+
});
|
213
|
+
export default SearchBar;
|
@@ -0,0 +1,148 @@
|
|
1
|
+
.arco-search-bar-container {
|
2
|
+
display: -webkit-box;
|
3
|
+
display: -webkit-flex;
|
4
|
+
display: flex;
|
5
|
+
-webkit-box-align: center;
|
6
|
+
-webkit-align-items: center;
|
7
|
+
align-items: center;
|
8
|
+
position: relative;
|
9
|
+
padding: 0.32rem ;
|
10
|
+
background-color: #FFFFFF ;
|
11
|
+
}
|
12
|
+
.arco-search-bar-square .arco-search-bar-wrap {
|
13
|
+
border-radius: 0.04rem ;
|
14
|
+
}
|
15
|
+
.arco-search-bar-round .arco-search-bar-wrap {
|
16
|
+
border-radius: 199.98rem ;
|
17
|
+
}
|
18
|
+
.arco-search-bar-wrap {
|
19
|
+
display: -webkit-box;
|
20
|
+
display: -webkit-flex;
|
21
|
+
display: flex;
|
22
|
+
-webkit-box-align: center;
|
23
|
+
-webkit-align-items: center;
|
24
|
+
align-items: center;
|
25
|
+
-webkit-box-flex: 1;
|
26
|
+
-webkit-flex: 1;
|
27
|
+
flex: 1;
|
28
|
+
height: 0.72rem ;
|
29
|
+
font-size: 0.28rem ;
|
30
|
+
padding: 0.16rem 0.28rem ;
|
31
|
+
background-color: #F2F3F5 ;
|
32
|
+
}
|
33
|
+
.arco-search-bar-input {
|
34
|
+
-webkit-box-flex: 1;
|
35
|
+
-webkit-flex: 1;
|
36
|
+
flex: 1;
|
37
|
+
background-color: transparent;
|
38
|
+
height: 0.4rem ;
|
39
|
+
caret-color: #165dff ;
|
40
|
+
}
|
41
|
+
.arco-search-bar-input-left {
|
42
|
+
text-align: left;
|
43
|
+
}
|
44
|
+
.arco-search-bar-input-right {
|
45
|
+
text-align: right;
|
46
|
+
}
|
47
|
+
.arco-search-bar-input-center {
|
48
|
+
text-align: center;
|
49
|
+
}
|
50
|
+
.arco-search-bar-input::-webkit-input-placeholder {
|
51
|
+
color: #c9cdd4 ;
|
52
|
+
}
|
53
|
+
.arco-search-bar-input::placeholder {
|
54
|
+
color: #c9cdd4 ;
|
55
|
+
}
|
56
|
+
.arco-search-bar-input::-webkit-search-cancel-button {
|
57
|
+
display: none;
|
58
|
+
}
|
59
|
+
.arco-search-bar-prefix,
|
60
|
+
.arco-search-bar-suffix,
|
61
|
+
.arco-search-bar-clear {
|
62
|
+
-webkit-box-align: center;
|
63
|
+
-webkit-align-items: center;
|
64
|
+
align-items: center;
|
65
|
+
-webkit-box-pack: center;
|
66
|
+
-webkit-justify-content: center;
|
67
|
+
justify-content: center;
|
68
|
+
display: -webkit-box;
|
69
|
+
display: -webkit-flex;
|
70
|
+
display: flex;
|
71
|
+
}
|
72
|
+
.arco-search-bar-prefix {
|
73
|
+
margin-right: 0.18rem ;
|
74
|
+
}
|
75
|
+
.arco-search-bar-clear {
|
76
|
+
color: #C9CDD4 ;
|
77
|
+
}
|
78
|
+
.arco-search-bar-search-icon {
|
79
|
+
color: #86909C ;
|
80
|
+
font-size: 0.32rem ;
|
81
|
+
}
|
82
|
+
.arco-search-bar-cancel-btn {
|
83
|
+
margin-left: 0.32rem ;
|
84
|
+
color: #165dff ;
|
85
|
+
font-size: 0.3rem ;
|
86
|
+
}
|
87
|
+
.arco-search-bar-association {
|
88
|
+
position: absolute;
|
89
|
+
left: 0;
|
90
|
+
right: 0;
|
91
|
+
background-color: #FFFFFF ;
|
92
|
+
top: 100%;
|
93
|
+
display: none;
|
94
|
+
}
|
95
|
+
.arco-search-bar-association-visible {
|
96
|
+
display: block;
|
97
|
+
}
|
98
|
+
.arco-search-bar-association-item {
|
99
|
+
height: 1.04rem ;
|
100
|
+
display: -webkit-box;
|
101
|
+
display: -webkit-flex;
|
102
|
+
display: flex;
|
103
|
+
-webkit-box-align: center;
|
104
|
+
-webkit-align-items: center;
|
105
|
+
align-items: center;
|
106
|
+
position: relative;
|
107
|
+
color: #1d2129 ;
|
108
|
+
padding: 0.32rem ;
|
109
|
+
font-size: 0.3rem ;
|
110
|
+
}
|
111
|
+
.arco-search-bar-association-item:not(:last-child) {
|
112
|
+
position: relative;
|
113
|
+
border-width: 0;
|
114
|
+
}
|
115
|
+
.arco-search-bar-association-item:not(:last-child)::after {
|
116
|
+
content: '';
|
117
|
+
width: 100%;
|
118
|
+
height: 1PX;
|
119
|
+
position: absolute;
|
120
|
+
left: 0;
|
121
|
+
bottom: 0;
|
122
|
+
z-index: 1;
|
123
|
+
border-bottom-style: solid;
|
124
|
+
border-bottom-width: 1PX;
|
125
|
+
border-bottom-color: #e5e6eb;
|
126
|
+
box-sizing: border-box;
|
127
|
+
transform-origin: left bottom;
|
128
|
+
-webkit-transform-origin: left bottom;
|
129
|
+
pointer-events: none;
|
130
|
+
border-radius: 0;
|
131
|
+
}
|
132
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2) {
|
133
|
+
.arco-search-bar-association-item:not(:last-child)::after {
|
134
|
+
transform: scaleY(0.5);
|
135
|
+
-webkit-transform: scaleY(0.5);
|
136
|
+
border-radius: 0;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
@media (-webkit-min-device-pixel-ratio: 3), (min-device-pixel-ratio: 3) {
|
140
|
+
.arco-search-bar-association-item:not(:last-child)::after {
|
141
|
+
transform: scaleY(0.33333333);
|
142
|
+
-webkit-transform: scaleY(0.33333333);
|
143
|
+
border-radius: 0;
|
144
|
+
}
|
145
|
+
}
|
146
|
+
.arco-search-bar-association-item-highlight {
|
147
|
+
color: #165dff ;
|
148
|
+
}
|