@fctc/widget-logic 1.3.0 → 1.3.2

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.
Files changed (65) hide show
  1. package/dist/config.d.mts +7 -0
  2. package/dist/config.d.ts +7 -0
  3. package/dist/config.js +24 -0
  4. package/dist/config.mjs +2 -0
  5. package/dist/constants.d.mts +1 -0
  6. package/dist/constants.d.ts +1 -0
  7. package/dist/constants.js +24 -0
  8. package/dist/constants.mjs +2 -0
  9. package/dist/environment.d.mts +1 -0
  10. package/dist/environment.d.ts +1 -0
  11. package/dist/environment.js +24 -0
  12. package/dist/environment.mjs +2 -0
  13. package/dist/hooks.d.mts +970 -0
  14. package/dist/hooks.d.ts +970 -0
  15. package/dist/hooks.js +734 -0
  16. package/dist/hooks.mjs +720 -0
  17. package/dist/icons.d.mts +9 -0
  18. package/dist/icons.d.ts +9 -0
  19. package/dist/icons.js +139 -0
  20. package/dist/icons.mjs +110 -0
  21. package/dist/index.d.mts +314 -5
  22. package/dist/index.d.ts +314 -5
  23. package/dist/index.js +7216 -231
  24. package/dist/index.mjs +7340 -221
  25. package/dist/model.d.mts +1 -0
  26. package/dist/model.d.ts +1 -0
  27. package/dist/model.js +24 -0
  28. package/dist/model.mjs +2 -0
  29. package/dist/provider.d.mts +1 -0
  30. package/dist/provider.d.ts +1 -0
  31. package/dist/provider.js +24 -0
  32. package/dist/provider.mjs +2 -0
  33. package/dist/services.d.mts +1 -0
  34. package/dist/services.d.ts +1 -0
  35. package/dist/services.js +24 -0
  36. package/dist/services.mjs +2 -0
  37. package/dist/store.d.mts +1 -0
  38. package/dist/store.d.ts +1 -0
  39. package/dist/store.js +24 -0
  40. package/dist/store.mjs +2 -0
  41. package/dist/types.d.mts +31 -0
  42. package/dist/types.d.ts +31 -0
  43. package/dist/types.js +24 -0
  44. package/dist/types.mjs +2 -0
  45. package/dist/utils.d.mts +38 -0
  46. package/dist/utils.d.ts +38 -0
  47. package/dist/utils.js +282 -0
  48. package/dist/utils.mjs +242 -0
  49. package/package.json +70 -22
  50. package/dist/action.d.mts +0 -68
  51. package/dist/action.d.ts +0 -68
  52. package/dist/action.js +0 -152
  53. package/dist/action.mjs +0 -122
  54. package/dist/common.d.mts +0 -13
  55. package/dist/common.d.ts +0 -13
  56. package/dist/common.js +0 -60
  57. package/dist/common.mjs +0 -33
  58. package/dist/form.d.mts +0 -41
  59. package/dist/form.d.ts +0 -41
  60. package/dist/form.js +0 -116
  61. package/dist/form.mjs +0 -87
  62. package/dist/table.d.mts +0 -33
  63. package/dist/table.d.ts +0 -33
  64. package/dist/table.js +0 -118
  65. package/dist/table.mjs +0 -91
