@rws-aoa/react-library 4.0.0 → 5.0.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.
Files changed (60) hide show
  1. package/dist/chunks/FieldError.DAUtZvvC.js +143 -0
  2. package/dist/chunks/FieldError.DAUtZvvC.js.map +1 -0
  3. package/dist/chunks/lodash.DOeeRDpT.js +3678 -0
  4. package/dist/chunks/lodash.DOeeRDpT.js.map +1 -0
  5. package/dist/components/atoms/_menu/menu-item/MenuItem.js +10 -10
  6. package/dist/components/atoms/_menu/menu-item/MenuItem.js.map +1 -1
  7. package/dist/components/atoms/_menu/user-menu/UserMenu.js +20 -20
  8. package/dist/components/atoms/_menu/user-menu/UserMenu.js.map +1 -1
  9. package/dist/components/atoms/button/Button.js +12 -12
  10. package/dist/components/atoms/button/Button.js.map +1 -1
  11. package/dist/components/atoms/icon-button/IconButton.js +4 -4
  12. package/dist/components/atoms/icon-button/IconButton.js.map +1 -1
  13. package/dist/components/atoms/input/Input.d.ts.map +1 -1
  14. package/dist/components/atoms/input/Input.js +4 -3
  15. package/dist/components/atoms/input/Input.js.map +1 -1
  16. package/dist/components/atoms/no-permission/NoPermission.js +9 -9
  17. package/dist/components/atoms/no-permission/NoPermission.js.map +1 -1
  18. package/dist/components/atoms/notification/Notification.js +10 -10
  19. package/dist/components/atoms/notification/Notification.js.map +1 -1
  20. package/dist/components/atoms/section-header/SectionHeader.js +12 -12
  21. package/dist/components/atoms/section-header/SectionHeader.js.map +1 -1
  22. package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js +8 -8
  23. package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js.map +1 -1
  24. package/dist/components/atoms/selection-buttons/radio-button/RadioButton.js +8 -8
  25. package/dist/components/atoms/selection-buttons/radio-button/RadioButton.js.map +1 -1
  26. package/dist/components/atoms/table/Table.d.ts.map +1 -1
  27. package/dist/components/atoms/table/Table.js +42 -44
  28. package/dist/components/atoms/table/Table.js.map +1 -1
  29. package/dist/components/atoms/table/_QuickSearchToolbar.d.ts.map +1 -1
  30. package/dist/components/atoms/table/_QuickSearchToolbar.js +1 -0
  31. package/dist/components/atoms/table/_QuickSearchToolbar.js.map +1 -1
  32. package/dist/components/molecules/field-error/FieldError.d.ts +22 -0
  33. package/dist/components/molecules/field-error/FieldError.d.ts.map +1 -0
  34. package/dist/components/molecules/field-error/FieldError.js +7 -0
  35. package/dist/components/molecules/field-error/FieldError.js.map +1 -0
  36. package/dist/components/molecules/form-error/FormError.d.ts +17 -4
  37. package/dist/components/molecules/form-error/FormError.d.ts.map +1 -1
  38. package/dist/components/molecules/form-error/FormError.js +4 -10
  39. package/dist/components/molecules/form-error/FormError.js.map +1 -1
  40. package/dist/components/molecules/form-modal/FormModal.d.ts +31 -34
  41. package/dist/components/molecules/form-modal/FormModal.d.ts.map +1 -1
  42. package/dist/components/molecules/form-modal/FormModal.js +7 -75
  43. package/dist/components/molecules/form-modal/FormModal.js.map +1 -1
  44. package/dist/components/molecules/modal/Modal.js +12 -12
  45. package/dist/components/molecules/modal/Modal.js.map +1 -1
  46. package/dist/components/molecules/navigation-bar/NavigationBar.js +21 -21
  47. package/dist/components/molecules/navigation-bar/NavigationBar.js.map +1 -1
  48. package/dist/components/molecules/upload-button/UploadButton.js +16 -16
  49. package/dist/components/molecules/upload-button/UploadButton.js.map +1 -1
  50. package/dist/contexts/TanstackFormContext.d.ts +29 -0
  51. package/dist/contexts/TanstackFormContext.d.ts.map +1 -0
  52. package/dist/contexts/TanstackFormContext.js +11 -0
  53. package/dist/contexts/TanstackFormContext.js.map +1 -0
  54. package/dist/index.d.ts +2 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +40 -34
  57. package/dist/index.js.map +1 -1
  58. package/package.json +41 -32
  59. package/dist/chunks/index.DJYQ_-zP.js +0 -489
  60. package/dist/chunks/index.DJYQ_-zP.js.map +0 -1
@@ -1,19 +1,19 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { CheckBoxOutlineBlank as t, CheckBox as l } from "@mui/icons-material";
3
- import { FormControlLabel as m, typographyClasses as i, Checkbox as c } from "@mui/material";
4
- import { m as a } from "../../../../chunks/index.DJYQ_-zP.js";
5
- import { memo as s } from "react";
3
+ import { FormControlLabel as i, typographyClasses as m, Checkbox as s } from "@mui/material";
4
+ import { l as a } from "../../../../chunks/lodash.DOeeRDpT.js";
5
+ import { memo as c } from "react";
6
6
  import { FontNormalSxProps as n } from "../../../../_constants.js";
