fomantic-ui 2.9.3-beta.9 → 2.9.4-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/.all-contributorsrc +2 -2
  2. package/.github/FUNDING.yml +1 -1
  3. package/.github/auto_assign.yml +1 -1
  4. package/.github/workflows/ci.yml +5 -5
  5. package/.github/workflows/nightly.yml +1 -1
  6. package/.github/workflows/release.yml +1 -1
  7. package/CHANGELOG.md +131 -0
  8. package/CONTRIBUTORS.md +1 -1
  9. package/README.md +5 -2
  10. package/SECURITY.md +2 -1
  11. package/dist/components/accordion.css +1 -1
  12. package/dist/components/accordion.js +2 -2
  13. package/dist/components/accordion.min.css +1 -1
  14. package/dist/components/accordion.min.js +2 -2
  15. package/dist/components/ad.css +1 -1
  16. package/dist/components/ad.min.css +1 -1
  17. package/dist/components/api.js +10 -9
  18. package/dist/components/api.min.js +2 -2
  19. package/dist/components/breadcrumb.css +1 -1
  20. package/dist/components/breadcrumb.min.css +1 -1
  21. package/dist/components/button.css +2 -2
  22. package/dist/components/button.min.css +2 -2
  23. package/dist/components/calendar.css +140 -3
  24. package/dist/components/calendar.js +2 -2
  25. package/dist/components/calendar.min.css +2 -2
  26. package/dist/components/calendar.min.js +2 -2
  27. package/dist/components/card.css +1 -1
  28. package/dist/components/card.min.css +1 -1
  29. package/dist/components/checkbox.css +50 -6
  30. package/dist/components/checkbox.js +5 -3
  31. package/dist/components/checkbox.min.css +2 -2
  32. package/dist/components/checkbox.min.js +2 -2
  33. package/dist/components/comment.css +6 -1
  34. package/dist/components/comment.min.css +2 -2
  35. package/dist/components/container.css +62 -1
  36. package/dist/components/container.min.css +2 -2
  37. package/dist/components/dimmer.css +3 -3
  38. package/dist/components/dimmer.js +2 -2
  39. package/dist/components/dimmer.min.css +2 -2
  40. package/dist/components/dimmer.min.js +2 -2
  41. package/dist/components/divider.css +1 -1
  42. package/dist/components/divider.min.css +1 -1
  43. package/dist/components/dropdown.css +101 -25
  44. package/dist/components/dropdown.js +29 -21
  45. package/dist/components/dropdown.min.css +2 -2
  46. package/dist/components/dropdown.min.js +2 -2
  47. package/dist/components/embed.css +1 -1
  48. package/dist/components/embed.js +2 -2
  49. package/dist/components/embed.min.css +1 -1
  50. package/dist/components/embed.min.js +2 -2
  51. package/dist/components/emoji.css +697 -249
  52. package/dist/components/emoji.min.css +2 -2
  53. package/dist/components/feed.css +486 -5
  54. package/dist/components/feed.min.css +2 -2
  55. package/dist/components/flag.css +3 -2
  56. package/dist/components/flag.min.css +2 -2
  57. package/dist/components/flyout.css +1 -1
  58. package/dist/components/flyout.js +2 -33
  59. package/dist/components/flyout.min.css +1 -1
  60. package/dist/components/flyout.min.js +2 -2
  61. package/dist/components/form.css +34 -32
  62. package/dist/components/form.js +72 -31
  63. package/dist/components/form.min.css +2 -2
  64. package/dist/components/form.min.js +2 -2
  65. package/dist/components/grid.css +107 -107
  66. package/dist/components/grid.min.css +2 -2
  67. package/dist/components/header.css +1 -1
  68. package/dist/components/header.min.css +1 -1
  69. package/dist/components/icon.css +62 -62
  70. package/dist/components/icon.min.css +2 -2
  71. package/dist/components/image.css +1 -1
  72. package/dist/components/image.min.css +1 -1
  73. package/dist/components/input.css +3 -27
  74. package/dist/components/input.min.css +2 -2
  75. package/dist/components/item.css +6 -1
  76. package/dist/components/item.min.css +2 -2
  77. package/dist/components/label.css +21 -2
  78. package/dist/components/label.min.css +2 -2
  79. package/dist/components/list.css +13 -13
  80. package/dist/components/list.min.css +2 -2
  81. package/dist/components/loader.css +282 -282
  82. package/dist/components/loader.min.css +2 -2
  83. package/dist/components/menu.css +13 -7
  84. package/dist/components/menu.min.css +2 -2
  85. package/dist/components/message.css +1 -1
  86. package/dist/components/message.min.css +1 -1
  87. package/dist/components/modal.css +5 -1
  88. package/dist/components/modal.js +3 -3
  89. package/dist/components/modal.min.css +2 -2
  90. package/dist/components/modal.min.js +2 -2
  91. package/dist/components/nag.css +1 -1
  92. package/dist/components/nag.js +3 -3
  93. package/dist/components/nag.min.css +1 -1
  94. package/dist/components/nag.min.js +2 -2
  95. package/dist/components/placeholder.css +1 -1
  96. package/dist/components/placeholder.min.css +1 -1
  97. package/dist/components/popup.css +3 -3
  98. package/dist/components/popup.js +11 -9
  99. package/dist/components/popup.min.css +2 -2
  100. package/dist/components/popup.min.js +2 -2
  101. package/dist/components/progress.css +1 -1
  102. package/dist/components/progress.js +2 -2
  103. package/dist/components/progress.min.css +1 -1
  104. package/dist/components/progress.min.js +2 -2
  105. package/dist/components/rail.css +1 -1
  106. package/dist/components/rail.min.css +1 -1
  107. package/dist/components/rating.css +1 -1
  108. package/dist/components/rating.js +2 -2
  109. package/dist/components/rating.min.css +1 -1
  110. package/dist/components/rating.min.js +2 -2
  111. package/dist/components/reset.css +1 -1
  112. package/dist/components/reset.min.css +1 -1
  113. package/dist/components/reveal.css +1 -1
  114. package/dist/components/reveal.min.css +1 -1
  115. package/dist/components/search.css +26 -1
  116. package/dist/components/search.js +5 -4
  117. package/dist/components/search.min.css +2 -2
  118. package/dist/components/search.min.js +2 -2
  119. package/dist/components/segment.css +159 -33
  120. package/dist/components/segment.min.css +2 -2
  121. package/dist/components/shape.css +1 -1
  122. package/dist/components/shape.js +2 -2
  123. package/dist/components/shape.min.css +1 -1
  124. package/dist/components/shape.min.js +2 -2
  125. package/dist/components/sidebar.css +1 -1
  126. package/dist/components/sidebar.js +2 -32
  127. package/dist/components/sidebar.min.css +1 -1
  128. package/dist/components/sidebar.min.js +2 -2
  129. package/dist/components/site.css +1 -1
  130. package/dist/components/site.js +2 -2
  131. package/dist/components/site.min.css +1 -1
  132. package/dist/components/site.min.js +2 -2
  133. package/dist/components/slider.css +1 -1
  134. package/dist/components/slider.js +126 -26
  135. package/dist/components/slider.min.css +1 -1
  136. package/dist/components/slider.min.js +2 -2
  137. package/dist/components/state.js +2 -2
  138. package/dist/components/state.min.js +2 -2
  139. package/dist/components/statistic.css +1 -1
  140. package/dist/components/statistic.min.css +1 -1
  141. package/dist/components/step.css +1 -1
  142. package/dist/components/step.min.css +1 -1
  143. package/dist/components/sticky.css +1 -1
  144. package/dist/components/sticky.js +2 -2
  145. package/dist/components/sticky.min.css +1 -1
  146. package/dist/components/sticky.min.js +2 -2
  147. package/dist/components/tab.css +1 -1
  148. package/dist/components/tab.js +6 -4
  149. package/dist/components/tab.min.css +1 -1
  150. package/dist/components/tab.min.js +2 -2
  151. package/dist/components/table.css +65 -1
  152. package/dist/components/table.min.css +2 -2
  153. package/dist/components/text.css +1 -1
  154. package/dist/components/text.min.css +1 -1
  155. package/dist/components/toast.css +6 -1
  156. package/dist/components/toast.js +2 -2
  157. package/dist/components/toast.min.css +2 -2
  158. package/dist/components/toast.min.js +2 -2
  159. package/dist/components/transition.css +1 -1
  160. package/dist/components/transition.js +3 -3
  161. package/dist/components/transition.min.css +1 -1
  162. package/dist/components/transition.min.js +2 -2
  163. package/dist/components/visibility.js +2 -2
  164. package/dist/components/visibility.min.js +2 -2
  165. package/dist/semantic.css +2822 -954
  166. package/dist/semantic.js +302 -206
  167. package/dist/semantic.min.css +2 -2
  168. package/dist/semantic.min.js +2 -2
  169. package/package.json +4 -3
  170. package/scripts/nightly-version.js +2 -2
  171. package/src/definitions/behaviors/api.js +9 -8
  172. package/src/definitions/behaviors/form.js +71 -30
  173. package/src/definitions/behaviors/state.js +1 -1
  174. package/src/definitions/behaviors/visibility.js +1 -1
  175. package/src/definitions/collections/form.less +9 -14
  176. package/src/definitions/collections/grid.less +106 -106
  177. package/src/definitions/collections/menu.less +29 -22
  178. package/src/definitions/collections/table.less +66 -0
  179. package/src/definitions/elements/button.less +1 -1
  180. package/src/definitions/elements/container.less +63 -0
  181. package/src/definitions/elements/icon.less +5 -5
  182. package/src/definitions/elements/input.less +2 -2
  183. package/src/definitions/elements/label.less +21 -1
  184. package/src/definitions/elements/list.less +13 -13
  185. package/src/definitions/elements/loader.less +71 -71
  186. package/src/definitions/elements/segment.less +110 -13
  187. package/src/definitions/globals/site.js +1 -1
  188. package/src/definitions/modules/accordion.js +1 -1
  189. package/src/definitions/modules/calendar.js +1 -1
  190. package/src/definitions/modules/calendar.less +40 -11
  191. package/src/definitions/modules/checkbox.js +4 -2
  192. package/src/definitions/modules/checkbox.less +61 -5
  193. package/src/definitions/modules/dimmer.js +1 -1
  194. package/src/definitions/modules/dimmer.less +2 -2
  195. package/src/definitions/modules/dropdown.js +28 -20
  196. package/src/definitions/modules/dropdown.less +124 -21
  197. package/src/definitions/modules/embed.js +1 -1
  198. package/src/definitions/modules/flyout.js +1 -32
  199. package/src/definitions/modules/modal.js +2 -2
  200. package/src/definitions/modules/modal.less +6 -0
  201. package/src/definitions/modules/nag.js +2 -2
  202. package/src/definitions/modules/popup.js +10 -8
  203. package/src/definitions/modules/popup.less +4 -4
  204. package/src/definitions/modules/progress.js +1 -1
  205. package/src/definitions/modules/rating.js +1 -1
  206. package/src/definitions/modules/search.js +4 -3
  207. package/src/definitions/modules/search.less +31 -0
  208. package/src/definitions/modules/shape.js +1 -1
  209. package/src/definitions/modules/sidebar.js +1 -31
  210. package/src/definitions/modules/slider.js +125 -25
  211. package/src/definitions/modules/sticky.js +1 -1
  212. package/src/definitions/modules/tab.js +5 -3
  213. package/src/definitions/modules/toast.js +1 -1
  214. package/src/definitions/modules/toast.less +7 -0
  215. package/src/definitions/modules/transition.js +2 -2
  216. package/src/definitions/views/comment.less +7 -0
  217. package/src/definitions/views/feed.less +238 -32
  218. package/src/definitions/views/item.less +7 -0
  219. package/src/theme.less +1 -1
  220. package/src/themes/amazon/elements/button.variables +5 -1
  221. package/src/themes/bootstrap3/elements/button.variables +5 -1
  222. package/src/themes/chubby/elements/header.variables +6 -1
  223. package/src/themes/default/collections/message.variables +3 -9
  224. package/src/themes/default/collections/table.variables +11 -8
  225. package/src/themes/default/elements/button.variables +8 -10
  226. package/src/themes/default/elements/container.variables +3 -0
  227. package/src/themes/default/elements/emoji.variables +179 -67
  228. package/src/themes/default/elements/flag.variables +1 -1
  229. package/src/themes/default/elements/label.variables +6 -1
  230. package/src/themes/default/elements/segment.variables +8 -0
  231. package/src/themes/default/globals/site.variables +362 -341
  232. package/src/themes/default/globals/variation.variables +24 -1
  233. package/src/themes/default/modules/calendar.variables +11 -0
  234. package/src/themes/default/modules/checkbox.variables +12 -0
  235. package/src/themes/default/modules/dropdown.variables +10 -4
  236. package/src/themes/default/modules/modal.variables +3 -0
  237. package/src/themes/default/modules/popup.variables +1 -1
  238. package/src/themes/default/modules/search.variables +3 -0
  239. package/src/themes/default/modules/toast.variables +6 -5
  240. package/src/themes/default/views/card.variables +4 -12
  241. package/src/themes/default/views/feed.variables +55 -1
  242. package/src/themes/default/views/item.variables +5 -5
  243. package/src/themes/flat/collections/form.variables +4 -4
  244. package/src/themes/flat/globals/site.variables +1 -1
  245. package/src/themes/github/elements/button.variables +5 -1
  246. package/src/themes/joypixels/elements/emoji.variables +182 -70
  247. package/src/themes/material/globals/site.variables +1 -1
  248. package/src/themes/twitter/elements/button.variables +5 -1
  249. package/src/themes/twitter/elements/emoji.variables +178 -66
  250. package/tasks/admin/components/create.js +1 -2
  251. package/tasks/admin/components/init.js +3 -4
  252. package/tasks/admin/components/update.js +2 -3
  253. package/tasks/admin/distributions/create.js +9 -5
  254. package/tasks/admin/distributions/init.js +3 -4
  255. package/tasks/admin/distributions/update.js +2 -3
  256. package/tasks/config/project/install.js +3 -0
  257. package/tasks/config/tasks.js +1 -8
  258. package/tasks/config/user.js +1 -1
  259. package/tasks/docs/build.js +2 -2
  260. package/tasks/docs/metadata.js +1 -1
  261. package/tasks/docs/serve.js +1 -1
  262. package/tasks/install.js +19 -10
  263. package/tasks/watch.js +1 -2
  264. package/types/fomantic-ui-accordion.d.ts +244 -0
  265. package/types/fomantic-ui-api.d.ts +555 -0
  266. package/types/fomantic-ui-calendar.d.ts +766 -0
  267. package/types/fomantic-ui-checkbox.d.ts +332 -0
  268. package/types/fomantic-ui-dimmer.d.ts +408 -0
  269. package/types/fomantic-ui-dropdown.d.ts +1183 -0
  270. package/types/fomantic-ui-embed.d.ts +326 -0
  271. package/types/fomantic-ui-flyout.d.ts +525 -0
  272. package/types/fomantic-ui-form.d.ts +651 -0
  273. package/types/fomantic-ui-modal.d.ts +471 -0
  274. package/types/fomantic-ui-nag.d.ts +270 -0
  275. package/types/fomantic-ui-popup.d.ts +523 -0
  276. package/types/fomantic-ui-progress.d.ts +459 -0
  277. package/types/fomantic-ui-rating.d.ts +187 -0
  278. package/types/fomantic-ui-search.d.ts +496 -0
  279. package/types/fomantic-ui-shape.d.ts +274 -0
  280. package/types/fomantic-ui-sidebar.d.ts +402 -0
  281. package/types/fomantic-ui-slider.d.ts +316 -0
  282. package/types/fomantic-ui-sticky.d.ts +215 -0
  283. package/types/fomantic-ui-tab.d.ts +361 -0
  284. package/types/fomantic-ui-tests.ts +25 -0
  285. package/types/fomantic-ui-toast.d.ts +514 -0
  286. package/types/fomantic-ui-transition.d.ts +355 -0
  287. package/types/fomantic-ui-visibility.d.ts +355 -0
  288. package/types/index.d.ts +63 -0
  289. package/types/tsconfig.json +23 -0
  290. package/types/tslint.json +1 -0
