@fctc/widget-logic 1.5.0 → 1.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/config.d.mts +6 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.js +24 -0
- package/dist/config.mjs +2 -0
- package/dist/constants.d.mts +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +24 -0
- package/dist/constants.mjs +2 -0
- package/dist/environment.d.mts +1 -0
- package/dist/environment.d.ts +1 -0
- package/dist/environment.js +24 -0
- package/dist/environment.mjs +2 -0
- package/dist/hooks.d.mts +969 -0
- package/dist/hooks.d.ts +969 -0
- package/dist/hooks.js +743 -0
- package/dist/hooks.mjs +717 -0
- package/dist/icons.d.mts +9 -0
- package/dist/icons.d.ts +9 -0
- package/dist/icons.js +139 -0
- package/dist/icons.mjs +110 -0
- package/dist/index.d.mts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.js +7233 -229
- package/dist/index.mjs +7320 -218
- package/dist/provider.d.mts +1 -0
- package/dist/provider.d.ts +1 -0
- package/dist/provider.js +24 -0
- package/dist/provider.mjs +2 -0
- package/dist/services.d.mts +1 -0
- package/dist/services.d.ts +1 -0
- package/dist/services.js +24 -0
- package/dist/services.mjs +2 -0
- package/dist/store.d.mts +1 -0
- package/dist/store.d.ts +1 -0
- package/dist/store.js +24 -0
- package/dist/store.mjs +2 -0
- package/dist/types.d.mts +31 -0
- package/dist/types.d.ts +31 -0
- package/dist/types.js +24 -0
- package/dist/types.mjs +2 -0
- package/dist/utils.d.mts +38 -0
- package/dist/utils.d.ts +38 -0
- package/dist/utils.js +282 -0
- package/dist/utils.mjs +242 -0
- package/dist/widget.d.mts +299 -0
- package/dist/widget.d.ts +299 -0
- package/dist/widget.js +7079 -0
- package/dist/widget.mjs +7111 -0
- package/package.json +69 -23
- package/dist/action.d.mts +0 -68
- package/dist/action.d.ts +0 -68
- package/dist/action.js +0 -152
- package/dist/action.mjs +0 -122
- package/dist/common.d.mts +0 -13
- package/dist/common.d.ts +0 -13
- package/dist/common.js +0 -60
- package/dist/common.mjs +0 -33
- package/dist/form.d.mts +0 -42
- package/dist/form.d.ts +0 -42
- package/dist/form.js +0 -116
- package/dist/form.mjs +0 -87
- package/dist/table.d.mts +0 -22
- package/dist/table.d.ts +0 -22
- package/dist/table.js +0 -118
- package/dist/table.mjs +0 -91
package/dist/widget.d.ts
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ChangeEvent } from 'react';
|
|
3
|
+
import { IInputFieldProps, ValuePropsType } from './types.js';
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
import '@fctc/interface-logic/types';
|
|
6
|
+
|
|
7
|
+
type TStatus = 'normal' | 'done' | 'blocked';
|
|
8
|
+
interface TStatusDropdownFieldProps extends IInputFieldProps {
|
|
9
|
+
state: any;
|
|
10
|
+
selection: any;
|
|
11
|
+
id: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const statusDropdownController: (props: TStatusDropdownFieldProps) => {
|
|
15
|
+
handleClick: (status: any) => Promise<void>;
|
|
16
|
+
buttonRef: react.RefObject<HTMLDivElement>;
|
|
17
|
+
isForm: boolean | undefined;
|
|
18
|
+
setIsOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
19
|
+
isOpen: boolean;
|
|
20
|
+
selection: any;
|
|
21
|
+
state: any;
|
|
22
|
+
colors: Record<TStatus, string>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface IMany2OneProps extends IInputFieldProps {
|
|
26
|
+
context?: any;
|
|
27
|
+
options?: any;
|
|
28
|
+
showDetail?: boolean;
|
|
29
|
+
actionData?: any;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare const many2oneFieldController: (props: IMany2OneProps) => {
|
|
33
|
+
allowShowDetail: boolean;
|
|
34
|
+
handleClose: () => void;
|
|
35
|
+
handleChooseRecord: (idRecord: number) => void;
|
|
36
|
+
handleSelectChange: (selectedOption: any) => void;
|
|
37
|
+
initValue: any;
|
|
38
|
+
isFetching: boolean;
|
|
39
|
+
isShowModalMany2Many: boolean;
|
|
40
|
+
options: any[];
|
|
41
|
+
fetchMoreOptions: () => void;
|
|
42
|
+
domainModal: any;
|
|
43
|
+
tempSelectedOption: any;
|
|
44
|
+
setTempSelectedOption: React.Dispatch<React.SetStateAction<any>>;
|
|
45
|
+
setDomainModal: React.Dispatch<React.SetStateAction<any>>;
|
|
46
|
+
dataOfSelection: any;
|
|
47
|
+
refetch: () => void;
|
|
48
|
+
selectOptions: any[];
|
|
49
|
+
optionsObject: any;
|
|
50
|
+
contextObject: any;
|
|
51
|
+
actionId: any;
|
|
52
|
+
setIsShowModalMany2Many: React.Dispatch<React.SetStateAction<boolean>>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
type Option = {
|
|
56
|
+
value: number;
|
|
57
|
+
label: string;
|
|
58
|
+
};
|
|
59
|
+
declare const many2oneButtonController: (props: any) => {
|
|
60
|
+
options: Option[];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
interface IMany2ManyControllerProps extends IInputFieldProps {
|
|
64
|
+
context: any;
|
|
65
|
+
tab: any;
|
|
66
|
+
aid: number;
|
|
67
|
+
setSelectedRowKeys: any;
|
|
68
|
+
fields: any;
|
|
69
|
+
setFields: any;
|
|
70
|
+
groupByDomain: any;
|
|
71
|
+
page: number;
|
|
72
|
+
options: any;
|
|
73
|
+
sessionStorageUtils: any;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare const many2manyFieldController: (props: IMany2ManyControllerProps) => {};
|
|
77
|
+
|
|
78
|
+
interface IMany2ManyTagFieldProps extends IInputFieldProps {
|
|
79
|
+
options: any;
|
|
80
|
+
widget: string;
|
|
81
|
+
placeholderNoOption: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare const many2manyTagsController: (props: IMany2ManyTagFieldProps) => {
|
|
85
|
+
options: any;
|
|
86
|
+
customNoOptionsMessage: () => string;
|
|
87
|
+
tranfer: (data: any) => any;
|
|
88
|
+
dataOfSelection: any;
|
|
89
|
+
isUser: boolean;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
interface IDurationFieldProps extends IInputFieldProps {
|
|
93
|
+
id: any;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare const durationController: (props: IDurationFieldProps) => {
|
|
97
|
+
defaultValue: string | number | ValuePropsType | undefined;
|
|
98
|
+
dataResponse: any;
|
|
99
|
+
handleClick: (stage_id: any) => Promise<void>;
|
|
100
|
+
disabled: boolean;
|
|
101
|
+
modelStatus: boolean;
|
|
102
|
+
setModalStatus: react.Dispatch<react.SetStateAction<boolean>>;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
interface IPriorityFieldProps extends IInputFieldProps {
|
|
106
|
+
selection: any;
|
|
107
|
+
id: any;
|
|
108
|
+
actionData: any;
|
|
109
|
+
viewData: any;
|
|
110
|
+
context: any;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare const priorityFieldController: (props: IPriorityFieldProps) => {
|
|
114
|
+
selection: any;
|
|
115
|
+
isForm: boolean | undefined;
|
|
116
|
+
methods: any;
|
|
117
|
+
defaultPriority: number;
|
|
118
|
+
savePriorities: ({ value, resetPriority, }: {
|
|
119
|
+
value: number;
|
|
120
|
+
resetPriority?: () => void;
|
|
121
|
+
}) => Promise<void>;
|
|
122
|
+
label: any;
|
|
123
|
+
id: any;
|
|
124
|
+
onChange: ((name: string, value: any) => void) | undefined;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
declare const floatTimeFiledController: ({ onChange: fieldOnChange, onBlur, value, isDirty, props, }: {
|
|
128
|
+
onChange: any;
|
|
129
|
+
onBlur: any;
|
|
130
|
+
value: any;
|
|
131
|
+
error: any;
|
|
132
|
+
isDirty: any;
|
|
133
|
+
props: IInputFieldProps;
|
|
134
|
+
}) => {
|
|
135
|
+
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
136
|
+
handleBlur: () => void;
|
|
137
|
+
handleKeyDown: (e: any) => void;
|
|
138
|
+
input: string;
|
|
139
|
+
errors: string;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
declare const floatController: ({ onChange, value, props, }: {
|
|
143
|
+
onChange: any;
|
|
144
|
+
value: any;
|
|
145
|
+
props: IInputFieldProps;
|
|
146
|
+
}) => {
|
|
147
|
+
handleInputMouseLeave: () => void;
|
|
148
|
+
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
149
|
+
useFormatFloatNumber: (value: number | string) => string;
|
|
150
|
+
inputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
151
|
+
inputValue: string;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
declare const downloadFileController: () => {
|
|
155
|
+
inputId: string;
|
|
156
|
+
file: any;
|
|
157
|
+
handleFileChange: (e: any) => void;
|
|
158
|
+
handleFileDownload: () => void;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
declare const downLoadBinaryController: (props: IInputFieldProps) => {
|
|
162
|
+
handleFileDownload: (e: any) => Promise<void>;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
interface IDateFieldProps extends IInputFieldProps {
|
|
166
|
+
showTime: boolean;
|
|
167
|
+
widget: string;
|
|
168
|
+
min: number | string;
|
|
169
|
+
max: number | string;
|
|
170
|
+
viewData: any;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
declare const dateFieldController: (props: IDateFieldProps) => {
|
|
174
|
+
formatDate: string;
|
|
175
|
+
formatDateParse: string;
|
|
176
|
+
range: (start: number, end: number, step?: number) => number[];
|
|
177
|
+
years: number[];
|
|
178
|
+
months_vi: string[];
|
|
179
|
+
months_en: string[];
|
|
180
|
+
customValidateMinMax: (date: any) => string | false;
|
|
181
|
+
minNowValue: boolean | moment.Moment | null;
|
|
182
|
+
maxNowValue: boolean | moment.Moment | null;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
declare const copyLinkButtonController: (props: IInputFieldProps) => {
|
|
186
|
+
isCopied: boolean;
|
|
187
|
+
handleCopyToClipboard: (value: string) => Promise<void>;
|
|
188
|
+
propValue: any;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
interface IColorFieldProps extends IInputFieldProps {
|
|
192
|
+
actionData: any;
|
|
193
|
+
idForm: number | string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
declare const colorFieldController: (props: IColorFieldProps) => {
|
|
197
|
+
savePickColor: (colorObject: any) => Promise<void>;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
declare const binaryFieldController: (props: IInputFieldProps) => {
|
|
201
|
+
inputId: string;
|
|
202
|
+
selectedImage: string | null;
|
|
203
|
+
initialImage: any;
|
|
204
|
+
isInsideTable: boolean;
|
|
205
|
+
binaryRef: react.RefObject<HTMLDivElement>;
|
|
206
|
+
handleImageChange: (e: ChangeEvent<HTMLInputElement>, onChange: (file: File | null) => void) => Promise<void>;
|
|
207
|
+
handleRemoveImage: (onChange: (file: File | null) => void) => void;
|
|
208
|
+
checkIsImageLink: (url: string) => boolean;
|
|
209
|
+
getImageBase64WithMimeType: (base64: any) => string | null;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
interface ITableBodyProps {
|
|
213
|
+
checkedAll: any;
|
|
214
|
+
checkboxRef: any;
|
|
215
|
+
setIsAutoSelect: any;
|
|
216
|
+
selectedRowKeys: any;
|
|
217
|
+
row: any;
|
|
218
|
+
isAutoSelect: any;
|
|
219
|
+
selectedRowKeysRef: any;
|
|
220
|
+
onClickRow: any;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
declare const tableBodyController: (props: ITableBodyProps) => {
|
|
224
|
+
handleCheckBoxSingle: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
225
|
+
checked: any;
|
|
226
|
+
handleClickRow: (col: any, row: any) => void;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
interface ITableHeadProps {
|
|
230
|
+
typeTable: string;
|
|
231
|
+
rows: any[];
|
|
232
|
+
selectedRowKeysRef: any;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
declare const tableHeadController: (props: ITableHeadProps) => {
|
|
236
|
+
handleCheckBoxAll: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
interface ITableProps {
|
|
240
|
+
data: {
|
|
241
|
+
fields: any[];
|
|
242
|
+
records: any[];
|
|
243
|
+
dataModel: {
|
|
244
|
+
[fieldName: string]: {
|
|
245
|
+
string?: string;
|
|
246
|
+
[key: string]: any;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
context: any;
|
|
250
|
+
typeTable?: 'list' | 'group' | 'calendar';
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
interface ISelctionStateProps {
|
|
254
|
+
typeTable?: string;
|
|
255
|
+
tableRef: any;
|
|
256
|
+
rows?: any[];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
declare const tableController: ({ data }: ITableProps) => {
|
|
260
|
+
rows: any[];
|
|
261
|
+
columns: any;
|
|
262
|
+
onToggleColumnOptional: (item: any) => void;
|
|
263
|
+
typeTable: "group" | "list" | "calendar" | undefined;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
declare const tableGroupController: (props: any) => {
|
|
267
|
+
handleExpandChildGroup: () => void;
|
|
268
|
+
colEmptyGroup: {
|
|
269
|
+
fromStart: number;
|
|
270
|
+
fromEnd: number;
|
|
271
|
+
};
|
|
272
|
+
leftPadding: string;
|
|
273
|
+
isShowGroup: boolean;
|
|
274
|
+
isQueryFetched: boolean;
|
|
275
|
+
nameGroupWithCount: string;
|
|
276
|
+
columns: any;
|
|
277
|
+
row: any;
|
|
278
|
+
isPlaceholderData: boolean;
|
|
279
|
+
columnsGroup: any;
|
|
280
|
+
indexRow: any;
|
|
281
|
+
rowsGroup: any[];
|
|
282
|
+
model: any;
|
|
283
|
+
viewData: any;
|
|
284
|
+
renderField: any;
|
|
285
|
+
level: any;
|
|
286
|
+
specification: any;
|
|
287
|
+
context: any;
|
|
288
|
+
checkedAll: any;
|
|
289
|
+
isDisplayCheckbox: any;
|
|
290
|
+
isAutoSelect: any;
|
|
291
|
+
setIsAutoSelect: any;
|
|
292
|
+
selectedRowKeysRef: any;
|
|
293
|
+
initVal: Record<string, any>;
|
|
294
|
+
dataResponse: any;
|
|
295
|
+
pageGroup: any;
|
|
296
|
+
setPageGroup: react.Dispatch<any>;
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
export { type ISelctionStateProps, type ITableBodyProps, type ITableHeadProps, type ITableProps, binaryFieldController, colorFieldController, copyLinkButtonController, dateFieldController, downLoadBinaryController, downloadFileController, durationController, floatController, floatTimeFiledController, many2manyFieldController, many2manyTagsController, many2oneButtonController, many2oneFieldController, priorityFieldController, statusDropdownController, tableBodyController, tableController, tableGroupController, tableHeadController };
|