mobx-view-model-devtools 0.0.42 → 0.0.43
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/auto.global.js +2 -2
- package/index.cjs +2 -2
- package/index.d.ts +28 -2
- package/index.js +287 -75
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { VirtualizerHandle } from 'virtua';
|
|
|
6
6
|
import { Ref } from 'yummies/mobx';
|
|
7
7
|
import { AnyObject, Maybe, Defined } from 'yummies/types';
|
|
8
8
|
import { KeyboardHandler as KeyboardHandler$1, KeyboardHandlerAction } from 'mobx-swiss-knife';
|
|
9
|
-
import { ComponentType, ChangeEventHandler, ChangeEvent, KeyboardEvent } from 'react';
|
|
9
|
+
import { ComponentType, ChangeEventHandler, ChangeEvent, FocusEvent, KeyboardEvent } from 'react';
|
|
10
10
|
|
|
11
11
|
declare class KeyboardHandler extends KeyboardHandler$1<KeyboardHandlerAction> {
|
|
12
12
|
constructor(devtools: ViewModelDevtools);
|
|
@@ -97,13 +97,24 @@ interface SearchEngineConfig {
|
|
|
97
97
|
getRootItems: () => ListItem<any>[];
|
|
98
98
|
getPresentationMode: () => 'tree' | 'list';
|
|
99
99
|
}
|
|
100
|
+
interface SearchSuggestion {
|
|
101
|
+
value: string;
|
|
102
|
+
suffix: string;
|
|
103
|
+
vmName: string;
|
|
104
|
+
}
|
|
100
105
|
declare class SearchEngine {
|
|
101
106
|
private config;
|
|
102
107
|
searchInputRef: FocusableRef<HTMLInputElement>;
|
|
103
108
|
searchText: string;
|
|
109
|
+
searchTextToSearch: string;
|
|
110
|
+
selectedSuggestionIndex: number;
|
|
111
|
+
isSearchInputFocused: boolean;
|
|
112
|
+
isSuggestionsDismissed: boolean;
|
|
104
113
|
searchCacheKey: string;
|
|
105
114
|
isSearching: boolean;
|
|
115
|
+
private searchTextToSearchTimeout;
|
|
106
116
|
private scrollToSearchMatchTimeout;
|
|
117
|
+
private static readonly searchDebounceMs;
|
|
107
118
|
private static readonly itemHeight;
|
|
108
119
|
get formattedSearchText(): string;
|
|
109
120
|
/**
|
|
@@ -112,15 +123,25 @@ declare class SearchEngine {
|
|
|
112
123
|
*/
|
|
113
124
|
get segments(): string[];
|
|
114
125
|
get endsWithDot(): boolean;
|
|
126
|
+
get isNestedSearch(): boolean;
|
|
115
127
|
get isActive(): boolean;
|
|
128
|
+
get isSearchTextDebouncing(): boolean;
|
|
129
|
+
get shouldShowSuggestions(): boolean;
|
|
130
|
+
get suggestionItems(): SearchSuggestion[];
|
|
131
|
+
get selectedSuggestion(): SearchSuggestion | null;
|
|
116
132
|
/**
|
|
117
|
-
* Суффикс
|
|
133
|
+
* Суффикс выбранного свойства, которое начинается с последнего сегмента.
|
|
118
134
|
* Отображается как серая подсказка в инпуте.
|
|
119
135
|
* Например: ввод "_pay" → suggestionSuffix = "load" (от "_payload")
|
|
120
136
|
*/
|
|
121
137
|
get suggestionSuffix(): string;
|
|
138
|
+
applySuggestion: (suggestion: SearchSuggestion) => void;
|
|
122
139
|
handleSearchInput: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
140
|
+
handleSearchInputFocus: (_e: FocusEvent<HTMLInputElement>) => void;
|
|
141
|
+
handleSearchInputBlur: (_e: FocusEvent<HTMLInputElement>) => void;
|
|
123
142
|
handleKeyDown: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
143
|
+
private clearSearchDebounce;
|
|
144
|
+
private scheduleSearchTextDebounce;
|
|
124
145
|
private scheduleScrollToFirstSearchMatch;
|
|
125
146
|
private scrollToFirstSearchMatch;
|
|
126
147
|
private scrollSimpleBarToOffset;
|
|
@@ -133,12 +154,16 @@ declare class SearchEngine {
|
|
|
133
154
|
* pathSegments — все сегменты кроме последнего (путь навигации).
|
|
134
155
|
*/
|
|
135
156
|
private getCandidatePropsAtDepth;
|
|
157
|
+
private getOwnerMatchedPathCandidates;
|
|
158
|
+
private getPropertyPathCandidates;
|
|
159
|
+
private getDirectPropertyChildren;
|
|
136
160
|
/**
|
|
137
161
|
* Уже введённый path-сегмент должен совпадать строго:
|
|
138
162
|
* `product.` заходит только в `product`, а не в `productAsyncTasks`
|
|
139
163
|
* или `serviceAndProductSearch`.
|
|
140
164
|
*/
|
|
141
165
|
private getPathMatchingProps;
|
|
166
|
+
private getOwnerVMName;
|
|
142
167
|
/**
|
|
143
168
|
* Навигация вглубь по цепочке свойств.
|
|
144
169
|
* Возвращает свойства на нужной глубине.
|
|
@@ -151,6 +176,7 @@ declare class SearchEngine {
|
|
|
151
176
|
private getFlatListItems;
|
|
152
177
|
getListItems(rootItems: ListItem<any>[]): ListItem<any>[];
|
|
153
178
|
private getFilteredItemsForSearch;
|
|
179
|
+
private getExtraSearchItems;
|
|
154
180
|
private getVMSearchItems;
|
|
155
181
|
/**
|
|
156
182
|
* Рекурсивно строит плоский список PropertyListItem для отображения.
|