@@ -0,0 +1,355 @@
1
+ declare namespace FomanticUI {
2
+ interface Transition {
3
+ settings: TransitionSettings;
4
+
5
+ /**
6
+ * Stop current animation and preserve queue.
7
+ */
8
+ (behavior: 'stop'): JQuery;
9
+
10
+ /**
11
+ * Stop current animation and queued animations.
12
+ */
13
+ (behavior: 'stop all'): JQuery;
14
+
15
+ /**
16
+ * Clears all queued animations.
17
+ */
18
+ (behavior: 'clear queue'): JQuery;
19
+
20
+ /**
21
+ * Stop current animation and show element.
22
+ */
23
+ (behavior: 'show'): JQuery;
24
+
25
+ /**
26
+ * Stop current animation and hide element.
27
+ */
28
+ (behavior: 'hide'): JQuery;
29
+
30
+ /**
31
+ * Toggles between hide and show.
32
+ */
33
+ (behavior: 'toggle'): JQuery;
34
+
35
+ /**
36
+ * Forces reflow using a more expensive but stable method.
37
+ */
38
+ (behavior: 'force repaint'): JQuery;
39
+
40
+ /**
41
+ * Triggers reflow on element.
42
+ */
43
+ (behavior: 'repaint'): JQuery;
44
+
45
+ /**
46
+ * Resets all conditions changes during transition.
47
+ */
48
+ (behavior: 'reset'): JQuery;
49
+
50
+ /**
51
+ * Enables animation looping.
52
+ */
53
+ (behavior: 'looping'): JQuery;
54
+
55
+ /**
56
+ * Removes looping state from element.
57
+ */
58
+ (behavior: 'remove looping'): JQuery;
59
+
60
+ /**
61
+ * Adds disabled state (stops ability to animate).
62
+ */
63
+ (behavior: 'disable'): JQuery;
64
+
65
+ /**
66
+ * Removes disabled state.
67
+ */
68
+ (behavior: 'enable'): JQuery;
69
+
70
+ /**
71
+ * Modifies element animation duration.
72
+ */
73
+ (behavior: 'set duration', duration: number): JQuery;
74
+
75
+ /**
76
+ * Saves all class names and styles to cache to be retrieved after animation.
77
+ */
78
+ (behavior: 'save conditions'): JQuery;
79
+
80
+ /**
81
+ * Adds back cached names and styles to element.
82
+ */
83
+ (behavior: 'restore conditions'): JQuery;
84
+
85
+ /**
86
+ * Returns vendor prefixed animation property for animationname.
87
+ */
88
+ (behavior: 'get animation name'): string;
89
+
90
+ /**
91
+ * Returns vendor prefixed animation property for animationend.
92
+ */
93
+ (behavior: 'get animation event'): string;
94
+
95
+ /**
96
+ * Returns whether element is currently visible.
97
+ */
98
+ (behavior: 'is visible'): boolean;
99
+
100
+ /**
101
+ * Returns whether transition is currently occurring.
102
+ */
103
+ (behavior: 'is animating'): boolean;
104
+
105
+ /**
106
+ * Returns whether animation looping is set.
107
+ */
108
+ (behavior: 'is looping'): boolean;
109
+
110
+ /**
111
+ * Returns whether animations are supported.
112
+ */
113
+ (behavior: 'is supported'): boolean;
114
+
115
+ /**
116
+ * Destroys instance and removes all events.
117
+ */
118
+ (behavior: 'destroy'): JQuery;
119
+ <K extends keyof TransitionSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<TransitionSettings, keyof TransitionSettings>>;
120
+ <K extends keyof TransitionSettings>(behavior: 'setting', name: K, value: TransitionSettings[K]): JQuery;
121
+ (behavior: 'setting', value: Partial<Pick<TransitionSettings, keyof TransitionSettings>>): JQuery;
122
+ (settings?: Partial<Pick<TransitionSettings, keyof TransitionSettings>>): JQuery;
123
+ }
124
+
125
+ /**
126
+ * @see {@link https://fomantic-ui.com/modules/transition.html#/settings}
127
+ */
128
+ interface TransitionSettings {
129
+ // region Transition Settings
130
+
131
+ /**
132
+ * Named animation event to used.
133
+ * Must be defined in CSS.
134
+ * @default 'fade'
135
+ */
136
+ animation: string;
137
+
138
+ /**
139
+ * Interval in MS between each elements transition.
140
+ * @default 0
141
+ */
142
+ interval: number;
143
+
144
+ /**
145
+ * When an interval is specified, sets order of animations. 'auto' reverses only animations that are hiding.
146
+ * @default 'auto'
147
+ */
148
+ reverse: string | boolean;
149
+
150
+ /**
151
+ * Specify the final display type (block, inline-block etc) so that it doesn't have to be calculated.
152
+ * @default false
153
+ */
154
+ displayType: false | string;
155
+
156
+ /**
157
+ * Specify the final display type (block, inline-block etc) so that it doesn't have to be calculated.
158
+ * @default '500ms'
159
+ */
160
+ duration: string;
161
+
162
+ /**
163
+ * If enabled a 'timeout' will be added to ensure 'animationend' callback occurs even if element is hidden.
164
+ * @default true
165
+ */
166
+ useFailSafe: boolean;
167
+
168
+ /**
169
+ * If enabled will allow same animation to be queued while it is already occurring.
170
+ * @default false
171
+ */
172
+ allowRepeats: boolean;
173
+
174
+ /**
175
+ * Whether to automatically queue animation if another is occurring.
176
+ * @default true
177
+ */
178
+ queue: boolean;
179
+
180
+ /**
181
+ * Whether initially inline hidden objects should be skipped for transition.
182
+ * Useful, if you do the transition for child objects also, but want to have inline hidden children (defined by style="display:none;") still kept hidden while the parent gets animated.
183
+ * Accordion uses this.
184
+ * @default false
185
+ */
186
+ skipInlineHidden: boolean;
187
+
188
+ // endregion
189
+
190
+ // region Callbacks
191
+
192
+ /**
193
+ * Callback on each transition that changes visibility to shown.
194
+ * Returning 'false' from this callback will cancel the transition from showing.
195
+ */
196
+ onShow(this: JQuery): boolean;
197
+
198
+ /**
199
+ * Callback right before the show transition should start.
200
+ * The 'showFunction' parameter has to be called inside the callback to trigger the transition show
201
+ */
202
+ onBeforeShow(this: JQuery, showFunction: Function): void;
203
+
204
+ /**
205
+ * Callback once the show transition has finished.
206
+ */
207
+ onVisible(this: JQuery): void;
208
+
209
+ /**
210
+ * Callback on each transition that changes visibility to hidden.
211
+ * Returning 'false' from this callback will cancel the transition from hiding.
212
+ */
213
+ onHide(this: JQuery): boolean;
214
+
215
+ /**
216
+ * Callback right before the hide transition should start.
217
+ * The 'hideFunction' parameter has to be called inside the callback to trigger the transition hide.
218
+ */
219
+ onBeforeHide(this: JQuery, hideFunction: Function): void;
220
+
221
+ /**
222
+ * Callback once the transition hide has finished.
223
+ */
224
+ onHidden(this: JQuery): void;
225
+
226
+ /**
227
+ * Callback on animation start, useful for queued animations.
228
+ */
229
+ onStart(this: JQuery): void;
230
+
231
+ /**
232
+ * Callback on each transition complete.
233
+ */
234
+ onComplete(this: JQuery): void;
235
+
236
+ // endregion
237
+
238
+ // region DOM Settings
239
+
240
+ /**
241
+ * Class names used to determine element state.
242
+ */
243
+ className: Transition.ClassNameSettings;
244
+
245
+ // endregion
246
+
247
+ // region Debug Settings
248
+
249
+ /**
250
+ * Name used in log statements
251
+ * @default 'Transition'
252
+ */
253
+ name: string;
254
+
255
+ /**
256
+ * Event namespace. Makes sure module teardown does not effect other events attached to an element.
257
+ * @default 'transition'
258
+ */
259
+ namespace: string;
260
+
261
+ /**
262
+ * Silences all console output including error messages, regardless of other debug settings.
263
+ * @default false
264
+ */
265
+ silent: boolean;
266
+
267
+ /**
268
+ * Debug output to console
269
+ * @default false
270
+ */
271
+ debug: boolean;
272
+
273
+ /**
274
+ * Show console.table output with performance metrics
275
+ * @default true
276
+ */
277
+ performance: boolean;
278
+
279
+ /**
280
+ * Debug output includes all internal behaviors
281
+ * @default false
282
+ */
283
+ verbose: boolean;
284
+
285
+ errors: Transition.ErrorSettings;
286
+
287
+ // endregion
288
+ }
289
+
290
+ namespace Transition {
291
+ type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
292
+ type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
293
+
294
+ namespace Settings {
295
+ interface ClassNames {
296
+ /**
297
+ * @default 'animating'
298
+ */
299
+ animating: string;
300
+
301
+ /**
302
+ * @default 'disabled'
303
+ */
304
+ disabled: string;
305
+
306
+ /**
307
+ * @default 'hidden'
308
+ */
309
+ hidden: string;
310
+
311
+ /**
312
+ * @default 'in'
313
+ */
314
+ inward: string;
315
+
316
+ /**
317
+ * @default 'loading'
318
+ */
319
+ loading: string;
320
+
321
+ /**
322
+ * @default 'looping'
323
+ */
324
+ looping: string;
325
+
326
+ /**
327
+ * @default 'out'
328
+ */
329
+ outward: string;
330
+
331
+ /**
332
+ * @default 'transition'
333
+ */
334
+ transition: string;
335
+
336
+ /**
337
+ * @default 'visible'
338
+ */
339
+ visible: string;
340
+ }
341
+
342
+ interface Errors {
343
+ /**
344
+ * @default 'You called a rating action that was not defined'
345
+ */
346
+ noAnimation: string;
347
+
348
+ /**
349
+ * @default 'The method you called is not defined'
350
+ */
351
+ method: string;
352
+ }
353
+ }
354
+ }
355
+ }
@@ -0,0 +1,355 @@
1
+ declare namespace FomanticUI {
2
+ interface Visibility {
3
+ settings: VisibilitySettings;
4
+
5
+ /**
6
+ * Disable callbacks temporarily.
7
+ * This is useful if you need to adjust scroll position and do not want to trigger callbacks during the position change.
8
+ */
9
+ (behavior: 'disable callbacks'): JQuery;
10
+
11
+ /**
12
+ * Re-enable callbacks.
13
+ */
14
+ (behavior: 'enable callbacks'): JQuery;
15
+
16
+ /**
17
+ * Returns whether element is on screen.
18
+ */
19
+ (behavior: 'is on screen'): boolean;
20
+
21
+ /**
22
+ * Returns whether element is off screen.
23
+ */
24
+ (behavior: 'is off screen'): boolean;
25
+
26
+ /**
27
+ * Returns number of pixels passed in current element from top of element.
28
+ */
29
+ (behavior: 'get pixels passed'): number;
30
+
31
+ /**
32
+ * Returns element calculations as object.
33
+ */
34
+ (behavior: 'get element calculations'): object;
35
+
36
+ /**
37
+ * Returns screen calculations as object.
38
+ */
39
+ (behavior: 'get screen calculations'): object;
40
+
41
+ /**
42
+ * Returns screen size as object.
43
+ */
44
+ (behavior: 'get screen size'): object;
45
+
46
+ (behavior: 'destroy'): 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;
49
+ (behavior: 'setting', value: VisibilitySettings): JQuery;
50
+ (settings?: VisibilitySettings): JQuery;
51
+ }
52
+
53
+ /**
54
+ * @see {@link https://fomantic-ui.com/behaviors/visibility.html#/settings}
55
+ */
56
+ interface VisibilitySettings {
57
+ // region Visibility Settings
58
+
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;
64
+
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;
70
+
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';
76
+
77
+ /**
78
+ * Whether visibility conditions should be checked immediately on init.
79
+ * @default true
80
+ */
81
+ initialCheck: boolean;
82
+
83
+ /**
84
+ * The scroll context visibility should use.
85
+ * @default window
86
+ */
87
+ context: Window | string | JQuery;
88
+
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;
95
+
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;
102
+
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;
197
+
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
254
+
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
+ }
341
+
342
+ interface Errors {
343
+ /**
344
+ * @default 'The method you called is not defined.'
345
+ */
346
+ method: string;
347
+
348
+ /**
349
+ * @default 'Element is hidden, you must call refresh after element becomes visible'
350
+ */
351
+ visible: string;
352
+ }
353
+ }
354
+ }
355
+ }