synapse-react-client 4.0.24 → 4.0.26

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.
Files changed (119) hide show
  1. package/dist/SWC.index.d.ts +1 -0
  2. package/dist/SWC.index.d.ts.map +1 -1
  3. package/dist/SWC.index.js +2 -1
  4. package/dist/SWC.index.js.map +1 -1
  5. package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
  6. package/dist/components/AclEditor/useUpdateAcl.js.map +1 -1
  7. package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
  8. package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
  9. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
  10. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  11. package/dist/components/Breadcrumbs/Breadcrumbs.js +43 -30
  12. package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  13. package/dist/components/CannedRejectionDialog/CannedRejectionDialog.js.map +1 -1
  14. package/dist/components/ChallengeSubmission/SubmissionDirectoryList.js.map +1 -1
  15. package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts +7 -1
  16. package/dist/components/CopyToClipboardString/CopyToClipboardString.d.ts.map +1 -1
  17. package/dist/components/CopyToClipboardString/CopyToClipboardString.js +22 -16
  18. package/dist/components/CopyToClipboardString/CopyToClipboardString.js.map +1 -1
  19. package/dist/components/DataExplorer/DataExplorer.css +1 -1
  20. package/dist/components/DataExplorer/DataExplorer.d.ts +16 -2
  21. package/dist/components/DataExplorer/DataExplorer.d.ts.map +1 -1
  22. package/dist/components/DataExplorer/DataExplorer.js +82 -75
  23. package/dist/components/DataExplorer/DataExplorer.js.map +1 -1
  24. package/dist/components/DataExplorer/DataExplorer.module.js +16 -16
  25. package/dist/components/DataExplorer/DataExplorer.module.js.map +1 -1
  26. package/dist/components/DataExplorer/DataExplorer.module.scss +1 -1
  27. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
  28. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +14 -1
  29. package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
  30. package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
  31. package/dist/components/DataGrid/utils/columnFactory.js +15 -19
  32. package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
  33. package/dist/components/EntityFinder/tree/EntityTree.js.map +1 -1
  34. package/dist/components/EntityFinder/tree/VirtualizedTree.js.map +1 -1
  35. package/dist/components/EntityIcon.d.ts +1 -0
  36. package/dist/components/EntityIcon.d.ts.map +1 -1
  37. package/dist/components/EntityIcon.js +37 -36
  38. package/dist/components/EntityIcon.js.map +1 -1
  39. package/dist/components/EntitySidebar/EntitySidebar.css +1 -0
  40. package/dist/components/EntitySidebar/EntitySidebar.d.ts +7 -0
  41. package/dist/components/EntitySidebar/EntitySidebar.d.ts.map +1 -0
  42. package/dist/components/EntitySidebar/EntitySidebar.js +62 -0
  43. package/dist/components/EntitySidebar/EntitySidebar.js.map +1 -0
  44. package/dist/components/EntitySidebar/EntitySidebar.module.js +17 -0
  45. package/dist/components/EntitySidebar/EntitySidebar.module.js.map +1 -0
  46. package/dist/components/EntitySidebar/EntitySidebar.module.scss +87 -0
  47. package/dist/components/Evaluation/EvaluationRoundEditorList.js.map +1 -1
  48. package/dist/components/GenericCard/BioregistryRules.js.map +1 -1
  49. package/dist/components/GenericCard/TableRowGenericCard.d.ts +2 -1
  50. package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
  51. package/dist/components/GenericCard/TableRowGenericCard.js +3 -2
  52. package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
  53. package/dist/components/HeaderCard.d.ts.map +1 -1
  54. package/dist/components/HeaderCard.js +4 -0
  55. package/dist/components/HeaderCard.js.map +1 -1
  56. package/dist/components/HexGrid/HexGrid.d.ts +2 -1
  57. package/dist/components/HexGrid/HexGrid.d.ts.map +1 -1
  58. package/dist/components/HexGrid/HexGrid.js +13 -13
  59. package/dist/components/HexGrid/HexGrid.js.map +1 -1
  60. package/dist/components/IconSvg/IconSvg.d.ts +2 -1
  61. package/dist/components/IconSvg/IconSvg.d.ts.map +1 -1
  62. package/dist/components/IconSvg/IconSvg.js +112 -89
  63. package/dist/components/IconSvg/IconSvg.js.map +1 -1
  64. package/dist/components/Plot/UpsetPlot.js.map +1 -1
  65. package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts +3 -0
  66. package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
  67. package/dist/components/ProvenanceGraph/ProvenanceGraph.js +140 -85
  68. package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
  69. package/dist/components/SchemaDrivenAnnotationEditor/field/AdditionalPropertiesSchemaField.js.map +1 -1
  70. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
  71. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +3 -3
  72. package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
  73. package/dist/components/StorybookComponentWrapper.js.map +1 -1
  74. package/dist/components/SynapseHomepageV2/HotdropsAndNews.css +1 -1
  75. package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js +9 -8
  76. package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js.map +1 -1
  77. package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.scss +4 -1
  78. package/dist/components/SynapseHomepageV2/WordPressNews.d.ts +2 -1
  79. package/dist/components/SynapseHomepageV2/WordPressNews.d.ts.map +1 -1
  80. package/dist/components/SynapseHomepageV2/WordPressNews.js +8 -7
  81. package/dist/components/SynapseHomepageV2/WordPressNews.js.map +1 -1
  82. package/dist/components/SynapseHomepageV2/WordPressNewsItem.d.ts +5 -1
  83. package/dist/components/SynapseHomepageV2/WordPressNewsItem.d.ts.map +1 -1
  84. package/dist/components/SynapseHomepageV2/WordPressNewsItem.js +19 -11
  85. package/dist/components/SynapseHomepageV2/WordPressNewsItem.js.map +1 -1
  86. package/dist/components/SynapseTable/TablePagination.js.map +1 -1
  87. package/dist/components/SynapseTable/datasets/DatasetItemsEditor.js.map +1 -1
  88. package/dist/components/TableColumnSchemaEditor/TableColumnSchemaForm.js.map +1 -1
  89. package/dist/components/TanStackTable/StyledTanStackTable.js.map +1 -1
  90. package/dist/components/WordPress/useWordPressPosts.js +1 -1
  91. package/dist/components/WordPress/useWordPressPosts.js.map +1 -1
  92. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts +1 -8
  93. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.d.ts.map +1 -1
  94. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js +17 -12
  95. package/dist/components/entity/page/breadcrumbs/EntityPageBreadcrumbs.js.map +1 -1
  96. package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
  97. package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +20 -16
  98. package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
  99. package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts +0 -1
  100. package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts.map +1 -1
  101. package/dist/components/entity/page/title_bar/TitleBarProperties.js +17 -82
  102. package/dist/components/entity/page/title_bar/TitleBarProperties.js.map +1 -1
  103. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.d.ts.map +1 -1
  104. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js +3 -4
  105. package/dist/components/entity/page/title_bar/useGetEntityTitleBarProperties.js.map +1 -1
  106. package/dist/components/menu/ComplexMenu.d.ts.map +1 -1
  107. package/dist/components/menu/ComplexMenu.js +5 -3
  108. package/dist/components/menu/ComplexMenu.js.map +1 -1
  109. package/dist/style/components/_data-grid-extra.css +1 -1
  110. package/dist/style/components/_data-grid-extra.scss +0 -6
  111. package/dist/testutils/ReactQueryMockUtils.js.map +1 -1
  112. package/dist/tsconfig.build.tsbuildinfo +1 -1
  113. package/dist/types/ThemeTypes.d.ts +2 -2
  114. package/dist/utils/functions/IsEqualTreatUndefinedAsMissing.js.map +1 -1
  115. package/dist/utils/hooks/useDebouncedEffect.js.map +1 -1
  116. package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
  117. package/dist/utils/hooks/useImmutableTableQuery/useImmutableTableQuery.js.map +1 -1
  118. package/dist/utils/hooks/useLogin.js.map +1 -1
  119. package/package.json +6 -6
