@canonical/dataviews-react 0.45.0 → 0.47.0
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/LICENSE +166 -0
- package/package.json +11 -10
- package/dist/esm/lib/DataTable/DataTable.js +0 -128
- package/dist/esm/lib/DataTable/DataTable.js.map +0 -1
- package/dist/esm/lib/DataTable/columnKeys.js +0 -64
- package/dist/esm/lib/DataTable/columnKeys.js.map +0 -1
- package/dist/esm/lib/DataTable/common/BodyCell/BodyCell.js +0 -45
- package/dist/esm/lib/DataTable/common/BodyCell/BodyCell.js.map +0 -1
- package/dist/esm/lib/DataTable/common/BodyCell/index.js +0 -2
- package/dist/esm/lib/DataTable/common/BodyCell/index.js.map +0 -1
- package/dist/esm/lib/DataTable/common/BodyCell/types.js +0 -2
- package/dist/esm/lib/DataTable/common/BodyCell/types.js.map +0 -1
- package/dist/esm/lib/DataTable/common/HeaderCell/HeaderCell.js +0 -47
- package/dist/esm/lib/DataTable/common/HeaderCell/HeaderCell.js.map +0 -1
- package/dist/esm/lib/DataTable/common/HeaderCell/index.js +0 -2
- package/dist/esm/lib/DataTable/common/HeaderCell/index.js.map +0 -1
- package/dist/esm/lib/DataTable/common/HeaderCell/types.js +0 -2
- package/dist/esm/lib/DataTable/common/HeaderCell/types.js.map +0 -1
- package/dist/esm/lib/DataTable/common/ResizeHandle/ResizeHandle.js +0 -142
- package/dist/esm/lib/DataTable/common/ResizeHandle/ResizeHandle.js.map +0 -1
- package/dist/esm/lib/DataTable/common/ResizeHandle/index.js +0 -2
- package/dist/esm/lib/DataTable/common/ResizeHandle/index.js.map +0 -1
- package/dist/esm/lib/DataTable/common/ResizeHandle/types.js +0 -2
- package/dist/esm/lib/DataTable/common/ResizeHandle/types.js.map +0 -1
- package/dist/esm/lib/DataTable/common/Row/Row.js +0 -28
- package/dist/esm/lib/DataTable/common/Row/Row.js.map +0 -1
- package/dist/esm/lib/DataTable/common/Row/index.js +0 -2
- package/dist/esm/lib/DataTable/common/Row/index.js.map +0 -1
- package/dist/esm/lib/DataTable/common/Row/types.js +0 -2
- package/dist/esm/lib/DataTable/common/Row/types.js.map +0 -1
- package/dist/esm/lib/DataTable/common/SelectAllCell/SelectAllCell.js +0 -45
- package/dist/esm/lib/DataTable/common/SelectAllCell/SelectAllCell.js.map +0 -1
- package/dist/esm/lib/DataTable/common/SelectAllCell/index.js +0 -2
- package/dist/esm/lib/DataTable/common/SelectAllCell/index.js.map +0 -1
- package/dist/esm/lib/DataTable/common/SelectAllCell/types.js +0 -2
- package/dist/esm/lib/DataTable/common/SelectAllCell/types.js.map +0 -1
- package/dist/esm/lib/DataTable/common/SelectionCell/SelectionCell.js +0 -17
- package/dist/esm/lib/DataTable/common/SelectionCell/SelectionCell.js.map +0 -1
- package/dist/esm/lib/DataTable/common/SelectionCell/index.js +0 -2
- package/dist/esm/lib/DataTable/common/SelectionCell/index.js.map +0 -1
- package/dist/esm/lib/DataTable/common/SelectionCell/types.js +0 -2
- package/dist/esm/lib/DataTable/common/SelectionCell/types.js.map +0 -1
- package/dist/esm/lib/DataTable/common/TableBody/TableBody.js +0 -30
- package/dist/esm/lib/DataTable/common/TableBody/TableBody.js.map +0 -1
- package/dist/esm/lib/DataTable/common/TableBody/index.js +0 -2
- package/dist/esm/lib/DataTable/common/TableBody/index.js.map +0 -1
- package/dist/esm/lib/DataTable/common/TableBody/types.js +0 -2
- package/dist/esm/lib/DataTable/common/TableBody/types.js.map +0 -1
- package/dist/esm/lib/DataTable/common/index.js +0 -8
- package/dist/esm/lib/DataTable/common/index.js.map +0 -1
- package/dist/esm/lib/DataTable/defaultStatusText.js +0 -16
- package/dist/esm/lib/DataTable/defaultStatusText.js.map +0 -1
- package/dist/esm/lib/DataTable/hooks/index.js +0 -6
- package/dist/esm/lib/DataTable/hooks/index.js.map +0 -1
- package/dist/esm/lib/DataTable/hooks/types.js +0 -6
- package/dist/esm/lib/DataTable/hooks/types.js.map +0 -1
- package/dist/esm/lib/DataTable/hooks/usePreferredWidths.js +0 -95
- package/dist/esm/lib/DataTable/hooks/usePreferredWidths.js.map +0 -1
- package/dist/esm/lib/DataTable/hooks/useRowScopes.js +0 -25
- package/dist/esm/lib/DataTable/hooks/useRowScopes.js.map +0 -1
- package/dist/esm/lib/DataTable/hooks/useStableCallback.js +0 -17
- package/dist/esm/lib/DataTable/hooks/useStableCallback.js.map +0 -1
- package/dist/esm/lib/DataTable/hooks/useStableValue.js +0 -18
- package/dist/esm/lib/DataTable/hooks/useStableValue.js.map +0 -1
- package/dist/esm/lib/DataTable/hooks/useTableGeometry.js +0 -124
- package/dist/esm/lib/DataTable/hooks/useTableGeometry.js.map +0 -1
- package/dist/esm/lib/DataTable/index.js +0 -2
- package/dist/esm/lib/DataTable/index.js.map +0 -1
- package/dist/esm/lib/DataTable/styles.css +0 -261
- package/dist/esm/lib/DataTable/tableStatus.js +0 -28
- package/dist/esm/lib/DataTable/tableStatus.js.map +0 -1
- package/dist/esm/lib/DataTable/types.js +0 -2
- package/dist/esm/lib/DataTable/types.js.map +0 -1
- package/dist/esm/lib/DataViews/CellScopeContext.js +0 -8
- package/dist/esm/lib/DataViews/CellScopeContext.js.map +0 -1
- package/dist/esm/lib/DataViews/Context.js +0 -9
- package/dist/esm/lib/DataViews/Context.js.map +0 -1
- package/dist/esm/lib/DataViews/Provider.js +0 -30
- package/dist/esm/lib/DataViews/Provider.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Actions/Actions.js +0 -60
- package/dist/esm/lib/DataViews/common/Actions/Actions.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Actions/index.js +0 -2
- package/dist/esm/lib/DataViews/common/Actions/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Actions/styles.css +0 -42
- package/dist/esm/lib/DataViews/common/Actions/types.js +0 -2
- package/dist/esm/lib/DataViews/common/Actions/types.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/Filters.js +0 -39
- package/dist/esm/lib/DataViews/common/Filters/Filters.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/BoundFilter/BoundFilter.js +0 -56
- package/dist/esm/lib/DataViews/common/Filters/common/BoundFilter/BoundFilter.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/BoundFilter/index.js +0 -2
- package/dist/esm/lib/DataViews/common/Filters/common/BoundFilter/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/BoundFilter/types.js +0 -2
- package/dist/esm/lib/DataViews/common/Filters/common/BoundFilter/types.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/ChoicesFilter/ChoicesFilter.js +0 -31
- package/dist/esm/lib/DataViews/common/Filters/common/ChoicesFilter/ChoicesFilter.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/ChoicesFilter/index.js +0 -2
- package/dist/esm/lib/DataViews/common/Filters/common/ChoicesFilter/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/ChoicesFilter/types.js +0 -2
- package/dist/esm/lib/DataViews/common/Filters/common/ChoicesFilter/types.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/FlagFilter/FlagFilter.js +0 -23
- package/dist/esm/lib/DataViews/common/Filters/common/FlagFilter/FlagFilter.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/FlagFilter/index.js +0 -2
- package/dist/esm/lib/DataViews/common/Filters/common/FlagFilter/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/FlagFilter/types.js +0 -2
- package/dist/esm/lib/DataViews/common/Filters/common/FlagFilter/types.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/common/index.js +0 -4
- package/dist/esm/lib/DataViews/common/Filters/common/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/handleFor.js +0 -13
- package/dist/esm/lib/DataViews/common/Filters/handleFor.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/index.js +0 -2
- package/dist/esm/lib/DataViews/common/Filters/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Filters/types.js +0 -2
- package/dist/esm/lib/DataViews/common/Filters/types.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Pagination/Pagination.js +0 -20
- package/dist/esm/lib/DataViews/common/Pagination/Pagination.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Pagination/index.js +0 -2
- package/dist/esm/lib/DataViews/common/Pagination/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Pagination/types.js +0 -2
- package/dist/esm/lib/DataViews/common/Pagination/types.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/Views.js +0 -157
- package/dist/esm/lib/DataViews/common/Views/Views.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/common/DeleteConfirm/DeleteConfirm.js +0 -24
- package/dist/esm/lib/DataViews/common/Views/common/DeleteConfirm/DeleteConfirm.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/common/DeleteConfirm/index.js +0 -2
- package/dist/esm/lib/DataViews/common/Views/common/DeleteConfirm/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/common/DeleteConfirm/types.js +0 -2
- package/dist/esm/lib/DataViews/common/Views/common/DeleteConfirm/types.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/common/NameForm/NameForm.js +0 -40
- package/dist/esm/lib/DataViews/common/Views/common/NameForm/NameForm.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/common/NameForm/index.js +0 -2
- package/dist/esm/lib/DataViews/common/Views/common/NameForm/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/common/NameForm/types.js +0 -2
- package/dist/esm/lib/DataViews/common/Views/common/NameForm/types.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/common/index.js +0 -3
- package/dist/esm/lib/DataViews/common/Views/common/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/index.js +0 -2
- package/dist/esm/lib/DataViews/common/Views/index.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/styles.css +0 -57
- package/dist/esm/lib/DataViews/common/Views/types.js +0 -2
- package/dist/esm/lib/DataViews/common/Views/types.js.map +0 -1
- package/dist/esm/lib/DataViews/common/Views/viewStatusText.js +0 -61
- package/dist/esm/lib/DataViews/common/Views/viewStatusText.js.map +0 -1
- package/dist/esm/lib/DataViews/common/index.js +0 -5
- package/dist/esm/lib/DataViews/common/index.js.map +0 -1
- package/dist/esm/lib/DataViews/hooks/index.js +0 -5
- package/dist/esm/lib/DataViews/hooks/index.js.map +0 -1
- package/dist/esm/lib/DataViews/hooks/types.js +0 -2
- package/dist/esm/lib/DataViews/hooks/types.js.map +0 -1
- package/dist/esm/lib/DataViews/hooks/useDataViews.js +0 -35
- package/dist/esm/lib/DataViews/hooks/useDataViews.js.map +0 -1
- package/dist/esm/lib/DataViews/hooks/useDataViewsCell.js +0 -25
- package/dist/esm/lib/DataViews/hooks/useDataViewsCell.js.map +0 -1
- package/dist/esm/lib/DataViews/hooks/useDataViewsField.js +0 -18
- package/dist/esm/lib/DataViews/hooks/useDataViewsField.js.map +0 -1
- package/dist/esm/lib/DataViews/hooks/useDataViewsState.js +0 -14
- package/dist/esm/lib/DataViews/hooks/useDataViewsState.js.map +0 -1
- package/dist/esm/lib/DataViews/hooks/useDataViewsValue.js +0 -9
- package/dist/esm/lib/DataViews/hooks/useDataViewsValue.js.map +0 -1
- package/dist/esm/lib/DataViews/index.js +0 -3
- package/dist/esm/lib/DataViews/index.js.map +0 -1
- package/dist/esm/lib/DataViews/plural.js +0 -5
- package/dist/esm/lib/DataViews/plural.js.map +0 -1
- package/dist/esm/lib/DataViews/sentenceOf.js +0 -8
- package/dist/esm/lib/DataViews/sentenceOf.js.map +0 -1
- package/dist/esm/lib/DataViews/types.js +0 -2
- package/dist/esm/lib/DataViews/types.js.map +0 -1
- package/dist/esm/lib/PaginationBar/PaginationBar.js +0 -104
- package/dist/esm/lib/PaginationBar/PaginationBar.js.map +0 -1
- package/dist/esm/lib/PaginationBar/index.js +0 -2
- package/dist/esm/lib/PaginationBar/index.js.map +0 -1
- package/dist/esm/lib/PaginationBar/paginationState.js +0 -32
- package/dist/esm/lib/PaginationBar/paginationState.js.map +0 -1
- package/dist/esm/lib/PaginationBar/styles.css +0 -105
- package/dist/esm/lib/PaginationBar/types.js +0 -2
- package/dist/esm/lib/PaginationBar/types.js.map +0 -1
- package/dist/types/lib/DataTable/DataTable.d.ts +0 -24
- package/dist/types/lib/DataTable/DataTable.d.ts.map +0 -1
- package/dist/types/lib/DataTable/columnKeys.d.ts +0 -45
- package/dist/types/lib/DataTable/columnKeys.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/BodyCell/BodyCell.d.ts +0 -17
- package/dist/types/lib/DataTable/common/BodyCell/BodyCell.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/BodyCell/index.d.ts +0 -3
- package/dist/types/lib/DataTable/common/BodyCell/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/BodyCell/types.d.ts +0 -16
- package/dist/types/lib/DataTable/common/BodyCell/types.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/HeaderCell/HeaderCell.d.ts +0 -12
- package/dist/types/lib/DataTable/common/HeaderCell/HeaderCell.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/HeaderCell/index.d.ts +0 -3
- package/dist/types/lib/DataTable/common/HeaderCell/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/HeaderCell/types.d.ts +0 -44
- package/dist/types/lib/DataTable/common/HeaderCell/types.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/ResizeHandle/ResizeHandle.d.ts +0 -14
- package/dist/types/lib/DataTable/common/ResizeHandle/ResizeHandle.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/ResizeHandle/index.d.ts +0 -3
- package/dist/types/lib/DataTable/common/ResizeHandle/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/ResizeHandle/types.d.ts +0 -21
- package/dist/types/lib/DataTable/common/ResizeHandle/types.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/Row/Row.d.ts +0 -15
- package/dist/types/lib/DataTable/common/Row/Row.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/Row/index.d.ts +0 -3
- package/dist/types/lib/DataTable/common/Row/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/Row/types.d.ts +0 -18
- package/dist/types/lib/DataTable/common/Row/types.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/SelectAllCell/SelectAllCell.d.ts +0 -9
- package/dist/types/lib/DataTable/common/SelectAllCell/SelectAllCell.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/SelectAllCell/index.d.ts +0 -3
- package/dist/types/lib/DataTable/common/SelectAllCell/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/SelectAllCell/types.d.ts +0 -23
- package/dist/types/lib/DataTable/common/SelectAllCell/types.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/SelectionCell/SelectionCell.d.ts +0 -8
- package/dist/types/lib/DataTable/common/SelectionCell/SelectionCell.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/SelectionCell/index.d.ts +0 -3
- package/dist/types/lib/DataTable/common/SelectionCell/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/SelectionCell/types.d.ts +0 -15
- package/dist/types/lib/DataTable/common/SelectionCell/types.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/TableBody/TableBody.d.ts +0 -15
- package/dist/types/lib/DataTable/common/TableBody/TableBody.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/TableBody/index.d.ts +0 -3
- package/dist/types/lib/DataTable/common/TableBody/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/TableBody/types.d.ts +0 -27
- package/dist/types/lib/DataTable/common/TableBody/types.d.ts.map +0 -1
- package/dist/types/lib/DataTable/common/index.d.ts +0 -8
- package/dist/types/lib/DataTable/common/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/defaultStatusText.d.ts +0 -4
- package/dist/types/lib/DataTable/defaultStatusText.d.ts.map +0 -1
- package/dist/types/lib/DataTable/hooks/index.d.ts +0 -7
- package/dist/types/lib/DataTable/hooks/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/hooks/types.d.ts +0 -27
- package/dist/types/lib/DataTable/hooks/types.d.ts.map +0 -1
- package/dist/types/lib/DataTable/hooks/usePreferredWidths.d.ts +0 -25
- package/dist/types/lib/DataTable/hooks/usePreferredWidths.d.ts.map +0 -1
- package/dist/types/lib/DataTable/hooks/useRowScopes.d.ts +0 -12
- package/dist/types/lib/DataTable/hooks/useRowScopes.d.ts.map +0 -1
- package/dist/types/lib/DataTable/hooks/useStableCallback.d.ts +0 -12
- package/dist/types/lib/DataTable/hooks/useStableCallback.d.ts.map +0 -1
- package/dist/types/lib/DataTable/hooks/useStableValue.d.ts +0 -11
- package/dist/types/lib/DataTable/hooks/useStableValue.d.ts.map +0 -1
- package/dist/types/lib/DataTable/hooks/useTableGeometry.d.ts +0 -21
- package/dist/types/lib/DataTable/hooks/useTableGeometry.d.ts.map +0 -1
- package/dist/types/lib/DataTable/index.d.ts +0 -3
- package/dist/types/lib/DataTable/index.d.ts.map +0 -1
- package/dist/types/lib/DataTable/tableStatus.d.ts +0 -15
- package/dist/types/lib/DataTable/tableStatus.d.ts.map +0 -1
- package/dist/types/lib/DataTable/types.d.ts +0 -119
- package/dist/types/lib/DataTable/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/CellScopeContext.d.ts +0 -29
- package/dist/types/lib/DataViews/CellScopeContext.d.ts.map +0 -1
- package/dist/types/lib/DataViews/Context.d.ts +0 -9
- package/dist/types/lib/DataViews/Context.d.ts.map +0 -1
- package/dist/types/lib/DataViews/Provider.d.ts +0 -19
- package/dist/types/lib/DataViews/Provider.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Actions/Actions.d.ts +0 -19
- package/dist/types/lib/DataViews/common/Actions/Actions.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Actions/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Actions/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Actions/types.d.ts +0 -27
- package/dist/types/lib/DataViews/common/Actions/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/Filters.d.ts +0 -14
- package/dist/types/lib/DataViews/common/Filters/Filters.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/BoundFilter/BoundFilter.d.ts +0 -12
- package/dist/types/lib/DataViews/common/Filters/common/BoundFilter/BoundFilter.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/BoundFilter/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Filters/common/BoundFilter/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/BoundFilter/types.d.ts +0 -24
- package/dist/types/lib/DataViews/common/Filters/common/BoundFilter/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/ChoicesFilter/ChoicesFilter.d.ts +0 -10
- package/dist/types/lib/DataViews/common/Filters/common/ChoicesFilter/ChoicesFilter.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/ChoicesFilter/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Filters/common/ChoicesFilter/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/ChoicesFilter/types.d.ts +0 -22
- package/dist/types/lib/DataViews/common/Filters/common/ChoicesFilter/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/FlagFilter/FlagFilter.d.ts +0 -9
- package/dist/types/lib/DataViews/common/Filters/common/FlagFilter/FlagFilter.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/FlagFilter/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Filters/common/FlagFilter/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/FlagFilter/types.d.ts +0 -20
- package/dist/types/lib/DataViews/common/Filters/common/FlagFilter/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/common/index.d.ts +0 -4
- package/dist/types/lib/DataViews/common/Filters/common/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/handleFor.d.ts +0 -11
- package/dist/types/lib/DataViews/common/Filters/handleFor.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Filters/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Filters/types.d.ts +0 -23
- package/dist/types/lib/DataViews/common/Filters/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Pagination/Pagination.d.ts +0 -12
- package/dist/types/lib/DataViews/common/Pagination/Pagination.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Pagination/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Pagination/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Pagination/types.d.ts +0 -8
- package/dist/types/lib/DataViews/common/Pagination/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/Views.d.ts +0 -25
- package/dist/types/lib/DataViews/common/Views/Views.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/common/DeleteConfirm/DeleteConfirm.d.ts +0 -8
- package/dist/types/lib/DataViews/common/Views/common/DeleteConfirm/DeleteConfirm.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/common/DeleteConfirm/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Views/common/DeleteConfirm/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/common/DeleteConfirm/types.d.ts +0 -14
- package/dist/types/lib/DataViews/common/Views/common/DeleteConfirm/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/common/NameForm/NameForm.d.ts +0 -11
- package/dist/types/lib/DataViews/common/Views/common/NameForm/NameForm.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/common/NameForm/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Views/common/NameForm/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/common/NameForm/types.d.ts +0 -22
- package/dist/types/lib/DataViews/common/Views/common/NameForm/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/common/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Views/common/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/index.d.ts +0 -3
- package/dist/types/lib/DataViews/common/Views/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/types.d.ts +0 -16
- package/dist/types/lib/DataViews/common/Views/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/Views/viewStatusText.d.ts +0 -9
- package/dist/types/lib/DataViews/common/Views/viewStatusText.d.ts.map +0 -1
- package/dist/types/lib/DataViews/common/index.d.ts +0 -5
- package/dist/types/lib/DataViews/common/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/hooks/index.d.ts +0 -6
- package/dist/types/lib/DataViews/hooks/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/hooks/types.d.ts +0 -48
- package/dist/types/lib/DataViews/hooks/types.d.ts.map +0 -1
- package/dist/types/lib/DataViews/hooks/useDataViews.d.ts +0 -11
- package/dist/types/lib/DataViews/hooks/useDataViews.d.ts.map +0 -1
- package/dist/types/lib/DataViews/hooks/useDataViewsCell.d.ts +0 -11
- package/dist/types/lib/DataViews/hooks/useDataViewsCell.d.ts.map +0 -1
- package/dist/types/lib/DataViews/hooks/useDataViewsField.d.ts +0 -8
- package/dist/types/lib/DataViews/hooks/useDataViewsField.d.ts.map +0 -1
- package/dist/types/lib/DataViews/hooks/useDataViewsState.d.ts +0 -11
- package/dist/types/lib/DataViews/hooks/useDataViewsState.d.ts.map +0 -1
- package/dist/types/lib/DataViews/hooks/useDataViewsValue.d.ts +0 -7
- package/dist/types/lib/DataViews/hooks/useDataViewsValue.d.ts.map +0 -1
- package/dist/types/lib/DataViews/index.d.ts +0 -9
- package/dist/types/lib/DataViews/index.d.ts.map +0 -1
- package/dist/types/lib/DataViews/plural.d.ts +0 -3
- package/dist/types/lib/DataViews/plural.d.ts.map +0 -1
- package/dist/types/lib/DataViews/sentenceOf.d.ts +0 -6
- package/dist/types/lib/DataViews/sentenceOf.d.ts.map +0 -1
- package/dist/types/lib/DataViews/types.d.ts +0 -18
- package/dist/types/lib/DataViews/types.d.ts.map +0 -1
- package/dist/types/lib/PaginationBar/PaginationBar.d.ts +0 -17
- package/dist/types/lib/PaginationBar/PaginationBar.d.ts.map +0 -1
- package/dist/types/lib/PaginationBar/index.d.ts +0 -3
- package/dist/types/lib/PaginationBar/index.d.ts.map +0 -1
- package/dist/types/lib/PaginationBar/paginationState.d.ts +0 -37
- package/dist/types/lib/PaginationBar/paginationState.d.ts.map +0 -1
- package/dist/types/lib/PaginationBar/types.d.ts +0 -24
- package/dist/types/lib/PaginationBar/types.d.ts.map +0 -1
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { columnTemplate, resolveColumns } from "@canonical/dataviews-core";
|
|
2
|
-
import { useCallback, useMemo, useState } from "react";
|
|
3
|
-
import useDataViewsState from "../../DataViews/hooks/useDataViewsState.js";
|
|
4
|
-
import { sameTracks } from "../columnKeys.js";
|
|
5
|
-
import useStableValue from "./useStableValue.js";
|
|
6
|
-
/**
|
|
7
|
-
* Give the last column whatever width the others leave, even past its own
|
|
8
|
-
* maximum: its trailing edge is the table's own edge, so it is never resized
|
|
9
|
-
* on its own and grows and shrinks as the columns before it are. Nothing
|
|
10
|
-
* changes once the columns no longer fit, or before the container is
|
|
11
|
-
* measured.
|
|
12
|
-
*/
|
|
13
|
-
const fillLast = (columns, available) => {
|
|
14
|
-
const last = columns.at(-1);
|
|
15
|
-
if (available === null || last === undefined) {
|
|
16
|
-
return columns;
|
|
17
|
-
}
|
|
18
|
-
const spare = available - columns.reduce((total, column) => total + column.width, 0);
|
|
19
|
-
return spare > 0
|
|
20
|
-
? [...columns.slice(0, -1), { id: last.id, width: last.width + spare }]
|
|
21
|
-
: columns;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Call `onResize` with each resize of one element. Returns the disconnect,
|
|
25
|
-
* or nothing where there is no observer.
|
|
26
|
-
*/
|
|
27
|
-
const observeResize = (element, onResize) => {
|
|
28
|
-
if (typeof ResizeObserver === "undefined") {
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
const observer = new ResizeObserver((entries) => {
|
|
32
|
-
for (const entry of entries) {
|
|
33
|
-
onResize(entry);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
observer.observe(element);
|
|
37
|
-
return () => {
|
|
38
|
-
observer.disconnect();
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Resolve one mounted table's geometry.
|
|
43
|
-
*
|
|
44
|
-
* Widths are published once, as the container's track list, rather than
|
|
45
|
-
* written onto every cell. Before the container is measured the tracks are
|
|
46
|
-
* declarative, so the baseline is aligned and server output deterministic;
|
|
47
|
-
* afterwards the solver's pixel vector is published, which is what capping
|
|
48
|
-
* and resizing need. The authoritative presentation is untouched while a
|
|
49
|
-
* resize previews: the preview only replaces its own column's track.
|
|
50
|
-
*
|
|
51
|
-
* The columns are resolved against the container's content width less the
|
|
52
|
-
* selection track, whose width is the stylesheet's: it is read back from the
|
|
53
|
-
* cell that track sizes, observed for as long as that cell is there.
|
|
54
|
-
*
|
|
55
|
-
* Two tables sharing one presentation therefore share user arrangement while
|
|
56
|
-
* resolving their own widths against their own container.
|
|
57
|
-
*/
|
|
58
|
-
export default function useTableGeometry(presentation, interaction, columnIds) {
|
|
59
|
-
const [container, setContainer] = useState(null);
|
|
60
|
-
const [reserved, setReserved] = useState(0);
|
|
61
|
-
// Subscribed for the re-render, not for the snapshot: the tracks below
|
|
62
|
-
// are read through the record itself, so its unknown-id guard is the one
|
|
63
|
-
// answer to a column the presentation never declared.
|
|
64
|
-
useDataViewsState(presentation);
|
|
65
|
-
const interactionState = useDataViewsState(interaction);
|
|
66
|
-
const attach = useCallback((node) => {
|
|
67
|
-
// Inside the border, which is no room for a column. The observer's
|
|
68
|
-
// first report, which follows at once, is the exact content width.
|
|
69
|
-
setContainer(node.clientWidth);
|
|
70
|
-
return observeResize(node, (entry) => {
|
|
71
|
-
setContainer(entry.contentRect.width);
|
|
72
|
-
});
|
|
73
|
-
}, []);
|
|
74
|
-
// Observed on its own: the track is sized in rem, so a root font-size
|
|
75
|
-
// change moves it with no change to the container. Read as its layout
|
|
76
|
-
// width every time — never its bounding box, which an ancestor's
|
|
77
|
-
// transform would scale.
|
|
78
|
-
const reserve = useCallback((cell) => {
|
|
79
|
-
const measure = () => {
|
|
80
|
-
setReserved(cell.offsetWidth);
|
|
81
|
-
};
|
|
82
|
-
measure();
|
|
83
|
-
const disconnect = observeResize(cell, measure);
|
|
84
|
-
return () => {
|
|
85
|
-
disconnect?.();
|
|
86
|
-
setReserved(0);
|
|
87
|
-
};
|
|
88
|
-
}, []);
|
|
89
|
-
const width = container === null ? null : Math.max(0, container - reserved);
|
|
90
|
-
const tracks = useStableValue(columnIds.map((id) => ({ id, sizing: presentation.effective(id) })), sameTracks);
|
|
91
|
-
// Resolving against zero yields each column's own reservation, which is
|
|
92
|
-
// exactly the width a resize should capture before the container is
|
|
93
|
-
// measured — so the unmeasured case needs no separate fallback.
|
|
94
|
-
const resolved = useMemo(() => resolveColumns(tracks, width ?? 0), [tracks, width]);
|
|
95
|
-
const filled = useMemo(() => fillLast(resolved, width), [resolved, width]);
|
|
96
|
-
const widths = useMemo(() => filled.map((column) => column.width), [filled]);
|
|
97
|
-
const preview = interactionState.status === "resizing"
|
|
98
|
-
? { id: interactionState.columnId, width: interactionState.previewWidth }
|
|
99
|
-
: undefined;
|
|
100
|
-
// Rebuilt per render rather than memoised: the track list costs one pass
|
|
101
|
-
// over the columns, and a live preview would defeat the memo anyway. The
|
|
102
|
-
// solved vector is handed over rather than re-solved: before the
|
|
103
|
-
// container is measured the tracks are declarative, and after it they are
|
|
104
|
-
// the widths just resolved.
|
|
105
|
-
// A live preview is substituted before the last column is filled, so the
|
|
106
|
-
// last column follows the edge being dragged rather than waiting for the
|
|
107
|
-
// commit.
|
|
108
|
-
const live = width === null
|
|
109
|
-
? null
|
|
110
|
-
: preview === undefined
|
|
111
|
-
? filled
|
|
112
|
-
: fillLast(resolved.map((column) => column.id === preview.id
|
|
113
|
-
? { id: column.id, width: preview.width }
|
|
114
|
-
: column), width);
|
|
115
|
-
return {
|
|
116
|
-
attach,
|
|
117
|
-
reserve,
|
|
118
|
-
// No columns, no tracks: nothing is published, and a selectable table's
|
|
119
|
-
// template keeps its selection track alone rather than turning invalid.
|
|
120
|
-
template: tracks.length === 0 ? undefined : columnTemplate(tracks, live),
|
|
121
|
-
widths,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=useTableGeometry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTableGeometry.js","sourceRoot":"","sources":["../../../../../src/lib/DataTable/hooks/useTableGeometry.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,iBAAiB,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,CACf,OAAkC,EAClC,SAAwB,EACG,EAAE;IAC7B,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,SAAS,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,KAAK,GACT,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,KAA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AAC,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC;QACxE,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/DataTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
2
|
-
|
|
3
|
-
@layer ds.components.global {
|
|
4
|
-
/**
|
|
5
|
-
* DataTable styles
|
|
6
|
-
*
|
|
7
|
-
* The specification is the anatomy beside the code: `DataTable.anatomy.yaml`
|
|
8
|
-
* and the files beside HeaderCell and BodyCell. Every value below is one it
|
|
9
|
-
* binds; what it could not bind is recorded there, never hardcoded here.
|
|
10
|
-
*
|
|
11
|
-
* The table is a stack of div rows, each a CSS grid. The solver publishes
|
|
12
|
-
* the data columns' tracks on the container as `--data-table-columns`: that
|
|
13
|
-
* one custom property is the whole of the geometry this component writes
|
|
14
|
-
* inline, derived per render from the measured container, which no
|
|
15
|
-
* stylesheet can know. Everything else about the layout is here, the
|
|
16
|
-
* selection column included.
|
|
17
|
-
*
|
|
18
|
-
* Colour, border, type and spacing come from @canonical/design-tokens. Row
|
|
19
|
-
* height and cell padding come from the density channel of
|
|
20
|
-
* @canonical/styles: the root carries the design system's `.dense`, so the
|
|
21
|
-
* table is dense wherever it sits, and it defines no density rule of its
|
|
22
|
-
* own.
|
|
23
|
-
*/
|
|
24
|
-
.ds.data-table {
|
|
25
|
-
/* The columns are authoritative: when their total no longer fits, the
|
|
26
|
-
table scrolls rather than compressing a column past its minimum.
|
|
27
|
-
`overflow-x` alone would make the used `overflow-y` a scroll
|
|
28
|
-
container anyway, so both are declared — which is also what lets the
|
|
29
|
-
header stick when a caller caps the height. */
|
|
30
|
-
overflow: auto;
|
|
31
|
-
color: var(--color-text);
|
|
32
|
-
font-family: var(--typography-text-primary-font-family);
|
|
33
|
-
font-size: var(--typography-text-primary-font-size);
|
|
34
|
-
font-weight: var(--typography-text-primary-font-weight);
|
|
35
|
-
/* The surface it sits on, so a table inside a layered surface steps its
|
|
36
|
-
background with it. */
|
|
37
|
-
background-color: var(--surface-color-background, var(--color-background));
|
|
38
|
-
border: var(--dimension-stroke-thickness-medium) solid
|
|
39
|
-
var(--color-border-muted);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* Rows take their width from the track list, not from the scroll
|
|
43
|
-
container, so a hovered or selected fill covers every column of a table
|
|
44
|
-
that is wider than its viewport. */
|
|
45
|
-
.ds.data-table-row-group {
|
|
46
|
-
min-inline-size: max-content;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ds.data-table-row-group.header {
|
|
50
|
-
/* Sticky only bites when the caller caps the table's height; it costs a
|
|
51
|
-
table that scrolls only horizontally nothing. */
|
|
52
|
-
position: sticky;
|
|
53
|
-
inset-block-start: 0;
|
|
54
|
-
z-index: 1;
|
|
55
|
-
background-color: var(--color-background-layer2);
|
|
56
|
-
border-block-end: var(--dimension-stroke-thickness-medium) solid
|
|
57
|
-
var(--color-border-muted);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.ds.data-table-row {
|
|
61
|
-
display: grid;
|
|
62
|
-
/* The one geometry publication, written on the container and read here.
|
|
63
|
-
The line after the data columns is named for the actions column a
|
|
64
|
-
later part places there; nothing follows it yet. */
|
|
65
|
-
grid-template-columns: var(--data-table-columns,) [actions];
|
|
66
|
-
align-items: center;
|
|
67
|
-
/* A minimum, not a height: a cell taller than the density line — a
|
|
68
|
-
second line of text, once cells offer one — grows its row rather than
|
|
69
|
-
clipping. */
|
|
70
|
-
min-block-size: var(--density-line-height-effective);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* The status row holds one cell for the whole table: a block, so its
|
|
74
|
-
message spans the table whatever tracks the rows have — even a
|
|
75
|
-
selectable table with no columns, whose rows have one 32px track. */
|
|
76
|
-
.ds.data-table-row.status {
|
|
77
|
-
display: block;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.ds.data-table-row-group.body > .ds.data-table-row {
|
|
81
|
-
&:not(:last-child) {
|
|
82
|
-
border-block-end: var(--dimension-stroke-thickness-medium) solid
|
|
83
|
-
var(--color-border-muted);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* A record row takes the neutral ghost fill under the pointer. A
|
|
87
|
-
selected row takes the information tint, the hue of its checked
|
|
88
|
-
checkbox, a step deeper under the pointer — provisional, until the
|
|
89
|
-
tokens name a selection role. The status row is not a record, so it
|
|
90
|
-
takes none of them. */
|
|
91
|
-
&:hover:not(.status) {
|
|
92
|
-
background-color: var(--color-foreground-ghost-hover);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&.selected {
|
|
96
|
-
background-color: var(--color-foreground-secondary-information);
|
|
97
|
-
|
|
98
|
-
&:hover {
|
|
99
|
-
background-color: var(--color-foreground-secondary-information-hover);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/* The selection column is this stylesheet's own track, ahead of the solved
|
|
105
|
-
ones, in a table whose header holds the select-all cell. The table reads
|
|
106
|
-
its width back from the cell it sizes, and the solver shares what is
|
|
107
|
-
left among the data columns. */
|
|
108
|
-
.ds.data-table:has(
|
|
109
|
-
> .ds.data-table-row-group.header
|
|
110
|
-
> .ds.data-table-row
|
|
111
|
-
> .ds.data-table-header-cell.selection
|
|
112
|
-
)
|
|
113
|
-
> .ds.data-table-row-group
|
|
114
|
-
> .ds.data-table-row {
|
|
115
|
-
grid-template-columns: var(--dimension-400) var(--data-table-columns,) [actions];
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.ds.data-table-body-cell,
|
|
119
|
-
.ds.data-table-header-cell {
|
|
120
|
-
/* A grid item's automatic minimum size is its content, which would let
|
|
121
|
-
one long value widen the track the solver just sized. Zero here. */
|
|
122
|
-
min-inline-size: 0;
|
|
123
|
-
padding-inline: var(--density-padding-inline);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.ds.data-table-body-cell {
|
|
127
|
-
/* One line: a value too long for its column ellipsizes rather than
|
|
128
|
-
wrapping the row out of the shared track list — clipped without the
|
|
129
|
-
cell becoming a scroll container. A cell renderer that wants other
|
|
130
|
-
behaviour overrides these on its own content. */
|
|
131
|
-
overflow: clip;
|
|
132
|
-
text-overflow: ellipsis;
|
|
133
|
-
white-space: nowrap;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.ds.data-table-resize-handle {
|
|
137
|
-
/* Pushed to the trailing edge of the header cell and stretched to its
|
|
138
|
-
height: the whole strip is the pointer target. */
|
|
139
|
-
flex: none;
|
|
140
|
-
align-self: stretch;
|
|
141
|
-
inline-size: var(--dimension-200);
|
|
142
|
-
margin-inline-start: auto;
|
|
143
|
-
position: relative;
|
|
144
|
-
cursor: col-resize;
|
|
145
|
-
/* A drag is a pointer gesture, never a scroll — and never a text
|
|
146
|
-
selection, which a second press would pick up as a native drag of
|
|
147
|
-
the selected text instead of a resize. */
|
|
148
|
-
touch-action: none;
|
|
149
|
-
user-select: none;
|
|
150
|
-
|
|
151
|
-
/* The mark the strip shows: the design's hairline, as wide as the large
|
|
152
|
-
stroke and as tall as a line of text, centred in the target. */
|
|
153
|
-
&::after {
|
|
154
|
-
content: "";
|
|
155
|
-
position: absolute;
|
|
156
|
-
inset: 0;
|
|
157
|
-
margin: auto;
|
|
158
|
-
inline-size: var(--dimension-stroke-thickness-large);
|
|
159
|
-
block-size: var(--dimension-250);
|
|
160
|
-
background-color: var(--color-border-muted);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
&:hover::after,
|
|
164
|
-
&:focus-visible::after {
|
|
165
|
-
background-color: var(--color-focus-ring, currentColor);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
&:focus-visible {
|
|
169
|
-
outline: var(--dimension-stroke-thickness-large) solid
|
|
170
|
-
var(--color-focus-ring, currentColor);
|
|
171
|
-
outline-offset: calc(-1 * var(--dimension-stroke-thickness-large));
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.ds.data-table-header-cell {
|
|
176
|
-
display: flex;
|
|
177
|
-
align-items: center;
|
|
178
|
-
/* The row's full height, so the resize target at its edge is too. */
|
|
179
|
-
align-self: stretch;
|
|
180
|
-
gap: var(--dimension-050);
|
|
181
|
-
font-weight: var(--typography-text-primary-bold-font-weight);
|
|
182
|
-
/* A header cell never clips: its label and sort control clip themselves,
|
|
183
|
-
and the resize handle at its edge must stay reachable however narrow
|
|
184
|
-
the column gets. */
|
|
185
|
-
overflow: visible;
|
|
186
|
-
|
|
187
|
-
/* The resize handle carries the trailing inset itself, so a header cell
|
|
188
|
-
that has one does not pay for that padding twice. */
|
|
189
|
-
&:has(> .ds.data-table-resize-handle) {
|
|
190
|
-
padding-inline-end: 0;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/* The header cell's own text ellipsizes — never a caller's content inside
|
|
194
|
-
it. In a sortable header cell it sits inside the sort control, which
|
|
195
|
-
shrinks with it, so the indicator stays in view when the text does
|
|
196
|
-
not fit. */
|
|
197
|
-
& > .sort > .label,
|
|
198
|
-
& > .label {
|
|
199
|
-
min-inline-size: 0;
|
|
200
|
-
overflow: clip;
|
|
201
|
-
text-overflow: ellipsis;
|
|
202
|
-
white-space: nowrap;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/* The sort control is the header cell's text: it inherits the type rather
|
|
206
|
-
than looking like a button that happens to sit in a table. */
|
|
207
|
-
& > .sort {
|
|
208
|
-
display: flex;
|
|
209
|
-
min-inline-size: 0;
|
|
210
|
-
align-items: center;
|
|
211
|
-
gap: var(--dimension-050);
|
|
212
|
-
margin: 0;
|
|
213
|
-
padding: 0;
|
|
214
|
-
color: inherit;
|
|
215
|
-
font: inherit;
|
|
216
|
-
text-align: start;
|
|
217
|
-
background: none;
|
|
218
|
-
border: none;
|
|
219
|
-
cursor: pointer;
|
|
220
|
-
|
|
221
|
-
/* Inset in full: the header cell clips anything drawn outside it. */
|
|
222
|
-
&:focus-visible {
|
|
223
|
-
outline: var(--dimension-stroke-thickness-large) solid
|
|
224
|
-
var(--color-focus-ring, currentColor);
|
|
225
|
-
outline-offset: calc(-1 * var(--dimension-stroke-thickness-large));
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/* The applied ordering's chevron, which never shrinks as the label
|
|
229
|
-
does. An unsorted column shows none. */
|
|
230
|
-
& > .ds.icon {
|
|
231
|
-
flex: none;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/* The selection column, in the header and in every row: one checkbox,
|
|
237
|
-
centred in its track. Overflow is visible so a focus ring on the
|
|
238
|
-
checkbox is not clipped by the cell that holds it. */
|
|
239
|
-
.ds.data-table-body-cell.selection,
|
|
240
|
-
.ds.data-table-header-cell.selection {
|
|
241
|
-
display: flex;
|
|
242
|
-
align-items: center;
|
|
243
|
-
justify-content: center;
|
|
244
|
-
padding-inline: 0;
|
|
245
|
-
overflow: visible;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
/* The one no-rows outcome: a single cell spanning every track, saying
|
|
249
|
-
which of the four it is. */
|
|
250
|
-
.ds.data-table-body-cell.status {
|
|
251
|
-
grid-column: 1 / -1;
|
|
252
|
-
padding-block: var(--dimension-300);
|
|
253
|
-
color: var(--color-text-muted);
|
|
254
|
-
white-space: normal;
|
|
255
|
-
text-align: center;
|
|
256
|
-
|
|
257
|
-
&.error {
|
|
258
|
-
color: var(--color-text-error);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What the table says instead of its rows or beside them, or null when the
|
|
3
|
-
* rows speak for themselves.
|
|
4
|
-
*
|
|
5
|
-
* The cases stay distinct so the table never says "no results" about a
|
|
6
|
-
* collection it failed to read, or "no data" about a query that simply
|
|
7
|
-
* matched nothing. Retained rows keep rendering: rows an earlier query
|
|
8
|
-
* produced are shown as such beside the reason the current one failed,
|
|
9
|
-
* while rows kept through a failed refresh of the same query still answer
|
|
10
|
-
* it, so they are shown as they are and the error stays in `lastError`.
|
|
11
|
-
*/
|
|
12
|
-
export default function tableStatus(state) {
|
|
13
|
-
const { result } = state;
|
|
14
|
-
if (result.rows !== null && result.rows.length > 0) {
|
|
15
|
-
return result.status === "stale" && result.lastError !== null
|
|
16
|
-
? { kind: "stale", reason: result.lastError }
|
|
17
|
-
: null;
|
|
18
|
-
}
|
|
19
|
-
if (result.lastError !== null) {
|
|
20
|
-
return { kind: "error", reason: result.lastError };
|
|
21
|
-
}
|
|
22
|
-
if (result.rows === null) {
|
|
23
|
-
return { kind: "loading" };
|
|
24
|
-
}
|
|
25
|
-
const filtered = state.slice.filter.length > 0 || state.slice.search !== null;
|
|
26
|
-
return { kind: filtered ? "no-results" : "no-data" };
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=tableStatus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tableStatus.js","sourceRoot":"","sources":["../../../../src/lib/DataTable/tableStatus.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,KAAyC;IAEzC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnD,OAAO,MAAM,CAAC,MAAM,KAAK,OAAO,IAAI,MAAM,CAAC,SAAS,KAAK,IAAI;YAC3D,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE;YAC7C,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;IACrD,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;IAC9E,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/DataTable/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* React context carrying the current cell scope, installed by the table
|
|
4
|
-
* renderer per cell. `useDataViewsCell()` reads from it.
|
|
5
|
-
*/
|
|
6
|
-
const CellScopeContext = createContext(null);
|
|
7
|
-
export default CellScopeContext;
|
|
8
|
-
//# sourceMappingURL=CellScopeContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CellScopeContext.js","sourceRoot":"","sources":["../../../../src/lib/DataViews/CellScopeContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAsBtC;;;GAGG;AACH,MAAM,gBAAgB,GAAG,aAAa,CAAwB,IAAI,CAAC,CAAC;AAEpE,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* React context carrying the active DataViews provider for a root.
|
|
4
|
-
*
|
|
5
|
-
* `DataViews` writes to this context and `useDataViews()` reads from it.
|
|
6
|
-
*/
|
|
7
|
-
const DataViewsContext = createContext(null);
|
|
8
|
-
export default DataViewsContext;
|
|
9
|
-
//# sourceMappingURL=Context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../../src/lib/DataViews/Context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,aAAa,CAE5B,IAAI,CAAC,CAAC;AAEhB,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isIdentity } from "@canonical/dataviews-core";
|
|
3
|
-
import DataViewsContext from "./Context.js";
|
|
4
|
-
import { Actions, Filters, Pagination, Views } from "./common/index.js";
|
|
5
|
-
/**
|
|
6
|
-
* The DataViews root: mounts the collection provider's context for the
|
|
7
|
-
* hooks and connected parts of the composition.
|
|
8
|
-
*
|
|
9
|
-
* Pure composition — no single root element (AGENTS.md rule 6): the root is
|
|
10
|
-
* a context mount, not a DOM node.
|
|
11
|
-
*/
|
|
12
|
-
function DataViews({ provider, children }) {
|
|
13
|
-
if (!isIdentity(provider?.identity)) {
|
|
14
|
-
throw new Error("DataViews requires a provider created by createDataViewsProvider");
|
|
15
|
-
}
|
|
16
|
-
// The context stores the widest provider shape, schema and record type
|
|
17
|
-
// alike; the hooks' identity witness narrows it back at runtime.
|
|
18
|
-
const value = provider;
|
|
19
|
-
return (_jsx(DataViewsContext.Provider, { value: value, children: children }));
|
|
20
|
-
}
|
|
21
|
-
/** The connected action bar, over the current selection. */
|
|
22
|
-
DataViews.Actions = Actions;
|
|
23
|
-
/** The connected query-editing part of the composition. */
|
|
24
|
-
DataViews.Filters = Filters;
|
|
25
|
-
/** The connected window-navigation part of the composition. */
|
|
26
|
-
DataViews.Pagination = Pagination;
|
|
27
|
-
/** The connected saved-view control, over the store the provider was given. */
|
|
28
|
-
DataViews.Views = Views;
|
|
29
|
-
export default DataViews;
|
|
30
|
-
//# sourceMappingURL=Provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../../src/lib/DataViews/Provider.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,gBAAgB,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGxE;;;;;;GAMG;AACH,SAAS,SAAS,CAGhB,EAAE,QAAQ,EAAE,QAAQ,EAAiC;IACrD,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,uEAAuE;IACvE,iEAAiE;IACjE,MAAM,KAAK,GAAG,QAA+D,CAAC;IAC9E,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACpC,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC;AAED,4DAA4D;AAC5D,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;AAC5B,2DAA2D;AAC3D,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;AAC5B,+DAA+D;AAC/D,SAAS,CAAC,UAAU,GAAG,UAAU,CAAC;AAClC,+EAA+E;AAC/E,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;AAExB,eAAe,SAAS,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "@canonical/react-ds-global";
|
|
3
|
-
import { useCallback, useContext, useRef } from "react";
|
|
4
|
-
import DataViewsContext from "../../Context.js";
|
|
5
|
-
import useDataViewsState from "../../hooks/useDataViewsState.js";
|
|
6
|
-
import plural from "../../plural.js";
|
|
7
|
-
import "./styles.css";
|
|
8
|
-
/**
|
|
9
|
-
* `contrasted` is the design system's contrasted surface: it sets the
|
|
10
|
-
* surface channel the stylesheet reads, so the bar needs no colour of its
|
|
11
|
-
* own.
|
|
12
|
-
*/
|
|
13
|
-
const componentCssClassName = "ds data-table-action-bar contrasted";
|
|
14
|
-
/**
|
|
15
|
-
* What can be done with the current selection: how much is selected, the
|
|
16
|
-
* actions a caller places, and a button that clears it.
|
|
17
|
-
*
|
|
18
|
-
* The bar reads the enclosing root's selection and takes no copy of it. It
|
|
19
|
-
* is absent while nothing is selected. The count is the whole selection,
|
|
20
|
-
* across pages, not the rows on screen.
|
|
21
|
-
*
|
|
22
|
-
* When the bar leaves with the focus inside it — the selection cleared, or
|
|
23
|
-
* every target of an action succeeded — the focus returns to the control it
|
|
24
|
-
* entered the bar from, rather than to the document.
|
|
25
|
-
*
|
|
26
|
-
* @implements ds:apps.subcomponent.data_table-action_bar
|
|
27
|
-
*/
|
|
28
|
-
export default function Actions({ label = "Selection actions", indicator, children, className, onFocus, ...rest }) {
|
|
29
|
-
const provider = useContext(DataViewsContext);
|
|
30
|
-
if (provider === null) {
|
|
31
|
-
throw new Error("DataViews.Actions must be used inside a DataViews root");
|
|
32
|
-
}
|
|
33
|
-
const { selection } = provider;
|
|
34
|
-
const count = useDataViewsState(selection).ids.size;
|
|
35
|
-
// Where focus entered the bar from. React releases the bar's ref before
|
|
36
|
-
// it removes the bar, so a bar leaving with the focus inside it can still
|
|
37
|
-
// find the focus there and hand it back.
|
|
38
|
-
const origin = useRef(null);
|
|
39
|
-
const returnFocus = useCallback((bar) => () => {
|
|
40
|
-
if (bar.contains(bar.ownerDocument.activeElement) &&
|
|
41
|
-
origin.current?.isConnected) {
|
|
42
|
-
origin.current.focus();
|
|
43
|
-
}
|
|
44
|
-
}, []);
|
|
45
|
-
if (count === 0) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
return (
|
|
49
|
-
// biome-ignore lint/a11y/useSemanticElements: a fieldset groups form controls under a legend; this groups commands under the name its label gives it
|
|
50
|
-
_jsxs("div", { ...rest, ref: returnFocus, role: "group", "aria-label": label, className: [componentCssClassName, className].filter(Boolean).join(" "), onFocus: (event) => {
|
|
51
|
-
const from = event.relatedTarget;
|
|
52
|
-
if (!event.currentTarget.contains(from)) {
|
|
53
|
-
origin.current = from instanceof HTMLElement ? from : null;
|
|
54
|
-
}
|
|
55
|
-
onFocus?.(event);
|
|
56
|
-
}, children: [indicator === undefined ? (_jsx("span", { role: "status", className: "indicator", children: `${count} selected` })) : (indicator), children, _jsx(Button, { type: "button", importance: "tertiary", icon: "close", className: "deselect", "aria-label": `Deselect ${count} ${plural(count, "item")}`, onClick: () => {
|
|
57
|
-
selection.clear();
|
|
58
|
-
} })] }));
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../../../../src/lib/DataViews/common/Actions/Actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,gBAAgB,MAAM,kBAAkB,CAAC;AAChD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,cAAc,CAAC;AAEtB;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,qCAAqC,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,KAAK,GAAG,mBAAmB,EAC3B,SAAS,E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GAAG,IAAI,YAAY,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YAC7D,CAAC;YACD,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,aAEA,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,CACzB,eAAM,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,WAAW,YAAE,GAAG,KAAK,WAAW,GAAQ,CACvE,CAAC,CAAC,CAAC,CACF,SAAS,CACV,EACA,QAAQ,EACT,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,UAAU,EAAC,UAAU,EACrB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,UAAU,gBACR,YAAY,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EACxD,OAAO,EAAE,GAAG,EAAE;oBACZ,SAAS,CAAC,KAAK,EAAE,CAAC;gBACpB,CAAC,GACD,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/DataViews/common/Actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
|
|
2
|
-
|
|
3
|
-
@layer ds.components.global {
|
|
4
|
-
/**
|
|
5
|
-
* Actions styles
|
|
6
|
-
*
|
|
7
|
-
* The specification is the anatomy beside the code, `Actions.anatomy.yaml`.
|
|
8
|
-
* Every value below is one it binds; what it could not bind is recorded
|
|
9
|
-
* there, never hardcoded here.
|
|
10
|
-
*
|
|
11
|
-
* The bar sits on the design system's contrasted surface: its root carries
|
|
12
|
-
* `.contrasted`, which sets the surface channel read here, so no colour
|
|
13
|
-
* below is the bar's own.
|
|
14
|
-
*/
|
|
15
|
-
.ds.data-table-action-bar {
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
color: var(--surface-color-text, var(--color-text));
|
|
19
|
-
font-family: var(--typography-text-primary-font-family);
|
|
20
|
-
font-size: var(--typography-text-primary-font-size);
|
|
21
|
-
font-weight: var(--typography-text-primary-font-weight);
|
|
22
|
-
background-color: var(--surface-color-background, var(--color-background));
|
|
23
|
-
/* The Button reads the page's text colour for its label, not the
|
|
24
|
-
surface's; its own text channel carries the surface's to it. */
|
|
25
|
-
--button-color-text: var(--surface-color-text, var(--color-text));
|
|
26
|
-
|
|
27
|
-
& > .indicator {
|
|
28
|
-
padding-inline: var(--density-padding-inline);
|
|
29
|
-
white-space: nowrap;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* An icon-only Button collapses without a label: held to a square one
|
|
33
|
-
row tall, its icon centred and its side padding equal. */
|
|
34
|
-
& > .ds.button.deselect {
|
|
35
|
-
--button-padding-inline-end: var(--dimension-100);
|
|
36
|
-
min-block-size: var(--density-line-height-effective);
|
|
37
|
-
min-inline-size: var(--density-line-height-effective);
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/lib/DataViews/common/Actions/types.ts"],"names":[],"mappings":""}
|