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.
Files changed (184) hide show
  1. package/dist/components/accordion.css +1 -1
  2. package/dist/components/accordion.js +1 -1
  3. package/dist/components/accordion.min.css +1 -1
  4. package/dist/components/accordion.min.js +1 -1
  5. package/dist/components/ad.css +1 -1
  6. package/dist/components/ad.min.css +1 -1
  7. package/dist/components/api.js +1 -1
  8. package/dist/components/api.min.js +1 -1
  9. package/dist/components/breadcrumb.css +1 -1
  10. package/dist/components/breadcrumb.min.css +1 -1
  11. package/dist/components/button.css +1 -1
  12. package/dist/components/button.min.css +1 -1
  13. package/dist/components/calendar.css +1 -1
  14. package/dist/components/calendar.js +1 -1
  15. package/dist/components/calendar.min.css +1 -1
  16. package/dist/components/calendar.min.js +1 -1
  17. package/dist/components/card.css +1 -1
  18. package/dist/components/card.min.css +1 -1
  19. package/dist/components/checkbox.css +1 -1
  20. package/dist/components/checkbox.js +1 -1
  21. package/dist/components/checkbox.min.css +1 -1
  22. package/dist/components/checkbox.min.js +1 -1
  23. package/dist/components/comment.css +1 -1
  24. package/dist/components/comment.min.css +1 -1
  25. package/dist/components/container.css +1 -1
  26. package/dist/components/container.min.css +1 -1
  27. package/dist/components/dimmer.css +1 -1
  28. package/dist/components/dimmer.js +1 -1
  29. package/dist/components/dimmer.min.css +1 -1
  30. package/dist/components/dimmer.min.js +1 -1
  31. package/dist/components/divider.css +1 -1
  32. package/dist/components/divider.min.css +1 -1
  33. package/dist/components/dropdown.css +1 -1
  34. package/dist/components/dropdown.js +1 -1
  35. package/dist/components/dropdown.min.css +1 -1
  36. package/dist/components/dropdown.min.js +1 -1
  37. package/dist/components/embed.css +1 -1
  38. package/dist/components/embed.js +1 -1
  39. package/dist/components/embed.min.css +1 -1
  40. package/dist/components/embed.min.js +1 -1
  41. package/dist/components/emoji.css +1 -1
  42. package/dist/components/emoji.min.css +1 -1
  43. package/dist/components/feed.css +1 -1
  44. package/dist/components/feed.min.css +1 -1
  45. package/dist/components/flag.css +1 -1
  46. package/dist/components/flag.min.css +1 -1
  47. package/dist/components/flyout.css +1 -1
  48. package/dist/components/flyout.js +1 -1
  49. package/dist/components/flyout.min.css +1 -1
  50. package/dist/components/flyout.min.js +1 -1
  51. package/dist/components/form.css +1 -1
  52. package/dist/components/form.js +1 -1
  53. package/dist/components/form.min.css +1 -1
  54. package/dist/components/form.min.js +1 -1
  55. package/dist/components/grid.css +1 -1
  56. package/dist/components/grid.min.css +1 -1
  57. package/dist/components/header.css +1 -1
  58. package/dist/components/header.min.css +1 -1
  59. package/dist/components/icon.css +1 -1
  60. package/dist/components/icon.min.css +1 -1
  61. package/dist/components/image.css +1 -1
  62. package/dist/components/image.min.css +1 -1
  63. package/dist/components/input.css +1 -1
  64. package/dist/components/input.min.css +1 -1
  65. package/dist/components/item.css +1 -1
  66. package/dist/components/item.min.css +1 -1
  67. package/dist/components/label.css +1 -1
  68. package/dist/components/label.min.css +1 -1
  69. package/dist/components/list.css +1 -1
  70. package/dist/components/list.min.css +1 -1
  71. package/dist/components/loader.css +1 -1
  72. package/dist/components/loader.min.css +1 -1
  73. package/dist/components/menu.css +1 -1
  74. package/dist/components/menu.min.css +1 -1
  75. package/dist/components/message.css +1 -1
  76. package/dist/components/message.min.css +1 -1
  77. package/dist/components/modal.css +1 -1
  78. package/dist/components/modal.js +1 -1
  79. package/dist/components/modal.min.css +1 -1
  80. package/dist/components/modal.min.js +1 -1
  81. package/dist/components/nag.css +1 -1
  82. package/dist/components/nag.js +1 -1
  83. package/dist/components/nag.min.css +1 -1
  84. package/dist/components/nag.min.js +1 -1
  85. package/dist/components/placeholder.css +1 -1
  86. package/dist/components/placeholder.min.css +1 -1
  87. package/dist/components/popup.css +1 -1
  88. package/dist/components/popup.js +1 -1
  89. package/dist/components/popup.min.css +1 -1
  90. package/dist/components/popup.min.js +1 -1
  91. package/dist/components/progress.css +1 -1
  92. package/dist/components/progress.js +1 -1
  93. package/dist/components/progress.min.css +1 -1
  94. package/dist/components/progress.min.js +1 -1
  95. package/dist/components/rail.css +1 -1
  96. package/dist/components/rail.min.css +1 -1
  97. package/dist/components/rating.css +1 -1
  98. package/dist/components/rating.js +1 -1
  99. package/dist/components/rating.min.css +1 -1
  100. package/dist/components/rating.min.js +1 -1
  101. package/dist/components/reset.css +1 -1
  102. package/dist/components/reset.min.css +1 -1
  103. package/dist/components/reveal.css +1 -1
  104. package/dist/components/reveal.min.css +1 -1
  105. package/dist/components/search.css +1 -1
  106. package/dist/components/search.js +1 -1
  107. package/dist/components/search.min.css +1 -1
  108. package/dist/components/search.min.js +1 -1
  109. package/dist/components/segment.css +1 -1
  110. package/dist/components/segment.min.css +1 -1
  111. package/dist/components/shape.css +1 -1
  112. package/dist/components/shape.js +1 -1
  113. package/dist/components/shape.min.css +1 -1
  114. package/dist/components/shape.min.js +1 -1
  115. package/dist/components/sidebar.css +1 -1
  116. package/dist/components/sidebar.js +1 -1
  117. package/dist/components/sidebar.min.css +1 -1
  118. package/dist/components/sidebar.min.js +1 -1
  119. package/dist/components/site.css +1 -1
  120. package/dist/components/site.js +1 -1
  121. package/dist/components/site.min.css +1 -1
  122. package/dist/components/site.min.js +1 -1
  123. package/dist/components/slider.css +1 -1
  124. package/dist/components/slider.js +1 -1
  125. package/dist/components/slider.min.css +1 -1
  126. package/dist/components/slider.min.js +1 -1
  127. package/dist/components/state.js +1 -1
  128. package/dist/components/state.min.js +1 -1
  129. package/dist/components/statistic.css +1 -1
  130. package/dist/components/statistic.min.css +1 -1
  131. package/dist/components/step.css +1 -1
  132. package/dist/components/step.min.css +1 -1
  133. package/dist/components/sticky.css +1 -1
  134. package/dist/components/sticky.js +1 -1
  135. package/dist/components/sticky.min.css +1 -1
  136. package/dist/components/sticky.min.js +1 -1
  137. package/dist/components/tab.css +1 -1
  138. package/dist/components/tab.js +1 -1
  139. package/dist/components/tab.min.css +1 -1
  140. package/dist/components/tab.min.js +1 -1
  141. package/dist/components/table.css +1 -1
  142. package/dist/components/table.min.css +1 -1
  143. package/dist/components/text.css +1 -1
  144. package/dist/components/text.min.css +1 -1
  145. package/dist/components/toast.css +1 -1
  146. package/dist/components/toast.js +1 -1
  147. package/dist/components/toast.min.css +1 -1
  148. package/dist/components/toast.min.js +1 -1
  149. package/dist/components/transition.css +1 -1
  150. package/dist/components/transition.js +1 -1
  151. package/dist/components/transition.min.css +1 -1
  152. package/dist/components/transition.min.js +1 -1
  153. package/dist/components/visibility.js +1 -1
  154. package/dist/components/visibility.min.js +1 -1
  155. package/dist/semantic.css +53 -53
  156. package/dist/semantic.js +26 -26
  157. package/dist/semantic.min.css +1 -1
  158. package/dist/semantic.min.js +1 -1
  159. package/package.json +1 -1
  160. package/types/fomantic-ui-accordion.d.ts +166 -172
  161. package/types/fomantic-ui-api.d.ts +418 -470
  162. package/types/fomantic-ui-calendar.d.ts +425 -479
  163. package/types/fomantic-ui-checkbox.d.ts +148 -194
  164. package/types/fomantic-ui-dimmer.d.ts +188 -265
  165. package/types/fomantic-ui-dropdown.d.ts +447 -666
  166. package/types/fomantic-ui-embed.d.ts +243 -289
  167. package/types/fomantic-ui-flyout.d.ts +259 -292
  168. package/types/fomantic-ui-form.d.ts +478 -607
  169. package/types/fomantic-ui-modal.d.ts +389 -471
  170. package/types/fomantic-ui-nag.d.ts +228 -277
  171. package/types/fomantic-ui-popup.d.ts +438 -534
  172. package/types/fomantic-ui-progress.d.ts +278 -352
  173. package/types/fomantic-ui-rating.d.ts +137 -168
  174. package/types/fomantic-ui-search.d.ts +359 -453
  175. package/types/fomantic-ui-shape.d.ts +152 -194
  176. package/types/fomantic-ui-sidebar.d.ts +315 -391
  177. package/types/fomantic-ui-slider.d.ts +259 -322
  178. package/types/fomantic-ui-sticky.d.ts +198 -244
  179. package/types/fomantic-ui-tab.d.ts +284 -350
  180. package/types/fomantic-ui-tests.ts +4 -2
  181. package/types/fomantic-ui-toast.d.ts +318 -424
  182. package/types/fomantic-ui-transition.d.ts +223 -273
  183. package/types/fomantic-ui-visibility.d.ts +286 -353
  184. package/types/index.d.ts +0 -1
