react-table-edit 1.2.57 → 1.2.58

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 (4) hide show
  1. package/dist/index.d.mts +368 -0
  2. package/dist/index.js +5243 -45623
  3. package/dist/index.mjs +5213 -45576
  4. package/package.json +17 -29
@@ -0,0 +1,368 @@
1
+ import * as react from 'react';
2
+ import react__default, { ReactNode, Dispatch, SetStateAction } from 'react';
3
+ import { TFunction } from 'react-i18next';
4
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
+
6
+ type IFColumnSelectTable = {
7
+ field: string;
8
+ headerText: string;
9
+ visible?: boolean;
10
+ textAlign?: 'left' | 'right' | 'center';
11
+ type?: 'text' | 'numeric' | 'date' | 'datetime';
12
+ template?: any;
13
+ typeCondition?: any;
14
+ fraction?: number;
15
+ width?: number;
16
+ maxWidth?: number;
17
+ minWidth?: number;
18
+ };
19
+ type IFTableSelectFormat = {
20
+ dateFormat?: string;
21
+ datetimeFormat?: string;
22
+ decimalSeparator?: string;
23
+ thousandSeparator?: string;
24
+ colorNegative?: string;
25
+ prefixNegative?: string;
26
+ suffixNegative?: string;
27
+ };
28
+ type Props$1 = {
29
+ id?: string;
30
+ component?: any;
31
+ footerComponent?: any;
32
+ fieldValue?: string;
33
+ fieldLabel?: string;
34
+ onChange: any;
35
+ textAlign?: 'left' | 'right' | 'center';
36
+ placeholder?: string;
37
+ invalid?: any;
38
+ loadOptions?: any;
39
+ menuWidth?: number;
40
+ width?: number;
41
+ rowData?: any;
42
+ value: any;
43
+ onKeyDown?: any;
44
+ onOpenMenu?: any;
45
+ formatOptionLabel?: any;
46
+ handleAdd?: any;
47
+ options: any[];
48
+ isMulti?: boolean;
49
+ noHeader?: boolean;
50
+ maxHeight?: number;
51
+ columns?: IFColumnSelectTable[];
52
+ isClearable?: boolean;
53
+ isDisabled?: boolean;
54
+ allowCreate?: boolean;
55
+ showFooter?: boolean;
56
+ onPaste?: any;
57
+ onCloseMenu?: any;
58
+ formatSetting?: IFTableSelectFormat;
59
+ };
60
+ declare const SelectTable: react__default.ForwardRefExoticComponent<Props$1 & react__default.RefAttributes<unknown>>;
61
+
62
+ type ITextAlign = 'center' | 'left' | 'right';
63
+ type IEditType = 'text' | 'numeric' | 'datetime' | 'selectTree' | 'date' | 'select' | 'checkbox' | 'form' | 'color';
64
+ type ICommandItem = {
65
+ id: string;
66
+ color?: string;
67
+ tooltip?: string;
68
+ icon?: string;
69
+ commandTemplate?: ReactNode;
70
+ };
71
+ type IFToolbarOptions = {
72
+ align: 'left' | 'right' | 'center';
73
+ template: any;
74
+ };
75
+ type ISettingFormElement = {
76
+ schema: any;
77
+ labelSize?: 'label-small' | 'label-medium' | 'label-large';
78
+ menuWidth?: number;
79
+ menuHeight?: number;
80
+ displayValue?: any;
81
+ footerTemplate?: any;
82
+ openOnFocus?: boolean;
83
+ isClearable?: boolean;
84
+ onChangeField?: any;
85
+ onFormOpen?: any;
86
+ onFormSubmit?: any;
87
+ };
88
+ type ISettingSelectElement = {
89
+ isClearable?: boolean;
90
+ isMulti?: boolean;
91
+ noHeader?: boolean;
92
+ showFooter?: boolean;
93
+ footerComponent?: any;
94
+ formatOptionLabel?: any;
95
+ selectChilds?: boolean;
96
+ allowCreate?: boolean;
97
+ loadOptions?: any;
98
+ defaultValue?: any;
99
+ fieldValue?: string;
100
+ fieldLabel?: string;
101
+ fieldChild?: string;
102
+ options?: any[];
103
+ widthPopup?: string | number;
104
+ heightPopup?: string | number;
105
+ iconGroup?: string;
106
+ handAddNew?: any;
107
+ validateOption?: any;
108
+ optionsField?: string;
109
+ columns?: IFColumnSelectTable[];
110
+ onOpenMenu?: any;
111
+ };
112
+ type ISettingNumericElement = {
113
+ min?: number;
114
+ max?: number;
115
+ fraction?: number;
116
+ allowNegative?: boolean;
117
+ };
118
+ type IColumnTable = {
119
+ field: string;
120
+ headerText?: string;
121
+ isPrimarykey?: boolean;
122
+ isUnikey?: boolean;
123
+ haveSum?: boolean;
124
+ haveToolTip?: boolean;
125
+ validate?: any;
126
+ disabledCondition?: any;
127
+ callback?: any;
128
+ width?: number | string;
129
+ minWidth?: number | string;
130
+ maxWidth?: number | string;
131
+ editEnable?: boolean;
132
+ visible?: boolean;
133
+ invisibleDisable?: boolean;
134
+ editType?: IEditType;
135
+ textAlign?: ITextAlign;
136
+ fixedType?: 'left' | 'right' | undefined;
137
+ template?: any;
138
+ commandItems?: ICommandItem[];
139
+ editTypeCondition?: any;
140
+ onPaste?: any;
141
+ onPasteValidate?: any;
142
+ placeholder?: string;
143
+ numericSettings?: ISettingNumericElement;
144
+ selectSettings?: ISettingSelectElement;
145
+ formSettings?: ISettingFormElement;
146
+ columns?: IColumnTable[];
147
+ };
148
+ type IFTableEditPaging = {
149
+ allowPaging?: boolean;
150
+ pagingClient?: boolean;
151
+ currentPage?: number;
152
+ setCurrentPage?: Dispatch<SetStateAction<number>>;
153
+ setPageSize?: Dispatch<SetStateAction<number>>;
154
+ pageSize?: number;
155
+ totalItem?: number;
156
+ };
157
+ type IFTableEditButton = {
158
+ deleteAllDisable?: boolean;
159
+ insertAfterDisable?: boolean;
160
+ insertBeforeDisable?: boolean;
161
+ duplicateDisable?: boolean;
162
+ };
163
+ type IFTableEditToolbar = {
164
+ showTopToolbar?: boolean;
165
+ toolbarOptions?: IFToolbarOptions[];
166
+ toolbarBottomOptions?: IFToolbarOptions[];
167
+ showBottomToolbar?: boolean;
168
+ };
169
+ type IFTableEditSearchSetting = {
170
+ searchEnable?: boolean;
171
+ searchClient?: boolean;
172
+ searchTerm?: string;
173
+ keyField?: string[];
174
+ setSearchTerm?: Dispatch<SetStateAction<string>>;
175
+ };
176
+ type IFTableEditFormat = {
177
+ dateFormat?: string;
178
+ datetimeFormat?: string;
179
+ decimalSeparator?: string;
180
+ thousandSeparator?: string;
181
+ colorNegative?: string;
182
+ prefixNegative?: string;
183
+ suffixNegative?: string;
184
+ };
185
+ type IFTableEditProps = {
186
+ idTable?: string;
187
+ dataSource: any[];
188
+ selectEnable?: boolean;
189
+ defaultValue?: any;
190
+ columns: IColumnTable[];
191
+ setDataSource?: any;
192
+ commandClick?: any;
193
+ rowChange?: any;
194
+ handleSelect?: any;
195
+ dataSourceChange?: any;
196
+ height?: number;
197
+ maxHeight?: number;
198
+ minHeight?: number;
199
+ selectedItem?: any;
200
+ setSelectedItem?: Dispatch<SetStateAction<any>>;
201
+ isMulti?: boolean;
202
+ editDisable?: boolean;
203
+ addDisable?: boolean;
204
+ haveSum?: boolean;
205
+ disableAutoKey?: boolean;
206
+ formatSetting?: IFTableEditFormat;
207
+ pagingSetting?: IFTableEditPaging;
208
+ buttonSetting?: IFTableEditButton;
209
+ toolbarSetting?: IFTableEditToolbar;
210
+ searchSetting?: IFTableEditSearchSetting;
211
+ };
212
+ type IFPageSize = {
213
+ pageSize: number;
214
+ };
215
+ type IFCurrentPage = {
216
+ currentPage: number;
217
+ };
218
+ type IFCurrentPageConfig = {
219
+ currentPage: number;
220
+ oldPage: number;
221
+ };
222
+ type IFRef = {
223
+ refeshFocusRow: any;
224
+ };
225
+ type IHeaderColumnTable = {
226
+ field: string;
227
+ headerText?: string;
228
+ width?: number | string;
229
+ minWidth?: number | string;
230
+ maxWidth?: number | string;
231
+ visible?: boolean;
232
+ rowspan?: number;
233
+ columns?: IColumnTable[];
234
+ textAlign?: ITextAlign;
235
+ fixedType?: 'left' | 'right' | undefined;
236
+ index?: number;
237
+ };
238
+ declare const TableEdit: react.ForwardRefExoticComponent<IFTableEditProps & react.RefAttributes<IFRef>>;
239
+
240
+ type FromItemsField = {
241
+ name: string;
242
+ label: string;
243
+ type: 'text' | 'numeric' | 'select' | 'selectCreatable';
244
+ disabled?: boolean;
245
+ fraction?: number;
246
+ min?: number;
247
+ max?: number;
248
+ options?: any[];
249
+ };
250
+
251
+ declare const messageHtmlBoxConfirm: (t: TFunction<"translation", undefined>, message: any[], handle: any, data: any, title?: string, btnOk?: string, btnCancel?: string) => void;
252
+ declare const messageHtmlBoxError: (t: TFunction<"translation", undefined>, message: any[], title?: string, btnCancel?: string) => void;
253
+ declare const messageBoxConfirmDelete: (t: TFunction<"translation", undefined>, handle: any, data: any) => void;
254
+ declare const messageBoxConfirm: (t: TFunction<"translation", undefined>, handle: any, data: any, message: string, title?: string, btnOk?: string, btnCancel?: string) => void;
255
+ declare const messageBoxError: (t: TFunction<"translation", undefined>, message: string, title?: string, btnCancel?: string) => void;
256
+ declare const notificationError: (param: string) => string;
257
+ declare const notificationSuccess: (param: string) => string;
258
+ declare const messageBoxConfirm2: (t: TFunction<"translation", undefined>, data: any, data2: any, message: string) => Promise<boolean>;
259
+
260
+ declare const useOnClickOutside: (ref: any, handler: any) => void;
261
+ declare const checkThousandSeparator: (thousandSeparator: any, decimalSeparator: any) => any;
262
+ declare const checkDecimalSeparator: (thousandSeparator: any, decimalSeparator: any) => any;
263
+ declare const isNullOrUndefined: (d: any) => boolean;
264
+ declare const generateUUID: () => string;
265
+ /**
266
+ * format chuỗi kí tự số
267
+ * @param str chuỗi số cần format
268
+ * @param decimalSeparator kí tự thập phân
269
+ * @param thousandSeparator kí tự phân cách hàng nghìn
270
+ * @param fraction số kí tự thập phân
271
+ * @param isDone đã nhập xong
272
+ * @returns
273
+ */
274
+ declare const formartNumberic: (str: string | number, decimalSeparator: string, thousandSeparator: string, fraction?: number, isDone?: boolean, haveNegative?: boolean) => string;
275
+ declare const roundNumber: (num: number, fraction: number) => number;
276
+ declare const formatDateTime: (data: any, format?: string) => string;
277
+
278
+ type IFDataProps = {
279
+ buttonWidth?: number;
280
+ tabParent?: boolean;
281
+ tabChild?: boolean;
282
+ resourceCodeParent?: string;
283
+ resourceCode: string;
284
+ resources: any[];
285
+ renderModal?: any;
286
+ windowSize?: any;
287
+ };
288
+ declare const TabsMenuComponent: ({ buttonWidth, tabParent, tabChild, resourceCodeParent, resources, resourceCode, windowSize, renderModal }: IFDataProps) => react_jsx_runtime.JSX.Element;
289
+
290
+ type IFColumnSelectTableTree = {
291
+ field: string;
292
+ headerText: string;
293
+ visible?: boolean;
294
+ textAlign?: 'left' | 'right' | 'center';
295
+ type?: 'text' | 'numeric' | 'date' | 'datetime';
296
+ template?: any;
297
+ typeCondition?: any;
298
+ fraction?: number;
299
+ width?: number;
300
+ maxWidth?: number;
301
+ minWidth?: number;
302
+ };
303
+ type IFTableTreeSelectFormat = {
304
+ dateFormat?: string;
305
+ decimalSeparator?: string;
306
+ thousandSeparator?: string;
307
+ colorNegative?: string;
308
+ prefixNegative?: string;
309
+ suffixNegative?: string;
310
+ };
311
+ type Props = {
312
+ id?: string;
313
+ component?: any;
314
+ footerComponent?: any;
315
+ fieldValue?: string;
316
+ fieldLabel?: string;
317
+ onChange: any;
318
+ textAlign?: 'left' | 'right' | 'center';
319
+ placeholder?: string;
320
+ invalid?: any;
321
+ loadOptions?: any;
322
+ menuWidth?: number;
323
+ width?: number;
324
+ rowData?: any;
325
+ value: any;
326
+ onKeyDown?: any;
327
+ formatOptionLabel?: any;
328
+ handleAdd?: any;
329
+ options: any[];
330
+ isMulti?: boolean;
331
+ noHeader?: boolean;
332
+ maxHeight?: number;
333
+ columns?: IFColumnSelectTableTree[];
334
+ fieldChildren?: string;
335
+ isClearable?: boolean;
336
+ isDisabled?: boolean;
337
+ showFooter?: boolean;
338
+ selectChilds?: boolean;
339
+ formatSetting?: IFTableTreeSelectFormat;
340
+ onOpenMenu?: any;
341
+ onPaste?: any;
342
+ };
343
+ declare const SelectTableTree: react__default.ForwardRefExoticComponent<Props & react__default.RefAttributes<unknown>>;
344
+
345
+ interface IFDataStyleSetting {
346
+ color: string;
347
+ backgroundColor: string;
348
+ fontFamily: string;
349
+ fontSize: number;
350
+ bold: boolean;
351
+ italic: boolean;
352
+ underline: boolean;
353
+ }
354
+ interface IFDataInputStyle {
355
+ value: IFDataStyleSetting;
356
+ onChange: any;
357
+ disabled?: boolean;
358
+ disabledColor?: boolean;
359
+ disabledBackgroundColor?: boolean;
360
+ disabledFontFamily?: boolean;
361
+ disabledFontSize?: boolean;
362
+ disabledBold?: boolean;
363
+ disabledItalic?: boolean;
364
+ disabledUnderline?: boolean;
365
+ }
366
+ declare const InputStyleComponent: (props: IFDataInputStyle) => react_jsx_runtime.JSX.Element;
367
+
368
+ export { type FromItemsField, type IColumnTable, type ICommandItem, type IFColumnSelectTable, type IFColumnSelectTableTree, type IFCurrentPage, type IFCurrentPageConfig, type IFPageSize, type IFTableEditButton, type IFTableEditFormat, type IFTableEditPaging, type IFTableEditProps, type IFTableEditSearchSetting, type IFTableEditToolbar, type IFTableSelectFormat, type IFTableTreeSelectFormat, type IFToolbarOptions, type IHeaderColumnTable, type ISettingFormElement, type ISettingNumericElement, type ISettingSelectElement, InputStyleComponent, SelectTable, SelectTableTree, TabsMenuComponent, checkDecimalSeparator, checkThousandSeparator, TableEdit as default, formartNumberic, formatDateTime, generateUUID, isNullOrUndefined, messageBoxConfirm, messageBoxConfirm2, messageBoxConfirmDelete, messageBoxError, messageHtmlBoxConfirm, messageHtmlBoxError, notificationError, notificationSuccess, roundNumber, useOnClickOutside };