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.
1685 lines
62 KiB
1685 lines
62 KiB
(self["webpackChunk"] = self["webpackChunk"] || []).push([[3219,54909],{
|
|
|
|
/***/ 63606:
|
|
/*!******************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/CheckOutlined.js + 1 modules ***!
|
|
\******************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_CheckOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/CheckOutlined.js
|
|
// This icon file is generated automatically.
|
|
var CheckOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z" } }] }, "name": "check", "theme": "outlined" };
|
|
/* harmony default export */ var asn_CheckOutlined = (CheckOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/CheckOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var CheckOutlined_CheckOutlined = function CheckOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_CheckOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_CheckOutlined = (/*#__PURE__*/react.forwardRef(CheckOutlined_CheckOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 99611:
|
|
/*!****************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/EyeOutlined.js + 1 modules ***!
|
|
\****************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_EyeOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/EyeOutlined.js
|
|
// This icon file is generated automatically.
|
|
var EyeOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
|
|
/* harmony default export */ var asn_EyeOutlined = (EyeOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/EyeOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var EyeOutlined_EyeOutlined = function EyeOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_EyeOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_EyeOutlined = (/*#__PURE__*/react.forwardRef(EyeOutlined_EyeOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 15360:
|
|
/*!*********************************************************************************!*\
|
|
!*** ./node_modules/@ant-design/icons/es/icons/FileTextOutlined.js + 1 modules ***!
|
|
\*********************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ icons_FileTextOutlined; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/FileTextOutlined.js
|
|
// This icon file is generated automatically.
|
|
var FileTextOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z" } }] }, "name": "file-text", "theme": "outlined" };
|
|
/* harmony default export */ var asn_FileTextOutlined = (FileTextOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/FileTextOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var FileTextOutlined_FileTextOutlined = function FileTextOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_FileTextOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_FileTextOutlined = (/*#__PURE__*/react.forwardRef(FileTextOutlined_FileTextOutlined));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 57838:
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/antd/es/_util/hooks/useForceUpdate.js ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "Z": function() { return /* binding */ useForceUpdate; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
|
|
|
|
function useForceUpdate() {
|
|
const [, forceUpdate] = react__WEBPACK_IMPORTED_MODULE_0__.useReducer(x => x + 1, 0);
|
|
return forceUpdate;
|
|
}
|
|
|
|
/***/ }),
|
|
|
|
/***/ 84567:
|
|
/*!************************************************************!*\
|
|
!*** ./node_modules/antd/es/checkbox/index.js + 3 modules ***!
|
|
\************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ es_checkbox; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/rc-checkbox/es/index.js + 5 modules
|
|
var es = __webpack_require__(95860);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var config_provider_context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/DisabledContext.js
|
|
var DisabledContext = __webpack_require__(98866);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/context.js
|
|
var context = __webpack_require__(65223);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/GroupContext.js
|
|
|
|
const GroupContext = /*#__PURE__*/react.createContext(null);
|
|
/* harmony default export */ var checkbox_GroupContext = (GroupContext);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/style/index.js
|
|
var checkbox_style = __webpack_require__(63185);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/Checkbox.js
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalCheckbox = (props, ref) => {
|
|
var _a;
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
children,
|
|
indeterminate = false,
|
|
style,
|
|
onMouseEnter,
|
|
onMouseLeave,
|
|
skipGroup = false,
|
|
disabled
|
|
} = props,
|
|
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction,
|
|
checkbox
|
|
} = react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
const checkboxGroup = react.useContext(checkbox_GroupContext);
|
|
const {
|
|
isFormItemInput
|
|
} = react.useContext(context/* FormItemInputContext */.aM);
|
|
const contextDisabled = react.useContext(DisabledContext/* default */.Z);
|
|
const mergedDisabled = (_a = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _a !== void 0 ? _a : contextDisabled;
|
|
const prevValue = react.useRef(restProps.value);
|
|
react.useEffect(() => {
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
false ? 0 : void 0;
|
|
}, []);
|
|
react.useEffect(() => {
|
|
if (skipGroup) {
|
|
return;
|
|
}
|
|
if (restProps.value !== prevValue.current) {
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
prevValue.current = restProps.value;
|
|
}
|
|
return () => checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
|
|
}, [restProps.value]);
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
const checkboxProps = Object.assign({}, restProps);
|
|
if (checkboxGroup && !skipGroup) {
|
|
checkboxProps.onChange = function () {
|
|
if (restProps.onChange) {
|
|
restProps.onChange.apply(restProps, arguments);
|
|
}
|
|
if (checkboxGroup.toggleOption) {
|
|
checkboxGroup.toggleOption({
|
|
label: children,
|
|
value: restProps.value
|
|
});
|
|
}
|
|
};
|
|
checkboxProps.name = checkboxGroup.name;
|
|
checkboxProps.checked = checkboxGroup.value.includes(restProps.value);
|
|
}
|
|
const classString = classnames_default()(`${prefixCls}-wrapper`, {
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
[`${prefixCls}-wrapper-checked`]: checkboxProps.checked,
|
|
[`${prefixCls}-wrapper-disabled`]: mergedDisabled,
|
|
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
|
|
}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.className, className, rootClassName, hashId);
|
|
const checkboxClass = classnames_default()({
|
|
[`${prefixCls}-indeterminate`]: indeterminate
|
|
}, hashId);
|
|
const ariaChecked = indeterminate ? 'mixed' : undefined;
|
|
return wrapSSR(
|
|
/*#__PURE__*/
|
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
react.createElement("label", {
|
|
className: classString,
|
|
style: Object.assign(Object.assign({}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.style), style),
|
|
onMouseEnter: onMouseEnter,
|
|
onMouseLeave: onMouseLeave
|
|
}, /*#__PURE__*/react.createElement(es/* default */.Z, Object.assign({
|
|
"aria-checked": ariaChecked
|
|
}, checkboxProps, {
|
|
prefixCls: prefixCls,
|
|
className: checkboxClass,
|
|
disabled: mergedDisabled,
|
|
ref: ref
|
|
})), children !== undefined && /*#__PURE__*/react.createElement("span", null, children)));
|
|
};
|
|
const Checkbox = /*#__PURE__*/react.forwardRef(InternalCheckbox);
|
|
if (false) {}
|
|
/* harmony default export */ var checkbox_Checkbox = (Checkbox);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
var toConsumableArray = __webpack_require__(74902);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
|
|
var omit = __webpack_require__(10366);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/Group.js
|
|
|
|
var Group_rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalGroup = (props, ref) => {
|
|
const {
|
|
defaultValue,
|
|
children,
|
|
options = [],
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
style,
|
|
onChange
|
|
} = props,
|
|
restProps = Group_rest(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction
|
|
} = react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
const [value, setValue] = react.useState(restProps.value || defaultValue || []);
|
|
const [registeredValues, setRegisteredValues] = react.useState([]);
|
|
react.useEffect(() => {
|
|
if ('value' in restProps) {
|
|
setValue(restProps.value || []);
|
|
}
|
|
}, [restProps.value]);
|
|
const memoOptions = react.useMemo(() => options.map(option => {
|
|
if (typeof option === 'string' || typeof option === 'number') {
|
|
return {
|
|
label: option,
|
|
value: option
|
|
};
|
|
}
|
|
return option;
|
|
}), [options]);
|
|
const cancelValue = val => {
|
|
setRegisteredValues(prevValues => prevValues.filter(v => v !== val));
|
|
};
|
|
const registerValue = val => {
|
|
setRegisteredValues(prevValues => [].concat((0,toConsumableArray/* default */.Z)(prevValues), [val]));
|
|
};
|
|
const toggleOption = option => {
|
|
const optionIndex = value.indexOf(option.value);
|
|
const newValue = (0,toConsumableArray/* default */.Z)(value);
|
|
if (optionIndex === -1) {
|
|
newValue.push(option.value);
|
|
} else {
|
|
newValue.splice(optionIndex, 1);
|
|
}
|
|
if (!('value' in restProps)) {
|
|
setValue(newValue);
|
|
}
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(val => registeredValues.includes(val)).sort((a, b) => {
|
|
const indexA = memoOptions.findIndex(opt => opt.value === a);
|
|
const indexB = memoOptions.findIndex(opt => opt.value === b);
|
|
return indexA - indexB;
|
|
}));
|
|
};
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
const domProps = (0,omit/* default */.Z)(restProps, ['value', 'disabled']);
|
|
const childrenNode = options.length ? memoOptions.map(option => /*#__PURE__*/react.createElement(checkbox_Checkbox, {
|
|
prefixCls: prefixCls,
|
|
key: option.value.toString(),
|
|
disabled: 'disabled' in option ? option.disabled : restProps.disabled,
|
|
value: option.value,
|
|
checked: value.includes(option.value),
|
|
onChange: option.onChange,
|
|
className: `${groupPrefixCls}-item`,
|
|
style: option.style,
|
|
title: option.title
|
|
}, option.label)) : children;
|
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
const context = {
|
|
toggleOption,
|
|
value,
|
|
disabled: restProps.disabled,
|
|
name: restProps.name,
|
|
// https://github.com/ant-design/ant-design/issues/16376
|
|
registerValue,
|
|
cancelValue
|
|
};
|
|
const classString = classnames_default()(groupPrefixCls, {
|
|
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
|
|
}, className, rootClassName, hashId);
|
|
return wrapSSR( /*#__PURE__*/react.createElement("div", Object.assign({
|
|
className: classString,
|
|
style: style
|
|
}, domProps, {
|
|
ref: ref
|
|
}), /*#__PURE__*/react.createElement(checkbox_GroupContext.Provider, {
|
|
value: context
|
|
}, childrenNode)));
|
|
};
|
|
|
|
const CheckboxGroup = /*#__PURE__*/react.forwardRef(InternalGroup);
|
|
/* harmony default export */ var Group = (/*#__PURE__*/react.memo(CheckboxGroup));
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/checkbox/index.js
|
|
'use client';
|
|
|
|
|
|
|
|
const es_checkbox_Checkbox = checkbox_Checkbox;
|
|
es_checkbox_Checkbox.Group = Group;
|
|
es_checkbox_Checkbox.__ANT_CHECKBOX = true;
|
|
if (false) {}
|
|
/* harmony default export */ var es_checkbox = (es_checkbox_Checkbox);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 63185:
|
|
/*!******************************************************!*\
|
|
!*** ./node_modules/antd/es/checkbox/style/index.js ***!
|
|
\******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ "C2": function() { return /* binding */ getStyle; }
|
|
/* harmony export */ });
|
|
/* unused harmony export genCheckboxStyle */
|
|
/* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ 68024);
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style */ 14747);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ 45503);
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/internal */ 67968);
|
|
|
|
|
|
|
|
// ============================== Motion ==============================
|
|
const antCheckboxEffect = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antCheckboxEffect', {
|
|
'0%': {
|
|
transform: 'scale(1)',
|
|
opacity: 0.5
|
|
},
|
|
'100%': {
|
|
transform: 'scale(1.6)',
|
|
opacity: 0
|
|
}
|
|
});
|
|
// ============================== Styles ==============================
|
|
const genCheckboxStyle = token => {
|
|
const {
|
|
checkboxCls
|
|
} = token;
|
|
const wrapperCls = `${checkboxCls}-wrapper`;
|
|
return [
|
|
// ===================== Basic =====================
|
|
{
|
|
// Group
|
|
[`${checkboxCls}-group`]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__/* .resetComponent */ .Wf)(token)), {
|
|
display: 'inline-flex',
|
|
flexWrap: 'wrap',
|
|
columnGap: token.marginXS,
|
|
// Group > Grid
|
|
[`> ${token.antCls}-row`]: {
|
|
flex: 1
|
|
}
|
|
}),
|
|
// Wrapper
|
|
[wrapperCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__/* .resetComponent */ .Wf)(token)), {
|
|
display: 'inline-flex',
|
|
alignItems: 'baseline',
|
|
cursor: 'pointer',
|
|
// Fix checkbox & radio in flex align #30260
|
|
'&:after': {
|
|
display: 'inline-block',
|
|
width: 0,
|
|
overflow: 'hidden',
|
|
content: "'\\a0'"
|
|
},
|
|
// Checkbox near checkbox
|
|
[`& + ${wrapperCls}`]: {
|
|
marginInlineStart: 0
|
|
},
|
|
[`&${wrapperCls}-in-form-item`]: {
|
|
'input[type="checkbox"]': {
|
|
width: 14,
|
|
height: 14 // FIXME: magic
|
|
}
|
|
}
|
|
}),
|
|
|
|
// Wrapper > Checkbox
|
|
[checkboxCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__/* .resetComponent */ .Wf)(token)), {
|
|
position: 'relative',
|
|
whiteSpace: 'nowrap',
|
|
lineHeight: 1,
|
|
cursor: 'pointer',
|
|
// To make alignment right when `controlHeight` is changed
|
|
// Ref: https://github.com/ant-design/ant-design/issues/41564
|
|
alignSelf: 'center',
|
|
// Wrapper > Checkbox > input
|
|
[`${checkboxCls}-input`]: {
|
|
position: 'absolute',
|
|
// Since baseline align will get additional space offset,
|
|
// we need to move input to top to make it align with text.
|
|
// Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
|
|
inset: 0,
|
|
zIndex: 1,
|
|
cursor: 'pointer',
|
|
opacity: 0,
|
|
margin: 0,
|
|
[`&:focus-visible + ${checkboxCls}-inner`]: Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_1__/* .genFocusOutline */ .oN)(token))
|
|
},
|
|
// Wrapper > Checkbox > inner
|
|
[`${checkboxCls}-inner`]: {
|
|
boxSizing: 'border-box',
|
|
position: 'relative',
|
|
top: 0,
|
|
insetInlineStart: 0,
|
|
display: 'block',
|
|
width: token.checkboxSize,
|
|
height: token.checkboxSize,
|
|
direction: 'ltr',
|
|
backgroundColor: token.colorBgContainer,
|
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
|
|
borderRadius: token.borderRadiusSM,
|
|
borderCollapse: 'separate',
|
|
transition: `all ${token.motionDurationSlow}`,
|
|
'&:after': {
|
|
boxSizing: 'border-box',
|
|
position: 'absolute',
|
|
top: '50%',
|
|
insetInlineStart: '21.5%',
|
|
display: 'table',
|
|
width: token.checkboxSize / 14 * 5,
|
|
height: token.checkboxSize / 14 * 8,
|
|
border: `${token.lineWidthBold}px solid ${token.colorWhite}`,
|
|
borderTop: 0,
|
|
borderInlineStart: 0,
|
|
transform: 'rotate(45deg) scale(0) translate(-50%,-50%)',
|
|
opacity: 0,
|
|
content: '""',
|
|
transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`
|
|
}
|
|
},
|
|
// Wrapper > Checkbox + Text
|
|
'& + span': {
|
|
paddingInlineStart: token.paddingXS,
|
|
paddingInlineEnd: token.paddingXS
|
|
}
|
|
})
|
|
},
|
|
// ===================== Hover =====================
|
|
{
|
|
// Wrapper
|
|
[`${wrapperCls}:hover ${checkboxCls}:after`]: {
|
|
visibility: 'visible'
|
|
},
|
|
// Wrapper & Wrapper > Checkbox
|
|
[`
|
|
${wrapperCls}:not(${wrapperCls}-disabled),
|
|
${checkboxCls}:not(${checkboxCls}-disabled)
|
|
`]: {
|
|
[`&:hover ${checkboxCls}-inner`]: {
|
|
borderColor: token.colorPrimary
|
|
}
|
|
},
|
|
[`${wrapperCls}:not(${wrapperCls}-disabled)`]: {
|
|
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled) ${checkboxCls}-inner`]: {
|
|
backgroundColor: token.colorPrimaryHover,
|
|
borderColor: 'transparent'
|
|
},
|
|
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled):after`]: {
|
|
borderColor: token.colorPrimaryHover
|
|
}
|
|
}
|
|
},
|
|
// ==================== Checked ====================
|
|
{
|
|
// Wrapper > Checkbox
|
|
[`${checkboxCls}-checked`]: {
|
|
[`${checkboxCls}-inner`]: {
|
|
backgroundColor: token.colorPrimary,
|
|
borderColor: token.colorPrimary,
|
|
'&:after': {
|
|
opacity: 1,
|
|
transform: 'rotate(45deg) scale(1) translate(-50%,-50%)',
|
|
transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`
|
|
}
|
|
},
|
|
// Checked Effect
|
|
'&:after': {
|
|
position: 'absolute',
|
|
top: 0,
|
|
insetInlineStart: 0,
|
|
width: '100%',
|
|
height: '100%',
|
|
borderRadius: token.borderRadiusSM,
|
|
visibility: 'hidden',
|
|
border: `${token.lineWidthBold}px solid ${token.colorPrimary}`,
|
|
animationName: antCheckboxEffect,
|
|
animationDuration: token.motionDurationSlow,
|
|
animationTimingFunction: 'ease-in-out',
|
|
animationFillMode: 'backwards',
|
|
content: '""',
|
|
transition: `all ${token.motionDurationSlow}`
|
|
}
|
|
},
|
|
[`
|
|
${wrapperCls}-checked:not(${wrapperCls}-disabled),
|
|
${checkboxCls}-checked:not(${checkboxCls}-disabled)
|
|
`]: {
|
|
[`&:hover ${checkboxCls}-inner`]: {
|
|
backgroundColor: token.colorPrimaryHover,
|
|
borderColor: 'transparent'
|
|
},
|
|
[`&:hover ${checkboxCls}:after`]: {
|
|
borderColor: token.colorPrimaryHover
|
|
}
|
|
}
|
|
},
|
|
// ================= Indeterminate =================
|
|
{
|
|
[checkboxCls]: {
|
|
'&-indeterminate': {
|
|
// Wrapper > Checkbox > inner
|
|
[`${checkboxCls}-inner`]: {
|
|
backgroundColor: token.colorBgContainer,
|
|
borderColor: token.colorBorder,
|
|
'&:after': {
|
|
top: '50%',
|
|
insetInlineStart: '50%',
|
|
width: token.fontSizeLG / 2,
|
|
height: token.fontSizeLG / 2,
|
|
backgroundColor: token.colorPrimary,
|
|
border: 0,
|
|
transform: 'translate(-50%, -50%) scale(1)',
|
|
opacity: 1,
|
|
content: '""'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
// ==================== Disable ====================
|
|
{
|
|
// Wrapper
|
|
[`${wrapperCls}-disabled`]: {
|
|
cursor: 'not-allowed'
|
|
},
|
|
// Wrapper > Checkbox
|
|
[`${checkboxCls}-disabled`]: {
|
|
// Wrapper > Checkbox > input
|
|
[`&, ${checkboxCls}-input`]: {
|
|
cursor: 'not-allowed',
|
|
// Disabled for native input to enable Tooltip event handler
|
|
// ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-1365075901
|
|
pointerEvents: 'none'
|
|
},
|
|
// Wrapper > Checkbox > inner
|
|
[`${checkboxCls}-inner`]: {
|
|
background: token.colorBgContainerDisabled,
|
|
borderColor: token.colorBorder,
|
|
'&:after': {
|
|
borderColor: token.colorTextDisabled
|
|
}
|
|
},
|
|
'&:after': {
|
|
display: 'none'
|
|
},
|
|
'& + span': {
|
|
color: token.colorTextDisabled
|
|
},
|
|
[`&${checkboxCls}-indeterminate ${checkboxCls}-inner::after`]: {
|
|
background: token.colorTextDisabled
|
|
}
|
|
}
|
|
}];
|
|
};
|
|
// ============================== Export ==============================
|
|
function getStyle(prefixCls, token) {
|
|
const checkboxToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__/* .merge */ .TS)(token, {
|
|
checkboxCls: `.${prefixCls}`,
|
|
checkboxSize: token.controlInteractiveSize
|
|
});
|
|
return [genCheckboxStyle(checkboxToken)];
|
|
}
|
|
/* harmony default export */ __webpack_exports__["ZP"] = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)('Checkbox', (token, _ref) => {
|
|
let {
|
|
prefixCls
|
|
} = _ref;
|
|
return [getStyle(prefixCls, token)];
|
|
}));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 79531:
|
|
/*!*********************************************************!*\
|
|
!*** ./node_modules/antd/es/input/index.js + 5 modules ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ input; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
|
|
var context = __webpack_require__(53124);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/context.js
|
|
var form_context = __webpack_require__(65223);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js
|
|
var style = __webpack_require__(47673);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/input/Group.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Group = props => {
|
|
const {
|
|
getPrefixCls,
|
|
direction
|
|
} = (0,react.useContext)(context/* ConfigContext */.E_);
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className
|
|
} = props;
|
|
const prefixCls = getPrefixCls('input-group', customizePrefixCls);
|
|
const inputPrefixCls = getPrefixCls('input');
|
|
const [wrapSSR, hashId] = (0,style/* default */.ZP)(inputPrefixCls);
|
|
const cls = classnames_default()(prefixCls, {
|
|
[`${prefixCls}-lg`]: props.size === 'large',
|
|
[`${prefixCls}-sm`]: props.size === 'small',
|
|
[`${prefixCls}-compact`]: props.compact,
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
}, hashId, className);
|
|
const formItemContext = (0,react.useContext)(form_context/* FormItemInputContext */.aM);
|
|
const groupFormItemContext = (0,react.useMemo)(() => Object.assign(Object.assign({}, formItemContext), {
|
|
isFormItemInput: false
|
|
}), [formItemContext]);
|
|
if (false) {}
|
|
return wrapSSR( /*#__PURE__*/react.createElement("span", {
|
|
className: cls,
|
|
style: props.style,
|
|
onMouseEnter: props.onMouseEnter,
|
|
onMouseLeave: props.onMouseLeave,
|
|
onFocus: props.onFocus,
|
|
onBlur: props.onBlur
|
|
}, /*#__PURE__*/react.createElement(form_context/* FormItemInputContext.Provider */.aM.Provider, {
|
|
value: groupFormItemContext
|
|
}, props.children)));
|
|
};
|
|
/* harmony default export */ var input_Group = (Group);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/Input.js + 1 modules
|
|
var Input = __webpack_require__(82586);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/EyeInvisibleOutlined.js
|
|
// This icon file is generated automatically.
|
|
var EyeInvisibleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };
|
|
/* harmony default export */ var asn_EyeInvisibleOutlined = (EyeInvisibleOutlined);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 8 modules
|
|
var AntdIcon = __webpack_require__(74643);
|
|
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/EyeInvisibleOutlined.js
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
var EyeInvisibleOutlined_EyeInvisibleOutlined = function EyeInvisibleOutlined(props, ref) {
|
|
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
ref: ref,
|
|
icon: asn_EyeInvisibleOutlined
|
|
}));
|
|
};
|
|
if (false) {}
|
|
/* harmony default export */ var icons_EyeInvisibleOutlined = (/*#__PURE__*/react.forwardRef(EyeInvisibleOutlined_EyeInvisibleOutlined));
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/EyeOutlined.js + 1 modules
|
|
var EyeOutlined = __webpack_require__(99611);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/omit.js
|
|
var omit = __webpack_require__(10366);
|
|
// EXTERNAL MODULE: ./node_modules/antd/node_modules/rc-util/es/ref.js
|
|
var es_ref = __webpack_require__(17799);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/hooks/useRemovePasswordTimeout.js
|
|
var useRemovePasswordTimeout = __webpack_require__(72922);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/input/Password.js
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const defaultIconRender = visible => visible ? /*#__PURE__*/react.createElement(EyeOutlined/* default */.Z, null) : /*#__PURE__*/react.createElement(icons_EyeInvisibleOutlined, null);
|
|
const ActionMap = {
|
|
click: 'onClick',
|
|
hover: 'onMouseOver'
|
|
};
|
|
const Password = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
const {
|
|
visibilityToggle = true
|
|
} = props;
|
|
const visibilityControlled = typeof visibilityToggle === 'object' && visibilityToggle.visible !== undefined;
|
|
const [visible, setVisible] = (0,react.useState)(() => visibilityControlled ? visibilityToggle.visible : false);
|
|
const inputRef = (0,react.useRef)(null);
|
|
react.useEffect(() => {
|
|
if (visibilityControlled) {
|
|
setVisible(visibilityToggle.visible);
|
|
}
|
|
}, [visibilityControlled, visibilityToggle]);
|
|
// Remove Password value
|
|
const removePasswordTimeout = (0,useRemovePasswordTimeout/* default */.Z)(inputRef);
|
|
const onVisibleChange = () => {
|
|
const {
|
|
disabled
|
|
} = props;
|
|
if (disabled) {
|
|
return;
|
|
}
|
|
if (visible) {
|
|
removePasswordTimeout();
|
|
}
|
|
setVisible(prevState => {
|
|
var _a;
|
|
const newState = !prevState;
|
|
if (typeof visibilityToggle === 'object') {
|
|
(_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, newState);
|
|
}
|
|
return newState;
|
|
});
|
|
};
|
|
const getIcon = prefixCls => {
|
|
const {
|
|
action = 'click',
|
|
iconRender = defaultIconRender
|
|
} = props;
|
|
const iconTrigger = ActionMap[action] || '';
|
|
const icon = iconRender(visible);
|
|
const iconProps = {
|
|
[iconTrigger]: onVisibleChange,
|
|
className: `${prefixCls}-icon`,
|
|
key: 'passwordIcon',
|
|
onMouseDown: e => {
|
|
// Prevent focused state lost
|
|
// https://github.com/ant-design/ant-design/issues/15173
|
|
e.preventDefault();
|
|
},
|
|
onMouseUp: e => {
|
|
// Prevent caret position change
|
|
// https://github.com/ant-design/ant-design/issues/23524
|
|
e.preventDefault();
|
|
}
|
|
};
|
|
return /*#__PURE__*/react.cloneElement( /*#__PURE__*/react.isValidElement(icon) ? icon : /*#__PURE__*/react.createElement("span", null, icon), iconProps);
|
|
};
|
|
const {
|
|
className,
|
|
prefixCls: customizePrefixCls,
|
|
inputPrefixCls: customizeInputPrefixCls,
|
|
size
|
|
} = props,
|
|
restProps = __rest(props, ["className", "prefixCls", "inputPrefixCls", "size"]);
|
|
const {
|
|
getPrefixCls
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
const prefixCls = getPrefixCls('input-password', customizePrefixCls);
|
|
const suffixIcon = visibilityToggle && getIcon(prefixCls);
|
|
const inputClassName = classnames_default()(prefixCls, className, {
|
|
[`${prefixCls}-${size}`]: !!size
|
|
});
|
|
const omittedProps = Object.assign(Object.assign({}, (0,omit/* default */.Z)(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {
|
|
type: visible ? 'text' : 'password',
|
|
className: inputClassName,
|
|
prefixCls: inputPrefixCls,
|
|
suffix: suffixIcon
|
|
});
|
|
if (size) {
|
|
omittedProps.size = size;
|
|
}
|
|
return /*#__PURE__*/react.createElement(Input/* default */.Z, Object.assign({
|
|
ref: (0,es_ref/* composeRef */.sQ)(ref, inputRef)
|
|
}, omittedProps));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var input_Password = (Password);
|
|
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/SearchOutlined.js + 1 modules
|
|
var SearchOutlined = __webpack_require__(68795);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/_util/reactNode.js
|
|
var reactNode = __webpack_require__(96159);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
var es_button = __webpack_require__(71577);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/hooks/useSize.js
|
|
var useSize = __webpack_require__(98675);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/space/Compact.js
|
|
var Compact = __webpack_require__(4173);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/input/Search.js
|
|
var Search_rest = undefined && undefined.__rest || function (s, e) {
|
|
var t = {};
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
}
|
|
return t;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Search = /*#__PURE__*/react.forwardRef((props, ref) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
inputPrefixCls: customizeInputPrefixCls,
|
|
className,
|
|
size: customizeSize,
|
|
suffix,
|
|
enterButton = false,
|
|
addonAfter,
|
|
loading,
|
|
disabled,
|
|
onSearch: customOnSearch,
|
|
onChange: customOnChange,
|
|
onCompositionStart,
|
|
onCompositionEnd
|
|
} = props,
|
|
restProps = Search_rest(props, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"]);
|
|
const {
|
|
getPrefixCls,
|
|
direction
|
|
} = react.useContext(context/* ConfigContext */.E_);
|
|
const composedRef = react.useRef(false);
|
|
const prefixCls = getPrefixCls('input-search', customizePrefixCls);
|
|
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
const {
|
|
compactSize
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
const size = (0,useSize/* default */.Z)(ctx => {
|
|
var _a;
|
|
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
|
|
});
|
|
const inputRef = react.useRef(null);
|
|
const onChange = e => {
|
|
if (e && e.target && e.type === 'click' && customOnSearch) {
|
|
customOnSearch(e.target.value, e);
|
|
}
|
|
if (customOnChange) {
|
|
customOnChange(e);
|
|
}
|
|
};
|
|
const onMouseDown = e => {
|
|
var _a;
|
|
if (document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input)) {
|
|
e.preventDefault();
|
|
}
|
|
};
|
|
const onSearch = e => {
|
|
var _a, _b;
|
|
if (customOnSearch) {
|
|
customOnSearch((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, e);
|
|
}
|
|
};
|
|
const onPressEnter = e => {
|
|
if (composedRef.current || loading) {
|
|
return;
|
|
}
|
|
onSearch(e);
|
|
};
|
|
const searchIcon = typeof enterButton === 'boolean' ? /*#__PURE__*/react.createElement(SearchOutlined/* default */.Z, null) : null;
|
|
const btnClassName = `${prefixCls}-button`;
|
|
let button;
|
|
const enterButtonAsElement = enterButton || {};
|
|
const isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
|
|
if (isAntdButton || enterButtonAsElement.type === 'button') {
|
|
button = (0,reactNode/* cloneElement */.Tm)(enterButtonAsElement, Object.assign({
|
|
onMouseDown,
|
|
onClick: e => {
|
|
var _a, _b;
|
|
(_b = (_a = enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : enterButtonAsElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
onSearch(e);
|
|
},
|
|
key: 'enterButton'
|
|
}, isAntdButton ? {
|
|
className: btnClassName,
|
|
size
|
|
} : {}));
|
|
} else {
|
|
button = /*#__PURE__*/react.createElement(es_button/* default */.ZP, {
|
|
className: btnClassName,
|
|
type: enterButton ? 'primary' : undefined,
|
|
size: size,
|
|
disabled: disabled,
|
|
key: "enterButton",
|
|
onMouseDown: onMouseDown,
|
|
onClick: onSearch,
|
|
loading: loading,
|
|
icon: searchIcon
|
|
}, enterButton);
|
|
}
|
|
if (addonAfter) {
|
|
button = [button, (0,reactNode/* cloneElement */.Tm)(addonAfter, {
|
|
key: 'addonAfter'
|
|
})];
|
|
}
|
|
const cls = classnames_default()(prefixCls, {
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
[`${prefixCls}-${size}`]: !!size,
|
|
[`${prefixCls}-with-button`]: !!enterButton
|
|
}, className);
|
|
const handleOnCompositionStart = e => {
|
|
composedRef.current = true;
|
|
onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
|
|
};
|
|
const handleOnCompositionEnd = e => {
|
|
composedRef.current = false;
|
|
onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
|
|
};
|
|
return /*#__PURE__*/react.createElement(Input/* default */.Z, Object.assign({
|
|
ref: (0,es_ref/* composeRef */.sQ)(inputRef, ref),
|
|
onPressEnter: onPressEnter
|
|
}, restProps, {
|
|
size: size,
|
|
onCompositionStart: handleOnCompositionStart,
|
|
onCompositionEnd: handleOnCompositionEnd,
|
|
prefixCls: inputPrefixCls,
|
|
addonAfter: button,
|
|
suffix: suffix,
|
|
onChange: onChange,
|
|
className: cls,
|
|
disabled: disabled
|
|
}));
|
|
});
|
|
if (false) {}
|
|
/* harmony default export */ var input_Search = (Search);
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/TextArea.js
|
|
var TextArea = __webpack_require__(96330);
|
|
;// CONCATENATED MODULE: ./node_modules/antd/es/input/index.js
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const input_Input = Input/* default */.Z;
|
|
if (false) {}
|
|
input_Input.Group = input_Group;
|
|
input_Input.Search = input_Search;
|
|
input_Input.TextArea = TextArea/* default */.Z;
|
|
input_Input.Password = input_Password;
|
|
/* harmony default export */ var input = (input_Input);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 33507:
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/antd/es/style/motion/collapse.js ***!
|
|
\*******************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
"use strict";
|
|
const genCollapseMotion = token => ({
|
|
[token.componentCls]: {
|
|
// For common/openAnimation
|
|
[`${token.antCls}-motion-collapse-legacy`]: {
|
|
overflow: 'hidden',
|
|
'&-active': {
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
}
|
|
},
|
|
[`${token.antCls}-motion-collapse`]: {
|
|
overflow: 'hidden',
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
}
|
|
}
|
|
});
|
|
/* harmony default export */ __webpack_exports__["Z"] = (genCollapseMotion);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 95860:
|
|
/*!**********************************************************!*\
|
|
!*** ./node_modules/rc-checkbox/es/index.js + 5 modules ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": function() { return /* binding */ es; }
|
|
});
|
|
|
|
// UNUSED EXPORTS: Checkbox
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
|
var esm_extends = __webpack_require__(87462);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(1413);
|
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
var defineProperty = __webpack_require__(4942);
|
|
// 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/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(45987);
|
|
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
var classnames = __webpack_require__(94184);
|
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
// EXTERNAL MODULE: ./node_modules/react/index.js
|
|
var react = __webpack_require__(67294);
|
|
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/hooks/useEvent.js
|
|
|
|
function useEvent(callback) {
|
|
var fnRef = react.useRef();
|
|
fnRef.current = callback;
|
|
var memoFn = react.useCallback(function () {
|
|
var _fnRef$current;
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
return (_fnRef$current = fnRef.current) === null || _fnRef$current === void 0 ? void 0 : _fnRef$current.call.apply(_fnRef$current, [fnRef].concat(args));
|
|
}, []);
|
|
return memoFn;
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/Dom/canUseDom.js
|
|
function canUseDom() {
|
|
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/hooks/useLayoutEffect.js
|
|
|
|
|
|
|
|
/**
|
|
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
*/
|
|
var useInternalLayoutEffect = true && canUseDom() ? react.useLayoutEffect : react.useEffect;
|
|
var useLayoutEffect = function useLayoutEffect(callback, deps) {
|
|
var firstMountRef = react.useRef(true);
|
|
useInternalLayoutEffect(function () {
|
|
return callback(firstMountRef.current);
|
|
}, deps);
|
|
|
|
// We tell react that first mount has passed
|
|
useInternalLayoutEffect(function () {
|
|
firstMountRef.current = false;
|
|
return function () {
|
|
firstMountRef.current = true;
|
|
};
|
|
}, []);
|
|
};
|
|
var useLayoutUpdateEffect = function useLayoutUpdateEffect(callback, deps) {
|
|
useLayoutEffect(function (firstMount) {
|
|
if (!firstMount) {
|
|
return callback();
|
|
}
|
|
}, deps);
|
|
};
|
|
/* harmony default export */ var hooks_useLayoutEffect = ((/* unused pure expression or super */ null && (useLayoutEffect)));
|
|
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/hooks/useState.js
|
|
|
|
|
|
/**
|
|
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
|
|
* We do not make this auto is to avoid real memory leak.
|
|
* Developer should confirm it's safe to ignore themselves.
|
|
*/
|
|
function useSafeState(defaultValue) {
|
|
var destroyRef = react.useRef(false);
|
|
var _React$useState = react.useState(defaultValue),
|
|
_React$useState2 = (0,slicedToArray/* default */.Z)(_React$useState, 2),
|
|
value = _React$useState2[0],
|
|
setValue = _React$useState2[1];
|
|
react.useEffect(function () {
|
|
destroyRef.current = false;
|
|
return function () {
|
|
destroyRef.current = true;
|
|
};
|
|
}, []);
|
|
function safeSetState(updater, ignoreDestroy) {
|
|
if (ignoreDestroy && destroyRef.current) {
|
|
return;
|
|
}
|
|
setValue(updater);
|
|
}
|
|
return [value, safeSetState];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/node_modules/rc-util/es/hooks/useMergedState.js
|
|
|
|
|
|
|
|
|
|
/** We only think `undefined` is empty */
|
|
function hasValue(value) {
|
|
return value !== undefined;
|
|
}
|
|
|
|
/**
|
|
* Similar to `useState` but will use props value if provided.
|
|
* Note that internal use rc-util `useState` hook.
|
|
*/
|
|
function useMergedState(defaultStateValue, option) {
|
|
var _ref = option || {},
|
|
defaultValue = _ref.defaultValue,
|
|
value = _ref.value,
|
|
onChange = _ref.onChange,
|
|
postState = _ref.postState;
|
|
|
|
// ======================= Init =======================
|
|
var _useState = useSafeState(function () {
|
|
if (hasValue(value)) {
|
|
return value;
|
|
} else if (hasValue(defaultValue)) {
|
|
return typeof defaultValue === 'function' ? defaultValue() : defaultValue;
|
|
} else {
|
|
return typeof defaultStateValue === 'function' ? defaultStateValue() : defaultStateValue;
|
|
}
|
|
}),
|
|
_useState2 = (0,slicedToArray/* default */.Z)(_useState, 2),
|
|
innerValue = _useState2[0],
|
|
setInnerValue = _useState2[1];
|
|
var mergedValue = value !== undefined ? value : innerValue;
|
|
var postMergedValue = postState ? postState(mergedValue) : mergedValue;
|
|
|
|
// ====================== Change ======================
|
|
var onChangeFn = useEvent(onChange);
|
|
var _useState3 = useSafeState([mergedValue]),
|
|
_useState4 = (0,slicedToArray/* default */.Z)(_useState3, 2),
|
|
prevValue = _useState4[0],
|
|
setPrevValue = _useState4[1];
|
|
useLayoutUpdateEffect(function () {
|
|
var prev = prevValue[0];
|
|
if (innerValue !== prev) {
|
|
onChangeFn(innerValue, prev);
|
|
}
|
|
}, [prevValue]);
|
|
|
|
// Sync value back to `undefined` when it from control to un-control
|
|
useLayoutUpdateEffect(function () {
|
|
if (!hasValue(value)) {
|
|
setInnerValue(value);
|
|
}
|
|
}, [value]);
|
|
|
|
// ====================== Update ======================
|
|
var triggerChange = useEvent(function (updater, ignoreDestroy) {
|
|
setInnerValue(updater, ignoreDestroy);
|
|
setPrevValue([mergedValue], ignoreDestroy);
|
|
});
|
|
return [postMergedValue, triggerChange];
|
|
}
|
|
;// CONCATENATED MODULE: ./node_modules/rc-checkbox/es/index.js
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"];
|
|
|
|
|
|
|
|
|
|
var Checkbox = /*#__PURE__*/(0,react.forwardRef)(function (props, ref) {
|
|
var _classNames;
|
|
var _props$prefixCls = props.prefixCls,
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-checkbox' : _props$prefixCls,
|
|
className = props.className,
|
|
style = props.style,
|
|
checked = props.checked,
|
|
disabled = props.disabled,
|
|
_props$defaultChecked = props.defaultChecked,
|
|
defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,
|
|
_props$type = props.type,
|
|
type = _props$type === void 0 ? 'checkbox' : _props$type,
|
|
title = props.title,
|
|
onChange = props.onChange,
|
|
inputProps = (0,objectWithoutProperties/* default */.Z)(props, _excluded);
|
|
var inputRef = (0,react.useRef)(null);
|
|
var _useMergedState = useMergedState(defaultChecked, {
|
|
value: checked
|
|
}),
|
|
_useMergedState2 = (0,slicedToArray/* default */.Z)(_useMergedState, 2),
|
|
rawValue = _useMergedState2[0],
|
|
setRawValue = _useMergedState2[1];
|
|
(0,react.useImperativeHandle)(ref, function () {
|
|
return {
|
|
focus: function focus() {
|
|
var _inputRef$current;
|
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
},
|
|
blur: function blur() {
|
|
var _inputRef$current2;
|
|
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
|
|
},
|
|
input: inputRef.current
|
|
};
|
|
});
|
|
var classString = classnames_default()(prefixCls, className, (_classNames = {}, (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-checked"), rawValue), (0,defineProperty/* default */.Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
|
|
var handleChange = function handleChange(e) {
|
|
if (disabled) {
|
|
return;
|
|
}
|
|
if (!('checked' in props)) {
|
|
setRawValue(e.target.checked);
|
|
}
|
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
target: (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
|
|
type: type,
|
|
checked: e.target.checked
|
|
}),
|
|
stopPropagation: function stopPropagation() {
|
|
e.stopPropagation();
|
|
},
|
|
preventDefault: function preventDefault() {
|
|
e.preventDefault();
|
|
},
|
|
nativeEvent: e.nativeEvent
|
|
});
|
|
};
|
|
return /*#__PURE__*/react.createElement("span", {
|
|
className: classString,
|
|
title: title,
|
|
style: style
|
|
}, /*#__PURE__*/react.createElement("input", (0,esm_extends/* default */.Z)({}, inputProps, {
|
|
className: "".concat(prefixCls, "-input"),
|
|
ref: inputRef,
|
|
onChange: handleChange,
|
|
disabled: disabled,
|
|
checked: !!rawValue,
|
|
type: type
|
|
})), /*#__PURE__*/react.createElement("span", {
|
|
className: "".concat(prefixCls, "-inner")
|
|
}));
|
|
});
|
|
/* harmony default export */ var es = (Checkbox);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 57761:
|
|
/*!*********************************************************************!*\
|
|
!*** ./node_modules/react-infinite-scroller/dist/InfiniteScroll.js ***!
|
|
\*********************************************************************/
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({
|
|
value: true
|
|
}));
|
|
|
|
var _createClass = 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _react = __webpack_require__(/*! react */ 67294);
|
|
|
|
var _react2 = _interopRequireDefault(_react);
|
|
|
|
var _propTypes = __webpack_require__(/*! prop-types */ 45697);
|
|
|
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
|
var InfiniteScroll = function (_Component) {
|
|
_inherits(InfiniteScroll, _Component);
|
|
|
|
function InfiniteScroll(props) {
|
|
_classCallCheck(this, InfiniteScroll);
|
|
|
|
var _this = _possibleConstructorReturn(this, (InfiniteScroll.__proto__ || Object.getPrototypeOf(InfiniteScroll)).call(this, props));
|
|
|
|
_this.scrollListener = _this.scrollListener.bind(_this);
|
|
_this.eventListenerOptions = _this.eventListenerOptions.bind(_this);
|
|
_this.mousewheelListener = _this.mousewheelListener.bind(_this);
|
|
return _this;
|
|
}
|
|
|
|
_createClass(InfiniteScroll, [{
|
|
key: 'componentDidMount',
|
|
value: function componentDidMount() {
|
|
this.pageLoaded = this.props.pageStart;
|
|
this.options = this.eventListenerOptions();
|
|
this.attachScrollListener();
|
|
}
|
|
}, {
|
|
key: 'componentDidUpdate',
|
|
value: function componentDidUpdate() {
|
|
if (this.props.isReverse && this.loadMore) {
|
|
var parentElement = this.getParentElement(this.scrollComponent);
|
|
parentElement.scrollTop = parentElement.scrollHeight - this.beforeScrollHeight + this.beforeScrollTop;
|
|
this.loadMore = false;
|
|
}
|
|
this.attachScrollListener();
|
|
}
|
|
}, {
|
|
key: 'componentWillUnmount',
|
|
value: function componentWillUnmount() {
|
|
this.detachScrollListener();
|
|
this.detachMousewheelListener();
|
|
}
|
|
}, {
|
|
key: 'isPassiveSupported',
|
|
value: function isPassiveSupported() {
|
|
var passive = false;
|
|
|
|
var testOptions = {
|
|
get passive() {
|
|
passive = true;
|
|
}
|
|
};
|
|
|
|
try {
|
|
document.addEventListener('test', null, testOptions);
|
|
document.removeEventListener('test', null, testOptions);
|
|
} catch (e) {
|
|
// ignore
|
|
}
|
|
return passive;
|
|
}
|
|
}, {
|
|
key: 'eventListenerOptions',
|
|
value: function eventListenerOptions() {
|
|
var options = this.props.useCapture;
|
|
|
|
if (this.isPassiveSupported()) {
|
|
options = {
|
|
useCapture: this.props.useCapture,
|
|
passive: true
|
|
};
|
|
}
|
|
return options;
|
|
}
|
|
|
|
// Set a defaut loader for all your `InfiniteScroll` components
|
|
|
|
}, {
|
|
key: 'setDefaultLoader',
|
|
value: function setDefaultLoader(loader) {
|
|
this.defaultLoader = loader;
|
|
}
|
|
}, {
|
|
key: 'detachMousewheelListener',
|
|
value: function detachMousewheelListener() {
|
|
var scrollEl = window;
|
|
if (this.props.useWindow === false) {
|
|
scrollEl = this.scrollComponent.parentNode;
|
|
}
|
|
|
|
scrollEl.removeEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
|
}
|
|
}, {
|
|
key: 'detachScrollListener',
|
|
value: function detachScrollListener() {
|
|
var scrollEl = window;
|
|
if (this.props.useWindow === false) {
|
|
scrollEl = this.getParentElement(this.scrollComponent);
|
|
}
|
|
|
|
scrollEl.removeEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
scrollEl.removeEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
}
|
|
}, {
|
|
key: 'getParentElement',
|
|
value: function getParentElement(el) {
|
|
var scrollParent = this.props.getScrollParent && this.props.getScrollParent();
|
|
if (scrollParent != null) {
|
|
return scrollParent;
|
|
}
|
|
return el && el.parentNode;
|
|
}
|
|
}, {
|
|
key: 'filterProps',
|
|
value: function filterProps(props) {
|
|
return props;
|
|
}
|
|
}, {
|
|
key: 'attachScrollListener',
|
|
value: function attachScrollListener() {
|
|
var parentElement = this.getParentElement(this.scrollComponent);
|
|
|
|
if (!this.props.hasMore || !parentElement) {
|
|
return;
|
|
}
|
|
|
|
var scrollEl = window;
|
|
if (this.props.useWindow === false) {
|
|
scrollEl = parentElement;
|
|
}
|
|
|
|
scrollEl.addEventListener('mousewheel', this.mousewheelListener, this.options ? this.options : this.props.useCapture);
|
|
scrollEl.addEventListener('scroll', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
scrollEl.addEventListener('resize', this.scrollListener, this.options ? this.options : this.props.useCapture);
|
|
|
|
if (this.props.initialLoad) {
|
|
this.scrollListener();
|
|
}
|
|
}
|
|
}, {
|
|
key: 'mousewheelListener',
|
|
value: function mousewheelListener(e) {
|
|
// Prevents Chrome hangups
|
|
// See: https://stackoverflow.com/questions/47524205/random-high-content-download-time-in-chrome/47684257#47684257
|
|
if (e.deltaY === 1 && !this.isPassiveSupported()) {
|
|
e.preventDefault();
|
|
}
|
|
}
|
|
}, {
|
|
key: 'scrollListener',
|
|
value: function scrollListener() {
|
|
var el = this.scrollComponent;
|
|
var scrollEl = window;
|
|
var parentNode = this.getParentElement(el);
|
|
|
|
var offset = void 0;
|
|
if (this.props.useWindow) {
|
|
var doc = document.documentElement || document.body.parentNode || document.body;
|
|
var scrollTop = scrollEl.pageYOffset !== undefined ? scrollEl.pageYOffset : doc.scrollTop;
|
|
if (this.props.isReverse) {
|
|
offset = scrollTop;
|
|
} else {
|
|
offset = this.calculateOffset(el, scrollTop);
|
|
}
|
|
} else if (this.props.isReverse) {
|
|
offset = parentNode.scrollTop;
|
|
} else {
|
|
offset = el.scrollHeight - parentNode.scrollTop - parentNode.clientHeight;
|
|
}
|
|
|
|
// Here we make sure the element is visible as well as checking the offset
|
|
if (offset < Number(this.props.threshold) && el && el.offsetParent !== null) {
|
|
this.detachScrollListener();
|
|
this.beforeScrollHeight = parentNode.scrollHeight;
|
|
this.beforeScrollTop = parentNode.scrollTop;
|
|
// Call loadMore after detachScrollListener to allow for non-async loadMore functions
|
|
if (typeof this.props.loadMore === 'function') {
|
|
this.props.loadMore(this.pageLoaded += 1);
|
|
this.loadMore = true;
|
|
}
|
|
}
|
|
}
|
|
}, {
|
|
key: 'calculateOffset',
|
|
value: function calculateOffset(el, scrollTop) {
|
|
if (!el) {
|
|
return 0;
|
|
}
|
|
|
|
return this.calculateTopPosition(el) + (el.offsetHeight - scrollTop - window.innerHeight);
|
|
}
|
|
}, {
|
|
key: 'calculateTopPosition',
|
|
value: function calculateTopPosition(el) {
|
|
if (!el) {
|
|
return 0;
|
|
}
|
|
return el.offsetTop + this.calculateTopPosition(el.offsetParent);
|
|
}
|
|
}, {
|
|
key: 'render',
|
|
value: function render() {
|
|
var _this2 = this;
|
|
|
|
var renderProps = this.filterProps(this.props);
|
|
|
|
var children = renderProps.children,
|
|
element = renderProps.element,
|
|
hasMore = renderProps.hasMore,
|
|
initialLoad = renderProps.initialLoad,
|
|
isReverse = renderProps.isReverse,
|
|
loader = renderProps.loader,
|
|
loadMore = renderProps.loadMore,
|
|
pageStart = renderProps.pageStart,
|
|
ref = renderProps.ref,
|
|
threshold = renderProps.threshold,
|
|
useCapture = renderProps.useCapture,
|
|
useWindow = renderProps.useWindow,
|
|
getScrollParent = renderProps.getScrollParent,
|
|
props = _objectWithoutProperties(renderProps, ['children', 'element', 'hasMore', 'initialLoad', 'isReverse', 'loader', 'loadMore', 'pageStart', 'ref', 'threshold', 'useCapture', 'useWindow', 'getScrollParent']);
|
|
|
|
props.ref = function (node) {
|
|
_this2.scrollComponent = node;
|
|
if (ref) {
|
|
ref(node);
|
|
}
|
|
};
|
|
|
|
var childrenArray = [children];
|
|
if (hasMore) {
|
|
if (loader) {
|
|
isReverse ? childrenArray.unshift(loader) : childrenArray.push(loader);
|
|
} else if (this.defaultLoader) {
|
|
isReverse ? childrenArray.unshift(this.defaultLoader) : childrenArray.push(this.defaultLoader);
|
|
}
|
|
}
|
|
return _react2.default.createElement(element, props, childrenArray);
|
|
}
|
|
}]);
|
|
|
|
return InfiniteScroll;
|
|
}(_react.Component);
|
|
|
|
InfiniteScroll.propTypes = {
|
|
children: _propTypes2.default.node.isRequired,
|
|
element: _propTypes2.default.node,
|
|
hasMore: _propTypes2.default.bool,
|
|
initialLoad: _propTypes2.default.bool,
|
|
isReverse: _propTypes2.default.bool,
|
|
loader: _propTypes2.default.node,
|
|
loadMore: _propTypes2.default.func.isRequired,
|
|
pageStart: _propTypes2.default.number,
|
|
ref: _propTypes2.default.func,
|
|
getScrollParent: _propTypes2.default.func,
|
|
threshold: _propTypes2.default.number,
|
|
useCapture: _propTypes2.default.bool,
|
|
useWindow: _propTypes2.default.bool
|
|
};
|
|
InfiniteScroll.defaultProps = {
|
|
element: 'div',
|
|
hasMore: false,
|
|
initialLoad: true,
|
|
pageStart: 0,
|
|
ref: null,
|
|
threshold: 250,
|
|
useWindow: true,
|
|
isReverse: false,
|
|
useCapture: false,
|
|
loader: null,
|
|
getScrollParent: null
|
|
};
|
|
exports["default"] = InfiniteScroll;
|
|
module.exports = exports['default'];
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 246:
|
|
/*!*******************************************************!*\
|
|
!*** ./node_modules/react-infinite-scroller/index.js ***!
|
|
\*******************************************************/
|
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
|
|
module.exports = __webpack_require__(/*! ./dist/InfiniteScroll */ 57761)
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |