@mistriwork/kit 1.0.0-rc.10 → 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,1115 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* A result grid, for anything that has rows and columns.
|
|
4
|
+
*
|
|
5
|
+
* One grid for the explorer's table view, an app's list, a record's related
|
|
6
|
+
* rows, a dashboard's list card and an expanded row's children — two
|
|
7
|
+
* renderers would drift, and a work order's parts showing `1`/`0` where
|
|
8
|
+
* the table above shows ✓/✗ is the kind of small inconsistency that makes a
|
|
9
|
+
* tool feel assembled rather than built.
|
|
10
|
+
*
|
|
11
|
+
* Sorting and filtering here work by rewriting the query text — that is
|
|
12
|
+
* the design, and it is why a filter built by clicking can be edited by
|
|
13
|
+
* typing, saved, shared as a link and read back later. So the grid holds
|
|
14
|
+
* no sort state of its own: the walk's query is read for what is sorted,
|
|
15
|
+
* and the header's clicks write to it.
|
|
16
|
+
*
|
|
17
|
+
* TanStack Table holds the column and row model; TanStack Virtual does the
|
|
18
|
+
* window arithmetic for a long result, rendered as a real table with two
|
|
19
|
+
* spacer rows, so column widths, sticky headers, text selection and
|
|
20
|
+
* Find-in-page all keep working. Below a few hundred rows windowing costs
|
|
21
|
+
* more than it saves and every row is drawn.
|
|
22
|
+
*
|
|
23
|
+
* The reader arranges the columns they see (gridArrange.ts): each head
|
|
24
|
+
* carries move buttons and a resizer, one step or one drag at a time,
|
|
25
|
+
* and the arrangement lives only in this grid — a refetch never moves a
|
|
26
|
+
* column the reader placed, and another reader never sees it.
|
|
27
|
+
*/
|
|
28
|
+
import { useMessageLanguage } from './useMessageLanguage.js';
|
|
29
|
+
import { cloneElement, isValidElement, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
30
|
+
import { createColumnHelper, tableFeatures, useTable } from '@tanstack/react-table';
|
|
31
|
+
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
32
|
+
import { columnDisplay, columnLabel, currentEntry, emptyWord, keyOf, openRecord, peekRecord, prefersPages, primaryKey, rowLabel, state, viewportBox, viewportScale, } from '../core.js';
|
|
33
|
+
import { opensRecord } from '../recordIntent.js';
|
|
34
|
+
import { labelColumn as namingColumn } from '@mistriwork/engine/shared/schema.js';
|
|
35
|
+
import { datesAmong, dressFor, leadTonePath, maskedText, ruleSays, subtitlePath } from './valueModel.js';
|
|
36
|
+
import { currencyPath } from '@mistriwork/engine/shared/money.js';
|
|
37
|
+
import { dueOpen } from './dueOpen.js';
|
|
38
|
+
import { LeadMark } from './Dressed.js';
|
|
39
|
+
import { formatDate, formatDateTime, formatNumber, sayNearDay } from '../locale.js';
|
|
40
|
+
import { AvatarText, Dressed } from './Value.js';
|
|
41
|
+
import { ValueSlot } from './valueRenderers.js';
|
|
42
|
+
import { sortDirection } from '../clauses.js';
|
|
43
|
+
import { planColumn, sortableFromHeader } from '../columns.js';
|
|
44
|
+
import { pinnedFor, pinsVersion, subscribePins } from '../pins.js';
|
|
45
|
+
import { hasChildren } from '../nested.js';
|
|
46
|
+
import { openFilterMenu, sortBy } from '../thmenu.js';
|
|
47
|
+
import { AppColumnMenuButton, useAppColumnMenu } from './AppColumnMenu.js';
|
|
48
|
+
import { DetailRow, Expander } from './Nested.js';
|
|
49
|
+
import { createRowHosts, RowDecoration, RowHostScope, RowTrailScope, rowKeyString, useRowHostScope, useRowTrailScope, } from './RowHost.js';
|
|
50
|
+
import { useGridKeyboard } from './useGridKeyboard.js';
|
|
51
|
+
import { useChangedRows } from '../liveState.js';
|
|
52
|
+
import { textMeasure } from './textMeasure.js';
|
|
53
|
+
import { presentationColumns } from './columnPresentation.js';
|
|
54
|
+
import { usePins } from './usePins.js';
|
|
55
|
+
import { useStickyHead } from './useStickyHead.js';
|
|
56
|
+
import { fitGridColumns, keepFitting, tagsThatFit, twoLineWidth, GRID_EXPANDER_WIDTH, GRID_HEAD_CHAR, GRID_SIZE_SAMPLE, GRID_TRAIL_WIDTH, } from './gridSizing.js';
|
|
57
|
+
import { applyColumnOrder, applyColumnWidths, clampColumnWidth, columnResizeStep, MIN_COLUMN_WIDTH, moveColumn } from './gridArrange.js';
|
|
58
|
+
import { VISUAL_THEME_EVENT } from '../visualTheme.js';
|
|
59
|
+
import { JsonPreview } from './JsonPreview.js';
|
|
60
|
+
import { AvatarPhotoContext, AvatarPhotos, avatarOwner } from './avatarPhotos.js';
|
|
61
|
+
import { jsonValueOf, previewOf } from './jsonModel.js';
|
|
62
|
+
import { vocabularyWord } from '@mistriwork/engine/shared/model.js';
|
|
63
|
+
import { shell } from '../shellMode.js';
|
|
64
|
+
import { parseLabelTemplate } from '@mistriwork/engine/shared/recordLabel.js';
|
|
65
|
+
import { say } from '../copy/lists/components/Grid.js';
|
|
66
|
+
import { TAGS_TYPE, tagChips } from '@mistriwork/engine/shared/tagLists.js';
|
|
67
|
+
import { addHostListener, removeHostListener, shellBody } from '../shellHost.js';
|
|
68
|
+
import { rowOpensTarget, useRowOpens } from './rowOpens.js';
|
|
69
|
+
/* A column narrower than this does not take a folded detail line: it would wrap inside it. */
|
|
70
|
+
const FOLD_ROOM = 150;
|
|
71
|
+
/* How many of a record's tags a list's cell draws before it says how many more. */
|
|
72
|
+
const TAGS_SHOWN = 3;
|
|
73
|
+
/* The mark a reference's head draws after its label, and its sizing counts. */
|
|
74
|
+
const REFERENCE_MARK = '→';
|
|
75
|
+
/** Beyond a few hundred rows the DOM, not the database, is the bottleneck. */
|
|
76
|
+
const VIRTUAL_THRESHOLD = 300;
|
|
77
|
+
const OVERSCAN = 12;
|
|
78
|
+
/** The most a single grid cell will put in the DOM. Well past what 30rem shows. */
|
|
79
|
+
const CELL_MAX = 300;
|
|
80
|
+
/** Rows started per batch when every row is expanded at once, and the pause between. */
|
|
81
|
+
const BATCH = 4;
|
|
82
|
+
const BREATH_MS = 60;
|
|
83
|
+
const features = tableFeatures({});
|
|
84
|
+
const helper = createColumnHelper();
|
|
85
|
+
const NO_ROWS = [];
|
|
86
|
+
function clampCell(raw) {
|
|
87
|
+
/* Not clamped, the cell has nothing to add on hover unless its column clips
|
|
88
|
+
it, which onMouseOver decides from the cell's own overflow: a title on
|
|
89
|
+
every value past 40 characters repeated a name the reader could read, in a
|
|
90
|
+
native tooltip drawn over whatever sat under it. */
|
|
91
|
+
if (raw.length <= CELL_MAX)
|
|
92
|
+
return { text: raw };
|
|
93
|
+
const more = raw.length - CELL_MAX;
|
|
94
|
+
return {
|
|
95
|
+
text: `${raw.slice(0, CELL_MAX)}…`,
|
|
96
|
+
title: say('moreCharactersOpenTheRow', { count: more }),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* One cell, rendered by what it holds. A reference is marked on the way
|
|
101
|
+
* out: a foreign key can be a number, a string or a code, so the branch
|
|
102
|
+
* that draws it is decided by its type while whether it points somewhere
|
|
103
|
+
* is decided by the schema.
|
|
104
|
+
*/
|
|
105
|
+
/** A total, dressed as its column is; a sum past 2^53 is shown as the server sent it. */
|
|
106
|
+
function TotalValue({ value, display }) {
|
|
107
|
+
if (value === undefined)
|
|
108
|
+
return (_jsx("span", { className: "grid-totals-pending", "aria-label": say('summing'), children: "\u2026" }));
|
|
109
|
+
if (value === null)
|
|
110
|
+
return _jsx("span", { className: "null", children: emptyWord() });
|
|
111
|
+
const dress = dressFor(display, value);
|
|
112
|
+
if (dress && dress.kind !== 'meter')
|
|
113
|
+
return _jsx(Dressed, { dress: dress, compact: dress.kind === 'richText' });
|
|
114
|
+
return _jsx("span", { className: "num-value", children: formatNumber(value) });
|
|
115
|
+
}
|
|
116
|
+
/** The words a plain cell draws for a value, which the grid sizes a column by and a folded detail line tests its head
|
|
117
|
+
against: a reference's label, a display rule's own words, a number as formatted, else the raw value. */
|
|
118
|
+
function drawnWords(display, plan, value, label) {
|
|
119
|
+
if (label !== null && label !== undefined && String(label) !== '')
|
|
120
|
+
return label;
|
|
121
|
+
const dress = dressFor(display, value);
|
|
122
|
+
if (!dress && plan.kind === 'number' && value != null)
|
|
123
|
+
return numberShown(value, plan) ?? value;
|
|
124
|
+
return (dress?.kind === 'tone' || dress?.kind === 'word' || dress?.kind === 'mark' ? dress.label : dress?.text) ?? value;
|
|
125
|
+
}
|
|
126
|
+
/** A row's folded columns, each drawn as its own cell would draw it, for the detail line under the row's name. */
|
|
127
|
+
export function foldedOf(more, record) {
|
|
128
|
+
/* Empty says nothing, and a yes-or-no says its head where it is yes ("Listed online") and nothing where it is no. */
|
|
129
|
+
const yes = (value) => value === true || value === 1 || value === '1' || value === 't' || value === 'true';
|
|
130
|
+
return more
|
|
131
|
+
.filter((column) => record[column.name] !== null && record[column.name] !== undefined && record[column.name] !== '')
|
|
132
|
+
.filter((column) => column.plan.kind !== 'boolean' || yes(record[column.name]))
|
|
133
|
+
.map((column) => {
|
|
134
|
+
if (column.plan.kind === 'boolean')
|
|
135
|
+
return { name: column.name, head: column.head, body: null };
|
|
136
|
+
const td = CellBody({
|
|
137
|
+
meta: column.meta,
|
|
138
|
+
plan: column.plan,
|
|
139
|
+
value: record[column.name],
|
|
140
|
+
label: column.label ? record[column.label] : undefined,
|
|
141
|
+
display: column.display,
|
|
142
|
+
pin: undefined,
|
|
143
|
+
edge: false,
|
|
144
|
+
});
|
|
145
|
+
/* A value that already says its head ("Cycle 19" under Cycle) is not told it twice: tested against the words
|
|
146
|
+
the cell draws, which a display rule or a reference's label may set apart from the stored value. */
|
|
147
|
+
const said = String(drawnWords(column.display, column.plan, record[column.name], column.label ? record[column.label] : undefined) ?? '').toLowerCase();
|
|
148
|
+
return {
|
|
149
|
+
name: column.name,
|
|
150
|
+
head: said.startsWith(column.head.toLowerCase()) ? '' : column.head,
|
|
151
|
+
body: isValidElement(td) ? td.props.children : null,
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/** A cell, and under it the second line its column's display rule names.
|
|
156
|
+
Memoized, as its row is: every prop is a value or a per-column object
|
|
157
|
+
the grid keeps (`useKeptColumns`), so an unchanged cell is not redrawn.
|
|
158
|
+
An editable cell is handed the grid's one `editCell` and its row, not a
|
|
159
|
+
closure made per paint, for the same reason. */
|
|
160
|
+
const Cell = memo(function Cell({ sub, more, editCell, adornCell, record, name, lead, ...props }) {
|
|
161
|
+
const edit = editCell && record && name !== undefined ? (draw) => editCell(record, name, draw, props.label) : undefined;
|
|
162
|
+
const td = CellBody(props);
|
|
163
|
+
const empty = props.value === null || props.value === undefined || props.value === '';
|
|
164
|
+
const adorned = adornCell && record && name !== undefined && empty ? adornCell(record, name) : undefined;
|
|
165
|
+
if (adorned !== undefined && isValidElement(td))
|
|
166
|
+
return cloneElement(td, {}, adorned);
|
|
167
|
+
/* An edited cell keeps its own <td> — alignment, pin, dress — and hands its
|
|
168
|
+
editor a way to draw any value as this cell would. */
|
|
169
|
+
if (edit && isValidElement(td)) {
|
|
170
|
+
const draw = (next) => {
|
|
171
|
+
const drawn = next ? CellBody({ ...props, value: next.value, label: next.label }) : td;
|
|
172
|
+
return isValidElement(drawn) ? drawn.props.children : null;
|
|
173
|
+
};
|
|
174
|
+
const editor = edit(draw);
|
|
175
|
+
/* The whole cell is the editor's, its padding too: a click there edits
|
|
176
|
+
rather than opening the row, as a click on the value does. */
|
|
177
|
+
if (editor !== undefined)
|
|
178
|
+
return cloneElement(td, {
|
|
179
|
+
className: `${td.props.className ?? ''} cell-editable`,
|
|
180
|
+
onClick: (event) => {
|
|
181
|
+
event.stopPropagation();
|
|
182
|
+
if (event.target === event.currentTarget)
|
|
183
|
+
event.currentTarget.querySelector('[data-cell-edits]')?.click();
|
|
184
|
+
},
|
|
185
|
+
}, editor);
|
|
186
|
+
}
|
|
187
|
+
const hasSub = !(sub === null || sub === undefined || sub === '');
|
|
188
|
+
const hasMore = Boolean(more?.length);
|
|
189
|
+
if ((!hasSub && !lead && !hasMore) || !isValidElement(td))
|
|
190
|
+
return td;
|
|
191
|
+
const body = hasSub || hasMore ? (_jsxs("span", { className: "cell-stack", children: [_jsx("span", { className: "cell-main", children: td.props.children }), hasSub && _jsx("span", { className: "cell-sub", children: String(sub) }), hasMore && (_jsx("span", { className: "cell-more", children: more.map((item) => (_jsxs("span", { className: "cell-more-item", children: [item.head && _jsx("span", { className: item.body === null ? 'cell-more-flag' : 'cell-more-head', children: item.head }), item.body !== null && _jsxs(_Fragment, { children: [" ", item.body] })] }, item.name))) }))] })) : (td.props.children);
|
|
192
|
+
return cloneElement(td, hasMore ? { className: `${td.props.className ?? ''} has-more` } : undefined, lead ? (_jsxs("span", { className: "cell-lead", children: [_jsx(LeadMark, { mark: lead.mark, tone: lead.tone }), _jsx("span", { className: "cell-lead-body", children: body })] })) : (body));
|
|
193
|
+
});
|
|
194
|
+
/* The lead icon a column's rule puts before its value, tinted by the tone its tone column's rule gives the row. Kept
|
|
195
|
+
per row as one object per mark and tone, so the memoized cell sees the same prop until the row changes. */
|
|
196
|
+
const leads = new Map();
|
|
197
|
+
function leadOf(column, record) {
|
|
198
|
+
const mark = column.display?.icon?.mark;
|
|
199
|
+
if (!mark)
|
|
200
|
+
return undefined;
|
|
201
|
+
const raw = column.leadTone && Object.hasOwn(record, column.leadTone.path) ? record[column.leadTone.path] : undefined;
|
|
202
|
+
const said = column.leadTone && raw != null ? ruleSays(column.leadTone.rule, raw).tone : undefined;
|
|
203
|
+
/* A value the rule does not name is "neutral" as a chip, but a grey square on every ordinary row reads as disabled:
|
|
204
|
+
only a tone the rule says (by name or by "*") takes the accent's place. */
|
|
205
|
+
const named = column.leadTone?.rule?.tone ?? {};
|
|
206
|
+
const tone = said === 'neutral' && !Object.hasOwn(named, String(raw)) && !Object.hasOwn(named, '*') ? undefined : said;
|
|
207
|
+
const key = `${mark}\u0000${tone ?? ''}`;
|
|
208
|
+
if (!leads.has(key))
|
|
209
|
+
leads.set(key, { mark, ...(tone ? { tone } : {}) });
|
|
210
|
+
return leads.get(key);
|
|
211
|
+
}
|
|
212
|
+
/* A key the App names in its own words ('SO-{id}'): the template filled
|
|
213
|
+
with the key as it came, never through Number(), so a key past 2^53
|
|
214
|
+
reads whole. The cell's data is untouched: sort, filter and export read the key. */
|
|
215
|
+
function keyName(template, value) {
|
|
216
|
+
if (value === null || value === undefined || value === '')
|
|
217
|
+
return value;
|
|
218
|
+
const parsed = parseLabelTemplate(template);
|
|
219
|
+
return 'problem' in parsed ? value : parsed.parts.map((part) => ('text' in part ? part.text : String(value))).join('');
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* The columns as the rows draw them, the same array for as long as nothing
|
|
223
|
+
* in it changed. The grid redraws whenever the room around it does — a
|
|
224
|
+
* keystroke in the list's search box was one — and a fresh array every time
|
|
225
|
+
* handed every memoized row a new prop, so each keystroke redrew every cell
|
|
226
|
+
* on the page: 250 rows, 250 times the work of 20.
|
|
227
|
+
*/
|
|
228
|
+
function useKeptColumns(columns) {
|
|
229
|
+
const kept = useRef(columns);
|
|
230
|
+
const was = kept.current;
|
|
231
|
+
/* A plan is remade from the rows (planColumn reads their decimals), so a
|
|
232
|
+
refetch with one changed row compares it by what it says. */
|
|
233
|
+
const samePlan = (a, b) => Object.keys(a).every((key) => a[key] === b[key]) && Object.keys(a).length === Object.keys(b).length;
|
|
234
|
+
const same = was.length === columns.length &&
|
|
235
|
+
columns.every((column, i) => Object.keys(column).every((key) => column[key] === was[i][key] || (key === 'plan' && samePlan(column.plan, was[i].plan))));
|
|
236
|
+
if (!same)
|
|
237
|
+
kept.current = columns;
|
|
238
|
+
return kept.current;
|
|
239
|
+
}
|
|
240
|
+
/** What a number cell draws for a value, or null where it draws the raw text.
|
|
241
|
+
A value the server sent as a string because it is past 2^53 must not be
|
|
242
|
+
run back through Number(): formatNumber keeps every digit. */
|
|
243
|
+
function numberShown(value, plan) {
|
|
244
|
+
const n = Number(value);
|
|
245
|
+
if (typeof value === 'string' && /^-?\d+$/.test(value) && !Number.isSafeInteger(n))
|
|
246
|
+
return formatNumber(value);
|
|
247
|
+
return Number.isFinite(n)
|
|
248
|
+
? formatNumber(n, {
|
|
249
|
+
minimumFractionDigits: plan.decimals,
|
|
250
|
+
maximumFractionDigits: plan.decimals,
|
|
251
|
+
useGrouping: plan.group,
|
|
252
|
+
})
|
|
253
|
+
: null;
|
|
254
|
+
}
|
|
255
|
+
/* A dress that draws only its words: a meter's bar and a percent's bar or ring are width the words do not
|
|
256
|
+
measure. (Only a number's or a date's dress is read for this: an avatar or a signature is text's.) */
|
|
257
|
+
const drawsWords = (dress) => dress.kind !== 'meter' && !('bar' in dress && dress.bar) && !('ring' in dress && dress.ring);
|
|
258
|
+
/* A record's tags in a list's cell: as many whole chips as the cell holds
|
|
259
|
+
(at most TAGS_SHOWN, at least one), then how many more. Clipped by the
|
|
260
|
+
cell, Thread's issues read "accessibility perfo"; a chip is a word, and a
|
|
261
|
+
cut one is no word at all. The chips that do not fit are hidden, not
|
|
262
|
+
unmounted, so a wider cell shows them again; the count is written into a
|
|
263
|
+
span React leaves empty. */
|
|
264
|
+
function TagsCellList({ chips }) {
|
|
265
|
+
const ref = useRef(null);
|
|
266
|
+
const shown = chips.slice(0, TAGS_SHOWN);
|
|
267
|
+
const labels = chips.map((chip) => chip.label).join('\n');
|
|
268
|
+
useLayoutEffect(() => {
|
|
269
|
+
const list = ref.current;
|
|
270
|
+
const cell = list?.parentElement;
|
|
271
|
+
if (!list || !cell)
|
|
272
|
+
return;
|
|
273
|
+
const tags = [...list.querySelectorAll(':scope > .record-tag')];
|
|
274
|
+
const more = list.querySelector(':scope > .tags-cell-more');
|
|
275
|
+
const sayMore = (count) => {
|
|
276
|
+
more.textContent = count > 0 ? say('moreTags', { count }) : '';
|
|
277
|
+
more.style.display = count > 0 ? '' : 'none';
|
|
278
|
+
};
|
|
279
|
+
const fit = () => {
|
|
280
|
+
tags.forEach((tag) => (tag.style.display = ''));
|
|
281
|
+
sayMore(chips.length - tags.length);
|
|
282
|
+
const box = getComputedStyle(cell);
|
|
283
|
+
const room = cell.clientWidth - parseFloat(box.paddingLeft) - parseFloat(box.paddingRight);
|
|
284
|
+
if (!(room > 0))
|
|
285
|
+
return;
|
|
286
|
+
const gap = parseFloat(getComputedStyle(list).columnGap) || 0;
|
|
287
|
+
const widths = tags.map((tag) => tag.offsetWidth);
|
|
288
|
+
const count = tagsThatFit(widths, chips.length, gap, room, (rest) => {
|
|
289
|
+
sayMore(rest);
|
|
290
|
+
return more.offsetWidth;
|
|
291
|
+
});
|
|
292
|
+
sayMore(chips.length - count);
|
|
293
|
+
tags.forEach((tag, index) => (tag.style.display = index < count ? '' : 'none'));
|
|
294
|
+
};
|
|
295
|
+
fit();
|
|
296
|
+
const observer = new ResizeObserver(() => fit());
|
|
297
|
+
observer.observe(cell);
|
|
298
|
+
return () => observer.disconnect();
|
|
299
|
+
}, [labels]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
300
|
+
return (_jsxs("span", { ref: ref, className: "tags-cell-list", children: [shown.map((chip) => (_jsx("span", { className: `record-tag tone tone-${chip.tone ?? 'neutral'}`, children: chip.label }, chip.label))), _jsx("span", { className: "tags-cell-more" })] }));
|
|
301
|
+
}
|
|
302
|
+
function CellBody(props) {
|
|
303
|
+
const { row, table, currency, open, ...cell } = props;
|
|
304
|
+
if (open)
|
|
305
|
+
cell.display = { ...cell.display, open: true };
|
|
306
|
+
/* A money column whose currency is the row's own: the code the row holds, where it holds one. */
|
|
307
|
+
if (typeof currency === 'string' && /^[A-Za-z]{3}$/.test(currency))
|
|
308
|
+
cell.display = {
|
|
309
|
+
...cell.display,
|
|
310
|
+
currency: currency.toUpperCase(),
|
|
311
|
+
};
|
|
312
|
+
const rule = cell.display;
|
|
313
|
+
/* The App's own renderer draws the value inside the platform's cell — its
|
|
314
|
+
class, alignment and pin kept — and the platform's own drawing stands in
|
|
315
|
+
until it arrives. The cell's data is untouched: sort, filter and export
|
|
316
|
+
read the value, never what a renderer drew. */
|
|
317
|
+
if (rule?.component &&
|
|
318
|
+
table &&
|
|
319
|
+
maskedText(rule, cell.value) === undefined &&
|
|
320
|
+
cell.value !== null &&
|
|
321
|
+
cell.value !== undefined &&
|
|
322
|
+
shellBody().classList.contains('app-mode')) {
|
|
323
|
+
const { component: _component, ...rest } = rule;
|
|
324
|
+
const td = PlatformCell({ ...cell, display: rest });
|
|
325
|
+
if (!isValidElement(td))
|
|
326
|
+
return td;
|
|
327
|
+
return cloneElement(td, undefined, _jsx(ValueSlot, { id: rule.component.id, value: cell.value, row: row, column: { name: cell.meta?.name ?? '', resource: table }, context: "grid", compact: true, ...ruleSays(rest, cell.value), fallback: td.props.children }));
|
|
328
|
+
}
|
|
329
|
+
return PlatformCell(cell);
|
|
330
|
+
}
|
|
331
|
+
function PlatformCell({ meta, plan, value, label, display, pin, edge, photo, wraps, }) {
|
|
332
|
+
const classes = [`align-${plan.align}`];
|
|
333
|
+
const peek = meta?.references && value !== null && value !== undefined && value !== ''
|
|
334
|
+
? {
|
|
335
|
+
'data-ref-table': meta.references.table,
|
|
336
|
+
'data-ref-column': meta.references.column,
|
|
337
|
+
'data-ref-value': String(value),
|
|
338
|
+
}
|
|
339
|
+
: {};
|
|
340
|
+
const pinAttrs = pin !== undefined ? { style: { left: `${pin}px` } } : {};
|
|
341
|
+
/* The face the rule asks for wins; unasked, an App sets short text in the reading face unless it is a key or a code. */
|
|
342
|
+
const face = display?.face;
|
|
343
|
+
const app = shellBody().classList.contains('app-mode');
|
|
344
|
+
const pinClass = (pin !== undefined ? ` pinned${edge ? ' pinned-edge' : ''}` : '') + (face ? ` face-${face}` : '') + (wraps ? ' wraps' : '');
|
|
345
|
+
/* A record's tags (tagLists.ts): a few chips, and how many more there are. */
|
|
346
|
+
if (meta?.type === TAGS_TYPE) {
|
|
347
|
+
const chips = tagChips(value);
|
|
348
|
+
return (_jsx("td", { className: `align-left tags-cell${pinClass}`, title: chips.map((chip) => chip.label).join(', ') || undefined, ...pinAttrs, children: chips.length ? _jsx(TagsCellList, { chips: chips }) : emptyWord() }));
|
|
349
|
+
}
|
|
350
|
+
if (value === null || value === undefined) {
|
|
351
|
+
return (_jsx("td", { className: `null align-${plan.align}${pinClass}`, title: "null", ...pinAttrs, children: emptyWord() }));
|
|
352
|
+
}
|
|
353
|
+
const json = jsonValueOf(meta, value);
|
|
354
|
+
if (json)
|
|
355
|
+
return (_jsx("td", { className: `align-left json-cell${pinClass}`, ...pinAttrs, children: _jsx(JsonPreview, { value: json.value, name: meta?.name ?? 'Value', type: meta?.type }) }));
|
|
356
|
+
const raw = String(value);
|
|
357
|
+
if (label !== null && label !== undefined && String(label) !== '') {
|
|
358
|
+
return (_jsx("td", { className: `align-left reflink${pinClass}`, title: `${String(label)} (${raw})`, ...peek, ...pinAttrs, children: display?.avatar ? (_jsx(AvatarText, { text: clampCell(String(label)).text, photo: photo })) : (clampCell(String(label)).text) }));
|
|
359
|
+
}
|
|
360
|
+
const dress = dressFor(display, value);
|
|
361
|
+
if (dress) {
|
|
362
|
+
return (_jsx("td", { className: `align-${plan.align} dressed${pinClass}`, ...peek, ...pinAttrs, children: _jsx(Dressed, { dress: dress.kind === 'avatar' && photo ? { ...dress, photo } : dress, compact: dress.kind === 'richText' }) }));
|
|
363
|
+
}
|
|
364
|
+
if (!face && (plan.kind === 'number' || (plan.mono && (!app || plan.kind !== 'text' || plan.idLike))))
|
|
365
|
+
classes.push('mono');
|
|
366
|
+
if (plan.kind === 'boolean') {
|
|
367
|
+
const on = value === true || value === 1 || value === '1' || value === 't';
|
|
368
|
+
return (_jsx("td", { className: `${classes.join(' ')} bool${pinClass}`, title: raw, ...peek, ...pinAttrs, children: _jsx("span", { className: on ? 'yes' : 'no', children: on ? '✓' : '✗' }) }));
|
|
369
|
+
}
|
|
370
|
+
if (plan.kind === 'number') {
|
|
371
|
+
const shown = numberShown(value, plan) ?? raw;
|
|
372
|
+
return (_jsx("td", { className: `${classes.join(' ')} num${meta?.references ? ' reflink' : ''}${pinClass}`, title: shown === raw ? undefined : raw, ...peek, ...pinAttrs, children: shown }));
|
|
373
|
+
}
|
|
374
|
+
if (plan.kind === 'date') {
|
|
375
|
+
/* An App says a near day from today and the rest as the date, the whole of it on hover (sayNearDay); the
|
|
376
|
+
Workbench shows the data as it is, its stored form on hover. */
|
|
377
|
+
const near = app ? sayNearDay(raw, Boolean(plan.showTime)) : null;
|
|
378
|
+
const shown = near?.text ?? (plan.showTime ? formatDateTime(raw) : formatDate(raw));
|
|
379
|
+
const title = near?.title ?? (shown === raw ? undefined : raw);
|
|
380
|
+
return (_jsx("td", { className: `${classes.join(' ')}${pinClass}`, title: title, ...peek, ...pinAttrs, children: shown }));
|
|
381
|
+
}
|
|
382
|
+
if (meta?.references) {
|
|
383
|
+
return (_jsx("td", { className: `${classes.join(' ')}${pinClass}`, ...peek, ...pinAttrs, children: _jsx("span", { className: "ref", title: `→ ${meta.references.table}`, children: raw }) }));
|
|
384
|
+
}
|
|
385
|
+
/* In an App a vocabulary's value is a word (Value.tsx says why); the Workbench's grid shows the data. */
|
|
386
|
+
if (shellBody().classList.contains('app-mode') && meta?.allowed?.includes(raw))
|
|
387
|
+
return (_jsx("td", { className: `${classes.join(' ')}${pinClass}`, title: raw, ...pinAttrs, children: vocabularyWord(raw) }));
|
|
388
|
+
const cell = clampCell(raw);
|
|
389
|
+
return (_jsx("td", { className: `${classes.join(' ')}${pinClass}`, title: cell.title, ...pinAttrs, children: cell.text }));
|
|
390
|
+
}
|
|
391
|
+
/* A vocabulary column that says where a row stands, kept when a narrow grid leaves columns out. */
|
|
392
|
+
const STATUS_NAME = /(^|_)(status|state|stage|phase)$/i;
|
|
393
|
+
export function Grid({ table, data, hide, labels, totals, totalsLabel = say('total'), density, referenceLabels, sizing = 'fit', interactive = true, virtual: mayVirtualise = true, onRowClick, list, current, emptyText, compact = false, firstRow = 0, dropColumns = false, editCell, adornCell, }) {
|
|
394
|
+
const captionLanguage = useMessageLanguage();
|
|
395
|
+
const wrap = useRef(null);
|
|
396
|
+
const tableRef = useRef(null);
|
|
397
|
+
const rows = data.rows ?? NO_ROWS;
|
|
398
|
+
const byName = useMemo(() => presentationColumns(state.schema, table, data.columns ?? []), [table, data.columns, state.schema]);
|
|
399
|
+
/* The columns asked to be drawn; an embedded grid may leave out those past its width (`drawn`, below). */
|
|
400
|
+
const asked = useMemo(() => (hide?.length ? (data.columns ?? []).filter((name) => !hide.includes(name)) : (data.columns ?? [])), [data.columns, hide?.join(',')]);
|
|
401
|
+
/* A second line is read from the row only where the row carries it: a
|
|
402
|
+
subtitle the list did not fetch is left out rather than read from a
|
|
403
|
+
column of the same name on another table. */
|
|
404
|
+
const subtitleOf = (name, row) => {
|
|
405
|
+
const path = subtitlePath(columnDisplay(table?.id, name), name);
|
|
406
|
+
return path && Object.hasOwn(row, path) ? row[path] : undefined;
|
|
407
|
+
};
|
|
408
|
+
const plans = useMemo(() => new Map(asked.map((name) => [
|
|
409
|
+
name,
|
|
410
|
+
{
|
|
411
|
+
...planColumn(byName.get(name), name, rows),
|
|
412
|
+
...(referenceLabels?.[name] ? { align: 'left' } : {}),
|
|
413
|
+
// A key the App names ('SO-{id}') is drawn as that name: text, read from the left.
|
|
414
|
+
...(table?.keyLabel && table.labelTemplate && byName.get(name)?.primaryKey ? { kind: 'text', align: 'left' } : {}),
|
|
415
|
+
},
|
|
416
|
+
])), [asked, byName, rows, referenceLabels, table]);
|
|
417
|
+
/* Each row's identity: the string its host is published under and the key
|
|
418
|
+
React keeps it by, so a refetch that reorders or drops rows moves the
|
|
419
|
+
survivors instead of redrawing them. A row that cannot name itself — no
|
|
420
|
+
key, a result that dropped a key column, a duplicate — is kept by
|
|
421
|
+
position and has no host. */
|
|
422
|
+
const keyed = Boolean(table && primaryKey(table).length && primaryKey(table).every((c) => (data.columns ?? []).includes(c)));
|
|
423
|
+
const outerHosts = useRowHostScope();
|
|
424
|
+
const [ownHosts] = useState(createRowHosts);
|
|
425
|
+
const hosts = outerHosts ?? ownHosts;
|
|
426
|
+
/* The trailing cell, drawn only when something around the grid asked to
|
|
427
|
+
put a row's own menu there — and only on rows that can name themselves. */
|
|
428
|
+
const trailHosts = useRowTrailScope();
|
|
429
|
+
const rowKeys = useMemo(() => {
|
|
430
|
+
if (!keyed)
|
|
431
|
+
return rows.map(() => null);
|
|
432
|
+
const seen = new Set();
|
|
433
|
+
return rows.map((row) => {
|
|
434
|
+
const key = rowKeyString(table, row);
|
|
435
|
+
if (key === null || seen.has(key))
|
|
436
|
+
return null;
|
|
437
|
+
seen.add(key);
|
|
438
|
+
return key;
|
|
439
|
+
});
|
|
440
|
+
}, [keyed, table, rows]);
|
|
441
|
+
/* Rows another person just changed, tinted for a moment (liveState.ts, docs/design.md rule 11). */
|
|
442
|
+
const changedRows = useChangedRows(table?.id, rows, (row) => (table ? keyOf(table, row) : null));
|
|
443
|
+
const openable = useMemo(() => rowKeys.filter((key) => key !== null), [rowKeys]);
|
|
444
|
+
const virtual = mayVirtualise && rows.length > VIRTUAL_THRESHOLD;
|
|
445
|
+
/* Not where rows open as pages: the expander is the explorer's way of
|
|
446
|
+
seeing what points at a row, and an app's list gets that on the page
|
|
447
|
+
the row opens as. Nor on a windowed table: an opened detail is many
|
|
448
|
+
times a row's height, and the window's whole model is uniform rows. Nor
|
|
449
|
+
on a result without the key: what points at a row is asked by its key,
|
|
450
|
+
and a projection that dropped it has nothing to ask with. */
|
|
451
|
+
const expandable = interactive && !prefersPages() && rows.length <= VIRTUAL_THRESHOLD && hasChildren(table) && keyed;
|
|
452
|
+
/* The leading cell is each row's host (components/RowHost.tsx): drawn when
|
|
453
|
+
the grid has an expander to put there, or when a presentation around
|
|
454
|
+
the grid has asked to decorate its rows. */
|
|
455
|
+
const slotted = expandable || Boolean(outerHosts);
|
|
456
|
+
const shift = slotted ? 1 : 0;
|
|
457
|
+
const trailing = Boolean(trailHosts) && keyed;
|
|
458
|
+
const language = interactive && Boolean(table);
|
|
459
|
+
const [availableWidth, setAvailableWidth] = useState(0);
|
|
460
|
+
const [headChar, setHeadChar] = useState(GRID_HEAD_CHAR);
|
|
461
|
+
/* How a head sets its label (font, case, tracking), so a column is sized by the label as drawn and not by a
|
|
462
|
+
count of its characters: seven pixels a character kept "Listed online" 125px wide at 1280, and the table
|
|
463
|
+
that did not fit cut the last column off. */
|
|
464
|
+
const [headFace, setHeadFace] = useState(null);
|
|
465
|
+
/* The fonts the first row's cells set in, one per cell, so a column is sized
|
|
466
|
+
by what its words measure there rather than a count of their characters
|
|
467
|
+
(gridSizing.ts). Per cell: a look sets the first column heavier, and
|
|
468
|
+
measured in the others' weight its names ran past the width they got. */
|
|
469
|
+
const [cellFonts, setCellFonts] = useState([]);
|
|
470
|
+
/* What a tone chip in the first row draws beyond its words, per cell (its dot, gap, padding): a look that says a
|
|
471
|
+
status as a pill spends 41px there, one that says it as a dot and a word 12, and sizing every column for the
|
|
472
|
+
wider kept 30px of every table's room in a status that never used it. -1: the cell holds no chip. */
|
|
473
|
+
const [cellChips, setCellChips] = useState([]);
|
|
474
|
+
useLayoutEffect(() => {
|
|
475
|
+
if (sizing !== 'fit' || !wrap.current)
|
|
476
|
+
return;
|
|
477
|
+
const element = wrap.current;
|
|
478
|
+
/* The look says how wide its heads' characters set (gridSizing.ts); read
|
|
479
|
+
again when the reader picks another look, which moves no width. */
|
|
480
|
+
const measure = (contentWidth) => {
|
|
481
|
+
const style = getComputedStyle(element);
|
|
482
|
+
/* clientWidth rounds up fractional layout widths. At density zoom that
|
|
483
|
+
can create a one-screen-pixel scroll range even when scrollWidth and
|
|
484
|
+
clientWidth agree. Preserve the fraction until fitGridColumns floors
|
|
485
|
+
it; neither clip real overflow nor subtract space from column minima. */
|
|
486
|
+
const inset = style.boxSizing === 'border-box'
|
|
487
|
+
? [style.paddingLeft, style.paddingRight, style.borderLeftWidth, style.borderRightWidth].reduce((sum, value) => sum + (parseFloat(value) || 0), 0)
|
|
488
|
+
: 0;
|
|
489
|
+
setAvailableWidth(contentWidth ?? Math.max(0, parseFloat(style.width) - inset));
|
|
490
|
+
setHeadChar(parseFloat(style.getPropertyValue('--grid-head-char')) || GRID_HEAD_CHAR);
|
|
491
|
+
const label = element.querySelector('thead th .th-sort');
|
|
492
|
+
if (label) {
|
|
493
|
+
const face = getComputedStyle(label);
|
|
494
|
+
const next = {
|
|
495
|
+
font: `${face.fontStyle} ${face.fontWeight} ${face.fontSize} ${face.fontFamily}`,
|
|
496
|
+
upper: face.textTransform === 'uppercase',
|
|
497
|
+
tracking: parseFloat(face.letterSpacing) || 0,
|
|
498
|
+
};
|
|
499
|
+
setHeadFace((was) => (was && was.font === next.font && was.upper === next.upper && was.tracking === next.tracking ? was : next));
|
|
500
|
+
}
|
|
501
|
+
const cells = [...element.querySelectorAll('tbody tr:first-child > td')];
|
|
502
|
+
if (cells.length) {
|
|
503
|
+
const fonts = cells.map((cell) => {
|
|
504
|
+
const font = getComputedStyle(cell);
|
|
505
|
+
return `${font.fontStyle} ${font.fontWeight} ${font.fontSize} ${font.fontFamily}`;
|
|
506
|
+
});
|
|
507
|
+
setCellFonts((was) => (was.join('|') === fonts.join('|') ? was : fonts));
|
|
508
|
+
/* The widest chip of the sampled rows, not the first row's: a look may draw a neutral state as a bare word
|
|
509
|
+
and the rest as pills, and sized by a first-row "Ready" Sage cut every "In review" pill to "In rev…". */
|
|
510
|
+
const rows = [...element.querySelectorAll('tbody tr')].slice(0, GRID_SIZE_SAMPLE);
|
|
511
|
+
const chips = cells.map((_, index) => {
|
|
512
|
+
let extra = -1;
|
|
513
|
+
for (const row of rows) {
|
|
514
|
+
const chip = row.children[index]?.querySelector('.tone:not(.tone-figure)');
|
|
515
|
+
const words = chip?.textContent?.trim();
|
|
516
|
+
const said = words ? textMeasure(fonts[index])?.(words) : undefined;
|
|
517
|
+
if (chip && said !== undefined)
|
|
518
|
+
extra = Math.max(extra, Math.ceil(chip.offsetWidth - said));
|
|
519
|
+
}
|
|
520
|
+
return extra;
|
|
521
|
+
});
|
|
522
|
+
/* A row with no chip in the cell (a sort moved the empty ones to the top) keeps what was known: the
|
|
523
|
+
columns must not move because of which row happens to be first. */
|
|
524
|
+
setCellChips((was) => {
|
|
525
|
+
const next = chips.map((extra, index) => (extra >= 0 ? extra : (was[index] ?? -1)));
|
|
526
|
+
return was.join('|') === next.join('|') ? was : next;
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
measure();
|
|
531
|
+
const observer = new ResizeObserver((entries) => measure(entries[0]?.contentRect.width));
|
|
532
|
+
observer.observe(element);
|
|
533
|
+
const themeChanged = () => measure();
|
|
534
|
+
addHostListener(window, VISUAL_THEME_EVENT, themeChanged);
|
|
535
|
+
return () => {
|
|
536
|
+
observer.disconnect();
|
|
537
|
+
removeHostListener(window, VISUAL_THEME_EVENT, themeChanged);
|
|
538
|
+
};
|
|
539
|
+
}, [sizing]);
|
|
540
|
+
/* The column that names the row — the table's label where it is drawn,
|
|
541
|
+
else the first text — is read whole before the others (gridSizing.ts). */
|
|
542
|
+
const titleName = useMemo(() => {
|
|
543
|
+
const naming = table ? namingColumn(table) : undefined;
|
|
544
|
+
return naming && asked.includes(naming)
|
|
545
|
+
? naming
|
|
546
|
+
: asked.find((name) => plans.get(name)?.kind === 'text' || Boolean(referenceLabels?.[name]));
|
|
547
|
+
}, [table, asked, plans, referenceLabels]);
|
|
548
|
+
const sizeHints = useMemo(() => asked.map((name) => {
|
|
549
|
+
const plan = plans.get(name);
|
|
550
|
+
const labelColumn = referenceLabels?.[name];
|
|
551
|
+
const display = datesAmong(columnDisplay(table?.id, name), rows.map((row) => row[name]));
|
|
552
|
+
const label = String(labels?.[name] ?? columnLabel(table?.id, name) ?? name);
|
|
553
|
+
const headText = byName.get(name)?.primaryKey && !shell().inApp() ? `${label} ${say('common.key')}` : label;
|
|
554
|
+
const headMeasure = headFace ? textMeasure(headFace.font) : undefined;
|
|
555
|
+
const headSet = (text) => headMeasure(headFace.upper ? text.toUpperCase() : text) + headFace.tracking * text.length;
|
|
556
|
+
return {
|
|
557
|
+
headWidth: headMeasure ? headSet(headText) : undefined,
|
|
558
|
+
/* An App's head wraps to two lines before it widens its column (style.css, .th-label). */
|
|
559
|
+
wrapHead: shell().inApp(),
|
|
560
|
+
/* An App's words may wrap too, once its heads have and the room is still short: kept whole on two lines. */
|
|
561
|
+
wrapValues: shell().inApp() && (Boolean(labelColumn) || plan.kind === 'text') && !display?.component,
|
|
562
|
+
headWrap: headMeasure && shell().inApp() ? twoLineWidth(headText, headSet) : undefined,
|
|
563
|
+
/* The head's key badge is words too, where it is drawn (an App hides it, features.css): once a
|
|
564
|
+
number was sized by its figures, the Workbench's "id KEY ↓" lost its "id" under the badge. */
|
|
565
|
+
label: byName.get(name)?.primaryKey && !shell().inApp() ? `${label} ${say('common.key')}` : label,
|
|
566
|
+
title: name === titleName,
|
|
567
|
+
avatar: Boolean(display?.avatar),
|
|
568
|
+
chipExtra: (cellChips[asked.indexOf(name) + shift] ?? -1) >= 0 ? cellChips[asked.indexOf(name) + shift] : undefined,
|
|
569
|
+
kind: labelColumn ? 'text' : plan.kind,
|
|
570
|
+
controls: language || Boolean(byName.get(name)?.primaryKey || byName.get(name)?.references),
|
|
571
|
+
/* A reference's arrow stands beside its label in the sort (the head, below), after the sort's 4px gap:
|
|
572
|
+
uncounted, it took the room past the label that the resizer's strip is (style.css). */
|
|
573
|
+
mark: byName.get(name)?.references ? 4 + (headMeasure ? headSet(REFERENCE_MARK) : GRID_HEAD_CHAR) : undefined,
|
|
574
|
+
showTime: plan.showTime,
|
|
575
|
+
values: rows.slice(0, GRID_SIZE_SAMPLE).map((row) => {
|
|
576
|
+
if (labelColumn && row[labelColumn] != null)
|
|
577
|
+
return row[labelColumn];
|
|
578
|
+
/* A tags cell keeps at least its first chip whole, and the count beside it (TagsCellList). */
|
|
579
|
+
if (byName.get(name)?.type === TAGS_TYPE) {
|
|
580
|
+
const chips = tagChips(row[name]);
|
|
581
|
+
return chips.length
|
|
582
|
+
? `${chips[0].label}${chips.length > 1 ? ` ${say('moreTags', { count: chips.length - 1 })}` : ''}`
|
|
583
|
+
: null;
|
|
584
|
+
}
|
|
585
|
+
const json = jsonValueOf(byName.get(name), row[name]);
|
|
586
|
+
if (json)
|
|
587
|
+
return previewOf(json.value);
|
|
588
|
+
// Sized by what is drawn: a tone chip draws its label, a bare number its formatted figures.
|
|
589
|
+
return drawnWords(display, plan, row[name]);
|
|
590
|
+
}),
|
|
591
|
+
subValues: display?.subtitle ? rows.slice(0, GRID_SIZE_SAMPLE).map((row) => subtitleOf(name, row)) : undefined,
|
|
592
|
+
chip: byName.get(name)?.type === TAGS_TYPE ||
|
|
593
|
+
(!labelColumn &&
|
|
594
|
+
rows.slice(0, GRID_SIZE_SAMPLE).some((row) => {
|
|
595
|
+
const dress = dressFor(display, row[name]);
|
|
596
|
+
return dress?.kind === 'tone' && !dress.figure;
|
|
597
|
+
})),
|
|
598
|
+
/* A number with no rule is sized by the figures its cell draws ("1,249.50"), measured as they
|
|
599
|
+
are; an App's own renderer draws something the words do not measure. */
|
|
600
|
+
dressed: !labelColumn &&
|
|
601
|
+
!display?.component &&
|
|
602
|
+
rows.slice(0, GRID_SIZE_SAMPLE).every((row) => {
|
|
603
|
+
if (row[name] == null)
|
|
604
|
+
return true;
|
|
605
|
+
const dress = dressFor(display, row[name]);
|
|
606
|
+
return dress ? drawsWords(dress) : plan.kind === 'number' && numberShown(row[name], plan) != null;
|
|
607
|
+
}),
|
|
608
|
+
status: !labelColumn &&
|
|
609
|
+
plan.kind !== 'number' &&
|
|
610
|
+
(Boolean(display?.tone && !display.format && !display.bar) ||
|
|
611
|
+
(Boolean(byName.get(name)?.allowed?.length) && STATUS_NAME.test(name))),
|
|
612
|
+
};
|
|
613
|
+
}), [asked, plans, referenceLabels, table?.id, labels, language, captionLanguage, byName, rows, titleName, headFace, cellChips, shift]);
|
|
614
|
+
/* Column i's cell follows the expander's when there is one. */
|
|
615
|
+
const measureText = useMemo(() => cellFonts.length
|
|
616
|
+
? (text, column) => textMeasure(cellFonts[Math.min(column + (slotted ? 1 : 0), cellFonts.length - 1)])?.(text) ?? text.length * 8
|
|
617
|
+
: undefined, [cellFonts, slotted]);
|
|
618
|
+
/* An App's own list folds the columns its room cannot hold under the row's name, as a detail line, once its heads
|
|
619
|
+
and words have wrapped (gridSizing.ts): they are moved, not lost, and the list does not scroll sideways. An
|
|
620
|
+
embedded grid leaves them out, as it did. */
|
|
621
|
+
const folds = !dropColumns && sizing === 'fit' && shell().inApp();
|
|
622
|
+
const kept = useMemo(() => (dropColumns || folds) && sizing === 'fit' ? keepFitting(sizeHints, availableWidth, slotted, trailing, headChar, measureText) : null, [dropColumns, folds, sizing, sizeHints, availableWidth, slotted, trailing, headChar, measureText]);
|
|
623
|
+
const drawn = useMemo(() => (kept ? asked.filter((_, index) => kept[index]) : asked), [asked, kept]);
|
|
624
|
+
const drawnHints = useMemo(() => (kept ? sizeHints.filter((_, index) => kept[index]) : sizeHints), [sizeHints, kept]);
|
|
625
|
+
/* The reader's arrangement, over the drawn columns (gridArrange.ts): an
|
|
626
|
+
order the reader put the columns in, and widths they dragged them to.
|
|
627
|
+
Both live only in this grid — a refetch never moves a placed column —
|
|
628
|
+
and both are dropped for columns no longer drawn. */
|
|
629
|
+
const [columnOrder, setColumnOrder] = useState(null);
|
|
630
|
+
const [columnWidths, setColumnWidths] = useState({});
|
|
631
|
+
const ordered = useMemo(() => applyColumnOrder(drawn, columnOrder), [drawn, columnOrder]);
|
|
632
|
+
const orderedHints = useMemo(() => ordered.map((name) => drawnHints[drawn.indexOf(name)]), [ordered, drawn, drawnHints]);
|
|
633
|
+
const fit = useMemo(() => fitGridColumns(orderedHints, availableWidth, slotted, trailing, headChar, measureText, dropColumns), [orderedHints, availableWidth, slotted, trailing, headChar, measureText, dropColumns]);
|
|
634
|
+
/* A dragged width stands in place of its fitted one. A scrolled grid has
|
|
635
|
+
no colgroup until a width is dragged: then it takes one, and the fixed
|
|
636
|
+
layout that makes a dragged width hold, with the fitted widths for the
|
|
637
|
+
columns untouched — a grid that was never arranged draws exactly as it
|
|
638
|
+
did. */
|
|
639
|
+
const hasWidthOverrides = Object.keys(columnWidths).length > 0;
|
|
640
|
+
const colWidths = useMemo(() => (hasWidthOverrides ? applyColumnWidths(fit.columns, ordered, columnWidths) : fit.columns), [hasWidthOverrides, fit.columns, ordered, columnWidths]);
|
|
641
|
+
const useColgroup = sizing === 'fit' || hasWidthOverrides;
|
|
642
|
+
const tableWidth = hasWidthOverrides
|
|
643
|
+
? colWidths.reduce((sum, width) => sum + width, 0) + (slotted ? GRID_EXPANDER_WIDTH : 0) + (trailing ? GRID_TRAIL_WIDTH : 0)
|
|
644
|
+
: fit.width;
|
|
645
|
+
const moveColumnBy = useCallback((name, direction) => setColumnOrder((current) => moveColumn(applyColumnOrder(drawn, current), name, direction)), [drawn]);
|
|
646
|
+
const setColumnWidth = useCallback((name, width) => setColumnWidths((current) => {
|
|
647
|
+
const next = clampColumnWidth(width);
|
|
648
|
+
return current[name] === next ? current : { ...current, [name]: next };
|
|
649
|
+
}), []);
|
|
650
|
+
const resetColumnWidth = useCallback((name) => setColumnWidths((current) => {
|
|
651
|
+
if (!(name in current))
|
|
652
|
+
return current;
|
|
653
|
+
const next = { ...current };
|
|
654
|
+
delete next[name];
|
|
655
|
+
return next;
|
|
656
|
+
}), []);
|
|
657
|
+
/* The widths a scrolled grid's columns are drawn at now. A scrolled grid is laid out by its content and holds no
|
|
658
|
+
width of its own, so the first one dragged would otherwise switch it to a fixed layout with every other column
|
|
659
|
+
at its estimated minimum, and the dragged one would start from the estimate rather than from what the reader
|
|
660
|
+
grabbed. The heads are measured instead, and the whole row becomes the first arrangement: the switch moves
|
|
661
|
+
nothing but the column being dragged. A head not laid out yet (no width) is left to its fitted width. */
|
|
662
|
+
const measureDrawn = useCallback((from) => {
|
|
663
|
+
const measured = {};
|
|
664
|
+
for (const th of from.closest('table')?.querySelectorAll('thead th[data-col]') ?? []) {
|
|
665
|
+
const width = th.getBoundingClientRect().width / viewportScale();
|
|
666
|
+
if (width > 0)
|
|
667
|
+
measured[th.dataset.col] = clampColumnWidth(width);
|
|
668
|
+
}
|
|
669
|
+
return measured;
|
|
670
|
+
}, []);
|
|
671
|
+
/* One resizer drag at a time: where it started, the width it started
|
|
672
|
+
from, and the override it started over, so a cancelled drag puts
|
|
673
|
+
back exactly what was there — including no override at all. `seed` is
|
|
674
|
+
the measured row of a scrolled grid not yet arranged, spent by the
|
|
675
|
+
first move (a press that never moves arranges nothing). */
|
|
676
|
+
const resizeDrag = useRef(null);
|
|
677
|
+
const columns = useMemo(() => helper.columns(ordered.map((name) => helper.accessor((row) => row[name], { id: name, header: name }))), [ordered]);
|
|
678
|
+
const model = useTable({ features, columns, data: rows });
|
|
679
|
+
const modelRows = model.getRowModel().rows;
|
|
680
|
+
/* In an App list the header's ⌄ is the App's short menu (AppColumnMenu.tsx), and the list's pins are its own. */
|
|
681
|
+
const appMenu = useAppColumnMenu();
|
|
682
|
+
const pinList = appMenu?.current?.listKey;
|
|
683
|
+
const pinChange = useSyncExternalStore(subscribePins, pinsVersion);
|
|
684
|
+
const pinned = useMemo(() => (interactive ? pinnedFor(table, ordered, pinList) : []), [interactive, table, ordered, pinList, pinChange]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
685
|
+
/* A pinned column keeps the block at the left that its sticky offsets are measured over (usePins.ts), so a
|
|
686
|
+
column steps only among its own kind: a move across the boundary would leave a scrolling column between two
|
|
687
|
+
frozen ones. The buttons and Alt+arrows both ask. */
|
|
688
|
+
const canMove = (name, direction) => {
|
|
689
|
+
const next = ordered[ordered.indexOf(name) + (direction === 'left' ? -1 : 1)];
|
|
690
|
+
return next !== undefined && pinned.includes(next) === pinned.includes(name);
|
|
691
|
+
};
|
|
692
|
+
const stepColumn = (name, direction) => {
|
|
693
|
+
if (canMove(name, direction))
|
|
694
|
+
moveColumnBy(name, direction);
|
|
695
|
+
};
|
|
696
|
+
const navigable = Boolean(onRowClick) || keyed;
|
|
697
|
+
const query = currentEntry()?.query ?? '';
|
|
698
|
+
/* The records on this page, and the list they are a page of when the room
|
|
699
|
+
hands one (TableView): a record opened from this grid steps through the
|
|
700
|
+
list past this page too (recordTrail.ts). An embedded grid hands its
|
|
701
|
+
rows only. */
|
|
702
|
+
const records = useMemo(() => rows.flatMap((item) => {
|
|
703
|
+
const itemKey = table && keyOf(table, item);
|
|
704
|
+
return itemKey ? [{ key: itemKey, label: rowLabel(table, item) }] : [];
|
|
705
|
+
}), [table, rows]);
|
|
706
|
+
/* The record the reader is on beside this list — a split's detail — is
|
|
707
|
+
marked, and brought into view as J and K step it along. */
|
|
708
|
+
const currentKey = current && table ? rowKeyString(table, current) : null;
|
|
709
|
+
useLayoutEffect(() => {
|
|
710
|
+
if (currentKey === null)
|
|
711
|
+
return;
|
|
712
|
+
const rowNodes = tableRef.current?.querySelectorAll('tbody tr[data-row-key]') ?? [];
|
|
713
|
+
[...rowNodes].find((node) => node.dataset.rowKey === currentKey)?.scrollIntoView?.({ block: 'nearest' });
|
|
714
|
+
}, [currentKey]);
|
|
715
|
+
const opens = useRowOpens();
|
|
716
|
+
const openRow = useCallback((row) => {
|
|
717
|
+
if (onRowClick) {
|
|
718
|
+
onRowClick(row);
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
/* A row that opens what it is about opens that, with no neighbors to step to: they are rows of this list. */
|
|
722
|
+
if (opens && table) {
|
|
723
|
+
const target = rowOpensTarget(table, row, opens);
|
|
724
|
+
if (target)
|
|
725
|
+
void openRecord(target.table, target.key, target.label, 'push');
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
const key = table && keyOf(table, row);
|
|
729
|
+
if (!key)
|
|
730
|
+
return;
|
|
731
|
+
void openRecord(table.id, key, rowLabel(table, row), 'push', {
|
|
732
|
+
records,
|
|
733
|
+
list,
|
|
734
|
+
});
|
|
735
|
+
}, [onRowClick, opens, table, records, list]);
|
|
736
|
+
/* Space glances at the row's record without leaving the list (peekpanel.js), its neighbors a J or K away. */
|
|
737
|
+
const peekRow = useCallback((row) => {
|
|
738
|
+
if (opens && table) {
|
|
739
|
+
const target = rowOpensTarget(table, row, opens);
|
|
740
|
+
if (target)
|
|
741
|
+
peekRecord(target.table, target.key, target.label);
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
const key = table && keyOf(table, row);
|
|
745
|
+
if (key)
|
|
746
|
+
peekRecord(table.id, key, rowLabel(table, row), records, list);
|
|
747
|
+
}, [opens, table, records, list]);
|
|
748
|
+
/* ---------- expansion ---------- */
|
|
749
|
+
const [expanded, setExpanded] = useState(() => new Set());
|
|
750
|
+
const [expandingAll, setExpandingAll] = useState(false);
|
|
751
|
+
/* An open row stays open for as long as it is in the result. A sort or a
|
|
752
|
+
page re-asks in place (core.js `refine`) and a refetch moves rows by key,
|
|
753
|
+
so a row still on screen keeps its detail; one that left is forgotten,
|
|
754
|
+
and coming back to it is coming back to a closed row. */
|
|
755
|
+
useEffect(() => {
|
|
756
|
+
setExpanded((s) => {
|
|
757
|
+
const kept = new Set(openable.filter((key) => s.has(key)));
|
|
758
|
+
return kept.size === s.size ? s : kept;
|
|
759
|
+
});
|
|
760
|
+
}, [openable]);
|
|
761
|
+
const toggle = (key) => setExpanded((s) => {
|
|
762
|
+
const n = new Set(s);
|
|
763
|
+
if (n.has(key))
|
|
764
|
+
n.delete(key);
|
|
765
|
+
else
|
|
766
|
+
n.add(key);
|
|
767
|
+
return n;
|
|
768
|
+
});
|
|
769
|
+
const anyClosed = openable.some((key) => !expanded.has(key));
|
|
770
|
+
const expandAll = async () => {
|
|
771
|
+
if (expandingAll)
|
|
772
|
+
return;
|
|
773
|
+
if (!anyClosed) {
|
|
774
|
+
setExpanded(new Set());
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
/* A few at a time — the top of the table fills in immediately, the
|
|
778
|
+
rest follows, and the database is never asked for everything at once. */
|
|
779
|
+
setExpandingAll(true);
|
|
780
|
+
try {
|
|
781
|
+
for (let i = 0; i < openable.length; i += BATCH) {
|
|
782
|
+
const batch = openable.slice(i, i + BATCH);
|
|
783
|
+
setExpanded((s) => new Set([...s, ...batch]));
|
|
784
|
+
if (i + BATCH < openable.length)
|
|
785
|
+
await new Promise((r) => setTimeout(r, BREATH_MS));
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
finally {
|
|
789
|
+
setExpandingAll(false);
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
/* ---------- windowing ---------- */
|
|
793
|
+
const [scroller, setScroller] = useState(null);
|
|
794
|
+
const [rowHeight, setRowHeight] = useState(26);
|
|
795
|
+
const [margin, setMargin] = useState(0);
|
|
796
|
+
useLayoutEffect(() => {
|
|
797
|
+
if (!virtual || !wrap.current)
|
|
798
|
+
return;
|
|
799
|
+
setScroller(wrap.current.closest('.content') ?? document.scrollingElement);
|
|
800
|
+
}, [virtual]);
|
|
801
|
+
const virtualizer = useVirtualizer({
|
|
802
|
+
count: virtual ? rows.length : 0,
|
|
803
|
+
getScrollElement: () => scroller,
|
|
804
|
+
estimateSize: () => rowHeight,
|
|
805
|
+
overscan: OVERSCAN,
|
|
806
|
+
scrollMargin: margin,
|
|
807
|
+
enabled: virtual && Boolean(scroller),
|
|
808
|
+
});
|
|
809
|
+
const items = virtualizer.getVirtualItems();
|
|
810
|
+
/* Measured from a rendered row rather than assumed: row height depends on
|
|
811
|
+
font, zoom and content, and a wrong guess is wrong by a pixel per row —
|
|
812
|
+
a scrollbar disagreeing with its content by a screenful. Sampled after
|
|
813
|
+
each paint and corrected once the disagreement is real. */
|
|
814
|
+
useLayoutEffect(() => {
|
|
815
|
+
if (!virtual || !tableRef.current || !scroller)
|
|
816
|
+
return;
|
|
817
|
+
const sample = tableRef.current.querySelector('tbody tr[data-row]');
|
|
818
|
+
const actual = sample ? viewportBox(sample).height : 0;
|
|
819
|
+
if (actual && Math.abs(actual - rowHeight) >= 0.5)
|
|
820
|
+
setRowHeight(actual);
|
|
821
|
+
const top = tableRef.current.offsetTop;
|
|
822
|
+
if (top !== margin)
|
|
823
|
+
setMargin(top);
|
|
824
|
+
});
|
|
825
|
+
useEffect(() => {
|
|
826
|
+
if (virtual)
|
|
827
|
+
virtualizer.measure();
|
|
828
|
+
}, [rowHeight, virtual]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
829
|
+
const shown = virtual ? items.map((it) => it.index) : rows.map((_, i) => i);
|
|
830
|
+
const padTop = virtual && items.length ? items[0].start - margin : 0;
|
|
831
|
+
const padBottom = virtual && items.length ? Math.max(0, rows.length - items[items.length - 1].index - 1) * rowHeight : 0;
|
|
832
|
+
/* ---------- pins and the keyboard ---------- */
|
|
833
|
+
const lefts = usePins(wrap, ordered, pinned, shift, `${shown.join(',')}:${sizing}:${fit.columns.join(',')}`);
|
|
834
|
+
useStickyHead(wrap, `${ordered.join(',')}:${sizing}:${rows.length > 0}`);
|
|
835
|
+
const lastPinned = pinned.length ? ordered.filter((n) => pinned.includes(n)).pop() : undefined;
|
|
836
|
+
/* Read on every paint, as the cells always read them — an App's display
|
|
837
|
+
rules can change under the grid — and kept while they are equal. */
|
|
838
|
+
const folded = folds && kept ? asked.filter((_, index) => !kept[index]) : [];
|
|
839
|
+
/* Under the row's name, unless that column is a short key ("AC-105"): a line folded into it wraps word by word and
|
|
840
|
+
reads as part of the key. Then the widest column of plain words (not a state's chip), else the name after all. */
|
|
841
|
+
const foldsInto = (() => {
|
|
842
|
+
if (!folded.length)
|
|
843
|
+
return undefined;
|
|
844
|
+
const named = titleName && ordered.includes(titleName) ? titleName : ordered[0];
|
|
845
|
+
const width = (name) => fit.columns[ordered.indexOf(name)] ?? 0;
|
|
846
|
+
if (width(named) >= FOLD_ROOM)
|
|
847
|
+
return named;
|
|
848
|
+
const words = ordered.filter((name) => (plans.get(name)?.kind === 'text' || Boolean(referenceLabels?.[name])) &&
|
|
849
|
+
!columnDisplay(table?.id, name)?.tone);
|
|
850
|
+
return words.reduce((best, name) => (width(name) > width(best) ? name : best), named);
|
|
851
|
+
})();
|
|
852
|
+
const cellColumns = useKeptColumns(ordered.map((name) => {
|
|
853
|
+
/* A column of relative dates is said one way down its length (datesAmong). */
|
|
854
|
+
const display = datesAmong(columnDisplay(table?.id, name), rows.map((row) => row[name]));
|
|
855
|
+
return {
|
|
856
|
+
name,
|
|
857
|
+
meta: byName.get(name),
|
|
858
|
+
plan: plans.get(name),
|
|
859
|
+
display,
|
|
860
|
+
label: referenceLabels?.[name],
|
|
861
|
+
subtitle: subtitlePath(display, name),
|
|
862
|
+
...(currencyPath(display, name) ? { currency: currencyPath(display, name) } : {}),
|
|
863
|
+
...(leadTonePath(display, name)
|
|
864
|
+
? {
|
|
865
|
+
leadTone: {
|
|
866
|
+
path: leadTonePath(display, name),
|
|
867
|
+
rule: columnDisplay(table?.id, leadTonePath(display, name)),
|
|
868
|
+
},
|
|
869
|
+
}
|
|
870
|
+
: {}),
|
|
871
|
+
photoOwner: avatarOwner(table, name, display, data.columns),
|
|
872
|
+
pin: lefts.get(name),
|
|
873
|
+
edge: name === lastPinned,
|
|
874
|
+
...(fit.wraps[ordered.indexOf(name)] ? { wraps: true } : {}),
|
|
875
|
+
...(name === foldsInto
|
|
876
|
+
? {
|
|
877
|
+
more: folded.map((other) => ({
|
|
878
|
+
name: other,
|
|
879
|
+
head: String(labels?.[other] ?? columnLabel(table?.id, other) ?? other),
|
|
880
|
+
meta: byName.get(other),
|
|
881
|
+
plan: plans.get(other),
|
|
882
|
+
display: datesAmong(columnDisplay(table?.id, other), rows.map((row) => row[other])),
|
|
883
|
+
label: referenceLabels?.[other],
|
|
884
|
+
})),
|
|
885
|
+
}
|
|
886
|
+
: {}),
|
|
887
|
+
...(table?.keyLabel && table.labelTemplate && byName.get(name)?.primaryKey ? { named: table.labelTemplate } : {}),
|
|
888
|
+
};
|
|
889
|
+
}));
|
|
890
|
+
const photoColumns = useMemo(() => cellColumns.filter((column) => column.photoOwner), [cellColumns]);
|
|
891
|
+
/* One callback for every row and every paint: the one it calls is read
|
|
892
|
+
when a row is opened, so a caller's fresh onRowClick redraws nothing. */
|
|
893
|
+
const opener = useRef(openRow);
|
|
894
|
+
opener.current = openRow;
|
|
895
|
+
const openOne = useCallback((row) => opener.current(row), []);
|
|
896
|
+
useGridKeyboard(tableRef, wrap, {
|
|
897
|
+
rowCount: rows.length,
|
|
898
|
+
columnCount: ordered.length,
|
|
899
|
+
offset: shift,
|
|
900
|
+
onOpen: navigable ? (index) => openRow(rows[index]) : undefined,
|
|
901
|
+
onPeek: keyed ? (index) => peekRow(rows[index]) : undefined,
|
|
902
|
+
totalRows: data.exactTotal === false || data.cappedTotal ? undefined : data.total,
|
|
903
|
+
firstRow,
|
|
904
|
+
});
|
|
905
|
+
/* Whatever the column clipped gets its whole value on hover, decided at hover time, once, from its own overflow:
|
|
906
|
+
the cell, or the line inside it that cuts its own text (a row's name over its detail, a lead mark's body, a
|
|
907
|
+
component's text), which the cell never sees overflow. A long summary ended in "…" with no way to read it (G210). */
|
|
908
|
+
const onMouseOver = (e) => {
|
|
909
|
+
if (!(e.target instanceof Element))
|
|
910
|
+
return;
|
|
911
|
+
const td = e.target.closest('td');
|
|
912
|
+
if (!td)
|
|
913
|
+
return;
|
|
914
|
+
for (let at = e.target; at; at = at === td ? null : at.parentElement) {
|
|
915
|
+
if (at instanceof HTMLElement && at.title)
|
|
916
|
+
return;
|
|
917
|
+
if (at.scrollWidth > at.clientWidth) {
|
|
918
|
+
at.title = at.textContent ?? '';
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
if (!rows.length && !(emptyText && data.columns?.length)) {
|
|
924
|
+
/* "No rows match" claims a filter did it. On `customer` with no
|
|
925
|
+
conditions, nothing was excluded — the table is empty, which is a
|
|
926
|
+
different thing to be told. */
|
|
927
|
+
const entry = currentEntry();
|
|
928
|
+
const filtered = !entry || entry.kind !== 'table' || entry.query.trim() !== entry.table || Boolean(data.errors?.length);
|
|
929
|
+
return (_jsx("div", { className: `table-wrap${compact ? ' grid-compact' : ''}`, ref: wrap, children: _jsx("p", { className: "note", children: filtered ? say('noRowsMatch') : say('thisTableIsEmpty') }) }));
|
|
930
|
+
}
|
|
931
|
+
const inApp = shell().inApp();
|
|
932
|
+
const header = (name, index) => {
|
|
933
|
+
const meta = byName.get(name);
|
|
934
|
+
const plan = plans.get(name);
|
|
935
|
+
const headLabel = labels?.[name] ?? columnLabel(table?.id, name) ?? name;
|
|
936
|
+
/* The width this head's column is actually drawn at: its fitted width
|
|
937
|
+
in a fitted grid, its dragged width in a scrolled one once it has
|
|
938
|
+
one — a scrolled column with no dragged width is drawn by its
|
|
939
|
+
content, so it has no width to say. */
|
|
940
|
+
const appliedWidth = sizing === 'fit' ? colWidths[index] : columnWidths[name];
|
|
941
|
+
/* Sorting from the header is offered only on columns the database can
|
|
942
|
+
sort cheaply: indexed, or small enough that it does not matter. Over an
|
|
943
|
+
API, only on the columns its documented sort values name (`sortable`). */
|
|
944
|
+
const sortable = table
|
|
945
|
+
? table.sortable
|
|
946
|
+
? table.sortable.includes(name)
|
|
947
|
+
: !table.indexed || table.indexed.includes(name) || sortableFromHeader(table)
|
|
948
|
+
: false;
|
|
949
|
+
const explicit = language ? sortDirection(query, name) : null;
|
|
950
|
+
const implied = !explicit && data.order?.implicit ? (data.order.order.find((o) => o.column === name)?.direction ?? null) : null;
|
|
951
|
+
const sorted = explicit ?? implied;
|
|
952
|
+
const pin = lefts.get(name);
|
|
953
|
+
return (_jsxs("th", { scope: "col", className: `align-${plan.align}${explicit ? ' sorted' : ''}${implied ? ' sorted-default' : ''}${pin !== undefined ? ` pinned${name === lastPinned ? ' pinned-edge' : ''}` : ''}`, style: pin !== undefined ? { left: `${pin}px` } : undefined, "data-col": name,
|
|
954
|
+
/* Alt+arrows move the column, as they move a field in the
|
|
955
|
+
arranger (FieldArranger.tsx): the head already owns its click
|
|
956
|
+
for sorting, so a drag would fight it, and a drag's drop target
|
|
957
|
+
is geometry a test cannot see. */
|
|
958
|
+
onKeyDown: (e) => {
|
|
959
|
+
if (!interactive || !e.altKey || (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight'))
|
|
960
|
+
return;
|
|
961
|
+
e.preventDefault();
|
|
962
|
+
stepColumn(name, e.key === 'ArrowLeft' ? 'left' : 'right');
|
|
963
|
+
}, "aria-sort": explicit ? (explicit === 'desc' ? 'descending' : 'ascending') : undefined, title: implied
|
|
964
|
+
? `${meta ? `${meta.type} · ` : ''}${say('defaultOrderRowsHaveToCome')}`
|
|
965
|
+
: meta?.type
|
|
966
|
+
? `${meta.type}${meta.nullable ? '' : ' NOT NULL'}`
|
|
967
|
+
: name, children: [_jsxs("span", { className: "th-controls", children: [_jsxs("button", { type: "button", className: `th-sort${language && !sortable ? ' not-sortable' : ''}`, "aria-disabled": !language || !sortable,
|
|
968
|
+
/* An App has no statement to edit and no query bar to type into: its words say what is so. */
|
|
969
|
+
title: !language
|
|
970
|
+
? say(inApp ? 'notSortableHere' : 'sortingAResultLike', {
|
|
971
|
+
name,
|
|
972
|
+
})
|
|
973
|
+
: sortable
|
|
974
|
+
? say('sortBy', { name })
|
|
975
|
+
: table?.sortable
|
|
976
|
+
? say('theApiDocumentsNoSort', { name })
|
|
977
|
+
: say(inApp ? 'isNotIndexedSortingInApp' : 'isNotIndexedSorting', { name }), onClick: (e) => {
|
|
978
|
+
if (!language || !sortable)
|
|
979
|
+
return;
|
|
980
|
+
if (e.shiftKey)
|
|
981
|
+
sortBy(name, sortDirection(currentEntry()?.query ?? '', name) === 'asc' ? 'desc' : 'asc', true);
|
|
982
|
+
else
|
|
983
|
+
sortBy(name);
|
|
984
|
+
}, children: [_jsx("span", { className: "th-label", children: headLabel }), meta?.primaryKey && _jsx("span", { className: "pk", children: say('common.key') }), meta?.references && _jsx("span", { className: "fk", children: REFERENCE_MARK }), sorted && _jsx("span", { className: "th-arrow", children: sorted === 'desc' ? '↓' : '↑' })] }), interactive && (_jsxs("span", { className: "th-moves", children: [_jsx("button", { type: "button", className: "th-move th-move-left", tabIndex: -1, disabled: !canMove(name, 'left'), title: say('moveColumnLeft', { name: headLabel }), "aria-label": say('moveColumnLeft', { name: headLabel }), onClick: (e) => {
|
|
985
|
+
e.stopPropagation();
|
|
986
|
+
stepColumn(name, 'left');
|
|
987
|
+
} }), _jsx("button", { type: "button", className: "th-move th-move-right", tabIndex: -1, disabled: !canMove(name, 'right'), title: say('moveColumnRight', { name: headLabel }), "aria-label": say('moveColumnRight', { name: headLabel }), onClick: (e) => {
|
|
988
|
+
e.stopPropagation();
|
|
989
|
+
stepColumn(name, 'right');
|
|
990
|
+
} })] })), language && appMenu && (_jsx(AppColumnMenuButton, { host: appMenu, name: name, label: headLabel, kind: plan.kind, meta: meta, sortable: sortable, current: sorted, columns: ordered, drawnBy: referenceLabels?.[name] })), language && !appMenu && (!table?.filterable || table.filterable.includes(name)) && (_jsx("button", { type: "button", className: "th-filter", title: say('filterOn', { name }), "aria-label": say('filterOn', { name }), onClick: (e) => {
|
|
991
|
+
e.stopPropagation();
|
|
992
|
+
openFilterMenu(e.currentTarget, meta, name, rows, plan);
|
|
993
|
+
}, children: _jsx("span", { className: "th-filter-icon", "aria-hidden": "true" }) }))] }), interactive && (_jsx("span", { role: "separator", "aria-orientation": "vertical", "aria-label": say('resizeColumn', { name: headLabel }), title: say('resizeColumnHint', { name: headLabel }), tabIndex: 0, className: "th-resizer", ...(appliedWidth !== undefined ? { 'aria-valuenow': appliedWidth, 'aria-valuemin': MIN_COLUMN_WIDTH } : {}), onPointerDown: (e) => {
|
|
994
|
+
if (e.pointerType === 'mouse' && e.button !== 0)
|
|
995
|
+
return;
|
|
996
|
+
const seed = sizing !== 'fit' && !hasWidthOverrides ? measureDrawn(e.currentTarget) : null;
|
|
997
|
+
resizeDrag.current = {
|
|
998
|
+
name,
|
|
999
|
+
startX: e.clientX,
|
|
1000
|
+
startWidth: seed?.[name] ?? appliedWidth ?? colWidths[index] ?? 0,
|
|
1001
|
+
hadOverride: name in columnWidths,
|
|
1002
|
+
prevWidth: columnWidths[name],
|
|
1003
|
+
seed,
|
|
1004
|
+
seeded: false,
|
|
1005
|
+
};
|
|
1006
|
+
try {
|
|
1007
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
1008
|
+
}
|
|
1009
|
+
catch {
|
|
1010
|
+
/* A renderer without capture still delivers the moves to the handle. */
|
|
1011
|
+
}
|
|
1012
|
+
}, onPointerMove: (e) => {
|
|
1013
|
+
const drag = resizeDrag.current;
|
|
1014
|
+
if (!drag || drag.name !== name)
|
|
1015
|
+
return;
|
|
1016
|
+
/* The pointer speaks screen pixels; the column's width
|
|
1017
|
+
speaks layout pixels (ruler.ts), so the drag is divided
|
|
1018
|
+
by the root's zoom before it becomes a width. */
|
|
1019
|
+
const width = drag.startWidth + (e.clientX - drag.startX) / viewportScale();
|
|
1020
|
+
if (drag.seed) {
|
|
1021
|
+
const seed = drag.seed;
|
|
1022
|
+
drag.seed = null;
|
|
1023
|
+
drag.seeded = true;
|
|
1024
|
+
setColumnWidths({ ...seed, [name]: clampColumnWidth(width) });
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
setColumnWidth(name, width);
|
|
1028
|
+
}, onPointerUp: () => {
|
|
1029
|
+
if (resizeDrag.current?.name === name)
|
|
1030
|
+
resizeDrag.current = null;
|
|
1031
|
+
}, onPointerCancel: () => {
|
|
1032
|
+
const drag = resizeDrag.current;
|
|
1033
|
+
if (drag?.name !== name)
|
|
1034
|
+
return;
|
|
1035
|
+
resizeDrag.current = null;
|
|
1036
|
+
/* A drag that arranged a scrolled grid undoes all of it: the grid goes back to no arrangement. */
|
|
1037
|
+
if (drag.seeded) {
|
|
1038
|
+
setColumnWidths({});
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
setColumnWidths((current) => {
|
|
1042
|
+
const next = { ...current };
|
|
1043
|
+
if (drag.hadOverride && drag.prevWidth !== undefined)
|
|
1044
|
+
next[name] = drag.prevWidth;
|
|
1045
|
+
else
|
|
1046
|
+
delete next[name];
|
|
1047
|
+
return next;
|
|
1048
|
+
});
|
|
1049
|
+
}, onKeyDown: (e) => {
|
|
1050
|
+
if (e.altKey && e.key === 'Backspace') {
|
|
1051
|
+
e.preventDefault();
|
|
1052
|
+
resetColumnWidth(name);
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight')
|
|
1056
|
+
return;
|
|
1057
|
+
e.preventDefault();
|
|
1058
|
+
const seed = sizing !== 'fit' && !hasWidthOverrides ? measureDrawn(e.currentTarget) : null;
|
|
1059
|
+
const current = seed?.[name] ?? appliedWidth ?? colWidths[index] ?? 0;
|
|
1060
|
+
const width = current + (e.key === 'ArrowRight' ? 1 : -1) * columnResizeStep(e.shiftKey);
|
|
1061
|
+
if (seed)
|
|
1062
|
+
setColumnWidths({ ...seed, [name]: clampColumnWidth(width) });
|
|
1063
|
+
else
|
|
1064
|
+
setColumnWidth(name, width);
|
|
1065
|
+
}, onDoubleClick: () => resetColumnWidth(name) }))] }, name));
|
|
1066
|
+
};
|
|
1067
|
+
const colSpan = ordered.length + shift + (trailing ? 1 : 0);
|
|
1068
|
+
return (_jsxs("div", { className: `table-wrap${compact ? ' grid-compact' : ''}${density === 'compact' ? ' grid-dense' : ''}`, ref: wrap, children: [_jsxs("table", { ref: tableRef, onMouseOver: onMouseOver, className: useColgroup ? 'grid-fit' : undefined, style: useColgroup ? { width: tableWidth } : undefined, children: [useColgroup && (_jsxs("colgroup", { children: [slotted && _jsx("col", { style: { width: GRID_EXPANDER_WIDTH } }), ordered.map((name, index) => (_jsx("col", { style: { width: colWidths[index] } }, name))), trailing && _jsx("col", { style: { width: GRID_TRAIL_WIDTH } })] })), _jsx("thead", { children: _jsxs("tr", { children: [slotted && (_jsx("th", { className: "expander-cell row-host", ref: hosts.headRef, children: expandable && !virtual && (_jsx("button", { type: "button", className: `expander expand-all${expandingAll ? ' working' : ''}`, title: anyClosed ? say('expandEveryRow') : say('collapseEveryRow'), "aria-label": anyClosed ? say('expandEveryRow') : say('collapseEveryRow'), "aria-expanded": !anyClosed, onClick: (e) => {
|
|
1069
|
+
e.stopPropagation();
|
|
1070
|
+
void expandAll();
|
|
1071
|
+
}, children: anyClosed ? '▸' : '▾' })) })), ordered.map((name, index) => header(name, index)), trailing && (_jsx("th", { className: "row-trail", children: _jsx("span", { className: "visually-hidden", children: say('actions') }) }))] }) }), (() => {
|
|
1072
|
+
const body = (_jsxs("tbody", { children: [virtual && (_jsx("tr", { className: "virtual-spacer", "aria-hidden": "true", children: _jsx("td", { colSpan: colSpan, style: {
|
|
1073
|
+
height: `${padTop}px`,
|
|
1074
|
+
padding: 0,
|
|
1075
|
+
border: 'none',
|
|
1076
|
+
} }) })), shown.map((i) => {
|
|
1077
|
+
const row = modelRows[i];
|
|
1078
|
+
if (!row)
|
|
1079
|
+
return null;
|
|
1080
|
+
const key = rowKeys[i];
|
|
1081
|
+
const open = expandable && key !== null && expanded.has(key);
|
|
1082
|
+
return (_jsx(Row, { index: i, rowKey: key, slot: slotted, hostRef: key === null ? undefined : hosts.ref(key), trail: trailing, trailRef: key === null || !trailHosts ? undefined : trailHosts.ref(key), record: row.original, navigable: navigable, opensPage: navigable && !onRowClick && !opens, onOpen: openOne, open: open, current: key !== null && key === currentKey, changed: changedRows.get(row.original), table: table, colSpan: colSpan, columns: cellColumns, editCell: editCell, adornCell: adornCell }, key === null ? `at:${i}` : `key:${key}`));
|
|
1083
|
+
}), virtual && (_jsx("tr", { className: "virtual-spacer", "aria-hidden": "true", children: _jsx("td", { colSpan: colSpan, style: {
|
|
1084
|
+
height: `${padBottom}px`,
|
|
1085
|
+
padding: 0,
|
|
1086
|
+
border: 'none',
|
|
1087
|
+
} }) }))] }));
|
|
1088
|
+
return photoColumns.length ? (_jsx(AvatarPhotos, { columns: photoColumns, rows: rows, children: body })) : (body);
|
|
1089
|
+
})(), totals && rows.length > 0 && (_jsx("tfoot", { children: _jsxs("tr", { className: "grid-totals", children: [slotted && _jsx("td", { className: "expander-cell" }), ordered.map((name, index) => {
|
|
1090
|
+
if (!Object.hasOwn(totals, name))
|
|
1091
|
+
return _jsx("td", { children: index === 0 && _jsx("span", { className: "grid-totals-label", children: totalsLabel }) }, name);
|
|
1092
|
+
return (_jsx("td", { className: "align-right num", children: _jsx(TotalValue, { value: totals[name], display: columnDisplay(table?.id, name) }) }, name));
|
|
1093
|
+
}), trailing && _jsx("td", {})] }) }))] }), expandable &&
|
|
1094
|
+
openable.map((key) => (_jsx(RowDecoration, { rowKey: key, store: hosts, children: _jsx(Expander, { open: expanded.has(key), onToggle: () => toggle(key) }) }, key))), virtual && _jsx("p", { className: "note virtual-note", children: say('rowsDrawnAsYouScroll', { count: rows.length }) }), !rows.length && _jsx("p", { className: "note grid-empty", children: emptyText })] }));
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* One row, and its detail row when it is open. The leading cell, when the
|
|
1098
|
+
* grid draws one, is the row's host: React never gives it children of its
|
|
1099
|
+
* own, so what a decoration portals there is left alone by every repaint.
|
|
1100
|
+
*/
|
|
1101
|
+
const Row = memo(function Row({ index, rowKey, slot, hostRef, trail = false, trailRef, record, navigable, opensPage = false, onOpen, open, current = false, changed, table, colSpan, columns, editCell, adornCell, }) {
|
|
1102
|
+
const photoOf = useContext(AvatarPhotoContext);
|
|
1103
|
+
/* A click inside a dialog one of its cells opened reaches the row through
|
|
1104
|
+
React's tree, not the page's: only a click on the row opens it. */
|
|
1105
|
+
const row = (_jsxs("tr", { className: `${navigable ? 'clickable' : ''}${open ? ' expanded' : ''}${current ? ' is-current' : ''}${changed ? ` row-changed-${changed}` : ''}`.trim() ||
|
|
1106
|
+
undefined, "aria-current": current ? 'true' : undefined, "data-row": index, "data-row-key": rowKey ?? undefined, "data-opens": opensPage && table ? opensRecord(table.id, keyOf(table, record)) : undefined, onClick: navigable
|
|
1107
|
+
? (e) => {
|
|
1108
|
+
if (e.currentTarget.contains(e.target))
|
|
1109
|
+
onOpen(record);
|
|
1110
|
+
}
|
|
1111
|
+
: undefined, children: [slot && _jsx("td", { className: "expander-cell row-host", ref: hostRef }), columns.map((column) => (_jsx(Cell, { meta: column.meta, plan: column.plan, value: column.named ? keyName(column.named, record[column.name]) : record[column.name], label: column.label ? record[column.label] : undefined, display: column.display, pin: column.pin, edge: column.edge, wraps: column.wraps, more: column.more ? foldedOf(column.more, record) : undefined, sub: column.subtitle && Object.hasOwn(record, column.subtitle) ? record[column.subtitle] : undefined, currency: column.currency ? record[column.currency] : undefined, open: column.display?.format === 'relative' && dueOpen(table?.id, column.name, record) ? true : undefined, lead: leadOf(column, record), name: column.name, editCell: editCell, adornCell: adornCell, record: editCell || adornCell ? record : undefined, photo: column.photoOwner ? photoOf(column.name, record[column.photoOwner]) : undefined, row: column.display?.component ? record : undefined, table: table?.id }, column.name))), trail && _jsx("td", { className: "row-trail", ref: trailRef })] }));
|
|
1112
|
+
if (!open || !table)
|
|
1113
|
+
return row;
|
|
1114
|
+
return (_jsxs(_Fragment, { children: [row, _jsx(RowHostScope, { store: null, children: _jsx(RowTrailScope, { store: null, children: _jsx(DetailRow, { table: table, row: record, colSpan: colSpan, grid: Grid }) }) })] }));
|
|
1115
|
+
});
|