@bridge-ui/vue 0.16.0 → 0.17.1
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/ai/skills/bridge-ui-components/SKILL.md +2 -1
- package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +1 -1
- package/dist/Actions/actionHostRegistry.d.ts +2 -1
- package/dist/Actions/actionHostRegistry.js +11 -7
- package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/Components/Chart/composables/useChart.js +16 -14
- package/dist/Components/DataTable/DataTable.vue.d.ts +5 -3
- package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +114 -101
- package/dist/Components/DataTable/composables/useDataTable.d.ts +4 -2
- package/dist/Components/DataTable/composables/useDataTable.js +293 -273
- package/dist/Components/DataTable/dataTable.types.d.ts +35 -2
- package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/Components/Drawer/composables/useDrawer.js +68 -67
- package/dist/Components/Menu/Menu.vue_vue_type_script_setup_true_lang.js +3 -5
- package/dist/Components/Modal/Modal.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/Components/Modal/composables/useModal.js +129 -119
- package/dist/Components/Pagination/Pagination.vue.d.ts +6 -0
- package/dist/Components/Pagination/Pagination.vue_vue_type_script_setup_true_lang.js +23 -11
- package/dist/Components/Pagination/composables/usePagination.d.ts +3 -3
- package/dist/Components/Pagination/composables/usePagination.js +95 -84
- package/dist/Components/Pagination/pagination.types.d.ts +30 -2
- package/dist/Components/Resizable/Resizable.js +5 -0
- package/dist/Components/Resizable/Resizable.vue.d.ts +17 -0
- package/dist/Components/Resizable/Resizable.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/Components/Resizable/composables/useResizable.d.ts +18 -0
- package/dist/Components/Resizable/composables/useResizable.js +195 -0
- package/dist/Components/Resizable/index.d.ts +4 -0
- package/dist/Components/Resizable/index.js +4 -0
- package/dist/Components/Resizable/resizable.types.d.ts +53 -0
- package/dist/Components/Resizable/resizableInjectionKey.d.ts +111 -0
- package/dist/Components/Resizable/resizableInjectionKey.js +4 -0
- package/dist/Components/ResizableHandle/ResizableHandle.js +5 -0
- package/dist/Components/ResizableHandle/ResizableHandle.vue.d.ts +14 -0
- package/dist/Components/ResizableHandle/ResizableHandle.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/Components/ResizableHandle/composables/useResizableHandle.d.ts +35 -0
- package/dist/Components/ResizableHandle/composables/useResizableHandle.js +85 -0
- package/dist/Components/ResizableHandle/index.d.ts +3 -0
- package/dist/Components/ResizableHandle/index.js +3 -0
- package/dist/Components/ResizableHandle/resizableHandle.types.d.ts +58 -0
- package/dist/Components/ResizablePanel/ResizablePanel.js +5 -0
- package/dist/Components/ResizablePanel/ResizablePanel.vue.d.ts +24 -0
- package/dist/Components/ResizablePanel/ResizablePanel.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/Components/ResizablePanel/composables/useResizablePanel.d.ts +21 -0
- package/dist/Components/ResizablePanel/composables/useResizablePanel.js +87 -0
- package/dist/Components/ResizablePanel/index.d.ts +3 -0
- package/dist/Components/ResizablePanel/index.js +3 -0
- package/dist/Components/ResizablePanel/resizablePanel.types.d.ts +71 -0
- package/dist/Components/Snackbar/composables/useSnackbar.js +140 -146
- package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +4 -6
- package/dist/Utils/LoadingSpin.js +5 -0
- package/dist/Utils/LoadingSpin.vue.d.ts +3 -0
- package/dist/Utils/LoadingSpin.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/augments.d.ts +15 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +70 -63
- package/docs/README.md +1 -0
- package/docs/components/Chart.md +3 -1
- package/docs/components/DataTable.md +19 -0
- package/docs/components/Pagination.md +17 -5
- package/docs/components/Resizable.md +224 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -119,66 +119,73 @@ import yt from "./Provider/BridgeUIProvider.js";
|
|
|
119
119
|
import { createBridgeUI as bt } from "./Provider/createBridgeUI.js";
|
|
120
120
|
import { useRating as xt } from "./Components/Rating/composables/useRating.js";
|
|
121
121
|
import St from "./Components/Rating/Rating.js";
|
|
122
|
-
import Ct from "./Components/
|
|
123
|
-
import wt from "./Components/
|
|
124
|
-
import
|
|
125
|
-
import {
|
|
126
|
-
import
|
|
127
|
-
import {
|
|
128
|
-
import
|
|
129
|
-
import
|
|
130
|
-
import
|
|
131
|
-
import Mt from "./Components/Sidebar/
|
|
132
|
-
import Nt from "./Components/Sidebar/
|
|
133
|
-
import Pt from "./Components/Sidebar/
|
|
134
|
-
import {
|
|
135
|
-
import It from "./Components/
|
|
136
|
-
import Lt from "./Components/Sidebar/
|
|
137
|
-
import Rt from "./Components/Sidebar/
|
|
138
|
-
import zt from "./Components/Sidebar/
|
|
139
|
-
import
|
|
140
|
-
import Vt from "./Components/
|
|
141
|
-
import {
|
|
142
|
-
import Ut from "./Components/
|
|
143
|
-
import
|
|
144
|
-
import Gt from "./Components/
|
|
145
|
-
import
|
|
146
|
-
import qt from "./Components/
|
|
147
|
-
import
|
|
148
|
-
import Yt from "./Components/
|
|
149
|
-
import
|
|
150
|
-
import Zt from "./Components/
|
|
151
|
-
import
|
|
152
|
-
import $t from "./Components/
|
|
153
|
-
import
|
|
154
|
-
import {
|
|
155
|
-
import nn from "./Components/
|
|
156
|
-
import {
|
|
157
|
-
import an from "./Components/
|
|
158
|
-
import {
|
|
159
|
-
import sn from "./Components/
|
|
160
|
-
import {
|
|
161
|
-
import ln from "./Components/
|
|
162
|
-
import
|
|
163
|
-
import dn from "./Components/
|
|
164
|
-
import
|
|
165
|
-
import pn from "./Components/
|
|
166
|
-
import
|
|
167
|
-
import hn from "./Components/
|
|
168
|
-
import
|
|
169
|
-
import {
|
|
170
|
-
import vn from "./Components/
|
|
171
|
-
import yn from "./Components/
|
|
172
|
-
import
|
|
173
|
-
import {
|
|
174
|
-
import Sn from "./Components/
|
|
175
|
-
import Cn from "./Components/
|
|
176
|
-
import {
|
|
177
|
-
import
|
|
178
|
-
import En from "./Components/
|
|
179
|
-
import {
|
|
180
|
-
import On from "./Components/
|
|
181
|
-
import
|
|
182
|
-
import
|
|
183
|
-
import {
|
|
184
|
-
|
|
122
|
+
import { RESIZABLE_INJECTION_KEY as Ct } from "./Components/Resizable/resizableInjectionKey.js";
|
|
123
|
+
import { useResizable as wt } from "./Components/Resizable/composables/useResizable.js";
|
|
124
|
+
import Tt from "./Components/Resizable/Resizable.js";
|
|
125
|
+
import { useResizableHandle as Et } from "./Components/ResizableHandle/composables/useResizableHandle.js";
|
|
126
|
+
import Dt from "./Components/ResizableHandle/ResizableHandle.js";
|
|
127
|
+
import { useResizablePanel as Ot } from "./Components/ResizablePanel/composables/useResizablePanel.js";
|
|
128
|
+
import kt from "./Components/ResizablePanel/ResizablePanel.js";
|
|
129
|
+
import At from "./Components/Select/Select.js";
|
|
130
|
+
import jt from "./Components/Select/SelectOption.js";
|
|
131
|
+
import { useSidebar as Mt } from "./Components/Sidebar/composables/useSidebar.js";
|
|
132
|
+
import { useSidebarInset as Nt } from "./Components/Sidebar/composables/useSidebarInset.js";
|
|
133
|
+
import { useSidebarList as Pt } from "./Components/Sidebar/composables/useSidebarList.js";
|
|
134
|
+
import { useSidebarListItem as Ft } from "./Components/Sidebar/composables/useSidebarListItem.js";
|
|
135
|
+
import { useSidebarProvider as It } from "./Components/Sidebar/composables/useSidebarProvider.js";
|
|
136
|
+
import { useSidebarShell as Lt } from "./Components/Sidebar/composables/useSidebarShell.js";
|
|
137
|
+
import { useSidebarTrigger as Rt } from "./Components/Sidebar/composables/useSidebarTrigger.js";
|
|
138
|
+
import zt from "./Components/Sidebar/Sidebar.js";
|
|
139
|
+
import Bt from "./Components/Sidebar/SidebarInset.js";
|
|
140
|
+
import Vt from "./Components/Sidebar/SidebarList.js";
|
|
141
|
+
import { useTooltip as Ht } from "./Components/Tooltip/composables/useTooltip.js";
|
|
142
|
+
import Ut from "./Components/Tooltip/Tooltip.js";
|
|
143
|
+
import Wt from "./Components/Sidebar/SidebarListItem.js";
|
|
144
|
+
import Gt from "./Components/Sidebar/SidebarProvider.js";
|
|
145
|
+
import Kt from "./Components/Sidebar/SidebarTrigger.js";
|
|
146
|
+
import { useSkeleton as qt } from "./Components/Skeleton/composables/useSkeleton.js";
|
|
147
|
+
import Jt from "./Components/Skeleton/Skeleton.js";
|
|
148
|
+
import { useSlider as Yt } from "./Components/Slider/composables/useSlider.js";
|
|
149
|
+
import Xt from "./Components/Slider/Slider.js";
|
|
150
|
+
import { useSnackbar as Zt } from "./Components/Snackbar/composables/useSnackbar.js";
|
|
151
|
+
import Qt from "./Components/Snackbar/Snackbar.js";
|
|
152
|
+
import { useSpinner as $t } from "./Components/Spinner/composables/useSpinner.js";
|
|
153
|
+
import en from "./Components/Spinner/Spinner.js";
|
|
154
|
+
import { useStep as tn } from "./Components/Step/composables/useStep.js";
|
|
155
|
+
import nn from "./Components/Step/Step.js";
|
|
156
|
+
import { useStepper as rn } from "./Components/Stepper/composables/useStepper.js";
|
|
157
|
+
import an from "./Components/Stepper/Stepper.js";
|
|
158
|
+
import { useSwitch as on } from "./Components/Switch/composables/useSwitch.js";
|
|
159
|
+
import sn from "./Components/Switch/Switch.js";
|
|
160
|
+
import { TABS_INJECTION_KEY as cn } from "./Components/Tabs/tabsInjectionKey.js";
|
|
161
|
+
import { useTab as ln } from "./Components/Tab/composables/useTab.js";
|
|
162
|
+
import un from "./Components/Tab/Tab.js";
|
|
163
|
+
import { useTabItem as dn } from "./Components/TabItem/composables/useTabItem.js";
|
|
164
|
+
import fn from "./Components/TabItem/TabItem.js";
|
|
165
|
+
import { useTabList as pn } from "./Components/TabList/composables/useTabList.js";
|
|
166
|
+
import mn from "./Components/TabList/TabList.js";
|
|
167
|
+
import { useTabPanel as hn } from "./Components/TabPanel/composables/useTabPanel.js";
|
|
168
|
+
import gn from "./Components/TabPanel/TabPanel.js";
|
|
169
|
+
import { useTabs as _n } from "./Components/Tabs/composables/useTabs.js";
|
|
170
|
+
import vn from "./Components/Tabs/Tabs.js";
|
|
171
|
+
import { useTextarea as yn } from "./Components/Textarea/composables/useTextarea.js";
|
|
172
|
+
import bn from "./Components/Textarea/Textarea.js";
|
|
173
|
+
import { useTextField as xn } from "./Components/TextField/composables/useTextField.js";
|
|
174
|
+
import Sn from "./Components/TextField/TextField.js";
|
|
175
|
+
import { useTimeField as Cn } from "./Components/TimeField/composables/useTimeField.js";
|
|
176
|
+
import { useTimePicker as wn } from "./Components/TimePicker/composables/useTimePicker.js";
|
|
177
|
+
import Tn from "./Components/TimePicker/TimePicker.js";
|
|
178
|
+
import En from "./Components/TimeField/TimeField.js";
|
|
179
|
+
import { useTimeRangeField as Dn } from "./Components/TimeRangeField/composables/useTimeRangeField.js";
|
|
180
|
+
import { useTimeRangePicker as On } from "./Components/TimeRangePicker/composables/useTimeRangePicker.js";
|
|
181
|
+
import kn from "./Components/TimeRangePicker/TimeRangePicker.js";
|
|
182
|
+
import An from "./Components/TimeRangeField/TimeRangeField.js";
|
|
183
|
+
import { TOGGLE_GROUP_INJECTION_KEY as jn } from "./Components/ToggleGroup/toggleGroupInjectionKey.js";
|
|
184
|
+
import { useToggleGroup as Mn } from "./Components/ToggleGroup/composables/useToggleGroup.js";
|
|
185
|
+
import Nn from "./Components/ToggleGroup/ToggleGroup.js";
|
|
186
|
+
import { useToggleItem as Pn } from "./Components/ToggleItem/composables/useToggleItem.js";
|
|
187
|
+
import Fn from "./Components/ToggleItem/ToggleItem.js";
|
|
188
|
+
import { SEMANTIC_ICON_NAMES as In, interpolateMessage as Ln, resolveMessage as Rn, selectPluralMessage as zn } from "@bridge-ui/core/Adapters";
|
|
189
|
+
import { cn as Bn } from "@bridge-ui/core/Utils";
|
|
190
|
+
import { BRIDGE_UI_DEFAULT_GLOBAL as Vn, mergeBridgeUIComponents as Hn, mergeBridgeUIGlobal as Un, resolveBridgeUIOptions as Wn } from "@bridge-ui/core/Config";
|
|
191
|
+
export { c as ACCORDION_INJECTION_KEY, p as Accordion, g as AccordionItem, x as ActionFooter, C as Alert, Q as Autocomplete, $ as AutocompleteOption, ee as Avatar, Vn as BRIDGE_UI_DEFAULT_GLOBAL, v as BUTTON_GROUP_INJECTION_KEY, ne as Badge, re as BaseField, ce as Breadcrumb, se as BreadcrumbItem, yt as BridgeUIProvider, b as Button, ue as ButtonGroup, ve as Calendar, pe as CalendarDate, he as CalendarMonth, Se as CalendarRange, _e as CalendarYear, we as Card, Ee as Carousel, Oe as CarouselSlide, Me as Checkbox, M as Chip, Ie as ColorField, Fe as ColorPicker, Be as DateField, ze as DatePicker, We as DateRangeField, Ue as DateRangePicker, Xe as DateTimeField, Ye as DateTimePicker, et as DateTimeRangeField, $e as DateTimeRangePicker, xe as Divider, z as Drawer, nt as EmptyState, W as FieldOverlay, ot as FileUpload, at as FileUploadItem, Ae as FormControl, F as FormField, h as Icon, P as Label, ct as Link, K as List, q as ListItem, J as ListSection, Z as Listbox, V as Menu, U as Modal, ut as NumberField, ft as OtpField, mt as Pagination, gt as PasswordField, X as Progress, Ct as RESIZABLE_INJECTION_KEY, vt as Radio, St as Rating, Tt as Resizable, Dt as ResizableHandle, kt as ResizablePanel, In as SEMANTIC_ICON_NAMES, At as Select, jt as SelectOption, zt as Sidebar, Bt as SidebarInset, Vt as SidebarList, Wt as SidebarListItem, Gt as SidebarProvider, Kt as SidebarTrigger, Jt as Skeleton, Xt as Slider, Qt as Snackbar, en as Spinner, nn as Step, an as Stepper, sn as Switch, cn as TABS_INJECTION_KEY, jn as TOGGLE_GROUP_INJECTION_KEY, un as Tab, fn as TabItem, mn as TabList, gn as TabPanel, vn as Tabs, Sn as TextField, bn as Textarea, En as TimeField, Je as TimePanel, Tn as TimePicker, An as TimeRangeField, kn as TimeRangePicker, Nn as ToggleGroup, Fn as ToggleItem, Ut as Tooltip, Bn as cn, bt as createBridgeUI, T as findFirstEnabledOptionIndex, E as findLastEnabledOptionIndex, D as getListboxActiveDescendantId, O as getListboxOptionId, Ln as interpolateMessage, Hn as mergeBridgeUIComponents, Un as mergeBridgeUIGlobal, k as moveListboxHighlight, Wn as resolveBridgeUIOptions, Rn as resolveMessage, zn as selectPluralMessage, t as setDateAdapterForTests, r as setI18nAdapterForTests, o as setIconAdapterForTests, f as useAccordion, m as useAccordionItem, _ as useActionFooter, S as useAlert, te as useBadge, ie as useBaseField, ae as useBreadcrumb, oe as useBreadcrumbItem, l as useBreakpoint, e as useBridgeUI, u as useBridgeUIComponent, d as useBridgeUIMergedRegistryClasses, y as useButton, le as useButtonGroup, de as useCalendar, fe as useCalendarDate, me as useCalendarMonth, ye as useCalendarRange, ge as useCalendarYear, Ce as useCard, Te as useCarousel, De as useCarouselSlide, je as useCheckbox, j as useChip, Ne as useColorField, Pe as useColorPicker, n as useDateAdapter, Le as useDateField, Re as useDatePicker, Ve as useDateRangeField, He as useDateRangePicker, Ge as useDateTimeField, Ke as useDateTimePicker, Ze as useDateTimeRangeField, Qe as useDateTimeRangePicker, be as useDivider, R as useDrawer, tt as useEmptyState, L as useFieldOverlay, rt as useFileUpload, it as useFileUploadItem, ke as useFormControl, w as useFormField, i as useI18nAdapter, s as useIconAdapter, N as useLabel, st as useLink, G as useList, I as useListbox, A as useListboxNavigation, B as useMenu, H as useModal, lt as useNumberField, dt as useOtpField, pt as usePagination, ht as usePasswordField, Y as useProgress, _t as useRadio, xt as useRating, wt as useResizable, Et as useResizableHandle, Ot as useResizablePanel, a as useResolveMessage, Mt as useSidebar, Nt as useSidebarInset, Pt as useSidebarList, Ft as useSidebarListItem, It as useSidebarProvider, Lt as useSidebarShell, Rt as useSidebarTrigger, qt as useSkeleton, Yt as useSlider, Zt as useSnackbar, $t as useSpinner, tn as useStep, rn as useStepper, on as useSwitch, ln as useTab, dn as useTabItem, pn as useTabList, hn as useTabPanel, _n as useTabs, xn as useTextField, yn as useTextarea, Cn as useTimeField, qe as useTimePanel, wn as useTimePicker, Dn as useTimeRangeField, On as useTimeRangePicker, Mn as useToggleGroup, Pn as useToggleItem, Ht as useTooltip };
|
package/docs/README.md
CHANGED
|
@@ -55,6 +55,7 @@ Component reference for **Vue**. This folder ships with the npm package.
|
|
|
55
55
|
- [Progress](./components/Progress.md)
|
|
56
56
|
- [Radio](./components/Radio.md)
|
|
57
57
|
- [Rating](./components/Rating.md)
|
|
58
|
+
- [Resizable](./components/Resizable.md)
|
|
58
59
|
- [RichTextEditor](./components/RichTextEditor.md)
|
|
59
60
|
- [Select](./components/Select.md)
|
|
60
61
|
- [Sidebar](./components/Sidebar.md)
|
package/docs/components/Chart.md
CHANGED
|
@@ -125,6 +125,8 @@ Legend entries are toggle buttons: click to hide or show a series, hover or focu
|
|
|
125
125
|
|
|
126
126
|
### Loading and empty
|
|
127
127
|
|
|
128
|
+
While `loading` is true, the plot stays visible behind a translucent overlay with a spinner, and the root gets `aria-busy`. Use the `loading` slot to replace the spinner.
|
|
129
|
+
|
|
128
130
|
```vue
|
|
129
131
|
<Chart :loading="isLoading" :categories="months">
|
|
130
132
|
<ChartSeries name="Revenue" :data="revenue" />
|
|
@@ -189,7 +191,7 @@ Theme tokens (`Chart.tokens.theme`) set the grid, axis, and label colors as Tail
|
|
|
189
191
|
| `categories` | `string[]` | required | Category labels; one value per category per series. |
|
|
190
192
|
| `classes` | `ChartClasses` | — | `root`, `plot`, `loading`, `empty`, `table`. |
|
|
191
193
|
| `height` | `number \| string` | `280` | Plot height. |
|
|
192
|
-
| `loading` | `boolean` | `false` | Shows the
|
|
194
|
+
| `loading` | `boolean` | `false` | Shows the spinner overlay. |
|
|
193
195
|
| `palette` | `ChartSeriesColor[]` | primary, info, success … | Series colors in order. |
|
|
194
196
|
| `size` | `ChartSize` | `"md"` | Density of labels, legend, and tooltip. |
|
|
195
197
|
| `summary` | `string` | generated | Accessible description of the plot. |
|
|
@@ -133,6 +133,25 @@ When `page` and `page-count` (or `total-count`) are set, DataTable does not sort
|
|
|
133
133
|
/>
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
### Cursor pagination
|
|
137
|
+
|
|
138
|
+
For APIs that return `next_cursor` / `prev_cursor` instead of a page total, bind `v-model:cursor` (or pass `next-cursor` / `prev-cursor`). DataTable then does not sort, filter, or slice `rows` locally, and the footer shows a previous / next `Pagination` instead of the "Page X of Y" label. The per-page Select stays. A `null` cursor disables its control:
|
|
139
|
+
|
|
140
|
+
```vue
|
|
141
|
+
<DataTable
|
|
142
|
+
:rows="audits"
|
|
143
|
+
:columns="columns"
|
|
144
|
+
v-model:cursor="cursor"
|
|
145
|
+
v-model:sorting="sorting"
|
|
146
|
+
v-model:filters="filters"
|
|
147
|
+
v-model:per-page="perPage"
|
|
148
|
+
:next-cursor="pagination.next_cursor"
|
|
149
|
+
:prev-cursor="pagination.prev_cursor"
|
|
150
|
+
/>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
DataTable never resets the cursor. Set it back to `null` in the app when sorting, filters, or per-page change. `#pagination` also receives `cursor`, `nextCursor`, `prevCursor`, `hasNext`, `hasPrevious`, `onNext`, and `onPrevious`. `customProps.cursorPagination` forwards extra props to the built-in cursor pager. Do not combine cursor props with `page` + `page-count` / `total-count`: cursor paging wins and a warning is logged in development.
|
|
154
|
+
|
|
136
155
|
### Empty, loading, and footer
|
|
137
156
|
|
|
138
157
|
Empty rows render `EmptyState` at the table `size`, with the semantic `inbox` icon and the i18n title `"No data"`. `#empty` replaces it. `loading` keeps the table visible. `loadingVariant="overlay"` (default) dims the table with a spin; `loadingVariant="bar"` dims the table and draws a progress line under the header. `#loading` replaces the indicator. `#footer` renders below the table, above the chrome footer:
|
|
@@ -51,15 +51,27 @@ Applies to `ghost` and `text` item corners and the `outlined` group / edge contr
|
|
|
51
51
|
|
|
52
52
|
### Simple (cursor / prev–next only)
|
|
53
53
|
|
|
54
|
-
For APIs that
|
|
54
|
+
For APIs that return `next_cursor` / `prev_cursor` instead of a page total. `v-model:cursor` is set to `next-cursor` or `prev-cursor` when the user navigates, and a `null` cursor disables its control:
|
|
55
55
|
|
|
56
56
|
```vue
|
|
57
57
|
<Pagination
|
|
58
58
|
mode="simple"
|
|
59
|
+
v-model:cursor="cursor"
|
|
59
60
|
aria-label="Pagination"
|
|
60
|
-
:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
:next-cursor="pagination.next_cursor"
|
|
62
|
+
:prev-cursor="pagination.prev_cursor"
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`has-next` / `has-previous` override the cursor defaults. `next` / `previous` still fire (after `update:cursor`), so prev/next without cursors keeps working:
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<Pagination
|
|
70
|
+
mode="simple"
|
|
71
|
+
:has-next="hasMore"
|
|
72
|
+
v-on:next="loadNext"
|
|
73
|
+
aria-label="Pagination"
|
|
74
|
+
:has-previous="page > 1"
|
|
75
|
+
v-on:previous="loadPrevious"
|
|
64
76
|
/>
|
|
65
77
|
```
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Resizable
|
|
2
|
+
|
|
3
|
+
Panels the user can resize by dragging the handle between them or with the keyboard. `Resizable` is the group, `ResizablePanel` is each panel, and `ResizableHandle` sits between two panels.
|
|
4
|
+
|
|
5
|
+
Sizes are percentages of the group. Panels without `default-size` share the space left. Panel order follows the DOM, so panels and handles can be wrapped or rendered with `v-if`.
|
|
6
|
+
|
|
7
|
+
The group fills its parent (`h-full w-full`). Give the parent, or the group through `class`, a height when the panels stack or when the page does not set one.
|
|
8
|
+
|
|
9
|
+
## Import
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { Resizable } from "@bridge-ui/vue/Components/Resizable";
|
|
13
|
+
import { ResizableHandle } from "@bridge-ui/vue/Components/ResizableHandle";
|
|
14
|
+
import { ResizablePanel } from "@bridge-ui/vue/Components/ResizablePanel";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Examples
|
|
18
|
+
|
|
19
|
+
### Usage
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<Resizable class="h-64 rounded-lg border">
|
|
23
|
+
<ResizablePanel :default-size="25">Sidebar</ResizablePanel>
|
|
24
|
+
<ResizableHandle />
|
|
25
|
+
<ResizablePanel>Content</ResizablePanel>
|
|
26
|
+
</Resizable>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Vertical
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<Resizable class="h-96" orientation="vertical">
|
|
33
|
+
<ResizablePanel>Editor</ResizablePanel>
|
|
34
|
+
<ResizableHandle />
|
|
35
|
+
<ResizablePanel :default-size="30">Console</ResizablePanel>
|
|
36
|
+
</Resizable>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Without a grip
|
|
40
|
+
|
|
41
|
+
Each handle shows a grip by default. `hide-grip` leaves only the line.
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<Resizable class="h-64">
|
|
45
|
+
<ResizablePanel>One</ResizablePanel>
|
|
46
|
+
<ResizableHandle hide-grip />
|
|
47
|
+
<ResizablePanel>Two</ResizablePanel>
|
|
48
|
+
</Resizable>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Size limits
|
|
52
|
+
|
|
53
|
+
`min-size` and `max-size` bound a panel while dragging and with the keyboard. Once the panel shrinking next to the handle reaches its `min-size`, the drag goes on to shrink the panels beyond it.
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<Resizable class="h-64">
|
|
57
|
+
<ResizablePanel :min-size="15" :max-size="40" :default-size="25">
|
|
58
|
+
Sidebar
|
|
59
|
+
</ResizablePanel>
|
|
60
|
+
<ResizableHandle />
|
|
61
|
+
<ResizablePanel :min-size="30">Content</ResizablePanel>
|
|
62
|
+
</Resizable>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Nested groups
|
|
66
|
+
|
|
67
|
+
```vue
|
|
68
|
+
<Resizable class="h-96">
|
|
69
|
+
<ResizablePanel :default-size="25">Files</ResizablePanel>
|
|
70
|
+
<ResizableHandle />
|
|
71
|
+
<ResizablePanel>
|
|
72
|
+
<Resizable orientation="vertical">
|
|
73
|
+
<ResizablePanel>Editor</ResizablePanel>
|
|
74
|
+
<ResizableHandle />
|
|
75
|
+
<ResizablePanel :default-size="30">Terminal</ResizablePanel>
|
|
76
|
+
</Resizable>
|
|
77
|
+
</ResizablePanel>
|
|
78
|
+
</Resizable>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Collapsible panel
|
|
82
|
+
|
|
83
|
+
A `collapsible` panel collapses to `collapsed-size` (default `0`) once it is dragged past half of `min-size`. `Enter` on the handle collapses it and expands it back to its last size. Bind `v-model:collapsed` to collapse or expand it from outside.
|
|
84
|
+
|
|
85
|
+
```vue
|
|
86
|
+
<Button @click="collapsed = !collapsed">Toggle sidebar</Button>
|
|
87
|
+
|
|
88
|
+
<Resizable class="h-64">
|
|
89
|
+
<ResizablePanel
|
|
90
|
+
collapsible
|
|
91
|
+
:min-size="15"
|
|
92
|
+
:default-size="25"
|
|
93
|
+
v-model:collapsed="collapsed"
|
|
94
|
+
>
|
|
95
|
+
Sidebar
|
|
96
|
+
</ResizablePanel>
|
|
97
|
+
<ResizableHandle />
|
|
98
|
+
<ResizablePanel>Content</ResizablePanel>
|
|
99
|
+
</Resizable>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`collapsed-size` keeps a strip visible, for example for an icon rail:
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<ResizablePanel collapsible :min-size="20" :collapsed-size="5">
|
|
106
|
+
Sidebar
|
|
107
|
+
</ResizablePanel>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Saving the layout
|
|
111
|
+
|
|
112
|
+
`@layout-change` receives every panel size, in order. Feed saved sizes back through `default-size`.
|
|
113
|
+
|
|
114
|
+
```vue
|
|
115
|
+
<script setup lang="ts">
|
|
116
|
+
const saved = JSON.parse(localStorage.getItem("layout") ?? "[30, 70]");
|
|
117
|
+
|
|
118
|
+
function save(layout: number[]) {
|
|
119
|
+
localStorage.setItem("layout", JSON.stringify(layout));
|
|
120
|
+
}
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<template>
|
|
124
|
+
<Resizable class="h-64" @layout-change="save">
|
|
125
|
+
<ResizablePanel :default-size="saved[0]">Sidebar</ResizablePanel>
|
|
126
|
+
<ResizableHandle />
|
|
127
|
+
<ResizablePanel :default-size="saved[1]">Content</ResizablePanel>
|
|
128
|
+
</Resizable>
|
|
129
|
+
</template>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`ResizablePanel` also emits `resize` with its own size.
|
|
133
|
+
|
|
134
|
+
### Disabled
|
|
135
|
+
|
|
136
|
+
`disabled` on the group locks every handle. On a handle, it locks only that handle.
|
|
137
|
+
|
|
138
|
+
```vue
|
|
139
|
+
<Resizable disabled class="h-64">
|
|
140
|
+
<ResizablePanel>One</ResizablePanel>
|
|
141
|
+
<ResizableHandle />
|
|
142
|
+
<ResizablePanel>Two</ResizablePanel>
|
|
143
|
+
</Resizable>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Right to left
|
|
147
|
+
|
|
148
|
+
`dir="rtl"` flips the horizontal drag and arrow keys, so the panel on the right is the first one.
|
|
149
|
+
|
|
150
|
+
```vue
|
|
151
|
+
<Resizable dir="rtl" class="h-64">
|
|
152
|
+
<ResizablePanel :default-size="25">Sidebar</ResizablePanel>
|
|
153
|
+
<ResizableHandle />
|
|
154
|
+
<ResizablePanel>Content</ResizablePanel>
|
|
155
|
+
</Resizable>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Classes and grip slot
|
|
159
|
+
|
|
160
|
+
```vue
|
|
161
|
+
<ResizableHandle
|
|
162
|
+
:classes="{
|
|
163
|
+
root: 'bg-primary-200',
|
|
164
|
+
grip: 'flex h-5 w-3 items-center justify-center text-xs',
|
|
165
|
+
}"
|
|
166
|
+
>
|
|
167
|
+
<template #grip>⋮</template>
|
|
168
|
+
</ResizableHandle>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Keyboard
|
|
172
|
+
|
|
173
|
+
- Each handle is a focusable `separator`. Its value is the size of the panel before it
|
|
174
|
+
- Horizontal: `ArrowLeft` / `ArrowRight`. Vertical: `ArrowUp` / `ArrowDown`. `dir="rtl"` swaps the horizontal arrows
|
|
175
|
+
- Arrow keys move by `keyboard-step` (default `10`)
|
|
176
|
+
- `Home` shrinks the panel before the handle to its `min-size` (or collapses it when `collapsible`). `End` grows it to its `max-size`
|
|
177
|
+
- `Enter` collapses or expands a `collapsible` panel before the handle
|
|
178
|
+
|
|
179
|
+
## Props
|
|
180
|
+
|
|
181
|
+
### Resizable
|
|
182
|
+
|
|
183
|
+
| Prop | Type | Default | Description |
|
|
184
|
+
| -------------- | ---------------------------- | -------------- | -------------------------------------------- |
|
|
185
|
+
| `classes` | `ResizableClasses` | — | Classes for the group root. |
|
|
186
|
+
| `disabled` | `boolean` | `false` | Lock every handle in the group. |
|
|
187
|
+
| `keyboardStep` | `number` | `10` | Percent an arrow key moves a focused handle. |
|
|
188
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Axis the panels are laid out on. |
|
|
189
|
+
|
|
190
|
+
| Event | Payload | Description |
|
|
191
|
+
| -------------- | ------------------ | ----------------------------------------------------- |
|
|
192
|
+
| `layoutChange` | `layout: number[]` | Every panel size (percent), in order, after a change. |
|
|
193
|
+
|
|
194
|
+
### ResizablePanel
|
|
195
|
+
|
|
196
|
+
| Prop | Type | Default | Description |
|
|
197
|
+
| --------------- | ----------------------- | ------- | --------------------------------------------------------------------- |
|
|
198
|
+
| `classes` | `ResizablePanelClasses` | — | Classes for the panel. |
|
|
199
|
+
| `collapsed` | `boolean` | — | Collapsed state, bound with `v-model:collapsed`. Needs `collapsible`. |
|
|
200
|
+
| `collapsedSize` | `number` | `0` | Size while collapsed, in percent. |
|
|
201
|
+
| `collapsible` | `boolean` | `false` | Let the panel collapse past half of `minSize`. |
|
|
202
|
+
| `defaultSize` | `number` | — | Initial size, in percent. Panels without one share the rest. |
|
|
203
|
+
| `maxSize` | `number` | `100` | Largest size, in percent. |
|
|
204
|
+
| `minSize` | `number` | `0` | Smallest size while expanded, in percent. |
|
|
205
|
+
|
|
206
|
+
| Event | Payload | Description |
|
|
207
|
+
| ------------------ | -------------------- | --------------------------------- |
|
|
208
|
+
| `resize` | `size: number` | The panel size changed (percent). |
|
|
209
|
+
| `update:collapsed` | `collapsed: boolean` | The panel collapsed or expanded. |
|
|
210
|
+
|
|
211
|
+
### ResizableHandle
|
|
212
|
+
|
|
213
|
+
| Prop | Type | Default | Description |
|
|
214
|
+
| ------------- | ---------------------------- | ------- | ------------------------------------- |
|
|
215
|
+
| `classes` | `ResizableHandleClasses` | — | Classes for `root` and `grip`. |
|
|
216
|
+
| `customProps` | `ResizableHandleCustomProps` | — | Extra props for the `grip`. |
|
|
217
|
+
| `disabled` | `boolean` | `false` | Lock this handle. |
|
|
218
|
+
| `hideGrip` | `boolean` | `false` | Hide the grip and show only the line. |
|
|
219
|
+
|
|
220
|
+
Slot `grip`: content inside the grip.
|
|
221
|
+
|
|
222
|
+
## Related components
|
|
223
|
+
|
|
224
|
+
Sidebar, Divider
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.17.1",
|
|
5
5
|
"author": "BridgeUI",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"name": "@bridge-ui/vue",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
"dependencies": {
|
|
112
|
-
"@bridge-ui/core": "^0.
|
|
112
|
+
"@bridge-ui/core": "^0.17.1",
|
|
113
113
|
"@tailwindcss/typography": "^0.5.20",
|
|
114
114
|
"clsx": "^2.1.1",
|
|
115
115
|
"es-toolkit": "^1.52.0",
|