@bigbinary/neeto-rules-frontend 2.5.15-beta → 2.5.15-beta-2

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.
@@ -5787,8 +5787,9 @@ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t
5787
5787
  var Form = function Form(_ref) {
5788
5788
  var _ref$data = _ref.data,
5789
5789
  data = _ref$data === void 0 ? {} : _ref$data,
5790
- _ref$title = _ref.title,
5791
- title = _ref$title === void 0 ? t$1("neetoRules.common.title") : _ref$title,
5790
+ title = _ref.title,
5791
+ _ref$breadcrumbs = _ref.breadcrumbs,
5792
+ breadcrumbs = _ref$breadcrumbs === void 0 ? {} : _ref$breadcrumbs,
5792
5793
  _children = _ref.children,
5793
5794
  className = _ref.className,
5794
5795
  _ref$handleSubmit = _ref.handleSubmit,
@@ -5797,88 +5798,86 @@ var Form = function Form(_ref) {
5797
5798
  handleCancel = _ref$handleCancel === void 0 ? noop : _ref$handleCancel,
5798
5799
  _ref$showStatusSwitch = _ref.showStatusSwitch,
5799
5800
  showStatusSwitch = _ref$showStatusSwitch === void 0 ? true : _ref$showStatusSwitch;
5800
- return function () {
5801
- var _useTranslation = useTranslation(),
5802
- t = _useTranslation.t;
5803
- var formRef = useRef(null);
5804
- var _useUtilityStore = useUtilityStore(function (store) {
5805
- return {
5806
- resetPanelState: store["resetPanelState"]
5807
- };
5808
- }, shallow),
5809
- resetPanelState = _useUtilityStore.resetPanelState;
5810
- var submitForm = function submitForm(values, formikBag) {
5811
- var payload = buildPayload(data, values);
5812
- handleSubmit(payload, formikBag);
5813
- };
5814
- var initialValues = useMemo(function () {
5815
- return formatData(data);
5816
- }, [data]);
5817
- var _useCustomDataStore = useCustomDataStore(function (store) {
5818
- return {
5819
- customData: store["customData"]
5820
- };
5821
- }, shallow),
5822
- customData = _useCustomDataStore.customData;
5823
- useEffect(function () {
5824
- return function () {
5825
- return resetPanelState();
5801
+ var _useTranslation = useTranslation(),
5802
+ t = _useTranslation.t;
5803
+ var formRef = useRef(null);
5804
+ var _useUtilityStore = useUtilityStore(function (store) {
5805
+ return {
5806
+ resetPanelState: store["resetPanelState"]
5826
5807
  };
5827
- }, []);
5828
- return /*#__PURE__*/jsx(Formik, {
5829
- enableReinitialize: true,
5830
- initialValues: _objectSpread$1(_objectSpread$1({}, DEFAULT_INITIAL_VALUE), initialValues),
5831
- validationSchema: getValidationSchema(data, customData),
5832
- onSubmit: submitForm,
5833
- children: function children(_ref2) {
5834
- var dirty = _ref2.dirty,
5835
- values = _ref2.values,
5836
- fromikBag = _objectWithoutProperties(_ref2, _excluded);
5837
- return /*#__PURE__*/jsxs("div", {
5838
- className: "flex neeto-rules-main-content h-full",
5839
- children: [/*#__PURE__*/jsx(TouchErrors, {}), /*#__PURE__*/jsxs(Container, {
5840
- className: "neeto-rules-main-content__container max-h-full",
5841
- children: [/*#__PURE__*/jsx(NeetoHeader, {
5842
- title: title,
5843
- breadcrumbs: {}
5844
- }), /*#__PURE__*/jsxs(Form$1, {
5845
- ref: formRef,
5846
- className: classNames(["w-full neeto-rules-main-content__form mx-auto max-w-3xl", className]),
5847
- children: [/*#__PURE__*/jsxs("div", {
5848
- className: "space-y-6",
5849
- children: [/*#__PURE__*/jsx(InputField, {
5850
- required: true,
5851
- data: initialValues,
5852
- label: t("neetoRules.common.name"),
5853
- name: "name"
5854
- }), /*#__PURE__*/jsx(TextareaField, {
5855
- data: initialValues,
5856
- label: t("neetoRules.common.description"),
5857
- name: "description"
5858
- }), showStatusSwitch && /*#__PURE__*/jsx(Status, {}), typeof _children === "function" ? _children === null || _children === void 0 ? void 0 : _children(_objectSpread$1({
5859
- values: values,
5860
- formattedValues: buildPayload(data, values),
5861
- dirty: dirty
5862
- }, fromikBag)) : _children, /*#__PURE__*/jsx(ScrollToErrorField, {
5863
- formRef: formRef
5864
- })]
5865
- }), /*#__PURE__*/jsx("div", {
5866
- className: "neeto-ui-bg-white sticky bottom-0 py-6",
5867
- children: /*#__PURE__*/jsx(ActionBlock, {
5868
- cancelButtonProps: {
5869
- onClick: handleCancel
5870
- },
5871
- submitButtonProps: {
5872
- "data-cy": "form-submit-button"
5873
- }
5874
- })
5808
+ }, shallow),
5809
+ resetPanelState = _useUtilityStore.resetPanelState;
5810
+ var submitForm = function submitForm(values, formikBag) {
5811
+ var payload = buildPayload(data, values);
5812
+ handleSubmit(payload, formikBag);
5813
+ };
5814
+ var initialValues = useMemo(function () {
5815
+ return formatData(data);
5816
+ }, [data]);
5817
+ var _useCustomDataStore = useCustomDataStore(function (store) {
5818
+ return {
5819
+ customData: store["customData"]
5820
+ };
5821
+ }, shallow),
5822
+ customData = _useCustomDataStore.customData;
5823
+ useEffect(function () {
5824
+ return function () {
5825
+ return resetPanelState();
5826
+ };
5827
+ }, []);
5828
+ return /*#__PURE__*/jsx(Formik, {
5829
+ enableReinitialize: true,
5830
+ initialValues: _objectSpread$1(_objectSpread$1({}, DEFAULT_INITIAL_VALUE), initialValues),
5831
+ validationSchema: getValidationSchema(data, customData),
5832
+ onSubmit: submitForm,
5833
+ children: function children(_ref2) {
5834
+ var dirty = _ref2.dirty,
5835
+ values = _ref2.values,
5836
+ fromikBag = _objectWithoutProperties(_ref2, _excluded);
5837
+ return /*#__PURE__*/jsxs("div", {
5838
+ className: "flex neeto-rules-main-content h-full",
5839
+ children: [/*#__PURE__*/jsx(TouchErrors, {}), /*#__PURE__*/jsxs(Container, {
5840
+ className: "neeto-rules-main-content__container max-h-full",
5841
+ children: [/*#__PURE__*/jsx(NeetoHeader, {
5842
+ breadcrumbs: breadcrumbs,
5843
+ title: title || t("neetoRules.common.title")
5844
+ }), /*#__PURE__*/jsxs(Form$1, {
5845
+ ref: formRef,
5846
+ className: classNames(["w-full neeto-rules-main-content__form mx-auto max-w-3xl", className]),
5847
+ children: [/*#__PURE__*/jsxs("div", {
5848
+ className: "space-y-6",
5849
+ children: [/*#__PURE__*/jsx(InputField, {
5850
+ required: true,
5851
+ data: initialValues,
5852
+ label: t("neetoRules.common.name"),
5853
+ name: "name"
5854
+ }), /*#__PURE__*/jsx(TextareaField, {
5855
+ data: initialValues,
5856
+ label: t("neetoRules.common.description"),
5857
+ name: "description"
5858
+ }), showStatusSwitch && /*#__PURE__*/jsx(Status, {}), typeof _children === "function" ? _children === null || _children === void 0 ? void 0 : _children(_objectSpread$1({
5859
+ values: values,
5860
+ formattedValues: buildPayload(data, values),
5861
+ dirty: dirty
5862
+ }, fromikBag)) : _children, /*#__PURE__*/jsx(ScrollToErrorField, {
5863
+ formRef: formRef
5875
5864
  })]
5865
+ }), /*#__PURE__*/jsx("div", {
5866
+ className: "neeto-ui-bg-white sticky bottom-0 py-6",
5867
+ children: /*#__PURE__*/jsx(ActionBlock, {
5868
+ cancelButtonProps: {
5869
+ onClick: handleCancel
5870
+ },
5871
+ submitButtonProps: {
5872
+ "data-cy": "form-submit-button"
5873
+ }
5874
+ })
5876
5875
  })]
5877
- }), /*#__PURE__*/jsx(Panel, {})]
5878
- });
5879
- }
5880
- });
5881
- }();
5876
+ })]
5877
+ }), /*#__PURE__*/jsx(Panel, {})]
5878
+ });
5879
+ }
5880
+ });
5882
5881
  };
5883
5882
 
5884
5883
  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; }