@gen3/frontend 0.12.65 → 0.12.67

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 (148) hide show
  1. package/dist/dts/components/Content/FormContent.d.ts +2 -1
  2. package/dist/dts/components/Content/FormContent.d.ts.map +1 -1
  3. package/dist/dts/components/Content/FormContent.js +2 -2
  4. package/dist/dts/components/Content/FormContent.js.map +1 -1
  5. package/dist/dts/components/facets/EnumFacet.js +1 -2
  6. package/dist/dts/components/facets/EnumFacet.js.map +1 -1
  7. package/dist/dts/components/facets/FacetControlsHeader.d.ts.map +1 -1
  8. package/dist/dts/components/facets/FacetControlsHeader.js +2 -2
  9. package/dist/dts/components/facets/FacetControlsHeader.js.map +1 -1
  10. package/dist/dts/components/facets/FacetEnumList.d.ts.map +1 -1
  11. package/dist/dts/components/facets/FacetEnumList.js +18 -7
  12. package/dist/dts/components/facets/FacetEnumList.js.map +1 -1
  13. package/dist/dts/components/facets/components.d.ts +1 -1
  14. package/dist/dts/components/facets/components.d.ts.map +1 -1
  15. package/dist/dts/components/facets/components.js +1 -1
  16. package/dist/dts/components/facets/components.js.map +1 -1
  17. package/dist/dts/components/facets/createFacetCard.d.ts.map +1 -1
  18. package/dist/dts/components/facets/createFacetCard.js +1 -1
  19. package/dist/dts/components/facets/createFacetCard.js.map +1 -1
  20. package/dist/dts/components/facets/createFacetCard.unit.test.d.ts +2 -0
  21. package/dist/dts/components/facets/createFacetCard.unit.test.d.ts.map +1 -0
  22. package/dist/dts/components/facets/createFacetCard.unit.test.js +56 -0
  23. package/dist/dts/components/facets/createFacetCard.unit.test.js.map +1 -0
  24. package/dist/dts/components/facets/utils.d.ts.map +1 -1
  25. package/dist/dts/components/facets/utils.js +1 -0
  26. package/dist/dts/components/facets/utils.js.map +1 -1
  27. package/dist/dts/components/facets/utils.unit.test.js +40 -2
  28. package/dist/dts/components/facets/utils.unit.test.js.map +1 -1
  29. package/dist/dts/features/CohortBuilder/QueryExpression/LogicalOperatorLabel.d.ts +8 -0
  30. package/dist/dts/features/CohortBuilder/QueryExpression/LogicalOperatorLabel.d.ts.map +1 -0
  31. package/dist/dts/features/CohortBuilder/QueryExpression/LogicalOperatorLabel.js +4 -0
  32. package/dist/dts/features/CohortBuilder/QueryExpression/LogicalOperatorLabel.js.map +1 -0
  33. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts +2 -1
  34. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts.map +1 -1
  35. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js +2 -1
  36. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js.map +1 -1
  37. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts +1 -0
  38. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts.map +1 -1
  39. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js +1 -0
  40. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js.map +1 -1
  41. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.d.ts.map +1 -1
  42. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.js +4 -3
  43. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.js.map +1 -1
  44. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.unit.test.d.ts +2 -0
  45. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.unit.test.d.ts.map +1 -0
  46. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.unit.test.js +72 -0
  47. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.unit.test.js.map +1 -0
  48. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.d.ts +1 -0
  49. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.d.ts.map +1 -1
  50. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.js +39 -28
  51. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.js.map +1 -1
  52. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.unit.test.d.ts +2 -0
  53. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.unit.test.d.ts.map +1 -0
  54. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.unit.test.js +38 -0
  55. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.unit.test.js.map +1 -0
  56. package/dist/dts/features/DiscoveryForms/{StudyRegistrationAccessRequest → GenericRegistrationAccessRequest}/FormContentViews.d.ts +3 -2
  57. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/FormContentViews.d.ts.map +1 -0
  58. package/dist/dts/features/DiscoveryForms/{StudyRegistrationAccessRequest → GenericRegistrationAccessRequest}/FormContentViews.js +3 -3
  59. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/FormContentViews.js.map +1 -0
  60. package/dist/dts/features/DiscoveryForms/{StudyRegistrationAccessRequest → GenericRegistrationAccessRequest}/FormContentViews.stories.d.ts +3 -1
  61. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/FormContentViews.stories.d.ts.map +1 -0
  62. package/dist/dts/features/DiscoveryForms/{StudyRegistrationAccessRequest → GenericRegistrationAccessRequest}/FormContentViews.stories.js +1 -1
  63. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/FormContentViews.stories.js.map +1 -0
  64. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/GenericRegistrationAccessRequestOutcome.d.ts +7 -0
  65. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/GenericRegistrationAccessRequestOutcome.d.ts.map +1 -0
  66. package/dist/dts/features/DiscoveryForms/{StudyRegistrationAccessRequest/StudyRegistrationAccessRequestOutcome.js → GenericRegistrationAccessRequest/GenericRegistrationAccessRequestOutcome.js} +3 -3
  67. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/GenericRegistrationAccessRequestOutcome.js.map +1 -0
  68. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/index.d.ts +8 -0
  69. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/index.d.ts.map +1 -0
  70. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/index.js +10 -0
  71. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/index.js.map +1 -0
  72. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/types.d.ts +35 -0
  73. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/types.d.ts.map +1 -0
  74. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/types.js.map +1 -0
  75. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/useGenericRegistration.d.ts +12 -0
  76. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/useGenericRegistration.d.ts.map +1 -0
  77. package/dist/dts/features/DiscoveryForms/{StudyRegistrationAccessRequest/useStudyRegistration.js → GenericRegistrationAccessRequest/useGenericRegistration.js} +31 -44
  78. package/dist/dts/features/DiscoveryForms/GenericRegistrationAccessRequest/useGenericRegistration.js.map +1 -0
  79. package/dist/dts/features/Study/StudyDetails/StudyDetailsHeaderButtons.d.ts.map +1 -1
  80. package/dist/dts/features/Study/StudyDetails/StudyDetailsHeaderButtons.js +40 -35
  81. package/dist/dts/features/Study/StudyDetails/StudyDetailsHeaderButtons.js.map +1 -1
  82. package/dist/dts/features/Workspace/utils.js +1 -1
  83. package/dist/dts/features/Workspace/utils.js.map +1 -1
  84. package/dist/dts/pages/StudyForms/StudyRegistrationAccessRequest/data.d.ts +2 -2
  85. package/dist/dts/pages/StudyForms/StudyRegistrationAccessRequest/data.d.ts.map +1 -1
  86. package/dist/dts/pages/StudyForms/StudyRegistrationAccessRequest/data.js +3 -3
  87. package/dist/dts/pages/StudyForms/StudyRegistrationAccessRequest/data.js.map +1 -1
  88. package/dist/dts/pages/StudyForms/StudyRegistrationAccessRequest/index.d.ts +6 -6
  89. package/dist/dts/pages/StudyForms/StudyRegistrationAccessRequest/index.d.ts.map +1 -1
  90. package/dist/dts/pages/StudyForms/StudyRegistrationAccessRequest/index.js +5 -5
  91. package/dist/dts/pages/StudyForms/StudyRegistrationAccessRequest/index.js.map +1 -1
  92. package/dist/dts/pages/StudyForms/VLMDSubmissionAccessRequest/data.d.ts +4 -0
  93. package/dist/dts/pages/StudyForms/VLMDSubmissionAccessRequest/data.d.ts.map +1 -0
  94. package/dist/dts/pages/StudyForms/VLMDSubmissionAccessRequest/data.js +32 -0
  95. package/dist/dts/pages/StudyForms/VLMDSubmissionAccessRequest/data.js.map +1 -0
  96. package/dist/dts/pages/StudyForms/VLMDSubmissionAccessRequest/index.d.ts +9 -0
  97. package/dist/dts/pages/StudyForms/VLMDSubmissionAccessRequest/index.d.ts.map +1 -0
  98. package/dist/dts/pages/StudyForms/VLMDSubmissionAccessRequest/index.js +12 -0
  99. package/dist/dts/pages/StudyForms/VLMDSubmissionAccessRequest/index.js.map +1 -0
  100. package/dist/index/cjs/{QueryPanel-DNGXxrpC.js → QueryPanel-aGaJfxNv.js} +2 -2
  101. package/dist/index/cjs/{QueryPanel-DNGXxrpC.js.map → QueryPanel-aGaJfxNv.js.map} +1 -1
  102. package/dist/index/cjs/{index-7sUtTikC.js → index-Br1lKHDn.js} +199 -99
  103. package/dist/index/cjs/index-Br1lKHDn.js.map +1 -0
  104. package/dist/index/cjs/index.js +1 -1
  105. package/dist/index/esm/{QueryPanel-C3JVntIb.js → QueryPanel-C0nNrzSx.js} +2 -2
  106. package/dist/index/esm/{QueryPanel-C3JVntIb.js.map → QueryPanel-C0nNrzSx.js.map} +1 -1
  107. package/dist/index/esm/{index-B_0ks9Pi.js → index-CDgLCUE3.js} +201 -101
  108. package/dist/index/esm/index-CDgLCUE3.js.map +1 -0
  109. package/dist/index/esm/index.js +1 -1
  110. package/dist/index.d.ts +4 -1
  111. package/dist/pages/cjs/{CohortBuilder-DircXqXL.js → CohortBuilder-rF69uCsJ.js} +2 -2
  112. package/dist/pages/cjs/{CohortBuilder-DircXqXL.js.map → CohortBuilder-rF69uCsJ.js.map} +1 -1
  113. package/dist/pages/cjs/{QueryPanel-qYWbo2Cb.js → QueryPanel-JOL_9n8f.js} +2 -2
  114. package/dist/pages/cjs/{QueryPanel-qYWbo2Cb.js.map → QueryPanel-JOL_9n8f.js.map} +1 -1
  115. package/dist/pages/cjs/{index-BQzYPjdE.js → index-Dbd5m3GQ.js} +200 -100
  116. package/dist/pages/cjs/index-Dbd5m3GQ.js.map +1 -0
  117. package/dist/pages/cjs/index.js +1 -1
  118. package/dist/pages/esm/{CohortBuilder-CI9PAFLd.js → CohortBuilder-D3EM-FLr.js} +2 -2
  119. package/dist/pages/esm/{CohortBuilder-CI9PAFLd.js.map → CohortBuilder-D3EM-FLr.js.map} +1 -1
  120. package/dist/pages/esm/{QueryPanel-BEqldpr5.js → QueryPanel-0Znj4lFa.js} +2 -2
  121. package/dist/pages/esm/{QueryPanel-BEqldpr5.js.map → QueryPanel-0Znj4lFa.js.map} +1 -1
  122. package/dist/pages/esm/{index-BoZwM5wd.js → index-CxrByAhv.js} +202 -102
  123. package/dist/pages/esm/index-CxrByAhv.js.map +1 -0
  124. package/dist/pages/esm/index.js +1 -1
  125. package/dist/pages.d.ts +1 -0
  126. package/package.json +4 -3
  127. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/FormContentViews.d.ts.map +0 -1
  128. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/FormContentViews.js.map +0 -1
  129. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/FormContentViews.stories.d.ts.map +0 -1
  130. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/FormContentViews.stories.js.map +0 -1
  131. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/StudyRegistrationAccessRequestOutcome.d.ts +0 -7
  132. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/StudyRegistrationAccessRequestOutcome.d.ts.map +0 -1
  133. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/StudyRegistrationAccessRequestOutcome.js.map +0 -1
  134. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/index.d.ts +0 -7
  135. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/index.d.ts.map +0 -1
  136. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/index.js +0 -11
  137. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/index.js.map +0 -1
  138. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/types.d.ts +0 -20
  139. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/types.d.ts.map +0 -1
  140. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/types.js.map +0 -1
  141. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/useStudyRegistration.d.ts +0 -11
  142. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/useStudyRegistration.d.ts.map +0 -1
  143. package/dist/dts/features/DiscoveryForms/StudyRegistrationAccessRequest/useStudyRegistration.js.map +0 -1
  144. package/dist/index/cjs/index-7sUtTikC.js.map +0 -1
  145. package/dist/index/esm/index-B_0ks9Pi.js.map +0 -1
  146. package/dist/pages/cjs/index-BQzYPjdE.js.map +0 -1
  147. package/dist/pages/esm/index-BoZwM5wd.js.map +0 -1
  148. /package/dist/dts/features/DiscoveryForms/{StudyRegistrationAccessRequest → GenericRegistrationAccessRequest}/types.js +0 -0
