@rws-aoa/react-library 3.5.3 → 3.6.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.
@@ -5,4 +5,9 @@ export declare const FontNormalSxProps: {
5
5
  fontStyle: "normal";
6
6
  fontWeight: string;
7
7
  };
8
+ export declare function isExtensionAllowed(regExp: RegExp, fileName: string): boolean;
9
+ /**
10
+ * An object that is non nullable, to bypass TypeScript not easily working with `Record<PropertyKey, unknown>` in various instances.
11
+ */
12
+ export type NonNullObject = {} & object;
8
13
  //# sourceMappingURL=_constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_constants.d.ts","sourceRoot":"","sources":["../src/_constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;;;;;;CAMX,CAAC"}
1
+ {"version":3,"file":"_constants.d.ts","sourceRoot":"","sources":["../src/_constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;;;;;;CAMX,CAAC;AAEpB,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAElE;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,EAAE,GAAG,MAAM,CAAC"}
@@ -1,11 +1,15 @@
1
- const t = {
1
+ const o = {
2
2
  fontFamily: "var(--font-text)",
3
3
  fontSize: "var(--font-size-text)",
4
4
  lineHeight: "var(--font-lineheight-text)",
5
5
  fontStyle: "normal",
6
6
  fontWeight: "normal"
7
7
  };
8
+ function e(t, n) {
9
+ return t.test(n);
10
+ }
8
11
  export {
9
- t as FontNormalSxProps
12
+ o as FontNormalSxProps,
13
+ e as isExtensionAllowed
10
14
  };
11
15
  //# sourceMappingURL=_constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_constants.js","sources":["../src/_constants.ts"],"sourcesContent":["import type { SxProps } from \"@mui/material\";\n\nexport const FontNormalSxProps = {\n fontFamily: \"var(--font-text)\",\n fontSize: \"var(--font-size-text)\",\n lineHeight: \"var(--font-lineheight-text)\",\n fontStyle: \"normal\",\n fontWeight: \"normal\"\n} satisfies SxProps;\n"],"names":["FontNormalSxProps"],"mappings":"AAEO,MAAMA,IAAoB;AAAA,EAC/B,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AACd;"}
1
+ {"version":3,"file":"_constants.js","sources":["../src/_constants.ts"],"sourcesContent":["import type { SxProps } from \"@mui/material\";\n\nexport const FontNormalSxProps = {\n fontFamily: \"var(--font-text)\",\n fontSize: \"var(--font-size-text)\",\n lineHeight: \"var(--font-lineheight-text)\",\n fontStyle: \"normal\",\n fontWeight: \"normal\"\n} satisfies SxProps;\n\nexport function isExtensionAllowed(regExp: RegExp, fileName: string) {\n return regExp.test(fileName);\n}\n\n/**\n * An object that is non nullable, to bypass TypeScript not easily working with `Record<PropertyKey, unknown>` in various instances.\n */\nexport type NonNullObject = {} & object;\n"],"names":["FontNormalSxProps","isExtensionAllowed","regExp","fileName"],"mappings":"AAEO,MAAMA,IAAoB;AAAA,EAC/B,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,YAAY;AACd;AAEgB,SAAAC,EAAmBC,GAAgBC,GAAkB;AAC5D,SAAAD,EAAO,KAAKC,CAAQ;AAC7B;"}
@@ -1,14 +1,14 @@
1
1
  import { SxProps } from '@mui/material';
2
- import { DataGridProps, GridColDef, GridFilterModel, GridLocaleText, GridSortModel, GridValidRowModel } from '@mui/x-data-grid';
3
- import { ReactNode } from 'react';
2
+ import { DataGridProps, GridColDef, GridFilterModel, GridLocaleText, GridSortModel } from '@mui/x-data-grid';
3
+ import { NonNullObject } from '../../../_constants';
4
4
 
5
- export interface AoaTableData<T extends GridValidRowModel = any> {
5
+ export interface AoaTableData<T extends NonNullObject = any> {
6
6
  /** The paged, filtered and sorted items from the database */
7
7
  items: T[];
8
8
  /** The total number of items present in the database table */
9
9
  totalItems: number;
10
10
  }
11
- export type AoaTableColumns = GridColDef[];
11
+ export type AoaTableColumns<T extends NonNullObject = any> = GridColDef<T>[];
12
12
  export interface AoaTableQueryOptions {
13
13
  /** The current page of the table */
14
14
  page: number;
@@ -30,11 +30,11 @@ type ModeProps =
30
30
  getData?: never;
31
31
  mode: "client";
32
32
  };
33
- export type AoaTableProps<T extends GridValidRowModel = any> = ModeProps & {
33
+ export type AoaTableProps<T extends NonNullObject = any> = ModeProps & {
34
34
  /** The TableData object to be displayed in the table */
35
35
  data: AoaTableData<T>;
36
36
  /** The column structure to display the data */
37
- columns: GridColDef[];
37
+ columns: GridColDef<T>[];
38
38
  /** Data-qa tag for E2E test purposes */
39
39
  "data-qa"?: string;
40
40
  /** Material UI's property to apply styling */
@@ -51,7 +51,7 @@ export type AoaTableProps<T extends GridValidRowModel = any> = ModeProps & {
51
51
  refreshTable: string;
52
52
  };
53
53
  /** Overwrite a safe selection of the {@link DataGrid} properties */
54
- dataGridOverridableProps?: Pick<DataGridProps, "ignoreDiacritics" | "loading" | "getRowId">;
54
+ dataGridOverridableProps?: Pick<DataGridProps<T>, "ignoreDiacritics" | "loading" | "getRowId">;
55
55
  };
56
56
  /**
57
57
  * Constructs a table using pre-defined Rijks styling
@@ -65,7 +65,7 @@ export type AoaTableProps<T extends GridValidRowModel = any> = ModeProps & {
65
65
  * />
66
66
  * ```
67
67
  */
68
- declare const NonMemoizeAoaTable: <T extends GridValidRowModel = any>(props: AoaTableProps<T>) => ReactNode;
68
+ declare function NonMemoizeAoaTable<T extends NonNullObject = any>(props: AoaTableProps<T>): import("react/jsx-runtime").JSX.Element;
69
69
  export declare const AoaTable: typeof NonMemoizeAoaTable;
70
70
  export {};
71
71
  //# sourceMappingURL=Table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CA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G,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,2CA0KjF;AAED,eAAO,MAAM,QAAQ,EAA+B,OAAO,kBAAkB,CAAC"}
@@ -5,16 +5,16 @@ import { m as F } from "../../../chunks/index.CtmQWjvP.js";
5
5
  import { memo as R, useState as i, useCallback as k, useEffect as v } from "react";
6
6
  import { FontNormalSxProps as I } from "../../../_constants.js";
7
7
  import { QuickSearchToolbar as T } from "./_QuickSearchToolbar.js";
8
- const j = (e) => {
8
+ function j(e) {
9
9
  var m, b, M;
10
10
  const [D, c] = i(!1), [l, h] = i({
11
11
  page: 0,
12
12
  pageSize: 10
13
13
  }), [n, S] = i([]), [d, C] = i({
14
14
  items: []
15
- }), r = e.mode ?? "server", s = r === "server", G = k((o) => {
15
+ }), r = e.mode ?? "server", s = r === "server", f = k((o) => {
16
16
  S(o);
17
- }, []), f = k((o) => {
17
+ }, []), G = k((o) => {
18
18
  C(o);
19
19
  }, []), [x, u] = i(((m = e.data) == null ? void 0 : m.totalItems) || 0), g = (o, t, a) => {
20
20
  if (s && e.getData) {
@@ -54,9 +54,9 @@ const j = (e) => {
54
54
  paginationMode: r,
55
55
  onPaginationModelChange: h,
56
56
  sortingMode: r,
57
- onSortModelChange: G,
57
+ onSortModelChange: f,
58
58
  filterMode: r,
59
- onFilterModelChange: f,
59
+ onFilterModelChange: G,
60
60
  slots: {
61
61
  toolbar: T
62
62
  },
@@ -148,7 +148,8 @@ const j = (e) => {
148
148
  ...e.dataGridOverridableProps
149
149
  }
150
150
  );
151
- }, $ = R(j);
151
+ }
152
+ const $ = R(j);
152
153
  export {
153
154
  $ as AoaTable
154
155
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../../src/components/atoms/table/Table.tsx"],"sourcesContent":["import { type SxProps } from \"@mui/material\";\nimport {\n DataGrid,\n type DataGridProps,\n type GridColDef,\n type GridFilterModel,\n type GridLocaleText,\n type GridSortModel,\n type GridValidRowModel\n} from \"@mui/x-data-grid\";\nimport merge from \"lodash.merge\";\nimport { memo, useCallback, useEffect, useState, type ReactNode } from \"react\";\nimport { FontNormalSxProps } from \"../../../_constants\";\nimport { QuickSearchToolbar } from \"./_QuickSearchToolbar\";\n\nexport interface AoaTableData<T extends GridValidRowModel = any> {\n /** The paged, filtered and sorted items from the database */\n items: T[];\n /** The total number of items present in the database table */\n totalItems: number;\n}\n\nexport type AoaTableColumns = GridColDef[];\n\nexport interface AoaTableQueryOptions {\n /** The current page of the table */\n page: number;\n /** The maximum number of items that are shown on a page */\n pageSize: number;\n /** Material UI's GridSortModel */\n sortModel: GridSortModel;\n /** Material UI's GridFilterModel */\n filterModel: GridFilterModel;\n}\n\ntype ModeProps =\n /** The Redux action that takes PaginationModel as parameter to retrieve data from the server */\n // eslint-disable-next-line no-unused-vars\n | { getData: (queryOptions: AoaTableQueryOptions) => Promise<void> | void; mode?: never }\n /** Overwrites the default mode (server) when you need pagination, filtering and sorting on the client side */\n | { getData?: never; mode: \"client\" };\n\nexport type AoaTableProps<T extends GridValidRowModel = any> = ModeProps & {\n /** The TableData object to be displayed in the table */\n data: AoaTableData<T>;\n /** The column structure to display the data */\n columns: GridColDef[];\n /** Data-qa tag for E2E test purposes */\n \"data-qa\"?: string;\n /** Material UI's property to apply styling */\n sx?: SxProps;\n /** Action buttons shown in the toolbar of the table */\n actionButtons?: JSX.Element[];\n /** Sets the initial sortModel in case the required sorting differs from the back-end's default sorting */\n initialSort?: { field: string; sort: \"asc\" | \"desc\" };\n /** Overwrites the default labels when you need a different language than Dutch */\n localeText?: GridLocaleText & { refreshTable: string };\n /** Overwrite a safe selection of the {@link DataGrid} properties */\n dataGridOverridableProps?: Pick<DataGridProps, \"ignoreDiacritics\" | \"loading\" | \"getRowId\">;\n};\n\ninterface PaginationModel {\n page: number;\n pageSize: number;\n}\n\n/**\n * Constructs a table using pre-defined Rijks styling\n * @param props Props to pass to the button\n * @example\n * ```jsx\n * <AoaTable\n * getData={(queryOptions) => getMockData(queryOptions)}\n * data={mockData}\n * columns={[{ field: \"id\" }, { field: \"title\" }, { field: \"completed\" }]}\n * />\n * ```\n */\n\nconst NonMemoizeAoaTable = <T extends GridValidRowModel = any>(props: AoaTableProps<T>): ReactNode => {\n const [isLoading, setIsLoading] = useState(false);\n const [paginationModel, setPaginationModel] = useState<PaginationModel>({\n page: 0,\n pageSize: 10\n });\n const [sortModel, setSortModel] = useState<GridSortModel>([]);\n const [filterModel, setFilterModel] = useState<GridFilterModel>({\n items: []\n });\n\n const mode = props.mode ?? \"server\";\n const isServerMode = mode === \"server\";\n\n const handleSortModelChange = useCallback((sortModel: GridSortModel) => {\n setSortModel(sortModel);\n }, []);\n\n const onFilterChange = useCallback((filterModel: GridFilterModel) => {\n setFilterModel(filterModel);\n }, []);\n\n const [rowCountState, setRowCountState] = useState(props.data?.totalItems || 0);\n\n const getData = (paginationModel: PaginationModel, sortModel: GridSortModel, filterModel: GridFilterModel) => {\n if (isServerMode && props.getData) {\n const fetchData = async () => {\n await props.getData({ ...paginationModel, sortModel, filterModel });\n };\n setIsLoading(true);\n fetchData();\n setIsLoading(false);\n }\n };\n\n useEffect(() => {\n setRowCountState((prevRowCountState) => (props.data?.totalItems !== undefined ? props.data?.totalItems : prevRowCountState));\n }, [props.data?.totalItems, setRowCountState]);\n\n useEffect(() => {\n getData(paginationModel, sortModel, filterModel);\n }, [paginationModel, sortModel, filterModel]);\n\n return (\n <DataGrid\n initialState={{\n sorting: {\n sortModel: props.initialSort ? [props.initialSort] : []\n }\n }}\n disableColumnMenu\n disableColumnFilter\n disableColumnSelector\n disableDensitySelector\n disableRowSelectionOnClick\n disableVirtualization\n columns={props.columns}\n rows={props.data?.items}\n rowCount={isServerMode ? rowCountState : undefined}\n getRowHeight={() => \"auto\"}\n pageSizeOptions={[5, 10, 20, 40, 80]}\n paginationModel={paginationModel}\n paginationMode={mode}\n onPaginationModelChange={setPaginationModel}\n sortingMode={mode}\n onSortModelChange={handleSortModelChange}\n filterMode={mode}\n onFilterModelChange={onFilterChange}\n slots={{\n toolbar: QuickSearchToolbar\n }}\n slotProps={{\n toolbar: {\n showQuickFilter: true,\n quickFilterProps: { debounceMs: 500 },\n mode,\n isServerMode,\n getData: () => getData(paginationModel, sortModel, filterModel),\n actionButtons: props.actionButtons,\n localeText: props.localeText\n }\n }}\n loading={isLoading}\n data-qa={props[\"data-qa\"]}\n sx={merge(\n {\n border: 0,\n color: \"var(--color-text)\",\n letterSpacing: \"normal\",\n minHeight: \"300px\",\n\n \"&.MuiDataGrid-root--densityCompact\": {\n \".MuiDataGrid-cell\": {\n py: \"8px\"\n }\n },\n \"&.MuiDataGrid-root--densityStandard\": {\n \".MuiDataGrid-cell\": {\n py: \"15px\"\n }\n },\n \"&.MuiDataGrid-root--densityComfortable\": {\n \".MuiDataGrid-cell\": {\n py: \"22px\"\n }\n },\n\n /**\n * The 'no results' message does not show if the DataGrid does not have a fixed height.\n * Because a fixed height is not desirable, we set a min-height on the DataGrid and set\n * the min-height of the virtualScroller to half of that height.\n */\n \".MuiDataGrid-virtualScroller\": {\n minHeight: \"150px\",\n overflow: \"hidden\",\n position: \"relative\"\n },\n\n \".MuiDataGrid-columnHeaders\": {\n \"--DataGrid-containerBackground\": \"var(--color-rijks-skyblue)\",\n backgroundCcolor: \"var(--color-rijks-skyblue)\",\n color: \"var(--color-text-light)\"\n },\n\n \".MuiDataGrid-row\": {\n \":hover\": {\n backgroundColor: \"var(--color-rijks-skyblue-light)\"\n },\n\n \":nth-of-type(even)\": {\n backgroundColor: \"var(--color-rijks-grey-1)\",\n\n \":hover\": {\n backgroundColor: \"var(--color-rijks-skyblue-light)\"\n }\n }\n },\n\n \".MuiDataGrid-columnHeader, .MuiDataGrid-cell, .MuiDataGrid-columnsContainer, .MuiDataGrid-cell\": {\n borderRight: \"1px solid var(--color-rijks-grey-2)\"\n },\n\n \".MuiDataGrid-cell\": {\n color: \"var(--color-text)\"\n },\n\n \".MuiPaginationItem-root\": {\n borderRadius: 0\n }\n },\n props.sx,\n FontNormalSxProps\n )}\n localeText={\n props.localeText ?? {\n columnHeaderSortIconLabel: \"Sorteren\",\n toolbarQuickFilterPlaceholder: \"Zoeken...\",\n toolbarQuickFilterLabel: \"Zoeken\",\n toolbarQuickFilterDeleteIconLabel: \"Wissen\",\n noRowsLabel: \"Geen regels beschikbaar\",\n noResultsOverlayLabel: \"Geen regels gevonden.\",\n MuiTablePagination: {\n labelDisplayedRows: ({ from, to, count }) => `${from} - ${to} van ${count}`,\n labelRowsPerPage: \"Regels per pagina\"\n }\n }\n }\n {...props.dataGridOverridableProps}\n />\n );\n};\n\nexport const AoaTable = memo(NonMemoizeAoaTable) as typeof NonMemoizeAoaTable;\n"],"names":["NonMemoizeAoaTable","props","isLoading","setIsLoading","useState","paginationModel","setPaginationModel","sortModel","setSortModel","filterModel","setFilterModel","mode","isServerMode","handleSortModelChange","useCallback","onFilterChange","rowCountState","setRowCountState","_a","getData","fetchData","useEffect","prevRowCountState","_b","jsx","DataGrid","_c","QuickSearchToolbar","merge","FontNormalSxProps","from","to","count","AoaTable","memo"],"mappings":";;;;;;;AA+EA,MAAMA,IAAqB,CAAoCC,MAAuC;;AACpG,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAiBC,CAAkB,IAAIF,EAA0B;AAAA,IACtE,MAAM;AAAA,IACN,UAAU;AAAA,EAAA,CACX,GACK,CAACG,GAAWC,CAAY,IAAIJ,EAAwB,CAAE,CAAA,GACtD,CAACK,GAAaC,CAAc,IAAIN,EAA0B;AAAA,IAC9D,OAAO,CAAC;AAAA,EAAA,CACT,GAEKO,IAAOV,EAAM,QAAQ,UACrBW,IAAeD,MAAS,UAExBE,IAAwBC,EAAY,CAACP,MAA6B;AACtE,IAAAC,EAAaD,CAAS;AAAA,EACxB,GAAG,CAAE,CAAA,GAECQ,IAAiBD,EAAY,CAACL,MAAiC;AACnE,IAAAC,EAAeD,CAAW;AAAA,EAC5B,GAAG,CAAE,CAAA,GAEC,CAACO,GAAeC,CA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A,qBAAqB;AAAA,YACnB,OAAO;AAAA,UACT;AAAA,UAEA,2BAA2B;AAAA,YACzB,cAAc;AAAA,UAChB;AAAA,QACF;AAAA,QACA3B,EAAM;AAAA,QACN4B;AAAA,MACF;AAAA,MACA,YACE5B,EAAM,cAAc;AAAA,QAClB,2BAA2B;AAAA,QAC3B,+BAA+B;AAAA,QAC/B,yBAAyB;AAAA,QACzB,mCAAmC;AAAA,QACnC,aAAa;AAAA,QACb,uBAAuB;AAAA,QACvB,oBAAoB;AAAA,UAClB,oBAAoB,CAAC,EAAE,MAAA6B,GAAM,IAAAC,GAAI,OAAAC,EAAY,MAAA,GAAGF,CAAI,MAAMC,CAAE,QAAQC,CAAK;AAAA,UACzE,kBAAkB;AAAA,QACpB;AAAA,MACF;AAAA,MAED,GAAG/B,EAAM;AAAA,IAAA;AAAA,EAAA;AAGhB,GAEagC,IAAWC,EAAKlC,CAAkB;"}
1
+ {"version":3,"file":"Table.js","sources":["../../../../src/components/atoms/table/Table.tsx"],"sourcesContent":["import { type SxProps } from \"@mui/material\";\nimport { DataGrid, type DataGridProps, type GridColDef, type GridFilterModel, type GridLocaleText, type GridSortModel } from \"@mui/x-data-grid\";\nimport merge from \"lodash.merge\";\nimport { memo, useCallback, useEffect, useState } from \"react\";\nimport { FontNormalSxProps, type NonNullObject } from \"../../../_constants\";\nimport { QuickSearchToolbar } from \"./_QuickSearchToolbar\";\n\nexport interface AoaTableData<T extends NonNullObject = any> {\n /** The paged, filtered and sorted items from the database */\n items: T[];\n /** The total number of items present in the database table */\n totalItems: number;\n}\n\nexport type AoaTableColumns<T extends NonNullObject = any> = GridColDef<T>[];\n\nexport interface AoaTableQueryOptions {\n /** The current page of the table */\n page: number;\n /** The maximum number of items that are shown on a page */\n pageSize: number;\n /** Material UI's GridSortModel */\n sortModel: GridSortModel;\n /** Material UI's GridFilterModel */\n filterModel: GridFilterModel;\n}\n\ntype ModeProps =\n /** The Redux action that takes PaginationModel as parameter to retrieve data from the server */\n // eslint-disable-next-line no-unused-vars\n | { getData: (queryOptions: AoaTableQueryOptions) => Promise<void> | void; mode?: never }\n /** Overwrites the default mode (server) when you need pagination, filtering and sorting on the client side */\n | { getData?: never; mode: \"client\" };\n\nexport type AoaTableProps<T extends NonNullObject = any> = ModeProps & {\n /** The TableData object to be displayed in the table */\n data: AoaTableData<T>;\n /** The column structure to display the data */\n columns: GridColDef<T>[];\n /** Data-qa tag for E2E test purposes */\n \"data-qa\"?: string;\n /** Material UI's property to apply styling */\n sx?: SxProps;\n /** Action buttons shown in the toolbar of the table */\n actionButtons?: JSX.Element[];\n /** Sets the initial sortModel in case the required sorting differs from the back-end's default sorting */\n initialSort?: { field: string; sort: \"asc\" | \"desc\" };\n /** Overwrites the default labels when you need a different language than Dutch */\n localeText?: GridLocaleText & { refreshTable: string };\n /** Overwrite a safe selection of the {@link DataGrid} properties */\n dataGridOverridableProps?: Pick<DataGridProps<T>, \"ignoreDiacritics\" | \"loading\" | \"getRowId\">;\n};\n\ninterface PaginationModel {\n page: number;\n pageSize: number;\n}\n\n/**\n * Constructs a table using pre-defined Rijks styling\n * @param props Props to pass to the button\n * @example\n * ```jsx\n * <AoaTable\n * getData={(queryOptions) => getMockData(queryOptions)}\n * data={mockData}\n * columns={[{ field: \"id\" }, { field: \"title\" }, { field: \"completed\" }]}\n * />\n * ```\n */\n\nfunction NonMemoizeAoaTable<T extends NonNullObject = any>(props: AoaTableProps<T>) {\n const [isLoading, setIsLoading] = useState(false);\n const [paginationModel, setPaginationModel] = useState<PaginationModel>({\n page: 0,\n pageSize: 10\n });\n const [sortModel, setSortModel] = useState<GridSortModel>([]);\n const [filterModel, setFilterModel] = useState<GridFilterModel>({\n items: []\n });\n\n const mode = props.mode ?? \"server\";\n const isServerMode = mode === \"server\";\n\n const handleSortModelChange = useCallback((sortModel: GridSortModel) => {\n setSortModel(sortModel);\n }, []);\n\n const onFilterChange = useCallback((filterModel: GridFilterModel) => {\n setFilterModel(filterModel);\n }, []);\n\n const [rowCountState, setRowCountState] = useState(props.data?.totalItems || 0);\n\n const getData = (paginationModel: PaginationModel, sortModel: GridSortModel, filterModel: GridFilterModel) => {\n if (isServerMode && props.getData) {\n const fetchData = async () => {\n await props.getData({ ...paginationModel, sortModel, filterModel });\n };\n setIsLoading(true);\n fetchData();\n setIsLoading(false);\n }\n };\n\n useEffect(() => {\n setRowCountState((prevRowCountState) => (props.data?.totalItems !== undefined ? props.data?.totalItems : prevRowCountState));\n }, [props.data?.totalItems, setRowCountState]);\n\n useEffect(() => {\n getData(paginationModel, sortModel, filterModel);\n }, [paginationModel, sortModel, filterModel]);\n\n return (\n <DataGrid\n initialState={{\n sorting: {\n sortModel: props.initialSort ? [props.initialSort] : []\n }\n }}\n disableColumnMenu\n disableColumnFilter\n disableColumnSelector\n disableDensitySelector\n disableRowSelectionOnClick\n disableVirtualization\n columns={props.columns}\n rows={props.data?.items}\n rowCount={isServerMode ? rowCountState : undefined}\n getRowHeight={() => \"auto\"}\n pageSizeOptions={[5, 10, 20, 40, 80]}\n paginationModel={paginationModel}\n paginationMode={mode}\n onPaginationModelChange={setPaginationModel}\n sortingMode={mode}\n onSortModelChange={handleSortModelChange}\n filterMode={mode}\n onFilterModelChange={onFilterChange}\n slots={{\n toolbar: QuickSearchToolbar\n }}\n slotProps={{\n toolbar: {\n showQuickFilter: true,\n quickFilterProps: { debounceMs: 500 },\n mode,\n isServerMode,\n getData: () => getData(paginationModel, sortModel, filterModel),\n actionButtons: props.actionButtons,\n localeText: props.localeText\n }\n }}\n loading={isLoading}\n data-qa={props[\"data-qa\"]}\n sx={merge(\n {\n border: 0,\n color: \"var(--color-text)\",\n letterSpacing: \"normal\",\n minHeight: \"300px\",\n\n \"&.MuiDataGrid-root--densityCompact\": {\n \".MuiDataGrid-cell\": {\n py: \"8px\"\n }\n },\n \"&.MuiDataGrid-root--densityStandard\": {\n \".MuiDataGrid-cell\": {\n py: \"15px\"\n }\n },\n \"&.MuiDataGrid-root--densityComfortable\": {\n \".MuiDataGrid-cell\": {\n py: \"22px\"\n }\n },\n\n /**\n * The 'no results' message does not show if the DataGrid does not have a fixed height.\n * Because a fixed height is not desirable, we set a min-height on the DataGrid and set\n * the min-height of the virtualScroller to half of that height.\n */\n \".MuiDataGrid-virtualScroller\": {\n minHeight: \"150px\",\n overflow: \"hidden\",\n position: \"relative\"\n },\n\n \".MuiDataGrid-columnHeaders\": {\n \"--DataGrid-containerBackground\": \"var(--color-rijks-skyblue)\",\n backgroundCcolor: \"var(--color-rijks-skyblue)\",\n color: \"var(--color-text-light)\"\n },\n\n \".MuiDataGrid-row\": {\n \":hover\": {\n backgroundColor: \"var(--color-rijks-skyblue-light)\"\n },\n\n \":nth-of-type(even)\": {\n backgroundColor: \"var(--color-rijks-grey-1)\",\n\n \":hover\": {\n backgroundColor: \"var(--color-rijks-skyblue-light)\"\n }\n }\n },\n\n \".MuiDataGrid-columnHeader, .MuiDataGrid-cell, .MuiDataGrid-columnsContainer, .MuiDataGrid-cell\": {\n borderRight: \"1px solid var(--color-rijks-grey-2)\"\n },\n\n \".MuiDataGrid-cell\": {\n color: \"var(--color-text)\"\n },\n\n \".MuiPaginationItem-root\": {\n borderRadius: 0\n }\n },\n props.sx,\n FontNormalSxProps\n )}\n localeText={\n props.localeText ?? {\n columnHeaderSortIconLabel: \"Sorteren\",\n toolbarQuickFilterPlaceholder: \"Zoeken...\",\n toolbarQuickFilterLabel: \"Zoeken\",\n toolbarQuickFilterDeleteIconLabel: \"Wissen\",\n noRowsLabel: \"Geen regels beschikbaar\",\n noResultsOverlayLabel: \"Geen regels gevonden.\",\n MuiTablePagination: {\n labelDisplayedRows: ({ from, to, count }) => `${from} - ${to} van ${count}`,\n labelRowsPerPage: \"Regels per pagina\"\n }\n }\n }\n {...props.dataGridOverridableProps}\n />\n );\n}\n\nexport const AoaTable = memo(NonMemoizeAoaTable) as typeof NonMemoizeAoaTable;\n"],"names":["NonMemoizeAoaTable","props","isLoading","setIsLoading","useState","paginationModel","setPaginationModel","sortModel","setSortModel","filterModel","setFilterModel","mode","isServerMode","handleSortModelChange","useCallback","onFilterChange","rowCountState","setRowCountState","_a","getData","fetchData","useEffect","prevRowCountState","_b","jsx","DataGrid","_c","QuickSearchToolbar","merge","FontNormalSxProps","from","to","count","AoaTable","memo"],"mappings":";;;;;;;AAuEA,SAASA,EAAkDC,GAAyB;;AAClF,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAiBC,CAAkB,IAAIF,EAA0B;AAAA,IACtE,MAAM;AAAA,IACN,UAAU;AAAA,EAAA,CACX,GACK,CAACG,GAAWC,CAAY,IAAIJ,EAAwB,CAAE,CAAA,GACtD,CAACK,GAAaC,CAAc,IAAIN,EAA0B;AAAA,IAC9D,OAAO,CAAC;AAAA,EAAA,CACT,GAEKO,IAAOV,EAAM,QAAQ,UACrBW,IAAeD,MAAS,UAExBE,IAAwBC,EAAY,CAACP,MAA6B;AACtE,IAAAC,EAAaD,CAAS;AAAA,EACxB,GAAG,CAAE,CAAA,GAECQ,IAAiBD,EAAY,CAACL,MAAiC;AACnE,IAAAC,EAAeD,CAAW;AAAA,EAC5B,GAAG,CAAE,CAAA,GAEC,CAACO,GAAeC,CAAgB,IAAIb,IAASc,IAAAjB,EAAM,SAAN,gBAAAiB,EAAY,eAAc,CAAC,GAExEC,IAAU,CAACd,GAAkCE,GAA0BE,MAAiC;AACxG,QAAAG,KAAgBX,EAAM,SAAS;AACjC,YAAMmB,IAAY,YAAY;AACtB,cAAAnB,EAAM,QAAQ,EAAE,GAAGI,GAAiB,WAAAE,GAAW,aAAAE,EAAAA,CAAa;AAAA,MAAA;AAEpE,MAAAN,EAAa,EAAI,GACPiB,KACVjB,EAAa,EAAK;AAAA,IACpB;AAAA,EAAA;AAGF,SAAAkB,EAAU,MAAM;AACG,IAAAJ,EAAA,CAACK;;AAAuB,eAAAJ,IAAAjB,EAAM,SAAN,gBAAAiB,EAAY,gBAAe,UAAYK,IAAAtB,EAAM,SAAN,gBAAAsB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,GAAG/B,EAAM;AAAA,IAAA;AAAA,EAAA;AAGhB;AAEa,MAAAgC,IAAWC,EAAKlC,CAAkB;"}
@@ -0,0 +1,48 @@
1
+ import { NonNullObject } from '@sapphire/utilities';
2
+ import { PropsWithChildren, ReactNode } from 'react';
3
+ import { Accept } from 'react-dropzone';
4
+
5
+ export type AoaDropableFile<TProps extends NonNullObject> = TProps & {
6
+ /** The file that was dropped */
7
+ file: File;
8
+ };
9
+ export interface AoaFileDropzoneDataQas {
10
+ /** The data-qa tag for the root element */
11
+ root: string;
12
+ /** The data-qa tag for the input */
13
+ input: string;
14
+ }
15
+ export interface AoaFileDropzoneProps<TProps extends NonNullObject, TFile extends AoaDropableFile<TProps>> {
16
+ /** The current set of files that are already dropped, coming from Redux or Zustand */
17
+ currentFiles: TFile[];
18
+ /**
19
+ * The function to overwrite the files in the client store.
20
+ * This should overwrite all files, not merge with current, which is handled in this component
21
+ * @param files - The new set of files to be stored
22
+ */
23
+ storeFiles(files: TFile[]): void;
24
+ /** The regular expression that validates if the dropped file should be accepted or rejected */
25
+ extensionRegex: RegExp;
26
+ /** The extension map to be passed to the dropzone component */
27
+ extensions: Accept;
28
+ /** The toast warning message to be shown when a file is rejection */
29
+ extensionWarning: string;
30
+ /** The children to show inside the box where files can be dropped */
31
+ fileDropChildren?: ReactNode;
32
+ /**
33
+ * A custom function that can perform extra checks when validating files.
34
+ * This should return `true` if the file should be rejected or `false` if it should be accepted
35
+ * @param file - The file to be validated
36
+ */
37
+ customFileValidator?(file: File): boolean;
38
+ /** A maximum count of files that should be accepted, if exceeded no save action will be performed */
39
+ maxUploadFiles?: number;
40
+ /** Additional properties to set for every file that is to be saved */
41
+ perFileProperties?(acceptedFile: File): TProps;
42
+ /** Whether the dropzone should be disabled or not */
43
+ isDisabled?: boolean;
44
+ /** data-qa tags for testing */
45
+ dataQas?: AoaFileDropzoneDataQas;
46
+ }
47
+ export declare function AoaFileDropzone<TProps extends NonNullObject, TFile extends AoaDropableFile<TProps>>(props: Readonly<PropsWithChildren<AoaFileDropzoneProps<TProps, TFile>>>): import("react/jsx-runtime").JSX.Element;
48
+ //# sourceMappingURL=FileDropzone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileDropzone.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/file-dropzone/FileDropzone.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAe,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAe,KAAK,MAAM,EAAsC,MAAM,gBAAgB,CAAC;AAI9F,MAAM,MAAM,eAAe,CAAC,MAAM,SAAS,aAAa,IAAI,MAAM,GAAG;IACnE,gCAAgC;IAChC,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB,CAAC,MAAM,SAAS,aAAa,EAAE,KAAK,SAAS,eAAe,CAAC,MAAM,CAAC;IACvG,sFAAsF;IACtF,YAAY,EAAE,KAAK,EAAE,CAAC;IACtB;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACjC,+FAA+F;IAC/F,cAAc,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,gBAAgB,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;IAC1C,qGAAqG;IACrG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,iBAAiB,CAAC,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAC/C,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED,wBAAgB,eAAe,CAAC,MAAM,SAAS,aAAa,EAAE,KAAK,SAAS,eAAe,CAAC,MAAM,CAAC,EACjG,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,2CA6ExE"}
@@ -0,0 +1,75 @@
1
+ import { jsxs as b, jsx as m } from "react/jsx-runtime";
2
+ import { Box as s } from "@mui/material";
3
+ import { useCallback as h } from "react";
4
+ import { useDropzone as D } from "react-dropzone";
5
+ import { toast as k } from "react-toastify";
6
+ import { isExtensionAllowed as C } from "../../../_constants.js";
7
+ function A(e) {
8
+ var a, l;
9
+ const f = h(
10
+ (n, t) => {
11
+ var r, d;
12
+ t.length > 0 && k(e.extensionWarning, { type: "warning" });
13
+ const o = [...e.currentFiles];
14
+ for (const i of n) {
15
+ const c = o.findIndex((F) => F.file.name === i.name);
16
+ c !== -1 ? o.splice(c, 1, {
17
+ file: i,
18
+ ...((r = e.perFileProperties) == null ? void 0 : r.call(e, i)) ?? {}
19
+ }) : o.push({ file: i, ...((d = e.perFileProperties) == null ? void 0 : d.call(e, i)) ?? {} });
20
+ }
21
+ e.storeFiles(o);
22
+ },
23
+ [e.extensionWarning, e.currentFiles, e.perFileProperties, e.storeFiles]
24
+ );
25
+ function u(n) {
26
+ var t;
27
+ return (t = e.customFileValidator) != null && t.call(e, n) ? {
28
+ code: "custom-validator",
29
+ message: e.extensionWarning
30
+ } : C(e.extensionRegex, n.name) ? null : {
31
+ code: "name-not-ok",
32
+ message: e.extensionWarning
33
+ };
34
+ }
35
+ const { getRootProps: x, getInputProps: g } = D({
36
+ onDrop: f,
37
+ disabled: e.isDisabled,
38
+ accept: e.extensions,
39
+ maxFiles: e.maxUploadFiles,
40
+ validator: u
41
+ });
42
+ return /* @__PURE__ */ b(
43
+ s,
44
+ {
45
+ ...x(),
46
+ sx: {
47
+ "&:focus": {
48
+ outline: "none"
49
+ }
50
+ },
51
+ "data-qa": ((a = e.dataQas) == null ? void 0 : a.root) ?? "file-dropzone-root",
52
+ children: [
53
+ /* @__PURE__ */ m("input", { ...g(), "data-qa": ((l = e.dataQas) == null ? void 0 : l.input) ?? "file-drop-input" }),
54
+ /* @__PURE__ */ m(
55
+ s,
56
+ {
57
+ sx: {
58
+ backgroundColor: "var(--color-rijks-grey-2)",
59
+ borderWidth: 1,
60
+ borderStyle: "dashed",
61
+ borderColor: "black",
62
+ marginBottom: 0.5,
63
+ textAlign: "center"
64
+ },
65
+ children: e.fileDropChildren
66
+ }
67
+ )
68
+ ]
69
+ }
70
+ );
71
+ }
72
+ export {
73
+ A as AoaFileDropzone
74
+ };
75
+ //# sourceMappingURL=FileDropzone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileDropzone.js","sources":["../../../../src/components/molecules/file-dropzone/FileDropzone.tsx"],"sourcesContent":["/* eslint-disable no-unused-vars */\nimport { Box } from \"@mui/material\";\nimport type { NonNullObject } from \"@sapphire/utilities\";\nimport { useCallback, type PropsWithChildren, type ReactNode } from \"react\";\nimport { useDropzone, type Accept, type FileError, type FileRejection } from \"react-dropzone\";\nimport { toast } from \"react-toastify\";\nimport { isExtensionAllowed } from \"../../../_constants\";\n\nexport type AoaDropableFile<TProps extends NonNullObject> = TProps & {\n /** The file that was dropped */\n file: File;\n};\n\nexport interface AoaFileDropzoneDataQas {\n /** The data-qa tag for the root element */\n root: string;\n /** The data-qa tag for the input */\n input: string;\n}\n\nexport interface AoaFileDropzoneProps<TProps extends NonNullObject, TFile extends AoaDropableFile<TProps>> {\n /** The current set of files that are already dropped, coming from Redux or Zustand */\n currentFiles: TFile[];\n /**\n * The function to overwrite the files in the client store.\n * This should overwrite all files, not merge with current, which is handled in this component\n * @param files - The new set of files to be stored\n */\n storeFiles(files: TFile[]): void;\n /** The regular expression that validates if the dropped file should be accepted or rejected */\n extensionRegex: RegExp;\n /** The extension map to be passed to the dropzone component */\n extensions: Accept;\n /** The toast warning message to be shown when a file is rejection */\n extensionWarning: string;\n /** The children to show inside the box where files can be dropped */\n fileDropChildren?: ReactNode;\n /**\n * A custom function that can perform extra checks when validating files.\n * This should return `true` if the file should be rejected or `false` if it should be accepted\n * @param file - The file to be validated\n */\n customFileValidator?(file: File): boolean;\n /** A maximum count of files that should be accepted, if exceeded no save action will be performed */\n maxUploadFiles?: number;\n /** Additional properties to set for every file that is to be saved */\n perFileProperties?(acceptedFile: File): TProps;\n /** Whether the dropzone should be disabled or not */\n isDisabled?: boolean;\n /** data-qa tags for testing */\n dataQas?: AoaFileDropzoneDataQas;\n}\n\nexport function AoaFileDropzone<TProps extends NonNullObject, TFile extends AoaDropableFile<TProps>>(\n props: Readonly<PropsWithChildren<AoaFileDropzoneProps<TProps, TFile>>>\n) {\n const handleDrop = useCallback(\n (acceptedFiles: File[], fileRejections: FileRejection[]) => {\n if (fileRejections.length > 0) {\n toast(props.extensionWarning, { type: \"warning\" });\n }\n\n const filesClone = [...props.currentFiles];\n for (const acceptedFile of acceptedFiles) {\n const existingFileIndex = filesClone.findIndex((file) => file.file.name === acceptedFile.name);\n if (existingFileIndex !== -1) {\n filesClone.splice(existingFileIndex, 1, {\n file: acceptedFile,\n ...(props.perFileProperties?.(acceptedFile) ?? {})\n } as TFile & TProps);\n } else {\n filesClone.push({ file: acceptedFile, ...(props.perFileProperties?.(acceptedFile) ?? {}) } as TFile & TProps);\n }\n }\n\n props.storeFiles(filesClone);\n },\n [props.extensionWarning, props.currentFiles, props.perFileProperties, props.storeFiles]\n );\n\n function fileValidator(file: File): FileError | null {\n if (props.customFileValidator?.(file)) {\n return {\n code: \"custom-validator\",\n message: props.extensionWarning\n };\n }\n\n if (isExtensionAllowed(props.extensionRegex, file.name)) {\n return null;\n }\n\n return {\n code: \"name-not-ok\",\n message: props.extensionWarning\n };\n }\n\n const { getRootProps, getInputProps } = useDropzone({\n onDrop: handleDrop,\n disabled: props.isDisabled,\n accept: props.extensions,\n maxFiles: props.maxUploadFiles,\n validator: fileValidator\n });\n\n return (\n <Box\n {...getRootProps()}\n sx={{\n \"&:focus\": {\n outline: \"none\"\n }\n }}\n data-qa={props.dataQas?.root ?? \"file-dropzone-root\"}\n >\n <input {...getInputProps()} data-qa={props.dataQas?.input ?? \"file-drop-input\"} />\n <Box\n sx={{\n backgroundColor: \"var(--color-rijks-grey-2)\",\n borderWidth: 1,\n borderStyle: \"dashed\",\n borderColor: \"black\",\n marginBottom: 0.5,\n textAlign: \"center\"\n }}\n >\n {props.fileDropChildren}\n </Box>\n </Box>\n );\n}\n"],"names":["AoaFileDropzone","props","handleDrop","useCallback","acceptedFiles","fileRejections","toast","filesClone","acceptedFile","existingFileIndex","file","_a","_b","fileValidator","isExtensionAllowed","getRootProps","getInputProps","useDropzone","jsxs","Box","jsx"],"mappings":";;;;;;AAqDO,SAASA,EACdC,GACA;;AACA,QAAMC,IAAaC;AAAA,IACjB,CAACC,GAAuBC,MAAoC;;AACtD,MAAAA,EAAe,SAAS,KAC1BC,EAAML,EAAM,kBAAkB,EAAE,MAAM,UAAW,CAAA;AAGnD,YAAMM,IAAa,CAAC,GAAGN,EAAM,YAAY;AACzC,iBAAWO,KAAgBJ,GAAe;AAClC,cAAAK,IAAoBF,EAAW,UAAU,CAACG,MAASA,EAAK,KAAK,SAASF,EAAa,IAAI;AAC7F,QAAIC,MAAsB,KACbF,EAAA,OAAOE,GAAmB,GAAG;AAAA,UACtC,MAAMD;AAAA,UACN,KAAIG,IAAAV,EAAM,sBAAN,gBAAAU,EAAA,KAAAV,GAA0BO,OAAiB,CAAC;AAAA,QAAA,CAC/B,IAERD,EAAA,KAAK,EAAE,MAAMC,GAAc,KAAII,IAAAX,EAAM,sBAAN,gBAAAW,EAAA,KAAAX,GAA0BO,OAAiB,CAAC,EAAA,CAAsB;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1
+ import { DataGridProps, GridColDef, GridValidRowModel } from '@mui/x-data-grid';
2
+ import { NonNullObject } from '../../../_constants';
3
+
4
+ export interface AoaFileTableProps<T extends GridValidRowModel = any> {
5
+ /** The TableData object to be displayed in the table */
6
+ data: T[];
7
+ /** The column structure to display the data */
8
+ columns: GridColDef<T>[];
9
+ /** Data-qa tag for E2E test purposes */
10
+ "data-qa"?: string;
11
+ /** Sets the initial sortModel in case the required sorting differs from the back-end's default sorting */
12
+ initialSort?: {
13
+ field: string;
14
+ sort: "asc" | "desc";
15
+ };
16
+ /** Overwrite a safe selection of the {@link DataGrid} properties */
17
+ dataGridOverridableProps?: Pick<DataGridProps<T>, "ignoreDiacritics" | "getRowId">;
18
+ }
19
+ export declare function AoaFileTable<T extends NonNullObject = any>({ data, columns, initialSort, dataGridOverridableProps, "data-qa": dataQa }: Readonly<AoaFileTableProps<T>>): import("react/jsx-runtime").JSX.Element;
20
+ //# sourceMappingURL=FileTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileTable.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/file-table/FileTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,iBAAiB,GAAG,GAAG;IAClE,wDAAwD;IACxD,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,+CAA+C;IAC/C,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IACzB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0GAA0G;IAC1G,WAAW,CAAC,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;KACtB,CAAC;IACF,oEAAoE;IACpE,wBAAwB,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAAC,CAAC;CACpF;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,GAAG,GAAG,EAAE,EAC1D,IAAI,EACJ,OAAO,EACP,WAAW,EACX,wBAAwB,EACxB,SAAS,EAAE,MAAM,EAClB,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,2CAchC"}
@@ -0,0 +1,28 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { AoaTable as i } from "../../atoms/table/Table.js";
3
+ function d({
4
+ data: t,
5
+ columns: a,
6
+ initialSort: e,
7
+ dataGridOverridableProps: o,
8
+ "data-qa": m
9
+ }) {
10
+ return /* @__PURE__ */ r(
11
+ i,
12
+ {
13
+ mode: "client",
14
+ data: {
15
+ items: t ?? [],
16
+ totalItems: t.length ?? 0
17
+ },
18
+ initialSort: e,
19
+ "data-qa": m,
20
+ columns: a,
21
+ dataGridOverridableProps: o
22
+ }
23
+ );
24
+ }
25
+ export {
26
+ d as AoaFileTable
27
+ };
28
+ //# sourceMappingURL=FileTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileTable.js","sources":["../../../../src/components/molecules/file-table/FileTable.tsx"],"sourcesContent":["import type { DataGridProps, GridColDef, GridValidRowModel } from \"@mui/x-data-grid\";\nimport type { NonNullObject } from \"../../../_constants\";\nimport { AoaTable } from \"../../atoms/table/Table\";\n\nexport interface AoaFileTableProps<T extends GridValidRowModel = any> {\n /** The TableData object to be displayed in the table */\n data: T[];\n /** The column structure to display the data */\n columns: GridColDef<T>[];\n /** Data-qa tag for E2E test purposes */\n \"data-qa\"?: string;\n /** Sets the initial sortModel in case the required sorting differs from the back-end's default sorting */\n initialSort?: {\n field: string;\n sort: \"asc\" | \"desc\";\n };\n /** Overwrite a safe selection of the {@link DataGrid} properties */\n dataGridOverridableProps?: Pick<DataGridProps<T>, \"ignoreDiacritics\" | \"getRowId\">;\n}\n\nexport function AoaFileTable<T extends NonNullObject = any>({\n data,\n columns,\n initialSort,\n dataGridOverridableProps,\n \"data-qa\": dataQa\n}: Readonly<AoaFileTableProps<T>>) {\n return (\n <AoaTable<T>\n mode=\"client\"\n data={{\n items: data ?? [],\n totalItems: data.length ?? 0\n }}\n initialSort={initialSort}\n data-qa={dataQa}\n columns={columns}\n dataGridOverridableProps={dataGridOverridableProps}\n />\n );\n}\n"],"names":["AoaFileTable","data","columns","initialSort","dataGridOverridableProps","dataQa","jsx","AoaTable"],"mappings":";;AAoBO,SAASA,EAA4C;AAAA,EAC1D,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,0BAAAC;AAAA,EACA,WAAWC;AACb,GAAmC;AAE/B,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAM;AAAA,QACJ,OAAON,KAAQ,CAAC;AAAA,QAChB,YAAYA,EAAK,UAAU;AAAA,MAC7B;AAAA,MACA,aAAAE;AAAA,MACA,WAASE;AAAA,MACT,SAAAH;AAAA,MACA,0BAAAE;AAAA,IAAA;AAAA,EAAA;AAGN;"}
package/dist/index.d.ts CHANGED
@@ -12,6 +12,8 @@ export { AoaRadioButton, type AoaRadioButtonProps } from './components/atoms/sel
12
12
  export { AoaSwitchButton, type AoaSwitchButtonProps } from './components/atoms/selection-buttons/switch-button/SwitchButton';
13
13
  export { AoaTable, type AoaTableColumns, type AoaTableData, type AoaTableProps, type AoaTableQueryOptions } from './components/atoms/table/Table';
14
14
  export { AoaZeroWidthSpace } from './components/atoms/zero-width-space/ZeroWidthSpace';
15
+ export { AoaFileDropzone, type AoaDropableFile, type AoaFileDropzoneDataQas, type AoaFileDropzoneProps } from './components/molecules/file-dropzone/FileDropzone';
16
+ export { AoaFileTable, type AoaFileTableProps } from './components/molecules/file-table/FileTable';
15
17
  export { AoaFormError, type AoaFormErrorProps } from './components/molecules/form-error/FormError';
16
18
  export { AoaFormModal, type AoaFormModalLabels, type AoaFormModalProps, type AoaFormModalQAs } from './components/molecules/form-modal/FormModal';
17
19
  export { AoaModalCloseButton, type AoaModalCloseButtonProps } from './components/molecules/modal-close-button/ModalCloseButton';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AAC3E,YAAY,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC3G,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAC/G,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC5G,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,+DAA+D,CAAC;AACzH,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AAC7H,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAClJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAG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import { AoaButton as t } from "./components/atoms/button/Button.js";
2
- import { AoaIconButton as e } from "./components/atoms/icon-button/IconButton.js";
3
- import { AoaInput as p } from "./components/atoms/input/Input.js";
2
+ import { AoaIconButton as a } from "./components/atoms/icon-button/IconButton.js";
3
+ import { AoaInput as m } from "./components/atoms/input/Input.js";
4
4
  import { AoaLogo as x } from "./components/atoms/logo/Logo.js";
5
5
  import { AoaNoPermission as n } from "./components/atoms/no-permission/NoPermission.js";
6
- import { AoaNotification as d } from "./components/atoms/notification/Notification.js";
6
+ import { AoaNotification as l } from "./components/atoms/notification/Notification.js";
7
7
  import { AoaSectionHeader as u } from "./components/atoms/section-header/SectionHeader.js";
8
8
  import { AoaCheckbox as c } from "./components/atoms/selection-buttons/checkbox/Checkbox.js";
9
9
  import { AoaRadioButton as C } from "./components/atoms/selection-buttons/radio-button/RadioButton.js";
10
- import { AoaSwitchButton as h } from "./components/atoms/selection-buttons/switch-button/SwitchButton.js";
11
- import { AoaTable as N } from "./components/atoms/table/Table.js";
12
- import { AoaZeroWidthSpace as b } from "./components/atoms/zero-width-space/ZeroWidthSpace.js";
13
- import { AoaFormError as I } from "./components/molecules/form-error/FormError.js";
14
- import { AoaFormModal as T } from "./components/molecules/form-modal/FormModal.js";
15
- import { AoaModalCloseButton as v } from "./components/molecules/modal-close-button/ModalCloseButton.js";
16
- import { AoaModal as E } from "./components/molecules/modal/Modal.js";
17
- import { AoaNavigationBar as L } from "./components/molecules/navigation-bar/NavigationBar.js";
18
- import { AoaUploadButton as U } from "./components/molecules/upload-button/UploadButton.js";
19
- import { AoaContentPage as Z } from "./components/organisms/content-page/ContentPage.js";
10
+ import { AoaSwitchButton as b } from "./components/atoms/selection-buttons/switch-button/SwitchButton.js";
11
+ import { AoaTable as h } from "./components/atoms/table/Table.js";
12
+ import { AoaZeroWidthSpace as N } from "./components/atoms/zero-width-space/ZeroWidthSpace.js";
13
+ import { AoaFileDropzone as T } from "./components/molecules/file-dropzone/FileDropzone.js";
14
+ import { AoaFileTable as P } from "./components/molecules/file-table/FileTable.js";
15
+ import { AoaFormError as v } from "./components/molecules/form-error/FormError.js";
16
+ import { AoaFormModal as z } from "./components/molecules/form-modal/FormModal.js";
17
+ import { AoaModalCloseButton as E } from "./components/molecules/modal-close-button/ModalCloseButton.js";
18
+ import { AoaModal as L } from "./components/molecules/modal/Modal.js";
19
+ import { AoaNavigationBar as U } from "./components/molecules/navigation-bar/NavigationBar.js";
20
+ import { AoaUploadButton as Z } from "./components/molecules/upload-button/UploadButton.js";
21
+ import { AoaContentPage as q } from "./components/organisms/content-page/ContentPage.js";
20
22
  export {
21
23
  t as AoaButton,
22
24
  c as AoaCheckbox,
23
- Z as AoaContentTemplate,
24
- I as AoaFormError,
25
- T as AoaFormModal,
26
- e as AoaIconButton,
27
- p as AoaInput,
25
+ q as AoaContentTemplate,
26
+ T as AoaFileDropzone,
27
+ P as AoaFileTable,
28
+ v as AoaFormError,
29
+ z as AoaFormModal,
30
+ a as AoaIconButton,
31
+ m as AoaInput,
28
32
  x as AoaLogo,
29
- E as AoaModal,
30
- v as AoaModalCloseButton,
31
- L as AoaNavigationBar,
33
+ L as AoaModal,
34
+ E as AoaModalCloseButton,
35
+ U as AoaNavigationBar,
32
36
  n as AoaNoPermission,
33
- d as AoaNotification,
37
+ l as AoaNotification,
34
38
  C as AoaRadioButton,
35
39
  u as AoaSectionHeader,
36
- h as AoaSwitchButton,
37
- N as AoaTable,
38
- U as AoaUploadButton,
39
- b as AoaZeroWidthSpace
40
+ b as AoaSwitchButton,
41
+ h as AoaTable,
42
+ Z as AoaUploadButton,
43
+ N as AoaZeroWidthSpace
40
44
  };
41
45
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rws-aoa/react-library",
3
- "version": "3.5.3",
3
+ "version": "3.6.0",
4
4
  "description": "RWS AOA Design System",
5
5
  "author": "@rws-aoa",
6
6
  "license": "Apache-2.0",
@@ -69,6 +69,8 @@
69
69
  "playwright": "^1.46.1",
70
70
  "prettier": "^3.3.3",
71
71
  "prop-types": "^15.8.1",
72
+ "react-dropzone": "^14.2.3",
73
+ "react-toastify": "^10.0.5",
72
74
  "storybook": "^7.6.20",
73
75
  "stylelint": "^16.9.0",
74
76
  "tslib": "^2.7.0",
@@ -87,7 +89,9 @@
87
89
  "@tanstack/react-form": "*",
88
90
  "@tanstack/react-router": "*",
89
91
  "react": "^18.x",
90
- "react-dom": "^18.x"
92
+ "react-dom": "^18.x",
93
+ "react-dropzone": "^14.x",
94
+ "react-toastify": "^10.x"
91
95
  },
92
96
  "peerDependenciesMeta": {
93
97
  "@mui/x-data-grid": {
@@ -131,6 +135,14 @@
131
135
  "types": "./dist/components/organisms/content-page/ContentPage.d.ts",
132
136
  "default": "./dist/components/organisms/content-page/ContentPage.js"
133
137
  },
138
+ "./filedropzone": {
139
+ "types": "./dist/components/molecules/file-dropzone/FileDropzone.d.ts",
140
+ "default": "./dist/components/molecules/file-dropzone/FileDropzone.js"
141
+ },
142
+ "./filetable": {
143
+ "types": "./dist/components/molecules/file-table/FileTable.d.ts",
144
+ "default": "./dist/components/molecules/file-table/FileTable.js"
145
+ },
134
146
  "./formerror": {
135
147
  "types": "./dist/components/molecules/form-error/FormError.d.ts",
136
148
  "default": "./dist/components/molecules/form-error/FormError.js"