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