@mtes-mct/monitor-ui 24.3.0 → 24.3.1

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,32 @@
1
+ ## [24.3.0](https://github.com/MTES-MCT/monitor-ui/compare/v24.2.1...v24.3.0) (2024-10-24)
2
+
3
+
4
+ ### Features
5
+
6
+ * **tables:** add isTableHeadHidden prop to DataTable ([fb723b0](https://github.com/MTES-MCT/monitor-ui/commit/fb723b078bf132806806ef7305d79b5d8e0ad926))
7
+ * **tables:** add tableOptions prop to DataTable ([1a28bae](https://github.com/MTES-MCT/monitor-ui/commit/1a28bae13c859b074c404673bd1cfc62d16c5518))
8
+ * **tables:** allow any object as collection item in DataTable data ([06ab17c](https://github.com/MTES-MCT/monitor-ui/commit/06ab17cc724021c40cb31b8dfdb212ea14d1e4c7))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **tables:** remove wrong 0 max-width from SimpleTable.Td ([e75b525](https://github.com/MTES-MCT/monitor-ui/commit/e75b525501fb6b84603d3484b332a898dbbdd9ac))
14
+
15
+
16
+ ### Buid System & Dependencies
17
+
18
+ * **deps:** bump tslib in the non-major-dependencies group ([c686c05](https://github.com/MTES-MCT/monitor-ui/commit/c686c056e3db44295ee5effebb94c39b0c32ab60))
19
+ * **dev-deps:** bump eslint-plugin-cypress from 3.5.0 to 4.0.0 ([6411931](https://github.com/MTES-MCT/monitor-ui/commit/641193149549795a2be2cef4b7a4b773d6eedbad))
20
+ * **dev-deps:** bump glob from 10.4.3 to 11.0.0 ([9fbf7af](https://github.com/MTES-MCT/monitor-ui/commit/9fbf7af3b7c22ff296e6013f9cd48ef973685ba4))
21
+ * **dev-deps:** bump the all-non-major-dependencies group ([7030e2c](https://github.com/MTES-MCT/monitor-ui/commit/7030e2ceceadd5525c0557ca954dcae120819d32))
22
+ * **dev-deps:** bump the non-major-dev-dependencies group with 13 updates ([1e1f0d2](https://github.com/MTES-MCT/monitor-ui/commit/1e1f0d272674250a2f0cea4c209f1d0ec824d6a3))
23
+
24
+
25
+ ### Documentation
26
+
27
+ * **tables:** add comment to DataTable ([139ed72](https://github.com/MTES-MCT/monitor-ui/commit/139ed72e68600744ae3406d94a14172d54e178a6))
28
+ * **tables:** remove useless generated doc exports from DataTable story ([e8ff655](https://github.com/MTES-MCT/monitor-ui/commit/e8ff6550401d56e0ce34c81be4bd28182d350b13))
29
+
1
30
  ## [24.2.1](https://github.com/MTES-MCT/monitor-ui/compare/v24.2.0...v24.2.1) (2024-10-18)
2
31
 
3
32
 
package/index.js CHANGED
@@ -73966,7 +73966,7 @@ function Th$1({ children, header }) {
73966
73966
  }, header.id);
73967
73967
  }
73968
73968
 
73969
- function DataTable({ columns, data, initialSorting, isTableHeadHidden = false, tableOptions }) {
73969
+ function DataTable({ columns, data, initialSorting, tableOptions, withoutHead = false }) {
73970
73970
  const [sorting, setSorting] = useState(initialSorting);
73971
73971
  const table = useReactTable({
73972
73972
  columns,
@@ -73994,7 +73994,7 @@ function DataTable({ columns, data, initialSorting, isTableHeadHidden = false, t
73994
73994
  }),
73995
73995
  data.length > 0 && /*#__PURE__*/ jsxs(SimpleTable.Table, {
73996
73996
  children: [
73997
- !isTableHeadHidden && /*#__PURE__*/ jsx(SimpleTable.Head, {
73997
+ !withoutHead && /*#__PURE__*/ jsx(SimpleTable.Head, {
73998
73998
  children: table.getHeaderGroups().map((headerGroup)=>/*#__PURE__*/ jsx("tr", {
73999
73999
  children: headerGroup.headers.map((header)=>/*#__PURE__*/ jsx(Th$1, {
74000
74000
  header: header
@@ -74002,7 +74002,7 @@ function DataTable({ columns, data, initialSorting, isTableHeadHidden = false, t
74002
74002
  }, headerGroup.id))
74003
74003
  }),
74004
74004
  /*#__PURE__*/ jsx(TBody, {
74005
- $withTopBorder: isTableHeadHidden,
74005
+ $withTopBorder: withoutHead,
74006
74006
  children: rows.map((row)=>// `data-id` is expected by `cy.getTableRowById()` custom command
74007
74007
  /*#__PURE__*/ jsx(SimpleTable.BodyTr, {
74008
74008
  "data-id": 'id' in row.original ? row.original.id : row.id,
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": "24.3.0",
4
+ "version": "24.3.1",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
7
7
  "engines": {
@@ -4,8 +4,8 @@ export type DataTableProps<T extends AnyObject> = {
4
4
  columns: Array<ColumnDef<T>>;
5
5
  data: T[] | undefined;
6
6
  initialSorting: SortingState;
7
- isTableHeadHidden?: boolean | undefined;
8
- tableOptions?: TableOptions<T> | undefined;
7
+ tableOptions?: Partial<TableOptions<T>> | undefined;
8
+ withoutHead?: boolean | undefined;
9
9
  };
10
- export declare function DataTable<T extends AnyObject>({ columns, data, initialSorting, isTableHeadHidden, tableOptions }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
10
+ export declare function DataTable<T extends AnyObject>({ columns, data, initialSorting, tableOptions, withoutHead }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tables/DataTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,YAAY,EAIlB,MAAM,uBAAuB,CAAA;AAQ9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,SAAS,IAAI;IAChD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5B,IAAI,EAAE,CAAC,EAAE,GAAG,SAAS,CAAA;IACrB,cAAc,EAAE,YAAY,CAAA;IAC5B,iBAAiB,CAAC,EAAE,OAA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