@rws-aoa/react-library 3.5.2 → 3.5.3
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/components/molecules/upload-button/UploadButton.d.ts +1 -1
- package/dist/components/molecules/upload-button/UploadButton.d.ts.map +1 -1
- package/dist/components/molecules/upload-button/UploadButton.js +21 -20
- package/dist/components/molecules/upload-button/UploadButton.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,5 +23,5 @@ export interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps, "start
|
|
|
23
23
|
*/
|
|
24
24
|
readonly isNeverDisabled?: boolean;
|
|
25
25
|
}
|
|
26
|
-
export declare function AoaUploadButton<TData>({ isUploading, isDisabled, children, sx, isNeverDisabled, type, setIsUploading, onClick, ...props }: PropsWithChildren<AoaUploadButtonProps<TData>>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function AoaUploadButton<TData>({ isUploading, isDisabled, children, sx, isNeverDisabled, type, files, setIsUploading, onClick, ...props }: PropsWithChildren<AoaUploadButtonProps<TData>>): import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
//# sourceMappingURL=UploadButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadButton.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/upload-button/UploadButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3E,MAAM,WAAW,oBAAoB,CAAC,KAAK,CAAE,SAAQ,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1G,qGAAqG;IACrG,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IACxC,iHAAiH;IACjH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B;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Ae,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,EACrC,WAAW,EACX,UAAU,EACV,QAAQ,EACR,EAAE,EACF,eAAe,EACf,IAAI,EACJ,KAAK,EACL,cAAc,EACd,OAAO,EACP,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,2CAgBhD"}
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { CircularProgress as
|
|
3
|
-
import { m as
|
|
4
|
-
import { AoaButton as
|
|
5
|
-
function
|
|
2
|
+
import { CircularProgress as g } from "@mui/material";
|
|
3
|
+
import { m as l } from "../../../chunks/index.CtmQWjvP.js";
|
|
4
|
+
import { AoaButton as x } from "../../atoms/button/Button.js";
|
|
5
|
+
function h({
|
|
6
6
|
isUploading: t,
|
|
7
|
-
isDisabled:
|
|
8
|
-
children:
|
|
9
|
-
sx:
|
|
10
|
-
isNeverDisabled:
|
|
11
|
-
type:
|
|
12
|
-
|
|
7
|
+
isDisabled: e,
|
|
8
|
+
children: m,
|
|
9
|
+
sx: a,
|
|
10
|
+
isNeverDisabled: s,
|
|
11
|
+
type: p,
|
|
12
|
+
files: u,
|
|
13
|
+
setIsUploading: f,
|
|
13
14
|
onClick: r,
|
|
14
|
-
...
|
|
15
|
+
...i
|
|
15
16
|
}) {
|
|
16
17
|
return /* @__PURE__ */ o(
|
|
17
|
-
|
|
18
|
+
x,
|
|
18
19
|
{
|
|
19
|
-
...
|
|
20
|
+
...i,
|
|
20
21
|
onClick: (n) => {
|
|
21
|
-
|
|
22
|
+
f(!0), r == null || r(n);
|
|
22
23
|
},
|
|
23
|
-
type:
|
|
24
|
-
startIcon: t ? /* @__PURE__ */ o(
|
|
25
|
-
disabled:
|
|
26
|
-
sx:
|
|
27
|
-
children:
|
|
24
|
+
type: p ?? "primary",
|
|
25
|
+
startIcon: t ? /* @__PURE__ */ o(g, { size: 20 }) : null,
|
|
26
|
+
disabled: s ? !1 : !!e || t || Object.keys(u ?? []).length < 1,
|
|
27
|
+
sx: l({ marginRight: 0 }, a),
|
|
28
|
+
children: m
|
|
28
29
|
}
|
|
29
30
|
);
|
|
30
31
|
}
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
+
h as AoaUploadButton
|
|
33
34
|
};
|
|
34
35
|
//# sourceMappingURL=UploadButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadButton.js","sources":["../../../../src/components/molecules/upload-button/UploadButton.tsx"],"sourcesContent":["import { CircularProgress } from \"@mui/material\";\nimport merge from \"lodash.merge\";\nimport type { PropsWithChildren } from \"react\";\nimport { AoaButton, type AoaButtonProps } from \"../../atoms/button/Button\";\n\nexport interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps, \"startIcon\" | \"disabled\" | \"type\"> {\n /** The type of the button. This _cannot_ be a `text` style button like the base {@link AoaButton} */\n readonly type?: \"primary\" | \"secondary\";\n /** Whether the upload process is running. This controls whether a spinner is shown and the button is disabled */\n readonly isUploading: boolean;\n /**\n * The action to change {@link AoaUploadButtonProps.isUploading `isUploading`} to `true`\n * @param newState The new state of the `isUploading` flag\n */\n // eslint-disable-next-line no-unused-vars\n readonly setIsUploading: (newState: boolean) => void;\n\n /** The files that should be checked, required if {@link AoaUploadButtonProps.noFilesAllowed} is `false` */\n readonly files?: TData[];\n /** Whether the button should be disabled */\n readonly isDisabled?: boolean;\n /**\n * Whether the button should never be disabled.\n * - If `true` the button never goes into a `disabled` state, regardless of other conditions\n * - If `false` the button will be disabled if there are no files provided\n * (through {@link AoaUploadButtonProps.files `files`}), or the upload progress is running\n */\n readonly isNeverDisabled?: boolean;\n}\n\nexport function AoaUploadButton<TData>({\n isUploading,\n isDisabled,\n children,\n sx,\n isNeverDisabled,\n type,\n setIsUploading,\n onClick,\n ...props\n}: PropsWithChildren<AoaUploadButtonProps<TData>>) {\n return (\n <AoaButton\n {...props}\n onClick={(event) => {\n setIsUploading(true);\n onClick?.(event);\n }}\n type={type ?? \"primary\"}\n startIcon={isUploading ? <CircularProgress size={20} /> : null}\n disabled={isNeverDisabled ? false : Boolean(isDisabled) || isUploading || Object.keys(
|
|
1
|
+
{"version":3,"file":"UploadButton.js","sources":["../../../../src/components/molecules/upload-button/UploadButton.tsx"],"sourcesContent":["import { CircularProgress } from \"@mui/material\";\nimport merge from \"lodash.merge\";\nimport type { PropsWithChildren } from \"react\";\nimport { AoaButton, type AoaButtonProps } from \"../../atoms/button/Button\";\n\nexport interface AoaUploadButtonProps<TData> extends Omit<AoaButtonProps, \"startIcon\" | \"disabled\" | \"type\"> {\n /** The type of the button. This _cannot_ be a `text` style button like the base {@link AoaButton} */\n readonly type?: \"primary\" | \"secondary\";\n /** Whether the upload process is running. This controls whether a spinner is shown and the button is disabled */\n readonly isUploading: boolean;\n /**\n * The action to change {@link AoaUploadButtonProps.isUploading `isUploading`} to `true`\n * @param newState The new state of the `isUploading` flag\n */\n // eslint-disable-next-line no-unused-vars\n readonly setIsUploading: (newState: boolean) => void;\n\n /** The files that should be checked, required if {@link AoaUploadButtonProps.noFilesAllowed} is `false` */\n readonly files?: TData[];\n /** Whether the button should be disabled */\n readonly isDisabled?: boolean;\n /**\n * Whether the button should never be disabled.\n * - If `true` the button never goes into a `disabled` state, regardless of other conditions\n * - If `false` the button will be disabled if there are no files provided\n * (through {@link AoaUploadButtonProps.files `files`}), or the upload progress is running\n */\n readonly isNeverDisabled?: boolean;\n}\n\nexport function AoaUploadButton<TData>({\n isUploading,\n isDisabled,\n children,\n sx,\n isNeverDisabled,\n type,\n files,\n setIsUploading,\n onClick,\n ...props\n}: PropsWithChildren<AoaUploadButtonProps<TData>>) {\n return (\n <AoaButton\n {...props}\n onClick={(event) => {\n setIsUploading(true);\n onClick?.(event);\n }}\n type={type ?? \"primary\"}\n startIcon={isUploading ? <CircularProgress size={20} /> : null}\n disabled={isNeverDisabled ? false : Boolean(isDisabled) || isUploading || Object.keys(files ?? []).length < 1}\n sx={merge({ marginRight: 0 }, sx)}\n >\n {children}\n </AoaButton>\n );\n}\n"],"names":["AoaUploadButton","isUploading","isDisabled","children","sx","isNeverDisabled","type","files","setIsUploading","onClick","props","jsx","AoaButton","event","CircularProgress","merge"],"mappings":";;;;AA8BO,SAASA,EAAuB;AAAA,EACrC,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GAAmD;AAE/C,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,SAAS,CAACG,MAAU;AAClB,QAAAL,EAAe,EAAI,GACnBC,KAAA,QAAAA,EAAUI;AAAA,MACZ;AAAA,MACA,MAAMP,KAAQ;AAAA,MACd,WAAWL,IAAc,gBAAAU,EAACG,GAAiB,EAAA,MAAM,GAAI,CAAA,IAAK;AAAA,MAC1D,UAAUT,IAAkB,KAAQ,EAAQH,KAAeD,KAAe,OAAO,KAAKM,KAAS,EAAE,EAAE,SAAS;AAAA,MAC5G,IAAIQ,EAAM,EAAE,aAAa,EAAA,GAAKX,CAAE;AAAA,MAE/B,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|