@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/services.js CHANGED
@@ -3064,7 +3064,8 @@ function useActionService() {
3064
3064
  async ({
3065
3065
  idAction,
3066
3066
  context,
3067
- service
3067
+ service,
3068
+ xNode
3068
3069
  }) => {
3069
3070
  const jsonData = {
3070
3071
  action_id: idAction,
@@ -3074,7 +3075,7 @@ function useActionService() {
3074
3075
  "/load_action" /* LOAD_ACTION */,
3075
3076
  jsonData,
3076
3077
  {
3077
- headers: { "Content-Type": "application/json" }
3078
+ headers: { "Content-Type": "application/json", x_node: xNode }
3078
3079
  },
3079
3080
  service
3080
3081
  );
@@ -3087,7 +3088,8 @@ function useActionService() {
3087
3088
  ids = [],
3088
3089
  context,
3089
3090
  method,
3090
- service
3091
+ service,
3092
+ xNode
3091
3093
  }) => {
3092
3094
  try {
3093
3095
  const jsonData = {
@@ -3100,7 +3102,8 @@ function useActionService() {
3100
3102
  "/call" /* CALL_PATH */,
3101
3103
  jsonData,
3102
3104
  {
3103
- headers: { "Content-Type": "application/json" }
3105
+ headers: { "Content-Type": "application/json" },
3106
+ ...xNode ? { x_node: xNode } : {}
3104
3107
  },
3105
3108
  service
3106
3109
  );
@@ -3116,7 +3119,8 @@ function useActionService() {
3116
3119
  model,
3117
3120
  ids,
3118
3121
  context,
3119
- service
3122
+ service,
3123
+ xNode
3120
3124
  }) => {
3121
3125
  const jsonData = {
3122
3126
  model,
@@ -3128,7 +3132,8 @@ function useActionService() {
3128
3132
  "/call" /* CALL_PATH */,
3129
3133
  jsonData,
3130
3134
  {
3131
- headers: { "Content-Type": "application/json" }
3135
+ headers: { "Content-Type": "application/json" },
3136
+ ...xNode ? { x_node: xNode } : {}
3132
3137
  },
3133
3138
  service
3134
3139
  );
@@ -3140,7 +3145,8 @@ function useActionService() {
3140
3145
  model,
3141
3146
  id,
3142
3147
  context,
3143
- service
3148
+ service,
3149
+ xNode
3144
3150
  }) => {
3145
3151
  const jsonData = {
3146
3152
  model,
@@ -3152,7 +3158,8 @@ function useActionService() {
3152
3158
  "/call" /* CALL_PATH */,
3153
3159
  jsonData,
3154
3160
  {
3155
- headers: { "Content-Type": "application/json" }
3161
+ headers: { "Content-Type": "application/json" },
3162
+ ...xNode ? { x_node: xNode } : {}
3156
3163
  },
3157
3164
  service
3158
3165
  );
@@ -3199,7 +3206,8 @@ function useActionService() {
3199
3206
  async ({
3200
3207
  idAction,
3201
3208
  context,
3202
- service
3209
+ service,
3210
+ xNode
3203
3211
  }) => {
3204
3212
  const jsonData = {
3205
3213
  action_id: idAction,
@@ -3209,7 +3217,8 @@ function useActionService() {
3209
3217
  "/run_action" /* RUN_ACTION_PATH */,
3210
3218
  jsonData,
3211
3219
  {
3212
- headers: { "Content-Type": "application/json" }
3220
+ headers: { "Content-Type": "application/json" },
3221
+ ...xNode ? { x_node: xNode } : {}
3213
3222
  },
3214
3223
  service
3215
3224
  );
@@ -3412,8 +3421,7 @@ function useAuthService() {
3412
3421
  [env]
3413
3422
  );
3414
3423
  const logout = (0, import_react7.useCallback)(
3415
- async (data) => {
3416
- console.log(data);
3424
+ async (service) => {
3417
3425
  return env?.requests?.post(
3418
3426
  "/logout" /* LOGOUT */,
3419
3427
  {},
@@ -3423,7 +3431,8 @@ function useAuthService() {
3423
3431
  },
3424
3432
  withCredentials: true,
3425
3433
  useRefreshToken: true
3426
- }
3434
+ },
3435
+ service
3427
3436
  );
3428
3437
  },
3429
3438
  [env]
@@ -3932,7 +3941,11 @@ function useModelService() {
3932
3941
  });
3933
3942
  }, [env]);
3934
3943
  const getAll = (0, import_react12.useCallback)(
3935
- async ({ data, service }) => {
3944
+ async ({
3945
+ data,
3946
+ service,
3947
+ xNode
3948
+ }) => {
3936
3949
  const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3937
3950
  fields: data.fields,
3938
3951
  groupby: data.groupby
@@ -3958,7 +3971,8 @@ function useModelService() {
3958
3971
  jsonData,
3959
3972
  {
3960
3973
  headers: {
3961
- "Content-Type": "application/json"
3974
+ "Content-Type": "application/json",
3975
+ ...xNode ? { x_node: xNode } : {}
3962
3976
  }
3963
3977
  },
3964
3978
  service
@@ -4035,7 +4049,8 @@ function useModelService() {
4035
4049
  model,
4036
4050
  specification,
4037
4051
  context,
4038
- service
4052
+ service,
4053
+ xNode
4039
4054
  }) => {
4040
4055
  const jsonData = {
4041
4056
  model,
@@ -4051,7 +4066,8 @@ function useModelService() {
4051
4066
  jsonData,
4052
4067
  {
4053
4068
  headers: {
4054
- "Content-Type": "application/json"
4069
+ "Content-Type": "application/json",
4070
+ ...xNode ? { x_node: xNode } : {}
4055
4071
  }
4056
4072
  },
4057
4073
  service
@@ -4067,7 +4083,8 @@ function useModelService() {
4067
4083
  specification = {},
4068
4084
  context = {},
4069
4085
  path,
4070
- service
4086
+ service,
4087
+ xNode
4071
4088
  }) => {
4072
4089
  const jsonData = {
4073
4090
  model,
@@ -4084,7 +4101,8 @@ function useModelService() {
4084
4101
  jsonData,
4085
4102
  {
4086
4103
  headers: {
4087
- "Content-Type": "application/json"
4104
+ "Content-Type": "application/json",
4105
+ ...xNode ? { x_node: xNode } : {}
4088
4106
  }
4089
4107
  },
4090
4108
  service
@@ -4120,7 +4138,8 @@ function useModelService() {
4120
4138
  specification,
4121
4139
  context,
4122
4140
  fieldChange,
4123
- service
4141
+ service,
4142
+ xNode
4124
4143
  }) => {
4125
4144
  const jsonData = {
4126
4145
  model,
@@ -4138,7 +4157,8 @@ function useModelService() {
4138
4157
  jsonData,
4139
4158
  {
4140
4159
  headers: {
4141
- "Content-Type": "application/json"
4160
+ "Content-Type": "application/json",
4161
+ ...xNode ? { x_node: xNode } : {}
4142
4162
  }
4143
4163
  },
4144
4164
  service
@@ -4147,7 +4167,11 @@ function useModelService() {
4147
4167
  [env]
4148
4168
  );
4149
4169
  const getListFieldsOnchange = (0, import_react12.useCallback)(
4150
- async ({ model, service }) => {
4170
+ async ({
4171
+ model,
4172
+ service,
4173
+ xNode
4174
+ }) => {
4151
4175
  const jsonData = {
4152
4176
  model,
4153
4177
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
@@ -4157,7 +4181,8 @@ function useModelService() {
4157
4181
  jsonData,
4158
4182
  {
4159
4183
  headers: {
4160
- "Content-Type": "application/json"
4184
+ "Content-Type": "application/json",
4185
+ ...xNode ? { x_node: xNode } : {}
4161
4186
  }
4162
4187
  },
4163
4188
  service
@@ -4322,7 +4347,8 @@ function useViewService() {
4322
4347
  context = {},
4323
4348
  options = {},
4324
4349
  aid,
4325
- service
4350
+ service,
4351
+ xNode
4326
4352
  }) => {
4327
4353
  const defaultOptions = {
4328
4354
  load_filters: true,
@@ -4343,7 +4369,8 @@ function useViewService() {
4343
4369
  jsonDataView,
4344
4370
  {
4345
4371
  headers: {
4346
- "Content-Type": "application/json"
4372
+ "Content-Type": "application/json",
4373
+ ...xNode ? { x_node: xNode } : {}
4347
4374
  }
4348
4375
  },
4349
4376
  service
@@ -4431,7 +4458,11 @@ function useViewService() {
4431
4458
  [env]
4432
4459
  );
4433
4460
  const getSelectionItem = (0, import_react14.useCallback)(
4434
- async ({ data, service }) => {
4461
+ async ({
4462
+ data,
4463
+ service,
4464
+ xNode
4465
+ }) => {
4435
4466
  const jsonData = {
4436
4467
  model: data.model,
4437
4468
  ids: [],
@@ -4454,7 +4485,8 @@ function useViewService() {
4454
4485
  jsonData,
4455
4486
  {
4456
4487
  headers: {
4457
- "Content-Type": "application/json"
4488
+ "Content-Type": "application/json",
4489
+ ...xNode ? { x_node: xNode } : {}
4458
4490
  }
4459
4491
  },
4460
4492
  service
package/dist/services.mjs CHANGED
@@ -2946,7 +2946,7 @@ import { useQuery as useQuery12 } from "@tanstack/react-query";
2946
2946
  import { useQuery as useQuery13 } from "@tanstack/react-query";
2947
2947
 
2948
2948
  // src/hooks/view/use-get-list-data.ts
2949
- import { useQuery as useQuery14 } from "@tanstack/react-query";
2949
+ import { keepPreviousData, useQuery as useQuery14 } from "@tanstack/react-query";
2950
2950
 
2951
2951
  // src/hooks/view/use-get-menu.ts
2952
2952
  import { useQuery as useQuery15 } from "@tanstack/react-query";
@@ -3020,7 +3020,8 @@ function useActionService() {
3020
3020
  async ({
3021
3021
  idAction,
3022
3022
  context,
3023
- service
3023
+ service,
3024
+ xNode
3024
3025
  }) => {
3025
3026
  const jsonData = {
3026
3027
  action_id: idAction,
@@ -3030,7 +3031,7 @@ function useActionService() {
3030
3031
  "/load_action" /* LOAD_ACTION */,
3031
3032
  jsonData,
3032
3033
  {
3033
- headers: { "Content-Type": "application/json" }
3034
+ headers: { "Content-Type": "application/json", x_node: xNode }
3034
3035
  },
3035
3036
  service
3036
3037
  );
@@ -3043,7 +3044,8 @@ function useActionService() {
3043
3044
  ids = [],
3044
3045
  context,
3045
3046
  method,
3046
- service
3047
+ service,
3048
+ xNode
3047
3049
  }) => {
3048
3050
  try {
3049
3051
  const jsonData = {
@@ -3056,7 +3058,8 @@ function useActionService() {
3056
3058
  "/call" /* CALL_PATH */,
3057
3059
  jsonData,
3058
3060
  {
3059
- headers: { "Content-Type": "application/json" }
3061
+ headers: { "Content-Type": "application/json" },
3062
+ ...xNode ? { x_node: xNode } : {}
3060
3063
  },
3061
3064
  service
3062
3065
  );
@@ -3072,7 +3075,8 @@ function useActionService() {
3072
3075
  model,
3073
3076
  ids,
3074
3077
  context,
3075
- service
3078
+ service,
3079
+ xNode
3076
3080
  }) => {
3077
3081
  const jsonData = {
3078
3082
  model,
@@ -3084,7 +3088,8 @@ function useActionService() {
3084
3088
  "/call" /* CALL_PATH */,
3085
3089
  jsonData,
3086
3090
  {
3087
- headers: { "Content-Type": "application/json" }
3091
+ headers: { "Content-Type": "application/json" },
3092
+ ...xNode ? { x_node: xNode } : {}
3088
3093
  },
3089
3094
  service
3090
3095
  );
@@ -3096,7 +3101,8 @@ function useActionService() {
3096
3101
  model,
3097
3102
  id,
3098
3103
  context,
3099
- service
3104
+ service,
3105
+ xNode
3100
3106
  }) => {
3101
3107
  const jsonData = {
3102
3108
  model,
@@ -3108,7 +3114,8 @@ function useActionService() {
3108
3114
  "/call" /* CALL_PATH */,
3109
3115
  jsonData,
3110
3116
  {
3111
- headers: { "Content-Type": "application/json" }
3117
+ headers: { "Content-Type": "application/json" },
3118
+ ...xNode ? { x_node: xNode } : {}
3112
3119
  },
3113
3120
  service
3114
3121
  );
@@ -3155,7 +3162,8 @@ function useActionService() {
3155
3162
  async ({
3156
3163
  idAction,
3157
3164
  context,
3158
- service
3165
+ service,
3166
+ xNode
3159
3167
  }) => {
3160
3168
  const jsonData = {
3161
3169
  action_id: idAction,
@@ -3165,7 +3173,8 @@ function useActionService() {
3165
3173
  "/run_action" /* RUN_ACTION_PATH */,
3166
3174
  jsonData,
3167
3175
  {
3168
- headers: { "Content-Type": "application/json" }
3176
+ headers: { "Content-Type": "application/json" },
3177
+ ...xNode ? { x_node: xNode } : {}
3169
3178
  },
3170
3179
  service
3171
3180
  );
@@ -3368,8 +3377,7 @@ function useAuthService() {
3368
3377
  [env]
3369
3378
  );
3370
3379
  const logout = useCallback3(
3371
- async (data) => {
3372
- console.log(data);
3380
+ async (service) => {
3373
3381
  return env?.requests?.post(
3374
3382
  "/logout" /* LOGOUT */,
3375
3383
  {},
@@ -3379,7 +3387,8 @@ function useAuthService() {
3379
3387
  },
3380
3388
  withCredentials: true,
3381
3389
  useRefreshToken: true
3382
- }
3390
+ },
3391
+ service
3383
3392
  );
3384
3393
  },
3385
3394
  [env]
@@ -3888,7 +3897,11 @@ function useModelService() {
3888
3897
  });
3889
3898
  }, [env]);
3890
3899
  const getAll = useCallback8(
3891
- async ({ data, service }) => {
3900
+ async ({
3901
+ data,
3902
+ service,
3903
+ xNode
3904
+ }) => {
3892
3905
  const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3893
3906
  fields: data.fields,
3894
3907
  groupby: data.groupby
@@ -3914,7 +3927,8 @@ function useModelService() {
3914
3927
  jsonData,
3915
3928
  {
3916
3929
  headers: {
3917
- "Content-Type": "application/json"
3930
+ "Content-Type": "application/json",
3931
+ ...xNode ? { x_node: xNode } : {}
3918
3932
  }
3919
3933
  },
3920
3934
  service
@@ -3991,7 +4005,8 @@ function useModelService() {
3991
4005
  model,
3992
4006
  specification,
3993
4007
  context,
3994
- service
4008
+ service,
4009
+ xNode
3995
4010
  }) => {
3996
4011
  const jsonData = {
3997
4012
  model,
@@ -4007,7 +4022,8 @@ function useModelService() {
4007
4022
  jsonData,
4008
4023
  {
4009
4024
  headers: {
4010
- "Content-Type": "application/json"
4025
+ "Content-Type": "application/json",
4026
+ ...xNode ? { x_node: xNode } : {}
4011
4027
  }
4012
4028
  },
4013
4029
  service
@@ -4023,7 +4039,8 @@ function useModelService() {
4023
4039
  specification = {},
4024
4040
  context = {},
4025
4041
  path,
4026
- service
4042
+ service,
4043
+ xNode
4027
4044
  }) => {
4028
4045
  const jsonData = {
4029
4046
  model,
@@ -4040,7 +4057,8 @@ function useModelService() {
4040
4057
  jsonData,
4041
4058
  {
4042
4059
  headers: {
4043
- "Content-Type": "application/json"
4060
+ "Content-Type": "application/json",
4061
+ ...xNode ? { x_node: xNode } : {}
4044
4062
  }
4045
4063
  },
4046
4064
  service
@@ -4076,7 +4094,8 @@ function useModelService() {
4076
4094
  specification,
4077
4095
  context,
4078
4096
  fieldChange,
4079
- service
4097
+ service,
4098
+ xNode
4080
4099
  }) => {
4081
4100
  const jsonData = {
4082
4101
  model,
@@ -4094,7 +4113,8 @@ function useModelService() {
4094
4113
  jsonData,
4095
4114
  {
4096
4115
  headers: {
4097
- "Content-Type": "application/json"
4116
+ "Content-Type": "application/json",
4117
+ ...xNode ? { x_node: xNode } : {}
4098
4118
  }
4099
4119
  },
4100
4120
  service
@@ -4103,7 +4123,11 @@ function useModelService() {
4103
4123
  [env]
4104
4124
  );
4105
4125
  const getListFieldsOnchange = useCallback8(
4106
- async ({ model, service }) => {
4126
+ async ({
4127
+ model,
4128
+ service,
4129
+ xNode
4130
+ }) => {
4107
4131
  const jsonData = {
4108
4132
  model,
4109
4133
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
@@ -4113,7 +4137,8 @@ function useModelService() {
4113
4137
  jsonData,
4114
4138
  {
4115
4139
  headers: {
4116
- "Content-Type": "application/json"
4140
+ "Content-Type": "application/json",
4141
+ ...xNode ? { x_node: xNode } : {}
4117
4142
  }
4118
4143
  },
4119
4144
  service
@@ -4278,7 +4303,8 @@ function useViewService() {
4278
4303
  context = {},
4279
4304
  options = {},
4280
4305
  aid,
4281
- service
4306
+ service,
4307
+ xNode
4282
4308
  }) => {
4283
4309
  const defaultOptions = {
4284
4310
  load_filters: true,
@@ -4299,7 +4325,8 @@ function useViewService() {
4299
4325
  jsonDataView,
4300
4326
  {
4301
4327
  headers: {
4302
- "Content-Type": "application/json"
4328
+ "Content-Type": "application/json",
4329
+ ...xNode ? { x_node: xNode } : {}
4303
4330
  }
4304
4331
  },
4305
4332
  service
@@ -4387,7 +4414,11 @@ function useViewService() {
4387
4414
  [env]
4388
4415
  );
4389
4416
  const getSelectionItem = useCallback10(
4390
- async ({ data, service }) => {
4417
+ async ({
4418
+ data,
4419
+ service,
4420
+ xNode
4421
+ }) => {
4391
4422
  const jsonData = {
4392
4423
  model: data.model,
4393
4424
  ids: [],
@@ -4410,7 +4441,8 @@ function useViewService() {
4410
4441
  jsonData,
4411
4442
  {
4412
4443
  headers: {
4413
- "Content-Type": "application/json"
4444
+ "Content-Type": "application/json",
4445
+ ...xNode ? { x_node: xNode } : {}
4414
4446
  }
4415
4447
  },
4416
4448
  service
package/dist/types.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, f as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-p4JdAOsz.mjs';
1
+ export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, f as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-xxw9OeSR.mjs';
2
2
 
3
3
  interface Config {
4
4
  baseUrl: string;
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, f as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-p4JdAOsz.js';
1
+ export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, f as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-xxw9OeSR.js';
2
2
 
3
3
  interface Config {
4
4
  baseUrl: string;
package/dist/utils.d.mts CHANGED
@@ -50,13 +50,14 @@ declare const convertFloatToTime: (floatValue: number) => string;
50
50
  declare const convertTimeToFloat: (timeString: string) => number;
51
51
  declare const stringToColor: (name: string, id: number) => string;
52
52
  declare const getFieldsOnChange: (fields: any) => any;
53
- declare const filterFieldDirty: ({ id, viewData, formValues, dirtyFields, model, defaultData, }: {
53
+ declare const filterFieldDirty: ({ id, viewData, formValues, dirtyFields, model, defaultData, keepZeroValue, }: {
54
54
  id?: any;
55
55
  viewData?: any;
56
56
  formValues?: any;
57
57
  dirtyFields?: any;
58
58
  model?: any;
59
59
  defaultData?: any;
60
+ keepZeroValue?: boolean;
60
61
  }) => any;
61
62
  type MergeableObject = {
62
63
  [key: string]: any;
package/dist/utils.d.ts CHANGED
@@ -50,13 +50,14 @@ declare const convertFloatToTime: (floatValue: number) => string;
50
50
  declare const convertTimeToFloat: (timeString: string) => number;
51
51
  declare const stringToColor: (name: string, id: number) => string;
52
52
  declare const getFieldsOnChange: (fields: any) => any;
53
- declare const filterFieldDirty: ({ id, viewData, formValues, dirtyFields, model, defaultData, }: {
53
+ declare const filterFieldDirty: ({ id, viewData, formValues, dirtyFields, model, defaultData, keepZeroValue, }: {
54
54
  id?: any;
55
55
  viewData?: any;
56
56
  formValues?: any;
57
57
  dirtyFields?: any;
58
58
  model?: any;
59
59
  defaultData?: any;
60
+ keepZeroValue?: boolean;
60
61
  }) => any;
61
62
  type MergeableObject = {
62
63
  [key: string]: any;
package/dist/utils.js CHANGED
@@ -2654,7 +2654,8 @@ var filterFieldDirty = ({
2654
2654
  formValues,
2655
2655
  dirtyFields,
2656
2656
  model,
2657
- defaultData
2657
+ defaultData,
2658
+ keepZeroValue = false
2658
2659
  }) => {
2659
2660
  const data = id ? { ...dirtyFields } : { ...formValues };
2660
2661
  for (const key in data) {
@@ -2674,7 +2675,8 @@ var filterFieldDirty = ({
2674
2675
  formValues: itemData,
2675
2676
  dirtyFields: {},
2676
2677
  model: viewData?.models?.[model]?.[key]?.relation,
2677
- defaultData
2678
+ defaultData,
2679
+ keepZeroValue
2678
2680
  })
2679
2681
  ]);
2680
2682
  } else if (dirtyFields[key]?.length) {
@@ -2689,7 +2691,8 @@ var filterFieldDirty = ({
2689
2691
  formValues: itemData,
2690
2692
  dirtyFields: itemDirty,
2691
2693
  model: viewData?.models?.[model]?.[key]?.relation,
2692
- defaultData: {}
2694
+ defaultData: {},
2695
+ keepZeroValue
2693
2696
  })
2694
2697
  ]);
2695
2698
  }
@@ -2721,9 +2724,11 @@ var filterFieldDirty = ({
2721
2724
  data[key] = lineData;
2722
2725
  } else {
2723
2726
  if (id && (typeof dirtyFields?.[key] === "object" && !dirtyFields?.[key]?.id || typeof dirtyFields[key] !== "object" && !dirtyFields[key])) {
2724
- delete data[key];
2727
+ if (!(keepZeroValue && (formValues[key] === 0 || formValues[key] === "0"))) {
2728
+ delete data[key];
2729
+ }
2725
2730
  } else {
2726
- if (!data[key]) {
2731
+ if (!data[key] && !(keepZeroValue && (data[key] === 0 || data[key] === "0"))) {
2727
2732
  delete data[key];
2728
2733
  } else {
2729
2734
  data[key] = formValues?.[key]?.display_name ? formValues?.[key]?.id : formValues?.[key];
package/dist/utils.mjs CHANGED
@@ -2589,7 +2589,8 @@ var filterFieldDirty = ({
2589
2589
  formValues,
2590
2590
  dirtyFields,
2591
2591
  model,
2592
- defaultData
2592
+ defaultData,
2593
+ keepZeroValue = false
2593
2594
  }) => {
2594
2595
  const data = id ? { ...dirtyFields } : { ...formValues };
2595
2596
  for (const key in data) {
@@ -2609,7 +2610,8 @@ var filterFieldDirty = ({
2609
2610
  formValues: itemData,
2610
2611
  dirtyFields: {},
2611
2612
  model: viewData?.models?.[model]?.[key]?.relation,
2612
- defaultData
2613
+ defaultData,
2614
+ keepZeroValue
2613
2615
  })
2614
2616
  ]);
2615
2617
  } else if (dirtyFields[key]?.length) {
@@ -2624,7 +2626,8 @@ var filterFieldDirty = ({
2624
2626
  formValues: itemData,
2625
2627
  dirtyFields: itemDirty,
2626
2628
  model: viewData?.models?.[model]?.[key]?.relation,
2627
- defaultData: {}
2629
+ defaultData: {},
2630
+ keepZeroValue
2628
2631
  })
2629
2632
  ]);
2630
2633
  }
@@ -2656,9 +2659,11 @@ var filterFieldDirty = ({
2656
2659
  data[key] = lineData;
2657
2660
  } else {
2658
2661
  if (id && (typeof dirtyFields?.[key] === "object" && !dirtyFields?.[key]?.id || typeof dirtyFields[key] !== "object" && !dirtyFields[key])) {
2659
- delete data[key];
2662
+ if (!(keepZeroValue && (formValues[key] === 0 || formValues[key] === "0"))) {
2663
+ delete data[key];
2664
+ }
2660
2665
  } else {
2661
- if (!data[key]) {
2666
+ if (!data[key] && !(keepZeroValue && (data[key] === 0 || data[key] === "0"))) {
2662
2667
  delete data[key];
2663
2668
  } else {
2664
2669
  data[key] = formValues?.[key]?.display_name ? formValues?.[key]?.id : formValues?.[key];
@@ -59,6 +59,7 @@ interface GetDetailParams {
59
59
  specification?: Specification;
60
60
  context?: ContextApi;
61
61
  service?: string;
62
+ xNode?: string;
62
63
  }
63
64
  interface SaveParams {
64
65
  model: string;
@@ -68,6 +69,7 @@ interface SaveParams {
68
69
  context?: ContextApi;
69
70
  path?: string;
70
71
  service?: string;
72
+ xNode?: string;
71
73
  }
72
74
  interface DeleteParams {
73
75
  ids?: number[];
@@ -82,6 +84,7 @@ interface OnChangeParams {
82
84
  context?: ContextApi;
83
85
  fieldChange?: string[];
84
86
  service?: string;
87
+ xNode?: string;
85
88
  }
86
89
  interface ViewData {
87
90
  models?: {
@@ -113,6 +116,7 @@ interface GetViewParams {
113
116
  options?: Option;
114
117
  aid?: number | string | null | boolean;
115
118
  service?: string;
119
+ xNode?: string;
116
120
  }
117
121
 
118
122
  export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetAllParams as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SaveParams as S, UpdatePasswordRequest as U, ViewData as V, GetDetailParams as a, GetListParams as b, GetSelectionType as c, SocialTokenBody as d, Specification as e, GetViewParams as f, View as g, updatePasswordBody as u };