@ebscn/ui 0.0.11 → 1.0.0-beta.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/README.md +22 -0
- package/assets/images/delete.png +0 -0
- package/assets/images/hand.png +0 -0
- package/assets/images/loading.webp +0 -0
- package/assets/images/pull_loading_grey.png +0 -0
- package/assets/images/pull_loading_refreshing_grey.gif +0 -0
- package/assets/images/pull_loading_refreshing_white.gif +0 -0
- package/assets/images/pull_loading_white.png +0 -0
- package/cjs/assets/images/delete.png +0 -0
- package/cjs/assets/images/hand.png +0 -0
- package/cjs/assets/images/loading.webp +0 -0
- package/cjs/assets/images/pull_loading_grey.png +0 -0
- package/cjs/assets/images/pull_loading_refreshing_grey.gif +0 -0
- package/cjs/assets/images/pull_loading_refreshing_white.gif +0 -0
- package/cjs/assets/images/pull_loading_white.png +0 -0
- package/cjs/components/alphabet-keyboard/alphabet-keyboard.css +143 -0
- package/cjs/components/alphabet-keyboard/alphabet-keyboard.d.ts +11 -0
- package/cjs/components/alphabet-keyboard/alphabet-keyboard.js +139 -0
- package/cjs/components/alphabet-keyboard/index.d.ts +4 -0
- package/cjs/components/alphabet-keyboard/index.js +9 -0
- package/cjs/components/button/button.css +152 -0
- package/cjs/components/button/button.d.ts +40 -0
- package/cjs/components/button/button.js +215 -0
- package/cjs/components/button/index.d.ts +6 -0
- package/cjs/components/button/index.js +20 -0
- package/cjs/components/button/selectorButton.css +15 -0
- package/cjs/components/button/selectorButton.d.ts +11 -0
- package/cjs/components/button/selectorButton.js +157 -0
- package/cjs/components/card/card.css +37 -0
- package/cjs/components/card/card.d.ts +17 -0
- package/cjs/components/card/card.js +40 -0
- package/cjs/components/card/index.d.ts +4 -0
- package/cjs/components/card/index.js +10 -0
- package/cjs/components/checkbox/checkbox.css +93 -0
- package/cjs/components/checkbox/checkbox.d.ts +44 -0
- package/cjs/components/checkbox/checkbox.js +106 -0
- package/cjs/components/checkbox/group-context.d.ts +8 -0
- package/cjs/components/checkbox/group-context.js +8 -0
- package/cjs/components/checkbox/group.d.ts +10 -0
- package/cjs/components/checkbox/group.js +48 -0
- package/cjs/components/checkbox/index.d.ts +26 -0
- package/cjs/components/checkbox/index.js +14 -0
- package/cjs/components/checkbox/native-input.d.ts +10 -0
- package/cjs/components/checkbox/native-input.js +38 -0
- package/cjs/components/date-picker/date-picker-date-utils.d.ts +7 -0
- package/cjs/components/date-picker/date-picker-date-utils.js +178 -0
- package/cjs/components/date-picker/date-picker-utils.d.ts +10 -0
- package/cjs/components/date-picker/date-picker-utils.js +51 -0
- package/cjs/components/date-picker/date-picker-week-utils.d.ts +7 -0
- package/cjs/components/date-picker/date-picker-week-utils.js +115 -0
- package/cjs/components/date-picker/date-picker.css +0 -0
- package/cjs/components/date-picker/date-picker.d.ts +40 -0
- package/cjs/components/date-picker/date-picker.js +92 -0
- package/cjs/components/date-picker/index.d.ts +28 -0
- package/cjs/components/date-picker/index.js +15 -0
- package/cjs/components/date-picker/prompt.d.ts +3 -0
- package/cjs/components/date-picker/prompt.js +53 -0
- package/cjs/components/date-picker/util.d.ts +4 -0
- package/cjs/components/date-picker/util.js +7 -0
- package/cjs/components/date-picker-view/date-picker-view.d.ts +18 -0
- package/cjs/components/date-picker-view/date-picker-view.js +60 -0
- package/cjs/components/date-picker-view/index.d.ts +4 -0
- package/cjs/components/date-picker-view/index.js +8 -0
- package/cjs/components/date-picker-view/useRenderLabel.d.ts +2 -0
- package/cjs/components/date-picker-view/useRenderLabel.js +25 -0
- package/cjs/components/date-range-picker/date-range-picker.css +94 -0
- package/cjs/components/date-range-picker/date-range-picker.d.ts +78 -0
- package/cjs/components/date-range-picker/date-range-picker.js +339 -0
- package/cjs/components/date-range-picker/index.d.ts +79 -0
- package/cjs/components/date-range-picker/index.js +13 -0
- package/cjs/components/divider/divider.css +39 -0
- package/cjs/components/divider/divider.d.ts +9 -0
- package/cjs/components/divider/divider.js +36 -0
- package/cjs/components/divider/index.d.ts +4 -0
- package/cjs/components/divider/index.js +9 -0
- package/cjs/components/grid/grid.css +15 -0
- package/cjs/components/grid/grid.d.ts +15 -0
- package/cjs/components/grid/grid.js +45 -0
- package/cjs/components/grid/index.d.ts +7 -0
- package/cjs/components/grid/index.js +12 -0
- package/cjs/components/handRead/handRead.css +72 -0
- package/{handRead → cjs/components/handRead}/handRead.d.ts +2 -2
- package/cjs/components/handRead/handRead.js +248 -0
- package/{handRead → cjs/components/handRead}/index.d.ts +9 -9
- package/cjs/components/handRead/index.js +9 -0
- package/cjs/components/header/header.css +62 -0
- package/cjs/components/header/header.d.ts +14 -0
- package/cjs/components/header/header.js +39 -0
- package/cjs/components/header/index.d.ts +4 -0
- package/cjs/components/header/index.js +10 -0
- package/cjs/components/icons/back-icon.d.ts +4 -0
- package/cjs/components/icons/back-icon.js +38 -0
- package/cjs/components/icons/check-icon.d.ts +4 -0
- package/cjs/components/icons/check-icon.js +31 -0
- package/cjs/components/icons/check-only-icon.d.ts +4 -0
- package/cjs/components/icons/check-only-icon.js +22 -0
- package/cjs/components/icons/clear-icon.d.ts +4 -0
- package/cjs/components/icons/clear-icon.js +41 -0
- package/cjs/components/icons/close-icon.d.ts +4 -0
- package/cjs/components/icons/close-icon.js +36 -0
- package/cjs/components/icons/gdlogo-icon.d.ts +4 -0
- package/cjs/components/icons/gdlogo-icon.js +41 -0
- package/cjs/components/icons/indeterminate-icon.d.ts +4 -0
- package/cjs/components/icons/indeterminate-icon.js +30 -0
- package/cjs/components/icons/index.d.ts +15 -0
- package/cjs/components/icons/index.js +111 -0
- package/cjs/components/icons/loading-icon.d.ts +4 -0
- package/cjs/components/icons/loading-icon.js +90 -0
- package/cjs/components/icons/notice-icon.d.ts +4 -0
- package/cjs/components/icons/notice-icon.js +24 -0
- package/cjs/components/icons/right-icon.d.ts +4 -0
- package/cjs/components/icons/right-icon.js +24 -0
- package/cjs/components/icons/search-icon.d.ts +4 -0
- package/cjs/components/icons/search-icon.js +43 -0
- package/cjs/components/icons/selector-icon.d.ts +4 -0
- package/cjs/components/icons/selector-icon.js +33 -0
- package/cjs/components/icons/spin-icon.d.ts +4 -0
- package/cjs/components/icons/spin-icon.js +33 -0
- package/cjs/components/icons/uncheck-icon.d.ts +4 -0
- package/cjs/components/icons/uncheck-icon.js +27 -0
- package/cjs/components/icons/warning-icon.d.ts +4 -0
- package/cjs/components/icons/warning-icon.js +34 -0
- package/cjs/components/imageViewer/imageViewer.d.ts +4 -0
- package/cjs/components/imageViewer/imageViewer.js +35 -0
- package/cjs/components/imageViewer/index.js +9 -0
- package/cjs/components/marketTag/index.d.ts +4 -0
- package/cjs/components/marketTag/index.js +9 -0
- package/cjs/components/marketTag/marketTag.css +14 -0
- package/cjs/components/marketTag/marketTag.d.ts +11 -0
- package/cjs/components/marketTag/marketTag.js +27 -0
- package/cjs/components/mask/index.d.ts +4 -0
- package/cjs/components/mask/index.js +9 -0
- package/cjs/components/mask/mask.css +22 -0
- package/cjs/components/mask/mask.d.ts +20 -0
- package/cjs/components/mask/mask.js +113 -0
- package/cjs/components/mask/mask.patch.css +3 -0
- package/cjs/components/notice-bar/index.d.ts +10 -0
- package/cjs/components/notice-bar/index.js +20 -0
- package/cjs/components/notice-bar/notice-bar-graph-item.d.ts +10 -0
- package/cjs/components/notice-bar/notice-bar-graph-item.js +16 -0
- package/cjs/components/notice-bar/notice-bar-graph.d.ts +19 -0
- package/cjs/components/notice-bar/notice-bar-graph.js +237 -0
- package/cjs/components/notice-bar/notice-bar.css +109 -0
- package/cjs/components/notice-bar/notice-bar.d.ts +19 -0
- package/cjs/components/notice-bar/notice-bar.js +132 -0
- package/cjs/components/number-keyboard/index.d.ts +4 -0
- package/cjs/components/number-keyboard/index.js +9 -0
- package/cjs/components/number-keyboard/number-keyboard.css +77 -0
- package/cjs/components/number-keyboard/number-keyboard.d.ts +13 -0
- package/cjs/components/number-keyboard/number-keyboard.js +93 -0
- package/cjs/components/page-indicator/index.d.ts +4 -0
- package/cjs/components/page-indicator/index.js +9 -0
- package/cjs/components/page-indicator/page-indicator.css +47 -0
- package/cjs/components/page-indicator/page-indicator.d.ts +9 -0
- package/cjs/components/page-indicator/page-indicator.js +32 -0
- package/cjs/components/pdfLink/index.d.ts +3 -0
- package/cjs/components/pdfLink/index.js +10 -0
- package/cjs/components/pdfLink/pdfLink.css +11 -0
- package/cjs/components/pdfLink/pdfLink.d.ts +8 -0
- package/cjs/components/pdfLink/pdfLink.js +101 -0
- package/cjs/components/picker/index.d.ts +59 -0
- package/cjs/components/picker/index.js +13 -0
- package/cjs/components/picker/picker-utils.d.ts +3 -0
- package/cjs/components/picker/picker-utils.js +10 -0
- package/cjs/components/picker/picker.css +55 -0
- package/cjs/components/picker/picker.d.ts +57 -0
- package/cjs/components/picker/picker.js +160 -0
- package/cjs/components/picker/prompt.d.ts +2 -0
- package/cjs/components/picker/prompt.js +53 -0
- package/cjs/components/picker-view/columns-extend.d.ts +3 -0
- package/cjs/components/picker-view/columns-extend.js +46 -0
- package/cjs/components/picker-view/index.d.ts +4 -0
- package/cjs/components/picker-view/index.js +9 -0
- package/cjs/components/picker-view/picker-view.css +129 -0
- package/cjs/components/picker-view/picker-view.d.ts +25 -0
- package/cjs/components/picker-view/picker-view.js +94 -0
- package/cjs/components/picker-view/wheel.d.ts +13 -0
- package/cjs/components/picker-view/wheel.js +252 -0
- package/cjs/components/popup/index.d.ts +4 -0
- package/cjs/components/popup/index.js +9 -0
- package/cjs/components/popup/popup-base-props.d.ts +51 -0
- package/cjs/components/popup/popup-base-props.js +19 -0
- package/cjs/components/popup/popup.css +57 -0
- package/cjs/components/popup/popup.d.ts +8 -0
- package/cjs/components/popup/popup.js +145 -0
- package/cjs/components/pro-selector/index.d.ts +30 -0
- package/cjs/components/pro-selector/index.js +12 -0
- package/cjs/components/pro-selector/pro-selector.css +11 -0
- package/cjs/components/pro-selector/pro-selector.d.ts +60 -0
- package/cjs/components/pro-selector/pro-selector.js +310 -0
- package/cjs/components/protocol/index.d.ts +3 -0
- package/cjs/components/protocol/index.js +10 -0
- package/cjs/components/protocol/protocol.css +46 -0
- package/cjs/components/protocol/protocol.d.ts +15 -0
- package/cjs/components/protocol/protocol.js +120 -0
- package/cjs/components/pull-to-refresh/index.d.ts +4 -0
- package/cjs/components/pull-to-refresh/index.js +9 -0
- package/cjs/components/pull-to-refresh/pull-to-refresh.css +58 -0
- package/cjs/components/pull-to-refresh/pull-to-refresh.d.ts +26 -0
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +345 -0
- package/cjs/components/radio/group-context.d.ts +8 -0
- package/cjs/components/radio/group-context.js +8 -0
- package/cjs/components/radio/group.d.ts +10 -0
- package/cjs/components/radio/group.js +43 -0
- package/cjs/components/radio/index.d.ts +8 -0
- package/cjs/components/radio/index.js +13 -0
- package/cjs/components/radio/radio.css +93 -0
- package/cjs/components/radio/radio.d.ts +19 -0
- package/cjs/components/radio/radio.js +92 -0
- package/cjs/components/search/index.d.ts +3 -0
- package/cjs/components/search/index.js +10 -0
- package/cjs/components/search/search.css +53 -0
- package/cjs/components/search/search.d.ts +15 -0
- package/cjs/components/search/search.js +110 -0
- package/cjs/components/selector/check-mark.d.ts +2 -0
- package/cjs/components/selector/check-mark.js +37 -0
- package/cjs/components/selector/index.d.ts +4 -0
- package/cjs/components/selector/index.js +9 -0
- package/cjs/components/selector/selector.css +71 -0
- package/cjs/components/selector/selector.d.ts +27 -0
- package/cjs/components/selector/selector.js +94 -0
- package/cjs/components/skeleton/index.d.ts +11 -0
- package/cjs/components/skeleton/index.js +16 -0
- package/cjs/components/skeleton/skeleton.css +65 -0
- package/cjs/components/skeleton/skeleton.d.ts +29 -0
- package/cjs/components/skeleton/skeleton.js +71 -0
- package/cjs/components/space/index.d.ts +4 -0
- package/cjs/components/space/index.js +9 -0
- package/cjs/components/space/space.css +70 -0
- package/cjs/components/space/space.d.ts +13 -0
- package/cjs/components/space/space.js +30 -0
- package/cjs/components/squared-grid/index.d.ts +7 -0
- package/cjs/components/squared-grid/index.js +12 -0
- package/cjs/components/squared-grid/squared-grid.css +30 -0
- package/cjs/components/squared-grid/squared-grid.d.ts +17 -0
- package/cjs/components/squared-grid/squared-grid.js +91 -0
- package/cjs/components/stock-count-keyboard/index.d.ts +4 -0
- package/cjs/components/stock-count-keyboard/index.js +9 -0
- package/cjs/components/stock-count-keyboard/stock-count-keyboard.css +74 -0
- package/cjs/components/stock-count-keyboard/stock-count-keyboard.d.ts +9 -0
- package/cjs/components/stock-count-keyboard/stock-count-keyboard.js +82 -0
- package/cjs/components/stock-keyboard/index.d.ts +4 -0
- package/cjs/components/stock-keyboard/index.js +9 -0
- package/cjs/components/stock-keyboard/stock-keyboard.css +111 -0
- package/cjs/components/stock-keyboard/stock-keyboard.d.ts +12 -0
- package/cjs/components/stock-keyboard/stock-keyboard.js +107 -0
- package/cjs/components/swiper/index.d.ts +35 -0
- package/cjs/components/swiper/index.js +13 -0
- package/cjs/components/swiper/swiper-item.d.ts +9 -0
- package/cjs/components/swiper/swiper-item.js +16 -0
- package/cjs/components/swiper/swiper.css +80 -0
- package/cjs/components/swiper/swiper.d.ts +68 -0
- package/cjs/components/swiper/swiper.js +372 -0
- package/cjs/components/switch/index.d.ts +4 -0
- package/cjs/components/switch/index.js +10 -0
- package/cjs/components/switch/switch.css +104 -0
- package/cjs/components/switch/switch.d.ts +16 -0
- package/cjs/components/switch/switch.js +213 -0
- package/cjs/components/tabs/index.d.ts +7 -0
- package/cjs/components/tabs/index.js +12 -0
- package/cjs/components/tabs/tabs.css +76 -0
- package/cjs/components/tabs/tabs.d.ts +27 -0
- package/cjs/components/tabs/tabs.js +294 -0
- package/cjs/components/tabs/tabs.patch.css +23 -0
- package/cjs/components/tip/index.d.ts +4 -0
- package/cjs/components/tip/index.js +9 -0
- package/cjs/components/tip/tip.css +22 -0
- package/cjs/components/tip/tip.d.ts +7 -0
- package/cjs/components/tip/tip.js +31 -0
- package/cjs/components/toastLoading/index.d.ts +4 -0
- package/cjs/components/toastLoading/index.js +9 -0
- package/cjs/components/toastLoading/toastLoading.css +26 -0
- package/cjs/components/toastLoading/toastLoading.d.ts +7 -0
- package/cjs/components/toastLoading/toastLoading.js +41 -0
- package/cjs/global/global.css +292 -0
- package/cjs/global/index.d.ts +1 -0
- package/cjs/global/index.js +11 -0
- package/cjs/global/theme-dark.css +18 -0
- package/cjs/global/theme-default.css +48 -0
- package/cjs/hooks/index.d.ts +5 -0
- package/cjs/hooks/index.js +12 -0
- package/cjs/hooks/useFieldNames.d.ts +7 -0
- package/cjs/hooks/useFieldNames.js +25 -0
- package/cjs/index.d.ts +37 -0
- package/cjs/index.js +315 -0
- package/cjs/utils/attach-properties-to-component.d.ts +1 -0
- package/cjs/utils/attach-properties-to-component.js +15 -0
- package/cjs/utils/bound.d.ts +1 -0
- package/cjs/utils/bound.js +16 -0
- package/cjs/utils/can-use-dom.d.ts +1 -0
- package/cjs/utils/can-use-dom.js +7 -0
- package/cjs/utils/convert-px.d.ts +1 -0
- package/cjs/utils/convert-px.js +33 -0
- package/cjs/utils/create-icon-component.d.ts +2 -0
- package/cjs/utils/create-icon-component.js +12 -0
- package/cjs/utils/dev-log.d.ts +3 -0
- package/cjs/utils/dev-log.js +45 -0
- package/cjs/utils/generate-int-array.d.ts +1 -0
- package/cjs/utils/generate-int-array.js +13 -0
- package/cjs/utils/get-container.d.ts +2 -0
- package/cjs/utils/get-container.js +10 -0
- package/cjs/utils/get-scroll-parent.d.ts +3 -0
- package/cjs/utils/get-scroll-parent.js +30 -0
- package/cjs/utils/is-dev.d.ts +1 -0
- package/cjs/utils/is-dev.js +7 -0
- package/cjs/utils/is-node-with-content.d.ts +4 -0
- package/cjs/utils/is-node-with-content.js +9 -0
- package/cjs/utils/matrix.d.ts +10 -0
- package/cjs/utils/matrix.js +47 -0
- package/cjs/utils/measure-css-length.d.ts +1 -0
- package/cjs/utils/measure-css-length.js +29 -0
- package/cjs/utils/merge-locale.d.ts +1 -0
- package/cjs/utils/merge-locale.js +21 -0
- package/cjs/utils/native-props.d.ts +8 -0
- package/cjs/utils/native-props.js +38 -0
- package/cjs/utils/nearest.d.ts +1 -0
- package/cjs/utils/nearest.js +11 -0
- package/cjs/utils/noop.d.ts +1 -0
- package/cjs/utils/noop.js +8 -0
- package/cjs/utils/reduce-and-restore-motion.d.ts +4 -0
- package/cjs/utils/reduce-and-restore-motion.js +44 -0
- package/cjs/utils/render-imperatively.d.ts +13 -0
- package/cjs/utils/render-imperatively.js +207 -0
- package/cjs/utils/render-to-body.d.ts +2 -0
- package/cjs/utils/render-to-body.js +19 -0
- package/cjs/utils/render-to-container.d.ts +3 -0
- package/cjs/utils/render-to-container.js +16 -0
- package/cjs/utils/render.d.ts +9 -0
- package/cjs/utils/render.js +196 -0
- package/cjs/utils/replace-message.d.ts +1 -0
- package/cjs/utils/replace-message.js +13 -0
- package/cjs/utils/rubberband.d.ts +2 -0
- package/cjs/utils/rubberband.js +20 -0
- package/cjs/utils/should-render.d.ts +10 -0
- package/cjs/utils/should-render.js +20 -0
- package/cjs/utils/shuffle.d.ts +6 -0
- package/cjs/utils/shuffle.js +29 -0
- package/cjs/utils/sleep.d.ts +1 -0
- package/cjs/utils/sleep.js +12 -0
- package/cjs/utils/supports-passive.d.ts +1 -0
- package/cjs/utils/supports-passive.js +19 -0
- package/cjs/utils/to-css-length.d.ts +1 -0
- package/cjs/utils/to-css-length.js +9 -0
- package/cjs/utils/traverse-react-node.d.ts +2 -0
- package/cjs/utils/traverse-react-node.js +23 -0
- package/cjs/utils/tree.d.ts +1 -0
- package/cjs/utils/tree.js +24 -0
- package/cjs/utils/undefined-fallback.d.ts +3 -0
- package/cjs/utils/undefined-fallback.js +17 -0
- package/cjs/utils/use-drag-and-pinch.d.ts +1 -0
- package/cjs/utils/use-drag-and-pinch.js +8 -0
- package/cjs/utils/use-initialized.d.ts +1 -0
- package/cjs/utils/use-initialized.js +14 -0
- package/cjs/utils/use-inner-visible.d.ts +1 -0
- package/cjs/utils/use-inner-visible.js +17 -0
- package/cjs/utils/use-isomorphic-update-layout-effect.d.ts +2 -0
- package/cjs/utils/use-isomorphic-update-layout-effect.js +8 -0
- package/cjs/utils/use-lock-scroll.d.ts +2 -0
- package/cjs/utils/use-lock-scroll.js +84 -0
- package/cjs/utils/use-mutation-effect.d.ts +2 -0
- package/cjs/utils/use-mutation-effect.js +21 -0
- package/cjs/utils/use-props-value.d.ts +8 -0
- package/cjs/utils/use-props-value.js +30 -0
- package/cjs/utils/use-ref-state.d.ts +2 -0
- package/cjs/utils/use-ref-state.js +17 -0
- package/cjs/utils/use-resize-effect.d.ts +2 -0
- package/cjs/utils/use-resize-effect.js +29 -0
- package/cjs/utils/use-tab-list-scroll.d.ts +5 -0
- package/cjs/utils/use-tab-list-scroll.js +67 -0
- package/cjs/utils/use-touch.d.ts +17 -0
- package/cjs/utils/use-touch.js +69 -0
- package/cjs/utils/validate.d.ts +8 -0
- package/cjs/utils/validate.js +39 -0
- package/cjs/utils/with-cache.d.ts +1 -0
- package/cjs/utils/with-cache.js +15 -0
- package/cjs/utils/with-default-props.d.ts +2 -0
- package/cjs/utils/with-default-props.js +32 -0
- package/cjs/utils/with-func-props.d.ts +5 -0
- package/cjs/utils/with-func-props.js +38 -0
- package/cjs/utils/with-stop-propagation.d.ts +4 -0
- package/cjs/utils/with-stop-propagation.js +37 -0
- package/es/assets/images/delete.png +0 -0
- package/es/assets/images/hand.png +0 -0
- package/es/assets/images/loading.webp +0 -0
- package/es/assets/images/pull_loading_grey.png +0 -0
- package/es/assets/images/pull_loading_refreshing_grey.gif +0 -0
- package/es/assets/images/pull_loading_refreshing_white.gif +0 -0
- package/es/assets/images/pull_loading_white.png +0 -0
- package/es/components/alphabet-keyboard/alphabet-keyboard.css +143 -0
- package/es/components/alphabet-keyboard/alphabet-keyboard.d.ts +11 -0
- package/es/components/alphabet-keyboard/alphabet-keyboard.js +132 -0
- package/es/components/alphabet-keyboard/index.d.ts +4 -0
- package/es/components/alphabet-keyboard/index.js +3 -0
- package/es/components/button/button.css +152 -0
- package/es/components/button/button.d.ts +40 -0
- package/es/components/button/button.js +206 -0
- package/es/components/button/index.d.ts +6 -0
- package/es/components/button/index.js +4 -0
- package/es/components/button/selectorButton.css +15 -0
- package/es/components/button/selectorButton.d.ts +11 -0
- package/es/components/button/selectorButton.js +149 -0
- package/es/components/card/card.css +37 -0
- package/es/components/card/card.d.ts +17 -0
- package/es/components/card/card.js +33 -0
- package/es/components/card/index.d.ts +4 -0
- package/es/components/card/index.js +3 -0
- package/es/components/checkbox/checkbox.css +93 -0
- package/es/components/checkbox/checkbox.d.ts +44 -0
- package/es/components/checkbox/checkbox.js +97 -0
- package/es/components/checkbox/group-context.d.ts +8 -0
- package/es/components/checkbox/group-context.js +2 -0
- package/es/components/checkbox/group.d.ts +10 -0
- package/es/components/checkbox/group.js +40 -0
- package/es/components/checkbox/index.d.ts +26 -0
- package/es/components/checkbox/index.js +7 -0
- package/es/components/checkbox/native-input.d.ts +10 -0
- package/es/components/checkbox/native-input.js +29 -0
- package/es/components/date-picker/date-picker-date-utils.d.ts +7 -0
- package/es/components/date-picker/date-picker-date-utils.js +169 -0
- package/es/components/date-picker/date-picker-utils.d.ts +10 -0
- package/es/components/date-picker/date-picker-utils.js +40 -0
- package/es/components/date-picker/date-picker-week-utils.d.ts +7 -0
- package/es/components/date-picker/date-picker-week-utils.js +106 -0
- package/es/components/date-picker/date-picker.css +0 -0
- package/es/components/date-picker/date-picker.d.ts +40 -0
- package/es/components/date-picker/date-picker.js +83 -0
- package/es/components/date-picker/index.d.ts +28 -0
- package/es/components/date-picker/index.js +9 -0
- package/es/components/date-picker/prompt.d.ts +3 -0
- package/es/components/date-picker/prompt.js +45 -0
- package/es/components/date-picker/util.d.ts +4 -0
- package/es/components/date-picker/util.js +1 -0
- package/es/components/date-picker-view/date-picker-view.d.ts +18 -0
- package/es/components/date-picker-view/date-picker-view.js +50 -0
- package/es/components/date-picker-view/index.d.ts +4 -0
- package/es/components/date-picker-view/index.js +2 -0
- package/es/components/date-picker-view/useRenderLabel.d.ts +2 -0
- package/es/components/date-picker-view/useRenderLabel.js +19 -0
- package/es/components/date-range-picker/date-range-picker.css +94 -0
- package/es/components/date-range-picker/date-range-picker.d.ts +78 -0
- package/es/components/date-range-picker/date-range-picker.js +330 -0
- package/es/components/date-range-picker/index.d.ts +79 -0
- package/es/components/date-range-picker/index.js +7 -0
- package/es/components/divider/divider.css +39 -0
- package/es/components/divider/divider.d.ts +9 -0
- package/es/components/divider/divider.js +28 -0
- package/es/components/divider/index.d.ts +4 -0
- package/es/components/divider/index.js +3 -0
- package/es/components/grid/grid.css +15 -0
- package/es/components/grid/grid.d.ts +15 -0
- package/es/components/grid/grid.js +36 -0
- package/es/components/grid/index.d.ts +7 -0
- package/es/components/grid/index.js +6 -0
- package/es/components/handRead/handRead.css +72 -0
- package/es/components/handRead/handRead.d.ts +6 -0
- package/es/components/handRead/handRead.js +239 -0
- package/es/components/handRead/index.d.ts +25 -0
- package/es/components/handRead/index.js +2 -0
- package/es/components/header/header.css +62 -0
- package/es/components/header/header.d.ts +14 -0
- package/es/components/header/header.js +32 -0
- package/es/components/header/index.d.ts +4 -0
- package/es/components/header/index.js +3 -0
- package/es/components/icons/back-icon.d.ts +4 -0
- package/es/components/icons/back-icon.js +30 -0
- package/es/components/icons/check-icon.d.ts +4 -0
- package/es/components/icons/check-icon.js +23 -0
- package/es/components/icons/check-only-icon.d.ts +4 -0
- package/es/components/icons/check-only-icon.js +14 -0
- package/es/components/icons/clear-icon.d.ts +4 -0
- package/es/components/icons/clear-icon.js +33 -0
- package/es/components/icons/close-icon.d.ts +4 -0
- package/es/components/icons/close-icon.js +28 -0
- package/es/components/icons/gdlogo-icon.d.ts +4 -0
- package/es/components/icons/gdlogo-icon.js +33 -0
- package/es/components/icons/indeterminate-icon.d.ts +4 -0
- package/es/components/icons/indeterminate-icon.js +22 -0
- package/es/components/icons/index.d.ts +15 -0
- package/es/components/icons/index.js +15 -0
- package/es/components/icons/loading-icon.d.ts +4 -0
- package/es/components/icons/loading-icon.js +82 -0
- package/es/components/icons/notice-icon.d.ts +4 -0
- package/es/components/icons/notice-icon.js +16 -0
- package/es/components/icons/right-icon.d.ts +4 -0
- package/es/components/icons/right-icon.js +16 -0
- package/es/components/icons/search-icon.d.ts +4 -0
- package/es/components/icons/search-icon.js +35 -0
- package/es/components/icons/selector-icon.d.ts +4 -0
- package/es/components/icons/selector-icon.js +25 -0
- package/es/components/icons/spin-icon.d.ts +4 -0
- package/es/components/icons/spin-icon.js +25 -0
- package/es/components/icons/uncheck-icon.d.ts +4 -0
- package/es/components/icons/uncheck-icon.js +19 -0
- package/es/components/icons/warning-icon.d.ts +4 -0
- package/es/components/icons/warning-icon.js +26 -0
- package/es/components/imageViewer/imageViewer.d.ts +4 -0
- package/es/components/imageViewer/imageViewer.js +28 -0
- package/es/components/imageViewer/index.d.ts +7 -0
- package/es/components/imageViewer/index.js +2 -0
- package/es/components/marketTag/index.d.ts +4 -0
- package/es/components/marketTag/index.js +3 -0
- package/es/components/marketTag/marketTag.css +14 -0
- package/es/components/marketTag/marketTag.d.ts +11 -0
- package/es/components/marketTag/marketTag.js +19 -0
- package/es/components/mask/index.d.ts +4 -0
- package/es/components/mask/index.js +3 -0
- package/es/components/mask/mask.css +22 -0
- package/es/components/mask/mask.d.ts +20 -0
- package/es/components/mask/mask.js +104 -0
- package/es/components/mask/mask.patch.css +3 -0
- package/es/components/notice-bar/index.d.ts +10 -0
- package/es/components/notice-bar/index.js +9 -0
- package/es/components/notice-bar/notice-bar-graph-item.d.ts +10 -0
- package/es/components/notice-bar/notice-bar-graph-item.js +8 -0
- package/es/components/notice-bar/notice-bar-graph.d.ts +19 -0
- package/es/components/notice-bar/notice-bar-graph.js +228 -0
- package/es/components/notice-bar/notice-bar.css +109 -0
- package/es/components/notice-bar/notice-bar.d.ts +19 -0
- package/es/components/notice-bar/notice-bar.js +123 -0
- package/es/components/number-keyboard/index.d.ts +4 -0
- package/es/components/number-keyboard/index.js +3 -0
- package/es/components/number-keyboard/number-keyboard.css +77 -0
- package/es/components/number-keyboard/number-keyboard.d.ts +13 -0
- package/es/components/number-keyboard/number-keyboard.js +85 -0
- package/es/components/page-indicator/index.d.ts +4 -0
- package/es/components/page-indicator/index.js +3 -0
- package/es/components/page-indicator/page-indicator.css +47 -0
- package/es/components/page-indicator/page-indicator.d.ts +9 -0
- package/es/components/page-indicator/page-indicator.js +23 -0
- package/es/components/pdfLink/index.d.ts +3 -0
- package/es/components/pdfLink/index.js +3 -0
- package/es/components/pdfLink/pdfLink.css +11 -0
- package/es/components/pdfLink/pdfLink.d.ts +8 -0
- package/es/components/pdfLink/pdfLink.js +93 -0
- package/es/components/picker/index.d.ts +59 -0
- package/es/components/picker/index.js +7 -0
- package/es/components/picker/picker-utils.d.ts +3 -0
- package/es/components/picker/picker-utils.js +3 -0
- package/es/components/picker/picker.css +55 -0
- package/es/components/picker/picker.d.ts +57 -0
- package/es/components/picker/picker.js +151 -0
- package/es/components/picker/prompt.d.ts +2 -0
- package/es/components/picker/prompt.js +45 -0
- package/es/components/picker-view/columns-extend.d.ts +3 -0
- package/es/components/picker-view/columns-extend.js +39 -0
- package/es/components/picker-view/index.d.ts +4 -0
- package/es/components/picker-view/index.js +3 -0
- package/es/components/picker-view/picker-view.css +129 -0
- package/es/components/picker-view/picker-view.d.ts +25 -0
- package/es/components/picker-view/picker-view.js +86 -0
- package/es/components/picker-view/wheel.d.ts +13 -0
- package/es/components/picker-view/wheel.js +243 -0
- package/es/components/popup/index.d.ts +4 -0
- package/es/components/popup/index.js +3 -0
- package/es/components/popup/popup-base-props.d.ts +51 -0
- package/es/components/popup/popup-base-props.js +13 -0
- package/es/components/popup/popup.css +57 -0
- package/es/components/popup/popup.d.ts +8 -0
- package/es/components/popup/popup.js +135 -0
- package/es/components/pro-selector/index.d.ts +30 -0
- package/es/components/pro-selector/index.js +6 -0
- package/es/components/pro-selector/pro-selector.css +11 -0
- package/es/components/pro-selector/pro-selector.d.ts +60 -0
- package/es/components/pro-selector/pro-selector.js +299 -0
- package/es/components/protocol/index.d.ts +3 -0
- package/es/components/protocol/index.js +3 -0
- package/es/components/protocol/protocol.css +46 -0
- package/es/components/protocol/protocol.d.ts +15 -0
- package/es/components/protocol/protocol.js +112 -0
- package/es/components/pull-to-refresh/index.d.ts +4 -0
- package/es/components/pull-to-refresh/index.js +3 -0
- package/es/components/pull-to-refresh/pull-to-refresh.css +58 -0
- package/es/components/pull-to-refresh/pull-to-refresh.d.ts +26 -0
- package/es/components/pull-to-refresh/pull-to-refresh.js +335 -0
- package/es/components/radio/group-context.d.ts +8 -0
- package/es/components/radio/group-context.js +2 -0
- package/es/components/radio/group.d.ts +10 -0
- package/es/components/radio/group.js +35 -0
- package/es/components/radio/index.d.ts +8 -0
- package/es/components/radio/index.js +7 -0
- package/es/components/radio/radio.css +93 -0
- package/es/components/radio/radio.d.ts +19 -0
- package/es/components/radio/radio.js +82 -0
- package/es/components/search/index.d.ts +3 -0
- package/es/components/search/index.js +3 -0
- package/es/components/search/search.css +53 -0
- package/es/components/search/search.d.ts +15 -0
- package/es/components/search/search.js +102 -0
- package/es/components/selector/check-mark.d.ts +2 -0
- package/es/components/selector/check-mark.js +29 -0
- package/es/components/selector/index.d.ts +4 -0
- package/es/components/selector/index.js +3 -0
- package/es/components/selector/selector.css +71 -0
- package/es/components/selector/selector.d.ts +27 -0
- package/es/components/selector/selector.js +86 -0
- package/es/components/skeleton/index.d.ts +11 -0
- package/es/components/skeleton/index.js +10 -0
- package/es/components/skeleton/skeleton.css +65 -0
- package/es/components/skeleton/skeleton.d.ts +29 -0
- package/es/components/skeleton/skeleton.js +58 -0
- package/es/components/space/index.d.ts +4 -0
- package/es/components/space/index.js +3 -0
- package/es/components/space/space.css +70 -0
- package/es/components/space/space.d.ts +13 -0
- package/es/components/space/space.js +22 -0
- package/es/components/squared-grid/index.d.ts +7 -0
- package/es/components/squared-grid/index.js +6 -0
- package/es/components/squared-grid/squared-grid.css +30 -0
- package/es/components/squared-grid/squared-grid.d.ts +17 -0
- package/es/components/squared-grid/squared-grid.js +82 -0
- package/es/components/stock-count-keyboard/index.d.ts +4 -0
- package/es/components/stock-count-keyboard/index.js +3 -0
- package/es/components/stock-count-keyboard/stock-count-keyboard.css +74 -0
- package/es/components/stock-count-keyboard/stock-count-keyboard.d.ts +9 -0
- package/es/components/stock-count-keyboard/stock-count-keyboard.js +74 -0
- package/es/components/stock-keyboard/index.d.ts +4 -0
- package/es/components/stock-keyboard/index.js +3 -0
- package/es/components/stock-keyboard/stock-keyboard.css +111 -0
- package/es/components/stock-keyboard/stock-keyboard.d.ts +12 -0
- package/es/components/stock-keyboard/stock-keyboard.js +99 -0
- package/es/components/swiper/index.d.ts +35 -0
- package/es/components/swiper/index.js +7 -0
- package/es/components/swiper/swiper-item.d.ts +9 -0
- package/es/components/swiper/swiper-item.js +8 -0
- package/es/components/swiper/swiper.css +80 -0
- package/es/components/swiper/swiper.d.ts +68 -0
- package/es/components/swiper/swiper.js +363 -0
- package/es/components/switch/index.d.ts +4 -0
- package/es/components/switch/index.js +3 -0
- package/es/components/switch/switch.css +104 -0
- package/es/components/switch/switch.d.ts +16 -0
- package/es/components/switch/switch.js +204 -0
- package/es/components/tabs/index.d.ts +7 -0
- package/es/components/tabs/index.js +6 -0
- package/es/components/tabs/tabs.css +76 -0
- package/es/components/tabs/tabs.d.ts +27 -0
- package/es/components/tabs/tabs.js +283 -0
- package/es/components/tabs/tabs.patch.css +23 -0
- package/es/components/tip/index.d.ts +4 -0
- package/es/components/tip/index.js +3 -0
- package/es/components/tip/tip.css +22 -0
- package/es/components/tip/tip.d.ts +7 -0
- package/es/components/tip/tip.js +23 -0
- package/es/components/toastLoading/index.d.ts +4 -0
- package/es/components/toastLoading/index.js +3 -0
- package/es/components/toastLoading/toastLoading.css +26 -0
- package/es/components/toastLoading/toastLoading.d.ts +7 -0
- package/es/components/toastLoading/toastLoading.js +32 -0
- package/es/global/global.css +292 -0
- package/es/global/index.d.ts +1 -0
- package/es/global/index.js +9 -0
- package/es/global/theme-dark.css +18 -0
- package/es/global/theme-default.css +48 -0
- package/es/hooks/index.d.ts +5 -0
- package/es/hooks/index.js +1 -0
- package/es/hooks/useFieldNames.d.ts +7 -0
- package/es/hooks/useFieldNames.js +18 -0
- package/es/index.d.ts +37 -0
- package/es/index.js +37 -0
- package/es/utils/attach-properties-to-component.d.ts +1 -0
- package/es/utils/attach-properties-to-component.js +9 -0
- package/es/utils/bound.d.ts +1 -0
- package/es/utils/bound.js +10 -0
- package/es/utils/can-use-dom.d.ts +1 -0
- package/es/utils/can-use-dom.js +1 -0
- package/es/utils/convert-px.d.ts +1 -0
- package/es/utils/convert-px.js +27 -0
- package/es/utils/create-icon-component.d.ts +2 -0
- package/es/utils/create-icon-component.js +6 -0
- package/es/utils/dev-log.d.ts +3 -0
- package/es/utils/dev-log.js +37 -0
- package/es/utils/generate-int-array.d.ts +1 -0
- package/es/utils/generate-int-array.js +7 -0
- package/es/utils/get-container.d.ts +2 -0
- package/es/utils/get-container.js +4 -0
- package/es/utils/get-scroll-parent.d.ts +3 -0
- package/es/utils/get-scroll-parent.js +24 -0
- package/es/utils/is-dev.d.ts +1 -0
- package/es/utils/is-dev.js +1 -0
- package/es/utils/is-node-with-content.d.ts +4 -0
- package/es/utils/is-node-with-content.js +3 -0
- package/es/utils/matrix.d.ts +10 -0
- package/es/utils/matrix.js +32 -0
- package/es/utils/measure-css-length.d.ts +1 -0
- package/es/utils/measure-css-length.js +23 -0
- package/es/utils/merge-locale.d.ts +1 -0
- package/es/utils/merge-locale.js +15 -0
- package/es/utils/native-props.d.ts +8 -0
- package/es/utils/native-props.js +31 -0
- package/es/utils/nearest.d.ts +1 -0
- package/es/utils/nearest.js +5 -0
- package/es/utils/noop.d.ts +1 -0
- package/es/utils/noop.js +1 -0
- package/es/utils/reduce-and-restore-motion.d.ts +4 -0
- package/es/utils/reduce-and-restore-motion.js +35 -0
- package/es/utils/render-imperatively.d.ts +13 -0
- package/es/utils/render-imperatively.js +199 -0
- package/es/utils/render-to-body.d.ts +2 -0
- package/es/utils/render-to-body.js +13 -0
- package/es/utils/render-to-container.d.ts +3 -0
- package/es/utils/render-to-container.js +10 -0
- package/es/utils/render.d.ts +9 -0
- package/es/utils/render.js +187 -0
- package/es/utils/replace-message.d.ts +1 -0
- package/es/utils/replace-message.js +7 -0
- package/es/utils/rubberband.d.ts +2 -0
- package/es/utils/rubberband.js +13 -0
- package/es/utils/should-render.d.ts +10 -0
- package/es/utils/should-render.js +12 -0
- package/es/utils/shuffle.d.ts +6 -0
- package/es/utils/shuffle.js +23 -0
- package/es/utils/sleep.d.ts +1 -0
- package/es/utils/sleep.js +5 -0
- package/es/utils/supports-passive.d.ts +1 -0
- package/es/utils/supports-passive.js +13 -0
- package/es/utils/to-css-length.d.ts +1 -0
- package/es/utils/to-css-length.js +3 -0
- package/es/utils/traverse-react-node.d.ts +2 -0
- package/es/utils/traverse-react-node.js +16 -0
- package/es/utils/tree.d.ts +1 -0
- package/es/utils/tree.js +18 -0
- package/es/utils/undefined-fallback.d.ts +3 -0
- package/es/utils/undefined-fallback.js +11 -0
- package/es/utils/use-drag-and-pinch.d.ts +1 -0
- package/es/utils/use-drag-and-pinch.js +2 -0
- package/es/utils/use-initialized.d.ts +1 -0
- package/es/utils/use-initialized.js +8 -0
- package/es/utils/use-inner-visible.d.ts +1 -0
- package/es/utils/use-inner-visible.js +11 -0
- package/es/utils/use-isomorphic-update-layout-effect.d.ts +2 -0
- package/es/utils/use-isomorphic-update-layout-effect.js +2 -0
- package/es/utils/use-lock-scroll.d.ts +2 -0
- package/es/utils/use-lock-scroll.js +78 -0
- package/es/utils/use-mutation-effect.d.ts +2 -0
- package/es/utils/use-mutation-effect.js +15 -0
- package/es/utils/use-props-value.d.ts +8 -0
- package/es/utils/use-props-value.js +24 -0
- package/es/utils/use-ref-state.d.ts +2 -0
- package/es/utils/use-ref-state.js +11 -0
- package/es/utils/use-resize-effect.d.ts +2 -0
- package/es/utils/use-resize-effect.js +23 -0
- package/es/utils/use-tab-list-scroll.d.ts +5 -0
- package/es/utils/use-tab-list-scroll.js +60 -0
- package/es/utils/use-touch.d.ts +17 -0
- package/es/utils/use-touch.js +63 -0
- package/es/utils/validate.d.ts +8 -0
- package/es/utils/validate.js +26 -0
- package/es/utils/with-cache.d.ts +1 -0
- package/es/utils/with-cache.js +9 -0
- package/es/utils/with-default-props.d.ts +2 -0
- package/es/utils/with-default-props.js +25 -0
- package/es/utils/with-func-props.d.ts +5 -0
- package/es/utils/with-func-props.js +32 -0
- package/es/utils/with-stop-propagation.d.ts +4 -0
- package/es/utils/with-stop-propagation.js +30 -0
- package/package.json +48 -20
- package/__vendor/__vendor.js +0 -1
- package/handRead/handRead.js +0 -302
- package/handRead/index.js +0 -11
- package/imageViewer/imageViewer.d.ts +0 -3
- package/imageViewer/imageViewer.js +0 -28
- package/imageViewer/index.js +0 -8
- package/index.d.ts +0 -6
- package/index.js +0 -14
- package/keyboard/index.d.ts +0 -13
- package/keyboard/index.js +0 -7
- package/keyboard/keyboard.d.ts +0 -2
- package/keyboard/keyboard.js +0 -87
- package/style.css +0 -1
- package/utils/isEqual.d.ts +0 -5
- /package/{imageViewer → cjs/components/imageViewer}/index.d.ts +0 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _2 = require("../..");
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
11
|
+
var _usePropsValue = require("../../utils/use-props-value");
|
|
12
|
+
var _validate = require("../../utils/validate");
|
|
13
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) {
|
|
19
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
20
|
+
resolve(value);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) {
|
|
25
|
+
try {
|
|
26
|
+
step(generator.next(value));
|
|
27
|
+
} catch (e) {
|
|
28
|
+
reject(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function rejected(value) {
|
|
32
|
+
try {
|
|
33
|
+
step(generator["throw"](value));
|
|
34
|
+
} catch (e) {
|
|
35
|
+
reject(e);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function step(result) {
|
|
39
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
40
|
+
}
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
45
|
+
var _ = {
|
|
46
|
+
label: 0,
|
|
47
|
+
sent: function () {
|
|
48
|
+
if (t[0] & 1) throw t[1];
|
|
49
|
+
return t[1];
|
|
50
|
+
},
|
|
51
|
+
trys: [],
|
|
52
|
+
ops: []
|
|
53
|
+
},
|
|
54
|
+
f,
|
|
55
|
+
y,
|
|
56
|
+
t,
|
|
57
|
+
g;
|
|
58
|
+
return g = {
|
|
59
|
+
next: verb(0),
|
|
60
|
+
"throw": verb(1),
|
|
61
|
+
"return": verb(2)
|
|
62
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
63
|
+
return this;
|
|
64
|
+
}), g;
|
|
65
|
+
function verb(n) {
|
|
66
|
+
return function (v) {
|
|
67
|
+
return step([n, v]);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function step(op) {
|
|
71
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
72
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
73
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
74
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
75
|
+
switch (op[0]) {
|
|
76
|
+
case 0:
|
|
77
|
+
case 1:
|
|
78
|
+
t = op;
|
|
79
|
+
break;
|
|
80
|
+
case 4:
|
|
81
|
+
_.label++;
|
|
82
|
+
return {
|
|
83
|
+
value: op[1],
|
|
84
|
+
done: false
|
|
85
|
+
};
|
|
86
|
+
case 5:
|
|
87
|
+
_.label++;
|
|
88
|
+
y = op[1];
|
|
89
|
+
op = [0];
|
|
90
|
+
continue;
|
|
91
|
+
case 7:
|
|
92
|
+
op = _.ops.pop();
|
|
93
|
+
_.trys.pop();
|
|
94
|
+
continue;
|
|
95
|
+
default:
|
|
96
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
97
|
+
_ = 0;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
101
|
+
_.label = op[1];
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
105
|
+
_.label = t[1];
|
|
106
|
+
t = op;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
if (t && _.label < t[2]) {
|
|
110
|
+
_.label = t[2];
|
|
111
|
+
_.ops.push(op);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
if (t[2]) _.ops.pop();
|
|
115
|
+
_.trys.pop();
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
op = body.call(thisArg, _);
|
|
119
|
+
} catch (e) {
|
|
120
|
+
op = [6, e];
|
|
121
|
+
y = 0;
|
|
122
|
+
} finally {
|
|
123
|
+
f = t = 0;
|
|
124
|
+
}
|
|
125
|
+
if (op[0] & 5) throw op[1];
|
|
126
|
+
return {
|
|
127
|
+
value: op[0] ? op[1] : void 0,
|
|
128
|
+
done: true
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
var classPrefix = "ebscn-switch";
|
|
133
|
+
var defaultProps = {
|
|
134
|
+
defaultChecked: false,
|
|
135
|
+
size: 'normal'
|
|
136
|
+
};
|
|
137
|
+
var Switch = function (p) {
|
|
138
|
+
var _a;
|
|
139
|
+
var props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
140
|
+
var disabled = props.disabled || props.loading || false;
|
|
141
|
+
var _b = (0, _react.useState)(false),
|
|
142
|
+
changing = _b[0],
|
|
143
|
+
setChanging = _b[1];
|
|
144
|
+
var _c = (0, _usePropsValue.usePropsValue)({
|
|
145
|
+
value: props.checked,
|
|
146
|
+
defaultValue: props.defaultChecked,
|
|
147
|
+
onChange: props.onChange
|
|
148
|
+
}),
|
|
149
|
+
checked = _c[0],
|
|
150
|
+
setChecked = _c[1];
|
|
151
|
+
function onClick() {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
153
|
+
var nextChecked, e_1, result, e_2;
|
|
154
|
+
return __generator(this, function (_a) {
|
|
155
|
+
switch (_a.label) {
|
|
156
|
+
case 0:
|
|
157
|
+
if (disabled || props.loading || changing) {
|
|
158
|
+
return [2 /*return*/];
|
|
159
|
+
}
|
|
160
|
+
nextChecked = !checked;
|
|
161
|
+
if (!props.beforeChange) return [3 /*break*/, 4];
|
|
162
|
+
setChanging(true);
|
|
163
|
+
_a.label = 1;
|
|
164
|
+
case 1:
|
|
165
|
+
_a.trys.push([1, 3,, 4]);
|
|
166
|
+
return [4 /*yield*/, props.beforeChange(nextChecked)];
|
|
167
|
+
case 2:
|
|
168
|
+
_a.sent();
|
|
169
|
+
setChanging(false);
|
|
170
|
+
return [3 /*break*/, 4];
|
|
171
|
+
case 3:
|
|
172
|
+
e_1 = _a.sent();
|
|
173
|
+
setChanging(false);
|
|
174
|
+
throw e_1;
|
|
175
|
+
case 4:
|
|
176
|
+
result = setChecked(nextChecked);
|
|
177
|
+
if (!(0, _validate.isPromise)(result)) return [3 /*break*/, 8];
|
|
178
|
+
setChanging(true);
|
|
179
|
+
_a.label = 5;
|
|
180
|
+
case 5:
|
|
181
|
+
_a.trys.push([5, 7,, 8]);
|
|
182
|
+
return [4 /*yield*/, result];
|
|
183
|
+
case 6:
|
|
184
|
+
_a.sent();
|
|
185
|
+
setChanging(false);
|
|
186
|
+
return [3 /*break*/, 8];
|
|
187
|
+
case 7:
|
|
188
|
+
e_2 = _a.sent();
|
|
189
|
+
setChanging(false);
|
|
190
|
+
throw e_2;
|
|
191
|
+
case 8:
|
|
192
|
+
return [2 /*return*/];
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
198
|
+
onClick: onClick,
|
|
199
|
+
className: (0, _classnames.default)(classPrefix, (_a = {}, _a["".concat(classPrefix, "-checked")] = checked, _a["".concat(classPrefix, "-disabled")] = disabled || changing, _a["".concat(classPrefix, "-small")] = props.size === 'small', _a)),
|
|
200
|
+
role: "switch",
|
|
201
|
+
"aria-checked": checked,
|
|
202
|
+
"aria-disabled": disabled
|
|
203
|
+
}, _react.default.createElement("div", {
|
|
204
|
+
className: "".concat(classPrefix, "-checkbox")
|
|
205
|
+
}, _react.default.createElement("div", {
|
|
206
|
+
className: "".concat(classPrefix, "-handle")
|
|
207
|
+
}, (props.loading || changing) && _react.default.createElement(_2.SpinIcon, {
|
|
208
|
+
className: "".concat(classPrefix, "-spin-icon")
|
|
209
|
+
})), _react.default.createElement("div", {
|
|
210
|
+
className: "".concat(classPrefix, "-inner")
|
|
211
|
+
}, checked ? props.checkedText : props.uncheckedText))));
|
|
212
|
+
};
|
|
213
|
+
var _default = exports.default = Switch;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './tabs.less';
|
|
3
|
+
export type { TabsProps, TabProps } from './tabs';
|
|
4
|
+
declare const _default: import("react").FC<import("./tabs").TabsProps> & {
|
|
5
|
+
Tab: import("react").FC<import("./tabs").TabProps>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
require("./tabs.css");
|
|
8
|
+
var _tabs2 = require("./tabs");
|
|
9
|
+
var _attachPropertiesToComponent = require("../../utils/attach-properties-to-component");
|
|
10
|
+
var _default = exports.default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_tabs2.Tabs, {
|
|
11
|
+
Tab: _tabs2.Tab
|
|
12
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.ebscn-tabs {
|
|
2
|
+
--title-font-size: var(--ebscn-font-size-9);
|
|
3
|
+
--content-padding: 12px;
|
|
4
|
+
--active-line-height: 2px;
|
|
5
|
+
--active-line-border-radius: var(--active-line-height);
|
|
6
|
+
--active-line-color: var(--ebscn-color-primary);
|
|
7
|
+
--active-title-color: var(--ebscn-color-primary);
|
|
8
|
+
position: relative;
|
|
9
|
+
min-width: 0;
|
|
10
|
+
}
|
|
11
|
+
.ebscn-tabs-header {
|
|
12
|
+
position: relative;
|
|
13
|
+
border-bottom: solid 1px var(--ebscn-color-border);
|
|
14
|
+
}
|
|
15
|
+
.ebscn-tabs-tab-list {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-wrap: nowrap;
|
|
18
|
+
justify-content: flex-start;
|
|
19
|
+
align-items: center;
|
|
20
|
+
position: relative;
|
|
21
|
+
overflow-x: scroll;
|
|
22
|
+
scrollbar-width: none;
|
|
23
|
+
}
|
|
24
|
+
.ebscn-tabs-tab-list::-webkit-scrollbar {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
.ebscn-tabs-tab-wrapper {
|
|
28
|
+
padding: 0 12px;
|
|
29
|
+
}
|
|
30
|
+
.ebscn-tabs-tab-wrapper-stretch {
|
|
31
|
+
flex: auto;
|
|
32
|
+
}
|
|
33
|
+
.ebscn-tabs-tab {
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
padding: 8px 0 10px;
|
|
36
|
+
width: -webkit-min-content;
|
|
37
|
+
width: min-content;
|
|
38
|
+
margin: 0 auto;
|
|
39
|
+
font-size: var(--title-font-size);
|
|
40
|
+
position: relative;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
.ebscn-tabs-tab-active {
|
|
44
|
+
color: var(--active-title-color);
|
|
45
|
+
}
|
|
46
|
+
.ebscn-tabs-tab-disabled {
|
|
47
|
+
opacity: 0.5;
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
}
|
|
50
|
+
.ebscn-tabs-tab-line {
|
|
51
|
+
position: absolute;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
height: var(--active-line-height);
|
|
54
|
+
background: var(--active-line-color);
|
|
55
|
+
border-radius: var(--active-line-border-radius);
|
|
56
|
+
}
|
|
57
|
+
.ebscn-tabs-content {
|
|
58
|
+
padding: var(--content-padding);
|
|
59
|
+
}
|
|
60
|
+
.ebscn-tabs-header-mask {
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 0;
|
|
63
|
+
bottom: 0;
|
|
64
|
+
z-index: 1;
|
|
65
|
+
width: 30px;
|
|
66
|
+
height: 100%;
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
}
|
|
69
|
+
.ebscn-tabs-header-mask-left {
|
|
70
|
+
left: 0;
|
|
71
|
+
background: linear-gradient(to right, var(--ebscn-color-background), rgba(255, 255, 255, 0));
|
|
72
|
+
}
|
|
73
|
+
.ebscn-tabs-header-mask-right {
|
|
74
|
+
right: 0;
|
|
75
|
+
background: linear-gradient(to left, var(--ebscn-color-background), rgba(255, 255, 255, 0));
|
|
76
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
export type TabProps = {
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
forceRender?: boolean;
|
|
7
|
+
destroyOnClose?: boolean;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
} & NativeProps;
|
|
10
|
+
export declare const Tab: FC<TabProps>;
|
|
11
|
+
export type TabsProps = {
|
|
12
|
+
activeKey?: string | null;
|
|
13
|
+
activeMode?: 'underline' | 'amplify';
|
|
14
|
+
defaultActiveKey?: string | null;
|
|
15
|
+
activeLineMode?: 'auto' | 'full' | 'fixed';
|
|
16
|
+
stretch?: boolean;
|
|
17
|
+
onChange?: (key: string) => void;
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
direction?: 'ltr' | 'rtl';
|
|
20
|
+
/**
|
|
21
|
+
* @experimental Support disabled auto scroll when Tabs header content change.
|
|
22
|
+
* This API name or function may change in the future.
|
|
23
|
+
* Please lock the version if you want to use it.
|
|
24
|
+
*/
|
|
25
|
+
autoScroll?: boolean;
|
|
26
|
+
} & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding' | '--active-title-color' | '--active-line-color'>;
|
|
27
|
+
export declare const Tabs: FC<TabsProps>;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Tabs = exports.Tab = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _web = require("@react-spring/web");
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
11
|
+
var _usePropsValue = require("../../utils/use-props-value");
|
|
12
|
+
var _bound = require("../../utils/bound");
|
|
13
|
+
var _ahooks = require("ahooks");
|
|
14
|
+
var _useMutationEffect = require("../../utils/use-mutation-effect");
|
|
15
|
+
var _useResizeEffect = require("../../utils/use-resize-effect");
|
|
16
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
|
+
var _useIsomorphicUpdateLayoutEffect = require("../../utils/use-isomorphic-update-layout-effect");
|
|
18
|
+
var _shouldRender = require("../../utils/should-render");
|
|
19
|
+
var _traverseReactNode = require("../../utils/traverse-react-node");
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
var classPrefix = "ebscn-tabs";
|
|
24
|
+
var Tab = function () {
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
27
|
+
exports.Tab = Tab;
|
|
28
|
+
var defaultProps = {
|
|
29
|
+
activeMode: 'underline',
|
|
30
|
+
activeLineMode: 'auto',
|
|
31
|
+
stretch: true,
|
|
32
|
+
direction: 'ltr'
|
|
33
|
+
};
|
|
34
|
+
var Tabs = function (p) {
|
|
35
|
+
var _a;
|
|
36
|
+
var props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
37
|
+
var tabListContainerRef = (0, _react.useRef)(null);
|
|
38
|
+
var activeLineRef = (0, _react.useRef)(null);
|
|
39
|
+
var keyToIndexRecord = {};
|
|
40
|
+
var firstActiveKey = null;
|
|
41
|
+
var panes = [];
|
|
42
|
+
var isRTL = props.direction === 'rtl';
|
|
43
|
+
(0, _traverseReactNode.traverseReactNode)(props.children, function (child, index) {
|
|
44
|
+
if (!(0, _react.isValidElement)(child)) return;
|
|
45
|
+
var key = child.key;
|
|
46
|
+
if (typeof key !== 'string') return;
|
|
47
|
+
if (index === 0) {
|
|
48
|
+
firstActiveKey = key;
|
|
49
|
+
}
|
|
50
|
+
var length = panes.push(child);
|
|
51
|
+
keyToIndexRecord[key] = length - 1;
|
|
52
|
+
});
|
|
53
|
+
var _b = (0, _usePropsValue.usePropsValue)({
|
|
54
|
+
value: props.activeKey,
|
|
55
|
+
defaultValue: (_a = props.defaultActiveKey) !== null && _a !== void 0 ? _a : firstActiveKey,
|
|
56
|
+
onChange: function (v) {
|
|
57
|
+
var _a;
|
|
58
|
+
if (v === null) return;
|
|
59
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, v);
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
activeKey = _b[0],
|
|
63
|
+
setActiveKey = _b[1];
|
|
64
|
+
var _c = (0, _web.useSpring)(function () {
|
|
65
|
+
return {
|
|
66
|
+
x: 0,
|
|
67
|
+
width: 0,
|
|
68
|
+
config: {
|
|
69
|
+
tension: 300,
|
|
70
|
+
clamp: true
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}),
|
|
74
|
+
_d = _c[0],
|
|
75
|
+
x = _d.x,
|
|
76
|
+
width = _d.width,
|
|
77
|
+
inkApi = _c[1];
|
|
78
|
+
var _e = (0, _web.useSpring)(function () {
|
|
79
|
+
return {
|
|
80
|
+
scrollLeft: 0,
|
|
81
|
+
config: {
|
|
82
|
+
tension: 300,
|
|
83
|
+
clamp: true
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}),
|
|
87
|
+
scrollLeft = _e[0].scrollLeft,
|
|
88
|
+
scrollApi = _e[1];
|
|
89
|
+
var _f = (0, _web.useSpring)(function () {
|
|
90
|
+
return {
|
|
91
|
+
leftMaskOpacity: 0,
|
|
92
|
+
rightMaskOpacity: 0,
|
|
93
|
+
config: {
|
|
94
|
+
clamp: true
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}),
|
|
98
|
+
_g = _f[0],
|
|
99
|
+
leftMaskOpacity = _g.leftMaskOpacity,
|
|
100
|
+
rightMaskOpacity = _g.rightMaskOpacity,
|
|
101
|
+
maskApi = _f[1];
|
|
102
|
+
function animate(immediate, fromMutation) {
|
|
103
|
+
if (immediate === void 0) {
|
|
104
|
+
immediate = false;
|
|
105
|
+
}
|
|
106
|
+
if (fromMutation === void 0) {
|
|
107
|
+
fromMutation = false;
|
|
108
|
+
}
|
|
109
|
+
var container = tabListContainerRef.current;
|
|
110
|
+
if (!container) return;
|
|
111
|
+
var activeIndex = keyToIndexRecord[activeKey];
|
|
112
|
+
if (activeIndex === undefined) {
|
|
113
|
+
inkApi.start({
|
|
114
|
+
x: 0,
|
|
115
|
+
width: 0,
|
|
116
|
+
immediate: true
|
|
117
|
+
});
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
var activeLine = activeLineRef.current;
|
|
121
|
+
if (!activeLine) return;
|
|
122
|
+
var activeTabWrapper = container.children.item(activeIndex + 1);
|
|
123
|
+
var activeTab = activeTabWrapper.children.item(0);
|
|
124
|
+
var activeTabLeft = activeTab.offsetLeft;
|
|
125
|
+
var activeTabWidth = activeTab.offsetWidth;
|
|
126
|
+
var activeTabWrapperLeft = activeTabWrapper.offsetLeft;
|
|
127
|
+
var activeTabWrapperWidth = activeTabWrapper.offsetWidth;
|
|
128
|
+
var containerWidth = container.offsetWidth;
|
|
129
|
+
var containerScrollWidth = container.scrollWidth;
|
|
130
|
+
var containerScrollLeft = container.scrollLeft;
|
|
131
|
+
var activeLineWidth = activeLine.offsetWidth;
|
|
132
|
+
var x = 0;
|
|
133
|
+
var width = 0;
|
|
134
|
+
if (props.activeLineMode === 'auto') {
|
|
135
|
+
x = activeTabLeft;
|
|
136
|
+
width = activeTabWidth;
|
|
137
|
+
} else if (props.activeLineMode === 'full') {
|
|
138
|
+
x = activeTabWrapperLeft;
|
|
139
|
+
width = activeTabWrapperWidth;
|
|
140
|
+
} else {
|
|
141
|
+
x = activeTabLeft + (activeTabWidth - activeLineWidth) / 2;
|
|
142
|
+
}
|
|
143
|
+
if (isRTL) {
|
|
144
|
+
/**
|
|
145
|
+
* In RTL mode, x equals the container width minus the x-coordinate of the current tab minus the width of the current tab.
|
|
146
|
+
* https://github.com/Fog3211/reproduce-codesandbox/blob/f0a3396a114cc00e88a51a67d3be60a746519b30/assets/images/antd_mobile_tabs_rtl_x.jpg?raw=true
|
|
147
|
+
*/
|
|
148
|
+
var w = ['auto', 'full'].includes(props.activeLineMode) ? width : activeLineWidth;
|
|
149
|
+
x = -(containerWidth - x - w);
|
|
150
|
+
}
|
|
151
|
+
inkApi.start({
|
|
152
|
+
x: x,
|
|
153
|
+
width: width,
|
|
154
|
+
immediate: immediate
|
|
155
|
+
});
|
|
156
|
+
var maxScrollDistance = containerScrollWidth - containerWidth;
|
|
157
|
+
if (maxScrollDistance <= 0) return;
|
|
158
|
+
var nextScrollLeft = 0;
|
|
159
|
+
if (isRTL) {
|
|
160
|
+
/**
|
|
161
|
+
* 位移距离等于:activeTab的中心坐标距离容器中心坐标的距离,然后RTL取负数
|
|
162
|
+
* containerWidth / 2 - (activeTabLeft + (activeTabWidth - activeLineWidth) / 2) - activeLineWidth / 2,
|
|
163
|
+
*/
|
|
164
|
+
nextScrollLeft = -(0, _bound.bound)(containerWidth / 2 - activeTabLeft + activeTabWidth / 2 - activeLineWidth, 0, maxScrollDistance);
|
|
165
|
+
} else {
|
|
166
|
+
nextScrollLeft = (0, _bound.bound)(activeTabLeft - (containerWidth - activeTabWidth) / 2, 0, maxScrollDistance);
|
|
167
|
+
}
|
|
168
|
+
if (!fromMutation || props.autoScroll !== false) {
|
|
169
|
+
scrollApi.start({
|
|
170
|
+
scrollLeft: nextScrollLeft,
|
|
171
|
+
from: {
|
|
172
|
+
scrollLeft: containerScrollLeft
|
|
173
|
+
},
|
|
174
|
+
immediate: immediate
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(function () {
|
|
179
|
+
animate(!x.isAnimating);
|
|
180
|
+
}, []);
|
|
181
|
+
(0, _useIsomorphicUpdateLayoutEffect.useIsomorphicUpdateLayoutEffect)(function () {
|
|
182
|
+
animate();
|
|
183
|
+
}, [activeKey]);
|
|
184
|
+
(0, _useResizeEffect.useResizeEffect)(function () {
|
|
185
|
+
animate(!x.isAnimating);
|
|
186
|
+
}, tabListContainerRef);
|
|
187
|
+
(0, _useMutationEffect.useMutationEffect)(function () {
|
|
188
|
+
animate(!x.isAnimating, true);
|
|
189
|
+
}, tabListContainerRef, {
|
|
190
|
+
subtree: true,
|
|
191
|
+
childList: true,
|
|
192
|
+
characterData: true
|
|
193
|
+
});
|
|
194
|
+
var updateMask = (0, _ahooks.useThrottleFn)(function (immediate) {
|
|
195
|
+
if (immediate === void 0) {
|
|
196
|
+
immediate = false;
|
|
197
|
+
}
|
|
198
|
+
var container = tabListContainerRef.current;
|
|
199
|
+
if (!container) return;
|
|
200
|
+
var scrollLeft = container.scrollLeft;
|
|
201
|
+
var showLeftMask = false;
|
|
202
|
+
var showRightMask = false;
|
|
203
|
+
if (isRTL) {
|
|
204
|
+
/**
|
|
205
|
+
* RTL模式下,只要滑动过,scrollLeft就再也回不到0(chrome是0.5)
|
|
206
|
+
* 所以要加round才能终止触发条件
|
|
207
|
+
* round(443.5) + 375 < 819
|
|
208
|
+
*/
|
|
209
|
+
showLeftMask = Math.round(-scrollLeft) + container.offsetWidth < container.scrollWidth;
|
|
210
|
+
showRightMask = scrollLeft < 0;
|
|
211
|
+
} else {
|
|
212
|
+
showLeftMask = scrollLeft > 0;
|
|
213
|
+
showRightMask = scrollLeft + container.offsetWidth < container.scrollWidth;
|
|
214
|
+
}
|
|
215
|
+
maskApi.start({
|
|
216
|
+
leftMaskOpacity: showLeftMask ? 1 : 0,
|
|
217
|
+
rightMaskOpacity: showRightMask ? 1 : 0,
|
|
218
|
+
immediate: immediate
|
|
219
|
+
});
|
|
220
|
+
}, {
|
|
221
|
+
wait: 100,
|
|
222
|
+
trailing: true,
|
|
223
|
+
leading: true
|
|
224
|
+
}).run;
|
|
225
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(function () {
|
|
226
|
+
updateMask(true);
|
|
227
|
+
}, []);
|
|
228
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
229
|
+
className: classPrefix,
|
|
230
|
+
style: {
|
|
231
|
+
direction: props.direction
|
|
232
|
+
}
|
|
233
|
+
}, _react.default.createElement("div", {
|
|
234
|
+
className: "".concat(classPrefix, "-header")
|
|
235
|
+
}, _react.default.createElement(_web.animated.div, {
|
|
236
|
+
className: (0, _classnames.default)("".concat(classPrefix, "-header-mask"), "".concat(classPrefix, "-header-mask-left")),
|
|
237
|
+
style: {
|
|
238
|
+
opacity: leftMaskOpacity
|
|
239
|
+
}
|
|
240
|
+
}), _react.default.createElement(_web.animated.div, {
|
|
241
|
+
className: (0, _classnames.default)("".concat(classPrefix, "-header-mask"), "".concat(classPrefix, "-header-mask-right")),
|
|
242
|
+
style: {
|
|
243
|
+
opacity: rightMaskOpacity
|
|
244
|
+
}
|
|
245
|
+
}), _react.default.createElement(_web.animated.div, {
|
|
246
|
+
className: "".concat(classPrefix, "-tab-list"),
|
|
247
|
+
ref: tabListContainerRef,
|
|
248
|
+
scrollLeft: scrollLeft,
|
|
249
|
+
onScroll: updateMask,
|
|
250
|
+
role: 'tablist'
|
|
251
|
+
}, _react.default.createElement(_web.animated.div, {
|
|
252
|
+
ref: activeLineRef,
|
|
253
|
+
className: "".concat(classPrefix, "-tab-line"),
|
|
254
|
+
style: {
|
|
255
|
+
width: props.activeLineMode === 'fixed' ? 'var(--fixed-active-line-width, 30px)' : width,
|
|
256
|
+
x: x
|
|
257
|
+
}
|
|
258
|
+
}), panes.map(function (pane) {
|
|
259
|
+
var _a, _b;
|
|
260
|
+
return (0, _nativeProps.withNativeProps)(pane.props, _react.default.createElement("div", {
|
|
261
|
+
key: pane.key,
|
|
262
|
+
className: (0, _classnames.default)("".concat(classPrefix, "-tab-wrapper"), (_a = {}, _a["".concat(classPrefix, "-tab-wrapper-stretch")] = props.stretch, _a))
|
|
263
|
+
}, _react.default.createElement("div", {
|
|
264
|
+
onClick: function () {
|
|
265
|
+
var key = pane.key;
|
|
266
|
+
if (pane.props.disabled) return;
|
|
267
|
+
if (key === undefined || key === null) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
setActiveKey(key.toString());
|
|
271
|
+
},
|
|
272
|
+
className: (0, _classnames.default)("".concat(classPrefix, "-tab"), (_b = {}, _b["".concat(classPrefix, "-tab-active")] = pane.key === activeKey, _b["".concat(classPrefix, "-tab-disabled")] = pane.props.disabled, _b)),
|
|
273
|
+
role: 'tab',
|
|
274
|
+
"aria-selected": pane.key === activeKey
|
|
275
|
+
}, pane.props.title)));
|
|
276
|
+
}))), panes.map(function (pane) {
|
|
277
|
+
if (pane.props.children === undefined) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
var active = pane.key === activeKey;
|
|
281
|
+
return _react.default.createElement(_shouldRender.ShouldRender, {
|
|
282
|
+
key: pane.key,
|
|
283
|
+
active: active,
|
|
284
|
+
forceRender: pane.props.forceRender,
|
|
285
|
+
destroyOnClose: pane.props.destroyOnClose
|
|
286
|
+
}, _react.default.createElement("div", {
|
|
287
|
+
className: "".concat(classPrefix, "-content"),
|
|
288
|
+
style: {
|
|
289
|
+
display: active ? 'block' : 'none'
|
|
290
|
+
}
|
|
291
|
+
}, pane.props.children));
|
|
292
|
+
})));
|
|
293
|
+
};
|
|
294
|
+
exports.Tabs = Tabs;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.ebscn-tabs-header {
|
|
2
|
+
border-bottom: solid 1px #eeeeee;
|
|
3
|
+
}
|
|
4
|
+
.ebscn-tabs-tab {
|
|
5
|
+
font-size: 17px;
|
|
6
|
+
}
|
|
7
|
+
.ebscn-tabs-tab-active {
|
|
8
|
+
color: #1677ff;
|
|
9
|
+
}
|
|
10
|
+
.ebscn-tabs-tab-line {
|
|
11
|
+
height: 2px;
|
|
12
|
+
background: #1677ff;
|
|
13
|
+
border-radius: 2px;
|
|
14
|
+
}
|
|
15
|
+
.ebscn-tabs-content {
|
|
16
|
+
padding: 12px;
|
|
17
|
+
}
|
|
18
|
+
.ebscn-tabs-header-mask-left {
|
|
19
|
+
background: linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0));
|
|
20
|
+
}
|
|
21
|
+
.ebscn-tabs-header-mask-right {
|
|
22
|
+
background: linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0));
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.ebscn-tip {
|
|
2
|
+
--font-size: var(--ebscn-font-size-6);
|
|
3
|
+
--border-radius: 6px;
|
|
4
|
+
--padding: 12px 10px;
|
|
5
|
+
color: var(--tip-color);
|
|
6
|
+
position: relative;
|
|
7
|
+
padding: var(--padding);
|
|
8
|
+
font-size: var(--font-size);
|
|
9
|
+
}
|
|
10
|
+
.ebscn-tip::before {
|
|
11
|
+
content: ' ';
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
background-color: var(--tip-color);
|
|
18
|
+
opacity: 0.1;
|
|
19
|
+
box-sizing: content-box;
|
|
20
|
+
border-radius: var(--border-radius);
|
|
21
|
+
transform: translate(calc(var(--border-width) * -1), calc(var(--border-width) * -1));
|
|
22
|
+
}
|