@rokkit/core 1.0.0-next.113 → 1.0.0-next.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/actions/src/delegate.svelte.d.ts +13 -0
- package/dist/packages/actions/src/dismissable.svelte.d.ts +7 -0
- package/dist/packages/actions/src/fillable.svelte.d.ts +8 -0
- package/dist/packages/actions/src/index.d.ts +11 -0
- package/dist/packages/actions/src/kbd.d.ts +44 -0
- package/dist/packages/actions/src/keyboard.svelte.d.ts +7 -0
- package/dist/packages/actions/src/lib/event-manager.d.ts +8 -0
- package/dist/packages/actions/src/lib/index.d.ts +2 -0
- package/dist/packages/actions/src/lib/internal.d.ts +19 -0
- package/dist/packages/actions/src/navigable.svelte.d.ts +8 -0
- package/dist/packages/actions/src/navigator.svelte.d.ts +20 -0
- package/dist/packages/actions/src/pannable.svelte.d.ts +6 -0
- package/dist/packages/actions/src/skinnable.svelte.d.ts +8 -0
- package/dist/packages/actions/src/swipeable.svelte.d.ts +14 -0
- package/dist/packages/actions/src/themable.svelte.d.ts +7 -0
- package/dist/packages/actions/src/types.d.ts +72 -0
- package/dist/packages/actions/src/utils.d.ts +18 -0
- package/dist/packages/bits-ui/src/index.d.ts +2 -0
- package/dist/packages/bits-ui/src/reference.d.ts +22 -0
- package/dist/packages/bits-ui/src/tree/constants.d.ts +13 -0
- package/dist/packages/bits-ui/src/tree/index.d.ts +7 -0
- package/dist/packages/bits-ui/src/tree/types.d.ts +71 -0
- package/dist/packages/core/src/calendar.d.ts +10 -0
- package/dist/packages/core/src/colors/index.d.ts +333 -0
- package/dist/packages/core/src/connector.d.ts +8 -0
- package/dist/packages/core/src/constants.d.ts +39 -0
- package/dist/packages/core/src/events.d.ts +12 -0
- package/dist/packages/core/src/field-mapper.d.ts +63 -0
- package/dist/packages/core/src/index.d.ts +13 -0
- package/dist/packages/core/src/key-event-map.d.ts +18 -0
- package/dist/packages/core/src/mapped-items.d.ts +14 -0
- package/dist/packages/core/src/mapping.d.ts +75 -0
- package/dist/packages/core/src/nested.d.ts +18 -0
- package/dist/packages/core/src/string.d.ts +59 -0
- package/dist/packages/core/src/theme.d.ts +52 -0
- package/dist/packages/core/src/ticks.d.ts +10 -0
- package/dist/packages/core/src/types.d.ts +245 -0
- package/dist/packages/core/src/utils.d.ts +70 -0
- package/dist/packages/data/src/aggregators.d.ts +2 -0
- package/dist/packages/data/src/constants.d.ts +46 -0
- package/dist/packages/data/src/convert.d.ts +10 -0
- package/dist/packages/data/src/dataset.d.ts +43 -0
- package/dist/packages/data/src/filter.d.ts +26 -0
- package/dist/packages/data/src/formatter.d.ts +10 -0
- package/dist/packages/data/src/hierarchy.d.ts +36 -0
- package/dist/packages/data/src/index.d.ts +7 -0
- package/dist/packages/data/src/infer.d.ts +80 -0
- package/dist/packages/data/src/join.d.ts +95 -0
- package/dist/packages/data/src/list.d.ts +121 -0
- package/dist/packages/data/src/metadata.d.ts +32 -0
- package/dist/packages/data/src/model.d.ts +29 -0
- package/dist/packages/data/src/parser.d.ts +31 -0
- package/dist/packages/data/src/renamer.d.ts +37 -0
- package/dist/packages/data/src/rollup.d.ts +51 -0
- package/dist/packages/data/src/types.d.ts +346 -0
- package/dist/packages/data/src/utils.d.ts +6 -0
- package/dist/packages/data/src/view.d.ts +35 -0
- package/dist/packages/helpers/src/components/index.d.ts +2 -0
- package/dist/packages/helpers/src/index.d.ts +1 -0
- package/dist/packages/helpers/src/matchers/action.d.ts +27 -0
- package/dist/packages/helpers/src/matchers/array.d.ts +10 -0
- package/dist/packages/helpers/src/matchers/dataset.d.ts +10 -0
- package/dist/packages/helpers/src/matchers/event.d.ts +10 -0
- package/dist/packages/helpers/src/matchers/index.d.ts +4 -0
- package/dist/packages/helpers/src/matchers/internal.d.ts +1 -0
- package/dist/packages/helpers/src/mocks/animate.d.ts +1 -0
- package/dist/packages/helpers/src/mocks/element.d.ts +60 -0
- package/dist/packages/helpers/src/mocks/index.d.ts +2 -0
- package/dist/packages/helpers/src/mocks/match-media.d.ts +30 -0
- package/dist/packages/helpers/src/mocks/resize-observer.d.ts +9 -0
- package/dist/packages/helpers/src/simulators/index.d.ts +1 -0
- package/dist/packages/helpers/src/simulators/touch.d.ts +40 -0
- package/dist/packages/icons/src/convert.d.ts +22 -0
- package/dist/packages/icons/src/index.d.ts +2 -0
- package/dist/packages/input/src/index.d.ts +18 -0
- package/dist/packages/states/src/constants.d.ts +27 -0
- package/dist/packages/states/src/derive.svelte.d.ts +22 -0
- package/dist/packages/states/src/hierarchy.d.ts +34 -0
- package/dist/packages/states/src/index.d.ts +5 -0
- package/dist/packages/states/src/list-controller.svelte.d.ts +70 -0
- package/dist/packages/states/src/nested-controller.svelte.d.ts +32 -0
- package/dist/packages/states/src/proxy.svelte.d.ts +43 -0
- package/dist/packages/states/src/tabular.svelte.d.ts +5 -0
- package/dist/packages/states/src/traversal.svelte.d.ts +69 -0
- package/dist/packages/states/src/vibe.svelte.d.ts +622 -0
- package/dist/packages/themes/src/constants.d.ts +6 -0
- package/dist/packages/themes/src/index.d.ts +2 -0
- package/dist/packages/tutorial/src/assimilate.d.ts +25 -0
- package/dist/packages/tutorial/src/collector.d.ts +46 -0
- package/dist/packages/tutorial/src/files.d.ts +8 -0
- package/dist/packages/tutorial/src/index.d.ts +2 -0
- package/dist/packages/tutorial/src/metadata/base.d.ts +19 -0
- package/dist/packages/tutorial/src/metadata/factory.d.ts +19 -0
- package/dist/packages/tutorial/src/metadata/index.d.ts +2 -0
- package/dist/packages/tutorial/src/metadata/javascript.d.ts +7 -0
- package/dist/packages/tutorial/src/metadata/json.d.ts +7 -0
- package/dist/packages/tutorial/src/metadata/markdown.d.ts +7 -0
- package/dist/packages/tutorial/src/metadata/registry.d.ts +26 -0
- package/dist/packages/tutorial/src/metamodel.d.ts +45 -0
- package/dist/packages/tutorial/src/tutorial.d.ts +21 -0
- package/dist/packages/tutorial/src/types.d.ts +172 -0
- package/dist/packages/tutorial/src/utils.d.ts +13 -0
- package/dist/packages/ui/src/constants.d.ts +2 -0
- package/dist/packages/ui/src/index.d.ts +42 -0
- package/dist/packages/ui/src/input/types.d.ts +9 -0
- package/dist/packages/ui/src/lib/fields.d.ts +16 -0
- package/dist/packages/ui/src/lib/form.d.ts +95 -0
- package/dist/packages/ui/src/lib/index.d.ts +6 -0
- package/dist/packages/ui/src/lib/layout.d.ts +7 -0
- package/dist/packages/ui/src/lib/nested.d.ts +48 -0
- package/dist/packages/ui/src/lib/schema.d.ts +7 -0
- package/dist/packages/ui/src/lib/select.d.ts +8 -0
- package/dist/packages/ui/src/lib/tree.d.ts +9 -0
- package/dist/packages/ui/src/types.d.ts +5 -0
- package/dist/packages/ui/src/wrappers/index.d.ts +3 -0
- package/dist/sites/learn/src/hooks.d.ts +1 -0
- package/dist/sites/learn/src/hooks.server.d.ts +2 -0
- package/dist/sites/learn/src/lib/index.d.ts +7 -0
- package/dist/sites/learn/src/lib/media.d.ts +13 -0
- package/dist/sites/learn/src/lib/paraglide/messages/en.d.ts +3 -0
- package/dist/sites/learn/src/lib/paraglide/messages/fr.d.ts +3 -0
- package/dist/sites/learn/src/lib/paraglide/messages/hi.d.ts +3 -0
- package/dist/sites/learn/src/lib/paraglide/messages.d.ts +5 -0
- package/dist/sites/learn/src/lib/paraglide/runtime.d.ts +52 -0
- package/dist/sites/learn/src/lib/stories/02-elements/01-list/03-mapping/src/data.d.ts +5 -0
- package/dist/sites/learn/src/lib/stories/02-elements/01-list/04-mixed/src/data.d.ts +13 -0
- package/dist/sites/learn/src/lib/stories/02-elements/02-tabs/04-fields/src/data.d.ts +5 -0
- package/dist/sites/learn/src/lib/stories/02-elements/02-tabs/05-using/src/data.d.ts +6 -0
- package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/01-intro/src/data.d.ts +4 -0
- package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/02-fields/src/data.d.ts +9 -0
- package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/03-using/src/data.d.ts +19 -0
- package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/04-mixed/src/data.d.ts +30 -0
- package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/props.d.ts +15 -0
- package/dist/sites/learn/src/lib/stories/02-elements/04-tree/01-intro/src/data.d.ts +12 -0
- package/dist/sites/learn/src/lib/stories/02-elements/06-select/02-fields/src/data.d.ts +5 -0
- package/dist/sites/learn/src/lib/stories/02-elements/07-multi-select/02-fields/src/data.d.ts +5 -0
- package/dist/sites/learn/src/lib/stories/02-elements/08-drop-down/02-fields/src/data.d.ts +5 -0
- package/dist/sites/learn/src/lib/stories/05-templates/01-form/02-schema/src/schema.d.ts +22 -0
- package/dist/sites/learn/src/lib/stories/05-templates/01-form/03-layout/src/layout.d.ts +19 -0
- package/dist/sites/learn/src/lib/stories/05-templates/01-form/03-layout/src/schema.d.ts +36 -0
- package/dist/sites/learn/src/lib/stories/05-templates/01-form/05-validation/src/schema.d.ts +34 -0
- package/dist/sites/learn/src/lib/stories/05-templates/02-editor/01-introduction/src/data.d.ts +39 -0
- package/dist/sites/learn/src/lib/stories/05-templates/02-editor/01-introduction/src/schema.d.ts +187 -0
- package/dist/sites/learn/src/lib/stories/06-layout/03-stepper/01-intro/src/data.d.ts +37 -0
- package/dist/sites/learn/src/lib/stories/06-layout/03-stepper/02-play/src/data.d.ts +37 -0
- package/dist/sites/learn/src/lib/stories/index.d.ts +1 -0
- package/dist/sites/learn/src/lib/theme.svelte.d.ts +70 -0
- package/dist/sites/learn/src/routes/(learn)/+layout.d.ts +12 -0
- package/dist/sites/learn/src/routes/(learn)/[segment]/[...slug]/+page.d.ts +8 -0
- package/dist/sites/learn/src/routes/+layout.d.ts +18 -0
- package/dist/sites/quick-start/src/hooks.d.ts +1 -0
- package/dist/sites/quick-start/src/hooks.server.d.ts +2 -0
- package/dist/sites/quick-start/src/lib/index.d.ts +1 -0
- package/dist/sites/quick-start/src/lib/paraglide/messages/en.d.ts +3 -0
- package/dist/sites/quick-start/src/lib/paraglide/messages/fr.d.ts +3 -0
- package/dist/sites/quick-start/src/lib/paraglide/messages/hi.d.ts +3 -0
- package/dist/sites/quick-start/src/lib/paraglide/messages.d.ts +5 -0
- package/dist/sites/quick-start/src/lib/paraglide/runtime.d.ts +52 -0
- package/dist/sites/quick-start/src/routes/+layout.d.ts +9 -0
- package/package.json +2 -2
- package/src/constants.js +5 -4
- package/src/utils.js +2 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export namespace DEFAULT_EVENTS {
|
|
2
|
+
export { noop as move };
|
|
3
|
+
export { noop as select };
|
|
4
|
+
export { noop as expand };
|
|
5
|
+
export { noop as collapse };
|
|
6
|
+
}
|
|
7
|
+
export const VALID_DENSITIES: string[];
|
|
8
|
+
export const VALID_MODES: string[];
|
|
9
|
+
/** @type {string[]} */
|
|
10
|
+
export const DEFAULT_STYLES: string[];
|
|
11
|
+
export namespace DEFAULT_VIBE_OPTIONS {
|
|
12
|
+
export { DEFAULT_STYLES as allowed };
|
|
13
|
+
export let style: string;
|
|
14
|
+
export let mode: string;
|
|
15
|
+
export let density: string;
|
|
16
|
+
}
|
|
17
|
+
export namespace DEFAULT_VIBE_PALETTE {
|
|
18
|
+
let primary: string;
|
|
19
|
+
let secondary: string;
|
|
20
|
+
let success: string;
|
|
21
|
+
let info: string;
|
|
22
|
+
let warning: string;
|
|
23
|
+
let danger: string;
|
|
24
|
+
let light: string;
|
|
25
|
+
let dark: string;
|
|
26
|
+
}
|
|
27
|
+
import { noop } from '@rokkit/core';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {Array<*>} items
|
|
4
|
+
* @param {import('@rokkit/core').FieldMapping} fields
|
|
5
|
+
* @param {Array<number>} path
|
|
6
|
+
* @returns {Array<{ key: string, value: any }>}
|
|
7
|
+
*/
|
|
8
|
+
export function flatVisibleNodes(items: Array<any>, fields?: import("@rokkit/core").FieldMapping, path?: Array<number>): Array<{
|
|
9
|
+
key: string;
|
|
10
|
+
value: any;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Derives a flat lookup table for the given items, using index paths as keys
|
|
14
|
+
* Each value is a Proxy instance for convenient manipulation
|
|
15
|
+
*
|
|
16
|
+
* @param {Array<*>} items - Source items array
|
|
17
|
+
* @param {import('@rokkit/core').FieldMapping} fields - Field mappings configuration
|
|
18
|
+
* @param {Array<number>} path - Current path in the tree
|
|
19
|
+
* @returns {Map<string, Proxy>} - Map of path keys to Proxy instances
|
|
20
|
+
*/
|
|
21
|
+
export function deriveLookupWithProxy(items: Array<any>, fields?: import("@rokkit/core").FieldMapping, path?: Array<number>): Map<string, Proxy>;
|
|
22
|
+
import { Proxy } from './proxy.svelte';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} HierarchyItem
|
|
3
|
+
* @property {number} depth - The depth of the item in the hierarchy.
|
|
4
|
+
* @property {Array<number>} path - The path of the item in the hierarchy.
|
|
5
|
+
* @property {any} item - The item itself.
|
|
6
|
+
* @property {HierarchyItem} parent - The reference to the parent item.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Converts a hierarchy of items into a flat array of objects.
|
|
10
|
+
*ß
|
|
11
|
+
* @param {Array<any>} items - The array of items to convert.
|
|
12
|
+
* @param {import('@rokkit/core').FieldMapper} mapping - The field mapper to use for mapping.
|
|
13
|
+
* @param {HierarchyItem} parent - The current path of the item.
|
|
14
|
+
* @returns {Array<Object>} - The flat array of objects.
|
|
15
|
+
*/
|
|
16
|
+
export function flatHierarchy(items: Array<any>, mapping: import("@rokkit/core").FieldMapper, parent?: HierarchyItem): Array<Object>;
|
|
17
|
+
export type HierarchyItem = {
|
|
18
|
+
/**
|
|
19
|
+
* - The depth of the item in the hierarchy.
|
|
20
|
+
*/
|
|
21
|
+
depth: number;
|
|
22
|
+
/**
|
|
23
|
+
* - The path of the item in the hierarchy.
|
|
24
|
+
*/
|
|
25
|
+
path: Array<number>;
|
|
26
|
+
/**
|
|
27
|
+
* - The item itself.
|
|
28
|
+
*/
|
|
29
|
+
item: any;
|
|
30
|
+
/**
|
|
31
|
+
* - The reference to the parent item.
|
|
32
|
+
*/
|
|
33
|
+
parent: HierarchyItem;
|
|
34
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export class ListController {
|
|
2
|
+
constructor(items: any, value: any, fields: any, options: any);
|
|
3
|
+
items: null;
|
|
4
|
+
fields: any;
|
|
5
|
+
mappers: any[];
|
|
6
|
+
selectedKeys: SvelteSet<any>;
|
|
7
|
+
focusedKey: null;
|
|
8
|
+
selected: null[];
|
|
9
|
+
focused: null | undefined;
|
|
10
|
+
data: {
|
|
11
|
+
key: string;
|
|
12
|
+
value: any;
|
|
13
|
+
}[];
|
|
14
|
+
lookup: Map<string, import("./proxy.svelte").Proxy>;
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
* @param {Array<*>} items
|
|
18
|
+
* @param {*} value
|
|
19
|
+
*/
|
|
20
|
+
private init;
|
|
21
|
+
get isNested(): boolean;
|
|
22
|
+
get currentKey(): null;
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
* @param {*} value
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
private findByValue;
|
|
29
|
+
/**
|
|
30
|
+
* @private
|
|
31
|
+
* @param {*} value
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
private moveToValue;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param {string} path
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
moveTo(path: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
* @param {number} index
|
|
44
|
+
*/
|
|
45
|
+
private moveToIndex;
|
|
46
|
+
movePrev(): boolean;
|
|
47
|
+
moveNext(): boolean;
|
|
48
|
+
moveFirst(): boolean;
|
|
49
|
+
moveLast(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Toggles the selection.
|
|
52
|
+
* @private
|
|
53
|
+
* @param {string} key
|
|
54
|
+
*/
|
|
55
|
+
private toggleSelection;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @param {string} selectedKey
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
select(selectedKey: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param {string} selectedKey
|
|
65
|
+
* @returns
|
|
66
|
+
*/
|
|
67
|
+
extendSelection(selectedKey: string): boolean;
|
|
68
|
+
#private;
|
|
69
|
+
}
|
|
70
|
+
import { SvelteSet } from 'svelte/reactivity';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class NestedController extends ListController {
|
|
2
|
+
/**
|
|
3
|
+
* @protected
|
|
4
|
+
* @param {Object} [value]
|
|
5
|
+
*/
|
|
6
|
+
protected init(value?: Object): void;
|
|
7
|
+
/**
|
|
8
|
+
* Mark parents as expanded so that item is visible
|
|
9
|
+
* @param {*} value
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
ensureVisible(value: any): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Toggle expansion of item
|
|
15
|
+
* @param {*} value
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
toggleExpansion(key: any): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Expand item
|
|
21
|
+
* @param {*} value
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
expand(key: any): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Collapse item
|
|
27
|
+
* @param {*} value
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
collapse(key: any): boolean;
|
|
31
|
+
}
|
|
32
|
+
import { ListController } from './list-controller.svelte';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export class Proxy {
|
|
2
|
+
constructor(value: any, fields: any);
|
|
3
|
+
set fields(value: null);
|
|
4
|
+
get fields(): null;
|
|
5
|
+
set id(new_id: null);
|
|
6
|
+
get id(): null;
|
|
7
|
+
get children(): Proxy[];
|
|
8
|
+
set value(value: null);
|
|
9
|
+
get value(): null;
|
|
10
|
+
/**
|
|
11
|
+
* Gets a mapped attribute from the original item
|
|
12
|
+
*
|
|
13
|
+
* @param {string} fieldName - Name of the field to get
|
|
14
|
+
* @param {any} defaultValue - Default value to return if not found
|
|
15
|
+
* @returns {any|undefined} - The attribute value or null if not found
|
|
16
|
+
*/
|
|
17
|
+
get(fieldName: string, defaultValue: any): any | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a mapped attribute exists in the original item
|
|
20
|
+
* @param {string} fieldName - Name of the field to check
|
|
21
|
+
* @returns boolean
|
|
22
|
+
*/
|
|
23
|
+
has(fieldName: string): false | (<P extends PropertyKey>(s: P) => boolean);
|
|
24
|
+
/**
|
|
25
|
+
* Gets the appropriate snippet for rendering this item:
|
|
26
|
+
* - Uses the 'snippet' field from the current item to find the snippet key
|
|
27
|
+
* - Finds a matching snippet in the provided collection using this key
|
|
28
|
+
* - Falls back to the defaultSnippet if:
|
|
29
|
+
* - No snippet key is configured for this item
|
|
30
|
+
* - The configured snippet key doesn't exist in the snippets collection
|
|
31
|
+
* @param {Object} snippets
|
|
32
|
+
* @param {import('svelte').Snippet|undefined} defaultSnippet
|
|
33
|
+
* @returns {import('svelte').Snippet|undefined}
|
|
34
|
+
*/
|
|
35
|
+
getSnippet(snippets: Object, defaultSnippet: import("svelte").Snippet | undefined): import("svelte").Snippet | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Identifies if the item has children
|
|
38
|
+
*/
|
|
39
|
+
get hasChildren(): boolean;
|
|
40
|
+
set expanded(value: any);
|
|
41
|
+
get expanded(): any;
|
|
42
|
+
#private;
|
|
43
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles navigation through a flattened data structure
|
|
3
|
+
*/
|
|
4
|
+
export class Traversal {
|
|
5
|
+
/**
|
|
6
|
+
* @param {object} dataProvider - Data provider component
|
|
7
|
+
*/
|
|
8
|
+
constructor(dataProvider: object);
|
|
9
|
+
/**
|
|
10
|
+
* Gets the current focused key
|
|
11
|
+
* @returns {string|null} The current key or null if none selected
|
|
12
|
+
*/
|
|
13
|
+
get currentKey(): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the current focused index
|
|
16
|
+
* @returns {number} The current index or -1 if none selected
|
|
17
|
+
*/
|
|
18
|
+
get currentIndex(): number;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the currently focused item
|
|
21
|
+
* @returns {object|null} The focused item or null
|
|
22
|
+
*/
|
|
23
|
+
get focused(): object | null;
|
|
24
|
+
/**
|
|
25
|
+
* Calculates the current index based on the current key
|
|
26
|
+
* @private
|
|
27
|
+
* @returns {number} The current index or -1 if not found
|
|
28
|
+
*/
|
|
29
|
+
private getCurrentIndex;
|
|
30
|
+
/**
|
|
31
|
+
* Focuses on an item by its key
|
|
32
|
+
* @param {string} key - Key of the item to focus
|
|
33
|
+
* @returns {boolean} True if focus changed, false otherwise
|
|
34
|
+
*/
|
|
35
|
+
moveToKey(key: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Focuses on an item by its index in the flattened list
|
|
38
|
+
* @param {number} index - Index of the item to focus
|
|
39
|
+
* @returns {boolean} True if focus changed, false otherwise
|
|
40
|
+
*/
|
|
41
|
+
moveToIndex(index: number): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Focuses on an item by finding its value in the data
|
|
44
|
+
* @param {*} value - Value to find and focus
|
|
45
|
+
* @returns {boolean} True if found and focused, false otherwise
|
|
46
|
+
*/
|
|
47
|
+
moveToValue(value: any): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Moves focus to the previous visible item
|
|
50
|
+
* @returns {boolean} True if moved, false if at the beginning
|
|
51
|
+
*/
|
|
52
|
+
movePrev(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Moves focus to the next visible item
|
|
55
|
+
* @returns {boolean} True if moved, false if at the end
|
|
56
|
+
*/
|
|
57
|
+
moveNext(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Moves focus to the first item
|
|
60
|
+
* @returns {boolean} True if moved, false otherwise
|
|
61
|
+
*/
|
|
62
|
+
moveFirst(): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Moves focus to the last item
|
|
65
|
+
* @returns {boolean} True if moved, false otherwise
|
|
66
|
+
*/
|
|
67
|
+
moveLast(): boolean;
|
|
68
|
+
#private;
|
|
69
|
+
}
|