@malloy-publisher/sdk 0.9.7 → 0.9.8
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/README.md +117 -17
- package/dist/{RenderedResult-qnpbr4tc.cjs.js → RenderedResult-BrvrMDAP.cjs.js} +1 -1
- package/dist/{RenderedResult-CkUS04tl.es.js → RenderedResult-DZj-FnOJ.es.js} +2 -2
- package/dist/{ServerProvider-DnLLeXEX.es.js → ServerProvider-B_bPAsu2.es.js} +583 -398
- package/dist/ServerProvider-DuEOzwPc.cjs.js +1 -0
- package/dist/builder/index.cjs.js +93 -93
- package/dist/builder/index.es.js +4630 -4562
- package/dist/builder-entry.d.ts +13 -12
- package/dist/client/api.d.ts +472 -94
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +105 -95
- package/dist/components/Dashboard/DashboardTile.d.ts +3 -1
- package/dist/components/Dashboard/DashboardView.d.ts +1 -3
- package/dist/components/Dashboard/index.d.ts +0 -2
- package/dist/components/DocumentCreate/createDocument.d.ts +29 -9
- package/dist/components/DocumentCreate/documentPath.d.ts +21 -6
- package/dist/components/DocumentCreate/guards.d.ts +2 -3
- package/dist/components/DocumentCreate/index.d.ts +2 -3
- package/dist/components/DocumentCreate/newNotebook.d.ts +14 -5
- package/dist/components/DocumentStorage/BrowserDocumentStorage.d.ts +6 -0
- package/dist/components/DocumentStorage/DocumentStorage.d.ts +52 -24
- package/dist/components/Loading.d.ts +1 -1
- package/dist/components/Package/DataSchemaDialog.d.ts +26 -0
- package/dist/components/Package/NewDocumentDialog.d.ts +19 -10
- package/dist/components/Package/Package.d.ts +14 -9
- package/dist/components/Package/documentLocation.d.ts +66 -23
- package/dist/components/Package/index.d.ts +3 -2
- package/dist/components/Package/reportQueries.d.ts +8 -0
- package/dist/components/Package/useDocumentLocation.d.ts +36 -6
- package/dist/components/Package/useDraftLayout.d.ts +20 -0
- package/dist/components/Report/CellReport.d.ts +89 -0
- package/dist/components/Report/LinearReport.d.ts +18 -0
- package/dist/components/Report/Report.d.ts +62 -0
- package/dist/components/Report/index.d.ts +2 -0
- package/dist/components/Report/telemetry.d.ts +163 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.d.ts +2 -2
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.d.ts +2 -2
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.d.ts +5 -4
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.d.ts +5 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/EditorSurface.d.ts +10 -7
- package/dist/components/{DashboardBuilder/DashboardBuilder.d.ts → ReportBuilder/ReportBuilder.d.ts} +17 -8
- package/dist/components/{DashboardBuilder/DashboardEditor.d.ts → ReportBuilder/ReportEditor.d.ts} +41 -14
- package/dist/components/ReportBuilder/builderReport.d.ts +14 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/catalog.d.ts +8 -5
- package/dist/components/{DashboardBuilder → ReportBuilder}/document.d.ts +3 -4
- package/dist/components/{DashboardBuilder → ReportBuilder}/documentSession.d.ts +1 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/imports.d.ts +5 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/malloyTree.d.ts +9 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/newDashboard.d.ts +7 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/readDocument.d.ts +7 -5
- package/dist/components/{DashboardBuilder → ReportBuilder}/readForEditor.d.ts +1 -1
- package/dist/components/ReportBuilder/reportTag.d.ts +52 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/spliceDocument.d.ts +1 -7
- package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.d.ts +2 -2
- package/dist/components/{DashboardBuilder → ReportBuilder}/useControlBindings.d.ts +2 -2
- package/dist/components/ReportBuilder/useEditorCatalog.d.ts +25 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/useHostCopy.d.ts +5 -3
- package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.d.ts +7 -5
- package/dist/components/{DashboardBuilder/useDashboardEditor.d.ts → ReportBuilder/useReportEditor.d.ts} +3 -7
- package/dist/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.d.ts +6 -4
- package/dist/components/{DashboardBuilder → ReportBuilder}/useTileEditing.d.ts +2 -2
- package/dist/components/ServerProvider.d.ts +2 -1
- package/dist/components/drill/resolveDrill.d.ts +8 -1
- package/dist/components/drill/useDrillSelf.d.ts +4 -2
- package/dist/components/index.d.ts +2 -1
- package/dist/components/{Dashboard → legacy}/Dashboard.d.ts +15 -9
- package/dist/components/legacy/MalloynbCells.d.ts +13 -0
- package/dist/components/legacy/Notebook.d.ts +15 -0
- package/dist/components/{DashboardBuilder → legacy}/NotebookEditor.d.ts +3 -3
- package/dist/components/legacy/builderNames.d.ts +10 -0
- package/dist/components/legacy/index.d.ts +11 -0
- package/dist/components/legacy/kindAdapter.d.ts +11 -0
- package/dist/components/legacy/kindTypedDrafts.d.ts +10 -0
- package/dist/components/legacy/nameAlias.d.ts +44 -0
- package/dist/components/legacy/queryKeys.d.ts +8 -0
- package/dist/index.cjs.js +19 -19
- package/dist/index.es.js +7984 -7452
- package/dist/text/index.es.js +2 -2
- package/dist/{text-entry-CA0LZ1xL.es.js → text-entry-72YFLeNk.es.js} +10 -10
- package/dist/useCompiledDocument-oocN5cGE.cjs.js +141 -0
- package/dist/{useCompiledDocument-Bf72Ob5v.es.js → useCompiledDocument-x0B2RAH3.es.js} +4593 -4395
- package/package.json +2 -2
- package/src/builder-entry.ts +32 -24
- package/src/components/Dashboard/DashboardTile.tsx +17 -0
- package/src/components/Dashboard/DashboardView.spec.tsx +0 -21
- package/src/components/Dashboard/DashboardView.tsx +8 -24
- package/src/components/Dashboard/dropValueUrlTags.spec.ts +1 -4
- package/src/components/Dashboard/index.ts +0 -2
- package/src/components/DocumentCreate/createDocument.spec.ts +346 -53
- package/src/components/DocumentCreate/createDocument.ts +143 -63
- package/src/components/DocumentCreate/documentPath.ts +41 -12
- package/src/components/DocumentCreate/guards.ts +7 -15
- package/src/components/DocumentCreate/index.ts +3 -7
- package/src/components/DocumentCreate/newNotebook.spec.ts +113 -43
- package/src/components/DocumentCreate/newNotebook.ts +32 -10
- package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +130 -28
- package/src/components/DocumentStorage/BrowserDocumentStorage.ts +78 -40
- package/src/components/DocumentStorage/DocumentStorage.contract.spec.tsx +426 -0
- package/src/components/DocumentStorage/DocumentStorage.ts +57 -24
- package/src/components/Home/AddEnvironmentDialog.tsx +1 -1
- package/src/components/Home/Home.tsx +1 -1
- package/src/components/Loading.tsx +1 -1
- package/src/components/Model/SourcesExplorer.tsx +1 -1
- package/src/components/Notebook/NotebookCell.tsx +6 -5
- package/src/components/Notebook/cellKind.spec.ts +15 -7
- package/src/components/Package/DataSchemaDialog.spec.tsx +85 -0
- package/src/components/Package/DataSchemaDialog.tsx +367 -0
- package/src/components/Package/NewDocumentDialog.spec.tsx +145 -88
- package/src/components/Package/NewDocumentDialog.tsx +93 -48
- package/src/components/Package/Package.artifacts.spec.tsx +79 -60
- package/src/components/Package/Package.create.spec.tsx +126 -112
- package/src/components/Package/Package.notebooks.spec.tsx +46 -27
- package/src/components/Package/Package.spec.tsx +43 -30
- package/src/components/Package/Package.tsx +173 -292
- package/src/components/Package/documentLocation.spec.ts +145 -50
- package/src/components/Package/documentLocation.ts +118 -39
- package/src/components/Package/index.ts +12 -3
- package/src/components/Package/reportQueries.ts +25 -0
- package/src/components/Package/useDocumentLocation.spec.ts +58 -0
- package/src/components/Package/useDocumentLocation.ts +90 -32
- package/src/components/Package/useDraftLayout.spec.tsx +143 -0
- package/src/components/Package/useDraftLayout.ts +81 -0
- package/src/components/Prose.spec.tsx +3 -3
- package/src/components/RenderedResult/RenderedResult.tsx +1 -1
- package/src/components/Report/CellReport.spec.tsx +155 -0
- package/src/components/{Notebook/Notebook.tsx → Report/CellReport.tsx} +178 -220
- package/src/components/Report/LinearReport.tsx +71 -0
- package/src/components/Report/Report.spec.tsx +238 -0
- package/src/components/Report/Report.telemetry.spec.tsx +292 -0
- package/src/components/Report/Report.tsx +277 -0
- package/src/components/Report/index.ts +12 -0
- package/src/components/Report/telemetry.spec.ts +90 -0
- package/src/components/Report/telemetry.ts +250 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.tsx +5 -5
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.tsx +2 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.tsx +6 -7
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.tsx +33 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/DrillDialog.tsx +2 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/EditorSurface.tsx +67 -107
- package/src/components/{DashboardBuilder → ReportBuilder}/FilterDialog.tsx +3 -4
- package/src/components/{DashboardBuilder/DashboardBuilder.charts.spec.tsx → ReportBuilder/ReportBuilder.charts.spec.tsx} +4 -4
- package/src/components/{DashboardBuilder/DashboardBuilder.exit.spec.tsx → ReportBuilder/ReportBuilder.exit.spec.tsx} +5 -5
- package/src/components/{DashboardBuilder/DashboardBuilder.inline.spec.tsx → ReportBuilder/ReportBuilder.inline.spec.tsx} +4 -4
- package/src/components/ReportBuilder/ReportBuilder.layoutSwitch.spec.tsx +145 -0
- package/src/components/{DashboardBuilder/DashboardBuilder.notebook.spec.tsx → ReportBuilder/ReportBuilder.notebook.spec.tsx} +22 -21
- package/src/components/{DashboardBuilder/DashboardBuilder.openDraft.spec.tsx → ReportBuilder/ReportBuilder.openDraft.spec.tsx} +3 -3
- package/src/components/{DashboardBuilder/DashboardBuilder.sources.spec.tsx → ReportBuilder/ReportBuilder.sources.spec.tsx} +19 -8
- package/src/components/{DashboardBuilder/DashboardBuilder.spec.tsx → ReportBuilder/ReportBuilder.spec.tsx} +34 -34
- package/src/components/{DashboardBuilder/DashboardBuilder.textTiles.spec.tsx → ReportBuilder/ReportBuilder.textTiles.spec.tsx} +5 -5
- package/src/components/{DashboardBuilder/DashboardBuilder.tsx → ReportBuilder/ReportBuilder.tsx} +46 -21
- package/src/components/{DashboardBuilder/DashboardEditor.authoritative.spec.tsx → ReportBuilder/ReportEditor.authoritative.spec.tsx} +28 -20
- package/src/components/{DashboardBuilder/DashboardEditor.emptyStart.spec.tsx → ReportBuilder/ReportEditor.emptyStart.spec.tsx} +19 -11
- package/src/components/{DashboardBuilder/DashboardEditor.filterTag.spec.tsx → ReportBuilder/ReportEditor.filterTag.spec.tsx} +7 -7
- package/src/components/{DashboardBuilder/DashboardEditor.notebook.spec.tsx → ReportBuilder/ReportEditor.notebook.spec.tsx} +70 -49
- package/src/components/{DashboardBuilder/DashboardEditor.package.spec.tsx → ReportBuilder/ReportEditor.package.spec.tsx} +52 -8
- package/src/components/{DashboardBuilder/DashboardEditor.resourceUri.spec.tsx → ReportBuilder/ReportEditor.resourceUri.spec.tsx} +50 -18
- package/src/components/{DashboardBuilder/DashboardEditor.spec.tsx → ReportBuilder/ReportEditor.spec.tsx} +65 -20
- package/src/components/{DashboardBuilder/DashboardEditor.textSource.spec.tsx → ReportBuilder/ReportEditor.textSource.spec.tsx} +6 -6
- package/src/components/{DashboardBuilder/DashboardEditor.tsx → ReportBuilder/ReportEditor.tsx} +92 -35
- package/src/components/{DashboardBuilder → ReportBuilder}/addTile.compile.spec.ts +1 -3
- package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.spec.ts +1 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/artifactBlock.spec.ts +21 -29
- package/src/components/ReportBuilder/builderReport.ts +53 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/catalog.spec.ts +28 -10
- package/src/components/{DashboardBuilder → ReportBuilder}/catalog.ts +17 -10
- package/src/components/{DashboardBuilder → ReportBuilder}/controls.spec.ts +1 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/document.ts +4 -7
- package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.spec.ts +5 -5
- package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.ts +1 -1
- package/src/components/{DashboardBuilder → ReportBuilder}/imports.spec.ts +6 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/imports.ts +8 -4
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.chart.spec.ts +1 -1
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.convert.spec.ts +9 -13
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.read.spec.ts +15 -15
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.ts +7 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.ts +25 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.spec.ts +12 -4
- package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.ts +11 -24
- package/src/components/{DashboardBuilder → ReportBuilder}/preview.spec.ts +1 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.spec.ts +64 -36
- package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.ts +33 -32
- package/src/components/ReportBuilder/readForEditor.spec.ts +96 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/readForEditor.ts +3 -11
- package/src/components/ReportBuilder/reportTag.ts +108 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.imports.spec.ts +28 -1
- package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.spec.ts +32 -3
- package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.ts +37 -60
- package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.spec.ts +3 -3
- package/src/components/{DashboardBuilder → ReportBuilder}/testing/artifactTagParity.json +2 -2
- package/src/components/ReportBuilder/testing/drillResolution.json +279 -0
- package/src/components/ReportBuilder/testing/reportLayoutParity.json +125 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/textTiles.spec.ts +66 -143
- package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.ts +2 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/useControlBindings.ts +2 -2
- package/src/components/ReportBuilder/useEditorCatalog.spec.tsx +156 -0
- package/src/components/ReportBuilder/useEditorCatalog.ts +119 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/useHostCopy.ts +7 -5
- package/src/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.ts +56 -35
- package/src/components/{DashboardBuilder/useDashboardEditor.spec.ts → ReportBuilder/useReportEditor.spec.ts} +6 -6
- package/src/components/{DashboardBuilder/useDashboardEditor.ts → ReportBuilder/useReportEditor.ts} +6 -17
- package/src/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.ts +36 -35
- package/src/components/{DashboardBuilder → ReportBuilder}/useTileEditing.ts +2 -2
- package/src/components/ServerProvider.tsx +2 -0
- package/src/components/drill/resolveDrill.ts +9 -2
- package/src/components/drill/useDrill.tsx +1 -0
- package/src/components/drill/useDrillSelf.spec.tsx +60 -7
- package/src/components/drill/useDrillSelf.ts +29 -12
- package/src/components/index.ts +2 -1
- package/src/components/{Dashboard → legacy}/Dashboard.spec.tsx +1 -1
- package/src/components/{Dashboard → legacy}/Dashboard.tsx +40 -28
- package/src/components/legacy/MalloynbCells.tsx +88 -0
- package/src/components/{Notebook → legacy}/Notebook.served.spec.tsx +17 -13
- package/src/components/{Notebook → legacy}/Notebook.spec.tsx +24 -20
- package/src/components/legacy/Notebook.tsx +44 -0
- package/src/components/{DashboardBuilder → legacy}/NotebookEditor.tsx +7 -4
- package/src/components/legacy/builderNames.ts +25 -0
- package/src/components/legacy/index.ts +20 -0
- package/src/components/legacy/kindAdapter.ts +19 -0
- package/src/components/legacy/kindTypedDrafts.ts +34 -0
- package/src/components/legacy/nameAlias.spec.ts +124 -0
- package/src/components/legacy/nameAlias.ts +95 -0
- package/src/components/legacy/queryKeys.ts +26 -0
- package/src/hooks/useGivensState.spec.ts +9 -9
- package/src/mainEntry.spec.ts +1 -1
- package/src/textEntry.spec.ts +9 -9
- package/src/utils/formatting.spec.ts +5 -5
- package/src/utils/parsing.spec.ts +1 -1
- package/src/utils/parsing.ts +1 -1
- package/dist/ServerProvider-Gj-im5VD.cjs.js +0 -1
- package/dist/components/Dashboard/telemetry.d.ts +0 -73
- package/dist/components/DashboardBuilder/builderReport.d.ts +0 -13
- package/dist/components/DashboardBuilder/telemetry.d.ts +0 -43
- package/dist/components/DocumentCreate/events.d.ts +0 -10
- package/dist/components/Notebook/Notebook.d.ts +0 -52
- package/dist/components/Notebook/index.d.ts +0 -1
- package/dist/useCompiledDocument-tBejqZ7s.cjs.js +0 -142
- package/src/components/Dashboard/telemetry.ts +0 -75
- package/src/components/DashboardBuilder/builderReport.ts +0 -74
- package/src/components/DashboardBuilder/readForEditor.spec.ts +0 -80
- package/src/components/DashboardBuilder/telemetry.ts +0 -47
- package/src/components/DashboardBuilder/testing/documentKindRule.json +0 -40
- package/src/components/DocumentCreate/events.ts +0 -15
- package/src/components/Notebook/index.ts +0 -4
- /package/dist/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/ChartPicker.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/DrillDialog.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterDialog.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterStrip.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineText.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/TextTileBody.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/TileFrame.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/TileMenu.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/annotationText.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/changedTile.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/chartLine.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/controls.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/inlineEdit.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/layout.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/loadMalloy.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/openDraft.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/preview.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/sortable.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/spliceResult.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/tagParse.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/inline.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/resize.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useDraft.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useExitGuard.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useFilterForm.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileReorder.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileResize.d.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.render.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/FilterStrip.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/InlineText.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/TextTileBody.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/TileFrame.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/TileMenu.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/__test__/inventory.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/artifactTagParity.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/catalog.aggregate.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/controls.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/emptyStart.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/inlineEdit.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/invariants.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/keepRowStructure.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/layout.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/moveIntoGap.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/openDraft.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/preview.shapes.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/preview.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/scannerShapes.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.chart.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/spliceResult.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/statementExtent.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/inline.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/resize.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/urlRenderTags.json +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.overlay.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useDraft.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.existing.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/withGaps.spec.ts +0 -0
- /package/src/components/{Notebook → legacy}/Notebook.layout.spec.tsx +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import { fireEvent, render, screen, within } from "@testing-library/react";
|
|
5
|
+
import { describe, expect, it } from "bun:test";
|
|
6
|
+
import type { Database } from "../../client";
|
|
7
|
+
import {
|
|
8
|
+
columnTypeIcon,
|
|
9
|
+
DataSchemaDialog,
|
|
10
|
+
formatRowCount,
|
|
11
|
+
} from "./DataSchemaDialog";
|
|
12
|
+
|
|
13
|
+
const file = (columnCount: number): Database => ({
|
|
14
|
+
path: "data/customers.parquet",
|
|
15
|
+
info: {
|
|
16
|
+
rowCount: 1000,
|
|
17
|
+
columns: Array.from({ length: columnCount }, (_, i) => ({
|
|
18
|
+
name: i === 0 ? "customer_id" : `col_${i}`,
|
|
19
|
+
type: i === 0 ? "number" : "string",
|
|
20
|
+
})),
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe("DataSchemaDialog", () => {
|
|
25
|
+
it("titles itself with the file and lists its columns", () => {
|
|
26
|
+
render(<DataSchemaDialog database={file(3)} onClose={() => {}} />);
|
|
27
|
+
const dialog = screen.getByRole("dialog");
|
|
28
|
+
expect(within(dialog).getByText("customers.parquet")).toBeTruthy();
|
|
29
|
+
expect(within(dialog).getByText("data · 1.0 K rows")).toBeTruthy();
|
|
30
|
+
const list = within(dialog).getByRole("list", { name: /Columns/ });
|
|
31
|
+
expect(within(list).getAllByRole("listitem")).toHaveLength(3);
|
|
32
|
+
expect(within(list).getByText("customer_id")).toBeTruthy();
|
|
33
|
+
// A narrow file has nothing to filter.
|
|
34
|
+
expect(within(dialog).queryByLabelText("Filter columns")).toBeNull();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("filters a wide file's columns by name", () => {
|
|
38
|
+
render(<DataSchemaDialog database={file(20)} onClose={() => {}} />);
|
|
39
|
+
fireEvent.change(screen.getByLabelText("Filter columns"), {
|
|
40
|
+
target: { value: "customer" },
|
|
41
|
+
});
|
|
42
|
+
const list = screen.getByRole("list", { name: /Columns/ });
|
|
43
|
+
expect(within(list).getAllByRole("listitem")).toHaveLength(1);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("shows a file's read error instead of columns", () => {
|
|
47
|
+
render(
|
|
48
|
+
<DataSchemaDialog
|
|
49
|
+
database={{ path: "data/bad.csv", error: "Could not read" }}
|
|
50
|
+
onClose={() => {}}
|
|
51
|
+
/>,
|
|
52
|
+
);
|
|
53
|
+
expect(screen.getByText("Could not read")).toBeTruthy();
|
|
54
|
+
expect(screen.queryByRole("list")).toBeNull();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("is closed with no file", () => {
|
|
58
|
+
render(<DataSchemaDialog database={null} onClose={() => {}} />);
|
|
59
|
+
expect(screen.queryByRole("dialog")).toBeNull();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe("columnTypeIcon", () => {
|
|
64
|
+
it("tells the Malloy types apart and falls back for an unknown one", () => {
|
|
65
|
+
const kinds = [
|
|
66
|
+
"string",
|
|
67
|
+
"number",
|
|
68
|
+
"date",
|
|
69
|
+
"timestamp",
|
|
70
|
+
"boolean",
|
|
71
|
+
"array<string>",
|
|
72
|
+
"record",
|
|
73
|
+
].map(columnTypeIcon);
|
|
74
|
+
expect(new Set(kinds).size).toBe(kinds.length);
|
|
75
|
+
expect(columnTypeIcon("sql native")).toBe(columnTypeIcon(undefined));
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe("formatRowCount", () => {
|
|
80
|
+
it("abbreviates like the Data section does", () => {
|
|
81
|
+
expect(formatRowCount(12)).toBe("12 rows");
|
|
82
|
+
expect(formatRowCount(25_400)).toBe("25.4 K rows");
|
|
83
|
+
expect(formatRowCount(3_000_000)).toBe("3.0 M rows");
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import AbcIcon from "@mui/icons-material/Abc";
|
|
5
|
+
import CalendarTodayOutlinedIcon from "@mui/icons-material/CalendarTodayOutlined";
|
|
6
|
+
import DataArrayIcon from "@mui/icons-material/DataArray";
|
|
7
|
+
import DataObjectIcon from "@mui/icons-material/DataObject";
|
|
8
|
+
import ScheduleOutlinedIcon from "@mui/icons-material/ScheduleOutlined";
|
|
9
|
+
import SearchIcon from "@mui/icons-material/Search";
|
|
10
|
+
import TagIcon from "@mui/icons-material/Tag";
|
|
11
|
+
import ToggleOnOutlinedIcon from "@mui/icons-material/ToggleOnOutlined";
|
|
12
|
+
import ViewColumnOutlinedIcon from "@mui/icons-material/ViewColumnOutlined";
|
|
13
|
+
import {
|
|
14
|
+
Alert,
|
|
15
|
+
Box,
|
|
16
|
+
InputAdornment,
|
|
17
|
+
InputBase,
|
|
18
|
+
Stack,
|
|
19
|
+
Typography,
|
|
20
|
+
} from "@mui/material";
|
|
21
|
+
import type { SvgIconComponent } from "@mui/icons-material";
|
|
22
|
+
import * as React from "react";
|
|
23
|
+
import { useId, useMemo, useState } from "react";
|
|
24
|
+
import type { Column, Database } from "../../client";
|
|
25
|
+
import { AppDialog } from "../AppDialog";
|
|
26
|
+
import { MONO_FONT_FAMILY } from "../styles";
|
|
27
|
+
import ContentTypeIcon, { CONTENT_TINT } from "./ContentTypeIcon";
|
|
28
|
+
|
|
29
|
+
/** A row count as the Data section shows it: "1.2 K rows". */
|
|
30
|
+
export function formatRowCount(rows: number): string {
|
|
31
|
+
if (rows >= 1_000_000_000)
|
|
32
|
+
return `${(rows / 1_000_000_000).toFixed(1)} B rows`;
|
|
33
|
+
if (rows >= 1_000_000) return `${(rows / 1_000_000).toFixed(1)} M rows`;
|
|
34
|
+
if (rows >= 1_000) return `${(rows / 1_000).toFixed(1)} K rows`;
|
|
35
|
+
return `${rows} rows`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Wider than this, the columns get a filter box: past a screenful, a reader
|
|
39
|
+
* is looking for one column rather than reading them all. */
|
|
40
|
+
const FILTER_THRESHOLD = 12;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The glyph for a column's type. The server reports Malloy's type names
|
|
44
|
+
* (`string`, `number`, `date`, `timestamp`, `boolean`, and arrays and records,
|
|
45
|
+
* which may carry their element types), so the glyph says what kind of value a
|
|
46
|
+
* column holds before its type is read. An unknown type keeps a plain column.
|
|
47
|
+
*/
|
|
48
|
+
export function columnTypeIcon(type: string | undefined): SvgIconComponent {
|
|
49
|
+
const t = type?.trim().toLowerCase() ?? "";
|
|
50
|
+
if (t.startsWith("array") || t.endsWith("[]")) return DataArrayIcon;
|
|
51
|
+
if (t.startsWith("record") || t.startsWith("struct")) return DataObjectIcon;
|
|
52
|
+
switch (t.split(/[\s(<]/)[0]) {
|
|
53
|
+
case "string":
|
|
54
|
+
return AbcIcon;
|
|
55
|
+
case "number":
|
|
56
|
+
return TagIcon;
|
|
57
|
+
case "date":
|
|
58
|
+
return CalendarTodayOutlinedIcon;
|
|
59
|
+
case "timestamp":
|
|
60
|
+
case "timestamptz":
|
|
61
|
+
return ScheduleOutlinedIcon;
|
|
62
|
+
case "boolean":
|
|
63
|
+
return ToggleOnOutlinedIcon;
|
|
64
|
+
default:
|
|
65
|
+
return ViewColumnOutlinedIcon;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* One column: its type's glyph, its name, its type.
|
|
71
|
+
*
|
|
72
|
+
* The name is mono because it exists verbatim in the file and is what a reader
|
|
73
|
+
* would type into a model; the type is sans and quieter because it describes
|
|
74
|
+
* the column rather than naming it.
|
|
75
|
+
*/
|
|
76
|
+
function ColumnRow({ column }: { column: Column }) {
|
|
77
|
+
const Icon = columnTypeIcon(column.type);
|
|
78
|
+
return (
|
|
79
|
+
<Box
|
|
80
|
+
component="li"
|
|
81
|
+
sx={(theme) => ({
|
|
82
|
+
display: "flex",
|
|
83
|
+
alignItems: "center",
|
|
84
|
+
gap: 1.25,
|
|
85
|
+
px: 1,
|
|
86
|
+
py: 0.625,
|
|
87
|
+
borderRadius: 1,
|
|
88
|
+
transition: "background-color 0.1s",
|
|
89
|
+
"&:hover": {
|
|
90
|
+
backgroundColor:
|
|
91
|
+
theme.palette.mode === "dark"
|
|
92
|
+
? "rgba(255, 255, 255, 0.06)"
|
|
93
|
+
: theme.palette.grey[100],
|
|
94
|
+
},
|
|
95
|
+
})}
|
|
96
|
+
>
|
|
97
|
+
<Icon
|
|
98
|
+
aria-hidden
|
|
99
|
+
sx={{ fontSize: 18, color: "primary.main", flexShrink: 0 }}
|
|
100
|
+
/>
|
|
101
|
+
<Box
|
|
102
|
+
sx={{
|
|
103
|
+
display: "flex",
|
|
104
|
+
alignItems: "baseline",
|
|
105
|
+
gap: 1,
|
|
106
|
+
minWidth: 0,
|
|
107
|
+
flex: 1,
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
<Typography
|
|
111
|
+
component="span"
|
|
112
|
+
sx={{
|
|
113
|
+
fontFamily: MONO_FONT_FAMILY,
|
|
114
|
+
fontSize: "0.8125rem",
|
|
115
|
+
fontWeight: 500,
|
|
116
|
+
color: "text.primary",
|
|
117
|
+
minWidth: 0,
|
|
118
|
+
overflow: "hidden",
|
|
119
|
+
textOverflow: "ellipsis",
|
|
120
|
+
whiteSpace: "nowrap",
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
123
|
+
{column.name}
|
|
124
|
+
</Typography>
|
|
125
|
+
{column.type && (
|
|
126
|
+
<Typography
|
|
127
|
+
component="span"
|
|
128
|
+
variant="caption"
|
|
129
|
+
color="text.secondary"
|
|
130
|
+
sx={{
|
|
131
|
+
flexShrink: 0,
|
|
132
|
+
maxWidth: "50%",
|
|
133
|
+
overflow: "hidden",
|
|
134
|
+
textOverflow: "ellipsis",
|
|
135
|
+
whiteSpace: "nowrap",
|
|
136
|
+
}}
|
|
137
|
+
>
|
|
138
|
+
{column.type}
|
|
139
|
+
</Typography>
|
|
140
|
+
)}
|
|
141
|
+
</Box>
|
|
142
|
+
</Box>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* A package data file's schema: its columns, opened from the Data section of
|
|
148
|
+
* the package page.
|
|
149
|
+
*
|
|
150
|
+
* The header names the file the way the row that opened it did (its icon, its
|
|
151
|
+
* basename in mono) and repeats the row's facts under it (the folder and the row
|
|
152
|
+
* count), so the dialog confirms what was clicked. The columns sit in one
|
|
153
|
+
* outlined pane under a ruled "Columns · N" band, and the pane scrolls on its
|
|
154
|
+
* own so a wide parquet file does not push the dialog past the viewport.
|
|
155
|
+
*/
|
|
156
|
+
export function DataSchemaDialog({
|
|
157
|
+
database,
|
|
158
|
+
onClose,
|
|
159
|
+
}: {
|
|
160
|
+
/** The file to show; the dialog is open while it is set. */
|
|
161
|
+
database: Database | null;
|
|
162
|
+
onClose: () => void;
|
|
163
|
+
}) {
|
|
164
|
+
const open = database !== null;
|
|
165
|
+
// Held through the close, so the dialog fades out showing the file it was
|
|
166
|
+
// showing rather than collapsing to an empty title.
|
|
167
|
+
const [shown, setShown] = useState<Database | null>(database);
|
|
168
|
+
if (database !== null && database !== shown) setShown(database);
|
|
169
|
+
|
|
170
|
+
const [filter, setFilter] = useState("");
|
|
171
|
+
const [filterFor, setFilterFor] = useState(shown?.path);
|
|
172
|
+
if (filterFor !== shown?.path) {
|
|
173
|
+
setFilterFor(shown?.path);
|
|
174
|
+
setFilter("");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const columnsId = useId();
|
|
178
|
+
const path = shown?.path ?? "";
|
|
179
|
+
const fileName = path.split("/").pop() || path;
|
|
180
|
+
const folder = path.slice(0, Math.max(0, path.length - fileName.length - 1));
|
|
181
|
+
const rowCount = shown?.info?.rowCount;
|
|
182
|
+
const subtitle = [
|
|
183
|
+
folder,
|
|
184
|
+
rowCount === undefined ? null : formatRowCount(rowCount),
|
|
185
|
+
]
|
|
186
|
+
.filter(Boolean)
|
|
187
|
+
.join(" · ");
|
|
188
|
+
|
|
189
|
+
const columns = useMemo(() => shown?.info?.columns ?? [], [shown]);
|
|
190
|
+
const needle = filter.trim().toLowerCase();
|
|
191
|
+
const visible = useMemo(
|
|
192
|
+
() =>
|
|
193
|
+
needle
|
|
194
|
+
? columns.filter(
|
|
195
|
+
(c) =>
|
|
196
|
+
c.name?.toLowerCase().includes(needle) ||
|
|
197
|
+
c.type?.toLowerCase().includes(needle),
|
|
198
|
+
)
|
|
199
|
+
: columns,
|
|
200
|
+
[columns, needle],
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<AppDialog
|
|
205
|
+
open={open}
|
|
206
|
+
onClose={onClose}
|
|
207
|
+
showClose
|
|
208
|
+
title={
|
|
209
|
+
<Stack
|
|
210
|
+
direction="row"
|
|
211
|
+
alignItems="center"
|
|
212
|
+
spacing={1.5}
|
|
213
|
+
sx={{ minWidth: 0 }}
|
|
214
|
+
>
|
|
215
|
+
<Box
|
|
216
|
+
aria-hidden
|
|
217
|
+
sx={{
|
|
218
|
+
width: 32,
|
|
219
|
+
height: 32,
|
|
220
|
+
borderRadius: 1,
|
|
221
|
+
bgcolor: CONTENT_TINT.data,
|
|
222
|
+
color: "#FFFFFF",
|
|
223
|
+
display: "flex",
|
|
224
|
+
alignItems: "center",
|
|
225
|
+
justifyContent: "center",
|
|
226
|
+
flexShrink: 0,
|
|
227
|
+
}}
|
|
228
|
+
>
|
|
229
|
+
<ContentTypeIcon type="data" size={18} />
|
|
230
|
+
</Box>
|
|
231
|
+
<Box sx={{ minWidth: 0 }}>
|
|
232
|
+
<Typography
|
|
233
|
+
component="span"
|
|
234
|
+
noWrap
|
|
235
|
+
title={path}
|
|
236
|
+
sx={{
|
|
237
|
+
display: "block",
|
|
238
|
+
fontFamily: MONO_FONT_FAMILY,
|
|
239
|
+
fontSize: "1rem",
|
|
240
|
+
fontWeight: 600,
|
|
241
|
+
letterSpacing: 0,
|
|
242
|
+
lineHeight: 1.4,
|
|
243
|
+
}}
|
|
244
|
+
>
|
|
245
|
+
{fileName || "Columns"}
|
|
246
|
+
</Typography>
|
|
247
|
+
{subtitle && (
|
|
248
|
+
<Typography
|
|
249
|
+
component="span"
|
|
250
|
+
variant="caption"
|
|
251
|
+
color="text.secondary"
|
|
252
|
+
noWrap
|
|
253
|
+
sx={{ display: "block", lineHeight: 1.4 }}
|
|
254
|
+
>
|
|
255
|
+
{subtitle}
|
|
256
|
+
</Typography>
|
|
257
|
+
)}
|
|
258
|
+
</Box>
|
|
259
|
+
</Stack>
|
|
260
|
+
}
|
|
261
|
+
>
|
|
262
|
+
{shown?.error && (
|
|
263
|
+
<Alert severity="error" variant="outlined">
|
|
264
|
+
{shown.error}
|
|
265
|
+
</Alert>
|
|
266
|
+
)}
|
|
267
|
+
{shown && !shown.error && (
|
|
268
|
+
<Box
|
|
269
|
+
component="section"
|
|
270
|
+
aria-labelledby={columnsId}
|
|
271
|
+
sx={{
|
|
272
|
+
display: "flex",
|
|
273
|
+
flexDirection: "column",
|
|
274
|
+
border: "1px solid",
|
|
275
|
+
borderColor: "divider",
|
|
276
|
+
borderRadius: 2,
|
|
277
|
+
bgcolor: "background.paper",
|
|
278
|
+
overflow: "hidden",
|
|
279
|
+
mb: 2,
|
|
280
|
+
}}
|
|
281
|
+
>
|
|
282
|
+
<Stack
|
|
283
|
+
direction="row"
|
|
284
|
+
alignItems="center"
|
|
285
|
+
spacing={1}
|
|
286
|
+
sx={{
|
|
287
|
+
px: 1.5,
|
|
288
|
+
py: 1,
|
|
289
|
+
minHeight: 44,
|
|
290
|
+
borderBottom: "1px solid",
|
|
291
|
+
borderColor: "divider",
|
|
292
|
+
}}
|
|
293
|
+
>
|
|
294
|
+
<Typography
|
|
295
|
+
id={columnsId}
|
|
296
|
+
component="h3"
|
|
297
|
+
sx={{ fontSize: "0.875rem", fontWeight: 600 }}
|
|
298
|
+
>
|
|
299
|
+
Columns
|
|
300
|
+
<Typography
|
|
301
|
+
component="span"
|
|
302
|
+
variant="caption"
|
|
303
|
+
color="text.secondary"
|
|
304
|
+
sx={{ ml: 0.75, fontVariantNumeric: "tabular-nums" }}
|
|
305
|
+
>
|
|
306
|
+
· {needle ? `${visible.length} of ` : ""}
|
|
307
|
+
{columns.length}
|
|
308
|
+
</Typography>
|
|
309
|
+
</Typography>
|
|
310
|
+
{columns.length > FILTER_THRESHOLD && (
|
|
311
|
+
<InputBase
|
|
312
|
+
value={filter}
|
|
313
|
+
onChange={(e) => setFilter(e.target.value)}
|
|
314
|
+
placeholder="Filter columns"
|
|
315
|
+
inputProps={{ "aria-label": "Filter columns" }}
|
|
316
|
+
startAdornment={
|
|
317
|
+
<InputAdornment position="start">
|
|
318
|
+
<SearchIcon
|
|
319
|
+
sx={{ fontSize: 16, color: "text.secondary" }}
|
|
320
|
+
/>
|
|
321
|
+
</InputAdornment>
|
|
322
|
+
}
|
|
323
|
+
sx={{
|
|
324
|
+
ml: "auto !important",
|
|
325
|
+
width: 200,
|
|
326
|
+
fontSize: "0.8125rem",
|
|
327
|
+
px: 1,
|
|
328
|
+
py: 0.25,
|
|
329
|
+
border: "1px solid",
|
|
330
|
+
borderColor: "divider",
|
|
331
|
+
borderRadius: 1.5,
|
|
332
|
+
"&.Mui-focused": { borderColor: "primary.main" },
|
|
333
|
+
}}
|
|
334
|
+
/>
|
|
335
|
+
)}
|
|
336
|
+
</Stack>
|
|
337
|
+
<Box
|
|
338
|
+
sx={{ overflowY: "auto", maxHeight: 420, px: 0.75, py: 0.75 }}
|
|
339
|
+
>
|
|
340
|
+
{visible.length === 0 ? (
|
|
341
|
+
<Typography
|
|
342
|
+
variant="body2"
|
|
343
|
+
color="text.secondary"
|
|
344
|
+
sx={{ fontStyle: "italic", px: 1, py: 1 }}
|
|
345
|
+
>
|
|
346
|
+
{needle ? "No columns match" : "No columns"}
|
|
347
|
+
</Typography>
|
|
348
|
+
) : (
|
|
349
|
+
<Box
|
|
350
|
+
component="ul"
|
|
351
|
+
aria-labelledby={columnsId}
|
|
352
|
+
sx={{ listStyle: "none", m: 0, p: 0 }}
|
|
353
|
+
>
|
|
354
|
+
{visible.map((column, i) => (
|
|
355
|
+
<ColumnRow
|
|
356
|
+
key={`${column.name}-${i}`}
|
|
357
|
+
column={column}
|
|
358
|
+
/>
|
|
359
|
+
))}
|
|
360
|
+
</Box>
|
|
361
|
+
)}
|
|
362
|
+
</Box>
|
|
363
|
+
</Box>
|
|
364
|
+
)}
|
|
365
|
+
</AppDialog>
|
|
366
|
+
);
|
|
367
|
+
}
|