@@ -1,89 +1,24 @@
1
- import e from "../../../../synapse-queries/entity/useEntityBundle.js";
2
- import { useGetFeatureFlag as t } from "../../../../synapse-queries/featureflags/useGetFeatureFlag.js";
3
- import "../../../../synapse-queries/index.js";
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 p(e) {
12
- let { title: t, value: n } = e;
13
- return /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("td", {
14
- style: { paddingRight: "1em" },
15
- children: /* @__PURE__ */ d(u, {
16
- component: "span",
17
- variant: "smallText1",
18
- sx: { fontWeight: 700 },
19
- children: t
20
- })
21
- }), /* @__PURE__ */ d("td", { children: /* @__PURE__ */ d(u, {
22
- component: "span",
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 { m as default };
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 { useGetEntityBundle, useGetFeatureFlag } from '@/synapse-queries'\nimport { Box, Divider, Link, Stack, Typography } from '@mui/material'\nimport { FeatureFlagEnum } from '@/utils/featureflag/FeatureFlags'\nimport { ReactNode, useState } from 'react'\nimport AddConditionsForUseButton from '../../../AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton'\nimport { useGetEntityTitleBarProperties } from './useGetEntityTitleBarProperties'\n\nexport type TitleBarPropertiesProps = {\n entityId: string\n versionNumber?: number\n /* Callback invoked when an ACT member clicks \"Add Conditions for Use\". */\n onActMemberClickAddConditionsForUse: () => void\n}\n\ntype PropertyProps = {\n title: string\n value: ReactNode\n}\nfunction Property(props: PropertyProps) {\n const { title, value } = props\n return (\n <tr>\n <td style={{ paddingRight: '1em' }}>\n <Typography\n component={'span'}\n variant={'smallText1'}\n sx={{\n fontWeight: 700,\n }}\n >\n {title}\n </Typography>\n </td>\n <td>\n <Typography component={'span'} variant={'smallText1'}>\n {value}\n </Typography>\n </td>\n </tr>\n )\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, versionNumber, onActMemberClickAddConditionsForUse } = props\n\n // We don't need the entire bundle, but it's fetched for the rest of the title bar and useGetEntityTitleBarProperties below, so the cache will be hot.\n const { data: bundle } = useGetEntityBundle(entityId, versionNumber)\n\n const isFeatureEnabled = useGetFeatureFlag(FeatureFlagEnum.DESCRIPTION_FIELD)\n\n // Actual entity data is fetched and transformed in this custom hook\n const properties = useGetEntityTitleBarProperties(entityId, versionNumber)\n\n const [showAllProperties, setShowAllProperties] = useState(false)\n\n return (\n <Box sx={{ padding: '20px 40px' }}>\n <Stack\n direction={'row'}\n sx={{\n justifyContent: 'space-between',\n alignItems: 'flex-start',\n }}\n >\n <Stack\n direction=\"row\"\n divider={<Divider orientation=\"vertical\" flexItem />}\n spacing={2}\n sx={{\n alignItems: 'flex-start',\n }}\n >\n {/* Always show the first 4 properties*/}\n <table>\n <tbody>\n {properties.slice(0, 2).map(p => {\n return <Property key={p.key} title={p.title} value={p.value} />\n })}\n </tbody>\n </table>\n {properties.length > 2 && (\n <table>\n <tbody>\n {properties.slice(2, 4).map(p => {\n return (\n <Property key={p.key} title={p.title} value={p.value} />\n )\n })}\n </tbody>\n </table>\n )}\n {/* If there are 5 or 6 properties, show them in the last column */}\n {(properties.length === 5 || properties.length === 6) && (\n <table>\n <tbody>\n {properties.slice(4, 6).map(p => {\n return (\n <Property key={p.key} title={p.title} value={p.value} />\n )\n })}\n </tbody>\n </table>\n )}\n {/* If there are more than 6 properties, then just show a button that toggles showing the rest */}\n {properties.length > 6 && (\n <Link onClick={() => setShowAllProperties(v => !v)}>\n {showAllProperties\n ? 'Hide properties'\n : `${properties.length - 4} more properties`}\n </Link>\n )}\n </Stack>\n <AddConditionsForUseButton\n entityId={entityId}\n onACTMemberClick={onActMemberClickAddConditionsForUse}\n />\n </Stack>\n {showAllProperties && (\n <Box sx={{ pt: '20px' }}>\n <table>\n <tbody>\n {/* Show the remaining properties. */}\n {properties.slice(4, Infinity).map(p => {\n return <Property key={p.key} title={p.title} value={p.value} />\n })}\n </tbody>\n </table>\n </Box>\n )}\n {bundle?.entity?.description && isFeatureEnabled && (\n <Box sx={{ marginTop: '10px', maxWidth: '720px' }}>\n {bundle?.entity?.description}\n </Box>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAS,EAAS,GAAsB;CACtC,IAAM,EAAE,UAAO,aAAU;CACzB,OACE,kBAAC,MAAD,EAAA,UAAA,CACE,kBAAC,MAAD;EAAI,OAAO,EAAE,cAAc,MAAM;YAC/B,kBAAC,GAAD;GACE,WAAW;GACX,SAAS;GACT,IAAI,EACF,YAAY,IACd;aAEC;EACS,CAAA;CACV,CAAA,GACJ,kBAAC,MAAD,EAAA,UACE,kBAAC,GAAD;EAAY,WAAW;EAAQ,SAAS;YACrC;CACS,CAAA,EACV,CAAA,CACF,EAAA,CAAA;AAER;AAKA,SAAwB,EAAmB,GAAgC;CACzE,IAAM,EAAE,aAAU,kBAAe,2CAAwC,GAGnE,EAAE,MAAM,MAAW,EAAmB,GAAU,CAAa,GAE7D,IAAmB,EAAkB,EAAgB,iBAAiB,GAGtE,IAAa,EAA+B,GAAU,CAAa,GAEnE,CAAC,GAAmB,KAAwB,EAAS,EAAK;CAEhE,OACE,kBAAC,GAAD;EAAK,IAAI,EAAE,SAAS,YAAY;YAAhC;GACE,kBAAC,GAAD;IACE,WAAW;IACX,IAAI;KACF,gBAAgB;KAChB,YAAY;IACd;cALF,CAOE,kBAAC,GAAD;KACE,WAAU;KACV,SAAS,kBAAC,GAAD;MAAS,aAAY;MAAW,UAAA;KAAU,CAAA;KACnD,SAAS;KACT,IAAI,EACF,YAAY,aACd;eANF;MASE,kBAAC,SAAD,EAAA,UACE,kBAAC,SAAD,EAAA,UACG,EAAW,MAAM,GAAG,CAAC,EAAE,KAAI,MACnB,kBAAC,GAAD;OAAsB,OAAO,EAAE;OAAO,OAAO,EAAE;MAAQ,GAAxC,EAAE,GAAsC,CAC/D,EACI,CAAA,EACF,CAAA;MACN,EAAW,SAAS,KACnB,kBAAC,SAAD,EAAA,UACE,kBAAC,SAAD,EAAA,UACG,EAAW,MAAM,GAAG,CAAC,EAAE,KAAI,MAExB,kBAAC,GAAD;OAAsB,OAAO,EAAE;OAAO,OAAO,EAAE;MAAQ,GAAxC,EAAE,GAAsC,CAE1D,EACI,CAAA,EACF,CAAA;OAGP,EAAW,WAAW,KAAK,EAAW,WAAW,MACjD,kBAAC,SAAD,EAAA,UACE,kBAAC,SAAD,EAAA,UACG,EAAW,MAAM,GAAG,CAAC,EAAE,KAAI,MAExB,kBAAC,GAAD;OAAsB,OAAO,EAAE;OAAO,OAAO,EAAE;MAAQ,GAAxC,EAAE,GAAsC,CAE1D,EACI,CAAA,EACF,CAAA;MAGR,EAAW,SAAS,KACnB,kBAAC,GAAD;OAAM,eAAe,GAAqB,MAAK,CAAC,CAAC;iBAC9C,IACG,oBACA,GAAG,EAAW,SAAS,EAAE;MACzB,CAAA;KAEH;QACP,kBAAC,GAAD;KACY;KACV,kBAAkB;IACnB,CAAA,CACI;;GACN,KACC,kBAAC,GAAD;IAAK,IAAI,EAAE,IAAI,OAAO;cACpB,kBAAC,SAAD,EAAA,UACE,kBAAC,SAAD,EAAA,UAEG,EAAW,MAAM,GAAG,QAAQ,EAAE,KAAI,MAC1B,kBAAC,GAAD;KAAsB,OAAO,EAAE;KAAO,OAAO,EAAE;IAAQ,GAAxC,EAAE,GAAsC,CAC/D,EACI,CAAA,EACF,CAAA;GACJ,CAAA;GAEN,GAAQ,QAAQ,eAAe,KAC9B,kBAAC,GAAD;IAAK,IAAI;KAAE,WAAW;KAAQ,UAAU;IAAQ;cAC7C,GAAQ,QAAQ;GACd,CAAA;EAEJ;;AAET"}
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,CAuLlB"}
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(m, {
57
+ value: /* @__PURE__ */ g(d, {
58
+ value: W,
58
59
  href: W,
59
- rel: "noopener noreferrer",
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: (\n <Link href={doi} rel={'noopener noreferrer'} target={'_blank'}>\n {doi}\n </Link>\n ),\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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;EAEN;EACA,KAAc;GACZ,KAAK;GACL,OAAO;GACP,OACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;IAAM,eAAe,EAAsB,EAAI;cAC5C,EAAS,OAAO,eAAe;GAC5B,CAAA,GACN,kBAAC,GAAD;IACE,MAAM;IACN,eAAe,EAAsB,EAAK;IAC1C,WAAW;IACX,OAAM;GACP,CAAA,CACD,EAAA,CAAA;EAEN;EACA,KAAO;GACL,KAAK;GACL,OAAO;GACP,OAAO,kBAAC,GAAD,EAAuB,OAAO,EAAM,CAAA;EAC7C;EACA,CAAC,KACC,KAAmB;GACjB,KAAK;GACL,OAAO;GACP,OAAO;EACT;EACF,KACE,KAA2B;GACzB,KAAK;GACL,OAAO;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
+ {"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,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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,2CAyGlD"}
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
- [e.breakpoints.down("sm")]: {
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("sm")]: {
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("sm")]: {
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('sm')]: {\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('sm')]: {\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('sm')]: {\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;IACJ,EAAM,YAAY,KAAK,IAAI,IAAI;IAC9B,eAAe;IACf,YAAY;GACd;EACF;YATF,CAWG,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
+ {"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
- .dsg-input{font-size:inherit;color:#353a3f}.dsg-cell-disabled input{color:#71767f}.row-deleted .dsg-cell,.row-deleted .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff1f0}.row-created .dsg-cell,.row-created .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#f6ffed}.row-updated .dsg-cell,.row-updated .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff7e6}.row-valid .dsg-cell-gutter,.row-valid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.row-invalid .dsg-cell-gutter,.row-invalid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.row-unknown .dsg-cell-gutter{background:#fdfeeb}.row-unknown .dsg-cell-gutter:after{content:"";z-index:1;border:2px solid #e6c200;border-top-color:#0000;border-radius:50%;width:16px;height:16px;margin:-8px 0 0 -8px;animation:1s linear infinite spin;display:block;position:absolute;top:50%;left:50%}.row-unknown .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.cell-invalid,.dsg-cell.cell-invalid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.dsg-cell.cell-valid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.dsg-cell.cell-unknown,.dsg-cell.cell-unknown.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.dsg-cell-sticky-left:not(.cell-invalid):not(.cell-valid):not(.cell-unknown):not(.dsg-cell-header):not(.dsg-cell-gutter){background:var(--dsg-cell-background-color,white)}@keyframes spin{to{transform:rotate(360deg)}}.dsg-cell-header:not(.dsg-cell-gutter){color:#000;background-color:#dbdde1;font-weight:700}.dsg-cell-header.header-upsert-key{color:#fff;background-color:#395979;font-weight:700}.multi-value-cell{min-height:40px}.multi-value-cell-large{min-height:80px}.dsg-expand-rows-rect{z-index:50;background:#4580e614;box-shadow:inset 0 0 0 1px #4580e6}.dsg-expand-rows-indicator{z-index:1001;overflow:visible}.dsg-expand-rows-indicator:before{content:"";cursor:crosshair;position:absolute;inset:-4px}.cell-selected{border:1px solid #1976d2}.dsg-container:not(:focus-within) .cell-selected{z-index:25;background-color:#1976d20d;border:1px solid #1976d2}.dsg-container{position:relative}.column-resize-handle{cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:100;background-color:#0000;width:8px;transition:background-color .15s;position:absolute}.column-resize-handle:before{content:"";background:0 0;border-left:1px solid #0000;border-right:1px solid #0000;width:4px;height:16px;transition:border-color .15s;position:absolute;top:8px;left:50%;transform:translate(-50%)}.column-resize-handle:hover{background-color:#80808026}.column-resize-handle:hover:before{border-left-color:#80808080;border-right-color:#80808080}.column-resize-handle.is-resizing{background-color:#8080804d}.column-resize-handle.is-resizing:before{border-left-color:#646464cc;border-right-color:#646464cc}body.col-resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}body.col-resizing .dsg-container,body.col-resizing .dsg-container *{cursor:col-resize}.dsg-cell.cell-changed--self:after{content:"";z-index:20;pointer-events:none;border-top:0 solid #0000;border-bottom:7px solid #0000;border-left:0 solid #0000;border-right:7px solid #52c41a;width:0;height:0;position:absolute;top:0;right:0}.dsg-cell.cell-changed--other-user:after{content:"";z-index:20;pointer-events:none;border-top:0 solid #0000;border-bottom:7px solid #0000;border-left:0 solid #0000;border-right:7px solid #1677ff;width:0;height:0;position:absolute;top:0;right:0}.dsg-cell.cell-remote-selected--color-0{box-shadow:inset 0 0 0 1px #1677ff66;background-color:#1677ff1f!important}.dsg-cell.cell-remote-selected--color-1{box-shadow:inset 0 0 0 1px #52c41a66;background-color:#52c41a1f!important}.dsg-cell.cell-remote-selected--color-2{box-shadow:inset 0 0 0 1px #fa8c1666;background-color:#fa8c161f!important}.dsg-cell.cell-remote-selected--color-3{box-shadow:inset 0 0 0 1px #eb2f9666;background-color:#eb2f961f!important}.dsg-cell.cell-remote-selected--color-4{box-shadow:inset 0 0 0 1px #13c2c266;background-color:#13c2c21f!important}.dsg-cell.cell-remote-selected--color-5{box-shadow:inset 0 0 0 1px #9254de66;background-color:#9254de1f!important}.dsg-cell.cell-remote-selected--color-6{box-shadow:inset 0 0 0 1px #f5222d66;background-color:#f5222d1f!important}.dsg-cell.cell-remote-selected--color-7{box-shadow:inset 0 0 0 1px #faad1466;background-color:#faad141f!important}
1
+ .dsg-input{font-size:inherit;color:#353a3f}.dsg-cell-disabled input{color:#71767f}.row-deleted .dsg-cell,.row-deleted .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff1f0}.row-created .dsg-cell,.row-created .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#f6ffed}.row-updated .dsg-cell,.row-updated .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff7e6}.row-valid .dsg-cell-gutter,.row-valid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.row-invalid .dsg-cell-gutter,.row-invalid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.row-unknown .dsg-cell-gutter{background:#fdfeeb}.row-unknown .dsg-cell-gutter:after{content:"";z-index:1;border:2px solid #e6c200;border-top-color:#0000;border-radius:50%;width:16px;height:16px;margin:-8px 0 0 -8px;animation:1s linear infinite spin;display:block;position:absolute;top:50%;left:50%}.row-unknown .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.cell-invalid,.dsg-cell.cell-invalid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.dsg-cell.cell-valid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.dsg-cell.cell-unknown,.dsg-cell.cell-unknown.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.dsg-cell-sticky-left:not(.cell-invalid):not(.cell-valid):not(.cell-unknown):not(.dsg-cell-header):not(.dsg-cell-gutter){background:var(--dsg-cell-background-color,white)}@keyframes spin{to{transform:rotate(360deg)}}.dsg-cell-header:not(.dsg-cell-gutter){color:#000;background-color:#dbdde1;font-weight:700}.multi-value-cell{min-height:40px}.multi-value-cell-large{min-height:80px}.dsg-expand-rows-rect{z-index:50;background:#4580e614;box-shadow:inset 0 0 0 1px #4580e6}.dsg-expand-rows-indicator{z-index:1001;overflow:visible}.dsg-expand-rows-indicator:before{content:"";cursor:crosshair;position:absolute;inset:-4px}.cell-selected{border:1px solid #1976d2}.dsg-container:not(:focus-within) .cell-selected{z-index:25;background-color:#1976d20d;border:1px solid #1976d2}.dsg-container{position:relative}.column-resize-handle{cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:100;background-color:#0000;width:8px;transition:background-color .15s;position:absolute}.column-resize-handle:before{content:"";background:0 0;border-left:1px solid #0000;border-right:1px solid #0000;width:4px;height:16px;transition:border-color .15s;position:absolute;top:8px;left:50%;transform:translate(-50%)}.column-resize-handle:hover{background-color:#80808026}.column-resize-handle:hover:before{border-left-color:#80808080;border-right-color:#80808080}.column-resize-handle.is-resizing{background-color:#8080804d}.column-resize-handle.is-resizing:before{border-left-color:#646464cc;border-right-color:#646464cc}body.col-resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}body.col-resizing .dsg-container,body.col-resizing .dsg-container *{cursor:col-resize}.dsg-cell.cell-changed--self:after{content:"";z-index:20;pointer-events:none;border-top:0 solid #0000;border-bottom:7px solid #0000;border-left:0 solid #0000;border-right:7px solid #52c41a;width:0;height:0;position:absolute;top:0;right:0}.dsg-cell.cell-changed--other-user:after{content:"";z-index:20;pointer-events:none;border-top:0 solid #0000;border-bottom:7px solid #0000;border-left:0 solid #0000;border-right:7px solid #1677ff;width:0;height:0;position:absolute;top:0;right:0}.dsg-cell.cell-remote-selected--color-0{box-shadow:inset 0 0 0 1px #1677ff66;background-color:#1677ff1f!important}.dsg-cell.cell-remote-selected--color-1{box-shadow:inset 0 0 0 1px #52c41a66;background-color:#52c41a1f!important}.dsg-cell.cell-remote-selected--color-2{box-shadow:inset 0 0 0 1px #fa8c1666;background-color:#fa8c161f!important}.dsg-cell.cell-remote-selected--color-3{box-shadow:inset 0 0 0 1px #eb2f9666;background-color:#eb2f961f!important}.dsg-cell.cell-remote-selected--color-4{box-shadow:inset 0 0 0 1px #13c2c266;background-color:#13c2c21f!important}.dsg-cell.cell-remote-selected--color-5{box-shadow:inset 0 0 0 1px #9254de66;background-color:#9254de1f!important}.dsg-cell.cell-remote-selected--color-6{box-shadow:inset 0 0 0 1px #f5222d66;background-color:#f5222d1f!important}.dsg-cell.cell-remote-selected--color-7{box-shadow:inset 0 0 0 1px #faad1466;background-color:#faad141f!important}
@@ -160,12 +160,6 @@ $remote-selection-colors:
160
160
  color: black;
161
161
  }
162
162
 
163
- .dsg-cell-header.header-upsert-key {
164
- background-color: #395979;
165
- color: white;
166
- font-weight: bold;
167
- }
168
-
169
163
  .multi-value-cell {
170
164
  min-height: 40px;
171
165
  }
@@ -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,SAA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,kBAhGuB;GACvB,IAAI,GAAiB;IACnB,IAAM,IAGF;KACF,MAAM,KAAA;KACN,aAAa;KACb,QAAQ;KACR,WAAW;KACX,WAAW;KACX,WAAW;KACX,SAAS;KACT,OAAO;KACP,WAAW;KACX,qBAAqB;KACrB,YAAY;KACZ,kBAAkB;KAClB,gBAAgB;KAChB,gBAAgB;KAChB,cAAc;KACd,aAAa;KACb,UAAU;KACV,eAAe,KAAK,IAAI;KACxB,gBAAgB;KAChB,kBAAkB;KAClB,cAAc;KACd,eAAe;KACf,eAAe;KACf,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,GAE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