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.
3130 lines
120 KiB
3130 lines
120 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[65911],{
|
|
|
|
/***/ 7918:
|
|
/*!******************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 6 modules ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ AntdIcon; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
var slicedToArray = __webpack_require__(97685);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(4942);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(45987);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/components/Context.js
|
|
|
|
var IconContext = /*#__PURE__*/(0,react.createContext)({});
|
|
/* harmony default export */ var Context = (IconContext);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
var esm_typeof = __webpack_require__(71002);
|
|
// EXTERNAL MODULE: ./node_modules/@ctrl/tinycolor/dist/module/conversion.js
|
|
var conversion = __webpack_require__(86500);
|
|
// EXTERNAL MODULE: ./node_modules/@ctrl/tinycolor/dist/module/format-input.js
|
|
var format_input = __webpack_require__(1350);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/node_modules/@ant-design/colors/es/generate.js
|
|
|
|
var hueStep = 2; // 色相阶梯
|
|
|
|
var saturationStep = 0.16; // 饱和度阶梯,浅色部分
|
|
|
|
var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
|
|
|
|
var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
|
|
|
|
var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
|
|
|
|
var lightColorCount = 5; // 浅色数量,主色上
|
|
|
|
var darkColorCount = 4; // 深色数量,主色下
|
|
// 暗色主题颜色映射关系表
|
|
|
|
var darkColorMap = [{
|
|
index: 7,
|
|
opacity: 0.15
|
|
}, {
|
|
index: 6,
|
|
opacity: 0.25
|
|
}, {
|
|
index: 5,
|
|
opacity: 0.3
|
|
}, {
|
|
index: 5,
|
|
opacity: 0.45
|
|
}, {
|
|
index: 5,
|
|
opacity: 0.65
|
|
}, {
|
|
index: 5,
|
|
opacity: 0.85
|
|
}, {
|
|
index: 4,
|
|
opacity: 0.9
|
|
}, {
|
|
index: 3,
|
|
opacity: 0.95
|
|
}, {
|
|
index: 2,
|
|
opacity: 0.97
|
|
}, {
|
|
index: 1,
|
|
opacity: 0.98
|
|
}];
|
|
|
|
// Wrapper function ported from TinyColor.prototype.toHsv
|
|
// Keep it here because of `hsv.h * 360`
|
|
function toHsv(_ref) {
|
|
var r = _ref.r,
|
|
g = _ref.g,
|
|
b = _ref.b;
|
|
var hsv = (0,conversion/* rgbToHsv */.py)(r, g, b);
|
|
return {
|
|
h: hsv.h * 360,
|
|
s: hsv.s,
|
|
v: hsv.v
|
|
};
|
|
} // Wrapper function ported from TinyColor.prototype.toHexString
|
|
// Keep it here because of the prefix `#`
|
|
|
|
|
|
function toHex(_ref2) {
|
|
var r = _ref2.r,
|
|
g = _ref2.g,
|
|
b = _ref2.b;
|
|
return "#".concat((0,conversion/* rgbToHex */.vq)(r, g, b, false));
|
|
} // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.
|
|
// Amount in range [0, 1]
|
|
// Assume color1 & color2 has no alpha, since the following src code did so.
|
|
|
|
|
|
function mix(rgb1, rgb2, amount) {
|
|
var p = amount / 100;
|
|
var rgb = {
|
|
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
b: (rgb2.b - rgb1.b) * p + rgb1.b
|
|
};
|
|
return rgb;
|
|
}
|
|
|
|
function getHue(hsv, i, light) {
|
|
var hue; // 根据色相不同,色相转向不同
|
|
|
|
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
|
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
|
} else {
|
|
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
|
}
|
|
|
|
if (hue < 0) {
|
|
hue += 360;
|
|
} else if (hue >= 360) {
|
|
hue -= 360;
|
|
}
|
|
|
|
return hue;
|
|
}
|
|
|
|
function getSaturation(hsv, i, light) {
|
|
// grey color don't change saturation
|
|
if (hsv.h === 0 && hsv.s === 0) {
|
|
return hsv.s;
|
|
}
|
|
|
|
var saturation;
|
|
|
|
if (light) {
|
|
saturation = hsv.s - saturationStep * i;
|
|
} else if (i === darkColorCount) {
|
|
saturation = hsv.s + saturationStep;
|
|
} else {
|
|
saturation = hsv.s + saturationStep2 * i;
|
|
} // 边界值修正
|
|
|
|
|
|
if (saturation > 1) {
|
|
saturation = 1;
|
|
} // 第一格的 s 限制在 0.06-0.1 之间
|
|
|
|
|
|
if (light && i === lightColorCount && saturation > 0.1) {
|
|
saturation = 0.1;
|
|
}
|
|
|
|
if (saturation < 0.06) {
|
|
saturation = 0.06;
|
|
}
|
|
|
|
return Number(saturation.toFixed(2));
|
|
}
|
|
|
|
function getValue(hsv, i, light) {
|
|
var value;
|
|
|
|
if (light) {
|
|
value = hsv.v + brightnessStep1 * i;
|
|
} else {
|
|
value = hsv.v - brightnessStep2 * i;
|
|
}
|
|
|
|
if (value > 1) {
|
|
value = 1;
|
|
}
|
|
|
|
return Number(value.toFixed(2));
|
|
}
|
|
|
|
function generate(color) {
|
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
var patterns = [];
|
|
var pColor = (0,format_input/* inputToRGB */.uA)(color);
|
|
|
|
for (var i = lightColorCount; i > 0; i -= 1) {
|
|
var hsv = toHsv(pColor);
|
|
var colorString = toHex((0,format_input/* inputToRGB */.uA)({
|
|
h: getHue(hsv, i, true),
|
|
s: getSaturation(hsv, i, true),
|
|
v: getValue(hsv, i, true)
|
|
}));
|
|
patterns.push(colorString);
|
|
}
|
|
|
|
patterns.push(toHex(pColor));
|
|
|
|
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
|
var _hsv = toHsv(pColor);
|
|
|
|
var _colorString = toHex((0,format_input/* inputToRGB */.uA)({
|
|
h: getHue(_hsv, _i),
|
|
s: getSaturation(_hsv, _i),
|
|
v: getValue(_hsv, _i)
|
|
}));
|
|
|
|
patterns.push(_colorString);
|
|
} // dark theme patterns
|
|
|
|
|
|
if (opts.theme === 'dark') {
|
|
return darkColorMap.map(function (_ref3) {
|
|
var index = _ref3.index,
|
|
opacity = _ref3.opacity;
|
|
var darkColorString = toHex(mix((0,format_input/* inputToRGB */.uA)(opts.backgroundColor || '#141414'), (0,format_input/* inputToRGB */.uA)(patterns[index]), opacity * 100));
|
|
return darkColorString;
|
|
});
|
|
}
|
|
|
|
return patterns;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/node_modules/@ant-design/colors/es/index.js
|
|
|
|
var presetPrimaryColors = {
|
|
red: '#F5222D',
|
|
volcano: '#FA541C',
|
|
orange: '#FA8C16',
|
|
gold: '#FAAD14',
|
|
yellow: '#FADB14',
|
|
lime: '#A0D911',
|
|
green: '#52C41A',
|
|
cyan: '#13C2C2',
|
|
blue: '#1677FF',
|
|
geekblue: '#2F54EB',
|
|
purple: '#722ED1',
|
|
magenta: '#EB2F96',
|
|
grey: '#666666'
|
|
};
|
|
var presetPalettes = {};
|
|
var presetDarkPalettes = {};
|
|
Object.keys(presetPrimaryColors).forEach(function (key) {
|
|
presetPalettes[key] = generate(presetPrimaryColors[key]);
|
|
presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes
|
|
|
|
presetDarkPalettes[key] = generate(presetPrimaryColors[key], {
|
|
theme: 'dark',
|
|
backgroundColor: '#141414'
|
|
});
|
|
presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
|
|
});
|
|
var red = presetPalettes.red;
|
|
var volcano = presetPalettes.volcano;
|
|
var gold = presetPalettes.gold;
|
|
var orange = presetPalettes.orange;
|
|
var yellow = presetPalettes.yellow;
|
|
var lime = presetPalettes.lime;
|
|
var green = presetPalettes.green;
|
|
var cyan = presetPalettes.cyan;
|
|
var blue = presetPalettes.blue;
|
|
var geekblue = presetPalettes.geekblue;
|
|
var purple = presetPalettes.purple;
|
|
var magenta = presetPalettes.magenta;
|
|
var grey = presetPalettes.grey;
|
|
var gray = presetPalettes.grey;
|
|
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/warning.js
|
|
var warning = __webpack_require__(80334);
|
|
// EXTERNAL MODULE: ./node_modules/rc-util/es/Dom/dynamicCSS.js
|
|
var dynamicCSS = __webpack_require__(44958);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/utils.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function utils_warning(valid, message) {
|
|
(0,warning/* default */.ZP)(valid, "[@ant-design/icons] ".concat(message));
|
|
}
|
|
function isIconDefinition(target) {
|
|
return (0,esm_typeof/* default */.Z)(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && ((0,esm_typeof/* default */.Z)(target.icon) === 'object' || typeof target.icon === 'function');
|
|
}
|
|
function normalizeAttrs() {
|
|
var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
return Object.keys(attrs).reduce(function (acc, key) {
|
|
var val = attrs[key];
|
|
switch (key) {
|
|
case 'class':
|
|
acc.className = val;
|
|
delete acc.class;
|
|
break;
|
|
default:
|
|
acc[key] = val;
|
|
}
|
|
return acc;
|
|
}, {});
|
|
}
|
|
function utils_generate(node, key, rootProps) {
|
|
if (!rootProps) {
|
|
return /*#__PURE__*/react.createElement(node.tag, (0,objectSpread2/* default */.Z)({
|
|
key: key
|
|
}, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {
|
|
return utils_generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
}));
|
|
}
|
|
return /*#__PURE__*/react.createElement(node.tag, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({
|
|
key: key
|
|
}, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {
|
|
return utils_generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
}));
|
|
}
|
|
function getSecondaryColor(primaryColor) {
|
|
// choose the second color
|
|
return generate(primaryColor)[0];
|
|
}
|
|
function normalizeTwoToneColors(twoToneColor) {
|
|
if (!twoToneColor) {
|
|
return [];
|
|
}
|
|
return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
|
|
}
|
|
// These props make sure that the SVG behaviours like general text.
|
|
// Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
|
|
var svgBaseProps = {
|
|
width: '1em',
|
|
height: '1em',
|
|
fill: 'currentColor',
|
|
'aria-hidden': 'true',
|
|
focusable: 'false'
|
|
};
|
|
var iconStyles = "\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
|
|
var useInsertStyles = function useInsertStyles() {
|
|
var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;
|
|
var _useContext = (0,react.useContext)(Context),
|
|
csp = _useContext.csp,
|
|
prefixCls = _useContext.prefixCls;
|
|
var mergedStyleStr = styleStr;
|
|
if (prefixCls) {
|
|
mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
|
|
}
|
|
(0,react.useEffect)(function () {
|
|
(0,dynamicCSS/* updateCSS */.hq)(mergedStyleStr, '@ant-design-icons', {
|
|
prepend: true,
|
|
csp: csp
|
|
});
|
|
}, []);
|
|
};
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/components/IconBase.js
|
|
|
|
|
|
var _excluded = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"];
|
|
|
|
var twoToneColorPalette = {
|
|
primaryColor: '#333',
|
|
secondaryColor: '#E6E6E6',
|
|
calculated: false
|
|
};
|
|
function setTwoToneColors(_ref) {
|
|
var primaryColor = _ref.primaryColor,
|
|
secondaryColor = _ref.secondaryColor;
|
|
twoToneColorPalette.primaryColor = primaryColor;
|
|
twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
|
|
twoToneColorPalette.calculated = !!secondaryColor;
|
|
}
|
|
function getTwoToneColors() {
|
|
return (0,objectSpread2/* default */.Z)({}, twoToneColorPalette);
|
|
}
|
|
var IconBase = function IconBase(props) {
|
|
var icon = props.icon,
|
|
className = props.className,
|
|
onClick = props.onClick,
|
|
style = props.style,
|
|
primaryColor = props.primaryColor,
|
|
secondaryColor = props.secondaryColor,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
|
|
var colors = twoToneColorPalette;
|
|
if (primaryColor) {
|
|
colors = {
|
|
primaryColor: primaryColor,
|
|
secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
|
|
};
|
|
}
|
|
useInsertStyles();
|
|
utils_warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
|
|
if (!isIconDefinition(icon)) {
|
|
return null;
|
|
}
|
|
var target = icon;
|
|
if (target && typeof target.icon === 'function') {
|
|
target = (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, target), {}, {
|
|
icon: target.icon(colors.primaryColor, colors.secondaryColor)
|
|
});
|
|
}
|
|
return utils_generate(target.icon, "svg-".concat(target.name), (0,objectSpread2/* default */.Z)({
|
|
className: className,
|
|
onClick: onClick,
|
|
style: style,
|
|
'data-icon': target.name,
|
|
width: '1em',
|
|
height: '1em',
|
|
fill: 'currentColor',
|
|
'aria-hidden': 'true'
|
|
}, restProps));
|
|
};
|
|
IconBase.displayName = 'IconReact';
|
|
IconBase.getTwoToneColors = getTwoToneColors;
|
|
IconBase.setTwoToneColors = setTwoToneColors;
|
|
/* harmony default export */ var components_IconBase = (IconBase);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js
|
|
|
|
|
|
|
|
function setTwoToneColor(twoToneColor) {
|
|
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
|
|
_normalizeTwoToneColo2 = (0,slicedToArray/* default */.Z)(_normalizeTwoToneColo, 2),
|
|
primaryColor = _normalizeTwoToneColo2[0],
|
|
secondaryColor = _normalizeTwoToneColo2[1];
|
|
return components_IconBase.setTwoToneColors({
|
|
primaryColor: primaryColor,
|
|
secondaryColor: secondaryColor
|
|
});
|
|
}
|
|
function getTwoToneColor() {
|
|
var colors = components_IconBase.getTwoToneColors();
|
|
if (!colors.calculated) {
|
|
return colors.primaryColor;
|
|
}
|
|
return [colors.primaryColor, colors.secondaryColor];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js
|
|
|
|
|
|
|
|
|
|
var AntdIcon_excluded = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Initial setting
|
|
// should move it to antd main repo?
|
|
setTwoToneColor('#1890ff');
|
|
var Icon = /*#__PURE__*/react.forwardRef(function (props, ref) {
|
|
var _classNames;
|
|
var className = props.className,
|
|
icon = props.icon,
|
|
spin = props.spin,
|
|
rotate = props.rotate,
|
|
tabIndex = props.tabIndex,
|
|
onClick = props.onClick,
|
|
twoToneColor = props.twoToneColor,
|
|
restProps = (0,objectWithoutProperties/* default */.Z)(props, AntdIcon_excluded);
|
|
var _React$useContext = react.useContext(Context),
|
|
_React$useContext$pre = _React$useContext.prefixCls,
|
|
prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre,
|
|
rootClassName = _React$useContext.rootClassName;
|
|
var classString = classnames_default()(rootClassName, prefixCls, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-spin"), !!spin || icon.name === 'loading'), _classNames), className);
|
|
var iconTabIndex = tabIndex;
|
|
if (iconTabIndex === undefined && onClick) {
|
|
iconTabIndex = -1;
|
|
}
|
|
var svgStyle = rotate ? {
|
|
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
transform: "rotate(".concat(rotate, "deg)")
|
|
} : undefined;
|
|
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
|
|
_normalizeTwoToneColo2 = (0,slicedToArray/* default */.Z)(_normalizeTwoToneColo, 2),
|
|
primaryColor = _normalizeTwoToneColo2[0],
|
|
secondaryColor = _normalizeTwoToneColo2[1];
|
|
return /*#__PURE__*/react.createElement("span", (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({
|
|
role: "img",
|
|
"aria-label": icon.name
|
|
}, restProps), {}, {
|
|
ref: ref,
|
|
tabIndex: iconTabIndex,
|
|
onClick: onClick,
|
|
className: classString
|
|
}), /*#__PURE__*/react.createElement(components_IconBase, {
|
|
icon: icon,
|
|
primaryColor: primaryColor,
|
|
secondaryColor: secondaryColor,
|
|
style: svgStyle
|
|
}));
|
|
});
|
|
Icon.displayName = 'AntdIcon';
|
|
Icon.getTwoToneColor = getTwoToneColor;
|
|
Icon.setTwoToneColor = setTwoToneColor;
|
|
/* harmony default export */ var AntdIcon = (Icon);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 87588:
|
|
/*!******************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var _ant_design_icons_svg_es_asn_ExclamationCircleOutlined__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ant-design/icons-svg/es/asn/ExclamationCircleOutlined */ 61144);
|
|
/* harmony import */ var _components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AntdIcon */ 7918);
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
var ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)({}, props), {}, {
|
|
ref: ref,
|
|
icon: _ant_design_icons_svg_es_asn_ExclamationCircleOutlined__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z
|
|
}));
|
|
};
|
|
ExclamationCircleOutlined.displayName = 'ExclamationCircleOutlined';
|
|
/* harmony default export */ __webpack_exports__["Z"] = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(ExclamationCircleOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 64029:
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/UpOutlined.js ***!
|
|
\***************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var _ant_design_icons_svg_es_asn_UpOutlined__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ant-design/icons-svg/es/asn/UpOutlined */ 92287);
|
|
/* harmony import */ var _components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AntdIcon */ 7918);
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
var UpOutlined = function UpOutlined(props, ref) {
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)({}, props), {}, {
|
|
ref: ref,
|
|
icon: _ant_design_icons_svg_es_asn_UpOutlined__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z
|
|
}));
|
|
};
|
|
UpOutlined.displayName = 'UpOutlined';
|
|
/* harmony default export */ __webpack_exports__["Z"] = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(UpOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 81643:
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/antd/es/_util/getRenderPropValue.js ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "Z": function() { return /* binding */ getRenderPropValue; }
|
|
/* harmony export */ });
|
|
var getRenderPropValue = function getRenderPropValue(propValue) {
|
|
if (!propValue) {
|
|
return null;
|
|
}
|
|
if (typeof propValue === 'function') {
|
|
return propValue();
|
|
}
|
|
return propValue;
|
|
};
|
|
|
|
/***/ }),
|
|
|
|
/***/ 55241:
|
|
/*!***********************************************!*\
|
|
!*** ./node_modules/antd/es/popover/index.js ***!
|
|
\***********************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ 87462);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
/* harmony import */ var _config_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config-provider */ 53124);
|
|
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../tooltip */ 84908);
|
|
/* harmony import */ var _util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../_util/getRenderPropValue */ 81643);
|
|
/* harmony import */ var _util_motion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../_util/motion */ 33603);
|
|
|
|
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;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var Overlay = function Overlay(_ref) {
|
|
var title = _ref.title,
|
|
content = _ref.content,
|
|
prefixCls = _ref.prefixCls;
|
|
if (!title && !content) {
|
|
return null;
|
|
}
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
|
|
className: "".concat(prefixCls, "-title")
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_1__/* .getRenderPropValue */ .Z)(title)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
|
|
className: "".concat(prefixCls, "-inner-content")
|
|
}, (0,_util_getRenderPropValue__WEBPACK_IMPORTED_MODULE_1__/* .getRenderPropValue */ .Z)(content)));
|
|
};
|
|
var Popover = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function (props, ref) {
|
|
var customizePrefixCls = props.prefixCls,
|
|
title = props.title,
|
|
content = props.content,
|
|
_overlay = props._overlay,
|
|
_props$placement = props.placement,
|
|
placement = _props$placement === void 0 ? 'top' : _props$placement,
|
|
_props$trigger = props.trigger,
|
|
trigger = _props$trigger === void 0 ? 'hover' : _props$trigger,
|
|
_props$mouseEnterDela = props.mouseEnterDelay,
|
|
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0.1 : _props$mouseEnterDela,
|
|
_props$mouseLeaveDela = props.mouseLeaveDelay,
|
|
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
|
|
_props$overlayStyle = props.overlayStyle,
|
|
overlayStyle = _props$overlayStyle === void 0 ? {} : _props$overlayStyle,
|
|
otherProps = __rest(props, ["prefixCls", "title", "content", "_overlay", "placement", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle"]);
|
|
var _React$useContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(_config_provider__WEBPACK_IMPORTED_MODULE_2__/* .ConfigContext */ .E_),
|
|
getPrefixCls = _React$useContext.getPrefixCls;
|
|
var prefixCls = getPrefixCls('popover', customizePrefixCls);
|
|
var rootPrefixCls = getPrefixCls();
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_tooltip__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)({
|
|
placement: placement,
|
|
trigger: trigger,
|
|
mouseEnterDelay: mouseEnterDelay,
|
|
mouseLeaveDelay: mouseLeaveDelay,
|
|
overlayStyle: overlayStyle
|
|
}, otherProps, {
|
|
prefixCls: prefixCls,
|
|
ref: ref,
|
|
overlay: _overlay || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Overlay, {
|
|
prefixCls: prefixCls,
|
|
title: title,
|
|
content: content
|
|
}),
|
|
transitionName: (0,_util_motion__WEBPACK_IMPORTED_MODULE_5__/* .getTransitionName */ .mL)(rootPrefixCls, 'zoom-big', otherProps.transitionName)
|
|
}));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ __webpack_exports__["Z"] = (Popover);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 63942:
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/antd/es/popover/style/index.js + 1 modules ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/style/default.less
|
|
var style_default = __webpack_require__(43146);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/popover/style/index.less
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/popover/style/index.js
|
|
|
|
|
|
// style dependencies
|
|
// deps-lint-skip: tooltip
|
|
|
|
/***/ }),
|
|
|
|
/***/ 86010:
|
|
/*!******************************************!*\
|
|
!*** ./node_modules/clsx/dist/clsx.m.js ***!
|
|
\******************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "clsx": function() { return /* binding */ clsx; }
|
|
/* harmony export */ });
|
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ __webpack_exports__["default"] = (clsx);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 75668:
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/react-draggable/build/cjs/Draggable.js ***!
|
|
\*************************************************************/
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
Object.defineProperty(exports, "DraggableCore", ({
|
|
enumerable: true,
|
|
get: function get() {
|
|
return _DraggableCore.default;
|
|
}
|
|
}));
|
|
exports["default"] = void 0;
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(/*! react */ 67294));
|
|
|
|
var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ 45697));
|
|
|
|
var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ 73935));
|
|
|
|
var _clsx2 = _interopRequireDefault(__webpack_require__(/*! clsx */ 86010));
|
|
|
|
var _domFns = __webpack_require__(/*! ./utils/domFns */ 81825);
|
|
|
|
var _positionFns = __webpack_require__(/*! ./utils/positionFns */ 2849);
|
|
|
|
var _shims = __webpack_require__(/*! ./utils/shims */ 9280);
|
|
|
|
var _DraggableCore = _interopRequireDefault(__webpack_require__(/*! ./DraggableCore */ 80783));
|
|
|
|
var _log = _interopRequireDefault(__webpack_require__(/*! ./utils/log */ 55904));
|
|
|
|
var _excluded = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"];
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
|
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
|
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
|
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
//
|
|
// Define <Draggable>
|
|
//
|
|
var Draggable = /*#__PURE__*/function (_React$Component) {
|
|
_inherits(Draggable, _React$Component);
|
|
|
|
var _super = _createSuper(Draggable);
|
|
|
|
function Draggable(props
|
|
/*: DraggableProps*/
|
|
) {
|
|
var _this;
|
|
|
|
_classCallCheck(this, Draggable);
|
|
|
|
_this = _super.call(this, props);
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onDragStart", function (e, coreData) {
|
|
(0, _log.default)('Draggable: onDragStart: %j', coreData); // Short-circuit if user's callback killed it.
|
|
|
|
var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData)); // Kills start event on core as well, so move handlers are never bound.
|
|
|
|
|
|
if (shouldStart === false) return false;
|
|
|
|
_this.setState({
|
|
dragging: true,
|
|
dragged: true
|
|
});
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onDrag", function (e, coreData) {
|
|
if (!_this.state.dragging) return false;
|
|
(0, _log.default)('Draggable: onDrag: %j', coreData);
|
|
var uiData = (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData);
|
|
var newState
|
|
/*: $Shape<DraggableState>*/
|
|
= {
|
|
x: uiData.x,
|
|
y: uiData.y
|
|
}; // Keep within bounds.
|
|
|
|
if (_this.props.bounds) {
|
|
// Save original x and y.
|
|
var x = newState.x,
|
|
y = newState.y; // Add slack to the values used to calculate bound position. This will ensure that if
|
|
// we start removing slack, the element won't react to it right away until it's been
|
|
// completely removed.
|
|
|
|
newState.x += _this.state.slackX;
|
|
newState.y += _this.state.slackY; // Get bound position. This will ceil/floor the x and y within the boundaries.
|
|
|
|
var _getBoundPosition = (0, _positionFns.getBoundPosition)(_assertThisInitialized(_this), newState.x, newState.y),
|
|
_getBoundPosition2 = _slicedToArray(_getBoundPosition, 2),
|
|
newStateX = _getBoundPosition2[0],
|
|
newStateY = _getBoundPosition2[1];
|
|
|
|
newState.x = newStateX;
|
|
newState.y = newStateY; // Recalculate slack by noting how much was shaved by the boundPosition handler.
|
|
|
|
newState.slackX = _this.state.slackX + (x - newState.x);
|
|
newState.slackY = _this.state.slackY + (y - newState.y); // Update the event we fire to reflect what really happened after bounds took effect.
|
|
|
|
uiData.x = newState.x;
|
|
uiData.y = newState.y;
|
|
uiData.deltaX = newState.x - _this.state.x;
|
|
uiData.deltaY = newState.y - _this.state.y;
|
|
} // Short-circuit if user's callback killed it.
|
|
|
|
|
|
var shouldUpdate = _this.props.onDrag(e, uiData);
|
|
|
|
if (shouldUpdate === false) return false;
|
|
|
|
_this.setState(newState);
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onDragStop", function (e, coreData) {
|
|
if (!_this.state.dragging) return false; // Short-circuit if user's callback killed it.
|
|
|
|
var shouldContinue = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData));
|
|
|
|
if (shouldContinue === false) return false;
|
|
(0, _log.default)('Draggable: onDragStop: %j', coreData);
|
|
var newState
|
|
/*: $Shape<DraggableState>*/
|
|
= {
|
|
dragging: false,
|
|
slackX: 0,
|
|
slackY: 0
|
|
}; // If this is a controlled component, the result of this operation will be to
|
|
// revert back to the old position. We expect a handler on `onDragStop`, at the least.
|
|
|
|
var controlled = Boolean(_this.props.position);
|
|
|
|
if (controlled) {
|
|
var _this$props$position = _this.props.position,
|
|
x = _this$props$position.x,
|
|
y = _this$props$position.y;
|
|
newState.x = x;
|
|
newState.y = y;
|
|
}
|
|
|
|
_this.setState(newState);
|
|
});
|
|
|
|
_this.state = {
|
|
// Whether or not we are currently dragging.
|
|
dragging: false,
|
|
// Whether or not we have been dragged before.
|
|
dragged: false,
|
|
// Current transform x and y.
|
|
x: props.position ? props.position.x : props.defaultPosition.x,
|
|
y: props.position ? props.position.y : props.defaultPosition.y,
|
|
prevPropsPosition: _objectSpread({}, props.position),
|
|
// Used for compensating for out-of-bounds drags
|
|
slackX: 0,
|
|
slackY: 0,
|
|
// Can only determine if SVG after mounting
|
|
isElementSVG: false
|
|
};
|
|
|
|
if (props.position && !(props.onDrag || props.onStop)) {
|
|
// eslint-disable-next-line no-console
|
|
console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.');
|
|
}
|
|
|
|
return _this;
|
|
}
|
|
|
|
_createClass(Draggable, [{
|
|
key: "componentDidMount",
|
|
value: function componentDidMount() {
|
|
// Check to see if the element passed is an instanceof SVGElement
|
|
if (typeof window.SVGElement !== 'undefined' && this.findDOMNode() instanceof window.SVGElement) {
|
|
this.setState({
|
|
isElementSVG: true
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "componentWillUnmount",
|
|
value: function componentWillUnmount() {
|
|
this.setState({
|
|
dragging: false
|
|
}); // prevents invariant if unmounted while dragging
|
|
} // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
|
|
// the underlying DOM node ourselves. See the README for more information.
|
|
|
|
}, {
|
|
key: "findDOMNode",
|
|
value: function findDOMNode()
|
|
/*: ?HTMLElement*/
|
|
{
|
|
var _this$props$nodeRef$c, _this$props, _this$props$nodeRef;
|
|
|
|
return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$nodeRef = _this$props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this);
|
|
}
|
|
}, {
|
|
key: "render",
|
|
value: function render()
|
|
/*: ReactElement<any>*/
|
|
{
|
|
var _clsx;
|
|
|
|
var _this$props2 = this.props,
|
|
axis = _this$props2.axis,
|
|
bounds = _this$props2.bounds,
|
|
children = _this$props2.children,
|
|
defaultPosition = _this$props2.defaultPosition,
|
|
defaultClassName = _this$props2.defaultClassName,
|
|
defaultClassNameDragging = _this$props2.defaultClassNameDragging,
|
|
defaultClassNameDragged = _this$props2.defaultClassNameDragged,
|
|
position = _this$props2.position,
|
|
positionOffset = _this$props2.positionOffset,
|
|
scale = _this$props2.scale,
|
|
draggableCoreProps = _objectWithoutProperties(_this$props2, _excluded);
|
|
|
|
var style = {};
|
|
var svgTransform = null; // If this is controlled, we don't want to move it - unless it's dragging.
|
|
|
|
var controlled = Boolean(position);
|
|
var draggable = !controlled || this.state.dragging;
|
|
var validPosition = position || defaultPosition;
|
|
var transformOpts = {
|
|
// Set left if horizontal drag is enabled
|
|
x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x,
|
|
// Set top if vertical drag is enabled
|
|
y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y
|
|
}; // If this element was SVG, we use the `transform` attribute.
|
|
|
|
if (this.state.isElementSVG) {
|
|
svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset);
|
|
} else {
|
|
// Add a CSS transform to move the element around. This allows us to move the element around
|
|
// without worrying about whether or not it is relatively or absolutely positioned.
|
|
// If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable>
|
|
// has a clean slate.
|
|
style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset);
|
|
} // Mark with class while dragging
|
|
|
|
|
|
var className = (0, _clsx2.default)(children.props.className || '', defaultClassName, (_clsx = {}, _defineProperty(_clsx, defaultClassNameDragging, this.state.dragging), _defineProperty(_clsx, defaultClassNameDragged, this.state.dragged), _clsx)); // Reuse the child provided
|
|
// This makes it flexible to use whatever element is wanted (div, ul, etc)
|
|
|
|
return /*#__PURE__*/React.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
|
|
onStart: this.onDragStart,
|
|
onDrag: this.onDrag,
|
|
onStop: this.onDragStop
|
|
}), /*#__PURE__*/React.cloneElement(React.Children.only(children), {
|
|
className: className,
|
|
style: _objectSpread(_objectSpread({}, children.props.style), style),
|
|
transform: svgTransform
|
|
}));
|
|
}
|
|
}], [{
|
|
key: "getDerivedStateFromProps",
|
|
value: // React 16.3+
|
|
// Arity (props, state)
|
|
function getDerivedStateFromProps(_ref, _ref2)
|
|
/*: ?$Shape<DraggableState>*/
|
|
{
|
|
var position = _ref.position;
|
|
var prevPropsPosition = _ref2.prevPropsPosition;
|
|
|
|
// Set x/y if a new position is provided in props that is different than the previous.
|
|
if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) {
|
|
(0, _log.default)('Draggable: getDerivedStateFromProps %j', {
|
|
position: position,
|
|
prevPropsPosition: prevPropsPosition
|
|
});
|
|
return {
|
|
x: position.x,
|
|
y: position.y,
|
|
prevPropsPosition: _objectSpread({}, position)
|
|
};
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}]);
|
|
|
|
return Draggable;
|
|
}(React.Component);
|
|
|
|
exports["default"] = Draggable;
|
|
|
|
_defineProperty(Draggable, "displayName", 'Draggable');
|
|
|
|
_defineProperty(Draggable, "propTypes", _objectSpread(_objectSpread({}, _DraggableCore.default.propTypes), {}, {
|
|
/**
|
|
* `axis` determines which axis the draggable can move.
|
|
*
|
|
* Note that all callbacks will still return data as normal. This only
|
|
* controls flushing to the DOM.
|
|
*
|
|
* 'both' allows movement horizontally and vertically.
|
|
* 'x' limits movement to horizontal axis.
|
|
* 'y' limits movement to vertical axis.
|
|
* 'none' limits all movement.
|
|
*
|
|
* Defaults to 'both'.
|
|
*/
|
|
axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),
|
|
|
|
/**
|
|
* `bounds` determines the range of movement available to the element.
|
|
* Available values are:
|
|
*
|
|
* 'parent' restricts movement within the Draggable's parent node.
|
|
*
|
|
* Alternatively, pass an object with the following properties, all of which are optional:
|
|
*
|
|
* {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
|
|
*
|
|
* All values are in px.
|
|
*
|
|
* Example:
|
|
*
|
|
* ```jsx
|
|
* let App = React.createClass({
|
|
* render: function () {
|
|
* return (
|
|
* <Draggable bounds={{right: 300, bottom: 300}}>
|
|
* <div>Content</div>
|
|
* </Draggable>
|
|
* );
|
|
* }
|
|
* });
|
|
* ```
|
|
*/
|
|
bounds: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
left: _propTypes.default.number,
|
|
right: _propTypes.default.number,
|
|
top: _propTypes.default.number,
|
|
bottom: _propTypes.default.number
|
|
}), _propTypes.default.string, _propTypes.default.oneOf([false])]),
|
|
defaultClassName: _propTypes.default.string,
|
|
defaultClassNameDragging: _propTypes.default.string,
|
|
defaultClassNameDragged: _propTypes.default.string,
|
|
|
|
/**
|
|
* `defaultPosition` specifies the x and y that the dragged item should start at
|
|
*
|
|
* Example:
|
|
*
|
|
* ```jsx
|
|
* let App = React.createClass({
|
|
* render: function () {
|
|
* return (
|
|
* <Draggable defaultPosition={{x: 25, y: 25}}>
|
|
* <div>I start with transformX: 25px and transformY: 25px;</div>
|
|
* </Draggable>
|
|
* );
|
|
* }
|
|
* });
|
|
* ```
|
|
*/
|
|
defaultPosition: _propTypes.default.shape({
|
|
x: _propTypes.default.number,
|
|
y: _propTypes.default.number
|
|
}),
|
|
positionOffset: _propTypes.default.shape({
|
|
x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
}),
|
|
|
|
/**
|
|
* `position`, if present, defines the current position of the element.
|
|
*
|
|
* This is similar to how form elements in React work - if no `position` is supplied, the component
|
|
* is uncontrolled.
|
|
*
|
|
* Example:
|
|
*
|
|
* ```jsx
|
|
* let App = React.createClass({
|
|
* render: function () {
|
|
* return (
|
|
* <Draggable position={{x: 25, y: 25}}>
|
|
* <div>I start with transformX: 25px and transformY: 25px;</div>
|
|
* </Draggable>
|
|
* );
|
|
* }
|
|
* });
|
|
* ```
|
|
*/
|
|
position: _propTypes.default.shape({
|
|
x: _propTypes.default.number,
|
|
y: _propTypes.default.number
|
|
}),
|
|
|
|
/**
|
|
* These properties should be defined on the child, not here.
|
|
*/
|
|
className: _shims.dontSetMe,
|
|
style: _shims.dontSetMe,
|
|
transform: _shims.dontSetMe
|
|
}));
|
|
|
|
_defineProperty(Draggable, "defaultProps", _objectSpread(_objectSpread({}, _DraggableCore.default.defaultProps), {}, {
|
|
axis: 'both',
|
|
bounds: false,
|
|
defaultClassName: 'react-draggable',
|
|
defaultClassNameDragging: 'react-draggable-dragging',
|
|
defaultClassNameDragged: 'react-draggable-dragged',
|
|
defaultPosition: {
|
|
x: 0,
|
|
y: 0
|
|
},
|
|
scale: 1
|
|
}));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 80783:
|
|
/*!*****************************************************************!*\
|
|
!*** ./node_modules/react-draggable/build/cjs/DraggableCore.js ***!
|
|
\*****************************************************************/
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
exports["default"] = void 0;
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(/*! react */ 67294));
|
|
|
|
var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ 45697));
|
|
|
|
var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ 73935));
|
|
|
|
var _domFns = __webpack_require__(/*! ./utils/domFns */ 81825);
|
|
|
|
var _positionFns = __webpack_require__(/*! ./utils/positionFns */ 2849);
|
|
|
|
var _shims = __webpack_require__(/*! ./utils/shims */ 9280);
|
|
|
|
var _log = _interopRequireDefault(__webpack_require__(/*! ./utils/log */ 55904));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
|
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
|
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
// Simple abstraction for dragging events names.
|
|
var eventsFor = {
|
|
touch: {
|
|
start: 'touchstart',
|
|
move: 'touchmove',
|
|
stop: 'touchend'
|
|
},
|
|
mouse: {
|
|
start: 'mousedown',
|
|
move: 'mousemove',
|
|
stop: 'mouseup'
|
|
}
|
|
}; // Default to mouse events.
|
|
|
|
var dragEventFor = eventsFor.mouse;
|
|
/*:: type DraggableCoreState = {
|
|
dragging: boolean,
|
|
lastX: number,
|
|
lastY: number,
|
|
touchIdentifier: ?number
|
|
};*/
|
|
|
|
/*:: export type DraggableData = {
|
|
node: HTMLElement,
|
|
x: number, y: number,
|
|
deltaX: number, deltaY: number,
|
|
lastX: number, lastY: number,
|
|
};*/
|
|
|
|
/*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void | false;*/
|
|
|
|
/*:: export type ControlPosition = {x: number, y: number};*/
|
|
|
|
/*:: export type PositionOffsetControlPosition = {x: number|string, y: number|string};*/
|
|
|
|
/*:: export type DraggableCoreDefaultProps = {
|
|
allowAnyClick: boolean,
|
|
disabled: boolean,
|
|
enableUserSelectHack: boolean,
|
|
onStart: DraggableEventHandler,
|
|
onDrag: DraggableEventHandler,
|
|
onStop: DraggableEventHandler,
|
|
onMouseDown: (e: MouseEvent) => void,
|
|
scale: number,
|
|
};*/
|
|
|
|
/*:: export type DraggableCoreProps = {
|
|
...DraggableCoreDefaultProps,
|
|
cancel: string,
|
|
children: ReactElement<any>,
|
|
offsetParent: HTMLElement,
|
|
grid: [number, number],
|
|
handle: string,
|
|
nodeRef?: ?React.ElementRef<any>,
|
|
};*/
|
|
|
|
//
|
|
// Define <DraggableCore>.
|
|
//
|
|
// <DraggableCore> is for advanced usage of <Draggable>. It maintains minimal internal state so it can
|
|
// work well with libraries that require more control over the element.
|
|
//
|
|
var DraggableCore = /*#__PURE__*/function (_React$Component) {
|
|
_inherits(DraggableCore, _React$Component);
|
|
|
|
var _super = _createSuper(DraggableCore);
|
|
|
|
function DraggableCore() {
|
|
var _this;
|
|
|
|
_classCallCheck(this, DraggableCore);
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
dragging: false,
|
|
// Used while dragging to determine deltas.
|
|
lastX: NaN,
|
|
lastY: NaN,
|
|
touchIdentifier: null
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "mounted", false);
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "handleDragStart", function (e) {
|
|
// Make it possible to attach event handlers on top of this one.
|
|
_this.props.onMouseDown(e); // Only accept left-clicks.
|
|
|
|
|
|
if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false; // Get nodes. Be sure to grab relative document (could be iframed)
|
|
|
|
var thisNode = _this.findDOMNode();
|
|
|
|
if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) {
|
|
throw new Error('<DraggableCore> not mounted on DragStart!');
|
|
}
|
|
|
|
var ownerDocument = thisNode.ownerDocument; // Short circuit if handle or cancel prop was provided and selector doesn't match.
|
|
|
|
if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) {
|
|
return;
|
|
} // Prevent scrolling on mobile devices, like ipad/iphone.
|
|
// Important that this is after handle/cancel.
|
|
|
|
|
|
if (e.type === 'touchstart') e.preventDefault(); // Set touch identifier in component state if this is a touch event. This allows us to
|
|
// distinguish between individual touches on multitouch screens by identifying which
|
|
// touchpoint was set to this element.
|
|
|
|
var touchIdentifier = (0, _domFns.getTouchIdentifier)(e);
|
|
|
|
_this.setState({
|
|
touchIdentifier: touchIdentifier
|
|
}); // Get the current drag point from the event. This is used as the offset.
|
|
|
|
|
|
var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _assertThisInitialized(_this));
|
|
if (position == null) return; // not possible but satisfies flow
|
|
|
|
var x = position.x,
|
|
y = position.y; // Create an event object with all the data parents need to make a decision here.
|
|
|
|
var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
|
|
(0, _log.default)('DraggableCore: handleDragStart: %j', coreEvent); // Call event handler. If it returns explicit false, cancel.
|
|
|
|
(0, _log.default)('calling', _this.props.onStart);
|
|
|
|
var shouldUpdate = _this.props.onStart(e, coreEvent);
|
|
|
|
if (shouldUpdate === false || _this.mounted === false) return; // Add a style to the body to disable user-select. This prevents text from
|
|
// being selected all over the page.
|
|
|
|
if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument); // Initiate dragging. Set the current x and y as offsets
|
|
// so we know how much we've moved during the drag. This allows us
|
|
// to drag elements around even if they have been moved, without issue.
|
|
|
|
_this.setState({
|
|
dragging: true,
|
|
lastX: x,
|
|
lastY: y
|
|
}); // Add events to the document directly so we catch when the user's mouse/touch moves outside of
|
|
// this element. We use different events depending on whether or not we have detected that this
|
|
// is a touch-capable device.
|
|
|
|
|
|
(0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);
|
|
(0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "handleDrag", function (e) {
|
|
// Get the current drag point from the event. This is used as the offset.
|
|
var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
|
|
if (position == null) return;
|
|
var x = position.x,
|
|
y = position.y; // Snap to grid if prop has been provided
|
|
|
|
if (Array.isArray(_this.props.grid)) {
|
|
var deltaX = x - _this.state.lastX,
|
|
deltaY = y - _this.state.lastY;
|
|
|
|
var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
|
|
|
|
var _snapToGrid2 = _slicedToArray(_snapToGrid, 2);
|
|
|
|
deltaX = _snapToGrid2[0];
|
|
deltaY = _snapToGrid2[1];
|
|
if (!deltaX && !deltaY) return; // skip useless drag
|
|
|
|
x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;
|
|
}
|
|
|
|
var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y);
|
|
(0, _log.default)('DraggableCore: handleDrag: %j', coreEvent); // Call event handler. If it returns explicit false, trigger end.
|
|
|
|
var shouldUpdate = _this.props.onDrag(e, coreEvent);
|
|
|
|
if (shouldUpdate === false || _this.mounted === false) {
|
|
try {
|
|
// $FlowIgnore
|
|
_this.handleDragStop(new MouseEvent('mouseup'));
|
|
} catch (err) {
|
|
// Old browsers
|
|
var event = ((document.createEvent('MouseEvents')
|
|
/*: any*/
|
|
)
|
|
/*: MouseTouchEvent*/
|
|
); // I see why this insanity was deprecated
|
|
// $FlowIgnore
|
|
|
|
event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
|
|
_this.handleDragStop(event);
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
_this.setState({
|
|
lastX: x,
|
|
lastY: y
|
|
});
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "handleDragStop", function (e) {
|
|
if (!_this.state.dragging) return;
|
|
var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
|
|
if (position == null) return;
|
|
var x = position.x,
|
|
y = position.y; // Snap to grid if prop has been provided
|
|
|
|
if (Array.isArray(_this.props.grid)) {
|
|
var deltaX = x - _this.state.lastX || 0;
|
|
var deltaY = y - _this.state.lastY || 0;
|
|
|
|
var _snapToGrid3 = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);
|
|
|
|
var _snapToGrid4 = _slicedToArray(_snapToGrid3, 2);
|
|
|
|
deltaX = _snapToGrid4[0];
|
|
deltaY = _snapToGrid4[1];
|
|
x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;
|
|
}
|
|
|
|
var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); // Call event handler
|
|
|
|
var shouldContinue = _this.props.onStop(e, coreEvent);
|
|
|
|
if (shouldContinue === false || _this.mounted === false) return false;
|
|
|
|
var thisNode = _this.findDOMNode();
|
|
|
|
if (thisNode) {
|
|
// Remove user-select hack
|
|
if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument);
|
|
}
|
|
|
|
(0, _log.default)('DraggableCore: handleDragStop: %j', coreEvent); // Reset the el.
|
|
|
|
_this.setState({
|
|
dragging: false,
|
|
lastX: NaN,
|
|
lastY: NaN
|
|
});
|
|
|
|
if (thisNode) {
|
|
// Remove event handlers
|
|
(0, _log.default)('DraggableCore: Removing handlers');
|
|
(0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag);
|
|
(0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop);
|
|
}
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onMouseDown", function (e) {
|
|
dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse
|
|
|
|
return _this.handleDragStart(e);
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onMouseUp", function (e) {
|
|
dragEventFor = eventsFor.mouse;
|
|
return _this.handleDragStop(e);
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onTouchStart", function (e) {
|
|
// We're on a touch device now, so change the event handlers
|
|
dragEventFor = eventsFor.touch;
|
|
return _this.handleDragStart(e);
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onTouchEnd", function (e) {
|
|
// We're on a touch device now, so change the event handlers
|
|
dragEventFor = eventsFor.touch;
|
|
return _this.handleDragStop(e);
|
|
});
|
|
|
|
return _this;
|
|
}
|
|
|
|
_createClass(DraggableCore, [{
|
|
key: "componentDidMount",
|
|
value: function componentDidMount() {
|
|
this.mounted = true; // Touch handlers must be added with {passive: false} to be cancelable.
|
|
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
|
|
|
|
var thisNode = this.findDOMNode();
|
|
|
|
if (thisNode) {
|
|
(0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
|
|
passive: false
|
|
});
|
|
}
|
|
}
|
|
}, {
|
|
key: "componentWillUnmount",
|
|
value: function componentWillUnmount() {
|
|
this.mounted = false; // Remove any leftover event handlers. Remove both touch and mouse handlers in case
|
|
// some browser quirk caused a touch event to fire during a mouse move, or vice versa.
|
|
|
|
var thisNode = this.findDOMNode();
|
|
|
|
if (thisNode) {
|
|
var ownerDocument = thisNode.ownerDocument;
|
|
(0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);
|
|
(0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);
|
|
(0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);
|
|
(0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);
|
|
(0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, {
|
|
passive: false
|
|
});
|
|
if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument);
|
|
}
|
|
} // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
|
|
// the underlying DOM node ourselves. See the README for more information.
|
|
|
|
}, {
|
|
key: "findDOMNode",
|
|
value: function findDOMNode()
|
|
/*: ?HTMLElement*/
|
|
{
|
|
var _this$props, _this$props2, _this$props2$nodeRef;
|
|
|
|
return (_this$props = this.props) !== null && _this$props !== void 0 && _this$props.nodeRef ? (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$nodeRef = _this$props2.nodeRef) === null || _this$props2$nodeRef === void 0 ? void 0 : _this$props2$nodeRef.current : _reactDom.default.findDOMNode(this);
|
|
}
|
|
}, {
|
|
key: "render",
|
|
value: function render()
|
|
/*: React.Element<any>*/
|
|
{
|
|
// Reuse the child provided
|
|
// This makes it flexible to use whatever element is wanted (div, ul, etc)
|
|
return /*#__PURE__*/React.cloneElement(React.Children.only(this.props.children), {
|
|
// Note: mouseMove handler is attached to document so it will still function
|
|
// when the user drags quickly and leaves the bounds of the element.
|
|
onMouseDown: this.onMouseDown,
|
|
onMouseUp: this.onMouseUp,
|
|
// onTouchStart is added on `componentDidMount` so they can be added with
|
|
// {passive: false}, which allows it to cancel. See
|
|
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
|
|
onTouchEnd: this.onTouchEnd
|
|
});
|
|
}
|
|
}]);
|
|
|
|
return DraggableCore;
|
|
}(React.Component);
|
|
|
|
exports["default"] = DraggableCore;
|
|
|
|
_defineProperty(DraggableCore, "displayName", 'DraggableCore');
|
|
|
|
_defineProperty(DraggableCore, "propTypes", {
|
|
/**
|
|
* `allowAnyClick` allows dragging using any mouse button.
|
|
* By default, we only accept the left button.
|
|
*
|
|
* Defaults to `false`.
|
|
*/
|
|
allowAnyClick: _propTypes.default.bool,
|
|
|
|
/**
|
|
* `disabled`, if true, stops the <Draggable> from dragging. All handlers,
|
|
* with the exception of `onMouseDown`, will not fire.
|
|
*/
|
|
disabled: _propTypes.default.bool,
|
|
|
|
/**
|
|
* By default, we add 'user-select:none' attributes to the document body
|
|
* to prevent ugly text selection during drag. If this is causing problems
|
|
* for your app, set this to `false`.
|
|
*/
|
|
enableUserSelectHack: _propTypes.default.bool,
|
|
|
|
/**
|
|
* `offsetParent`, if set, uses the passed DOM node to compute drag offsets
|
|
* instead of using the parent node.
|
|
*/
|
|
offsetParent: function offsetParent(props
|
|
/*: DraggableCoreProps*/
|
|
, propName
|
|
/*: $Keys<DraggableCoreProps>*/
|
|
) {
|
|
if (props[propName] && props[propName].nodeType !== 1) {
|
|
throw new Error('Draggable\'s offsetParent must be a DOM Node.');
|
|
}
|
|
},
|
|
|
|
/**
|
|
* `grid` specifies the x and y that dragging should snap to.
|
|
*/
|
|
grid: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
|
|
/**
|
|
* `handle` specifies a selector to be used as the handle that initiates drag.
|
|
*
|
|
* Example:
|
|
*
|
|
* ```jsx
|
|
* let App = React.createClass({
|
|
* render: function () {
|
|
* return (
|
|
* <Draggable handle=".handle">
|
|
* <div>
|
|
* <div className="handle">Click me to drag</div>
|
|
* <div>This is some other content</div>
|
|
* </div>
|
|
* </Draggable>
|
|
* );
|
|
* }
|
|
* });
|
|
* ```
|
|
*/
|
|
handle: _propTypes.default.string,
|
|
|
|
/**
|
|
* `cancel` specifies a selector to be used to prevent drag initialization.
|
|
*
|
|
* Example:
|
|
*
|
|
* ```jsx
|
|
* let App = React.createClass({
|
|
* render: function () {
|
|
* return(
|
|
* <Draggable cancel=".cancel">
|
|
* <div>
|
|
* <div className="cancel">You can't drag from here</div>
|
|
* <div>Dragging here works fine</div>
|
|
* </div>
|
|
* </Draggable>
|
|
* );
|
|
* }
|
|
* });
|
|
* ```
|
|
*/
|
|
cancel: _propTypes.default.string,
|
|
|
|
/* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
|
|
* Unfortunately, in order for <Draggable> to work properly, we need raw access
|
|
* to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
|
|
* as in this example:
|
|
*
|
|
* function MyComponent() {
|
|
* const nodeRef = React.useRef(null);
|
|
* return (
|
|
* <Draggable nodeRef={nodeRef}>
|
|
* <div ref={nodeRef}>Example Target</div>
|
|
* </Draggable>
|
|
* );
|
|
* }
|
|
*
|
|
* This can be used for arbitrarily nested components, so long as the ref ends up
|
|
* pointing to the actual child DOM node and not a custom component.
|
|
*/
|
|
nodeRef: _propTypes.default.object,
|
|
|
|
/**
|
|
* Called when dragging starts.
|
|
* If this function returns the boolean false, dragging will be canceled.
|
|
*/
|
|
onStart: _propTypes.default.func,
|
|
|
|
/**
|
|
* Called while dragging.
|
|
* If this function returns the boolean false, dragging will be canceled.
|
|
*/
|
|
onDrag: _propTypes.default.func,
|
|
|
|
/**
|
|
* Called when dragging stops.
|
|
* If this function returns the boolean false, the drag will remain active.
|
|
*/
|
|
onStop: _propTypes.default.func,
|
|
|
|
/**
|
|
* A workaround option which can be passed if onMouseDown needs to be accessed,
|
|
* since it'll always be blocked (as there is internal use of onMouseDown)
|
|
*/
|
|
onMouseDown: _propTypes.default.func,
|
|
|
|
/**
|
|
* `scale`, if set, applies scaling while dragging an element
|
|
*/
|
|
scale: _propTypes.default.number,
|
|
|
|
/**
|
|
* These properties should be defined on the child, not here.
|
|
*/
|
|
className: _shims.dontSetMe,
|
|
style: _shims.dontSetMe,
|
|
transform: _shims.dontSetMe
|
|
});
|
|
|
|
_defineProperty(DraggableCore, "defaultProps", {
|
|
allowAnyClick: false,
|
|
// by default only accept left click
|
|
disabled: false,
|
|
enableUserSelectHack: true,
|
|
onStart: function onStart() {},
|
|
onDrag: function onDrag() {},
|
|
onStop: function onStop() {},
|
|
onMouseDown: function onMouseDown() {},
|
|
scale: 1
|
|
});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 61193:
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/react-draggable/build/cjs/cjs.js ***!
|
|
\*******************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
|
|
var _require = __webpack_require__(/*! ./Draggable */ 75668),
|
|
Draggable = _require.default,
|
|
DraggableCore = _require.DraggableCore; // Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'.
|
|
// See https://github.com/mzabriskie/react-draggable/pull/254
|
|
// and https://github.com/mzabriskie/react-draggable/issues/266
|
|
|
|
|
|
module.exports = Draggable;
|
|
module.exports["default"] = Draggable;
|
|
module.exports.DraggableCore = DraggableCore;
|
|
|
|
/***/ }),
|
|
|
|
/***/ 81825:
|
|
/*!****************************************************************!*\
|
|
!*** ./node_modules/react-draggable/build/cjs/utils/domFns.js ***!
|
|
\****************************************************************/
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
exports.addClassName = addClassName;
|
|
exports.addEvent = addEvent;
|
|
exports.addUserSelectStyles = addUserSelectStyles;
|
|
exports.createCSSTransform = createCSSTransform;
|
|
exports.createSVGTransform = createSVGTransform;
|
|
exports.getTouch = getTouch;
|
|
exports.getTouchIdentifier = getTouchIdentifier;
|
|
exports.getTranslation = getTranslation;
|
|
exports.innerHeight = innerHeight;
|
|
exports.innerWidth = innerWidth;
|
|
exports.matchesSelector = matchesSelector;
|
|
exports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;
|
|
exports.offsetXYFromParent = offsetXYFromParent;
|
|
exports.outerHeight = outerHeight;
|
|
exports.outerWidth = outerWidth;
|
|
exports.removeClassName = removeClassName;
|
|
exports.removeEvent = removeEvent;
|
|
exports.removeUserSelectStyles = removeUserSelectStyles;
|
|
|
|
var _shims = __webpack_require__(/*! ./shims */ 9280);
|
|
|
|
var _getPrefix = _interopRequireWildcard(__webpack_require__(/*! ./getPrefix */ 38650));
|
|
|
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
|
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
var matchesSelectorFunc = '';
|
|
|
|
function matchesSelector(el
|
|
/*: Node*/
|
|
, selector
|
|
/*: string*/
|
|
)
|
|
/*: boolean*/
|
|
{
|
|
if (!matchesSelectorFunc) {
|
|
matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {
|
|
// $FlowIgnore: Doesn't think elements are indexable
|
|
return (0, _shims.isFunction)(el[method]);
|
|
});
|
|
} // Might not be found entirely (not an Element?) - in that case, bail
|
|
// $FlowIgnore: Doesn't think elements are indexable
|
|
|
|
|
|
if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false; // $FlowIgnore: Doesn't think elements are indexable
|
|
|
|
return el[matchesSelectorFunc](selector);
|
|
} // Works up the tree to the draggable itself attempting to match selector.
|
|
|
|
|
|
function matchesSelectorAndParentsTo(el
|
|
/*: Node*/
|
|
, selector
|
|
/*: string*/
|
|
, baseNode
|
|
/*: Node*/
|
|
)
|
|
/*: boolean*/
|
|
{
|
|
var node = el;
|
|
|
|
do {
|
|
if (matchesSelector(node, selector)) return true;
|
|
if (node === baseNode) return false;
|
|
node = node.parentNode;
|
|
} while (node);
|
|
|
|
return false;
|
|
}
|
|
|
|
function addEvent(el
|
|
/*: ?Node*/
|
|
, event
|
|
/*: string*/
|
|
, handler
|
|
/*: Function*/
|
|
, inputOptions
|
|
/*: Object*/
|
|
)
|
|
/*: void*/
|
|
{
|
|
if (!el) return;
|
|
|
|
var options = _objectSpread({
|
|
capture: true
|
|
}, inputOptions); // $FlowIgnore[method-unbinding]
|
|
|
|
|
|
if (el.addEventListener) {
|
|
el.addEventListener(event, handler, options);
|
|
} else if (el.attachEvent) {
|
|
el.attachEvent('on' + event, handler);
|
|
} else {
|
|
// $FlowIgnore: Doesn't think elements are indexable
|
|
el['on' + event] = handler;
|
|
}
|
|
}
|
|
|
|
function removeEvent(el
|
|
/*: ?Node*/
|
|
, event
|
|
/*: string*/
|
|
, handler
|
|
/*: Function*/
|
|
, inputOptions
|
|
/*: Object*/
|
|
)
|
|
/*: void*/
|
|
{
|
|
if (!el) return;
|
|
|
|
var options = _objectSpread({
|
|
capture: true
|
|
}, inputOptions); // $FlowIgnore[method-unbinding]
|
|
|
|
|
|
if (el.removeEventListener) {
|
|
el.removeEventListener(event, handler, options);
|
|
} else if (el.detachEvent) {
|
|
el.detachEvent('on' + event, handler);
|
|
} else {
|
|
// $FlowIgnore: Doesn't think elements are indexable
|
|
el['on' + event] = null;
|
|
}
|
|
}
|
|
|
|
function outerHeight(node
|
|
/*: HTMLElement*/
|
|
)
|
|
/*: number*/
|
|
{
|
|
// This is deliberately excluding margin for our calculations, since we are using
|
|
// offsetTop which is including margin. See getBoundPosition
|
|
var height = node.clientHeight;
|
|
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
height += (0, _shims.int)(computedStyle.borderTopWidth);
|
|
height += (0, _shims.int)(computedStyle.borderBottomWidth);
|
|
return height;
|
|
}
|
|
|
|
function outerWidth(node
|
|
/*: HTMLElement*/
|
|
)
|
|
/*: number*/
|
|
{
|
|
// This is deliberately excluding margin for our calculations, since we are using
|
|
// offsetLeft which is including margin. See getBoundPosition
|
|
var width = node.clientWidth;
|
|
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
width += (0, _shims.int)(computedStyle.borderLeftWidth);
|
|
width += (0, _shims.int)(computedStyle.borderRightWidth);
|
|
return width;
|
|
}
|
|
|
|
function innerHeight(node
|
|
/*: HTMLElement*/
|
|
)
|
|
/*: number*/
|
|
{
|
|
var height = node.clientHeight;
|
|
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
height -= (0, _shims.int)(computedStyle.paddingTop);
|
|
height -= (0, _shims.int)(computedStyle.paddingBottom);
|
|
return height;
|
|
}
|
|
|
|
function innerWidth(node
|
|
/*: HTMLElement*/
|
|
)
|
|
/*: number*/
|
|
{
|
|
var width = node.clientWidth;
|
|
var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);
|
|
width -= (0, _shims.int)(computedStyle.paddingLeft);
|
|
width -= (0, _shims.int)(computedStyle.paddingRight);
|
|
return width;
|
|
}
|
|
/*:: interface EventWithOffset {
|
|
clientX: number, clientY: number
|
|
}*/
|
|
|
|
|
|
// Get from offsetParent
|
|
function offsetXYFromParent(evt
|
|
/*: EventWithOffset*/
|
|
, offsetParent
|
|
/*: HTMLElement*/
|
|
, scale
|
|
/*: number*/
|
|
)
|
|
/*: ControlPosition*/
|
|
{
|
|
var isBody = offsetParent === offsetParent.ownerDocument.body;
|
|
var offsetParentRect = isBody ? {
|
|
left: 0,
|
|
top: 0
|
|
} : offsetParent.getBoundingClientRect();
|
|
var x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
|
|
var y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
|
|
return {
|
|
x: x,
|
|
y: y
|
|
};
|
|
}
|
|
|
|
function createCSSTransform(controlPos
|
|
/*: ControlPosition*/
|
|
, positionOffset
|
|
/*: PositionOffsetControlPosition*/
|
|
)
|
|
/*: Object*/
|
|
{
|
|
var translation = getTranslation(controlPos, positionOffset, 'px');
|
|
return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix.default), translation);
|
|
}
|
|
|
|
function createSVGTransform(controlPos
|
|
/*: ControlPosition*/
|
|
, positionOffset
|
|
/*: PositionOffsetControlPosition*/
|
|
)
|
|
/*: string*/
|
|
{
|
|
var translation = getTranslation(controlPos, positionOffset, '');
|
|
return translation;
|
|
}
|
|
|
|
function getTranslation(_ref2, positionOffset
|
|
/*: PositionOffsetControlPosition*/
|
|
, unitSuffix
|
|
/*: string*/
|
|
)
|
|
/*: string*/
|
|
{
|
|
var x = _ref2.x,
|
|
y = _ref2.y;
|
|
var translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")");
|
|
|
|
if (positionOffset) {
|
|
var defaultX = "".concat(typeof positionOffset.x === 'string' ? positionOffset.x : positionOffset.x + unitSuffix);
|
|
var defaultY = "".concat(typeof positionOffset.y === 'string' ? positionOffset.y : positionOffset.y + unitSuffix);
|
|
translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation;
|
|
}
|
|
|
|
return translation;
|
|
}
|
|
|
|
function getTouch(e
|
|
/*: MouseTouchEvent*/
|
|
, identifier
|
|
/*: number*/
|
|
)
|
|
/*: ?{clientX: number, clientY: number}*/
|
|
{
|
|
return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) {
|
|
return identifier === t.identifier;
|
|
}) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) {
|
|
return identifier === t.identifier;
|
|
});
|
|
}
|
|
|
|
function getTouchIdentifier(e
|
|
/*: MouseTouchEvent*/
|
|
)
|
|
/*: ?number*/
|
|
{
|
|
if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
|
|
if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
|
|
} // User-select Hacks:
|
|
//
|
|
// Useful for preventing blue highlights all over everything when dragging.
|
|
// Note we're passing `document` b/c we could be iframed
|
|
|
|
|
|
function addUserSelectStyles(doc
|
|
/*: ?Document*/
|
|
) {
|
|
if (!doc) return;
|
|
var styleEl = doc.getElementById('react-draggable-style-el');
|
|
|
|
if (!styleEl) {
|
|
styleEl = doc.createElement('style');
|
|
styleEl.type = 'text/css';
|
|
styleEl.id = 'react-draggable-style-el';
|
|
styleEl.innerHTML = '.react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n';
|
|
styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {all: inherit;}\n';
|
|
doc.getElementsByTagName('head')[0].appendChild(styleEl);
|
|
}
|
|
|
|
if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection');
|
|
}
|
|
|
|
function removeUserSelectStyles(doc
|
|
/*: ?Document*/
|
|
) {
|
|
if (!doc) return;
|
|
|
|
try {
|
|
if (doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection'); // $FlowIgnore: IE
|
|
|
|
if (doc.selection) {
|
|
// $FlowIgnore: IE
|
|
doc.selection.empty();
|
|
} else {
|
|
// Remove selection caused by scroll, unless it's a focused input
|
|
// (we use doc.defaultView in case we're in an iframe)
|
|
var selection = (doc.defaultView || window).getSelection();
|
|
|
|
if (selection && selection.type !== 'Caret') {
|
|
selection.removeAllRanges();
|
|
}
|
|
}
|
|
} catch (e) {// probably IE
|
|
}
|
|
}
|
|
|
|
function addClassName(el
|
|
/*: HTMLElement*/
|
|
, className
|
|
/*: string*/
|
|
) {
|
|
if (el.classList) {
|
|
el.classList.add(className);
|
|
} else {
|
|
if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) {
|
|
el.className += " ".concat(className);
|
|
}
|
|
}
|
|
}
|
|
|
|
function removeClassName(el
|
|
/*: HTMLElement*/
|
|
, className
|
|
/*: string*/
|
|
) {
|
|
if (el.classList) {
|
|
el.classList.remove(className);
|
|
} else {
|
|
el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), 'g'), '');
|
|
}
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 38650:
|
|
/*!*******************************************************************!*\
|
|
!*** ./node_modules/react-draggable/build/cjs/utils/getPrefix.js ***!
|
|
\*******************************************************************/
|
|
/***/ (function(__unused_webpack_module, exports) {
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
exports.browserPrefixToKey = browserPrefixToKey;
|
|
exports.browserPrefixToStyle = browserPrefixToStyle;
|
|
exports["default"] = void 0;
|
|
exports.getPrefix = getPrefix;
|
|
var prefixes = ['Moz', 'Webkit', 'O', 'ms'];
|
|
|
|
function getPrefix()
|
|
/*: string*/
|
|
{
|
|
var _window$document, _window$document$docu;
|
|
|
|
var prop
|
|
/*: string*/
|
|
= arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';
|
|
// Ensure we're running in an environment where there is actually a global
|
|
// `window` obj
|
|
if (typeof window === 'undefined') return ''; // If we're in a pseudo-browser server-side environment, this access
|
|
// path may not exist, so bail out if it doesn't.
|
|
|
|
var style = (_window$document = window.document) === null || _window$document === void 0 ? void 0 : (_window$document$docu = _window$document.documentElement) === null || _window$document$docu === void 0 ? void 0 : _window$document$docu.style;
|
|
if (!style) return '';
|
|
if (prop in style) return '';
|
|
|
|
for (var i = 0; i < prefixes.length; i++) {
|
|
if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];
|
|
}
|
|
|
|
return '';
|
|
}
|
|
|
|
function browserPrefixToKey(prop
|
|
/*: string*/
|
|
, prefix
|
|
/*: string*/
|
|
)
|
|
/*: string*/
|
|
{
|
|
return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop;
|
|
}
|
|
|
|
function browserPrefixToStyle(prop
|
|
/*: string*/
|
|
, prefix
|
|
/*: string*/
|
|
)
|
|
/*: string*/
|
|
{
|
|
return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop;
|
|
}
|
|
|
|
function kebabToTitleCase(str
|
|
/*: string*/
|
|
)
|
|
/*: string*/
|
|
{
|
|
var out = '';
|
|
var shouldCapitalize = true;
|
|
|
|
for (var i = 0; i < str.length; i++) {
|
|
if (shouldCapitalize) {
|
|
out += str[i].toUpperCase();
|
|
shouldCapitalize = false;
|
|
} else if (str[i] === '-') {
|
|
shouldCapitalize = true;
|
|
} else {
|
|
out += str[i];
|
|
}
|
|
}
|
|
|
|
return out;
|
|
} // Default export is the prefix itself, like 'Moz', 'Webkit', etc
|
|
// Note that you may have to re-test for certain things; for instance, Chrome 50
|
|
// can handle unprefixed `transform`, but not unprefixed `user-select`
|
|
|
|
|
|
var _default = (getPrefix()
|
|
/*: string*/
|
|
);
|
|
|
|
exports["default"] = _default;
|
|
|
|
/***/ }),
|
|
|
|
/***/ 55904:
|
|
/*!*************************************************************!*\
|
|
!*** ./node_modules/react-draggable/build/cjs/utils/log.js ***!
|
|
\*************************************************************/
|
|
/***/ (function(__unused_webpack_module, exports) {
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
exports["default"] = log;
|
|
|
|
/*eslint no-console:0*/
|
|
function log() {
|
|
var _console;
|
|
|
|
if (false) {}
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 2849:
|
|
/*!*********************************************************************!*\
|
|
!*** ./node_modules/react-draggable/build/cjs/utils/positionFns.js ***!
|
|
\*********************************************************************/
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
exports.canDragX = canDragX;
|
|
exports.canDragY = canDragY;
|
|
exports.createCoreData = createCoreData;
|
|
exports.createDraggableData = createDraggableData;
|
|
exports.getBoundPosition = getBoundPosition;
|
|
exports.getControlPosition = getControlPosition;
|
|
exports.snapToGrid = snapToGrid;
|
|
|
|
var _shims = __webpack_require__(/*! ./shims */ 9280);
|
|
|
|
var _domFns = __webpack_require__(/*! ./domFns */ 81825);
|
|
|
|
function getBoundPosition(draggable
|
|
/*: Draggable*/
|
|
, x
|
|
/*: number*/
|
|
, y
|
|
/*: number*/
|
|
)
|
|
/*: [number, number]*/
|
|
{
|
|
// If no bounds, short-circuit and move on
|
|
if (!draggable.props.bounds) return [x, y]; // Clone new bounds
|
|
|
|
var bounds = draggable.props.bounds;
|
|
bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);
|
|
var node = findDOMNode(draggable);
|
|
|
|
if (typeof bounds === 'string') {
|
|
var ownerDocument = node.ownerDocument;
|
|
var ownerWindow = ownerDocument.defaultView;
|
|
var boundNode;
|
|
|
|
if (bounds === 'parent') {
|
|
boundNode = node.parentNode;
|
|
} else {
|
|
boundNode = ownerDocument.querySelector(bounds);
|
|
}
|
|
|
|
if (!(boundNode instanceof ownerWindow.HTMLElement)) {
|
|
throw new Error('Bounds selector "' + bounds + '" could not find an element.');
|
|
}
|
|
|
|
var boundNodeEl
|
|
/*: HTMLElement*/
|
|
= boundNode; // for Flow, can't seem to refine correctly
|
|
|
|
var nodeStyle = ownerWindow.getComputedStyle(node);
|
|
var boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl); // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.
|
|
|
|
bounds = {
|
|
left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
|
|
top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
|
|
right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
|
|
bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
|
|
};
|
|
} // Keep x and y below right and bottom limits...
|
|
|
|
|
|
if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right);
|
|
if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom); // But above left and top limits.
|
|
|
|
if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left);
|
|
if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top);
|
|
return [x, y];
|
|
}
|
|
|
|
function snapToGrid(grid
|
|
/*: [number, number]*/
|
|
, pendingX
|
|
/*: number*/
|
|
, pendingY
|
|
/*: number*/
|
|
)
|
|
/*: [number, number]*/
|
|
{
|
|
var x = Math.round(pendingX / grid[0]) * grid[0];
|
|
var y = Math.round(pendingY / grid[1]) * grid[1];
|
|
return [x, y];
|
|
}
|
|
|
|
function canDragX(draggable
|
|
/*: Draggable*/
|
|
)
|
|
/*: boolean*/
|
|
{
|
|
return draggable.props.axis === 'both' || draggable.props.axis === 'x';
|
|
}
|
|
|
|
function canDragY(draggable
|
|
/*: Draggable*/
|
|
)
|
|
/*: boolean*/
|
|
{
|
|
return draggable.props.axis === 'both' || draggable.props.axis === 'y';
|
|
} // Get {x, y} positions from event.
|
|
|
|
|
|
function getControlPosition(e
|
|
/*: MouseTouchEvent*/
|
|
, touchIdentifier
|
|
/*: ?number*/
|
|
, draggableCore
|
|
/*: DraggableCore*/
|
|
)
|
|
/*: ?ControlPosition*/
|
|
{
|
|
var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;
|
|
if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch
|
|
|
|
var node = findDOMNode(draggableCore); // User can provide an offsetParent if desired.
|
|
|
|
var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
|
|
return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale);
|
|
} // Create an data object exposed by <DraggableCore>'s events
|
|
|
|
|
|
function createCoreData(draggable
|
|
/*: DraggableCore*/
|
|
, x
|
|
/*: number*/
|
|
, y
|
|
/*: number*/
|
|
)
|
|
/*: DraggableData*/
|
|
{
|
|
var state = draggable.state;
|
|
var isStart = !(0, _shims.isNum)(state.lastX);
|
|
var node = findDOMNode(draggable);
|
|
|
|
if (isStart) {
|
|
// If this is our first move, use the x and y as last coords.
|
|
return {
|
|
node: node,
|
|
deltaX: 0,
|
|
deltaY: 0,
|
|
lastX: x,
|
|
lastY: y,
|
|
x: x,
|
|
y: y
|
|
};
|
|
} else {
|
|
// Otherwise calculate proper values.
|
|
return {
|
|
node: node,
|
|
deltaX: x - state.lastX,
|
|
deltaY: y - state.lastY,
|
|
lastX: state.lastX,
|
|
lastY: state.lastY,
|
|
x: x,
|
|
y: y
|
|
};
|
|
}
|
|
} // Create an data exposed by <Draggable>'s events
|
|
|
|
|
|
function createDraggableData(draggable
|
|
/*: Draggable*/
|
|
, coreData
|
|
/*: DraggableData*/
|
|
)
|
|
/*: DraggableData*/
|
|
{
|
|
var scale = draggable.props.scale;
|
|
return {
|
|
node: coreData.node,
|
|
x: draggable.state.x + coreData.deltaX / scale,
|
|
y: draggable.state.y + coreData.deltaY / scale,
|
|
deltaX: coreData.deltaX / scale,
|
|
deltaY: coreData.deltaY / scale,
|
|
lastX: draggable.state.x,
|
|
lastY: draggable.state.y
|
|
};
|
|
} // A lot faster than stringify/parse
|
|
|
|
|
|
function cloneBounds(bounds
|
|
/*: Bounds*/
|
|
)
|
|
/*: Bounds*/
|
|
{
|
|
return {
|
|
left: bounds.left,
|
|
top: bounds.top,
|
|
right: bounds.right,
|
|
bottom: bounds.bottom
|
|
};
|
|
}
|
|
|
|
function findDOMNode(draggable
|
|
/*: Draggable | DraggableCore*/
|
|
)
|
|
/*: HTMLElement*/
|
|
{
|
|
var node = draggable.findDOMNode();
|
|
|
|
if (!node) {
|
|
throw new Error('<DraggableCore>: Unmounted during event!');
|
|
} // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME
|
|
|
|
|
|
return node;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 9280:
|
|
/*!***************************************************************!*\
|
|
!*** ./node_modules/react-draggable/build/cjs/utils/shims.js ***!
|
|
\***************************************************************/
|
|
/***/ (function(__unused_webpack_module, exports) {
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
exports.dontSetMe = dontSetMe;
|
|
exports.findInArray = findInArray;
|
|
exports.int = int;
|
|
exports.isFunction = isFunction;
|
|
exports.isNum = isNum;
|
|
|
|
// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc
|
|
function findInArray(array
|
|
/*: Array<any> | TouchList*/
|
|
, callback
|
|
/*: Function*/
|
|
)
|
|
/*: any*/
|
|
{
|
|
for (var i = 0, length = array.length; i < length; i++) {
|
|
if (callback.apply(callback, [array[i], i, array])) return array[i];
|
|
}
|
|
}
|
|
|
|
function isFunction(func
|
|
/*: any*/
|
|
)
|
|
/*: boolean %checks*/
|
|
{
|
|
// $FlowIgnore[method-unbinding]
|
|
return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';
|
|
}
|
|
|
|
function isNum(num
|
|
/*: any*/
|
|
)
|
|
/*: boolean %checks*/
|
|
{
|
|
return typeof num === 'number' && !isNaN(num);
|
|
}
|
|
|
|
function int(a
|
|
/*: string*/
|
|
)
|
|
/*: number*/
|
|
{
|
|
return parseInt(a, 10);
|
|
}
|
|
|
|
function dontSetMe(props
|
|
/*: Object*/
|
|
, propName
|
|
/*: string*/
|
|
, componentName
|
|
/*: string*/
|
|
)
|
|
/*: ?Error*/
|
|
{
|
|
if (props[propName]) {
|
|
return new Error("Invalid prop ".concat(propName, " passed to ").concat(componentName, " - do not set this, set it on the child."));
|
|
}
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 22827:
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/react-resizable/build/Resizable.js ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
exports.__esModule = true;
|
|
exports["default"] = void 0;
|
|
|
|
var _react = _interopRequireDefault(__webpack_require__(/*! react */ 67294));
|
|
|
|
var _reactDraggable = __webpack_require__(/*! react-draggable */ 61193);
|
|
|
|
var _utils = __webpack_require__(/*! ./utils */ 59069);
|
|
|
|
var _propTypes = __webpack_require__(/*! ./propTypes */ 448);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
var Resizable = /*#__PURE__*/function (_React$Component) {
|
|
_inheritsLoose(Resizable, _React$Component);
|
|
|
|
function Resizable() {
|
|
var _this;
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "state", undefined);
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "lastHandleRect", null);
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "slack", null);
|
|
|
|
return _this;
|
|
}
|
|
|
|
var _proto = Resizable.prototype;
|
|
|
|
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
this.resetData();
|
|
};
|
|
|
|
_proto.lockAspectRatio = function lockAspectRatio(width, height, aspectRatio) {
|
|
height = width / aspectRatio;
|
|
width = height * aspectRatio;
|
|
return [width, height];
|
|
};
|
|
|
|
_proto.resetData = function resetData() {
|
|
this.lastHandleRect = this.slack = null;
|
|
} // Clamp width and height within provided constraints
|
|
;
|
|
|
|
_proto.runConstraints = function runConstraints(width, height) {
|
|
var _ref = [this.props.minConstraints, this.props.maxConstraints],
|
|
min = _ref[0],
|
|
max = _ref[1];
|
|
if (!min && !max) return [width, height]; // If constraining to min and max, we need to also fit width and height to aspect ratio.
|
|
|
|
if (this.props.lockAspectRatio) {
|
|
var resizingHorizontally = height === this.props.height;
|
|
|
|
if (resizingHorizontally) {
|
|
var ratio = this.props.width / this.props.height;
|
|
height = width / ratio;
|
|
width = height * ratio;
|
|
} else {
|
|
// Take into account vertical resize with N/S handles on locked aspect
|
|
// ratio. Calculate the change height-first, instead of width-first
|
|
var _ratio = this.props.height / this.props.width;
|
|
|
|
width = height / _ratio;
|
|
height = width * _ratio;
|
|
}
|
|
}
|
|
|
|
var oldW = width,
|
|
oldH = height; // Add slack to the values used to calculate bound position. This will ensure that if
|
|
// we start removing slack, the element won't react to it right away until it's been
|
|
// completely removed.
|
|
|
|
var _ref2 = this.slack || [0, 0],
|
|
slackW = _ref2[0],
|
|
slackH = _ref2[1];
|
|
|
|
width += slackW;
|
|
height += slackH;
|
|
|
|
if (min) {
|
|
width = Math.max(min[0], width);
|
|
height = Math.max(min[1], height);
|
|
}
|
|
|
|
if (max) {
|
|
width = Math.min(max[0], width);
|
|
height = Math.min(max[1], height);
|
|
} // If the width or height changed, we must have introduced some slack. Record it for the next iteration.
|
|
|
|
|
|
this.slack = [slackW + (oldW - width), slackH + (oldH - height)];
|
|
return [width, height];
|
|
}
|
|
/**
|
|
* Wrapper around drag events to provide more useful data.
|
|
*
|
|
* @param {String} handlerName Handler name to wrap.
|
|
* @return {Function} Handler function.
|
|
*/
|
|
;
|
|
|
|
_proto.resizeHandler = function resizeHandler(handlerName, axis) {
|
|
var _this2 = this;
|
|
|
|
return function (e, _ref3) {
|
|
var node = _ref3.node,
|
|
deltaX = _ref3.deltaX,
|
|
deltaY = _ref3.deltaY;
|
|
// Reset data in case it was left over somehow (should not be possible)
|
|
if (handlerName === 'onResizeStart') _this2.resetData(); // Axis restrictions
|
|
|
|
var canDragX = (_this2.props.axis === 'both' || _this2.props.axis === 'x') && axis !== 'n' && axis !== 's';
|
|
var canDragY = (_this2.props.axis === 'both' || _this2.props.axis === 'y') && axis !== 'e' && axis !== 'w'; // No dragging possible.
|
|
|
|
if (!canDragX && !canDragY) return; // Decompose axis for later use
|
|
|
|
var axisV = axis[0];
|
|
var axisH = axis[axis.length - 1]; // intentionally not axis[1], so that this catches axis === 'w' for example
|
|
// Track the element being dragged to account for changes in position.
|
|
// If a handle's position is changed between callbacks, we need to factor this in to the next callback.
|
|
// Failure to do so will cause the element to "skip" when resized upwards or leftwards.
|
|
|
|
var handleRect = node.getBoundingClientRect();
|
|
|
|
if (_this2.lastHandleRect != null) {
|
|
// If the handle has repositioned on either axis since last render,
|
|
// we need to increase our callback values by this much.
|
|
// Only checking 'n', 'w' since resizing by 's', 'w' won't affect the overall position on page,
|
|
if (axisH === 'w') {
|
|
var deltaLeftSinceLast = handleRect.left - _this2.lastHandleRect.left;
|
|
deltaX += deltaLeftSinceLast;
|
|
}
|
|
|
|
if (axisV === 'n') {
|
|
var deltaTopSinceLast = handleRect.top - _this2.lastHandleRect.top;
|
|
deltaY += deltaTopSinceLast;
|
|
}
|
|
} // Storage of last rect so we know how much it has really moved.
|
|
|
|
|
|
_this2.lastHandleRect = handleRect; // Reverse delta if using top or left drag handles.
|
|
|
|
if (axisH === 'w') deltaX = -deltaX;
|
|
if (axisV === 'n') deltaY = -deltaY; // Update w/h by the deltas. Also factor in transformScale.
|
|
|
|
var width = _this2.props.width + (canDragX ? deltaX / _this2.props.transformScale : 0);
|
|
var height = _this2.props.height + (canDragY ? deltaY / _this2.props.transformScale : 0); // Run user-provided constraints.
|
|
|
|
var _this2$runConstraints = _this2.runConstraints(width, height);
|
|
|
|
width = _this2$runConstraints[0];
|
|
height = _this2$runConstraints[1];
|
|
var dimensionsChanged = width !== _this2.props.width || height !== _this2.props.height; // Call user-supplied callback if present.
|
|
|
|
var cb = typeof _this2.props[handlerName] === 'function' ? _this2.props[handlerName] : null; // Don't call 'onResize' if dimensions haven't changed.
|
|
|
|
var shouldSkipCb = handlerName === 'onResize' && !dimensionsChanged;
|
|
|
|
if (cb && !shouldSkipCb) {
|
|
if (typeof e.persist === 'function') e.persist();
|
|
cb(e, {
|
|
node: node,
|
|
size: {
|
|
width: width,
|
|
height: height
|
|
},
|
|
handle: axis
|
|
});
|
|
} // Reset internal data
|
|
|
|
|
|
if (handlerName === 'onResizeStop') _this2.resetData();
|
|
};
|
|
};
|
|
|
|
_proto.renderResizeHandle = function renderResizeHandle(resizeHandleAxis) {
|
|
var handle = this.props.handle;
|
|
|
|
if (handle) {
|
|
if (typeof handle === 'function') {
|
|
return handle(resizeHandleAxis);
|
|
}
|
|
|
|
return handle;
|
|
}
|
|
|
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
className: "react-resizable-handle react-resizable-handle-" + resizeHandleAxis
|
|
});
|
|
};
|
|
|
|
_proto.render = function render() {
|
|
var _this3 = this;
|
|
|
|
// Pass along only props not meant for the `<Resizable>`.`
|
|
// eslint-disable-next-line no-unused-vars
|
|
var _this$props = this.props,
|
|
children = _this$props.children,
|
|
className = _this$props.className,
|
|
draggableOpts = _this$props.draggableOpts,
|
|
width = _this$props.width,
|
|
height = _this$props.height,
|
|
handle = _this$props.handle,
|
|
handleSize = _this$props.handleSize,
|
|
lockAspectRatio = _this$props.lockAspectRatio,
|
|
axis = _this$props.axis,
|
|
minConstraints = _this$props.minConstraints,
|
|
maxConstraints = _this$props.maxConstraints,
|
|
onResize = _this$props.onResize,
|
|
onResizeStop = _this$props.onResizeStop,
|
|
onResizeStart = _this$props.onResizeStart,
|
|
resizeHandles = _this$props.resizeHandles,
|
|
transformScale = _this$props.transformScale,
|
|
p = _objectWithoutPropertiesLoose(_this$props, ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"]); // What we're doing here is getting the child of this element, and cloning it with this element's props.
|
|
// We are then defining its children as:
|
|
// Its original children (resizable's child's children), and
|
|
// One or more draggable handles.
|
|
|
|
|
|
return (0, _utils.cloneElement)(children, _objectSpread(_objectSpread({}, p), {}, {
|
|
className: (className ? className + " " : '') + "react-resizable",
|
|
children: [].concat(children.props.children, resizeHandles.map(function (handleAxis) {
|
|
return /*#__PURE__*/_react.default.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
|
|
key: "resizableHandle-" + handleAxis,
|
|
onStop: _this3.resizeHandler('onResizeStop', handleAxis),
|
|
onStart: _this3.resizeHandler('onResizeStart', handleAxis),
|
|
onDrag: _this3.resizeHandler('onResize', handleAxis)
|
|
}), _this3.renderResizeHandle(handleAxis));
|
|
}))
|
|
}));
|
|
};
|
|
|
|
return Resizable;
|
|
}(_react.default.Component);
|
|
|
|
exports["default"] = Resizable;
|
|
|
|
_defineProperty(Resizable, "propTypes", _propTypes.resizableProps);
|
|
|
|
_defineProperty(Resizable, "defaultProps", {
|
|
handleSize: [20, 20],
|
|
lockAspectRatio: false,
|
|
axis: 'both',
|
|
minConstraints: [20, 20],
|
|
maxConstraints: [Infinity, Infinity],
|
|
resizeHandles: ['se'],
|
|
transformScale: 1
|
|
});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 8735:
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/react-resizable/build/ResizableBox.js ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
var __webpack_unused_export__;
|
|
|
|
|
|
__webpack_unused_export__ = true;
|
|
exports["default"] = void 0;
|
|
|
|
var React = _interopRequireWildcard(__webpack_require__(/*! react */ 67294));
|
|
|
|
var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ 45697));
|
|
|
|
var _Resizable = _interopRequireDefault(__webpack_require__(/*! ./Resizable */ 22827));
|
|
|
|
var _propTypes2 = __webpack_require__(/*! ./propTypes */ 448);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
|
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
|
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
|
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
var ResizableBox = /*#__PURE__*/function (_React$Component) {
|
|
_inheritsLoose(ResizableBox, _React$Component);
|
|
|
|
function ResizableBox() {
|
|
var _this;
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
width: _this.props.width,
|
|
height: _this.props.height,
|
|
propsWidth: _this.props.width,
|
|
propsHeight: _this.props.height
|
|
});
|
|
|
|
_defineProperty(_assertThisInitialized(_this), "onResize", function (e, data) {
|
|
var size = data.size;
|
|
|
|
if (_this.props.onResize) {
|
|
e.persist && e.persist();
|
|
|
|
_this.setState(size, function () {
|
|
return _this.props.onResize && _this.props.onResize(e, data);
|
|
});
|
|
} else {
|
|
_this.setState(size);
|
|
}
|
|
});
|
|
|
|
return _this;
|
|
}
|
|
|
|
ResizableBox.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
|
// If parent changes height/width, set that in our state.
|
|
if (state.propsWidth !== props.width || state.propsHeight !== props.height) {
|
|
return {
|
|
width: props.width,
|
|
height: props.height,
|
|
propsWidth: props.width,
|
|
propsHeight: props.height
|
|
};
|
|
}
|
|
|
|
return null;
|
|
};
|
|
|
|
var _proto = ResizableBox.prototype;
|
|
|
|
_proto.render = function render() {
|
|
// Basic wrapper around a Resizable instance.
|
|
// If you use Resizable directly, you are responsible for updating the child component
|
|
// with a new width and height.
|
|
var _this$props = this.props,
|
|
handle = _this$props.handle,
|
|
handleSize = _this$props.handleSize,
|
|
onResize = _this$props.onResize,
|
|
onResizeStart = _this$props.onResizeStart,
|
|
onResizeStop = _this$props.onResizeStop,
|
|
draggableOpts = _this$props.draggableOpts,
|
|
minConstraints = _this$props.minConstraints,
|
|
maxConstraints = _this$props.maxConstraints,
|
|
lockAspectRatio = _this$props.lockAspectRatio,
|
|
axis = _this$props.axis,
|
|
width = _this$props.width,
|
|
height = _this$props.height,
|
|
resizeHandles = _this$props.resizeHandles,
|
|
style = _this$props.style,
|
|
transformScale = _this$props.transformScale,
|
|
props = _objectWithoutPropertiesLoose(_this$props, ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"]);
|
|
|
|
return /*#__PURE__*/React.createElement(_Resizable.default, {
|
|
axis: axis,
|
|
draggableOpts: draggableOpts,
|
|
handle: handle,
|
|
handleSize: handleSize,
|
|
height: this.state.height,
|
|
lockAspectRatio: lockAspectRatio,
|
|
maxConstraints: maxConstraints,
|
|
minConstraints: minConstraints,
|
|
onResizeStart: onResizeStart,
|
|
onResize: this.onResize,
|
|
onResizeStop: onResizeStop,
|
|
resizeHandles: resizeHandles,
|
|
transformScale: transformScale,
|
|
width: this.state.width
|
|
}, /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
width: this.state.width + 'px',
|
|
height: this.state.height + 'px'
|
|
})
|
|
})));
|
|
};
|
|
|
|
return ResizableBox;
|
|
}(React.Component);
|
|
|
|
exports["default"] = ResizableBox;
|
|
|
|
_defineProperty(ResizableBox, "propTypes", _objectSpread(_objectSpread({}, _propTypes2.resizableProps), {}, {
|
|
children: _propTypes.default.element
|
|
}));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 448:
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/react-resizable/build/propTypes.js ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
exports.__esModule = true;
|
|
exports.resizableProps = void 0;
|
|
|
|
var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ 45697));
|
|
|
|
var _reactDraggable = __webpack_require__(/*! react-draggable */ 61193);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
var resizableProps = {
|
|
/*
|
|
* Restricts resizing to a particular axis (default: 'both')
|
|
* 'both' - allows resizing by width or height
|
|
* 'x' - only allows the width to be changed
|
|
* 'y' - only allows the height to be changed
|
|
* 'none' - disables resizing altogether
|
|
* */
|
|
axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']),
|
|
className: _propTypes.default.string,
|
|
|
|
/*
|
|
* Require that one and only one child be present.
|
|
* */
|
|
children: _propTypes.default.element.isRequired,
|
|
|
|
/*
|
|
* These will be passed wholesale to react-draggable's DraggableCore
|
|
* */
|
|
draggableOpts: _propTypes.default.shape({
|
|
allowAnyClick: _propTypes.default.bool,
|
|
cancel: _propTypes.default.string,
|
|
children: _propTypes.default.node,
|
|
disabled: _propTypes.default.bool,
|
|
enableUserSelectHack: _propTypes.default.bool,
|
|
offsetParent: _propTypes.default.node,
|
|
grid: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
handle: _propTypes.default.string,
|
|
nodeRef: _propTypes.default.object,
|
|
onStart: _propTypes.default.func,
|
|
onDrag: _propTypes.default.func,
|
|
onStop: _propTypes.default.func,
|
|
onMouseDown: _propTypes.default.func,
|
|
scale: _propTypes.default.number
|
|
}),
|
|
|
|
/*
|
|
* Initial height
|
|
* */
|
|
height: _propTypes.default.number.isRequired,
|
|
|
|
/*
|
|
* Customize cursor resize handle
|
|
* */
|
|
handle: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
|
|
/*
|
|
* If you change this, be sure to update your css
|
|
* */
|
|
handleSize: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
lockAspectRatio: _propTypes.default.bool,
|
|
|
|
/*
|
|
* Max X & Y measure
|
|
* */
|
|
maxConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
|
|
/*
|
|
* Min X & Y measure
|
|
* */
|
|
minConstraints: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
|
|
/*
|
|
* Called on stop resize event
|
|
* */
|
|
onResizeStop: _propTypes.default.func,
|
|
|
|
/*
|
|
* Called on start resize event
|
|
* */
|
|
onResizeStart: _propTypes.default.func,
|
|
|
|
/*
|
|
* Called on resize event
|
|
* */
|
|
onResize: _propTypes.default.func,
|
|
|
|
/*
|
|
* Defines which resize handles should be rendered (default: 'se')
|
|
* 's' - South handle (bottom-center)
|
|
* 'w' - West handle (left-center)
|
|
* 'e' - East handle (right-center)
|
|
* 'n' - North handle (top-center)
|
|
* 'sw' - Southwest handle (bottom-left)
|
|
* 'nw' - Northwest handle (top-left)
|
|
* 'se' - Southeast handle (bottom-right)
|
|
* 'ne' - Northeast handle (top-center)
|
|
* */
|
|
resizeHandles: _propTypes.default.arrayOf(_propTypes.default.oneOf(['s', 'w', 'e', 'n', 'sw', 'nw', 'se', 'ne'])),
|
|
|
|
/*
|
|
* If `transform: scale(n)` is set on the parent, this should be set to `n`.
|
|
* */
|
|
transformScale: _propTypes.default.number,
|
|
|
|
/*
|
|
* Initial width
|
|
*/
|
|
width: _propTypes.default.number.isRequired
|
|
};
|
|
exports.resizableProps = resizableProps;
|
|
|
|
/***/ }),
|
|
|
|
/***/ 59069:
|
|
/*!*****************************************************!*\
|
|
!*** ./node_modules/react-resizable/build/utils.js ***!
|
|
\*****************************************************/
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
exports.__esModule = true;
|
|
exports.cloneElement = cloneElement;
|
|
|
|
var _react = _interopRequireDefault(__webpack_require__(/*! react */ 67294));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
// React.addons.cloneWithProps look-alike that merges style & className.
|
|
function cloneElement(element, props) {
|
|
if (props.style && element.props.style) {
|
|
props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);
|
|
}
|
|
|
|
if (props.className && element.props.className) {
|
|
props.className = element.props.className + " " + props.className;
|
|
}
|
|
|
|
return /*#__PURE__*/_react.default.cloneElement(element, props);
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 1706:
|
|
/*!***********************************************!*\
|
|
!*** ./node_modules/react-resizable/index.js ***!
|
|
\***********************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
|
|
module.exports = function() {
|
|
throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
|
|
};
|
|
|
|
module.exports.Resizable = __webpack_require__(/*! ./build/Resizable */ 22827)["default"];
|
|
module.exports.ResizableBox = __webpack_require__(/*! ./build/ResizableBox */ 8735)["default"];
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |