@clickview/library-editor 1.1.2 → 1.1.3-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js.map +1 -1
- package/dist/cv-app-dev.js +104026 -0
- package/dist/cv-app-dev.js.map +1 -0
- package/dist/cv-svg-dev.js +1449 -0
- package/dist/cv-svg-dev.js.map +1 -0
- package/dist/library-editor-app.css.map +1 -1
- package/dist/src/apps/search/components/index.d.ts +2 -0
- package/dist/src/apps/search/components/instant-search/index.d.ts +4 -0
- package/dist/src/apps/search/components/instant-search/recent-search/RecentSearchResultComponent.d.ts +15 -0
- package/dist/src/apps/search/components/instant-search/series/SeriesSearchResultComponent.d.ts +9 -0
- package/dist/src/apps/search/components/instant-search/tag/TagSearchResultComponent.d.ts +9 -0
- package/dist/src/apps/search/components/instant-search/video-result/VideoSearchResultComponent.d.ts +15 -0
- package/dist/src/apps/search/components/search-context/SearchContextComponent.d.ts +18 -0
- package/dist/src/apps/search/components/search-tips/SearchTipsComponent.d.ts +11 -0
- package/dist/src/apps/search/services/ContextualSearchService.d.ts +37 -0
- package/dist/src/apps/search/views/search-bar/SearchBarView.d.ts +102 -0
- package/dist/src/apps/search/views/search-bar/templates/index.d.ts +9 -0
- package/dist/src/shared/behaviors/popover/PopoverBehavior.d.ts +40 -0
- package/dist/src/shared/behaviors/tooltip/TooltipBehavior.d.ts +12 -0
- package/dist/src/shared/components/thumbnail/ThumbnailComponent.d.ts +32 -0
- package/dist/src/shared/interfaces/Tooltip.d.ts +6 -0
- package/dist/src/shared/services/ContextService.d.ts +38 -0
- package/dist/src/shared/services/LanguageService.d.ts +16 -0
- package/dist/src/shared/utils/MaskHelper.d.ts +15 -0
- package/dist/src/shared/utils/search/InstantSearchHelper.d.ts +21 -0
- package/dist/src/shared/utils/search/RecentSearchHelper.d.ts +12 -0
- package/dist/src/shared/utils/search/SearchTypes.d.ts +28 -0
- package/dist/src/shared/utils/search/TypeaheadHelper.d.ts +76 -0
- package/dist/src/shared/utils/search/raw-search-components/confirm-selection/ConfirmSelectionComponent.d.ts +12 -0
- package/package.json +103 -103
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ObjectHash } from 'backbone';
|
|
2
|
+
import { Core } from '@clickview/common';
|
|
3
|
+
export declare class SearchContextComponent extends Core.Component {
|
|
4
|
+
initialize(): void;
|
|
5
|
+
get name(): string;
|
|
6
|
+
get template(): string;
|
|
7
|
+
get tagName(): string;
|
|
8
|
+
get className(): string;
|
|
9
|
+
get behaviors(): any[];
|
|
10
|
+
get elements(): ObjectHash;
|
|
11
|
+
events(): ObjectHash;
|
|
12
|
+
private onClick;
|
|
13
|
+
private onMouseEnter;
|
|
14
|
+
private onMouseLeave;
|
|
15
|
+
private toggleFocus;
|
|
16
|
+
viewOptions(): ObjectHash;
|
|
17
|
+
onBeforeRender(): boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ObjectHash } from 'backbone';
|
|
2
|
+
import { Core } from '@clickview/common';
|
|
3
|
+
export declare class SearchTipsComponent extends Core.Component {
|
|
4
|
+
initialize(): void;
|
|
5
|
+
get name(): string;
|
|
6
|
+
get template(): string;
|
|
7
|
+
get lang(): string;
|
|
8
|
+
get behaviors(): any[];
|
|
9
|
+
private renderTips;
|
|
10
|
+
viewOptions(): ObjectHash;
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Core } from '@clickview/common';
|
|
2
|
+
export interface SearchContext {
|
|
3
|
+
appLink: Core.AppLink;
|
|
4
|
+
searchTag: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
filterParam: string;
|
|
7
|
+
filterValue?: string;
|
|
8
|
+
setFilterValue: (context: SearchContext, self: any) => void;
|
|
9
|
+
}
|
|
10
|
+
declare class StaticContextualSearchService extends Core.Service {
|
|
11
|
+
private static instance;
|
|
12
|
+
private searchContext;
|
|
13
|
+
static get Instance(): StaticContextualSearchService;
|
|
14
|
+
initialize(): void;
|
|
15
|
+
get name(): string;
|
|
16
|
+
get lang(): string;
|
|
17
|
+
getSearchContext(): Core.Model;
|
|
18
|
+
/**
|
|
19
|
+
* Event listeners
|
|
20
|
+
*/
|
|
21
|
+
private onRouteChange;
|
|
22
|
+
private onTypeaheadToggle;
|
|
23
|
+
/**
|
|
24
|
+
* Context mutation methods
|
|
25
|
+
*/
|
|
26
|
+
private setSearchContext;
|
|
27
|
+
private updateSearchContext;
|
|
28
|
+
private setFilterValue;
|
|
29
|
+
private resetSearchContext;
|
|
30
|
+
/**
|
|
31
|
+
* Validation methods
|
|
32
|
+
*/
|
|
33
|
+
private isValidSearchContext;
|
|
34
|
+
private inSearchView;
|
|
35
|
+
}
|
|
36
|
+
export declare const ContextualSearchService: StaticContextualSearchService;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ObjectHash } from 'backbone';
|
|
2
|
+
import { Core } from '@clickview/common';
|
|
3
|
+
export interface SearchBarViewOptions extends Core.ViewOptions {
|
|
4
|
+
showRecentSearch?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class SearchBarView extends Core.View {
|
|
7
|
+
protected options: SearchBarViewOptions;
|
|
8
|
+
private currentUser;
|
|
9
|
+
private libraryCollection;
|
|
10
|
+
private storageHelper;
|
|
11
|
+
private recentSearchEngine;
|
|
12
|
+
private viewCache;
|
|
13
|
+
private searchInput;
|
|
14
|
+
private searchContext;
|
|
15
|
+
private preventToggleEvent;
|
|
16
|
+
constructor(options: SearchBarViewOptions);
|
|
17
|
+
initialize(): void;
|
|
18
|
+
get name(): string;
|
|
19
|
+
get title(): boolean;
|
|
20
|
+
get tagName(): string;
|
|
21
|
+
get template(): any;
|
|
22
|
+
get lang(): string;
|
|
23
|
+
get channelName(): string;
|
|
24
|
+
get className(): string;
|
|
25
|
+
get defaults(): ObjectHash;
|
|
26
|
+
get elements(): ObjectHash;
|
|
27
|
+
events(): ObjectHash;
|
|
28
|
+
get bindings(): ObjectHash;
|
|
29
|
+
regions(): ObjectHash;
|
|
30
|
+
private get recentSearchKey();
|
|
31
|
+
private bindListeners;
|
|
32
|
+
/**
|
|
33
|
+
* View Cache management
|
|
34
|
+
*/
|
|
35
|
+
private getOrCacheView;
|
|
36
|
+
private clearViewCache;
|
|
37
|
+
private getDynamicTemplate;
|
|
38
|
+
private getLimits;
|
|
39
|
+
/**
|
|
40
|
+
* Recent search logic
|
|
41
|
+
*/
|
|
42
|
+
private updateSearchHistory;
|
|
43
|
+
private handleRecentSearch;
|
|
44
|
+
private onDeleteRecentSearch;
|
|
45
|
+
private getInstantSearchAppLink;
|
|
46
|
+
/**
|
|
47
|
+
* Typeahead event handlers
|
|
48
|
+
*/
|
|
49
|
+
private onTypeaheadSelect;
|
|
50
|
+
private onClickSearch;
|
|
51
|
+
private onSubmit;
|
|
52
|
+
private submitQuery;
|
|
53
|
+
private resetQuery;
|
|
54
|
+
private updateInitialQuery;
|
|
55
|
+
private logSearch;
|
|
56
|
+
/**
|
|
57
|
+
* When the user clicks away from the typeahead, the close event will be fired, unbinding the delete
|
|
58
|
+
* event for recent search. Re-selecting the typehead will open it BUT it won't re-fetch the results and
|
|
59
|
+
* render event won't be fired. We need to manually re-bind the click handlers to ensure the delete
|
|
60
|
+
* functionality is retained.
|
|
61
|
+
*/
|
|
62
|
+
private onTypeaheadOpen;
|
|
63
|
+
private onBeforeTypeaheadClose;
|
|
64
|
+
private onTypeaheadClose;
|
|
65
|
+
private showMask;
|
|
66
|
+
private hideMask;
|
|
67
|
+
private alignTypeahead;
|
|
68
|
+
private onTypeaheadRender;
|
|
69
|
+
private initTypeaheadListeners;
|
|
70
|
+
private initNoLibrariesTypeaheadListeners;
|
|
71
|
+
private onKeydown;
|
|
72
|
+
private onResetSearchContext;
|
|
73
|
+
/**
|
|
74
|
+
* Bloodhound & Typeadhead configs
|
|
75
|
+
*/
|
|
76
|
+
private getRecentSearchBloodhound;
|
|
77
|
+
private getDynamicBloodhoundConfig;
|
|
78
|
+
private getDynamicTypeaheadConfig;
|
|
79
|
+
private getDynamicOptions;
|
|
80
|
+
/**
|
|
81
|
+
* Typeahead sources
|
|
82
|
+
*/
|
|
83
|
+
private getRecentSearchSources;
|
|
84
|
+
private getDirectSearchSources;
|
|
85
|
+
private getDynamicSearchSources;
|
|
86
|
+
private getSources;
|
|
87
|
+
private getNoLibrariesSource;
|
|
88
|
+
private initializeTypeahead;
|
|
89
|
+
private hasLibraries;
|
|
90
|
+
private getLibraryIds;
|
|
91
|
+
/**
|
|
92
|
+
* Render methods
|
|
93
|
+
*/
|
|
94
|
+
viewOptions(): ObjectHash;
|
|
95
|
+
get requiredResources(): Core.RequiredResourceHash;
|
|
96
|
+
private renderSearchTips;
|
|
97
|
+
private renderSearch;
|
|
98
|
+
private renderPartialSearch;
|
|
99
|
+
private renderSearchContext;
|
|
100
|
+
onRender(): void;
|
|
101
|
+
onClose(): void;
|
|
102
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import FolderResult from './FolderResult.hbs';
|
|
2
|
+
import DirectSearchResult from './DirectSearchResult.hbs';
|
|
3
|
+
import Loading from './Loading.hbs';
|
|
4
|
+
import NotFound from './NotFound.hbs';
|
|
5
|
+
import ResultFooter from './ResultFooter.hbs';
|
|
6
|
+
import ResultHeader from './ResultHeader.hbs';
|
|
7
|
+
import RecentSearchHeader from './RecentSearchHeader.hbs';
|
|
8
|
+
import NoLibraries from './NoLibraries.hbs';
|
|
9
|
+
export { FolderResult, DirectSearchResult, Loading, NotFound, ResultFooter, ResultHeader, RecentSearchHeader, NoLibraries };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ObjectHash } from 'backbone';
|
|
2
|
+
import { Core } from '@clickview/common';
|
|
3
|
+
export declare enum PopoverPlacement {
|
|
4
|
+
auto = "auto",
|
|
5
|
+
top = "top",
|
|
6
|
+
bottom = "bottom",
|
|
7
|
+
left = "left",
|
|
8
|
+
right = "right"
|
|
9
|
+
}
|
|
10
|
+
export declare type PopoverSize = 'popover-sm' | 'popover-md' | 'popover-lg';
|
|
11
|
+
export interface PopoverBehaviorOptions {
|
|
12
|
+
toggleEventName?: string;
|
|
13
|
+
renderContent: (region: string) => void;
|
|
14
|
+
placement?: PopoverPlacement;
|
|
15
|
+
title?: string;
|
|
16
|
+
containerSelector?: string;
|
|
17
|
+
size?: PopoverSize;
|
|
18
|
+
boundary?: any;
|
|
19
|
+
customClasses?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class PopoverBehavior extends Core.Behavior {
|
|
22
|
+
options: PopoverBehaviorOptions;
|
|
23
|
+
private popoverInitialized;
|
|
24
|
+
get defaults(): ObjectHash;
|
|
25
|
+
set defaults(defaults: ObjectHash);
|
|
26
|
+
get ui(): ObjectHash;
|
|
27
|
+
set ui(ui: ObjectHash);
|
|
28
|
+
events(): ObjectHash;
|
|
29
|
+
private bindListeners;
|
|
30
|
+
private bindBodyClickListener;
|
|
31
|
+
private bindDropdownListener;
|
|
32
|
+
private onPopoverInserted;
|
|
33
|
+
private onPopoverHidden;
|
|
34
|
+
private toggle;
|
|
35
|
+
private hide;
|
|
36
|
+
private onClickPopover;
|
|
37
|
+
private onClickOutside;
|
|
38
|
+
private getTrigger;
|
|
39
|
+
private onAttach;
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ObjectHash } from 'backbone';
|
|
2
|
+
import { Core } from '@clickview/common';
|
|
3
|
+
export declare class TooltipBehavior extends Core.Behavior {
|
|
4
|
+
get defaults(): ObjectHash;
|
|
5
|
+
set defaults(defaults: ObjectHash);
|
|
6
|
+
get ui(): ObjectHash;
|
|
7
|
+
set ui(ui: ObjectHash);
|
|
8
|
+
private getElement;
|
|
9
|
+
private getOptions;
|
|
10
|
+
onRender(): void;
|
|
11
|
+
onBeforeDetach(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ObjectHash } from 'backbone';
|
|
2
|
+
import { Core } from '@clickview/common';
|
|
3
|
+
import { Video } from "../../models";
|
|
4
|
+
import { ImageOptions } from "../../utils";
|
|
5
|
+
export interface ThumbnailComponentOptions extends Core.ComponentOptions {
|
|
6
|
+
model: Video;
|
|
7
|
+
onClickHandler?: Function;
|
|
8
|
+
thumbnailOptions?: ImageOptions;
|
|
9
|
+
playIcon?: boolean;
|
|
10
|
+
lazyload?: boolean;
|
|
11
|
+
appLink?: Core.AppLink;
|
|
12
|
+
href?: string;
|
|
13
|
+
channelName?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class ThumbnailComponent extends Core.Component<Video> {
|
|
16
|
+
protected options: ThumbnailComponentOptions;
|
|
17
|
+
constructor(options: ThumbnailComponentOptions);
|
|
18
|
+
initialize(): void;
|
|
19
|
+
get name(): string;
|
|
20
|
+
get template(): string;
|
|
21
|
+
get tagName(): string;
|
|
22
|
+
get className(): string;
|
|
23
|
+
get elements(): ObjectHash;
|
|
24
|
+
events(): ObjectHash;
|
|
25
|
+
get appLinks(): Core.AppLinkHash;
|
|
26
|
+
get attributes(): ObjectHash;
|
|
27
|
+
private showPlayIcon;
|
|
28
|
+
private onClick;
|
|
29
|
+
private onImageLoad;
|
|
30
|
+
viewOptions(): ObjectHash;
|
|
31
|
+
onRender(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Core } from '@clickview/common';
|
|
2
|
+
interface ApplicationContext {
|
|
3
|
+
pageLoad: boolean;
|
|
4
|
+
appLink: Core.AppLink;
|
|
5
|
+
}
|
|
6
|
+
export interface AppContextServiceOptions {
|
|
7
|
+
}
|
|
8
|
+
export declare class StaticContextService extends Core.Service {
|
|
9
|
+
private static instance;
|
|
10
|
+
private routeHistory;
|
|
11
|
+
private contextHistory;
|
|
12
|
+
get name(): string;
|
|
13
|
+
static get Instance(): StaticContextService;
|
|
14
|
+
initialize(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Context specific methods.
|
|
17
|
+
* The Context History keeps track of ALL APPLINKS.
|
|
18
|
+
*/
|
|
19
|
+
private setContext;
|
|
20
|
+
getCurrentContext(): ApplicationContext;
|
|
21
|
+
getPreviousContext(): ApplicationContext;
|
|
22
|
+
/**
|
|
23
|
+
* Route specific methods.
|
|
24
|
+
* The Route History works the same way as the Context History, except
|
|
25
|
+
* it will ONLY take applinks that change the route. This is useful
|
|
26
|
+
* for things like tracking state for in-application back buttons where we
|
|
27
|
+
* would not be interested in applinks that do not map to routes.
|
|
28
|
+
*/
|
|
29
|
+
private updateRouteHistory;
|
|
30
|
+
getCurrentRoute(): ApplicationContext;
|
|
31
|
+
getPreviousRoute(): ApplicationContext;
|
|
32
|
+
/**
|
|
33
|
+
* Other utilities
|
|
34
|
+
*/
|
|
35
|
+
fromPageLoad(): boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare const ContextService: StaticContextService;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Core } from '@clickview/common';
|
|
2
|
+
import { LanguageConfig } from "../models/LanguageConfig";
|
|
3
|
+
interface LanguageInterpolationOptions {
|
|
4
|
+
smartCount?: number;
|
|
5
|
+
[propName: string]: any;
|
|
6
|
+
}
|
|
7
|
+
declare class StaticLanguageService extends Core.Service {
|
|
8
|
+
private static instance;
|
|
9
|
+
private polyglot;
|
|
10
|
+
static get Instance(): StaticLanguageService;
|
|
11
|
+
get name(): string;
|
|
12
|
+
setConfig(config: LanguageConfig): void;
|
|
13
|
+
getPhrase(namespace: string, phraseKey: string, options?: LanguageInterpolationOptions): string;
|
|
14
|
+
}
|
|
15
|
+
export declare const LanguageService: StaticLanguageService;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="jquery" />
|
|
2
|
+
/// <reference types="jqueryui" />
|
|
3
|
+
/// <reference types="typeahead" />
|
|
4
|
+
/// <reference types="bootstrap" />
|
|
5
|
+
/// <reference types="dropzone" />
|
|
6
|
+
export interface MaskHelperOptions {
|
|
7
|
+
targetSelector?: string;
|
|
8
|
+
additionalClasses?: string;
|
|
9
|
+
fade?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const MaskHelper: {
|
|
12
|
+
showMask(options?: MaskHelperOptions): JQuery<HTMLElement>;
|
|
13
|
+
hideMask(maskEl?: JQuery<HTMLElement>): void;
|
|
14
|
+
getTarget(targetSelector?: string): JQuery<HTMLElement>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="jquery" />
|
|
2
|
+
import { ObjectHash } from 'backbone';
|
|
3
|
+
import { RemoteSearch } from "./";
|
|
4
|
+
/**
|
|
5
|
+
* Specific logic for processing responses from domain v1/search/instant endpoint
|
|
6
|
+
*/
|
|
7
|
+
export declare const InstantSearchHelper: {
|
|
8
|
+
prepareQuery: (query: string, settings: JQueryAjaxSettings, options?: ObjectHash) => string;
|
|
9
|
+
bloodhoundConfig(source: string, options: ObjectHash): RemoteSearch<any>;
|
|
10
|
+
handleResult(data: ObjectHash, item: any, options?: ObjectHash): any[];
|
|
11
|
+
processVideoResult(collection: any[], item: any, options: ObjectHash): any[];
|
|
12
|
+
processTagsResult(collection: any[], item: any, options: ObjectHash): any[];
|
|
13
|
+
processSeriesResult(collection: any[], item: any, options: ObjectHash): any[];
|
|
14
|
+
processFolderResult(collection: any[], item: any, options?: ObjectHash): any[];
|
|
15
|
+
/**
|
|
16
|
+
* Manipulate
|
|
17
|
+
* @param collection
|
|
18
|
+
* @param options
|
|
19
|
+
*/
|
|
20
|
+
processCollection(collection: any[], options?: ObjectHash): any[];
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StorageHelper } from '@clickview/common';
|
|
2
|
+
export interface UpdateRecentSearchOptions<T> {
|
|
3
|
+
query: T;
|
|
4
|
+
add?: boolean;
|
|
5
|
+
remove?: boolean;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const RecentSearchHelper: {
|
|
9
|
+
getRecentSearches<T>(key: string, dataSource: StorageHelper): T[];
|
|
10
|
+
setRecentSearches<T_1>(key: string, recentSearches: T_1[], dataSource: StorageHelper): void;
|
|
11
|
+
updateRecentSearches<T_2>(key: string, dataSource: StorageHelper, options: UpdateRecentSearchOptions<T_2>): T_2[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="typeahead" />
|
|
2
|
+
import { ObjectHash } from 'backbone';
|
|
3
|
+
import { Series, Folder, Video, Channel, Producer, Distributor } from "../../models";
|
|
4
|
+
export declare type InstantSearch = Series | Folder | Video | Channel | Producer | Distributor;
|
|
5
|
+
export interface RemoteSearch<T> extends Bloodhound.BloodhoundOptions<T> {
|
|
6
|
+
remote: Bloodhound.RemoteOptions<T>;
|
|
7
|
+
}
|
|
8
|
+
export interface LocalSearch<T> extends Bloodhound.BloodhoundOptions<T> {
|
|
9
|
+
local: T[] | (() => T[]);
|
|
10
|
+
}
|
|
11
|
+
export declare type TypeaheadDataSource<T> = Bloodhound<T> | ((query: string, syncResults: (result: T[]) => void, asyncResults?: (result: T[]) => void) => void);
|
|
12
|
+
export interface InstantSearchBloodhound<T> {
|
|
13
|
+
bloodhound: TypeaheadDataSource<T>;
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
export declare type TypeaheadConfig<T> = Twitter.Typeahead.Dataset<T>;
|
|
17
|
+
export interface TypeaheadConfigHandler<T> {
|
|
18
|
+
(source?: InstantSearchBloodhound<T>, index?: number, options?: ObjectHash): Twitter.Typeahead.Dataset<T>;
|
|
19
|
+
}
|
|
20
|
+
export interface BloodhoundConfigHandler<T> {
|
|
21
|
+
(source: string, options?: ObjectHash): LocalSearch<T> | RemoteSearch<T>;
|
|
22
|
+
}
|
|
23
|
+
export interface TypeaheadSourceItem<T> {
|
|
24
|
+
name: string;
|
|
25
|
+
typeaheadConfig: TypeaheadConfigHandler<T>;
|
|
26
|
+
bloodhoundConfig?: BloodhoundConfigHandler<T>;
|
|
27
|
+
options?: ObjectHash;
|
|
28
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/// <reference types="typeahead" />
|
|
2
|
+
/// <reference types="jquery" />
|
|
3
|
+
import { ObjectHash } from 'backbone';
|
|
4
|
+
import * as Bloodhound from 'bloodhound';
|
|
5
|
+
import { TypeaheadDataSource, LocalSearch, RemoteSearch, TypeaheadConfig } from "./";
|
|
6
|
+
import { TypeaheadSourceItem } from "./SearchTypes";
|
|
7
|
+
export declare const TypeaheadHelper: {
|
|
8
|
+
/**
|
|
9
|
+
* This function will only allow our typeahead to fetch results when we
|
|
10
|
+
* have exceeded our min length. The reason for doing this is that we want to the typeahead
|
|
11
|
+
* to load our recent searches immediately when we click the input, but before we perform any searches. - Mike
|
|
12
|
+
*/
|
|
13
|
+
handleQuery<T>(dataSource?: TypeaheadDataSource<T>, options?: ObjectHash): TypeaheadDataSource<T>;
|
|
14
|
+
/**
|
|
15
|
+
* This function complements HandleQuery allowing us to override when and how typeahead templates are
|
|
16
|
+
* rendered. When the query doesn't meet our min length we will render a fallback template, which is
|
|
17
|
+
* essentially just an empty div. This is necessary to ensure we can display recent searchs when the
|
|
18
|
+
* typeahead is active (but less than the require length to trigger the search functionality). As we are
|
|
19
|
+
* dynamically generating the results for videos, folders and series we are deliberately using a closure
|
|
20
|
+
* to ensure we don't lose our template.
|
|
21
|
+
*
|
|
22
|
+
* It must also return <any> as the typeahead typings are shit.
|
|
23
|
+
* - Mike
|
|
24
|
+
*/
|
|
25
|
+
getTemplate(template: Function, options?: ObjectHash): any;
|
|
26
|
+
/**
|
|
27
|
+
* Provides mechanism to map a single search query against multiple bloodhound sources.
|
|
28
|
+
* Sources may be remote endpoints or local in-memory collections.
|
|
29
|
+
* @param sources
|
|
30
|
+
* @param options
|
|
31
|
+
*/
|
|
32
|
+
getSearchSources<T_1>(sources: TypeaheadSourceItem<T_1>[]): TypeaheadConfig<T_1>[];
|
|
33
|
+
/**
|
|
34
|
+
* Bloodhound helper
|
|
35
|
+
*/
|
|
36
|
+
buildBloodhound<T_2>(options: RemoteSearch<T_2> | LocalSearch<T_2>): Bloodhound<T_2>;
|
|
37
|
+
/**
|
|
38
|
+
* This is attached as a callback to the typeahead's render event.
|
|
39
|
+
* Where there is a real suggestion from the server, we will automatically
|
|
40
|
+
* set the cursor to that item, to make it simply to add. This is to encourage the
|
|
41
|
+
* re-use of existing entities.
|
|
42
|
+
*
|
|
43
|
+
* Note: With multiple suggestion sets, the render event will also be called multiple times
|
|
44
|
+
* along with this callback.
|
|
45
|
+
*/
|
|
46
|
+
selectFirstResult(e: JQueryEventObject, suggestions: any[], async: boolean, dataset: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Callback is designed to be attached to the stickit bindings for the typeahead form
|
|
49
|
+
* and emit events when a change is detected on the bound model. We do this to be
|
|
50
|
+
* able to detect whether an input has cleared from a previous selection,
|
|
51
|
+
*
|
|
52
|
+
* @param channelName
|
|
53
|
+
* @param event
|
|
54
|
+
*/
|
|
55
|
+
emitEventOnInput(channelName: string, eventName: string, type: string, wrapperOptions?: ObjectHash): Function;
|
|
56
|
+
/**
|
|
57
|
+
* I hate this.
|
|
58
|
+
*
|
|
59
|
+
* Basically what this function does is curry a callback with the original association's
|
|
60
|
+
* data. Then, depending on the user's interaction with the typeahead input, it will restore that
|
|
61
|
+
* data when a blur event is triggered.
|
|
62
|
+
*
|
|
63
|
+
* @param data raw clone of original assoc model
|
|
64
|
+
*
|
|
65
|
+
* Curried callback
|
|
66
|
+
* @param channelName
|
|
67
|
+
* @param propertyName
|
|
68
|
+
*/
|
|
69
|
+
resetAssociationOnBlur(data: ObjectHash): Function;
|
|
70
|
+
/**
|
|
71
|
+
* Create and render ConfirmSelection component for use as a
|
|
72
|
+
* @param options
|
|
73
|
+
*/
|
|
74
|
+
getConfirmSelectionTemplate(options?: ObjectHash): Function;
|
|
75
|
+
clearInputOnBlur(channelName: string): void;
|
|
76
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ObjectHash } from 'backbone';
|
|
2
|
+
import { Core } from '@clickview/common';
|
|
3
|
+
interface ConfirmSelectionComponentOptions extends Core.ComponentOptions {
|
|
4
|
+
}
|
|
5
|
+
export declare class ConfirmSelectionComponent extends Core.Component {
|
|
6
|
+
constructor(options: ConfirmSelectionComponentOptions);
|
|
7
|
+
get name(): string;
|
|
8
|
+
get template(): string;
|
|
9
|
+
get className(): string;
|
|
10
|
+
viewOptions(): ObjectHash;
|
|
11
|
+
}
|
|
12
|
+
export {};
|