@gen-epix/ui-core-components 4.3.1 → 4.4.1
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.map +1 -1
- package/dist/components/BackdropSpinner/index.js.map +1 -1
- package/dist/components/Confirmation/index.js.map +1 -1
- package/dist/components/CopyToClipboardButton/index.js +1 -1
- package/dist/components/CopyToClipboardButton/index.js.map +1 -1
- package/dist/components/Dialog/index.js.map +1 -1
- package/dist/components/FileDropZone/index.js.map +1 -1
- package/dist/components/LinearProgressWithLabel/index.js.map +1 -1
- package/dist/components/LoadingIndicator/index.js.map +1 -1
- package/dist/components/MultiFileUploader/index.js +2 -6
- package/dist/components/MultiFileUploader/index.js.map +1 -1
- package/dist/components/NestedMenu/NestedDropdown.d.ts +1 -1
- package/dist/components/NestedMenu/index.js.map +1 -1
- package/dist/components/NestedMenu/nestedMenuItemsFromObject.d.ts +1 -1
- package/dist/components/Spinner/index.js.map +1 -1
- package/dist/components/Stepper/index.js.map +1 -1
- package/dist/context/uiCoreComponentsConfigContext/index.js.map +1 -1
- package/dist/hoc/withDialog/index.js.map +1 -1
- package/package.json +21 -21
- /package/dist/models/{nestedMenu.d.ts → nested-menu.models.d.ts} +0 -0
- /package/dist/models/{nestedMenu.js → nested-menu.models.js} +0 -0
|
@@ -1 +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"],"
|
|
1
|
+
{"version":3,"file":"isObject.js","names":["__commonJSMin","require_isObject","isObject","type","value"],"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"],"ignoreList":[0],"mappings":";;;CAyBA,SAASE,EAAS,GAAO;EACvB,IAAIC,IAAO,OAAOC;EAClB,OAAOA,KAAS,SAASD,KAAQ,YAAYA,KAAQ;CACvD;CAEA,EAAO,UAAUD"}
|
|
@@ -1 +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 backgroundColor?: string;\n readonly open: boolean;\n} & Omit<SpinnerProps, 'inline'>;\n\nexport const BackdropSpinner = ({ backgroundColor, open, ...spinnerProps }: BackdropSpinnerProps) => {\n const theme = useTheme();\n return (\n <Backdrop\n open={open}\n sx={{\n backdropFilter: 'blur(3px)',\n backgroundColor: backgroundColor ?? (theme.palette.mode === 'light' ? 'rgba(255, 255, 255, 0.6)' : 'rgba(0, 0, 0, 0.6)'),\n zIndex: theme.zIndex.drawer + 1,\n }}\n >\n {open && (\n <Spinner\n {...spinnerProps}\n />\n )}\n </Backdrop>\n );\n};\n"],"mappings":";;;;AAaA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["BackdropSpinner","spinnerProps","theme","useTheme","Backdrop","backgroundColor","open","Spinner"],"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 backgroundColor?: string;\n readonly open: boolean;\n} & Omit<SpinnerProps, 'inline'>;\n\nexport const BackdropSpinner = ({ backgroundColor, open, ...spinnerProps }: BackdropSpinnerProps) => {\n const theme = useTheme();\n return (\n <Backdrop\n open={open}\n sx={{\n backdropFilter: 'blur(3px)',\n backgroundColor: backgroundColor ?? (theme.palette.mode === 'light' ? 'rgba(255, 255, 255, 0.6)' : 'rgba(0, 0, 0, 0.6)'),\n zIndex: theme.zIndex.drawer + 1,\n }}\n >\n {open && (\n <Spinner\n {...spinnerProps}\n />\n )}\n </Backdrop>\n );\n};\n"],"mappings":";;;;AAaA,IAAaA,KAAmB,EAAE,oBAAiB,SAAM,GAAGC,QAAyC;CACnG,IAAMC,IAAQC,EAAS;CACvB,OACE,kBAACC,GAAD;EACQ;EACN,IAAI;GACF,gBAAgB;GAChB,iBAAiBC,MAAoBH,EAAM,QAAQ,SAAS,UAAU,6BAA6B;GACnG,QAAQA,EAAM,OAAO,SAAS;EAChC;EAEC,UAAAI,KACC,kBAACC,GAAD,EACE,GAAIN,EACL,CAAA;CAEK,CAAA;AAEd"}
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"index.js","names":["ConfirmationRender","useTranslation","onCancelButtonClick","useCallback","onCancel","openProps","onClose","onConfirmButtonClick","onConfirm","useEffect","actions","cancelLabel","TestIdUtil","confirmLabel","onActionsChange","t","body","DialogContentText","Confirmation","withDialog"],"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,IAAaA,KACX,EACE,SACA,gBACA,iBACA,oBACA,aACA,YACA,cACA,mBAEe;CACjB,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAAsBC,QAAwB;EAIlD,AAHIC,KACFA,EAASC,CAAS,GAEpBC,EAAQ;CACV,GAAG;EAACF;EAAUE;EAASD;CAAS,CAAC,GAE3BE,IAAuBJ,QAAwB;EAEnD,AADAK,EAAUH,CAAS,GACnBC,EAAQ;CACV,GAAG;EAACE;EAAWH;EAAWC;CAAO,CAAC;CA2BlC,OAzBAG,QAAgB;EACd,IAAMC,IAA0B,CAAC;EAkBjC,AAjBIC,KACFD,EAAQ,KAAK;GACX,GAAGE,EAAW,iBAAiB,2BAA2B;GAC1D,OAAO;GACP,OAAOD,KAAe,CAAC;GACvB,SAAST;GACT,SAAS;EACX,CAAC,GAEHQ,EAAQ,KAAK;GACX,GAAGE,EAAW,iBAAiB,4BAA4B;GAC3D,WAAW;GACX,OAAO;GACP,OAAOC,KAAgB,CAAC;GACxB,SAASN;GACT,SAAS;EACX,CAAC,GACDO,EAAgBJ,CAAO;CACzB,GAAG;EAACC;EAAaT;EAAqBW;EAAcN;EAAsBO;EAAiBV;EAAUW;CAAC,CAAC,GAElGC,IAIH,kBAACC,GAAD;EAAmB,GAAIL,EAAW,iBAAiB,0BAA0B;EAC1E,UAAAI;CACgB,CAAA,IALZ;AAOX,GC3EaE,IAAeC,EAAuCnB,GAAoB;CACrF,WAAW;CACX,UAAU;CACV,QAAQ;AACV,CAAC"}
|
|
@@ -9,7 +9,7 @@ import u from "@mui/icons-material/Error";
|
|
|
9
9
|
import { jsx as d } from "react/jsx-runtime";
|
|
10
10
|
//#region builtin:esm-external-require-react
|
|
11
11
|
var f = /* @__PURE__ */ t(((e, t) => {
|
|
12
|
-
t.exports = { ...n };
|
|
12
|
+
t.exports = Object.prototype.hasOwnProperty.call(n, "module.exports") ? n["module.exports"] : { ...n };
|
|
13
13
|
})), p = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
14
14
|
var n = f();
|
|
15
15
|
function r(e) {
|
|
@@ -1 +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.3.
|
|
1
|
+
{"version":3,"file":"index.js","names":["useCleanupCallback","__toESM","m","ContentCopyIcon","DoneIcon","ErrorIcon","require_builtin_esm_external_require_react","import_dist","__commonJSMin","e","n","r","l","a","t","o","i","p","f","s","C","U","c","u","CopyToClipboardButton","useTranslation","copyToClipBoardButtonColor","setCopyToClipBoardButtonColor","useState","copyToClipBoardIcon","setCopyToClipBoardIcon","baseIcon","tooltipText","setTooltipText","buttonText","onCopyToClipboardButtonClick","timeoutId","clipboardValue","onGetClipboardValue","tooltipSuccessText","iconOnly","Tooltip","IconButton","buttonProps","Button","buttonVariant"],"sources":["../../../builtin:esm-external-require-react","../../../../../node_modules/.pnpm/use-cleanup-callback@1.3.0_react@19.3.1/node_modules/use-cleanup-callback/dist/index.js","../../../src/components/CopyToClipboardButton/CopyToClipboardButton.tsx"],"sourcesContent":["import * as m from 'react';module.exports = Object.prototype.hasOwnProperty.call(m, 'module.exports') ? m['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"],"ignoreList":[1],"mappings":";;;;;;;;;;;CAA2B,EAAO,UAAU,OAAO,UAAU,eAAe,KAAKE,GAAG,gBAAgB,IAAIA,EAAE,oBAAoB,EAAE,GAAGA,EAAE;;CCArI,IAAI,IAAAI,EAAA;CAAmB,SAASG,EAAE,GAAE;EAAC,IAAIA,IAAEC,EAAE;EAAQ,EAAE,YAAsB,OAAOD,KAAnB,eAAuB,EAAE,WAAS,CAAC,GAAEA,EAAE;CAAE;CAAC,EAAO,UAAQ,SAAS,GAAE,GAAE,GAAE;EAAC,IAAIE,IAAWC,MAAT,KAAK,IAAM,CAAC,IAAEA,GAAEC,IAAEF,EAAE,eAAcG,IAAWD,MAAT,KAAK,KAAOA,GAAEE,IAAEJ,EAAE,qBAAoBK,IAAWD,MAAT,KAAK,KAAOA,GAAEE,IAAEN,EAAE,kBAAiBO,IAAWD,MAAT,KAAK,KAAOA,GAAEE,IAAE,EAAE,OAAO;GAAC,SAAQ;GAAK,UAAS,CAAC;EAAC,CAAC,GAAEC,IAAE;GAAC,eAAcN;GAAE,qBAAoBE;GAAE,kBAAiBE;EAAC,GAAEG,IAAE,EAAE,OAAOD,CAAC;EAAE,OAAO,EAAE,UAAU,WAAU;GAAC,EAAE,UAAQA;EAAC,CAAC,GAAE,EAAE,UAAU,WAAU;GAAC,OAAO,WAAU;IAAC,EAAE,QAAQ,uBAAqBX,EAAEU,EAAE,OAAO;GAAC;EAAC,GAAE,CAACG,CAAC,CAAC,GAAE,EAAE,UAAU,WAAU;GAAC,OAAO,WAAU;IAAC,EAAE,QAAQ,oBAAkBb,EAAEU,EAAE,OAAO;GAAC;EAAC,GAAE,CAAC,CAAC,GAAE,EAA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;IACnD,GAAG,GAAI;GACT;EACF,EAEA,CAAQ,SACK;GACX,aAAaE,CAAS;EACxB;CACF,GAAG;EAACL;EAAUG;EAAYG;EAAgBC;EAAqBxB;EAAGyB;CAAkB,CAAC;CAqBrF,OAnBIC,IAEA,kBAACC,GAAD;EACE,OAAA;EACA,WAAW;EACX,OAAOT;EAEP,UAAA,kBAACU,GAAD;GACE,GAAIC;GACJ,OAAOjB;GACP,SAASS;GACT,MAAM;GAEL,UAAAN;EACS,CAAA;CACL,CAAA,IAKX,kBAACe,GAAD;EACE,GAAID;EACJ,OAAOjB;EACP,SAASS;EACT,WAAWN;EACX,SAASgB,KAAiB;EAEzB,UAAAX,KAAc,CAAC;CACV,CAAA;AAEZ"}
|
|
@@ -1 +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 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\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":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["isObject","MuiDialog","MuiDialogActions","__toESM","Dialog$1","CloseIcon","LinkIcon","import_isObject","require_isObject","isDialogActionButton","action","Dialog","useTranslation","onMuiDialogClose","useCallback","reason","onClose","disableBackdropClick","onGetClipboardValue","permalink","TestIdUtil","testId","noPadding","noTitle","Box","DialogTitle","titleVariant","title","CopyToClipboardButton","noCloseButton","IconButton","t","children","DialogContent","dialogContentRef","fullScreen","actions","DialogActions","Button"],"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 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\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":";;;;;;;;;;;mCAoDMS,KAAwB,OAC5B,GAAOT,EAAAA,QAAAA,CAASU,CAAM,KAAK,WAAWA,GAG3BC,KAAU,EACrB,YACA,aACA,qBACA,0BAAuB,IACvB,gBAAa,IACb,eAAY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,CAAC,CAAC2B,KACD,kBAACC,GAAD;IACE,GAAIb,EAAW,iBAAiB,GAAGC,EAAO,SAAS;IACnD,UAAA;IACA,KAAKa;IACL,IAAI,EACF,YAAYC,IAAa,IAAI,KAAA,EAC/B;IAEC;GACY,CAAA;GAEhBC,GAAS,SAAS,KACjB,kBAAClC,GAAD;IAAkB,GAAIkB,EAAW,iBAAiB,GAAGC,EAAO,SAAS;IACnE,UAAA,kBAACG,GAAD;KACE,IAAI,EACF,cAAc,EACZ,QAAQ,EACV,EACF;KAEC,UAAAY,EAAQ,KAAK,MACR3B,EAAqBC,CAAM,IAE3B,kBAAC4B,GAAD;MAEE,GAAI5B;MAEH,UAAAA,EAAO;KACF,GAJDA,EAAO,KAIN,IAGLA,CACR;IACE,CAAA;GACW,CAAA;EAEX;;AAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import type {\n ChangeEvent,\n DragEvent,\n KeyboardEvent as ReactKeyboardEvent,\n Ref,\n} from 'react';\nimport {\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport {\n Box,\n Typography,\n} from '@mui/material';\nimport { visuallyHidden } from '@mui/utils';\nimport CloudUploadOutlinedIcon from '@mui/icons-material/CloudUploadOutlined';\nimport InsertDriveFileOutlinedIcon from '@mui/icons-material/InsertDriveFileOutlined';\nimport { useTranslation } from 'react-i18next';\nimport { FileUtil } from '@gen-epix/ui-core/utils/FileUtil';\n\nexport interface FileDropZoneProps {\n readonly accept: string;\n readonly ariaDescribedBy?: string;\n readonly disabled?: boolean;\n readonly error?: boolean;\n readonly files: FileList | null;\n readonly helperText?: string;\n readonly label?: string;\n readonly labelledById?: string;\n readonly multiple?: boolean;\n readonly onBlur?: () => void;\n readonly onFilesSelected: (files: FileList) => void;\n readonly ref?: Ref<HTMLDivElement>;\n}\n\nexport const FileDropZone = ({\n accept,\n ariaDescribedBy,\n disabled,\n error,\n files,\n helperText,\n label,\n labelledById,\n multiple = false,\n onBlur,\n onFilesSelected,\n ref,\n}: FileDropZoneProps) => {\n const { t } = useTranslation();\n const [isDragOver, setIsDragOver] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const descriptionId = useId();\n\n const translatedLabel = multiple\n ? t('{{label}} ({{accept}})', { accept: accept.split(',').join(', '), label })\n : t('{{label}} ({{accept}})', { accept: accept.split(',').join(', '), label });\n\n useEffect(() => {\n // allows re-selecting the same file after it was cleared externally\n if (!files && inputRef.current) {\n inputRef.current.value = '';\n }\n }, [files]);\n\n const onDragOver = useCallback((e: DragEvent) => {\n e.preventDefault();\n if (disabled) {\n return;\n }\n setIsDragOver(true);\n }, [disabled]);\n\n const onDragLeave = useCallback(() => {\n setIsDragOver(false);\n }, []);\n\n const onDrop = useCallback((e: DragEvent) => {\n e.preventDefault();\n setIsDragOver(false);\n if (disabled) {\n return;\n }\n if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {\n onFilesSelected(e.dataTransfer.files);\n }\n }, [disabled, onFilesSelected]);\n\n const onFileChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files.length > 0) {\n onFilesSelected(e.target.files);\n }\n }, [onFilesSelected]);\n\n const onClick = useCallback(() => {\n if (disabled) {\n return;\n }\n inputRef.current?.click();\n }, [disabled]);\n\n const onKeyDown = useCallback((e: ReactKeyboardEvent) => {\n if (disabled) {\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n inputRef.current?.click();\n }\n }, [disabled]);\n\n const selectedFiles = files ? Array.from(files) : [];\n const hasFiles = selectedFiles.length > 0;\n const totalSize = selectedFiles.reduce((sum, currentFile) => sum + currentFile.size, 0);\n\n let backgroundColor = 'background.paper';\n let borderColor = 'divider';\n if (disabled) {\n backgroundColor = 'action.disabledBackground';\n borderColor = 'action.disabled';\n } else if (isDragOver) {\n backgroundColor = 'action.hover';\n borderColor = 'primary.main';\n } else if (error) {\n borderColor = 'error.main';\n }\n\n return (\n <Box\n aria-describedby={ariaDescribedBy ? `${ariaDescribedBy} ${descriptionId}` : descriptionId}\n aria-disabled={disabled}\n aria-label={labelledById ? undefined : translatedLabel}\n aria-labelledby={labelledById}\n onBlur={onBlur}\n onClick={onClick}\n onDragLeave={onDragLeave}\n onDragOver={onDragOver}\n onDrop={onDrop}\n onKeyDown={onKeyDown}\n ref={ref}\n role={'button'}\n sx={{\n '&:focus-visible': {\n borderColor: 'primary.main',\n borderStyle: 'solid',\n },\n alignItems: 'center',\n backgroundColor,\n border: '2px dashed',\n borderColor,\n borderRadius: 2,\n cursor: disabled ? 'default' : 'pointer',\n display: 'flex',\n flexDirection: 'column',\n gap: 1.5,\n justifyContent: 'center',\n minHeight: 180,\n opacity: disabled ? 0.6 : 1,\n padding: 3,\n pointerEvents: disabled ? 'none' : 'auto',\n textAlign: 'center',\n transition: 'all 0.2s ease',\n }}\n tabIndex={disabled ? -1 : 0}\n >\n <input\n accept={accept}\n disabled={disabled}\n multiple={multiple}\n onChange={onFileChange}\n ref={inputRef}\n style={{ display: 'none' }}\n type={'file'}\n />\n <span\n id={descriptionId}\n style={visuallyHidden}\n >\n {translatedLabel}\n {helperText ? ` ${helperText}` : ''}\n </span>\n <Box\n aria-atomic\n aria-live={'polite'}\n component={'span'}\n sx={{ alignItems: 'center', display: 'flex', flexDirection: 'column', gap: 1.5 }}\n >\n {hasFiles ? (\n <>\n <InsertDriveFileOutlinedIcon\n color={'primary'}\n sx={{ fontSize: 40 }}\n />\n <Typography\n color={'success.main'}\n sx={{ fontWeight: 600 }}\n variant={'subtitle1'}\n >\n {selectedFiles.map((currentFile) => currentFile.name).join(', ')}\n </Typography>\n <Typography\n color={'text.secondary'}\n variant={'caption'}\n >\n {FileUtil.getReadableFileSize(totalSize)}\n {' — '}\n {t('Click or drag to replace')}\n </Typography>\n </>\n ) : (\n <>\n <CloudUploadOutlinedIcon\n color={'primary'}\n sx={{ fontSize: 44 }}\n />\n <Typography\n sx={{ fontWeight: 600 }}\n variant={'subtitle1'}\n >\n {translatedLabel}\n </Typography>\n <Typography\n color={'text.secondary'}\n variant={'body2'}\n >\n {helperText || t('Drag & drop your file here, or click to browse')}\n </Typography>\n <Box\n aria-hidden\n component={'span'}\n sx={{\n border: '1px solid',\n borderColor: disabled ? 'action.disabled' : 'primary.main',\n borderRadius: 1,\n color: disabled ? 'action.disabled' : 'primary.main',\n fontSize: '0.8125rem',\n fontWeight: 500,\n letterSpacing: '0.02857em',\n mt: 1,\n padding: '5px 14px',\n textTransform: 'uppercase',\n }}\n >\n {t('Choose File')}\n </Box>\n </>\n )}\n </Box>\n </Box>\n );\n};\n"],"mappings":";;;;;;;;;AAsCA,IAAa,KAAgB,EAC3B,WACA,oBACA,aACA,UACA,UACA,eACA,UACA,iBACA,cAAW,IACX,WACA,oBACA,aACuB;CACvB,IAAM,EAAE,SAAM,EAAe,GACvB,CAAC,GAAY,KAAiB,EAAS,EAAK,GAC5C,IAAW,EAAyB,IAAI,GACxC,IAAgB,EAAM,GAEtB,IACF,EAAE,0BAA0B;EAAE,QAAQ,EAAO,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI;EAAG;CAAM,CACC;CAE/E,QAAgB;EAEd,AAAI,CAAC,KAAS,EAAS,YACrB,EAAS,QAAQ,QAAQ;CAE7B,GAAG,CAAC,CAAK,CAAC;CAEV,IAAM,IAAa,GAAa,MAAiB;EAC/C,EAAE,eAAe,GACb,MAGJ,EAAc,EAAI;CACpB,GAAG,CAAC,CAAQ,CAAC,GAEP,IAAc,QAAkB;EACpC,EAAc,EAAK;CACrB,GAAG,CAAC,CAAC,GAEC,IAAS,GAAa,MAAiB;EAC3C,EAAE,eAAe,GACjB,EAAc,EAAK,GACf,MAGA,EAAE,aAAa,SAAS,EAAE,aAAa,MAAM,SAAS,KACxD,EAAgB,EAAE,aAAa,KAAK;CAExC,GAAG,CAAC,GAAU,CAAe,CAAC,GAExB,IAAe,GAAa,MAAqC;EAC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G,GACA,IAAa,IAAI,MAAe,EAC7B;;GACN,kBAAC,GAAD;IACE,eAAA;IACA,aAAW;IACX,WAAW;IACX,IAAI;KAAE,YAAY;KAAU,SAAS;KAAQ,eAAe;KAAU,KAAK;IAAI;IAE9E,UAAA,IACC,kBAAA,GAAA,EAAA,UAAA;KACE,kBAAC,GAAD;MACE,OAAO;MACP,IAAI,EAAE,UAAU,GAAG;KACpB,CAAA;KACD,kBAAC,GAAD;MACE,OAAO;MACP,IAAI,EAAE,YAAY,IAAI;MACtB,SAAS;MAER,UAAA,EAAc,KAAK,MAAgB,EAAY,IAAI,CAAC,CAAC,KAAK,IAAI;KACrD,CAAA;KACZ,kBAAC,GAAD;MACE,OAAO;MACP,SAAS;MAFX,UAAA;OAIG,EAAS,oBAAoB,CAAS;OACtC;OACA,EAAE,0BAA0B;MACnB;;IACZ,EAAA,CAAA,IAEF,kBAAA,GAAA,EAAA,UAAA;KACE,kBAAC,GAAD;MACE,OAAO;MACP,IAAI,EAAE,UAAU,GAAG;KACpB,CAAA;KACD,kBAAC,GAAD;MACE,IAAI,EAAE,YAAY,IAAI;MACtB,SAAS;MAER,UAAA;KACS,CAAA;KACZ,kBAAC,GAAD;MACE,OAAO;MACP,SAAS;MAER,UAAA,KAAc,EAAE,gDAAgD;KACvD,CAAA;KACZ,kBAAC,GAAD;MACE,eAAA;MACA,WAAW;MACX,IAAI;OACF,QAAQ;OACR,aAAa,IAAW,oBAAoB;OAC5C,cAAc;OACd,OAAO,IAAW,oBAAoB;OACtC,UAAU;OACV,YAAY;OACZ,eAAe;OACf,IAAI;OACJ,SAAS;OACT,eAAe;MACjB;MAEC,UAAA,EAAE,aAAa;KACb,CAAA;IACL,EAAA,CAAA;GAED,CAAA;EACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Fragment","CloudUploadOutlinedIcon","InsertDriveFileOutlinedIcon","FileDropZone","useTranslation","isDragOver","setIsDragOver","useState","inputRef","useRef","descriptionId","useId","translatedLabel","t","accept","files","onDragOver","useCallback","disabled","onDragLeave","onDrop","onFilesSelected","onFileChange","onClick","onKeyDown","selectedFiles","hasFiles","totalSize","sum","currentFile","backgroundColor","borderColor","error","Box","ariaDescribedBy","labelledById","visuallyHidden","helperText","Fragment","Typography","FileUtil"],"sources":["../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import type {\n ChangeEvent,\n DragEvent,\n KeyboardEvent as ReactKeyboardEvent,\n Ref,\n} from 'react';\nimport {\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport {\n Box,\n Typography,\n} from '@mui/material';\nimport { visuallyHidden } from '@mui/utils';\nimport CloudUploadOutlinedIcon from '@mui/icons-material/CloudUploadOutlined';\nimport InsertDriveFileOutlinedIcon from '@mui/icons-material/InsertDriveFileOutlined';\nimport { useTranslation } from 'react-i18next';\nimport { FileUtil } from '@gen-epix/ui-core/utils/FileUtil';\n\nexport interface FileDropZoneProps {\n readonly accept: string;\n readonly ariaDescribedBy?: string;\n readonly disabled?: boolean;\n readonly error?: boolean;\n readonly files: FileList | null;\n readonly helperText?: string;\n readonly label?: string;\n readonly labelledById?: string;\n readonly multiple?: boolean;\n readonly onBlur?: () => void;\n readonly onFilesSelected: (files: FileList) => void;\n readonly ref?: Ref<HTMLDivElement>;\n}\n\nexport const FileDropZone = ({\n accept,\n ariaDescribedBy,\n disabled,\n error,\n files,\n helperText,\n label,\n labelledById,\n multiple = false,\n onBlur,\n onFilesSelected,\n ref,\n}: FileDropZoneProps) => {\n const { t } = useTranslation();\n const [isDragOver, setIsDragOver] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const descriptionId = useId();\n\n const translatedLabel = multiple\n ? t('{{label}} ({{accept}})', { accept: accept.split(',').join(', '), label })\n : t('{{label}} ({{accept}})', { accept: accept.split(',').join(', '), label });\n\n useEffect(() => {\n // allows re-selecting the same file after it was cleared externally\n if (!files && inputRef.current) {\n inputRef.current.value = '';\n }\n }, [files]);\n\n const onDragOver = useCallback((e: DragEvent) => {\n e.preventDefault();\n if (disabled) {\n return;\n }\n setIsDragOver(true);\n }, [disabled]);\n\n const onDragLeave = useCallback(() => {\n setIsDragOver(false);\n }, []);\n\n const onDrop = useCallback((e: DragEvent) => {\n e.preventDefault();\n setIsDragOver(false);\n if (disabled) {\n return;\n }\n if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {\n onFilesSelected(e.dataTransfer.files);\n }\n }, [disabled, onFilesSelected]);\n\n const onFileChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files.length > 0) {\n onFilesSelected(e.target.files);\n }\n }, [onFilesSelected]);\n\n const onClick = useCallback(() => {\n if (disabled) {\n return;\n }\n inputRef.current?.click();\n }, [disabled]);\n\n const onKeyDown = useCallback((e: ReactKeyboardEvent) => {\n if (disabled) {\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n inputRef.current?.click();\n }\n }, [disabled]);\n\n const selectedFiles = files ? Array.from(files) : [];\n const hasFiles = selectedFiles.length > 0;\n const totalSize = selectedFiles.reduce((sum, currentFile) => sum + currentFile.size, 0);\n\n let backgroundColor = 'background.paper';\n let borderColor = 'divider';\n if (disabled) {\n backgroundColor = 'action.disabledBackground';\n borderColor = 'action.disabled';\n } else if (isDragOver) {\n backgroundColor = 'action.hover';\n borderColor = 'primary.main';\n } else if (error) {\n borderColor = 'error.main';\n }\n\n return (\n <Box\n aria-describedby={ariaDescribedBy ? `${ariaDescribedBy} ${descriptionId}` : descriptionId}\n aria-disabled={disabled}\n aria-label={labelledById ? undefined : translatedLabel}\n aria-labelledby={labelledById}\n onBlur={onBlur}\n onClick={onClick}\n onDragLeave={onDragLeave}\n onDragOver={onDragOver}\n onDrop={onDrop}\n onKeyDown={onKeyDown}\n ref={ref}\n role={'button'}\n sx={{\n '&:focus-visible': {\n borderColor: 'primary.main',\n borderStyle: 'solid',\n },\n alignItems: 'center',\n backgroundColor,\n border: '2px dashed',\n borderColor,\n borderRadius: 2,\n cursor: disabled ? 'default' : 'pointer',\n display: 'flex',\n flexDirection: 'column',\n gap: 1.5,\n justifyContent: 'center',\n minHeight: 180,\n opacity: disabled ? 0.6 : 1,\n padding: 3,\n pointerEvents: disabled ? 'none' : 'auto',\n textAlign: 'center',\n transition: 'all 0.2s ease',\n }}\n tabIndex={disabled ? -1 : 0}\n >\n <input\n accept={accept}\n disabled={disabled}\n multiple={multiple}\n onChange={onFileChange}\n ref={inputRef}\n style={{ display: 'none' }}\n type={'file'}\n />\n <span\n id={descriptionId}\n style={visuallyHidden}\n >\n {translatedLabel}\n {helperText ? ` ${helperText}` : ''}\n </span>\n <Box\n aria-atomic\n aria-live={'polite'}\n component={'span'}\n sx={{ alignItems: 'center', display: 'flex', flexDirection: 'column', gap: 1.5 }}\n >\n {hasFiles ? (\n <>\n <InsertDriveFileOutlinedIcon\n color={'primary'}\n sx={{ fontSize: 40 }}\n />\n <Typography\n color={'success.main'}\n sx={{ fontWeight: 600 }}\n variant={'subtitle1'}\n >\n {selectedFiles.map((currentFile) => currentFile.name).join(', ')}\n </Typography>\n <Typography\n color={'text.secondary'}\n variant={'caption'}\n >\n {FileUtil.getReadableFileSize(totalSize)}\n {' — '}\n {t('Click or drag to replace')}\n </Typography>\n </>\n ) : (\n <>\n <CloudUploadOutlinedIcon\n color={'primary'}\n sx={{ fontSize: 44 }}\n />\n <Typography\n sx={{ fontWeight: 600 }}\n variant={'subtitle1'}\n >\n {translatedLabel}\n </Typography>\n <Typography\n color={'text.secondary'}\n variant={'body2'}\n >\n {helperText || t('Drag & drop your file here, or click to browse')}\n </Typography>\n <Box\n aria-hidden\n component={'span'}\n sx={{\n border: '1px solid',\n borderColor: disabled ? 'action.disabled' : 'primary.main',\n borderRadius: 1,\n color: disabled ? 'action.disabled' : 'primary.main',\n fontSize: '0.8125rem',\n fontWeight: 500,\n letterSpacing: '0.02857em',\n mt: 1,\n padding: '5px 14px',\n textTransform: 'uppercase',\n }}\n >\n {t('Choose File')}\n </Box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;MACE,OAAO;MACP,IAAI,EAAE,YAAY,IAAI;MACtB,SAAS;MAER,UAAAd,EAAc,KAAK,MAAgBI,EAAY,IAAI,CAAC,CAAC,KAAK,IAAI;KACrD,CAAA;KACZ,kBAACU,GAAD;MACE,OAAO;MACP,SAAS;MAFX,UAAA;OAIGC,EAAS,oBAAoBb,CAAS;OACtC;OACAd,EAAE,0BAA0B;MACnB;;IACZ,EAAA,CAAA,IAEF,kBAAAb,GAAA,EAAA,UAAA;KACE,kBAACC,GAAD;MACE,OAAO;MACP,IAAI,EAAE,UAAU,GAAG;KACpB,CAAA;KACD,kBAACsC,GAAD;MACE,IAAI,EAAE,YAAY,IAAI;MACtB,SAAS;MAER,UAAA3B;KACS,CAAA;KACZ,kBAAC2B,GAAD;MACE,OAAO;MACP,SAAS;MAER,UAAAF,KAAcxB,EAAE,gDAAgD;KACvD,CAAA;KACZ,kBAACoB,GAAD;MACE,eAAA;MACA,WAAW;MACX,IAAI;OACF,QAAQ;OACR,aAAaf,IAAW,oBAAoB;OAC5C,cAAc;OACd,OAAOA,IAAW,oBAAoB;OACtC,UAAU;OACV,YAAY;OACZ,eAAe;OACf,IAAI;OACJ,SAAS;OACT,eAAe;MACjB;MAEC,UAAAL,EAAE,aAAa;KACb,CAAA;IACL,EAAA,CAAA;GAED,CAAA;EACF;;AAET"}
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"index.js","names":["LinearProgressWithLabel","props","Box","LinearProgress","value","Typography"],"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,IAAaA,KAA2B,EAAE,UAAO,GAAGC,QAEhD,kBAACC,GAAD;CAAK,IAAI;EAAE,YAAY;EAAU,SAAS;CAAO;CAAjD,UAAA,CACE,kBAACA,GAAD;EAAK,IAAI;GAAE,IAAI;GAAG,OAAO;EAAO;EAC9B,UAAA,kBAACC,GAAD;GACE,OAAOC,IAAQ,IAAIA,IAAQ,KAAA;GAC3B,SAASA,IAAQ,IAAI,gBAAgB;GACrC,GAAIH;EACL,CAAA;CACE,CAAA,GACJG,IAAQ,KACP,kBAACF,GAAD;EAAK,IAAI,EAAE,UAAU,GAAG;EACtB,UAAA,kBAACG,GAAD;GACE,IAAI,EAAE,OAAO,iBAAiB;GAC9B,SAAS;GAER,UAAA,GAAG,KAAK,MAAMD,CAAK,EAAE;EACZ,CAAA;CACT,CAAA,CAEJ"}
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"index.js","names":["LoadingIndicator","styled","LinearProgress"],"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,IAAaA,IAAmBC,EAAOC,CAAc,CAAC,QAAQ;CAC5D,MAAM;CACN,UAAU;CACV,OAAO;CACP,QAAQ;AACV,EAAE"}
|
|
@@ -5,7 +5,7 @@ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
|
5
5
|
import m from "@mui/icons-material/Delete";
|
|
6
6
|
import te from "@mui/icons-material/InsertDriveFile";
|
|
7
7
|
import ne from "@mui/icons-material/CloudUpload";
|
|
8
|
-
import { DATE_FORMAT as re } from "@gen-epix/ui-core/constants/date";
|
|
8
|
+
import { DATE_FORMAT as re } from "@gen-epix/ui-core/constants/date.constants";
|
|
9
9
|
import { FileUtil as ie } from "@gen-epix/ui-core/utils/FileUtil";
|
|
10
10
|
//#region ../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.js
|
|
11
11
|
var h = 365.2425, g = 6048e5, _ = 864e5, v = 86400;
|
|
@@ -1158,11 +1158,7 @@ function De(e) {
|
|
|
1158
1158
|
var Oe = ({ accept: h, initialDataTransfer: g, numFilesAllowed: _ = 1, onDataTransferChange: v }) => {
|
|
1159
1159
|
let { t: y } = ee(), b = y(_ === 1 ? "Click or drag to upload file ({{accept}})" : "Click or drag to upload files ({{accept}})", { accept: h.split(",").join(", ") }), x = _ === 1 ? y`Drop file here` : y`Drop files here`, S = n(), C = i(null), w = r(() => g ?? new DataTransfer(), [g]), [T, E] = a(w), [D, O] = a(b), [k, A] = a(null), [j, M] = a(!1), N = i(!0);
|
|
1160
1160
|
t(() => {
|
|
1161
|
-
|
|
1162
|
-
N.current = !1;
|
|
1163
|
-
return;
|
|
1164
|
-
}
|
|
1165
|
-
v(T);
|
|
1161
|
+
N.current ? N.current = !1 : v(T);
|
|
1166
1162
|
}, [T, v]);
|
|
1167
1163
|
let P = e((e) => {
|
|
1168
1164
|
e.stopPropagation(), e.preventDefault();
|