@fctc/interface-logic 2.4.1 → 2.4.3

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/provider.js CHANGED
@@ -2894,8 +2894,7 @@ function useActionService() {
2894
2894
  async ({
2895
2895
  idAction,
2896
2896
  context,
2897
- service,
2898
- xNode
2897
+ service
2899
2898
  }) => {
2900
2899
  const jsonData = {
2901
2900
  action_id: idAction,
@@ -2905,7 +2904,7 @@ function useActionService() {
2905
2904
  "/load_action" /* LOAD_ACTION */,
2906
2905
  jsonData,
2907
2906
  {
2908
- headers: { "Content-Type": "application/json", x_node: xNode }
2907
+ headers: { "Content-Type": "application/json" }
2909
2908
  },
2910
2909
  service
2911
2910
  );
@@ -2918,8 +2917,7 @@ function useActionService() {
2918
2917
  ids = [],
2919
2918
  context,
2920
2919
  method,
2921
- service,
2922
- xNode
2920
+ service
2923
2921
  }) => {
2924
2922
  try {
2925
2923
  const jsonData = {
@@ -2932,8 +2930,7 @@ function useActionService() {
2932
2930
  "/call" /* CALL_PATH */,
2933
2931
  jsonData,
2934
2932
  {
2935
- headers: { "Content-Type": "application/json" },
2936
- ...xNode ? { x_node: xNode } : {}
2933
+ headers: { "Content-Type": "application/json" }
2937
2934
  },
2938
2935
  service
2939
2936
  );
@@ -2949,8 +2946,7 @@ function useActionService() {
2949
2946
  model,
2950
2947
  ids,
2951
2948
  context,
2952
- service,
2953
- xNode
2949
+ service
2954
2950
  }) => {
2955
2951
  const jsonData = {
2956
2952
  model,
@@ -2962,8 +2958,7 @@ function useActionService() {
2962
2958
  "/call" /* CALL_PATH */,
2963
2959
  jsonData,
2964
2960
  {
2965
- headers: { "Content-Type": "application/json" },
2966
- ...xNode ? { x_node: xNode } : {}
2961
+ headers: { "Content-Type": "application/json" }
2967
2962
  },
2968
2963
  service
2969
2964
  );
@@ -2975,8 +2970,7 @@ function useActionService() {
2975
2970
  model,
2976
2971
  id,
2977
2972
  context,
2978
- service,
2979
- xNode
2973
+ service
2980
2974
  }) => {
2981
2975
  const jsonData = {
2982
2976
  model,
@@ -2988,8 +2982,7 @@ function useActionService() {
2988
2982
  "/call" /* CALL_PATH */,
2989
2983
  jsonData,
2990
2984
  {
2991
- headers: { "Content-Type": "application/json" },
2992
- ...xNode ? { x_node: xNode } : {}
2985
+ headers: { "Content-Type": "application/json" }
2993
2986
  },
2994
2987
  service
2995
2988
  );
@@ -3036,8 +3029,7 @@ function useActionService() {
3036
3029
  async ({
3037
3030
  idAction,
3038
3031
  context,
3039
- service,
3040
- xNode
3032
+ service
3041
3033
  }) => {
3042
3034
  const jsonData = {
3043
3035
  action_id: idAction,
@@ -3047,8 +3039,7 @@ function useActionService() {
3047
3039
  "/run_action" /* RUN_ACTION_PATH */,
3048
3040
  jsonData,
3049
3041
  {
3050
- headers: { "Content-Type": "application/json" },
3051
- ...xNode ? { x_node: xNode } : {}
3042
+ headers: { "Content-Type": "application/json" }
3052
3043
  },
3053
3044
  service
3054
3045
  );
@@ -3382,7 +3373,7 @@ function useExcelService() {
3382
3373
  };
3383
3374
  return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3384
3375
  headers: {
3385
- "Content-Type": "multipart/form-data"
3376
+ "Content-Type": "application/json"
3386
3377
  }
3387
3378
  });
3388
3379
  },
@@ -3411,7 +3402,7 @@ function useExcelService() {
3411
3402
  };
3412
3403
  return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3413
3404
  headers: {
3414
- "Content-Type": "multipart/form-data"
3405
+ "Content-Type": "application/json"
3415
3406
  }
3416
3407
  });
3417
3408
  },
@@ -3771,11 +3762,7 @@ function useModelService() {
3771
3762
  });
3772
3763
  }, [env]);
3773
3764
  const getAll = (0, import_react8.useCallback)(
3774
- async ({
3775
- data,
3776
- service,
3777
- xNode
3778
- }) => {
3765
+ async ({ data, service }) => {
3779
3766
  const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3780
3767
  fields: data.fields,
3781
3768
  groupby: data.groupby
@@ -3801,8 +3788,7 @@ function useModelService() {
3801
3788
  jsonData,
3802
3789
  {
3803
3790
  headers: {
3804
- "Content-Type": "application/json",
3805
- ...xNode ? { x_node: xNode } : {}
3791
+ "Content-Type": "application/json"
3806
3792
  }
3807
3793
  },
3808
3794
  service
@@ -3879,8 +3865,7 @@ function useModelService() {
3879
3865
  model,
3880
3866
  specification,
3881
3867
  context,
3882
- service,
3883
- xNode
3868
+ service
3884
3869
  }) => {
3885
3870
  const jsonData = {
3886
3871
  model,
@@ -3896,8 +3881,7 @@ function useModelService() {
3896
3881
  jsonData,
3897
3882
  {
3898
3883
  headers: {
3899
- "Content-Type": "application/json",
3900
- ...xNode ? { x_node: xNode } : {}
3884
+ "Content-Type": "application/json"
3901
3885
  }
3902
3886
  },
3903
3887
  service
@@ -3913,8 +3897,7 @@ function useModelService() {
3913
3897
  specification = {},
3914
3898
  context = {},
3915
3899
  path,
3916
- service,
3917
- xNode
3900
+ service
3918
3901
  }) => {
3919
3902
  const jsonData = {
3920
3903
  model,
@@ -3931,8 +3914,7 @@ function useModelService() {
3931
3914
  jsonData,
3932
3915
  {
3933
3916
  headers: {
3934
- "Content-Type": "application/json",
3935
- ...xNode ? { x_node: xNode } : {}
3917
+ "Content-Type": "application/json"
3936
3918
  }
3937
3919
  },
3938
3920
  service
@@ -3968,8 +3950,7 @@ function useModelService() {
3968
3950
  specification,
3969
3951
  context,
3970
3952
  fieldChange,
3971
- service,
3972
- xNode
3953
+ service
3973
3954
  }) => {
3974
3955
  const jsonData = {
3975
3956
  model,
@@ -3987,8 +3968,7 @@ function useModelService() {
3987
3968
  jsonData,
3988
3969
  {
3989
3970
  headers: {
3990
- "Content-Type": "application/json",
3991
- ...xNode ? { x_node: xNode } : {}
3971
+ "Content-Type": "application/json"
3992
3972
  }
3993
3973
  },
3994
3974
  service
@@ -3997,11 +3977,7 @@ function useModelService() {
3997
3977
  [env]
3998
3978
  );
3999
3979
  const getListFieldsOnchange = (0, import_react8.useCallback)(
4000
- async ({
4001
- model,
4002
- service,
4003
- xNode
4004
- }) => {
3980
+ async ({ model, service }) => {
4005
3981
  const jsonData = {
4006
3982
  model,
4007
3983
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
@@ -4011,8 +3987,7 @@ function useModelService() {
4011
3987
  jsonData,
4012
3988
  {
4013
3989
  headers: {
4014
- "Content-Type": "application/json",
4015
- ...xNode ? { x_node: xNode } : {}
3990
+ "Content-Type": "application/json"
4016
3991
  }
4017
3992
  },
4018
3993
  service
@@ -4177,8 +4152,7 @@ function useViewService() {
4177
4152
  context = {},
4178
4153
  options = {},
4179
4154
  aid,
4180
- service,
4181
- xNode
4155
+ service
4182
4156
  }) => {
4183
4157
  const defaultOptions = {
4184
4158
  load_filters: true,
@@ -4199,8 +4173,7 @@ function useViewService() {
4199
4173
  jsonDataView,
4200
4174
  {
4201
4175
  headers: {
4202
- "Content-Type": "application/json",
4203
- ...xNode ? { x_node: xNode } : {}
4176
+ "Content-Type": "application/json"
4204
4177
  }
4205
4178
  },
4206
4179
  service
@@ -4288,11 +4261,7 @@ function useViewService() {
4288
4261
  [env]
4289
4262
  );
4290
4263
  const getSelectionItem = (0, import_react10.useCallback)(
4291
- async ({
4292
- data,
4293
- service,
4294
- xNode
4295
- }) => {
4264
+ async ({ data, service }) => {
4296
4265
  const jsonData = {
4297
4266
  model: data.model,
4298
4267
  ids: [],
@@ -4315,8 +4284,7 @@ function useViewService() {
4315
4284
  jsonData,
4316
4285
  {
4317
4286
  headers: {
4318
- "Content-Type": "application/json",
4319
- ...xNode ? { x_node: xNode } : {}
4287
+ "Content-Type": "application/json"
4320
4288
  }
4321
4289
  },
4322
4290
  service
@@ -4783,7 +4751,7 @@ var axiosClient = {
4783
4751
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4784
4752
  headers
4785
4753
  ).then(responseBody),
4786
- post: async (url, body, headers, serviceName) => instance.post(
4754
+ post: (url, body, headers, serviceName) => instance.post(
4787
4755
  formatUrl(getBaseUrl(config?.baseUrl, serviceName) + url, db),
4788
4756
  body,
4789
4757
  headers
@@ -5482,15 +5450,13 @@ var useGetDetail = () => {
5482
5450
  ids,
5483
5451
  specification,
5484
5452
  context,
5485
- service,
5486
- xNode
5453
+ service
5487
5454
  }) => getDetail({
5488
5455
  model,
5489
5456
  ids,
5490
5457
  specification,
5491
5458
  context,
5492
- service,
5493
- xNode
5459
+ service
5494
5460
  })
5495
5461
  });
5496
5462
  };
@@ -5500,16 +5466,14 @@ var use_get_detail_default = useGetDetail;
5500
5466
  var import_react_query38 = require("@tanstack/react-query");
5501
5467
  var useGetFieldOnChange = ({
5502
5468
  model,
5503
- service,
5504
- xNode
5469
+ service
5505
5470
  }) => {
5506
5471
  const { getListFieldsOnchange } = useModelService();
5507
5472
  return (0, import_react_query38.useQuery)({
5508
5473
  queryKey: [`field-onchange-${model}`, model],
5509
5474
  queryFn: () => getListFieldsOnchange({
5510
5475
  model,
5511
- service,
5512
- xNode
5476
+ service
5513
5477
  }).then((res) => {
5514
5478
  if (res) {
5515
5479
  return res;
@@ -5694,8 +5658,7 @@ var useOnChangeForm = () => {
5694
5658
  context,
5695
5659
  object,
5696
5660
  fieldChange,
5697
- service,
5698
- xNode
5661
+ service
5699
5662
  }) => onChange({
5700
5663
  ids,
5701
5664
  model,
@@ -5703,8 +5666,7 @@ var useOnChangeForm = () => {
5703
5666
  context,
5704
5667
  object,
5705
5668
  fieldChange,
5706
- service,
5707
- xNode
5669
+ service
5708
5670
  })
5709
5671
  });
5710
5672
  };
@@ -5722,9 +5684,8 @@ var useSave = () => {
5722
5684
  specification,
5723
5685
  context,
5724
5686
  path,
5725
- service,
5726
- xNode
5727
- }) => save({ ids, model, data, specification, context, path, service, xNode })
5687
+ service
5688
+ }) => save({ ids, model, data, specification, context, path, service })
5728
5689
  });
5729
5690
  };
5730
5691
  var use_save_default = useSave;
@@ -5777,15 +5738,13 @@ var useButton = () => {
5777
5738
  ids,
5778
5739
  context,
5779
5740
  method,
5780
- service,
5781
- xNode
5741
+ service
5782
5742
  }) => callButton({
5783
5743
  model,
5784
5744
  ids,
5785
5745
  context,
5786
5746
  method,
5787
- service,
5788
- xNode
5747
+ service
5789
5748
  }),
5790
5749
  onSuccess: (response) => {
5791
5750
  return response;
@@ -5803,14 +5762,12 @@ var useDuplicateRecord = () => {
5803
5762
  id,
5804
5763
  model,
5805
5764
  context,
5806
- service,
5807
- xNode
5765
+ service
5808
5766
  }) => duplicateRecord({
5809
5767
  id,
5810
5768
  model,
5811
5769
  context,
5812
- service,
5813
- xNode
5770
+ service
5814
5771
  })
5815
5772
  });
5816
5773
  };
@@ -5893,11 +5850,11 @@ var use_get_groups_default = useGetGroups;
5893
5850
 
5894
5851
  // src/hooks/view/use-get-list-data.ts
5895
5852
  var import_react_query50 = require("@tanstack/react-query");
5896
- var useGetListData = (listDataProps, queryKey, enabled, service, xNode) => {
5853
+ var useGetListData = (listDataProps, queryKey, enabled, service) => {
5897
5854
  const { getAll } = useModelService();
5898
5855
  return (0, import_react_query50.useQuery)({
5899
5856
  queryKey,
5900
- queryFn: () => getAll({ data: listDataProps, service, xNode }).then((res) => {
5857
+ queryFn: () => getAll({ data: listDataProps, service }).then((res) => {
5901
5858
  if (res) {
5902
5859
  return res;
5903
5860
  }
@@ -5905,8 +5862,7 @@ var useGetListData = (listDataProps, queryKey, enabled, service, xNode) => {
5905
5862
  }),
5906
5863
  enabled,
5907
5864
  refetchOnWindowFocus: false,
5908
- staleTime: 0,
5909
- placeholderData: import_react_query50.keepPreviousData
5865
+ staleTime: 0
5910
5866
  });
5911
5867
  };
5912
5868
  var use_get_list_data_default = useGetListData;
@@ -5975,13 +5931,12 @@ var useGetSelection = ({
5975
5931
  data,
5976
5932
  queryKey,
5977
5933
  enabled,
5978
- service,
5979
- xNode
5934
+ service
5980
5935
  }) => {
5981
5936
  const { getSelectionItem } = useViewService();
5982
5937
  return (0, import_react_query54.useQuery)({
5983
5938
  queryKey,
5984
- queryFn: () => getSelectionItem({ data, service, xNode }),
5939
+ queryFn: () => getSelectionItem({ data, service }),
5985
5940
  enabled,
5986
5941
  refetchOnWindowFocus: false
5987
5942
  });
@@ -6010,14 +5965,12 @@ var useLoadAction = () => {
6010
5965
  mutationFn: ({
6011
5966
  idAction,
6012
5967
  context,
6013
- service,
6014
- xNode
5968
+ service
6015
5969
  }) => {
6016
5970
  return loadAction({
6017
5971
  idAction,
6018
5972
  context,
6019
- service,
6020
- xNode
5973
+ service
6021
5974
  });
6022
5975
  }
6023
5976
  });
@@ -6059,14 +6012,12 @@ var useRemoveRow = () => {
6059
6012
  model,
6060
6013
  ids,
6061
6014
  context,
6062
- service,
6063
- xNode
6015
+ service
6064
6016
  }) => removeRows({
6065
6017
  model,
6066
6018
  ids,
6067
6019
  context,
6068
- service,
6069
- xNode
6020
+ service
6070
6021
  })
6071
6022
  });
6072
6023
  };
@@ -6098,13 +6049,11 @@ var useRunAction = () => {
6098
6049
  mutationFn: ({
6099
6050
  idAction,
6100
6051
  context,
6101
- service,
6102
- xNode
6052
+ service
6103
6053
  }) => runAction({
6104
6054
  idAction,
6105
6055
  context,
6106
- service,
6107
- xNode
6056
+ service
6108
6057
  })
6109
6058
  });
6110
6059
  };