fomantic-ui 2.9.3-beta.9 → 2.9.3
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/.all-contributorsrc +2 -2
- package/.github/FUNDING.yml +1 -1
- package/.github/auto_assign.yml +1 -1
- package/.github/workflows/ci.yml +5 -5
- package/.github/workflows/nightly.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/CHANGELOG.md +131 -0
- package/CONTRIBUTORS.md +1 -1
- package/README.md +5 -2
- package/SECURITY.md +2 -1
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +2 -2
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +10 -9
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +2 -2
- package/dist/components/button.min.css +2 -2
- package/dist/components/calendar.css +140 -3
- package/dist/components/calendar.js +2 -2
- package/dist/components/calendar.min.css +2 -2
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +50 -6
- package/dist/components/checkbox.js +5 -3
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +6 -1
- package/dist/components/comment.min.css +2 -2
- package/dist/components/container.css +62 -1
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +3 -3
- package/dist/components/dimmer.js +2 -2
- package/dist/components/dimmer.min.css +2 -2
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +101 -25
- package/dist/components/dropdown.js +29 -21
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +2 -2
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +697 -249
- package/dist/components/emoji.min.css +2 -2
- package/dist/components/feed.css +486 -5
- package/dist/components/feed.min.css +2 -2
- package/dist/components/flag.css +3 -2
- package/dist/components/flag.min.css +2 -2
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +2 -33
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +34 -32
- package/dist/components/form.js +72 -31
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +107 -107
- package/dist/components/grid.min.css +2 -2
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +62 -62
- package/dist/components/icon.min.css +2 -2
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +3 -27
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +6 -1
- package/dist/components/item.min.css +2 -2
- package/dist/components/label.css +21 -2
- package/dist/components/label.min.css +2 -2
- package/dist/components/list.css +13 -13
- package/dist/components/list.min.css +2 -2
- package/dist/components/loader.css +282 -282
- package/dist/components/loader.min.css +2 -2
- package/dist/components/menu.css +13 -7
- package/dist/components/menu.min.css +2 -2
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +5 -1
- package/dist/components/modal.js +3 -3
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +3 -3
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +3 -3
- package/dist/components/popup.js +11 -9
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +2 -2
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +2 -2
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +26 -1
- package/dist/components/search.js +5 -4
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +159 -33
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +2 -2
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +2 -32
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +2 -2
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +126 -26
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +2 -2
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +2 -2
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +6 -4
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +65 -1
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +6 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toast.min.css +2 -2
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +3 -3
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +2 -2
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +2822 -954
- package/dist/semantic.js +302 -206
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +5 -4
- package/scripts/nightly-version.js +2 -2
- package/src/definitions/behaviors/api.js +9 -8
- package/src/definitions/behaviors/form.js +71 -30
- package/src/definitions/behaviors/state.js +1 -1
- package/src/definitions/behaviors/visibility.js +1 -1
- package/src/definitions/collections/form.less +9 -14
- package/src/definitions/collections/grid.less +106 -106
- package/src/definitions/collections/menu.less +29 -22
- package/src/definitions/collections/table.less +66 -0
- package/src/definitions/elements/button.less +1 -1
- package/src/definitions/elements/container.less +63 -0
- package/src/definitions/elements/icon.less +5 -5
- package/src/definitions/elements/input.less +2 -2
- package/src/definitions/elements/label.less +21 -1
- package/src/definitions/elements/list.less +13 -13
- package/src/definitions/elements/loader.less +71 -71
- package/src/definitions/elements/segment.less +110 -13
- package/src/definitions/globals/site.js +1 -1
- package/src/definitions/modules/accordion.js +1 -1
- package/src/definitions/modules/calendar.js +1 -1
- package/src/definitions/modules/calendar.less +40 -11
- package/src/definitions/modules/checkbox.js +4 -2
- package/src/definitions/modules/checkbox.less +61 -5
- package/src/definitions/modules/dimmer.js +1 -1
- package/src/definitions/modules/dimmer.less +2 -2
- package/src/definitions/modules/dropdown.js +28 -20
- package/src/definitions/modules/dropdown.less +124 -21
- package/src/definitions/modules/embed.js +1 -1
- package/src/definitions/modules/flyout.js +1 -32
- package/src/definitions/modules/modal.js +2 -2
- package/src/definitions/modules/modal.less +6 -0
- package/src/definitions/modules/nag.js +2 -2
- package/src/definitions/modules/popup.js +10 -8
- package/src/definitions/modules/popup.less +4 -4
- package/src/definitions/modules/progress.js +1 -1
- package/src/definitions/modules/rating.js +1 -1
- package/src/definitions/modules/search.js +4 -3
- package/src/definitions/modules/search.less +31 -0
- package/src/definitions/modules/shape.js +1 -1
- package/src/definitions/modules/sidebar.js +1 -31
- package/src/definitions/modules/slider.js +125 -25
- package/src/definitions/modules/sticky.js +1 -1
- package/src/definitions/modules/tab.js +5 -3
- package/src/definitions/modules/toast.js +1 -1
- package/src/definitions/modules/toast.less +7 -0
- package/src/definitions/modules/transition.js +2 -2
- package/src/definitions/views/comment.less +7 -0
- package/src/definitions/views/feed.less +238 -32
- package/src/definitions/views/item.less +7 -0
- package/src/theme.less +1 -1
- package/src/themes/amazon/elements/button.variables +5 -1
- package/src/themes/bootstrap3/elements/button.variables +5 -1
- package/src/themes/chubby/elements/header.variables +6 -1
- package/src/themes/default/collections/message.variables +3 -9
- package/src/themes/default/collections/table.variables +11 -8
- package/src/themes/default/elements/button.variables +8 -10
- package/src/themes/default/elements/container.variables +3 -0
- package/src/themes/default/elements/emoji.variables +179 -67
- package/src/themes/default/elements/flag.variables +1 -1
- package/src/themes/default/elements/label.variables +6 -1
- package/src/themes/default/elements/segment.variables +8 -0
- package/src/themes/default/globals/site.variables +362 -341
- package/src/themes/default/globals/variation.variables +24 -1
- package/src/themes/default/modules/calendar.variables +11 -0
- package/src/themes/default/modules/checkbox.variables +12 -0
- package/src/themes/default/modules/dropdown.variables +10 -4
- package/src/themes/default/modules/modal.variables +3 -0
- package/src/themes/default/modules/popup.variables +1 -1
- package/src/themes/default/modules/search.variables +3 -0
- package/src/themes/default/modules/toast.variables +6 -5
- package/src/themes/default/views/card.variables +4 -12
- package/src/themes/default/views/feed.variables +55 -1
- package/src/themes/default/views/item.variables +5 -5
- package/src/themes/flat/collections/form.variables +4 -4
- package/src/themes/flat/globals/site.variables +1 -1
- package/src/themes/github/elements/button.variables +5 -1
- package/src/themes/joypixels/elements/emoji.variables +182 -70
- package/src/themes/material/globals/site.variables +1 -1
- package/src/themes/twitter/elements/button.variables +5 -1
- package/src/themes/twitter/elements/emoji.variables +178 -66
- package/tasks/admin/components/create.js +1 -2
- package/tasks/admin/components/init.js +3 -4
- package/tasks/admin/components/update.js +2 -3
- package/tasks/admin/distributions/create.js +9 -5
- package/tasks/admin/distributions/init.js +3 -4
- package/tasks/admin/distributions/update.js +2 -3
- package/tasks/config/project/install.js +3 -0
- package/tasks/config/tasks.js +1 -8
- package/tasks/config/user.js +1 -1
- package/tasks/docs/build.js +2 -2
- package/tasks/docs/metadata.js +1 -1
- package/tasks/docs/serve.js +1 -1
- package/tasks/install.js +19 -10
- package/tasks/watch.js +1 -2
- package/types/fomantic-ui-accordion.d.ts +244 -0
- package/types/fomantic-ui-api.d.ts +555 -0
- package/types/fomantic-ui-calendar.d.ts +766 -0
- package/types/fomantic-ui-checkbox.d.ts +332 -0
- package/types/fomantic-ui-dimmer.d.ts +408 -0
- package/types/fomantic-ui-dropdown.d.ts +1183 -0
- package/types/fomantic-ui-embed.d.ts +326 -0
- package/types/fomantic-ui-flyout.d.ts +525 -0
- package/types/fomantic-ui-form.d.ts +651 -0
- package/types/fomantic-ui-modal.d.ts +471 -0
- package/types/fomantic-ui-nag.d.ts +270 -0
- package/types/fomantic-ui-popup.d.ts +523 -0
- package/types/fomantic-ui-progress.d.ts +459 -0
- package/types/fomantic-ui-rating.d.ts +187 -0
- package/types/fomantic-ui-search.d.ts +496 -0
- package/types/fomantic-ui-shape.d.ts +274 -0
- package/types/fomantic-ui-sidebar.d.ts +402 -0
- package/types/fomantic-ui-slider.d.ts +316 -0
- package/types/fomantic-ui-sticky.d.ts +215 -0
- package/types/fomantic-ui-tab.d.ts +361 -0
- package/types/fomantic-ui-tests.ts +25 -0
- package/types/fomantic-ui-toast.d.ts +514 -0
- package/types/fomantic-ui-transition.d.ts +355 -0
- package/types/fomantic-ui-visibility.d.ts +355 -0
- package/types/index.d.ts +63 -0
- package/types/tsconfig.json +23 -0
- package/types/tslint.json +1 -0
@@ -0,0 +1,496 @@
|
|
1
|
+
declare namespace FomanticUI {
|
2
|
+
interface Search {
|
3
|
+
settings: SearchSettings;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Search for value currently set in search input.
|
7
|
+
*/
|
8
|
+
(behavior: 'query', callback: Function): JQuery;
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Displays message in search results with text, using template matching type.
|
12
|
+
*/
|
13
|
+
(behavior: 'display message', text: string, type: string): JQuery;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Cancels current remote search query.
|
17
|
+
*/
|
18
|
+
(behavior: 'cancel query'): JQuery;
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Search local object for specified query and display results.
|
22
|
+
*/
|
23
|
+
(behavior: 'search local', query: string): JQuery;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Whether has minimum characters.
|
27
|
+
*/
|
28
|
+
(behavior: 'has minimum characters'): boolean;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Search remote endpoint for specified query and display results.
|
32
|
+
*/
|
33
|
+
(behavior: 'search remote', query: string, callback: Function): JQuery;
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Search object for specified query and return results.
|
37
|
+
*/
|
38
|
+
(behavior: 'search object', query: string, object: string, searchFields: string): JQuery;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Whether search is currently focused.
|
42
|
+
*/
|
43
|
+
(behavior: 'is focused'): boolean;
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Whether search results are visible.
|
47
|
+
*/
|
48
|
+
(behavior: 'is visible'): boolean;
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Whether search results are empty.
|
52
|
+
*/
|
53
|
+
(behavior: 'is empty'): boolean;
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Returns current search value.
|
57
|
+
*/
|
58
|
+
(behavior: 'get value'): string;
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Returns JSON object matching searched title or id.
|
62
|
+
*/
|
63
|
+
(behavior: 'get result', value: string): object;
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Sets search input to value.
|
67
|
+
*/
|
68
|
+
(behavior: 'set value', value: string): JQuery;
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Reads cached results for query.
|
72
|
+
*/
|
73
|
+
(behavior: 'read cache', query: string): JQuery;
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Clears value from cache, if no parameter passed clears all cache.
|
77
|
+
*/
|
78
|
+
(behavior: 'clear cache', query: string): JQuery;
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Writes cached results for query.
|
82
|
+
*/
|
83
|
+
(behavior: 'write cache', query: string): JQuery;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Adds HTML to results and displays.
|
87
|
+
*/
|
88
|
+
(behavior: 'add results', html: string): JQuery;
|
89
|
+
|
90
|
+
/**
|
91
|
+
* Shows results container.
|
92
|
+
*/
|
93
|
+
(behavior: 'show results', callback: Function): JQuery;
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Hide results container.
|
97
|
+
*/
|
98
|
+
(behavior: 'hide results', callback: Function): JQuery;
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Generates results using parser specified by 'settings.template'.
|
102
|
+
*/
|
103
|
+
(behavior: 'generate results', response: Function): JQuery;
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Removes all events.
|
107
|
+
*/
|
108
|
+
(behavior: 'destroy'): JQuery;
|
109
|
+
|
110
|
+
<K extends keyof SearchSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<SearchSettings, keyof SearchSettings>>;
|
111
|
+
<K extends keyof SearchSettings>(behavior: 'setting', name: K, value: SearchSettings[K]): JQuery;
|
112
|
+
(behavior: 'setting', value: Partial<Pick<SearchSettings, keyof SearchSettings>>): JQuery;
|
113
|
+
(settings?: Partial<Pick<SearchSettings, keyof SearchSettings>>): JQuery;
|
114
|
+
}
|
115
|
+
|
116
|
+
/**
|
117
|
+
* @see {@link https://fomantic-ui.com/modules/search.html#/settings}
|
118
|
+
*/
|
119
|
+
interface SearchSettings {
|
120
|
+
// region Search Settings
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Settings for API call.
|
124
|
+
* @see {@link https://fomantic-ui.com/behaviors/api.html#/settings}
|
125
|
+
* @default {}
|
126
|
+
*/
|
127
|
+
apiSettings: APISettings | JQueryAjaxSettings;
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Minimum characters to query for results.
|
131
|
+
* @default 1
|
132
|
+
*/
|
133
|
+
minCharacters: number;
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Whether search should show results on focus (must also match min character length).
|
137
|
+
* @default true
|
138
|
+
*/
|
139
|
+
searchOnFocus: boolean;
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Named transition to use when animating menu in and out.
|
143
|
+
* Fade and slide down are available without including ui transitions.
|
144
|
+
* @see {@link https://fomantic-ui.com/modules/transition.html}
|
145
|
+
* @default 'fade'
|
146
|
+
*/
|
147
|
+
transition: string;
|
148
|
+
|
149
|
+
/**
|
150
|
+
* Duration of animation events.
|
151
|
+
* @default 300
|
152
|
+
*/
|
153
|
+
duration: number;
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Maximum results to display when using local and simple search, maximum category count for category search.
|
157
|
+
* @default 7
|
158
|
+
*/
|
159
|
+
maxResults: number;
|
160
|
+
|
161
|
+
/**
|
162
|
+
* Caches results locally to avoid requerying server.
|
163
|
+
* @default true
|
164
|
+
*/
|
165
|
+
cache: boolean;
|
166
|
+
|
167
|
+
/**
|
168
|
+
* Specify a Javascript object which will be searched locally.
|
169
|
+
* @default false
|
170
|
+
*/
|
171
|
+
source: boolean | object;
|
172
|
+
|
173
|
+
/**
|
174
|
+
* Whether the search should automatically select the first search result after searching.
|
175
|
+
* @default false
|
176
|
+
*/
|
177
|
+
selectFirstResult: boolean;
|
178
|
+
|
179
|
+
/**
|
180
|
+
* Whether a "no results" message should be shown if no results are found.
|
181
|
+
* @default false
|
182
|
+
*/
|
183
|
+
showNoResults: boolean;
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Specifying to "true" will use a fuzzy full text search, setting to "exact" will force the exact search to be matched somewhere in the string, setting to false will only match to start of string.
|
187
|
+
* @default 'exact'
|
188
|
+
*/
|
189
|
+
fullTextSearch: 'exact' | boolean;
|
190
|
+
|
191
|
+
/**
|
192
|
+
* List mapping display content to JSON property, either with API or 'source'.
|
193
|
+
* @default {}
|
194
|
+
*/
|
195
|
+
fields: object;
|
196
|
+
|
197
|
+
/**
|
198
|
+
* Specify object properties inside local source object which will be searched.
|
199
|
+
* @default ['title', 'description']
|
200
|
+
*/
|
201
|
+
searchFields: string[];
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Delay before hiding results after search blur.
|
205
|
+
* @default 0
|
206
|
+
*/
|
207
|
+
hideDelay: number;
|
208
|
+
|
209
|
+
/**
|
210
|
+
* Delay before querying results on inputchange.
|
211
|
+
* @default 100
|
212
|
+
*/
|
213
|
+
searchDelay: number;
|
214
|
+
|
215
|
+
/**
|
216
|
+
* Easing equation when using fallback Javascript animation.
|
217
|
+
* EaseOutExpo is included with search, for additional options you must include `easing equations`.
|
218
|
+
* @see {@link https://gsgd.co.uk/sandbox/jquery/easing/}
|
219
|
+
* @default 'easeOutExpo'
|
220
|
+
*/
|
221
|
+
easing: string;
|
222
|
+
|
223
|
+
/**
|
224
|
+
* When activated, searches will also match results for base diacritic letters.
|
225
|
+
* For example when searching for 'a', it will also match 'á' or 'â' or 'å' and so on...
|
226
|
+
* It will also ignore diacritics for the searchterm, so if searching for 'ó', it will match 'ó', but also 'o', 'ô' or 'õ' and so on...
|
227
|
+
* @default false
|
228
|
+
*/
|
229
|
+
ignoreDiacritics: boolean;
|
230
|
+
|
231
|
+
// endregion
|
232
|
+
|
233
|
+
// region Callbacks
|
234
|
+
|
235
|
+
/**
|
236
|
+
* Callback on element selection by user.
|
237
|
+
* The first parameter includes the filtered response results for that element.
|
238
|
+
* The function should return 'false' to prevent default action (closing search results and selecting value).
|
239
|
+
*/
|
240
|
+
onSelect(this: JQuery, result: object, response: object): boolean;
|
241
|
+
|
242
|
+
/**
|
243
|
+
* Callback after processing element template to add HTML to results.
|
244
|
+
* Function should return 'false' to prevent default actions.
|
245
|
+
*/
|
246
|
+
onResultsAdd(this: JQuery, html: string): boolean;
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Callback on search query.
|
250
|
+
*/
|
251
|
+
onSearchQuery(this: JQuery, query: string): void;
|
252
|
+
|
253
|
+
/**
|
254
|
+
* Callback on server response.
|
255
|
+
*/
|
256
|
+
onResults(this: JQuery, response: object): void;
|
257
|
+
|
258
|
+
/**
|
259
|
+
* Callback when results are opened.
|
260
|
+
*/
|
261
|
+
onResultsOpen(this: JQuery): void;
|
262
|
+
|
263
|
+
/**
|
264
|
+
* Callback when results are closed.
|
265
|
+
*/
|
266
|
+
onResultsClose(this: JQuery): void;
|
267
|
+
|
268
|
+
// endregion
|
269
|
+
|
270
|
+
// region Template Settings
|
271
|
+
|
272
|
+
templates: Search.TemplateSettings;
|
273
|
+
|
274
|
+
// endregion
|
275
|
+
|
276
|
+
// region DOM Settings
|
277
|
+
|
278
|
+
/**
|
279
|
+
* DOM Selectors used internally.
|
280
|
+
* Selectors used to find parts of a module.
|
281
|
+
*/
|
282
|
+
selector: Search.SelectorSettings;
|
283
|
+
|
284
|
+
/**
|
285
|
+
* Regular expressions used for matching.
|
286
|
+
*/
|
287
|
+
regExp: Search.RegExpSettings;
|
288
|
+
|
289
|
+
/**
|
290
|
+
* Class names used to determine element state.
|
291
|
+
*/
|
292
|
+
className: Search.ClassNameSettings;
|
293
|
+
|
294
|
+
/**
|
295
|
+
* HTML5 metadata attributes used internally.
|
296
|
+
*/
|
297
|
+
metadata: Search.MetadataSettings;
|
298
|
+
|
299
|
+
// endregion
|
300
|
+
|
301
|
+
// region Debug Settings
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Name used in log statements
|
305
|
+
* @default 'Search'
|
306
|
+
*/
|
307
|
+
name: string;
|
308
|
+
|
309
|
+
/**
|
310
|
+
* Event namespace. Makes sure module teardown does not effect other events attached to an element.
|
311
|
+
* @default 'search'
|
312
|
+
*/
|
313
|
+
namespace: string;
|
314
|
+
|
315
|
+
/**
|
316
|
+
* Silences all console output including error messages, regardless of other debug settings.
|
317
|
+
* @default false
|
318
|
+
*/
|
319
|
+
silent: boolean;
|
320
|
+
|
321
|
+
/**
|
322
|
+
* Debug output to console
|
323
|
+
* @default false
|
324
|
+
*/
|
325
|
+
debug: boolean;
|
326
|
+
|
327
|
+
/**
|
328
|
+
* Show console.table output with performance metrics
|
329
|
+
* @default true
|
330
|
+
*/
|
331
|
+
performance: boolean;
|
332
|
+
|
333
|
+
/**
|
334
|
+
* Debug output includes all internal behaviors
|
335
|
+
* @default false
|
336
|
+
*/
|
337
|
+
verbose: boolean;
|
338
|
+
|
339
|
+
error: Search.ErrorSettings;
|
340
|
+
|
341
|
+
// endregion
|
342
|
+
}
|
343
|
+
|
344
|
+
namespace Search {
|
345
|
+
type TemplateSettings = Partial<Pick<Settings.Templates, keyof Settings.Templates>>;
|
346
|
+
type SelectorSettings = Partial<Pick<Settings.Selectors, keyof Settings.Selectors>>;
|
347
|
+
type RegExpSettings = Partial<Pick<Settings.RegExps, keyof Settings.RegExps>>;
|
348
|
+
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
|
349
|
+
type MetadataSettings = Partial<Pick<Settings.Metadatas, keyof Settings.Metadatas>>;
|
350
|
+
type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
|
351
|
+
|
352
|
+
namespace Settings {
|
353
|
+
interface Templates {
|
354
|
+
/**
|
355
|
+
* @default function(string)
|
356
|
+
*/
|
357
|
+
escape: Function;
|
358
|
+
|
359
|
+
/**
|
360
|
+
* @default function(message, type)
|
361
|
+
*/
|
362
|
+
message: Function;
|
363
|
+
|
364
|
+
/**
|
365
|
+
* @default function(response)
|
366
|
+
*/
|
367
|
+
category: Function;
|
368
|
+
|
369
|
+
/**
|
370
|
+
* @default function(response)
|
371
|
+
*/
|
372
|
+
standard: Function;
|
373
|
+
}
|
374
|
+
|
375
|
+
interface Selectors {
|
376
|
+
/**
|
377
|
+
* @default '.prompt'
|
378
|
+
*/
|
379
|
+
prompt: string;
|
380
|
+
|
381
|
+
/**
|
382
|
+
* @default '.search.button'
|
383
|
+
*/
|
384
|
+
searchButton: string;
|
385
|
+
|
386
|
+
/**
|
387
|
+
* @default '.results'
|
388
|
+
*/
|
389
|
+
results: string;
|
390
|
+
|
391
|
+
/**
|
392
|
+
* @default '.category'
|
393
|
+
*/
|
394
|
+
category: string;
|
395
|
+
|
396
|
+
/**
|
397
|
+
* @default '.result'
|
398
|
+
*/
|
399
|
+
result: string;
|
400
|
+
}
|
401
|
+
|
402
|
+
interface RegExps {
|
403
|
+
/**
|
404
|
+
* @default /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g
|
405
|
+
*/
|
406
|
+
escape: RegExp;
|
407
|
+
|
408
|
+
/**
|
409
|
+
* @default '(?:\s|^)'
|
410
|
+
*/
|
411
|
+
beginsWith: RegExp;
|
412
|
+
}
|
413
|
+
|
414
|
+
interface ClassNames {
|
415
|
+
/**
|
416
|
+
* @default 'active'
|
417
|
+
*/
|
418
|
+
active: string;
|
419
|
+
|
420
|
+
/**
|
421
|
+
* @default 'empty'
|
422
|
+
*/
|
423
|
+
empty: string;
|
424
|
+
|
425
|
+
/**
|
426
|
+
* @default 'focus'
|
427
|
+
*/
|
428
|
+
focus: string;
|
429
|
+
|
430
|
+
/**
|
431
|
+
* @default 'loading'
|
432
|
+
*/
|
433
|
+
loading: string;
|
434
|
+
|
435
|
+
/**
|
436
|
+
* @default 'down'
|
437
|
+
*/
|
438
|
+
pressed: string;
|
439
|
+
}
|
440
|
+
|
441
|
+
interface Metadatas {
|
442
|
+
/**
|
443
|
+
* @default 'cache'
|
444
|
+
*/
|
445
|
+
cache: string;
|
446
|
+
|
447
|
+
/**
|
448
|
+
* @default 'results'
|
449
|
+
*/
|
450
|
+
results: string;
|
451
|
+
}
|
452
|
+
|
453
|
+
interface Errors {
|
454
|
+
/**
|
455
|
+
* @default 'Cannot search. No source used, and Fomantic API module was not included'
|
456
|
+
*/
|
457
|
+
source: string;
|
458
|
+
|
459
|
+
/**
|
460
|
+
* @default 'No Results'
|
461
|
+
*/
|
462
|
+
noResultsHeader: string;
|
463
|
+
|
464
|
+
/**
|
465
|
+
* @default 'Your search returned no results'
|
466
|
+
*/
|
467
|
+
noResults: string;
|
468
|
+
|
469
|
+
/**
|
470
|
+
* @default 'Error in debug logging, exiting.'
|
471
|
+
*/
|
472
|
+
logging: string;
|
473
|
+
|
474
|
+
/**
|
475
|
+
* @default 'A valid template name was not specified.'
|
476
|
+
*/
|
477
|
+
noTemplate: string;
|
478
|
+
|
479
|
+
/**
|
480
|
+
* @default 'There was an issue with querying the server.'
|
481
|
+
*/
|
482
|
+
serverError: string;
|
483
|
+
|
484
|
+
/**
|
485
|
+
* @default 'Results must be an array to use maxResults setting'
|
486
|
+
*/
|
487
|
+
maxResults: string;
|
488
|
+
|
489
|
+
/**
|
490
|
+
* @default 'The method you called is not defined.'
|
491
|
+
*/
|
492
|
+
method: string;
|
493
|
+
}
|
494
|
+
}
|
495
|
+
}
|
496
|
+
}
|