@fctc/widget-logic 5.3.7-beta.15 → 5.3.7-beta.16

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/utils.mjs DELETED
@@ -1,389 +0,0 @@
1
- // src/utils/constants.ts
2
- var languages = [
3
- { id: "vi_VN", name: "VIE" },
4
- { id: "en_US", name: "ENG" }
5
- ];
6
-
7
- // src/utils/function.ts
8
- import { useCallback, useEffect, useReducer } from "react";
9
- var countSum = (data, field) => {
10
- if (!data || !field) return 0;
11
- return data.reduce(
12
- (total, item) => total + (item?.[`${field}_count`] || 0),
13
- 0
14
- );
15
- };
16
- var isObjectEmpty = (obj) => {
17
- return Object.keys(obj).length === 0;
18
- };
19
- function mergeButtons(fields) {
20
- const buttons = fields?.filter((f) => f.type_co === "button");
21
- const others = fields?.filter((f) => f.type_co !== "button");
22
- if (buttons?.length) {
23
- others.push({
24
- type_co: "buttons",
25
- buttons
26
- });
27
- }
28
- return others;
29
- }
30
- var STORAGES = {
31
- TOKEN: "accessToken",
32
- USER_INFO: "USER_INFO"
33
- };
34
- function useAsyncState(initialValue = [true, null]) {
35
- return useReducer(
36
- (_state, action = null) => [false, action],
37
- initialValue
38
- );
39
- }
40
- async function setStorageItemAsync(key, value) {
41
- try {
42
- if (value === null) {
43
- localStorage.removeItem(key);
44
- } else {
45
- localStorage.setItem(key, value);
46
- }
47
- } catch (e) {
48
- console.error("Local storage is unavailable:", e);
49
- }
50
- }
51
- function useStorageState(key) {
52
- const [state, setState] = useAsyncState();
53
- useEffect(() => {
54
- try {
55
- const storedValue = localStorage.getItem(key);
56
- setState(storedValue);
57
- } catch (e) {
58
- console.error("Local storage is unavailable:", e);
59
- }
60
- }, [key]);
61
- const setValue = useCallback(
62
- (value) => {
63
- setState(value);
64
- setStorageItemAsync(key, value);
65
- },
66
- [key]
67
- );
68
- return [state, setValue];
69
- }
70
- var guessTypeFromUrl = (url) => {
71
- const ext = url.split(".").pop()?.toLowerCase();
72
- if (!ext) return null;
73
- const map = {
74
- jpg: "image/jpeg",
75
- jpeg: "image/jpeg",
76
- png: "image/png",
77
- webp: "image/webp",
78
- gif: "image/gif",
79
- svg: "image/svg+xml",
80
- bmp: "image/bmp",
81
- tiff: "image/tiff",
82
- pdf: "application/pdf",
83
- zip: "application/zip",
84
- rar: "application/x-rar-compressed",
85
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
86
- xls: "application/vnd.ms-excel",
87
- mp4: "video/mp4",
88
- mov: "video/quicktime"
89
- };
90
- return map[ext] || null;
91
- };
92
-
93
- // src/utils/format-date.ts
94
- import moment from "moment";
95
- var validateAndParseDate = (input, isDateTime = false) => {
96
- if (!input || typeof input !== "string") return null;
97
- const cleanInput = input.replace(/[^0-9-\/:\s]/g, "");
98
- const dateFormat = "YYYY-MM-DD";
99
- const dateTimeFormat = "YYYY-MM-DD HH:mm:ss";
100
- const currentDay = moment().format("DD");
101
- const currentMonth = moment().format("MM");
102
- const currentYear = moment().format("YYYY");
103
- const defaultTime = "00:00:00";
104
- const maxYear = parseInt(currentYear) + 10;
105
- const isValidDate = (day, month, year) => {
106
- const date = moment(`${day}-${month}-${year}`, "DD-MM-YYYY", true);
107
- return date.isValid();
108
- };
109
- const isValidTime = (hour, minute = "00", second = "00") => {
110
- const h = parseInt(hour, 10);
111
- const m = parseInt(minute, 10);
112
- const s = parseInt(second, 10);
113
- return h >= 0 && h <= 23 && m >= 0 && m <= 59 && s >= 0 && s <= 59;
114
- };
115
- const formatOutput = (day, month, year, time = defaultTime) => {
116
- let result = moment(
117
- `${day}-${month}-${year} ${time}`,
118
- "DD-MM-YYYY HH:mm:ss"
119
- );
120
- if (!result.isValid()) return null;
121
- if (isDateTime) {
122
- result = result.subtract(7, "hours");
123
- return result.format(dateTimeFormat);
124
- }
125
- return result.format(dateFormat);
126
- };
127
- if (isDateTime && input.match(
128
- /^\d{1,2}[\/-]\d{1,2}[\/-]\d{2,4}\s+\d{1,2}(:\d{1,2}(:\d{1,2})?)?$/
129
- )) {
130
- const [datePart, timePart] = input.split(/\s+/);
131
- const dateParts = datePart.split(/[\/-]/);
132
- const timeParts = timePart.split(":");
133
- const day = dateParts[0].padStart(2, "0");
134
- const month = dateParts[1].padStart(2, "0");
135
- const year = dateParts[2].length <= 2 ? `20${dateParts[2].padStart(2, "0")}` : dateParts[2].padStart(4, "0");
136
- const hour = timeParts[0].padStart(2, "0");
137
- const minute = timeParts[1] ? timeParts[1].padStart(2, "0") : "00";
138
- const second = timeParts[2] ? timeParts[2].padStart(2, "0") : "00";
139
- if (isValidDate(day, month, year) && isValidTime(hour, minute, second)) {
140
- let result = moment(
141
- `${day}-${month}-${year} ${hour}:${minute}:${second}`,
142
- "DD-MM-YYYY HH:mm:ss"
143
- );
144
- if (!result.isValid()) return null;
145
- result = result.subtract(7, "hours");
146
- return result.format(dateTimeFormat);
147
- }
148
- return null;
149
- }
150
- if (cleanInput.match(/^\d{4}-\d{2}-\d{2}$/)) {
151
- const [year, month, day] = cleanInput.split("-");
152
- if (isValidDate(day, month, year)) {
153
- return formatOutput(day, month, year);
154
- }
155
- return null;
156
- }
157
- if (cleanInput.match(/^\d{1,2}\/\d{1,2}\/\d{2,4}$/)) {
158
- const [day, month, year] = cleanInput.split("/");
159
- const paddedDay = day.padStart(2, "0");
160
- const paddedMonth = month.padStart(2, "0");
161
- const fullYear = year.length <= 2 ? `20${year.padStart(2, "0")}` : year.padStart(4, "0");
162
- if (isValidDate(paddedDay, paddedMonth, fullYear)) {
163
- return formatOutput(paddedDay, paddedMonth, fullYear);
164
- }
165
- return null;
166
- }
167
- if (cleanInput.match(/^\d{1,2}-\d{1,2}-\d{2,4}$/)) {
168
- const [day, month, year] = cleanInput.split("-");
169
- const paddedDay = day.padStart(2, "0");
170
- const paddedMonth = month.padStart(2, "0");
171
- const fullYear = year.length <= 2 ? `20${year.padStart(2, "0")}` : year.padStart(4, "0");
172
- if (isValidDate(paddedDay, paddedMonth, fullYear)) {
173
- return formatOutput(paddedDay, paddedMonth, fullYear);
174
- }
175
- return null;
176
- }
177
- if (cleanInput.match(/^\d{1,2}[\/-]\d{1,2}$/)) {
178
- const [day, month] = cleanInput.split(/[\/-]/);
179
- const paddedDay = day.padStart(2, "0");
180
- const paddedMonth = month.padStart(2, "0");
181
- if (isValidDate(paddedDay, paddedMonth, currentYear)) {
182
- return formatOutput(paddedDay, paddedMonth, currentYear);
183
- }
184
- return null;
185
- }
186
- if (cleanInput.match(/^\d{4}$/)) {
187
- const num = parseInt(cleanInput, 10);
188
- if (num >= 2e3 && num <= maxYear) {
189
- if (isValidDate(currentDay, currentMonth, num.toString())) {
190
- return formatOutput(currentDay, currentMonth, num.toString());
191
- }
192
- return null;
193
- }
194
- const day = cleanInput.slice(0, 2);
195
- const month = cleanInput.slice(2, 4);
196
- if (isValidDate(day, month, currentYear)) {
197
- return formatOutput(day, month, currentYear);
198
- }
199
- return null;
200
- }
201
- if (cleanInput.startsWith("-") && /^\-\d+$/.test(cleanInput)) {
202
- const daysToSubtract = Math.abs(parseInt(cleanInput, 10));
203
- let result = moment().subtract(daysToSubtract, "days");
204
- if (isDateTime) {
205
- result = result.subtract(7, "hours");
206
- }
207
- if (result.isValid()) {
208
- return isDateTime ? result.format(dateTimeFormat) : result.format(dateFormat);
209
- }
210
- return null;
211
- }
212
- if (input.match(/^\d{1,2}[^0-9-\/]+\d{1,2}[^0-9-\/]+\d{2,4}.*$/)) {
213
- const parts = input.split(/[^0-9-\/]+/).filter(Boolean);
214
- const day = parts[0].padStart(2, "0");
215
- const month = parts[1].padStart(2, "0");
216
- let year = parts[2];
217
- year = year.length === 2 ? `20${year}` : year.padStart(4, "0");
218
- if (isValidDate(day, month, year)) {
219
- return formatOutput(day, month, year);
220
- }
221
- return null;
222
- }
223
- if (isDateTime) {
224
- if (cleanInput.length === 9) {
225
- const day = cleanInput.slice(0, 2);
226
- const month = cleanInput.slice(2, 4);
227
- const year = cleanInput.slice(4, 8);
228
- const hour = cleanInput.slice(8, 9).padStart(2, "0");
229
- if (isValidDate(day, month, year) && isValidTime(hour)) {
230
- let result = moment(
231
- `${day}-${month}-${year} ${hour}:00:00`,
232
- "DD-MM-YYYY HH:mm:ss"
233
- );
234
- if (!result.isValid()) return null;
235
- result = result.subtract(7, "hours");
236
- return result.format(dateTimeFormat);
237
- }
238
- return null;
239
- }
240
- if (cleanInput.length === 10) {
241
- const day = cleanInput.slice(0, 2);
242
- const month = cleanInput.slice(2, 4);
243
- const year = cleanInput.slice(4, 8);
244
- const hour = cleanInput.slice(8, 10);
245
- if (isValidDate(day, month, year) && isValidTime(hour)) {
246
- let result = moment(
247
- `${day}-${month}-${year} ${hour}:00:00`,
248
- "DD-MM-YYYY HH:mm:ss"
249
- );
250
- if (!result.isValid()) return null;
251
- result = result.subtract(7, "hours");
252
- return result.format(dateTimeFormat);
253
- }
254
- return null;
255
- }
256
- if (cleanInput.length === 11) {
257
- const day = cleanInput.slice(0, 2);
258
- const month = cleanInput.slice(2, 4);
259
- const year = cleanInput.slice(4, 8);
260
- const hour = cleanInput.slice(8, 10);
261
- const minute = cleanInput.slice(10, 11).padStart(2, "0");
262
- if (isValidDate(day, month, year) && isValidTime(hour, minute)) {
263
- let result = moment(
264
- `${day}-${month}-${year} ${hour}:${minute}:00`,
265
- "DD-MM-YYYY HH:mm:ss"
266
- );
267
- if (!result.isValid()) return null;
268
- result = result.subtract(7, "hours");
269
- return result.format(dateTimeFormat);
270
- }
271
- return null;
272
- }
273
- if (cleanInput.length === 12) {
274
- const day = cleanInput.slice(0, 2);
275
- const month = cleanInput.slice(2, 4);
276
- const year = cleanInput.slice(4, 8);
277
- const hour = cleanInput.slice(8, 10);
278
- const minute = cleanInput.slice(10, 12);
279
- if (isValidDate(day, month, year) && isValidTime(hour, minute)) {
280
- let result = moment(
281
- `${day}-${month}-${year} ${hour}:${minute}:00`,
282
- "DD-MM-YYYY HH:mm:ss"
283
- );
284
- if (!result.isValid()) return null;
285
- result = result.subtract(7, "hours");
286
- return result.format(dateTimeFormat);
287
- }
288
- return null;
289
- }
290
- if (cleanInput.length === 13) {
291
- const day = cleanInput.slice(0, 2);
292
- const month = cleanInput.slice(2, 4);
293
- const year = cleanInput.slice(4, 8);
294
- const hour = cleanInput.slice(8, 10);
295
- const minute = cleanInput.slice(10, 12);
296
- const second = cleanInput.slice(12, 13).padStart(2, "0");
297
- if (isValidDate(day, month, year) && isValidTime(hour, minute, second)) {
298
- let result = moment(
299
- `${day}-${month}-${year} ${hour}:${minute}:${second}`,
300
- "DD-MM-YYYY HH:mm:ss"
301
- );
302
- if (!result.isValid()) return null;
303
- result = result.subtract(7, "hours");
304
- return result.format(dateTimeFormat);
305
- }
306
- return null;
307
- }
308
- if (cleanInput.length === 14) {
309
- const day = cleanInput.slice(0, 2);
310
- const month = cleanInput.slice(2, 4);
311
- const year = cleanInput.slice(4, 8);
312
- const hour = cleanInput.slice(8, 10);
313
- const minute = cleanInput.slice(10, 12);
314
- const second = cleanInput.slice(12, 14);
315
- if (isValidDate(day, month, year) && isValidTime(hour, minute, second)) {
316
- let result = moment(
317
- `${day}-${month}-${year} ${hour}:${minute}:${second}`,
318
- "DD-MM-YYYY HH:mm:ss"
319
- );
320
- if (!result.isValid()) return null;
321
- result = result.subtract(7, "hours");
322
- return result.format(dateTimeFormat);
323
- }
324
- return null;
325
- }
326
- }
327
- const len = cleanInput.length;
328
- if (len === 1 || len === 2) {
329
- const paddedDay = cleanInput.padStart(2, "0");
330
- if (isValidDate(paddedDay, currentMonth, currentYear)) {
331
- return formatOutput(paddedDay, currentMonth, currentYear);
332
- }
333
- return null;
334
- }
335
- if (len === 3) {
336
- const day = cleanInput.slice(0, 2);
337
- const month = cleanInput.slice(2, 3).padStart(2, "0");
338
- if (isValidDate(day, month, currentYear)) {
339
- return formatOutput(day, month, currentYear);
340
- }
341
- return null;
342
- }
343
- if (len === 6) {
344
- const day = cleanInput.slice(0, 2);
345
- const month = cleanInput.slice(2, 4);
346
- let year = cleanInput.slice(4, 6);
347
- year = `20${year}`;
348
- if (parseInt(month) > 12) {
349
- if (isValidDate(day, currentMonth, currentYear)) {
350
- return formatOutput(day, currentMonth, currentYear);
351
- }
352
- return null;
353
- }
354
- if (isValidDate(day, month, year)) {
355
- return formatOutput(day, month, year);
356
- }
357
- return null;
358
- }
359
- if (len === 7) {
360
- return null;
361
- }
362
- if (len === 8) {
363
- const day = cleanInput.slice(0, 2);
364
- const month = cleanInput.slice(2, 4);
365
- const year = cleanInput.slice(4, 8);
366
- if (isValidDate(day, month, year)) {
367
- return formatOutput(day, month, year);
368
- }
369
- return null;
370
- }
371
- if (len > 8 && !isDateTime) {
372
- return null;
373
- }
374
- return null;
375
- };
376
-
377
- // src/utils.ts
378
- export * from "@fctc/interface-logic/utils";
379
- export {
380
- STORAGES,
381
- countSum,
382
- guessTypeFromUrl,
383
- isObjectEmpty,
384
- languages,
385
- mergeButtons,
386
- setStorageItemAsync,
387
- useStorageState,
388
- validateAndParseDate
389
- };
package/dist/widget.d.mts DELETED
@@ -1,328 +0,0 @@
1
- import * as react from 'react';
2
- import { ChangeEvent } from 'react';
3
- import { IInputFieldProps } from './types.mjs';
4
- import '@fctc/interface-logic/types';
5
-
6
- type TStatus = 'normal' | 'done' | 'blocked';
7
- interface TStatusDropdownFieldProps extends IInputFieldProps {
8
- state: any;
9
- selection: any;
10
- id: any;
11
- }
12
-
13
- declare const statusDropdownController: (props: TStatusDropdownFieldProps) => {
14
- handleClick: (status: any) => Promise<void>;
15
- buttonRef: react.RefObject<HTMLDivElement>;
16
- isForm: boolean | undefined;
17
- setIsOpen: react.Dispatch<react.SetStateAction<boolean>>;
18
- isOpen: boolean;
19
- selection: any;
20
- state: any;
21
- colors: Record<TStatus, string>;
22
- };
23
-
24
- interface IMany2OneProps extends IInputFieldProps {
25
- context?: any;
26
- options?: any;
27
- showDetail?: boolean;
28
- actionData?: any;
29
- sessionStorageUtils?: any;
30
- service?: string;
31
- xNode?: string;
32
- in_list_view?: string;
33
- }
34
-
35
- declare const many2oneFieldController: (props: IMany2OneProps) => {
36
- isShowModalMany2Many: boolean;
37
- isFetching: boolean;
38
- initValue: any;
39
- handleChooseRecord: (idRecord: number) => void;
40
- handleClose: () => void;
41
- handleSelectChange: (selectedOption: any) => void;
42
- domainModal: null;
43
- setInputValue: react.Dispatch<react.SetStateAction<string>>;
44
- allowShowDetail: any;
45
- contextObject: any;
46
- tempSelectedOption: any;
47
- listOptions: never[];
48
- fetchMoreOptions: () => void;
49
- domainObject: any;
50
- setIsShowModalMany2Many: react.Dispatch<react.SetStateAction<boolean>>;
51
- setDomainObject: react.Dispatch<react.SetStateAction<null>>;
52
- options: any;
53
- relation: any;
54
- service: any;
55
- };
56
-
57
- type Option = {
58
- value: number;
59
- label: string;
60
- };
61
- declare const many2oneButtonController: (props: any) => {
62
- options: Option[];
63
- };
64
-
65
- interface IMany2ManyControllerProps extends IInputFieldProps {
66
- relation: string;
67
- domain?: any;
68
- context?: any;
69
- options?: any;
70
- enabled?: boolean;
71
- service?: string;
72
- }
73
-
74
- declare const many2manyFieldController: (props: IMany2ManyControllerProps) => {
75
- rows: any[];
76
- columns: any;
77
- optionsObject: any;
78
- viewData: any;
79
- totalRows: any;
80
- onToggleColumnOptional: (item: any) => void;
81
- typeTable: "list" | "group" | "calendar" | undefined;
82
- isLoading: boolean;
83
- isFetched: boolean;
84
- isPlaceholderData: boolean;
85
- page: number;
86
- pageLimit: number;
87
- groupByList: any;
88
- selectedRowKeys: number[];
89
- domain: any;
90
- setPage: react.Dispatch<react.SetStateAction<number>>;
91
- setDomain: react.Dispatch<any>;
92
- setPageLimit: react.Dispatch<react.SetStateAction<number>>;
93
- setGroupByList: react.Dispatch<any>;
94
- setSelectedRowKeys: react.Dispatch<react.SetStateAction<number[]>>;
95
- searchController: {
96
- groupBy: any[] | null;
97
- searchBy: any[] | null;
98
- filterBy: any[] | null;
99
- selectedTags: any[] | null;
100
- searchString: string;
101
- setFilterBy: react.Dispatch<react.SetStateAction<any[] | null>>;
102
- setGroupBy: react.Dispatch<react.SetStateAction<any[] | null>>;
103
- setSearchBy: react.Dispatch<react.SetStateAction<any[] | null>>;
104
- clearSearch: () => void;
105
- setSelectedTags: react.Dispatch<react.SetStateAction<any[] | null>>;
106
- removeSearchItems: (key: string, item: any) => void;
107
- onSearchString: (search_string: string) => void;
108
- handleAddTagSearch: (tag: any) => void;
109
- domain: any[] | undefined;
110
- context: any;
111
- onKeyDown: (e: any) => void;
112
- handleMouseEnter: (index: number) => void;
113
- handleMouseLeave: () => void;
114
- hoveredIndexSearchList: number | null;
115
- };
116
- handleCreateNewOnPage: () => Promise<void>;
117
- specification: Record<string, any> | null;
118
- };
119
-
120
- interface IMany2ManyTagFieldProps extends IInputFieldProps {
121
- options: any;
122
- placeholderNoOption: string;
123
- service?: string;
124
- xNode?: string;
125
- }
126
-
127
- declare const many2manyTagsController: (props: IMany2ManyTagFieldProps) => {
128
- options: any[];
129
- transfer: (data: any) => any;
130
- isUser: boolean;
131
- isFetching: boolean;
132
- fetchMoreOptions: () => void;
133
- domainObject: any;
134
- setDomainObject: react.Dispatch<any>;
135
- handleChooseRecord: (idRecord: number) => void;
136
- handleClose: () => void;
137
- isShowModalMany2Many: boolean;
138
- setIsShowModalMany2Many: react.Dispatch<react.SetStateAction<boolean>>;
139
- };
140
-
141
- interface IDurationFieldProps extends IInputFieldProps {
142
- id: any;
143
- enabled?: any;
144
- }
145
-
146
- declare const durationController: (props: IDurationFieldProps) => {
147
- dataResponse: any;
148
- handleClick: (stage_id: any) => Promise<void>;
149
- disabled: boolean;
150
- modelStatus: boolean;
151
- setModalStatus: react.Dispatch<react.SetStateAction<boolean>>;
152
- };
153
-
154
- interface IPriorityFieldProps extends IInputFieldProps {
155
- id: any;
156
- actionData: any;
157
- context: any;
158
- specification?: any;
159
- index?: number;
160
- }
161
-
162
- declare const priorityFieldController: (props: IPriorityFieldProps) => {
163
- savePriorities: ({ value, resetPriority, }: {
164
- value: number;
165
- resetPriority?: () => void;
166
- }) => Promise<void>;
167
- };
168
-
169
- declare const downloadFileController: () => {
170
- inputId: string;
171
- file: any;
172
- handleFileChange: (e: any) => void;
173
- handleFileDownload: () => void;
174
- };
175
-
176
- declare const downLoadBinaryController: (props: IInputFieldProps) => {
177
- handleFileDownload: (e: any) => Promise<void>;
178
- };
179
-
180
- declare const copyLinkButtonController: (props: IInputFieldProps) => {
181
- isCopied: boolean;
182
- handleCopyToClipboard: (value: string) => Promise<void>;
183
- propValue: any;
184
- };
185
-
186
- interface IColorFieldProps extends IInputFieldProps {
187
- actionData: any;
188
- }
189
-
190
- declare const colorFieldController: (props: IColorFieldProps) => {
191
- savePickColor: (colorObject: any) => Promise<void>;
192
- };
193
-
194
- interface IBinaryFieldProps extends IInputFieldProps {
195
- service?: string;
196
- xNode?: string;
197
- path?: string;
198
- rootField?: any;
199
- index?: number;
200
- }
201
-
202
- type FileInfor = {
203
- type?: string;
204
- date?: string;
205
- size?: string;
206
- };
207
- declare const binaryFieldController: (props: IBinaryFieldProps) => {
208
- onUploadFile: (formData: FormData) => Promise<any>;
209
- onDeleteFile: () => void;
210
- fileInfo: FileInfor | null;
211
- url: any;
212
- };
213
-
214
- type UploadDeps = {
215
- service?: any;
216
- xNode?: any;
217
- path?: any;
218
- };
219
-
220
- declare const many2manyBinaryController: (props: IInputFieldProps & UploadDeps & {
221
- rootField?: any;
222
- index?: number;
223
- }) => {
224
- inputId: string;
225
- initialFiles: any[];
226
- binaryRef: react.RefObject<HTMLDivElement>;
227
- handleFileChange: (files: any, e: ChangeEvent<HTMLInputElement>, oldValues: any) => Promise<void>;
228
- handleRemoveAt: (idx: number) => void;
229
- handleRemoveAll: () => void;
230
- checkIsImageLink: (url: string) => boolean;
231
- setInitialFiles: react.Dispatch<react.SetStateAction<any[]>>;
232
- };
233
-
234
- interface IProviderEinvoiceFieldProps extends IInputFieldProps {
235
- options?: any;
236
- xNode?: any;
237
- }
238
-
239
- declare const providerEinvoiceFieldController: (props: IProviderEinvoiceFieldProps) => {
240
- listDataCard: any;
241
- };
242
-
243
- declare const tableHeadController: (props: any) => {
244
- handleCheckBoxAll: (event: React.ChangeEvent<HTMLInputElement>) => void;
245
- checkedAll: any;
246
- selectedRowKeysRef: react.MutableRefObject<any[]>;
247
- };
248
-
249
- interface ITableHeadProps {
250
- typeTable: string;
251
- rows: any[];
252
- tableRef: React.RefObject<HTMLTableElement | null>;
253
- groupByList: any;
254
- selectedRowKeys: any;
255
- }
256
-
257
- interface ITableProps {
258
- data: {
259
- fields: any[];
260
- records: any[];
261
- dataModel: {
262
- [fieldName: string]: {
263
- string?: string;
264
- [key: string]: any;
265
- };
266
- };
267
- context: any;
268
- typeTable?: 'list' | 'group' | 'calendar';
269
- };
270
- }
271
- interface ISelctionStateProps {
272
- typeTable?: string;
273
- tableRef: any;
274
- rows?: any[];
275
- }
276
-
277
- declare const tableController: ({ data }: ITableProps) => {
278
- rows: any[];
279
- columns: any;
280
- onToggleColumnOptional: (item: any) => void;
281
- typeTable: "list" | "group" | "calendar" | undefined;
282
- };
283
-
284
- declare const tableGroupController: (props: any) => {
285
- colEmptyGroup: {
286
- fromStart: number;
287
- fromEnd: number;
288
- };
289
- isShowGroup: boolean;
290
- isDataGroupFetched: boolean;
291
- isDataPlaceHolder: boolean;
292
- columnsGroup: any;
293
- rowsGroup: any[];
294
- dataGroup: any;
295
- pageGroup: any;
296
- setPageGroup: react.Dispatch<any>;
297
- typeTableGroup: "list" | "group" | "calendar" | undefined;
298
- };
299
-
300
- declare const searchController: ({ viewData, model, domain, context, fieldsList, }: {
301
- viewData: any;
302
- model: string;
303
- context: any;
304
- domain: any;
305
- fieldsList: any[];
306
- }) => {
307
- groupBy: any[] | null;
308
- searchBy: any[] | null;
309
- filterBy: any[] | null;
310
- selectedTags: any[] | null;
311
- searchString: string;
312
- setFilterBy: react.Dispatch<react.SetStateAction<any[] | null>>;
313
- setGroupBy: react.Dispatch<react.SetStateAction<any[] | null>>;
314
- setSearchBy: react.Dispatch<react.SetStateAction<any[] | null>>;
315
- clearSearch: () => void;
316
- setSelectedTags: react.Dispatch<react.SetStateAction<any[] | null>>;
317
- removeSearchItems: (key: string, item: any) => void;
318
- onSearchString: (search_string: string) => void;
319
- handleAddTagSearch: (tag: any) => void;
320
- domain: any[] | undefined;
321
- context: any;
322
- onKeyDown: (e: any) => void;
323
- handleMouseEnter: (index: number) => void;
324
- handleMouseLeave: () => void;
325
- hoveredIndexSearchList: number | null;
326
- };
327
-
328
- export { type ISelctionStateProps, type ITableHeadProps, type ITableProps, binaryFieldController, colorFieldController, copyLinkButtonController, downLoadBinaryController, downloadFileController, durationController, many2manyBinaryController, many2manyFieldController, many2manyTagsController, many2oneButtonController, many2oneFieldController, priorityFieldController, providerEinvoiceFieldController, searchController, statusDropdownController, tableController, tableGroupController, tableHeadController };