@rws-aoa/react-library 3.6.2 → 3.6.4

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.
Files changed (112) hide show
  1. package/dist/_constants.d.ts +0 -4
  2. package/dist/_constants.d.ts.map +1 -1
  3. package/dist/_constants.js.map +1 -1
  4. package/dist/chunks/index.DJYQ_-zP.js +489 -0
  5. package/dist/chunks/{index.CtmQWjvP.js.map → index.DJYQ_-zP.js.map} +1 -1
  6. package/dist/components/atoms/_menu/menu-item/MenuItem.d.ts +51 -25
  7. package/dist/components/atoms/_menu/menu-item/MenuItem.d.ts.map +1 -1
  8. package/dist/components/atoms/_menu/menu-item/MenuItem.js +23 -23
  9. package/dist/components/atoms/_menu/menu-item/MenuItem.js.map +1 -1
  10. package/dist/components/atoms/_menu/user-menu/UserMenu.d.ts +27 -15
  11. package/dist/components/atoms/_menu/user-menu/UserMenu.d.ts.map +1 -1
  12. package/dist/components/atoms/_menu/user-menu/UserMenu.js +25 -25
  13. package/dist/components/atoms/_menu/user-menu/UserMenu.js.map +1 -1
  14. package/dist/components/atoms/button/Button.d.ts +10 -6
  15. package/dist/components/atoms/button/Button.d.ts.map +1 -1
  16. package/dist/components/atoms/button/Button.js +4 -4
  17. package/dist/components/atoms/button/Button.js.map +1 -1
  18. package/dist/components/atoms/icon-button/IconButton.d.ts +30 -16
  19. package/dist/components/atoms/icon-button/IconButton.d.ts.map +1 -1
  20. package/dist/components/atoms/icon-button/IconButton.js +43 -40
  21. package/dist/components/atoms/icon-button/IconButton.js.map +1 -1
  22. package/dist/components/atoms/input/Input.d.ts +10 -6
  23. package/dist/components/atoms/input/Input.d.ts.map +1 -1
  24. package/dist/components/atoms/input/Input.js +3 -3
  25. package/dist/components/atoms/input/Input.js.map +1 -1
  26. package/dist/components/atoms/logo/Logo.d.ts +9 -5
  27. package/dist/components/atoms/logo/Logo.d.ts.map +1 -1
  28. package/dist/components/atoms/logo/Logo.js +87 -87
  29. package/dist/components/atoms/logo/Logo.js.map +1 -1
  30. package/dist/components/atoms/no-permission/NoPermission.d.ts +10 -6
  31. package/dist/components/atoms/no-permission/NoPermission.d.ts.map +1 -1
  32. package/dist/components/atoms/no-permission/NoPermission.js +2 -2
  33. package/dist/components/atoms/no-permission/NoPermission.js.map +1 -1
  34. package/dist/components/atoms/notification/Notification.d.ts +19 -11
  35. package/dist/components/atoms/notification/Notification.d.ts.map +1 -1
  36. package/dist/components/atoms/notification/Notification.js +8 -8
  37. package/dist/components/atoms/notification/Notification.js.map +1 -1
  38. package/dist/components/atoms/notification/_icons/Error.js +10 -10
  39. package/dist/components/atoms/notification/_icons/Error.js.map +1 -1
  40. package/dist/components/atoms/notification/_icons/Info.js +11 -11
  41. package/dist/components/atoms/notification/_icons/Info.js.map +1 -1
  42. package/dist/components/atoms/notification/_icons/Success.js +11 -11
  43. package/dist/components/atoms/notification/_icons/Success.js.map +1 -1
  44. package/dist/components/atoms/notification/_icons/Warning.js +9 -9
  45. package/dist/components/atoms/notification/_icons/Warning.js.map +1 -1
  46. package/dist/components/atoms/section-header/SectionHeader.d.ts +12 -9
  47. package/dist/components/atoms/section-header/SectionHeader.d.ts.map +1 -1
  48. package/dist/components/atoms/section-header/SectionHeader.js +3 -3
  49. package/dist/components/atoms/section-header/SectionHeader.js.map +1 -1
  50. package/dist/components/atoms/selection-buttons/checkbox/Checkbox.d.ts +15 -9
  51. package/dist/components/atoms/selection-buttons/checkbox/Checkbox.d.ts.map +1 -1
  52. package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js +7 -7
  53. package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js.map +1 -1
  54. package/dist/components/atoms/selection-buttons/radio-button/RadioButton.d.ts +14 -8
  55. package/dist/components/atoms/selection-buttons/radio-button/RadioButton.d.ts.map +1 -1
  56. package/dist/components/atoms/selection-buttons/radio-button/RadioButton.js +4 -4
  57. package/dist/components/atoms/selection-buttons/radio-button/RadioButton.js.map +1 -1
  58. package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.d.ts +14 -8
  59. package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.d.ts.map +1 -1
  60. package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.js +3 -3
  61. package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.js.map +1 -1
  62. package/dist/components/atoms/table/Table.d.ts +67 -36
  63. package/dist/components/atoms/table/Table.d.ts.map +1 -1
  64. package/dist/components/atoms/table/Table.js +80 -62
  65. package/dist/components/atoms/table/Table.js.map +1 -1
  66. package/dist/components/atoms/table/_QuickSearchToolbar.d.ts +4 -5
  67. package/dist/components/atoms/table/_QuickSearchToolbar.d.ts.map +1 -1
  68. package/dist/components/atoms/table/_QuickSearchToolbar.js +1 -1
  69. package/dist/components/atoms/table/_QuickSearchToolbar.js.map +1 -1
  70. package/dist/components/atoms/zero-width-space/ZeroWidthSpace.d.ts +2 -2
  71. package/dist/components/atoms/zero-width-space/ZeroWidthSpace.d.ts.map +1 -1
  72. package/dist/components/atoms/zero-width-space/ZeroWidthSpace.js +1 -1
  73. package/dist/components/atoms/zero-width-space/ZeroWidthSpace.js.map +1 -1
  74. package/dist/components/molecules/file-dropzone/FileDropzone.d.ts +56 -32
  75. package/dist/components/molecules/file-dropzone/FileDropzone.d.ts.map +1 -1
  76. package/dist/components/molecules/file-dropzone/FileDropzone.js +24 -25
  77. package/dist/components/molecules/file-dropzone/FileDropzone.js.map +1 -1
  78. package/dist/components/molecules/file-table/FileTable.d.ts +18 -10
  79. package/dist/components/molecules/file-table/FileTable.d.ts.map +1 -1
  80. package/dist/components/molecules/file-table/FileTable.js +4 -4
  81. package/dist/components/molecules/file-table/FileTable.js.map +1 -1
  82. package/dist/components/molecules/form-error/FormError.d.ts +1 -2
  83. package/dist/components/molecules/form-error/FormError.d.ts.map +1 -1
  84. package/dist/components/molecules/form-error/FormError.js +1 -1
  85. package/dist/components/molecules/form-error/FormError.js.map +1 -1
  86. package/dist/components/molecules/form-modal/FormModal.d.ts +29 -14
  87. package/dist/components/molecules/form-modal/FormModal.d.ts.map +1 -1
  88. package/dist/components/molecules/form-modal/FormModal.js +10 -10
  89. package/dist/components/molecules/form-modal/FormModal.js.map +1 -1
  90. package/dist/components/molecules/modal/Modal.d.ts +45 -23
  91. package/dist/components/molecules/modal/Modal.d.ts.map +1 -1
  92. package/dist/components/molecules/modal/Modal.js +2 -2
  93. package/dist/components/molecules/modal/Modal.js.map +1 -1
  94. package/dist/components/molecules/modal-close-button/ModalCloseButton.d.ts +4 -2
  95. package/dist/components/molecules/modal-close-button/ModalCloseButton.d.ts.map +1 -1
  96. package/dist/components/molecules/modal-close-button/ModalCloseButton.js +1 -1
  97. package/dist/components/molecules/modal-close-button/ModalCloseButton.js.map +1 -1
  98. package/dist/components/molecules/navigation-bar/NavigationBar.d.ts +22 -12
  99. package/dist/components/molecules/navigation-bar/NavigationBar.d.ts.map +1 -1
  100. package/dist/components/molecules/navigation-bar/NavigationBar.js +2 -2
  101. package/dist/components/molecules/navigation-bar/NavigationBar.js.map +1 -1
  102. package/dist/components/molecules/upload-button/UploadButton.d.ts +20 -12
  103. package/dist/components/molecules/upload-button/UploadButton.d.ts.map +1 -1
  104. package/dist/components/molecules/upload-button/UploadButton.js +3 -3
  105. package/dist/components/molecules/upload-button/UploadButton.js.map +1 -1
  106. package/dist/components/organisms/content-page/ContentPage.d.ts +7 -5
  107. package/dist/components/organisms/content-page/ContentPage.d.ts.map +1 -1
  108. package/dist/components/organisms/content-page/ContentPage.js +1 -1
  109. package/dist/components/organisms/content-page/ContentPage.js.map +1 -1
  110. package/dist/css/styles.css +6 -6
  111. package/package.json +33 -34
  112. package/dist/chunks/index.CtmQWjvP.js +0 -486
