@gridsuite/commons-ui 0.91.0 → 0.92.0

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/README.md CHANGED
@@ -8,33 +8,35 @@ The commons-ui library have a demo app in which you can call your components to
8
8
  The `npm start` command install the library's dependencies then launches the demo app.
9
9
 
10
10
  If you want to test your library integration with a consumer application my-app you have first
11
- to build commons-ui via
11
+ to build commons-ui via
12
+
12
13
  - `npm install` (if not already done to get `tsc`)
13
14
  - `npm run build:pack`
14
15
 
15
16
  Then in the my-app project :
16
- - Change the commons-ui dependency in my-app's package.json from
17
- `@gridsuite/commons-ui:"^x.x.x"`
18
- to
19
- `@gridsuite/commons-ui:"file:{PATH_TO_LIBRARY}/gridsuite-commons-ui-{LIBRARY_VERSION}.tgz"`
17
+
18
+ - Change the commons-ui dependency in my-app's package.json from
19
+ `@gridsuite/commons-ui:"^x.x.x"`
20
+ to
21
+ `@gridsuite/commons-ui:"file:{PATH_TO_LIBRARY}/gridsuite-commons-ui-{LIBRARY_VERSION}.tgz"`
20
22
  - `npm install`
21
23
  - `npm start`
22
24
 
23
- *Warning* : with Create React App, we realised the library was not updating correctly if you try to install the library multiple times.
25
+ _Warning_ : with Create React App, we realised the library was not updating correctly if you try to install the library multiple times.
24
26
  To fix this, run this command from the app **after** running "npm install"
27
+
25
28
  - rm -Rf node_modules/.cache
26
-
27
29
 
28
30
  #### For integrators
29
31
 
