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.mjs CHANGED
@@ -22643,7 +22643,7 @@ const SelectTable = forwardRef((props, ref) => {
22643
22643
  };
22644
22644
  const callbackLoadOption = (rs) => {
22645
22645
  setIsLoading(false);
22646
- if (searchTerm) {
22646
+ if (inputRef.current.value) {
22647
22647
  setOptionsLoad(rs);
22648
22648
  }
22649
22649
  };
@@ -22772,10 +22772,10 @@ const SelectTable = forwardRef((props, ref) => {
22772
22772
  }
22773
22773
  }
22774
22774
  setSearchTerm(val.target.value);
22775
- }, onKeyDown: (e) => handleOnKeyDown(e) }) })] }), isLoading && jsxs("div", { className: classnames('select-table-indicator d-flex align-items-center'), children: [jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }), jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }), jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" })] }), (isClearable && value && !isDisabled) && jsx("div", { className: classnames('cursor-pointer'), onClick: (e) => {
22775
+ }, onKeyDown: (e) => handleOnKeyDown(e) }) })] }), isLoading && jsxs("div", { className: classnames('select-table-indicator d-flex align-items-center'), children: [jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }), jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }), jsx(Spinner$1, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" })] }), (isClearable && value && !isDisabled) && jsx("div", { className: classnames('cursor-pointer icon-clear'), onClick: (e) => {
22776
22776
  handChange(isMulti ? [] : undefined);
22777
22777
  e.stopPropagation();
22778
- }, children: jsx("svg", { height: "20", width: "20", color: "#c4c4c4", viewBox: "0 0 20 20", "aria-hidden": "true", focusable: "false", className: "css-tj5bde-Svg", children: jsx("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" }) }) }), !isDisabled && jsx("div", { className: "select-table-indicator", onMouseDown: (e) => e.preventDefault(), children: jsx("svg", { height: "20", width: "20", viewBox: "0 0 20 20", children: 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" }) }) })] }), jsx(DropdownMenu$1, { container: component, className: 'formula-dropdown icon-dropdown p-0', style: {
22778
+ }, children: "\u00D7" }), !isDisabled && jsx("div", { className: "select-table-indicator", onMouseDown: (e) => e.preventDefault(), children: jsx("svg", { height: "20", width: "20", viewBox: "0 0 20 20", children: 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" }) }) })] }), jsx(DropdownMenu$1, { container: component, className: 'formula-dropdown icon-dropdown p-0', style: {
22779
22779
  minWidth: selectTableRef?.current?.clientWidth,
22780
22780
  width: width ? width + 2 : 'min-content',
22781
22781
  position: 'fixed',
@@ -25540,10 +25540,10 @@ const SelectTableTree = forwardRef((props, ref) => {
25540
25540
  return (jsxs("span", { children: [index === 0 ? '' : ', ', ele[fieldLabel ?? 'label']] }, index));
25541
25541
  }) }) }) : jsx(Fragment$1, { children: jsxs("div", { className: classnames('select-value', { 'd-none': searchTerm }), children: [value ? (formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? 'label']) : '', " "] }) }), !((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && jsx("div", { className: classnames('select-placeholder'), children: placeholder }), jsx("div", { className: 'input-container', children: jsx("input", { style: { textAlign: textAlign ?? 'left' }, ref: inputRef, className: classnames('select-input'), readOnly: isDisabled, value: searchTerm, onPaste: (e) => (onPaste && !dropdownOpen) && onPaste(e), onChange: (val) => {
25542
25542
  setSearchTerm(val.target.value);
25543
- }, onKeyDown: (e) => handleOnKeyDown(e) }) })] }), (isClearable && value && !isDisabled) && jsx("div", { className: classnames('cursor-pointer'), onClick: (e) => {
25543
+ }, onKeyDown: (e) => handleOnKeyDown(e) }) })] }), (isClearable && value && !isDisabled) && jsx("div", { className: classnames('cursor-pointer icon-clear'), onClick: (e) => {
25544
25544
  onChange(isMulti ? [] : undefined);
25545
25545
  e.stopPropagation();
25546
- }, children: jsx("svg", { height: "20", width: "20", color: "#c4c4c4", viewBox: "0 0 20 20", "aria-hidden": "true", focusable: "false", className: "css-tj5bde-Svg", children: jsx("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" }) }) }), !isDisabled && jsx("div", { className: "select-table-indicator", onMouseDown: (e) => e.preventDefault(), children: jsx("svg", { height: "20", width: "20", viewBox: "0 0 20 20", children: 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" }) }) })] }), jsx(DropdownMenu$1, { container: component, className: 'formula-dropdown icon-dropdown p-0', style: {
25546
+ }, children: "\u00D7" }), !isDisabled && jsx("div", { className: "select-table-indicator", onMouseDown: (e) => e.preventDefault(), children: jsx("svg", { height: "20", width: "20", viewBox: "0 0 20 20", children: 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" }) }) })] }), jsx(DropdownMenu$1, { container: component, className: 'formula-dropdown icon-dropdown p-0', style: {
25547
25547
  width: width ? width + 2 : 'min-content',
25548
25548
  position: 'fixed',
25549
25549
  borderRadius: 4,
@@ -41862,7 +41862,7 @@ const DateInput = (props) => {
41862
41862
  if (onChange) {
41863
41863
  onChange(date);
41864
41864
  }
41865
- }, dateFormat: dateFormat, locale: "vi", showMonthDropdown: true, showYearDropdown: true, dropdownMode: "select", onCalendarClose: () => setOpen(false), onCalendarOpen: () => setOpen(true), customInput: jsx(InputMask, { mask: "99/99/9999", placeholder: dateFormat }), onKeyDown: (e) => {
41865
+ }, dateFormat: dateFormat, locale: "vi", showMonthDropdown: true, showYearDropdown: true, dropdownMode: "select", isClearable: true, onCalendarClose: () => setOpen(false), onCalendarOpen: () => setOpen(true), customInput: jsx(InputMask, { mask: "99/99/9999", placeholder: dateFormat }), onKeyDown: (e) => {
41866
41866
  if (e.code === 'Space') {
41867
41867
  setOpen(!open);
41868
41868
  setTimeout(() => {
@@ -42064,9 +42064,9 @@ const TableEdit = forwardRef((props, ref) => {
42064
42064
  switch (col?.editTypeCondition ? col?.editTypeCondition(row) : col.editType) {
42065
42065
  case 'date':
42066
42066
  return (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) => {
42067
- row[col.field] = date;
42067
+ row[col.field] = date ? new Date(date.getTime() + 7 * 60 * 60 * 1000) : undefined;
42068
42068
  if (col.callback) {
42069
- col.callback(date, indexRow);
42069
+ col.callback(row[col.field], indexRow);
42070
42070
  }
42071
42071
  handleDataChange(row, col, indexRow);
42072
42072
  }, dateFormat: "dd/MM/yyyy", onKeyDown: (e) => {
@@ -42078,7 +42078,7 @@ const TableEdit = forwardRef((props, ref) => {
42078
42078
  return (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) => {
42079
42079
  row[col.field] = date;
42080
42080
  if (col.callback) {
42081
- col.callback(date, indexRow);
42081
+ col.callback(row[col.field], indexRow);
42082
42082
  }
42083
42083
  handleDataChange(row, col, indexRow);
42084
42084
  }, dateFormat: "dd/MM/yyyy HH:mm", onKeyDown: (e) => {