synapse-react-client 4.0.25 → 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.
- package/dist/SWC.index.js +1 -1
- package/dist/components/DataExplorer/DataExplorer.css +1 -1
- package/dist/components/DataExplorer/DataExplorer.d.ts +16 -2
- package/dist/components/DataExplorer/DataExplorer.d.ts.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.js +82 -75
- package/dist/components/DataExplorer/DataExplorer.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.js +16 -16
- package/dist/components/DataExplorer/DataExplorer.module.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.scss +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js +14 -1
- package/dist/components/DataGrid/components/ColumnHeaderWithTooltip.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +15 -19
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts +2 -1
- package/dist/components/GenericCard/TableRowGenericCard.d.ts.map +1 -1
- package/dist/components/GenericCard/TableRowGenericCard.js +3 -2
- package/dist/components/GenericCard/TableRowGenericCard.js.map +1 -1
- package/dist/components/HeaderCard.d.ts.map +1 -1
- package/dist/components/HeaderCard.js +4 -0
- package/dist/components/HeaderCard.js.map +1 -1
- package/dist/components/HexGrid/HexGrid.d.ts +2 -1
- package/dist/components/HexGrid/HexGrid.d.ts.map +1 -1
- package/dist/components/HexGrid/HexGrid.js +13 -13
- package/dist/components/HexGrid/HexGrid.js.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts +3 -0
- package/dist/components/ProvenanceGraph/ProvenanceGraph.d.ts.map +1 -1
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js +140 -85
- package/dist/components/ProvenanceGraph/ProvenanceGraph.js.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.d.ts.map +1 -1
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js +3 -3
- package/dist/components/SearchQueryWrapper/SearchQueryUseQueryOptions.js.map +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.css +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js +9 -8
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.js.map +1 -1
- package/dist/components/SynapseHomepageV2/HotdropsAndNews.module.scss +4 -1
- package/dist/components/SynapseHomepageV2/WordPressNews.d.ts +2 -1
- package/dist/components/SynapseHomepageV2/WordPressNews.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/WordPressNews.js +8 -7
- package/dist/components/SynapseHomepageV2/WordPressNews.js.map +1 -1
- package/dist/components/SynapseHomepageV2/WordPressNewsItem.d.ts +5 -1
- package/dist/components/SynapseHomepageV2/WordPressNewsItem.d.ts.map +1 -1
- package/dist/components/SynapseHomepageV2/WordPressNewsItem.js +19 -11
- package/dist/components/SynapseHomepageV2/WordPressNewsItem.js.map +1 -1
- package/dist/components/WordPress/useWordPressPosts.js +1 -1
- package/dist/components/WordPress/useWordPressPosts.js.map +1 -1
- package/dist/style/components/_data-grid-extra.css +1 -1
- package/dist/style/components/_data-grid-extra.scss +0 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnFactory.js","names":["dateTimeColumn","EnumeratedValue","FlatTypeInfo","SchemaPropertyInfo","CellComponent","CellProps","Column","createTextColumn","floatColumn","keyColumn","autocompleteColumn","autocompleteMultipleEnumColumn","calculateDefaultColumnWidth","HeaderOptions","ColumnHeaderWithTooltip","Tooltip","SmartToyTwoTone","DataGridRow","wrapPasteValueWithSchemaCoercion","getEmptyValue","withChangeIndicatorTooltip","OriginalComponent","T","C","colName","CellWithTooltip","props","$","_c","changeInfo","rowData","__cellChangeInfo","isAgent","category","t0","t1","tooltipText","position","top","right","width","height","zIndex","pointerEvents","t2","focus","fontSize","alignSelf","flexShrink","mr","color","backgroundColor","t3","displayName","ColumnConfig","columnName","description","disabled","typeInfo","enumeratedValues","isRequired","customWidth","showPinIcon","isPinned","onTogglePin","isUpsertKey","schemaPropertyInfo","getHeaderClassName","createDeleteValue","Record","createParseUserInput","value","trimmedValue","trim","createBaseColumn","config","columnImpl","headerOptions","hasDescription","undefined","keyed","component","title","headerClassName","minWidth","basis","grow","shrink","deleteValue","pasteValue","stickyLeft","COLUMN_FACTORIES","multipleEnum","choices","colType","type","limitTags","clearValue","boolean","number","enumerated","date-time","text","continuousUpdates","deletedValue","parseUserInput","cellClassName","getColumnType","length","format","isArray","createColumn","columnType"],"sources":["../../../../src/components/DataGrid/utils/columnFactory.tsx"],"sourcesContent":["import { dateTimeColumn } from '@/components/DataGrid/columns/DateTimeColumn'\nimport { EnumeratedValue } from '@/utils/jsonschema/getEnumeratedValues'\nimport { FlatTypeInfo } from '@/utils/jsonschema/getType'\nimport { SchemaPropertyInfo } from '@/utils/jsonschema/getSchemaPropertyInfo'\nimport {\n CellComponent,\n CellProps,\n Column,\n createTextColumn,\n floatColumn,\n keyColumn,\n} from '@sage-bionetworks/react-datasheet-grid'\nimport { autocompleteColumn } from '../columns/AutocompleteColumn'\nimport { autocompleteMultipleEnumColumn } from '../columns/AutocompleteMultipleEnumColumn'\nimport {\n calculateDefaultColumnWidth,\n HeaderOptions,\n} from './calculateColumnWidth'\nimport { ColumnHeaderWithTooltip } from '../components/ColumnHeaderWithTooltip'\nimport { Tooltip } from '@mui/material'\nimport { SmartToyTwoTone } from '@mui/icons-material'\nimport type { DataGridRow } from '../DataGridTypes'\nimport { wrapPasteValueWithSchemaCoercion } from './schemaAwarePasteValue'\nimport { getEmptyValue } from './getEmptyValue'\n\n/**\n * Wraps a column cell component to overlay change-attribution indicators:\n * - Non-agent changes: invisible 7×7px tooltip trigger over the CSS triangle (top-right).\n * - Agent changes: robot icon (1em, vertically centered on the right) with no triangle.\n */\nfunction withChangeIndicatorTooltip<T, C>(\n OriginalComponent: CellComponent<T, C>,\n colName: string,\n): CellComponent<T, C> {\n function CellWithTooltip(props: CellProps<T, C>) {\n const changeInfo = (props.rowData as DataGridRow).__cellChangeInfo?.[\n colName\n ]\n const isAgent =\n changeInfo?.category === 'own-agent' ||\n changeInfo?.category === 'other-agent'\n return (\n <>\n <OriginalComponent {...props} />\n {changeInfo && !isAgent && (\n <Tooltip title={changeInfo.tooltipText} placement=\"top-end\">\n <div\n style={{\n position: 'absolute',\n top: 0,\n right: 0,\n width: 7,\n height: 7,\n zIndex: 21,\n pointerEvents: 'auto',\n }}\n />\n </Tooltip>\n )}\n {isAgent && !props.focus && (\n <Tooltip title={changeInfo.tooltipText} placement=\"left\">\n <SmartToyTwoTone\n sx={{\n fontSize: '1em',\n alignSelf: 'center',\n flexShrink: 0,\n mr: 0.5,\n zIndex: 21,\n pointerEvents: 'auto',\n color: 'grey.400',\n backgroundColor: 'transparent',\n }}\n />\n </Tooltip>\n )}\n </>\n )\n }\n CellWithTooltip.displayName = `CellWithTooltip(${colName})`\n return CellWithTooltip\n}\n\ntype ColumnConfig = {\n columnName: string\n description?: string\n disabled?: boolean\n typeInfo: FlatTypeInfo | null\n enumeratedValues: EnumeratedValue[] | string[] | null\n isRequired: boolean\n customWidth?: number\n showPinIcon?: boolean\n isPinned?: boolean\n onTogglePin?: () => void\n isUpsertKey?: boolean\n /**\n * Optional column-level schema info. When provided, paste behavior coerces\n * empty pasted cells to the schema-correct blank (undefined for optional\n * columns, null for required columns). Omit to preserve the column impl's\n * default paste behavior.\n */\n schemaPropertyInfo?: SchemaPropertyInfo\n}\n\nfunction getHeaderClassName(isRequired: boolean, isUpsertKey: boolean): string {\n return isUpsertKey\n ? 'header-upsert-key'\n : isRequired\n ? 'header-cell-required'\n : 'header-cell'\n}\n\nfunction createDeleteValue(columnName: string, isRequired?: boolean) {\n return ({ rowData }: { rowData: Record<string, unknown> }) => ({\n ...rowData,\n [columnName]: getEmptyValue(isRequired),\n })\n}\n\nfunction createParseUserInput(isRequired?: boolean) {\n return (value: string) => {\n const trimmedValue = value.trim()\n if (trimmedValue === '') {\n return getEmptyValue(isRequired)\n }\n return trimmedValue\n }\n}\n\nfunction createBaseColumn(config: ColumnConfig, columnImpl: any) {\n const headerOptions: HeaderOptions = {\n showPinIcon: config.showPinIcon,\n hasDescription: !!config.description,\n }\n\n const width =\n config.customWidth ??\n calculateDefaultColumnWidth(\n config.columnName,\n undefined, // propertyInfo is not available here, passed from higher level\n headerOptions,\n )\n\n const keyed = keyColumn(config.columnName, columnImpl)\n return {\n ...keyed,\n component: withChangeIndicatorTooltip(keyed.component!, config.columnName),\n title: (\n <ColumnHeaderWithTooltip\n name={config.columnName}\n description={config.description}\n isRequired={config.isRequired}\n isUpsertKey={config.isUpsertKey}\n showPinIcon={config.showPinIcon}\n isPinned={config.isPinned}\n onTogglePin={config.onTogglePin}\n />\n ),\n headerClassName: getHeaderClassName(\n config.isRequired,\n !!config.isUpsertKey,\n ),\n minWidth: width,\n basis: width,\n grow: 0,\n shrink: 0,\n disabled: config.disabled,\n deleteValue: createDeleteValue(config.columnName, config.isRequired),\n pasteValue: wrapPasteValueWithSchemaCoercion(\n keyed.pasteValue,\n config.columnName,\n config.schemaPropertyInfo,\n ),\n stickyLeft: config.isPinned,\n }\n}\n\nconst COLUMN_FACTORIES = {\n multipleEnum: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteMultipleEnumColumn({\n choices: config.enumeratedValues ?? [],\n colType: config.typeInfo?.type || null,\n limitTags: 3,\n clearValue: getEmptyValue(config.isRequired),\n }),\n )\n },\n\n boolean: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteColumn({\n choices: [true, false],\n colType: 'boolean',\n clearValue: getEmptyValue(config.isRequired),\n }),\n )\n },\n\n number: (config: ColumnConfig) => {\n return createBaseColumn(config, floatColumn)\n },\n\n enumerated: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteColumn({\n choices: config.enumeratedValues ?? [],\n colType: config.typeInfo?.type || null,\n clearValue: getEmptyValue(config.isRequired),\n }),\n )\n },\n\n 'date-time': (config: ColumnConfig) => {\n const columnImpl = dateTimeColumn({\n colType: config.typeInfo?.type || null,\n })\n\n // Date-time needs special width calculation\n const headerOptions: HeaderOptions = {\n showPinIcon: config.showPinIcon,\n hasDescription: !!config.description,\n }\n\n const width =\n config.customWidth ??\n calculateDefaultColumnWidth(\n config.columnName,\n {\n type: config.typeInfo ?? undefined,\n isRequired: config.isRequired,\n enumeratedValues: null,\n },\n headerOptions,\n )\n\n return {\n ...createBaseColumn(config, columnImpl),\n minWidth: width,\n basis: width,\n }\n },\n\n text: (config: ColumnConfig) => {\n const columnImpl = createTextColumn({\n continuousUpdates: false,\n deletedValue: undefined,\n parseUserInput: createParseUserInput(config.isRequired),\n })\n\n return {\n ...createBaseColumn(config, columnImpl),\n cellClassName: 'MuiInputBase-input',\n }\n },\n}\n\nfunction getColumnType(\n typeInfo: FlatTypeInfo | null,\n enumeratedValues?: EnumeratedValue[] | string[] | null,\n): keyof typeof COLUMN_FACTORIES {\n if (!typeInfo) {\n return enumeratedValues && enumeratedValues.length > 0\n ? 'enumerated'\n : 'text'\n }\n\n if (typeInfo.format === 'date-time') {\n return 'date-time'\n }\n\n // Handle arrays - check if it's an array of enums\n if (typeInfo.isArray) {\n return 'multipleEnum'\n }\n\n if (typeInfo.type === 'boolean') {\n return 'boolean'\n }\n\n if (typeInfo.type === 'number' || typeInfo.type === 'integer') {\n return 'number'\n }\n\n if (enumeratedValues && enumeratedValues.length > 0) {\n return 'enumerated'\n }\n\n return 'text'\n}\n\nexport function createColumn(config: ColumnConfig): Column {\n const columnType = getColumnType(config.typeInfo, config.enumeratedValues)\n return COLUMN_FACTORIES[columnType](config)\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAASoB,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BC,cAAczB,KAAAA;GACd0B,gBAAgBnC,EAAqBK,EAAOf,UAAU;EACxD,CAG8BgB,CAAU;EACtC8B,eAAe;CACjB;AAEJ;AAEA,SAASC,EACPjD,GACAC,GAC+B;CA4B/B,OA3BKD,IAMDA,EAASmD,WAAW,cACf,cAILnD,EAASoD,UACJ,iBAGLpD,EAASqC,SAAS,YACb,YAGLrC,EAASqC,SAAS,YAAYrC,EAASqC,SAAS,YAC3C,WAGLpC,KAAoBA,EAAiBiD,SAAS,IACzC,eAGF,SA1BEjD,KAAoBA,EAAiBiD,SAAS,IACjD,eACA;AAyBR;AAEA,SAAgBG,EAAapC,GAA8B;CAEzD,OAAOgB,EADYgB,EAAchC,EAAOjB,UAAUiB,EAAOhB,gBACjCqD,GAAYrC,CAAM;AAC5C"}
|
|
1
|
+
{"version":3,"file":"columnFactory.js","names":["dateTimeColumn","EnumeratedValue","FlatTypeInfo","SchemaPropertyInfo","CellComponent","CellProps","Column","createTextColumn","floatColumn","keyColumn","autocompleteColumn","autocompleteMultipleEnumColumn","calculateDefaultColumnWidth","HeaderOptions","ColumnHeaderWithTooltip","Tooltip","SmartToyTwoTone","DataGridRow","wrapPasteValueWithSchemaCoercion","getEmptyValue","withChangeIndicatorTooltip","OriginalComponent","T","C","colName","CellWithTooltip","props","$","_c","changeInfo","rowData","__cellChangeInfo","isAgent","category","t0","t1","tooltipText","position","top","right","width","height","zIndex","pointerEvents","t2","focus","fontSize","alignSelf","flexShrink","mr","color","backgroundColor","t3","displayName","ColumnConfig","columnName","description","disabled","typeInfo","enumeratedValues","isRequired","customWidth","showPinIcon","isPinned","onTogglePin","isUpsertKey","schemaPropertyInfo","createDeleteValue","Record","createParseUserInput","value","trimmedValue","trim","createBaseColumn","config","columnImpl","headerOptions","hasDescription","undefined","keyed","component","title","minWidth","basis","grow","shrink","deleteValue","pasteValue","stickyLeft","COLUMN_FACTORIES","multipleEnum","choices","colType","type","limitTags","clearValue","boolean","number","enumerated","date-time","text","continuousUpdates","deletedValue","parseUserInput","cellClassName","getColumnType","length","format","isArray","createColumn","columnType"],"sources":["../../../../src/components/DataGrid/utils/columnFactory.tsx"],"sourcesContent":["import { dateTimeColumn } from '@/components/DataGrid/columns/DateTimeColumn'\nimport { EnumeratedValue } from '@/utils/jsonschema/getEnumeratedValues'\nimport { FlatTypeInfo } from '@/utils/jsonschema/getType'\nimport { SchemaPropertyInfo } from '@/utils/jsonschema/getSchemaPropertyInfo'\nimport {\n CellComponent,\n CellProps,\n Column,\n createTextColumn,\n floatColumn,\n keyColumn,\n} from '@sage-bionetworks/react-datasheet-grid'\nimport { autocompleteColumn } from '../columns/AutocompleteColumn'\nimport { autocompleteMultipleEnumColumn } from '../columns/AutocompleteMultipleEnumColumn'\nimport {\n calculateDefaultColumnWidth,\n HeaderOptions,\n} from './calculateColumnWidth'\nimport { ColumnHeaderWithTooltip } from '../components/ColumnHeaderWithTooltip'\nimport { Tooltip } from '@mui/material'\nimport { SmartToyTwoTone } from '@mui/icons-material'\nimport type { DataGridRow } from '../DataGridTypes'\nimport { wrapPasteValueWithSchemaCoercion } from './schemaAwarePasteValue'\nimport { getEmptyValue } from './getEmptyValue'\n\n/**\n * Wraps a column cell component to overlay change-attribution indicators:\n * - Non-agent changes: invisible 7×7px tooltip trigger over the CSS triangle (top-right).\n * - Agent changes: robot icon (1em, vertically centered on the right) with no triangle.\n */\nfunction withChangeIndicatorTooltip<T, C>(\n OriginalComponent: CellComponent<T, C>,\n colName: string,\n): CellComponent<T, C> {\n function CellWithTooltip(props: CellProps<T, C>) {\n const changeInfo = (props.rowData as DataGridRow).__cellChangeInfo?.[\n colName\n ]\n const isAgent =\n changeInfo?.category === 'own-agent' ||\n changeInfo?.category === 'other-agent'\n return (\n <>\n <OriginalComponent {...props} />\n {changeInfo && !isAgent && (\n <Tooltip title={changeInfo.tooltipText} placement=\"top-end\">\n <div\n style={{\n position: 'absolute',\n top: 0,\n right: 0,\n width: 7,\n height: 7,\n zIndex: 21,\n pointerEvents: 'auto',\n }}\n />\n </Tooltip>\n )}\n {isAgent && !props.focus && (\n <Tooltip title={changeInfo.tooltipText} placement=\"left\">\n <SmartToyTwoTone\n sx={{\n fontSize: '1em',\n alignSelf: 'center',\n flexShrink: 0,\n mr: 0.5,\n zIndex: 21,\n pointerEvents: 'auto',\n color: 'grey.400',\n backgroundColor: 'transparent',\n }}\n />\n </Tooltip>\n )}\n </>\n )\n }\n CellWithTooltip.displayName = `CellWithTooltip(${colName})`\n return CellWithTooltip\n}\n\ntype ColumnConfig = {\n columnName: string\n description?: string\n disabled?: boolean\n typeInfo: FlatTypeInfo | null\n enumeratedValues: EnumeratedValue[] | string[] | null\n isRequired: boolean\n customWidth?: number\n showPinIcon?: boolean\n isPinned?: boolean\n onTogglePin?: () => void\n isUpsertKey?: boolean\n /**\n * Optional column-level schema info. When provided, paste behavior coerces\n * empty pasted cells to the schema-correct blank (undefined for optional\n * columns, null for required columns). Omit to preserve the column impl's\n * default paste behavior.\n */\n schemaPropertyInfo?: SchemaPropertyInfo\n}\n\nfunction createDeleteValue(columnName: string, isRequired?: boolean) {\n return ({ rowData }: { rowData: Record<string, unknown> }) => ({\n ...rowData,\n [columnName]: getEmptyValue(isRequired),\n })\n}\n\nfunction createParseUserInput(isRequired?: boolean) {\n return (value: string) => {\n const trimmedValue = value.trim()\n if (trimmedValue === '') {\n return getEmptyValue(isRequired)\n }\n return trimmedValue\n }\n}\n\nfunction createBaseColumn(config: ColumnConfig, columnImpl: any) {\n const headerOptions: HeaderOptions = {\n showPinIcon: config.showPinIcon,\n hasDescription: !!config.description,\n }\n\n const width =\n config.customWidth ??\n calculateDefaultColumnWidth(\n config.columnName,\n undefined, // propertyInfo is not available here, passed from higher level\n headerOptions,\n )\n\n const keyed = keyColumn(config.columnName, columnImpl)\n return {\n ...keyed,\n component: withChangeIndicatorTooltip(keyed.component!, config.columnName),\n title: (\n <ColumnHeaderWithTooltip\n name={config.columnName}\n description={config.description}\n isRequired={config.isRequired}\n isUpsertKey={config.isUpsertKey}\n showPinIcon={config.showPinIcon}\n isPinned={config.isPinned}\n onTogglePin={config.onTogglePin}\n />\n ),\n minWidth: width,\n basis: width,\n grow: 0,\n shrink: 0,\n disabled: config.disabled,\n deleteValue: createDeleteValue(config.columnName, config.isRequired),\n pasteValue: wrapPasteValueWithSchemaCoercion(\n keyed.pasteValue,\n config.columnName,\n config.schemaPropertyInfo,\n ),\n stickyLeft: config.isPinned,\n }\n}\n\nconst COLUMN_FACTORIES = {\n multipleEnum: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteMultipleEnumColumn({\n choices: config.enumeratedValues ?? [],\n colType: config.typeInfo?.type || null,\n limitTags: 3,\n clearValue: getEmptyValue(config.isRequired),\n }),\n )\n },\n\n boolean: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteColumn({\n choices: [true, false],\n colType: 'boolean',\n clearValue: getEmptyValue(config.isRequired),\n }),\n )\n },\n\n number: (config: ColumnConfig) => {\n return createBaseColumn(config, floatColumn)\n },\n\n enumerated: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteColumn({\n choices: config.enumeratedValues ?? [],\n colType: config.typeInfo?.type || null,\n clearValue: getEmptyValue(config.isRequired),\n }),\n )\n },\n\n 'date-time': (config: ColumnConfig) => {\n const columnImpl = dateTimeColumn({\n colType: config.typeInfo?.type || null,\n })\n\n // Date-time needs special width calculation\n const headerOptions: HeaderOptions = {\n showPinIcon: config.showPinIcon,\n hasDescription: !!config.description,\n }\n\n const width =\n config.customWidth ??\n calculateDefaultColumnWidth(\n config.columnName,\n {\n type: config.typeInfo ?? undefined,\n isRequired: config.isRequired,\n enumeratedValues: null,\n },\n headerOptions,\n )\n\n return {\n ...createBaseColumn(config, columnImpl),\n minWidth: width,\n basis: width,\n }\n },\n\n text: (config: ColumnConfig) => {\n const columnImpl = createTextColumn({\n continuousUpdates: false,\n deletedValue: undefined,\n parseUserInput: createParseUserInput(config.isRequired),\n })\n\n return {\n ...createBaseColumn(config, columnImpl),\n cellClassName: 'MuiInputBase-input',\n }\n },\n}\n\nfunction getColumnType(\n typeInfo: FlatTypeInfo | null,\n enumeratedValues?: EnumeratedValue[] | string[] | null,\n): keyof typeof COLUMN_FACTORIES {\n if (!typeInfo) {\n return enumeratedValues && enumeratedValues.length > 0\n ? 'enumerated'\n : 'text'\n }\n\n if (typeInfo.format === 'date-time') {\n return 'date-time'\n }\n\n // Handle arrays - check if it's an array of enums\n if (typeInfo.isArray) {\n return 'multipleEnum'\n }\n\n if (typeInfo.type === 'boolean') {\n return 'boolean'\n }\n\n if (typeInfo.type === 'number' || typeInfo.type === 'integer') {\n return 'number'\n }\n\n if (enumeratedValues && enumeratedValues.length > 0) {\n return 'enumerated'\n }\n\n return 'text'\n}\n\nexport function createColumn(config: ColumnConfig): Column {\n const columnType = getColumnType(config.typeInfo, config.enumeratedValues)\n return COLUMN_FACTORIES[columnType](config)\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAASoB,EACPC,GACAG,GACqB;CACrB,SAAAC,EAAAC,GAAA;EAAA,IAAAC,IAAAC,EAAA,EAAA,GACEC,IAAoBH,EAAKI,QAAuBC,mBAC9CP,IAEFQ,IACEH,GAAUI,aAAe,eACzBJ,GAAUI,aAAe,eAAaC;EAAA,AAAAP,EAAA,OAAAD,IAGJQ,IAAAP,EAAA,MAAhCO,IAAA,kBAAC,GAAD,EAAkB,GAAKR,EAAK,CAAA,GAAIC,EAAA,KAAAD,GAAAC,EAAA,KAAAO;EAAA,IAAAC;EAAA,AAAAR,EAAA,OAAAE,KAAAF,EAAA,OAAAK,KAC/BG,IAAAN,KAAA,CAAeG,KACd,kBAAC,GAAD;GAAgB,OAAAH,EAAUO;GAAwB,WAAA;aAChD,kBAAA,OAAA,EACS,OAAA;IAAAC,UACK;IAAUC,KACf;IAACC,OACC;IAACC,OACD;IAACC,QACA;IAACC,QACD;IAAEC,eACK;GACjB,EAAC,CAAA;EAVG,CAAA,GAaThB,EAAA,KAAAE,GAAAF,EA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,IAAa3E,EAAe,EAChC4F,SAASlB,EAAOhB,UAAUmC,QAAQ,KACpC,CAAC,GAGKjB,IAA+B;GACnCd,aAAaY,EAAOZ;GACpBe,gBAAgB,CAAC,CAACH,EAAOlB;EAC3B,GAEMhB,IACJkC,EAAOb,eACPjD,EACE8D,EAAOnB,YACP;GACEsC,MAAMnB,EAAOhB,YAAYoB,KAAAA;GACzBlB,YAAYc,EAAOd;GACnBD,kBAAkB;EACpB,GACAiB,CACF;EAEF,OAAO;GACL,GAAGH,EAAiBC,GAAQC,CAAU;GACtCO,UAAU1C;GACV2C,OAAO3C;EACT;CACF;CAEA4D,OAAO1B,OAOE;EACL,GAAGD,EAAiBC,GAPHnE,EAAiB;GAClC8F,mBAAmB;GACnBC,cAAcxB,KAAAA;GACdyB,gBAAgBlC,EAAqBK,EAAOd,UAAU;EACxD,CAG8Be,CAAU;EACtC6B,eAAe;CACjB;AAEJ;AAEA,SAASC,EACP/C,GACAC,GAC+B;CA4B/B,OA3BKD,IAMDA,EAASiD,WAAW,cACf,cAILjD,EAASkD,UACJ,iBAGLlD,EAASmC,SAAS,YACb,YAGLnC,EAASmC,SAAS,YAAYnC,EAASmC,SAAS,YAC3C,WAGLlC,KAAoBA,EAAiB+C,SAAS,IACzC,eAGF,SA1BE/C,KAAoBA,EAAiB+C,SAAS,IACjD,eACA;AAyBR;AAEA,SAAgBG,EAAanC,GAA8B;CAEzD,OAAOe,EADYgB,EAAc/B,EAAOhB,UAAUgB,EAAOf,gBACjCmD,GAAYpC,CAAM;AAC5C"}
|
|
@@ -98,7 +98,8 @@ export type TableToGenericCardMapping = {
|
|
|
98
98
|
/**
|
|
99
99
|
* Column name of a STRING_LIST of Data Use Ontology (DUO) values (ontology
|
|
100
100
|
* codes or term names). When set, the values are rendered as DUO tags in a
|
|
101
|
-
*
|
|
101
|
+
* metadata row labeled with the column's display name, so the card matches the
|
|
102
|
+
* corresponding facet.
|
|
102
103
|
*/
|
|
103
104
|
dataUseModifiersColumnName?: string;
|
|
104
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRowGenericCard.d.ts","sourceRoot":"","sources":["../../../src/components/GenericCard/TableRowGenericCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAA;AA2B9E,OAAO,EACL,WAAW,EAGX,YAAY,EAEb,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAyC,MAAM,OAAO,CAAA;AAI7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAIjD,OAAsB,EACpB,kBAAkB,EACnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAKjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAA;AAI3E,KAAK,sBAAsB,GAAG;IAC5B,4DAA4D;IAC5D,EAAE,EAAE;QACF,MAAM,EAAE,OAAO,CAAA;KAChB,CAAA;IACD,2FAA2F;IAC3F,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,kBAAkB,CAAA;KAC3B,CAAA;CACF,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,2DAA2D;IAC3D,EAAE,EAAE;QACF,MAAM,EAAE,QAAQ,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,gEAAgE;IAChE,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,QAAQ,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,mBAAmB,GAC3B,sBAAsB,GACtB,yBAAyB,CAAA;AAE7B;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sEAAsE;IACtE,WAAW,CA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A;IAC1B,0GAA0G;IAC1G,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;IAC/C
|
|
1
|
+
{"version":3,"file":"TableRowGenericCard.d.ts","sourceRoot":"","sources":["../../../src/components/GenericCard/TableRowGenericCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAA;AA2B9E,OAAO,EACL,WAAW,EAGX,YAAY,EAEb,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAyC,MAAM,OAAO,CAAA;AAI7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAIjD,OAAsB,EACpB,kBAAkB,EACnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AAKjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAA;AAI3E,KAAK,sBAAsB,GAAG;IAC5B,4DAA4D;IAC5D,EAAE,EAAE;QACF,MAAM,EAAE,OAAO,CAAA;KAChB,CAAA;IACD,2FAA2F;IAC3F,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,kBAAkB,CAAA;KAC3B,CAAA;CACF,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,2DAA2D;IAC3D,EAAE,EAAE;QACF,MAAM,EAAE,QAAQ,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,gEAAgE;IAChE,OAAO,CAAC,EAAE;QACR,MAAM,EAAE,QAAQ,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,mBAAmB,GAC3B,sBAAsB,GACtB,yBAAyB,CAAA;AAE7B;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAA;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132
132
|
}), q = [], { secondaryLabels: J = [] } = S, Y = S.customSecondaryLabelConfig;
|
|
133
|
-
if (V && q.push({
|
|
134
|
-
|
|
133
|
+
if (V && S.dataUseModifiersColumnName && q.push({
|
|
134
|
+
columnName: S.dataUseModifiersColumnName,
|
|
135
|
+
columnDisplayName: _(S.dataUseModifiersColumnName),
|
|
135
136
|
value: V
|
|
136
137
|
}), nt && N && K && Pe && q.push({
|
|
137
138
|
columnDisplayName: "DOI",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRowGenericCard.js","names":[],"sources":["../../../src/components/GenericCard/TableRowGenericCard.tsx"],"sourcesContent":["import { CommonCardProps } from '@/components/CardContainer/CardConfiguration'\nimport {\n getFileHandleAssociation,\n getLinkParams,\n getValueOrMultiValue,\n} from '@/components/GenericCard/CardUtils'\nimport CroissantButton from '@/components/GenericCard/CroissantButton/CroissantButton'\nimport { GenericCardIcon } from '@/components/GenericCard/GenericCardIcon'\nimport PortalDOI from '@/components/GenericCard/PortalDOI/PortalDOI'\nimport {\n getCandidateDoiId,\n useShowDoiCardLabel,\n} from '@/components/GenericCard/PortalDOI/PortalDOIUtils'\nimport { mapRowToRecord } from '@/components/SynapseTable/SynapseTableUtils'\nimport { useGetEntity } from '@/synapse-queries'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isDatasetCollection,\n isTableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport { PRODUCTION_ENDPOINT_CONFIG } from '@/utils/functions/getEndpoint'\nimport { parseSynId } from '@/utils/functions/RegularExpressions'\nimport { getColumnIndex } from '@/utils/functions/SqlFunctions'\nimport { TargetEnum } from '@/utils/html/TargetEnum'\nimport * as SynapseConstants from '@/utils/SynapseConstants'\nimport { GetAppTwoTone } from '@mui/icons-material'\nimport { Box, Collapse, Link, Stack, Typography } from '@mui/material'\nimport {\n ColumnModel,\n ColumnTypeEnum,\n Entity,\n SelectColumn,\n Table,\n} from '@sage-bionetworks/synapse-types'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\nimport CitationPopover from '../CitationPopover'\nimport { EntityDownloadConfirmation } from '../EntityDownloadConfirmation'\nimport { HeaderCardVariant } from '../HeaderCard'\nimport IconList from '../IconList'\nimport { useQueryContext } from '../QueryContext/QueryContext'\nimport { useQueryVisualizationContext } from '../QueryVisualizationWrapper'\nimport ShareThisPage, {\n ShareThisPageProps,\n} from '../ShareThisPage/ShareThisPage'\nimport { SustainabilityScorecardProps } from '../SustainabilityScorecard/SustainabilityScorecard'\nimport GenericCard from './GenericCard'\nimport GenericCardActionButton from './GenericCardActionButton'\nimport DuoTermTags from './DuoTermTags/DuoTermTags'\nimport { parseDuoModifiers } from './DuoTermTags/duoTerms'\nimport { PortalDOIConfiguration } from './PortalDOI/PortalDOIConfiguration'\nimport { SynapseCardLabel } from './SynapseCardLabel'\nimport { useResolvedSynapseEntity } from './useResolvedSynapseEntity'\n\ntype RowSynapseEntityConfig = {\n /** Use the table rowId to resolve the Synapse entity ID. */\n id: {\n source: 'rowId'\n }\n /** Use the table rowVersionNumber to resolve the Synapse entity version (if available). */\n version?: {\n source: 'rowVersionNumber'\n }\n}\n\ntype ColumnSynapseEntityConfig = {\n /** Use a column value to resolve the Synapse entity ID. */\n id: {\n source: 'column'\n columnName: string\n }\n /** Use a column value to resolve the Synapse entity version. */\n version?: {\n source: 'column'\n columnName: string\n }\n}\n\nexport type SynapseEntityConfig =\n | RowSynapseEntityConfig\n | ColumnSynapseEntityConfig\n\n/**\n * Maps a table query result to a GenericCard.\n */\nexport type TableToGenericCardMapping = {\n /** The 'type' of resource a card refers to. Renders a label on the card with this string value.\n * Can be hidden by setting it to '' (empty string)\n */\n type: string\n /** The column name whose data contains the title of the card */\n title: string\n /** The column name whose data contains the subtitle of the card */\n subTitle?: string\n /** The column name whose data contains the description of the card */\n description?: string\n /** If true, a 'Cite As' button will be displayed for those cards with a DOI in the 'doi' column */\n includeCitation?: boolean\n /** If true, a 'Share this page' button will be displayed */\n includeShareButton?: boolean\n /**\n * Configuration for displaying the SustainabilityScorecard component\n */\n sustainabilityScorecard?: SustainabilityScorecardProps\n /** The initial citation format to use in the 'Cite As' UI */\n defaultCitationFormat?: 'bibtex' | 'apa' | 'ieee' | 'nature' | 'science'\n /** Static text displayed in the 'Cite As' UI */\n citationBoilerplateText?: string\n /** The column name whose data contains the value used to map to the icon */\n icon?: string\n /** The column name whose data contains an image file handle to be displayed on the card */\n imageFileHandleColumnName?: string\n /** Static boolean value used if the image displayed using `imageFileHandleColumnName` requires extra padding */\n thumbnailRequiresPadding?: boolean\n /** Array of column names to be used for labels in the Card Footer */\n secondaryLabels?: string[]\n /** Can be used to add a custom secondary label */\n customSecondaryLabelConfig?: {\n /** The displayed label key */\n key: string\n /** The value to display */\n value: React.ReactNode\n /** Callback to determine visibility of the label\n * @param schema the mapping of columnName to data index\n * @param data the row data\n */\n isVisible: (schema: Record<string, number>, data: string[]) => boolean\n }\n /** Column name of the link value if the title should be linked */\n link?: string\n /** Column name of the STRING_LIST column that includes icon names that represent icons that should be displayed on the card */\n dataTypeIconNames?: string\n /**\n * Ordered list of column names to display to the right of the title area.\n * Each renders as \"Display Name: Value\" on its own line. Rows with empty values are skipped.\n * The display name is derived from getColumnDisplayName (respects column aliases and unCamelCase).\n *\n * Can also be a function that receives the schema and row data and returns the list of column\n * names to display, allowing the displayed details to vary based on the row's actual values.\n */\n titleAreaDetails?:\n | string[]\n | ((schema: Record<string, number>, data: string[]) => string[])\n /** Configuration for resolving the Synapse entity ID/version represented by each card row.\n * The ID and version sources must both reference either row-based values or column-based values.\n */\n synapseEntityConfig?: SynapseEntityConfig\n /** The column name whose data contains a synId that can be used to show a button to add the corresponding entity to the download cart. */\n downloadCartSynId?: string\n /** Configuration to display a DOI, as well as the ability to create one for users with such permission */\n portalDoiConfiguration?: PortalDOIConfiguration\n /**\n * Column name of a STRING_LIST of Data Use Ontology (DUO) values (ontology\n * codes or term names). When set, the values are rendered as DUO tags in a\n * \"Data Usage Restrictions\" row in the card's metadata section.\n */\n dataUseModifiersColumnName?: string\n}\n\nexport type TableRowGenericCardProps = {\n /** The schema that maps a table result to the GenericCard UI */\n genericCardSchema: TableToGenericCardMapping\n /** The table's SelectColumns */\n selectColumns?: SelectColumn[]\n /** The table's ColumnModels */\n columnModels?: ColumnModel[]\n /** If true, the 'type' column will be used as the icon string to choose the icon */\n useTypeColumnForIcon?: boolean\n /** If true, render the card as a HeaderCard */\n isHeader?: boolean\n /** If isHeader is true, use this variant of HeaderCard */\n headerCardVariant?: HeaderCardVariant\n isAlignToLeftNav?: boolean\n /** Mapping of column name to row data index */\n schema: Record<string, number>\n /** The row data */\n data: string[]\n /** The ID of the table row */\n rowId?: number\n /** The versionNumber of the table row */\n versionNumber?: number\n /** Optional props for the ShareThisPage component */\n sharePageLinkButtonProps?: ShareThisPageProps\n /** Optional function that receives schema and data and returns a ReactNode to be rendered next to the card type */\n CardTypeAdornment?: React.ComponentType<{\n schema: Record<string, number>\n data: string[]\n }>\n} & CommonCardProps\n\n// SWC-6115: special rendering of the version column (for Views)\nfunction VersionLabel(props: { synapseId: string; version: string }) {\n const { synapseId, version } = props\n return (\n <span>\n {version} \n <a\n target={TargetEnum.NEW_WINDOW}\n rel=\"noopener noreferrer\"\n href={`${PRODUCTION_ENDPOINT_CONFIG.PORTAL}Synapse:${synapseId}.${version}`}\n >\n (Show Version History on Synapse)\n </a>\n </span>\n )\n}\n\n/**\n * Maps a table row to a GenericCard.\n */\nexport function TableRowGenericCard(props: TableRowGenericCardProps) {\n const [showDownloadConfirmation, setShowDownloadConfirmation] =\n useState(false)\n const [downloadButtonLoading, setDownloadButtonLoading] = useState(false)\n\n const { entityId, versionNumber } = useQueryContext()\n const { getColumnDisplayName } = useQueryVisualizationContext()\n\n const { ref, inView: cardIsInView } = useInView()\n\n const { data: table } = useGetEntity<Table>(entityId, versionNumber)\n\n const {\n schema,\n data,\n rowId,\n versionNumber: rowVersionNumber,\n genericCardSchema,\n secondaryLabelLimit,\n sharePageLinkButtonProps,\n selectColumns,\n columnModels,\n iconOptions,\n useTypeColumnForIcon = false,\n isHeader = false,\n sustainabilityScorecard,\n headerCardVariant,\n titleLinkConfig,\n ctaLinkConfig,\n ctaLinkPosition,\n labelLinkConfig,\n descriptionConfig,\n columnIconOptions,\n CardTypeAdornment,\n charCountCutoff,\n } = props\n\n const {\n link = '',\n type,\n includeCitation,\n includeShareButton,\n defaultCitationFormat,\n citationBoilerplateText,\n downloadCartSynId,\n portalDoiConfiguration,\n } = genericCardSchema\n const title = data[schema[genericCardSchema.title]]\n let subTitle =\n genericCardSchema.subTitle && data[schema[genericCardSchema.subTitle]]\n subTitle =\n genericCardSchema.subTitle &&\n getValueOrMultiValue({\n value: subTitle,\n columnName: genericCardSchema.subTitle,\n selectColumns,\n columnModels,\n }).str\n const description = data[schema[genericCardSchema.description || '']]\n const iconValue = data[schema[genericCardSchema.icon || '']]\n const dataTypeIconNames =\n data[schema[genericCardSchema.dataTypeIconNames || '']]\n const imageFileHandleIdValue =\n data[schema[genericCardSchema.imageFileHandleColumnName || '']]\n const titleColumnModel = columnModels?.find(\n el => genericCardSchema.link === el.name,\n )\n const titleColumnType = titleColumnModel?.columnType\n // wrap link in parens because undefined would throw an error\n const linkValue: string = data[schema[link]] || ''\n const { href, target } = getLinkParams(\n linkValue,\n titleLinkConfig,\n data,\n schema,\n rowId,\n )\n\n const synapseEntityConfig = genericCardSchema.synapseEntityConfig\n\n const getColumnValue = useCallback(\n (columnName?: string) => {\n if (!columnName) {\n return undefined\n }\n const columnIndex = schema[columnName]\n if (columnIndex === undefined) {\n return undefined\n }\n return data[columnIndex]\n },\n [schema, data],\n )\n\n // DUO (Data Use Ontology) tags, when a dataUseModifiers column is configured.\n // Rendered as a \"Data Usage Restrictions\" row in the metadata section.\n const duoContent = useMemo(() => {\n const col = genericCardSchema.dataUseModifiersColumnName\n if (!col) {\n return undefined\n }\n const terms = parseDuoModifiers(data[schema[col]])\n if (terms.length === 0) {\n return undefined\n }\n return <DuoTermTags terms={terms} />\n }, [genericCardSchema, data, schema])\n\n const resolvedTitleAreaRightContent = useMemo(() => {\n const { titleAreaDetails } = genericCardSchema\n if (!titleAreaDetails) return undefined\n const columns =\n typeof titleAreaDetails === 'function'\n ? titleAreaDetails(schema, data)\n : titleAreaDetails\n if (columns.length === 0) return undefined\n const rows = columns\n .map(columnName => {\n const rawValue: string | undefined = data[schema[columnName]]\n if (!rawValue) return null\n return { name: getColumnDisplayName(columnName), rawValue, columnName }\n })\n .filter(Boolean) as {\n name: string\n rawValue: string\n columnName: string\n }[]\n if (rows.length === 0) return undefined\n return (\n <Stack direction=\"column\" gap=\"4px\">\n {rows.map(({ name, rawValue, columnName }) => (\n <Stack key={columnName} direction=\"row\" gap=\"4px\" alignItems=\"center\">\n <Typography component=\"span\" variant=\"body1\">\n {name}:\n </Typography>\n <SynapseCardLabel\n value={rawValue}\n columnName={columnName}\n labelLink={undefined}\n isHeader={isHeader}\n selectColumns={selectColumns}\n columnModels={columnModels}\n rowData={data}\n columnIconOptions={columnIconOptions}\n />\n </Stack>\n ))}\n </Stack>\n )\n }, [\n genericCardSchema,\n data,\n schema,\n getColumnDisplayName,\n isHeader,\n selectColumns,\n columnModels,\n columnIconOptions,\n ])\n\n const {\n entityId: resolvedSynapseEntityId,\n entityVersionNumber: resolvedSynapseEntityVersionNumber,\n } = useResolvedSynapseEntity({\n synapseEntityConfig,\n getColumnValue,\n rowId,\n rowVersionNumber,\n })\n\n let resolvedDownloadCartSynIdValue = resolvedSynapseEntityId\n let resolvedDownloadCartVersionNumber = resolvedSynapseEntityVersionNumber\n\n if (downloadCartSynId) {\n const reference = parseSynId(getColumnValue(downloadCartSynId) ?? '')\n resolvedDownloadCartSynIdValue = reference?.targetId\n resolvedDownloadCartVersionNumber = reference?.targetVersionNumber\n }\n\n // Transform the row to a record of (columnName, value) pairs for compatibility with getCandidateDoiId\n const dataAsRecord: Record<string, string | null> = useMemo(\n () => mapRowToRecord(data, schema),\n [data, schema],\n )\n\n const candidateDoiId = getCandidateDoiId({\n data: dataAsRecord,\n portalDoiConfiguration,\n })\n\n const showDoiCardLabel = useShowDoiCardLabel({\n portalId: portalDoiConfiguration?.portalId,\n resourceId: candidateDoiId,\n })\n\n const values: {\n columnDisplayName: string\n value: React.ReactNode\n columnName?: string\n }[] = []\n const { secondaryLabels = [] } = genericCardSchema\n const customLabelConfig = genericCardSchema.customSecondaryLabelConfig\n\n // DUO tags rendered as a metadata row (alongside \"How to download\", size, …).\n if (duoContent) {\n values.push({\n columnDisplayName: 'Data Usage Restrictions',\n value: duoContent,\n })\n }\n\n // PORTALS-3549 - if a DOI exists or can be created by the current user, show it\n if (\n showDoiCardLabel &&\n portalDoiConfiguration &&\n candidateDoiId &&\n cardIsInView\n ) {\n values.push({\n columnDisplayName: 'DOI',\n value: (\n <PortalDOI\n portalId={portalDoiConfiguration.portalId}\n resourceId={candidateDoiId}\n />\n ),\n })\n }\n\n // Overwrite the 'HOW TO DOWNLOAD' link if a synapse ID is available\n if (customLabelConfig?.isVisible(schema, data)) {\n const { key, value } = customLabelConfig\n if (resolvedDownloadCartSynIdValue) {\n values.push({\n columnDisplayName: 'HOW TO DOWNLOAD',\n value: (\n <Link onClick={() => setShowDownloadConfirmation(val => !val)}>\n Click here to add to Synapse download list\n </Link>\n ),\n })\n } else {\n values.push({ columnDisplayName: key, value })\n }\n }\n\n const isView = table && !isTableEntity(table)\n for (let i = 0; i < secondaryLabels.length; i += 1) {\n const columnName = secondaryLabels[i]\n const rawValue: string | undefined = data[schema[columnName]]\n let renderedValue: React.ReactNode = rawValue\n let columnDisplayName\n if (renderedValue && rawValue !== '[]' && rawValue !== '[\"\"]') {\n // PORTALS-2750: special rendering of the datasetSizeInBytes (for Dataset Collections)\n if (\n isDatasetCollection(table as Entity) &&\n columnName === 'datasetSizeInBytes'\n ) {\n columnDisplayName = 'Size'\n renderedValue = calculateFriendlyFileSize(parseInt(rawValue))\n } // SWC-6115: special rendering of the version column (for Views)\n else if (isView && columnName === 'currentVersion') {\n const synapseId = data[schema.id]\n renderedValue = (\n <VersionLabel synapseId={synapseId} version={rawValue} />\n )\n columnDisplayName = 'Version'\n } else {\n const labelLink = labelLinkConfig?.find(\n el => el.matchColumnName === columnName,\n )\n renderedValue = (\n <SynapseCardLabel\n value={rawValue}\n columnName={columnName}\n labelLink={labelLink}\n isHeader={isHeader}\n selectColumns={selectColumns}\n columnModels={columnModels}\n rowData={data}\n columnIconOptions={columnIconOptions}\n />\n )\n columnDisplayName = getColumnDisplayName(columnName)\n }\n values.push({ columnDisplayName, value: renderedValue, columnName })\n }\n }\n\n const fileHandleId = imageFileHandleIdValue || linkValue\n\n /**\n * To show a direct download link to a file, we need to determine the association that gives permission to download the file.\n */\n const fileHandleAssociation = getFileHandleAssociation(\n table,\n fileHandleId,\n data[schema.id],\n )\n\n const descriptionSubTitle = getColumnDisplayName(\n genericCardSchema.description || '',\n )\n\n const doiColumnIndex = getColumnIndex('doi', selectColumns, columnModels)\n const doiValue =\n doiColumnIndex !== undefined ? data[doiColumnIndex] : undefined\n\n // Normalize ctaLinkConfig to array and resolve each config\n const ctaLinkConfigs = ctaLinkConfig\n ? Array.isArray(ctaLinkConfig)\n ? ctaLinkConfig\n : [ctaLinkConfig]\n : []\n const resolvedCtaLinkConfigs = ctaLinkConfigs\n .map(config => {\n const ctaLinkValue: string = data[schema[config.link]] || ''\n if (!ctaLinkValue) return null\n const { href, target } = getLinkParams(\n ctaLinkValue,\n undefined, //card link config\n data,\n schema,\n rowId,\n )\n return {\n text: config.endIcon ? (\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n {config.text}\n {config.endIcon}\n </div>\n ) : (\n config.text\n ),\n href,\n target,\n }\n })\n .filter(Boolean) as { text: string; href: string; target?: string }[]\n\n let croissantButton = <></>\n if (\n resolvedSynapseEntityId != null &&\n resolvedSynapseEntityVersionNumber != null\n ) {\n croissantButton = (\n <CroissantButton\n datasetId={resolvedSynapseEntityId}\n datasetVersionNumber={resolvedSynapseEntityVersionNumber}\n />\n )\n }\n\n const resolvedCardTypeAdornment = CardTypeAdornment ? (\n <CardTypeAdornment schema={schema} data={data} />\n ) : null\n\n let isRenderingIcon = true\n if (isHeader && !imageFileHandleIdValue && !iconValue) {\n // For header cards, if there is no image or explicit icon value, we don't show an icon at all\n isRenderingIcon = false\n }\n const iconNode = isRenderingIcon ? (\n <GenericCardIcon\n type={\n useTypeColumnForIcon ? data[schema['type']] : genericCardSchema.type\n }\n useTypeForIcon={useTypeColumnForIcon}\n thumbnailRequiresPadding={genericCardSchema.thumbnailRequiresPadding}\n imageFileHandleId={imageFileHandleIdValue}\n fileHandleAssociation={fileHandleAssociation}\n iconOptions={iconOptions}\n iconValue={iconValue}\n />\n ) : undefined\n return (\n <GenericCard\n ref={ref}\n icon={iconNode}\n isHeader={isHeader}\n sustainabilityScorecard={sustainabilityScorecard}\n headerCardVariant={headerCardVariant}\n type={type}\n title={title}\n subtitle={subTitle}\n titleLinkConfiguration={{ target, href }}\n cardTypeAdornment={resolvedCardTypeAdornment}\n titleAsFileHandleLinkConfiguration={\n !titleLinkConfig &&\n titleColumnType === ColumnTypeEnum.FILEHANDLEID &&\n fileHandleAssociation\n ? {\n fileHandleAssociation: fileHandleAssociation,\n showDownloadIcon: type !== SynapseConstants.EXPERIMENTAL,\n }\n : undefined\n }\n ctaLinkConfig={\n resolvedCtaLinkConfigs.length > 0 ? resolvedCtaLinkConfigs : undefined\n }\n ctaLinkPosition={ctaLinkPosition}\n titleAreaRightContent={resolvedTitleAreaRightContent}\n description={description}\n descriptionSubTitle={descriptionSubTitle}\n descriptionConfig={descriptionConfig}\n charCountCutoff={charCountCutoff}\n labels={values}\n secondaryLabelLimit={secondaryLabelLimit}\n useStylesForDisplayedImage={Boolean(imageFileHandleIdValue)}\n cardTopContent={\n <>\n {resolvedDownloadCartSynIdValue && (\n <Collapse in={showDownloadConfirmation}>\n <EntityDownloadConfirmation\n entityId={resolvedDownloadCartSynIdValue}\n versionNumber={resolvedDownloadCartVersionNumber}\n handleClose={() => setShowDownloadConfirmation(false)}\n onIsLoadingChange={isLoading => {\n setDownloadButtonLoading(isLoading)\n }}\n />\n </Collapse>\n )}\n </>\n }\n renderedIconList={\n // If the portal configs has columnIconOptions.columns.dataType option\n // and the column value is not null, display the card data type icons\n columnIconOptions?.columns?.dataType &&\n dataTypeIconNames?.length && (\n <div style={{ marginTop: '20px' }}>\n <IconList\n iconConfigs={columnIconOptions.columns.dataType}\n iconNames={JSON.parse(dataTypeIconNames) as string[]}\n commonIconProps={{\n sx: { fontSize: '40px' },\n }}\n useBackground={true}\n useTheme={true}\n />\n </div>\n )\n }\n cardTopButtons={\n <Box sx={{ display: 'flex', gap: 1, alignItems: 'center' }}>\n {croissantButton}\n {/* PORTALS-3386 Use synapseLink in schema to add entity to download cart */}\n {resolvedDownloadCartSynIdValue && (\n <GenericCardActionButton\n onClick={() => setShowDownloadConfirmation(val => !val)}\n variant=\"outlined\"\n startIcon={<GetAppTwoTone sx={{ height: '12px' }} />}\n loading={downloadButtonLoading}\n >\n Download\n </GenericCardActionButton>\n )}\n {includeCitation && doiValue && (\n <CitationPopover\n title={title}\n doi={doiValue}\n boilerplateText={citationBoilerplateText}\n defaultCitationFormat={defaultCitationFormat}\n />\n )}\n {includeShareButton && isHeader && (\n <ShareThisPage {...sharePageLinkButtonProps} />\n )}\n </Box>\n }\n />\n )\n}\n\nexport default TableRowGenericCard\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+LA,SAAS,GAAa,GAA+C;CACnE,IAAM,EAAE,cAAW,eAAY;CAC/B,OACE,kBAAC,QAAD,EAAA,UAAA;EACG;EAAQ;EACT,kBAAC,KAAD;GACE,QAAQ,EAAW;GACnB,KAAI;GACJ,MAAM,GAAG,EAA2B,OAAO,UAAU,EAAU,GAAG;aACnE;EAEE,CAAA;CACC,EAAA,CAAA;AAEV;AAKA,SAAgB,EAAoB,GAAiC;C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;GACyB;GACvB,kBAAkB,MAAS;EAC7B,IACA,KAAA;EAEN,eACE,GAAuB,SAAS,IAAI,KAAyB,KAAA;EAE9C;EACjB,uBAAuB;EACV;EACQ;EACF;EACF;EACjB,QAAQ;EACa;EACrB,4BAA4B,EAAQ;EACpC,gBACE,kBAAA,GAAA,EAAA,UACG,KACC,kBAAC,IAAD;GAAU,IAAI;aACZ,kBAAC,IAAD;IACE,UAAU;IACV,eAAe;IACf,mBAAmB,EAA4B,EAAK;IACpD,oBAAmB,MAAa;KAC9B,GAAyB,CAAS;IACpC;GACD,CAAA;EACO,CAAA,EAEZ,CAAA;EAEJ,kBAGE,GAAmB,SAAS,YAC5B,GAAmB,UACjB,kBAAC,OAAD;GAAK,OAAO,EAAE,WAAW,OAAO;aAC9B,kBAAC,IAAD;IACE,aAAa,EAAkB,QAAQ;IACvC,WAAW,KAAK,MAAM,CAAiB;IACvC,iBAAiB,EACf,IAAI,EAAE,UAAU,OAAO,EACzB;IACA,eAAe;IACf,UAAU;GACX,CAAA;EACE,CAAA;EAGT,gBACE,kBAAC,IAAD;GAAK,IAAI;IAAE,SAAS;IAAQ,KAAK;IAAG,YAAY;GAAS;aAAzD;IACG;IAEA,KACC,kBAAC,IAAD;KACE,eAAe,GAA4B,MAAO,CAAC,CAAG;KACtD,SAAQ;KACR,WAAW,kBAAC,IAAD,EAAe,IAAI,EAAE,QAAQ,OAAO,EAAI,CAAA;KACnD,SAAS;eACV;IAEwB,CAAA;IAE1B,MAAmB,KAClB,kBAAC,IAAD;KACS;KACP,KAAK;KACL,iBAAiB;KACM;IACxB,CAAA;IAEF,MAAsB,KACrB,kBAAC,IAAD,EAAe,GAAI,GAA2B,CAAA;GAE7C;;CAER,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"TableRowGenericCard.js","names":[],"sources":["../../../src/components/GenericCard/TableRowGenericCard.tsx"],"sourcesContent":["import { CommonCardProps } from '@/components/CardContainer/CardConfiguration'\nimport {\n getFileHandleAssociation,\n getLinkParams,\n getValueOrMultiValue,\n} from '@/components/GenericCard/CardUtils'\nimport CroissantButton from '@/components/GenericCard/CroissantButton/CroissantButton'\nimport { GenericCardIcon } from '@/components/GenericCard/GenericCardIcon'\nimport PortalDOI from '@/components/GenericCard/PortalDOI/PortalDOI'\nimport {\n getCandidateDoiId,\n useShowDoiCardLabel,\n} from '@/components/GenericCard/PortalDOI/PortalDOIUtils'\nimport { mapRowToRecord } from '@/components/SynapseTable/SynapseTableUtils'\nimport { useGetEntity } from '@/synapse-queries'\nimport { calculateFriendlyFileSize } from '@/utils/functions/calculateFriendlyFileSize'\nimport {\n isDatasetCollection,\n isTableEntity,\n} from '@/utils/functions/EntityTypeUtils'\nimport { PRODUCTION_ENDPOINT_CONFIG } from '@/utils/functions/getEndpoint'\nimport { parseSynId } from '@/utils/functions/RegularExpressions'\nimport { getColumnIndex } from '@/utils/functions/SqlFunctions'\nimport { TargetEnum } from '@/utils/html/TargetEnum'\nimport * as SynapseConstants from '@/utils/SynapseConstants'\nimport { GetAppTwoTone } from '@mui/icons-material'\nimport { Box, Collapse, Link, Stack, Typography } from '@mui/material'\nimport {\n ColumnModel,\n ColumnTypeEnum,\n Entity,\n SelectColumn,\n Table,\n} from '@sage-bionetworks/synapse-types'\nimport React, { useCallback, useMemo, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\nimport CitationPopover from '../CitationPopover'\nimport { EntityDownloadConfirmation } from '../EntityDownloadConfirmation'\nimport { HeaderCardVariant } from '../HeaderCard'\nimport IconList from '../IconList'\nimport { useQueryContext } from '../QueryContext/QueryContext'\nimport { useQueryVisualizationContext } from '../QueryVisualizationWrapper'\nimport ShareThisPage, {\n ShareThisPageProps,\n} from '../ShareThisPage/ShareThisPage'\nimport { SustainabilityScorecardProps } from '../SustainabilityScorecard/SustainabilityScorecard'\nimport GenericCard from './GenericCard'\nimport GenericCardActionButton from './GenericCardActionButton'\nimport DuoTermTags from './DuoTermTags/DuoTermTags'\nimport { parseDuoModifiers } from './DuoTermTags/duoTerms'\nimport { PortalDOIConfiguration } from './PortalDOI/PortalDOIConfiguration'\nimport { SynapseCardLabel } from './SynapseCardLabel'\nimport { useResolvedSynapseEntity } from './useResolvedSynapseEntity'\n\ntype RowSynapseEntityConfig = {\n /** Use the table rowId to resolve the Synapse entity ID. */\n id: {\n source: 'rowId'\n }\n /** Use the table rowVersionNumber to resolve the Synapse entity version (if available). */\n version?: {\n source: 'rowVersionNumber'\n }\n}\n\ntype ColumnSynapseEntityConfig = {\n /** Use a column value to resolve the Synapse entity ID. */\n id: {\n source: 'column'\n columnName: string\n }\n /** Use a column value to resolve the Synapse entity version. */\n version?: {\n source: 'column'\n columnName: string\n }\n}\n\nexport type SynapseEntityConfig =\n | RowSynapseEntityConfig\n | ColumnSynapseEntityConfig\n\n/**\n * Maps a table query result to a GenericCard.\n */\nexport type TableToGenericCardMapping = {\n /** The 'type' of resource a card refers to. Renders a label on the card with this string value.\n * Can be hidden by setting it to '' (empty string)\n */\n type: string\n /** The column name whose data contains the title of the card */\n title: string\n /** The column name whose data contains the subtitle of the card */\n subTitle?: string\n /** The column name whose data contains the description of the card */\n description?: string\n /** If true, a 'Cite As' button will be displayed for those cards with a DOI in the 'doi' column */\n includeCitation?: boolean\n /** If true, a 'Share this page' button will be displayed */\n includeShareButton?: boolean\n /**\n * Configuration for displaying the SustainabilityScorecard component\n */\n sustainabilityScorecard?: SustainabilityScorecardProps\n /** The initial citation format to use in the 'Cite As' UI */\n defaultCitationFormat?: 'bibtex' | 'apa' | 'ieee' | 'nature' | 'science'\n /** Static text displayed in the 'Cite As' UI */\n citationBoilerplateText?: string\n /** The column name whose data contains the value used to map to the icon */\n icon?: string\n /** The column name whose data contains an image file handle to be displayed on the card */\n imageFileHandleColumnName?: string\n /** Static boolean value used if the image displayed using `imageFileHandleColumnName` requires extra padding */\n thumbnailRequiresPadding?: boolean\n /** Array of column names to be used for labels in the Card Footer */\n secondaryLabels?: string[]\n /** Can be used to add a custom secondary label */\n customSecondaryLabelConfig?: {\n /** The displayed label key */\n key: string\n /** The value to display */\n value: React.ReactNode\n /** Callback to determine visibility of the label\n * @param schema the mapping of columnName to data index\n * @param data the row data\n */\n isVisible: (schema: Record<string, number>, data: string[]) => boolean\n }\n /** Column name of the link value if the title should be linked */\n link?: string\n /** Column name of the STRING_LIST column that includes icon names that represent icons that should be displayed on the card */\n dataTypeIconNames?: string\n /**\n * Ordered list of column names to display to the right of the title area.\n * Each renders as \"Display Name: Value\" on its own line. Rows with empty values are skipped.\n * The display name is derived from getColumnDisplayName (respects column aliases and unCamelCase).\n *\n * Can also be a function that receives the schema and row data and returns the list of column\n * names to display, allowing the displayed details to vary based on the row's actual values.\n */\n titleAreaDetails?:\n | string[]\n | ((schema: Record<string, number>, data: string[]) => string[])\n /** Configuration for resolving the Synapse entity ID/version represented by each card row.\n * The ID and version sources must both reference either row-based values or column-based values.\n */\n synapseEntityConfig?: SynapseEntityConfig\n /** The column name whose data contains a synId that can be used to show a button to add the corresponding entity to the download cart. */\n downloadCartSynId?: string\n /** Configuration to display a DOI, as well as the ability to create one for users with such permission */\n portalDoiConfiguration?: PortalDOIConfiguration\n /**\n * Column name of a STRING_LIST of Data Use Ontology (DUO) values (ontology\n * codes or term names). When set, the values are rendered as DUO tags in a\n * metadata row labeled with the column's display name, so the card matches the\n * corresponding facet.\n */\n dataUseModifiersColumnName?: string\n}\n\nexport type TableRowGenericCardProps = {\n /** The schema that maps a table result to the GenericCard UI */\n genericCardSchema: TableToGenericCardMapping\n /** The table's SelectColumns */\n selectColumns?: SelectColumn[]\n /** The table's ColumnModels */\n columnModels?: ColumnModel[]\n /** If true, the 'type' column will be used as the icon string to choose the icon */\n useTypeColumnForIcon?: boolean\n /** If true, render the card as a HeaderCard */\n isHeader?: boolean\n /** If isHeader is true, use this variant of HeaderCard */\n headerCardVariant?: HeaderCardVariant\n isAlignToLeftNav?: boolean\n /** Mapping of column name to row data index */\n schema: Record<string, number>\n /** The row data */\n data: string[]\n /** The ID of the table row */\n rowId?: number\n /** The versionNumber of the table row */\n versionNumber?: number\n /** Optional props for the ShareThisPage component */\n sharePageLinkButtonProps?: ShareThisPageProps\n /** Optional function that receives schema and data and returns a ReactNode to be rendered next to the card type */\n CardTypeAdornment?: React.ComponentType<{\n schema: Record<string, number>\n data: string[]\n }>\n} & CommonCardProps\n\n// SWC-6115: special rendering of the version column (for Views)\nfunction VersionLabel(props: { synapseId: string; version: string }) {\n const { synapseId, version } = props\n return (\n <span>\n {version} \n <a\n target={TargetEnum.NEW_WINDOW}\n rel=\"noopener noreferrer\"\n href={`${PRODUCTION_ENDPOINT_CONFIG.PORTAL}Synapse:${synapseId}.${version}`}\n >\n (Show Version History on Synapse)\n </a>\n </span>\n )\n}\n\n/**\n * Maps a table row to a GenericCard.\n */\nexport function TableRowGenericCard(props: TableRowGenericCardProps) {\n const [showDownloadConfirmation, setShowDownloadConfirmation] =\n useState(false)\n const [downloadButtonLoading, setDownloadButtonLoading] = useState(false)\n\n const { entityId, versionNumber } = useQueryContext()\n const { getColumnDisplayName } = useQueryVisualizationContext()\n\n const { ref, inView: cardIsInView } = useInView()\n\n const { data: table } = useGetEntity<Table>(entityId, versionNumber)\n\n const {\n schema,\n data,\n rowId,\n versionNumber: rowVersionNumber,\n genericCardSchema,\n secondaryLabelLimit,\n sharePageLinkButtonProps,\n selectColumns,\n columnModels,\n iconOptions,\n useTypeColumnForIcon = false,\n isHeader = false,\n sustainabilityScorecard,\n headerCardVariant,\n titleLinkConfig,\n ctaLinkConfig,\n ctaLinkPosition,\n labelLinkConfig,\n descriptionConfig,\n columnIconOptions,\n CardTypeAdornment,\n charCountCutoff,\n } = props\n\n const {\n link = '',\n type,\n includeCitation,\n includeShareButton,\n defaultCitationFormat,\n citationBoilerplateText,\n downloadCartSynId,\n portalDoiConfiguration,\n } = genericCardSchema\n const title = data[schema[genericCardSchema.title]]\n let subTitle =\n genericCardSchema.subTitle && data[schema[genericCardSchema.subTitle]]\n subTitle =\n genericCardSchema.subTitle &&\n getValueOrMultiValue({\n value: subTitle,\n columnName: genericCardSchema.subTitle,\n selectColumns,\n columnModels,\n }).str\n const description = data[schema[genericCardSchema.description || '']]\n const iconValue = data[schema[genericCardSchema.icon || '']]\n const dataTypeIconNames =\n data[schema[genericCardSchema.dataTypeIconNames || '']]\n const imageFileHandleIdValue =\n data[schema[genericCardSchema.imageFileHandleColumnName || '']]\n const titleColumnModel = columnModels?.find(\n el => genericCardSchema.link === el.name,\n )\n const titleColumnType = titleColumnModel?.columnType\n // wrap link in parens because undefined would throw an error\n const linkValue: string = data[schema[link]] || ''\n const { href, target } = getLinkParams(\n linkValue,\n titleLinkConfig,\n data,\n schema,\n rowId,\n )\n\n const synapseEntityConfig = genericCardSchema.synapseEntityConfig\n\n const getColumnValue = useCallback(\n (columnName?: string) => {\n if (!columnName) {\n return undefined\n }\n const columnIndex = schema[columnName]\n if (columnIndex === undefined) {\n return undefined\n }\n return data[columnIndex]\n },\n [schema, data],\n )\n\n // DUO (Data Use Ontology) tags, when a dataUseModifiers column is configured.\n // Rendered as a metadata row labeled with the column's display name.\n const duoContent = useMemo(() => {\n const col = genericCardSchema.dataUseModifiersColumnName\n if (!col) {\n return undefined\n }\n const terms = parseDuoModifiers(data[schema[col]])\n if (terms.length === 0) {\n return undefined\n }\n return <DuoTermTags terms={terms} />\n }, [genericCardSchema, data, schema])\n\n const resolvedTitleAreaRightContent = useMemo(() => {\n const { titleAreaDetails } = genericCardSchema\n if (!titleAreaDetails) return undefined\n const columns =\n typeof titleAreaDetails === 'function'\n ? titleAreaDetails(schema, data)\n : titleAreaDetails\n if (columns.length === 0) return undefined\n const rows = columns\n .map(columnName => {\n const rawValue: string | undefined = data[schema[columnName]]\n if (!rawValue) return null\n return { name: getColumnDisplayName(columnName), rawValue, columnName }\n })\n .filter(Boolean) as {\n name: string\n rawValue: string\n columnName: string\n }[]\n if (rows.length === 0) return undefined\n return (\n <Stack direction=\"column\" gap=\"4px\">\n {rows.map(({ name, rawValue, columnName }) => (\n <Stack key={columnName} direction=\"row\" gap=\"4px\" alignItems=\"center\">\n <Typography component=\"span\" variant=\"body1\">\n {name}:\n </Typography>\n <SynapseCardLabel\n value={rawValue}\n columnName={columnName}\n labelLink={undefined}\n isHeader={isHeader}\n selectColumns={selectColumns}\n columnModels={columnModels}\n rowData={data}\n columnIconOptions={columnIconOptions}\n />\n </Stack>\n ))}\n </Stack>\n )\n }, [\n genericCardSchema,\n data,\n schema,\n getColumnDisplayName,\n isHeader,\n selectColumns,\n columnModels,\n columnIconOptions,\n ])\n\n const {\n entityId: resolvedSynapseEntityId,\n entityVersionNumber: resolvedSynapseEntityVersionNumber,\n } = useResolvedSynapseEntity({\n synapseEntityConfig,\n getColumnValue,\n rowId,\n rowVersionNumber,\n })\n\n let resolvedDownloadCartSynIdValue = resolvedSynapseEntityId\n let resolvedDownloadCartVersionNumber = resolvedSynapseEntityVersionNumber\n\n if (downloadCartSynId) {\n const reference = parseSynId(getColumnValue(downloadCartSynId) ?? '')\n resolvedDownloadCartSynIdValue = reference?.targetId\n resolvedDownloadCartVersionNumber = reference?.targetVersionNumber\n }\n\n // Transform the row to a record of (columnName, value) pairs for compatibility with getCandidateDoiId\n const dataAsRecord: Record<string, string | null> = useMemo(\n () => mapRowToRecord(data, schema),\n [data, schema],\n )\n\n const candidateDoiId = getCandidateDoiId({\n data: dataAsRecord,\n portalDoiConfiguration,\n })\n\n const showDoiCardLabel = useShowDoiCardLabel({\n portalId: portalDoiConfiguration?.portalId,\n resourceId: candidateDoiId,\n })\n\n const values: {\n columnDisplayName: string\n value: React.ReactNode\n columnName?: string\n }[] = []\n const { secondaryLabels = [] } = genericCardSchema\n const customLabelConfig = genericCardSchema.customSecondaryLabelConfig\n\n // DUO tags rendered as a metadata row (alongside \"How to download\", size, …).\n // Label it with the DUO column's display name so the card row matches the\n // facet exactly (respecting any column alias) rather than a hardcoded string.\n if (duoContent && genericCardSchema.dataUseModifiersColumnName) {\n values.push({\n columnName: genericCardSchema.dataUseModifiersColumnName,\n columnDisplayName: getColumnDisplayName(\n genericCardSchema.dataUseModifiersColumnName,\n ),\n value: duoContent,\n })\n }\n\n // PORTALS-3549 - if a DOI exists or can be created by the current user, show it\n if (\n showDoiCardLabel &&\n portalDoiConfiguration &&\n candidateDoiId &&\n cardIsInView\n ) {\n values.push({\n columnDisplayName: 'DOI',\n value: (\n <PortalDOI\n portalId={portalDoiConfiguration.portalId}\n resourceId={candidateDoiId}\n />\n ),\n })\n }\n\n // Overwrite the 'HOW TO DOWNLOAD' link if a synapse ID is available\n if (customLabelConfig?.isVisible(schema, data)) {\n const { key, value } = customLabelConfig\n if (resolvedDownloadCartSynIdValue) {\n values.push({\n columnDisplayName: 'HOW TO DOWNLOAD',\n value: (\n <Link onClick={() => setShowDownloadConfirmation(val => !val)}>\n Click here to add to Synapse download list\n </Link>\n ),\n })\n } else {\n values.push({ columnDisplayName: key, value })\n }\n }\n\n const isView = table && !isTableEntity(table)\n for (let i = 0; i < secondaryLabels.length; i += 1) {\n const columnName = secondaryLabels[i]\n const rawValue: string | undefined = data[schema[columnName]]\n let renderedValue: React.ReactNode = rawValue\n let columnDisplayName\n if (renderedValue && rawValue !== '[]' && rawValue !== '[\"\"]') {\n // PORTALS-2750: special rendering of the datasetSizeInBytes (for Dataset Collections)\n if (\n isDatasetCollection(table as Entity) &&\n columnName === 'datasetSizeInBytes'\n ) {\n columnDisplayName = 'Size'\n renderedValue = calculateFriendlyFileSize(parseInt(rawValue))\n } // SWC-6115: special rendering of the version column (for Views)\n else if (isView && columnName === 'currentVersion') {\n const synapseId = data[schema.id]\n renderedValue = (\n <VersionLabel synapseId={synapseId} version={rawValue} />\n )\n columnDisplayName = 'Version'\n } else {\n const labelLink = labelLinkConfig?.find(\n el => el.matchColumnName === columnName,\n )\n renderedValue = (\n <SynapseCardLabel\n value={rawValue}\n columnName={columnName}\n labelLink={labelLink}\n isHeader={isHeader}\n selectColumns={selectColumns}\n columnModels={columnModels}\n rowData={data}\n columnIconOptions={columnIconOptions}\n />\n )\n columnDisplayName = getColumnDisplayName(columnName)\n }\n values.push({ columnDisplayName, value: renderedValue, columnName })\n }\n }\n\n const fileHandleId = imageFileHandleIdValue || linkValue\n\n /**\n * To show a direct download link to a file, we need to determine the association that gives permission to download the file.\n */\n const fileHandleAssociation = getFileHandleAssociation(\n table,\n fileHandleId,\n data[schema.id],\n )\n\n const descriptionSubTitle = getColumnDisplayName(\n genericCardSchema.description || '',\n )\n\n const doiColumnIndex = getColumnIndex('doi', selectColumns, columnModels)\n const doiValue =\n doiColumnIndex !== undefined ? data[doiColumnIndex] : undefined\n\n // Normalize ctaLinkConfig to array and resolve each config\n const ctaLinkConfigs = ctaLinkConfig\n ? Array.isArray(ctaLinkConfig)\n ? ctaLinkConfig\n : [ctaLinkConfig]\n : []\n const resolvedCtaLinkConfigs = ctaLinkConfigs\n .map(config => {\n const ctaLinkValue: string = data[schema[config.link]] || ''\n if (!ctaLinkValue) return null\n const { href, target } = getLinkParams(\n ctaLinkValue,\n undefined, //card link config\n data,\n schema,\n rowId,\n )\n return {\n text: config.endIcon ? (\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n {config.text}\n {config.endIcon}\n </div>\n ) : (\n config.text\n ),\n href,\n target,\n }\n })\n .filter(Boolean) as { text: string; href: string; target?: string }[]\n\n let croissantButton = <></>\n if (\n resolvedSynapseEntityId != null &&\n resolvedSynapseEntityVersionNumber != null\n ) {\n croissantButton = (\n <CroissantButton\n datasetId={resolvedSynapseEntityId}\n datasetVersionNumber={resolvedSynapseEntityVersionNumber}\n />\n )\n }\n\n const resolvedCardTypeAdornment = CardTypeAdornment ? (\n <CardTypeAdornment schema={schema} data={data} />\n ) : null\n\n let isRenderingIcon = true\n if (isHeader && !imageFileHandleIdValue && !iconValue) {\n // For header cards, if there is no image or explicit icon value, we don't show an icon at all\n isRenderingIcon = false\n }\n const iconNode = isRenderingIcon ? (\n <GenericCardIcon\n type={\n useTypeColumnForIcon ? data[schema['type']] : genericCardSchema.type\n }\n useTypeForIcon={useTypeColumnForIcon}\n thumbnailRequiresPadding={genericCardSchema.thumbnailRequiresPadding}\n imageFileHandleId={imageFileHandleIdValue}\n fileHandleAssociation={fileHandleAssociation}\n iconOptions={iconOptions}\n iconValue={iconValue}\n />\n ) : undefined\n return (\n <GenericCard\n ref={ref}\n icon={iconNode}\n isHeader={isHeader}\n sustainabilityScorecard={sustainabilityScorecard}\n headerCardVariant={headerCardVariant}\n type={type}\n title={title}\n subtitle={subTitle}\n titleLinkConfiguration={{ target, href }}\n cardTypeAdornment={resolvedCardTypeAdornment}\n titleAsFileHandleLinkConfiguration={\n !titleLinkConfig &&\n titleColumnType === ColumnTypeEnum.FILEHANDLEID &&\n fileHandleAssociation\n ? {\n fileHandleAssociation: fileHandleAssociation,\n showDownloadIcon: type !== SynapseConstants.EXPERIMENTAL,\n }\n : undefined\n }\n ctaLinkConfig={\n resolvedCtaLinkConfigs.length > 0 ? resolvedCtaLinkConfigs : undefined\n }\n ctaLinkPosition={ctaLinkPosition}\n titleAreaRightContent={resolvedTitleAreaRightContent}\n description={description}\n descriptionSubTitle={descriptionSubTitle}\n descriptionConfig={descriptionConfig}\n charCountCutoff={charCountCutoff}\n labels={values}\n secondaryLabelLimit={secondaryLabelLimit}\n useStylesForDisplayedImage={Boolean(imageFileHandleIdValue)}\n cardTopContent={\n <>\n {resolvedDownloadCartSynIdValue && (\n <Collapse in={showDownloadConfirmation}>\n <EntityDownloadConfirmation\n entityId={resolvedDownloadCartSynIdValue}\n versionNumber={resolvedDownloadCartVersionNumber}\n handleClose={() => setShowDownloadConfirmation(false)}\n onIsLoadingChange={isLoading => {\n setDownloadButtonLoading(isLoading)\n }}\n />\n </Collapse>\n )}\n </>\n }\n renderedIconList={\n // If the portal configs has columnIconOptions.columns.dataType option\n // and the column value is not null, display the card data type icons\n columnIconOptions?.columns?.dataType &&\n dataTypeIconNames?.length && (\n <div style={{ marginTop: '20px' }}>\n <IconList\n iconConfigs={columnIconOptions.columns.dataType}\n iconNames={JSON.parse(dataTypeIconNames) as string[]}\n commonIconProps={{\n sx: { fontSize: '40px' },\n }}\n useBackground={true}\n useTheme={true}\n />\n </div>\n )\n }\n cardTopButtons={\n <Box sx={{ display: 'flex', gap: 1, alignItems: 'center' }}>\n {croissantButton}\n {/* PORTALS-3386 Use synapseLink in schema to add entity to download cart */}\n {resolvedDownloadCartSynIdValue && (\n <GenericCardActionButton\n onClick={() => setShowDownloadConfirmation(val => !val)}\n variant=\"outlined\"\n startIcon={<GetAppTwoTone sx={{ height: '12px' }} />}\n loading={downloadButtonLoading}\n >\n Download\n </GenericCardActionButton>\n )}\n {includeCitation && doiValue && (\n <CitationPopover\n title={title}\n doi={doiValue}\n boilerplateText={citationBoilerplateText}\n defaultCitationFormat={defaultCitationFormat}\n />\n )}\n {includeShareButton && isHeader && (\n <ShareThisPage {...sharePageLinkButtonProps} />\n )}\n </Box>\n }\n />\n )\n}\n\nexport default TableRowGenericCard\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgMA,SAAS,GAAa,GAA+C;CACnE,IAAM,EAAE,cAAW,eAAY;CAC/B,OACE,kBAAC,QAAD,EAAA,UAAA;EACG;EAAQ;EACT,kBAAC,KAAD;GACE,QAAQ,EAAW;GACnB,KAAI;GACJ,MAAM,GAAG,EAA2B,OAAO,UAAU,EAAU,GAAG;aACnE;EAEE,CAAA;CACC,EAAA,CAAA;AAEV;AAKA,SAAgB,EAAoB,GAAiC;CACnE,IAAM,CAAC,GAA0B,KAC/B,EAAS,EAAK,GACV,CAAC,IAAuB,MAA4B,EAAS,EAAK,GAElE,EAAE,cAAU,sBAAkB,GAAgB,GAC9C,EAAE,4BAAyB,GAA6B,GAExD,EAAE,SAAK,QAAQ,OAAiB,GAAU,GAE1C,EAAE,MAAM,MAAU,GAAoB,IAAU,EAAa,GAE7D,EACJ,WACA,SACA,UACA,eAAe,IACf,sBACA,yBACA,8BACA,kBACA,iBACA,iBACA,0BAAuB,IACvB,cAAW,IACX,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,CAAC,EAAE,OAAO,CAAA;CACb,CAAA;AAiND,QAAA,MAAM,UAAU,4GASd,CAAA;AAEF,eAAe,UAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderCard.js","names":[],"sources":["../../src/components/HeaderCard.tsx"],"sourcesContent":["import { CardLabel } from '@/components/row_renderers/utils/CardFooter'\nimport { Box, Container, SxProps } from '@mui/material'\nimport { SmartLink } from './SmartLink/SmartLink'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { FileHandleLink } from './widgets/FileHandleLink'\nimport { GenericCardProps } from '@/components/GenericCard/GenericCard'\nimport { CardFooter } from './row_renderers/utils'\nimport { DescriptionConfig } from './CardContainerLogic'\nimport { CollapsibleDescription } from './GenericCard/CollapsibleDescription'\nimport HeaderCardV2 from './HeaderCard/HeaderCardV2'\nimport SustainabilityScorecard, {\n SustainabilityScorecardProps,\n} from './SustainabilityScorecard/SustainabilityScorecard'\nimport { useDocumentMetadata } from '@/utils/context/DocumentMetadataContext'\nimport { AdaptiveTwoColumnLayout } from './AdaptiveTwoColumnLayout/AdaptiveTwoColumnLayout'\n\nexport type HeaderCardVariant = 'HeaderCard' | 'HeaderCardV2'\n\nexport type HeaderCardProps = {\n type: string\n title: string\n subTitle?: string\n description: string\n secondaryLabelLimit?: number\n values?: CardLabel[]\n isAlignToLeftNav?: boolean\n descriptionConfig?: DescriptionConfig\n charCountCutoff?: number\n href?: string\n target?: string\n titleAsFileHandleLinkConfiguration?: GenericCardProps['titleAsFileHandleLinkConfiguration']\n titleAreaRightContent?: React.ReactNode\n descriptionSubTitle?: string\n icon: React.ReactNode\n headerCardVariant?: HeaderCardVariant\n cardTopContent?: React.ReactNode\n ctaLinkConfig?: GenericCardProps['ctaLinkConfig']\n cardTopButtons?: React.ReactNode\n sustainabilityScorecard?: SustainabilityScorecardProps\n renderedIconList?: React.ReactNode\n cardTypeAdornment?: React.ReactNode\n doiUri?: string\n sx?: SxProps\n}\n\nconst HeaderCardClassic = forwardRef(function HeaderCardClassic(\n props: HeaderCardProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const {\n type,\n title,\n subTitle = '',\n description,\n values,\n secondaryLabelLimit,\n isAlignToLeftNav,\n descriptionConfig,\n descriptionSubTitle = '',\n href,\n target,\n titleAsFileHandleLinkConfiguration,\n titleAreaRightContent,\n icon,\n cardTopContent,\n cardTopButtons,\n sustainabilityScorecard,\n renderedIconList,\n cardTypeAdornment,\n sx,\n } = props\n\n const descriptionConfiguration: DescriptionConfig = {\n ...descriptionConfig,\n showFullDescriptionByDefault:\n descriptionConfig?.showFullDescriptionByDefault ?? false,\n }\n\n const metadataDescription = description || subTitle || undefined\n useDocumentMetadata({\n title,\n description: metadataDescription,\n priority: 100,\n })\n\n return (\n <Box\n ref={ref}\n className={`SRC-portalCard SRC-portalCardHeader ${\n isAlignToLeftNav ? 'isAlignToLeftNav' : ''\n }`}\n sx={{\n // Break out of any constrained parent (e.g. margin:auto containers)\n // so the background stretches full-viewport width.\n width: '100vw',\n marginLeft: 'calc(50% - 50vw)',\n ...sx,\n }}\n >\n <Container maxWidth=\"lg\">\n {/* Row 1: type, cardTypeAdornment, cardTopButtons */}\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n gap: '10px',\n }}\n >\n <div className=\"SRC-type\">{type}</div>\n {cardTypeAdornment}\n <Box sx={{ flex: 1 }} />\n {cardTopButtons && (\n <Box sx={{ display: 'flex', gap: '10px' }}>{cardTopButtons}</Box>\n )}\n </Box>\n\n {/* Row 2: Title */}\n <Box>\n <h3 className=\"SRC-boldText\" style={{ margin: 'none' }}>\n {titleAsFileHandleLinkConfiguration ? (\n <FileHandleLink\n fileHandleAssociation={\n titleAsFileHandleLinkConfiguration.fileHandleAssociation\n }\n showDownloadIcon={\n titleAsFileHandleLinkConfiguration.showDownloadIcon\n }\n displayValue={title}\n />\n ) : href ? (\n <SmartLink\n href={href ?? ''}\n className=\"highlight-link\"\n target={target}\n >\n {title}\n </SmartLink>\n ) : (\n <span>{title}</span>\n )}\n </h3>\n </Box>\n\n {/* Row 3: renderedIconList */}\n {renderedIconList && (\n <Box\n sx={{\n '& .icon-list.themed path, & .icon-list.themed circle': {\n fill: 'white',\n },\n }}\n >\n {renderedIconList}\n </Box>\n )}\n\n {/* Row 4: left content, optionally alongside right content in an adaptive two-column layout */}\n {(() => {\n const leftContent = (\n <>\n {/* Column 1: icon (floated left) with subTitle and description flowing around */}\n {icon && (\n <Box\n sx={{\n width: '120px',\n float: 'left',\n paddingRight: '24px',\n paddingBottom: '24px',\n display: 'flex',\n justifyContent: 'center',\n }}\n >\n {icon}\n </Box>\n )}\n {subTitle && <div className=\"SRC-author\">{subTitle}</div>}\n <CollapsibleDescription\n description={description}\n descriptionSubTitle={descriptionSubTitle}\n descriptionConfig={descriptionConfiguration}\n />\n {sustainabilityScorecard && (\n <SustainabilityScorecard\n metricsConfig={sustainabilityScorecard.metricsConfig}\n searchParamKey={sustainabilityScorecard.searchParamKey}\n filterColumn={sustainabilityScorecard.filterColumn}\n scoreDescriptorColumnName={\n sustainabilityScorecard.scoreDescriptorColumnName\n }\n queryRequest={sustainabilityScorecard.queryRequest}\n sustainabilityReportLink={\n sustainabilityScorecard.sustainabilityReportLink\n }\n sx={{\n background: 'rgba(0, 0, 0, 0.10)',\n marginTop: '30px',\n ...sustainabilityScorecard.sx,\n }}\n />\n )}\n <Box sx={{ clear: 'both', pb: 'var(--baseline-grid)' }} />\n </>\n )\n\n const rightContent =\n titleAreaRightContent || cardTopContent || values?.length ? (\n /* Column 2: titleAreaRightContent, cardTopContent, CardFooter */\n <>\n {titleAreaRightContent && (\n <div className=\"SRC-cardTitleAreaDetails\">\n {titleAreaRightContent}\n </div>\n )}\n {cardTopContent && (\n <div className=\"SRC-cardContent\">{cardTopContent}</div>\n )}\n {values && (\n <Box sx={{ '&& .SRC-cardMetadata': { paddingTop: 0 } }}>\n <CardFooter\n isHeader={true}\n secondaryLabelLimit={secondaryLabelLimit}\n values={values}\n />\n </Box>\n )}\n </>\n ) : undefined\n\n return rightContent ? (\n <AdaptiveTwoColumnLayout\n stackRatioThreshold={0.45}\n sx={{ marginTop: '24px' }}\n leftContent={leftContent}\n rightContent={rightContent}\n />\n ) : (\n <Box sx={{ marginTop: '24px' }}>{leftContent}</Box>\n )\n })()}\n </Container>\n </Box>\n )\n})\n\nconst HeaderCard = forwardRef(function HeaderCard(\n props: HeaderCardProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { headerCardVariant = 'HeaderCard' } = props\n if (headerCardVariant === 'HeaderCardV2') {\n return <HeaderCardV2 {...props} ref={ref} />\n }\n return <HeaderCardClassic {...props} ref={ref} />\n})\n\nexport default HeaderCard\n"],"mappings":";;;;;;;;;;;;;AA6CA,IAAM,IAAoB,EAAW,SACnC,GACA,GACA;CACA,IAAM,EACJ,SACA,UACA,cAAW,IACX,gBACA,WACA,wBACA,qBACA,sBACA,yBAAsB,IACtB,SACA,WACA,uCACA,0BACA,SACA,mBACA,mBACA,4BACA,qBACA,sBACA,UACE,GAEE,IAA8C;EAClD,GAAG;EACH,8BACE,GAAmB,gCAAgC;CACvD;CASA,OANA,EAAoB;EAClB;EACA,aAH0B,KAAe,KAAY,KAAA;EAIrD,UAAU;CACZ,CAAC,GAGC,kBAAC,GAAD;EACO;EACL,WAAW,uCACT,IAAmB,qBAAqB;EAE1C,IAAI;GAGF,OAAO;GACP,YAAY;GACZ,GAAG;EACL;YAEA,kBAAC,GAAD;GAAW,UAAS;aAApB;IAEE,kBAAC,GAAD;KACE,IAAI;MACF,SAAS;MACT,eAAe;MACf,YAAY;MACZ,KAAK;KACP;eANF;MAQE,kBAAC,OAAD;OAAK,WAAU;iBAAY;MAAU,CAAA;MACpC;MACD,kBAAC,GAAD,EAAK,IAAI,EAAE,MAAM,EAAE,EAAI,CAAA;MACtB,KACC,kBAAC,GAAD;OAAK,IAAI;QAAE,SAAS;QAAQ,KAAK;OAAO;iBAAI;MAAoB,CAAA;KA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AAE,YAAY,EAAE,EAAE;iBACnD,kBAAC,GAAD;QACE,UAAU;QACW;QACb;OACT,CAAA;MACE,CAAA;KAEP,EAAA,CAAA,IACA,KAAA;KAEN,OAAO,IACL,kBAAC,GAAD;MACE,qBAAqB;MACrB,IAAI,EAAE,WAAW,OAAO;MACX;MACC;KACf,CAAA,IAED,kBAAC,GAAD;MAAK,IAAI,EAAE,WAAW,OAAO;gBAAI;KAAiB,CAAA;IAEtD,GAAG;GACM;;CACR,CAAA;AAET,CAAC,GAEK,IAAa,EAAW,SAC5B,GACA,GACA;CACA,IAAM,EAAE,uBAAoB,iBAAiB;CAI7C,OAFS,EADL,MAAsB,iBAChB,IAEF,GAFC;EAAc,GAAI;EAAY;CAAM,CAAA;AAG/C,CAAC"}
|
|
1
|
+
{"version":3,"file":"HeaderCard.js","names":[],"sources":["../../src/components/HeaderCard.tsx"],"sourcesContent":["import { CardLabel } from '@/components/row_renderers/utils/CardFooter'\nimport { Box, Container, SxProps } from '@mui/material'\nimport { SmartLink } from './SmartLink/SmartLink'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { FileHandleLink } from './widgets/FileHandleLink'\nimport { GenericCardProps } from '@/components/GenericCard/GenericCard'\nimport { CardFooter } from './row_renderers/utils'\nimport { DescriptionConfig } from './CardContainerLogic'\nimport { CollapsibleDescription } from './GenericCard/CollapsibleDescription'\nimport HeaderCardV2 from './HeaderCard/HeaderCardV2'\nimport SustainabilityScorecard, {\n SustainabilityScorecardProps,\n} from './SustainabilityScorecard/SustainabilityScorecard'\nimport { useDocumentMetadata } from '@/utils/context/DocumentMetadataContext'\nimport { AdaptiveTwoColumnLayout } from './AdaptiveTwoColumnLayout/AdaptiveTwoColumnLayout'\n\nexport type HeaderCardVariant = 'HeaderCard' | 'HeaderCardV2'\n\nexport type HeaderCardProps = {\n type: string\n title: string\n subTitle?: string\n description: string\n secondaryLabelLimit?: number\n values?: CardLabel[]\n isAlignToLeftNav?: boolean\n descriptionConfig?: DescriptionConfig\n charCountCutoff?: number\n href?: string\n target?: string\n titleAsFileHandleLinkConfiguration?: GenericCardProps['titleAsFileHandleLinkConfiguration']\n titleAreaRightContent?: React.ReactNode\n descriptionSubTitle?: string\n icon: React.ReactNode\n headerCardVariant?: HeaderCardVariant\n cardTopContent?: React.ReactNode\n ctaLinkConfig?: GenericCardProps['ctaLinkConfig']\n cardTopButtons?: React.ReactNode\n sustainabilityScorecard?: SustainabilityScorecardProps\n renderedIconList?: React.ReactNode\n cardTypeAdornment?: React.ReactNode\n doiUri?: string\n sx?: SxProps\n}\n\nconst HeaderCardClassic = forwardRef(function HeaderCardClassic(\n props: HeaderCardProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const {\n type,\n title,\n subTitle = '',\n description,\n values,\n secondaryLabelLimit,\n isAlignToLeftNav,\n descriptionConfig,\n descriptionSubTitle = '',\n href,\n target,\n titleAsFileHandleLinkConfiguration,\n titleAreaRightContent,\n icon,\n cardTopContent,\n cardTopButtons,\n sustainabilityScorecard,\n renderedIconList,\n cardTypeAdornment,\n sx,\n } = props\n\n const descriptionConfiguration: DescriptionConfig = {\n ...descriptionConfig,\n showFullDescriptionByDefault:\n descriptionConfig?.showFullDescriptionByDefault ?? false,\n }\n\n const metadataDescription = description || subTitle || undefined\n useDocumentMetadata({\n title,\n description: metadataDescription,\n priority: 100,\n })\n\n return (\n <Box\n ref={ref}\n className={`SRC-portalCard SRC-portalCardHeader ${\n isAlignToLeftNav ? 'isAlignToLeftNav' : ''\n }`}\n sx={{\n // Break out of any constrained parent (e.g. margin:auto containers)\n // so the background stretches full-viewport width.\n width: '100vw',\n marginLeft: 'calc(50% - 50vw)',\n ...sx,\n }}\n >\n <Container maxWidth=\"lg\">\n {/* Row 1: type, cardTypeAdornment, cardTopButtons */}\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n gap: '10px',\n }}\n >\n <div className=\"SRC-type\">{type}</div>\n {cardTypeAdornment}\n <Box sx={{ flex: 1 }} />\n {cardTopButtons && (\n <Box sx={{ display: 'flex', gap: '10px' }}>{cardTopButtons}</Box>\n )}\n </Box>\n\n {/* Row 2: Title */}\n <Box>\n <h3 className=\"SRC-boldText\" style={{ margin: 'none' }}>\n {titleAsFileHandleLinkConfiguration ? (\n <FileHandleLink\n fileHandleAssociation={\n titleAsFileHandleLinkConfiguration.fileHandleAssociation\n }\n showDownloadIcon={\n titleAsFileHandleLinkConfiguration.showDownloadIcon\n }\n displayValue={title}\n />\n ) : href ? (\n <SmartLink\n href={href ?? ''}\n className=\"highlight-link\"\n target={target}\n >\n {title}\n </SmartLink>\n ) : (\n <span>{title}</span>\n )}\n </h3>\n </Box>\n\n {/* Row 3: renderedIconList */}\n {renderedIconList && (\n <Box\n sx={{\n '& .icon-list.themed path, & .icon-list.themed circle': {\n fill: 'white',\n },\n }}\n >\n {renderedIconList}\n </Box>\n )}\n\n {/* Row 4: left content, optionally alongside right content in an adaptive two-column layout */}\n {(() => {\n const leftContent = (\n <>\n {/* Column 1: icon (floated left) with subTitle and description flowing around */}\n {icon && (\n <Box\n sx={{\n width: '120px',\n float: 'left',\n paddingRight: '24px',\n paddingBottom: '24px',\n display: 'flex',\n justifyContent: 'center',\n }}\n >\n {icon}\n </Box>\n )}\n {subTitle && (\n <div\n className=\"SRC-author\"\n style={{ fontStyle: 'italic', marginBottom: '10px' }}\n >\n {subTitle}\n </div>\n )}\n <CollapsibleDescription\n description={description}\n descriptionSubTitle={descriptionSubTitle}\n descriptionConfig={descriptionConfiguration}\n />\n {sustainabilityScorecard && (\n <SustainabilityScorecard\n metricsConfig={sustainabilityScorecard.metricsConfig}\n searchParamKey={sustainabilityScorecard.searchParamKey}\n filterColumn={sustainabilityScorecard.filterColumn}\n scoreDescriptorColumnName={\n sustainabilityScorecard.scoreDescriptorColumnName\n }\n queryRequest={sustainabilityScorecard.queryRequest}\n sustainabilityReportLink={\n sustainabilityScorecard.sustainabilityReportLink\n }\n sx={{\n background: 'rgba(0, 0, 0, 0.10)',\n marginTop: '30px',\n ...sustainabilityScorecard.sx,\n }}\n />\n )}\n <Box sx={{ clear: 'both', pb: 'var(--baseline-grid)' }} />\n </>\n )\n\n const rightContent =\n titleAreaRightContent || cardTopContent || values?.length ? (\n /* Column 2: titleAreaRightContent, cardTopContent, CardFooter */\n <>\n {titleAreaRightContent && (\n <div className=\"SRC-cardTitleAreaDetails\">\n {titleAreaRightContent}\n </div>\n )}\n {cardTopContent && (\n <div className=\"SRC-cardContent\">{cardTopContent}</div>\n )}\n {values && (\n <Box sx={{ '&& .SRC-cardMetadata': { paddingTop: 0 } }}>\n <CardFooter\n isHeader={true}\n secondaryLabelLimit={secondaryLabelLimit}\n values={values}\n />\n </Box>\n )}\n </>\n ) : undefined\n\n return rightContent ? (\n <AdaptiveTwoColumnLayout\n stackRatioThreshold={0.45}\n sx={{ marginTop: '24px' }}\n leftContent={leftContent}\n rightContent={rightContent}\n />\n ) : (\n <Box sx={{ marginTop: '24px' }}>{leftContent}</Box>\n )\n })()}\n </Container>\n </Box>\n )\n})\n\nconst HeaderCard = forwardRef(function HeaderCard(\n props: HeaderCardProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { headerCardVariant = 'HeaderCard' } = props\n if (headerCardVariant === 'HeaderCardV2') {\n return <HeaderCardV2 {...props} ref={ref} />\n }\n return <HeaderCardClassic {...props} ref={ref} />\n})\n\nexport default HeaderCard\n"],"mappings":";;;;;;;;;;;;;AA6CA,IAAM,IAAoB,EAAW,SACnC,GACA,GACA;CACA,IAAM,EACJ,SACA,UACA,cAAW,IACX,gBACA,WACA,wBACA,qBACA,sBACA,yBAAsB,IACtB,SACA,WACA,uCACA,0BACA,SACA,mBACA,mBACA,4BACA,qBACA,sBACA,UACE,GAEE,IAA8C;EAClD,GAAG;EACH,8BACE,GAAmB,gCAAgC;CACvD;CASA,OANA,EAAoB;EAClB;EACA,aAH0B,KAAe,KAAY,KAAA;EAIrD,UAAU;CACZ,CAAC,GAGC,kBAAC,GAAD;EACO;EACL,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ACE,EAAwB;OAE1B,cAAc,EAAwB;OACtC,0BACE,EAAwB;OAE1B,IAAI;QACF,YAAY;QACZ,WAAW;QACX,GAAG,EAAwB;OAC7B;MACD,CAAA;MAEH,kBAAC,GAAD,EAAK,IAAI;OAAE,OAAO;OAAQ,IAAI;MAAuB,EAAI,CAAA;KACzD,EAAA,CAAA,GAGE,IACJ,KAAyB,KAAkB,GAAQ,SAEjD,kBAAA,GAAA,EAAA,UAAA;MACG,KACC,kBAAC,OAAD;OAAK,WAAU;iBACZ;MACE,CAAA;MAEN,KACC,kBAAC,OAAD;OAAK,WAAU;iBAAmB;MAAoB,CAAA;MAEvD,KACC,kBAAC,GAAD;OAAK,IAAI,EAAE,wBAAwB,EAAE,YAAY,EAAE,EAAE;iBACnD,kBAAC,GAAD;QACE,UAAU;QACW;QACb;OACT,CAAA;MACE,CAAA;KAEP,EAAA,CAAA,IACA,KAAA;KAEN,OAAO,IACL,kBAAC,GAAD;MACE,qBAAqB;MACrB,IAAI,EAAE,WAAW,OAAO;MACX;MACC;KACf,CAAA,IAED,kBAAC,GAAD;MAAK,IAAI,EAAE,WAAW,OAAO;gBAAI;KAAiB,CAAA;IAEtD,GAAG;GACM;;CACR,CAAA;AAET,CAAC,GAEK,IAAa,EAAW,SAC5B,GACA,GACA;CACA,IAAM,EAAE,uBAAoB,iBAAiB;CAI7C,OAFS,EADL,MAAsB,iBAChB,IAEF,GAFC;EAAc,GAAI;EAAY;CAAM,CAAA;AAG/C,CAAC"}
|
|
@@ -9,8 +9,9 @@ type HexGridProps = {
|
|
|
9
9
|
titleColName: string;
|
|
10
10
|
imageColName: string;
|
|
11
11
|
descriptionColName: string;
|
|
12
|
+
isVisibleColName?: string;
|
|
12
13
|
onRowClick?: (rowData: HexRowData) => void;
|
|
13
14
|
};
|
|
14
|
-
declare function HexGrid({ sql, titleColName, imageColName, descriptionColName, onRowClick, }: HexGridProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function HexGrid({ sql, titleColName, imageColName, descriptionColName, isVisibleColName, onRowClick, }: HexGridProps): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export default HexGrid;
|
|
16
17
|
//# sourceMappingURL=HexGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HexGrid.d.ts","sourceRoot":"","sources":["../../../src/components/HexGrid/HexGrid.tsx"],"names":[],"mappings":"AAaA,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAA;CAC3C,CAAA;AAED,iBAAS,OAAO,CAAC,EACf,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,UAAU,GACX,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"HexGrid.d.ts","sourceRoot":"","sources":["../../../src/components/HexGrid/HexGrid.tsx"],"names":[],"mappings":"AAaA,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAA;CAC3C,CAAA;AAED,iBAAS,OAAO,CAAC,EACf,GAAG,EACH,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,GACX,EAAE,YAAY,2CAiEd;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -9,38 +9,38 @@ import { ButtonBase as a, Typography as o } from "@mui/material";
|
|
|
9
9
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
10
10
|
import { FileHandleAssociateType as l } from "@sage-bionetworks/synapse-types";
|
|
11
11
|
//#region src/components/HexGrid/HexGrid.tsx
|
|
12
|
-
function u({ sql: u, titleColName: d, imageColName: f, descriptionColName: p,
|
|
13
|
-
let
|
|
14
|
-
entityId:
|
|
12
|
+
function u({ sql: u, titleColName: d, imageColName: f, descriptionColName: p, isVisibleColName: m, onRowClick: h }) {
|
|
13
|
+
let g = e(u), { data: _ } = n({
|
|
14
|
+
entityId: g,
|
|
15
15
|
query: { sql: u },
|
|
16
16
|
partMask: 5,
|
|
17
17
|
concreteType: "org.sagebionetworks.repo.model.table.QueryBundleRequest"
|
|
18
|
-
}),
|
|
18
|
+
}), v = _?.queryResult?.queryResults.rows ?? [], y = t(d, _), b = t(f, _), x = t(p, _), S = t(m, _), C = m ? v.filter((e) => e.values[S] === "true") : v;
|
|
19
19
|
return /* @__PURE__ */ s("div", {
|
|
20
20
|
className: i.hexSlat,
|
|
21
21
|
children: /* @__PURE__ */ s("div", {
|
|
22
22
|
className: i.gridWrapper,
|
|
23
23
|
children: /* @__PURE__ */ s("ul", {
|
|
24
24
|
className: i.hexGrid,
|
|
25
|
-
children:
|
|
25
|
+
children: C.map((e) => /* @__PURE__ */ s(a, {
|
|
26
26
|
component: "li",
|
|
27
27
|
className: i.hex,
|
|
28
|
-
onClick: () =>
|
|
29
|
-
title: e.values[
|
|
30
|
-
imageFileHandleId: e.values[
|
|
31
|
-
description: e.values[
|
|
32
|
-
entityId:
|
|
28
|
+
onClick: () => h?.({
|
|
29
|
+
title: e.values[y] ?? "",
|
|
30
|
+
imageFileHandleId: e.values[b] ?? null,
|
|
31
|
+
description: e.values[x] ?? null,
|
|
32
|
+
entityId: g
|
|
33
33
|
}),
|
|
34
34
|
children: /* @__PURE__ */ c("div", {
|
|
35
35
|
className: i.hexIn,
|
|
36
36
|
children: [/* @__PURE__ */ s(o, {
|
|
37
37
|
variant: "headline3",
|
|
38
38
|
className: i.hexTitle,
|
|
39
|
-
children: e.values[
|
|
39
|
+
children: e.values[y]
|
|
40
40
|
}), /* @__PURE__ */ s(r, {
|
|
41
41
|
fileHandleAssociation: {
|
|
42
|
-
fileHandleId: e.values[
|
|
43
|
-
associateObjectId:
|
|
42
|
+
fileHandleId: e.values[b] ?? "",
|
|
43
|
+
associateObjectId: g,
|
|
44
44
|
associateObjectType: l.TableEntity
|
|
45
45
|
},
|
|
46
46
|
imgProps: { className: i.hexIcon }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HexGrid.js","names":[],"sources":["../../../src/components/HexGrid/HexGrid.tsx"],"sourcesContent":["import styles from './HexGrid.module.scss'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport {\n FileHandleAssociateType,\n QueryBundleRequest,\n} from '@sage-bionetworks/synapse-types'\nimport { SynapseConstants } from '@/utils'\nimport { useGetFullTableQueryResults } from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { ImageFileHandle } from '@/components/widgets/ImageFileHandle'\nimport { getFieldIndex } from '@/utils/functions/queryUtils'\nimport { ButtonBase, Typography } from '@mui/material'\n\n// Column values resolved by name so consumers don't need the indices that are only known inside HexGrid.\nexport type HexRowData = {\n title: string\n imageFileHandleId: string | null\n description: string | null\n entityId: string\n}\n\ntype HexGridProps = {\n sql: string\n titleColName: string\n imageColName: string\n descriptionColName: string\n onRowClick?: (rowData: HexRowData) => void\n}\n\nfunction HexGrid({\n sql,\n titleColName,\n imageColName,\n descriptionColName,\n onRowClick,\n}: HexGridProps) {\n const entityId = parseEntityIdFromSqlStatement(sql)\n const queryBundleRequest: QueryBundleRequest = {\n entityId,\n query: { sql },\n partMask:\n SynapseConstants.BUNDLE_MASK_QUERY_SELECT_COLUMNS |\n SynapseConstants.BUNDLE_MASK_QUERY_RESULTS,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n }\n\n const { data: queryResultBundle } =\n useGetFullTableQueryResults(queryBundleRequest)\n\n const dataRows = queryResultBundle?.queryResult?.queryResults.rows ?? []\n\n const titleColIndex = getFieldIndex(titleColName, queryResultBundle)\n\n const imageColIndex = getFieldIndex(imageColName, queryResultBundle)\n\n const descColIndex = getFieldIndex(descriptionColName, queryResultBundle)\n\n return (\n <div className={styles.hexSlat}>\n <div className={styles.gridWrapper}>\n <ul className={styles.hexGrid}>\n {
|
|
1
|
+
{"version":3,"file":"HexGrid.js","names":[],"sources":["../../../src/components/HexGrid/HexGrid.tsx"],"sourcesContent":["import styles from './HexGrid.module.scss'\nimport { parseEntityIdFromSqlStatement } from '@/utils/functions/SqlFunctions'\nimport {\n FileHandleAssociateType,\n QueryBundleRequest,\n} from '@sage-bionetworks/synapse-types'\nimport { SynapseConstants } from '@/utils'\nimport { useGetFullTableQueryResults } from '@/synapse-queries/entity/useGetQueryResultBundle'\nimport { ImageFileHandle } from '@/components/widgets/ImageFileHandle'\nimport { getFieldIndex } from '@/utils/functions/queryUtils'\nimport { ButtonBase, Typography } from '@mui/material'\n\n// Column values resolved by name so consumers don't need the indices that are only known inside HexGrid.\nexport type HexRowData = {\n title: string\n imageFileHandleId: string | null\n description: string | null\n entityId: string\n}\n\ntype HexGridProps = {\n sql: string\n titleColName: string\n imageColName: string\n descriptionColName: string\n isVisibleColName?: string\n onRowClick?: (rowData: HexRowData) => void\n}\n\nfunction HexGrid({\n sql,\n titleColName,\n imageColName,\n descriptionColName,\n isVisibleColName,\n onRowClick,\n}: HexGridProps) {\n const entityId = parseEntityIdFromSqlStatement(sql)\n const queryBundleRequest: QueryBundleRequest = {\n entityId,\n query: { sql },\n partMask:\n SynapseConstants.BUNDLE_MASK_QUERY_SELECT_COLUMNS |\n SynapseConstants.BUNDLE_MASK_QUERY_RESULTS,\n concreteType: 'org.sagebionetworks.repo.model.table.QueryBundleRequest',\n }\n\n const { data: queryResultBundle } =\n useGetFullTableQueryResults(queryBundleRequest)\n\n const dataRows = queryResultBundle?.queryResult?.queryResults.rows ?? []\n\n const titleColIndex = getFieldIndex(titleColName, queryResultBundle)\n\n const imageColIndex = getFieldIndex(imageColName, queryResultBundle)\n\n const descColIndex = getFieldIndex(descriptionColName, queryResultBundle)\n\n const toShowColIndex = getFieldIndex(isVisibleColName, queryResultBundle)\n\n const filteredDataRows = isVisibleColName\n ? dataRows.filter(row => row.values[toShowColIndex] === 'true')\n : dataRows\n\n return (\n <div className={styles.hexSlat}>\n <div className={styles.gridWrapper}>\n <ul className={styles.hexGrid}>\n {filteredDataRows.map(row => (\n <ButtonBase\n component=\"li\"\n key={row.rowId}\n className={styles.hex}\n onClick={() =>\n onRowClick?.({\n title: row.values[titleColIndex] ?? '',\n imageFileHandleId: row.values[imageColIndex] ?? null,\n description: row.values[descColIndex] ?? null,\n entityId,\n })\n }\n >\n <div className={styles.hexIn}>\n <Typography variant=\"headline3\" className={styles.hexTitle}>\n {row.values[titleColIndex]}\n </Typography>\n <ImageFileHandle\n fileHandleAssociation={{\n fileHandleId: row.values[imageColIndex] ?? '',\n associateObjectId: entityId,\n associateObjectType: FileHandleAssociateType.TableEntity,\n }}\n imgProps={{ className: styles.hexIcon }}\n />\n </div>\n </ButtonBase>\n ))}\n </ul>\n </div>\n </div>\n )\n}\n\nexport default HexGrid\n"],"mappings":";;;;;;;;;;;AA6BA,SAAS,EAAQ,EACf,QACA,iBACA,iBACA,uBACA,qBACA,iBACe;CACf,IAAM,IAAW,EAA8B,CAAG,GAU5C,EAAE,MAAM,MACZ,EAA4B;EAT5B;EACA,OAAO,EAAE,OAAI;EACb,UACE;EAEF,cAAc;CAIc,CAAkB,GAE1C,IAAW,GAAmB,aAAa,aAAa,QAAQ,CAAC,GAEjE,IAAgB,EAAc,GAAc,CAAiB,GAE7D,IAAgB,EAAc,GAAc,CAAiB,GAE7D,IAAe,EAAc,GAAoB,CAAiB,GAElE,IAAiB,EAAc,GAAkB,CAAiB,GAElE,IAAmB,IACrB,EAAS,QAAO,MAAO,EAAI,OAAO,OAAoB,MAAM,IAC5D;CAEJ,OACE,kBAAC,OAAD;EAAK,WAAW,EAAO;YACrB,kBAAC,OAAD;GAAK,WAAW,EAAO;aACrB,kBAAC,MAAD;IAAI,WAAW,EAAO;cACnB,EAAiB,KAAI,MACpB,kBAAC,GAAD;KACE,WAAU;KAEV,WAAW,EAAO;KAClB,eACE,IAAa;MACX,OAAO,EAAI,OAAO,MAAkB;MACpC,mBAAmB,EAAI,OAAO,MAAkB;MAChD,aAAa,EAAI,OAAO,MAAiB;MACzC;KACF,CAAC;eAGH,kBAAC,OAAD;MAAK,WAAW,EAAO;gBAAvB,CACE,kBAAC,GAAD;OAAY,SAAQ;OAAY,WAAW,EAAO;iBAC/C,EAAI,OAAO;MACF,CAAA,GACZ,kBAAC,GAAD;OACE,uBAAuB;QACrB,cAAc,EAAI,OAAO,MAAkB;QAC3C,mBAAmB;QACnB,qBAAqB,EAAwB;OAC/C;OACA,UAAU,EAAE,WAAW,EAAO,QAAQ;MACvC,CAAA,CACE;;IACK,GAxBL,EAAI,KAwBC,CACb;GACC,CAAA;EACD,CAAA;CACF,CAAA;AAET"}
|
|
@@ -8,7 +8,10 @@ export type ProvenanceProps = {
|
|
|
8
8
|
initialEdges?: Edge[];
|
|
9
9
|
onNodesChangedListener?: (nodes: Node[]) => void;
|
|
10
10
|
onEdgesChangedListener?: (edges: Edge[]) => void;
|
|
11
|
+
onEditProvenanceClicked?: () => void;
|
|
11
12
|
};
|
|
13
|
+
export declare const EDIT_PROVENANCE_TEXT = "Edit Provenance";
|
|
14
|
+
export declare const NO_PROVENANCE_TITLE = "No provenance data";
|
|
12
15
|
declare const ProvenanceGraph: (props: ProvenanceProps) => React.ReactNode;
|
|
13
16
|
export default ProvenanceGraph;
|
|
14
17
|
//# sourceMappingURL=ProvenanceGraph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProvenanceGraph.d.ts","sourceRoot":"","sources":["../../../src/components/ProvenanceGraph/ProvenanceGraph.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProvenanceGraph.d.ts","sourceRoot":"","sources":["../../../src/components/ProvenanceGraph/ProvenanceGraph.tsx"],"names":[],"mappings":"AAQA,OAAO,EAGL,aAAa,EAKd,MAAM,iCAAiC,CAAA;AAGxC,OAAkB,EAEhB,IAAI,EAEJ,IAAI,EAKL,MAAM,WAAW,CAAA;AAoBlB,OAAO,0BAA0B,CAAA;AAEjC,MAAM,MAAM,eAAe,GAAG;IAE5B,UAAU,EAAE,aAAa,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAA;IACrB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAA;IACrB,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAA;IAChD,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAA;IAChD,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAA;CACrC,CAAA;AAID,eAAO,MAAM,oBAAoB,oBAAoB,CAAA;AACrD,eAAO,MAAM,mBAAmB,uBAAuB,CAAA;AAscvD,QAAA,MAAM,eAAe,GAAI,OAAO,eAAe,KAAG,KAAK,CAAC,SAQvD,CAAA;AAED,eAAe,eAAe,CAAA"}
|