react-table-edit 1.2.77 → 1.2.88
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/component/input/input-style/input-box.d.ts +0 -2
- package/dist/component/table/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -9,8 +9,6 @@ var reactI18next = require('react-i18next');
|
|
|
9
9
|
var client = require('react-dom/client');
|
|
10
10
|
var toast = require('react-hot-toast');
|
|
11
11
|
var reactRouterDom = require('react-router-dom');
|
|
12
|
-
var select = require('@components/select');
|
|
13
|
-
var reactTableEdit = require('react-table-edit');
|
|
14
12
|
|
|
15
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
14
|
|
|
@@ -21125,7 +21123,6 @@ const renderLabel = (props) => {
|
|
|
21125
21123
|
};
|
|
21126
21124
|
|
|
21127
21125
|
const TextInput = (props) => {
|
|
21128
|
-
reactI18next.useTranslation();
|
|
21129
21126
|
const { control, id, name, min, max, type, label, labelSize, required, errors, height, disabled, row, isLabel, placeholder, autoFocus, inLine, callback, readOnly, classes, ...rest } = props;
|
|
21130
21127
|
const renderInput = () => {
|
|
21131
21128
|
return (jsxRuntime.jsxs(React$5.Fragment, { children: [jsxRuntime.jsx(Controller, { name: name, control: control, render: ({ field: { value, onChange } }) => (jsxRuntime.jsx(Input$1, { id: id, value: !isNullOrUndefined$1(value) ? value : '', onChange: (val) => {
|
|
@@ -22383,7 +22380,6 @@ function NumericFormat(props) {
|
|
|
22383
22380
|
|
|
22384
22381
|
const NumberInput = (props) => {
|
|
22385
22382
|
const { id, control, fractionCurrency, name, min, max, label, labelSize, required, errors, disabled, isLabel, fixedDecimalScale, placeholder, inLine, callback, decimalSeparator = ',', thousandSeparator = '.', classes, width, allowNegative } = props;
|
|
22386
|
-
reactI18next.useTranslation();
|
|
22387
22383
|
const renderInput = () => {
|
|
22388
22384
|
return (jsxRuntime.jsxs(React$5.Fragment, { children: [jsxRuntime.jsx(Controller, { name: name, control: control, render: ({ field: { value, onChange } }) => {
|
|
22389
22385
|
let floatValue = parseFloat(value);
|
|
@@ -41894,7 +41890,7 @@ const DateInput = (props) => {
|
|
|
41894
41890
|
if (onChange) {
|
|
41895
41891
|
onChange(date);
|
|
41896
41892
|
}
|
|
41897
|
-
}, dateFormat: dateFormat, locale: "vi", showMonthDropdown: true, showYearDropdown: true, dropdownMode: "select", onCalendarClose: () => setOpen(false), onCalendarOpen: () => setOpen(true), customInput: jsxRuntime.jsx(InputMask, { mask: "99/99/9999", placeholder: dateFormat }), onKeyDown: (e) => {
|
|
41893
|
+
}, dateFormat: dateFormat, locale: "vi", showMonthDropdown: true, showYearDropdown: true, dropdownMode: "select", isClearable: true, onCalendarClose: () => setOpen(false), onCalendarOpen: () => setOpen(true), customInput: jsxRuntime.jsx(InputMask, { mask: "99/99/9999", placeholder: dateFormat }), onKeyDown: (e) => {
|
|
41898
41894
|
if (e.code === 'Space') {
|
|
41899
41895
|
setOpen(!open);
|
|
41900
41896
|
setTimeout(() => {
|
|
@@ -41917,7 +41913,7 @@ const DateInput = (props) => {
|
|
|
41917
41913
|
|
|
41918
41914
|
const TableEdit = React$5.forwardRef((props, ref) => {
|
|
41919
41915
|
const { t } = reactI18next.useTranslation();
|
|
41920
|
-
const { idTable, dataSource, columns, commandClick, dataSourceChange, rowChange, pagingSetting, setDataSource, height, maxHeight, minHeight, defaultValue, toolbarSetting, searchSetting, setSelectedItem, selectedItem, selectEnable, editDisable, addDisable, buttonSetting, formatSetting, handleSelect, haveSum, isMulti, disableAutoKey } = props;
|
|
41916
|
+
const { idTable, dataSource, columns, commandClick, dataSourceChange, rowChange, pagingSetting, setDataSource, height, maxHeight, minHeight, defaultValue, toolbarSetting, searchSetting, setSelectedItem, selectedItem, selectEnable, editDisable, addDisable, buttonSetting, formatSetting, handleSelect, haveSum, isMulti, disableAutoKey, onDuplicate } = props;
|
|
41921
41917
|
React$5.useImperativeHandle(ref, () => {
|
|
41922
41918
|
return {
|
|
41923
41919
|
refeshFocusRow: handleRefeshRow
|
|
@@ -42510,19 +42506,23 @@ const TableEdit = React$5.forwardRef((props, ref) => {
|
|
|
42510
42506
|
focusNewElement(columnFistEdit, lengthData + 1, true);
|
|
42511
42507
|
}
|
|
42512
42508
|
};
|
|
42513
|
-
const handleDuplicate = (data, index) => {
|
|
42509
|
+
const handleDuplicate = async (data, index) => {
|
|
42510
|
+
const newData = { ...data };
|
|
42514
42511
|
if (toolbarSetting?.showBottomToolbar && !buttonSetting?.duplicateDisable && !editDisable && !addDisable) {
|
|
42515
42512
|
if (fieldKey && defaultValue) {
|
|
42516
42513
|
fieldUniKey.forEach((item) => {
|
|
42517
|
-
|
|
42514
|
+
newData[item] = defaultValue[item];
|
|
42518
42515
|
});
|
|
42519
|
-
|
|
42516
|
+
newData[fieldKey] = defaultValue[fieldKey];
|
|
42517
|
+
}
|
|
42518
|
+
if (onDuplicate) {
|
|
42519
|
+
await onDuplicate(newData, index);
|
|
42520
42520
|
}
|
|
42521
42521
|
if (pagingClient) {
|
|
42522
|
-
dataSource.splice((((pagingSetting?.currentPage ?? 1) - 1) * (pagingSetting?.pageSize ?? 0) + index), 0,
|
|
42522
|
+
dataSource.splice((((pagingSetting?.currentPage ?? 1) - 1) * (pagingSetting?.pageSize ?? 0) + index) + 1, 0, newData);
|
|
42523
42523
|
}
|
|
42524
42524
|
else {
|
|
42525
|
-
dataSource.splice(index, 0,
|
|
42525
|
+
dataSource.splice(index + 1, 0, newData);
|
|
42526
42526
|
}
|
|
42527
42527
|
changeDataSource(dataSource);
|
|
42528
42528
|
if (tableElement && index === totalCount) {
|
|
@@ -45512,17 +45512,17 @@ const defaultStyleExportSetting = {
|
|
|
45512
45512
|
};
|
|
45513
45513
|
|
|
45514
45514
|
const StyleInput = (props) => {
|
|
45515
|
-
const {
|
|
45515
|
+
const { control, name, label, labelSize, required, errors, height, disabled, isLabel, inLine, classes, disabledBackgroundColor, disabledFontFamily, disabledFontSize, disabledBold, disabledItalic, disabledUnderline } = props;
|
|
45516
45516
|
const renderInput = () => {
|
|
45517
45517
|
return (jsxRuntime.jsxs(React$5.Fragment, { children: [jsxRuntime.jsx(Controller, { name: name, control: control, render: ({ field: { value, onChange } }) => {
|
|
45518
|
-
return (jsxRuntime.jsx(
|
|
45518
|
+
return (jsxRuntime.jsx(InputStyleComponent, { disabledBackgroundColor: disabledBackgroundColor, disabledFontFamily: disabledFontFamily, disabledFontSize: disabledFontSize, disabledBold: disabledBold, disabledItalic: disabledItalic, disabledUnderline: disabledUnderline, disabled: disabled, value: value, onChange: onChange }));
|
|
45519
45519
|
} }), errors && jsxRuntime.jsx(FormFeedback$1, { children: errors?.message })] }));
|
|
45520
45520
|
};
|
|
45521
45521
|
return (jsxRuntime.jsx(React$5.Fragment, { children: jsxRuntime.jsxs("div", { className: classnames(' align', {
|
|
45522
45522
|
[labelSize ? labelSize : '']: labelSize,
|
|
45523
45523
|
[classes ? classes : '']: classes,
|
|
45524
45524
|
'form-row-inline-error': errors
|
|
45525
|
-
}, inLine === false ? 'form-group ' : 'form-row-inline d-flex'), children: [
|
|
45525
|
+
}, inLine === false ? 'form-group ' : 'form-row-inline d-flex'), children: [renderLabel({ isLabel, name, label, required }), jsxRuntime.jsx("div", { style: { height: `${height}px` }, className: classnames('form-input-content', { 'hidden-label': isLabel === false }), children: renderInput() })] }) }));
|
|
45526
45526
|
};
|
|
45527
45527
|
|
|
45528
45528
|
const ExportExcelComponent = ({ openModal, typeModal, handleModal, windowSize, dataItem, columns, columnGroups }) => {
|