@dxtmisha/functional 1.15.8 → 1.15.12
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/CHANGELOG.md +15 -0
- package/ai-description.md +13 -6
- package/ai-doc.md +1 -0
- package/ai-mcp-resources.json +38 -0
- package/ai-resources/prompts.json +26 -0
- package/ai-types.md +1187 -322
- package/dist/library.js +20 -21
- package/package.json +5 -5
- package/ai-mcp.json +0 -38
- /package/{ai-prompts → ai-resources}/api-reference.md +0 -0
- /package/{ai-prompts → ai-resources}/localization-seo.md +0 -0
- /package/{ai-prompts → ai-resources}/reactivity-lists.md +0 -0
- /package/{ai-prompts → ai-resources}/storage-state.md +0 -0
package/ai-types.md
CHANGED
|
@@ -1,382 +1,769 @@
|
|
|
1
|
-
All these methods are in the @dxtmisha/functional library.
|
|
1
|
+
All these methods are in the @dxtmisha/functional (v1.15.12) library.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import { Datetime, GeoDate, GeoFirstDay, GeoHours, NumberOrStringOrDate, ElementOrString, ElementOrWindow, EventItem, EventListenerDetail, EventOptions, GeoFlag, GeoFlagItem, GeoFlagNational, ItemValue, NumberOrString, GeoItemFull, GeoUnit, ApiInstance, ApiData, ApiDataValidation, ApiErrorStorageList, ApiErrorItem, ApiFetch, FormattersListColumns, FormattersOptionsList, SearchColumns, SearchFormatList, FormattersListProp, FormattersReturn, MetaRobots, Meta, SearchItem, SearchOptions, TranslateInstance, TranslateList, ApiConfig, ErrorCenterCauseList, ErrorCenterHandlerCallback, ErrorCenterHandlerList, IconsConfig, TranslateConfig, ItemList, ApiDefaultValue, ApiMethodItem, Undefined, NumberOrStringOrBoolean, SearchListValue } from '@dxtmisha/functional-basic';
|
|
5
|
-
import { InputSocialIcons } from '@dxtmisha/media';
|
|
6
|
-
import { RouteLocationRaw, Router, _RouterClassic } from 'vue-router';
|
|
7
|
-
export type RefType<T> = ComputedRef<T> | Ref<T>;
|
|
8
|
-
export type RefUndefined<T> = RefType<T | undefined>;
|
|
9
|
-
export type RefOrNormal<T> = RefType<T> | T;
|
|
10
|
-
export type RefOrNormalOrFunction<T> = RefOrNormal<T> | (() => RefOrNormal<T>);
|
|
11
|
-
export type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
|
|
12
|
-
export type RawSlots = {
|
|
13
|
-
[name: string]: unknown;
|
|
14
|
-
$stable?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export type ApiOptions = ApiMethodItem | RefOrNormal<ApiFetch>;
|
|
17
|
-
export type ApiManagementValue = ApiDefaultValue | ApiDefaultValue[];
|
|
18
|
-
export type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = {
|
|
19
|
-
path?: RefOrNormal<string | undefined>;
|
|
20
|
-
options?: ApiOptions;
|
|
21
|
-
reactivity?: boolean;
|
|
22
|
-
conditions?: RefType<boolean>;
|
|
23
|
-
transformation?: (data: Type, isResponseContractValid?: ApiDataValidation) => ApiData<Return>;
|
|
24
|
-
validateResponseContract?: (data: Type) => ApiDataValidation;
|
|
25
|
-
errorContract?: ApiErrorStorageList;
|
|
26
|
-
typeData?: ((data: Return) => boolean) | any;
|
|
27
|
-
unmounted?: boolean;
|
|
28
|
-
skeleton?: () => Return;
|
|
29
|
-
};
|
|
30
|
-
export type ApiManagementSearch<T extends SearchItem, K extends SearchColumns<T>> = {
|
|
31
|
-
columns: K;
|
|
32
|
-
value?: Ref<string>;
|
|
33
|
-
options?: SearchOptions;
|
|
34
|
-
};
|
|
35
|
-
export type ApiManagementRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> = {
|
|
36
|
-
path?: RefOrNormal<string | undefined>;
|
|
37
|
-
action?: (data: Return | undefined) => Promise<void> | void;
|
|
38
|
-
transformation?: (data: T) => Return;
|
|
39
|
-
validateRequestContract?: (data: Request) => ApiDataValidation & Return;
|
|
40
|
-
validateResponseContract?: (data: T) => ApiDataValidation & Return;
|
|
41
|
-
errorContract?: ApiErrorStorageList;
|
|
42
|
-
toData?: boolean;
|
|
43
|
-
options?: ApiOptions;
|
|
44
|
-
};
|
|
45
|
-
export type ConstrItem = Record<string, any>;
|
|
46
|
-
export type ConstrValue<T = any> = {
|
|
47
|
-
value?: T;
|
|
48
|
-
};
|
|
49
|
-
export type ConstrComponent = Record<string, any>;
|
|
50
|
-
export type ConstrComponentMod<P extends ConstrItem> = ConstrItem | {
|
|
51
|
-
[K in keyof P]?: RefOrNormal<P[K]>;
|
|
52
|
-
};
|
|
53
|
-
export type ConstrExpose<E extends Element, EXPOSE extends ConstrItem> = EXPOSE & {
|
|
54
|
-
elementHtml?: ComputedRef<E | undefined>;
|
|
55
|
-
};
|
|
56
|
-
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
57
|
-
export type ConstrEmitItem<T extends ConstrItem> = T[keyof T];
|
|
58
|
-
export type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{
|
|
59
|
-
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
60
|
-
}>>;
|
|
61
|
-
export type ConstrClassObject = Record<string, boolean | undefined>;
|
|
62
|
-
export type ConstrClass = string | (string | ConstrClass | Undefined)[] | ConstrClassObject;
|
|
63
|
-
export type ConstrClassList = Record<string, ConstrClass>;
|
|
64
|
-
export type ConstrClasses = {
|
|
65
|
-
main: ConstrClass;
|
|
66
|
-
} & ConstrClassList;
|
|
67
|
-
export type ConstrStylesItem = string | null;
|
|
68
|
-
export type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
|
|
69
|
-
export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
|
|
70
|
-
components?: COMP;
|
|
71
|
-
compMod?: ConstrComponentMod<P>;
|
|
72
|
-
emits?: ConstrEmit<EMITS>;
|
|
73
|
-
classes?: RefType<ConstrClasses>;
|
|
74
|
-
styles?: RefType<ConstrStyles>;
|
|
75
|
-
};
|
|
76
|
-
export type ConstrSetup<E extends Element, CLASSES extends ConstrClasses, SETUP extends ConstrItem> = {
|
|
77
|
-
name: string;
|
|
78
|
-
element: Ref<E | undefined>;
|
|
79
|
-
classes: RefType<CLASSES>;
|
|
80
|
-
styles: RefType<ConstrStyles>;
|
|
81
|
-
} & SETUP;
|
|
82
|
-
export type ConstrRegistration = {
|
|
83
|
-
flag?: boolean;
|
|
84
|
-
translate?: Record<string, string>;
|
|
85
|
-
};
|
|
86
|
-
export type ConstrBind<T> = T & Record<string, any> & {
|
|
87
|
-
key?: string;
|
|
88
|
-
class?: ConstrClass;
|
|
89
|
-
style?: ConstrStyles;
|
|
90
|
-
};
|
|
91
|
-
export type ConstrPropItemOptions<T = any> = {
|
|
92
|
-
type?: PropType<T>;
|
|
93
|
-
required?: boolean;
|
|
94
|
-
default?: any;
|
|
95
|
-
validator?(value: any, props: any): boolean;
|
|
96
|
-
};
|
|
97
|
-
export type ConstrPropItem<T = any> = ConstrPropItemOptions<T> | PropType<T>;
|
|
98
|
-
export type ConstrProps<P = Record<string, any>> = {
|
|
99
|
-
[K in keyof P]: ConstrPropItem<P[K]>;
|
|
100
|
-
};
|
|
101
|
-
export type ConstrHrefProps = {
|
|
102
|
-
href?: string;
|
|
103
|
-
};
|
|
104
|
-
export type ListType = 'item' | 'space' | 'line' | 'subtitle' | 'html' | 'menu' | 'menu-group' | 'group';
|
|
105
|
-
export type ListDataBasic = {
|
|
106
|
-
label?: NumberOrString;
|
|
107
|
-
value?: any;
|
|
108
|
-
search?: string;
|
|
109
|
-
};
|
|
110
|
-
export type ListDataItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item & {
|
|
111
|
-
parent?: string;
|
|
112
|
-
type: ListType;
|
|
113
|
-
index: string;
|
|
114
|
-
disabled?: boolean;
|
|
115
|
-
}>;
|
|
116
|
-
export type ListList<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item>[];
|
|
117
|
-
export type ListRecord<Item extends ListDataBasic = ListDataBasic> = ListList<Item> | Record<string, any>;
|
|
118
|
-
export type ListDataFullItem<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item> & {
|
|
119
|
-
focus: boolean;
|
|
120
|
-
highlight?: string;
|
|
121
|
-
selected: boolean;
|
|
122
|
-
disabled?: boolean;
|
|
123
|
-
};
|
|
124
|
-
export type ListDataFull<Item extends ListDataBasic = ListDataBasic> = ListDataFullItem<Item>[];
|
|
125
|
-
export type ListListInputItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item>;
|
|
126
|
-
export type ListListInput<Item extends ListDataBasic = ListDataBasic> = ListListInputItem<Item>[] | string[] | Record<string, ListListInputItem<Item>> | Record<string, string>;
|
|
127
|
-
export type ListSelectedItem = NumberOrStringOrBoolean;
|
|
128
|
-
export type ListSelectedList = ListSelectedItem | ListSelectedItem[];
|
|
129
|
-
export type ListName = string | number | undefined;
|
|
130
|
-
export type ListNames = ListName[];
|
|
131
|
-
export type SearchListValueRef<T extends SearchItem> = RefOrNormal<SearchListValue<T>>;
|
|
132
|
-
export type SearchListInput<T extends SearchItem> = SearchListValueRef<T> | (() => SearchListValueRef<T>);
|
|
133
|
-
export type SearchColumnsRef<T extends SearchItem, K extends SearchColumns<T>> = RefOrNormal<K>;
|
|
134
|
-
export type SearchColumnsInput<T extends SearchItem, K extends SearchColumns<T>> = SearchColumnsRef<T, K> | (() => SearchColumnsRef<T, K>);
|
|
3
|
+
/** Base class for working with design component constructors. @keywords design abstract constructor callback */
|
|
135
4
|
export declare abstract class DesignAbstract<T extends Record<string, any>, C extends Record<string, any>> {
|
|
5
|
+
/** Constructor @keywords design constructor initialize */
|
|
136
6
|
constructor(props: T, callback?: ((event: C) => void) | undefined, changed?: string[]);
|
|
7
|
+
/** Calls the callback function. @keywords design make update */
|
|
137
8
|
make(compelled?: boolean): this;
|
|
9
|
+
/** Calls the callback function. @keywords design callback */
|
|
138
10
|
makeCallback(compelled?: boolean): void;
|
|
139
11
|
}
|
|
12
|
+
|
|
13
|
+
/** Base class for asynchronous design construction. @keywords design async abstract class */
|
|
140
14
|
export declare abstract class DesignAsyncAbstract<T extends Record<string, any>, C extends Record<string, any>> extends DesignAbstract<T, C> {
|
|
15
|
+
/** Makes design callbacks. @keywords make design async */
|
|
141
16
|
make(compelled?: boolean): this;
|
|
17
|
+
/** Makes callback asynchronously. @keywords make callback async */
|
|
142
18
|
makeCallback(compelled?: boolean): Promise<void>;
|
|
19
|
+
/** Initializes event asynchronously. @keywords init event async */
|
|
20
|
+
protected abstract initEvent(): Promise<void>;
|
|
143
21
|
}
|
|
22
|
+
|
|
23
|
+
/** Checks properties for changes. @keywords design changed check update */
|
|
144
24
|
export declare class DesignChanged<T extends Record<string, any>> {
|
|
25
|
+
/** Creates a changed tracker instance. @keywords constructor create */
|
|
145
26
|
constructor(props: T, watch?: string[]);
|
|
27
|
+
/** Checks if property changed. @keywords is changed check */
|
|
146
28
|
is(name: string | string[]): boolean;
|
|
29
|
+
/** Checks if any watched property changed. @keywords is changed */
|
|
147
30
|
isChanged(): boolean;
|
|
31
|
+
/** Updates cached property values. @keywords update cache */
|
|
148
32
|
update(): void;
|
|
149
33
|
}
|
|
34
|
+
|
|
150
35
|
export declare class DesignComp<COMP extends ConstrComponent, P extends ConstrItem> extends DesignComponents<COMP, P> {
|
|
151
36
|
}
|
|
37
|
+
|
|
38
|
+
import { ComputedRef, VNode } from 'vue';
|
|
39
|
+
|
|
40
|
+
/** Manages and renders connected UI components with modifier support. @keywords design components modification render */
|
|
152
41
|
export declare class DesignComponents<COMP extends ConstrComponent, P extends ConstrItem> {
|
|
42
|
+
/** Creates a component manager instance. @keywords constructor design components */
|
|
153
43
|
constructor(components?: COMP, modification?: ConstrComponentMod<P> | undefined);
|
|
44
|
+
/** Checks if a component exists by name. @keywords check component exists */
|
|
154
45
|
is<K extends keyof COMP>(name: K): name is K;
|
|
46
|
+
/** Retrieves a component by name. @keywords get component */
|
|
155
47
|
get<K extends keyof COMP>(name: K): COMP[K];
|
|
48
|
+
/** Computes and returns modified component properties. @keywords get modification props */
|
|
156
49
|
getModification<K extends keyof P>(index?: K & string | string, props?: P[K] | Record<string, any>): Record<string, any> | undefined;
|
|
50
|
+
/** Renders a component and returns an array containing the VNode. @keywords render component array */
|
|
157
51
|
render<K extends keyof COMP, PK extends keyof P>(name: K & string, props?: P[PK] & ConstrItem | ConstrItem, children?: RawChildren | RawSlots, index?: PK & string | string): VNode[];
|
|
52
|
+
/** Renders a single component VNode. @keywords render one component */
|
|
158
53
|
renderOne<K extends keyof COMP, PK extends keyof P>(name: K & string, props?: P[PK] & ConstrItem | ConstrItem, children?: RawChildren | RawSlots, index?: PK & string | string): VNode | undefined;
|
|
54
|
+
/** Renders a component and appends it to an array. @keywords render add component */
|
|
159
55
|
renderAdd<K extends keyof COMP, PK extends keyof P>(item: any[], name: K & string, props?: P[PK] & ConstrItem | ConstrItem, children?: RawChildren | RawSlots, index?: PK & string | string): this;
|
|
56
|
+
/** Computes modifications for a specific component index. @keywords compute modification */
|
|
57
|
+
protected computeModification<K extends keyof P>(index: K & string | string): Record<string, any>;
|
|
160
58
|
}
|
|
59
|
+
|
|
60
|
+
import { ComputedRef, ToRefs, VNode, Ref } from 'vue';
|
|
61
|
+
/** Component constructor abstract class. @keywords design constructor abstract component */
|
|
161
62
|
export declare abstract class DesignConstructorAbstract<E extends Element, COMP extends ConstrComponent, EMITS extends ConstrItem, EXPOSE extends ConstrItem, SLOTS extends ConstrItem, CLASSES extends ConstrClasses, P extends ConstrItem> {
|
|
162
|
-
|
|
63
|
+
/** Creates instance of design constructor. @keywords constructor design */
|
|
64
|
+
protected constructor(name: string, props: Readonly<P>, options?: ConstrOptions<COMP, EMITS, P> | undefined);
|
|
65
|
+
/** Initializes instance properties. @keywords init design */
|
|
66
|
+
protected init(): this;
|
|
67
|
+
/** Gets full class name. @keywords get name class */
|
|
163
68
|
getName(): string;
|
|
69
|
+
/** Gets design prefix/name. @keywords get design */
|
|
164
70
|
getDesign(): string;
|
|
71
|
+
/** Gets sub-class name by levels. @keywords get sub class */
|
|
165
72
|
getSubClass(name: string | string[]): string;
|
|
73
|
+
/** Gets status modifier class name. @keywords get status class */
|
|
166
74
|
getStatusClass(name: string | string[]): string;
|
|
75
|
+
/** Gets CSS custom property name. @keywords get style var */
|
|
167
76
|
getStyle(name: string | string[]): string;
|
|
77
|
+
/** Gets filtered element attributes. @keywords get attrs */
|
|
168
78
|
getAttrs(): ConstrItem;
|
|
79
|
+
/** Exposes public component properties and element. @keywords expose component */
|
|
169
80
|
expose(): ConstrExpose<E, EXPOSE>;
|
|
81
|
+
/** Returns component render function. @keywords render function */
|
|
170
82
|
render(): () => VNode | (VNode | any)[] | undefined;
|
|
83
|
+
/** Initializes exposed context. @keywords init expose */
|
|
84
|
+
protected abstract initExpose(): EXPOSE;
|
|
85
|
+
/** Initializes computed CSS classes. @keywords init classes */
|
|
86
|
+
protected abstract initClasses(): Partial<CLASSES>;
|
|
87
|
+
/** Initializes computed inline styles. @keywords init styles */
|
|
88
|
+
protected abstract initStyles(): ConstrStyles;
|
|
89
|
+
/** Renders component template VNode. @keywords init render */
|
|
90
|
+
protected abstract initRender(): VNode | (VNode | any)[] | undefined;
|
|
91
|
+
/** Initializes slot content and optionally pushes to children. @keywords init slot */
|
|
92
|
+
protected initSlot<K extends keyof SLOTS>(name: K, children?: any[], props?: ConstrItem): VNode | undefined;
|
|
93
|
+
/** Normalizes class definition into class object map. @keywords to class */
|
|
94
|
+
protected toClass(classes?: ConstrClass): ConstrClassObject;
|
|
95
|
+
/** Maps class definition placeholders to component names. @keywords to class name */
|
|
96
|
+
protected toClassName<T extends ConstrItem>(classes?: ConstrItem): T;
|
|
171
97
|
}
|
|
98
|
+
|
|
99
|
+
import { ComputedRef, Ref } from 'vue';
|
|
100
|
+
import { Datetime, GeoDate, GeoFirstDay, GeoHours, NumberOrStringOrDate } from '@dxtmisha/functional-basic';
|
|
101
|
+
|
|
102
|
+
/** @keywords DatetimeRef, date, reactive, time */
|
|
172
103
|
export declare class DatetimeRef {
|
|
104
|
+
/** @keywords constructor, init */
|
|
173
105
|
constructor(date: RefOrNormal<NumberOrStringOrDate>, type?: RefOrNormal<GeoDate>, code?: RefOrNormal<string>);
|
|
106
|
+
/** @keywords getItem, date, ref */
|
|
174
107
|
getItem(): Ref<NumberOrStringOrDate>;
|
|
108
|
+
/** @keywords getDate, date */
|
|
175
109
|
getDate(): Ref<Date>;
|
|
110
|
+
/** @keywords getDatetime, datetime */
|
|
176
111
|
getDatetime(): Datetime;
|
|
112
|
+
/** @keywords getHoursType, hours */
|
|
177
113
|
getHoursType(): ComputedRef<GeoHours>;
|
|
114
|
+
/** @keywords getFirstDayCode, firstDay */
|
|
178
115
|
getFirstDayCode(): ComputedRef<GeoFirstDay>;
|
|
116
|
+
/** @keywords getYear, year */
|
|
179
117
|
getYear(): ComputedRef<number>;
|
|
118
|
+
/** @keywords getMonth, month */
|
|
180
119
|
getMonth(): ComputedRef<number>;
|
|
120
|
+
/** @keywords getDay, day */
|
|
181
121
|
getDay(): ComputedRef<number>;
|
|
122
|
+
/** @keywords getHour, hour */
|
|
182
123
|
getHour(): ComputedRef<number>;
|
|
124
|
+
/** @keywords getMinute, minute */
|
|
183
125
|
getMinute(): ComputedRef<number>;
|
|
126
|
+
/** @keywords getSecond, second */
|
|
184
127
|
getSecond(): ComputedRef<number>;
|
|
128
|
+
/** @keywords getMaxDay, maxDay */
|
|
185
129
|
getMaxDay(): ComputedRef<number>;
|
|
130
|
+
/** @keywords locale, format */
|
|
186
131
|
locale(type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions): ComputedRef<string>;
|
|
132
|
+
/** @keywords standard, format */
|
|
187
133
|
standard(timeZone?: boolean): ComputedRef<string>;
|
|
134
|
+
protected updateDate(): this;
|
|
188
135
|
}
|
|
136
|
+
|
|
137
|
+
/** Global effect scope class. @keywords effect scope global scope */
|
|
189
138
|
export declare class EffectScopeGlobal {
|
|
139
|
+
/** Runs a function within the global scope. @keywords run execute global scope */
|
|
190
140
|
static run<T>(fn: () => T): T | undefined;
|
|
141
|
+
/** Gets the global effect scope instance. @keywords get scope instance global */
|
|
142
|
+
static getScope(): import("vue").EffectScope;
|
|
191
143
|
}
|
|
144
|
+
|
|
145
|
+
import { ElementOrString, ElementOrWindow, EventItem, EventListenerDetail, EventOptions } from '@dxtmisha/functional-basic';
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Class for working with events using reactive references.
|
|
149
|
+
* @keywords event_ref event_wrapper reactive_event dom_event
|
|
150
|
+
*/
|
|
192
151
|
export declare class EventRef<E extends ElementOrWindow, O extends Event, D extends Record<string, any> = Record<string, any>> extends EventItem<E, O, D> {
|
|
152
|
+
/**
|
|
153
|
+
* Creates an instance of EventRef.
|
|
154
|
+
* @keywords constructor event_ref_init
|
|
155
|
+
*/
|
|
193
156
|
constructor(elementSelector?: RefOrNormal<ElementOrString<E> | undefined>, elementSelectorControl?: RefOrNormal<ElementOrString<HTMLElement>>, type?: string | string[], listener?: EventListenerDetail<O, D>, options?: EventOptions, detail?: D);
|
|
194
157
|
}
|
|
158
|
+
|
|
159
|
+
import { ComputedRef } from 'vue';
|
|
160
|
+
import { GeoFlagItem, GeoFlagNational } from '@dxtmisha/functional-basic';
|
|
161
|
+
|
|
162
|
+
/** Geo flag reactive reference manager. @keywords geo, flag, country, language */
|
|
195
163
|
export declare class GeoFlagRef {
|
|
164
|
+
/**
|
|
165
|
+
* Creates a new GeoFlagRef instance.
|
|
166
|
+
* @param code Country or language code
|
|
167
|
+
*/
|
|
196
168
|
constructor(code?: RefOrNormal<string | undefined>);
|
|
169
|
+
/** Gets the current country code. @keywords code, get */
|
|
197
170
|
getCode(): string;
|
|
171
|
+
/** Gets reactive country flag item information. @keywords country, flag, item */
|
|
198
172
|
get(code?: RefOrNormal<string>): ComputedRef<GeoFlagItem | undefined>;
|
|
173
|
+
/** Gets reactive language flag item information. @keywords language, flag, item */
|
|
199
174
|
getLanguage(code?: RefOrNormal<string>): ComputedRef<GeoFlagItem | undefined>;
|
|
175
|
+
/** Gets reactive flag image URL or source. @keywords flag, link, image */
|
|
200
176
|
getFlag(code?: RefOrNormal<string>): ComputedRef<string | undefined>;
|
|
177
|
+
/** Gets a reactive list of country flag items. @keywords list, country, flags */
|
|
201
178
|
getList(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagItem[]>;
|
|
179
|
+
/** Gets a reactive list of language flag items. @keywords list, language, flags */
|
|
202
180
|
getListLanguage(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagItem[]>;
|
|
181
|
+
/** Gets reactive country flag items in national representation. @keywords national, country, list */
|
|
203
182
|
getNational(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagNational[]>;
|
|
183
|
+
/** Gets reactive language flag items in national representation. @keywords national, language, list */
|
|
204
184
|
getNationalLanguage(codes?: RefOrNormal<string[] | undefined>): ComputedRef<GeoFlagNational[]>;
|
|
205
185
|
}
|
|
186
|
+
|
|
187
|
+
import { ComputedRef } from 'vue';
|
|
188
|
+
import { GeoDate, ItemValue, NumberOrString, NumberOrStringOrDate } from '@dxtmisha/functional-basic';
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Reactive class for managing the formatting of numbers and dates.
|
|
192
|
+
* @keywords geo intl format reactive number date localize
|
|
193
|
+
*/
|
|
206
194
|
export declare class GeoIntlRef {
|
|
195
|
+
/**
|
|
196
|
+
* Constructor for GeoIntlRef.
|
|
197
|
+
* @keywords constructor initialize geo intl ref
|
|
198
|
+
*/
|
|
207
199
|
constructor(code?: RefOrNormal<string>);
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Format display names for language, region, and script.
|
|
203
|
+
* @keywords display name language region script intl
|
|
204
|
+
*/
|
|
208
205
|
display(value?: RefOrNormal<string>, typeOptions?: Intl.DisplayNamesOptions['type'] | Intl.DisplayNamesOptions): ComputedRef<string>;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Get display names of language.
|
|
209
|
+
* @keywords language name translate intl
|
|
210
|
+
*/
|
|
209
211
|
languageName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Get display names of region.
|
|
215
|
+
* @keywords country region name intl
|
|
216
|
+
*/
|
|
210
217
|
countryName(value?: RefOrNormal<string>, style?: Intl.RelativeTimeFormatStyle): ComputedRef<string>;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Format a number value.
|
|
221
|
+
* @keywords number format intl digit
|
|
222
|
+
*/
|
|
211
223
|
number(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Get the decimal point symbol.
|
|
227
|
+
* @keywords decimal point symbol separator
|
|
228
|
+
*/
|
|
212
229
|
decimal(): ComputedRef<string>;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Format a currency value.
|
|
233
|
+
* @keywords currency format money price intl
|
|
234
|
+
*/
|
|
213
235
|
currency(value: RefOrNormal<NumberOrString>, currencyOptions?: RefOrNormal<string | Intl.NumberFormatOptions>, numberOnly?: boolean): ComputedRef<string>;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Get the currency symbol or code.
|
|
239
|
+
* @keywords currency symbol code intl
|
|
240
|
+
*/
|
|
214
241
|
currencySymbol(currency: RefOrNormal<string>, currencyDisplay?: keyof Intl.NumberFormatOptionsCurrencyDisplayRegistry): ComputedRef<string>;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Format a unit value.
|
|
245
|
+
* @keywords unit format measurement intl
|
|
246
|
+
*/
|
|
215
247
|
unit(value: RefOrNormal<NumberOrString>, unitOptions?: string | Intl.NumberFormatOptions): ComputedRef<string>;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Format a file size value.
|
|
251
|
+
* @keywords size file bytes megabytes intl
|
|
252
|
+
*/
|
|
216
253
|
sizeFile(value: RefOrNormal<NumberOrString>, unitOptions?: 'byte' | 'kilobyte' | 'megabyte' | 'gigabyte' | 'terabyte' | 'petabyte' | Intl.NumberFormatOptions): ComputedRef<string>;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Format a number as a percentage.
|
|
257
|
+
* @keywords percent percentage format intl
|
|
258
|
+
*/
|
|
217
259
|
percent(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Format a number as a percentage by 100.
|
|
263
|
+
* @keywords percent 100 format intl
|
|
264
|
+
*/
|
|
218
265
|
percentBy100(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Format text based on plural rules and language words.
|
|
269
|
+
* @keywords plural rules words format intl
|
|
270
|
+
*/
|
|
219
271
|
plural(value: RefOrNormal<NumberOrString>, words: string, options?: Intl.PluralRulesOptions, optionsNumber?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Format a date and time value.
|
|
275
|
+
* @keywords date time format intl calendar
|
|
276
|
+
*/
|
|
220
277
|
date(value: RefOrNormal<NumberOrStringOrDate>, type?: GeoDate, styleOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, hour24?: boolean): ComputedRef<string>;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Format relative time.
|
|
281
|
+
* @keywords relative time ago format intl
|
|
282
|
+
*/
|
|
221
283
|
relative(value: RefOrNormal<NumberOrStringOrDate>, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, todayValue?: Date): ComputedRef<string>;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Format relative time with a limit falling back to standard date.
|
|
287
|
+
* @keywords relative time limit format intl
|
|
288
|
+
*/
|
|
222
289
|
relativeLimit(value: RefOrNormal<NumberOrStringOrDate>, limit: number, todayValue?: Date, relativeOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions, dateOptions?: Intl.DateTimeFormatOptions['month'] | Intl.DateTimeFormatOptions, type?: GeoDate, hour24?: boolean): ComputedRef<string>;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Format relative time by specific unit and value.
|
|
293
|
+
* @keywords relative value unit time format intl
|
|
294
|
+
*/
|
|
223
295
|
relativeByValue(value: RefOrNormal<NumberOrString>, unit: Intl.RelativeTimeFormatUnit, styleOptions?: Intl.RelativeTimeFormatStyle | Intl.RelativeTimeFormatOptions): ComputedRef<string>;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Get the name of a month.
|
|
299
|
+
* @keywords month name date format intl
|
|
300
|
+
*/
|
|
224
301
|
month(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['month']): ComputedRef<string>;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Get an array of all months.
|
|
305
|
+
* @keywords months list array intl
|
|
306
|
+
*/
|
|
225
307
|
months(style?: Intl.DateTimeFormatOptions['month']): ComputedRef<ItemValue<number | undefined>[]>;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Get the name of a weekday.
|
|
311
|
+
* @keywords weekday name date format intl
|
|
312
|
+
*/
|
|
226
313
|
weekday(value?: RefOrNormal<NumberOrStringOrDate>, style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<string>;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Get an array of all weekdays.
|
|
317
|
+
* @keywords weekdays list array intl
|
|
318
|
+
*/
|
|
227
319
|
weekdays(style?: Intl.DateTimeFormatOptions['weekday']): ComputedRef<ItemValue<number | undefined>[]>;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Format time.
|
|
323
|
+
* @keywords time format intl
|
|
324
|
+
*/
|
|
228
325
|
time(value: RefOrNormal<NumberOrStringOrDate>): ComputedRef<string>;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Sort an array of items taking into account locale specifics.
|
|
329
|
+
* @keywords sort locale array intl
|
|
330
|
+
*/
|
|
229
331
|
sort<T>(data: RefOrNormal<T[]>, compareFn?: (a: T, b: T) => [string, string]): ComputedRef<T[]>;
|
|
230
332
|
}
|
|
333
|
+
|
|
334
|
+
import { ComputedRef, Ref } from 'vue';
|
|
335
|
+
import { GeoItemFull } from '@dxtmisha/functional-basic';
|
|
336
|
+
|
|
337
|
+
/** Geo reference reactive manager class @keywords geo ref country language */
|
|
231
338
|
export declare class GeoRef {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
339
|
+
/** Get reactive geographic full item @keywords get geo item */
|
|
340
|
+
static get(): Ref<GeoItemFull>;
|
|
341
|
+
/** Get current country code @keywords country code */
|
|
342
|
+
static getCountry(): ComputedRef<string>;
|
|
343
|
+
/** Get current language code @keywords language code */
|
|
344
|
+
static getLanguage(): ComputedRef<string>;
|
|
345
|
+
/** Get standard format string @keywords standard locale */
|
|
346
|
+
static getStandard(): ComputedRef<string>;
|
|
347
|
+
/** Get first day of the week @keywords first day */
|
|
348
|
+
static getFirstDay(): ComputedRef<string>;
|
|
349
|
+
/** Get current location string @keywords location */
|
|
350
|
+
static getLocation(): ComputedRef<string>;
|
|
351
|
+
/** Get country from location @keywords location country */
|
|
352
|
+
static getLocationCountry(): ComputedRef<string>;
|
|
353
|
+
/** Get language from location @keywords location language */
|
|
354
|
+
static getLocationLanguage(): ComputedRef<string>;
|
|
355
|
+
/** Set geographic code @keywords set geo */
|
|
356
|
+
static set(code: string): void;
|
|
357
|
+
/** Set default geographic value @keywords default geo */
|
|
358
|
+
static setValueDefault(code?: string | (() => string)): void;
|
|
242
359
|
}
|
|
360
|
+
|
|
361
|
+
import { ComputedRef, Ref } from 'vue';
|
|
362
|
+
import { GeoUnit, NumberOrString } from '@dxtmisha/functional-basic';
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Reactive class for managing localized unit formatting and automatic conversions.
|
|
366
|
+
* @keywords GeoUnitRef, geo, unit, formatting, conversion, localized
|
|
367
|
+
*/
|
|
243
368
|
export declare class GeoUnitRef {
|
|
369
|
+
/**
|
|
370
|
+
* Creates an instance of GeoUnitRef.
|
|
371
|
+
* @keywords constructor, geo, unit
|
|
372
|
+
*/
|
|
244
373
|
constructor(code?: RefOrNormal<string>);
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Returns the standard location code.
|
|
377
|
+
* @keywords getLocation, location, code, standard
|
|
378
|
+
*/
|
|
245
379
|
getLocation(): ComputedRef<string>;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Formats millimeter value, converting to inches if overridden by locale unit settings.
|
|
383
|
+
* @keywords millimeter, format, length, unit
|
|
384
|
+
*/
|
|
246
385
|
millimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Formats centimeter value, converting to inches if overridden by locale unit settings.
|
|
389
|
+
* @keywords centimeter, format, length, unit
|
|
390
|
+
*/
|
|
247
391
|
centimeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Formats meter value, converting to feet if overridden by locale unit settings.
|
|
395
|
+
* @keywords meter, format, length, unit
|
|
396
|
+
*/
|
|
248
397
|
meter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Formats kilometer value, converting to miles if overridden by locale unit settings.
|
|
401
|
+
* @keywords kilometer, format, length, unit
|
|
402
|
+
*/
|
|
249
403
|
kilometer(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Formats square meter value, converting to square feet if overridden by locale unit settings.
|
|
407
|
+
* @keywords squareMeter, format, area, unit
|
|
408
|
+
*/
|
|
250
409
|
squareMeter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Formats hectare value, converting to acres if overridden by locale unit settings.
|
|
413
|
+
* @keywords hectare, format, area, unit
|
|
414
|
+
*/
|
|
251
415
|
hectare(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Formats gram value, converting to ounces if overridden by locale unit settings.
|
|
419
|
+
* @keywords gram, format, mass, weight, unit
|
|
420
|
+
*/
|
|
252
421
|
gram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Formats kilogram value, converting to pounds if overridden by locale unit settings.
|
|
425
|
+
* @keywords kilogram, format, mass, weight, unit
|
|
426
|
+
*/
|
|
253
427
|
kilogram(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Formats tonne value, converting to short tons if overridden by locale unit settings.
|
|
431
|
+
* @keywords tonne, format, mass, weight, unit
|
|
432
|
+
*/
|
|
254
433
|
tonne(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Formats milliliter value, converting to fluid ounces if overridden by locale unit settings.
|
|
437
|
+
* @keywords milliliter, format, volume, unit
|
|
438
|
+
*/
|
|
255
439
|
milliliter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Formats liter value, converting to gallons if overridden by locale unit settings.
|
|
443
|
+
* @keywords liter, format, volume, unit
|
|
444
|
+
*/
|
|
256
445
|
liter(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Formats celsius value, converting to fahrenheit if overridden by locale unit settings.
|
|
449
|
+
* @keywords celsius, format, temperature, unit
|
|
450
|
+
*/
|
|
257
451
|
celsius(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Formats kilometer per hour value, converting to miles per hour if overridden by locale unit settings.
|
|
455
|
+
* @keywords kilometerPerHour, format, speed, unit
|
|
456
|
+
*/
|
|
258
457
|
kilometerPerHour(value: RefOrNormal<NumberOrString>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Formats the value for the specified unit reactively, converting and formatting it according to the locale.
|
|
461
|
+
* @keywords format, unit, conversion, localized
|
|
462
|
+
*/
|
|
259
463
|
format(value: RefOrNormal<NumberOrString>, unit: RefOrNormal<string>, options?: Intl.NumberFormatOptions): ComputedRef<string>;
|
|
260
464
|
}
|
|
465
|
+
|
|
466
|
+
import { ComputedRef } from 'vue';
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Class for managing the data list.
|
|
470
|
+
* @keywords list data management collection items
|
|
471
|
+
*/
|
|
261
472
|
export declare class ListDataRef {
|
|
473
|
+
/**
|
|
474
|
+
* Creates an instance of ListData for managing list data.
|
|
475
|
+
* @keywords list data constructor initialize
|
|
476
|
+
*/
|
|
262
477
|
constructor(list: RefOrNormal<ListListInput | undefined>, focus?: RefType<ListSelectedItem | undefined> | undefined, highlight?: RefType<string | undefined> | undefined, highlightLengthStart?: RefType<number | undefined> | undefined, filterMode?: RefType<boolean | undefined> | undefined, selected?: RefType<ListSelectedList | undefined> | undefined, keyValue?: RefType<string | undefined> | undefined, keyLabel?: RefType<string | undefined> | undefined, lite?: RefType<number | undefined> | undefined, min?: RefOrNormal<number | string | undefined>, max?: RefOrNormal<number | string | undefined>, parent?: string | undefined);
|
|
478
|
+
/**
|
|
479
|
+
* Returns a list for forming a list.
|
|
480
|
+
* @keywords list items data reactive
|
|
481
|
+
*/
|
|
263
482
|
readonly data: ComputedRef<ListList>;
|
|
483
|
+
/**
|
|
484
|
+
* Returns a simplified list for quick loading.
|
|
485
|
+
* @keywords lite list fast items
|
|
486
|
+
*/
|
|
264
487
|
readonly liteData: ComputedRef<ListList>;
|
|
488
|
+
/**
|
|
489
|
+
* Returns a list of records with all additional data.
|
|
490
|
+
* @keywords full list data items state
|
|
491
|
+
*/
|
|
265
492
|
readonly fullData: ComputedRef<ListDataFull>;
|
|
493
|
+
/**
|
|
494
|
+
* Returns a flat map of all entries including sublists.
|
|
495
|
+
* @keywords map flat list items
|
|
496
|
+
*/
|
|
266
497
|
readonly map: ComputedRef<ListList>;
|
|
498
|
+
/**
|
|
499
|
+
* Returns a list consisting only of items.
|
|
500
|
+
* @keywords map items array
|
|
501
|
+
*/
|
|
267
502
|
readonly mapItems: ComputedRef<ListList>;
|
|
503
|
+
/**
|
|
504
|
+
* Returns a list consisting only of values for selection.
|
|
505
|
+
* @keywords items selection values group menu
|
|
506
|
+
*/
|
|
268
507
|
readonly items: ComputedRef<ListList>;
|
|
508
|
+
/**
|
|
509
|
+
* Finds the first element that meets the search conditions.
|
|
510
|
+
* @keywords highlight first item search index
|
|
511
|
+
*/
|
|
269
512
|
readonly highlightFirstItem: ComputedRef<number>;
|
|
513
|
+
/**
|
|
514
|
+
* Is there a selected item.
|
|
515
|
+
* @keywords is selected boolean state
|
|
516
|
+
*/
|
|
270
517
|
readonly isSelected: ComputedRef<boolean>;
|
|
518
|
+
/**
|
|
519
|
+
* Is the minimum selection reached.
|
|
520
|
+
* @keywords is selected min threshold
|
|
521
|
+
*/
|
|
271
522
|
readonly isSelectedMin: ComputedRef<boolean>;
|
|
523
|
+
/**
|
|
524
|
+
* Is the maximum selection reached.
|
|
525
|
+
* @keywords is selected max threshold
|
|
526
|
+
*/
|
|
272
527
|
readonly isSelectedMax: ComputedRef<boolean>;
|
|
528
|
+
/**
|
|
529
|
+
* Returns a list of selected items on the map.
|
|
530
|
+
* @keywords selected list items
|
|
531
|
+
*/
|
|
273
532
|
readonly selectedList: ComputedRef<ListList>;
|
|
533
|
+
/**
|
|
534
|
+
* Returns a list of selected items in the current group.
|
|
535
|
+
* @keywords selected list group items
|
|
536
|
+
*/
|
|
274
537
|
readonly selectedListInGroup: ComputedRef<ListList>;
|
|
538
|
+
/**
|
|
539
|
+
* Returns a list of selected labels on the map.
|
|
540
|
+
* @keywords selected names labels list
|
|
541
|
+
*/
|
|
275
542
|
readonly selectedNames: ComputedRef<ListNames>;
|
|
543
|
+
/**
|
|
544
|
+
* Returns a list of selected values on the map.
|
|
545
|
+
* @keywords selected values list
|
|
546
|
+
*/
|
|
276
547
|
readonly selectedValues: ComputedRef<any[]>;
|
|
548
|
+
/**
|
|
549
|
+
* Checks whether it is necessary to first display a simplified version.
|
|
550
|
+
* @keywords is lite mode check
|
|
551
|
+
*/
|
|
277
552
|
isLite(): boolean;
|
|
553
|
+
/**
|
|
554
|
+
* Checks if an element is in focus.
|
|
555
|
+
* @keywords is focus check
|
|
556
|
+
*/
|
|
278
557
|
isFocus(): boolean;
|
|
558
|
+
/**
|
|
559
|
+
* Checks if there is a highlighted item (search results).
|
|
560
|
+
* @keywords is highlight check search
|
|
561
|
+
*/
|
|
279
562
|
isHighlight(): boolean;
|
|
563
|
+
/**
|
|
564
|
+
* Checks if highlighting is active (minimum length reached).
|
|
565
|
+
* @keywords is highlight active check
|
|
566
|
+
*/
|
|
280
567
|
isHighlightActive(): boolean;
|
|
568
|
+
/**
|
|
569
|
+
* Returns the number of records in the current list.
|
|
570
|
+
* @keywords get length count list
|
|
571
|
+
*/
|
|
281
572
|
getLength(): number;
|
|
573
|
+
/**
|
|
574
|
+
* Returns the number of all available records in the map.
|
|
575
|
+
* @keywords get length map count
|
|
576
|
+
*/
|
|
282
577
|
getLengthByMap(): number;
|
|
578
|
+
/**
|
|
579
|
+
* Returns the number of all available records (items).
|
|
580
|
+
* @keywords get length items count
|
|
581
|
+
*/
|
|
283
582
|
getLengthByItems(): number;
|
|
583
|
+
/**
|
|
584
|
+
* Returns the identifier in focus.
|
|
585
|
+
* @keywords get focus identifier
|
|
586
|
+
*/
|
|
284
587
|
getFocus(): ListSelectedItem | undefined;
|
|
588
|
+
/**
|
|
589
|
+
* Returns the item in focus.
|
|
590
|
+
* @keywords get focus item data
|
|
591
|
+
*/
|
|
285
592
|
getFocusItem(): ListDataItem | undefined;
|
|
593
|
+
/**
|
|
594
|
+
* Returns the highlight text.
|
|
595
|
+
* @keywords get highlight search text
|
|
596
|
+
*/
|
|
286
597
|
getHighlight(): string | undefined;
|
|
598
|
+
/**
|
|
599
|
+
* Returns the minimum length for highlight to start.
|
|
600
|
+
* @keywords get highlight length start
|
|
601
|
+
*/
|
|
287
602
|
getHighlightLengthStart(): number;
|
|
603
|
+
/**
|
|
604
|
+
* Returns the selected identifiers list.
|
|
605
|
+
* @keywords get selected list
|
|
606
|
+
*/
|
|
288
607
|
getSelected(): ListSelectedList | undefined;
|
|
608
|
+
/**
|
|
609
|
+
* Returns an item by moving a certain number of steps from the selected item.
|
|
610
|
+
* @keywords get selected by step navigation
|
|
611
|
+
*/
|
|
289
612
|
getSelectedByStep(step: number): ListSelectedItem | undefined;
|
|
613
|
+
/**
|
|
614
|
+
* Returns the next item from the selected one.
|
|
615
|
+
* @keywords get selected next item
|
|
616
|
+
*/
|
|
290
617
|
getSelectedNext(): ListSelectedItem | undefined;
|
|
618
|
+
/**
|
|
619
|
+
* Returns the previous item from the selected one.
|
|
620
|
+
* @keywords get selected prev item
|
|
621
|
+
*/
|
|
291
622
|
getSelectedPrev(): ListSelectedItem | undefined;
|
|
623
|
+
/**
|
|
624
|
+
* Returns an item by moving a certain number of steps from the specified item.
|
|
625
|
+
* @keywords get item by step navigation
|
|
626
|
+
*/
|
|
292
627
|
getItemByStep(item: ListDataItem, step: number): ListDataItem | undefined;
|
|
628
|
+
/**
|
|
629
|
+
* Returns the next item from the specified one.
|
|
630
|
+
* @keywords get item next
|
|
631
|
+
*/
|
|
293
632
|
getItemNext(item: ListDataItem): ListDataItem | undefined;
|
|
633
|
+
/**
|
|
634
|
+
* Returns the previous item from the specified one.
|
|
635
|
+
* @keywords get item prev
|
|
636
|
+
*/
|
|
294
637
|
getItemPrev(item: ListDataItem): ListDataItem | undefined;
|
|
638
|
+
/**
|
|
639
|
+
* Returns an item by moving a certain number of steps from the specified index.
|
|
640
|
+
* @keywords get index by step navigation
|
|
641
|
+
*/
|
|
295
642
|
getIndexByStep(index: string, step: number): ListDataItem | undefined;
|
|
643
|
+
/**
|
|
644
|
+
* Returns the next item from the specified index.
|
|
645
|
+
* @keywords get index next
|
|
646
|
+
*/
|
|
296
647
|
getIndexNext(index: string): ListDataItem | undefined;
|
|
648
|
+
/**
|
|
649
|
+
* Returns the previous item from the specified index.
|
|
650
|
+
* @keywords get index prev
|
|
651
|
+
*/
|
|
297
652
|
getIndexPrev(index: string): ListDataItem | undefined;
|
|
653
|
+
/**
|
|
654
|
+
* Returns an item by its index.
|
|
655
|
+
* @keywords get item by index
|
|
656
|
+
*/
|
|
298
657
|
getItemByIndex(index?: string): {
|
|
299
658
|
key: number;
|
|
300
659
|
item: ListDataItem;
|
|
301
660
|
} | undefined;
|
|
661
|
+
/**
|
|
662
|
+
* Returns an item by its key.
|
|
663
|
+
* @keywords get item by key number
|
|
664
|
+
*/
|
|
302
665
|
getItemByKey(key: number): ListDataItem | undefined;
|
|
666
|
+
/**
|
|
667
|
+
* Returns the first item with the specified parent.
|
|
668
|
+
* @keywords get first item by parent
|
|
669
|
+
*/
|
|
303
670
|
getFirstItemByParent(parent: string | undefined): ListDataItem | undefined;
|
|
671
|
+
/**
|
|
672
|
+
* Returns the last item with the specified parent.
|
|
673
|
+
* @keywords get last item by parent
|
|
674
|
+
*/
|
|
304
675
|
getLastItemByParent(parent: string | undefined): ListDataItem | undefined;
|
|
676
|
+
/**
|
|
677
|
+
* Returns a sublist object for a group item.
|
|
678
|
+
* @keywords get sub list group item
|
|
679
|
+
*/
|
|
305
680
|
getSubList(item: ListDataItem): ListDataRef;
|
|
306
681
|
}
|
|
682
|
+
|
|
683
|
+
import { RouteLocationRaw, Router, _RouterClassic } from 'vue-router';
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Router management class.
|
|
687
|
+
* @keywords router, navigation, ref, link, href
|
|
688
|
+
*/
|
|
307
689
|
export declare class RouterItemRef {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
690
|
+
/** Get router instance. @keywords router, get */
|
|
691
|
+
static get(): _RouterClassic;
|
|
692
|
+
/** Returns the link by name. @keywords router, link, resolve */
|
|
693
|
+
static getLink(name: string, params?: any, query?: any): string | undefined;
|
|
694
|
+
/** Returns the link property by name. @keywords router, href */
|
|
695
|
+
static getHref(name?: string, params?: any, query?: any): ConstrHrefProps;
|
|
696
|
+
/** Site path change. @keywords router, push, navigate */
|
|
697
|
+
static push(to: string | RouteLocationRaw): void;
|
|
698
|
+
/** Set router instance. @keywords router, set */
|
|
699
|
+
static set(router: Router): void;
|
|
700
|
+
/** Set router instance only once. @keywords router, set, once */
|
|
701
|
+
static setOneTime(router: Router): void;
|
|
702
|
+
/** Converts the raw route location to href properties. @keywords router, href, raw */
|
|
703
|
+
static rawToHref(to?: string | RouteLocationRaw): ConstrHrefProps;
|
|
315
704
|
}
|
|
705
|
+
|
|
706
|
+
import { Ref, ComputedRef } from 'vue';
|
|
707
|
+
|
|
708
|
+
/** Scrollbar width reactive reference utility class @keywords scrollbar, width, reactive, dom */
|
|
316
709
|
export declare class ScrollbarWidthRef {
|
|
710
|
+
/** Reactive item state @keywords item, state, boolean */
|
|
317
711
|
readonly item: Ref<boolean | undefined, boolean | undefined>;
|
|
712
|
+
/** Reactive scrollbar width value @keywords width, number, size */
|
|
318
713
|
readonly width: Ref<number, number>;
|
|
714
|
+
/** Creates a scrollbar width reference instance @keywords constructor, init */
|
|
319
715
|
constructor();
|
|
716
|
+
/** Computes whether scrollbar width is available @keywords is, computed, check */
|
|
320
717
|
readonly is: ComputedRef<boolean>;
|
|
321
718
|
}
|
|
719
|
+
|
|
720
|
+
import { ApiInstance, ApiData, ApiDataValidation, ApiErrorStorageList } from '@dxtmisha/functional-basic';
|
|
721
|
+
|
|
322
722
|
/**
|
|
323
723
|
* Asynchronous reactive composable for API requests with built-in SSR support.
|
|
324
|
-
*
|
|
325
|
-
* Use this composable ONLY if you need the request to be executed on the server side during SSR.
|
|
326
|
-
* For all other cases, use `useApiRef`.
|
|
327
|
-
*
|
|
328
|
-
* @example
|
|
329
|
-
* ```typescript
|
|
330
|
-
* import { Schema as S } from '@effect/schema'
|
|
331
|
-
* import { useApiAsyncRef } from '@dxtmisha/functional'
|
|
332
|
-
*
|
|
333
|
-
* const userSchema = S.Struct({ id: S.Number, name: S.String })
|
|
334
|
-
*
|
|
335
|
-
* const { data, loading, errorItem, isResponseContractValid } = useApiAsyncRef(
|
|
336
|
-
* '/users/1',
|
|
337
|
-
* { method: 'GET' },
|
|
338
|
-
* true,
|
|
339
|
-
* undefined,
|
|
340
|
-
* undefined,
|
|
341
|
-
* (data) => {
|
|
342
|
-
* try {
|
|
343
|
-
* return { status: 'success', data: S.decodeUnknownSync(userSchema)(data) }
|
|
344
|
-
* } catch (e) {
|
|
345
|
-
* return { status: 'error', errors: e }
|
|
346
|
-
* }
|
|
347
|
-
* },
|
|
348
|
-
* [
|
|
349
|
-
* { status: 404, message: 'User not found' }
|
|
350
|
-
* ]
|
|
351
|
-
* )
|
|
352
|
-
* ```
|
|
724
|
+
* @keywords api, async, ssr, request, fetch
|
|
353
725
|
*/
|
|
354
726
|
export declare function useApiAsyncRef<R, T = R>(path?: RefOrNormal<string | undefined>, options?: ApiOptions, reactivity?: boolean, conditions?: RefType<boolean>, transformation?: (data: T, isResponseContractValid?: ApiDataValidation) => ApiData<R>, validateResponseContract?: (data: T) => ApiDataValidation, errorContract?: ApiErrorStorageList, unmounted?: boolean, apiInstance?: ApiInstance): UseApiRef<R>;
|
|
727
|
+
|
|
728
|
+
import { ApiData, ApiFetch } from '@dxtmisha/functional-basic';
|
|
729
|
+
import { Ref } from 'vue';
|
|
730
|
+
|
|
355
731
|
export interface UseApiDeleteSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
356
732
|
}
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Executes a DELETE request via the API.
|
|
736
|
+
* @keywords api delete request setup composable
|
|
737
|
+
*/
|
|
357
738
|
export declare function useApiDelete<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiDeleteSetup<T, Request, Return>): {
|
|
358
739
|
loading: Ref<boolean, boolean>;
|
|
359
740
|
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
360
741
|
};
|
|
742
|
+
|
|
743
|
+
/** Setup interface for API GET request @keywords api get setup request configuration */
|
|
361
744
|
export interface UseApiGetSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
362
745
|
}
|
|
746
|
+
|
|
747
|
+
/** Executes an API GET request with loading state and send method @keywords api get request wrapper */
|
|
363
748
|
export declare function useApiGet<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiGetSetup<T, Request, Return>): {
|
|
364
749
|
loading: Ref<boolean, boolean>;
|
|
365
750
|
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
366
751
|
};
|
|
752
|
+
|
|
753
|
+
import { ApiInstance, ArrayToItem, FormattersListColumns, FormattersOptionsList, SearchColumns, ApiDataValidation, SearchFormatList, ApiData, ApiErrorItem, ApiFetch } from '@dxtmisha/functional-basic';
|
|
754
|
+
import { ComputedRef, Ref } from 'vue';
|
|
755
|
+
|
|
367
756
|
/**
|
|
368
|
-
* Asynchronous reactive composable for API management requests with
|
|
369
|
-
*
|
|
370
|
-
* Use this composable ONLY if you need the request to be executed on the server side during SSR.
|
|
371
|
-
* For all other cases, use `useApiManagementRef`.
|
|
757
|
+
* Asynchronous reactive composable for API management requests with SSR support.
|
|
758
|
+
* @keywords api management async ssr composable fetch
|
|
372
759
|
*/
|
|
373
760
|
export declare function useApiManagementAsyncRef<Return extends ApiManagementValue, FormattersOptions extends FormattersOptionsList, Post extends Record<string, any>, Put extends Record<string, any>, Delete extends Record<string, any>, Type extends ApiManagementValue = Return, Item extends ArrayToItem<Return> = ArrayToItem<Return>, ItemFormatters extends FormattersListColumns<Item, FormattersOptions>[number] = FormattersListColumns<Item, FormattersOptions>[number], Columns extends SearchColumns<ItemFormatters> = []>(propsGet: ApiManagementGet<Return, Type>, formattersOptions?: FormattersOptions, searchOptions?: ApiManagementSearch<Item, Columns>, postRequest?: ApiManagementRequest<Post>, putRequest?: ApiManagementRequest<Put>, deleteRequest?: ApiManagementRequest<Delete>, action?: () => Promise<void> | void, apiInstance?: ApiInstance): {
|
|
374
761
|
isValid: ComputedRef<boolean>;
|
|
375
762
|
isResponseContractValid: ComputedRef<boolean>;
|
|
376
|
-
responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
|
|
763
|
+
responseValidationResult: ComputedRef< ApiDataValidation | undefined>;
|
|
377
764
|
list: ComputedRef<SearchFormatList<ItemFormatters, Columns>>;
|
|
378
|
-
readonly data: ComputedRef<ApiData<Return> | undefined>;
|
|
379
|
-
errorItem: ComputedRef<ApiErrorItem | undefined>;
|
|
765
|
+
readonly data: ComputedRef< ApiData<Return> | undefined>;
|
|
766
|
+
errorItem: ComputedRef< ApiErrorItem | undefined>;
|
|
380
767
|
readonly length: ComputedRef<number>;
|
|
381
768
|
lengthData: ComputedRef<number>;
|
|
382
769
|
starting: ComputedRef<boolean>;
|
|
@@ -392,49 +779,25 @@ export declare function useApiManagementAsyncRef<Return extends ApiManagementVal
|
|
|
392
779
|
initSsr: () => void;
|
|
393
780
|
reset: () => Promise<void>;
|
|
394
781
|
abort: () => void;
|
|
395
|
-
sendPost: (request?: ApiFetch["request"]) => Promise<ApiData<Post> | undefined>;
|
|
396
|
-
sendPut: (request?: ApiFetch["request"]) => Promise<ApiData<Put> | undefined>;
|
|
397
|
-
sendDelete: (request?: ApiFetch["request"]) => Promise<ApiData<Delete> | undefined>;
|
|
782
|
+
sendPost: (request?: ApiFetch["request"]) => Promise< ApiData<Post> | undefined>;
|
|
783
|
+
sendPut: (request?: ApiFetch["request"]) => Promise< ApiData<Put> | undefined>;
|
|
784
|
+
sendDelete: (request?: ApiFetch["request"]) => Promise< ApiData<Delete> | undefined>;
|
|
398
785
|
};
|
|
786
|
+
|
|
787
|
+
import { Ref, ComputedRef } from 'vue';
|
|
788
|
+
import { FormattersOptionsList, ApiData, ApiInstance, ArrayToItem, SearchColumns, SearchFormatList, FormattersListColumns, ApiFetch, ApiDataValidation, ApiErrorItem, ApiManagementValue, ApiManagementGet, ApiManagementSearch, ApiManagementRequest } from '@dxtmisha/functional-basic';
|
|
789
|
+
|
|
399
790
|
/**
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
* and mutations (POST, PUT, DELETE) through a single reactive interface.
|
|
403
|
-
*
|
|
404
|
-
* @note This hook is recommended to be used in tandem with `executeUse` for centralized state management.
|
|
405
|
-
* By wrapping `useApiManagementRef` in `executeUseProvide` or `executeUseGlobal`, you can ensure
|
|
406
|
-
* a single source of truth across the component tree or the entire application.
|
|
407
|
-
*
|
|
408
|
-
* @remarks
|
|
409
|
-
* Data formatting guidelines for `formattersOptions`:
|
|
410
|
-
* - Recommended for formatting: Numbers that represent values (prices, counts), dates, currency, units, and statuses.
|
|
411
|
-
* - Not recommended for formatting: Technical identifiers such as ID, UUID, account numbers, types, or internal codes.
|
|
412
|
-
*
|
|
413
|
-
* @example
|
|
414
|
-
* const products = useApiManagementRef(
|
|
415
|
-
* {
|
|
416
|
-
* path: '/api/v1/products',
|
|
417
|
-
* skeleton: () => Array(5).fill({ id: 0, name: 'Loading...', price: 0 })
|
|
418
|
-
* },
|
|
419
|
-
* {
|
|
420
|
-
* price: (v) => `${v} USD`,
|
|
421
|
-
* created_at: (v) => new Date(v).toLocaleDateString()
|
|
422
|
-
* },
|
|
423
|
-
* {
|
|
424
|
-
* columns: ['name', 'category']
|
|
425
|
-
* },
|
|
426
|
-
* { path: '/api/v1/products' },
|
|
427
|
-
* { path: (data) => `/api/v1/products/${data.id}` },
|
|
428
|
-
* { path: (data) => `/api/v1/products/${data.id}` }
|
|
429
|
-
* );
|
|
791
|
+
* Manages API requests and list operations.
|
|
792
|
+
* @keywords api, management, ref, request
|
|
430
793
|
*/
|
|
431
794
|
export declare function useApiManagementRef<Return extends ApiManagementValue, FormattersOptions extends FormattersOptionsList, Post extends Record<string, any>, Put extends Record<string, any>, Delete extends Record<string, any>, Type extends ApiManagementValue = Return, Item extends ArrayToItem<Return> = ArrayToItem<Return>, ItemFormatters extends FormattersListColumns<Item, FormattersOptions>[number] = FormattersListColumns<Item, FormattersOptions>[number], Columns extends SearchColumns<ItemFormatters> = []>(propsGet: ApiManagementGet<Return, Type>, formattersOptions?: FormattersOptions, searchOptions?: ApiManagementSearch<Item, Columns>, postRequest?: ApiManagementRequest<Post>, putRequest?: ApiManagementRequest<Put>, deleteRequest?: ApiManagementRequest<Delete>, action?: () => Promise<void> | void, apiInstance?: ApiInstance): {
|
|
432
795
|
isValid: ComputedRef<boolean>;
|
|
433
796
|
isResponseContractValid: ComputedRef<boolean>;
|
|
434
|
-
responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
|
|
797
|
+
responseValidationResult: ComputedRef< ApiDataValidation | undefined>;
|
|
435
798
|
list: ComputedRef<SearchFormatList<ItemFormatters, Columns>>;
|
|
436
799
|
readonly data: ComputedRef<ApiData<Return> | undefined>;
|
|
437
|
-
errorItem: ComputedRef<ApiErrorItem | undefined>;
|
|
800
|
+
errorItem: ComputedRef< ApiErrorItem | undefined>;
|
|
438
801
|
readonly length: ComputedRef<number>;
|
|
439
802
|
lengthData: ComputedRef<number>;
|
|
440
803
|
starting: ComputedRef<boolean>;
|
|
@@ -446,137 +809,258 @@ export declare function useApiManagementRef<Return extends ApiManagementValue, F
|
|
|
446
809
|
loadingDelete: Ref<boolean, boolean> | undefined;
|
|
447
810
|
isSearch: ComputedRef<boolean> | undefined;
|
|
448
811
|
search: Ref<string>;
|
|
812
|
+
/** Initializes api management. @keywords init, start */
|
|
449
813
|
init: () => void;
|
|
814
|
+
/** Initializes server-side rendering. @keywords ssr, init */
|
|
450
815
|
initSsr: () => void;
|
|
816
|
+
/** Resets request state. @keywords reset, clear */
|
|
451
817
|
reset: () => Promise<void>;
|
|
818
|
+
/** Aborts active request. @keywords abort, cancel */
|
|
452
819
|
abort: () => void;
|
|
820
|
+
/** Sends POST request. @keywords post, send */
|
|
453
821
|
sendPost: (request?: ApiFetch["request"]) => Promise<ApiData<Post> | undefined>;
|
|
822
|
+
/** Sends PUT request. @keywords put, send */
|
|
454
823
|
sendPut: (request?: ApiFetch["request"]) => Promise<ApiData<Put> | undefined>;
|
|
824
|
+
/** Sends DELETE request. @keywords delete, send */
|
|
455
825
|
sendDelete: (request?: ApiFetch["request"]) => Promise<ApiData<Delete> | undefined>;
|
|
456
826
|
};
|
|
827
|
+
|
|
828
|
+
import { ApiData, ApiFetch } from '@dxtmisha/functional-basic';
|
|
829
|
+
import { Ref } from 'vue';
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Setup interface for API POST request.
|
|
833
|
+
* @keywords api, post, setup, request
|
|
834
|
+
*/
|
|
457
835
|
export interface UseApiPostSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
458
836
|
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Executes a POST request using the API.
|
|
840
|
+
* @keywords api, post, request, send
|
|
841
|
+
*/
|
|
459
842
|
export declare function useApiPost<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPostSetup<T, Request, Return>): {
|
|
460
843
|
loading: Ref<boolean, boolean>;
|
|
461
844
|
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
462
845
|
};
|
|
846
|
+
|
|
847
|
+
/** Setup interface for API PUT request @keywords useApiPutSetup, api, put */
|
|
463
848
|
export interface UseApiPutSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> extends Omit<UseApiRequestSetup<T, Request, Return>, 'method'> {
|
|
464
849
|
}
|
|
850
|
+
/** Use API PUT request wrapper @keywords useApiPut, api, put, request */
|
|
465
851
|
export declare function useApiPut<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>(setup: UseApiPutSetup<T, Request, Return>): {
|
|
466
852
|
loading: Ref<boolean, boolean>;
|
|
467
853
|
send(request?: Request | undefined): Promise<Return | undefined>;
|
|
468
854
|
};
|
|
855
|
+
|
|
856
|
+
import { ComputedRef, Ref } from 'vue';
|
|
857
|
+
import { ApiInstance, ApiData, ApiDataValidation, ApiErrorStorageList, ApiErrorItem } from '@dxtmisha/functional-basic';
|
|
858
|
+
|
|
469
859
|
export interface UseApiRef<R> {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
860
|
+
/** @keywords data, computed, reactive */
|
|
861
|
+
data: ComputedRef<ApiData<R> | undefined>;
|
|
862
|
+
/** @keywords item, ref */
|
|
863
|
+
item: Ref<ApiData<R> | undefined>;
|
|
864
|
+
/** @keywords error, computed, item */
|
|
865
|
+
errorItem: ComputedRef<ApiErrorItem | undefined>;
|
|
866
|
+
/** @keywords response, contract, valid, status */
|
|
867
|
+
isResponseContractValid: ComputedRef<boolean>;
|
|
868
|
+
/** @keywords response, validation, result */
|
|
869
|
+
responseValidationResult: ComputedRef<ApiDataValidation | undefined>;
|
|
870
|
+
/** @keywords length, computed */
|
|
871
|
+
length: ComputedRef<number>;
|
|
872
|
+
/** @keywords starting, flag */
|
|
873
|
+
starting: ComputedRef<boolean>;
|
|
874
|
+
/** @keywords loading, ref */
|
|
875
|
+
loading: Ref<boolean>;
|
|
876
|
+
/** @keywords reading, ref */
|
|
877
|
+
reading: Ref<boolean>;
|
|
878
|
+
/** @keywords is, starting */
|
|
879
|
+
isStarting(): boolean;
|
|
880
|
+
/** @keywords is, loading */
|
|
881
|
+
isLoading(): boolean;
|
|
882
|
+
/** @keywords is, reading */
|
|
883
|
+
isReading(): boolean;
|
|
884
|
+
/** @keywords get, item */
|
|
885
|
+
getItem(): ApiData<R> | undefined;
|
|
886
|
+
/** @keywords init */
|
|
887
|
+
init(): void;
|
|
888
|
+
/** @keywords init, ssr */
|
|
889
|
+
initSsr(): void;
|
|
890
|
+
/** @keywords reset */
|
|
891
|
+
reset(): Promise<void>;
|
|
892
|
+
/** @keywords stop */
|
|
893
|
+
stop(): void;
|
|
894
|
+
/** @keywords abort */
|
|
895
|
+
abort(): void;
|
|
488
896
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
* Automatically handles SSR, reactivity, caching, error storage, data validation, and transformation.
|
|
492
|
-
*
|
|
493
|
-
* @example
|
|
494
|
-
* ```typescript
|
|
495
|
-
* import { Schema as S } from '@effect/schema'
|
|
496
|
-
* import { useApiRef } from '@dxtmisha/functional'
|
|
497
|
-
*
|
|
498
|
-
* const userSchema = S.Struct({ id: S.Number, name: S.String })
|
|
499
|
-
*
|
|
500
|
-
* const { data, loading, errorItem, isResponseContractValid } = useApiRef(
|
|
501
|
-
* '/users/1',
|
|
502
|
-
* { method: 'GET' },
|
|
503
|
-
* true,
|
|
504
|
-
* undefined,
|
|
505
|
-
* (data) => ({ ...data, isTransformed: true }),
|
|
506
|
-
* (data) => {
|
|
507
|
-
* try {
|
|
508
|
-
* return { status: 'success', data: S.decodeUnknownSync(userSchema)(data) }
|
|
509
|
-
* } catch (e) {
|
|
510
|
-
* return { status: 'error', errors: e }
|
|
511
|
-
* }
|
|
512
|
-
* },
|
|
513
|
-
* [
|
|
514
|
-
* {
|
|
515
|
-
* status: 404,
|
|
516
|
-
* message: 'User not found'
|
|
517
|
-
* }
|
|
518
|
-
* ]
|
|
519
|
-
* )
|
|
520
|
-
* ```
|
|
521
|
-
*/
|
|
897
|
+
|
|
898
|
+
/** @keywords api, ref, vue, composable */
|
|
522
899
|
export declare function useApiRef<R, T = R>(path?: RefOrNormal<string | undefined>, options?: ApiOptions, reactivity?: boolean, conditions?: RefType<boolean>, transformation?: (data: T, isResponseContractValid?: ApiDataValidation) => ApiData<R>, validateResponseContract?: (data: T) => ApiDataValidation, errorContract?: ApiErrorStorageList, unmounted?: boolean, apiInstance?: ApiInstance): UseApiRef<R>;
|
|
900
|
+
|
|
901
|
+
/** @keywords set, api, global, conditions */
|
|
523
902
|
export declare const setApiRefGlobalConditions: (conditions: RefType<any>) => void;
|
|
903
|
+
|
|
904
|
+
import { ApiInstance, ApiMethodItem, ApiData, ApiFetch, ApiErrorStorageList, ApiDataValidation } from '@dxtmisha/functional-basic';
|
|
905
|
+
import { Ref } from 'vue';
|
|
906
|
+
|
|
907
|
+
/** Setup interface for API request. @keywords useApiRequest setup api request configuration */
|
|
524
908
|
export interface UseApiRequestSetup<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> {
|
|
909
|
+
/** Path to the API endpoint. @keywords path endpoint api */
|
|
525
910
|
path?: RefOrNormal<string | undefined>;
|
|
911
|
+
/** HTTP method used for the request. @keywords method http get post */
|
|
526
912
|
method?: ApiMethodItem;
|
|
913
|
+
/** Action callback after successful completion. @keywords action callback success */
|
|
527
914
|
action?: (data: Return | undefined) => Promise<void> | void;
|
|
915
|
+
/** Transformation function for response data. @keywords transformation transform response data */
|
|
528
916
|
transformation?: (data: T) => Return;
|
|
917
|
+
/** Function to validate the request payload contract. @keywords validate request contract payload */
|
|
529
918
|
validateRequestContract?: (data: Request) => ApiDataValidation & Return;
|
|
919
|
+
/** Function to validate response data contract. @keywords validate response contract schema */
|
|
530
920
|
validateResponseContract?: (data: T) => ApiDataValidation & Return;
|
|
921
|
+
/** Array of expected error contracts for the request. @keywords error contract list */
|
|
531
922
|
errorContract?: ApiErrorStorageList;
|
|
923
|
+
/** If true, extracts nested data field. @keywords toData extract response data */
|
|
532
924
|
toData?: boolean;
|
|
925
|
+
/** Additional request options. @keywords options request headers params */
|
|
533
926
|
options?: ApiOptions;
|
|
927
|
+
/** Custom Api instance. @keywords apiInstance custom api */
|
|
534
928
|
apiInstance?: ApiInstance;
|
|
535
929
|
}
|
|
930
|
+
|
|
931
|
+
/** Execute an API request with loading states. @keywords useApiRequest request api fetch */
|
|
536
932
|
export declare function useApiRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>>({ path, method, action, transformation, validateRequestContract, validateResponseContract, errorContract, toData, options, apiInstance }: UseApiRequestSetup<T, Request, Return>): {
|
|
933
|
+
/** Loading state flag. @keywords loading state ref */
|
|
537
934
|
loading: Ref<boolean, boolean>;
|
|
935
|
+
/** Send the API request. @keywords send request api method */
|
|
538
936
|
send(request?: Request): Promise<Return | undefined>;
|
|
539
937
|
};
|
|
938
|
+
|
|
939
|
+
import { Ref } from 'vue';
|
|
940
|
+
|
|
540
941
|
type BroadcastValueItem<T> = T | string | undefined;
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* Creates a reactive variable to manage data between browser tabs.
|
|
945
|
+
* @keywords broadcast value ref tabs reactive
|
|
946
|
+
* @param name value name
|
|
947
|
+
* @param defaultValue default value
|
|
948
|
+
*/
|
|
541
949
|
export declare function useBroadcastValueRef<T>(name: string, defaultValue?: T | string | (() => (T | string))): Ref<BroadcastValueItem<T>>;
|
|
950
|
+
|
|
951
|
+
export {};
|
|
952
|
+
|
|
953
|
+
import { Ref } from 'vue';
|
|
954
|
+
import { CookieOptions } from '@dxtmisha/functional-basic';
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* Creates a reactive variable to manage cookies.
|
|
958
|
+
* @keywords cookie, ref, reactive, storage, useCookieRef
|
|
959
|
+
*/
|
|
542
960
|
export declare function useCookieRef<T>(name: string, defaultValue?: T | string | (() => (T | string)), options?: CookieOptions): Ref<T | string | undefined>;
|
|
961
|
+
|
|
962
|
+
import { FormattersListProp, FormattersOptionsList, FormattersReturn } from '@dxtmisha/functional-basic';
|
|
963
|
+
import { ComputedRef } from 'vue';
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Reactively formats a list of data based on provided formatting options.
|
|
967
|
+
* @keywords useFormattersRef formatters list reactive
|
|
968
|
+
*/
|
|
543
969
|
export declare function useFormattersRef<Options extends FormattersOptionsList = FormattersOptionsList, List extends FormattersListProp = FormattersListProp>(list: RefType<List | undefined>, options: Options): {
|
|
970
|
+
/** Formatted data list. @keywords list format computed */
|
|
544
971
|
listFormat: ComputedRef<FormattersReturn<List, Options>>;
|
|
972
|
+
/** Count of records in the formatted list. @keywords length count list */
|
|
545
973
|
length: ComputedRef<number>;
|
|
546
974
|
};
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
*
|
|
550
|
-
* @remarks
|
|
551
|
-
* Avoid using this reactive composable if reactive updates are not required.
|
|
552
|
-
* For non-reactive formatting, use the standard `GeoIntl` class from `@dxtmisha/functional-basic`.
|
|
553
|
-
*/
|
|
975
|
+
|
|
976
|
+
/** Returns a class object for working with data formatting. @keywords geo intl format ref */
|
|
554
977
|
export declare function useGeoIntlRef(): GeoIntlRef;
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Returns a class object for working with unit formatting and automatic conversions.
|
|
981
|
+
* @keywords useGeoUnitRef, geo, unit, formatting, conversion
|
|
982
|
+
*/
|
|
555
983
|
export declare function useGeoUnitRef(): GeoUnitRef;
|
|
984
|
+
|
|
985
|
+
import { ShallowRef } from 'vue';
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Creates a reactive variable to manage the hash.
|
|
989
|
+
* @keywords useHashRef hash reactive variable state url
|
|
990
|
+
* @param name value name
|
|
991
|
+
* @param defaultValue default value
|
|
992
|
+
*/
|
|
556
993
|
export declare function useHashRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
|
|
994
|
+
|
|
557
995
|
export type LazyItemByMargin = {
|
|
558
996
|
rootMargin: string;
|
|
559
997
|
item: ReturnType<typeof useLazyRef>;
|
|
560
998
|
};
|
|
999
|
+
/**
|
|
1000
|
+
* Hook for tracking element visibility by margin.
|
|
1001
|
+
* @keywords useLazyItemByMarginRef, lazy, observer, margin
|
|
1002
|
+
*/
|
|
561
1003
|
export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | undefined>, rootMargin?: string) => {
|
|
1004
|
+
/** Lazy item status */
|
|
562
1005
|
lazyItemStatus: ShallowRef<boolean, boolean>;
|
|
1006
|
+
/** Tracked lazy item instance */
|
|
563
1007
|
readonly lazyItem: LazyItem | undefined;
|
|
564
1008
|
};
|
|
1009
|
+
|
|
1010
|
+
import { Ref, ShallowRef } from 'vue';
|
|
1011
|
+
|
|
565
1012
|
export type LazyItem = {
|
|
566
1013
|
status: ShallowRef<boolean>;
|
|
567
1014
|
ratio: ShallowRef<number>;
|
|
568
1015
|
entry: ShallowRef<IntersectionObserverEntry | undefined>;
|
|
569
1016
|
stopWatch: () => void;
|
|
570
1017
|
};
|
|
1018
|
+
|
|
571
1019
|
export type LazyList = Record<string, LazyItem>;
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Initializes lazy reference tracking using Intersection Observer.
|
|
1023
|
+
* @keywords useLazyRef, lazy, observer, intersection, ref
|
|
1024
|
+
*/
|
|
572
1025
|
export declare const useLazyRef: (options?: IntersectionObserverInit) => {
|
|
573
1026
|
intersectionObserver: IntersectionObserver | undefined;
|
|
1027
|
+
/**
|
|
1028
|
+
* Gets lazy item by element.
|
|
1029
|
+
* @keywords getItem, lazy, element
|
|
1030
|
+
*/
|
|
574
1031
|
getItem(element?: HTMLElement): LazyItem | undefined;
|
|
1032
|
+
/**
|
|
1033
|
+
* Adds an element for lazy tracking.
|
|
1034
|
+
* @keywords addLazyItem, lazy, track
|
|
1035
|
+
*/
|
|
575
1036
|
addLazyItem(element: Ref<HTMLElement | undefined>): ShallowRef<boolean, boolean>;
|
|
1037
|
+
/**
|
|
1038
|
+
* Removes an element from lazy tracking.
|
|
1039
|
+
* @keywords removeLazyItem, lazy, remove
|
|
1040
|
+
*/
|
|
576
1041
|
removeLazyItem: (element?: HTMLElement) => void;
|
|
1042
|
+
/**
|
|
1043
|
+
* Disconnects lazy observer.
|
|
1044
|
+
* @keywords disconnectLazy, lazy, observer
|
|
1045
|
+
*/
|
|
577
1046
|
disconnectLazy: () => void | undefined;
|
|
578
1047
|
};
|
|
1048
|
+
|
|
1049
|
+
import { ShallowRef } from 'vue';
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Returns the global loading status reference.
|
|
1053
|
+
* @keywords useLoadingRef, loading, status, ref
|
|
1054
|
+
*/
|
|
579
1055
|
export declare function useLoadingRef(): ShallowRef<boolean, boolean>;
|
|
1056
|
+
|
|
1057
|
+
import { MetaRobots, Meta } from '@dxtmisha/functional-basic';
|
|
1058
|
+
import { Ref } from 'vue';
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* Vue composable for reactive meta tags management.
|
|
1062
|
+
* @keywords use_meta meta tags management seo vue
|
|
1063
|
+
*/
|
|
580
1064
|
export declare const useMeta: () => Readonly<{
|
|
581
1065
|
meta: Meta;
|
|
582
1066
|
title: Ref<string, string>;
|
|
@@ -587,20 +1071,33 @@ export declare const useMeta: () => Readonly<{
|
|
|
587
1071
|
canonical: Ref<string, string>;
|
|
588
1072
|
robots: Ref<MetaRobots, MetaRobots>;
|
|
589
1073
|
siteName: Ref<string, string>;
|
|
1074
|
+
/** Generates HTML string for all meta tags. @keywords get_html_meta ssr */
|
|
590
1075
|
getHtmlMeta: () => string;
|
|
1076
|
+
/** Synchronizes reactive values with MetaStatic. @keywords sync meta */
|
|
591
1077
|
sync: () => void;
|
|
1078
|
+
/** Updates MetaStatic values with current reactive state. @keywords update meta */
|
|
592
1079
|
update: () => void;
|
|
1080
|
+
/** Updates MetaStatic values in SSR environment. @keywords update ssr */
|
|
593
1081
|
updateSsr: () => void;
|
|
1082
|
+
/** Sets the page title. @keywords set title */
|
|
594
1083
|
setTitle: (value: string) => void;
|
|
1084
|
+
/** Sets the keywords meta tag. @keywords set keywords */
|
|
595
1085
|
setKeywords: (value: string) => void;
|
|
1086
|
+
/** Sets the description meta tag. @keywords set description */
|
|
596
1087
|
setDescription: (value: string) => void;
|
|
1088
|
+
/** Sets the author meta tag. @keywords set author */
|
|
597
1089
|
setAuthor: (value: string) => void;
|
|
1090
|
+
/** Sets the Open Graph / Twitter Card image URL. @keywords set image */
|
|
598
1091
|
setImage: (value: string) => void;
|
|
1092
|
+
/** Sets the canonical URL. @keywords set canonical */
|
|
599
1093
|
setCanonical: (value: string) => void;
|
|
1094
|
+
/** Sets the robots meta tag directive. @keywords set robots */
|
|
600
1095
|
setRobots: (value: MetaRobots) => void;
|
|
1096
|
+
/** Sets the site name for Open Graph and Twitter Card. @keywords set site name */
|
|
601
1097
|
setSiteName: (value: string) => void;
|
|
1098
|
+
/** Sets the suffix for the page title. @keywords set suffix */
|
|
602
1099
|
setSuffix: (suffix: string) => void;
|
|
603
|
-
}
|
|
1100
|
+
} & {
|
|
604
1101
|
init(): Readonly<{
|
|
605
1102
|
meta: Meta;
|
|
606
1103
|
title: Ref<string, string>;
|
|
@@ -611,63 +1108,167 @@ export declare const useMeta: () => Readonly<{
|
|
|
611
1108
|
canonical: Ref<string, string>;
|
|
612
1109
|
robots: Ref<MetaRobots, MetaRobots>;
|
|
613
1110
|
siteName: Ref<string, string>;
|
|
1111
|
+
/** Generates HTML string for all meta tags. @keywords get_html_meta ssr */
|
|
614
1112
|
getHtmlMeta: () => string;
|
|
1113
|
+
/** Synchronizes reactive values with MetaStatic. @keywords sync meta */
|
|
615
1114
|
sync: () => void;
|
|
1115
|
+
/** Updates MetaStatic values with current reactive state. @keywords update meta */
|
|
616
1116
|
update: () => void;
|
|
1117
|
+
/** Updates MetaStatic values in SSR environment. @keywords update ssr */
|
|
617
1118
|
updateSsr: () => void;
|
|
1119
|
+
/** Sets the page title. @keywords set title */
|
|
618
1120
|
setTitle: (value: string) => void;
|
|
1121
|
+
/** Sets the keywords meta tag. @keywords set keywords */
|
|
619
1122
|
setKeywords: (value: string) => void;
|
|
1123
|
+
/** Sets the description meta tag. @keywords set description */
|
|
620
1124
|
setDescription: (value: string) => void;
|
|
1125
|
+
/** Sets the author meta tag. @keywords set author */
|
|
621
1126
|
setAuthor: (value: string) => void;
|
|
1127
|
+
/** Sets the Open Graph / Twitter Card image URL. @keywords set image */
|
|
622
1128
|
setImage: (value: string) => void;
|
|
1129
|
+
/** Sets the canonical URL. @keywords set canonical */
|
|
623
1130
|
setCanonical: (value: string) => void;
|
|
1131
|
+
/** Sets the robots meta tag directive. @keywords set robots */
|
|
624
1132
|
setRobots: (value: MetaRobots) => void;
|
|
1133
|
+
/** Sets the site name for Open Graph and Twitter Card. @keywords set site name */
|
|
625
1134
|
setSiteName: (value: string) => void;
|
|
1135
|
+
/** Sets the suffix for the page title. @keywords set suffix */
|
|
626
1136
|
setSuffix: (suffix: string) => void;
|
|
627
1137
|
}>;
|
|
1138
|
+
/** Destroys execution context. @keywords destroy execute */
|
|
628
1139
|
destroyExecute?(): void;
|
|
629
1140
|
}>;
|
|
1141
|
+
|
|
1142
|
+
import { ShallowRef } from 'vue';
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* Creates a reactive variable to manage URL query parameters.
|
|
1146
|
+
* @keywords query parameter url ref reactive
|
|
1147
|
+
* @param name Parameter name
|
|
1148
|
+
* @param defaultValue Default value
|
|
1149
|
+
*/
|
|
630
1150
|
export declare function useQueryRef<T>(name: string, defaultValue?: T | (() => T)): ShallowRef<T>;
|
|
1151
|
+
|
|
1152
|
+
import { Ref, ComputedRef } from 'vue';
|
|
1153
|
+
import { NumberOrString } from '@dxtmisha/functional-basic';
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* Managing a list of links for the router.
|
|
1157
|
+
* @keywords useRouterList router links navigation
|
|
1158
|
+
*/
|
|
631
1159
|
export declare const useRouterList: <T extends ListDataBasic>(list: RefType<ConstrBind<T>[] | undefined>, selected?: Ref<string> | string, hasTo?: boolean) => {
|
|
1160
|
+
/** Active router item / Активный элемент роутера */
|
|
632
1161
|
item: ComputedRef<T | undefined>;
|
|
1162
|
+
/** Selected element / Выбранный элемент */
|
|
633
1163
|
selected: Ref<string, string>;
|
|
1164
|
+
/** Label of selected element / Метка выбранного элемента */
|
|
634
1165
|
label: ComputedRef<NumberOrString>;
|
|
1166
|
+
/** List of elements / Список элементов */
|
|
635
1167
|
list: ComputedRef<ConstrBind<T>[]>;
|
|
1168
|
+
/** Navigate by name / Переход по имени */
|
|
636
1169
|
to: (name?: string) => void;
|
|
1170
|
+
/** Transition to the main element / Переход к главному элементу */
|
|
637
1171
|
toMain(): void;
|
|
638
1172
|
};
|
|
1173
|
+
|
|
1174
|
+
import { Ref, ComputedRef } from 'vue';
|
|
1175
|
+
import { SearchColumns, SearchFormatList, SearchItem, SearchOptions } from '@dxtmisha/functional-basic';
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* Composable for handling search logic with reactive data.
|
|
1179
|
+
* @keywords search ref reactive list columns
|
|
1180
|
+
*/
|
|
639
1181
|
export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns?: SearchColumnsInput<T, K>, value?: Ref<string>, options?: SearchOptions): {
|
|
1182
|
+
/** Whether search is currently active. @keywords isSearch active */
|
|
640
1183
|
isSearch: ComputedRef<boolean>;
|
|
1184
|
+
/** Search string reference. @keywords search string */
|
|
641
1185
|
search: Ref<string, string>;
|
|
1186
|
+
/** Search loading status reference. @keywords loading status */
|
|
642
1187
|
loading: Ref<boolean, boolean>;
|
|
1188
|
+
/** Formatted search results list. @keywords list search results */
|
|
643
1189
|
listSearch: ComputedRef<SearchFormatList<T, K>>;
|
|
1190
|
+
/** Length of search results. @keywords length count */
|
|
644
1191
|
length: ComputedRef<number>;
|
|
645
1192
|
};
|
|
1193
|
+
|
|
1194
|
+
import { Ref } from 'vue';
|
|
1195
|
+
import { SearchList, SearchColumns, SearchItem } from '@dxtmisha/functional-basic';
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* Manages search value state and handling delays.
|
|
1199
|
+
* @keywords useSearchValueRef, search, delay, debounce, loading
|
|
1200
|
+
*/
|
|
646
1201
|
export declare function useSearchValueRef<T extends SearchItem, K extends SearchColumns<T>>(item: SearchList<T, K>, value?: Ref<string>): {
|
|
1202
|
+
/** Current search value */
|
|
647
1203
|
search: Ref<string, string>;
|
|
1204
|
+
/** Search value with applied delay */
|
|
648
1205
|
searchDelay: Ref<string, string>;
|
|
1206
|
+
/** Loading status during delay */
|
|
649
1207
|
loading: Ref<boolean, boolean>;
|
|
650
1208
|
};
|
|
1209
|
+
|
|
1210
|
+
import { Ref } from 'vue';
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Creates a reactive variable for session storage.
|
|
1214
|
+
* @keywords session ref storage reactive
|
|
1215
|
+
*/
|
|
651
1216
|
export declare function useSessionRef<T>(name: string, defaultValue?: T | (() => T)): Ref<T | undefined>;
|
|
1217
|
+
|
|
1218
|
+
import { Ref } from 'vue';
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Creates a reactive reference to manage browser local storage.
|
|
1222
|
+
* @keywords storage, local, reactive, ref
|
|
1223
|
+
*/
|
|
652
1224
|
export declare function useStorageRef<T>(name: string, defaultValue?: T | (() => T), cache?: number): Ref<T | undefined>;
|
|
1225
|
+
|
|
1226
|
+
import { ShallowRef } from 'vue';
|
|
1227
|
+
import { TranslateInstance, TranslateList } from '@dxtmisha/functional-basic';
|
|
1228
|
+
|
|
653
1229
|
/**
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
* Use `as const` for arrays to ensure proper TypeScript key inference.
|
|
657
|
-
*
|
|
658
|
-
* @example
|
|
659
|
-
* ```typescript
|
|
660
|
-
* const translations = useTranslateRef(['home.title', 'home.description'] as const);
|
|
661
|
-
* const labels = t(['button.save', 'button.cancel'] as const);
|
|
662
|
-
* ```
|
|
1230
|
+
* Gets translated text by key or array of keys.
|
|
1231
|
+
* @keywords translate ref localization i18n
|
|
663
1232
|
*/
|
|
664
1233
|
export declare function useTranslateRef<T extends (string | string[])[]>(names: T, translateInstance?: TranslateInstance): ShallowRef<TranslateList<T>>;
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* Shorthand alias for useTranslateRef.
|
|
1237
|
+
* @keywords translate t localization i18n shorthand
|
|
1238
|
+
*/
|
|
665
1239
|
export declare const t: <T extends string[]>(names: T) => ShallowRef<TranslateList<T>>;
|
|
1240
|
+
|
|
1241
|
+
```ts
|
|
1242
|
+
/** Initializes user interface flags. @keywords ui, flags, initialize */
|
|
666
1243
|
export declare const uiMakeFlags: () => void;
|
|
1244
|
+
```
|
|
1245
|
+
|
|
667
1246
|
export * from '@dxtmisha/functional-basic';
|
|
1247
|
+
|
|
1248
|
+
import { ComputedRef, DebuggerOptions } from 'vue';
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Creates a computed property that handles asynchronous getters.
|
|
1252
|
+
* @keywords computed async reactive vue
|
|
1253
|
+
*/
|
|
668
1254
|
export declare function computedAsync<R>(getter: (() => Promise<R>) | (() => R) | R, initialState?: (() => R) | R, ignore?: R, debugOptions?: DebuggerOptions): ComputedRef<R | undefined>;
|
|
1255
|
+
|
|
1256
|
+
import { ComputedGetter, ComputedRef, DebuggerOptions } from 'vue';
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* Creates a language-dependent computed reactive property.
|
|
1260
|
+
* @keywords computed language reactive getter
|
|
1261
|
+
*/
|
|
669
1262
|
export declare function computedByLanguage<T, R extends (T | undefined) = T | undefined>(getter: ComputedGetter<R>, getterNone?: R | (() => R), conditions?: () => boolean, debugOptions?: DebuggerOptions): ComputedRef<R>;
|
|
1263
|
+
|
|
1264
|
+
/** Computes eternity property on demand with caching @keywords computed eternity cache async */
|
|
670
1265
|
export declare function computedEternity<T>(getter: () => Promise<T> | T, initialState?: (() => T) | T): Ref<T, T>;
|
|
1266
|
+
|
|
1267
|
+
import { Plugin } from 'vue';
|
|
1268
|
+
import { InputSocialIcons } from '@dxtmisha/media';
|
|
1269
|
+
import { ApiConfig, ErrorCenterCauseList, ErrorCenterHandlerCallback, ErrorCenterHandlerList, IconsConfig, TranslateConfig } from '@dxtmisha/functional-basic';
|
|
1270
|
+
import { Router } from 'vue-router';
|
|
1271
|
+
|
|
671
1272
|
export interface FunctionalPluginOptions {
|
|
672
1273
|
api?: ApiConfig;
|
|
673
1274
|
translate?: TranslateConfig;
|
|
@@ -680,57 +1281,44 @@ export interface FunctionalPluginOptions {
|
|
|
680
1281
|
errorHandlers?: ErrorCenterHandlerList;
|
|
681
1282
|
errorCallbacks?: ErrorCenterHandlerCallback[];
|
|
682
1283
|
}
|
|
1284
|
+
|
|
683
1285
|
/**
|
|
684
|
-
* Vue plugin for initializing and configuring global functional services
|
|
685
|
-
*
|
|
686
|
-
*
|
|
1286
|
+
* Vue plugin for initializing and configuring global functional services.
|
|
1287
|
+
* @keywords plugin, dxtFunctionalPlugin, functional, vue
|
|
687
1288
|
* @example
|
|
688
|
-
* ```typescript
|
|
689
1289
|
* import { createApp } from 'vue'
|
|
690
1290
|
* import { dxtFunctionalPlugin } from '@dxtmisha/functional'
|
|
691
|
-
* import router from './router'
|
|
692
|
-
*
|
|
693
1291
|
* const app = createApp(App)
|
|
694
|
-
* app.use(dxtFunctionalPlugin, {
|
|
695
|
-
* api: { url: 'https://api.example.com' },
|
|
696
|
-
* metaSuffix: ' | My App',
|
|
697
|
-
* router
|
|
698
|
-
* })
|
|
699
|
-
* ```
|
|
1292
|
+
* app.use(dxtFunctionalPlugin, { api: { url: 'https://api.example.com' } })
|
|
700
1293
|
*/
|
|
701
1294
|
export declare const dxtFunctionalPlugin: Plugin;
|
|
1295
|
+
|
|
1296
|
+
/** Types of initialization for a singleton @keywords execute, use, type */
|
|
702
1297
|
export declare enum ExecuteUseType {
|
|
1298
|
+
/** Global application instance @keywords global, singleton */
|
|
703
1299
|
global = "global",
|
|
1300
|
+
/** Provide/inject shared instance @keywords provide, inject */
|
|
704
1301
|
provide = "provide",
|
|
1302
|
+
/** Local closure instance @keywords local, closure */
|
|
705
1303
|
local = "local"
|
|
706
1304
|
}
|
|
1305
|
+
|
|
707
1306
|
export type ExecuteUseReturn<R> = Readonly<R & {
|
|
1307
|
+
/** Returns raw instance @keywords init, raw */
|
|
708
1308
|
init(): Readonly<R>;
|
|
1309
|
+
/** Resets cached instance @keywords destroy, reset */
|
|
709
1310
|
destroyExecute?(): void;
|
|
710
1311
|
}>;
|
|
1312
|
+
|
|
711
1313
|
/**
|
|
712
|
-
* Creates a managed singleton
|
|
713
|
-
*
|
|
714
|
-
*
|
|
715
|
-
* @remarks
|
|
716
|
-
* Use this function for API services, shared reactive states, and singleton resource optimizations.
|
|
717
|
-
*
|
|
718
|
-
* @example
|
|
719
|
-
* export const useUserApi = executeUseGlobal(() => {
|
|
720
|
-
* return useApiGet('/api/user');
|
|
721
|
-
* });
|
|
722
|
-
*
|
|
723
|
-
* export const useFeatureState = executeUseProvide(() => {
|
|
724
|
-
* const items = [];
|
|
725
|
-
* const addItem = (item) => items.push(item);
|
|
726
|
-
* return { items, addItem };
|
|
727
|
-
* });
|
|
1314
|
+
* Creates a managed singleton with initialization strategies.
|
|
1315
|
+
* @keywords execute, use, singleton, factory
|
|
728
1316
|
*/
|
|
729
1317
|
export declare function executeUse<R, O extends any[], RI extends ExecuteUseReturn<R> = ExecuteUseReturn<R>>(callback: (...args: O) => R, type?: ExecuteUseType): ((...args: O) => RI) | (() => RI);
|
|
730
1318
|
|
|
731
1319
|
/**
|
|
732
1320
|
* Creates a global singleton.
|
|
733
|
-
* @
|
|
1321
|
+
* @keywords execute, use, global, singleton
|
|
734
1322
|
*/
|
|
735
1323
|
export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<R & {
|
|
736
1324
|
init(): Readonly<R>;
|
|
@@ -742,7 +1330,7 @@ export declare function executeUseGlobal<R>(callback: () => R): (() => Readonly<
|
|
|
742
1330
|
|
|
743
1331
|
/**
|
|
744
1332
|
* Creates a component-scoped singleton.
|
|
745
|
-
* @
|
|
1333
|
+
* @keywords execute, use, provide, singleton
|
|
746
1334
|
*/
|
|
747
1335
|
export declare function executeUseProvide<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
|
|
748
1336
|
init(): Readonly<R>;
|
|
@@ -754,7 +1342,7 @@ export declare function executeUseProvide<R, O extends any[]>(callback: (...args
|
|
|
754
1342
|
|
|
755
1343
|
/**
|
|
756
1344
|
* Creates a local singleton.
|
|
757
|
-
* @
|
|
1345
|
+
* @keywords execute, use, local, singleton
|
|
758
1346
|
*/
|
|
759
1347
|
export declare function executeUseLocal<R, O extends any[]>(callback: (...args: O) => R): ((...args: O) => Readonly<R & {
|
|
760
1348
|
init(): Readonly<R>;
|
|
@@ -764,18 +1352,295 @@ export declare function executeUseLocal<R, O extends any[]>(callback: (...args:
|
|
|
764
1352
|
destroyExecute?(): void;
|
|
765
1353
|
}>);
|
|
766
1354
|
|
|
1355
|
+
/**
|
|
1356
|
+
* Initializes all global callbacks.
|
|
1357
|
+
* @keywords execute, use, global, init
|
|
1358
|
+
*/
|
|
767
1359
|
export declare function executeUseGlobalInit(): void;
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* Get injected value by name.
|
|
1363
|
+
* @keywords get_inject dependency injection
|
|
1364
|
+
*/
|
|
768
1365
|
export declare function getInject<T>(name: string): T | undefined;
|
|
1366
|
+
|
|
1367
|
+
/** Get request options. @keywords get_options request api */
|
|
769
1368
|
export declare const getOptions: (options?: ApiOptions) => RefOrNormal<ApiFetch>;
|
|
1369
|
+
|
|
1370
|
+
/**
|
|
1371
|
+
* Executes a function if provided and unwraps the resulting Vue Ref.
|
|
1372
|
+
* @keywords execute, function, ref, unwrap, reactive
|
|
1373
|
+
*/
|
|
770
1374
|
export declare function executeFunctionRef<T>(data: RefOrNormalOrFunction<T>): T;
|
|
1375
|
+
|
|
1376
|
+
import { ComputedRef } from 'vue';
|
|
1377
|
+
import { ApiData, ApiErrorItem } from '@dxtmisha/functional-basic';
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* Returns the error item for the Api ref.
|
|
1381
|
+
* @keywords api error ref reactive getApiErrorRef
|
|
1382
|
+
*/
|
|
771
1383
|
export declare function getApiErrorRef<R>(data: RefType<ApiData<R> | undefined>): ComputedRef<ApiErrorItem | undefined>;
|
|
1384
|
+
|
|
1385
|
+
import { ComputedRef } from 'vue';
|
|
1386
|
+
import { ItemList } from '@dxtmisha/functional-basic';
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Generates a computed reference for subcomponent bindings.
|
|
1390
|
+
* @keywords get_bind_ref reactive properties computed binding
|
|
1391
|
+
*/
|
|
772
1392
|
export declare function getBindRef<T, R extends ItemList>(value: RefOrNormal<T | R> | undefined, nameExtra?: RefOrNormal<ItemList> | string, name?: string): ComputedRef<R>;
|
|
1393
|
+
|
|
1394
|
+
/** Returns the value of a reactive ref or the value itself if not reactive. @keywords get ref value unwrap */
|
|
773
1395
|
export declare function getRef<T>(item: RefOrNormal<T>): T;
|
|
1396
|
+
|
|
1397
|
+
import { VNode } from 'vue';
|
|
1398
|
+
import { ItemList } from '@dxtmisha/functional-basic';
|
|
1399
|
+
|
|
1400
|
+
/** Render virtual node with cached properties. @keywords render, vnode, components */
|
|
774
1401
|
export declare function render<T extends ItemList>(name: string | any, props?: T, children?: RawChildren | RawSlots, index?: string): VNode;
|
|
1402
|
+
|
|
1403
|
+
import { Ref } from 'vue';
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* Changes the value of a reactive reference.
|
|
1407
|
+
* @keywords set ref value update
|
|
1408
|
+
*/
|
|
775
1409
|
export declare function setRef<T>(item: Ref<T>, value: T): void;
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* Returns a reference or wraps the value in a reference.
|
|
1413
|
+
* @keywords ref toRefItem wrap reactive variable
|
|
1414
|
+
*/
|
|
776
1415
|
export declare function toRefItem<T>(item: RefOrNormal<T>): Ref<T>;
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* Generates component binding properties.
|
|
1419
|
+
* @keywords getBind bind properties component attributes
|
|
1420
|
+
*/
|
|
777
1421
|
export declare function getBind<T, R extends ItemList>(value: T | R | undefined | null, nameExtra?: ItemList | string, name?: string, except?: boolean): ConstrBind<R>;
|
|
1422
|
+
|
|
1423
|
+
/**
|
|
1424
|
+
* Returns the class name from the provided properties object.
|
|
1425
|
+
* @keywords get class name props
|
|
1426
|
+
*/
|
|
778
1427
|
export declare function getClassName<T extends ItemList>(props?: T): string | undefined;
|
|
1428
|
+
|
|
1429
|
+
import { ItemList } from '@dxtmisha/functional-basic';
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* Returns or generates a render index string.
|
|
1433
|
+
* @keywords render, index, key, generator
|
|
1434
|
+
*/
|
|
779
1435
|
export declare function getIndexForRender<T extends ItemList>(name: string | any, props?: T, index?: string): string | undefined;
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* Merges two objects with properties, taking into account their classes and styles
|
|
1439
|
+
* @keywords toBind merge objects class style bind
|
|
1440
|
+
*/
|
|
780
1441
|
export declare function toBind<R extends ItemList = ItemList>(extra: ItemList, value: ItemList): ConstrBind<R>;
|
|
781
|
-
|
|
1442
|
+
|
|
1443
|
+
/** Merges multiple objects into a single bound object with combined classes and styles. @keywords toBinds merge bind styles classes */
|
|
1444
|
+
export declare function toBinds<R extends ItemList = ItemList>(...values: (ItemList | undefined)[]): ConstrBind<R>;
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
export type ApiOptions = ApiMethodItem | RefOrNormal<ApiFetch>;
|
|
1449
|
+
export type ApiManagementValue = ApiDefaultValue | ApiDefaultValue[];
|
|
1450
|
+
export type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = {
|
|
1451
|
+
path?: RefOrNormal<string | undefined>;
|
|
1452
|
+
options?: ApiOptions;
|
|
1453
|
+
reactivity?: boolean;
|
|
1454
|
+
conditions?: RefType<boolean>;
|
|
1455
|
+
transformation?: (data: Type, isResponseContractValid?: ApiDataValidation) => ApiData<Return>;
|
|
1456
|
+
validateResponseContract?: (data: Type) => ApiDataValidation;
|
|
1457
|
+
errorContract?: ApiErrorStorageList;
|
|
1458
|
+
typeData?: ((data: Return) => boolean) | any;
|
|
1459
|
+
unmounted?: boolean;
|
|
1460
|
+
skeleton?: () => Return;
|
|
1461
|
+
};
|
|
1462
|
+
export type ApiManagementSearch<T extends SearchItem, K extends SearchColumns<T>> = {
|
|
1463
|
+
columns: K;
|
|
1464
|
+
value?: Ref<string>;
|
|
1465
|
+
options?: SearchOptions;
|
|
1466
|
+
};
|
|
1467
|
+
export type ApiManagementRequest<T, Request extends ApiFetch['request'] = ApiFetch['request'], Return extends ApiData<T> = ApiData<T>> = {
|
|
1468
|
+
path?: RefOrNormal<string | undefined>;
|
|
1469
|
+
action?: (data: Return | undefined) => Promise<void> | void;
|
|
1470
|
+
transformation?: (data: T) => Return;
|
|
1471
|
+
validateRequestContract?: (data: Request) => ApiDataValidation & Return;
|
|
1472
|
+
validateResponseContract?: (data: T) => ApiDataValidation & Return;
|
|
1473
|
+
errorContract?: ApiErrorStorageList;
|
|
1474
|
+
toData?: boolean;
|
|
1475
|
+
options?: ApiOptions;
|
|
1476
|
+
};
|
|
1477
|
+
|
|
1478
|
+
export type ConstrItem = Record<string, any>;
|
|
1479
|
+
export type ConstrValue<T = any> = {
|
|
1480
|
+
value?: T;
|
|
1481
|
+
};
|
|
1482
|
+
export type ConstrComponent = Record<string, any>;
|
|
1483
|
+
export type ConstrComponentMod<P extends ConstrItem> = ConstrItem | {
|
|
1484
|
+
[K in keyof P]?: RefOrNormal<P[K]>;
|
|
1485
|
+
};
|
|
1486
|
+
export type ConstrExpose<E extends Element, EXPOSE extends ConstrItem> = EXPOSE & {
|
|
1487
|
+
elementHtml?: ComputedRef<E | undefined>;
|
|
1488
|
+
};
|
|
1489
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
1490
|
+
export type ConstrEmitItem<T extends ConstrItem> = T[keyof T];
|
|
1491
|
+
export type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{
|
|
1492
|
+
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
1493
|
+
}>>;
|
|
1494
|
+
export type ConstrClassObject = Record<string, boolean | undefined>;
|
|
1495
|
+
export type ConstrClass = string | (string | ConstrClass | Undefined)[] | ConstrClassObject;
|
|
1496
|
+
export type ConstrClassList = Record<string, ConstrClass>;
|
|
1497
|
+
export type ConstrClasses = {
|
|
1498
|
+
main: ConstrClass;
|
|
1499
|
+
} & ConstrClassList;
|
|
1500
|
+
export type ConstrStylesItem = string | null;
|
|
1501
|
+
export type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
|
|
1502
|
+
/** Constructor options for component configuration @keywords options setup component */
|
|
1503
|
+
export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
|
|
1504
|
+
components?: COMP;
|
|
1505
|
+
compMod?: ConstrComponentMod<P>;
|
|
1506
|
+
emits?: ConstrEmit<EMITS>;
|
|
1507
|
+
classes?: RefType<ConstrClasses>;
|
|
1508
|
+
styles?: RefType<ConstrStyles>;
|
|
1509
|
+
};
|
|
1510
|
+
/** Constructor setup structure for component initialization @keywords setup initialization */
|
|
1511
|
+
export type ConstrSetup<E extends Element, CLASSES extends ConstrClasses, SETUP extends ConstrItem> = {
|
|
1512
|
+
name: string;
|
|
1513
|
+
element: Ref<E | undefined>;
|
|
1514
|
+
classes: RefType<CLASSES>;
|
|
1515
|
+
styles: RefType<ConstrStyles>;
|
|
1516
|
+
} & SETUP;
|
|
1517
|
+
export type ConstrRegistration = {
|
|
1518
|
+
flag?: boolean;
|
|
1519
|
+
translate?: Record<string, string>;
|
|
1520
|
+
};
|
|
1521
|
+
/** Constructor bind type with class and style support @keywords bind attributes */
|
|
1522
|
+
export type ConstrBind<T> = T & Record<string, any> & {
|
|
1523
|
+
key?: string;
|
|
1524
|
+
class?: ConstrClass;
|
|
1525
|
+
style?: ConstrStyles;
|
|
1526
|
+
};
|
|
1527
|
+
export type ConstrPropItemOptions<T = any> = {
|
|
1528
|
+
type?: PropType<T>;
|
|
1529
|
+
required?: boolean;
|
|
1530
|
+
default?: any;
|
|
1531
|
+
validator?(value: any, props: any): boolean;
|
|
1532
|
+
};
|
|
1533
|
+
export type ConstrPropItem<T = any> = ConstrPropItemOptions<T> | PropType<T>;
|
|
1534
|
+
export type ConstrProps<P = Record<string, any>> = {
|
|
1535
|
+
[K in keyof P]: ConstrPropItem<P[K]>;
|
|
1536
|
+
};
|
|
1537
|
+
/** Hyperlink props definition @keywords href link properties */
|
|
1538
|
+
export type ConstrHrefProps = {
|
|
1539
|
+
href?: string;
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1542
|
+
import { NumberOrString, NumberOrStringOrBoolean } from '@dxtmisha/functional-basic';
|
|
1543
|
+
|
|
1544
|
+
/** Type of list item @keywords list, type, item */
|
|
1545
|
+
export type ListType = 'item' | 'space' | 'line' | 'subtitle' | 'html' | 'menu' | 'menu-group' | 'group';
|
|
1546
|
+
|
|
1547
|
+
/** Basic data structure for list item @keywords list, data, basic */
|
|
1548
|
+
export type ListDataBasic = {
|
|
1549
|
+
label?: NumberOrString;
|
|
1550
|
+
value?: any;
|
|
1551
|
+
search?: string;
|
|
1552
|
+
};
|
|
1553
|
+
|
|
1554
|
+
/** Extended list item with type and index @keywords list, item, extended */
|
|
1555
|
+
export type ListDataItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item & {
|
|
1556
|
+
parent?: string;
|
|
1557
|
+
type: ListType;
|
|
1558
|
+
index: string;
|
|
1559
|
+
disabled?: boolean;
|
|
1560
|
+
}>;
|
|
1561
|
+
|
|
1562
|
+
/** Array of list data items @keywords list, items, array */
|
|
1563
|
+
export type ListList<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item>[];
|
|
1564
|
+
|
|
1565
|
+
/** List or record structure for list data @keywords list, record, structure */
|
|
1566
|
+
export type ListRecord<Item extends ListDataBasic = ListDataBasic> = Item[] | Record<string, Item>;
|
|
1567
|
+
|
|
1568
|
+
/** Extended list item with additional state properties @keywords list, item, full, state */
|
|
1569
|
+
export type ListDataFullItem<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item> & {
|
|
1570
|
+
focus: boolean;
|
|
1571
|
+
highlight?: string;
|
|
1572
|
+
selected: boolean;
|
|
1573
|
+
disabled?: boolean;
|
|
1574
|
+
};
|
|
1575
|
+
|
|
1576
|
+
/** Array of extended list items with state @keywords list, data, full, state */
|
|
1577
|
+
export type ListDataFull<Item extends ListDataBasic = ListDataBasic> = ListDataFullItem<Item>[];
|
|
1578
|
+
|
|
1579
|
+
/** Input item for list creation @keywords list, input, item */
|
|
1580
|
+
export type ListListInputItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item>;
|
|
1581
|
+
|
|
1582
|
+
/** Various input formats for list creation @keywords list, input, formats */
|
|
1583
|
+
export type ListListInput<Item extends ListDataBasic = ListDataBasic> = ListListInputItem<Item>[] | string[] | Record<string, ListListInputItem<Item>> | Record<string, string>;
|
|
1584
|
+
|
|
1585
|
+
/** Single selected item identifier @keywords list, selected, item */
|
|
1586
|
+
export type ListSelectedItem = NumberOrStringOrBoolean;
|
|
1587
|
+
|
|
1588
|
+
/** Single or multiple selected items @keywords list, selected, list */
|
|
1589
|
+
export type ListSelectedList = ListSelectedItem | ListSelectedItem[];
|
|
1590
|
+
|
|
1591
|
+
/** Name of selected list item @keywords list, name */
|
|
1592
|
+
export type ListName = string | number | undefined;
|
|
1593
|
+
|
|
1594
|
+
/** Array of list item names @keywords list, names, array */
|
|
1595
|
+
export type ListNames = ListName[];
|
|
1596
|
+
|
|
1597
|
+
import { ComputedRef, Ref, VNode, VNodeArrayChildren } from 'vue';
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Union type for Vue reactive references (computed or ref)
|
|
1601
|
+
* @keywords ref type computed reactive
|
|
1602
|
+
*/
|
|
1603
|
+
export type RefType<T> = ComputedRef<T> | Ref<T>;
|
|
1604
|
+
|
|
1605
|
+
/**
|
|
1606
|
+
* Union type for Vue reactive references that can be undefined
|
|
1607
|
+
* @keywords ref undefined computed reactive
|
|
1608
|
+
*/
|
|
1609
|
+
export type RefUndefined<T> = RefType<T | undefined>;
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* Union type that can be either a Vue reactive reference or a normal value
|
|
1613
|
+
* @keywords ref normal value reactive
|
|
1614
|
+
*/
|
|
1615
|
+
export type RefOrNormal<T> = RefType<T> | T;
|
|
1616
|
+
|
|
1617
|
+
/**
|
|
1618
|
+
* Union type that can be a Vue reactive reference, normal value, or function returning them
|
|
1619
|
+
* @keywords ref normal function reactive
|
|
1620
|
+
*/
|
|
1621
|
+
export type RefOrNormalOrFunction<T> = RefOrNormal<T> | (() => RefOrNormal<T>);
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* Union type for Vue raw children content
|
|
1625
|
+
* @keywords raw children vnode array
|
|
1626
|
+
*/
|
|
1627
|
+
export type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* Type for Vue raw slots with optional stability flag
|
|
1631
|
+
* @keywords raw slots stable vue
|
|
1632
|
+
*/
|
|
1633
|
+
export type RawSlots = {
|
|
1634
|
+
[name: string]: unknown;
|
|
1635
|
+
$stable?: boolean;
|
|
1636
|
+
};
|
|
1637
|
+
|
|
1638
|
+
import { SearchColumns, SearchItem, SearchListValue } from '@dxtmisha/functional-basic';
|
|
1639
|
+
/** Search list value reference @keywords search list value ref */
|
|
1640
|
+
export type SearchListValueRef<T extends SearchItem> = RefOrNormal<SearchListValue<T>>;
|
|
1641
|
+
/** Search list input configuration @keywords search list input */
|
|
1642
|
+
export type SearchListInput<T extends SearchItem> = SearchListValueRef<T> | (() => SearchListValueRef<T>);
|
|
1643
|
+
/** Search columns reference @keywords search columns ref */
|
|
1644
|
+
export type SearchColumnsRef<T extends SearchItem, K extends SearchColumns<T>> = RefOrNormal<K>;
|
|
1645
|
+
/** Search columns input configuration @keywords search columns input */
|
|
1646
|
+
export type SearchColumnsInput<T extends SearchItem, K extends SearchColumns<T>> = SearchColumnsRef<T, K> | (() => SearchColumnsRef<T, K>);
|