@fctc/interface-logic 2.4.3 → 2.4.5

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/hooks.js CHANGED
@@ -2946,7 +2946,8 @@ function useActionService() {
2946
2946
  async ({
2947
2947
  idAction,
2948
2948
  context,
2949
- service
2949
+ service,
2950
+ xNode
2950
2951
  }) => {
2951
2952
  const jsonData = {
2952
2953
  action_id: idAction,
@@ -2956,7 +2957,7 @@ function useActionService() {
2956
2957
  "/load_action" /* LOAD_ACTION */,
2957
2958
  jsonData,
2958
2959
  {
2959
- headers: { "Content-Type": "application/json" }
2960
+ headers: { "Content-Type": "application/json", x_node: xNode }
2960
2961
  },
2961
2962
  service
2962
2963
  );
@@ -2969,7 +2970,8 @@ function useActionService() {
2969
2970
  ids = [],
2970
2971
  context,
2971
2972
  method,
2972
- service
2973
+ service,
2974
+ xNode
2973
2975
  }) => {
2974
2976
  try {
2975
2977
  const jsonData = {
@@ -2982,7 +2984,8 @@ function useActionService() {
2982
2984
  "/call" /* CALL_PATH */,
2983
2985
  jsonData,
2984
2986
  {
2985
- headers: { "Content-Type": "application/json" }
2987
+ headers: { "Content-Type": "application/json" },
2988
+ ...xNode ? { x_node: xNode } : {}
2986
2989
  },
2987
2990
  service
2988
2991
  );
@@ -2998,7 +3001,8 @@ function useActionService() {
2998
3001
  model,
2999
3002
  ids,
3000
3003
  context,
3001
- service
3004
+ service,
3005
+ xNode
3002
3006
  }) => {
3003
3007
  const jsonData = {
3004
3008
  model,
@@ -3010,7 +3014,8 @@ function useActionService() {
3010
3014
  "/call" /* CALL_PATH */,
3011
3015
  jsonData,
3012
3016
  {
3013
- headers: { "Content-Type": "application/json" }
3017
+ headers: { "Content-Type": "application/json" },
3018
+ ...xNode ? { x_node: xNode } : {}
3014
3019
  },
3015
3020
  service
3016
3021
  );
@@ -3022,7 +3027,8 @@ function useActionService() {
3022
3027
  model,
3023
3028
  id,
3024
3029
  context,
3025
- service
3030
+ service,
3031
+ xNode
3026
3032
  }) => {
3027
3033
  const jsonData = {
3028
3034
  model,
@@ -3034,7 +3040,8 @@ function useActionService() {
3034
3040
  "/call" /* CALL_PATH */,
3035
3041
  jsonData,
3036
3042
  {
3037
- headers: { "Content-Type": "application/json" }
3043
+ headers: { "Content-Type": "application/json" },
3044
+ ...xNode ? { x_node: xNode } : {}
3038
3045
  },
3039
3046
  service
3040
3047
  );
@@ -3081,7 +3088,8 @@ function useActionService() {
3081
3088
  async ({
3082
3089
  idAction,
3083
3090
  context,
3084
- service
3091
+ service,
3092
+ xNode
3085
3093
  }) => {
3086
3094
  const jsonData = {
3087
3095
  action_id: idAction,
@@ -3091,7 +3099,8 @@ function useActionService() {
3091
3099
  "/run_action" /* RUN_ACTION_PATH */,
3092
3100
  jsonData,
3093
3101
  {
3094
- headers: { "Content-Type": "application/json" }
3102
+ headers: { "Content-Type": "application/json" },
3103
+ ...xNode ? { x_node: xNode } : {}
3095
3104
  },
3096
3105
  service
3097
3106
  );
@@ -3294,8 +3303,7 @@ function useAuthService() {
3294
3303
  [env]
3295
3304
  );
3296
3305
  const logout = (0, import_react7.useCallback)(
3297
- async (data) => {
3298
- console.log(data);
3306
+ async (service) => {
3299
3307
  return env?.requests?.post(
3300
3308
  "/logout" /* LOGOUT */,
3301
3309
  {},
@@ -3305,7 +3313,8 @@ function useAuthService() {
3305
3313
  },
3306
3314
  withCredentials: true,
3307
3315
  useRefreshToken: true
3308
- }
3316
+ },
3317
+ service
3309
3318
  );
3310
3319
  },
3311
3320
  [env]
@@ -3814,7 +3823,11 @@ function useModelService() {
3814
3823
  });
3815
3824
  }, [env]);
3816
3825
  const getAll = (0, import_react12.useCallback)(
3817
- async ({ data, service }) => {
3826
+ async ({
3827
+ data,
3828
+ service,
3829
+ xNode
3830
+ }) => {
3818
3831
  const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3819
3832
  fields: data.fields,
3820
3833
  groupby: data.groupby
@@ -3840,7 +3853,8 @@ function useModelService() {
3840
3853
  jsonData,
3841
3854
  {
3842
3855
  headers: {
3843
- "Content-Type": "application/json"
3856
+ "Content-Type": "application/json",
3857
+ ...xNode ? { x_node: xNode } : {}
3844
3858
  }
3845
3859
  },
3846
3860
  service
@@ -3917,7 +3931,8 @@ function useModelService() {
3917
3931
  model,
3918
3932
  specification,
3919
3933
  context,
3920
- service
3934
+ service,
3935
+ xNode
3921
3936
  }) => {
3922
3937
  const jsonData = {
3923
3938
  model,
@@ -3933,7 +3948,8 @@ function useModelService() {
3933
3948
  jsonData,
3934
3949
  {
3935
3950
  headers: {
3936
- "Content-Type": "application/json"
3951
+ "Content-Type": "application/json",
3952
+ ...xNode ? { x_node: xNode } : {}
3937
3953
  }
3938
3954
  },
3939
3955
  service
@@ -3949,7 +3965,8 @@ function useModelService() {
3949
3965
  specification = {},
3950
3966
  context = {},
3951
3967
  path,
3952
- service
3968
+ service,
3969
+ xNode
3953
3970
  }) => {
3954
3971
  const jsonData = {
3955
3972
  model,
@@ -3966,7 +3983,8 @@ function useModelService() {
3966
3983
  jsonData,
3967
3984
  {
3968
3985
  headers: {
3969
- "Content-Type": "application/json"
3986
+ "Content-Type": "application/json",
3987
+ ...xNode ? { x_node: xNode } : {}
3970
3988
  }
3971
3989
  },
3972
3990
  service
@@ -4002,7 +4020,8 @@ function useModelService() {
4002
4020
  specification,
4003
4021
  context,
4004
4022
  fieldChange,
4005
- service
4023
+ service,
4024
+ xNode
4006
4025
  }) => {
4007
4026
  const jsonData = {
4008
4027
  model,
@@ -4020,7 +4039,8 @@ function useModelService() {
4020
4039
  jsonData,
4021
4040
  {
4022
4041
  headers: {
4023
- "Content-Type": "application/json"
4042
+ "Content-Type": "application/json",
4043
+ ...xNode ? { x_node: xNode } : {}
4024
4044
  }
4025
4045
  },
4026
4046
  service
@@ -4029,7 +4049,11 @@ function useModelService() {
4029
4049
  [env]
4030
4050
  );
4031
4051
  const getListFieldsOnchange = (0, import_react12.useCallback)(
4032
- async ({ model, service }) => {
4052
+ async ({
4053
+ model,
4054
+ service,
4055
+ xNode
4056
+ }) => {
4033
4057
  const jsonData = {
4034
4058
  model,
4035
4059
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
@@ -4039,7 +4063,8 @@ function useModelService() {
4039
4063
  jsonData,
4040
4064
  {
4041
4065
  headers: {
4042
- "Content-Type": "application/json"
4066
+ "Content-Type": "application/json",
4067
+ ...xNode ? { x_node: xNode } : {}
4043
4068
  }
4044
4069
  },
4045
4070
  service
@@ -4204,7 +4229,8 @@ function useViewService() {
4204
4229
  context = {},
4205
4230
  options = {},
4206
4231
  aid,
4207
- service
4232
+ service,
4233
+ xNode
4208
4234
  }) => {
4209
4235
  const defaultOptions = {
4210
4236
  load_filters: true,
@@ -4225,7 +4251,8 @@ function useViewService() {
4225
4251
  jsonDataView,
4226
4252
  {
4227
4253
  headers: {
4228
- "Content-Type": "application/json"
4254
+ "Content-Type": "application/json",
4255
+ ...xNode ? { x_node: xNode } : {}
4229
4256
  }
4230
4257
  },
4231
4258
  service
@@ -4313,7 +4340,11 @@ function useViewService() {
4313
4340
  [env]
4314
4341
  );
4315
4342
  const getSelectionItem = (0, import_react14.useCallback)(
4316
- async ({ data, service }) => {
4343
+ async ({
4344
+ data,
4345
+ service,
4346
+ xNode
4347
+ }) => {
4317
4348
  const jsonData = {
4318
4349
  model: data.model,
4319
4350
  ids: [],
@@ -4336,7 +4367,8 @@ function useViewService() {
4336
4367
  jsonData,
4337
4368
  {
4338
4369
  headers: {
4339
- "Content-Type": "application/json"
4370
+ "Content-Type": "application/json",
4371
+ ...xNode ? { x_node: xNode } : {}
4340
4372
  }
4341
4373
  },
4342
4374
  service
@@ -4675,8 +4707,8 @@ var import_react_query12 = require("@tanstack/react-query");
4675
4707
  var useLogout = () => {
4676
4708
  const { logout } = useAuthService();
4677
4709
  return (0, import_react_query12.useMutation)({
4678
- mutationFn: (data) => {
4679
- return logout(data);
4710
+ mutationFn: (service) => {
4711
+ return logout(service);
4680
4712
  }
4681
4713
  });
4682
4714
  };
@@ -5084,13 +5116,15 @@ var useGetDetail = () => {
5084
5116
  ids,
5085
5117
  specification,
5086
5118
  context,
5087
- service
5119
+ service,
5120
+ xNode
5088
5121
  }) => getDetail({
5089
5122
  model,
5090
5123
  ids,
5091
5124
  specification,
5092
5125
  context,
5093
- service
5126
+ service,
5127
+ xNode
5094
5128
  })
5095
5129
  });
5096
5130
  };
@@ -5100,14 +5134,16 @@ var use_get_detail_default = useGetDetail;
5100
5134
  var import_react_query38 = require("@tanstack/react-query");
5101
5135
  var useGetFieldOnChange = ({
5102
5136
  model,
5103
- service
5137
+ service,
5138
+ xNode
5104
5139
  }) => {
5105
5140
  const { getListFieldsOnchange } = useModelService();
5106
5141
  return (0, import_react_query38.useQuery)({
5107
5142
  queryKey: [`field-onchange-${model}`, model],
5108
5143
  queryFn: () => getListFieldsOnchange({
5109
5144
  model,
5110
- service
5145
+ service,
5146
+ xNode
5111
5147
  }).then((res) => {
5112
5148
  if (res) {
5113
5149
  return res;
@@ -5147,12 +5183,10 @@ var use_get_list_my_bank_account_default = useGetListMyBankAccount;
5147
5183
  var BaseModel = class {
5148
5184
  name;
5149
5185
  view;
5150
- actContext;
5151
5186
  fields;
5152
5187
  constructor(init) {
5153
5188
  this.name = init.name;
5154
5189
  this.view = init.view;
5155
- this.actContext = init.actContext;
5156
5190
  this.fields = init.fields;
5157
5191
  }
5158
5192
  getSpecificationByFields({
@@ -5292,7 +5326,8 @@ var useOnChangeForm = () => {
5292
5326
  context,
5293
5327
  object,
5294
5328
  fieldChange,
5295
- service
5329
+ service,
5330
+ xNode
5296
5331
  }) => onChange({
5297
5332
  ids,
5298
5333
  model,
@@ -5300,7 +5335,8 @@ var useOnChangeForm = () => {
5300
5335
  context,
5301
5336
  object,
5302
5337
  fieldChange,
5303
- service
5338
+ service,
5339
+ xNode
5304
5340
  })
5305
5341
  });
5306
5342
  };
@@ -5318,8 +5354,9 @@ var useSave = () => {
5318
5354
  specification,
5319
5355
  context,
5320
5356
  path,
5321
- service
5322
- }) => save({ ids, model, data, specification, context, path, service })
5357
+ service,
5358
+ xNode
5359
+ }) => save({ ids, model, data, specification, context, path, service, xNode })
5323
5360
  });
5324
5361
  };
5325
5362
  var use_save_default = useSave;
@@ -5372,13 +5409,15 @@ var useButton = () => {
5372
5409
  ids,
5373
5410
  context,
5374
5411
  method,
5375
- service
5412
+ service,
5413
+ xNode
5376
5414
  }) => callButton({
5377
5415
  model,
5378
5416
  ids,
5379
5417
  context,
5380
5418
  method,
5381
- service
5419
+ service,
5420
+ xNode
5382
5421
  }),
5383
5422
  onSuccess: (response) => {
5384
5423
  return response;
@@ -5396,12 +5435,14 @@ var useDuplicateRecord = () => {
5396
5435
  id,
5397
5436
  model,
5398
5437
  context,
5399
- service
5438
+ service,
5439
+ xNode
5400
5440
  }) => duplicateRecord({
5401
5441
  id,
5402
5442
  model,
5403
5443
  context,
5404
- service
5444
+ service,
5445
+ xNode
5405
5446
  })
5406
5447
  });
5407
5448
  };
@@ -5484,11 +5525,11 @@ var use_get_groups_default = useGetGroups;
5484
5525
 
5485
5526
  // src/hooks/view/use-get-list-data.ts
5486
5527
  var import_react_query50 = require("@tanstack/react-query");
5487
- var useGetListData = (listDataProps, queryKey, enabled, service) => {
5528
+ var useGetListData = (listDataProps, queryKey, enabled, service, xNode) => {
5488
5529
  const { getAll } = useModelService();
5489
5530
  return (0, import_react_query50.useQuery)({
5490
5531
  queryKey,
5491
- queryFn: () => getAll({ data: listDataProps, service }).then((res) => {
5532
+ queryFn: () => getAll({ data: listDataProps, service, xNode }).then((res) => {
5492
5533
  if (res) {
5493
5534
  return res;
5494
5535
  }
@@ -5496,7 +5537,8 @@ var useGetListData = (listDataProps, queryKey, enabled, service) => {
5496
5537
  }),
5497
5538
  enabled,
5498
5539
  refetchOnWindowFocus: false,
5499
- staleTime: 0
5540
+ staleTime: 0,
5541
+ placeholderData: import_react_query50.keepPreviousData
5500
5542
  });
5501
5543
  };
5502
5544
  var use_get_list_data_default = useGetListData;
@@ -5565,12 +5607,13 @@ var useGetSelection = ({
5565
5607
  data,
5566
5608
  queryKey,
5567
5609
  enabled,
5568
- service
5610
+ service,
5611
+ xNode
5569
5612
  }) => {
5570
5613
  const { getSelectionItem } = useViewService();
5571
5614
  return (0, import_react_query54.useQuery)({
5572
5615
  queryKey,
5573
- queryFn: () => getSelectionItem({ data, service }),
5616
+ queryFn: () => getSelectionItem({ data, service, xNode }),
5574
5617
  enabled,
5575
5618
  refetchOnWindowFocus: false
5576
5619
  });
@@ -5599,12 +5642,14 @@ var useLoadAction = () => {
5599
5642
  mutationFn: ({
5600
5643
  idAction,
5601
5644
  context,
5602
- service
5645
+ service,
5646
+ xNode
5603
5647
  }) => {
5604
5648
  return loadAction({
5605
5649
  idAction,
5606
5650
  context,
5607
- service
5651
+ service,
5652
+ xNode
5608
5653
  });
5609
5654
  }
5610
5655
  });
@@ -5646,12 +5691,14 @@ var useRemoveRow = () => {
5646
5691
  model,
5647
5692
  ids,
5648
5693
  context,
5649
- service
5694
+ service,
5695
+ xNode
5650
5696
  }) => removeRows({
5651
5697
  model,
5652
5698
  ids,
5653
5699
  context,
5654
- service
5700
+ service,
5701
+ xNode
5655
5702
  })
5656
5703
  });
5657
5704
  };
@@ -5683,11 +5730,13 @@ var useRunAction = () => {
5683
5730
  mutationFn: ({
5684
5731
  idAction,
5685
5732
  context,
5686
- service
5733
+ service,
5734
+ xNode
5687
5735
  }) => runAction({
5688
5736
  idAction,
5689
5737
  context,
5690
- service
5738
+ service,
5739
+ xNode
5691
5740
  })
5692
5741
  });
5693
5742
  };