import React, { useMemo } from 'react';
import ProForm, { createForm } from '../../form';
// @ts-ignore
export var initConfigurator = function initConfigurator(schema, defaultInitialValues, defaultValues) {
  return function (props) {
    var initialValues = props.initialValues,
      onValuesChange = props.onValuesChange;
    var form = useMemo(function () {
      return createForm({
        initialValues: Object.assign({}, defaultValues, initialValues || defaultInitialValues)
      });
    }, []);
    var onChange = function onChange(values) {
      onValuesChange && onValuesChange(values);
    };
    return /*#__PURE__*/React.createElement(ProForm, {
      labelCol: 6,
      wrapperCol: 18,
      labelAlign: "left",
      colon: false,
      form: form,
      schema: schema,
      onChange: onChange
    });
  };
};