@mistriwork/kit 1.0.0-rc.11 → 1.0.0-rc.12
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/client/actionGrants.d.ts +21 -0
- package/dist/client/actionGrants.js +24 -0
- package/dist/client/addressMount.d.ts +67 -0
- package/dist/client/addressMount.js +136 -0
- package/dist/client/app.d.ts +10 -0
- package/dist/client/app.js +976 -0
- package/dist/client/boot.d.ts +1 -0
- package/dist/client/boot.js +37 -0
- package/dist/client/brandLook.css +125 -0
- package/dist/client/breakdownBatch.d.ts +34 -0
- package/dist/client/breakdownBatch.js +115 -0
- package/dist/client/bulkActions.d.ts +66 -0
- package/dist/client/bulkActions.js +171 -0
- package/dist/client/chart.d.ts +20 -0
- package/dist/client/chart.js +80 -0
- package/dist/client/clauses.d.ts +121 -0
- package/dist/client/clauses.js +276 -0
- package/dist/client/columns.d.ts +77 -0
- package/dist/client/columns.js +102 -0
- package/dist/client/components/Accordion.d.ts +26 -0
- package/dist/client/components/Accordion.js +44 -0
- package/dist/client/components/ApiOperations.d.ts +3 -0
- package/dist/client/components/ApiOperations.js +162 -0
- package/dist/client/components/AppColumnMenu.d.ts +66 -0
- package/dist/client/components/AppColumnMenu.js +59 -0
- package/dist/client/components/AppColumnMenuPopups.d.ts +21 -0
- package/dist/client/components/AppColumnMenuPopups.js +92 -0
- package/dist/client/components/AppFooter.css +17 -0
- package/dist/client/components/AppFooter.d.ts +23 -0
- package/dist/client/components/AppFooter.js +12 -0
- package/dist/client/components/AppIssues.d.ts +4 -0
- package/dist/client/components/AppIssues.js +18 -0
- package/dist/client/components/AppList.d.ts +20 -0
- package/dist/client/components/AppList.js +696 -0
- package/dist/client/components/AttachmentList.d.ts +45 -0
- package/dist/client/components/AttachmentList.js +178 -0
- package/dist/client/components/BoardList.css +9 -0
- package/dist/client/components/Breakdown.d.ts +11 -0
- package/dist/client/components/Breakdown.js +157 -0
- package/dist/client/components/BreakdownRoom.d.ts +4 -0
- package/dist/client/components/BreakdownRoom.js +48 -0
- package/dist/client/components/CardsList.d.ts +23 -0
- package/dist/client/components/CardsList.js +209 -0
- package/dist/client/components/Chart.css +165 -0
- package/dist/client/components/Chart.d.ts +194 -0
- package/dist/client/components/Chart.js +801 -0
- package/dist/client/components/ChartFigure.d.ts +82 -0
- package/dist/client/components/ChartFigure.js +102 -0
- package/dist/client/components/ChartShapes.css +213 -0
- package/dist/client/components/ChartShapes.d.ts +63 -0
- package/dist/client/components/ChartShapes.js +393 -0
- package/dist/client/components/Checklist.css +16 -0
- package/dist/client/components/Composer.d.ts +1 -0
- package/dist/client/components/Composer.js +331 -0
- package/dist/client/components/Content.d.ts +8 -0
- package/dist/client/components/Content.js +170 -0
- package/dist/client/components/CountedLabel.d.ts +10 -0
- package/dist/client/components/CountedLabel.js +26 -0
- package/dist/client/components/Crumbs.d.ts +11 -0
- package/dist/client/components/Crumbs.js +142 -0
- package/dist/client/components/DashboardList.css +7 -0
- package/dist/client/components/DashboardList.d.ts +9 -0
- package/dist/client/components/DashboardList.js +46 -0
- package/dist/client/components/DashboardNote.d.ts +21 -0
- package/dist/client/components/DashboardNote.js +22 -0
- package/dist/client/components/DateField.css +6 -0
- package/dist/client/components/DateField.d.ts +7 -0
- package/dist/client/components/DateField.js +27 -0
- package/dist/client/components/DefinedFields.d.ts +50 -0
- package/dist/client/components/DefinedFields.js +186 -0
- package/dist/client/components/DeleteButton.d.ts +30 -0
- package/dist/client/components/DeleteButton.js +198 -0
- package/dist/client/components/Diagram.d.ts +7 -0
- package/dist/client/components/Diagram.js +320 -0
- package/dist/client/components/Dressed.d.ts +31 -0
- package/dist/client/components/Dressed.js +138 -0
- package/dist/client/components/Dropdown.d.ts +14 -0
- package/dist/client/components/Dropdown.js +20 -0
- package/dist/client/components/EditLayoutButton.d.ts +13 -0
- package/dist/client/components/EditLayoutButton.js +7 -0
- package/dist/client/components/Editable.d.ts +47 -0
- package/dist/client/components/Editable.js +422 -0
- package/dist/client/components/ErrorBoundary.d.ts +40 -0
- package/dist/client/components/ErrorBoundary.js +41 -0
- package/dist/client/components/Export.d.ts +15 -0
- package/dist/client/components/Export.js +151 -0
- package/dist/client/components/ExportHold.d.ts +18 -0
- package/dist/client/components/ExportHold.js +30 -0
- package/dist/client/components/FavoriteStar.d.ts +5 -0
- package/dist/client/components/FavoriteStar.js +14 -0
- package/dist/client/components/FieldArranger.d.ts +28 -0
- package/dist/client/components/FieldArranger.js +82 -0
- package/dist/client/components/FilePreview.css +20 -0
- package/dist/client/components/FilePreview.d.ts +26 -0
- package/dist/client/components/FilePreview.js +170 -0
- package/dist/client/components/FilterBoxes.d.ts +76 -0
- package/dist/client/components/FilterBoxes.js +294 -0
- package/dist/client/components/FilterRail.css +100 -0
- package/dist/client/components/FilterRail.d.ts +61 -0
- package/dist/client/components/FilterRail.js +559 -0
- package/dist/client/components/Gallery.d.ts +11 -0
- package/dist/client/components/Gallery.js +53 -0
- package/dist/client/components/Grid.d.ts +122 -0
- package/dist/client/components/Grid.js +1115 -0
- package/dist/client/components/GridCellEditor.d.ts +35 -0
- package/dist/client/components/GridCellEditor.js +291 -0
- package/dist/client/components/GridSelection.d.ts +16 -0
- package/dist/client/components/GridSelection.js +28 -0
- package/dist/client/components/HelpPanel.d.ts +5 -0
- package/dist/client/components/HelpPanel.js +92 -0
- package/dist/client/components/History.d.ts +10 -0
- package/dist/client/components/History.js +22 -0
- package/dist/client/components/Icon.d.ts +31 -0
- package/dist/client/components/Icon.js +20 -0
- package/dist/client/components/JsonPreview.d.ts +5 -0
- package/dist/client/components/JsonPreview.js +25 -0
- package/dist/client/components/JsonValue.d.ts +4 -0
- package/dist/client/components/JsonValue.js +3 -0
- package/dist/client/components/JsonView.css +109 -0
- package/dist/client/components/JsonView.d.ts +3 -0
- package/dist/client/components/JsonView.js +118 -0
- package/dist/client/components/Landing.d.ts +19 -0
- package/dist/client/components/Landing.js +55 -0
- package/dist/client/components/LandingSurface.css +177 -0
- package/dist/client/components/LandingSurface.d.ts +42 -0
- package/dist/client/components/LandingSurface.js +108 -0
- package/dist/client/components/LayoutBuilder.d.ts +36 -0
- package/dist/client/components/LayoutBuilder.js +104 -0
- package/dist/client/components/Lightbox.d.ts +29 -0
- package/dist/client/components/Lightbox.js +62 -0
- package/dist/client/components/ListEmpty.css +13 -0
- package/dist/client/components/ListEmpty.d.ts +10 -0
- package/dist/client/components/ListEmpty.js +8 -0
- package/dist/client/components/ListFilterBar.css +76 -0
- package/dist/client/components/ListFilterBar.d.ts +52 -0
- package/dist/client/components/ListFilterBar.js +304 -0
- package/dist/client/components/LiveNotices.css +105 -0
- package/dist/client/components/LiveNotices.d.ts +26 -0
- package/dist/client/components/LiveNotices.js +211 -0
- package/dist/client/components/MinorMoneyInput.d.ts +26 -0
- package/dist/client/components/MinorMoneyInput.js +50 -0
- package/dist/client/components/Modal.css +3 -0
- package/dist/client/components/MultiStepForm.css +122 -0
- package/dist/client/components/MultiStepForm.d.ts +59 -0
- package/dist/client/components/MultiStepForm.js +216 -0
- package/dist/client/components/NavGlyph.d.ts +14 -0
- package/dist/client/components/NavGlyph.js +27 -0
- package/dist/client/components/Nested.d.ts +21 -0
- package/dist/client/components/Nested.js +86 -0
- package/dist/client/components/NewRecord.d.ts +89 -0
- package/dist/client/components/NewRecord.js +897 -0
- package/dist/client/components/NewRecordButton.d.ts +13 -0
- package/dist/client/components/NewRecordButton.js +28 -0
- package/dist/client/components/Notes.css +39 -0
- package/dist/client/components/Notes.d.ts +59 -0
- package/dist/client/components/Notes.js +96 -0
- package/dist/client/components/OverflowMenu.d.ts +3 -0
- package/dist/client/components/OverflowMenu.js +60 -0
- package/dist/client/components/Page.d.ts +52 -0
- package/dist/client/components/Page.js +237 -0
- package/dist/client/components/PageCurrent.d.ts +38 -0
- package/dist/client/components/PageCurrent.js +27 -0
- package/dist/client/components/PageEmptyRun.d.ts +18 -0
- package/dist/client/components/PageEmptyRun.js +118 -0
- package/dist/client/components/PageFields.d.ts +3 -0
- package/dist/client/components/PageFields.js +294 -0
- package/dist/client/components/PageFlowDiagram.css +193 -0
- package/dist/client/components/PageFlowDiagram.d.ts +95 -0
- package/dist/client/components/PageFlowDiagram.js +276 -0
- package/dist/client/components/PageFlows.css +27 -0
- package/dist/client/components/PageFlows.d.ts +54 -0
- package/dist/client/components/PageFlows.js +92 -0
- package/dist/client/components/PageGroups.d.ts +43 -0
- package/dist/client/components/PageGroups.js +123 -0
- package/dist/client/components/PageHead.d.ts +28 -0
- package/dist/client/components/PageHead.js +279 -0
- package/dist/client/components/PageHeadline.d.ts +23 -0
- package/dist/client/components/PageHeadline.js +101 -0
- package/dist/client/components/PageHistory.d.ts +62 -0
- package/dist/client/components/PageHistory.js +160 -0
- package/dist/client/components/PageLayout.d.ts +22 -0
- package/dist/client/components/PageLayout.js +13 -0
- package/dist/client/components/PageMetrics.d.ts +11 -0
- package/dist/client/components/PageMetrics.js +252 -0
- package/dist/client/components/PageRelated.d.ts +70 -0
- package/dist/client/components/PageRelated.js +667 -0
- package/dist/client/components/PageRoom.d.ts +37 -0
- package/dist/client/components/PageRoom.js +277 -0
- package/dist/client/components/PageSectionBox.d.ts +28 -0
- package/dist/client/components/PageSectionBox.js +65 -0
- package/dist/client/components/PageSections.d.ts +38 -0
- package/dist/client/components/PageSections.js +352 -0
- package/dist/client/components/PageSkeleton.css +17 -0
- package/dist/client/components/PageSkeleton.d.ts +11 -0
- package/dist/client/components/PageSkeleton.js +25 -0
- package/dist/client/components/PageTimeline.d.ts +2 -0
- package/dist/client/components/PageTimeline.js +273 -0
- package/dist/client/components/Palette.d.ts +4 -0
- package/dist/client/components/Palette.js +176 -0
- package/dist/client/components/Peek.d.ts +1 -0
- package/dist/client/components/Peek.js +158 -0
- package/dist/client/components/PeekPanel.d.ts +16 -0
- package/dist/client/components/PeekPanel.js +120 -0
- package/dist/client/components/Picker.d.ts +13 -0
- package/dist/client/components/Picker.js +33 -0
- package/dist/client/components/Prefs.d.ts +3 -0
- package/dist/client/components/Prefs.js +121 -0
- package/dist/client/components/PresentationSwitch.d.ts +13 -0
- package/dist/client/components/PresentationSwitch.js +10 -0
- package/dist/client/components/Prompt.d.ts +35 -0
- package/dist/client/components/Prompt.js +114 -0
- package/dist/client/components/QrCode.css +11 -0
- package/dist/client/components/QrCode.d.ts +4 -0
- package/dist/client/components/QrCode.js +57 -0
- package/dist/client/components/QueueList.css +122 -0
- package/dist/client/components/QuickAdd.css +18 -0
- package/dist/client/components/QuickAdd.d.ts +11 -0
- package/dist/client/components/QuickAdd.js +53 -0
- package/dist/client/components/QuickAddOnDemand.d.ts +4 -0
- package/dist/client/components/QuickAddOnDemand.js +10 -0
- package/dist/client/components/Record.d.ts +36 -0
- package/dist/client/components/Record.js +385 -0
- package/dist/client/components/RecordGone.d.ts +7 -0
- package/dist/client/components/RecordGone.js +22 -0
- package/dist/client/components/RecordPicker.d.ts +59 -0
- package/dist/client/components/RecordPicker.js +299 -0
- package/dist/client/components/RecordSummaries.d.ts +55 -0
- package/dist/client/components/RecordSummaries.js +151 -0
- package/dist/client/components/RecordTags.d.ts +6 -0
- package/dist/client/components/RecordTags.js +119 -0
- package/dist/client/components/RecordTrailNav.d.ts +25 -0
- package/dist/client/components/RecordTrailNav.js +110 -0
- package/dist/client/components/RichText.d.ts +7 -0
- package/dist/client/components/RichText.js +82 -0
- package/dist/client/components/RichTextEditor.css +202 -0
- package/dist/client/components/RichTextEditor.d.ts +33 -0
- package/dist/client/components/RichTextEditor.js +348 -0
- package/dist/client/components/RichTextField.d.ts +26 -0
- package/dist/client/components/RichTextField.js +71 -0
- package/dist/client/components/Rooms.d.ts +35 -0
- package/dist/client/components/Rooms.js +276 -0
- package/dist/client/components/RowActions.d.ts +8 -0
- package/dist/client/components/RowActions.js +49 -0
- package/dist/client/components/RowHost.d.ts +110 -0
- package/dist/client/components/RowHost.js +212 -0
- package/dist/client/components/SavedViews.d.ts +25 -0
- package/dist/client/components/SavedViews.js +35 -0
- package/dist/client/components/SchemaExport.d.ts +15 -0
- package/dist/client/components/SchemaExport.js +42 -0
- package/dist/client/components/SectionPeriod.css +14 -0
- package/dist/client/components/SectionPeriod.d.ts +7 -0
- package/dist/client/components/SectionPeriod.js +14 -0
- package/dist/client/components/SetFieldDialog.d.ts +12 -0
- package/dist/client/components/SetFieldDialog.js +51 -0
- package/dist/client/components/Sidebar.d.ts +34 -0
- package/dist/client/components/Sidebar.js +398 -0
- package/dist/client/components/Skeleton.d.ts +35 -0
- package/dist/client/components/Skeleton.js +49 -0
- package/dist/client/components/SortMenu.d.ts +20 -0
- package/dist/client/components/SortMenu.js +45 -0
- package/dist/client/components/SplitListDetail.css +119 -0
- package/dist/client/components/SuggestBox.d.ts +29 -0
- package/dist/client/components/SuggestBox.js +60 -0
- package/dist/client/components/Summary.d.ts +14 -0
- package/dist/client/components/Summary.js +93 -0
- package/dist/client/components/TableRoom.d.ts +88 -0
- package/dist/client/components/TableRoom.js +246 -0
- package/dist/client/components/TableView.d.ts +111 -0
- package/dist/client/components/TableView.js +324 -0
- package/dist/client/components/ThMenu.d.ts +40 -0
- package/dist/client/components/ThMenu.js +163 -0
- package/dist/client/components/ThemeLab.d.ts +4 -0
- package/dist/client/components/ThemeLab.js +67 -0
- package/dist/client/components/TimelineSides.css +23 -0
- package/dist/client/components/TimelineSides.d.ts +7 -0
- package/dist/client/components/TimelineSides.js +9 -0
- package/dist/client/components/Tour.d.ts +12 -0
- package/dist/client/components/Tour.js +131 -0
- package/dist/client/components/Value.d.ts +38 -0
- package/dist/client/components/Value.js +172 -0
- package/dist/client/components/WorkPanel.d.ts +9 -0
- package/dist/client/components/WorkPanel.js +43 -0
- package/dist/client/components/WorkflowStatus.d.ts +6 -0
- package/dist/client/components/WorkflowStatus.js +44 -0
- package/dist/client/components/WriteConfirm.d.ts +4 -0
- package/dist/client/components/WriteConfirm.js +27 -0
- package/dist/client/components/appColumnMenuModel.d.ts +46 -0
- package/dist/client/components/appColumnMenuModel.js +51 -0
- package/dist/client/components/appListModel.d.ts +179 -0
- package/dist/client/components/appListModel.js +421 -0
- package/dist/client/components/appRooms.d.ts +106 -0
- package/dist/client/components/appRooms.js +133 -0
- package/dist/client/components/autoChart.d.ts +33 -0
- package/dist/client/components/autoChart.js +107 -0
- package/dist/client/components/avatarPhotos.d.ts +45 -0
- package/dist/client/components/avatarPhotos.js +93 -0
- package/dist/client/components/besideDetail.d.ts +1 -0
- package/dist/client/components/besideDetail.js +10 -0
- package/dist/client/components/boardNew.d.ts +2 -0
- package/dist/client/components/boardNew.js +8 -0
- package/dist/client/components/cardsModel.d.ts +11 -0
- package/dist/client/components/cardsModel.js +24 -0
- package/dist/client/components/chromeIcons.d.ts +16 -0
- package/dist/client/components/chromeIcons.js +16 -0
- package/dist/client/components/columnPresentation.d.ts +8 -0
- package/dist/client/components/columnPresentation.js +47 -0
- package/dist/client/components/componentSlot.d.ts +31 -0
- package/dist/client/components/componentSlot.js +76 -0
- package/dist/client/components/composerDraft.d.ts +16 -0
- package/dist/client/components/composerDraft.js +16 -0
- package/dist/client/components/conditionText.d.ts +14 -0
- package/dist/client/components/conditionText.js +45 -0
- package/dist/client/components/conditionWords.d.ts +37 -0
- package/dist/client/components/conditionWords.js +382 -0
- package/dist/client/components/crumbSlot.d.ts +14 -0
- package/dist/client/components/crumbSlot.js +49 -0
- package/dist/client/components/dashboardModel.d.ts +283 -0
- package/dist/client/components/dashboardModel.js +415 -0
- package/dist/client/components/dashboardParts.d.ts +9 -0
- package/dist/client/components/dashboardParts.js +18 -0
- package/dist/client/components/diagramModel.d.ts +83 -0
- package/dist/client/components/diagramModel.js +211 -0
- package/dist/client/components/dueOpen.d.ts +1 -0
- package/dist/client/components/dueOpen.js +23 -0
- package/dist/client/components/editInteraction.d.ts +20 -0
- package/dist/client/components/editInteraction.js +178 -0
- package/dist/client/components/favoriteNav.d.ts +6 -0
- package/dist/client/components/favoriteNav.js +31 -0
- package/dist/client/components/favorites.d.ts +23 -0
- package/dist/client/components/favorites.js +86 -0
- package/dist/client/components/filePreviewModel.d.ts +18 -0
- package/dist/client/components/filePreviewModel.js +21 -0
- package/dist/client/components/filterRailModel.d.ts +93 -0
- package/dist/client/components/filterRailModel.js +302 -0
- package/dist/client/components/formControlsStyle.d.ts +1 -0
- package/dist/client/components/formControlsStyle.js +3 -0
- package/dist/client/components/formDefaults.d.ts +17 -0
- package/dist/client/components/formDefaults.js +128 -0
- package/dist/client/components/gridArrange.d.ts +33 -0
- package/dist/client/components/gridArrange.js +62 -0
- package/dist/client/components/gridCellModel.d.ts +32 -0
- package/dist/client/components/gridCellModel.js +42 -0
- package/dist/client/components/gridSizing.d.ts +89 -0
- package/dist/client/components/gridSizing.js +295 -0
- package/dist/client/components/groupMoves.d.ts +44 -0
- package/dist/client/components/groupMoves.js +295 -0
- package/dist/client/components/groupOrder.d.ts +43 -0
- package/dist/client/components/groupOrder.js +63 -0
- package/dist/client/components/inputRenderers.d.ts +48 -0
- package/dist/client/components/inputRenderers.js +37 -0
- package/dist/client/components/intakeStyle.d.ts +2 -0
- package/dist/client/components/intakeStyle.js +6 -0
- package/dist/client/components/jsonModel.d.ts +98 -0
- package/dist/client/components/jsonModel.js +264 -0
- package/dist/client/components/listColumn.d.ts +20 -0
- package/dist/client/components/listColumn.js +31 -0
- package/dist/client/components/listNavigation.d.ts +16 -0
- package/dist/client/components/listNavigation.js +14 -0
- package/dist/client/components/mentionRows.d.ts +5 -0
- package/dist/client/components/mentionRows.js +62 -0
- package/dist/client/components/mount.d.ts +55 -0
- package/dist/client/components/mount.js +155 -0
- package/dist/client/components/myViews.d.ts +54 -0
- package/dist/client/components/myViews.js +82 -0
- package/dist/client/components/navCounts.d.ts +84 -0
- package/dist/client/components/navCounts.js +194 -0
- package/dist/client/components/navigationTree.d.ts +52 -0
- package/dist/client/components/navigationTree.js +49 -0
- package/dist/client/components/newMenuModel.d.ts +27 -0
- package/dist/client/components/newMenuModel.js +58 -0
- package/dist/client/components/newRecordModel.d.ts +58 -0
- package/dist/client/components/newRecordModel.js +232 -0
- package/dist/client/components/onDemand.d.ts +30 -0
- package/dist/client/components/onDemand.js +121 -0
- package/dist/client/components/optimisticMoves.d.ts +21 -0
- package/dist/client/components/optimisticMoves.js +145 -0
- package/dist/client/components/pageContext.d.ts +154 -0
- package/dist/client/components/pageContext.js +47 -0
- package/dist/client/components/pageFieldsRead.d.ts +67 -0
- package/dist/client/components/pageFieldsRead.js +55 -0
- package/dist/client/components/pageModel.d.ts +203 -0
- package/dist/client/components/pageModel.js +67 -0
- package/dist/client/components/pageStep.d.ts +31 -0
- package/dist/client/components/pageStep.js +15 -0
- package/dist/client/components/paletteModel.d.ts +9 -0
- package/dist/client/components/paletteModel.js +46 -0
- package/dist/client/components/pickerStaleness.d.ts +32 -0
- package/dist/client/components/pickerStaleness.js +27 -0
- package/dist/client/components/placeOrder.d.ts +47 -0
- package/dist/client/components/placeOrder.js +71 -0
- package/dist/client/components/pointerDrag.d.ts +54 -0
- package/dist/client/components/pointerDrag.js +95 -0
- package/dist/client/components/presentationFit.d.ts +19 -0
- package/dist/client/components/presentationFit.js +32 -0
- package/dist/client/components/recordKeys.d.ts +2 -0
- package/dist/client/components/recordKeys.js +8 -0
- package/dist/client/components/recordSearch.d.ts +31 -0
- package/dist/client/components/recordSearch.js +80 -0
- package/dist/client/components/recordSurface.d.ts +86 -0
- package/dist/client/components/recordSurface.js +267 -0
- package/dist/client/components/rowOpens.d.ts +19 -0
- package/dist/client/components/rowOpens.js +25 -0
- package/dist/client/components/sidebarModel.d.ts +152 -0
- package/dist/client/components/sidebarModel.js +372 -0
- package/dist/client/components/suggestModel.d.ts +22 -0
- package/dist/client/components/suggestModel.js +49 -0
- package/dist/client/components/suggestPart.d.ts +4 -0
- package/dist/client/components/suggestPart.js +4 -0
- package/dist/client/components/textMeasure.d.ts +2 -0
- package/dist/client/components/textMeasure.js +35 -0
- package/dist/client/components/unknownIcon.d.ts +8 -0
- package/dist/client/components/unknownIcon.js +32 -0
- package/dist/client/components/useBulkSelection.d.ts +30 -0
- package/dist/client/components/useBulkSelection.js +360 -0
- package/dist/client/components/useConditionWords.d.ts +17 -0
- package/dist/client/components/useConditionWords.js +104 -0
- package/dist/client/components/useGridKeyboard.d.ts +32 -0
- package/dist/client/components/useGridKeyboard.js +223 -0
- package/dist/client/components/useListOrder.d.ts +94 -0
- package/dist/client/components/useListOrder.js +294 -0
- package/dist/client/components/useMediaQuery.d.ts +10 -0
- package/dist/client/components/useMediaQuery.js +45 -0
- package/dist/client/components/useMessageLanguage.d.ts +1 -0
- package/dist/client/components/useMessageLanguage.js +6 -0
- package/dist/client/components/usePins.d.ts +20 -0
- package/dist/client/components/usePins.js +66 -0
- package/dist/client/components/usePointerDrag.d.ts +72 -0
- package/dist/client/components/usePointerDrag.js +553 -0
- package/dist/client/components/useRecordInsert.d.ts +42 -0
- package/dist/client/components/useRecordInsert.js +145 -0
- package/dist/client/components/useRowWindow.d.ts +35 -0
- package/dist/client/components/useRowWindow.js +149 -0
- package/dist/client/components/useStickyHead.d.ts +17 -0
- package/dist/client/components/useStickyHead.js +65 -0
- package/dist/client/components/useTabFold.d.ts +32 -0
- package/dist/client/components/useTabFold.js +145 -0
- package/dist/client/components/valueModel.d.ts +300 -0
- package/dist/client/components/valueModel.js +560 -0
- package/dist/client/components/valueRenderers.d.ts +36 -0
- package/dist/client/components/valueRenderers.js +13 -0
- package/dist/client/components/viewLink.d.ts +27 -0
- package/dist/client/components/viewLink.js +79 -0
- package/dist/client/components/walk.d.ts +14 -0
- package/dist/client/components/walk.js +16 -0
- package/dist/client/compose.d.ts +8 -0
- package/dist/client/compose.js +163 -0
- package/dist/client/composedHook.d.ts +20 -0
- package/dist/client/composedHook.js +12 -0
- package/dist/client/composedReads.d.ts +26 -0
- package/dist/client/composedReads.js +183 -0
- package/dist/client/composer.css +499 -0
- package/dist/client/composer.d.ts +121 -0
- package/dist/client/composer.js +1079 -0
- package/dist/client/composerEntry.d.ts +1 -0
- package/dist/client/composerEntry.js +58 -0
- package/dist/client/composerTab.d.ts +6 -0
- package/dist/client/composerTab.js +20 -0
- package/dist/client/conditions.d.ts +46 -0
- package/dist/client/conditions.js +150 -0
- package/dist/client/connectionList.d.ts +11 -0
- package/dist/client/connectionList.js +146 -0
- package/dist/client/connectionScope.d.ts +6 -0
- package/dist/client/connectionScope.js +14 -0
- package/dist/client/connectionTransition.d.ts +12 -0
- package/dist/client/connectionTransition.js +41 -0
- package/dist/client/copy/columnMenu/components/AppColumnMenu.d.ts +4 -0
- package/dist/client/copy/columnMenu/components/AppColumnMenu.js +6 -0
- package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.d.ts +4 -0
- package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.js +6 -0
- package/dist/client/copy/columnMenu/components/ThMenu.d.ts +35 -0
- package/dist/client/copy/columnMenu/components/ThMenu.js +37 -0
- package/dist/client/copy/columnMenu/components/appColumnMenuModel.d.ts +10 -0
- package/dist/client/copy/columnMenu/components/appColumnMenuModel.js +12 -0
- package/dist/client/copy/dashboards/breakdownBatch.d.ts +3 -0
- package/dist/client/copy/dashboards/breakdownBatch.js +5 -0
- package/dist/client/copy/dashboards/components/Breakdown.d.ts +32 -0
- package/dist/client/copy/dashboards/components/Breakdown.js +25 -0
- package/dist/client/copy/dashboards/components/BreakdownRoom.d.ts +3 -0
- package/dist/client/copy/dashboards/components/BreakdownRoom.js +5 -0
- package/dist/client/copy/dashboards/components/Chart.d.ts +26 -0
- package/dist/client/copy/dashboards/components/Chart.js +19 -0
- package/dist/client/copy/dashboards/components/ChartShapes.d.ts +16 -0
- package/dist/client/copy/dashboards/components/ChartShapes.js +12 -0
- package/dist/client/copy/dashboards/components/PageMetrics.d.ts +21 -0
- package/dist/client/copy/dashboards/components/PageMetrics.js +20 -0
- package/dist/client/copy/dashboards/components/SectionPeriod.d.ts +4 -0
- package/dist/client/copy/dashboards/components/SectionPeriod.js +6 -0
- package/dist/client/copy/dashboards/components/dashboardModel.d.ts +3 -0
- package/dist/client/copy/dashboards/components/dashboardModel.js +5 -0
- package/dist/client/copy/es.d.ts +11 -0
- package/dist/client/copy/es.js +60 -0
- package/dist/client/copy/filters/components/FilterBoxes.d.ts +10 -0
- package/dist/client/copy/filters/components/FilterBoxes.js +12 -0
- package/dist/client/copy/filters/components/FilterRail.d.ts +16 -0
- package/dist/client/copy/filters/components/FilterRail.js +18 -0
- package/dist/client/copy/filters/components/ListFilterBar.d.ts +9 -0
- package/dist/client/copy/filters/components/ListFilterBar.js +11 -0
- package/dist/client/copy/filters/components/conditionWords.d.ts +46 -0
- package/dist/client/copy/filters/components/conditionWords.js +95 -0
- package/dist/client/copy/filters/components/filterRailModel.d.ts +12 -0
- package/dist/client/copy/filters/components/filterRailModel.js +14 -0
- package/dist/client/copy/forms/components/DateField.d.ts +13 -0
- package/dist/client/copy/forms/components/DateField.js +15 -0
- package/dist/client/copy/forms/components/MinorMoneyInput.d.ts +4 -0
- package/dist/client/copy/forms/components/MinorMoneyInput.js +6 -0
- package/dist/client/copy/forms/components/MultiStepForm.d.ts +10 -0
- package/dist/client/copy/forms/components/MultiStepForm.js +12 -0
- package/dist/client/copy/forms/components/NewRecord.d.ts +29 -0
- package/dist/client/copy/forms/components/NewRecord.js +31 -0
- package/dist/client/copy/forms/components/NewRecordButton.d.ts +6 -0
- package/dist/client/copy/forms/components/NewRecordButton.js +8 -0
- package/dist/client/copy/forms/components/Picker.d.ts +4 -0
- package/dist/client/copy/forms/components/Picker.js +6 -0
- package/dist/client/copy/forms/components/QuickAdd.d.ts +3 -0
- package/dist/client/copy/forms/components/QuickAdd.js +5 -0
- package/dist/client/copy/forms/components/RecordPicker.d.ts +6 -0
- package/dist/client/copy/forms/components/RecordPicker.js +8 -0
- package/dist/client/copy/forms/components/RichTextEditor.d.ts +36 -0
- package/dist/client/copy/forms/components/RichTextEditor.js +40 -0
- package/dist/client/copy/forms/components/RichTextField.d.ts +3 -0
- package/dist/client/copy/forms/components/RichTextField.js +5 -0
- package/dist/client/copy/forms/components/SetFieldDialog.d.ts +10 -0
- package/dist/client/copy/forms/components/SetFieldDialog.js +9 -0
- package/dist/client/copy/forms/components/useRecordInsert.d.ts +7 -0
- package/dist/client/copy/forms/components/useRecordInsert.js +9 -0
- package/dist/client/copy/help/helpContent.d.ts +71 -0
- package/dist/client/copy/help/helpContent.js +73 -0
- package/dist/client/copy/lists/bulkActions.d.ts +12 -0
- package/dist/client/copy/lists/bulkActions.js +14 -0
- package/dist/client/copy/lists/components/AppList.d.ts +28 -0
- package/dist/client/copy/lists/components/AppList.js +30 -0
- package/dist/client/copy/lists/components/CardsList.d.ts +3 -0
- package/dist/client/copy/lists/components/CardsList.js +5 -0
- package/dist/client/copy/lists/components/Gallery.d.ts +7 -0
- package/dist/client/copy/lists/components/Gallery.js +9 -0
- package/dist/client/copy/lists/components/Grid.d.ts +30 -0
- package/dist/client/copy/lists/components/Grid.js +29 -0
- package/dist/client/copy/lists/components/GridCellEditor.d.ts +5 -0
- package/dist/client/copy/lists/components/GridCellEditor.js +7 -0
- package/dist/client/copy/lists/components/GridSelection.d.ts +4 -0
- package/dist/client/copy/lists/components/GridSelection.js +6 -0
- package/dist/client/copy/lists/components/Nested.d.ts +7 -0
- package/dist/client/copy/lists/components/Nested.js +9 -0
- package/dist/client/copy/lists/components/RowActions.d.ts +1 -0
- package/dist/client/copy/lists/components/RowActions.js +3 -0
- package/dist/client/copy/lists/components/SavedViews.d.ts +5 -0
- package/dist/client/copy/lists/components/SavedViews.js +7 -0
- package/dist/client/copy/lists/components/SortMenu.d.ts +5 -0
- package/dist/client/copy/lists/components/SortMenu.js +7 -0
- package/dist/client/copy/lists/components/TableRoom.d.ts +12 -0
- package/dist/client/copy/lists/components/TableRoom.js +14 -0
- package/dist/client/copy/lists/components/TableView.d.ts +37 -0
- package/dist/client/copy/lists/components/TableView.js +39 -0
- package/dist/client/copy/lists/components/appListModel.d.ts +6 -0
- package/dist/client/copy/lists/components/appListModel.js +5 -0
- package/dist/client/copy/lists/components/myViews.d.ts +4 -0
- package/dist/client/copy/lists/components/myViews.js +6 -0
- package/dist/client/copy/lists/components/placeOrder.d.ts +4 -0
- package/dist/client/copy/lists/components/placeOrder.js +6 -0
- package/dist/client/copy/lists/components/useBulkSelection.d.ts +20 -0
- package/dist/client/copy/lists/components/useBulkSelection.js +16 -0
- package/dist/client/copy/lists/components/useListOrder.d.ts +7 -0
- package/dist/client/copy/lists/components/useListOrder.js +9 -0
- package/dist/client/copy/public/components/appRooms.d.ts +3 -0
- package/dist/client/copy/public/components/appRooms.js +5 -0
- package/dist/client/copy/record/components/Actions.d.ts +13 -0
- package/dist/client/copy/record/components/Actions.js +15 -0
- package/dist/client/copy/record/components/AttachmentList.d.ts +23 -0
- package/dist/client/copy/record/components/AttachmentList.js +22 -0
- package/dist/client/copy/record/components/DeleteButton.d.ts +22 -0
- package/dist/client/copy/record/components/DeleteButton.js +24 -0
- package/dist/client/copy/record/components/Dressed.d.ts +5 -0
- package/dist/client/copy/record/components/Dressed.js +7 -0
- package/dist/client/copy/record/components/EditLayoutButton.d.ts +5 -0
- package/dist/client/copy/record/components/EditLayoutButton.js +7 -0
- package/dist/client/copy/record/components/Editable.d.ts +25 -0
- package/dist/client/copy/record/components/Editable.js +24 -0
- package/dist/client/copy/record/components/FieldArranger.d.ts +15 -0
- package/dist/client/copy/record/components/FieldArranger.js +17 -0
- package/dist/client/copy/record/components/FilePreview.d.ts +13 -0
- package/dist/client/copy/record/components/FilePreview.js +15 -0
- package/dist/client/copy/record/components/JsonPreview.d.ts +3 -0
- package/dist/client/copy/record/components/JsonPreview.js +5 -0
- package/dist/client/copy/record/components/JsonView.d.ts +12 -0
- package/dist/client/copy/record/components/JsonView.js +14 -0
- package/dist/client/copy/record/components/LayoutBuilder.d.ts +23 -0
- package/dist/client/copy/record/components/LayoutBuilder.js +25 -0
- package/dist/client/copy/record/components/Lightbox.d.ts +5 -0
- package/dist/client/copy/record/components/Lightbox.js +7 -0
- package/dist/client/copy/record/components/LiveNotices.d.ts +33 -0
- package/dist/client/copy/record/components/LiveNotices.js +29 -0
- package/dist/client/copy/record/components/PageCurrent.d.ts +1 -0
- package/dist/client/copy/record/components/PageCurrent.js +3 -0
- package/dist/client/copy/record/components/PageEmptyRun.d.ts +3 -0
- package/dist/client/copy/record/components/PageEmptyRun.js +5 -0
- package/dist/client/copy/record/components/PageFields.d.ts +5 -0
- package/dist/client/copy/record/components/PageFields.js +7 -0
- package/dist/client/copy/record/components/PageFlowDiagram.d.ts +33 -0
- package/dist/client/copy/record/components/PageFlowDiagram.js +37 -0
- package/dist/client/copy/record/components/PageFlows.d.ts +20 -0
- package/dist/client/copy/record/components/PageFlows.js +22 -0
- package/dist/client/copy/record/components/PageGroups.d.ts +12 -0
- package/dist/client/copy/record/components/PageGroups.js +14 -0
- package/dist/client/copy/record/components/PageHead.d.ts +8 -0
- package/dist/client/copy/record/components/PageHead.js +10 -0
- package/dist/client/copy/record/components/PageHistory.d.ts +18 -0
- package/dist/client/copy/record/components/PageHistory.js +20 -0
- package/dist/client/copy/record/components/PageLayout.d.ts +5 -0
- package/dist/client/copy/record/components/PageLayout.js +7 -0
- package/dist/client/copy/record/components/PageRelated.d.ts +24 -0
- package/dist/client/copy/record/components/PageRelated.js +26 -0
- package/dist/client/copy/record/components/PageRoom.d.ts +4 -0
- package/dist/client/copy/record/components/PageRoom.js +6 -0
- package/dist/client/copy/record/components/PageSectionBox.d.ts +6 -0
- package/dist/client/copy/record/components/PageSectionBox.js +10 -0
- package/dist/client/copy/record/components/PageTimeline.d.ts +9 -0
- package/dist/client/copy/record/components/PageTimeline.js +8 -0
- package/dist/client/copy/record/components/Peek.d.ts +3 -0
- package/dist/client/copy/record/components/Peek.js +5 -0
- package/dist/client/copy/record/components/PeekPanel.d.ts +5 -0
- package/dist/client/copy/record/components/PeekPanel.js +7 -0
- package/dist/client/copy/record/components/QrCode.d.ts +3 -0
- package/dist/client/copy/record/components/QrCode.js +5 -0
- package/dist/client/copy/record/components/Record.d.ts +19 -0
- package/dist/client/copy/record/components/Record.js +21 -0
- package/dist/client/copy/record/components/RecordGone.d.ts +4 -0
- package/dist/client/copy/record/components/RecordGone.js +6 -0
- package/dist/client/copy/record/components/RecordSummaries.d.ts +1 -0
- package/dist/client/copy/record/components/RecordSummaries.js +3 -0
- package/dist/client/copy/record/components/RecordTags.d.ts +9 -0
- package/dist/client/copy/record/components/RecordTags.js +11 -0
- package/dist/client/copy/record/components/RecordTrailNav.d.ts +8 -0
- package/dist/client/copy/record/components/RecordTrailNav.js +10 -0
- package/dist/client/copy/record/components/RichText.d.ts +4 -0
- package/dist/client/copy/record/components/RichText.js +6 -0
- package/dist/client/copy/record/components/Value.d.ts +4 -0
- package/dist/client/copy/record/components/Value.js +6 -0
- package/dist/client/copy/record/components/WorkflowStatus.d.ts +7 -0
- package/dist/client/copy/record/components/WorkflowStatus.js +9 -0
- package/dist/client/copy/record/components/WriteConfirm.d.ts +11 -0
- package/dist/client/copy/record/components/WriteConfirm.js +13 -0
- package/dist/client/copy/record/components/groupMoves.d.ts +7 -0
- package/dist/client/copy/record/components/groupMoves.js +9 -0
- package/dist/client/copy/record/components/jsonModel.d.ts +3 -0
- package/dist/client/copy/record/components/jsonModel.js +5 -0
- package/dist/client/copy/record/components/pageModel.d.ts +5 -0
- package/dist/client/copy/record/components/pageModel.js +7 -0
- package/dist/client/copy/record/components/recordSurface.d.ts +6 -0
- package/dist/client/copy/record/components/recordSurface.js +8 -0
- package/dist/client/copy/record/components/valueModel.d.ts +5 -0
- package/dist/client/copy/record/components/valueModel.js +7 -0
- package/dist/client/copy/record/fileSource.d.ts +3 -0
- package/dist/client/copy/record/fileSource.js +5 -0
- package/dist/client/copy/record/insert.d.ts +6 -0
- package/dist/client/copy/record/insert.js +8 -0
- package/dist/client/copy/record/page.d.ts +4 -0
- package/dist/client/copy/record/page.js +6 -0
- package/dist/client/copy/record/recordEditValidation.d.ts +4 -0
- package/dist/client/copy/record/recordEditValidation.js +6 -0
- package/dist/client/copy/record/savedPages.d.ts +4 -0
- package/dist/client/copy/record/savedPages.js +6 -0
- package/dist/client/copy/record/template.d.ts +9 -0
- package/dist/client/copy/record/template.js +11 -0
- package/dist/client/copy/record/write.d.ts +30 -0
- package/dist/client/copy/record/write.js +26 -0
- package/dist/client/copy/shell/app.d.ts +27 -0
- package/dist/client/copy/shell/app.js +43 -0
- package/dist/client/copy/shell/components/AppIssues.d.ts +10 -0
- package/dist/client/copy/shell/components/AppIssues.js +9 -0
- package/dist/client/copy/shell/components/Crumbs.d.ts +7 -0
- package/dist/client/copy/shell/components/Crumbs.js +17 -0
- package/dist/client/copy/shell/components/Dropdown.d.ts +3 -0
- package/dist/client/copy/shell/components/Dropdown.js +5 -0
- package/dist/client/copy/shell/components/ErrorBoundary.d.ts +4 -0
- package/dist/client/copy/shell/components/ErrorBoundary.js +6 -0
- package/dist/client/copy/shell/components/FavoriteStar.d.ts +4 -0
- package/dist/client/copy/shell/components/FavoriteStar.js +6 -0
- package/dist/client/copy/shell/components/MobileNavDrawer.d.ts +4 -0
- package/dist/client/copy/shell/components/MobileNavDrawer.js +12 -0
- package/dist/client/copy/shell/components/OverflowMenu.d.ts +3 -0
- package/dist/client/copy/shell/components/OverflowMenu.js +10 -0
- package/dist/client/copy/shell/components/Palette.d.ts +15 -0
- package/dist/client/copy/shell/components/Palette.js +18 -0
- package/dist/client/copy/shell/components/Prefs.d.ts +4 -0
- package/dist/client/copy/shell/components/Prefs.js +11 -0
- package/dist/client/copy/shell/components/Prompt.d.ts +1 -0
- package/dist/client/copy/shell/components/Prompt.js +3 -0
- package/dist/client/copy/shell/components/Rooms.d.ts +6 -0
- package/dist/client/copy/shell/components/Rooms.js +8 -0
- package/dist/client/copy/shell/components/Sidebar.d.ts +7 -0
- package/dist/client/copy/shell/components/Sidebar.js +9 -0
- package/dist/client/copy/shell/components/Skeleton.d.ts +5 -0
- package/dist/client/copy/shell/components/Skeleton.js +7 -0
- package/dist/client/copy/shell/components/TopNav.d.ts +4 -0
- package/dist/client/copy/shell/components/TopNav.js +12 -0
- package/dist/client/copy/shell/components/Tour.d.ts +4 -0
- package/dist/client/copy/shell/components/Tour.js +6 -0
- package/dist/client/copy/shell/components/newMenuModel.d.ts +3 -0
- package/dist/client/copy/shell/components/newMenuModel.js +5 -0
- package/dist/client/copy/shell/components/onDemand.d.ts +3 -0
- package/dist/client/copy/shell/components/onDemand.js +5 -0
- package/dist/client/copy/shell/components/sidebarModel.d.ts +3 -0
- package/dist/client/copy/shell/components/sidebarModel.js +5 -0
- package/dist/client/copy/shell/connectionList.d.ts +6 -0
- package/dist/client/copy/shell/connectionList.js +8 -0
- package/dist/client/copy/shell/core.d.ts +16 -0
- package/dist/client/copy/shell/core.js +18 -0
- package/dist/client/copy/shell/palette.d.ts +6 -0
- package/dist/client/copy/shell/palette.js +8 -0
- package/dist/client/copy/shell/prompt.d.ts +1 -0
- package/dist/client/copy/shell/prompt.js +3 -0
- package/dist/client/copy/shell/requestIdentity.d.ts +9 -0
- package/dist/client/copy/shell/requestIdentity.js +11 -0
- package/dist/client/copy/shell/resourceRequests.d.ts +4 -0
- package/dist/client/copy/shell/resourceRequests.js +6 -0
- package/dist/client/copy/shell/sessionIdentity.d.ts +11 -0
- package/dist/client/copy/shell/sessionIdentity.js +13 -0
- package/dist/client/copy/shell/sessionLifecycle.d.ts +5 -0
- package/dist/client/copy/shell/sessionLifecycle.js +7 -0
- package/dist/client/copy/shell/startup.d.ts +5 -0
- package/dist/client/copy/shell/startup.js +7 -0
- package/dist/client/copy/shell/theme.d.ts +5 -0
- package/dist/client/copy/shell/theme.js +14 -0
- package/dist/client/copy/shell/toast.d.ts +3 -0
- package/dist/client/copy/shell/toast.js +5 -0
- package/dist/client/copy/shell/updateAttempts.d.ts +6 -0
- package/dist/client/copy/shell/updateAttempts.js +8 -0
- package/dist/client/copy/shell/visualTheme.d.ts +4 -0
- package/dist/client/copy/shell/visualTheme.js +6 -0
- package/dist/client/copy/workbench/clauses.d.ts +3 -0
- package/dist/client/copy/workbench/clauses.js +5 -0
- package/dist/client/copy/workbench/components/ApiOperations.d.ts +21 -0
- package/dist/client/copy/workbench/components/ApiOperations.js +23 -0
- package/dist/client/copy/workbench/components/Composer.d.ts +105 -0
- package/dist/client/copy/workbench/components/Composer.js +92 -0
- package/dist/client/copy/workbench/components/Diagram.d.ts +56 -0
- package/dist/client/copy/workbench/components/Diagram.js +46 -0
- package/dist/client/copy/workbench/components/Export.d.ts +26 -0
- package/dist/client/copy/workbench/components/Export.js +25 -0
- package/dist/client/copy/workbench/components/HelpPanel.d.ts +10 -0
- package/dist/client/copy/workbench/components/HelpPanel.js +12 -0
- package/dist/client/copy/workbench/components/History.d.ts +11 -0
- package/dist/client/copy/workbench/components/History.js +10 -0
- package/dist/client/copy/workbench/components/Landing.d.ts +5 -0
- package/dist/client/copy/workbench/components/Landing.js +7 -0
- package/dist/client/copy/workbench/components/SchemaExport.d.ts +24 -0
- package/dist/client/copy/workbench/components/SchemaExport.js +20 -0
- package/dist/client/copy/workbench/components/Summary.d.ts +28 -0
- package/dist/client/copy/workbench/components/Summary.js +24 -0
- package/dist/client/copy/workbench/components/ThemeLab.d.ts +25 -0
- package/dist/client/copy/workbench/components/ThemeLab.js +27 -0
- package/dist/client/copy/workbench/components/WorkPanel.d.ts +12 -0
- package/dist/client/copy/workbench/components/WorkPanel.js +14 -0
- package/dist/client/copy/workbench/composer.d.ts +36 -0
- package/dist/client/copy/workbench/composer.js +32 -0
- package/dist/client/copy/workbench/composerEntry.d.ts +4 -0
- package/dist/client/copy/workbench/composerEntry.js +6 -0
- package/dist/client/copy/workbench/export.d.ts +8 -0
- package/dist/client/copy/workbench/export.js +7 -0
- package/dist/client/copy/workbench/filterbar.d.ts +6 -0
- package/dist/client/copy/workbench/filterbar.js +8 -0
- package/dist/client/copy/workbench/handoff.d.ts +20 -0
- package/dist/client/copy/workbench/handoff.js +19 -0
- package/dist/client/copy/workbench/help.d.ts +6 -0
- package/dist/client/copy/workbench/help.js +8 -0
- package/dist/client/copy/workbench/history.d.ts +3 -0
- package/dist/client/copy/workbench/history.js +5 -0
- package/dist/client/copy/workbench/schemaexport.d.ts +5 -0
- package/dist/client/copy/workbench/schemaexport.js +7 -0
- package/dist/client/copy/workbench/tour.d.ts +22 -0
- package/dist/client/copy/workbench/tour.js +24 -0
- package/dist/client/copy/workbench/views.d.ts +6 -0
- package/dist/client/copy/workbench/views.js +8 -0
- package/dist/client/core.d.ts +312 -0
- package/dist/client/core.js +1067 -0
- package/dist/client/customThemes.css +43 -0
- package/dist/client/dashboard.d.ts +16 -0
- package/dist/client/dashboard.js +35 -0
- package/dist/client/deeplink.d.ts +64 -0
- package/dist/client/deeplink.js +384 -0
- package/dist/client/delete.d.ts +8 -0
- package/dist/client/delete.js +35 -0
- package/dist/client/density.d.ts +8 -0
- package/dist/client/density.js +102 -0
- package/dist/client/devtoolsEventClient.d.ts +27 -0
- package/dist/client/devtoolsEventClient.js +32 -0
- package/dist/client/documents.d.ts +9 -0
- package/dist/client/documents.js +23 -0
- package/dist/client/dom.d.ts +36 -0
- package/dist/client/dom.js +232 -0
- package/dist/client/draftRecovery.d.ts +16 -0
- package/dist/client/draftRecovery.js +56 -0
- package/dist/client/export.d.ts +59 -0
- package/dist/client/export.js +217 -0
- package/dist/client/features.css +2187 -0
- package/dist/client/fieldErrors.d.ts +27 -0
- package/dist/client/fieldErrors.js +20 -0
- package/dist/client/fileSource.d.ts +10 -0
- package/dist/client/fileSource.js +115 -0
- package/dist/client/filterbar.d.ts +87 -0
- package/dist/client/filterbar.js +168 -0
- package/dist/client/firstPaint.d.ts +26 -0
- package/dist/client/firstPaint.js +102 -0
- package/dist/client/fonts/Barlow-OFL.txt +125 -0
- package/dist/client/fonts/IBMPlexMono-OFL.txt +104 -0
- package/dist/client/fonts/Inter-OFL.txt +92 -0
- package/dist/client/fonts/barlow-400.woff2 +0 -0
- package/dist/client/fonts/barlow-600.woff2 +0 -0
- package/dist/client/fonts/barlow-semi-condensed-700.woff2 +0 -0
- package/dist/client/fonts/ibm-plex-mono-400.woff2 +0 -0
- package/dist/client/fonts/ibm-plex-mono-500.woff2 +0 -0
- package/dist/client/fonts/inter-latin.woff2 +0 -0
- package/dist/client/formControls.css +5 -0
- package/dist/client/handoff.d.ts +47 -0
- package/dist/client/handoff.js +138 -0
- package/dist/client/help.css +151 -0
- package/dist/client/help.d.ts +20 -0
- package/dist/client/help.js +103 -0
- package/dist/client/helpContent.d.ts +95 -0
- package/dist/client/helpContent.js +661 -0
- package/dist/client/history.d.ts +10 -0
- package/dist/client/history.js +181 -0
- package/dist/client/historyToken.d.ts +18 -0
- package/dist/client/historyToken.js +27 -0
- package/dist/client/iconWeight.d.ts +16 -0
- package/dist/client/iconWeight.js +44 -0
- package/dist/client/index.html +244 -0
- package/dist/client/insert.d.ts +50 -0
- package/dist/client/insert.js +269 -0
- package/dist/client/kit.d.ts +7 -0
- package/dist/client/kit.js +1 -0
- package/dist/client/layoutDraftRecovery.d.ts +8 -0
- package/dist/client/layoutDraftRecovery.js +33 -0
- package/dist/client/ledgerLook.css +32 -0
- package/dist/client/liveReads.d.ts +23 -0
- package/dist/client/liveReads.js +38 -0
- package/dist/client/liveState.d.ts +94 -0
- package/dist/client/liveState.js +212 -0
- package/dist/client/locale.d.ts +141 -0
- package/dist/client/locale.js +0 -0
- package/dist/client/lumenLook.css +1867 -0
- package/dist/client/menu.d.ts +49 -0
- package/dist/client/menu.js +131 -0
- package/dist/client/menuScope.d.ts +6 -0
- package/dist/client/menuScope.js +4 -0
- package/dist/client/messages.d.ts +240 -0
- package/dist/client/messages.js +370 -0
- package/dist/client/motionStill.d.ts +1 -0
- package/dist/client/motionStill.js +17 -0
- package/dist/client/navigationHold.d.ts +37 -0
- package/dist/client/navigationHold.js +503 -0
- package/dist/client/nested.d.ts +8 -0
- package/dist/client/nested.js +26 -0
- package/dist/client/ownWrites.d.ts +33 -0
- package/dist/client/ownWrites.js +76 -0
- package/dist/client/page.css +4052 -0
- package/dist/client/page.d.ts +21 -0
- package/dist/client/page.js +187 -0
- package/dist/client/pagemarks.d.ts +32 -0
- package/dist/client/pagemarks.js +98 -0
- package/dist/client/palette.d.ts +35 -0
- package/dist/client/palette.js +357 -0
- package/dist/client/partsLook.css +1047 -0
- package/dist/client/peek.d.ts +11 -0
- package/dist/client/peek.js +51 -0
- package/dist/client/peekpanel.d.ts +26 -0
- package/dist/client/peekpanel.js +121 -0
- package/dist/client/pendingWork.d.ts +19 -0
- package/dist/client/pendingWork.js +36 -0
- package/dist/client/pins.d.ts +24 -0
- package/dist/client/pins.js +97 -0
- package/dist/client/prefs.d.ts +3 -0
- package/dist/client/prefs.js +32 -0
- package/dist/client/prompt.d.ts +27 -0
- package/dist/client/prompt.js +61 -0
- package/dist/client/readGathering.d.ts +4 -0
- package/dist/client/readGathering.js +23 -0
- package/dist/client/recordCompose.d.ts +11 -0
- package/dist/client/recordCompose.js +69 -0
- package/dist/client/recordDrafts.d.ts +40 -0
- package/dist/client/recordDrafts.js +57 -0
- package/dist/client/recordEditValidation.d.ts +12 -0
- package/dist/client/recordEditValidation.js +52 -0
- package/dist/client/recordIntent.d.ts +6 -0
- package/dist/client/recordIntent.js +15 -0
- package/dist/client/recordPress.d.ts +12 -0
- package/dist/client/recordPress.js +84 -0
- package/dist/client/recordSource.d.ts +6 -0
- package/dist/client/recordSource.js +15 -0
- package/dist/client/recordTrail.d.ts +77 -0
- package/dist/client/recordTrail.js +101 -0
- package/dist/client/recordWriteRefresh.d.ts +74 -0
- package/dist/client/recordWriteRefresh.js +284 -0
- package/dist/client/relatedRows.d.ts +4 -0
- package/dist/client/relatedRows.js +24 -0
- package/dist/client/requestIdentity.d.ts +36 -0
- package/dist/client/requestIdentity.js +97 -0
- package/dist/client/resourceRequests.d.ts +7 -0
- package/dist/client/resourceRequests.js +32 -0
- package/dist/client/roleLabels.d.ts +7 -0
- package/dist/client/roleLabels.js +24 -0
- package/dist/client/rowEditing.d.ts +15 -0
- package/dist/client/rowEditing.js +36 -0
- package/dist/client/sageLook.css +242 -0
- package/dist/client/savedPages.d.ts +15 -0
- package/dist/client/savedPages.js +123 -0
- package/dist/client/schemaexport.d.ts +14 -0
- package/dist/client/schemaexport.js +182 -0
- package/dist/client/sessionIdentity.d.ts +39 -0
- package/dist/client/sessionIdentity.js +255 -0
- package/dist/client/sessionLifecycle.d.ts +33 -0
- package/dist/client/sessionLifecycle.js +276 -0
- package/dist/client/shellHost.d.ts +70 -0
- package/dist/client/shellHost.js +92 -0
- package/dist/client/shellMain.d.ts +8 -0
- package/dist/client/shellMode.d.ts +433 -0
- package/dist/client/shellMode.js +68 -0
- package/dist/client/shellStart.d.ts +5 -0
- package/dist/client/shellStart.js +54 -0
- package/dist/client/shells.d.ts +123 -0
- package/dist/client/shells.js +1 -0
- package/dist/client/sql.css +139 -0
- package/dist/client/startup.d.ts +8 -0
- package/dist/client/startup.js +85 -0
- package/dist/client/startupHold.d.ts +10 -0
- package/dist/client/startupHold.js +73 -0
- package/dist/client/structure.css +1296 -0
- package/dist/client/style.css +3526 -0
- package/dist/client/styleImports.d.ts +3 -0
- package/dist/client/surfaces.d.ts +18 -0
- package/dist/client/surfaces.js +27 -0
- package/dist/client/surfacesLook.css +88 -0
- package/dist/client/template.d.ts +75 -0
- package/dist/client/template.js +403 -0
- package/dist/client/theme.d.ts +14 -0
- package/dist/client/theme.js +112 -0
- package/dist/client/themeFamilies.css +788 -0
- package/dist/client/thmenu.d.ts +12 -0
- package/dist/client/thmenu.js +94 -0
- package/dist/client/toast.d.ts +7 -0
- package/dist/client/toast.js +117 -0
- package/dist/client/tour.d.ts +8 -0
- package/dist/client/tour.js +176 -0
- package/dist/client/transport.d.ts +2 -0
- package/dist/client/transport.js +13 -0
- package/dist/client/typography.d.ts +4 -0
- package/dist/client/typography.js +51 -0
- package/dist/client/uiBridge.d.ts +57 -0
- package/dist/client/uiBridge.js +30 -0
- package/dist/client/updateAttempts.d.ts +46 -0
- package/dist/client/updateAttempts.js +131 -0
- package/dist/client/url.d.ts +74 -0
- package/dist/client/url.js +388 -0
- package/dist/client/views.d.ts +19 -0
- package/dist/client/views.js +133 -0
- package/dist/client/visualTheme.d.ts +62 -0
- package/dist/client/visualTheme.js +502 -0
- package/dist/client/visualThemes.css +421 -0
- package/dist/client/workshopLook.css +126 -0
- package/dist/client/write.d.ts +100 -0
- package/dist/client/write.js +882 -0
- package/dist/client/writePaths.d.ts +16 -0
- package/dist/client/writePaths.js +35 -0
- package/dist/client/yesNoRule.d.ts +12 -0
- package/dist/client/yesNoRule.js +39 -0
- package/dist/clientFiles.d.ts +11 -4
- package/dist/clientFiles.js +16 -12
- package/dist/vite.d.ts +136 -0
- package/dist/vite.js +571 -0
- package/package.json +130 -3
|
@@ -0,0 +1,1079 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The view composer: build a multi-table result by picking related tables and
|
|
3
|
+
* their fields, rather than by writing a join.
|
|
4
|
+
*
|
|
5
|
+
* The whole thing is a visual editor for **reference paths** — the dot-walked
|
|
6
|
+
* chains defined in shared/view.ts. `customer_id.name` means "follow
|
|
7
|
+
* invoice.customer_id to customer, then take name", and because the foreign
|
|
8
|
+
* key graph is already in the browser every hop can be proposed rather than
|
|
9
|
+
* typed. Adding a related table adds paths; ticking a field adds a path;
|
|
10
|
+
* filtering across a walk is a condition on a path. One idea, three panels.
|
|
11
|
+
*
|
|
12
|
+
* It is deliberately not a query builder with a JOIN dropdown. Nobody thinks
|
|
13
|
+
* "left join customer on customer.id = invoice.customer_id"; they think "and
|
|
14
|
+
* show me the customer's country". So the suggestions are phrased from the
|
|
15
|
+
* key — *each invoice has one customer* — and the join is a consequence you
|
|
16
|
+
* can go and read in the SQL panel if you want to.
|
|
17
|
+
*
|
|
18
|
+
* ## Self-attaching
|
|
19
|
+
*
|
|
20
|
+
* composerEntry.js adds its entry point to the top bar and hooks navigation
|
|
21
|
+
* through the existing hash scheme rather than through app.js, and loads this
|
|
22
|
+
* module the first time a view is opened: the composer is the Workbench's,
|
|
23
|
+
* and an App's first page carries only the entry.
|
|
24
|
+
*
|
|
25
|
+
* ## Where a view lives in the URL
|
|
26
|
+
*
|
|
27
|
+
* A composer session is a *tab on a table*, exactly like Rows, Definition and
|
|
28
|
+
* Diagram — so `/demo/invoice!view:sales-by-country` needs no second URL
|
|
29
|
+
* format and no change to deeplink.js. The serialisation already carries the
|
|
30
|
+
* tab; the id after the colon names the saved view, and a bare `!view` is a
|
|
31
|
+
* fresh composer on that table.
|
|
32
|
+
*
|
|
33
|
+
* ## Where a view is stored
|
|
34
|
+
*
|
|
35
|
+
* Saved views are per connection in localStorage, like saved filters: they are
|
|
36
|
+
* one person's working set, and `orders` on staging is not `orders` on
|
|
37
|
+
* production. Views defined in `tablewalk.json` come from the server, are
|
|
38
|
+
* marked as such, and cannot be edited from here — a page silently rewriting a
|
|
39
|
+
* file someone checked into a repo is a surprise nobody asked for.
|
|
40
|
+
*/
|
|
41
|
+
import { createElement } from 'react';
|
|
42
|
+
import { $, api, currentEntry, el, findTable, go, labelColumn, loadJson, looksLikeDateColumn, primaryKey, quote, refsFrom, saveJson, state, tableView, toast,
|
|
43
|
+
/* Aliased rather than renamed at every call site: `hopsOut(customer)` reads
|
|
44
|
+
as a question about one table, where `hopsFrom` reads as half of a call
|
|
45
|
+
that has lost its schema argument. */
|
|
46
|
+
hopName as hopLabel, hopsFrom as hopsOut, tableAtPrefix as tableAt, viewportBox, } from './core.js';
|
|
47
|
+
import { toHash } from './url.js';
|
|
48
|
+
import { viewTabOf } from './composerTab.js';
|
|
49
|
+
import { confirmFor, promptFor } from './prompt.js';
|
|
50
|
+
import { mount, unmount } from './components/mount.js';
|
|
51
|
+
import { surfaceOf } from './surfaces.js';
|
|
52
|
+
import { MAX_PATH_DEPTH, resolveAggregate } from '@mistriwork/engine/shared/view.js';
|
|
53
|
+
import { plural as pluralCount } from './locale.js';
|
|
54
|
+
import { say } from './copy/workbench/composer.js';
|
|
55
|
+
import { shown } from './addressMount.js';
|
|
56
|
+
import { navReplace, portalRoot, shellBody, shellQuery } from './shellHost.js';
|
|
57
|
+
/* The panel is the Workbench's, registered by app.js (surfaces.js) and loaded
|
|
58
|
+
the first time it opens. The draft,
|
|
59
|
+
the paths and the phrasing stay here, where the agreement suite reads them. */
|
|
60
|
+
/* Mirrors MAX_PATH_DEPTH in shared/view.ts. The cap is not decoration:
|
|
61
|
+
work_order.parent_id points at work_order, so the path space is infinite
|
|
62
|
+
and any breadth-first walk of it runs forever. */
|
|
63
|
+
export const MAX_DEPTH = MAX_PATH_DEPTH;
|
|
64
|
+
const STORE = 'mistri.composer.v1';
|
|
65
|
+
/* ---------- module state ---------- */
|
|
66
|
+
/** The overlay, or null when the composer is closed. */
|
|
67
|
+
let root = null;
|
|
68
|
+
/**
|
|
69
|
+
* What the overlay is currently showing, as `base|viewId`.
|
|
70
|
+
*
|
|
71
|
+
* The base table is part of the identity and not an afterthought: two fresh
|
|
72
|
+
* composers both have an empty view id, so keying on the id alone means
|
|
73
|
+
* moving from `/db/invoice!view` to `/db/work_order!view` looks like no
|
|
74
|
+
* change at all and the panel keeps showing the old table.
|
|
75
|
+
*/
|
|
76
|
+
let openFor = null;
|
|
77
|
+
/** The view being edited. */
|
|
78
|
+
let draft = null;
|
|
79
|
+
/** Path prefixes whose table has been added — the joins, in tree form. */
|
|
80
|
+
let opened = new Set();
|
|
81
|
+
/** The prefix added by the last click, so the checklist can point at it. */
|
|
82
|
+
let justAdded = null;
|
|
83
|
+
/** Config-defined views for this connection, fetched once per open. */
|
|
84
|
+
let fromConfig = [];
|
|
85
|
+
/** The last preview response, kept so the SQL toggle needs no round trip. */
|
|
86
|
+
let preview = null;
|
|
87
|
+
let previewError = null;
|
|
88
|
+
let showSql = false;
|
|
89
|
+
/** The text panel, and what has been typed into it but not yet applied. */
|
|
90
|
+
let showText = false;
|
|
91
|
+
let textEdit = null;
|
|
92
|
+
let running = false;
|
|
93
|
+
let runToken = 0;
|
|
94
|
+
/* ---------- the store the drawing reads ----------
|
|
95
|
+
|
|
96
|
+
`components/Composer.tsx` draws whatever these say and calls the actions below;
|
|
97
|
+
every mutation here ends in `tell()`, which is what `redraw()` now means. */
|
|
98
|
+
let version = 0;
|
|
99
|
+
const listeners = new Set();
|
|
100
|
+
function tell() {
|
|
101
|
+
version += 1;
|
|
102
|
+
for (const fn of listeners)
|
|
103
|
+
fn();
|
|
104
|
+
}
|
|
105
|
+
export const composerVersion = () => version;
|
|
106
|
+
export function subscribeComposer(fn) {
|
|
107
|
+
listeners.add(fn);
|
|
108
|
+
return () => listeners.delete(fn);
|
|
109
|
+
}
|
|
110
|
+
export function composerState() {
|
|
111
|
+
return {
|
|
112
|
+
draft,
|
|
113
|
+
opened,
|
|
114
|
+
justAdded,
|
|
115
|
+
fromConfig,
|
|
116
|
+
preview,
|
|
117
|
+
previewError,
|
|
118
|
+
showSql,
|
|
119
|
+
showText,
|
|
120
|
+
textEdit,
|
|
121
|
+
running,
|
|
122
|
+
savedViews: savedViews(),
|
|
123
|
+
pinned: pinnedIds(),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/* ---------- paths ----------
|
|
127
|
+
|
|
128
|
+
The mirror of shared/view.ts these are built on lives in core.js, where the
|
|
129
|
+
layout builder can reach it too — it used to walk the same prefixes with a
|
|
130
|
+
copy of its own, and disagreed with this one about whether a constraint
|
|
131
|
+
name is a legal path segment. */
|
|
132
|
+
/** A path's final column, or null if any segment does not resolve.
|
|
133
|
+
|
|
134
|
+
Deliberately stricter than resolvePath in shared/view.ts, which also
|
|
135
|
+
accepts a case-insensitive column name and refuses a path deeper than
|
|
136
|
+
MAX_PATH_DEPTH. Both differences can only ever withhold a suggestion the
|
|
137
|
+
server would have accepted; neither can propose one it would refuse. */
|
|
138
|
+
export function columnAt(baseId, path) {
|
|
139
|
+
const cut = path.lastIndexOf('.');
|
|
140
|
+
const table = tableAt(baseId, cut === -1 ? '' : path.slice(0, cut));
|
|
141
|
+
if (!table)
|
|
142
|
+
return null;
|
|
143
|
+
const name = path.slice(cut + 1);
|
|
144
|
+
return table.columns.find((c) => c.name === name) ?? null;
|
|
145
|
+
}
|
|
146
|
+
const depthOf = (path) => (path ? path.split('.').length : 0);
|
|
147
|
+
/* ---------- plain language ----------
|
|
148
|
+
|
|
149
|
+
The phrasing is generated from the key, not written per table, and says the
|
|
150
|
+
two things a foreign key actually tells you: the direction, and whether the
|
|
151
|
+
other row has to exist. "may have one" versus "has one" is the difference
|
|
152
|
+
between a column that will show nulls and one that will not. */
|
|
153
|
+
export function phraseOne(fromTable, hop) {
|
|
154
|
+
const target = findTable(hop.target);
|
|
155
|
+
const subject = fromTable.name;
|
|
156
|
+
const object = target ? target.name : hop.target;
|
|
157
|
+
const verb = hop.optional ? say('mayHaveOne') : say('hasOne');
|
|
158
|
+
const self = target && target.id === fromTable.id;
|
|
159
|
+
return self ? say('eachParent', { subject, verb, object }) : say('relationPhrase', { subject, verb, object });
|
|
160
|
+
}
|
|
161
|
+
export function phraseMany(toTable, fk) {
|
|
162
|
+
const child = findTable(fk.from.table);
|
|
163
|
+
return say('eachHasMany', { name: toTable.name, values: plural(child ? child.name : fk.from.table) });
|
|
164
|
+
}
|
|
165
|
+
/* "each country has many customer" is the kind of almost-English that makes a
|
|
166
|
+
generated sentence read as generated. Three rules cover every table name
|
|
167
|
+
anyone actually writes, and a name they do not cover is still a real word
|
|
168
|
+
with an s on the end. */
|
|
169
|
+
export function plural(name) {
|
|
170
|
+
if (/(?:s|x|z|ch|sh)$/i.test(name))
|
|
171
|
+
return `${name}es`;
|
|
172
|
+
if (/[^aeiou]y$/i.test(name))
|
|
173
|
+
return `${name.slice(0, -1)}ies`;
|
|
174
|
+
return `${name}s`;
|
|
175
|
+
}
|
|
176
|
+
/* ---------- storage ---------- */
|
|
177
|
+
const connectionKey = () => state.activeConnection ?? 'default';
|
|
178
|
+
/**
|
|
179
|
+
* Everything stored for one connection: the views, and which ids are pinned.
|
|
180
|
+
*
|
|
181
|
+
* Pins live beside the views rather than on them because a view defined in
|
|
182
|
+
* `tablewalk.json` can be pinned too, and that view is not ours to write to.
|
|
183
|
+
* A list of ids covers both without the config half needing a copy kept here
|
|
184
|
+
* that could drift from the file.
|
|
185
|
+
*
|
|
186
|
+
* An earlier shape stored the array directly. It is read rather than
|
|
187
|
+
* discarded: someone who saved three views before this existed should not
|
|
188
|
+
* find them gone.
|
|
189
|
+
*/
|
|
190
|
+
function bucket() {
|
|
191
|
+
const stored = loadJson(STORE, {})[connectionKey()];
|
|
192
|
+
if (Array.isArray(stored))
|
|
193
|
+
return { views: stored, pinned: [] };
|
|
194
|
+
return { views: stored?.views ?? [], pinned: stored?.pinned ?? [] };
|
|
195
|
+
}
|
|
196
|
+
function savedViews() {
|
|
197
|
+
return bucket().views;
|
|
198
|
+
}
|
|
199
|
+
const pinnedIds = () => bucket().pinned;
|
|
200
|
+
const isPinned = (id) => pinnedIds().includes(id);
|
|
201
|
+
function writeBucket(next) {
|
|
202
|
+
const all = loadJson(STORE, {});
|
|
203
|
+
all[connectionKey()] = next;
|
|
204
|
+
if (!saveJson(STORE, all)) {
|
|
205
|
+
toast(say('couldNotSaveThisBrowser'), 'error');
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
function writeSaved(list) {
|
|
211
|
+
return writeBucket({ ...bucket(), views: list });
|
|
212
|
+
}
|
|
213
|
+
function togglePin(id) {
|
|
214
|
+
const current = bucket();
|
|
215
|
+
const pinned = current.pinned.includes(id) ? current.pinned.filter((p) => p !== id) : [...current.pinned, id];
|
|
216
|
+
if (writeBucket({ ...current, pinned }))
|
|
217
|
+
redraw();
|
|
218
|
+
}
|
|
219
|
+
function newId() {
|
|
220
|
+
/* Time plus a little noise. Ids end up in URLs, so they stay in the
|
|
221
|
+
character set the hash scheme already treats as opaque. */
|
|
222
|
+
return `v${Date.now().toString(36)}${Math.floor(Math.random() * 1296).toString(36)}`;
|
|
223
|
+
}
|
|
224
|
+
/* ---------- the draft ---------- */
|
|
225
|
+
function blankView(baseId) {
|
|
226
|
+
const table = findTable(baseId);
|
|
227
|
+
const label = table ? labelColumn(table) : null;
|
|
228
|
+
const key = table ? primaryKey(table) : [];
|
|
229
|
+
/* A brand new view opens with the row's key and its readable column ticked.
|
|
230
|
+
An empty grid is a worse starting point than a small correct one: it
|
|
231
|
+
gives you nothing to recognise your data by while you build. */
|
|
232
|
+
const columns = [...new Set([...key, label].filter(Boolean))].map((path) => ({ path }));
|
|
233
|
+
return { id: '', name: '', base: baseId, columns, aggregates: [], query: '', orderBy: [], limit: 20 };
|
|
234
|
+
}
|
|
235
|
+
const selected = () => draft.columns.map((c) => c.path);
|
|
236
|
+
const isSelected = (path) => draft.columns.some((c) => c.path === path);
|
|
237
|
+
function toggleField(path) {
|
|
238
|
+
draft.columns = isSelected(path) ? draft.columns.filter((c) => c.path !== path) : [...draft.columns, { path }];
|
|
239
|
+
changed();
|
|
240
|
+
}
|
|
241
|
+
function addJoin(prefix) {
|
|
242
|
+
opened.add(prefix);
|
|
243
|
+
/* A join with nothing showing through it is a join you cannot see: the SQL
|
|
244
|
+
does not even emit it, because no path uses it, so "Add" appears to do
|
|
245
|
+
nothing at all. One field comes along — the readable one where there is
|
|
246
|
+
one — so the click has a visible consequence in the grid as well as in
|
|
247
|
+
the checklist. */
|
|
248
|
+
const table = tableAt(draft.base, prefix);
|
|
249
|
+
const field = table ? defaultField(table, prefix) : null;
|
|
250
|
+
if (field)
|
|
251
|
+
draft.columns.push({ path: `${prefix}.${field}` });
|
|
252
|
+
justAdded = prefix;
|
|
253
|
+
changed();
|
|
254
|
+
}
|
|
255
|
+
/** The one field worth showing by default from a newly joined table. */
|
|
256
|
+
function defaultField(table, prefix) {
|
|
257
|
+
const free = (name) => name && !isSelected(`${prefix}.${name}`);
|
|
258
|
+
const label = labelColumn(table);
|
|
259
|
+
if (free(label))
|
|
260
|
+
return label;
|
|
261
|
+
const text = table.columns.find((c) => !c.primaryKey && /char|text|varchar|string/i.test(c.type));
|
|
262
|
+
if (free(text?.name))
|
|
263
|
+
return text.name;
|
|
264
|
+
const key = primaryKey(table)[0];
|
|
265
|
+
if (free(key))
|
|
266
|
+
return key;
|
|
267
|
+
return table.columns.map((c) => c.name).find(free) ?? null;
|
|
268
|
+
}
|
|
269
|
+
function removeJoin(prefix) {
|
|
270
|
+
// Everything reached *through* this table goes with it, or the view keeps
|
|
271
|
+
// paths whose join has just been taken away.
|
|
272
|
+
for (const open of [...opened]) {
|
|
273
|
+
if (open === prefix || open.startsWith(`${prefix}.`))
|
|
274
|
+
opened.delete(open);
|
|
275
|
+
}
|
|
276
|
+
draft.columns = draft.columns.filter((c) => !c.path.startsWith(`${prefix}.`));
|
|
277
|
+
draft.orderBy = (draft.orderBy ?? []).filter((o) => !o.path.startsWith(`${prefix}.`));
|
|
278
|
+
changed();
|
|
279
|
+
}
|
|
280
|
+
/** Rebase onto another table, discarding paths that no longer mean anything. */
|
|
281
|
+
function setBase(baseId) {
|
|
282
|
+
draft = { ...blankView(baseId), id: draft.id, name: draft.name };
|
|
283
|
+
opened = new Set();
|
|
284
|
+
claim();
|
|
285
|
+
changed();
|
|
286
|
+
}
|
|
287
|
+
/** Record what is on screen and make the address bar agree with it. */
|
|
288
|
+
function claim() {
|
|
289
|
+
const tab = tabForDraft();
|
|
290
|
+
openFor = `${draft.base}|${viewTabOf({ kind: 'table', tab })}`;
|
|
291
|
+
linkTo(tab);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* One edit: redraw the panels, then re-run the preview.
|
|
295
|
+
*
|
|
296
|
+
* Kept as a pair rather than folded into `redraw`, because `redraw` also runs
|
|
297
|
+
* when nothing about the *view* changed — opening the overlay, toggling the
|
|
298
|
+
* SQL panel — and re-querying for those would put a round trip behind a
|
|
299
|
+
* button that only reveals text.
|
|
300
|
+
*/
|
|
301
|
+
function changed() {
|
|
302
|
+
redraw();
|
|
303
|
+
schedulePreview();
|
|
304
|
+
}
|
|
305
|
+
/* ---------- the view sent to the server ---------- */
|
|
306
|
+
function payload() {
|
|
307
|
+
return {
|
|
308
|
+
id: draft.id,
|
|
309
|
+
name: draft.name,
|
|
310
|
+
base: draft.base,
|
|
311
|
+
columns: draft.columns,
|
|
312
|
+
aggregates: draft.aggregates ?? [],
|
|
313
|
+
/* Carried, and not only when the box is empty. A view defined in
|
|
314
|
+
`tablewalk.json` holds its filter as a structure, and leaving it out
|
|
315
|
+
here was a bug with the worst possible shape: the view ran, returned
|
|
316
|
+
rows, and returned the wrong ones — an "Australian work orders" view
|
|
317
|
+
quietly listing New Zealand. */
|
|
318
|
+
filter: draft.filter,
|
|
319
|
+
orderBy: draft.orderBy ?? [],
|
|
320
|
+
limit: draft.limit,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
/* ---------- a filter, written back as text ----------
|
|
324
|
+
|
|
325
|
+
A structural filter that does not appear in the box is a filter you cannot
|
|
326
|
+
see, edit or argue with — the composer would be applying a condition the
|
|
327
|
+
screen denies exists. Rendering it back into the language closes that gap
|
|
328
|
+
and makes the box the single thing the view's filter *is*. */
|
|
329
|
+
const OP_TEXT = {
|
|
330
|
+
'=': '=',
|
|
331
|
+
'!=': '!=',
|
|
332
|
+
'<': '<',
|
|
333
|
+
'<=': '<=',
|
|
334
|
+
'>': '>',
|
|
335
|
+
'>=': '>=',
|
|
336
|
+
contains: 'contains',
|
|
337
|
+
startsWith: 'startswith',
|
|
338
|
+
endsWith: 'endswith',
|
|
339
|
+
like: 'like',
|
|
340
|
+
};
|
|
341
|
+
function filterToText(filter) {
|
|
342
|
+
if (!filter?.groups?.length)
|
|
343
|
+
return '';
|
|
344
|
+
return filter.groups
|
|
345
|
+
.map((group) => group.map(conditionToText).filter(Boolean).join(' and '))
|
|
346
|
+
.filter(Boolean)
|
|
347
|
+
.map((text, _, all) => (all.length > 1 ? `(${text})` : text))
|
|
348
|
+
.join(' or ');
|
|
349
|
+
}
|
|
350
|
+
function conditionToText(condition) {
|
|
351
|
+
const { path, op, value } = condition;
|
|
352
|
+
if (op === 'isNull')
|
|
353
|
+
return `${path} is empty`;
|
|
354
|
+
if (op === 'isNotNull')
|
|
355
|
+
return `${path} is not empty`;
|
|
356
|
+
if (op === 'in') {
|
|
357
|
+
const list = (Array.isArray(value) ? value : [value]).map(valueToText).join(', ');
|
|
358
|
+
return `${path} in (${list})`;
|
|
359
|
+
}
|
|
360
|
+
const word = OP_TEXT[op];
|
|
361
|
+
return word ? `${path} ${word} ${valueToText(value)}` : '';
|
|
362
|
+
}
|
|
363
|
+
function valueToText(value) {
|
|
364
|
+
/* Quoted whenever a bare word would not survive the round trip. The parser
|
|
365
|
+
treats an explicit quote as "this is text", which is exactly right for a
|
|
366
|
+
value that came out of a config file already typed.
|
|
367
|
+
|
|
368
|
+
This kept its own copy with a slightly wider bare-word set (`$`), so the
|
|
369
|
+
same value written here and in the query bar could come out differently.
|
|
370
|
+
A `$` now gets quoted instead of passing bare, which the grammar reads
|
|
371
|
+
identically — one rule beats two nearly-identical ones. */
|
|
372
|
+
return quote(String(value ?? ''));
|
|
373
|
+
}
|
|
374
|
+
/* ---------- preview ----------
|
|
375
|
+
|
|
376
|
+
Debounced, and every response carries the token of the request that asked
|
|
377
|
+
for it. Without that, a slow query started three keystrokes ago lands after
|
|
378
|
+
a fast one and the grid shows an answer to a question nobody is asking any
|
|
379
|
+
more — the classic race, and invisible when it happens. */
|
|
380
|
+
let previewTimer = null;
|
|
381
|
+
function schedulePreview() {
|
|
382
|
+
clearTimeout(previewTimer);
|
|
383
|
+
previewTimer = setTimeout(() => void runPreview(), 220);
|
|
384
|
+
}
|
|
385
|
+
async function runPreview() {
|
|
386
|
+
if (!draft || (!draft.columns.length && !aggregates().length)) {
|
|
387
|
+
preview = null;
|
|
388
|
+
previewError = null;
|
|
389
|
+
paintPreview();
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
const token = ++runToken;
|
|
393
|
+
running = true;
|
|
394
|
+
paintPreview();
|
|
395
|
+
try {
|
|
396
|
+
const data = await api('/api/view/run', {
|
|
397
|
+
view: payload(),
|
|
398
|
+
query: draft.query,
|
|
399
|
+
limit: draft.limit,
|
|
400
|
+
});
|
|
401
|
+
if (token !== runToken)
|
|
402
|
+
return;
|
|
403
|
+
if (data.errors && data.errors.length) {
|
|
404
|
+
preview = null;
|
|
405
|
+
previewError = data.errors;
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
preview = data;
|
|
409
|
+
previewError = null;
|
|
410
|
+
/* The text form only exists once the view has run, so this is where an
|
|
411
|
+
unsaved composer becomes a link worth copying. Stamped rather than
|
|
412
|
+
navigated: `go()` would repaint the whole app underneath the overlay,
|
|
413
|
+
and a network round trip per keystroke is exactly what a live preview
|
|
414
|
+
must not cost. */
|
|
415
|
+
stampHash();
|
|
416
|
+
if (showText)
|
|
417
|
+
textEdit = null;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
catch (err) {
|
|
421
|
+
if (token !== runToken)
|
|
422
|
+
return;
|
|
423
|
+
preview = null;
|
|
424
|
+
previewError = [{ message: err.message }];
|
|
425
|
+
}
|
|
426
|
+
finally {
|
|
427
|
+
if (token === runToken) {
|
|
428
|
+
running = false;
|
|
429
|
+
paintPreview();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
/* ---------- open / close ---------- */
|
|
434
|
+
/* The hash is one segment of a `/`-separated path, and deeplink.js finds the
|
|
435
|
+
tab by the last `!` in it. Neither may appear in the payload, and
|
|
436
|
+
encodeURIComponent leaves `!` alone. */
|
|
437
|
+
const encodeText = (text) => encodeURIComponent(text).replace(/!/g, '%21');
|
|
438
|
+
/** Above this the URL stops being pasteable, so the link degrades to the base. */
|
|
439
|
+
const MAX_LINK_TEXT = 1200;
|
|
440
|
+
function tabForDraft() {
|
|
441
|
+
if (draft.id)
|
|
442
|
+
return `view:${draft.id}`;
|
|
443
|
+
const text = preview?.text;
|
|
444
|
+
if (text) {
|
|
445
|
+
const encoded = encodeText(text);
|
|
446
|
+
if (encoded.length <= MAX_LINK_TEXT)
|
|
447
|
+
return `view+${encoded}`;
|
|
448
|
+
}
|
|
449
|
+
return 'view';
|
|
450
|
+
}
|
|
451
|
+
function closeComposer() {
|
|
452
|
+
if (!root)
|
|
453
|
+
return;
|
|
454
|
+
unmount(root);
|
|
455
|
+
root.remove();
|
|
456
|
+
root = null;
|
|
457
|
+
openFor = null;
|
|
458
|
+
draft = null;
|
|
459
|
+
preview = null;
|
|
460
|
+
previewError = null;
|
|
461
|
+
shellBody().classList.remove('composing');
|
|
462
|
+
}
|
|
463
|
+
async function openComposer(baseId, viewId) {
|
|
464
|
+
const base = findTable(baseId) ? baseId : likeliestBase();
|
|
465
|
+
if (!base)
|
|
466
|
+
return;
|
|
467
|
+
openFor = `${base}|${viewId}`;
|
|
468
|
+
showSql = false;
|
|
469
|
+
draft = blankView(base);
|
|
470
|
+
opened = new Set();
|
|
471
|
+
if (!root) {
|
|
472
|
+
root = el('div', { class: 'composer', role: 'dialog', 'aria-modal': 'false', 'aria-label': say('viewComposer') });
|
|
473
|
+
portalRoot().append(root);
|
|
474
|
+
shellBody().classList.add('composing');
|
|
475
|
+
positionRoot();
|
|
476
|
+
mount(root, createElement(surfaceOf('composer')));
|
|
477
|
+
}
|
|
478
|
+
redraw();
|
|
479
|
+
/* Config views are fetched rather than cached across opens: they can change
|
|
480
|
+
when the connection does, and the request is one small GET. */
|
|
481
|
+
try {
|
|
482
|
+
const data = await api('/api/views');
|
|
483
|
+
fromConfig = data.views ?? [];
|
|
484
|
+
}
|
|
485
|
+
catch {
|
|
486
|
+
// A server that cannot list config views is not a reason to refuse to
|
|
487
|
+
// compose one. The saved list still works.
|
|
488
|
+
fromConfig = [];
|
|
489
|
+
}
|
|
490
|
+
if (viewId && viewId.startsWith('+')) {
|
|
491
|
+
/* The link carries the view itself. Parsed by the server, because the
|
|
492
|
+
grammar lives there — the same call the text panel makes. */
|
|
493
|
+
try {
|
|
494
|
+
const data = await api('/api/view/run', { text: decodeURIComponent(viewId.slice(1)) });
|
|
495
|
+
if (data.errors?.length) {
|
|
496
|
+
previewError = data.errors;
|
|
497
|
+
}
|
|
498
|
+
else if ('view' in data) {
|
|
499
|
+
loadView({ ...data.view, id: '', name: draft.name });
|
|
500
|
+
preview = data;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
catch (err) {
|
|
504
|
+
previewError = [{ message: err.message }];
|
|
505
|
+
}
|
|
506
|
+
redraw();
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
if (viewId) {
|
|
510
|
+
const found = [...savedViews(), ...fromConfig].find((v) => v.id === viewId);
|
|
511
|
+
if (found) {
|
|
512
|
+
loadView(found);
|
|
513
|
+
/* A saved view carries its own base table, which need not be the one
|
|
514
|
+
named in the link that opened it. Correcting the address bar keeps a
|
|
515
|
+
copied URL truthful rather than merely functional. */
|
|
516
|
+
claim();
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
toast(say('noSavedViewCalled', { viewId }), 'error');
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
redraw();
|
|
523
|
+
schedulePreview();
|
|
524
|
+
}
|
|
525
|
+
function loadView(view) {
|
|
526
|
+
draft = {
|
|
527
|
+
id: view.id,
|
|
528
|
+
name: view.name ?? '',
|
|
529
|
+
base: view.base,
|
|
530
|
+
columns: (view.columns ?? []).map((c) => (typeof c === 'string' ? { path: c } : { ...c })),
|
|
531
|
+
aggregates: (view.aggregates ?? []).map((a) => ({ ...a })),
|
|
532
|
+
/* Shown in the box, so the condition a config view applies is visible and
|
|
533
|
+
editable rather than invisible and authoritative. The structure is kept
|
|
534
|
+
alongside as the authority until the box is touched, so a filter that
|
|
535
|
+
does not survive the round trip exactly still runs exactly. */
|
|
536
|
+
query: view.query ?? filterToText(view.filter),
|
|
537
|
+
filter: view.filter,
|
|
538
|
+
orderBy: view.orderBy ?? [],
|
|
539
|
+
limit: view.limit ?? 20,
|
|
540
|
+
source: view.source,
|
|
541
|
+
};
|
|
542
|
+
/* Every prefix a path walks through is a join that must be open, or the
|
|
543
|
+
tables panel would show a view whose own columns are not in it. */
|
|
544
|
+
opened = new Set();
|
|
545
|
+
for (const col of draft.columns) {
|
|
546
|
+
const parts = col.path.split('.');
|
|
547
|
+
for (let i = 1; i < parts.length; i++)
|
|
548
|
+
opened.add(parts.slice(0, i).join('.'));
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
/* ---------- rendering ---------- */
|
|
552
|
+
/**
|
|
553
|
+
* Sit below the app's own top bar rather than over it.
|
|
554
|
+
*
|
|
555
|
+
* Covering the whole window would be simpler and would also hide the
|
|
556
|
+
* connection label and the schema button — the two things that tell you
|
|
557
|
+
* *which* database you are composing against. Measuring is a line; guessing a
|
|
558
|
+
* height in the stylesheet is a line that goes wrong the first time the bar
|
|
559
|
+
* wraps on a narrow window.
|
|
560
|
+
*/
|
|
561
|
+
export function positionRoot() {
|
|
562
|
+
if (!root)
|
|
563
|
+
return;
|
|
564
|
+
const bar = shellQuery('.topbar');
|
|
565
|
+
root.style.top = bar ? `${Math.round(viewportBox(bar).bottom)}px` : '0px';
|
|
566
|
+
}
|
|
567
|
+
/** Every mutation ends here: the component redraws from the store. */
|
|
568
|
+
function redraw() {
|
|
569
|
+
if (!root || !draft)
|
|
570
|
+
return;
|
|
571
|
+
positionRoot();
|
|
572
|
+
tell();
|
|
573
|
+
}
|
|
574
|
+
/* ---------- summaries of the many side ---------- */
|
|
575
|
+
const aggregates = () => draft.aggregates ?? [];
|
|
576
|
+
function resolvedAggregate(spec, base = draft?.base) {
|
|
577
|
+
// Saved drafts may be invalid or still use an unambiguous constraint name.
|
|
578
|
+
// Resolve against the same parent/prefix and precedence as the server.
|
|
579
|
+
try {
|
|
580
|
+
return resolveAggregate(state.schema, base, spec);
|
|
581
|
+
}
|
|
582
|
+
catch {
|
|
583
|
+
return undefined;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
function aggregateReference(spec, base) {
|
|
587
|
+
const resolved = resolvedAggregate(spec, base);
|
|
588
|
+
return resolved ? `${resolved.child.id}.${resolved.fk.from.columns.join('+')}` : spec.via;
|
|
589
|
+
}
|
|
590
|
+
export function sameAggregate(a, b, base = draft?.base) {
|
|
591
|
+
return (a.fn === b.fn &&
|
|
592
|
+
(a.on ?? '') === (b.on ?? '') &&
|
|
593
|
+
(a.column ?? '') === (b.column ?? '') &&
|
|
594
|
+
aggregateReference(a, base) === aggregateReference(b, base));
|
|
595
|
+
}
|
|
596
|
+
function addAggregate(next) {
|
|
597
|
+
if (aggregates().some((a) => sameAggregate(a, next)))
|
|
598
|
+
return;
|
|
599
|
+
draft.aggregates = [...aggregates(), next];
|
|
600
|
+
changed();
|
|
601
|
+
}
|
|
602
|
+
function removeAggregate(target) {
|
|
603
|
+
draft.aggregates = aggregates().filter((a) => !sameAggregate(a, target));
|
|
604
|
+
changed();
|
|
605
|
+
}
|
|
606
|
+
/** How a summary reads in a sentence: "a count of work_order_parts". */
|
|
607
|
+
export function aggregateLabel(spec) {
|
|
608
|
+
const child = resolvedAggregate(spec)?.child;
|
|
609
|
+
const name = child ? child.name : spec.via;
|
|
610
|
+
const where = spec.on ? say('on', { on: spec.on }) : '';
|
|
611
|
+
return spec.fn === 'count'
|
|
612
|
+
? say('aCount', { names: plural(name), where })
|
|
613
|
+
: say('the', { fn: spec.fn, name, column: spec.column, where });
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* One level of the join tree, and recursively the levels below it.
|
|
617
|
+
*
|
|
618
|
+
* Hops are grouped by the table they land on. `work_order` reaches `employee`
|
|
619
|
+
* three ways — raised_by, assigned_to, approved_by — and listing them as three
|
|
620
|
+
* sentences that differ only in a trailing column name is a list you have to
|
|
621
|
+
* read word by word rather than scan. Grouped, the question becomes the one
|
|
622
|
+
* actually being asked: *which* employee.
|
|
623
|
+
*
|
|
624
|
+
* A table reachable exactly one way keeps its full sentence, because a header
|
|
625
|
+
* plus a single row underneath is ceremony around one fact.
|
|
626
|
+
*/
|
|
627
|
+
function startFromChild(fk) {
|
|
628
|
+
const child = findTable(fk.from.table);
|
|
629
|
+
if (!child)
|
|
630
|
+
return;
|
|
631
|
+
draft = { ...blankView(child.id), id: draft.id, name: draft.name };
|
|
632
|
+
opened = new Set();
|
|
633
|
+
claim();
|
|
634
|
+
const hop = hopsOut(child.id).find((h) => h.fk.name === fk.name);
|
|
635
|
+
if (hop)
|
|
636
|
+
addJoin(hop.name);
|
|
637
|
+
else
|
|
638
|
+
changed();
|
|
639
|
+
}
|
|
640
|
+
/** The chip's text: `count(work_order_part)`, matching the column header. */
|
|
641
|
+
export function shortAggregate(spec) {
|
|
642
|
+
const child = resolvedAggregate(spec)?.child;
|
|
643
|
+
const name = `${spec.on ? `${spec.on}.` : ''}${child ? child.name : spec.via}`;
|
|
644
|
+
return `${spec.fn}(${name}${spec.column ? `.${spec.column}` : ''})`;
|
|
645
|
+
}
|
|
646
|
+
/* ---------- path-aware autocomplete ----------
|
|
647
|
+
|
|
648
|
+
complete.js does this for the query bar and is left alone: it completes
|
|
649
|
+
*columns*, and a path is a different shape — the useful suggestion after
|
|
650
|
+
`customer_id.` is the next table's columns, which needs the key graph
|
|
651
|
+
walked. Same keyboard contract, different candidate set. */
|
|
652
|
+
const CLAUSES = ['sort', 'show', 'limit'];
|
|
653
|
+
const JOINERS = ['and', 'or'];
|
|
654
|
+
const OPERATORS = ['=', '!=', '>', '>=', '<', '<=', 'contains', 'startswith', 'endswith', 'like', 'in'];
|
|
655
|
+
const NULL_CHECKS = ['is empty', 'is not empty'];
|
|
656
|
+
const DATE_VALUES = ['today', 'yesterday', 'this week', 'last week', 'this month', 'last month', 'last 7 days', 'last 30 days'];
|
|
657
|
+
const EXPECTS_FIELD = new Set(['and', 'or', 'where', 'filter', 'show', 'select', 'sort', 'by', '']);
|
|
658
|
+
function wordAt(text, caret) {
|
|
659
|
+
const before = text.slice(0, caret);
|
|
660
|
+
const start = Math.max(before.lastIndexOf(' '), before.lastIndexOf(',')) + 1;
|
|
661
|
+
return { word: before.slice(start), start };
|
|
662
|
+
}
|
|
663
|
+
/** Paths reachable from a typed prefix: this table's columns, and its hops. */
|
|
664
|
+
function pathCandidates(word) {
|
|
665
|
+
const cut = word.lastIndexOf('.');
|
|
666
|
+
const prefix = cut === -1 ? '' : word.slice(0, cut);
|
|
667
|
+
const fragment = (cut === -1 ? word : word.slice(cut + 1)).toLowerCase();
|
|
668
|
+
const table = tableAt(draft.base, prefix);
|
|
669
|
+
if (!table)
|
|
670
|
+
return [];
|
|
671
|
+
const lead = prefix ? `${prefix}.` : '';
|
|
672
|
+
const out = [];
|
|
673
|
+
for (const column of table.columns) {
|
|
674
|
+
if (fragment && !column.name.toLowerCase().startsWith(fragment))
|
|
675
|
+
continue;
|
|
676
|
+
out.push({
|
|
677
|
+
value: `${lead}${column.name}`,
|
|
678
|
+
label: `${lead}${column.name}`,
|
|
679
|
+
detail: `${column.type.toLowerCase()}${column.primaryKey ? say('key') : ''}`,
|
|
680
|
+
kind: 'value',
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
/* Hops end in a dot and do not close the token, so accepting one leaves the
|
|
684
|
+
caret mid-path with the next table's columns already listed. That chaining
|
|
685
|
+
is the whole reason dot-walking is pleasant to type. */
|
|
686
|
+
if (depthOf(prefix) < MAX_DEPTH) {
|
|
687
|
+
for (const hop of hopsOut(table.id)) {
|
|
688
|
+
if (fragment && !hop.name.toLowerCase().startsWith(fragment))
|
|
689
|
+
continue;
|
|
690
|
+
const target = findTable(hop.target);
|
|
691
|
+
out.push({
|
|
692
|
+
value: `${lead}${hop.name}.`,
|
|
693
|
+
label: `${lead}${hop.name}.`,
|
|
694
|
+
detail: `→ ${target ? target.name : hop.target}`,
|
|
695
|
+
kind: 'table',
|
|
696
|
+
partial: true,
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
return out;
|
|
701
|
+
}
|
|
702
|
+
function completionsFor(text, caret) {
|
|
703
|
+
const { word, start } = wordAt(text, caret);
|
|
704
|
+
const previous = text.slice(0, start).trim().split(/\s+/).pop()?.toLowerCase() ?? '';
|
|
705
|
+
const lower = word.toLowerCase();
|
|
706
|
+
const matches = (list) => list.filter((s) => !lower || s.value.toLowerCase().startsWith(lower));
|
|
707
|
+
if (word.includes('.'))
|
|
708
|
+
return pathCandidates(word);
|
|
709
|
+
const previousColumn = previous ? columnAt(draft.base, previous) : null;
|
|
710
|
+
if (previousColumn) {
|
|
711
|
+
/* Was a fourth copy of the date test, and the narrowest: its name pattern
|
|
712
|
+
had lost `datetime`, `timestamp` and `deleted`, so `event_timestamp`
|
|
713
|
+
got `=` and nothing else in the composer while the query bar offered it
|
|
714
|
+
the relative-date phrases — the language's best feature, missing on the
|
|
715
|
+
columns it exists for. */
|
|
716
|
+
const isDate = looksLikeDateColumn(previousColumn);
|
|
717
|
+
const dates = isDate ? DATE_VALUES.map((v) => ({ value: `= ${v}`, label: `= ${v}`, detail: say('dateRange'), kind: 'value' })) : [];
|
|
718
|
+
return matches([
|
|
719
|
+
...dates,
|
|
720
|
+
...OPERATORS.map((o) => ({ value: o, label: o, detail: 'operator', kind: 'op' })),
|
|
721
|
+
...NULL_CHECKS.map((o) => ({ value: o, label: o, detail: say('nullCheck'), kind: 'op' })),
|
|
722
|
+
]);
|
|
723
|
+
}
|
|
724
|
+
if (EXPECTS_FIELD.has(previous))
|
|
725
|
+
return pathCandidates(word);
|
|
726
|
+
return matches([
|
|
727
|
+
...JOINERS.map((j) => ({ value: j, label: j, detail: 'combine', kind: 'kw' })),
|
|
728
|
+
...CLAUSES.map((c) => ({ value: c, label: c, detail: 'clause', kind: 'kw' })),
|
|
729
|
+
...pathCandidates(word),
|
|
730
|
+
]);
|
|
731
|
+
}
|
|
732
|
+
/* ---------- panel: the view, written down ----------
|
|
733
|
+
|
|
734
|
+
A view built by clicking is UI state: it can be saved and loaded, and that
|
|
735
|
+
is all. Everything else in tablewalk holds that the *text* is the source of
|
|
736
|
+
truth — it is why sorting edits the query, why a link carries the walk, why
|
|
737
|
+
a filter composes into the bar. A view that could only be clicked could not
|
|
738
|
+
be hand-edited, diffed in a config file, or pasted to someone who does not
|
|
739
|
+
have the composer open.
|
|
740
|
+
|
|
741
|
+
So the panel is editable, and applying it replaces the draft. The grammar
|
|
742
|
+
is `viewtext.ts` on the server: one language, parsed once, rather than a
|
|
743
|
+
second one here that would drift. */
|
|
744
|
+
async function applyText(value) {
|
|
745
|
+
const text = String(value ?? '').trim();
|
|
746
|
+
if (!text)
|
|
747
|
+
return;
|
|
748
|
+
running = true;
|
|
749
|
+
paintPreview();
|
|
750
|
+
try {
|
|
751
|
+
const data = await api('/api/view/run', { text, limit: draft.limit });
|
|
752
|
+
if (data.errors?.length || !('view' in data)) {
|
|
753
|
+
previewError = data.errors;
|
|
754
|
+
running = false;
|
|
755
|
+
paintPreview();
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
// The name and the identity are the composer's, not the text's: retyping
|
|
759
|
+
// the body of a saved view should still be that saved view.
|
|
760
|
+
loadView({ ...data.view, id: draft.id, name: draft.name });
|
|
761
|
+
preview = data;
|
|
762
|
+
previewError = null;
|
|
763
|
+
textEdit = null;
|
|
764
|
+
running = false;
|
|
765
|
+
claim();
|
|
766
|
+
redraw();
|
|
767
|
+
}
|
|
768
|
+
catch (err) {
|
|
769
|
+
previewError = [{ message: err.message }];
|
|
770
|
+
running = false;
|
|
771
|
+
paintPreview();
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Give a column its own name.
|
|
776
|
+
*
|
|
777
|
+
* Applies to summaries as well as fields — `count(work_order_part)` is a
|
|
778
|
+
* worse column heading than `parts` in exactly the same way.
|
|
779
|
+
*
|
|
780
|
+
* Matching is by output name rather than by index. The result's column order
|
|
781
|
+
* is produced by the compiler, and tying a rename to a position would break
|
|
782
|
+
* the moment a field is ticked above it.
|
|
783
|
+
*/
|
|
784
|
+
async function renameColumn(meta, fallbackName) {
|
|
785
|
+
const current = meta?.name ?? fallbackName;
|
|
786
|
+
const chosen = await promptFor({
|
|
787
|
+
title: say('renameColumn'),
|
|
788
|
+
label: say('shownAs'),
|
|
789
|
+
value: current,
|
|
790
|
+
hint: meta?.aggregate
|
|
791
|
+
? say('aggregateOver', { aggregate: meta.aggregate, shortTable: shortTable(meta.table) })
|
|
792
|
+
: (meta?.path ?? fallbackName),
|
|
793
|
+
confirmLabel: say('common.rename'),
|
|
794
|
+
});
|
|
795
|
+
if (chosen === null)
|
|
796
|
+
return;
|
|
797
|
+
const alias = chosen.trim();
|
|
798
|
+
if (meta?.aggregate) {
|
|
799
|
+
const list = aggregates();
|
|
800
|
+
const hit = list.find((a) => (a.alias ?? '') === current || aggregateOutputName(a) === current);
|
|
801
|
+
if (hit)
|
|
802
|
+
hit.alias = alias || undefined;
|
|
803
|
+
}
|
|
804
|
+
else if (meta?.path) {
|
|
805
|
+
const hit = draft.columns.find((c) => c.path === meta.path);
|
|
806
|
+
// Clearing the box removes the alias rather than setting an empty one,
|
|
807
|
+
// so the column goes back to naming itself.
|
|
808
|
+
if (hit)
|
|
809
|
+
hit.alias = alias && alias !== meta.path ? alias : undefined;
|
|
810
|
+
}
|
|
811
|
+
claim();
|
|
812
|
+
void runPreview();
|
|
813
|
+
}
|
|
814
|
+
/** What an aggregate is called when it has no alias of its own. */
|
|
815
|
+
function aggregateOutputName(spec) {
|
|
816
|
+
return resolvedAggregate(spec)?.name ?? spec.alias ?? shortAggregate(spec);
|
|
817
|
+
}
|
|
818
|
+
function paintPreview() {
|
|
819
|
+
tell();
|
|
820
|
+
}
|
|
821
|
+
const shortTable = (id) => findTable(id)?.name ?? id;
|
|
822
|
+
function sortByPath(path) {
|
|
823
|
+
const current = (draft.orderBy ?? []).find((o) => o.path === path);
|
|
824
|
+
// Click sorts ascending, click again reverses, a third clears — the same
|
|
825
|
+
// three states the results grid has, so the gesture transfers.
|
|
826
|
+
if (!current)
|
|
827
|
+
draft.orderBy = [{ path, direction: 'asc' }];
|
|
828
|
+
else if (current.direction === 'asc')
|
|
829
|
+
draft.orderBy = [{ path, direction: 'desc' }];
|
|
830
|
+
else
|
|
831
|
+
draft.orderBy = [];
|
|
832
|
+
changed();
|
|
833
|
+
}
|
|
834
|
+
function openSaved(view) {
|
|
835
|
+
loadView(view);
|
|
836
|
+
claim();
|
|
837
|
+
changed();
|
|
838
|
+
}
|
|
839
|
+
async function removeSaved(view) {
|
|
840
|
+
const ok = await confirmFor({
|
|
841
|
+
title: say('removeName', { name: view.name }),
|
|
842
|
+
body: say('theViewIsOnly'),
|
|
843
|
+
confirmLabel: say('common.remove'),
|
|
844
|
+
});
|
|
845
|
+
if (!ok)
|
|
846
|
+
return;
|
|
847
|
+
if (!writeSaved(savedViews().filter((v) => v.id !== view.id)))
|
|
848
|
+
return;
|
|
849
|
+
if (draft.id === view.id) {
|
|
850
|
+
/* The draft stays on screen — losing your work because you tidied the
|
|
851
|
+
list would be a rude surprise — but it is no longer *that* view, and
|
|
852
|
+
the link has to stop claiming it is or reloading would 404 it. */
|
|
853
|
+
draft.id = '';
|
|
854
|
+
claim();
|
|
855
|
+
}
|
|
856
|
+
redraw();
|
|
857
|
+
}
|
|
858
|
+
/* ---------- saving ---------- */
|
|
859
|
+
async function saveDraft() {
|
|
860
|
+
if (!draft.columns.length && !aggregates().length) {
|
|
861
|
+
toast(say('pickAtLeastOneField'), 'error');
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
if (draft.source === 'config') {
|
|
865
|
+
toast(say('thisViewComesFromTablewalk'), 'error');
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
if (!draft.name.trim() || !draft.id)
|
|
869
|
+
return saveAs();
|
|
870
|
+
const list = savedViews().map((v) => (v.id === draft.id ? snapshot(draft.id) : v));
|
|
871
|
+
if (!list.some((v) => v.id === draft.id))
|
|
872
|
+
list.push(snapshot(draft.id));
|
|
873
|
+
if (!writeSaved(list))
|
|
874
|
+
return;
|
|
875
|
+
toast(say('saved', { name: draft.name.trim() }), 'ok');
|
|
876
|
+
claim();
|
|
877
|
+
redraw();
|
|
878
|
+
}
|
|
879
|
+
async function saveAs() {
|
|
880
|
+
if (!draft.columns.length && !aggregates().length) {
|
|
881
|
+
toast(say('pickAtLeastOneField'), 'error');
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
const name = await promptFor({
|
|
885
|
+
title: say('saveThisView'),
|
|
886
|
+
label: say('common.name'),
|
|
887
|
+
value: draft.name.trim() || suggestName(),
|
|
888
|
+
hint: `${draft.base} · ${say('countFields', { count: draft.columns.length })} · ${say('countRelatedTables', { count: opened.size })}`,
|
|
889
|
+
placeholder: say('eGAustralianWork'),
|
|
890
|
+
});
|
|
891
|
+
if (!name)
|
|
892
|
+
return;
|
|
893
|
+
draft.name = name;
|
|
894
|
+
draft.source = undefined;
|
|
895
|
+
const id = newId();
|
|
896
|
+
draft.id = id;
|
|
897
|
+
// A repeated name replaces rather than duplicating: two entries reading
|
|
898
|
+
// "Open" that do different things is worse than losing the older one.
|
|
899
|
+
const list = savedViews().filter((v) => v.name !== name);
|
|
900
|
+
list.push(snapshot(id));
|
|
901
|
+
if (!writeSaved(list))
|
|
902
|
+
return;
|
|
903
|
+
toast(say('saved', { name }), 'ok');
|
|
904
|
+
claim();
|
|
905
|
+
redraw();
|
|
906
|
+
}
|
|
907
|
+
function snapshot(id) {
|
|
908
|
+
return {
|
|
909
|
+
id,
|
|
910
|
+
name: draft.name.trim(),
|
|
911
|
+
base: draft.base,
|
|
912
|
+
columns: draft.columns.map((c) => ({ path: c.path, alias: c.alias })),
|
|
913
|
+
aggregates: draft.aggregates ?? [],
|
|
914
|
+
query: draft.query,
|
|
915
|
+
filter: draft.filter,
|
|
916
|
+
orderBy: draft.orderBy ?? [],
|
|
917
|
+
limit: draft.limit,
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
function suggestName() {
|
|
921
|
+
const table = findTable(draft.base);
|
|
922
|
+
const extras = [...opened].map((p) => {
|
|
923
|
+
const joined = tableAt(draft.base, p);
|
|
924
|
+
return joined ? joined.name : p;
|
|
925
|
+
});
|
|
926
|
+
const head = table ? table.name : draft.base;
|
|
927
|
+
return extras.length ? say('headWithExtras', { head, extras: extras.slice(0, 2).join(' and ') }) : head;
|
|
928
|
+
}
|
|
929
|
+
/* ---------- navigation ----------
|
|
930
|
+
|
|
931
|
+
A composer session is a tab on a table, which is why none of this needs a
|
|
932
|
+
second URL format: the hash already carries a tab, deeplink.js already
|
|
933
|
+
round-trips it, and the app underneath renders the base table — so closing
|
|
934
|
+
the composer leaves you somewhere sensible rather than on a blank page. */
|
|
935
|
+
function linkTo(tab) {
|
|
936
|
+
const entry = currentEntry();
|
|
937
|
+
if (entry && entry.kind === 'table' && entry.table === draft.base) {
|
|
938
|
+
go({ ...entry, tab }, 'replace');
|
|
939
|
+
}
|
|
940
|
+
else {
|
|
941
|
+
// Rebasing rewrites the crumb rather than adding one: choosing a
|
|
942
|
+
// different starting table is editing this view, not a step in a walk.
|
|
943
|
+
go(tableView(draft.base, draft.base, tab), entry ? 'replace' : 'reset');
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Update the address bar without re-rendering the app beneath.
|
|
948
|
+
*
|
|
949
|
+
* `go()` is the right call when the *position* changes; here only the label
|
|
950
|
+
* on the position changes, and putting a full render behind every edit would
|
|
951
|
+
* re-run the base table's query each time a checkbox moved.
|
|
952
|
+
*/
|
|
953
|
+
function stampHash() {
|
|
954
|
+
const entry = currentEntry();
|
|
955
|
+
const tab = tabForDraft();
|
|
956
|
+
if (!entry || entry.kind !== 'table' || entry.table !== draft.base)
|
|
957
|
+
return;
|
|
958
|
+
if (entry.tab === tab)
|
|
959
|
+
return;
|
|
960
|
+
entry.tab = tab;
|
|
961
|
+
openFor = `${draft.base}|${viewTabOf(entry)}`;
|
|
962
|
+
navReplace(shown(toHash()));
|
|
963
|
+
}
|
|
964
|
+
function leave() {
|
|
965
|
+
const entry = currentEntry();
|
|
966
|
+
closeComposer();
|
|
967
|
+
if (entry && entry.kind === 'table')
|
|
968
|
+
go({ ...entry, tab: 'rows' }, 'replace');
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* Where to start when nothing is selected.
|
|
972
|
+
*
|
|
973
|
+
* Not the first table alphabetically: on the demo that is `country`, a
|
|
974
|
+
* two-column lookup with no outgoing keys, so the composer opens with an
|
|
975
|
+
* empty "related tables" panel and appears to do nothing. The table with the
|
|
976
|
+
* most references out of it is the one where the idea explains itself.
|
|
977
|
+
*/
|
|
978
|
+
function likeliestBase() {
|
|
979
|
+
const tables = state.schema.tables.filter((t) => !t.isView);
|
|
980
|
+
const ranked = (tables.length ? tables : state.schema.tables)
|
|
981
|
+
.map((t) => ({ id: t.id, out: refsFrom(t.id).length }))
|
|
982
|
+
.sort((a, b) => b.out - a.out);
|
|
983
|
+
return ranked[0]?.id;
|
|
984
|
+
}
|
|
985
|
+
export function openFromTopbar() {
|
|
986
|
+
const entry = currentEntry();
|
|
987
|
+
const base = entry?.table ?? likeliestBase();
|
|
988
|
+
if (!base) {
|
|
989
|
+
toast(say('thisConnectionHasNoTables'), 'error');
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
if (entry && entry.kind === 'table')
|
|
993
|
+
go({ ...entry, tab: 'view' }, 'replace');
|
|
994
|
+
else
|
|
995
|
+
go(tableView(base, base, 'view'), 'reset');
|
|
996
|
+
sync();
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Reconcile the overlay with wherever the app now is.
|
|
1000
|
+
*
|
|
1001
|
+
* Called after anything that could have navigated. It is a no-op unless the
|
|
1002
|
+
* *view identity* changed, so clicking around inside the composer — which
|
|
1003
|
+
* also produces clicks — cannot reset the draft underneath your hands.
|
|
1004
|
+
*/
|
|
1005
|
+
export function sync() {
|
|
1006
|
+
if (!state.schema)
|
|
1007
|
+
return;
|
|
1008
|
+
const entry = currentEntry();
|
|
1009
|
+
const id = viewTabOf(entry);
|
|
1010
|
+
if (id === null) {
|
|
1011
|
+
closeComposer();
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
if (root && openFor === `${entry.table}|${id}`)
|
|
1015
|
+
return;
|
|
1016
|
+
void openComposer(entry.table, id);
|
|
1017
|
+
}
|
|
1018
|
+
/* ---------- actions ---------- */
|
|
1019
|
+
export const composerActions = {
|
|
1020
|
+
setName: (name) => {
|
|
1021
|
+
draft.name = name;
|
|
1022
|
+
tell();
|
|
1023
|
+
},
|
|
1024
|
+
toggleText: () => {
|
|
1025
|
+
showText = !showText;
|
|
1026
|
+
textEdit = null;
|
|
1027
|
+
redraw();
|
|
1028
|
+
},
|
|
1029
|
+
toggleSql: () => {
|
|
1030
|
+
showSql = !showSql;
|
|
1031
|
+
redraw();
|
|
1032
|
+
},
|
|
1033
|
+
saveDraft,
|
|
1034
|
+
saveAs,
|
|
1035
|
+
leave,
|
|
1036
|
+
setBase,
|
|
1037
|
+
toggleField,
|
|
1038
|
+
addJoin,
|
|
1039
|
+
removeJoin,
|
|
1040
|
+
addAggregate,
|
|
1041
|
+
removeAggregate,
|
|
1042
|
+
startFromChild,
|
|
1043
|
+
setQuery: (text) => {
|
|
1044
|
+
draft.query = text;
|
|
1045
|
+
/* The moment the box is edited it becomes the filter, entirely. */
|
|
1046
|
+
draft.filter = undefined;
|
|
1047
|
+
tell();
|
|
1048
|
+
schedulePreview();
|
|
1049
|
+
},
|
|
1050
|
+
setLimit: (n) => {
|
|
1051
|
+
draft.limit = Number.isFinite(n) && n > 0 ? Math.min(Math.floor(n), 1000) : 20;
|
|
1052
|
+
schedulePreview();
|
|
1053
|
+
},
|
|
1054
|
+
setTextEdit: (text) => {
|
|
1055
|
+
textEdit = text;
|
|
1056
|
+
tell();
|
|
1057
|
+
},
|
|
1058
|
+
applyText,
|
|
1059
|
+
sortByPath,
|
|
1060
|
+
renameColumn,
|
|
1061
|
+
togglePin,
|
|
1062
|
+
openSaved,
|
|
1063
|
+
removeSaved,
|
|
1064
|
+
completionsFor,
|
|
1065
|
+
/** The fresh group has been scrolled to; the mark comes off without a redraw. */
|
|
1066
|
+
consumeJustAdded: () => {
|
|
1067
|
+
justAdded = null;
|
|
1068
|
+
},
|
|
1069
|
+
};
|
|
1070
|
+
/** Escape leaves the field, then the composer. */
|
|
1071
|
+
export function escapeComposer() {
|
|
1072
|
+
if (!root || shellQuery('dialog[open]'))
|
|
1073
|
+
return;
|
|
1074
|
+
const inside = root.contains(document.activeElement);
|
|
1075
|
+
if (inside && document.activeElement instanceof HTMLElement)
|
|
1076
|
+
document.activeElement.blur();
|
|
1077
|
+
else
|
|
1078
|
+
leave();
|
|
1079
|
+
}
|