@gpa-gemstone/react-table 1.2.58 → 1.2.59

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.
@@ -119,7 +119,7 @@ function Table(props) {
119
119
  if (React.isValidElement(element) && IsColumnProps(element.props)) {
120
120
  if (newMap.get(element.props.Key) != null)
121
121
  console.error("Multiple of the same key detected in table, this will cause issues.");
122
- newMap.set(element.props.Key, { minWidth: 100, maxWidth: 1000, width: 100 });
122
+ newMap.set(element.props.Key, { minWidth: 10, maxWidth: 1000, width: 100 });
123
123
  }
124
124
  });
125
125
  // If width is the same and keys are identical, we can skip the operation
package/package.json CHANGED
@@ -1,57 +1,57 @@
1
- {
2
- "name": "@gpa-gemstone/react-table",
3
- "version": "1.2.58",
4
- "description": "Table for GPA web applications",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "files": ["lib"],
8
- "scripts": {
9
- "test": "jest --config jestconfig.json",
10
- "build": "tsc",
11
- "format": "prettier --write \"src/**/*.tsx\"",
12
- "lint": "eslint . --ext .ts,.tsx",
13
- "prepare": "npm run build",
14
- "prepublishOnly": "npm test && npm run lint",
15
- "preversion": "npm run lint",
16
- "version": "npm run format && git add -A src",
17
- "postversion": "git push && git push --tags"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "https://github.com/GridProtectionAlliance/gpa-gemstone.git"
22
- },
23
- "keywords": [
24
- "React",
25
- "Table",
26
- "GSF",
27
- "Gemstone",
28
- "GridProtectionAlliance"
29
- ],
30
- "author": "GridProtectionAlliance",
31
- "license": "MIT",
32
- "bugs": {"url": "https://github.com/GridProtectionAlliance/gpa-gemstone/issues"},
33
- "homepage": "https://github.com/GridProtectionAlliance/gpa-gemstone#readme",
34
- "devDependencies": {
35
- "@types/jest": "^27.0.0",
36
- "@typescript-eslint/eslint-plugin": "^5.60.0",
37
- "@typescript-eslint/parser": "^5.60.0",
38
- "@types/react-portal": "4.0.4",
39
- "eslint": "^8.43.0",
40
- "jest": "^29.0.0",
41
- "prettier": "^2.3.2",
42
- "ts-jest": "^29.0.0",
43
- "typescript": "5.5.3"
44
- },
45
- "dependencies": {
46
- "@gpa-gemstone/gpa-symbols": "0.0.45",
47
- "@gpa-gemstone/helper-functions": "0.0.36",
48
- "@gpa-gemstone/react-interactive": "1.0.137",
49
- "@types/lodash": "^4.14.171",
50
- "@types/react": "^17.0.14",
51
- "lodash": "^4.17.21",
52
- "react": "^18.2.0",
53
- "react-dom": "18.2.0",
54
- "react-portal": "4.2.2"
55
- },
56
- "publishConfig": {"access": "public"}
1
+ {
2
+ "name": "@gpa-gemstone/react-table",
3
+ "version": "1.2.59",
4
+ "description": "Table for GPA web applications",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "files": ["lib"],
8
+ "scripts": {
9
+ "test": "jest --config jestconfig.json",
10
+ "build": "tsc",
11
+ "format": "prettier --write \"src/**/*.tsx\"",
12
+ "lint": "eslint . --ext .ts,.tsx",
13
+ "prepare": "npm run build",
14
+ "prepublishOnly": "npm test && npm run lint",
15
+ "preversion": "npm run lint",
16
+ "version": "npm run format && git add -A src",
17
+ "postversion": "git push && git push --tags"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/GridProtectionAlliance/gpa-gemstone.git"
22
+ },
23
+ "keywords": [
24
+ "React",
25
+ "Table",
26
+ "GSF",
27
+ "Gemstone",
28
+ "GridProtectionAlliance"
29
+ ],
30
+ "author": "GridProtectionAlliance",
31
+ "license": "MIT",
32
+ "bugs": {"url": "https://github.com/GridProtectionAlliance/gpa-gemstone/issues"},
33
+ "homepage": "https://github.com/GridProtectionAlliance/gpa-gemstone#readme",
34
+ "devDependencies": {
35
+ "@types/jest": "^27.0.0",
36
+ "@typescript-eslint/eslint-plugin": "^5.60.0",
37
+ "@typescript-eslint/parser": "^5.60.0",
38
+ "@types/react-portal": "4.0.4",
39
+ "eslint": "^8.43.0",
40
+ "jest": "^29.0.0",
41
+ "prettier": "^2.3.2",
42
+ "ts-jest": "^29.0.0",
43
+ "typescript": "5.5.3"
44
+ },
45
+ "dependencies": {
46
+ "@gpa-gemstone/gpa-symbols": "0.0.46",
47
+ "@gpa-gemstone/helper-functions": "0.0.37",
48
+ "@gpa-gemstone/react-interactive": "1.0.138",
49
+ "@types/lodash": "^4.14.171",
50
+ "@types/react": "^17.0.14",
51
+ "lodash": "^4.17.21",
52
+ "react": "^18.2.0",
53
+ "react-dom": "18.2.0",
54
+ "react-portal": "4.2.2"
55
+ },
56
+ "publishConfig": {"access": "public"}
57
57
  }
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import * as ReactTableProps from './Types';
3
- export declare function AdjustableColumn<T>(props: React.PropsWithChildren<ReactTableProps.IColumn<T>>): JSX.Element;
4
- export declare function Column<T>(props: React.PropsWithChildren<ReactTableProps.IColumn<T>>): JSX.Element;
5
- export interface IHeaderWrapperProps {
6
- onSort: React.MouseEventHandler<HTMLTableCellElement>;
7
- startAdjustment?: React.MouseEventHandler<HTMLDivElement>;
8
- sorted: boolean;
9
- asc: boolean;
10
- style: React.CSSProperties;
11
- allowSort?: boolean;
12
- colKey: string;
13
- }
14
- export declare function ColumnHeaderWrapper(props: React.PropsWithChildren<IHeaderWrapperProps>): JSX.Element;
15
- export interface IDataWrapperProps {
16
- dragStart?: (e: React.DragEvent) => void;
17
- onClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
18
- style: React.CSSProperties;
19
- }
20
- export declare function ColumnDataWrapper(props: React.PropsWithChildren<IDataWrapperProps>): JSX.Element;
@@ -1,77 +0,0 @@
1
- "use strict";
2
- // ******************************************************************************************************
3
- // Column.tsx - Gbtc
4
- //
5
- // Copyright © 2018, Grid Protection Alliance. All Rights Reserved.
6
- //
7
- // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
8
- // the NOTICE file distributed with this work for additional information regarding copyright ownership.
9
- // The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
10
- // file except in compliance with the License. You may obtain a copy of the License at:
11
- //
12
- // http://opensource.org/licenses/MIT
13
- //
14
- // Unless agreed to in writing, the subject software distributed under the License is distributed on an
15
- // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
16
- // License for the specific language governing permissions and limitations.
17
- //
18
- // Code Modification History:
19
- // ----------------------------------------------------------------------------------------------------
20
- // 08/02/2018 - Billy Ernest
21
- // Generated original version of source code.
22
- // 05/31/2024 - C. Lackner
23
- // Refactored to fix sizing issues.
24
- // 12/04/2024 - G. Santos
25
- // Refactored to fix performance issues.
26
- //
27
- // ******************************************************************************************************
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.AdjustableColumn = AdjustableColumn;
30
- exports.Column = Column;
31
- exports.ColumnHeaderWrapper = ColumnHeaderWrapper;
32
- exports.ColumnDataWrapper = ColumnDataWrapper;
33
- const gpa_symbols_1 = require("@gpa-gemstone/gpa-symbols");
34
- const React = require("react");
35
- function AdjustableColumn(props) {
36
- return React.createElement(React.Fragment, null, props.children);
37
- }
38
- function Column(props) {
39
- return React.createElement(React.Fragment, null, props.children);
40
- }
41
- function ColumnHeaderWrapper(props) {
42
- var _a;
43
- const [showBorder, setShowBorder] = React.useState(false);
44
- const onHover = React.useCallback(() => { setShowBorder(true); }, []);
45
- const onLeave = React.useCallback(() => { setShowBorder(false); }, []);
46
- const onClickBorder = React.useCallback((e) => {
47
- if (props.startAdjustment != null)
48
- props.startAdjustment(e);
49
- }, [props.startAdjustment]);
50
- const onClick = React.useCallback((e) => {
51
- var _a;
52
- if ((_a = props.allowSort) !== null && _a !== void 0 ? _a : true)
53
- props.onSort(e);
54
- }, [props.onSort, props.allowSort]);
55
- const preventPropagation = React.useCallback((e) => {
56
- e.stopPropagation();
57
- }, []);
58
- return React.createElement("th", { style: props.style, onClick: onClick, onDrag: (e) => { e.stopPropagation(); }, id: props.colKey },
59
- props.startAdjustment == null ? React.createElement(React.Fragment, null) :
60
- React.createElement("div", { style: {
61
- width: 5,
62
- height: '100%',
63
- position: 'absolute',
64
- top: 0,
65
- left: 0,
66
- opacity: showBorder ? 1 : 0,
67
- background: '#e9ecef',
68
- cursor: 'col-resize',
69
- }, onMouseEnter: onHover, onMouseLeave: onLeave, onMouseDown: onClickBorder, onClick: preventPropagation }),
70
- props.sorted ? React.createElement("div", { style: { position: 'absolute', width: 25 } }, props.asc ? React.createElement(gpa_symbols_1.ReactIcons.ArrowDropUp, null) : React.createElement(gpa_symbols_1.ReactIcons.ArrowDropDown, null)) : null,
71
- React.createElement("div", { style: {
72
- marginLeft: (props.sorted ? 25 : 0),
73
- } }, (_a = props.children) !== null && _a !== void 0 ? _a : props.colKey));
74
- }
75
- function ColumnDataWrapper(props) {
76
- return (React.createElement("td", { style: props.style, onClick: props.onClick, draggable: props.dragStart !== undefined, onDragStart: props.dragStart }, props.children));
77
- }
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- import * as ReactTableProps from './Types';
3
- export declare function AdjustableTable<T>(props: React.PropsWithChildren<ReactTableProps.ITable<T>>): JSX.Element;