@cloud-app-dev/vidc 2.2.0-alpha.5 → 2.2.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Api/index.js +16 -12
- package/es/AppContext/Sync.d.ts +3 -2
- package/es/AppContext/Sync.js +11 -2
- package/es/AppContext/index.js +63 -9
- package/es/AppContext/interface.d.ts +10 -1
- package/es/AppContext/static.d.ts +2 -0
- package/es/AppContext/static.js +15 -6
- package/es/CheckGroupFixed/index.js +8 -6
- package/es/FullScreen/index.d.ts +12 -0
- package/es/FullScreen/index.js +1 -1
- package/es/InitialConfig/utils.js +12 -8
- package/es/InitialRequest/index.js +6 -2
- package/es/InitialRequest/utils.js +6 -2
- package/es/List/DynamicDeviceList/utils.js +6 -2
- package/es/List/DynamicGridList/index.d.ts +27 -17
- package/es/List/DynamicGridList/index.js +50 -24
- package/es/List/GridList/Demo.js +13 -35
- package/es/List/GridList/data.json +710 -0
- package/es/List/GridList/index.d.ts +2 -2
- package/es/List/GridList/index.js +2 -1
- package/es/List/index.d.ts +3 -1
- package/es/List/index.js +4 -0
- package/es/LoaderApp/index.js +6 -2
- package/es/LoaderApp/loader.js +8 -4
- package/es/LoaderApp/utils.js +6 -2
- package/es/LoaderScript/utils.js +10 -6
- package/es/Modal/index.d.ts +7 -7
- package/es/Picture/component/DefaultRects/RectInfo.js +1 -1
- package/es/Picture/component/DefaultRects/index.js +1 -1
- package/es/Picture/index.d.ts +2 -0
- package/es/Picture/index.js +13 -7
- package/es/Picture/interface.d.ts +136 -3
- package/es/Picture/loadCaptureRectImage.js +6 -2
- package/es/Picture/utils.d.ts +0 -2
- package/es/Player/message.js +1 -1
- package/es/Player/player.d.ts +119 -1
- package/es/Player/style/timeline.css +1 -1
- package/es/Service/fetch-adapter.js +6 -2
- package/es/WorkerFlow/Form/EmptyUserSet.js +6 -2
- package/es/WorkerFlow/Form/GroupSelect.js +6 -2
- package/es/WorkerFlow/Form/LevelGroupSelect.js +6 -2
- package/es/WorkerFlow/Form/UserAndGroupSelect.js +6 -2
- package/es/WorkerFlow/Form/UserSelect.js +6 -2
- package/es/WorkerFlow/index.js +6 -2
- package/es/index.d.ts +2 -2
- package/es/index.js +3 -3
- package/es/utils.d.ts +2 -1
- package/es/utils.js +24 -3
- package/package.json +2 -2
- package/pnpm-lock.yaml +13662 -0
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
|
|
3
|
+
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, $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 generator._invoke = function (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); } }; }(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; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return 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, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), 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 (object) { var 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; }
|
|
4
|
+
|
|
1
5
|
import { __awaiter } from "tslib";
|
|
2
6
|
import Service from '../../Service';
|
|
3
7
|
import { getHeader } from '../../utils';
|
|
@@ -21,10 +25,10 @@ export var LIMIT = 30;
|
|
|
21
25
|
|
|
22
26
|
export var loadNextPage = function loadNextPage(d, defaultLimit) {
|
|
23
27
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
24
|
-
return __awaiter(this, void 0, void 0, /*#__PURE__*/
|
|
28
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
25
29
|
var _ref, offset, limit, pageLimit, pageOffset, res;
|
|
26
30
|
|
|
27
|
-
return
|
|
31
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28
32
|
while (1) {
|
|
29
33
|
switch (_context.prev = _context.next) {
|
|
30
34
|
case 0:
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export interface IDynamicGridListProps
|
|
2
|
+
export interface IDynamicGridListProps {
|
|
3
3
|
itemKey: string;
|
|
4
|
-
itemHeight
|
|
5
|
-
itemWidth
|
|
6
|
-
loadNextPage: (d
|
|
7
|
-
|
|
4
|
+
itemHeight: number;
|
|
5
|
+
itemWidth: number;
|
|
6
|
+
loadNextPage: (d?: IDynamicGridListResult) => Promise<IDynamicGridListResult>;
|
|
7
|
+
reloadDeps?: any[];
|
|
8
8
|
isNoMore: (d: any) => boolean;
|
|
9
|
-
renderItem: (item:
|
|
9
|
+
renderItem: (item: any) => React.ReactNode;
|
|
10
10
|
className?: string;
|
|
11
11
|
getGridGap?: (elementWidth: number, windowHeight: number) => number;
|
|
12
12
|
}
|
|
13
|
-
export interface IDynamicGridListResult
|
|
14
|
-
list:
|
|
13
|
+
export interface IDynamicGridListResult {
|
|
14
|
+
list: any[];
|
|
15
15
|
[key: string]: any;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
export interface IDynamicGridListRef {
|
|
18
|
+
/**
|
|
19
|
+
* @desc 修改数据
|
|
20
|
+
*/
|
|
21
|
+
mutate: React.Dispatch<React.SetStateAction<IDynamicGridListResult | undefined>>;
|
|
22
|
+
/**
|
|
23
|
+
* 重置第一页
|
|
24
|
+
*/
|
|
25
|
+
reload: () => void;
|
|
26
|
+
data: any;
|
|
27
|
+
loading: boolean;
|
|
28
|
+
loadingMore: boolean;
|
|
29
|
+
noMore: boolean;
|
|
30
|
+
loadMore: () => void;
|
|
31
|
+
loadMoreAsync: () => Promise<any>;
|
|
32
|
+
reloadAsync: () => Promise<any>;
|
|
33
|
+
cancel: () => void;
|
|
25
34
|
}
|
|
26
|
-
|
|
35
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<IDynamicGridListResult, keyof IDynamicGridListResult> & React.RefAttributes<IDynamicGridListRef>>;
|
|
36
|
+
export default _default;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
2
2
|
import _useInfiniteScroll2 from "ahooks/es/useInfiniteScroll";
|
|
3
|
-
import React, { useRef } from 'react';
|
|
3
|
+
import React, { useImperativeHandle, useRef } from 'react';
|
|
4
4
|
import GridList from '../GridList';
|
|
5
5
|
|
|
6
|
-
function DynamicGridList(
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
function DynamicGridList(props, ref) {
|
|
7
|
+
var _props$className = props.className,
|
|
8
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
9
|
+
renderItem = props.renderItem,
|
|
10
|
+
_props$getGridGap = props.getGridGap,
|
|
11
|
+
getGridGap = _props$getGridGap === void 0 ? function () {
|
|
12
|
+
return 20;
|
|
13
|
+
} : _props$getGridGap,
|
|
14
|
+
_props$itemHeight = props.itemHeight,
|
|
15
|
+
itemHeight = _props$itemHeight === void 0 ? 300 : _props$itemHeight,
|
|
16
|
+
_props$itemWidth = props.itemWidth,
|
|
17
|
+
itemWidth = _props$itemWidth === void 0 ? 250 : _props$itemWidth,
|
|
18
|
+
itemKey = props.itemKey,
|
|
19
|
+
reloadDeps = props.reloadDeps,
|
|
20
|
+
loadNextPage = props.loadNextPage,
|
|
21
|
+
isNoMore = props.isNoMore;
|
|
16
22
|
var containerRef = useRef(null);
|
|
17
23
|
|
|
18
24
|
var _useInfiniteScroll = _useInfiniteScroll2(function (d) {
|
|
@@ -21,9 +27,19 @@ function DynamicGridList(_ref) {
|
|
|
21
27
|
target: containerRef,
|
|
22
28
|
threshold: 50,
|
|
23
29
|
isNoMore: isNoMore,
|
|
24
|
-
|
|
30
|
+
manual: true,
|
|
31
|
+
reloadDeps: reloadDeps
|
|
25
32
|
}),
|
|
26
|
-
data = _useInfiniteScroll.data
|
|
33
|
+
data = _useInfiniteScroll.data,
|
|
34
|
+
mutate = _useInfiniteScroll.mutate,
|
|
35
|
+
reload = _useInfiniteScroll.reload,
|
|
36
|
+
reloadAsync = _useInfiniteScroll.reloadAsync,
|
|
37
|
+
loading = _useInfiniteScroll.loading,
|
|
38
|
+
loadMore = _useInfiniteScroll.loadMore,
|
|
39
|
+
loadMoreAsync = _useInfiniteScroll.loadMoreAsync,
|
|
40
|
+
loadingMore = _useInfiniteScroll.loadingMore,
|
|
41
|
+
noMore = _useInfiniteScroll.noMore,
|
|
42
|
+
cancel = _useInfiniteScroll.cancel;
|
|
27
43
|
|
|
28
44
|
function getItemData(data) {
|
|
29
45
|
return {
|
|
@@ -44,12 +60,30 @@ function DynamicGridList(_ref) {
|
|
|
44
60
|
_useUpdateEffect(function () {
|
|
45
61
|
var _a;
|
|
46
62
|
|
|
47
|
-
|
|
63
|
+
mutate({
|
|
64
|
+
list: [],
|
|
65
|
+
isMutate: true
|
|
66
|
+
});
|
|
67
|
+
(_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
48
68
|
left: 0,
|
|
49
69
|
top: 0
|
|
50
70
|
});
|
|
51
|
-
},
|
|
71
|
+
}, reloadDeps);
|
|
52
72
|
|
|
73
|
+
useImperativeHandle(ref, function () {
|
|
74
|
+
return {
|
|
75
|
+
data: data,
|
|
76
|
+
mutate: mutate,
|
|
77
|
+
reload: reload,
|
|
78
|
+
reloadAsync: reloadAsync,
|
|
79
|
+
loading: loading,
|
|
80
|
+
loadMore: loadMore,
|
|
81
|
+
loadMoreAsync: loadMoreAsync,
|
|
82
|
+
loadingMore: loadingMore,
|
|
83
|
+
noMore: noMore,
|
|
84
|
+
cancel: cancel
|
|
85
|
+
};
|
|
86
|
+
}, [data, mutate, reload, reloadAsync, loading, loadMore, loadMoreAsync, loadingMore, noMore, cancel]);
|
|
53
87
|
return /*#__PURE__*/React.createElement(GridList, {
|
|
54
88
|
className: "cloudapp-dynamic-grid-list ".concat(className),
|
|
55
89
|
items: (data === null || data === void 0 ? void 0 : data.list) || [],
|
|
@@ -62,12 +96,4 @@ function DynamicGridList(_ref) {
|
|
|
62
96
|
});
|
|
63
97
|
}
|
|
64
98
|
|
|
65
|
-
|
|
66
|
-
itemWidth: 250,
|
|
67
|
-
itemHeight: 300,
|
|
68
|
-
className: '',
|
|
69
|
-
getGridGap: function getGridGap() {
|
|
70
|
-
return 20;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
export default DynamicGridList;
|
|
99
|
+
export default /*#__PURE__*/React.forwardRef(DynamicGridList);
|
package/es/List/GridList/Demo.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import GridList from './index';
|
|
3
|
+
import data from './data.json';
|
|
3
4
|
var ITEM_WIDTH = 300;
|
|
4
5
|
|
|
5
6
|
function getGridGap(elementWidth, windowHeight) {
|
|
@@ -19,22 +20,27 @@ function getWindowMargin(windowHeight) {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
function getItemData(image, columnWidth) {
|
|
23
|
+
console.log(columnWidth);
|
|
22
24
|
return {
|
|
23
25
|
key: image.url,
|
|
24
26
|
height: 400,
|
|
25
|
-
width:
|
|
27
|
+
width: ITEM_WIDTH
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
function
|
|
30
|
-
return /*#__PURE__*/React.createElement(
|
|
31
|
-
|
|
31
|
+
var App = function App() {
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
style: {
|
|
34
|
+
height: 800,
|
|
35
|
+
overflow: 'auto'
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/React.createElement(GridList, {
|
|
38
|
+
items: data.data.list,
|
|
32
39
|
getGridGap: getGridGap,
|
|
33
40
|
getColumnCount: getColumnCount,
|
|
34
41
|
getWindowMargin: getWindowMargin,
|
|
35
42
|
getItemData: getItemData,
|
|
36
|
-
|
|
37
|
-
renderItem: function renderItem(image) {
|
|
43
|
+
renderItem: function renderItem(image, cell) {
|
|
38
44
|
return /*#__PURE__*/React.createElement("div", {
|
|
39
45
|
style: {
|
|
40
46
|
border: '1px solid gray',
|
|
@@ -55,36 +61,8 @@ function ImageGridList(props) {
|
|
|
55
61
|
width: '100%',
|
|
56
62
|
height: '100%'
|
|
57
63
|
}
|
|
58
|
-
})), /*#__PURE__*/React.createElement("p", null,
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function random(low, high) {
|
|
64
|
-
return Math.floor(Math.random() * high) + low;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
var IMAGES = Array.from({
|
|
68
|
-
length: 10000
|
|
69
|
-
}, function (_, index) {
|
|
70
|
-
var width = 300;
|
|
71
|
-
var height = random(200, 300);
|
|
72
|
-
return {
|
|
73
|
-
url: "https://picsum.photos/id/".concat(index + 1, "/").concat(width, "/").concat(height, ".jpg"),
|
|
74
|
-
width: width,
|
|
75
|
-
height: height
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
var App = function App() {
|
|
80
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
style: {
|
|
82
|
-
height: 800,
|
|
83
|
-
overflow: 'auto'
|
|
64
|
+
})), /*#__PURE__*/React.createElement("p", null, image.deviceName), /*#__PURE__*/React.createElement("p", null, "\u63CF\u8FF0"));
|
|
84
65
|
}
|
|
85
|
-
}, /*#__PURE__*/React.createElement(ImageGridList, {
|
|
86
|
-
images: IMAGES,
|
|
87
|
-
fixed: false
|
|
88
66
|
}));
|
|
89
67
|
};
|
|
90
68
|
|