synapse-react-client 4.0.24 → 4.0.25
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/SWC.index.d.ts +1 -0
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +2 -1
- package/dist/SWC.index.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
- package/dist/components/AclEditor/useUpdateAcl.js.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +43 -30
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js.map +1 -1
- package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
- package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts +7 -1
- package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts.map +1 -1
- package/dist/components/CopyToClipboardString/CopyToClipboardString.js +22 -16
- package/dist/components/CopyToClipboardString/CopyToClipboardString.js.map +1 -1
- package/dist/components/EntityFinder/tree/EntityTree.js.map +1 -1
- package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
- package/dist/components/EntityIcon.d.ts +1 -0
- package/dist/components/EntityIcon.d.ts.map +1 -1
- package/dist/components/EntityIcon.js +37 -36
- package/dist/components/EntityIcon.js.map +1 -1
- package/dist/components/EntitySidebar/EntitySidebar.css +1 -0
- package/dist/components/EntitySidebar/EntitySidebar.d.ts +7 -0
- package/dist/components/EntitySidebar/EntitySidebar.d.ts.map +1 -0
- package/dist/components/EntitySidebar/EntitySidebar.js +62 -0
- package/dist/components/EntitySidebar/EntitySidebar.js.map +1 -0
- package/dist/components/EntitySidebar/EntitySidebar.module.js +17 -0
- package/dist/components/EntitySidebar/EntitySidebar.module.js.map +1 -0
- package/dist/components/EntitySidebar/EntitySidebar.module.scss +87 -0
- package/dist/components/Evaluation/EvaluationRoundEditorList.js.map +1 -1
- package/dist/components/GenericCard/BioregistryRules.js.map +1 -1
- package/dist/components/IconSvg/IconSvg.d.ts +2 -1
- package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
- package/dist/components/IconSvg/IconSvg.js +112 -89
- package/dist/components/IconSvg/IconSvg.js.map +1 -1
- package/dist/components/Plot/UpsetPlot.js.map +1 -1
- package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js.map +1 -1
- package/dist/components/StorybookComponentWrapper.js.map +1 -1
- package/dist/components/SynapseTable/TablePagination.js.map +1 -1
- package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
- package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
- package/dist/components/TanStackTable/StyledTanStackTable.js.map +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts +1 -8
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts.map +1 -1
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js +17 -12
- package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +20 -16
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.js +17 -82
- package/dist/components/entity/page/title_bar/TitleBarProperties.js.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +3 -4
- package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
- package/dist/components/menu/ComplexMenu.d.ts.map +1 -1
- package/dist/components/menu/ComplexMenu.js +5 -3
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/testutils/ReactQueryMockUtils.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/ThemeTypes.d.ts +2 -2
- package/dist/utils/functions/IsEqualTreatUndefinedAsMissing.js.map +1 -1
- package/dist/utils/hooks/useDebouncedEffect.js.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
- package/dist/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.js.map +1 -1
- package/dist/utils/hooks/useLogin.js.map +1 -1
- package/package.json +5 -5
|
@@ -10,9 +10,9 @@ import c from "./TitleBarProperties.js";
|
|
|
10
10
|
import { Avatar as l, Box as u, Skeleton as d, Stack as f, Typography as p } from "@mui/material";
|
|
11
11
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
12
|
//#region src/components/entity/page/title_bar/EntityPageTitleBar.tsx
|
|
13
|
-
var g = "#9EAAB7", _ = "#EAF0F5", v = "#497097";
|
|
14
|
-
function
|
|
15
|
-
let { entityId:
|
|
13
|
+
var g = "#9EAAB7", _ = "#EAF0F5", v = "#497097", y = "#33373D";
|
|
14
|
+
function b(g) {
|
|
15
|
+
let { entityId: b, versionNumber: x, entityActionMenuProps: S } = g, C = S?.actionConfiguration.SHOW_VERSION_HISTORY?.onClick, { data: w, isLoading: T } = t(b, x), E = w?.entity && e(w.entity) ? w.entity.repositoryName : w?.entity?.name;
|
|
16
16
|
return /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m(u, {
|
|
17
17
|
sx: {
|
|
18
18
|
padding: "20px 40px",
|
|
@@ -23,7 +23,7 @@ function y(g) {
|
|
|
23
23
|
sx: {
|
|
24
24
|
flexDirection: {
|
|
25
25
|
xs: "column",
|
|
26
|
-
|
|
26
|
+
md: "row"
|
|
27
27
|
},
|
|
28
28
|
alignItems: "center"
|
|
29
29
|
},
|
|
@@ -34,7 +34,7 @@ function y(g) {
|
|
|
34
34
|
flexGrow: 1
|
|
35
35
|
},
|
|
36
36
|
children: [/* @__PURE__ */ m(i, {
|
|
37
|
-
condition:
|
|
37
|
+
condition: T,
|
|
38
38
|
wrapper: d,
|
|
39
39
|
wrapperProps: { variant: "circular" },
|
|
40
40
|
children: /* @__PURE__ */ m(l, {
|
|
@@ -45,8 +45,8 @@ function y(g) {
|
|
|
45
45
|
borderRadius: "3px"
|
|
46
46
|
},
|
|
47
47
|
variant: "square",
|
|
48
|
-
children:
|
|
49
|
-
icon:
|
|
48
|
+
children: w?.entityType && /* @__PURE__ */ m(n, {
|
|
49
|
+
icon: w?.entityType ? r[w.entityType] : "file",
|
|
50
50
|
wrap: !1
|
|
51
51
|
})
|
|
52
52
|
})
|
|
@@ -62,27 +62,31 @@ function y(g) {
|
|
|
62
62
|
gap: "3px"
|
|
63
63
|
},
|
|
64
64
|
children: [/* @__PURE__ */ m(i, {
|
|
65
|
-
condition:
|
|
65
|
+
condition: T,
|
|
66
66
|
wrapper: d,
|
|
67
67
|
children: /* @__PURE__ */ m(p, {
|
|
68
68
|
variant: "headline2",
|
|
69
|
-
|
|
69
|
+
sx: {
|
|
70
|
+
color: y,
|
|
71
|
+
fontWeight: 540
|
|
72
|
+
},
|
|
73
|
+
children: E ?? "Name not set"
|
|
70
74
|
})
|
|
71
|
-
}),
|
|
72
|
-
entityId:
|
|
75
|
+
}), w?.entity?.id && /* @__PURE__ */ m(a, {
|
|
76
|
+
entityId: w.entity.id,
|
|
73
77
|
iconColor: "#9EAAB7"
|
|
74
78
|
})]
|
|
75
79
|
}), /* @__PURE__ */ m(s, {
|
|
76
|
-
entityId:
|
|
77
|
-
versionNumber:
|
|
78
|
-
toggleShowVersionHistory:
|
|
80
|
+
entityId: b,
|
|
81
|
+
versionNumber: x,
|
|
82
|
+
toggleShowVersionHistory: C
|
|
79
83
|
})]
|
|
80
84
|
})]
|
|
81
|
-
}),
|
|
85
|
+
}), S && /* @__PURE__ */ m(o, { ...S })]
|
|
82
86
|
})
|
|
83
87
|
}), /* @__PURE__ */ m(c, { ...g })] });
|
|
84
88
|
}
|
|
85
89
|
//#endregion
|
|
86
|
-
export { g as FAVORITE_BUTTON_ICON_COLOR,
|
|
90
|
+
export { g as FAVORITE_BUTTON_ICON_COLOR, b as default };
|
|
87
91
|
|
|
88
92
|
//# sourceMappingURL=EntityPageTitleBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPageTitleBar.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/EntityPageTitleBar.tsx"],"sourcesContent":["import ConditionalWrapper from '@/components/utils/ConditionalWrapper'\nimport { useGetEntityBundle } from '@/synapse-queries'\nimport { isDockerRepository } from '@/utils/types/IsType'\nimport { Avatar, Box, Skeleton, Stack, Typography } from '@mui/material'\nimport FavoriteButton from '../../../favorites/FavoriteButton'\nimport IconSvg, { type2SvgIconName } from '../../../IconSvg/IconSvg'\nimport EntityActionMenu, {\n EntityActionMenuProps,\n} from '../action_menu/EntityActionMenu'\nimport { EntityTitleBarVersionInfo } from './EntityTitleBarVersionInfo'\nimport TitleBarProperties from './TitleBarProperties'\n\nexport type EntityPageTitleBarProps = {\n entityId: string\n versionNumber?: number\n /* Props that will be passed through to an EntityActionMenu component */\n entityActionMenuProps?: EntityActionMenuProps\n /* Callback invoked when an ACT member clicks \"Add Conditions for Use\". */\n onActMemberClickAddConditionsForUse: () => void\n}\n\nexport const FAVORITE_BUTTON_ICON_COLOR = '#9EAAB7'\nconst TITLE_BAR_BACKGROUND_COLOR = '#EAF0F5'\nconst AVATAR_BACKGROUND_COLOR = '#497097'\n\n/**\n * The EntityPageTitleBar component is shown on every Entity page in Synapse, and shows an Entity's metadata and\n * provides controls to view and manipulate the Entity.\n */\nexport default function EntityPageTitleBar(props: EntityPageTitleBarProps) {\n const { entityId, versionNumber, entityActionMenuProps } = props\n\n const toggleShowVersionHistory =\n entityActionMenuProps?.actionConfiguration['SHOW_VERSION_HISTORY']?.onClick\n\n const { data: bundle, isLoading } = useGetEntityBundle(\n entityId,\n versionNumber,\n )\n\n const name =\n bundle?.entity && isDockerRepository(bundle.entity)\n ? bundle.entity.repositoryName\n : bundle?.entity?.name\n\n return (\n <div>\n <Box\n sx={{\n padding: '20px 40px',\n backgroundColor: TITLE_BAR_BACKGROUND_COLOR,\n borderRadius: '5px',\n }}\n >\n <Stack\n sx={{\n flexDirection: { xs: 'column',
|
|
1
|
+
{"version":3,"file":"EntityPageTitleBar.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/EntityPageTitleBar.tsx"],"sourcesContent":["import ConditionalWrapper from '@/components/utils/ConditionalWrapper'\nimport { useGetEntityBundle } from '@/synapse-queries'\nimport { isDockerRepository } from '@/utils/types/IsType'\nimport { Avatar, Box, Skeleton, Stack, Typography } from '@mui/material'\nimport FavoriteButton from '../../../favorites/FavoriteButton'\nimport IconSvg, { type2SvgIconName } from '../../../IconSvg/IconSvg'\nimport EntityActionMenu, {\n EntityActionMenuProps,\n} from '../action_menu/EntityActionMenu'\nimport { EntityTitleBarVersionInfo } from './EntityTitleBarVersionInfo'\nimport TitleBarProperties from './TitleBarProperties'\n\nexport type EntityPageTitleBarProps = {\n entityId: string\n versionNumber?: number\n /* Props that will be passed through to an EntityActionMenu component */\n entityActionMenuProps?: EntityActionMenuProps\n /* Callback invoked when an ACT member clicks \"Add Conditions for Use\". */\n onActMemberClickAddConditionsForUse: () => void\n}\n\nexport const FAVORITE_BUTTON_ICON_COLOR = '#9EAAB7'\nconst TITLE_BAR_BACKGROUND_COLOR = '#EAF0F5'\nconst AVATAR_BACKGROUND_COLOR = '#497097'\nconst TITLE_NAME_COLOR = '#33373D'\n\n/**\n * The EntityPageTitleBar component is shown on every Entity page in Synapse, and shows an Entity's metadata and\n * provides controls to view and manipulate the Entity.\n */\nexport default function EntityPageTitleBar(props: EntityPageTitleBarProps) {\n const { entityId, versionNumber, entityActionMenuProps } = props\n\n const toggleShowVersionHistory =\n entityActionMenuProps?.actionConfiguration['SHOW_VERSION_HISTORY']?.onClick\n\n const { data: bundle, isLoading } = useGetEntityBundle(\n entityId,\n versionNumber,\n )\n\n const name =\n bundle?.entity && isDockerRepository(bundle.entity)\n ? bundle.entity.repositoryName\n : bundle?.entity?.name\n\n return (\n <div>\n <Box\n sx={{\n padding: '20px 40px',\n backgroundColor: TITLE_BAR_BACKGROUND_COLOR,\n borderRadius: '5px',\n }}\n >\n <Stack\n sx={{\n flexDirection: { xs: 'column', md: 'row' },\n alignItems: 'center',\n }}\n >\n <Stack\n direction={'row'}\n sx={{\n alignItems: 'center',\n flexGrow: 1,\n }}\n >\n <ConditionalWrapper\n condition={isLoading}\n wrapper={Skeleton}\n wrapperProps={{\n variant: 'circular',\n }}\n >\n <Avatar\n sx={{\n bgcolor: AVATAR_BACKGROUND_COLOR,\n height: 48,\n width: 48,\n borderRadius: '3px',\n }}\n variant={'square'}\n >\n {bundle?.entityType && (\n <IconSvg\n icon={\n bundle?.entityType\n ? type2SvgIconName[bundle.entityType]\n : 'file'\n }\n wrap={false}\n />\n )}\n </Avatar>\n </ConditionalWrapper>\n <Box sx={{ marginLeft: '10px', flexGrow: 1 }}>\n <Stack\n direction={'row'}\n sx={{\n alignItems: 'center',\n gap: '3px',\n }}\n >\n <ConditionalWrapper condition={isLoading} wrapper={Skeleton}>\n <Typography\n variant={'headline2'}\n sx={{ color: TITLE_NAME_COLOR, fontWeight: 540 }}\n >\n {name ?? 'Name not set'}\n </Typography>\n </ConditionalWrapper>\n {bundle?.entity?.id && (\n <FavoriteButton\n entityId={bundle.entity.id}\n iconColor={FAVORITE_BUTTON_ICON_COLOR}\n />\n )}\n </Stack>\n <EntityTitleBarVersionInfo\n entityId={entityId}\n versionNumber={versionNumber}\n toggleShowVersionHistory={toggleShowVersionHistory}\n />\n </Box>\n </Stack>\n {entityActionMenuProps && (\n <EntityActionMenu {...entityActionMenuProps} />\n )}\n </Stack>\n </Box>\n <TitleBarProperties {...props} />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAqBA,IAAa,IAA6B,WACpC,IAA6B,WAC7B,IAA0B,WAC1B,IAAmB;AAMzB,SAAwB,EAAmB,GAAgC;CACzE,IAAM,EAAE,aAAU,kBAAe,6BAA0B,GAErD,IACJ,GAAuB,oBAAoB,sBAAyB,SAEhE,EAAE,MAAM,GAAQ,iBAAc,EAClC,GACA,CACF,GAEM,IACJ,GAAQ,UAAU,EAAmB,EAAO,MAAM,IAC9C,EAAO,OAAO,iBACd,GAAQ,QAAQ;CAEtB,OACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,GAAD;EACE,IAAI;GACF,SAAS;GACT,iBAAiB;GACjB,cAAc;EAChB;YAEA,kBAAC,GAAD;GACE,IAAI;IACF,eAAe;KAAE,IAAI;KAAU,IAAI;IAAM;IACzC,YAAY;GACd;aAJF,CAME,kBAAC,GAAD;IACE,WAAW;IACX,IAAI;KACF,YAAY;KACZ,UAAU;IACZ;cALF,CAOE,kBAAC,GAAD;KACE,WAAW;KACX,SAAS;KACT,cAAc,EACZ,SAAS,WACX;eAEA,kBAAC,GAAD;MACE,IAAI;OACF,SAAS;OACT,QAAQ;OACR,OAAO;OACP,cAAc;MAChB;MACA,SAAS;gBAER,GAAQ,cACP,kBAAC,GAAD;OACE,MACE,GAAQ,aACJ,EAAiB,EAAO,cACxB;OAEN,MAAM;MACP,CAAA;KAEG,CAAA;IACU,CAAA,GACpB,kBAAC,GAAD;KAAK,IAAI;MAAE,YAAY;MAAQ,UAAU;KAAE;eAA3C,CACE,kBAAC,GAAD;MACE,WAAW;MACX,IAAI;OACF,YAAY;OACZ,KAAK;MACP;gBALF,CAOE,kBAAC,GAAD;OAAoB,WAAW;OAAW,SAAS;iBACjD,kBAAC,GAAD;QACE,SAAS;QACT,IAAI;SAAE,OAAO;SAAkB,YAAY;QAAI;kBAE9C,KAAQ;OACC,CAAA;MACM,CAAA,GACnB,GAAQ,QAAQ,MACf,kBAAC,GAAD;OACE,UAAU,EAAO,OAAO;OACxB,WAAA;MACD,CAAA,CAEE;SACP,kBAAC,GAAD;MACY;MACK;MACW;KAC3B,CAAA,CACE;MACA;OACN,KACC,kBAAC,GAAD,EAAkB,GAAI,EAAwB,CAAA,CAE3C;;CACJ,CAAA,GACL,kBAAC,GAAD,EAAoB,GAAI,EAAQ,CAAA,CAC7B,EAAA,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAEhB,mCAAmC,EAAE,MAAM,IAAI,CAAA;CAChD,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAkBxE"}
|
|
@@ -1,89 +1,24 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
import { FeatureFlagEnum as n } from "../../../../utils/featureflag/FeatureFlags.js";
|
|
5
|
-
import r from "../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js";
|
|
6
|
-
import { useGetEntityTitleBarProperties as i } from "./useGetEntityTitleBarProperties.js";
|
|
7
|
-
import { useState as a } from "react";
|
|
8
|
-
import { Box as o, Divider as s, Link as c, Stack as l, Typography as u } from "@mui/material";
|
|
9
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
1
|
+
import e from "../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js";
|
|
2
|
+
import { Box as t } from "@mui/material";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
10
4
|
//#region src/components/entity/page/title_bar/TitleBarProperties.tsx
|
|
11
|
-
function
|
|
12
|
-
let {
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
|
|
15
|
-
children: /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
variant: "smallText1",
|
|
24
|
-
children: n
|
|
25
|
-
}) })] });
|
|
26
|
-
}
|
|
27
|
-
function m(u) {
|
|
28
|
-
let { entityId: m, versionNumber: h, onActMemberClickAddConditionsForUse: g } = u, { data: _ } = e(m, h), v = t(n.DESCRIPTION_FIELD), y = i(m, h), [b, x] = a(!1);
|
|
29
|
-
return /* @__PURE__ */ f(o, {
|
|
30
|
-
sx: { padding: "20px 40px" },
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ f(l, {
|
|
33
|
-
direction: "row",
|
|
34
|
-
sx: {
|
|
35
|
-
justifyContent: "space-between",
|
|
36
|
-
alignItems: "flex-start"
|
|
37
|
-
},
|
|
38
|
-
children: [/* @__PURE__ */ f(l, {
|
|
39
|
-
direction: "row",
|
|
40
|
-
divider: /* @__PURE__ */ d(s, {
|
|
41
|
-
orientation: "vertical",
|
|
42
|
-
flexItem: !0
|
|
43
|
-
}),
|
|
44
|
-
spacing: 2,
|
|
45
|
-
sx: { alignItems: "flex-start" },
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ d("table", { children: /* @__PURE__ */ d("tbody", { children: y.slice(0, 2).map((e) => /* @__PURE__ */ d(p, {
|
|
48
|
-
title: e.title,
|
|
49
|
-
value: e.value
|
|
50
|
-
}, e.key)) }) }),
|
|
51
|
-
y.length > 2 && /* @__PURE__ */ d("table", { children: /* @__PURE__ */ d("tbody", { children: y.slice(2, 4).map((e) => /* @__PURE__ */ d(p, {
|
|
52
|
-
title: e.title,
|
|
53
|
-
value: e.value
|
|
54
|
-
}, e.key)) }) }),
|
|
55
|
-
(y.length === 5 || y.length === 6) && /* @__PURE__ */ d("table", { children: /* @__PURE__ */ d("tbody", { children: y.slice(4, 6).map((e) => /* @__PURE__ */ d(p, {
|
|
56
|
-
title: e.title,
|
|
57
|
-
value: e.value
|
|
58
|
-
}, e.key)) }) }),
|
|
59
|
-
y.length > 6 && /* @__PURE__ */ d(c, {
|
|
60
|
-
onClick: () => x((e) => !e),
|
|
61
|
-
children: b ? "Hide properties" : `${y.length - 4} more properties`
|
|
62
|
-
})
|
|
63
|
-
]
|
|
64
|
-
}), /* @__PURE__ */ d(r, {
|
|
65
|
-
entityId: m,
|
|
66
|
-
onACTMemberClick: g
|
|
67
|
-
})]
|
|
68
|
-
}),
|
|
69
|
-
b && /* @__PURE__ */ d(o, {
|
|
70
|
-
sx: { pt: "20px" },
|
|
71
|
-
children: /* @__PURE__ */ d("table", { children: /* @__PURE__ */ d("tbody", { children: y.slice(4, Infinity).map((e) => /* @__PURE__ */ d(p, {
|
|
72
|
-
title: e.title,
|
|
73
|
-
value: e.value
|
|
74
|
-
}, e.key)) }) })
|
|
75
|
-
}),
|
|
76
|
-
_?.entity?.description && v && /* @__PURE__ */ d(o, {
|
|
77
|
-
sx: {
|
|
78
|
-
marginTop: "10px",
|
|
79
|
-
maxWidth: "720px"
|
|
80
|
-
},
|
|
81
|
-
children: _?.entity?.description
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { entityId: i, onActMemberClickAddConditionsForUse: a } = r;
|
|
7
|
+
return /* @__PURE__ */ n(t, {
|
|
8
|
+
sx: { padding: "20px 0" },
|
|
9
|
+
children: /* @__PURE__ */ n(t, {
|
|
10
|
+
sx: {
|
|
11
|
+
display: "flex",
|
|
12
|
+
justifyContent: "flex-end"
|
|
13
|
+
},
|
|
14
|
+
children: /* @__PURE__ */ n(e, {
|
|
15
|
+
entityId: i,
|
|
16
|
+
onACTMemberClick: a
|
|
82
17
|
})
|
|
83
|
-
|
|
18
|
+
})
|
|
84
19
|
});
|
|
85
20
|
}
|
|
86
21
|
//#endregion
|
|
87
|
-
export {
|
|
22
|
+
export { r as default };
|
|
88
23
|
|
|
89
24
|
//# sourceMappingURL=TitleBarProperties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"TitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/TitleBarProperties.tsx"],"sourcesContent":["import { Box } from '@mui/material'\nimport AddConditionsForUseButton from '../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton'\n\nexport type TitleBarPropertiesProps = {\n entityId: string\n /* Callback invoked when an ACT member clicks \"Add Conditions for Use\". */\n onActMemberClickAddConditionsForUse: () => void\n}\n\n/**\n * The TitleBarProperties component displays a tabular view of the entity metadata on the Entity page.\n */\nexport default function TitleBarProperties(props: TitleBarPropertiesProps) {\n const { entityId, onActMemberClickAddConditionsForUse } = props\n\n return (\n <Box sx={{ padding: '20px 0' }}>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'flex-end',\n }}\n >\n <AddConditionsForUseButton\n entityId={entityId}\n onACTMemberClick={onActMemberClickAddConditionsForUse}\n />\n </Box>\n </Box>\n )\n}\n"],"mappings":";;;;AAYA,SAAwB,EAAmB,GAAgC;CACzE,IAAM,EAAE,aAAU,2CAAwC;CAE1D,OACE,kBAAC,GAAD;EAAK,IAAI,EAAE,SAAS,SAAS;YAC3B,kBAAC,GAAD;GACE,IAAI;IACF,SAAS;IACT,gBAAgB;GAClB;aAEA,kBAAC,GAAD;IACY;IACV,kBAAkB;GACnB,CAAA;EACE,CAAA;CACF,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetEntityTitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAQ3C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,GACrB,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"useGetEntityTitleBarProperties.d.ts","sourceRoot":"","sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAQ3C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,GACrB,cAAc,EAAE,CAmLlB"}
|
|
@@ -54,11 +54,10 @@ function b(b, x) {
|
|
|
54
54
|
W && {
|
|
55
55
|
key: "doi",
|
|
56
56
|
title: "DOI",
|
|
57
|
-
value: /* @__PURE__ */ g(
|
|
57
|
+
value: /* @__PURE__ */ g(d, {
|
|
58
|
+
value: W,
|
|
58
59
|
href: W,
|
|
59
|
-
|
|
60
|
-
target: "_blank",
|
|
61
|
-
children: W
|
|
60
|
+
useRoundedIcon: !0
|
|
62
61
|
})
|
|
63
62
|
},
|
|
64
63
|
G && {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetEntityTitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"sourcesContent":["import { useGetEntityChildren } from '@/synapse-queries'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isEntityRefCollectionView,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport useGetEntityMetadata from '@/utils/hooks/useGetEntityMetadata'\nimport { Box, Link } from '@mui/material'\nimport { DoiObjectType, EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityRefCollectionView } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport CopyToClipboardString from '../../../CopyToClipboardString/CopyToClipboardString'\nimport { HasAccessV2 } from '../../../HasAccess/HasAccessV2'\nimport { CitationsDialog } from './CitationsDialog'\nimport { maxCitationCount, useDataCiteUsage } from './useDataCiteUsage'\nimport { useGetMentions } from './useGetMentions'\nimport Linkify from '@/components/GenericCard/Linkify'\n\nexport type EntityProperty = {\n key: string\n title: string\n value: ReactNode\n}\n\n/**\n * This hook fetches all the entity metadata shown on the Entity page, and transforms the data into an ordered list of\n * render-able key-value pairs.\n * @param entityId\n * @param versionNumber\n */\nexport function useGetEntityTitleBarProperties(\n entityId: string,\n versionNumber?: number,\n): EntityProperty[] {\n const {\n entityBundle: bundle,\n fileHandle: dataFileHandle,\n downloadAlias,\n isContainer,\n fileHandleStorageInfo,\n uploadDestinationString,\n } = useGetEntityMetadata(entityId, versionNumber)\n const [dataCiteCitationsDialogOpen, setDataCiteCitationsDialogOpen] =\n useState(false)\n const [mentionsDialogOpen, setMentionsDialogOpen] = useState(false)\n const { data: entityChildrenResponse } = useGetEntityChildren(\n {\n parentId: entityId,\n includeTypes: Object.values(EntityType),\n includeTotalChildCount: true,\n },\n { enabled: isContainer },\n )\n\n // If this is the latest entity version, show the \"versionless\" DOI if it exists.\n const useFallbackVersionlessDOI =\n bundle &&\n !bundle.doiAssociation &&\n isVersionableEntity(bundle.entity) &&\n bundle.entity.isLatestVersion\n const { data: versionlessDOIAssociation } = useGetDOIAssociation(\n { id: entityId, version: undefined, type: DoiObjectType.ENTITY },\n {\n enabled: useFallbackVersionlessDOI,\n },\n )\n\n const size =\n dataFileHandle?.contentSize &&\n calculateFriendlyFileSize(dataFileHandle.contentSize)\n const storageLocation =\n fileHandleStorageInfo &&\n 'location' in fileHandleStorageInfo &&\n fileHandleStorageInfo.location\n const endpoint =\n fileHandleStorageInfo &&\n 'endpoint' in fileHandleStorageInfo &&\n fileHandleStorageInfo.endpoint\n const bucket =\n fileHandleStorageInfo &&\n 'bucket' in fileHandleStorageInfo &&\n fileHandleStorageInfo.bucket\n const fileKey =\n fileHandleStorageInfo &&\n 'fileKey' in fileHandleStorageInfo &&\n fileHandleStorageInfo.fileKey\n const externalUrl =\n fileHandleStorageInfo &&\n 'url' in fileHandleStorageInfo &&\n fileHandleStorageInfo.url\n\n const md5 = dataFileHandle?.contentMd5\n\n // If there is no version-specific DOI, fall back to the versionless DOI\n const doiAssociation = useFallbackVersionlessDOI\n ? versionlessDOIAssociation\n : bundle?.doiAssociation\n const { data: dataCiteUsage } = useDataCiteUsage(doiAssociation?.doiUri)\n const doi = doiAssociation && `https://doi.org/${doiAssociation?.doiUri}`\n const isDoiUsage = !!dataCiteUsage && dataCiteUsage.citationCount > 0\n const containerItems = entityChildrenResponse?.totalChildCount\n\n const datasetItems =\n bundle?.entity && isEntityRefCollectionView(bundle.entity)\n ? ((bundle?.entity as EntityRefCollectionView).items ?? []).length\n : null\n\n const { data: mentions } = useGetMentions(entityId)\n const isMentions = !!mentions && mentions.length > 0\n return [\n {\n key: 'id',\n title: 'SynID',\n value: <CopyToClipboardString value={entityId} />,\n },\n {\n key: 'access',\n title: 'Access',\n value: <HasAccessV2 entityId={entityId} />,\n },\n size && { key: 'fileSize', title: 'Size', value: size },\n containerItems != null && {\n key: 'containerItems',\n title: 'Items',\n value: containerItems.toLocaleString(),\n },\n datasetItems != null && {\n key: 'entityRefCollectionItems',\n title: 'Items',\n value: datasetItems.toLocaleString(),\n },\n doi && {\n key: 'doi',\n title: 'DOI',\n value:
|
|
1
|
+
{"version":3,"file":"useGetEntityTitleBarProperties.js","names":[],"sources":["../../../../../src/components/entity/page/title_bar/useGetEntityTitleBarProperties.tsx"],"sourcesContent":["import { useGetEntityChildren } from '@/synapse-queries'\nimport { useGetDOIAssociation } from '@/synapse-queries/doi/useDOI'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isEntityRefCollectionView,\n isVersionableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport useGetEntityMetadata from '@/utils/hooks/useGetEntityMetadata'\nimport { Box, Link } from '@mui/material'\nimport { DoiObjectType, EntityType } from '@sage-bionetworks/synapse-client'\nimport { EntityRefCollectionView } from '@sage-bionetworks/synapse-types'\nimport { ReactNode, useState } from 'react'\nimport CopyToClipboardString from '../../../CopyToClipboardString/CopyToClipboardString'\nimport { HasAccessV2 } from '../../../HasAccess/HasAccessV2'\nimport { CitationsDialog } from './CitationsDialog'\nimport { maxCitationCount, useDataCiteUsage } from './useDataCiteUsage'\nimport { useGetMentions } from './useGetMentions'\nimport Linkify from '@/components/GenericCard/Linkify'\n\nexport type EntityProperty = {\n key: string\n title: string\n value: ReactNode\n}\n\n/**\n * This hook fetches all the entity metadata shown on the Entity page, and transforms the data into an ordered list of\n * render-able key-value pairs.\n * @param entityId\n * @param versionNumber\n */\nexport function useGetEntityTitleBarProperties(\n entityId: string,\n versionNumber?: number,\n): EntityProperty[] {\n const {\n entityBundle: bundle,\n fileHandle: dataFileHandle,\n downloadAlias,\n isContainer,\n fileHandleStorageInfo,\n uploadDestinationString,\n } = useGetEntityMetadata(entityId, versionNumber)\n const [dataCiteCitationsDialogOpen, setDataCiteCitationsDialogOpen] =\n useState(false)\n const [mentionsDialogOpen, setMentionsDialogOpen] = useState(false)\n const { data: entityChildrenResponse } = useGetEntityChildren(\n {\n parentId: entityId,\n includeTypes: Object.values(EntityType),\n includeTotalChildCount: true,\n },\n { enabled: isContainer },\n )\n\n // If this is the latest entity version, show the \"versionless\" DOI if it exists.\n const useFallbackVersionlessDOI =\n bundle &&\n !bundle.doiAssociation &&\n isVersionableEntity(bundle.entity) &&\n bundle.entity.isLatestVersion\n const { data: versionlessDOIAssociation } = useGetDOIAssociation(\n { id: entityId, version: undefined, type: DoiObjectType.ENTITY },\n {\n enabled: useFallbackVersionlessDOI,\n },\n )\n\n const size =\n dataFileHandle?.contentSize &&\n calculateFriendlyFileSize(dataFileHandle.contentSize)\n const storageLocation =\n fileHandleStorageInfo &&\n 'location' in fileHandleStorageInfo &&\n fileHandleStorageInfo.location\n const endpoint =\n fileHandleStorageInfo &&\n 'endpoint' in fileHandleStorageInfo &&\n fileHandleStorageInfo.endpoint\n const bucket =\n fileHandleStorageInfo &&\n 'bucket' in fileHandleStorageInfo &&\n fileHandleStorageInfo.bucket\n const fileKey =\n fileHandleStorageInfo &&\n 'fileKey' in fileHandleStorageInfo &&\n fileHandleStorageInfo.fileKey\n const externalUrl =\n fileHandleStorageInfo &&\n 'url' in fileHandleStorageInfo &&\n fileHandleStorageInfo.url\n\n const md5 = dataFileHandle?.contentMd5\n\n // If there is no version-specific DOI, fall back to the versionless DOI\n const doiAssociation = useFallbackVersionlessDOI\n ? versionlessDOIAssociation\n : bundle?.doiAssociation\n const { data: dataCiteUsage } = useDataCiteUsage(doiAssociation?.doiUri)\n const doi = doiAssociation && `https://doi.org/${doiAssociation?.doiUri}`\n const isDoiUsage = !!dataCiteUsage && dataCiteUsage.citationCount > 0\n const containerItems = entityChildrenResponse?.totalChildCount\n\n const datasetItems =\n bundle?.entity && isEntityRefCollectionView(bundle.entity)\n ? ((bundle?.entity as EntityRefCollectionView).items ?? []).length\n : null\n\n const { data: mentions } = useGetMentions(entityId)\n const isMentions = !!mentions && mentions.length > 0\n return [\n {\n key: 'id',\n title: 'SynID',\n value: <CopyToClipboardString value={entityId} />,\n },\n {\n key: 'access',\n title: 'Access',\n value: <HasAccessV2 entityId={entityId} />,\n },\n size && { key: 'fileSize', title: 'Size', value: size },\n containerItems != null && {\n key: 'containerItems',\n title: 'Items',\n value: containerItems.toLocaleString(),\n },\n datasetItems != null && {\n key: 'entityRefCollectionItems',\n title: 'Items',\n value: datasetItems.toLocaleString(),\n },\n doi && {\n key: 'doi',\n title: 'DOI',\n value: <CopyToClipboardString value={doi} href={doi} useRoundedIcon />,\n },\n isDoiUsage && {\n key: 'citations',\n title: 'Citations',\n value: (\n <>\n <Link onClick={() => setDataCiteCitationsDialogOpen(true)}>\n {dataCiteUsage.citationCount.toLocaleString()}\n {dataCiteUsage.citationCount == maxCitationCount && '+'}\n </Link>\n <CitationsDialog\n open={dataCiteCitationsDialogOpen}\n onClose={() => setDataCiteCitationsDialogOpen(false)}\n citations={dataCiteUsage.citations}\n />\n </>\n ),\n },\n isMentions && {\n key: 'mentions',\n title: 'Mentions',\n value: (\n <>\n <Link onClick={() => setMentionsDialogOpen(true)}>\n {mentions.length.toLocaleString()}\n </Link>\n <CitationsDialog\n open={mentionsDialogOpen}\n onClose={() => setMentionsDialogOpen(false)}\n citations={mentions}\n title=\"Mentioned in\"\n />\n </>\n ),\n },\n md5 && {\n key: 'fileMd5',\n title: 'MD5',\n value: <CopyToClipboardString value={md5} />,\n },\n !isContainer &&\n storageLocation && {\n key: 'fileStorageLocation',\n title: 'Storage Location',\n value: storageLocation,\n },\n isContainer &&\n uploadDestinationString && {\n key: 'uploadDestination',\n title: 'Upload Destination',\n value: uploadDestinationString,\n },\n endpoint && {\n key: 'externalFileEndpoint',\n title: 'Endpoint',\n value: endpoint,\n },\n externalUrl && {\n key: 'externalUrl',\n title: 'URL',\n value: <Linkify text={externalUrl} />,\n },\n bucket && { key: 'externalFileBucket', title: 'Bucket', value: bucket },\n fileKey && { key: 'externalFileKey', title: 'File Key', value: fileKey },\n downloadAlias && {\n key: 'fileAlias',\n title: 'Alias',\n value: (\n <>\n {'Name when downloaded will be: '}\n <Box sx={{ display: 'inline', fontFamily: 'monospace' }}>\n {downloadAlias}\n </Box>\n </>\n ),\n },\n ].filter(item => !!item) as EntityProperty[]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,SAAgB,EACd,GACA,GACkB;CAClB,IAAM,EACJ,cAAc,GACd,YAAY,GACZ,kBACA,gBACA,0BACA,+BACE,EAAqB,GAAU,CAAa,GAC1C,CAAC,GAA6B,KAClC,EAAS,EAAK,GACV,CAAC,GAAoB,KAAyB,EAAS,EAAK,GAC5D,EAAE,MAAM,MAA2B,EACvC;EACE,UAAU;EACV,cAAc,OAAO,OAAO,CAAU;EACtC,wBAAwB;CAC1B,GACA,EAAE,SAAS,EAAY,CACzB,GAGM,IACJ,KACA,CAAC,EAAO,kBACR,EAAoB,EAAO,MAAM,KACjC,EAAO,OAAO,iBACV,EAAE,MAAM,MAA8B,EAC1C;EAAE,IAAI;EAAU,SAAS,KAAA;EAAW,MAAM,EAAc;CAAO,GAC/D,EACE,SAAS,EACX,CACF,GAEM,IACJ,GAAgB,eAChB,EAA0B,EAAe,WAAW,GAChD,IACJ,KACA,cAAc,KACd,EAAsB,UAClB,IACJ,KACA,cAAc,KACd,EAAsB,UAClB,IACJ,KACA,YAAY,KACZ,EAAsB,QAClB,IACJ,KACA,aAAa,KACb,EAAsB,SAClB,IACJ,KACA,SAAS,KACT,EAAsB,KAElB,IAAM,GAAgB,YAGtB,IAAiB,IACnB,IACA,GAAQ,gBACN,EAAE,MAAM,MAAkB,EAAiB,GAAgB,MAAM,GACjE,IAAM,KAAkB,mBAAmB,GAAgB,UAC3D,IAAa,CAAC,CAAC,KAAiB,EAAc,gBAAgB,GAC9D,IAAiB,GAAwB,iBAEzC,IACJ,GAAQ,UAAU,EAA0B,EAAO,MAAM,MACnD,GAAQ,QAAmC,SAAS,CAAC,GAAG,SAC1D,MAEA,EAAE,MAAM,MAAa,EAAe,CAAQ,GAC5C,IAAa,CAAC,CAAC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AAO;GACP,OAAO;EACT;EACF,KAAY;GACV,KAAK;GACL,OAAO;GACP,OAAO;EACT;EACA,KAAe;GACb,KAAK;GACL,OAAO;GACP,OAAO,kBAAC,GAAD,EAAS,MAAM,EAAc,CAAA;EACtC;EACA,KAAU;GAAE,KAAK;GAAsB,OAAO;GAAU,OAAO;EAAO;EACtE,KAAW;GAAE,KAAK;GAAmB,OAAO;GAAY,OAAO;EAAQ;EACvE,KAAiB;GACf,KAAK;GACL,OAAO;GACP,OACE,kBAAA,GAAA,EAAA,UAAA,CACG,kCACD,kBAAC,GAAD;IAAK,IAAI;KAAE,SAAS;KAAU,YAAY;IAAY;cACnD;GACE,CAAA,CACL,EAAA,CAAA;EAEN;CACF,EAAE,QAAO,MAAQ,CAAC,CAAC,CAAI;AACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComplexMenu.d.ts","sourceRoot":"","sources":["../../../src/components/menu/ComplexMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACX,OAAO,EAIR,MAAM,eAAe,CAAA;AACtB,OAAO,EAAgB,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAiB,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAGpE,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG;IACtE,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAK7B,WAAW,CAAC,EAAE,sBAAsB,EAAE,CAAA;IAMtC,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAA;CACpC,CAAA;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ComplexMenu.d.ts","sourceRoot":"","sources":["../../../src/components/menu/ComplexMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACX,OAAO,EAIR,MAAM,eAAe,CAAA;AACtB,OAAO,EAAgB,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAiB,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAGpE,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAAG;IACtE,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAK7B,WAAW,CAAC,EAAE,sBAAsB,EAAE,CAAA;IAMtC,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAA;CACpC,CAAA;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA2GlD"}
|
|
@@ -11,7 +11,9 @@ function u(u) {
|
|
|
11
11
|
display: "flex",
|
|
12
12
|
alignItems: "center",
|
|
13
13
|
gap: "10px",
|
|
14
|
-
|
|
14
|
+
flexWrap: "wrap",
|
|
15
|
+
justifyContent: "flex-end",
|
|
16
|
+
[e.breakpoints.down("md")]: {
|
|
15
17
|
flexDirection: "column",
|
|
16
18
|
paddingTop: "10px"
|
|
17
19
|
}
|
|
@@ -20,7 +22,7 @@ function u(u) {
|
|
|
20
22
|
if (n.variant != null) {
|
|
21
23
|
let t = n.text ?? n.tooltipText;
|
|
22
24
|
return /* @__PURE__ */ c(r, {
|
|
23
|
-
sx: (e) => ({ [e.breakpoints.down("
|
|
25
|
+
sx: (e) => ({ [e.breakpoints.down("md")]: {
|
|
24
26
|
width: "100%",
|
|
25
27
|
".MuiButton-root": { width: "100%" }
|
|
26
28
|
} }),
|
|
@@ -69,7 +71,7 @@ function u(u) {
|
|
|
69
71
|
icon: n.icon
|
|
70
72
|
}, n.tooltipText);
|
|
71
73
|
}), f.map((e, t) => e.items && e.items.length > 0 && /* @__PURE__ */ c(r, {
|
|
72
|
-
sx: (e) => ({ [e.breakpoints.down("
|
|
74
|
+
sx: (e) => ({ [e.breakpoints.down("md")]: {
|
|
73
75
|
width: "100%",
|
|
74
76
|
".MuiButton-root": { width: "100%" }
|
|
75
77
|
} }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComplexMenu.js","names":[],"sources":["../../../src/components/menu/ComplexMenu.tsx"],"sourcesContent":["import {\n Box,\n Button,\n ButtonProps,\n SxProps,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@mui/material'\nimport { DropdownMenu, DropdownMenuProps } from './DropdownMenu'\nimport { IconSvgButton, IconSvgButtonProps } from '../IconSvgButton'\nimport IconSvg from '../IconSvg'\n\nexport type ComplexMenuButtonProps = Omit<IconSvgButtonProps, 'icon'> & {\n icon?: IconSvgButtonProps['icon']\n variant?: ButtonProps['variant']\n text?: string\n iconSx?: SxProps\n}\n\nexport type ComplexMenuProps = {\n /*\n * Configuration for buttons. Each entry corresponds to one button.\n * See the ComplexMenuButtonProps type for more info.\n */\n iconButtons?: ComplexMenuButtonProps[]\n /*\n * Configuration for DropdownMenus. Each entry corresponds to one dropdown menu button, which\n * itself can contain multiple groups of items.\n * See the DropdownMenuProps type for more info.\n */\n dropdownMenus?: DropdownMenuProps[]\n}\n\n/**\n * The ComplexMenu component allows you to create a generic menu with\n * icon buttons and multiple dropdown menus that contain groups of items.\n */\nexport function ComplexMenu(props: ComplexMenuProps) {\n const { iconButtons = [], dropdownMenus = [] } = props\n const theme = useTheme()\n const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'))\n\n return (\n <Box\n sx={theme => ({\n display: 'flex',\n alignItems: 'center',\n gap: '10px',\n [theme.breakpoints.down('
|
|
1
|
+
{"version":3,"file":"ComplexMenu.js","names":[],"sources":["../../../src/components/menu/ComplexMenu.tsx"],"sourcesContent":["import {\n Box,\n Button,\n ButtonProps,\n SxProps,\n Typography,\n useMediaQuery,\n useTheme,\n} from '@mui/material'\nimport { DropdownMenu, DropdownMenuProps } from './DropdownMenu'\nimport { IconSvgButton, IconSvgButtonProps } from '../IconSvgButton'\nimport IconSvg from '../IconSvg'\n\nexport type ComplexMenuButtonProps = Omit<IconSvgButtonProps, 'icon'> & {\n icon?: IconSvgButtonProps['icon']\n variant?: ButtonProps['variant']\n text?: string\n iconSx?: SxProps\n}\n\nexport type ComplexMenuProps = {\n /*\n * Configuration for buttons. Each entry corresponds to one button.\n * See the ComplexMenuButtonProps type for more info.\n */\n iconButtons?: ComplexMenuButtonProps[]\n /*\n * Configuration for DropdownMenus. Each entry corresponds to one dropdown menu button, which\n * itself can contain multiple groups of items.\n * See the DropdownMenuProps type for more info.\n */\n dropdownMenus?: DropdownMenuProps[]\n}\n\n/**\n * The ComplexMenu component allows you to create a generic menu with\n * icon buttons and multiple dropdown menus that contain groups of items.\n */\nexport function ComplexMenu(props: ComplexMenuProps) {\n const { iconButtons = [], dropdownMenus = [] } = props\n const theme = useTheme()\n const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'))\n\n return (\n <Box\n sx={theme => ({\n display: 'flex',\n alignItems: 'center',\n gap: '10px',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n [theme.breakpoints.down('md')]: {\n flexDirection: 'column',\n paddingTop: '10px',\n },\n })}\n >\n {iconButtons.map(iconButton => {\n if (iconButton.variant != null) {\n const label = iconButton.text ?? iconButton.tooltipText\n return (\n <Box\n key={label}\n sx={theme => ({\n [theme.breakpoints.down('md')]: {\n width: '100%',\n '.MuiButton-root': { width: '100%' },\n },\n })}\n >\n <Button\n variant={iconButton.variant}\n startIcon={\n iconButton.icon ? (\n <IconSvg\n icon={iconButton.icon}\n wrap={false}\n fontSize={'inherit'}\n sx={iconButton.iconSx}\n />\n ) : undefined\n }\n onClick={iconButton.onClick}\n href={iconButton.href}\n disabled={iconButton.disabled}\n >\n <Typography variant=\"buttonLink\">{label}</Typography>\n </Button>\n </Box>\n )\n }\n return isSmallScreen && iconButton.tooltipText ? (\n <Box\n sx={{\n width: '100%',\n textAlign: 'center',\n }}\n >\n <Button\n variant=\"text\"\n startIcon={\n <IconSvg\n key={iconButton.tooltipText}\n icon={iconButton.icon!}\n wrap={false}\n fontSize={'inherit'}\n />\n }\n onClick={iconButton.onClick}\n sx={{\n padding: '6px 12px',\n minWidth: 'unset',\n }}\n >\n <Typography variant=\"buttonLink\">\n {iconButton.tooltipText}\n </Typography>\n </Button>\n </Box>\n ) : (\n <IconSvgButton\n key={iconButton.tooltipText}\n {...iconButton}\n icon={iconButton.icon!}\n />\n )\n })}\n {dropdownMenus.map(\n (menuProps, index) =>\n menuProps.items &&\n menuProps.items.length > 0 && (\n <Box\n sx={theme => ({\n [theme.breakpoints.down('md')]: {\n width: '100%',\n '.MuiButton-root': { width: '100%' },\n },\n })}\n >\n <DropdownMenu key={index} {...menuProps} />\n </Box>\n ),\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;AAsCA,SAAgB,EAAY,GAAyB;CACnD,IAAM,EAAE,iBAAc,CAAC,GAAG,mBAAgB,CAAC,MAAM,GAE3C,IAAgB,EADR,EACsB,EAAM,YAAY,KAAK,IAAI,CAAC;CAEhE,OACE,kBAAC,GAAD;EACE,KAAI,OAAU;GACZ,SAAS;GACT,YAAY;GACZ,KAAK;GACL,UAAU;GACV,gBAAgB;IACf,EAAM,YAAY,KAAK,IAAI,IAAI;IAC9B,eAAe;IACf,YAAY;GACd;EACF;YAXF,CAaG,EAAY,KAAI,MAAc;GAC7B,IAAI,EAAW,WAAW,MAAM;IAC9B,IAAM,IAAQ,EAAW,QAAQ,EAAW;IAC5C,OACE,kBAAC,GAAD;KAEE,KAAI,OAAU,GACX,EAAM,YAAY,KAAK,IAAI,IAAI;MAC9B,OAAO;MACP,mBAAmB,EAAE,OAAO,OAAO;KACrC,EACF;eAEA,kBAAC,GAAD;MACE,SAAS,EAAW;MACpB,WACE,EAAW,OACT,kBAAC,GAAD;OACE,MAAM,EAAW;OACjB,MAAM;OACN,UAAU;OACV,IAAI,EAAW;MAChB,CAAA,IACC,KAAA;MAEN,SAAS,EAAW;MACpB,MAAM,EAAW;MACjB,UAAU,EAAW;gBAErB,kBAAC,GAAD;OAAY,SAAQ;iBAAc;MAAkB,CAAA;KAC9C,CAAA;IACL,GA1BE,CA0BF;GAET;GACA,OAAO,KAAiB,EAAW,cACjC,kBAAC,GAAD;IACE,IAAI;KACF,OAAO;KACP,WAAW;IACb;cAEA,kBAAC,GAAD;KACE,SAAQ;KACR,WACE,kBAAC,GAAD;MAEE,MAAM,EAAW;MACjB,MAAM;MACN,UAAU;KACX,GAJM,EAAW,WAIjB;KAEH,SAAS,EAAW;KACpB,IAAI;MACF,SAAS;MACT,UAAU;KACZ;eAEA,kBAAC,GAAD;MAAY,SAAQ;gBACjB,EAAW;KACF,CAAA;IACN,CAAA;GACL,CAAA,IAEL,kBAAC,GAAD;IAEE,GAAI;IACJ,MAAM,EAAW;GAClB,GAHM,EAAW,WAGjB;EAEL,CAAC,GACA,EAAc,KACZ,GAAW,MACV,EAAU,SACV,EAAU,MAAM,SAAS,KACvB,kBAAC,GAAD;GACE,KAAI,OAAU,GACX,EAAM,YAAY,KAAK,IAAI,IAAI;IAC9B,OAAO;IACP,mBAAmB,EAAE,OAAO,OAAO;GACrC,EACF;aAEA,kBAAC,GAAD,EAA0B,GAAI,EAAY,GAAvB,CAAuB;EACvC,CAAA,CAEX,CACG;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactQueryMockUtils.js","names":[],"sources":["../../src/testutils/ReactQueryMockUtils.ts"],"sourcesContent":["import type { InfiniteData } from '@tanstack/query-core'\nimport {\n QueryObserverLoadingResult,\n QueryObserverSuccessResult,\n UseInfiniteQueryResult,\n UseMutationResult,\n UseQueryResult,\n} from '@tanstack/react-query'\nimport type { Mock } from '@vitest/spy'\nimport { Dispatch, SetStateAction, useState } from 'react'\n\n/**\n * Returns a mock instance for useQuery, as well as functions to manipulate the mock hook's state, and\n * mocks for function(s) returned by the hook.\n *\n * Example usage:\n * ```tsx\n * const { mock, setSuccess } = getUseQueryMock<MyDataType, MyErrorType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n *\n * // ...optionally verify a loading state in your component/hook\n *\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseQueryMock<TData = unknown, TError = unknown>(): {\n mock: Mock<() => UseQueryResult<TData, TError>>\n mockRefetch: Mock\n setSuccess: (data: TData) => void\n setError: (error: TError) => void\n setLoading: () => void\n setIdle: () => void\n} {\n // Stable mock functions\n const mockRefetch = vi.fn()\n\n let currentSetValue: Dispatch<\n SetStateAction<UseQueryResult<TData, TError>>\n > | null = null\n\n const setSuccess = (data: TData) => {\n if (currentSetValue) {\n const successState: UseQueryResult<TData, TError> = {\n data: data,\n status: 'success',\n isSuccess: true,\n isPending: false,\n isLoading: false,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n refetch: mockRefetch,\n isPlaceholderData: false,\n isStale: false,\n promise: Promise.resolve(data),\n }\n\n currentSetValue(successState)\n } else {\n console.warn(\n 'setSuccess called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: 0,\n error: error,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: true,\n isFetched: false,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoadingError: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'error',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isLoading: false,\n isPending: false,\n promise: new Promise(() => {}),\n }\n\n currentSetValue(errorState)\n } else {\n console.warn(\n 'setError called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const setLoading = () => {\n if (currentSetValue) {\n const loadingState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: true,\n isLoading: true,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n failureReason: null,\n fetchStatus: 'fetching',\n isPending: true,\n isInitialLoading: true,\n isPaused: false,\n promise: new Promise(() => {}),\n }\n\n currentSetValue(loadingState)\n } else {\n console.warn(\n 'setError called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n function setIdle() {\n if (currentSetValue) {\n const idleState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: true,\n isLoading: false,\n isPending: true,\n promise: new Promise(() => {}),\n }\n currentSetValue(idleState)\n } else {\n console.warn(\n 'setIdle called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useQueryMocked() {\n const [value, setValue] = useState<UseQueryResult<TData, TError>>({\n data: undefined,\n fetchStatus: 'fetching',\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isInitialLoading: false,\n isLoading: true,\n isLoadingError: false,\n isPaused: false,\n isPending: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n promise: new Promise(() => {}),\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockRefetch: mockRefetch,\n setSuccess,\n setError,\n setLoading,\n setIdle,\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQuerySuccessMock<TData>(\n data: TData,\n): QueryObserverSuccessResult<TData, never> {\n return {\n data: data,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoading: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: true,\n refetch: vi.fn(),\n status: 'success',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isPending: false,\n promise: Promise.resolve(data),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryLoadingMock(): QueryObserverLoadingResult<\n never,\n never\n> {\n return {\n data: undefined,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: true,\n isLoading: true,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'pending',\n failureReason: null,\n fetchStatus: 'fetching',\n isPending: true,\n isInitialLoading: true,\n isPaused: false,\n promise: new Promise(() => {}),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryErrorMock<TError>(\n error: TError,\n): UseQueryResult<never, TError> {\n return {\n data: undefined,\n dataUpdatedAt: 0,\n error: error,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: true,\n isFetched: false,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoadingError: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'error',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isLoading: false,\n isPending: false,\n promise: new Promise<never>(() => {}),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryIdleMock(): UseQueryResult<never, never> {\n return {\n data: undefined,\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'pending',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: true,\n isLoading: false,\n isPending: true,\n promise: new Promise(() => {}),\n }\n}\n\n/**\n * Returns a mock instance for useMutation, as well as functions to manipulate the mock hook's state, and\n * mocks for function(s) returned by the hook.\n *\n * Example usage:\n * ```tsx\n * const { mock, setPending, setSuccess, mockMutate } = getUseMutationMockImpl<MyDataType, MyErrorType, MyVarsType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n *\n * // ...trigger the mutation using your component/hook interface, then\n * expect(mockMutate).toHaveBeenCalledWith(expectedVars);\n * act(() => { setPending(); })\n *\n * // ...verify the pending state in your component/hook, then resolve the mutation\n *\n *\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseMutationMock<\n TData = unknown,\n TError = unknown,\n TVariables = unknown,\n>(): {\n mock: Mock<() => UseMutationResult<TData, TError, TVariables>>\n mockMutate: Mock<(vars: TVariables) => void>\n mockMutateAsync: Mock<(vars: TVariables) => Promise<TData>>\n mockReset: Mock\n setSuccess: (data: TData) => void\n setError: (error: TError) => void\n setPending: () => void\n setIdle: () => void\n} {\n let currentSetValue: Dispatch<\n SetStateAction<UseMutationResult<TData, TError, TVariables>>\n > | null = null\n\n function setVars(vars: TVariables) {\n if (currentSetValue) {\n currentSetValue(\n prevState =>\n ({\n ...prevState,\n variables: vars,\n }) as UseMutationResult<TData, TError, TVariables>,\n )\n } else {\n console.warn(\n 'mutate or mutateAsync called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n // Stable mock functions\n const mockMutate = vi.fn()\n const mockMutateAsync = vi.fn()\n const mockReset = vi.fn()\n const variables = (mockMutate.mock.lastCall?.[0] ??\n mockMutateAsync.mock.lastCall?.[0]) as TVariables | undefined\n\n function mutate(vars: TVariables): void {\n setVars(vars)\n mockMutate(vars)\n }\n\n function mutateAsync(vars: TVariables): Promise<TData> {\n setVars(vars)\n return mockMutateAsync(vars) as Promise<TData>\n }\n\n const setSuccess = (data: TData) => {\n if (currentSetValue) {\n const successState: UseMutationResult<TData, TError, TVariables> = {\n data: data,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: true,\n status: 'success',\n variables: variables!,\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n }\n\n currentSetValue(\n prev =>\n ({ ...successState, variables: prev.variables }) as UseMutationResult<\n TData,\n TError,\n TVariables\n >,\n )\n } else {\n console.warn(\n 'setSuccess called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseMutationResult<TData, TError, TVariables> = {\n error: error,\n data: undefined,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n failureCount: 1,\n isError: true,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n status: 'error',\n variables: variables!,\n failureReason: error,\n isPending: false,\n submittedAt: 0,\n }\n\n currentSetValue(\n prev =>\n ({ ...errorState, variables: prev.variables }) as UseMutationResult<\n TData,\n TError,\n TVariables\n >,\n )\n } else {\n console.warn(\n 'setError called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const setPending = () => {\n if (currentSetValue) {\n const pendingState: UseMutationResult<TData, TError, TVariables> = {\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n status: 'pending',\n failureReason: null,\n isPending: true,\n submittedAt: 0,\n variables: variables!,\n }\n\n currentSetValue(\n prev =>\n ({ ...pendingState, variables: prev.variables }) as UseMutationResult<\n TData,\n TError,\n TVariables\n >,\n )\n } else {\n console.warn(\n 'setPending called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n function setIdle() {\n if (currentSetValue) {\n const idleState: UseMutationResult<TData, TError, TVariables> = {\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n variables: undefined,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n status: 'idle',\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n }\n currentSetValue(idleState)\n } else {\n console.warn(\n 'setIdle called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useMutationMocked() {\n const [value, setValue] = useState<\n UseMutationResult<TData, TError, TVariables>\n >({\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n variables: undefined,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n status: 'idle',\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockMutate,\n mockMutateAsync,\n mockReset,\n setSuccess,\n setError,\n setPending,\n setIdle,\n }\n}\n\n/**\n * @deprecated Use {@link getUseMutationMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseMutationIdleMock<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TError = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TVariables = any,\n>(data?: TData) {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n mutate: vi.fn(),\n mutateAsync: vi.fn().mockResolvedValue(data),\n reset: vi.fn(),\n status: 'idle',\n variables: undefined,\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n } satisfies UseMutationResult<TData, TError, TVariables>\n}\n\n/**\n * @deprecated Use {@link getUseMutationMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseMutationPendingMock<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TData = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TError = any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TVariables = any,\n>(data?: TData, variables?: TVariables) {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n mutate: vi.fn(),\n mutateAsync: vi.fn().mockResolvedValue(data),\n reset: vi.fn(),\n status: 'pending',\n variables: variables!,\n failureReason: null,\n isPending: true,\n submittedAt: 0,\n } satisfies UseMutationResult<TData, TError, TVariables>\n}\n\n/**\n * @deprecated Use {@link getUseInfiniteQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseInfiniteQuerySuccessMock<TData>(\n pages: TData[],\n hasNextPage = false,\n): UseInfiniteQueryResult<{ pages: TData[] }, never> {\n return {\n data: {\n pages: pages,\n },\n error: null,\n isError: false,\n isPending: false,\n isLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isSuccess: true,\n status: 'success',\n fetchNextPage: vi.fn(),\n fetchPreviousPage: vi.fn(),\n hasNextPage: hasNextPage,\n hasPreviousPage: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n dataUpdatedAt: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n errorUpdateCount: 0,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isInitialLoading: false,\n isPaused: false,\n isPlaceholderData: false,\n isRefetching: false,\n isStale: false,\n refetch: vi.fn(),\n fetchStatus: 'idle',\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: Promise.resolve({ pages }),\n } satisfies UseInfiniteQueryResult<{ pages: TData[] }, never>\n}\n\n/**\n * Returns a mock instance for useInfiniteQuery, as well as functions to manipulate the mock hook's state, and\n * mock functions for fetchNextPage, fetchPreviousPage, and refetch.\n *\n * Example usage:\n * ```tsx\n * const { mock, setSuccess } = getUseInfiniteQueryMock<MyDataType, MyErrorType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseInfiniteQueryMock<TData = unknown, TError = unknown>(): {\n mock: Mock<() => UseInfiniteQueryResult<InfiniteData<TData>, TError>>\n mockFetchNextPage: Mock\n setSuccess: (\n data: TData[],\n hasNextPage?: boolean,\n isFetchingNextPage?: boolean,\n ) => void\n setError: (error: TError) => void\n setLoading: () => void\n} {\n // Stable mock functions\n const mockFetchNextPage = vi.fn()\n const mockFetchPreviousPage = vi.fn()\n const mockRefetch = vi.fn()\n\n let currentSetValue: Dispatch<\n SetStateAction<UseInfiniteQueryResult<InfiniteData<TData>, TError>>\n > | null = null\n\n const setSuccess = (\n data: TData[],\n hasNextPage = false,\n isFetchingNextPage = false,\n ) => {\n if (currentSetValue) {\n const successState: UseInfiniteQueryResult<\n InfiniteData<TData>,\n TError\n > = {\n data: { pages: data, pageParams: [] },\n hasNextPage: hasNextPage,\n status: 'success',\n isSuccess: true,\n isPending: false,\n isLoading: false,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: isFetchingNextPage ? 'fetching' : 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: isFetchingNextPage,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchPreviousPageError: false,\n isFetchNextPageError: false,\n promise: Promise.resolve({ pages: data, pageParams: [] }),\n }\n currentSetValue(successState)\n } else {\n console.warn(\n 'setSuccess called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseInfiniteQueryResult<InfiniteData<TData>, TError> = {\n data: undefined,\n hasNextPage: false,\n status: 'error',\n isSuccess: false,\n isPending: false,\n isLoading: false,\n isError: true,\n error: error,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: true,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n }\n currentSetValue(errorState)\n } else {\n console.warn(\n 'setError called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const setLoading = () => {\n if (currentSetValue) {\n const loadingState: UseInfiniteQueryResult<\n InfiniteData<TData>,\n TError\n > = {\n data: undefined,\n hasNextPage: false,\n status: 'pending',\n isSuccess: false,\n isPending: true,\n isLoading: true,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'fetching',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: true,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n }\n currentSetValue(loadingState)\n } else {\n console.warn(\n 'setError called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useMockInfiniteQuery() {\n const [value, setValue] = useState<\n UseInfiniteQueryResult<InfiniteData<TData>, TError>\n >({\n data: undefined,\n fetchStatus: 'fetching',\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n hasNextPage: false,\n hasPreviousPage: false,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n isInitialLoading: false,\n isLoading: true,\n isLoadingError: false,\n isPaused: false,\n isPending: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockFetchNextPage: mockFetchNextPage,\n setSuccess,\n setError,\n setLoading,\n }\n}\n"],"mappings":";;AA4BA,SAAgB,IAOd;CAEA,IAAM,IAAc,GAAG,GAAG,GAEtB,IAEO,MAEL,KAAc,MAAgB;EAClC,IAAI,GAAiB;GACnB,IAAM,IAA8C;IAC5C;IACN,QAAQ;IACR,WAAW;IACX,WAAW;IACX,WAAW;IACX,SAAS;IACT,OAAO;IACP,WAAW;IACX,qBAAqB;IACrB,YAAY;IACZ,kBAAkB;IAClB,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,UAAU;IACV,eAAe,KAAK,IAAI;IACxB,gBAAgB;IAChB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,SAAS;IACT,mBAAmB;IACnB,SAAS;IACT,SAAS,QAAQ,QAAQ,CAAI;GAC/B;GAEA,EAAgB,CAAY;EAC9B,OACE,QAAQ,KACN,4EACF;CAEJ,GAEM,KAAY,MAAkB;EAClC,IAAI,GAAiB;GACnB,IAAM,IAA4C;IAChD,MAAM,KAAA;IACN,eAAe;IACR;IACP,kBAAkB;IAClB,gBAAgB,KAAK,IAAI;IACzB,cAAc;IACd,SAAS;IACT,WAAW;IACX,qBAAqB;IACrB,YAAY;IACZ,gBAAgB;IAChB,mBAAmB;IACnB,gBAAgB;IAChB,cAAc;IACd,SAAS;I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,mBAAmB;KACnB,SAAS;KACT,iBAAiB;KACjB,oBAAoB;KACpB,wBAAwB;KACxB,mBAAmB;KACnB,SAAS;KACT,sBAAsB;KACtB,0BAA0B;KAC1B,SAAS,IAAI,cAAc,CAAC,CAAC;IAC/B;IACA,EAAgB,CAAY;GAC9B,OACE,QAAQ,KACN,oFACF;EAEJ;CAmDA;AACF"}
|
|
1
|
+
{"version":3,"file":"ReactQueryMockUtils.js","names":[],"sources":["../../src/testutils/ReactQueryMockUtils.ts"],"sourcesContent":["import type { InfiniteData } from '@tanstack/query-core'\nimport {\n QueryObserverLoadingResult,\n QueryObserverSuccessResult,\n UseInfiniteQueryResult,\n UseMutationResult,\n UseQueryResult,\n} from '@tanstack/react-query'\nimport type { Mock } from '@vitest/spy'\nimport { Dispatch, SetStateAction, useState } from 'react'\n\n/**\n * Returns a mock instance for useQuery, as well as functions to manipulate the mock hook's state, and\n * mocks for function(s) returned by the hook.\n *\n * Example usage:\n * ```tsx\n * const { mock, setSuccess } = getUseQueryMock<MyDataType, MyErrorType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n *\n * // ...optionally verify a loading state in your component/hook\n *\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseQueryMock<TData = unknown, TError = unknown>(): {\n mock: Mock<() => UseQueryResult<TData, TError>>\n mockRefetch: Mock\n setSuccess: (data: TData) => void\n setError: (error: TError) => void\n setLoading: () => void\n setIdle: () => void\n} {\n // Stable mock functions\n const mockRefetch = vi.fn()\n\n let currentSetValue: Dispatch<\n SetStateAction<UseQueryResult<TData, TError>>\n > | null = null\n\n const setSuccess = (data: TData) => {\n if (currentSetValue) {\n const successState: UseQueryResult<TData, TError> = {\n data: data,\n status: 'success',\n isSuccess: true,\n isPending: false,\n isLoading: false,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n refetch: mockRefetch,\n isPlaceholderData: false,\n isStale: false,\n promise: Promise.resolve(data),\n }\n\n currentSetValue(successState)\n } else {\n console.warn(\n 'setSuccess called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: 0,\n error: error,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: true,\n isFetched: false,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoadingError: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'error',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isLoading: false,\n isPending: false,\n promise: new Promise(() => {}),\n }\n\n currentSetValue(errorState)\n } else {\n console.warn(\n 'setError called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const setLoading = () => {\n if (currentSetValue) {\n const loadingState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: true,\n isLoading: true,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n failureReason: null,\n fetchStatus: 'fetching',\n isPending: true,\n isInitialLoading: true,\n isPaused: false,\n promise: new Promise(() => {}),\n }\n\n currentSetValue(loadingState)\n } else {\n console.warn(\n 'setError called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n function setIdle() {\n if (currentSetValue) {\n const idleState: UseQueryResult<TData, TError> = {\n data: undefined,\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: true,\n isLoading: false,\n isPending: true,\n promise: new Promise(() => {}),\n }\n currentSetValue(idleState)\n } else {\n console.warn(\n 'setIdle called before mock query was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useQueryMocked() {\n const [value, setValue] = useState<UseQueryResult<TData, TError>>({\n data: undefined,\n fetchStatus: 'fetching',\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isInitialLoading: false,\n isLoading: true,\n isLoadingError: false,\n isPaused: false,\n isPending: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n promise: new Promise(() => {}),\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockRefetch: mockRefetch,\n setSuccess,\n setError,\n setLoading,\n setIdle,\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQuerySuccessMock<TData>(\n data: TData,\n): QueryObserverSuccessResult<TData, never> {\n return {\n data: data,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoading: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: true,\n refetch: vi.fn(),\n status: 'success',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isPending: false,\n promise: Promise.resolve(data),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryLoadingMock(): QueryObserverLoadingResult<\n never,\n never\n> {\n return {\n data: undefined,\n dataUpdatedAt: Date.now(),\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n isError: false,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: true,\n isLoading: true,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'pending',\n failureReason: null,\n fetchStatus: 'fetching',\n isPending: true,\n isInitialLoading: true,\n isPaused: false,\n promise: new Promise(() => {}),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryErrorMock<TError>(\n error: TError,\n): UseQueryResult<never, TError> {\n return {\n data: undefined,\n dataUpdatedAt: 0,\n error: error,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: true,\n isFetched: false,\n isFetchedAfterMount: true,\n isFetching: false,\n isLoadingError: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'error',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: false,\n isLoading: false,\n isPending: false,\n promise: new Promise<never>(() => {}),\n }\n}\n\n/**\n * @deprecated Use {@link getUseQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseQueryIdleMock(): UseQueryResult<never, never> {\n return {\n data: undefined,\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 1,\n errorUpdatedAt: Date.now(),\n failureCount: 1,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isLoadingError: false,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: vi.fn(),\n status: 'pending',\n failureReason: null,\n fetchStatus: 'idle',\n isInitialLoading: false,\n isPaused: true,\n isLoading: false,\n isPending: true,\n promise: new Promise(() => {}),\n }\n}\n\n/**\n * Returns a mock instance for useMutation, as well as functions to manipulate the mock hook's state, and\n * mocks for function(s) returned by the hook.\n *\n * Example usage:\n * ```tsx\n * const { mock, setPending, setSuccess, mockMutate } = getUseMutationMockImpl<MyDataType, MyErrorType, MyVarsType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n *\n * // ...trigger the mutation using your component/hook interface, then\n * expect(mockMutate).toHaveBeenCalledWith(expectedVars);\n * act(() => { setPending(); })\n *\n * // ...verify the pending state in your component/hook, then resolve the mutation\n *\n *\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseMutationMock<\n TData = unknown,\n TError = unknown,\n TVariables = unknown,\n>(): {\n mock: Mock<() => UseMutationResult<TData, TError, TVariables>>\n mockMutate: Mock<(vars: TVariables) => void>\n mockMutateAsync: Mock<(vars: TVariables) => Promise<TData>>\n mockReset: Mock\n setSuccess: (data: TData) => void\n setError: (error: TError) => void\n setPending: () => void\n setIdle: () => void\n} {\n let currentSetValue: Dispatch<\n SetStateAction<UseMutationResult<TData, TError, TVariables>>\n > | null = null\n\n function setVars(vars: TVariables) {\n if (currentSetValue) {\n currentSetValue(\n prevState =>\n ({\n ...prevState,\n variables: vars,\n }) as UseMutationResult<TData, TError, TVariables>,\n )\n } else {\n console.warn(\n 'mutate or mutateAsync called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n // Stable mock functions\n const mockMutate = vi.fn()\n const mockMutateAsync = vi.fn()\n const mockReset = vi.fn()\n const variables = (mockMutate.mock.lastCall?.[0] ??\n mockMutateAsync.mock.lastCall?.[0]) as TVariables | undefined\n\n function mutate(vars: TVariables): void {\n setVars(vars)\n mockMutate(vars)\n }\n\n function mutateAsync(vars: TVariables): Promise<TData> {\n setVars(vars)\n return mockMutateAsync(vars) as Promise<TData>\n }\n\n const setSuccess = (data: TData) => {\n if (currentSetValue) {\n const successState: UseMutationResult<TData, TError, TVariables> = {\n data: data,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: true,\n status: 'success',\n variables: variables!,\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n }\n\n currentSetValue(\n prev =>\n ({ ...successState, variables: prev.variables }) as UseMutationResult<\n TData,\n TError,\n TVariables\n >,\n )\n } else {\n console.warn(\n 'setSuccess called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseMutationResult<TData, TError, TVariables> = {\n error: error,\n data: undefined,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n failureCount: 1,\n isError: true,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n status: 'error',\n variables: variables!,\n failureReason: error,\n isPending: false,\n submittedAt: 0,\n }\n\n currentSetValue(\n prev =>\n ({ ...errorState, variables: prev.variables }) as UseMutationResult<\n TData,\n TError,\n TVariables\n >,\n )\n } else {\n console.warn(\n 'setError called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const setPending = () => {\n if (currentSetValue) {\n const pendingState: UseMutationResult<TData, TError, TVariables> = {\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n status: 'pending',\n failureReason: null,\n isPending: true,\n submittedAt: 0,\n variables: variables!,\n }\n\n currentSetValue(\n prev =>\n ({ ...pendingState, variables: prev.variables }) as UseMutationResult<\n TData,\n TError,\n TVariables\n >,\n )\n } else {\n console.warn(\n 'setPending called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n function setIdle() {\n if (currentSetValue) {\n const idleState: UseMutationResult<TData, TError, TVariables> = {\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n variables: undefined,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n status: 'idle',\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n }\n currentSetValue(idleState)\n } else {\n console.warn(\n 'setIdle called before mock mutation was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useMutationMocked() {\n const [value, setValue] = useState<\n UseMutationResult<TData, TError, TVariables>\n >({\n data: undefined,\n error: null,\n mutate,\n mutateAsync,\n reset: mockReset,\n variables: undefined,\n context: undefined,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n status: 'idle',\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockMutate,\n mockMutateAsync,\n mockReset,\n setSuccess,\n setError,\n setPending,\n setIdle,\n }\n}\n\n/**\n * @deprecated Use {@link getUseMutationMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseMutationIdleMock<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n TData = any,\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n TError = any,\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n TVariables = any,\n>(data?: TData) {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: true,\n isPaused: false,\n isSuccess: false,\n mutate: vi.fn(),\n mutateAsync: vi.fn().mockResolvedValue(data),\n reset: vi.fn(),\n status: 'idle',\n variables: undefined,\n failureReason: null,\n isPending: false,\n submittedAt: 0,\n } satisfies UseMutationResult<TData, TError, TVariables>\n}\n\n/**\n * @deprecated Use {@link getUseMutationMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseMutationPendingMock<\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n TData = any,\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n TError = any,\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n TVariables = any,\n>(data?: TData, variables?: TVariables) {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isError: false,\n isIdle: false,\n isPaused: false,\n isSuccess: false,\n mutate: vi.fn(),\n mutateAsync: vi.fn().mockResolvedValue(data),\n reset: vi.fn(),\n status: 'pending',\n variables: variables!,\n failureReason: null,\n isPending: true,\n submittedAt: 0,\n } satisfies UseMutationResult<TData, TError, TVariables>\n}\n\n/**\n * @deprecated Use {@link getUseInfiniteQueryMock} instead, which provides utilities to dynamically change the state of the mock hook.\n */\nexport function getUseInfiniteQuerySuccessMock<TData>(\n pages: TData[],\n hasNextPage = false,\n): UseInfiniteQueryResult<{ pages: TData[] }, never> {\n return {\n data: {\n pages: pages,\n },\n error: null,\n isError: false,\n isPending: false,\n isLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isSuccess: true,\n status: 'success',\n fetchNextPage: vi.fn(),\n fetchPreviousPage: vi.fn(),\n hasNextPage: hasNextPage,\n hasPreviousPage: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n dataUpdatedAt: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n errorUpdateCount: 0,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isInitialLoading: false,\n isPaused: false,\n isPlaceholderData: false,\n isRefetching: false,\n isStale: false,\n refetch: vi.fn(),\n fetchStatus: 'idle',\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: Promise.resolve({ pages }),\n } satisfies UseInfiniteQueryResult<{ pages: TData[] }, never>\n}\n\n/**\n * Returns a mock instance for useInfiniteQuery, as well as functions to manipulate the mock hook's state, and\n * mock functions for fetchNextPage, fetchPreviousPage, and refetch.\n *\n * Example usage:\n * ```tsx\n * const { mock, setSuccess } = getUseInfiniteQueryMock<MyDataType, MyErrorType>();\n *\n * // Set the mock implementation\n * myMockedHook.mockImplementation(mock);\n * // Update the hook's state to success with data\n * act(() => { myMockedHook.setSuccess(myDataArray, true); });\n * ```\n */\nexport function getUseInfiniteQueryMock<TData = unknown, TError = unknown>(): {\n mock: Mock<() => UseInfiniteQueryResult<InfiniteData<TData>, TError>>\n mockFetchNextPage: Mock\n setSuccess: (\n data: TData[],\n hasNextPage?: boolean,\n isFetchingNextPage?: boolean,\n ) => void\n setError: (error: TError) => void\n setLoading: () => void\n} {\n // Stable mock functions\n const mockFetchNextPage = vi.fn()\n const mockFetchPreviousPage = vi.fn()\n const mockRefetch = vi.fn()\n\n let currentSetValue: Dispatch<\n SetStateAction<UseInfiniteQueryResult<InfiniteData<TData>, TError>>\n > | null = null\n\n const setSuccess = (\n data: TData[],\n hasNextPage = false,\n isFetchingNextPage = false,\n ) => {\n if (currentSetValue) {\n const successState: UseInfiniteQueryResult<\n InfiniteData<TData>,\n TError\n > = {\n data: { pages: data, pageParams: [] },\n hasNextPage: hasNextPage,\n status: 'success',\n isSuccess: true,\n isPending: false,\n isLoading: false,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: isFetchingNextPage ? 'fetching' : 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: isFetchingNextPage,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchPreviousPageError: false,\n isFetchNextPageError: false,\n promise: Promise.resolve({ pages: data, pageParams: [] }),\n }\n currentSetValue(successState)\n } else {\n console.warn(\n 'setSuccess called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const setError = (error: TError) => {\n if (currentSetValue) {\n const errorState: UseInfiniteQueryResult<InfiniteData<TData>, TError> = {\n data: undefined,\n hasNextPage: false,\n status: 'error',\n isSuccess: false,\n isPending: false,\n isLoading: false,\n isError: true,\n error: error,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: true,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'idle',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n }\n currentSetValue(errorState)\n } else {\n console.warn(\n 'setError called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const setLoading = () => {\n if (currentSetValue) {\n const loadingState: UseInfiniteQueryResult<\n InfiniteData<TData>,\n TError\n > = {\n data: undefined,\n hasNextPage: false,\n status: 'pending',\n isSuccess: false,\n isPending: true,\n isLoading: true,\n isError: false,\n error: null,\n isFetched: true,\n isFetchedAfterMount: true,\n isFetching: false,\n isInitialLoading: false,\n isLoadingError: false,\n isRefetchError: false,\n isRefetching: false,\n fetchStatus: 'fetching',\n isPaused: false,\n dataUpdatedAt: Date.now(),\n errorUpdatedAt: 0,\n errorUpdateCount: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n refetch: mockRefetch,\n hasPreviousPage: false,\n isFetchingNextPage: true,\n isFetchingPreviousPage: false,\n isPlaceholderData: false,\n isStale: false,\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n }\n currentSetValue(loadingState)\n } else {\n console.warn(\n 'setError called before useInfiniteQueryMock was rendered or setValue was captured.',\n )\n }\n }\n\n const mock = vi.fn(function useMockInfiniteQuery() {\n const [value, setValue] = useState<\n UseInfiniteQueryResult<InfiniteData<TData>, TError>\n >({\n data: undefined,\n fetchStatus: 'fetching',\n dataUpdatedAt: 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n failureCount: 0,\n failureReason: null,\n fetchNextPage: mockFetchNextPage,\n fetchPreviousPage: mockFetchPreviousPage,\n hasNextPage: false,\n hasPreviousPage: false,\n isError: false,\n isFetched: false,\n isFetchedAfterMount: false,\n isFetching: false,\n isFetchingNextPage: false,\n isFetchingPreviousPage: false,\n isInitialLoading: false,\n isLoading: true,\n isLoadingError: false,\n isPaused: false,\n isPending: true,\n isPlaceholderData: false,\n isRefetchError: false,\n isRefetching: false,\n isStale: false,\n isSuccess: false,\n refetch: mockRefetch,\n status: 'pending',\n isFetchNextPageError: false,\n isFetchPreviousPageError: false,\n promise: new Promise(() => {}),\n })\n\n currentSetValue = setValue\n\n return value\n })\n return {\n mock: mock,\n mockFetchNextPage: mockFetchNextPage,\n setSuccess,\n setError,\n setLoading,\n }\n}\n"],"mappings":";;AA4BA,SAAgB,IAOd;CAEA,IAAM,IAAc,GAAG,GAAG,GAEtB,IAEO,MAEL,KAAc,MAAgB;EAClC,IAAI,GAAiB;GACnB,IAAM,IAA8C;IAC5C;IACN,QAAQ;IACR,WAAW;IACX,WAAW;IACX,WAAW;IACX,SAAS;IACT,OAAO;IACP,WAAW;IACX,qBAAqB;IACrB,YAAY;IACZ,kBAAkB;IAClB,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,UAAU;IACV,eAAe,KAAK,IAAI;IACxB,gBAAgB;IAChB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,SAA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