@cloud-app-dev/vidc 3.2.11 → 3.2.14
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 +71 -0
- package/.editorconfig +0 -3
- package/.eslintrc.js +3 -0
- package/.fatherrc.ts +19 -0
- package/.husky/commit-msg +5 -0
- package/.husky/pre-commit +4 -0
- package/.prettierrc.js +16 -0
- package/README.md +14 -26
- package/es/Api/index.js +100 -30
- package/es/AppContext/Sync.js +19 -3
- package/es/AppContext/index.js +86 -42
- package/es/AppContext/static.js +7 -0
- package/es/Auth/index.js +11 -4
- package/es/AutoExit/index.js +11 -3
- package/es/Box/BetweenBox/index.js +19 -10
- package/es/Box/BetweenBox/{index.css → index.less} +0 -0
- package/es/Box/InfoBox/index.js +24 -18
- package/es/Box/InfoBox/index.less +22 -0
- package/es/Box/TwoColumnBox/index.js +42 -25
- package/es/Box/TwoColumnBox/index.less +70 -0
- package/es/Box/deps/grid-factory.d.ts +2 -2
- package/es/Box/deps/grid-factory.js +12 -0
- package/es/Box/index.js +29 -16
- package/es/Box/{index.css → index.less} +5 -4
- package/es/CheckGroupFixed/demo.d.ts +3 -0
- package/es/CheckGroupFixed/demo.js +28 -0
- package/es/CheckGroupFixed/index.js +117 -82
- package/es/CheckGroupFixed/index.less +50 -0
- package/es/Config/index.js +5 -1
- package/es/Config/utils.js +18 -3
- package/es/ConfigContext/index.js +8 -4
- package/es/CustomRenderSelect/index.js +71 -36
- package/es/CustomRenderSelect/index.less +25 -0
- package/es/DisableMark/index.js +14 -11
- package/es/DisableMark/{index.css → index.less} +0 -0
- package/es/DomMove/demo.js +14 -10
- package/es/DomMove/index.js +52 -30
- package/es/DomMove/utils.js +8 -3
- package/es/Drag/DragAndDropItem.js +44 -20
- package/es/Drag/DropItem.js +22 -6
- package/es/Drag/index.js +2 -2
- package/es/Drag/{index.css → index.less} +0 -0
- package/es/Drawer/Footer.js +22 -15
- package/es/Drawer/{Demo.d.ts → demo.d.ts} +0 -0
- package/es/Drawer/demo.js +109 -0
- package/es/Drawer/index.js +98 -60
- package/es/Drawer/index.less +42 -0
- package/es/ErrorFallback/index.js +23 -14
- package/es/FrontendPlayer/index.js +1 -1
- package/es/FullScreen/index.js +30 -17
- package/es/FullScreen/index.less +16 -0
- package/es/HightLevel/index.js +11 -4
- package/es/HightLevel/{index.css → index.less} +0 -0
- package/es/IconFont/index.js +39 -18
- package/es/ImageView/index.js +37 -13
- package/es/ImageView/index.less +10 -0
- package/es/Input/demo.d.ts +3 -0
- package/es/Input/demo.js +16 -0
- package/es/Input/index.js +46 -22
- package/es/Input/index.less +12 -0
- package/es/InstanceHistory/index.js +2 -0
- package/es/LabelValue/index.js +25 -18
- package/es/LabelValue/index.less +20 -0
- package/es/List/DynamicGridList/Demo.d.ts +1 -0
- package/es/List/DynamicGridList/Demo.js +52 -32
- package/es/List/DynamicGridList/index.d.ts +3 -3
- package/es/List/DynamicGridList/index.js +41 -26
- package/es/List/DynamicList/index.js +76 -56
- package/es/List/DynamicList/index.less +15 -0
- package/es/List/GridList/Demo.d.ts +1 -0
- package/es/List/GridList/Demo.js +60 -38
- package/es/List/GridList/hook.d.ts +1 -1
- package/es/List/GridList/hook.js +66 -35
- package/es/List/GridList/index.js +33 -29
- package/es/List/GridList/{index.css → index.less} +0 -0
- package/es/List/GridList/utils.d.ts +2 -2
- package/es/List/GridList/utils.js +1 -0
- package/es/List/VList/index.d.ts +1 -1
- package/es/List/VList/index.js +32 -19
- package/es/List/VList/{index.css → index.less} +0 -0
- package/es/List/VList/utils.d.ts +2 -2
- package/es/List/VList/utils.js +8 -6
- package/es/List/demo.d.ts +3 -0
- package/es/List/demo.js +26 -0
- package/es/List/index.d.ts +1 -1
- package/es/List/index.js +31 -23
- package/es/List/{index.css → index.less} +5 -4
- package/es/ListWithSizeAnimate/demo.d.ts +2 -0
- package/es/ListWithSizeAnimate/demo.js +19 -0
- package/es/ListWithSizeAnimate/index.d.ts +9 -0
- package/es/ListWithSizeAnimate/index.js +71 -0
- package/es/ListWithSizeAnimate/index.less +13 -0
- package/es/LoaderApp/index.js +59 -25
- package/es/LoaderApp/{index.css → index.less} +0 -0
- package/es/LoaderApp/loader.js +40 -23
- package/es/LoaderApp/sandbox.back.js +101 -24
- package/es/LoaderApp/sandbox.js +26 -9
- package/es/LoaderApp/utils.d.ts +1 -1
- package/es/LoaderApp/utils.js +68 -25
- package/es/LoaderScript/index.js +25 -10
- package/es/LoaderScript/utils.js +151 -87
- package/es/Map/BasicMap/AMapInstance.d.ts +1 -1
- package/es/Map/BasicMap/AMapInstance.js +25 -3
- package/es/Map/BasicMap/LeafletInstance.js +28 -11
- package/es/Map/BasicMap/index.js +67 -27
- package/es/Map/BasicMap/index.less +24 -0
- package/es/Map/ClusterLayer/hook.d.ts +2 -2
- package/es/Map/ClusterLayer/hook.js +51 -23
- package/es/Map/ClusterLayer/index.d.ts +1 -1
- package/es/Map/ClusterLayer/index.js +14 -6
- package/es/Map/ClusterLayer/index.less +27 -0
- package/es/Map/Config/index.js +44 -16
- package/es/Map/Config/utils.js +17 -3
- package/es/Map/Context/index.js +43 -9
- package/es/Map/FindPio/index.js +5 -2
- package/es/Map/FindPio/{index.css → index.less} +0 -0
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +1 -1
- package/es/Map/InfoWindow/MakerLikeWindow.js +41 -18
- package/es/Map/InfoWindow/demo.d.ts +1 -0
- package/es/Map/InfoWindow/demo.js +51 -29
- package/es/Map/InfoWindow/index.d.ts +1 -1
- package/es/Map/InfoWindow/index.js +39 -18
- package/es/Map/LevelCenter/DragMarker/index.js +16 -10
- package/es/Map/LevelCenter/demo.d.ts +1 -0
- package/es/Map/LevelCenter/demo.js +41 -22
- package/es/Map/LevelCenter/index.js +41 -29
- package/es/Map/LevelCenter/index.less +2 -0
- package/es/Map/LoaderMap/index.js +38 -22
- package/es/Map/MapDrawSelect/demo.d.ts +1 -0
- package/es/Map/MapDrawSelect/demo.js +65 -46
- package/es/Map/MapDrawSelect/index.js +43 -31
- package/es/Map/MapDrawSelect/index.less +2 -0
- package/es/Map/MouseTool/index.js +32 -18
- package/es/Map/MouseTool/useMouseTools.js +37 -8
- package/es/Map/ResetTools/index.js +58 -44
- package/es/Map/ResetTools/index.less +35 -0
- package/es/Map/SinglePoint/index.js +39 -27
- package/es/Map/SinglePoint/index.less +41 -0
- package/es/Map/hook/useMapEvent.js +8 -4
- package/es/Map/hook/useMapType.js +3 -2
- package/es/Map/index.d.ts +1 -0
- package/es/Map/index.js +11 -11
- package/es/Map/useMarker/index.d.ts +1 -1
- package/es/Map/useMarker/index.js +33 -13
- package/es/Map/{LevelCenter/index.css → useMarker/index.less} +0 -0
- package/es/Map/withMap/index.d.ts +1 -0
- package/es/Map/withMap/index.js +14 -4
- package/es/Modal/demo.d.ts +3 -0
- package/es/Modal/demo.js +106 -0
- package/es/Modal/index.js +94 -57
- package/es/Modal/index.less +45 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +59 -37
- package/es/Picture/component/DefaultRects/index.js +46 -32
- package/es/Picture/component/DefaultRects/index.less +188 -0
- package/es/Picture/component/DrawRect/index.js +37 -24
- package/es/Picture/component/DrawRect/{index.css → index.less} +0 -0
- package/es/Picture/component/RectMenu/index.js +35 -26
- package/es/Picture/component/RectMenu/index.less +31 -0
- package/es/Picture/component/RectMenu/utils.js +6 -3
- package/es/Picture/component/Tools/index.js +91 -69
- package/es/Picture/component/Tools/index.less +43 -0
- package/es/Picture/component/WheelScale/index.js +9 -4
- package/es/Picture/demo.js +14 -11
- package/es/Picture/dragBound.d.ts +1 -1
- package/es/Picture/dragBound.js +17 -4
- package/es/Picture/index.d.ts +2 -2
- package/es/Picture/index.js +201 -137
- package/es/Picture/index.less +14 -0
- package/es/Picture/interface.d.ts +0 -6
- package/es/Picture/loadCaptureRectImage.d.ts +1 -1
- package/es/Picture/loadCaptureRectImage.js +39 -14
- package/es/Picture/useDraw.js +40 -20
- package/es/Picture/utils.d.ts +9 -9
- package/es/Picture/utils.js +18 -3
- package/es/Player/api/index.d.ts +3 -3
- package/es/Player/api/index.js +117 -82
- package/es/Player/context.js +21 -7
- package/es/Player/contraller_bar/bar.d.ts +1 -1
- package/es/Player/contraller_bar/bar.js +28 -10
- package/es/Player/contraller_bar/contraller_event.js +34 -12
- package/es/Player/contraller_bar/index.js +30 -22
- package/es/Player/contraller_bar/left_bar.js +62 -39
- package/es/Player/contraller_bar/right_bar.js +34 -18
- package/es/Player/contraller_bar/time.js +19 -8
- package/es/Player/contraller_bar/useBarStatus.js +29 -11
- package/es/Player/contraller_bar/volume.d.ts +1 -1
- package/es/Player/contraller_bar/volume.js +43 -21
- package/es/Player/demo.d.ts +1 -0
- package/es/Player/demo.js +258 -215
- package/es/Player/event/errorEvent.js +41 -16
- package/es/Player/event/eventName.js +12 -1
- package/es/Player/event/index.js +66 -24
- package/es/Player/fps_play.js +33 -15
- package/es/Player/frontend_player.js +42 -20
- package/es/Player/frontend_timeline.js +95 -55
- package/es/Player/iconfont.js +23 -8
- package/es/Player/index.js +1 -1
- package/es/Player/live_heart.js +15 -3
- package/es/Player/message.js +68 -37
- package/es/Player/segment_player.js +113 -62
- package/es/Player/segment_timeline.js +145 -97
- package/es/Player/single_player.js +153 -111
- package/es/Player/style/bar.less +39 -0
- package/es/Player/style/iconfont.js +17 -10
- package/es/Player/style/index.less +30 -0
- package/es/Player/style/message.less +50 -0
- package/es/Player/style/slider.less +103 -0
- package/es/Player/style/timeline.less +106 -0
- package/es/Player/style/volume.less +21 -0
- package/es/Player/timeline.d.ts +1 -1
- package/es/Player/timeline.js +59 -32
- package/es/Player/util.js +46 -7
- package/es/PlayerExt/demo.d.ts +1 -0
- package/es/PlayerExt/demo.js +145 -112
- package/es/PlayerExt/index.d.ts +2 -2
- package/es/PlayerExt/index.js +139 -87
- package/es/PlayerExt/{index.css → index.less} +0 -0
- package/es/Progress/index.js +18 -5
- package/es/Progress/index.less +20 -0
- package/es/ROI/demo.d.ts +1 -0
- package/es/ROI/demo.js +12 -8
- package/es/ROI/index.js +45 -35
- package/es/ROI/index.less +29 -0
- package/es/ScreenPlayer/Live.d.ts +2 -2
- package/es/ScreenPlayer/Live.js +172 -109
- package/es/ScreenPlayer/LiveTools.d.ts +2 -2
- package/es/ScreenPlayer/LiveTools.js +156 -116
- package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
- package/es/ScreenPlayer/PlayerWithExt.js +172 -115
- package/es/ScreenPlayer/RatePick.js +35 -22
- package/es/ScreenPlayer/Record.d.ts +1 -1
- package/es/ScreenPlayer/Record.js +307 -192
- package/es/ScreenPlayer/RecordTools.d.ts +2 -2
- package/es/ScreenPlayer/RecordTools.js +201 -149
- package/es/ScreenPlayer/ScreenSelect.js +37 -28
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -1
- package/es/ScreenPlayer/SegmentTimeLine.js +24 -17
- package/es/ScreenPlayer/TimeMode.js +22 -16
- package/es/ScreenPlayer/TimeSelect.js +86 -65
- package/es/ScreenPlayer/demo.js +16 -18
- package/es/ScreenPlayer/demo2.js +193 -178
- package/es/ScreenPlayer/index.d.ts +1 -0
- package/es/ScreenPlayer/index.js +3 -3
- package/es/ScreenPlayer/index.less +178 -0
- package/es/ScreenPlayer/interface.d.ts +2 -2
- package/es/ScreenPlayer/useTimeSlider.d.ts +8 -8
- package/es/ScreenPlayer/useTimeSlider.js +167 -60
- package/es/ScreenPlayer/useVideoFit.d.ts +1 -1
- package/es/ScreenPlayer/useVideoFit.js +18 -5
- package/es/ScreenPlayer/utils.d.ts +1 -1
- package/es/ScreenPlayer/utils.js +10 -1
- package/es/SegmentPlayer/index.js +1 -1
- package/es/Service/fetch-adapter.d.ts +1 -1
- package/es/Service/fetch-adapter.js +48 -5
- package/es/Service/http.js +46 -16
- package/es/Service/index.js +2 -2
- package/es/TableLayout/index.js +18 -12
- package/es/TableLayout/{index.css → index.less} +0 -0
- package/es/ThemeAntd/demo.d.ts +1 -0
- package/es/ThemeAntd/demo.js +126 -76
- package/es/ThemeAntd/{demo.css → demo.less} +4 -3
- package/es/ThemeAntd/index.js +6 -2
- package/es/ThemeAntd/index.less +16 -0
- package/es/ThemeAntd/style/button.less +67 -0
- package/es/ThemeAntd/style/checkbox.less +72 -0
- package/es/ThemeAntd/style/form.less +12 -0
- package/es/ThemeAntd/style/input.less +83 -0
- package/es/ThemeAntd/style/pagination.less +95 -0
- package/es/ThemeAntd/style/picker.less +106 -0
- package/es/ThemeAntd/style/popover.less +5 -0
- package/es/ThemeAntd/style/radio.less +87 -0
- package/es/ThemeAntd/style/{scrollbar.css → scrollbar.less} +4 -2
- package/es/ThemeAntd/style/select.less +81 -0
- package/es/ThemeAntd/style/table.less +57 -0
- package/es/ThemeAntd/style/tree.less +18 -0
- package/es/Timeout/index.js +36 -12
- package/es/Tree/demo.js +26 -21
- package/es/Tree/index.js +51 -30
- package/es/Tree/index.less +59 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +48 -47
- package/es/useDrawROI/index.js +130 -65
- package/es/useEventEmitterHandle/index.js +6 -2
- package/es/useFullscreen/demo.js +44 -27
- package/es/useFullscreen/index.js +30 -8
- package/es/useHistory/index.js +3 -1
- package/es/useInfiniteScroll/index.js +50 -19
- package/es/useRafInterval/index.js +28 -4
- package/es/useSimpleState/index.js +23 -6
- package/es/useVirtualList/index.js +58 -20
- package/es/utils.d.ts +1 -1
- package/es/utils.js +53 -14
- package/package.json +37 -32
- package/tsconfig.json +8 -32
- package/.eslintrc +0 -4
- package/.fatherrc.js +0 -25
- package/.prettierrc +0 -11
- package/.umirc.ts +0 -55
- package/clear-cache.sh +0 -4
- package/es/Box/InfoBox/index.css +0 -22
- package/es/Box/TwoColumnBox/index.css +0 -70
- package/es/CheckGroupFixed/index.css +0 -49
- package/es/CustomRenderSelect/index.css +0 -20
- package/es/Drawer/Demo.js +0 -59
- package/es/Drawer/index.css +0 -40
- package/es/FullScreen/index.css +0 -16
- package/es/ImageView/index.css +0 -10
- package/es/Input/index.css +0 -8
- package/es/LabelValue/index.css +0 -18
- package/es/List/DynamicList/index.css +0 -15
- package/es/Map/BasicMap/index.css +0 -24
- package/es/Map/ClusterLayer/index.css +0 -26
- package/es/Map/MapDrawSelect/index.css +0 -0
- package/es/Map/ResetTools/index.css +0 -32
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Hover.svg +0 -15
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Normal.svg +0 -15
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Hover.svg +0 -15
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Normal.svg +0 -15
- package/es/Map/SinglePoint/index.css +0 -29
- package/es/Map/useMarker/index.css +0 -0
- package/es/Modal/index.css +0 -43
- package/es/Picture/component/DefaultRects/index.css +0 -247
- package/es/Picture/component/RectMenu/index.css +0 -31
- package/es/Picture/component/Tools/index.css +0 -42
- package/es/Picture/index.css +0 -12
- package/es/Player/style/bar.css +0 -38
- package/es/Player/style/index.css +0 -30
- package/es/Player/style/message.css +0 -49
- package/es/Player/style/slider.css +0 -96
- package/es/Player/style/timeline.css +0 -99
- package/es/Player/style/volume.css +0 -19
- package/es/Progress/index.css +0 -20
- package/es/ROI/index.css +0 -29
- package/es/ScreenPlayer/index.css +0 -166
- package/es/ThemeAntd/index.css +0 -620
- package/es/ThemeAntd/style/button.css +0 -55
- package/es/ThemeAntd/style/checkbox.css +0 -64
- package/es/ThemeAntd/style/form.css +0 -10
- package/es/ThemeAntd/style/input.css +0 -68
- package/es/ThemeAntd/style/pagination.css +0 -82
- package/es/ThemeAntd/style/picker.css +0 -98
- package/es/ThemeAntd/style/popover.css +0 -3
- package/es/ThemeAntd/style/radio.css +0 -80
- package/es/ThemeAntd/style/select.css +0 -76
- package/es/ThemeAntd/style/table.css +0 -46
- package/es/ThemeAntd/style/tree.css +0 -16
- package/es/Tree/index.css +0 -64
package/es/ImageView/index.js
CHANGED
|
@@ -1,23 +1,44 @@
|
|
|
1
|
+
var _excluded = ["src", "defaultSrc", "alt", "onError", "className"];
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
1
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
|
|
2
11
|
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."); }
|
|
12
|
+
|
|
3
13
|
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); }
|
|
14
|
+
|
|
4
15
|
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; }
|
|
16
|
+
|
|
5
17
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
18
|
+
|
|
6
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
|
|
8
25
|
import React, { useState, useEffect, useMemo, useRef } from 'react';
|
|
9
|
-
import "./index.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
import "./index.less";
|
|
27
|
+
import { createElement as _createElement } from "react";
|
|
28
|
+
|
|
29
|
+
function ImageView(_ref) {
|
|
30
|
+
var src = _ref.src,
|
|
31
|
+
defaultSrc = _ref.defaultSrc,
|
|
32
|
+
alt = _ref.alt,
|
|
33
|
+
onError = _ref.onError,
|
|
34
|
+
className = _ref.className,
|
|
35
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
|
|
17
37
|
var _useState = useState(!src),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
+
isError = _useState2[0],
|
|
40
|
+
setErrorStatus = _useState2[1];
|
|
41
|
+
|
|
21
42
|
var imgKey = useRef(Math.random());
|
|
22
43
|
var isErr = useMemo(function () {
|
|
23
44
|
return isError || !src;
|
|
@@ -29,11 +50,13 @@ function ImageView(_a) {
|
|
|
29
50
|
imgKey.current = Math.random();
|
|
30
51
|
setErrorStatus(null);
|
|
31
52
|
}, [src]);
|
|
53
|
+
|
|
32
54
|
function onImageError(e) {
|
|
33
55
|
setErrorStatus(true);
|
|
34
56
|
onError && onError(e);
|
|
35
57
|
}
|
|
36
|
-
|
|
58
|
+
|
|
59
|
+
return /*#__PURE__*/_createElement("img", _objectSpread(_objectSpread({}, props), {}, {
|
|
37
60
|
className: "lm-t-c-image-card ".concat(isErr ? 'lm-t-c-image-card-placeholder' : '', " ").concat(className),
|
|
38
61
|
key: imgKey.current,
|
|
39
62
|
"data-src": src,
|
|
@@ -42,6 +65,7 @@ function ImageView(_a) {
|
|
|
42
65
|
onError: onImageError
|
|
43
66
|
}));
|
|
44
67
|
}
|
|
68
|
+
|
|
45
69
|
ImageView.defaultProps = {
|
|
46
70
|
className: '',
|
|
47
71
|
defaultSrc: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAFmxJREFUeF7tXQvQdlVVfp6pAQwor6VZigQC8nNREYVMRYEQCgHl+vNzv2gIiXETpTBRSDCMklJQCYVMVER/NLE0IRDkoogCP3HJGmWmMe0yjZdqnmbZeenl4/vevfc5+5yzzzlrzXzz/zPf2muv/az9fPucffZei3BxBByBFRGgY+MIOAIrI+AE8dnhCCxAwAni08MRcIL4HHAE6iHgK0g93LzVRBBwgkwk0D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Zg8QYpZOSy0km4EsHP2MLvBughMmiClkcPSlR5cN5LerhUEJkuQ0sixqFZ3K5F3o1EITJIgpZHjtQD+NCpcrtQ1ApMjSGnk2APAZwAEs8d0PTO8v58gMCmClEaOZ1oAAGzik7FYBCZDkKLIUe1YGTleWuzUcMeyrSCWVcOya5QqJZLD6hkeVipg7tcjCGRZQVYDKK7sWDXEEskxK1Lv87B8BLIQZHMA95U/1loe3g7g0yStqHxjkXQ0gEsbG3IDXSHQnCDV8/RdAFZ15XUP/VxB8tAm/UraFcBaAOs3seNtO0UgG0FOAXB+p65339meJD9bp1tJmwGw/LnPrtPe2/SGQB6CVKvIGE71LorEu0meXCdUkq4DsFudtt6mVwSyEmQ9AD/qdTjtdv4Jksm3+yRdAuCYdl1z6y0hkI8g1SryXADXA9ioJYf7NHskyctSHJD0FgBvS2njukUhkJcgs6FJGtvhu1tIWrLoaPFagdFQlax4Dcl9FjlY+4yQJNv12R3AdgPPI2vbvHunRLHKY2U7VhuntHPd4hA4leQFrRBk3qikDQBsA2DD4iBY7NA6kg+n+CzJzlgZOca87Z0CyZB1dyJ5c+sEGTJCqb5LMnLsldrO9YtD4Dskg1efaz9iFTfcDhyStD8Aq57lMnwEzid5WmgYTpAQQnO/lzT2b0EJaAxaNXpTxgmSEGdJD/n9jgTAylXdkuS6GPecIDEoVTqSLgewJqGJq5aHwNkph1OdIAkBlHQIgCsSmrhqOQg8COAIkjekuOQESUHr/3JbTeHgZiIqRav/IwD7IHhSHS+dIDVQk7RTVUfQ/nUpD4HvV+ldbyZ5RxP3nCBN0PO2o0fACTL6EPsAmyDgBGmCnrcdPQJOkNGH2AfYBAEnSBP0vO3oEXCCjD7EPsAmCDhBmqDnbUePgBNk9CH2ATZB4H8BgW8+XwSELpsAAAAASUVORK5CYII='
|
package/es/Input/demo.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "antd/lib/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import Input from "./index";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
var App = function App() {
|
|
8
|
+
return /*#__PURE__*/_jsx(_ConfigProvider, {
|
|
9
|
+
prefixCls: "cloudapp",
|
|
10
|
+
children: /*#__PURE__*/_jsx(Input, {
|
|
11
|
+
onChange: console.log
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default App;
|
package/es/Input/index.js
CHANGED
|
@@ -2,44 +2,67 @@ import "antd/lib/input/style";
|
|
|
2
2
|
import _Input from "antd/lib/input";
|
|
3
3
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
4
4
|
import _useDebounce from "ahooks/es/useDebounce";
|
|
5
|
+
var _excluded = ["prefix", "className", "suffix", "allowClear", "defaultValue", "value", "onChange", "onEnter"];
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
|
|
5
13
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
+
|
|
6
15
|
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."); }
|
|
16
|
+
|
|
7
17
|
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); }
|
|
18
|
+
|
|
8
19
|
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; }
|
|
20
|
+
|
|
9
21
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
22
|
+
|
|
10
23
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
|
|
12
29
|
import React, { useState } from 'react';
|
|
13
|
-
import IconFont from
|
|
14
|
-
import "./index.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
import IconFont from "../IconFont";
|
|
31
|
+
import "./index.less";
|
|
32
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
|
+
|
|
34
|
+
function Input(_ref) {
|
|
35
|
+
var prefix = _ref.prefix,
|
|
36
|
+
className = _ref.className,
|
|
37
|
+
suffix = _ref.suffix,
|
|
38
|
+
allowClear = _ref.allowClear,
|
|
39
|
+
defaultValue = _ref.defaultValue,
|
|
40
|
+
value = _ref.value,
|
|
41
|
+
onChange = _ref.onChange,
|
|
42
|
+
onEnter = _ref.onEnter,
|
|
43
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
+
|
|
25
45
|
var _useState = useState({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
46
|
+
value: defaultValue || value,
|
|
47
|
+
focus: false
|
|
48
|
+
}),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
state = _useState2[0],
|
|
51
|
+
setState = _useState2[1];
|
|
52
|
+
|
|
32
53
|
var debouncedValue = _useDebounce(state.value, {
|
|
33
54
|
wait: 500
|
|
34
55
|
});
|
|
56
|
+
|
|
35
57
|
_useUpdateEffect(function () {
|
|
36
58
|
return onChange === null || onChange === void 0 ? void 0 : onChange(debouncedValue);
|
|
37
59
|
}, [debouncedValue]);
|
|
38
|
-
|
|
60
|
+
|
|
61
|
+
return /*#__PURE__*/_jsx(_Input, _objectSpread(_objectSpread({}, props), {}, {
|
|
39
62
|
className: "bc-search-input ".concat(className),
|
|
40
63
|
onChange: function onChange(e) {
|
|
41
64
|
return setState(function (old) {
|
|
42
|
-
return
|
|
65
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
43
66
|
value: e.target.value
|
|
44
67
|
});
|
|
45
68
|
});
|
|
@@ -53,9 +76,10 @@ function Input(_a) {
|
|
|
53
76
|
}
|
|
54
77
|
}));
|
|
55
78
|
}
|
|
79
|
+
|
|
56
80
|
Input.defaultProps = {
|
|
57
81
|
className: '',
|
|
58
|
-
prefix: /*#__PURE__*/
|
|
82
|
+
prefix: /*#__PURE__*/_jsx(IconFont, {
|
|
59
83
|
type: "lm-player_Edit_Search"
|
|
60
84
|
}),
|
|
61
85
|
allowClear: true
|
package/es/LabelValue/index.js
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import "./index.
|
|
2
|
+
import "./index.less";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
3
6
|
function LabelValue(_ref) {
|
|
4
7
|
var label = _ref.label,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return /*#__PURE__*/
|
|
8
|
+
value = _ref.value,
|
|
9
|
+
emptyValue = _ref.emptyValue,
|
|
10
|
+
className = _ref.className,
|
|
11
|
+
style = _ref.style,
|
|
12
|
+
labelStyle = _ref.labelStyle,
|
|
13
|
+
valueStyle = _ref.valueStyle,
|
|
14
|
+
noWrap = _ref.noWrap,
|
|
15
|
+
noColon = _ref.noColon;
|
|
16
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
14
17
|
className: "lm-c-label-value-layout ".concat(className),
|
|
15
|
-
style: style
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
style: style,
|
|
19
|
+
children: [/*#__PURE__*/_jsxs("span", {
|
|
20
|
+
style: labelStyle,
|
|
21
|
+
children: [label, noColon ? '' : ':']
|
|
22
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
23
|
+
title: value,
|
|
24
|
+
className: "".concat(noWrap ? 'no-wrap' : ''),
|
|
25
|
+
style: valueStyle,
|
|
26
|
+
children: value || emptyValue
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
23
29
|
}
|
|
30
|
+
|
|
24
31
|
LabelValue.defaultProps = {
|
|
25
32
|
value: '',
|
|
26
33
|
emptyValue: '-',
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.lm-c-label-value-layout {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
font-size: var(--fs-small);
|
|
4
|
+
span {
|
|
5
|
+
&:first-child {
|
|
6
|
+
white-space: nowrap;
|
|
7
|
+
padding-right: 4px;
|
|
8
|
+
color: var(--color);
|
|
9
|
+
}
|
|
10
|
+
&:last-child {
|
|
11
|
+
flex: 1;
|
|
12
|
+
color: var(--color-dark);
|
|
13
|
+
&.no-wrap {
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
2
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
3
5
|
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); }
|
|
6
|
+
|
|
4
7
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
|
|
5
9
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
|
|
6
11
|
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; }
|
|
12
|
+
|
|
7
13
|
import React from 'react';
|
|
8
|
-
import GridList from
|
|
14
|
+
import GridList from "./index";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
|
|
9
18
|
function random(low, high) {
|
|
10
19
|
return Math.floor(Math.random() * high) + low;
|
|
11
20
|
}
|
|
21
|
+
|
|
12
22
|
var IMAGES = function IMAGES() {
|
|
13
23
|
return Array.from({
|
|
14
24
|
length: 20
|
|
@@ -22,6 +32,7 @@ var IMAGES = function IMAGES() {
|
|
|
22
32
|
};
|
|
23
33
|
});
|
|
24
34
|
};
|
|
35
|
+
|
|
25
36
|
function loadPage() {
|
|
26
37
|
var d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
27
38
|
var resultData = IMAGES();
|
|
@@ -34,40 +45,49 @@ function loadPage() {
|
|
|
34
45
|
}, 10);
|
|
35
46
|
});
|
|
36
47
|
}
|
|
48
|
+
|
|
37
49
|
var App = function App() {
|
|
38
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/_jsx("div", {
|
|
39
51
|
style: {
|
|
40
52
|
height: 400
|
|
41
|
-
}
|
|
42
|
-
}, /*#__PURE__*/React.createElement(GridList, {
|
|
43
|
-
itemKey: "url",
|
|
44
|
-
itemHeight: 300,
|
|
45
|
-
itemWidth: 250,
|
|
46
|
-
renderItem: function renderItem(image) {
|
|
47
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
style: {
|
|
49
|
-
border: '1px solid gray',
|
|
50
|
-
height: '100%',
|
|
51
|
-
display: 'flex',
|
|
52
|
-
flexDirection: 'column'
|
|
53
|
-
}
|
|
54
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
style: {
|
|
56
|
-
flex: 1,
|
|
57
|
-
overflow: 'hidden'
|
|
58
|
-
}
|
|
59
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
60
|
-
src: image.url,
|
|
61
|
-
alt: "",
|
|
62
|
-
style: {
|
|
63
|
-
objectFit: 'cover',
|
|
64
|
-
display: 'block',
|
|
65
|
-
width: '100%',
|
|
66
|
-
height: '100%'
|
|
67
|
-
}
|
|
68
|
-
})), /*#__PURE__*/React.createElement("p", null, "\u6807\u9898"), /*#__PURE__*/React.createElement("p", null, "\u63CF\u8FF0"));
|
|
69
53
|
},
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
children: /*#__PURE__*/_jsx(GridList, {
|
|
55
|
+
itemKey: "url",
|
|
56
|
+
itemHeight: 300,
|
|
57
|
+
itemWidth: 250,
|
|
58
|
+
renderItem: function renderItem(image) {
|
|
59
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
60
|
+
style: {
|
|
61
|
+
border: '1px solid gray',
|
|
62
|
+
height: '100%',
|
|
63
|
+
display: 'flex',
|
|
64
|
+
flexDirection: 'column'
|
|
65
|
+
},
|
|
66
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
67
|
+
style: {
|
|
68
|
+
flex: 1,
|
|
69
|
+
overflow: 'hidden'
|
|
70
|
+
},
|
|
71
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
72
|
+
src: image.url,
|
|
73
|
+
alt: "",
|
|
74
|
+
style: {
|
|
75
|
+
objectFit: 'cover',
|
|
76
|
+
display: 'block',
|
|
77
|
+
width: '100%',
|
|
78
|
+
height: '100%'
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
82
|
+
children: "\u6807\u9898"
|
|
83
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
84
|
+
children: "\u63CF\u8FF0"
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
loadPage: loadPage
|
|
89
|
+
})
|
|
90
|
+
});
|
|
72
91
|
};
|
|
92
|
+
|
|
73
93
|
export default App;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { GridListCell } from '../GridList/interface';
|
|
3
2
|
import { TData } from '../../useInfiniteScroll';
|
|
3
|
+
import { GridListCell } from '../GridList/interface';
|
|
4
4
|
export interface IDynamicGridListProps<T> {
|
|
5
5
|
itemHeight?: number;
|
|
6
6
|
className?: string;
|
|
@@ -13,11 +13,11 @@ export interface IDynamicGridListProps<T> {
|
|
|
13
13
|
* @param options
|
|
14
14
|
*/
|
|
15
15
|
renderItem: (item: T, cell: GridListCell<T>) => React.ReactNode;
|
|
16
|
-
loadPage(d
|
|
16
|
+
loadPage(d?: TData<T>): Promise<TData<T>>;
|
|
17
17
|
itemWidth?: number;
|
|
18
18
|
itemKey: string;
|
|
19
19
|
getGridGap?: (...args: any) => number;
|
|
20
|
-
isNoMore?: (data
|
|
20
|
+
isNoMore?: (data?: TData<T>) => boolean;
|
|
21
21
|
threshold?: number;
|
|
22
22
|
}
|
|
23
23
|
declare function DynamicGridList<T>({ renderItem, itemHeight, itemKey, itemWidth, reloadDeps, getGridGap, loadPage, isNoMore, threshold, ...props }: IDynamicGridListProps<T>): JSX.Element;
|
|
@@ -1,33 +1,44 @@
|
|
|
1
|
-
import "antd/lib/message/style";
|
|
2
|
-
import _message from "antd/lib/message";
|
|
3
1
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
4
|
-
|
|
2
|
+
var _excluded = ["renderItem", "itemHeight", "itemKey", "itemWidth", "reloadDeps", "getGridGap", "loadPage", "isNoMore", "threshold"];
|
|
3
|
+
|
|
4
|
+
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; }
|
|
5
|
+
|
|
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
|
+
|
|
5
8
|
import React, { useMemo, useRef } from 'react';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
import useInfiniteScroll from "../../useInfiniteScroll";
|
|
10
|
+
import GridList from "../GridList";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
|
|
13
|
+
function DynamicGridList(_ref) {
|
|
14
|
+
var renderItem = _ref.renderItem,
|
|
15
|
+
itemHeight = _ref.itemHeight,
|
|
16
|
+
itemKey = _ref.itemKey,
|
|
17
|
+
itemWidth = _ref.itemWidth,
|
|
18
|
+
reloadDeps = _ref.reloadDeps,
|
|
19
|
+
getGridGap = _ref.getGridGap,
|
|
20
|
+
loadPage = _ref.loadPage,
|
|
21
|
+
isNoMore = _ref.isNoMore,
|
|
22
|
+
threshold = _ref.threshold,
|
|
23
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
|
|
19
25
|
var containerRef = useRef(null);
|
|
26
|
+
|
|
20
27
|
var _useInfiniteScroll = useInfiniteScroll(loadPage, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
target: containerRef,
|
|
29
|
+
threshold: threshold,
|
|
30
|
+
isNoMore: isNoMore,
|
|
31
|
+
reloadDeps: reloadDeps
|
|
32
|
+
}),
|
|
33
|
+
data = _useInfiniteScroll.data,
|
|
34
|
+
noMore = _useInfiniteScroll.noMore;
|
|
35
|
+
|
|
28
36
|
_useUpdateEffect(function () {
|
|
29
|
-
|
|
37
|
+
if (noMore) {
|
|
38
|
+
console.warn('数据已全部加载完成');
|
|
39
|
+
}
|
|
30
40
|
}, [noMore]);
|
|
41
|
+
|
|
31
42
|
function getItemData(data) {
|
|
32
43
|
return {
|
|
33
44
|
key: data[itemKey],
|
|
@@ -35,16 +46,19 @@ function DynamicGridList(_a) {
|
|
|
35
46
|
width: itemWidth
|
|
36
47
|
};
|
|
37
48
|
}
|
|
49
|
+
|
|
38
50
|
function getColumnCount(elementWidth, gridGap) {
|
|
39
|
-
return Math.floor((elementWidth + gridGap) / (itemWidth + gridGap));
|
|
51
|
+
return Math.floor((elementWidth + gridGap) / ((itemWidth !== null && itemWidth !== void 0 ? itemWidth : 0) + gridGap));
|
|
40
52
|
}
|
|
53
|
+
|
|
41
54
|
function getWindowMargin(windowHeight) {
|
|
42
55
|
return Math.round(windowHeight * 1.5);
|
|
43
56
|
}
|
|
57
|
+
|
|
44
58
|
var dataList = useMemo(function () {
|
|
45
59
|
return data ? data.list || [] : [];
|
|
46
60
|
}, [data]);
|
|
47
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/_jsx(GridList, {
|
|
48
62
|
className: "cloudapp-dynamic-grid-list ".concat(props.className),
|
|
49
63
|
items: dataList,
|
|
50
64
|
ref: containerRef,
|
|
@@ -55,6 +69,7 @@ function DynamicGridList(_a) {
|
|
|
55
69
|
getGridGap: getGridGap
|
|
56
70
|
});
|
|
57
71
|
}
|
|
72
|
+
|
|
58
73
|
DynamicGridList.defaultProps = {
|
|
59
74
|
reloadDeps: [],
|
|
60
75
|
className: '',
|