react-table-edit 1.5.6 → 1.5.7

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
@@ -23953,7 +23953,9 @@ const EditForm = forwardRef((props, ref) => {
23953
23953
  const [itemsField, setItemsField] = useState([]);
23954
23954
  const { t } = useTranslation();
23955
23955
  useOnClickOutside(editFormRef, () => {
23956
- closeMenu();
23956
+ if (dropdownOpen !== false) {
23957
+ closeMenu();
23958
+ }
23957
23959
  });
23958
23960
  const closeMenu = () => {
23959
23961
  setTimeout(() => {
@@ -24117,43 +24119,43 @@ const EditForm = forwardRef((props, ref) => {
24117
24119
  });
24118
24120
  }
24119
24121
  }, [inputRef]);
24120
- return (jsx("div", { className: "form-edit", ref: ref, id: id, children: jsx("div", { ref: editFormRef, children: jsxs(Dropdown$1, { isOpen: dropdownOpen, toggle: () => { }, children: [jsx(DropdownToggle$1, { tag: 'div', children: jsxs("div", { className: classNames$1('display-value', { 'r-is-focus': isFocus || dropdownOpen }, { 'is-invalid': invalid }), onClick: handleOnClick, children: [template?.(rowData, indexRow) ?? displayValue, jsx(Input$1, { style: {
24121
- outline: 'none',
24122
- border: 'none',
24123
- width: template ? 0 : '100%',
24124
- height: template ? 0 : 28,
24125
- lineHeight: template ? 0 : 19,
24126
- padding: template ? 0 : 'auto',
24127
- backgroundColor: '$white',
24128
- textAlign: textAlign ?? 'left'
24129
- }, placeholder: placeholder, innerRef: inputRef, onKeyDown: (e) => handleOnKeyDown(e), onPaste: (e) => onPaste && onPaste(e), readOnly: true })] }) }), jsx(DropdownMenu$1, { className: 'formula-dropdown icon-dropdown p-0', container: component, style: {
24130
- position: 'fixed',
24131
- minWidth: minWidth ? minWidth : defaultWidth,
24132
- width: menuWidth ? menuWidth : 'min-content',
24133
- maxWidth: innerWidth > 1280 ? 1280 : innerWidth,
24134
- borderRadius: 8,
24135
- zIndex: 9999
24136
- }, children: jsxs(DropdownItem$1, { className: 'p-0', style: { borderRadius: '6px' }, tag: 'div', header: true, children: [jsx("div", { onKeyDown: (e) => formKeyDown(e, handleSubmit(handleOnSubmit)), className: 'p-1', style: {
24137
- maxHeight: menuHeight ? menuHeight : 300,
24138
- overflow: "auto"
24139
- }, children: itemsField ? renderForm(itemsField) : '' }), jsxs("div", { className: "d-flex justify-content-between p-50", style: { boxShadow: "0 4px 24px 0 rgb(34 41 47 / 10%)" }, children: [jsx("div", { className: "text-primary py-25", style: { fontSize: 12 }, children: footerTemplate ? footerTemplate(rowData) : '' }), !onChangeField ? jsxs("div", { className: "d-flex justify-content-end", children: [isClearable && jsx(Button$1, { className: 'btn me-50 py-25 px-50', outline: true, onClick: () => {
24140
- itemsField.forEach((e) => {
24141
- if (e.type === 'numeric') {
24142
- setValue(e.name, 0);
24143
- }
24144
- else {
24145
- setValue(e.name, '');
24146
- }
24147
- });
24148
- }, onKeyDown: (e) => {
24149
- if (e.code === 'Tab') {
24150
- closeMenu();
24122
+ return (jsx("div", { className: "form-edit", ref: ref, id: id, children: jsxs(Dropdown$1, { isOpen: dropdownOpen, toggle: () => { }, children: [jsx(DropdownToggle$1, { tag: 'div', children: jsxs("div", { className: classNames$1('display-value', { 'r-is-focus': isFocus || dropdownOpen }, { 'is-invalid': invalid }), onClick: handleOnClick, children: [template?.(rowData, indexRow) ?? displayValue, jsx(Input$1, { style: {
24123
+ outline: 'none',
24124
+ border: 'none',
24125
+ width: template ? 0 : '100%',
24126
+ height: template ? 0 : 28,
24127
+ lineHeight: template ? 0 : 19,
24128
+ padding: template ? 0 : 'auto',
24129
+ backgroundColor: '$white',
24130
+ textAlign: textAlign ?? 'left'
24131
+ }, placeholder: placeholder, innerRef: inputRef, onKeyDown: (e) => handleOnKeyDown(e), onPaste: (e) => onPaste && onPaste(e), readOnly: true })] }) }), jsx(DropdownMenu$1, { className: 'formula-dropdown icon-dropdown p-0', container: component, style: {
24132
+ position: 'fixed',
24133
+ minWidth: minWidth ? minWidth : defaultWidth,
24134
+ width: menuWidth ? menuWidth : 'min-content',
24135
+ maxWidth: innerWidth > 1280 ? 1280 : innerWidth,
24136
+ borderRadius: 8,
24137
+ zIndex: 9999
24138
+ }, children: jsxs(DropdownItem$1, { className: 'p-0', style: { borderRadius: '6px' }, tag: 'div', header: true, children: [jsx("div", { onKeyDown: (e) => formKeyDown(e, handleSubmit(handleOnSubmit)), className: 'p-1', ref: editFormRef, style: {
24139
+ maxHeight: menuHeight ? menuHeight : 300,
24140
+ overflow: "auto"
24141
+ }, children: itemsField ? renderForm(itemsField) : '' }), jsxs("div", { className: "d-flex justify-content-between p-50", style: { boxShadow: "0 4px 24px 0 rgb(34 41 47 / 10%)" }, children: [jsx("div", { className: "text-primary py-25", style: { fontSize: 12 }, children: footerTemplate ? footerTemplate(rowData) : '' }), !onChangeField ? jsxs("div", { className: "d-flex justify-content-end", children: [isClearable && jsx(Button$1, { className: 'btn me-50 py-25 px-50', outline: true, onClick: () => {
24142
+ itemsField.forEach((e) => {
24143
+ if (e.type === 'numeric') {
24144
+ setValue(e.name, 0);
24151
24145
  }
24152
- }, children: t('Clear') }), jsx(Button$1, { color: 'primary', className: 'btn btn-primary py-25 px-50', onClick: handleSubmit(handleOnSubmit), onKeyDown: (e) => {
24153
- if (e.code === 'Tab') {
24154
- closeMenu();
24146
+ else {
24147
+ setValue(e.name, '');
24155
24148
  }
24156
- }, children: t('Save') })] }) : jsx(Fragment$1, {})] })] }) })] }) }) }));
24149
+ });
24150
+ }, onKeyDown: (e) => {
24151
+ if (e.code === 'Tab') {
24152
+ closeMenu();
24153
+ }
24154
+ }, children: t('Clear') }), jsx(Button$1, { color: 'primary', className: 'btn btn-primary py-25 px-50', onClick: handleSubmit(handleOnSubmit), onKeyDown: (e) => {
24155
+ if (e.code === 'Tab') {
24156
+ closeMenu();
24157
+ }
24158
+ }, children: t('Save') })] }) : jsx(Fragment$1, {})] })] }) })] }) }));
24157
24159
  });
24158
24160
 
24159
24161
  const SelectTableBox = (props) => {