@@ -0,0 +1,970 @@
1
+ import * as _tanstack_react_query from '@tanstack/react-query';
2
+ import * as _tanstack_query_core from '@tanstack/query-core';
3
+ import * as react from 'react';
4
+ import { RefObject } from 'react';
5
+ import { Context } from '@fctc/interface-logic';
6
+ export * from '@fctc/interface-logic/hooks';
7
+
8
+ declare const useCallAction: () => readonly [ActionResult | undefined, ({ aid, actionType, }: {
9
+ aid: number;
10
+ actionType?: string;
11
+ }) => Promise<ActionResult | undefined>];
12
+ type useCallActionType = ReturnType<typeof useCallAction>;
13
+ type ActionResultType = useCallActionType[0];
14
+ interface ActionResult {
15
+ jsonrpc: '2.0' | string;
16
+ result?: {
17
+ id?: number;
18
+ name?: string;
19
+ type?: 'ir.actions.act_window' | string;
20
+ xml_id?: string;
21
+ path?: false | string;
22
+ help?: string;
23
+ binding_model_id?: false | number;
24
+ binding_type?: 'action' | string;
25
+ binding_view_types?: string;
26
+ display_name?: string;
27
+ view_id?: false | number;
28
+ domain?: false | any[];
29
+ context?: string;
30
+ res_id?: number;
31
+ res_model?: string;
32
+ target?: 'current' | 'new' | string;
33
+ view_mode?: string;
34
+ mobile_view_mode?: string;
35
+ views?: [number, string][];
36
+ limit?: number;
37
+ groups_id?: number[];
38
+ search_view_id?: [number, string];
39
+ embedded_action_ids?: number[];
40
+ filter?: false | any;
41
+ };
42
+ }
43
+
44
+ type EnvData = {
45
+ mode: string;
46
+ baseUrl: string;
47
+ config: {
48
+ grantType: string;
49
+ clientId: string;
50
+ clientSecret: string;
51
+ };
52
+ };
53
+ type ConfigType = {
54
+ VITE_SIDEBAR_TYPE: string;
55
+ VITE_APP_DOMAIN: string;
56
+ VITE_IS_EDU: boolean;
57
+ VITE_LOGO_WHITE_LOGIN: string;
58
+ VITE_LOGO_BLACK_LOGIN: string;
59
+ VITE_BACKGROUND_SIDEBAR: string;
60
+ VITE_BANNER: string;
61
+ VITE_BG_BUTTON: string;
62
+ VITE_BACKGROUND_PAGE: string;
63
+ };
64
+ declare const useConfig: ({ localStorageUtils, sessionStorageUtils }: any) => {
65
+ envConfig: EnvData;
66
+ config: ConfigType;
67
+ };
68
+ type useConfigType = ReturnType<typeof useConfig>;
69
+
70
+ declare const useDetail: (accessToken: string | null, sub?: number) => _tanstack_react_query.UseQueryResult<any, Error>;
71
+
72
+ declare const useViewV2: ({ action, context, }: {
73
+ action: ActionResultType;
74
+ context: any;
75
+ }) => {
76
+ context: any;
77
+ data: ViewResponse;
78
+ error: Error;
79
+ isError: true;
80
+ isPending: false;
81
+ isLoading: false;
82
+ isLoadingError: false;
83
+ isRefetchError: true;
84
+ isSuccess: false;
85
+ isPlaceholderData: false;
86
+ status: "error";
87
+ dataUpdatedAt: number;
88
+ errorUpdatedAt: number;
89
+ failureCount: number;
90
+ failureReason: Error | null;
91
+ errorUpdateCount: number;
92
+ isFetched: boolean;
93
+ isFetchedAfterMount: boolean;
94
+ isFetching: boolean;
95
+ isInitialLoading: boolean;
96
+ isPaused: boolean;
97
+ isRefetching: boolean;
98
+ isStale: boolean;
99
+ isEnabled: boolean;
100
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
101
+ fetchStatus: _tanstack_query_core.FetchStatus;
102
+ promise: Promise<ViewResponse>;
103
+ } | {
104
+ context: any;
105
+ data: ViewResponse;
106
+ error: null;
107
+ isError: false;
108
+ isPending: false;
109
+ isLoading: false;
110
+ isLoadingError: false;
111
+ isRefetchError: false;
112
+ isSuccess: true;
113
+ isPlaceholderData: false;
114
+ status: "success";
115
+ dataUpdatedAt: number;
116
+ errorUpdatedAt: number;
117
+ failureCount: number;
118
+ failureReason: Error | null;
119
+ errorUpdateCount: number;
120
+ isFetched: boolean;
121
+ isFetchedAfterMount: boolean;
122
+ isFetching: boolean;
123
+ isInitialLoading: boolean;
124
+ isPaused: boolean;
125
+ isRefetching: boolean;
126
+ isStale: boolean;
127
+ isEnabled: boolean;
128
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
129
+ fetchStatus: _tanstack_query_core.FetchStatus;
130
+ promise: Promise<ViewResponse>;
131
+ } | {
132
+ context: any;
133
+ data: undefined;
134
+ error: Error;
135
+ isError: true;
136
+ isPending: false;
137
+ isLoading: false;
138
+ isLoadingError: true;
139
+ isRefetchError: false;
140
+ isSuccess: false;
141
+ isPlaceholderData: false;
142
+ status: "error";
143
+ dataUpdatedAt: number;
144
+ errorUpdatedAt: number;
145
+ failureCount: number;
146
+ failureReason: Error | null;
147
+ errorUpdateCount: number;
148
+ isFetched: boolean;
149
+ isFetchedAfterMount: boolean;
150
+ isFetching: boolean;
151
+ isInitialLoading: boolean;
152
+ isPaused: boolean;
153
+ isRefetching: boolean;
154
+ isStale: boolean;
155
+ isEnabled: boolean;
156
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
157
+ fetchStatus: _tanstack_query_core.FetchStatus;
158
+ promise: Promise<ViewResponse>;
159
+ } | {
160
+ context: any;
161
+ data: undefined;
162
+ error: null;
163
+ isError: false;
164
+ isPending: true;
165
+ isLoading: true;
166
+ isLoadingError: false;
167
+ isRefetchError: false;
168
+ isSuccess: false;
169
+ isPlaceholderData: false;
170
+ status: "pending";
171
+ dataUpdatedAt: number;
172
+ errorUpdatedAt: number;
173
+ failureCount: number;
174
+ failureReason: Error | null;
175
+ errorUpdateCount: number;
176
+ isFetched: boolean;
177
+ isFetchedAfterMount: boolean;
178
+ isFetching: boolean;
179
+ isInitialLoading: boolean;
180
+ isPaused: boolean;
181
+ isRefetching: boolean;
182
+ isStale: boolean;
183
+ isEnabled: boolean;
184
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
185
+ fetchStatus: _tanstack_query_core.FetchStatus;
186
+ promise: Promise<ViewResponse>;
187
+ } | {
188
+ context: any;
189
+ data: undefined;
190
+ error: null;
191
+ isError: false;
192
+ isPending: true;
193
+ isLoadingError: false;
194
+ isRefetchError: false;
195
+ isSuccess: false;
196
+ isPlaceholderData: false;
197
+ status: "pending";
198
+ dataUpdatedAt: number;
199
+ errorUpdatedAt: number;
200
+ failureCount: number;
201
+ failureReason: Error | null;
202
+ errorUpdateCount: number;
203
+ isFetched: boolean;
204
+ isFetchedAfterMount: boolean;
205
+ isFetching: boolean;
206
+ isLoading: boolean;
207
+ isInitialLoading: boolean;
208
+ isPaused: boolean;
209
+ isRefetching: boolean;
210
+ isStale: boolean;
211
+ isEnabled: boolean;
212
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
213
+ fetchStatus: _tanstack_query_core.FetchStatus;
214
+ promise: Promise<ViewResponse>;
215
+ } | {
216
+ context: any;
217
+ data: ViewResponse;
218
+ isError: false;
219
+ error: null;
220
+ isPending: false;
221
+ isLoading: false;
222
+ isLoadingError: false;
223
+ isRefetchError: false;
224
+ isSuccess: true;
225
+ isPlaceholderData: true;
226
+ status: "success";
227
+ dataUpdatedAt: number;
228
+ errorUpdatedAt: number;
229
+ failureCount: number;
230
+ failureReason: Error | null;
231
+ errorUpdateCount: number;
232
+ isFetched: boolean;
233
+ isFetchedAfterMount: boolean;
234
+ isFetching: boolean;
235
+ isInitialLoading: boolean;
236
+ isPaused: boolean;
237
+ isRefetching: boolean;
238
+ isStale: boolean;
239
+ isEnabled: boolean;
240
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
241
+ fetchStatus: _tanstack_query_core.FetchStatus;
242
+ promise: Promise<ViewResponse>;
243
+ };
244
+ type useViewV2Type = ReturnType<typeof useViewV2>;
245
+ type ViewResponse = {
246
+ models: {
247
+ [key: string]: any;
248
+ };
249
+ views: {
250
+ [key: string]: any;
251
+ };
252
+ };
253
+
254
+ declare const useListData: ({ action, context, viewResponse, }: {
255
+ action: ActionResultType;
256
+ context: any;
257
+ viewResponse?: ViewResponse;
258
+ }) => {
259
+ state: {
260
+ type: string;
261
+ setType: react.Dispatch<react.SetStateAction<string>>;
262
+ mode: string;
263
+ setMode: react.Dispatch<react.SetStateAction<string>>;
264
+ currentDate: Date;
265
+ setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
266
+ };
267
+ data: any;
268
+ error: Error;
269
+ isError: true;
270
+ isPending: false;
271
+ isLoading: false;
272
+ isLoadingError: false;
273
+ isRefetchError: true;
274
+ isSuccess: false;
275
+ isPlaceholderData: false;
276
+ status: "error";
277
+ dataUpdatedAt: number;
278
+ errorUpdatedAt: number;
279
+ failureCount: number;
280
+ failureReason: Error | null;
281
+ errorUpdateCount: number;
282
+ isFetched: boolean;
283
+ isFetchedAfterMount: boolean;
284
+ isFetching: boolean;
285
+ isInitialLoading: boolean;
286
+ isPaused: boolean;
287
+ isRefetching: boolean;
288
+ isStale: boolean;
289
+ isEnabled: boolean;
290
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<any, Error>>;
291
+ fetchStatus: _tanstack_query_core.FetchStatus;
292
+ promise: Promise<any>;
293
+ } | {
294
+ state: {
295
+ type: string;
296
+ setType: react.Dispatch<react.SetStateAction<string>>;
297
+ mode: string;
298
+ setMode: react.Dispatch<react.SetStateAction<string>>;
299
+ currentDate: Date;
300
+ setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
301
+ };
302
+ data: any;
303
+ error: null;
304
+ isError: false;
305
+ isPending: false;
306
+ isLoading: false;
307
+ isLoadingError: false;
308
+ isRefetchError: false;
309
+ isSuccess: true;
310
+ isPlaceholderData: false;
311
+ status: "success";
312
+ dataUpdatedAt: number;
313
+ errorUpdatedAt: number;
314
+ failureCount: number;
315
+ failureReason: Error | null;
316
+ errorUpdateCount: number;
317
+ isFetched: boolean;
318
+ isFetchedAfterMount: boolean;
319
+ isFetching: boolean;
320
+ isInitialLoading: boolean;
321
+ isPaused: boolean;
322
+ isRefetching: boolean;
323
+ isStale: boolean;
324
+ isEnabled: boolean;
325
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<any, Error>>;
326
+ fetchStatus: _tanstack_query_core.FetchStatus;
327
+ promise: Promise<any>;
328
+ } | {
329
+ state: {
330
+ type: string;
331
+ setType: react.Dispatch<react.SetStateAction<string>>;
332
+ mode: string;
333
+ setMode: react.Dispatch<react.SetStateAction<string>>;
334
+ currentDate: Date;
335
+ setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
336
+ };
337
+ data: undefined;
338
+ error: Error;
339
+ isError: true;
340
+ isPending: false;
341
+ isLoading: false;
342
+ isLoadingError: true;
343
+ isRefetchError: false;
344
+ isSuccess: false;
345
+ isPlaceholderData: false;
346
+ status: "error";
347
+ dataUpdatedAt: number;
348
+ errorUpdatedAt: number;
349
+ failureCount: number;
350
+ failureReason: Error | null;
351
+ errorUpdateCount: number;
352
+ isFetched: boolean;
353
+ isFetchedAfterMount: boolean;
354
+ isFetching: boolean;
355
+ isInitialLoading: boolean;
356
+ isPaused: boolean;
357
+ isRefetching: boolean;
358
+ isStale: boolean;
359
+ isEnabled: boolean;
360
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<any, Error>>;
361
+ fetchStatus: _tanstack_query_core.FetchStatus;
362
+ promise: Promise<any>;
363
+ } | {
364
+ state: {
365
+ type: string;
366
+ setType: react.Dispatch<react.SetStateAction<string>>;
367
+ mode: string;
368
+ setMode: react.Dispatch<react.SetStateAction<string>>;
369
+ currentDate: Date;
370
+ setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
371
+ };
372
+ data: undefined;
373
+ error: null;
374
+ isError: false;
375
+ isPending: true;
376
+ isLoading: true;
377
+ isLoadingError: false;
378
+ isRefetchError: false;
379
+ isSuccess: false;
380
+ isPlaceholderData: false;
381
+ status: "pending";
382
+ dataUpdatedAt: number;
383
+ errorUpdatedAt: number;
384
+ failureCount: number;
385
+ failureReason: Error | null;
386
+ errorUpdateCount: number;
387
+ isFetched: boolean;
388
+ isFetchedAfterMount: boolean;
389
+ isFetching: boolean;
390
+ isInitialLoading: boolean;
391
+ isPaused: boolean;
392
+ isRefetching: boolean;
393
+ isStale: boolean;
394
+ isEnabled: boolean;
395
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<any, Error>>;
396
+ fetchStatus: _tanstack_query_core.FetchStatus;
397
+ promise: Promise<any>;
398
+ } | {
399
+ state: {
400
+ type: string;
401
+ setType: react.Dispatch<react.SetStateAction<string>>;
402
+ mode: string;
403
+ setMode: react.Dispatch<react.SetStateAction<string>>;
404
+ currentDate: Date;
405
+ setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
406
+ };
407
+ data: undefined;
408
+ error: null;
409
+ isError: false;
410
+ isPending: true;
411
+ isLoadingError: false;
412
+ isRefetchError: false;
413
+ isSuccess: false;
414
+ isPlaceholderData: false;
415
+ status: "pending";
416
+ dataUpdatedAt: number;
417
+ errorUpdatedAt: number;
418
+ failureCount: number;
419
+ failureReason: Error | null;
420
+ errorUpdateCount: number;
421
+ isFetched: boolean;
422
+ isFetchedAfterMount: boolean;
423
+ isFetching: boolean;
424
+ isLoading: boolean;
425
+ isInitialLoading: boolean;
426
+ isPaused: boolean;
427
+ isRefetching: boolean;
428
+ isStale: boolean;
429
+ isEnabled: boolean;
430
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<any, Error>>;
431
+ fetchStatus: _tanstack_query_core.FetchStatus;
432
+ promise: Promise<any>;
433
+ } | {
434
+ state: {
435
+ type: string;
436
+ setType: react.Dispatch<react.SetStateAction<string>>;
437
+ mode: string;
438
+ setMode: react.Dispatch<react.SetStateAction<string>>;
439
+ currentDate: Date;
440
+ setCurrentDate: react.Dispatch<react.SetStateAction<Date>>;
441
+ };
442
+ data: any;
443
+ isError: false;
444
+ error: null;
445
+ isPending: false;
446
+ isLoading: false;
447
+ isLoadingError: false;
448
+ isRefetchError: false;
449
+ isSuccess: true;
450
+ isPlaceholderData: true;
451
+ status: "success";
452
+ dataUpdatedAt: number;
453
+ errorUpdatedAt: number;
454
+ failureCount: number;
455
+ failureReason: Error | null;
456
+ errorUpdateCount: number;
457
+ isFetched: boolean;
458
+ isFetchedAfterMount: boolean;
459
+ isFetching: boolean;
460
+ isInitialLoading: boolean;
461
+ isPaused: boolean;
462
+ isRefetching: boolean;
463
+ isStale: boolean;
464
+ isEnabled: boolean;
465
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<any, Error>>;
466
+ fetchStatus: _tanstack_query_core.FetchStatus;
467
+ promise: Promise<any>;
468
+ };
469
+ type useListDataType = ReturnType<typeof useListData>;
470
+
471
+ declare const useMenu: ({ context }: {
472
+ context: Context;
473
+ }) => {
474
+ data: Record[] | undefined;
475
+ action: {
476
+ handleChangeMenu: ({ menu, subMenu, }: {
477
+ menu?: Record;
478
+ subMenu: Record;
479
+ }) => Promise<void>;
480
+ };
481
+ state: any;
482
+ context: Context;
483
+ error: Error;
484
+ isError: true;
485
+ isPending: false;
486
+ isLoading: false;
487
+ isLoadingError: false;
488
+ isRefetchError: true;
489
+ isSuccess: false;
490
+ isPlaceholderData: false;
491
+ status: "error";
492
+ dataUpdatedAt: number;
493
+ errorUpdatedAt: number;
494
+ failureCount: number;
495
+ failureReason: Error | null;
496
+ errorUpdateCount: number;
497
+ isFetched: boolean;
498
+ isFetchedAfterMount: boolean;
499
+ isFetching: boolean;
500
+ isInitialLoading: boolean;
501
+ isPaused: boolean;
502
+ isRefetching: boolean;
503
+ isStale: boolean;
504
+ isEnabled: boolean;
505
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<Record[] | undefined, Error>>;
506
+ fetchStatus: _tanstack_query_core.FetchStatus;
507
+ promise: Promise<Record[] | undefined>;
508
+ } | {
509
+ data: Record[] | undefined;
510
+ action: {
511
+ handleChangeMenu: ({ menu, subMenu, }: {
512
+ menu?: Record;
513
+ subMenu: Record;
514
+ }) => Promise<void>;
515
+ };
516
+ state: any;
517
+ context: Context;
518
+ error: null;
519
+ isError: false;
520
+ isPending: false;
521
+ isLoading: false;
522
+ isLoadingError: false;
523
+ isRefetchError: false;
524
+ isSuccess: true;
525
+ isPlaceholderData: false;
526
+ status: "success";
527
+ dataUpdatedAt: number;
528
+ errorUpdatedAt: number;
529
+ failureCount: number;
530
+ failureReason: Error | null;
531
+ errorUpdateCount: number;
532
+ isFetched: boolean;
533
+ isFetchedAfterMount: boolean;
534
+ isFetching: boolean;
535
+ isInitialLoading: boolean;
536
+ isPaused: boolean;
537
+ isRefetching: boolean;
538
+ isStale: boolean;
539
+ isEnabled: boolean;
540
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<Record[] | undefined, Error>>;
541
+ fetchStatus: _tanstack_query_core.FetchStatus;
542
+ promise: Promise<Record[] | undefined>;
543
+ } | {
544
+ data: Record[] | undefined;
545
+ action: {
546
+ handleChangeMenu: ({ menu, subMenu, }: {
547
+ menu?: Record;
548
+ subMenu: Record;
549
+ }) => Promise<void>;
550
+ };
551
+ state: any;
552
+ context: Context;
553
+ error: Error;
554
+ isError: true;
555
+ isPending: false;
556
+ isLoading: false;
557
+ isLoadingError: true;
558
+ isRefetchError: false;
559
+ isSuccess: false;
560
+ isPlaceholderData: false;
561
+ status: "error";
562
+ dataUpdatedAt: number;
563
+ errorUpdatedAt: number;
564
+ failureCount: number;
565
+ failureReason: Error | null;
566
+ errorUpdateCount: number;
567
+ isFetched: boolean;
568
+ isFetchedAfterMount: boolean;
569
+ isFetching: boolean;
570
+ isInitialLoading: boolean;
571
+ isPaused: boolean;
572
+ isRefetching: boolean;
573
+ isStale: boolean;
574
+ isEnabled: boolean;
575
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<Record[] | undefined, Error>>;
576
+ fetchStatus: _tanstack_query_core.FetchStatus;
577
+ promise: Promise<Record[] | undefined>;
578
+ } | {
579
+ data: Record[] | undefined;
580
+ action: {
581
+ handleChangeMenu: ({ menu, subMenu, }: {
582
+ menu?: Record;
583
+ subMenu: Record;
584
+ }) => Promise<void>;
585
+ };
586
+ state: any;
587
+ context: Context;
588
+ error: null;
589
+ isError: false;
590
+ isPending: true;
591
+ isLoading: true;
592
+ isLoadingError: false;
593
+ isRefetchError: false;
594
+ isSuccess: false;
595
+ isPlaceholderData: false;
596
+ status: "pending";
597
+ dataUpdatedAt: number;
598
+ errorUpdatedAt: number;
599
+ failureCount: number;
600
+ failureReason: Error | null;
601
+ errorUpdateCount: number;
602
+ isFetched: boolean;
603
+ isFetchedAfterMount: boolean;
604
+ isFetching: boolean;
605
+ isInitialLoading: boolean;
606
+ isPaused: boolean;
607
+ isRefetching: boolean;
608
+ isStale: boolean;
609
+ isEnabled: boolean;
610
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<Record[] | undefined, Error>>;
611
+ fetchStatus: _tanstack_query_core.FetchStatus;
612
+ promise: Promise<Record[] | undefined>;
613
+ } | {
614
+ data: Record[] | undefined;
615
+ action: {
616
+ handleChangeMenu: ({ menu, subMenu, }: {
617
+ menu?: Record;
618
+ subMenu: Record;
619
+ }) => Promise<void>;
620
+ };
621
+ state: any;
622
+ context: Context;
623
+ error: null;
624
+ isError: false;
625
+ isPending: true;
626
+ isLoadingError: false;
627
+ isRefetchError: false;
628
+ isSuccess: false;
629
+ isPlaceholderData: false;
630
+ status: "pending";
631
+ dataUpdatedAt: number;
632
+ errorUpdatedAt: number;
633
+ failureCount: number;
634
+ failureReason: Error | null;
635
+ errorUpdateCount: number;
636
+ isFetched: boolean;
637
+ isFetchedAfterMount: boolean;
638
+ isFetching: boolean;
639
+ isLoading: boolean;
640
+ isInitialLoading: boolean;
641
+ isPaused: boolean;
642
+ isRefetching: boolean;
643
+ isStale: boolean;
644
+ isEnabled: boolean;
645
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<Record[] | undefined, Error>>;
646
+ fetchStatus: _tanstack_query_core.FetchStatus;
647
+ promise: Promise<Record[] | undefined>;
648
+ } | {
649
+ data: Record[] | undefined;
650
+ action: {
651
+ handleChangeMenu: ({ menu, subMenu, }: {
652
+ menu?: Record;
653
+ subMenu: Record;
654
+ }) => Promise<void>;
655
+ };
656
+ state: any;
657
+ context: Context;
658
+ isError: false;
659
+ error: null;
660
+ isPending: false;
661
+ isLoading: false;
662
+ isLoadingError: false;
663
+ isRefetchError: false;
664
+ isSuccess: true;
665
+ isPlaceholderData: true;
666
+ status: "success";
667
+ dataUpdatedAt: number;
668
+ errorUpdatedAt: number;
669
+ failureCount: number;
670
+ failureReason: Error | null;
671
+ errorUpdateCount: number;
672
+ isFetched: boolean;
673
+ isFetchedAfterMount: boolean;
674
+ isFetching: boolean;
675
+ isInitialLoading: boolean;
676
+ isPaused: boolean;
677
+ isRefetching: boolean;
678
+ isStale: boolean;
679
+ isEnabled: boolean;
680
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<Record[] | undefined, Error>>;
681
+ fetchStatus: _tanstack_query_core.FetchStatus;
682
+ promise: Promise<Record[] | undefined>;
683
+ };
684
+ type useMenuType = ReturnType<typeof useMenu>;
685
+ interface Record {
686
+ action: {
687
+ binding_view_types: string;
688
+ display_name: string;
689
+ id: {
690
+ id: number;
691
+ model: string;
692
+ };
693
+ res_model: string;
694
+ type: string;
695
+ };
696
+ active: boolean;
697
+ child_id?: Record[];
698
+ complete_name: string;
699
+ display_name: string;
700
+ groups_id: any[];
701
+ id: number;
702
+ is_display: boolean;
703
+ is_mobile: boolean;
704
+ name: string;
705
+ sequence: number;
706
+ url_icon: boolean | string | null;
707
+ web_icon: boolean | string | null;
708
+ web_icon_data: boolean | string | null;
709
+ }
710
+
711
+ declare const useProfile: (accessToken: string | null) => {
712
+ context: ContextProfile | undefined;
713
+ data: UserInfo | undefined;
714
+ error: Error;
715
+ isError: true;
716
+ isPending: false;
717
+ isLoading: false;
718
+ isLoadingError: false;
719
+ isRefetchError: true;
720
+ isSuccess: false;
721
+ isPlaceholderData: false;
722
+ status: "error";
723
+ dataUpdatedAt: number;
724
+ errorUpdatedAt: number;
725
+ failureCount: number;
726
+ failureReason: Error | null;
727
+ errorUpdateCount: number;
728
+ isFetched: boolean;
729
+ isFetchedAfterMount: boolean;
730
+ isFetching: boolean;
731
+ isInitialLoading: boolean;
732
+ isPaused: boolean;
733
+ isRefetching: boolean;
734
+ isStale: boolean;
735
+ isEnabled: boolean;
736
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<UserInfo | undefined, Error>>;
737
+ fetchStatus: _tanstack_query_core.FetchStatus;
738
+ promise: Promise<UserInfo | undefined>;
739
+ } | {
740
+ context: ContextProfile | undefined;
741
+ data: UserInfo | undefined;
742
+ error: null;
743
+ isError: false;
744
+ isPending: false;
745
+ isLoading: false;
746
+ isLoadingError: false;
747
+ isRefetchError: false;
748
+ isSuccess: true;
749
+ isPlaceholderData: false;
750
+ status: "success";
751
+ dataUpdatedAt: number;
752
+ errorUpdatedAt: number;
753
+ failureCount: number;
754
+ failureReason: Error | null;
755
+ errorUpdateCount: number;
756
+ isFetched: boolean;
757
+ isFetchedAfterMount: boolean;
758
+ isFetching: boolean;
759
+ isInitialLoading: boolean;
760
+ isPaused: boolean;
761
+ isRefetching: boolean;
762
+ isStale: boolean;
763
+ isEnabled: boolean;
764
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<UserInfo | undefined, Error>>;
765
+ fetchStatus: _tanstack_query_core.FetchStatus;
766
+ promise: Promise<UserInfo | undefined>;
767
+ } | {
768
+ context: ContextProfile | undefined;
769
+ data: undefined;
770
+ error: Error;
771
+ isError: true;
772
+ isPending: false;
773
+ isLoading: false;
774
+ isLoadingError: true;
775
+ isRefetchError: false;
776
+ isSuccess: false;
777
+ isPlaceholderData: false;
778
+ status: "error";
779
+ dataUpdatedAt: number;
780
+ errorUpdatedAt: number;
781
+ failureCount: number;
782
+ failureReason: Error | null;
783
+ errorUpdateCount: number;
784
+ isFetched: boolean;
785
+ isFetchedAfterMount: boolean;
786
+ isFetching: boolean;
787
+ isInitialLoading: boolean;
788
+ isPaused: boolean;
789
+ isRefetching: boolean;
790
+ isStale: boolean;
791
+ isEnabled: boolean;
792
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<UserInfo | undefined, Error>>;
793
+ fetchStatus: _tanstack_query_core.FetchStatus;
794
+ promise: Promise<UserInfo | undefined>;
795
+ } | {
796
+ context: ContextProfile | undefined;
797
+ data: undefined;
798
+ error: null;
799
+ isError: false;
800
+ isPending: true;
801
+ isLoading: true;
802
+ isLoadingError: false;
803
+ isRefetchError: false;
804
+ isSuccess: false;
805
+ isPlaceholderData: false;
806
+ status: "pending";
807
+ dataUpdatedAt: number;
808
+ errorUpdatedAt: number;
809
+ failureCount: number;
810
+ failureReason: Error | null;
811
+ errorUpdateCount: number;
812
+ isFetched: boolean;
813
+ isFetchedAfterMount: boolean;
814
+ isFetching: boolean;
815
+ isInitialLoading: boolean;
816
+ isPaused: boolean;
817
+ isRefetching: boolean;
818
+ isStale: boolean;
819
+ isEnabled: boolean;
820
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<UserInfo | undefined, Error>>;
821
+ fetchStatus: _tanstack_query_core.FetchStatus;
822
+ promise: Promise<UserInfo | undefined>;
823
+ } | {
824
+ context: ContextProfile | undefined;
825
+ data: undefined;
826
+ error: null;
827
+ isError: false;
828
+ isPending: true;
829
+ isLoadingError: false;
830
+ isRefetchError: false;
831
+ isSuccess: false;
832
+ isPlaceholderData: false;
833
+ status: "pending";
834
+ dataUpdatedAt: number;
835
+ errorUpdatedAt: number;
836
+ failureCount: number;
837
+ failureReason: Error | null;
838
+ errorUpdateCount: number;
839
+ isFetched: boolean;
840
+ isFetchedAfterMount: boolean;
841
+ isFetching: boolean;
842
+ isLoading: boolean;
843
+ isInitialLoading: boolean;
844
+ isPaused: boolean;
845
+ isRefetching: boolean;
846
+ isStale: boolean;
847
+ isEnabled: boolean;
848
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<UserInfo | undefined, Error>>;
849
+ fetchStatus: _tanstack_query_core.FetchStatus;
850
+ promise: Promise<UserInfo | undefined>;
851
+ } | {
852
+ context: ContextProfile | undefined;
853
+ data: UserInfo | undefined;
854
+ isError: false;
855
+ error: null;
856
+ isPending: false;
857
+ isLoading: false;
858
+ isLoadingError: false;
859
+ isRefetchError: false;
860
+ isSuccess: true;
861
+ isPlaceholderData: true;
862
+ status: "success";
863
+ dataUpdatedAt: number;
864
+ errorUpdatedAt: number;
865
+ failureCount: number;
866
+ failureReason: Error | null;
867
+ errorUpdateCount: number;
868
+ isFetched: boolean;
869
+ isFetchedAfterMount: boolean;
870
+ isFetching: boolean;
871
+ isInitialLoading: boolean;
872
+ isPaused: boolean;
873
+ isRefetching: boolean;
874
+ isStale: boolean;
875
+ isEnabled: boolean;
876
+ refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<UserInfo | undefined, Error>>;
877
+ fetchStatus: _tanstack_query_core.FetchStatus;
878
+ promise: Promise<UserInfo | undefined>;
879
+ };
880
+ interface UserInfo {
881
+ address: Address;
882
+ email: string;
883
+ locale: string;
884
+ name: string;
885
+ partner_id: PartnerID;
886
+ phone_number: boolean;
887
+ sub: number;
888
+ updated_at: Date;
889
+ username: string;
890
+ website: boolean;
891
+ zoneinfo: string;
892
+ }
893
+ interface Address {
894
+ country: boolean;
895
+ formatted: string;
896
+ locality: boolean;
897
+ postal_code: boolean;
898
+ region: boolean;
899
+ street_address: boolean;
900
+ }
901
+ interface PartnerID {
902
+ id: number;
903
+ stud_id: boolean;
904
+ }
905
+ type ContextProfile = {
906
+ uid: number;
907
+ lang: string;
908
+ allowed_company_ids: number[];
909
+ [key: string]: any;
910
+ };
911
+
912
+ declare const useUser: (accessToken: string | null) => any;
913
+ type useUserType = ReturnType<typeof useUser>;
914
+
915
+ declare const useAuth: () => {
916
+ signIn: (email: string, password: string) => Promise<void>;
917
+ signOut: () => Promise<void>;
918
+ accessToken: string | null;
919
+ isLoading: boolean;
920
+ };
921
+ type useAuthType = ReturnType<typeof useAuth>;
922
+
923
+ declare const useCompany: (accessToken: string | null) => {
924
+ currentCompany: _tanstack_react_query.UseQueryResult<CurrentCompany | undefined, Error>;
925
+ companyInfo: _tanstack_react_query.UseQueryResult<any, Error>;
926
+ context: {
927
+ allowed_company_ids: (number | undefined)[];
928
+ };
929
+ };
930
+
931
+ interface CompanyTuple extends Array<number | string> {
932
+ 0: number;
933
+ 1: string;
934
+ }
935
+ interface CurrentCompany {
936
+ allowed_companies: CompanyTuple[];
937
+ current_company: CompanyTuple;
938
+ current_company_id: number;
939
+ is_allowed: boolean;
940
+ }
941
+ type useCompanyType = ReturnType<typeof useCompany>;
942
+
943
+ type AppProviderType = {
944
+ config: useConfigType;
945
+ user: useUserType;
946
+ auth: useAuthType;
947
+ company: useCompanyType;
948
+ action: ActionResultType;
949
+ menu: useMenuType;
950
+ view: useViewV2Type;
951
+ list: useListDataType;
952
+ };
953
+ declare const AppProvider: ({ children }: {
954
+ children: React.ReactNode;
955
+ }) => JSX.Element;
956
+ declare const useAppProvider: () => AppProviderType;
957
+
958
+ declare const DEFAULT_EVENTS: readonly ["mousedown", "touchstart"];
959
+ type EventType = (typeof DEFAULT_EVENTS)[number];
960
+ interface UseClickOutsideOptions {
961
+ handler: (event?: Event) => void;
962
+ events?: readonly EventType[];
963
+ nodes?: (HTMLDivElement | null)[];
964
+ refs?: any;
965
+ }
966
+ declare const useClickOutside: ({ handler, events, nodes, refs, }: UseClickOutsideOptions) => RefObject<HTMLDivElement | null>;
967
+
968
+ declare function useDebounce<T>(value: T, delay: number): [T];
969
+
970
+ export { type ActionResultType, AppProvider, type ContextProfile, type Record, type ViewResponse, useAppProvider, useAuth, type useAuthType, useCallAction, type useCallActionType, useClickOutside, useConfig, type useConfigType, useDebounce, useDetail, useListData, type useListDataType, useMenu, type useMenuType, useProfile, useUser, type useUserType, useViewV2, type useViewV2Type };