@cloud-app-dev/vidc 4.0.15 → 4.0.17
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/.dumirc.ts +2 -18
- package/.fatherrc.ts +0 -1
- package/package.json +35 -31
- package/release-build.sh +1 -2
- package/es/AppContext/Sync.d.ts +0 -8
- package/es/AppContext/Sync.js +0 -44
- package/es/AppContext/index.d.ts +0 -10
- package/es/AppContext/index.js +0 -144
- package/es/AppContext/interface.d.ts +0 -41
- package/es/AppContext/static.d.ts +0 -8
- package/es/AppContext/static.js +0 -9
- package/es/Auth/index.d.ts +0 -8
- package/es/Auth/index.js +0 -18
- package/es/AutoExit/index.d.ts +0 -6
- package/es/AutoExit/index.js +0 -23
- package/es/CheckGroupFixed/demo.d.ts +0 -3
- package/es/CheckGroupFixed/demo.js +0 -25
- package/es/CheckGroupFixed/index.d.ts +0 -18
- package/es/CheckGroupFixed/index.js +0 -150
- package/es/CheckGroupFixed/index.less +0 -53
- package/es/Config/index.d.ts +0 -4
- package/es/Config/index.js +0 -77
- package/es/Config/interface.d.ts +0 -65
- package/es/Config/utils.d.ts +0 -4
- package/es/Config/utils.js +0 -33
- package/es/ConfigContext/index.d.ts +0 -22
- package/es/ConfigContext/index.js +0 -25
- package/es/CustomRenderSelect/index.d.ts +0 -12
- package/es/CustomRenderSelect/index.js +0 -83
- package/es/CustomRenderSelect/index.less +0 -25
- package/es/DBTools/index.d.ts +0 -25
- package/es/DBTools/index.js +0 -337
- package/es/DisableMark/index.d.ts +0 -9
- package/es/DisableMark/index.js +0 -22
- package/es/DisableMark/index.less +0 -9
- package/es/DomMove/demo.d.ts +0 -2
- package/es/DomMove/demo.js +0 -20
- package/es/DomMove/index.d.ts +0 -16
- package/es/DomMove/index.js +0 -149
- package/es/DomMove/utils.d.ts +0 -8
- package/es/DomMove/utils.js +0 -33
- package/es/Drag/DragAndDropItem.d.ts +0 -4
- package/es/Drag/DragAndDropItem.js +0 -133
- package/es/Drag/DropItem.d.ts +0 -4
- package/es/Drag/DropItem.js +0 -50
- package/es/Drag/index.d.ts +0 -7
- package/es/Drag/index.js +0 -7
- package/es/Drag/interface.d.ts +0 -16
- package/es/DynamicGridList/Demo.d.ts +0 -3
- package/es/DynamicGridList/Demo.js +0 -86
- package/es/DynamicGridList/index.d.ts +0 -27
- package/es/DynamicGridList/index.js +0 -71
- package/es/DynamicList/demo.d.ts +0 -2
- package/es/DynamicList/demo.js +0 -50
- package/es/DynamicList/index.d.ts +0 -31
- package/es/DynamicList/index.js +0 -96
- package/es/DynamicList/index.less +0 -17
- package/es/DynamicList/interface.d.ts +0 -19
- package/es/DynamicList/utils.d.ts +0 -4
- package/es/DynamicList/utils.js +0 -6
- package/es/ErrorFallback/index.d.ts +0 -9
- package/es/ErrorFallback/index.js +0 -38
- package/es/ErrorFallback/inerface.d.ts +0 -48
- package/es/EventTools/index.d.ts +0 -3
- package/es/EventTools/index.js +0 -12
- package/es/FrontendPlayer/index.d.ts +0 -4
- package/es/FrontendPlayer/index.js +0 -2
- package/es/FullScreen/index.d.ts +0 -22
- package/es/FullScreen/index.js +0 -36
- package/es/FullScreen/index.less +0 -18
- package/es/GridList/Demo.d.ts +0 -3
- package/es/GridList/Demo.js +0 -89
- package/es/GridList/data.d.ts +0 -16
- package/es/GridList/data.js +0 -609
- package/es/GridList/hook.d.ts +0 -13
- package/es/GridList/hook.js +0 -270
- package/es/GridList/index.d.ts +0 -15
- package/es/GridList/index.js +0 -48
- package/es/GridList/index.less +0 -8
- package/es/GridList/interface.d.ts +0 -59
- package/es/GridList/utils.d.ts +0 -9
- package/es/GridList/utils.js +0 -42
- package/es/HightLevel/index.d.ts +0 -9
- package/es/HightLevel/index.js +0 -21
- package/es/HightLevel/index.less +0 -3
- package/es/IconFont/index.d.ts +0 -12
- package/es/IconFont/index.js +0 -63
- package/es/ImageView/index.d.ts +0 -17
- package/es/ImageView/index.js +0 -58
- package/es/ImageView/index.less +0 -11
- package/es/InstanceHistory/index.d.ts +0 -3
- package/es/InstanceHistory/index.js +0 -7
- package/es/LabelPlayer/111.png +0 -0
- package/es/LabelPlayer/demo.d.ts +0 -2
- package/es/LabelPlayer/demo.js +0 -123
- package/es/LabelPlayer/index.d.ts +0 -21
- package/es/LabelPlayer/index.js +0 -169
- package/es/LabelPlayer/index.less +0 -24
- package/es/LabelValue/index.d.ts +0 -15
- package/es/LabelValue/index.js +0 -32
- package/es/LabelValue/index.less +0 -23
- package/es/List/demo.d.ts +0 -3
- package/es/List/demo.js +0 -26
- package/es/List/index.d.ts +0 -28
- package/es/List/index.js +0 -30
- package/es/List/index.less +0 -13
- package/es/ListWithSizeAnimate/demo.d.ts +0 -2
- package/es/ListWithSizeAnimate/demo.js +0 -128
- package/es/ListWithSizeAnimate/index.d.ts +0 -14
- package/es/ListWithSizeAnimate/index.js +0 -97
- package/es/ListWithSizeAnimate/index.less +0 -23
- package/es/LoaderScript/index.d.ts +0 -47
- package/es/LoaderScript/index.js +0 -38
- package/es/LoaderScript/utils.d.ts +0 -13
- package/es/LoaderScript/utils.js +0 -179
- package/es/Map/AMap.d.ts +0 -7109
- package/es/Map/BasicMap/AMapInstance.d.ts +0 -19
- package/es/Map/BasicMap/AMapInstance.js +0 -98
- package/es/Map/BasicMap/LeafletInstance.d.ts +0 -18
- package/es/Map/BasicMap/LeafletInstance.js +0 -111
- package/es/Map/BasicMap/index.d.ts +0 -9
- package/es/Map/BasicMap/index.js +0 -98
- package/es/Map/BasicMap/index.less +0 -29
- package/es/Map/ClusterLayer/demo.d.ts +0 -3
- package/es/Map/ClusterLayer/demo.js +0 -22
- package/es/Map/ClusterLayer/hook.d.ts +0 -5
- package/es/Map/ClusterLayer/hook.js +0 -124
- package/es/Map/ClusterLayer/index.d.ts +0 -6
- package/es/Map/ClusterLayer/index.js +0 -32
- package/es/Map/ClusterLayer/index.less +0 -29
- package/es/Map/ClusterLayer/props.d.ts +0 -8
- package/es/Map/Config/index.d.ts +0 -9
- package/es/Map/Config/index.js +0 -52
- package/es/Map/Config/utils.d.ts +0 -2
- package/es/Map/Config/utils.js +0 -65
- package/es/Map/Context/index.d.ts +0 -11
- package/es/Map/Context/index.js +0 -56
- package/es/Map/FindPio/index.d.ts +0 -4
- package/es/Map/FindPio/index.js +0 -14
- package/es/Map/FindPio/index.less +0 -7
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +0 -4
- package/es/Map/InfoWindow/MakerLikeWindow.js +0 -113
- package/es/Map/InfoWindow/demo.d.ts +0 -3
- package/es/Map/InfoWindow/demo.js +0 -76
- package/es/Map/InfoWindow/index.d.ts +0 -11
- package/es/Map/InfoWindow/index.js +0 -67
- package/es/Map/LevelCenter/DragMarker/index.d.ts +0 -10
- package/es/Map/LevelCenter/DragMarker/index.js +0 -44
- package/es/Map/LevelCenter/demo.d.ts +0 -3
- package/es/Map/LevelCenter/demo.js +0 -46
- package/es/Map/LevelCenter/index.d.ts +0 -15
- package/es/Map/LevelCenter/index.js +0 -71
- package/es/Map/LoaderMap/index.d.ts +0 -12
- package/es/Map/LoaderMap/index.js +0 -71
- package/es/Map/MapDrawSelect/demo.d.ts +0 -3
- package/es/Map/MapDrawSelect/demo.js +0 -79
- package/es/Map/MapDrawSelect/index.d.ts +0 -15
- package/es/Map/MapDrawSelect/index.js +0 -62
- package/es/Map/MouseTool/index.d.ts +0 -10
- package/es/Map/MouseTool/index.js +0 -44
- package/es/Map/MouseTool/useMouseTools.d.ts +0 -7
- package/es/Map/MouseTool/useMouseTools.js +0 -83
- package/es/Map/ResetTools/index.d.ts +0 -10
- package/es/Map/ResetTools/index.js +0 -67
- package/es/Map/ResetTools/index.less +0 -39
- package/es/Map/SinglePoint/demo.d.ts +0 -3
- package/es/Map/SinglePoint/demo.js +0 -16
- package/es/Map/SinglePoint/index.d.ts +0 -27
- package/es/Map/SinglePoint/index.js +0 -57
- package/es/Map/SinglePoint/index.less +0 -41
- package/es/Map/hook/useMapEvent.d.ts +0 -2
- package/es/Map/hook/useMapEvent.js +0 -19
- package/es/Map/hook/useMapType.d.ts +0 -4
- package/es/Map/hook/useMapType.js +0 -12
- package/es/Map/icon.d.ts +0 -2
- package/es/Map/icon.js +0 -10
- package/es/Map/index.d.ts +0 -24
- package/es/Map/index.js +0 -25
- package/es/Map/interface.d.ts +0 -74
- package/es/Map/points.d.ts +0 -74
- package/es/Map/points.js +0 -1
- package/es/Map/useMarker/index.d.ts +0 -10
- package/es/Map/useMarker/index.js +0 -71
- package/es/Map/withMap/index.d.ts +0 -3
- package/es/Map/withMap/index.js +0 -18
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +0 -8
- package/es/Picture/component/DefaultRects/RectInfo.js +0 -88
- package/es/Picture/component/DefaultRects/index.d.ts +0 -13
- package/es/Picture/component/DefaultRects/index.js +0 -58
- package/es/Picture/component/DefaultRects/index.less +0 -211
- package/es/Picture/component/DefaultRects/utils.d.ts +0 -2
- package/es/Picture/component/DefaultRects/utils.js +0 -11
- package/es/Picture/component/DrawRect/index.d.ts +0 -13
- package/es/Picture/component/DrawRect/index.js +0 -51
- package/es/Picture/component/DrawRect/index.less +0 -8
- package/es/Picture/component/RectMenu/index.d.ts +0 -12
- package/es/Picture/component/RectMenu/index.js +0 -79
- package/es/Picture/component/RectMenu/index.less +0 -36
- package/es/Picture/component/RectMenu/utils.d.ts +0 -12
- package/es/Picture/component/RectMenu/utils.js +0 -19
- package/es/Picture/component/Tools/index.d.ts +0 -12
- package/es/Picture/component/Tools/index.js +0 -93
- package/es/Picture/component/Tools/index.less +0 -49
- package/es/Picture/component/WheelScale/index.d.ts +0 -7
- package/es/Picture/component/WheelScale/index.js +0 -29
- package/es/Picture/demo.d.ts +0 -2
- package/es/Picture/demo.js +0 -114
- package/es/Picture/index.d.ts +0 -19
- package/es/Picture/index.js +0 -354
- package/es/Picture/index.less +0 -20
- package/es/Picture/interface.d.ts +0 -196
- package/es/Picture/loadCaptureRectImage.d.ts +0 -3
- package/es/Picture/loadCaptureRectImage.js +0 -99
- package/es/Picture/useDraw.d.ts +0 -1
- package/es/Picture/useDraw.js +0 -103
- package/es/Picture/utils.d.ts +0 -26
- package/es/Picture/utils.js +0 -143
- package/es/Player/api/index.d.ts +0 -68
- package/es/Player/api/index.js +0 -283
- package/es/Player/context.d.ts +0 -21
- package/es/Player/context.js +0 -25
- package/es/Player/contraller_bar/bar.d.ts +0 -8
- package/es/Player/contraller_bar/bar.js +0 -28
- package/es/Player/contraller_bar/contraller_event.d.ts +0 -6
- package/es/Player/contraller_bar/contraller_event.js +0 -53
- package/es/Player/contraller_bar/index.d.ts +0 -14
- package/es/Player/contraller_bar/index.js +0 -33
- package/es/Player/contraller_bar/left_bar.d.ts +0 -10
- package/es/Player/contraller_bar/left_bar.js +0 -88
- package/es/Player/contraller_bar/right_bar.d.ts +0 -8
- package/es/Player/contraller_bar/right_bar.js +0 -37
- package/es/Player/contraller_bar/time.d.ts +0 -3
- package/es/Player/contraller_bar/time.js +0 -21
- package/es/Player/contraller_bar/useBarStatus.d.ts +0 -2
- package/es/Player/contraller_bar/useBarStatus.js +0 -43
- package/es/Player/contraller_bar/volume.d.ts +0 -9
- package/es/Player/contraller_bar/volume.js +0 -65
- package/es/Player/demo.d.ts +0 -3
- package/es/Player/demo.js +0 -277
- package/es/Player/empty.d.ts +0 -2
- package/es/Player/empty.js +0 -6
- package/es/Player/event/errorEvent.d.ts +0 -14
- package/es/Player/event/errorEvent.js +0 -88
- package/es/Player/event/eventName.d.ts +0 -18
- package/es/Player/event/eventName.js +0 -30
- package/es/Player/event/index.d.ts +0 -24
- package/es/Player/event/index.js +0 -204
- package/es/Player/fps_play.d.ts +0 -11
- package/es/Player/fps_play.js +0 -84
- package/es/Player/frontend_player.d.ts +0 -8
- package/es/Player/frontend_player.js +0 -72
- package/es/Player/frontend_timeline.d.ts +0 -10
- package/es/Player/frontend_timeline.js +0 -145
- package/es/Player/iconfont.d.ts +0 -5
- package/es/Player/iconfont.js +0 -22
- package/es/Player/index.d.ts +0 -2
- package/es/Player/index.js +0 -2
- package/es/Player/live_heart.d.ts +0 -8
- package/es/Player/live_heart.js +0 -46
- package/es/Player/message.d.ts +0 -5
- package/es/Player/message.js +0 -138
- package/es/Player/player.d.ts +0 -231
- package/es/Player/segment_player.d.ts +0 -9
- package/es/Player/segment_player.js +0 -230
- package/es/Player/segment_timeline.d.ts +0 -12
- package/es/Player/segment_timeline.js +0 -190
- package/es/Player/single_player.d.ts +0 -5
- package/es/Player/single_player.js +0 -275
- package/es/Player/style/bar.less +0 -43
- package/es/Player/style/iconfont.js +0 -43
- package/es/Player/style/index.less +0 -34
- package/es/Player/style/message.less +0 -56
- package/es/Player/style/slider.less +0 -106
- package/es/Player/style/timeline.less +0 -116
- package/es/Player/style/volume.less +0 -24
- package/es/Player/timeline.d.ts +0 -5
- package/es/Player/timeline.js +0 -98
- package/es/Player/util.d.ts +0 -43
- package/es/Player/util.js +0 -189
- package/es/PlayerExt/demo.d.ts +0 -3
- package/es/PlayerExt/demo.js +0 -170
- package/es/PlayerExt/index.d.ts +0 -48
- package/es/PlayerExt/index.js +0 -207
- package/es/PlayerExt/index.less +0 -10
- package/es/Progress/index.d.ts +0 -12
- package/es/Progress/index.js +0 -56
- package/es/Progress/index.less +0 -21
- package/es/ROI/demo.d.ts +0 -3
- package/es/ROI/demo.js +0 -18
- package/es/ROI/index.d.ts +0 -33
- package/es/ROI/index.js +0 -57
- package/es/ROI/index.less +0 -33
- package/es/RefDrawer/Footer.d.ts +0 -9
- package/es/RefDrawer/Footer.js +0 -27
- package/es/RefDrawer/demo.d.ts +0 -3
- package/es/RefDrawer/demo.js +0 -32
- package/es/RefDrawer/index.d.ts +0 -26
- package/es/RefDrawer/index.js +0 -73
- package/es/RefModal/demo.d.ts +0 -3
- package/es/RefModal/demo.js +0 -32
- package/es/RefModal/index.d.ts +0 -17
- package/es/RefModal/index.js +0 -71
- package/es/ScreenPlayer/Live.d.ts +0 -10
- package/es/ScreenPlayer/Live.js +0 -220
- package/es/ScreenPlayer/LiveTools.d.ts +0 -29
- package/es/ScreenPlayer/LiveTools.js +0 -167
- package/es/ScreenPlayer/PlayerWithExt.d.ts +0 -34
- package/es/ScreenPlayer/PlayerWithExt.js +0 -240
- package/es/ScreenPlayer/RatePick.d.ts +0 -8
- package/es/ScreenPlayer/RatePick.js +0 -30
- package/es/ScreenPlayer/Record.d.ts +0 -10
- package/es/ScreenPlayer/Record.js +0 -447
- package/es/ScreenPlayer/RecordTools.d.ts +0 -38
- package/es/ScreenPlayer/RecordTools.js +0 -216
- package/es/ScreenPlayer/ScreenSelect.d.ts +0 -7
- package/es/ScreenPlayer/ScreenSelect.js +0 -51
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +0 -17
- package/es/ScreenPlayer/SegmentTimeLine.js +0 -38
- package/es/ScreenPlayer/TimeMode.d.ts +0 -7
- package/es/ScreenPlayer/TimeMode.js +0 -30
- package/es/ScreenPlayer/TimeSelect.d.ts +0 -7
- package/es/ScreenPlayer/TimeSelect.js +0 -94
- package/es/ScreenPlayer/demo.d.ts +0 -2
- package/es/ScreenPlayer/demo.js +0 -24
- package/es/ScreenPlayer/demo2.d.ts +0 -2
- package/es/ScreenPlayer/demo2.js +0 -200
- package/es/ScreenPlayer/index.d.ts +0 -6
- package/es/ScreenPlayer/index.js +0 -9
- package/es/ScreenPlayer/index.less +0 -335
- package/es/ScreenPlayer/interface.d.ts +0 -216
- package/es/ScreenPlayer/useTimeSlider.d.ts +0 -25
- package/es/ScreenPlayer/useTimeSlider.js +0 -450
- package/es/ScreenPlayer/useVideoFit.d.ts +0 -5
- package/es/ScreenPlayer/useVideoFit.js +0 -35
- package/es/ScreenPlayer/utils.d.ts +0 -17
- package/es/ScreenPlayer/utils.js +0 -85
- package/es/SegmentPlayer/index.d.ts +0 -2
- package/es/SegmentPlayer/index.js +0 -2
- package/es/Service/http.d.ts +0 -6
- package/es/Service/http.js +0 -125
- package/es/Service/index.d.ts +0 -3
- package/es/Service/index.js +0 -10
- package/es/Service/interface.d.ts +0 -22
- package/es/Service/middleware.d.ts +0 -5
- package/es/Service/middleware.js +0 -15
- package/es/SocketEmitter/eventEmitter.d.ts +0 -27
- package/es/SocketEmitter/eventEmitter.js +0 -88
- package/es/SocketEmitter/index.d.ts +0 -24
- package/es/SocketEmitter/index.js +0 -125
- package/es/SocketEmitter/interface.d.ts +0 -4
- package/es/TableLayout/index.d.ts +0 -10
- package/es/TableLayout/index.js +0 -29
- package/es/TableLayout/index.less +0 -4
- package/es/ThemeAntd/demo.d.ts +0 -4
- package/es/ThemeAntd/demo.js +0 -129
- package/es/ThemeAntd/demo.less +0 -20
- package/es/ThemeAntd/index.d.ts +0 -7
- package/es/ThemeAntd/index.js +0 -23
- package/es/ThemeAntd/index.less +0 -4
- package/es/Timeout/index.d.ts +0 -32
- package/es/Timeout/index.js +0 -70
- package/es/VList/index.d.ts +0 -11
- package/es/VList/index.js +0 -42
- package/es/VList/index.less +0 -6
- package/es/VList/utils.d.ts +0 -14
- package/es/VList/utils.js +0 -17
- package/es/bigNumberTransformCN/index.d.ts +0 -5
- package/es/bigNumberTransformCN/index.js +0 -60
- package/es/cache/index.d.ts +0 -34
- package/es/cache/index.js +0 -94
- package/es/copy/index.d.ts +0 -1
- package/es/copy/index.js +0 -9
- package/es/core.d.ts +0 -0
- package/es/getThemeStyle/index.d.ts +0 -2
- package/es/getThemeStyle/index.js +0 -5
- package/es/index.d.ts +0 -60
- package/es/index.js +0 -60
- package/es/logger/index.d.ts +0 -7
- package/es/logger/index.js +0 -30
- package/es/nextTick/index.d.ts +0 -1
- package/es/nextTick/index.js +0 -7
- package/es/submidstr/index.d.ts +0 -5
- package/es/submidstr/index.js +0 -14
- package/es/treeHelper/index.d.ts +0 -11
- package/es/treeHelper/index.js +0 -189
- package/es/typings.d.ts +0 -2
- package/es/useDrawROI/index.d.ts +0 -16
- package/es/useDrawROI/index.js +0 -322
- package/es/useEventEmitterHandle/index.d.ts +0 -2
- package/es/useEventEmitterHandle/index.js +0 -17
- package/es/useFullscreen/demo.d.ts +0 -2
- package/es/useFullscreen/demo.js +0 -48
- package/es/useFullscreen/index.d.ts +0 -12
- package/es/useFullscreen/index.js +0 -76
- package/es/useHistory/index.d.ts +0 -3
- package/es/useHistory/index.js +0 -9
- package/es/useHistory/interface.d.ts +0 -3
- package/es/useInfiniteScroll/index.d.ts +0 -16
- package/es/useInfiniteScroll/index.js +0 -101
- package/es/useRafInterval/index.d.ts +0 -5
- package/es/useRafInterval/index.js +0 -70
- package/es/useSimpleState/index.d.ts +0 -3
- package/es/useSimpleState/index.js +0 -36
- package/es/useVirtualList/index.d.ts +0 -13
- package/es/useVirtualList/index.js +0 -139
- package/es/utils.d.ts +0 -14
- package/es/utils.js +0 -75
- package/es/uuid/index.d.ts +0 -4
- package/es/uuid/index.js +0 -15
package/es/DBTools/index.js
DELETED
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
var _excluded = ["expireTime"];
|
|
2
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
8
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
-
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; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
-
import db from 'db.js';
|
|
17
|
-
import cache from "../cache";
|
|
18
|
-
import logger from "../logger";
|
|
19
|
-
var schema = {
|
|
20
|
-
key: {
|
|
21
|
-
keyPath: 'id',
|
|
22
|
-
autoIncrement: true
|
|
23
|
-
},
|
|
24
|
-
indexes: {
|
|
25
|
-
id: {
|
|
26
|
-
unique: true
|
|
27
|
-
},
|
|
28
|
-
time: {
|
|
29
|
-
unique: false
|
|
30
|
-
},
|
|
31
|
-
expireTime: {
|
|
32
|
-
unique: false
|
|
33
|
-
},
|
|
34
|
-
userId: {
|
|
35
|
-
unique: false
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
var DBInstance = /*#__PURE__*/function () {
|
|
40
|
-
function DBInstance(schemaName) {
|
|
41
|
-
_classCallCheck(this, DBInstance);
|
|
42
|
-
_defineProperty(this, "LM_DB_SERVER", void 0);
|
|
43
|
-
_defineProperty(this, "schemaName", void 0);
|
|
44
|
-
_defineProperty(this, "version", void 0);
|
|
45
|
-
this.LM_DB_SERVER = null;
|
|
46
|
-
this.schemaName = schemaName;
|
|
47
|
-
this.version = 1;
|
|
48
|
-
this._init();
|
|
49
|
-
}
|
|
50
|
-
_createClass(DBInstance, [{
|
|
51
|
-
key: "_init",
|
|
52
|
-
value: function () {
|
|
53
|
-
var _init2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
54
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
55
|
-
while (1) switch (_context.prev = _context.next) {
|
|
56
|
-
case 0:
|
|
57
|
-
_context.next = 2;
|
|
58
|
-
return db.open({
|
|
59
|
-
server: this.schemaName,
|
|
60
|
-
version: this.version,
|
|
61
|
-
schema: _defineProperty({}, this.schemaName, schema)
|
|
62
|
-
});
|
|
63
|
-
case 2:
|
|
64
|
-
this.LM_DB_SERVER = _context.sent;
|
|
65
|
-
console.log(this.LM_DB_SERVER);
|
|
66
|
-
logger.debug('IndexDB open success!', "serverName:".concat(this.schemaName, ", version:").concat(this.version, ", schema:").concat(JSON.stringify(schema)));
|
|
67
|
-
case 5:
|
|
68
|
-
case "end":
|
|
69
|
-
return _context.stop();
|
|
70
|
-
}
|
|
71
|
-
}, _callee, this);
|
|
72
|
-
}));
|
|
73
|
-
function _init() {
|
|
74
|
-
return _init2.apply(this, arguments);
|
|
75
|
-
}
|
|
76
|
-
return _init;
|
|
77
|
-
}()
|
|
78
|
-
}, {
|
|
79
|
-
key: "isClosed",
|
|
80
|
-
get: function get() {
|
|
81
|
-
return this.LM_DB_SERVER ? this.LM_DB_SERVER.isClosed() : true;
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
key: "get",
|
|
85
|
-
value: function () {
|
|
86
|
-
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
|
87
|
-
var id;
|
|
88
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
89
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
90
|
-
case 0:
|
|
91
|
-
id = _ref.id;
|
|
92
|
-
if (id) {
|
|
93
|
-
_context2.next = 3;
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
return _context2.abrupt("return", Promise.reject({
|
|
97
|
-
message: 'IndexDB主键id不存在'
|
|
98
|
-
}));
|
|
99
|
-
case 3:
|
|
100
|
-
if (!this.isClosed) {
|
|
101
|
-
_context2.next = 6;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
_context2.next = 6;
|
|
105
|
-
return this._init();
|
|
106
|
-
case 6:
|
|
107
|
-
this.removeExpireData();
|
|
108
|
-
return _context2.abrupt("return", this.LM_DB_SERVER[this.schemaName].get(id));
|
|
109
|
-
case 8:
|
|
110
|
-
case "end":
|
|
111
|
-
return _context2.stop();
|
|
112
|
-
}
|
|
113
|
-
}, _callee2, this);
|
|
114
|
-
}));
|
|
115
|
-
function get(_x) {
|
|
116
|
-
return _get.apply(this, arguments);
|
|
117
|
-
}
|
|
118
|
-
return get;
|
|
119
|
-
}()
|
|
120
|
-
}, {
|
|
121
|
-
key: "put",
|
|
122
|
-
value: function () {
|
|
123
|
-
var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
|
|
124
|
-
var _data$expireTime, expireTime, params;
|
|
125
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
126
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
127
|
-
case 0:
|
|
128
|
-
if (data.id) {
|
|
129
|
-
_context3.next = 2;
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
return _context3.abrupt("return", Promise.reject({
|
|
133
|
-
message: '主键id不存在'
|
|
134
|
-
}));
|
|
135
|
-
case 2:
|
|
136
|
-
_data$expireTime = data.expireTime, expireTime = _data$expireTime === void 0 ? Date.now() + 7 * 24 * 60 * 60 * 1000 : _data$expireTime, params = _objectWithoutProperties(data, _excluded);
|
|
137
|
-
params.userId = cache.getCache('userId', 'session');
|
|
138
|
-
params.updateTime = Date.now();
|
|
139
|
-
if (!this.isClosed) {
|
|
140
|
-
_context3.next = 8;
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
_context3.next = 8;
|
|
144
|
-
return this._init();
|
|
145
|
-
case 8:
|
|
146
|
-
this.removeExpireData();
|
|
147
|
-
return _context3.abrupt("return", this.LM_DB_SERVER[this.schemaName].put(_objectSpread({
|
|
148
|
-
expireTime: expireTime
|
|
149
|
-
}, params)));
|
|
150
|
-
case 10:
|
|
151
|
-
case "end":
|
|
152
|
-
return _context3.stop();
|
|
153
|
-
}
|
|
154
|
-
}, _callee3, this);
|
|
155
|
-
}));
|
|
156
|
-
function put(_x2) {
|
|
157
|
-
return _put.apply(this, arguments);
|
|
158
|
-
}
|
|
159
|
-
return put;
|
|
160
|
-
}()
|
|
161
|
-
}, {
|
|
162
|
-
key: "remove",
|
|
163
|
-
value: function () {
|
|
164
|
-
var _remove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(ids) {
|
|
165
|
-
var _this = this;
|
|
166
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
167
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
168
|
-
case 0:
|
|
169
|
-
if (!this.isClosed) {
|
|
170
|
-
_context4.next = 3;
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
_context4.next = 3;
|
|
174
|
-
return this._init();
|
|
175
|
-
case 3:
|
|
176
|
-
return _context4.abrupt("return", Promise.all(ids.map(function (id) {
|
|
177
|
-
return _this.LM_DB_SERVER[_this.schemaName].remove(id);
|
|
178
|
-
})));
|
|
179
|
-
case 4:
|
|
180
|
-
case "end":
|
|
181
|
-
return _context4.stop();
|
|
182
|
-
}
|
|
183
|
-
}, _callee4, this);
|
|
184
|
-
}));
|
|
185
|
-
function remove(_x3) {
|
|
186
|
-
return _remove.apply(this, arguments);
|
|
187
|
-
}
|
|
188
|
-
return remove;
|
|
189
|
-
}()
|
|
190
|
-
}, {
|
|
191
|
-
key: "removeExpireData",
|
|
192
|
-
value: function () {
|
|
193
|
-
var _removeExpireData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
194
|
-
var result;
|
|
195
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
196
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
197
|
-
case 0:
|
|
198
|
-
if (!this.isClosed) {
|
|
199
|
-
_context5.next = 3;
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
_context5.next = 3;
|
|
203
|
-
return this._init();
|
|
204
|
-
case 3:
|
|
205
|
-
_context5.next = 5;
|
|
206
|
-
return this.LM_DB_SERVER[this.schemaName].query().filter(function (item) {
|
|
207
|
-
return item.expireTime < Date.now();
|
|
208
|
-
}).execute();
|
|
209
|
-
case 5:
|
|
210
|
-
result = _context5.sent;
|
|
211
|
-
return _context5.abrupt("return", this.remove(result.map(function (v) {
|
|
212
|
-
return v.id;
|
|
213
|
-
})));
|
|
214
|
-
case 7:
|
|
215
|
-
case "end":
|
|
216
|
-
return _context5.stop();
|
|
217
|
-
}
|
|
218
|
-
}, _callee5, this);
|
|
219
|
-
}));
|
|
220
|
-
function removeExpireData() {
|
|
221
|
-
return _removeExpireData.apply(this, arguments);
|
|
222
|
-
}
|
|
223
|
-
return removeExpireData;
|
|
224
|
-
}()
|
|
225
|
-
}, {
|
|
226
|
-
key: "clear",
|
|
227
|
-
value: function () {
|
|
228
|
-
var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
229
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
230
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
231
|
-
case 0:
|
|
232
|
-
if (!this.isClosed) {
|
|
233
|
-
_context6.next = 3;
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
_context6.next = 3;
|
|
237
|
-
return this._init();
|
|
238
|
-
case 3:
|
|
239
|
-
return _context6.abrupt("return", this.LM_DB_SERVER[this.schemaName].clear());
|
|
240
|
-
case 4:
|
|
241
|
-
case "end":
|
|
242
|
-
return _context6.stop();
|
|
243
|
-
}
|
|
244
|
-
}, _callee6, this);
|
|
245
|
-
}));
|
|
246
|
-
function clear() {
|
|
247
|
-
return _clear.apply(this, arguments);
|
|
248
|
-
}
|
|
249
|
-
return clear;
|
|
250
|
-
}()
|
|
251
|
-
}, {
|
|
252
|
-
key: "count",
|
|
253
|
-
value: function () {
|
|
254
|
-
var _count = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
255
|
-
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
256
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
257
|
-
case 0:
|
|
258
|
-
if (!this.isClosed) {
|
|
259
|
-
_context7.next = 3;
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
_context7.next = 3;
|
|
263
|
-
return this._init();
|
|
264
|
-
case 3:
|
|
265
|
-
return _context7.abrupt("return", this.LM_DB_SERVER[this.schemaName].count());
|
|
266
|
-
case 4:
|
|
267
|
-
case "end":
|
|
268
|
-
return _context7.stop();
|
|
269
|
-
}
|
|
270
|
-
}, _callee7, this);
|
|
271
|
-
}));
|
|
272
|
-
function count() {
|
|
273
|
-
return _count.apply(this, arguments);
|
|
274
|
-
}
|
|
275
|
-
return count;
|
|
276
|
-
}()
|
|
277
|
-
}, {
|
|
278
|
-
key: "update",
|
|
279
|
-
value: function () {
|
|
280
|
-
var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
281
|
-
var _this$LM_DB_SERVER$th;
|
|
282
|
-
var _args8 = arguments;
|
|
283
|
-
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
284
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
285
|
-
case 0:
|
|
286
|
-
if (!this.isClosed) {
|
|
287
|
-
_context8.next = 3;
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
_context8.next = 3;
|
|
291
|
-
return this._init();
|
|
292
|
-
case 3:
|
|
293
|
-
this.removeExpireData();
|
|
294
|
-
return _context8.abrupt("return", (_this$LM_DB_SERVER$th = this.LM_DB_SERVER[this.schemaName]).update.apply(_this$LM_DB_SERVER$th, _args8));
|
|
295
|
-
case 5:
|
|
296
|
-
case "end":
|
|
297
|
-
return _context8.stop();
|
|
298
|
-
}
|
|
299
|
-
}, _callee8, this);
|
|
300
|
-
}));
|
|
301
|
-
function update() {
|
|
302
|
-
return _update.apply(this, arguments);
|
|
303
|
-
}
|
|
304
|
-
return update;
|
|
305
|
-
}()
|
|
306
|
-
}, {
|
|
307
|
-
key: "query",
|
|
308
|
-
value: function () {
|
|
309
|
-
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
310
|
-
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
311
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
312
|
-
case 0:
|
|
313
|
-
if (!this.isClosed) {
|
|
314
|
-
_context9.next = 3;
|
|
315
|
-
break;
|
|
316
|
-
}
|
|
317
|
-
_context9.next = 3;
|
|
318
|
-
return this._init();
|
|
319
|
-
case 3:
|
|
320
|
-
return _context9.abrupt("return", this.LM_DB_SERVER[this.schemaName].query().filter(function (v) {
|
|
321
|
-
return v.userId === cache.getCache('userId', 'session');
|
|
322
|
-
}).execute());
|
|
323
|
-
case 4:
|
|
324
|
-
case "end":
|
|
325
|
-
return _context9.stop();
|
|
326
|
-
}
|
|
327
|
-
}, _callee9, this);
|
|
328
|
-
}));
|
|
329
|
-
function query() {
|
|
330
|
-
return _query.apply(this, arguments);
|
|
331
|
-
}
|
|
332
|
-
return query;
|
|
333
|
-
}()
|
|
334
|
-
}]);
|
|
335
|
-
return DBInstance;
|
|
336
|
-
}();
|
|
337
|
-
export default DBInstance;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
interface IDisableMarkProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
disabled: boolean;
|
|
6
|
-
width?: string | number;
|
|
7
|
-
}
|
|
8
|
-
export default function DisableMark({ children, disabled, width }: IDisableMarkProps): JSX.Element;
|
|
9
|
-
export {};
|
package/es/DisableMark/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import "./index.less";
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
export default function DisableMark(_ref) {
|
|
6
|
-
var children = _ref.children,
|
|
7
|
-
disabled = _ref.disabled,
|
|
8
|
-
width = _ref.width;
|
|
9
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
10
|
-
style: {
|
|
11
|
-
width: '100%',
|
|
12
|
-
height: 'max-content',
|
|
13
|
-
position: 'relative'
|
|
14
|
-
},
|
|
15
|
-
children: [disabled ? /*#__PURE__*/_jsx("div", {
|
|
16
|
-
className: "disable-mark",
|
|
17
|
-
style: {
|
|
18
|
-
width: width
|
|
19
|
-
}
|
|
20
|
-
}) : null, children]
|
|
21
|
-
});
|
|
22
|
-
}
|
package/es/DomMove/demo.d.ts
DELETED
package/es/DomMove/demo.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import DomMove from "./index";
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export default function App() {
|
|
5
|
-
return /*#__PURE__*/_jsx("div", {
|
|
6
|
-
style: {
|
|
7
|
-
width: 800,
|
|
8
|
-
height: 800
|
|
9
|
-
},
|
|
10
|
-
children: /*#__PURE__*/_jsx(DomMove, {
|
|
11
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
12
|
-
style: {
|
|
13
|
-
width: 30,
|
|
14
|
-
height: 30,
|
|
15
|
-
background: 'red'
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
})
|
|
19
|
-
});
|
|
20
|
-
}
|
package/es/DomMove/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PositionType, SizeType } from '../Picture/interface';
|
|
3
|
-
interface IDomMoveProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
onDrag?: (e: MouseEvent, position: PositionType) => void;
|
|
6
|
-
onDragChange?: (position: PositionType) => void;
|
|
7
|
-
onDragEnd?: (e: MouseEvent, position: PositionType) => void;
|
|
8
|
-
position?: PositionType;
|
|
9
|
-
size?: SizeType;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
className?: string;
|
|
12
|
-
style?: React.CSSProperties;
|
|
13
|
-
forwordRef?: React.MutableRefObject<any>;
|
|
14
|
-
}
|
|
15
|
-
declare const _default: React.ForwardRefExoticComponent<IDomMoveProps & React.RefAttributes<unknown>>;
|
|
16
|
-
export default _default;
|
package/es/DomMove/index.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
import _useEventListener from "ahooks/es/useEventListener";
|
|
3
|
-
import _useUpdate from "ahooks/es/useUpdate";
|
|
4
|
-
import _useSize from "ahooks/es/useSize";
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
-
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; }
|
|
8
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
-
import React, { useEffect, useImperativeHandle, useRef } from 'react';
|
|
11
|
-
import { getMouseXY, getPosition } from "./utils";
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
function DomMove(_ref) {
|
|
14
|
-
var onDrag = _ref.onDrag,
|
|
15
|
-
position = _ref.position,
|
|
16
|
-
className = _ref.className,
|
|
17
|
-
size = _ref.size,
|
|
18
|
-
children = _ref.children,
|
|
19
|
-
onDragChange = _ref.onDragChange,
|
|
20
|
-
onDragEnd = _ref.onDragEnd,
|
|
21
|
-
forwordRef = _ref.forwordRef,
|
|
22
|
-
disabled = _ref.disabled;
|
|
23
|
-
var dragRef = useRef(null);
|
|
24
|
-
var ref = useRef({
|
|
25
|
-
position: {
|
|
26
|
-
x: 0,
|
|
27
|
-
y: 0
|
|
28
|
-
},
|
|
29
|
-
DA: {
|
|
30
|
-
x: 0,
|
|
31
|
-
y: 0
|
|
32
|
-
},
|
|
33
|
-
isDrag: false,
|
|
34
|
-
deviation: {
|
|
35
|
-
offsetX: 0,
|
|
36
|
-
offsetY: 0,
|
|
37
|
-
width: 0,
|
|
38
|
-
height: 0
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
var reSize = _useSize(dragRef) || {};
|
|
42
|
-
var update = _useUpdate();
|
|
43
|
-
var updatePosition = function updatePosition(_ref2) {
|
|
44
|
-
var x = _ref2.x,
|
|
45
|
-
y = _ref2.y;
|
|
46
|
-
ref.current.position = {
|
|
47
|
-
x: x,
|
|
48
|
-
y: y
|
|
49
|
-
};
|
|
50
|
-
update();
|
|
51
|
-
onDragChange === null || onDragChange === void 0 ? void 0 : onDragChange({
|
|
52
|
-
x: x,
|
|
53
|
-
y: y
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
useEffect(function () {
|
|
57
|
-
var offset = getPosition(dragRef === null || dragRef === void 0 ? void 0 : dragRef.current);
|
|
58
|
-
ref.current.deviation = {
|
|
59
|
-
offsetX: offset.left,
|
|
60
|
-
offsetY: offset.top,
|
|
61
|
-
width: reSize.width,
|
|
62
|
-
height: reSize.height
|
|
63
|
-
};
|
|
64
|
-
}, [reSize.width, reSize.height]);
|
|
65
|
-
|
|
66
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
|
-
useImperativeHandle(forwordRef, function () {
|
|
68
|
-
return {
|
|
69
|
-
updatePosition: updatePosition
|
|
70
|
-
};
|
|
71
|
-
}, []);
|
|
72
|
-
_useEventListener('mousemove', function (event) {
|
|
73
|
-
if (ref.current.isDrag) {
|
|
74
|
-
// let maxX, maxY;
|
|
75
|
-
var moveX, moveY;
|
|
76
|
-
var _getMouseXY = getMouseXY(event),
|
|
77
|
-
_x = _getMouseXY.x,
|
|
78
|
-
_y = _getMouseXY.y;
|
|
79
|
-
moveX = _x - ref.current.deviation.offsetX;
|
|
80
|
-
moveY = _y - ref.current.deviation.offsetY;
|
|
81
|
-
|
|
82
|
-
// 计算可移动位置的大小, 保证元素不会超过可移动范围
|
|
83
|
-
// maxX = document.documentElement.clientWidth - this.deviation.width;
|
|
84
|
-
// maxY = document.documentElement.clientHeight - this.deviation.height;
|
|
85
|
-
|
|
86
|
-
// min方法保证不会超过右边界,max保证不会超过左边界
|
|
87
|
-
// moveX = Math.min(Math.max(0, moveX), maxX);
|
|
88
|
-
// moveY = Math.min(Math.max(0, moveY), maxY);
|
|
89
|
-
var _position = {
|
|
90
|
-
x: moveX,
|
|
91
|
-
y: moveY
|
|
92
|
-
};
|
|
93
|
-
onDrag ? onDrag(event, _position) : updatePosition(_position);
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
target: document.body
|
|
97
|
-
});
|
|
98
|
-
_useEventListener('mouseup', function (event) {
|
|
99
|
-
if (ref.current.isDrag) {
|
|
100
|
-
ref.current.isDrag = false;
|
|
101
|
-
onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(event, ref.current.position);
|
|
102
|
-
}
|
|
103
|
-
}, {
|
|
104
|
-
target: document.body
|
|
105
|
-
});
|
|
106
|
-
_useEventListener('mousedown', function (event) {
|
|
107
|
-
if (!disabled) {
|
|
108
|
-
var _getMouseXY2 = getMouseXY(event),
|
|
109
|
-
_x2 = _getMouseXY2.x,
|
|
110
|
-
_y2 = _getMouseXY2.y;
|
|
111
|
-
ref.current.deviation.offsetX = _x2 - ref.current.position.x;
|
|
112
|
-
ref.current.deviation.offsetY = _y2 - ref.current.position.y;
|
|
113
|
-
ref.current.isDrag = true;
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
target: dragRef
|
|
117
|
-
});
|
|
118
|
-
var _ref3 = onDrag ? {
|
|
119
|
-
x: position === null || position === void 0 ? void 0 : position.x,
|
|
120
|
-
y: position === null || position === void 0 ? void 0 : position.y
|
|
121
|
-
} : {
|
|
122
|
-
x: ref.current.position.x,
|
|
123
|
-
y: ref.current.position.y
|
|
124
|
-
},
|
|
125
|
-
x = _ref3.x,
|
|
126
|
-
y = _ref3.y;
|
|
127
|
-
return /*#__PURE__*/_jsx("div", {
|
|
128
|
-
ref: dragRef,
|
|
129
|
-
className: "drag-move-Content ".concat(className),
|
|
130
|
-
style: {
|
|
131
|
-
transform: "translate(".concat(x, "px,").concat(y, "px)"),
|
|
132
|
-
width: size === null || size === void 0 ? void 0 : size.width,
|
|
133
|
-
height: size === null || size === void 0 ? void 0 : size.height
|
|
134
|
-
},
|
|
135
|
-
children: children
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
DomMove.defaultProps = {
|
|
139
|
-
className: '',
|
|
140
|
-
size: {
|
|
141
|
-
width: '100%',
|
|
142
|
-
height: '100%'
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
export default /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
146
|
-
return /*#__PURE__*/_jsx(DomMove, _objectSpread(_objectSpread({}, props), {}, {
|
|
147
|
-
forwordRef: ref
|
|
148
|
-
}));
|
|
149
|
-
});
|
package/es/DomMove/utils.d.ts
DELETED
package/es/DomMove/utils.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export function getPosition(obj) {
|
|
2
|
-
//获取某元素以浏览器左上角为原点的坐标
|
|
3
|
-
var t = obj.offsetTop; //获取该元素对应父容器的上边距
|
|
4
|
-
var l = obj.offsetLeft; //对应父容器的上边距
|
|
5
|
-
//判断是否有父容器,如果存在则累加其边距
|
|
6
|
-
while (obj = obj.offsetParent) {
|
|
7
|
-
//等效 obj = obj.offsetParent;while (obj != undefined)
|
|
8
|
-
t += obj.offsetTop; //叠加父容器的上边距
|
|
9
|
-
l += obj.offsetLeft; //叠加父容器的左边距
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return {
|
|
13
|
-
left: l,
|
|
14
|
-
top: t
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
// 函数用于获取鼠标的位置
|
|
18
|
-
export function getMouseXY(e) {
|
|
19
|
-
var x = 0,
|
|
20
|
-
y = 0;
|
|
21
|
-
e = e || window.event;
|
|
22
|
-
if (e.pageX) {
|
|
23
|
-
x = e.pageX;
|
|
24
|
-
y = e.pageY;
|
|
25
|
-
} else {
|
|
26
|
-
x = e.clientX + document.body.scrollLeft - document.body.clientLeft;
|
|
27
|
-
y = e.clientY + document.body.scrollTop - document.body.clientTop;
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
x: x,
|
|
31
|
-
y: y
|
|
32
|
-
};
|
|
33
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IDragAndDropItemProps } from './interface';
|
|
3
|
-
declare function DragAndDropItem<T>({ children, dragData, dragId, style, onDropEnd, disabledCopyElement }: IDragAndDropItemProps<T>): React.FunctionComponentElement<any>;
|
|
4
|
-
export default DragAndDropItem;
|