@@ -67,552 +67,456 @@ declare namespace FomanticUI {
67
67
  */
68
68
  (behavior: 'destroy'): JQuery;
69
69
 
70
- <K extends keyof PopupSettings>(behavior: 'setting', name: K, value?: undefined): PopupSettings._Impl[K];
71
- <K extends keyof PopupSettings>(behavior: 'setting', name: K, value: PopupSettings._Impl[K]): JQuery;
72
- (behavior: 'setting', value: PopupSettings): JQuery;
73
- (settings?: PopupSettings): JQuery;
70
+ <K extends keyof PopupSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<PopupSettings, keyof PopupSettings>>;
71
+ <K extends keyof PopupSettings>(behavior: 'setting', name: K, value: PopupSettings[K]): JQuery;
72
+ (behavior: 'setting', value: Partial<Pick<PopupSettings, keyof PopupSettings>>): JQuery;
73
+ (settings?: Partial<Pick<PopupSettings, keyof PopupSettings>>): JQuery;
74
74
  }
75
75
 
76
76
  /**
77
77
  * @see {@link https://fomantic-ui.com/modules/popup.html#/settings}
78
78
  */
79
- type PopupSettings = PopupSettings.Param;
80
-
81
- namespace PopupSettings {
82
- type Param = (
83
- | Pick<_Impl, 'popup'>
84
- | Pick<_Impl, 'exclusive'>
85
- | Pick<_Impl, 'movePopup'>
86
- | Pick<_Impl, 'observeChanges'>
87
- | Pick<_Impl, 'boundary'>
88
- | Pick<_Impl, 'context'>
89
- | Pick<_Impl, 'scrollContext'>
90
- | Pick<_Impl, 'jitter'>
91
- | Pick<_Impl, 'position'>
92
- | Pick<_Impl, 'forcePosition'>
93
- | Pick<_Impl, 'inline'>
94
- | Pick<_Impl, 'preserve'>
95
- | Pick<_Impl, 'prefer'>
96
- | Pick<_Impl, 'lastResort'>
97
- | Pick<_Impl, 'on'>
98
- | Pick<_Impl, 'delay'>
99
- | Pick<_Impl, 'transition'>
100
- | Pick<_Impl, 'duration'>
101
- | Pick<_Impl, 'arrowPixelsFromEdge'>
102
- | Pick<_Impl, 'setFluidWidth'>
103
- | Pick<_Impl, 'hoverable'>
104
- | Pick<_Impl, 'closable'>
105
- | Pick<_Impl, 'addTouchEvents'>
106
- | Pick<_Impl, 'hideOnScroll'>
107
- | Pick<_Impl, 'target'>
108
- | Pick<_Impl, 'distanceAway'>
109
- | Pick<_Impl, 'offset'>
110
- | Pick<_Impl, 'maxSearchDepth'>
111
- | Pick<_Impl, 'onCreate'>
112
- | Pick<_Impl, 'onRemove'>
113
- | Pick<_Impl, 'onShow'>
114
- | Pick<_Impl, 'onVisible'>
115
- | Pick<_Impl, 'onHide'>
116
- | Pick<_Impl, 'onHidden'>
117
- | Pick<_Impl, 'onUnplaceable'>
118
- | Pick<_Impl, 'variation'>
119
- | Pick<_Impl, 'content'>
120
- | Pick<_Impl, 'title'>
121
- | Pick<_Impl, 'html'>
122
- | Pick<_Impl, 'selector'>
123
- | Pick<_Impl, 'metadata'>
124
- | Pick<_Impl, 'className'>
125
- | Pick<_Impl, 'name'>
126
- | Pick<_Impl, 'namespace'>
127
- | Pick<_Impl, 'silent'>
128
- | Pick<_Impl, 'debug'>
129
- | Pick<_Impl, 'performance'>
130
- | Pick<_Impl, 'verbose'>
131
- | Pick<_Impl, 'error'>
132
- ) &
133
- Partial<Pick<_Impl, keyof _Impl>>;
134
-
135
- interface _Impl {
136
- // region Popup Settings
137
-
138
- /**
139
- * Can specify a DOM element that should be used as the popup.
140
- * This is useful for including a pre-formatted popup.
141
- * @default false
142
- */
143
- popup: false | string;
144
-
145
- /**
146
- * Whether all other popups should be hidden when this popup is opened.
147
- * @default false
148
- */
149
- exclusive: boolean;
150
-
151
- /**
152
- * Whether to move popup to same offset container as target element when popup already exists on the page.
153
- * Using a popup inside of an element without 'overflow:visible', like a sidebar, may require you to set this to 'false'.
154
- * @default true
155
- */
156
- movePopup: boolean;
157
-
158
- /**
159
- * Whether popup should attach 'mutationObservers' to automatically run destroy when the element is removed from the page's DOM.
160
- * @default true
161
- */
162
- observeChanges: boolean;
163
-
164
- /**
165
- * When the popup surpasses the boundary of this element, it will attempt to find another display position.
166
- * @default window
167
- */
168
- boundary: Window | string;
169
-
170
- /**
171
- * Selector or jquery object specifying where the popup should be created.
172
- * @default 'body'
173
- */
174
- context: string | JQuery;
175
-
176
- /**
177
- * Will automatically hide a popup on scroll event in this context.
178
- * @default window
179
- */
180
- scrollContext: Window | string;
181
-
182
- /**
183
- * Number of pixels that a popup is allowed to appear outside the boundaries of its context.
184
- * This allows for permissible rounding errors when an element is against the edge of its 'context'.
185
- * @default 2
186
- */
187
- jitter: number;
188
-
189
- /**
190
- * Position that the popup should appear.
191
- * @default 'top left'
192
- */
193
- position: string;
194
-
195
- /**
196
- * If given position should be used, regardless if popup fits.
197
- * @default false
198
- */
199
- forcePosition: boolean;
200
-
201
- /**
202
- * If a popup is inline it will be created next to current element, allowing for local css rules to apply.
203
- * It will not be removed from the DOM after being hidden.
204
- * Otherwise popups will appended to body and removed after being hidden.
205
- * @default false
206
- */
207
- inline: boolean;
208
-
209
- /**
210
- * Whether popup contents should be preserved in the page after being hidden, allowing it to re-appear slightly faster on subsequent loads.
211
- * @default false
212
- */
213
- preserve: boolean;
214
-
215
- /**
216
- * Can be set to 'adjacent' or 'opposite' to prefer adjacent or opposite position if popup cannot fit on screen.
217
- * @default 'opposite'
218
- */
219
- prefer: 'opposite' | 'adjacent';
220
-
221
- /**
222
- * When set to 'false', a popup will not appear and produce an error message if it cannot entirely fit on page.
223
- * Setting this to a position like, 'right center' forces the popup to use this position as a last resort even if it is partially offstage.
224
- * Setting this to 'true' will use the last attempted position.
225
- * @default false
226
- */
227
- lastResort: boolean | string;
228
-
229
- /**
230
- * Event used to trigger popup.
231
- * Can be either 'focus', 'click', 'hover', or 'manual'.
232
- * Manual popups must be triggered with '$('.element').popup('show');'.
233
- * @default 'hover'
234
- */
235
- on: 'hover' | 'focus' | 'click' | 'manual';
236
-
237
- /**
238
- * Delay in milliseconds before showing or hiding a popup on hover or focus.
239
- * @default {}
240
- */
241
- delay: object; // TODO
242
-
243
- /**
244
- * Named transition to use when animating menu in and out.
245
- * Alternatively you can provide an object to set individual values for hide/show transitions as well as hide/show duration.
246
- * @default 'scale'
247
- */
248
- transition: string | object;
249
-
250
- /**
251
- * Duration of animation events.
252
- * The value will be ignored when individual hide/show duration values are provided via the 'transition' setting.
253
- * @default 200
254
- */
255
- duration: number;
256
-
257
- /**
258
- * When a target element is less than 2x this amount, the popup will appear with the arrow centered on the target element, instead of with the popup edge matching the target's edge.
259
- * @default 20
260
- */
261
- arrowPixelsFromEdge: number;
262
-
263
- /**
264
- * Whether popup should set fluid popup variation width on load to avoid 'width: 100%' including padding.
265
- * @default true
266
- */
267
- setFluidWidth: boolean;
268
-
269
- /**
270
- * Whether popup should not close on hover (useful for popup navigation menus).
271
- * @default false
272
- */
273
- hoverable: boolean;
274
-
275
- /**
276
- * Whether popup should hide when clicking on the page, 'auto' only hides for popups without on: 'hover'.
277
- * @default true
278
- */
279
- closable: boolean | 'auto';
280
-
281
- /**
282
- * When using on: 'hover' whether 'touchstart' events should be added to allow the popup to be triggered.
283
- * @default true
284
- */
285
- addTouchEvents: boolean;
286
-
287
- /**
288
- * Whether popup should hide on scroll or touchmove, 'auto' only hides for popups without on: 'click'.
289
- * Set this to 'false' to prevent mobile browsers from closing popups when you tap inside input fields.
290
- * @default 'auto'
291
- */
292
- hideOnScroll: 'auto' | boolean;
293
-
294
- /**
295
- * If a selector or jQuery object is specified this allows the popup to be positioned relative to that element.
296
- * @default false
297
- */
298
- target: false | string | JQuery;
299
-
300
- /**
301
- * Offset for distance of popup from element.
302
- * @default 0
303
- */
304
- distanceAway: number;
305
-
306
- /**
307
- * Offset in pixels from calculated position.
308
- * @default 0
309
- */
310
- offset: number;
311
-
312
- /**
313
- * Number of iterations before giving up search for popup position when a popup cannot fit on screen.
314
- * @default 15
315
- */
316
- maxSearchDepth: number;
317
-
318
- // endregion
319
-
320
- // region Callbacks
321
-
322
- /**
323
- * Callback on popup element creation, with created popup.
324
- */
325
- onCreate(this: JQuery): void;
326
-
327
- /**
328
- * Callback immediately before Popup is removed from DOM.
329
- */
330
- onRemove(this: JQuery): void;
331
-
332
- /**
333
- * Callback before popup is shown.
334
- * Returning 'false' from this callback will cancel the popup from showing.
335
- */
336
- onShow(this: JQuery): boolean;
337
-
338
- /**
339
- * Callback after popup is shown.
340
- */
341
- onVisible(this: JQuery): void;
342
-
343
- /**
344
- * Callback before popup is hidden.
345
- * Returning 'false' from this callback will cancel the popup from hiding.
346
- */
347
- onHide(this: JQuery): boolean;
348
-
349
- /**
350
- * Callback after popup is hidden.
351
- */
352
- onHidden(this: JQuery): void;
353
-
354
- /**
355
- * Callback after popup cannot be placed on screen.
356
- */
357
- onUnplaceable(this: JQuery): void;
358
-
359
- // endregion
360
-
361
- // region Content Settings
362
-
363
- /**
364
- * Popup variation to use, can use multiple variations with a space delimiter.
365
- */
366
- variation: string;
367
-
368
- /**
369
- * Content to display.
370
- */
371
- content: string;
372
-
373
- /**
374
- * Title to display alongside content.
375
- */
376
- title: string;
377
-
378
- /**
379
- * HTML content to display instead of preformatted title and content.
380
- */
381
- html: string;
382
-
383
- // endregion
384
-
385
- // region DOM Settings
386
-
387
- /**
388
- * DOM Selectors used internally.
389
- * Selectors used to find parts of a module.
390
- */
391
- selector: Popup.SelectorSettings;
392
-
393
- /**
394
- * Class names used to determine element state.
395
- */
396
- metadata: Popup.MetadataSettings;
397
-
398
- /**
399
- * Class names used to determine element state.
400
- */
401
- className: Popup.ClassNameSettings;
402
-
403
- // endregion
404
-
405
- // region Debug Settings
406
-
407
- /**
408
- * Name used in log statements
409
- */
410
- name: string;
411
-
412
- /**
413
- * Event namespace. Makes sure module teardown does not effect other events attached to an element.
414
- */
415
- namespace: string;
416
-
417
- /**
418
- * Silences all console output including error messages, regardless of other debug settings.
419
- */
420
- silent: boolean;
421
-
422
- /**
423
- * Debug output to console
424
- */
425
- debug: boolean;
426
-
427
- /**
428
- * Show console.table output with performance metrics
429
- */
430
- performance: boolean;
431
-
432
- /**
433
- * Debug output includes all internal behaviors
434
- */
435
- verbose: boolean;
436
-
437
- error: Popup.ErrorSettings;
438
-
439
- // endregion
440
- }
79
+ interface PopupSettings {
80
+ // region Popup Settings
441
81
 
442
- namespace Popup {
443
- type SelectorSettings = SelectorSettings.Param;
82
+ /**
83
+ * Can specify a DOM element that should be used as the popup.
84
+ * This is useful for including a pre-formatted popup.
85
+ * @default false
86
+ */
87
+ popup: false | string;
444
88
 
445
- namespace SelectorSettings {
446
- type Param = Pick<_Impl, 'popup'> & Partial<Pick<_Impl, keyof _Impl>>;
89
+ /**
90
+ * Whether all other popups should be hidden when this popup is opened.
91
+ * @default false
92
+ */
93
+ exclusive: boolean;
447
94
 
448
- interface _Impl {
449
- /**
450
- * @default '.ui.popup'
451
- */
452
- popup: string;
453
- }
454
- }
95
+ /**
96
+ * Whether to move popup to same offset container as target element when popup already exists on the page.
97
+ * Using a popup inside of an element without 'overflow:visible', like a sidebar, may require you to set this to 'false'.
98
+ * @default true
99
+ */
100
+ movePopup: boolean;
455
101
 
456
- type MetadataSettings = MetadataSettings.Param;
457
-
458
- namespace MetadataSettings {
459
- type Param = (
460
- | Pick<_Impl, 'activator'>
461
- | Pick<_Impl, 'content'>
462
- | Pick<_Impl, 'html'>
463
- | Pick<_Impl, 'offset'>
464
- | Pick<_Impl, 'position'>
465
- | Pick<_Impl, 'title'>
466
- | Pick<_Impl, 'variation'>
467
- ) &
468
- Partial<Pick<_Impl, keyof _Impl>>;
469
-
470
- interface _Impl {
471
- /**
472
- * @default 'activator'
473
- */
474
- activator: string;
475
-
476
- /**
477
- * @default 'content'
478
- */
479
- content: string;
480
-
481
- /**
482
- * @default 'html'
483
- */
484
- html: string;
485
-
486
- /**
487
- * @default 'offset'
488
- */
489
- offset: string;
490
-
491
- /**
492
- * @default 'position'
493
- */
494
- position: string;
495
-
496
- /**
497
- * @default 'title'
498
- */
499
- title: string;
500
-
501
- /**
502
- * @default 'variation'
503
- */
504
- variation: string;
505
- }
506
- }
102
+ /**
103
+ * Whether popup should attach 'mutationObservers' to automatically run destroy when the element is removed from the page's DOM.
104
+ * @default true
105
+ */
106
+ observeChanges: boolean;
107
+
108
+ /**
109
+ * When the popup surpasses the boundary of this element, it will attempt to find another display position.
110
+ * @default window
111
+ */
112
+ boundary: Window | string;
113
+
114
+ /**
115
+ * Selector or jquery object specifying where the popup should be created.
116
+ * @default 'body'
117
+ */
118
+ context: string | JQuery;
119
+
120
+ /**
121
+ * Will automatically hide a popup on scroll event in this context.
122
+ * @default window
123
+ */
124
+ scrollContext: Window | string;
125
+
126
+ /**
127
+ * Number of pixels that a popup is allowed to appear outside the boundaries of its context.
128
+ * This allows for permissible rounding errors when an element is against the edge of its 'context'.
129
+ * @default 2
130
+ */
131
+ jitter: number;
132
+
133
+ /**
134
+ * Position that the popup should appear.
135
+ * @default 'top left'
136
+ */
137
+ position: string;
138
+
139
+ /**
140
+ * If given position should be used, regardless if popup fits.
141
+ * @default false
142
+ */
143
+ forcePosition: boolean;
144
+
145
+ /**
146
+ * If a popup is inline it will be created next to current element, allowing for local css rules to apply.
147
+ * It will not be removed from the DOM after being hidden.
148
+ * Otherwise popups will appended to body and removed after being hidden.
149
+ * @default false
150
+ */
151
+ inline: boolean;
152
+
153
+ /**
154
+ * Whether popup contents should be preserved in the page after being hidden, allowing it to re-appear slightly faster on subsequent loads.
155
+ * @default false
156
+ */
157
+ preserve: boolean;
158
+
159
+ /**
160
+ * Can be set to 'adjacent' or 'opposite' to prefer adjacent or opposite position if popup cannot fit on screen.
161
+ * @default 'opposite'
162
+ */
163
+ prefer: 'opposite' | 'adjacent';
164
+
165
+ /**
166
+ * When set to 'false', a popup will not appear and produce an error message if it cannot entirely fit on page.
167
+ * Setting this to a position like, 'right center' forces the popup to use this position as a last resort even if it is partially offstage.
168
+ * Setting this to 'true' will use the last attempted position.
169
+ * @default false
170
+ */
171
+ lastResort: boolean | string;
172
+
173
+ /**
174
+ * Event used to trigger popup.
175
+ * Can be either 'focus', 'click', 'hover', or 'manual'.
176
+ * Manual popups must be triggered with '$('.element').popup('show');'.
177
+ * @default 'hover'
178
+ */
179
+ on: 'hover' | 'focus' | 'click' | 'manual';
180
+
181
+ /**
182
+ * Delay in milliseconds before showing or hiding a popup on hover or focus.
183
+ * @default {}
184
+ */
185
+ delay: object; // TODO
186
+
187
+ /**
188
+ * Named transition to use when animating menu in and out.
189
+ * Alternatively you can provide an object to set individual values for hide/show transitions as well as hide/show duration.
190
+ * @default 'scale'
191
+ */
192
+ transition: string | object;
193
+
194
+ /**
195
+ * Duration of animation events.
196
+ * The value will be ignored when individual hide/show duration values are provided via the 'transition' setting.
197
+ * @default 200
198
+ */
199
+ duration: number;
200
+
201
+ /**
202
+ * When a target element is less than 2x this amount, the popup will appear with the arrow centered on the target element, instead of with the popup edge matching the target's edge.
203
+ * @default 20
204
+ */
205
+ arrowPixelsFromEdge: number;
206
+
207
+ /**
208
+ * Whether popup should set fluid popup variation width on load to avoid 'width: 100%' including padding.
209
+ * @default true
210
+ */
211
+ setFluidWidth: boolean;
212
+
213
+ /**
214
+ * Whether popup should not close on hover (useful for popup navigation menus).
215
+ * @default false
216
+ */
217
+ hoverable: boolean;
218
+
219
+ /**
220
+ * Whether popup should hide when clicking on the page, 'auto' only hides for popups without on: 'hover'.
221
+ * @default true
222
+ */
223
+ closable: boolean | 'auto';
224
+
225
+ /**
226
+ * When using on: 'hover' whether 'touchstart' events should be added to allow the popup to be triggered.
227
+ * @default true
228
+ */
229
+ addTouchEvents: boolean;
230
+
231
+ /**
232
+ * Whether popup should hide on scroll or touchmove, 'auto' only hides for popups without on: 'click'.
233
+ * Set this to 'false' to prevent mobile browsers from closing popups when you tap inside input fields.
234
+ * @default 'auto'
235
+ */
236
+ hideOnScroll: 'auto' | boolean;
237
+
238
+ /**
239
+ * If a selector or jQuery object is specified this allows the popup to be positioned relative to that element.
240
+ * @default false
241
+ */
242
+ target: false | string | JQuery;
243
+
244
+ /**
245
+ * Offset for distance of popup from element.
246
+ * @default 0
247
+ */
248
+ distanceAway: number;
249
+
250
+ /**
251
+ * Offset in pixels from calculated position.
252
+ * @default 0
253
+ */
254
+ offset: number;
255
+
256
+ /**
257
+ * Number of iterations before giving up search for popup position when a popup cannot fit on screen.
258
+ * @default 15
259
+ */
260
+ maxSearchDepth: number;
261
+
262
+ // endregion
263
+
264
+ // region Callbacks
265
+
266
+ /**
267
+ * Callback on popup element creation, with created popup.
268
+ */
269
+ onCreate(this: JQuery): void;
270
+
271
+ /**
272
+ * Callback immediately before Popup is removed from DOM.
273
+ */
274
+ onRemove(this: JQuery): void;
275
+
276
+ /**
277
+ * Callback before popup is shown.
278
+ * Returning 'false' from this callback will cancel the popup from showing.
279
+ */
280
+ onShow(this: JQuery): boolean;
281
+
282
+ /**
283
+ * Callback after popup is shown.
284
+ */
285
+ onVisible(this: JQuery): void;
286
+
287
+ /**
288
+ * Callback before popup is hidden.
289
+ * Returning 'false' from this callback will cancel the popup from hiding.
290
+ */
291
+ onHide(this: JQuery): boolean;
292
+
293
+ /**
294
+ * Callback after popup is hidden.
295
+ */
296
+ onHidden(this: JQuery): void;
297
+
298
+ /**
299
+ * Callback after popup cannot be placed on screen.
300
+ */
301
+ onUnplaceable(this: JQuery): void;
302
+
303
+ // endregion
304
+
305
+ // region Content Settings
306
+
307
+ /**
308
+ * Popup variation to use, can use multiple variations with a space delimiter.
309
+ */
310
+ variation: string;
311
+
312
+ /**
313
+ * Content to display.
314
+ */
315
+ content: string;
316
+
317
+ /**
318
+ * Title to display alongside content.
319
+ */
320
+ title: string;
507
321
 
508
- type ClassNameSettings = ClassNameSettings.Param;
509
-
510
- namespace ClassNameSettings {
511
- type Param = (
512
- | Pick<_Impl, 'active'>
513
- | Pick<_Impl, 'basic'>
514
- | Pick<_Impl, 'animating'>
515
- | Pick<_Impl, 'dropdown'>
516
- | Pick<_Impl, 'fluid'>
517
- | Pick<_Impl, 'loading'>
518
- | Pick<_Impl, 'popup'>
519
- | Pick<_Impl, 'position'>
520
- | Pick<_Impl, 'visible'>
521
- | Pick<_Impl, 'popupVisible'>
522
- ) &
523
- Partial<Pick<_Impl, keyof _Impl>>;
524
-
525
- interface _Impl {
526
- /**
527
- * @default 'active'
528
- */
529
- active: string;
530
-
531
- /**
532
- * @default 'basic'
533
- */
534
- basic: string;
535
-
536
- /**
537
- * @default 'animating'
538
- */
539
- animating: string;
540
-
541
- /**
542
- * @default 'dropdown'
543
- */
544
- dropdown: string;
545
-
546
- /**
547
- * @default 'fluid'
548
- */
549
- fluid: string;
550
-
551
- /**
552
- * @default 'loading'
553
- */
554
- loading: string;
555
-
556
- /**
557
- * @default 'ui popup'
558
- */
559
- popup: string;
560
-
561
- /**
562
- * @default 'top left center bottom right'
563
- */
564
- position: string;
565
-
566
- /**
567
- * @default 'visible'
568
- */
569
- visible: string;
570
-
571
- /**
572
- * @default 'visible'
573
- */
574
- popupVisible: string;
575
- }
322
+ /**
323
+ * HTML content to display instead of preformatted title and content.
324
+ */
325
+ html: string;
326
+
327
+ // endregion
328
+
329
+ // region DOM Settings
330
+
331
+ /**
332
+ * DOM Selectors used internally.
333
+ * Selectors used to find parts of a module.
334
+ */
335
+ selector: Popup.SelectorSettings;
336
+
337
+ /**
338
+ * Class names used to determine element state.
339
+ */
340
+ metadata: Popup.MetadataSettings;
341
+
342
+ /**
343
+ * Class names used to determine element state.
344
+ */
345
+ className: Popup.ClassNameSettings;
346
+
347
+ // endregion
348
+
349
+ // region Debug Settings
350
+
351
+ /**
352
+ * Name used in log statements
353
+ * @default 'Popup'
354
+ */
355
+ name: string;
356
+
357
+ /**
358
+ * Event namespace. Makes sure module teardown does not effect other events attached to an element.
359
+ * @default 'popup'
360
+ */
361
+ namespace: string;
362
+
363
+ /**
364
+ * Silences all console output including error messages, regardless of other debug settings.
365
+ * @default false
366
+ */
367
+ silent: boolean;
368
+
369
+ /**
370
+ * Debug output to console
371
+ * @default false
372
+ */
373
+ debug: boolean;
374
+
375
+ /**
376
+ * Show console.table output with performance metrics
377
+ * @default true
378
+ */
379
+ performance: boolean;
380
+
381
+ /**
382
+ * Debug output includes all internal behaviors
383
+ * @default false
384
+ */
385
+ verbose: boolean;
386
+
387
+ error: Popup.ErrorSettings;
388
+
389
+ // endregion
390
+ }
391
+
392
+ namespace Popup {
393
+ type SelectorSettings = Partial<Pick<Settings.Selectors, keyof Settings.Selectors>>;
394
+ type MetadataSettings = Partial<Pick<Settings.Metadatas, keyof Settings.Metadatas>>;
395
+ type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
396
+ type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
397
+
398
+ namespace Settings {
399
+ interface Selectors {
400
+ /**
401
+ * @default '.ui.popup'
402
+ */
403
+ popup: string;
404
+ }
405
+
406
+ interface Metadatas {
407
+ /**
408
+ * @default 'activator'
409
+ */
410
+ activator: string;
411
+
412
+ /**
413
+ * @default 'content'
414
+ */
415
+ content: string;
416
+
417
+ /**
418
+ * @default 'html'
419
+ */
420
+ html: string;
421
+
422
+ /**
423
+ * @default 'offset'
424
+ */
425
+ offset: string;
426
+
427
+ /**
428
+ * @default 'position'
429
+ */
430
+ position: string;
431
+
432
+ /**
433
+ * @default 'title'
434
+ */
435
+ title: string;
436
+
437
+ /**
438
+ * @default 'variation'
439
+ */
440
+ variation: string;
441
+ }
442
+
443
+ interface ClassNames {
444
+ /**
445
+ * @default 'active'
446
+ */
447
+ active: string;
448
+
449
+ /**
450
+ * @default 'basic'
451
+ */
452
+ basic: string;
453
+
454
+ /**
455
+ * @default 'animating'
456
+ */
457
+ animating: string;
458
+
459
+ /**
460
+ * @default 'dropdown'
461
+ */
462
+ dropdown: string;
463
+
464
+ /**
465
+ * @default 'fluid'
466
+ */
467
+ fluid: string;
468
+
469
+ /**
470
+ * @default 'loading'
471
+ */
472
+ loading: string;
473
+
474
+ /**
475
+ * @default 'ui popup'
476
+ */
477
+ popup: string;
478
+
479
+ /**
480
+ * @default 'top left center bottom right'
481
+ */
482
+ position: string;
483
+
484
+ /**
485
+ * @default 'visible'
486
+ */
487
+ visible: string;
488
+
489
+ /**
490
+ * @default 'visible'
491
+ */
492
+ popupVisible: string;
576
493
  }
577
494
 
578
- type ErrorSettings = ErrorSettings.Param;
579
-
580
- namespace ErrorSettings {
581
- type Param = (
582
- | Pick<_Impl, 'invalidPosition'>
583
- | Pick<_Impl, 'cannotPlace'>
584
- | Pick<_Impl, 'method'>
585
- | Pick<_Impl, 'noTransition'>
586
- | Pick<_Impl, 'notFound'>
587
- ) &
588
- Partial<Pick<_Impl, keyof _Impl>>;
589
-
590
- interface _Impl {
591
- /**
592
- * @default 'The position you specified is not a valid position'
593
- */
594
- invalidPosition: string;
595
-
596
- /**
597
- * @default 'Popup does not fit within the boundaries of the viewport'
598
- */
599
- cannotPlace: string;
600
-
601
- /**
602
- * @default 'The method you called is not defined.'
603
- */
604
- method: string;
605
-
606
- /**
607
- * @default 'This module requires ui transitions'
608
- */
609
- noTransition: string;
610
-
611
- /**
612
- * @default 'The target or popup you specified does not exist on the page'
613
- */
614
- notFound: string;
615
- }
495
+ interface Errors {
496
+ /**
497
+ * @default 'The position you specified is not a valid position'
498
+ */
499
+ invalidPosition: string;
500
+
501
+ /**
502
+ * @default 'Popup does not fit within the boundaries of the viewport'
503
+ */
504
+ cannotPlace: string;
505
+
506
+ /**
507
+ * @default 'The method you called is not defined.'
508
+ */
509
+ method: string;
510
+
511
+ /**
512
+ * @default 'This module requires ui transitions'
513
+ */
514
+ noTransition: string;
515
+
516
+ /**
517
+ * @default 'The target or popup you specified does not exist on the page'
518
+ */
519
+ notFound: string;
616
520
  }
617
521
  }
618
522
  }