fomantic-ui 2.9.3-beta.46 → 2.9.3-beta.47
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/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +1 -1
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +1 -1
- package/dist/components/api.min.js +1 -1
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +1 -1
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +1 -1
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +1 -1
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +1 -1
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +1 -1
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- package/dist/components/emoji.css +1 -1
- package/dist/components/emoji.min.css +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +1 -1
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +1 -1
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +1 -1
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/menu.css +1 -1
- package/dist/components/menu.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +1 -1
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +1 -1
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +1 -1
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +1 -1
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- 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 +1 -1
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +1 -1
- 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 +1 -1
- package/dist/components/search.js +1 -1
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +1 -1
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -1
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +1 -1
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +1 -1
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.css +1 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- 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 +1 -1
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +1 -1
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +53 -53
- package/dist/semantic.js +26 -26
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +1 -1
- package/package.json +1 -1
- package/types/fomantic-ui-accordion.d.ts +166 -172
- package/types/fomantic-ui-api.d.ts +418 -470
- package/types/fomantic-ui-calendar.d.ts +425 -479
- package/types/fomantic-ui-checkbox.d.ts +148 -194
- package/types/fomantic-ui-dimmer.d.ts +188 -265
- package/types/fomantic-ui-dropdown.d.ts +447 -666
- package/types/fomantic-ui-embed.d.ts +243 -289
- package/types/fomantic-ui-flyout.d.ts +259 -292
- package/types/fomantic-ui-form.d.ts +478 -607
- package/types/fomantic-ui-modal.d.ts +389 -471
- package/types/fomantic-ui-nag.d.ts +228 -277
- package/types/fomantic-ui-popup.d.ts +438 -534
- package/types/fomantic-ui-progress.d.ts +278 -352
- package/types/fomantic-ui-rating.d.ts +137 -168
- package/types/fomantic-ui-search.d.ts +359 -453
- package/types/fomantic-ui-shape.d.ts +152 -194
- package/types/fomantic-ui-sidebar.d.ts +315 -391
- package/types/fomantic-ui-slider.d.ts +259 -322
- package/types/fomantic-ui-sticky.d.ts +198 -244
- package/types/fomantic-ui-tab.d.ts +284 -350
- package/types/fomantic-ui-tests.ts +4 -2
- package/types/fomantic-ui-toast.d.ts +318 -424
- package/types/fomantic-ui-transition.d.ts +223 -273
- package/types/fomantic-ui-visibility.d.ts +286 -353
- package/types/index.d.ts +0 -1
@@ -107,483 +107,389 @@ declare namespace FomanticUI {
|
|
107
107
|
*/
|
108
108
|
(behavior: 'destroy'): JQuery;
|
109
109
|
|
110
|
-
<K extends keyof SearchSettings>(behavior: 'setting', name: K, value?: undefined): SearchSettings
|
111
|
-
<K extends keyof SearchSettings>(behavior: 'setting', name: K, value: SearchSettings
|
112
|
-
(behavior: 'setting', value: SearchSettings): JQuery;
|
113
|
-
(settings?: SearchSettings): JQuery;
|
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
114
|
}
|
115
115
|
|
116
116
|
/**
|
117
117
|
* @see {@link https://fomantic-ui.com/modules/search.html#/settings}
|
118
118
|
*/
|
119
|
-
|
120
|
-
|
121
|
-
namespace SearchSettings {
|
122
|
-
type Param = (
|
123
|
-
| Pick<_Impl, 'apiSettings'>
|
124
|
-
| Pick<_Impl, 'minCharacters'>
|
125
|
-
| Pick<_Impl, 'searchOnFocus'>
|
126
|
-
| Pick<_Impl, 'transition'>
|
127
|
-
| Pick<_Impl, 'duration'>
|
128
|
-
| Pick<_Impl, 'maxResults'>
|
129
|
-
| Pick<_Impl, 'cache'>
|
130
|
-
| Pick<_Impl, 'source'>
|
131
|
-
| Pick<_Impl, 'selectFirstResult'>
|
132
|
-
| Pick<_Impl, 'showNoResults'>
|
133
|
-
| Pick<_Impl, 'fullTextSearch'>
|
134
|
-
| Pick<_Impl, 'fields'>
|
135
|
-
| Pick<_Impl, 'searchFields'>
|
136
|
-
| Pick<_Impl, 'hideDelay'>
|
137
|
-
| Pick<_Impl, 'searchDelay'>
|
138
|
-
| Pick<_Impl, 'easing'>
|
139
|
-
| Pick<_Impl, 'ignoreDiacritics'>
|
140
|
-
| Pick<_Impl, 'onSelect'>
|
141
|
-
| Pick<_Impl, 'onResultsAdd'>
|
142
|
-
| Pick<_Impl, 'onSearchQuery'>
|
143
|
-
| Pick<_Impl, 'onResults'>
|
144
|
-
| Pick<_Impl, 'onResultsOpen'>
|
145
|
-
| Pick<_Impl, 'onResultsClose'>
|
146
|
-
| Pick<_Impl, 'templates'>
|
147
|
-
| Pick<_Impl, 'selector'>
|
148
|
-
| Pick<_Impl, 'regExp'>
|
149
|
-
| Pick<_Impl, 'className'>
|
150
|
-
| Pick<_Impl, 'metadata'>
|
151
|
-
| Pick<_Impl, 'name'>
|
152
|
-
| Pick<_Impl, 'namespace'>
|
153
|
-
| Pick<_Impl, 'silent'>
|
154
|
-
| Pick<_Impl, 'debug'>
|
155
|
-
| Pick<_Impl, 'performance'>
|
156
|
-
| Pick<_Impl, 'verbose'>
|
157
|
-
| Pick<_Impl, 'error'>
|
158
|
-
) &
|
159
|
-
Partial<Pick<_Impl, keyof _Impl>>;
|
160
|
-
|
161
|
-
interface _Impl {
|
162
|
-
// region Search Settings
|
163
|
-
|
164
|
-
/**
|
165
|
-
* Settings for API call.
|
166
|
-
* @see {@link https://fomantic-ui.com/behaviors/api.html#/settings}
|
167
|
-
* @default {}
|
168
|
-
*/
|
169
|
-
apiSettings: APISettings;
|
170
|
-
|
171
|
-
/**
|
172
|
-
* Minimum characters to query for results.
|
173
|
-
* @default 1
|
174
|
-
*/
|
175
|
-
minCharacters: number;
|
176
|
-
|
177
|
-
/**
|
178
|
-
* Whether search should show results on focus (must also match min character length).
|
179
|
-
* @default true
|
180
|
-
*/
|
181
|
-
searchOnFocus: boolean;
|
182
|
-
|
183
|
-
/**
|
184
|
-
* Named transition to use when animating menu in and out.
|
185
|
-
* Fade and slide down are available without including ui transitions.
|
186
|
-
* @see {@link https://fomantic-ui.com/modules/transition.html}
|
187
|
-
* @default 'fade'
|
188
|
-
*/
|
189
|
-
transition: string;
|
190
|
-
|
191
|
-
/**
|
192
|
-
* Duration of animation events.
|
193
|
-
* @default 300
|
194
|
-
*/
|
195
|
-
duration: number;
|
196
|
-
|
197
|
-
/**
|
198
|
-
* Maximum results to display when using local and simple search, maximum category count for category search.
|
199
|
-
* @default 7
|
200
|
-
*/
|
201
|
-
maxResults: number;
|
202
|
-
|
203
|
-
/**
|
204
|
-
* Caches results locally to avoid requerying server.
|
205
|
-
* @default true
|
206
|
-
*/
|
207
|
-
cache: boolean;
|
208
|
-
|
209
|
-
/**
|
210
|
-
* Specify a Javascript object which will be searched locally.
|
211
|
-
* @default false
|
212
|
-
*/
|
213
|
-
source: boolean | object;
|
214
|
-
|
215
|
-
/**
|
216
|
-
* Whether the search should automatically select the first search result after searching.
|
217
|
-
* @default false
|
218
|
-
*/
|
219
|
-
selectFirstResult: boolean;
|
220
|
-
|
221
|
-
/**
|
222
|
-
* Whether a "no results" message should be shown if no results are found.
|
223
|
-
* @default false
|
224
|
-
*/
|
225
|
-
showNoResults: boolean;
|
226
|
-
|
227
|
-
/**
|
228
|
-
* 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.
|
229
|
-
* @default 'exact'
|
230
|
-
*/
|
231
|
-
fullTextSearch: 'exact' | boolean;
|
232
|
-
|
233
|
-
/**
|
234
|
-
* List mapping display content to JSON property, either with API or 'source'.
|
235
|
-
* @default {}
|
236
|
-
*/
|
237
|
-
fields: object;
|
238
|
-
|
239
|
-
/**
|
240
|
-
* Specify object properties inside local source object which will be searched.
|
241
|
-
* @default ['title', 'description']
|
242
|
-
*/
|
243
|
-
searchFields: string[];
|
244
|
-
|
245
|
-
/**
|
246
|
-
* Delay before hiding results after search blur.
|
247
|
-
* @default 0
|
248
|
-
*/
|
249
|
-
hideDelay: number;
|
250
|
-
|
251
|
-
/**
|
252
|
-
* Delay before querying results on inputchange.
|
253
|
-
* @default 100
|
254
|
-
*/
|
255
|
-
searchDelay: number;
|
256
|
-
|
257
|
-
/**
|
258
|
-
* Easing equation when using fallback Javascript animation.
|
259
|
-
* EaseOutExpo is included with search, for additional options you must include `easing equations`.
|
260
|
-
* @see {@link https://gsgd.co.uk/sandbox/jquery/easing/}
|
261
|
-
* @default 'easeOutExpo'
|
262
|
-
*/
|
263
|
-
easing: string;
|
264
|
-
|
265
|
-
/**
|
266
|
-
* When activated, searches will also match results for base diacritic letters.
|
267
|
-
* For example when searching for 'a', it will also match 'á' or 'â' or 'å' and so on...
|
268
|
-
* It will also ignore diacritics for the searchterm, so if searching for 'ó', it will match 'ó', but also 'o', 'ô' or 'õ' and so on...
|
269
|
-
* @default false
|
270
|
-
*/
|
271
|
-
ignoreDiacritics: boolean;
|
272
|
-
|
273
|
-
// endregion
|
274
|
-
|
275
|
-
// region Callbacks
|
276
|
-
|
277
|
-
/**
|
278
|
-
* Callback on element selection by user.
|
279
|
-
* The first parameter includes the filtered response results for that element.
|
280
|
-
* The function should return 'false' to prevent default action (closing search results and selecting value).
|
281
|
-
*/
|
282
|
-
onSelect(this: JQuery, result: object, response: object): boolean;
|
283
|
-
|
284
|
-
/**
|
285
|
-
* Callback after processing element template to add HTML to results.
|
286
|
-
* Function should return 'false' to prevent default actions.
|
287
|
-
*/
|
288
|
-
onResultsAdd(this: JQuery, html: string): boolean;
|
289
|
-
|
290
|
-
/**
|
291
|
-
* Callback on search query.
|
292
|
-
*/
|
293
|
-
onSearchQuery(this: JQuery, query: string): void;
|
294
|
-
|
295
|
-
/**
|
296
|
-
* Callback on server response.
|
297
|
-
*/
|
298
|
-
onResults(this: JQuery, response: object): void;
|
299
|
-
|
300
|
-
/**
|
301
|
-
* Callback when results are opened.
|
302
|
-
*/
|
303
|
-
onResultsOpen(this: JQuery): void;
|
304
|
-
|
305
|
-
/**
|
306
|
-
* Callback when results are closed.
|
307
|
-
*/
|
308
|
-
onResultsClose(this: JQuery): void;
|
309
|
-
|
310
|
-
// endregion
|
311
|
-
|
312
|
-
// region Template Settings
|
313
|
-
|
314
|
-
templates: Search.TemplateSettings;
|
315
|
-
|
316
|
-
// endregion
|
317
|
-
|
318
|
-
// region DOM Settings
|
319
|
-
|
320
|
-
/**
|
321
|
-
* DOM Selectors used internally.
|
322
|
-
* Selectors used to find parts of a module.
|
323
|
-
*/
|
324
|
-
selector: Search.SelectorSettings;
|
325
|
-
|
326
|
-
/**
|
327
|
-
* Regular expressions used for matching.
|
328
|
-
*/
|
329
|
-
regExp: Search.RegExpSettings;
|
330
|
-
|
331
|
-
/**
|
332
|
-
* Class names used to determine element state.
|
333
|
-
*/
|
334
|
-
className: Search.ClassNameSettings;
|
335
|
-
|
336
|
-
/**
|
337
|
-
* HTML5 metadata attributes used internally.
|
338
|
-
*/
|
339
|
-
metadata: Search.MetadataSettings;
|
340
|
-
|
341
|
-
// endregion
|
342
|
-
|
343
|
-
// region Debug Settings
|
344
|
-
|
345
|
-
/**
|
346
|
-
* Name used in log statements
|
347
|
-
*/
|
348
|
-
name: string;
|
349
|
-
|
350
|
-
/**
|
351
|
-
* Event namespace. Makes sure module teardown does not effect other events attached to an element.
|
352
|
-
*/
|
353
|
-
namespace: string;
|
354
|
-
|
355
|
-
/**
|
356
|
-
* Silences all console output including error messages, regardless of other debug settings.
|
357
|
-
*/
|
358
|
-
silent: boolean;
|
359
|
-
|
360
|
-
/**
|
361
|
-
* Debug output to console
|
362
|
-
*/
|
363
|
-
debug: boolean;
|
119
|
+
interface SearchSettings {
|
120
|
+
// region Search Settings
|
364
121
|
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
122
|
+
/**
|
123
|
+
* Settings for API call.
|
124
|
+
* @see {@link https://fomantic-ui.com/behaviors/api.html#/settings}
|
125
|
+
* @default {}
|
126
|
+
*/
|
127
|
+
apiSettings: APISettings;
|
369
128
|
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
129
|
+
/**
|
130
|
+
* Minimum characters to query for results.
|
131
|
+
* @default 1
|
132
|
+
*/
|
133
|
+
minCharacters: number;
|
374
134
|
|
375
|
-
|
135
|
+
/**
|
136
|
+
* Whether search should show results on focus (must also match min character length).
|
137
|
+
* @default true
|
138
|
+
*/
|
139
|
+
searchOnFocus: boolean;
|
376
140
|
|
377
|
-
|
378
|
-
|
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;
|
379
148
|
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
| Pick<_Impl, 'escape'>
|
386
|
-
| Pick<_Impl, 'message'>
|
387
|
-
| Pick<_Impl, 'category'>
|
388
|
-
| Pick<_Impl, 'standard'>
|
389
|
-
) &
|
390
|
-
Partial<Pick<_Impl, keyof _Impl>>;
|
391
|
-
|
392
|
-
interface _Impl {
|
393
|
-
/**
|
394
|
-
* @default function(string)
|
395
|
-
*/
|
396
|
-
escape: Function;
|
397
|
-
|
398
|
-
/**
|
399
|
-
* @default function(message, type)
|
400
|
-
*/
|
401
|
-
message: Function;
|
402
|
-
|
403
|
-
/**
|
404
|
-
* @default function(response)
|
405
|
-
*/
|
406
|
-
category: Function;
|
407
|
-
|
408
|
-
/**
|
409
|
-
* @default function(response)
|
410
|
-
*/
|
411
|
-
standard: Function;
|
412
|
-
}
|
413
|
-
}
|
149
|
+
/**
|
150
|
+
* Duration of animation events.
|
151
|
+
* @default 300
|
152
|
+
*/
|
153
|
+
duration: number;
|
414
154
|
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
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;
|
454
298
|
|
455
|
-
|
299
|
+
// endregion
|
300
|
+
|
301
|
+
// region Debug Settings
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Name used in log statements
|
305
|
+
* @default 'Search'
|
306
|
+
*/
|
307
|
+
name: string;
|
456
308
|
|
457
|
-
|
458
|
-
|
309
|
+
/**
|
310
|
+
* Event namespace. Makes sure module teardown does not effect other events attached to an element.
|
311
|
+
* @default 'search'
|
312
|
+
*/
|
313
|
+
namespace: string;
|
459
314
|
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
315
|
+
/**
|
316
|
+
* Silences all console output including error messages, regardless of other debug settings.
|
317
|
+
* @default false
|
318
|
+
*/
|
319
|
+
silent: boolean;
|
465
320
|
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
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;
|
471
373
|
}
|
472
374
|
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
*/
|
499
|
-
focus: string;
|
500
|
-
|
501
|
-
/**
|
502
|
-
* @default 'loading'
|
503
|
-
*/
|
504
|
-
loading: string;
|
505
|
-
|
506
|
-
/**
|
507
|
-
* @default 'down'
|
508
|
-
*/
|
509
|
-
pressed: string;
|
510
|
-
}
|
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;
|
511
400
|
}
|
512
401
|
|
513
|
-
|
402
|
+
interface RegExps {
|
403
|
+
/**
|
404
|
+
* @default /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g
|
405
|
+
*/
|
406
|
+
escape: RegExp;
|
514
407
|
|
515
|
-
|
516
|
-
|
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
|
+
}
|
517
440
|
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
441
|
+
interface Metadatas {
|
442
|
+
/**
|
443
|
+
* @default 'cache'
|
444
|
+
*/
|
445
|
+
cache: string;
|
523
446
|
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
}
|
447
|
+
/**
|
448
|
+
* @default 'results'
|
449
|
+
*/
|
450
|
+
results: string;
|
529
451
|
}
|
530
452
|
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
/**
|
573
|
-
* @default 'There was an issue with querying the server.'
|
574
|
-
*/
|
575
|
-
serverError: string;
|
576
|
-
|
577
|
-
/**
|
578
|
-
* @default 'Results must be an array to use maxResults setting'
|
579
|
-
*/
|
580
|
-
maxResults: string;
|
581
|
-
|
582
|
-
/**
|
583
|
-
* @default 'The method you called is not defined.'
|
584
|
-
*/
|
585
|
-
method: string;
|
586
|
-
}
|
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;
|
587
493
|
}
|
588
494
|
}
|
589
495
|
}
|