@fctc/widget-logic 1.5.0 → 1.5.1

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