@mseva/digit-ui-module-challangeneration 1.0.6 → 1.0.7

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.
package/dist/index.js CHANGED
@@ -13775,6 +13775,25 @@ const OffenceDetails = _ref => {
13775
13775
  } = _ref;
13776
13776
  const [loader, setLoader] = React.useState(false);
13777
13777
  const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
13778
+ const {
13779
+ data: categoryData,
13780
+ isLoading: categoryLoading
13781
+ } = Digit.Hooks.useCustomMDMS(tenantId, "Challan", [{
13782
+ name: "Category"
13783
+ }]);
13784
+ const {
13785
+ data: subCategoryData,
13786
+ isLoading: subCategoryLoading
13787
+ } = Digit.Hooks.useCustomMDMS(tenantId, "Challan", [{
13788
+ name: "SubCategory"
13789
+ }]);
13790
+ const {
13791
+ data: OffenceTypeData,
13792
+ isLoading: OffenceTypeLoading
13793
+ } = Digit.Hooks.useCustomMDMS(tenantId, "Challan", [{
13794
+ name: "OffenceType"
13795
+ }]);
13796
+ console.log("categoryData====", categoryData, subCategoryData, OffenceTypeData);
13778
13797
  const {
13779
13798
  control,
13780
13799
  handleSubmit,
@@ -13811,17 +13830,20 @@ const OffenceDetails = _ref => {
13811
13830
  control: control,
13812
13831
  name: "offenceType",
13813
13832
  defaultValue: null,
13814
- render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
13815
- style: {
13816
- marginBottom: 0
13817
- },
13818
- className: "form-field",
13819
- select: props.onChange,
13820
- selected: props.value,
13821
- option: [],
13822
- optionKey: "name",
13823
- t: t
13824
- })
13833
+ render: props => {
13834
+ var _OffenceTypeData$Chal;
13835
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
13836
+ style: {
13837
+ marginBottom: 0
13838
+ },
13839
+ className: "form-field",
13840
+ select: props.onChange,
13841
+ selected: props.value,
13842
+ option: OffenceTypeData === null || OffenceTypeData === void 0 ? void 0 : (_OffenceTypeData$Chal = OffenceTypeData.Challan) === null || _OffenceTypeData$Chal === void 0 ? void 0 : _OffenceTypeData$Chal.OffenceType,
13843
+ optionKey: "name",
13844
+ t: t
13845
+ });
13846
+ }
13825
13847
  }), errors.offenceType && /*#__PURE__*/React__default.createElement("p", {
13826
13848
  style: {
13827
13849
  color: "red"
@@ -13838,17 +13860,20 @@ const OffenceDetails = _ref => {
13838
13860
  control: control,
13839
13861
  name: "offenceCategory",
13840
13862
  defaultValue: null,
13841
- render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
13842
- style: {
13843
- marginBottom: 0
13844
- },
13845
- className: "form-field",
13846
- select: props.onChange,
13847
- selected: props.value,
13848
- option: [],
13849
- optionKey: "name",
13850
- t: t
13851
- })
13863
+ render: props => {
13864
+ var _categoryData$Challan;
13865
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
13866
+ style: {
13867
+ marginBottom: 0
13868
+ },
13869
+ className: "form-field",
13870
+ select: props.onChange,
13871
+ selected: props.value,
13872
+ option: categoryData === null || categoryData === void 0 ? void 0 : (_categoryData$Challan = categoryData.Challan) === null || _categoryData$Challan === void 0 ? void 0 : _categoryData$Challan.Category,
13873
+ optionKey: "name",
13874
+ t: t
13875
+ });
13876
+ }
13852
13877
  }), errors.offenceCategory && /*#__PURE__*/React__default.createElement("p", {
13853
13878
  style: {
13854
13879
  color: "red"
@@ -13865,17 +13890,20 @@ const OffenceDetails = _ref => {
13865
13890
  control: control,
13866
13891
  name: "offenceSubCategory",
13867
13892
  defaultValue: null,
13868
- render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
13869
- style: {
13870
- marginBottom: 0
13871
- },
13872
- className: "form-field",
13873
- select: props.onChange,
13874
- selected: props.value,
13875
- option: [],
13876
- optionKey: "name",
13877
- t: t
13878
- })
13893
+ render: props => {
13894
+ var _subCategoryData$Chal;
13895
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
13896
+ style: {
13897
+ marginBottom: 0
13898
+ },
13899
+ className: "form-field",
13900
+ select: props.onChange,
13901
+ selected: props.value,
13902
+ option: subCategoryData === null || subCategoryData === void 0 ? void 0 : (_subCategoryData$Chal = subCategoryData.Challan) === null || _subCategoryData$Chal === void 0 ? void 0 : _subCategoryData$Chal.SubCategory,
13903
+ optionKey: "name",
13904
+ t: t
13905
+ });
13906
+ }
13879
13907
  }), errors.offenceSubCategory && /*#__PURE__*/React__default.createElement("p", {
13880
13908
  style: {
13881
13909
  color: "red"
@@ -14024,7 +14052,7 @@ const OffenceDetails = _ref => {
14024
14052
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
14025
14053
  label: "Next",
14026
14054
  submit: "submit"
14027
- }))), loader && /*#__PURE__*/React__default.createElement(Loader, {
14055
+ }))), (loader || categoryLoading || subCategoryLoading || OffenceTypeLoading) && /*#__PURE__*/React__default.createElement(Loader, {
14028
14056
  page: true
14029
14057
  }));
14030
14058
  };