react-table-edit 1.4.6 → 1.4.8

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
@@ -42139,7 +42139,7 @@ pagingClient, pagingSetting
42139
42139
  await onDuplicate(newData, indexFocus);
42140
42140
  }
42141
42141
  if (pagingClient) {
42142
- dataSource.splice((((pagingSetting?.currentPage ?? 1) - 1) * (pagingSetting?.pageSize ?? 0) + indexFocus) + 1, 0, newData);
42142
+ dataSource.splice(((((pagingSetting?.currentPage ?? 1) - 1) * (pagingSetting?.pageSize ?? 0)) + indexFocus) + 1, 0, newData);
42143
42143
  }
42144
42144
  else {
42145
42145
  dataSource.splice(indexFocus + 1, 0, newData);
@@ -42159,7 +42159,7 @@ changeDataSource,
42159
42159
  tableElement, totalCount, pagingClient, pagingSetting, toolbarSetting, buttonSetting, editDisable, addDisable) => {
42160
42160
  if (toolbarSetting?.showBottomToolbar && !buttonSetting?.insertAfterDisable && !editDisable && !addDisable) {
42161
42161
  if (pagingClient) {
42162
- dataSource.splice((((pagingSetting?.currentPage ?? 1) - 1) * (pagingSetting?.pageSize ?? 0) + (indexFocus ?? -1) + 1), 0, { ...{ ...defaultValue } });
42162
+ dataSource.splice(((((pagingSetting?.currentPage ?? 1) - 1) * (pagingSetting?.pageSize ?? 0)) + (indexFocus ?? -1) + 1), 0, { ...{ ...defaultValue } });
42163
42163
  }
42164
42164
  else {
42165
42165
  dataSource.splice((indexFocus ?? -1) + 1, 0, { ...defaultValue });
@@ -42179,7 +42179,7 @@ changeDataSource,
42179
42179
  pagingClient, pagingSetting, toolbarSetting, buttonSetting, editDisable, addDisable) => {
42180
42180
  if (toolbarSetting?.showBottomToolbar && !buttonSetting?.insertBeforeDisable && !editDisable && !addDisable) {
42181
42181
  if (pagingClient) {
42182
- dataSource.splice((((pagingSetting?.currentPage ?? 1) - 1) * (pagingSetting?.pageSize ?? 0) + (indexFocus ?? -1)), 0, { ...{ ...defaultValue } });
42182
+ dataSource.splice(((((pagingSetting?.currentPage ?? 1) - 1) * (pagingSetting?.pageSize ?? 0)) + (indexFocus ?? -1)), 0, { ...{ ...defaultValue } });
42183
42183
  }
42184
42184
  else {
42185
42185
  dataSource.splice((indexFocus ?? -1), 0, { ...defaultValue });
@@ -42204,14 +42204,11 @@ editDisable, addDisable, toolbarSetting, buttonSetting) => {
42204
42204
 
42205
42205
  const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleInsertAfter, handleDeleteAll, setOpenPopupSetupColumn, indexFocus, editDisable, addDisable, buttonSetting, toolbarSetting, headerColumns, t }) => {
42206
42206
  return (jsx("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: jsxs("div", { className: "r-toolbar-items", children: [jsxs("div", { className: "r-toolbar-left", children: [jsx("div", { className: classnames('r-toolbar-item', { 'd-none': editDisable || addDisable }), "aria-disabled": "false", children: jsx(Button$1, { color: 'success', outline: true, onClick: handleAdd, className: 'd-flex', children: t('Add item') }) }), (indexFocus ?? -1) > -1 ? jsxs(Fragment$1, { children: [jsx("div", { className: classnames('r-toolbar-item', { 'd-none': editDisable || addDisable || buttonSetting?.duplicateDisable }), "aria-disabled": "false", children: jsx(Button$1, { color: 'success', outline: true, onClick: () => { handleDuplicate(); }, className: 'd-flex', children: t('Duplicate') }) }), jsx("div", { className: classnames('r-toolbar-item', { 'd-none': editDisable || addDisable || buttonSetting?.insertBeforeDisable }), "aria-disabled": "false", children: jsx(Button$1, { color: 'success', outline: true, onClick: handleInsertBefore, className: 'd-flex', children: t('Insert item before') }) }), jsx("div", { className: classnames('r-toolbar-item', { 'd-none': editDisable || addDisable || buttonSetting?.insertAfterDisable }), "aria-disabled": "false", children: jsx(Button$1, { color: 'success', outline: true, onClick: handleInsertAfter, className: 'd-flex', children: t('Insert item after') }) })] }) : jsx(Fragment$1, { children: " " }), jsx("div", { className: classnames('r-toolbar-item', { 'd-none': editDisable || buttonSetting?.deleteAllDisable }), "aria-disabled": "false", children: jsx(Button$1, { color: 'primary', outline: true, onClick: handleDeleteAll, className: 'd-flex', children: t('Delete all item') }) }), toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
42207
- return ((item.align === 'left') ?
42208
- jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`) : '');
42207
+ return ((item.align === 'left') ? jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`) : '');
42209
42208
  })] }), jsx("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
42210
- return ((item.align === 'center') ?
42211
- jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`) : '');
42209
+ return ((item.align === 'center') ? jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`) : '');
42212
42210
  }) }), jsxs("div", { className: "r-toolbar-right", children: [toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
42213
- return ((item.align === 'right') ?
42214
- jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`) : '');
42211
+ return ((item.align === 'right') ? jsx("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`) : '');
42215
42212
  }), jsx("div", { className: classnames('r-toolbar-item me-25', { 'd-none': headerColumns.length > 1 }), "aria-disabled": "false", children: jsx(SvgSettings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }), jsx("div", { className: classnames('r-toolbar-item me-25', { 'd-none': editDisable || addDisable }), "aria-disabled": "false", children: jsxs(UncontrolledDropdown, { className: 'dropdown-user nav-item', children: [jsx(DropdownToggle$1, { tag: 'div', color: "primary", onClick: (e) => e.preventDefault(), children: jsx(SvgInfo, { className: "cursor-pointer text-primary" }) }), jsx(DropdownMenu$1, { className: 'formula-dropdown icon-dropdown', children: jsxs("ul", { className: "mb-0 pe-50", children: [jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\u00E2n b\u1EA3n" }), jsx("li", { style: { fontSize: 13 }, children: "Ch\u1ECDn \u00F4 v\u00E0 Ctrl + V \u0111\u1EC3 d\u00E1n th\u00F4ng tin t\u1EEB excel" }), jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\u00E9p h\u00E0ng" }), jsx("li", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\u00E0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\u00E0ng v\u00E0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\u00E1n h\u00E0ng" })] }) })] }) })] })] }) }));
42216
42213
  };
42217
42214
 
@@ -42646,13 +42643,13 @@ const TableEdit = forwardRef((props, ref) => {
42646
42643
  } }));
42647
42644
  case 'numeric':
42648
42645
  const numericFormatProps = {
42649
- value: !isNullOrUndefined$1(row[col.field]) ? row[col.field] : '',
42646
+ value: !isNullOrUndefined$1(row[col.field]) ? row[col.field].toString() : '',
42650
42647
  thousandSeparator: checkThousandSeparator(formatSetting?.thousandSeparator, formatSetting?.decimalSeparator),
42651
42648
  decimalSeparator: checkDecimalSeparator(formatSetting?.thousandSeparator, formatSetting?.decimalSeparator),
42652
42649
  allowNegative: col.numericSettings?.allowNegative ?? false,
42653
42650
  decimalScale: col.numericSettings?.fraction ?? 0
42654
42651
  };
42655
- let floatValue = parseFloat(row[col.field]);
42652
+ let floatValue = parseFloat(row[col.field] ?? '0');
42656
42653
  return (jsx(NumericFormat, { id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`, style: { textAlign: col.textAlign, height: 29 }, ...numericFormatProps, defaultValue: formartNumberic(row[col.field], formatSetting?.decimalSeparator ?? ',', formatSetting?.thousandSeparator ?? '.', col.numericSettings?.fraction), className: classnames('form-control border-0 rounded-0 input-numeric', { 'is-invalid': col.validate && col.validate(row[col.field], row) }), onValueChange: (values) => {
42657
42654
  floatValue = values?.floatValue;
42658
42655
  }, onFocus: (e) => {
@@ -65044,7 +65041,7 @@ const Wizard = forwardRef((props, ref) => {
65044
65041
  return (jsxs(Fragment, { children: [index !== 0 && index !== steps.length ? jsx("div", { className: 'line', children: separator }) : null, jsx("div", { className: classnames('step', {
65045
65042
  crossed: (step.done !== undefined ? step.done : activeStep > index),
65046
65043
  disable: step.disable,
65047
- active: index === activeStep
65044
+ active: (index + 1) === activeStep
65048
65045
  }), "data-target": `#${step.id}`, children: jsxs("button", { type: 'button', disabled: step.disable, className: 'step-trigger', onClick: () => setActiveStep?.(index), children: [jsx("span", { className: 'bs-stepper-box', children: step.icon ? step.icon : index + 1 }), jsxs("span", { className: 'bs-stepper-label', children: [jsxs("span", { className: 'bs-stepper-title', children: [step.title, " "] }), step.loading && jsx(Spinner$1, { className: 'text-info', style: { borderWidth: 2, height: 15, width: 15, marginRight: 3 } }), " ", step.subtitle ? jsx("span", { className: 'bs-stepper-subtitle', children: step.subtitle }) : null] })] }) })] }, step.id));
65049
65046
  });
65050
65047
  };