@@ -1868,7 +1868,7 @@ function hashCode(str) {
1868
1868
  * @param {string} props.keyString - For mantine form to identify elements
1869
1869
  * @param {FormContentProps['form']} props.form - @mantine/form useForm() object
1870
1870
  * @returns {JSX.Element} A JSX element that renders the content dynamically based on the input type and properties.
1871
- */ const FormContent = ({ text, label, initialValue, dropdownData, description, placeholder, disabled, required, tooltip, className = '', type = ContentType.Text, keyString, form })=>{
1871
+ */ const FormContent = ({ text, label, initialValue, dropdownData, description, placeholder, disabled, required, tooltip, className = '', autosize = false, type = ContentType.Text, keyString, form })=>{
1872
1872
  //code for tooltips on form items
1873
1873
  let inputContainer;
1874
1874
  if (tooltip) {
@@ -1994,7 +1994,8 @@ function hashCode(str) {
1994
1994
  disabled: disabled || form.submitting,
1995
1995
  required: required,
1996
1996
  inputContainer: inputContainer,
1997
- ...form.getInputProps(keyString)
1997
+ ...form.getInputProps(keyString),
1998
+ autosize: autosize
1998
1999
  }, form.key(keyString));
1999
2000
  }
2000
2001
  default:
@@ -8594,6 +8595,7 @@ const OverflowTooltippedLabel = ({ children, label, className = 'flex-grow font-
8594
8595
 
8595
8596
  const QueryExpressionContext = /*#__PURE__*/ React__namespace.default.createContext({
8596
8597
  displayOnly: false,
8598
+ showLogicalOperators: false,
8597
8599
  fieldsAreFlat: true,
8598
8600
  cohortId: null,
8599
8601
  cohortName: 'default',
@@ -8654,6 +8656,12 @@ const QueryExpressionsExpandedContext = /*#__PURE__*/ React__namespace.default.c
8654
8656
  ()=>null
8655
8657
  ]);
8656
8658
 
8659
+ const LogicalOperatorLabel = ({ operator, className = '' })=>/*#__PURE__*/ jsxRuntime.jsx("span", {
8660
+ className: `flex items-center justify-center px-1 text-xs font-bold uppercase text-base-darkest ${className}`,
8661
+ "data-testid": `query-logical-operator-${operator}`,
8662
+ children: operator
8663
+ });
8664
+
8657
8665
  const RemoveButton$1 = ({ value })=>/*#__PURE__*/ jsxRuntime.jsx(core.ActionIcon, {
8658
8666
  size: "xs",
8659
8667
  color: "base.0",
@@ -8715,9 +8723,23 @@ const isRangeOperation = (x)=>{
8715
8723
  const isNestedFilter = (x)=>{
8716
8724
  return 'path' in x;
8717
8725
  };
8718
- const IncludeExcludeQueryElement = ({ index, field, path, operator, operands, displayOnly = false })=>{
8726
+ const buildSetOperation = (field, operator, operands, combineMode)=>combineMode === 'and' ? {
8727
+ operator: 'and',
8728
+ operands: operands.map((value)=>({
8729
+ operator,
8730
+ field,
8731
+ operands: [
8732
+ value
8733
+ ]
8734
+ }))
8735
+ } : {
8736
+ operator,
8737
+ field,
8738
+ operands
8739
+ };
8740
+ const IncludeExcludeQueryElement = ({ index, field, path, operator, operands, displayOnly = false, combineMode = 'or' })=>{
8719
8741
  const [queryExpressionsExpanded, setQueryExpressionsExpanded] = React.useContext(QueryExpressionsExpandedContext);
8720
- const { cohortId: currentCohortId, useRemoveFilter, useUpdateFilters, shouldShowSummary, fieldsAreFlat } = React.useContext(QueryExpressionContext);
8742
+ const { cohortId: currentCohortId, useRemoveFilter, useUpdateFilters, shouldShowSummary, fieldsAreFlat, showLogicalOperators } = React.useContext(QueryExpressionContext);
8721
8743
  const removeCohortFilter = useRemoveFilter();
8722
8744
  const updateCohortFilter = useUpdateFilters();
8723
8745
  useDeepCompare.useDeepCompareEffect(()=>{
@@ -8808,45 +8830,45 @@ const IncludeExcludeQueryElement = ({ index, field, path, operator, operands, di
8808
8830
  gap: "xs",
8809
8831
  children: operandsArray.map((x, i)=>{
8810
8832
  const value = x.toString();
8811
- return /*#__PURE__*/ jsxRuntime.jsx(core.Badge, {
8812
- "data-testid": `query-rep-${field}-${value}-${i}`,
8813
- variant: "filled",
8814
- color: "accent.5",
8815
- size: "md",
8816
- className: `normal-case items-center max-w-[162px] cursor-pointer hover:bg-accent-darker pl-2 ${displayOnly ? 'pr-3' : 'pr-0'}`,
8817
- rightSection: !displayOnly && /*#__PURE__*/ jsxRuntime.jsx(RemoveButton$1, {
8818
- value: value
8819
- }),
8820
- onClick: ()=>{
8821
- if (displayOnly) return;
8822
- const newOperands = operandsArray.filter((o)=>o !== x);
8823
- if (currentCohortId && newOperands.length === 0) {
8824
- setQueryExpressionsExpanded({
8825
- type: 'clear',
8826
- cohortId: currentCohortId,
8827
- field: fieldToUpdate
8828
- });
8829
- removeCohortFilter(index, fieldToUpdate);
8830
- } else {
8831
- updateCohortFilter(index, fieldToUpdate, fieldsAreFlat ? {
8832
- operator: operator,
8833
- field: field,
8834
- operands: newOperands
8835
- } : core$1.buildNestedFilterForOperation(fieldToUpdate, {
8836
- operator: operator,
8837
- field: field,
8838
- operands: newOperands
8839
- }));
8840
- }
8841
- },
8842
- children: /*#__PURE__*/ jsxRuntime.jsx(OverflowTooltippedLabel, {
8843
- label: value,
8844
- className: "flex-grow text-md font-content",
8845
- children: /*#__PURE__*/ jsxRuntime.jsx(QueryRepresentationLabel, {
8846
- value: value.toString(),
8847
- field: field
8833
+ return /*#__PURE__*/ jsxRuntime.jsxs(React__namespace.default.Fragment, {
8834
+ children: [
8835
+ showLogicalOperators && i > 0 && /*#__PURE__*/ jsxRuntime.jsx(LogicalOperatorLabel, {
8836
+ operator: combineMode
8837
+ }),
8838
+ /*#__PURE__*/ jsxRuntime.jsx(core.Badge, {
8839
+ "data-testid": `query-rep-${field}-${value}-${i}`,
8840
+ variant: "filled",
8841
+ color: "accent.5",
8842
+ size: "md",
8843
+ className: `normal-case items-center max-w-[162px] cursor-pointer hover:bg-accent-darker pl-2 ${displayOnly ? 'pr-3' : 'pr-0'}`,
8844
+ rightSection: !displayOnly && /*#__PURE__*/ jsxRuntime.jsx(RemoveButton$1, {
8845
+ value: value
8846
+ }),
8847
+ onClick: ()=>{
8848
+ if (displayOnly) return;
8849
+ const newOperands = operandsArray.filter((o)=>o !== x);
8850
+ if (currentCohortId && newOperands.length === 0) {
8851
+ setQueryExpressionsExpanded({
8852
+ type: 'clear',
8853
+ cohortId: currentCohortId,
8854
+ field: fieldToUpdate
8855
+ });
8856
+ removeCohortFilter(index, fieldToUpdate);
8857
+ } else {
8858
+ const updatedOperation = buildSetOperation(field, operator, newOperands, combineMode);
8859
+ updateCohortFilter(index, fieldToUpdate, fieldsAreFlat ? updatedOperation : core$1.buildNestedFilterForOperation(fieldToUpdate, updatedOperation));
8860
+ }
8861
+ },
8862
+ children: /*#__PURE__*/ jsxRuntime.jsx(OverflowTooltippedLabel, {
8863
+ label: value,
8864
+ className: "flex-grow text-md font-content",
8865
+ children: /*#__PURE__*/ jsxRuntime.jsx(QueryRepresentationLabel, {
8866
+ value: value.toString(),
8867
+ field: field
8868
+ })
8869
+ })
8848
8870
  })
8849
- })
8871
+ ]
8850
8872
  }, `query-rep-${field}-${value}-${i}`);
8851
8873
  })
8852
8874
  })
@@ -9094,6 +9116,25 @@ const QueryElement = ({ index, field, path, children, displayOnly = false })=>{
9094
9116
  upper: f.operands[1]
9095
9117
  }, f.operands[0].field);
9096
9118
  }
9119
+ const enumOperands = f.operands.filter(core$1.isIncludes);
9120
+ const field = enumOperands[0]?.field;
9121
+ if (enumOperands.length === f.operands.length && field && enumOperands.every((operand)=>operand.field === field)) {
9122
+ return /*#__PURE__*/ jsxRuntime.jsx(QueryElement, {
9123
+ field: field,
9124
+ index: this.index,
9125
+ path: this.path,
9126
+ displayOnly: this.displayOnly,
9127
+ children: /*#__PURE__*/ jsxRuntime.jsx(IncludeExcludeQueryElement, {
9128
+ field: field,
9129
+ operator: enumOperands[0].operator,
9130
+ operands: enumOperands.flatMap((operand)=>operand.operands),
9131
+ combineMode: "and",
9132
+ index: this.index,
9133
+ path: this.path,
9134
+ displayOnly: this.displayOnly
9135
+ })
9136
+ }, field);
9137
+ }
9097
9138
  // TODO: handle deeper nesting
9098
9139
  return null;
9099
9140
  };
@@ -9410,7 +9451,7 @@ const QueryExpressionSection = ({ index, showImportExport = false, displayOnly =
9410
9451
  const [filtersSectionCollapsed, setFiltersSectionCollapsed] = React.useState(true);
9411
9452
  const filtersRef = React.useRef(null);
9412
9453
  const [QESectionHeight, setQESectionHeight] = React.useState(0);
9413
- const { cohortName, cohortId, useClearCohortFilters, useGetFilters } = React.useContext(QueryExpressionContext);
9454
+ const { cohortName, cohortId, showLogicalOperators, useClearCohortFilters, useGetFilters } = React.useContext(QueryExpressionContext);
9414
9455
  const clearCohortFilters = useClearCohortFilters();
9415
9456
  const filters = useGetFilters(index);
9416
9457
  useDeepCompare.useDeepCompareEffect(()=>{
@@ -9551,8 +9592,16 @@ const QueryExpressionSection = ({ index, showImportExport = false, displayOnly =
9551
9592
  "data-testid": "text-no-active-cohort-filter",
9552
9593
  className: "flex items-center font-content h-10",
9553
9594
  children: "No filters currently applied."
9554
- }) : Object.keys(filters.root).map((k)=>{
9555
- return convertFilterToComponent(filters.root[k], index, '.', displayOnly);
9595
+ }) : Object.keys(filters.root).map((k, indexInFilters)=>{
9596
+ return /*#__PURE__*/ jsxRuntime.jsxs(React__namespace.default.Fragment, {
9597
+ children: [
9598
+ showLogicalOperators && indexInFilters > 0 && /*#__PURE__*/ jsxRuntime.jsx(LogicalOperatorLabel, {
9599
+ operator: filters.mode,
9600
+ className: "mr-1 mb-2"
9601
+ }),
9602
+ convertFilterToComponent(filters.root[k], index, '.', displayOnly)
9603
+ ]
9604
+ }, k);
9556
9605
  })
9557
9606
  })
9558
9607
  ]
@@ -9599,7 +9648,7 @@ const SUMMARY_THRESHOLD = 10;
9599
9648
  */ const DefaultShouldShowSummary = (field, count)=>{
9600
9649
  return count > SUMMARY_THRESHOLD;
9601
9650
  };
9602
- const QueryExpression = ({ index, shouldShowSummary = DefaultShouldShowSummary, hooks, fieldsAreFlat = true })=>{
9651
+ const QueryExpression = ({ index, shouldShowSummary = DefaultShouldShowSummary, hooks, fieldsAreFlat = true, showLogicalOperators = false })=>{
9603
9652
  const currentCohortId = core$1.useCoreSelector((state)=>core$1.selectCurrentCohortId(state));
9604
9653
  const currentCohortName = core$1.useCoreSelector((state)=>core$1.selectCurrentCohortName(state));
9605
9654
  return /*#__PURE__*/ jsxRuntime.jsx(QueryExpressionContext.Provider, {
@@ -9607,6 +9656,7 @@ const QueryExpression = ({ index, shouldShowSummary = DefaultShouldShowSummary,
9607
9656
  cohortName: currentCohortName,
9608
9657
  cohortId: currentCohortId,
9609
9658
  displayOnly: false,
9659
+ showLogicalOperators,
9610
9660
  fieldsAreFlat: fieldsAreFlat,
9611
9661
  shouldShowSummary: shouldShowSummary,
9612
9662
  useClearCohortFilters: ()=>{
@@ -9902,6 +9952,7 @@ const classifyFacets = (data, index, fieldMapping = [], facetDefinitionsFromConf
9902
9952
  moveValuesToBottom: facetDef?.moveValuesToBottom,
9903
9953
  excludeValues: facetDef?.excludeValues,
9904
9954
  defaultSort: facetDef?.defaultSort,
9955
+ showMatchModeSelector: facetDef?.showMatchModeSelector,
9905
9956
  valueLabel: facetDef?.valueLabel,
9906
9957
  range: facetDef?.range ? {
9907
9958
  minimum: facetDef.range?.minimum ?? Math.floor(Number(value[0].key[0])),
@@ -11164,7 +11215,7 @@ inline-flex
11164
11215
  items-center
11165
11216
  hover:text-primary-lightest
11166
11217
  `;
11167
- const controlsIconStyle = 'text-secondary-contrast hover:text-secondary-lighter';
11218
+ const controlsIconStyle = 'text-secondary-contrast hover:text-secondary-contrast-lighter';
11168
11219
  const FacetText = tw__default.default.div`
11169
11220
  text-secondary-contrast font-heading font-semibold text-sm break-words
11170
11221
  `;
@@ -11287,12 +11338,11 @@ flex items-start justify-between items-center flex-nowrap bg-secondary px-1.5 ro
11287
11338
  if (toggleExpandFilter) toggleExpandFilter(field, true);
11288
11339
  if (toggleSettings) toggleSettings();
11289
11340
  },
11290
- "aria-label": "Search",
11341
+ "aria-label": "Filter settings",
11291
11342
  className: header.iconStyle,
11292
- children: /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
11293
- width: 12,
11294
- height: 12,
11295
- icon: "gen3:settings",
11343
+ children: /*#__PURE__*/ jsxRuntime.jsx(md.MdSettings, {
11344
+ size: "1.35em",
11345
+ className: header.iconStyle,
11296
11346
  "aria-hidden": "true"
11297
11347
  })
11298
11348
  })
@@ -12613,8 +12663,8 @@ const FacetEnumList = ({ field, facetName, hooks, valueLabel, isSettings = false
12613
12663
  const searchInputRef = React.useRef(null);
12614
12664
  const settingRef = React.useRef(null);
12615
12665
  const [searchTerm, setSearchTerm] = React.useState('');
12616
- // const [combineMode, setCombineMode] = useState<'or' | 'and'>('or');
12617
12666
  const { data, enumFilters, combineMode, isSuccess, error } = hooks.useGetFacetData(field);
12667
+ const [selectedCombineMode, setSelectedCombineMode] = React.useState(combineMode ?? 'or');
12618
12668
  const [selectedEnums, setSelectedEnums] = React.useState(enumFilters ?? []);
12619
12669
  const totalCount = hooks?.useTotalCounts ? hooks.useTotalCounts() : 1;
12620
12670
  const clearFilters = hooks.useClearFilter();
@@ -12648,6 +12698,17 @@ const FacetEnumList = ({ field, facetName, hooks, valueLabel, isSettings = false
12648
12698
  }, [
12649
12699
  enumFilters
12650
12700
  ]);
12701
+ React.useEffect(()=>{
12702
+ // Existing filters are the source of truth when loading or externally
12703
+ // updating a cohort. Keep a user's selected mode when the facet is empty
12704
+ // so they can choose "Match all" before selecting values.
12705
+ if ((enumFilters?.length ?? 0) > 0) {
12706
+ setSelectedCombineMode(combineMode ?? 'or');
12707
+ }
12708
+ }, [
12709
+ combineMode,
12710
+ enumFilters
12711
+ ]);
12651
12712
  const maxValuesToDisplay = DEFAULT_VISIBLE_ITEMS$1;
12652
12713
  // update filters when checkbox is selected
12653
12714
  const handleChange = (value, checked)=>{
@@ -12662,13 +12723,15 @@ const FacetEnumList = ({ field, facetName, hooks, valueLabel, isSettings = false
12662
12723
  ] : [
12663
12724
  value
12664
12725
  ];
12665
- updateFacetEnum(field, updated, updateFacetFilters, clearFilters, combineMode);
12726
+ updateFacetEnum(field, updated, updateFacetFilters, clearFilters, selectedCombineMode);
12666
12727
  } else {
12667
12728
  const updated = selectedEnums?.filter((x)=>x !== value);
12668
- updateFacetEnum(field, updated ?? [], updateFacetFilters, clearFilters, combineMode);
12729
+ updateFacetEnum(field, updated ?? [], updateFacetFilters, clearFilters, selectedCombineMode);
12669
12730
  }
12670
12731
  };
12671
12732
  const handleCombineModeChange = (mode)=>{
12733
+ setSelectedCombineMode(mode);
12734
+ if ((selectedEnums?.length ?? 0) === 0) return;
12672
12735
  updateFacetEnum(field, selectedEnums ?? [], updateFacetFilters, clearFilters, mode);
12673
12736
  };
12674
12737
  const [facetChartData, setFacetChartData] = React.useState({
@@ -12803,23 +12866,24 @@ const FacetEnumList = ({ field, facetName, hooks, valueLabel, isSettings = false
12803
12866
  indicator: 'bg-accent text-accent-contrast'
12804
12867
  },
12805
12868
  ref: settingRef,
12806
- value: combineMode,
12869
+ value: selectedCombineMode,
12870
+ "aria-label": "How selected facet values are matched",
12807
12871
  onChange: (value)=>{
12808
12872
  handleCombineModeChange(value);
12809
12873
  },
12810
12874
  data: [
12811
12875
  {
12812
- label: 'AND',
12813
- value: 'and'
12876
+ label: 'Match any',
12877
+ value: 'or'
12814
12878
  },
12815
12879
  {
12816
- label: 'OR',
12817
- value: 'or'
12880
+ label: 'Match all',
12881
+ value: 'and'
12818
12882
  }
12819
12883
  ]
12820
12884
  }),
12821
12885
  /*#__PURE__*/ jsxRuntime.jsx(core.Tooltip, {
12822
- label: "Combine filters with AND or OR 2",
12886
+ label: "Match any includes cases with at least one selected value. Match all requires every selected value.",
12823
12887
  children: /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
12824
12888
  icon: "gen3:info",
12825
12889
  height: 12,
@@ -13655,6 +13719,7 @@ const createFacetCard = ({ facetDefinition, valueLabel, hooks: dataFunctions, fa
13655
13719
  width: width,
13656
13720
  hooks: dataFunctions,
13657
13721
  showPercent: showPercent,
13722
+ showSettings: facetDefinition?.showMatchModeSelector,
13658
13723
  sharedWithIndices: facetDefinition?.sharedWithIndices,
13659
13724
  defaultSort: facetDefinition?.defaultSort,
13660
13725
  moveValuesToBottom: facetDefinition?.moveValuesToBottom ?? [],
@@ -16460,17 +16525,11 @@ const SinglePageStudyDetailsPanel = ({ data, studyConfig, authorization })=>{
16460
16525
  });
16461
16526
  };
16462
16527
 
16463
- const userCanRegisterStudy = (userInfo, studyRegistrationAuthZ)=>{
16464
- const actions = userInfo?.authz && studyRegistrationAuthZ ? userInfo.authz[studyRegistrationAuthZ] : undefined;
16465
- const method = 'access';
16466
- const service = 'study_registration';
16467
- return actions?.some((x)=>(x.service === service || x.service === '*') && (x.method === method || x.method === '*')) ?? false;
16468
- };
16469
-
16470
16528
  const StudyDetailsHeaderButtons = ({ onClose, permalink })=>{
16471
16529
  const userInfo = core$1.useCoreSelector((state)=>core$1.selectUserDetails(state));
16472
16530
  const requiresLogin = !userInfo.active;
16473
16531
  const { discoveryConfig: config } = useDiscoveryContext();
16532
+ const router$1 = router.useRouter();
16474
16533
  const index = config.minimalFieldMapping.uid;
16475
16534
  const { studyDetails } = useStudyContext();
16476
16535
  const studyUID = _.toString(studyDetails[index]);
@@ -16478,44 +16537,55 @@ const StudyDetailsHeaderButtons = ({ onClose, permalink })=>{
16478
16537
  const studyRegistrationAuthZ = studyDetails.registration_authz;
16479
16538
  const studyProjectNumber = studyDetails.project_number;
16480
16539
  const showSubmitButton = config.detailView.showSubmitButton;
16481
- const router$1 = router.useRouter();
16482
- const isStudyRegisterable = userCanRegisterStudy(userInfo, studyRegistrationAuthZ);
16483
- const handleRegisterButtonClick = ()=>{
16540
+ const userAuthMapping = core$1.useCoreSelector((state)=>core$1.selectAuthzMappingData(state));
16541
+ const userHasStudyRegistrationAccess = core$1.userHasMethodForServiceOnResource('access', 'study_registration', _.toString(studyRegistrationAuthZ), userAuthMapping);
16542
+ const isStudyRegistered = studyDetails.is_registered;
16543
+ // Study is not yet registered — show register/request-access/login button
16544
+ const showStudyRegistrationButton = showSubmitButton && isStudyRegistered === false;
16545
+ // Study is registered — show appropriate VLMD submission button based on auth state
16546
+ const showSubmitVLMDButton = showSubmitButton && isStudyRegistered && !requiresLogin && userHasStudyRegistrationAccess;
16547
+ const showRequestVLMDAccessButton = showSubmitButton && isStudyRegistered && !requiresLogin && !userHasStudyRegistrationAccess;
16548
+ const showLoginToSubmitVLMDButton = showSubmitButton && isStudyRegistered && requiresLogin;
16549
+ const studyNavQuery = {
16550
+ studyUID,
16551
+ studyName,
16552
+ studyRegistrationAuthZ: _.toString(studyRegistrationAuthZ),
16553
+ studyProjectNumber
16554
+ };
16555
+ const handleStudyRegistrationClick = ()=>{
16484
16556
  if (requiresLogin) {
16485
16557
  void router$1.push('/Login');
16486
- } else if (isStudyRegisterable) {
16558
+ } else if (userHasStudyRegistrationAccess) {
16487
16559
  void router$1.push({
16488
16560
  pathname: '/study-reg',
16489
- query: {
16490
- studyUID: studyUID,
16491
- studyName: studyName,
16492
- studyRegistrationAuthZ: studyRegistrationAuthZ,
16493
- studyProjectNumber: studyProjectNumber
16494
- }
16561
+ query: studyNavQuery
16495
16562
  }, '/study-reg');
16496
16563
  } else {
16497
16564
  void router$1.push({
16498
16565
  pathname: '/study-reg/request-access',
16499
- query: {
16500
- studyUID: studyUID,
16501
- studyName: studyName,
16502
- studyRegistrationAuthZ: studyRegistrationAuthZ,
16503
- studyProjectNumber: studyProjectNumber
16504
- }
16566
+ query: studyNavQuery
16505
16567
  }, '/study-reg/request-access');
16506
16568
  }
16507
16569
  };
16508
- const submitButtonText = React.useMemo(()=>{
16509
- if (requiresLogin) {
16510
- return 'Login to Register This Study';
16511
- } else if (isStudyRegisterable) {
16512
- return 'Register Study';
16513
- } else {
16514
- return `Request Access to Register this Study`;
16515
- }
16570
+ const handleSubmitVLMDClick = ()=>{
16571
+ void router$1.push({
16572
+ pathname: '/vlmd-submission',
16573
+ query: studyNavQuery
16574
+ }, '/vlmd-submission');
16575
+ };
16576
+ const handleRequestVLMDAccessClick = ()=>{
16577
+ void router$1.push({
16578
+ pathname: '/vlmd-submission/request-access',
16579
+ query: studyNavQuery
16580
+ }, '/vlmd-submission/request-access');
16581
+ };
16582
+ const studyRegistrationButtonText = React.useMemo(()=>{
16583
+ if (requiresLogin) return 'Login to Register This Study';
16584
+ if (userHasStudyRegistrationAccess) return 'Register This Study';
16585
+ return 'Request Access to Register This Study';
16516
16586
  }, [
16517
16587
  requiresLogin,
16518
- isStudyRegisterable
16588
+ userHasStudyRegistrationAccess
16519
16589
  ]);
16520
16590
  return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
16521
16591
  children: [
@@ -16525,15 +16595,45 @@ const StudyDetailsHeaderButtons = ({ onClose, permalink })=>{
16525
16595
  variant: "outline",
16526
16596
  children: "Back"
16527
16597
  }),
16528
- showSubmitButton && /*#__PURE__*/ jsxRuntime.jsx(core.Button, {
16598
+ showStudyRegistrationButton && /*#__PURE__*/ jsxRuntime.jsx(core.Button, {
16529
16599
  leftSection: /*#__PURE__*/ jsxRuntime.jsx(fi.FiLogIn, {
16530
16600
  size: 14
16531
16601
  }),
16532
16602
  variant: "subtle",
16533
16603
  color: "black",
16534
16604
  size: "xs",
16535
- onClick: handleRegisterButtonClick,
16536
- children: submitButtonText
16605
+ onClick: handleStudyRegistrationClick,
16606
+ children: studyRegistrationButtonText
16607
+ }),
16608
+ showSubmitVLMDButton && /*#__PURE__*/ jsxRuntime.jsx(core.Button, {
16609
+ leftSection: /*#__PURE__*/ jsxRuntime.jsx(fi.FiLogIn, {
16610
+ size: 14
16611
+ }),
16612
+ variant: "subtle",
16613
+ color: "black",
16614
+ size: "xs",
16615
+ onClick: handleSubmitVLMDClick,
16616
+ children: "Submit Variable-level Metadata"
16617
+ }),
16618
+ showRequestVLMDAccessButton && /*#__PURE__*/ jsxRuntime.jsx(core.Button, {
16619
+ leftSection: /*#__PURE__*/ jsxRuntime.jsx(fi.FiLogIn, {
16620
+ size: 14
16621
+ }),
16622
+ variant: "subtle",
16623
+ color: "black",
16624
+ size: "xs",
16625
+ onClick: handleRequestVLMDAccessClick,
16626
+ children: "Request Access to Submit Variable-level Metadata"
16627
+ }),
16628
+ showLoginToSubmitVLMDButton && /*#__PURE__*/ jsxRuntime.jsx(core.Button, {
16629
+ leftSection: /*#__PURE__*/ jsxRuntime.jsx(fi.FiLogIn, {
16630
+ size: 14
16631
+ }),
16632
+ variant: "subtle",
16633
+ color: "black",
16634
+ size: "xs",
16635
+ onClick: ()=>void router$1.push('/Login'),
16636
+ children: "Login to Submit Variable-level Metadata"
16537
16637
  }),
16538
16638
  /*#__PURE__*/ jsxRuntime.jsx(core.CopyButton, {
16539
16639
  value: permalink,
@@ -24346,7 +24446,7 @@ const DiscoveryPageGetServerSideProps = async ()=>{
24346
24446
  }
24347
24447
  };
24348
24448
 
24349
- const QueryPanel = dynamic__default.default(()=>Promise.resolve().then(function () { return require('./QueryPanel-qYWbo2Cb.js'); }), {
24449
+ const QueryPanel = dynamic__default.default(()=>Promise.resolve().then(function () { return require('./QueryPanel-JOL_9n8f.js'); }), {
24350
24450
  ssr: false
24351
24451
  });
24352
24452
  const QueryPage = ({ headerProps, footerProps, configuration: queryProps })=>{
@@ -24580,7 +24680,7 @@ const getActiveTab = (router)=>{
24580
24680
  else if (typeof activeTab === 'object') return activeTab[0];
24581
24681
  return undefined;
24582
24682
  };
24583
- const CohortBuilder = dynamic__default.default(()=>Promise.resolve().then(function () { return require('./CohortBuilder-DircXqXL.js'); }), {
24683
+ const CohortBuilder = dynamic__default.default(()=>Promise.resolve().then(function () { return require('./CohortBuilder-rF69uCsJ.js'); }), {
24584
24684
  ssr: false
24585
24685
  });
24586
24686
  const ExplorerPage = ({ headerProps, footerProps, explorerConfig, headerMetadata, tabsLayout, sharedFiltersMap })=>{
@@ -27038,7 +27138,7 @@ const ExternalLoginsStatus = ()=>{
27038
27138
  };
27039
27139
 
27040
27140
  const PaymentNumberToString = (x, undefinedValue = 'N/A', precision = 2)=>{
27041
- if (!x || Number.isNaN(x)) return undefinedValue;
27141
+ if (typeof x !== 'number' || Number.isNaN(x)) return undefinedValue;
27042
27142
  return x.toFixed(precision);
27043
27143
  };
27044
27144
 
@@ -32496,4 +32596,4 @@ exports.useGetFacetFilters = useGetFacetFilters;
32496
32596
  exports.useSetCohortFilterCombineState = useSetCohortFilterCombineState;
32497
32597
  exports.useToggleExpandFilter = useToggleExpandFilter;
32498
32598
  exports.useUpdateFilters = useUpdateFilters;
32499
- //# sourceMappingURL=index-BQzYPjdE.js.map
32599
+ //# sourceMappingURL=index-Dbd5m3GQ.js.map