You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
5390 lines
206 KiB
5390 lines
206 KiB
(self["webpackChunk"] = self["webpackChunk"] || []).push([[98506],{
|
|
|
|
/***/ 10263:
|
|
/*!******************************************************************************************************!*\
|
|
!*** ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/EditOutlined.js + 1 modules ***!
|
|
\******************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ icons_EditOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(5891);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/EditOutlined.js
|
|
// This icon file is generated automatically.
|
|
var EditOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z" } }] }, "name": "edit", "theme": "outlined" };
|
|
/* harmony default export */ var asn_EditOutlined = (EditOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
var AntdIcon = __webpack_require__(22589);
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.5.1@@ant-design/icons/es/icons/EditOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var EditOutlined_EditOutlined = function EditOutlined(props, ref) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_EditOutlined
|
|
}));
|
|
};
|
|
|
|
/** */
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(EditOutlined_EditOutlined);
|
|
if (false) {}
|
|
/* harmony default export */ var icons_EditOutlined = (RefIcon);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 57642:
|
|
/*!*************************************************************************************************!*\
|
|
!*** ./node_modules/_antd-img-crop@4.23.0@antd-img-crop/dist/antd-img-crop.esm.js + 19 modules ***!
|
|
\*************************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// UNUSED EXPORTS: default
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_tslib@2.8.1@tslib/tslib.es6.mjs
|
|
/******************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */
|
|
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
|
|
var extendStatics = function(d, b) {
|
|
extendStatics = Object.setPrototypeOf ||
|
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
return extendStatics(d, b);
|
|
};
|
|
|
|
function __extends(d, b) {
|
|
if (typeof b !== "function" && b !== null)
|
|
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
extendStatics(d, b);
|
|
function __() { this.constructor = d; }
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
}
|
|
|
|
var __assign = function() {
|
|
__assign = Object.assign || function __assign(t) {
|
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
s = arguments[i];
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
}
|
|
return t;
|
|
}
|
|
return __assign.apply(this, arguments);
|
|
}
|
|
|
|
function __rest(s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
}
|
|
|
|
function __decorate(decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
}
|
|
|
|
function __param(paramIndex, decorator) {
|
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
}
|
|
|
|
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
var _, done = false;
|
|
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
var context = {};
|
|
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
if (kind === "accessor") {
|
|
if (result === void 0) continue;
|
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
if (_ = accept(result.get)) descriptor.get = _;
|
|
if (_ = accept(result.set)) descriptor.set = _;
|
|
if (_ = accept(result.init)) initializers.unshift(_);
|
|
}
|
|
else if (_ = accept(result)) {
|
|
if (kind === "field") initializers.unshift(_);
|
|
else descriptor[key] = _;
|
|
}
|
|
}
|
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
done = true;
|
|
};
|
|
|
|
function __runInitializers(thisArg, initializers, value) {
|
|
var useValue = arguments.length > 2;
|
|
for (var i = 0; i < initializers.length; i++) {
|
|
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
}
|
|
return useValue ? value : void 0;
|
|
};
|
|
|
|
function __propKey(x) {
|
|
return typeof x === "symbol" ? x : "".concat(x);
|
|
};
|
|
|
|
function __setFunctionName(f, name, prefix) {
|
|
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
};
|
|
|
|
function __metadata(metadataKey, metadataValue) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
}
|
|
|
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
}
|
|
|
|
function __generator(thisArg, body) {
|
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
function step(op) {
|
|
if (f) throw new TypeError("Generator is already executing.");
|
|
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
switch (op[0]) {
|
|
case 0: case 1: t = op; break;
|
|
case 4: _.label++; return { value: op[1], done: false };
|
|
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
default:
|
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
if (t[2]) _.ops.pop();
|
|
_.trys.pop(); continue;
|
|
}
|
|
op = body.call(thisArg, _);
|
|
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
}
|
|
}
|
|
|
|
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
}
|
|
Object.defineProperty(o, k2, desc);
|
|
}) : (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
o[k2] = m[k];
|
|
});
|
|
|
|
function __exportStar(m, o) {
|
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
|
}
|
|
|
|
function __values(o) {
|
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
if (m) return m.call(o);
|
|
if (o && typeof o.length === "number") return {
|
|
next: function () {
|
|
if (o && i >= o.length) o = void 0;
|
|
return { value: o && o[i++], done: !o };
|
|
}
|
|
};
|
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
}
|
|
|
|
function __read(o, n) {
|
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
if (!m) return o;
|
|
var i = m.call(o), r, ar = [], e;
|
|
try {
|
|
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
}
|
|
catch (error) { e = { error: error }; }
|
|
finally {
|
|
try {
|
|
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
}
|
|
finally { if (e) throw e.error; }
|
|
}
|
|
return ar;
|
|
}
|
|
|
|
/** @deprecated */
|
|
function __spread() {
|
|
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
ar = ar.concat(__read(arguments[i]));
|
|
return ar;
|
|
}
|
|
|
|
/** @deprecated */
|
|
function __spreadArrays() {
|
|
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
r[k] = a[j];
|
|
return r;
|
|
}
|
|
|
|
function __spreadArray(to, from, pack) {
|
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
if (ar || !(i in from)) {
|
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
ar[i] = from[i];
|
|
}
|
|
}
|
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
}
|
|
|
|
function __await(v) {
|
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
}
|
|
|
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
function fulfill(value) { resume("next", value); }
|
|
function reject(value) { resume("throw", value); }
|
|
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
}
|
|
|
|
function __asyncDelegator(o) {
|
|
var i, p;
|
|
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
}
|
|
|
|
function __asyncValues(o) {
|
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
var m = o[Symbol.asyncIterator], i;
|
|
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
}
|
|
|
|
function __makeTemplateObject(cooked, raw) {
|
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
return cooked;
|
|
};
|
|
|
|
var __setModuleDefault = Object.create ? (function(o, v) {
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
}) : function(o, v) {
|
|
o["default"] = v;
|
|
};
|
|
|
|
var ownKeys = function(o) {
|
|
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
var ar = [];
|
|
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
return ar;
|
|
};
|
|
return ownKeys(o);
|
|
};
|
|
|
|
function __importStar(mod) {
|
|
if (mod && mod.__esModule) return mod;
|
|
var result = {};
|
|
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
__setModuleDefault(result, mod);
|
|
return result;
|
|
}
|
|
|
|
function __importDefault(mod) {
|
|
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
}
|
|
|
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
}
|
|
|
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
}
|
|
|
|
function __classPrivateFieldIn(state, receiver) {
|
|
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
|
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
}
|
|
|
|
function __addDisposableResource(env, value, async) {
|
|
if (value !== null && value !== void 0) {
|
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
var dispose, inner;
|
|
if (async) {
|
|
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
dispose = value[Symbol.asyncDispose];
|
|
}
|
|
if (dispose === void 0) {
|
|
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
dispose = value[Symbol.dispose];
|
|
if (async) inner = dispose;
|
|
}
|
|
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
}
|
|
else if (async) {
|
|
env.stack.push({ async: true });
|
|
}
|
|
return value;
|
|
}
|
|
|
|
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
var e = new Error(message);
|
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
};
|
|
|
|
function __disposeResources(env) {
|
|
function fail(e) {
|
|
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
env.hasError = true;
|
|
}
|
|
var r, s = 0;
|
|
function next() {
|
|
while (r = env.stack.pop()) {
|
|
try {
|
|
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
if (r.dispose) {
|
|
var result = r.dispose.call(r.value);
|
|
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
}
|
|
else s |= 1;
|
|
}
|
|
catch (e) {
|
|
fail(e);
|
|
}
|
|
}
|
|
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
if (env.hasError) throw env.error;
|
|
}
|
|
return next();
|
|
}
|
|
|
|
function __rewriteRelativeImportExtension(path, preserveJsx) {
|
|
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
});
|
|
}
|
|
return path;
|
|
}
|
|
|
|
/* harmony default export */ var tslib_es6 = ({
|
|
__extends,
|
|
__assign,
|
|
__rest,
|
|
__decorate,
|
|
__param,
|
|
__esDecorate,
|
|
__runInitializers,
|
|
__propKey,
|
|
__setFunctionName,
|
|
__metadata,
|
|
__awaiter,
|
|
__generator,
|
|
__createBinding,
|
|
__exportStar,
|
|
__values,
|
|
__read,
|
|
__spread,
|
|
__spreadArrays,
|
|
__spreadArray,
|
|
__await,
|
|
__asyncGenerator,
|
|
__asyncDelegator,
|
|
__asyncValues,
|
|
__makeTemplateObject,
|
|
__importStar,
|
|
__importDefault,
|
|
__classPrivateFieldGet,
|
|
__classPrivateFieldSet,
|
|
__classPrivateFieldIn,
|
|
__addDisposableResource,
|
|
__disposeResources,
|
|
__rewriteRelativeImportExtension,
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/upload/index.js + 24 modules
|
|
var upload = __webpack_require__(59028);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(80962);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(26390);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
var slicedToArray = __webpack_require__(29043);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/typeof.js
|
|
var esm_typeof = __webpack_require__(80665);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/isEqual.js
|
|
var isEqual = __webpack_require__(20176);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/hooks/useMergedState.js
|
|
var useMergedState = __webpack_require__(71366);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(5891);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(19149);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.26.0@@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(57259);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/KeyCode.js
|
|
var KeyCode = __webpack_require__(20287);
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/context.js
|
|
|
|
var SliderContext = /*#__PURE__*/_react_17_0_2_react.createContext({
|
|
min: 0,
|
|
max: 0,
|
|
direction: 'ltr',
|
|
step: 1,
|
|
includedStart: 0,
|
|
includedEnd: 0,
|
|
tabIndex: 0,
|
|
keyboard: true
|
|
});
|
|
/* harmony default export */ var es_context = (SliderContext);
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/util.js
|
|
function getOffset(value, min, max) {
|
|
return (value - min) / (max - min);
|
|
}
|
|
function getDirectionStyle(direction, value, min, max) {
|
|
var offset = getOffset(value, min, max);
|
|
var positionStyle = {};
|
|
switch (direction) {
|
|
case 'rtl':
|
|
positionStyle.right = "".concat(offset * 100, "%");
|
|
positionStyle.transform = 'translateX(50%)';
|
|
break;
|
|
case 'btt':
|
|
positionStyle.bottom = "".concat(offset * 100, "%");
|
|
positionStyle.transform = 'translateY(50%)';
|
|
break;
|
|
case 'ttb':
|
|
positionStyle.top = "".concat(offset * 100, "%");
|
|
positionStyle.transform = 'translateY(-50%)';
|
|
break;
|
|
default:
|
|
positionStyle.left = "".concat(offset * 100, "%");
|
|
positionStyle.transform = 'translateX(-50%)';
|
|
break;
|
|
}
|
|
return positionStyle;
|
|
}
|
|
/** Return index value if is list or return value directly */
|
|
function getIndex(value, index) {
|
|
return Array.isArray(value) ? value[index] : value;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/Handles/Handle.js
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "value", "valueIndex", "onStartMove", "style", "render", "dragging", "onOffsetChange"];
|
|
|
|
|
|
|
|
|
|
|
|
var Handle = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref) {
|
|
var _classNames, _getIndex;
|
|
var prefixCls = props.prefixCls,
|
|
value = props.value,
|
|
valueIndex = props.valueIndex,
|
|
onStartMove = props.onStartMove,
|
|
style = props.style,
|
|
render = props.render,
|
|
dragging = props.dragging,
|
|
onOffsetChange = props.onOffsetChange,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
|
|
var _React$useContext = _react_17_0_2_react.useContext(es_context),
|
|
min = _React$useContext.min,
|
|
max = _React$useContext.max,
|
|
direction = _React$useContext.direction,
|
|
disabled = _React$useContext.disabled,
|
|
keyboard = _React$useContext.keyboard,
|
|
range = _React$useContext.range,
|
|
tabIndex = _React$useContext.tabIndex,
|
|
ariaLabelForHandle = _React$useContext.ariaLabelForHandle,
|
|
ariaLabelledByForHandle = _React$useContext.ariaLabelledByForHandle,
|
|
ariaValueTextFormatterForHandle = _React$useContext.ariaValueTextFormatterForHandle;
|
|
var handlePrefixCls = "".concat(prefixCls, "-handle");
|
|
// ============================ Events ============================
|
|
var onInternalStartMove = function onInternalStartMove(e) {
|
|
if (!disabled) {
|
|
onStartMove(e, valueIndex);
|
|
}
|
|
};
|
|
// =========================== Keyboard ===========================
|
|
var onKeyDown = function onKeyDown(e) {
|
|
if (!disabled && keyboard) {
|
|
var offset = null;
|
|
// Change the value
|
|
switch (e.which || e.keyCode) {
|
|
case KeyCode/* default */.Z.LEFT:
|
|
offset = direction === 'ltr' || direction === 'btt' ? -1 : 1;
|
|
break;
|
|
case KeyCode/* default */.Z.RIGHT:
|
|
offset = direction === 'ltr' || direction === 'btt' ? 1 : -1;
|
|
break;
|
|
// Up is plus
|
|
case KeyCode/* default */.Z.UP:
|
|
offset = direction !== 'ttb' ? 1 : -1;
|
|
break;
|
|
// Down is minus
|
|
case KeyCode/* default */.Z.DOWN:
|
|
offset = direction !== 'ttb' ? -1 : 1;
|
|
break;
|
|
case KeyCode/* default */.Z.HOME:
|
|
offset = 'min';
|
|
break;
|
|
case KeyCode/* default */.Z.END:
|
|
offset = 'max';
|
|
break;
|
|
case KeyCode/* default */.Z.PAGE_UP:
|
|
offset = 2;
|
|
break;
|
|
case KeyCode/* default */.Z.PAGE_DOWN:
|
|
offset = -2;
|
|
break;
|
|
}
|
|
if (offset !== null) {
|
|
e.preventDefault();
|
|
onOffsetChange(offset, valueIndex);
|
|
}
|
|
}
|
|
};
|
|
// ============================ Offset ============================
|
|
var positionStyle = getDirectionStyle(direction, value, min, max);
|
|
// ============================ Render ============================
|
|
var handleNode = /*#__PURE__*/_react_17_0_2_react.createElement("div", (0,esm_extends/* default */.Z)({
|
|
ref: ref,
|
|
className: _classnames_2_5_1_classnames_default()(handlePrefixCls, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(handlePrefixCls, "-").concat(valueIndex + 1), range), (0,defineProperty/* default */.Z)(_classNames, "".concat(handlePrefixCls, "-dragging"), dragging), _classNames)),
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, positionStyle), style),
|
|
onMouseDown: onInternalStartMove,
|
|
onTouchStart: onInternalStartMove,
|
|
onKeyDown: onKeyDown,
|
|
tabIndex: disabled ? null : getIndex(tabIndex, valueIndex),
|
|
role: "slider",
|
|
"aria-valuemin": min,
|
|
"aria-valuemax": max,
|
|
"aria-valuenow": value,
|
|
"aria-disabled": disabled,
|
|
"aria-label": getIndex(ariaLabelForHandle, valueIndex),
|
|
"aria-labelledby": getIndex(ariaLabelledByForHandle, valueIndex),
|
|
"aria-valuetext": (_getIndex = getIndex(ariaValueTextFormatterForHandle, valueIndex)) === null || _getIndex === void 0 ? void 0 : _getIndex(value),
|
|
"aria-orientation": direction === 'ltr' || direction === 'rtl' ? 'horizontal' : 'vertical'
|
|
}, restProps));
|
|
// Customize
|
|
if (render) {
|
|
handleNode = render(handleNode, {
|
|
index: valueIndex,
|
|
prefixCls: prefixCls,
|
|
value: value,
|
|
dragging: dragging
|
|
});
|
|
}
|
|
return handleNode;
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var Handles_Handle = (Handle);
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/Handles/index.js
|
|
|
|
|
|
var Handles_excluded = ["prefixCls", "style", "onStartMove", "onOffsetChange", "values", "handleRender", "draggingIndex"];
|
|
|
|
|
|
|
|
var Handles = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref) {
|
|
var prefixCls = props.prefixCls,
|
|
style = props.style,
|
|
onStartMove = props.onStartMove,
|
|
onOffsetChange = props.onOffsetChange,
|
|
values = props.values,
|
|
handleRender = props.handleRender,
|
|
draggingIndex = props.draggingIndex,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, Handles_excluded);
|
|
var handlesRef = _react_17_0_2_react.useRef({});
|
|
_react_17_0_2_react.useImperativeHandle(ref, function () {
|
|
return {
|
|
focus: function focus(index) {
|
|
var _handlesRef$current$i;
|
|
(_handlesRef$current$i = handlesRef.current[index]) === null || _handlesRef$current$i === void 0 ? void 0 : _handlesRef$current$i.focus();
|
|
}
|
|
};
|
|
});
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, values.map(function (value, index) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Handles_Handle, (0,esm_extends/* default */.Z)({
|
|
ref: function ref(node) {
|
|
if (!node) {
|
|
delete handlesRef.current[index];
|
|
} else {
|
|
handlesRef.current[index] = node;
|
|
}
|
|
},
|
|
dragging: draggingIndex === index,
|
|
prefixCls: prefixCls,
|
|
style: getIndex(style, index),
|
|
key: index,
|
|
value: value,
|
|
valueIndex: index,
|
|
onStartMove: onStartMove,
|
|
onOffsetChange: onOffsetChange,
|
|
render: handleRender
|
|
}, restProps));
|
|
}));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var es_Handles = (Handles);
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/hooks/useDrag.js
|
|
|
|
|
|
|
|
function getPosition(e) {
|
|
var obj = 'touches' in e ? e.touches[0] : e;
|
|
return {
|
|
pageX: obj.pageX,
|
|
pageY: obj.pageY
|
|
};
|
|
}
|
|
function useDrag(containerRef, direction, rawValues, min, max, formatValue, triggerChange, finishChange, offsetValues) {
|
|
var _React$useState = _react_17_0_2_react.useState(null),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
draggingValue = _React$useState2[0],
|
|
setDraggingValue = _React$useState2[1];
|
|
var _React$useState3 = _react_17_0_2_react.useState(-1),
|
|
_React$useState4 = (0,slicedToArray/* default */.Z)(_React$useState3, 2),
|
|
draggingIndex = _React$useState4[0],
|
|
setDraggingIndex = _React$useState4[1];
|
|
var _React$useState5 = _react_17_0_2_react.useState(rawValues),
|
|
_React$useState6 = (0,slicedToArray/* default */.Z)(_React$useState5, 2),
|
|
cacheValues = _React$useState6[0],
|
|
setCacheValues = _React$useState6[1];
|
|
var _React$useState7 = _react_17_0_2_react.useState(rawValues),
|
|
_React$useState8 = (0,slicedToArray/* default */.Z)(_React$useState7, 2),
|
|
originValues = _React$useState8[0],
|
|
setOriginValues = _React$useState8[1];
|
|
var mouseMoveEventRef = _react_17_0_2_react.useRef(null);
|
|
var mouseUpEventRef = _react_17_0_2_react.useRef(null);
|
|
_react_17_0_2_react.useEffect(function () {
|
|
if (draggingIndex === -1) {
|
|
setCacheValues(rawValues);
|
|
}
|
|
}, [rawValues, draggingIndex]);
|
|
// Clean up event
|
|
_react_17_0_2_react.useEffect(function () {
|
|
return function () {
|
|
document.removeEventListener('mousemove', mouseMoveEventRef.current);
|
|
document.removeEventListener('mouseup', mouseUpEventRef.current);
|
|
document.removeEventListener('touchmove', mouseMoveEventRef.current);
|
|
document.removeEventListener('touchend', mouseUpEventRef.current);
|
|
};
|
|
}, []);
|
|
var flushValues = function flushValues(nextValues, nextValue) {
|
|
// Perf: Only update state when value changed
|
|
if (cacheValues.some(function (val, i) {
|
|
return val !== nextValues[i];
|
|
})) {
|
|
if (nextValue !== undefined) {
|
|
setDraggingValue(nextValue);
|
|
}
|
|
setCacheValues(nextValues);
|
|
triggerChange(nextValues);
|
|
}
|
|
};
|
|
var updateCacheValue = function updateCacheValue(valueIndex, offsetPercent) {
|
|
// Basic point offset
|
|
if (valueIndex === -1) {
|
|
// >>>> Dragging on the track
|
|
var startValue = originValues[0];
|
|
var endValue = originValues[originValues.length - 1];
|
|
var maxStartOffset = min - startValue;
|
|
var maxEndOffset = max - endValue;
|
|
// Get valid offset
|
|
var offset = offsetPercent * (max - min);
|
|
offset = Math.max(offset, maxStartOffset);
|
|
offset = Math.min(offset, maxEndOffset);
|
|
// Use first value to revert back of valid offset (like steps marks)
|
|
var formatStartValue = formatValue(startValue + offset);
|
|
offset = formatStartValue - startValue;
|
|
var cloneCacheValues = originValues.map(function (val) {
|
|
return val + offset;
|
|
});
|
|
flushValues(cloneCacheValues);
|
|
} else {
|
|
// >>>> Dragging on the handle
|
|
var offsetDist = (max - min) * offsetPercent;
|
|
// Always start with the valueIndex origin value
|
|
var cloneValues = (0,toConsumableArray/* default */.Z)(cacheValues);
|
|
cloneValues[valueIndex] = originValues[valueIndex];
|
|
var next = offsetValues(cloneValues, offsetDist, valueIndex, 'dist');
|
|
flushValues(next.values, next.value);
|
|
}
|
|
};
|
|
// Resolve closure
|
|
var updateCacheValueRef = _react_17_0_2_react.useRef(updateCacheValue);
|
|
updateCacheValueRef.current = updateCacheValue;
|
|
var onStartMove = function onStartMove(e, valueIndex) {
|
|
e.stopPropagation();
|
|
var originValue = rawValues[valueIndex];
|
|
setDraggingIndex(valueIndex);
|
|
setDraggingValue(originValue);
|
|
setOriginValues(rawValues);
|
|
var _getPosition = getPosition(e),
|
|
startX = _getPosition.pageX,
|
|
startY = _getPosition.pageY;
|
|
// Moving
|
|
var onMouseMove = function onMouseMove(event) {
|
|
event.preventDefault();
|
|
var _getPosition2 = getPosition(event),
|
|
moveX = _getPosition2.pageX,
|
|
moveY = _getPosition2.pageY;
|
|
var offsetX = moveX - startX;
|
|
var offsetY = moveY - startY;
|
|
var _containerRef$current = containerRef.current.getBoundingClientRect(),
|
|
width = _containerRef$current.width,
|
|
height = _containerRef$current.height;
|
|
var offSetPercent;
|
|
switch (direction) {
|
|
case 'btt':
|
|
offSetPercent = -offsetY / height;
|
|
break;
|
|
case 'ttb':
|
|
offSetPercent = offsetY / height;
|
|
break;
|
|
case 'rtl':
|
|
offSetPercent = -offsetX / width;
|
|
break;
|
|
default:
|
|
offSetPercent = offsetX / width;
|
|
}
|
|
updateCacheValueRef.current(valueIndex, offSetPercent);
|
|
};
|
|
// End
|
|
var onMouseUp = function onMouseUp(event) {
|
|
event.preventDefault();
|
|
document.removeEventListener('mouseup', onMouseUp);
|
|
document.removeEventListener('mousemove', onMouseMove);
|
|
document.removeEventListener('touchend', onMouseUp);
|
|
document.removeEventListener('touchmove', onMouseMove);
|
|
mouseMoveEventRef.current = null;
|
|
mouseUpEventRef.current = null;
|
|
setDraggingIndex(-1);
|
|
finishChange();
|
|
};
|
|
document.addEventListener('mouseup', onMouseUp);
|
|
document.addEventListener('mousemove', onMouseMove);
|
|
document.addEventListener('touchend', onMouseUp);
|
|
document.addEventListener('touchmove', onMouseMove);
|
|
mouseMoveEventRef.current = onMouseMove;
|
|
mouseUpEventRef.current = onMouseUp;
|
|
};
|
|
// Only return cache value when it mapping with rawValues
|
|
var returnValues = _react_17_0_2_react.useMemo(function () {
|
|
var sourceValues = (0,toConsumableArray/* default */.Z)(rawValues).sort(function (a, b) {
|
|
return a - b;
|
|
});
|
|
var targetValues = (0,toConsumableArray/* default */.Z)(cacheValues).sort(function (a, b) {
|
|
return a - b;
|
|
});
|
|
return sourceValues.every(function (val, index) {
|
|
return val === targetValues[index];
|
|
}) ? cacheValues : rawValues;
|
|
}, [rawValues, cacheValues]);
|
|
return [draggingIndex, draggingValue, returnValues, onStartMove];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/Tracks/Track.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Track(props) {
|
|
var _classNames;
|
|
var prefixCls = props.prefixCls,
|
|
style = props.style,
|
|
start = props.start,
|
|
end = props.end,
|
|
index = props.index,
|
|
onStartMove = props.onStartMove;
|
|
var _React$useContext = _react_17_0_2_react.useContext(es_context),
|
|
direction = _React$useContext.direction,
|
|
min = _React$useContext.min,
|
|
max = _React$useContext.max,
|
|
disabled = _React$useContext.disabled,
|
|
range = _React$useContext.range;
|
|
var trackPrefixCls = "".concat(prefixCls, "-track");
|
|
var offsetStart = getOffset(start, min, max);
|
|
var offsetEnd = getOffset(end, min, max);
|
|
// ============================ Events ============================
|
|
var onInternalStartMove = function onInternalStartMove(e) {
|
|
if (!disabled && onStartMove) {
|
|
onStartMove(e, -1);
|
|
}
|
|
};
|
|
// ============================ Render ============================
|
|
var positionStyle = {};
|
|
switch (direction) {
|
|
case 'rtl':
|
|
positionStyle.right = "".concat(offsetStart * 100, "%");
|
|
positionStyle.width = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
|
|
break;
|
|
case 'btt':
|
|
positionStyle.bottom = "".concat(offsetStart * 100, "%");
|
|
positionStyle.height = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
|
|
break;
|
|
case 'ttb':
|
|
positionStyle.top = "".concat(offsetStart * 100, "%");
|
|
positionStyle.height = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
|
|
break;
|
|
default:
|
|
positionStyle.left = "".concat(offsetStart * 100, "%");
|
|
positionStyle.width = "".concat(offsetEnd * 100 - offsetStart * 100, "%");
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: _classnames_2_5_1_classnames_default()(trackPrefixCls, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(trackPrefixCls, "-").concat(index + 1), range), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-track-draggable"), onStartMove), _classNames)),
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, positionStyle), style),
|
|
onMouseDown: onInternalStartMove,
|
|
onTouchStart: onInternalStartMove
|
|
});
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/Tracks/index.js
|
|
|
|
|
|
|
|
|
|
function Tracks(props) {
|
|
var prefixCls = props.prefixCls,
|
|
style = props.style,
|
|
values = props.values,
|
|
startPoint = props.startPoint,
|
|
onStartMove = props.onStartMove;
|
|
var _React$useContext = _react_17_0_2_react.useContext(es_context),
|
|
included = _React$useContext.included,
|
|
range = _React$useContext.range,
|
|
min = _React$useContext.min;
|
|
var trackList = _react_17_0_2_react.useMemo(function () {
|
|
if (!range) {
|
|
// null value do not have track
|
|
if (values.length === 0) {
|
|
return [];
|
|
}
|
|
var startValue = startPoint !== null && startPoint !== void 0 ? startPoint : min;
|
|
var endValue = values[0];
|
|
return [{
|
|
start: Math.min(startValue, endValue),
|
|
end: Math.max(startValue, endValue)
|
|
}];
|
|
}
|
|
// Multiple
|
|
var list = [];
|
|
for (var i = 0; i < values.length - 1; i += 1) {
|
|
list.push({
|
|
start: values[i],
|
|
end: values[i + 1]
|
|
});
|
|
}
|
|
return list;
|
|
}, [values, range, startPoint, min]);
|
|
return included ? trackList.map(function (_ref, index) {
|
|
var start = _ref.start,
|
|
end = _ref.end;
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Track, {
|
|
index: index,
|
|
prefixCls: prefixCls,
|
|
style: getIndex(style, index),
|
|
start: start,
|
|
end: end,
|
|
key: index,
|
|
onStartMove: onStartMove
|
|
});
|
|
}) : null;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/Marks/Mark.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Mark(props) {
|
|
var prefixCls = props.prefixCls,
|
|
style = props.style,
|
|
children = props.children,
|
|
value = props.value,
|
|
_onClick = props.onClick;
|
|
var _React$useContext = _react_17_0_2_react.useContext(es_context),
|
|
min = _React$useContext.min,
|
|
max = _React$useContext.max,
|
|
direction = _React$useContext.direction,
|
|
includedStart = _React$useContext.includedStart,
|
|
includedEnd = _React$useContext.includedEnd,
|
|
included = _React$useContext.included;
|
|
var textCls = "".concat(prefixCls, "-text");
|
|
// ============================ Offset ============================
|
|
var positionStyle = getDirectionStyle(direction, value, min, max);
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: _classnames_2_5_1_classnames_default()(textCls, (0,defineProperty/* default */.Z)({}, "".concat(textCls, "-active"), included && includedStart <= value && value <= includedEnd)),
|
|
style: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, positionStyle), style),
|
|
onMouseDown: function onMouseDown(e) {
|
|
e.stopPropagation();
|
|
},
|
|
onClick: function onClick() {
|
|
_onClick(value);
|
|
}
|
|
}, children);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/Marks/index.js
|
|
|
|
|
|
function Marks(props) {
|
|
var prefixCls = props.prefixCls,
|
|
marks = props.marks,
|
|
onClick = props.onClick;
|
|
var markPrefixCls = "".concat(prefixCls, "-mark");
|
|
// Not render mark if empty
|
|
if (!marks.length) {
|
|
return null;
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: markPrefixCls
|
|
}, marks.map(function (_ref) {
|
|
var value = _ref.value,
|
|
style = _ref.style,
|
|
label = _ref.label;
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Mark, {
|
|
key: value,
|
|
prefixCls: markPrefixCls,
|
|
style: style,
|
|
value: value,
|
|
onClick: onClick
|
|
}, label);
|
|
}));
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/Steps/Dot.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Dot(props) {
|
|
var prefixCls = props.prefixCls,
|
|
value = props.value,
|
|
style = props.style,
|
|
activeStyle = props.activeStyle;
|
|
var _React$useContext = _react_17_0_2_react.useContext(es_context),
|
|
min = _React$useContext.min,
|
|
max = _React$useContext.max,
|
|
direction = _React$useContext.direction,
|
|
included = _React$useContext.included,
|
|
includedStart = _React$useContext.includedStart,
|
|
includedEnd = _React$useContext.includedEnd;
|
|
var dotClassName = "".concat(prefixCls, "-dot");
|
|
var active = included && includedStart <= value && value <= includedEnd;
|
|
// ============================ Offset ============================
|
|
var mergedStyle = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, getDirectionStyle(direction, value, min, max)), typeof style === 'function' ? style(value) : style);
|
|
if (active) {
|
|
mergedStyle = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, mergedStyle), typeof activeStyle === 'function' ? activeStyle(value) : activeStyle);
|
|
}
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: _classnames_2_5_1_classnames_default()(dotClassName, (0,defineProperty/* default */.Z)({}, "".concat(dotClassName, "-active"), active)),
|
|
style: mergedStyle
|
|
});
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/Steps/index.js
|
|
|
|
|
|
|
|
function Steps(props) {
|
|
var prefixCls = props.prefixCls,
|
|
marks = props.marks,
|
|
dots = props.dots,
|
|
style = props.style,
|
|
activeStyle = props.activeStyle;
|
|
var _React$useContext = _react_17_0_2_react.useContext(es_context),
|
|
min = _React$useContext.min,
|
|
max = _React$useContext.max,
|
|
step = _React$useContext.step;
|
|
var stepDots = _react_17_0_2_react.useMemo(function () {
|
|
var dotSet = new Set();
|
|
// Add marks
|
|
marks.forEach(function (mark) {
|
|
dotSet.add(mark.value);
|
|
});
|
|
// Fill dots
|
|
if (dots && step !== null) {
|
|
var current = min;
|
|
while (current <= max) {
|
|
dotSet.add(current);
|
|
current += step;
|
|
}
|
|
}
|
|
return Array.from(dotSet);
|
|
}, [min, max, step, dots, marks]);
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: "".concat(prefixCls, "-step")
|
|
}, stepDots.map(function (dotValue) {
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Dot, {
|
|
prefixCls: prefixCls,
|
|
key: dotValue,
|
|
value: dotValue,
|
|
style: style,
|
|
activeStyle: activeStyle
|
|
});
|
|
}));
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/hooks/useOffset.js
|
|
|
|
|
|
function useOffset(min, max, step, markList, allowCross, pushable) {
|
|
var formatRangeValue = _react_17_0_2_react.useCallback(function (val) {
|
|
var formatNextValue = isFinite(val) ? val : min;
|
|
formatNextValue = Math.min(max, val);
|
|
formatNextValue = Math.max(min, formatNextValue);
|
|
return formatNextValue;
|
|
}, [min, max]);
|
|
var formatStepValue = _react_17_0_2_react.useCallback(function (val) {
|
|
if (step !== null) {
|
|
var stepValue = min + Math.round((formatRangeValue(val) - min) / step) * step;
|
|
// Cut number in case to be like 0.30000000000000004
|
|
var getDecimal = function getDecimal(num) {
|
|
return (String(num).split('.')[1] || '').length;
|
|
};
|
|
var maxDecimal = Math.max(getDecimal(step), getDecimal(max), getDecimal(min));
|
|
var fixedValue = Number(stepValue.toFixed(maxDecimal));
|
|
return min <= fixedValue && fixedValue <= max ? fixedValue : null;
|
|
}
|
|
return null;
|
|
}, [step, min, max, formatRangeValue]);
|
|
var formatValue = _react_17_0_2_react.useCallback(function (val) {
|
|
var formatNextValue = formatRangeValue(val);
|
|
// List align values
|
|
var alignValues = markList.map(function (mark) {
|
|
return mark.value;
|
|
});
|
|
if (step !== null) {
|
|
alignValues.push(formatStepValue(val));
|
|
}
|
|
// min & max
|
|
alignValues.push(min, max);
|
|
// Align with marks
|
|
var closeValue = alignValues[0];
|
|
var closeDist = max - min;
|
|
alignValues.forEach(function (alignValue) {
|
|
var dist = Math.abs(formatNextValue - alignValue);
|
|
if (dist <= closeDist) {
|
|
closeValue = alignValue;
|
|
closeDist = dist;
|
|
}
|
|
});
|
|
return closeValue;
|
|
}, [min, max, markList, step, formatRangeValue, formatStepValue]);
|
|
// ========================== Offset ==========================
|
|
// Single Value
|
|
var offsetValue = function offsetValue(values, offset, valueIndex) {
|
|
var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';
|
|
if (typeof offset === 'number') {
|
|
var nextValue;
|
|
var originValue = values[valueIndex];
|
|
// Only used for `dist` mode
|
|
var targetDistValue = originValue + offset;
|
|
// Compare next step value & mark value which is best match
|
|
var potentialValues = [];
|
|
markList.forEach(function (mark) {
|
|
potentialValues.push(mark.value);
|
|
});
|
|
// Min & Max
|
|
potentialValues.push(min, max);
|
|
// In case origin value is align with mark but not with step
|
|
potentialValues.push(formatStepValue(originValue));
|
|
// Put offset step value also
|
|
var sign = offset > 0 ? 1 : -1;
|
|
if (mode === 'unit') {
|
|
potentialValues.push(formatStepValue(originValue + sign * step));
|
|
} else {
|
|
potentialValues.push(formatStepValue(targetDistValue));
|
|
}
|
|
// Find close one
|
|
potentialValues = potentialValues.filter(function (val) {
|
|
return val !== null;
|
|
})
|
|
// Remove reverse value
|
|
.filter(function (val) {
|
|
return offset < 0 ? val <= originValue : val >= originValue;
|
|
});
|
|
if (mode === 'unit') {
|
|
// `unit` mode can not contain itself
|
|
potentialValues = potentialValues.filter(function (val) {
|
|
return val !== originValue;
|
|
});
|
|
}
|
|
var compareValue = mode === 'unit' ? originValue : targetDistValue;
|
|
nextValue = potentialValues[0];
|
|
var valueDist = Math.abs(nextValue - compareValue);
|
|
potentialValues.forEach(function (potentialValue) {
|
|
var dist = Math.abs(potentialValue - compareValue);
|
|
if (dist < valueDist) {
|
|
nextValue = potentialValue;
|
|
valueDist = dist;
|
|
}
|
|
});
|
|
// Out of range will back to range
|
|
if (nextValue === undefined) {
|
|
return offset < 0 ? min : max;
|
|
}
|
|
// `dist` mode
|
|
if (mode === 'dist') {
|
|
return nextValue;
|
|
}
|
|
// `unit` mode may need another round
|
|
if (Math.abs(offset) > 1) {
|
|
var cloneValues = (0,toConsumableArray/* default */.Z)(values);
|
|
cloneValues[valueIndex] = nextValue;
|
|
return offsetValue(cloneValues, offset - sign, valueIndex, mode);
|
|
}
|
|
return nextValue;
|
|
} else if (offset === 'min') {
|
|
return min;
|
|
} else if (offset === 'max') {
|
|
return max;
|
|
}
|
|
};
|
|
/** Same as `offsetValue` but return `changed` mark to tell value changed */
|
|
var offsetChangedValue = function offsetChangedValue(values, offset, valueIndex) {
|
|
var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';
|
|
var originValue = values[valueIndex];
|
|
var nextValue = offsetValue(values, offset, valueIndex, mode);
|
|
return {
|
|
value: nextValue,
|
|
changed: nextValue !== originValue
|
|
};
|
|
};
|
|
var needPush = function needPush(dist) {
|
|
return pushable === null && dist === 0 || typeof pushable === 'number' && dist < pushable;
|
|
};
|
|
// Values
|
|
var offsetValues = function offsetValues(values, offset, valueIndex) {
|
|
var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'unit';
|
|
var nextValues = values.map(formatValue);
|
|
var originValue = nextValues[valueIndex];
|
|
var nextValue = offsetValue(nextValues, offset, valueIndex, mode);
|
|
nextValues[valueIndex] = nextValue;
|
|
if (allowCross === false) {
|
|
// >>>>> Allow Cross
|
|
var pushNum = pushable || 0;
|
|
// ============ AllowCross ===============
|
|
if (valueIndex > 0 && nextValues[valueIndex - 1] !== originValue) {
|
|
nextValues[valueIndex] = Math.max(nextValues[valueIndex], nextValues[valueIndex - 1] + pushNum);
|
|
}
|
|
if (valueIndex < nextValues.length - 1 && nextValues[valueIndex + 1] !== originValue) {
|
|
nextValues[valueIndex] = Math.min(nextValues[valueIndex], nextValues[valueIndex + 1] - pushNum);
|
|
}
|
|
} else if (typeof pushable === 'number' || pushable === null) {
|
|
// >>>>> Pushable
|
|
// =============== Push ==================
|
|
// >>>>>> Basic push
|
|
// End values
|
|
for (var i = valueIndex + 1; i < nextValues.length; i += 1) {
|
|
var changed = true;
|
|
while (needPush(nextValues[i] - nextValues[i - 1]) && changed) {
|
|
var _offsetChangedValue = offsetChangedValue(nextValues, 1, i);
|
|
nextValues[i] = _offsetChangedValue.value;
|
|
changed = _offsetChangedValue.changed;
|
|
}
|
|
}
|
|
// Start values
|
|
for (var _i = valueIndex; _i > 0; _i -= 1) {
|
|
var _changed = true;
|
|
while (needPush(nextValues[_i] - nextValues[_i - 1]) && _changed) {
|
|
var _offsetChangedValue2 = offsetChangedValue(nextValues, -1, _i - 1);
|
|
nextValues[_i - 1] = _offsetChangedValue2.value;
|
|
_changed = _offsetChangedValue2.changed;
|
|
}
|
|
}
|
|
// >>>>> Revert back to safe push range
|
|
// End to Start
|
|
for (var _i2 = nextValues.length - 1; _i2 > 0; _i2 -= 1) {
|
|
var _changed2 = true;
|
|
while (needPush(nextValues[_i2] - nextValues[_i2 - 1]) && _changed2) {
|
|
var _offsetChangedValue3 = offsetChangedValue(nextValues, -1, _i2 - 1);
|
|
nextValues[_i2 - 1] = _offsetChangedValue3.value;
|
|
_changed2 = _offsetChangedValue3.changed;
|
|
}
|
|
}
|
|
// Start to End
|
|
for (var _i3 = 0; _i3 < nextValues.length - 1; _i3 += 1) {
|
|
var _changed3 = true;
|
|
while (needPush(nextValues[_i3 + 1] - nextValues[_i3]) && _changed3) {
|
|
var _offsetChangedValue4 = offsetChangedValue(nextValues, 1, _i3 + 1);
|
|
nextValues[_i3 + 1] = _offsetChangedValue4.value;
|
|
_changed3 = _offsetChangedValue4.changed;
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
value: nextValues[valueIndex],
|
|
values: nextValues
|
|
};
|
|
};
|
|
return [formatValue, offsetValues];
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/warning.js
|
|
var warning = __webpack_require__(85870);
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/Slider.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Slider = /*#__PURE__*/_react_17_0_2_react.forwardRef(function (props, ref) {
|
|
var _classNames;
|
|
var _props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-slider' : _props$prefixCls,
|
|
className = props.className,
|
|
style = props.style,
|
|
_props$disabled = props.disabled,
|
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
_props$keyboard = props.keyboard,
|
|
keyboard = _props$keyboard === void 0 ? true : _props$keyboard,
|
|
autoFocus = props.autoFocus,
|
|
onFocus = props.onFocus,
|
|
onBlur = props.onBlur,
|
|
_props$min = props.min,
|
|
min = _props$min === void 0 ? 0 : _props$min,
|
|
_props$max = props.max,
|
|
max = _props$max === void 0 ? 100 : _props$max,
|
|
_props$step = props.step,
|
|
step = _props$step === void 0 ? 1 : _props$step,
|
|
value = props.value,
|
|
defaultValue = props.defaultValue,
|
|
range = props.range,
|
|
count = props.count,
|
|
onChange = props.onChange,
|
|
onBeforeChange = props.onBeforeChange,
|
|
onAfterChange = props.onAfterChange,
|
|
_props$allowCross = props.allowCross,
|
|
allowCross = _props$allowCross === void 0 ? true : _props$allowCross,
|
|
_props$pushable = props.pushable,
|
|
pushable = _props$pushable === void 0 ? false : _props$pushable,
|
|
draggableTrack = props.draggableTrack,
|
|
reverse = props.reverse,
|
|
vertical = props.vertical,
|
|
_props$included = props.included,
|
|
included = _props$included === void 0 ? true : _props$included,
|
|
startPoint = props.startPoint,
|
|
trackStyle = props.trackStyle,
|
|
handleStyle = props.handleStyle,
|
|
railStyle = props.railStyle,
|
|
dotStyle = props.dotStyle,
|
|
activeDotStyle = props.activeDotStyle,
|
|
marks = props.marks,
|
|
dots = props.dots,
|
|
handleRender = props.handleRender,
|
|
_props$tabIndex = props.tabIndex,
|
|
tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
|
|
ariaLabelForHandle = props.ariaLabelForHandle,
|
|
ariaLabelledByForHandle = props.ariaLabelledByForHandle,
|
|
ariaValueTextFormatterForHandle = props.ariaValueTextFormatterForHandle;
|
|
var handlesRef = _react_17_0_2_react.useRef();
|
|
var containerRef = _react_17_0_2_react.useRef();
|
|
var direction = _react_17_0_2_react.useMemo(function () {
|
|
if (vertical) {
|
|
return reverse ? 'ttb' : 'btt';
|
|
}
|
|
return reverse ? 'rtl' : 'ltr';
|
|
}, [reverse, vertical]);
|
|
// ============================ Range =============================
|
|
var mergedMin = _react_17_0_2_react.useMemo(function () {
|
|
return isFinite(min) ? min : 0;
|
|
}, [min]);
|
|
var mergedMax = _react_17_0_2_react.useMemo(function () {
|
|
return isFinite(max) ? max : 100;
|
|
}, [max]);
|
|
// ============================= Step =============================
|
|
var mergedStep = _react_17_0_2_react.useMemo(function () {
|
|
return step !== null && step <= 0 ? 1 : step;
|
|
}, [step]);
|
|
// ============================= Push =============================
|
|
var mergedPush = _react_17_0_2_react.useMemo(function () {
|
|
if (typeof pushable === 'boolean') {
|
|
return pushable ? mergedStep : false;
|
|
}
|
|
return pushable >= 0 ? pushable : false;
|
|
}, [pushable, mergedStep]);
|
|
// ============================ Marks =============================
|
|
var markList = _react_17_0_2_react.useMemo(function () {
|
|
var keys = Object.keys(marks || {});
|
|
return keys.map(function (key) {
|
|
var mark = marks[key];
|
|
var markObj = {
|
|
value: Number(key)
|
|
};
|
|
if (mark && (0,esm_typeof/* default */.Z)(mark) === 'object' && ! /*#__PURE__*/_react_17_0_2_react.isValidElement(mark) && ('label' in mark || 'style' in mark)) {
|
|
markObj.style = mark.style;
|
|
markObj.label = mark.label;
|
|
} else {
|
|
markObj.label = mark;
|
|
}
|
|
return markObj;
|
|
}).filter(function (_ref) {
|
|
var label = _ref.label;
|
|
return label || typeof label === 'number';
|
|
}).sort(function (a, b) {
|
|
return a.value - b.value;
|
|
});
|
|
}, [marks]);
|
|
// ============================ Format ============================
|
|
var _useOffset = useOffset(mergedMin, mergedMax, mergedStep, markList, allowCross, mergedPush),
|
|
_useOffset2 = (0,slicedToArray/* default */.Z)(_useOffset, 2),
|
|
formatValue = _useOffset2[0],
|
|
offsetValues = _useOffset2[1];
|
|
// ============================ Values ============================
|
|
var _useMergedState = (0,useMergedState/* default */.Z)(defaultValue, {
|
|
value: value
|
|
}),
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
mergedValue = _useMergedState2[0],
|
|
setValue = _useMergedState2[1];
|
|
var rawValues = _react_17_0_2_react.useMemo(function () {
|
|
var valueList = mergedValue === null || mergedValue === undefined ? [] : Array.isArray(mergedValue) ? mergedValue : [mergedValue];
|
|
var _valueList = (0,slicedToArray/* default */.Z)(valueList, 1),
|
|
_valueList$ = _valueList[0],
|
|
val0 = _valueList$ === void 0 ? mergedMin : _valueList$;
|
|
var returnValues = mergedValue === null ? [] : [val0];
|
|
// Format as range
|
|
if (range) {
|
|
returnValues = (0,toConsumableArray/* default */.Z)(valueList);
|
|
// When count provided or value is `undefined`, we fill values
|
|
if (count || mergedValue === undefined) {
|
|
var pointCount = count >= 0 ? count + 1 : 2;
|
|
returnValues = returnValues.slice(0, pointCount);
|
|
// Fill with count
|
|
while (returnValues.length < pointCount) {
|
|
var _returnValues;
|
|
returnValues.push((_returnValues = returnValues[returnValues.length - 1]) !== null && _returnValues !== void 0 ? _returnValues : mergedMin);
|
|
}
|
|
}
|
|
returnValues.sort(function (a, b) {
|
|
return a - b;
|
|
});
|
|
}
|
|
// Align in range
|
|
returnValues.forEach(function (val, index) {
|
|
returnValues[index] = formatValue(val);
|
|
});
|
|
return returnValues;
|
|
}, [mergedValue, range, mergedMin, count, formatValue]);
|
|
// =========================== onChange ===========================
|
|
var rawValuesRef = _react_17_0_2_react.useRef(rawValues);
|
|
rawValuesRef.current = rawValues;
|
|
var getTriggerValue = function getTriggerValue(triggerValues) {
|
|
return range ? triggerValues : triggerValues[0];
|
|
};
|
|
var triggerChange = function triggerChange(nextValues) {
|
|
// Order first
|
|
var cloneNextValues = (0,toConsumableArray/* default */.Z)(nextValues).sort(function (a, b) {
|
|
return a - b;
|
|
});
|
|
// Trigger event if needed
|
|
if (onChange && !(0,isEqual/* default */.Z)(cloneNextValues, rawValuesRef.current, true)) {
|
|
onChange(getTriggerValue(cloneNextValues));
|
|
}
|
|
// We set this later since it will re-render component immediately
|
|
setValue(cloneNextValues);
|
|
};
|
|
var changeToCloseValue = function changeToCloseValue(newValue) {
|
|
if (!disabled) {
|
|
var valueIndex = 0;
|
|
var valueDist = mergedMax - mergedMin;
|
|
rawValues.forEach(function (val, index) {
|
|
var dist = Math.abs(newValue - val);
|
|
if (dist <= valueDist) {
|
|
valueDist = dist;
|
|
valueIndex = index;
|
|
}
|
|
});
|
|
// Create new values
|
|
var cloneNextValues = (0,toConsumableArray/* default */.Z)(rawValues);
|
|
cloneNextValues[valueIndex] = newValue;
|
|
// Fill value to match default 2
|
|
if (range && !rawValues.length && count === undefined) {
|
|
cloneNextValues.push(newValue);
|
|
}
|
|
onBeforeChange === null || onBeforeChange === void 0 ? void 0 : onBeforeChange(getTriggerValue(cloneNextValues));
|
|
triggerChange(cloneNextValues);
|
|
onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(getTriggerValue(cloneNextValues));
|
|
}
|
|
};
|
|
// ============================ Click =============================
|
|
var onSliderMouseDown = function onSliderMouseDown(e) {
|
|
e.preventDefault();
|
|
var _containerRef$current = containerRef.current.getBoundingClientRect(),
|
|
width = _containerRef$current.width,
|
|
height = _containerRef$current.height,
|
|
left = _containerRef$current.left,
|
|
top = _containerRef$current.top,
|
|
bottom = _containerRef$current.bottom,
|
|
right = _containerRef$current.right;
|
|
var clientX = e.clientX,
|
|
clientY = e.clientY;
|
|
var percent;
|
|
switch (direction) {
|
|
case 'btt':
|
|
percent = (bottom - clientY) / height;
|
|
break;
|
|
case 'ttb':
|
|
percent = (clientY - top) / height;
|
|
break;
|
|
case 'rtl':
|
|
percent = (right - clientX) / width;
|
|
break;
|
|
default:
|
|
percent = (clientX - left) / width;
|
|
}
|
|
var nextValue = mergedMin + percent * (mergedMax - mergedMin);
|
|
changeToCloseValue(formatValue(nextValue));
|
|
};
|
|
// =========================== Keyboard ===========================
|
|
var _React$useState = _react_17_0_2_react.useState(null),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
keyboardValue = _React$useState2[0],
|
|
setKeyboardValue = _React$useState2[1];
|
|
var onHandleOffsetChange = function onHandleOffsetChange(offset, valueIndex) {
|
|
if (!disabled) {
|
|
var next = offsetValues(rawValues, offset, valueIndex);
|
|
onBeforeChange === null || onBeforeChange === void 0 ? void 0 : onBeforeChange(getTriggerValue(rawValues));
|
|
triggerChange(next.values);
|
|
onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(getTriggerValue(next.values));
|
|
setKeyboardValue(next.value);
|
|
}
|
|
};
|
|
_react_17_0_2_react.useEffect(function () {
|
|
if (keyboardValue !== null) {
|
|
var valueIndex = rawValues.indexOf(keyboardValue);
|
|
if (valueIndex >= 0) {
|
|
handlesRef.current.focus(valueIndex);
|
|
}
|
|
}
|
|
setKeyboardValue(null);
|
|
}, [keyboardValue]);
|
|
// ============================= Drag =============================
|
|
var mergedDraggableTrack = _react_17_0_2_react.useMemo(function () {
|
|
if (draggableTrack && mergedStep === null) {
|
|
if (false) {}
|
|
return false;
|
|
}
|
|
return draggableTrack;
|
|
}, [draggableTrack, mergedStep]);
|
|
var finishChange = function finishChange() {
|
|
onAfterChange === null || onAfterChange === void 0 ? void 0 : onAfterChange(getTriggerValue(rawValuesRef.current));
|
|
};
|
|
var _useDrag = useDrag(containerRef, direction, rawValues, mergedMin, mergedMax, formatValue, triggerChange, finishChange, offsetValues),
|
|
_useDrag2 = (0,slicedToArray/* default */.Z)(_useDrag, 4),
|
|
draggingIndex = _useDrag2[0],
|
|
draggingValue = _useDrag2[1],
|
|
cacheValues = _useDrag2[2],
|
|
onStartDrag = _useDrag2[3];
|
|
var onStartMove = function onStartMove(e, valueIndex) {
|
|
onStartDrag(e, valueIndex);
|
|
onBeforeChange === null || onBeforeChange === void 0 ? void 0 : onBeforeChange(getTriggerValue(rawValuesRef.current));
|
|
};
|
|
// Auto focus for updated handle
|
|
var dragging = draggingIndex !== -1;
|
|
_react_17_0_2_react.useEffect(function () {
|
|
if (!dragging) {
|
|
var valueIndex = rawValues.lastIndexOf(draggingValue);
|
|
handlesRef.current.focus(valueIndex);
|
|
}
|
|
}, [dragging]);
|
|
// =========================== Included ===========================
|
|
var sortedCacheValues = _react_17_0_2_react.useMemo(function () {
|
|
return (0,toConsumableArray/* default */.Z)(cacheValues).sort(function (a, b) {
|
|
return a - b;
|
|
});
|
|
}, [cacheValues]);
|
|
// Provide a range values with included [min, max]
|
|
// Used for Track, Mark & Dot
|
|
var _React$useMemo = _react_17_0_2_react.useMemo(function () {
|
|
if (!range) {
|
|
return [mergedMin, sortedCacheValues[0]];
|
|
}
|
|
return [sortedCacheValues[0], sortedCacheValues[sortedCacheValues.length - 1]];
|
|
}, [sortedCacheValues, range, mergedMin]),
|
|
_React$useMemo2 = (0,slicedToArray/* default */.Z)(_React$useMemo, 2),
|
|
includedStart = _React$useMemo2[0],
|
|
includedEnd = _React$useMemo2[1];
|
|
// ============================= Refs =============================
|
|
_react_17_0_2_react.useImperativeHandle(ref, function () {
|
|
return {
|
|
focus: function focus() {
|
|
handlesRef.current.focus(0);
|
|
},
|
|
blur: function blur() {
|
|
var _document = document,
|
|
activeElement = _document.activeElement;
|
|
if (containerRef.current.contains(activeElement)) {
|
|
activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur();
|
|
}
|
|
}
|
|
};
|
|
});
|
|
// ========================== Auto Focus ==========================
|
|
_react_17_0_2_react.useEffect(function () {
|
|
if (autoFocus) {
|
|
handlesRef.current.focus(0);
|
|
}
|
|
}, []);
|
|
// =========================== Context ============================
|
|
var context = _react_17_0_2_react.useMemo(function () {
|
|
return {
|
|
min: mergedMin,
|
|
max: mergedMax,
|
|
direction: direction,
|
|
disabled: disabled,
|
|
keyboard: keyboard,
|
|
step: mergedStep,
|
|
included: included,
|
|
includedStart: includedStart,
|
|
includedEnd: includedEnd,
|
|
range: range,
|
|
tabIndex: tabIndex,
|
|
ariaLabelForHandle: ariaLabelForHandle,
|
|
ariaLabelledByForHandle: ariaLabelledByForHandle,
|
|
ariaValueTextFormatterForHandle: ariaValueTextFormatterForHandle
|
|
};
|
|
}, [mergedMin, mergedMax, direction, disabled, keyboard, mergedStep, included, includedStart, includedEnd, range, tabIndex, ariaLabelForHandle, ariaLabelledByForHandle, ariaValueTextFormatterForHandle]);
|
|
// ============================ Render ============================
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(es_context.Provider, {
|
|
value: context
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
ref: containerRef,
|
|
className: _classnames_2_5_1_classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-vertical"), vertical), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-horizontal"), !vertical), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-with-marks"), markList.length), _classNames)),
|
|
style: style,
|
|
onMouseDown: onSliderMouseDown
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: "".concat(prefixCls, "-rail"),
|
|
style: railStyle
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(Tracks, {
|
|
prefixCls: prefixCls,
|
|
style: trackStyle,
|
|
values: sortedCacheValues,
|
|
startPoint: startPoint,
|
|
onStartMove: mergedDraggableTrack ? onStartMove : null
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(Steps, {
|
|
prefixCls: prefixCls,
|
|
marks: markList,
|
|
dots: dots,
|
|
style: dotStyle,
|
|
activeStyle: activeDotStyle
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(es_Handles, {
|
|
ref: handlesRef,
|
|
prefixCls: prefixCls,
|
|
style: handleStyle,
|
|
values: cacheValues,
|
|
draggingIndex: draggingIndex,
|
|
onStartMove: onStartMove,
|
|
onOffsetChange: onHandleOffsetChange,
|
|
onFocus: onFocus,
|
|
onBlur: onBlur,
|
|
handleRender: handleRender
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(Marks, {
|
|
prefixCls: prefixCls,
|
|
marks: markList,
|
|
onClick: changeToCloseValue
|
|
})));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var es_Slider = (Slider);
|
|
;// CONCATENATED MODULE: ./node_modules/_rc-slider@10.2.1@rc-slider/es/index.js
|
|
|
|
/* harmony default export */ var es = (es_Slider);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
var context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/DisabledContext.js
|
|
var DisabledContext = __webpack_require__(1684);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/raf.js
|
|
var raf = __webpack_require__(71783);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/ref.js
|
|
var es_ref = __webpack_require__(25629);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/slider/SliderTooltip.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SliderTooltip = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
const {
|
|
open
|
|
} = props;
|
|
const innerRef = (0,_react_17_0_2_react.useRef)(null);
|
|
const rafRef = (0,_react_17_0_2_react.useRef)(null);
|
|
function cancelKeepAlign() {
|
|
raf/* default */.Z.cancel(rafRef.current);
|
|
rafRef.current = null;
|
|
}
|
|
function keepAlign() {
|
|
rafRef.current = (0,raf/* default */.Z)(() => {
|
|
var _a;
|
|
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.forceAlign();
|
|
rafRef.current = null;
|
|
});
|
|
}
|
|
_react_17_0_2_react.useEffect(() => {
|
|
if (open) {
|
|
keepAlign();
|
|
} else {
|
|
cancelKeepAlign();
|
|
}
|
|
return cancelKeepAlign;
|
|
}, [open, props.title]);
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(tooltip/* default */.Z, Object.assign({
|
|
ref: (0,es_ref/* composeRef */.sQ)(innerRef, ref)
|
|
}, props));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var slider_SliderTooltip = (SliderTooltip);
|
|
// EXTERNAL MODULE: ./node_modules/_@ctrl_tinycolor@3.6.1@@ctrl/tinycolor/dist/module/index.js
|
|
var dist_module = __webpack_require__(64993);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
var style = __webpack_require__(17313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(37613);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/slider/style/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
// =============================== Base ===============================
|
|
const genBaseStyle = token => {
|
|
const {
|
|
componentCls,
|
|
antCls,
|
|
controlSize,
|
|
dotSize,
|
|
marginFull,
|
|
marginPart,
|
|
colorFillContentHover
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
height: controlSize,
|
|
margin: `${marginPart}px ${marginFull}px`,
|
|
padding: 0,
|
|
cursor: 'pointer',
|
|
touchAction: 'none',
|
|
[`&-vertical`]: {
|
|
margin: `${marginFull}px ${marginPart}px`
|
|
},
|
|
[`${componentCls}-rail`]: {
|
|
position: 'absolute',
|
|
backgroundColor: token.railBg,
|
|
borderRadius: token.borderRadiusXS,
|
|
transition: `background-color ${token.motionDurationMid}`
|
|
},
|
|
[`${componentCls}-track`]: {
|
|
position: 'absolute',
|
|
backgroundColor: token.trackBg,
|
|
borderRadius: token.borderRadiusXS,
|
|
transition: `background-color ${token.motionDurationMid}`
|
|
},
|
|
[`${componentCls}-track-draggable`]: {
|
|
// base on https://github.com/ant-design/ant-design/pull/42825/files#diff-9b9560a611e7ed0e6ef24ca9f1faff1e8c816d3f35ed6a1f73c36d2b42790aba
|
|
// zIndex: 1,
|
|
boxSizing: 'content-box',
|
|
backgroundClip: 'content-box',
|
|
border: 'solid rgba(0,0,0,0)'
|
|
},
|
|
'&:hover': {
|
|
[`${componentCls}-rail`]: {
|
|
backgroundColor: token.railHoverBg
|
|
},
|
|
[`${componentCls}-track`]: {
|
|
backgroundColor: token.trackHoverBg
|
|
},
|
|
[`${componentCls}-dot`]: {
|
|
borderColor: colorFillContentHover
|
|
},
|
|
[`${componentCls}-handle::after`]: {
|
|
boxShadow: `0 0 0 ${token.handleLineWidth}px ${token.colorPrimaryBorderHover}`
|
|
},
|
|
[`${componentCls}-dot-active`]: {
|
|
borderColor: token.dotActiveBorderColor
|
|
}
|
|
},
|
|
[`${componentCls}-handle`]: {
|
|
position: 'absolute',
|
|
width: token.handleSize,
|
|
height: token.handleSize,
|
|
outline: 'none',
|
|
[`${componentCls}-dragging`]: {
|
|
zIndex: 1
|
|
},
|
|
// 扩大选区
|
|
'&::before': {
|
|
content: '""',
|
|
position: 'absolute',
|
|
insetInlineStart: -token.handleLineWidth,
|
|
insetBlockStart: -token.handleLineWidth,
|
|
width: token.handleSize + token.handleLineWidth * 2,
|
|
height: token.handleSize + token.handleLineWidth * 2,
|
|
backgroundColor: 'transparent'
|
|
},
|
|
'&::after': {
|
|
content: '""',
|
|
position: 'absolute',
|
|
insetBlockStart: 0,
|
|
insetInlineStart: 0,
|
|
width: token.handleSize,
|
|
height: token.handleSize,
|
|
backgroundColor: token.colorBgElevated,
|
|
boxShadow: `0 0 0 ${token.handleLineWidth}px ${token.handleColor}`,
|
|
borderRadius: '50%',
|
|
cursor: 'pointer',
|
|
transition: `
|
|
inset-inline-start ${token.motionDurationMid},
|
|
inset-block-start ${token.motionDurationMid},
|
|
width ${token.motionDurationMid},
|
|
height ${token.motionDurationMid},
|
|
box-shadow ${token.motionDurationMid}
|
|
`
|
|
},
|
|
'&:hover, &:active, &:focus': {
|
|
'&::before': {
|
|
insetInlineStart: -((token.handleSizeHover - token.handleSize) / 2 + token.handleLineWidthHover),
|
|
insetBlockStart: -((token.handleSizeHover - token.handleSize) / 2 + token.handleLineWidthHover),
|
|
width: token.handleSizeHover + token.handleLineWidthHover * 2,
|
|
height: token.handleSizeHover + token.handleLineWidthHover * 2
|
|
},
|
|
'&::after': {
|
|
boxShadow: `0 0 0 ${token.handleLineWidthHover}px ${token.handleActiveColor}`,
|
|
width: token.handleSizeHover,
|
|
height: token.handleSizeHover,
|
|
insetInlineStart: (token.handleSize - token.handleSizeHover) / 2,
|
|
insetBlockStart: (token.handleSize - token.handleSizeHover) / 2
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-mark`]: {
|
|
position: 'absolute',
|
|
fontSize: token.fontSize
|
|
},
|
|
[`${componentCls}-mark-text`]: {
|
|
position: 'absolute',
|
|
display: 'inline-block',
|
|
color: token.colorTextDescription,
|
|
textAlign: 'center',
|
|
wordBreak: 'keep-all',
|
|
cursor: 'pointer',
|
|
userSelect: 'none',
|
|
'&-active': {
|
|
color: token.colorText
|
|
}
|
|
},
|
|
[`${componentCls}-step`]: {
|
|
position: 'absolute',
|
|
background: 'transparent',
|
|
pointerEvents: 'none'
|
|
},
|
|
[`${componentCls}-dot`]: {
|
|
position: 'absolute',
|
|
width: dotSize,
|
|
height: dotSize,
|
|
backgroundColor: token.colorBgElevated,
|
|
border: `${token.handleLineWidth}px solid ${token.dotBorderColor}`,
|
|
borderRadius: '50%',
|
|
cursor: 'pointer',
|
|
transition: `border-color ${token.motionDurationSlow}`,
|
|
pointerEvents: 'auto',
|
|
'&-active': {
|
|
borderColor: token.dotActiveBorderColor
|
|
}
|
|
},
|
|
[`&${componentCls}-disabled`]: {
|
|
cursor: 'not-allowed',
|
|
[`${componentCls}-rail`]: {
|
|
backgroundColor: `${token.railBg} !important`
|
|
},
|
|
[`${componentCls}-track`]: {
|
|
backgroundColor: `${token.trackBgDisabled} !important`
|
|
},
|
|
[`
|
|
${componentCls}-dot
|
|
`]: {
|
|
backgroundColor: token.colorBgElevated,
|
|
borderColor: token.trackBgDisabled,
|
|
boxShadow: 'none',
|
|
cursor: 'not-allowed'
|
|
},
|
|
[`${componentCls}-handle::after`]: {
|
|
backgroundColor: token.colorBgElevated,
|
|
cursor: 'not-allowed',
|
|
width: token.handleSize,
|
|
height: token.handleSize,
|
|
boxShadow: `0 0 0 ${token.handleLineWidth}px ${new dist_module/* TinyColor */.C(token.colorTextDisabled).onBackground(token.colorBgContainer).toHexShortString()}`,
|
|
insetInlineStart: 0,
|
|
insetBlockStart: 0
|
|
},
|
|
[`
|
|
${componentCls}-mark-text,
|
|
${componentCls}-dot
|
|
`]: {
|
|
cursor: `not-allowed !important`
|
|
}
|
|
},
|
|
[`&-tooltip ${antCls}-tooltip-inner`]: {
|
|
minWidth: 'unset'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================ Horizontal ============================
|
|
const genDirectionStyle = (token, horizontal) => {
|
|
const {
|
|
componentCls,
|
|
railSize,
|
|
handleSize,
|
|
dotSize
|
|
} = token;
|
|
const railPadding = horizontal ? 'paddingBlock' : 'paddingInline';
|
|
const full = horizontal ? 'width' : 'height';
|
|
const part = horizontal ? 'height' : 'width';
|
|
const handlePos = horizontal ? 'insetBlockStart' : 'insetInlineStart';
|
|
const markInset = horizontal ? 'top' : 'insetInlineStart';
|
|
const handlePosSize = (railSize * 3 - handleSize) / 2;
|
|
const draggableBorderSize = (handleSize - railSize) / 2;
|
|
const draggableBorder = horizontal ? {
|
|
borderWidth: `${draggableBorderSize}px 0`,
|
|
transform: `translateY(-${draggableBorderSize}px)`
|
|
} : {
|
|
borderWidth: `0 ${draggableBorderSize}px`,
|
|
transform: `translateX(-${draggableBorderSize}px)`
|
|
};
|
|
return {
|
|
[railPadding]: railSize,
|
|
[part]: railSize * 3,
|
|
[`${componentCls}-rail`]: {
|
|
[full]: '100%',
|
|
[part]: railSize
|
|
},
|
|
[`${componentCls}-track`]: {
|
|
[part]: railSize
|
|
},
|
|
[`${componentCls}-track-draggable`]: Object.assign({}, draggableBorder),
|
|
[`${componentCls}-handle`]: {
|
|
[handlePos]: handlePosSize
|
|
},
|
|
[`${componentCls}-mark`]: {
|
|
// Reset all
|
|
insetInlineStart: 0,
|
|
top: 0,
|
|
// https://github.com/ant-design/ant-design/issues/43731
|
|
[markInset]: railSize * 3 + (horizontal ? 0 : token.marginFull),
|
|
[full]: '100%'
|
|
},
|
|
[`${componentCls}-step`]: {
|
|
// Reset all
|
|
insetInlineStart: 0,
|
|
top: 0,
|
|
[markInset]: railSize,
|
|
[full]: '100%',
|
|
[part]: railSize
|
|
},
|
|
[`${componentCls}-dot`]: {
|
|
position: 'absolute',
|
|
[handlePos]: (railSize - dotSize) / 2
|
|
}
|
|
};
|
|
};
|
|
// ============================ Horizontal ============================
|
|
const genHorizontalStyle = token => {
|
|
const {
|
|
componentCls,
|
|
marginPartWithMark
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-horizontal`]: Object.assign(Object.assign({}, genDirectionStyle(token, true)), {
|
|
[`&${componentCls}-with-marks`]: {
|
|
marginBottom: marginPartWithMark
|
|
}
|
|
})
|
|
};
|
|
};
|
|
// ============================= Vertical =============================
|
|
const genVerticalStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-vertical`]: Object.assign(Object.assign({}, genDirectionStyle(token, false)), {
|
|
height: '100%'
|
|
})
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var slider_style = ((0,genComponentStyleHook/* default */.Z)('Slider', token => {
|
|
const sliderToken = (0,statistic/* merge */.TS)(token, {
|
|
marginPart: (token.controlHeight - token.controlSize) / 2,
|
|
marginFull: token.controlSize / 2,
|
|
marginPartWithMark: token.controlHeightLG - token.controlSize
|
|
});
|
|
return [genBaseStyle(sliderToken), genHorizontalStyle(sliderToken), genVerticalStyle(sliderToken)];
|
|
}, token => {
|
|
// Handle line width is always width-er 1px
|
|
const increaseHandleWidth = 1;
|
|
const controlSize = token.controlHeightLG / 4;
|
|
const controlSizeHover = token.controlHeightSM / 2;
|
|
const handleLineWidth = token.lineWidth + increaseHandleWidth;
|
|
const handleLineWidthHover = token.lineWidth + increaseHandleWidth * 3;
|
|
return {
|
|
controlSize,
|
|
railSize: 4,
|
|
handleSize: controlSize,
|
|
handleSizeHover: controlSizeHover,
|
|
dotSize: 8,
|
|
handleLineWidth,
|
|
handleLineWidthHover,
|
|
railBg: token.colorFillTertiary,
|
|
railHoverBg: token.colorFillSecondary,
|
|
trackBg: token.colorPrimaryBorder,
|
|
trackHoverBg: token.colorPrimaryBorderHover,
|
|
handleColor: token.colorPrimaryBorder,
|
|
handleActiveColor: token.colorPrimary,
|
|
dotBorderColor: token.colorBorderSecondary,
|
|
dotActiveBorderColor: token.colorPrimaryBorder,
|
|
trackBgDisabled: token.colorBgContainerDisabled
|
|
};
|
|
}));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/slider/index.js
|
|
"use client";
|
|
|
|
var slider_rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const defaultFormatter = val => typeof val === 'number' ? val.toString() : '';
|
|
const slider_Slider = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
range,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
disabled,
|
|
// Deprecated Props
|
|
tooltipPrefixCls: legacyTooltipPrefixCls,
|
|
tipFormatter: legacyTipFormatter,
|
|
tooltipVisible: legacyTooltipVisible,
|
|
getTooltipPopupContainer: legacyGetTooltipPopupContainer,
|
|
tooltipPlacement: legacyTooltipPlacement
|
|
} = props,
|
|
restProps = slider_rest(props, ["prefixCls", "range", "className", "rootClassName", "style", "disabled", "tooltipPrefixCls", "tipFormatter", "tooltipVisible", "getTooltipPopupContainer", "tooltipPlacement"]);
|
|
const {
|
|
direction,
|
|
slider,
|
|
getPrefixCls,
|
|
getPopupContainer
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const contextDisabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
|
|
const mergedDisabled = disabled !== null && disabled !== void 0 ? disabled : contextDisabled;
|
|
const [opens, setOpens] = _react_17_0_2_react.useState({});
|
|
const toggleTooltipOpen = (index, open) => {
|
|
setOpens(prev => Object.assign(Object.assign({}, prev), {
|
|
[index]: open
|
|
}));
|
|
};
|
|
const getTooltipPlacement = (placement, vertical) => {
|
|
if (placement) {
|
|
return placement;
|
|
}
|
|
if (!vertical) {
|
|
return 'top';
|
|
}
|
|
return direction === 'rtl' ? 'left' : 'right';
|
|
};
|
|
const prefixCls = getPrefixCls('slider', customizePrefixCls);
|
|
const [wrapSSR, hashId] = slider_style(prefixCls);
|
|
const cls = _classnames_2_5_1_classnames_default()(className, slider === null || slider === void 0 ? void 0 : slider.className, rootClassName, {
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, hashId);
|
|
// make reverse default on rtl direction
|
|
if (direction === 'rtl' && !restProps.vertical) {
|
|
restProps.reverse = !restProps.reverse;
|
|
}
|
|
// Range config
|
|
const [mergedRange, draggableTrack] = _react_17_0_2_react.useMemo(() => {
|
|
if (!range) {
|
|
return [false];
|
|
}
|
|
return typeof range === 'object' ? [true, range.draggableTrack] : [true, false];
|
|
}, [range]);
|
|
// Warning for deprecated usage
|
|
if (false) {}
|
|
const handleRender = (node, info) => {
|
|
var _a;
|
|
const {
|
|
index,
|
|
dragging
|
|
} = info;
|
|
const {
|
|
tooltip = {},
|
|
vertical
|
|
} = props;
|
|
const tooltipProps = Object.assign({}, tooltip);
|
|
const {
|
|
open: tooltipOpen,
|
|
placement: tooltipPlacement,
|
|
getPopupContainer: getTooltipPopupContainer,
|
|
prefixCls: customizeTooltipPrefixCls,
|
|
formatter: tipFormatter
|
|
} = tooltipProps;
|
|
let mergedTipFormatter;
|
|
if (tipFormatter || tipFormatter === null) {
|
|
mergedTipFormatter = tipFormatter;
|
|
} else if (legacyTipFormatter || legacyTipFormatter === null) {
|
|
mergedTipFormatter = legacyTipFormatter;
|
|
} else {
|
|
mergedTipFormatter = defaultFormatter;
|
|
}
|
|
const isTipFormatter = mergedTipFormatter ? opens[index] || dragging : false;
|
|
const open = (_a = tooltipOpen !== null && tooltipOpen !== void 0 ? tooltipOpen : legacyTooltipVisible) !== null && _a !== void 0 ? _a : tooltipOpen === undefined && isTipFormatter;
|
|
const passedProps = Object.assign(Object.assign({}, node.props), {
|
|
onMouseEnter: () => toggleTooltipOpen(index, true),
|
|
onMouseLeave: () => toggleTooltipOpen(index, false)
|
|
});
|
|
const tooltipPrefixCls = getPrefixCls('tooltip', customizeTooltipPrefixCls !== null && customizeTooltipPrefixCls !== void 0 ? customizeTooltipPrefixCls : legacyTooltipPrefixCls);
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(slider_SliderTooltip, Object.assign({}, tooltipProps, {
|
|
prefixCls: tooltipPrefixCls,
|
|
title: mergedTipFormatter ? mergedTipFormatter(info.value) : '',
|
|
open: open,
|
|
placement: getTooltipPlacement(tooltipPlacement !== null && tooltipPlacement !== void 0 ? tooltipPlacement : legacyTooltipPlacement, vertical),
|
|
key: index,
|
|
overlayClassName: `${prefixCls}-tooltip`,
|
|
getPopupContainer: getTooltipPopupContainer || legacyGetTooltipPopupContainer || getPopupContainer
|
|
}), /*#__PURE__*/_react_17_0_2_react.cloneElement(node, passedProps));
|
|
};
|
|
const mergedStyle = Object.assign(Object.assign({}, slider === null || slider === void 0 ? void 0 : slider.style), style);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(es, Object.assign({}, restProps, {
|
|
step: restProps.step,
|
|
range: mergedRange,
|
|
draggableTrack: draggableTrack,
|
|
className: cls,
|
|
style: mergedStyle,
|
|
disabled: mergedDisabled,
|
|
ref: ref,
|
|
prefixCls: prefixCls,
|
|
handleRender: handleRender
|
|
})));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var slider = (slider_Slider);
|
|
// EXTERNAL MODULE: ./node_modules/_normalize-wheel@1.0.1@normalize-wheel/index.js
|
|
var _normalize_wheel_1_0_1_normalize_wheel = __webpack_require__(23841);
|
|
var _normalize_wheel_1_0_1_normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(_normalize_wheel_1_0_1_normalize_wheel);
|
|
;// CONCATENATED MODULE: ./node_modules/_react-easy-crop@5.1.0@react-easy-crop/index.module.js
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Compute the dimension of the crop area based on media size,
|
|
* aspect ratio and optionally rotation
|
|
*/
|
|
function getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) {
|
|
if (rotation === void 0) {
|
|
rotation = 0;
|
|
}
|
|
var _a = rotateSize(mediaWidth, mediaHeight, rotation),
|
|
width = _a.width,
|
|
height = _a.height;
|
|
var fittingWidth = Math.min(width, containerWidth);
|
|
var fittingHeight = Math.min(height, containerHeight);
|
|
if (fittingWidth > fittingHeight * aspect) {
|
|
return {
|
|
width: fittingHeight * aspect,
|
|
height: fittingHeight
|
|
};
|
|
}
|
|
return {
|
|
width: fittingWidth,
|
|
height: fittingWidth / aspect
|
|
};
|
|
}
|
|
/**
|
|
* Compute media zoom.
|
|
* We fit the media into the container with "max-width: 100%; max-height: 100%;"
|
|
*/
|
|
function getMediaZoom(mediaSize) {
|
|
// Take the axis with more pixels to improve accuracy
|
|
return mediaSize.width > mediaSize.height ? mediaSize.width / mediaSize.naturalWidth : mediaSize.height / mediaSize.naturalHeight;
|
|
}
|
|
/**
|
|
* Ensure a new media position stays in the crop area.
|
|
*/
|
|
function restrictPosition(position, mediaSize, cropSize, zoom, rotation) {
|
|
if (rotation === void 0) {
|
|
rotation = 0;
|
|
}
|
|
var _a = rotateSize(mediaSize.width, mediaSize.height, rotation),
|
|
width = _a.width,
|
|
height = _a.height;
|
|
return {
|
|
x: restrictPositionCoord(position.x, width, cropSize.width, zoom),
|
|
y: restrictPositionCoord(position.y, height, cropSize.height, zoom)
|
|
};
|
|
}
|
|
function restrictPositionCoord(position, mediaSize, cropSize, zoom) {
|
|
var maxPosition = mediaSize * zoom / 2 - cropSize / 2;
|
|
return clamp(position, -maxPosition, maxPosition);
|
|
}
|
|
function getDistanceBetweenPoints(pointA, pointB) {
|
|
return Math.sqrt(Math.pow(pointA.y - pointB.y, 2) + Math.pow(pointA.x - pointB.x, 2));
|
|
}
|
|
function getRotationBetweenPoints(pointA, pointB) {
|
|
return Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x) * 180 / Math.PI;
|
|
}
|
|
/**
|
|
* Compute the output cropped area of the media in percentages and pixels.
|
|
* x/y are the top-left coordinates on the src media
|
|
*/
|
|
function computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition) {
|
|
if (rotation === void 0) {
|
|
rotation = 0;
|
|
}
|
|
if (restrictPosition === void 0) {
|
|
restrictPosition = true;
|
|
}
|
|
// if the media is rotated by the user, we cannot limit the position anymore
|
|
// as it might need to be negative.
|
|
var limitAreaFn = restrictPosition ? limitArea : noOp;
|
|
var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation);
|
|
var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation);
|
|
// calculate the crop area in percentages
|
|
// in the rotated space
|
|
var croppedAreaPercentages = {
|
|
x: limitAreaFn(100, ((mediaBBoxSize.width - cropSize.width / zoom) / 2 - crop.x / zoom) / mediaBBoxSize.width * 100),
|
|
y: limitAreaFn(100, ((mediaBBoxSize.height - cropSize.height / zoom) / 2 - crop.y / zoom) / mediaBBoxSize.height * 100),
|
|
width: limitAreaFn(100, cropSize.width / mediaBBoxSize.width * 100 / zoom),
|
|
height: limitAreaFn(100, cropSize.height / mediaBBoxSize.height * 100 / zoom)
|
|
};
|
|
// we compute the pixels size naively
|
|
var widthInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.width, croppedAreaPercentages.width * mediaNaturalBBoxSize.width / 100));
|
|
var heightInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.height, croppedAreaPercentages.height * mediaNaturalBBoxSize.height / 100));
|
|
var isImgWiderThanHigh = mediaNaturalBBoxSize.width >= mediaNaturalBBoxSize.height * aspect;
|
|
// then we ensure the width and height exactly match the aspect (to avoid rounding approximations)
|
|
// if the media is wider than high, when zoom is 0, the crop height will be equals to image height
|
|
// thus we want to compute the width from the height and aspect for accuracy.
|
|
// Otherwise, we compute the height from width and aspect.
|
|
var sizePixels = isImgWiderThanHigh ? {
|
|
width: Math.round(heightInPixels * aspect),
|
|
height: heightInPixels
|
|
} : {
|
|
width: widthInPixels,
|
|
height: Math.round(widthInPixels / aspect)
|
|
};
|
|
var croppedAreaPixels = __assign(__assign({}, sizePixels), {
|
|
x: Math.round(limitAreaFn(mediaNaturalBBoxSize.width - sizePixels.width, croppedAreaPercentages.x * mediaNaturalBBoxSize.width / 100)),
|
|
y: Math.round(limitAreaFn(mediaNaturalBBoxSize.height - sizePixels.height, croppedAreaPercentages.y * mediaNaturalBBoxSize.height / 100))
|
|
});
|
|
return {
|
|
croppedAreaPercentages: croppedAreaPercentages,
|
|
croppedAreaPixels: croppedAreaPixels
|
|
};
|
|
}
|
|
/**
|
|
* Ensure the returned value is between 0 and max
|
|
*/
|
|
function limitArea(max, value) {
|
|
return Math.min(max, Math.max(0, value));
|
|
}
|
|
function noOp(_max, value) {
|
|
return value;
|
|
}
|
|
/**
|
|
* Compute crop and zoom from the croppedAreaPercentages.
|
|
*/
|
|
function getInitialCropFromCroppedAreaPercentages(croppedAreaPercentages, mediaSize, rotation, cropSize, minZoom, maxZoom) {
|
|
var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation);
|
|
// This is the inverse process of computeCroppedArea
|
|
var zoom = clamp(cropSize.width / mediaBBoxSize.width * (100 / croppedAreaPercentages.width), minZoom, maxZoom);
|
|
var crop = {
|
|
x: zoom * mediaBBoxSize.width / 2 - cropSize.width / 2 - mediaBBoxSize.width * zoom * (croppedAreaPercentages.x / 100),
|
|
y: zoom * mediaBBoxSize.height / 2 - cropSize.height / 2 - mediaBBoxSize.height * zoom * (croppedAreaPercentages.y / 100)
|
|
};
|
|
return {
|
|
crop: crop,
|
|
zoom: zoom
|
|
};
|
|
}
|
|
/**
|
|
* Compute zoom from the croppedAreaPixels
|
|
*/
|
|
function getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) {
|
|
var mediaZoom = getMediaZoom(mediaSize);
|
|
return cropSize.height > cropSize.width ? cropSize.height / (croppedAreaPixels.height * mediaZoom) : cropSize.width / (croppedAreaPixels.width * mediaZoom);
|
|
}
|
|
/**
|
|
* Compute crop and zoom from the croppedAreaPixels
|
|
*/
|
|
function getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, rotation, cropSize, minZoom, maxZoom) {
|
|
if (rotation === void 0) {
|
|
rotation = 0;
|
|
}
|
|
var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation);
|
|
var zoom = clamp(getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize), minZoom, maxZoom);
|
|
var cropZoom = cropSize.height > cropSize.width ? cropSize.height / croppedAreaPixels.height : cropSize.width / croppedAreaPixels.width;
|
|
var crop = {
|
|
x: ((mediaNaturalBBoxSize.width - croppedAreaPixels.width) / 2 - croppedAreaPixels.x) * cropZoom,
|
|
y: ((mediaNaturalBBoxSize.height - croppedAreaPixels.height) / 2 - croppedAreaPixels.y) * cropZoom
|
|
};
|
|
return {
|
|
crop: crop,
|
|
zoom: zoom
|
|
};
|
|
}
|
|
/**
|
|
* Return the point that is the center of point a and b
|
|
*/
|
|
function getCenter(a, b) {
|
|
return {
|
|
x: (b.x + a.x) / 2,
|
|
y: (b.y + a.y) / 2
|
|
};
|
|
}
|
|
function getRadianAngle(degreeValue) {
|
|
return degreeValue * Math.PI / 180;
|
|
}
|
|
/**
|
|
* Returns the new bounding area of a rotated rectangle.
|
|
*/
|
|
function rotateSize(width, height, rotation) {
|
|
var rotRad = getRadianAngle(rotation);
|
|
return {
|
|
width: Math.abs(Math.cos(rotRad) * width) + Math.abs(Math.sin(rotRad) * height),
|
|
height: Math.abs(Math.sin(rotRad) * width) + Math.abs(Math.cos(rotRad) * height)
|
|
};
|
|
}
|
|
/**
|
|
* Clamp value between min and max
|
|
*/
|
|
function clamp(value, min, max) {
|
|
return Math.min(Math.max(value, min), max);
|
|
}
|
|
/**
|
|
* Combine multiple class names into a single string.
|
|
*/
|
|
function classNames() {
|
|
var args = [];
|
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
args[_i] = arguments[_i];
|
|
}
|
|
return args.filter(function (value) {
|
|
if (typeof value === 'string' && value.length > 0) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}).join(' ').trim();
|
|
}
|
|
|
|
var css_248z = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n";
|
|
|
|
var MIN_ZOOM = 1;
|
|
var MAX_ZOOM = 3;
|
|
var KEYBOARD_STEP = 1;
|
|
var Cropper = /** @class */function (_super) {
|
|
__extends(Cropper, _super);
|
|
function Cropper() {
|
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
_this.imageRef = _react_17_0_2_react.createRef();
|
|
_this.videoRef = _react_17_0_2_react.createRef();
|
|
_this.containerPosition = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
_this.containerRef = null;
|
|
_this.styleRef = null;
|
|
_this.containerRect = null;
|
|
_this.mediaSize = {
|
|
width: 0,
|
|
height: 0,
|
|
naturalWidth: 0,
|
|
naturalHeight: 0
|
|
};
|
|
_this.dragStartPosition = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
_this.dragStartCrop = {
|
|
x: 0,
|
|
y: 0
|
|
};
|
|
_this.gestureZoomStart = 0;
|
|
_this.gestureRotationStart = 0;
|
|
_this.isTouching = false;
|
|
_this.lastPinchDistance = 0;
|
|
_this.lastPinchRotation = 0;
|
|
_this.rafDragTimeout = null;
|
|
_this.rafPinchTimeout = null;
|
|
_this.wheelTimer = null;
|
|
_this.currentDoc = typeof document !== 'undefined' ? document : null;
|
|
_this.currentWindow = typeof window !== 'undefined' ? window : null;
|
|
_this.resizeObserver = null;
|
|
_this.state = {
|
|
cropSize: null,
|
|
hasWheelJustStarted: false,
|
|
mediaObjectFit: undefined
|
|
};
|
|
_this.initResizeObserver = function () {
|
|
if (typeof window.ResizeObserver === 'undefined' || !_this.containerRef) {
|
|
return;
|
|
}
|
|
var isFirstResize = true;
|
|
_this.resizeObserver = new window.ResizeObserver(function (entries) {
|
|
if (isFirstResize) {
|
|
isFirstResize = false; // observe() is called on mount, we don't want to trigger a recompute on mount
|
|
return;
|
|
}
|
|
_this.computeSizes();
|
|
});
|
|
_this.resizeObserver.observe(_this.containerRef);
|
|
};
|
|
// this is to prevent Safari on iOS >= 10 to zoom the page
|
|
_this.preventZoomSafari = function (e) {
|
|
return e.preventDefault();
|
|
};
|
|
_this.cleanEvents = function () {
|
|
if (!_this.currentDoc) return;
|
|
_this.currentDoc.removeEventListener('mousemove', _this.onMouseMove);
|
|
_this.currentDoc.removeEventListener('mouseup', _this.onDragStopped);
|
|
_this.currentDoc.removeEventListener('touchmove', _this.onTouchMove);
|
|
_this.currentDoc.removeEventListener('touchend', _this.onDragStopped);
|
|
_this.currentDoc.removeEventListener('gesturemove', _this.onGestureMove);
|
|
_this.currentDoc.removeEventListener('gestureend', _this.onGestureEnd);
|
|
_this.currentDoc.removeEventListener('scroll', _this.onScroll);
|
|
};
|
|
_this.clearScrollEvent = function () {
|
|
if (_this.containerRef) _this.containerRef.removeEventListener('wheel', _this.onWheel);
|
|
if (_this.wheelTimer) {
|
|
clearTimeout(_this.wheelTimer);
|
|
}
|
|
};
|
|
_this.onMediaLoad = function () {
|
|
var cropSize = _this.computeSizes();
|
|
if (cropSize) {
|
|
_this.emitCropData();
|
|
_this.setInitialCrop(cropSize);
|
|
}
|
|
if (_this.props.onMediaLoaded) {
|
|
_this.props.onMediaLoaded(_this.mediaSize);
|
|
}
|
|
};
|
|
_this.setInitialCrop = function (cropSize) {
|
|
if (_this.props.initialCroppedAreaPercentages) {
|
|
var _a = getInitialCropFromCroppedAreaPercentages(_this.props.initialCroppedAreaPercentages, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom),
|
|
crop = _a.crop,
|
|
zoom = _a.zoom;
|
|
_this.props.onCropChange(crop);
|
|
_this.props.onZoomChange && _this.props.onZoomChange(zoom);
|
|
} else if (_this.props.initialCroppedAreaPixels) {
|
|
var _b = getInitialCropFromCroppedAreaPixels(_this.props.initialCroppedAreaPixels, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom),
|
|
crop = _b.crop,
|
|
zoom = _b.zoom;
|
|
_this.props.onCropChange(crop);
|
|
_this.props.onZoomChange && _this.props.onZoomChange(zoom);
|
|
}
|
|
};
|
|
_this.computeSizes = function () {
|
|
var _a, _b, _c, _d, _e, _f;
|
|
var mediaRef = _this.imageRef.current || _this.videoRef.current;
|
|
if (mediaRef && _this.containerRef) {
|
|
_this.containerRect = _this.containerRef.getBoundingClientRect();
|
|
_this.saveContainerPosition();
|
|
var containerAspect = _this.containerRect.width / _this.containerRect.height;
|
|
var naturalWidth = ((_a = _this.imageRef.current) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0;
|
|
var naturalHeight = ((_c = _this.imageRef.current) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0;
|
|
var isMediaScaledDown = mediaRef.offsetWidth < naturalWidth || mediaRef.offsetHeight < naturalHeight;
|
|
var mediaAspect = naturalWidth / naturalHeight;
|
|
// We do not rely on the offsetWidth/offsetHeight if the media is scaled down
|
|
// as the values they report are rounded. That will result in precision losses
|
|
// when calculating zoom. We use the fact that the media is positionned relative
|
|
// to the container. That allows us to use the container's dimensions
|
|
// and natural aspect ratio of the media to calculate accurate media size.
|
|
// However, for this to work, the container should not be rotated
|
|
var renderedMediaSize = void 0;
|
|
if (isMediaScaledDown) {
|
|
switch (_this.state.mediaObjectFit) {
|
|
default:
|
|
case 'contain':
|
|
renderedMediaSize = containerAspect > mediaAspect ? {
|
|
width: _this.containerRect.height * mediaAspect,
|
|
height: _this.containerRect.height
|
|
} : {
|
|
width: _this.containerRect.width,
|
|
height: _this.containerRect.width / mediaAspect
|
|
};
|
|
break;
|
|
case 'horizontal-cover':
|
|
renderedMediaSize = {
|
|
width: _this.containerRect.width,
|
|
height: _this.containerRect.width / mediaAspect
|
|
};
|
|
break;
|
|
case 'vertical-cover':
|
|
renderedMediaSize = {
|
|
width: _this.containerRect.height * mediaAspect,
|
|
height: _this.containerRect.height
|
|
};
|
|
break;
|
|
}
|
|
} else {
|
|
renderedMediaSize = {
|
|
width: mediaRef.offsetWidth,
|
|
height: mediaRef.offsetHeight
|
|
};
|
|
}
|
|
_this.mediaSize = __assign(__assign({}, renderedMediaSize), {
|
|
naturalWidth: naturalWidth,
|
|
naturalHeight: naturalHeight
|
|
});
|
|
// set media size in the parent
|
|
if (_this.props.setMediaSize) {
|
|
_this.props.setMediaSize(_this.mediaSize);
|
|
}
|
|
var cropSize = _this.props.cropSize ? _this.props.cropSize : getCropSize(_this.mediaSize.width, _this.mediaSize.height, _this.containerRect.width, _this.containerRect.height, _this.props.aspect, _this.props.rotation);
|
|
if (((_e = _this.state.cropSize) === null || _e === void 0 ? void 0 : _e.height) !== cropSize.height || ((_f = _this.state.cropSize) === null || _f === void 0 ? void 0 : _f.width) !== cropSize.width) {
|
|
_this.props.onCropSizeChange && _this.props.onCropSizeChange(cropSize);
|
|
}
|
|
_this.setState({
|
|
cropSize: cropSize
|
|
}, _this.recomputeCropPosition);
|
|
// pass crop size to parent
|
|
if (_this.props.setCropSize) {
|
|
_this.props.setCropSize(cropSize);
|
|
}
|
|
return cropSize;
|
|
}
|
|
};
|
|
_this.saveContainerPosition = function () {
|
|
if (_this.containerRef) {
|
|
var bounds = _this.containerRef.getBoundingClientRect();
|
|
_this.containerPosition = {
|
|
x: bounds.left,
|
|
y: bounds.top
|
|
};
|
|
}
|
|
};
|
|
_this.onMouseDown = function (e) {
|
|
if (!_this.currentDoc) return;
|
|
e.preventDefault();
|
|
_this.currentDoc.addEventListener('mousemove', _this.onMouseMove);
|
|
_this.currentDoc.addEventListener('mouseup', _this.onDragStopped);
|
|
_this.saveContainerPosition();
|
|
_this.onDragStart(Cropper.getMousePoint(e));
|
|
};
|
|
_this.onMouseMove = function (e) {
|
|
return _this.onDrag(Cropper.getMousePoint(e));
|
|
};
|
|
_this.onScroll = function (e) {
|
|
if (!_this.currentDoc) return;
|
|
e.preventDefault();
|
|
_this.saveContainerPosition();
|
|
};
|
|
_this.onTouchStart = function (e) {
|
|
if (!_this.currentDoc) return;
|
|
_this.isTouching = true;
|
|
if (_this.props.onTouchRequest && !_this.props.onTouchRequest(e)) {
|
|
return;
|
|
}
|
|
_this.currentDoc.addEventListener('touchmove', _this.onTouchMove, {
|
|
passive: false
|
|
}); // iOS 11 now defaults to passive: true
|
|
_this.currentDoc.addEventListener('touchend', _this.onDragStopped);
|
|
_this.saveContainerPosition();
|
|
if (e.touches.length === 2) {
|
|
_this.onPinchStart(e);
|
|
} else if (e.touches.length === 1) {
|
|
_this.onDragStart(Cropper.getTouchPoint(e.touches[0]));
|
|
}
|
|
};
|
|
_this.onTouchMove = function (e) {
|
|
// Prevent whole page from scrolling on iOS.
|
|
e.preventDefault();
|
|
if (e.touches.length === 2) {
|
|
_this.onPinchMove(e);
|
|
} else if (e.touches.length === 1) {
|
|
_this.onDrag(Cropper.getTouchPoint(e.touches[0]));
|
|
}
|
|
};
|
|
_this.onGestureStart = function (e) {
|
|
if (!_this.currentDoc) return;
|
|
e.preventDefault();
|
|
_this.currentDoc.addEventListener('gesturechange', _this.onGestureMove);
|
|
_this.currentDoc.addEventListener('gestureend', _this.onGestureEnd);
|
|
_this.gestureZoomStart = _this.props.zoom;
|
|
_this.gestureRotationStart = _this.props.rotation;
|
|
};
|
|
_this.onGestureMove = function (e) {
|
|
e.preventDefault();
|
|
if (_this.isTouching) {
|
|
// this is to avoid conflict between gesture and touch events
|
|
return;
|
|
}
|
|
var point = Cropper.getMousePoint(e);
|
|
var newZoom = _this.gestureZoomStart - 1 + e.scale;
|
|
_this.setNewZoom(newZoom, point, {
|
|
shouldUpdatePosition: true
|
|
});
|
|
if (_this.props.onRotationChange) {
|
|
var newRotation = _this.gestureRotationStart + e.rotation;
|
|
_this.props.onRotationChange(newRotation);
|
|
}
|
|
};
|
|
_this.onGestureEnd = function (e) {
|
|
_this.cleanEvents();
|
|
};
|
|
_this.onDragStart = function (_a) {
|
|
var _b, _c;
|
|
var x = _a.x,
|
|
y = _a.y;
|
|
_this.dragStartPosition = {
|
|
x: x,
|
|
y: y
|
|
};
|
|
_this.dragStartCrop = __assign({}, _this.props.crop);
|
|
(_c = (_b = _this.props).onInteractionStart) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
};
|
|
_this.onDrag = function (_a) {
|
|
var x = _a.x,
|
|
y = _a.y;
|
|
if (!_this.currentWindow) return;
|
|
if (_this.rafDragTimeout) _this.currentWindow.cancelAnimationFrame(_this.rafDragTimeout);
|
|
_this.rafDragTimeout = _this.currentWindow.requestAnimationFrame(function () {
|
|
if (!_this.state.cropSize) return;
|
|
if (x === undefined || y === undefined) return;
|
|
var offsetX = x - _this.dragStartPosition.x;
|
|
var offsetY = y - _this.dragStartPosition.y;
|
|
var requestedPosition = {
|
|
x: _this.dragStartCrop.x + offsetX,
|
|
y: _this.dragStartCrop.y + offsetY
|
|
};
|
|
var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : requestedPosition;
|
|
_this.props.onCropChange(newPosition);
|
|
});
|
|
};
|
|
_this.onDragStopped = function () {
|
|
var _a, _b;
|
|
_this.isTouching = false;
|
|
_this.cleanEvents();
|
|
_this.emitCropData();
|
|
(_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
};
|
|
_this.onWheel = function (e) {
|
|
if (!_this.currentWindow) return;
|
|
if (_this.props.onWheelRequest && !_this.props.onWheelRequest(e)) {
|
|
return;
|
|
}
|
|
e.preventDefault();
|
|
var point = Cropper.getMousePoint(e);
|
|
var pixelY = _normalize_wheel_1_0_1_normalize_wheel_default()(e).pixelY;
|
|
var newZoom = _this.props.zoom - pixelY * _this.props.zoomSpeed / 200;
|
|
_this.setNewZoom(newZoom, point, {
|
|
shouldUpdatePosition: true
|
|
});
|
|
if (!_this.state.hasWheelJustStarted) {
|
|
_this.setState({
|
|
hasWheelJustStarted: true
|
|
}, function () {
|
|
var _a, _b;
|
|
return (_b = (_a = _this.props).onInteractionStart) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
});
|
|
}
|
|
if (_this.wheelTimer) {
|
|
clearTimeout(_this.wheelTimer);
|
|
}
|
|
_this.wheelTimer = _this.currentWindow.setTimeout(function () {
|
|
return _this.setState({
|
|
hasWheelJustStarted: false
|
|
}, function () {
|
|
var _a, _b;
|
|
return (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
});
|
|
}, 250);
|
|
};
|
|
_this.getPointOnContainer = function (_a, containerTopLeft) {
|
|
var x = _a.x,
|
|
y = _a.y;
|
|
if (!_this.containerRect) {
|
|
throw new Error('The Cropper is not mounted');
|
|
}
|
|
return {
|
|
x: _this.containerRect.width / 2 - (x - containerTopLeft.x),
|
|
y: _this.containerRect.height / 2 - (y - containerTopLeft.y)
|
|
};
|
|
};
|
|
_this.getPointOnMedia = function (_a) {
|
|
var x = _a.x,
|
|
y = _a.y;
|
|
var _b = _this.props,
|
|
crop = _b.crop,
|
|
zoom = _b.zoom;
|
|
return {
|
|
x: (x + crop.x) / zoom,
|
|
y: (y + crop.y) / zoom
|
|
};
|
|
};
|
|
_this.setNewZoom = function (zoom, point, _a) {
|
|
var _b = _a === void 0 ? {} : _a,
|
|
_c = _b.shouldUpdatePosition,
|
|
shouldUpdatePosition = _c === void 0 ? true : _c;
|
|
if (!_this.state.cropSize || !_this.props.onZoomChange) return;
|
|
var newZoom = clamp(zoom, _this.props.minZoom, _this.props.maxZoom);
|
|
if (shouldUpdatePosition) {
|
|
var zoomPoint = _this.getPointOnContainer(point, _this.containerPosition);
|
|
var zoomTarget = _this.getPointOnMedia(zoomPoint);
|
|
var requestedPosition = {
|
|
x: zoomTarget.x * newZoom - zoomPoint.x,
|
|
y: zoomTarget.y * newZoom - zoomPoint.y
|
|
};
|
|
var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, newZoom, _this.props.rotation) : requestedPosition;
|
|
_this.props.onCropChange(newPosition);
|
|
}
|
|
_this.props.onZoomChange(newZoom);
|
|
};
|
|
_this.getCropData = function () {
|
|
if (!_this.state.cropSize) {
|
|
return null;
|
|
}
|
|
// this is to ensure the crop is correctly restricted after a zoom back (https://github.com/ValentinH/react-easy-crop/issues/6)
|
|
var restrictedPosition = _this.props.restrictPosition ? restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop;
|
|
return computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition);
|
|
};
|
|
_this.emitCropData = function () {
|
|
var cropData = _this.getCropData();
|
|
if (!cropData) return;
|
|
var croppedAreaPercentages = cropData.croppedAreaPercentages,
|
|
croppedAreaPixels = cropData.croppedAreaPixels;
|
|
if (_this.props.onCropComplete) {
|
|
_this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels);
|
|
}
|
|
if (_this.props.onCropAreaChange) {
|
|
_this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
|
|
}
|
|
};
|
|
_this.emitCropAreaChange = function () {
|
|
var cropData = _this.getCropData();
|
|
if (!cropData) return;
|
|
var croppedAreaPercentages = cropData.croppedAreaPercentages,
|
|
croppedAreaPixels = cropData.croppedAreaPixels;
|
|
if (_this.props.onCropAreaChange) {
|
|
_this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
|
|
}
|
|
};
|
|
_this.recomputeCropPosition = function () {
|
|
if (!_this.state.cropSize) return;
|
|
var newPosition = _this.props.restrictPosition ? restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop;
|
|
_this.props.onCropChange(newPosition);
|
|
_this.emitCropData();
|
|
};
|
|
_this.onKeyDown = function (event) {
|
|
var _a = _this.props,
|
|
crop = _a.crop,
|
|
onCropChange = _a.onCropChange,
|
|
keyboardStep = _a.keyboardStep,
|
|
zoom = _a.zoom,
|
|
rotation = _a.rotation;
|
|
var step = keyboardStep;
|
|
if (!_this.state.cropSize) return;
|
|
var newCrop = __assign({}, crop);
|
|
switch (event.key) {
|
|
case 'ArrowUp':
|
|
newCrop.y -= step;
|
|
break;
|
|
case 'ArrowDown':
|
|
newCrop.y += step;
|
|
break;
|
|
case 'ArrowLeft':
|
|
newCrop.x -= step;
|
|
break;
|
|
case 'ArrowRight':
|
|
newCrop.x += step;
|
|
break;
|
|
default:
|
|
return;
|
|
}
|
|
if (_this.props.restrictPosition) {
|
|
newCrop = restrictPosition(newCrop, _this.mediaSize, _this.state.cropSize, zoom, rotation);
|
|
}
|
|
onCropChange(newCrop);
|
|
};
|
|
return _this;
|
|
}
|
|
Cropper.prototype.componentDidMount = function () {
|
|
if (!this.currentDoc || !this.currentWindow) return;
|
|
if (this.containerRef) {
|
|
if (this.containerRef.ownerDocument) {
|
|
this.currentDoc = this.containerRef.ownerDocument;
|
|
}
|
|
if (this.currentDoc.defaultView) {
|
|
this.currentWindow = this.currentDoc.defaultView;
|
|
}
|
|
this.initResizeObserver();
|
|
// only add window resize listener if ResizeObserver is not supported. Otherwise, it would be redundant
|
|
if (typeof window.ResizeObserver === 'undefined') {
|
|
this.currentWindow.addEventListener('resize', this.computeSizes);
|
|
}
|
|
this.props.zoomWithScroll && this.containerRef.addEventListener('wheel', this.onWheel, {
|
|
passive: false
|
|
});
|
|
this.containerRef.addEventListener('gesturestart', this.onGestureStart);
|
|
}
|
|
this.currentDoc.addEventListener('scroll', this.onScroll);
|
|
if (!this.props.disableAutomaticStylesInjection) {
|
|
this.styleRef = this.currentDoc.createElement('style');
|
|
this.styleRef.setAttribute('type', 'text/css');
|
|
if (this.props.nonce) {
|
|
this.styleRef.setAttribute('nonce', this.props.nonce);
|
|
}
|
|
this.styleRef.innerHTML = css_248z;
|
|
this.currentDoc.head.appendChild(this.styleRef);
|
|
}
|
|
// when rendered via SSR, the image can already be loaded and its onLoad callback will never be called
|
|
if (this.imageRef.current && this.imageRef.current.complete) {
|
|
this.onMediaLoad();
|
|
}
|
|
// set image and video refs in the parent if the callbacks exist
|
|
if (this.props.setImageRef) {
|
|
this.props.setImageRef(this.imageRef);
|
|
}
|
|
if (this.props.setVideoRef) {
|
|
this.props.setVideoRef(this.videoRef);
|
|
}
|
|
};
|
|
Cropper.prototype.componentWillUnmount = function () {
|
|
var _a, _b;
|
|
if (!this.currentDoc || !this.currentWindow) return;
|
|
if (typeof window.ResizeObserver === 'undefined') {
|
|
this.currentWindow.removeEventListener('resize', this.computeSizes);
|
|
}
|
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
if (this.containerRef) {
|
|
this.containerRef.removeEventListener('gesturestart', this.preventZoomSafari);
|
|
}
|
|
if (this.styleRef) {
|
|
(_b = this.styleRef.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.styleRef);
|
|
}
|
|
this.cleanEvents();
|
|
this.props.zoomWithScroll && this.clearScrollEvent();
|
|
};
|
|
Cropper.prototype.componentDidUpdate = function (prevProps) {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
if (prevProps.rotation !== this.props.rotation) {
|
|
this.computeSizes();
|
|
this.recomputeCropPosition();
|
|
} else if (prevProps.aspect !== this.props.aspect) {
|
|
this.computeSizes();
|
|
} else if (prevProps.objectFit !== this.props.objectFit) {
|
|
this.computeSizes();
|
|
} else if (prevProps.zoom !== this.props.zoom) {
|
|
this.recomputeCropPosition();
|
|
} else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) {
|
|
this.computeSizes();
|
|
} else if (((_e = prevProps.crop) === null || _e === void 0 ? void 0 : _e.x) !== ((_f = this.props.crop) === null || _f === void 0 ? void 0 : _f.x) || ((_g = prevProps.crop) === null || _g === void 0 ? void 0 : _g.y) !== ((_h = this.props.crop) === null || _h === void 0 ? void 0 : _h.y)) {
|
|
this.emitCropAreaChange();
|
|
}
|
|
if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) {
|
|
this.props.zoomWithScroll ? this.containerRef.addEventListener('wheel', this.onWheel, {
|
|
passive: false
|
|
}) : this.clearScrollEvent();
|
|
}
|
|
if (prevProps.video !== this.props.video) {
|
|
(_j = this.videoRef.current) === null || _j === void 0 ? void 0 : _j.load();
|
|
}
|
|
var objectFit = this.getObjectFit();
|
|
if (objectFit !== this.state.mediaObjectFit) {
|
|
this.setState({
|
|
mediaObjectFit: objectFit
|
|
}, this.computeSizes);
|
|
}
|
|
};
|
|
Cropper.prototype.getAspect = function () {
|
|
var _a = this.props,
|
|
cropSize = _a.cropSize,
|
|
aspect = _a.aspect;
|
|
if (cropSize) {
|
|
return cropSize.width / cropSize.height;
|
|
}
|
|
return aspect;
|
|
};
|
|
Cropper.prototype.getObjectFit = function () {
|
|
var _a, _b, _c, _d;
|
|
if (this.props.objectFit === 'cover') {
|
|
var mediaRef = this.imageRef.current || this.videoRef.current;
|
|
if (mediaRef && this.containerRef) {
|
|
this.containerRect = this.containerRef.getBoundingClientRect();
|
|
var containerAspect = this.containerRect.width / this.containerRect.height;
|
|
var naturalWidth = ((_a = this.imageRef.current) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = this.videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0;
|
|
var naturalHeight = ((_c = this.imageRef.current) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = this.videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0;
|
|
var mediaAspect = naturalWidth / naturalHeight;
|
|
return mediaAspect < containerAspect ? 'horizontal-cover' : 'vertical-cover';
|
|
}
|
|
return 'horizontal-cover';
|
|
}
|
|
return this.props.objectFit;
|
|
};
|
|
Cropper.prototype.onPinchStart = function (e) {
|
|
var pointA = Cropper.getTouchPoint(e.touches[0]);
|
|
var pointB = Cropper.getTouchPoint(e.touches[1]);
|
|
this.lastPinchDistance = getDistanceBetweenPoints(pointA, pointB);
|
|
this.lastPinchRotation = getRotationBetweenPoints(pointA, pointB);
|
|
this.onDragStart(getCenter(pointA, pointB));
|
|
};
|
|
Cropper.prototype.onPinchMove = function (e) {
|
|
var _this = this;
|
|
if (!this.currentDoc || !this.currentWindow) return;
|
|
var pointA = Cropper.getTouchPoint(e.touches[0]);
|
|
var pointB = Cropper.getTouchPoint(e.touches[1]);
|
|
var center = getCenter(pointA, pointB);
|
|
this.onDrag(center);
|
|
if (this.rafPinchTimeout) this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout);
|
|
this.rafPinchTimeout = this.currentWindow.requestAnimationFrame(function () {
|
|
var distance = getDistanceBetweenPoints(pointA, pointB);
|
|
var newZoom = _this.props.zoom * (distance / _this.lastPinchDistance);
|
|
_this.setNewZoom(newZoom, center, {
|
|
shouldUpdatePosition: false
|
|
});
|
|
_this.lastPinchDistance = distance;
|
|
var rotation = getRotationBetweenPoints(pointA, pointB);
|
|
var newRotation = _this.props.rotation + (rotation - _this.lastPinchRotation);
|
|
_this.props.onRotationChange && _this.props.onRotationChange(newRotation);
|
|
_this.lastPinchRotation = rotation;
|
|
});
|
|
};
|
|
Cropper.prototype.render = function () {
|
|
var _this = this;
|
|
var _a;
|
|
var _b = this.props,
|
|
image = _b.image,
|
|
video = _b.video,
|
|
mediaProps = _b.mediaProps,
|
|
transform = _b.transform,
|
|
_c = _b.crop,
|
|
x = _c.x,
|
|
y = _c.y,
|
|
rotation = _b.rotation,
|
|
zoom = _b.zoom,
|
|
cropShape = _b.cropShape,
|
|
showGrid = _b.showGrid,
|
|
_d = _b.style,
|
|
containerStyle = _d.containerStyle,
|
|
cropAreaStyle = _d.cropAreaStyle,
|
|
mediaStyle = _d.mediaStyle,
|
|
_e = _b.classes,
|
|
containerClassName = _e.containerClassName,
|
|
cropAreaClassName = _e.cropAreaClassName,
|
|
mediaClassName = _e.mediaClassName;
|
|
var objectFit = (_a = this.state.mediaObjectFit) !== null && _a !== void 0 ? _a : this.getObjectFit();
|
|
return _react_17_0_2_react.createElement("div", {
|
|
onMouseDown: this.onMouseDown,
|
|
onTouchStart: this.onTouchStart,
|
|
ref: function ref(el) {
|
|
return _this.containerRef = el;
|
|
},
|
|
"data-testid": "container",
|
|
style: containerStyle,
|
|
className: classNames('reactEasyCrop_Container', containerClassName)
|
|
}, image ? _react_17_0_2_react.createElement("img", __assign({
|
|
alt: "",
|
|
className: classNames('reactEasyCrop_Image', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName)
|
|
}, mediaProps, {
|
|
src: image,
|
|
ref: this.imageRef,
|
|
style: __assign(__assign({}, mediaStyle), {
|
|
transform: transform || "translate(".concat(x, "px, ").concat(y, "px) rotate(").concat(rotation, "deg) scale(").concat(zoom, ")")
|
|
}),
|
|
onLoad: this.onMediaLoad
|
|
})) : video && _react_17_0_2_react.createElement("video", __assign({
|
|
autoPlay: true,
|
|
playsInline: true,
|
|
loop: true,
|
|
muted: true,
|
|
className: classNames('reactEasyCrop_Video', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName)
|
|
}, mediaProps, {
|
|
ref: this.videoRef,
|
|
onLoadedMetadata: this.onMediaLoad,
|
|
style: __assign(__assign({}, mediaStyle), {
|
|
transform: transform || "translate(".concat(x, "px, ").concat(y, "px) rotate(").concat(rotation, "deg) scale(").concat(zoom, ")")
|
|
}),
|
|
controls: false
|
|
}), (Array.isArray(video) ? video : [{
|
|
src: video
|
|
}]).map(function (item) {
|
|
return _react_17_0_2_react.createElement("source", __assign({
|
|
key: item.src
|
|
}, item));
|
|
})), this.state.cropSize && _react_17_0_2_react.createElement("div", {
|
|
style: __assign(__assign({}, cropAreaStyle), {
|
|
width: this.state.cropSize.width,
|
|
height: this.state.cropSize.height
|
|
}),
|
|
tabIndex: 0,
|
|
onKeyDown: this.onKeyDown,
|
|
"data-testid": "cropper",
|
|
className: classNames('reactEasyCrop_CropArea', cropShape === 'round' && 'reactEasyCrop_CropAreaRound', showGrid && 'reactEasyCrop_CropAreaGrid', cropAreaClassName)
|
|
}));
|
|
};
|
|
Cropper.defaultProps = {
|
|
zoom: 1,
|
|
rotation: 0,
|
|
aspect: 4 / 3,
|
|
maxZoom: MAX_ZOOM,
|
|
minZoom: MIN_ZOOM,
|
|
cropShape: 'rect',
|
|
objectFit: 'contain',
|
|
showGrid: true,
|
|
style: {},
|
|
classes: {},
|
|
mediaProps: {},
|
|
zoomSpeed: 1,
|
|
restrictPosition: true,
|
|
zoomWithScroll: true,
|
|
keyboardStep: KEYBOARD_STEP
|
|
};
|
|
Cropper.getMousePoint = function (e) {
|
|
return {
|
|
x: Number(e.clientX),
|
|
y: Number(e.clientY)
|
|
};
|
|
};
|
|
Cropper.getTouchPoint = function (touch) {
|
|
return {
|
|
x: Number(touch.clientX),
|
|
y: Number(touch.clientY)
|
|
};
|
|
};
|
|
return Cropper;
|
|
}(_react_17_0_2_react.Component);
|
|
|
|
|
|
//# sourceMappingURL=index.module.js.map
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd-img-crop@4.23.0@antd-img-crop/dist/antd-img-crop.esm.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const PREFIX = 'img-crop';
|
|
const ZOOM_INITIAL = 1;
|
|
const ZOOM_STEP = 0.1;
|
|
const ROTATION_INITIAL = 0;
|
|
const ROTATION_MIN = -180;
|
|
const ROTATION_MAX = 180;
|
|
const ROTATION_STEP = 1;
|
|
const ASPECT_MIN = 0.5;
|
|
const ASPECT_MAX = 2;
|
|
const ASPECT_STEP = 0.01;
|
|
|
|
const EasyCrop = (0,_react_17_0_2_react.forwardRef)((props, ref) => {
|
|
const { cropperRef, zoomSlider, rotationSlider, aspectSlider, showReset, resetBtnText, modalImage, aspect: ASPECT_INITIAL, minZoom, maxZoom, cropShape, showGrid, cropperProps, } = props;
|
|
const [zoom, setZoom] = (0,_react_17_0_2_react.useState)(ZOOM_INITIAL);
|
|
const [rotation, setRotation] = (0,_react_17_0_2_react.useState)(ROTATION_INITIAL);
|
|
const [aspect, setAspect] = (0,_react_17_0_2_react.useState)(ASPECT_INITIAL);
|
|
const isResetActive = zoom !== ZOOM_INITIAL ||
|
|
rotation !== ROTATION_INITIAL ||
|
|
aspect !== ASPECT_INITIAL;
|
|
const onReset = () => {
|
|
setZoom(ZOOM_INITIAL);
|
|
setRotation(ROTATION_INITIAL);
|
|
setAspect(ASPECT_INITIAL);
|
|
};
|
|
const [crop, onCropChange] = (0,_react_17_0_2_react.useState)({ x: 0, y: 0 });
|
|
const cropPixelsRef = (0,_react_17_0_2_react.useRef)({ width: 0, height: 0, x: 0, y: 0 });
|
|
const onCropComplete = (0,_react_17_0_2_react.useCallback)((_, croppedAreaPixels) => {
|
|
cropPixelsRef.current = croppedAreaPixels;
|
|
}, []);
|
|
(0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({
|
|
rotation,
|
|
cropPixelsRef,
|
|
onReset,
|
|
}));
|
|
const wrapperClass = '[display:flex] [align-items:center] [width:60%] [margin-inline:auto]';
|
|
const buttonClass = '[display:flex] [align-items:center] [justify-content:center] [height:32px] [width:32px] [background:transparent] [border:0] [font-family:inherit] [font-size:18px] [cursor:pointer] disabled:[opacity:20%] disabled:[cursor:default]';
|
|
const sliderClass = '[flex:1]';
|
|
return ((0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [(0,jsx_runtime.jsx)(Cropper, Object.assign({}, cropperProps, { ref: cropperRef, image: modalImage, crop: crop,
|
|
//
|
|
zoom: zoom, rotation: rotation, aspect: aspect, minZoom: minZoom, maxZoom: maxZoom, zoomWithScroll: zoomSlider,
|
|
//
|
|
cropShape: cropShape, showGrid: showGrid, onCropChange: onCropChange, onZoomChange: setZoom, onRotationChange: setRotation, onCropComplete: onCropComplete, classes: {
|
|
containerClassName: `${PREFIX}-container ![position:relative] [width:100%] [height:40vh] [&~section:first-of-type]:[margin-top:16px] [&~section:last-of-type]:[margin-bottom:16px]`,
|
|
mediaClassName: `${PREFIX}-media`,
|
|
} })), zoomSlider && ((0,jsx_runtime.jsxs)("section", { className: `${PREFIX}-control ${PREFIX}-control-zoom ${wrapperClass}`, children: [(0,jsx_runtime.jsx)("button", { className: buttonClass, onClick: () => setZoom(+(zoom - ZOOM_STEP).toFixed(1)), disabled: zoom - ZOOM_STEP < minZoom, children: "\uFF0D" }), (0,jsx_runtime.jsx)(slider, { className: sliderClass, min: minZoom, max: maxZoom, step: ZOOM_STEP, value: zoom, onChange: setZoom }), (0,jsx_runtime.jsx)("button", { className: buttonClass, onClick: () => setZoom(+(zoom + ZOOM_STEP).toFixed(1)), disabled: zoom + ZOOM_STEP > maxZoom, children: "\uFF0B" })] })), rotationSlider && ((0,jsx_runtime.jsxs)("section", { className: `${PREFIX}-control ${PREFIX}-control-rotation ${wrapperClass}`, children: [(0,jsx_runtime.jsx)("button", { className: `${buttonClass} [font-size:16px]`, onClick: () => setRotation(rotation - ROTATION_STEP), disabled: rotation === ROTATION_MIN, children: "\u21BA" }), (0,jsx_runtime.jsx)(slider, { className: sliderClass, min: ROTATION_MIN, max: ROTATION_MAX, step: ROTATION_STEP, value: rotation, onChange: setRotation }), (0,jsx_runtime.jsx)("button", { className: `${buttonClass} [font-size:16px]`, onClick: () => setRotation(rotation + ROTATION_STEP), disabled: rotation === ROTATION_MAX, children: "\u21BB" })] })), aspectSlider && ((0,jsx_runtime.jsxs)("section", { className: `${PREFIX}-control ${PREFIX}-control-aspect ${wrapperClass}`, children: [(0,jsx_runtime.jsx)("button", { className: buttonClass, onClick: () => setAspect(+(aspect - ASPECT_STEP).toFixed(2)), disabled: aspect - ASPECT_STEP < ASPECT_MIN, children: "\u2195\uFE0F" }), (0,jsx_runtime.jsx)(slider, { className: sliderClass, min: ASPECT_MIN, max: ASPECT_MAX, step: ASPECT_STEP, value: aspect, onChange: setAspect }), (0,jsx_runtime.jsx)("button", { className: buttonClass, onClick: () => setAspect(+(aspect + ASPECT_STEP).toFixed(2)), disabled: aspect + ASPECT_STEP > ASPECT_MAX, children: "\u2194\uFE0F" })] })), showReset && (zoomSlider || rotationSlider || aspectSlider) && ((0,jsx_runtime.jsx)(es_button/* default */.ZP, { className: "[bottom:20px] [position:absolute]", style: isResetActive ? {} : { opacity: 0.3, pointerEvents: 'none' }, onClick: onReset, children: resetBtnText }))] }));
|
|
});
|
|
var EasyCrop$1 = (0,_react_17_0_2_react.memo)(EasyCrop);
|
|
|
|
function styleInject(css, ref) {
|
|
if ( ref === void 0 ) ref = {};
|
|
var insertAt = ref.insertAt;
|
|
|
|
if (typeof document === 'undefined') { return; }
|
|
|
|
var head = document.head || document.getElementsByTagName('head')[0];
|
|
var style = document.createElement('style');
|
|
style.type = 'text/css';
|
|
|
|
if (insertAt === 'top') {
|
|
if (head.firstChild) {
|
|
head.insertBefore(style, head.firstChild);
|
|
} else {
|
|
head.appendChild(style);
|
|
}
|
|
} else {
|
|
head.appendChild(style);
|
|
}
|
|
|
|
if (style.styleSheet) {
|
|
style.styleSheet.cssText = css;
|
|
} else {
|
|
style.appendChild(document.createTextNode(css));
|
|
}
|
|
}
|
|
|
|
var antd_img_crop_esm_css_248z = ".\\[align-items\\:center\\]{align-items:center}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.\\[bottom\\:20px\\]{bottom:20px}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[display\\:flex\\]{display:flex}.\\[flex\\:1\\]{flex:1}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[justify-content\\:center\\]{justify-content:center}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[position\\:absolute\\]{position:absolute}.\\!\\[position\\:relative\\]{position:relative!important}.\\[width\\:100\\%\\]{width:100%}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.disabled\\:\\[cursor\\:default\\]:disabled{cursor:default}.disabled\\:\\[opacity\\:20\\%\\]:disabled{opacity:20%}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]~section:first-of-type{margin-top:16px}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]~section:last-of-type{margin-bottom:16px}";
|
|
styleInject(antd_img_crop_esm_css_248z,{"insertAt":"top"});
|
|
|
|
const ImgCrop = (0,_react_17_0_2_react.forwardRef)((props, cropperRef) => {
|
|
const { quality = 0.4, fillColor = 'white', zoomSlider = true, rotationSlider = false, aspectSlider = false, showReset = false, resetText, aspect = 1, minZoom = 1, maxZoom = 3, cropShape = 'rect', showGrid = false, cropperProps, modalClassName, modalTitle, modalWidth, modalOk, modalCancel, onModalOk, onModalCancel, modalProps, beforeCrop, children, } = props;
|
|
const cb = (0,_react_17_0_2_react.useRef)({});
|
|
cb.current.onModalOk = onModalOk;
|
|
cb.current.onModalCancel = onModalCancel;
|
|
cb.current.beforeCrop = beforeCrop;
|
|
/**
|
|
* crop
|
|
*/
|
|
const easyCropRef = (0,_react_17_0_2_react.useRef)(null);
|
|
const getCropCanvas = (0,_react_17_0_2_react.useCallback)((target) => {
|
|
var _a;
|
|
const canvas = document.createElement('canvas');
|
|
const ctx = canvas.getContext('2d');
|
|
const context = ((_a = target === null || target === void 0 ? void 0 : target.getRootNode) === null || _a === void 0 ? void 0 : _a.call(target)) || document;
|
|
const imgSource = context.querySelector(`.${PREFIX}-media`);
|
|
const { width: cropWidth, height: cropHeight, x: cropX, y: cropY, } = easyCropRef.current.cropPixelsRef.current;
|
|
if (rotationSlider &&
|
|
easyCropRef.current.rotation !== ROTATION_INITIAL) {
|
|
const { naturalWidth: imgWidth, naturalHeight: imgHeight } = imgSource;
|
|
const angle = easyCropRef.current.rotation * (Math.PI / 180);
|
|
// get container for rotated image
|
|
const sine = Math.abs(Math.sin(angle));
|
|
const cosine = Math.abs(Math.cos(angle));
|
|
const squareWidth = imgWidth * cosine + imgHeight * sine;
|
|
const squareHeight = imgHeight * cosine + imgWidth * sine;
|
|
canvas.width = squareWidth;
|
|
canvas.height = squareHeight;
|
|
ctx.fillStyle = fillColor;
|
|
ctx.fillRect(0, 0, squareWidth, squareHeight);
|
|
// rotate container
|
|
const squareHalfWidth = squareWidth / 2;
|
|
const squareHalfHeight = squareHeight / 2;
|
|
ctx.translate(squareHalfWidth, squareHalfHeight);
|
|
ctx.rotate(angle);
|
|
ctx.translate(-squareHalfWidth, -squareHalfHeight);
|
|
// draw rotated image
|
|
const imgX = (squareWidth - imgWidth) / 2;
|
|
const imgY = (squareHeight - imgHeight) / 2;
|
|
ctx.drawImage(imgSource, 0, 0, imgWidth, imgHeight, imgX, imgY, imgWidth, imgHeight);
|
|
// crop rotated image
|
|
const imgData = ctx.getImageData(0, 0, squareWidth, squareHeight);
|
|
canvas.width = cropWidth;
|
|
canvas.height = cropHeight;
|
|
ctx.putImageData(imgData, -cropX, -cropY);
|
|
}
|
|
else {
|
|
canvas.width = cropWidth;
|
|
canvas.height = cropHeight;
|
|
ctx.fillStyle = fillColor;
|
|
ctx.fillRect(0, 0, cropWidth, cropHeight);
|
|
ctx.drawImage(imgSource, cropX, cropY, cropWidth, cropHeight, 0, 0, cropWidth, cropHeight);
|
|
}
|
|
return canvas;
|
|
}, [fillColor, rotationSlider]);
|
|
/**
|
|
* upload
|
|
*/
|
|
const [modalImage, setModalImage] = (0,_react_17_0_2_react.useState)('');
|
|
const onCancel = (0,_react_17_0_2_react.useRef)();
|
|
const onOk = (0,_react_17_0_2_react.useRef)();
|
|
const runBeforeUpload = (0,_react_17_0_2_react.useCallback)((_a) => __awaiter(void 0, [_a], void 0, function* ({ beforeUpload, file, resolve, reject, }) {
|
|
const rawFile = file;
|
|
if (typeof beforeUpload !== 'function') {
|
|
resolve(rawFile);
|
|
return;
|
|
}
|
|
try {
|
|
// https://ant.design/components/upload-cn#api
|
|
// https://github.com/ant-design/ant-design/blob/master/components/upload/Upload.tsx#L152-L178
|
|
const result = yield beforeUpload(file, [file]);
|
|
if (result === false) {
|
|
resolve(false);
|
|
}
|
|
else {
|
|
resolve((result !== true && result) || rawFile);
|
|
}
|
|
}
|
|
catch (err) {
|
|
reject(err);
|
|
}
|
|
}), []);
|
|
const getNewBeforeUpload = (0,_react_17_0_2_react.useCallback)((beforeUpload) => {
|
|
return ((file, fileList) => {
|
|
return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
|
|
let processedFile = file;
|
|
if (typeof cb.current.beforeCrop === 'function') {
|
|
try {
|
|
const result = yield cb.current.beforeCrop(file, fileList);
|
|
if (result === false) {
|
|
return runBeforeUpload({ beforeUpload, file, resolve, reject }); // not open modal
|
|
}
|
|
if (result !== true) {
|
|
processedFile = result || file; // will open modal
|
|
}
|
|
}
|
|
catch (err) {
|
|
return runBeforeUpload({ beforeUpload, file, resolve, reject }); // not open modal
|
|
}
|
|
}
|
|
// read file
|
|
const reader = new FileReader();
|
|
reader.addEventListener('load', () => {
|
|
if (typeof reader.result === 'string') {
|
|
setModalImage(reader.result); // open modal
|
|
}
|
|
});
|
|
reader.readAsDataURL(processedFile);
|
|
// on modal cancel
|
|
onCancel.current = () => {
|
|
var _a, _b;
|
|
setModalImage('');
|
|
easyCropRef.current.onReset();
|
|
let hasResolveCalled = false;
|
|
(_b = (_a = cb.current).onModalCancel) === null || _b === void 0 ? void 0 : _b.call(_a, (LIST_IGNORE) => {
|
|
resolve(LIST_IGNORE);
|
|
hasResolveCalled = true;
|
|
});
|
|
if (!hasResolveCalled) {
|
|
resolve(upload/* default */.Z.LIST_IGNORE);
|
|
}
|
|
};
|
|
// on modal confirm
|
|
onOk.current = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
setModalImage('');
|
|
easyCropRef.current.onReset();
|
|
const canvas = getCropCanvas(event.target);
|
|
const { type, name, uid } = processedFile;
|
|
canvas.toBlob((blob) => __awaiter(void 0, void 0, void 0, function* () {
|
|
const newFile = new File([blob], name, { type });
|
|
Object.assign(newFile, { uid });
|
|
runBeforeUpload({
|
|
beforeUpload,
|
|
file: newFile,
|
|
resolve: (file) => {
|
|
var _a, _b;
|
|
resolve(file);
|
|
(_b = (_a = cb.current).onModalOk) === null || _b === void 0 ? void 0 : _b.call(_a, file);
|
|
},
|
|
reject: (err) => {
|
|
var _a, _b;
|
|
reject(err);
|
|
(_b = (_a = cb.current).onModalOk) === null || _b === void 0 ? void 0 : _b.call(_a, err);
|
|
},
|
|
});
|
|
}), type, quality);
|
|
});
|
|
}));
|
|
});
|
|
}, [getCropCanvas, quality, runBeforeUpload]);
|
|
const getNewUpload = (0,_react_17_0_2_react.useCallback)((children) => {
|
|
const upload = Array.isArray(children) ? children[0] : children;
|
|
const _a = upload.props, { beforeUpload, accept } = _a, restUploadProps = __rest(_a, ["beforeUpload", "accept"]);
|
|
return Object.assign(Object.assign({}, upload), { props: Object.assign(Object.assign({}, restUploadProps), { accept: accept || 'image/*', beforeUpload: getNewBeforeUpload(beforeUpload) }) });
|
|
}, [getNewBeforeUpload]);
|
|
/**
|
|
* modal
|
|
*/
|
|
const modalBaseProps = (0,_react_17_0_2_react.useMemo)(() => {
|
|
const obj = {};
|
|
if (modalWidth !== undefined)
|
|
obj.width = modalWidth;
|
|
if (modalOk !== undefined)
|
|
obj.okText = modalOk;
|
|
if (modalCancel !== undefined)
|
|
obj.cancelText = modalCancel;
|
|
return obj;
|
|
}, [modalCancel, modalOk, modalWidth]);
|
|
const wrapClassName = `${PREFIX}-modal${modalClassName ? ` ${modalClassName}` : ''}`;
|
|
const lang = typeof window === 'undefined' ? '' : window.navigator.language;
|
|
const isCN = lang === 'zh-CN';
|
|
const title = modalTitle || (isCN ? '编辑图片' : 'Edit image');
|
|
const resetBtnText = resetText || (isCN ? '重置' : 'Reset');
|
|
return ((0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [getNewUpload(children), modalImage && ((0,jsx_runtime.jsx)(modal/* default */.Z, Object.assign({}, modalProps, modalBaseProps, { open: true, title: title, onCancel: onCancel.current, onOk: onOk.current, wrapClassName: wrapClassName, maskClosable: false, destroyOnClose: true, children: (0,jsx_runtime.jsx)(EasyCrop$1, { ref: easyCropRef, cropperRef: cropperRef, zoomSlider: zoomSlider, rotationSlider: rotationSlider, aspectSlider: aspectSlider, showReset: showReset, resetBtnText: resetBtnText, modalImage: modalImage, aspect: aspect, minZoom: minZoom, maxZoom: maxZoom, cropShape: cropShape, showGrid: showGrid, cropperProps: cropperProps }) })))] }));
|
|
});
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 77578:
|
|
/*!**********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/_util/getRenderPropValue.js ***!
|
|
\**********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ Z: function() { return /* binding */ getRenderPropValue; }
|
|
/* harmony export */ });
|
|
const getRenderPropValue = propValue => {
|
|
if (!propValue) {
|
|
return null;
|
|
}
|
|
if (typeof propValue === 'function') {
|
|
return propValue();
|
|
}
|
|
return propValue;
|
|
};
|
|
|
|
/***/ }),
|
|
|
|
/***/ 26743:
|
|
/*!**********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/avatar/index.js + 4 modules ***!
|
|
\**********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
C: function() { return /* binding */ es_avatar; }
|
|
});
|
|
|
|
// UNUSED EXPORTS: Group
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-resize-observer@1.4.0@rc-resize-observer/es/index.js + 4 modules
|
|
var es = __webpack_require__(28647);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/ref.js
|
|
var es_ref = __webpack_require__(25629);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/responsiveObserver.js
|
|
var responsiveObserver = __webpack_require__(69507);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
var context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/grid/hooks/useBreakpoint.js
|
|
var useBreakpoint = __webpack_require__(8628);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/avatar/AvatarContext.js
|
|
|
|
const AvatarContext = /*#__PURE__*/_react_17_0_2_react.createContext({});
|
|
/* harmony default export */ var avatar_AvatarContext = (AvatarContext);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
var style = __webpack_require__(17313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(37613);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/avatar/style/index.js
|
|
|
|
|
|
const genBaseStyle = token => {
|
|
const {
|
|
antCls,
|
|
componentCls,
|
|
iconCls,
|
|
avatarBg,
|
|
avatarColor,
|
|
containerSize,
|
|
containerSizeLG,
|
|
containerSizeSM,
|
|
textFontSize,
|
|
textFontSizeLG,
|
|
textFontSizeSM,
|
|
borderRadius,
|
|
borderRadiusLG,
|
|
borderRadiusSM,
|
|
lineWidth,
|
|
lineType
|
|
} = token;
|
|
// Avatar size style
|
|
const avatarSizeStyle = (size, fontSize, radius) => ({
|
|
width: size,
|
|
height: size,
|
|
lineHeight: `${size - lineWidth * 2}px`,
|
|
borderRadius: '50%',
|
|
[`&${componentCls}-square`]: {
|
|
borderRadius: radius
|
|
},
|
|
[`${componentCls}-string`]: {
|
|
position: 'absolute',
|
|
left: {
|
|
_skip_check_: true,
|
|
value: '50%'
|
|
},
|
|
transformOrigin: '0 center'
|
|
},
|
|
[`&${componentCls}-icon`]: {
|
|
fontSize,
|
|
[`> ${iconCls}`]: {
|
|
margin: 0
|
|
}
|
|
}
|
|
});
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
overflow: 'hidden',
|
|
color: avatarColor,
|
|
whiteSpace: 'nowrap',
|
|
textAlign: 'center',
|
|
verticalAlign: 'middle',
|
|
background: avatarBg,
|
|
border: `${lineWidth}px ${lineType} transparent`,
|
|
[`&-image`]: {
|
|
background: 'transparent'
|
|
},
|
|
[`${antCls}-image-img`]: {
|
|
display: 'block'
|
|
}
|
|
}), avatarSizeStyle(containerSize, textFontSize, borderRadius)), {
|
|
[`&-lg`]: Object.assign({}, avatarSizeStyle(containerSizeLG, textFontSizeLG, borderRadiusLG)),
|
|
[`&-sm`]: Object.assign({}, avatarSizeStyle(containerSizeSM, textFontSizeSM, borderRadiusSM)),
|
|
'> img': {
|
|
display: 'block',
|
|
width: '100%',
|
|
height: '100%',
|
|
objectFit: 'cover'
|
|
}
|
|
})
|
|
};
|
|
};
|
|
const genGroupStyle = token => {
|
|
const {
|
|
componentCls,
|
|
groupBorderColor,
|
|
groupOverlapping,
|
|
groupSpace
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-group`]: {
|
|
display: 'inline-flex',
|
|
[`${componentCls}`]: {
|
|
borderColor: groupBorderColor
|
|
},
|
|
[`> *:not(:first-child)`]: {
|
|
marginInlineStart: groupOverlapping
|
|
}
|
|
},
|
|
[`${componentCls}-group-popover`]: {
|
|
[`${componentCls} + ${componentCls}`]: {
|
|
marginInlineStart: groupSpace
|
|
}
|
|
}
|
|
};
|
|
};
|
|
/* harmony default export */ var avatar_style = ((0,genComponentStyleHook/* default */.Z)('Avatar', token => {
|
|
const {
|
|
colorTextLightSolid,
|
|
colorTextPlaceholder
|
|
} = token;
|
|
const avatarToken = (0,statistic/* merge */.TS)(token, {
|
|
avatarBg: colorTextPlaceholder,
|
|
avatarColor: colorTextLightSolid
|
|
});
|
|
return [genBaseStyle(avatarToken), genGroupStyle(avatarToken)];
|
|
}, token => {
|
|
const {
|
|
controlHeight,
|
|
controlHeightLG,
|
|
controlHeightSM,
|
|
fontSize,
|
|
fontSizeLG,
|
|
fontSizeXL,
|
|
fontSizeHeading3,
|
|
marginXS,
|
|
marginXXS,
|
|
colorBorderBg
|
|
} = token;
|
|
return {
|
|
containerSize: controlHeight,
|
|
containerSizeLG: controlHeightLG,
|
|
containerSizeSM: controlHeightSM,
|
|
textFontSize: Math.round((fontSizeLG + fontSizeXL) / 2),
|
|
textFontSizeLG: fontSizeHeading3,
|
|
textFontSizeSM: fontSize,
|
|
groupSpace: marginXXS,
|
|
groupOverlapping: -marginXS,
|
|
groupBorderColor: colorBorderBg
|
|
};
|
|
}));
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(19716);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/avatar/avatar.js
|
|
"use client";
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalAvatar = (props, ref) => {
|
|
const [scale, setScale] = _react_17_0_2_react.useState(1);
|
|
const [mounted, setMounted] = _react_17_0_2_react.useState(false);
|
|
const [isImgExist, setIsImgExist] = _react_17_0_2_react.useState(true);
|
|
const avatarNodeRef = _react_17_0_2_react.useRef(null);
|
|
const avatarChildrenRef = _react_17_0_2_react.useRef(null);
|
|
const avatarNodeMergeRef = (0,es_ref/* composeRef */.sQ)(ref, avatarNodeRef);
|
|
const {
|
|
getPrefixCls,
|
|
avatar
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const avatarCtx = _react_17_0_2_react.useContext(avatar_AvatarContext);
|
|
const setScaleParam = () => {
|
|
if (!avatarChildrenRef.current || !avatarNodeRef.current) {
|
|
return;
|
|
}
|
|
const childrenWidth = avatarChildrenRef.current.offsetWidth; // offsetWidth avoid affecting be transform scale
|
|
const nodeWidth = avatarNodeRef.current.offsetWidth;
|
|
// denominator is 0 is no meaning
|
|
if (childrenWidth !== 0 && nodeWidth !== 0) {
|
|
const {
|
|
gap = 4
|
|
} = props;
|
|
if (gap * 2 < nodeWidth) {
|
|
setScale(nodeWidth - gap * 2 < childrenWidth ? (nodeWidth - gap * 2) / childrenWidth : 1);
|
|
}
|
|
}
|
|
};
|
|
_react_17_0_2_react.useEffect(() => {
|
|
setMounted(true);
|
|
}, []);
|
|
_react_17_0_2_react.useEffect(() => {
|
|
setIsImgExist(true);
|
|
setScale(1);
|
|
}, [props.src]);
|
|
_react_17_0_2_react.useEffect(setScaleParam, [props.gap]);
|
|
const handleImgLoadError = () => {
|
|
const {
|
|
onError
|
|
} = props;
|
|
const errorFlag = onError === null || onError === void 0 ? void 0 : onError();
|
|
if (errorFlag !== false) {
|
|
setIsImgExist(false);
|
|
}
|
|
};
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
shape,
|
|
size: customSize,
|
|
src,
|
|
srcSet,
|
|
icon,
|
|
className,
|
|
rootClassName,
|
|
alt,
|
|
draggable,
|
|
children,
|
|
crossOrigin
|
|
} = props,
|
|
others = __rest(props, ["prefixCls", "shape", "size", "src", "srcSet", "icon", "className", "rootClassName", "alt", "draggable", "children", "crossOrigin"]);
|
|
const size = (0,useSize/* default */.Z)(ctxSize => {
|
|
var _a, _b;
|
|
return (_b = (_a = customSize !== null && customSize !== void 0 ? customSize : avatarCtx === null || avatarCtx === void 0 ? void 0 : avatarCtx.size) !== null && _a !== void 0 ? _a : ctxSize) !== null && _b !== void 0 ? _b : 'default';
|
|
});
|
|
const needResponsive = Object.keys(typeof size === 'object' ? size || {} : {}).some(key => ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key));
|
|
const screens = (0,useBreakpoint/* default */.Z)(needResponsive);
|
|
const responsiveSizeStyle = _react_17_0_2_react.useMemo(() => {
|
|
if (typeof size !== 'object') {
|
|
return {};
|
|
}
|
|
const currentBreakpoint = responsiveObserver/* responsiveArray */.c4.find(screen => screens[screen]);
|
|
const currentSize = size[currentBreakpoint];
|
|
return currentSize ? {
|
|
width: currentSize,
|
|
height: currentSize,
|
|
lineHeight: `${currentSize}px`,
|
|
fontSize: icon ? currentSize / 2 : 18
|
|
} : {};
|
|
}, [screens, size]);
|
|
false ? 0 : void 0;
|
|
const prefixCls = getPrefixCls('avatar', customizePrefixCls);
|
|
const [wrapSSR, hashId] = avatar_style(prefixCls);
|
|
const sizeCls = _classnames_2_5_1_classnames_default()({
|
|
[`${prefixCls}-lg`]: size === 'large',
|
|
[`${prefixCls}-sm`]: size === 'small'
|
|
});
|
|
const hasImageElement = /*#__PURE__*/_react_17_0_2_react.isValidElement(src);
|
|
const mergedShape = shape || (avatarCtx === null || avatarCtx === void 0 ? void 0 : avatarCtx.shape) || 'circle';
|
|
const classString = _classnames_2_5_1_classnames_default()(prefixCls, sizeCls, avatar === null || avatar === void 0 ? void 0 : avatar.className, `${prefixCls}-${mergedShape}`, {
|
|
[`${prefixCls}-image`]: hasImageElement || src && isImgExist,
|
|
[`${prefixCls}-icon`]: !!icon
|
|
}, className, rootClassName, hashId);
|
|
const sizeStyle = typeof size === 'number' ? {
|
|
width: size,
|
|
height: size,
|
|
lineHeight: `${size}px`,
|
|
fontSize: icon ? size / 2 : 18
|
|
} : {};
|
|
let childrenToRender;
|
|
if (typeof src === 'string' && isImgExist) {
|
|
childrenToRender = /*#__PURE__*/_react_17_0_2_react.createElement("img", {
|
|
src: src,
|
|
draggable: draggable,
|
|
srcSet: srcSet,
|
|
onError: handleImgLoadError,
|
|
alt: alt,
|
|
crossOrigin: crossOrigin
|
|
});
|
|
} else if (hasImageElement) {
|
|
childrenToRender = src;
|
|
} else if (icon) {
|
|
childrenToRender = icon;
|
|
} else if (mounted || scale !== 1) {
|
|
const transformString = `scale(${scale}) translateX(-50%)`;
|
|
const childrenStyle = {
|
|
msTransform: transformString,
|
|
WebkitTransform: transformString,
|
|
transform: transformString
|
|
};
|
|
const sizeChildrenStyle = typeof size === 'number' ? {
|
|
lineHeight: `${size}px`
|
|
} : {};
|
|
childrenToRender = /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, {
|
|
onResize: setScaleParam
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${prefixCls}-string`,
|
|
ref: avatarChildrenRef,
|
|
style: Object.assign(Object.assign({}, sizeChildrenStyle), childrenStyle)
|
|
}, children));
|
|
} else {
|
|
childrenToRender = /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
className: `${prefixCls}-string`,
|
|
style: {
|
|
opacity: 0
|
|
},
|
|
ref: avatarChildrenRef
|
|
}, children);
|
|
}
|
|
// The event is triggered twice from bubbling up the DOM tree.
|
|
// see https://codesandbox.io/s/kind-snow-9lidz
|
|
delete others.onError;
|
|
delete others.gap;
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("span", Object.assign({}, others, {
|
|
style: Object.assign(Object.assign(Object.assign(Object.assign({}, sizeStyle), responsiveSizeStyle), avatar === null || avatar === void 0 ? void 0 : avatar.style), others.style),
|
|
className: classString,
|
|
ref: avatarNodeMergeRef
|
|
}), childrenToRender));
|
|
};
|
|
const Avatar = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalAvatar);
|
|
if (false) {}
|
|
/* harmony default export */ var avatar = (Avatar);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/Children/toArray.js
|
|
var toArray = __webpack_require__(75440);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/popover/index.js
|
|
var popover = __webpack_require__(60324);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
|
|
var reactNode = __webpack_require__(92343);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/avatar/group.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const AvatarContextProvider = props => {
|
|
const {
|
|
size,
|
|
shape
|
|
} = _react_17_0_2_react.useContext(avatar_AvatarContext);
|
|
const avatarContextValue = _react_17_0_2_react.useMemo(() => ({
|
|
size: props.size || size,
|
|
shape: props.shape || shape
|
|
}), [props.size, props.shape, size, shape]);
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(avatar_AvatarContext.Provider, {
|
|
value: avatarContextValue
|
|
}, props.children);
|
|
};
|
|
const Group = props => {
|
|
const {
|
|
getPrefixCls,
|
|
direction
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
maxCount,
|
|
maxStyle,
|
|
size,
|
|
shape,
|
|
maxPopoverPlacement = 'top',
|
|
maxPopoverTrigger = 'hover',
|
|
children
|
|
} = props;
|
|
const prefixCls = getPrefixCls('avatar', customizePrefixCls);
|
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
const [wrapSSR, hashId] = avatar_style(prefixCls);
|
|
const cls = _classnames_2_5_1_classnames_default()(groupPrefixCls, {
|
|
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const childrenWithProps = (0,toArray/* default */.Z)(children).map((child, index) => (0,reactNode/* cloneElement */.Tm)(child, {
|
|
key: `avatar-key-${index}`
|
|
}));
|
|
const numOfChildren = childrenWithProps.length;
|
|
if (maxCount && maxCount < numOfChildren) {
|
|
const childrenShow = childrenWithProps.slice(0, maxCount);
|
|
const childrenHidden = childrenWithProps.slice(maxCount, numOfChildren);
|
|
childrenShow.push( /*#__PURE__*/_react_17_0_2_react.createElement(popover/* default */.Z, {
|
|
key: "avatar-popover-key",
|
|
content: childrenHidden,
|
|
trigger: maxPopoverTrigger,
|
|
placement: maxPopoverPlacement,
|
|
overlayClassName: `${groupPrefixCls}-popover`
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(avatar, {
|
|
style: maxStyle
|
|
}, `+${numOfChildren - maxCount}`)));
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(AvatarContextProvider, {
|
|
shape: shape,
|
|
size: size
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: cls,
|
|
style: style
|
|
}, childrenShow)));
|
|
}
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(AvatarContextProvider, {
|
|
shape: shape,
|
|
size: size
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: cls,
|
|
style: style
|
|
}, childrenWithProps)));
|
|
};
|
|
/* harmony default export */ var group = (Group);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/avatar/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
const avatar_Avatar = avatar;
|
|
avatar_Avatar.Group = group;
|
|
/* harmony default export */ var es_avatar = (avatar_Avatar);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 18889:
|
|
/*!********************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/card/index.js + 4 modules ***!
|
|
\********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ card; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.43.0@rc-util/es/omit.js
|
|
var omit = __webpack_require__(55405);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
var context = __webpack_require__(36355);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(19716);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
var skeleton = __webpack_require__(96865);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
|
|
var es_tabs = __webpack_require__(99313);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/card/Grid.js
|
|
"use client";
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
const Grid = _a => {
|
|
var {
|
|
prefixCls,
|
|
className,
|
|
hoverable = true
|
|
} = _a,
|
|
props = __rest(_a, ["prefixCls", "className", "hoverable"]);
|
|
const {
|
|
getPrefixCls
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const prefix = getPrefixCls('card', prefixCls);
|
|
const classString = _classnames_2_5_1_classnames_default()(`${prefix}-grid`, className, {
|
|
[`${prefix}-grid-hoverable`]: hoverable
|
|
});
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({}, props, {
|
|
className: classString
|
|
}));
|
|
};
|
|
/* harmony default export */ var card_Grid = (Grid);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
var style = __webpack_require__(17313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
var statistic = __webpack_require__(37613);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/card/style/index.js
|
|
|
|
|
|
// ============================== Styles ==============================
|
|
// ============================== Head ==============================
|
|
const genCardHeadStyle = token => {
|
|
const {
|
|
antCls,
|
|
componentCls,
|
|
headerHeight,
|
|
cardPaddingBase,
|
|
tabsMarginBottom
|
|
} = token;
|
|
return Object.assign(Object.assign({
|
|
display: 'flex',
|
|
justifyContent: 'center',
|
|
flexDirection: 'column',
|
|
minHeight: headerHeight,
|
|
marginBottom: -1,
|
|
padding: `0 ${cardPaddingBase}px`,
|
|
color: token.colorTextHeading,
|
|
fontWeight: token.fontWeightStrong,
|
|
fontSize: token.headerFontSize,
|
|
background: token.headerBg,
|
|
borderBottom: `${token.lineWidth}px ${token.lineType} ${token.colorBorderSecondary}`,
|
|
borderRadius: `${token.borderRadiusLG}px ${token.borderRadiusLG}px 0 0`
|
|
}, (0,style/* clearFix */.dF)()), {
|
|
'&-wrapper': {
|
|
width: '100%',
|
|
display: 'flex',
|
|
alignItems: 'center'
|
|
},
|
|
'&-title': Object.assign(Object.assign({
|
|
display: 'inline-block',
|
|
flex: 1
|
|
}, style/* textEllipsis */.vS), {
|
|
[`
|
|
> ${componentCls}-typography,
|
|
> ${componentCls}-typography-edit-content
|
|
`]: {
|
|
insetInlineStart: 0,
|
|
marginTop: 0,
|
|
marginBottom: 0
|
|
}
|
|
}),
|
|
[`${antCls}-tabs-top`]: {
|
|
clear: 'both',
|
|
marginBottom: tabsMarginBottom,
|
|
color: token.colorText,
|
|
fontWeight: 'normal',
|
|
fontSize: token.fontSize,
|
|
'&-bar': {
|
|
borderBottom: `${token.lineWidth}px ${token.lineType} ${token.colorBorderSecondary}`
|
|
}
|
|
}
|
|
});
|
|
};
|
|
// ============================== Grid ==============================
|
|
const genCardGridStyle = token => {
|
|
const {
|
|
cardPaddingBase,
|
|
colorBorderSecondary,
|
|
cardShadow,
|
|
lineWidth
|
|
} = token;
|
|
return {
|
|
width: '33.33%',
|
|
padding: cardPaddingBase,
|
|
border: 0,
|
|
borderRadius: 0,
|
|
boxShadow: `
|
|
${lineWidth}px 0 0 0 ${colorBorderSecondary},
|
|
0 ${lineWidth}px 0 0 ${colorBorderSecondary},
|
|
${lineWidth}px ${lineWidth}px 0 0 ${colorBorderSecondary},
|
|
${lineWidth}px 0 0 0 ${colorBorderSecondary} inset,
|
|
0 ${lineWidth}px 0 0 ${colorBorderSecondary} inset;
|
|
`,
|
|
transition: `all ${token.motionDurationMid}`,
|
|
'&-hoverable:hover': {
|
|
position: 'relative',
|
|
zIndex: 1,
|
|
boxShadow: cardShadow
|
|
}
|
|
};
|
|
};
|
|
// ============================== Actions ==============================
|
|
const genCardActionsStyle = token => {
|
|
const {
|
|
componentCls,
|
|
iconCls,
|
|
actionsLiMargin,
|
|
cardActionsIconSize,
|
|
colorBorderSecondary,
|
|
actionsBg
|
|
} = token;
|
|
return Object.assign(Object.assign({
|
|
margin: 0,
|
|
padding: 0,
|
|
listStyle: 'none',
|
|
background: actionsBg,
|
|
borderTop: `${token.lineWidth}px ${token.lineType} ${colorBorderSecondary}`,
|
|
display: 'flex',
|
|
borderRadius: `0 0 ${token.borderRadiusLG}px ${token.borderRadiusLG}px `
|
|
}, (0,style/* clearFix */.dF)()), {
|
|
'& > li': {
|
|
margin: actionsLiMargin,
|
|
color: token.colorTextDescription,
|
|
textAlign: 'center',
|
|
'> span': {
|
|
position: 'relative',
|
|
display: 'block',
|
|
minWidth: token.cardActionsIconSize * 2,
|
|
fontSize: token.fontSize,
|
|
lineHeight: token.lineHeight,
|
|
cursor: 'pointer',
|
|
'&:hover': {
|
|
color: token.colorPrimary,
|
|
transition: `color ${token.motionDurationMid}`
|
|
},
|
|
[`a:not(${componentCls}-btn), > ${iconCls}`]: {
|
|
display: 'inline-block',
|
|
width: '100%',
|
|
color: token.colorTextDescription,
|
|
lineHeight: `${token.fontSize * token.lineHeight}px`,
|
|
transition: `color ${token.motionDurationMid}`,
|
|
'&:hover': {
|
|
color: token.colorPrimary
|
|
}
|
|
},
|
|
[`> ${iconCls}`]: {
|
|
fontSize: cardActionsIconSize,
|
|
lineHeight: `${cardActionsIconSize * token.lineHeight}px`
|
|
}
|
|
},
|
|
'&:not(:last-child)': {
|
|
borderInlineEnd: `${token.lineWidth}px ${token.lineType} ${colorBorderSecondary}`
|
|
}
|
|
}
|
|
});
|
|
};
|
|
// ============================== Meta ==============================
|
|
const genCardMetaStyle = token => Object.assign(Object.assign({
|
|
margin: `-${token.marginXXS}px 0`,
|
|
display: 'flex'
|
|
}, (0,style/* clearFix */.dF)()), {
|
|
'&-avatar': {
|
|
paddingInlineEnd: token.padding
|
|
},
|
|
'&-detail': {
|
|
overflow: 'hidden',
|
|
flex: 1,
|
|
'> div:not(:last-child)': {
|
|
marginBottom: token.marginXS
|
|
}
|
|
},
|
|
'&-title': Object.assign({
|
|
color: token.colorTextHeading,
|
|
fontWeight: token.fontWeightStrong,
|
|
fontSize: token.fontSizeLG
|
|
}, style/* textEllipsis */.vS),
|
|
'&-description': {
|
|
color: token.colorTextDescription
|
|
}
|
|
});
|
|
// ============================== Inner ==============================
|
|
const genCardTypeInnerStyle = token => {
|
|
const {
|
|
componentCls,
|
|
cardPaddingBase,
|
|
colorFillAlter
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-head`]: {
|
|
padding: `0 ${cardPaddingBase}px`,
|
|
background: colorFillAlter,
|
|
'&-title': {
|
|
fontSize: token.fontSize
|
|
}
|
|
},
|
|
[`${componentCls}-body`]: {
|
|
padding: `${token.padding}px ${cardPaddingBase}px`
|
|
}
|
|
};
|
|
};
|
|
// ============================== Loading ==============================
|
|
const genCardLoadingStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
overflow: 'hidden',
|
|
[`${componentCls}-body`]: {
|
|
userSelect: 'none'
|
|
}
|
|
};
|
|
};
|
|
// ============================== Basic ==============================
|
|
const genCardStyle = token => {
|
|
const {
|
|
antCls,
|
|
componentCls,
|
|
cardShadow,
|
|
cardHeadPadding,
|
|
colorBorderSecondary,
|
|
boxShadowTertiary,
|
|
cardPaddingBase,
|
|
extraColor
|
|
} = token;
|
|
return {
|
|
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
position: 'relative',
|
|
background: token.colorBgContainer,
|
|
borderRadius: token.borderRadiusLG,
|
|
[`&:not(${componentCls}-bordered)`]: {
|
|
boxShadow: boxShadowTertiary
|
|
},
|
|
[`${componentCls}-head`]: genCardHeadStyle(token),
|
|
[`${componentCls}-extra`]: {
|
|
// https://stackoverflow.com/a/22429853/3040605
|
|
marginInlineStart: 'auto',
|
|
color: extraColor,
|
|
fontWeight: 'normal',
|
|
fontSize: token.fontSize
|
|
},
|
|
[`${componentCls}-body`]: Object.assign({
|
|
padding: cardPaddingBase,
|
|
borderRadius: ` 0 0 ${token.borderRadiusLG}px ${token.borderRadiusLG}px`
|
|
}, (0,style/* clearFix */.dF)()),
|
|
[`${componentCls}-grid`]: genCardGridStyle(token),
|
|
[`${componentCls}-cover`]: {
|
|
'> *': {
|
|
display: 'block',
|
|
width: '100%'
|
|
},
|
|
[`img, img + ${antCls}-image-mask`]: {
|
|
borderRadius: `${token.borderRadiusLG}px ${token.borderRadiusLG}px 0 0`
|
|
}
|
|
},
|
|
[`${componentCls}-actions`]: genCardActionsStyle(token),
|
|
[`${componentCls}-meta`]: genCardMetaStyle(token)
|
|
}),
|
|
[`${componentCls}-bordered`]: {
|
|
border: `${token.lineWidth}px ${token.lineType} ${colorBorderSecondary}`,
|
|
[`${componentCls}-cover`]: {
|
|
marginTop: -1,
|
|
marginInlineStart: -1,
|
|
marginInlineEnd: -1
|
|
}
|
|
},
|
|
[`${componentCls}-hoverable`]: {
|
|
cursor: 'pointer',
|
|
transition: `box-shadow ${token.motionDurationMid}, border-color ${token.motionDurationMid}`,
|
|
'&:hover': {
|
|
borderColor: 'transparent',
|
|
boxShadow: cardShadow
|
|
}
|
|
},
|
|
[`${componentCls}-contain-grid`]: {
|
|
[`${componentCls}-body`]: {
|
|
display: 'flex',
|
|
flexWrap: 'wrap'
|
|
},
|
|
[`&:not(${componentCls}-loading) ${componentCls}-body`]: {
|
|
marginBlockStart: -token.lineWidth,
|
|
marginInlineStart: -token.lineWidth,
|
|
padding: 0
|
|
}
|
|
},
|
|
[`${componentCls}-contain-tabs`]: {
|
|
[`> ${componentCls}-head`]: {
|
|
[`${componentCls}-head-title, ${componentCls}-extra`]: {
|
|
paddingTop: cardHeadPadding
|
|
}
|
|
}
|
|
},
|
|
[`${componentCls}-type-inner`]: genCardTypeInnerStyle(token),
|
|
[`${componentCls}-loading`]: genCardLoadingStyle(token),
|
|
[`${componentCls}-rtl`]: {
|
|
direction: 'rtl'
|
|
}
|
|
};
|
|
};
|
|
// ============================== Size ==============================
|
|
const genCardSizeStyle = token => {
|
|
const {
|
|
componentCls,
|
|
cardPaddingSM,
|
|
headerHeightSM,
|
|
headerFontSizeSM
|
|
} = token;
|
|
return {
|
|
[`${componentCls}-small`]: {
|
|
[`> ${componentCls}-head`]: {
|
|
minHeight: headerHeightSM,
|
|
padding: `0 ${cardPaddingSM}px`,
|
|
fontSize: headerFontSizeSM,
|
|
[`> ${componentCls}-head-wrapper`]: {
|
|
[`> ${componentCls}-extra`]: {
|
|
fontSize: token.fontSize
|
|
}
|
|
}
|
|
},
|
|
[`> ${componentCls}-body`]: {
|
|
padding: cardPaddingSM
|
|
}
|
|
},
|
|
[`${componentCls}-small${componentCls}-contain-tabs`]: {
|
|
[`> ${componentCls}-head`]: {
|
|
[`${componentCls}-head-title, ${componentCls}-extra`]: {
|
|
minHeight: headerHeightSM,
|
|
paddingTop: 0,
|
|
display: 'flex',
|
|
alignItems: 'center'
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
// ============================== Export ==============================
|
|
/* harmony default export */ var card_style = ((0,genComponentStyleHook/* default */.Z)('Card', token => {
|
|
const cardToken = (0,statistic/* merge */.TS)(token, {
|
|
cardShadow: token.boxShadowCard,
|
|
cardHeadPadding: token.padding,
|
|
cardPaddingBase: token.paddingLG,
|
|
cardActionsIconSize: token.fontSize,
|
|
cardPaddingSM: 12 // Fixed padding.
|
|
});
|
|
|
|
return [
|
|
// Style
|
|
genCardStyle(cardToken),
|
|
// Size
|
|
genCardSizeStyle(cardToken)];
|
|
}, token => ({
|
|
headerBg: 'transparent',
|
|
headerFontSize: token.fontSizeLG,
|
|
headerFontSizeSM: token.fontSize,
|
|
headerHeight: token.fontSizeLG * token.lineHeightLG + token.padding * 2,
|
|
headerHeightSM: token.fontSize * token.lineHeight + token.paddingXS * 2,
|
|
actionsBg: token.colorBgContainer,
|
|
actionsLiMargin: `${token.paddingSM}px 0`,
|
|
tabsMarginBottom: -token.padding - token.lineWidth,
|
|
extraColor: token.colorText
|
|
})));
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/card/Card.js
|
|
"use client";
|
|
|
|
var Card_rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getAction(actions) {
|
|
return actions.map((action, index) =>
|
|
/*#__PURE__*/
|
|
// eslint-disable-next-line react/no-array-index-key
|
|
_react_17_0_2_react.createElement("li", {
|
|
style: {
|
|
width: `${100 / actions.length}%`
|
|
},
|
|
key: `action-${index}`
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("span", null, action)));
|
|
}
|
|
const Card = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
extra,
|
|
headStyle = {},
|
|
bodyStyle = {},
|
|
title,
|
|
loading,
|
|
bordered = true,
|
|
size: customizeSize,
|
|
type,
|
|
cover,
|
|
actions,
|
|
tabList,
|
|
children,
|
|
activeTabKey,
|
|
defaultActiveTabKey,
|
|
tabBarExtraContent,
|
|
hoverable,
|
|
tabProps = {}
|
|
} = props,
|
|
others = Card_rest(props, ["prefixCls", "className", "rootClassName", "style", "extra", "headStyle", "bodyStyle", "title", "loading", "bordered", "size", "type", "cover", "actions", "tabList", "children", "activeTabKey", "defaultActiveTabKey", "tabBarExtraContent", "hoverable", "tabProps"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
card
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const onTabChange = key => {
|
|
var _a;
|
|
(_a = props.onTabChange) === null || _a === void 0 ? void 0 : _a.call(props, key);
|
|
};
|
|
const isContainGrid = _react_17_0_2_react.useMemo(() => {
|
|
let containGrid = false;
|
|
_react_17_0_2_react.Children.forEach(children, element => {
|
|
if (element && element.type && element.type === card_Grid) {
|
|
containGrid = true;
|
|
}
|
|
});
|
|
return containGrid;
|
|
}, [children]);
|
|
const prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
const [wrapSSR, hashId] = card_style(prefixCls);
|
|
const loadingBlock = /*#__PURE__*/_react_17_0_2_react.createElement(skeleton/* default */.Z, {
|
|
loading: true,
|
|
active: true,
|
|
paragraph: {
|
|
rows: 4
|
|
},
|
|
title: false
|
|
}, children);
|
|
const hasActiveTabKey = activeTabKey !== undefined;
|
|
const extraProps = Object.assign(Object.assign({}, tabProps), {
|
|
[hasActiveTabKey ? 'activeKey' : 'defaultActiveKey']: hasActiveTabKey ? activeTabKey : defaultActiveTabKey,
|
|
tabBarExtraContent
|
|
});
|
|
let head;
|
|
const mergedSize = (0,useSize/* default */.Z)(customizeSize);
|
|
const tabSize = !mergedSize || mergedSize === 'default' ? 'large' : mergedSize;
|
|
const tabs = tabList ? /*#__PURE__*/_react_17_0_2_react.createElement(es_tabs/* default */.Z, Object.assign({
|
|
size: tabSize
|
|
}, extraProps, {
|
|
className: `${prefixCls}-head-tabs`,
|
|
onChange: onTabChange,
|
|
items: tabList.map(_a => {
|
|
var {
|
|
tab
|
|
} = _a,
|
|
item = Card_rest(_a, ["tab"]);
|
|
return Object.assign({
|
|
label: tab
|
|
}, item);
|
|
})
|
|
})) : null;
|
|
if (title || extra || tabs) {
|
|
head = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-head`,
|
|
style: headStyle
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-head-wrapper`
|
|
}, title && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-head-title`
|
|
}, title), extra && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-extra`
|
|
}, extra)), tabs);
|
|
}
|
|
const coverDom = cover ? /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-cover`
|
|
}, cover) : null;
|
|
const body = /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-body`,
|
|
style: bodyStyle
|
|
}, loading ? loadingBlock : children);
|
|
const actionDom = actions && actions.length ? /*#__PURE__*/_react_17_0_2_react.createElement("ul", {
|
|
className: `${prefixCls}-actions`
|
|
}, getAction(actions)) : null;
|
|
const divProps = (0,omit/* default */.Z)(others, ['onTabChange']);
|
|
const classString = _classnames_2_5_1_classnames_default()(prefixCls, card === null || card === void 0 ? void 0 : card.className, {
|
|
[`${prefixCls}-loading`]: loading,
|
|
[`${prefixCls}-bordered`]: bordered,
|
|
[`${prefixCls}-hoverable`]: hoverable,
|
|
[`${prefixCls}-contain-grid`]: isContainGrid,
|
|
[`${prefixCls}-contain-tabs`]: tabList && tabList.length,
|
|
[`${prefixCls}-${mergedSize}`]: mergedSize,
|
|
[`${prefixCls}-type-${type}`]: !!type,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
const mergedStyle = Object.assign(Object.assign({}, card === null || card === void 0 ? void 0 : card.style), style);
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
ref: ref
|
|
}, divProps, {
|
|
className: classString,
|
|
style: mergedStyle
|
|
}), head, coverDom, body, actionDom));
|
|
});
|
|
/* harmony default export */ var card_Card = (Card);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/card/Meta.js
|
|
"use client";
|
|
|
|
var Meta_rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
const Meta = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
avatar,
|
|
title,
|
|
description
|
|
} = props,
|
|
others = Meta_rest(props, ["prefixCls", "className", "avatar", "title", "description"]);
|
|
const {
|
|
getPrefixCls
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
const prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
const classString = _classnames_2_5_1_classnames_default()(`${prefixCls}-meta`, className);
|
|
const avatarDom = avatar ? /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-meta-avatar`
|
|
}, avatar) : null;
|
|
const titleDom = title ? /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-meta-title`
|
|
}, title) : null;
|
|
const descriptionDom = description ? /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-meta-description`
|
|
}, description) : null;
|
|
const MetaDetail = titleDom || descriptionDom ? /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
className: `${prefixCls}-meta-detail`
|
|
}, titleDom, descriptionDom) : null;
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({}, others, {
|
|
className: classString
|
|
}), avatarDom, MetaDetail);
|
|
};
|
|
/* harmony default export */ var card_Meta = (Meta);
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/card/index.js
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
const es_card_Card = card_Card;
|
|
es_card_Card.Grid = card_Grid;
|
|
es_card_Card.Meta = card_Meta;
|
|
if (false) {}
|
|
/* harmony default export */ var card = (es_card_Card);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 39722:
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/PurePanel.js ***!
|
|
\***************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ t5: function() { return /* binding */ RawPurePanel; }
|
|
/* harmony export */ });
|
|
/* unused harmony export getOverlay */
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 92310);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var rc_tooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-tooltip */ 55477);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config-provider */ 36355);
|
|
/* harmony import */ var _util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../_util/getRenderPropValue */ 77578);
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./style */ 17356);
|
|
"use client";
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getOverlay = (prefixCls, title, content) => {
|
|
if (!title && !content) return undefined;
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(react__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
className: `${prefixCls}-title`
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__/* .getRenderPropValue */ .Z)(title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
className: `${prefixCls}-inner-content`
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_3__/* .getRenderPropValue */ .Z)(content)));
|
|
};
|
|
const RawPurePanel = props => {
|
|
const {
|
|
hashId,
|
|
prefixCls,
|
|
className,
|
|
style,
|
|
placement = 'top',
|
|
title,
|
|
content,
|
|
children
|
|
} = props;
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(hashId, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className),
|
|
style: style
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("div", {
|
|
className: `${prefixCls}-arrow`
|
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(rc_tooltip__WEBPACK_IMPORTED_MODULE_1__/* .Popup */ .G, Object.assign({}, props, {
|
|
className: hashId,
|
|
prefixCls: prefixCls
|
|
}), children || getOverlay(prefixCls, title, content)));
|
|
};
|
|
const PurePanel = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react__WEBPACK_IMPORTED_MODULE_2__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_4__/* .ConfigContext */ .E_);
|
|
const prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(prefixCls);
|
|
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement(RawPurePanel, Object.assign({}, restProps, {
|
|
prefixCls: prefixCls,
|
|
hashId: hashId
|
|
})));
|
|
};
|
|
/* harmony default export */ __webpack_exports__.ZP = (PurePanel);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 60324:
|
|
/*!***********************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/index.js ***!
|
|
\***********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 92310);
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var _util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../_util/getRenderPropValue */ 77578);
|
|
/* harmony import */ var _util_motion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../_util/motion */ 62892);
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config-provider */ 36355);
|
|
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../tooltip */ 6848);
|
|
/* harmony import */ var _PurePanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PurePanel */ 39722);
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style */ 17356);
|
|
"use client";
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CSSINJS
|
|
|
|
const Overlay = _ref => {
|
|
let {
|
|
title,
|
|
content,
|
|
prefixCls
|
|
} = _ref;
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
|
|
className: `${prefixCls}-title`
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__/* .getRenderPropValue */ .Z)(title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
|
|
className: `${prefixCls}-inner-content`
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_2__/* .getRenderPropValue */ .Z)(content)));
|
|
};
|
|
const Popover = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
title,
|
|
content,
|
|
overlayClassName,
|
|
placement = 'top',
|
|
trigger = 'hover',
|
|
mouseEnterDelay = 0.1,
|
|
mouseLeaveDelay = 0.1,
|
|
overlayStyle = {}
|
|
} = props,
|
|
otherProps = __rest(props, ["prefixCls", "title", "content", "overlayClassName", "placement", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react__WEBPACK_IMPORTED_MODULE_1__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_3__/* .ConfigContext */ .E_);
|
|
const prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
const [wrapSSR, hashId] = (0,_style__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(prefixCls);
|
|
const rootPrefixCls = getPrefixCls();
|
|
const overlayCls = classnames__WEBPACK_IMPORTED_MODULE_0___default()(overlayClassName, hashId);
|
|
return wrapSSR( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(_tooltip__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, Object.assign({
|
|
placement: placement,
|
|
trigger: trigger,
|
|
mouseEnterDelay: mouseEnterDelay,
|
|
mouseLeaveDelay: mouseLeaveDelay,
|
|
overlayStyle: overlayStyle
|
|
}, otherProps, {
|
|
prefixCls: prefixCls,
|
|
overlayClassName: overlayCls,
|
|
ref: ref,
|
|
overlay: title || content ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(Overlay, {
|
|
prefixCls: prefixCls,
|
|
title: title,
|
|
content: content
|
|
}) : null,
|
|
transitionName: (0,_util_motion__WEBPACK_IMPORTED_MODULE_6__/* .getTransitionName */ .m)(rootPrefixCls, 'zoom-big', otherProps.transitionName),
|
|
"data-popover-inject": true
|
|
})));
|
|
});
|
|
if (false) {}
|
|
Popover._InternalPanelDoNotUseOrYouWillBeFired = _PurePanel__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP;
|
|
/* harmony default export */ __webpack_exports__.Z = (Popover);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 17356:
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/popover/style/index.js ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ 17313);
|
|
/* harmony import */ var _style_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../style/motion */ 29878);
|
|
/* harmony import */ var _style_placementArrow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/placementArrow */ 19447);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ 33166);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ 83116);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/internal */ 37613);
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const genBaseStyle = token => {
|
|
const {
|
|
componentCls,
|
|
popoverColor,
|
|
minWidth,
|
|
fontWeightStrong,
|
|
popoverPadding,
|
|
boxShadowSecondary,
|
|
colorTextHeading,
|
|
borderRadiusLG: borderRadius,
|
|
zIndexPopup,
|
|
marginXS,
|
|
colorBgElevated,
|
|
popoverBg
|
|
} = token;
|
|
return [{
|
|
[componentCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
|
|
position: 'absolute',
|
|
top: 0,
|
|
// use `left` to fix https://github.com/ant-design/ant-design/issues/39195
|
|
left: {
|
|
_skip_check_: true,
|
|
value: 0
|
|
},
|
|
zIndex: zIndexPopup,
|
|
fontWeight: 'normal',
|
|
whiteSpace: 'normal',
|
|
textAlign: 'start',
|
|
cursor: 'auto',
|
|
userSelect: 'text',
|
|
transformOrigin: `var(--arrow-x, 50%) var(--arrow-y, 50%)`,
|
|
'--antd-arrow-background-color': colorBgElevated,
|
|
'&-rtl': {
|
|
direction: 'rtl'
|
|
},
|
|
'&-hidden': {
|
|
display: 'none'
|
|
},
|
|
[`${componentCls}-content`]: {
|
|
position: 'relative'
|
|
},
|
|
[`${componentCls}-inner`]: {
|
|
backgroundColor: popoverBg,
|
|
backgroundClip: 'padding-box',
|
|
borderRadius,
|
|
boxShadow: boxShadowSecondary,
|
|
padding: popoverPadding
|
|
},
|
|
[`${componentCls}-title`]: {
|
|
minWidth,
|
|
marginBottom: marginXS,
|
|
color: colorTextHeading,
|
|
fontWeight: fontWeightStrong
|
|
},
|
|
[`${componentCls}-inner-content`]: {
|
|
color: popoverColor
|
|
}
|
|
})
|
|
},
|
|
// Arrow Style
|
|
(0,_style_placementArrow__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP)(token, {
|
|
colorBg: 'var(--antd-arrow-background-color)'
|
|
}),
|
|
// Pure Render
|
|
{
|
|
[`${componentCls}-pure`]: {
|
|
position: 'relative',
|
|
maxWidth: 'none',
|
|
margin: token.sizePopupArrow,
|
|
display: 'inline-block',
|
|
[`${componentCls}-content`]: {
|
|
display: 'inline-block'
|
|
}
|
|
}
|
|
}];
|
|
};
|
|
const genColorStyle = token => {
|
|
const {
|
|
componentCls
|
|
} = token;
|
|
return {
|
|
[componentCls]: _theme_internal__WEBPACK_IMPORTED_MODULE_2__/* .PresetColors */ .i.map(colorKey => {
|
|
const lightColor = token[`${colorKey}6`];
|
|
return {
|
|
[`&${componentCls}-${colorKey}`]: {
|
|
'--antd-arrow-background-color': lightColor,
|
|
[`${componentCls}-inner`]: {
|
|
backgroundColor: lightColor
|
|
},
|
|
[`${componentCls}-arrow`]: {
|
|
background: 'transparent'
|
|
}
|
|
}
|
|
};
|
|
})
|
|
};
|
|
};
|
|
const genWireframeStyle = token => {
|
|
const {
|
|
componentCls,
|
|
lineWidth,
|
|
lineType,
|
|
colorSplit,
|
|
paddingSM,
|
|
controlHeight,
|
|
fontSize,
|
|
lineHeight,
|
|
padding
|
|
} = token;
|
|
const titlePaddingBlockDist = controlHeight - Math.round(fontSize * lineHeight);
|
|
const popoverTitlePaddingBlockTop = titlePaddingBlockDist / 2;
|
|
const popoverTitlePaddingBlockBottom = titlePaddingBlockDist / 2 - lineWidth;
|
|
const popoverPaddingHorizontal = padding;
|
|
return {
|
|
[componentCls]: {
|
|
[`${componentCls}-inner`]: {
|
|
padding: 0
|
|
},
|
|
[`${componentCls}-title`]: {
|
|
margin: 0,
|
|
padding: `${popoverTitlePaddingBlockTop}px ${popoverPaddingHorizontal}px ${popoverTitlePaddingBlockBottom}px`,
|
|
borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`
|
|
},
|
|
[`${componentCls}-inner-content`]: {
|
|
padding: `${paddingSM}px ${popoverPaddingHorizontal}px`
|
|
}
|
|
}
|
|
};
|
|
};
|
|
/* harmony default export */ __webpack_exports__.Z = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)('Popover', token => {
|
|
const {
|
|
colorBgElevated,
|
|
colorText,
|
|
wireframe
|
|
} = token;
|
|
const popoverToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_4__/* .merge */ .TS)(token, {
|
|
popoverPadding: 12,
|
|
popoverBg: colorBgElevated,
|
|
popoverColor: colorText
|
|
});
|
|
return [genBaseStyle(popoverToken), genColorStyle(popoverToken), wireframe && genWireframeStyle(popoverToken), (0,_style_motion__WEBPACK_IMPORTED_MODULE_5__/* .initZoomMotion */ ._y)(popoverToken, 'zoom-big')];
|
|
}, token => ({
|
|
width: 177,
|
|
minWidth: 177,
|
|
zIndexPopup: token.zIndexPopupBase + 30
|
|
}), {
|
|
resetStyle: false,
|
|
deprecatedTokens: [['width', 'minWidth']]
|
|
}));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 23841:
|
|
/*!**********************************************************************!*\
|
|
!*** ./node_modules/_normalize-wheel@1.0.1@normalize-wheel/index.js ***!
|
|
\**********************************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
module.exports = __webpack_require__(/*! ./src/normalizeWheel.js */ 70709);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 95343:
|
|
/*!*****************************************************************************************!*\
|
|
!*** ./node_modules/_normalize-wheel@1.0.1@normalize-wheel/src/ExecutionEnvironment.js ***!
|
|
\*****************************************************************************************/
|
|
/***/ (function(module) {
|
|
|
|
"use strict";
|
|
/**
|
|
* Copyright (c) 2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule ExecutionEnvironment
|
|
*/
|
|
|
|
/*jslint evil: true */
|
|
|
|
|
|
|
|
var canUseDOM = !!(
|
|
typeof window !== 'undefined' &&
|
|
window.document &&
|
|
window.document.createElement
|
|
);
|
|
|
|
/**
|
|
* Simple, lightweight module assisting with the detection and context of
|
|
* Worker. Helps avoid circular dependencies and allows code to reason about
|
|
* whether or not they are in a Worker, even if they never include the main
|
|
* `ReactWorker` dependency.
|
|
*/
|
|
var ExecutionEnvironment = {
|
|
|
|
canUseDOM: canUseDOM,
|
|
|
|
canUseWorkers: typeof Worker !== 'undefined',
|
|
|
|
canUseEventListeners:
|
|
canUseDOM && !!(window.addEventListener || window.attachEvent),
|
|
|
|
canUseViewport: canUseDOM && !!window.screen,
|
|
|
|
isInWorker: !canUseDOM // For now, this is true - might change in the future.
|
|
|
|
};
|
|
|
|
module.exports = ExecutionEnvironment;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 83117:
|
|
/*!*****************************************************************************************!*\
|
|
!*** ./node_modules/_normalize-wheel@1.0.1@normalize-wheel/src/UserAgent_DEPRECATED.js ***!
|
|
\*****************************************************************************************/
|
|
/***/ (function(module) {
|
|
|
|
/**
|
|
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
*
|
|
* @providesModule UserAgent_DEPRECATED
|
|
*/
|
|
|
|
/**
|
|
* Provides entirely client-side User Agent and OS detection. You should prefer
|
|
* the non-deprecated UserAgent module when possible, which exposes our
|
|
* authoritative server-side PHP-based detection to the client.
|
|
*
|
|
* Usage is straightforward:
|
|
*
|
|
* if (UserAgent_DEPRECATED.ie()) {
|
|
* // IE
|
|
* }
|
|
*
|
|
* You can also do version checks:
|
|
*
|
|
* if (UserAgent_DEPRECATED.ie() >= 7) {
|
|
* // IE7 or better
|
|
* }
|
|
*
|
|
* The browser functions will return NaN if the browser does not match, so
|
|
* you can also do version compares the other way:
|
|
*
|
|
* if (UserAgent_DEPRECATED.ie() < 7) {
|
|
* // IE6 or worse
|
|
* }
|
|
*
|
|
* Note that the version is a float and may include a minor version number,
|
|
* so you should always use range operators to perform comparisons, not
|
|
* strict equality.
|
|
*
|
|
* **Note:** You should **strongly** prefer capability detection to browser
|
|
* version detection where it's reasonable:
|
|
*
|
|
* http://www.quirksmode.org/js/support.html
|
|
*
|
|
* Further, we have a large number of mature wrapper functions and classes
|
|
* which abstract away many browser irregularities. Check the documentation,
|
|
* grep for things, or ask on javascript@lists.facebook.com before writing yet
|
|
* another copy of "event || window.event".
|
|
*
|
|
*/
|
|
|
|
var _populated = false;
|
|
|
|
// Browsers
|
|
var _ie, _firefox, _opera, _webkit, _chrome;
|
|
|
|
// Actual IE browser for compatibility mode
|
|
var _ie_real_version;
|
|
|
|
// Platforms
|
|
var _osx, _windows, _linux, _android;
|
|
|
|
// Architectures
|
|
var _win64;
|
|
|
|
// Devices
|
|
var _iphone, _ipad, _native;
|
|
|
|
var _mobile;
|
|
|
|
function _populate() {
|
|
if (_populated) {
|
|
return;
|
|
}
|
|
|
|
_populated = true;
|
|
|
|
// To work around buggy JS libraries that can't handle multi-digit
|
|
// version numbers, Opera 10's user agent string claims it's Opera
|
|
// 9, then later includes a Version/X.Y field:
|
|
//
|
|
// Opera/9.80 (foo) Presto/2.2.15 Version/10.10
|
|
var uas = navigator.userAgent;
|
|
var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
|
|
var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
|
|
|
|
_iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
|
|
_ipad = /\b(iP[ao]d)/.exec(uas);
|
|
_android = /Android/i.exec(uas);
|
|
_native = /FBAN\/\w+;/i.exec(uas);
|
|
_mobile = /Mobile/i.exec(uas);
|
|
|
|
// Note that the IE team blog would have you believe you should be checking
|
|
// for 'Win64; x64'. But MSDN then reveals that you can actually be coming
|
|
// from either x64 or ia64; so ultimately, you should just check for Win64
|
|
// as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit
|
|
// Windows will send 'WOW64' instead.
|
|
_win64 = !!(/Win64/.exec(uas));
|
|
|
|
if (agent) {
|
|
_ie = agent[1] ? parseFloat(agent[1]) : (
|
|
agent[5] ? parseFloat(agent[5]) : NaN);
|
|
// IE compatibility mode
|
|
if (_ie && document && document.documentMode) {
|
|
_ie = document.documentMode;
|
|
}
|
|
// grab the "true" ie version from the trident token if available
|
|
var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
|
|
_ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
|
|
|
|
_firefox = agent[2] ? parseFloat(agent[2]) : NaN;
|
|
_opera = agent[3] ? parseFloat(agent[3]) : NaN;
|
|
_webkit = agent[4] ? parseFloat(agent[4]) : NaN;
|
|
if (_webkit) {
|
|
// We do not add the regexp to the above test, because it will always
|
|
// match 'safari' only since 'AppleWebKit' appears before 'Chrome' in
|
|
// the userAgent string.
|
|
agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
|
|
_chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
|
|
} else {
|
|
_chrome = NaN;
|
|
}
|
|
} else {
|
|
_ie = _firefox = _opera = _chrome = _webkit = NaN;
|
|
}
|
|
|
|
if (os) {
|
|
if (os[1]) {
|
|
// Detect OS X version. If no version number matches, set _osx to true.
|
|
// Version examples: 10, 10_6_1, 10.7
|
|
// Parses version number as a float, taking only first two sets of
|
|
// digits. If only one set of digits is found, returns just the major
|
|
// version number.
|
|
var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
|
|
|
|
_osx = ver ? parseFloat(ver[1].replace('_', '.')) : true;
|
|
} else {
|
|
_osx = false;
|
|
}
|
|
_windows = !!os[2];
|
|
_linux = !!os[3];
|
|
} else {
|
|
_osx = _windows = _linux = false;
|
|
}
|
|
}
|
|
|
|
var UserAgent_DEPRECATED = {
|
|
|
|
/**
|
|
* Check if the UA is Internet Explorer.
|
|
*
|
|
*
|
|
* @return float|NaN Version number (if match) or NaN.
|
|
*/
|
|
ie: function() {
|
|
return _populate() || _ie;
|
|
},
|
|
|
|
/**
|
|
* Check if we're in Internet Explorer compatibility mode.
|
|
*
|
|
* @return bool true if in compatibility mode, false if
|
|
* not compatibility mode or not ie
|
|
*/
|
|
ieCompatibilityMode: function() {
|
|
return _populate() || (_ie_real_version > _ie);
|
|
},
|
|
|
|
|
|
/**
|
|
* Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we
|
|
* only need this because Skype can't handle 64-bit IE yet. We need to remove
|
|
* this when we don't need it -- tracked by #601957.
|
|
*/
|
|
ie64: function() {
|
|
return UserAgent_DEPRECATED.ie() && _win64;
|
|
},
|
|
|
|
/**
|
|
* Check if the UA is Firefox.
|
|
*
|
|
*
|
|
* @return float|NaN Version number (if match) or NaN.
|
|
*/
|
|
firefox: function() {
|
|
return _populate() || _firefox;
|
|
},
|
|
|
|
|
|
/**
|
|
* Check if the UA is Opera.
|
|
*
|
|
*
|
|
* @return float|NaN Version number (if match) or NaN.
|
|
*/
|
|
opera: function() {
|
|
return _populate() || _opera;
|
|
},
|
|
|
|
|
|
/**
|
|
* Check if the UA is WebKit.
|
|
*
|
|
*
|
|
* @return float|NaN Version number (if match) or NaN.
|
|
*/
|
|
webkit: function() {
|
|
return _populate() || _webkit;
|
|
},
|
|
|
|
/**
|
|
* For Push
|
|
* WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit
|
|
*/
|
|
safari: function() {
|
|
return UserAgent_DEPRECATED.webkit();
|
|
},
|
|
|
|
/**
|
|
* Check if the UA is a Chrome browser.
|
|
*
|
|
*
|
|
* @return float|NaN Version number (if match) or NaN.
|
|
*/
|
|
chrome : function() {
|
|
return _populate() || _chrome;
|
|
},
|
|
|
|
|
|
/**
|
|
* Check if the user is running Windows.
|
|
*
|
|
* @return bool `true' if the user's OS is Windows.
|
|
*/
|
|
windows: function() {
|
|
return _populate() || _windows;
|
|
},
|
|
|
|
|
|
/**
|
|
* Check if the user is running Mac OS X.
|
|
*
|
|
* @return float|bool Returns a float if a version number is detected,
|
|
* otherwise true/false.
|
|
*/
|
|
osx: function() {
|
|
return _populate() || _osx;
|
|
},
|
|
|
|
/**
|
|
* Check if the user is running Linux.
|
|
*
|
|
* @return bool `true' if the user's OS is some flavor of Linux.
|
|
*/
|
|
linux: function() {
|
|
return _populate() || _linux;
|
|
},
|
|
|
|
/**
|
|
* Check if the user is running on an iPhone or iPod platform.
|
|
*
|
|
* @return bool `true' if the user is running some flavor of the
|
|
* iPhone OS.
|
|
*/
|
|
iphone: function() {
|
|
return _populate() || _iphone;
|
|
},
|
|
|
|
mobile: function() {
|
|
return _populate() || (_iphone || _ipad || _android || _mobile);
|
|
},
|
|
|
|
nativeApp: function() {
|
|
// webviews inside of the native apps
|
|
return _populate() || _native;
|
|
},
|
|
|
|
android: function() {
|
|
return _populate() || _android;
|
|
},
|
|
|
|
ipad: function() {
|
|
return _populate() || _ipad;
|
|
}
|
|
};
|
|
|
|
module.exports = UserAgent_DEPRECATED;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 23555:
|
|
/*!*************************************************************************************!*\
|
|
!*** ./node_modules/_normalize-wheel@1.0.1@normalize-wheel/src/isEventSupported.js ***!
|
|
\*************************************************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/**
|
|
* Copyright 2013-2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule isEventSupported
|
|
*/
|
|
|
|
|
|
|
|
var ExecutionEnvironment = __webpack_require__(/*! ./ExecutionEnvironment */ 95343);
|
|
|
|
var useHasFeature;
|
|
if (ExecutionEnvironment.canUseDOM) {
|
|
useHasFeature =
|
|
document.implementation &&
|
|
document.implementation.hasFeature &&
|
|
// always returns true in newer browsers as per the standard.
|
|
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
|
|
document.implementation.hasFeature('', '') !== true;
|
|
}
|
|
|
|
/**
|
|
* Checks if an event is supported in the current execution environment.
|
|
*
|
|
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
* `reset`, `load`, `error`, and `select`.
|
|
*
|
|
* Borrows from Modernizr.
|
|
*
|
|
* @param {string} eventNameSuffix Event name, e.g. "click".
|
|
* @param {?boolean} capture Check if the capture phase is supported.
|
|
* @return {boolean} True if the event is supported.
|
|
* @internal
|
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
*/
|
|
function isEventSupported(eventNameSuffix, capture) {
|
|
if (!ExecutionEnvironment.canUseDOM ||
|
|
capture && !('addEventListener' in document)) {
|
|
return false;
|
|
}
|
|
|
|
var eventName = 'on' + eventNameSuffix;
|
|
var isSupported = eventName in document;
|
|
|
|
if (!isSupported) {
|
|
var element = document.createElement('div');
|
|
element.setAttribute(eventName, 'return;');
|
|
isSupported = typeof element[eventName] === 'function';
|
|
}
|
|
|
|
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
|
|
// This is the only way to test support for the `wheel` event in IE9+.
|
|
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
|
|
}
|
|
|
|
return isSupported;
|
|
}
|
|
|
|
module.exports = isEventSupported;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 70709:
|
|
/*!***********************************************************************************!*\
|
|
!*** ./node_modules/_normalize-wheel@1.0.1@normalize-wheel/src/normalizeWheel.js ***!
|
|
\***********************************************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/**
|
|
* Copyright (c) 2015, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
* @providesModule normalizeWheel
|
|
* @typechecks
|
|
*/
|
|
|
|
|
|
|
|
var UserAgent_DEPRECATED = __webpack_require__(/*! ./UserAgent_DEPRECATED */ 83117);
|
|
|
|
var isEventSupported = __webpack_require__(/*! ./isEventSupported */ 23555);
|
|
|
|
|
|
// Reasonable defaults
|
|
var PIXEL_STEP = 10;
|
|
var LINE_HEIGHT = 40;
|
|
var PAGE_HEIGHT = 800;
|
|
|
|
/**
|
|
* Mouse wheel (and 2-finger trackpad) support on the web sucks. It is
|
|
* complicated, thus this doc is long and (hopefully) detailed enough to answer
|
|
* your questions.
|
|
*
|
|
* If you need to react to the mouse wheel in a predictable way, this code is
|
|
* like your bestest friend. * hugs *
|
|
*
|
|
* As of today, there are 4 DOM event types you can listen to:
|
|
*
|
|
* 'wheel' -- Chrome(31+), FF(17+), IE(9+)
|
|
* 'mousewheel' -- Chrome, IE(6+), Opera, Safari
|
|
* 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!
|
|
* 'DOMMouseScroll' -- FF(0.9.7+) since 2003
|
|
*
|
|
* So what to do? The is the best:
|
|
*
|
|
* normalizeWheel.getEventType();
|
|
*
|
|
* In your event callback, use this code to get sane interpretation of the
|
|
* deltas. This code will return an object with properties:
|
|
*
|
|
* spinX -- normalized spin speed (use for zoom) - x plane
|
|
* spinY -- " - y plane
|
|
* pixelX -- normalized distance (to pixels) - x plane
|
|
* pixelY -- " - y plane
|
|
*
|
|
* Wheel values are provided by the browser assuming you are using the wheel to
|
|
* scroll a web page by a number of lines or pixels (or pages). Values can vary
|
|
* significantly on different platforms and browsers, forgetting that you can
|
|
* scroll at different speeds. Some devices (like trackpads) emit more events
|
|
* at smaller increments with fine granularity, and some emit massive jumps with
|
|
* linear speed or acceleration.
|
|
*
|
|
* This code does its best to normalize the deltas for you:
|
|
*
|
|
* - spin is trying to normalize how far the wheel was spun (or trackpad
|
|
* dragged). This is super useful for zoom support where you want to
|
|
* throw away the chunky scroll steps on the PC and make those equal to
|
|
* the slow and smooth tiny steps on the Mac. Key data: This code tries to
|
|
* resolve a single slow step on a wheel to 1.
|
|
*
|
|
* - pixel is normalizing the desired scroll delta in pixel units. You'll
|
|
* get the crazy differences between browsers, but at least it'll be in
|
|
* pixels!
|
|
*
|
|
* - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This
|
|
* should translate to positive value zooming IN, negative zooming OUT.
|
|
* This matches the newer 'wheel' event.
|
|
*
|
|
* Why are there spinX, spinY (or pixels)?
|
|
*
|
|
* - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn
|
|
* with a mouse. It results in side-scrolling in the browser by default.
|
|
*
|
|
* - spinY is what you expect -- it's the classic axis of a mouse wheel.
|
|
*
|
|
* - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and
|
|
* probably is by browsers in conjunction with fancy 3D controllers .. but
|
|
* you know.
|
|
*
|
|
* Implementation info:
|
|
*
|
|
* Examples of 'wheel' event if you scroll slowly (down) by one step with an
|
|
* average mouse:
|
|
*
|
|
* OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)
|
|
* OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)
|
|
* OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)
|
|
* Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)
|
|
* Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)
|
|
*
|
|
* On the trackpad:
|
|
*
|
|
* OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)
|
|
* OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)
|
|
*
|
|
* On other/older browsers.. it's more complicated as there can be multiple and
|
|
* also missing delta values.
|
|
*
|
|
* The 'wheel' event is more standard:
|
|
*
|
|
* http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
|
|
*
|
|
* The basics is that it includes a unit, deltaMode (pixels, lines, pages), and
|
|
* deltaX, deltaY and deltaZ. Some browsers provide other values to maintain
|
|
* backward compatibility with older events. Those other values help us
|
|
* better normalize spin speed. Example of what the browsers provide:
|
|
*
|
|
* | event.wheelDelta | event.detail
|
|
* ------------------+------------------+--------------
|
|
* Safari v5/OS X | -120 | 0
|
|
* Safari v5/Win7 | -120 | 0
|
|
* Chrome v17/OS X | -120 | 0
|
|
* Chrome v17/Win7 | -120 | 0
|
|
* IE9/Win7 | -120 | undefined
|
|
* Firefox v4/OS X | undefined | 1
|
|
* Firefox v4/Win7 | undefined | 3
|
|
*
|
|
*/
|
|
function normalizeWheel(/*object*/ event) /*object*/ {
|
|
var sX = 0, sY = 0, // spinX, spinY
|
|
pX = 0, pY = 0; // pixelX, pixelY
|
|
|
|
// Legacy
|
|
if ('detail' in event) { sY = event.detail; }
|
|
if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; }
|
|
if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; }
|
|
if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; }
|
|
|
|
// side scrolling on FF with DOMMouseScroll
|
|
if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {
|
|
sX = sY;
|
|
sY = 0;
|
|
}
|
|
|
|
pX = sX * PIXEL_STEP;
|
|
pY = sY * PIXEL_STEP;
|
|
|
|
if ('deltaY' in event) { pY = event.deltaY; }
|
|
if ('deltaX' in event) { pX = event.deltaX; }
|
|
|
|
if ((pX || pY) && event.deltaMode) {
|
|
if (event.deltaMode == 1) { // delta in LINE units
|
|
pX *= LINE_HEIGHT;
|
|
pY *= LINE_HEIGHT;
|
|
} else { // delta in PAGE units
|
|
pX *= PAGE_HEIGHT;
|
|
pY *= PAGE_HEIGHT;
|
|
}
|
|
}
|
|
|
|
// Fall-back if spin cannot be determined
|
|
if (pX && !sX) { sX = (pX < 1) ? -1 : 1; }
|
|
if (pY && !sY) { sY = (pY < 1) ? -1 : 1; }
|
|
|
|
return { spinX : sX,
|
|
spinY : sY,
|
|
pixelX : pX,
|
|
pixelY : pY };
|
|
}
|
|
|
|
|
|
/**
|
|
* The best combination if you prefer spinX + spinY normalization. It favors
|
|
* the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with
|
|
* 'wheel' event, making spin speed determination impossible.
|
|
*/
|
|
normalizeWheel.getEventType = function() /*string*/ {
|
|
return (UserAgent_DEPRECATED.firefox())
|
|
? 'DOMMouseScroll'
|
|
: (isEventSupported('wheel'))
|
|
? 'wheel'
|
|
: 'mousewheel';
|
|
};
|
|
|
|
module.exports = normalizeWheel;
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |