var _excluded = ["children", "className", "style", "size", "type", "formItemGroup", "title", "visible", "formPrefix", "formPostfix", "initialValues", "hideRequiredMark", "bodyStyle", "footer", "footerButtonGroup", "hideFooter", "getFormFields", "fieldStatus", "formLayout", "tabsConfig", "stepsConfig", "displayLayout", "dragAble"],
  _excluded2 = ["name", "type", "icon", "ghost", "disabled", "loading", "fn"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
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; }
/* eslint-disable */
import React, { useEffect, useMemo, useState } from 'react';
import { Form, Modal, Button, Row, Col } from 'antd';
import { general } from "../data";
import RenderItemGroup from "../FormComp/RenderItemGroup";
import { UtilValueFormat } from "../utils";
import IconNode from "../components/IconNode";
import TabForm from "../StandardForm/TabForm";
import StepForm from "../StandardForm/StepForm";
// @ts-ignore
import ActionList from "../StandardForm/ActionList";
import "./style/index.less";
// import { DraggableModal, DraggableModalProvider } from '../StandardDragModal/index'
import StandardDragModal from "../StandardDragModal/Modal";
import "../StandardDragModal/index.less";
var StandardModal = function StandardModal(props) {
  var children = props.children,
    className = props.className,
    style = props.style,
    _props$size = props.size,
    size = _props$size === void 0 ? 'md' : _props$size,
    type = props.type,
    formItemGroup = props.formItemGroup,
    title = props.title,
    visible = props.visible,
    formPrefix = props.formPrefix,
    formPostfix = props.formPostfix,
    initialValues = props.initialValues,
    hideRequiredMark = props.hideRequiredMark,
    bodyStyle = props.bodyStyle,
    footer = props.footer,
    footerButtonGroup = props.footerButtonGroup,
    hideFooter = props.hideFooter,
    _getFormFields = props.getFormFields,
    _props$fieldStatus = props.fieldStatus,
    fieldStatus = _props$fieldStatus === void 0 ? 'default' : _props$fieldStatus,
    _props$formLayout = props.formLayout,
    formLayout = _props$formLayout === void 0 ? 'horizontal' : _props$formLayout,
    tabsConfig = props.tabsConfig,
    stepsConfig = props.stepsConfig,
    displayLayout = props.displayLayout,
    _props$dragAble = props.dragAble,
    dragAble = _props$dragAble === void 0 ? false : _props$dragAble,
    otherProps = _objectWithoutProperties(props, _excluded);
  var _Form$useForm = Form.useForm(),
    _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
    modalForm = _Form$useForm2[0];
  var _useState = useState(),
    _useState2 = _slicedToArray(_useState, 2),
    modalFormRef = _useState2[0],
    setModalFormRef = _useState2[1]; // <---- set the ref when Form Rendered
  var _useState3 = useState(0),
    _useState4 = _slicedToArray(_useState3, 2),
    bodyMaxHeight = _useState4[0],
    setBodyMaxHeight = _useState4[1];

  // setTabFormChild
  var _useState5 = useState(),
    _useState6 = _slicedToArray(_useState5, 2),
    formChild = _useState6[0],
    setFormChild = _useState6[1]; // <---- set the ref when Form Rendered

  // 按钮栏是否有显示（默认显示）
  var hasFooterBar = useMemo(function () {
    var openLog = false;
    if (type === 'tabForm' || type === 'stepForm') {
      if (type === 'tabForm') {
        var _activeTabInfo$action, _activeTabInfo$action2;
        var activeTabInfo = (formItemGroup || []).find(function (fItem) {
          return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
        });
        openLog && console.log('rule 0-1', (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action = activeTabInfo.actions) === null || _activeTabInfo$action === void 0 ? void 0 : _activeTabInfo$action.length) > 0);
        return (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action2 = activeTabInfo.actions) === null || _activeTabInfo$action2 === void 0 ? void 0 : _activeTabInfo$action2.length) > 0;
      }
      if (type === 'stepForm') {
        var _currentStepInfo$acti, _currentStepInfo$acti2;
        var currentStepInfo = (formItemGroup || [])[stepsConfig.current];
        openLog && console.log('rule 0-2', (currentStepInfo === null || currentStepInfo === void 0 || (_currentStepInfo$acti = currentStepInfo.actions) === null || _currentStepInfo$acti === void 0 ? void 0 : _currentStepInfo$acti.length) > 0);
        return (currentStepInfo === null || currentStepInfo === void 0 || (_currentStepInfo$acti2 = currentStepInfo.actions) === null || _currentStepInfo$acti2 === void 0 ? void 0 : _currentStepInfo$acti2.length) > 0;
      }
      return true;
    } else {
      if (hideFooter) {
        openLog && console.log('rule 1');
        return false;
      }
      if (fieldStatus && fieldStatus !== 'default') {
        if (props.hasOwnProperty('footerButtonGroup')) {
          // 如果有配置按钮组件，则还是要显示按钮
          return true;
        }
        openLog && console.log('rule 2');
        // disabled/viewOnly都不显示按钮
        return false;
      }
      if (props.hasOwnProperty('footerButtonGroup') && footerButtonGroup) {
        var _footerButtonGroup;
        if (Array.isArray(footerButtonGroup) && footerButtonGroup.length === 0) {
          openLog && console.log('rule 4');
          // 返回为空数组不占用按钮栏
          return false;
        } else if (typeof footerButtonGroup === 'function' && (!footerButtonGroup() || ((_footerButtonGroup = footerButtonGroup()) === null || _footerButtonGroup === void 0 ? void 0 : _footerButtonGroup.length) === 0)) {
          openLog && console.log('rule 5');
          // 配置类型为Function且返回值为null或者返回数组长度为0时，不显示按钮栏
          return false;
        }
        openLog && console.log('rule 3');
        return true;
      } else if (footerButtonGroup === false) {
        openLog && console.log('rule 7');
        // 显示
        return true;
      }
      if (props.hasOwnProperty('footer') && !footer) {
        openLog && console.log('rule 8');
        return false;
      }
      openLog && console.log('rule 9');
      return true;
    }
  }, [fieldStatus, hideFooter, footer, footerButtonGroup, type, tabsConfig, stepsConfig, formItemGroup]);
  // 设置限制弹窗高度
  var initBodyMaxHeight = function initBodyMaxHeight() {
    var title = props.title;
    var bodyHeight = document.body.offsetHeight;
    var baseReduce = 80 + 32; // 默认需要减去的高度（上下空白间距150及内部内容间距16*2
    // console.log('弹窗是否有按钮：', hasFooterBar ? '是' : '否')
    setBodyMaxHeight("".concat(bodyHeight - (title ? 55 : 0) - (hasFooterBar ? 55 : 0) - baseReduce, "px"));
    // setBodyMaxHeight(`${bodyHeight - (title ? 55 : 0) - ((footer || footerButtonGroup) ? 55 : 0) - baseReduce +
    // ((fieldStatus && fieldStatus !== 'default' && !footerButtonGroup) || hideFooter ? 55 : 0)}px`)
  };
  // fill Form when modal open 此处可解决获取  Form.useForm  warning
  useEffect(function () {
    if (visible && modalFormRef) {
      // <---- check ref before use the form instance
      if (initialValues && _typeof(initialValues) === 'object') {
        initialValues && modalForm.setFieldsValue(_objectSpread({}, initialValues));
        forceUpdateForm();
      }
    }
    // if (!visible && modalFormRef) {
    //   clearAllFieldsValue() // 清空表单传参数
    // }
  }, [modalFormRef, visible]);
  useEffect(function () {
    if (visible) {
      initBodyMaxHeight();
      // 让resize事件触发 initBodyMaxHeight
      window.addEventListener('resize', initBodyMaxHeight);
    } else {
      window.removeEventListener('resize', initBodyMaxHeight);
    }
  }, [fieldStatus, title, visible, hideFooter, footer, footerButtonGroup]);
  var handleSubmit = function handleSubmit() {
    var type = props.type,
      formItemGroup = props.formItemGroup,
      onSubmit = props.onSubmit;
    if (type === 'form' || type === 'gridForm') {
      modalForm.validateFields().then(function (values) {
        if (Object.prototype.hasOwnProperty.call(values, 'false')) {
          delete values.false; // 自定义结构会莫名的出来一个false字段
        }
        var resultValues = UtilValueFormat(values, formItemGroup);
        if (onSubmit) {
          onSubmit(_objectSpread({}, resultValues));
        }
      }).catch(function () {
        // 定位到第一条表单异常的
        var errorCollection = Array.prototype.slice.call(document.getElementsByClassName('ant-form-item-has-error'));
        if (errorCollection[0] && errorCollection[0].getElementsByTagName('input')) {
          Array.prototype.slice.call(errorCollection[0].getElementsByTagName('input'))[0].focus();
        }
        // console.error('表单填写有误', errorInfo, '第一条数据',errorInfo.errorFields[0].name[0])
      });
    } else if (type === 'stepForm' || type === 'tabForm') {
      // onSubmit && onSubmit()
      formChild.validateFields().then(function (values) {
        // console.log(values)
        if (Object.prototype.hasOwnProperty.call(values, 'false')) {
          delete values.false; // 自定义结构会莫名的出来一个false字段
        }
        var resultValues = UtilValueFormat(values, formItemGroup);
        if (onSubmit) {
          onSubmit(_objectSpread({}, resultValues));
        }
      }).catch(function () {
        // 定位到第一条表单异常的
        var errorCollection = Array.prototype.slice.call(document.getElementsByClassName('ant-form-item-has-error'));
        if (errorCollection[0] && errorCollection[0].getElementsByTagName('input')) {
          Array.prototype.slice.call(errorCollection[0].getElementsByTagName('input'))[0].focus();
        }
        // console.error('表单填写有误', errorInfo, '第一条数据',errorInfo.errorFields[0].name[0])
      });
    } else {
      // 没有表单数组 formItemGroup 配置
      onSubmit && onSubmit();
    }
  };

  // 重置所有表单
  var clearAllFieldsValue = function clearAllFieldsValue() {
    // let allFields = {}
    // Object.keys(modalForm.getFieldsValue()).map((item) => allFields[item] = undefined)
    // modalForm.setFieldsValue(allFields) // 直接清空表单的赋值(initialValues传值如果没有前后赋值没有全部带上所有字段，则会默认又使用之前的部分未传参字段)
    modalForm.resetFields(); // 直接使用这个无效
  };
  var onAfterClose = function onAfterClose() {
    var afterClose = props.afterClose;
    if (type === 'form') clearAllFieldsValue();
    if (afterClose) afterClose();
  };
  var handleCancel = function handleCancel() {
    var onCancel = props.onCancel;
    if (onCancel) onCancel();
  };

  // 强制更新表单值，用于赋初始化实例值
  var forceUpdateForm = function forceUpdateForm() {
    _getFormFields && _getFormFields(modalForm.getFieldsValue() || {}, modalForm);
  };
  var renderFormItemGroup = function renderFormItemGroup() {
    var fieldStatus = props.fieldStatus,
      formItemGroup = props.formItemGroup,
      _props$size2 = props.size,
      size = _props$size2 === void 0 ? 'md' : _props$size2,
      type = props.type;
    if (Array.isArray(formItemGroup)) {
      if (type === 'gridForm') {
        // 栅格组
        return /*#__PURE__*/React.createElement(Row, {
          gutter: 20
        }, formItemGroup.map(function (item, index) {
          var childrenFields = item.fields || [];
          if (item.label) {
            childrenFields = [{
              type: item.type,
              label: item.label,
              protoConfig: _objectSpread({}, item.protoConfig)
              // protoConfig: { className: '', ...item.protoConfig }
            }].concat(childrenFields);
          }
          return /*#__PURE__*/React.createElement(Col, {
            key: index,
            span: item.gridSpan || 24
          }, /*#__PURE__*/React.createElement(RenderItemGroup, {
            size: size,
            layout: formLayout,
            doUpdateFormFields: function doUpdateFormFields() {
              return forceUpdateForm();
            },
            displayLayout: item.displayLayout || displayLayout,
            itemGroup: childrenFields,
            fieldStatus: fieldStatus,
            form: modalForm
          }));
        }));
      }
      return /*#__PURE__*/React.createElement(RenderItemGroup, {
        size: size,
        layout: formLayout,
        doUpdateFormFields: function doUpdateFormFields() {
          return forceUpdateForm();
        },
        displayLayout: displayLayout,
        itemGroup: formItemGroup,
        fieldStatus: fieldStatus,
        form: modalForm
      });
    }
    return formItemGroup;
  };
  var handleStepType = function handleStepType(type, extraFunc) {
    var current = stepsConfig.current;
    switch (type) {
      case 'submit':
      case 'next':
        // 获取当前步骤的表单配置下有 rules 的控件进行校验（自定义的控件则自己有业务层面处理添加校验）
        // console.log('执行下一步骤，需要优先进行校验')
        var currentFields = (formItemGroup || [])[current].fields;
        var validatorGroup = currentFields && Array.isArray(currentFields) ? currentFields.map(function (fItem) {
          return fItem.rules ? fItem.filedName || fItem.fieldName : null;
        }) : [];
        formChild.validateFields(validatorGroup).then(function () {
          // if (stepClick) stepClick(type, formChild, values);
          extraFunc && extraFunc();
        }).catch(function () {
          // console.log('表单校验不通过 ', errorFields.map(err => err))
        });
        break;
      case 'prev':
        // if (stepClick) stepClick(type, formChild);
        extraFunc && extraFunc();
        break;
      case 'cancel':
        // if (stepClick) stepClick(type, formChild);
        extraFunc && extraFunc();
        break;
      default:
        // extraFunc()
        break;
    }
  };
  var renderButtonGroup = function renderButtonGroup() {
    var footerButtonGroup = props.footerButtonGroup,
      confirmLoading = props.confirmLoading,
      cancelText = props.cancelText,
      confirmText = props.confirmText,
      okText = props.okText,
      okButtonProps = props.okButtonProps,
      confirmButtonProps = props.confirmButtonProps,
      cancelButtonProps = props.cancelButtonProps;
    if (footerButtonGroup) {
      if (Array.isArray(footerButtonGroup)) {
        if (footerButtonGroup.length === 0) return null; // <div>按钮组合配置为空</div>
        return /*#__PURE__*/React.createElement(React.Fragment, null, footerButtonGroup.map(function (item) {
          if (_typeof(item) === 'object') {
            if (item.isHide) return null;
            var name = item.name,
              _type = item.type,
              icon = item.icon,
              ghost = item.ghost,
              disabled = item.disabled,
              loading = item.loading,
              fn = item.fn,
              others = _objectWithoutProperties(item, _excluded2);
            return /*#__PURE__*/React.createElement(Button, _extends({
              key: name,
              type: _type || 'primary',
              icon: /*#__PURE__*/React.createElement(IconNode, {
                icon: icon
              }),
              ghost: ghost,
              disabled: disabled,
              loading: loading,
              onClick: fn ? function (e) {
                return fn(item, modalForm, props, e);
              } : null
            }, others), name);
          } else {
            return item; // 如果是DOM，则直接渲染
          }
        }));
      }
      if (typeof footerButtonGroup === 'function') {
        return footerButtonGroup(modalForm, props);
      }
      return footerButtonGroup;
    }
    if (footer) return footer;
    return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({
      key: "submit",
      type: 'primary',
      loading: confirmLoading,
      onClick: handleSubmit
    }, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/React.createElement(Button, _extends({
      key: "back",
      onClick: handleCancel
    }, cancelButtonProps), cancelText || '取消'));
  };
  var renderFooter = function renderFooter() {
    if (type === 'stepForm') {
      var _currentStepInfo$acti3;
      var currentStepInfo = (formItemGroup || [])[stepsConfig.current];
      return (currentStepInfo === null || currentStepInfo === void 0 || (_currentStepInfo$acti3 = currentStepInfo.actions) === null || _currentStepInfo$acti3 === void 0 ? void 0 : _currentStepInfo$acti3.length) > 0 ? /*#__PURE__*/React.createElement(ActionList, {
        list: currentStepInfo.actions || [],
        onStep: handleStepType,
        form: formChild,
        other: props
      }) : null;
    }
    if (type === 'tabForm') {
      var _activeTabInfo$action3;
      var activeTabInfo = (formItemGroup || []).find(function (fItem) {
        return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
      });
      return (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action3 = activeTabInfo.actions) === null || _activeTabInfo$action3 === void 0 ? void 0 : _activeTabInfo$action3.length) > 0 ? /*#__PURE__*/React.createElement(ActionList, {
        list: (activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) || [],
        form: formChild,
        other: props
      }) : null;
    }
    return hasFooterBar ? renderButtonGroup() : null;
  };
  // 内容渲染
  var renderChildrenNodes = function renderChildrenNodes() {
    return /*#__PURE__*/React.createElement(React.Fragment, null, children, (type === 'form' || type === 'gridForm') && /*#__PURE__*/React.createElement(Form, {
      layout: formLayout,
      ref: setModalFormRef,
      form: modalForm,
      onFinish: handleSubmit,
      hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark
      // initialValues={{ ...initialValues }}
      ,
      scrollToFirstError: true,
      className: "modalForm"
    }, formPrefix && /*#__PURE__*/React.createElement(Row, null, formPrefix(modalForm, props, forceUpdateForm)), formItemGroup ? renderFormItemGroup() : null, formPostfix && /*#__PURE__*/React.createElement(Row, null, formPostfix(modalForm, props, forceUpdateForm), " ")), type === 'tabForm' && /*#__PURE__*/React.createElement(TabForm, {
      grid: size,
      layout: formLayout,
      fieldStatus: fieldStatus,
      actionHide: true
      // @ts-ignore
      ,
      getFormFields: function getFormFields(fields, form) {
        setFormChild(form);
        _getFormFields && _getFormFields(fields, form);
      },
      formItemGroup: formItemGroup,
      tabsConfig: tabsConfig,
      onSubmit: handleSubmit,
      initialValues: _objectSpread({}, initialValues),
      displayLayout: displayLayout
    }), type === 'stepForm' && /*#__PURE__*/React.createElement(StepForm, {
      grid: size,
      layout: formLayout,
      fieldStatus: fieldStatus,
      actionHide: true
      // @ts-ignore
      ,
      getFormFields: function getFormFields(fields, form) {
        setFormChild(form);
        _getFormFields && _getFormFields(fields, form);
      },
      formItemGroup: formItemGroup,
      stepsConfig: stepsConfig,
      onSubmit: handleSubmit,
      initialValues: _objectSpread({}, initialValues),
      displayLayout: displayLayout
    }));
  };
  // 可拖动及缩放
  if (dragAble) {
    return /*#__PURE__*/React.createElement(StandardDragModal, _extends({
      destroyOnHidden: true,
      destroyOnClose: true
      // @ts-ignore
      ,
      initialWidth: otherProps.width || general.modalSize[size].width,
      initialHeight: otherProps.height,
      zIndex: 1001
    }, otherProps, {
      visible: visible,
      className: "standardModal ".concat(className || '', " ").concat(fieldStatus === 'viewOnly' ? 'is-view' : ''),
      onCancel: handleCancel,
      afterClose: onAfterClose,
      onOk: handleSubmit,
      title: title,
      footer: renderFooter()
    }), renderChildrenNodes());
    /* return <DraggableModalProvider>
       <DraggableModal destroyOnClose
                       initialWidth={otherProps.width || general.modalSize[size].width}
                       initialHeight={otherProps.height}
                       zIndex={1001}
                       {...otherProps}
                       visible={visible}
                       className={`standardModal ${className || ''} ${fieldStatus === 'viewOnly' ? 'is-view' : ''}`}
                       onCancel={handleCancel}
                       afterClose={onAfterClose}
                       onOk={handleSubmit}
                       title={title}
                       footer={renderFooter()}
       >
         {renderChildrenNodes()}
       </DraggableModal>
     </DraggableModalProvider>*/
  }
  return /*#__PURE__*/React.createElement(Modal, _extends({
    destroyOnClose: true,
    maskClosable: false
    // @ts-ignore
    ,
    width: general.modalSize[size].width
  }, otherProps, {
    open: visible,
    title: title,
    footer: renderFooter(),
    className: "standardModal ".concat(className || '', " ").concat(fieldStatus === 'viewOnly' ? 'is-view' : ''),
    style: _objectSpread({
      top: '80px'
    }, style),
    bodyStyle: _objectSpread({
      maxHeight: bodyMaxHeight,
      overflowY: 'scroll'
    }, bodyStyle),
    onCancel: handleCancel,
    afterClose: onAfterClose,
    onOk: handleSubmit
  }), renderChildrenNodes());
};
export default StandardModal;