7
- const k = s(({ label: e, ...r }) => /* @__PURE__ */ o(
8
- m,
7
+ const k = c(({ label: e, ...r }) => /* @__PURE__ */ o(
8
+ i,
9
9
  {
10
10
  control: /* @__PURE__ */ o(
11
- c,
11
+ s,
12
12
  {
13
13
  ...r,
14
14
  checkedIcon: /* @__PURE__ */ o(l, { color: "inherit", fontSize: "small" }),
15
15
  icon: /* @__PURE__ */ o(t, { color: "inherit", fontSize: "small" }),
16
- sx: a(
16
+ sx: a.merge(
17
17
  {
18
18
  color: "var(--color-primary)",
19
19
  ":focus": {
@@ -30,7 +30,7 @@ const k = s(({ label: e, ...r }) => /* @__PURE__ */ o(
30
30
  }
31
31
  ),
32
32
  label: e,
33
- sx: { [`.${i.root}`]: n }
33
+ sx: { [`.${m.root}`]: n }
34
34
  }
35
35
  ));
36
36
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../../../src/components/atoms/selection-buttons/checkbox/Checkbox.tsx"],"sourcesContent":["import { CheckBox as CheckBoxIcon, CheckBoxOutlineBlank as CheckBoxOutlineBlankIcon } from '@mui/icons-material';\nimport {\n Checkbox as MUICheckbox,\n FormControlLabel as MUIFormControlLabel,\n typographyClasses,\n type CheckboxProps as MUICheckboxProps\n} from '@mui/material';\nimport merge from 'lodash.merge';\nimport { memo, type ReactNode } from 'react';\nimport { FontNormalSxProps } from '../../../../_constants';\n\nexport interface AoaCheckboxProps extends Omit<MUICheckboxProps, 'checkedIcon' | 'icon'> {\n /**\n * Whether this checkbox is checked\n */\n readonly checked: boolean;\n /**\n * Data-qa tag for E2E test purposes\n */\n readonly 'data-qa'?: string;\n /**\n * The label that is shown after the checkbox\n */\n readonly label: string;\n}\n\n/**\n * Constructs a checkbox using pre-defined Rijks styling\n *\n * @param props - Props to pass to the checkbox\n * @example\n * ```jsx\n * <AoaCheckbox label=\"Demo checkbox\" checked={true} onChange={handleChange} />} />\n * ```\n */\n\nexport const AoaCheckbox = memo(({ label, ...props }: AoaCheckboxProps): ReactNode => {\n return (\n <MUIFormControlLabel\n control={\n <MUICheckbox\n {...props}\n checkedIcon={<CheckBoxIcon color='inherit' fontSize='small' />}\n icon={<CheckBoxOutlineBlankIcon color='inherit' fontSize='small' />}\n sx={merge(\n {\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 props.sx\n )}\n />\n }\n label={label}\n sx={{ [`.${typographyClasses.root}`]: FontNormalSxProps }}\n />\n );\n});\n"],"names":["AoaCheckbox","memo","label","props","jsx","MUIFormControlLabel","MUICheckbox","CheckBoxIcon","CheckBoxOutlineBlankIcon","merge","typographyClasses","FontNormalSxProps"],"mappings":";;;;;;AAoCO,MAAMA,IAAcC,EAAK,CAAC,EAAE,OAAAC,GAAO,GAAGC,QAEzC,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,SACE,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACE,GAAGH;AAAA,QACJ,aAAc,gBAAAC,EAAAG,GAAA,EAAa,OAAM,WAAU,UAAS,SAAQ;AAAA,QAC5D,MAAO,gBAAAH,EAAAI,GAAA,EAAyB,OAAM,WAAU,UAAS,SAAQ;AAAA,QACjE,IAAIC;AAAA,UACF;AAAA,YACE,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,UACAN,EAAM;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,IAEF,OAAAD;AAAA,IACA,IAAI,EAAE,CAAC,IAAIQ,EAAkB,IAAI,EAAE,GAAGC,EAAkB;AAAA,EAAA;AAC1D,CAEH;"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../../../src/components/atoms/selection-buttons/checkbox/Checkbox.tsx"],"sourcesContent":["import { CheckBox as CheckBoxIcon, CheckBoxOutlineBlank as CheckBoxOutlineBlankIcon } from '@mui/icons-material';\nimport {\n Checkbox as MUICheckbox,\n FormControlLabel as MUIFormControlLabel,\n typographyClasses,\n type CheckboxProps as MUICheckboxProps\n} from '@mui/material';\nimport { merge } from 'lodash';\nimport { memo, type ReactNode } from 'react';\nimport { FontNormalSxProps } from '../../../../_constants';\n\nexport interface AoaCheckboxProps extends Omit<MUICheckboxProps, 'checkedIcon' | 'icon'> {\n /**\n * Whether this checkbox is checked\n */\n readonly checked: boolean;\n /**\n * Data-qa tag for E2E test purposes\n */\n readonly 'data-qa'?: string;\n /**\n * The label that is shown after the checkbox\n */\n readonly label: string;\n}\n\n/**\n * Constructs a checkbox using pre-defined Rijks styling\n *\n * @param props - Props to pass to the checkbox\n * @example\n * ```jsx\n * <AoaCheckbox label=\"Demo checkbox\" checked={true} onChange={handleChange} />} />\n * ```\n */\n\nexport const AoaCheckbox = memo(({ label, ...props }: AoaCheckboxProps): ReactNode => {\n return (\n <MUIFormControlLabel\n control={\n <MUICheckbox\n {...props}\n checkedIcon={<CheckBoxIcon color='inherit' fontSize='small' />}\n icon={<CheckBoxOutlineBlankIcon color='inherit' fontSize='small' />}\n sx={merge(\n {\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 props.sx\n )}\n />\n }\n label={label}\n sx={{ [`.${typographyClasses.root}`]: FontNormalSxProps }}\n />\n );\n});\n"],"names":["AoaCheckbox","memo","label","props","jsx","MUIFormControlLabel","MUICheckbox","CheckBoxIcon","CheckBoxOutlineBlankIcon","merge","typographyClasses","FontNormalSxProps"],"mappings":";;;;;;AAoCO,MAAMA,IAAcC,EAAK,CAAC,EAAE,OAAAC,GAAO,GAAGC,QAEzC,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,SACE,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACE,GAAGH;AAAA,QACJ,aAAc,gBAAAC,EAAAG,GAAA,EAAa,OAAM,WAAU,UAAS,SAAQ;AAAA,QAC5D,MAAO,gBAAAH,EAAAI,GAAA,EAAyB,OAAM,WAAU,UAAS,SAAQ;AAAA,QACjE,IAAIC,EAAA;AAAA,UACF;AAAA,YACE,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,UACAN,EAAM;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,IAEF,OAAAD;AAAA,IACA,IAAI,EAAE,CAAC,IAAIQ,EAAkB,IAAI,EAAE,GAAGC,EAAkB;AAAA,EAAA;AAC1D,CAEH;"}
@@ -1,16 +1,16 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { FormControlLabel as m, typographyClasses as a, Radio as e } from "@mui/material";
3
- import { m as l } from "../../../../chunks/index.DJYQ_-zP.js";
4
- import { memo as s } from "react";
2
+ import { FormControlLabel as a, typographyClasses as l, Radio as m } from "@mui/material";
3
+ import { l as s } from "../../../../chunks/lodash.DOeeRDpT.js";
4
+ import { memo as e } from "react";
5
5
  import { FontNormalSxProps as i } from "../../../../_constants.js";
6
- const n = s(({ label: t, ...o }) => /* @__PURE__ */ r(
7
- m,
6
+ const n = e(({ label: t, ...o }) => /* @__PURE__ */ r(
7
+ a,
8
8
  {
9
9
  control: /* @__PURE__ */ r(
10
- e,
10
+ m,
11
11
  {
12
12
  ...o,
13
- sx: l(
13
+ sx: s.merge(
14
14
  {
15
15
  color: "var(--color-primary)",
16
16
  ":focus": {
@@ -26,7 +26,7 @@ const n = s(({ label: t, ...o }) => /* @__PURE__ */ r(
26
26
  }
27
27
  ),
28
28
  label: t,
29
- sx: { [`.${a.root}`]: i }
29
+ sx: { [`.${l.root}`]: i }
30
30
  }
31
31
  ));
32
32
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","sources":["../../../../../src/components/atoms/selection-buttons/radio-button/RadioButton.tsx"],"sourcesContent":["import {\n FormControlLabel as MUIFormControlLabel,\n Radio as MUIRadioButton,\n typographyClasses,\n type RadioProps as MUIRadioButtonProps\n} from '@mui/material';\nimport merge from 'lodash.merge';\nimport { memo, type ReactNode } from 'react';\nimport { FontNormalSxProps } from '../../../../_constants';\n\nexport interface AoaRadioButtonProps extends MUIRadioButtonProps {\n /**\n * Whether this radio button is checked\n */\n readonly checked: boolean;\n /**\n * Data-qa tag for E2E test purposes\n */\n readonly 'data-qa'?: string;\n /**\n * The label that is shown after the radio button\n */\n readonly label: string;\n}\n\n/**\n * Constructs a radio button using pre-defined Rijks styling\n *\n * @param props - Props to pass to the radio button\n * @example\n * ```jsx\n * <AoaRadioButton label=\"Demo radio button\" />} />\n * ```\n */\n\nexport const AoaRadioButton = memo(({ label, ...props }: AoaRadioButtonProps): ReactNode => {\n return (\n <MUIFormControlLabel\n control={\n <MUIRadioButton\n {...props}\n sx={merge(\n {\n color: 'var(--color-primary)',\n\n ':focus': {\n outline: '2px dashed var(--color-text)',\n outlineOffset: '-8px'\n },\n\n ':disabled': {\n color: 'var(--color-disabled)'\n }\n },\n props.sx\n )}\n />\n }\n label={label}\n sx={{ [`.${typographyClasses.root}`]: FontNormalSxProps }}\n />\n );\n});\n"],"names":["AoaRadioButton","memo","label","props","jsx","MUIFormControlLabel","MUIRadioButton","merge","typographyClasses","FontNormalSxProps"],"mappings":";;;;;AAmCO,MAAMA,IAAiBC,EAAK,CAAC,EAAE,OAAAC,GAAO,GAAGC,QAE5C,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,SACE,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACE,GAAGH;AAAA,QACJ,IAAII;AAAA,UACF;AAAA,YACE,OAAO;AAAA,YAEP,UAAU;AAAA,cACR,SAAS;AAAA,cACT,eAAe;AAAA,YACjB;AAAA,YAEA,aAAa;AAAA,cACX,OAAO;AAAA,YAAA;AAAA,UAEX;AAAA,UACAJ,EAAM;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,IAEF,OAAAD;AAAA,IACA,IAAI,EAAE,CAAC,IAAIM,EAAkB,IAAI,EAAE,GAAGC,EAAkB;AAAA,EAAA;AAC1D,CAEH;"}
1
+ {"version":3,"file":"RadioButton.js","sources":["../../../../../src/components/atoms/selection-buttons/radio-button/RadioButton.tsx"],"sourcesContent":["import {\n FormControlLabel as MUIFormControlLabel,\n Radio as MUIRadioButton,\n typographyClasses,\n type RadioProps as MUIRadioButtonProps\n} from '@mui/material';\nimport { merge } from 'lodash';\nimport { memo, type ReactNode } from 'react';\nimport { FontNormalSxProps } from '../../../../_constants';\n\nexport interface AoaRadioButtonProps extends MUIRadioButtonProps {\n /**\n * Whether this radio button is checked\n */\n readonly checked: boolean;\n /**\n * Data-qa tag for E2E test purposes\n */\n readonly 'data-qa'?: string;\n /**\n * The label that is shown after the radio button\n */\n readonly label: string;\n}\n\n/**\n * Constructs a radio button using pre-defined Rijks styling\n *\n * @param props - Props to pass to the radio button\n * @example\n * ```jsx\n * <AoaRadioButton label=\"Demo radio button\" />} />\n * ```\n */\n\nexport const AoaRadioButton = memo(({ label, ...props }: AoaRadioButtonProps): ReactNode => {\n return (\n <MUIFormControlLabel\n control={\n <MUIRadioButton\n {...props}\n sx={merge(\n {\n color: 'var(--color-primary)',\n\n ':focus': {\n outline: '2px dashed var(--color-text)',\n outlineOffset: '-8px'\n },\n\n ':disabled': {\n color: 'var(--color-disabled)'\n }\n },\n props.sx\n )}\n />\n }\n label={label}\n sx={{ [`.${typographyClasses.root}`]: FontNormalSxProps }}\n />\n );\n});\n"],"names":["AoaRadioButton","memo","label","props","jsx","MUIFormControlLabel","MUIRadioButton","merge","typographyClasses","FontNormalSxProps"],"mappings":";;;;;AAmCO,MAAMA,IAAiBC,EAAK,CAAC,EAAE,OAAAC,GAAO,GAAGC,QAE5C,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,SACE,gBAAAD;AAAA,MAACE;AAAAA,MAAA;AAAA,QACE,GAAGH;AAAA,QACJ,IAAII,EAAA;AAAA,UACF;AAAA,YACE,OAAO;AAAA,YAEP,UAAU;AAAA,cACR,SAAS;AAAA,cACT,eAAe;AAAA,YACjB;AAAA,YAEA,aAAa;AAAA,cACX,OAAO;AAAA,YAAA;AAAA,UAEX;AAAA,UACAJ,EAAM;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,IAEF,OAAAD;AAAA,IACA,IAAI,EAAE,CAAC,IAAIM,EAAkB,IAAI,EAAE,GAAGC,EAAkB;AAAA,EAAA;AAC1D,CAEH;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAM1B,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG;IAClD;;OAEG;IACH,KAAK,EAAE,CAAC,EAAE,CAAC;IACX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MA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
1
1
  import { jsx as F } from "react/jsx-runtime";
2
- import { checkboxClasses as f, paginationItemClasses as P } from "@mui/material";
3
- import { DataGrid as I, gridClasses as o } from "@mui/x-data-grid";
4
- import { m as T } from "../../../chunks/index.DJYQ_-zP.js";
5
- import { memo as j, useState as i, useCallback as h, useEffect as C } from "react";
2
+ import { checkboxClasses as h, paginationItemClasses as P } from "@mui/material";
3
+ import { DataGrid as p, gridClasses as o } from "@mui/x-data-grid";
4
+ import { l as T } from "../../../chunks/lodash.DOeeRDpT.js";
5
+ import { memo as j, useState as l, useCallback as f, useEffect as x } from "react";
6
6
  import { FontNormalSxProps as H } from "../../../_constants.js";
7
- import { QuickSearchToolbar as L } from "./_QuickSearchToolbar.js";
8
- function p(e) {
9
- var b, v, k;
10
- const [S, u] = i(!1), [n, x] = i({
7
+ import { QuickSearchToolbar as I } from "./_QuickSearchToolbar.js";
8
+ function L(e) {
9
+ var m, k, v;
10
+ const [C, u] = l(!1), [i, S] = l({
11
11
  page: 0,
12
12
  pageSize: 10
13
- }), [s, M] = i([]), [c, y] = i({
13
+ }), [n, M] = l([]), [s, y] = l({
14
14
  items: []
15
- }), l = e.mode ?? "server", d = l === "server", $ = h((t) => {
15
+ }), r = e.mode ?? "server", c = r === "server", $ = f((t) => {
16
16
  M(t);
17
- }, []), w = h((t) => {
17
+ }, []), w = f((t) => {
18
18
  y(t);
19
- }, []), [R, g] = i(((b = e.data) == null ? void 0 : b.totalItems) || 0);
20
- async function m(t, a, r) {
21
- if (d && e.getData) {
19
+ }, []), [R, g] = l(((m = e.data) == null ? void 0 : m.totalItems) || 0);
20
+ async function b(t, a, d) {
21
+ if (c && e.getData) {
22
22
  const D = async () => {
23
- await e.getData({ ...t, sortModel: a, filterModel: r });
23
+ await e.getData({ ...t, sortModel: a, filterModel: d });
24
24
  };
25
25
  u(!0), await D(), u(!1);
26
26
  }
27
27
  }
28
- return C(() => {
29
- g(
30
- (t) => {
31
- var a, r;
32
- return ((a = e.data) == null ? void 0 : a.totalItems) === void 0 ? t : (r = e.data) == null ? void 0 : r.totalItems;
33
- }
34
- );
35
- }, [(v = e.data) == null ? void 0 : v.totalItems, g]), C(() => {
36
- m(n, s, c);
37
- }, [n, s, c]), /* @__PURE__ */ F(
38
- I,
28
+ return x(() => {
29
+ g((t) => {
30
+ var a;
31
+ return ((a = e.data) == null ? void 0 : a.totalItems) ?? t;
32
+ });
33
+ }, [(k = e.data) == null ? void 0 : k.totalItems, g]), x(() => {
34
+ b(i, n, s);
35
+ }, [i, n, s]), /* @__PURE__ */ F(
36
+ p,
39
37
  {
40
38
  columns: e.columns,
41
39
  "data-qa": e["data-qa"],
@@ -45,14 +43,14 @@ function p(e) {
45
43
  disableDensitySelector: !0,
46
44
  disableRowSelectionOnClick: !0,
47
45
  disableVirtualization: !0,
48
- filterMode: l,
46
+ filterMode: r,
49
47
  getRowHeight: () => "auto",
50
48
  initialState: {
51
49
  sorting: {
52
50
  sortModel: e.initialSort ? [e.initialSort] : []
53
51
  }
54
52
  },
55
- loading: S,
53
+ loading: C,
56
54
  localeText: e.localeText ?? {
57
55
  columnHeaderSortIconLabel: "Sorteren",
58
56
  toolbarQuickFilterPlaceholder: "Zoeken...",
@@ -61,35 +59,35 @@ function p(e) {
61
59
  noRowsLabel: "Geen regels beschikbaar",
62
60
  noResultsOverlayLabel: "Geen regels gevonden.",
63
61
  MuiTablePagination: {
64
- labelDisplayedRows: ({ from: t, to: a, count: r }) => `${t} - ${a} van ${r}`,
62
+ labelDisplayedRows: ({ from: t, to: a, count: d }) => `${t} - ${a} van ${d}`,
65
63
  labelRowsPerPage: "Regels per pagina"
66
64
  },
67
65
  footerRowSelected: (t) => `${t} regels geselecteerd`
68
66
  },
69
67
  onFilterModelChange: w,
70
- onPaginationModelChange: x,
68
+ onPaginationModelChange: S,
71
69
  onSortModelChange: $,
72
70
  pageSizeOptions: [5, 10, 20, 40, 80],
73
- paginationMode: l,
74
- paginationModel: n,
75
- rowCount: d ? R : void 0,
76
- rows: (k = e.data) == null ? void 0 : k.items,
71
+ paginationMode: r,
72
+ paginationModel: i,
73
+ rowCount: c ? R : void 0,
74
+ rows: (v = e.data) == null ? void 0 : v.items,
77
75
  slotProps: {
78
76
  toolbar: {
79
77
  showQuickFilter: !0,
80
78
  quickFilterProps: { debounceMs: 500 },
81
- mode: l,
82
- isServerMode: d,
83
- getData: async () => m(n, s, c),
79
+ mode: r,
80
+ isServerMode: c,
81
+ getData: async () => b(i, n, s),
84
82
  actionButtons: e.actionButtons,
85
83
  localeText: e.localeText
86
84
  }
87
85
  },
88
86
  slots: {
89
- toolbar: L
87
+ toolbar: I
90
88
  },
91
- sortingMode: l,
92
- sx: T(
89
+ sortingMode: r,
90
+ sx: T.merge(
93
91
  {
94
92
  border: 0,
95
93
  color: "var(--color-text)",
@@ -145,7 +143,7 @@ function p(e) {
145
143
  [`.${P.root}`]: {
146
144
  borderRadius: 0
147
145
  },
148
- [`.${f.root}`]: {
146
+ [`.${h.root}`]: {
149
147
  color: "var(--color-primary)",
150
148
  ":focus": {
151
149
  outline: "2px dashed var(--color-text)",
@@ -156,7 +154,7 @@ function p(e) {
156
154
  color: "var(--color-disabled)"
157
155
  }
158
156
  },
159
- [`.${o.columnHeader} .${f.root}`]: {
157
+ [`.${o.columnHeader} .${h.root}`]: {
160
158
  color: "white"
161
159
  }
162
160
  },
@@ -167,8 +165,8 @@ function p(e) {
167
165
  }
168
166
  );
169
167
  }
170
- const N = j(p);
168
+ const E = j(L);
171
169
  export {
172
- N as AoaTable
170
+ E as AoaTable
173
171
  };
174
172
  //# sourceMappingURL=Table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../../src/components/atoms/table/Table.tsx"],"sourcesContent":["import { checkboxClasses, paginationItemClasses, type SxProps } from '@mui/material';\nimport {\n DataGrid,\n gridClasses,\n type DataGridProps,\n type GridColDef,\n type GridFilterModel,\n type GridLocaleText,\n type GridSortModel\n} 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'\n | 'getRowId'\n | 'ignoreDiacritics'\n | 'isRowSelectable'\n | 'loading'\n | 'onRowSelectionModelChange'\n | '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 async function 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\n setIsLoading(true);\n await fetchData();\n setIsLoading(false);\n }\n }\n\n useEffect(() => {\n setRowCountState((prevRowCountState) =>\n props.data?.totalItems === undefined ? prevRowCountState : props.data?.totalItems\n );\n }, [props.data?.totalItems, setRowCountState]);\n\n useEffect(() => {\n void getData(paginationModel, sortModel, filterModel);\n // ESLint tells us here that we should add the `getData` function, however,\n // doing so will cause the fetching to loop infinity until the JavaScript heap overflows.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [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 [`&.${gridClasses['root--densityCompact']}`]: {\n [`.${gridClasses.cell}`]: {\n py: '8px'\n }\n },\n [`&.${gridClasses['root--densityStandard']}`]: {\n [`.${gridClasses.cell}`]: {\n py: '15px'\n }\n },\n [`&.${gridClasses['root--densityComfortable']}`]: {\n [`.${gridClasses.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 [`.${gridClasses.virtualScroller}`]: {\n minHeight: '150px',\n overflow: 'hidden',\n position: 'relative'\n },\n\n [`.${gridClasses.columnHeaders}`]: {\n '--DataGrid-containerBackground': 'var(--color-rijks-skyblue)',\n backgroundCcolor: 'var(--color-rijks-skyblue)',\n color: 'var(--color-text-light)'\n },\n\n [`.${gridClasses.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 [`.${gridClasses.columnHeader}, .${gridClasses.cell}, .MuiDataGrid-columnsContainer`]: {\n borderRight: '1px solid var(--color-rijks-grey-2)'\n },\n\n [`.${gridClasses.cell}`]: {\n color: 'var(--color-text)'\n },\n\n [`.${paginationItemClasses.root}`]: {\n borderRadius: 0\n },\n\n [`.${checkboxClasses.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 [`.${gridClasses.columnHeader} .${checkboxClasses.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","gridClasses","paginationItemClasses","checkboxClasses","FontNormalSxProps","AoaTable","memo"],"mappings":";;;;;;;AAwHA,SAASA,EAA2CC,GAAyB;;AAC3E,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAiBC,CAAkB,IAAIF,EAA0B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;AAAA,UACT;AAAA,UAEA,CAAC,IAAIC,EAAsB,IAAI,EAAE,GAAG;AAAA,YAClC,cAAc;AAAA,UAChB;AAAA,UAEA,CAAC,IAAIC,EAAgB,IAAI,EAAE,GAAG;AAAA,YAC5B,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,CAAC,IAAIF,EAAY,YAAY,KAAKE,EAAgB,IAAI,EAAE,GAAG;AAAA,YACzD,OAAO;AAAA,UAAA;AAAA,QAEX;AAAA,QACAjC,EAAM;AAAA,QACNkC;AAAA,MACF;AAAA,MACC,GAAGlC,EAAM;AAAA,IAAA;AAAA,EACZ;AAEJ;AAEa,MAAAmC,IAAWC,EAAKrC,CAAkB;"}
1
+ {"version":3,"file":"Table.js","sources":["../../../../src/components/atoms/table/Table.tsx"],"sourcesContent":["import { checkboxClasses, paginationItemClasses, type SxProps } from '@mui/material';\nimport {\n DataGrid,\n gridClasses,\n type DataGridProps,\n type GridColDef,\n type GridFilterModel,\n type GridLocaleText,\n type GridSortModel\n} from '@mui/x-data-grid';\nimport { merge } from 'lodash';\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'\n | 'getRowId'\n | 'ignoreDiacritics'\n | 'isRowSelectable'\n | 'loading'\n | 'onRowSelectionModelChange'\n | '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 async function 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\n setIsLoading(true);\n await fetchData();\n setIsLoading(false);\n }\n }\n\n useEffect(() => {\n setRowCountState((prevRowCountState) => props.data?.totalItems ?? prevRowCountState);\n }, [props.data?.totalItems, setRowCountState]);\n\n useEffect(() => {\n void getData(paginationModel, sortModel, filterModel);\n // ESLint tells us here that we should add the `getData` function, however,\n // doing so will cause the fetching to loop infinity until the JavaScript heap overflows.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [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 [`&.${gridClasses['root--densityCompact']}`]: {\n [`.${gridClasses.cell}`]: {\n py: '8px'\n }\n },\n [`&.${gridClasses['root--densityStandard']}`]: {\n [`.${gridClasses.cell}`]: {\n py: '15px'\n }\n },\n [`&.${gridClasses['root--densityComfortable']}`]: {\n [`.${gridClasses.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 [`.${gridClasses.virtualScroller}`]: {\n minHeight: '150px',\n overflow: 'hidden',\n position: 'relative'\n },\n\n [`.${gridClasses.columnHeaders}`]: {\n '--DataGrid-containerBackground': 'var(--color-rijks-skyblue)',\n backgroundCcolor: 'var(--color-rijks-skyblue)',\n color: 'var(--color-text-light)'\n },\n\n [`.${gridClasses.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 [`.${gridClasses.columnHeader}, .${gridClasses.cell}, .MuiDataGrid-columnsContainer`]: {\n borderRight: '1px solid var(--color-rijks-grey-2)'\n },\n\n [`.${gridClasses.cell}`]: {\n color: 'var(--color-text)'\n },\n\n [`.${paginationItemClasses.root}`]: {\n borderRadius: 0\n },\n\n [`.${checkboxClasses.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 [`.${gridClasses.columnHeader} .${checkboxClasses.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","gridClasses","paginationItemClasses","checkboxClasses","FontNormalSxProps","AoaTable","memo"],"mappings":";;;;;;;AAwHA,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,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J;AAEa,MAAAmC,IAAWC,EAAKrC,CAAkB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"_QuickSearchToolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/table/_QuickSearchToolbar.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAC;AAI1B,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,qHAQ1B,gBAAgB,GAAG,qBAAqB,6CAmG5C,CAAC"}
1
+ {"version":3,"file":"_QuickSearchToolbar.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/table/_QuickSearchToolbar.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAC;AAI1B,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,qHAQ1B,gBAAgB,GAAG,qBAAqB,6CAoG5C,CAAC"}
@@ -21,6 +21,7 @@ const R = v(
21
21
  alignItems: "center",
22
22
  justifyContent: "flex-end",
23
23
  paddingBottom: "10px",
24
+ /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */
24
25
  "&.server-mode :nth-child(2)": {
25
26
  marginLeft: "auto"
26
27
  },
@@ -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 {\n Box,\n inputBaseClasses,\n inputClasses,\n formControlClasses,\n svgIconClasses,\n touchRippleClasses,\n textFieldClasses,\n buttonBaseClasses\n} from '@mui/material';\nimport {\n GridToolbarQuickFilter,\n type GridLocaleText,\n type GridToolbarProps,\n type ToolbarPropsOverrides\n} 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 ({\n mode,\n isServerMode,\n actionButtons,\n getData,\n localeText,\n quickFilterProps\n }: 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 [`.${buttonBaseClasses.root}`]: {\n width: '48px',\n marginRight: '10px'\n },\n\n [`.${formControlClasses.root}.${textFieldClasses.root}`]: {\n paddingBottom: 0,\n\n [`.${inputClasses.root}`]: {\n position: 'relative',\n\n ':before, :after': {\n borderBottom: 'transparent'\n },\n\n [`.${svgIconClasses.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 [`.${inputBaseClasses.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 [`.${buttonBaseClasses.root}`]: {\n position: 'absolute',\n right: '48px',\n height: '24px',\n width: '24px',\n marginRight: '4px',\n\n [`.${svgIconClasses.root}`]: {\n color: 'var(--color-primary)',\n background: 'none'\n },\n\n ':hover, :active, :focus': {\n backgroundColor: 'transparent'\n },\n\n [`.${touchRippleClasses.root}`]: {\n display: 'none'\n }\n }\n }\n }\n }}\n >\n {isServerMode && (\n <AoaIconButton icon={<RefreshIcon />} label={localeText?.refreshTable ?? 'Ververs tabel'} onClick={getData} />\n )}\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","buttonBaseClasses","formControlClasses","textFieldClasses","inputClasses","svgIconClasses","inputBaseClasses","touchRippleClasses","jsx","AoaIconButton","RefreshIcon","button","GridToolbarQuickFilter"],"mappings":";;;;;;AAgCO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,aAAa;AAAA,gBACb,SAAS;AAAA,gBACT,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA;AAAA,YAMf;AAAA,YAEA,CAAC,IAAIL,EAAkB,IAAI,EAAE,GAAG;AAAA,cAC9B,UAAU;AAAA,cACV,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,OAAO;AAAA,cACP,aAAa;AAAA,cAEb,CAAC,IAAII,EAAe,IAAI,EAAE,GAAG;AAAA,gBAC3B,OAAO;AAAA,gBACP,YAAY;AAAA,cACd;AAAA,cAEA,2BAA2B;AAAA,gBACzB,iBAAiB;AAAA,cACnB;AAAA,cAEA,CAAC,IAAIE,EAAmB,IAAI,EAAE,GAAG;AAAA,gBAC/B,SAAS;AAAA,cAAA;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MAEJ;AAAA,MAEC,UAAA;AAAA,QACCb,KAAA,gBAAAc,EAACC,GAAc,EAAA,MAAO,gBAAAD,EAAAE,GAAA,CAAA,CAAY,GAAI,QAAOb,KAAA,gBAAAA,EAAY,iBAAgB,iBAAiB,SAASD,EAAS,CAAA;AAAA,QAE7GD,KAAA,gBAAAA,EAAe,IAAI,CAACgB,MAAwBA;AAAA,QAC7C,gBAAAH,EAACI,GAAwB,EAAA,GAAGd,EAAkB,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpD;"}
1
+ {"version":3,"file":"_QuickSearchToolbar.js","sources":["../../../../src/components/atoms/table/_QuickSearchToolbar.tsx"],"sourcesContent":["import { Refresh as RefreshIcon } from '@mui/icons-material';\nimport {\n Box,\n inputBaseClasses,\n inputClasses,\n formControlClasses,\n svgIconClasses,\n touchRippleClasses,\n textFieldClasses,\n buttonBaseClasses\n} from '@mui/material';\nimport {\n GridToolbarQuickFilter,\n type GridLocaleText,\n type GridToolbarProps,\n type ToolbarPropsOverrides\n} 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 ({\n mode,\n isServerMode,\n actionButtons,\n getData,\n localeText,\n quickFilterProps\n }: 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 /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */\n '&.server-mode :nth-child(2)': {\n marginLeft: 'auto'\n },\n\n [`.${buttonBaseClasses.root}`]: {\n width: '48px',\n marginRight: '10px'\n },\n\n [`.${formControlClasses.root}.${textFieldClasses.root}`]: {\n paddingBottom: 0,\n\n [`.${inputClasses.root}`]: {\n position: 'relative',\n\n ':before, :after': {\n borderBottom: 'transparent'\n },\n\n [`.${svgIconClasses.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 [`.${inputBaseClasses.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 [`.${buttonBaseClasses.root}`]: {\n position: 'absolute',\n right: '48px',\n height: '24px',\n width: '24px',\n marginRight: '4px',\n\n [`.${svgIconClasses.root}`]: {\n color: 'var(--color-primary)',\n background: 'none'\n },\n\n ':hover, :active, :focus': {\n backgroundColor: 'transparent'\n },\n\n [`.${touchRippleClasses.root}`]: {\n display: 'none'\n }\n }\n }\n }\n }}\n >\n {isServerMode && (\n <AoaIconButton icon={<RefreshIcon />} label={localeText?.refreshTable ?? 'Ververs tabel'} onClick={getData} />\n )}\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","buttonBaseClasses","formControlClasses","textFieldClasses","inputClasses","svgIconClasses","inputBaseClasses","touchRippleClasses","jsx","AoaIconButton","RefreshIcon","button","GridToolbarQuickFilter"],"mappings":";;;;;;AAgCO,MAAMA,IAAqBC;AAAA,EAChC,CAAC;AAAA,IACC,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC;AAAA,IACA,kBAAAC;AAAA,EAAA,MAEA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAW,GAAGP,CAAI;AAAA,MAClB,IAAI;AAAA,QACF,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,gBAAgB;AAAA,QAChB,eAAe;AAAA;AAAA,QAGf,+BAA+B;AAAA,UAC7B,YAAY;AAAA,QACd;AAAA,QAEA,CAAC,IAAIQ,EAAkB,IAAI,EAAE,GAAG;AAAA,UAC9B,OAAO;AAAA,UACP,aAAa;AAAA,QACf;AAAA,QAEA,CAAC,IAAIC,EAAmB,IAAI,IAAIC,EAAiB,IAAI,EAAE,GAAG;AAAA,UACxD,eAAe;AAAA,UAEf,CAAC,IAAIC,EAAa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AD,EAAAE,GAAA,CAAA,CAAY,GAAI,QAAOb,KAAA,gBAAAA,EAAY,iBAAgB,iBAAiB,SAASD,EAAS,CAAA;AAAA,QAE7GD,KAAA,gBAAAA,EAAe,IAAI,CAACgB,MAAwBA;AAAA,QAC7C,gBAAAH,EAACI,GAAwB,EAAA,GAAGd,EAAkB,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpD;"}
@@ -0,0 +1,22 @@
1
+ export interface AoaFieldErrorProps {
2
+ readonly 'data-qa'?: string;
3
+ }
4
+ /**
5
+ * Constructs a custom error message for a field **using pre-defined Rijks styling**
6
+ *
7
+ * This component is intended for internal use only and should always be used through `<field.AoaFieldError />`
8
+ *
9
+ * @internal
10
+ * @param param0 - Props to pass to the field error
11
+ * @returns A custom error message for a field
12
+ * @example
13
+ * ```jsx
14
+ * <form.AppField name='name'>
15
+ * {(field) => {
16
+ * return <field.AoaFieldError />;
17
+ * }}
18
+ * </form.AppField>
19
+ * ```
20
+ */
21
+ export declare function AoaFieldError<TData>({ 'data-qa': dataQa }: AoaFieldErrorProps): import("react/jsx-runtime").JSX.Element | null;
22
+ //# sourceMappingURL=FieldError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldError.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/field-error/FieldError.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,kBAAkB,kDAiB7E"}
@@ -0,0 +1,7 @@
1
+ import "react/jsx-runtime";
2
+ import { A as p } from "../../../chunks/FieldError.DAUtZvvC.js";
3
+ import "../../atoms/notification/Notification.js";
4
+ export {
5
+ p as AoaFieldError
6
+ };
7
+ //# sourceMappingURL=FieldError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldError.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,7 +1,20 @@
1
- import { DeepKeys, DeepValue, FieldApi, Validator } from '@tanstack/react-form';
2
- export interface AoaFormErrorProps<TParentData, TName extends DeepKeys<TParentData>, TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined, TFormValidator extends Validator<TParentData, unknown> | undefined = undefined, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> {
1
+ export interface AoaFormErrorProps {
3
2
  readonly 'data-qa'?: string;
4
- readonly field: FieldApi<TParentData, TName, TFieldValidator, TFormValidator, TData>;
5
3
  }
6
- export declare function AoaFormError<TParentData, TName extends DeepKeys<TParentData>, TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined, TFormValidator extends Validator<TParentData, unknown> | undefined = undefined, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>>({ field, 'data-qa': dataQa }: AoaFormErrorProps<TParentData, TName, TFieldValidator, TFormValidator, TData>): import("react/jsx-runtime").JSX.Element | null;
4
+ /**
5
+ * Constructs a custom error message for a form **using pre-defined Rijks styling**
6
+ *
7
+ * This component is intended for internal use only and should always be used through `<form.AoaFormError />`
8
+ *
9
+ * @internal
10
+ * @param param0 - Props to pass to the form error
11
+ * @returns A custom error message for a form
12
+ * @example
13
+ * ```jsx
14
+ * <form.AppForm>
15
+ * <form.AoaFormError />
16
+ * </form.AppForm>
17
+ * ```
18
+ */
19
+ export declare function AoaFormError({ 'data-qa': dataQa }: AoaFormErrorProps): import("react/jsx-runtime").JSX.Element;
7
20
  //# sourceMappingURL=FormError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormError.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/form-error/FormError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGr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AAgB,YAAY,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,iBAAiB,2CAuBpE"}
@@ -1,13 +1,7 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { AoaNotification as s } from "../../atoms/notification/Notification.js";
3
- function i({ field: r, "data-qa": o }) {
4
- if (r.state.meta.isTouched && r.state.meta.errors.length) {
5
- const t = r.state.meta.errors.at(0), e = typeof t == "string" ? t : "";
6
- return e ? /* @__PURE__ */ a(s, { "data-qa": o ?? "form-error", message: e, severity: "error" }) : null;
7
- }
8
- return null;
9
- }
1
+ import "react/jsx-runtime";
2
+ import { a as p } from "../../../chunks/FieldError.DAUtZvvC.js";
3
+ import "../../atoms/notification/Notification.js";
10
4
  export {
11
- i as AoaFormError
5
+ p as AoaFormError
12
6
  };
13
7
  //# sourceMappingURL=FormError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormError.js","sources":["../../../../src/components/molecules/form-error/FormError.tsx"],"sourcesContent":["import type { DeepKeys, DeepValue, FieldApi, Validator } from '@tanstack/react-form';\nimport { AoaNotification } from '../../atoms/notification/Notification';\n\nexport interface AoaFormErrorProps<\n TParentData,\n TName extends DeepKeys<TParentData>,\n TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined,\n TFormValidator extends Validator<TParentData, unknown> | undefined = undefined,\n TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>\n> {\n readonly 'data-qa'?: string;\n readonly field: FieldApi<TParentData, TName, TFieldValidator, TFormValidator, TData>;\n}\n\nexport function AoaFormError<\n TParentData,\n TName extends DeepKeys<TParentData>,\n TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined,\n TFormValidator extends Validator<TParentData, unknown> | undefined = undefined,\n TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>\n>({ field, 'data-qa': dataQa }: AoaFormErrorProps<TParentData, TName, TFieldValidator, TFormValidator, TData>) {\n if (field.state.meta.isTouched && field.state.meta.errors.length) {\n const message = field.state.meta.errors.at(0);\n const stringMessage = typeof message === 'string' ? message : '';\n\n if (!stringMessage) return null;\n\n return <AoaNotification data-qa={dataQa ?? 'form-error'} message={stringMessage} severity='error' />;\n }\n\n return null;\n}\n"],"names":["AoaFormError","field","dataQa","message","stringMessage","jsx","AoaNotification"],"mappings":";;AAcO,SAASA,EAMd,EAAE,OAAAC,GAAO,WAAWC,KAAyF;AACzG,MAAAD,EAAM,MAAM,KAAK,aAAaA,EAAM,MAAM,KAAK,OAAO,QAAQ;AAChE,UAAME,IAAUF,EAAM,MAAM,KAAK,OAAO,GAAG,CAAC,GACtCG,IAAgB,OAAOD,KAAY,WAAWA,IAAU;AAE1D,WAACC,IAEE,gBAAAC,EAACC,KAAgB,WAASJ,KAAU,cAAc,SAASE,GAAe,UAAS,SAAQ,IAFvE;AAAA,EAEuE;AAG7F,SAAA;AACT;"}
1
+ {"version":3,"file":"FormError.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,4 +1,3 @@
1
- import { FormApi, Validator } from '@tanstack/react-form';
2
1
  import { AoaButtonProps } from '../../atoms/button/Button';
3
2
  import { AoaModalProps } from '../modal/Modal';
4
3
  import { AoaModalCloseButtonProps } from '../modal-close-button/ModalCloseButton';
@@ -28,15 +27,9 @@ export interface AoaFormModalProps extends Omit<AoaModalProps, 'dialogActions'>,
28
27
  /**
29
28
  * Additional properties to provide to the {@link AoaButton | submit button}
30
29
  */
31
- AoaSubmitButtonProps?: Omit<AoaButtonProps, 'buttonType' | 'data-qa' | 'onClick' | 'type'>;
32
- /**
33
- * The tanstack form instance
34
- *
35
- * @remarks
36
- * - The `any`'s here are intentional, otherwise type instantiation can become excessively deep and possibly infinite,
37
- * exact types are also not necessary here
38
- */
39
- form: FormApi<any, Validator<any>>;
30
+ AoaSubmitButtonProps?: Omit<AoaButtonProps, 'buttonType' | 'data-qa' | 'disabled' | 'onClick' | 'type'> & {
31
+ disableWithFormState?: boolean;
32
+ };
40
33
  /**
41
34
  * Labels for the buttons in {@link DialogActions}
42
35
  */
@@ -55,33 +48,37 @@ export interface AoaFormModalProps extends Omit<AoaModalProps, 'dialogActions'>,
55
48
  *
56
49
  * For a modal without a form see `AoaModal`
57
50
  *
51
+ * This component is intended for internal use only and should always be used through `<form.AoaFormModal />`
52
+ *
53
+ * @internal
58
54
  * @param props - Props to pass to the modal - {@link ModalProps}
59
55
  * @example
60
56
  * ```jsx
61
- * <AoaFormModal
62
- * open={true}
63
- * form={form}
64
- * formLabels={{
65
- * submit: 'submit',
66
- * cancel: 'cancel'
67
- * }}
68
- * formModalQas={{
69
- * cancelButton: 'cancel-button',
70
- * dialogActions: 'dialog-actions,
71
- * form: 'form',
72
- * submitButton: 'confirm-button'
73
- * }}
74
- * closeAction={handleClose}
75
- * topic='topic'
76
- * modalQas={{
77
- * modal: 'modal',
78
- * content: 'modal-content',
79
- * title: 'modal-title'
80
- * }}
81
- * formName='form'
82
- * dialogContent={content}
83
- * />
57
+ * <form.AppForm>
58
+ * <form.AoaFormModal
59
+ * open={true}
60
+ * formLabels={{
61
+ * submit: 'submit',
62
+ * cancel: 'cancel'
63
+ * }}
64
+ * formModalQas={{
65
+ * cancelButton: 'cancel-button',
66
+ * dialogActions: 'dialog-actions,
67
+ * form: 'form',
68
+ * submitButton: 'confirm-button'
69
+ * }}
70
+ * closeAction={handleClose}
71
+ * topic='topic'
72
+ * modalQas={{
73
+ * modal: 'modal',
74
+ * content: 'modal-content',
75
+ * title: 'modal-title'
76
+ * }}
77
+ * formName='form'
78
+ * dialogContent={content}
79
+ * />
80
+ * </form.AppForm>
84
81
  * ```
85
82
  */
86
- export declare function AoaFormModal({ form, formModalQas, formLabels, formName, DialogProps, DialogTitleProps, DialogContentProps, AoaSubmitButtonProps, modalQas, open, topic, dialogContent, closeAction }: Readonly<AoaFormModalProps>): import("react/jsx-runtime").JSX.Element;
83
+ export declare function AoaFormModal({ formModalQas, formLabels, formName, DialogProps, DialogTitleProps, DialogContentProps, AoaSubmitButtonProps: { disableWithFormState, ...AoaSubmitButtonProps }, modalQas, open, topic, dialogContent, closeAction }: Readonly<AoaFormModalProps>): import("react/jsx-runtime").JSX.Element;
87
84
  //# sourceMappingURL=FormModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormModal.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/form-modal/FormModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAE5G,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,EAAE,wBAAwB;IACvG;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC,CAAC;IAC3F;;;;;;OAMG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC;;OAEG;IACH,UAAU,EAAE,kBAAkB,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,aAAa,EACb,WAAW,EACZ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,2CAmD7B"}
1
+ {"version":3,"file":"FormModal.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/form-modal/FormModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAE5G,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,EAAE,wBAAwB;IACvG;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG;QACxG,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;IACF;;OAEG;IACH,UAAU,EAAE,kBAAkB,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC;I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