@fctc/widget-logic 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks.d.mts +919 -1
- package/dist/hooks.d.ts +919 -1
- package/dist/hooks.js +530 -9
- package/dist/hooks.mjs +544 -9
- package/dist/index.d.mts +65 -166
- package/dist/index.d.ts +65 -166
- package/dist/index.js +816 -231
- package/dist/index.mjs +801 -207
- package/dist/types.d.mts +4 -98
- package/dist/types.d.ts +4 -98
- package/dist/utils.d.mts +36 -0
- package/dist/utils.d.ts +36 -0
- package/dist/utils.js +277 -0
- package/dist/utils.mjs +239 -0
- package/package.json +66 -57
package/dist/index.d.ts
CHANGED
|
@@ -1,95 +1,75 @@
|
|
|
1
|
-
export { useClickOutside, useDebounce } from './hooks.js';
|
|
1
|
+
export { ActionResultType, Context, Record, ViewResponse, useAuth, useAuthType, useCallAction, useCallActionType, useClickOutside, useConfig, useConfigType, useDebounce, useDetail, useListData, useListDataType, useMenu, useMenuType, useProfile, useUser, useUserType, useViewV2, useViewV2Type } from './hooks.js';
|
|
2
2
|
export { CloseIcon, EyeIcon, LoadingIcon } from './icons.js';
|
|
3
|
-
import {
|
|
4
|
-
export { ColorType, GoogleLoginType } from './types.js';
|
|
3
|
+
import { IInputFieldProps, ValuePropsType } from './types.js';
|
|
5
4
|
import * as react from 'react';
|
|
6
5
|
import { ChangeEvent } from 'react';
|
|
7
|
-
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
8
|
-
import * as _fctc_interface_logic from '@fctc/interface-logic';
|
|
9
|
-
import { BaseModelInit } from '@fctc/interface-logic';
|
|
10
|
-
import * as _fctc_interface_logic_dist_index_C_nK1Mii from '@fctc/interface-logic/dist/index-C_nK1Mii';
|
|
11
6
|
import day from 'react-datepicker/dist/day';
|
|
12
7
|
import month from 'react-datepicker/dist/month';
|
|
13
8
|
import year from 'react-datepicker/dist/year';
|
|
14
9
|
import moment from 'moment';
|
|
10
|
+
export { API_APP_URL, API_PRESCHOOL_URL, STORAGES, combineContexts, convertFieldsToArray, countSum, getDateRange, languages, mergeButtons, setStorageItemAsync, useGetRowIds, useStorageState } from './utils.js';
|
|
11
|
+
import '@tanstack/react-query';
|
|
12
|
+
import '@fctc/interface-logic';
|
|
15
13
|
|
|
16
14
|
type TStatus = 'normal' | 'done' | 'blocked';
|
|
17
|
-
interface
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
id
|
|
21
|
-
model?: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
state?: string | undefined;
|
|
24
|
-
onRefetch?: Function;
|
|
15
|
+
interface TStatusDropdownFieldProps extends IInputFieldProps {
|
|
16
|
+
state: any;
|
|
17
|
+
selection: any;
|
|
18
|
+
id: any;
|
|
25
19
|
}
|
|
26
20
|
|
|
27
|
-
declare const statusDropdownController: (props:
|
|
21
|
+
declare const statusDropdownController: (props: TStatusDropdownFieldProps) => {
|
|
28
22
|
handleClick: (status: any) => Promise<void>;
|
|
29
23
|
buttonRef: react.RefObject<HTMLDivElement>;
|
|
30
24
|
isForm: boolean | undefined;
|
|
31
25
|
setIsOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
32
26
|
isOpen: boolean;
|
|
33
27
|
selection: any;
|
|
34
|
-
state:
|
|
28
|
+
state: any;
|
|
35
29
|
colors: Record<TStatus, string>;
|
|
36
30
|
};
|
|
37
31
|
|
|
38
|
-
interface
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
relation: any;
|
|
44
|
-
onChange: any;
|
|
45
|
-
value: any;
|
|
46
|
-
context: any;
|
|
47
|
-
options: any;
|
|
48
|
-
showDetail: any;
|
|
49
|
-
actionData: any;
|
|
32
|
+
interface IMany2OneProps extends IInputFieldProps {
|
|
33
|
+
context?: any;
|
|
34
|
+
options?: any;
|
|
35
|
+
showDetail?: boolean;
|
|
36
|
+
actionData?: any;
|
|
50
37
|
}
|
|
51
38
|
|
|
52
|
-
declare const many2oneFieldController: (props:
|
|
53
|
-
allowShowDetail:
|
|
39
|
+
declare const many2oneFieldController: (props: IMany2OneProps) => {
|
|
40
|
+
allowShowDetail: boolean;
|
|
54
41
|
handleClose: () => void;
|
|
55
42
|
handleChooseRecord: (idRecord: number) => void;
|
|
56
43
|
handleSelectChange: (selectedOption: any) => void;
|
|
57
44
|
initValue: any;
|
|
58
45
|
isFetching: boolean;
|
|
59
46
|
isShowModalMany2Many: boolean;
|
|
60
|
-
options:
|
|
47
|
+
options: any[];
|
|
61
48
|
fetchMoreOptions: () => void;
|
|
62
|
-
domainModal:
|
|
49
|
+
domainModal: any;
|
|
63
50
|
tempSelectedOption: any;
|
|
64
|
-
setTempSelectedOption:
|
|
65
|
-
setDomainModal:
|
|
51
|
+
setTempSelectedOption: React.Dispatch<React.SetStateAction<any>>;
|
|
52
|
+
setDomainModal: React.Dispatch<React.SetStateAction<any>>;
|
|
66
53
|
dataOfSelection: any;
|
|
67
|
-
refetch: (
|
|
68
|
-
selectOptions: any;
|
|
69
|
-
optionsObject:
|
|
54
|
+
refetch: () => void;
|
|
55
|
+
selectOptions: any[];
|
|
56
|
+
optionsObject: any;
|
|
70
57
|
contextObject: any;
|
|
71
58
|
actionId: any;
|
|
72
|
-
setIsShowModalMany2Many:
|
|
59
|
+
setIsShowModalMany2Many: React.Dispatch<React.SetStateAction<boolean>>;
|
|
73
60
|
};
|
|
74
61
|
|
|
75
62
|
type Option = {
|
|
76
63
|
value: number;
|
|
77
64
|
label: string;
|
|
78
65
|
};
|
|
79
|
-
declare const many2oneButtonController: (
|
|
80
|
-
relation: string;
|
|
81
|
-
methods: any;
|
|
82
|
-
domain: any;
|
|
83
|
-
}) => {
|
|
66
|
+
declare const many2oneButtonController: (props: IInputFieldProps) => {
|
|
84
67
|
options: Option[];
|
|
85
68
|
};
|
|
86
69
|
|
|
87
|
-
interface
|
|
88
|
-
relation: string;
|
|
89
|
-
domain: any;
|
|
70
|
+
interface IMany2ManyControllerProps extends IInputFieldProps {
|
|
90
71
|
context: any;
|
|
91
72
|
tab: any;
|
|
92
|
-
model: string;
|
|
93
73
|
aid: number;
|
|
94
74
|
setSelectedRowKeys: any;
|
|
95
75
|
fields: any;
|
|
@@ -100,69 +80,27 @@ interface Many2ManyControllerProps {
|
|
|
100
80
|
sessionStorageUtils: any;
|
|
101
81
|
}
|
|
102
82
|
|
|
103
|
-
declare const many2manyFieldController: (props:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
isDataLoading: boolean;
|
|
111
|
-
isDataResponseFetched: boolean;
|
|
112
|
-
isPlaceholderData: boolean;
|
|
113
|
-
queryKey: any[];
|
|
114
|
-
data: {
|
|
115
|
-
model: string;
|
|
116
|
-
specification: Record<string, any> | null;
|
|
117
|
-
domain: any;
|
|
118
|
-
offset: number;
|
|
119
|
-
limit: number;
|
|
120
|
-
context: any;
|
|
121
|
-
fields: any;
|
|
122
|
-
groupby: any[];
|
|
123
|
-
sort: string | null;
|
|
124
|
-
};
|
|
125
|
-
specification: Record<string, any> | null;
|
|
126
|
-
enabled: boolean;
|
|
127
|
-
isViewReponseFetched: boolean;
|
|
128
|
-
actionData: any;
|
|
129
|
-
viewResponse: any;
|
|
130
|
-
debouncedPage: number;
|
|
131
|
-
order: undefined;
|
|
132
|
-
default_order: any;
|
|
133
|
-
optionsObject: {} | null;
|
|
134
|
-
setDomainMany2Many: react.Dispatch<any>;
|
|
135
|
-
selectedTags: [];
|
|
136
|
-
initModel: {
|
|
137
|
-
initModel: (modelData: _fctc_interface_logic_dist_index_C_nK1Mii.a) => _fctc_interface_logic.BaseModel;
|
|
138
|
-
};
|
|
139
|
-
modelInstance: _fctc_interface_logic.BaseModel | null;
|
|
140
|
-
baseModel: BaseModelInit;
|
|
141
|
-
dataResponse: any;
|
|
142
|
-
isLoading: boolean;
|
|
143
|
-
setOrder: react.Dispatch<react.SetStateAction<undefined>>;
|
|
144
|
-
};
|
|
83
|
+
declare const many2manyFieldController: (props: IMany2ManyControllerProps) => {};
|
|
84
|
+
|
|
85
|
+
interface IMany2ManyTagFieldProps extends IInputFieldProps {
|
|
86
|
+
options: any;
|
|
87
|
+
widget: string;
|
|
88
|
+
placeholderNoOption: string;
|
|
89
|
+
}
|
|
145
90
|
|
|
146
|
-
declare const many2manyTagsController: (props:
|
|
91
|
+
declare const many2manyTagsController: (props: IMany2ManyTagFieldProps) => {
|
|
147
92
|
options: any;
|
|
148
|
-
customNoOptionsMessage: () =>
|
|
93
|
+
customNoOptionsMessage: () => string;
|
|
149
94
|
tranfer: (data: any) => any;
|
|
150
95
|
dataOfSelection: any;
|
|
151
96
|
isUser: boolean;
|
|
152
97
|
};
|
|
153
98
|
|
|
154
|
-
interface
|
|
155
|
-
|
|
156
|
-
defaultValue?: string | number | ValuePropsType;
|
|
157
|
-
domain?: string | [] | any;
|
|
158
|
-
formValues?: Record<string, any>;
|
|
159
|
-
name?: string;
|
|
160
|
-
id?: string | number;
|
|
161
|
-
model?: string;
|
|
162
|
-
onRefetch?: Function;
|
|
99
|
+
interface IDurationFieldProps extends IInputFieldProps {
|
|
100
|
+
id: any;
|
|
163
101
|
}
|
|
164
102
|
|
|
165
|
-
declare const durationController: (props:
|
|
103
|
+
declare const durationController: (props: IDurationFieldProps) => {
|
|
166
104
|
defaultValue: string | number | ValuePropsType | undefined;
|
|
167
105
|
dataResponse: any;
|
|
168
106
|
handleClick: (stage_id: any) => Promise<void>;
|
|
@@ -171,23 +109,17 @@ declare const durationController: (props: IDurationProps) => {
|
|
|
171
109
|
setModalStatus: react.Dispatch<react.SetStateAction<boolean>>;
|
|
172
110
|
};
|
|
173
111
|
|
|
174
|
-
interface
|
|
175
|
-
value: any;
|
|
112
|
+
interface IPriorityFieldProps extends IInputFieldProps {
|
|
176
113
|
selection: any;
|
|
177
|
-
|
|
178
|
-
name: string;
|
|
179
|
-
methods: any;
|
|
180
|
-
id: string;
|
|
181
|
-
onChange: any;
|
|
182
|
-
model: any;
|
|
114
|
+
id: any;
|
|
183
115
|
actionData: any;
|
|
184
116
|
viewData: any;
|
|
185
117
|
context: any;
|
|
186
118
|
}
|
|
187
119
|
|
|
188
|
-
declare const priorityFieldController: (props:
|
|
120
|
+
declare const priorityFieldController: (props: IPriorityFieldProps) => {
|
|
189
121
|
selection: any;
|
|
190
|
-
isForm: boolean;
|
|
122
|
+
isForm: boolean | undefined;
|
|
191
123
|
methods: any;
|
|
192
124
|
defaultPriority: number;
|
|
193
125
|
savePriorities: ({ value, resetPriority, }: {
|
|
@@ -195,8 +127,8 @@ declare const priorityFieldController: (props: PriorityFieldProps) => {
|
|
|
195
127
|
resetPriority?: () => void;
|
|
196
128
|
}) => Promise<void>;
|
|
197
129
|
label: any;
|
|
198
|
-
id:
|
|
199
|
-
onChange: any;
|
|
130
|
+
id: any;
|
|
131
|
+
onChange: ((name: string, value: any) => void) | undefined;
|
|
200
132
|
};
|
|
201
133
|
|
|
202
134
|
declare const floatTimeFiledController: ({ onChange: fieldOnChange, onBlur, value, isDirty, props, }: {
|
|
@@ -205,7 +137,7 @@ declare const floatTimeFiledController: ({ onChange: fieldOnChange, onBlur, valu
|
|
|
205
137
|
value: any;
|
|
206
138
|
error: any;
|
|
207
139
|
isDirty: any;
|
|
208
|
-
props:
|
|
140
|
+
props: IInputFieldProps;
|
|
209
141
|
}) => {
|
|
210
142
|
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
211
143
|
handleBlur: () => void;
|
|
@@ -217,7 +149,7 @@ declare const floatTimeFiledController: ({ onChange: fieldOnChange, onBlur, valu
|
|
|
217
149
|
declare const floatController: ({ onChange, value, props, }: {
|
|
218
150
|
onChange: any;
|
|
219
151
|
value: any;
|
|
220
|
-
props:
|
|
152
|
+
props: IInputFieldProps;
|
|
221
153
|
}) => {
|
|
222
154
|
handleInputMouseLeave: () => void;
|
|
223
155
|
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -233,24 +165,26 @@ declare const downloadFileController: () => {
|
|
|
233
165
|
handleFileDownload: () => void;
|
|
234
166
|
};
|
|
235
167
|
|
|
236
|
-
|
|
237
|
-
value: any;
|
|
238
|
-
defaultValue: any;
|
|
239
|
-
formValues: any;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
declare const downLoadBinaryController: (props: TDownLoadBinaryProps) => {
|
|
168
|
+
declare const downLoadBinaryController: (props: IInputFieldProps) => {
|
|
243
169
|
handleFileDownload: (e: any) => Promise<void>;
|
|
244
170
|
};
|
|
245
171
|
|
|
246
|
-
|
|
172
|
+
interface IDateFieldProps extends IInputFieldProps {
|
|
173
|
+
showTime: boolean;
|
|
174
|
+
widget: string;
|
|
175
|
+
min: number | string;
|
|
176
|
+
max: number | string;
|
|
177
|
+
viewData: any;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
declare const dateFieldController: (props: IDateFieldProps) => {
|
|
247
181
|
formatDate: string;
|
|
248
182
|
formatDateParse: string;
|
|
249
183
|
range: (start: number, end: number, step?: number) => number[];
|
|
250
184
|
years: number[];
|
|
251
185
|
months_vi: string[];
|
|
252
186
|
months_en: string[];
|
|
253
|
-
customValidateMinMax: (date: any) =>
|
|
187
|
+
customValidateMinMax: (date: any) => string | false;
|
|
254
188
|
minNowValue: boolean | moment.Moment | null;
|
|
255
189
|
maxNowValue: boolean | moment.Moment | null;
|
|
256
190
|
year: typeof year;
|
|
@@ -258,31 +192,18 @@ declare const dateFieldController: (props: any) => {
|
|
|
258
192
|
day: typeof day;
|
|
259
193
|
};
|
|
260
194
|
|
|
261
|
-
declare const copyLinkButtonController: (props:
|
|
195
|
+
declare const copyLinkButtonController: (props: IInputFieldProps) => {
|
|
262
196
|
isCopied: boolean;
|
|
263
197
|
handleCopyToClipboard: (value: string) => Promise<void>;
|
|
264
198
|
propValue: any;
|
|
265
199
|
};
|
|
266
200
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
setSelectedColor: react.Dispatch<any>;
|
|
271
|
-
handleShowFullColors: () => void;
|
|
272
|
-
pickColorsRef: react.RefObject<HTMLDivElement>;
|
|
273
|
-
savePickColor: any;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
interface ColorFieldProps extends IInputFieldProps {
|
|
277
|
-
value?: string | number | ValuePropsType | null | Record<any, any> | any;
|
|
278
|
-
isForm?: boolean;
|
|
279
|
-
name?: string;
|
|
280
|
-
methods?: any;
|
|
281
|
-
onChange?: (name: string, value: any) => void;
|
|
282
|
-
[key: string]: any;
|
|
201
|
+
interface IColorFieldProps extends IInputFieldProps {
|
|
202
|
+
actionData: any;
|
|
203
|
+
idForm: number | string;
|
|
283
204
|
}
|
|
284
205
|
|
|
285
|
-
declare const colorFieldController: (props:
|
|
206
|
+
declare const colorFieldController: (props: IColorFieldProps) => {
|
|
286
207
|
savePickColor: (colorObject: any) => Promise<void>;
|
|
287
208
|
};
|
|
288
209
|
|
|
@@ -298,26 +219,4 @@ declare const binaryFieldController: (props: IInputFieldProps) => {
|
|
|
298
219
|
getImageBase64WithMimeType: (base64: any) => string | null;
|
|
299
220
|
};
|
|
300
221
|
|
|
301
|
-
|
|
302
|
-
data: {
|
|
303
|
-
fields: any[];
|
|
304
|
-
records: any[];
|
|
305
|
-
dataModel: {
|
|
306
|
-
[fieldName: string]: {
|
|
307
|
-
string?: string;
|
|
308
|
-
[key: string]: any;
|
|
309
|
-
};
|
|
310
|
-
};
|
|
311
|
-
context: any;
|
|
312
|
-
typeTable?: 'list' | 'group' | 'calendar';
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
declare const useTableHandler: ({ data }: UseTableProps) => {
|
|
317
|
-
rows: any[];
|
|
318
|
-
columns: any;
|
|
319
|
-
onToggleColumnOptional: (item: any) => void;
|
|
320
|
-
typeTable: "list" | "group" | "calendar" | undefined;
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
export { ColorWrapperControllerProps, IInputFieldProps, ValuePropsType, WidgetPropsType, binaryFieldController, colorFieldController, colorWrapperController, copyLinkButtonController, dateFieldController, downLoadBinaryController, downloadFileController, durationController, floatController, floatTimeFiledController, many2manyFieldController, many2manyTagsController, many2oneButtonController, many2oneFieldController, priorityFieldController, statusDropdownController, useTableHandler };
|
|
222
|
+
export { IInputFieldProps, ValuePropsType, binaryFieldController, colorFieldController, copyLinkButtonController, dateFieldController, downLoadBinaryController, downloadFileController, durationController, floatController, floatTimeFiledController, many2manyFieldController, many2manyTagsController, many2oneButtonController, many2oneFieldController, priorityFieldController, statusDropdownController };
|