@mtes-mct/monitor-ui 18.0.0 → 18.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,37 @@
1
+ ## [18.0.1](https://github.com/MTES-MCT/monitor-ui/compare/v18.0.0...v18.0.1) (2024-05-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **tables:** disable user selection in SimpleTable.Th ([20d9b64](https://github.com/MTES-MCT/monitor-ui/commit/20d9b64fa72739b880d09740c6f9de6c2141b536))
7
+ * **tables:** force prop border in TableWithSelectableRows.Td ([9fbd1ee](https://github.com/MTES-MCT/monitor-ui/commit/9fbd1ee51236b6a7da47ff410cb2b00e95ddc66e))
8
+ * **tables:** force min & max width in SimpleTable.Th ([0ddfa57](https://github.com/MTES-MCT/monitor-ui/commit/0ddfa57afc4ec734d5242b82756d8506bc7f00fc))
9
+
10
+ ## [18.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v17.2.2...v18.0.0) (2024-05-27)
11
+
12
+
13
+ ### ⚠ BREAKING CHANGES
14
+
15
+ * **tables:** - Remove `isChecked` prop in `TableWithSelectableRows.RowCheckbox`, replaced by native `checked` prop.
16
+ - Remove `isIndeterminate` prop in `TableWithSelectableRows.RowCheckbox`, replaced by original Rsuite `indeterminate` prop.
17
+ - Remove `$isHighlighted` prop in `TableWithSelectableRows.Td`, replaced by the same prop on `TableWithSelectableRows.BodyTr`.
18
+ - In order to work properly with `RowCheckbox`, `TableWithSelectableRows` now requires `<Table $withRowCheckbox />`.
19
+ - Following the `SimpleTable` & `TableWithSelectableRows` margins/heights normalization, including a few hacks,
20
+ it may break some UI widths & heights.
21
+ - Please check `TableWithSelectableRows.stories.tsx` to see a full example on how to use/update it.
22
+ - As shown in the story, be careful **NOT** to wrap the checkbox table header cell
23
+ within `<TableWithSelectableRows.SortContainer />` since the flex display breaks its internal positioning.
24
+
25
+ ### Features
26
+
27
+ * **tables:** add $isLoading prop to SimpleTable.Td ([6cc137e](https://github.com/MTES-MCT/monitor-ui/commit/6cc137e187bd0314756bfc973f65bcde19f063ea))
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * **tables:** normalize tables checkbox, margins & height ([23afb70](https://github.com/MTES-MCT/monitor-ui/commit/23afb702e79e44788d82b6abeb0e2e6ba4deb4d3))
33
+ * **tables:** set SimpleTable.Td line-height & .CellLoader height to 22px ([176b161](https://github.com/MTES-MCT/monitor-ui/commit/176b161ac85c48913f25e5a483ce8ac30698e65c))
34
+
1
35
  ## [17.2.2](https://github.com/MTES-MCT/monitor-ui/compare/v17.2.1...v17.2.2) (2024-05-21)
2
36
 
3
37
 
package/index.js CHANGED
@@ -52929,7 +52929,11 @@ NewWindow.defaultProps = {
52929
52929
  try {
52930
52930
  rules = styleSheet.cssRules;
52931
52931
  } catch (err) {
52932
- console.error(err);
52932
+ // An error here most likely happens when trying to access stylesheets from other domains,
52933
+ // which is a CORS violation and should be ignored.
52934
+ // eslint-disable-next-line no-console
52935
+ console.debug(err);
52936
+ return;
52933
52937
  }
52934
52938
  if (rules) {
52935
52939
  // IE11 is very slow for appendChild, so use plain string here
@@ -76346,8 +76350,14 @@ const Th$2 = styled.th`
76346
76350
  padding: 9px 10px;
76347
76351
  overflow: hidden;
76348
76352
  text-overflow: ellipsis;
76349
- ${(p)=>!!p.$width && `width: ${p.$width}px;`}
76353
+ user-select: none;
76350
76354
  white-space: nowrap;
76355
+
76356
+ ${(p)=>!!p.$width && css`
76357
+ max-width: ${p.$width}px;
76358
+ min-width: ${p.$width}px;
76359
+ width: ${p.$width}px;
76360
+ `}
76351
76361
  `;
76352
76362
  const SortContainer$1 = styled.div`
76353
76363
  align-items: center;
@@ -76534,7 +76544,7 @@ const Table = styled(SimpleTable.Table)`
76534
76544
  border-spacing: 0 5px;
76535
76545
  table-layout: fixed;
76536
76546
 
76537
- ${(p)=>!!p.$withRowCheckbox && `
76547
+ ${(p)=>!!p.$withRowCheckbox && css`
76538
76548
  > thead > tr > th:first-child {
76539
76549
  padding: 0 0 0 8px;
76540
76550
 
@@ -76552,7 +76562,7 @@ const Table = styled(SimpleTable.Table)`
76552
76562
  > tbody > tr > td:first-child {
76553
76563
  padding: 0 0 0 8px;
76554
76564
  }
76555
- `}
76565
+ `}
76556
76566
  `;
76557
76567
  const Head = styled(SimpleTable.Head)`
76558
76568
  > tr {
@@ -76601,7 +76611,7 @@ const BodyTr = styled(SimpleTable.BodyTr)`
76601
76611
  `;
76602
76612
  const Td = styled(SimpleTable.Td)`
76603
76613
  background-color: ${(p)=>p.theme.color.cultured};
76604
- ${(p)=>!!p.$hasRightBorder && `border-right: 1px solid ${p.theme.color.lightGray};`}
76614
+ ${(p)=>!!p.$hasRightBorder && `border-right: 1px solid ${p.theme.color.lightGray} !important;`}
76605
76615
  padding: 9px 16px;
76606
76616
  `;
76607
76617
  const TableWithSelectableRows = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mtes-mct/monitor-ui",
3
3
  "description": "Common React components, hooks, utilities and CSS stylesheets for MonitorFish, MonitorEnv and RapportNav.",
4
- "version": "18.0.0",
4
+ "version": "18.0.2",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
7
7
  "engines": {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tables/SimpleTable/index.tsx"],"names":[],"mappings":";AAkEA,eAAO,MAAM,WAAW;;;;;;;;;;;iBAvCb,MAAM,GAAG,SAAS;;CA+C5B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tables/SimpleTable/index.tsx"],"names":[],"mappings":";AA0EA,eAAO,MAAM,WAAW;;;;;;;;;;;iBA/Cb,MAAM,GAAG,SAAS;;CAuD5B,CAAA"}