@fctc/widget-logic 2.5.0 → 2.5.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.
- package/dist/hooks.d.mts +220 -3
- package/dist/hooks.d.ts +220 -3
- package/dist/hooks.js +0 -3
- package/dist/hooks.mjs +0 -3
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +68 -42
- package/dist/index.mjs +83 -53
- package/dist/widget.d.mts +1 -3
- package/dist/widget.d.ts +1 -3
- package/dist/widget.js +68 -191
- package/dist/widget.mjs +83 -202
- package/package.json +1 -1
- package/dist/use-view-v2-BWHqxo3S.d.mts +0 -222
- package/dist/use-view-v2-BWHqxo3S.d.ts +0 -222
package/dist/hooks.d.mts
CHANGED
|
@@ -1,11 +1,43 @@
|
|
|
1
1
|
export { useButton, useChangeStatus, useDelete, useDeleteComment, useDuplicateRecord, useExecuteImport, useExportExcel, useForgotPassword, useForgotPasswordSSO, useGet2FAMethods, useGetAccessByCode, useGetActionDetail, useGetAll, useGetCalendar, useGetComment, useGetCompanyInfo, useGetConversionRate, useGetCurrency, useGetCurrentCompany, useGetDetail, useGetFieldExport, useGetFieldOnChange, useGetFileExcel, useGetFormView, useGetGroups, useGetImage, useGetListCompany, useGetListData, useGetListMyBankAccount, useGetMenu, useGetPrintReport, useGetProGressBar, useGetProfile, useGetProvider, useGetResequence, useGetSelection, useGetUser, useGetView, useGrantAccess, useIsValidToken, useLoadAction, useLoadMessage, useLoginCredential, useLoginSocial, useLogout, useModel, useOdooDataTransform, useOnChangeForm, useParsePreview, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useResetPassword, useResetPasswordSSO, useRunAction, useSave, useSendComment, useSettingsWebRead2fa, useSignInSSO, useSwitchLocale, useUpdatePassword, useUploadFile, useUploadFileExcel, useUploadIdFile, useUploadImage, useValidateActionToken, useVerify2FA, useVerifyTotp } from '@fctc/interface-logic/hooks';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { A as ActionResultType, c as useViewV2Type, V as ViewResponse } from './use-view-v2-BWHqxo3S.mjs';
|
|
4
|
-
export { u as useCallAction, a as useCallActionType, b as useViewV2 } from './use-view-v2-BWHqxo3S.mjs';
|
|
5
3
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
6
4
|
import * as react from 'react';
|
|
7
5
|
import react__default, { RefObject } from 'react';
|
|
8
6
|
|
|
7
|
+
declare const useCallAction: () => readonly [ActionResult | undefined, ({ aid, }: {
|
|
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
|
+
id?: number;
|
|
15
|
+
name?: string;
|
|
16
|
+
type?: 'ir.actions.act_window' | string;
|
|
17
|
+
xml_id?: string;
|
|
18
|
+
path?: false | string;
|
|
19
|
+
help?: string;
|
|
20
|
+
binding_model_id?: false | number;
|
|
21
|
+
binding_type?: 'action' | string;
|
|
22
|
+
binding_view_types?: string;
|
|
23
|
+
display_name?: string;
|
|
24
|
+
view_id?: false | number;
|
|
25
|
+
domain?: false | any[];
|
|
26
|
+
context?: string;
|
|
27
|
+
res_id?: number;
|
|
28
|
+
res_model?: string;
|
|
29
|
+
target?: 'current' | 'new' | string;
|
|
30
|
+
view_mode?: string;
|
|
31
|
+
mobile_view_mode?: string;
|
|
32
|
+
views?: [number, string][];
|
|
33
|
+
limit?: number;
|
|
34
|
+
groups_id?: number[];
|
|
35
|
+
search_view_id?: [number, string];
|
|
36
|
+
embedded_action_ids?: number[];
|
|
37
|
+
filter?: false | any;
|
|
38
|
+
url?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
9
41
|
declare const useMenu: ({ context, specification, }: {
|
|
10
42
|
context?: any;
|
|
11
43
|
specification?: any;
|
|
@@ -57,6 +89,191 @@ interface UseMenuReturn {
|
|
|
57
89
|
declare const useUser: () => any;
|
|
58
90
|
type useUserType = ReturnType<typeof useUser>;
|
|
59
91
|
|
|
92
|
+
declare const useViewV2: ({ action, context, aid, views, model, }: {
|
|
93
|
+
action?: ActionResultType;
|
|
94
|
+
context: any;
|
|
95
|
+
aid?: any;
|
|
96
|
+
views?: any;
|
|
97
|
+
model?: string;
|
|
98
|
+
}) => {
|
|
99
|
+
context: any;
|
|
100
|
+
data: ViewResponse;
|
|
101
|
+
error: Error;
|
|
102
|
+
isError: true;
|
|
103
|
+
isPending: false;
|
|
104
|
+
isLoading: false;
|
|
105
|
+
isLoadingError: false;
|
|
106
|
+
isRefetchError: true;
|
|
107
|
+
isSuccess: false;
|
|
108
|
+
isPlaceholderData: false;
|
|
109
|
+
status: "error";
|
|
110
|
+
dataUpdatedAt: number;
|
|
111
|
+
errorUpdatedAt: number;
|
|
112
|
+
failureCount: number;
|
|
113
|
+
failureReason: Error | null;
|
|
114
|
+
errorUpdateCount: number;
|
|
115
|
+
isFetched: boolean;
|
|
116
|
+
isFetchedAfterMount: boolean;
|
|
117
|
+
isFetching: boolean;
|
|
118
|
+
isInitialLoading: boolean;
|
|
119
|
+
isPaused: boolean;
|
|
120
|
+
isRefetching: boolean;
|
|
121
|
+
isStale: boolean;
|
|
122
|
+
isEnabled: boolean;
|
|
123
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
124
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
125
|
+
promise: Promise<ViewResponse>;
|
|
126
|
+
} | {
|
|
127
|
+
context: any;
|
|
128
|
+
data: ViewResponse;
|
|
129
|
+
error: null;
|
|
130
|
+
isError: false;
|
|
131
|
+
isPending: false;
|
|
132
|
+
isLoading: false;
|
|
133
|
+
isLoadingError: false;
|
|
134
|
+
isRefetchError: false;
|
|
135
|
+
isSuccess: true;
|
|
136
|
+
isPlaceholderData: false;
|
|
137
|
+
status: "success";
|
|
138
|
+
dataUpdatedAt: number;
|
|
139
|
+
errorUpdatedAt: number;
|
|
140
|
+
failureCount: number;
|
|
141
|
+
failureReason: Error | null;
|
|
142
|
+
errorUpdateCount: number;
|
|
143
|
+
isFetched: boolean;
|
|
144
|
+
isFetchedAfterMount: boolean;
|
|
145
|
+
isFetching: boolean;
|
|
146
|
+
isInitialLoading: boolean;
|
|
147
|
+
isPaused: boolean;
|
|
148
|
+
isRefetching: boolean;
|
|
149
|
+
isStale: boolean;
|
|
150
|
+
isEnabled: boolean;
|
|
151
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
152
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
153
|
+
promise: Promise<ViewResponse>;
|
|
154
|
+
} | {
|
|
155
|
+
context: any;
|
|
156
|
+
data: undefined;
|
|
157
|
+
error: Error;
|
|
158
|
+
isError: true;
|
|
159
|
+
isPending: false;
|
|
160
|
+
isLoading: false;
|
|
161
|
+
isLoadingError: true;
|
|
162
|
+
isRefetchError: false;
|
|
163
|
+
isSuccess: false;
|
|
164
|
+
isPlaceholderData: false;
|
|
165
|
+
status: "error";
|
|
166
|
+
dataUpdatedAt: number;
|
|
167
|
+
errorUpdatedAt: number;
|
|
168
|
+
failureCount: number;
|
|
169
|
+
failureReason: Error | null;
|
|
170
|
+
errorUpdateCount: number;
|
|
171
|
+
isFetched: boolean;
|
|
172
|
+
isFetchedAfterMount: boolean;
|
|
173
|
+
isFetching: boolean;
|
|
174
|
+
isInitialLoading: boolean;
|
|
175
|
+
isPaused: boolean;
|
|
176
|
+
isRefetching: boolean;
|
|
177
|
+
isStale: boolean;
|
|
178
|
+
isEnabled: boolean;
|
|
179
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
180
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
181
|
+
promise: Promise<ViewResponse>;
|
|
182
|
+
} | {
|
|
183
|
+
context: any;
|
|
184
|
+
data: undefined;
|
|
185
|
+
error: null;
|
|
186
|
+
isError: false;
|
|
187
|
+
isPending: true;
|
|
188
|
+
isLoading: true;
|
|
189
|
+
isLoadingError: false;
|
|
190
|
+
isRefetchError: false;
|
|
191
|
+
isSuccess: false;
|
|
192
|
+
isPlaceholderData: false;
|
|
193
|
+
status: "pending";
|
|
194
|
+
dataUpdatedAt: number;
|
|
195
|
+
errorUpdatedAt: number;
|
|
196
|
+
failureCount: number;
|
|
197
|
+
failureReason: Error | null;
|
|
198
|
+
errorUpdateCount: number;
|
|
199
|
+
isFetched: boolean;
|
|
200
|
+
isFetchedAfterMount: boolean;
|
|
201
|
+
isFetching: boolean;
|
|
202
|
+
isInitialLoading: boolean;
|
|
203
|
+
isPaused: boolean;
|
|
204
|
+
isRefetching: boolean;
|
|
205
|
+
isStale: boolean;
|
|
206
|
+
isEnabled: boolean;
|
|
207
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
208
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
209
|
+
promise: Promise<ViewResponse>;
|
|
210
|
+
} | {
|
|
211
|
+
context: any;
|
|
212
|
+
data: undefined;
|
|
213
|
+
error: null;
|
|
214
|
+
isError: false;
|
|
215
|
+
isPending: true;
|
|
216
|
+
isLoadingError: false;
|
|
217
|
+
isRefetchError: false;
|
|
218
|
+
isSuccess: false;
|
|
219
|
+
isPlaceholderData: false;
|
|
220
|
+
status: "pending";
|
|
221
|
+
dataUpdatedAt: number;
|
|
222
|
+
errorUpdatedAt: number;
|
|
223
|
+
failureCount: number;
|
|
224
|
+
failureReason: Error | null;
|
|
225
|
+
errorUpdateCount: number;
|
|
226
|
+
isFetched: boolean;
|
|
227
|
+
isFetchedAfterMount: boolean;
|
|
228
|
+
isFetching: boolean;
|
|
229
|
+
isLoading: boolean;
|
|
230
|
+
isInitialLoading: boolean;
|
|
231
|
+
isPaused: boolean;
|
|
232
|
+
isRefetching: boolean;
|
|
233
|
+
isStale: boolean;
|
|
234
|
+
isEnabled: boolean;
|
|
235
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
236
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
237
|
+
promise: Promise<ViewResponse>;
|
|
238
|
+
} | {
|
|
239
|
+
context: any;
|
|
240
|
+
data: ViewResponse;
|
|
241
|
+
isError: false;
|
|
242
|
+
error: null;
|
|
243
|
+
isPending: false;
|
|
244
|
+
isLoading: false;
|
|
245
|
+
isLoadingError: false;
|
|
246
|
+
isRefetchError: false;
|
|
247
|
+
isSuccess: true;
|
|
248
|
+
isPlaceholderData: true;
|
|
249
|
+
status: "success";
|
|
250
|
+
dataUpdatedAt: number;
|
|
251
|
+
errorUpdatedAt: number;
|
|
252
|
+
failureCount: number;
|
|
253
|
+
failureReason: Error | null;
|
|
254
|
+
errorUpdateCount: number;
|
|
255
|
+
isFetched: boolean;
|
|
256
|
+
isFetchedAfterMount: boolean;
|
|
257
|
+
isFetching: boolean;
|
|
258
|
+
isInitialLoading: boolean;
|
|
259
|
+
isPaused: boolean;
|
|
260
|
+
isRefetching: boolean;
|
|
261
|
+
isStale: boolean;
|
|
262
|
+
isEnabled: boolean;
|
|
263
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
264
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
265
|
+
promise: Promise<ViewResponse>;
|
|
266
|
+
};
|
|
267
|
+
type useViewV2Type = ReturnType<typeof useViewV2>;
|
|
268
|
+
type ViewResponse = {
|
|
269
|
+
models: {
|
|
270
|
+
[key: string]: any;
|
|
271
|
+
};
|
|
272
|
+
views: {
|
|
273
|
+
[key: string]: any;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
|
|
60
277
|
declare const useCompany: () => {
|
|
61
278
|
currentCompany: {
|
|
62
279
|
data: CurrentCompany | undefined;
|
|
@@ -979,4 +1196,4 @@ declare const useGetRowIds: (tableRef: react__default.RefObject<HTMLTableElement
|
|
|
979
1196
|
refresh: () => void;
|
|
980
1197
|
};
|
|
981
1198
|
|
|
982
|
-
export { ActionResultType, AppProvider, type CompanyTuple, type ContextProfile, type CurrentCompany, type RecordMenu, type UseMenuReturn, ViewResponse, useAppProvider, useClickOutside, useCompany, type useCompanyType, useConfig, type useConfigType, useDebounce, useDetail, useGetAction, useGetRowIds, useGetSpecification, useListData, type useListDataType, useMenu, type useMenuType, useProfile, useUser, type useUserType, useViewV2Type };
|
|
1199
|
+
export { type ActionResultType, AppProvider, type CompanyTuple, type ContextProfile, type CurrentCompany, type RecordMenu, type UseMenuReturn, type ViewResponse, useAppProvider, useCallAction, type useCallActionType, useClickOutside, useCompany, type useCompanyType, useConfig, type useConfigType, useDebounce, useDetail, useGetAction, useGetRowIds, useGetSpecification, useListData, type useListDataType, useMenu, type useMenuType, useProfile, useUser, type useUserType, useViewV2, type useViewV2Type };
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,11 +1,43 @@
|
|
|
1
1
|
export { useButton, useChangeStatus, useDelete, useDeleteComment, useDuplicateRecord, useExecuteImport, useExportExcel, useForgotPassword, useForgotPasswordSSO, useGet2FAMethods, useGetAccessByCode, useGetActionDetail, useGetAll, useGetCalendar, useGetComment, useGetCompanyInfo, useGetConversionRate, useGetCurrency, useGetCurrentCompany, useGetDetail, useGetFieldExport, useGetFieldOnChange, useGetFileExcel, useGetFormView, useGetGroups, useGetImage, useGetListCompany, useGetListData, useGetListMyBankAccount, useGetMenu, useGetPrintReport, useGetProGressBar, useGetProfile, useGetProvider, useGetResequence, useGetSelection, useGetUser, useGetView, useGrantAccess, useIsValidToken, useLoadAction, useLoadMessage, useLoginCredential, useLoginSocial, useLogout, useModel, useOdooDataTransform, useOnChangeForm, useParsePreview, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useResetPassword, useResetPasswordSSO, useRunAction, useSave, useSendComment, useSettingsWebRead2fa, useSignInSSO, useSwitchLocale, useUpdatePassword, useUploadFile, useUploadFileExcel, useUploadIdFile, useUploadImage, useValidateActionToken, useVerify2FA, useVerifyTotp } from '@fctc/interface-logic/hooks';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { A as ActionResultType, c as useViewV2Type, V as ViewResponse } from './use-view-v2-BWHqxo3S.js';
|
|
4
|
-
export { u as useCallAction, a as useCallActionType, b as useViewV2 } from './use-view-v2-BWHqxo3S.js';
|
|
5
3
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
6
4
|
import * as react from 'react';
|
|
7
5
|
import react__default, { RefObject } from 'react';
|
|
8
6
|
|
|
7
|
+
declare const useCallAction: () => readonly [ActionResult | undefined, ({ aid, }: {
|
|
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
|
+
id?: number;
|
|
15
|
+
name?: string;
|
|
16
|
+
type?: 'ir.actions.act_window' | string;
|
|
17
|
+
xml_id?: string;
|
|
18
|
+
path?: false | string;
|
|
19
|
+
help?: string;
|
|
20
|
+
binding_model_id?: false | number;
|
|
21
|
+
binding_type?: 'action' | string;
|
|
22
|
+
binding_view_types?: string;
|
|
23
|
+
display_name?: string;
|
|
24
|
+
view_id?: false | number;
|
|
25
|
+
domain?: false | any[];
|
|
26
|
+
context?: string;
|
|
27
|
+
res_id?: number;
|
|
28
|
+
res_model?: string;
|
|
29
|
+
target?: 'current' | 'new' | string;
|
|
30
|
+
view_mode?: string;
|
|
31
|
+
mobile_view_mode?: string;
|
|
32
|
+
views?: [number, string][];
|
|
33
|
+
limit?: number;
|
|
34
|
+
groups_id?: number[];
|
|
35
|
+
search_view_id?: [number, string];
|
|
36
|
+
embedded_action_ids?: number[];
|
|
37
|
+
filter?: false | any;
|
|
38
|
+
url?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
9
41
|
declare const useMenu: ({ context, specification, }: {
|
|
10
42
|
context?: any;
|
|
11
43
|
specification?: any;
|
|
@@ -57,6 +89,191 @@ interface UseMenuReturn {
|
|
|
57
89
|
declare const useUser: () => any;
|
|
58
90
|
type useUserType = ReturnType<typeof useUser>;
|
|
59
91
|
|
|
92
|
+
declare const useViewV2: ({ action, context, aid, views, model, }: {
|
|
93
|
+
action?: ActionResultType;
|
|
94
|
+
context: any;
|
|
95
|
+
aid?: any;
|
|
96
|
+
views?: any;
|
|
97
|
+
model?: string;
|
|
98
|
+
}) => {
|
|
99
|
+
context: any;
|
|
100
|
+
data: ViewResponse;
|
|
101
|
+
error: Error;
|
|
102
|
+
isError: true;
|
|
103
|
+
isPending: false;
|
|
104
|
+
isLoading: false;
|
|
105
|
+
isLoadingError: false;
|
|
106
|
+
isRefetchError: true;
|
|
107
|
+
isSuccess: false;
|
|
108
|
+
isPlaceholderData: false;
|
|
109
|
+
status: "error";
|
|
110
|
+
dataUpdatedAt: number;
|
|
111
|
+
errorUpdatedAt: number;
|
|
112
|
+
failureCount: number;
|
|
113
|
+
failureReason: Error | null;
|
|
114
|
+
errorUpdateCount: number;
|
|
115
|
+
isFetched: boolean;
|
|
116
|
+
isFetchedAfterMount: boolean;
|
|
117
|
+
isFetching: boolean;
|
|
118
|
+
isInitialLoading: boolean;
|
|
119
|
+
isPaused: boolean;
|
|
120
|
+
isRefetching: boolean;
|
|
121
|
+
isStale: boolean;
|
|
122
|
+
isEnabled: boolean;
|
|
123
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
124
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
125
|
+
promise: Promise<ViewResponse>;
|
|
126
|
+
} | {
|
|
127
|
+
context: any;
|
|
128
|
+
data: ViewResponse;
|
|
129
|
+
error: null;
|
|
130
|
+
isError: false;
|
|
131
|
+
isPending: false;
|
|
132
|
+
isLoading: false;
|
|
133
|
+
isLoadingError: false;
|
|
134
|
+
isRefetchError: false;
|
|
135
|
+
isSuccess: true;
|
|
136
|
+
isPlaceholderData: false;
|
|
137
|
+
status: "success";
|
|
138
|
+
dataUpdatedAt: number;
|
|
139
|
+
errorUpdatedAt: number;
|
|
140
|
+
failureCount: number;
|
|
141
|
+
failureReason: Error | null;
|
|
142
|
+
errorUpdateCount: number;
|
|
143
|
+
isFetched: boolean;
|
|
144
|
+
isFetchedAfterMount: boolean;
|
|
145
|
+
isFetching: boolean;
|
|
146
|
+
isInitialLoading: boolean;
|
|
147
|
+
isPaused: boolean;
|
|
148
|
+
isRefetching: boolean;
|
|
149
|
+
isStale: boolean;
|
|
150
|
+
isEnabled: boolean;
|
|
151
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
152
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
153
|
+
promise: Promise<ViewResponse>;
|
|
154
|
+
} | {
|
|
155
|
+
context: any;
|
|
156
|
+
data: undefined;
|
|
157
|
+
error: Error;
|
|
158
|
+
isError: true;
|
|
159
|
+
isPending: false;
|
|
160
|
+
isLoading: false;
|
|
161
|
+
isLoadingError: true;
|
|
162
|
+
isRefetchError: false;
|
|
163
|
+
isSuccess: false;
|
|
164
|
+
isPlaceholderData: false;
|
|
165
|
+
status: "error";
|
|
166
|
+
dataUpdatedAt: number;
|
|
167
|
+
errorUpdatedAt: number;
|
|
168
|
+
failureCount: number;
|
|
169
|
+
failureReason: Error | null;
|
|
170
|
+
errorUpdateCount: number;
|
|
171
|
+
isFetched: boolean;
|
|
172
|
+
isFetchedAfterMount: boolean;
|
|
173
|
+
isFetching: boolean;
|
|
174
|
+
isInitialLoading: boolean;
|
|
175
|
+
isPaused: boolean;
|
|
176
|
+
isRefetching: boolean;
|
|
177
|
+
isStale: boolean;
|
|
178
|
+
isEnabled: boolean;
|
|
179
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
180
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
181
|
+
promise: Promise<ViewResponse>;
|
|
182
|
+
} | {
|
|
183
|
+
context: any;
|
|
184
|
+
data: undefined;
|
|
185
|
+
error: null;
|
|
186
|
+
isError: false;
|
|
187
|
+
isPending: true;
|
|
188
|
+
isLoading: true;
|
|
189
|
+
isLoadingError: false;
|
|
190
|
+
isRefetchError: false;
|
|
191
|
+
isSuccess: false;
|
|
192
|
+
isPlaceholderData: false;
|
|
193
|
+
status: "pending";
|
|
194
|
+
dataUpdatedAt: number;
|
|
195
|
+
errorUpdatedAt: number;
|
|
196
|
+
failureCount: number;
|
|
197
|
+
failureReason: Error | null;
|
|
198
|
+
errorUpdateCount: number;
|
|
199
|
+
isFetched: boolean;
|
|
200
|
+
isFetchedAfterMount: boolean;
|
|
201
|
+
isFetching: boolean;
|
|
202
|
+
isInitialLoading: boolean;
|
|
203
|
+
isPaused: boolean;
|
|
204
|
+
isRefetching: boolean;
|
|
205
|
+
isStale: boolean;
|
|
206
|
+
isEnabled: boolean;
|
|
207
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
208
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
209
|
+
promise: Promise<ViewResponse>;
|
|
210
|
+
} | {
|
|
211
|
+
context: any;
|
|
212
|
+
data: undefined;
|
|
213
|
+
error: null;
|
|
214
|
+
isError: false;
|
|
215
|
+
isPending: true;
|
|
216
|
+
isLoadingError: false;
|
|
217
|
+
isRefetchError: false;
|
|
218
|
+
isSuccess: false;
|
|
219
|
+
isPlaceholderData: false;
|
|
220
|
+
status: "pending";
|
|
221
|
+
dataUpdatedAt: number;
|
|
222
|
+
errorUpdatedAt: number;
|
|
223
|
+
failureCount: number;
|
|
224
|
+
failureReason: Error | null;
|
|
225
|
+
errorUpdateCount: number;
|
|
226
|
+
isFetched: boolean;
|
|
227
|
+
isFetchedAfterMount: boolean;
|
|
228
|
+
isFetching: boolean;
|
|
229
|
+
isLoading: boolean;
|
|
230
|
+
isInitialLoading: boolean;
|
|
231
|
+
isPaused: boolean;
|
|
232
|
+
isRefetching: boolean;
|
|
233
|
+
isStale: boolean;
|
|
234
|
+
isEnabled: boolean;
|
|
235
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
236
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
237
|
+
promise: Promise<ViewResponse>;
|
|
238
|
+
} | {
|
|
239
|
+
context: any;
|
|
240
|
+
data: ViewResponse;
|
|
241
|
+
isError: false;
|
|
242
|
+
error: null;
|
|
243
|
+
isPending: false;
|
|
244
|
+
isLoading: false;
|
|
245
|
+
isLoadingError: false;
|
|
246
|
+
isRefetchError: false;
|
|
247
|
+
isSuccess: true;
|
|
248
|
+
isPlaceholderData: true;
|
|
249
|
+
status: "success";
|
|
250
|
+
dataUpdatedAt: number;
|
|
251
|
+
errorUpdatedAt: number;
|
|
252
|
+
failureCount: number;
|
|
253
|
+
failureReason: Error | null;
|
|
254
|
+
errorUpdateCount: number;
|
|
255
|
+
isFetched: boolean;
|
|
256
|
+
isFetchedAfterMount: boolean;
|
|
257
|
+
isFetching: boolean;
|
|
258
|
+
isInitialLoading: boolean;
|
|
259
|
+
isPaused: boolean;
|
|
260
|
+
isRefetching: boolean;
|
|
261
|
+
isStale: boolean;
|
|
262
|
+
isEnabled: boolean;
|
|
263
|
+
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
264
|
+
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
265
|
+
promise: Promise<ViewResponse>;
|
|
266
|
+
};
|
|
267
|
+
type useViewV2Type = ReturnType<typeof useViewV2>;
|
|
268
|
+
type ViewResponse = {
|
|
269
|
+
models: {
|
|
270
|
+
[key: string]: any;
|
|
271
|
+
};
|
|
272
|
+
views: {
|
|
273
|
+
[key: string]: any;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
|
|
60
277
|
declare const useCompany: () => {
|
|
61
278
|
currentCompany: {
|
|
62
279
|
data: CurrentCompany | undefined;
|
|
@@ -979,4 +1196,4 @@ declare const useGetRowIds: (tableRef: react__default.RefObject<HTMLTableElement
|
|
|
979
1196
|
refresh: () => void;
|
|
980
1197
|
};
|
|
981
1198
|
|
|
982
|
-
export { ActionResultType, AppProvider, type CompanyTuple, type ContextProfile, type CurrentCompany, type RecordMenu, type UseMenuReturn, ViewResponse, useAppProvider, useClickOutside, useCompany, type useCompanyType, useConfig, type useConfigType, useDebounce, useDetail, useGetAction, useGetRowIds, useGetSpecification, useListData, type useListDataType, useMenu, type useMenuType, useProfile, useUser, type useUserType, useViewV2Type };
|
|
1199
|
+
export { type ActionResultType, AppProvider, type CompanyTuple, type ContextProfile, type CurrentCompany, type RecordMenu, type UseMenuReturn, type ViewResponse, useAppProvider, useCallAction, type useCallActionType, useClickOutside, useCompany, type useCompanyType, useConfig, type useConfigType, useDebounce, useDetail, useGetAction, useGetRowIds, useGetSpecification, useListData, type useListDataType, useMenu, type useMenuType, useProfile, useUser, type useUserType, useViewV2, type useViewV2Type };
|
package/dist/hooks.js
CHANGED
package/dist/hooks.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { useButton, useChangeStatus, useDelete, useDeleteComment, useDuplicateRecord, useExecuteImport, useExportExcel, useForgotPassword, useForgotPasswordSSO, useGet2FAMethods, useGetAccessByCode, useGetActionDetail, useGetAll, useGetCalendar, useGetComment, useGetCompanyInfo, useGetConversionRate, useGetCurrency, useGetCurrentCompany, useGetDetail, useGetFieldExport, useGetFieldOnChange, useGetFileExcel, useGetFormView, useGetGroups, useGetImage, useGetListCompany, useGetListData, useGetListMyBankAccount, useGetMenu, useGetPrintReport, useGetProGressBar, useGetProfile, useGetProvider, useGetResequence, useGetSelection, useGetUser, useGetView, useGrantAccess, useIsValidToken, useLoadAction, useLoadMessage, useLoginCredential, useLoginSocial, useLogout, useModel, useOdooDataTransform, useOnChangeForm, useParsePreview, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useResetPassword, useResetPasswordSSO, useRunAction, useSave, useSendComment, useSettingsWebRead2fa, useSignInSSO, useSwitchLocale, useUpdatePassword, useUploadFile, useUploadFileExcel, useUploadIdFile, useUploadImage, useValidateActionToken, useVerify2FA, useVerifyTotp } from '@fctc/interface-logic/hooks';
|
|
2
|
-
export { AppProvider, CompanyTuple, ContextProfile, CurrentCompany, RecordMenu, UseMenuReturn, useAppProvider, useClickOutside, useCompany, useCompanyType, useConfig, useConfigType, useDebounce, useDetail, useGetAction, useGetRowIds, useGetSpecification, useListData, useListDataType, useMenu, useMenuType, useProfile, useUser, useUserType } from './hooks.mjs';
|
|
3
|
-
export { A as ActionResultType, V as ViewResponse, u as useCallAction, a as useCallActionType, b as useViewV2, c as useViewV2Type } from './use-view-v2-BWHqxo3S.mjs';
|
|
2
|
+
export { ActionResultType, AppProvider, CompanyTuple, ContextProfile, CurrentCompany, RecordMenu, UseMenuReturn, ViewResponse, useAppProvider, useCallAction, useCallActionType, useClickOutside, useCompany, useCompanyType, useConfig, useConfigType, useDebounce, useDetail, useGetAction, useGetRowIds, useGetSpecification, useListData, useListDataType, useMenu, useMenuType, useProfile, useUser, useUserType, useViewV2, useViewV2Type } from './hooks.mjs';
|
|
4
3
|
export * from '@fctc/interface-logic/configs';
|
|
5
4
|
export { CheckIcon, ChevronBottomIcon, CloseIcon, EyeIcon, FilterIcon, GroupByIcon, LoadingIcon, SearchIcon } from './icons.mjs';
|
|
6
5
|
export { ISelctionStateProps, ITableHeadProps, ITableProps, binaryFieldController, colorFieldController, copyLinkButtonController, dateFieldController, downLoadBinaryController, downloadFileController, durationController, many2manyFieldController, many2manyTagsController, many2oneButtonController, many2oneFieldController, priorityFieldController, searchController, statusDropdownController, tableController, tableGroupController, tableHeadController } from './widget.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { useButton, useChangeStatus, useDelete, useDeleteComment, useDuplicateRecord, useExecuteImport, useExportExcel, useForgotPassword, useForgotPasswordSSO, useGet2FAMethods, useGetAccessByCode, useGetActionDetail, useGetAll, useGetCalendar, useGetComment, useGetCompanyInfo, useGetConversionRate, useGetCurrency, useGetCurrentCompany, useGetDetail, useGetFieldExport, useGetFieldOnChange, useGetFileExcel, useGetFormView, useGetGroups, useGetImage, useGetListCompany, useGetListData, useGetListMyBankAccount, useGetMenu, useGetPrintReport, useGetProGressBar, useGetProfile, useGetProvider, useGetResequence, useGetSelection, useGetUser, useGetView, useGrantAccess, useIsValidToken, useLoadAction, useLoadMessage, useLoginCredential, useLoginSocial, useLogout, useModel, useOdooDataTransform, useOnChangeForm, useParsePreview, usePrint, useRemoveRow, useRemoveTotpSetup, useRequestSetupTotp, useResetPassword, useResetPasswordSSO, useRunAction, useSave, useSendComment, useSettingsWebRead2fa, useSignInSSO, useSwitchLocale, useUpdatePassword, useUploadFile, useUploadFileExcel, useUploadIdFile, useUploadImage, useValidateActionToken, useVerify2FA, useVerifyTotp } from '@fctc/interface-logic/hooks';
|
|
2
|
-
export { AppProvider, CompanyTuple, ContextProfile, CurrentCompany, RecordMenu, UseMenuReturn, useAppProvider, useClickOutside, useCompany, useCompanyType, useConfig, useConfigType, useDebounce, useDetail, useGetAction, useGetRowIds, useGetSpecification, useListData, useListDataType, useMenu, useMenuType, useProfile, useUser, useUserType } from './hooks.js';
|
|
3
|
-
export { A as ActionResultType, V as ViewResponse, u as useCallAction, a as useCallActionType, b as useViewV2, c as useViewV2Type } from './use-view-v2-BWHqxo3S.js';
|
|
2
|
+
export { ActionResultType, AppProvider, CompanyTuple, ContextProfile, CurrentCompany, RecordMenu, UseMenuReturn, ViewResponse, useAppProvider, useCallAction, useCallActionType, useClickOutside, useCompany, useCompanyType, useConfig, useConfigType, useDebounce, useDetail, useGetAction, useGetRowIds, useGetSpecification, useListData, useListDataType, useMenu, useMenuType, useProfile, useUser, useUserType, useViewV2, useViewV2Type } from './hooks.js';
|
|
4
3
|
export * from '@fctc/interface-logic/configs';
|
|
5
4
|
export { CheckIcon, ChevronBottomIcon, CloseIcon, EyeIcon, FilterIcon, GroupByIcon, LoadingIcon, SearchIcon } from './icons.js';
|
|
6
5
|
export { ISelctionStateProps, ITableHeadProps, ITableProps, binaryFieldController, colorFieldController, copyLinkButtonController, dateFieldController, downLoadBinaryController, downloadFileController, durationController, many2manyFieldController, many2manyTagsController, many2oneButtonController, many2oneFieldController, priorityFieldController, searchController, statusDropdownController, tableController, tableGroupController, tableHeadController } from './widget.js';
|
package/dist/index.js
CHANGED
|
@@ -4535,9 +4535,6 @@ var useViewV2 = ({
|
|
|
4535
4535
|
}) => {
|
|
4536
4536
|
const { useGetView: useGetView2 } = (0, provider_exports.useService)();
|
|
4537
4537
|
const viewParams = (0, import_react6.useMemo)(() => {
|
|
4538
|
-
if (!action) {
|
|
4539
|
-
return void 0;
|
|
4540
|
-
}
|
|
4541
4538
|
return {
|
|
4542
4539
|
model,
|
|
4543
4540
|
views,
|
|
@@ -5494,24 +5491,62 @@ var many2oneButtonController = (props) => {
|
|
|
5494
5491
|
var import_react17 = require("react");
|
|
5495
5492
|
var import_utils8 = require("@fctc/interface-logic/utils");
|
|
5496
5493
|
var many2manyFieldController = (props) => {
|
|
5497
|
-
const {
|
|
5494
|
+
const {
|
|
5495
|
+
relation,
|
|
5496
|
+
domain,
|
|
5497
|
+
context,
|
|
5498
|
+
options,
|
|
5499
|
+
tab,
|
|
5500
|
+
setSelectedRowKeys: setSelectedRowKeys2,
|
|
5501
|
+
groupByDomain,
|
|
5502
|
+
enabled: enabledCallAPI,
|
|
5503
|
+
actionData
|
|
5504
|
+
} = props;
|
|
5498
5505
|
const { env } = (0, provider_exports.useEnv)();
|
|
5499
|
-
const { useGetFormView: useGetFormView2 } = (0, provider_exports.useService)();
|
|
5506
|
+
const { useGetView: useGetView2, useGetListData: useGetListData2, useGetFormView: useGetFormView2 } = (0, provider_exports.useService)();
|
|
5507
|
+
const [order, setOrder] = (0, import_react17.useState)();
|
|
5500
5508
|
const [page, setPage] = (0, import_react17.useState)(0);
|
|
5501
5509
|
const [domainMany2Many, setDomainMany2Many] = (0, import_react17.useState)(null);
|
|
5502
|
-
const
|
|
5510
|
+
const [debouncedPage] = useDebounce(page, 500);
|
|
5503
5511
|
const contextObject = {
|
|
5504
5512
|
...env.context,
|
|
5505
5513
|
...context || {}
|
|
5506
5514
|
};
|
|
5507
|
-
const
|
|
5508
|
-
model:
|
|
5515
|
+
const viewParams = {
|
|
5516
|
+
model: relation,
|
|
5509
5517
|
views: [
|
|
5510
5518
|
[false, "list"],
|
|
5511
5519
|
[false, "search"]
|
|
5512
5520
|
],
|
|
5513
5521
|
context: contextObject
|
|
5514
|
-
}
|
|
5522
|
+
};
|
|
5523
|
+
const { data: viewResponse } = useGetView2(viewParams, enabledCallAPI);
|
|
5524
|
+
const baseModel = (0, import_react17.useMemo)(
|
|
5525
|
+
() => ({
|
|
5526
|
+
name: String(relation),
|
|
5527
|
+
view: viewResponse || {},
|
|
5528
|
+
actContext: contextObject,
|
|
5529
|
+
fields: [
|
|
5530
|
+
...Object.values(viewResponse?.views?.list?.fields ?? {}),
|
|
5531
|
+
...tab?.fields ? tab.fields : []
|
|
5532
|
+
]
|
|
5533
|
+
}),
|
|
5534
|
+
[relation, viewResponse]
|
|
5535
|
+
);
|
|
5536
|
+
const initModel = (0, import_hooks2.useModel)();
|
|
5537
|
+
const modelInstance = (0, import_react17.useMemo)(() => {
|
|
5538
|
+
if (viewResponse) {
|
|
5539
|
+
return initModel.initModel(baseModel);
|
|
5540
|
+
}
|
|
5541
|
+
return null;
|
|
5542
|
+
}, [baseModel, viewResponse]);
|
|
5543
|
+
const specification = (0, import_react17.useMemo)(() => {
|
|
5544
|
+
if (modelInstance) {
|
|
5545
|
+
return modelInstance.getSpecification();
|
|
5546
|
+
}
|
|
5547
|
+
return null;
|
|
5548
|
+
}, [modelInstance]);
|
|
5549
|
+
const default_order = viewResponse && viewResponse?.views?.list?.default_order;
|
|
5515
5550
|
const optionsObject = tab?.options ? (0, import_utils8.evalJSONContext)(tab?.options) : (options ? (0, import_utils8.evalJSONContext)(options) : {}) || {};
|
|
5516
5551
|
const fetchData = async () => {
|
|
5517
5552
|
try {
|
|
@@ -5522,17 +5557,32 @@ var many2manyFieldController = (props) => {
|
|
|
5522
5557
|
console.log(err);
|
|
5523
5558
|
}
|
|
5524
5559
|
};
|
|
5560
|
+
const queryKey = [
|
|
5561
|
+
`view-${relation}`,
|
|
5562
|
+
specification,
|
|
5563
|
+
domainMany2Many,
|
|
5564
|
+
debouncedPage,
|
|
5565
|
+
groupByDomain,
|
|
5566
|
+
order
|
|
5567
|
+
];
|
|
5568
|
+
const data = {
|
|
5569
|
+
model: relation,
|
|
5570
|
+
specification,
|
|
5571
|
+
domain: domainMany2Many,
|
|
5572
|
+
offset: debouncedPage * 10,
|
|
5573
|
+
limit: 10,
|
|
5574
|
+
context: contextObject,
|
|
5575
|
+
fields: groupByDomain?.fields,
|
|
5576
|
+
groupby: [groupByDomain?.contexts[0]?.group_by],
|
|
5577
|
+
sort: order ? order : default_order ? (0, import_utils8.formatSortingString)(default_order) : ""
|
|
5578
|
+
};
|
|
5579
|
+
const enabled = enabledCallAPI && !!specification && !!relation && !!domainMany2Many && !!viewResponse;
|
|
5525
5580
|
const {
|
|
5526
5581
|
data: dataResponse,
|
|
5582
|
+
isLoading,
|
|
5527
5583
|
isFetched,
|
|
5528
|
-
isPlaceholderData
|
|
5529
|
-
|
|
5530
|
-
} = useListData({
|
|
5531
|
-
action,
|
|
5532
|
-
context,
|
|
5533
|
-
model: String(relation),
|
|
5534
|
-
viewData: viewResponse
|
|
5535
|
-
});
|
|
5584
|
+
isPlaceholderData
|
|
5585
|
+
} = useGetListData2(data, queryKey, enabled);
|
|
5536
5586
|
(0, import_react17.useEffect)(() => {
|
|
5537
5587
|
if (viewResponse) {
|
|
5538
5588
|
fetchData();
|
|
@@ -5563,31 +5613,7 @@ var many2manyFieldController = (props) => {
|
|
|
5563
5613
|
)?.map((col) => ({ ...col.field })) ?? []
|
|
5564
5614
|
]
|
|
5565
5615
|
});
|
|
5566
|
-
const {
|
|
5567
|
-
refetch,
|
|
5568
|
-
data: dataFormViewResponse,
|
|
5569
|
-
isSuccess
|
|
5570
|
-
} = useGetFormView2({
|
|
5571
|
-
data: {
|
|
5572
|
-
id: null,
|
|
5573
|
-
model: relation ?? "",
|
|
5574
|
-
context: contextObject
|
|
5575
|
-
},
|
|
5576
|
-
queryKey: [`form-view-action-${relation}`],
|
|
5577
|
-
enabled: false
|
|
5578
|
-
});
|
|
5579
|
-
(0, import_react17.useEffect)(() => {
|
|
5580
|
-
if (isSuccess && dataFormViewResponse) {
|
|
5581
|
-
sessionStorage.setItem("actionData", JSON.stringify(dataFormViewResponse));
|
|
5582
|
-
window.location.href = `/form/menu?model=${relation}`;
|
|
5583
|
-
}
|
|
5584
|
-
}, [isSuccess]);
|
|
5585
5616
|
const handleCreateNewOnPage = async () => {
|
|
5586
|
-
try {
|
|
5587
|
-
refetch();
|
|
5588
|
-
} catch (error) {
|
|
5589
|
-
console.log(error);
|
|
5590
|
-
}
|
|
5591
5617
|
};
|
|
5592
5618
|
return {
|
|
5593
5619
|
handleCreateNewOnPage,
|
|
@@ -7252,7 +7278,7 @@ var searchController = ({
|
|
|
7252
7278
|
const formatDomain = () => {
|
|
7253
7279
|
if (domainAction) {
|
|
7254
7280
|
const domain2 = [];
|
|
7255
|
-
if (domainAction
|
|
7281
|
+
if (Array.isArray(domainAction) && domainAction.length > 0) {
|
|
7256
7282
|
if (Object.keys(searchMap).some((key) => !key.includes(import_constants3.SearchType.GROUP))) {
|
|
7257
7283
|
domain2.push("&");
|
|
7258
7284
|
}
|