-
-
Notifications
You must be signed in to change notification settings - Fork 151
docs(BTable): complete documentation for table items provider #2662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(BTable): complete documentation for table items provider #2662
Conversation
|
commit: |
Woohoo! I'll do the directives soon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Cool! I still have to do the full parity verification of the table components, but hopefully that won't turn up too much... |
Co-authored-by: Issayah <github.private.imcvv@slmail.me>
WalkthroughThis update introduces and documents new TypeScript types for a table data provider system, specifically for use with a Bootstrap Vue Next table component. It defines types for the provider context and function signature, supporting both synchronous and asynchronous data provision with sorting, filtering, and pagination. The documentation for the table component is expanded to explain pagination, provider functions, and migration details. These changes clarify how to use provider functions, update migration guidance, and add comprehensive type documentation, but do not alter any underlying logic or exported entities. Changes
Sequence Diagram(s)sequenceDiagram
participant BTable
participant ProviderFunction
participant DataSource
BTable->>ProviderFunction: Call with BTableProviderContext (sortBy, filter, currentPage, perPage)
alt Synchronous
ProviderFunction-->>BTable: Return items array
else Asynchronous
ProviderFunction-->>BTable: Return Promise<items array>
end
Note over BTable: BTable renders with provided items
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
apps/docs/src/docs/migration-guide.md (1)
662-663
: Adopt more concise phrasing for callback deprecation.Consider using the more direct suggestion from a previous review:
"The item provider no longer includes an optional callback parameter, use the async method of calling instead."
This improves clarity and matches the style of the rest of the migration guide.
🧹 Nitpick comments (3)
apps/docs/src/docs/components/demo/TableProvider.ts (1)
3-3
: Consider importingMaybePromise
from the main codebase for consistency.You define
type MaybePromise<T> = Promise<T> | T
locally, but this type already exists in the main codebase (packages/bootstrap-vue-next/src/types/MaybePromise.ts
). For consistency and to avoid duplication, consider importing it instead:-import type {BTableSortBy} from 'bootstrap-vue-next' -type MaybePromise<T> = Promise<T> | T +import type {BTableSortBy} from 'bootstrap-vue-next' +import type {MaybePromise} from 'bootstrap-vue-next'This is optional for a documentation/demo file, but helps keep types in sync.
apps/docs/src/docs/migration-guide.md (1)
650-655
: Consider rewording for conciseness.The phrase "In order to use an items provider, set the
provider
prop..." can be shortened to "To use an items provider, set theprovider
prop..." for clarity and brevity.-In order to use an items provider, set the `provider` prop to a provider function and leave the -`items` prop undefined (unlike in BootstrapVue, where the `items` prop was overloaded). See -our [documentation](/docs/components/table#using-items-provider-functions) for details. +To use an items provider, set the `provider` prop to a provider function and leave the +`items` prop undefined (unlike in BootstrapVue, where the `items` prop was overloaded). See +our [documentation](/docs/components/table#using-items-provider-functions) for details.🧰 Tools
🪛 LanguageTool
[style] ~651-~651: Consider a shorter alternative to avoid wordiness.
Context: ...sibility ### Items Provider Functions In order to use an items provider, set the `provide...(IN_ORDER_TO_PREMIUM)
apps/docs/src/docs/types.md (1)
501-513
: Consider referencing the canonicalMaybePromise
type for consistency.You define
type MaybePromise<T> = Promise<T> | T
locally, but this type already exists in the main codebase. For consistency, consider referencing or importing the canonical type in documentation and code examples.This is optional for documentation, but helps keep types in sync.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/docs/src/docs/components/demo/TableProvider.ts
(1 hunks)apps/docs/src/docs/components/table.md
(2 hunks)apps/docs/src/docs/migration-guide.md
(1 hunks)apps/docs/src/docs/types.md
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/docs/src/docs/components/demo/TableProvider.ts (1)
packages/bootstrap-vue-next/src/types/MaybePromise.ts (1)
MaybePromise
(1-1)
🪛 LanguageTool
apps/docs/src/docs/migration-guide.md
[style] ~651-~651: Consider a shorter alternative to avoid wordiness.
Context: ...sibility ### Items Provider Functions In order to use an items provider, set the `provide...
(IN_ORDER_TO_PREMIUM)
🔇 Additional comments (6)
apps/docs/src/docs/components/demo/TableProvider.ts (1)
5-15
: Type definitions are clear and correct.The type definitions for
BTableProviderContext
andBTableProvider
are accurate, generic, and match the documentation and migration guide. No issues found.apps/docs/src/docs/migration-guide.md (1)
650-663
: Migration guidance is accurate and helpful.The new section clearly explains the changes to the items provider API, context object, and deprecations. No technical issues found.
🧰 Tools
🪛 LanguageTool
[style] ~651-~651: Consider a shorter alternative to avoid wordiness.
Context: ...sibility ### Items Provider Functions In order to use an items provider, set the `provide...(IN_ORDER_TO_PREMIUM)
apps/docs/src/docs/types.md (1)
503-513
: Type definitions are accurate and match the API.The
BTableProviderContext
andBTableProvider
types are correct, generic, and align with the documented API. No issues found.apps/docs/src/docs/components/table.md (3)
56-57
: Provider function documentation is clear and accurate.The updated explanation for using a provider function is concise and correctly references the new section for details. No issues found.
832-839
: Pagination documentation is clear and correct.The new pagination section accurately describes how to use
per-page
,current-page
, and<BPagination>
. No issues found.
842-876
: Provider function usage and context documentation is excellent.The section on using items provider functions is thorough, accurate, and matches the new API and types. The context object and example usage are well explained.
* upstream/main: (184 commits) fix(BDropdown): don't calulcate the position when dropdown is not shown. docs(BTable): complete documentation for table items provider (bootstrap-vue-next#2662) fix(BPagination): right/left/up/down arrow keys now operating better after new page chosen (bootstrap-vue-next#2665) add the check to hide as well fix(useShowHide): don't run show if component already unmounted (ie. BPopover) fix(BAccordionItem): fix initial modelValue feat(BModal)!: remove autofocus and autofocusButton props and add more versitile focus prop feat(BOffcanvas)!: remove nofocus prop and add more versitile focus prop feat(BModal): return focus to previous element on close feat(BOffcanvas): return focus to previous element on close fix(BModal): set focus only once chore: release main (bootstrap-vue-next#2659) bth and btd scope attribute updates and bpagination li element needs presentation role (bootstrap-vue-next#2646) feat(BBreadcrumb): allow it to use individual breadcrumb trails with useBreadcrumb by passing prop id to component and id param to composable fixes bootstrap-vue-next#2630 Revert "fix(BButton): Consume useColorVariantClasses (bootstrap-vue-next#2640)" (bootstrap-vue-next#2654) chore: release main fixes bootstrap-vue-next#2643 feat(BTable): Expose additional functions and document them (bootstrap-vue-next#2632) fix(BButton): Consume useColorVariantClasses (bootstrap-vue-next#2640) docs(BButton): Outline variant example (bootstrap-vue-next#2639) fix(BTab): error in recursion (bootstrap-vue-next#2624) fix(BTable): correct multi-sort to not update sortby in place (bootstrap-vue-next#2644) Update BDropdownForm.vue (bootstrap-vue-next#2635) doc(BTable): Fill out light-weight, helper component and accessibility sections (bootstrap-vue-next#2629) chore: release main (bootstrap-vue-next#2626) ...
Describe the PR
MaybePromise
as it's useful in the documentation and examplesSmall replication
N/A
PR checklist
What kind of change does this PR introduce? (check at least one)
fix(...)
feat(...)
fix(...)
docs(...)
The PR fulfills these requirements:
CHANGELOG
is generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be deniedSummary by CodeRabbit
provider
prop in tables.