@@ -1,61 +1,92 @@
1
1
  import { SxProps } from '@mui/material';
2
2
  import { DataGridProps, GridColDef, GridFilterModel, GridLocaleText, GridSortModel } from '@mui/x-data-grid';
3
- import { NonNullObject } from '../../../_constants';
4
-
5
- export interface AoaTableData<T extends NonNullObject = any> {
6
- /** The paged, filtered and sorted items from the database */
3
+ export interface AoaTableData<T extends object = any> {
4
+ /**
5
+ * The paged, filtered and sorted items from the database
6
+ */
7
7
  items: T[];
8
- /** The total number of items present in the database table */
8
+ /**
9
+ * The total number of items present in the database table
10
+ */
9
11
  totalItems: number;
10
12
  }
11
- export type AoaTableColumns<T extends NonNullObject = any> = GridColDef<T>[];
13
+ export type AoaTableColumns<T extends object = any> = GridColDef<T>[];
12
14
  export interface AoaTableQueryOptions {
13
- /** The current page of the table */
15
+ /**
16
+ * Material UI's GridFilterModel
17
+ */
18
+ filterModel: GridFilterModel;
19
+ /**
20
+ * The current page of the table
21
+ */
14
22
  page: number;
15
- /** The maximum number of items that are shown on a page */
23
+ /**
24
+ * The maximum number of items that are shown on a page
25
+ */
16
26
  pageSize: number;
17
- /** Material UI's GridSortModel */
27
+ /**
28
+ * Material UI's GridSortModel
29
+ */
18
30
  sortModel: GridSortModel;
19
- /** Material UI's GridFilterModel */
20
- filterModel: GridFilterModel;
21
31
  }
22
32
  type ModeProps =
23
- /** The Redux action that takes PaginationModel as parameter to retrieve data from the server */
33
+ /**
34
+ * Overwrites the default mode (server) when you need pagination, filtering and sorting on the client side
35
+ */
24
36
  {
25
- getData: (queryOptions: AoaTableQueryOptions) => Promise<void> | void;
26
- mode?: never;
27
- }
28
- /** Overwrites the default mode (server) when you need pagination, filtering and sorting on the client side */
29
- | {
30
37
  getData?: never;
31
38
  mode: "client";
39
+ }
40
+ /**
41
+ * The Redux action that takes PaginationModel as parameter to retrieve data from the server
42
+ */
43
+ | {
44
+ getData(queryOptions: AoaTableQueryOptions): Promise<void> | void;
45
+ mode?: never;
32
46
  };
33
- export type AoaTableProps<T extends NonNullObject = any> = ModeProps & {
34
- /** The TableData object to be displayed in the table */
35
- data: AoaTableData<T>;
36
- /** The column structure to display the data */
37
- columns: GridColDef<T>[];
38
- /** Data-qa tag for E2E test purposes */
39
- "data-qa"?: string;
40
- /** Material UI's property to apply styling */
41
- sx?: SxProps;
42
- /** Action buttons shown in the toolbar of the table */
43
- actionButtons?: JSX.Element[];
44
- /** Sets the initial sortModel in case the required sorting differs from the back-end's default sorting */
45
- initialSort?: {
47
+ export type AoaTableProps<T extends object = any> = ModeProps & {
48
+ /**
49
+ * Action buttons shown in the toolbar of the table
50
+ */
51
+ readonly actionButtons?: JSX.Element[];
52
+ /**
53
+ * The column structure to display the data
54
+ */
55
+ readonly columns: GridColDef<T>[];
56
+ /**
57
+ * The TableData object to be displayed in the table
58
+ */
59
+ readonly data: AoaTableData<T>;
60
+ /**
61
+ * Data-qa tag for E2E test purposes
62
+ */
63
+ readonly "data-qa"?: string;
64
+ /**
65
+ * Overwrite a safe selection of the {@link DataGrid} properties
66
+ */
67
+ readonly dataGridOverridableProps?: Pick<DataGridProps<T>, "checkboxSelection" | "getRowId" | "ignoreDiacritics" | "isRowSelectable" | "loading" | "onRowSelectionModelChange" | "rowSelectionModel">;
68
+ /**
69
+ * Sets the initial sortModel in case the required sorting differs from the back-end's default sorting
70
+ */
71
+ readonly initialSort?: {
46
72
  field: string;
47
73
  sort: "asc" | "desc";
48
74
  };
49
- /** Overwrites the default labels when you need a different language than Dutch */
50
- localeText?: GridLocaleText & {
75
+ /**
76
+ * Overwrites the default labels when you need a different language than Dutch
77
+ */
78
+ readonly localeText?: GridLocaleText & {
51
79
  refreshTable: string;
52
80
  };
53
- /** Overwrite a safe selection of the {@link DataGrid} properties */
54
- dataGridOverridableProps?: Pick<DataGridProps<T>, "ignoreDiacritics" | "loading" | "getRowId">;
81
+ /**
82
+ * Material UI's property to apply styling
83
+ */
84
+ readonly sx?: SxProps;
55
85
  };
56
86
  /**
57
87
  * Constructs a table using pre-defined Rijks styling
58
- * @param props Props to pass to the button
88
+ *
89
+ * @param props - Props to pass to the button
59
90
  * @example
60
91
  * ```jsx
61
92
  * <AoaTable
@@ -65,7 +96,7 @@ export type AoaTableProps<T extends NonNullObject = any> = ModeProps & {
65
96
  * />
66
97
  * ```
67
98
  */
68
- declare function NonMemoizeAoaTable<T extends NonNullObject = any>(props: AoaTableProps<T>): import("react/jsx-runtime").JSX.Element;
99
+ declare function NonMemoizeAoaTable<T extends object = any>(props: AoaTableProps<T>): import("react/jsx-runtime").JSX.Element;
69
100
  export declare const AoaTable: typeof NonMemoizeAoaTable;
70
101
  export {};
71
102
  //# 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,CAAC;AAC7C,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGhJ,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,aAAa,GAAG,GAAG;IACzD,6DAA6D;IAC7D,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,aAAa,GAAG,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;AAE7E,MAAM,WAAW,oBAAoB;IACnC,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,SAAS,EAAE,aAAa,CAAC;IACzB,oCAAoC;IACpC,WAAW,EAAE,eAAe,CAAC;CAC9B;AAED,KAAK,SAAS;AACZ,gGAAgG;AAE9F;IAAE,OAAO,EAAE,CAAC,YAAY,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE;AACzF,8GAA8G;GAC5G;IAAE,OA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GAAG,UAAU,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,SAAS,GAAG,2BAA2B,GAAG,mBAAmB,CAC1I,CAAC;IACF;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;KAAE,CAAC;IAC/D;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,GAAG;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAOF;;;;;;;;;;;;GAYG;AAEH,iBAAS,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,2CAiM1E;AAED,eAAO,MAAM,QAAQ,EAA+B,OAAO,kBAAkB,CAAC"}
@@ -1,79 +1,95 @@
1
1
  import { jsx as w } from "react/jsx-runtime";
2
2
  import "@mui/material";
3
- import { DataGrid as P } from "@mui/x-data-grid";
4
- import { m as F } from "../../../chunks/index.CtmQWjvP.js";
5
- import { memo as R, useState as i, useCallback as k, useEffect as v } from "react";
3
+ import { DataGrid as R } from "@mui/x-data-grid";
4
+ import { m as P } from "../../../chunks/index.DJYQ_-zP.js";
5
+ import { memo as F, useState as i, useCallback as u, useEffect as h } from "react";
6
6
  import { FontNormalSxProps as I } from "../../../_constants.js";
7
7
  import { QuickSearchToolbar as T } from "./_QuickSearchToolbar.js";
8
8
  function j(e) {
9
- var m, b, M;
10
- const [D, c] = i(!1), [l, h] = i({
9
+ var m, M, k;
10
+ const [v, g] = i(!1), [l, f] = i({
11
11
  page: 0,
12
12
  pageSize: 10
13
- }), [n, S] = i([]), [d, C] = i({
13
+ }), [d, D] = i([]), [s, x] = i({
14
14
  items: []
15
- }), r = e.mode ?? "server", s = r === "server", f = k((o) => {
16
- S(o);
17
- }, []), G = k((o) => {
18
- C(o);
19
- }, []), [x, u] = i(((m = e.data) == null ? void 0 : m.totalItems) || 0), g = (o, t, a) => {
20
- if (s && e.getData) {
21
- const y = async () => {
22
- await e.getData({ ...o, sortModel: t, filterModel: a });
23
- };
24
- c(!0), y(), c(!1);
25
- }
26
- };
27
- return v(() => {
28
- u((o) => {
15
+ }), r = e.mode ?? "server", n = r === "server", S = u((o) => {
16
+ D(o);
17
+ }, []), C = u((o) => {
18
+ x(o);
19
+ }, []), [y, b] = i(((m = e.data) == null ? void 0 : m.totalItems) || 0), c = u(
20
+ async (o, t, a) => {
21
+ if (n && e.getData) {
22
+ const G = async () => {
23
+ await e.getData({ ...o, sortModel: t, filterModel: a });
24
+ };
25
+ g(!0), await G(), g(!1);
26
+ }
27
+ },
28
+ [n, e]
29
+ );
30
+ return h(() => {
31
+ b((o) => {
29
32
  var t, a;
30
- return ((t = e.data) == null ? void 0 : t.totalItems) !== void 0 ? (a = e.data) == null ? void 0 : a.totalItems : o;
33
+ return ((t = e.data) == null ? void 0 : t.totalItems) === void 0 ? o : (a = e.data) == null ? void 0 : a.totalItems;
31
34
  });
32
- }, [(b = e.data) == null ? void 0 : b.totalItems, u]), v(() => {
33
- g(l, n, d);
34
- }, [l, n, d]), /* @__PURE__ */ w(
35
- P,
35
+ }, [(M = e.data) == null ? void 0 : M.totalItems, b]), h(() => {
36
+ c(l, d, s);
37
+ }, [c, l, d, s]), /* @__PURE__ */ w(
38
+ R,
36
39
  {
37
- initialState: {
38
- sorting: {
39
- sortModel: e.initialSort ? [e.initialSort] : []
40
- }
41
- },
42
- disableColumnMenu: !0,
40
+ columns: e.columns,
41
+ "data-qa": e["data-qa"],
43
42
  disableColumnFilter: !0,
43
+ disableColumnMenu: !0,
44
44
  disableColumnSelector: !0,
45
45
  disableDensitySelector: !0,
46
46
  disableRowSelectionOnClick: !0,
47
47
  disableVirtualization: !0,
48
- columns: e.columns,
49
- rows: (M = e.data) == null ? void 0 : M.items,
50
- rowCount: s ? x : void 0,
48
+ filterMode: r,
51
49
  getRowHeight: () => "auto",
50
+ initialState: {
51
+ sorting: {
52
+ sortModel: e.initialSort ? [e.initialSort] : []
53
+ }
54
+ },
55
+ loading: v,
56
+ localeText: e.localeText ?? {
57
+ columnHeaderSortIconLabel: "Sorteren",
58
+ toolbarQuickFilterPlaceholder: "Zoeken...",
59
+ toolbarQuickFilterLabel: "Zoeken",
60
+ toolbarQuickFilterDeleteIconLabel: "Wissen",
61
+ noRowsLabel: "Geen regels beschikbaar",
62
+ noResultsOverlayLabel: "Geen regels gevonden.",
63
+ MuiTablePagination: {
64
+ labelDisplayedRows: ({ from: o, to: t, count: a }) => `${o} - ${t} van ${a}`,
65
+ labelRowsPerPage: "Regels per pagina"
66
+ },
67
+ footerRowSelected: (o) => `${o} regels geselecteerd`
68
+ },
69
+ onFilterModelChange: C,
70
+ onPaginationModelChange: f,
71
+ onSortModelChange: S,
52
72
  pageSizeOptions: [5, 10, 20, 40, 80],
53
- paginationModel: l,
54
73
  paginationMode: r,
55
- onPaginationModelChange: h,
56
- sortingMode: r,
57
- onSortModelChange: f,
58
- filterMode: r,
59
- onFilterModelChange: G,
60
- slots: {
61
- toolbar: T
62
- },
74
+ paginationModel: l,
75
+ rowCount: n ? y : void 0,
76
+ rows: (k = e.data) == null ? void 0 : k.items,
63
77
  slotProps: {
64
78
  toolbar: {
65
79
  showQuickFilter: !0,
66
80
  quickFilterProps: { debounceMs: 500 },
67
81
  mode: r,
68
- isServerMode: s,
69
- getData: () => g(l, n, d),
82
+ isServerMode: n,
83
+ getData: async () => c(l, d, s),
70
84
  actionButtons: e.actionButtons,
71
85
  localeText: e.localeText
72
86
  }
73
87
  },
74
- loading: D,
75
- "data-qa": e["data-qa"],
76
- sx: F(
88
+ slots: {
89
+ toolbar: T
90
+ },
91
+ sortingMode: r,
92
+ sx: P(
77
93
  {
78
94
  border: 0,
79
95
  color: "var(--color-text)",
@@ -128,29 +144,31 @@ function j(e) {
128
144
  },
129
145
  ".MuiPaginationItem-root": {
130
146
  borderRadius: 0
147
+ },
148
+ ".MuiCheckbox-root": {
149
+ color: "var(--color-primary)",
150
+ ":focus": {
151
+ outline: "2px dashed var(--color-text)",
152
+ outlineOffset: "-9px",
153
+ borderRadius: 0
154
+ },
155
+ ":disabled": {
156
+ color: "var(--color-disabled)"
157
+ }
158
+ },
159
+ ".MuiDataGrid-columnHeader .MuiCheckbox-root": {
160
+ color: "white"
131
161
  }
132
162
  },
133
163
  e.sx,
134
164
  I
135
165
  ),
136
- localeText: e.localeText ?? {
137
- columnHeaderSortIconLabel: "Sorteren",
138
- toolbarQuickFilterPlaceholder: "Zoeken...",
139
- toolbarQuickFilterLabel: "Zoeken",
140
- toolbarQuickFilterDeleteIconLabel: "Wissen",
141
- noRowsLabel: "Geen regels beschikbaar",
142
- noResultsOverlayLabel: "Geen regels gevonden.",
143
- MuiTablePagination: {
144
- labelDisplayedRows: ({ from: o, to: t, count: a }) => `${o} - ${t} van ${a}`,
145
- labelRowsPerPage: "Regels per pagina"
146
- }
147
- },
148
166
  ...e.dataGridOverridableProps
149
167
  }
150
168
  );
151
169
  }
152
- const $ = R(j);
170
+ const q = F(j);
153
171
  export {
154
- $ as AoaTable
172
+ q as AoaTable
155
173
  };
156
174
  //# sourceMappingURL=Table.js.map
@@ -1 +1 @@
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,C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zB,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;AAEa,MAAAgC,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 } from \"../../../_constants\";\nimport { QuickSearchToolbar } from \"./_QuickSearchToolbar\";\n\nexport interface AoaTableData<T extends object = any> {\n /**\n * The paged, filtered and sorted items from the database\n */\n items: T[];\n /**\n * The total number of items present in the database table\n */\n totalItems: number;\n}\n\nexport type AoaTableColumns<T extends object = any> = GridColDef<T>[];\n\nexport interface AoaTableQueryOptions {\n /**\n * Material UI's GridFilterModel\n */\n filterModel: GridFilterModel;\n /**\n * The current page of the table\n */\n page: number;\n /**\n * The maximum number of items that are shown on a page\n */\n pageSize: number;\n /**\n * Material UI's GridSortModel\n */\n sortModel: GridSortModel;\n}\n\ntype ModeProps =\n /**\n * Overwrites the default mode (server) when you need pagination, filtering and sorting on the client side\n */\n | { getData?: never; mode: \"client\" }\n /**\n * The Redux action that takes PaginationModel as parameter to retrieve data from the server\n */\n | { getData(queryOptions: AoaTableQueryOptions): Promise<void> | void; mode?: never };\n\nexport type AoaTableProps<T extends object = any> = ModeProps & {\n /**\n * Action buttons shown in the toolbar of the table\n */\n readonly actionButtons?: JSX.Element[];\n /**\n * The column structure to display the data\n */\n readonly columns: GridColDef<T>[];\n /**\n * The TableData object to be displayed in the table\n */\n readonly data: AoaTableData<T>;\n /**\n * Data-qa tag for E2E test purposes\n */\n readonly \"data-qa\"?: string;\n /**\n * Overwrite a safe selection of the {@link DataGrid} properties\n */\n readonly dataGridOverridableProps?: Pick<\n DataGridProps<T>,\n \"checkboxSelection\" | \"getRowId\" | \"ignoreDiacritics\" | \"isRowSelectable\" | \"loading\" | \"onRowSelectionModelChange\" | \"rowSelectionModel\"\n >;\n /**\n * Sets the initial sortModel in case the required sorting differs from the back-end's default sorting\n */\n readonly initialSort?: { field: string; sort: \"asc\" | \"desc\" };\n /**\n * Overwrites the default labels when you need a different language than Dutch\n */\n readonly localeText?: GridLocaleText & { refreshTable: string };\n /**\n * Material UI's property to apply styling\n */\n readonly sx?: SxProps;\n};\n\ninterface PaginationModel {\n page: number;\n pageSize: number;\n}\n\n/**\n * Constructs a table using pre-defined Rijks styling\n *\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 object = 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 = useCallback(\n async (paginationModel: PaginationModel, sortModel: GridSortModel, filterModel: GridFilterModel) => {\n if (isServerMode && props.getData) {\n const fetchData = async () => {\n await props.getData({ ...paginationModel, sortModel, filterModel });\n };\n\n setIsLoading(true);\n await fetchData();\n setIsLoading(false);\n }\n },\n [isServerMode, props]\n );\n\n useEffect(() => {\n setRowCountState((prevRowCountState) => (props.data?.totalItems === undefined ? prevRowCountState : props.data?.totalItems));\n }, [props.data?.totalItems, setRowCountState]);\n\n useEffect(() => {\n void getData(paginationModel, sortModel, filterModel);\n }, [getData, paginationModel, sortModel, filterModel]);\n\n return (\n <DataGrid\n columns={props.columns}\n data-qa={props[\"data-qa\"]}\n disableColumnFilter\n disableColumnMenu\n disableColumnSelector\n disableDensitySelector\n disableRowSelectionOnClick\n disableVirtualization\n filterMode={mode}\n getRowHeight={() => \"auto\"}\n initialState={{\n sorting: {\n sortModel: props.initialSort ? [props.initialSort] : []\n }\n }}\n loading={isLoading}\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 footerRowSelected: (count) => `${count} regels geselecteerd`\n }\n }\n onFilterModelChange={onFilterChange}\n onPaginationModelChange={setPaginationModel}\n onSortModelChange={handleSortModelChange}\n pageSizeOptions={[5, 10, 20, 40, 80]}\n paginationMode={mode}\n paginationModel={paginationModel}\n rowCount={isServerMode ? rowCountState : undefined}\n rows={props.data?.items}\n slotProps={{\n toolbar: {\n showQuickFilter: true,\n quickFilterProps: { debounceMs: 500 },\n mode,\n isServerMode,\n getData: async () => getData(paginationModel, sortModel, filterModel),\n actionButtons: props.actionButtons,\n localeText: props.localeText\n }\n }}\n slots={{\n toolbar: QuickSearchToolbar\n }}\n sortingMode={mode}\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 \".MuiCheckbox-root\": {\n color: \"var(--color-primary)\",\n\n \":focus\": {\n outline: \"2px dashed var(--color-text)\",\n outlineOffset: \"-9px\",\n borderRadius: 0\n },\n\n \":disabled\": {\n color: \"var(--color-disabled)\"\n }\n },\n\n \".MuiDataGrid-columnHeader .MuiCheckbox-root\": {\n color: \"white\"\n }\n },\n props.sx,\n FontNormalSxProps\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","from","to","count","_c","QuickSearchToolbar","merge","FontNormalSxProps","AoaTable","memo"],"mappings":";;;;;;;AA0GA,SAASA,EAA2CC,GAAyB;;AAC3E,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,CAAA,CAAE,GACtD,CAACK,GAAaC,CAAc,IAAIN,EAA0B;AAAA,IAC9D,OAAO,CAAA;AAAA,EAAC,CACT,GAEKO,IAAOV,EAAM,QAAQ,UACrBW,IAAeD,MAAS,UAExBE,IAAwBC,EAAY,CAACP,MAA6B;AACtE,IAAAC,EAAaD,CAAS;AAAA,EACxB,GAAG,EAAE,GAECQ,IAAiBD,EAAY,CAACL,MAAiC;AACnE,IAAAC,EAAeD,CAAW;AAAA,EAC5B,GAAG,EAAE,GAEC,CAACO,GAAeC,CAAgB,IAAIb,IAASc,IAAAjB,EAAM,SAAN,gBAAAiB,EAAY,eAAc,CAAC,GAExEC,IAAUL;AAAA,IACd,OAAOT,GAAkCE,GAA0BE,MAAiC;AAC9F,UAAAG,KAAgBX,EAAM,SAAS;AACjC,cAAMmB,IAAY,YAAY;AACtB,gBAAAnB,EAAM,QAAQ,EAAE,GAAGI,GAAiB,WAAAE,GAAW,aAAAE,GAAa;AAAA,QACpE;AAEA,QAAAN,EAAa,EAAI,GACjB,MAAMiB,EAAU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;AAAA,cAEjB,UAAU;AAAA,gBACR,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,UAEJ;AAAA,UAEA,kGAAkG;AAAA,YAChG,aAAa;AAAA,UACf;AAAA,UAEA,qBAAqB;AAAA,YACnB,OAAO;AAAA,UACT;AAAA,UAEA,2BAA2B;AAAA,YACzB,cAAc;AAAA,UAChB;AAAA,UAEA,qBAAqB;AAAA,YACnB,OAAO;AAAA,YAEP,UAAU;AAAA,cACR,SAAS;AAAA,cACT,eAAe;AAAA,cACf,cAAc;AAAA,YAChB;AAAA,YAEA,aAAa;AAAA,cACX,OAAO;AAAA,YAAA;AAAA,UAEX;AAAA,UAEA,+CAA+C;AAAA,YAC7C,OAAO;AAAA,UAAA;AAAA,QAEX;AAAA,QACA9B,EAAM;AAAA,QACN+B;AAAA,MACF;AAAA,MACC,GAAG/B,EAAM;AAAA,IAAA;AAAA,EACZ;AAEJ;AAEa,MAAAgC,IAAWC,EAAKlC,CAAkB;"}
@@ -1,15 +1,14 @@
1
1
  import { GridLocaleText, GridToolbarProps, ToolbarPropsOverrides } from '@mui/x-data-grid';
2
-
3
- export declare const QuickSearchToolbar: import('react').MemoExoticComponent<({ mode, isServerMode, actionButtons, getData, localeText, quickFilterProps }: GridToolbarProps & ToolbarPropsOverrides) => import("react/jsx-runtime").JSX.Element>;
4
2
  declare module "@mui/x-data-grid" {
5
3
  interface ToolbarPropsOverrides {
6
- mode: "client" | "server";
7
- isServerMode: boolean;
8
4
  actionButtons?: JSX.Element[];
9
- getData(): void;
5
+ getData(this: void): void;
6
+ isServerMode: boolean;
10
7
  localeText?: GridLocaleText & {
11
8
  refreshTable: string;
12
9
  };
10
+ mode: "client" | "server";
13
11
  }
14
12
  }
13
+ export declare const QuickSearchToolbar: import('react').MemoExoticComponent<({ mode, isServerMode, actionButtons, getData, localeText, quickFilterProps }: GridToolbarProps & ToolbarPropsOverrides) => import("react/jsx-runtime").JSX.Element>;
15
14
  //# sourceMappingURL=_QuickSearchToolbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"_QuickSearchToolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/table/_QuickSearchToolbar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIlI,eAAO,MAAM,kBAAkB,qHACkD,gBAAgB,GAAG,qBAAqB,6CAiGxH,CAAC;AAEF,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAiB,qBAAqB;QACpC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;QAC1B,YAAY,EAAE,OAAO,CAAC;QACtB,aAAa,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAC9B,OAAO,IAAI,IAAI,CAAC;QAChB,UAAU,CAAC,EAAE,cAAc,GAAG;YAC5B,YAAY,EAAE,MAAM,CAAC;SACtB,CAAC;KACH;CACF"}
1
+ {"version":3,"file":"_QuickSearchToolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/table/_QuickSearchToolbar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIlI,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAiB,qBAAqB;QACpC,aAAa,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAC9B,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;QAC1B,YAAY,EAAE,OAAO,CAAC;QACtB,UAAU,CAAC,EAAE,cAAc,GAAG;YAC5B,YAAY,EAAE,MAAM,CAAC;SACtB,CAAC;QACF,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;KAC3B;CACF;AAED,eAAO,MAAM,kBAAkB,qHACkD,gBAAgB,GAAG,qBAAqB,6CAiGxH,CAAC"}
@@ -86,7 +86,7 @@ const k = h(
86
86
  }
87
87
  },
88
88
  children: [
89
- t && /* @__PURE__ */ i(m, { onClick: n, icon: /* @__PURE__ */ i(d, {}), label: (r == null ? void 0 : r.refreshTable) ?? "Ververs tabel" }),
89
+ t && /* @__PURE__ */ i(m, { icon: /* @__PURE__ */ i(d, {}), label: (r == null ? void 0 : r.refreshTable) ?? "Ververs tabel", onClick: n }),
90
90
  o == null ? void 0 : o.map((a) => a),
91
91
  /* @__PURE__ */ i(l, { ...p })
92
92
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"_QuickSearchToolbar.js","sources":["../../../../src/components/atoms/table/_QuickSearchToolbar.tsx"],"sourcesContent":["import { Refresh as RefreshIcon } from \"@mui/icons-material\";\nimport { Box } from \"@mui/material\";\nimport { GridToolbarQuickFilter, type GridLocaleText, type GridToolbarProps, type ToolbarPropsOverrides } from \"@mui/x-data-grid\";\nimport { memo } from \"react\";\nimport { AoaIconButton } from \"../icon-button/IconButton\";\n\nexport const QuickSearchToolbar = memo(\n ({ mode, isServerMode, actionButtons, getData, localeText, quickFilterProps }: GridToolbarProps & ToolbarPropsOverrides) => (\n <Box\n className={`${mode}-mode`}\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n paddingBottom: \"10px\",\n\n \"&.server-mode :nth-child(2)\": {\n marginLeft: \"auto\"\n },\n\n \".MuiButtonBase-root\": {\n width: \"48px\",\n marginRight: \"10px\"\n },\n\n \".MuiFormControl-root.MuiTextField-root\": {\n paddingBottom: 0,\n\n \".MuiInput-root\": {\n position: \"relative\",\n\n \":before, :after\": {\n borderBottom: \"transparent\"\n },\n\n \".MuiSvgIcon-root\": {\n position: \"absolute\",\n right: \"-1px\",\n width: \"24px\",\n height: \"24px\",\n padding: \"12px\",\n background: \"#007bc7\",\n color: \"#ffffff\",\n fontWeight: \"700\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n boxSizing: \"content-box\"\n },\n\n \".MuiInputBase-input\": {\n color: \"var(--color-text)\",\n fontFamily: \"RijksoverheidSansText, Verdana, Arial, sans-serif\",\n fontSize: \"1.125rem\",\n boxSizing: \"border-box\",\n flex: \"1 1\",\n height: \"48px\",\n margin: \"0\",\n padding: \"0 85px 0 14px\",\n background: \"var(--color-text-light)\",\n border: \"1px solid var(--color-rijks-grey-3)\",\n boxShadow: \"inset 1px 1px 3px hsl(0deg 0% 41% / 10%)\",\n lineHeight: \"1.5\",\n maxWidth: \"100%\",\n\n \":focus\": {\n borderColor: \"var(--color-rijks-skyblue)\",\n outline: \"0 !important\",\n boxShadow: `\n inset 1px 1px 3px hsl(0deg 0% 41% / 10%),\n inset 0 0 0 1px var(--color-rijks-skyblue),\n 0 0 5px rgb(0 115 191 / 50%);\n `\n }\n },\n\n \".MuiButtonBase-root\": {\n position: \"absolute\",\n right: \"48px\",\n height: \"24px\",\n width: \"24px\",\n marginRight: \"4px\",\n\n \".MuiSvgIcon-root\": {\n color: \"var(--color-primary)\",\n background: \"none\"\n },\n\n \":hover, :active, :focus\": {\n backgroundColor: \"transparent\"\n },\n\n \".MuiTouchRipple-root\": {\n display: \"none\"\n }\n }\n }\n }\n }}\n >\n {isServerMode && <AoaIconButton onClick={getData} icon={<RefreshIcon />} label={localeText?.refreshTable ?? \"Ververs tabel\"} />}\n {actionButtons?.map((button: JSX.Element) => button)}\n <GridToolbarQuickFilter {...quickFilterProps} />\n </Box>\n )\n);\n\ndeclare module \"@mui/x-data-grid\" {\n export interface ToolbarPropsOverrides {\n mode: \"client\" | \"server\";\n isServerMode: boolean;\n actionButtons?: JSX.Element[];\n getData(): void;\n localeText?: GridLocaleText & {\n refreshTable: string;\n };\n }\n}\n"],"names":["QuickSearchToolbar","memo","mode","isServerMode","actionButtons","getData","localeText","quickFilterProps","jsxs","Box","jsx","AoaIconButton","RefreshIcon","button","GridToolbarQuickFilter"],"mappings":";;;;;;AAMO,MAAMA,IAAqBC;AAAA,EAChC,CAAC,EAAE,MAAAC,GAAM,cAAAC,GAAc,eAAAC,GA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,gBACzB,iBAAiB;AAAA,cACnB;AAAA,cAEA,wBAAwB;AAAA,gBACtB,SAAS;AAAA,cACX;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,MAEC,UAAA;AAAA,QAAgBC,KAAA,gBAAAO,EAACC,GAAc,EAAA,SAASN,GAAS,MAAO,gBAAAK,EAAAE,GAAA,CAAA,CAAY,GAAI,QAAON,KAAA,gBAAAA,EAAY,iBAAgB,gBAAiB,CAAA;AAAA,QAC5HF,KAAA,gBAAAA,EAAe,IAAI,CAACS,MAAwBA;AAAA,QAC7C,gBAAAH,EAACI,GAAwB,EAAA,GAAGP,GAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,EAChD;AAEJ;"}
1
+ {"version":3,"file":"_QuickSearchToolbar.js","sources":["../../../../src/components/atoms/table/_QuickSearchToolbar.tsx"],"sourcesContent":["import { Refresh as RefreshIcon } from \"@mui/icons-material\";\nimport { Box } from \"@mui/material\";\nimport { GridToolbarQuickFilter, type GridLocaleText, type GridToolbarProps, type ToolbarPropsOverrides } from \"@mui/x-data-grid\";\nimport { memo } from \"react\";\nimport { AoaIconButton } from \"../icon-button/IconButton\";\n\ndeclare module \"@mui/x-data-grid\" {\n export interface ToolbarPropsOverrides {\n actionButtons?: JSX.Element[];\n getData(this: void): void;\n isServerMode: boolean;\n localeText?: GridLocaleText & {\n refreshTable: string;\n };\n mode: \"client\" | \"server\";\n }\n}\n\nexport const QuickSearchToolbar = memo(\n ({ mode, isServerMode, actionButtons, getData, localeText, quickFilterProps }: GridToolbarProps & ToolbarPropsOverrides) => (\n <Box\n className={`${mode}-mode`}\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n paddingBottom: \"10px\",\n\n \"&.server-mode :nth-child(2)\": {\n marginLeft: \"auto\"\n },\n\n \".MuiButtonBase-root\": {\n width: \"48px\",\n marginRight: \"10px\"\n },\n\n \".MuiFormControl-root.MuiTextField-root\": {\n paddingBottom: 0,\n\n \".MuiInput-root\": {\n position: \"relative\",\n\n \":before, :after\": {\n borderBottom: \"transparent\"\n },\n\n \".MuiSvgIcon-root\": {\n position: \"absolute\",\n right: \"-1px\",\n width: \"24px\",\n height: \"24px\",\n padding: \"12px\",\n background: \"#007bc7\",\n color: \"#ffffff\",\n fontWeight: \"700\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n boxSizing: \"content-box\"\n },\n\n \".MuiInputBase-input\": {\n color: \"var(--color-text)\",\n fontFamily: \"RijksoverheidSansText, Verdana, Arial, sans-serif\",\n fontSize: \"1.125rem\",\n boxSizing: \"border-box\",\n flex: \"1 1\",\n height: \"48px\",\n margin: \"0\",\n padding: \"0 85px 0 14px\",\n background: \"var(--color-text-light)\",\n border: \"1px solid var(--color-rijks-grey-3)\",\n boxShadow: \"inset 1px 1px 3px hsl(0deg 0% 41% / 10%)\",\n lineHeight: \"1.5\",\n maxWidth: \"100%\",\n\n \":focus\": {\n borderColor: \"var(--color-rijks-skyblue)\",\n outline: \"0 !important\",\n boxShadow: `\n inset 1px 1px 3px hsl(0deg 0% 41% / 10%),\n inset 0 0 0 1px var(--color-rijks-skyblue),\n 0 0 5px rgb(0 115 191 / 50%);\n `\n }\n },\n\n \".MuiButtonBase-root\": {\n position: \"absolute\",\n right: \"48px\",\n height: \"24px\",\n width: \"24px\",\n marginRight: \"4px\",\n\n \".MuiSvgIcon-root\": {\n color: \"var(--color-primary)\",\n background: \"none\"\n },\n\n \":hover, :active, :focus\": {\n backgroundColor: \"transparent\"\n },\n\n \".MuiTouchRipple-root\": {\n display: \"none\"\n }\n }\n }\n }\n }}\n >\n {isServerMode && <AoaIconButton icon={<RefreshIcon />} label={localeText?.refreshTable ?? \"Ververs tabel\"} onClick={getData} />}\n {actionButtons?.map((button: JSX.Element) => button)}\n <GridToolbarQuickFilter {...quickFilterProps} />\n </Box>\n )\n);\n"],"names":["QuickSearchToolbar","memo","mode","isServerMode","actionButtons","getData","localeText","quickFilterProps","jsxs","Box","jsx","A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QAAQ;AAAA,cACR,OAAO;AAAA,cACP,aAAa;AAAA,cAEb,oBAAoB;AAAA,gBAClB,OAAO;AAAA,gBACP,YAAY;AAAA,cACd;AAAA,cAEA,2BAA2B;AAAA,gBACzB,iBAAiB;AAAA,cACnB;AAAA,cAEA,wBAAwB;AAAA,gBACtB,SAAS;AAAA,cAAA;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MAEJ;AAAA,MAEC,UAAA;AAAA,QAAgBC,KAAA,gBAAAO,EAACC,GAAc,EAAA,MAAO,gBAAAD,EAAAE,GAAA,CAAA,CAAY,GAAI,QAAON,KAAA,gBAAAA,EAAY,iBAAgB,iBAAiB,SAASD,EAAS,CAAA;AAAA,QAC5HD,KAAA,gBAAAA,EAAe,IAAI,CAACS,MAAwBA;AAAA,QAC7C,gBAAAH,EAACI,GAAwB,EAAA,GAAGP,EAAkB,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpD;"}
@@ -1,9 +1,9 @@
1
1
  import { TypographyProps } from '@mui/material';
2
2
  import { ReactNode } from 'react';
3
-
4
3
  /**
5
4
  * Inserts a Zero Width Space as a React component
6
- * @param props Props to pass to the Zero-Width Space component
5
+ *
6
+ * @param props - Props to pass to the Zero-Width Space component
7
7
  * @example
8
8
  * ```jsx
9
9
  * <AoaZeroWidthSpace />
@@ -1 +1 @@
1
- {"version":3,"file":"ZeroWidthSpace.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/zero-width-space/ZeroWidthSpace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7C;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,qEACG,eAAe,KAAG,SAAS,CAK3D,CAAC"}
1
+ {"version":3,"file":"ZeroWidthSpace.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/zero-width-space/ZeroWidthSpace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7C;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,qEACG,eAAe,KAAG,SAAS,CAK3D,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as p } from "react/jsx-runtime";
2
2
  import { Typography as t } from "@mui/material";
3
3
  import { memo as i } from "react";
4
4
  const n = i(
5
- ({ variant: o, style: r, ...m }) => /* @__PURE__ */ p(t, { ...m, variant: o ?? "caption", style: r, children: "​" })
5
+ ({ variant: o, style: r, ...m }) => /* @__PURE__ */ p(t, { ...m, style: r, variant: o ?? "caption", children: "​" })
6
6
  );
7
7
  export {
8
8
  n as AoaZeroWidthSpace
@@ -1 +1 @@
1
- {"version":3,"file":"ZeroWidthSpace.js","sources":["../../../../src/components/atoms/zero-width-space/ZeroWidthSpace.tsx"],"sourcesContent":["import { Typography, type TypographyProps } from \"@mui/material\";\nimport { memo, type ReactNode } from \"react\";\n\n/**\n * Inserts a Zero Width Space as a React component\n * @param props Props to pass to the Zero-Width Space component\n * @example\n * ```jsx\n * <AoaZeroWidthSpace />\n * ```\n */\nexport const AoaZeroWidthSpace = memo(\n ({ variant, style, ...props }: TypographyProps): ReactNode => (\n <Typography {...props} variant={variant ?? \"caption\"} style={style}>\n &#8203;\n </Typography>\n )\n);\n"],"names":["AoaZeroWidthSpace","memo","variant","style","props","jsx","Typography"],"mappings":";;;AAWO,MAAMA,IAAoBC;AAAA,EAC/B,CAAC,EAAE,SAAAC,GAAS,OAAAC,GAAO,GAAGC,EAAM,MACzB,gBAAAC,EAAAC,GAAA,EAAY,GAAGF,GAAO,SAASF,KAAW,WAAW,OAAAC,GAAc,UAEpE,KAAA;AAEJ;"}
1
+ {"version":3,"file":"ZeroWidthSpace.js","sources":["../../../../src/components/atoms/zero-width-space/ZeroWidthSpace.tsx"],"sourcesContent":["import { Typography, type TypographyProps } from \"@mui/material\";\nimport { memo, type ReactNode } from \"react\";\n\n/**\n * Inserts a Zero Width Space as a React component\n *\n * @param props - Props to pass to the Zero-Width Space component\n * @example\n * ```jsx\n * <AoaZeroWidthSpace />\n * ```\n */\nexport const AoaZeroWidthSpace = memo(\n ({ variant, style, ...props }: TypographyProps): ReactNode => (\n <Typography {...props} style={style} variant={variant ?? \"caption\"}>\n &#8203;\n </Typography>\n )\n);\n"],"names":["AoaZeroWidthSpace","memo","variant","style","props","jsx","Typography"],"mappings":";;;AAYO,MAAMA,IAAoBC;AAAA,EAC/B,CAAC,EAAE,SAAAC,GAAS,OAAAC,GAAO,GAAGC,EAAM,MACzB,gBAAAC,EAAAC,GAAA,EAAY,GAAGF,GAAO,OAAAD,GAAc,SAASD,KAAW,WAAW,UAEpE,IAAA,CAAA;AAEJ;"}
@@ -1,53 +1,77 @@
1
- import { NonNullObject } from '@sapphire/utilities';
2
1
  import { PropsWithChildren, ReactNode } from 'react';
3
2
  import { Accept } from 'react-dropzone';
4
-
5
- export type AoaDropableFile<TProps extends NonNullObject> = TProps & {
6
- /** The file that was dropped */
3
+ export type AoaDropableFile<TProps extends object> = TProps & {
4
+ /**
5
+ * The file that was dropped
6
+ */
7
7
  file: File;
8
8
  };
9
9
  export interface AoaFileDropzoneDataQas {
10
- /** The data-qa tag for the root element */
11
- root: string;
12
- /** The data-qa tag for the input */
10
+ /**
11
+ * The data-qa tag for the input
12
+ */
13
13
  input: string;
14
+ /**
15
+ * The data-qa tag for the root element
16
+ */
17
+ root: string;
14
18
  }
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 */
19
+ export interface AoaFileDropzoneProps<TProps extends object, TFile extends AoaDropableFile<TProps>> {
20
+ /**
21
+ * The current set of files that are already dropped, coming from Redux or Zustand
22
+ */
17
23
  currentFiles: TFile[];
18
24
  /**
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
25
+ * A custom function that can perform extra checks when validating files.
26
+ * This should return `true` if the file should be rejected or `false` if it should be accepted
27
+ *
28
+ * @param file - The file to be validated
29
+ */
30
+ customFileValidator?(file: File): boolean;
31
+ /**
32
+ * data-qa tags for testing
33
+ */
34
+ dataQas?: AoaFileDropzoneDataQas;
35
+ /**
36
+ * The regular expression that validates if the dropped file should be accepted or rejected
22
37
  */
23
- storeFiles(files: TFile[]): void;
24
- /** The regular expression that validates if the dropped file should be accepted or rejected */
25
38
  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 */
39
+ /**
40
+ * The toast warning message to be shown when a file is rejection
41
+ */
29
42
  extensionWarning: string;
30
43
  /**
31
- * The toast warning message to be shown when the files to be uploaded exceeds the maximum,
32
- * required if {@link AoaFileDropzoneProps.maxUploadFiles maxUploadFiles} is specified.
44
+ * The extension map to be passed to the dropzone component
45
+ */
46
+ extensions: Accept;
47
+ /**
48
+ * The children to show inside the box where files can be dropped
33
49
  */
34
- maxUploadSizeExceededWarning?: string;
35
- /** The children to show inside the box where files can be dropped */
36
50
  fileDropChildren?: ReactNode;
37
51
  /**
38
- * A custom function that can perform extra checks when validating files.
39
- * This should return `true` if the file should be rejected or `false` if it should be accepted
40
- * @param file - The file to be validated
52
+ * Whether the dropzone should be disabled or not
53
+ */
54
+ isDisabled?: boolean;
55
+ /**
56
+ * A maximum count of files that should be accepted, if exceeded no save action will be performed
41
57
  */
42
- customFileValidator?(file: File): boolean;
43
- /** A maximum count of files that should be accepted, if exceeded no save action will be performed */
44
58
  maxUploadFiles?: number;
45
- /** Additional properties to set for every file that is to be saved */
59
+ /**
60
+ * The toast warning message to be shown when the files to be uploaded exceeds the maximum,
61
+ * required if {@link AoaFileDropzoneProps.maxUploadFiles | maxUploadFiles} is specified.
62
+ */
63
+ maxUploadSizeExceededWarning?: string;
64
+ /**
65
+ * Additional properties to set for every file that is to be saved
66
+ */
46
67
  perFileProperties?(acceptedFile: File): TProps;
47
- /** Whether the dropzone should be disabled or not */
48
- isDisabled?: boolean;
49
- /** data-qa tags for testing */
50
- dataQas?: AoaFileDropzoneDataQas;
68
+ /**
69
+ * The function to overwrite the files in the client store.
70
+ * This should overwrite all files, not merge with current, which is handled in this component
71
+ *
72
+ * @param files - The new set of files to be stored
73
+ */
74
+ storeFiles(files: TFile[]): void;
51
75
  }
52
- export declare function AoaFileDropzone<TProps extends NonNullObject, TFile extends AoaDropableFile<TProps>>(props: Readonly<PropsWithChildren<AoaFileDropzoneProps<TProps, TFile>>>): import("react/jsx-runtime").JSX.Element;
76
+ export declare function AoaFileDropzone<TProps extends object, TFile extends AoaDropableFile<TProps>>(props: Readonly<PropsWithChildren<AoaFileDropzoneProps<TProps, TFile>>>): import("react/jsx-runtime").JSX.Element;
53
77
  //# sourceMappingURL=FileDropzone.d.ts.map