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
@@ -44,12 +44,8 @@ declare namespace FomanticUI {
|
|
44
44
|
(behavior: 'get screen size'): object;
|
45
45
|
|
46
46
|
(behavior: 'destroy'): JQuery;
|
47
|
-
<K extends keyof VisibilitySettings>(
|
48
|
-
|
49
|
-
name: K,
|
50
|
-
value?: undefined,
|
51
|
-
): VisibilitySettings._Impl[K];
|
52
|
-
<K extends keyof VisibilitySettings>(behavior: 'setting', name: K, value: VisibilitySettings._Impl[K]): JQuery;
|
47
|
+
<K extends keyof VisibilitySettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<VisibilitySettings, keyof VisibilitySettings>>;
|
48
|
+
<K extends keyof VisibilitySettings>(behavior: 'setting', name: K, value: VisibilitySettings[K]): JQuery;
|
53
49
|
(behavior: 'setting', value: VisibilitySettings): JQuery;
|
54
50
|
(settings?: VisibilitySettings): JQuery;
|
55
51
|
}
|
@@ -57,365 +53,302 @@ declare namespace FomanticUI {
|
|
57
53
|
/**
|
58
54
|
* @see {@link https://fomantic-ui.com/behaviors/visibility.html#/settings}
|
59
55
|
*/
|
60
|
-
|
61
|
-
|
62
|
-
namespace VisibilitySettings {
|
63
|
-
type Param = (
|
64
|
-
| Pick<_Impl, 'observeChanges'>
|
65
|
-
| Pick<_Impl, 'initialCheck'>
|
66
|
-
| Pick<_Impl, 'refreshOnLoad'>
|
67
|
-
| Pick<_Impl, 'refreshOnResize'>
|
68
|
-
| Pick<_Impl, 'checkOnRefresh'>
|
69
|
-
| Pick<_Impl, 'once'>
|
70
|
-
| Pick<_Impl, 'continuous'>
|
71
|
-
| Pick<_Impl, 'offset'>
|
72
|
-
| Pick<_Impl, 'includeMargin'>
|
73
|
-
| Pick<_Impl, 'context'>
|
74
|
-
| Pick<_Impl, 'throttle'>
|
75
|
-
| Pick<_Impl, 'type'>
|
76
|
-
| Pick<_Impl, 'zIndex'>
|
77
|
-
| Pick<_Impl, 'transition'>
|
78
|
-
| Pick<_Impl, 'duration'>
|
79
|
-
| Pick<_Impl, 'onOnScreen'>
|
80
|
-
| Pick<_Impl, 'onOffScreen'>
|
81
|
-
| Pick<_Impl, 'onPassing'>
|
82
|
-
| Pick<_Impl, 'onTopVisible'>
|
83
|
-
| Pick<_Impl, 'onBottomVisible'>
|
84
|
-
| Pick<_Impl, 'onTopPassed'>
|
85
|
-
| Pick<_Impl, 'onBottomPassed'>
|
86
|
-
| Pick<_Impl, 'onPassingReverse'>
|
87
|
-
| Pick<_Impl, 'onTopVisibleReverse'>
|
88
|
-
| Pick<_Impl, 'onBottomVisibleReverse'>
|
89
|
-
| Pick<_Impl, 'onTopPassedReverse'>
|
90
|
-
| Pick<_Impl, 'onBottomPassedReverse'>
|
91
|
-
| Pick<_Impl, 'onLoad'>
|
92
|
-
| Pick<_Impl, 'onAllLoaded'>
|
93
|
-
| Pick<_Impl, 'onFixed'>
|
94
|
-
| Pick<_Impl, 'onUnfixed'>
|
95
|
-
| Pick<_Impl, 'onUpdate'>
|
96
|
-
| Pick<_Impl, 'onRefresh'>
|
97
|
-
| Pick<_Impl, 'metadata'>
|
98
|
-
| Pick<_Impl, 'className'>
|
99
|
-
| Pick<_Impl, 'name'>
|
100
|
-
| Pick<_Impl, 'namespace'>
|
101
|
-
| Pick<_Impl, 'silent'>
|
102
|
-
| Pick<_Impl, 'debug'>
|
103
|
-
| Pick<_Impl, 'performance'>
|
104
|
-
| Pick<_Impl, 'verbose'>
|
105
|
-
| Pick<_Impl, 'error'>
|
106
|
-
) &
|
107
|
-
Partial<Pick<_Impl, keyof _Impl>>;
|
108
|
-
|
109
|
-
interface _Impl {
|
110
|
-
// region Visibility Settings
|
111
|
-
|
112
|
-
/**
|
113
|
-
* When set to 'false' a callback will occur each time an element passes the threshold for a condition.
|
114
|
-
* @default true
|
115
|
-
*/
|
116
|
-
once: boolean;
|
117
|
-
|
118
|
-
/**
|
119
|
-
* When set to 'true' a callback will occur anytime an element passes a condition not just immediately after the threshold is met.
|
120
|
-
* @default false
|
121
|
-
*/
|
122
|
-
continuous: boolean;
|
123
|
-
|
124
|
-
/**
|
125
|
-
* Set to 'image' to load images when on screen. Set to 'fixed' to add class name 'fixed' when passed.
|
126
|
-
* @default false
|
127
|
-
*/
|
128
|
-
type: false | 'image' | 'fixed';
|
129
|
-
|
130
|
-
/**
|
131
|
-
* Whether visibility conditions should be checked immediately on init.
|
132
|
-
* @default true
|
133
|
-
*/
|
134
|
-
initialCheck: boolean;
|
135
|
-
|
136
|
-
/**
|
137
|
-
* The scroll context visibility should use.
|
138
|
-
* @default window
|
139
|
-
*/
|
140
|
-
context: Window | string | JQuery;
|
141
|
-
|
142
|
-
/**
|
143
|
-
* Whether visibility conditions should be checked on window load.
|
144
|
-
* This ensures that after images load content positions will be updated correctly.
|
145
|
-
* @default true
|
146
|
-
*/
|
147
|
-
refreshOnLoad: boolean;
|
148
|
-
|
149
|
-
/**
|
150
|
-
* Whether visibility conditions should be checked on window resize.
|
151
|
-
* Useful when content resizes causes continuous changes in position.
|
152
|
-
* @default true
|
153
|
-
*/
|
154
|
-
refreshOnResize: boolean;
|
155
|
-
|
156
|
-
/**
|
157
|
-
* Whether visibility conditions should be checked on calls to refresh.
|
158
|
-
* These calls can be triggered from either resize, load or manually calling.
|
159
|
-
* @default true
|
160
|
-
*/
|
161
|
-
checkOnRefresh: boolean;
|
162
|
-
|
163
|
-
/**
|
164
|
-
* Specify a z-index when using type: 'fixed'.
|
165
|
-
* @default 10
|
166
|
-
*/
|
167
|
-
zIndex: number;
|
168
|
-
|
169
|
-
/**
|
170
|
-
* Value that context 'scrollTop' should be adjusted in pixels.
|
171
|
-
* Useful for making content appear below content fixed to the page.
|
172
|
-
* @default 0
|
173
|
-
*/
|
174
|
-
offset: number;
|
175
|
-
|
176
|
-
/**
|
177
|
-
* Whether element calculations should include its margin.
|
178
|
-
* @default false
|
179
|
-
*/
|
180
|
-
includeMargin: boolean;
|
181
|
-
|
182
|
-
/**
|
183
|
-
* When set to an 'integer', scroll position will be debounced using this ms value.
|
184
|
-
* 'false' will debounce with requestAnimationFrame.
|
185
|
-
* @default false
|
186
|
-
*/
|
187
|
-
throttle: boolean | number;
|
188
|
-
|
189
|
-
/**
|
190
|
-
* Whether to automatically refresh content when changes are made to the element's DOM subtree.
|
191
|
-
* @default true
|
192
|
-
*/
|
193
|
-
observeChanges: boolean;
|
194
|
-
|
195
|
-
/**
|
196
|
-
* When using type: image allows you to specify transition when showing a loaded image.
|
197
|
-
* @default false
|
198
|
-
*/
|
199
|
-
transition: false | string;
|
200
|
-
|
201
|
-
/**
|
202
|
-
* When using type: image allows you to specify transition duration.
|
203
|
-
* @default 1000
|
204
|
-
*/
|
205
|
-
duration: number;
|
206
|
-
|
207
|
-
// endregion
|
208
|
-
|
209
|
-
// region Callbacks
|
210
|
-
|
211
|
-
/**
|
212
|
-
* Any part of element is in current scroll viewport.
|
213
|
-
*/
|
214
|
-
onOnScreen(this: JQuery): void;
|
215
|
-
|
216
|
-
/**
|
217
|
-
* No part of element is in current scroll viewport.
|
218
|
-
*/
|
219
|
-
onOffScreen(this: JQuery): void;
|
220
|
-
|
221
|
-
/**
|
222
|
-
* No part of element is in current scroll viewport.
|
223
|
-
*/
|
224
|
-
onOffScreen(this: JQuery): void;
|
225
|
-
|
226
|
-
/**
|
227
|
-
* Element's top edge has passed bottom of screen.
|
228
|
-
*/
|
229
|
-
onTopVisible(this: JQuery): void;
|
230
|
-
|
231
|
-
/**
|
232
|
-
* Element's top edge has passed top of the screen.
|
233
|
-
*/
|
234
|
-
onTopPassed(this: JQuery): void;
|
235
|
-
|
236
|
-
/**
|
237
|
-
* Element's bottom edge has passed bottom of screen.
|
238
|
-
*/
|
239
|
-
onBottomVisible(this: JQuery): void;
|
240
|
-
|
241
|
-
/**
|
242
|
-
* Any part of an element is visible on screen.
|
243
|
-
*/
|
244
|
-
onPassing(this: JQuery): void;
|
245
|
-
|
246
|
-
/**
|
247
|
-
* Element's bottom edge has passed top of screen.
|
248
|
-
*/
|
249
|
-
onBottomPassed(this: JQuery): void;
|
250
|
-
|
251
|
-
/**
|
252
|
-
* Element's top edge has not passed bottom of screen.
|
253
|
-
*/
|
254
|
-
onTopVisibleReverse(this: JQuery): void;
|
255
|
-
|
256
|
-
/**
|
257
|
-
* Element's top edge has not passed top of the screen.
|
258
|
-
*/
|
259
|
-
onTopPassedReverse(this: JQuery): void;
|
260
|
-
|
261
|
-
/**
|
262
|
-
* Element's bottom edge has not passed bottom of screen.
|
263
|
-
*/
|
264
|
-
onBottomVisibleReverse(this: JQuery): void;
|
265
|
-
|
266
|
-
/**
|
267
|
-
* Element's top has not passed top of screen but bottom has.
|
268
|
-
*/
|
269
|
-
onPassingReverse(this: JQuery): void;
|
270
|
-
|
271
|
-
/**
|
272
|
-
* Element's bottom edge has not passed top of screen.
|
273
|
-
*/
|
274
|
-
onBottomPassedReverse(this: JQuery): void;
|
275
|
-
|
276
|
-
/**
|
277
|
-
* Occurs after an image has completed loading.
|
278
|
-
*/
|
279
|
-
onLoad(this: JQuery): void;
|
280
|
-
|
281
|
-
/**
|
282
|
-
* Occurs after all 'img' initialized at the same time have loaded.
|
283
|
-
*/
|
284
|
-
onAllLoaded(this: JQuery): void;
|
285
|
-
|
286
|
-
/**
|
287
|
-
* Occurs after element has been assigned position fixed.
|
288
|
-
*/
|
289
|
-
onFixed(this: JQuery): void;
|
290
|
-
|
291
|
-
/**
|
292
|
-
* Occurs after element has been removed from fixed position.
|
293
|
-
*/
|
294
|
-
onUnfixed(this: JQuery): void;
|
295
|
-
|
296
|
-
/**
|
297
|
-
* Occurs each time an elements calculations are updated.
|
298
|
-
*/
|
299
|
-
onUpdate(this: JQuery, calculations: object): void;
|
300
|
-
|
301
|
-
/**
|
302
|
-
* Occurs whenever element's visibility is refreshed.
|
303
|
-
*/
|
304
|
-
onRefresh(this: JQuery, calculations: object): void;
|
305
|
-
|
306
|
-
// endregion
|
307
|
-
|
308
|
-
// region DOM Settings
|
309
|
-
|
310
|
-
/**
|
311
|
-
* Metadata used internally.
|
312
|
-
*/
|
313
|
-
metadata: Visibility.MetadataSettings;
|
314
|
-
|
315
|
-
/**
|
316
|
-
* Class names used to determine element state.
|
317
|
-
*/
|
318
|
-
className: Visibility.ClassNameSettings;
|
319
|
-
|
320
|
-
// endregion
|
321
|
-
|
322
|
-
// region Debug Settings
|
323
|
-
|
324
|
-
/**
|
325
|
-
* Name used in log statements
|
326
|
-
* @default 'Visibility'
|
327
|
-
*/
|
328
|
-
name: string;
|
329
|
-
|
330
|
-
/**
|
331
|
-
* Event namespace. Makes sure module teardown does not effect other events attached to an element.
|
332
|
-
* @default 'visibility'
|
333
|
-
*/
|
334
|
-
namespace: string;
|
335
|
-
|
336
|
-
/**
|
337
|
-
* Silences all console output including error messages, regardless of other debug settings.
|
338
|
-
* @default false
|
339
|
-
*/
|
340
|
-
silent: boolean;
|
341
|
-
|
342
|
-
/**
|
343
|
-
* Debug output to console
|
344
|
-
* @default false
|
345
|
-
*/
|
346
|
-
debug: boolean;
|
347
|
-
|
348
|
-
/**
|
349
|
-
* Show console.table output with performance metrics
|
350
|
-
* @default true
|
351
|
-
*/
|
352
|
-
performance: boolean;
|
353
|
-
|
354
|
-
/**
|
355
|
-
* Debug output includes all internal behaviors
|
356
|
-
* @default false
|
357
|
-
*/
|
358
|
-
verbose: boolean;
|
359
|
-
|
360
|
-
error: Visibility.ErrorSettings;
|
361
|
-
|
362
|
-
// endregion
|
363
|
-
}
|
56
|
+
interface VisibilitySettings {
|
57
|
+
// region Visibility Settings
|
364
58
|
|
365
|
-
|
366
|
-
|
59
|
+
/**
|
60
|
+
* When set to 'false' a callback will occur each time an element passes the threshold for a condition.
|
61
|
+
* @default true
|
62
|
+
*/
|
63
|
+
once: boolean;
|
367
64
|
|
368
|
-
|
369
|
-
|
65
|
+
/**
|
66
|
+
* When set to 'true' a callback will occur anytime an element passes a condition not just immediately after the threshold is met.
|
67
|
+
* @default false
|
68
|
+
*/
|
69
|
+
continuous: boolean;
|
370
70
|
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
}
|
377
|
-
}
|
71
|
+
/**
|
72
|
+
* Set to 'image' to load images when on screen. Set to 'fixed' to add class name 'fixed' when passed.
|
73
|
+
* @default false
|
74
|
+
*/
|
75
|
+
type: false | 'image' | 'fixed';
|
378
76
|
|
379
|
-
|
77
|
+
/**
|
78
|
+
* Whether visibility conditions should be checked immediately on init.
|
79
|
+
* @default true
|
80
|
+
*/
|
81
|
+
initialCheck: boolean;
|
380
82
|
|
381
|
-
|
382
|
-
|
383
|
-
|
83
|
+
/**
|
84
|
+
* The scroll context visibility should use.
|
85
|
+
* @default window
|
86
|
+
*/
|
87
|
+
context: Window | string | JQuery;
|
384
88
|
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
89
|
+
/**
|
90
|
+
* Whether visibility conditions should be checked on window load.
|
91
|
+
* This ensures that after images load content positions will be updated correctly.
|
92
|
+
* @default true
|
93
|
+
*/
|
94
|
+
refreshOnLoad: boolean;
|
390
95
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
96
|
+
/**
|
97
|
+
* Whether visibility conditions should be checked on window resize.
|
98
|
+
* Useful when content resizes causes continuous changes in position.
|
99
|
+
* @default true
|
100
|
+
*/
|
101
|
+
refreshOnResize: boolean;
|
395
102
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
103
|
+
/**
|
104
|
+
* Whether visibility conditions should be checked on calls to refresh.
|
105
|
+
* These calls can be triggered from either resize, load or manually calling.
|
106
|
+
* @default true
|
107
|
+
*/
|
108
|
+
checkOnRefresh: boolean;
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Specify a z-index when using type: 'fixed'.
|
112
|
+
* @default 10
|
113
|
+
*/
|
114
|
+
zIndex: number;
|
115
|
+
|
116
|
+
/**
|
117
|
+
* Value that context 'scrollTop' should be adjusted in pixels.
|
118
|
+
* Useful for making content appear below content fixed to the page.
|
119
|
+
* @default 0
|
120
|
+
*/
|
121
|
+
offset: number;
|
122
|
+
|
123
|
+
/**
|
124
|
+
* Whether element calculations should include its margin.
|
125
|
+
* @default false
|
126
|
+
*/
|
127
|
+
includeMargin: boolean;
|
128
|
+
|
129
|
+
/**
|
130
|
+
* When set to an 'integer', scroll position will be debounced using this ms value.
|
131
|
+
* 'false' will debounce with requestAnimationFrame.
|
132
|
+
* @default false
|
133
|
+
*/
|
134
|
+
throttle: boolean | number;
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Whether to automatically refresh content when changes are made to the element's DOM subtree.
|
138
|
+
* @default true
|
139
|
+
*/
|
140
|
+
observeChanges: boolean;
|
141
|
+
|
142
|
+
/**
|
143
|
+
* When using type: image allows you to specify transition when showing a loaded image.
|
144
|
+
* @default false
|
145
|
+
*/
|
146
|
+
transition: false | string;
|
147
|
+
|
148
|
+
/**
|
149
|
+
* When using type: image allows you to specify transition duration.
|
150
|
+
* @default 1000
|
151
|
+
*/
|
152
|
+
duration: number;
|
153
|
+
|
154
|
+
// endregion
|
155
|
+
|
156
|
+
// region Callbacks
|
157
|
+
|
158
|
+
/**
|
159
|
+
* Any part of element is in current scroll viewport.
|
160
|
+
*/
|
161
|
+
onOnScreen(this: JQuery): void;
|
162
|
+
|
163
|
+
/**
|
164
|
+
* No part of element is in current scroll viewport.
|
165
|
+
*/
|
166
|
+
onOffScreen(this: JQuery): void;
|
167
|
+
|
168
|
+
/**
|
169
|
+
* No part of element is in current scroll viewport.
|
170
|
+
*/
|
171
|
+
onOffScreen(this: JQuery): void;
|
172
|
+
|
173
|
+
/**
|
174
|
+
* Element's top edge has passed bottom of screen.
|
175
|
+
*/
|
176
|
+
onTopVisible(this: JQuery): void;
|
177
|
+
|
178
|
+
/**
|
179
|
+
* Element's top edge has passed top of the screen.
|
180
|
+
*/
|
181
|
+
onTopPassed(this: JQuery): void;
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Element's bottom edge has passed bottom of screen.
|
185
|
+
*/
|
186
|
+
onBottomVisible(this: JQuery): void;
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Any part of an element is visible on screen.
|
190
|
+
*/
|
191
|
+
onPassing(this: JQuery): void;
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Element's bottom edge has passed top of screen.
|
195
|
+
*/
|
196
|
+
onBottomPassed(this: JQuery): void;
|
402
197
|
|
403
|
-
|
198
|
+
/**
|
199
|
+
* Element's top edge has not passed bottom of screen.
|
200
|
+
*/
|
201
|
+
onTopVisibleReverse(this: JQuery): void;
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Element's top edge has not passed top of the screen.
|
205
|
+
*/
|
206
|
+
onTopPassedReverse(this: JQuery): void;
|
207
|
+
|
208
|
+
/**
|
209
|
+
* Element's bottom edge has not passed bottom of screen.
|
210
|
+
*/
|
211
|
+
onBottomVisibleReverse(this: JQuery): void;
|
212
|
+
|
213
|
+
/**
|
214
|
+
* Element's top has not passed top of screen but bottom has.
|
215
|
+
*/
|
216
|
+
onPassingReverse(this: JQuery): void;
|
217
|
+
|
218
|
+
/**
|
219
|
+
* Element's bottom edge has not passed top of screen.
|
220
|
+
*/
|
221
|
+
onBottomPassedReverse(this: JQuery): void;
|
222
|
+
|
223
|
+
/**
|
224
|
+
* Occurs after an image has completed loading.
|
225
|
+
*/
|
226
|
+
onLoad(this: JQuery): void;
|
227
|
+
|
228
|
+
/**
|
229
|
+
* Occurs after all 'img' initialized at the same time have loaded.
|
230
|
+
*/
|
231
|
+
onAllLoaded(this: JQuery): void;
|
232
|
+
|
233
|
+
/**
|
234
|
+
* Occurs after element has been assigned position fixed.
|
235
|
+
*/
|
236
|
+
onFixed(this: JQuery): void;
|
237
|
+
|
238
|
+
/**
|
239
|
+
* Occurs after element has been removed from fixed position.
|
240
|
+
*/
|
241
|
+
onUnfixed(this: JQuery): void;
|
242
|
+
|
243
|
+
/**
|
244
|
+
* Occurs each time an elements calculations are updated.
|
245
|
+
*/
|
246
|
+
onUpdate(this: JQuery, calculations: object): void;
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Occurs whenever element's visibility is refreshed.
|
250
|
+
*/
|
251
|
+
onRefresh(this: JQuery, calculations: object): void;
|
252
|
+
|
253
|
+
// endregion
|
404
254
|
|
405
|
-
|
406
|
-
|
255
|
+
// region DOM Settings
|
256
|
+
|
257
|
+
/**
|
258
|
+
* Metadata used internally.
|
259
|
+
*/
|
260
|
+
metadata: Visibility.MetadataSettings;
|
261
|
+
|
262
|
+
/**
|
263
|
+
* Class names used to determine element state.
|
264
|
+
*/
|
265
|
+
className: Visibility.ClassNameSettings;
|
266
|
+
|
267
|
+
// endregion
|
268
|
+
|
269
|
+
// region Debug Settings
|
270
|
+
|
271
|
+
/**
|
272
|
+
* Name used in log statements
|
273
|
+
* @default 'Visibility'
|
274
|
+
*/
|
275
|
+
name: string;
|
276
|
+
|
277
|
+
/**
|
278
|
+
* Event namespace. Makes sure module teardown does not effect other events attached to an element.
|
279
|
+
* @default 'visibility'
|
280
|
+
*/
|
281
|
+
namespace: string;
|
282
|
+
|
283
|
+
/**
|
284
|
+
* Silences all console output including error messages, regardless of other debug settings.
|
285
|
+
* @default false
|
286
|
+
*/
|
287
|
+
silent: boolean;
|
288
|
+
|
289
|
+
/**
|
290
|
+
* Debug output to console
|
291
|
+
* @default false
|
292
|
+
*/
|
293
|
+
debug: boolean;
|
294
|
+
|
295
|
+
/**
|
296
|
+
* Show console.table output with performance metrics
|
297
|
+
* @default true
|
298
|
+
*/
|
299
|
+
performance: boolean;
|
300
|
+
|
301
|
+
/**
|
302
|
+
* Debug output includes all internal behaviors
|
303
|
+
* @default false
|
304
|
+
*/
|
305
|
+
verbose: boolean;
|
306
|
+
|
307
|
+
error: Visibility.ErrorSettings;
|
308
|
+
|
309
|
+
// endregion
|
310
|
+
}
|
311
|
+
|
312
|
+
namespace Visibility {
|
313
|
+
type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
|
314
|
+
type MetadataSettings = Partial<Pick<Settings.Metadatas, keyof Settings.Metadatas>>;
|
315
|
+
type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
|
316
|
+
|
317
|
+
namespace Settings {
|
318
|
+
interface Metadatas {
|
319
|
+
/**
|
320
|
+
* @default 'src'
|
321
|
+
*/
|
322
|
+
src: string;
|
323
|
+
}
|
324
|
+
|
325
|
+
interface ClassNames {
|
326
|
+
/**
|
327
|
+
* @default 'fixed'
|
328
|
+
*/
|
329
|
+
fixed: string;
|
330
|
+
|
331
|
+
/**
|
332
|
+
* @default 'constraint'
|
333
|
+
*/
|
334
|
+
placeholder: string;
|
335
|
+
|
336
|
+
/**
|
337
|
+
* @default 'visible'
|
338
|
+
*/
|
339
|
+
visible: string;
|
340
|
+
}
|
407
341
|
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
342
|
+
interface Errors {
|
343
|
+
/**
|
344
|
+
* @default 'The method you called is not defined.'
|
345
|
+
*/
|
346
|
+
method: string;
|
413
347
|
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
}
|
348
|
+
/**
|
349
|
+
* @default 'Element is hidden, you must call refresh after element becomes visible'
|
350
|
+
*/
|
351
|
+
visible: string;
|
419
352
|
}
|
420
353
|
}
|
421
354
|
}
|
package/types/index.d.ts
CHANGED