@mtes-mct/monitor-ui 9.1.0 → 9.2.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/package.json CHANGED
@@ -1,24 +1,24 @@
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": "9.1.0",
4
+ "version": "9.2.0",
5
5
  "license": "AGPL-3.0",
6
6
  "engines": {
7
7
  "node": ">=18"
8
8
  },
9
9
  "dependencies": {
10
- "@babel/runtime": "7.22.6",
11
- "@tanstack/react-table": "^8.9.3",
10
+ "@babel/runtime": "7.22.15",
11
+ "@tanstack/react-table": "8.9.7",
12
12
  "@tanstack/react-virtual": "beta",
13
13
  "prop-types": "15.8.1",
14
- "tslib": "2.5.3"
14
+ "tslib": "2.6.2"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@sentry/react": "^7.0.0",
18
- "cypress": "^10.0.0 || ^11.0.0 || ^12.0.0",
18
+ "cypress": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0",
19
19
  "formik": "^2.0.0",
20
20
  "react": "^18.0.0",
21
- "react-dom": "^18.0.0",
21
+ "react-router-dom": "^6.0.0",
22
22
  "rsuite": "^5.37.0",
23
23
  "styled-components": "^5.0.0"
24
24
  },
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from '../types';
2
+ export declare function ControlUnit({ color, size, ...nativeProps }: IconProps): import("react/jsx-runtime").JSX.Element;
@@ -10,6 +10,7 @@ import { Clock } from './Clock';
10
10
  import { Close } from './Close';
11
11
  import { Confirm } from './Confirm';
12
12
  import { Control } from './Control';
13
+ import { ControlUnit } from './ControlUnit';
13
14
  import { Delete } from './Delete';
14
15
  import { Display } from './Display';
15
16
  import { DoubleChevron } from './DoubleChevron';
@@ -73,4 +74,4 @@ import { Unlock } from './Unlock';
73
74
  import { Vessel } from './Vessel';
74
75
  import { ViewOnMap } from './ViewOnMap';
75
76
  import { Vms } from './Vms';
76
- export { ActivityFeed, Alert, Anchor, Archive, Attention, Calendar, Check, Chevron, Clock, Close, Confirm, Control, Delete, Display, DoubleChevron, Download, Drapeau, Duplicate, Edit, EditBis, Expand, Favorite, FilledArrow, Filter, FilterBis, Fishery, FishingEngine, FleetSegment, Focus, FocusVessel, FocusZones, Hide, Info, Infringement, Landmark, List, MapLayers, MeasureAngle, MeasureBrokenLine, MeasureCircle, MeasureLine, Minus, MissionAction, More, Note, Observation, Pin, PinFilled, Pinpoint, PinpointHide, Plane, Plus, Reject, Report, Reset, Save, Search, SelectCircle, SelectPolygon, SelectRectangle, SelectZone, Semaphore, ShowErsMessages, ShowXml, SortSelectedDown, SortSelectedUp, SortingArrows, SortingChevrons, Summary, Tag, Target, Unlock, Vessel, ViewOnMap, Vms };
77
+ export { ActivityFeed, Alert, Anchor, Archive, Attention, Calendar, Check, Chevron, Clock, Close, Confirm, Control, ControlUnit, Delete, Display, DoubleChevron, Download, Drapeau, Duplicate, Edit, EditBis, Expand, Favorite, FilledArrow, Filter, FilterBis, Fishery, FishingEngine, FleetSegment, Focus, FocusVessel, FocusZones, Hide, Info, Infringement, Landmark, List, MapLayers, MeasureAngle, MeasureBrokenLine, MeasureCircle, MeasureLine, Minus, MissionAction, More, Note, Observation, Pin, PinFilled, Pinpoint, PinpointHide, Plane, Plus, Reject, Report, Reset, Save, Search, SelectCircle, SelectPolygon, SelectRectangle, SelectZone, Semaphore, ShowErsMessages, ShowXml, SortSelectedDown, SortSelectedUp, SortingArrows, SortingChevrons, Summary, Tag, Target, Unlock, Vessel, ViewOnMap, Vms };
package/src/index.d.ts CHANGED
@@ -26,8 +26,6 @@ export { Label } from './elements/Label';
26
26
  export { Legend } from './elements/Legend';
27
27
  export { Tag } from './elements/Tag';
28
28
  export { TagGroup } from './elements/TagGroup';
29
- export { SimpleTable } from './elements/Table/SimpleTable';
30
- export { TableWithSelectableRows } from './elements/Table/TableWithSelectableRows';
31
29
  export { Search } from './fields/Search';
32
30
  export { Checkbox } from './fields/Checkbox';
33
31
  export { DatePicker } from './fields/DatePicker';
@@ -62,6 +60,9 @@ export { useKey } from './hooks/useKey';
62
60
  export { NewWindowContext, useNewWindow } from './hooks/useNewWindow';
63
61
  export { usePrevious } from './hooks/usePrevious';
