react-table-edit 1.2.19 → 1.2.20
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/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +22 -0
- package/dist/index.mjs +22 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -41,6 +41,7 @@ type Props$1 = {
|
|
|
41
41
|
rowData?: any;
|
|
42
42
|
value: any;
|
|
43
43
|
onKeyDown?: any;
|
|
44
|
+
onOpenMenu?: any;
|
|
44
45
|
formatOptionLabel?: any;
|
|
45
46
|
handleAdd?: any;
|
|
46
47
|
options: any[];
|
|
@@ -100,6 +101,7 @@ type ISettingSelectElement = {
|
|
|
100
101
|
validateOption?: any;
|
|
101
102
|
optionsField?: string;
|
|
102
103
|
columns?: IFColumnSelectTable[];
|
|
104
|
+
onOpenMenu?: any;
|
|
103
105
|
};
|
|
104
106
|
type ISettingNumericElement = {
|
|
105
107
|
min?: number;
|
|
@@ -333,6 +335,7 @@ type Props = {
|
|
|
333
335
|
showFooter?: boolean;
|
|
334
336
|
selectChilds?: boolean;
|
|
335
337
|
formatSetting?: IFTableTreeSelectFormat;
|
|
338
|
+
onOpenMenu?: any;
|
|
336
339
|
onPaste?: any;
|
|
337
340
|
};
|
|
338
341
|
declare const SelectTableTree: react__default.ForwardRefExoticComponent<Props & react__default.RefAttributes<unknown>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ type Props$1 = {
|
|
|
41
41
|
rowData?: any;
|
|
42
42
|
value: any;
|
|
43
43
|
onKeyDown?: any;
|
|
44
|
+
onOpenMenu?: any;
|
|
44
45
|
formatOptionLabel?: any;
|
|
45
46
|
handleAdd?: any;
|
|
46
47
|
options: any[];
|
|
@@ -100,6 +101,7 @@ type ISettingSelectElement = {
|
|
|
100
101
|
validateOption?: any;
|
|
101
102
|
optionsField?: string;
|
|
102
103
|
columns?: IFColumnSelectTable[];
|
|
104
|
+
onOpenMenu?: any;
|
|
103
105
|
};
|
|
104
106
|
type ISettingNumericElement = {
|
|
105
107
|
min?: number;
|
|
@@ -333,6 +335,7 @@ type Props = {
|
|
|
333
335
|
showFooter?: boolean;
|
|
334
336
|
selectChilds?: boolean;
|
|
335
337
|
formatSetting?: IFTableTreeSelectFormat;
|
|
338
|
+
onOpenMenu?: any;
|
|
336
339
|
onPaste?: any;
|
|
337
340
|
};
|
|
338
341
|
declare const SelectTableTree: react__default.ForwardRefExoticComponent<Props & react__default.RefAttributes<unknown>>;
|
package/dist/index.js
CHANGED
|
@@ -647,6 +647,7 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
647
647
|
footerComponent,
|
|
648
648
|
formatSetting,
|
|
649
649
|
allowCreate,
|
|
650
|
+
onOpenMenu,
|
|
650
651
|
onPaste
|
|
651
652
|
} = props;
|
|
652
653
|
const selectTableRef = (0, import_react6.useRef)();
|
|
@@ -706,6 +707,11 @@ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
706
707
|
setIndexFocus(0);
|
|
707
708
|
}
|
|
708
709
|
}, [searchTerm]);
|
|
710
|
+
(0, import_react6.useEffect)(() => {
|
|
711
|
+
if (dropdownOpen && onOpenMenu) {
|
|
712
|
+
onOpenMenu();
|
|
713
|
+
}
|
|
714
|
+
}, [dropdownOpen]);
|
|
709
715
|
const handleOpenClose = () => {
|
|
710
716
|
setSearchTerm("");
|
|
711
717
|
if (dropdownOpen) {
|
|
@@ -2318,6 +2324,7 @@ var SelectTableTree = (0, import_react15.forwardRef)((props, ref) => {
|
|
|
2318
2324
|
selectChilds,
|
|
2319
2325
|
footerComponent,
|
|
2320
2326
|
formatSetting,
|
|
2327
|
+
onOpenMenu,
|
|
2321
2328
|
onPaste
|
|
2322
2329
|
} = props;
|
|
2323
2330
|
const selectTableRef = (0, import_react15.useRef)();
|
|
@@ -2340,6 +2347,11 @@ var SelectTableTree = (0, import_react15.forwardRef)((props, ref) => {
|
|
|
2340
2347
|
const isSelectedAll = (0, import_react15.useMemo)(() => {
|
|
2341
2348
|
return isMulti === true && options.length > 0 && areAllItemsSelected(value, options, fieldValue ?? "value");
|
|
2342
2349
|
}, [options, value]);
|
|
2350
|
+
(0, import_react15.useEffect)(() => {
|
|
2351
|
+
if (dropdownOpen && onOpenMenu) {
|
|
2352
|
+
onOpenMenu();
|
|
2353
|
+
}
|
|
2354
|
+
}, [dropdownOpen]);
|
|
2343
2355
|
const defaultColumns = [
|
|
2344
2356
|
{
|
|
2345
2357
|
headerText: "Name",
|
|
@@ -3171,6 +3183,11 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3171
3183
|
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
3172
3184
|
}
|
|
3173
3185
|
},
|
|
3186
|
+
onOpenMenu: () => {
|
|
3187
|
+
if (col.selectSettings?.onOpenMenu) {
|
|
3188
|
+
col.selectSettings?.onOpenMenu(row, col, indexRow);
|
|
3189
|
+
}
|
|
3190
|
+
},
|
|
3174
3191
|
onPaste: (e) => {
|
|
3175
3192
|
if (toolbarSetting?.showBottomToolbar && !editDisable && !addDisable) {
|
|
3176
3193
|
pasteDataFromExcel(indexRow, indexCol, e);
|
|
@@ -3237,6 +3254,11 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3237
3254
|
isClearable: col.selectSettings?.isClearable ?? false,
|
|
3238
3255
|
formatSetting,
|
|
3239
3256
|
placeholder: t("Select"),
|
|
3257
|
+
onOpenMenu: () => {
|
|
3258
|
+
if (col.selectSettings?.onOpenMenu) {
|
|
3259
|
+
col.selectSettings?.onOpenMenu(row, col, indexRow);
|
|
3260
|
+
}
|
|
3261
|
+
},
|
|
3240
3262
|
loadOptions: col.selectSettings?.loadOptions,
|
|
3241
3263
|
handleAdd: col.selectSettings?.handAddNew ? (e) => col.selectSettings?.handAddNew(e, indexRow, row) : void 0,
|
|
3242
3264
|
fieldChildren: col.selectSettings?.fieldChild ?? "children",
|
package/dist/index.mjs
CHANGED
|
@@ -609,6 +609,7 @@ var SelectTable = forwardRef((props, ref) => {
|
|
|
609
609
|
footerComponent,
|
|
610
610
|
formatSetting,
|
|
611
611
|
allowCreate,
|
|
612
|
+
onOpenMenu,
|
|
612
613
|
onPaste
|
|
613
614
|
} = props;
|
|
614
615
|
const selectTableRef = useRef();
|
|
@@ -668,6 +669,11 @@ var SelectTable = forwardRef((props, ref) => {
|
|
|
668
669
|
setIndexFocus(0);
|
|
669
670
|
}
|
|
670
671
|
}, [searchTerm]);
|
|
672
|
+
useEffect3(() => {
|
|
673
|
+
if (dropdownOpen && onOpenMenu) {
|
|
674
|
+
onOpenMenu();
|
|
675
|
+
}
|
|
676
|
+
}, [dropdownOpen]);
|
|
671
677
|
const handleOpenClose = () => {
|
|
672
678
|
setSearchTerm("");
|
|
673
679
|
if (dropdownOpen) {
|
|
@@ -2288,6 +2294,7 @@ var SelectTableTree = forwardRef3((props, ref) => {
|
|
|
2288
2294
|
selectChilds,
|
|
2289
2295
|
footerComponent,
|
|
2290
2296
|
formatSetting,
|
|
2297
|
+
onOpenMenu,
|
|
2291
2298
|
onPaste
|
|
2292
2299
|
} = props;
|
|
2293
2300
|
const selectTableRef = useRef3();
|
|
@@ -2310,6 +2317,11 @@ var SelectTableTree = forwardRef3((props, ref) => {
|
|
|
2310
2317
|
const isSelectedAll = useMemo2(() => {
|
|
2311
2318
|
return isMulti === true && options.length > 0 && areAllItemsSelected(value, options, fieldValue ?? "value");
|
|
2312
2319
|
}, [options, value]);
|
|
2320
|
+
useEffect8(() => {
|
|
2321
|
+
if (dropdownOpen && onOpenMenu) {
|
|
2322
|
+
onOpenMenu();
|
|
2323
|
+
}
|
|
2324
|
+
}, [dropdownOpen]);
|
|
2313
2325
|
const defaultColumns = [
|
|
2314
2326
|
{
|
|
2315
2327
|
headerText: "Name",
|
|
@@ -3141,6 +3153,11 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3141
3153
|
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
3142
3154
|
}
|
|
3143
3155
|
},
|
|
3156
|
+
onOpenMenu: () => {
|
|
3157
|
+
if (col.selectSettings?.onOpenMenu) {
|
|
3158
|
+
col.selectSettings?.onOpenMenu(row, col, indexRow);
|
|
3159
|
+
}
|
|
3160
|
+
},
|
|
3144
3161
|
onPaste: (e) => {
|
|
3145
3162
|
if (toolbarSetting?.showBottomToolbar && !editDisable && !addDisable) {
|
|
3146
3163
|
pasteDataFromExcel(indexRow, indexCol, e);
|
|
@@ -3207,6 +3224,11 @@ var TableEdit = forwardRef4((props, ref) => {
|
|
|
3207
3224
|
isClearable: col.selectSettings?.isClearable ?? false,
|
|
3208
3225
|
formatSetting,
|
|
3209
3226
|
placeholder: t("Select"),
|
|
3227
|
+
onOpenMenu: () => {
|
|
3228
|
+
if (col.selectSettings?.onOpenMenu) {
|
|
3229
|
+
col.selectSettings?.onOpenMenu(row, col, indexRow);
|
|
3230
|
+
}
|
|
3231
|
+
},
|
|
3210
3232
|
loadOptions: col.selectSettings?.loadOptions,
|
|
3211
3233
|
handleAdd: col.selectSettings?.handAddNew ? (e) => col.selectSettings?.handAddNew(e, indexRow, row) : void 0,
|
|
3212
3234
|
fieldChildren: col.selectSettings?.fieldChild ?? "children",
|