mig-schema-table 3.0.113 → 3.0.114

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.
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
- const MINIMUM_COLUMN_WIDTH = 25;
3
+ import { MINIMUM_COLUMN_WIDTH } from "../../inc/constant";
4
4
  const ColumnResizers = ({ columnWidths, setColumnWidths, tableBodyHeight, }) => {
5
5
  const [dragColumnIndex, setDragColumnIndex] = React.useState(-1);
6
6
  const [dragStartX, setDragStartX] = React.useState(0);
@@ -17,7 +17,7 @@ import { localeFormat } from "../inc/date";
17
17
  import { defaultTranslate } from "../inc/string";
18
18
  import { SELECT_ALL_COLUMN_NAME, SELECT_ALL_COLUMN_WIDTH } from "./constants";
19
19
  import Td from "./Td";
20
- import { DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, ENumberColumnFilterOperation, } from "../inc/constant";
20
+ import { DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, ENumberColumnFilterOperation, MINIMUM_COLUMN_WIDTH, } from "../inc/constant";
21
21
  import { parseLocationHash, serializeLocationHash } from "../inc/data";
22
22
  import Th, { EColumnFilterStatus } from "./Th";
23
23
  import ThMenu from "./ThMenu";
@@ -220,7 +220,7 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
220
220
  return { dynamicWidthColumnCount, fixedWidthColumnsWidth };
221
221
  }, [columnNames, config]);
222
222
  React.useEffect(() => {
223
- const dynamicColumnWidth = Math.floor((width - fixedWidthColumnsWidth) / dynamicWidthColumnCount);
223
+ const dynamicColumnWidth = Math.max(Math.floor((width - fixedWidthColumnsWidth) / dynamicWidthColumnCount), MINIMUM_COLUMN_WIDTH);
224
224
  let roundingDifference = (width - fixedWidthColumnsWidth) % dynamicWidthColumnCount;
225
225
  setColumnWidths(columnNames.map((propName) => {
226
226
  if (propName === SELECT_ALL_COLUMN_NAME) {
@@ -1,5 +1,6 @@
1
1
  export declare const DEFAULT_DATE_FORMAT = "dd MMM yyyy";
2
2
  export declare const DEFAULT_DATE_TIME_FORMAT = "dd MMM yyyy HH:mm";
3
+ export declare const MINIMUM_COLUMN_WIDTH = 25;
3
4
  export declare enum ENumberColumnFilterOperation {
4
5
  "GT" = "GT",
5
6
  "LT" = "LT",
@@ -1,5 +1,6 @@
1
1
  export const DEFAULT_DATE_FORMAT = "dd MMM yyyy";
2
2
  export const DEFAULT_DATE_TIME_FORMAT = "dd MMM yyyy HH:mm";
3
+ export const MINIMUM_COLUMN_WIDTH = 25;
3
4
  export var ENumberColumnFilterOperation;
4
5
  (function (ENumberColumnFilterOperation) {
5
6
  ENumberColumnFilterOperation["GT"] = "GT";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mig-schema-table",
3
- "version": "3.0.113",
3
+ "version": "3.0.114",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/"