'use strict';

var useEventBus = require('./useEventBus.js');

const defaultHandlers = {
  onFormSubmit: async () => {
    console.warn("[FormEvents] onFormSubmit \u672A\u5B9E\u73B0");
  },
  onFormReset: () => {
    console.warn("[FormEvents] onFormReset \u672A\u5B9E\u73B0");
  },
  onFieldChange: () => {
    console.warn("[FormEvents] onFieldChange \u672A\u5B9E\u73B0");
  },
  onFormValidate: () => {
    console.warn("[FormEvents] onFormValidate \u672A\u5B9E\u73B0");
  },
  onFormDialogClose: () => {
    console.warn("[FormEvents] onFormDialogClose \u672A\u5B9E\u73B0");
  },
  onFormDialogOpen: () => {
    console.warn("[FormEvents] onFormDialogOpen \u672A\u5B9E\u73B0");
  }
};
const {
  provideEvents: provideFormEvents,
  useEvents: useFormEvents
} = useEventBus.createEventBus({
  name: "formEvents",
  defaultHandlers,
  strict: true
  // 开发环境严格检查
});

exports.provideFormEvents = provideFormEvents;
exports.useFormEvents = useFormEvents;
