@rws-aoa/react-library 3.6.5 → 3.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_constants.js.map +1 -1
- package/dist/components/atoms/_menu/menu-item/MenuItem.d.ts.map +1 -1
- package/dist/components/atoms/_menu/menu-item/MenuItem.js +32 -26
- package/dist/components/atoms/_menu/menu-item/MenuItem.js.map +1 -1
- package/dist/components/atoms/_menu/user-menu/UserMenu.d.ts +1 -1
- package/dist/components/atoms/_menu/user-menu/UserMenu.d.ts.map +1 -1
- package/dist/components/atoms/_menu/user-menu/UserMenu.js +15 -14
- package/dist/components/atoms/_menu/user-menu/UserMenu.js.map +1 -1
- package/dist/components/atoms/button/Button.d.ts +4 -4
- package/dist/components/atoms/button/Button.d.ts.map +1 -1
- package/dist/components/atoms/button/Button.js +121 -119
- package/dist/components/atoms/button/Button.js.map +1 -1
- package/dist/components/atoms/icon-button/IconButton.d.ts +1 -1
- package/dist/components/atoms/icon-button/IconButton.d.ts.map +1 -1
- package/dist/components/atoms/icon-button/IconButton.js +6 -4
- package/dist/components/atoms/icon-button/IconButton.js.map +1 -1
- package/dist/components/atoms/input/Input.d.ts +2 -2
- package/dist/components/atoms/input/Input.js.map +1 -1
- package/dist/components/atoms/logo/Logo.d.ts +2 -2
- package/dist/components/atoms/logo/Logo.js.map +1 -1
- package/dist/components/atoms/no-permission/NoPermission.d.ts +1 -1
- package/dist/components/atoms/no-permission/NoPermission.js.map +1 -1
- package/dist/components/atoms/notification/Notification.d.ts +2 -2
- package/dist/components/atoms/notification/Notification.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Error.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Info.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Success.js.map +1 -1
- package/dist/components/atoms/notification/_icons/Warning.js.map +1 -1
- package/dist/components/atoms/section-header/SectionHeader.d.ts +2 -2
- package/dist/components/atoms/section-header/SectionHeader.d.ts.map +1 -1
- package/dist/components/atoms/section-header/SectionHeader.js +57 -35
- package/dist/components/atoms/section-header/SectionHeader.js.map +1 -1
- package/dist/components/atoms/selection-buttons/checkbox/Checkbox.d.ts +2 -2
- package/dist/components/atoms/selection-buttons/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js +3 -3
- package/dist/components/atoms/selection-buttons/checkbox/Checkbox.js.map +1 -1
- package/dist/components/atoms/selection-buttons/radio-button/RadioButton.d.ts +1 -1
- package/dist/components/atoms/selection-buttons/radio-button/RadioButton.d.ts.map +1 -1
- package/dist/components/atoms/selection-buttons/radio-button/RadioButton.js.map +1 -1
- package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.d.ts +1 -1
- package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.d.ts.map +1 -1
- package/dist/components/atoms/selection-buttons/switch-button/SwitchButton.js.map +1 -1
- package/dist/components/atoms/table/Table.d.ts +4 -4
- package/dist/components/atoms/table/Table.d.ts.map +1 -1
- package/dist/components/atoms/table/Table.js +13 -11
- package/dist/components/atoms/table/Table.js.map +1 -1
- package/dist/components/atoms/table/_QuickSearchToolbar.d.ts +2 -2
- package/dist/components/atoms/table/_QuickSearchToolbar.d.ts.map +1 -1
- package/dist/components/atoms/table/_QuickSearchToolbar.js +8 -1
- package/dist/components/atoms/table/_QuickSearchToolbar.js.map +1 -1
- package/dist/components/atoms/zero-width-space/ZeroWidthSpace.js.map +1 -1
- package/dist/components/molecules/file-dropzone/FileDropzone.d.ts.map +1 -1
- package/dist/components/molecules/file-dropzone/FileDropzone.js +24 -13
- package/dist/components/molecules/file-dropzone/FileDropzone.js.map +1 -1
- package/dist/components/molecules/file-table/FileTable.d.ts +4 -4
- package/dist/components/molecules/file-table/FileTable.js +17 -17
- package/dist/components/molecules/file-table/FileTable.js.map +1 -1
- package/dist/components/molecules/form-error/FormError.d.ts +2 -2
- package/dist/components/molecules/form-error/FormError.js.map +1 -1
- package/dist/components/molecules/form-modal/FormModal.d.ts +2 -2
- package/dist/components/molecules/form-modal/FormModal.d.ts.map +1 -1
- package/dist/components/molecules/form-modal/FormModal.js +10 -1
- package/dist/components/molecules/form-modal/FormModal.js.map +1 -1
- package/dist/components/molecules/modal/Modal.d.ts +1 -1
- package/dist/components/molecules/modal/Modal.d.ts.map +1 -1
- package/dist/components/molecules/modal/Modal.js.map +1 -1
- package/dist/components/molecules/modal-close-button/ModalCloseButton.js.map +1 -1
- package/dist/components/molecules/navigation-bar/NavigationBar.d.ts.map +1 -1
- package/dist/components/molecules/navigation-bar/NavigationBar.js +27 -16
- package/dist/components/molecules/navigation-bar/NavigationBar.js.map +1 -1
- package/dist/components/molecules/upload-button/UploadButton.d.ts +2 -2
- package/dist/components/molecules/upload-button/UploadButton.js +18 -18
- package/dist/components/molecules/upload-button/UploadButton.js.map +1 -1
- package/dist/components/organisms/content-page/ContentPage.d.ts +1 -1
- package/dist/components/organisms/content-page/ContentPage.d.ts.map +1 -1
- package/dist/components/organisms/content-page/ContentPage.js +6 -4
- package/dist/components/organisms/content-page/ContentPage.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +41 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDropzone.js","sources":["../../../../src/components/molecules/file-dropzone/FileDropzone.tsx"],"sourcesContent":["import { Box } from
|
|
1
|
+
{"version":3,"file":"FileDropzone.js","sources":["../../../../src/components/molecules/file-dropzone/FileDropzone.tsx"],"sourcesContent":["import { Box } from '@mui/material';\nimport { useCallback, type PropsWithChildren, type ReactNode } from 'react';\nimport { useDropzone, type Accept, type FileError, type FileRejection } from 'react-dropzone';\nimport { toast } from 'react-toastify';\nimport { isExtensionAllowed } from '../../../_constants';\n\nexport type AoaDropableFile<TProps extends object> = TProps & {\n /**\n * The file that was dropped\n */\n file: File;\n};\n\nexport interface AoaFileDropzoneDataQas {\n /**\n * The data-qa tag for the input\n */\n input: string;\n /**\n * The data-qa tag for the root element\n */\n root: string;\n}\n\nexport interface AoaFileDropzoneProps<TProps extends object, TFile extends AoaDropableFile<TProps>> {\n /**\n * The current set of files that are already dropped, coming from Redux or Zustand\n */\n currentFiles: TFile[];\n /**\n * A custom function that can perform extra checks when validating files.\n * This should return `true` if the file should be rejected or `false` if it should be accepted\n *\n * @param file - The file to be validated\n */\n customFileValidator?(file: File): boolean;\n /**\n * data-qa tags for testing\n */\n dataQas?: AoaFileDropzoneDataQas;\n /**\n * The regular expression that validates if the dropped file should be accepted or rejected\n */\n extensionRegex: RegExp;\n /**\n * The toast warning message to be shown when a file is rejection\n */\n extensionWarning: string;\n /**\n * The extension map to be passed to the dropzone component\n */\n extensions: Accept;\n /**\n * The children to show inside the box where files can be dropped\n */\n fileDropChildren?: ReactNode;\n /**\n * Whether the dropzone should be disabled or not\n */\n isDisabled?: boolean;\n /**\n * A maximum count of files that should be accepted, if exceeded no save action will be performed\n */\n maxUploadFiles?: number;\n /**\n * The toast warning message to be shown when the files to be uploaded exceeds the maximum,\n * required if {@link AoaFileDropzoneProps.maxUploadFiles | maxUploadFiles} is specified.\n */\n maxUploadSizeExceededWarning?: string;\n /**\n * Additional properties to set for every file that is to be saved\n */\n perFileProperties?(acceptedFile: File): TProps;\n /**\n * The function to overwrite the files in the client store.\n * This should overwrite all files, not merge with current, which is handled in this component\n *\n * @param files - The new set of files to be stored\n */\n storeFiles(files: TFile[]): void;\n}\n\nexport function AoaFileDropzone<TProps extends object, TFile extends AoaDropableFile<TProps>>(\n props: Readonly<PropsWithChildren<AoaFileDropzoneProps<TProps, TFile>>>\n) {\n const showMaxUploadFilesWarning = useCallback(() => {\n toast(\n props.maxUploadSizeExceededWarning ??\n `U heeft meer dan ${props.maxUploadFiles} bestand(en) geselecteerd. Dit is niet toegestaan.`,\n {\n type: 'warning'\n }\n );\n }, [props.maxUploadFiles, props.maxUploadSizeExceededWarning]);\n\n const handleDrop = useCallback(\n (acceptedFiles: File[], fileRejections: FileRejection[]) => {\n if (fileRejections.length > 0) {\n if (fileRejections.every((file) => file.errors.every((error) => error.code === 'too-many-files'))) {\n showMaxUploadFilesWarning();\n } else {\n toast(props.extensionWarning, { type: 'warning' });\n }\n }\n\n const filesClone = [...props.currentFiles];\n for (const acceptedFile of acceptedFiles) {\n const existingFileIndex = filesClone.findIndex((file) => file.file.name === acceptedFile.name);\n if (existingFileIndex === -1) {\n filesClone.push({ file: acceptedFile, ...props.perFileProperties?.(acceptedFile) } as TFile & TProps);\n } else {\n filesClone.splice(existingFileIndex, 1, {\n file: acceptedFile,\n ...props.perFileProperties?.(acceptedFile)\n } as TFile & TProps);\n }\n }\n\n if (props.maxUploadFiles && filesClone.length > props.maxUploadFiles) {\n showMaxUploadFilesWarning();\n } else {\n props.storeFiles(filesClone);\n }\n },\n [showMaxUploadFilesWarning, props]\n );\n\n function fileValidator(file: File): FileError | null {\n if (props.customFileValidator?.(file)) {\n return {\n code: 'custom-validator',\n message: props.extensionWarning\n };\n }\n\n if (isExtensionAllowed(props.extensionRegex, file.name)) {\n return null;\n }\n\n return {\n code: 'name-not-ok',\n message: props.extensionWarning\n };\n }\n\n const { getRootProps, getInputProps } = useDropzone({\n onDrop: handleDrop,\n disabled: props.isDisabled,\n accept: props.extensions,\n maxFiles: props.maxUploadFiles,\n validator: fileValidator\n });\n\n return (\n <Box\n {...getRootProps()}\n data-qa={props.dataQas?.root ?? 'file-dropzone-root'}\n sx={{\n '&:focus': {\n outline: 'none'\n }\n }}\n >\n <input\n {...getInputProps()}\n aria-label='File drop'\n data-qa={props.dataQas?.input ?? 'file-drop-input'}\n data-testid='file-drop-input'\n />\n <Box\n sx={{\n backgroundColor: 'var(--color-rijks-grey-2)',\n borderWidth: 1,\n borderStyle: 'dashed',\n borderColor: 'black',\n marginBottom: 0.5,\n textAlign: 'center'\n }}\n >\n {props.fileDropChildren}\n </Box>\n </Box>\n );\n}\n"],"names":["AoaFileDropzone","props","showMaxUploadFilesWarning","useCallback","toast","handleDrop","acceptedFiles","fileRejections","file","error","filesClone","acceptedFile","existingFileIndex","_a","_b","fileValidator","isExtensionAllowed","getRootProps","getInputProps","useDropzone","jsxs","Box","jsx"],"mappings":";;;;;;AAkFO,SAASA,EACdC,GACA;;AACM,QAAAC,IAA4BC,EAAY,MAAM;AAClD,IAAAC;AAAA,MACEH,EAAM,gCACJ,oBAAoBA,EAAM,cAAc;AAAA,MAC1C;AAAA,QACE,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,KACC,CAACA,EAAM,gBAAgBA,EAAM,4BAA4B,CAAC,GAEvDI,IAAaF;AAAA,IACjB,CAACG,GAAuBC,MAAoC;;AACtD,MAAAA,EAAe,SAAS,MACtBA,EAAe,MAAM,CAACC,MAASA,EAAK,OAAO,MAAM,CAACC,MAAUA,EAAM,SAAS,gBAAgB,CAAC,IACpEP,EAAA,IAE1BE,EAAMH,EAAM,kBAAkB,EAAE,MAAM,WAAW;AAIrD,YAAMS,IAAa,CAAC,GAAGT,EAAM,YAAY;AACzC,iBAAWU,KAAgBL,GAAe;AAClC,cAAAM,IAAoBF,EAAW,UAAU,CAACF,MAASA,EAAK,KAAK,SAASG,EAAa,IAAI;AAC7F,QAAIC,MAAsB,KACbF,EAAA,KAAK,EAAE,MAAMC,GAAc,IAAGE,IAAAZ,EAAM,sBAAN,gBAAAY,EAAA,KAAAZ,GAA0BU,IAAiC,IAEzFD,EAAA,OAAOE,GAAmB,GAAG;AAAA,UACtC,MAAMD;AAAA,UACN,IAAGG,IAAAb,EAAM,sBAAN,gBAAAa,EAAA,KAAAb,GAA0BU;AAAA,QAAY,CACxB;AAAA,MACrB;AAGF,MAAIV,EAAM,kBAAkBS,EAAW,SAAST,EAAM,iBAC1BC,EAAA,IAE1BD,EAAM,WAAWS,CAAU;AAAA,IAE/B;AAAA,IACA,CAACR,GAA2BD,CAAK;AAAA,EACnC;AAEA,WAASc,EAAcP,GAA8B;;AAC/C,YAAAK,IAAAZ,EAAM,wBAAN,QAAAY,EAAA,KAAAZ,GAA4BO,KACvB;AAAA,MACL,MAAM;AAAA,MACN,SAASP,EAAM;AAAA,IACjB,IAGEe,EAAmBf,EAAM,gBAAgBO,EAAK,IAAI,IAC7C,OAGF;AAAA,MACL,MAAM;AAAA,MACN,SAASP,EAAM;AAAA,IACjB;AAAA,EAAA;AAGF,QAAM,EAAE,cAAAgB,GAAc,eAAAC,EAAc,IAAIC,EAAY;AAAA,IAClD,QAAQd;AAAA,IACR,UAAUJ,EAAM;AAAA,IAChB,QAAQA,EAAM;AAAA,IACd,UAAUA,EAAM;AAAA,IAChB,WAAWc;AAAA,EAAA,CACZ;AAGC,SAAA,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGJ,EAAa;AAAA,MACjB,aAASJ,IAAAZ,EAAM,YAAN,gBAAAY,EAAe,SAAQ;AAAA,MAChC,IAAI;AAAA,QACF,WAAW;AAAA,UACT,SAAS;AAAA,QAAA;AAAA,MAEb;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAS;AAAA,UAAC;AAAA,UAAA;AAAA,YACE,GAAGJ,EAAc;AAAA,YAClB,cAAW;AAAA,YACX,aAASJ,IAAAb,EAAM,YAAN,gBAAAa,EAAe,UAAS;AAAA,YACjC,eAAY;AAAA,UAAA;AAAA,QACd;AAAA,QACA,gBAAAQ;AAAA,UAACD;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,cACF,iBAAiB;AAAA,cACjB,aAAa;AAAA,cACb,aAAa;AAAA,cACb,aAAa;AAAA,cACb,cAAc;AAAA,cACd,WAAW;AAAA,YACb;AAAA,YAEC,UAAMpB,EAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACT;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -11,18 +11,18 @@ export interface AoaFileTableProps<T extends GridValidRowModel = any> {
|
|
|
11
11
|
/**
|
|
12
12
|
* Data-qa tag for E2E test purposes
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
'data-qa'?: string;
|
|
15
15
|
/**
|
|
16
16
|
* Overwrite a safe selection of the {@link DataGrid} properties
|
|
17
17
|
*/
|
|
18
|
-
dataGridOverridableProps?: Pick<DataGridProps<T>,
|
|
18
|
+
dataGridOverridableProps?: Pick<DataGridProps<T>, 'getRowId' | 'ignoreDiacritics'>;
|
|
19
19
|
/**
|
|
20
20
|
* Sets the initial sortModel in case the required sorting differs from the back-end's default sorting
|
|
21
21
|
*/
|
|
22
22
|
initialSort?: {
|
|
23
23
|
field: string;
|
|
24
|
-
sort:
|
|
24
|
+
sort: 'asc' | 'desc';
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
export declare function AoaFileTable<T extends object = any>({ data, columns, initialSort, dataGridOverridableProps,
|
|
27
|
+
export declare function AoaFileTable<T extends object = any>({ data, columns, initialSort, dataGridOverridableProps, 'data-qa': dataQa }: Readonly<AoaFileTableProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
//# sourceMappingURL=FileTable.d.ts.map
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { AoaTable as
|
|
3
|
-
function
|
|
4
|
-
data:
|
|
5
|
-
columns:
|
|
6
|
-
initialSort:
|
|
7
|
-
dataGridOverridableProps:
|
|
8
|
-
"data-qa":
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { AoaTable as l } from "../../atoms/table/Table.js";
|
|
3
|
+
function f({
|
|
4
|
+
data: e,
|
|
5
|
+
columns: o,
|
|
6
|
+
initialSort: t,
|
|
7
|
+
dataGridOverridableProps: m,
|
|
8
|
+
"data-qa": r
|
|
9
9
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
|
|
10
|
+
return /* @__PURE__ */ i(
|
|
11
|
+
l,
|
|
12
12
|
{
|
|
13
|
-
columns:
|
|
13
|
+
columns: o,
|
|
14
14
|
data: {
|
|
15
|
-
items:
|
|
16
|
-
totalItems:
|
|
15
|
+
items: e ?? [],
|
|
16
|
+
totalItems: (e == null ? void 0 : e.length) ?? 0
|
|
17
17
|
},
|
|
18
|
-
"data-qa":
|
|
19
|
-
dataGridOverridableProps:
|
|
20
|
-
initialSort:
|
|
18
|
+
"data-qa": r,
|
|
19
|
+
dataGridOverridableProps: m,
|
|
20
|
+
initialSort: t,
|
|
21
21
|
mode: "client"
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
f as AoaFileTable
|
|
27
27
|
};
|
|
28
28
|
//# sourceMappingURL=FileTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileTable.js","sources":["../../../../src/components/molecules/file-table/FileTable.tsx"],"sourcesContent":["import type { DataGridProps, GridColDef, GridValidRowModel } from
|
|
1
|
+
{"version":3,"file":"FileTable.js","sources":["../../../../src/components/molecules/file-table/FileTable.tsx"],"sourcesContent":["import type { DataGridProps, GridColDef, GridValidRowModel } from '@mui/x-data-grid';\nimport { AoaTable } from '../../atoms/table/Table';\n\nexport interface AoaFileTableProps<T extends GridValidRowModel = any> {\n /**\n * The column structure to display the data\n */\n columns: GridColDef<T>[];\n /**\n * The TableData object to be displayed in the table\n */\n data: T[];\n /**\n * Data-qa tag for E2E test purposes\n */\n 'data-qa'?: string;\n /**\n * Overwrite a safe selection of the {@link DataGrid} properties\n */\n dataGridOverridableProps?: Pick<DataGridProps<T>, 'getRowId' | 'ignoreDiacritics'>;\n /**\n * Sets the initial sortModel in case the required sorting differs from the back-end's default sorting\n */\n initialSort?: {\n field: string;\n sort: 'asc' | 'desc';\n };\n}\n\nexport function AoaFileTable<T extends object = any>({\n data,\n columns,\n initialSort,\n dataGridOverridableProps,\n 'data-qa': dataQa\n}: Readonly<AoaFileTableProps<T>>) {\n return (\n <AoaTable<T>\n columns={columns}\n data={{\n items: data ?? [],\n totalItems: data?.length ?? 0\n }}\n data-qa={dataQa}\n dataGridOverridableProps={dataGridOverridableProps}\n initialSort={initialSort}\n mode='client'\n />\n );\n}\n"],"names":["AoaFileTable","data","columns","initialSort","dataGridOverridableProps","dataQa","jsx","AoaTable"],"mappings":";;AA6BO,SAASA,EAAqC;AAAA,EACnD,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,0BAAAC;AAAA,EACA,WAAWC;AACb,GAAmC;AAE/B,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAL;AAAA,MACA,MAAM;AAAA,QACJ,OAAOD,KAAQ,CAAC;AAAA,QAChB,aAAYA,KAAA,gBAAAA,EAAM,WAAU;AAAA,MAC9B;AAAA,MACA,WAASI;AAAA,MACT,0BAAAD;AAAA,MACA,aAAAD;AAAA,MACA,MAAK;AAAA,IAAA;AAAA,EACP;AAEJ;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DeepKeys, DeepValue, FieldApi, Validator } from '@tanstack/react-form';
|
|
2
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>> {
|
|
3
|
-
readonly
|
|
3
|
+
readonly 'data-qa'?: string;
|
|
4
4
|
readonly field: FieldApi<TParentData, TName, TFieldValidator, TFormValidator, TData>;
|
|
5
5
|
}
|
|
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,
|
|
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;
|
|
7
7
|
//# sourceMappingURL=FormError.d.ts.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
|
|
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;"}
|
|
@@ -24,11 +24,11 @@ export interface AoaFormModalLabels {
|
|
|
24
24
|
cancel: string;
|
|
25
25
|
submit: string;
|
|
26
26
|
}
|
|
27
|
-
export interface AoaFormModalProps extends Omit<AoaModalProps,
|
|
27
|
+
export interface AoaFormModalProps extends Omit<AoaModalProps, 'dialogActions'>, AoaModalCloseButtonProps {
|
|
28
28
|
/**
|
|
29
29
|
* Additional properties to provide to the {@link AoaButton | submit button}
|
|
30
30
|
*/
|
|
31
|
-
AoaSubmitButtonProps?: Omit<AoaButtonProps,
|
|
31
|
+
AoaSubmitButtonProps?: Omit<AoaButtonProps, 'buttonType' | 'data-qa' | 'onClick' | 'type'>;
|
|
32
32
|
/**
|
|
33
33
|
* The tanstack form instance
|
|
34
34
|
*
|
|
@@ -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,
|
|
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"}
|
|
@@ -56,7 +56,16 @@ function G({
|
|
|
56
56
|
children: p.cancel
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
/* @__PURE__ */ e(
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
q,
|
|
61
|
+
{
|
|
62
|
+
...B,
|
|
63
|
+
buttonType: "submit",
|
|
64
|
+
"data-qa": (t == null ? void 0 : t.submitButton) ?? "submit-form",
|
|
65
|
+
type: "primary",
|
|
66
|
+
children: p.submit
|
|
67
|
+
}
|
|
68
|
+
)
|
|
60
69
|
] })
|
|
61
70
|
]
|
|
62
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormModal.js","sources":["../../../../src/components/molecules/form-modal/FormModal.tsx"],"sourcesContent":["import { Dialog, DialogActions, DialogContent, DialogTitle } from
|
|
1
|
+
{"version":3,"file":"FormModal.js","sources":["../../../../src/components/molecules/form-modal/FormModal.tsx"],"sourcesContent":["import { Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material';\nimport type { FormApi, Validator } from '@tanstack/react-form';\nimport merge from 'lodash.merge';\nimport { AoaButton, type AoaButtonProps } from '../../atoms/button/Button';\nimport type { AoaModalProps } from '../modal/Modal';\nimport { AoaModalCloseButton, type AoaModalCloseButtonProps } from '../modal-close-button/ModalCloseButton';\n\nexport interface AoaFormModalQAs {\n /**\n * Data-qa tag applied to the \"cancel\" button\n */\n cancelButton?: string;\n /**\n * Data-qa tag applied to the `DialogActions` component\n */\n dialogActions?: string;\n /**\n * Data-qa tag applied to the HTML `form` element\n */\n form?: string;\n /**\n * Data-qa tag applied to the \"submit\" button\n */\n submitButton?: string;\n}\n\nexport interface AoaFormModalLabels {\n cancel: string;\n submit: string;\n}\n\nexport interface AoaFormModalProps extends Omit<AoaModalProps, 'dialogActions'>, AoaModalCloseButtonProps {\n /**\n * Additional properties to provide to the {@link AoaButton | submit button}\n */\n AoaSubmitButtonProps?: Omit<AoaButtonProps, 'buttonType' | 'data-qa' | 'onClick' | 'type'>;\n /**\n * The tanstack form instance\n *\n * @remarks\n * - The `any`'s here are intentional, otherwise type instantiation can become excessively deep and possibly infinite,\n * exact types are also not necessary here\n */\n form: FormApi<any, Validator<any>>;\n /**\n * Labels for the buttons in {@link DialogActions}\n */\n formLabels: AoaFormModalLabels;\n /**\n * data-qa tags for the components in the form section of the modal\n */\n formModalQas?: AoaFormModalQAs;\n /**\n * Optionally the `name` property for the HTML form element\n */\n formName?: string;\n}\n\n/**\n * Constructs a modal **for holding a Form** using pre-defined Rijks styling\n *\n * For a modal without a form see `AoaModal`\n *\n * @param props - Props to pass to the modal - {@link ModalProps}\n * @example\n * ```jsx\n * <AoaFormModal\n * open={true}\n * form={form}\n * formLabels={{\n * submit: 'submit',\n * cancel: 'cancel'\n * }}\n * formModalQas={{\n * cancelButton: 'cancel-button',\n * dialogActions: 'dialog-actions,\n * form: 'form',\n * submitButton: 'confirm-button'\n * }}\n * closeAction={handleClose}\n * topic='topic'\n * modalQas={{\n * modal: 'modal',\n * content: 'modal-content',\n * title: 'modal-title'\n * }}\n * formName='form'\n * dialogContent={content}\n * />\n * ```\n */\nexport function AoaFormModal({\n form,\n formModalQas,\n formLabels,\n formName,\n DialogProps,\n DialogTitleProps,\n DialogContentProps,\n AoaSubmitButtonProps,\n modalQas,\n open,\n topic,\n dialogContent,\n closeAction\n}: Readonly<AoaFormModalProps>) {\n return (\n <Dialog {...DialogProps} data-qa={modalQas?.modal ?? 'modal'} open={Boolean(open)}>\n <DialogTitle {...DialogTitleProps} data-qa={modalQas?.title ?? 'modal-title'} maxWidth='sm' sx={{ m: 0, p: 2 }}>\n {topic}\n </DialogTitle>\n <AoaModalCloseButton closeAction={closeAction} />\n <form\n data-qa={formModalQas?.form ?? 'form'}\n name={formName}\n onSubmit={async (event) => {\n event.preventDefault();\n event.stopPropagation();\n await form.handleSubmit();\n }}\n >\n <DialogContent\n {...DialogContentProps}\n data-qa={modalQas?.content ?? 'modal-content'}\n sx={merge(\n {\n padding: '0 3rem 2rem'\n },\n DialogContentProps?.sx\n )}\n >\n {dialogContent}\n </DialogContent>\n <DialogActions data-qa={formModalQas?.dialogActions ?? 'dialog-actions'}>\n <AoaButton\n data-qa={formModalQas?.cancelButton ?? 'cancel-form'}\n onClick={() => {\n form.reset();\n closeAction();\n }}\n type='secondary'\n >\n {formLabels.cancel}\n </AoaButton>\n <AoaButton\n {...AoaSubmitButtonProps}\n buttonType='submit'\n data-qa={formModalQas?.submitButton ?? 'submit-form'}\n type='primary'\n >\n {formLabels.submit}\n </AoaButton>\n </DialogActions>\n </form>\n </Dialog>\n );\n}\n"],"names":["AoaFormModal","form","formModalQas","formLabels","formName","DialogProps","DialogTitleProps","DialogContentProps","AoaSubmitButtonProps","modalQas","open","topic","dialogContent","closeAction","jsxs","Dialog","jsx","DialogTitle","AoaModalCloseButton","event","DialogContent","merge","DialogActions","AoaButton"],"mappings":";;;;;AA2FO,SAASA,EAAa;AAAA,EAC3B,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AACF,GAAgC;AAE5B,SAAA,gBAAAC,EAACC,GAAQ,EAAA,GAAGV,GAAa,YAASI,KAAA,gBAAAA,EAAU,UAAS,SAAS,MAAM,EAAQC,GAC1E,UAAA;AAAA,IAAA,gBAAAM,EAACC,KAAa,GAAGX,GAAkB,YAASG,KAAA,gBAAAA,EAAU,UAAS,eAAe,UAAS,MAAK,IAAI,EAAE,GAAG,GAAG,GAAG,KACxG,UACHE,GAAA;AAAA,IACA,gBAAAK,EAACE,KAAoB,aAAAL,GAA0B;AAAA,IAC/C,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,YAASZ,KAAA,gBAAAA,EAAc,SAAQ;AAAA,QAC/B,MAAME;AAAA,QACN,UAAU,OAAOe,MAAU;AACzB,UAAAA,EAAM,eAAe,GACrBA,EAAM,gBAAgB,GACtB,MAAMlB,EAAK,aAAa;AAAA,QAC1B;AAAA,QAEA,UAAA;AAAA,UAAA,gBAAAe;AAAA,YAACI;AAAA,YAAA;AAAA,cACE,GAAGb;AAAA,cACJ,YAASE,KAAA,gBAAAA,EAAU,YAAW;AAAA,cAC9B,IAAIY;AAAA,gBACF;AAAA,kBACE,SAAS;AAAA,gBACX;AAAA,gBACAd,KAAA,gBAAAA,EAAoB;AAAA,cACtB;AAAA,cAEC,UAAAK;AAAA,YAAA;AAAA,UACH;AAAA,UACC,gBAAAE,EAAAQ,GAAA,EAAc,YAASpB,KAAA,gBAAAA,EAAc,kBAAiB,kBACrD,UAAA;AAAA,YAAA,gBAAAc;AAAA,cAACO;AAAA,cAAA;AAAA,gBACC,YAASrB,KAAA,gBAAAA,EAAc,iBAAgB;AAAA,gBACvC,SAAS,MAAM;AACb,kBAAAD,EAAK,MAAM,GACCY,EAAA;AAAA,gBACd;AAAA,gBACA,MAAK;AAAA,gBAEJ,UAAWV,EAAA;AAAA,cAAA;AAAA,YACd;AAAA,YACA,gBAAAa;AAAA,cAACO;AAAA,cAAA;AAAA,gBACE,GAAGf;AAAA,gBACJ,YAAW;AAAA,gBACX,YAASN,KAAA,gBAAAA,EAAc,iBAAgB;AAAA,gBACvC,MAAK;AAAA,gBAEJ,UAAWC,EAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UACd,EACF,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -23,7 +23,7 @@ export interface AoaModalProps {
|
|
|
23
23
|
/**
|
|
24
24
|
* Any other props passed to the {@link Dialog}
|
|
25
25
|
*/
|
|
26
|
-
readonly DialogProps?: Omit<DialogProps,
|
|
26
|
+
readonly DialogProps?: Omit<DialogProps, 'open'>;
|
|
27
27
|
/**
|
|
28
28
|
* Any other props passed to the {@link DialogTitle}
|
|
29
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAE5G,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACjD;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACjD;;OAEG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAC7C;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,gKAWhB,wBAAwB,GAAG,aAAa,6CAgD5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../../src/components/molecules/modal/Modal.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Modal.js","sources":["../../../../src/components/molecules/modal/Modal.tsx"],"sourcesContent":["import {\n Dialog,\n DialogContent,\n DialogTitle,\n type DialogContentProps,\n type DialogProps,\n type DialogTitleProps\n} from '@mui/material';\nimport merge from 'lodash.merge';\nimport { memo, type ReactNode } from 'react';\nimport { AoaModalCloseButton, type AoaModalCloseButtonProps } from '../modal-close-button/ModalCloseButton';\n\nexport interface AoaModalQAs {\n /**\n * Data-qa tag applied to the content\n */\n content?: string;\n /**\n * Data-qa tag applied to the main modal\n */\n modal?: string;\n /**\n * Data-qa tag applied to the title\n */\n title?: string;\n}\n\nexport interface AoaModalProps {\n /**\n * Any other props passed to the {@link DialogContent}\n */\n readonly DialogContentProps?: DialogContentProps;\n /**\n * Any other props passed to the {@link Dialog}\n */\n readonly DialogProps?: Omit<DialogProps, 'open'>;\n /**\n * Any other props passed to the {@link DialogTitle}\n */\n readonly DialogTitleProps?: DialogTitleProps;\n /**\n * Optional for adding dialog actions below the content\n */\n readonly dialogActions?: ReactNode;\n /**\n * The content to show in the modal\n */\n readonly dialogContent: ReactNode;\n /**\n * Object of data-qa tags to pass to the modal\n */\n readonly modalQas?: AoaModalQAs;\n /**\n * Whether the modal should be opened or not\n */\n readonly open: boolean;\n /**\n * Title for the modal\n */\n readonly topic: string;\n}\n\n/**\n * Constructs a modal using pre-defined Rijkswaterstaat styling\n *\n * @param props - Props to pass to the modal - {@link ModalProps}\n * @example\n * ```jsx\n * <AoaModal\n * topic='topic'\n * modalQas={{\n * modal: 'modal',\n * content: 'content',\n * title: 'title',\n * }}\n * dialogContent={<div>SAMPLE</div>}\n * open={true}\n * />\n * ```\n */\nexport const AoaModal = memo(\n ({\n DialogProps,\n DialogTitleProps,\n DialogContentProps,\n modalQas,\n open,\n topic,\n dialogContent,\n dialogActions,\n closeAction\n }: AoaModalCloseButtonProps & AoaModalProps) => {\n return (\n <Dialog\n {...DialogProps}\n data-qa={modalQas?.modal ?? 'modal'}\n open={Boolean(open)}\n sx={merge(\n {\n '> div > div': {\n borderRadius: 0,\n minWidth: '45vw'\n }\n },\n DialogProps?.sx\n )}\n >\n <DialogTitle\n {...DialogTitleProps}\n data-qa={modalQas?.title ?? 'modal-title'}\n sx={merge(\n {\n padding: '3rem 3rem 1rem',\n color: 'var(--color-rijks-logoblue)',\n fontSize: '1.1rem',\n fontWeight: 'bolder'\n },\n DialogTitleProps?.sx\n )}\n >\n {topic}\n </DialogTitle>\n <AoaModalCloseButton closeAction={closeAction} />\n <DialogContent\n {...DialogContentProps}\n data-qa={modalQas?.content ?? 'modal-content'}\n sx={merge(\n {\n padding: '0 3rem 2rem'\n },\n DialogContentProps?.sx\n )}\n >\n {dialogContent}\n </DialogContent>\n {dialogActions}\n </Dialog>\n );\n }\n);\n"],"names":["AoaModal","memo","DialogProps","DialogTitleProps","DialogContentProps","modalQas","open","topic","dialogContent","dialogActions","closeAction","jsxs","Dialog","merge","jsx","DialogTitle","AoaModalCloseButton","DialogContent"],"mappings":";;;;;AAgFO,MAAMA,IAAWC;AAAA,EACtB,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,MAGE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGV;AAAA,MACJ,YAASG,KAAA,gBAAAA,EAAU,UAAS;AAAA,MAC5B,MAAM,EAAQC;AAAA,MACd,IAAIO;AAAA,QACF;AAAA,UACE,eAAe;AAAA,YACb,cAAc;AAAA,YACd,UAAU;AAAA,UAAA;AAAA,QAEd;AAAA,QACAX,KAAA,gBAAAA,EAAa;AAAA,MACf;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAY;AAAA,UAACC;AAAA,UAAA;AAAA,YACE,GAAGZ;AAAA,YACJ,YAASE,KAAA,gBAAAA,EAAU,UAAS;AAAA,YAC5B,IAAIQ;AAAA,cACF;AAAA,gBACE,SAAS;AAAA,gBACT,OAAO;AAAA,gBACP,UAAU;AAAA,gBACV,YAAY;AAAA,cACd;AAAA,cACAV,KAAA,gBAAAA,EAAkB;AAAA,YACpB;AAAA,YAEC,UAAAI;AAAA,UAAA;AAAA,QACH;AAAA,QACA,gBAAAO,EAACE,KAAoB,aAAAN,GAA0B;AAAA,QAC/C,gBAAAI;AAAA,UAACG;AAAA,UAAA;AAAA,YACE,GAAGb;AAAA,YACJ,YAASC,KAAA,gBAAAA,EAAU,YAAW;AAAA,YAC9B,IAAIQ;AAAA,cACF;AAAA,gBACE,SAAS;AAAA,cACX;AAAA,cACAT,KAAA,gBAAAA,EAAoB;AAAA,YACtB;AAAA,YAEC,UAAAI;AAAA,UAAA;AAAA,QACH;AAAA,QACCC;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AAGN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalCloseButton.js","sources":["../../../../src/components/molecules/modal-close-button/ModalCloseButton.tsx"],"sourcesContent":["import { Close as CloseIcon } from
|
|
1
|
+
{"version":3,"file":"ModalCloseButton.js","sources":["../../../../src/components/molecules/modal-close-button/ModalCloseButton.tsx"],"sourcesContent":["import { Close as CloseIcon } from '@mui/icons-material';\nimport { memo } from 'react';\nimport { AoaIconButton } from '../../atoms/icon-button/IconButton';\n\nexport interface AoaModalCloseButtonProps {\n /**\n * The action to trigger to close this modal\n */\n closeAction(this: void): void;\n}\n\nexport const AoaModalCloseButton = memo(({ closeAction }: AoaModalCloseButtonProps) => (\n <AoaIconButton\n icon={<CloseIcon />}\n inline\n label='Modaal sluiten'\n onClick={closeAction}\n sx={{\n position: 'absolute',\n right: 8,\n top: 8\n }}\n />\n));\n"],"names":["AoaModalCloseButton","memo","closeAction","jsx","AoaIconButton","CloseIcon"],"mappings":";;;;AAWO,MAAMA,IAAsBC,EAAK,CAAC,EAAE,aAAAC,EACzC,MAAA,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,wBAAOC,GAAU,EAAA;AAAA,IACjB,QAAM;AAAA,IACN,OAAM;AAAA,IACN,SAASH;AAAA,IACT,IAAI;AAAA,MACF,UAAU;AAAA,MACV,OAAO;AAAA,MACP,KAAK;AAAA,IAAA;AAAA,EACP;AACF,CACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationBar.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/navigation-bar/NavigationBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAEpF,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,eAAO,MAAM,gBAAgB,8CAAgB,qBAAqB,KAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"NavigationBar.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/navigation-bar/NavigationBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAEpF,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,eAAO,MAAM,gBAAgB,8CAAgB,qBAAqB,KAAG,SAAS,CAiG5E,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { AppBar as
|
|
1
|
+
import { jsx as e, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { AppBar as c, Toolbar as n, Box as d } from "@mui/material";
|
|
3
3
|
import { m } from "../../../chunks/index.DJYQ_-zP.js";
|
|
4
4
|
import { memo as g, useState as u, useEffect as s } from "react";
|
|
5
|
-
import { FontNormalSxProps as
|
|
5
|
+
import { FontNormalSxProps as x } from "../../../_constants.js";
|
|
6
6
|
import { AoaMenuItem as l } from "../../atoms/_menu/menu-item/MenuItem.js";
|
|
7
|
-
import { AoaUserMenu as
|
|
8
|
-
const
|
|
9
|
-
const [
|
|
7
|
+
import { AoaUserMenu as w } from "../../atoms/_menu/user-menu/UserMenu.js";
|
|
8
|
+
const I = g((r) => {
|
|
9
|
+
const [o, a] = u(0);
|
|
10
10
|
return s(() => {
|
|
11
11
|
const t = window.sessionStorage.getItem("activeMenuTab");
|
|
12
12
|
t && a(JSON.parse(t));
|
|
13
13
|
}, []), s(() => {
|
|
14
|
-
window.sessionStorage.setItem("activeMenuTab",
|
|
15
|
-
}, [
|
|
16
|
-
|
|
14
|
+
window.sessionStorage.setItem("activeMenuTab", o.toString());
|
|
15
|
+
}, [o]), /* @__PURE__ */ e(
|
|
16
|
+
c,
|
|
17
17
|
{
|
|
18
18
|
position: "static",
|
|
19
19
|
sx: m(
|
|
@@ -23,11 +23,12 @@ const M = g((r) => {
|
|
|
23
23
|
height: "70px",
|
|
24
24
|
boxShadow: "none"
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
x
|
|
27
27
|
),
|
|
28
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ b(
|
|
29
29
|
n,
|
|
30
30
|
{
|
|
31
|
+
role: "menu",
|
|
31
32
|
sx: {
|
|
32
33
|
height: "100%",
|
|
33
34
|
overflowX: "scroll",
|
|
@@ -66,18 +67,28 @@ const M = g((r) => {
|
|
|
66
67
|
"-webkit-border-radius": "100px"
|
|
67
68
|
}
|
|
68
69
|
},
|
|
70
|
+
tabIndex: 0,
|
|
69
71
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ e(
|
|
71
73
|
l,
|
|
72
74
|
{
|
|
73
75
|
index: 0,
|
|
74
76
|
page: { label: r.name, to: r.homePath ?? "/" },
|
|
75
|
-
selectedPage:
|
|
77
|
+
selectedPage: o,
|
|
76
78
|
setSelectedPage: a
|
|
77
79
|
}
|
|
78
80
|
),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
81
|
+
/* @__PURE__ */ e(d, { sx: { flexGrow: 1, display: "flex", height: "100%" }, children: r.pages.map((t, i) => /* @__PURE__ */ e(
|
|
82
|
+
l,
|
|
83
|
+
{
|
|
84
|
+
index: i + 1,
|
|
85
|
+
page: t,
|
|
86
|
+
selectedPage: o,
|
|
87
|
+
setSelectedPage: a
|
|
88
|
+
},
|
|
89
|
+
i
|
|
90
|
+
)) }),
|
|
91
|
+
/* @__PURE__ */ e(w, { settings: r.settings, username: r.username })
|
|
81
92
|
]
|
|
82
93
|
}
|
|
83
94
|
)
|
|
@@ -85,6 +96,6 @@ const M = g((r) => {
|
|
|
85
96
|
);
|
|
86
97
|
});
|
|
87
98
|
export {
|
|
88
|
-
|
|
99
|
+
I as AoaNavigationBar
|
|
89
100
|
};
|
|
90
101
|
//# sourceMappingURL=NavigationBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationBar.js","sources":["../../../../src/components/molecules/navigation-bar/NavigationBar.tsx"],"sourcesContent":["import { AppBar, Box, Toolbar } from
|
|
1
|
+
{"version":3,"file":"NavigationBar.js","sources":["../../../../src/components/molecules/navigation-bar/NavigationBar.tsx"],"sourcesContent":["import { AppBar, Box, Toolbar } from '@mui/material';\nimport merge from 'lodash.merge';\nimport { memo, useEffect, useState, type ReactNode } from 'react';\nimport { FontNormalSxProps } from '../../../_constants';\nimport { AoaMenuItem, type AoaPage } from '../../atoms/_menu/menu-item/MenuItem';\nimport { AoaUserMenu, type AoaSetting } from '../../atoms/_menu/user-menu/UserMenu';\n\nexport interface AoaNavigationBarProps {\n /**\n * If your home page is not on the root url, use this prop to set the home path\n */\n readonly homePath?: string;\n /**\n * The name of the application that will be used for the Home tab\n */\n readonly name: string;\n /**\n * A list of all the pages and optional subpages to be shown in the menu\n */\n readonly pages: AoaPage[];\n /**\n * A list of all the settings to be shown in the menu\n */\n readonly settings: AoaSetting[];\n /**\n * Optional username to be displayed next to the settings menu\n */\n readonly username?: string;\n}\n\n/**\n * Constructs a navigation bar using pre-defined Rijks styling\n *\n * @param props - Props to pass to the navigation bar\n * @example\n * ```jsx\n * <AoaNavigationBar\n * name=\"Demo App\"\n * pages={\n * [\n * {\n * label: \"Products\",\n * to: \"/products\",\n * subItems: [\n * {\n * label: \"Books\",\n * to: \"/books\",\n * icon: <BookIcon />\n * }\n * ]\n * }\n * ]\n * }\n * settings={[{ label: \"Logout\", onClick: () => console.log(\"Logout\") }]}\n * />\n * ```\n */\n\nexport const AoaNavigationBar = memo((props: AoaNavigationBarProps): ReactNode => {\n const [selectedPage, setSelectedPage] = useState<number>(0);\n\n useEffect(() => {\n const sessionStorage = window.sessionStorage.getItem('activeMenuTab');\n if (sessionStorage) {\n setSelectedPage(JSON.parse(sessionStorage));\n }\n }, []);\n\n useEffect(() => {\n window.sessionStorage.setItem('activeMenuTab', selectedPage.toString());\n }, [selectedPage]);\n\n return (\n <AppBar\n position='static'\n sx={merge(\n {\n color: 'var(--color-text)',\n backgroundColor: 'var(--color-rijks-yellow)',\n height: '70px',\n boxShadow: 'none'\n },\n FontNormalSxProps\n )}\n >\n <Toolbar\n role='menu'\n sx={{\n height: '100%',\n overflowX: 'scroll',\n scrollbarWidth: 'thin',\n scrollbarColor: '#c5c5c5 #f6f6f6',\n\n '::-webkit-scrollbar': {\n overflow: 'visible',\n borderRadius: '4px',\n width: '6px',\n height: '6px',\n '-webkit-border-radius': '4px'\n },\n\n '::-webkit-scrollbar:hover': {\n background: '#c5c5c5;'\n },\n\n '::-webkit-scrollbar-corner': {\n background: 'rgba(0,0,0,0.5)'\n },\n\n '::-webkit-scrollbar-track': {\n opacity: 0,\n transition: 'all 0.5s',\n '-webkit-transition': 'all .5s'\n },\n\n '::-webkit-scrollbar-thumb': {\n overflow: 'visible',\n backgroundColor: '#c5c5c5;',\n borderRadius: '4px',\n border: '3px solid #f6f6f6'\n },\n\n '::-webkit-scrollbar-thumb:vertical': {\n background: 'rgba(100, 100, 100, .5)',\n '-webkit-border-radius': '100px'\n },\n\n '::-webkit-scrollbar-thumb:vertical:active': {\n background: 'rgba(100, 100, 100, .61)',\n '-webkit-border-radius': '100px'\n }\n }}\n tabIndex={0}\n >\n <AoaMenuItem\n index={0}\n page={{ label: props.name, to: props.homePath ?? '/' }}\n selectedPage={selectedPage}\n setSelectedPage={setSelectedPage}\n />\n <Box sx={{ flexGrow: 1, display: 'flex', height: '100%' }}>\n {props.pages.map((page, index) => (\n <AoaMenuItem\n index={index + 1}\n key={index}\n page={page}\n selectedPage={selectedPage}\n setSelectedPage={setSelectedPage}\n />\n ))}\n </Box>\n <AoaUserMenu settings={props.settings} username={props.username} />\n </Toolbar>\n </AppBar>\n );\n});\n"],"names":["AoaNavigationBar","memo","props","selectedPage","setSelectedPage","useState","useEffect","sessionStorage","jsx","AppBar","merge","FontNormalSxProps","jsxs","Toolbar","AoaMenuItem","Box","page","index","AoaUserMenu"],"mappings":";;;;;;;AA0Da,MAAAA,IAAmBC,EAAK,CAACC,MAA4C;AAChF,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAiB,CAAC;AAE1D,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAiB,OAAO,eAAe,QAAQ,eAAe;AACpE,IAAIA,KACcH,EAAA,KAAK,MAAMG,CAAc,CAAC;AAAA,EAE9C,GAAG,EAAE,GAELD,EAAU,MAAM;AACd,WAAO,eAAe,QAAQ,iBAAiBH,EAAa,UAAU;AAAA,EAAA,GACrE,CAACA,CAAY,CAAC,GAGf,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAS;AAAA,MACT,IAAIC;AAAA,QACF;AAAA,UACE,OAAO;AAAA,UACP,iBAAiB;AAAA,UACjB,QAAQ;AAAA,UACR,WAAW;AAAA,QACb;AAAA,QACAC;AAAA,MACF;AAAA,MAEA,UAAA,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,IAAI;AAAA,YACF,QAAQ;AAAA,YACR,WAAW;AAAA,YACX,gBAAgB;AAAA,YAChB,gBAAgB;AAAA,YAEhB,uBAAuB;AAAA,cACrB,UAAU;AAAA,cACV,cAAc;AAAA,cACd,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,yBAAyB;AAAA,YAC3B;AAAA,YAEA,6BAA6B;AAAA,cAC3B,YAAY;AAAA,YACd;AAAA,YAEA,8BAA8B;AAAA,cAC5B,YAAY;AAAA,YACd;AAAA,YAEA,6BAA6B;AAAA,cAC3B,SAAS;AAAA,cACT,YAAY;AAAA,cACZ,sBAAsB;AAAA,YACxB;AAAA,YAEA,6BAA6B;AAAA,cAC3B,UAAU;AAAA,cACV,iBAAiB;AAAA,cACjB,cAAc;AAAA,cACd,QAAQ;AAAA,YACV;AAAA,YAEA,sCAAsC;AAAA,cACpC,YAAY;AAAA,cACZ,yBAAyB;AAAA,YAC3B;AAAA,YAEA,6CAA6C;AAAA,cAC3C,YAAY;AAAA,cACZ,yBAAyB;AAAA,YAAA;AAAA,UAE7B;AAAA,UACA,UAAU;AAAA,UAEV,UAAA;AAAA,YAAA,gBAAAL;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,OAAO;AAAA,gBACP,MAAM,EAAE,OAAOZ,EAAM,MAAM,IAAIA,EAAM,YAAY,IAAI;AAAA,gBACrD,cAAAC;AAAA,gBACA,iBAAAC;AAAA,cAAA;AAAA,YACF;AAAA,8BACCW,GAAI,EAAA,IAAI,EAAE,UAAU,GAAG,SAAS,QAAQ,QAAQ,UAC9C,UAAMb,EAAA,MAAM,IAAI,CAACc,GAAMC,MACtB,gBAAAT;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,OAAOG,IAAQ;AAAA,gBAEf,MAAAD;AAAA,gBACA,cAAAb;AAAA,gBACA,iBAAAC;AAAA,cAAA;AAAA,cAHKa;AAAA,YAKR,CAAA,GACH;AAAA,8BACCC,GAAY,EAAA,UAAUhB,EAAM,UAAU,UAAUA,EAAM,SAAU,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACnE;AAAA,EACF;AAEJ,CAAC;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { AoaButtonProps } from '../../atoms/button/Button';
|
|
3
|
-
export interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps,
|
|
3
|
+
export interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps, 'disabled' | 'startIcon' | 'type'> {
|
|
4
4
|
/**
|
|
5
5
|
* The files that should be checked, required if {@link AoaUploadButtonProps.noFilesAllowed} is `false`
|
|
6
6
|
*/
|
|
@@ -29,7 +29,7 @@ export interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps, "disab
|
|
|
29
29
|
/**
|
|
30
30
|
* The type of the button. This _cannot_ be a `text` style button like the base {@link AoaButton}
|
|
31
31
|
*/
|
|
32
|
-
readonly type?:
|
|
32
|
+
readonly type?: 'primary' | 'secondary';
|
|
33
33
|
}
|
|
34
34
|
export declare function AoaUploadButton<TData>({ isUploading, isDisabled, children, sx, isNeverDisabled, type, files, setIsUploading, onClick, ...props }: PropsWithChildren<AoaUploadButtonProps<TData>>): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
//# sourceMappingURL=UploadButton.d.ts.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { CircularProgress as
|
|
3
|
-
import { m as
|
|
4
|
-
import { AoaButton as
|
|
2
|
+
import { CircularProgress as f } from "@mui/material";
|
|
3
|
+
import { m as g } from "../../../chunks/index.DJYQ_-zP.js";
|
|
4
|
+
import { AoaButton as b } from "../../atoms/button/Button.js";
|
|
5
5
|
function h({
|
|
6
6
|
isUploading: t,
|
|
7
7
|
isDisabled: e,
|
|
8
|
-
children:
|
|
9
|
-
sx:
|
|
8
|
+
children: a,
|
|
9
|
+
sx: m,
|
|
10
10
|
isNeverDisabled: s,
|
|
11
|
-
type:
|
|
12
|
-
files:
|
|
13
|
-
setIsUploading:
|
|
11
|
+
type: i,
|
|
12
|
+
files: p,
|
|
13
|
+
setIsUploading: l,
|
|
14
14
|
onClick: r,
|
|
15
|
-
...
|
|
15
|
+
...n
|
|
16
16
|
}) {
|
|
17
17
|
return /* @__PURE__ */ o(
|
|
18
|
-
|
|
18
|
+
b,
|
|
19
19
|
{
|
|
20
|
-
...
|
|
21
|
-
disabled: s ? !1 : !!e || t || Object.keys(
|
|
22
|
-
onClick: (
|
|
23
|
-
|
|
20
|
+
...n,
|
|
21
|
+
disabled: s ? !1 : !!e || t || Object.keys(p ?? []).length < 1,
|
|
22
|
+
onClick: (u) => {
|
|
23
|
+
l(!0), r == null || r(u);
|
|
24
24
|
},
|
|
25
|
-
startIcon: t ? /* @__PURE__ */ o(
|
|
26
|
-
sx:
|
|
27
|
-
type:
|
|
28
|
-
children:
|
|
25
|
+
startIcon: t ? /* @__PURE__ */ o(f, { "aria-label": "Uploading...", size: 20 }) : null,
|
|
26
|
+
sx: g({ marginRight: 0 }, m),
|
|
27
|
+
type: i ?? "primary",
|
|
28
|
+
children: a
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadButton.js","sources":["../../../../src/components/molecules/upload-button/UploadButton.tsx"],"sourcesContent":["import { CircularProgress } from
|
|
1
|
+
{"version":3,"file":"UploadButton.js","sources":["../../../../src/components/molecules/upload-button/UploadButton.tsx"],"sourcesContent":["import { CircularProgress } from '@mui/material';\nimport merge from 'lodash.merge';\nimport type { PropsWithChildren } from 'react';\nimport { AoaButton, type AoaButtonProps } from '../../atoms/button/Button';\n\nexport interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps, 'disabled' | 'startIcon' | 'type'> {\n /**\n * The files that should be checked, required if {@link AoaUploadButtonProps.noFilesAllowed} is `false`\n */\n readonly files?: TData[];\n /**\n * Whether the button should be disabled\n */\n readonly isDisabled?: boolean;\n /**\n * Whether the button should never be disabled.\n * - If `true` the button never goes into a `disabled` state, regardless of other conditions\n * - If `false` the button will be disabled if there are no files provided\n * (through {@link AoaUploadButtonProps.files | `files`}), or the upload progress is running\n */\n readonly isNeverDisabled?: boolean;\n\n /**\n * Whether the upload process is running. This controls whether a spinner is shown and the button is disabled\n */\n readonly isUploading: boolean;\n /**\n * The action to change {@link AoaUploadButtonProps.isUploading | `isUploading`} to `true`\n *\n * @param newState - The new state of the `isUploading` flag\n */\n setIsUploading(this: void, newState: boolean): void;\n\n /**\n * The type of the button. This _cannot_ be a `text` style button like the base {@link AoaButton}\n */\n readonly type?: 'primary' | 'secondary';\n}\n\nexport function AoaUploadButton<TData>({\n isUploading,\n isDisabled,\n children,\n sx,\n isNeverDisabled,\n type,\n files,\n setIsUploading,\n onClick,\n ...props\n}: PropsWithChildren<AoaUploadButtonProps<TData>>) {\n return (\n <AoaButton\n {...props}\n disabled={isNeverDisabled ? false : Boolean(isDisabled) || isUploading || Object.keys(files ?? []).length < 1}\n onClick={(event) => {\n setIsUploading(true);\n onClick?.(event);\n }}\n startIcon={isUploading ? <CircularProgress aria-label='Uploading...' size={20} /> : null}\n sx={merge({ marginRight: 0 }, sx)}\n type={type ?? 'primary'}\n >\n {children}\n </AoaButton>\n );\n}\n"],"names":["AoaUploadButton","isUploading","isDisabled","children","sx","isNeverDisabled","type","files","setIsUploading","onClick","props","jsx","AoaButton","event","CircularProgress","merge"],"mappings":";;;;AAuCO,SAASA,EAAuB;AAAA,EACrC,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GAAmD;AAE/C,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,UAAUL,IAAkB,KAAQ,EAAQH,KAAeD,KAAe,OAAO,KAAKM,KAAS,EAAE,EAAE,SAAS;AAAA,MAC5G,SAAS,CAACM,MAAU;AAClB,QAAAL,EAAe,EAAI,GACnBC,KAAA,QAAAA,EAAUI;AAAA,MACZ;AAAA,MACA,WAAWZ,IAAe,gBAAAU,EAAAG,GAAA,EAAiB,cAAW,gBAAe,MAAM,GAAI,CAAA,IAAK;AAAA,MACpF,IAAIC,EAAM,EAAE,aAAa,EAAA,GAAKX,CAAE;AAAA,MAChC,MAAME,KAAQ;AAAA,MAEb,UAAAH;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPage.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/content-page/ContentPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAExG,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;CACpD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"ContentPage.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/content-page/ContentPage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAExG,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;CACpD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,mFACoB,iBAAiB,CAAC,mBAAmB,CAAC,6CAUpF,CAAC"}
|
|
@@ -2,10 +2,12 @@ import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { Container as e, Box as i } from "@mui/material";
|
|
3
3
|
import { memo as n } from "react";
|
|
4
4
|
import { AoaSectionHeader as p } from "../../atoms/section-header/SectionHeader.js";
|
|
5
|
-
const l = n(
|
|
6
|
-
/* @__PURE__ */ o(
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const l = n(
|
|
6
|
+
({ children: r, sectionHeaderProps: a, ...t }) => /* @__PURE__ */ o(e, { maxWidth: "xl", children: /* @__PURE__ */ m(i, { "data-qa": t["data-qa"], marginTop: "calc(8 * 4px)", children: [
|
|
7
|
+
/* @__PURE__ */ o(p, { ...a }),
|
|
8
|
+
r
|
|
9
|
+
] }) })
|
|
10
|
+
);
|
|
9
11
|
export {
|
|
10
12
|
l as AoaContentPage
|
|
11
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPage.js","sources":["../../../../src/components/organisms/content-page/ContentPage.tsx"],"sourcesContent":["import { Box, Container } from
|
|
1
|
+
{"version":3,"file":"ContentPage.js","sources":["../../../../src/components/organisms/content-page/ContentPage.tsx"],"sourcesContent":["import { Box, Container } from '@mui/material';\nimport { memo, type PropsWithChildren } from 'react';\nimport { AoaSectionHeader, type AoaSectionHeaderProps } from '../../atoms/section-header/SectionHeader';\n\nexport interface AoaContentPageProps {\n /**\n * Data-qa tag for E2E test purposes\n */\n readonly 'data-qa'?: string;\n readonly sectionHeaderProps: AoaSectionHeaderProps;\n}\n\n/**\n * Constructs a basic page with a section header using pre-defined Rijks styling\n *\n * @param props - Props to pass to the content page\n * @example\n * ```jsx\n * <AoaContentPage sectionHeaderProps={{ title: \"This is a title\" }}>I am a child!</AoaContentPage>\n * ```\n */\nexport const AoaContentPage = memo(\n ({ children, sectionHeaderProps, ...props }: PropsWithChildren<AoaContentPageProps>) => {\n return (\n <Container maxWidth='xl'>\n <Box data-qa={props['data-qa']} marginTop='calc(8 * 4px)'>\n <AoaSectionHeader {...sectionHeaderProps} />\n {children}\n </Box>\n </Container>\n );\n }\n);\n"],"names":["AoaContentPage","memo","children","sectionHeaderProps","props","jsx","Container","jsxs","Box","AoaSectionHeader"],"mappings":";;;;AAqBO,MAAMA,IAAiBC;AAAA,EAC5B,CAAC,EAAE,UAAAC,GAAU,oBAAAC,GAAoB,GAAGC,QAEhC,gBAAAC,EAACC,GAAU,EAAA,UAAS,MAClB,UAAA,gBAAAC,EAACC,GAAI,EAAA,WAASJ,EAAM,SAAS,GAAG,WAAU,iBACxC,UAAA;AAAA,IAAC,gBAAAC,EAAAI,GAAA,EAAkB,GAAGN,GAAoB;AAAA,IACzCD;AAAA,EAAA,EAAA,CACH,EACF,CAAA;AAGN;"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AAC3E,YAAY,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC3G,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAC/G,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC5G,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AAC3E,YAAY,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC3G,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAC/G,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC5G,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACzB,MAAM,+DAA+D,CAAC;AACvE,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EAC1B,MAAM,iEAAiE,CAAC;AACzE,OAAO,EACL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAGvF,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC1B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AACnG,OAAO,EACL,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC9B,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AACnH,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAG/G,OAAO,EACL,cAAc,IAAI,kBAAkB,EACpC,KAAK,mBAAmB,IAAI,uBAAuB,EACpD,MAAM,iDAAiD,CAAC"}
|