@vuetify/v0 1.0.0-alpha.2 → 1.0.0-alpha.4
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/README.md +6 -1
- package/dist/adapter-BSKx9WQ7.mjs +4 -0
- package/dist/{index-CT5SCLzW.d.mts → adapter-C6JmOyYo.d.mts} +6 -9
- package/dist/{adapter-gQ2SNKZq.mjs → adapter-C9cR4AcY.mjs} +248 -5
- package/dist/adapter-Chznb9Ju.mjs +4 -0
- package/dist/{adapter-DlX3FA3A.d.mts → adapter-Cr7Bl4la.d.mts} +3 -7
- package/dist/adapter-D8zizQVP.mjs +4 -0
- package/dist/adapter-DgBBe_BW.d.mts +17 -0
- package/dist/adapter-Dzyrlbz7.d.mts +98 -0
- package/dist/adapter-o8r-2vUn.d.mts +11 -0
- package/dist/adapters-B25KaYU4.mjs +2 -0
- package/dist/adapters-BcddLSNs.mjs +4 -0
- package/dist/adapters-D64TORDu.mjs +2 -0
- package/dist/adapters-Dv74Jk6A.mjs +5 -0
- package/dist/adapters-t6QC-zE8.mjs +3 -0
- package/dist/browser/index.js +5167 -597
- package/dist/components/index.d.mts +3 -3
- package/dist/components/index.mjs +2 -2
- package/dist/{components-CqDewYTU.mjs → components-BWxMSWr7.mjs} +3780 -417
- package/dist/composables/index.d.mts +19 -19
- package/dist/composables/index.mjs +31 -29
- package/dist/{consola-BdgyPEfx.d.mts → consola-Crr4qbeI.d.mts} +2 -2
- package/dist/{consola-Ceox8BWi.mjs → consola-DYvbPNbF.mjs} +3 -1
- package/dist/constants/index.d.mts +1 -1
- package/dist/constants/index.mjs +2 -2
- package/dist/{createDataTable-rXBqGglI.mjs → createDataTable-DDr2yY-A.mjs} +30 -29
- package/dist/{createGroup-BU4olYtB.mjs → createGroup-BSGtfBUE.mjs} +3 -3
- package/dist/{createRegistry-Dl-bSSTr.mjs → createRegistry-Db_juawd.mjs} +78 -41
- package/dist/{createSelection-Csaa-C8p.mjs → createSelection-BeKZMxha.mjs} +3 -3
- package/dist/{createSingle-8xbHAIpY.mjs → createSingle-Dms2efxr.mjs} +1 -1
- package/dist/{createTokens-lNg2M_P_.mjs → createTokens-B1lwHZvO.mjs} +2 -2
- package/dist/data-table/adapters/client/index.d.mts +2 -2
- package/dist/data-table/adapters/client/index.mjs +2 -2
- package/dist/data-table/adapters/index.d.mts +5 -5
- package/dist/data-table/adapters/index.mjs +6 -6
- package/dist/data-table/adapters/server/index.d.mts +2 -2
- package/dist/data-table/adapters/server/index.mjs +2 -2
- package/dist/data-table/adapters/virtual/index.d.mts +2 -2
- package/dist/data-table/adapters/virtual/index.mjs +2 -2
- package/dist/data-table/index.d.mts +6 -6
- package/dist/data-table/index.mjs +6 -6
- package/dist/date/index.d.mts +3 -3
- package/dist/date/index.mjs +11 -4
- package/dist/features/adapters/flagsmith/index.d.mts +2 -2
- package/dist/features/adapters/flagsmith/index.mjs +2 -2
- package/dist/features/adapters/launchdarkly/index.d.mts +2 -2
- package/dist/features/adapters/launchdarkly/index.mjs +2 -2
- package/dist/features/adapters/posthog/index.d.mts +2 -2
- package/dist/features/adapters/posthog/index.mjs +2 -2
- package/dist/features/index.d.mts +3 -3
- package/dist/features/index.mjs +2 -1
- package/dist/{flagsmith-Dbh1h8WF.mjs → flagsmith-Cu93hUIF.mjs} +6 -4
- package/dist/{index-BzFHTW59.d.mts → flagsmith-ygKMImos.d.mts} +4 -4
- package/dist/{globals-CKdzjeLe.mjs → globals-BAe6tA_x.mjs} +1 -1
- package/dist/{index-GOpjKzaJ.d.mts → index-B3-FstpY.d.mts} +25 -2
- package/dist/{index-BJGcVy7e.d.mts → index-BA7YU2xY.d.mts} +5 -5
- package/dist/{index-BxKMMWnQ.d.mts → index-BfpLkDR_.d.mts} +1113 -74
- package/dist/{index-DE3bWw11.d.mts → index-Cw04PFVO.d.mts} +92 -48
- package/dist/index-DewYtDsc.d.mts +4 -0
- package/dist/{index-B7cqgTBL.d.mts → index-jQPkwo3G.d.mts} +598 -363
- package/dist/index.d.mts +23 -23
- package/dist/index.mjs +35 -33
- package/dist/json/attributes.json +57 -1
- package/dist/json/importMap.json +16 -0
- package/dist/json/tags.json +29 -0
- package/dist/json/web-types.json +181 -3
- package/dist/launchdarkly-BJR4vbbV.d.mts +13 -0
- package/dist/{launchdarkly-BKtW-idu.mjs → launchdarkly-CLGtJCsI.mjs} +6 -4
- package/dist/locale/adapters/index.d.mts +3 -3
- package/dist/locale/adapters/index.mjs +4 -3
- package/dist/locale/adapters/v0/index.d.mts +2 -2
- package/dist/locale/adapters/v0/index.mjs +2 -2
- package/dist/locale/adapters/vue-i18n/index.d.mts +3 -3
- package/dist/locale/adapters/vue-i18n/index.mjs +4 -2
- package/dist/locale/index.d.mts +4 -4
- package/dist/locale/index.mjs +4 -3
- package/dist/logger/adapters/consola/index.d.mts +1 -1
- package/dist/logger/adapters/consola/index.mjs +1 -1
- package/dist/logger/adapters/index.d.mts +5 -5
- package/dist/logger/adapters/index.mjs +6 -5
- package/dist/logger/adapters/pino/index.d.mts +1 -1
- package/dist/logger/adapters/pino/index.mjs +1 -1
- package/dist/logger/adapters/v0/index.d.mts +2 -2
- package/dist/logger/adapters/v0/index.mjs +2 -2
- package/dist/logger/index.d.mts +6 -6
- package/dist/logger/index.mjs +6 -5
- package/dist/{memory-CeSQE-QV.d.mts → memory-B0w39kno.d.mts} +9 -9
- package/dist/{memory-oYBvtkgx.mjs → memory-BMpJcQjQ.mjs} +13 -3
- package/dist/notifications/index.d.mts +30 -4
- package/dist/notifications/index.mjs +187 -126
- package/dist/palettes/ant/index.d.mts +1 -1
- package/dist/palettes/index.d.mts +3 -3
- package/dist/palettes/leonardo/generate/index.mjs +5 -1
- package/dist/palettes/material/index.d.mts +1 -1
- package/dist/palettes/md1/index.d.mts +1 -1
- package/dist/palettes/md2/index.d.mts +1 -1
- package/dist/palettes/radix/index.d.mts +1 -1
- package/dist/palettes/tailwind/index.d.mts +1 -1
- package/dist/permissions/adapters/index.d.mts +2 -2
- package/dist/permissions/adapters/index.mjs +3 -3
- package/dist/permissions/adapters/v0/index.d.mts +2 -2
- package/dist/permissions/adapters/v0/index.mjs +2 -2
- package/dist/permissions/index.d.mts +2 -2
- package/dist/permissions/index.mjs +3 -3
- package/dist/{pino-9L79n6y6.mjs → pino-CIcYlW3u.mjs} +3 -1
- package/dist/{pino-DNfCEb0p.d.mts → pino-NmR7X0s4.d.mts} +2 -2
- package/dist/{posthog-DZNnPXxS.mjs → posthog-B3go2aCh.mjs} +7 -5
- package/dist/posthog-CQntUXFO.d.mts +13 -0
- package/dist/rules/index.d.mts +1 -1
- package/dist/rules/index.mjs +1 -1
- package/dist/{server-3ilWFwqe.d.mts → server-DQK305lc.d.mts} +5 -5
- package/dist/{server-y7zLSCSx.mjs → server-ZFXbgQoY.mjs} +4 -3
- package/dist/storage/adapters/index.d.mts +3 -3
- package/dist/storage/adapters/index.mjs +2 -2
- package/dist/storage/adapters/memory/index.d.mts +2 -2
- package/dist/storage/adapters/memory/index.mjs +2 -2
- package/dist/storage/index.d.mts +4 -4
- package/dist/storage/index.mjs +3 -3
- package/dist/theme/adapters/index.d.mts +2 -2
- package/dist/theme/adapters/index.mjs +4 -4
- package/dist/theme/adapters/unhead/index.d.mts +1 -1
- package/dist/theme/adapters/unhead/index.mjs +1 -1
- package/dist/theme/adapters/v0/index.d.mts +1 -1
- package/dist/theme/adapters/v0/index.mjs +1 -1
- package/dist/theme/index.d.mts +1 -1
- package/dist/theme/index.mjs +3 -3
- package/dist/types/index.d.mts +1 -1
- package/dist/{unhead-DZiD-4Tx.mjs → unhead-dPyVkgiJ.mjs} +2 -2
- package/dist/{useClickOutside-CmCUD_Pf.mjs → useClickOutside-B8naChaQ.mjs} +1405 -288
- package/dist/{useFeatures-ZIvzzuEV.mjs → useFeatures-x2iKp0C8.mjs} +7 -10
- package/dist/{useLocale-DTJx3aKR.mjs → useLocale-BUms59Bw.mjs} +6 -6
- package/dist/{useLogger-BBTcMN61.mjs → useLogger-DPSSa-YR.mjs} +4 -4
- package/dist/{useNotifications-H4knpvNw.mjs → useNotifications-BPTmZWQy.mjs} +22 -11
- package/dist/{usePermissions-B_G12Dwd.mjs → usePermissions-CTi-3pBk.mjs} +6 -6
- package/dist/{useRules--7Qoo60I.mjs → useRules-DNhljkyO.mjs} +2 -2
- package/dist/{useTheme-Co05TEeD.mjs → useTheme-3vW3kFNg.mjs} +5 -5
- package/dist/utilities/index.d.mts +2 -2
- package/dist/utilities/index.mjs +27 -2
- package/dist/{v0-DrOub-e1.d.mts → v0-CRGArJim.d.mts} +4 -4
- package/dist/{v0-D0Mh3EVG.mjs → v0-CotC1PiS.mjs} +5 -3
- package/dist/{v0-Dq3zhexO.mjs → v0-DAlKpCR8.mjs} +3 -4
- package/dist/{v0-D7Fm2C3Y.d.mts → v0-DDELiSI6.d.mts} +3 -3
- package/dist/v0-DYsCJPIu.d.mts +8 -0
- package/dist/{v0-BrTEO5sv.mjs → v0-DadOcxFI.mjs} +2 -2
- package/dist/{v0-Bmow1q_x.mjs → v0-Dvu8fMl3.mjs} +3 -3
- package/dist/{v0-DeiZuexg.mjs → v0-YJQoTLsp.mjs} +6 -4
- package/dist/virtual-BqCRw0ly.d.mts +8 -0
- package/dist/{virtual-C0yHf1DC.mjs → virtual-Dnno49F8.mjs} +3 -4
- package/package.json +10 -10
- package/dist/adapter-58IvIfAZ.d.mts +0 -96
- package/dist/adapter-BvWEd9w-.d.mts +0 -17
- package/dist/adapter-Dhq68tz0.d.mts +0 -11
- package/dist/adapters-BJ5n7rgh.mjs +0 -3
- package/dist/adapters-BnKW0BF_.mjs +0 -2
- package/dist/adapters-CBrvizWb.mjs +0 -4
- package/dist/adapters-CMJGA1k7.mjs +0 -2
- package/dist/adapters-Dse4bPxk.mjs +0 -5
- package/dist/createPagination-CHF7SmmK.mjs +0 -247
- package/dist/index-1XdASTjp.d.mts +0 -13
- package/dist/index-C6rdXZ7j.d.mts +0 -11
- package/dist/index-Dp1HjBxJ.d.mts +0 -13
- package/dist/v0-CdusXjY_.d.mts +0 -8
- package/dist/virtual-D4fckewC.d.mts +0 -8
- /package/dist/{adapter-Be9zUc-n.mjs → adapter-oM18AdUc.mjs} +0 -0
- /package/dist/{htmlElements-D4oMQZPJ.mjs → htmlElements-CHXZfsZu.mjs} +0 -0
- /package/dist/{index-CFhUdAHM.d.mts → index-CKKoxA9V.d.mts} +0 -0
- /package/dist/{index-DuddF-NR.d.mts → index-CLR1QMM3.d.mts} +0 -0
- /package/dist/{index-BgCkepP_.d.mts → index-DJQwYeyx.d.mts} +0 -0
- /package/dist/{index-CROz1VSV.d.mts → index-DWfPppPU.d.mts} +0 -0
- /package/dist/{index-DTvqw22G.d.mts → index-H_hl6-4b.d.mts} +0 -0
- /package/dist/{toArray-as9BWxBK.mjs → toArray-CD2-OxAz.mjs} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as ID, i as Extensible, o as MaybeArray } from "./index-
|
|
2
|
-
import { t as ContextTrinity } from "./index-
|
|
3
|
-
import { b as RegistryTicket, c as TokenTicket, i as TokenContext, m as RegistryContext, o as TokenOptions, r as TokenCollection, x as RegistryTicketInput, y as RegistryOptions } from "./index-
|
|
4
|
-
import {
|
|
5
|
-
import { t as DateAdapter } from "./adapter-
|
|
6
|
-
import { n as FeaturesAdapterFlags,
|
|
7
|
-
import { t as LocaleAdapter } from "./adapter-
|
|
8
|
-
import { t as LoggerAdapter } from "./adapter-
|
|
9
|
-
import {
|
|
1
|
+
import { a as ID, i as Extensible, o as MaybeArray } from "./index-CLR1QMM3.mjs";
|
|
2
|
+
import { t as ContextTrinity } from "./index-H_hl6-4b.mjs";
|
|
3
|
+
import { b as RegistryTicket, c as TokenTicket, g as RegistryEventCallback, i as TokenContext, m as RegistryContext, o as TokenOptions, r as TokenCollection, v as RegistryEventName, x as RegistryTicketInput, y as RegistryOptions } from "./index-Cw04PFVO.mjs";
|
|
4
|
+
import { _ as FilterMode } from "./adapter-Cr7Bl4la.mjs";
|
|
5
|
+
import { t as DateAdapter } from "./adapter-Dzyrlbz7.mjs";
|
|
6
|
+
import { n as FeaturesAdapterFlags, t as FeaturesAdapter } from "./adapter-C6JmOyYo.mjs";
|
|
7
|
+
import { t as LocaleAdapter } from "./adapter-DgBBe_BW.mjs";
|
|
8
|
+
import { t as LoggerAdapter } from "./adapter-o8r-2vUn.mjs";
|
|
9
|
+
import { n as StorageAdapter } from "./memory-B0w39kno.mjs";
|
|
10
10
|
import { App, ComponentPublicInstance, ComputedRef, InjectionKey, MaybeRef, MaybeRefOrGetter, Reactive, Ref, ShallowRef, UnwrapNestedRefs, WatchSource, WritableComputedRef } from "vue";
|
|
11
11
|
|
|
12
12
|
//#region src/composables/createModel/index.d.ts
|
|
@@ -1479,12 +1479,12 @@ interface ComboboxAdapterResult {
|
|
|
1479
1479
|
/** Whether no items match the current query */
|
|
1480
1480
|
isEmpty: Ref<boolean>;
|
|
1481
1481
|
}
|
|
1482
|
-
|
|
1483
|
-
setup
|
|
1482
|
+
declare abstract class ComboboxAdapter {
|
|
1483
|
+
abstract setup(context: ComboboxAdapterContext): ComboboxAdapterResult;
|
|
1484
1484
|
}
|
|
1485
1485
|
//#endregion
|
|
1486
1486
|
//#region src/composables/createCombobox/adapters/client.d.ts
|
|
1487
|
-
interface
|
|
1487
|
+
interface ClientComboboxAdapterOptions {
|
|
1488
1488
|
/** Filter matching mode */
|
|
1489
1489
|
mode?: FilterMode;
|
|
1490
1490
|
/** Object keys to match against (for object values) */
|
|
@@ -1492,14 +1492,14 @@ interface ClientAdapterOptions {
|
|
|
1492
1492
|
/** Custom filter function — overrides default matching */
|
|
1493
1493
|
filter?: (query: string, value: unknown) => boolean;
|
|
1494
1494
|
}
|
|
1495
|
-
declare class
|
|
1495
|
+
declare class ClientComboboxAdapter extends ComboboxAdapter {
|
|
1496
1496
|
private options;
|
|
1497
|
-
constructor(options?:
|
|
1497
|
+
constructor(options?: ClientComboboxAdapterOptions);
|
|
1498
1498
|
setup(context: ComboboxAdapterContext): ComboboxAdapterResult;
|
|
1499
1499
|
}
|
|
1500
1500
|
//#endregion
|
|
1501
1501
|
//#region src/composables/createCombobox/adapters/server.d.ts
|
|
1502
|
-
declare class
|
|
1502
|
+
declare class ServerComboboxAdapter extends ComboboxAdapter {
|
|
1503
1503
|
setup(context: ComboboxAdapterContext): ComboboxAdapterResult;
|
|
1504
1504
|
}
|
|
1505
1505
|
//#endregion
|
|
@@ -1511,7 +1511,7 @@ interface ComboboxOptions {
|
|
|
1511
1511
|
strict?: MaybeRefOrGetter<boolean>;
|
|
1512
1512
|
error?: MaybeRefOrGetter<boolean>;
|
|
1513
1513
|
errorMessages?: MaybeRefOrGetter<MaybeArray<string> | undefined>;
|
|
1514
|
-
adapter?:
|
|
1514
|
+
adapter?: ComboboxAdapter;
|
|
1515
1515
|
displayValue?: (value: unknown) => string;
|
|
1516
1516
|
id?: string;
|
|
1517
1517
|
name?: string;
|
|
@@ -2117,6 +2117,471 @@ interface InputContext<T = string> {
|
|
|
2117
2117
|
}
|
|
2118
2118
|
declare function createInput<T = string>(options: InputOptions<T>): InputContext<T>;
|
|
2119
2119
|
//#endregion
|
|
2120
|
+
//#region src/composables/createSortable/index.d.ts
|
|
2121
|
+
/**
|
|
2122
|
+
* Input shape passed to `register` / `onboard`. Inherits all model fields.
|
|
2123
|
+
*
|
|
2124
|
+
* @template V Type of the per-ticket value.
|
|
2125
|
+
*
|
|
2126
|
+
* @example
|
|
2127
|
+
* ```ts
|
|
2128
|
+
* interface TaskTicket extends SortableTicketInput {
|
|
2129
|
+
* value: { id: number; label: string }
|
|
2130
|
+
* }
|
|
2131
|
+
*
|
|
2132
|
+
* const sortable = createSortable<TaskTicket>()
|
|
2133
|
+
* sortable.register({ value: { id: 1, label: 'A' } })
|
|
2134
|
+
* ```
|
|
2135
|
+
*/
|
|
2136
|
+
type SortableTicketInput<V = unknown> = ModelTicketInput<V>;
|
|
2137
|
+
/**
|
|
2138
|
+
* Output ticket returned by `register` / `onboard` / `get`.
|
|
2139
|
+
* Aliased to `ModelTicket<Z>` — sortable adds no per-ticket fields.
|
|
2140
|
+
*
|
|
2141
|
+
* @template Z The input ticket type (carries the value type V).
|
|
2142
|
+
*/
|
|
2143
|
+
type SortableTicket<Z extends SortableTicketInput = SortableTicketInput> = ModelTicket<Z>;
|
|
2144
|
+
/**
|
|
2145
|
+
* Options accepted by `createSortable`.
|
|
2146
|
+
*
|
|
2147
|
+
* @example
|
|
2148
|
+
* ```ts
|
|
2149
|
+
* const sortable = createSortable({
|
|
2150
|
+
* disabled: toRef(() => isReadOnlyMode.value),
|
|
2151
|
+
* })
|
|
2152
|
+
* ```
|
|
2153
|
+
*/
|
|
2154
|
+
interface SortableOptions extends Omit<ModelOptions, 'events'> {
|
|
2155
|
+
/**
|
|
2156
|
+
* Mutation gate. When truthy, `move` / `swap` / `reorder` silently no-op.
|
|
2157
|
+
*
|
|
2158
|
+
* @default false
|
|
2159
|
+
* @remarks Per-ticket `disabled` is honored at the `move` and `swap` call sites
|
|
2160
|
+
* for that ticket. `reorder` **bypasses** per-ticket `disabled` — it's a bulk
|
|
2161
|
+
* operation declaring the canonical order, and applying that order may relocate
|
|
2162
|
+
* disabled tickets. `register` / `onboard` / `unregister` are NEVER gated —
|
|
2163
|
+
* those are composition, not user-driven reorder.
|
|
2164
|
+
*
|
|
2165
|
+
* @example
|
|
2166
|
+
* ```ts
|
|
2167
|
+
* const sortable = createSortable({ disabled: toRef(() => isSaving.value) })
|
|
2168
|
+
* ```
|
|
2169
|
+
*/
|
|
2170
|
+
disabled?: MaybeRefOrGetter<boolean>;
|
|
2171
|
+
}
|
|
2172
|
+
/**
|
|
2173
|
+
* Payload of the `move:ticket` event.
|
|
2174
|
+
*
|
|
2175
|
+
* @example
|
|
2176
|
+
* ```ts
|
|
2177
|
+
* sortable.on('move:ticket', ({ ticket, from, to }) => {
|
|
2178
|
+
* console.log(ticket.id, from, to)
|
|
2179
|
+
* })
|
|
2180
|
+
* ```
|
|
2181
|
+
*/
|
|
2182
|
+
interface SortableMovePayload<E extends SortableTicket = SortableTicket> {
|
|
2183
|
+
ticket: E;
|
|
2184
|
+
from: number;
|
|
2185
|
+
to: number;
|
|
2186
|
+
}
|
|
2187
|
+
/**
|
|
2188
|
+
* Listener-binding signature for a sortable instance — a typed overload for
|
|
2189
|
+
* `move:ticket` plus the registry's generic event channel.
|
|
2190
|
+
*
|
|
2191
|
+
* @template E Output ticket type.
|
|
2192
|
+
*/
|
|
2193
|
+
type SortableEventListener<E extends SortableTicket = SortableTicket> = {
|
|
2194
|
+
(event: 'move:ticket', cb: (data: SortableMovePayload<E>) => void): void;
|
|
2195
|
+
<K extends Extensible<RegistryEventName>>(event: K, cb: RegistryEventCallback<E, K>): void;
|
|
2196
|
+
};
|
|
2197
|
+
/**
|
|
2198
|
+
* Public API of a sortable instance.
|
|
2199
|
+
*
|
|
2200
|
+
* @template Z Input ticket type.
|
|
2201
|
+
* @template E Output ticket type.
|
|
2202
|
+
*/
|
|
2203
|
+
interface SortableContext<Z extends SortableTicketInput = SortableTicketInput, E extends SortableTicket<Z> = SortableTicket<Z>> extends Omit<ModelContext<Z, E>, 'on' | 'off' | 'move'> {
|
|
2204
|
+
/**
|
|
2205
|
+
* Subscribe to the typed `move:ticket` event with a strongly-typed payload.
|
|
2206
|
+
*
|
|
2207
|
+
* @example
|
|
2208
|
+
* ```ts
|
|
2209
|
+
* sortable.on('move:ticket', ({ ticket, from, to }) => {
|
|
2210
|
+
* console.log(ticket.id, from, to)
|
|
2211
|
+
* })
|
|
2212
|
+
* ```
|
|
2213
|
+
*/
|
|
2214
|
+
on: SortableEventListener<E>;
|
|
2215
|
+
/**
|
|
2216
|
+
* Unsubscribe from a `move:ticket` listener. Must be called with the same callback reference used to subscribe.
|
|
2217
|
+
*
|
|
2218
|
+
* @example
|
|
2219
|
+
* ```ts
|
|
2220
|
+
* function onMove ({ ticket, from, to }: SortableMovePayload) {
|
|
2221
|
+
* console.log(ticket.id, from, to)
|
|
2222
|
+
* }
|
|
2223
|
+
*
|
|
2224
|
+
* sortable.on('move:ticket', onMove)
|
|
2225
|
+
* // later...
|
|
2226
|
+
* sortable.off('move:ticket', onMove)
|
|
2227
|
+
* ```
|
|
2228
|
+
*/
|
|
2229
|
+
off: SortableEventListener<E>;
|
|
2230
|
+
/**
|
|
2231
|
+
* Move a ticket to a target index. Other tickets shift to fill.
|
|
2232
|
+
* Emits `move:ticket` once when the index actually changes — a move whose
|
|
2233
|
+
* `toIndex` already equals the ticket's current index is a no-op.
|
|
2234
|
+
* No-ops when the root sortable is disabled or when the ticket is disabled.
|
|
2235
|
+
*
|
|
2236
|
+
* @param id Ticket id to move.
|
|
2237
|
+
* @param toIndex Target index (zero-based).
|
|
2238
|
+
* @returns The moved ticket, or `undefined` when the move was gated or the id is unknown.
|
|
2239
|
+
*
|
|
2240
|
+
* @example
|
|
2241
|
+
* ```ts
|
|
2242
|
+
* sortable.move(ticket.id, 2)
|
|
2243
|
+
* ```
|
|
2244
|
+
*/
|
|
2245
|
+
move: (id: ID, toIndex: number) => E | undefined;
|
|
2246
|
+
/**
|
|
2247
|
+
* Swap two tickets' positions. Emits `move:ticket` twice — once per ticket.
|
|
2248
|
+
* No-ops when the root sortable is disabled or when either ticket is disabled.
|
|
2249
|
+
*
|
|
2250
|
+
* @param a Ticket id at one position.
|
|
2251
|
+
* @param b Ticket id at the other position.
|
|
2252
|
+
*
|
|
2253
|
+
* @example
|
|
2254
|
+
* ```ts
|
|
2255
|
+
* sortable.swap(a.id, b.id)
|
|
2256
|
+
* ```
|
|
2257
|
+
*/
|
|
2258
|
+
swap: (a: ID, b: ID) => void;
|
|
2259
|
+
/**
|
|
2260
|
+
* Set the canonical order in one shot.
|
|
2261
|
+
*
|
|
2262
|
+
* @param ids Permutation of currently-registered ticket ids.
|
|
2263
|
+
*
|
|
2264
|
+
* @remarks
|
|
2265
|
+
* Validates `ids.length === registry.size` and that every id is unique and known.
|
|
2266
|
+
* Logs a warning via `useLogger()` and silently no-ops if any check fails — drag
|
|
2267
|
+
* handlers that race against concurrent unregisters won't crash.
|
|
2268
|
+
*
|
|
2269
|
+
* Honors root `disabled` (whole call no-ops). Per-ticket `disabled` is **ignored** —
|
|
2270
|
+
* `reorder` is a bulk operation declaring the canonical order, and applying that
|
|
2271
|
+
* order may move disabled tickets. If you want disabled tickets pinned, exclude
|
|
2272
|
+
* them from the ids you pass.
|
|
2273
|
+
*
|
|
2274
|
+
* @example
|
|
2275
|
+
* ```ts
|
|
2276
|
+
* sortable.reorder([c.id, a.id, b.id])
|
|
2277
|
+
* ```
|
|
2278
|
+
*/
|
|
2279
|
+
reorder: (ids: ID[]) => void;
|
|
2280
|
+
}
|
|
2281
|
+
/**
|
|
2282
|
+
* Create an ordered-list state primitive.
|
|
2283
|
+
*
|
|
2284
|
+
* @param options Sortable options.
|
|
2285
|
+
* @returns A {@link SortableContext} that extends {@link ModelContext}.
|
|
2286
|
+
*
|
|
2287
|
+
* @example
|
|
2288
|
+
* ```ts
|
|
2289
|
+
* const sortable = createSortable<Todo>()
|
|
2290
|
+
* sortable.onboard(todos.value.map(value => ({ value })))
|
|
2291
|
+
* ```
|
|
2292
|
+
*/
|
|
2293
|
+
declare function createSortable<Z extends SortableTicketInput = SortableTicketInput, E extends SortableTicket<Z> = SortableTicket<Z>>(_options?: SortableOptions): SortableContext<Z, E>;
|
|
2294
|
+
//#endregion
|
|
2295
|
+
//#region src/composables/createKanban/index.d.ts
|
|
2296
|
+
/**
|
|
2297
|
+
* Options accepted by `createKanban`.
|
|
2298
|
+
*
|
|
2299
|
+
* @example
|
|
2300
|
+
* ```ts
|
|
2301
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2302
|
+
* import { shallowRef, toRef } from 'vue'
|
|
2303
|
+
*
|
|
2304
|
+
* const isReadOnly = shallowRef(false)
|
|
2305
|
+
* const kanban = createKanban({ disabled: toRef(() => isReadOnly.value) })
|
|
2306
|
+
* ```
|
|
2307
|
+
*/
|
|
2308
|
+
interface KanbanOptions extends Omit<SortableOptions, 'events'> {
|
|
2309
|
+
/**
|
|
2310
|
+
* Mutation gate. When truthy, `transfer` and column-level mutations no-op.
|
|
2311
|
+
*
|
|
2312
|
+
* @default false
|
|
2313
|
+
*/
|
|
2314
|
+
disabled?: MaybeRefOrGetter<boolean>;
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Input shape for a column ticket. Parameterized over the per-column inner
|
|
2318
|
+
* ticket type so `accept` is typed against the caller's domain.
|
|
2319
|
+
*
|
|
2320
|
+
* @template ItemZ The inner ticket input type (extends `SortableTicketInput`).
|
|
2321
|
+
* @template V The column's own value type.
|
|
2322
|
+
*
|
|
2323
|
+
* @example
|
|
2324
|
+
* ```ts
|
|
2325
|
+
* import type { KanbanColumnTicketInput, SortableTicketInput } from '@vuetify/v0'
|
|
2326
|
+
*
|
|
2327
|
+
* interface CardTicket extends SortableTicketInput {
|
|
2328
|
+
* value: { title: string }
|
|
2329
|
+
* }
|
|
2330
|
+
*
|
|
2331
|
+
* interface BoardColumn extends KanbanColumnTicketInput<CardTicket> {
|
|
2332
|
+
* value: { title: string; color: string }
|
|
2333
|
+
* }
|
|
2334
|
+
* ```
|
|
2335
|
+
*/
|
|
2336
|
+
interface KanbanColumnTicketInput<ItemZ extends SortableTicketInput = SortableTicketInput, V = unknown> extends SortableTicketInput<V> {
|
|
2337
|
+
/**
|
|
2338
|
+
* Per-column mutation gate. When truthy, transfers into and out of this
|
|
2339
|
+
* column are blocked, and the column's inner `items` sortable is disabled
|
|
2340
|
+
* (move / swap / reorder no-op). Column-level operations on
|
|
2341
|
+
* `kanban.columns` are unaffected — those are gated by the kanban-level
|
|
2342
|
+
* `disabled`.
|
|
2343
|
+
*
|
|
2344
|
+
* @default false
|
|
2345
|
+
*/
|
|
2346
|
+
disabled?: MaybeRefOrGetter<boolean>;
|
|
2347
|
+
/**
|
|
2348
|
+
* Predicate veto for incoming transfers. Synchronous boolean return:
|
|
2349
|
+
* `true` accepts; `false` rejects (silent no-op). Async predicates are
|
|
2350
|
+
* rejected at runtime with a warning.
|
|
2351
|
+
*
|
|
2352
|
+
* @param ticket The item being transferred (from the source column).
|
|
2353
|
+
* @param from The source column id.
|
|
2354
|
+
* @param toIndex The target index inside this destination column.
|
|
2355
|
+
*
|
|
2356
|
+
* @example
|
|
2357
|
+
* ```ts
|
|
2358
|
+
* const review = kanban.columns.register({
|
|
2359
|
+
* value: { title: 'Review' },
|
|
2360
|
+
* accept: (ticket, from) => from !== archiveColumn.id,
|
|
2361
|
+
* })
|
|
2362
|
+
* ```
|
|
2363
|
+
*/
|
|
2364
|
+
accept?: (ticket: SortableTicket<ItemZ>, from: ID, toIndex: number) => boolean;
|
|
2365
|
+
}
|
|
2366
|
+
/**
|
|
2367
|
+
* Output ticket returned from `kanban.columns.register`. Extends `SortableTicket`
|
|
2368
|
+
* with the column's own inner sortable on `items`.
|
|
2369
|
+
*
|
|
2370
|
+
* @template ItemZ Inner ticket input type.
|
|
2371
|
+
* @template Z Column input type.
|
|
2372
|
+
*
|
|
2373
|
+
* @example
|
|
2374
|
+
* ```ts
|
|
2375
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2376
|
+
*
|
|
2377
|
+
* const kanban = createKanban()
|
|
2378
|
+
* const todo = kanban.columns.register({ value: { title: 'Todo' } })
|
|
2379
|
+
* todo.items.register({ value: { title: 'Write spec' } })
|
|
2380
|
+
* console.log(todo.id, todo.value.title, todo.items.size)
|
|
2381
|
+
* ```
|
|
2382
|
+
*/
|
|
2383
|
+
type KanbanColumnTicket<ItemZ extends SortableTicketInput = SortableTicketInput, Z extends KanbanColumnTicketInput<ItemZ> = KanbanColumnTicketInput<ItemZ>> = SortableTicket<Z> & {
|
|
2384
|
+
items: SortableContext<ItemZ>;
|
|
2385
|
+
};
|
|
2386
|
+
/**
|
|
2387
|
+
* Payload of the `transfer:ticket` event on the kanban bus.
|
|
2388
|
+
*
|
|
2389
|
+
* @example
|
|
2390
|
+
* ```ts
|
|
2391
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2392
|
+
*
|
|
2393
|
+
* const kanban = createKanban()
|
|
2394
|
+
*
|
|
2395
|
+
* kanban.on('transfer:ticket', ({ ticket, from, to, toIndex }) => {
|
|
2396
|
+
* console.log(ticket.id, from, '→', to, '@', toIndex)
|
|
2397
|
+
* })
|
|
2398
|
+
* ```
|
|
2399
|
+
*/
|
|
2400
|
+
interface KanbanTransferPayload<ItemZ extends SortableTicketInput = SortableTicketInput> {
|
|
2401
|
+
ticket: SortableTicket<ItemZ>;
|
|
2402
|
+
from: ID;
|
|
2403
|
+
to: ID;
|
|
2404
|
+
fromIndex: number;
|
|
2405
|
+
toIndex: number;
|
|
2406
|
+
}
|
|
2407
|
+
/**
|
|
2408
|
+
* Listener signature for the kanban-level `transfer:ticket` event. Registry
|
|
2409
|
+
* events (`register:ticket`, `unregister:ticket`, etc.) live on the columns
|
|
2410
|
+
* registry — subscribe via `kanban.columns.on(...)` rather than `kanban.on(...)`.
|
|
2411
|
+
*
|
|
2412
|
+
* @example
|
|
2413
|
+
* ```ts
|
|
2414
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2415
|
+
*
|
|
2416
|
+
* const kanban = createKanban()
|
|
2417
|
+
*
|
|
2418
|
+
* kanban.on('transfer:ticket', ({ ticket, from, to, toIndex }) => {
|
|
2419
|
+
* console.log(ticket.id, from, '→', to, '@', toIndex)
|
|
2420
|
+
* })
|
|
2421
|
+
* ```
|
|
2422
|
+
*/
|
|
2423
|
+
type KanbanEventListener<ItemZ extends SortableTicketInput = SortableTicketInput> = (event: 'transfer:ticket', cb: (data: KanbanTransferPayload<ItemZ>) => void) => void;
|
|
2424
|
+
/**
|
|
2425
|
+
* Public context returned by `createKanban`.
|
|
2426
|
+
*
|
|
2427
|
+
* @example
|
|
2428
|
+
* ```ts
|
|
2429
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2430
|
+
* import type { KanbanColumnTicketInput, SortableTicketInput } from '@vuetify/v0'
|
|
2431
|
+
*
|
|
2432
|
+
* interface CardTicket extends SortableTicketInput {
|
|
2433
|
+
* value: { title: string }
|
|
2434
|
+
* }
|
|
2435
|
+
*
|
|
2436
|
+
* interface BoardColumn extends KanbanColumnTicketInput<CardTicket> {
|
|
2437
|
+
* value: { title: string }
|
|
2438
|
+
* }
|
|
2439
|
+
*
|
|
2440
|
+
* const kanban = createKanban<CardTicket, BoardColumn>()
|
|
2441
|
+
*
|
|
2442
|
+
* const [todo, done] = kanban.columns.onboard([
|
|
2443
|
+
* { value: { title: 'Todo' } },
|
|
2444
|
+
* { value: { title: 'Done' } },
|
|
2445
|
+
* ])
|
|
2446
|
+
*
|
|
2447
|
+
* const card = todo.items.register({ value: { title: 'Write spec' } })
|
|
2448
|
+
*
|
|
2449
|
+
* kanban.on('transfer:ticket', ({ ticket, from, to, toIndex }) => {
|
|
2450
|
+
* console.log(`${ticket.id}: ${from} → ${to} @ ${toIndex}`)
|
|
2451
|
+
* })
|
|
2452
|
+
*
|
|
2453
|
+
* kanban.transfer(card.id, done.id, 0)
|
|
2454
|
+
* ```
|
|
2455
|
+
*/
|
|
2456
|
+
interface KanbanContext<ItemZ extends SortableTicketInput = SortableTicketInput, ColZ extends KanbanColumnTicketInput<ItemZ> = KanbanColumnTicketInput<ItemZ>> {
|
|
2457
|
+
/**
|
|
2458
|
+
* Column registry. Use this for column register / unregister / move / swap / reorder.
|
|
2459
|
+
*
|
|
2460
|
+
* @remarks
|
|
2461
|
+
* Unregistering a column disposes its `items` sortable — all of the column's
|
|
2462
|
+
* tickets are dropped and any subscribers attached to `column.items` are
|
|
2463
|
+
* cleared. The internal cleanup runs before consumer-registered
|
|
2464
|
+
* `unregister:ticket` handlers, so you cannot rescue items from inside that
|
|
2465
|
+
* callback. To preserve items, move them before calling `unregister`.
|
|
2466
|
+
*
|
|
2467
|
+
* @example
|
|
2468
|
+
* ```ts
|
|
2469
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2470
|
+
*
|
|
2471
|
+
* const kanban = createKanban<CardTicket, BoardColumn>()
|
|
2472
|
+
* const todo = kanban.columns.register({ value: { title: 'Todo' } })
|
|
2473
|
+
* todo.items.register({ value: { title: 'Write spec' } })
|
|
2474
|
+
* kanban.columns.move(todo.id, 1)
|
|
2475
|
+
* ```
|
|
2476
|
+
*
|
|
2477
|
+
* @example
|
|
2478
|
+
* ```ts
|
|
2479
|
+
* // Reflow items into a fallback column before disposing the source column.
|
|
2480
|
+
* for (const item of todo.items.values()) {
|
|
2481
|
+
* trash.items.register({ id: item.id, value: item.value })
|
|
2482
|
+
* }
|
|
2483
|
+
* todo.unregister()
|
|
2484
|
+
* ```
|
|
2485
|
+
*/
|
|
2486
|
+
columns: SortableContext<ColZ, KanbanColumnTicket<ItemZ, ColZ>>;
|
|
2487
|
+
/**
|
|
2488
|
+
* Move an item across columns. Same-column transfer (where `toColumnId`
|
|
2489
|
+
* matches the item's current column) collapses to `column.items.move` and
|
|
2490
|
+
* does not emit `transfer:ticket`.
|
|
2491
|
+
*
|
|
2492
|
+
* Returns the moved ticket, or `undefined` when gated (kanban / source / destination /
|
|
2493
|
+
* item disabled, destination.accept rejected, unknown id, duplicate destination id).
|
|
2494
|
+
*
|
|
2495
|
+
* @example
|
|
2496
|
+
* ```ts
|
|
2497
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2498
|
+
*
|
|
2499
|
+
* const kanban = createKanban()
|
|
2500
|
+
* const [todo, done] = kanban.columns.onboard([{ value: 'Todo' }, { value: 'Done' }])
|
|
2501
|
+
* const card = todo.items.register({ value: 'Write spec' })
|
|
2502
|
+
*
|
|
2503
|
+
* const moved = kanban.transfer(card.id, done.id, 0)
|
|
2504
|
+
* if (moved) console.log('landed at', moved.index)
|
|
2505
|
+
*
|
|
2506
|
+
* // Returns undefined when gated by disabled, accept, or unknown ids:
|
|
2507
|
+
* kanban.transfer(card.id, 'no-such-column', 0) // → undefined
|
|
2508
|
+
* ```
|
|
2509
|
+
*/
|
|
2510
|
+
transfer: (id: ID, toColumnId: ID, toIndex: number) => SortableTicket<ItemZ> | undefined;
|
|
2511
|
+
/**
|
|
2512
|
+
* Subscribe to the kanban-level `transfer:ticket` event, fired after each
|
|
2513
|
+
* successful cross-column move. Registry events (`register:ticket`,
|
|
2514
|
+
* `unregister:ticket`, `move:ticket`) live on the columns registry — use
|
|
2515
|
+
* `kanban.columns.on(...)` for those, or `column.items.on(...)` for
|
|
2516
|
+
* per-column intra-column reorder events.
|
|
2517
|
+
*
|
|
2518
|
+
* @example
|
|
2519
|
+
* ```ts
|
|
2520
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2521
|
+
*
|
|
2522
|
+
* const kanban = createKanban()
|
|
2523
|
+
*
|
|
2524
|
+
* kanban.on('transfer:ticket', ({ ticket, from, to, fromIndex, toIndex }) => {
|
|
2525
|
+
* console.log(ticket.id, from, '→', to, '@', toIndex)
|
|
2526
|
+
* })
|
|
2527
|
+
* ```
|
|
2528
|
+
*/
|
|
2529
|
+
on: KanbanEventListener<ItemZ>;
|
|
2530
|
+
/**
|
|
2531
|
+
* Unsubscribe from the `transfer:ticket` event. Must be called with the same
|
|
2532
|
+
* callback reference used to subscribe.
|
|
2533
|
+
*
|
|
2534
|
+
* @example
|
|
2535
|
+
* ```ts
|
|
2536
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2537
|
+
* import type { KanbanTransferPayload } from '@vuetify/v0'
|
|
2538
|
+
*
|
|
2539
|
+
* const kanban = createKanban<CardTicket>()
|
|
2540
|
+
*
|
|
2541
|
+
* function onTransfer (data: KanbanTransferPayload<CardTicket>) {
|
|
2542
|
+
* console.log(data.ticket.id)
|
|
2543
|
+
* }
|
|
2544
|
+
*
|
|
2545
|
+
* kanban.on('transfer:ticket', onTransfer)
|
|
2546
|
+
* // later
|
|
2547
|
+
* kanban.off('transfer:ticket', onTransfer)
|
|
2548
|
+
* ```
|
|
2549
|
+
*/
|
|
2550
|
+
off: KanbanEventListener<ItemZ>;
|
|
2551
|
+
}
|
|
2552
|
+
/**
|
|
2553
|
+
* Create a headless two-level sortable orchestrator.
|
|
2554
|
+
*
|
|
2555
|
+
* @param options Kanban options (currently only `disabled`).
|
|
2556
|
+
* @returns A {@link KanbanContext}.
|
|
2557
|
+
*
|
|
2558
|
+
* @example
|
|
2559
|
+
* ```ts
|
|
2560
|
+
* import { createKanban } from '@vuetify/v0'
|
|
2561
|
+
* import type { KanbanColumnTicketInput, SortableTicketInput } from '@vuetify/v0'
|
|
2562
|
+
*
|
|
2563
|
+
* interface CardTicket extends SortableTicketInput {
|
|
2564
|
+
* value: { title: string }
|
|
2565
|
+
* }
|
|
2566
|
+
*
|
|
2567
|
+
* interface BoardColumn extends KanbanColumnTicketInput<CardTicket> {
|
|
2568
|
+
* value: { title: string }
|
|
2569
|
+
* }
|
|
2570
|
+
*
|
|
2571
|
+
* const kanban = createKanban<CardTicket, BoardColumn>()
|
|
2572
|
+
*
|
|
2573
|
+
* const todo = kanban.columns.register({ value: { title: 'Todo' } })
|
|
2574
|
+
* const review = kanban.columns.register({
|
|
2575
|
+
* value: { title: 'Review' },
|
|
2576
|
+
* accept: card => card.value.title.length > 0,
|
|
2577
|
+
* })
|
|
2578
|
+
*
|
|
2579
|
+
* const spec = todo.items.register({ value: { title: 'Write spec' } })
|
|
2580
|
+
* kanban.transfer(spec.id, review.id, 0)
|
|
2581
|
+
* ```
|
|
2582
|
+
*/
|
|
2583
|
+
declare function createKanban<ItemZ extends SortableTicketInput = SortableTicketInput, ColZ extends KanbanColumnTicketInput<ItemZ> = KanbanColumnTicketInput<ItemZ>>(_options?: KanbanOptions): KanbanContext<ItemZ, ColZ>;
|
|
2584
|
+
//#endregion
|
|
2120
2585
|
//#region src/composables/createNested/types.d.ts
|
|
2121
2586
|
/**
|
|
2122
2587
|
* Input type for nested tickets - what users provide to register().
|
|
@@ -2130,7 +2595,7 @@ interface NestedTicketInput<V = unknown> extends GroupTicketInput<V> {
|
|
|
2130
2595
|
/** Whether this ticket is initially active */
|
|
2131
2596
|
active?: boolean;
|
|
2132
2597
|
/** Reference to the DOM element for focus management */
|
|
2133
|
-
el?: MaybeRefOrGetter<
|
|
2598
|
+
el?: MaybeRefOrGetter<Element | null | undefined>;
|
|
2134
2599
|
}
|
|
2135
2600
|
/**
|
|
2136
2601
|
* Output type for nested tickets - what users receive from get().
|
|
@@ -2140,7 +2605,7 @@ interface NestedTicketInput<V = unknown> extends GroupTicketInput<V> {
|
|
|
2140
2605
|
*/
|
|
2141
2606
|
type NestedTicket<Z extends NestedTicketInput = NestedTicketInput> = GroupTicket<Z> & {
|
|
2142
2607
|
/** ID of the parent ticket, or undefined if this is a root item. Static — set at registration time. */parentId: ID | undefined; /** Reference to the DOM element for focus management */
|
|
2143
|
-
el: MaybeRefOrGetter<
|
|
2608
|
+
el: MaybeRefOrGetter<Element | null | undefined> | undefined; /** Whether this ticket is currently open/expanded */
|
|
2144
2609
|
isOpen: Readonly<Ref<boolean>>; /** Whether this ticket is currently active/highlighted */
|
|
2145
2610
|
isActive: Readonly<Ref<boolean>>; /** Whether this ticket is a leaf node (has no children) */
|
|
2146
2611
|
isLeaf: Readonly<Ref<boolean>>; /** Depth in tree (0 = root) */
|
|
@@ -2179,7 +2644,7 @@ type NestedRegistration<Z extends NestedTicketInput = NestedTicketInput> = Parti
|
|
|
2179
2644
|
* and hierarchical traversal methods. Perfect for tree structures, nested menus,
|
|
2180
2645
|
* file explorers, and organizational charts.
|
|
2181
2646
|
*/
|
|
2182
|
-
interface NestedContext<Z extends NestedTicketInput = NestedTicketInput, E extends NestedTicket<Z> = NestedTicket<Z>> extends Omit<GroupContext<Z, E>, 'register' | 'onboard' | 'select' | 'unselect' | 'toggle'> {
|
|
2647
|
+
interface NestedContext<Z extends NestedTicketInput = NestedTicketInput, E extends NestedTicket<Z> = NestedTicket<Z>> extends Omit<GroupContext<Z, E>, 'register' | 'onboard' | 'offboard' | 'select' | 'unselect' | 'toggle'> {
|
|
2183
2648
|
/** Map of parent IDs to arrays of child IDs. Use register/unregister to modify. */
|
|
2184
2649
|
readonly children: ReadonlyMap<ID, readonly ID[]>;
|
|
2185
2650
|
/** Map of child IDs to their parent ID (or undefined for roots). Use register/unregister to modify. */
|
|
@@ -4222,8 +4687,8 @@ interface DateOptions<Z> {
|
|
|
4222
4687
|
*
|
|
4223
4688
|
* @example
|
|
4224
4689
|
* ```ts
|
|
4225
|
-
* import {
|
|
4226
|
-
* createDate({ adapter: new
|
|
4690
|
+
* import { V0DateAdapter } from '@vuetify/v0/date'
|
|
4691
|
+
* createDate({ adapter: new V0DateAdapter() })
|
|
4227
4692
|
* ```
|
|
4228
4693
|
*/
|
|
4229
4694
|
adapter: DateAdapter<Z>;
|
|
@@ -4252,14 +4717,14 @@ interface DatePluginOptions<Z> extends DateContextOptions<Z> {}
|
|
|
4252
4717
|
*
|
|
4253
4718
|
* @example
|
|
4254
4719
|
* ```ts
|
|
4255
|
-
* import {
|
|
4720
|
+
* import { V0DateAdapter } from '@vuetify/v0/date'
|
|
4256
4721
|
*
|
|
4257
|
-
* const { adapter } = createDate({ adapter: new
|
|
4722
|
+
* const { adapter } = createDate({ adapter: new V0DateAdapter() })
|
|
4258
4723
|
* const today = adapter.date()
|
|
4259
4724
|
*
|
|
4260
4725
|
* // With locale options
|
|
4261
4726
|
* const { adapter } = createDate({
|
|
4262
|
-
* adapter: new
|
|
4727
|
+
* adapter: new V0DateAdapter(),
|
|
4263
4728
|
* locale: 'de-DE',
|
|
4264
4729
|
* })
|
|
4265
4730
|
* ```
|
|
@@ -4277,10 +4742,10 @@ declare function createDate<Z, E extends DateContext<Z> = DateContext<Z>>(option
|
|
|
4277
4742
|
*
|
|
4278
4743
|
* @example
|
|
4279
4744
|
* ```ts
|
|
4280
|
-
* import {
|
|
4745
|
+
* import { V0DateAdapter } from '@vuetify/v0/date'
|
|
4281
4746
|
*
|
|
4282
4747
|
* const [useAppDate, provideAppDate] = createDateContext({
|
|
4283
|
-
* adapter: new
|
|
4748
|
+
* adapter: new V0DateAdapter(),
|
|
4284
4749
|
* namespace: 'app:date',
|
|
4285
4750
|
* })
|
|
4286
4751
|
* ```
|
|
@@ -4298,14 +4763,14 @@ declare function createDateContext<Z, E extends DateContext<Z> = DateContext<Z>>
|
|
|
4298
4763
|
*
|
|
4299
4764
|
* @example
|
|
4300
4765
|
* ```ts
|
|
4301
|
-
* import {
|
|
4766
|
+
* import { V0DateAdapter } from '@vuetify/v0/date'
|
|
4302
4767
|
*
|
|
4303
4768
|
* const app = createApp(App)
|
|
4304
|
-
* app.use(createDatePlugin({ adapter: new
|
|
4769
|
+
* app.use(createDatePlugin({ adapter: new V0DateAdapter() }))
|
|
4305
4770
|
*
|
|
4306
4771
|
* // With locale options
|
|
4307
4772
|
* app.use(createDatePlugin({
|
|
4308
|
-
* adapter: new
|
|
4773
|
+
* adapter: new V0DateAdapter(),
|
|
4309
4774
|
* locale: 'de-DE',
|
|
4310
4775
|
* }))
|
|
4311
4776
|
* ```
|
|
@@ -4327,10 +4792,10 @@ declare function createDatePlugin<Z, E extends DateContext<Z> = DateContext<Z>>(
|
|
|
4327
4792
|
* @example
|
|
4328
4793
|
* ```ts
|
|
4329
4794
|
* // main.ts
|
|
4330
|
-
* import {
|
|
4795
|
+
* import { V0DateAdapter } from '@vuetify/v0/date'
|
|
4331
4796
|
* import { createDatePlugin } from '@vuetify/v0'
|
|
4332
4797
|
*
|
|
4333
|
-
* app.use(createDatePlugin({ adapter: new
|
|
4798
|
+
* app.use(createDatePlugin({ adapter: new V0DateAdapter() }))
|
|
4334
4799
|
* ```
|
|
4335
4800
|
*
|
|
4336
4801
|
* @example
|
|
@@ -4345,18 +4810,587 @@ declare function createDatePlugin<Z, E extends DateContext<Z> = DateContext<Z>>(
|
|
|
4345
4810
|
*/
|
|
4346
4811
|
declare function useDate<Z, E extends DateContext<Z> = DateContext<Z>>(namespace?: string): E;
|
|
4347
4812
|
//#endregion
|
|
4348
|
-
//#region src/composables/
|
|
4349
|
-
|
|
4350
|
-
|
|
4813
|
+
//#region src/composables/useDelay/index.d.ts
|
|
4814
|
+
interface UseDelayOptions {
|
|
4815
|
+
/**
|
|
4816
|
+
* Delay in milliseconds before the opening transition fires.
|
|
4817
|
+
*
|
|
4818
|
+
* @example
|
|
4819
|
+
* ```ts
|
|
4820
|
+
* useDelay({ openDelay: 300 })
|
|
4821
|
+
* useDelay({ openDelay: () => isFocus.value ? 0 : 500 })
|
|
4822
|
+
* ```
|
|
4823
|
+
*/
|
|
4824
|
+
openDelay?: MaybeRefOrGetter<number>;
|
|
4825
|
+
/**
|
|
4826
|
+
* Delay in milliseconds before the closing transition fires.
|
|
4827
|
+
*
|
|
4828
|
+
* @example
|
|
4829
|
+
* ```ts
|
|
4830
|
+
* useDelay({ closeDelay: 200 })
|
|
4831
|
+
* ```
|
|
4832
|
+
*/
|
|
4833
|
+
closeDelay?: MaybeRefOrGetter<number>;
|
|
4834
|
+
}
|
|
4351
4835
|
/**
|
|
4352
|
-
*
|
|
4836
|
+
* Per-call options for `start()`.
|
|
4353
4837
|
*
|
|
4354
|
-
* @
|
|
4355
|
-
*
|
|
4356
|
-
*
|
|
4357
|
-
*
|
|
4358
|
-
|
|
4359
|
-
|
|
4838
|
+
* @example
|
|
4839
|
+
* ```ts
|
|
4840
|
+
* delay.start(false, { minDelay: 500 })
|
|
4841
|
+
* ```
|
|
4842
|
+
*/
|
|
4843
|
+
interface UseDelayStartOptions {
|
|
4844
|
+
/** Minimum delay floor in ms; max(configuredDelay, minDelay) wins. */
|
|
4845
|
+
minDelay?: number;
|
|
4846
|
+
}
|
|
4847
|
+
/**
|
|
4848
|
+
* The reactive controls and state surface returned by `useDelay`.
|
|
4849
|
+
*
|
|
4850
|
+
* @example
|
|
4851
|
+
* ```ts
|
|
4852
|
+
* const { start, stop, pause, resume, isActive, isOpening } = useDelay(
|
|
4853
|
+
* undefined,
|
|
4854
|
+
* { openDelay: 300, closeDelay: 200 },
|
|
4855
|
+
* )
|
|
4856
|
+
*
|
|
4857
|
+
* start(true)
|
|
4858
|
+
* ```
|
|
4859
|
+
*/
|
|
4860
|
+
interface UseDelayReturn {
|
|
4861
|
+
/**
|
|
4862
|
+
* Start a delay in the given direction. Restarts if already running. Resolves
|
|
4863
|
+
* with `isOpening` once the delay elapses. If `start()` is called again before
|
|
4864
|
+
* the previous resolves, the previous promise resolves with the new direction.
|
|
4865
|
+
*
|
|
4866
|
+
* @example
|
|
4867
|
+
* ```ts
|
|
4868
|
+
* const delay = useDelay({ openDelay: 300, closeDelay: 200 })
|
|
4869
|
+
* await delay.start(true) // resolves true after 300ms
|
|
4870
|
+
* await delay.start(false, { minDelay: 500 }) // resolves false after max(200, 500)
|
|
4871
|
+
* ```
|
|
4872
|
+
*/
|
|
4873
|
+
start: (isOpening: boolean, options?: UseDelayStartOptions) => Promise<boolean>;
|
|
4874
|
+
/**
|
|
4875
|
+
* Cancel any pending delay and reset state. Resolves the pending promise with the current direction.
|
|
4876
|
+
*
|
|
4877
|
+
* @example
|
|
4878
|
+
* ```ts
|
|
4879
|
+
* delay.stop()
|
|
4880
|
+
* ```
|
|
4881
|
+
*/
|
|
4882
|
+
stop: () => void;
|
|
4883
|
+
/**
|
|
4884
|
+
* Pause the in-flight delay, preserving remaining time. No-op if not running.
|
|
4885
|
+
*
|
|
4886
|
+
* @example
|
|
4887
|
+
* ```ts
|
|
4888
|
+
* delay.pause()
|
|
4889
|
+
* ```
|
|
4890
|
+
*/
|
|
4891
|
+
pause: () => void;
|
|
4892
|
+
/**
|
|
4893
|
+
* Resume from where pause left off. No-op if not paused.
|
|
4894
|
+
*
|
|
4895
|
+
* @example
|
|
4896
|
+
* ```ts
|
|
4897
|
+
* delay.resume()
|
|
4898
|
+
* ```
|
|
4899
|
+
*/
|
|
4900
|
+
resume: () => void;
|
|
4901
|
+
/**
|
|
4902
|
+
* Whether a delay is currently pending (started, not stopped).
|
|
4903
|
+
*/
|
|
4904
|
+
isActive: Readonly<Ref<boolean>>;
|
|
4905
|
+
/**
|
|
4906
|
+
* Whether the pending delay is currently paused.
|
|
4907
|
+
*/
|
|
4908
|
+
isPaused: Readonly<Ref<boolean>>;
|
|
4909
|
+
/**
|
|
4910
|
+
* Milliseconds remaining until the pending transition fires.
|
|
4911
|
+
*/
|
|
4912
|
+
remaining: Readonly<Ref<number>>;
|
|
4913
|
+
/**
|
|
4914
|
+
* Direction of the pending transition (`true` = opening, `false` = closing).
|
|
4915
|
+
*/
|
|
4916
|
+
isOpening: Readonly<Ref<boolean>>;
|
|
4917
|
+
}
|
|
4918
|
+
/**
|
|
4919
|
+
* Schedule open and close transitions with configurable delays.
|
|
4920
|
+
*
|
|
4921
|
+
* Composes `useTimer` for the lifecycle (`start` / `stop` / `pause` / `resume` plus
|
|
4922
|
+
* reactive `isActive`, `isPaused`, `remaining`) and adds direction tracking
|
|
4923
|
+
* (`isOpening`) and promise-based resolution.
|
|
4924
|
+
*
|
|
4925
|
+
* @param callback Optional callback invoked once a started delay elapses; receives the resolved direction.
|
|
4926
|
+
* @param options Reactive delay settings.
|
|
4927
|
+
* @returns Lifecycle controls and reactive state.
|
|
4928
|
+
*
|
|
4929
|
+
* @see https://0.vuetifyjs.com/composables/system/use-delay
|
|
4930
|
+
*
|
|
4931
|
+
* @example
|
|
4932
|
+
* ```ts
|
|
4933
|
+
* const delay = useDelay(isOpening => isVisible.value = isOpening, {
|
|
4934
|
+
* openDelay: 300,
|
|
4935
|
+
* closeDelay: 200,
|
|
4936
|
+
* })
|
|
4937
|
+
*
|
|
4938
|
+
* delay.start(true)
|
|
4939
|
+
* delay.start(false, { minDelay: 500 })
|
|
4940
|
+
* delay.pause()
|
|
4941
|
+
* delay.resume()
|
|
4942
|
+
* delay.stop()
|
|
4943
|
+
* ```
|
|
4944
|
+
*/
|
|
4945
|
+
declare function useDelay(callback?: (isOpening: boolean) => void, options?: UseDelayOptions): UseDelayReturn;
|
|
4946
|
+
//#endregion
|
|
4947
|
+
//#region src/composables/useDragDrop/adapters/adapter.d.ts
|
|
4948
|
+
interface DragDropAdapterEmit<Z extends DragType = DragType> {
|
|
4949
|
+
start: (source: DraggableTicket<Z>, origin: {
|
|
4950
|
+
x: number;
|
|
4951
|
+
y: number;
|
|
4952
|
+
}, via: DragVia) => void;
|
|
4953
|
+
move: (point: {
|
|
4954
|
+
x: number;
|
|
4955
|
+
y: number;
|
|
4956
|
+
}) => void;
|
|
4957
|
+
drop: () => void;
|
|
4958
|
+
cancel: () => void;
|
|
4959
|
+
}
|
|
4960
|
+
interface DragDropAdapterContext<Z extends DragType = DragType> extends DragDropContext<Z> {
|
|
4961
|
+
emit: DragDropAdapterEmit<Z>;
|
|
4962
|
+
}
|
|
4963
|
+
/**
|
|
4964
|
+
* Abstract base class for useDragDrop adapters. Provides a `cleanup` slot, a
|
|
4965
|
+
* `dispose()` lifecycle, and a `locate()` helper that walks the DOM to find the
|
|
4966
|
+
* draggable ticket whose `el` ancestors a given event target.
|
|
4967
|
+
*
|
|
4968
|
+
* @example
|
|
4969
|
+
* ```ts
|
|
4970
|
+
* import { DragDropAdapter, type DragDropAdapterContext } from '@vuetify/v0'
|
|
4971
|
+
*
|
|
4972
|
+
* class MyAdapter extends DragDropAdapter {
|
|
4973
|
+
* setup (context: DragDropAdapterContext) {
|
|
4974
|
+
* const stop = useEventListener(document, 'mousedown', event => {
|
|
4975
|
+
* const ticket = this.locate(event.target, context)
|
|
4976
|
+
* if (ticket) context.emit.start(ticket, { x: event.clientX, y: event.clientY }, 'pointer')
|
|
4977
|
+
* })
|
|
4978
|
+
* this.cleanup = () => stop()
|
|
4979
|
+
* }
|
|
4980
|
+
* }
|
|
4981
|
+
* ```
|
|
4982
|
+
*/
|
|
4983
|
+
declare abstract class DragDropAdapter<Z extends DragType = DragType> {
|
|
4984
|
+
protected cleanup: (() => void) | null;
|
|
4985
|
+
dispose(): void;
|
|
4986
|
+
protected locate(target: EventTarget | Element | null, context: DragDropAdapterContext<Z>): DraggableTicket<Z> | null;
|
|
4987
|
+
abstract setup(context: DragDropAdapterContext<Z>): void;
|
|
4988
|
+
}
|
|
4989
|
+
//#endregion
|
|
4990
|
+
//#region src/composables/useDragDrop/adapters/pointer.d.ts
|
|
4991
|
+
interface PointerAdapterOptions {
|
|
4992
|
+
/** Drag-activation distance in px (default 0 — start on pointerdown). */
|
|
4993
|
+
threshold?: number;
|
|
4994
|
+
}
|
|
4995
|
+
/**
|
|
4996
|
+
* Default pointer adapter. Wires `pointerdown` / `pointermove` / `pointerup` /
|
|
4997
|
+
* `pointercancel` on the document and converts them into drag lifecycle calls.
|
|
4998
|
+
*
|
|
4999
|
+
* @example
|
|
5000
|
+
* ```ts
|
|
5001
|
+
* import { PointerAdapter, useDragDrop } from '@vuetify/v0'
|
|
5002
|
+
*
|
|
5003
|
+
* useDragDrop({ adapters: [new PointerAdapter({ threshold: 10 })] })
|
|
5004
|
+
* ```
|
|
5005
|
+
*/
|
|
5006
|
+
declare class PointerAdapter<Z extends DragType = DragType> extends DragDropAdapter<Z> {
|
|
5007
|
+
private threshold;
|
|
5008
|
+
constructor(options?: PointerAdapterOptions);
|
|
5009
|
+
setup(context: DragDropAdapterContext<Z>): void;
|
|
5010
|
+
}
|
|
5011
|
+
//#endregion
|
|
5012
|
+
//#region src/composables/useDragDrop/adapters/keyboard.d.ts
|
|
5013
|
+
interface KeyboardAdapterOptions {
|
|
5014
|
+
/** Activation keys (default [' ', 'Enter']). */
|
|
5015
|
+
activate?: string[];
|
|
5016
|
+
/** Step size in px for arrow-key moves (default 16). */
|
|
5017
|
+
step?: number;
|
|
5018
|
+
}
|
|
5019
|
+
/**
|
|
5020
|
+
* Default keyboard adapter. Listens for `keydown` on the document; activation
|
|
5021
|
+
* keys start/drop drags, arrow keys nudge the drag point, Escape cancels.
|
|
5022
|
+
*
|
|
5023
|
+
* @example
|
|
5024
|
+
* ```ts
|
|
5025
|
+
* import { KeyboardAdapter, useDragDrop } from '@vuetify/v0'
|
|
5026
|
+
*
|
|
5027
|
+
* useDragDrop({ adapters: [new KeyboardAdapter({ activate: ['x'], step: 32 })] })
|
|
5028
|
+
* ```
|
|
5029
|
+
*/
|
|
5030
|
+
declare class KeyboardAdapter<Z extends DragType = DragType> extends DragDropAdapter<Z> {
|
|
5031
|
+
private activate;
|
|
5032
|
+
private step;
|
|
5033
|
+
constructor(options?: KeyboardAdapterOptions);
|
|
5034
|
+
setup(context: DragDropAdapterContext<Z>): void;
|
|
5035
|
+
}
|
|
5036
|
+
//#endregion
|
|
5037
|
+
//#region src/composables/useDragDrop/index.d.ts
|
|
5038
|
+
/**
|
|
5039
|
+
* Layout axis a drop zone resolves indices along.
|
|
5040
|
+
*/
|
|
5041
|
+
type Orientation = 'vertical' | 'horizontal';
|
|
5042
|
+
/**
|
|
5043
|
+
* Discriminated payload describing what is being dragged. Consumers extend
|
|
5044
|
+
* this with concrete `type` literals plus a matching `value`.
|
|
5045
|
+
*
|
|
5046
|
+
* @example
|
|
5047
|
+
* ```ts
|
|
5048
|
+
* import type { DragType } from '@vuetify/v0'
|
|
5049
|
+
*
|
|
5050
|
+
* type Cards =
|
|
5051
|
+
* | { type: 'card', value: Card }
|
|
5052
|
+
* | { type: 'column', value: Column }
|
|
5053
|
+
* // Cards extends DragType — distributive over the union.
|
|
5054
|
+
* ```
|
|
5055
|
+
*/
|
|
5056
|
+
interface DragType {
|
|
5057
|
+
type: string;
|
|
5058
|
+
value: unknown;
|
|
5059
|
+
}
|
|
5060
|
+
/**
|
|
5061
|
+
* Resolved drop slot inside an oriented zone. Surfaced via {@link DropPosition}
|
|
5062
|
+
* so consumers can render a between-children indicator against the resolved
|
|
5063
|
+
* child rect.
|
|
5064
|
+
*
|
|
5065
|
+
* @example
|
|
5066
|
+
* ```ts
|
|
5067
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5068
|
+
*
|
|
5069
|
+
* const dnd = useDragDrop<{ type: 'card', value: Card }>()
|
|
5070
|
+
* const zone = dnd.zones.register({ el, accept: ['card'], orientation: 'vertical' })
|
|
5071
|
+
*
|
|
5072
|
+
* const indicator = zone.indicator.value
|
|
5073
|
+
* if (indicator) {
|
|
5074
|
+
* const y = indicator.edge === 'before'
|
|
5075
|
+
* ? indicator.rect.top
|
|
5076
|
+
* : indicator.rect.bottom
|
|
5077
|
+
* const x = indicator.rect.left
|
|
5078
|
+
* const width = indicator.rect.width
|
|
5079
|
+
* // Render a 2px bar at (x, y) with `width` to mark drop slot `indicator.index`.
|
|
5080
|
+
* }
|
|
5081
|
+
* ```
|
|
5082
|
+
*/
|
|
5083
|
+
interface DropIndicator {
|
|
5084
|
+
index: number;
|
|
5085
|
+
edge: 'before' | 'after';
|
|
5086
|
+
rect: DOMRect;
|
|
5087
|
+
}
|
|
5088
|
+
/**
|
|
5089
|
+
* Position passed to drop hooks. `index` and `indicator` are populated for
|
|
5090
|
+
* oriented zones; unoriented zones receive only the pointer location.
|
|
5091
|
+
*
|
|
5092
|
+
* @example
|
|
5093
|
+
* ```ts
|
|
5094
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5095
|
+
*
|
|
5096
|
+
* const dnd = useDragDrop<{ type: 'card', value: Card }>()
|
|
5097
|
+
*
|
|
5098
|
+
* dnd.zones.register({
|
|
5099
|
+
* el,
|
|
5100
|
+
* accept: ['card'],
|
|
5101
|
+
* orientation: 'vertical',
|
|
5102
|
+
* onDrop: (drag, position) => {
|
|
5103
|
+
* const target = position.index ?? items.length
|
|
5104
|
+
* items.splice(target, 0, drag.value)
|
|
5105
|
+
* },
|
|
5106
|
+
* })
|
|
5107
|
+
* ```
|
|
5108
|
+
*/
|
|
5109
|
+
interface DropPosition {
|
|
5110
|
+
pointer: {
|
|
5111
|
+
x: number;
|
|
5112
|
+
y: number;
|
|
5113
|
+
};
|
|
5114
|
+
index?: number;
|
|
5115
|
+
indicator?: DropIndicator;
|
|
5116
|
+
}
|
|
5117
|
+
/**
|
|
5118
|
+
* Source modality for an active drag. Adapters declare their own value via
|
|
5119
|
+
* the `Extensible<...>` escape hatch (e.g., 'touch', 'gamepad').
|
|
5120
|
+
*/
|
|
5121
|
+
type DragVia = Extensible<'pointer' | 'keyboard'>;
|
|
5122
|
+
/**
|
|
5123
|
+
* Active drag state. Distributive over `Z` so that narrowing `drag.type` also
|
|
5124
|
+
* narrows `drag.value` when `Z` is a discriminated union.
|
|
5125
|
+
*
|
|
5126
|
+
* @example
|
|
5127
|
+
* ```ts
|
|
5128
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5129
|
+
*
|
|
5130
|
+
* type Cards = { type: 'card', value: Card } | { type: 'column', value: Column }
|
|
5131
|
+
*
|
|
5132
|
+
* const dnd = useDragDrop<Cards>()
|
|
5133
|
+
*
|
|
5134
|
+
* dnd.zones.register({
|
|
5135
|
+
* el,
|
|
5136
|
+
* onEnter: drag => {
|
|
5137
|
+
* if (drag.type === 'card') drag.value.title // narrowed to Card
|
|
5138
|
+
* },
|
|
5139
|
+
* })
|
|
5140
|
+
* ```
|
|
5141
|
+
*/
|
|
5142
|
+
type ActiveDrag<Z extends DragType = DragType> = Z extends DragType ? {
|
|
5143
|
+
id: ID;
|
|
5144
|
+
type: Z['type'];
|
|
5145
|
+
value: Z['value'];
|
|
5146
|
+
origin: {
|
|
5147
|
+
x: number;
|
|
5148
|
+
y: number;
|
|
5149
|
+
};
|
|
5150
|
+
current: {
|
|
5151
|
+
x: number;
|
|
5152
|
+
y: number;
|
|
5153
|
+
};
|
|
5154
|
+
delta: {
|
|
5155
|
+
x: number;
|
|
5156
|
+
y: number;
|
|
5157
|
+
};
|
|
5158
|
+
over: ID | null;
|
|
5159
|
+
willAccept: boolean;
|
|
5160
|
+
via: DragVia;
|
|
5161
|
+
} : never;
|
|
5162
|
+
/**
|
|
5163
|
+
* Input shape for a draggable. Distributive over `Z` so unions narrow.
|
|
5164
|
+
*
|
|
5165
|
+
* @example
|
|
5166
|
+
* ```ts
|
|
5167
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5168
|
+
*
|
|
5169
|
+
* const dnd = useDragDrop<{ type: 'card', value: Card }>()
|
|
5170
|
+
*
|
|
5171
|
+
* dnd.draggables.register({
|
|
5172
|
+
* el: cardRef,
|
|
5173
|
+
* type: 'card',
|
|
5174
|
+
* value: card,
|
|
5175
|
+
* onBeforeStart: drag => !drag.value.locked,
|
|
5176
|
+
* })
|
|
5177
|
+
* ```
|
|
5178
|
+
*/
|
|
5179
|
+
type DraggableTicketInput<Z extends DragType = DragType> = Z extends DragType ? RegistryTicketInput & {
|
|
5180
|
+
type: Z['type'];
|
|
5181
|
+
value: Z['value'];
|
|
5182
|
+
el: MaybeRefOrGetter<HTMLElement | null>;
|
|
5183
|
+
disabled?: MaybeRefOrGetter<boolean>;
|
|
5184
|
+
onBeforeStart?: (drag: ActiveDrag<Z>) => boolean | void;
|
|
5185
|
+
onMove?: (drag: ActiveDrag<Z>) => void;
|
|
5186
|
+
onCancel?: (drag: ActiveDrag<Z>, reason: 'cancel' | 'reject') => void;
|
|
5187
|
+
} : never;
|
|
5188
|
+
/**
|
|
5189
|
+
* Output shape for a draggable. Distributive over `Z` so `ticket.type`
|
|
5190
|
+
* narrowing carries `ticket.value` to the matching union member.
|
|
5191
|
+
*
|
|
5192
|
+
* @example
|
|
5193
|
+
* ```ts
|
|
5194
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5195
|
+
*
|
|
5196
|
+
* const dnd = useDragDrop<{ type: 'card', value: Card }>()
|
|
5197
|
+
*
|
|
5198
|
+
* const ticket = dnd.draggables.register({ el, type: 'card', value: card })
|
|
5199
|
+
*
|
|
5200
|
+
* ticket.isDragging.value // boolean
|
|
5201
|
+
* ticket.value // Card
|
|
5202
|
+
* ```
|
|
5203
|
+
*/
|
|
5204
|
+
type DraggableTicket<Z extends DragType = DragType> = Z extends DragType ? RegistryTicket & {
|
|
5205
|
+
type: Z['type'];
|
|
5206
|
+
value: Z['value'];
|
|
5207
|
+
el: Readonly<Ref<HTMLElement | null>>;
|
|
5208
|
+
isDragging: Readonly<Ref<boolean>>;
|
|
5209
|
+
} : never;
|
|
5210
|
+
/**
|
|
5211
|
+
* Input shape for a drop zone.
|
|
5212
|
+
*
|
|
5213
|
+
* @example
|
|
5214
|
+
* ```ts
|
|
5215
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5216
|
+
*
|
|
5217
|
+
* const dnd = useDragDrop<{ type: 'card', value: Card }>()
|
|
5218
|
+
*
|
|
5219
|
+
* dnd.zones.register({
|
|
5220
|
+
* el: listRef,
|
|
5221
|
+
* accept: ['card'],
|
|
5222
|
+
* orientation: 'vertical',
|
|
5223
|
+
* onDrop: (drag, position) => items.splice(position.index ?? 0, 0, drag.value),
|
|
5224
|
+
* })
|
|
5225
|
+
* ```
|
|
5226
|
+
*/
|
|
5227
|
+
interface DropZoneTicketInput<Z extends DragType = DragType> extends RegistryTicketInput {
|
|
5228
|
+
el: MaybeRefOrGetter<HTMLElement | null>;
|
|
5229
|
+
/** Allowed drag types or a synchronous predicate. Async predicates (Promise / thenable returns) are rejected with a warning — `accept` must return synchronously. */
|
|
5230
|
+
accept?: Z['type'][] | ((drag: ActiveDrag<Z>) => boolean);
|
|
5231
|
+
orientation?: Orientation;
|
|
5232
|
+
disabled?: MaybeRefOrGetter<boolean>;
|
|
5233
|
+
onEnter?: (drag: ActiveDrag<Z>) => void;
|
|
5234
|
+
onLeave?: (drag: ActiveDrag<Z>) => void;
|
|
5235
|
+
onBeforeDrop?: (drag: ActiveDrag<Z>, position: DropPosition) => boolean | void;
|
|
5236
|
+
onDrop?: (drag: ActiveDrag<Z>, position: DropPosition) => void;
|
|
5237
|
+
}
|
|
5238
|
+
/**
|
|
5239
|
+
* Output shape for a drop zone.
|
|
5240
|
+
*
|
|
5241
|
+
* @example
|
|
5242
|
+
* ```ts
|
|
5243
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5244
|
+
*
|
|
5245
|
+
* const dnd = useDragDrop<{ type: 'card', value: Card }>()
|
|
5246
|
+
*
|
|
5247
|
+
* const zone = dnd.zones.register({ el, accept: ['card'] })
|
|
5248
|
+
*
|
|
5249
|
+
* zone.isOver.value // boolean
|
|
5250
|
+
* zone.willAccept.value // boolean
|
|
5251
|
+
* zone.indicator.value // DropIndicator | null
|
|
5252
|
+
* ```
|
|
5253
|
+
*/
|
|
5254
|
+
interface DropZoneTicket extends RegistryTicket {
|
|
5255
|
+
el: Readonly<Ref<HTMLElement | null>>;
|
|
5256
|
+
isOver: Readonly<Ref<boolean>>;
|
|
5257
|
+
willAccept: Readonly<Ref<boolean>>;
|
|
5258
|
+
indicator: Readonly<Ref<DropIndicator | null>>;
|
|
5259
|
+
}
|
|
5260
|
+
/**
|
|
5261
|
+
* Plugin signature. Receives the public context, optionally returns a
|
|
5262
|
+
* disposer that runs on scope teardown.
|
|
5263
|
+
*
|
|
5264
|
+
* @example
|
|
5265
|
+
* ```ts
|
|
5266
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5267
|
+
* import type { DragDropPlugin } from '@vuetify/v0'
|
|
5268
|
+
*
|
|
5269
|
+
* const logDrops: DragDropPlugin = context => {
|
|
5270
|
+
* const off = context.zones.on('register:ticket', ticket => console.log('zone', ticket.id))
|
|
5271
|
+
* return () => off()
|
|
5272
|
+
* }
|
|
5273
|
+
*
|
|
5274
|
+
* const dnd = useDragDrop({ plugins: [logDrops] })
|
|
5275
|
+
* ```
|
|
5276
|
+
*/
|
|
5277
|
+
type DragDropPlugin<Z extends DragType = DragType> = (context: DragDropContext<Z>) => (() => void) | void;
|
|
5278
|
+
/**
|
|
5279
|
+
* Options accepted by {@link useDragDrop}.
|
|
5280
|
+
*
|
|
5281
|
+
* @example
|
|
5282
|
+
* ```ts
|
|
5283
|
+
* import { useDragDrop, PointerAdapter } from '@vuetify/v0'
|
|
5284
|
+
*
|
|
5285
|
+
* const dnd = useDragDrop({
|
|
5286
|
+
* adapters: [new PointerAdapter()],
|
|
5287
|
+
* onDrop: (drag, position) => console.log('drop', drag, position),
|
|
5288
|
+
* })
|
|
5289
|
+
* ```
|
|
5290
|
+
*/
|
|
5291
|
+
interface DragDropOptions<Z extends DragType = DragType> {
|
|
5292
|
+
adapters?: DragDropAdapter<Z>[];
|
|
5293
|
+
plugins?: DragDropPlugin<Z>[];
|
|
5294
|
+
onBeforeStart?: (drag: ActiveDrag<Z>) => boolean | void;
|
|
5295
|
+
onMove?: (drag: ActiveDrag<Z>) => void;
|
|
5296
|
+
onBeforeDrop?: (drag: ActiveDrag<Z>, position: DropPosition) => boolean | void;
|
|
5297
|
+
onDrop?: (drag: ActiveDrag<Z>, position: DropPosition) => void;
|
|
5298
|
+
onCancel?: (drag: ActiveDrag<Z>, reason: 'cancel' | 'reject') => void;
|
|
5299
|
+
}
|
|
5300
|
+
/**
|
|
5301
|
+
* Registry context for draggable tickets, returned as `dnd.draggables`
|
|
5302
|
+
* from {@link useDragDrop}.
|
|
5303
|
+
*
|
|
5304
|
+
* @example
|
|
5305
|
+
* ```ts
|
|
5306
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5307
|
+
*
|
|
5308
|
+
* const dnd = useDragDrop<{ type: 'card', value: Card }>()
|
|
5309
|
+
*
|
|
5310
|
+
* const ticket = dnd.draggables.register({ el, type: 'card', value: card })
|
|
5311
|
+
* ```
|
|
5312
|
+
*/
|
|
5313
|
+
interface DraggablesContext<Z extends DragType = DragType> extends Omit<RegistryContext<DraggableTicketInput<Z>, DraggableTicketInput<Z> & DraggableTicket<Z>>, 'register'> {
|
|
5314
|
+
register: (registration: DraggableTicketInput<Z>) => DraggableTicket<Z>;
|
|
5315
|
+
}
|
|
5316
|
+
/**
|
|
5317
|
+
* Registry context for drop zones, returned as `dnd.zones`
|
|
5318
|
+
* from {@link useDragDrop}.
|
|
5319
|
+
*
|
|
5320
|
+
* @example
|
|
5321
|
+
* ```ts
|
|
5322
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5323
|
+
*
|
|
5324
|
+
* const dnd = useDragDrop<{ type: 'card', value: Card }>()
|
|
5325
|
+
*
|
|
5326
|
+
* const zone = dnd.zones.register({ el, accept: ['card'] })
|
|
5327
|
+
* ```
|
|
5328
|
+
*/
|
|
5329
|
+
interface ZonesContext<Z extends DragType = DragType> extends Omit<RegistryContext<DropZoneTicketInput<Z>, DropZoneTicketInput<Z> & DropZoneTicket>, 'register'> {
|
|
5330
|
+
register: (registration: DropZoneTicketInput<Z>) => DropZoneTicket;
|
|
5331
|
+
}
|
|
5332
|
+
/**
|
|
5333
|
+
* Public context returned by {@link useDragDrop}.
|
|
5334
|
+
*
|
|
5335
|
+
* @example
|
|
5336
|
+
* ```ts
|
|
5337
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5338
|
+
*
|
|
5339
|
+
* const dnd = useDragDrop<{ type: 'card', value: Card }>()
|
|
5340
|
+
*
|
|
5341
|
+
* dnd.active.value // ActiveDrag<{ type: 'card', value: Card }> | null
|
|
5342
|
+
* dnd.isDragging.value // boolean
|
|
5343
|
+
* dnd.cancel() // programmatic cancel
|
|
5344
|
+
* ```
|
|
5345
|
+
*/
|
|
5346
|
+
interface DragDropContext<Z extends DragType = DragType> {
|
|
5347
|
+
draggables: DraggablesContext<Z>;
|
|
5348
|
+
zones: ZonesContext<Z>;
|
|
5349
|
+
active: Readonly<ShallowRef<ActiveDrag<Z> | null>>;
|
|
5350
|
+
isDragging: Readonly<Ref<boolean>>;
|
|
5351
|
+
cancel: () => void;
|
|
5352
|
+
}
|
|
5353
|
+
/**
|
|
5354
|
+
* Create a headless drag-and-drop context.
|
|
5355
|
+
*
|
|
5356
|
+
* @param options - Adapters, plugins, and lifecycle hooks. All optional.
|
|
5357
|
+
* @returns A `DragDropContext<Z>` exposing `draggables` / `zones` registries,
|
|
5358
|
+
* the `active` drag, the `isDragging` boolean, and a programmatic `cancel()`.
|
|
5359
|
+
*
|
|
5360
|
+
* @see https://0.vuetifyjs.com/composables/system/use-drag-drop
|
|
5361
|
+
*
|
|
5362
|
+
* @example
|
|
5363
|
+
* ```ts
|
|
5364
|
+
* import { useDragDrop } from '@vuetify/v0'
|
|
5365
|
+
* import { useTemplateRef } from 'vue'
|
|
5366
|
+
*
|
|
5367
|
+
* const dnd = useDragDrop<{ type: 'card', value: string }>()
|
|
5368
|
+
*
|
|
5369
|
+
* const draggable = useTemplateRef<HTMLElement>('draggable')
|
|
5370
|
+
* const dropzone = useTemplateRef<HTMLElement>('dropzone')
|
|
5371
|
+
*
|
|
5372
|
+
* dnd.draggables.register({ el: draggable, type: 'card', value: 'card-1' })
|
|
5373
|
+
* dnd.zones.register({
|
|
5374
|
+
* el: dropzone,
|
|
5375
|
+
* accept: ['card'],
|
|
5376
|
+
* onDrop: (drag, position) => console.log(drag.value, position.index),
|
|
5377
|
+
* })
|
|
5378
|
+
* ```
|
|
5379
|
+
*/
|
|
5380
|
+
declare function useDragDrop<Z extends DragType = DragType>(options?: DragDropOptions<Z>): DragDropContext<Z>;
|
|
5381
|
+
//#endregion
|
|
5382
|
+
//#region src/composables/useEventListener/index.d.ts
|
|
5383
|
+
type CleanupFunction = () => void;
|
|
5384
|
+
type EventHandler<E = Event> = (event: E) => void;
|
|
5385
|
+
/**
|
|
5386
|
+
* Attaches an event listener to the window.
|
|
5387
|
+
*
|
|
5388
|
+
* @param target The window object.
|
|
5389
|
+
* @param event The event to listen for.
|
|
5390
|
+
* @param listener The event listener.
|
|
5391
|
+
* @param options The event listener options.
|
|
5392
|
+
* @template E The event type.
|
|
5393
|
+
* @returns A function to remove the event listener.
|
|
4360
5394
|
*
|
|
4361
5395
|
* @see https://0.vuetifyjs.com/composables/system/use-event-listener
|
|
4362
5396
|
*/
|
|
@@ -4471,7 +5505,7 @@ interface FeaturePluginOptions extends FeatureContextOptions {
|
|
|
4471
5505
|
*
|
|
4472
5506
|
* @remarks Adapters provide dynamic flag values from external services.
|
|
4473
5507
|
*/
|
|
4474
|
-
adapter?: MaybeArray<
|
|
5508
|
+
adapter?: MaybeArray<FeaturesAdapter>;
|
|
4475
5509
|
}
|
|
4476
5510
|
/**
|
|
4477
5511
|
* Creates a new features instance.
|
|
@@ -5137,6 +6171,14 @@ interface UseMutationObserverReturn extends ObserverReturn {}
|
|
|
5137
6171
|
*/
|
|
5138
6172
|
declare function useMutationObserver(target: MaybeElementRef, callback: (entries: MutationObserverRecord[]) => void, options?: UseMutationObserverOptions): UseMutationObserverReturn;
|
|
5139
6173
|
//#endregion
|
|
6174
|
+
//#region src/composables/useNotifications/adapters/adapter.d.ts
|
|
6175
|
+
declare abstract class NotificationsAdapter<Z extends NotificationInput = NotificationInput, E extends NotificationTicket<Z> = NotificationTicket<Z>> {
|
|
6176
|
+
/** Called once when the plugin installs. Wire inbound/outbound sync here. */
|
|
6177
|
+
abstract setup(context: NotificationsAdapterContext<Z, E>): void;
|
|
6178
|
+
/** Called on app unmount. Tear down listeners and connections. */
|
|
6179
|
+
dispose?(): void;
|
|
6180
|
+
}
|
|
6181
|
+
//#endregion
|
|
5140
6182
|
//#region src/composables/useNotifications/index.d.ts
|
|
5141
6183
|
/** Notification urgency level. Maps to ARIA roles: `'error'`/`'warning'` → `role="alert"`, `'info'`/`'success'` → `role="status"`. Extensible — custom values like `'critical'` are allowed with autocomplete for defaults. */
|
|
5142
6184
|
type NotificationSeverity = Extensible<'info' | 'warning' | 'error' | 'success'>;
|
|
@@ -5181,22 +6223,11 @@ interface NotificationsAdapterContext<Z extends NotificationInput = Notification
|
|
|
5181
6223
|
send: (input: Z) => E;
|
|
5182
6224
|
/** Create a notification in registry only (no toast). Use for initial/historical items. */
|
|
5183
6225
|
register: (input: Z) => E;
|
|
5184
|
-
/** Subscribe to notification lifecycle events (e.g., `'notification:read'`). */
|
|
6226
|
+
/** Subscribe to notification lifecycle events (e.g., `'notification:read'`). The handler receives the affected {@link NotificationTicket}. */
|
|
5185
6227
|
on: (event: string, handler: (data: unknown) => void) => void;
|
|
5186
6228
|
/** Unsubscribe from a lifecycle event. */
|
|
5187
6229
|
off: (event: string, handler: (data: unknown) => void) => void;
|
|
5188
6230
|
}
|
|
5189
|
-
/**
|
|
5190
|
-
* Adapter interface for bridging external notification services.
|
|
5191
|
-
* Adapters receive an {@link NotificationsAdapterContext} on setup
|
|
5192
|
-
* and optionally clean up on dispose.
|
|
5193
|
-
*/
|
|
5194
|
-
interface NotificationsAdapterInterface<Z extends NotificationInput = NotificationInput, E extends NotificationTicket<Z> = NotificationTicket<Z>> {
|
|
5195
|
-
/** Called once when the plugin installs. Wire inbound/outbound sync here. */
|
|
5196
|
-
setup: (context: NotificationsAdapterContext<Z, E>) => void;
|
|
5197
|
-
/** Called on app unmount. Tear down listeners and connections. */
|
|
5198
|
-
dispose?: () => void;
|
|
5199
|
-
}
|
|
5200
6231
|
/** Options for {@link createNotifications}. */
|
|
5201
6232
|
interface NotificationsOptions extends RegistryOptions {
|
|
5202
6233
|
/** Default auto-dismiss timeout in ms for the toast queue. @default 3000 */
|
|
@@ -5230,7 +6261,7 @@ interface NotificationsContext<Z extends NotificationInput = NotificationInput,
|
|
|
5230
6261
|
declare function createNotifications(options?: NotificationsOptions): NotificationsContext;
|
|
5231
6262
|
interface NotificationsPluginOptions extends NotificationsOptions {
|
|
5232
6263
|
namespace?: string;
|
|
5233
|
-
adapter?:
|
|
6264
|
+
adapter?: NotificationsAdapter;
|
|
5234
6265
|
}
|
|
5235
6266
|
/**
|
|
5236
6267
|
* Notification management with registry, event system, and optional adapters.
|
|
@@ -5252,15 +6283,12 @@ interface NotificationsPluginOptions extends NotificationsOptions {
|
|
|
5252
6283
|
declare const createNotificationsContext: <_E extends NotificationsContext<NotificationInput, NotificationTicket<NotificationInput>> = NotificationsContext<NotificationInput, NotificationTicket<NotificationInput>>>(_options?: NotificationsPluginOptions | undefined) => ContextTrinity<_E>, createNotificationsPlugin: (_options?: NotificationsPluginOptions | undefined) => Plugin, useNotifications: <_E extends NotificationsContext<NotificationInput, NotificationTicket<NotificationInput>> = NotificationsContext<NotificationInput, NotificationTicket<NotificationInput>>>(namespace?: string) => _E;
|
|
5253
6284
|
//#endregion
|
|
5254
6285
|
//#region src/composables/usePermissions/adapters/adapter.d.ts
|
|
5255
|
-
|
|
5256
|
-
can: <Z extends PermissionTicket = PermissionTicket>(role: ID, action: string, subject: string, context: Record<string, unknown>, permissions: PermissionContext<Z>) => boolean;
|
|
5257
|
-
}
|
|
5258
|
-
declare abstract class PermissionAdapter implements PermissionAdapterInterface {
|
|
6286
|
+
declare abstract class PermissionsAdapter {
|
|
5259
6287
|
abstract can<Z extends PermissionTicket = PermissionTicket>(role: ID, action: string, subject: string, context: Record<string, unknown>, permissions: PermissionContext<Z>): boolean;
|
|
5260
6288
|
}
|
|
5261
6289
|
//#endregion
|
|
5262
6290
|
//#region src/composables/usePermissions/adapters/v0.d.ts
|
|
5263
|
-
declare class
|
|
6291
|
+
declare class V0PermissionsAdapter extends PermissionsAdapter {
|
|
5264
6292
|
constructor();
|
|
5265
6293
|
can<Z extends PermissionTicket = PermissionTicket>(role: ID, action: string, subject: string, context: Record<string, unknown>, permissions: PermissionContext<Z>): boolean;
|
|
5266
6294
|
}
|
|
@@ -5271,7 +6299,7 @@ interface PermissionContext<Z extends PermissionTicket = PermissionTicket> exten
|
|
|
5271
6299
|
can: (id: ID, action: string, subject: string, context?: Record<string, unknown>) => boolean;
|
|
5272
6300
|
}
|
|
5273
6301
|
interface PermissionOptions extends TokenOptions {
|
|
5274
|
-
adapter?:
|
|
6302
|
+
adapter?: PermissionsAdapter;
|
|
5275
6303
|
permissions?: Record<ID, [string | string[], string | string[], (boolean | ((context: Record<string, unknown>) => boolean))?][]>;
|
|
5276
6304
|
}
|
|
5277
6305
|
interface PermissionContextOptions extends PermissionOptions {
|
|
@@ -5581,7 +6609,7 @@ declare function useElementSize(target: MaybeElementRef): UseElementSizeReturn;
|
|
|
5581
6609
|
//#endregion
|
|
5582
6610
|
//#region src/composables/useRovingFocus/index.d.ts
|
|
5583
6611
|
interface RovingItem extends TraversalItem {
|
|
5584
|
-
el?: MaybeRefOrGetter<
|
|
6612
|
+
el?: MaybeRefOrGetter<Element | null | undefined>;
|
|
5585
6613
|
}
|
|
5586
6614
|
interface RovingFocusOptions {
|
|
5587
6615
|
target?: MaybeRefOrGetter<HTMLElement | null | undefined>;
|
|
@@ -5613,12 +6641,12 @@ interface RtlAdapterSetupContext {
|
|
|
5613
6641
|
isRtl: Ref<boolean>;
|
|
5614
6642
|
toggle: () => void;
|
|
5615
6643
|
}
|
|
5616
|
-
|
|
5617
|
-
setup
|
|
6644
|
+
declare abstract class RtlAdapter {
|
|
6645
|
+
abstract setup<T extends RtlAdapterSetupContext>(app: App, context: T, target?: string | HTMLElement | null): void;
|
|
5618
6646
|
}
|
|
5619
6647
|
//#endregion
|
|
5620
6648
|
//#region src/composables/useRtl/adapters/v0.d.ts
|
|
5621
|
-
declare class
|
|
6649
|
+
declare class V0RtlAdapter extends RtlAdapter {
|
|
5622
6650
|
setup<T extends RtlAdapterSetupContext>(app: App, context: T, target?: string | HTMLElement | null): void;
|
|
5623
6651
|
}
|
|
5624
6652
|
//#endregion
|
|
@@ -5898,7 +6926,7 @@ interface StorageContext {
|
|
|
5898
6926
|
clear: () => void;
|
|
5899
6927
|
}
|
|
5900
6928
|
interface StorageOptions {
|
|
5901
|
-
/** The storage adapter to use. Defaults to localStorage in browser,
|
|
6929
|
+
/** The storage adapter to use. Defaults to localStorage in browser, MemoryStorageAdapter otherwise */
|
|
5902
6930
|
adapter?: StorageAdapter;
|
|
5903
6931
|
/** The prefix to use for all storage keys. Defaults to 'v0:' */
|
|
5904
6932
|
prefix?: string;
|
|
@@ -5948,11 +6976,7 @@ interface ThemeAdapterSetupContext {
|
|
|
5948
6976
|
selectedId: Ref<ID | null | undefined>;
|
|
5949
6977
|
isDark: Readonly<Ref<boolean>>;
|
|
5950
6978
|
}
|
|
5951
|
-
|
|
5952
|
-
setup: <T extends ThemeAdapterSetupContext>(app: App, context: T, target?: string | HTMLElement | null) => void;
|
|
5953
|
-
update: (colors: Record<string, Colors>, isDark?: boolean) => void;
|
|
5954
|
-
}
|
|
5955
|
-
declare abstract class ThemeAdapter implements ThemeAdapterInterface {
|
|
6979
|
+
declare abstract class ThemeAdapter {
|
|
5956
6980
|
private static UNSAFE_CSS;
|
|
5957
6981
|
private static SAFE_IDENT;
|
|
5958
6982
|
stylesheetId: string;
|
|
@@ -6222,10 +7246,19 @@ declare const createThemeContext: <_E extends ThemeContext<ThemeTicketInput, The
|
|
|
6222
7246
|
//#region src/composables/useTimer/index.d.ts
|
|
6223
7247
|
interface TimerOptions {
|
|
6224
7248
|
/**
|
|
6225
|
-
* Duration in milliseconds.
|
|
7249
|
+
* Duration in milliseconds. Accepts a plain number, ref, or getter — the
|
|
7250
|
+
* value is read fresh each time `start()` is invoked, so reactive sources
|
|
7251
|
+
* can change between runs without recreating the timer.
|
|
7252
|
+
*
|
|
6226
7253
|
* @default 1000
|
|
7254
|
+
*
|
|
7255
|
+
* @example
|
|
7256
|
+
* ```ts
|
|
7257
|
+
* useTimer(handler, { duration: 5000 })
|
|
7258
|
+
* useTimer(handler, { duration: () => isFast.value ? 100 : 1000 })
|
|
7259
|
+
* ```
|
|
6227
7260
|
*/
|
|
6228
|
-
duration?: number
|
|
7261
|
+
duration?: MaybeRefOrGetter<number>;
|
|
6229
7262
|
/**
|
|
6230
7263
|
* Whether the timer repeats after firing.
|
|
6231
7264
|
* @default false
|
|
@@ -6265,6 +7298,12 @@ interface TimerContext {
|
|
|
6265
7298
|
* timer.pause()
|
|
6266
7299
|
* timer.resume()
|
|
6267
7300
|
* timer.stop()
|
|
7301
|
+
*
|
|
7302
|
+
* // Reactive duration — re-read on each start()
|
|
7303
|
+
* const duration = shallowRef(1000)
|
|
7304
|
+
* const reactive = useTimer(handler, { duration })
|
|
7305
|
+
* duration.value = 2000
|
|
7306
|
+
* reactive.start() // fires after 2000ms
|
|
6268
7307
|
* ```
|
|
6269
7308
|
*/
|
|
6270
7309
|
declare function useTimer(handler: () => void, options?: TimerOptions): TimerContext;
|
|
@@ -6337,4 +7376,4 @@ interface ToggleScopeControls {
|
|
|
6337
7376
|
*/
|
|
6338
7377
|
declare function useToggleScope(source: WatchSource<boolean>, fn: (() => void) | ((controls: ToggleScopeControls) => void)): ToggleScopeControls;
|
|
6339
7378
|
//#endregion
|
|
6340
|
-
export {
|
|
7379
|
+
export { RtlAdapterSetupContext as $, RulesContextOptions as $a, createNumberField as $i, useFeatures as $n, GroupTicket as $o, createBreakpointsPlugin as $r, usePrefersDark as $t, createStoragePlugin as A, InputOptions as Aa, RatingItemState as Ai, useIntersectionObserver as An, VirtualFocusOptions as Ao, UseDelayStartOptions as Ar, createSelectionContext as As, usePermissions as At, createStackPlugin as B, FormValue as Ba, createQueue as Bi, PlatformContext as Bn, StepTicketInput as Bo, ClickOutsideElement as Br, createNotifications as Bt, ThemeAdapter as C, SortableEventListener as Ca, SliderContext as Ci, LazyOptions as Cn, ServerComboboxAdapter as Co, PointerAdapter as Cr, useImage as Cs, PermissionContextOptions as Ct, StoragePluginOptions as D, SortableTicketInput as Da, RatingContext as Di, UseElementIntersectionReturn as Dn, ComboboxAdapterContext as Do, DragDropAdapterEmit as Dr, SelectionTicket as Ds, createPermissions as Dt, StorageOptions as E, SortableTicket as Ea, createSlider as Ei, IntersectionObserverOptions as En, ComboboxAdapter as Eo, DragDropAdapterContext as Er, SelectionOptions as Es, PermissionTicket as Et, StackPluginOptions as F, FormOptions as Fa, QueueContext as Fi, createFallbackHydration as Fn, usePopover as Fo, DatePluginOptions as Fr, ModelTicketInput as Fs, NotificationTicket as Ft, RtlPluginOptions as G, ValidationOptions as Ga, ProgressOptions as Gi, FeatureContextOptions as Gn, OverflowContextOptions as Go, useClickOutside as Gr, MutationObserverRecord as Gt, RtlContext as H, createFormContext as Ha, useQueue as Hi, UseHotkeyReturn as Hn, createStepContext as Ho, ClickOutsideTarget as Hr, createNotificationsPlugin as Ht, StackTicket as I, FormTicket as Ia, QueueContextOptions as Ii, createHydration as In, StepContext as Io, createDate as Ir, createModel as Is, NotificationsAdapterContext as It, createRtlFallback as J, createValidation as Ja, createProgress as Ji, FeatureTicket as Jn, createOverflowContext as Jo, BreakpointsContextOptions as Jr, UseMutationObserverReturn as Jt, createRtl as K, ValidationTicket as Ka, ProgressTicket as Ki, FeatureOptions as Kn, OverflowOptions as Ko, BreakpointName as Kr, ObservableNodeList as Kt, StackTicketInput as L, FormTicketInput as La, QueueOptions as Li, createHydrationContext as Ln, StepContextOptions as Lo, createDateContext as Lr, NotificationsContext as Lt, StackContext as M, createInput as Ma, createRating as Mi, HydrationContextOptions as Mn, useVirtualFocus as Mo, DateContext as Mr, ModelContext as Ms, PermissionsAdapter as Mt, StackContextOptions as N, FormContext as Na, createRatingContext as Ni, HydrationOptions as Nn, PopoverOptions as No, DateContextOptions as Nr, ModelOptions as Ns, NotificationInput as Nt, createStorage as O, createSortable as Oa, RatingContextOptions as Oi, UseIntersectionObserverReturn as On, ComboboxAdapterResult as Oo, UseDelayOptions as Or, SelectionTicketInput as Os, createPermissionsContext as Ot, StackOptions as P, FormContextOptions as Pa, useRating as Pi, HydrationPluginOptions as Pn, PopoverReturn as Po, DateOptions as Pr, ModelTicket as Ps, NotificationSeverity as Pt, RtlAdapter as Q, RulesContext as Qa, NumberFieldOptions as Qi, createFeaturesPlugin as Qn, GroupOptions as Qo, createBreakpointsContext as Qr, usePrefersContrast as Qt, createStack as R, FormValidationResult as Ra, QueueTicket as Ri, createHydrationPlugin as Rn, StepOptions as Ro, createDatePlugin as Rr, NotificationsOptions as Rt, Vuetify0ThemeOptions as S, SortableContext as Sa, useTimeline as Si, LazyContext as Sn, useCombobox as So, KeyboardAdapterOptions as Sr, UseImageReturn as Ss, PermissionContext as St, StorageContextOptions as T, SortableOptions as Ta, SliderTicketInput as Ti, IntersectionObserverEntry as Tn, ClientComboboxAdapterOptions as To, DragDropAdapter as Tr, SelectionContextOptions as Ts, PermissionPluginOptions as Tt, RtlContextOptions as U, useForm as Ua, ProgressContext as Ui, useHotkey as Un, useStep as Uo, UseClickOutsideOptions as Ur, useNotifications as Ut, useStack as V, createForm as Va, createQueueContext as Vi, UseHotkeyOptions as Vn, createStep as Vo, ClickOutsideIgnoreTarget as Vr, createNotificationsContext as Vt, RtlOptions as W, ValidationContext as Wa, ProgressContextOptions as Wi, FeatureContext as Wn, OverflowContext as Wo, UseClickOutsideReturn as Wr, NotificationsAdapter as Wt, useRtl as X, RuleAliases as Xa, useProgress as Xi, createFeatures as Xn, GroupContext as Xo, BreakpointsPluginOptions as Xr, MediaQueryContext as Xt, createRtlPlugin as Y, RuleAlias as Ya, createProgressContext as Yi, FeatureTicketInput as Yn, useOverflow as Yo, BreakpointsOptions as Yr, useMutationObserver as Yt, V0RtlAdapter as Z, RuleInput as Za, NumberFieldContext as Zi, createFeaturesContext as Zn, GroupContextOptions as Zo, createBreakpoints as Zr, useMediaQuery as Zt, createThemePlugin as _, KanbanContext as _a, TimelineContextOptions as _i, createLocale as _n, useContext as _o, DropZoneTicketInput as _r, createSingle as _s, useProxyModel as _t, useTimer as a, useNested as aa, ScrollToOptions as ai, createLogger as an, useRules as ao, ActiveDrag as ar, BreadcrumbTicketInput as as, ResizeObserverOptions as at, V0UnheadThemeOptions as b, KanbanTransferPayload as ba, createTimeline as bi, createLocalePlugin as bn, createCombobox as bo, useDragDrop as br, ImageStatus as bs, UsePresenceReturn as bt, ThemeContext as c, NestedContextOptions as ca, VirtualContextOptions as ci, useLogger as cn, Plugin as co, DragDropPlugin as cr, BreadcrumbsOptions as cs, useElementSize as ct, ThemePluginOptions as d, NestedRegistration as da, VirtualOptions as di, LocaleContextOptions as dn, createPlugin as do, DraggableTicket as dr, useBreadcrumbs as ds, useRaf as dt, NumericContext as ea, useBreakpoints as ei, usePrefersReducedMotion as en, RulesOptions as eo, CleanupFunction as er, GroupTicketInput as es, RovingFocusOptions as et, ThemeRecord as f, NestedSelectionMode as fa, VirtualState as fi, LocaleOptions as fn, createPluginContext as fo, DraggableTicketInput as fr, SingleContext as fs, ProxyRegistryContext as ft, createThemeContext as g, KanbanColumnTicketInput as ga, TimelineContext as gi, LocaleTicketInput as gn, provideContext as go, DropZoneTicket as gr, SingleTicketInput as gs, ProxyModelTarget as gt, createTheme as h, KanbanColumnTicket as ha, useVirtual as hi, LocaleTicket as hn, createContext as ho, DropPosition as hr, SingleTicket as hs, ProxyModelOptions as ht, TimerOptions as i, createNestedContext as ia, toArray as ii, LoggerPluginOptions as in, createRulesPlugin as io, useWindowEventListener as ir, BreadcrumbTicket as is, ResizeObserverEntry as it, useStorage as j, InputState as ja, RatingOptions as ji, HydrationContext as jn, VirtualFocusReturn as jo, useDelay as jr, useSelection as js, V0PermissionsAdapter as jt, createStorageContext as k, InputContext as ka, RatingItemDescriptor as ki, useElementIntersection as kn, VirtualFocusItem as ko, UseDelayReturn as kr, createSelection as ks, createPermissionsPlugin as kt, ThemeContextOptions as l, NestedOpenMode as la, VirtualDirection as li, LogLevel as ln, PluginContextConfig as lo, DragType as lr, createBreadcrumbs as ls, useResizeObserver as lt, ThemeTicketInput as m, NestedTicketInput as ma, createVirtualContext as mi, LocaleRecord as mn, CreateContextOptions as mo, DropIndicator as mr, SingleOptions as ms, useProxyRegistry as mt, useToggleScope as n, createNumeric as na, MaybeElementRef as ni, LoggerContextOptions as nn, createRulesContext as no, useDocumentEventListener as nr, createGroupContext as ns, RovingItem as nt, Colors as o, NestedActiveMode as oa, VirtualAnchor as oi, createLoggerContext as on, StandardSchemaV1 as oo, DragDropContext as or, BreadcrumbsContext as os, UseElementSizeReturn as ot, ThemeTicket as p, NestedTicket as pa, createVirtual as pi, LocalePluginOptions as pn, ContextKey as po, DraggablesContext as pr, SingleContextOptions as ps, ProxyRegistryOptions as pt, createRtlContext as q, ValidationTicketInput as qa, ProgressTicketInput as qi, FeaturePluginOptions as qn, createOverflow as qo, BreakpointsContext as qr, UseMutationObserverOptions as qt, TimerContext as r, createNested as ra, toElement as ri, LoggerOptions as rn, createRulesFallback as ro, useEventListener as rr, useGroup as rs, useRovingFocus as rt, ThemeColors as s, NestedContext as sa, VirtualContext as si, createLoggerPlugin as sn, isStandardSchema as so, DragDropOptions as sr, BreadcrumbsContextOptions as ss, UseResizeObserverReturn as st, ToggleScopeControls as t, NumericOptions as ta, toReactive as ti, LoggerContext as tn, createRules as to, EventHandler as tr, createGroup as ts, RovingFocusReturn as tt, ThemeOptions as u, NestedOptions as ua, VirtualItem as ui, LocaleContext as un, PluginOptions as uo, DragVia as ur, createBreadcrumbsContext as us, UseRafReturn as ut, useTheme as v, KanbanEventListener as va, TimelineOptions as vi, createLocaleContext as vn, ComboboxContext as vo, Orientation as vr, createSingleContext as vs, PresenceState as vt, StorageContext as w, SortableMovePayload as wa, SliderOptions as wi, useLazy as wn, ClientComboboxAdapter as wo, PointerAdapterOptions as wr, SelectionContext as ws, PermissionOptions as wt, V0StyleSheetThemeAdapter as x, createKanban as xa, createTimelineContext as xi, useLocale as xn, createComboboxContext as xo, KeyboardAdapter as xr, UseImageOptions as xs, usePresence as xt, V0UnheadThemeAdapter as y, KanbanOptions as ya, TimelineTicket as yi, createLocaleFallback as yn, ComboboxOptions as yo, ZonesContext as yr, useSingle as ys, UsePresenceOptions as yt, createStackContext as z, FormValidationRule as za, QueueTicketInput as zi, useHydration as zn, StepTicket as zo, useDate as zr, NotificationsPluginOptions as zt };
|