@star-insure/sdk 3.2.2 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ declare type QuoteRequestForm = QuoteRequest & Record<string, any>;
5
5
  interface QuoteRequestFormContextInterface {
6
6
  form?: InertiaFormProps<QuoteRequestForm>;
7
7
  handleChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => void;
8
+ clear: () => void;
8
9
  }
9
10
  export declare const initialData: QuoteRequestForm;
10
11
  export declare const QuoteRequestFormContext: React.Context<QuoteRequestFormContextInterface>;
@@ -815,10 +815,14 @@ var initialData = {
815
815
  follow_up_at: undefined,
816
816
  is_follow_up_required: true
817
817
  };
818
- var QuoteRequestFormContext = /*#__PURE__*/React__default.createContext({});
818
+ var QuoteRequestFormContext = /*#__PURE__*/React__default.createContext({
819
+ clear: function clear() {
820
+ return null;
821
+ }
822
+ });
819
823
  function QuoteRequestFormProvider(_ref) {
820
824
  var children = _ref.children;
821
- var form = react.useForm(initialData);
825
+ var form = react.useForm(_extends({}, initialData));
822
826
  /**
823
827
  * Handle the change event for all form inputs
824
828
  */
@@ -854,10 +858,15 @@ function QuoteRequestFormProvider(_ref) {
854
858
  });
855
859
  }
856
860
 
861
+ function clear() {
862
+ form.setData(_extends({}, initialData));
863
+ }
864
+
857
865
  return React__default.createElement(QuoteRequestFormContext.Provider, {
858
866
  value: {
859
867
  form: form,
860
- handleChange: handleChange
868
+ handleChange: handleChange,
869
+ clear: clear
861
870
  }
862
871
  }, children);
863
872
  }