@portnet/ui 0.0.115 → 0.0.117

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.
@@ -77,8 +77,12 @@ const PuiStandardDateField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
77
77
  } = _ref,
78
78
  rest = _objectWithoutProperties(_ref, _excluded);
79
79
  const handleChange = value => {
80
- const formattedValue = format ? value.format(format) : value.toISOString();
81
- onChange(formattedValue);
80
+ if (value) {
81
+ const formattedValue = format ? value.format(format) : value.toISOString();
82
+ onChange(formattedValue);
83
+ } else {
84
+ onChange(null);
85
+ }
82
86
  };
83
87
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DesktopDatePicker.DesktopDatePicker, _objectSpread({
84
88
  ref: ref,
@@ -144,8 +148,13 @@ const PuiFormikDateField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
144
148
  const formikContext = (0, _formik.useFormikContext)();
145
149
  const [hasError, setHasError] = React.useState(false);
146
150
  const handleChange = value => {
147
- formikContext.setFieldValue(name, value);
148
- onChange(value);
151
+ if (value) {
152
+ formikContext.setFieldValue(name, value);
153
+ onChange(value);
154
+ } else {
155
+ formikContext.setFieldValue(name, null);
156
+ onChange(null);
157
+ }
149
158
  };
150
159
  const handleBlur = event => {
151
160
  onBlur(event);
@@ -145,7 +145,7 @@ const specificReferentielsBaseColumns = {
145
145
  [_specificReferentielsKeys.SPECIFIC_REFERENTIEL_OPERATEURS_IMP_EXP]: [{
146
146
  field: "description",
147
147
  headerName: "Nom",
148
- flex: 3,
148
+ flex: 2,
149
149
  sortable: false,
150
150
  valueGetter: _ref12 => {
151
151
  var _row$description3;
@@ -193,7 +193,7 @@ const specificReferentielsBaseColumns = {
193
193
  }, {
194
194
  field: "ice",
195
195
  headerName: "ICE",
196
- flex: 1,
196
+ flex: 2,
197
197
  sortable: false,
198
198
  valueGetter: _ref16 => {
199
199
  var _row$ice;
@@ -129,10 +129,10 @@ const PuiSpecificReferentielField = _ref2 => {
129
129
  });
130
130
  const {
131
131
  data
132
- } = await axios.post("/api/".concat(_specificReferentielsApis.default[searchKey], "/getPage"), _objectSpread(_objectSpread({}, values), {}, {
132
+ } = await axios.post("/api/".concat(_specificReferentielsApis.default[searchKey], "/getPage"), _objectSpread(_objectSpread({}, specifications), {}, {
133
133
  pageNumber: dataFetchingState.pageNumber,
134
134
  pageSize: dataFetchingState.pageSize
135
- }, specifications));
135
+ }, values));
136
136
  if (data.succes) {
137
137
  dataFetchingDispatch({
138
138
  type: "SUCCESSED",
@@ -83,7 +83,9 @@ const StyledMuiTable = (0, _styles.styled)( /*#__PURE__*/React.forwardRef((props
83
83
  display: "flex",
84
84
  alignItems: "center",
85
85
  fontWeight: "600",
86
- color: _apperance.palette.primary
86
+ color: _apperance.palette.primary,
87
+ whiteSpace: "normal",
88
+ lineHeight: "1.2em"
87
89
  },
88
90
  "&:focus-within": {
89
91
  outline: "none"
@@ -99,6 +101,11 @@ const StyledMuiTable = (0, _styles.styled)( /*#__PURE__*/React.forwardRef((props
99
101
  "& .MuiDataGrid-cell": {
100
102
  paddingTop: "2px",
101
103
  paddingBottom: "2px",
104
+ whiteSpace: "normal",
105
+ textOverflow: "ellipsis",
106
+ overflow: "hidden",
107
+ maxHeight: "none",
108
+ wordBreak: "break-word",
102
109
  "&.tableAction": {
103
110
  justifyContent: "center",
104
111
  position: "relative",
@@ -108,6 +115,14 @@ const StyledMuiTable = (0, _styles.styled)( /*#__PURE__*/React.forwardRef((props
108
115
  outline: "none"
109
116
  }
110
117
  },
118
+ "& .MuiDataGrid-row": {
119
+ maxHeight: "none !important"
120
+ },
121
+ "& .MuiDataGrid-virtualScrollerContent": {
122
+ "& .MuiDataGrid-row": {
123
+ maxHeight: "none !important"
124
+ }
125
+ },
111
126
  "& .MuiDataGrid-virtualScroller": {
112
127
  backgroundColor: _apperance.palette.white
113
128
  },
@@ -240,6 +255,10 @@ const TableCheckbox = /*#__PURE__*/React.forwardRef((props, ref) => {
240
255
  }
241
256
  }));
242
257
  });
258
+ const autosizeOptions = {
259
+ includeHeaders: true,
260
+ includeOutliers: true
261
+ };
243
262
  const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
244
263
  let {
245
264
  id,
@@ -309,40 +328,50 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
309
328
  }));
310
329
  // eslint-disable-next-line react-hooks/exhaustive-deps
311
330
  }, [actions, columns]);
312
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledMuiTable, _objectSpread({
313
- ref: ref,
314
- id: id,
315
- components: {
316
- BaseCheckbox: TableCheckbox,
317
- LoadingOverlay: _material.LinearProgress,
318
- Pagination: TablePagination
331
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
332
+ style: {
333
+ width: '100%'
319
334
  },
320
- className: "".concat(className, " ").concat(stripped ? "table-stripped" : "", " ").concat(loading ? "table-loading" : "", " ").concat(elevate ? "elevate" : ""),
321
- sx: sx,
322
- autoHeight: true,
323
- headerHeight: 40,
324
- footerHeight: 40,
325
- rowHeight: 40,
326
- rows: rows,
327
- rowCount: rowCount,
328
- columns: appColumns,
329
- page: page,
330
- pageSize: pageSize,
331
- checkboxSelection: checkboxSelection,
332
- disableSelectionOnClick: true,
333
- disableColumnMenu: true,
334
- disableColumnFilter: true,
335
- disableColumnSelector: true,
336
- disableVirtualization: true,
337
- density: "compact",
338
- loading: loading,
339
- paginationMode: paginationMode,
340
- localeText: localeText,
341
- getRowHeight: () => 'auto',
342
- onPageChange: onPageChange,
343
- onPageSizeChange: onPageSizeChange,
344
- onSelectionModelChange: onSelect
345
- }, rest));
335
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledMuiTable, _objectSpread({
336
+ ref: ref,
337
+ id: id,
338
+ components: {
339
+ BaseCheckbox: TableCheckbox,
340
+ LoadingOverlay: _material.LinearProgress,
341
+ Pagination: TablePagination
342
+ },
343
+ className: "".concat(className, " ").concat(stripped ? "table-stripped" : "", " ").concat(loading ? "table-loading" : "", " ").concat(elevate ? "elevate" : ""),
344
+ sx: {
345
+ ["& .".concat(_xDataGrid.gridClasses.cell)]: {
346
+ py: 0.5
347
+ }
348
+ },
349
+ autoHeight: true,
350
+ headerHeight: 60,
351
+ footerHeight: 40,
352
+ rowHeight: 40,
353
+ rows: rows,
354
+ rowCount: rowCount,
355
+ columns: appColumns,
356
+ page: page,
357
+ pageSize: pageSize,
358
+ checkboxSelection: checkboxSelection,
359
+ disableSelectionOnClick: true,
360
+ disableColumnMenu: true,
361
+ disableColumnFilter: true,
362
+ disableColumnSelector: true,
363
+ disableVirtualization: true,
364
+ density: "compact",
365
+ loading: loading,
366
+ paginationMode: paginationMode,
367
+ localeText: localeText,
368
+ getRowHeight: () => 'auto',
369
+ onPageChange: onPageChange,
370
+ onPageSizeChange: onPageSizeChange,
371
+ onSelectionModelChange: onSelect,
372
+ autosizeOptions: autosizeOptions
373
+ }, rest))
374
+ });
346
375
  });
347
376
  PuiTable.propTypes = {
348
377
  id: _propTypes.default.string,
package/package.json CHANGED
@@ -1,97 +1,97 @@
1
- {
2
- "name": "@portnet/ui",
3
- "version": "0.0.115",
4
- "description": "Portnet UI",
5
- "keywords": [
6
- "react",
7
- "components",
8
- "ui"
9
- ],
10
- "main": "dist/index.js",
11
- "private": false,
12
- "files": [
13
- "dist",
14
- "README.md"
15
- ],
16
- "dependencies": {
17
- "@emotion/react": "^11.10.5",
18
- "@emotion/styled": "^11.10.5",
19
- "@mui/icons-material": "^5.10.16",
20
- "@mui/lab": "^5.0.0-alpha.60",
21
- "@mui/material": "^5.10.16",
22
- "@mui/x-data-grid": "^5.17.26",
23
- "@mui/x-date-pickers": "^5.0.4",
24
- "@testing-library/jest-dom": "^5.16.5",
25
- "@testing-library/react": "^13.4.0",
26
- "@testing-library/user-event": "^13.5.0",
27
- "axios": "^0.27.2",
28
- "formik": "^2.2.9",
29
- "lodash": "^4.17.21",
30
- "moment": "^2.29.4",
31
- "react": "^18.2.0",
32
- "react-dom": "^18.2.0",
33
- "react-scripts": "^5.0.1",
34
- "react-transition-group": "^4.4.5",
35
- "styled-components": "^6.1.3",
36
- "uuid": "^9.0.0",
37
- "web-vitals": "^2.1.4",
38
- "yup": "^0.32.11"
39
- },
40
- "scripts": {
41
- "start": "react-scripts start",
42
- "build": "rimraf dist && cross-env NODE_ENV=production babel src/lib --out-dir dist --copy-files",
43
- "test": "react-scripts test",
44
- "eject": "react-scripts eject",
45
- "storybook": "storybook dev -p 6006 -s public",
46
- "build-storybook": "storybook build -s public"
47
- },
48
- "eslintConfig": {
49
- "extends": [
50
- "react-app",
51
- "react-app/jest"
52
- ],
53
- "overrides": [
54
- {
55
- "files": [
56
- "**/*.stories.*"
57
- ],
58
- "rules": {
59
- "import/no-anonymous-default-export": "off"
60
- }
61
- }
62
- ]
63
- },
64
- "browserslist": {
65
- "production": [
66
- ">0.2%",
67
- "not dead",
68
- "not op_mini all"
69
- ],
70
- "development": [
71
- "last 1 chrome version",
72
- "last 1 firefox version",
73
- "last 1 safari version"
74
- ]
75
- },
76
- "devDependencies": {
77
- "@babel/cli": "^7.19.3",
78
- "@babel/core": "^7.20.5",
79
- "@babel/preset-env": "^7.20.2",
80
- "@babel/preset-react": "^7.18.6",
81
- "@storybook/addon-actions": "^7.6.4",
82
- "@storybook/addon-essentials": "^7.6.4",
83
- "@storybook/addon-interactions": "^7.6.4",
84
- "@storybook/addon-links": "^7.6.4",
85
- "@storybook/node-logger": "^7.6.4",
86
- "@storybook/preset-create-react-app": "^7.6.4",
87
- "@storybook/react": "^7.6.4",
88
- "@storybook/react-webpack5": "^7.6.4",
89
- "@storybook/testing-library": "^0.2.2",
90
- "cross-env": "^7.0.3",
91
- "husky": "^4.3.8",
92
- "prop-types": "^15.8.1",
93
- "rimraf": "^5.0.5",
94
- "storybook": "^7.6.4",
95
- "webpack": "^5.75.0"
96
- }
97
- }
1
+ {
2
+ "name": "@portnet/ui",
3
+ "version": "0.0.117",
4
+ "description": "Portnet UI",
5
+ "keywords": [
6
+ "react",
7
+ "components",
8
+ "ui"
9
+ ],
10
+ "main": "dist/index.js",
11
+ "private": false,
12
+ "files": [
13
+ "dist",
14
+ "README.md"
15
+ ],
16
+ "dependencies": {
17
+ "@emotion/react": "^11.10.5",
18
+ "@emotion/styled": "^11.10.5",
19
+ "@mui/icons-material": "^5.10.16",
20
+ "@mui/lab": "^5.0.0-alpha.60",
21
+ "@mui/material": "^5.10.16",
22
+ "@mui/x-data-grid": "^5.17.26",
23
+ "@mui/x-date-pickers": "^5.0.4",
24
+ "@testing-library/jest-dom": "^5.16.5",
25
+ "@testing-library/react": "^13.4.0",
26
+ "@testing-library/user-event": "^13.5.0",
27
+ "axios": "^0.27.2",
28
+ "formik": "^2.2.9",
29
+ "lodash": "^4.17.21",
30
+ "moment": "^2.29.4",
31
+ "react": "^18.2.0",
32
+ "react-dom": "^18.2.0",
33
+ "react-scripts": "^5.0.1",
34
+ "react-transition-group": "^4.4.5",
35
+ "styled-components": "^6.1.3",
36
+ "uuid": "^9.0.0",
37
+ "web-vitals": "^2.1.4",
38
+ "yup": "^0.32.11"
39
+ },
40
+ "scripts": {
41
+ "start": "react-scripts start",
42
+ "build": "rimraf dist && cross-env NODE_ENV=production babel src/lib --out-dir dist --copy-files",
43
+ "test": "react-scripts test",
44
+ "eject": "react-scripts eject",
45
+ "storybook": "storybook dev -p 6006 -s public",
46
+ "build-storybook": "storybook build -s public"
47
+ },
48
+ "eslintConfig": {
49
+ "extends": [
50
+ "react-app",
51
+ "react-app/jest"
52
+ ],
53
+ "overrides": [
54
+ {
55
+ "files": [
56
+ "**/*.stories.*"
57
+ ],
58
+ "rules": {
59
+ "import/no-anonymous-default-export": "off"
60
+ }
61
+ }
62
+ ]
63
+ },
64
+ "browserslist": {
65
+ "production": [
66
+ ">0.2%",
67
+ "not dead",
68
+ "not op_mini all"
69
+ ],
70
+ "development": [
71
+ "last 1 chrome version",
72
+ "last 1 firefox version",
73
+ "last 1 safari version"
74
+ ]
75
+ },
76
+ "devDependencies": {
77
+ "@babel/cli": "^7.19.3",
78
+ "@babel/core": "^7.20.5",
79
+ "@babel/preset-env": "^7.20.2",
80
+ "@babel/preset-react": "^7.18.6",
81
+ "@storybook/addon-actions": "^7.6.4",
82
+ "@storybook/addon-essentials": "^7.6.4",
83
+ "@storybook/addon-interactions": "^7.6.4",
84
+ "@storybook/addon-links": "^7.6.4",
85
+ "@storybook/node-logger": "^7.6.4",
86
+ "@storybook/preset-create-react-app": "^7.6.4",
87
+ "@storybook/react": "^7.6.4",
88
+ "@storybook/react-webpack5": "^7.6.4",
89
+ "@storybook/testing-library": "^0.2.2",
90
+ "cross-env": "^7.0.3",
91
+ "husky": "^4.3.8",
92
+ "prop-types": "^15.8.1",
93
+ "rimraf": "^5.0.5",
94
+ "storybook": "^7.6.4",
95
+ "webpack": "^5.75.0"
96
+ }
97
+ }