@gen-epix/ui-core-components 4.0.0 → 4.0.2
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/_chunks/isObject.js +13 -0
- package/dist/_chunks/isObject.js.map +1 -0
- package/dist/_chunks/rolldown-runtime.js +2 -2
- package/dist/components/BackdropSpinner/BackdropSpinner.d.ts +5 -0
- package/dist/components/BackdropSpinner/index.d.ts +1 -0
- package/dist/components/BackdropSpinner/index.js +19 -0
- package/dist/components/BackdropSpinner/index.js.map +1 -0
- package/dist/components/Confirmation/Confirmation.d.ts +2 -0
- package/dist/components/Confirmation/ConfirmationRender.d.ts +11 -0
- package/dist/components/Confirmation/index.d.ts +2 -0
- package/dist/components/Confirmation/index.js +58 -0
- package/dist/components/Confirmation/index.js.map +1 -0
- package/dist/components/CopyToClipboardButton/CopyToClipboardButton.d.ts +13 -0
- package/dist/components/CopyToClipboardButton/index.d.ts +1 -0
- package/dist/components/CopyToClipboardButton/index.js +101 -0
- package/dist/components/CopyToClipboardButton/index.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +27 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +83 -0
- package/dist/components/Dialog/index.js.map +1 -0
- package/dist/components/LinearProgressWithLabel/LinearProgressWithLabel.d.ts +5 -0
- package/dist/components/LinearProgressWithLabel/index.d.ts +1 -0
- package/dist/components/LinearProgressWithLabel/index.js +31 -0
- package/dist/components/LinearProgressWithLabel/index.js.map +1 -0
- package/dist/components/LoadingIndicator/LoadingIndicator.d.ts +2 -0
- package/dist/components/LoadingIndicator/index.d.ts +1 -0
- package/dist/components/LoadingIndicator/index.js +12 -0
- package/dist/components/LoadingIndicator/index.js.map +1 -0
- package/dist/components/NestedMenu/IconMenuItem.d.ts +18 -0
- package/dist/components/NestedMenu/NestedDropdown.d.ts +17 -0
- package/dist/components/NestedMenu/NestedMenuItem.d.ts +22 -0
- package/dist/components/NestedMenu/index.d.ts +4 -0
- package/dist/components/NestedMenu/index.js +240 -0
- package/dist/components/NestedMenu/index.js.map +1 -0
- package/dist/components/NestedMenu/nestedMenuItemsFromObject.d.ts +11 -0
- package/dist/components/Spinner/Spinner.d.ts +11 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Spinner/index.js +63 -0
- package/dist/components/Spinner/index.js.map +1 -0
- package/dist/components/Stepper/Stepper.d.ts +17 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Stepper/index.js +1087 -0
- package/dist/components/Stepper/index.js.map +1 -0
- package/dist/components/Stepper/stepperModel.d.ts +4 -0
- package/dist/context/uiCoreComponentsConfigContext/UiCoreComponentsConfigContextProvider.d.ts +6 -0
- package/dist/context/uiCoreComponentsConfigContext/index.d.ts +3 -0
- package/dist/context/uiCoreComponentsConfigContext/index.js +14 -0
- package/dist/context/uiCoreComponentsConfigContext/index.js.map +1 -0
- package/dist/context/uiCoreComponentsConfigContext/uiCoreComponentsConfigContext.d.ts +7 -0
- package/dist/context/uiCoreComponentsConfigContext/useUiCoreComponentsConfigContext.d.ts +2 -0
- package/dist/hoc/withDialog/index.d.ts +1 -0
- package/dist/hoc/withDialog/index.js +69 -0
- package/dist/hoc/withDialog/index.js.map +1 -0
- package/dist/hoc/withDialog/withDialog.d.ts +33 -0
- package/dist/locale/en.json +14 -93
- package/dist/locale/nl.json +14 -93
- package/dist/models/nestedMenu.d.ts +17 -0
- package/dist/models/nestedMenu.js +0 -0
- package/package.json +3 -3
- package/dist/@types/ui-form.d.ts +0 -2
- package/dist/@types/yup.d.ts +0 -30
- package/dist/_chunks/Autocomplete.js +0 -229
- package/dist/_chunks/Autocomplete.js.map +0 -1
- package/dist/_chunks/DatePicker.js +0 -126
- package/dist/_chunks/DatePicker.js.map +0 -1
- package/dist/_chunks/FormUtil.js +0 -1350
- package/dist/_chunks/FormUtil.js.map +0 -1
- package/dist/_chunks/RichTextEditor.js +0 -22721
- package/dist/_chunks/RichTextEditor.js.map +0 -1
- package/dist/_chunks/TransferList.js +0 -453
- package/dist/_chunks/TransferList.js.map +0 -1
- package/dist/_chunks/UploadButton.js +0 -91
- package/dist/_chunks/UploadButton.js.map +0 -1
- package/dist/_chunks/classnames.js +0 -33
- package/dist/_chunks/classnames.js.map +0 -1
- package/dist/_chunks/index.esm.js +0 -348
- package/dist/_chunks/index.esm.js.map +0 -1
- package/dist/_chunks/isEqual.js +0 -348
- package/dist/_chunks/isEqual.js.map +0 -1
- package/dist/_chunks/isObjectLike.js +0 -304
- package/dist/_chunks/isObjectLike.js.map +0 -1
- package/dist/_chunks/isValid.js +0 -28
- package/dist/_chunks/isValid.js.map +0 -1
- package/dist/_chunks/sv.js +0 -434
- package/dist/_chunks/sv.js.map +0 -1
- package/dist/components/fields/Autocomplete/Autocomplete.d.ts +0 -19
- package/dist/components/fields/Autocomplete/AutocompleteSelectAllContext.d.ts +0 -2
- package/dist/components/fields/Autocomplete/AutocompleteSelectAllPaper.d.ts +0 -2
- package/dist/components/fields/Autocomplete/index.d.ts +0 -1
- package/dist/components/fields/Autocomplete/index.js +0 -2
- package/dist/components/fields/CheckboxGroup/CheckboxGroup.d.ts +0 -18
- package/dist/components/fields/CheckboxGroup/index.d.ts +0 -1
- package/dist/components/fields/CheckboxGroup/index.js +0 -114
- package/dist/components/fields/CheckboxGroup/index.js.map +0 -1
- package/dist/components/fields/DatePicker/DatePicker.d.ts +0 -15
- package/dist/components/fields/DatePicker/DatePickerInputAdornment.d.ts +0 -8
- package/dist/components/fields/DatePicker/index.d.ts +0 -1
- package/dist/components/fields/DatePicker/index.js +0 -2
- package/dist/components/fields/DateRangePicker/DateRangePicker.d.ts +0 -17
- package/dist/components/fields/DateRangePicker/index.d.ts +0 -1
- package/dist/components/fields/DateRangePicker/index.js +0 -1648
- package/dist/components/fields/DateRangePicker/index.js.map +0 -1
- package/dist/components/fields/NumberField/NumberField.d.ts +0 -19
- package/dist/components/fields/NumberField/index.d.ts +0 -1
- package/dist/components/fields/NumberField/index.js +0 -180
- package/dist/components/fields/NumberField/index.js.map +0 -1
- package/dist/components/fields/NumberRangeInput/NumberRangeInput.d.ts +0 -15
- package/dist/components/fields/NumberRangeInput/index.d.ts +0 -1
- package/dist/components/fields/NumberRangeInput/index.js +0 -192
- package/dist/components/fields/NumberRangeInput/index.js.map +0 -1
- package/dist/components/fields/RadioGroup/RadioGroup.d.ts +0 -16
- package/dist/components/fields/RadioGroup/index.d.ts +0 -1
- package/dist/components/fields/RadioGroup/index.js +0 -72
- package/dist/components/fields/RadioGroup/index.js.map +0 -1
- package/dist/components/fields/RichTextEditor/RichTextEditor.d.ts +0 -13
- package/dist/components/fields/RichTextEditor/RichTextEditorContent.d.ts +0 -4
- package/dist/components/fields/RichTextEditor/index.d.ts +0 -2
- package/dist/components/fields/RichTextEditor/index.js +0 -2
- package/dist/components/fields/RichTextEditor/useRichTextEditorExtensions.d.ts +0 -10
- package/dist/components/fields/Select/Select.d.ts +0 -16
- package/dist/components/fields/Select/index.d.ts +0 -1
- package/dist/components/fields/Select/index.js +0 -129
- package/dist/components/fields/Select/index.js.map +0 -1
- package/dist/components/fields/Switch/Switch.d.ts +0 -13
- package/dist/components/fields/Switch/index.d.ts +0 -1
- package/dist/components/fields/Switch/index.js +0 -68
- package/dist/components/fields/Switch/index.js.map +0 -1
- package/dist/components/fields/TextField/TextField.d.ts +0 -18
- package/dist/components/fields/TextField/index.d.ts +0 -1
- package/dist/components/fields/TextField/index.js +0 -108
- package/dist/components/fields/TextField/index.js.map +0 -1
- package/dist/components/fields/ToggleButtonGroup/ToggleButtonGroup.d.ts +0 -14
- package/dist/components/fields/ToggleButtonGroup/index.d.ts +0 -1
- package/dist/components/fields/ToggleButtonGroup/index.js +0 -57
- package/dist/components/fields/ToggleButtonGroup/index.js.map +0 -1
- package/dist/components/fields/TransferList/TransferList.d.ts +0 -16
- package/dist/components/fields/TransferList/index.d.ts +0 -1
- package/dist/components/fields/TransferList/index.js +0 -2
- package/dist/components/fields/UploadButton/UploadButton.d.ts +0 -15
- package/dist/components/fields/UploadButton/index.d.ts +0 -1
- package/dist/components/fields/UploadButton/index.js +0 -2
- package/dist/components/helpers/FormFieldHelperText/FormFieldHelperText.d.ts +0 -8
- package/dist/components/helpers/FormFieldHelperText/index.d.ts +0 -1
- package/dist/components/helpers/FormFieldHelperText/index.js +0 -50
- package/dist/components/helpers/FormFieldHelperText/index.js.map +0 -1
- package/dist/components/helpers/FormFieldLoadingIndicator/FormFieldLoadingIndicator.d.ts +0 -4
- package/dist/components/helpers/FormFieldLoadingIndicator/index.d.ts +0 -1
- package/dist/components/helpers/FormFieldLoadingIndicator/index.js +0 -16
- package/dist/components/helpers/FormFieldLoadingIndicator/index.js.map +0 -1
- package/dist/components/helpers/GenericForm/GenericForm.d.ts +0 -18
- package/dist/components/helpers/GenericForm/index.d.ts +0 -1
- package/dist/components/helpers/GenericForm/index.js +0 -156
- package/dist/components/helpers/GenericForm/index.js.map +0 -1
- package/dist/hooks/useIsFormFieldRequiredFromSchema/index.d.ts +0 -1
- package/dist/hooks/useIsFormFieldRequiredFromSchema/index.js +0 -18
- package/dist/hooks/useIsFormFieldRequiredFromSchema/index.js.map +0 -1
- package/dist/hooks/useIsFormFieldRequiredFromSchema/useIsFormFieldRequiredFromSchema.d.ts +0 -4
- package/dist/models/form.d.ts +0 -112
- package/dist/models/form.js +0 -8
- package/dist/models/form.js.map +0 -1
- package/dist/setup/setup.d.ts +0 -1
- package/dist/setup/setup.js +0 -166
- package/dist/setup/setup.js.map +0 -1
- package/dist/utils/FormUtil/FormUtil.d.ts +0 -19
- package/dist/utils/FormUtil/index.d.ts +0 -1
- package/dist/utils/FormUtil/index.js +0 -2
- package/dist/utils/SchemaUtil/SchemaUtil.d.ts +0 -9
- package/dist/utils/SchemaUtil/index.d.ts +0 -1
- package/dist/utils/SchemaUtil/index.js +0 -30
- package/dist/utils/SchemaUtil/index.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js
|
|
3
|
+
var t = /* @__PURE__ */ e(((e, t) => {
|
|
4
|
+
function n(e) {
|
|
5
|
+
var t = typeof e;
|
|
6
|
+
return e != null && (t == "object" || t == "function");
|
|
7
|
+
}
|
|
8
|
+
t.exports = n;
|
|
9
|
+
}));
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=isObject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isObject.js","names":[],"sources":["../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js"],"sourcesContent":["/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n"],"x_google_ignoreList":[0],"mappings":";;;CAyBA,SAAS,EAAS,GAAO;EACvB,IAAI,IAAO,OAAO;EAClB,OAAO,KAAS,SAAS,KAAQ,YAAY,KAAQ;CACvD;CAEA,EAAO,UAAU"}
|
|
@@ -5,9 +5,9 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
5
5
|
enumerable: !(s = n(i, d)) || s.enumerable
|
|
6
6
|
});
|
|
7
7
|
return e;
|
|
8
|
-
}, c = (n, r,
|
|
8
|
+
}, c = (n, r, o) => (o = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
|
|
9
9
|
value: n,
|
|
10
10
|
enumerable: !0
|
|
11
|
-
}) :
|
|
11
|
+
}) : o, n));
|
|
12
12
|
//#endregion
|
|
13
13
|
export { c as n, o as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BackdropSpinner';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Spinner as e } from "../Spinner/index.js";
|
|
2
|
+
import { Backdrop as t, useTheme as n } from "@mui/material";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/BackdropSpinner/BackdropSpinner.tsx
|
|
5
|
+
var i = ({ open: i, ...a }) => {
|
|
6
|
+
let o = n();
|
|
7
|
+
return /* @__PURE__ */ r(t, {
|
|
8
|
+
open: i,
|
|
9
|
+
sx: {
|
|
10
|
+
backgroundColor: o.palette.mode === "light" ? "rgba(255, 255, 255, 0.7)" : "rgba(0, 0, 0, 0.5)",
|
|
11
|
+
zIndex: o.zIndex.drawer + 1
|
|
12
|
+
},
|
|
13
|
+
children: i && /* @__PURE__ */ r(e, { ...a })
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as BackdropSpinner };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/BackdropSpinner/BackdropSpinner.tsx"],"sourcesContent":["import {\n Backdrop,\n useTheme,\n} from '@mui/material';\n\nimport type { SpinnerProps } from '../Spinner';\nimport { Spinner } from '../Spinner';\n\nexport type BackdropSpinnerProps = {\n readonly open: boolean;\n} & Omit<SpinnerProps, 'inline'>;\n\nexport const BackdropSpinner = ({ open, ...spinnerProps }: BackdropSpinnerProps) => {\n const theme = useTheme();\n return (\n <Backdrop\n open={open}\n sx={{\n backgroundColor: theme.palette.mode === 'light' ? 'rgba(255, 255, 255, 0.7)' : 'rgba(0, 0, 0, 0.5)',\n zIndex: theme.zIndex.drawer + 1,\n }}\n >\n {open && (\n <Spinner\n {...spinnerProps}\n />\n )}\n </Backdrop>\n );\n};\n"],"mappings":";;;;AAYA,IAAa,KAAmB,EAAE,SAAM,GAAG,QAAyC;CAClF,IAAM,IAAQ,EAAS;CACvB,OACE,kBAAC,GAAD;EACQ;EACN,IAAI;GACF,iBAAiB,EAAM,QAAQ,SAAS,UAAU,6BAA6B;GAC/E,QAAQ,EAAM,OAAO,SAAS;EAChC;EAEC,UAAA,KACC,kBAAC,GAAD,EACE,GAAI,EACL,CAAA;CAEK,CAAA;AAEd"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { WithDialogRefMethods, WithDialogRenderProps } from '../../hoc/withDialog';
|
|
3
|
+
export interface ConfirmationProps<TOpenProps = never> extends WithDialogRenderProps<TOpenProps> {
|
|
4
|
+
readonly body?: string;
|
|
5
|
+
readonly cancelLabel?: string;
|
|
6
|
+
readonly confirmLabel: string;
|
|
7
|
+
readonly onCancel?: (openProps: TOpenProps) => void;
|
|
8
|
+
readonly onConfirm: (openProps: TOpenProps) => void;
|
|
9
|
+
}
|
|
10
|
+
export type ConfirmationRefMethods<TOpenProps = never> = WithDialogRefMethods<ConfirmationProps, TOpenProps>;
|
|
11
|
+
export declare const ConfirmationRender: <TOpenProps>({ body, cancelLabel, confirmLabel, onActionsChange, onCancel, onClose, onConfirm, openProps, }: ConfirmationProps<TOpenProps>) => ReactElement;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { withDialog as e } from "../../hoc/withDialog/index.js";
|
|
2
|
+
import { useCallback as t, useEffect as n } from "react";
|
|
3
|
+
import { DialogContentText as r } from "@mui/material";
|
|
4
|
+
import { useTranslation as i } from "react-i18next";
|
|
5
|
+
import { TestIdUtil as a } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/Confirmation/ConfirmationRender.tsx
|
|
8
|
+
var s = ({ body: e, cancelLabel: s, confirmLabel: c, onActionsChange: l, onCancel: u, onClose: d, onConfirm: f, openProps: p }) => {
|
|
9
|
+
let { t: m } = i(), h = t(() => {
|
|
10
|
+
u && u(p), d();
|
|
11
|
+
}, [
|
|
12
|
+
u,
|
|
13
|
+
d,
|
|
14
|
+
p
|
|
15
|
+
]), g = t(() => {
|
|
16
|
+
f(p), d();
|
|
17
|
+
}, [
|
|
18
|
+
f,
|
|
19
|
+
p,
|
|
20
|
+
d
|
|
21
|
+
]);
|
|
22
|
+
return n(() => {
|
|
23
|
+
let e = [];
|
|
24
|
+
s && e.push({
|
|
25
|
+
...a.createAttributes("Confirmation-cancelButton"),
|
|
26
|
+
color: "primary",
|
|
27
|
+
label: s ?? m`Cancel`,
|
|
28
|
+
onClick: h,
|
|
29
|
+
variant: "outlined"
|
|
30
|
+
}), e.push({
|
|
31
|
+
...a.createAttributes("Confirmation-confirmButton"),
|
|
32
|
+
autoFocus: !0,
|
|
33
|
+
color: "secondary",
|
|
34
|
+
label: c ?? m`OK`,
|
|
35
|
+
onClick: g,
|
|
36
|
+
variant: "contained"
|
|
37
|
+
}), l(e);
|
|
38
|
+
}, [
|
|
39
|
+
s,
|
|
40
|
+
h,
|
|
41
|
+
c,
|
|
42
|
+
g,
|
|
43
|
+
l,
|
|
44
|
+
u,
|
|
45
|
+
m
|
|
46
|
+
]), e ? /* @__PURE__ */ o(r, {
|
|
47
|
+
...a.createAttributes("Confirmation-textContent"),
|
|
48
|
+
children: e
|
|
49
|
+
}) : null;
|
|
50
|
+
}, c = e(s, {
|
|
51
|
+
fullWidth: !0,
|
|
52
|
+
maxWidth: "sm",
|
|
53
|
+
testId: "Confirmation"
|
|
54
|
+
});
|
|
55
|
+
//#endregion
|
|
56
|
+
export { c as Confirmation, s as ConfirmationRender };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Confirmation/ConfirmationRender.tsx","../../../src/components/Confirmation/Confirmation.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n} from 'react';\nimport { DialogContentText } from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport type { DialogAction } from '../Dialog/Dialog';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '../../hoc/withDialog';\n\nexport interface ConfirmationProps<TOpenProps = never> extends WithDialogRenderProps<TOpenProps> {\n readonly body?: string;\n readonly cancelLabel?: string;\n readonly confirmLabel: string;\n readonly onCancel?: (openProps: TOpenProps) => void;\n readonly onConfirm: (openProps: TOpenProps) => void;\n}\n\nexport type ConfirmationRefMethods<TOpenProps = never> = WithDialogRefMethods<ConfirmationProps, TOpenProps>;\n\nexport const ConfirmationRender = <TOpenProps,>(\n {\n body,\n cancelLabel,\n confirmLabel,\n onActionsChange,\n onCancel,\n onClose,\n onConfirm,\n openProps,\n }: ConfirmationProps<TOpenProps>,\n): ReactElement => {\n const { t } = useTranslation();\n const onCancelButtonClick = useCallback((): void => {\n if (onCancel) {\n onCancel(openProps);\n }\n onClose();\n }, [onCancel, onClose, openProps]);\n\n const onConfirmButtonClick = useCallback((): void => {\n onConfirm(openProps);\n onClose();\n }, [onConfirm, openProps, onClose]);\n\n useEffect(() => {\n const actions: DialogAction[] = [];\n if (cancelLabel) {\n actions.push({\n ...TestIdUtil.createAttributes('Confirmation-cancelButton'),\n color: 'primary',\n label: cancelLabel ?? t`Cancel`,\n onClick: onCancelButtonClick,\n variant: 'outlined',\n });\n }\n actions.push({\n ...TestIdUtil.createAttributes('Confirmation-confirmButton'),\n autoFocus: true,\n color: 'secondary',\n label: confirmLabel ?? t`OK`,\n onClick: onConfirmButtonClick,\n variant: 'contained',\n });\n onActionsChange(actions);\n }, [cancelLabel, onCancelButtonClick, confirmLabel, onConfirmButtonClick, onActionsChange, onCancel, t]);\n\n if (!body) {\n return null;\n }\n return (\n <DialogContentText {...TestIdUtil.createAttributes('Confirmation-textContent')}>\n {body}\n </DialogContentText>\n );\n};\n","import { withDialog } from '../../hoc/withDialog';\n\nimport type { ConfirmationProps } from './ConfirmationRender';\nimport { ConfirmationRender } from './ConfirmationRender';\n\nexport const Confirmation = withDialog<ConfirmationProps, unknown>(ConfirmationRender, {\n fullWidth: true,\n maxWidth: 'sm',\n testId: 'Confirmation',\n});\n"],"mappings":";;;;;;;AAyBA,IAAa,KACX,EACE,SACA,gBACA,iBACA,oBACA,aACA,YACA,cACA,mBAEe;CACjB,IAAM,EAAE,SAAM,EAAe,GACvB,IAAsB,QAAwB;EAIlD,AAHI,KACF,EAAS,CAAS,GAEpB,EAAQ;CACV,GAAG;EAAC;EAAU;EAAS;CAAS,CAAC,GAE3B,IAAuB,QAAwB;EAEnD,AADA,EAAU,CAAS,GACnB,EAAQ;CACV,GAAG;EAAC;EAAW;EAAW;CAAO,CAAC;CA2BlC,OAzBA,QAAgB;EACd,IAAM,IAA0B,CAAC;EAkBjC,AAjBI,KACF,EAAQ,KAAK;GACX,GAAG,EAAW,iBAAiB,2BAA2B;GAC1D,OAAO;GACP,OAAO,KAAe,CAAC;GACvB,SAAS;GACT,SAAS;EACX,CAAC,GAEH,EAAQ,KAAK;GACX,GAAG,EAAW,iBAAiB,4BAA4B;GAC3D,WAAW;GACX,OAAO;GACP,OAAO,KAAgB,CAAC;GACxB,SAAS;GACT,SAAS;EACX,CAAC,GACD,EAAgB,CAAO;CACzB,GAAG;EAAC;EAAa;EAAqB;EAAc;EAAsB;EAAiB;EAAU;CAAC,CAAC,GAElG,IAIH,kBAAC,GAAD;EAAmB,GAAI,EAAW,iBAAiB,0BAA0B;EAC1E,UAAA;CACgB,CAAA,IALZ;AAOX,GC3Ea,IAAe,EAAuC,GAAoB;CACrF,WAAW;CACX,UAAU;CACV,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ButtonOwnProps } from '@mui/material';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
export type CopyToClipboardButtonProps = {
|
|
4
|
+
readonly baseIcon?: ReactElement;
|
|
5
|
+
readonly buttonProps?: ButtonOwnProps;
|
|
6
|
+
readonly buttonText?: string;
|
|
7
|
+
readonly buttonVariant?: ButtonOwnProps['variant'];
|
|
8
|
+
readonly clipboardValue?: string;
|
|
9
|
+
readonly iconOnly?: boolean;
|
|
10
|
+
readonly onGetClipboardValue?: () => string;
|
|
11
|
+
readonly tooltipSuccessText?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const CopyToClipboardButton: ({ baseIcon, buttonProps, buttonText, buttonVariant, clipboardValue, iconOnly, onGetClipboardValue, tooltipSuccessText }: CopyToClipboardButtonProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CopyToClipboardButton';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { n as e, t } from "../../_chunks/rolldown-runtime.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { useState as r } from "react";
|
|
4
|
+
import { Button as i, IconButton as a, Tooltip as o } from "@mui/material";
|
|
5
|
+
import { useTranslation as s } from "react-i18next";
|
|
6
|
+
import c from "@mui/icons-material/ContentCopy";
|
|
7
|
+
import l from "@mui/icons-material/Done";
|
|
8
|
+
import u from "@mui/icons-material/Error";
|
|
9
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
10
|
+
//#region builtin:esm-external-require-react
|
|
11
|
+
var f = /* @__PURE__ */ t(((e, t) => {
|
|
12
|
+
t.exports = { ...n };
|
|
13
|
+
})), p = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
14
|
+
var n = f();
|
|
15
|
+
function r(e) {
|
|
16
|
+
var t = e.cleanup;
|
|
17
|
+
e.isCalled || typeof t != "function" || (e.isCalled = !0, t());
|
|
18
|
+
}
|
|
19
|
+
t.exports = function(e, t, i) {
|
|
20
|
+
var a = i === void 0 ? {} : i, o = a.cleanUpOnCall, s = o === void 0 || o, c = a.cleanUpOnDepsChange, l = c !== void 0 && c, u = a.cleanUpOnUnmount, d = u === void 0 || u, f = n.useRef({
|
|
21
|
+
cleanup: null,
|
|
22
|
+
isCalled: !1
|
|
23
|
+
}), p = {
|
|
24
|
+
cleanUpOnCall: s,
|
|
25
|
+
cleanUpOnDepsChange: l,
|
|
26
|
+
cleanUpOnUnmount: d
|
|
27
|
+
}, m = n.useRef(p);
|
|
28
|
+
return n.useEffect(function() {
|
|
29
|
+
m.current = p;
|
|
30
|
+
}), n.useEffect(function() {
|
|
31
|
+
return function() {
|
|
32
|
+
m.current.cleanUpOnDepsChange && r(f.current);
|
|
33
|
+
};
|
|
34
|
+
}, [t]), n.useEffect(function() {
|
|
35
|
+
return function() {
|
|
36
|
+
m.current.cleanUpOnUnmount && r(f.current);
|
|
37
|
+
};
|
|
38
|
+
}, []), n.useCallback(function() {
|
|
39
|
+
m.current.cleanUpOnCall && r(f.current);
|
|
40
|
+
var t = e.apply(void 0, [].slice.call(arguments));
|
|
41
|
+
if (typeof t == "object") {
|
|
42
|
+
var n = t.value;
|
|
43
|
+
return f.current = {
|
|
44
|
+
cleanup: t.cleanup,
|
|
45
|
+
isCalled: !1
|
|
46
|
+
}, n;
|
|
47
|
+
}
|
|
48
|
+
return typeof t == "function" && (f.current = {
|
|
49
|
+
cleanup: t,
|
|
50
|
+
isCalled: !1
|
|
51
|
+
}), t;
|
|
52
|
+
}, t);
|
|
53
|
+
};
|
|
54
|
+
})))(), 1), m = ({ baseIcon: e, buttonProps: t, buttonText: n, buttonVariant: f, clipboardValue: m, iconOnly: h, onGetClipboardValue: g, tooltipSuccessText: _ }) => {
|
|
55
|
+
let { t: v } = s(), [y, b] = r("primary"), [x, S] = r(e ?? /* @__PURE__ */ d(c, {})), [C, w] = r(n ?? v`Copy to clipboard`), T = (0, p.default)(() => {
|
|
56
|
+
let t;
|
|
57
|
+
return (async () => {
|
|
58
|
+
try {
|
|
59
|
+
await navigator.clipboard.writeText(m ?? g()), b("success"), S(/* @__PURE__ */ d(l, {})), w(_ ?? v`Copied to clipboard`);
|
|
60
|
+
} catch {
|
|
61
|
+
b("error"), S(/* @__PURE__ */ d(u, {})), w(v`Error`);
|
|
62
|
+
} finally {
|
|
63
|
+
t = window.setTimeout(() => {
|
|
64
|
+
b("primary"), S(e ?? /* @__PURE__ */ d(c, {})), w(n ?? v`Copy to clipboard`);
|
|
65
|
+
}, 2e3);
|
|
66
|
+
}
|
|
67
|
+
})(), () => {
|
|
68
|
+
clearTimeout(t);
|
|
69
|
+
};
|
|
70
|
+
}, [
|
|
71
|
+
e,
|
|
72
|
+
n,
|
|
73
|
+
m,
|
|
74
|
+
g,
|
|
75
|
+
v,
|
|
76
|
+
_
|
|
77
|
+
]);
|
|
78
|
+
return h ? /* @__PURE__ */ d(o, {
|
|
79
|
+
arrow: !0,
|
|
80
|
+
placement: "top",
|
|
81
|
+
title: C,
|
|
82
|
+
children: /* @__PURE__ */ d(a, {
|
|
83
|
+
...t,
|
|
84
|
+
color: y,
|
|
85
|
+
onClick: T,
|
|
86
|
+
size: "small",
|
|
87
|
+
children: x
|
|
88
|
+
})
|
|
89
|
+
}) : /* @__PURE__ */ d(i, {
|
|
90
|
+
...t,
|
|
91
|
+
color: y,
|
|
92
|
+
onClick: T,
|
|
93
|
+
startIcon: x,
|
|
94
|
+
variant: f ?? "contained",
|
|
95
|
+
children: n ?? v`Copy to clipboard`
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
export { m as CopyToClipboardButton };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../builtin:esm-external-require-react","../../../../../node_modules/.pnpm/use-cleanup-callback@1.3.0_react@19.2.8/node_modules/use-cleanup-callback/dist/index.js","../../../src/components/CopyToClipboardButton/CopyToClipboardButton.tsx"],"sourcesContent":["import * as m from 'react';module.exports = { ...m };","var n=require(\"react\");function e(n){var e=n.cleanup;n.isCalled||\"function\"!=typeof e||(n.isCalled=!0,e())}module.exports=function(u,c,l){var r=void 0===l?{}:l,a=r.cleanUpOnCall,t=void 0===a||a,o=r.cleanUpOnDepsChange,i=void 0!==o&&o,p=r.cleanUpOnUnmount,f=void 0===p||p,s=n.useRef({cleanup:null,isCalled:!1}),C={cleanUpOnCall:t,cleanUpOnDepsChange:i,cleanUpOnUnmount:f},U=n.useRef(C);return n.useEffect(function(){U.current=C}),n.useEffect(function(){return function(){U.current.cleanUpOnDepsChange&&e(s.current)}},[c]),n.useEffect(function(){return function(){U.current.cleanUpOnUnmount&&e(s.current)}},[]),n.useCallback(function(){U.current.cleanUpOnCall&&e(s.current);var n=u.apply(void 0,[].slice.call(arguments));if(\"object\"==typeof n){var c=n.value,l=n.cleanup;return s.current={cleanup:l,isCalled:!1},c}return\"function\"==typeof n&&(s.current={cleanup:n,isCalled:!1}),n},c)};\n//# sourceMappingURL=index.js.map\n","import type { ButtonOwnProps } from '@mui/material';\nimport {\n Button,\n IconButton,\n Tooltip,\n} from '@mui/material';\nimport { useTranslation } from 'react-i18next';\nimport useCleanupCallback from 'use-cleanup-callback';\nimport ContentCopyIcon from '@mui/icons-material/ContentCopy';\nimport DoneIcon from '@mui/icons-material/Done';\nimport ErrorIcon from '@mui/icons-material/Error';\nimport type { ReactElement } from 'react';\nimport { useState } from 'react';\n\nexport type CopyToClipboardButtonProps = {\n readonly baseIcon?: ReactElement;\n readonly buttonProps?: ButtonOwnProps;\n readonly buttonText?: string;\n readonly buttonVariant?: ButtonOwnProps['variant'];\n readonly clipboardValue?: string;\n readonly iconOnly?: boolean;\n readonly onGetClipboardValue?: () => string;\n readonly tooltipSuccessText?: string;\n};\n\nexport const CopyToClipboardButton = ({ baseIcon, buttonProps, buttonText, buttonVariant, clipboardValue, iconOnly, onGetClipboardValue, tooltipSuccessText }: CopyToClipboardButtonProps) => {\n const { t } = useTranslation();\n const [copyToClipBoardButtonColor, setCopyToClipBoardButtonColor] = useState<ButtonOwnProps['color']>('primary');\n const [copyToClipBoardIcon, setCopyToClipBoardIcon] = useState<ReactElement>(baseIcon ?? <ContentCopyIcon />);\n const [tooltipText, setTooltipText] = useState<string>(buttonText ?? t`Copy to clipboard`);\n\n\n const onCopyToClipboardButtonClick = useCleanupCallback(() => {\n let timeoutId: number;\n const perform = async () => {\n try {\n await navigator.clipboard.writeText(clipboardValue ?? onGetClipboardValue());\n setCopyToClipBoardButtonColor('success');\n setCopyToClipBoardIcon(\n <DoneIcon />,\n );\n setTooltipText(tooltipSuccessText ?? t`Copied to clipboard`);\n } catch (_error: unknown) {\n setCopyToClipBoardButtonColor('error');\n setCopyToClipBoardIcon(\n <ErrorIcon />,\n );\n setTooltipText(t`Error`);\n } finally {\n timeoutId = window.setTimeout(() => {\n setCopyToClipBoardButtonColor('primary');\n setCopyToClipBoardIcon(baseIcon ?? <ContentCopyIcon />);\n setTooltipText(buttonText ?? t`Copy to clipboard`);\n }, 2000);\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n perform();\n return () => {\n clearTimeout(timeoutId);\n };\n }, [baseIcon, buttonText, clipboardValue, onGetClipboardValue, t, tooltipSuccessText]);\n\n if (iconOnly) {\n return (\n <Tooltip\n arrow\n placement={'top'}\n title={tooltipText}\n >\n <IconButton\n {...buttonProps}\n color={copyToClipBoardButtonColor}\n onClick={onCopyToClipboardButtonClick}\n size={'small'}\n >\n {copyToClipBoardIcon}\n </IconButton>\n </Tooltip>\n );\n }\n\n return (\n <Button\n {...buttonProps}\n color={copyToClipBoardButtonColor}\n onClick={onCopyToClipboardButtonClick}\n startIcon={copyToClipBoardIcon}\n variant={buttonVariant ?? 'contained'}\n >\n {buttonText ?? t`Copy to clipboard`}\n </Button>\n );\n};\n"],"x_google_ignoreList":[1],"mappings":"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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DialogProps as MuiDialogProps, TypographyVariant, Button } from '@mui/material';
|
|
2
|
+
import { PropsWithChildren, ReactElement, RefObject } from 'react';
|
|
3
|
+
export type DialogAction = DialogActionButton | ReactElement;
|
|
4
|
+
export type DialogActionButton = {
|
|
5
|
+
label: string;
|
|
6
|
+
} & Omit<Parameters<typeof Button>[0], 'children'>;
|
|
7
|
+
export type DialogProps = {
|
|
8
|
+
readonly actionButtons?: () => ReactElement;
|
|
9
|
+
readonly actions?: DialogAction[];
|
|
10
|
+
readonly component?: (props: {
|
|
11
|
+
onDialogTitleChange?: (title: string) => void;
|
|
12
|
+
}) => ReactElement;
|
|
13
|
+
readonly dialogContentRef?: RefObject<HTMLDivElement>;
|
|
14
|
+
readonly disableBackdropClick?: boolean;
|
|
15
|
+
readonly fullScreen?: boolean;
|
|
16
|
+
readonly fullWidth?: boolean;
|
|
17
|
+
readonly maxWidth?: MuiDialogProps['maxWidth'];
|
|
18
|
+
readonly noCloseButton?: boolean;
|
|
19
|
+
readonly noPadding?: boolean;
|
|
20
|
+
readonly noTitle?: boolean;
|
|
21
|
+
readonly onClose?: () => void;
|
|
22
|
+
readonly permalink?: string;
|
|
23
|
+
readonly testId: string;
|
|
24
|
+
readonly title?: string;
|
|
25
|
+
readonly titleVariant?: TypographyVariant;
|
|
26
|
+
};
|
|
27
|
+
export declare const Dialog: ({ actionButtons: ActionButtons, actions, children, dialogContentRef, disableBackdropClick, fullScreen, fullWidth, maxWidth, noCloseButton, noPadding, noTitle, onClose, permalink, testId, title, titleVariant, }: PropsWithChildren<DialogProps>) => ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dialog';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { n as e } from "../../_chunks/rolldown-runtime.js";
|
|
2
|
+
import { t } from "../../_chunks/isObject.js";
|
|
3
|
+
import { CopyToClipboardButton as n } from "../CopyToClipboardButton/index.js";
|
|
4
|
+
import { useCallback as r } from "react";
|
|
5
|
+
import { Box as i, Button as a, Dialog as o, DialogActions as s, DialogContent as c, DialogTitle as l, IconButton as u } from "@mui/material";
|
|
6
|
+
import d from "@mui/icons-material/Close";
|
|
7
|
+
import f from "@mui/icons-material/Link";
|
|
8
|
+
import { useTranslation as p } from "react-i18next";
|
|
9
|
+
import { TestIdUtil as m } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
10
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/Dialog/Dialog.tsx
|
|
12
|
+
var _ = /* @__PURE__ */ e(t(), 1), v = (e) => (0, _.default)(e) && "label" in e, y = ({ actionButtons: e, actions: t, children: _, dialogContentRef: y, disableBackdropClick: b = !1, fullScreen: x = !1, fullWidth: S = !1, maxWidth: C = !1, noCloseButton: w = !1, noPadding: T = !1, noTitle: E = !1, onClose: D, permalink: O, testId: k, title: A, titleVariant: j = "h5" }) => {
|
|
13
|
+
let { t: M } = p(), N = r((e, t) => {
|
|
14
|
+
b && (t === "backdropClick" || t === "escapeKeyDown") || D?.();
|
|
15
|
+
}, [b, D]), P = r(() => O, [O]);
|
|
16
|
+
return /* @__PURE__ */ g(o, {
|
|
17
|
+
...m.createAttributes(k, { title: A }),
|
|
18
|
+
fullScreen: x,
|
|
19
|
+
fullWidth: S,
|
|
20
|
+
maxWidth: C,
|
|
21
|
+
onClose: N,
|
|
22
|
+
open: !0,
|
|
23
|
+
sx: { "& .MuiDialogContent-root, & .MuiCardContent-root:last-child": { padding: T ? "0" : void 0 } },
|
|
24
|
+
children: [
|
|
25
|
+
!E && /* @__PURE__ */ g(i, {
|
|
26
|
+
sx: {
|
|
27
|
+
display: "flex",
|
|
28
|
+
justifyContent: "space-between"
|
|
29
|
+
},
|
|
30
|
+
children: [/* @__PURE__ */ g(l, {
|
|
31
|
+
...m.createAttributes(`${k}-title`),
|
|
32
|
+
sx: { pr: 3 },
|
|
33
|
+
variant: j,
|
|
34
|
+
children: [A, O && /* @__PURE__ */ h(i, {
|
|
35
|
+
className: "genepix-permalink",
|
|
36
|
+
sx: {
|
|
37
|
+
display: "inline-block",
|
|
38
|
+
marginLeft: 1
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ h(n, {
|
|
41
|
+
baseIcon: /* @__PURE__ */ h(f, {}),
|
|
42
|
+
buttonProps: { sx: {
|
|
43
|
+
"& svg": { fontSize: 20 },
|
|
44
|
+
height: 20,
|
|
45
|
+
width: 20
|
|
46
|
+
} },
|
|
47
|
+
iconOnly: !0,
|
|
48
|
+
onGetClipboardValue: P
|
|
49
|
+
})
|
|
50
|
+
})]
|
|
51
|
+
}), !w && /* @__PURE__ */ h(u, {
|
|
52
|
+
...m.createAttributes(`${k}-closeButton`),
|
|
53
|
+
"aria-label": A ? M("Close dialog with title: {{title}}", { title: A }) : M`Close dialog`,
|
|
54
|
+
onClick: D,
|
|
55
|
+
sx: { color: "grey.500" },
|
|
56
|
+
title: M`Close`,
|
|
57
|
+
children: /* @__PURE__ */ h(d, {})
|
|
58
|
+
})]
|
|
59
|
+
}),
|
|
60
|
+
!!_ && /* @__PURE__ */ h(c, {
|
|
61
|
+
...m.createAttributes(`${k}-content`),
|
|
62
|
+
dividers: !!e,
|
|
63
|
+
ref: y,
|
|
64
|
+
sx: { paddingTop: x ? 0 : void 0 },
|
|
65
|
+
children: _
|
|
66
|
+
}),
|
|
67
|
+
t?.length > 0 && /* @__PURE__ */ h(s, {
|
|
68
|
+
...m.createAttributes(`${k}-actions`),
|
|
69
|
+
children: /* @__PURE__ */ h(i, {
|
|
70
|
+
sx: { "& > button": { margin: 1 } },
|
|
71
|
+
children: t.map((e) => v(e) ? /* @__PURE__ */ h(a, {
|
|
72
|
+
...e,
|
|
73
|
+
children: e.label
|
|
74
|
+
}, e.label) : e)
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
export { y as Dialog };
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import type {\n DialogProps as MuiDialogProps,\n TypographyVariant,\n} from '@mui/material';\nimport {\n Box,\n Button,\n DialogContent,\n DialogTitle,\n IconButton,\n Dialog as MuiDialog,\n DialogActions as MuiDialogActions,\n} from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport LinkIcon from '@mui/icons-material/Link';\nimport isObject from 'lodash/isObject';\nimport type {\n PropsWithChildren,\n ReactElement,\n RefObject,\n} from 'react';\nimport { useCallback } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { CopyToClipboardButton } from '../CopyToClipboardButton';\n\nexport type DialogAction = DialogActionButton | ReactElement;\n\nexport type DialogActionButton = {\n label: string;\n} & Omit<Parameters<typeof Button>[0], 'children'>;\n\nexport type DialogProps = {\n readonly actionButtons?: () => ReactElement;\n readonly actions?: DialogAction[];\n readonly component?: (props: { onDialogTitleChange?: (title: string) => void }) => ReactElement;\n readonly dialogContentRef?: RefObject<HTMLDivElement>;\n readonly disableBackdropClick?: boolean;\n readonly fullScreen?: boolean;\n readonly fullWidth?: boolean;\n readonly maxWidth?: MuiDialogProps['maxWidth'];\n readonly noCloseButton?: boolean;\n readonly noPadding?: boolean;\n readonly noTitle?: boolean;\n readonly onClose?: () => void;\n readonly permalink?: string;\n readonly testId: string;\n readonly title?: string;\n readonly titleVariant?: TypographyVariant;\n};\n\nconst isDialogActionButton = (action: DialogAction): action is DialogActionButton => {\n return isObject(action) && 'label' in action;\n};\n\nexport const Dialog = ({\n actionButtons: ActionButtons,\n actions,\n children,\n dialogContentRef,\n disableBackdropClick = false,\n fullScreen = false,\n fullWidth = false,\n maxWidth = false,\n noCloseButton = false,\n noPadding = false,\n noTitle = false,\n onClose,\n permalink,\n testId,\n title,\n titleVariant = 'h5',\n}: PropsWithChildren<DialogProps>): ReactElement => {\n const { t } = useTranslation();\n const onMuiDialogClose = useCallback<NonNullable<MuiDialogProps['onClose']>>((_event, reason) => {\n if (disableBackdropClick && (reason === 'backdropClick' || reason === 'escapeKeyDown')) {\n return;\n }\n onClose?.();\n }, [disableBackdropClick, onClose]);\n\n const onGetClipboardValue = useCallback(() => {\n return permalink;\n }, [permalink]);\n\n return (\n <MuiDialog\n {...TestIdUtil.createAttributes(testId, { title })}\n fullScreen={fullScreen}\n fullWidth={fullWidth}\n maxWidth={maxWidth}\n onClose={onMuiDialogClose}\n open\n sx={{\n '& .MuiDialogContent-root, & .MuiCardContent-root:last-child': {\n padding: noPadding ? '0' : undefined,\n },\n }}\n >\n {!noTitle && (\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n }}\n >\n <DialogTitle\n {...TestIdUtil.createAttributes(`${testId}-title`)}\n sx={{\n pr: 3,\n }}\n variant={titleVariant}\n >\n {title}\n {permalink && (\n <Box\n className={'genepix-permalink'}\n sx={{\n display: 'inline-block',\n marginLeft: 1,\n }}\n >\n <CopyToClipboardButton\n baseIcon={<LinkIcon />}\n buttonProps={{\n sx: {\n '& svg': {\n fontSize: 20,\n },\n height: 20,\n width: 20,\n },\n }}\n iconOnly\n onGetClipboardValue={onGetClipboardValue}\n />\n </Box>\n )}\n </DialogTitle>\n {!noCloseButton && (\n <IconButton\n {...TestIdUtil.createAttributes(`${testId}-closeButton`)}\n aria-label={title ? t('Close dialog with title: {{title}}', { title }) : t`Close dialog`}\n onClick={onClose}\n sx={{\n color: 'grey.500',\n }}\n title={t`Close`}\n >\n <CloseIcon />\n </IconButton>\n )}\n </Box>\n )}\n {!!children && (\n <DialogContent\n {...TestIdUtil.createAttributes(`${testId}-content`)}\n dividers={!!ActionButtons}\n ref={dialogContentRef}\n sx={{\n paddingTop: fullScreen ? 0 : undefined,\n }}\n >\n {children}\n </DialogContent>\n )}\n {actions?.length > 0 && (\n <MuiDialogActions {...TestIdUtil.createAttributes(`${testId}-actions`)}>\n <Box\n sx={{\n '& > button': {\n margin: 1,\n },\n }}\n >\n {actions.map((action) => {\n if (isDialogActionButton(action)) {\n return (\n <Button\n key={action.label}\n {...action}\n >\n {action.label}\n </Button>\n );\n }\n return action;\n })}\n </Box>\n </MuiDialogActions>\n )}\n </MuiDialog>\n );\n};\n"],"mappings":";;;;;;;;;;;mCAoDM,KAAwB,OAC5B,GAAO,EAAA,QAAA,CAAS,CAAM,KAAK,WAAW,GAG3B,KAAU,EACrB,eAAe,GACf,YACA,aACA,qBACA,0BAAuB,IACvB,gBAAa,IACb,eAAY,IACZ,cAAW,IACX,mBAAgB,IAChB,eAAY,IACZ,aAAU,IACV,YACA,cACA,WACA,UACA,kBAAe,WACmC;CAClD,IAAM,EAAE,SAAM,EAAe,GACvB,IAAmB,GAAqD,GAAQ,MAAW;EAC3F,MAAyB,MAAW,mBAAmB,MAAW,oBAGtE,IAAU;CACZ,GAAG,CAAC,GAAsB,CAAO,CAAC,GAE5B,IAAsB,QACnB,GACN,CAAC,CAAS,CAAC;CAEd,OACE,kBAAC,GAAD;EACE,GAAI,EAAW,iBAAiB,GAAQ,EAAE,SAAM,CAAC;EACrC;EACD;EACD;EACV,SAAS;EACT,MAAA;EACA,IAAI,EACF,+DAA+D,EAC7D,SAAS,IAAY,MAAM,KAAA,EAC7B,EACF;EAXF,UAAA;GAaG,CAAC,KACA,kBAAC,GAAD;IACE,IAAI;KACF,SAAS;KACT,gBAAgB;IAClB;IAJF,UAAA,CAME,kBAAC,GAAD;KACE,GAAI,EAAW,iBAAiB,GAAG,EAAO,OAAO;KACjD,IAAI,EACF,IAAI,EACN;KACA,SAAS;KALX,UAAA,CAOG,GACA,KACC,kBAAC,GAAD;MACE,WAAW;MACX,IAAI;OACF,SAAS;OACT,YAAY;MACd;MAEA,UAAA,kBAAC,GAAD;OACE,UAAU,kBAAC,GAAD,CAAW,CAAA;OACrB,aAAa,EACX,IAAI;QACF,SAAS,EACP,UAAU,GACZ;QACA,QAAQ;QACR,OAAO;OACT,EACF;OACA,UAAA;OACqB;MACtB,CAAA;KACE,CAAA,CAEI;IACZ,CAAA,GAAA,CAAC,KACA,kBAAC,GAAD;KACE,GAAI,EAAW,iBAAiB,GAAG,EAAO,aAAa;KACvD,cAAY,IAAQ,EAAE,sCAAsC,EAAE,SAAM,CAAC,IAAI,CAAC;KAC1E,SAAS;KACT,IAAI,EACF,OAAO,WACT;KACA,OAAO,CAAC;KAER,UAAA,kBAAC,GAAD,CAAY,CAAA;IACF,CAAA,CAEX;;GAEN,CAAC,CAAC,KACD,kBAAC,GAAD;IACE,GAAI,EAAW,iBAAiB,GAAG,EAAO,SAAS;IACnD,UAAU,CAAC,CAAC;IACZ,KAAK;IACL,IAAI,EACF,YAAY,IAAa,IAAI,KAAA,EAC/B;IAEC;GACY,CAAA;GAEhB,GAAS,SAAS,KACjB,kBAAC,GAAD;IAAkB,GAAI,EAAW,iBAAiB,GAAG,EAAO,SAAS;IACnE,UAAA,kBAAC,GAAD;KACE,IAAI,EACF,cAAc,EACZ,QAAQ,EACV,EACF;KAEC,UAAA,EAAQ,KAAK,MACR,EAAqB,CAAM,IAE3B,kBAAC,GAAD;MAEE,GAAI;MAEH,UAAA,EAAO;KACF,GAJD,EAAO,KAIN,IAGL,CACR;IACE,CAAA;GACW,CAAA;EAEX;;AAEf"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LinearProgressProps } from '@mui/material';
|
|
2
|
+
export type LinearProgressWithLabelProps = {
|
|
3
|
+
readonly value: number;
|
|
4
|
+
} & LinearProgressProps;
|
|
5
|
+
export declare const LinearProgressWithLabel: ({ value, ...props }: LinearProgressWithLabelProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LinearProgressWithLabel';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Box as e, LinearProgress as t, Typography as n } from "@mui/material";
|
|
2
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/LinearProgressWithLabel/LinearProgressWithLabel.tsx
|
|
4
|
+
var a = ({ value: a, ...o }) => /* @__PURE__ */ i(e, {
|
|
5
|
+
sx: {
|
|
6
|
+
alignItems: "center",
|
|
7
|
+
display: "flex"
|
|
8
|
+
},
|
|
9
|
+
children: [/* @__PURE__ */ r(e, {
|
|
10
|
+
sx: {
|
|
11
|
+
mr: 1,
|
|
12
|
+
width: "100%"
|
|
13
|
+
},
|
|
14
|
+
children: /* @__PURE__ */ r(t, {
|
|
15
|
+
value: a > 1 ? a : void 0,
|
|
16
|
+
variant: a > 1 ? "determinate" : "indeterminate",
|
|
17
|
+
...o
|
|
18
|
+
})
|
|
19
|
+
}), a > 1 && /* @__PURE__ */ r(e, {
|
|
20
|
+
sx: { minWidth: 35 },
|
|
21
|
+
children: /* @__PURE__ */ r(n, {
|
|
22
|
+
sx: { color: "text.secondary" },
|
|
23
|
+
variant: "body2",
|
|
24
|
+
children: `${Math.round(a)}%`
|
|
25
|
+
})
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { a as LinearProgressWithLabel };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/LinearProgressWithLabel/LinearProgressWithLabel.tsx"],"sourcesContent":["import type { LinearProgressProps } from '@mui/material';\nimport {\n Box,\n LinearProgress,\n Typography,\n} from '@mui/material';\n\nexport type LinearProgressWithLabelProps = {\n readonly value: number;\n} & LinearProgressProps;\n\nexport const LinearProgressWithLabel = ({ value, ...props }: LinearProgressWithLabelProps) => {\n return (\n <Box sx={{ alignItems: 'center', display: 'flex' }}>\n <Box sx={{ mr: 1, width: '100%' }}>\n <LinearProgress\n value={value > 1 ? value : undefined}\n variant={value > 1 ? 'determinate' : 'indeterminate'}\n {...props}\n />\n </Box>\n {value > 1 && (\n <Box sx={{ minWidth: 35 }}>\n <Typography\n sx={{ color: 'text.secondary' }}\n variant={'body2'}\n >\n {`${Math.round(value)}%`}\n </Typography>\n </Box>\n )}\n </Box>\n );\n};\n"],"mappings":";;;AAWA,IAAa,KAA2B,EAAE,UAAO,GAAG,QAEhD,kBAAC,GAAD;CAAK,IAAI;EAAE,YAAY;EAAU,SAAS;CAAO;CAAjD,UAAA,CACE,kBAAC,GAAD;EAAK,IAAI;GAAE,IAAI;GAAG,OAAO;EAAO;EAC9B,UAAA,kBAAC,GAAD;GACE,OAAO,IAAQ,IAAI,IAAQ,KAAA;GAC3B,SAAS,IAAQ,IAAI,gBAAgB;GACrC,GAAI;EACL,CAAA;CACE,CAAA,GACJ,IAAQ,KACP,kBAAC,GAAD;EAAK,IAAI,EAAE,UAAU,GAAG;EACtB,UAAA,kBAAC,GAAD;GACE,IAAI,EAAE,OAAO,iBAAiB;GAC9B,SAAS;GAER,UAAA,GAAG,KAAK,MAAM,CAAK,EAAE;EACZ,CAAA;CACT,CAAA,CAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LoadingIndicator';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LinearProgress as e, styled as t } from "@mui/material";
|
|
2
|
+
//#region src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
3
|
+
var n = t(e)(() => ({
|
|
4
|
+
left: 0,
|
|
5
|
+
position: "absolute",
|
|
6
|
+
right: 0,
|
|
7
|
+
zIndex: 1
|
|
8
|
+
}));
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as LoadingIndicator };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/LoadingIndicator/LoadingIndicator.tsx"],"sourcesContent":["import {\n LinearProgress,\n styled,\n} from '@mui/material';\n\nexport const LoadingIndicator = styled(LinearProgress)(() => ({\n left: 0,\n position: 'absolute',\n right: 0,\n zIndex: 1,\n})) as typeof LinearProgress;\n"],"mappings":";;AAKA,IAAa,IAAmB,EAAO,CAAc,CAAC,QAAQ;CAC5D,MAAM;CACN,UAAU;CACV,OAAO;CACP,QAAQ;AACV,EAAE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MenuItemProps } from '@mui/material/MenuItem';
|
|
2
|
+
import { SxProps } from '@mui/material';
|
|
3
|
+
import { MouseEvent, ReactNode, Ref } from 'react';
|
|
4
|
+
type IconMenuItemProps = {
|
|
5
|
+
readonly checked?: 'false' | 'mixed' | 'true';
|
|
6
|
+
readonly className?: string;
|
|
7
|
+
readonly disabled?: boolean;
|
|
8
|
+
readonly divider?: boolean;
|
|
9
|
+
readonly label?: string;
|
|
10
|
+
readonly leftIcon?: ReactNode;
|
|
11
|
+
readonly MenuItemProps?: MenuItemProps;
|
|
12
|
+
readonly onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
13
|
+
readonly ref?: Ref<HTMLLIElement>;
|
|
14
|
+
readonly rightIcon?: ReactNode;
|
|
15
|
+
readonly sx?: SxProps;
|
|
16
|
+
};
|
|
17
|
+
export declare const IconMenuItem: ({ checked, className, label, leftIcon, MenuItemProps, ref, rightIcon, ...props }: IconMenuItemProps) => import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
2
|
+
import { MenuProps } from '@mui/material/Menu';
|
|
3
|
+
import { MouseEvent, ReactNode, Ref } from 'react';
|
|
4
|
+
import { BoxProps } from '@mui/material';
|
|
5
|
+
import { MenuItemData } from '../../models/nestedMenu';
|
|
6
|
+
interface NestedDropdownProps {
|
|
7
|
+
readonly ButtonProps?: Partial<ButtonProps>;
|
|
8
|
+
readonly children?: ReactNode;
|
|
9
|
+
readonly ContainerProps?: Partial<BoxProps>;
|
|
10
|
+
readonly menuItemsData?: MenuItemData;
|
|
11
|
+
readonly MenuProps?: Partial<MenuProps>;
|
|
12
|
+
readonly onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
readonly ref?: Ref<HTMLDivElement>;
|
|
14
|
+
readonly showTopLevelTooltip?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const NestedDropdown: ({ ref, ...props }: NestedDropdownProps) => import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MenuProps } from '@mui/material/Menu';
|
|
2
|
+
import { MenuItemProps } from '@mui/material/MenuItem';
|
|
3
|
+
import { ElementType, HTMLAttributes, ReactNode, Ref } from 'react';
|
|
4
|
+
export type NestedMenuItemProps = {
|
|
5
|
+
readonly active?: boolean;
|
|
6
|
+
readonly button?: true;
|
|
7
|
+
readonly callback?: () => void;
|
|
8
|
+
readonly checked?: 'false' | 'mixed' | 'true';
|
|
9
|
+
readonly children?: ReactNode;
|
|
10
|
+
readonly className?: string;
|
|
11
|
+
readonly component?: ElementType;
|
|
12
|
+
readonly ContainerProps?: HTMLAttributes<HTMLElement>;
|
|
13
|
+
readonly disabled?: boolean;
|
|
14
|
+
readonly label?: string;
|
|
15
|
+
readonly leftIcon?: ReactNode;
|
|
16
|
+
readonly MenuProps?: Partial<Omit<MenuProps, 'children'>>;
|
|
17
|
+
readonly parentMenuOpen: boolean;
|
|
18
|
+
readonly ref?: Ref<HTMLLIElement>;
|
|
19
|
+
readonly rightIcon?: ReactNode;
|
|
20
|
+
readonly tabIndex?: number;
|
|
21
|
+
} & Omit<MenuItemProps, 'button'>;
|
|
22
|
+
export declare const NestedMenuItem: ({ ref, ...props }: NestedMenuItemProps) => import("react").JSX.Element;
|