@cloud-app-dev/vidc 4.0.20 → 4.0.21
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/es/AppContext/Sync.d.ts +8 -0
- package/es/AppContext/Sync.js +42 -0
- package/es/AppContext/index.d.ts +10 -0
- package/es/AppContext/index.js +141 -0
- package/es/AppContext/interface.d.ts +41 -0
- package/es/AppContext/static.d.ts +8 -0
- package/es/AppContext/static.js +9 -0
- package/es/Auth/index.d.ts +8 -0
- package/es/Auth/index.js +14 -0
- package/es/AutoExit/index.d.ts +6 -0
- package/es/AutoExit/index.js +19 -0
- package/es/CheckGroupFixed/demo.d.ts +3 -0
- package/es/CheckGroupFixed/demo.js +22 -0
- package/es/CheckGroupFixed/index.d.ts +24 -0
- package/es/CheckGroupFixed/index.js +140 -0
- package/es/CheckGroupFixed/index.less +56 -0
- package/es/Config/index.d.ts +4 -0
- package/es/Config/index.js +77 -0
- package/es/Config/interface.d.ts +65 -0
- package/es/Config/utils.d.ts +4 -0
- package/es/Config/utils.js +33 -0
- package/es/ConfigContext/index.d.ts +17 -0
- package/es/ConfigContext/index.js +21 -0
- package/es/CustomRenderSelect/index.d.ts +12 -0
- package/es/CustomRenderSelect/index.js +73 -0
- package/es/CustomRenderSelect/index.less +25 -0
- package/es/DBTools/index.d.ts +25 -0
- package/es/DBTools/index.js +336 -0
- package/es/DisableMark/index.d.ts +9 -0
- package/es/DisableMark/index.js +19 -0
- package/es/DisableMark/index.less +9 -0
- package/es/DomMove/demo.d.ts +2 -0
- package/es/DomMove/demo.js +16 -0
- package/es/DomMove/index.d.ts +16 -0
- package/es/DomMove/index.js +139 -0
- package/es/DomMove/utils.d.ts +8 -0
- package/es/DomMove/utils.js +32 -0
- package/es/Drag/DragAndDropItem.d.ts +4 -0
- package/es/Drag/DragAndDropItem.js +134 -0
- package/es/Drag/DropItem.d.ts +4 -0
- package/es/Drag/DropItem.js +50 -0
- package/es/Drag/index.d.ts +7 -0
- package/es/Drag/index.js +7 -0
- package/es/Drag/interface.d.ts +16 -0
- package/es/DynamicGridList/Demo.d.ts +3 -0
- package/es/DynamicGridList/Demo.js +77 -0
- package/es/DynamicGridList/index.d.ts +24 -0
- package/es/DynamicGridList/index.js +67 -0
- package/es/DynamicList/demo.d.ts +2 -0
- package/es/DynamicList/demo.js +44 -0
- package/es/DynamicList/index.d.ts +22 -0
- package/es/DynamicList/index.js +86 -0
- package/es/DynamicList/index.less +17 -0
- package/es/DynamicList/interface.d.ts +19 -0
- package/es/DynamicList/utils.d.ts +4 -0
- package/es/DynamicList/utils.js +6 -0
- package/es/ErrorFallback/index.d.ts +9 -0
- package/es/ErrorFallback/index.js +31 -0
- package/es/ErrorFallback/inerface.d.ts +48 -0
- package/es/EventTools/index.d.ts +3 -0
- package/es/EventTools/index.js +12 -0
- package/es/FrontendPlayer/index.d.ts +4 -0
- package/es/FrontendPlayer/index.js +2 -0
- package/es/FullScreen/index.d.ts +22 -0
- package/es/FullScreen/index.js +33 -0
- package/es/FullScreen/index.less +18 -0
- package/es/GridList/Demo.d.ts +3 -0
- package/es/GridList/Demo.js +80 -0
- package/es/GridList/data.d.ts +16 -0
- package/es/GridList/data.js +609 -0
- package/es/GridList/hook.d.ts +13 -0
- package/es/GridList/hook.js +270 -0
- package/es/GridList/index.d.ts +15 -0
- package/es/GridList/index.js +44 -0
- package/es/GridList/index.less +8 -0
- package/es/GridList/interface.d.ts +59 -0
- package/es/GridList/utils.d.ts +9 -0
- package/es/GridList/utils.js +42 -0
- package/es/HightLevel/index.d.ts +9 -0
- package/es/HightLevel/index.js +18 -0
- package/es/HightLevel/index.less +3 -0
- package/es/IconFont/index.d.ts +12 -0
- package/es/IconFont/index.js +54 -0
- package/es/ImageView/index.d.ts +20 -0
- package/es/ImageView/index.js +51 -0
- package/es/ImageView/index.less +11 -0
- package/es/InstanceHistory/index.d.ts +3 -0
- package/es/InstanceHistory/index.js +7 -0
- package/es/LabelPlayer/111.png +0 -0
- package/es/LabelPlayer/demo.d.ts +2 -0
- package/es/LabelPlayer/demo.js +115 -0
- package/es/LabelPlayer/index.d.ts +21 -0
- package/es/LabelPlayer/index.js +160 -0
- package/es/LabelPlayer/index.less +24 -0
- package/es/LabelValue/index.d.ts +15 -0
- package/es/LabelValue/index.js +27 -0
- package/es/LabelValue/index.less +23 -0
- package/es/List/demo.d.ts +3 -0
- package/es/List/demo.js +23 -0
- package/es/List/index.d.ts +28 -0
- package/es/List/index.js +28 -0
- package/es/List/index.less +20 -0
- package/es/ListWithSizeAnimate/demo.d.ts +2 -0
- package/es/ListWithSizeAnimate/demo.js +98 -0
- package/es/ListWithSizeAnimate/index.d.ts +14 -0
- package/es/ListWithSizeAnimate/index.js +85 -0
- package/es/ListWithSizeAnimate/index.less +23 -0
- package/es/LoaderScript/index.d.ts +47 -0
- package/es/LoaderScript/index.js +34 -0
- package/es/LoaderScript/utils.d.ts +13 -0
- package/es/LoaderScript/utils.js +179 -0
- package/es/Map/AMap.d.ts +7109 -0
- package/es/Map/BasicMap/AMapInstance.d.ts +19 -0
- package/es/Map/BasicMap/AMapInstance.js +98 -0
- package/es/Map/BasicMap/LeafletInstance.d.ts +18 -0
- package/es/Map/BasicMap/LeafletInstance.js +111 -0
- package/es/Map/BasicMap/index.d.ts +9 -0
- package/es/Map/BasicMap/index.js +90 -0
- package/es/Map/BasicMap/index.less +29 -0
- package/es/Map/ClusterLayer/demo.d.ts +3 -0
- package/es/Map/ClusterLayer/demo.js +18 -0
- package/es/Map/ClusterLayer/hook.d.ts +5 -0
- package/es/Map/ClusterLayer/hook.js +123 -0
- package/es/Map/ClusterLayer/index.d.ts +6 -0
- package/es/Map/ClusterLayer/index.js +28 -0
- package/es/Map/ClusterLayer/index.less +29 -0
- package/es/Map/ClusterLayer/props.d.ts +8 -0
- package/es/Map/Config/index.d.ts +9 -0
- package/es/Map/Config/index.js +48 -0
- package/es/Map/Config/utils.d.ts +2 -0
- package/es/Map/Config/utils.js +65 -0
- package/es/Map/Context/index.d.ts +11 -0
- package/es/Map/Context/index.js +51 -0
- package/es/Map/FindPio/index.d.ts +4 -0
- package/es/Map/FindPio/index.js +13 -0
- package/es/Map/FindPio/index.less +7 -0
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +4 -0
- package/es/Map/InfoWindow/MakerLikeWindow.js +112 -0
- package/es/Map/InfoWindow/demo.d.ts +3 -0
- package/es/Map/InfoWindow/demo.js +70 -0
- package/es/Map/InfoWindow/index.d.ts +11 -0
- package/es/Map/InfoWindow/index.js +66 -0
- package/es/Map/LevelCenter/DragMarker/index.d.ts +10 -0
- package/es/Map/LevelCenter/DragMarker/index.js +42 -0
- package/es/Map/LevelCenter/demo.d.ts +3 -0
- package/es/Map/LevelCenter/demo.js +38 -0
- package/es/Map/LevelCenter/index.d.ts +15 -0
- package/es/Map/LevelCenter/index.js +66 -0
- package/es/Map/LoaderMap/index.d.ts +7 -0
- package/es/Map/LoaderMap/index.js +62 -0
- package/es/Map/MapDrawSelect/demo.d.ts +3 -0
- package/es/Map/MapDrawSelect/demo.js +71 -0
- package/es/Map/MapDrawSelect/index.d.ts +15 -0
- package/es/Map/MapDrawSelect/index.js +56 -0
- package/es/Map/MouseTool/index.d.ts +10 -0
- package/es/Map/MouseTool/index.js +40 -0
- package/es/Map/MouseTool/useMouseTools.d.ts +7 -0
- package/es/Map/MouseTool/useMouseTools.js +83 -0
- package/es/Map/ResetTools/index.d.ts +10 -0
- package/es/Map/ResetTools/index.js +57 -0
- package/es/Map/ResetTools/index.less +39 -0
- package/es/Map/SinglePoint/demo.d.ts +3 -0
- package/es/Map/SinglePoint/demo.js +14 -0
- package/es/Map/SinglePoint/index.d.ts +27 -0
- package/es/Map/SinglePoint/index.js +52 -0
- package/es/Map/SinglePoint/index.less +41 -0
- package/es/Map/hook/useMapEvent.d.ts +2 -0
- package/es/Map/hook/useMapEvent.js +19 -0
- package/es/Map/hook/useMapType.d.ts +4 -0
- package/es/Map/hook/useMapType.js +12 -0
- package/es/Map/icon.d.ts +2 -0
- package/es/Map/icon.js +10 -0
- package/es/Map/index.d.ts +24 -0
- package/es/Map/index.js +25 -0
- package/es/Map/interface.d.ts +74 -0
- package/es/Map/points.d.ts +50 -0
- package/es/Map/points.js +1 -0
- package/es/Map/useMarker/index.d.ts +10 -0
- package/es/Map/useMarker/index.js +71 -0
- package/es/Map/withMap/index.d.ts +3 -0
- package/es/Map/withMap/index.js +10 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +8 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +80 -0
- package/es/Picture/component/DefaultRects/index.d.ts +13 -0
- package/es/Picture/component/DefaultRects/index.js +52 -0
- package/es/Picture/component/DefaultRects/index.less +211 -0
- package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
- package/es/Picture/component/DefaultRects/utils.js +11 -0
- package/es/Picture/component/DrawRect/index.d.ts +13 -0
- package/es/Picture/component/DrawRect/index.js +46 -0
- package/es/Picture/component/DrawRect/index.less +8 -0
- package/es/Picture/component/RectMenu/index.d.ts +12 -0
- package/es/Picture/component/RectMenu/index.js +76 -0
- package/es/Picture/component/RectMenu/index.less +36 -0
- package/es/Picture/component/RectMenu/utils.d.ts +12 -0
- package/es/Picture/component/RectMenu/utils.js +19 -0
- package/es/Picture/component/Tools/index.d.ts +12 -0
- package/es/Picture/component/Tools/index.js +73 -0
- package/es/Picture/component/Tools/index.less +49 -0
- package/es/Picture/component/WheelScale/index.d.ts +7 -0
- package/es/Picture/component/WheelScale/index.js +27 -0
- package/es/Picture/demo.d.ts +2 -0
- package/es/Picture/demo.js +105 -0
- package/es/Picture/index.d.ts +5 -0
- package/es/Picture/index.js +341 -0
- package/es/Picture/index.less +20 -0
- package/es/Picture/interface.d.ts +196 -0
- package/es/Picture/loadCaptureRectImage.d.ts +3 -0
- package/es/Picture/loadCaptureRectImage.js +99 -0
- package/es/Picture/useDraw.d.ts +1 -0
- package/es/Picture/useDraw.js +103 -0
- package/es/Picture/utils.d.ts +26 -0
- package/es/Picture/utils.js +143 -0
- package/es/Player/api/index.d.ts +68 -0
- package/es/Player/api/index.js +309 -0
- package/es/Player/context.d.ts +17 -0
- package/es/Player/context.js +24 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/bar.js +20 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +6 -0
- package/es/Player/contraller_bar/contraller_event.js +50 -0
- package/es/Player/contraller_bar/index.d.ts +14 -0
- package/es/Player/contraller_bar/index.js +27 -0
- package/es/Player/contraller_bar/left_bar.d.ts +10 -0
- package/es/Player/contraller_bar/left_bar.js +83 -0
- package/es/Player/contraller_bar/right_bar.d.ts +8 -0
- package/es/Player/contraller_bar/right_bar.js +32 -0
- package/es/Player/contraller_bar/time.d.ts +3 -0
- package/es/Player/contraller_bar/time.js +19 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +2 -0
- package/es/Player/contraller_bar/useBarStatus.js +43 -0
- package/es/Player/contraller_bar/volume.d.ts +9 -0
- package/es/Player/contraller_bar/volume.js +62 -0
- package/es/Player/demo.d.ts +3 -0
- package/es/Player/demo.js +266 -0
- package/es/Player/empty.d.ts +2 -0
- package/es/Player/empty.js +4 -0
- package/es/Player/event/errorEvent.d.ts +14 -0
- package/es/Player/event/errorEvent.js +88 -0
- package/es/Player/event/eventName.d.ts +18 -0
- package/es/Player/event/eventName.js +29 -0
- package/es/Player/event/index.d.ts +24 -0
- package/es/Player/event/index.js +205 -0
- package/es/Player/fps_play.d.ts +11 -0
- package/es/Player/fps_play.js +83 -0
- package/es/Player/frontend_player.d.ts +8 -0
- package/es/Player/frontend_player.js +64 -0
- package/es/Player/frontend_timeline.d.ts +10 -0
- package/es/Player/frontend_timeline.js +132 -0
- package/es/Player/iconfont.d.ts +5 -0
- package/es/Player/iconfont.js +16 -0
- package/es/Player/index.d.ts +2 -0
- package/es/Player/index.js +2 -0
- package/es/Player/live_heart.d.ts +8 -0
- package/es/Player/live_heart.js +45 -0
- package/es/Player/message.d.ts +5 -0
- package/es/Player/message.js +137 -0
- package/es/Player/player.d.ts +233 -0
- package/es/Player/segment_player.d.ts +9 -0
- package/es/Player/segment_player.js +228 -0
- package/es/Player/segment_timeline.d.ts +12 -0
- package/es/Player/segment_timeline.js +173 -0
- package/es/Player/single_player.d.ts +5 -0
- package/es/Player/single_player.js +262 -0
- package/es/Player/style/bar.less +43 -0
- package/es/Player/style/iconfont.js +43 -0
- package/es/Player/style/index.less +34 -0
- package/es/Player/style/message.less +56 -0
- package/es/Player/style/slider.less +106 -0
- package/es/Player/style/timeline.less +117 -0
- package/es/Player/style/volume.less +24 -0
- package/es/Player/timeline.d.ts +5 -0
- package/es/Player/timeline.js +95 -0
- package/es/Player/util.d.ts +43 -0
- package/es/Player/util.js +189 -0
- package/es/PlayerExt/demo.d.ts +3 -0
- package/es/PlayerExt/demo.js +154 -0
- package/es/PlayerExt/index.d.ts +48 -0
- package/es/PlayerExt/index.js +188 -0
- package/es/PlayerExt/index.less +10 -0
- package/es/Progress/index.d.ts +7 -0
- package/es/Progress/index.js +53 -0
- package/es/Progress/index.less +21 -0
- package/es/ROI/demo.d.ts +3 -0
- package/es/ROI/demo.js +16 -0
- package/es/ROI/index.d.ts +33 -0
- package/es/ROI/index.js +54 -0
- package/es/ROI/index.less +33 -0
- package/es/RefDrawer/Footer.d.ts +9 -0
- package/es/RefDrawer/Footer.js +22 -0
- package/es/RefDrawer/demo.d.ts +3 -0
- package/es/RefDrawer/demo.js +18 -0
- package/es/RefDrawer/index.d.ts +26 -0
- package/es/RefDrawer/index.js +71 -0
- package/es/RefModal/demo.d.ts +3 -0
- package/es/RefModal/demo.js +18 -0
- package/es/RefModal/index.d.ts +17 -0
- package/es/RefModal/index.js +70 -0
- package/es/ScreenPlayer/Live.d.ts +5 -0
- package/es/ScreenPlayer/Live.js +212 -0
- package/es/ScreenPlayer/LiveTools.d.ts +29 -0
- package/es/ScreenPlayer/LiveTools.js +151 -0
- package/es/ScreenPlayer/PlayerWithExt.d.ts +34 -0
- package/es/ScreenPlayer/PlayerWithExt.js +231 -0
- package/es/ScreenPlayer/RatePick.d.ts +8 -0
- package/es/ScreenPlayer/RatePick.js +29 -0
- package/es/ScreenPlayer/Record.d.ts +10 -0
- package/es/ScreenPlayer/Record.js +442 -0
- package/es/ScreenPlayer/RecordTools.d.ts +38 -0
- package/es/ScreenPlayer/RecordTools.js +197 -0
- package/es/ScreenPlayer/ScreenSelect.d.ts +7 -0
- package/es/ScreenPlayer/ScreenSelect.js +46 -0
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +17 -0
- package/es/ScreenPlayer/SegmentTimeLine.js +36 -0
- package/es/ScreenPlayer/TimeMode.d.ts +7 -0
- package/es/ScreenPlayer/TimeMode.js +26 -0
- package/es/ScreenPlayer/TimeSelect.d.ts +7 -0
- package/es/ScreenPlayer/TimeSelect.js +88 -0
- package/es/ScreenPlayer/demo.d.ts +2 -0
- package/es/ScreenPlayer/demo.js +21 -0
- package/es/ScreenPlayer/demo2.d.ts +2 -0
- package/es/ScreenPlayer/demo2.js +194 -0
- package/es/ScreenPlayer/index.d.ts +6 -0
- package/es/ScreenPlayer/index.js +9 -0
- package/es/ScreenPlayer/index.less +335 -0
- package/es/ScreenPlayer/interface.d.ts +216 -0
- package/es/ScreenPlayer/useTimeSlider.d.ts +25 -0
- package/es/ScreenPlayer/useTimeSlider.js +451 -0
- package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
- package/es/ScreenPlayer/useVideoFit.js +35 -0
- package/es/ScreenPlayer/utils.d.ts +17 -0
- package/es/ScreenPlayer/utils.js +85 -0
- package/es/SegmentPlayer/index.d.ts +2 -0
- package/es/SegmentPlayer/index.js +2 -0
- package/es/Service/http.d.ts +6 -0
- package/es/Service/http.js +133 -0
- package/es/Service/index.d.ts +3 -0
- package/es/Service/index.js +11 -0
- package/es/Service/interface.d.ts +23 -0
- package/es/Service/middleware.d.ts +8 -0
- package/es/Service/middleware.js +22 -0
- package/es/SocketEmitter/eventEmitter.d.ts +27 -0
- package/es/SocketEmitter/eventEmitter.js +88 -0
- package/es/SocketEmitter/index.d.ts +24 -0
- package/es/SocketEmitter/index.js +125 -0
- package/es/SocketEmitter/interface.d.ts +4 -0
- package/es/TableLayout/index.d.ts +10 -0
- package/es/TableLayout/index.js +27 -0
- package/es/TableLayout/index.less +4 -0
- package/es/ThemeAntd/demo.d.ts +4 -0
- package/es/ThemeAntd/demo.js +81 -0
- package/es/ThemeAntd/demo.less +20 -0
- package/es/ThemeAntd/index.d.ts +7 -0
- package/es/ThemeAntd/index.js +21 -0
- package/es/ThemeAntd/index.less +4 -0
- package/es/Timeout/index.d.ts +26 -0
- package/es/Timeout/index.js +65 -0
- package/es/bigNumberTransformCN/index.d.ts +5 -0
- package/es/bigNumberTransformCN/index.js +58 -0
- package/es/cache/index.d.ts +34 -0
- package/es/cache/index.js +94 -0
- package/es/copy/index.d.ts +1 -0
- package/es/copy/index.js +9 -0
- package/es/core.d.ts +0 -0
- package/es/getThemeStyle/index.d.ts +2 -0
- package/es/getThemeStyle/index.js +5 -0
- package/es/index.d.ts +62 -0
- package/es/index.js +62 -0
- package/es/likeGo/index.d.ts +2 -0
- package/es/likeGo/index.js +31 -0
- package/es/likeGoSync/index.d.ts +2 -0
- package/es/likeGoSync/index.js +10 -0
- package/es/logger/index.d.ts +7 -0
- package/es/logger/index.js +30 -0
- package/es/nextTick/index.d.ts +1 -0
- package/es/nextTick/index.js +3 -0
- package/es/recorder/demo.d.ts +3 -0
- package/es/recorder/demo.js +181 -0
- package/es/recorder/index.d.ts +294 -0
- package/es/recorder/index.js +992 -0
- package/es/submidstr/index.d.ts +5 -0
- package/es/submidstr/index.js +14 -0
- package/es/treeHelper/index.d.ts +11 -0
- package/es/treeHelper/index.js +188 -0
- package/es/typings.d.ts +2 -0
- package/es/useDrawROI/index.d.ts +16 -0
- package/es/useDrawROI/index.js +318 -0
- package/es/useEventEmitterHandle/index.d.ts +2 -0
- package/es/useEventEmitterHandle/index.js +17 -0
- package/es/useFullscreen/demo.d.ts +2 -0
- package/es/useFullscreen/demo.js +43 -0
- package/es/useFullscreen/index.d.ts +12 -0
- package/es/useFullscreen/index.js +76 -0
- package/es/useHistory/index.d.ts +3 -0
- package/es/useHistory/index.js +9 -0
- package/es/useHistory/interface.d.ts +3 -0
- package/es/useInfiniteScroll/index.d.ts +16 -0
- package/es/useInfiniteScroll/index.js +102 -0
- package/es/useRafInterval/index.d.ts +5 -0
- package/es/useRafInterval/index.js +71 -0
- package/es/useSimpleState/index.d.ts +3 -0
- package/es/useSimpleState/index.js +35 -0
- package/es/useVirtualList/index.d.ts +13 -0
- package/es/useVirtualList/index.js +136 -0
- package/es/utils.d.ts +14 -0
- package/es/utils.js +46 -0
- package/es/uuid/index.d.ts +5 -0
- package/es/uuid/index.js +6 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference path="../AMap.d.ts" />
|
|
2
|
+
import { Map } from '../interface';
|
|
3
|
+
export interface IUseMarkerProps {
|
|
4
|
+
map: Map;
|
|
5
|
+
center: [number, number];
|
|
6
|
+
createIcon: (options?: any) => any;
|
|
7
|
+
options?: AMap.MarkerOptions;
|
|
8
|
+
}
|
|
9
|
+
declare function useMarker({ map, center, createIcon, options }: IUseMarkerProps): any;
|
|
10
|
+
export default useMarker;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
14
|
+
/// <reference path="../AMap.d.ts" />
|
|
15
|
+
|
|
16
|
+
import { useEffect, useRef, useState } from 'react';
|
|
17
|
+
import useMapType from "../hook/useMapType";
|
|
18
|
+
function useMarker(_ref) {
|
|
19
|
+
var map = _ref.map,
|
|
20
|
+
center = _ref.center,
|
|
21
|
+
createIcon = _ref.createIcon,
|
|
22
|
+
options = _ref.options;
|
|
23
|
+
var _useState = useState({
|
|
24
|
+
marker: null
|
|
25
|
+
}),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
state = _useState2[0],
|
|
28
|
+
setState = _useState2[1];
|
|
29
|
+
var inMap = useRef(false);
|
|
30
|
+
var type = useMapType();
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
if (!(center && center.length === 2) || !map) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (type.leaflet) {
|
|
36
|
+
var L = window.L;
|
|
37
|
+
var latlng = L.latLng(center);
|
|
38
|
+
if (inMap.current) {
|
|
39
|
+
state.marker.setLatLng(latlng);
|
|
40
|
+
} else {
|
|
41
|
+
var marker = L.marker(latlng, {
|
|
42
|
+
icon: createIcon(),
|
|
43
|
+
draggable: true,
|
|
44
|
+
zIndexOffset: 10
|
|
45
|
+
});
|
|
46
|
+
map.addLayer(marker);
|
|
47
|
+
setState({
|
|
48
|
+
marker: marker
|
|
49
|
+
});
|
|
50
|
+
inMap.current = true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (type.AMap) {
|
|
54
|
+
if (inMap.current) {
|
|
55
|
+
state.marker.setPosition(center);
|
|
56
|
+
} else {
|
|
57
|
+
var _marker = new AMap.Marker(_objectSpread({
|
|
58
|
+
position: center
|
|
59
|
+
}, options));
|
|
60
|
+
map.add(_marker);
|
|
61
|
+
setState({
|
|
62
|
+
marker: _marker
|
|
63
|
+
});
|
|
64
|
+
inMap.current = true;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68
|
+
}, [center, map, options]);
|
|
69
|
+
return state.marker;
|
|
70
|
+
}
|
|
71
|
+
export default useMarker;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Map from "../BasicMap";
|
|
3
|
+
function withMap(Component, className) {
|
|
4
|
+
return function withMapComponent(props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement(Map, {
|
|
6
|
+
className: className
|
|
7
|
+
}, /*#__PURE__*/React.createElement(Component, props));
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export default withMap;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RectType } from '../../interface';
|
|
3
|
+
interface IRectInfoProps {
|
|
4
|
+
item: RectType;
|
|
5
|
+
containerDom: HTMLDivElement;
|
|
6
|
+
}
|
|
7
|
+
declare function RectInfo({ item, containerDom }: IRectInfoProps): React.JSX.Element;
|
|
8
|
+
export default RectInfo;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
|
+
import IconFont from "../../../IconFont";
|
|
9
|
+
var RECT_INFO_WIDTH = 150;
|
|
10
|
+
var RECT_INFO_HEIGHT = 24;
|
|
11
|
+
var RECT_WINDOW_MARGIN = 6;
|
|
12
|
+
function RectInfo(_ref) {
|
|
13
|
+
var item = _ref.item,
|
|
14
|
+
containerDom = _ref.containerDom;
|
|
15
|
+
var position = useMemo(function () {
|
|
16
|
+
var _containerDom$getBoun = containerDom.getBoundingClientRect(),
|
|
17
|
+
width = _containerDom$getBoun.width,
|
|
18
|
+
height = _containerDom$getBoun.height;
|
|
19
|
+
var _rectInfoWidth$rectIn = {
|
|
20
|
+
rectInfoWidth: RECT_INFO_WIDTH,
|
|
21
|
+
rectInfoHeight: item.tags.length * RECT_INFO_HEIGHT + 6 + 30
|
|
22
|
+
},
|
|
23
|
+
rectInfoWidth = _rectInfoWidth$rectIn.rectInfoWidth,
|
|
24
|
+
rectInfoHeight = _rectInfoWidth$rectIn.rectInfoHeight;
|
|
25
|
+
var _item$rect = _slicedToArray(item.rect, 3),
|
|
26
|
+
rectLeft = _item$rect[0],
|
|
27
|
+
rectTop = _item$rect[1],
|
|
28
|
+
rectWidth = _item$rect[2];
|
|
29
|
+
var x, y;
|
|
30
|
+
if (rectWidth + rectLeft + rectInfoWidth < width) {
|
|
31
|
+
x = rectWidth + rectLeft + RECT_WINDOW_MARGIN;
|
|
32
|
+
} else {
|
|
33
|
+
x = rectLeft - RECT_WINDOW_MARGIN - rectInfoWidth;
|
|
34
|
+
}
|
|
35
|
+
if (rectTop + rectInfoHeight < height) {
|
|
36
|
+
y = rectTop;
|
|
37
|
+
y = y < 0 ? RECT_WINDOW_MARGIN : y;
|
|
38
|
+
} else {
|
|
39
|
+
y = height - rectInfoHeight;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
x: x,
|
|
43
|
+
y: y,
|
|
44
|
+
width: rectInfoWidth,
|
|
45
|
+
height: rectInfoHeight
|
|
46
|
+
};
|
|
47
|
+
}, [containerDom, item.rect, item.tags.length]);
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: "rect-info-list-wrapper",
|
|
50
|
+
style: {
|
|
51
|
+
left: position.x,
|
|
52
|
+
top: position.y,
|
|
53
|
+
width: position.width,
|
|
54
|
+
height: position.height
|
|
55
|
+
}
|
|
56
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: "data-type"
|
|
58
|
+
}, item.hasOwnProperty('lowQuality') && /*#__PURE__*/React.createElement("span", {
|
|
59
|
+
className: "data-tag low"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
61
|
+
type: 'lm-player_View_Cluster'
|
|
62
|
+
}), item.lowQuality ? '低质量' : '高质量'), item.hasOwnProperty('dupId') && item.dupId && /*#__PURE__*/React.createElement("span", {
|
|
63
|
+
className: "data-tag repeat"
|
|
64
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
65
|
+
type: 'lm-player_Photo_repeatingdata'
|
|
66
|
+
}), "\u91CD\u590D")), /*#__PURE__*/React.createElement("ul", {
|
|
67
|
+
className: "rect-info-list"
|
|
68
|
+
}, item.tags.map(function (v, index) {
|
|
69
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
70
|
+
className: "info-item",
|
|
71
|
+
key: index,
|
|
72
|
+
title: v.titleAttr
|
|
73
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
74
|
+
type: v.icon
|
|
75
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
76
|
+
className: "item-value"
|
|
77
|
+
}, v.label));
|
|
78
|
+
})));
|
|
79
|
+
}
|
|
80
|
+
export default RectInfo;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RectType } from '../../interface';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface IDefaultRectsProps {
|
|
5
|
+
rects: RectType[];
|
|
6
|
+
containerDom: HTMLDivElement;
|
|
7
|
+
onClickRect?: (item: RectType & {
|
|
8
|
+
base64: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
getRectImage: (rect: number[]) => string | null;
|
|
11
|
+
}
|
|
12
|
+
declare function DefaultRects({ rects, containerDom, onClickRect, getRectImage }: IDefaultRectsProps): React.JSX.Element;
|
|
13
|
+
export default DefaultRects;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import React, { useCallback, useMemo } from 'react';
|
|
8
|
+
import RectInfo from "./RectInfo";
|
|
9
|
+
import { computedZIndex } from "./utils";
|
|
10
|
+
import "./index.less";
|
|
11
|
+
function DefaultRects(_ref) {
|
|
12
|
+
var rects = _ref.rects,
|
|
13
|
+
containerDom = _ref.containerDom,
|
|
14
|
+
onClickRect = _ref.onClickRect,
|
|
15
|
+
getRectImage = _ref.getRectImage;
|
|
16
|
+
var renderRects = useMemo(function () {
|
|
17
|
+
return computedZIndex(rects);
|
|
18
|
+
}, [rects]);
|
|
19
|
+
var rectClick = useCallback(function (e, item) {
|
|
20
|
+
var _getRectImage;
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
onClickRect === null || onClickRect === void 0 || onClickRect(_objectSpread(_objectSpread({}, item), {}, {
|
|
23
|
+
base64: (_getRectImage = getRectImage(item.rect)) !== null && _getRectImage !== void 0 ? _getRectImage : ''
|
|
24
|
+
}));
|
|
25
|
+
}, [getRectImage, onClickRect]);
|
|
26
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderRects.map(function (v, k) {
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: "rect-item-wrapper rect-item-".concat(v.type, "-wrapper"),
|
|
29
|
+
key: k
|
|
30
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: 'rect-item',
|
|
32
|
+
onClick: function onClick(e) {
|
|
33
|
+
return rectClick(e, v);
|
|
34
|
+
},
|
|
35
|
+
style: {
|
|
36
|
+
left: v.rect[0],
|
|
37
|
+
top: v.rect[1],
|
|
38
|
+
width: v.rect[2],
|
|
39
|
+
height: v.rect[3],
|
|
40
|
+
zIndex: k
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: "border-top-decorator"
|
|
44
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: "border-bottom-decorator"
|
|
46
|
+
})), Array.isArray(v.tags) && v.tags.length > 0 && /*#__PURE__*/React.createElement(RectInfo, {
|
|
47
|
+
item: v,
|
|
48
|
+
containerDom: containerDom
|
|
49
|
+
}));
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
export default DefaultRects;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
.border-decorator-color-mixin(@color) {
|
|
2
|
+
.border-top-decorator {
|
|
3
|
+
&::before {
|
|
4
|
+
border-top-color: @color;
|
|
5
|
+
border-left-color: @color;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&::after {
|
|
9
|
+
border-top-color: @color;
|
|
10
|
+
border-right-color: @color;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.border-bottom-decorator {
|
|
15
|
+
&::before {
|
|
16
|
+
border-bottom-color: @color;
|
|
17
|
+
border-left-color: @color;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&::after {
|
|
21
|
+
border-bottom-color: @color;
|
|
22
|
+
border-right-color: @color;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.rect-item-style-mixin(@color, @lightColor, @shadowColor) {
|
|
28
|
+
.rect-item {
|
|
29
|
+
border-color: @lightColor;
|
|
30
|
+
.border-decorator-color-mixin(@color);
|
|
31
|
+
|
|
32
|
+
&:hover {
|
|
33
|
+
border-color: @color;
|
|
34
|
+
box-shadow: inset 0 0 24px 0 @shadowColor;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.rect-info-list-mixin(@color, @bgColor, @shadowColor) {
|
|
40
|
+
.rect-info-list-wrapper {
|
|
41
|
+
.data-type {
|
|
42
|
+
.data-tag {
|
|
43
|
+
background: @bgColor;
|
|
44
|
+
border: 1px solid @color;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// border-color: @color;
|
|
48
|
+
// .rect-card-corner {
|
|
49
|
+
// color: @color;
|
|
50
|
+
// }
|
|
51
|
+
// .rect-info-list {
|
|
52
|
+
// display: block;
|
|
53
|
+
// background: @bgColor;
|
|
54
|
+
// box-shadow: inset 0 0 8px 0 @shadowColor;
|
|
55
|
+
// }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.rect-item-face-wrapper {
|
|
60
|
+
.rect-item-style-mixin(#ff5f57, rgba(255, 95, 87, .6), rgba(255, 95, 87, .4));
|
|
61
|
+
.rect-info-list-mixin(#FF5F57, rgba(255,95,87,.6), rgba(179,49,43,.6));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.rect-item-body-wrapper {
|
|
65
|
+
.rect-item-style-mixin(#ffbb22, rgba(255, 187, 34, .6), rgba(255, 187, 34, .4));
|
|
66
|
+
.rect-info-list-mixin(#FFBB22, rgba(255,187,34,.6), rgba(176,94,0,.6));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.rect-item-vehicle-wrapper {
|
|
70
|
+
.rect-item-style-mixin(#44aaff, rgba(68, 170, 255, .6), rgba(68, 170, 255, .4));
|
|
71
|
+
.rect-info-list-mixin(#44aaff, rgba(68,170,255,.6), rgba(31,114,183,.6));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.rect-item-nonVehicle-wrapper {
|
|
75
|
+
.rect-item-style-mixin(#50e9b2, rgba(80, 233, 178, .6), rgba(80, 233, 178, .4));
|
|
76
|
+
.rect-info-list-mixin(#50e9b2, rgba(80,233,178,.6), rgba(15,196,132,.6));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.rect-item-thing-wrapper {
|
|
80
|
+
.rect-item-style-mixin(#b946d2, rgba(185, 70, 210, .6), rgba(185, 70, 210, .4));
|
|
81
|
+
.rect-info-list-mixin(#b946d2, rgba(185, 70, 210, .6), rgba(155, 58, 177, .4));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.rect-item {
|
|
85
|
+
position: absolute;
|
|
86
|
+
border-width: 1px;
|
|
87
|
+
border-style: solid;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
|
|
90
|
+
.border-top-decorator,
|
|
91
|
+
.border-bottom-decorator {
|
|
92
|
+
position: absolute;
|
|
93
|
+
width: 100%;
|
|
94
|
+
pointer-events: none;
|
|
95
|
+
|
|
96
|
+
&::before,
|
|
97
|
+
&::after {
|
|
98
|
+
display: block;
|
|
99
|
+
width: 8px;
|
|
100
|
+
height: 8px;
|
|
101
|
+
border: 2px solid transparent;
|
|
102
|
+
content: '';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&::before {
|
|
106
|
+
float: left;
|
|
107
|
+
margin-left: -1px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&::after {
|
|
111
|
+
float: right;
|
|
112
|
+
margin-right: -1px;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.border-top-decorator {
|
|
117
|
+
top: 0;
|
|
118
|
+
|
|
119
|
+
&::before,
|
|
120
|
+
&::after {
|
|
121
|
+
margin-top: -1px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.border-bottom-decorator {
|
|
126
|
+
bottom: 0;
|
|
127
|
+
|
|
128
|
+
&::before,
|
|
129
|
+
&::after {
|
|
130
|
+
margin-bottom: -1px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&:hover + .rect-info-list-wrapper {
|
|
135
|
+
display: block;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// 结构化窗体
|
|
140
|
+
.rect-info-list-wrapper {
|
|
141
|
+
position: absolute;
|
|
142
|
+
z-index: 11;
|
|
143
|
+
display: none;
|
|
144
|
+
padding-top: 5px;
|
|
145
|
+
background: rgb(16 21 36 / 80%);
|
|
146
|
+
border: 1px solid transparent;
|
|
147
|
+
|
|
148
|
+
/* 高低质量 */
|
|
149
|
+
.data-type {
|
|
150
|
+
padding: 0 5px;
|
|
151
|
+
color: #fff;
|
|
152
|
+
|
|
153
|
+
.data-tag {
|
|
154
|
+
padding: 4px;
|
|
155
|
+
margin-right: 4px;
|
|
156
|
+
font-size: 12px;
|
|
157
|
+
|
|
158
|
+
.anticon {
|
|
159
|
+
margin-right: 4px;
|
|
160
|
+
color: #fff;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.rect-card-corner {
|
|
166
|
+
position: absolute;
|
|
167
|
+
top: -9px;
|
|
168
|
+
left: -1px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.rect-info-arrow {
|
|
172
|
+
position: absolute;
|
|
173
|
+
top: 6px;
|
|
174
|
+
left: -4px;
|
|
175
|
+
display: block;
|
|
176
|
+
background: transparent;
|
|
177
|
+
transform: rotate(45deg);
|
|
178
|
+
border-style: solid;
|
|
179
|
+
border-width: 4px;
|
|
180
|
+
border-color: rgb(16 21 36 / 80%);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.rect-info-list {
|
|
184
|
+
height: 100%;
|
|
185
|
+
padding: 3px 10px;
|
|
186
|
+
border-radius: 2px;
|
|
187
|
+
|
|
188
|
+
.info-item {
|
|
189
|
+
padding: 3px 0;
|
|
190
|
+
overflow: hidden;
|
|
191
|
+
font-size: var(--fs-small);
|
|
192
|
+
line-height: 18px;
|
|
193
|
+
color: #fff;
|
|
194
|
+
text-overflow: ellipsis;
|
|
195
|
+
white-space: nowrap;
|
|
196
|
+
|
|
197
|
+
.anticon {
|
|
198
|
+
position: relative;
|
|
199
|
+
top: 1px;
|
|
200
|
+
padding-right: 4px;
|
|
201
|
+
font-size: 16px;
|
|
202
|
+
color: #fff;
|
|
203
|
+
cursor: default;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.item-label {
|
|
207
|
+
margin: 0 4px;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuRectType } from '../../interface';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface IDrawRectProps {
|
|
5
|
+
rect: number[];
|
|
6
|
+
canRenderMenu?: boolean;
|
|
7
|
+
containerDom: HTMLDivElement;
|
|
8
|
+
onMenuClick?: (options: MenuRectType) => void;
|
|
9
|
+
menus: MenuRectType[];
|
|
10
|
+
getRectImage: (rect: number[]) => string | null;
|
|
11
|
+
}
|
|
12
|
+
declare function DrawRect({ rect, canRenderMenu, containerDom, onMenuClick, menus, getRectImage }: IDrawRectProps): React.JSX.Element;
|
|
13
|
+
export default DrawRect;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import React, { useCallback, useMemo } from 'react';
|
|
8
|
+
import RectMenu from "../RectMenu";
|
|
9
|
+
import "./index.less";
|
|
10
|
+
function DrawRect(_ref) {
|
|
11
|
+
var _ref$rect = _ref.rect,
|
|
12
|
+
rect = _ref$rect === void 0 ? [] : _ref$rect,
|
|
13
|
+
canRenderMenu = _ref.canRenderMenu,
|
|
14
|
+
containerDom = _ref.containerDom,
|
|
15
|
+
onMenuClick = _ref.onMenuClick,
|
|
16
|
+
menus = _ref.menus,
|
|
17
|
+
getRectImage = _ref.getRectImage;
|
|
18
|
+
var x = useMemo(function () {
|
|
19
|
+
return rect[0] + rect[2];
|
|
20
|
+
}, [rect]);
|
|
21
|
+
var y = useMemo(function () {
|
|
22
|
+
return rect[1] + rect[3];
|
|
23
|
+
}, [rect]);
|
|
24
|
+
var onMenuClickAction = useCallback(function (item) {
|
|
25
|
+
var _getRectImage;
|
|
26
|
+
onMenuClick === null || onMenuClick === void 0 || onMenuClick(_objectSpread(_objectSpread({}, item), {}, {
|
|
27
|
+
base64: (_getRectImage = getRectImage(rect)) !== null && _getRectImage !== void 0 ? _getRectImage : ''
|
|
28
|
+
}));
|
|
29
|
+
}, [getRectImage, onMenuClick, rect]);
|
|
30
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: "select-rect-layout",
|
|
32
|
+
style: {
|
|
33
|
+
left: rect[0],
|
|
34
|
+
top: rect[1],
|
|
35
|
+
width: rect[2],
|
|
36
|
+
height: rect[3]
|
|
37
|
+
}
|
|
38
|
+
}), canRenderMenu && /*#__PURE__*/React.createElement(RectMenu, {
|
|
39
|
+
x: x,
|
|
40
|
+
y: y,
|
|
41
|
+
containerDom: containerDom,
|
|
42
|
+
onMenuClick: onMenuClickAction,
|
|
43
|
+
menus: menus
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
export default DrawRect;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
.select-rect-layout {
|
|
2
|
+
position: absolute;
|
|
3
|
+
border: 1px solid;
|
|
4
|
+
box-shadow: 0 0 0 9999em rgb(0 0 0 / 40%);
|
|
5
|
+
border-image-source: url('data:image/gif;base64,R0lGODlhCgAKAJECAAAAAP///////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEI5RDc5MTFDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEI5RDc5MTBDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEBQoAAgAsAAAAAAoACgAAAhWEERkn7W3ei7KlagMWF/dKgYeyGAUAIfkEBQoAAgAsAAAAAAoACgAAAg+UYwLJ7RnQm7QmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYgLJHdiinNSAVfOEKoUCACH5BAUKAAIALAAAAAAKAAoAAAIRVISAdusPo3RAzYtjaMIaUQAAIfkEBQoAAgAsAAAAAAoACgAAAg+MDiem7Q8bSLFaG5il6xQAIfkEBQoAAgAsAAAAAAoACgAAAg+UYRLJ7QnQm7SmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYBLJDdiinNSEVfOEKoECACH5BAUKAAIALAAAAAAKAAoAAAIRFISBdusPo3RBzYsjaMIaUQAAOw==');
|
|
6
|
+
border-image-repeat: repeat;
|
|
7
|
+
border-image-slice: 1;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuRectType } from '../../../Picture/interface';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface IRectMenuProps {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
menus: MenuRectType[];
|
|
8
|
+
containerDom: HTMLDivElement;
|
|
9
|
+
onMenuClick: (options: MenuRectType) => void;
|
|
10
|
+
}
|
|
11
|
+
declare function RectMenu({ x, y, menus, containerDom, onMenuClick }: IRectMenuProps): React.JSX.Element;
|
|
12
|
+
export default RectMenu;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useRef, useEffect } from 'react';
|
|
2
|
+
import IconFont from "../../../IconFont";
|
|
3
|
+
import { computedMenuPosition } from "./utils";
|
|
4
|
+
import "./index.less";
|
|
5
|
+
var MENU_WIDTH = 110;
|
|
6
|
+
var MENU_HEIGHT = 30;
|
|
7
|
+
function RectMenu(_ref) {
|
|
8
|
+
var x = _ref.x,
|
|
9
|
+
y = _ref.y,
|
|
10
|
+
menus = _ref.menus,
|
|
11
|
+
containerDom = _ref.containerDom,
|
|
12
|
+
onMenuClick = _ref.onMenuClick;
|
|
13
|
+
var _useMemo = useMemo(function () {
|
|
14
|
+
return containerDom.getBoundingClientRect();
|
|
15
|
+
}, [containerDom]),
|
|
16
|
+
width = _useMemo.width,
|
|
17
|
+
height = _useMemo.height;
|
|
18
|
+
var size = useMemo(function () {
|
|
19
|
+
return {
|
|
20
|
+
w: MENU_WIDTH,
|
|
21
|
+
h: MENU_HEIGHT * menus.length
|
|
22
|
+
};
|
|
23
|
+
}, [menus.length]);
|
|
24
|
+
var position = useMemo(function () {
|
|
25
|
+
return computedMenuPosition({
|
|
26
|
+
width: width,
|
|
27
|
+
height: height,
|
|
28
|
+
size: size,
|
|
29
|
+
position: [x, y]
|
|
30
|
+
});
|
|
31
|
+
}, [height, size, width, x, y]);
|
|
32
|
+
var domRef = useRef(null);
|
|
33
|
+
var handleCancelB = useCallback(function (e) {
|
|
34
|
+
return e.stopPropagation();
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
//防止click事件冒泡到查看器
|
|
38
|
+
useEffect(function () {
|
|
39
|
+
var dom = domRef.current;
|
|
40
|
+
if (dom) {
|
|
41
|
+
dom.addEventListener('mousedown', handleCancelB, false);
|
|
42
|
+
dom.addEventListener('mousemove', handleCancelB, false);
|
|
43
|
+
dom.addEventListener('mouseup', handleCancelB, false);
|
|
44
|
+
}
|
|
45
|
+
return function () {
|
|
46
|
+
if (dom) {
|
|
47
|
+
dom.removeEventListener('mousedown', handleCancelB, false);
|
|
48
|
+
dom.removeEventListener('mousemove', handleCancelB, false);
|
|
49
|
+
dom.removeEventListener('mouseup', handleCancelB, false);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}, [handleCancelB]);
|
|
53
|
+
var onClickMenu = useCallback(function (e, item) {
|
|
54
|
+
e.stopPropagation();
|
|
55
|
+
onMenuClick === null || onMenuClick === void 0 || onMenuClick(item);
|
|
56
|
+
}, [onMenuClick]);
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: "select-rect-menu-layout",
|
|
59
|
+
style: {
|
|
60
|
+
left: position.x,
|
|
61
|
+
top: position.y
|
|
62
|
+
},
|
|
63
|
+
ref: domRef
|
|
64
|
+
}, menus.map(function (v) {
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: "menu-action-item",
|
|
67
|
+
key: v.pathname,
|
|
68
|
+
onClick: function onClick(e) {
|
|
69
|
+
return onClickMenu(e, v);
|
|
70
|
+
}
|
|
71
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
72
|
+
type: v.icon
|
|
73
|
+
}), v.title);
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
export default RectMenu;
|