react-table-edit 1.2.78 → 1.2.89
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.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22671,7 +22671,7 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
22671
22671
|
};
|
|
22672
22672
|
const callbackLoadOption = (rs) => {
|
|
22673
22673
|
setIsLoading(false);
|
|
22674
|
-
if (
|
|
22674
|
+
if (inputRef.current.value) {
|
|
22675
22675
|
setOptionsLoad(rs);
|
|
22676
22676
|
}
|
|
22677
22677
|
};
|
|
@@ -22800,10 +22800,10 @@ const SelectTable = React$5.forwardRef((props, ref) => {
|
|
|
22800
22800
|
}
|
|
22801
22801
|
}
|
|
22802
22802
|
setSearchTerm(val.target.value);
|
|
22803
|
-
}, onKeyDown: (e) => handleOnKeyDown(e) }) })] }), isLoading && jsxRuntime.jsxs("div", { className: classnames('select-table-indicator d-flex align-items-center'), children: [jsxRuntime.jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }), jsxRuntime.jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }), jsxRuntime.jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" })] }), (isClearable && value && !isDisabled) && jsxRuntime.jsx("div", { className: classnames('cursor-pointer'), onClick: (e) => {
|
|
22803
|
+
}, onKeyDown: (e) => handleOnKeyDown(e) }) })] }), isLoading && jsxRuntime.jsxs("div", { className: classnames('select-table-indicator d-flex align-items-center'), children: [jsxRuntime.jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }), jsxRuntime.jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }), jsxRuntime.jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" })] }), (isClearable && value && !isDisabled) && jsxRuntime.jsx("div", { className: classnames('cursor-pointer icon-clear'), onClick: (e) => {
|
|
22804
22804
|
handChange(isMulti ? [] : undefined);
|
|
22805
22805
|
e.stopPropagation();
|
|
22806
|
-
}, children:
|
|
22806
|
+
}, children: "\u00D7" }), !isDisabled && jsxRuntime.jsx("div", { className: "select-table-indicator", onMouseDown: (e) => e.preventDefault(), children: jsxRuntime.jsx("svg", { height: "20", width: "20", viewBox: "0 0 20 20", children: jsxRuntime.jsx("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" }) }) })] }), jsxRuntime.jsx(DropdownMenu$1, { container: component, className: 'formula-dropdown icon-dropdown p-0', style: {
|
|
22807
22807
|
minWidth: selectTableRef?.current?.clientWidth,
|
|
22808
22808
|
width: width ? width + 2 : 'min-content',
|
|
22809
22809
|
position: 'fixed',
|
|
@@ -25568,10 +25568,10 @@ const SelectTableTree = React$5.forwardRef((props, ref) => {
|
|
|
25568
25568
|
return (jsxRuntime.jsxs("span", { children: [index === 0 ? '' : ', ', ele[fieldLabel ?? 'label']] }, index));
|
|
25569
25569
|
}) }) }) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: classnames('select-value', { 'd-none': searchTerm }), children: [value ? (formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? 'label']) : '', " "] }) }), !((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && jsxRuntime.jsx("div", { className: classnames('select-placeholder'), children: placeholder }), jsxRuntime.jsx("div", { className: 'input-container', children: jsxRuntime.jsx("input", { style: { textAlign: textAlign ?? 'left' }, ref: inputRef, className: classnames('select-input'), readOnly: isDisabled, value: searchTerm, onPaste: (e) => (onPaste && !dropdownOpen) && onPaste(e), onChange: (val) => {
|
|
25570
25570
|
setSearchTerm(val.target.value);
|
|
25571
|
-
}, onKeyDown: (e) => handleOnKeyDown(e) }) })] }), (isClearable && value && !isDisabled) && jsxRuntime.jsx("div", { className: classnames('cursor-pointer'), onClick: (e) => {
|
|
25571
|
+
}, onKeyDown: (e) => handleOnKeyDown(e) }) })] }), (isClearable && value && !isDisabled) && jsxRuntime.jsx("div", { className: classnames('cursor-pointer icon-clear'), onClick: (e) => {
|
|
25572
25572
|
onChange(isMulti ? [] : undefined);
|
|
25573
25573
|
e.stopPropagation();
|
|
25574
|
-
}, children:
|
|
25574
|
+
}, children: "\u00D7" }), !isDisabled && jsxRuntime.jsx("div", { className: "select-table-indicator", onMouseDown: (e) => e.preventDefault(), children: jsxRuntime.jsx("svg", { height: "20", width: "20", viewBox: "0 0 20 20", children: jsxRuntime.jsx("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" }) }) })] }), jsxRuntime.jsx(DropdownMenu$1, { container: component, className: 'formula-dropdown icon-dropdown p-0', style: {
|
|
25575
25575
|
width: width ? width + 2 : 'min-content',
|
|
25576
25576
|
position: 'fixed',
|
|
25577
25577
|
borderRadius: 4,
|
|
@@ -41890,7 +41890,7 @@ const DateInput = (props) => {
|
|
|
41890
41890
|
if (onChange) {
|
|
41891
41891
|
onChange(date);
|
|
41892
41892
|
}
|
|
41893
|
-
}, 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) => {
|
|
41894
41894
|
if (e.code === 'Space') {
|
|
41895
41895
|
setOpen(!open);
|
|
41896
41896
|
setTimeout(() => {
|
|
@@ -42092,9 +42092,9 @@ const TableEdit = React$5.forwardRef((props, ref) => {
|
|
|
42092
42092
|
switch (col?.editTypeCondition ? col?.editTypeCondition(row) : col.editType) {
|
|
42093
42093
|
case 'date':
|
|
42094
42094
|
return (jsxRuntime.jsx(DateInput, { id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`, className: classnames('form-control border-0 rounded-0 input-numeric', { 'is-invalid': col.validate && col.validate(row[col.field], row) }), value: row[col.field], onChange: (date) => {
|
|
42095
|
-
row[col.field] = date;
|
|
42095
|
+
row[col.field] = date ? new Date(date.getTime() + 7 * 60 * 60 * 1000) : undefined;
|
|
42096
42096
|
if (col.callback) {
|
|
42097
|
-
col.callback(
|
|
42097
|
+
col.callback(row[col.field], indexRow);
|
|
42098
42098
|
}
|
|
42099
42099
|
handleDataChange(row, col, indexRow);
|
|
42100
42100
|
}, dateFormat: "dd/MM/yyyy", onKeyDown: (e) => {
|
|
@@ -42106,7 +42106,7 @@ const TableEdit = React$5.forwardRef((props, ref) => {
|
|
|
42106
42106
|
return (jsxRuntime.jsx(DateInput, { id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`, className: classnames('form-control border-0 rounded-0 input-numeric', { 'is-invalid': col.validate && col.validate(row[col.field], row) }), value: row[col.field], onChange: (date) => {
|
|
42107
42107
|
row[col.field] = date;
|
|
42108
42108
|
if (col.callback) {
|
|
42109
|
-
col.callback(
|
|
42109
|
+
col.callback(row[col.field], indexRow);
|
|
42110
42110
|
}
|
|
42111
42111
|
handleDataChange(row, col, indexRow);
|
|
42112
42112
|
}, dateFormat: "dd/MM/yyyy HH:mm", onKeyDown: (e) => {
|