64
62
  export { CustomSearch } from './libs/CustomSearch';
63
+ export { DataTable } from './tables/DataTable';
64
+ export { SimpleTable } from './tables/SimpleTable';
65
+ export { TableWithSelectableRows } from './tables/TableWithSelectableRows';
65
66
  export { cleanString } from './utils/cleanString';
66
67
  export { customDayjs } from './utils/customDayjs';
67
68
  export { getCoordinates, coordinatesAreDistinct } from './utils/coordinates';
@@ -97,7 +98,6 @@ export type { LabelProps } from './elements/Label';
97
98
  export type { LegendProps } from './elements/Legend';
98
99
  export type { TagProps } from './elements/Tag';
99
100
  export type { TagGroupProps } from './elements/TagGroup';
100
- export type { RowCheckboxProps } from './elements/Table/TableWithSelectableRows/RowCheckbox';
101
101
  export type { SearchProps } from './fields/Search';
102
102
  export type { CheckboxProps } from './fields/Checkbox';
103
103
  export type { DatePickerWithDateDateProps, DatePickerWithStringDateProps } from './fields/DatePicker';
@@ -126,3 +126,5 @@ export type { FormikTextareaProps } from './formiks/FormikTextarea';
126
126
  export type { FormikTextInputProps } from './formiks/FormikTextInput';
127
127
  export type { NewWindowContextValue } from './hooks/useNewWindow';
128
128
  export type { CustomSearchKey, CustomSearchOptions } from './libs/CustomSearch';
129
+ export type { DataTableProps } from './tables/DataTable';
130
+ export type { RowCheckboxProps } from './tables/TableWithSelectableRows/RowCheckbox';
@@ -20,10 +20,20 @@ export type CustomSearchOptions = Partial<{
20
20
  * instead of returning both by default (`false`).
21
21
  */
22
22
  isStrict: boolean;
23
+ /**
24
+ * By default, location is set to 0 and distance to 100
25
+ * When isStrict is false, for something to be considered a match, it would have to be within
26
+ * (threshold) 0.4 x (distance) 100 = 40 characters away from the expected location 0. (i.e. the first 40 characters)
27
+ * When true, search will ignore location and distance, so it won't matter where in the string the pattern appears.
28
+ *
29
+ * @default true
30
+ * @see https://www.fusejs.io/concepts/scoring-theory.html#scoring-theory
31
+ */
32
+ shouldIgnoreLocation: boolean;
23
33
  /**
24
34
  * At what point does the match algorithm give up.
25
35
  *
26
- * @default 0.6
36
+ * @default 0.4
27
37
  * @description
28
38
  * A threshold of `0.0` requires a perfect match (of both letters and location),
29
39
  * a threshold of `1.0` would match anything.
@@ -35,7 +45,7 @@ export type CustomSearchOptions = Partial<{
35
45
  export type CustomSearchKey<T> = string | Fuse.FuseOptionKeyObject<T>;
36
46
  export declare class CustomSearch<T extends Record<string, any> = Record<string, any>> {
37
47
  #private;
38
- constructor(collection: T[], keys: Array<CustomSearchKey<T>>, { cacheKey, isCaseSensitive, isDiacriticSensitive, isStrict, threshold }?: CustomSearchOptions);
48
+ constructor(collection: T[], keys: Array<CustomSearchKey<T>>, { cacheKey, isCaseSensitive, isDiacriticSensitive, isStrict, shouldIgnoreLocation, threshold }?: CustomSearchOptions);
39
49
  /**
40
50
  * Searches the entire collection, and returns a list of items matching this query.
41
51
  *
@@ -0,0 +1,4 @@
1
+ import { Chevron } from '../../icons';
2
+ export declare const SortingIcon: import("styled-components").StyledComponent<typeof Chevron, import("styled-components").DefaultTheme, {
3
+ $isDescending?: boolean;
4
+ }, never>;
@@ -0,0 +1,7 @@
1
+ import { type Cell } from '@tanstack/react-table';
2
+ import type { ReactNode } from 'react';
3
+ export type TdProps = {
4
+ cell: Cell<any, unknown>;
5
+ children?: ReactNode;
6
+ };
7
+ export declare function Td({ cell, children }: TdProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type Header } from '@tanstack/react-table';
2
+ import type { ReactNode } from 'react';
3
+ export type ThProps = {
4
+ children?: ReactNode;
5
+ header: Header<any, unknown>;
6
+ };
7
+ export declare function Th({ children, header }: ThProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type ColumnDef, type SortingState } from '@tanstack/react-table';
2
+ export type DataTableProps<T extends {
3
+ id: number;
4
+ }> = {
5
+ columns: Array<ColumnDef<T, any>>;
6
+ data: T[] | undefined;
7
+ initialSorting: SortingState;
8
+ };
9
+ export declare function DataTable<T extends {
10
+ id: number;
11
+ }>({ columns, data, initialSorting }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
File without changes