@portnet/ui 0.0.113 → 0.0.115

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,12 +77,8 @@ const PuiStandardDateField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
77
77
  } = _ref,
78
78
  rest = _objectWithoutProperties(_ref, _excluded);
79
79
  const handleChange = value => {
80
- if (value) {
81
- const formattedValue = format ? value.format(format) : value.toISOString();
82
- onChange(formattedValue);
83
- } else {
84
- onChange(null);
85
- }
80
+ const formattedValue = format ? value.format(format) : value.toISOString();
81
+ onChange(formattedValue);
86
82
  };
87
83
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DesktopDatePicker.DesktopDatePicker, _objectSpread({
88
84
  ref: ref,
@@ -113,8 +109,7 @@ const PuiStandardDateField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
113
109
  onBlur: onBlur,
114
110
  helperText: helperText
115
111
  }, params), {}, {
116
- error: required && meta.touched && Boolean(meta.error),
117
- helperText: meta.touched && meta.error ? meta.error : helperText,
112
+ error: params.error || error,
118
113
  inputProps: _objectSpread({
119
114
  name
120
115
  }, params.inputProps)
@@ -149,14 +144,8 @@ const PuiFormikDateField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
149
144
  const formikContext = (0, _formik.useFormikContext)();
150
145
  const [hasError, setHasError] = React.useState(false);
151
146
  const handleChange = value => {
152
- if (value && (0, _moment.default)(value, inputFormat, true).isValid()) {
153
- formikContext.setFieldValue(name, value);
154
- onChange(value);
155
- } else {
156
- // Set the field value to undefined when the input is invalid or empty
157
- formikContext.setFieldValue(name, undefined);
158
- onChange(undefined);
159
- }
147
+ formikContext.setFieldValue(name, value);
148
+ onChange(value);
160
149
  };
161
150
  const handleBlur = event => {
162
151
  onBlur(event);
@@ -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({}, specifications), {}, {
132
+ } = await axios.post("/api/".concat(_specificReferentielsApis.default[searchKey], "/getPage"), _objectSpread(_objectSpread({}, values), {}, {
133
133
  pageNumber: dataFetchingState.pageNumber,
134
134
  pageSize: dataFetchingState.pageSize
135
- }, values));
135
+ }, specifications));
136
136
  if (data.succes) {
137
137
  dataFetchingDispatch({
138
138
  type: "SUCCESSED",
@@ -83,9 +83,7 @@ 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,
87
- whiteSpace: "normal",
88
- lineHeight: "1.2em"
86
+ color: _apperance.palette.primary
89
87
  },
90
88
  "&:focus-within": {
91
89
  outline: "none"
@@ -242,10 +240,6 @@ const TableCheckbox = /*#__PURE__*/React.forwardRef((props, ref) => {
242
240
  }
243
241
  }));
244
242
  });
245
- const autosizeOptions = {
246
- includeHeaders: true,
247
- includeOutliers: true
248
- };
249
243
  const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
250
244
  let {
251
245
  id,
@@ -315,50 +309,40 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
315
309
  }));
316
310
  // eslint-disable-next-line react-hooks/exhaustive-deps
317
311
  }, [actions, columns]);
318
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
319
- style: {
320
- width: '100%'
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
321
319
  },
322
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledMuiTable, _objectSpread({
323
- ref: ref,
324
- id: id,
325
- components: {
326
- BaseCheckbox: TableCheckbox,
327
- LoadingOverlay: _material.LinearProgress,
328
- Pagination: TablePagination
329
- },
330
- className: "".concat(className, " ").concat(stripped ? "table-stripped" : "", " ").concat(loading ? "table-loading" : "", " ").concat(elevate ? "elevate" : ""),
331
- sx: {
332
- ["& .".concat(_xDataGrid.gridClasses.cell)]: {
333
- py: 0.5
334
- }
335
- },
336
- autoHeight: true,
337
- headerHeight: 60,
338
- footerHeight: 40,
339
- rowHeight: 40,
340
- rows: rows,
341
- rowCount: rowCount,
342
- columns: appColumns,
343
- page: page,
344
- pageSize: pageSize,
345
- checkboxSelection: checkboxSelection,
346
- disableSelectionOnClick: true,
347
- disableColumnMenu: true,
348
- disableColumnFilter: true,
349
- disableColumnSelector: true,
350
- disableVirtualization: true,
351
- density: "compact",
352
- loading: loading,
353
- paginationMode: paginationMode,
354
- localeText: localeText,
355
- getRowHeight: () => 'auto',
356
- onPageChange: onPageChange,
357
- onPageSizeChange: onPageSizeChange,
358
- onSelectionModelChange: onSelect,
359
- autosizeOptions: autosizeOptions
360
- }, rest))
361
- });
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));
362
346
  });
363
347
  PuiTable.propTypes = {
364
348
  id: _propTypes.default.string,
package/package.json CHANGED
@@ -1,97 +1,97 @@
1
- {
2
- "name": "@portnet/ui",
3
- "version": "0.0.113",
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.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
+ }