30
32
  If you want to deploy a new version of commons-ui in the [NPM package registry](https://www.npmjs.com/package/@gridsuite/commons-ui),
31
33
  you need to follow the steps below:
32
34
 
33
- - [Make a release action](https://github.com/gridsuite/commons-ui/actions/workflows/release.yml)
34
- - In the 'run workflow' combobox select, let the branch on main
35
- - Enter the type of evolution (major | minor | patch)
36
- - Enter your NPM access token (it must be an **automation** access token to bypass 2FA, see the [access token documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) for details)
37
- - Click 'run workflow'
35
+ - [Make a release action](https://github.com/gridsuite/commons-ui/actions/workflows/release.yml)
36
+ - In the 'run workflow' combobox select, let the branch on main
37
+ - Enter the type of evolution (major | minor | patch)
38
+ - Enter your NPM access token (it must be an **automation** access token to bypass 2FA, see the [access token documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) for details)
39
+ - Click 'run workflow'
38
40
 
39
41
  #### License Headers and dependencies checking
40
42
 
@@ -44,6 +46,7 @@ To check dependencies license compatibility with this project one locally, pleas
44
46
  npm run licenses-check
45
47
  ```
46
48
 
47
- Notes :
48
- * Check [license-checker-config.json](license-checker-config.json) for license white list and exclusion.
49
- If you need to update this list, please inform organization's owners.
49
+ Notes :
50
+
51
+ - Check [license-checker-config.json](license-checker-config.json) for license white list and exclusion.
52
+ If you need to update this list, please inform organization's owners.
@@ -2,7 +2,6 @@ import { default as React } from 'react';
2
2
  import { AgGridReact, AgGridReactProps } from 'ag-grid-react';
3
3
  interface CustomAGGGridStyleProps {
4
4
  shouldHidePinnedHeaderRightBorder?: boolean;
5
- showOverlay?: boolean;
6
5
  }
7
6
  export interface CustomAGGridProps extends AgGridReactProps, CustomAGGGridStyleProps {
8
7
  }
@@ -19,7 +19,7 @@ const onColumnResized = (params) => {
19
19
  }
20
20
  };
21
21
  const CustomAGGrid = React.forwardRef((props, ref) => {
22
- const { shouldHidePinnedHeaderRightBorder = false, showOverlay = false, ...agGridReactProps } = props;
22
+ const { shouldHidePinnedHeaderRightBorder = false, ...agGridReactProps } = props;
23
23
  const theme = useTheme();
24
24
  const intl = useIntl();
25
25
  const GRID_PREFIX = "grid.";
@@ -38,8 +38,7 @@ const CustomAGGrid = React.forwardRef((props, ref) => {
38
38
  {
39
39
  sx: mergeSx(
40
40
  styles.grid,
41
- shouldHidePinnedHeaderRightBorder ? styles.noBorderRight : void 0,
42
- showOverlay ? styles.overlayBackground : void 0
41
+ shouldHidePinnedHeaderRightBorder ? styles.noBorderRight : void 0
43
42
  ),
44
43
  className: `${theme.aggrid.theme} ${CUSTOM_AGGRID_THEME}`,
45
44
  children: /* @__PURE__ */ jsx(
@@ -8,12 +8,4 @@ export declare const styles: {
8
8
  borderRight: string;
9
9
  };
10
10
  };
11
- overlayBackground: (theme: Theme) => {
12
- '& .ag-overlay-loading-wrapper': {
13
- background: string;
14
- };
15
- '& .ag-overlay-no-rows-wrapper': {
16
- background: string;
17
- };
18
- };
19
11
  };
@@ -33,15 +33,7 @@ const styles = {
33
33
  "& .ag-pinned-left-header": {
34
34
  borderRight: "none"
35
35
  }
36
- },
37
- overlayBackground: (theme) => ({
38
- "& .ag-overlay-loading-wrapper": {
39
- background: theme.aggrid.overlay.background
40
- },
41
- "& .ag-overlay-no-rows-wrapper": {
42
- background: "none"
43
- }
44
- })
36
+ }
45
37
  };
46
38
  export {
47
39
  CUSTOM_AGGRID_THEME,
@@ -24,7 +24,7 @@ function UniqueNameInput({
24
24
  autoFocus,
25
25
  onManualChangeCallback,
26
26
  formProps,
27
- currentName,
27
+ currentName = "",
28
28
  activeDirectory,
29
29
  sx,
30
30
  fullWidth = true
@@ -2,10 +2,13 @@ import { useRef, useEffect, useCallback } from "react";
2
2
  const useListenerManager = (urls) => {
3
3
  const urlsListenersRef = useRef({});
4
4
  useEffect(() => {
5
- urlsListenersRef.current = Object.keys(urls).reduce((acc, urlKey) => {
6
- acc[urlKey] = urlsListenersRef.current[urlKey] ?? [];
7
- return acc;
8
- }, {});
5
+ urlsListenersRef.current = Object.keys(urls).reduce(
6
+ (acc, urlKey) => {
7
+ acc[urlKey] = urlsListenersRef.current[urlKey] ?? [];
8
+ return acc;
9
+ },
10
+ {}
11
+ );
9
12
  }, [urls]);
10
13
  const addListenerEvent = useCallback((urlKey, listener) => {
11
14
  const urlsListeners = urlsListenersRef.current;
package/package.json CHANGED
@@ -1,16 +1,23 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.91.0",
3
+ "version": "0.92.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
7
7
  "license": "MPL-2.0",
8
8
  "repository": "git://github.com/gridsuite/commons-ui.git",
9
9
  "engines": {
10
- "node": ">=22",
10
+ "node": ">=22.6.0",
11
11
  "npm": "^10.9.2"
12
12
  },
13
- "exports": "./dist/index.js",
13
+ "type": "module",
14
+ "exports": {
15
+ ".": {
16
+ "import": "./dist/index.js",
17
+ "types": "./dist/index.d.ts"
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
14
21
  "module": "./dist/index.js",
15
22
  "types": "./dist/index.d.ts",
16
23
  "files": [
@@ -20,8 +27,8 @@
20
27
  "**/*.css"
21
28
  ],
22
29
  "scripts": {
23
- "start": "vite demo/ --config vite.config.mts",
24
- "start:open": "vite demo/ --config vite.config.mts --open",
30
+ "start": "vite demo/ --config vite.config.ts",
31
+ "start:open": "vite demo/ --config vite.config.ts --open",
25
32
  "build": "tsc && vite build",
26
33
  "build:pack": "tsc && vite build && npm pack",
27
34
  "prepublishOnly": "npm run build",
@@ -29,6 +36,7 @@
29
36
  "test:coverage": "jest --coverage",
30
37
  "test:watch": "jest --watch",
31
38
  "lint": "eslint . --ext js,mjs,jsx,ts,mts,tsx --max-warnings 0",
39
+ "lint:format": "prettier --check --cache .",
32
40
  "licenses-check": "license-checker --summary --excludePrivatePackages --production --onlyAllow \"$( jq -r .onlyAllow[] license-checker-config.json | tr '\n' ';')\" --excludePackages \"$( jq -r .excludePackages[] license-checker-config.json | tr '\n' ';')\""
33
41
  },
34
42
  "dependencies": {
@@ -65,7 +73,7 @@
65
73
  "react-hook-form": "^7.54.2",
66
74
  "react-intl": "^7.1.6",
67
75
  "react-papaparse": "^4.4.0",
68
- "react-router": "^6.29.0",
76
+ "react-router": "^7.4.1",
69
77
  "yup": "^1.6.1"
70
78
  },
71
79
  "devDependencies": {
@@ -108,12 +116,12 @@
108
116
  "eslint": "^8.57.1",
109
117
  "eslint-config-airbnb": "^19.0.4",
110
118
  "eslint-config-airbnb-typescript": "^18.0.0",
111
- "eslint-config-prettier": "^9.1.0",
119
+ "eslint-config-prettier": "^10.1.1",
112
120
  "eslint-config-react-app": "^7.0.1",
113
121
  "eslint-plugin-flowtype": "^8.0.3",
114
122
  "eslint-plugin-import": "^2.31.0",
115
123
  "eslint-plugin-jsx-a11y": "^6.10.2",
116
- "eslint-plugin-prettier": "^4.2.1",
124
+ "eslint-plugin-prettier": "^5.2.5",
117
125
  "eslint-plugin-react": "^7.37.4",
118
126
  "eslint-plugin-react-hooks": "^4.6.2",
119
127
  "glob": "^11.0.1",
@@ -122,15 +130,16 @@
122
130
  "jest-environment-jsdom": "^29.7.0",
123
131
  "license-checker": "^25.0.1",
124
132
  "notistack": "^3.0.2",
125
- "prettier": "^2.8.8",
133
+ "prettier": "^3.5.3",
134
+ "prettier-plugin-properties": "^0.3.0",
126
135
  "react": "^18.3.1",
127
136
  "react-dom": "^18.3.1",
128
137
  "react-hook-form": "^7.54.2",
129
138
  "react-intl": "^7.1.6",
130
139
  "react-papaparse": "^4.4.0",
131
140
  "react-resizable": "^3.0.5",
132
- "react-router": "^6.29.0",
133
- "react-router-dom": "^6.29.0",
141
+ "react-router": "^7.4.1",
142
+ "svgo": "^3.3.2",
134
143
  "ts-node": "^10.9.2",
135
144
  "typescript": "~5.5.4",
136
145
  "vite": "^6.2.1",